From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- dom/canvas/CanvasGradient.h | 83 + dom/canvas/CanvasImageCache.cpp | 419 + dom/canvas/CanvasImageCache.h | 58 + dom/canvas/CanvasPath.h | 91 + dom/canvas/CanvasPattern.h | 80 + dom/canvas/CanvasRenderingContext2D.cpp | 6555 +++++ dom/canvas/CanvasRenderingContext2D.h | 1156 + dom/canvas/CanvasRenderingContextHelper.cpp | 304 + dom/canvas/CanvasRenderingContextHelper.h | 83 + dom/canvas/CanvasUtils.cpp | 130 + dom/canvas/CanvasUtils.h | 162 + dom/canvas/DocumentRendererChild.cpp | 94 + dom/canvas/DocumentRendererChild.h | 37 + dom/canvas/DocumentRendererParent.cpp | 63 + dom/canvas/DocumentRendererParent.h | 44 + dom/canvas/ImageBitmap.cpp | 2133 ++ dom/canvas/ImageBitmap.h | 290 + dom/canvas/ImageBitmapColorUtils.cpp | 2080 ++ dom/canvas/ImageBitmapColorUtils.h | 501 + dom/canvas/ImageBitmapRenderingContext.cpp | 314 + dom/canvas/ImageBitmapRenderingContext.h | 98 + dom/canvas/ImageBitmapSource.h | 21 + dom/canvas/ImageBitmapUtils.cpp | 2778 ++ dom/canvas/ImageBitmapUtils.h | 99 + dom/canvas/ImageData.cpp | 123 + dom/canvas/ImageData.h | 90 + dom/canvas/ImageUtils.cpp | 291 + dom/canvas/ImageUtils.h | 73 + dom/canvas/MurmurHash3.cpp | 340 + dom/canvas/MurmurHash3.h | 23 + dom/canvas/OffscreenCanvas.cpp | 371 + dom/canvas/OffscreenCanvas.h | 214 + dom/canvas/TexUnpackBlob.cpp | 831 + dom/canvas/TexUnpackBlob.h | 154 + dom/canvas/TextMetrics.h | 45 + dom/canvas/WebGL1Context.cpp | 52 + dom/canvas/WebGL1Context.h | 44 + dom/canvas/WebGL1ContextUniforms.cpp | 50 + dom/canvas/WebGL2Context.cpp | 187 + dom/canvas/WebGL2Context.h | 433 + dom/canvas/WebGL2ContextBuffers.cpp | 158 + dom/canvas/WebGL2ContextFramebuffers.cpp | 339 + dom/canvas/WebGL2ContextMRTs.cpp | 188 + dom/canvas/WebGL2ContextPrograms.cpp | 28 + dom/canvas/WebGL2ContextQueries.cpp | 232 + dom/canvas/WebGL2ContextRenderbuffers.cpp | 96 + dom/canvas/WebGL2ContextSamplers.cpp | 147 + dom/canvas/WebGL2ContextState.cpp | 202 + dom/canvas/WebGL2ContextSync.cpp | 136 + dom/canvas/WebGL2ContextTextures.cpp | 48 + dom/canvas/WebGL2ContextTransformFeedback.cpp | 160 + dom/canvas/WebGL2ContextUniforms.cpp | 308 + dom/canvas/WebGL2ContextVAOs.cpp | 21 + dom/canvas/WebGL2ContextVertices.cpp | 92 + dom/canvas/WebGLActiveInfo.cpp | 132 + dom/canvas/WebGLActiveInfo.h | 98 + dom/canvas/WebGLBuffer.cpp | 290 + dom/canvas/WebGLBuffer.h | 115 + dom/canvas/WebGLContext.cpp | 2480 ++ dom/canvas/WebGLContext.h | 2201 ++ dom/canvas/WebGLContextBuffers.cpp | 531 + dom/canvas/WebGLContextDraw.cpp | 1256 + dom/canvas/WebGLContextExtensions.cpp | 480 + dom/canvas/WebGLContextFramebufferOperations.cpp | 228 + dom/canvas/WebGLContextGL.cpp | 2367 ++ dom/canvas/WebGLContextLossHandler.cpp | 103 + dom/canvas/WebGLContextLossHandler.h | 44 + dom/canvas/WebGLContextNotSupported.cpp | 10 + dom/canvas/WebGLContextState.cpp | 732 + dom/canvas/WebGLContextTextures.cpp | 415 + dom/canvas/WebGLContextUnchecked.cpp | 19 + dom/canvas/WebGLContextUnchecked.h | 35 + dom/canvas/WebGLContextUtils.cpp | 877 + dom/canvas/WebGLContextUtils.h | 99 + dom/canvas/WebGLContextValidate.cpp | 816 + dom/canvas/WebGLContextVertexArray.cpp | 86 + dom/canvas/WebGLContextVertices.cpp | 344 + dom/canvas/WebGLElementArrayCache.cpp | 622 + dom/canvas/WebGLElementArrayCache.h | 101 + dom/canvas/WebGLExtensionBase.cpp | 33 + dom/canvas/WebGLExtensionBlendMinMax.cpp | 31 + dom/canvas/WebGLExtensionColorBufferFloat.cpp | 57 + dom/canvas/WebGLExtensionColorBufferHalfFloat.cpp | 51 + dom/canvas/WebGLExtensionCompressedTextureATC.cpp | 46 + dom/canvas/WebGLExtensionCompressedTextureES3.cpp | 68 + dom/canvas/WebGLExtensionCompressedTextureETC1.cpp | 44 + .../WebGLExtensionCompressedTexturePVRTC.cpp | 47 + dom/canvas/WebGLExtensionCompressedTextureS3TC.cpp | 47 + dom/canvas/WebGLExtensionDebugRendererInfo.cpp | 24 + dom/canvas/WebGLExtensionDebugShaders.cpp | 49 + dom/canvas/WebGLExtensionDepthTexture.cpp | 49 + dom/canvas/WebGLExtensionDisjointTimerQuery.cpp | 129 + dom/canvas/WebGLExtensionDrawBuffers.cpp | 69 + dom/canvas/WebGLExtensionEXTColorBufferFloat.cpp | 51 + dom/canvas/WebGLExtensionElementIndexUint.cpp | 25 + dom/canvas/WebGLExtensionFragDepth.cpp | 34 + dom/canvas/WebGLExtensionInstancedArrays.cpp | 78 + dom/canvas/WebGLExtensionLoseContext.cpp | 36 + dom/canvas/WebGLExtensionSRGB.cpp | 72 + dom/canvas/WebGLExtensionShaderTextureLod.cpp | 25 + dom/canvas/WebGLExtensionStandardDerivatives.cpp | 25 + .../WebGLExtensionTextureFilterAnisotropic.cpp | 25 + dom/canvas/WebGLExtensionTextureFloat.cpp | 122 + dom/canvas/WebGLExtensionTextureFloatLinear.cpp | 32 + dom/canvas/WebGLExtensionTextureHalfFloat.cpp | 129 + .../WebGLExtensionTextureHalfFloatLinear.cpp | 32 + dom/canvas/WebGLExtensionVertexArray.cpp | 63 + dom/canvas/WebGLExtensions.h | 390 + dom/canvas/WebGLFormats.cpp | 1126 + dom/canvas/WebGLFormats.h | 349 + dom/canvas/WebGLFramebuffer.cpp | 1952 ++ dom/canvas/WebGLFramebuffer.h | 295 + dom/canvas/WebGLFramebufferAttachable.cpp | 43 + dom/canvas/WebGLFramebufferAttachable.h | 27 + dom/canvas/WebGLInternalFormatsTable.h | 82 + dom/canvas/WebGLMemoryTracker.cpp | 261 + dom/canvas/WebGLMemoryTracker.h | 80 + dom/canvas/WebGLObjectModel.cpp | 25 + dom/canvas/WebGLObjectModel.h | 365 + dom/canvas/WebGLProgram.cpp | 1645 ++ dom/canvas/WebGLProgram.h | 217 + dom/canvas/WebGLQuery.cpp | 270 + dom/canvas/WebGLQuery.h | 69 + dom/canvas/WebGLRenderbuffer.cpp | 302 + dom/canvas/WebGLRenderbuffer.h | 94 + dom/canvas/WebGLSampler.cpp | 214 + dom/canvas/WebGLSampler.h | 56 + dom/canvas/WebGLShader.cpp | 465 + dom/canvas/WebGLShader.h | 107 + dom/canvas/WebGLShaderPrecisionFormat.cpp | 21 + dom/canvas/WebGLShaderPrecisionFormat.h | 53 + dom/canvas/WebGLShaderValidator.cpp | 604 + dom/canvas/WebGLShaderValidator.h | 77 + dom/canvas/WebGLStrongTypes.h | 457 + dom/canvas/WebGLSync.cpp | 53 + dom/canvas/WebGLSync.h | 41 + dom/canvas/WebGLTexelConversions.cpp | 435 + dom/canvas/WebGLTexelConversions.h | 1345 + dom/canvas/WebGLTexture.cpp | 1226 + dom/canvas/WebGLTexture.h | 444 + dom/canvas/WebGLTextureUpload.cpp | 2242 ++ dom/canvas/WebGLTransformFeedback.cpp | 214 + dom/canvas/WebGLTransformFeedback.h | 66 + dom/canvas/WebGLTypes.h | 176 + dom/canvas/WebGLUniformLocation.cpp | 318 + dom/canvas/WebGLUniformLocation.h | 73 + dom/canvas/WebGLValidateStrings.cpp | 169 + dom/canvas/WebGLValidateStrings.h | 156 + dom/canvas/WebGLVertexArray.cpp | 81 + dom/canvas/WebGLVertexArray.h | 73 + dom/canvas/WebGLVertexArrayFake.cpp | 70 + dom/canvas/WebGLVertexArrayFake.h | 36 + dom/canvas/WebGLVertexArrayGL.cpp | 62 + dom/canvas/WebGLVertexArrayGL.h | 37 + dom/canvas/WebGLVertexArrayObject.cpp | 37 + dom/canvas/WebGLVertexArrayObject.h | 42 + dom/canvas/WebGLVertexAttribData.cpp | 98 + dom/canvas/WebGLVertexAttribData.h | 78 + dom/canvas/crashtests/0px-size-font-667225.html | 19 + dom/canvas/crashtests/0px-size-font-shadow.html | 17 + dom/canvas/crashtests/1099143-1.html | 5 + dom/canvas/crashtests/1161277-1.html | 22 + dom/canvas/crashtests/1183363.html | 23 + dom/canvas/crashtests/1190705.html | 17 + dom/canvas/crashtests/1223740-1.html | 22 + dom/canvas/crashtests/1225381-1.html | 17 + dom/canvas/crashtests/1229932-1.html | 16 + dom/canvas/crashtests/1229983-1.html | 24 + dom/canvas/crashtests/1233613.html | 19 + dom/canvas/crashtests/1244850-1.html | 22 + dom/canvas/crashtests/1246775-1.html | 15 + dom/canvas/crashtests/1283113-1.html | 25 + dom/canvas/crashtests/1284356-1.html | 9 + dom/canvas/crashtests/1284578-1.html | 8 + dom/canvas/crashtests/1286458-1.html | 20 + dom/canvas/crashtests/1287515-1.html | 7 + dom/canvas/crashtests/1287652-1.html | 8 + dom/canvas/crashtests/1288872-1.html | 6 + dom/canvas/crashtests/1290628-1.html | 13 + dom/canvas/crashtests/1298576-1.html | 21 + dom/canvas/crashtests/1299062-1.html | 5 + dom/canvas/crashtests/1305312-1.html | 5 + dom/canvas/crashtests/1334647-1.html | 8 + dom/canvas/crashtests/1357092.html | 10 + dom/canvas/crashtests/360293-1.html | 35 + dom/canvas/crashtests/421715-1.html | 41 + dom/canvas/crashtests/553938-1.html | 20 + dom/canvas/crashtests/647480.html | 104 + dom/canvas/crashtests/727547.html | 7 + dom/canvas/crashtests/729116.html | 18 + dom/canvas/crashtests/743499-negative-size.html | 22 + dom/canvas/crashtests/745699-1.html | 25 + dom/canvas/crashtests/745818-large-source.html | 21 + dom/canvas/crashtests/746813-1.html | 6 + dom/canvas/crashtests/767337-1.html | 21 + dom/canvas/crashtests/779426.html | 19 + dom/canvas/crashtests/780392-1.html | 10 + dom/canvas/crashtests/789933-1.html | 13 + dom/canvas/crashtests/794463-1.html | 17 + dom/canvas/crashtests/802926-1.html | 6 + dom/canvas/crashtests/896047-1.html | 17 + dom/canvas/crashtests/896047-2.html | 19 + dom/canvas/crashtests/916128-1.html | 13 + dom/canvas/crashtests/934939-1.html | 8 + dom/canvas/crashtests/crashtests.list | 44 + dom/canvas/crashtests/texImage2D.html | 8 + dom/canvas/gtest/TestImageBitmapColorUtils.cpp | 2585 ++ dom/canvas/gtest/TestWebGLElementArrayCache.cpp | 206 + dom/canvas/gtest/moz.build | 17 + dom/canvas/moz.build | 202 + dom/canvas/nsICanvasRenderingContextInternal.h | 194 + dom/canvas/test/android.json | 6 + dom/canvas/test/captureStream_common.js | 250 + dom/canvas/test/chrome/chrome.ini | 8 + .../nonchrome_webgl_debug_renderer_info.html | 83 + .../test/chrome/test_drawWindow_widget_layers.html | 54 + .../chrome/test_webgl_debug_renderer_info.html | 102 + dom/canvas/test/crash/1251091-1.png | Bin 0 -> 95370 bytes dom/canvas/test/crash/file_1251091-1.html | 51 + dom/canvas/test/crash/file_616401.html | 8 + dom/canvas/test/crash/file_798802-1.html | 18 + dom/canvas/test/crash/file_bug1233613.html | 19 + dom/canvas/test/crash/file_texImage2D.html | 8 + dom/canvas/test/crash/mochitest.ini | 16 + dom/canvas/test/crash/test_1251091-1.html | 30 + dom/canvas/test/crash/test_616401.html | 30 + dom/canvas/test/crash/test_798802-1.html | 30 + dom/canvas/test/crash/test_bug1233613.html | 30 + .../test/crash/test_createImageBitmap-video.html | 34 + dom/canvas/test/crash/test_texImage2D.html | 30 + .../test/crossorigin/image-allow-credentials.png | Bin 0 -> 844 bytes .../image-allow-credentials.png^headers^ | 2 + dom/canvas/test/crossorigin/image-allow-star.png | Bin 0 -> 844 bytes .../test/crossorigin/image-allow-star.png^headers^ | 1 + dom/canvas/test/crossorigin/image.png | Bin 0 -> 844 bytes dom/canvas/test/crossorigin/mochitest.ini | 15 + .../crossorigin/test_canvas2d_crossorigin.html | 212 + .../test/crossorigin/test_video_crossorigin.html | 219 + .../test_webgl_crossorigin_textures.html | 143 + dom/canvas/test/crossorigin/video.sjs | 43 + .../test/file_drawImage_document_domain.html | 30 + dom/canvas/test/file_drawWindow_common.js | 159 + dom/canvas/test/file_drawWindow_source.html | 10 + dom/canvas/test/image_anim-gr.gif | Bin 0 -> 241 bytes dom/canvas/test/image_anim-gr.png | Bin 0 -> 460 bytes dom/canvas/test/image_anim-poster-gr.png | Bin 0 -> 422 bytes dom/canvas/test/image_broken.png | Bin 0 -> 87 bytes dom/canvas/test/image_error-early.png | 1 + dom/canvas/test/image_ggrr-256x256.png | Bin 0 -> 120 bytes dom/canvas/test/image_green-16x16.png | Bin 0 -> 92 bytes dom/canvas/test/image_green-1x1.png | Bin 0 -> 82 bytes dom/canvas/test/image_green-redirect | 0 dom/canvas/test/image_green-redirect^headers^ | 2 + dom/canvas/test/image_green.png | Bin 0 -> 87 bytes dom/canvas/test/image_red-16x16.png | Bin 0 -> 130 bytes dom/canvas/test/image_red.png | Bin 0 -> 87 bytes .../test/image_red_crossorigin_credentials.png | Bin 0 -> 87 bytes .../image_red_crossorigin_credentials.png^headers^ | 2 + dom/canvas/test/image_redtransparent.png | Bin 0 -> 109 bytes dom/canvas/test/image_rgrg-256x256.png | Bin 0 -> 131 bytes dom/canvas/test/image_rrgg-256x256.png | Bin 0 -> 120 bytes dom/canvas/test/image_transparent.png | Bin 0 -> 100 bytes dom/canvas/test/image_transparent50.png | Bin 0 -> 155 bytes dom/canvas/test/image_yellow.png | Bin 0 -> 95 bytes dom/canvas/test/image_yellow75.png | Bin 0 -> 150 bytes dom/canvas/test/imagebitmap_bug1239300.js | 19 + dom/canvas/test/imagebitmap_bug1239752.js | 85 + dom/canvas/test/imagebitmap_extensions.html | 49 + dom/canvas/test/imagebitmap_extensions.js | 526 + dom/canvas/test/imagebitmap_extensions_data.js | 1066 + .../test/imagebitmap_extensions_on_worker.js | 47 + .../test/imagebitmap_extensions_prepareSources.js | 94 + dom/canvas/test/imagebitmap_on_worker.js | 86 + dom/canvas/test/imagebitmap_structuredclone.js | 35 + .../test/imagebitmap_structuredclone_iframe.html | 38 + .../test/imagebitmap_structuredclone_utils.js | 157 + dom/canvas/test/mochitest.ini | 303 + dom/canvas/test/offscreencanvas.js | 364 + dom/canvas/test/offscreencanvas_mask.svg | 11 + dom/canvas/test/offscreencanvas_neuter.js | 1 + .../test/offscreencanvas_serviceworker_inner.html | 32 + .../reftest/1177726-text-stroke-bounds-ref.html | 24 + .../test/reftest/1177726-text-stroke-bounds.html | 28 + dom/canvas/test/reftest/black.html | 9 + dom/canvas/test/reftest/capturestream.html | 35 + .../test/reftest/clip-multiple-move-1-ref.html | 22 + dom/canvas/test/reftest/clip-multiple-move-1.html | 27 + .../test/reftest/clip-multiple-move-2-ref.html | 13 + dom/canvas/test/reftest/clip-multiple-move-2.html | 32 + .../test/reftest/clip-multiple-paths-badref.html | 22 + dom/canvas/test/reftest/clip-multiple-paths.html | 27 + dom/canvas/test/reftest/colors-no-alpha.png | Bin 0 -> 439 bytes dom/canvas/test/reftest/colors-non-premult.png | Bin 0 -> 444 bytes dom/canvas/test/reftest/colors-premult.png | Bin 0 -> 441 bytes .../test/reftest/drawCustomFocusRing-ref.html | 18 + dom/canvas/test/reftest/drawCustomFocusRing.html | 32 + dom/canvas/test/reftest/drawFocusIfNeeded-ref.html | 18 + dom/canvas/test/reftest/drawFocusIfNeeded.html | 28 + dom/canvas/test/reftest/filters/default-color.html | 16 + .../reftest/filters/drop-shadow-transformed.html | 17 + dom/canvas/test/reftest/filters/drop-shadow.html | 16 + .../fillText-with-filter-grayscale-1-ref.html | 12 + .../filters/fillText-with-filter-grayscale-1.html | 13 + .../fillText-with-filter-grayscale-2-ref.html | 13 + .../filters/fillText-with-filter-grayscale-2.html | 14 + .../fillText-with-filter-opacity-1-ref.html | 13 + .../filters/fillText-with-filter-opacity-1.html | 13 + .../fillText-with-filter-opacity-2-ref.html | 13 + .../filters/fillText-with-filter-opacity-2.html | 14 + .../reftest/filters/fillText-with-shadow-1.html | 14 + .../reftest/filters/fillText-with-shadow-2.html | 15 + .../filters/fillText-without-shadow-1-ref.html | 12 + .../filters/fillText-without-shadow-2-ref.html | 13 + .../test/reftest/filters/global-alpha-ref.html | 18 + dom/canvas/test/reftest/filters/global-alpha.html | 17 + .../filters/global-composite-operation-ref.html | 26 + .../filters/global-composite-operation.html | 21 + dom/canvas/test/reftest/filters/liveness.html | 18 + .../reftest/filters/multiple-drop-shadows.html | 16 + dom/canvas/test/reftest/filters/ref.html | 17 + dom/canvas/test/reftest/filters/reftest-stylo.list | 21 + dom/canvas/test/reftest/filters/reftest.list | 30 + dom/canvas/test/reftest/filters/shadow-ref.html | 19 + dom/canvas/test/reftest/filters/shadow.html | 18 + .../strokeText-with-filter-grayscale-1-ref.html | 12 + .../strokeText-with-filter-grayscale-1.html | 13 + .../strokeText-with-filter-grayscale-2-ref.html | 13 + .../strokeText-with-filter-grayscale-2.html | 14 + .../reftest/filters/strokeText-with-shadow-1.html | 14 + .../reftest/filters/strokeText-with-shadow-2.html | 15 + .../filters/strokeText-without-shadow-1-ref.html | 12 + .../filters/strokeText-without-shadow-2-ref.html | 13 + .../test/reftest/filters/subregion-fill-paint.html | 27 + dom/canvas/test/reftest/filters/subregion-ref.html | 15 + .../reftest/filters/subregion-stroke-paint.html | 27 + dom/canvas/test/reftest/filters/svg-bbox-ref.html | 15 + dom/canvas/test/reftest/filters/svg-bbox.html | 27 + dom/canvas/test/reftest/filters/svg-inline.html | 30 + dom/canvas/test/reftest/filters/svg-liveness.html | 64 + .../test/reftest/filters/svg-off-screen.html | 33 + dom/canvas/test/reftest/filters/units-em.html | 21 + dom/canvas/test/reftest/filters/units-ex.html | 17 + .../test/reftest/filters/units-off-screen.html | 21 + dom/canvas/test/reftest/filters/units-pt.html | 16 + dom/canvas/test/reftest/filters/units.html | 16 + dom/canvas/test/reftest/green.png | Bin 0 -> 1358 bytes .../test/reftest/mozCurrentTransform-ref.html | 15 + dom/canvas/test/reftest/mozCurrentTransform.html | 22 + .../test/reftest/mozCurrentTransformInverse.html | 22 + dom/canvas/test/reftest/reftest-stylo.list | 169 + dom/canvas/test/reftest/reftest.list | 173 + dom/canvas/test/reftest/stroketext-shadow-ref.html | 19 + dom/canvas/test/reftest/stroketext-shadow.html | 20 + .../test/reftest/webgl-capturestream-test.html | 50 + dom/canvas/test/reftest/webgl-clear-test.html | 40 + dom/canvas/test/reftest/webgl-color-test.html | 123 + dom/canvas/test/reftest/webgl-disable-test.html | 60 + dom/canvas/test/reftest/webgl-hanging-fb-test.html | 58 + .../test/reftest/webgl-hanging-scissor-test.html | 57 + dom/canvas/test/reftest/webgl-resize-test.html | 58 + dom/canvas/test/reftest/webgl-utils.js | 82 + dom/canvas/test/reftest/white.png | Bin 0 -> 1401 bytes dom/canvas/test/reftest/wrapper.html | 27 + .../test/test_2d.clearRect.image.offscreen.html | 42 + dom/canvas/test/test_2d.clip.winding.html | 52 + .../test/test_2d.composite.canvas.color-burn.html | 44 + .../test/test_2d.composite.canvas.color-dodge.html | 44 + .../test/test_2d.composite.canvas.color.html | 44 + .../test/test_2d.composite.canvas.darken.html | 44 + .../test_2d.composite.canvas.destination-atop.html | 44 + .../test_2d.composite.canvas.destination-in.html | 44 + .../test/test_2d.composite.canvas.difference.html | 44 + .../test/test_2d.composite.canvas.exclusion.html | 44 + .../test/test_2d.composite.canvas.hard-light.html | 44 + dom/canvas/test/test_2d.composite.canvas.hue.html | 44 + .../test/test_2d.composite.canvas.lighten.html | 44 + .../test/test_2d.composite.canvas.lighter.html | 44 + .../test/test_2d.composite.canvas.luminosity.html | 44 + .../test/test_2d.composite.canvas.multiply.html | 44 + .../test/test_2d.composite.canvas.overlay.html | 44 + .../test/test_2d.composite.canvas.saturation.html | 44 + .../test/test_2d.composite.canvas.screen.html | 44 + .../test/test_2d.composite.canvas.soft-light.html | 44 + .../test/test_2d.composite.canvas.source-in.html | 44 + .../test/test_2d.composite.canvas.source-out.html | 44 + dom/canvas/test/test_2d.composite.canvas.xor.html | 44 + .../test/test_2d.composite.clip.lighter.html | 43 + dom/canvas/test/test_2d.composite.clip.xor.html | 43 + .../test_2d.composite.image.destination-atop.html | 39 + .../test_2d.composite.image.destination-in.html | 39 + .../test/test_2d.composite.image.lighter.html | 39 + .../test/test_2d.composite.image.source-in.html | 39 + .../test/test_2d.composite.image.source-out.html | 39 + dom/canvas/test/test_2d.composite.image.xor.html | 39 + .../test/test_2d.composite.solid.color-burn.html | 39 + .../test/test_2d.composite.solid.color-dodge.html | 39 + dom/canvas/test/test_2d.composite.solid.color.html | 39 + .../test/test_2d.composite.solid.darken.html | 39 + .../test/test_2d.composite.solid.difference.html | 39 + .../test/test_2d.composite.solid.exclusion.html | 39 + .../test/test_2d.composite.solid.hard-light.html | 39 + dom/canvas/test/test_2d.composite.solid.hue.html | 39 + .../test/test_2d.composite.solid.lighten.html | 39 + .../test/test_2d.composite.solid.lighter.html | 39 + .../test/test_2d.composite.solid.luminosity.html | 39 + .../test/test_2d.composite.solid.multiply.html | 39 + .../test/test_2d.composite.solid.overlay.html | 39 + .../test/test_2d.composite.solid.saturation.html | 39 + .../test/test_2d.composite.solid.screen.html | 39 + .../test/test_2d.composite.solid.soft-light.html | 39 + dom/canvas/test/test_2d.composite.solid.xor.html | 39 + .../test_2d.composite.transparent.lighter.html | 39 + .../test/test_2d.composite.transparent.xor.html | 39 + ...est_2d.composite.uncovered.fill.color-burn.html | 53 + ...st_2d.composite.uncovered.fill.color-dodge.html | 53 + .../test_2d.composite.uncovered.fill.color.html | 53 + .../test_2d.composite.uncovered.fill.darken.html | 53 + ....composite.uncovered.fill.destination-atop.html | 53 + ...2d.composite.uncovered.fill.destination-in.html | 53 + ...est_2d.composite.uncovered.fill.difference.html | 53 + ...test_2d.composite.uncovered.fill.exclusion.html | 53 + ...est_2d.composite.uncovered.fill.hard-light.html | 53 + .../test/test_2d.composite.uncovered.fill.hue.html | 53 + .../test_2d.composite.uncovered.fill.lighten.html | 53 + ...est_2d.composite.uncovered.fill.luminosity.html | 53 + .../test_2d.composite.uncovered.fill.multiply.html | 53 + .../test_2d.composite.uncovered.fill.overlay.html | 53 + ...est_2d.composite.uncovered.fill.saturation.html | 53 + .../test_2d.composite.uncovered.fill.screen.html | 53 + ...est_2d.composite.uncovered.fill.soft-light.html | 53 + ...test_2d.composite.uncovered.fill.source-in.html | 53 + ...est_2d.composite.uncovered.fill.source-out.html | 53 + ...composite.uncovered.image.destination-atop.html | 53 + ...d.composite.uncovered.image.destination-in.html | 53 + ...est_2d.composite.uncovered.image.source-in.html | 53 + ...st_2d.composite.uncovered.image.source-out.html | 53 + ...mposite.uncovered.pattern.destination-atop.html | 53 + ...composite.uncovered.pattern.destination-in.html | 53 + ...t_2d.composite.uncovered.pattern.source-in.html | 53 + ..._2d.composite.uncovered.pattern.source-out.html | 53 + dom/canvas/test/test_2d.drawImage.zerocanvas.html | 55 + ...test_2d.fill.pattern.imageSmoothingEnabled.html | 81 + dom/canvas/test/test_2d.fill.winding.html | 50 + dom/canvas/test/test_2d.fillText.gradient.html | 55 + .../test/test_2d.gradient.radial.cone.behind.html | 62 + .../test/test_2d.gradient.radial.cone.beside.html | 62 + .../test/test_2d.gradient.radial.cone.front.html | 50 + .../test/test_2d.gradient.radial.cone.shape2.html | 71 + .../test/test_2d.gradient.radial.cone.top.html | 64 + dom/canvas/test/test_2d.gradient.radial.equal.html | 62 + .../test/test_2d.gradient.radial.inside2.html | 50 + .../test/test_2d.gradient.radial.inside3.html | 51 + .../test/test_2d.gradient.radial.outside1.html | 50 + .../test/test_2d.gradient.radial.outside2.html | 62 + .../test/test_2d.gradient.radial.outside3.html | 63 + .../test/test_2d.gradient.radial.touch1.html | 62 + .../test/test_2d.gradient.radial.touch2.html | 64 + .../test/test_2d.gradient.radial.touch3.html | 62 + dom/canvas/test/test_2d.isPointInPath.winding.html | 28 + dom/canvas/test/test_2d.line.cap.closed.html | 53 + dom/canvas/test/test_2d.line.join.parallel.html | 49 + dom/canvas/test/test_2d.path.arc.shape.3.html | 57 + .../test/test_2d.path.rect.selfintersect.html | 50 + dom/canvas/test/test_2d.path.rect.zero.6.html | 52 + dom/canvas/test/test_2d.strokeRect.zero.5.html | 37 + ...st_2d_composite_canvaspattern_setTransform.html | 78 + dom/canvas/test/test_ImageData_ctor.html | 80 + dom/canvas/test/test_bitmaprenderer.html | 172 + dom/canvas/test/test_bug1215072.html | 76 + dom/canvas/test/test_bug232227.html | 151 + dom/canvas/test/test_bug613794.html | 41 + dom/canvas/test/test_bug753758.html | 35 + dom/canvas/test/test_bug764125.html | 36 + dom/canvas/test/test_bug856472.html | 31 + dom/canvas/test/test_bug866575.html | 34 + dom/canvas/test/test_bug902651.html | 44 + dom/canvas/test/test_canvas.html | 25808 +++++++++++++++++++ dom/canvas/test/test_canvas_focusring.html | 100 + dom/canvas/test/test_canvas_font_setter.html | 68 + dom/canvas/test/test_canvas_path.html | 447 + .../test/test_canvas_strokeStyle_getter.html | 38 + dom/canvas/test/test_capture.html | 141 + dom/canvas/test/test_createPattern_broken.html | 35 + dom/canvas/test/test_drawImageIncomplete.html | 59 + .../test/test_drawImage_document_domain.html | 48 + dom/canvas/test/test_drawImage_edge_cases.html | 42 + dom/canvas/test/test_drawWindow.html | 55 + dom/canvas/test/test_filter.html | 45 + dom/canvas/test/test_filter_tainted.html | 338 + dom/canvas/test/test_hitregion_canvas.html | 84 + dom/canvas/test/test_hitregion_event.html | 93 + dom/canvas/test/test_imagebitmap.html | 346 + dom/canvas/test/test_imagebitmap_close.html | 93 + dom/canvas/test/test_imagebitmap_cropping.html | 274 + dom/canvas/test/test_imagebitmap_extensions.html | 37 + .../test_imagebitmap_extensions_on_worker.html | 39 + dom/canvas/test/test_imagebitmap_on_worker.html | 142 + .../test/test_imagebitmap_structuredclone.html | 38 + .../test_imagebitmap_structuredclone_iframe.html | 45 + .../test_imagebitmap_structuredclone_window.html | 27 + dom/canvas/test/test_imagebitmap_transfer.html | 46 + dom/canvas/test/test_isPointInStroke.html | 244 + dom/canvas/test/test_mozGetAsFile.html | 50 + .../test/test_offscreencanvas_basic_webgl.html | 62 + .../test_offscreencanvas_dynamic_fallback.html | 80 + dom/canvas/test/test_offscreencanvas_many.html | 67 + dom/canvas/test/test_offscreencanvas_neuter.html | 78 + .../test/test_offscreencanvas_serviceworker.html | 52 + .../test/test_offscreencanvas_sharedworker.html | 47 + .../test/test_offscreencanvas_sizechange.html | 41 + .../test/test_offscreencanvas_subworker.html | 90 + dom/canvas/test/test_offscreencanvas_toblob.html | 91 + .../test/test_offscreencanvas_toimagebitmap.html | 69 + dom/canvas/test/test_strokeText_throw.html | 68 + dom/canvas/test/test_toBlob.html | 47 + dom/canvas/test/test_toDataURL_alpha.html | 206 + .../test/test_toDataURL_lowercase_ascii.html | 20 + dom/canvas/test/test_toDataURL_parameters.html | 54 + dom/canvas/test/test_windingRuleUndefined.html | 34 + dom/canvas/test/webgl-conf/always-fail.html | 20 + .../test/webgl-conf/checkout/00_test_list.txt | 8 + .../test/webgl-conf/checkout/CONFORMANCE_RULES.txt | 127 + dom/canvas/test/webgl-conf/checkout/README.md | 79 + .../webgl-conf/checkout/closure-library/AUTHORS | 19 + .../checkout/closure-library/CONTRIBUTING | 48 + .../webgl-conf/checkout/closure-library/LICENSE | 176 + .../checkout/closure-library/README-Khronos.txt | 20 + .../webgl-conf/checkout/closure-library/README.md | 9 + .../closure/bin/build/closurebuilder.py | 287 + .../closure-library/closure/bin/build/depstree.py | 189 + .../closure/bin/build/depswriter.py | 204 + .../closure/bin/build/jscompiler.py | 135 + .../closure-library/closure/bin/build/source.py | 127 + .../closure-library/closure/bin/build/treescan.py | 78 + .../closure-library/closure/bin/calcdeps.py | 590 + .../closure-library/closure/bin/scopify.py | 221 + .../checkout/closure-library/closure/goog/base.js | 2496 ++ .../checkout/closure-library/closure/goog/deps.js | 1465 ++ .../webgl-conf/checkout/conformance/00_readme.txt | 13 + .../checkout/conformance/00_test_list.txt | 18 + .../checkout/conformance/attribs/00_test_list.txt | 11 + .../attribs/gl-bindAttribLocation-aliasing.html | 90 + .../attribs/gl-bindAttribLocation-matrix.html | 119 + .../attribs/gl-bindAttribLocation-repeated.html | 89 + .../attribs/gl-disabled-vertex-attrib.html | 100 + .../attribs/gl-enable-vertex-attrib.html | 82 + .../conformance/attribs/gl-matrix-attributes.html | 157 + .../attribs/gl-vertex-attrib-render.html | 110 + .../attribs/gl-vertex-attrib-zero-issues.html | 152 + .../conformance/attribs/gl-vertex-attrib.html | 49 + .../attribs/gl-vertexattribpointer-offsets.html | 181 + .../attribs/gl-vertexattribpointer.html | 164 + .../checkout/conformance/buffers/00_test_list.txt | 12 + .../conformance/buffers/buffer-bind-test.html | 87 + .../buffers/buffer-data-and-buffer-sub-data.html | 188 + .../buffers/buffer-data-array-buffer-delete.html | 80 + .../conformance/buffers/buffer-uninitialized.html | 123 + .../element-array-buffer-delete-recreate.html | 90 + .../buffers/index-validation-copies-indices.html | 73 + ...ndex-validation-crash-with-buffer-sub-data.html | 59 + .../buffers/index-validation-large-buffer.html | 77 + ...index-validation-verifies-too-many-indices.html | 71 + .../index-validation-with-resized-buffer.html | 128 + .../conformance/buffers/index-validation.html | 138 + .../checkout/conformance/canvas/00_test_list.txt | 15 + .../conformance/canvas/buffer-offscreen-test.html | 99 + .../conformance/canvas/buffer-preserve-test.html | 87 + .../checkout/conformance/canvas/canvas-test.html | 212 + .../conformance/canvas/canvas-zero-size.html | 64 + .../draw-static-webgl-to-multiple-canvas-test.html | 96 + .../canvas/draw-webgl-to-canvas-test.html | 99 + .../canvas/drawingbuffer-hd-dpi-test.html | 225 + .../canvas/drawingbuffer-static-canvas-test.html | 137 + .../conformance/canvas/drawingbuffer-test.html | 138 + ...amebuffer-bindings-affected-by-to-data-url.html | 95 + .../framebuffer-bindings-unaffected-on-resize.html | 106 + .../conformance/canvas/rapid-resizing.html | 190 + .../texture-bindings-unaffected-on-resize.html | 87 + .../conformance/canvas/to-data-url-test.html | 129 + .../canvas/viewport-unchanged-upon-resize.html | 113 + .../checkout/conformance/context/00_test_list.txt | 19 + .../context/constants-and-properties.html | 566 + .../context-attribute-preserve-drawing-buffer.html | 129 + ...t-attributes-alpha-depth-stencil-antialias.html | 354 + .../context/context-creation-and-destruction.html | 56 + .../conformance/context/context-creation.html | 56 + .../context-eviction-with-garbage-collection.html | 78 + .../conformance/context/context-hidden-alpha.html | 187 + .../conformance/context/context-lost-restored.html | 306 + .../checkout/conformance/context/context-lost.html | 374 + .../context/context-no-alpha-fbo-with-alpha.html | 98 + .../context/context-release-upon-reload.html | 93 + .../context/context-release-with-workers.html | 93 + .../conformance/context/context-size-change.html | 113 + .../conformance/context/context-type-test.html | 74 + .../incorrect-context-object-behaviour.html | 88 + .../checkout/conformance/context/methods.html | 239 + .../conformance/context/premultiplyalpha-test.html | 266 + .../conformance/context/resource-sharing-test.html | 64 + .../context-release-child-with-worker.html | 76 + .../context-release-upon-reload-child.html | 75 + .../context/resources/context-release-worker.js | 4 + .../user-defined-properties-on-context.html | 70 + .../conformance/extensions/00_test_list.txt | 39 + .../angle-instanced-arrays-out-of-bounds.html | 77 + .../extensions/angle-instanced-arrays.html | 652 + .../conformance/extensions/ext-blend-minmax.html | 246 + .../extensions/ext-disjoint-timer-query.html | 326 + .../conformance/extensions/ext-frag-depth.html | 310 + .../checkout/conformance/extensions/ext-sRGB.html | 430 + .../extensions/ext-shader-texture-lod.html | 362 + .../extensions/ext-texture-filter-anisotropic.html | 190 + .../conformance/extensions/get-extension.html | 120 + .../extensions/oes-element-index-uint.html | 447 + .../extensions/oes-standard-derivatives.html | 421 + .../extensions/oes-texture-float-linear.html | 53 + .../extensions/oes-texture-float-with-canvas.html | 55 + .../oes-texture-float-with-image-data.html | 56 + .../extensions/oes-texture-float-with-image.html | 55 + .../extensions/oes-texture-float-with-video.html | 60 + .../conformance/extensions/oes-texture-float.html | 291 + .../extensions/oes-texture-half-float-linear.html | 56 + .../oes-texture-half-float-with-canvas.html | 60 + .../oes-texture-half-float-with-image-data.html | 61 + .../oes-texture-half-float-with-image.html | 60 + .../oes-texture-half-float-with-video.html | 65 + .../extensions/oes-texture-half-float.html | 496 + .../oes-vertex-array-object-bufferData.html | 215 + .../extensions/oes-vertex-array-object.html | 738 + .../extensions/webgl-compressed-texture-atc.html | 431 + .../extensions/webgl-compressed-texture-etc.html | 154 + .../extensions/webgl-compressed-texture-pvrtc.html | 392 + .../webgl-compressed-texture-s3tc-srgb.html | 711 + .../extensions/webgl-compressed-texture-s3tc.html | 736 + .../webgl-compressed-texture-size-limit.html | 246 + .../extensions/webgl-debug-renderer-info.html | 125 + .../extensions/webgl-debug-shaders.html | 165 + .../extensions/webgl-depth-texture.html | 352 + ...webgl-draw-buffers-framebuffer-unsupported.html | 147 + .../webgl-draw-buffers-max-draw-buffers.html | 139 + .../conformance/extensions/webgl-draw-buffers.html | 844 + .../extensions/webgl-shared-resources.html | 861 + .../checkout/conformance/glsl/00_test_list.txt | 11 + .../conformance/glsl/bugs/00_test_list.txt | 39 + .../checkout/conformance/glsl/bugs/README.md | 18 + .../glsl/bugs/angle-ambiguous-function-call.html | 70 + .../bugs/angle-constructor-invalid-parameters.html | 77 + .../glsl/bugs/angle-d3d11-compiler-error.html | 117 + .../glsl/bugs/angle-dx-variable-bug.html | 117 + .../array-of-struct-with-int-first-position.html | 162 + .../glsl/bugs/bool-type-cast-bug-int-float.html | 333 + .../glsl/bugs/compare-loop-index-to-uniform.html | 87 + .../glsl/bugs/complex-glsl-does-not-crash.html | 212 + .../bugs/compound-assignment-type-combination.html | 47 + .../glsl/bugs/conditional-discard-in-loop.html | 161 + .../bugs/conditional-discard-optimization.html | 138 + .../glsl/bugs/constant-precision-qualifier.html | 144 + .../glsl/bugs/essl3-shaders-with-webgl1.html | 159 + .../bugs/floor-div-cos-should-not-truncate.html | 80 + .../glsl/bugs/floored-division-accuracy.html | 95 + .../glsl/bugs/fragcoord-linking-bug.html | 114 + .../glsl/bugs/gl-fragcoord-multisampling-bug.html | 66 + ...bal-invariant-does-not-leak-across-shaders.html | 98 + .../invariant-does-not-leak-across-shaders.html | 95 + .../bugs/logic-inside-block-without-braces.html | 125 + .../bugs/long-expressions-should-not-crash.html | 157 + .../glsl/bugs/loop-if-loop-gradient.html | 96 + .../glsl/bugs/modulo-arithmetic-accuracy.html | 95 + .../glsl/bugs/multiplication-assignment.html | 80 + .../bugs/nested-functions-should-not-crash.html | 110 + .../bugs/nested-loops-with-break-and-continue.html | 104 + .../glsl/bugs/nested-sequence-operator.html | 68 + ...of-small-constant-in-user-defined-function.html | 95 + ...ow-with-constant-exponent-should-not-crash.html | 86 + .../conformance/glsl/bugs/qualcomm-crash.html | 157 + .../bugs/qualcomm-loop-with-continue-crash.html | 92 + .../glsl/bugs/sampler-array-using-loop-index.html | 102 + .../glsl/bugs/sampler-struct-function-arg.html | 116 + .../bugs/sequence-operator-evaluation-order.html | 137 + .../glsl/bugs/sketchfab-lighting-shader-crash.html | 105 + .../glsl/bugs/struct-constructor-highp-bug.html | 63 + .../bugs/temp-expressions-should-not-crash.html | 121 + .../bugs/undefined-index-should-not-crash.html | 85 + .../glsl/bugs/uniforms-should-not-lose-values.html | 102 + .../conformance/glsl/constructors/00_test_list.txt | 14 + .../glsl/constructors/glsl-construct-bvec2.html | 60 + .../glsl/constructors/glsl-construct-bvec3.html | 60 + .../glsl/constructors/glsl-construct-bvec4.html | 60 + .../glsl/constructors/glsl-construct-ivec2.html | 60 + .../glsl/constructors/glsl-construct-ivec3.html | 60 + .../glsl/constructors/glsl-construct-ivec4.html | 60 + .../glsl/constructors/glsl-construct-mat2.html | 60 + .../glsl/constructors/glsl-construct-mat3.html | 60 + .../glsl/constructors/glsl-construct-mat4.html | 60 + .../glsl-construct-vec-mat-corner-cases.html | 216 + .../constructors/glsl-construct-vec-mat-index.html | 75 + .../glsl/constructors/glsl-construct-vec2.html | 60 + .../glsl/constructors/glsl-construct-vec3.html | 60 + .../glsl/constructors/glsl-construct-vec4.html | 60 + .../conformance/glsl/functions/00_test_list.txt | 36 + .../glsl/functions/glsl-function-abs.html | 66 + .../glsl/functions/glsl-function-acos.html | 116 + .../glsl/functions/glsl-function-asin.html | 116 + .../glsl/functions/glsl-function-atan-xy.html | 119 + .../glsl/functions/glsl-function-atan.html | 116 + .../glsl/functions/glsl-function-ceil.html | 74 + .../glsl/functions/glsl-function-clamp-float.html | 77 + .../functions/glsl-function-clamp-gentype.html | 80 + .../glsl/functions/glsl-function-cos.html | 120 + .../glsl/functions/glsl-function-cross.html | 74 + .../glsl/functions/glsl-function-distance.html | 109 + .../glsl/functions/glsl-function-dot.html | 111 + .../glsl/functions/glsl-function-faceforward.html | 87 + .../glsl/functions/glsl-function-floor.html | 73 + .../glsl/functions/glsl-function-fract.html | 71 + .../glsl/functions/glsl-function-length.html | 108 + .../glsl/functions/glsl-function-lessThan.html | 73 + .../glsl/functions/glsl-function-max-float.html | 73 + .../glsl/functions/glsl-function-max-gentype.html | 73 + .../glsl/functions/glsl-function-min-float.html | 73 + .../glsl/functions/glsl-function-min-gentype.html | 73 + .../glsl/functions/glsl-function-mix-float.html | 75 + .../glsl/functions/glsl-function-mix-gentype.html | 75 + .../glsl/functions/glsl-function-mod-float.html | 74 + .../glsl/functions/glsl-function-mod-gentype.html | 77 + .../glsl/functions/glsl-function-normalize.html | 80 + .../glsl/functions/glsl-function-reflect.html | 82 + .../glsl/functions/glsl-function-refract.html | 91 + .../glsl/functions/glsl-function-sign.html | 73 + .../glsl/functions/glsl-function-sin.html | 117 + .../functions/glsl-function-smoothstep-float.html | 118 + .../glsl-function-smoothstep-gentype.html | 77 + .../glsl/functions/glsl-function-step-float.html | 73 + .../glsl/functions/glsl-function-step-gentype.html | 72 + .../conformance/glsl/functions/glsl-function.html | 60 + .../conformance/glsl/implicit/00_test_list.txt | 65 + .../glsl/implicit/add_int_float.vert.html | 58 + .../glsl/implicit/add_int_mat2.vert.html | 58 + .../glsl/implicit/add_int_mat3.vert.html | 58 + .../glsl/implicit/add_int_mat4.vert.html | 58 + .../glsl/implicit/add_int_vec2.vert.html | 58 + .../glsl/implicit/add_int_vec3.vert.html | 58 + .../glsl/implicit/add_int_vec4.vert.html | 58 + .../glsl/implicit/add_ivec2_vec2.vert.html | 58 + .../glsl/implicit/add_ivec3_vec3.vert.html | 58 + .../glsl/implicit/add_ivec4_vec4.vert.html | 58 + .../glsl/implicit/assign_int_to_float.vert.html | 58 + .../glsl/implicit/assign_ivec2_to_vec2.vert.html | 58 + .../glsl/implicit/assign_ivec3_to_vec3.vert.html | 58 + .../glsl/implicit/assign_ivec4_to_vec4.vert.html | 58 + .../glsl/implicit/construct_struct.vert.html | 61 + .../glsl/implicit/divide_int_float.vert.html | 58 + .../glsl/implicit/divide_int_mat2.vert.html | 58 + .../glsl/implicit/divide_int_mat3.vert.html | 58 + .../glsl/implicit/divide_int_mat4.vert.html | 58 + .../glsl/implicit/divide_int_vec2.vert.html | 58 + .../glsl/implicit/divide_int_vec3.vert.html | 58 + .../glsl/implicit/divide_int_vec4.vert.html | 58 + .../glsl/implicit/divide_ivec2_vec2.vert.html | 58 + .../glsl/implicit/divide_ivec3_vec3.vert.html | 58 + .../glsl/implicit/divide_ivec4_vec4.vert.html | 58 + .../glsl/implicit/equal_int_float.vert.html | 58 + .../glsl/implicit/equal_ivec2_vec2.vert.html | 58 + .../glsl/implicit/equal_ivec3_vec3.vert.html | 58 + .../glsl/implicit/equal_ivec4_vec4.vert.html | 58 + .../glsl/implicit/function_int_float.vert.html | 61 + .../glsl/implicit/function_ivec2_vec2.vert.html | 61 + .../glsl/implicit/function_ivec3_vec3.vert.html | 61 + .../glsl/implicit/function_ivec4_vec4.vert.html | 61 + .../glsl/implicit/greater_than.vert.html | 58 + .../glsl/implicit/greater_than_equal.vert.html | 58 + .../conformance/glsl/implicit/less_than.vert.html | 58 + .../glsl/implicit/less_than_equal.vert.html | 58 + .../glsl/implicit/multiply_int_float.vert.html | 58 + .../glsl/implicit/multiply_int_mat2.vert.html | 58 + .../glsl/implicit/multiply_int_mat3.vert.html | 58 + .../glsl/implicit/multiply_int_mat4.vert.html | 58 + .../glsl/implicit/multiply_int_vec2.vert.html | 58 + .../glsl/implicit/multiply_int_vec3.vert.html | 58 + .../glsl/implicit/multiply_int_vec4.vert.html | 58 + .../glsl/implicit/multiply_ivec2_vec2.vert.html | 58 + .../glsl/implicit/multiply_ivec3_vec3.vert.html | 58 + .../glsl/implicit/multiply_ivec4_vec4.vert.html | 58 + .../glsl/implicit/not_equal_int_float.vert.html | 58 + .../glsl/implicit/not_equal_ivec2_vec2.vert.html | 58 + .../glsl/implicit/not_equal_ivec3_vec3.vert.html | 58 + .../glsl/implicit/not_equal_ivec4_vec4.vert.html | 58 + .../glsl/implicit/subtract_int_float.vert.html | 58 + .../glsl/implicit/subtract_int_mat2.vert.html | 58 + .../glsl/implicit/subtract_int_mat3.vert.html | 58 + .../glsl/implicit/subtract_int_mat4.vert.html | 58 + .../glsl/implicit/subtract_int_vec2.vert.html | 58 + .../glsl/implicit/subtract_int_vec3.vert.html | 58 + .../glsl/implicit/subtract_int_vec4.vert.html | 58 + .../glsl/implicit/subtract_ivec2_vec2.vert.html | 58 + .../glsl/implicit/subtract_ivec3_vec3.vert.html | 58 + .../glsl/implicit/subtract_ivec4_vec4.vert.html | 58 + .../glsl/implicit/ternary_int_float.vert.html | 58 + .../glsl/implicit/ternary_ivec2_vec2.vert.html | 58 + .../glsl/implicit/ternary_ivec3_vec3.vert.html | 58 + .../glsl/implicit/ternary_ivec4_vec4.vert.html | 58 + .../conformance/glsl/literals/00_test_list.txt | 3 + .../glsl/literals/float_literal.vert.html | 72 + .../glsl/literals/literal_precision.html | 56 + .../glsl/literals/overflow_leak.vert.html | 82 + .../conformance/glsl/matrices/00_test_list.txt | 3 + .../glsl/matrices/glsl-mat3-construction.html | 93 + .../glsl/matrices/glsl-mat4-to-mat3.html | 91 + .../glsl/matrices/matrix-compound-multiply.html | 92 + .../conformance/glsl/misc/00_test_list.txt | 114 + .../glsl/misc/attrib-location-length-limits.html | 110 + .../conformance/glsl/misc/boolean_precision.html | 93 + .../glsl/misc/const-variable-initialization.html | 265 + .../embedded-struct-definitions-forbidden.html | 62 + .../conformance/glsl/misc/empty-declaration.html | 132 + .../conformance/glsl/misc/empty_main.vert.html | 54 + .../expression-list-in-declarator-initializer.html | 87 + .../glsl/misc/gl_position_unset.vert.html | 58 + .../glsl/misc/global-variable-init.html | 314 + .../misc/glsl-2types-of-textures-on-same-unit.html | 153 + .../conformance/glsl/misc/glsl-function-nodes.html | 155 + .../glsl/misc/glsl-long-variable-names.html | 248 + .../conformance/glsl/misc/glsl-vertex-branch.html | 149 + .../checkout/conformance/glsl/misc/include.vs | 4 + .../conformance/glsl/misc/large-loop-compile.html | 193 + .../glsl/misc/non-ascii-comments.vert.html | 59 + .../conformance/glsl/misc/non-ascii.vert.html | 58 + .../conformance/glsl/misc/re-compile-re-link.html | 171 + .../misc/sequence-operator-returns-constant.html | 81 + .../glsl/misc/shader-precision-format-obeyed.html | 104 + .../conformance/glsl/misc/shader-struct-scope.html | 252 + .../misc/shader-uniform-packing-restrictions.html | 272 + .../misc/shader-varying-packing-restrictions.html | 209 + .../misc/shader-with-256-character-define.html | 57 + .../shader-with-256-character-identifier.frag.html | 126 + .../misc/shader-with-257-character-define.html | 57 + .../shader-with-257-character-identifier.frag.html | 57 + .../misc/shader-with-_webgl-identifier.vert.html | 58 + .../misc/shader-with-arbitrary-indexing.frag.html | 62 + .../misc/shader-with-arbitrary-indexing.vert.html | 61 + ...er-with-array-of-structs-containing-arrays.html | 154 + .../misc/shader-with-array-of-structs-uniform.html | 166 + .../glsl/misc/shader-with-attrib-array.vert.html | 58 + .../glsl/misc/shader-with-attrib-struct.vert.html | 60 + .../glsl/misc/shader-with-clipvertex.vert.html | 57 + .../glsl/misc/shader-with-comma-assignment.html | 62 + .../shader-with-comma-conditional-assignment.html | 213 + ...with-comma-separated-variable-declarations.html | 58 + .../shader-with-conditional-scoping-negative.html | 63 + .../glsl/misc/shader-with-conditional-scoping.html | 66 + .../misc/shader-with-default-precision.frag.html | 59 + .../misc/shader-with-default-precision.vert.html | 60 + .../shader-with-define-line-continuation.frag.html | 58 + .../glsl/misc/shader-with-dfdx-no-ext.frag.html | 58 + .../glsl/misc/shader-with-dfdx.frag.html | 57 + .../conformance/glsl/misc/shader-with-do-loop.html | 61 + .../glsl/misc/shader-with-error-directive.html | 72 + .../misc/shader-with-explicit-int-cast.vert.html | 59 + .../misc/shader-with-float-return-value.frag.html | 67 + .../glsl/misc/shader-with-for-loop.html | 104 + .../glsl/misc/shader-with-for-scoping.html | 59 + .../glsl/misc/shader-with-frag-depth.frag.html | 59 + .../misc/shader-with-function-recursion.frag.html | 66 + .../misc/shader-with-function-scoped-struct.html | 63 + .../glsl/misc/shader-with-functional-scoping.html | 60 + .../glsl/misc/shader-with-glcolor.vert.html | 56 + .../glsl/misc/shader-with-gles-1.frag.html | 60 + .../glsl/misc/shader-with-gles-symbol.frag.html | 60 + ...er-with-global-variable-precision-mismatch.html | 149 + .../misc/shader-with-glprojectionmatrix.vert.html | 56 + .../misc/shader-with-hex-int-constant-macro.html | 59 + ...shader-with-illegal-default-precision.frag.html | 259 + ...shader-with-illegal-default-precision.vert.html | 245 + ...hader-with-implicit-vec3-to-vec4-cast.vert.html | 59 + .../glsl/misc/shader-with-include.vert.html | 60 + .../misc/shader-with-int-return-value.frag.html | 63 + .../misc/shader-with-invalid-identifier.frag.html | 57 + .../misc/shader-with-ivec2-return-value.frag.html | 63 + .../misc/shader-with-ivec3-return-value.frag.html | 63 + .../misc/shader-with-ivec4-return-value.frag.html | 63 + .../misc/shader-with-limited-indexing.frag.html | 75 + .../glsl/misc/shader-with-long-line.html | 88 + .../misc/shader-with-non-ascii-error.frag.html | 58 + .../glsl/misc/shader-with-non-reserved-words.html | 716 + .../glsl/misc/shader-with-precision.frag.html | 58 + .../misc/shader-with-preprocessor-whitespace.html | 83 + .../glsl/misc/shader-with-quoted-error.frag.html | 58 + .../glsl/misc/shader-with-reserved-words.html | 284 + .../shader-with-short-circuiting-operators.html | 177 + .../shader-with-similar-uniform-array-names.html | 130 + .../glsl/misc/shader-with-too-many-uniforms.html | 144 + .../misc/shader-with-two-initializer-types.html | 57 + ...er-with-undefined-preprocessor-symbol.frag.html | 60 + ...shader-with-uniform-in-loop-condition.vert.html | 63 + .../misc/shader-with-vec2-return-value.frag.html | 65 + .../misc/shader-with-vec3-return-value.frag.html | 65 + .../misc/shader-with-vec4-return-value.frag.html | 65 + .../shader-with-vec4-vec3-vec4-conditional.html | 57 + .../glsl/misc/shader-with-version-100.frag.html | 62 + .../glsl/misc/shader-with-version-100.vert.html | 59 + .../glsl/misc/shader-with-version-120.vert.html | 59 + .../glsl/misc/shader-with-version-130.vert.html | 59 + .../misc/shader-with-webgl-identifier.vert.html | 58 + .../glsl/misc/shader-with-while-loop.html | 59 + .../glsl/misc/shader-without-precision.frag.html | 58 + ...s-with-constant-expression-loop-conditions.html | 136 + .../glsl/misc/shaders-with-invariance.html | 353 + .../misc/shaders-with-mis-matching-uniforms.html | 108 + .../misc/shaders-with-mis-matching-varyings.html | 101 + .../glsl/misc/shaders-with-missing-varyings.html | 95 + .../glsl/misc/shaders-with-name-conflicts.html | 104 + .../glsl/misc/shaders-with-uniform-structs.html | 310 + .../glsl/misc/shaders-with-varyings.html | 124 + .../checkout/conformance/glsl/misc/shared.html | 172 + .../conformance/glsl/misc/struct-assign.html | 233 + .../conformance/glsl/misc/struct-equals.html | 238 + .../glsl/misc/struct-mixed-array-declarators.html | 90 + .../glsl/misc/struct-nesting-exceeds-maximum.html | 76 + .../misc/struct-nesting-of-variable-names.html | 93 + .../glsl/misc/struct-nesting-under-maximum.html | 72 + .../glsl/misc/struct-specifiers-in-uniforms.html | 84 + .../glsl/misc/struct-unary-operators.html | 89 + .../glsl/misc/ternary-operator-on-arrays.html | 85 + .../ternary-operators-in-global-initializers.html | 86 + .../misc/ternary-operators-in-initializers.html | 143 + .../glsl/misc/uniform-location-length-limits.html | 107 + .../conformance/glsl/reserved/00_test_list.txt | 8 + .../glsl/reserved/_webgl_field.vert.html | 61 + .../glsl/reserved/_webgl_function.vert.html | 59 + .../glsl/reserved/_webgl_struct.vert.html | 59 + .../glsl/reserved/_webgl_variable.vert.html | 55 + .../glsl/reserved/webgl_field.vert.html | 61 + .../glsl/reserved/webgl_function.vert.html | 59 + .../glsl/reserved/webgl_struct.vert.html | 59 + .../glsl/reserved/webgl_variable.vert.html | 55 + .../conformance/glsl/samplers/00_test_list.txt | 4 + .../samplers/glsl-function-texture2d-bias.html | 122 + .../glsl/samplers/glsl-function-texture2dlod.html | 130 + .../glsl/samplers/glsl-function-texture2dproj.html | 137 + .../samplers/glsl-function-texture2dprojlod.html | 161 + .../conformance/glsl/variables/00_test_list.txt | 6 + .../glsl/variables/gl-fragcoord-xy-values.html | 206 + .../conformance/glsl/variables/gl-fragcoord.html | 105 + .../glsl/variables/gl-fragdata-and-fragcolor.html | 59 + .../conformance/glsl/variables/gl-frontfacing.html | 107 + .../conformance/glsl/variables/gl-pointcoord.html | 162 + .../conformance/glsl/variables/glsl-built-ins.html | 127 + .../checkout/conformance/limits/00_test_list.txt | 6 + .../checkout/conformance/limits/gl-line-width.html | 93 + .../limits/gl-max-texture-dimensions.html | 130 + .../conformance/limits/gl-min-attribs.html | 107 + .../conformance/limits/gl-min-textures.html | 102 + .../conformance/limits/gl-min-uniforms.html | 126 + .../angle-instanced-arrays-state-leakage.html | 99 + .../manual/canvas-clear-on-zero-count-draw.html | 111 + .../manual/canvas-no-clear-on-readpixels.html | 71 + .../canvas-no-clear-on-unsuccessful-draw.html | 84 + ...fers-keep-contents-exiting-fullscreen-mode.html | 155 + .../checkout/conformance/misc/00_test_list.txt | 15 + .../conformance/misc/bad-arguments-test.html | 121 + .../misc/boolean-argument-conversion.html | 136 + .../checkout/conformance/misc/delayed-drawing.html | 85 + .../checkout/conformance/misc/error-reporting.html | 94 + .../checkout/conformance/misc/expando-loss.html | 243 + .../misc/functions-returning-strings.html | 125 + .../checkout/conformance/misc/instanceof-test.html | 65 + .../conformance/misc/invalid-passed-params.html | 184 + .../checkout/conformance/misc/is-object.html | 99 + .../conformance/misc/null-object-behaviour.html | 110 + .../misc/object-deletion-behaviour.html | 464 + .../conformance/misc/shader-precision-format.html | 158 + .../conformance/misc/type-conversion-test.html | 172 + .../conformance/misc/uninitialized-test.html | 214 + .../checkout/conformance/misc/webgl-specific.html | 132 + .../checkout/conformance/more/00_test_list.txt | 58 + .../webgl-conf/checkout/conformance/more/README.md | 53 + .../checkout/conformance/more/all_tests.html | 399 + .../conformance/more/all_tests_linkonly.html | 399 + .../conformance/more/all_tests_sequential.html | 399 + .../more/conformance/argGenerators-A.js | 86 + .../more/conformance/argGenerators-B1.js | 78 + .../more/conformance/argGenerators-B2.js | 171 + .../more/conformance/argGenerators-B3.js | 85 + .../more/conformance/argGenerators-B4.js | 88 + .../more/conformance/argGenerators-C.js | 136 + .../more/conformance/argGenerators-D_G.js | 252 + .../more/conformance/argGenerators-G_I.js | 141 + .../more/conformance/argGenerators-L_S.js | 139 + .../more/conformance/argGenerators-S_V.js | 229 + .../more/conformance/badArgsArityLessThanArgc.html | 597 + .../conformance/more/conformance/constants.html | 372 + .../conformance/more/conformance/fuzzTheAPI.html | 137 + .../conformance/more/conformance/getContext.html | 59 + .../conformance/more/conformance/methods.html | 201 + .../more/conformance/quickCheckAPI-A.html | 84 + .../more/conformance/quickCheckAPI-B1.html | 84 + .../more/conformance/quickCheckAPI-B2.html | 84 + .../more/conformance/quickCheckAPI-B3.html | 84 + .../more/conformance/quickCheckAPI-B4.html | 84 + .../more/conformance/quickCheckAPI-C.html | 84 + .../more/conformance/quickCheckAPI-D_G.html | 84 + .../more/conformance/quickCheckAPI-G_I.html | 84 + .../more/conformance/quickCheckAPI-L_S.html | 84 + .../more/conformance/quickCheckAPI-S_V.html | 84 + .../conformance/more/conformance/quickCheckAPI.js | 430 + .../more/conformance/quickCheckAPIBadArgs.html | 103 + .../conformance/more/conformance/webGLArrays.html | 186 + .../conformance/more/demos/opengl_web.html | 607 + .../checkout/conformance/more/demos/video.html | 163 + .../conformance/more/functions/bindBuffer.html | 69 + .../more/functions/bindBufferBadArgs.html | 94 + .../functions/bindFramebufferLeaveNonZero.html | 50 + .../conformance/more/functions/bufferData.html | 87 + .../more/functions/bufferDataBadArgs.html | 79 + .../conformance/more/functions/bufferSubData.html | 138 + .../more/functions/bufferSubDataBadArgs.html | 94 + .../conformance/more/functions/copyTexImage2D.html | 130 + .../more/functions/copyTexImage2DBadArgs.html | 109 + .../more/functions/copyTexSubImage2D.html | 142 + .../more/functions/copyTexSubImage2DBadArgs.html | 117 + .../more/functions/deleteBufferBadArgs.html | 65 + .../conformance/more/functions/drawArrays.html | 135 + .../more/functions/drawArraysOutOfBounds.html | 305 + .../conformance/more/functions/drawElements.html | 143 + .../more/functions/drawElementsBadArgs.html | 209 + .../conformance/more/functions/isTests.html | 82 + .../conformance/more/functions/isTestsBadArgs.html | 108 + .../conformance/more/functions/readPixels.html | 63 + .../more/functions/readPixelsBadArgs.html | 124 + .../conformance/more/functions/texImage2D.html | 86 + .../more/functions/texImage2DBadArgs.html | 107 + .../conformance/more/functions/texImage2DHTML.html | 159 + .../more/functions/texImage2DHTMLBadArgs.html | 72 + .../conformance/more/functions/texSubImage2D.html | 91 + .../more/functions/texSubImage2DBadArgs.html | 116 + .../more/functions/texSubImage2DHTML.html | 172 + .../more/functions/texSubImage2DHTMLBadArgs.html | 104 + .../conformance/more/functions/uniformMatrix.html | 90 + .../more/functions/uniformMatrixBadArgs.html | 164 + .../conformance/more/functions/uniformf.html | 95 + .../more/functions/uniformfArrayLen1.html | 121 + .../more/functions/uniformfBadArgs.html | 126 + .../conformance/more/functions/uniformi.html | 95 + .../more/functions/uniformiBadArgs.html | 122 + .../conformance/more/functions/vertexAttrib.html | 142 + .../more/functions/vertexAttribBadArgs.html | 118 + .../more/functions/vertexAttribPointer.html | 106 + .../more/functions/vertexAttribPointerBadArgs.html | 131 + .../conformance/more/glsl/arrayOutOfBounds.html | 279 + .../checkout/conformance/more/glsl/longLoops.html | 253 + .../conformance/more/glsl/uniformOutOfBounds.html | 217 + .../more/glsl/unusedAttribsUniforms.html | 115 + .../checkout/conformance/more/index.html | 96 + .../conformance/more/performance/CPUvsGPU.html | 360 + .../conformance/more/performance/bandwidth.html | 238 + .../conformance/more/performance/jsGCPause.html | 85 + .../conformance/more/performance/jsMatrixMult.html | 77 + .../more/performance/jsToGLOverhead.html | 67 + .../webgl-conf/checkout/conformance/more/unit.css | 66 + .../webgl-conf/checkout/conformance/more/unit.js | 988 + .../webgl-conf/checkout/conformance/more/util.js | 1286 + .../checkout/conformance/ogles/00_test_list.txt | 2 + .../conformance/ogles/GL/abs/abs_001_to_006.html | 129 + .../ogles/GL/abs/abs_float_frag_xvary.frag | 35 + .../ogles/GL/abs/abs_float_frag_xvary_ref.frag | 37 + .../ogles/GL/abs/abs_float_vert_xvary.vert | 36 + .../ogles/GL/abs/abs_float_vert_xvary_ref.vert | 38 + .../ogles/GL/abs/abs_vec2_frag_xvary.frag | 35 + .../ogles/GL/abs/abs_vec2_frag_xvary_ref.frag | 38 + .../ogles/GL/abs/abs_vec2_vert_xvary.vert | 36 + .../ogles/GL/abs/abs_vec2_vert_xvary_ref.vert | 39 + .../ogles/GL/abs/abs_vec3_frag_xvary.frag | 35 + .../ogles/GL/abs/abs_vec3_frag_xvary_ref.frag | 40 + .../ogles/GL/abs/abs_vec3_vert_xvary.vert | 36 + .../ogles/GL/abs/abs_vec3_vert_xvary_ref.vert | 40 + .../conformance/ogles/GL/abs/input.run.txt | 2 + .../conformance/ogles/GL/acos/acos_001_to_006.html | 129 + .../ogles/GL/acos/acos_float_frag_xvary.frag | 36 + .../ogles/GL/acos/acos_float_frag_xvary_ref.frag | 111 + .../ogles/GL/acos/acos_float_vert_xvary.vert | 37 + .../ogles/GL/acos/acos_float_vert_xvary_ref.vert | 58 + .../ogles/GL/acos/acos_vec2_frag_xvary.frag | 36 + .../ogles/GL/acos/acos_vec2_frag_xvary_ref.frag | 147 + .../ogles/GL/acos/acos_vec2_vert_xvary.vert | 37 + .../ogles/GL/acos/acos_vec2_vert_xvary_ref.vert | 73 + .../ogles/GL/acos/acos_vec3_frag_xvary.frag | 36 + .../ogles/GL/acos/acos_vec3_frag_xvary_ref.frag | 183 + .../ogles/GL/acos/acos_vec3_vert_xvary.vert | 37 + .../ogles/GL/acos/acos_vec3_vert_xvary_ref.vert | 89 + .../conformance/ogles/GL/acos/input.run.txt | 2 + .../conformance/ogles/GL/all/all_001_to_004.html | 103 + .../conformance/ogles/GL/all/all_bvec2_frag.frag | 35 + .../ogles/GL/all/all_bvec2_frag_ref.frag | 45 + .../conformance/ogles/GL/all/all_bvec2_vert.vert | 36 + .../ogles/GL/all/all_bvec2_vert_ref.vert | 46 + .../conformance/ogles/GL/all/all_bvec3_frag.frag | 35 + .../ogles/GL/all/all_bvec3_frag_ref.frag | 46 + .../conformance/ogles/GL/all/all_bvec3_vert.vert | 36 + .../ogles/GL/all/all_bvec3_vert_ref.vert | 47 + .../conformance/ogles/GL/all/input.run.txt | 2 + .../conformance/ogles/GL/any/any_001_to_004.html | 103 + .../conformance/ogles/GL/any/any_bvec2_frag.frag | 35 + .../ogles/GL/any/any_bvec2_frag_ref.frag | 45 + .../conformance/ogles/GL/any/any_bvec2_vert.vert | 36 + .../ogles/GL/any/any_bvec2_vert_ref.vert | 46 + .../conformance/ogles/GL/any/any_bvec3_frag.frag | 35 + .../ogles/GL/any/any_bvec3_frag_ref.frag | 46 + .../conformance/ogles/GL/any/any_bvec3_vert.vert | 36 + .../ogles/GL/any/any_bvec3_vert_ref.vert | 47 + .../conformance/ogles/GL/any/input.run.txt | 2 + .../ogles/GL/array/array_001_to_006.html | 221 + .../GL/array/empty_empty_array_float_frag.frag | 45 + .../GL/array/empty_empty_array_float_vert.vert | 44 + .../GL/array/empty_uniform_array_float_frag.frag | 45 + .../GL/array/empty_uniform_array_float_vert.vert | 47 + .../GL/array/initfunc_empty_array_float_frag.frag | 50 + .../GL/array/initfunc_empty_array_float_vert.vert | 49 + .../conformance/ogles/GL/array/input.run.txt | 2 + .../conformance/ogles/GL/asin/asin_001_to_006.html | 129 + .../ogles/GL/asin/asin_float_frag_xvary.frag | 36 + .../ogles/GL/asin/asin_float_frag_xvary_ref.frag | 110 + .../ogles/GL/asin/asin_float_vert_xvary.vert | 37 + .../ogles/GL/asin/asin_float_vert_xvary_ref.vert | 57 + .../ogles/GL/asin/asin_vec2_frag_xvary.frag | 36 + .../ogles/GL/asin/asin_vec2_frag_xvary_ref.frag | 146 + .../ogles/GL/asin/asin_vec2_vert_xvary.vert | 37 + .../ogles/GL/asin/asin_vec2_vert_xvary_ref.vert | 71 + .../ogles/GL/asin/asin_vec3_frag_xvary.frag | 36 + .../ogles/GL/asin/asin_vec3_frag_xvary_ref.frag | 182 + .../ogles/GL/asin/asin_vec3_vert_xvary.vert | 37 + .../ogles/GL/asin/asin_vec3_vert_xvary_ref.vert | 86 + .../conformance/ogles/GL/asin/input.run.txt | 2 + .../conformance/ogles/GL/atan/atan_001_to_008.html | 155 + .../conformance/ogles/GL/atan/atan_009_to_012.html | 103 + .../ogles/GL/atan/atan_float_frag_xvary.frag | 36 + .../ogles/GL/atan/atan_float_frag_xvary_ref.frag | 72 + .../ogles/GL/atan/atan_float_frag_xvaryyvary.frag | 48 + .../GL/atan/atan_float_frag_xvaryyvary_ref.frag | 88 + .../ogles/GL/atan/atan_float_vert_xvary.vert | 37 + .../ogles/GL/atan/atan_float_vert_xvary_ref.vert | 73 + .../ogles/GL/atan/atan_float_vert_xvaryyvary.vert | 46 + .../GL/atan/atan_float_vert_xvaryyvary_ref.vert | 85 + .../ogles/GL/atan/atan_vec2_frag_xvary.frag | 36 + .../ogles/GL/atan/atan_vec2_frag_xvary_ref.frag | 132 + .../ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag | 49 + .../GL/atan/atan_vec2_frag_xvaryyvary_ref.frag | 150 + .../ogles/GL/atan/atan_vec2_vert_xvary.vert | 37 + .../ogles/GL/atan/atan_vec2_vert_xvary_ref.vert | 133 + .../ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert | 51 + .../GL/atan/atan_vec2_vert_xvaryyvary_ref.vert | 150 + .../ogles/GL/atan/atan_vec3_frag_xvary.frag | 36 + .../ogles/GL/atan/atan_vec3_frag_xvary_ref.frag | 178 + .../ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag | 54 + .../GL/atan/atan_vec3_frag_xvaryyvary_ref.frag | 203 + .../ogles/GL/atan/atan_vec3_vert_xvary.vert | 37 + .../ogles/GL/atan/atan_vec3_vert_xvary_ref.vert | 178 + .../ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert | 56 + .../GL/atan/atan_vec3_vert_xvaryyvary_ref.vert | 202 + .../conformance/ogles/GL/atan/input.run.txt | 3 + .../GL/biConstants/biConstants_001_to_008.html | 251 + .../GL/biConstants/biConstants_009_to_016.html | 251 + .../gl_MaxCombinedTextureImageUnits_frag.frag | 37 + .../gl_MaxCombinedTextureImageUnits_vert.vert | 38 + .../GL/biConstants/gl_MaxDrawBuffers_frag.frag | 37 + .../GL/biConstants/gl_MaxDrawBuffers_vert.vert | 38 + .../gl_MaxFragmentUniformVectors_frag.frag | 37 + .../gl_MaxFragmentUniformVectors_vert.vert | 38 + .../biConstants/gl_MaxTextureImageUnits_frag.frag | 37 + .../biConstants/gl_MaxTextureImageUnits_vert.vert | 38 + .../GL/biConstants/gl_MaxVaryingVectors_frag.frag | 37 + .../GL/biConstants/gl_MaxVaryingVectors_vert.vert | 38 + .../GL/biConstants/gl_MaxVertexAttribs_frag.frag | 37 + .../GL/biConstants/gl_MaxVertexAttribs_vert.vert | 38 + .../gl_MaxVertexTextureImageUnits_frag.frag | 39 + .../gl_MaxVertexTextureImageUnits_vert.vert | 40 + .../gl_MaxVertexUniformVectors_frag.frag | 37 + .../gl_MaxVertexUniformVectors_vert.vert | 38 + .../conformance/ogles/GL/biConstants/input.run.txt | 3 + .../ogles/GL/biuDepthRange/DepthRange_frag.frag | 33 + .../ogles/GL/biuDepthRange/DepthRange_vert.vert | 35 + .../GL/biuDepthRange/biuDepthRange_001_to_002.html | 129 + .../ogles/GL/biuDepthRange/input.run.txt | 2 + .../ogles/GL/build/CG_Data_Types_frag.frag | 45 + .../ogles/GL/build/CG_Standard_Library_frag.frag | 32 + .../ogles/GL/build/CorrectBuiltInOveride_frag.frag | 39 + .../ogles/GL/build/CorrectComma_frag.frag | 39 + .../ogles/GL/build/CorrectConstFolding1_vert.vert | 53 + .../ogles/GL/build/CorrectConstFolding2_vert.vert | 438 + .../ogles/GL/build/CorrectConstruct_vert.vert | 54 + .../GL/build/CorrectExtension10_V100_frag.frag | 43 + .../GL/build/CorrectExtension1_V100_frag.frag | 34 + .../GL/build/CorrectExtension4_V100_frag.frag | 35 + .../ogles/GL/build/CorrectFull_vert.vert | 671 + .../ogles/GL/build/CorrectFuncOverload_frag.frag | 44 + .../ogles/GL/build/CorrectFuncOverload_vert.vert | 54 + .../ogles/GL/build/CorrectFunction1_vert.vert | 53 + .../ogles/GL/build/CorrectModule_frag.frag | 81 + .../ogles/GL/build/CorrectParse1_frag.frag | 68 + .../ogles/GL/build/CorrectParse2_frag.frag | 153 + .../ogles/GL/build/CorrectParse2_vert.vert | 166 + .../ogles/GL/build/CorrectParseTest1_frag.frag | 40 + .../ogles/GL/build/CorrectParseTest_frag.frag | 43 + .../ogles/GL/build/CorrectPreprocess5_frag.frag | 48 + .../ogles/GL/build/CorrectPreprocess8_frag.frag | 132 + .../ogles/GL/build/CorrectPreprocess9_frag.frag | 49 + .../ogles/GL/build/CorrectSwizzle1_frag.frag | 41 + .../ogles/GL/build/CorrectSwizzle1_vert.vert | 34 + .../ogles/GL/build/CorrectSwizzle2_frag.frag | 56 + .../ogles/GL/build/CorrectSwizzle2_vert.vert | 34 + .../ogles/GL/build/CorrectSwizzle3_frag.frag | 41 + .../ogles/GL/build/CorrectVersion_V100_frag.frag | 36 + .../GL/build/DuplicateVersion1_V100_frag.frag | 36 + .../ogles/GL/build/FunctionParam_vert.vert | 38 + .../build/Include_Preprocessor_Directive_frag.frag | 29 + .../Low_Level_Assembly_Reserved_Words_frag.frag | 44 + .../ogles/GL/build/Main_Parameters_vert.vert | 29 + .../ogles/GL/build/ParseTest3_frag.frag | 37 + .../ogles/GL/build/ParseTest4_frag.frag | 33 + .../Permissive_Constant_Conversions_frag.frag | 32 + .../Permissive_Scalar_Vector_Expressions_frag.frag | 33 + .../conformance/ogles/GL/build/TernaryOp_frag.frag | 35 + .../GL/build/Texture_Rectangle_Samplers_frag.frag | 34 + .../conformance/ogles/GL/build/array10_frag.frag | 35 + .../conformance/ogles/GL/build/array11_frag.frag | 33 + .../conformance/ogles/GL/build/array1_frag.frag | 32 + .../conformance/ogles/GL/build/array2_frag.frag | 32 + .../conformance/ogles/GL/build/array3_frag.frag | 33 + .../conformance/ogles/GL/build/array4_frag.frag | 32 + .../conformance/ogles/GL/build/array5_frag.frag | 33 + .../conformance/ogles/GL/build/array6_frag.frag | 33 + .../conformance/ogles/GL/build/array7_frag.frag | 33 + .../conformance/ogles/GL/build/array8_frag.frag | 33 + .../conformance/ogles/GL/build/array9_frag.frag | 33 + .../ogles/GL/build/attribute1_vert.vert | 31 + .../ogles/GL/build/attribute2_vert.vert | 31 + .../conformance/ogles/GL/build/attribute_frag.frag | 32 + .../conformance/ogles/GL/build/attribute_vert.vert | 29 + .../conformance/ogles/GL/build/break_frag.frag | 32 + .../ogles/GL/build/build_001_to_008.html | 131 + .../ogles/GL/build/build_009_to_016.html | 131 + .../ogles/GL/build/build_017_to_024.html | 131 + .../ogles/GL/build/build_025_to_032.html | 131 + .../ogles/GL/build/build_033_to_040.html | 131 + .../ogles/GL/build/build_041_to_048.html | 131 + .../ogles/GL/build/build_049_to_056.html | 131 + .../ogles/GL/build/build_057_to_064.html | 131 + .../ogles/GL/build/build_065_to_072.html | 131 + .../ogles/GL/build/build_073_to_080.html | 131 + .../ogles/GL/build/build_081_to_088.html | 131 + .../ogles/GL/build/build_089_to_096.html | 131 + .../ogles/GL/build/build_097_to_104.html | 131 + .../ogles/GL/build/build_105_to_112.html | 131 + .../ogles/GL/build/build_113_to_120.html | 131 + .../ogles/GL/build/build_121_to_128.html | 131 + .../ogles/GL/build/build_129_to_136.html | 131 + .../ogles/GL/build/build_137_to_144.html | 131 + .../ogles/GL/build/build_145_to_152.html | 131 + .../ogles/GL/build/build_153_to_160.html | 131 + .../ogles/GL/build/build_161_to_168.html | 131 + .../ogles/GL/build/build_169_to_176.html | 131 + .../ogles/GL/build/build_177_to_178.html | 71 + .../conformance/ogles/GL/build/comma1_vert.vert | 33 + .../conformance/ogles/GL/build/comma2_frag.frag | 35 + .../conformance/ogles/GL/build/comma2_vert.vert | 33 + .../conformance/ogles/GL/build/comma3_vert.vert | 34 + .../conformance/ogles/GL/build/comment_frag.frag | 32 + .../ogles/GL/build/conditional1_frag.frag | 34 + .../ogles/GL/build/conditional2_frag.frag | 35 + .../ogles/GL/build/conditional3_frag.frag | 34 + .../conformance/ogles/GL/build/constFunc_frag.frag | 39 + .../ogles/GL/build/constructor1_frag.frag | 32 + .../ogles/GL/build/constructor2_frag.frag | 33 + .../ogles/GL/build/constructor3_V100_frag.frag | 33 + .../conformance/ogles/GL/build/continue_frag.frag | 32 + .../ogles/GL/build/dataType10_frag.frag | 33 + .../ogles/GL/build/dataType11_frag.frag | 32 + .../ogles/GL/build/dataType12_frag.frag | 32 + .../ogles/GL/build/dataType13_frag.frag | 34 + .../ogles/GL/build/dataType19_frag.frag | 33 + .../conformance/ogles/GL/build/dataType1_frag.frag | 32 + .../conformance/ogles/GL/build/dataType2_frag.frag | 34 + .../conformance/ogles/GL/build/dataType3_frag.frag | 33 + .../conformance/ogles/GL/build/dataType4_frag.frag | 32 + .../conformance/ogles/GL/build/dataType5_frag.frag | 32 + .../conformance/ogles/GL/build/dataType6_frag.frag | 32 + .../conformance/ogles/GL/build/dataType7_frag.frag | 33 + .../conformance/ogles/GL/build/dataType8_frag.frag | 33 + .../conformance/ogles/GL/build/dataType9_frag.frag | 35 + .../conformance/ogles/GL/build/default.frag | 32 + .../conformance/ogles/GL/build/default.vert | 32 + .../conformance/ogles/GL/build/dowhile_frag.frag | 34 + .../conformance/ogles/GL/build/dvec2_frag.frag | 32 + .../conformance/ogles/GL/build/dvec3_frag.frag | 32 + .../conformance/ogles/GL/build/dvec4_frag.frag | 32 + .../ogles/GL/build/extension2_V100_frag.frag | 34 + .../ogles/GL/build/extension3_V100_frag.frag | 33 + .../ogles/GL/build/extension5_V100_frag.frag | 33 + .../ogles/GL/build/extension6_V100_frag.frag | 33 + .../ogles/GL/build/extension7_V100_frag.frag | 33 + .../ogles/GL/build/extension8_V100_frag.frag | 33 + .../ogles/GL/build/extension9_V100_frag.frag | 33 + .../conformance/ogles/GL/build/float2_frag.frag | 32 + .../conformance/ogles/GL/build/float3_frag.frag | 32 + .../conformance/ogles/GL/build/float4_frag.frag | 32 + .../ogles/GL/build/fragmentOnly1_vert.vert | 29 + .../ogles/GL/build/fragmentOnly2_vert.vert | 29 + .../ogles/GL/build/fragmentOnly3_vert.vert | 29 + .../ogles/GL/build/fragmentOnly4_vert.vert | 29 + .../ogles/GL/build/fragmentOnly_vert.vert | 29 + .../ogles/GL/build/function10_frag.frag | 41 + .../conformance/ogles/GL/build/function1_frag.frag | 40 + .../ogles/GL/build/function2_V100_frag.frag | 39 + .../conformance/ogles/GL/build/function3_frag.frag | 40 + .../conformance/ogles/GL/build/function4_frag.frag | 40 + .../conformance/ogles/GL/build/function6_frag.frag | 40 + .../conformance/ogles/GL/build/function7_frag.frag | 39 + .../conformance/ogles/GL/build/function8_frag.frag | 40 + .../conformance/ogles/GL/build/function9_frag.frag | 41 + .../conformance/ogles/GL/build/hvec2_frag.frag | 32 + .../conformance/ogles/GL/build/hvec3_frag.frag | 32 + .../conformance/ogles/GL/build/hvec4_frag.frag | 32 + .../ogles/GL/build/identifier1_frag.frag | 32 + .../ogles/GL/build/identifier2_frag.frag | 32 + .../ogles/GL/build/identifier3_frag.frag | 33 + .../conformance/ogles/GL/build/if1_frag.frag | 34 + .../conformance/ogles/GL/build/if2_frag.frag | 35 + .../ogles/GL/build/increment1_frag.frag | 37 + .../ogles/GL/build/increment2_frag.frag | 33 + .../ogles/GL/build/increment3_frag.frag | 34 + .../ogles/GL/build/increment4_frag.frag | 33 + .../ogles/GL/build/increment6_frag.frag | 33 + .../conformance/ogles/GL/build/input.run.txt | 24 + .../conformance/ogles/GL/build/main1_vert.vert | 28 + .../conformance/ogles/GL/build/main2_vert.vert | 29 + .../conformance/ogles/GL/build/main3_vert.vert | 29 + .../ogles/GL/build/matrix_V100_frag.frag | 33 + .../conformance/ogles/GL/build/normal_vert.vert | 30 + .../conformance/ogles/GL/build/parser10_frag.frag | 32 + .../conformance/ogles/GL/build/parser1_vert.vert | 30 + .../conformance/ogles/GL/build/parser3_frag.frag | 33 + .../conformance/ogles/GL/build/parser4_frag.frag | 33 + .../conformance/ogles/GL/build/parser5_frag.frag | 33 + .../conformance/ogles/GL/build/parser6_frag.frag | 33 + .../conformance/ogles/GL/build/parser7_frag.frag | 33 + .../conformance/ogles/GL/build/parser8_frag.frag | 34 + .../conformance/ogles/GL/build/parser9_frag.frag | 33 + .../ogles/GL/build/preprocess0_frag.frag | 80 + .../ogles/GL/build/preprocess10_frag.frag | 36 + .../ogles/GL/build/preprocess1_frag.frag | 81 + .../ogles/GL/build/preprocess2_frag.frag | 77 + .../ogles/GL/build/preprocess3_frag.frag | 60 + .../ogles/GL/build/preprocess4_frag.frag | 77 + .../ogles/GL/build/preprocess6_frag.frag | 54 + .../ogles/GL/build/preprocess7_frag.frag | 68 + .../conformance/ogles/GL/build/scoping1_frag.frag | 38 + .../conformance/ogles/GL/build/scoping2_frag.frag | 36 + .../conformance/ogles/GL/build/struct10_frag.frag | 36 + .../conformance/ogles/GL/build/struct11_frag.frag | 36 + .../conformance/ogles/GL/build/struct1_frag.frag | 35 + .../conformance/ogles/GL/build/struct2_frag.frag | 35 + .../conformance/ogles/GL/build/struct3_frag.frag | 35 + .../conformance/ogles/GL/build/struct4_frag.frag | 35 + .../conformance/ogles/GL/build/struct5_frag.frag | 36 + .../conformance/ogles/GL/build/struct6_frag.frag | 35 + .../conformance/ogles/GL/build/struct7_frag.frag | 33 + .../conformance/ogles/GL/build/struct8_frag.frag | 40 + .../conformance/ogles/GL/build/struct9_frag.frag | 36 + .../conformance/ogles/GL/build/swizzle1_frag.frag | 33 + .../conformance/ogles/GL/build/swizzle2_frag.frag | 33 + .../conformance/ogles/GL/build/swizzle3_frag.frag | 33 + .../conformance/ogles/GL/build/typecast_frag.frag | 33 + .../conformance/ogles/GL/build/uniform1_frag.frag | 40 + .../conformance/ogles/GL/build/uniform_frag.frag | 32 + .../conformance/ogles/GL/build/varying1_frag.frag | 34 + .../conformance/ogles/GL/build/varying2_frag.frag | 34 + .../conformance/ogles/GL/build/varying3_frag.frag | 34 + .../conformance/ogles/GL/build/varying_frag.frag | 32 + .../conformance/ogles/GL/build/vector_frag.frag | 33 + .../ogles/GL/build/version2_V100_frag.frag | 36 + .../ogles/GL/build/version3_V100_frag.frag | 36 + .../ogles/GL/build/vertexOnly2_frag.frag | 32 + .../ogles/GL/build/vertexOnly_frag.frag | 42 + .../conformance/ogles/GL/build/vertex_vert.vert | 30 + .../conformance/ogles/GL/build/while1_frag.frag | 34 + .../conformance/ogles/GL/build/while2_frag.frag | 33 + .../conformance/ogles/GL/build/while_frag.frag | 34 + ..._in_varying_array_out_of_bounds_001_to_001.html | 61 + .../gl_Color_array_index_out_of_bounds_frag.frag | 33 + .../input.run.txt | 2 + .../conformance/ogles/GL/ceil/ceil_001_to_006.html | 129 + .../ogles/GL/ceil/ceil_float_frag_xvary.frag | 35 + .../ogles/GL/ceil/ceil_float_frag_xvary_ref.frag | 41 + .../ogles/GL/ceil/ceil_float_vert_xvary.vert | 36 + .../ogles/GL/ceil/ceil_float_vert_xvary_ref.vert | 42 + .../ogles/GL/ceil/ceil_vec2_frag_xvary.frag | 35 + .../ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag | 42 + .../ogles/GL/ceil/ceil_vec2_vert_xvary.vert | 36 + .../ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert | 43 + .../ogles/GL/ceil/ceil_vec3_frag_xvary.frag | 35 + .../ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag | 43 + .../ogles/GL/ceil/ceil_vec3_vert_xvary.vert | 36 + .../ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert | 44 + .../conformance/ogles/GL/ceil/input.run.txt | 2 + .../ogles/GL/clamp/clamp_001_to_006.html | 129 + .../clamp_float_frag_xvary_yconstquarter.frag | 37 + .../clamp_float_frag_xvary_yconstquarter_ref.frag | 40 + .../clamp_float_vert_xvary_yconstquarter.vert | 38 + .../clamp_float_vert_xvary_yconstquarter_ref.vert | 41 + .../clamp/clamp_vec2_frag_xvary_yconstquarter.frag | 37 + .../clamp_vec2_frag_xvary_yconstquarter_ref.frag | 42 + .../clamp/clamp_vec2_vert_xvary_yconstquarter.vert | 38 + .../clamp_vec2_vert_xvary_yconstquarter_ref.vert | 43 + .../clamp/clamp_vec3_frag_xvary_yconstquarter.frag | 37 + .../clamp_vec3_frag_xvary_yconstquarter_ref.frag | 44 + .../clamp/clamp_vec3_vert_xvary_yconstquarter.vert | 38 + .../clamp_vec3_vert_xvary_yconstquarter_ref.vert | 45 + .../conformance/ogles/GL/clamp/input.run.txt | 2 + .../GL/control_flow/control_flow_001_to_008.html | 251 + .../GL/control_flow/control_flow_009_to_010.html | 101 + .../ogles/GL/control_flow/for_break_frag.frag | 46 + .../ogles/GL/control_flow/for_break_vert.vert | 45 + .../ogles/GL/control_flow/for_continue_frag.frag | 50 + .../ogles/GL/control_flow/for_continue_vert.vert | 50 + .../GL/control_flow/for_nested_break_frag.frag | 52 + .../GL/control_flow/for_nested_break_vert.vert | 52 + .../GL/control_flow/for_nested_continue_frag.frag | 61 + .../GL/control_flow/for_nested_continue_vert.vert | 61 + .../ogles/GL/control_flow/input.run.txt | 3 + .../ogles/GL/control_flow/nested_if_else_frag.frag | 57 + .../ogles/GL/control_flow/nested_if_else_vert.vert | 57 + .../conformance/ogles/GL/cos/cos_001_to_006.html | 129 + .../ogles/GL/cos/cos_float_frag_xvary.frag | 35 + .../ogles/GL/cos/cos_float_frag_xvary_ref.frag | 70 + .../ogles/GL/cos/cos_float_vert_xvary.vert | 36 + .../ogles/GL/cos/cos_float_vert_xvary_ref.vert | 50 + .../ogles/GL/cos/cos_vec2_frag_xvary.frag | 35 + .../ogles/GL/cos/cos_vec2_frag_xvary_ref.frag | 74 + .../ogles/GL/cos/cos_vec2_vert_xvary.vert | 36 + .../ogles/GL/cos/cos_vec2_vert_xvary_ref.vert | 50 + .../ogles/GL/cos/cos_vec3_frag_xvary.frag | 35 + .../ogles/GL/cos/cos_vec3_frag_xvary_ref.frag | 74 + .../ogles/GL/cos/cos_vec3_vert_xvary.vert | 36 + .../ogles/GL/cos/cos_vec3_vert_xvary_ref.vert | 50 + .../conformance/ogles/GL/cos/input.run.txt | 2 + .../ogles/GL/cross/cross_001_to_002.html | 77 + .../GL/cross/cross_vec3_frag_xvaryyconst.frag | 47 + .../GL/cross/cross_vec3_frag_xvaryyconst_ref.frag | 49 + .../GL/cross/cross_vec3_vert_xvaryyconst.vert | 46 + .../GL/cross/cross_vec3_vert_xvaryyconst_ref.vert | 50 + .../conformance/ogles/GL/cross/input.run.txt | 2 + .../conformance/ogles/GL/default/default.frag | 34 + .../conformance/ogles/GL/default/default.vert | 36 + .../ogles/GL/default/default_001_to_001.html | 64 + .../ogles/GL/default/default_textured.frag | 36 + .../ogles/GL/default/default_textured.vert | 39 + .../conformance/ogles/GL/default/expected.frag | 34 + .../conformance/ogles/GL/default/input.run.txt | 2 + .../ogles/GL/degrees/degrees_001_to_006.html | 129 + .../ogles/GL/degrees/degrees_float_frag_xvary.frag | 36 + .../GL/degrees/degrees_float_frag_xvary_ref.frag | 36 + .../ogles/GL/degrees/degrees_float_vert_xvary.vert | 37 + .../GL/degrees/degrees_float_vert_xvary_ref.vert | 37 + .../ogles/GL/degrees/degrees_vec2_frag_xvary.frag | 36 + .../GL/degrees/degrees_vec2_frag_xvary_ref.frag | 36 + .../ogles/GL/degrees/degrees_vec2_vert_xvary.vert | 37 + .../GL/degrees/degrees_vec2_vert_xvary_ref.vert | 37 + .../ogles/GL/degrees/degrees_vec3_frag_xvary.frag | 36 + .../GL/degrees/degrees_vec3_frag_xvary_ref.frag | 36 + .../ogles/GL/degrees/degrees_vec3_vert_xvary.vert | 37 + .../GL/degrees/degrees_vec3_vert_xvary_ref.vert | 37 + .../conformance/ogles/GL/degrees/input.run.txt | 2 + .../ogles/GL/discard/discard_001_to_002.html | 89 + .../ogles/GL/discard/discard_cond_frag.frag | 41 + .../ogles/GL/discard/discard_cond_frag_ref.frag | 44 + .../conformance/ogles/GL/discard/discard_frag.frag | 35 + .../conformance/ogles/GL/discard/input.run.txt | 2 + .../ogles/GL/distance/distance_001_to_006.html | 129 + .../distance/distance_float_frag_xvaryyhalf.frag | 34 + .../distance_float_frag_xvaryyhalf_ref.frag | 34 + .../distance/distance_float_vert_xvaryyhalf.vert | 35 + .../distance_float_vert_xvaryyhalf_ref.vert | 35 + .../GL/distance/distance_vec2_frag_xvaryyhalf.frag | 34 + .../distance_vec2_frag_xvaryyhalf_ref.frag | 34 + .../GL/distance/distance_vec2_vert_xvaryyhalf.vert | 35 + .../distance_vec2_vert_xvaryyhalf_ref.vert | 35 + .../GL/distance/distance_vec3_frag_xvaryyhalf.frag | 34 + .../distance_vec3_frag_xvaryyhalf_ref.frag | 34 + .../GL/distance/distance_vec3_vert_xvaryyhalf.vert | 35 + .../distance_vec3_vert_xvaryyhalf_ref.vert | 35 + .../conformance/ogles/GL/distance/input.run.txt | 2 + .../conformance/ogles/GL/dot/dot_001_to_006.html | 129 + .../ogles/GL/dot/dot_float_frag_xvaryyone.frag | 34 + .../ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag | 34 + .../ogles/GL/dot/dot_float_vert_xvaryyone.vert | 35 + .../ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert | 35 + .../ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag | 34 + .../ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag | 34 + .../ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert | 35 + .../ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert | 35 + .../ogles/GL/dot/dot_vec3_frag_xvaryythird.frag | 34 + .../GL/dot/dot_vec3_frag_xvaryythird_ref.frag | 34 + .../ogles/GL/dot/dot_vec3_vert_xvaryythird.vert | 35 + .../GL/dot/dot_vec3_vert_xvaryythird_ref.vert | 35 + .../conformance/ogles/GL/dot/input.run.txt | 2 + .../ogles/GL/equal/equal_001_to_008.html | 155 + .../ogles/GL/equal/equal_009_to_012.html | 103 + .../ogles/GL/equal/equal_bvec2_frag.frag | 40 + .../ogles/GL/equal/equal_bvec2_frag_ref.frag | 50 + .../ogles/GL/equal/equal_bvec2_vert.vert | 37 + .../ogles/GL/equal/equal_bvec2_vert_ref.vert | 47 + .../ogles/GL/equal/equal_bvec3_frag.frag | 36 + .../ogles/GL/equal/equal_bvec3_frag_ref.frag | 48 + .../ogles/GL/equal/equal_bvec3_vert.vert | 37 + .../ogles/GL/equal/equal_bvec3_vert_ref.vert | 49 + .../ogles/GL/equal/equal_ivec2_frag.frag | 36 + .../ogles/GL/equal/equal_ivec2_frag_ref.frag | 46 + .../ogles/GL/equal/equal_ivec2_vert.vert | 37 + .../ogles/GL/equal/equal_ivec2_vert_ref.vert | 47 + .../ogles/GL/equal/equal_ivec3_frag.frag | 36 + .../ogles/GL/equal/equal_ivec3_frag_ref.frag | 48 + .../ogles/GL/equal/equal_ivec3_vert.vert | 37 + .../ogles/GL/equal/equal_ivec3_vert_ref.vert | 49 + .../ogles/GL/equal/equal_vec2_frag.frag | 40 + .../ogles/GL/equal/equal_vec2_frag_ref.frag | 50 + .../ogles/GL/equal/equal_vec2_vert.vert | 37 + .../ogles/GL/equal/equal_vec2_vert_ref.vert | 47 + .../ogles/GL/equal/equal_vec3_frag.frag | 36 + .../ogles/GL/equal/equal_vec3_frag_ref.frag | 48 + .../ogles/GL/equal/equal_vec3_vert.vert | 37 + .../ogles/GL/equal/equal_vec3_vert_ref.vert | 49 + .../conformance/ogles/GL/equal/input.run.txt | 3 + .../conformance/ogles/GL/exp/exp_001_to_008.html | 155 + .../conformance/ogles/GL/exp/exp_009_to_012.html | 103 + .../ogles/GL/exp/exp_float_frag_xvary.frag | 36 + .../ogles/GL/exp/exp_float_frag_xvary_ref.frag | 37 + .../ogles/GL/exp/exp_float_frag_xvaryneg.frag | 35 + .../ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag | 36 + .../ogles/GL/exp/exp_float_vert_xvary.vert | 37 + .../ogles/GL/exp/exp_float_vert_xvary_ref.vert | 38 + .../ogles/GL/exp/exp_float_vert_xvaryneg.vert | 36 + .../ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert | 37 + .../ogles/GL/exp/exp_vec2_frag_xvary.frag | 36 + .../ogles/GL/exp/exp_vec2_frag_xvary_ref.frag | 37 + .../ogles/GL/exp/exp_vec2_frag_xvaryneg.frag | 35 + .../ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag | 36 + .../ogles/GL/exp/exp_vec2_vert_xvary.vert | 37 + .../ogles/GL/exp/exp_vec2_vert_xvary_ref.vert | 38 + .../ogles/GL/exp/exp_vec2_vert_xvaryneg.vert | 36 + .../ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert | 37 + .../ogles/GL/exp/exp_vec3_frag_xvary.frag | 36 + .../ogles/GL/exp/exp_vec3_frag_xvary_ref.frag | 37 + .../ogles/GL/exp/exp_vec3_frag_xvaryneg.frag | 35 + .../ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag | 36 + .../ogles/GL/exp/exp_vec3_vert_xvary.vert | 37 + .../ogles/GL/exp/exp_vec3_vert_xvary_ref.vert | 38 + .../ogles/GL/exp/exp_vec3_vert_xvaryneg.vert | 36 + .../ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert | 37 + .../conformance/ogles/GL/exp/input.run.txt | 3 + .../conformance/ogles/GL/exp2/exp2_001_to_008.html | 155 + .../conformance/ogles/GL/exp2/exp2_009_to_012.html | 103 + .../ogles/GL/exp2/exp2_float_frag_xvary.frag | 35 + .../ogles/GL/exp2/exp2_float_frag_xvary_ref.frag | 35 + .../ogles/GL/exp2/exp2_float_frag_xvaryneg.frag | 35 + .../GL/exp2/exp2_float_frag_xvaryneg_ref.frag | 35 + .../ogles/GL/exp2/exp2_float_vert_xvary.vert | 36 + .../ogles/GL/exp2/exp2_float_vert_xvary_ref.vert | 36 + .../ogles/GL/exp2/exp2_float_vert_xvaryneg.vert | 36 + .../GL/exp2/exp2_float_vert_xvaryneg_ref.vert | 36 + .../ogles/GL/exp2/exp2_vec2_frag_xvary.frag | 35 + .../ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag | 35 + .../ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag | 35 + .../ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag | 35 + .../ogles/GL/exp2/exp2_vec2_vert_xvary.vert | 36 + .../ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert | 36 + .../ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert | 36 + .../ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert | 36 + .../ogles/GL/exp2/exp2_vec3_frag_xvary.frag | 35 + .../ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag | 35 + .../ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag | 35 + .../ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag | 35 + .../ogles/GL/exp2/exp2_vec3_vert_xvary.vert | 36 + .../ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert | 36 + .../ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert | 36 + .../ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert | 36 + .../conformance/ogles/GL/exp2/input.run.txt | 3 + .../GL/faceforward/faceforward_001_to_006.html | 129 + .../faceforward_float_frag_nvaryiconst.frag | 40 + .../faceforward_float_frag_nvaryiconst_ref.frag | 41 + .../faceforward_float_vert_nvaryiconst.vert | 41 + .../faceforward_float_vert_nvaryiconst_ref.vert | 42 + .../faceforward_vec2_frag_nvaryiconst.frag | 46 + .../faceforward_vec2_frag_nvaryiconst_ref.frag | 47 + .../faceforward_vec2_vert_nvaryiconst.vert | 46 + .../faceforward_vec2_vert_nvaryiconst_ref.vert | 47 + .../faceforward_vec3_frag_nvaryiconst.frag | 47 + .../faceforward_vec3_frag_nvaryiconst_ref.frag | 48 + .../faceforward_vec3_vert_nvaryiconst.vert | 47 + .../faceforward_vec3_vert_nvaryiconst_ref.vert | 48 + .../conformance/ogles/GL/faceforward/input.run.txt | 2 + .../ogles/GL/floor/floor_001_to_006.html | 129 + .../ogles/GL/floor/floor_float_frag_xvary.frag | 35 + .../ogles/GL/floor/floor_float_frag_xvary_ref.frag | 44 + .../ogles/GL/floor/floor_float_vert_xvary.vert | 36 + .../ogles/GL/floor/floor_float_vert_xvary_ref.vert | 45 + .../ogles/GL/floor/floor_vec2_frag_xvary.frag | 35 + .../ogles/GL/floor/floor_vec2_frag_xvary_ref.frag | 48 + .../ogles/GL/floor/floor_vec2_vert_xvary.vert | 36 + .../ogles/GL/floor/floor_vec2_vert_xvary_ref.vert | 49 + .../ogles/GL/floor/floor_vec3_frag_xvary.frag | 35 + .../ogles/GL/floor/floor_vec3_frag_xvary_ref.frag | 52 + .../ogles/GL/floor/floor_vec3_vert_xvary.vert | 36 + .../ogles/GL/floor/floor_vec3_vert_xvary_ref.vert | 53 + .../conformance/ogles/GL/floor/input.run.txt | 2 + .../ogles/GL/fract/fract_001_to_006.html | 129 + .../ogles/GL/fract/fract_float_frag_xvary.frag | 36 + .../ogles/GL/fract/fract_float_frag_xvary_ref.frag | 36 + .../ogles/GL/fract/fract_float_vert_xvary.vert | 37 + .../ogles/GL/fract/fract_float_vert_xvary_ref.vert | 37 + .../ogles/GL/fract/fract_vec2_frag_xvary.frag | 36 + .../ogles/GL/fract/fract_vec2_frag_xvary_ref.frag | 36 + .../ogles/GL/fract/fract_vec2_vert_xvary.vert | 37 + .../ogles/GL/fract/fract_vec2_vert_xvary_ref.vert | 37 + .../ogles/GL/fract/fract_vec3_frag_xvary.frag | 36 + .../ogles/GL/fract/fract_vec3_frag_xvary_ref.frag | 36 + .../ogles/GL/fract/fract_vec3_vert_xvary.vert | 37 + .../ogles/GL/fract/fract_vec3_vert_xvary_ref.vert | 37 + .../conformance/ogles/GL/fract/input.run.txt | 2 + .../ogles/GL/functions/array_float_frag.frag | 102 + .../ogles/GL/functions/array_float_vert.vert | 103 + .../bool_empty_empty_bool_array_frag.frag | 91 + .../bool_empty_empty_bool_array_vert.vert | 91 + .../bool_empty_empty_bool_empty_frag.frag | 65 + .../bool_empty_empty_bool_empty_vert.vert | 65 + .../functions/bool_empty_in_bool_array_frag.frag | 91 + .../functions/bool_empty_in_bool_array_vert.vert | 91 + .../functions/bool_empty_in_bool_empty_frag.frag | 65 + .../functions/bool_empty_in_bool_empty_vert.vert | 65 + .../bool_empty_inout_bool_array_frag.frag | 91 + .../bool_empty_inout_bool_array_vert.vert | 91 + .../bool_empty_inout_bool_empty_frag.frag | 65 + .../bool_empty_inout_bool_empty_vert.vert | 65 + .../functions/bool_empty_out_bool_array_frag.frag | 85 + .../functions/bool_empty_out_bool_array_vert.vert | 85 + .../functions/bool_empty_out_bool_empty_frag.frag | 59 + .../functions/bool_empty_out_bool_empty_vert.vert | 59 + .../bvec4_empty_empty_bvec4_array_frag.frag | 108 + .../bvec4_empty_empty_bvec4_array_vert.vert | 108 + .../bvec4_empty_empty_bvec4_empty_frag.frag | 91 + .../bvec4_empty_empty_bvec4_empty_vert.vert | 91 + .../functions/bvec4_empty_in_bvec4_array_frag.frag | 108 + .../functions/bvec4_empty_in_bvec4_array_vert.vert | 108 + .../functions/bvec4_empty_in_bvec4_empty_frag.frag | 91 + .../functions/bvec4_empty_in_bvec4_empty_vert.vert | 91 + .../bvec4_empty_inout_bvec4_array_frag.frag | 108 + .../bvec4_empty_inout_bvec4_array_vert.vert | 108 + .../bvec4_empty_inout_bvec4_bigarray_frag.frag | 129 + .../bvec4_empty_inout_bvec4_bigarray_vert.vert | 129 + .../bvec4_empty_inout_bvec4_empty_frag.frag | 91 + .../bvec4_empty_inout_bvec4_empty_vert.vert | 91 + .../bvec4_empty_out_bvec4_array_frag.frag | 102 + .../bvec4_empty_out_bvec4_array_vert.vert | 102 + .../bvec4_empty_out_bvec4_empty_frag.frag | 85 + .../bvec4_empty_out_bvec4_empty_vert.vert | 85 + .../float_empty_empty_float_array_frag.frag | 91 + .../float_empty_empty_float_array_vert.vert | 91 + .../float_empty_empty_float_empty_frag.frag | 65 + .../float_empty_empty_float_empty_vert.vert | 65 + .../functions/float_empty_in_float_array_frag.frag | 91 + .../functions/float_empty_in_float_array_vert.vert | 91 + .../functions/float_empty_in_float_empty_frag.frag | 65 + .../functions/float_empty_in_float_empty_vert.vert | 65 + .../float_empty_inout_float_array_frag.frag | 91 + .../float_empty_inout_float_array_vert.vert | 91 + .../float_empty_inout_float_empty_frag.frag | 65 + .../float_empty_inout_float_empty_vert.vert | 65 + .../float_empty_out_float_array_frag.frag | 85 + .../float_empty_out_float_array_vert.vert | 85 + .../float_empty_out_float_empty_frag.frag | 59 + .../float_empty_out_float_empty_vert.vert | 59 + .../ogles/GL/functions/functions_001_to_008.html | 251 + .../ogles/GL/functions/functions_009_to_016.html | 251 + .../ogles/GL/functions/functions_017_to_024.html | 251 + .../ogles/GL/functions/functions_025_to_032.html | 251 + .../ogles/GL/functions/functions_033_to_040.html | 251 + .../ogles/GL/functions/functions_041_to_048.html | 251 + .../ogles/GL/functions/functions_049_to_056.html | 251 + .../ogles/GL/functions/functions_057_to_064.html | 251 + .../ogles/GL/functions/functions_065_to_072.html | 251 + .../ogles/GL/functions/functions_073_to_080.html | 251 + .../ogles/GL/functions/functions_081_to_088.html | 251 + .../ogles/GL/functions/functions_089_to_096.html | 251 + .../ogles/GL/functions/functions_097_to_104.html | 251 + .../ogles/GL/functions/functions_105_to_112.html | 251 + .../ogles/GL/functions/functions_113_to_120.html | 251 + .../ogles/GL/functions/functions_121_to_126.html | 201 + .../conformance/ogles/GL/functions/input.run.txt | 17 + .../functions/int_empty_empty_int_array_frag.frag | 91 + .../functions/int_empty_empty_int_array_vert.vert | 91 + .../functions/int_empty_empty_int_empty_frag.frag | 65 + .../functions/int_empty_empty_int_empty_vert.vert | 65 + .../GL/functions/int_empty_in_int_array_frag.frag | 91 + .../GL/functions/int_empty_in_int_array_vert.vert | 91 + .../GL/functions/int_empty_in_int_empty_frag.frag | 65 + .../GL/functions/int_empty_in_int_empty_vert.vert | 65 + .../functions/int_empty_inout_int_array_frag.frag | 91 + .../functions/int_empty_inout_int_array_vert.vert | 91 + .../functions/int_empty_inout_int_empty_frag.frag | 65 + .../functions/int_empty_inout_int_empty_vert.vert | 65 + .../GL/functions/int_empty_out_int_array_frag.frag | 85 + .../GL/functions/int_empty_out_int_array_vert.vert | 85 + .../GL/functions/int_empty_out_int_empty_frag.frag | 59 + .../GL/functions/int_empty_out_int_empty_vert.vert | 59 + .../ivec4_empty_empty_ivec4_array_frag.frag | 108 + .../ivec4_empty_empty_ivec4_array_vert.vert | 108 + .../ivec4_empty_empty_ivec4_empty_frag.frag | 91 + .../ivec4_empty_empty_ivec4_empty_vert.vert | 91 + .../functions/ivec4_empty_in_ivec4_array_frag.frag | 108 + .../functions/ivec4_empty_in_ivec4_array_vert.vert | 108 + .../functions/ivec4_empty_in_ivec4_empty_frag.frag | 91 + .../functions/ivec4_empty_in_ivec4_empty_vert.vert | 91 + .../ivec4_empty_inout_ivec4_array_frag.frag | 108 + .../ivec4_empty_inout_ivec4_array_vert.vert | 108 + .../ivec4_empty_inout_ivec4_bigarray_frag.frag | 129 + .../ivec4_empty_inout_ivec4_bigarray_vert.vert | 129 + .../ivec4_empty_inout_ivec4_empty_frag.frag | 91 + .../ivec4_empty_inout_ivec4_empty_vert.vert | 91 + .../ivec4_empty_out_ivec4_array_frag.frag | 102 + .../ivec4_empty_out_ivec4_array_vert.vert | 102 + .../ivec4_empty_out_ivec4_empty_frag.frag | 85 + .../ivec4_empty_out_ivec4_empty_vert.vert | 85 + .../mat4_empty_empty_mat4_array_frag.frag | 141 + .../mat4_empty_empty_mat4_array_vert.vert | 141 + .../mat4_empty_empty_mat4_empty_frag.frag | 145 + .../mat4_empty_empty_mat4_empty_vert.vert | 145 + .../functions/mat4_empty_in_mat4_array_frag.frag | 141 + .../functions/mat4_empty_in_mat4_array_vert.vert | 141 + .../functions/mat4_empty_in_mat4_empty_frag.frag | 145 + .../functions/mat4_empty_in_mat4_empty_vert.vert | 145 + .../mat4_empty_inout_mat4_array_frag.frag | 141 + .../mat4_empty_inout_mat4_array_vert.vert | 141 + .../mat4_empty_inout_mat4_empty_frag.frag | 145 + .../mat4_empty_inout_mat4_empty_vert.vert | 145 + .../functions/mat4_empty_out_mat4_array_frag.frag | 135 + .../functions/mat4_empty_out_mat4_array_vert.vert | 135 + .../functions/mat4_empty_out_mat4_empty_frag.frag | 136 + .../functions/mat4_empty_out_mat4_empty_vert.vert | 136 + .../ogles/GL/functions/qualifiers_float_frag.frag | 59 + .../ogles/GL/functions/qualifiers_float_vert.vert | 59 + .../ogles/GL/functions/qualifiers_struct_frag.frag | 83 + .../ogles/GL/functions/qualifiers_struct_vert.vert | 87 + .../vec4_empty_empty_vec4_array_frag.frag | 108 + .../vec4_empty_empty_vec4_array_vert.vert | 108 + .../vec4_empty_empty_vec4_empty_frag.frag | 91 + .../vec4_empty_empty_vec4_empty_vert.vert | 91 + .../functions/vec4_empty_in_vec4_array_frag.frag | 108 + .../functions/vec4_empty_in_vec4_array_vert.vert | 108 + .../functions/vec4_empty_in_vec4_empty_frag.frag | 91 + .../functions/vec4_empty_in_vec4_empty_vert.vert | 91 + .../vec4_empty_inout_vec4_array_frag.frag | 108 + .../vec4_empty_inout_vec4_array_vert.vert | 108 + .../vec4_empty_inout_vec4_bigarray_frag.frag | 129 + .../vec4_empty_inout_vec4_bigarray_vert.vert | 129 + .../vec4_empty_inout_vec4_empty_frag.frag | 91 + .../vec4_empty_inout_vec4_empty_vert.vert | 91 + .../functions/vec4_empty_out_vec4_array_frag.frag | 102 + .../functions/vec4_empty_out_vec4_array_vert.vert | 102 + .../functions/vec4_empty_out_vec4_empty_frag.frag | 85 + .../functions/vec4_empty_out_vec4_empty_vert.vert | 85 + .../void_empty_empty_void_empty_frag.frag | 49 + .../void_empty_empty_void_empty_vert.vert | 49 + .../GL/gl_FragCoord/gl_FragCoord_001_to_003.html | 110 + .../ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag | 32 + .../GL/gl_FragCoord/gl_FragCoord_xy_frag.frag | 36 + .../GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag | 37 + .../ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag | 32 + .../GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag | 42 + .../GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert | 36 + .../ogles/GL/gl_FragCoord/input.run.txt | 2 + .../gl_FrontFacing/gl_FrontFacing_001_to_001.html | 64 + .../GL/gl_FrontFacing/gl_FrontFacing_frag.frag | 35 + .../ogles/GL/gl_FrontFacing/input.run.txt | 2 + .../GL/greaterThan/greaterThan_001_to_008.html | 155 + .../GL/greaterThan/greaterThan_ivec2_frag.frag | 36 + .../GL/greaterThan/greaterThan_ivec2_frag_ref.frag | 46 + .../GL/greaterThan/greaterThan_ivec2_vert.vert | 37 + .../GL/greaterThan/greaterThan_ivec2_vert_ref.vert | 47 + .../GL/greaterThan/greaterThan_ivec3_frag.frag | 36 + .../GL/greaterThan/greaterThan_ivec3_frag_ref.frag | 48 + .../GL/greaterThan/greaterThan_ivec3_vert.vert | 37 + .../GL/greaterThan/greaterThan_ivec3_vert_ref.vert | 49 + .../GL/greaterThan/greaterThan_vec2_frag.frag | 40 + .../GL/greaterThan/greaterThan_vec2_frag_ref.frag | 50 + .../GL/greaterThan/greaterThan_vec2_vert.vert | 37 + .../GL/greaterThan/greaterThan_vec2_vert_ref.vert | 47 + .../GL/greaterThan/greaterThan_vec3_frag.frag | 36 + .../GL/greaterThan/greaterThan_vec3_frag_ref.frag | 48 + .../GL/greaterThan/greaterThan_vec3_vert.vert | 37 + .../GL/greaterThan/greaterThan_vec3_vert_ref.vert | 49 + .../conformance/ogles/GL/greaterThan/input.run.txt | 2 + .../greaterThanEqual_001_to_008.html | 155 + .../greaterThanEqual_ivec2_frag.frag | 36 + .../greaterThanEqual_ivec2_frag_ref.frag | 46 + .../greaterThanEqual_ivec2_vert.vert | 37 + .../greaterThanEqual_ivec2_vert_ref.vert | 47 + .../greaterThanEqual_ivec3_frag.frag | 36 + .../greaterThanEqual_ivec3_frag_ref.frag | 48 + .../greaterThanEqual_ivec3_vert.vert | 37 + .../greaterThanEqual_ivec3_vert_ref.vert | 49 + .../greaterThanEqual_vec2_frag.frag | 40 + .../greaterThanEqual_vec2_frag_ref.frag | 50 + .../greaterThanEqual_vec2_vert.vert | 37 + .../greaterThanEqual_vec2_vert_ref.vert | 47 + .../greaterThanEqual_vec3_frag.frag | 36 + .../greaterThanEqual_vec3_frag_ref.frag | 48 + .../greaterThanEqual_vec3_vert.vert | 37 + .../greaterThanEqual_vec3_vert_ref.vert | 49 + .../ogles/GL/greaterThanEqual/input.run.txt | 2 + .../conformance/ogles/GL/inversesqrt/input.run.txt | 2 + .../GL/inversesqrt/inversesqrt_001_to_006.html | 129 + .../inversesqrt/inversesqrt_float_frag_xvary.frag | 35 + .../inversesqrt_float_frag_xvary_ref.frag | 35 + .../inversesqrt/inversesqrt_float_vert_xvary.vert | 36 + .../inversesqrt_float_vert_xvary_ref.vert | 36 + .../inversesqrt/inversesqrt_vec2_frag_xvary.frag | 35 + .../inversesqrt_vec2_frag_xvary_ref.frag | 35 + .../inversesqrt/inversesqrt_vec2_vert_xvary.vert | 36 + .../inversesqrt_vec2_vert_xvary_ref.vert | 36 + .../inversesqrt/inversesqrt_vec3_frag_xvary.frag | 35 + .../inversesqrt_vec3_frag_xvary_ref.frag | 35 + .../inversesqrt/inversesqrt_vec3_vert_xvary.vert | 36 + .../inversesqrt_vec3_vert_xvary_ref.vert | 36 + .../conformance/ogles/GL/length/input.run.txt | 2 + .../ogles/GL/length/length_001_to_006.html | 129 + .../ogles/GL/length/length_float_frag_xvary.frag | 34 + .../GL/length/length_float_frag_xvary_ref.frag | 34 + .../ogles/GL/length/length_float_vert_xvary.vert | 35 + .../GL/length/length_float_vert_xvary_ref.vert | 35 + .../ogles/GL/length/length_vec2_frag_xvary.frag | 34 + .../GL/length/length_vec2_frag_xvary_ref.frag | 34 + .../ogles/GL/length/length_vec2_vert_xvary.vert | 35 + .../GL/length/length_vec2_vert_xvary_ref.vert | 35 + .../ogles/GL/length/length_vec3_frag_xvary.frag | 34 + .../GL/length/length_vec3_frag_xvary_ref.frag | 34 + .../ogles/GL/length/length_vec3_vert_xvary.vert | 35 + .../GL/length/length_vec3_vert_xvary_ref.vert | 35 + .../conformance/ogles/GL/lessThan/input.run.txt | 2 + .../ogles/GL/lessThan/lessThan_001_to_008.html | 155 + .../ogles/GL/lessThan/lessThan_ivec2_frag.frag | 36 + .../ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag | 46 + .../ogles/GL/lessThan/lessThan_ivec2_vert.vert | 37 + .../ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert | 47 + .../ogles/GL/lessThan/lessThan_ivec3_frag.frag | 36 + .../ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag | 48 + .../ogles/GL/lessThan/lessThan_ivec3_vert.vert | 37 + .../ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert | 49 + .../ogles/GL/lessThan/lessThan_vec2_frag.frag | 40 + .../ogles/GL/lessThan/lessThan_vec2_frag_ref.frag | 50 + .../ogles/GL/lessThan/lessThan_vec2_vert.vert | 37 + .../ogles/GL/lessThan/lessThan_vec2_vert_ref.vert | 47 + .../ogles/GL/lessThan/lessThan_vec3_frag.frag | 36 + .../ogles/GL/lessThan/lessThan_vec3_frag_ref.frag | 48 + .../ogles/GL/lessThan/lessThan_vec3_vert.vert | 37 + .../ogles/GL/lessThan/lessThan_vec3_vert_ref.vert | 49 + .../ogles/GL/lessThanEqual/input.run.txt | 2 + .../GL/lessThanEqual/lessThanEqual_001_to_008.html | 155 + .../GL/lessThanEqual/lessThanEqual_ivec2_frag.frag | 36 + .../lessThanEqual_ivec2_frag_ref.frag | 46 + .../GL/lessThanEqual/lessThanEqual_ivec2_vert.vert | 37 + .../lessThanEqual_ivec2_vert_ref.vert | 47 + .../GL/lessThanEqual/lessThanEqual_ivec3_frag.frag | 36 + .../lessThanEqual_ivec3_frag_ref.frag | 48 + .../GL/lessThanEqual/lessThanEqual_ivec3_vert.vert | 37 + .../lessThanEqual_ivec3_vert_ref.vert | 49 + .../GL/lessThanEqual/lessThanEqual_vec2_frag.frag | 40 + .../lessThanEqual/lessThanEqual_vec2_frag_ref.frag | 50 + .../GL/lessThanEqual/lessThanEqual_vec2_vert.vert | 37 + .../lessThanEqual/lessThanEqual_vec2_vert_ref.vert | 47 + .../GL/lessThanEqual/lessThanEqual_vec3_frag.frag | 36 + .../lessThanEqual/lessThanEqual_vec3_frag_ref.frag | 48 + .../GL/lessThanEqual/lessThanEqual_vec3_vert.vert | 37 + .../lessThanEqual/lessThanEqual_vec3_vert_ref.vert | 49 + .../conformance/ogles/GL/log/input.run.txt | 3 + .../conformance/ogles/GL/log/log_001_to_008.html | 155 + .../conformance/ogles/GL/log/log_009_to_012.html | 103 + .../ogles/GL/log/log_float_frag_xvary.frag | 35 + .../ogles/GL/log/log_float_frag_xvary01.frag | 35 + .../ogles/GL/log/log_float_frag_xvary01_ref.frag | 53 + .../ogles/GL/log/log_float_frag_xvary_ref.frag | 50 + .../ogles/GL/log/log_float_vert_xvary.vert | 36 + .../ogles/GL/log/log_float_vert_xvary01.vert | 36 + .../ogles/GL/log/log_float_vert_xvary01_ref.vert | 54 + .../ogles/GL/log/log_float_vert_xvary_ref.vert | 51 + .../ogles/GL/log/log_vec2_frag_xvary.frag | 35 + .../ogles/GL/log/log_vec2_frag_xvary01.frag | 35 + .../ogles/GL/log/log_vec2_frag_xvary01_ref.frag | 53 + .../ogles/GL/log/log_vec2_frag_xvary_ref.frag | 50 + .../ogles/GL/log/log_vec2_vert_xvary.vert | 36 + .../ogles/GL/log/log_vec2_vert_xvary01.vert | 36 + .../ogles/GL/log/log_vec2_vert_xvary01_ref.vert | 54 + .../ogles/GL/log/log_vec2_vert_xvary_ref.vert | 51 + .../ogles/GL/log/log_vec3_frag_xvary.frag | 35 + .../ogles/GL/log/log_vec3_frag_xvary01.frag | 35 + .../ogles/GL/log/log_vec3_frag_xvary01_ref.frag | 53 + .../ogles/GL/log/log_vec3_frag_xvary_ref.frag | 50 + .../ogles/GL/log/log_vec3_vert_xvary.vert | 36 + .../ogles/GL/log/log_vec3_vert_xvary01.vert | 36 + .../ogles/GL/log/log_vec3_vert_xvary01_ref.vert | 54 + .../ogles/GL/log/log_vec3_vert_xvary_ref.vert | 51 + .../conformance/ogles/GL/log2/input.run.txt | 3 + .../conformance/ogles/GL/log2/log2_001_to_008.html | 155 + .../conformance/ogles/GL/log2/log2_009_to_012.html | 103 + .../ogles/GL/log2/log2_float_frag_xvary.frag | 35 + .../ogles/GL/log2/log2_float_frag_xvary01.frag | 35 + .../ogles/GL/log2/log2_float_frag_xvary01_ref.frag | 56 + .../ogles/GL/log2/log2_float_frag_xvary_ref.frag | 53 + .../ogles/GL/log2/log2_float_vert_xvary.vert | 36 + .../ogles/GL/log2/log2_float_vert_xvary01.vert | 36 + .../ogles/GL/log2/log2_float_vert_xvary01_ref.vert | 57 + .../ogles/GL/log2/log2_float_vert_xvary_ref.vert | 52 + .../ogles/GL/log2/log2_vec2_frag_xvary.frag | 35 + .../ogles/GL/log2/log2_vec2_frag_xvary01.frag | 35 + .../ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag | 56 + .../ogles/GL/log2/log2_vec2_frag_xvary_ref.frag | 53 + .../ogles/GL/log2/log2_vec2_vert_xvary.vert | 36 + .../ogles/GL/log2/log2_vec2_vert_xvary01.vert | 36 + .../ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert | 57 + .../ogles/GL/log2/log2_vec2_vert_xvary_ref.vert | 54 + .../ogles/GL/log2/log2_vec3_frag_xvary.frag | 35 + .../ogles/GL/log2/log2_vec3_frag_xvary01.frag | 35 + .../ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag | 56 + .../ogles/GL/log2/log2_vec3_frag_xvary_ref.frag | 53 + .../ogles/GL/log2/log2_vec3_vert_xvary.vert | 36 + .../ogles/GL/log2/log2_vec3_vert_xvary01.vert | 36 + .../ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert | 57 + .../ogles/GL/log2/log2_vec3_vert_xvary_ref.vert | 54 + .../ogles/GL/mat/array_const_mat2_frag.frag | 50 + .../ogles/GL/mat/array_const_mat2_vert.vert | 50 + .../ogles/GL/mat/array_const_mat3_frag.frag | 54 + .../ogles/GL/mat/array_const_mat3_vert.vert | 54 + .../ogles/GL/mat/array_const_mat4_frag.frag | 56 + .../ogles/GL/mat/array_const_mat4_vert.vert | 56 + .../ogles/GL/mat/const_mat2_copy_frag.frag | 73 + .../ogles/GL/mat/const_mat2_copy_vert.vert | 72 + .../conformance/ogles/GL/mat/const_mat2_frag.frag | 70 + .../conformance/ogles/GL/mat/const_mat2_vert.vert | 69 + .../ogles/GL/mat/const_mat3_copy_frag.frag | 83 + .../ogles/GL/mat/const_mat3_copy_vert.vert | 83 + .../conformance/ogles/GL/mat/const_mat3_frag.frag | 80 + .../conformance/ogles/GL/mat/const_mat3_vert.vert | 79 + .../ogles/GL/mat/const_mat4_copy_frag.frag | 95 + .../ogles/GL/mat/const_mat4_copy_vert.vert | 94 + .../conformance/ogles/GL/mat/const_mat4_frag.frag | 92 + .../conformance/ogles/GL/mat/const_mat4_vert.vert | 91 + .../conformance/ogles/GL/mat/input.run.txt | 7 + .../conformance/ogles/GL/mat/mat2_2vec2_frag.frag | 43 + .../conformance/ogles/GL/mat/mat2_2vec2_vert.vert | 45 + .../conformance/ogles/GL/mat/mat2_4float_frag.frag | 43 + .../conformance/ogles/GL/mat/mat2_4float_vert.vert | 45 + .../conformance/ogles/GL/mat/mat2_copy_frag.frag | 73 + .../conformance/ogles/GL/mat/mat2_copy_vert.vert | 72 + .../conformance/ogles/GL/mat/mat2_float_frag.frag | 48 + .../conformance/ogles/GL/mat/mat2_float_vert.vert | 47 + .../conformance/ogles/GL/mat/mat2_frag.frag | 70 + .../conformance/ogles/GL/mat/mat2_vert.vert | 69 + .../conformance/ogles/GL/mat/mat3_3vec3_frag.frag | 48 + .../conformance/ogles/GL/mat/mat3_3vec3_vert.vert | 49 + .../conformance/ogles/GL/mat/mat3_9float_frag.frag | 48 + .../conformance/ogles/GL/mat/mat3_9float_vert.vert | 50 + .../conformance/ogles/GL/mat/mat3_copy_frag.frag | 83 + .../conformance/ogles/GL/mat/mat3_copy_vert.vert | 82 + .../conformance/ogles/GL/mat/mat3_float_frag.frag | 59 + .../conformance/ogles/GL/mat/mat3_float_vert.vert | 59 + .../conformance/ogles/GL/mat/mat3_frag.frag | 80 + .../conformance/ogles/GL/mat/mat3_vert.vert | 79 + .../ogles/GL/mat/mat4_16float_frag.frag | 74 + .../ogles/GL/mat/mat4_16float_vert.vert | 71 + .../conformance/ogles/GL/mat/mat4_4vec4_frag.frag | 76 + .../conformance/ogles/GL/mat/mat4_4vec4_vert.vert | 73 + .../conformance/ogles/GL/mat/mat4_copy_frag.frag | 95 + .../conformance/ogles/GL/mat/mat4_copy_vert.vert | 94 + .../conformance/ogles/GL/mat/mat4_frag.frag | 92 + .../conformance/ogles/GL/mat/mat4_vert.vert | 91 + .../conformance/ogles/GL/mat/mat_001_to_008.html | 251 + .../conformance/ogles/GL/mat/mat_009_to_016.html | 251 + .../conformance/ogles/GL/mat/mat_017_to_024.html | 251 + .../conformance/ogles/GL/mat/mat_025_to_032.html | 251 + .../conformance/ogles/GL/mat/mat_033_to_040.html | 251 + .../conformance/ogles/GL/mat/mat_041_to_046.html | 201 + .../conformance/ogles/GL/mat3/input.run.txt | 2 + .../conformance/ogles/GL/mat3/mat3_001_to_006.html | 363 + .../ogles/GL/mat3/mat3arrayindirect0_frag.frag | 53 + .../ogles/GL/mat3/mat3arrayindirect0_vert.vert | 52 + .../ogles/GL/mat3/mat3arrayindirect1_frag.frag | 53 + .../ogles/GL/mat3/mat3arrayindirect1_vert.vert | 53 + .../ogles/GL/mat3/mat3arraysimple_frag.frag | 43 + .../ogles/GL/mat3/mat3arraysimple_vert.vert | 49 + .../ogles/GL/matrixCompMult/input.run.txt | 2 + .../matrixCompMult/matrixCompMult_001_to_004.html | 103 + .../matrixCompMult/matrixMultComp_mat2_frag.frag | 39 + .../matrixMultComp_mat2_frag_ref.frag | 43 + .../matrixCompMult/matrixMultComp_mat2_vert.vert | 40 + .../matrixMultComp_mat2_vert_ref.vert | 44 + .../matrixCompMult/matrixMultComp_mat3_frag.frag | 53 + .../matrixMultComp_mat3_frag_ref.frag | 59 + .../matrixCompMult/matrixMultComp_mat3_vert.vert | 54 + .../matrixMultComp_mat3_vert_ref.vert | 64 + .../conformance/ogles/GL/max/input.run.txt | 2 + .../conformance/ogles/GL/max/max_001_to_006.html | 129 + .../GL/max/max_float_frag_xvary_yconsthalf.frag | 36 + .../max/max_float_frag_xvary_yconsthalf_ref.frag | 38 + .../GL/max/max_float_vert_xvary_yconsthalf.vert | 37 + .../max/max_float_vert_xvary_yconsthalf_ref.vert | 39 + .../GL/max/max_vec2_frag_xvary_yconsthalf.frag | 36 + .../GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag | 39 + .../GL/max/max_vec2_vert_xvary_yconsthalf.vert | 37 + .../GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert | 40 + .../GL/max/max_vec3_frag_xvary_yconsthalf.frag | 36 + .../GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag | 40 + .../GL/max/max_vec3_vert_xvary_yconsthalf.vert | 37 + .../GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert | 41 + .../conformance/ogles/GL/min/input.run.txt | 2 + .../conformance/ogles/GL/min/min_001_to_006.html | 129 + .../GL/min/min_float_frag_xvary_yconsthalf.frag | 36 + .../min/min_float_frag_xvary_yconsthalf_ref.frag | 38 + .../GL/min/min_float_vert_xvary_yconsthalf.vert | 37 + .../min/min_float_vert_xvary_yconsthalf_ref.vert | 39 + .../GL/min/min_vec2_frag_xvary_yconsthalf.frag | 36 + .../GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag | 40 + .../GL/min/min_vec2_vert_xvary_yconsthalf.vert | 37 + .../GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert | 40 + .../GL/min/min_vec3_frag_xvary_yconsthalf.frag | 36 + .../GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag | 40 + .../GL/min/min_vec3_vert_xvary_yconsthalf.vert | 37 + .../GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert | 41 + .../conformance/ogles/GL/mix/input.run.txt | 2 + .../conformance/ogles/GL/mix/mix_001_to_006.html | 129 + ...mix_float_frag_xvary_yconsthalf_aconsthalf.frag | 37 + ...float_frag_xvary_yconsthalf_aconsthalf_ref.frag | 38 + ...mix_float_vert_xvary_yconsthalf_aconsthalf.vert | 38 + ...float_vert_xvary_yconsthalf_aconsthalf_ref.vert | 39 + .../mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag | 36 + ..._vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag | 38 + .../mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert | 37 + ..._vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert | 39 + .../mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag | 36 + ..._vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag | 38 + .../mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert | 37 + ..._vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert | 39 + .../conformance/ogles/GL/mod/input.run.txt | 2 + .../conformance/ogles/GL/mod/mod_001_to_008.html | 179 + .../ogles/GL/mod/mod_float_frag_xvary_yconst1.frag | 35 + .../GL/mod/mod_float_frag_xvary_yconst1_ref.frag | 36 + .../ogles/GL/mod/mod_float_vert_xvary_yconst1.vert | 36 + .../GL/mod/mod_float_vert_xvary_yconst1_ref.vert | 37 + .../ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag | 35 + .../GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag | 36 + .../ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert | 36 + .../GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert | 37 + .../ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag | 35 + .../GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag | 36 + .../ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert | 36 + .../GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert | 37 + .../ogles/GL/mod/mod_x_large_y_large_frag.frag | 35 + .../ogles/GL/mod/mod_x_large_y_large_vert.vert | 34 + .../conformance/ogles/GL/normalize/input.run.txt | 2 + .../ogles/GL/normalize/normalize_001_to_006.html | 129 + .../GL/normalize/normalize_float_frag_xvary.frag | 35 + .../normalize/normalize_float_frag_xvary_ref.frag | 35 + .../GL/normalize/normalize_float_vert_xvary.vert | 36 + .../normalize/normalize_float_vert_xvary_ref.vert | 36 + .../GL/normalize/normalize_vec2_frag_xvary.frag | 35 + .../normalize/normalize_vec2_frag_xvary_ref.frag | 35 + .../GL/normalize/normalize_vec2_vert_xvary.vert | 36 + .../normalize/normalize_vec2_vert_xvary_ref.vert | 36 + .../GL/normalize/normalize_vec3_frag_xvary.frag | 35 + .../normalize/normalize_vec3_frag_xvary_ref.frag | 35 + .../GL/normalize/normalize_vec3_vert_xvary.vert | 36 + .../normalize/normalize_vec3_vert_xvary_ref.vert | 36 + .../conformance/ogles/GL/not/input.run.txt | 2 + .../conformance/ogles/GL/not/not_001_to_004.html | 103 + .../conformance/ogles/GL/not/not_bvec2_frag.frag | 39 + .../ogles/GL/not/not_bvec2_frag_ref.frag | 49 + .../conformance/ogles/GL/not/not_bvec2_vert.vert | 36 + .../ogles/GL/not/not_bvec2_vert_ref.vert | 46 + .../conformance/ogles/GL/not/not_bvec3_frag.frag | 35 + .../ogles/GL/not/not_bvec3_frag_ref.frag | 47 + .../conformance/ogles/GL/not/not_bvec3_vert.vert | 36 + .../ogles/GL/not/not_bvec3_vert_ref.vert | 48 + .../conformance/ogles/GL/notEqual/input.run.txt | 3 + .../ogles/GL/notEqual/notEqual_001_to_008.html | 155 + .../ogles/GL/notEqual/notEqual_009_to_012.html | 103 + .../ogles/GL/notEqual/notEqual_bvec2_frag.frag | 40 + .../ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag | 50 + .../ogles/GL/notEqual/notEqual_bvec2_vert.vert | 37 + .../ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert | 47 + .../ogles/GL/notEqual/notEqual_bvec3_frag.frag | 36 + .../ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag | 48 + .../ogles/GL/notEqual/notEqual_bvec3_vert.vert | 37 + .../ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert | 49 + .../ogles/GL/notEqual/notEqual_ivec2_frag.frag | 36 + .../ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag | 46 + .../ogles/GL/notEqual/notEqual_ivec2_vert.vert | 37 + .../ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert | 47 + .../ogles/GL/notEqual/notEqual_ivec3_frag.frag | 36 + .../ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag | 48 + .../ogles/GL/notEqual/notEqual_ivec3_vert.vert | 37 + .../ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert | 49 + .../ogles/GL/notEqual/notEqual_vec2_frag.frag | 40 + .../ogles/GL/notEqual/notEqual_vec2_frag_ref.frag | 50 + .../ogles/GL/notEqual/notEqual_vec2_vert.vert | 37 + .../ogles/GL/notEqual/notEqual_vec2_vert_ref.vert | 47 + .../ogles/GL/notEqual/notEqual_vec3_frag.frag | 36 + .../ogles/GL/notEqual/notEqual_vec3_frag_ref.frag | 48 + .../ogles/GL/notEqual/notEqual_vec3_vert.vert | 37 + .../ogles/GL/notEqual/notEqual_vec3_vert_ref.vert | 49 + .../ogles/GL/operators/addsubtract_frag.frag | 42 + .../ogles/GL/operators/addsubtract_vert.vert | 42 + .../ogles/GL/operators/assignments_frag.frag | 78 + .../ogles/GL/operators/assignments_vert.vert | 78 + .../ogles/GL/operators/division_frag.frag | 42 + .../ogles/GL/operators/division_vert.vert | 42 + .../ogles/GL/operators/equality_frag.frag | 43 + .../ogles/GL/operators/equality_vert.vert | 43 + .../conformance/ogles/GL/operators/input.run.txt | 5 + .../ogles/GL/operators/logical_frag.frag | 111 + .../ogles/GL/operators/logical_vert.vert | 111 + .../ogles/GL/operators/multiplicative_frag.frag | 41 + .../ogles/GL/operators/multiplicative_vert.vert | 41 + .../ogles/GL/operators/operators_001_to_008.html | 251 + .../ogles/GL/operators/operators_009_to_016.html | 251 + .../ogles/GL/operators/operators_017_to_024.html | 251 + .../ogles/GL/operators/operators_025_to_026.html | 101 + .../ogles/GL/operators/postfixdecrement_frag.frag | 40 + .../ogles/GL/operators/postfixdecrement_vert.vert | 40 + .../ogles/GL/operators/postfixincrement_frag.frag | 40 + .../ogles/GL/operators/postfixincrement_vert.vert | 40 + .../ogles/GL/operators/prefixdecrement_frag.frag | 40 + .../ogles/GL/operators/prefixdecrement_vert.vert | 40 + .../ogles/GL/operators/prefixincrement_frag.frag | 40 + .../ogles/GL/operators/prefixincrement_vert.vert | 40 + .../ogles/GL/operators/relational_frag.frag | 44 + .../ogles/GL/operators/relational_vert.vert | 45 + .../ogles/GL/operators/selection_frag.frag | 46 + .../ogles/GL/operators/selection_vert.vert | 46 + .../conformance/ogles/GL/operators/unary_frag.frag | 42 + .../conformance/ogles/GL/operators/unary_vert.vert | 42 + .../conformance/ogles/GL/pow/input.run.txt | 4 + .../conformance/ogles/GL/pow/pow_001_to_008.html | 155 + .../conformance/ogles/GL/pow/pow_009_to_016.html | 155 + .../conformance/ogles/GL/pow/pow_017_to_024.html | 155 + .../ogles/GL/pow/pow_float_frag_xconst2_yvary.frag | 35 + .../GL/pow/pow_float_frag_xconst2_yvary_ref.frag | 35 + .../GL/pow/pow_float_frag_xconsthalf_yvary.frag | 35 + .../pow/pow_float_frag_xconsthalf_yvary_ref.frag | 35 + .../ogles/GL/pow/pow_float_frag_xvary_yconst2.frag | 35 + .../GL/pow/pow_float_frag_xvary_yconst2_ref.frag | 35 + .../GL/pow/pow_float_frag_xvary_yconsthalf.frag | 35 + .../pow/pow_float_frag_xvary_yconsthalf_ref.frag | 35 + .../ogles/GL/pow/pow_float_vert_xconst2_yvary.vert | 36 + .../GL/pow/pow_float_vert_xconst2_yvary_ref.vert | 36 + .../GL/pow/pow_float_vert_xconsthalf_yvary.vert | 36 + .../pow/pow_float_vert_xconsthalf_yvary_ref.vert | 36 + .../ogles/GL/pow/pow_float_vert_xvary_yconst2.vert | 36 + .../GL/pow/pow_float_vert_xvary_yconst2_ref.vert | 36 + .../GL/pow/pow_float_vert_xvary_yconsthalf.vert | 36 + .../pow/pow_float_vert_xvary_yconsthalf_ref.vert | 36 + .../ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag | 35 + .../GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag | 35 + .../GL/pow/pow_vec2_frag_xconsthalf_yvary.frag | 35 + .../GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag | 35 + .../ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag | 35 + .../GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag | 35 + .../GL/pow/pow_vec2_frag_xvary_yconsthalf.frag | 35 + .../GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag | 35 + .../ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert | 36 + .../GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert | 36 + .../GL/pow/pow_vec2_vert_xconsthalf_yvary.vert | 36 + .../GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert | 36 + .../ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert | 36 + .../GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert | 36 + .../GL/pow/pow_vec2_vert_xvary_yconsthalf.vert | 36 + .../GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert | 36 + .../ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag | 35 + .../GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag | 35 + .../GL/pow/pow_vec3_frag_xconsthalf_yvary.frag | 35 + .../GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag | 35 + .../ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag | 35 + .../GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag | 35 + .../GL/pow/pow_vec3_frag_xvary_yconsthalf.frag | 35 + .../GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag | 35 + .../ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert | 36 + .../GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert | 36 + .../GL/pow/pow_vec3_vert_xconsthalf_yvary.vert | 36 + .../GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert | 36 + .../ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert | 36 + .../GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert | 36 + .../GL/pow/pow_vec3_vert_xvary_yconsthalf.vert | 36 + .../GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert | 36 + .../conformance/ogles/GL/radians/input.run.txt | 2 + .../ogles/GL/radians/radians_001_to_006.html | 129 + .../ogles/GL/radians/radians_float_frag_xvary.frag | 36 + .../GL/radians/radians_float_frag_xvary_ref.frag | 36 + .../ogles/GL/radians/radians_float_vert_xvary.vert | 37 + .../GL/radians/radians_float_vert_xvary_ref.vert | 37 + .../ogles/GL/radians/radians_vec2_frag_xvary.frag | 36 + .../GL/radians/radians_vec2_frag_xvary_ref.frag | 36 + .../ogles/GL/radians/radians_vec2_vert_xvary.vert | 37 + .../GL/radians/radians_vec2_vert_xvary_ref.vert | 37 + .../ogles/GL/radians/radians_vec3_frag_xvary.frag | 36 + .../GL/radians/radians_vec3_frag_xvary_ref.frag | 36 + .../ogles/GL/radians/radians_vec3_vert_xvary.vert | 37 + .../GL/radians/radians_vec3_vert_xvary_ref.vert | 37 + .../conformance/ogles/GL/reflect/input.run.txt | 2 + .../ogles/GL/reflect/reflect_001_to_006.html | 129 + .../GL/reflect/reflect_float_frag_ivarynconst.frag | 40 + .../reflect_float_frag_ivarynconst_ref.frag | 40 + .../GL/reflect/reflect_float_vert_ivarynconst.vert | 41 + .../reflect_float_vert_ivarynconst_ref.vert | 41 + .../GL/reflect/reflect_vec2_frag_ivarynconst.frag | 45 + .../reflect/reflect_vec2_frag_ivarynconst_ref.frag | 46 + .../GL/reflect/reflect_vec2_vert_ivarynconst.vert | 46 + .../reflect/reflect_vec2_vert_ivarynconst_ref.vert | 46 + .../GL/reflect/reflect_vec3_frag_ivarynconst.frag | 47 + .../reflect/reflect_vec3_frag_ivarynconst_ref.frag | 47 + .../GL/reflect/reflect_vec3_vert_ivarynconst.vert | 47 + .../reflect/reflect_vec3_vert_ivarynconst_ref.vert | 47 + .../conformance/ogles/GL/refract/input.run.txt | 2 + .../ogles/GL/refract/refract_001_to_006.html | 129 + .../GL/refract/refract_float_frag_ivarynconst.frag | 40 + .../refract_float_frag_ivarynconst_ref.frag | 46 + .../GL/refract/refract_float_vert_ivarynconst.vert | 39 + .../refract_float_vert_ivarynconst_ref.vert | 49 + .../GL/refract/refract_vec2_frag_ivarynconst.frag | 45 + .../refract/refract_vec2_frag_ivarynconst_ref.frag | 54 + .../GL/refract/refract_vec2_vert_ivarynconst.vert | 46 + .../refract/refract_vec2_vert_ivarynconst_ref.vert | 54 + .../GL/refract/refract_vec3_frag_ivarynconst.frag | 47 + .../refract/refract_vec3_frag_ivarynconst_ref.frag | 55 + .../GL/refract/refract_vec3_vert_ivarynconst.vert | 47 + .../refract/refract_vec3_vert_ivarynconst_ref.vert | 55 + .../conformance/ogles/GL/sign/input.run.txt | 2 + .../conformance/ogles/GL/sign/sign_001_to_006.html | 129 + .../ogles/GL/sign/sign_float_frag_xvary.frag | 35 + .../ogles/GL/sign/sign_float_frag_xvary_ref.frag | 38 + .../ogles/GL/sign/sign_float_vert_xvary.vert | 36 + .../ogles/GL/sign/sign_float_vert_xvary_ref.vert | 39 + .../ogles/GL/sign/sign_vec2_frag_xvary.frag | 35 + .../ogles/GL/sign/sign_vec2_frag_xvary_ref.frag | 40 + .../ogles/GL/sign/sign_vec2_vert_xvary.vert | 36 + .../ogles/GL/sign/sign_vec2_vert_xvary_ref.vert | 41 + .../ogles/GL/sign/sign_vec3_frag_xvary.frag | 35 + .../ogles/GL/sign/sign_vec3_frag_xvary_ref.frag | 43 + .../ogles/GL/sign/sign_vec3_vert_xvary.vert | 36 + .../ogles/GL/sign/sign_vec3_vert_xvary_ref.vert | 44 + .../conformance/ogles/GL/sin/input.run.txt | 2 + .../conformance/ogles/GL/sin/sin_001_to_006.html | 129 + .../ogles/GL/sin/sin_float_frag_xvary.frag | 35 + .../ogles/GL/sin/sin_float_frag_xvary_ref.frag | 101 + .../ogles/GL/sin/sin_float_vert_xvary.vert | 36 + .../ogles/GL/sin/sin_float_vert_xvary_ref.vert | 55 + .../ogles/GL/sin/sin_vec2_frag_xvary.frag | 35 + .../ogles/GL/sin/sin_vec2_frag_xvary_ref.frag | 137 + .../ogles/GL/sin/sin_vec2_vert_xvary.vert | 36 + .../ogles/GL/sin/sin_vec2_vert_xvary_ref.vert | 79 + .../ogles/GL/sin/sin_vec3_frag_xvary.frag | 35 + .../ogles/GL/sin/sin_vec3_frag_xvary_ref.frag | 173 + .../ogles/GL/sin/sin_vec3_vert_xvary.vert | 36 + .../ogles/GL/sin/sin_vec3_vert_xvary_ref.vert | 79 + .../conformance/ogles/GL/smoothstep/input.run.txt | 2 + .../ogles/GL/smoothstep/smoothstep_001_to_006.html | 129 + ...oothstep_float_frag_xvary_edgeconstquarter.frag | 36 + ...step_float_frag_xvary_edgeconstquarter_ref.frag | 38 + ...oothstep_float_vert_xvary_edgeconstquarter.vert | 37 + ...step_float_vert_xvary_edgeconstquarter_ref.vert | 39 + ...moothstep_vec2_frag_xvary_edgeconstquarter.frag | 36 + ...hstep_vec2_frag_xvary_edgeconstquarter_ref.frag | 37 + ...moothstep_vec2_vert_xvary_edgeconstquarter.vert | 37 + ...hstep_vec2_vert_xvary_edgeconstquarter_ref.vert | 38 + ...moothstep_vec3_frag_xvary_edgeconstquarter.frag | 36 + ...hstep_vec3_frag_xvary_edgeconstquarter_ref.frag | 38 + ...moothstep_vec3_vert_xvary_edgeconstquarter.vert | 37 + ...hstep_vec3_vert_xvary_edgeconstquarter_ref.vert | 39 + .../conformance/ogles/GL/sqrt/input.run.txt | 2 + .../conformance/ogles/GL/sqrt/sqrt_001_to_006.html | 129 + .../ogles/GL/sqrt/sqrt_float_frag_xvary.frag | 35 + .../ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag | 35 + .../ogles/GL/sqrt/sqrt_float_vert_xvary.vert | 36 + .../ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert | 36 + .../ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag | 35 + .../ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag | 35 + .../ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert | 36 + .../ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert | 36 + .../ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag | 35 + .../ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag | 35 + .../ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert | 36 + .../ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert | 36 + .../conformance/ogles/GL/step/input.run.txt | 2 + .../conformance/ogles/GL/step/step_001_to_006.html | 129 + .../step/step_float_frag_xvary_edgeconsthalf.frag | 35 + .../step_float_frag_xvary_edgeconsthalf_ref.frag | 39 + .../step/step_float_vert_xvary_edgeconsthalf.vert | 36 + .../step_float_vert_xvary_edgeconsthalf_ref.vert | 40 + .../step/step_vec2_frag_xvary_edgeconsthalf.frag | 35 + .../step_vec2_frag_xvary_edgeconsthalf_ref.frag | 53 + .../step/step_vec2_vert_xvary_edgeconsthalf.vert | 36 + .../step_vec2_vert_xvary_edgeconsthalf_ref.vert | 54 + .../step/step_vec3_frag_xvary_edgeconsthalf.frag | 35 + .../step_vec3_frag_xvary_edgeconsthalf_ref.frag | 61 + .../step/step_vec3_vert_xvary_edgeconsthalf.vert | 36 + .../step_vec3_vert_xvary_edgeconsthalf_ref.vert | 62 + .../conformance/ogles/GL/struct/input.run.txt | 8 + .../GL/struct/nestedstructcomb_various_frag.frag | 116 + .../GL/struct/nestedstructcomb_various_vert.vert | 119 + .../ogles/GL/struct/struct_001_to_008.html | 251 + .../ogles/GL/struct/struct_009_to_016.html | 251 + .../ogles/GL/struct/struct_017_to_024.html | 251 + .../ogles/GL/struct/struct_025_to_032.html | 251 + .../ogles/GL/struct/struct_033_to_040.html | 251 + .../ogles/GL/struct/struct_041_to_048.html | 251 + .../ogles/GL/struct/struct_049_to_056.html | 251 + .../ogles/GL/struct/struct_bool_frag.frag | 49 + .../ogles/GL/struct/struct_bool_vert.vert | 52 + .../GL/struct/struct_bvec2bvec3bvec4_frag.frag | 46 + .../GL/struct/struct_bvec2bvec3bvec4_vert.vert | 47 + .../ogles/GL/struct/struct_float_frag.frag | 43 + .../ogles/GL/struct/struct_float_vert.vert | 47 + .../ogles/GL/struct/struct_mat2_frag.frag | 40 + .../ogles/GL/struct/struct_mat2_vert.vert | 40 + .../ogles/GL/struct/struct_mat3_frag.frag | 53 + .../ogles/GL/struct/struct_mat3_vert.vert | 54 + .../ogles/GL/struct/struct_mat4_frag.frag | 63 + .../ogles/GL/struct/struct_mat4_vert.vert | 65 + .../ogles/GL/struct/struct_vec2_frag.frag | 41 + .../ogles/GL/struct/struct_vec2_vert.vert | 45 + .../ogles/GL/struct/struct_vec3_frag.frag | 41 + .../ogles/GL/struct/struct_vec3_vert.vert | 45 + .../ogles/GL/struct/struct_vec4_frag.frag | 41 + .../ogles/GL/struct/struct_vec4_vert.vert | 41 + .../ogles/GL/struct/structcopy_bool_frag.frag | 50 + .../ogles/GL/struct/structcopy_bool_vert.vert | 55 + .../GL/struct/structcopy_bvec2bvec3bvec4_frag.frag | 48 + .../GL/struct/structcopy_bvec2bvec3bvec4_vert.vert | 49 + .../ogles/GL/struct/structcopy_float_frag.frag | 45 + .../ogles/GL/struct/structcopy_float_vert.vert | 49 + .../ogles/GL/struct/structcopy_mat2_frag.frag | 42 + .../ogles/GL/struct/structcopy_mat2_vert.vert | 42 + .../ogles/GL/struct/structcopy_mat3_frag.frag | 55 + .../ogles/GL/struct/structcopy_mat3_vert.vert | 56 + .../ogles/GL/struct/structcopy_mat4_frag.frag | 68 + .../ogles/GL/struct/structcopy_mat4_vert.vert | 70 + .../ogles/GL/struct/structcopy_vec2_frag.frag | 42 + .../ogles/GL/struct/structcopy_vec2_vert.vert | 47 + .../ogles/GL/struct/structcopy_vec3_frag.frag | 42 + .../ogles/GL/struct/structcopy_vec3_vert.vert | 47 + .../ogles/GL/struct/structcopy_vec4_frag.frag | 43 + .../ogles/GL/struct/structcopy_vec4_vert.vert | 43 + .../ogles/GL/struct/structnest_bool_frag.frag | 55 + .../ogles/GL/struct/structnest_bool_vert.vert | 58 + .../GL/struct/structnest_bvec2bvec3bvec4_frag.frag | 71 + .../GL/struct/structnest_bvec2bvec3bvec4_vert.vert | 74 + .../ogles/GL/struct/structnest_float_frag.frag | 49 + .../ogles/GL/struct/structnest_float_vert.vert | 51 + .../ogles/GL/struct/structnest_mat2_frag.frag | 51 + .../ogles/GL/struct/structnest_mat2_vert.vert | 51 + .../ogles/GL/struct/structnest_mat3_frag.frag | 79 + .../ogles/GL/struct/structnest_mat3_vert.vert | 74 + .../ogles/GL/struct/structnest_mat4_frag.frag | 100 + .../ogles/GL/struct/structnest_mat4_vert.vert | 89 + .../ogles/GL/struct/structnest_vec2_frag.frag | 50 + .../ogles/GL/struct/structnest_vec2_vert.vert | 51 + .../ogles/GL/struct/structnest_vec3_frag.frag | 49 + .../ogles/GL/struct/structnest_vec3_vert.vert | 51 + .../ogles/GL/struct/structnest_vec4_frag.frag | 49 + .../ogles/GL/struct/structnest_vec4_vert.vert | 51 + .../conformance/ogles/GL/swizzlers/input.run.txt | 16 + .../ogles/GL/swizzlers/swizzlers_001_to_008.html | 155 + .../ogles/GL/swizzlers/swizzlers_009_to_016.html | 155 + .../ogles/GL/swizzlers/swizzlers_017_to_024.html | 155 + .../ogles/GL/swizzlers/swizzlers_025_to_032.html | 155 + .../ogles/GL/swizzlers/swizzlers_033_to_040.html | 155 + .../ogles/GL/swizzlers/swizzlers_041_to_048.html | 155 + .../ogles/GL/swizzlers/swizzlers_049_to_056.html | 155 + .../ogles/GL/swizzlers/swizzlers_057_to_064.html | 155 + .../ogles/GL/swizzlers/swizzlers_065_to_072.html | 155 + .../ogles/GL/swizzlers/swizzlers_073_to_080.html | 155 + .../ogles/GL/swizzlers/swizzlers_081_to_088.html | 155 + .../ogles/GL/swizzlers/swizzlers_089_to_096.html | 155 + .../ogles/GL/swizzlers/swizzlers_097_to_104.html | 155 + .../ogles/GL/swizzlers/swizzlers_105_to_112.html | 155 + .../ogles/GL/swizzlers/swizzlers_113_to_120.html | 155 + .../ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag | 37 + .../ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert | 39 + .../GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert | 40 + .../GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag | 37 + .../ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert | 39 + .../GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag | 37 + .../ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert | 39 + .../GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert | 40 + .../GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag | 36 + .../ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert | 38 + .../GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert | 40 + .../GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag | 36 + .../ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert | 38 + .../GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag | 37 + .../ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert | 39 + .../GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag | 36 + .../ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert | 38 + .../GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag | 37 + .../ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert | 39 + .../GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert | 40 + .../GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag | 38 + .../GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert | 40 + .../ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag | 37 + .../ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert | 38 + .../GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert | 38 + .../ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert | 38 + .../GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert | 38 + .../ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert | 38 + .../GL/swizzlers/vec4_r_g_b_a_4float_frag.frag | 39 + .../GL/swizzlers/vec4_r_g_b_a_4float_vert.vert | 41 + .../ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag | 35 + .../ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert | 37 + .../GL/swizzlers/vec4_s_t_p_q_4float_frag.frag | 39 + .../GL/swizzlers/vec4_s_t_p_q_4float_vert.vert | 41 + .../ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag | 35 + .../ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert | 37 + .../ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert | 38 + .../ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert | 38 + .../GL/swizzlers/vec4_x_y_z_w_4float_frag.frag | 39 + .../GL/swizzlers/vec4_x_y_z_w_4float_vert.vert | 41 + .../ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag | 35 + .../ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert | 37 + .../ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert | 39 + .../GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert | 38 + .../GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag | 37 + .../GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert | 39 + .../ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag | 36 + .../ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert | 38 + .../ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag | 37 + .../ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert | 39 + .../conformance/ogles/GL/tan/input.run.txt | 2 + .../conformance/ogles/GL/tan/tan_001_to_006.html | 129 + .../ogles/GL/tan/tan_float_frag_xvary.frag | 42 + .../ogles/GL/tan/tan_float_frag_xvary_ref.frag | 41 + .../ogles/GL/tan/tan_float_vert_xvary.vert | 43 + .../ogles/GL/tan/tan_float_vert_xvary_ref.vert | 42 + .../ogles/GL/tan/tan_vec2_frag_xvary.frag | 47 + .../ogles/GL/tan/tan_vec2_frag_xvary_ref.frag | 47 + .../ogles/GL/tan/tan_vec2_vert_xvary.vert | 48 + .../ogles/GL/tan/tan_vec2_vert_xvary_ref.vert | 48 + .../ogles/GL/tan/tan_vec3_frag_xvary.frag | 52 + .../ogles/GL/tan/tan_vec3_frag_xvary_ref.frag | 52 + .../ogles/GL/tan/tan_vec3_vert_xvary.vert | 53 + .../ogles/GL/tan/tan_vec3_vert_xvary_ref.vert | 53 + .../ogles/GL/vec/bvec4_2int_2float_frag.frag | 39 + .../ogles/GL/vec/bvec4_2int_2float_vert.vert | 40 + .../conformance/ogles/GL/vec/input.run.txt | 4 + .../conformance/ogles/GL/vec/ivec3_3int_frag.frag | 39 + .../conformance/ogles/GL/vec/ivec3_3int_vert.vert | 40 + .../conformance/ogles/GL/vec/vec2_2float_frag.frag | 39 + .../conformance/ogles/GL/vec/vec2_2float_vert.vert | 40 + .../conformance/ogles/GL/vec/vec2_vec3_frag.frag | 40 + .../conformance/ogles/GL/vec/vec2_vec3_vert.vert | 40 + .../ogles/GL/vec/vec3_float_vec2_frag.frag | 40 + .../ogles/GL/vec/vec3_float_vec2_vert.vert | 40 + .../ogles/GL/vec/vec3_vec2_float_frag.frag | 40 + .../ogles/GL/vec/vec3_vec2_float_vert.vert | 40 + .../conformance/ogles/GL/vec/vec3_vec4_frag.frag | 40 + .../conformance/ogles/GL/vec/vec3_vec4_vert.vert | 40 + .../conformance/ogles/GL/vec/vec4_ivec4_frag.frag | 40 + .../conformance/ogles/GL/vec/vec4_ivec4_vert.vert | 41 + .../ogles/GL/vec/vec4_vec3_float_frag.frag | 40 + .../ogles/GL/vec/vec4_vec3_float_vert.vert | 40 + .../conformance/ogles/GL/vec/vec_001_to_008.html | 251 + .../conformance/ogles/GL/vec/vec_009_to_016.html | 251 + .../conformance/ogles/GL/vec/vec_017_to_018.html | 101 + .../conformance/ogles/GL/vec3/input.run.txt | 2 + .../conformance/ogles/GL/vec3/vec3_001_to_008.html | 333 + .../conformance/ogles/GL/vec3/vec3array_frag.frag | 49 + .../conformance/ogles/GL/vec3/vec3array_vert.vert | 47 + .../ogles/GL/vec3/vec3arraydirect_frag.frag | 41 + .../ogles/GL/vec3/vec3arraydirect_vert.vert | 45 + .../ogles/GL/vec3/vec3arrayindirect_frag.frag | 55 + .../ogles/GL/vec3/vec3arrayindirect_vert.vert | 51 + .../conformance/ogles/GL/vec3/vec3single_frag.frag | 41 + .../conformance/ogles/GL/vec3/vec3single_vert.vert | 45 + .../compressed_paletted_texture.frag | 36 + .../compressed_paletted_texture.vert | 38 + .../ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag | 68 + .../ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert | 36 + .../GL2ExtensionTests/dFdx/dFdx_frag_ref.frag | 61 + .../GL2ExtensionTests/dFdx/dFdx_frag_ref.vert | 36 + .../ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag | 68 + .../ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert | 37 + .../GL2ExtensionTests/dFdy/dFdy_frag_ref.frag | 64 + .../GL2ExtensionTests/dFdy/dFdy_frag_ref.vert | 37 + .../GL2ExtensionTests/default_shaders/default.frag | 34 + .../GL2ExtensionTests/default_shaders/default.vert | 37 + .../default_shaders/default_textured.frag | 36 + .../default_shaders/default_textured.vert | 39 + .../GL2ExtensionTests/fwidth/fwidth_frag.frag | 65 + .../GL2ExtensionTests/fwidth/fwidth_frag.vert | 36 + .../GL2ExtensionTests/fwidth/fwidth_frag_dx.frag | 65 + .../GL2ExtensionTests/fwidth/fwidth_frag_dx.vert | 36 + .../GL2ExtensionTests/fwidth/fwidth_frag_dy.frag | 65 + .../GL2ExtensionTests/fwidth/fwidth_frag_dy.vert | 36 + .../GL2ExtensionTests/fwidth/fwidth_frag_ref.frag | 64 + .../GL2ExtensionTests/fwidth/fwidth_frag_ref.vert | 36 + .../fwidth/fwidth_frag_ref_dx.frag | 63 + .../fwidth/fwidth_frag_ref_dx.vert | 36 + .../fwidth/fwidth_frag_ref_dy.frag | 64 + .../fwidth/fwidth_frag_ref_dy.vert | 36 + .../buffer_objects/buffer_objects.frag | 36 + .../buffer_objects/buffer_objects.vert | 161 + .../buffer_objects_multitexturing.frag | 39 + .../buffer_objects_multitexturing.vert | 42 + .../buffer_objects/buffer_objects_pointSize.frag | 34 + .../buffer_objects/buffer_objects_pointSize.vert | 37 + .../GL2FixedTests/copy_texture/copy_texture.frag | 39 + .../GL2FixedTests/default_shaders/default.frag | 34 + .../GL2FixedTests/default_shaders/default.vert | 36 + .../default_shaders/default_textured.frag | 36 + .../default_shaders/default_textured.vert | 39 + .../lighting_diffuse/lighting_diffuse.frag | 34 + .../lighting_diffuse/lighting_diffuse.vert | 149 + .../lighting_diffuse/lighting_diffuse_ref.frag | 34 + .../lighting_diffuse/lighting_diffuse_ref.vert | 35 + .../point_rasterization/point_rasterization.frag | 34 + .../point_rasterization/point_rasterization.vert | 37 + .../GL2FixedTests/point_sprites/point_sprites.frag | 31 + .../GL2FixedTests/point_sprites/point_sprites.vert | 34 + .../user_clip_planes/user_clip_planes.frag | 39 + .../user_clip_planes/user_clip_planes.vert | 44 + .../attach_shader/successfulcompile_frag.frag | 63 + .../attach_shader/successfulcompile_vert.vert | 43 + .../attach_shader/unsuccessfulcompile_frag.frag | 83 + .../attach_shader/unsuccessfulcompile_vert.vert | 60 + .../GL2Tests/bind_attribute_location/brick.frag | 64 + .../GL2Tests/bind_attribute_location/brick.vert | 60 + .../ogles/GL2Tests/compile_shader/brick.vert | 60 + .../ogles/GL2Tests/compile_shader/texture.frag | 52 + .../ogles/GL2Tests/compile_shader/wood.frag | 83 + .../ogles/GL2Tests/compile_shader/wood.vert | 43 + .../delete_object/successfulcompile_frag.frag | 63 + .../delete_object/successfulcompile_vert.vert | 43 + .../detach_shader/successfulcompile_frag.frag | 63 + .../detach_shader/successfulcompile_vert.vert | 43 + .../GL2Tests/framebuffer_objects/fboShader0.frag | 46 + .../GL2Tests/framebuffer_objects/fboShader0.vert | 40 + .../ogles/GL2Tests/get_active_attribute/brick.frag | 63 + .../GL2Tests/get_active_attribute/brick_mat2.vert | 62 + .../GL2Tests/get_active_attribute/brick_mat3.vert | 62 + .../GL2Tests/get_active_attribute/brick_mat4.vert | 62 + .../GL2Tests/get_active_attribute/brick_vec.vert | 65 + .../ogles/GL2Tests/get_active_uniform/brick.frag | 62 + .../ogles/GL2Tests/get_active_uniform/brick.vert | 88 + .../GL2Tests/get_attribute_location/brick.frag | 34 + .../GL2Tests/get_attribute_location/brick.vert | 39 + .../get_handle/successfulcompile_frag.frag | 63 + .../get_handle/successfulcompile_vert.vert | 43 + .../ogles/GL2Tests/get_uniform_location/brick.frag | 63 + .../ogles/GL2Tests/get_uniform_location/brick.vert | 60 + .../GL2Tests/glGetProgramInfoLog_2.0/simple.frag | 35 + .../GL2Tests/glGetProgramInfoLog_2.0/simple.vert | 35 + .../ogles/GL2Tests/glGetProgramiv_2.0/brick.frag | 63 + .../ogles/GL2Tests/glGetProgramiv_2.0/brick.vert | 60 + .../GL2Tests/glGetShaderInfoLog_2.0/simple.frag | 35 + .../GL2Tests/glGetShaderInfoLog_2.0/simple.vert | 35 + .../ogles/GL2Tests/glGetUniform/bvec_tests.frag | 41 + .../ogles/GL2Tests/glGetUniform/bvec_tests.vert | 39 + .../ogles/GL2Tests/glGetUniform/ivec_tests.frag | 39 + .../ogles/GL2Tests/glGetUniform/ivec_tests.vert | 38 + .../ogles/GL2Tests/glGetUniform/mat_tests.frag | 42 + .../ogles/GL2Tests/glGetUniform/mat_tests.vert | 42 + .../ogles/GL2Tests/glGetUniform/vec_tests.frag | 39 + .../ogles/GL2Tests/glGetUniform/vec_tests.vert | 38 + .../GL2Tests/glGetVertexAttrib/mat_tests.vert | 41 + .../GL2Tests/glGetVertexAttrib/mat_tests2.vert | 41 + .../GL2Tests/glGetVertexAttrib/vec_tests.vert | 38 + .../ogles/GL2Tests/glUniform/1b_frag.frag | 34 + .../ogles/GL2Tests/glUniform/1b_vert.frag | 34 + .../ogles/GL2Tests/glUniform/1b_vert.vert | 35 + .../ogles/GL2Tests/glUniform/1f_frag.frag | 34 + .../ogles/GL2Tests/glUniform/1f_vert.frag | 33 + .../ogles/GL2Tests/glUniform/1f_vert.vert | 35 + .../ogles/GL2Tests/glUniform/1i_frag.frag | 34 + .../ogles/GL2Tests/glUniform/1i_vert.frag | 33 + .../ogles/GL2Tests/glUniform/1i_vert.vert | 35 + .../ogles/GL2Tests/glUniform/21f_frag.frag | 34 + .../ogles/GL2Tests/glUniform/21i_frag.frag | 36 + .../ogles/GL2Tests/glUniform/22f_frag.frag | 34 + .../ogles/GL2Tests/glUniform/22i_frag.frag | 39 + .../ogles/GL2Tests/glUniform/23f_frag.frag | 36 + .../ogles/GL2Tests/glUniform/23i_frag.frag | 37 + .../ogles/GL2Tests/glUniform/24f_frag.frag | 36 + .../ogles/GL2Tests/glUniform/24i_frag.frag | 37 + .../ogles/GL2Tests/glUniform/2b_frag.frag | 34 + .../ogles/GL2Tests/glUniform/2b_vert.frag | 34 + .../ogles/GL2Tests/glUniform/2b_vert.vert | 35 + .../ogles/GL2Tests/glUniform/2f_frag.frag | 34 + .../ogles/GL2Tests/glUniform/2f_vert.frag | 34 + .../ogles/GL2Tests/glUniform/2f_vert.vert | 35 + .../ogles/GL2Tests/glUniform/2i_frag.frag | 34 + .../ogles/GL2Tests/glUniform/2i_vert.frag | 34 + .../ogles/GL2Tests/glUniform/2i_vert.vert | 35 + .../ogles/GL2Tests/glUniform/2m_frag.frag | 34 + .../ogles/GL2Tests/glUniform/3b_frag.frag | 34 + .../ogles/GL2Tests/glUniform/3b_vert.frag | 34 + .../ogles/GL2Tests/glUniform/3b_vert.vert | 35 + .../ogles/GL2Tests/glUniform/3f_frag.frag | 34 + .../ogles/GL2Tests/glUniform/3f_vert.frag | 34 + .../ogles/GL2Tests/glUniform/3f_vert.vert | 35 + .../ogles/GL2Tests/glUniform/3i_frag.frag | 34 + .../ogles/GL2Tests/glUniform/3i_vert.frag | 34 + .../ogles/GL2Tests/glUniform/3i_vert.vert | 35 + .../ogles/GL2Tests/glUniform/3m_frag.frag | 37 + .../GL2Tests/glUniform/4b_firstthree_frag.frag | 34 + .../GL2Tests/glUniform/4b_firstthree_vert.frag | 34 + .../GL2Tests/glUniform/4b_lastthree_frag.frag | 34 + .../GL2Tests/glUniform/4b_lastthree_vert.frag | 34 + .../ogles/GL2Tests/glUniform/4b_vert.vert | 35 + .../ogles/GL2Tests/glUniform/4f_frag.frag | 34 + .../ogles/GL2Tests/glUniform/4f_vert.frag | 34 + .../ogles/GL2Tests/glUniform/4f_vert.vert | 35 + .../ogles/GL2Tests/glUniform/4i_frag.frag | 34 + .../ogles/GL2Tests/glUniform/4i_vert.frag | 34 + .../ogles/GL2Tests/glUniform/4i_vert.vert | 35 + .../ogles/GL2Tests/glUniform/4m_frag.frag | 37 + .../ogles/GL2Tests/glUniform/default.vert | 33 + .../ogles/GL2Tests/glUniform/matrix2VSU.frag | 34 + .../ogles/GL2Tests/glUniform/matrix2VSU.vert | 39 + .../ogles/GL2Tests/glUniform/matrix2arrayVSU.frag | 34 + .../ogles/GL2Tests/glUniform/matrix2arrayVSU.vert | 38 + .../ogles/GL2Tests/glUniform/matrixVSU.frag | 34 + .../ogles/GL2Tests/glUniform/matrixVSU.vert | 38 + .../link_program/successfulcompile_frag.frag | 63 + .../link_program/successfulcompile_vert.vert | 43 + .../link_program/unsuccessfulcompile_frag.frag | 83 + .../link_program/unsuccessfulcompile_vert.vert | 60 + .../precision_specifiers/precision_specifiers.frag | 31 + .../precision_specifiers/precision_specifiers.vert | 42 + .../ogles/GL2Tests/relink_program/simple.frag | 34 + .../ogles/GL2Tests/relink_program/simple.vert | 37 + .../shader_source/successfulcompile_frag.frag | 63 + .../shader_source/successfulcompile_vert.vert | 43 + .../shader_source/unsuccessfulcompile_frag.frag | 83 + .../shader_source/unsuccessfulcompile_vert.vert | 61 + .../ogles/GL2Tests/three_uniforms/4f_frag.frag | 39 + .../use_program/successfulcompile_frag.frag | 63 + .../use_program/successfulcompile_vert.vert | 43 + .../use_program/unsuccessfulcompile_frag.frag | 83 + .../use_program/unsuccessfulcompile_vert.vert | 60 + .../validate_program/successfulcompile_frag.frag | 63 + .../validate_program/successfulcompile_vert.vert | 43 + .../validate_program/unsuccessfulcompile_frag.frag | 83 + .../validate_program/unsuccessfulcompile_vert.vert | 60 + .../vertex_program_point_size/point_size.vert | 36 + .../checkout/conformance/ogles/README.md | 20 + .../checkout/conformance/ogles/mustpass.run.txt | 64 + .../checkout/conformance/ogles/ogles-utils.js | 808 + .../conformance/ogles/process-ogles2-tests.py | 586 + .../checkout/conformance/programs/00_test_list.txt | 11 + .../conformance/programs/get-active-test.html | 140 + .../gl-bind-attrib-location-long-names-test.html | 174 + .../programs/gl-bind-attrib-location-test.html | 160 + .../programs/gl-get-active-attribute.html | 106 + .../programs/gl-get-active-uniform.html | 157 + .../conformance/programs/gl-getshadersource.html | 60 + .../conformance/programs/gl-shader-test.html | 115 + .../conformance/programs/invalid-UTF-16.html | 69 + .../conformance/programs/program-infolog.html | 83 + .../conformance/programs/program-test.html | 425 + ...gram-crash-with-discard-in-fragment-shader.html | 98 + .../checkout/conformance/reading/00_test_list.txt | 3 + .../reading/read-pixels-pack-alignment.html | 263 + .../conformance/reading/read-pixels-test.html | 318 + .../conformance/renderbuffers/00_test_list.txt | 6 + .../conformance/renderbuffers/feedback-loop.html | 125 + .../framebuffer-object-attachment.html | 663 + .../framebuffer-state-restoration.html | 128 + .../renderbuffers/framebuffer-test.html | 197 + .../renderbuffers/renderbuffer-initialization.html | 120 + .../conformance/rendering/00_test_list.txt | 28 + .../rendering/clipping-wide-points.html | 47 + .../checkout/conformance/rendering/culling.html | 148 + .../rendering/default-texture-draw-bug.html | 90 + .../rendering/draw-arrays-out-of-bounds.html | 54 + .../rendering/draw-elements-out-of-bounds.html | 54 + .../draw-with-changing-start-vertex-bug.html | 133 + .../conformance/rendering/framebuffer-switch.html | 111 + .../rendering/framebuffer-texture-switch.html | 107 + .../checkout/conformance/rendering/gl-clear.html | 88 + .../conformance/rendering/gl-drawarrays.html | 103 + .../conformance/rendering/gl-drawelements.html | 128 + .../rendering/gl-scissor-canvas-dimensions.html | 99 + .../conformance/rendering/gl-scissor-fbo-test.html | 131 + .../conformance/rendering/gl-scissor-test.html | 116 + .../conformance/rendering/gl-viewport-test-2.html | 76 + .../conformance/rendering/gl-viewport-test.html | 133 + .../conformance/rendering/line-loop-tri-fan.html | 250 + .../conformance/rendering/many-draw-calls.html | 159 + .../rendering/more-than-65536-indices.html | 144 + .../rendering/multisample-corruption.html | 60 + .../conformance/rendering/negative-one-index.html | 119 + .../rendering/out-of-bounds-index-buffers.html | 156 + .../conformance/rendering/point-no-attributes.html | 76 + .../checkout/conformance/rendering/point-size.html | 150 + .../rendering/point-specific-shader-variables.html | 185 + ...oint-with-gl-pointcoord-in-fragment-shader.html | 140 + .../conformance/rendering/polygon-offset.html | 192 + .../checkout/conformance/rendering/simple.html | 98 + .../checkout/conformance/rendering/triangle.html | 94 + .../rendering/vertex-texture-fetch.html | 112 + .../checkout/conformance/state/00_test_list.txt | 8 + .../checkout/conformance/state/diffs.txt | 69 + .../conformance/state/gl-enable-enum-test.html | 161 + .../checkout/conformance/state/gl-enum-tests.html | 50 + .../checkout/conformance/state/gl-get-calls.html | 219 + .../checkout/conformance/state/gl-geterror.html | 99 + .../checkout/conformance/state/gl-getstring.html | 81 + .../conformance/state/gl-initial-state.html | 79 + .../conformance/state/gl-object-get-calls.html | 47 + .../state/state-uneffected-after-compositing.html | 107 + .../checkout/conformance/textures/00_test_list.txt | 14 + .../conformance/textures/canvas/00_test_list.txt | 5 + .../canvas/tex-2d-rgb-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 57 + .../canvas/tex-2d-rgba-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 57 + .../textures/canvas_sub_rectangle/00_test_list.txt | 5 + .../tex-2d-rgb-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 57 + .../tex-2d-rgba-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 57 + .../conformance/textures/image/00_test_list.txt | 5 + .../image/tex-2d-rgb-rgb-unsigned_byte.html | 57 + .../image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 57 + .../image/tex-2d-rgba-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 57 + .../image_bitmap_from_blob/00_test_list.txt | 5 + .../tex-2d-rgb-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgba-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 58 + .../image_bitmap_from_canvas/00_test_list.txt | 5 + .../tex-2d-rgb-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgba-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 58 + .../image_bitmap_from_image/00_test_list.txt | 5 + .../tex-2d-rgb-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgba-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 58 + .../00_test_list.txt | 5 + .../tex-2d-rgb-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgba-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 58 + .../image_bitmap_from_image_data/00_test_list.txt | 5 + .../tex-2d-rgb-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgba-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 58 + .../image_bitmap_from_video/00_test_list.txt | 5 + .../tex-2d-rgb-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgba-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 58 + .../textures/image_data/00_test_list.txt | 5 + .../image_data/tex-2d-rgb-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 58 + .../image_data/tex-2d-rgba-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 58 + .../conformance/textures/misc/00_test_list.txt | 42 + .../textures/misc/compressed-tex-image.html | 82 + .../textures/misc/copy-tex-image-2d-formats.html | 194 + .../misc/copy-tex-image-and-sub-image-2d.html | 158 + .../copy-tex-sub-image-2d-partial-texture.html | 191 + .../textures/misc/cube-incomplete-fbo.html | 93 + .../conformance/textures/misc/default-texture.html | 63 + .../textures/misc/gl-get-tex-parameter.html | 48 + .../conformance/textures/misc/gl-pixelstorei.html | 117 + .../conformance/textures/misc/gl-teximage.html | 427 + .../conformance/textures/misc/mipmap-fbo.html | 130 + .../textures/misc/origin-clean-conformance.html | 149 + ...ge-and-sub-image-2d-with-array-buffer-view.html | 303 + .../misc/tex-image-and-uniform-binding-bugs.html | 63 + .../textures/misc/tex-image-canvas-corruption.html | 72 + .../conformance/textures/misc/tex-image-webgl.html | 99 + .../misc/tex-image-with-format-and-type.html | 743 + .../textures/misc/tex-image-with-invalid-data.html | 179 + .../textures/misc/tex-input-validation.html | 45 + .../textures/misc/tex-sub-image-2d-bad-args.html | 154 + .../textures/misc/tex-sub-image-2d.html | 122 + .../textures/misc/texparameter-test.html | 150 + .../textures/misc/texture-active-bind-2.html | 231 + .../textures/misc/texture-active-bind.html | 140 + .../textures/misc/texture-attachment-formats.html | 197 + .../conformance/textures/misc/texture-clear.html | 64 + .../textures/misc/texture-complete.html | 84 + .../misc/texture-copying-feedback-loops.html | 103 + .../misc/texture-cube-as-fbo-attachment.html | 86 + .../misc/texture-draw-with-2d-and-cube.html | 124 + .../textures/misc/texture-fakeblack.html | 115 + .../textures/misc/texture-formats-test.html | 287 + .../conformance/textures/misc/texture-hd-dpi.html | 138 + .../conformance/textures/misc/texture-mips.html | 318 + .../textures/misc/texture-npot-video.html | 161 + .../conformance/textures/misc/texture-npot.html | 326 + .../textures/misc/texture-size-cube-maps.html | 352 + .../textures/misc/texture-size-limit.html | 171 + .../conformance/textures/misc/texture-size.html | 234 + .../textures/misc/texture-sub-image-cube-maps.html | 337 + .../texture-transparent-pixels-initialized.html | 106 + .../textures/misc/texture-upload-cube-maps.html | 73 + .../textures/misc/texture-upload-size.html | 169 + .../textures/svg_image/00_test_list.txt | 5 + .../svg_image/tex-2d-rgb-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 57 + .../svg_image/tex-2d-rgba-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 57 + .../conformance/textures/video/00_test_list.txt | 5 + .../video/tex-2d-rgb-rgb-unsigned_byte.html | 57 + .../video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 57 + .../video/tex-2d-rgba-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 57 + .../textures/webgl_canvas/00_test_list.txt | 5 + .../webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 57 + .../tex-2d-rgba-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 57 + .../conformance/typedarrays/00_test_list.txt | 7 + .../typedarrays/array-buffer-crash.html | 61 + .../typedarrays/array-buffer-view-crash.html | 60 + .../typedarrays/array-large-array-tests.html | 102 + .../conformance/typedarrays/array-unit-tests.html | 1124 + .../conformance/typedarrays/data-view-crash.html | 54 + .../conformance/typedarrays/data-view-test.html | 442 + .../typedarrays/typed-arrays-in-workers.html | 278 + .../checkout/conformance/uniforms/00_test_list.txt | 12 + .../conformance/uniforms/gl-uniform-arrays.html | 510 + .../conformance/uniforms/gl-uniform-bool.html | 80 + .../uniforms/gl-uniform-struct-unused.html | 104 + ...niform-unused-array-elements-get-truncated.html | 135 + .../conformance/uniforms/gl-uniformmatrix4fv.html | 110 + .../conformance/uniforms/gl-unknown-uniform.html | 88 + .../uniforms/null-uniform-location.html | 102 + .../out-of-bounds-uniform-array-access.html | 189 + .../uniforms/uniform-default-values.html | 360 + .../conformance/uniforms/uniform-location.html | 115 + .../uniforms/uniform-samplers-test.html | 132 + .../uniforms/uniform-values-per-program.html | 200 + .../checkout/conformance2/00_test_list.txt | 16 + .../checkout/conformance2/attribs/00_test_list.txt | 4 + .../attribs/gl-vertex-attrib-i-render.html | 129 + .../conformance2/attribs/gl-vertex-attrib.html | 49 + .../attribs/gl-vertexattribipointer-offsets.html | 175 + .../attribs/gl-vertexattribipointer.html | 143 + .../checkout/conformance2/buffers/00_test_list.txt | 9 + .../buffers/bound-buffer-size-change-test.html | 140 + .../buffers/buffer-copying-contents.html | 197 + .../buffers/buffer-copying-restrictions.html | 123 + ...buffer-data-and-buffer-sub-data-sub-source.html | 204 + .../conformance2/buffers/buffer-overflow-test.html | 72 + .../buffers/buffer-type-restrictions.html | 141 + .../conformance2/buffers/get-buffer-sub-data.html | 176 + .../conformance2/buffers/getBufferSubData.html | 105 + .../buffers/one-large-uniform-buffer.html | 152 + .../conformance2/buffers/uniform-buffers.html | 428 + .../checkout/conformance2/context/00_test_list.txt | 4 + .../context/constants-and-properties-2.html | 855 + ...-attributes-depth-stencil-antialias-obeyed.html | 110 + .../conformance2/context/context-type-test-2.html | 72 + .../checkout/conformance2/context/methods-2.html | 329 + .../conformance2/extensions/00_test_list.txt | 4 + .../extensions/ext-color-buffer-float.html | 419 + .../ext-disjoint-timer-query-webgl2.html | 335 + .../extensions/promoted-extensions-in-shaders.html | 136 + .../extensions/promoted-extensions.html | 86 + .../checkout/conformance2/glsl3/00_test_list.txt | 40 + .../conformance2/glsl3/array-as-return-value.html | 171 + .../glsl3/array-assign-constructor.html | 129 + .../checkout/conformance2/glsl3/array-assign.html | 114 + .../conformance2/glsl3/array-complex-indexing.html | 108 + .../glsl3/array-element-increment.html | 152 + .../conformance2/glsl3/array-equality.html | 106 + .../glsl3/array-in-complex-expression.html | 165 + .../glsl3/array-length-side-effects.html | 106 + .../glsl3/attrib-location-length-limits.html | 110 + .../glsl3/bool-type-cast-bug-uint-ivec-uvec.html | 389 + .../glsl3/compare-structs-containing-arrays.html | 107 + .../compound-assignment-type-combination.html | 47 + .../conformance2/glsl3/const-array-init.html | 119 + .../conformance2/glsl3/forbidden-operators.html | 145 + .../checkout/conformance2/glsl3/frag-depth.html | 178 + .../glsl3/invalid-default-precision.html | 92 + .../conformance2/glsl3/invalid-invariant.html | 109 + .../glsl3/loops-with-side-effects.html | 232 + .../glsl3/misplaced-version-directive.html | 132 + .../glsl3/no-attribute-vertex-shader.html | 84 + .../conformance2/glsl3/sampler-no-precision.html | 109 + .../sequence-operator-returns-non-constant.html | 80 + .../conformance2/glsl3/shader-linking.html | 105 + .../glsl3/shader-with-1024-character-define.html | 57 + ...shader-with-1024-character-identifier.frag.html | 126 + .../glsl3/shader-with-1025-character-define.html | 57 + ...shader-with-1025-character-identifier.frag.html | 57 + .../glsl3/shader-with-invalid-characters.html | 58 + .../shader-with-mis-matching-uniform-block.html | 80 + .../glsl3/short-circuiting-in-loop-condition.html | 190 + .../glsl3/texture-offset-out-of-range.html | 127 + .../texture-offset-uniform-texture-coordinate.html | 191 + .../conformance2/glsl3/tricky-loop-conditions.html | 348 + .../unary-minus-operator-in-dynamic-loop.html | 269 + .../glsl3/uniform-block-layout-match.html | 78 + .../conformance2/glsl3/uniform-block-layouts.html | 84 + .../glsl3/uniform-location-length-limits.html | 110 + .../conformance2/glsl3/valid-invariant.html | 116 + .../vector-dynamic-indexing-nv-driver-bug.html | 88 + .../glsl3/vector-dynamic-indexing.html | 370 + .../checkout/conformance2/misc/00_test_list.txt | 6 + .../checkout/conformance2/misc/expando-loss-2.html | 305 + .../getextension-while-pbo-bound-stability.html | 78 + .../conformance2/misc/instanceof-test.html | 65 + .../misc/object-deletion-behaviour-2.html | 136 + .../conformance2/misc/uninitialized-test-2.html | 572 + .../conformance2/misc/views-with-offsets.html | 341 + .../conformance2/programs/00_test_list.txt | 2 + .../programs/active-built-in-attribs.html | 107 + .../programs/gl-get-frag-data-location.html | 121 + .../checkout/conformance2/query/00_test_list.txt | 2 + .../conformance2/query/occlusion-query.html | 158 + .../checkout/conformance2/query/query.html | 178 + .../checkout/conformance2/reading/00_test_list.txt | 5 + .../reading/format-r11f-g11f-b10f.html | 287 + .../reading/read-pixels-from-fbo-test.html | 659 + .../read-pixels-from-rgb8-into-pbo-bug.html | 106 + .../read-pixels-into-pixel-pack-buffer.html | 173 + .../reading/read-pixels-pack-parameters.html | 373 + .../conformance2/renderbuffers/00_test_list.txt | 7 + .../framebuffer-object-attachment.html | 427 + .../renderbuffers/framebuffer-test.html | 309 + .../renderbuffers/framebuffer-texture-layer.html | 165 + .../renderbuffers/invalidate-framebuffer.html | 173 + .../multisample-with-full-sample-counts.html | 119 + .../multisampled-renderbuffer-initialization.html | 150 + .../conformance2/renderbuffers/readbuffer.html | 195 + .../conformance2/rendering/00_test_list.txt | 25 + .../conformance2/rendering/attrib-type-match.html | 582 + .../blitframebuffer-filter-outofbounds.html | 199 + .../rendering/blitframebuffer-filter-srgb.html | 183 + .../blitframebuffer-multisampled-readbuffer.html | 134 + .../blitframebuffer-outside-readbuffer.html | 289 + .../rendering/blitframebuffer-scissor-enabled.html | 182 + .../rendering/blitframebuffer-size-overflow.html | 98 + ...litframebuffer-srgb-and-linear-drawbuffers.html | 229 + .../rendering/blitframebuffer-stencil-only.html | 192 + .../rendering/blitframebuffer-test.html | 342 + .../rendering/canvas-resizing-with-pbo-bound.html | 130 + .../rendering/clear-func-buffer-type-match.html | 166 + .../rendering/clear-srgb-color-buffer.html | 109 + .../rendering/clipping-wide-points.html | 47 + .../conformance2/rendering/draw-buffers.html | 581 + .../conformance2/rendering/element-index-uint.html | 426 + .../framebuffer-completeness-unaffected.html | 113 + .../rendering/framebuffer-unsupported.html | 155 + .../fs-color-type-mismatch-color-buffer-type.html | 190 + .../conformance2/rendering/instanced-arrays.html | 242 + .../rendering/instanced-rendering-bug.html | 275 + .../out-of-bounds-index-buffers-after-copying.html | 207 + .../rendering-sampling-feedback-loop.html | 148 + .../conformance2/rendering/rgb-format-support.html | 132 + .../rendering/uniform-block-buffer-size.html | 249 + .../conformance2/samplers/00_test_list.txt | 2 + .../samplers/sampler-drawing-test.html | 145 + .../checkout/conformance2/samplers/samplers.html | 251 + .../checkout/conformance2/state/00_test_list.txt | 4 + .../checkout/conformance2/state/gl-enum-tests.html | 50 + .../checkout/conformance2/state/gl-get-calls.html | 198 + .../checkout/conformance2/state/gl-getstring.html | 81 + .../conformance2/state/gl-object-get-calls.html | 47 + .../checkout/conformance2/sync/00_test_list.txt | 1 + .../conformance2/sync/sync-webgl-specific.html | 87 + .../conformance2/textures/00_test_list.txt | 14 + .../conformance2/textures/canvas/00_test_list.txt | 66 + .../canvas/tex-2d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/canvas/tex-2d-r16f-red-float.html | 57 + .../canvas/tex-2d-r16f-red-half_float.html | 57 + .../textures/canvas/tex-2d-r32f-red-float.html | 57 + .../canvas/tex-2d-r8-red-unsigned_byte.html | 57 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/canvas/tex-2d-rg16f-rg-float.html | 57 + .../canvas/tex-2d-rg16f-rg-half_float.html | 57 + .../textures/canvas/tex-2d-rg32f-rg-float.html | 57 + .../canvas/tex-2d-rg8-rg-unsigned_byte.html | 57 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../textures/canvas/tex-2d-rgb16f-rgb-float.html | 57 + .../canvas/tex-2d-rgb16f-rgb-half_float.html | 57 + .../textures/canvas/tex-2d-rgb32f-rgb-float.html | 57 + .../canvas/tex-2d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../canvas/tex-2d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../textures/canvas/tex-2d-rgb9_e5-rgb-float.html | 57 + .../canvas/tex-2d-rgb9_e5-rgb-half_float.html | 57 + .../textures/canvas/tex-2d-rgba16f-rgba-float.html | 57 + .../canvas/tex-2d-rgba16f-rgba-half_float.html | 57 + .../textures/canvas/tex-2d-rgba32f-rgba-float.html | 57 + .../canvas/tex-2d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../canvas/tex-2d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../canvas/tex-2d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../canvas/tex-3d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/canvas/tex-3d-r16f-red-float.html | 57 + .../canvas/tex-3d-r16f-red-half_float.html | 57 + .../textures/canvas/tex-3d-r32f-red-float.html | 57 + .../canvas/tex-3d-r8-red-unsigned_byte.html | 57 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/canvas/tex-3d-rg16f-rg-float.html | 57 + .../canvas/tex-3d-rg16f-rg-half_float.html | 57 + .../textures/canvas/tex-3d-rg32f-rg-float.html | 57 + .../canvas/tex-3d-rg8-rg-unsigned_byte.html | 57 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../textures/canvas/tex-3d-rgb16f-rgb-float.html | 57 + .../canvas/tex-3d-rgb16f-rgb-half_float.html | 57 + .../textures/canvas/tex-3d-rgb32f-rgb-float.html | 57 + .../canvas/tex-3d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../canvas/tex-3d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../textures/canvas/tex-3d-rgb9_e5-rgb-float.html | 57 + .../canvas/tex-3d-rgb9_e5-rgb-half_float.html | 57 + .../textures/canvas/tex-3d-rgba16f-rgba-float.html | 57 + .../canvas/tex-3d-rgba16f-rgba-half_float.html | 57 + .../textures/canvas/tex-3d-rgba32f-rgba-float.html | 57 + .../canvas/tex-3d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../canvas/tex-3d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../canvas/tex-3d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../textures/canvas_sub_rectangle/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../tex-2d-r16f-red-float.html | 57 + .../tex-2d-r16f-red-half_float.html | 57 + .../tex-2d-r32f-red-float.html | 57 + .../tex-2d-r8-red-unsigned_byte.html | 57 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 57 + .../tex-2d-rg16f-rg-float.html | 57 + .../tex-2d-rg16f-rg-half_float.html | 57 + .../tex-2d-rg32f-rg-float.html | 57 + .../tex-2d-rg8-rg-unsigned_byte.html | 57 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../tex-2d-rgb16f-rgb-float.html | 57 + .../tex-2d-rgb16f-rgb-half_float.html | 57 + .../tex-2d-rgb32f-rgb-float.html | 57 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../tex-2d-rgb9_e5-rgb-float.html | 57 + .../tex-2d-rgb9_e5-rgb-half_float.html | 57 + .../tex-2d-rgba16f-rgba-float.html | 57 + .../tex-2d-rgba16f-rgba-half_float.html | 57 + .../tex-2d-rgba32f-rgba-float.html | 57 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../tex-3d-r16f-red-float.html | 57 + .../tex-3d-r16f-red-half_float.html | 57 + .../tex-3d-r32f-red-float.html | 57 + .../tex-3d-r8-red-unsigned_byte.html | 57 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 57 + .../tex-3d-rg16f-rg-float.html | 57 + .../tex-3d-rg16f-rg-half_float.html | 57 + .../tex-3d-rg32f-rg-float.html | 57 + .../tex-3d-rg8-rg-unsigned_byte.html | 57 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../tex-3d-rgb16f-rgb-float.html | 57 + .../tex-3d-rgb16f-rgb-half_float.html | 57 + .../tex-3d-rgb32f-rgb-float.html | 57 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../tex-3d-rgb9_e5-rgb-float.html | 57 + .../tex-3d-rgb9_e5-rgb-half_float.html | 57 + .../tex-3d-rgba16f-rgba-float.html | 57 + .../tex-3d-rgba16f-rgba-half_float.html | 57 + .../tex-3d-rgba32f-rgba-float.html | 57 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../conformance2/textures/image/00_test_list.txt | 66 + .../image/tex-2d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/image/tex-2d-r16f-red-float.html | 57 + .../textures/image/tex-2d-r16f-red-half_float.html | 57 + .../textures/image/tex-2d-r32f-red-float.html | 57 + .../image/tex-2d-r8-red-unsigned_byte.html | 57 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/image/tex-2d-rg16f-rg-float.html | 57 + .../textures/image/tex-2d-rg16f-rg-half_float.html | 57 + .../textures/image/tex-2d-rg32f-rg-float.html | 57 + .../image/tex-2d-rg8-rg-unsigned_byte.html | 57 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../textures/image/tex-2d-rgb16f-rgb-float.html | 57 + .../image/tex-2d-rgb16f-rgb-half_float.html | 57 + .../textures/image/tex-2d-rgb32f-rgb-float.html | 57 + .../image/tex-2d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../image/tex-2d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../image/tex-2d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../textures/image/tex-2d-rgb9_e5-rgb-float.html | 57 + .../image/tex-2d-rgb9_e5-rgb-half_float.html | 57 + .../textures/image/tex-2d-rgba16f-rgba-float.html | 57 + .../image/tex-2d-rgba16f-rgba-half_float.html | 57 + .../textures/image/tex-2d-rgba32f-rgba-float.html | 57 + .../image/tex-2d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../image/tex-2d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../image/tex-2d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../image/tex-3d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/image/tex-3d-r16f-red-float.html | 57 + .../textures/image/tex-3d-r16f-red-half_float.html | 57 + .../textures/image/tex-3d-r32f-red-float.html | 57 + .../image/tex-3d-r8-red-unsigned_byte.html | 57 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/image/tex-3d-rg16f-rg-float.html | 57 + .../textures/image/tex-3d-rg16f-rg-half_float.html | 57 + .../textures/image/tex-3d-rg32f-rg-float.html | 57 + .../image/tex-3d-rg8-rg-unsigned_byte.html | 57 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../textures/image/tex-3d-rgb16f-rgb-float.html | 57 + .../image/tex-3d-rgb16f-rgb-half_float.html | 57 + .../textures/image/tex-3d-rgb32f-rgb-float.html | 57 + .../image/tex-3d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../image/tex-3d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../image/tex-3d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../textures/image/tex-3d-rgb9_e5-rgb-float.html | 57 + .../image/tex-3d-rgb9_e5-rgb-half_float.html | 57 + .../textures/image/tex-3d-rgba16f-rgba-float.html | 57 + .../image/tex-3d-rgba16f-rgba-half_float.html | 57 + .../textures/image/tex-3d-rgba32f-rgba-float.html | 57 + .../image/tex-3d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../image/tex-3d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../image/tex-3d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../image_bitmap_from_blob/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-2d-r16f-red-float.html | 58 + .../tex-2d-r16f-red-half_float.html | 58 + .../tex-2d-r32f-red-float.html | 58 + .../tex-2d-r8-red-unsigned_byte.html | 58 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-2d-rg16f-rg-float.html | 58 + .../tex-2d-rg16f-rg-half_float.html | 58 + .../tex-2d-rg32f-rg-float.html | 58 + .../tex-2d-rg8-rg-unsigned_byte.html | 58 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-2d-rgb16f-rgb-float.html | 58 + .../tex-2d-rgb16f-rgb-half_float.html | 58 + .../tex-2d-rgb32f-rgb-float.html | 58 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-2d-rgb9_e5-rgb-float.html | 58 + .../tex-2d-rgb9_e5-rgb-half_float.html | 58 + .../tex-2d-rgba16f-rgba-float.html | 58 + .../tex-2d-rgba16f-rgba-half_float.html | 58 + .../tex-2d-rgba32f-rgba-float.html | 58 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-3d-r16f-red-float.html | 58 + .../tex-3d-r16f-red-half_float.html | 58 + .../tex-3d-r32f-red-float.html | 58 + .../tex-3d-r8-red-unsigned_byte.html | 58 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-3d-rg16f-rg-float.html | 58 + .../tex-3d-rg16f-rg-half_float.html | 58 + .../tex-3d-rg32f-rg-float.html | 58 + .../tex-3d-rg8-rg-unsigned_byte.html | 58 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-3d-rgb16f-rgb-float.html | 58 + .../tex-3d-rgb16f-rgb-half_float.html | 58 + .../tex-3d-rgb32f-rgb-float.html | 58 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-3d-rgb9_e5-rgb-float.html | 58 + .../tex-3d-rgb9_e5-rgb-half_float.html | 58 + .../tex-3d-rgba16f-rgba-float.html | 58 + .../tex-3d-rgba16f-rgba-half_float.html | 58 + .../tex-3d-rgba32f-rgba-float.html | 58 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../image_bitmap_from_canvas/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-2d-r16f-red-float.html | 58 + .../tex-2d-r16f-red-half_float.html | 58 + .../tex-2d-r32f-red-float.html | 58 + .../tex-2d-r8-red-unsigned_byte.html | 58 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-2d-rg16f-rg-float.html | 58 + .../tex-2d-rg16f-rg-half_float.html | 58 + .../tex-2d-rg32f-rg-float.html | 58 + .../tex-2d-rg8-rg-unsigned_byte.html | 58 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-2d-rgb16f-rgb-float.html | 58 + .../tex-2d-rgb16f-rgb-half_float.html | 58 + .../tex-2d-rgb32f-rgb-float.html | 58 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-2d-rgb9_e5-rgb-float.html | 58 + .../tex-2d-rgb9_e5-rgb-half_float.html | 58 + .../tex-2d-rgba16f-rgba-float.html | 58 + .../tex-2d-rgba16f-rgba-half_float.html | 58 + .../tex-2d-rgba32f-rgba-float.html | 58 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-3d-r16f-red-float.html | 58 + .../tex-3d-r16f-red-half_float.html | 58 + .../tex-3d-r32f-red-float.html | 58 + .../tex-3d-r8-red-unsigned_byte.html | 58 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-3d-rg16f-rg-float.html | 58 + .../tex-3d-rg16f-rg-half_float.html | 58 + .../tex-3d-rg32f-rg-float.html | 58 + .../tex-3d-rg8-rg-unsigned_byte.html | 58 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-3d-rgb16f-rgb-float.html | 58 + .../tex-3d-rgb16f-rgb-half_float.html | 58 + .../tex-3d-rgb32f-rgb-float.html | 58 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-3d-rgb9_e5-rgb-float.html | 58 + .../tex-3d-rgb9_e5-rgb-half_float.html | 58 + .../tex-3d-rgba16f-rgba-float.html | 58 + .../tex-3d-rgba16f-rgba-half_float.html | 58 + .../tex-3d-rgba32f-rgba-float.html | 58 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../image_bitmap_from_image/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-2d-r16f-red-float.html | 58 + .../tex-2d-r16f-red-half_float.html | 58 + .../tex-2d-r32f-red-float.html | 58 + .../tex-2d-r8-red-unsigned_byte.html | 58 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-2d-rg16f-rg-float.html | 58 + .../tex-2d-rg16f-rg-half_float.html | 58 + .../tex-2d-rg32f-rg-float.html | 58 + .../tex-2d-rg8-rg-unsigned_byte.html | 58 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-2d-rgb16f-rgb-float.html | 58 + .../tex-2d-rgb16f-rgb-half_float.html | 58 + .../tex-2d-rgb32f-rgb-float.html | 58 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-2d-rgb9_e5-rgb-float.html | 58 + .../tex-2d-rgb9_e5-rgb-half_float.html | 58 + .../tex-2d-rgba16f-rgba-float.html | 58 + .../tex-2d-rgba16f-rgba-half_float.html | 58 + .../tex-2d-rgba32f-rgba-float.html | 58 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-3d-r16f-red-float.html | 58 + .../tex-3d-r16f-red-half_float.html | 58 + .../tex-3d-r32f-red-float.html | 58 + .../tex-3d-r8-red-unsigned_byte.html | 58 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-3d-rg16f-rg-float.html | 58 + .../tex-3d-rg16f-rg-half_float.html | 58 + .../tex-3d-rg32f-rg-float.html | 58 + .../tex-3d-rg8-rg-unsigned_byte.html | 58 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-3d-rgb16f-rgb-float.html | 58 + .../tex-3d-rgb16f-rgb-half_float.html | 58 + .../tex-3d-rgb32f-rgb-float.html | 58 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-3d-rgb9_e5-rgb-float.html | 58 + .../tex-3d-rgb9_e5-rgb-half_float.html | 58 + .../tex-3d-rgba16f-rgba-float.html | 58 + .../tex-3d-rgba16f-rgba-half_float.html | 58 + .../tex-3d-rgba32f-rgba-float.html | 58 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-2d-r16f-red-float.html | 58 + .../tex-2d-r16f-red-half_float.html | 58 + .../tex-2d-r32f-red-float.html | 58 + .../tex-2d-r8-red-unsigned_byte.html | 58 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-2d-rg16f-rg-float.html | 58 + .../tex-2d-rg16f-rg-half_float.html | 58 + .../tex-2d-rg32f-rg-float.html | 58 + .../tex-2d-rg8-rg-unsigned_byte.html | 58 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-2d-rgb16f-rgb-float.html | 58 + .../tex-2d-rgb16f-rgb-half_float.html | 58 + .../tex-2d-rgb32f-rgb-float.html | 58 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-2d-rgb9_e5-rgb-float.html | 58 + .../tex-2d-rgb9_e5-rgb-half_float.html | 58 + .../tex-2d-rgba16f-rgba-float.html | 58 + .../tex-2d-rgba16f-rgba-half_float.html | 58 + .../tex-2d-rgba32f-rgba-float.html | 58 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-3d-r16f-red-float.html | 58 + .../tex-3d-r16f-red-half_float.html | 58 + .../tex-3d-r32f-red-float.html | 58 + .../tex-3d-r8-red-unsigned_byte.html | 58 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-3d-rg16f-rg-float.html | 58 + .../tex-3d-rg16f-rg-half_float.html | 58 + .../tex-3d-rg32f-rg-float.html | 58 + .../tex-3d-rg8-rg-unsigned_byte.html | 58 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-3d-rgb16f-rgb-float.html | 58 + .../tex-3d-rgb16f-rgb-half_float.html | 58 + .../tex-3d-rgb32f-rgb-float.html | 58 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-3d-rgb9_e5-rgb-float.html | 58 + .../tex-3d-rgb9_e5-rgb-half_float.html | 58 + .../tex-3d-rgba16f-rgba-float.html | 58 + .../tex-3d-rgba16f-rgba-half_float.html | 58 + .../tex-3d-rgba32f-rgba-float.html | 58 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../image_bitmap_from_image_data/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-2d-r16f-red-float.html | 58 + .../tex-2d-r16f-red-half_float.html | 58 + .../tex-2d-r32f-red-float.html | 58 + .../tex-2d-r8-red-unsigned_byte.html | 58 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-2d-rg16f-rg-float.html | 58 + .../tex-2d-rg16f-rg-half_float.html | 58 + .../tex-2d-rg32f-rg-float.html | 58 + .../tex-2d-rg8-rg-unsigned_byte.html | 58 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-2d-rgb16f-rgb-float.html | 58 + .../tex-2d-rgb16f-rgb-half_float.html | 58 + .../tex-2d-rgb32f-rgb-float.html | 58 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-2d-rgb9_e5-rgb-float.html | 58 + .../tex-2d-rgb9_e5-rgb-half_float.html | 58 + .../tex-2d-rgba16f-rgba-float.html | 58 + .../tex-2d-rgba16f-rgba-half_float.html | 58 + .../tex-2d-rgba32f-rgba-float.html | 58 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-3d-r16f-red-float.html | 58 + .../tex-3d-r16f-red-half_float.html | 58 + .../tex-3d-r32f-red-float.html | 58 + .../tex-3d-r8-red-unsigned_byte.html | 58 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-3d-rg16f-rg-float.html | 58 + .../tex-3d-rg16f-rg-half_float.html | 58 + .../tex-3d-rg32f-rg-float.html | 58 + .../tex-3d-rg8-rg-unsigned_byte.html | 58 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-3d-rgb16f-rgb-float.html | 58 + .../tex-3d-rgb16f-rgb-half_float.html | 58 + .../tex-3d-rgb32f-rgb-float.html | 58 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-3d-rgb9_e5-rgb-float.html | 58 + .../tex-3d-rgb9_e5-rgb-half_float.html | 58 + .../tex-3d-rgba16f-rgba-float.html | 58 + .../tex-3d-rgba16f-rgba-half_float.html | 58 + .../tex-3d-rgba32f-rgba-float.html | 58 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../image_bitmap_from_video/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-2d-r16f-red-float.html | 58 + .../tex-2d-r16f-red-half_float.html | 58 + .../tex-2d-r32f-red-float.html | 58 + .../tex-2d-r8-red-unsigned_byte.html | 58 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-2d-rg16f-rg-float.html | 58 + .../tex-2d-rg16f-rg-half_float.html | 58 + .../tex-2d-rg32f-rg-float.html | 58 + .../tex-2d-rg8-rg-unsigned_byte.html | 58 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-2d-rgb16f-rgb-float.html | 58 + .../tex-2d-rgb16f-rgb-half_float.html | 58 + .../tex-2d-rgb32f-rgb-float.html | 58 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-2d-rgb9_e5-rgb-float.html | 58 + .../tex-2d-rgb9_e5-rgb-half_float.html | 58 + .../tex-2d-rgba16f-rgba-float.html | 58 + .../tex-2d-rgba16f-rgba-half_float.html | 58 + .../tex-2d-rgba32f-rgba-float.html | 58 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../tex-3d-r16f-red-float.html | 58 + .../tex-3d-r16f-red-half_float.html | 58 + .../tex-3d-r32f-red-float.html | 58 + .../tex-3d-r8-red-unsigned_byte.html | 58 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 58 + .../tex-3d-rg16f-rg-float.html | 58 + .../tex-3d-rg16f-rg-half_float.html | 58 + .../tex-3d-rg32f-rg-float.html | 58 + .../tex-3d-rg8-rg-unsigned_byte.html | 58 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../tex-3d-rgb16f-rgb-float.html | 58 + .../tex-3d-rgb16f-rgb-half_float.html | 58 + .../tex-3d-rgb32f-rgb-float.html | 58 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../tex-3d-rgb9_e5-rgb-float.html | 58 + .../tex-3d-rgb9_e5-rgb-half_float.html | 58 + .../tex-3d-rgba16f-rgba-float.html | 58 + .../tex-3d-rgba16f-rgba-half_float.html | 58 + .../tex-3d-rgba32f-rgba-float.html | 58 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../textures/image_data/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../textures/image_data/tex-2d-r16f-red-float.html | 58 + .../image_data/tex-2d-r16f-red-half_float.html | 58 + .../textures/image_data/tex-2d-r32f-red-float.html | 58 + .../image_data/tex-2d-r8-red-unsigned_byte.html | 58 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 58 + .../textures/image_data/tex-2d-rg16f-rg-float.html | 58 + .../image_data/tex-2d-rg16f-rg-half_float.html | 58 + .../textures/image_data/tex-2d-rg32f-rg-float.html | 58 + .../image_data/tex-2d-rg8-rg-unsigned_byte.html | 58 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../image_data/tex-2d-rgb16f-rgb-float.html | 58 + .../image_data/tex-2d-rgb16f-rgb-half_float.html | 58 + .../image_data/tex-2d-rgb32f-rgb-float.html | 58 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../image_data/tex-2d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../image_data/tex-2d-rgb9_e5-rgb-float.html | 58 + .../image_data/tex-2d-rgb9_e5-rgb-half_float.html | 58 + .../image_data/tex-2d-rgba16f-rgba-float.html | 58 + .../image_data/tex-2d-rgba16f-rgba-half_float.html | 58 + .../image_data/tex-2d-rgba32f-rgba-float.html | 58 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../image_data/tex-2d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 58 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 58 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 58 + .../textures/image_data/tex-3d-r16f-red-float.html | 58 + .../image_data/tex-3d-r16f-red-half_float.html | 58 + .../textures/image_data/tex-3d-r32f-red-float.html | 58 + .../image_data/tex-3d-r8-red-unsigned_byte.html | 58 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 58 + .../textures/image_data/tex-3d-rg16f-rg-float.html | 58 + .../image_data/tex-3d-rg16f-rg-half_float.html | 58 + .../textures/image_data/tex-3d-rg32f-rg-float.html | 58 + .../image_data/tex-3d-rg8-rg-unsigned_byte.html | 58 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 58 + .../image_data/tex-3d-rgb16f-rgb-float.html | 58 + .../image_data/tex-3d-rgb16f-rgb-half_float.html | 58 + .../image_data/tex-3d-rgb32f-rgb-float.html | 58 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 58 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 58 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 58 + .../image_data/tex-3d-rgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 58 + .../image_data/tex-3d-rgb9_e5-rgb-float.html | 58 + .../image_data/tex-3d-rgb9_e5-rgb-half_float.html | 58 + .../image_data/tex-3d-rgba16f-rgba-float.html | 58 + .../image_data/tex-3d-rgba16f-rgba-half_float.html | 58 + .../image_data/tex-3d-rgba32f-rgba-float.html | 58 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 58 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 58 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 58 + .../image_data/tex-3d-srgb8-rgb-unsigned_byte.html | 58 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 58 + .../conformance2/textures/misc/00_test_list.txt | 23 + .../textures/misc/active-3d-texture-bug.html | 145 + .../textures/misc/compressed-tex-image.html | 94 + .../misc/copy-texture-image-luma-format.html | 187 + .../misc/copy-texture-image-webgl-specific.html | 324 + .../textures/misc/copy-texture-image.html | 248 + .../textures/misc/gl-get-tex-parameter.html | 48 + .../integer-cubemap-specification-order-bug.html | 190 + .../misc/integer-cubemap-texture-sampling.html | 190 + .../conformance2/textures/misc/mipmap-fbo.html | 71 + .../textures/misc/tex-3d-size-limit.html | 184 + ...ub-image-with-array-buffer-view-sub-source.html | 218 + .../tex-image-with-bad-args-from-dom-elements.html | 149 + .../textures/misc/tex-image-with-bad-args.html | 76 + .../misc/tex-image-with-different-data-source.html | 72 + .../textures/misc/tex-input-validation.html | 45 + .../textures/misc/tex-mipmap-levels.html | 280 + .../textures/misc/tex-new-formats.html | 586 + .../textures/misc/tex-srgb-mipmap.html | 227 + .../conformance2/textures/misc/tex-storage-2d.html | 294 + .../textures/misc/tex-storage-and-subimage-3d.html | 234 + .../misc/tex-storage-compressed-formats.html | 124 + .../textures/misc/tex-unpack-params.html | 612 + .../textures/misc/texel-fetch-undefined.html | 104 + .../conformance2/textures/misc/texture-npot.html | 181 + .../textures/svg_image/00_test_list.txt | 66 + .../svg_image/tex-2d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/svg_image/tex-2d-r16f-red-float.html | 57 + .../svg_image/tex-2d-r16f-red-half_float.html | 57 + .../textures/svg_image/tex-2d-r32f-red-float.html | 57 + .../svg_image/tex-2d-r8-red-unsigned_byte.html | 57 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/svg_image/tex-2d-rg16f-rg-float.html | 57 + .../svg_image/tex-2d-rg16f-rg-half_float.html | 57 + .../textures/svg_image/tex-2d-rg32f-rg-float.html | 57 + .../svg_image/tex-2d-rg8-rg-unsigned_byte.html | 57 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../svg_image/tex-2d-rgb16f-rgb-float.html | 57 + .../svg_image/tex-2d-rgb16f-rgb-half_float.html | 57 + .../svg_image/tex-2d-rgb32f-rgb-float.html | 57 + .../svg_image/tex-2d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../svg_image/tex-2d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../svg_image/tex-2d-rgb9_e5-rgb-float.html | 57 + .../svg_image/tex-2d-rgb9_e5-rgb-half_float.html | 57 + .../svg_image/tex-2d-rgba16f-rgba-float.html | 57 + .../svg_image/tex-2d-rgba16f-rgba-half_float.html | 57 + .../svg_image/tex-2d-rgba32f-rgba-float.html | 57 + .../svg_image/tex-2d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../svg_image/tex-2d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../svg_image/tex-2d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../svg_image/tex-3d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/svg_image/tex-3d-r16f-red-float.html | 57 + .../svg_image/tex-3d-r16f-red-half_float.html | 57 + .../textures/svg_image/tex-3d-r32f-red-float.html | 57 + .../svg_image/tex-3d-r8-red-unsigned_byte.html | 57 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/svg_image/tex-3d-rg16f-rg-float.html | 57 + .../svg_image/tex-3d-rg16f-rg-half_float.html | 57 + .../textures/svg_image/tex-3d-rg32f-rg-float.html | 57 + .../svg_image/tex-3d-rg8-rg-unsigned_byte.html | 57 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../svg_image/tex-3d-rgb16f-rgb-float.html | 57 + .../svg_image/tex-3d-rgb16f-rgb-half_float.html | 57 + .../svg_image/tex-3d-rgb32f-rgb-float.html | 57 + .../svg_image/tex-3d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../svg_image/tex-3d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../svg_image/tex-3d-rgb9_e5-rgb-float.html | 57 + .../svg_image/tex-3d-rgb9_e5-rgb-half_float.html | 57 + .../svg_image/tex-3d-rgba16f-rgba-float.html | 57 + .../svg_image/tex-3d-rgba16f-rgba-half_float.html | 57 + .../svg_image/tex-3d-rgba32f-rgba-float.html | 57 + .../svg_image/tex-3d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../svg_image/tex-3d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../svg_image/tex-3d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../conformance2/textures/video/00_test_list.txt | 66 + .../video/tex-2d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/video/tex-2d-r16f-red-float.html | 57 + .../textures/video/tex-2d-r16f-red-half_float.html | 57 + .../textures/video/tex-2d-r32f-red-float.html | 57 + .../video/tex-2d-r8-red-unsigned_byte.html | 57 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/video/tex-2d-rg16f-rg-float.html | 57 + .../textures/video/tex-2d-rg16f-rg-half_float.html | 57 + .../textures/video/tex-2d-rg32f-rg-float.html | 57 + .../video/tex-2d-rg8-rg-unsigned_byte.html | 57 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../textures/video/tex-2d-rgb16f-rgb-float.html | 57 + .../video/tex-2d-rgb16f-rgb-half_float.html | 57 + .../textures/video/tex-2d-rgb32f-rgb-float.html | 57 + .../video/tex-2d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../video/tex-2d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../video/tex-2d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../textures/video/tex-2d-rgb9_e5-rgb-float.html | 57 + .../video/tex-2d-rgb9_e5-rgb-half_float.html | 57 + .../textures/video/tex-2d-rgba16f-rgba-float.html | 57 + .../video/tex-2d-rgba16f-rgba-half_float.html | 57 + .../textures/video/tex-2d-rgba32f-rgba-float.html | 57 + .../video/tex-2d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../video/tex-2d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../video/tex-2d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../video/tex-3d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../textures/video/tex-3d-r16f-red-float.html | 57 + .../textures/video/tex-3d-r16f-red-half_float.html | 57 + .../textures/video/tex-3d-r32f-red-float.html | 57 + .../video/tex-3d-r8-red-unsigned_byte.html | 57 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 57 + .../textures/video/tex-3d-rg16f-rg-float.html | 57 + .../textures/video/tex-3d-rg16f-rg-half_float.html | 57 + .../textures/video/tex-3d-rg32f-rg-float.html | 57 + .../video/tex-3d-rg8-rg-unsigned_byte.html | 57 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../textures/video/tex-3d-rgb16f-rgb-float.html | 57 + .../video/tex-3d-rgb16f-rgb-half_float.html | 57 + .../textures/video/tex-3d-rgb32f-rgb-float.html | 57 + .../video/tex-3d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../video/tex-3d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../video/tex-3d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../textures/video/tex-3d-rgb9_e5-rgb-float.html | 57 + .../video/tex-3d-rgb9_e5-rgb-half_float.html | 57 + .../textures/video/tex-3d-rgba16f-rgba-float.html | 57 + .../video/tex-3d-rgba16f-rgba-half_float.html | 57 + .../textures/video/tex-3d-rgba32f-rgba-float.html | 57 + .../video/tex-3d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../video/tex-3d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../video/tex-3d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../textures/webgl_canvas/00_test_list.txt | 66 + .../tex-2d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-2d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../webgl_canvas/tex-2d-r16f-red-float.html | 57 + .../webgl_canvas/tex-2d-r16f-red-half_float.html | 57 + .../webgl_canvas/tex-2d-r32f-red-float.html | 57 + .../webgl_canvas/tex-2d-r8-red-unsigned_byte.html | 57 + .../tex-2d-r8ui-red_integer-unsigned_byte.html | 57 + .../webgl_canvas/tex-2d-rg16f-rg-float.html | 57 + .../webgl_canvas/tex-2d-rg16f-rg-half_float.html | 57 + .../webgl_canvas/tex-2d-rg32f-rg-float.html | 57 + .../webgl_canvas/tex-2d-rg8-rg-unsigned_byte.html | 57 + .../tex-2d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../webgl_canvas/tex-2d-rgb16f-rgb-float.html | 57 + .../webgl_canvas/tex-2d-rgb16f-rgb-half_float.html | 57 + .../webgl_canvas/tex-2d-rgb32f-rgb-float.html | 57 + .../tex-2d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../tex-2d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../tex-2d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../webgl_canvas/tex-2d-rgb9_e5-rgb-float.html | 57 + .../tex-2d-rgb9_e5-rgb-half_float.html | 57 + .../webgl_canvas/tex-2d-rgba16f-rgba-float.html | 57 + .../tex-2d-rgba16f-rgba-half_float.html | 57 + .../webgl_canvas/tex-2d-rgba32f-rgba-float.html | 57 + .../tex-2d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-2d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../tex-2d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-float.html | 57 + .../tex-3d-r11f_g11f_b10f-rgb-half_float.html | 57 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 57 + .../webgl_canvas/tex-3d-r16f-red-float.html | 57 + .../webgl_canvas/tex-3d-r16f-red-half_float.html | 57 + .../webgl_canvas/tex-3d-r32f-red-float.html | 57 + .../webgl_canvas/tex-3d-r8-red-unsigned_byte.html | 57 + .../tex-3d-r8ui-red_integer-unsigned_byte.html | 57 + .../webgl_canvas/tex-3d-rg16f-rg-float.html | 57 + .../webgl_canvas/tex-3d-rg16f-rg-half_float.html | 57 + .../webgl_canvas/tex-3d-rg32f-rg-float.html | 57 + .../webgl_canvas/tex-3d-rg8-rg-unsigned_byte.html | 57 + .../tex-3d-rg8ui-rg_integer-unsigned_byte.html | 57 + .../webgl_canvas/tex-3d-rgb16f-rgb-float.html | 57 + .../webgl_canvas/tex-3d-rgb16f-rgb-half_float.html | 57 + .../webgl_canvas/tex-3d-rgb32f-rgb-float.html | 57 + .../tex-3d-rgb565-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 57 + .../tex-3d-rgb5_a1-rgba-unsigned_byte.html | 57 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 57 + .../tex-3d-rgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 57 + .../webgl_canvas/tex-3d-rgb9_e5-rgb-float.html | 57 + .../tex-3d-rgb9_e5-rgb-half_float.html | 57 + .../webgl_canvas/tex-3d-rgba16f-rgba-float.html | 57 + .../tex-3d-rgba16f-rgba-half_float.html | 57 + .../webgl_canvas/tex-3d-rgba32f-rgba-float.html | 57 + .../tex-3d-rgba4-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 57 + .../tex-3d-rgba8-rgba-unsigned_byte.html | 57 + .../tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 57 + .../tex-3d-srgb8-rgb-unsigned_byte.html | 57 + .../tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 57 + .../transform_feedback/00_test_list.txt | 3 + .../transform_feedback/transform_feedback.html | 454 + .../two-unreferenced-varyings.html | 157 + .../unwritten-output-defaults-to-zero.html | 154 + .../conformance2/vertex_arrays/00_test_list.txt | 1 + .../vertex_arrays/vertex-array-object.html | 684 + .../test/webgl-conf/checkout/deqp/00_test_list.txt | 7 + dom/canvas/test/webgl-conf/checkout/deqp/LICENSE | 202 + dom/canvas/test/webgl-conf/checkout/deqp/README.md | 21 + dom/canvas/test/webgl-conf/checkout/deqp/build.py | 283 + .../test/webgl-conf/checkout/deqp/compiler.jar | Bin 0 -> 6220019 bytes .../checkout/deqp/compiler_additional_extern.js | 111 + .../deqp/data/gles2/shaders/00_test_list.txt | 15 + .../deqp/data/gles2/shaders/conditionals.html | 36 + .../deqp/data/gles2/shaders/conditionals.test | 333 + .../data/gles2/shaders/constant_expressions.html | 36 + .../data/gles2/shaders/constant_expressions.test | 288 + .../deqp/data/gles2/shaders/constants.html | 36 + .../deqp/data/gles2/shaders/constants.test | 662 + .../deqp/data/gles2/shaders/conversions.html | 36 + .../deqp/data/gles2/shaders/conversions.test | 5930 +++++ .../deqp/data/gles2/shaders/declarations.html | 36 + .../deqp/data/gles2/shaders/declarations.test | 140 + .../checkout/deqp/data/gles2/shaders/fragdata.html | 36 + .../checkout/deqp/data/gles2/shaders/fragdata.test | 76 + .../deqp/data/gles2/shaders/functions.html | 36 + .../deqp/data/gles2/shaders/functions.test | 3475 +++ .../gles2/shaders/invalid_texture_functions.html | 36 + .../gles2/shaders/invalid_texture_functions.test | 90 + .../checkout/deqp/data/gles2/shaders/keywords.html | 36 + .../checkout/deqp/data/gles2/shaders/keywords.test | 1613 ++ .../checkout/deqp/data/gles2/shaders/linkage.html | 36 + .../checkout/deqp/data/gles2/shaders/linkage.test | 1715 ++ .../deqp/data/gles2/shaders/preprocessor.html | 36 + .../deqp/data/gles2/shaders/preprocessor.test | 4287 +++ .../data/gles2/shaders/qualification_order.html | 36 + .../data/gles2/shaders/qualification_order.test | 785 + .../data/gles2/shaders/reserved_operators.html | 36 + .../data/gles2/shaders/reserved_operators.test | 250 + .../checkout/deqp/data/gles2/shaders/scoping.html | 36 + .../checkout/deqp/data/gles2/shaders/scoping.test | 823 + .../deqp/data/gles2/shaders/shader-lib-test.html | 462 + .../checkout/deqp/data/gles2/shaders/swizzles.html | 36 + .../checkout/deqp/data/gles2/shaders/swizzles.test | 6811 +++++ .../checkout/deqp/data/gles2/shaders/template.html | 36 + .../deqp/data/gles3/shaders/00_test_list.txt | 17 + .../checkout/deqp/data/gles3/shaders/arrays.html | 36 + .../checkout/deqp/data/gles3/shaders/arrays.test | 1962 ++ .../deqp/data/gles3/shaders/conditionals.html | 36 + .../deqp/data/gles3/shaders/conditionals.test | 381 + .../data/gles3/shaders/constant_expressions.html | 36 + .../data/gles3/shaders/constant_expressions.test | 483 + .../deqp/data/gles3/shaders/constants.html | 36 + .../deqp/data/gles3/shaders/constants.test | 1153 + .../deqp/data/gles3/shaders/conversions.html | 36 + .../deqp/data/gles3/shaders/conversions.test | 14246 ++++++++++ .../deqp/data/gles3/shaders/declarations.html | 36 + .../deqp/data/gles3/shaders/declarations.test | 591 + .../checkout/deqp/data/gles3/shaders/fragdata.html | 36 + .../checkout/deqp/data/gles3/shaders/fragdata.test | 76 + .../deqp/data/gles3/shaders/functions.html | 36 + .../deqp/data/gles3/shaders/functions.test | 4345 ++++ .../gles3/shaders/invalid_texture_functions.html | 36 + .../gles3/shaders/invalid_texture_functions.test | 1143 + .../checkout/deqp/data/gles3/shaders/keywords.html | 36 + .../checkout/deqp/data/gles3/shaders/keywords.test | 3219 +++ .../checkout/deqp/data/gles3/shaders/linkage.html | 36 + .../checkout/deqp/data/gles3/shaders/linkage.test | 3833 +++ .../checkout/deqp/data/gles3/shaders/negative.html | 36 + .../checkout/deqp/data/gles3/shaders/negative.test | 100 + .../deqp/data/gles3/shaders/preprocessor.html | 36 + .../deqp/data/gles3/shaders/preprocessor.test | 5256 ++++ .../data/gles3/shaders/qualification_order.html | 36 + .../data/gles3/shaders/qualification_order.test | 2714 ++ .../checkout/deqp/data/gles3/shaders/scoping.html | 36 + .../checkout/deqp/data/gles3/shaders/scoping.test | 901 + .../checkout/deqp/data/gles3/shaders/switch.html | 36 + .../checkout/deqp/data/gles3/shaders/switch.test | 633 + .../checkout/deqp/data/gles3/shaders/swizzles.html | 36 + .../checkout/deqp/data/gles3/shaders/swizzles.test | 7459 ++++++ .../checkout/deqp/data/gles3/shaders/template.html | 36 + .../test/webgl-conf/checkout/deqp/deqp-deps.js | 141 + .../framework/common/tcuBilinearImageCompare.js | 272 + .../deqp/framework/common/tcuCompressedTexture.js | 967 + .../checkout/deqp/framework/common/tcuFloat.js | 809 + .../deqp/framework/common/tcuFloatFormat.js | 349 + .../deqp/framework/common/tcuFuzzyImageCompare.js | 338 + .../deqp/framework/common/tcuImageCompare.js | 757 + .../checkout/deqp/framework/common/tcuInterval.js | 609 + .../checkout/deqp/framework/common/tcuLogImage.js | 163 + .../checkout/deqp/framework/common/tcuMatrix.js | 354 + .../deqp/framework/common/tcuMatrixUtil.js | 70 + .../deqp/framework/common/tcuPixelFormat.js | 79 + .../checkout/deqp/framework/common/tcuRGBA.js | 279 + .../checkout/deqp/framework/common/tcuSkipList.js | 324 + .../deqp/framework/common/tcuStringTemplate.js | 42 + .../checkout/deqp/framework/common/tcuSurface.js | 184 + .../checkout/deqp/framework/common/tcuTestCase.js | 484 + .../deqp/framework/common/tcuTexCompareVerifier.js | 1356 + .../deqp/framework/common/tcuTexLookupVerifier.js | 2225 ++ .../deqp/framework/common/tcuTexVerifierUtil.js | 265 + .../checkout/deqp/framework/common/tcuTexture.js | 3636 +++ .../deqp/framework/common/tcuTextureUtil.js | 725 + .../deqp/framework/delibs/debase/deMath.js | 1061 + .../deqp/framework/delibs/debase/deRandom.js | 260 + .../deqp/framework/delibs/debase/deString.js | 111 + .../deqp/framework/delibs/debase/deUtil.js | 90 + .../checkout/deqp/framework/opengl/gluDrawUtil.js | 510 + .../deqp/framework/opengl/gluObjectWrapper.js | 117 + .../deqp/framework/opengl/gluPixelTransfer.js | 55 + .../deqp/framework/opengl/gluShaderProgram.js | 488 + .../deqp/framework/opengl/gluShaderUtil.js | 795 + .../checkout/deqp/framework/opengl/gluStrUtil.js | 166 + .../checkout/deqp/framework/opengl/gluTexture.js | 380 + .../deqp/framework/opengl/gluTextureUtil.js | 1025 + .../checkout/deqp/framework/opengl/gluVarType.js | 814 + .../deqp/framework/opengl/gluVarTypeUtil.js | 693 + .../opengl/simplereference/00_test_list.txt | 1 + .../opengl/simplereference/referencecontext.html | 32 + .../opengl/simplereference/sglrGLContext.js | 231 + .../opengl/simplereference/sglrReferenceContext.js | 4986 ++++ .../simplereference/sglrReferenceContextTest.js | 834 + .../opengl/simplereference/sglrReferenceUtils.js | 317 + .../opengl/simplereference/sglrShaderProgram.js | 336 + .../deqp/framework/referencerenderer/rrDefs.js | 72 + .../referencerenderer/rrFragmentOperations.js | 583 + .../framework/referencerenderer/rrGenericVector.js | 54 + .../rrMultisamplePixelBufferAccess.js | 190 + .../framework/referencerenderer/rrRenderState.js | 323 + .../deqp/framework/referencerenderer/rrRenderer.js | 1274 + .../deqp/framework/referencerenderer/rrShaders.js | 123 + .../referencerenderer/rrShadingContext.js | 113 + .../deqp/framework/referencerenderer/rrUtil.js | 115 + .../framework/referencerenderer/rrVertexAttrib.js | 641 + .../framework/referencerenderer/rrVertexPacket.js | 101 + .../deqp/functional/gles3/00_test_list.txt | 76 + .../deqp/functional/gles3/attriblocation.html | 24 + .../deqp/functional/gles3/booleanstatequery.html | 24 + .../checkout/deqp/functional/gles3/buffercopy.html | 24 + .../deqp/functional/gles3/bufferobjectquery.html | 24 + .../gles3/builtinprecision/00_test_list.txt | 55 + .../functional/gles3/builtinprecision/abs.html | 32 + .../functional/gles3/builtinprecision/acos.html | 32 + .../functional/gles3/builtinprecision/acosh.html | 32 + .../functional/gles3/builtinprecision/add.html | 32 + .../functional/gles3/builtinprecision/asin.html | 32 + .../functional/gles3/builtinprecision/asinh.html | 32 + .../functional/gles3/builtinprecision/atan.html | 32 + .../functional/gles3/builtinprecision/atan2.html | 32 + .../functional/gles3/builtinprecision/atanh.html | 32 + .../builtinprecision_test_generator.py | 160 + .../functional/gles3/builtinprecision/ceil.html | 32 + .../functional/gles3/builtinprecision/clamp.html | 32 + .../functional/gles3/builtinprecision/cos.html | 32 + .../functional/gles3/builtinprecision/cosh.html | 32 + .../functional/gles3/builtinprecision/cross.html | 32 + .../functional/gles3/builtinprecision/degrees.html | 32 + .../gles3/builtinprecision/determinant.html | 32 + .../gles3/builtinprecision/distance.html | 32 + .../functional/gles3/builtinprecision/div.html | 32 + .../functional/gles3/builtinprecision/dot.html | 32 + .../functional/gles3/builtinprecision/exp.html | 32 + .../functional/gles3/builtinprecision/exp2.html | 32 + .../gles3/builtinprecision/faceforward.html | 32 + .../functional/gles3/builtinprecision/floor.html | 32 + .../functional/gles3/builtinprecision/fract.html | 32 + .../functional/gles3/builtinprecision/inverse.html | 32 + .../gles3/builtinprecision/inversesqrt.html | 32 + .../functional/gles3/builtinprecision/length.html | 32 + .../functional/gles3/builtinprecision/log.html | 32 + .../functional/gles3/builtinprecision/log2.html | 32 + .../gles3/builtinprecision/matrixcompmult.html | 32 + .../functional/gles3/builtinprecision/max.html | 32 + .../functional/gles3/builtinprecision/min.html | 32 + .../functional/gles3/builtinprecision/mix.html | 32 + .../functional/gles3/builtinprecision/mod.html | 32 + .../functional/gles3/builtinprecision/modf.html | 32 + .../functional/gles3/builtinprecision/mul.html | 32 + .../gles3/builtinprecision/normalize.html | 32 + .../gles3/builtinprecision/outerproduct.html | 32 + .../functional/gles3/builtinprecision/pow.html | 32 + .../functional/gles3/builtinprecision/radians.html | 32 + .../functional/gles3/builtinprecision/reflect.html | 32 + .../functional/gles3/builtinprecision/refract.html | 32 + .../functional/gles3/builtinprecision/round.html | 32 + .../gles3/builtinprecision/roundeven.html | 32 + .../functional/gles3/builtinprecision/sign.html | 32 + .../functional/gles3/builtinprecision/sin.html | 32 + .../functional/gles3/builtinprecision/sinh.html | 32 + .../gles3/builtinprecision/smoothstep.html | 32 + .../functional/gles3/builtinprecision/sqrt.html | 32 + .../functional/gles3/builtinprecision/step.html | 32 + .../functional/gles3/builtinprecision/sub.html | 32 + .../functional/gles3/builtinprecision/tan.html | 32 + .../functional/gles3/builtinprecision/tanh.html | 32 + .../gles3/builtinprecision/transpose.html | 32 + .../functional/gles3/builtinprecision/trunc.html | 32 + .../checkout/deqp/functional/gles3/clipping.html | 24 + .../functional/gles3/defaultvertexattribute.html | 24 + .../deqp/functional/gles3/draw/00_test_list.txt | 7 + .../deqp/functional/gles3/draw/draw_arrays.html | 31 + .../gles3/draw/draw_arrays_instanced.html | 31 + .../deqp/functional/gles3/draw/draw_elements.html | 31 + .../gles3/draw/draw_elements_instanced.html | 31 + .../functional/gles3/draw/draw_range_elements.html | 31 + .../functional/gles3/draw/draw_test_generator.py | 106 + .../deqp/functional/gles3/draw/instancing.html | 31 + .../deqp/functional/gles3/draw/random.html | 31 + .../checkout/deqp/functional/gles3/es3fApiCase.js | 161 + .../functional/gles3/es3fAttribLocationTests.js | 267 + .../deqp/functional/gles3/es3fBooleanStateQuery.js | 372 + .../deqp/functional/gles3/es3fBufferCopyTests.js | 355 + .../functional/gles3/es3fBufferObjectQueryTests.js | 177 + .../functional/gles3/es3fBuiltinPrecisionTests.js | 87 + .../deqp/functional/gles3/es3fClippingTests.js | 406 + .../gles3/es3fDefaultVertexAttributeTests.js | 546 + .../deqp/functional/gles3/es3fDrawTests.js | 1155 + .../functional/gles3/es3fFboColorbufferTests.js | 1041 + .../functional/gles3/es3fFboCompletenessTests.js | 567 + .../functional/gles3/es3fFboDepthbufferTests.js | 385 + .../functional/gles3/es3fFboInvalidateTests.js | 1471 ++ .../functional/gles3/es3fFboMultisampleTests.js | 377 + .../deqp/functional/gles3/es3fFboRenderTest.js | 2389 ++ .../functional/gles3/es3fFboStateQueryTests.js | 796 + .../functional/gles3/es3fFboStencilbufferTests.js | 325 + .../deqp/functional/gles3/es3fFboTestCase.js | 483 + .../deqp/functional/gles3/es3fFboTestUtil.js | 1324 + .../functional/gles3/es3fFloatStateQueryTests.js | 431 + .../deqp/functional/gles3/es3fFragDepthTests.js | 593 + .../functional/gles3/es3fFragmentOutputTests.js | 1398 + .../functional/gles3/es3fFramebufferBlitTests.js | 1261 + .../functional/gles3/es3fIndexedStateQueryTests.js | 409 + .../gles3/es3fInstancedRenderingTests.js | 711 + .../functional/gles3/es3fIntegerStateQueryTests.js | 2049 ++ .../gles3/es3fInternalFormatQueryTests.js | 173 + .../deqp/functional/gles3/es3fLifetimeTests.js | 476 + .../deqp/functional/gles3/es3fMultisampleTests.js | 1741 ++ .../functional/gles3/es3fNegativeBufferApiTests.js | 1104 + .../gles3/es3fNegativeFragmentApiTests.js | 339 + .../functional/gles3/es3fNegativeShaderApiTests.js | 1195 + .../functional/gles3/es3fNegativeStateApiTests.js | 927 + .../gles3/es3fNegativeTextureApiTests.js | 3002 +++ .../gles3/es3fNegativeVertexArrayApiTests.js | 910 + .../functional/gles3/es3fOcclusionQueryTests.js | 511 + .../functional/gles3/es3fPixelBufferObjectTest.js | 577 + .../functional/gles3/es3fPrimitiveRestartTests.js | 704 + .../functional/gles3/es3fRasterizerDiscardTests.js | 485 + .../functional/gles3/es3fRboStateQueryTests.js | 308 + .../deqp/functional/gles3/es3fReadPixelTests.js | 517 + .../functional/gles3/es3fSamplerObjectTests.js | 313 + .../functional/gles3/es3fSamplerStateQueryTests.js | 205 + .../deqp/functional/gles3/es3fShaderApiTests.js | 650 + .../functional/gles3/es3fShaderBuiltinVarTests.js | 1109 + .../gles3/es3fShaderCommonFunctionTests.js | 1913 ++ .../functional/gles3/es3fShaderDerivateTests.js | 1696 ++ .../functional/gles3/es3fShaderIndexingTests.js | 1278 + .../deqp/functional/gles3/es3fShaderLoopTests.js | 1251 + .../deqp/functional/gles3/es3fShaderMatrixTest.js | 1852 ++ .../functional/gles3/es3fShaderOperatorTests.js | 3219 +++ .../gles3/es3fShaderPackingFunctionTests.js | 791 + .../functional/gles3/es3fShaderPrecisionTests.js | 941 + .../functional/gles3/es3fShaderStateQueryTests.js | 2205 ++ .../deqp/functional/gles3/es3fShaderStructTests.js | 1957 ++ .../deqp/functional/gles3/es3fShaderSwitchTests.js | 492 + .../gles3/es3fShaderTextureFunctionTests.js | 2698 ++ .../deqp/functional/gles3/es3fStringQueryTests.js | 111 + .../deqp/functional/gles3/es3fSyncTests.js | 335 + .../functional/gles3/es3fTextureFilteringTests.js | 2269 ++ .../functional/gles3/es3fTextureFormatTests.js | 1185 + .../functional/gles3/es3fTextureShadowTests.js | 898 + .../gles3/es3fTextureSpecificationTests.js | 7456 ++++++ .../deqp/functional/gles3/es3fTextureStateQuery.js | 376 + .../deqp/functional/gles3/es3fTextureWrapTests.js | 434 + .../functional/gles3/es3fTransformFeedbackTests.js | 1914 ++ .../deqp/functional/gles3/es3fUniformApiTests.js | 3203 +++ .../deqp/functional/gles3/es3fUniformBlockTests.js | 748 + .../functional/gles3/es3fVertexArrayObjectTests.js | 875 + .../deqp/functional/gles3/es3fVertexArrayTests.js | 1103 + .../deqp/functional/gles3/fbocolorbuffer.html | 32 + .../gles3/fbocolorbuffer/00_test_list.txt | 26 + .../functional/gles3/fbocolorbuffer/blend.html | 32 + .../functional/gles3/fbocolorbuffer/clear.html | 32 + .../fbocolorbuffer_test_generator.py | 133 + .../functional/gles3/fbocolorbuffer/tex2d.html | 32 + .../functional/gles3/fbocolorbuffer/tex2d_00.html | 32 + .../functional/gles3/fbocolorbuffer/tex2d_01.html | 32 + .../functional/gles3/fbocolorbuffer/tex2d_02.html | 32 + .../functional/gles3/fbocolorbuffer/tex2d_03.html | 32 + .../functional/gles3/fbocolorbuffer/tex2d_04.html | 32 + .../functional/gles3/fbocolorbuffer/tex2d_05.html | 32 + .../gles3/fbocolorbuffer/tex2darray.html | 32 + .../gles3/fbocolorbuffer/tex2darray_00.html | 32 + .../gles3/fbocolorbuffer/tex2darray_01.html | 32 + .../gles3/fbocolorbuffer/tex2darray_02.html | 32 + .../gles3/fbocolorbuffer/tex2darray_03.html | 32 + .../gles3/fbocolorbuffer/tex2darray_04.html | 32 + .../gles3/fbocolorbuffer/tex2darray_05.html | 32 + .../functional/gles3/fbocolorbuffer/tex3d.html | 32 + .../functional/gles3/fbocolorbuffer/tex3d_00.html | 32 + .../functional/gles3/fbocolorbuffer/tex3d_01.html | 32 + .../functional/gles3/fbocolorbuffer/tex3d_02.html | 32 + .../functional/gles3/fbocolorbuffer/tex3d_03.html | 32 + .../functional/gles3/fbocolorbuffer/tex3d_04.html | 32 + .../functional/gles3/fbocolorbuffer/tex3d_05.html | 32 + .../functional/gles3/fbocolorbuffer/texcube.html | 32 + .../gles3/fbocolorbuffer/texcube_00.html | 32 + .../gles3/fbocolorbuffer/texcube_01.html | 32 + .../gles3/fbocolorbuffer/texcube_02.html | 32 + .../gles3/fbocolorbuffer/texcube_03.html | 32 + .../gles3/fbocolorbuffer/texcube_04.html | 32 + .../gles3/fbocolorbuffer/texcube_05.html | 32 + .../deqp/functional/gles3/fbocompleteness.html | 32 + .../deqp/functional/gles3/fbodepthbuffer.html | 32 + .../deqp/functional/gles3/fboinvalidate.html | 25 + .../gles3/fboinvalidate/00_test_list.txt | 7 + .../functional/gles3/fboinvalidate/default.html | 32 + .../fboinvalidate/fboinvalidate_test_generator.py | 131 + .../functional/gles3/fboinvalidate/format_00.html | 32 + .../functional/gles3/fboinvalidate/format_01.html | 32 + .../functional/gles3/fboinvalidate/format_02.html | 32 + .../deqp/functional/gles3/fboinvalidate/sub.html | 32 + .../functional/gles3/fboinvalidate/target.html | 32 + .../deqp/functional/gles3/fboinvalidate/whole.html | 32 + .../functional/gles3/fbomultisample.2_samples.html | 24 + .../functional/gles3/fbomultisample.4_samples.html | 24 + .../functional/gles3/fbomultisample.8_samples.html | 24 + .../deqp/functional/gles3/fbomultisample.html | 30 + .../checkout/deqp/functional/gles3/fborender.html | 30 + .../functional/gles3/fborender/00_test_list.txt | 18 + .../gles3/fborender/fborender_test_generator.py | 134 + .../gles3/fborender/recreate_color_00.html | 31 + .../gles3/fborender/recreate_color_01.html | 31 + .../gles3/fborender/recreate_color_02.html | 31 + .../gles3/fborender/recreate_color_03.html | 31 + .../gles3/fborender/recreate_color_04.html | 31 + .../gles3/fborender/recreate_color_05.html | 31 + .../gles3/fborender/recreate_color_06.html | 31 + .../gles3/fborender/recreate_depth_stencil.html | 31 + .../deqp/functional/gles3/fborender/resize_00.html | 31 + .../deqp/functional/gles3/fborender/resize_01.html | 31 + .../deqp/functional/gles3/fborender/resize_02.html | 31 + .../deqp/functional/gles3/fborender/resize_03.html | 31 + .../gles3/fborender/shared_colorbuffer_00.html | 31 + .../gles3/fborender/shared_colorbuffer_01.html | 31 + .../gles3/fborender/shared_colorbuffer_02.html | 31 + .../gles3/fborender/shared_colorbuffer_clear.html | 31 + .../gles3/fborender/shared_depth_stencil.html | 31 + .../functional/gles3/fborender/stencil_clear.html | 31 + .../deqp/functional/gles3/fbostatequery.html | 24 + .../deqp/functional/gles3/fbostencilbuffer.html | 24 + .../deqp/functional/gles3/floatstatequery.html | 24 + .../checkout/deqp/functional/gles3/fragdepth.html | 24 + .../deqp/functional/gles3/fragmentoutput.html | 29 + .../gles3/fragmentoutput/00_test_list.txt | 11 + .../gles3/fragmentoutput/array.fixed.html | 31 + .../gles3/fragmentoutput/array.float.html | 31 + .../functional/gles3/fragmentoutput/array.int.html | 31 + .../gles3/fragmentoutput/array.uint.html | 31 + .../gles3/fragmentoutput/basic.fixed.html | 31 + .../gles3/fragmentoutput/basic.float.html | 31 + .../functional/gles3/fragmentoutput/basic.int.html | 31 + .../gles3/fragmentoutput/basic.uint.html | 31 + .../fragmentoutput_test_generator.py | 110 + .../functional/gles3/fragmentoutput/random_00.html | 31 + .../functional/gles3/fragmentoutput/random_01.html | 31 + .../functional/gles3/fragmentoutput/random_02.html | 31 + .../deqp/functional/gles3/framebufferblit.html | 31 + .../gles3/framebufferblit/00_test_list.txt | 50 + .../gles3/framebufferblit/conversion_00.html | 31 + .../gles3/framebufferblit/conversion_01.html | 31 + .../gles3/framebufferblit/conversion_02.html | 31 + .../gles3/framebufferblit/conversion_03.html | 31 + .../gles3/framebufferblit/conversion_04.html | 31 + .../gles3/framebufferblit/conversion_05.html | 31 + .../gles3/framebufferblit/conversion_06.html | 31 + .../gles3/framebufferblit/conversion_07.html | 31 + .../gles3/framebufferblit/conversion_08.html | 31 + .../gles3/framebufferblit/conversion_09.html | 31 + .../gles3/framebufferblit/conversion_10.html | 31 + .../gles3/framebufferblit/conversion_11.html | 31 + .../gles3/framebufferblit/conversion_12.html | 31 + .../gles3/framebufferblit/conversion_13.html | 31 + .../gles3/framebufferblit/conversion_14.html | 31 + .../gles3/framebufferblit/conversion_15.html | 31 + .../gles3/framebufferblit/conversion_16.html | 31 + .../gles3/framebufferblit/conversion_17.html | 31 + .../gles3/framebufferblit/conversion_18.html | 31 + .../gles3/framebufferblit/conversion_19.html | 31 + .../gles3/framebufferblit/conversion_20.html | 31 + .../gles3/framebufferblit/conversion_21.html | 31 + .../gles3/framebufferblit/conversion_22.html | 31 + .../gles3/framebufferblit/conversion_23.html | 31 + .../gles3/framebufferblit/conversion_24.html | 31 + .../gles3/framebufferblit/conversion_25.html | 31 + .../gles3/framebufferblit/conversion_26.html | 31 + .../gles3/framebufferblit/conversion_27.html | 31 + .../gles3/framebufferblit/conversion_28.html | 31 + .../gles3/framebufferblit/conversion_29.html | 31 + .../gles3/framebufferblit/conversion_30.html | 31 + .../gles3/framebufferblit/conversion_31.html | 31 + .../gles3/framebufferblit/conversion_32.html | 31 + .../gles3/framebufferblit/conversion_33.html | 31 + .../gles3/framebufferblit/conversion_34.html | 31 + .../framebufferblit/default_framebuffer_00.html | 31 + .../framebufferblit/default_framebuffer_01.html | 31 + .../framebufferblit/default_framebuffer_02.html | 31 + .../framebufferblit/default_framebuffer_03.html | 31 + .../framebufferblit/default_framebuffer_04.html | 31 + .../framebufferblit/default_framebuffer_05.html | 31 + .../framebufferblit/default_framebuffer_06.html | 31 + .../gles3/framebufferblit/depth_stencil.html | 31 + .../frambufferblit_test_generator.py | 128 + .../functional/gles3/framebufferblit/rect_00.html | 31 + .../functional/gles3/framebufferblit/rect_01.html | 31 + .../functional/gles3/framebufferblit/rect_02.html | 31 + .../functional/gles3/framebufferblit/rect_03.html | 31 + .../functional/gles3/framebufferblit/rect_04.html | 31 + .../functional/gles3/framebufferblit/rect_05.html | 31 + .../functional/gles3/framebufferblit/rect_06.html | 31 + .../deqp/functional/gles3/indexedstatequery.html | 24 + .../deqp/functional/gles3/instancedrendering.html | 24 + .../deqp/functional/gles3/integerstatequery.html | 24 + .../deqp/functional/gles3/internalformatquery.html | 24 + .../checkout/deqp/functional/gles3/lifetime.html | 34 + .../deqp/functional/gles3/multisample.html | 24 + .../deqp/functional/gles3/negativebufferapi.html | 30 + .../deqp/functional/gles3/negativefragmentapi.html | 23 + .../deqp/functional/gles3/negativeshaderapi.html | 24 + .../deqp/functional/gles3/negativestateapi.html | 23 + .../deqp/functional/gles3/negativetextureapi.html | 30 + .../functional/gles3/negativevertexarrayapi.html | 30 + .../deqp/functional/gles3/occlusionquery.html | 26 + .../gles3/occlusionquery_conservative.html | 26 + .../functional/gles3/occlusionquery_strict.html | 26 + .../deqp/functional/gles3/pixelbufferobject.html | 24 + .../deqp/functional/gles3/primitiverestart.html | 24 + .../deqp/functional/gles3/primitiverestart/00.html | 31 + .../gles3/primitiverestart/00_test_list.txt | 8 + .../deqp/functional/gles3/primitiverestart/01.html | 31 + .../deqp/functional/gles3/primitiverestart/02.html | 31 + .../deqp/functional/gles3/primitiverestart/03.html | 31 + .../deqp/functional/gles3/primitiverestart/04.html | 31 + .../deqp/functional/gles3/primitiverestart/05.html | 31 + .../deqp/functional/gles3/primitiverestart/06.html | 31 + .../deqp/functional/gles3/primitiverestart/07.html | 31 + .../primitiverestart_test_generator.py | 101 + .../deqp/functional/gles3/rasterizerdiscard.html | 24 + .../deqp/functional/gles3/rbostatequery.html | 24 + .../checkout/deqp/functional/gles3/readpixel.html | 26 + .../deqp/functional/gles3/samplerobject.html | 24 + .../deqp/functional/gles3/samplerstatequery.html | 24 + .../checkout/deqp/functional/gles3/shaderapi.html | 24 + .../deqp/functional/gles3/shaderbuiltinvar.html | 24 + .../functional/gles3/shadercommonfunction.html | 24 + .../deqp/functional/gles3/shaderderivate.html | 24 + .../deqp/functional/gles3/shaderderivate_dfdx.html | 24 + .../deqp/functional/gles3/shaderderivate_dfdy.html | 24 + .../functional/gles3/shaderderivate_fwidth.html | 24 + .../gles3/shaderindexing/00_test_list.txt | 9 + .../functional/gles3/shaderindexing/mat_00.html | 31 + .../functional/gles3/shaderindexing/mat_01.html | 31 + .../functional/gles3/shaderindexing/mat_02.html | 31 + .../shaderindexing_test_generator.py | 114 + .../deqp/functional/gles3/shaderindexing/tmp.html | 31 + .../functional/gles3/shaderindexing/uniform.html | 31 + .../functional/gles3/shaderindexing/varying.html | 31 + .../deqp/functional/gles3/shaderindexing/vec2.html | 31 + .../deqp/functional/gles3/shaderindexing/vec3.html | 31 + .../deqp/functional/gles3/shaderindexing/vec4.html | 31 + .../deqp/functional/gles3/shaderloop_do_while.html | 24 + .../deqp/functional/gles3/shaderloop_for.html | 24 + .../deqp/functional/gles3/shaderloop_while.html | 24 + .../functional/gles3/shadermatrix/00_test_list.txt | 33 + .../functional/gles3/shadermatrix/add_assign.html | 31 + .../functional/gles3/shadermatrix/add_const.html | 31 + .../functional/gles3/shadermatrix/add_dynamic.html | 31 + .../functional/gles3/shadermatrix/add_uniform.html | 31 + .../functional/gles3/shadermatrix/determinant.html | 31 + .../functional/gles3/shadermatrix/div_assign.html | 31 + .../functional/gles3/shadermatrix/div_const.html | 31 + .../functional/gles3/shadermatrix/div_dynamic.html | 31 + .../functional/gles3/shadermatrix/div_uniform.html | 31 + .../functional/gles3/shadermatrix/inverse.html | 31 + .../gles3/shadermatrix/matrixcompmult.html | 31 + .../functional/gles3/shadermatrix/mul_assign.html | 31 + .../gles3/shadermatrix/mul_const_highp.html | 31 + .../gles3/shadermatrix/mul_const_lowp.html | 31 + .../gles3/shadermatrix/mul_const_mediump.html | 31 + .../gles3/shadermatrix/mul_dynamic_highp.html | 31 + .../gles3/shadermatrix/mul_dynamic_lowp.html | 31 + .../gles3/shadermatrix/mul_dynamic_mediump.html | 31 + .../gles3/shadermatrix/mul_uniform_highp.html | 31 + .../gles3/shadermatrix/mul_uniform_lowp.html | 31 + .../gles3/shadermatrix/mul_uniform_mediump.html | 31 + .../functional/gles3/shadermatrix/negation.html | 31 + .../gles3/shadermatrix/outerproduct.html | 31 + .../gles3/shadermatrix/post_decrement.html | 31 + .../gles3/shadermatrix/post_increment.html | 31 + .../gles3/shadermatrix/pre_decrement.html | 31 + .../gles3/shadermatrix/pre_increment.html | 31 + .../shadermatrix/shadermatrix_test_generator.py | 138 + .../functional/gles3/shadermatrix/sub_assign.html | 31 + .../functional/gles3/shadermatrix/sub_const.html | 31 + .../functional/gles3/shadermatrix/sub_dynamic.html | 31 + .../functional/gles3/shadermatrix/sub_uniform.html | 31 + .../functional/gles3/shadermatrix/transpose.html | 31 + .../gles3/shadermatrix/unary_addition.html | 31 + .../gles3/shaderoperator/00_test_list.txt | 31 + .../shaderoperator/angle_and_trigonometry.html | 33 + .../shaderoperator/angle_and_trigonometry_00.html | 33 + .../shaderoperator/angle_and_trigonometry_01.html | 33 + .../shaderoperator/angle_and_trigonometry_02.html | 33 + .../shaderoperator/angle_and_trigonometry_03.html | 33 + .../gles3/shaderoperator/binary_operator.html | 33 + .../gles3/shaderoperator/binary_operator_00.html | 33 + .../gles3/shaderoperator/binary_operator_01.html | 33 + .../gles3/shaderoperator/binary_operator_02.html | 33 + .../gles3/shaderoperator/binary_operator_03.html | 33 + .../gles3/shaderoperator/binary_operator_04.html | 33 + .../gles3/shaderoperator/binary_operator_05.html | 33 + .../gles3/shaderoperator/binary_operator_06.html | 33 + .../gles3/shaderoperator/binary_operator_07.html | 33 + .../gles3/shaderoperator/binary_operator_08.html | 33 + .../gles3/shaderoperator/binary_operator_09.html | 33 + .../gles3/shaderoperator/binary_operator_10.html | 33 + .../gles3/shaderoperator/binary_operator_11.html | 33 + .../gles3/shaderoperator/binary_operator_12.html | 33 + .../gles3/shaderoperator/binary_operator_13.html | 33 + .../gles3/shaderoperator/binary_operator_14.html | 33 + .../gles3/shaderoperator/binary_operator_15.html | 33 + .../gles3/shaderoperator/bool_compare.html | 33 + .../gles3/shaderoperator/common_fucntions.html | 33 + .../gles3/shaderoperator/common_functions.html | 33 + .../gles3/shaderoperator/exponential.html | 33 + .../gles3/shaderoperator/float_compare.html | 33 + .../functional/gles3/shaderoperator/geometric.html | 33 + .../gles3/shaderoperator/int_compare.html | 33 + .../functional/gles3/shaderoperator/selection.html | 33 + .../functional/gles3/shaderoperator/sequence.html | 33 + .../shaderoperator_test_generator.py | 138 + .../gles3/shaderoperator/unary_operator.html | 33 + .../gles3/shaderoperator/unary_operator_00.html | 33 + .../gles3/shaderoperator/unary_operator_01.html | 33 + .../gles3/shaderoperator/unary_operator_02.html | 33 + .../functional/gles3/shaderpackingfunction.html | 26 + .../functional/gles3/shaderprecision_float.html | 24 + .../deqp/functional/gles3/shaderprecision_int.html | 24 + .../functional/gles3/shaderprecision_uint.html | 24 + .../deqp/functional/gles3/shaderstatequery.html | 31 + .../deqp/functional/gles3/shaderstruct.html | 24 + .../deqp/functional/gles3/shaderswitch.html | 24 + .../gles3/shadertexturefunction/00_test_list.txt | 15 + .../shadertexturefunction_test_generator.py | 120 + .../gles3/shadertexturefunction/texelfetch.html | 31 + .../shadertexturefunction/texelfetchoffset.html | 31 + .../gles3/shadertexturefunction/texture.html | 31 + .../gles3/shadertexturefunction/texturegrad.html | 31 + .../shadertexturefunction/texturegradoffset.html | 31 + .../gles3/shadertexturefunction/texturelod.html | 31 + .../shadertexturefunction/texturelodoffset.html | 31 + .../gles3/shadertexturefunction/textureoffset.html | 31 + .../gles3/shadertexturefunction/textureproj.html | 31 + .../shadertexturefunction/textureprojgrad.html | 31 + .../textureprojgradoffset.html | 31 + .../shadertexturefunction/textureprojlod.html | 31 + .../textureprojlodoffset.html | 31 + .../shadertexturefunction/textureprojoffset.html | 31 + .../gles3/shadertexturefunction/texturesize.html | 31 + .../deqp/functional/gles3/stringquery.html | 24 + .../checkout/deqp/functional/gles3/sync.html | 32 + .../gles3/texturefiltering/00_test_list.txt | 116 + .../texturefiltering/2d_array_combinations_00.html | 31 + .../texturefiltering/2d_array_combinations_01.html | 31 + .../texturefiltering/2d_array_combinations_02.html | 31 + .../texturefiltering/2d_array_combinations_03.html | 31 + .../texturefiltering/2d_array_combinations_04.html | 31 + .../texturefiltering/2d_array_combinations_05.html | 31 + .../texturefiltering/2d_array_formats_00.html | 31 + .../texturefiltering/2d_array_formats_01.html | 31 + .../texturefiltering/2d_array_formats_02.html | 31 + .../texturefiltering/2d_array_formats_03.html | 31 + .../texturefiltering/2d_array_formats_04.html | 31 + .../texturefiltering/2d_array_formats_05.html | 31 + .../texturefiltering/2d_array_formats_06.html | 31 + .../texturefiltering/2d_array_formats_07.html | 31 + .../texturefiltering/2d_array_formats_08.html | 31 + .../texturefiltering/2d_array_formats_09.html | 31 + .../gles3/texturefiltering/2d_array_sizes_00.html | 31 + .../gles3/texturefiltering/2d_array_sizes_01.html | 31 + .../gles3/texturefiltering/2d_array_sizes_02.html | 31 + .../gles3/texturefiltering/2d_array_sizes_03.html | 31 + .../gles3/texturefiltering/2d_array_sizes_04.html | 31 + .../gles3/texturefiltering/2d_combinations_00.html | 31 + .../gles3/texturefiltering/2d_combinations_01.html | 31 + .../gles3/texturefiltering/2d_combinations_02.html | 31 + .../gles3/texturefiltering/2d_combinations_03.html | 31 + .../gles3/texturefiltering/2d_combinations_04.html | 31 + .../gles3/texturefiltering/2d_combinations_05.html | 31 + .../gles3/texturefiltering/2d_formats_00.html | 31 + .../gles3/texturefiltering/2d_formats_01.html | 31 + .../gles3/texturefiltering/2d_formats_02.html | 31 + .../gles3/texturefiltering/2d_formats_03.html | 31 + .../gles3/texturefiltering/2d_formats_04.html | 31 + .../gles3/texturefiltering/2d_formats_05.html | 31 + .../gles3/texturefiltering/2d_formats_06.html | 31 + .../gles3/texturefiltering/2d_formats_07.html | 31 + .../gles3/texturefiltering/2d_formats_08.html | 31 + .../gles3/texturefiltering/2d_formats_09.html | 31 + .../gles3/texturefiltering/2d_sizes_00.html | 31 + .../gles3/texturefiltering/2d_sizes_01.html | 31 + .../gles3/texturefiltering/2d_sizes_02.html | 31 + .../gles3/texturefiltering/2d_sizes_03.html | 31 + .../gles3/texturefiltering/2d_sizes_04.html | 31 + .../gles3/texturefiltering/2d_sizes_05.html | 31 + .../gles3/texturefiltering/3d_combinations_00.html | 31 + .../gles3/texturefiltering/3d_combinations_01.html | 31 + .../gles3/texturefiltering/3d_combinations_02.html | 31 + .../gles3/texturefiltering/3d_combinations_03.html | 31 + .../gles3/texturefiltering/3d_combinations_04.html | 31 + .../gles3/texturefiltering/3d_combinations_05.html | 31 + .../gles3/texturefiltering/3d_combinations_06.html | 31 + .../gles3/texturefiltering/3d_combinations_07.html | 31 + .../gles3/texturefiltering/3d_combinations_08.html | 31 + .../gles3/texturefiltering/3d_combinations_09.html | 31 + .../gles3/texturefiltering/3d_combinations_10.html | 31 + .../gles3/texturefiltering/3d_combinations_11.html | 31 + .../gles3/texturefiltering/3d_combinations_12.html | 31 + .../gles3/texturefiltering/3d_combinations_13.html | 31 + .../gles3/texturefiltering/3d_combinations_14.html | 31 + .../gles3/texturefiltering/3d_combinations_15.html | 31 + .../gles3/texturefiltering/3d_combinations_16.html | 31 + .../gles3/texturefiltering/3d_combinations_17.html | 31 + .../gles3/texturefiltering/3d_combinations_18.html | 31 + .../gles3/texturefiltering/3d_combinations_19.html | 31 + .../gles3/texturefiltering/3d_combinations_20.html | 31 + .../gles3/texturefiltering/3d_combinations_21.html | 31 + .../gles3/texturefiltering/3d_combinations_22.html | 31 + .../gles3/texturefiltering/3d_combinations_23.html | 31 + .../gles3/texturefiltering/3d_combinations_24.html | 31 + .../gles3/texturefiltering/3d_combinations_25.html | 31 + .../gles3/texturefiltering/3d_combinations_26.html | 31 + .../gles3/texturefiltering/3d_combinations_27.html | 31 + .../gles3/texturefiltering/3d_combinations_28.html | 31 + .../gles3/texturefiltering/3d_combinations_29.html | 31 + .../gles3/texturefiltering/3d_combinations_30.html | 31 + .../gles3/texturefiltering/3d_combinations_31.html | 31 + .../gles3/texturefiltering/3d_combinations_32.html | 31 + .../gles3/texturefiltering/3d_combinations_33.html | 31 + .../gles3/texturefiltering/3d_combinations_34.html | 31 + .../gles3/texturefiltering/3d_combinations_35.html | 31 + .../gles3/texturefiltering/3d_formats_00.html | 31 + .../gles3/texturefiltering/3d_formats_01.html | 31 + .../gles3/texturefiltering/3d_formats_02.html | 31 + .../gles3/texturefiltering/3d_formats_03.html | 31 + .../gles3/texturefiltering/3d_formats_04.html | 31 + .../gles3/texturefiltering/3d_formats_05.html | 31 + .../gles3/texturefiltering/3d_formats_06.html | 31 + .../gles3/texturefiltering/3d_formats_07.html | 31 + .../gles3/texturefiltering/3d_formats_08.html | 31 + .../gles3/texturefiltering/3d_formats_09.html | 31 + .../gles3/texturefiltering/3d_sizes_00.html | 31 + .../gles3/texturefiltering/3d_sizes_01.html | 31 + .../gles3/texturefiltering/3d_sizes_02.html | 31 + .../gles3/texturefiltering/3d_sizes_03.html | 31 + .../gles3/texturefiltering/3d_sizes_04.html | 31 + .../texturefiltering/cube_combinations_00.html | 31 + .../texturefiltering/cube_combinations_01.html | 31 + .../texturefiltering/cube_combinations_02.html | 31 + .../texturefiltering/cube_combinations_03.html | 31 + .../texturefiltering/cube_combinations_04.html | 31 + .../texturefiltering/cube_combinations_05.html | 31 + .../gles3/texturefiltering/cube_formats_00.html | 31 + .../gles3/texturefiltering/cube_formats_01.html | 31 + .../gles3/texturefiltering/cube_formats_02.html | 31 + .../gles3/texturefiltering/cube_formats_03.html | 31 + .../gles3/texturefiltering/cube_formats_04.html | 31 + .../gles3/texturefiltering/cube_formats_05.html | 31 + .../gles3/texturefiltering/cube_formats_06.html | 31 + .../gles3/texturefiltering/cube_formats_07.html | 31 + .../gles3/texturefiltering/cube_formats_08.html | 31 + .../gles3/texturefiltering/cube_formats_09.html | 31 + .../texturefiltering/cube_no_edges_visible.html | 31 + .../gles3/texturefiltering/cube_sizes_00.html | 31 + .../gles3/texturefiltering/cube_sizes_01.html | 31 + .../gles3/texturefiltering/cube_sizes_02.html | 31 + .../gles3/texturefiltering/cube_sizes_03.html | 31 + .../gles3/texturefiltering/cube_sizes_04.html | 31 + .../texturefiltering_test_generator.py | 155 + .../gles3/textureformat/00_test_list.txt | 38 + .../gles3/textureformat/compressed_2d.html | 31 + .../gles3/textureformat/compressed_cube.html | 31 + .../sized_color_2d_array_npot_00.html | 31 + .../sized_color_2d_array_npot_01.html | 31 + .../sized_color_2d_array_npot_02.html | 31 + .../sized_color_2d_array_npot_03.html | 31 + .../textureformat/sized_color_2d_array_pot_00.html | 31 + .../textureformat/sized_color_2d_array_pot_01.html | 31 + .../textureformat/sized_color_2d_array_pot_02.html | 31 + .../textureformat/sized_color_2d_array_pot_03.html | 31 + .../textureformat/sized_color_2d_npot_00.html | 31 + .../textureformat/sized_color_2d_npot_01.html | 31 + .../textureformat/sized_color_2d_npot_02.html | 31 + .../textureformat/sized_color_2d_npot_03.html | 31 + .../gles3/textureformat/sized_color_2d_pot_00.html | 31 + .../gles3/textureformat/sized_color_2d_pot_01.html | 31 + .../gles3/textureformat/sized_color_2d_pot_02.html | 31 + .../gles3/textureformat/sized_color_2d_pot_03.html | 31 + .../textureformat/sized_color_3d_npot_00.html | 31 + .../textureformat/sized_color_3d_npot_01.html | 31 + .../textureformat/sized_color_3d_npot_02.html | 31 + .../textureformat/sized_color_3d_npot_03.html | 31 + .../gles3/textureformat/sized_color_3d_pot_00.html | 31 + .../gles3/textureformat/sized_color_3d_pot_01.html | 31 + .../gles3/textureformat/sized_color_3d_pot_02.html | 31 + .../gles3/textureformat/sized_color_3d_pot_03.html | 31 + .../textureformat/sized_color_cube_npot_00.html | 31 + .../textureformat/sized_color_cube_npot_01.html | 31 + .../textureformat/sized_color_cube_npot_02.html | 31 + .../textureformat/sized_color_cube_npot_03.html | 31 + .../textureformat/sized_color_cube_pot_00.html | 31 + .../textureformat/sized_color_cube_pot_01.html | 31 + .../textureformat/sized_color_cube_pot_02.html | 31 + .../textureformat/sized_color_cube_pot_03.html | 31 + .../gles3/textureformat/sized_depth_stencil.html | 31 + .../textureformat/textureformat_test_generator.py | 143 + .../functional/gles3/textureformat/unsized_2d.html | 31 + .../gles3/textureformat/unsized_2d_array.html | 31 + .../functional/gles3/textureformat/unsized_3d.html | 31 + .../gles3/textureshadow/00_test_list.txt | 144 + .../textureshadow/2d_array_linear_always.html | 31 + .../gles3/textureshadow/2d_array_linear_equal.html | 31 + .../textureshadow/2d_array_linear_greater.html | 31 + .../2d_array_linear_greater_or_equal.html | 31 + .../gles3/textureshadow/2d_array_linear_less.html | 31 + .../2d_array_linear_less_or_equal.html | 31 + .../2d_array_linear_mipmap_linear_always.html | 31 + .../2d_array_linear_mipmap_linear_equal.html | 31 + .../2d_array_linear_mipmap_linear_greater.html | 31 + ...rray_linear_mipmap_linear_greater_or_equal.html | 31 + .../2d_array_linear_mipmap_linear_less.html | 31 + ...d_array_linear_mipmap_linear_less_or_equal.html | 31 + .../2d_array_linear_mipmap_linear_never.html | 31 + .../2d_array_linear_mipmap_linear_not_equal.html | 31 + .../2d_array_linear_mipmap_nearest_always.html | 31 + .../2d_array_linear_mipmap_nearest_equal.html | 31 + .../2d_array_linear_mipmap_nearest_greater.html | 31 + ...ray_linear_mipmap_nearest_greater_or_equal.html | 31 + .../2d_array_linear_mipmap_nearest_less.html | 31 + ..._array_linear_mipmap_nearest_less_or_equal.html | 31 + .../2d_array_linear_mipmap_nearest_never.html | 31 + .../2d_array_linear_mipmap_nearest_not_equal.html | 31 + .../gles3/textureshadow/2d_array_linear_never.html | 31 + .../textureshadow/2d_array_linear_not_equal.html | 31 + .../textureshadow/2d_array_nearest_always.html | 31 + .../textureshadow/2d_array_nearest_equal.html | 31 + .../textureshadow/2d_array_nearest_greater.html | 31 + .../2d_array_nearest_greater_or_equal.html | 31 + .../gles3/textureshadow/2d_array_nearest_less.html | 31 + .../2d_array_nearest_less_or_equal.html | 31 + .../2d_array_nearest_mipmap_linear_always.html | 31 + .../2d_array_nearest_mipmap_linear_equal.html | 31 + .../2d_array_nearest_mipmap_linear_greater.html | 31 + ...ray_nearest_mipmap_linear_greater_or_equal.html | 31 + .../2d_array_nearest_mipmap_linear_less.html | 31 + ..._array_nearest_mipmap_linear_less_or_equal.html | 31 + .../2d_array_nearest_mipmap_linear_never.html | 31 + .../2d_array_nearest_mipmap_linear_not_equal.html | 31 + .../2d_array_nearest_mipmap_nearest_always.html | 31 + .../2d_array_nearest_mipmap_nearest_equal.html | 31 + .../2d_array_nearest_mipmap_nearest_greater.html | 31 + ...ay_nearest_mipmap_nearest_greater_or_equal.html | 31 + .../2d_array_nearest_mipmap_nearest_less.html | 31 + ...array_nearest_mipmap_nearest_less_or_equal.html | 31 + .../2d_array_nearest_mipmap_nearest_never.html | 31 + .../2d_array_nearest_mipmap_nearest_not_equal.html | 31 + .../textureshadow/2d_array_nearest_never.html | 31 + .../textureshadow/2d_array_nearest_not_equal.html | 31 + .../gles3/textureshadow/2d_linear_always.html | 31 + .../gles3/textureshadow/2d_linear_equal.html | 31 + .../gles3/textureshadow/2d_linear_greater.html | 31 + .../textureshadow/2d_linear_greater_or_equal.html | 31 + .../gles3/textureshadow/2d_linear_less.html | 31 + .../textureshadow/2d_linear_less_or_equal.html | 31 + .../2d_linear_mipmap_linear_always.html | 31 + .../2d_linear_mipmap_linear_equal.html | 31 + .../2d_linear_mipmap_linear_greater.html | 31 + .../2d_linear_mipmap_linear_greater_or_equal.html | 31 + .../2d_linear_mipmap_linear_less.html | 31 + .../2d_linear_mipmap_linear_less_or_equal.html | 31 + .../2d_linear_mipmap_linear_never.html | 31 + .../2d_linear_mipmap_linear_not_equal.html | 31 + .../2d_linear_mipmap_nearest_always.html | 31 + .../2d_linear_mipmap_nearest_equal.html | 31 + .../2d_linear_mipmap_nearest_greater.html | 31 + .../2d_linear_mipmap_nearest_greater_or_equal.html | 31 + .../2d_linear_mipmap_nearest_less.html | 31 + .../2d_linear_mipmap_nearest_less_or_equal.html | 31 + .../2d_linear_mipmap_nearest_never.html | 31 + .../2d_linear_mipmap_nearest_not_equal.html | 31 + .../gles3/textureshadow/2d_linear_never.html | 31 + .../gles3/textureshadow/2d_linear_not_equal.html | 31 + .../gles3/textureshadow/2d_nearest_always.html | 31 + .../gles3/textureshadow/2d_nearest_equal.html | 31 + .../gles3/textureshadow/2d_nearest_greater.html | 31 + .../textureshadow/2d_nearest_greater_or_equal.html | 31 + .../gles3/textureshadow/2d_nearest_less.html | 31 + .../textureshadow/2d_nearest_less_or_equal.html | 31 + .../2d_nearest_mipmap_linear_always.html | 31 + .../2d_nearest_mipmap_linear_equal.html | 31 + .../2d_nearest_mipmap_linear_greater.html | 31 + .../2d_nearest_mipmap_linear_greater_or_equal.html | 31 + .../2d_nearest_mipmap_linear_less.html | 31 + .../2d_nearest_mipmap_linear_less_or_equal.html | 31 + .../2d_nearest_mipmap_linear_never.html | 31 + .../2d_nearest_mipmap_linear_not_equal.html | 31 + .../2d_nearest_mipmap_nearest_always.html | 31 + .../2d_nearest_mipmap_nearest_equal.html | 31 + .../2d_nearest_mipmap_nearest_greater.html | 31 + ...2d_nearest_mipmap_nearest_greater_or_equal.html | 31 + .../2d_nearest_mipmap_nearest_less.html | 31 + .../2d_nearest_mipmap_nearest_less_or_equal.html | 31 + .../2d_nearest_mipmap_nearest_never.html | 31 + .../2d_nearest_mipmap_nearest_not_equal.html | 31 + .../gles3/textureshadow/2d_nearest_never.html | 31 + .../gles3/textureshadow/2d_nearest_not_equal.html | 31 + .../gles3/textureshadow/cube_linear_always.html | 31 + .../gles3/textureshadow/cube_linear_equal.html | 31 + .../gles3/textureshadow/cube_linear_greater.html | 31 + .../cube_linear_greater_or_equal.html | 31 + .../gles3/textureshadow/cube_linear_less.html | 31 + .../textureshadow/cube_linear_less_or_equal.html | 31 + .../cube_linear_mipmap_linear_always.html | 31 + .../cube_linear_mipmap_linear_equal.html | 31 + .../cube_linear_mipmap_linear_greater.html | 31 + ...cube_linear_mipmap_linear_greater_or_equal.html | 31 + .../cube_linear_mipmap_linear_less.html | 31 + .../cube_linear_mipmap_linear_less_or_equal.html | 31 + .../cube_linear_mipmap_linear_never.html | 31 + .../cube_linear_mipmap_linear_not_equal.html | 31 + .../cube_linear_mipmap_nearest_always.html | 31 + .../cube_linear_mipmap_nearest_equal.html | 31 + .../cube_linear_mipmap_nearest_greater.html | 31 + ...ube_linear_mipmap_nearest_greater_or_equal.html | 31 + .../cube_linear_mipmap_nearest_less.html | 31 + .../cube_linear_mipmap_nearest_less_or_equal.html | 31 + .../cube_linear_mipmap_nearest_never.html | 31 + .../cube_linear_mipmap_nearest_not_equal.html | 31 + .../gles3/textureshadow/cube_linear_never.html | 31 + .../gles3/textureshadow/cube_linear_not_equal.html | 31 + .../gles3/textureshadow/cube_nearest_always.html | 31 + .../gles3/textureshadow/cube_nearest_equal.html | 31 + .../gles3/textureshadow/cube_nearest_greater.html | 31 + .../cube_nearest_greater_or_equal.html | 31 + .../gles3/textureshadow/cube_nearest_less.html | 31 + .../textureshadow/cube_nearest_less_or_equal.html | 31 + .../cube_nearest_mipmap_linear_always.html | 31 + .../cube_nearest_mipmap_linear_equal.html | 31 + .../cube_nearest_mipmap_linear_greater.html | 31 + ...ube_nearest_mipmap_linear_greater_or_equal.html | 31 + .../cube_nearest_mipmap_linear_less.html | 31 + .../cube_nearest_mipmap_linear_less_or_equal.html | 31 + .../cube_nearest_mipmap_linear_never.html | 31 + .../cube_nearest_mipmap_linear_not_equal.html | 31 + .../cube_nearest_mipmap_nearest_always.html | 31 + .../cube_nearest_mipmap_nearest_equal.html | 31 + .../cube_nearest_mipmap_nearest_greater.html | 31 + ...be_nearest_mipmap_nearest_greater_or_equal.html | 31 + .../cube_nearest_mipmap_nearest_less.html | 31 + .../cube_nearest_mipmap_nearest_less_or_equal.html | 31 + .../cube_nearest_mipmap_nearest_never.html | 31 + .../cube_nearest_mipmap_nearest_not_equal.html | 31 + .../gles3/textureshadow/cube_nearest_never.html | 31 + .../textureshadow/cube_nearest_not_equal.html | 31 + .../textureshadow/textureshadow_test_generator.py | 133 + .../gles3/texturespecification/00_test_list.txt | 90 + .../texturespecification/basic_copyteximage2d.html | 31 + .../basic_copytexsubimage2d.html | 31 + .../basic_teximage2d_2d_00.html | 31 + .../basic_teximage2d_2d_01.html | 31 + .../basic_teximage2d_cube_00.html | 31 + .../basic_teximage2d_cube_01.html | 31 + .../basic_teximage2d_cube_02.html | 31 + .../basic_teximage2d_cube_03.html | 31 + .../basic_teximage2d_cube_04.html | 31 + .../basic_teximage3d_2d_array_00.html | 31 + .../basic_teximage3d_2d_array_01.html | 31 + .../basic_teximage3d_2d_array_02.html | 31 + .../basic_teximage3d_3d_00.html | 31 + .../basic_teximage3d_3d_01.html | 31 + .../basic_teximage3d_3d_02.html | 31 + .../basic_teximage3d_3d_03.html | 31 + .../basic_teximage3d_3d_04.html | 31 + .../basic_texsubimage2d_2d_00.html | 31 + .../basic_texsubimage2d_2d_01.html | 31 + .../basic_texsubimage2d_2d_02.html | 31 + .../basic_texsubimage2d_cube_00.html | 31 + .../basic_texsubimage2d_cube_01.html | 31 + .../basic_texsubimage2d_cube_02.html | 31 + .../basic_texsubimage2d_cube_03.html | 31 + .../basic_texsubimage2d_cube_04.html | 31 + .../basic_texsubimage3d_00.html | 31 + .../basic_texsubimage3d_01.html | 31 + .../basic_texsubimage3d_02.html | 31 + .../basic_texsubimage3d_03.html | 31 + .../basic_texsubimage3d_04.html | 31 + .../texturespecification/random_teximage2d_2d.html | 31 + .../random_teximage2d_cube.html | 31 + .../texturespecification/teximage2d_align.html | 31 + .../texturespecification/teximage2d_depth.html | 31 + .../texturespecification/teximage2d_depth_pbo.html | 31 + .../texturespecification/teximage2d_pbo_2d_00.html | 31 + .../texturespecification/teximage2d_pbo_2d_01.html | 31 + .../teximage2d_pbo_cube_00.html | 31 + .../teximage2d_pbo_cube_01.html | 31 + .../teximage2d_pbo_cube_02.html | 31 + .../teximage2d_pbo_cube_03.html | 31 + .../teximage2d_pbo_cube_04.html | 31 + .../teximage2d_pbo_params.html | 31 + .../teximage2d_unpack_params.html | 31 + .../texturespecification/teximage3d_depth.html | 31 + .../texturespecification/teximage3d_depth_pbo.html | 31 + .../teximage3d_pbo_2d_array_00.html | 31 + .../teximage3d_pbo_2d_array_01.html | 31 + .../texturespecification/teximage3d_pbo_3d_00.html | 31 + .../texturespecification/teximage3d_pbo_3d_01.html | 31 + .../teximage3d_pbo_params.html | 31 + .../teximage3d_unpack_params.html | 31 + .../texstorage2d_format_2d_00.html | 31 + .../texstorage2d_format_2d_01.html | 31 + .../texstorage2d_format_2d_02.html | 31 + .../texstorage2d_format_cube_00.html | 31 + .../texstorage2d_format_cube_01.html | 31 + .../texstorage2d_format_cube_02.html | 31 + .../texstorage2d_format_cube_03.html | 31 + .../texstorage2d_format_cube_04.html | 31 + .../texstorage2d_format_depth_stencil.html | 31 + .../texstorage2d_format_size.html | 31 + .../texstorage3d_format_2d_array_00.html | 31 + .../texstorage3d_format_2d_array_01.html | 31 + .../texstorage3d_format_2d_array_02.html | 31 + .../texstorage3d_format_3d_00.html | 31 + .../texstorage3d_format_3d_01.html | 31 + .../texstorage3d_format_3d_02.html | 31 + .../texstorage3d_format_3d_03.html | 31 + .../texstorage3d_format_depth_stencil.html | 31 + .../texstorage3d_format_size.html | 31 + .../texturespecification/texsubimage2d_align.html | 31 + .../texturespecification/texsubimage2d_depth.html | 31 + .../texsubimage2d_empty_tex.html | 31 + .../texsubimage2d_pbo_2d_00.html | 31 + .../texsubimage2d_pbo_2d_01.html | 31 + .../texsubimage2d_pbo_cube_00.html | 31 + .../texsubimage2d_pbo_cube_01.html | 31 + .../texsubimage2d_pbo_cube_02.html | 31 + .../texsubimage2d_pbo_cube_03.html | 31 + .../texsubimage2d_pbo_cube_04.html | 31 + .../texsubimage2d_pbo_params.html | 31 + .../texsubimage2d_unpack_params.html | 31 + .../texturespecification/texsubimage3d_depth.html | 31 + .../texsubimage3d_pbo_2d_array_00.html | 31 + .../texsubimage3d_pbo_2d_array_01.html | 31 + .../texsubimage3d_pbo_3d_00.html | 31 + .../texsubimage3d_pbo_3d_01.html | 31 + .../texsubimage3d_pbo_params.html | 31 + .../texsubimage3d_unpack_params.html | 31 + .../texturespecification_test_generator.py | 195 + .../deqp/functional/gles3/texturestatequery.html | 24 + .../deqp/functional/gles3/texturewrap.html | 24 + .../functional/gles3/texturewrap/00_test_list.txt | 22 + .../functional/gles3/texturewrap/eac_r11_npot.html | 31 + .../functional/gles3/texturewrap/eac_r11_pot.html | 31 + .../gles3/texturewrap/eac_rg11_npot.html | 31 + .../functional/gles3/texturewrap/eac_rg11_pot.html | 31 + .../gles3/texturewrap/eac_signed_r11_npot.html | 31 + .../gles3/texturewrap/eac_signed_r11_pot.html | 31 + .../gles3/texturewrap/eac_signed_rg11_npot.html | 31 + .../gles3/texturewrap/eac_signed_rg11_pot.html | 31 + .../gles3/texturewrap/etc2_eac_rgba8_npot.html | 31 + .../gles3/texturewrap/etc2_eac_rgba8_pot.html | 31 + .../texturewrap/etc2_eac_srgb8_alpha8_npot.html | 31 + .../texturewrap/etc2_eac_srgb8_alpha8_pot.html | 31 + .../gles3/texturewrap/etc2_rgb8_npot.html | 31 + .../gles3/texturewrap/etc2_rgb8_pot.html | 31 + .../etc2_rgb8_punchthrough_alpha1_npot.html | 31 + .../etc2_rgb8_punchthrough_alpha1_pot.html | 31 + .../gles3/texturewrap/etc2_srgb8_npot.html | 31 + .../gles3/texturewrap/etc2_srgb8_pot.html | 31 + .../etc2_srgb8_punchthrough_alpha1_npot.html | 31 + .../etc2_srgb8_punchthrough_alpha1_pot.html | 31 + .../functional/gles3/texturewrap/rgba8_npot.html | 31 + .../functional/gles3/texturewrap/rgba8_pot.html | 31 + .../texturewrap/texturewrap_test_generator.py | 127 + .../gles3/transformfeedback/00_test_list.txt | 29 + .../array_element_interleaved_lines.html | 31 + .../array_element_interleaved_points.html | 31 + .../array_element_interleaved_triangles.html | 31 + .../array_element_separate_lines.html | 31 + .../array_element_separate_points.html | 31 + .../array_element_separate_triangles.html | 31 + .../transformfeedback/array_interleaved_lines.html | 31 + .../array_interleaved_points.html | 31 + .../array_interleaved_triangles.html | 31 + .../transformfeedback/array_separate_lines.html | 31 + .../transformfeedback/array_separate_points.html | 31 + .../array_separate_triangles.html | 31 + .../basic_types_interleaved_lines.html | 31 + .../basic_types_interleaved_points.html | 31 + .../basic_types_interleaved_triangles.html | 31 + .../basic_types_separate_lines.html | 31 + .../basic_types_separate_points.html | 31 + .../basic_types_separate_triangles.html | 31 + .../transformfeedback/interpolation_centroid.html | 31 + .../transformfeedback/interpolation_flat.html | 31 + .../transformfeedback/interpolation_smooth.html | 31 + .../gles3/transformfeedback/point_size.html | 31 + .../gles3/transformfeedback/position.html | 31 + .../random_interleaved_lines.html | 31 + .../random_interleaved_points.html | 31 + .../random_interleaved_triangles.html | 31 + .../transformfeedback/random_separate_lines.html | 31 + .../transformfeedback/random_separate_points.html | 31 + .../random_separate_triangles.html | 31 + .../transformfeedback_test_generator.py | 135 + .../checkout/deqp/functional/gles3/uniformapi.html | 24 + .../functional/gles3/uniformapi/00_test_list.txt | 4 + .../functional/gles3/uniformapi/info_query.html | 31 + .../deqp/functional/gles3/uniformapi/random.html | 31 + .../gles3/uniformapi/uniformapi_test_generator.py | 109 + .../gles3/uniformapi/value_assigned.html | 31 + .../functional/gles3/uniformapi/value_initial.html | 31 + .../gles3/uniformbuffers/00_test_list.txt | 10 + .../uniformbuffers/instance_array_basic_type.html | 31 + .../gles3/uniformbuffers/multi_basic_types.html | 31 + .../gles3/uniformbuffers/multi_nested_struct.html | 31 + .../functional/gles3/uniformbuffers/random.html | 31 + .../gles3/uniformbuffers/single_basic_array.html | 31 + .../gles3/uniformbuffers/single_basic_type.html | 31 + .../gles3/uniformbuffers/single_nested_struct.html | 31 + .../uniformbuffers/single_nested_struct_array.html | 31 + .../gles3/uniformbuffers/single_struct.html | 31 + .../gles3/uniformbuffers/single_struct_array.html | 31 + .../uniformbuffers_test_generator.py | 115 + .../deqp/functional/gles3/vertexarrayobject.html | 24 + .../functional/gles3/vertexarrays/00_test_list.txt | 27 + .../vertexarrays/multiple_attributes.count.html | 31 + .../vertexarrays/multiple_attributes.output.html | 31 + .../vertexarrays/multiple_attributes.storage.html | 31 + .../vertexarrays/multiple_attributes.stride.html | 31 + .../gles3/vertexarrays/single_attribute.first.html | 31 + .../vertexarrays/single_attribute.normalize.html | 31 + .../vertexarrays/single_attribute.offset.html | 31 + .../single_attribute.output_type.byte.html | 31 + .../single_attribute.output_type.float.html | 31 + .../single_attribute.output_type.half.html | 31 + .../single_attribute.output_type.int.html | 31 + ...ingle_attribute.output_type.int_2_10_10_10.html | 31 + .../single_attribute.output_type.short.html | 31 + ...single_attribute.output_type.unsigned_byte.html | 31 + .../single_attribute.output_type.unsigned_int.html | 31 + ...ribute.output_type.unsigned_int_2_10_10_10.html | 31 + ...ingle_attribute.output_type.unsigned_short.html | 31 + .../vertexarrays/single_attribute.stride.html | 31 + .../single_attribute.usage.dynamic_copy.html | 31 + .../single_attribute.usage.dynamic_draw.html | 31 + .../single_attribute.usage.dynamic_read.html | 31 + .../single_attribute.usage.static_copy.html | 31 + .../single_attribute.usage.static_draw.html | 31 + .../single_attribute.usage.static_read.html | 31 + .../single_attribute.usage.stream_copy.html | 31 + .../single_attribute.usage.stream_draw.html | 31 + .../single_attribute.usage.stream_read.html | 31 + .../vertexarrays/vertexarrays_test_generator.py | 127 + .../webgl-conf/checkout/deqp/genHTMLfromTest.py | 43 + .../modules/shared/glsAttributeLocationTests.js | 1477 ++ .../deqp/modules/shared/glsBufferTestUtil.js | 1068 + .../modules/shared/glsBuiltinPrecisionTests.js | 5415 ++++ .../shared/glsBuiltinPrecisionTestsUnitTests.js | 2819 ++ .../checkout/deqp/modules/shared/glsDrawTests.js | 3452 +++ .../deqp/modules/shared/glsFboCompletenessTests.js | 961 + .../checkout/deqp/modules/shared/glsFboUtil.js | 1413 + .../deqp/modules/shared/glsLifetimeTests.js | 1118 + .../modules/shared/glsRandomUniformBlockCase.js | 282 + .../deqp/modules/shared/glsSamplerObjectTest.js | 1148 + .../deqp/modules/shared/glsShaderExecUtil.js | 735 + .../deqp/modules/shared/glsShaderLibrary.js | 1114 + .../deqp/modules/shared/glsShaderLibraryCase.js | 1132 + .../deqp/modules/shared/glsShaderRenderCase.js | 1200 + .../checkout/deqp/modules/shared/glsStateQuery.js | 367 + .../deqp/modules/shared/glsTextureTestUtil.js | 2642 ++ .../deqp/modules/shared/glsUniformBlockCase.js | 2451 ++ .../deqp/modules/shared/glsVertexArrayTests.js | 2534 ++ .../test/webgl-conf/checkout/deqp/run-closure.sh | 26 + .../checkout/deqp/temp_externs/chrome.js | 156 + .../checkout/deqp/temp_externs/deprecated.js | 46 + .../webgl-conf/checkout/deqp/temp_externs/es3.js | 2236 ++ .../webgl-conf/checkout/deqp/temp_externs/es5.js | 269 + .../webgl-conf/checkout/deqp/temp_externs/es6.js | 856 + .../checkout/deqp/temp_externs/es6_collections.js | 253 + .../checkout/deqp/temp_externs/fileapi.js | 961 + .../webgl-conf/checkout/deqp/temp_externs/flash.js | 210 + .../checkout/deqp/temp_externs/gecko_css.js | 126 + .../checkout/deqp/temp_externs/gecko_dom.js | 1120 + .../checkout/deqp/temp_externs/gecko_event.js | 62 + .../checkout/deqp/temp_externs/gecko_xml.js | 73 + .../checkout/deqp/temp_externs/google.js | 30 + .../webgl-conf/checkout/deqp/temp_externs/html5.js | 3241 +++ .../checkout/deqp/temp_externs/ie_css.js | 267 + .../checkout/deqp/temp_externs/ie_dom.js | 1395 + .../checkout/deqp/temp_externs/ie_event.js | 309 + .../checkout/deqp/temp_externs/ie_vml.js | 77 + .../webgl-conf/checkout/deqp/temp_externs/intl.js | 163 + .../checkout/deqp/temp_externs/iphone.js | 362 + .../checkout/deqp/temp_externs/mediasource.js | 142 + .../checkout/deqp/temp_externs/page_visibility.js | 32 + .../webgl-conf/checkout/deqp/temp_externs/v8.js | 125 + .../checkout/deqp/temp_externs/w3c_anim_timing.js | 191 + .../checkout/deqp/temp_externs/w3c_css.js | 2505 ++ .../checkout/deqp/temp_externs/w3c_css3d.js | 199 + .../deqp/temp_externs/w3c_device_sensor_event.js | 101 + .../checkout/deqp/temp_externs/w3c_dom1.js | 874 + .../checkout/deqp/temp_externs/w3c_dom2.js | 2619 ++ .../checkout/deqp/temp_externs/w3c_dom3.js | 854 + .../deqp/temp_externs/w3c_elementtraversal.js | 56 + .../checkout/deqp/temp_externs/w3c_encoding.js | 54 + .../checkout/deqp/temp_externs/w3c_event.js | 372 + .../checkout/deqp/temp_externs/w3c_event3.js | 63 + .../checkout/deqp/temp_externs/w3c_geolocation.js | 101 + .../checkout/deqp/temp_externs/w3c_indexeddb.js | 914 + .../deqp/temp_externs/w3c_navigation_timing.js | 161 + .../checkout/deqp/temp_externs/w3c_range.js | 248 + .../checkout/deqp/temp_externs/w3c_rtc.js | 1002 + .../checkout/deqp/temp_externs/w3c_selectors.js | 94 + .../checkout/deqp/temp_externs/w3c_xml.js | 417 + .../checkout/deqp/temp_externs/webkit_css.js | 456 + .../checkout/deqp/temp_externs/webkit_dom.js | 281 + .../checkout/deqp/temp_externs/webkit_event.js | 48 + .../deqp/temp_externs/webkit_notifications.js | 201 + .../checkout/deqp/temp_externs/webstorage.js | 148 + .../checkout/deqp/temp_externs/window.js | 191 + .../test/webgl-conf/checkout/deqp/test-webgl2.js | 4 + .../test/webgl-conf/checkout/deqp/test-webgl2.sh | 60 + dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js | 5537 ++++ .../extra/50x50pixel-black-with-red-triangle.png | Bin 0 -> 3032 bytes .../checkout/extra/big-fbos-example.html | 277 + .../checkout/extra/buffer-gc-stress.html | 176 + .../webgl-conf/checkout/extra/buffer-sizes.html | 289 + .../checkout/extra/canvas-compositing-test.html | 109 + .../checkout/extra/canvas-compositing-test.png | Bin 0 -> 212531 bytes .../extra/constant-index-out-of-range.html | 240 + .../context-creation-and-destruction-stress.html | 56 + .../extra/cube-map-uploads-out-of-order.html | 112 + .../checkout/extra/fbo-lost-context.html | 223 + .../checkout/extra/lots-of-polys-example.html | 110 + .../extra/lots-of-polys-shader-example.html | 176 + .../extra/multisample-corruption-stress.html | 58 + .../webgl-conf/checkout/extra/offscreen-issue.html | 64 + .../extra/out-of-bounds-uniform-array-access.html | 126 + .../webgl-conf/checkout/extra/out-of-memory.html | 105 + .../checkout/extra/out-of-resources.html | 141 + .../webgl-conf/checkout/extra/out-of-vram.html | 135 + .../checkout/extra/point-no-attributes-stress.html | 82 + .../webgl-conf/checkout/extra/program-test-1.html | 101 + .../checkout/extra/readpixels-after-alert.html | 86 + .../test/webgl-conf/checkout/extra/sample-100.png | Bin 0 -> 960 bytes .../test/webgl-conf/checkout/extra/sample-200.png | Bin 0 -> 2364 bytes .../test/webgl-conf/checkout/extra/sample-400.png | Bin 0 -> 5181 bytes .../test/webgl-conf/checkout/extra/sample.svg | 4 + .../extra/simulated-attrib-0-bug-test.html | 57 + .../checkout/extra/slow-shader-example.html | 133 + .../checkout/extra/tex-image-with-video-test.html | 48 + .../checkout/extra/tex-image-with-video-test.js | 174 + .../extra/texture-allocation-stress-test.html | 68 + .../webgl-conf/checkout/extra/texture-sizing.html | 250 + .../extra/webgl-drawelements-validation.html | 163 + .../test/webgl-conf/checkout/extra/webgl-info.html | 296 + .../checkout/extra/webgl-translate-shader.html | 171 + .../webgl-conf/checkout/js/desktop-gl-constants.js | 2656 ++ .../checkout/js/glsl-conformance-test.js | 393 + .../js/glsl-constructor-tests-generator.js | 936 + .../test/webgl-conf/checkout/js/glsl-generator.js | 1251 + .../test/webgl-conf/checkout/js/js-test-post.js | 29 + .../test/webgl-conf/checkout/js/js-test-pre.js | 744 + dom/canvas/test/webgl-conf/checkout/js/pnglib.js | 207 + .../test/webgl-conf/checkout/js/test-eval.js | 32 + .../checkout/js/tests/clipping-wide-points.js | 109 + .../tests/compound-assignment-type-combination.js | 150 + .../webgl-conf/checkout/js/tests/gl-enum-tests.js | 140 + .../checkout/js/tests/gl-get-tex-parameter.js | 200 + .../checkout/js/tests/gl-object-get-calls.js | 1092 + .../checkout/js/tests/gl-vertex-attrib.js | 280 + .../checkout/js/tests/instanceof-test.js | 122 + .../webgl-conf/checkout/js/tests/iterable-test.js | 173 + .../oes-texture-float-and-half-float-linear.js | 183 + .../checkout/js/tests/out-of-bounds-test.js | 343 + ...e-and-sub-image-2d-with-canvas-sub-rectangle.js | 329 + .../tex-image-and-sub-image-2d-with-canvas.js | 320 + ...and-sub-image-2d-with-image-bitmap-from-blob.js | 63 + ...d-sub-image-2d-with-image-bitmap-from-canvas.js | 89 + ...image-2d-with-image-bitmap-from-image-bitmap.js | 67 + ...b-image-2d-with-image-bitmap-from-image-data.js | 64 + ...nd-sub-image-2d-with-image-bitmap-from-image.js | 61 + ...nd-sub-image-2d-with-image-bitmap-from-video.js | 61 + .../tex-image-and-sub-image-2d-with-image-data.js | 267 + .../tests/tex-image-and-sub-image-2d-with-image.js | 263 + .../tex-image-and-sub-image-2d-with-svg-image.js | 148 + .../tests/tex-image-and-sub-image-2d-with-video.js | 299 + ...tex-image-and-sub-image-2d-with-webgl-canvas.js | 249 + ...e-and-sub-image-3d-with-canvas-sub-rectangle.js | 304 + .../tex-image-and-sub-image-3d-with-canvas.js | 233 + ...and-sub-image-3d-with-image-bitmap-from-blob.js | 63 + ...d-sub-image-3d-with-image-bitmap-from-canvas.js | 89 + ...image-3d-with-image-bitmap-from-image-bitmap.js | 67 + ...b-image-3d-with-image-bitmap-from-image-data.js | 64 + ...nd-sub-image-3d-with-image-bitmap-from-image.js | 60 + ...nd-sub-image-3d-with-image-bitmap-from-video.js | 61 + .../tex-image-and-sub-image-3d-with-image-data.js | 276 + .../tests/tex-image-and-sub-image-3d-with-image.js | 277 + .../tex-image-and-sub-image-3d-with-svg-image.js | 121 + .../tests/tex-image-and-sub-image-3d-with-video.js | 260 + ...tex-image-and-sub-image-3d-with-webgl-canvas.js | 204 + .../js/tests/tex-image-and-sub-image-utils.js | 818 + ...-image-and-sub-image-with-image-bitmap-utils.js | 408 + .../checkout/js/tests/tex-input-validation.js | 580 + .../checkout/js/tests/typed-array-test-cases.js | 90 + .../checkout/js/tests/typed-array-worker.js | 89 + .../webgl-conf/checkout/js/webgl-test-harness.js | 659 + .../webgl-conf/checkout/js/webgl-test-utils.js | 3122 +++ .../test/webgl-conf/checkout/py/lint/LICENSE | 30 + .../test/webgl-conf/checkout/py/lint/README.md | 115 + .../test/webgl-conf/checkout/py/lint/lint.py | 223 + .../webgl-conf/checkout/py/lint/lint.whitelist | 46 + .../checkout/py/tex_image_test_generator.py | 214 + .../webgl-conf/checkout/resources/1-channel.jpg | Bin 0 -> 16799 bytes .../test/webgl-conf/checkout/resources/3x3.png | Bin 0 -> 2806 bytes .../webgl-conf/checkout/resources/blue-1x1.jpg | Bin 0 -> 319 bytes .../checkout/resources/boolUniformShader.vert | 43 + .../checkout/resources/bug-32888-texture.png | Bin 0 -> 10050 bytes .../checkout/resources/floatUniformShader.vert | 43 + .../checkout/resources/fragmentShader.frag | 32 + .../checkout/resources/glsl-feature-tests.css | 29 + .../checkout/resources/glsl-generator.js | 1251 + .../checkout/resources/gray-1024x1024.jpg | Bin 0 -> 10314 bytes .../resources/gray-ramp-256-with-128-alpha.png | Bin 0 -> 81 bytes .../checkout/resources/gray-ramp-256.png | Bin 0 -> 78 bytes .../checkout/resources/gray-ramp-default-gamma.png | Bin 0 -> 123 bytes .../checkout/resources/gray-ramp-gamma0.1.png | Bin 0 -> 133 bytes .../checkout/resources/gray-ramp-gamma1.0.png | Bin 0 -> 133 bytes .../checkout/resources/gray-ramp-gamma2.0.png | Bin 0 -> 133 bytes .../checkout/resources/gray-ramp-gamma4.0.png | Bin 0 -> 133 bytes .../checkout/resources/gray-ramp-gamma9.0.png | Bin 0 -> 133 bytes .../webgl-conf/checkout/resources/gray-ramp.png | Bin 0 -> 123 bytes .../checkout/resources/green-2x2-16bit.png | Bin 0 -> 134 bytes .../checkout/resources/intArrayUniformShader.vert | 8 + .../checkout/resources/intUniformShader.vert | 43 + .../checkout/resources/js-test-style.css | 17 + .../resources/matForWebGL2UniformShader.vert | 42 + .../checkout/resources/matUniformShader.vert | 40 + .../checkout/resources/noopUniformShader.frag | 34 + .../checkout/resources/noopUniformShader.vert | 4 + .../checkout/resources/noopUniformShaderES3.frag | 40 + .../checkout/resources/noopUniformShaderES3.vert | 6 + .../webgl-conf/checkout/resources/npot-video.mp4 | Bin 0 -> 38215 bytes .../checkout/resources/npot-video.theora.ogv | Bin 0 -> 24630 bytes .../checkout/resources/npot-video.webmvp8.webm | Bin 0 -> 51240 bytes .../webgl-conf/checkout/resources/ogles-tests.css | 30 + .../webgl-conf/checkout/resources/opengl_logo.jpg | Bin 0 -> 5827 bytes .../checkout/resources/red-green-blue-cyan-4x4.png | Bin 0 -> 469 bytes .../checkout/resources/red-green-blue-cyan-4x4.psd | Bin 0 -> 20380 bytes .../resources/red-green-semi-transparent.png | Bin 0 -> 101 bytes .../webgl-conf/checkout/resources/red-green.mp4 | Bin 0 -> 92225 bytes .../webgl-conf/checkout/resources/red-green.png | Bin 0 -> 144 bytes .../webgl-conf/checkout/resources/red-green.svg | 6 + .../checkout/resources/red-green.theora.ogv | Bin 0 -> 10292 bytes .../checkout/resources/red-green.webmvp8.webm | Bin 0 -> 10979 bytes .../checkout/resources/red-green.webmvp9.webm | Bin 0 -> 4309 bytes .../webgl-conf/checkout/resources/red-indexed.png | Bin 0 -> 168 bytes .../resources/samplerForWebGL2UniformShader.frag | 34 + .../checkout/resources/samplerUniformShader.frag | 8 + .../small-square-with-cie-rgb-profile.png | Bin 0 -> 868 bytes .../small-square-with-colormatch-profile.png | Bin 0 -> 871 bytes .../small-square-with-colorspin-profile.jpg | Bin 0 -> 9145 bytes .../small-square-with-colorspin-profile.png | Bin 0 -> 841 bytes .../resources/small-square-with-e-srgb-profile.png | Bin 0 -> 1985 bytes .../small-square-with-smpte-c-profile.png | Bin 0 -> 871 bytes ...small-square-with-srgb-iec61966-2.1-profile.png | Bin 0 -> 3201 bytes .../checkout/resources/structUniformShader.vert | 53 + .../checkout/resources/thunderbird-logo-64x64.png | Bin 0 -> 63843 bytes .../resources/transparent-on-left-indexed.png | Bin 0 -> 972 bytes .../checkout/resources/uintUniformShader.vert | 38 + .../checkout/resources/uniformBlockShader.frag | 36 + .../checkout/resources/uniformBlockShader.vert | 43 + .../checkout/resources/vertexShader.vert | 36 + .../webgl-conf/checkout/resources/webgl-logo.png | Bin 0 -> 9077 bytes .../webgl-conf/checkout/resources/zero-alpha.png | Bin 0 -> 89 bytes .../test/webgl-conf/checkout/test-guidelines.md | 181 + .../checkout/webgl-conformance-tests.html | 1268 + .../webgl-conf/generate-wrappers-and-manifest.py | 532 + dom/canvas/test/webgl-conf/generated-mochitest.ini | 8376 ++++++ .../webgl-conf/generated/test_..__always-fail.html | 17 + ...mance2__attribs__gl-vertex-attrib-i-render.html | 17 + ..._2_conformance2__attribs__gl-vertex-attrib.html | 17 + ...__attribs__gl-vertexattribipointer-offsets.html | 17 + ...ormance2__attribs__gl-vertexattribipointer.html | 17 + ...e2__buffers__bound-buffer-size-change-test.html | 17 + ...ormance2__buffers__buffer-copying-contents.html | 17 + ...nce2__buffers__buffer-copying-restrictions.html | 17 + ...buffer-data-and-buffer-sub-data-sub-source.html | 17 + ...onformance2__buffers__buffer-overflow-test.html | 17 + ...rmance2__buffers__buffer-type-restrictions.html | 17 + ...conformance2__buffers__get-buffer-sub-data.html | 17 + ..._2_conformance2__buffers__getBufferSubData.html | 17 + ...rmance2__buffers__one-large-uniform-buffer.html | 17 + ...t_2_conformance2__buffers__uniform-buffers.html | 17 + ...ance2__context__constants-and-properties-2.html | 17 + ...-attributes-depth-stencil-antialias-obeyed.html | 17 + ...conformance2__context__context-type-test-2.html | 17 + .../test_2_conformance2__context__methods-2.html | 17 + ...mance2__extensions__ext-color-buffer-float.html | 17 + ...xtensions__ext-disjoint-timer-query-webgl2.html | 17 + ...extensions__promoted-extensions-in-shaders.html | 17 + ...formance2__extensions__promoted-extensions.html | 17 + ...conformance2__glsl3__array-as-return-value.html | 17 + ...formance2__glsl3__array-assign-constructor.html | 17 + .../test_2_conformance2__glsl3__array-assign.html | 17 + ...onformance2__glsl3__array-complex-indexing.html | 17 + ...nformance2__glsl3__array-element-increment.html | 17 + ...test_2_conformance2__glsl3__array-equality.html | 17 + ...mance2__glsl3__array-in-complex-expression.html | 17 + ...ormance2__glsl3__array-length-side-effects.html | 17 + ...nce2__glsl3__attrib-location-length-limits.html | 17 + ...__glsl3__bool-type-cast-bug-uint-ivec-uvec.html | 17 + ...__glsl3__compare-structs-containing-arrays.html | 17 + ...lsl3__compound-assignment-type-combination.html | 17 + ...st_2_conformance2__glsl3__const-array-init.html | 17 + ...2_conformance2__glsl3__forbidden-operators.html | 17 + .../test_2_conformance2__glsl3__frag-depth.html | 17 + ...ormance2__glsl3__invalid-default-precision.html | 17 + ...t_2_conformance2__glsl3__invalid-invariant.html | 17 + ...nformance2__glsl3__loops-with-side-effects.html | 17 + ...mance2__glsl3__misplaced-version-directive.html | 17 + ...rmance2__glsl3__no-attribute-vertex-shader.html | 17 + ..._conformance2__glsl3__sampler-no-precision.html | 17 + ...l3__sequence-operator-returns-non-constant.html | 17 + ...test_2_conformance2__glsl3__shader-linking.html | 17 + ...__glsl3__shader-with-1024-character-define.html | 17 + ...shader-with-1024-character-identifier.frag.html | 17 + ...__glsl3__shader-with-1025-character-define.html | 17 + ...shader-with-1025-character-identifier.frag.html | 17 + ...ce2__glsl3__shader-with-invalid-characters.html | 17 + ...l3__shader-with-mis-matching-uniform-block.html | 17 + ..._glsl3__short-circuiting-in-loop-condition.html | 17 + ...mance2__glsl3__texture-offset-out-of-range.html | 17 + ..._texture-offset-uniform-texture-coordinate.html | 17 + ...onformance2__glsl3__tricky-loop-conditions.html | 17 + ...lsl3__unary-minus-operator-in-dynamic-loop.html | 17 + ...rmance2__glsl3__uniform-block-layout-match.html | 17 + ...conformance2__glsl3__uniform-block-layouts.html | 17 + ...ce2__glsl3__uniform-location-length-limits.html | 17 + ...est_2_conformance2__glsl3__valid-invariant.html | 17 + ...sl3__vector-dynamic-indexing-nv-driver-bug.html | 17 + ...nformance2__glsl3__vector-dynamic-indexing.html | 17 + .../test_2_conformance2__misc__expando-loss-2.html | 17 + ...sc__getextension-while-pbo-bound-stability.html | 17 + ...test_2_conformance2__misc__instanceof-test.html | 17 + ...rmance2__misc__object-deletion-behaviour-2.html | 17 + ...2_conformance2__misc__uninitialized-test-2.html | 17 + ...t_2_conformance2__misc__views-with-offsets.html | 17 + ...rmance2__programs__active-built-in-attribs.html | 17 + ...ance2__programs__gl-get-frag-data-location.html | 17 + ...est_2_conformance2__query__occlusion-query.html | 17 + .../test_2_conformance2__query__query.html | 17 + ...nformance2__reading__format-r11f-g11f-b10f.html | 17 + ...mance2__reading__read-pixels-from-fbo-test.html | 17 + ...eading__read-pixels-from-rgb8-into-pbo-bug.html | 17 + ...eading__read-pixels-into-pixel-pack-buffer.html | 17 + ...nce2__reading__read-pixels-pack-parameters.html | 17 + ...nderbuffers__framebuffer-object-attachment.html | 17 + ...formance2__renderbuffers__framebuffer-test.html | 17 + ...__renderbuffers__framebuffer-texture-layer.html | 17 + ...ce2__renderbuffers__invalidate-framebuffer.html | 17 + ...ffers__multisample-with-full-sample-counts.html | 17 + ...__multisampled-renderbuffer-initialization.html | 17 + ..._2_conformance2__renderbuffers__readbuffer.html | 17 + ...conformance2__rendering__attrib-type-match.html | 17 + ...dering__blitframebuffer-filter-outofbounds.html | 17 + ...e2__rendering__blitframebuffer-filter-srgb.html | 17 + ...g__blitframebuffer-multisampled-readbuffer.html | 17 + ...dering__blitframebuffer-outside-readbuffer.html | 17 + ...rendering__blitframebuffer-scissor-enabled.html | 17 + ...__rendering__blitframebuffer-size-overflow.html | 17 + ...litframebuffer-srgb-and-linear-drawbuffers.html | 17 + ...2__rendering__blitframebuffer-stencil-only.html | 17 + ...formance2__rendering__blitframebuffer-test.html | 17 + ..._rendering__canvas-resizing-with-pbo-bound.html | 17 + ...2__rendering__clear-func-buffer-type-match.html | 17 + ...mance2__rendering__clear-srgb-color-buffer.html | 17 + ...formance2__rendering__clipping-wide-points.html | 17 + ...st_2_conformance2__rendering__draw-buffers.html | 17 + ...onformance2__rendering__element-index-uint.html | 17 + ...ering__framebuffer-completeness-unaffected.html | 17 + ...mance2__rendering__framebuffer-unsupported.html | 17 + ...__fs-color-type-mismatch-color-buffer-type.html | 17 + ..._conformance2__rendering__instanced-arrays.html | 17 + ...mance2__rendering__instanced-rendering-bug.html | 17 + ..._out-of-bounds-index-buffers-after-copying.html | 17 + ...endering__rendering-sampling-feedback-loop.html | 17 + ...onformance2__rendering__rgb-format-support.html | 17 + ...nce2__rendering__uniform-block-buffer-size.html | 17 + ...nformance2__samplers__sampler-drawing-test.html | 17 + .../test_2_conformance2__samplers__samplers.html | 17 + .../test_2_conformance2__state__gl-enum-tests.html | 17 + .../test_2_conformance2__state__gl-get-calls.html | 17 + .../test_2_conformance2__state__gl-getstring.html | 17 + ...2_conformance2__state__gl-object-get-calls.html | 17 + ...s__canvas__tex-2d-r11f_g11f_b10f-rgb-float.html | 17 + ...nvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...2__textures__canvas__tex-2d-r16f-red-float.html | 17 + ...xtures__canvas__tex-2d-r16f-red-half_float.html | 17 + ...2__textures__canvas__tex-2d-r32f-red-float.html | 17 + ...tures__canvas__tex-2d-r8-red-unsigned_byte.html | 17 + ...vas__tex-2d-r8ui-red_integer-unsigned_byte.html | 17 + ...2__textures__canvas__tex-2d-rg16f-rg-float.html | 17 + ...xtures__canvas__tex-2d-rg16f-rg-half_float.html | 17 + ...2__textures__canvas__tex-2d-rg32f-rg-float.html | 17 + ...tures__canvas__tex-2d-rg8-rg-unsigned_byte.html | 17 + ...vas__tex-2d-rg8ui-rg_integer-unsigned_byte.html | 17 + ..._textures__canvas__tex-2d-rgb16f-rgb-float.html | 17 + ...ures__canvas__tex-2d-rgb16f-rgb-half_float.html | 17 + ..._textures__canvas__tex-2d-rgb32f-rgb-float.html | 17 + ...s__canvas__tex-2d-rgb565-rgb-unsigned_byte.html | 17 + ...as__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ..._canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...res__canvas__tex-2d-rgb8-rgb-unsigned_byte.html | 17 + ...s__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...extures__canvas__tex-2d-rgba16f-rgba-float.html | 17 + ...es__canvas__tex-2d-rgba16f-rgba-half_float.html | 17 + ...extures__canvas__tex-2d-rgba32f-rgba-float.html | 17 + ...s__canvas__tex-2d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...s__canvas__tex-2d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...es__canvas__tex-2d-srgb8-rgb-unsigned_byte.html | 17 + ...as__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...s__canvas__tex-3d-r11f_g11f_b10f-rgb-float.html | 17 + ...nvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...2__textures__canvas__tex-3d-r16f-red-float.html | 17 + ...xtures__canvas__tex-3d-r16f-red-half_float.html | 17 + ...2__textures__canvas__tex-3d-r32f-red-float.html | 17 + ...tures__canvas__tex-3d-r8-red-unsigned_byte.html | 17 + ...vas__tex-3d-r8ui-red_integer-unsigned_byte.html | 17 + ...2__textures__canvas__tex-3d-rg16f-rg-float.html | 17 + ...xtures__canvas__tex-3d-rg16f-rg-half_float.html | 17 + ...2__textures__canvas__tex-3d-rg32f-rg-float.html | 17 + ...tures__canvas__tex-3d-rg8-rg-unsigned_byte.html | 17 + ...vas__tex-3d-rg8ui-rg_integer-unsigned_byte.html | 17 + ..._textures__canvas__tex-3d-rgb16f-rgb-float.html | 17 + ...ures__canvas__tex-3d-rgb16f-rgb-half_float.html | 17 + ..._textures__canvas__tex-3d-rgb32f-rgb-float.html | 17 + ...s__canvas__tex-3d-rgb565-rgb-unsigned_byte.html | 17 + ...as__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ..._canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...res__canvas__tex-3d-rgb8-rgb-unsigned_byte.html | 17 + ...s__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...extures__canvas__tex-3d-rgba16f-rgba-float.html | 17 + ...es__canvas__tex-3d-rgba16f-rgba-half_float.html | 17 + ...extures__canvas__tex-3d-rgba32f-rgba-float.html | 17 + ...s__canvas__tex-3d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...s__canvas__tex-3d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...es__canvas__tex-3d-srgb8-rgb-unsigned_byte.html | 17 + ...as__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...rectangle__tex-2d-r11f_g11f_b10f-rgb-float.html | 17 + ...ngle__tex-2d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...anvas_sub_rectangle__tex-2d-r16f-red-float.html | 17 + ..._sub_rectangle__tex-2d-r16f-red-half_float.html | 17 + ...anvas_sub_rectangle__tex-2d-r32f-red-float.html | 17 + ...sub_rectangle__tex-2d-r8-red-unsigned_byte.html | 17 + ...gle__tex-2d-r8ui-red_integer-unsigned_byte.html | 17 + ...anvas_sub_rectangle__tex-2d-rg16f-rg-float.html | 17 + ..._sub_rectangle__tex-2d-rg16f-rg-half_float.html | 17 + ...anvas_sub_rectangle__tex-2d-rg32f-rg-float.html | 17 + ...sub_rectangle__tex-2d-rg8-rg-unsigned_byte.html | 17 + ...gle__tex-2d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...vas_sub_rectangle__tex-2d-rgb16f-rgb-float.html | 17 + ...ub_rectangle__tex-2d-rgb16f-rgb-half_float.html | 17 + ...vas_sub_rectangle__tex-2d-rgb32f-rgb-float.html | 17 + ...rectangle__tex-2d-rgb565-rgb-unsigned_byte.html | 17 + ...le__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...ctangle__tex-2d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...b_rectangle__tex-2d-rgb8-rgb-unsigned_byte.html | 17 + ...e__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...as_sub_rectangle__tex-2d-rgb9_e5-rgb-float.html | 17 + ...b_rectangle__tex-2d-rgb9_e5-rgb-half_float.html | 17 + ...s_sub_rectangle__tex-2d-rgba16f-rgba-float.html | 17 + ..._rectangle__tex-2d-rgba16f-rgba-half_float.html | 17 + ...s_sub_rectangle__tex-2d-rgba32f-rgba-float.html | 17 + ...rectangle__tex-2d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...rectangle__tex-2d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ..._rectangle__tex-2d-srgb8-rgb-unsigned_byte.html | 17 + ...le__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...rectangle__tex-3d-r11f_g11f_b10f-rgb-float.html | 17 + ...ngle__tex-3d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...anvas_sub_rectangle__tex-3d-r16f-red-float.html | 17 + ..._sub_rectangle__tex-3d-r16f-red-half_float.html | 17 + ...anvas_sub_rectangle__tex-3d-r32f-red-float.html | 17 + ...sub_rectangle__tex-3d-r8-red-unsigned_byte.html | 17 + ...gle__tex-3d-r8ui-red_integer-unsigned_byte.html | 17 + ...anvas_sub_rectangle__tex-3d-rg16f-rg-float.html | 17 + ..._sub_rectangle__tex-3d-rg16f-rg-half_float.html | 17 + ...anvas_sub_rectangle__tex-3d-rg32f-rg-float.html | 17 + ...sub_rectangle__tex-3d-rg8-rg-unsigned_byte.html | 17 + ...gle__tex-3d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...vas_sub_rectangle__tex-3d-rgb16f-rgb-float.html | 17 + ...ub_rectangle__tex-3d-rgb16f-rgb-half_float.html | 17 + ...vas_sub_rectangle__tex-3d-rgb32f-rgb-float.html | 17 + ...rectangle__tex-3d-rgb565-rgb-unsigned_byte.html | 17 + ...le__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...ctangle__tex-3d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...b_rectangle__tex-3d-rgb8-rgb-unsigned_byte.html | 17 + ...e__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...as_sub_rectangle__tex-3d-rgb9_e5-rgb-float.html | 17 + ...b_rectangle__tex-3d-rgb9_e5-rgb-half_float.html | 17 + ...s_sub_rectangle__tex-3d-rgba16f-rgba-float.html | 17 + ..._rectangle__tex-3d-rgba16f-rgba-half_float.html | 17 + ...s_sub_rectangle__tex-3d-rgba32f-rgba-float.html | 17 + ...rectangle__tex-3d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...rectangle__tex-3d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ..._rectangle__tex-3d-srgb8-rgb-unsigned_byte.html | 17 + ...le__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...es__image__tex-2d-r11f_g11f_b10f-rgb-float.html | 17 + ...mage__tex-2d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...e2__textures__image__tex-2d-r16f-red-float.html | 17 + ...extures__image__tex-2d-r16f-red-half_float.html | 17 + ...e2__textures__image__tex-2d-r32f-red-float.html | 17 + ...xtures__image__tex-2d-r8-red-unsigned_byte.html | 17 + ...age__tex-2d-r8ui-red_integer-unsigned_byte.html | 17 + ...e2__textures__image__tex-2d-rg16f-rg-float.html | 17 + ...extures__image__tex-2d-rg16f-rg-half_float.html | 17 + ...e2__textures__image__tex-2d-rg32f-rg-float.html | 17 + ...xtures__image__tex-2d-rg8-rg-unsigned_byte.html | 17 + ...age__tex-2d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...__textures__image__tex-2d-rgb16f-rgb-float.html | 17 + ...tures__image__tex-2d-rgb16f-rgb-half_float.html | 17 + ...__textures__image__tex-2d-rgb32f-rgb-float.html | 17 + ...es__image__tex-2d-rgb565-rgb-unsigned_byte.html | 17 + ...ge__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...__image__tex-2d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...ures__image__tex-2d-rgb8-rgb-unsigned_byte.html | 17 + ...e__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ..._textures__image__tex-2d-rgb9_e5-rgb-float.html | 17 + ...ures__image__tex-2d-rgb9_e5-rgb-half_float.html | 17 + ...textures__image__tex-2d-rgba16f-rgba-float.html | 17 + ...res__image__tex-2d-rgba16f-rgba-half_float.html | 17 + ...textures__image__tex-2d-rgba32f-rgba-float.html | 17 + ...es__image__tex-2d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...es__image__tex-2d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...res__image__tex-2d-srgb8-rgb-unsigned_byte.html | 17 + ...ge__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...es__image__tex-3d-r11f_g11f_b10f-rgb-float.html | 17 + ...mage__tex-3d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...e2__textures__image__tex-3d-r16f-red-float.html | 17 + ...extures__image__tex-3d-r16f-red-half_float.html | 17 + ...e2__textures__image__tex-3d-r32f-red-float.html | 17 + ...xtures__image__tex-3d-r8-red-unsigned_byte.html | 17 + ...age__tex-3d-r8ui-red_integer-unsigned_byte.html | 17 + ...e2__textures__image__tex-3d-rg16f-rg-float.html | 17 + ...extures__image__tex-3d-rg16f-rg-half_float.html | 17 + ...e2__textures__image__tex-3d-rg32f-rg-float.html | 17 + ...xtures__image__tex-3d-rg8-rg-unsigned_byte.html | 17 + ...age__tex-3d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...__textures__image__tex-3d-rgb16f-rgb-float.html | 17 + ...tures__image__tex-3d-rgb16f-rgb-half_float.html | 17 + ...__textures__image__tex-3d-rgb32f-rgb-float.html | 17 + ...es__image__tex-3d-rgb565-rgb-unsigned_byte.html | 17 + ...ge__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...__image__tex-3d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...ures__image__tex-3d-rgb8-rgb-unsigned_byte.html | 17 + ...e__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ..._textures__image__tex-3d-rgb9_e5-rgb-float.html | 17 + ...ures__image__tex-3d-rgb9_e5-rgb-half_float.html | 17 + ...textures__image__tex-3d-rgba16f-rgba-float.html | 17 + ...res__image__tex-3d-rgba16f-rgba-half_float.html | 17 + ...textures__image__tex-3d-rgba32f-rgba-float.html | 17 + ...es__image__tex-3d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...es__image__tex-3d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...res__image__tex-3d-srgb8-rgb-unsigned_byte.html | 17 + ...ge__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...mage_data__tex-2d-r11f_g11f_b10f-rgb-float.html | 17 + ...data__tex-2d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...extures__image_data__tex-2d-r16f-red-float.html | 17 + ...es__image_data__tex-2d-r16f-red-half_float.html | 17 + ...extures__image_data__tex-2d-r32f-red-float.html | 17 + ...s__image_data__tex-2d-r8-red-unsigned_byte.html | 17 + ...ata__tex-2d-r8ui-red_integer-unsigned_byte.html | 17 + ...extures__image_data__tex-2d-rg16f-rg-float.html | 17 + ...es__image_data__tex-2d-rg16f-rg-half_float.html | 17 + ...extures__image_data__tex-2d-rg32f-rg-float.html | 17 + ...s__image_data__tex-2d-rg8-rg-unsigned_byte.html | 17 + ...ata__tex-2d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...tures__image_data__tex-2d-rgb16f-rgb-float.html | 17 + ...__image_data__tex-2d-rgb16f-rgb-half_float.html | 17 + ...tures__image_data__tex-2d-rgb32f-rgb-float.html | 17 + ...mage_data__tex-2d-rgb565-rgb-unsigned_byte.html | 17 + ...ta__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...ge_data__tex-2d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ..._image_data__tex-2d-rgb8-rgb-unsigned_byte.html | 17 + ...a__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...ures__image_data__tex-2d-rgb9_e5-rgb-float.html | 17 + ..._image_data__tex-2d-rgb9_e5-rgb-half_float.html | 17 + ...res__image_data__tex-2d-rgba16f-rgba-float.html | 17 + ...image_data__tex-2d-rgba16f-rgba-half_float.html | 17 + ...res__image_data__tex-2d-rgba32f-rgba-float.html | 17 + ...mage_data__tex-2d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...mage_data__tex-2d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...image_data__tex-2d-srgb8-rgb-unsigned_byte.html | 17 + ...ta__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...mage_data__tex-3d-r11f_g11f_b10f-rgb-float.html | 17 + ...data__tex-3d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...extures__image_data__tex-3d-r16f-red-float.html | 17 + ...es__image_data__tex-3d-r16f-red-half_float.html | 17 + ...extures__image_data__tex-3d-r32f-red-float.html | 17 + ...s__image_data__tex-3d-r8-red-unsigned_byte.html | 17 + ...ata__tex-3d-r8ui-red_integer-unsigned_byte.html | 17 + ...extures__image_data__tex-3d-rg16f-rg-float.html | 17 + ...es__image_data__tex-3d-rg16f-rg-half_float.html | 17 + ...extures__image_data__tex-3d-rg32f-rg-float.html | 17 + ...s__image_data__tex-3d-rg8-rg-unsigned_byte.html | 17 + ...ata__tex-3d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...tures__image_data__tex-3d-rgb16f-rgb-float.html | 17 + ...__image_data__tex-3d-rgb16f-rgb-half_float.html | 17 + ...tures__image_data__tex-3d-rgb32f-rgb-float.html | 17 + ...mage_data__tex-3d-rgb565-rgb-unsigned_byte.html | 17 + ...ta__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...ge_data__tex-3d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ..._image_data__tex-3d-rgb8-rgb-unsigned_byte.html | 17 + ...a__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...ures__image_data__tex-3d-rgb9_e5-rgb-float.html | 17 + ..._image_data__tex-3d-rgb9_e5-rgb-half_float.html | 17 + ...res__image_data__tex-3d-rgba16f-rgba-float.html | 17 + ...image_data__tex-3d-rgba16f-rgba-half_float.html | 17 + ...res__image_data__tex-3d-rgba32f-rgba-float.html | 17 + ...mage_data__tex-3d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...mage_data__tex-3d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...image_data__tex-3d-srgb8-rgb-unsigned_byte.html | 17 + ...ta__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...ce2__textures__misc__active-3d-texture-bug.html | 17 + ...ures__misc__copy-texture-image-luma-format.html | 17 + ...s__misc__copy-texture-image-webgl-specific.html | 17 + ...mance2__textures__misc__copy-texture-image.html | 17 + ...nce2__textures__misc__gl-get-tex-parameter.html | 17 + ...c__integer-cubemap-specification-order-bug.html | 17 + ...es__misc__integer-cubemap-texture-sampling.html | 17 + ...2_conformance2__textures__misc__mipmap-fbo.html | 17 + ...rmance2__textures__misc__tex-3d-size-limit.html | 17 + ...ub-image-with-array-buffer-view-sub-source.html | 17 + ..._tex-image-with-bad-args-from-dom-elements.html | 17 + ...2__textures__misc__tex-image-with-bad-args.html | 17 + ...misc__tex-image-with-different-data-source.html | 17 + ...nce2__textures__misc__tex-input-validation.html | 17 + ...rmance2__textures__misc__tex-mipmap-levels.html | 17 + ...formance2__textures__misc__tex-new-formats.html | 17 + ...formance2__textures__misc__tex-srgb-mipmap.html | 17 + ...nformance2__textures__misc__tex-storage-2d.html | 17 + ...extures__misc__tex-storage-and-subimage-3d.html | 17 + ...ures__misc__tex-storage-compressed-formats.html | 17 + ...rmance2__textures__misc__tex-unpack-params.html | 17 + ...ce2__textures__misc__texel-fetch-undefined.html | 17 + ...conformance2__textures__misc__texture-npot.html | 17 + ...svg_image__tex-2d-r11f_g11f_b10f-rgb-float.html | 17 + ...mage__tex-2d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...textures__svg_image__tex-2d-r16f-red-float.html | 17 + ...res__svg_image__tex-2d-r16f-red-half_float.html | 17 + ...textures__svg_image__tex-2d-r32f-red-float.html | 17 + ...es__svg_image__tex-2d-r8-red-unsigned_byte.html | 17 + ...age__tex-2d-r8ui-red_integer-unsigned_byte.html | 17 + ...textures__svg_image__tex-2d-rg16f-rg-float.html | 17 + ...res__svg_image__tex-2d-rg16f-rg-half_float.html | 17 + ...textures__svg_image__tex-2d-rg32f-rg-float.html | 17 + ...es__svg_image__tex-2d-rg8-rg-unsigned_byte.html | 17 + ...age__tex-2d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...xtures__svg_image__tex-2d-rgb16f-rgb-float.html | 17 + ...s__svg_image__tex-2d-rgb16f-rgb-half_float.html | 17 + ...xtures__svg_image__tex-2d-rgb32f-rgb-float.html | 17 + ...svg_image__tex-2d-rgb565-rgb-unsigned_byte.html | 17 + ...ge__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...g_image__tex-2d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...__svg_image__tex-2d-rgb8-rgb-unsigned_byte.html | 17 + ...e__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...tures__svg_image__tex-2d-rgb9_e5-rgb-float.html | 17 + ...__svg_image__tex-2d-rgb9_e5-rgb-half_float.html | 17 + ...ures__svg_image__tex-2d-rgba16f-rgba-float.html | 17 + ..._svg_image__tex-2d-rgba16f-rgba-half_float.html | 17 + ...ures__svg_image__tex-2d-rgba32f-rgba-float.html | 17 + ...svg_image__tex-2d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...svg_image__tex-2d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ..._svg_image__tex-2d-srgb8-rgb-unsigned_byte.html | 17 + ...ge__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...svg_image__tex-3d-r11f_g11f_b10f-rgb-float.html | 17 + ...mage__tex-3d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...textures__svg_image__tex-3d-r16f-red-float.html | 17 + ...res__svg_image__tex-3d-r16f-red-half_float.html | 17 + ...textures__svg_image__tex-3d-r32f-red-float.html | 17 + ...es__svg_image__tex-3d-r8-red-unsigned_byte.html | 17 + ...age__tex-3d-r8ui-red_integer-unsigned_byte.html | 17 + ...textures__svg_image__tex-3d-rg16f-rg-float.html | 17 + ...res__svg_image__tex-3d-rg16f-rg-half_float.html | 17 + ...textures__svg_image__tex-3d-rg32f-rg-float.html | 17 + ...es__svg_image__tex-3d-rg8-rg-unsigned_byte.html | 17 + ...age__tex-3d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...xtures__svg_image__tex-3d-rgb16f-rgb-float.html | 17 + ...s__svg_image__tex-3d-rgb16f-rgb-half_float.html | 17 + ...xtures__svg_image__tex-3d-rgb32f-rgb-float.html | 17 + ...svg_image__tex-3d-rgb565-rgb-unsigned_byte.html | 17 + ...ge__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...g_image__tex-3d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...__svg_image__tex-3d-rgb8-rgb-unsigned_byte.html | 17 + ...e__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...tures__svg_image__tex-3d-rgb9_e5-rgb-float.html | 17 + ...__svg_image__tex-3d-rgb9_e5-rgb-half_float.html | 17 + ...ures__svg_image__tex-3d-rgba16f-rgba-float.html | 17 + ..._svg_image__tex-3d-rgba16f-rgba-half_float.html | 17 + ...ures__svg_image__tex-3d-rgba32f-rgba-float.html | 17 + ...svg_image__tex-3d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...svg_image__tex-3d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ..._svg_image__tex-3d-srgb8-rgb-unsigned_byte.html | 17 + ...ge__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...es__video__tex-2d-r11f_g11f_b10f-rgb-float.html | 17 + ...ideo__tex-2d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...e2__textures__video__tex-2d-r16f-red-float.html | 17 + ...extures__video__tex-2d-r16f-red-half_float.html | 17 + ...e2__textures__video__tex-2d-r32f-red-float.html | 17 + ...xtures__video__tex-2d-r8-red-unsigned_byte.html | 17 + ...deo__tex-2d-r8ui-red_integer-unsigned_byte.html | 17 + ...e2__textures__video__tex-2d-rg16f-rg-float.html | 17 + ...extures__video__tex-2d-rg16f-rg-half_float.html | 17 + ...e2__textures__video__tex-2d-rg32f-rg-float.html | 17 + ...xtures__video__tex-2d-rg8-rg-unsigned_byte.html | 17 + ...deo__tex-2d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...__textures__video__tex-2d-rgb16f-rgb-float.html | 17 + ...tures__video__tex-2d-rgb16f-rgb-half_float.html | 17 + ...__textures__video__tex-2d-rgb32f-rgb-float.html | 17 + ...es__video__tex-2d-rgb565-rgb-unsigned_byte.html | 17 + ...eo__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...__video__tex-2d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...ures__video__tex-2d-rgb8-rgb-unsigned_byte.html | 17 + ...o__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ..._textures__video__tex-2d-rgb9_e5-rgb-float.html | 17 + ...ures__video__tex-2d-rgb9_e5-rgb-half_float.html | 17 + ...textures__video__tex-2d-rgba16f-rgba-float.html | 17 + ...res__video__tex-2d-rgba16f-rgba-half_float.html | 17 + ...textures__video__tex-2d-rgba32f-rgba-float.html | 17 + ...es__video__tex-2d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...es__video__tex-2d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...res__video__tex-2d-srgb8-rgb-unsigned_byte.html | 17 + ...eo__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...es__video__tex-3d-r11f_g11f_b10f-rgb-float.html | 17 + ...ideo__tex-3d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...e2__textures__video__tex-3d-r16f-red-float.html | 17 + ...extures__video__tex-3d-r16f-red-half_float.html | 17 + ...e2__textures__video__tex-3d-r32f-red-float.html | 17 + ...xtures__video__tex-3d-r8-red-unsigned_byte.html | 17 + ...deo__tex-3d-r8ui-red_integer-unsigned_byte.html | 17 + ...e2__textures__video__tex-3d-rg16f-rg-float.html | 17 + ...extures__video__tex-3d-rg16f-rg-half_float.html | 17 + ...e2__textures__video__tex-3d-rg32f-rg-float.html | 17 + ...xtures__video__tex-3d-rg8-rg-unsigned_byte.html | 17 + ...deo__tex-3d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...__textures__video__tex-3d-rgb16f-rgb-float.html | 17 + ...tures__video__tex-3d-rgb16f-rgb-half_float.html | 17 + ...__textures__video__tex-3d-rgb32f-rgb-float.html | 17 + ...es__video__tex-3d-rgb565-rgb-unsigned_byte.html | 17 + ...eo__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ...__video__tex-3d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...ures__video__tex-3d-rgb8-rgb-unsigned_byte.html | 17 + ...o__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ..._textures__video__tex-3d-rgb9_e5-rgb-float.html | 17 + ...ures__video__tex-3d-rgb9_e5-rgb-half_float.html | 17 + ...textures__video__tex-3d-rgba16f-rgba-float.html | 17 + ...res__video__tex-3d-rgba16f-rgba-half_float.html | 17 + ...textures__video__tex-3d-rgba32f-rgba-float.html | 17 + ...es__video__tex-3d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...es__video__tex-3d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...res__video__tex-3d-srgb8-rgb-unsigned_byte.html | 17 + ...eo__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...gl_canvas__tex-2d-r11f_g11f_b10f-rgb-float.html | 17 + ...nvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...tures__webgl_canvas__tex-2d-r16f-red-float.html | 17 + ...__webgl_canvas__tex-2d-r16f-red-half_float.html | 17 + ...tures__webgl_canvas__tex-2d-r32f-red-float.html | 17 + ..._webgl_canvas__tex-2d-r8-red-unsigned_byte.html | 17 + ...vas__tex-2d-r8ui-red_integer-unsigned_byte.html | 17 + ...tures__webgl_canvas__tex-2d-rg16f-rg-float.html | 17 + ...__webgl_canvas__tex-2d-rg16f-rg-half_float.html | 17 + ...tures__webgl_canvas__tex-2d-rg32f-rg-float.html | 17 + ..._webgl_canvas__tex-2d-rg8-rg-unsigned_byte.html | 17 + ...vas__tex-2d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...res__webgl_canvas__tex-2d-rgb16f-rgb-float.html | 17 + ...webgl_canvas__tex-2d-rgb16f-rgb-half_float.html | 17 + ...res__webgl_canvas__tex-2d-rgb32f-rgb-float.html | 17 + ...gl_canvas__tex-2d-rgb565-rgb-unsigned_byte.html | 17 + ...as__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ..._canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...ebgl_canvas__tex-2d-rgb8-rgb-unsigned_byte.html | 17 + ...s__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...s__webgl_canvas__tex-2d-rgba16f-rgba-float.html | 17 + ...bgl_canvas__tex-2d-rgba16f-rgba-half_float.html | 17 + ...s__webgl_canvas__tex-2d-rgba32f-rgba-float.html | 17 + ...gl_canvas__tex-2d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...gl_canvas__tex-2d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-2d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...bgl_canvas__tex-2d-srgb8-rgb-unsigned_byte.html | 17 + ...as__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...gl_canvas__tex-3d-r11f_g11f_b10f-rgb-float.html | 17 + ...nvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html | 17 + ...g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html | 17 + ...tures__webgl_canvas__tex-3d-r16f-red-float.html | 17 + ...__webgl_canvas__tex-3d-r16f-red-half_float.html | 17 + ...tures__webgl_canvas__tex-3d-r32f-red-float.html | 17 + ..._webgl_canvas__tex-3d-r8-red-unsigned_byte.html | 17 + ...vas__tex-3d-r8ui-red_integer-unsigned_byte.html | 17 + ...tures__webgl_canvas__tex-3d-rg16f-rg-float.html | 17 + ...__webgl_canvas__tex-3d-rg16f-rg-half_float.html | 17 + ...tures__webgl_canvas__tex-3d-rg32f-rg-float.html | 17 + ..._webgl_canvas__tex-3d-rg8-rg-unsigned_byte.html | 17 + ...vas__tex-3d-rg8ui-rg_integer-unsigned_byte.html | 17 + ...res__webgl_canvas__tex-3d-rgb16f-rgb-float.html | 17 + ...webgl_canvas__tex-3d-rgb16f-rgb-half_float.html | 17 + ...res__webgl_canvas__tex-3d-rgb32f-rgb-float.html | 17 + ...gl_canvas__tex-3d-rgb565-rgb-unsigned_byte.html | 17 + ...as__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html | 17 + ..._canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html | 17 + ...tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html | 17 + ...ebgl_canvas__tex-3d-rgb8-rgb-unsigned_byte.html | 17 + ...s__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html | 17 + ...s__webgl_canvas__tex-3d-rgba16f-rgba-float.html | 17 + ...bgl_canvas__tex-3d-rgba16f-rgba-half_float.html | 17 + ...s__webgl_canvas__tex-3d-rgba32f-rgba-float.html | 17 + ...gl_canvas__tex-3d-rgba4-rgba-unsigned_byte.html | 17 + ...__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html | 17 + ...gl_canvas__tex-3d-rgba8-rgba-unsigned_byte.html | 17 + ..._tex-3d-rgba8ui-rgba_integer-unsigned_byte.html | 17 + ...bgl_canvas__tex-3d-srgb8-rgb-unsigned_byte.html | 17 + ...as__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html | 17 + ...e2__transform_feedback__transform_feedback.html | 17 + ...nsform_feedback__two-unreferenced-varyings.html | 17 + ...eedback__unwritten-output-defaults-to-zero.html | 17 + ...mance2__vertex_arrays__vertex-array-object.html | 17 + ...e__attribs__gl-bindAttribLocation-aliasing.html | 17 + ...nce__attribs__gl-bindAttribLocation-matrix.html | 17 + ...e__attribs__gl-bindAttribLocation-repeated.html | 17 + ...rmance__attribs__gl-disabled-vertex-attrib.html | 17 + ...formance__attribs__gl-enable-vertex-attrib.html | 17 + ...conformance__attribs__gl-matrix-attributes.html | 17 + ...formance__attribs__gl-vertex-attrib-render.html | 17 + ...nce__attribs__gl-vertex-attrib-zero-issues.html | 17 + ...e__attribs__gl-vertexattribpointer-offsets.html | 17 + ...nformance__attribs__gl-vertexattribpointer.html | 17 + ...t_2_conformance__buffers__buffer-bind-test.html | 17 + ...__buffers__buffer-data-and-buffer-sub-data.html | 17 + ...__buffers__buffer-data-array-buffer-delete.html | 17 + ...conformance__buffers__buffer-uninitialized.html | 17 + ...fers__element-array-buffer-delete-recreate.html | 17 + ...__buffers__index-validation-copies-indices.html | 17 + ...ndex-validation-crash-with-buffer-sub-data.html | 17 + ...ce__buffers__index-validation-large-buffer.html | 17 + ...index-validation-verifies-too-many-indices.html | 17 + ...fers__index-validation-with-resized-buffer.html | 17 + ...t_2_conformance__buffers__index-validation.html | 17 + ...conformance__canvas__buffer-offscreen-test.html | 17 + ..._conformance__canvas__buffer-preserve-test.html | 17 + .../test_2_conformance__canvas__canvas-test.html | 17 + ...st_2_conformance__canvas__canvas-zero-size.html | 17 + ..._draw-static-webgl-to-multiple-canvas-test.html | 17 + ...ormance__canvas__draw-webgl-to-canvas-test.html | 17 + ...ormance__canvas__drawingbuffer-hd-dpi-test.html | 17 + ...__canvas__drawingbuffer-static-canvas-test.html | 17 + ..._2_conformance__canvas__drawingbuffer-test.html | 17 + ...amebuffer-bindings-affected-by-to-data-url.html | 17 + ..._framebuffer-bindings-unaffected-on-resize.html | 17 + ...test_2_conformance__canvas__rapid-resizing.html | 17 + ...vas__texture-bindings-unaffected-on-resize.html | 17 + ...st_2_conformance__canvas__to-data-url-test.html | 17 + ...ce__canvas__viewport-unchanged-upon-resize.html | 17 + ..._context-attribute-preserve-drawing-buffer.html | 17 + ...t-attributes-alpha-depth-stencil-antialias.html | 17 + ..._context__context-creation-and-destruction.html | 17 + ...t_2_conformance__context__context-creation.html | 17 + ...__context-eviction-with-garbage-collection.html | 17 + ...conformance__context__context-hidden-alpha.html | 17 + ...onformance__context__context-lost-restored.html | 17 + .../test_2_conformance__context__context-lost.html | 17 + ...__context__context-no-alpha-fbo-with-alpha.html | 17 + ...ance__context__context-release-upon-reload.html | 17 + ...nce__context__context-release-with-workers.html | 17 + ..._conformance__context__context-size-change.html | 17 + ...ontext__incorrect-context-object-behaviour.html | 17 + ...onformance__context__premultiplyalpha-test.html | 17 + ...onformance__context__resource-sharing-test.html | 17 + ...ontext__user-defined-properties-on-context.html | 17 + ...ance__extensions__ext-disjoint-timer-query.html | 17 + ...extensions__ext-texture-filter-anisotropic.html | 17 + ...t_2_conformance__extensions__get-extension.html | 17 + ...ance__extensions__oes-texture-float-linear.html | 17 + ...__extensions__webgl-compressed-texture-atc.html | 17 + ...__extensions__webgl-compressed-texture-etc.html | 17 + ...extensions__webgl-compressed-texture-pvrtc.html | 17 + ...nsions__webgl-compressed-texture-s3tc-srgb.html | 17 + ..._extensions__webgl-compressed-texture-s3tc.html | 17 + ...sions__webgl-compressed-texture-size-limit.html | 17 + ...nce__extensions__webgl-debug-renderer-info.html | 17 + ...nformance__extensions__webgl-debug-shaders.html | 17 + ...rmance__extensions__webgl-shared-resources.html | 17 + ..._glsl__bugs__angle-ambiguous-function-call.html | 17 + ...bugs__angle-constructor-invalid-parameters.html | 17 + ...ce__glsl__bugs__angle-d3d11-compiler-error.html | 17 + ...ormance__glsl__bugs__angle-dx-variable-bug.html | 17 + ...s__array-of-struct-with-int-first-position.html | 17 + ...__glsl__bugs__bool-type-cast-bug-int-float.html | 17 + ..._glsl__bugs__compare-loop-index-to-uniform.html | 17 + ...e__glsl__bugs__complex-glsl-does-not-crash.html | 17 + ...bugs__compound-assignment-type-combination.html | 17 + ...e__glsl__bugs__conditional-discard-in-loop.html | 17 + ...sl__bugs__conditional-discard-optimization.html | 17 + ...__glsl__bugs__constant-precision-qualifier.html | 17 + ...l__bugs__floor-div-cos-should-not-truncate.html | 17 + ...nce__glsl__bugs__floored-division-accuracy.html | 17 + ...ormance__glsl__bugs__fragcoord-linking-bug.html | 17 + ...glsl__bugs__gl-fragcoord-multisampling-bug.html | 17 + ...bal-invariant-does-not-leak-across-shaders.html | 17 + ...gs__invariant-does-not-leak-across-shaders.html | 17 + ...l__bugs__logic-inside-block-without-braces.html | 17 + ...l__bugs__long-expressions-should-not-crash.html | 17 + ...ormance__glsl__bugs__loop-if-loop-gradient.html | 17 + ...ce__glsl__bugs__modulo-arithmetic-accuracy.html | 17 + ...nce__glsl__bugs__multiplication-assignment.html | 17 + ...l__bugs__nested-functions-should-not-crash.html | 17 + ...bugs__nested-loops-with-break-and-continue.html | 17 + ...ance__glsl__bugs__nested-sequence-operator.html | 17 + ...of-small-constant-in-user-defined-function.html | 17 + ...ow-with-constant-exponent-should-not-crash.html | 17 + ..._2_conformance__glsl__bugs__qualcomm-crash.html | 17 + ...l__bugs__qualcomm-loop-with-continue-crash.html | 17 + ...glsl__bugs__sampler-array-using-loop-index.html | 17 + ...e__glsl__bugs__sampler-struct-function-arg.html | 17 + ...__bugs__sequence-operator-evaluation-order.html | 17 + ...lsl__bugs__sketchfab-lighting-shader-crash.html | 17 + ...__glsl__bugs__struct-constructor-highp-bug.html | 17 + ...l__bugs__temp-expressions-should-not-crash.html | 17 + ...sl__bugs__undefined-index-should-not-crash.html | 17 + ...lsl__bugs__uniforms-should-not-lose-values.html | 17 + ...__glsl__constructors__glsl-construct-bvec2.html | 17 + ...__glsl__constructors__glsl-construct-bvec3.html | 17 + ...__glsl__constructors__glsl-construct-bvec4.html | 17 + ...__glsl__constructors__glsl-construct-ivec2.html | 17 + ...__glsl__constructors__glsl-construct-ivec3.html | 17 + ...__glsl__constructors__glsl-construct-ivec4.html | 17 + ...e__glsl__constructors__glsl-construct-mat2.html | 17 + ...e__glsl__constructors__glsl-construct-mat3.html | 17 + ...e__glsl__constructors__glsl-construct-mat4.html | 17 + ...ctors__glsl-construct-vec-mat-corner-cases.html | 17 + ...constructors__glsl-construct-vec-mat-index.html | 17 + ...e__glsl__constructors__glsl-construct-vec2.html | 17 + ...e__glsl__constructors__glsl-construct-vec3.html | 17 + ...e__glsl__constructors__glsl-construct-vec4.html | 17 + ...rmance__glsl__functions__glsl-function-abs.html | 17 + ...mance__glsl__functions__glsl-function-acos.html | 17 + ...mance__glsl__functions__glsl-function-asin.html | 17 + ...ce__glsl__functions__glsl-function-atan-xy.html | 17 + ...mance__glsl__functions__glsl-function-atan.html | 17 + ...mance__glsl__functions__glsl-function-ceil.html | 17 + ...glsl__functions__glsl-function-clamp-float.html | 17 + ...sl__functions__glsl-function-clamp-gentype.html | 17 + ...rmance__glsl__functions__glsl-function-cos.html | 17 + ...ance__glsl__functions__glsl-function-cross.html | 17 + ...e__glsl__functions__glsl-function-distance.html | 17 + ...rmance__glsl__functions__glsl-function-dot.html | 17 + ...glsl__functions__glsl-function-faceforward.html | 17 + ...ance__glsl__functions__glsl-function-floor.html | 17 + ...ance__glsl__functions__glsl-function-fract.html | 17 + ...nce__glsl__functions__glsl-function-length.html | 17 + ...__glsl__functions__glsl-function-max-float.html | 17 + ...glsl__functions__glsl-function-max-gentype.html | 17 + ...__glsl__functions__glsl-function-min-float.html | 17 + ...glsl__functions__glsl-function-min-gentype.html | 17 + ...__glsl__functions__glsl-function-mix-float.html | 17 + ...glsl__functions__glsl-function-mix-gentype.html | 17 + ...__glsl__functions__glsl-function-mod-float.html | 17 + ...glsl__functions__glsl-function-mod-gentype.html | 17 + ...__glsl__functions__glsl-function-normalize.html | 17 + ...ce__glsl__functions__glsl-function-reflect.html | 17 + ...mance__glsl__functions__glsl-function-sign.html | 17 + ...rmance__glsl__functions__glsl-function-sin.html | 17 + ..._functions__glsl-function-smoothstep-float.html | 17 + ...unctions__glsl-function-smoothstep-gentype.html | 17 + ..._glsl__functions__glsl-function-step-float.html | 17 + ...lsl__functions__glsl-function-step-gentype.html | 17 + ...onformance__glsl__functions__glsl-function.html | 17 + ...rmance__glsl__implicit__add_int_float.vert.html | 17 + ...ormance__glsl__implicit__add_int_mat2.vert.html | 17 + ...ormance__glsl__implicit__add_int_mat3.vert.html | 17 + ...ormance__glsl__implicit__add_int_mat4.vert.html | 17 + ...ormance__glsl__implicit__add_int_vec2.vert.html | 17 + ...ormance__glsl__implicit__add_int_vec3.vert.html | 17 + ...ormance__glsl__implicit__add_int_vec4.vert.html | 17 + ...mance__glsl__implicit__add_ivec2_vec2.vert.html | 17 + ...mance__glsl__implicit__add_ivec3_vec3.vert.html | 17 + ...mance__glsl__implicit__add_ivec4_vec4.vert.html | 17 + ...__glsl__implicit__assign_int_to_float.vert.html | 17 + ..._glsl__implicit__assign_ivec2_to_vec2.vert.html | 17 + ..._glsl__implicit__assign_ivec3_to_vec3.vert.html | 17 + ..._glsl__implicit__assign_ivec4_to_vec4.vert.html | 17 + ...nce__glsl__implicit__construct_struct.vert.html | 17 + ...nce__glsl__implicit__divide_int_float.vert.html | 17 + ...ance__glsl__implicit__divide_int_mat2.vert.html | 17 + ...ance__glsl__implicit__divide_int_mat3.vert.html | 17 + ...ance__glsl__implicit__divide_int_mat4.vert.html | 17 + ...ance__glsl__implicit__divide_int_vec2.vert.html | 17 + ...ance__glsl__implicit__divide_int_vec3.vert.html | 17 + ...ance__glsl__implicit__divide_int_vec4.vert.html | 17 + ...ce__glsl__implicit__divide_ivec2_vec2.vert.html | 17 + ...ce__glsl__implicit__divide_ivec3_vec3.vert.html | 17 + ...ce__glsl__implicit__divide_ivec4_vec4.vert.html | 17 + ...ance__glsl__implicit__equal_int_float.vert.html | 17 + ...nce__glsl__implicit__equal_ivec2_vec2.vert.html | 17 + ...nce__glsl__implicit__equal_ivec3_vec3.vert.html | 17 + ...nce__glsl__implicit__equal_ivec4_vec4.vert.html | 17 + ...e__glsl__implicit__function_int_float.vert.html | 17 + ...__glsl__implicit__function_ivec2_vec2.vert.html | 17 + ...__glsl__implicit__function_ivec3_vec3.vert.html | 17 + ...__glsl__implicit__function_ivec4_vec4.vert.html | 17 + ...ormance__glsl__implicit__greater_than.vert.html | 17 + ...e__glsl__implicit__greater_than_equal.vert.html | 17 + ...onformance__glsl__implicit__less_than.vert.html | 17 + ...ance__glsl__implicit__less_than_equal.vert.html | 17 + ...e__glsl__implicit__multiply_int_float.vert.html | 17 + ...ce__glsl__implicit__multiply_int_mat2.vert.html | 17 + ...ce__glsl__implicit__multiply_int_mat3.vert.html | 17 + ...ce__glsl__implicit__multiply_int_mat4.vert.html | 17 + ...ce__glsl__implicit__multiply_int_vec2.vert.html | 17 + ...ce__glsl__implicit__multiply_int_vec3.vert.html | 17 + ...ce__glsl__implicit__multiply_int_vec4.vert.html | 17 + ...__glsl__implicit__multiply_ivec2_vec2.vert.html | 17 + ...__glsl__implicit__multiply_ivec3_vec3.vert.html | 17 + ...__glsl__implicit__multiply_ivec4_vec4.vert.html | 17 + ...__glsl__implicit__not_equal_int_float.vert.html | 17 + ..._glsl__implicit__not_equal_ivec2_vec2.vert.html | 17 + ..._glsl__implicit__not_equal_ivec3_vec3.vert.html | 17 + ..._glsl__implicit__not_equal_ivec4_vec4.vert.html | 17 + ...e__glsl__implicit__subtract_int_float.vert.html | 17 + ...ce__glsl__implicit__subtract_int_mat2.vert.html | 17 + ...ce__glsl__implicit__subtract_int_mat3.vert.html | 17 + ...ce__glsl__implicit__subtract_int_mat4.vert.html | 17 + ...ce__glsl__implicit__subtract_int_vec2.vert.html | 17 + ...ce__glsl__implicit__subtract_int_vec3.vert.html | 17 + ...ce__glsl__implicit__subtract_int_vec4.vert.html | 17 + ...__glsl__implicit__subtract_ivec2_vec2.vert.html | 17 + ...__glsl__implicit__subtract_ivec3_vec3.vert.html | 17 + ...__glsl__implicit__subtract_ivec4_vec4.vert.html | 17 + ...ce__glsl__implicit__ternary_int_float.vert.html | 17 + ...e__glsl__implicit__ternary_ivec2_vec2.vert.html | 17 + ...e__glsl__implicit__ternary_ivec3_vec3.vert.html | 17 + ...e__glsl__implicit__ternary_ivec4_vec4.vert.html | 17 + ...rmance__glsl__literals__float_literal.vert.html | 17 + ...ormance__glsl__literals__literal_precision.html | 17 + ...rmance__glsl__literals__overflow_leak.vert.html | 17 + ...ce__glsl__matrices__glsl-mat3-construction.html | 17 + ...ormance__glsl__matrices__glsl-mat4-to-mat3.html | 17 + ...__glsl__matrices__matrix-compound-multiply.html | 17 + ...conformance__glsl__misc__boolean_precision.html | 17 + ..._glsl__misc__const-variable-initialization.html | 17 + ...isc__embedded-struct-definitions-forbidden.html | 17 + ...conformance__glsl__misc__empty-declaration.html | 17 + ...2_conformance__glsl__misc__empty_main.vert.html | 17 + ..._expression-list-in-declarator-initializer.html | 17 + ...rmance__glsl__misc__gl_position_unset.vert.html | 17 + ...formance__glsl__misc__global-variable-init.html | 17 + ...nformance__glsl__misc__glsl-function-nodes.html | 17 + ...ance__glsl__misc__glsl-long-variable-names.html | 17 + ...onformance__glsl__misc__glsl-vertex-branch.html | 17 + ...onformance__glsl__misc__large-loop-compile.html | 17 + ...mance__glsl__misc__non-ascii-comments.vert.html | 17 + ..._2_conformance__glsl__misc__non-ascii.vert.html | 17 + ...onformance__glsl__misc__re-compile-re-link.html | 17 + ...__misc__sequence-operator-returns-constant.html | 17 + ...glsl__misc__shader-precision-format-obeyed.html | 17 + ...nformance__glsl__misc__shader-struct-scope.html | 17 + ..._misc__shader-uniform-packing-restrictions.html | 17 + ..._misc__shader-varying-packing-restrictions.html | 17 + ...sl__misc__shader-with-256-character-define.html | 17 + ..._shader-with-256-character-identifier.frag.html | 17 + ...__misc__shader-with-_webgl-identifier.vert.html | 17 + ..._misc__shader-with-arbitrary-indexing.frag.html | 17 + ..._misc__shader-with-arbitrary-indexing.vert.html | 17 + ...er-with-array-of-structs-containing-arrays.html | 17 + ...misc__shader-with-array-of-structs-uniform.html | 17 + ..._glsl__misc__shader-with-attrib-array.vert.html | 17 + ...glsl__misc__shader-with-attrib-struct.vert.html | 17 + ...e__glsl__misc__shader-with-clipvertex.vert.html | 17 + ...__glsl__misc__shader-with-comma-assignment.html | 17 + ...__shader-with-comma-conditional-assignment.html | 17 + ...with-comma-separated-variable-declarations.html | 17 + ...__shader-with-conditional-scoping-negative.html | 17 + ...lsl__misc__shader-with-conditional-scoping.html | 17 + ...__misc__shader-with-default-precision.frag.html | 17 + ...__misc__shader-with-default-precision.vert.html | 17 + ..._shader-with-define-line-continuation.frag.html | 17 + ...__glsl__misc__shader-with-dfdx-no-ext.frag.html | 17 + ...ormance__glsl__misc__shader-with-dfdx.frag.html | 17 + ...nformance__glsl__misc__shader-with-do-loop.html | 17 + ...e__glsl__misc__shader-with-error-directive.html | 17 + ...__misc__shader-with-explicit-int-cast.vert.html | 17 + ..._misc__shader-with-float-return-value.frag.html | 17 + ...formance__glsl__misc__shader-with-for-loop.html | 17 + ...mance__glsl__misc__shader-with-for-scoping.html | 17 + ...e__glsl__misc__shader-with-frag-depth.frag.html | 17 + ..._misc__shader-with-function-recursion.frag.html | 17 + ...__misc__shader-with-function-scoped-struct.html | 17 + ...glsl__misc__shader-with-functional-scoping.html | 17 + ...ance__glsl__misc__shader-with-glcolor.vert.html | 17 + ...mance__glsl__misc__shader-with-gles-1.frag.html | 17 + ...__glsl__misc__shader-with-gles-symbol.frag.html | 17 + ...er-with-global-variable-precision-mismatch.html | 17 + ..._misc__shader-with-glprojectionmatrix.vert.html | 17 + ...__misc__shader-with-hex-int-constant-macro.html | 17 + ...hader-with-implicit-vec3-to-vec4-cast.vert.html | 17 + ...ance__glsl__misc__shader-with-include.vert.html | 17 + ...l__misc__shader-with-int-return-value.frag.html | 17 + ..._misc__shader-with-invalid-identifier.frag.html | 17 + ..._misc__shader-with-ivec2-return-value.frag.html | 17 + ..._misc__shader-with-ivec3-return-value.frag.html | 17 + ..._misc__shader-with-ivec4-return-value.frag.html | 17 + ...l__misc__shader-with-limited-indexing.frag.html | 17 + ...ormance__glsl__misc__shader-with-long-line.html | 17 + ...sl__misc__shader-with-non-ascii-error.frag.html | 17 + ...glsl__misc__shader-with-non-reserved-words.html | 17 + ...ce__glsl__misc__shader-with-precision.frag.html | 17 + ..._misc__shader-with-preprocessor-whitespace.html | 17 + ..._glsl__misc__shader-with-quoted-error.frag.html | 17 + ...ce__glsl__misc__shader-with-reserved-words.html | 17 + ...sc__shader-with-short-circuiting-operators.html | 17 + ...c__shader-with-similar-uniform-array-names.html | 17 + ..._glsl__misc__shader-with-too-many-uniforms.html | 17 + ...l__misc__shader-with-two-initializer-types.html | 17 + ...er-with-undefined-preprocessor-symbol.frag.html | 17 + ...shader-with-uniform-in-loop-condition.vert.html | 17 + ...__misc__shader-with-vec2-return-value.frag.html | 17 + ...__misc__shader-with-vec3-return-value.frag.html | 17 + ...__misc__shader-with-vec4-return-value.frag.html | 17 + ...sc__shader-with-vec4-vec3-vec4-conditional.html | 17 + ...__glsl__misc__shader-with-version-100.frag.html | 17 + ...__glsl__misc__shader-with-version-100.vert.html | 17 + ...__glsl__misc__shader-with-version-120.vert.html | 17 + ...__glsl__misc__shader-with-version-130.vert.html | 17 + ...l__misc__shader-with-webgl-identifier.vert.html | 17 + ...rmance__glsl__misc__shader-with-while-loop.html | 17 + ..._glsl__misc__shader-without-precision.frag.html | 17 + ...s-with-constant-expression-loop-conditions.html | 17 + ...mance__glsl__misc__shaders-with-invariance.html | 17 + ...__misc__shaders-with-mis-matching-uniforms.html | 17 + ...__misc__shaders-with-mis-matching-varyings.html | 17 + ..._glsl__misc__shaders-with-missing-varyings.html | 17 + ...e__glsl__misc__shaders-with-name-conflicts.html | 17 + ...__glsl__misc__shaders-with-uniform-structs.html | 17 + ...ormance__glsl__misc__shaders-with-varyings.html | 17 + .../test_2_conformance__glsl__misc__shared.html | 17 + ...t_2_conformance__glsl__misc__struct-assign.html | 17 + ...t_2_conformance__glsl__misc__struct-equals.html | 17 + ...glsl__misc__struct-mixed-array-declarators.html | 17 + ...glsl__misc__struct-nesting-exceeds-maximum.html | 17 + ...sl__misc__struct-nesting-of-variable-names.html | 17 + ...__glsl__misc__struct-nesting-under-maximum.html | 17 + ..._glsl__misc__struct-specifiers-in-uniforms.html | 17 + ...rmance__glsl__misc__struct-unary-operators.html | 17 + ...ce__glsl__misc__ternary-operator-on-arrays.html | 17 + ...__ternary-operators-in-global-initializers.html | 17 + ...l__misc__ternary-operators-in-initializers.html | 17 + ...ormance__glsl__reserved___webgl_field.vert.html | 17 + ...ance__glsl__reserved___webgl_function.vert.html | 17 + ...rmance__glsl__reserved___webgl_struct.vert.html | 17 + ...ance__glsl__reserved___webgl_variable.vert.html | 17 + ...formance__glsl__reserved__webgl_field.vert.html | 17 + ...mance__glsl__reserved__webgl_function.vert.html | 17 + ...ormance__glsl__reserved__webgl_struct.vert.html | 17 + ...mance__glsl__reserved__webgl_variable.vert.html | 17 + ...sl__samplers__glsl-function-texture2d-bias.html | 17 + ...glsl__samplers__glsl-function-texture2dlod.html | 17 + ...lsl__samplers__glsl-function-texture2dproj.html | 17 + ...__samplers__glsl-function-texture2dprojlod.html | 17 + ...e__glsl__variables__gl-fragcoord-xy-values.html | 17 + ...conformance__glsl__variables__gl-fragcoord.html | 17 + ...glsl__variables__gl-fragdata-and-fragcolor.html | 17 + ...nformance__glsl__variables__gl-frontfacing.html | 17 + ...onformance__glsl__variables__gl-pointcoord.html | 17 + ...nformance__glsl__variables__glsl-built-ins.html | 17 + .../test_2_conformance__limits__gl-line-width.html | 17 + ...ormance__limits__gl-max-texture-dimensions.html | 17 + ...test_2_conformance__limits__gl-min-attribs.html | 17 + ...est_2_conformance__limits__gl-min-textures.html | 17 + ...est_2_conformance__limits__gl-min-uniforms.html | 17 + ...st_2_conformance__misc__bad-arguments-test.html | 17 + ...ormance__misc__boolean-argument-conversion.html | 17 + .../test_2_conformance__misc__delayed-drawing.html | 17 + .../test_2_conformance__misc__error-reporting.html | 17 + .../test_2_conformance__misc__expando-loss.html | 17 + ...ormance__misc__functions-returning-strings.html | 17 + ...2_conformance__misc__invalid-passed-params.html | 17 + .../test_2_conformance__misc__is-object.html | 17 + ...2_conformance__misc__null-object-behaviour.html | 17 + ...nformance__misc__object-deletion-behaviour.html | 17 + ...conformance__misc__shader-precision-format.html | 17 + ..._2_conformance__misc__type-conversion-test.html | 17 + ...st_2_conformance__misc__uninitialized-test.html | 17 + .../test_2_conformance__misc__webgl-specific.html | 17 + ..._conformance__more__conformance__constants.html | 17 + ...conformance__more__conformance__getContext.html | 17 + ..._2_conformance__more__conformance__methods.html | 17 + ...rmance__more__conformance__quickCheckAPI-A.html | 17 + ...mance__more__conformance__quickCheckAPI-B1.html | 17 + ...mance__more__conformance__quickCheckAPI-B2.html | 17 + ...mance__more__conformance__quickCheckAPI-B3.html | 17 + ...mance__more__conformance__quickCheckAPI-B4.html | 17 + ...rmance__more__conformance__quickCheckAPI-C.html | 17 + ...ance__more__conformance__quickCheckAPI-D_G.html | 17 + ...ance__more__conformance__quickCheckAPI-G_I.html | 17 + ...ance__more__conformance__quickCheckAPI-L_S.html | 17 + ...ance__more__conformance__quickCheckAPI-S_V.html | 17 + ...onformance__more__conformance__webGLArrays.html | 17 + ...2_conformance__more__functions__bindBuffer.html | 17 + ...rmance__more__functions__bindBufferBadArgs.html | 17 + ...re__functions__bindFramebufferLeaveNonZero.html | 17 + ...2_conformance__more__functions__bufferData.html | 17 + ...rmance__more__functions__bufferDataBadArgs.html | 17 + ...onformance__more__functions__bufferSubData.html | 17 + ...nce__more__functions__bufferSubDataBadArgs.html | 17 + ...nformance__more__functions__copyTexImage2D.html | 17 + ...ce__more__functions__copyTexImage2DBadArgs.html | 17 + ...rmance__more__functions__copyTexSubImage2D.html | 17 + ..._more__functions__copyTexSubImage2DBadArgs.html | 17 + ...ance__more__functions__deleteBufferBadArgs.html | 17 + ...2_conformance__more__functions__drawArrays.html | 17 + ...ce__more__functions__drawArraysOutOfBounds.html | 17 + ...conformance__more__functions__drawElements.html | 17 + ...ance__more__functions__drawElementsBadArgs.html | 17 + ...st_2_conformance__more__functions__isTests.html | 17 + ...nformance__more__functions__isTestsBadArgs.html | 17 + ...2_conformance__more__functions__readPixels.html | 17 + ...rmance__more__functions__readPixelsBadArgs.html | 17 + ...2_conformance__more__functions__texImage2D.html | 17 + ...rmance__more__functions__texImage2DBadArgs.html | 17 + ...nformance__more__functions__texImage2DHTML.html | 17 + ...ce__more__functions__texImage2DHTMLBadArgs.html | 17 + ...onformance__more__functions__texSubImage2D.html | 17 + ...nce__more__functions__texSubImage2DBadArgs.html | 17 + ...rmance__more__functions__texSubImage2DHTML.html | 17 + ..._more__functions__texSubImage2DHTMLBadArgs.html | 17 + ...onformance__more__functions__uniformMatrix.html | 17 + ...nce__more__functions__uniformMatrixBadArgs.html | 17 + ...t_2_conformance__more__functions__uniformf.html | 17 + ...rmance__more__functions__uniformfArrayLen1.html | 17 + ...formance__more__functions__uniformfBadArgs.html | 17 + ...t_2_conformance__more__functions__uniformi.html | 17 + ...formance__more__functions__uniformiBadArgs.html | 17 + ...conformance__more__functions__vertexAttrib.html | 17 + ...ance__more__functions__vertexAttribBadArgs.html | 17 + ...ance__more__functions__vertexAttribPointer.html | 17 + ...ore__functions__vertexAttribPointerBadArgs.html | 17 + ..._conformance__more__glsl__arrayOutOfBounds.html | 17 + ...onformance__more__glsl__uniformOutOfBounds.html | 17 + ...onformance__ogles__GL__abs__abs_001_to_006.html | 17 + ...formance__ogles__GL__acos__acos_001_to_006.html | 17 + ...onformance__ogles__GL__all__all_001_to_004.html | 17 + ...onformance__ogles__GL__any__any_001_to_004.html | 17 + ...rmance__ogles__GL__array__array_001_to_006.html | 17 + ...formance__ogles__GL__asin__asin_001_to_006.html | 17 + ...formance__ogles__GL__atan__atan_001_to_008.html | 17 + ...formance__ogles__GL__atan__atan_009_to_012.html | 17 + ...s__GL__biConstants__biConstants_001_to_008.html | 17 + ...s__GL__biConstants__biConstants_009_to_016.html | 17 + ...L__biuDepthRange__biuDepthRange_001_to_002.html | 17 + ...rmance__ogles__GL__build__build_001_to_008.html | 17 + ...rmance__ogles__GL__build__build_009_to_016.html | 17 + ...rmance__ogles__GL__build__build_017_to_024.html | 17 + ...rmance__ogles__GL__build__build_025_to_032.html | 17 + ...rmance__ogles__GL__build__build_033_to_040.html | 17 + ...rmance__ogles__GL__build__build_041_to_048.html | 17 + ...rmance__ogles__GL__build__build_049_to_056.html | 17 + ...rmance__ogles__GL__build__build_057_to_064.html | 17 + ...rmance__ogles__GL__build__build_065_to_072.html | 17 + ...rmance__ogles__GL__build__build_073_to_080.html | 17 + ...rmance__ogles__GL__build__build_081_to_088.html | 17 + ...rmance__ogles__GL__build__build_089_to_096.html | 17 + ...rmance__ogles__GL__build__build_097_to_104.html | 17 + ...rmance__ogles__GL__build__build_105_to_112.html | 17 + ...rmance__ogles__GL__build__build_113_to_120.html | 17 + ...rmance__ogles__GL__build__build_121_to_128.html | 17 + ...rmance__ogles__GL__build__build_129_to_136.html | 17 + ...rmance__ogles__GL__build__build_137_to_144.html | 17 + ...rmance__ogles__GL__build__build_145_to_152.html | 17 + ...rmance__ogles__GL__build__build_153_to_160.html | 17 + ...rmance__ogles__GL__build__build_161_to_168.html | 17 + ...rmance__ogles__GL__build__build_169_to_176.html | 17 + ...rmance__ogles__GL__build__build_177_to_178.html | 17 + ..._in_varying_array_out_of_bounds_001_to_001.html | 17 + ...formance__ogles__GL__ceil__ceil_001_to_006.html | 17 + ...rmance__ogles__GL__clamp__clamp_001_to_006.html | 17 + ..._GL__control_flow__control_flow_001_to_008.html | 17 + ..._GL__control_flow__control_flow_009_to_010.html | 17 + ...onformance__ogles__GL__cos__cos_001_to_006.html | 17 + ...rmance__ogles__GL__cross__cross_001_to_002.html | 17 + ...ce__ogles__GL__default__default_001_to_001.html | 17 + ...ce__ogles__GL__degrees__degrees_001_to_006.html | 17 + ...ce__ogles__GL__discard__discard_001_to_002.html | 17 + ...__ogles__GL__distance__distance_001_to_006.html | 17 + ...onformance__ogles__GL__dot__dot_001_to_006.html | 17 + ...rmance__ogles__GL__equal__equal_001_to_008.html | 17 + ...rmance__ogles__GL__equal__equal_009_to_012.html | 17 + ...formance__ogles__GL__exp2__exp2_001_to_008.html | 17 + ...formance__ogles__GL__exp2__exp2_009_to_012.html | 17 + ...onformance__ogles__GL__exp__exp_001_to_008.html | 17 + ...onformance__ogles__GL__exp__exp_009_to_012.html | 17 + ...s__GL__faceforward__faceforward_001_to_006.html | 17 + ...rmance__ogles__GL__floor__floor_001_to_006.html | 17 + ...rmance__ogles__GL__fract__fract_001_to_006.html | 17 + ...ogles__GL__functions__functions_001_to_008.html | 17 + ...ogles__GL__functions__functions_009_to_016.html | 17 + ...ogles__GL__functions__functions_017_to_024.html | 17 + ...ogles__GL__functions__functions_025_to_032.html | 17 + ...ogles__GL__functions__functions_033_to_040.html | 17 + ...ogles__GL__functions__functions_041_to_048.html | 17 + ...ogles__GL__functions__functions_049_to_056.html | 17 + ...ogles__GL__functions__functions_057_to_064.html | 17 + ...ogles__GL__functions__functions_065_to_072.html | 17 + ...ogles__GL__functions__functions_073_to_080.html | 17 + ...ogles__GL__functions__functions_081_to_088.html | 17 + ...ogles__GL__functions__functions_089_to_096.html | 17 + ...ogles__GL__functions__functions_097_to_104.html | 17 + ...ogles__GL__functions__functions_105_to_112.html | 17 + ...ogles__GL__functions__functions_113_to_120.html | 17 + ...ogles__GL__functions__functions_121_to_126.html | 17 + ..._GL__gl_FragCoord__gl_FragCoord_001_to_003.html | 17 + ..._gl_FrontFacing__gl_FrontFacing_001_to_001.html | 17 + ...aterThanEqual__greaterThanEqual_001_to_008.html | 17 + ...s__GL__greaterThan__greaterThan_001_to_008.html | 17 + ...s__GL__inversesqrt__inversesqrt_001_to_006.html | 17 + ...ance__ogles__GL__length__length_001_to_006.html | 17 + ...L__lessThanEqual__lessThanEqual_001_to_008.html | 17 + ...__ogles__GL__lessThan__lessThan_001_to_008.html | 17 + ...formance__ogles__GL__log2__log2_001_to_008.html | 17 + ...formance__ogles__GL__log2__log2_009_to_012.html | 17 + ...onformance__ogles__GL__log__log_001_to_008.html | 17 + ...onformance__ogles__GL__log__log_009_to_012.html | 17 + ...formance__ogles__GL__mat3__mat3_001_to_006.html | 17 + ...onformance__ogles__GL__mat__mat_001_to_008.html | 17 + ...onformance__ogles__GL__mat__mat_009_to_016.html | 17 + ...onformance__ogles__GL__mat__mat_017_to_024.html | 17 + ...onformance__ogles__GL__mat__mat_025_to_032.html | 17 + ...onformance__ogles__GL__mat__mat_033_to_040.html | 17 + ...onformance__ogles__GL__mat__mat_041_to_046.html | 17 + ..._matrixCompMult__matrixCompMult_001_to_004.html | 17 + ...onformance__ogles__GL__max__max_001_to_006.html | 17 + ...onformance__ogles__GL__min__min_001_to_006.html | 17 + ...onformance__ogles__GL__mix__mix_001_to_006.html | 17 + ...onformance__ogles__GL__mod__mod_001_to_008.html | 17 + ...ogles__GL__normalize__normalize_001_to_006.html | 17 + ...__ogles__GL__notEqual__notEqual_001_to_008.html | 17 + ...__ogles__GL__notEqual__notEqual_009_to_012.html | 17 + ...onformance__ogles__GL__not__not_001_to_004.html | 17 + ...ogles__GL__operators__operators_001_to_008.html | 17 + ...ogles__GL__operators__operators_009_to_016.html | 17 + ...ogles__GL__operators__operators_017_to_024.html | 17 + ...ogles__GL__operators__operators_025_to_026.html | 17 + ...onformance__ogles__GL__pow__pow_001_to_008.html | 17 + ...onformance__ogles__GL__pow__pow_009_to_016.html | 17 + ...onformance__ogles__GL__pow__pow_017_to_024.html | 17 + ...ce__ogles__GL__radians__radians_001_to_006.html | 17 + ...ce__ogles__GL__reflect__reflect_001_to_006.html | 17 + ...ce__ogles__GL__refract__refract_001_to_006.html | 17 + ...formance__ogles__GL__sign__sign_001_to_006.html | 17 + ...onformance__ogles__GL__sin__sin_001_to_006.html | 17 + ...les__GL__smoothstep__smoothstep_001_to_006.html | 17 + ...formance__ogles__GL__sqrt__sqrt_001_to_006.html | 17 + ...formance__ogles__GL__step__step_001_to_006.html | 17 + ...ance__ogles__GL__struct__struct_001_to_008.html | 17 + ...ance__ogles__GL__struct__struct_009_to_016.html | 17 + ...ance__ogles__GL__struct__struct_017_to_024.html | 17 + ...ance__ogles__GL__struct__struct_025_to_032.html | 17 + ...ance__ogles__GL__struct__struct_033_to_040.html | 17 + ...ance__ogles__GL__struct__struct_041_to_048.html | 17 + ...ance__ogles__GL__struct__struct_049_to_056.html | 17 + ...ogles__GL__swizzlers__swizzlers_001_to_008.html | 17 + ...ogles__GL__swizzlers__swizzlers_009_to_016.html | 17 + ...ogles__GL__swizzlers__swizzlers_017_to_024.html | 17 + ...ogles__GL__swizzlers__swizzlers_025_to_032.html | 17 + ...ogles__GL__swizzlers__swizzlers_033_to_040.html | 17 + ...ogles__GL__swizzlers__swizzlers_041_to_048.html | 17 + ...ogles__GL__swizzlers__swizzlers_049_to_056.html | 17 + ...ogles__GL__swizzlers__swizzlers_057_to_064.html | 17 + ...ogles__GL__swizzlers__swizzlers_065_to_072.html | 17 + ...ogles__GL__swizzlers__swizzlers_073_to_080.html | 17 + ...ogles__GL__swizzlers__swizzlers_081_to_088.html | 17 + ...ogles__GL__swizzlers__swizzlers_089_to_096.html | 17 + ...ogles__GL__swizzlers__swizzlers_097_to_104.html | 17 + ...ogles__GL__swizzlers__swizzlers_105_to_112.html | 17 + ...ogles__GL__swizzlers__swizzlers_113_to_120.html | 17 + ...onformance__ogles__GL__tan__tan_001_to_006.html | 17 + ...formance__ogles__GL__vec3__vec3_001_to_008.html | 17 + ...onformance__ogles__GL__vec__vec_001_to_008.html | 17 + ...onformance__ogles__GL__vec__vec_009_to_016.html | 17 + ...onformance__ogles__GL__vec__vec_017_to_018.html | 17 + ...t_2_conformance__programs__get-active-test.html | 17 + ...s__gl-bind-attrib-location-long-names-test.html | 17 + ...ce__programs__gl-bind-attrib-location-test.html | 17 + ...ormance__programs__gl-get-active-attribute.html | 17 + ...nformance__programs__gl-get-active-uniform.html | 17 + ..._conformance__programs__gl-getshadersource.html | 17 + ...st_2_conformance__programs__gl-shader-test.html | 17 + ...st_2_conformance__programs__invalid-UTF-16.html | 17 + ...t_2_conformance__programs__program-infolog.html | 17 + ...test_2_conformance__programs__program-test.html | 17 + ...gram-crash-with-discard-in-fragment-shader.html | 17 + ...mance__reading__read-pixels-pack-alignment.html | 17 + ...t_2_conformance__reading__read-pixels-test.html | 17 + ..._conformance__renderbuffers__feedback-loop.html | 17 + ...nderbuffers__framebuffer-state-restoration.html | 17 + ...renderbuffers__renderbuffer-initialization.html | 17 + .../test_2_conformance__rendering__culling.html | 17 + ...mance__rendering__default-texture-draw-bug.html | 17 + ...ance__rendering__draw-arrays-out-of-bounds.html | 17 + ...ce__rendering__draw-elements-out-of-bounds.html | 17 + ...ering__draw-with-changing-start-vertex-bug.html | 17 + ...conformance__rendering__framebuffer-switch.html | 17 + ...nce__rendering__framebuffer-texture-switch.html | 17 + .../test_2_conformance__rendering__gl-clear.html | 17 + ...st_2_conformance__rendering__gl-drawarrays.html | 17 + ..._2_conformance__rendering__gl-drawelements.html | 17 + ...e__rendering__gl-scissor-canvas-dimensions.html | 17 + ...onformance__rendering__gl-scissor-fbo-test.html | 17 + ..._2_conformance__rendering__gl-scissor-test.html | 17 + ...2_conformance__rendering__gl-viewport-test.html | 17 + ..._conformance__rendering__line-loop-tri-fan.html | 17 + ..._2_conformance__rendering__many-draw-calls.html | 17 + ...rmance__rendering__more-than-65536-indices.html | 17 + ...ormance__rendering__multisample-corruption.html | 17 + ...conformance__rendering__negative-one-index.html | 17 + ...ce__rendering__out-of-bounds-index-buffers.html | 17 + ...onformance__rendering__point-no-attributes.html | 17 + .../test_2_conformance__rendering__point-size.html | 17 + ...rendering__point-specific-shader-variables.html | 17 + ...oint-with-gl-pointcoord-in-fragment-shader.html | 17 + ...t_2_conformance__rendering__polygon-offset.html | 17 + .../test_2_conformance__rendering__simple.html | 17 + .../test_2_conformance__rendering__triangle.html | 17 + ..._2_conformance__state__gl-enable-enum-test.html | 17 + .../test_2_conformance__state__gl-get-calls.html | 17 + .../test_2_conformance__state__gl-geterror.html | 17 + ...est_2_conformance__state__gl-initial-state.html | 17 + ..._state__state-uneffected-after-compositing.html | 17 + ...ures__canvas__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...anvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...es__canvas__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...ub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...angle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ..._rectangle__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...tures__image__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...res__image__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...__image_data__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ..._data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...image_data__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...a__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...a__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ..._textures__misc__copy-tex-image-2d-formats.html | 17 + ...res__misc__copy-tex-image-and-sub-image-2d.html | 17 + ...isc__copy-tex-sub-image-2d-partial-texture.html | 17 + ...mance__textures__misc__cube-incomplete-fbo.html | 17 + ...nformance__textures__misc__default-texture.html | 17 + ...onformance__textures__misc__gl-pixelstorei.html | 17 + ...2_conformance__textures__misc__gl-teximage.html | 17 + ..._2_conformance__textures__misc__mipmap-fbo.html | 17 + ...__textures__misc__origin-clean-conformance.html | 17 + ...ge-and-sub-image-2d-with-array-buffer-view.html | 17 + ...__misc__tex-image-and-uniform-binding-bugs.html | 17 + ...extures__misc__tex-image-canvas-corruption.html | 17 + ...nformance__textures__misc__tex-image-webgl.html | 17 + ...ures__misc__tex-image-with-format-and-type.html | 17 + ...extures__misc__tex-image-with-invalid-data.html | 17 + ..._textures__misc__tex-sub-image-2d-bad-args.html | 17 + ...formance__textures__misc__tex-sub-image-2d.html | 17 + ...ormance__textures__misc__texparameter-test.html | 17 + ...nce__textures__misc__texture-active-bind-2.html | 17 + ...mance__textures__misc__texture-active-bind.html | 17 + ...textures__misc__texture-attachment-formats.html | 17 + ...conformance__textures__misc__texture-clear.html | 17 + ...formance__textures__misc__texture-complete.html | 17 + ...ures__misc__texture-copying-feedback-loops.html | 17 + ...ures__misc__texture-cube-as-fbo-attachment.html | 17 + ...tures__misc__texture-draw-with-2d-and-cube.html | 17 + ...onformance__textures__misc__texture-hd-dpi.html | 17 + ..._conformance__textures__misc__texture-mips.html | 17 + ...ce__textures__misc__texture-size-cube-maps.html | 17 + ...rmance__textures__misc__texture-size-limit.html | 17 + ..._conformance__textures__misc__texture-size.html | 17 + ...extures__misc__texture-sub-image-cube-maps.html | 17 + ...sc__texture-transparent-pixels-initialized.html | 17 + ...__textures__misc__texture-upload-cube-maps.html | 17 + ...mance__textures__misc__texture-upload-size.html | 17 + ...s__svg_image__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ..._svg_image__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...tures__video__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...res__video__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...o__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...o__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...anvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...bgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...nformance__typedarrays__array-buffer-crash.html | 17 + ...ance__typedarrays__array-buffer-view-crash.html | 17 + ...ance__typedarrays__array-large-array-tests.html | 17 + ...conformance__typedarrays__array-unit-tests.html | 17 + ..._conformance__typedarrays__data-view-crash.html | 17 + ...2_conformance__typedarrays__data-view-test.html | 17 + ...ance__typedarrays__typed-arrays-in-workers.html | 17 + ...2_conformance__uniforms__gl-uniform-arrays.html | 17 + ...t_2_conformance__uniforms__gl-uniform-bool.html | 17 + ...conformance__uniforms__gl-uniformmatrix4fv.html | 17 + ..._conformance__uniforms__gl-unknown-uniform.html | 17 + ...nformance__uniforms__null-uniform-location.html | 17 + ...iforms__out-of-bounds-uniform-array-access.html | 17 + ...formance__uniforms__uniform-default-values.html | 17 + ..._2_conformance__uniforms__uniform-location.html | 17 + ...nformance__uniforms__uniform-samplers-test.html | 17 + ...ance__uniforms__uniform-values-per-program.html | 17 + ...e__attribs__gl-bindAttribLocation-aliasing.html | 17 + ...nce__attribs__gl-bindAttribLocation-matrix.html | 17 + ...e__attribs__gl-bindAttribLocation-repeated.html | 17 + ...rmance__attribs__gl-disabled-vertex-attrib.html | 17 + ...formance__attribs__gl-enable-vertex-attrib.html | 17 + ...conformance__attribs__gl-matrix-attributes.html | 17 + ...formance__attribs__gl-vertex-attrib-render.html | 17 + ...nce__attribs__gl-vertex-attrib-zero-issues.html | 17 + ...est_conformance__attribs__gl-vertex-attrib.html | 17 + ...e__attribs__gl-vertexattribpointer-offsets.html | 17 + ...nformance__attribs__gl-vertexattribpointer.html | 17 + ...est_conformance__buffers__buffer-bind-test.html | 17 + ...__buffers__buffer-data-and-buffer-sub-data.html | 17 + ...__buffers__buffer-data-array-buffer-delete.html | 17 + ...conformance__buffers__buffer-uninitialized.html | 17 + ...fers__element-array-buffer-delete-recreate.html | 17 + ...__buffers__index-validation-copies-indices.html | 17 + ...ndex-validation-crash-with-buffer-sub-data.html | 17 + ...ce__buffers__index-validation-large-buffer.html | 17 + ...index-validation-verifies-too-many-indices.html | 17 + ...fers__index-validation-with-resized-buffer.html | 17 + ...est_conformance__buffers__index-validation.html | 17 + ...conformance__canvas__buffer-offscreen-test.html | 17 + ..._conformance__canvas__buffer-preserve-test.html | 17 + .../test_conformance__canvas__canvas-test.html | 17 + ...test_conformance__canvas__canvas-zero-size.html | 17 + ..._draw-static-webgl-to-multiple-canvas-test.html | 17 + ...ormance__canvas__draw-webgl-to-canvas-test.html | 17 + ...ormance__canvas__drawingbuffer-hd-dpi-test.html | 17 + ...__canvas__drawingbuffer-static-canvas-test.html | 17 + ...st_conformance__canvas__drawingbuffer-test.html | 17 + ...amebuffer-bindings-affected-by-to-data-url.html | 17 + ..._framebuffer-bindings-unaffected-on-resize.html | 17 + .../test_conformance__canvas__rapid-resizing.html | 17 + ...vas__texture-bindings-unaffected-on-resize.html | 17 + ...test_conformance__canvas__to-data-url-test.html | 17 + ...ce__canvas__viewport-unchanged-upon-resize.html | 17 + ...ormance__context__constants-and-properties.html | 17 + ..._context-attribute-preserve-drawing-buffer.html | 17 + ...t-attributes-alpha-depth-stencil-antialias.html | 17 + ..._context__context-creation-and-destruction.html | 17 + ...est_conformance__context__context-creation.html | 17 + ...__context-eviction-with-garbage-collection.html | 17 + ...conformance__context__context-hidden-alpha.html | 17 + ...onformance__context__context-lost-restored.html | 17 + .../test_conformance__context__context-lost.html | 17 + ...__context__context-no-alpha-fbo-with-alpha.html | 17 + ...ance__context__context-release-upon-reload.html | 17 + ...nce__context__context-release-with-workers.html | 17 + ..._conformance__context__context-size-change.html | 17 + ...st_conformance__context__context-type-test.html | 17 + ...ontext__incorrect-context-object-behaviour.html | 17 + .../test_conformance__context__methods.html | 17 + ...onformance__context__premultiplyalpha-test.html | 17 + ...onformance__context__resource-sharing-test.html | 17 + ...ontext__user-defined-properties-on-context.html | 17 + ...ions__angle-instanced-arrays-out-of-bounds.html | 17 + ...rmance__extensions__angle-instanced-arrays.html | 17 + ..._conformance__extensions__ext-blend-minmax.html | 17 + ...ance__extensions__ext-disjoint-timer-query.html | 17 + ...st_conformance__extensions__ext-frag-depth.html | 17 + .../test_conformance__extensions__ext-sRGB.html | 17 + ...rmance__extensions__ext-shader-texture-lod.html | 17 + ...extensions__ext-texture-filter-anisotropic.html | 17 + ...est_conformance__extensions__get-extension.html | 17 + ...rmance__extensions__oes-element-index-uint.html | 17 + ...ance__extensions__oes-standard-derivatives.html | 17 + ...ance__extensions__oes-texture-float-linear.html | 17 + ..._extensions__oes-texture-float-with-canvas.html | 17 + ...ensions__oes-texture-float-with-image-data.html | 17 + ...__extensions__oes-texture-float-with-image.html | 17 + ...__extensions__oes-texture-float-with-video.html | 17 + ...conformance__extensions__oes-texture-float.html | 17 + ..._extensions__oes-texture-half-float-linear.html | 17 + ...nsions__oes-texture-half-float-with-canvas.html | 17 + ...ns__oes-texture-half-float-with-image-data.html | 17 + ...ensions__oes-texture-half-float-with-image.html | 17 + ...ensions__oes-texture-half-float-with-video.html | 17 + ...rmance__extensions__oes-texture-half-float.html | 17 + ...nsions__oes-vertex-array-object-bufferData.html | 17 + ...mance__extensions__oes-vertex-array-object.html | 17 + ...__extensions__webgl-compressed-texture-atc.html | 17 + ...__extensions__webgl-compressed-texture-etc.html | 17 + ...extensions__webgl-compressed-texture-pvrtc.html | 17 + ...nsions__webgl-compressed-texture-s3tc-srgb.html | 17 + ..._extensions__webgl-compressed-texture-s3tc.html | 17 + ...sions__webgl-compressed-texture-size-limit.html | 17 + ...nce__extensions__webgl-debug-renderer-info.html | 17 + ...nformance__extensions__webgl-debug-shaders.html | 17 + ...nformance__extensions__webgl-depth-texture.html | 17 + ...webgl-draw-buffers-framebuffer-unsupported.html | 17 + ...sions__webgl-draw-buffers-max-draw-buffers.html | 17 + ...onformance__extensions__webgl-draw-buffers.html | 17 + ...rmance__extensions__webgl-shared-resources.html | 17 + ..._glsl__bugs__angle-ambiguous-function-call.html | 17 + ...bugs__angle-constructor-invalid-parameters.html | 17 + ...ce__glsl__bugs__angle-d3d11-compiler-error.html | 17 + ...ormance__glsl__bugs__angle-dx-variable-bug.html | 17 + ...s__array-of-struct-with-int-first-position.html | 17 + ...__glsl__bugs__bool-type-cast-bug-int-float.html | 17 + ..._glsl__bugs__compare-loop-index-to-uniform.html | 17 + ...e__glsl__bugs__complex-glsl-does-not-crash.html | 17 + ...bugs__compound-assignment-type-combination.html | 17 + ...e__glsl__bugs__conditional-discard-in-loop.html | 17 + ...sl__bugs__conditional-discard-optimization.html | 17 + ...__glsl__bugs__constant-precision-qualifier.html | 17 + ...nce__glsl__bugs__essl3-shaders-with-webgl1.html | 17 + ...l__bugs__floor-div-cos-should-not-truncate.html | 17 + ...nce__glsl__bugs__floored-division-accuracy.html | 17 + ...ormance__glsl__bugs__fragcoord-linking-bug.html | 17 + ...glsl__bugs__gl-fragcoord-multisampling-bug.html | 17 + ...bal-invariant-does-not-leak-across-shaders.html | 17 + ...gs__invariant-does-not-leak-across-shaders.html | 17 + ...l__bugs__logic-inside-block-without-braces.html | 17 + ...l__bugs__long-expressions-should-not-crash.html | 17 + ...ormance__glsl__bugs__loop-if-loop-gradient.html | 17 + ...ce__glsl__bugs__modulo-arithmetic-accuracy.html | 17 + ...nce__glsl__bugs__multiplication-assignment.html | 17 + ...l__bugs__nested-functions-should-not-crash.html | 17 + ...bugs__nested-loops-with-break-and-continue.html | 17 + ...ance__glsl__bugs__nested-sequence-operator.html | 17 + ...of-small-constant-in-user-defined-function.html | 17 + ...ow-with-constant-exponent-should-not-crash.html | 17 + ...st_conformance__glsl__bugs__qualcomm-crash.html | 17 + ...l__bugs__qualcomm-loop-with-continue-crash.html | 17 + ...glsl__bugs__sampler-array-using-loop-index.html | 17 + ...e__glsl__bugs__sampler-struct-function-arg.html | 17 + ...__bugs__sequence-operator-evaluation-order.html | 17 + ...lsl__bugs__sketchfab-lighting-shader-crash.html | 17 + ...__glsl__bugs__struct-constructor-highp-bug.html | 17 + ...l__bugs__temp-expressions-should-not-crash.html | 17 + ...sl__bugs__undefined-index-should-not-crash.html | 17 + ...lsl__bugs__uniforms-should-not-lose-values.html | 17 + ...__glsl__constructors__glsl-construct-bvec2.html | 17 + ...__glsl__constructors__glsl-construct-bvec3.html | 17 + ...__glsl__constructors__glsl-construct-bvec4.html | 17 + ...__glsl__constructors__glsl-construct-ivec2.html | 17 + ...__glsl__constructors__glsl-construct-ivec3.html | 17 + ...__glsl__constructors__glsl-construct-ivec4.html | 17 + ...e__glsl__constructors__glsl-construct-mat2.html | 17 + ...e__glsl__constructors__glsl-construct-mat3.html | 17 + ...e__glsl__constructors__glsl-construct-mat4.html | 17 + ...ctors__glsl-construct-vec-mat-corner-cases.html | 17 + ...constructors__glsl-construct-vec-mat-index.html | 17 + ...e__glsl__constructors__glsl-construct-vec2.html | 17 + ...e__glsl__constructors__glsl-construct-vec3.html | 17 + ...e__glsl__constructors__glsl-construct-vec4.html | 17 + ...rmance__glsl__functions__glsl-function-abs.html | 17 + ...mance__glsl__functions__glsl-function-acos.html | 17 + ...mance__glsl__functions__glsl-function-asin.html | 17 + ...ce__glsl__functions__glsl-function-atan-xy.html | 17 + ...mance__glsl__functions__glsl-function-atan.html | 17 + ...mance__glsl__functions__glsl-function-ceil.html | 17 + ...glsl__functions__glsl-function-clamp-float.html | 17 + ...sl__functions__glsl-function-clamp-gentype.html | 17 + ...rmance__glsl__functions__glsl-function-cos.html | 17 + ...ance__glsl__functions__glsl-function-cross.html | 17 + ...e__glsl__functions__glsl-function-distance.html | 17 + ...rmance__glsl__functions__glsl-function-dot.html | 17 + ...glsl__functions__glsl-function-faceforward.html | 17 + ...ance__glsl__functions__glsl-function-floor.html | 17 + ...ance__glsl__functions__glsl-function-fract.html | 17 + ...nce__glsl__functions__glsl-function-length.html | 17 + ...__glsl__functions__glsl-function-max-float.html | 17 + ...glsl__functions__glsl-function-max-gentype.html | 17 + ...__glsl__functions__glsl-function-min-float.html | 17 + ...glsl__functions__glsl-function-min-gentype.html | 17 + ...__glsl__functions__glsl-function-mix-float.html | 17 + ...glsl__functions__glsl-function-mix-gentype.html | 17 + ...__glsl__functions__glsl-function-mod-float.html | 17 + ...glsl__functions__glsl-function-mod-gentype.html | 17 + ...__glsl__functions__glsl-function-normalize.html | 17 + ...ce__glsl__functions__glsl-function-reflect.html | 17 + ...mance__glsl__functions__glsl-function-sign.html | 17 + ...rmance__glsl__functions__glsl-function-sin.html | 17 + ..._functions__glsl-function-smoothstep-float.html | 17 + ...unctions__glsl-function-smoothstep-gentype.html | 17 + ..._glsl__functions__glsl-function-step-float.html | 17 + ...lsl__functions__glsl-function-step-gentype.html | 17 + ...onformance__glsl__functions__glsl-function.html | 17 + ...rmance__glsl__implicit__add_int_float.vert.html | 17 + ...ormance__glsl__implicit__add_int_mat2.vert.html | 17 + ...ormance__glsl__implicit__add_int_mat3.vert.html | 17 + ...ormance__glsl__implicit__add_int_mat4.vert.html | 17 + ...ormance__glsl__implicit__add_int_vec2.vert.html | 17 + ...ormance__glsl__implicit__add_int_vec3.vert.html | 17 + ...ormance__glsl__implicit__add_int_vec4.vert.html | 17 + ...mance__glsl__implicit__add_ivec2_vec2.vert.html | 17 + ...mance__glsl__implicit__add_ivec3_vec3.vert.html | 17 + ...mance__glsl__implicit__add_ivec4_vec4.vert.html | 17 + ...__glsl__implicit__assign_int_to_float.vert.html | 17 + ..._glsl__implicit__assign_ivec2_to_vec2.vert.html | 17 + ..._glsl__implicit__assign_ivec3_to_vec3.vert.html | 17 + ..._glsl__implicit__assign_ivec4_to_vec4.vert.html | 17 + ...nce__glsl__implicit__construct_struct.vert.html | 17 + ...nce__glsl__implicit__divide_int_float.vert.html | 17 + ...ance__glsl__implicit__divide_int_mat2.vert.html | 17 + ...ance__glsl__implicit__divide_int_mat3.vert.html | 17 + ...ance__glsl__implicit__divide_int_mat4.vert.html | 17 + ...ance__glsl__implicit__divide_int_vec2.vert.html | 17 + ...ance__glsl__implicit__divide_int_vec3.vert.html | 17 + ...ance__glsl__implicit__divide_int_vec4.vert.html | 17 + ...ce__glsl__implicit__divide_ivec2_vec2.vert.html | 17 + ...ce__glsl__implicit__divide_ivec3_vec3.vert.html | 17 + ...ce__glsl__implicit__divide_ivec4_vec4.vert.html | 17 + ...ance__glsl__implicit__equal_int_float.vert.html | 17 + ...nce__glsl__implicit__equal_ivec2_vec2.vert.html | 17 + ...nce__glsl__implicit__equal_ivec3_vec3.vert.html | 17 + ...nce__glsl__implicit__equal_ivec4_vec4.vert.html | 17 + ...e__glsl__implicit__function_int_float.vert.html | 17 + ...__glsl__implicit__function_ivec2_vec2.vert.html | 17 + ...__glsl__implicit__function_ivec3_vec3.vert.html | 17 + ...__glsl__implicit__function_ivec4_vec4.vert.html | 17 + ...ormance__glsl__implicit__greater_than.vert.html | 17 + ...e__glsl__implicit__greater_than_equal.vert.html | 17 + ...onformance__glsl__implicit__less_than.vert.html | 17 + ...ance__glsl__implicit__less_than_equal.vert.html | 17 + ...e__glsl__implicit__multiply_int_float.vert.html | 17 + ...ce__glsl__implicit__multiply_int_mat2.vert.html | 17 + ...ce__glsl__implicit__multiply_int_mat3.vert.html | 17 + ...ce__glsl__implicit__multiply_int_mat4.vert.html | 17 + ...ce__glsl__implicit__multiply_int_vec2.vert.html | 17 + ...ce__glsl__implicit__multiply_int_vec3.vert.html | 17 + ...ce__glsl__implicit__multiply_int_vec4.vert.html | 17 + ...__glsl__implicit__multiply_ivec2_vec2.vert.html | 17 + ...__glsl__implicit__multiply_ivec3_vec3.vert.html | 17 + ...__glsl__implicit__multiply_ivec4_vec4.vert.html | 17 + ...__glsl__implicit__not_equal_int_float.vert.html | 17 + ..._glsl__implicit__not_equal_ivec2_vec2.vert.html | 17 + ..._glsl__implicit__not_equal_ivec3_vec3.vert.html | 17 + ..._glsl__implicit__not_equal_ivec4_vec4.vert.html | 17 + ...e__glsl__implicit__subtract_int_float.vert.html | 17 + ...ce__glsl__implicit__subtract_int_mat2.vert.html | 17 + ...ce__glsl__implicit__subtract_int_mat3.vert.html | 17 + ...ce__glsl__implicit__subtract_int_mat4.vert.html | 17 + ...ce__glsl__implicit__subtract_int_vec2.vert.html | 17 + ...ce__glsl__implicit__subtract_int_vec3.vert.html | 17 + ...ce__glsl__implicit__subtract_int_vec4.vert.html | 17 + ...__glsl__implicit__subtract_ivec2_vec2.vert.html | 17 + ...__glsl__implicit__subtract_ivec3_vec3.vert.html | 17 + ...__glsl__implicit__subtract_ivec4_vec4.vert.html | 17 + ...ce__glsl__implicit__ternary_int_float.vert.html | 17 + ...e__glsl__implicit__ternary_ivec2_vec2.vert.html | 17 + ...e__glsl__implicit__ternary_ivec3_vec3.vert.html | 17 + ...e__glsl__implicit__ternary_ivec4_vec4.vert.html | 17 + ...rmance__glsl__literals__float_literal.vert.html | 17 + ...ormance__glsl__literals__literal_precision.html | 17 + ...rmance__glsl__literals__overflow_leak.vert.html | 17 + ...ce__glsl__matrices__glsl-mat3-construction.html | 17 + ...ormance__glsl__matrices__glsl-mat4-to-mat3.html | 17 + ...__glsl__matrices__matrix-compound-multiply.html | 17 + ..._glsl__misc__attrib-location-length-limits.html | 17 + ...conformance__glsl__misc__boolean_precision.html | 17 + ..._glsl__misc__const-variable-initialization.html | 17 + ...isc__embedded-struct-definitions-forbidden.html | 17 + ...conformance__glsl__misc__empty-declaration.html | 17 + ...t_conformance__glsl__misc__empty_main.vert.html | 17 + ..._expression-list-in-declarator-initializer.html | 17 + ...rmance__glsl__misc__gl_position_unset.vert.html | 17 + ...formance__glsl__misc__global-variable-init.html | 17 + ...nformance__glsl__misc__glsl-function-nodes.html | 17 + ...ance__glsl__misc__glsl-long-variable-names.html | 17 + ...onformance__glsl__misc__glsl-vertex-branch.html | 17 + ...onformance__glsl__misc__large-loop-compile.html | 17 + ...mance__glsl__misc__non-ascii-comments.vert.html | 17 + ...st_conformance__glsl__misc__non-ascii.vert.html | 17 + ...onformance__glsl__misc__re-compile-re-link.html | 17 + ...__misc__sequence-operator-returns-constant.html | 17 + ...glsl__misc__shader-precision-format-obeyed.html | 17 + ...nformance__glsl__misc__shader-struct-scope.html | 17 + ..._misc__shader-uniform-packing-restrictions.html | 17 + ..._misc__shader-varying-packing-restrictions.html | 17 + ...sl__misc__shader-with-256-character-define.html | 17 + ..._shader-with-256-character-identifier.frag.html | 17 + ...sl__misc__shader-with-257-character-define.html | 17 + ..._shader-with-257-character-identifier.frag.html | 17 + ...__misc__shader-with-_webgl-identifier.vert.html | 17 + ..._misc__shader-with-arbitrary-indexing.frag.html | 17 + ..._misc__shader-with-arbitrary-indexing.vert.html | 17 + ...er-with-array-of-structs-containing-arrays.html | 17 + ...misc__shader-with-array-of-structs-uniform.html | 17 + ..._glsl__misc__shader-with-attrib-array.vert.html | 17 + ...glsl__misc__shader-with-attrib-struct.vert.html | 17 + ...e__glsl__misc__shader-with-clipvertex.vert.html | 17 + ...__glsl__misc__shader-with-comma-assignment.html | 17 + ...__shader-with-comma-conditional-assignment.html | 17 + ...with-comma-separated-variable-declarations.html | 17 + ...__shader-with-conditional-scoping-negative.html | 17 + ...lsl__misc__shader-with-conditional-scoping.html | 17 + ...__misc__shader-with-default-precision.frag.html | 17 + ...__misc__shader-with-default-precision.vert.html | 17 + ..._shader-with-define-line-continuation.frag.html | 17 + ...__glsl__misc__shader-with-dfdx-no-ext.frag.html | 17 + ...ormance__glsl__misc__shader-with-dfdx.frag.html | 17 + ...nformance__glsl__misc__shader-with-do-loop.html | 17 + ...e__glsl__misc__shader-with-error-directive.html | 17 + ...__misc__shader-with-explicit-int-cast.vert.html | 17 + ..._misc__shader-with-float-return-value.frag.html | 17 + ...formance__glsl__misc__shader-with-for-loop.html | 17 + ...mance__glsl__misc__shader-with-for-scoping.html | 17 + ...e__glsl__misc__shader-with-frag-depth.frag.html | 17 + ..._misc__shader-with-function-recursion.frag.html | 17 + ...__misc__shader-with-function-scoped-struct.html | 17 + ...glsl__misc__shader-with-functional-scoping.html | 17 + ...ance__glsl__misc__shader-with-glcolor.vert.html | 17 + ...mance__glsl__misc__shader-with-gles-1.frag.html | 17 + ...__glsl__misc__shader-with-gles-symbol.frag.html | 17 + ...er-with-global-variable-precision-mismatch.html | 17 + ..._misc__shader-with-glprojectionmatrix.vert.html | 17 + ...__misc__shader-with-hex-int-constant-macro.html | 17 + ...hader-with-implicit-vec3-to-vec4-cast.vert.html | 17 + ...ance__glsl__misc__shader-with-include.vert.html | 17 + ...l__misc__shader-with-int-return-value.frag.html | 17 + ..._misc__shader-with-invalid-identifier.frag.html | 17 + ..._misc__shader-with-ivec2-return-value.frag.html | 17 + ..._misc__shader-with-ivec3-return-value.frag.html | 17 + ..._misc__shader-with-ivec4-return-value.frag.html | 17 + ...l__misc__shader-with-limited-indexing.frag.html | 17 + ...ormance__glsl__misc__shader-with-long-line.html | 17 + ...sl__misc__shader-with-non-ascii-error.frag.html | 17 + ...glsl__misc__shader-with-non-reserved-words.html | 17 + ...ce__glsl__misc__shader-with-precision.frag.html | 17 + ..._misc__shader-with-preprocessor-whitespace.html | 17 + ..._glsl__misc__shader-with-quoted-error.frag.html | 17 + ...ce__glsl__misc__shader-with-reserved-words.html | 17 + ...sc__shader-with-short-circuiting-operators.html | 17 + ...c__shader-with-similar-uniform-array-names.html | 17 + ..._glsl__misc__shader-with-too-many-uniforms.html | 17 + ...l__misc__shader-with-two-initializer-types.html | 17 + ...er-with-undefined-preprocessor-symbol.frag.html | 17 + ...shader-with-uniform-in-loop-condition.vert.html | 17 + ...__misc__shader-with-vec2-return-value.frag.html | 17 + ...__misc__shader-with-vec3-return-value.frag.html | 17 + ...__misc__shader-with-vec4-return-value.frag.html | 17 + ...sc__shader-with-vec4-vec3-vec4-conditional.html | 17 + ...__glsl__misc__shader-with-version-100.frag.html | 17 + ...__glsl__misc__shader-with-version-100.vert.html | 17 + ...__glsl__misc__shader-with-version-120.vert.html | 17 + ...__glsl__misc__shader-with-version-130.vert.html | 17 + ...l__misc__shader-with-webgl-identifier.vert.html | 17 + ...rmance__glsl__misc__shader-with-while-loop.html | 17 + ..._glsl__misc__shader-without-precision.frag.html | 17 + ...s-with-constant-expression-loop-conditions.html | 17 + ...mance__glsl__misc__shaders-with-invariance.html | 17 + ...__misc__shaders-with-mis-matching-uniforms.html | 17 + ...__misc__shaders-with-mis-matching-varyings.html | 17 + ..._glsl__misc__shaders-with-missing-varyings.html | 17 + ...e__glsl__misc__shaders-with-name-conflicts.html | 17 + ...__glsl__misc__shaders-with-uniform-structs.html | 17 + ...ormance__glsl__misc__shaders-with-varyings.html | 17 + .../test_conformance__glsl__misc__shared.html | 17 + ...est_conformance__glsl__misc__struct-assign.html | 17 + ...est_conformance__glsl__misc__struct-equals.html | 17 + ...glsl__misc__struct-mixed-array-declarators.html | 17 + ...glsl__misc__struct-nesting-exceeds-maximum.html | 17 + ...sl__misc__struct-nesting-of-variable-names.html | 17 + ...__glsl__misc__struct-nesting-under-maximum.html | 17 + ..._glsl__misc__struct-specifiers-in-uniforms.html | 17 + ...rmance__glsl__misc__struct-unary-operators.html | 17 + ...ce__glsl__misc__ternary-operator-on-arrays.html | 17 + ...__ternary-operators-in-global-initializers.html | 17 + ...l__misc__ternary-operators-in-initializers.html | 17 + ...glsl__misc__uniform-location-length-limits.html | 17 + ...ormance__glsl__reserved___webgl_field.vert.html | 17 + ...ance__glsl__reserved___webgl_function.vert.html | 17 + ...rmance__glsl__reserved___webgl_struct.vert.html | 17 + ...ance__glsl__reserved___webgl_variable.vert.html | 17 + ...formance__glsl__reserved__webgl_field.vert.html | 17 + ...mance__glsl__reserved__webgl_function.vert.html | 17 + ...ormance__glsl__reserved__webgl_struct.vert.html | 17 + ...mance__glsl__reserved__webgl_variable.vert.html | 17 + ...sl__samplers__glsl-function-texture2d-bias.html | 17 + ...glsl__samplers__glsl-function-texture2dlod.html | 17 + ...lsl__samplers__glsl-function-texture2dproj.html | 17 + ...__samplers__glsl-function-texture2dprojlod.html | 17 + ...e__glsl__variables__gl-fragcoord-xy-values.html | 17 + ...conformance__glsl__variables__gl-fragcoord.html | 17 + ...glsl__variables__gl-fragdata-and-fragcolor.html | 17 + ...nformance__glsl__variables__gl-frontfacing.html | 17 + ...onformance__glsl__variables__gl-pointcoord.html | 17 + ...nformance__glsl__variables__glsl-built-ins.html | 17 + .../test_conformance__limits__gl-line-width.html | 17 + ...ormance__limits__gl-max-texture-dimensions.html | 17 + .../test_conformance__limits__gl-min-attribs.html | 17 + .../test_conformance__limits__gl-min-textures.html | 17 + .../test_conformance__limits__gl-min-uniforms.html | 17 + ...test_conformance__misc__bad-arguments-test.html | 17 + ...ormance__misc__boolean-argument-conversion.html | 17 + .../test_conformance__misc__delayed-drawing.html | 17 + .../test_conformance__misc__error-reporting.html | 17 + .../test_conformance__misc__expando-loss.html | 17 + ...ormance__misc__functions-returning-strings.html | 17 + .../test_conformance__misc__instanceof-test.html | 17 + ...t_conformance__misc__invalid-passed-params.html | 17 + .../test_conformance__misc__is-object.html | 17 + ...t_conformance__misc__null-object-behaviour.html | 17 + ...nformance__misc__object-deletion-behaviour.html | 17 + ...conformance__misc__shader-precision-format.html | 17 + ...st_conformance__misc__type-conversion-test.html | 17 + ...test_conformance__misc__uninitialized-test.html | 17 + .../test_conformance__misc__webgl-specific.html | 17 + ..._conformance__more__conformance__constants.html | 17 + ...conformance__more__conformance__getContext.html | 17 + ...st_conformance__more__conformance__methods.html | 17 + ...rmance__more__conformance__quickCheckAPI-A.html | 17 + ...mance__more__conformance__quickCheckAPI-B1.html | 17 + ...mance__more__conformance__quickCheckAPI-B2.html | 17 + ...mance__more__conformance__quickCheckAPI-B3.html | 17 + ...mance__more__conformance__quickCheckAPI-B4.html | 17 + ...rmance__more__conformance__quickCheckAPI-C.html | 17 + ...ance__more__conformance__quickCheckAPI-D_G.html | 17 + ...ance__more__conformance__quickCheckAPI-G_I.html | 17 + ...ance__more__conformance__quickCheckAPI-L_S.html | 17 + ...ance__more__conformance__quickCheckAPI-S_V.html | 17 + ...onformance__more__conformance__webGLArrays.html | 17 + ...t_conformance__more__functions__bindBuffer.html | 17 + ...rmance__more__functions__bindBufferBadArgs.html | 17 + ...re__functions__bindFramebufferLeaveNonZero.html | 17 + ...t_conformance__more__functions__bufferData.html | 17 + ...rmance__more__functions__bufferDataBadArgs.html | 17 + ...onformance__more__functions__bufferSubData.html | 17 + ...nce__more__functions__bufferSubDataBadArgs.html | 17 + ...nformance__more__functions__copyTexImage2D.html | 17 + ...ce__more__functions__copyTexImage2DBadArgs.html | 17 + ...rmance__more__functions__copyTexSubImage2D.html | 17 + ..._more__functions__copyTexSubImage2DBadArgs.html | 17 + ...ance__more__functions__deleteBufferBadArgs.html | 17 + ...t_conformance__more__functions__drawArrays.html | 17 + ...ce__more__functions__drawArraysOutOfBounds.html | 17 + ...conformance__more__functions__drawElements.html | 17 + ...ance__more__functions__drawElementsBadArgs.html | 17 + ...test_conformance__more__functions__isTests.html | 17 + ...nformance__more__functions__isTestsBadArgs.html | 17 + ...t_conformance__more__functions__readPixels.html | 17 + ...rmance__more__functions__readPixelsBadArgs.html | 17 + ...t_conformance__more__functions__texImage2D.html | 17 + ...rmance__more__functions__texImage2DBadArgs.html | 17 + ...nformance__more__functions__texImage2DHTML.html | 17 + ...ce__more__functions__texImage2DHTMLBadArgs.html | 17 + ...onformance__more__functions__texSubImage2D.html | 17 + ...nce__more__functions__texSubImage2DBadArgs.html | 17 + ...rmance__more__functions__texSubImage2DHTML.html | 17 + ..._more__functions__texSubImage2DHTMLBadArgs.html | 17 + ...onformance__more__functions__uniformMatrix.html | 17 + ...nce__more__functions__uniformMatrixBadArgs.html | 17 + ...est_conformance__more__functions__uniformf.html | 17 + ...rmance__more__functions__uniformfArrayLen1.html | 17 + ...formance__more__functions__uniformfBadArgs.html | 17 + ...est_conformance__more__functions__uniformi.html | 17 + ...formance__more__functions__uniformiBadArgs.html | 17 + ...conformance__more__functions__vertexAttrib.html | 17 + ...ance__more__functions__vertexAttribBadArgs.html | 17 + ...ance__more__functions__vertexAttribPointer.html | 17 + ...ore__functions__vertexAttribPointerBadArgs.html | 17 + ..._conformance__more__glsl__arrayOutOfBounds.html | 17 + ...onformance__more__glsl__uniformOutOfBounds.html | 17 + ...onformance__ogles__GL__abs__abs_001_to_006.html | 17 + ...formance__ogles__GL__acos__acos_001_to_006.html | 17 + ...onformance__ogles__GL__all__all_001_to_004.html | 17 + ...onformance__ogles__GL__any__any_001_to_004.html | 17 + ...rmance__ogles__GL__array__array_001_to_006.html | 17 + ...formance__ogles__GL__asin__asin_001_to_006.html | 17 + ...formance__ogles__GL__atan__atan_001_to_008.html | 17 + ...formance__ogles__GL__atan__atan_009_to_012.html | 17 + ...s__GL__biConstants__biConstants_001_to_008.html | 17 + ...s__GL__biConstants__biConstants_009_to_016.html | 17 + ...L__biuDepthRange__biuDepthRange_001_to_002.html | 17 + ...rmance__ogles__GL__build__build_001_to_008.html | 17 + ...rmance__ogles__GL__build__build_009_to_016.html | 17 + ...rmance__ogles__GL__build__build_017_to_024.html | 17 + ...rmance__ogles__GL__build__build_025_to_032.html | 17 + ...rmance__ogles__GL__build__build_033_to_040.html | 17 + ...rmance__ogles__GL__build__build_041_to_048.html | 17 + ...rmance__ogles__GL__build__build_049_to_056.html | 17 + ...rmance__ogles__GL__build__build_057_to_064.html | 17 + ...rmance__ogles__GL__build__build_065_to_072.html | 17 + ...rmance__ogles__GL__build__build_073_to_080.html | 17 + ...rmance__ogles__GL__build__build_081_to_088.html | 17 + ...rmance__ogles__GL__build__build_089_to_096.html | 17 + ...rmance__ogles__GL__build__build_097_to_104.html | 17 + ...rmance__ogles__GL__build__build_105_to_112.html | 17 + ...rmance__ogles__GL__build__build_113_to_120.html | 17 + ...rmance__ogles__GL__build__build_121_to_128.html | 17 + ...rmance__ogles__GL__build__build_129_to_136.html | 17 + ...rmance__ogles__GL__build__build_137_to_144.html | 17 + ...rmance__ogles__GL__build__build_145_to_152.html | 17 + ...rmance__ogles__GL__build__build_153_to_160.html | 17 + ...rmance__ogles__GL__build__build_161_to_168.html | 17 + ...rmance__ogles__GL__build__build_169_to_176.html | 17 + ...rmance__ogles__GL__build__build_177_to_178.html | 17 + ..._in_varying_array_out_of_bounds_001_to_001.html | 17 + ...formance__ogles__GL__ceil__ceil_001_to_006.html | 17 + ...rmance__ogles__GL__clamp__clamp_001_to_006.html | 17 + ..._GL__control_flow__control_flow_001_to_008.html | 17 + ..._GL__control_flow__control_flow_009_to_010.html | 17 + ...onformance__ogles__GL__cos__cos_001_to_006.html | 17 + ...rmance__ogles__GL__cross__cross_001_to_002.html | 17 + ...ce__ogles__GL__default__default_001_to_001.html | 17 + ...ce__ogles__GL__degrees__degrees_001_to_006.html | 17 + ...ce__ogles__GL__discard__discard_001_to_002.html | 17 + ...__ogles__GL__distance__distance_001_to_006.html | 17 + ...onformance__ogles__GL__dot__dot_001_to_006.html | 17 + ...rmance__ogles__GL__equal__equal_001_to_008.html | 17 + ...rmance__ogles__GL__equal__equal_009_to_012.html | 17 + ...formance__ogles__GL__exp2__exp2_001_to_008.html | 17 + ...formance__ogles__GL__exp2__exp2_009_to_012.html | 17 + ...onformance__ogles__GL__exp__exp_001_to_008.html | 17 + ...onformance__ogles__GL__exp__exp_009_to_012.html | 17 + ...s__GL__faceforward__faceforward_001_to_006.html | 17 + ...rmance__ogles__GL__floor__floor_001_to_006.html | 17 + ...rmance__ogles__GL__fract__fract_001_to_006.html | 17 + ...ogles__GL__functions__functions_001_to_008.html | 17 + ...ogles__GL__functions__functions_009_to_016.html | 17 + ...ogles__GL__functions__functions_017_to_024.html | 17 + ...ogles__GL__functions__functions_025_to_032.html | 17 + ...ogles__GL__functions__functions_033_to_040.html | 17 + ...ogles__GL__functions__functions_041_to_048.html | 17 + ...ogles__GL__functions__functions_049_to_056.html | 17 + ...ogles__GL__functions__functions_057_to_064.html | 17 + ...ogles__GL__functions__functions_065_to_072.html | 17 + ...ogles__GL__functions__functions_073_to_080.html | 17 + ...ogles__GL__functions__functions_081_to_088.html | 17 + ...ogles__GL__functions__functions_089_to_096.html | 17 + ...ogles__GL__functions__functions_097_to_104.html | 17 + ...ogles__GL__functions__functions_105_to_112.html | 17 + ...ogles__GL__functions__functions_113_to_120.html | 17 + ...ogles__GL__functions__functions_121_to_126.html | 17 + ..._GL__gl_FragCoord__gl_FragCoord_001_to_003.html | 17 + ..._gl_FrontFacing__gl_FrontFacing_001_to_001.html | 17 + ...aterThanEqual__greaterThanEqual_001_to_008.html | 17 + ...s__GL__greaterThan__greaterThan_001_to_008.html | 17 + ...s__GL__inversesqrt__inversesqrt_001_to_006.html | 17 + ...ance__ogles__GL__length__length_001_to_006.html | 17 + ...L__lessThanEqual__lessThanEqual_001_to_008.html | 17 + ...__ogles__GL__lessThan__lessThan_001_to_008.html | 17 + ...formance__ogles__GL__log2__log2_001_to_008.html | 17 + ...formance__ogles__GL__log2__log2_009_to_012.html | 17 + ...onformance__ogles__GL__log__log_001_to_008.html | 17 + ...onformance__ogles__GL__log__log_009_to_012.html | 17 + ...formance__ogles__GL__mat3__mat3_001_to_006.html | 17 + ...onformance__ogles__GL__mat__mat_001_to_008.html | 17 + ...onformance__ogles__GL__mat__mat_009_to_016.html | 17 + ...onformance__ogles__GL__mat__mat_017_to_024.html | 17 + ...onformance__ogles__GL__mat__mat_025_to_032.html | 17 + ...onformance__ogles__GL__mat__mat_033_to_040.html | 17 + ...onformance__ogles__GL__mat__mat_041_to_046.html | 17 + ..._matrixCompMult__matrixCompMult_001_to_004.html | 17 + ...onformance__ogles__GL__max__max_001_to_006.html | 17 + ...onformance__ogles__GL__min__min_001_to_006.html | 17 + ...onformance__ogles__GL__mix__mix_001_to_006.html | 17 + ...onformance__ogles__GL__mod__mod_001_to_008.html | 17 + ...ogles__GL__normalize__normalize_001_to_006.html | 17 + ...__ogles__GL__notEqual__notEqual_001_to_008.html | 17 + ...__ogles__GL__notEqual__notEqual_009_to_012.html | 17 + ...onformance__ogles__GL__not__not_001_to_004.html | 17 + ...ogles__GL__operators__operators_001_to_008.html | 17 + ...ogles__GL__operators__operators_009_to_016.html | 17 + ...ogles__GL__operators__operators_017_to_024.html | 17 + ...ogles__GL__operators__operators_025_to_026.html | 17 + ...onformance__ogles__GL__pow__pow_001_to_008.html | 17 + ...onformance__ogles__GL__pow__pow_009_to_016.html | 17 + ...onformance__ogles__GL__pow__pow_017_to_024.html | 17 + ...ce__ogles__GL__radians__radians_001_to_006.html | 17 + ...ce__ogles__GL__reflect__reflect_001_to_006.html | 17 + ...ce__ogles__GL__refract__refract_001_to_006.html | 17 + ...formance__ogles__GL__sign__sign_001_to_006.html | 17 + ...onformance__ogles__GL__sin__sin_001_to_006.html | 17 + ...les__GL__smoothstep__smoothstep_001_to_006.html | 17 + ...formance__ogles__GL__sqrt__sqrt_001_to_006.html | 17 + ...formance__ogles__GL__step__step_001_to_006.html | 17 + ...ance__ogles__GL__struct__struct_001_to_008.html | 17 + ...ance__ogles__GL__struct__struct_009_to_016.html | 17 + ...ance__ogles__GL__struct__struct_017_to_024.html | 17 + ...ance__ogles__GL__struct__struct_025_to_032.html | 17 + ...ance__ogles__GL__struct__struct_033_to_040.html | 17 + ...ance__ogles__GL__struct__struct_041_to_048.html | 17 + ...ance__ogles__GL__struct__struct_049_to_056.html | 17 + ...ogles__GL__swizzlers__swizzlers_001_to_008.html | 17 + ...ogles__GL__swizzlers__swizzlers_009_to_016.html | 17 + ...ogles__GL__swizzlers__swizzlers_017_to_024.html | 17 + ...ogles__GL__swizzlers__swizzlers_025_to_032.html | 17 + ...ogles__GL__swizzlers__swizzlers_033_to_040.html | 17 + ...ogles__GL__swizzlers__swizzlers_041_to_048.html | 17 + ...ogles__GL__swizzlers__swizzlers_049_to_056.html | 17 + ...ogles__GL__swizzlers__swizzlers_057_to_064.html | 17 + ...ogles__GL__swizzlers__swizzlers_065_to_072.html | 17 + ...ogles__GL__swizzlers__swizzlers_073_to_080.html | 17 + ...ogles__GL__swizzlers__swizzlers_081_to_088.html | 17 + ...ogles__GL__swizzlers__swizzlers_089_to_096.html | 17 + ...ogles__GL__swizzlers__swizzlers_097_to_104.html | 17 + ...ogles__GL__swizzlers__swizzlers_105_to_112.html | 17 + ...ogles__GL__swizzlers__swizzlers_113_to_120.html | 17 + ...onformance__ogles__GL__tan__tan_001_to_006.html | 17 + ...formance__ogles__GL__vec3__vec3_001_to_008.html | 17 + ...onformance__ogles__GL__vec__vec_001_to_008.html | 17 + ...onformance__ogles__GL__vec__vec_009_to_016.html | 17 + ...onformance__ogles__GL__vec__vec_017_to_018.html | 17 + ...est_conformance__programs__get-active-test.html | 17 + ...s__gl-bind-attrib-location-long-names-test.html | 17 + ...ce__programs__gl-bind-attrib-location-test.html | 17 + ...ormance__programs__gl-get-active-attribute.html | 17 + ...nformance__programs__gl-get-active-uniform.html | 17 + ..._conformance__programs__gl-getshadersource.html | 17 + ...test_conformance__programs__gl-shader-test.html | 17 + ...test_conformance__programs__invalid-UTF-16.html | 17 + ...est_conformance__programs__program-infolog.html | 17 + .../test_conformance__programs__program-test.html | 17 + ...gram-crash-with-discard-in-fragment-shader.html | 17 + ...mance__reading__read-pixels-pack-alignment.html | 17 + ...est_conformance__reading__read-pixels-test.html | 17 + ..._conformance__renderbuffers__feedback-loop.html | 17 + ...nderbuffers__framebuffer-object-attachment.html | 17 + ...nderbuffers__framebuffer-state-restoration.html | 17 + ...nformance__renderbuffers__framebuffer-test.html | 17 + ...renderbuffers__renderbuffer-initialization.html | 17 + ...nformance__rendering__clipping-wide-points.html | 17 + .../test_conformance__rendering__culling.html | 17 + ...mance__rendering__default-texture-draw-bug.html | 17 + ...ance__rendering__draw-arrays-out-of-bounds.html | 17 + ...ce__rendering__draw-elements-out-of-bounds.html | 17 + ...ering__draw-with-changing-start-vertex-bug.html | 17 + ...conformance__rendering__framebuffer-switch.html | 17 + ...nce__rendering__framebuffer-texture-switch.html | 17 + .../test_conformance__rendering__gl-clear.html | 17 + ...test_conformance__rendering__gl-drawarrays.html | 17 + ...st_conformance__rendering__gl-drawelements.html | 17 + ...e__rendering__gl-scissor-canvas-dimensions.html | 17 + ...onformance__rendering__gl-scissor-fbo-test.html | 17 + ...st_conformance__rendering__gl-scissor-test.html | 17 + ...t_conformance__rendering__gl-viewport-test.html | 17 + ..._conformance__rendering__line-loop-tri-fan.html | 17 + ...st_conformance__rendering__many-draw-calls.html | 17 + ...rmance__rendering__more-than-65536-indices.html | 17 + ...ormance__rendering__multisample-corruption.html | 17 + ...conformance__rendering__negative-one-index.html | 17 + ...ce__rendering__out-of-bounds-index-buffers.html | 17 + ...onformance__rendering__point-no-attributes.html | 17 + .../test_conformance__rendering__point-size.html | 17 + ...rendering__point-specific-shader-variables.html | 17 + ...oint-with-gl-pointcoord-in-fragment-shader.html | 17 + ...est_conformance__rendering__polygon-offset.html | 17 + .../test_conformance__rendering__simple.html | 17 + .../test_conformance__rendering__triangle.html | 17 + ...st_conformance__state__gl-enable-enum-test.html | 17 + .../test_conformance__state__gl-enum-tests.html | 17 + .../test_conformance__state__gl-get-calls.html | 17 + .../test_conformance__state__gl-geterror.html | 17 + .../test_conformance__state__gl-getstring.html | 17 + .../test_conformance__state__gl-initial-state.html | 17 + ...st_conformance__state__gl-object-get-calls.html | 17 + ..._state__state-uneffected-after-compositing.html | 17 + ...ures__canvas__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...anvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...es__canvas__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...ub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...angle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ..._rectangle__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...tures__image__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...res__image__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...__image_data__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ..._data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...image_data__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...a__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...a__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...ance__textures__misc__compressed-tex-image.html | 17 + ..._textures__misc__copy-tex-image-2d-formats.html | 17 + ...res__misc__copy-tex-image-and-sub-image-2d.html | 17 + ...isc__copy-tex-sub-image-2d-partial-texture.html | 17 + ...mance__textures__misc__cube-incomplete-fbo.html | 17 + ...nformance__textures__misc__default-texture.html | 17 + ...ance__textures__misc__gl-get-tex-parameter.html | 17 + ...onformance__textures__misc__gl-pixelstorei.html | 17 + ...t_conformance__textures__misc__gl-teximage.html | 17 + ...st_conformance__textures__misc__mipmap-fbo.html | 17 + ...__textures__misc__origin-clean-conformance.html | 17 + ...ge-and-sub-image-2d-with-array-buffer-view.html | 17 + ...__misc__tex-image-and-uniform-binding-bugs.html | 17 + ...extures__misc__tex-image-canvas-corruption.html | 17 + ...nformance__textures__misc__tex-image-webgl.html | 17 + ...ures__misc__tex-image-with-format-and-type.html | 17 + ...extures__misc__tex-image-with-invalid-data.html | 17 + ...ance__textures__misc__tex-input-validation.html | 17 + ..._textures__misc__tex-sub-image-2d-bad-args.html | 17 + ...formance__textures__misc__tex-sub-image-2d.html | 17 + ...ormance__textures__misc__texparameter-test.html | 17 + ...nce__textures__misc__texture-active-bind-2.html | 17 + ...mance__textures__misc__texture-active-bind.html | 17 + ...textures__misc__texture-attachment-formats.html | 17 + ...conformance__textures__misc__texture-clear.html | 17 + ...formance__textures__misc__texture-complete.html | 17 + ...ures__misc__texture-copying-feedback-loops.html | 17 + ...ures__misc__texture-cube-as-fbo-attachment.html | 17 + ...tures__misc__texture-draw-with-2d-and-cube.html | 17 + ...ormance__textures__misc__texture-fakeblack.html | 17 + ...ance__textures__misc__texture-formats-test.html | 17 + ...onformance__textures__misc__texture-hd-dpi.html | 17 + ..._conformance__textures__misc__texture-mips.html | 17 + ...rmance__textures__misc__texture-npot-video.html | 17 + ..._conformance__textures__misc__texture-npot.html | 17 + ...ce__textures__misc__texture-size-cube-maps.html | 17 + ...rmance__textures__misc__texture-size-limit.html | 17 + ..._conformance__textures__misc__texture-size.html | 17 + ...extures__misc__texture-sub-image-cube-maps.html | 17 + ...sc__texture-transparent-pixels-initialized.html | 17 + ...__textures__misc__texture-upload-cube-maps.html | 17 + ...mance__textures__misc__texture-upload-size.html | 17 + ...s__svg_image__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ..._svg_image__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...e__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...tures__video__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...res__video__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...o__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...o__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html | 17 + ...anvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html | 17 + ...bgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html | 17 + ...s__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html | 17 + ...nformance__typedarrays__array-buffer-crash.html | 17 + ...ance__typedarrays__array-buffer-view-crash.html | 17 + ...ance__typedarrays__array-large-array-tests.html | 17 + ...conformance__typedarrays__array-unit-tests.html | 17 + ..._conformance__typedarrays__data-view-crash.html | 17 + ...t_conformance__typedarrays__data-view-test.html | 17 + ...ance__typedarrays__typed-arrays-in-workers.html | 17 + ...t_conformance__uniforms__gl-uniform-arrays.html | 17 + ...est_conformance__uniforms__gl-uniform-bool.html | 17 + ...conformance__uniforms__gl-uniformmatrix4fv.html | 17 + ..._conformance__uniforms__gl-unknown-uniform.html | 17 + ...nformance__uniforms__null-uniform-location.html | 17 + ...iforms__out-of-bounds-uniform-array-access.html | 17 + ...formance__uniforms__uniform-default-values.html | 17 + ...st_conformance__uniforms__uniform-location.html | 17 + ...nformance__uniforms__uniform-samplers-test.html | 17 + ...ance__uniforms__uniform-values-per-program.html | 17 + dom/canvas/test/webgl-conf/iframe-passthrough.css | 36 + dom/canvas/test/webgl-conf/mochi-single.html | 65 + .../test/webgl-conf/mochi-wrapper.html.template | 17 + dom/canvas/test/webgl-conf/mochitest-errata.ini | 913 + dom/canvas/test/webgl-conf/mochitest.ini.template | 10 + dom/canvas/test/webgl-mochitest/driver-info.js | 169 + .../test/webgl-mochitest/ensure-exts/ensure-ext.js | 44 + .../ensure-exts/test_ANGLE_instanced_arrays.html | 17 + .../ensure-exts/test_EXT_blend_minmax.html | 17 + .../test_EXT_color_buffer_half_float.html | 17 + .../ensure-exts/test_EXT_disjoint_timer_query.html | 17 + .../ensure-exts/test_EXT_frag_depth.html | 17 + .../webgl-mochitest/ensure-exts/test_EXT_sRGB.html | 17 + .../ensure-exts/test_EXT_shader_texture_lod.html | 17 + .../test_EXT_texture_filter_anisotropic.html | 17 + .../ensure-exts/test_OES_standard_derivatives.html | 17 + .../ensure-exts/test_WEBGL_color_buffer_float.html | 17 + .../test_WEBGL_compressed_texture_atc.html | 17 + .../test_WEBGL_compressed_texture_es3.html | 19 + .../test_WEBGL_compressed_texture_etc1.html | 17 + .../test_WEBGL_compressed_texture_pvrtc.html | 17 + .../test_WEBGL_compressed_texture_s3tc.html | 17 + .../ensure-exts/test_WEBGL_depth_texture.html | 17 + .../ensure-exts/test_WEBGL_draw_buffers.html | 17 + .../webgl-mochitest/ensure-exts/test_common.html | 110 + dom/canvas/test/webgl-mochitest/es3-data.js | 4719 ++++ .../test/webgl-mochitest/mochi-to-testcase.py | 101 + dom/canvas/test/webgl-mochitest/mochitest.ini | 96 + .../webgl-mochitest/regress/test_bug_1268096.html | 140 + .../webgl-mochitest/test_backbuffer_channels.html | 111 + dom/canvas/test/webgl-mochitest/test_backends.html | 169 + .../test/webgl-mochitest/test_canvas_size.html | 54 + dom/canvas/test/webgl-mochitest/test_capture.html | 207 + .../test_cubemap_must_be_square.html | 35 + .../webgl-mochitest/test_depth_readpixels.html | 60 + .../webgl-mochitest/test_depth_tex_lazy_clear.html | 73 + dom/canvas/test/webgl-mochitest/test_draw.html | 131 + dom/canvas/test/webgl-mochitest/test_fb_param.html | 54 + .../test/webgl-mochitest/test_fb_param_crash.html | 48 + .../test/webgl-mochitest/test_fuzzing_bugs.html | 159 + .../test/webgl-mochitest/test_hidden_alpha.html | 156 + .../webgl-mochitest/test_hidden_depth_stencil.html | 159 + dom/canvas/test/webgl-mochitest/test_highp_fs.html | 61 + .../test_implicit_color_buffer_float.html | 199 + .../test/webgl-mochitest/test_no_arr_points.html | 169 + .../test/webgl-mochitest/test_noprog_draw.html | 80 + .../webgl-mochitest/test_pixel_pack_buffer.html | 288 + .../test/webgl-mochitest/test_privileged_exts.html | 32 + .../webgl-mochitest/test_renderer_strings.html | 102 + .../test/webgl-mochitest/test_sab_with_webgl.html | 192 + .../webgl-mochitest/test_texsubimage_float.html | 62 + .../test/webgl-mochitest/test_uninit_data.html | 84 + .../test_webgl2_alpha_luminance.html | 114 + .../test_webgl2_invalidate_framebuffer.html | 27 + .../webgl-mochitest/test_webgl2_not_exposed.html | 37 + .../test/webgl-mochitest/test_webgl_available.html | 19 + .../test_webgl_color_buffer_float.html | 486 + .../test_webgl_compressed_texture_es3.html | 753 + .../webgl-mochitest/test_webgl_conformance.html | 29 + .../webgl-mochitest/test_webgl_force_enable.html | 50 + .../test_webgl_request_context.html | 36 + .../test_webgl_request_mismatch.html | 90 + .../test_webglcontextcreationerror.html | 66 + dom/canvas/test/webgl-mochitest/webgl-util.js | 170 + 7365 files changed, 730956 insertions(+) create mode 100644 dom/canvas/CanvasGradient.h create mode 100644 dom/canvas/CanvasImageCache.cpp create mode 100644 dom/canvas/CanvasImageCache.h create mode 100644 dom/canvas/CanvasPath.h create mode 100644 dom/canvas/CanvasPattern.h create mode 100644 dom/canvas/CanvasRenderingContext2D.cpp create mode 100644 dom/canvas/CanvasRenderingContext2D.h create mode 100644 dom/canvas/CanvasRenderingContextHelper.cpp create mode 100644 dom/canvas/CanvasRenderingContextHelper.h create mode 100644 dom/canvas/CanvasUtils.cpp create mode 100644 dom/canvas/CanvasUtils.h create mode 100644 dom/canvas/DocumentRendererChild.cpp create mode 100644 dom/canvas/DocumentRendererChild.h create mode 100644 dom/canvas/DocumentRendererParent.cpp create mode 100644 dom/canvas/DocumentRendererParent.h create mode 100644 dom/canvas/ImageBitmap.cpp create mode 100644 dom/canvas/ImageBitmap.h create mode 100644 dom/canvas/ImageBitmapColorUtils.cpp create mode 100644 dom/canvas/ImageBitmapColorUtils.h create mode 100644 dom/canvas/ImageBitmapRenderingContext.cpp create mode 100644 dom/canvas/ImageBitmapRenderingContext.h create mode 100644 dom/canvas/ImageBitmapSource.h create mode 100644 dom/canvas/ImageBitmapUtils.cpp create mode 100644 dom/canvas/ImageBitmapUtils.h create mode 100644 dom/canvas/ImageData.cpp create mode 100644 dom/canvas/ImageData.h create mode 100644 dom/canvas/ImageUtils.cpp create mode 100644 dom/canvas/ImageUtils.h create mode 100644 dom/canvas/MurmurHash3.cpp create mode 100644 dom/canvas/MurmurHash3.h create mode 100644 dom/canvas/OffscreenCanvas.cpp create mode 100644 dom/canvas/OffscreenCanvas.h create mode 100644 dom/canvas/TexUnpackBlob.cpp create mode 100644 dom/canvas/TexUnpackBlob.h create mode 100644 dom/canvas/TextMetrics.h create mode 100644 dom/canvas/WebGL1Context.cpp create mode 100644 dom/canvas/WebGL1Context.h create mode 100644 dom/canvas/WebGL1ContextUniforms.cpp create mode 100644 dom/canvas/WebGL2Context.cpp create mode 100644 dom/canvas/WebGL2Context.h create mode 100644 dom/canvas/WebGL2ContextBuffers.cpp create mode 100644 dom/canvas/WebGL2ContextFramebuffers.cpp create mode 100644 dom/canvas/WebGL2ContextMRTs.cpp create mode 100644 dom/canvas/WebGL2ContextPrograms.cpp create mode 100644 dom/canvas/WebGL2ContextQueries.cpp create mode 100644 dom/canvas/WebGL2ContextRenderbuffers.cpp create mode 100644 dom/canvas/WebGL2ContextSamplers.cpp create mode 100644 dom/canvas/WebGL2ContextState.cpp create mode 100644 dom/canvas/WebGL2ContextSync.cpp create mode 100644 dom/canvas/WebGL2ContextTextures.cpp create mode 100644 dom/canvas/WebGL2ContextTransformFeedback.cpp create mode 100644 dom/canvas/WebGL2ContextUniforms.cpp create mode 100644 dom/canvas/WebGL2ContextVAOs.cpp create mode 100644 dom/canvas/WebGL2ContextVertices.cpp create mode 100644 dom/canvas/WebGLActiveInfo.cpp create mode 100644 dom/canvas/WebGLActiveInfo.h create mode 100644 dom/canvas/WebGLBuffer.cpp create mode 100644 dom/canvas/WebGLBuffer.h create mode 100644 dom/canvas/WebGLContext.cpp create mode 100644 dom/canvas/WebGLContext.h create mode 100644 dom/canvas/WebGLContextBuffers.cpp create mode 100644 dom/canvas/WebGLContextDraw.cpp create mode 100644 dom/canvas/WebGLContextExtensions.cpp create mode 100644 dom/canvas/WebGLContextFramebufferOperations.cpp create mode 100644 dom/canvas/WebGLContextGL.cpp create mode 100644 dom/canvas/WebGLContextLossHandler.cpp create mode 100644 dom/canvas/WebGLContextLossHandler.h create mode 100644 dom/canvas/WebGLContextNotSupported.cpp create mode 100644 dom/canvas/WebGLContextState.cpp create mode 100644 dom/canvas/WebGLContextTextures.cpp create mode 100644 dom/canvas/WebGLContextUnchecked.cpp create mode 100644 dom/canvas/WebGLContextUnchecked.h create mode 100644 dom/canvas/WebGLContextUtils.cpp create mode 100644 dom/canvas/WebGLContextUtils.h create mode 100644 dom/canvas/WebGLContextValidate.cpp create mode 100644 dom/canvas/WebGLContextVertexArray.cpp create mode 100644 dom/canvas/WebGLContextVertices.cpp create mode 100644 dom/canvas/WebGLElementArrayCache.cpp create mode 100644 dom/canvas/WebGLElementArrayCache.h create mode 100644 dom/canvas/WebGLExtensionBase.cpp create mode 100644 dom/canvas/WebGLExtensionBlendMinMax.cpp create mode 100644 dom/canvas/WebGLExtensionColorBufferFloat.cpp create mode 100644 dom/canvas/WebGLExtensionColorBufferHalfFloat.cpp create mode 100644 dom/canvas/WebGLExtensionCompressedTextureATC.cpp create mode 100644 dom/canvas/WebGLExtensionCompressedTextureES3.cpp create mode 100644 dom/canvas/WebGLExtensionCompressedTextureETC1.cpp create mode 100644 dom/canvas/WebGLExtensionCompressedTexturePVRTC.cpp create mode 100644 dom/canvas/WebGLExtensionCompressedTextureS3TC.cpp create mode 100644 dom/canvas/WebGLExtensionDebugRendererInfo.cpp create mode 100644 dom/canvas/WebGLExtensionDebugShaders.cpp create mode 100644 dom/canvas/WebGLExtensionDepthTexture.cpp create mode 100644 dom/canvas/WebGLExtensionDisjointTimerQuery.cpp create mode 100644 dom/canvas/WebGLExtensionDrawBuffers.cpp create mode 100644 dom/canvas/WebGLExtensionEXTColorBufferFloat.cpp create mode 100644 dom/canvas/WebGLExtensionElementIndexUint.cpp create mode 100644 dom/canvas/WebGLExtensionFragDepth.cpp create mode 100644 dom/canvas/WebGLExtensionInstancedArrays.cpp create mode 100644 dom/canvas/WebGLExtensionLoseContext.cpp create mode 100644 dom/canvas/WebGLExtensionSRGB.cpp create mode 100644 dom/canvas/WebGLExtensionShaderTextureLod.cpp create mode 100644 dom/canvas/WebGLExtensionStandardDerivatives.cpp create mode 100644 dom/canvas/WebGLExtensionTextureFilterAnisotropic.cpp create mode 100644 dom/canvas/WebGLExtensionTextureFloat.cpp create mode 100644 dom/canvas/WebGLExtensionTextureFloatLinear.cpp create mode 100644 dom/canvas/WebGLExtensionTextureHalfFloat.cpp create mode 100644 dom/canvas/WebGLExtensionTextureHalfFloatLinear.cpp create mode 100644 dom/canvas/WebGLExtensionVertexArray.cpp create mode 100644 dom/canvas/WebGLExtensions.h create mode 100644 dom/canvas/WebGLFormats.cpp create mode 100644 dom/canvas/WebGLFormats.h create mode 100644 dom/canvas/WebGLFramebuffer.cpp create mode 100644 dom/canvas/WebGLFramebuffer.h create mode 100644 dom/canvas/WebGLFramebufferAttachable.cpp create mode 100644 dom/canvas/WebGLFramebufferAttachable.h create mode 100644 dom/canvas/WebGLInternalFormatsTable.h create mode 100644 dom/canvas/WebGLMemoryTracker.cpp create mode 100644 dom/canvas/WebGLMemoryTracker.h create mode 100644 dom/canvas/WebGLObjectModel.cpp create mode 100644 dom/canvas/WebGLObjectModel.h create mode 100644 dom/canvas/WebGLProgram.cpp create mode 100644 dom/canvas/WebGLProgram.h create mode 100644 dom/canvas/WebGLQuery.cpp create mode 100644 dom/canvas/WebGLQuery.h create mode 100644 dom/canvas/WebGLRenderbuffer.cpp create mode 100644 dom/canvas/WebGLRenderbuffer.h create mode 100644 dom/canvas/WebGLSampler.cpp create mode 100644 dom/canvas/WebGLSampler.h create mode 100644 dom/canvas/WebGLShader.cpp create mode 100644 dom/canvas/WebGLShader.h create mode 100644 dom/canvas/WebGLShaderPrecisionFormat.cpp create mode 100644 dom/canvas/WebGLShaderPrecisionFormat.h create mode 100644 dom/canvas/WebGLShaderValidator.cpp create mode 100644 dom/canvas/WebGLShaderValidator.h create mode 100644 dom/canvas/WebGLStrongTypes.h create mode 100644 dom/canvas/WebGLSync.cpp create mode 100644 dom/canvas/WebGLSync.h create mode 100644 dom/canvas/WebGLTexelConversions.cpp create mode 100644 dom/canvas/WebGLTexelConversions.h create mode 100644 dom/canvas/WebGLTexture.cpp create mode 100644 dom/canvas/WebGLTexture.h create mode 100644 dom/canvas/WebGLTextureUpload.cpp create mode 100644 dom/canvas/WebGLTransformFeedback.cpp create mode 100644 dom/canvas/WebGLTransformFeedback.h create mode 100644 dom/canvas/WebGLTypes.h create mode 100644 dom/canvas/WebGLUniformLocation.cpp create mode 100644 dom/canvas/WebGLUniformLocation.h create mode 100644 dom/canvas/WebGLValidateStrings.cpp create mode 100644 dom/canvas/WebGLValidateStrings.h create mode 100644 dom/canvas/WebGLVertexArray.cpp create mode 100644 dom/canvas/WebGLVertexArray.h create mode 100644 dom/canvas/WebGLVertexArrayFake.cpp create mode 100644 dom/canvas/WebGLVertexArrayFake.h create mode 100644 dom/canvas/WebGLVertexArrayGL.cpp create mode 100644 dom/canvas/WebGLVertexArrayGL.h create mode 100644 dom/canvas/WebGLVertexArrayObject.cpp create mode 100644 dom/canvas/WebGLVertexArrayObject.h create mode 100644 dom/canvas/WebGLVertexAttribData.cpp create mode 100644 dom/canvas/WebGLVertexAttribData.h create mode 100644 dom/canvas/crashtests/0px-size-font-667225.html create mode 100644 dom/canvas/crashtests/0px-size-font-shadow.html create mode 100644 dom/canvas/crashtests/1099143-1.html create mode 100644 dom/canvas/crashtests/1161277-1.html create mode 100644 dom/canvas/crashtests/1183363.html create mode 100644 dom/canvas/crashtests/1190705.html create mode 100644 dom/canvas/crashtests/1223740-1.html create mode 100644 dom/canvas/crashtests/1225381-1.html create mode 100644 dom/canvas/crashtests/1229932-1.html create mode 100644 dom/canvas/crashtests/1229983-1.html create mode 100644 dom/canvas/crashtests/1233613.html create mode 100644 dom/canvas/crashtests/1244850-1.html create mode 100644 dom/canvas/crashtests/1246775-1.html create mode 100644 dom/canvas/crashtests/1283113-1.html create mode 100644 dom/canvas/crashtests/1284356-1.html create mode 100644 dom/canvas/crashtests/1284578-1.html create mode 100644 dom/canvas/crashtests/1286458-1.html create mode 100644 dom/canvas/crashtests/1287515-1.html create mode 100644 dom/canvas/crashtests/1287652-1.html create mode 100644 dom/canvas/crashtests/1288872-1.html create mode 100644 dom/canvas/crashtests/1290628-1.html create mode 100644 dom/canvas/crashtests/1298576-1.html create mode 100644 dom/canvas/crashtests/1299062-1.html create mode 100644 dom/canvas/crashtests/1305312-1.html create mode 100644 dom/canvas/crashtests/1334647-1.html create mode 100644 dom/canvas/crashtests/1357092.html create mode 100644 dom/canvas/crashtests/360293-1.html create mode 100644 dom/canvas/crashtests/421715-1.html create mode 100644 dom/canvas/crashtests/553938-1.html create mode 100644 dom/canvas/crashtests/647480.html create mode 100644 dom/canvas/crashtests/727547.html create mode 100644 dom/canvas/crashtests/729116.html create mode 100644 dom/canvas/crashtests/743499-negative-size.html create mode 100644 dom/canvas/crashtests/745699-1.html create mode 100644 dom/canvas/crashtests/745818-large-source.html create mode 100644 dom/canvas/crashtests/746813-1.html create mode 100644 dom/canvas/crashtests/767337-1.html create mode 100644 dom/canvas/crashtests/779426.html create mode 100644 dom/canvas/crashtests/780392-1.html create mode 100644 dom/canvas/crashtests/789933-1.html create mode 100644 dom/canvas/crashtests/794463-1.html create mode 100644 dom/canvas/crashtests/802926-1.html create mode 100644 dom/canvas/crashtests/896047-1.html create mode 100644 dom/canvas/crashtests/896047-2.html create mode 100644 dom/canvas/crashtests/916128-1.html create mode 100644 dom/canvas/crashtests/934939-1.html create mode 100644 dom/canvas/crashtests/crashtests.list create mode 100644 dom/canvas/crashtests/texImage2D.html create mode 100644 dom/canvas/gtest/TestImageBitmapColorUtils.cpp create mode 100644 dom/canvas/gtest/TestWebGLElementArrayCache.cpp create mode 100644 dom/canvas/gtest/moz.build create mode 100644 dom/canvas/moz.build create mode 100644 dom/canvas/nsICanvasRenderingContextInternal.h create mode 100644 dom/canvas/test/android.json create mode 100644 dom/canvas/test/captureStream_common.js create mode 100644 dom/canvas/test/chrome/chrome.ini create mode 100644 dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html create mode 100644 dom/canvas/test/chrome/test_drawWindow_widget_layers.html create mode 100644 dom/canvas/test/chrome/test_webgl_debug_renderer_info.html create mode 100644 dom/canvas/test/crash/1251091-1.png create mode 100644 dom/canvas/test/crash/file_1251091-1.html create mode 100644 dom/canvas/test/crash/file_616401.html create mode 100644 dom/canvas/test/crash/file_798802-1.html create mode 100644 dom/canvas/test/crash/file_bug1233613.html create mode 100644 dom/canvas/test/crash/file_texImage2D.html create mode 100644 dom/canvas/test/crash/mochitest.ini create mode 100644 dom/canvas/test/crash/test_1251091-1.html create mode 100644 dom/canvas/test/crash/test_616401.html create mode 100644 dom/canvas/test/crash/test_798802-1.html create mode 100644 dom/canvas/test/crash/test_bug1233613.html create mode 100644 dom/canvas/test/crash/test_createImageBitmap-video.html create mode 100644 dom/canvas/test/crash/test_texImage2D.html create mode 100644 dom/canvas/test/crossorigin/image-allow-credentials.png create mode 100644 dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ create mode 100644 dom/canvas/test/crossorigin/image-allow-star.png create mode 100644 dom/canvas/test/crossorigin/image-allow-star.png^headers^ create mode 100644 dom/canvas/test/crossorigin/image.png create mode 100644 dom/canvas/test/crossorigin/mochitest.ini create mode 100644 dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html create mode 100644 dom/canvas/test/crossorigin/test_video_crossorigin.html create mode 100644 dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html create mode 100644 dom/canvas/test/crossorigin/video.sjs create mode 100644 dom/canvas/test/file_drawImage_document_domain.html create mode 100644 dom/canvas/test/file_drawWindow_common.js create mode 100644 dom/canvas/test/file_drawWindow_source.html create mode 100644 dom/canvas/test/image_anim-gr.gif create mode 100644 dom/canvas/test/image_anim-gr.png create mode 100644 dom/canvas/test/image_anim-poster-gr.png create mode 100644 dom/canvas/test/image_broken.png create mode 100644 dom/canvas/test/image_error-early.png create mode 100644 dom/canvas/test/image_ggrr-256x256.png create mode 100644 dom/canvas/test/image_green-16x16.png create mode 100644 dom/canvas/test/image_green-1x1.png create mode 100644 dom/canvas/test/image_green-redirect create mode 100644 dom/canvas/test/image_green-redirect^headers^ create mode 100644 dom/canvas/test/image_green.png create mode 100644 dom/canvas/test/image_red-16x16.png create mode 100644 dom/canvas/test/image_red.png create mode 100644 dom/canvas/test/image_red_crossorigin_credentials.png create mode 100644 dom/canvas/test/image_red_crossorigin_credentials.png^headers^ create mode 100644 dom/canvas/test/image_redtransparent.png create mode 100644 dom/canvas/test/image_rgrg-256x256.png create mode 100644 dom/canvas/test/image_rrgg-256x256.png create mode 100644 dom/canvas/test/image_transparent.png create mode 100644 dom/canvas/test/image_transparent50.png create mode 100644 dom/canvas/test/image_yellow.png create mode 100644 dom/canvas/test/image_yellow75.png create mode 100644 dom/canvas/test/imagebitmap_bug1239300.js create mode 100644 dom/canvas/test/imagebitmap_bug1239752.js create mode 100644 dom/canvas/test/imagebitmap_extensions.html create mode 100644 dom/canvas/test/imagebitmap_extensions.js create mode 100644 dom/canvas/test/imagebitmap_extensions_data.js create mode 100644 dom/canvas/test/imagebitmap_extensions_on_worker.js create mode 100644 dom/canvas/test/imagebitmap_extensions_prepareSources.js create mode 100644 dom/canvas/test/imagebitmap_on_worker.js create mode 100644 dom/canvas/test/imagebitmap_structuredclone.js create mode 100644 dom/canvas/test/imagebitmap_structuredclone_iframe.html create mode 100644 dom/canvas/test/imagebitmap_structuredclone_utils.js create mode 100644 dom/canvas/test/mochitest.ini create mode 100644 dom/canvas/test/offscreencanvas.js create mode 100644 dom/canvas/test/offscreencanvas_mask.svg create mode 100644 dom/canvas/test/offscreencanvas_neuter.js create mode 100644 dom/canvas/test/offscreencanvas_serviceworker_inner.html create mode 100644 dom/canvas/test/reftest/1177726-text-stroke-bounds-ref.html create mode 100644 dom/canvas/test/reftest/1177726-text-stroke-bounds.html create mode 100644 dom/canvas/test/reftest/black.html create mode 100644 dom/canvas/test/reftest/capturestream.html create mode 100644 dom/canvas/test/reftest/clip-multiple-move-1-ref.html create mode 100644 dom/canvas/test/reftest/clip-multiple-move-1.html create mode 100644 dom/canvas/test/reftest/clip-multiple-move-2-ref.html create mode 100644 dom/canvas/test/reftest/clip-multiple-move-2.html create mode 100644 dom/canvas/test/reftest/clip-multiple-paths-badref.html create mode 100644 dom/canvas/test/reftest/clip-multiple-paths.html create mode 100644 dom/canvas/test/reftest/colors-no-alpha.png create mode 100644 dom/canvas/test/reftest/colors-non-premult.png create mode 100644 dom/canvas/test/reftest/colors-premult.png create mode 100644 dom/canvas/test/reftest/drawCustomFocusRing-ref.html create mode 100644 dom/canvas/test/reftest/drawCustomFocusRing.html create mode 100644 dom/canvas/test/reftest/drawFocusIfNeeded-ref.html create mode 100644 dom/canvas/test/reftest/drawFocusIfNeeded.html create mode 100644 dom/canvas/test/reftest/filters/default-color.html create mode 100644 dom/canvas/test/reftest/filters/drop-shadow-transformed.html create mode 100644 dom/canvas/test/reftest/filters/drop-shadow.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1-ref.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2-ref.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1-ref.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2-ref.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-shadow-1.html create mode 100644 dom/canvas/test/reftest/filters/fillText-with-shadow-2.html create mode 100644 dom/canvas/test/reftest/filters/fillText-without-shadow-1-ref.html create mode 100644 dom/canvas/test/reftest/filters/fillText-without-shadow-2-ref.html create mode 100644 dom/canvas/test/reftest/filters/global-alpha-ref.html create mode 100644 dom/canvas/test/reftest/filters/global-alpha.html create mode 100644 dom/canvas/test/reftest/filters/global-composite-operation-ref.html create mode 100644 dom/canvas/test/reftest/filters/global-composite-operation.html create mode 100644 dom/canvas/test/reftest/filters/liveness.html create mode 100644 dom/canvas/test/reftest/filters/multiple-drop-shadows.html create mode 100644 dom/canvas/test/reftest/filters/ref.html create mode 100644 dom/canvas/test/reftest/filters/reftest-stylo.list create mode 100644 dom/canvas/test/reftest/filters/reftest.list create mode 100644 dom/canvas/test/reftest/filters/shadow-ref.html create mode 100644 dom/canvas/test/reftest/filters/shadow.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1-ref.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2-ref.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-with-shadow-1.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-with-shadow-2.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-without-shadow-1-ref.html create mode 100644 dom/canvas/test/reftest/filters/strokeText-without-shadow-2-ref.html create mode 100644 dom/canvas/test/reftest/filters/subregion-fill-paint.html create mode 100644 dom/canvas/test/reftest/filters/subregion-ref.html create mode 100644 dom/canvas/test/reftest/filters/subregion-stroke-paint.html create mode 100644 dom/canvas/test/reftest/filters/svg-bbox-ref.html create mode 100644 dom/canvas/test/reftest/filters/svg-bbox.html create mode 100644 dom/canvas/test/reftest/filters/svg-inline.html create mode 100644 dom/canvas/test/reftest/filters/svg-liveness.html create mode 100644 dom/canvas/test/reftest/filters/svg-off-screen.html create mode 100644 dom/canvas/test/reftest/filters/units-em.html create mode 100644 dom/canvas/test/reftest/filters/units-ex.html create mode 100644 dom/canvas/test/reftest/filters/units-off-screen.html create mode 100644 dom/canvas/test/reftest/filters/units-pt.html create mode 100644 dom/canvas/test/reftest/filters/units.html create mode 100644 dom/canvas/test/reftest/green.png create mode 100644 dom/canvas/test/reftest/mozCurrentTransform-ref.html create mode 100644 dom/canvas/test/reftest/mozCurrentTransform.html create mode 100644 dom/canvas/test/reftest/mozCurrentTransformInverse.html create mode 100644 dom/canvas/test/reftest/reftest-stylo.list create mode 100644 dom/canvas/test/reftest/reftest.list create mode 100644 dom/canvas/test/reftest/stroketext-shadow-ref.html create mode 100644 dom/canvas/test/reftest/stroketext-shadow.html create mode 100644 dom/canvas/test/reftest/webgl-capturestream-test.html create mode 100644 dom/canvas/test/reftest/webgl-clear-test.html create mode 100644 dom/canvas/test/reftest/webgl-color-test.html create mode 100644 dom/canvas/test/reftest/webgl-disable-test.html create mode 100644 dom/canvas/test/reftest/webgl-hanging-fb-test.html create mode 100644 dom/canvas/test/reftest/webgl-hanging-scissor-test.html create mode 100644 dom/canvas/test/reftest/webgl-resize-test.html create mode 100644 dom/canvas/test/reftest/webgl-utils.js create mode 100644 dom/canvas/test/reftest/white.png create mode 100644 dom/canvas/test/reftest/wrapper.html create mode 100644 dom/canvas/test/test_2d.clearRect.image.offscreen.html create mode 100644 dom/canvas/test/test_2d.clip.winding.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.color-burn.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.color-dodge.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.color.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.darken.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.destination-atop.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.destination-in.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.difference.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.exclusion.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.hard-light.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.hue.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.lighten.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.lighter.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.luminosity.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.multiply.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.overlay.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.saturation.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.screen.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.soft-light.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.source-in.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.source-out.html create mode 100644 dom/canvas/test/test_2d.composite.canvas.xor.html create mode 100644 dom/canvas/test/test_2d.composite.clip.lighter.html create mode 100644 dom/canvas/test/test_2d.composite.clip.xor.html create mode 100644 dom/canvas/test/test_2d.composite.image.destination-atop.html create mode 100644 dom/canvas/test/test_2d.composite.image.destination-in.html create mode 100644 dom/canvas/test/test_2d.composite.image.lighter.html create mode 100644 dom/canvas/test/test_2d.composite.image.source-in.html create mode 100644 dom/canvas/test/test_2d.composite.image.source-out.html create mode 100644 dom/canvas/test/test_2d.composite.image.xor.html create mode 100644 dom/canvas/test/test_2d.composite.solid.color-burn.html create mode 100644 dom/canvas/test/test_2d.composite.solid.color-dodge.html create mode 100644 dom/canvas/test/test_2d.composite.solid.color.html create mode 100644 dom/canvas/test/test_2d.composite.solid.darken.html create mode 100644 dom/canvas/test/test_2d.composite.solid.difference.html create mode 100644 dom/canvas/test/test_2d.composite.solid.exclusion.html create mode 100644 dom/canvas/test/test_2d.composite.solid.hard-light.html create mode 100644 dom/canvas/test/test_2d.composite.solid.hue.html create mode 100644 dom/canvas/test/test_2d.composite.solid.lighten.html create mode 100644 dom/canvas/test/test_2d.composite.solid.lighter.html create mode 100644 dom/canvas/test/test_2d.composite.solid.luminosity.html create mode 100644 dom/canvas/test/test_2d.composite.solid.multiply.html create mode 100644 dom/canvas/test/test_2d.composite.solid.overlay.html create mode 100644 dom/canvas/test/test_2d.composite.solid.saturation.html create mode 100644 dom/canvas/test/test_2d.composite.solid.screen.html create mode 100644 dom/canvas/test/test_2d.composite.solid.soft-light.html create mode 100644 dom/canvas/test/test_2d.composite.solid.xor.html create mode 100644 dom/canvas/test/test_2d.composite.transparent.lighter.html create mode 100644 dom/canvas/test/test_2d.composite.transparent.xor.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.color-burn.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.color-dodge.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.color.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.darken.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.destination-atop.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.destination-in.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.difference.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.exclusion.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.hard-light.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.hue.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.lighten.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.luminosity.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.multiply.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.overlay.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.saturation.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.screen.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.soft-light.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.source-in.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.fill.source-out.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.image.destination-atop.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.image.destination-in.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.image.source-in.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.image.source-out.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.pattern.destination-atop.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.pattern.destination-in.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.pattern.source-in.html create mode 100644 dom/canvas/test/test_2d.composite.uncovered.pattern.source-out.html create mode 100644 dom/canvas/test/test_2d.drawImage.zerocanvas.html create mode 100644 dom/canvas/test/test_2d.fill.pattern.imageSmoothingEnabled.html create mode 100644 dom/canvas/test/test_2d.fill.winding.html create mode 100644 dom/canvas/test/test_2d.fillText.gradient.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.cone.behind.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.cone.beside.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.cone.front.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.cone.shape2.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.cone.top.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.equal.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.inside2.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.inside3.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.outside1.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.outside2.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.outside3.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.touch1.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.touch2.html create mode 100644 dom/canvas/test/test_2d.gradient.radial.touch3.html create mode 100644 dom/canvas/test/test_2d.isPointInPath.winding.html create mode 100644 dom/canvas/test/test_2d.line.cap.closed.html create mode 100644 dom/canvas/test/test_2d.line.join.parallel.html create mode 100644 dom/canvas/test/test_2d.path.arc.shape.3.html create mode 100644 dom/canvas/test/test_2d.path.rect.selfintersect.html create mode 100644 dom/canvas/test/test_2d.path.rect.zero.6.html create mode 100644 dom/canvas/test/test_2d.strokeRect.zero.5.html create mode 100644 dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html create mode 100644 dom/canvas/test/test_ImageData_ctor.html create mode 100644 dom/canvas/test/test_bitmaprenderer.html create mode 100644 dom/canvas/test/test_bug1215072.html create mode 100644 dom/canvas/test/test_bug232227.html create mode 100644 dom/canvas/test/test_bug613794.html create mode 100644 dom/canvas/test/test_bug753758.html create mode 100644 dom/canvas/test/test_bug764125.html create mode 100644 dom/canvas/test/test_bug856472.html create mode 100644 dom/canvas/test/test_bug866575.html create mode 100644 dom/canvas/test/test_bug902651.html create mode 100644 dom/canvas/test/test_canvas.html create mode 100644 dom/canvas/test/test_canvas_focusring.html create mode 100644 dom/canvas/test/test_canvas_font_setter.html create mode 100644 dom/canvas/test/test_canvas_path.html create mode 100644 dom/canvas/test/test_canvas_strokeStyle_getter.html create mode 100644 dom/canvas/test/test_capture.html create mode 100644 dom/canvas/test/test_createPattern_broken.html create mode 100644 dom/canvas/test/test_drawImageIncomplete.html create mode 100644 dom/canvas/test/test_drawImage_document_domain.html create mode 100644 dom/canvas/test/test_drawImage_edge_cases.html create mode 100644 dom/canvas/test/test_drawWindow.html create mode 100644 dom/canvas/test/test_filter.html create mode 100644 dom/canvas/test/test_filter_tainted.html create mode 100644 dom/canvas/test/test_hitregion_canvas.html create mode 100644 dom/canvas/test/test_hitregion_event.html create mode 100644 dom/canvas/test/test_imagebitmap.html create mode 100644 dom/canvas/test/test_imagebitmap_close.html create mode 100644 dom/canvas/test/test_imagebitmap_cropping.html create mode 100644 dom/canvas/test/test_imagebitmap_extensions.html create mode 100644 dom/canvas/test/test_imagebitmap_extensions_on_worker.html create mode 100644 dom/canvas/test/test_imagebitmap_on_worker.html create mode 100644 dom/canvas/test/test_imagebitmap_structuredclone.html create mode 100644 dom/canvas/test/test_imagebitmap_structuredclone_iframe.html create mode 100644 dom/canvas/test/test_imagebitmap_structuredclone_window.html create mode 100644 dom/canvas/test/test_imagebitmap_transfer.html create mode 100644 dom/canvas/test/test_isPointInStroke.html create mode 100644 dom/canvas/test/test_mozGetAsFile.html create mode 100644 dom/canvas/test/test_offscreencanvas_basic_webgl.html create mode 100644 dom/canvas/test/test_offscreencanvas_dynamic_fallback.html create mode 100644 dom/canvas/test/test_offscreencanvas_many.html create mode 100644 dom/canvas/test/test_offscreencanvas_neuter.html create mode 100644 dom/canvas/test/test_offscreencanvas_serviceworker.html create mode 100644 dom/canvas/test/test_offscreencanvas_sharedworker.html create mode 100644 dom/canvas/test/test_offscreencanvas_sizechange.html create mode 100644 dom/canvas/test/test_offscreencanvas_subworker.html create mode 100644 dom/canvas/test/test_offscreencanvas_toblob.html create mode 100644 dom/canvas/test/test_offscreencanvas_toimagebitmap.html create mode 100644 dom/canvas/test/test_strokeText_throw.html create mode 100644 dom/canvas/test/test_toBlob.html create mode 100644 dom/canvas/test/test_toDataURL_alpha.html create mode 100644 dom/canvas/test/test_toDataURL_lowercase_ascii.html create mode 100644 dom/canvas/test/test_toDataURL_parameters.html create mode 100644 dom/canvas/test/test_windingRuleUndefined.html create mode 100644 dom/canvas/test/webgl-conf/always-fail.html create mode 100644 dom/canvas/test/webgl-conf/checkout/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/CONFORMANCE_RULES.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/README.md create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/AUTHORS create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/CONTRIBUTING create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/LICENSE create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/README-Khronos.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/README.md create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/closurebuilder.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depstree.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depswriter.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/jscompiler.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/source.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/treescan.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/calcdeps.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/scopify.py create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/goog/base.js create mode 100644 dom/canvas/test/webgl-conf/checkout/closure-library/closure/goog/deps.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/00_readme.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-aliasing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/resource-sharing-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-atc.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-shared-resources.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-define-line-continuation.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/README.md create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B1.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B2.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B4.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-G_I.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-L_S.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/demos/opengl_web.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/demos/video.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArraysOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElementsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/longLoops.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/unusedAttribsUniforms.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/index.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/performance/CPUvsGPU.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/performance/bandwidth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsGCPause.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsMatrixMult.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsToGLOverhead.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/more/util.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/diffs.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-sub-image-2d-partial-texture.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/attribs/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib-i-render.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer-offsets.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/bound-buffer-size-change-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-contents.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-data-and-buffer-sub-data-sub-source.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-overflow-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-type-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/get-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/getBufferSubData.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/one-large-uniform-buffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/buffers/uniform-buffers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/context/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/context/constants-and-properties-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/context/context-attributes-depth-stencil-antialias-obeyed.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/context/context-type-test-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/context/methods-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-color-buffer-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions-in-shaders.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-as-return-value.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign-constructor.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-complex-indexing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-element-increment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-equality.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-in-complex-expression.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-length-side-effects.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/attrib-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/bool-type-cast-bug-uint-ivec-uvec.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compare-structs-containing-arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compound-assignment-type-combination.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/const-array-init.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/forbidden-operators.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/frag-depth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-default-precision.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-invariant.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/loops-with-side-effects.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/misplaced-version-directive.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/no-attribute-vertex-shader.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sampler-no-precision.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sequence-operator-returns-non-constant.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-linking.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-define.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-define.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-invalid-characters.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-mis-matching-uniform-block.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/short-circuiting-in-loop-condition.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-out-of-range.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-uniform-texture-coordinate.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/tricky-loop-conditions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/unary-minus-operator-in-dynamic-loop.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layout-match.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layouts.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/valid-invariant.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/misc/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/misc/expando-loss-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/misc/getextension-while-pbo-bound-stability.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/misc/instanceof-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/misc/object-deletion-behaviour-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/misc/uninitialized-test-2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/misc/views-with-offsets.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/programs/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/programs/active-built-in-attribs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/programs/gl-get-frag-data-location.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/query/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/query/query.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/reading/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/reading/format-r11f-g11f-b10f.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-fbo-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-rgb8-into-pbo-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-into-pixel-pack-buffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-pack-parameters.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-object-attachment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-texture-layer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/invalidate-framebuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisample-with-full-sample-counts.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisampled-renderbuffer-initialization.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/readbuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/attrib-type-match.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-outofbounds.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-srgb.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-multisampled-readbuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-outside-readbuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-scissor-enabled.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-size-overflow.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-srgb-and-linear-drawbuffers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-stencil-only.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/canvas-resizing-with-pbo-bound.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-func-buffer-type-match.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-srgb-color-buffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clipping-wide-points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/draw-buffers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/element-index-uint.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-completeness-unaffected.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-unsupported.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/fs-color-type-mismatch-color-buffer-type.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-rendering-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/out-of-bounds-index-buffers-after-copying.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rendering-sampling-feedback-loop.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rgb-format-support.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/uniform-block-buffer-size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/samplers/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/samplers/sampler-drawing-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/samplers/samplers.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/state/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-enum-tests.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-getstring.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-object-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/sync/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/sync/sync-webgl-specific.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/active-3d-texture-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/compressed-tex-image.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-luma-format.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-webgl-specific.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/gl-get-tex-parameter.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-specification-order-bug.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-texture-sampling.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/mipmap-fbo.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-3d-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-and-sub-image-with-array-buffer-view-sub-source.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args-from-dom-elements.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-different-data-source.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-input-validation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-mipmap-levels.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-srgb-mipmap.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-and-subimage-3d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-compressed-formats.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-unpack-params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texel-fetch-undefined.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texture-npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/transform_feedback.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/two-unreferenced-varyings.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/vertex-array-object.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/LICENSE create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/README.md create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/build.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/compiler.jar create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_fucntions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh create mode 100644 dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample-100.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample-200.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample-400.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample.svg create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html create mode 100644 dom/canvas/test/webgl-conf/checkout/js/desktop-gl-constants.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/glsl-conformance-test.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/glsl-constructor-tests-generator.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/glsl-generator.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/js-test-post.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/pnglib.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/test-eval.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/clipping-wide-points.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/compound-assignment-type-combination.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/gl-enum-tests.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/gl-get-tex-parameter.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/gl-object-get-calls.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/gl-vertex-attrib.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/instanceof-test.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/iterable-test.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/oes-texture-float-and-half-float-linear.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/out-of-bounds-test.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-data.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-svg-image.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-video.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas-sub-rectangle.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-canvas.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-bitmap.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-data.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-video.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-data.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-svg-image.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-video.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-webgl-canvas.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-utils.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/tex-input-validation.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-test-cases.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-worker.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/webgl-test-harness.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/webgl-test-utils.js create mode 100644 dom/canvas/test/webgl-conf/checkout/py/lint/LICENSE create mode 100644 dom/canvas/test/webgl-conf/checkout/py/lint/README.md create mode 100755 dom/canvas/test/webgl-conf/checkout/py/lint/lint.py create mode 100644 dom/canvas/test/webgl-conf/checkout/py/lint/lint.whitelist create mode 100644 dom/canvas/test/webgl-conf/checkout/py/tex_image_test_generator.py create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/1-channel.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/3x3.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/blue-1x1.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/boolUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/bug-32888-texture.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/floatUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/fragmentShader.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/glsl-feature-tests.css create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/glsl-generator.js create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-1024x1024.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256-with-128-alpha.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-default-gamma.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma0.1.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma1.0.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma2.0.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma4.0.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma9.0.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/gray-ramp.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/green-2x2-16bit.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/intArrayUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/intUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/js-test-style.css create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/matForWebGL2UniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/matUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/npot-video.mp4 create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/npot-video.theora.ogv create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/npot-video.webmvp8.webm create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/ogles-tests.css create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/opengl_logo.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.psd create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green-semi-transparent.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green.mp4 create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green.svg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green.theora.ogv create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp8.webm create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp9.webm create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-indexed.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/samplerForWebGL2UniformShader.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/samplerUniformShader.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/small-square-with-cie-rgb-profile.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colormatch-profile.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/small-square-with-e-srgb-profile.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/small-square-with-smpte-c-profile.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/small-square-with-srgb-iec61966-2.1-profile.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/structUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/thunderbird-logo-64x64.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/transparent-on-left-indexed.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/uintUniformShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.frag create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/vertexShader.vert create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/webgl-logo.png create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/zero-alpha.png create mode 100644 dom/canvas/test/webgl-conf/checkout/test-guidelines.md create mode 100644 dom/canvas/test/webgl-conf/checkout/webgl-conformance-tests.html create mode 100755 dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py create mode 100644 dom/canvas/test/webgl-conf/generated-mochitest.ini create mode 100644 dom/canvas/test/webgl-conf/generated/test_..__always-fail.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib-i-render.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer-offsets.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__bound-buffer-size-change-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-contents.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-data-and-buffer-sub-data-sub-source.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-overflow-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-type-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__get-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__getBufferSubData.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__one-large-uniform-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__uniform-buffers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__constants-and-properties-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-attributes-depth-stencil-antialias-obeyed.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-type-test-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__methods-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-color-buffer-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-disjoint-timer-query-webgl2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions-in-shaders.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-as-return-value.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign-constructor.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-complex-indexing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-element-increment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-equality.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-in-complex-expression.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-length-side-effects.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__attrib-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__bool-type-cast-bug-uint-ivec-uvec.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compare-structs-containing-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compound-assignment-type-combination.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__const-array-init.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__forbidden-operators.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__frag-depth.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-default-precision.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-invariant.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__loops-with-side-effects.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__misplaced-version-directive.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__no-attribute-vertex-shader.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sampler-no-precision.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sequence-operator-returns-non-constant.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-linking.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-define.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-define.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-invalid-characters.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-mis-matching-uniform-block.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__short-circuiting-in-loop-condition.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-out-of-range.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-uniform-texture-coordinate.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__tricky-loop-conditions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__unary-minus-operator-in-dynamic-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layout-match.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layouts.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__valid-invariant.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing-nv-driver-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__expando-loss-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__getextension-while-pbo-bound-stability.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__instanceof-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__object-deletion-behaviour-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__uninitialized-test-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__views-with-offsets.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__active-built-in-attribs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__gl-get-frag-data-location.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__occlusion-query.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__query.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__format-r11f-g11f-b10f.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-fbo-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-rgb8-into-pbo-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-into-pixel-pack-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-pack-parameters.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-object-attachment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-texture-layer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__invalidate-framebuffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisample-with-full-sample-counts.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisampled-renderbuffer-initialization.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__readbuffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__attrib-type-match.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-outofbounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-srgb.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-multisampled-readbuffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-outside-readbuffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-scissor-enabled.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-size-overflow.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-srgb-and-linear-drawbuffers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-stencil-only.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__canvas-resizing-with-pbo-bound.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-func-buffer-type-match.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-srgb-color-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clipping-wide-points.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__draw-buffers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__element-index-uint.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-completeness-unaffected.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-unsupported.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__fs-color-type-mismatch-color-buffer-type.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-rendering-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__out-of-bounds-index-buffers-after-copying.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rendering-sampling-feedback-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rgb-format-support.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__uniform-block-buffer-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__sampler-drawing-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__samplers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-enum-tests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-getstring.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-object-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__active-3d-texture-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-luma-format.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-webgl-specific.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__gl-get-tex-parameter.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-specification-order-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-texture-sampling.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__mipmap-fbo.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-3d-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-and-sub-image-with-array-buffer-view-sub-source.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args-from-dom-elements.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-different-data-source.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-input-validation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-mipmap-levels.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-new-formats.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-srgb-mipmap.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-2d.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-and-subimage-3d.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-compressed-formats.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-unpack-params.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texel-fetch-undefined.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texture-npot.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r32f-red-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8-red-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8ui-red_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg32f-rg-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8-rg-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb32f-rgb-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-half_float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba32f-rgba-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__transform_feedback.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__two-unreferenced-varyings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__unwritten-output-defaults-to-zero.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__vertex_arrays__vertex-array-object.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-aliasing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-matrix.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-repeated.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-disabled-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-enable-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-matrix-attributes.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-render.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-zero-issues.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer-offsets.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-bind-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-and-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-array-buffer-delete.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-uninitialized.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__element-array-buffer-delete-recreate.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-copies-indices.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-crash-with-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-large-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-verifies-too-many-indices.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-with-resized-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-offscreen-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-preserve-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-zero-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-webgl-to-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-hd-dpi-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-static-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__rapid-resizing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__texture-bindings-unaffected-on-resize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__to-data-url-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__viewport-unchanged-upon-resize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attribute-preserve-drawing-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attributes-alpha-depth-stencil-antialias.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation-and-destruction.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-eviction-with-garbage-collection.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-hidden-alpha.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost-restored.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-no-alpha-fbo-with-alpha.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-upon-reload.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-with-workers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-size-change.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__incorrect-context-object-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__premultiplyalpha-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__resource-sharing-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__context__user-defined-properties-on-context.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-disjoint-timer-query.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-texture-filter-anisotropic.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__get-extension.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__oes-texture-float-linear.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-atc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-etc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-pvrtc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-renderer-info.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-shaders.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-shared-resources.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-ambiguous-function-call.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-constructor-invalid-parameters.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-d3d11-compiler-error.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-dx-variable-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__array-of-struct-with-int-first-position.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__bool-type-cast-bug-int-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compare-loop-index-to-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__complex-glsl-does-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compound-assignment-type-combination.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-in-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-optimization.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__constant-precision-qualifier.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floored-division-accuracy.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__fragcoord-linking-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__logic-inside-block-without-braces.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__long-expressions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__loop-if-loop-gradient.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__modulo-arithmetic-accuracy.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__multiplication-assignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-functions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-loops-with-break-and-continue.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-sequence-operator.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-array-using-loop-index.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-struct-function-arg.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sequence-operator-evaluation-order.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__struct-constructor-highp-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__temp-expressions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__undefined-index-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__uniforms-should-not-lose-values.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-index.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-abs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-acos.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-asin.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan-xy.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-ceil.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cos.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cross.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-distance.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-dot.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-faceforward.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-floor.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-fract.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-length.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-normalize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-reflect.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sign.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sin.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_int_to_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__construct_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than_equal.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than_equal.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__float_literal.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__literal_precision.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__overflow_leak.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat3-construction.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat4-to-mat3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__matrix-compound-multiply.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__boolean_precision.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__const-variable-initialization.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__embedded-struct-definitions-forbidden.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty-declaration.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty_main.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__expression-list-in-declarator-initializer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__gl_position_unset.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__global-variable-init.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-function-nodes.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-long-variable-names.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-vertex-branch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__large-loop-compile.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii-comments.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__re-compile-re-link.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__sequence-operator-returns-constant.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-precision-format-obeyed.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-struct-scope.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-varying-packing-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-define.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-array.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-clipvertex.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-assignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-conditional-assignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping-negative.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-define-line-continuation.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-do-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-error-directive.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-float-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-scoping.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-frag-depth.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-recursion.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-scoped-struct.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-functional-scoping.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glcolor.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-1.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-symbol.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-hex-int-constant-macro.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-include.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-int-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-invalid-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-limited-indexing.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-long-line.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-ascii-error.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-reserved-words.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-preprocessor-whitespace.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-quoted-error.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-reserved-words.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-short-circuiting-operators.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-similar-uniform-array-names.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-too-many-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-two-initializer-types.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec2-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec3-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-120.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-130.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-webgl-identifier.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-while-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-without-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-invariance.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-varyings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-missing-varyings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-name-conflicts.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-uniform-structs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-varyings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shared.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-assign.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-equals.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-mixed-array-declarators.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-exceeds-maximum.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-of-variable-names.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-under-maximum.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-specifiers-in-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-unary-operators.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operator-on-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-global-initializers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-initializers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_field.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_function.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_variable.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_field.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_function.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_variable.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2d-bias.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dlod.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dproj.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dprojlod.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord-xy-values.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragdata-and-fragcolor.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-frontfacing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-pointcoord.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__glsl-built-ins.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-line-width.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-max-texture-dimensions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-attribs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-textures.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__bad-arguments-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__boolean-argument-conversion.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__delayed-drawing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__error-reporting.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__expando-loss.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__functions-returning-strings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__invalid-passed-params.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__is-object.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__null-object-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__object-deletion-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__shader-precision-format.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__type-conversion-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__uninitialized-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__webgl-specific.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__constants.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__getContext.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__methods.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-A.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-C.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-D_G.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-G_I.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-L_S.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-S_V.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__webGLArrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBuffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBufferBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindFramebufferLeaveNonZero.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferData.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferDataBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubData.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubDataBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__deleteBufferBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArraysOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElements.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElementsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTestsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixels.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixelsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTML.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTMLBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTML.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTMLBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrix.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrixBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformf.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfArrayLen1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformi.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformiBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointerBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__arrayOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__uniformOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__abs__abs_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__acos__acos_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__all__all_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__any__any_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__array__array_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__asin__asin_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_121_to_128.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_129_to_136.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_137_to_144.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_145_to_152.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_153_to_160.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_161_to_168.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_169_to_176.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_177_to_178.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__ceil__ceil_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__clamp__clamp_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_009_to_010.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cos__cos_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cross__cross_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__default__default_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__degrees__degrees_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__discard__discard_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__distance__distance_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__dot__dot_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__faceforward__faceforward_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__floor__floor_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__fract__fract_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_121_to_126.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__length__length_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThan__lessThan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat3__mat3_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_041_to_046.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__max__max_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__min__min_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mix__mix_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mod__mod_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__normalize__normalize_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__not__not_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_025_to_026.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__radians__radians_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__reflect__reflect_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__refract__refract_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sign__sign_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sin__sin_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sqrt__sqrt_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__step__step_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__tan__tan_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec3__vec3_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_017_to_018.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__get-active-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-long-names-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-attribute.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-getshadersource.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-shader-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__invalid-UTF-16.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-infolog.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-pack-alignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__feedback-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__framebuffer-state-restoration.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__renderbuffer-initialization.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__culling.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__default-texture-draw-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-arrays-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-elements-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-with-changing-start-vertex-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-switch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-texture-switch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-clear.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawarrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawelements.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-canvas-dimensions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-fbo-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-viewport-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__line-loop-tri-fan.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__many-draw-calls.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__more-than-65536-indices.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__multisample-corruption.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__negative-one-index.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__out-of-bounds-index-buffers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-no-attributes.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-specific-shader-variables.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__polygon-offset.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__simple.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__triangle.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-enable-enum-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-geterror.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-initial-state.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__state__state-uneffected-after-compositing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-2d-formats.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__cube-incomplete-fbo.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__default-texture.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-pixelstorei.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-teximage.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__mipmap-fbo.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__origin-clean-conformance.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-canvas-corruption.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-webgl.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-invalid-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d-bad-args.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texparameter-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-attachment-formats.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-clear.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-complete.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-copying-feedback-loops.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-cube-as-fbo-attachment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-draw-with-2d-and-cube.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-hd-dpi.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-mips.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-sub-image-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-transparent-pixels-initialized.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-view-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-large-array-tests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-unit-tests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__typed-arrays-in-workers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-bool.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniformmatrix4fv.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-unknown-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__null-uniform-location.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__out-of-bounds-uniform-array-access.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-default-values.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-location.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-samplers-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-values-per-program.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-aliasing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-matrix.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-repeated.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-disabled-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-enable-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-matrix-attributes.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-render.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-zero-issues.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer-offsets.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-bind-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-and-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-array-buffer-delete.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-uninitialized.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__element-array-buffer-delete-recreate.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-copies-indices.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-crash-with-buffer-sub-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-large-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-verifies-too-many-indices.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-with-resized-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-offscreen-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-preserve-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-zero-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-webgl-to-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-hd-dpi-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-static-canvas-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__rapid-resizing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__texture-bindings-unaffected-on-resize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__to-data-url-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__canvas__viewport-unchanged-upon-resize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__constants-and-properties.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attributes-alpha-depth-stencil-antialias.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation-and-destruction.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-eviction-with-garbage-collection.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-hidden-alpha.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost-restored.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-no-alpha-fbo-with-alpha.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-upon-reload.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-with-workers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-size-change.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__context-type-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__incorrect-context-object-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__methods.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__premultiplyalpha-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__resource-sharing-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__context__user-defined-properties-on-context.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-blend-minmax.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-disjoint-timer-query.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-frag-depth.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-sRGB.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-shader-texture-lod.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-texture-filter-anisotropic.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__get-extension.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-element-index-uint.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-standard-derivatives.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-linear.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-canvas.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-video.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-linear.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-canvas.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-video.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object-bufferData.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-atc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-etc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-pvrtc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-renderer-info.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-shaders.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-depth-texture.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-framebuffer-unsupported.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-max-draw-buffers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-shared-resources.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-ambiguous-function-call.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-constructor-invalid-parameters.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-d3d11-compiler-error.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-dx-variable-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__array-of-struct-with-int-first-position.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__bool-type-cast-bug-int-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compare-loop-index-to-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__complex-glsl-does-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compound-assignment-type-combination.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-in-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-optimization.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__constant-precision-qualifier.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__essl3-shaders-with-webgl1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floored-division-accuracy.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__fragcoord-linking-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__logic-inside-block-without-braces.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__long-expressions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__loop-if-loop-gradient.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__modulo-arithmetic-accuracy.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__multiplication-assignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-functions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-loops-with-break-and-continue.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-sequence-operator.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-array-using-loop-index.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-struct-function-arg.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sequence-operator-evaluation-order.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__struct-constructor-highp-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__temp-expressions-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__undefined-index-should-not-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__uniforms-should-not-lose-values.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-index.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-abs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-acos.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-asin.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan-xy.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-ceil.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cos.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cross.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-distance.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-dot.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-faceforward.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-floor.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-fract.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-length.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-normalize.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-reflect.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sign.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sin.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-float.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-gentype.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_int_to_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__construct_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than_equal.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than_equal.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_int_float.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__float_literal.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__literal_precision.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__overflow_leak.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat3-construction.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat4-to-mat3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__matrix-compound-multiply.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__attrib-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__boolean_precision.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__const-variable-initialization.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__embedded-struct-definitions-forbidden.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty-declaration.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty_main.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__expression-list-in-declarator-initializer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__gl_position_unset.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__global-variable-init.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-function-nodes.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-long-variable-names.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-vertex-branch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__large-loop-compile.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii-comments.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__re-compile-re-link.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__sequence-operator-returns-constant.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-precision-format-obeyed.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-struct-scope.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-uniform-packing-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-varying-packing-restrictions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-define.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-define.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-array.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-clipvertex.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-assignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-conditional-assignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping-negative.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-define-line-continuation.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-do-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-error-directive.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-float-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-scoping.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-frag-depth.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-recursion.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-scoped-struct.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-functional-scoping.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glcolor.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-1.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-symbol.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-hex-int-constant-macro.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-include.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-int-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-invalid-identifier.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-limited-indexing.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-long-line.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-ascii-error.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-reserved-words.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-preprocessor-whitespace.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-quoted-error.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-reserved-words.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-short-circuiting-operators.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-similar-uniform-array-names.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-too-many-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-two-initializer-types.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec2-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec3-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-return-value.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-120.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-130.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-webgl-identifier.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-while-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-without-precision.frag.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-invariance.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-varyings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-missing-varyings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-name-conflicts.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-uniform-structs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-varyings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shared.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-assign.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-equals.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-mixed-array-declarators.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-exceeds-maximum.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-of-variable-names.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-under-maximum.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-specifiers-in-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-unary-operators.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operator-on-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-global-initializers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-initializers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__uniform-location-length-limits.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_field.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_function.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_variable.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_field.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_function.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_struct.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_variable.vert.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2d-bias.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dlod.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dproj.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dprojlod.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord-xy-values.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragdata-and-fragcolor.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-frontfacing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-pointcoord.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__glsl-built-ins.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-line-width.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-max-texture-dimensions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-attribs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-textures.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-uniforms.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__bad-arguments-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__boolean-argument-conversion.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__delayed-drawing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__error-reporting.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__expando-loss.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__functions-returning-strings.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__instanceof-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__invalid-passed-params.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__is-object.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__null-object-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__object-deletion-behaviour.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__shader-precision-format.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__type-conversion-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__uninitialized-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__misc__webgl-specific.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__constants.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__getContext.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__methods.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-A.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B3.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-C.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-D_G.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-G_I.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-L_S.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-S_V.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__webGLArrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBuffer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBufferBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindFramebufferLeaveNonZero.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferData.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferDataBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubData.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubDataBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__deleteBufferBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArraysOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElements.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElementsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTestsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixels.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixelsBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTML.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTMLBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2D.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTML.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTMLBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrix.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrixBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformf.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfArrayLen1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformi.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformiBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttrib.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointer.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointerBadArgs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__arrayOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__uniformOutOfBounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__abs__abs_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__acos__acos_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__all__all_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__any__any_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__array__array_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__asin__asin_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_121_to_128.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_129_to_136.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_137_to_144.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_145_to_152.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_153_to_160.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_161_to_168.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_169_to_176.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_177_to_178.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__ceil__ceil_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__clamp__clamp_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_009_to_010.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cos__cos_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cross__cross_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__default__default_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__degrees__degrees_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__discard__discard_001_to_002.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__distance__distance_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__dot__dot_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__faceforward__faceforward_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__floor__floor_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__fract__fract_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_121_to_126.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__length__length_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThan__lessThan_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat3__mat3_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_041_to_046.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__max__max_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__min__min_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mix__mix_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mod__mod_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__normalize__normalize_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_009_to_012.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__not__not_001_to_004.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_025_to_026.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__radians__radians_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__reflect__reflect_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__refract__refract_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sign__sign_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sin__sin_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sqrt__sqrt_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__step__step_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__tan__tan_001_to_006.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec3__vec3_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_001_to_008.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_009_to_016.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_017_to_018.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__get-active-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-long-names-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-attribute.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-getshadersource.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-shader-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__invalid-UTF-16.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-infolog.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-pack-alignment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__feedback-loop.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-object-attachment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-state-restoration.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__renderbuffer-initialization.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__clipping-wide-points.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__culling.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__default-texture-draw-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-arrays-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-elements-out-of-bounds.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-with-changing-start-vertex-bug.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-switch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-texture-switch.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-clear.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawarrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawelements.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-canvas-dimensions.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-fbo-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-viewport-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__line-loop-tri-fan.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__many-draw-calls.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__more-than-65536-indices.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__multisample-corruption.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__negative-one-index.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__out-of-bounds-index-buffers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-no-attributes.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-specific-shader-variables.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__polygon-offset.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__simple.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__rendering__triangle.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enable-enum-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enum-tests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-geterror.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-getstring.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-initial-state.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-object-get-calls.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__state__state-uneffected-after-compositing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__compressed-tex-image.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-2d-formats.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__cube-incomplete-fbo.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__default-texture.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-get-tex-parameter.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-pixelstorei.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-teximage.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__mipmap-fbo.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__origin-clean-conformance.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-canvas-corruption.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-webgl.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-format-and-type.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-invalid-data.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-input-validation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d-bad-args.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texparameter-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind-2.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-attachment-formats.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-clear.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-complete.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-copying-feedback-loops.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-cube-as-fbo-attachment.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-draw-with-2d-and-cube.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-fakeblack.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-formats-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-hd-dpi.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-mips.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot-video.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-limit.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-sub-image-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-transparent-pixels-initialized.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-cube-maps.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-size.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-view-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-large-array-tests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-unit-tests.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-crash.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__typed-arrays-in-workers.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-arrays.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-bool.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniformmatrix4fv.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-unknown-uniform.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__null-uniform-location.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__out-of-bounds-uniform-array-access.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-default-values.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-location.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-samplers-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-values-per-program.html create mode 100644 dom/canvas/test/webgl-conf/iframe-passthrough.css create mode 100644 dom/canvas/test/webgl-conf/mochi-single.html create mode 100644 dom/canvas/test/webgl-conf/mochi-wrapper.html.template create mode 100644 dom/canvas/test/webgl-conf/mochitest-errata.ini create mode 100644 dom/canvas/test/webgl-conf/mochitest.ini.template create mode 100644 dom/canvas/test/webgl-mochitest/driver-info.js create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/ensure-ext.js create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_frag_depth.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_sRGB.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html create mode 100644 dom/canvas/test/webgl-mochitest/ensure-exts/test_common.html create mode 100644 dom/canvas/test/webgl-mochitest/es3-data.js create mode 100644 dom/canvas/test/webgl-mochitest/mochi-to-testcase.py create mode 100644 dom/canvas/test/webgl-mochitest/mochitest.ini create mode 100644 dom/canvas/test/webgl-mochitest/regress/test_bug_1268096.html create mode 100644 dom/canvas/test/webgl-mochitest/test_backbuffer_channels.html create mode 100644 dom/canvas/test/webgl-mochitest/test_backends.html create mode 100644 dom/canvas/test/webgl-mochitest/test_canvas_size.html create mode 100644 dom/canvas/test/webgl-mochitest/test_capture.html create mode 100644 dom/canvas/test/webgl-mochitest/test_cubemap_must_be_square.html create mode 100644 dom/canvas/test/webgl-mochitest/test_depth_readpixels.html create mode 100644 dom/canvas/test/webgl-mochitest/test_depth_tex_lazy_clear.html create mode 100644 dom/canvas/test/webgl-mochitest/test_draw.html create mode 100644 dom/canvas/test/webgl-mochitest/test_fb_param.html create mode 100644 dom/canvas/test/webgl-mochitest/test_fb_param_crash.html create mode 100644 dom/canvas/test/webgl-mochitest/test_fuzzing_bugs.html create mode 100644 dom/canvas/test/webgl-mochitest/test_hidden_alpha.html create mode 100644 dom/canvas/test/webgl-mochitest/test_hidden_depth_stencil.html create mode 100644 dom/canvas/test/webgl-mochitest/test_highp_fs.html create mode 100644 dom/canvas/test/webgl-mochitest/test_implicit_color_buffer_float.html create mode 100644 dom/canvas/test/webgl-mochitest/test_no_arr_points.html create mode 100644 dom/canvas/test/webgl-mochitest/test_noprog_draw.html create mode 100644 dom/canvas/test/webgl-mochitest/test_pixel_pack_buffer.html create mode 100644 dom/canvas/test/webgl-mochitest/test_privileged_exts.html create mode 100644 dom/canvas/test/webgl-mochitest/test_renderer_strings.html create mode 100644 dom/canvas/test/webgl-mochitest/test_sab_with_webgl.html create mode 100644 dom/canvas/test/webgl-mochitest/test_texsubimage_float.html create mode 100644 dom/canvas/test/webgl-mochitest/test_uninit_data.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl2_alpha_luminance.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl2_invalidate_framebuffer.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl_available.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl_color_buffer_float.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl_compressed_texture_es3.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl_conformance.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl_force_enable.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl_request_context.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html create mode 100644 dom/canvas/test/webgl-mochitest/test_webglcontextcreationerror.html create mode 100644 dom/canvas/test/webgl-mochitest/webgl-util.js (limited to 'dom/canvas') diff --git a/dom/canvas/CanvasGradient.h b/dom/canvas/CanvasGradient.h new file mode 100644 index 000000000..5a98ab13e --- /dev/null +++ b/dom/canvas/CanvasGradient.h @@ -0,0 +1,83 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_CanvasGradient_h +#define mozilla_dom_CanvasGradient_h + +#include "mozilla/Attributes.h" +#include "nsTArray.h" +#include "mozilla/RefPtr.h" +#include "mozilla/dom/CanvasRenderingContext2DBinding.h" +#include "mozilla/dom/CanvasRenderingContext2D.h" +#include "mozilla/gfx/2D.h" +#include "nsWrapperCache.h" +#include "gfxGradientCache.h" + +namespace mozilla { +namespace dom { + +class CanvasGradient : public nsWrapperCache +{ +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasGradient) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasGradient) + + enum class Type : uint8_t { + LINEAR = 0, + RADIAL + }; + + Type GetType() + { + return mType; + } + + mozilla::gfx::GradientStops * + GetGradientStopsForTarget(mozilla::gfx::DrawTarget *aRT) + { + if (mStops && mStops->GetBackendType() == aRT->GetBackendType()) { + return mStops; + } + + mStops = + gfx::gfxGradientCache::GetOrCreateGradientStops(aRT, + mRawStops, + gfx::ExtendMode::CLAMP); + + return mStops; + } + + // WebIDL + void AddColorStop(float offset, const nsAString& colorstr, ErrorResult& rv); + + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override + { + return CanvasGradientBinding::Wrap(aCx, this, aGivenProto); + } + + CanvasRenderingContext2D* GetParentObject() + { + return mContext; + } + +protected: + friend struct CanvasBidiProcessor; + + CanvasGradient(CanvasRenderingContext2D* aContext, Type aType) + : mContext(aContext) + , mType(aType) + { + } + + RefPtr mContext; + nsTArray mRawStops; + RefPtr mStops; + Type mType; + virtual ~CanvasGradient() {} +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_CanvasGradient_h diff --git a/dom/canvas/CanvasImageCache.cpp b/dom/canvas/CanvasImageCache.cpp new file mode 100644 index 000000000..82b3f277c --- /dev/null +++ b/dom/canvas/CanvasImageCache.cpp @@ -0,0 +1,419 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "CanvasImageCache.h" +#include "nsAutoPtr.h" +#include "nsIImageLoadingContent.h" +#include "nsExpirationTracker.h" +#include "imgIRequest.h" +#include "mozilla/dom/Element.h" +#include "nsTHashtable.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "nsContentUtils.h" +#include "mozilla/Preferences.h" +#include "mozilla/gfx/2D.h" +#include "gfx2DGlue.h" + +namespace mozilla { + +using namespace dom; +using namespace gfx; + +/** + * Used for images specific to this one canvas. Required + * due to CORS security. + */ +struct ImageCacheKey +{ + ImageCacheKey(imgIContainer* aImage, + HTMLCanvasElement* aCanvas, + bool aIsAccelerated) + : mImage(aImage) + , mCanvas(aCanvas) + , mIsAccelerated(aIsAccelerated) + {} + nsCOMPtr mImage; + HTMLCanvasElement* mCanvas; + bool mIsAccelerated; +}; + +/** + * Cache data needs to be separate from the entry + * for nsExpirationTracker. + */ +struct ImageCacheEntryData +{ + ImageCacheEntryData(const ImageCacheEntryData& aOther) + : mImage(aOther.mImage) + , mCanvas(aOther.mCanvas) + , mIsAccelerated(aOther.mIsAccelerated) + , mSourceSurface(aOther.mSourceSurface) + , mSize(aOther.mSize) + {} + explicit ImageCacheEntryData(const ImageCacheKey& aKey) + : mImage(aKey.mImage) + , mCanvas(aKey.mCanvas) + , mIsAccelerated(aKey.mIsAccelerated) + {} + + nsExpirationState* GetExpirationState() { return &mState; } + size_t SizeInBytes() { return mSize.width * mSize.height * 4; } + + // Key + nsCOMPtr mImage; + HTMLCanvasElement* mCanvas; + bool mIsAccelerated; + // Value + RefPtr mSourceSurface; + IntSize mSize; + nsExpirationState mState; +}; + +class ImageCacheEntry : public PLDHashEntryHdr +{ +public: + typedef ImageCacheKey KeyType; + typedef const ImageCacheKey* KeyTypePointer; + + explicit ImageCacheEntry(const KeyType* aKey) : + mData(new ImageCacheEntryData(*aKey)) {} + ImageCacheEntry(const ImageCacheEntry& toCopy) : + mData(new ImageCacheEntryData(*toCopy.mData)) {} + ~ImageCacheEntry() {} + + bool KeyEquals(KeyTypePointer key) const + { + return mData->mImage == key->mImage && + mData->mCanvas == key->mCanvas && + mData->mIsAccelerated == key->mIsAccelerated; + } + + static KeyTypePointer KeyToPointer(KeyType& key) { return &key; } + static PLDHashNumber HashKey(KeyTypePointer key) + { + return HashGeneric(key->mImage.get(), key->mCanvas, key->mIsAccelerated); + } + enum { ALLOW_MEMMOVE = true }; + + nsAutoPtr mData; +}; + + +/** + * Used for all images across all canvases. + */ +struct AllCanvasImageCacheKey +{ + AllCanvasImageCacheKey(imgIContainer* aImage, + bool aIsAccelerated) + : mImage(aImage) + , mIsAccelerated(aIsAccelerated) + {} + + nsCOMPtr mImage; + bool mIsAccelerated; +}; + +class AllCanvasImageCacheEntry : public PLDHashEntryHdr { +public: + typedef AllCanvasImageCacheKey KeyType; + typedef const AllCanvasImageCacheKey* KeyTypePointer; + + explicit AllCanvasImageCacheEntry(const KeyType* aKey) + : mImage(aKey->mImage) + , mIsAccelerated(aKey->mIsAccelerated) + {} + + AllCanvasImageCacheEntry(const AllCanvasImageCacheEntry &toCopy) + : mImage(toCopy.mImage) + , mIsAccelerated(toCopy.mIsAccelerated) + , mSourceSurface(toCopy.mSourceSurface) + {} + + ~AllCanvasImageCacheEntry() {} + + bool KeyEquals(KeyTypePointer key) const + { + return mImage == key->mImage && + mIsAccelerated == key->mIsAccelerated; + } + + static KeyTypePointer KeyToPointer(KeyType& key) { return &key; } + static PLDHashNumber HashKey(KeyTypePointer key) + { + return HashGeneric(key->mImage.get(), key->mIsAccelerated); + } + enum { ALLOW_MEMMOVE = true }; + + nsCOMPtr mImage; + bool mIsAccelerated; + RefPtr mSourceSurface; +}; + +static bool sPrefsInitialized = false; +static int32_t sCanvasImageCacheLimit = 0; + +class ImageCacheObserver; + +class ImageCache final : public nsExpirationTracker +{ +public: + // We use 3 generations of 1 second each to get a 2-3 seconds timeout. + enum { GENERATION_MS = 1000 }; + ImageCache(); + ~ImageCache(); + + virtual void NotifyExpired(ImageCacheEntryData* aObject) + { + mTotal -= aObject->SizeInBytes(); + RemoveObject(aObject); + + // Remove from the all canvas cache entry first since nsExpirationTracker + // will delete aObject. + mAllCanvasCache.RemoveEntry(AllCanvasImageCacheKey(aObject->mImage, aObject->mIsAccelerated)); + + // Deleting the entry will delete aObject since the entry owns aObject. + mCache.RemoveEntry(ImageCacheKey(aObject->mImage, aObject->mCanvas, aObject->mIsAccelerated)); + } + + nsTHashtable mCache; + nsTHashtable mAllCanvasCache; + size_t mTotal; + RefPtr mImageCacheObserver; +}; + +static ImageCache* gImageCache = nullptr; + +// Listen memory-pressure event for image cache purge. +class ImageCacheObserver final : public nsIObserver +{ +public: + NS_DECL_ISUPPORTS + + explicit ImageCacheObserver(ImageCache* aImageCache) + : mImageCache(aImageCache) + { + RegisterMemoryPressureEvent(); + } + + void Destroy() + { + UnregisterMemoryPressureEvent(); + mImageCache = nullptr; + } + + NS_IMETHOD Observe(nsISupports* aSubject, + const char* aTopic, + const char16_t* aSomeData) override + { + if (!mImageCache || strcmp(aTopic, "memory-pressure")) { + return NS_OK; + } + + mImageCache->AgeAllGenerations(); + return NS_OK; + } + +private: + virtual ~ImageCacheObserver() + { + } + + void RegisterMemoryPressureEvent() + { + nsCOMPtr observerService = + mozilla::services::GetObserverService(); + + MOZ_ASSERT(observerService); + + if (observerService) { + observerService->AddObserver(this, "memory-pressure", false); + } + } + + void UnregisterMemoryPressureEvent() + { + nsCOMPtr observerService = + mozilla::services::GetObserverService(); + + // Do not assert on observerService here. This might be triggered by + // the cycle collector at a late enough time, that XPCOM services are + // no longer available. See bug 1029504. + if (observerService) { + observerService->RemoveObserver(this, "memory-pressure"); + } + } + + ImageCache* mImageCache; +}; + +NS_IMPL_ISUPPORTS(ImageCacheObserver, nsIObserver) + +class CanvasImageCacheShutdownObserver final : public nsIObserver +{ + ~CanvasImageCacheShutdownObserver() {} +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIOBSERVER +}; + +ImageCache::ImageCache() + : nsExpirationTracker(GENERATION_MS, "ImageCache") + , mTotal(0) +{ + if (!sPrefsInitialized) { + sPrefsInitialized = true; + Preferences::AddIntVarCache(&sCanvasImageCacheLimit, "canvas.image.cache.limit", 0); + } + mImageCacheObserver = new ImageCacheObserver(this); + MOZ_RELEASE_ASSERT(mImageCacheObserver, "GFX: Can't alloc ImageCacheObserver"); +} + +ImageCache::~ImageCache() { + AgeAllGenerations(); + mImageCacheObserver->Destroy(); +} + +static already_AddRefed +GetImageContainer(dom::Element* aImage) +{ + nsCOMPtr request; + nsCOMPtr ilc = do_QueryInterface(aImage); + if (!ilc) { + return nullptr; + } + + ilc->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST, + getter_AddRefs(request)); + if (!request) { + return nullptr; + } + + nsCOMPtr imgContainer; + request->GetImage(getter_AddRefs(imgContainer)); + if (!imgContainer) { + return nullptr; + } + + return imgContainer.forget(); +} + +void +CanvasImageCache::NotifyDrawImage(Element* aImage, + HTMLCanvasElement* aCanvas, + SourceSurface* aSource, + const IntSize& aSize, + bool aIsAccelerated) +{ + if (!gImageCache) { + gImageCache = new ImageCache(); + nsContentUtils::RegisterShutdownObserver(new CanvasImageCacheShutdownObserver()); + } + + nsCOMPtr imgContainer = GetImageContainer(aImage); + if (!imgContainer) { + return; + } + + AllCanvasImageCacheKey allCanvasCacheKey(imgContainer, aIsAccelerated); + ImageCacheKey canvasCacheKey(imgContainer, aCanvas, aIsAccelerated); + ImageCacheEntry* entry = gImageCache->mCache.PutEntry(canvasCacheKey); + + if (entry) { + if (entry->mData->mSourceSurface) { + // We are overwriting an existing entry. + gImageCache->mTotal -= entry->mData->SizeInBytes(); + gImageCache->RemoveObject(entry->mData); + gImageCache->mAllCanvasCache.RemoveEntry(allCanvasCacheKey); + } + + gImageCache->AddObject(entry->mData); + entry->mData->mSourceSurface = aSource; + entry->mData->mSize = aSize; + gImageCache->mTotal += entry->mData->SizeInBytes(); + + AllCanvasImageCacheEntry* allEntry = gImageCache->mAllCanvasCache.PutEntry(allCanvasCacheKey); + if (allEntry) { + allEntry->mSourceSurface = aSource; + } + } + + if (!sCanvasImageCacheLimit) + return; + + // Expire the image cache early if its larger than we want it to be. + while (gImageCache->mTotal > size_t(sCanvasImageCacheLimit)) + gImageCache->AgeOneGeneration(); +} + +SourceSurface* +CanvasImageCache::LookupAllCanvas(Element* aImage, + bool aIsAccelerated) +{ + if (!gImageCache) { + return nullptr; + } + + nsCOMPtr imgContainer = GetImageContainer(aImage); + if (!imgContainer) { + return nullptr; + } + + AllCanvasImageCacheEntry* entry = + gImageCache->mAllCanvasCache.GetEntry(AllCanvasImageCacheKey(imgContainer, aIsAccelerated)); + if (!entry) { + return nullptr; + } + + return entry->mSourceSurface; +} + +SourceSurface* +CanvasImageCache::LookupCanvas(Element* aImage, + HTMLCanvasElement* aCanvas, + IntSize* aSizeOut, + bool aIsAccelerated) +{ + if (!gImageCache) { + return nullptr; + } + + nsCOMPtr imgContainer = GetImageContainer(aImage); + if (!imgContainer) { + return nullptr; + } + + ImageCacheEntry* entry = + gImageCache->mCache.GetEntry(ImageCacheKey(imgContainer, aCanvas, aIsAccelerated)); + if (!entry) { + return nullptr; + } + + MOZ_ASSERT(aSizeOut); + + gImageCache->MarkUsed(entry->mData); + *aSizeOut = entry->mData->mSize; + return entry->mData->mSourceSurface; +} + + +NS_IMPL_ISUPPORTS(CanvasImageCacheShutdownObserver, nsIObserver) + +NS_IMETHODIMP +CanvasImageCacheShutdownObserver::Observe(nsISupports *aSubject, + const char *aTopic, + const char16_t *aData) +{ + if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) { + delete gImageCache; + gImageCache = nullptr; + + nsContentUtils::UnregisterShutdownObserver(this); + } + + return NS_OK; +} + +} // namespace mozilla diff --git a/dom/canvas/CanvasImageCache.h b/dom/canvas/CanvasImageCache.h new file mode 100644 index 000000000..f537067ec --- /dev/null +++ b/dom/canvas/CanvasImageCache.h @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef CANVASIMAGECACHE_H_ +#define CANVASIMAGECACHE_H_ + +#include "mozilla/RefPtr.h" +#include "nsSize.h" + +namespace mozilla { +namespace dom { +class Element; +class HTMLCanvasElement; +} // namespace dom +namespace gfx { +class SourceSurface; +} // namespace gfx +} // namespace mozilla +class imgIContainer; + +namespace mozilla { + +class CanvasImageCache { + typedef mozilla::gfx::SourceSurface SourceSurface; +public: + /** + * Notify that image element aImage was drawn to aCanvas element + * using the first frame of aRequest's image. The data for the surface is + * in aSurface, and the image size is in aSize. + */ + static void NotifyDrawImage(dom::Element* aImage, + dom::HTMLCanvasElement* aCanvas, + SourceSurface* aSource, + const gfx::IntSize& aSize, + bool aIsAccelerated); + + /** + * Check whether aImage has recently been drawn any canvas. If we return + * a non-null surface, then the same image was recently drawn into a canvas. + */ + static SourceSurface* LookupAllCanvas(dom::Element* aImage, + bool aIsAccelerated); + + /** + * Like the top above, but restricts the lookup to only aCanvas. This is + * required for CORS security. + */ + static SourceSurface* LookupCanvas(dom::Element* aImage, + dom::HTMLCanvasElement* aCanvas, + gfx::IntSize* aSizeOut, + bool aIsAccelerated); +}; + +} // namespace mozilla + +#endif /* CANVASIMAGECACHE_H_ */ diff --git a/dom/canvas/CanvasPath.h b/dom/canvas/CanvasPath.h new file mode 100644 index 000000000..e31b375cc --- /dev/null +++ b/dom/canvas/CanvasPath.h @@ -0,0 +1,91 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef CanvasPath_h +#define CanvasPath_h + +#include "mozilla/Attributes.h" +#include "mozilla/RefPtr.h" +#include "nsWrapperCache.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "mozilla/ErrorResult.h" + +namespace mozilla { +namespace dom { + +enum class CanvasWindingRule : uint32_t; +class SVGMatrix; + +class CanvasPath final : + public nsWrapperCache +{ +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPath) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPath) + + nsCOMPtr GetParentObject() { return mParent; } + + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + + static already_AddRefed Constructor(const GlobalObject& aGlobal, + ErrorResult& rv); + static already_AddRefed Constructor(const GlobalObject& aGlobal, + CanvasPath& aCanvasPath, + ErrorResult& rv); + static already_AddRefed Constructor(const GlobalObject& aGlobal, + const nsAString& aPathString, + ErrorResult& rv); + + void ClosePath(); + void MoveTo(double x, double y); + void LineTo(double x, double y); + void QuadraticCurveTo(double cpx, double cpy, double x, double y); + void BezierCurveTo(double cp1x, double cp1y, + double cp2x, double cp2y, + double x, double y); + void ArcTo(double x1, double y1, double x2, double y2, double radius, + ErrorResult& error); + void Rect(double x, double y, double w, double h); + void Arc(double x, double y, double radius, + double startAngle, double endAngle, bool anticlockwise, + ErrorResult& error); + void Ellipse(double x, double y, double radiusX, double radiusY, + double rotation, double startAngle, double endAngle, + bool anticlockwise, ErrorResult& error); + + void LineTo(const gfx::Point& aPoint); + void BezierTo(const gfx::Point& aCP1, + const gfx::Point& aCP2, + const gfx::Point& aCP3); + + already_AddRefed GetPath(const CanvasWindingRule& aWinding, + const gfx::DrawTarget* aTarget) const; + + explicit CanvasPath(nsISupports* aParent); + // already_AddRefed arg because the return value from Path::CopyToBuilder() + // is passed directly and we can't drop the only ref to have a raw pointer. + CanvasPath(nsISupports* aParent, + already_AddRefed aPathBuilder); + + void AddPath(CanvasPath& aCanvasPath, + const Optional>& aMatrix); + +private: + virtual ~CanvasPath() {} + + nsCOMPtr mParent; + static gfx::Float ToFloat(double aValue) { return gfx::Float(aValue); } + + mutable RefPtr mPath; + mutable RefPtr mPathBuilder; + + void EnsurePathBuilder() const; +}; + +} // namespace dom +} // namespace mozilla + +#endif /* CanvasPath_h */ + diff --git a/dom/canvas/CanvasPattern.h b/dom/canvas/CanvasPattern.h new file mode 100644 index 000000000..98555485d --- /dev/null +++ b/dom/canvas/CanvasPattern.h @@ -0,0 +1,80 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_CanvasPattern_h +#define mozilla_dom_CanvasPattern_h + +#include "mozilla/Attributes.h" +#include "mozilla/dom/CanvasRenderingContext2DBinding.h" +#include "mozilla/dom/CanvasRenderingContext2D.h" +#include "mozilla/RefPtr.h" +#include "nsISupports.h" +#include "nsWrapperCache.h" + +class nsIPrincipal; + +namespace mozilla { +namespace gfx { +class SourceSurface; +} // namespace gfx + +namespace dom { +class SVGMatrix; + +class CanvasPattern final : public nsWrapperCache +{ + ~CanvasPattern() {} +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPattern) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPattern) + + enum class RepeatMode : uint8_t { + REPEAT, + REPEATX, + REPEATY, + NOREPEAT + }; + + CanvasPattern(CanvasRenderingContext2D* aContext, + gfx::SourceSurface* aSurface, + RepeatMode aRepeat, + nsIPrincipal* principalForSecurityCheck, + bool forceWriteOnly, + bool CORSUsed) + : mContext(aContext) + , mSurface(aSurface) + , mPrincipal(principalForSecurityCheck) + , mTransform() + , mForceWriteOnly(forceWriteOnly) + , mCORSUsed(CORSUsed) + , mRepeat(aRepeat) + { + } + + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override + { + return CanvasPatternBinding::Wrap(aCx, this, aGivenProto); + } + + CanvasRenderingContext2D* GetParentObject() + { + return mContext; + } + + // WebIDL + void SetTransform(SVGMatrix& matrix); + + RefPtr mContext; + RefPtr mSurface; + nsCOMPtr mPrincipal; + mozilla::gfx::Matrix mTransform; + const bool mForceWriteOnly; + const bool mCORSUsed; + const RepeatMode mRepeat; +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_CanvasPattern_h diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp new file mode 100644 index 000000000..2ed39627e --- /dev/null +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -0,0 +1,6555 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "CanvasRenderingContext2D.h" + +#include "mozilla/gfx/Helpers.h" +#include "nsXULElement.h" + +#include "nsAutoPtr.h" +#include "nsIServiceManager.h" +#include "nsMathUtils.h" +#include "SVGImageContext.h" + +#include "nsContentUtils.h" + +#include "nsIDocument.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "nsSVGEffects.h" +#include "nsPresContext.h" +#include "nsIPresShell.h" + +#include "nsIInterfaceRequestorUtils.h" +#include "nsIFrame.h" +#include "nsError.h" + +#include "nsCSSParser.h" +#include "mozilla/css/StyleRule.h" +#include "mozilla/css/Declaration.h" +#include "nsComputedDOMStyle.h" +#include "nsStyleSet.h" + +#include "nsPrintfCString.h" + +#include "nsReadableUtils.h" + +#include "nsColor.h" +#include "nsGfxCIID.h" +#include "nsIDocShell.h" +#include "nsIDOMWindow.h" +#include "nsPIDOMWindow.h" +#include "nsDisplayList.h" +#include "nsFocusManager.h" +#include "nsContentUtils.h" + +#include "nsTArray.h" + +#include "ImageEncoder.h" +#include "ImageRegion.h" + +#include "gfxContext.h" +#include "gfxImageSurface.h" +#include "gfxPlatform.h" +#include "gfxFont.h" +#include "gfxBlur.h" +#include "gfxPrefs.h" +#include "gfxUtils.h" + +#include "nsFrameLoader.h" +#include "nsBidi.h" +#include "nsBidiPresUtils.h" +#include "Layers.h" +#include "LayerUserData.h" +#include "CanvasUtils.h" +#include "nsIMemoryReporter.h" +#include "nsStyleUtil.h" +#include "CanvasImageCache.h" + +#include + +#include "jsapi.h" +#include "jsfriendapi.h" +#include "js/Conversions.h" + +#include "mozilla/Alignment.h" +#include "mozilla/Assertions.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/DebugOnly.h" +#include "mozilla/dom/ContentParent.h" +#include "mozilla/dom/ImageBitmap.h" +#include "mozilla/dom/ImageData.h" +#include "mozilla/dom/PBrowserParent.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/dom/TypedArray.h" +#include "mozilla/EndianUtils.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/gfx/Helpers.h" +#include "mozilla/gfx/Tools.h" +#include "mozilla/gfx/PathHelpers.h" +#include "mozilla/gfx/DataSurfaceHelpers.h" +#include "mozilla/gfx/PatternHelpers.h" +#include "mozilla/ipc/DocumentRendererParent.h" +#include "mozilla/ipc/PDocumentRendererParent.h" +#include "mozilla/layers/PersistentBufferProvider.h" +#include "mozilla/MathAlgorithms.h" +#include "mozilla/Preferences.h" +#include "mozilla/Telemetry.h" +#include "mozilla/TimeStamp.h" +#include "mozilla/UniquePtr.h" +#include "mozilla/Unused.h" +#include "nsCCUncollectableMarker.h" +#include "nsWrapperCacheInlines.h" +#include "mozilla/dom/CanvasRenderingContext2DBinding.h" +#include "mozilla/dom/CanvasPath.h" +#include "mozilla/dom/HTMLImageElement.h" +#include "mozilla/dom/HTMLVideoElement.h" +#include "mozilla/dom/SVGMatrix.h" +#include "mozilla/dom/TextMetrics.h" +#include "mozilla/dom/SVGMatrix.h" +#include "mozilla/FloatingPoint.h" +#include "nsGlobalWindow.h" +#include "GLContext.h" +#include "GLContextProvider.h" +#include "SVGContentUtils.h" +#include "nsIScreenManager.h" +#include "nsFilterInstance.h" +#include "nsSVGLength2.h" +#include "nsDeviceContext.h" +#include "nsFontMetrics.h" +#include "Units.h" +#include "CanvasUtils.h" +#include "mozilla/StyleSetHandle.h" +#include "mozilla/StyleSetHandleInlines.h" +#include "mozilla/layers/CanvasClient.h" + +#undef free // apparently defined by some windows header, clashing with a free() + // method in SkTypes.h +#include "SkiaGLGlue.h" +#ifdef USE_SKIA +#include "SurfaceTypes.h" +#include "GLBlitHelper.h" +#endif + +using mozilla::gl::GLContext; +using mozilla::gl::SkiaGLGlue; +using mozilla::gl::GLContextProvider; + +#ifdef XP_WIN +#include "gfxWindowsPlatform.h" +#endif + +#ifdef MOZ_WIDGET_GONK +#include "mozilla/layers/ShadowLayers.h" +#endif + +// windows.h (included by chromium code) defines this, in its infinite wisdom +#undef DrawText + +using namespace mozilla; +using namespace mozilla::CanvasUtils; +using namespace mozilla::css; +using namespace mozilla::gfx; +using namespace mozilla::image; +using namespace mozilla::ipc; +using namespace mozilla::layers; + +namespace mozilla { +namespace dom { + +// Cap sigma to avoid overly large temp surfaces. +const Float SIGMA_MAX = 100; + +const size_t MAX_STYLE_STACK_SIZE = 1024; + +/* Memory reporter stuff */ +static int64_t gCanvasAzureMemoryUsed = 0; + +// Adds Save() / Restore() calls to the scope. +class MOZ_RAII AutoSaveRestore +{ +public: + explicit AutoSaveRestore(CanvasRenderingContext2D* aCtx + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : mCtx(aCtx) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + mCtx->Save(); + } + ~AutoSaveRestore() { mCtx->Restore(); } +private: + RefPtr mCtx; + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + +// This is KIND_OTHER because it's not always clear where in memory the pixels +// of a canvas are stored. Furthermore, this memory will be tracked by the +// underlying surface implementations. See bug 655638 for details. +class Canvas2dPixelsReporter final : public nsIMemoryReporter +{ + ~Canvas2dPixelsReporter() {} +public: + NS_DECL_ISUPPORTS + + NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport, + nsISupports* aData, bool aAnonymize) override + { + MOZ_COLLECT_REPORT( + "canvas-2d-pixels", KIND_OTHER, UNITS_BYTES, gCanvasAzureMemoryUsed, + "Memory used by 2D canvases. Each canvas requires " + "(width * height * 4) bytes."); + + return NS_OK; + } +}; + +NS_IMPL_ISUPPORTS(Canvas2dPixelsReporter, nsIMemoryReporter) + +class CanvasRadialGradient : public CanvasGradient +{ +public: + CanvasRadialGradient(CanvasRenderingContext2D* aContext, + const Point& aBeginOrigin, Float aBeginRadius, + const Point& aEndOrigin, Float aEndRadius) + : CanvasGradient(aContext, Type::RADIAL) + , mCenter1(aBeginOrigin) + , mCenter2(aEndOrigin) + , mRadius1(aBeginRadius) + , mRadius2(aEndRadius) + { + } + + Point mCenter1; + Point mCenter2; + Float mRadius1; + Float mRadius2; +}; + +class CanvasLinearGradient : public CanvasGradient +{ +public: + CanvasLinearGradient(CanvasRenderingContext2D* aContext, + const Point& aBegin, const Point& aEnd) + : CanvasGradient(aContext, Type::LINEAR) + , mBegin(aBegin) + , mEnd(aEnd) + { + } + +protected: + friend struct CanvasBidiProcessor; + friend class CanvasGeneralPattern; + + // Beginning of linear gradient. + Point mBegin; + // End of linear gradient. + Point mEnd; +}; + +bool +CanvasRenderingContext2D::PatternIsOpaque(CanvasRenderingContext2D::Style aStyle) const +{ + const ContextState& state = CurrentState(); + if (state.globalAlpha < 1.0) { + return false; + } + + if (state.patternStyles[aStyle] && state.patternStyles[aStyle]->mSurface) { + return IsOpaqueFormat(state.patternStyles[aStyle]->mSurface->GetFormat()); + } + + // TODO: for gradient patterns we could check that all stops are opaque + // colors. + + if (!state.gradientStyles[aStyle]) { + // it's a color pattern. + return Color::FromABGR(state.colorStyles[aStyle]).a >= 1.0; + } + + return false; +} + +// This class is named 'GeneralCanvasPattern' instead of just +// 'GeneralPattern' to keep Windows PGO builds from confusing the +// GeneralPattern class in gfxContext.cpp with this one. +class CanvasGeneralPattern +{ +public: + typedef CanvasRenderingContext2D::Style Style; + typedef CanvasRenderingContext2D::ContextState ContextState; + + Pattern& ForStyle(CanvasRenderingContext2D* aCtx, + Style aStyle, + DrawTarget* aRT) + { + // This should only be called once or the mPattern destructor will + // not be executed. + NS_ASSERTION(!mPattern.GetPattern(), "ForStyle() should only be called once on CanvasGeneralPattern!"); + + const ContextState& state = aCtx->CurrentState(); + + if (state.StyleIsColor(aStyle)) { + mPattern.InitColorPattern(ToDeviceColor(state.colorStyles[aStyle])); + } else if (state.gradientStyles[aStyle] && + state.gradientStyles[aStyle]->GetType() == CanvasGradient::Type::LINEAR) { + auto gradient = + static_cast(state.gradientStyles[aStyle].get()); + + mPattern.InitLinearGradientPattern(gradient->mBegin, gradient->mEnd, + gradient->GetGradientStopsForTarget(aRT)); + } else if (state.gradientStyles[aStyle] && + state.gradientStyles[aStyle]->GetType() == CanvasGradient::Type::RADIAL) { + auto gradient = + static_cast(state.gradientStyles[aStyle].get()); + + mPattern.InitRadialGradientPattern(gradient->mCenter1, gradient->mCenter2, + gradient->mRadius1, gradient->mRadius2, + gradient->GetGradientStopsForTarget(aRT)); + } else if (state.patternStyles[aStyle]) { + if (aCtx->mCanvasElement) { + CanvasUtils::DoDrawImageSecurityCheck(aCtx->mCanvasElement, + state.patternStyles[aStyle]->mPrincipal, + state.patternStyles[aStyle]->mForceWriteOnly, + state.patternStyles[aStyle]->mCORSUsed); + } + + ExtendMode mode; + if (state.patternStyles[aStyle]->mRepeat == CanvasPattern::RepeatMode::NOREPEAT) { + mode = ExtendMode::CLAMP; + } else { + mode = ExtendMode::REPEAT; + } + + SamplingFilter samplingFilter; + if (state.imageSmoothingEnabled) { + samplingFilter = SamplingFilter::GOOD; + } else { + samplingFilter = SamplingFilter::POINT; + } + + mPattern.InitSurfacePattern(state.patternStyles[aStyle]->mSurface, mode, + state.patternStyles[aStyle]->mTransform, + samplingFilter); + } + + return *mPattern.GetPattern(); + } + + GeneralPattern mPattern; +}; + +/* This is an RAII based class that can be used as a drawtarget for + * operations that need to have a filter applied to their results. + * All coordinates passed to the constructor are in device space. + */ +class AdjustedTargetForFilter +{ +public: + typedef CanvasRenderingContext2D::ContextState ContextState; + + AdjustedTargetForFilter(CanvasRenderingContext2D* aCtx, + DrawTarget* aFinalTarget, + const gfx::IntPoint& aFilterSpaceToTargetOffset, + const gfx::IntRect& aPreFilterBounds, + const gfx::IntRect& aPostFilterBounds, + gfx::CompositionOp aCompositionOp) + : mFinalTarget(aFinalTarget) + , mCtx(aCtx) + , mPostFilterBounds(aPostFilterBounds) + , mOffset(aFilterSpaceToTargetOffset) + , mCompositionOp(aCompositionOp) + { + nsIntRegion sourceGraphicNeededRegion; + nsIntRegion fillPaintNeededRegion; + nsIntRegion strokePaintNeededRegion; + + FilterSupport::ComputeSourceNeededRegions( + aCtx->CurrentState().filter, mPostFilterBounds, + sourceGraphicNeededRegion, fillPaintNeededRegion, + strokePaintNeededRegion); + + mSourceGraphicRect = sourceGraphicNeededRegion.GetBounds(); + mFillPaintRect = fillPaintNeededRegion.GetBounds(); + mStrokePaintRect = strokePaintNeededRegion.GetBounds(); + + mSourceGraphicRect = mSourceGraphicRect.Intersect(aPreFilterBounds); + + if (mSourceGraphicRect.IsEmpty()) { + // The filter might not make any use of the source graphic. We need to + // create a DrawTarget that we can return from DT() anyway, so we'll + // just use a 1x1-sized one. + mSourceGraphicRect.SizeTo(1, 1); + } + + mTarget = mFinalTarget->CreateSimilarDrawTarget(mSourceGraphicRect.Size(), + SurfaceFormat::B8G8R8A8); + + if (!mTarget) { + // XXX - Deal with the situation where our temp size is too big to + // fit in a texture (bug 1066622). + mTarget = mFinalTarget; + mCtx = nullptr; + mFinalTarget = nullptr; + return; + } + + mTarget->SetTransform( + mFinalTarget->GetTransform().PostTranslate(-mSourceGraphicRect.TopLeft() + mOffset)); + } + + // Return a SourceSurface that contains the FillPaint or StrokePaint source. + already_AddRefed + DoSourcePaint(gfx::IntRect& aRect, CanvasRenderingContext2D::Style aStyle) + { + if (aRect.IsEmpty()) { + return nullptr; + } + + RefPtr dt = + mFinalTarget->CreateSimilarDrawTarget(aRect.Size(), SurfaceFormat::B8G8R8A8); + if (!dt) { + aRect.SetEmpty(); + return nullptr; + } + + Matrix transform = + mFinalTarget->GetTransform().PostTranslate(-aRect.TopLeft() + mOffset); + + dt->SetTransform(transform); + + if (transform.Invert()) { + gfx::Rect dtBounds(0, 0, aRect.width, aRect.height); + gfx::Rect fillRect = transform.TransformBounds(dtBounds); + dt->FillRect(fillRect, CanvasGeneralPattern().ForStyle(mCtx, aStyle, dt)); + } + return dt->Snapshot(); + } + + ~AdjustedTargetForFilter() + { + if (!mCtx) { + return; + } + + RefPtr snapshot = mTarget->Snapshot(); + + RefPtr fillPaint = + DoSourcePaint(mFillPaintRect, CanvasRenderingContext2D::Style::FILL); + RefPtr strokePaint = + DoSourcePaint(mStrokePaintRect, CanvasRenderingContext2D::Style::STROKE); + + AutoRestoreTransform autoRestoreTransform(mFinalTarget); + mFinalTarget->SetTransform(Matrix()); + + MOZ_RELEASE_ASSERT(!mCtx->CurrentState().filter.mPrimitives.IsEmpty()); + gfx::FilterSupport::RenderFilterDescription( + mFinalTarget, mCtx->CurrentState().filter, + gfx::Rect(mPostFilterBounds), + snapshot, mSourceGraphicRect, + fillPaint, mFillPaintRect, + strokePaint, mStrokePaintRect, + mCtx->CurrentState().filterAdditionalImages, + mPostFilterBounds.TopLeft() - mOffset, + DrawOptions(1.0f, mCompositionOp)); + + const gfx::FilterDescription& filter = mCtx->CurrentState().filter; + MOZ_RELEASE_ASSERT(!filter.mPrimitives.IsEmpty()); + if (filter.mPrimitives.LastElement().IsTainted() && mCtx->mCanvasElement) { + mCtx->mCanvasElement->SetWriteOnly(); + } + } + + DrawTarget* DT() + { + return mTarget; + } + +private: + RefPtr mTarget; + RefPtr mFinalTarget; + CanvasRenderingContext2D* mCtx; + gfx::IntRect mSourceGraphicRect; + gfx::IntRect mFillPaintRect; + gfx::IntRect mStrokePaintRect; + gfx::IntRect mPostFilterBounds; + gfx::IntPoint mOffset; + gfx::CompositionOp mCompositionOp; +}; + +/* This is an RAII based class that can be used as a drawtarget for + * operations that need to have a shadow applied to their results. + * All coordinates passed to the constructor are in device space. + */ +class AdjustedTargetForShadow +{ +public: + typedef CanvasRenderingContext2D::ContextState ContextState; + + AdjustedTargetForShadow(CanvasRenderingContext2D* aCtx, + DrawTarget* aFinalTarget, + const gfx::Rect& aBounds, + gfx::CompositionOp aCompositionOp) + : mFinalTarget(aFinalTarget) + , mCtx(aCtx) + , mCompositionOp(aCompositionOp) + { + const ContextState& state = mCtx->CurrentState(); + mSigma = state.ShadowBlurSigma(); + + // We actually include the bounds of the shadow blur, this makes it + // easier to execute the actual blur on hardware, and shouldn't affect + // the amount of pixels that need to be touched. + gfx::Rect bounds = aBounds; + int32_t blurRadius = state.ShadowBlurRadius(); + bounds.Inflate(blurRadius); + bounds.RoundOut(); + bounds.ToIntRect(&mTempRect); + + mTarget = + mFinalTarget->CreateShadowDrawTarget(mTempRect.Size(), + SurfaceFormat::B8G8R8A8, mSigma); + + if (!mTarget) { + // XXX - Deal with the situation where our temp size is too big to + // fit in a texture (bug 1066622). + mTarget = mFinalTarget; + mCtx = nullptr; + mFinalTarget = nullptr; + } else { + mTarget->SetTransform( + mFinalTarget->GetTransform().PostTranslate(-mTempRect.TopLeft())); + } + } + + ~AdjustedTargetForShadow() + { + if (!mCtx) { + return; + } + + RefPtr snapshot = mTarget->Snapshot(); + + mFinalTarget->DrawSurfaceWithShadow(snapshot, mTempRect.TopLeft(), + Color::FromABGR(mCtx->CurrentState().shadowColor), + mCtx->CurrentState().shadowOffset, mSigma, + mCompositionOp); + } + + DrawTarget* DT() + { + return mTarget; + } + + gfx::IntPoint OffsetToFinalDT() + { + return mTempRect.TopLeft(); + } + +private: + RefPtr mTarget; + RefPtr mFinalTarget; + CanvasRenderingContext2D* mCtx; + Float mSigma; + gfx::IntRect mTempRect; + gfx::CompositionOp mCompositionOp; +}; + +/* + * This is an RAII based class that can be used as a drawtarget for + * operations that need a shadow or a filter drawn. It will automatically + * provide a temporary target when needed, and if so blend it back with a + * shadow, filter, or both. + * If both a shadow and a filter are needed, the filter is applied first, + * and the shadow is applied to the filtered results. + * + * aBounds specifies the bounds of the drawing operation that will be + * drawn to the target, it is given in device space! If this is nullptr the + * drawing operation will be assumed to cover the whole canvas. + */ +class AdjustedTarget +{ +public: + typedef CanvasRenderingContext2D::ContextState ContextState; + + explicit AdjustedTarget(CanvasRenderingContext2D* aCtx, + const gfx::Rect* aBounds = nullptr) + { + // All rects in this function are in the device space of ctx->mTarget. + + // In order to keep our temporary surfaces as small as possible, we first + // calculate what their maximum required bounds would need to be if we + // were to fill the whole canvas. Everything outside those bounds we don't + // need to render. + gfx::Rect r(0, 0, aCtx->mWidth, aCtx->mHeight); + gfx::Rect maxSourceNeededBoundsForShadow = + MaxSourceNeededBoundsForShadow(r, aCtx); + gfx::Rect maxSourceNeededBoundsForFilter = + MaxSourceNeededBoundsForFilter(maxSourceNeededBoundsForShadow, aCtx); + if (!aCtx->IsTargetValid()) { + return; + } + + gfx::Rect bounds = maxSourceNeededBoundsForFilter; + if (aBounds) { + bounds = bounds.Intersect(*aBounds); + } + gfx::Rect boundsAfterFilter = BoundsAfterFilter(bounds, aCtx); + if (!aCtx->IsTargetValid()) { + return; + } + + mozilla::gfx::CompositionOp op = aCtx->CurrentState().op; + + gfx::IntPoint offsetToFinalDT; + + // First set up the shadow draw target, because the shadow goes outside. + // It applies to the post-filter results, if both a filter and a shadow + // are used. + if (aCtx->NeedToDrawShadow()) { + mShadowTarget = MakeUnique( + aCtx, aCtx->mTarget, boundsAfterFilter, op); + mTarget = mShadowTarget->DT(); + offsetToFinalDT = mShadowTarget->OffsetToFinalDT(); + + // If we also have a filter, the filter needs to be drawn with OP_OVER + // because shadow drawing already applies op on the result. + op = gfx::CompositionOp::OP_OVER; + } + + // Now set up the filter draw target. + const bool applyFilter = aCtx->NeedToApplyFilter(); + if (!aCtx->IsTargetValid()) { + return; + } + if (applyFilter) { + bounds.RoundOut(); + + if (!mTarget) { + mTarget = aCtx->mTarget; + } + gfx::IntRect intBounds; + if (!bounds.ToIntRect(&intBounds)) { + return; + } + mFilterTarget = MakeUnique( + aCtx, mTarget, offsetToFinalDT, intBounds, + gfx::RoundedToInt(boundsAfterFilter), op); + mTarget = mFilterTarget->DT(); + } + if (!mTarget) { + mTarget = aCtx->mTarget; + } + } + + ~AdjustedTarget() + { + // The order in which the targets are finalized is important. + // Filters are inside, any shadow applies to the post-filter results. + mFilterTarget.reset(); + mShadowTarget.reset(); + } + + operator DrawTarget*() + { + return mTarget; + } + + DrawTarget* operator->() MOZ_NO_ADDREF_RELEASE_ON_RETURN + { + return mTarget; + } + +private: + + gfx::Rect + MaxSourceNeededBoundsForFilter(const gfx::Rect& aDestBounds, CanvasRenderingContext2D* aCtx) + { + const bool applyFilter = aCtx->NeedToApplyFilter(); + if (!aCtx->IsTargetValid()) { + return aDestBounds; + } + if (!applyFilter) { + return aDestBounds; + } + + nsIntRegion sourceGraphicNeededRegion; + nsIntRegion fillPaintNeededRegion; + nsIntRegion strokePaintNeededRegion; + + FilterSupport::ComputeSourceNeededRegions( + aCtx->CurrentState().filter, gfx::RoundedToInt(aDestBounds), + sourceGraphicNeededRegion, fillPaintNeededRegion, strokePaintNeededRegion); + + return gfx::Rect(sourceGraphicNeededRegion.GetBounds()); + } + + gfx::Rect + MaxSourceNeededBoundsForShadow(const gfx::Rect& aDestBounds, CanvasRenderingContext2D* aCtx) + { + if (!aCtx->NeedToDrawShadow()) { + return aDestBounds; + } + + const ContextState& state = aCtx->CurrentState(); + gfx::Rect sourceBounds = aDestBounds - state.shadowOffset; + sourceBounds.Inflate(state.ShadowBlurRadius()); + + // Union the shadow source with the original rect because we're going to + // draw both. + return sourceBounds.Union(aDestBounds); + } + + gfx::Rect + BoundsAfterFilter(const gfx::Rect& aBounds, CanvasRenderingContext2D* aCtx) + { + const bool applyFilter = aCtx->NeedToApplyFilter(); + if (!aCtx->IsTargetValid()) { + return aBounds; + } + if (!applyFilter) { + return aBounds; + } + + gfx::Rect bounds(aBounds); + bounds.RoundOut(); + + gfx::IntRect intBounds; + if (!bounds.ToIntRect(&intBounds)) { + return gfx::Rect(); + } + + nsIntRegion extents = + gfx::FilterSupport::ComputePostFilterExtents(aCtx->CurrentState().filter, + intBounds); + return gfx::Rect(extents.GetBounds()); + } + + RefPtr mTarget; + UniquePtr mShadowTarget; + UniquePtr mFilterTarget; +}; + +void +CanvasPattern::SetTransform(SVGMatrix& aMatrix) +{ + mTransform = ToMatrix(aMatrix.GetMatrix()); +} + +void +CanvasGradient::AddColorStop(float aOffset, const nsAString& aColorstr, ErrorResult& aRv) +{ + if (aOffset < 0.0 || aOffset > 1.0) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + nsCSSValue value; + nsCSSParser parser; + if (!parser.ParseColorString(aColorstr, nullptr, 0, value)) { + aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); + return; + } + + nscolor color; + nsCOMPtr presShell = mContext ? mContext->GetPresShell() : nullptr; + if (!nsRuleNode::ComputeColor(value, presShell ? presShell->GetPresContext() : nullptr, + nullptr, color)) { + aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); + return; + } + + mStops = nullptr; + + GradientStop newStop; + + newStop.offset = aOffset; + newStop.color = Color::FromABGR(color); + + mRawStops.AppendElement(newStop); +} + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasGradient, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasGradient, Release) + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasGradient, mContext) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasPattern, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasPattern, Release) + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasPattern, mContext) + +class CanvasShutdownObserver final : public nsIObserver +{ +public: + explicit CanvasShutdownObserver(CanvasRenderingContext2D* aCanvas) + : mCanvas(aCanvas) + {} + + NS_DECL_ISUPPORTS + NS_DECL_NSIOBSERVER +private: + ~CanvasShutdownObserver() {} + + CanvasRenderingContext2D* mCanvas; +}; + +NS_IMPL_ISUPPORTS(CanvasShutdownObserver, nsIObserver) + +NS_IMETHODIMP +CanvasShutdownObserver::Observe(nsISupports* aSubject, + const char* aTopic, + const char16_t* aData) +{ + if (mCanvas && strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) { + mCanvas->OnShutdown(); + nsContentUtils::UnregisterShutdownObserver(this); + } + + return NS_OK; +} + +class CanvasDrawObserver +{ +public: + explicit CanvasDrawObserver(CanvasRenderingContext2D* aCanvasContext); + + // Only enumerate draw calls that could affect the heuristic + enum DrawCallType { + PutImageData, + GetImageData, + DrawImage + }; + + // This is the one that we call on relevant draw calls and count + // GPU vs. CPU preferrable calls... + void DidDrawCall(DrawCallType aType); + + // When this returns true, the observer is done making the decisions. + // Right now, we expect to get rid of the observer after the FrameEnd + // returns true, though the decision could eventually change if the + // function calls shift. If we change to monitor the functions called + // and make decisions to change more than once, we would probably want + // FrameEnd to reset the timer and counters as it returns true. + bool FrameEnd(); + +private: + // These values will be picked up from preferences: + int32_t mMinFramesBeforeDecision; + float mMinSecondsBeforeDecision; + int32_t mMinCallsBeforeDecision; + + CanvasRenderingContext2D* mCanvasContext; + int32_t mSoftwarePreferredCalls; + int32_t mGPUPreferredCalls; + int32_t mFramesRendered; + TimeStamp mCreationTime; +}; + +// We are not checking for the validity of the preference values. For example, +// negative values will have an effect of a quick exit, so no harm done. +CanvasDrawObserver::CanvasDrawObserver(CanvasRenderingContext2D* aCanvasContext) + : mMinFramesBeforeDecision(gfxPrefs::CanvasAutoAccelerateMinFrames()) + , mMinSecondsBeforeDecision(gfxPrefs::CanvasAutoAccelerateMinSeconds()) + , mMinCallsBeforeDecision(gfxPrefs::CanvasAutoAccelerateMinCalls()) + , mCanvasContext(aCanvasContext) + , mSoftwarePreferredCalls(0) + , mGPUPreferredCalls(0) + , mFramesRendered(0) + , mCreationTime(TimeStamp::NowLoRes()) +{} + +void +CanvasDrawObserver::DidDrawCall(DrawCallType aType) +{ + switch (aType) { + case PutImageData: + case GetImageData: + if (mGPUPreferredCalls == 0 && mSoftwarePreferredCalls == 0) { + mCreationTime = TimeStamp::NowLoRes(); + } + mSoftwarePreferredCalls++; + break; + case DrawImage: + if (mGPUPreferredCalls == 0 && mSoftwarePreferredCalls == 0) { + mCreationTime = TimeStamp::NowLoRes(); + } + mGPUPreferredCalls++; + break; + } +} + +// If we return true, the observer is done making the decisions... +bool +CanvasDrawObserver::FrameEnd() +{ + mFramesRendered++; + + // We log the first mMinFramesBeforeDecision frames of any + // canvas object then make a call to determine whether it should + // be GPU or CPU backed + if ((mFramesRendered >= mMinFramesBeforeDecision) || + ((TimeStamp::NowLoRes() - mCreationTime).ToSeconds()) > mMinSecondsBeforeDecision) { + + // If we don't have enough data, don't bother changing... + if (mGPUPreferredCalls > mMinCallsBeforeDecision || + mSoftwarePreferredCalls > mMinCallsBeforeDecision) { + CanvasRenderingContext2D::RenderingMode switchToMode; + if (mGPUPreferredCalls >= mSoftwarePreferredCalls) { + switchToMode = CanvasRenderingContext2D::RenderingMode::OpenGLBackendMode; + } else { + switchToMode = CanvasRenderingContext2D::RenderingMode::SoftwareBackendMode; + } + if (switchToMode != mCanvasContext->mRenderingMode) { + if (!mCanvasContext->SwitchRenderingMode(switchToMode)) { + gfxDebug() << "Canvas acceleration failed mode switch to " << switchToMode; + } + } + } + + // If we ever redesign this class to constantly monitor the functions + // and keep making decisions, we would probably want to reset the counters + // and the timers here... + return true; + } + return false; +} + +class CanvasRenderingContext2DUserData : public LayerUserData { +public: + explicit CanvasRenderingContext2DUserData(CanvasRenderingContext2D* aContext) + : mContext(aContext) + { + aContext->mUserDatas.AppendElement(this); + } + ~CanvasRenderingContext2DUserData() + { + if (mContext) { + mContext->mUserDatas.RemoveElement(this); + } + } + + static void PreTransactionCallback(void* aData) + { + auto self = static_cast(aData); + CanvasRenderingContext2D* context = self->mContext; + if (!context || !context->mTarget) + return; + + context->OnStableState(); + } + + static void DidTransactionCallback(void* aData) + { + auto self = static_cast(aData); + if (self->mContext) { + self->mContext->MarkContextClean(); + if (self->mContext->mDrawObserver) { + if (self->mContext->mDrawObserver->FrameEnd()) { + // Note that this call deletes and nulls out mDrawObserver: + self->mContext->RemoveDrawObserver(); + } + } + } + } + bool IsForContext(CanvasRenderingContext2D* aContext) + { + return mContext == aContext; + } + void Forget() + { + mContext = nullptr; + } + +private: + CanvasRenderingContext2D* mContext; +}; + +class CanvasFilterChainObserver : public nsSVGFilterChainObserver +{ +public: + CanvasFilterChainObserver(nsTArray& aFilters, + Element* aCanvasElement, + CanvasRenderingContext2D* aContext) + : nsSVGFilterChainObserver(aFilters, aCanvasElement) + , mContext(aContext) + { + } + + virtual void DoUpdate() override + { + if (!mContext) { + MOZ_CRASH("GFX: This should never be called without a context"); + } + // Refresh the cached FilterDescription in mContext->CurrentState().filter. + // If this filter is not at the top of the state stack, we'll refresh the + // wrong filter, but that's ok, because we'll refresh the right filter + // when we pop the state stack in CanvasRenderingContext2D::Restore(). + RefPtr kungFuDeathGrip(mContext); + kungFuDeathGrip->UpdateFilter(); + } + + void DetachFromContext() { mContext = nullptr; } + +private: + CanvasRenderingContext2D* mContext; +}; + +NS_IMPL_CYCLE_COLLECTING_ADDREF(CanvasRenderingContext2D) +NS_IMPL_CYCLE_COLLECTING_RELEASE(CanvasRenderingContext2D) + +NS_IMPL_CYCLE_COLLECTION_CLASS(CanvasRenderingContext2D) + +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D) + // Make sure we remove ourselves from the list of demotable contexts (raw pointers), + // since we're logically destructed at this point. + CanvasRenderingContext2D::RemoveDemotableContext(tmp); + NS_IMPL_CYCLE_COLLECTION_UNLINK(mCanvasElement) + for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) { + ImplCycleCollectionUnlink(tmp->mStyleStack[i].patternStyles[Style::STROKE]); + ImplCycleCollectionUnlink(tmp->mStyleStack[i].patternStyles[Style::FILL]); + ImplCycleCollectionUnlink(tmp->mStyleStack[i].gradientStyles[Style::STROKE]); + ImplCycleCollectionUnlink(tmp->mStyleStack[i].gradientStyles[Style::FILL]); + auto filterChainObserver = + static_cast(tmp->mStyleStack[i].filterChainObserver.get()); + if (filterChainObserver) { + filterChainObserver->DetachFromContext(); + } + ImplCycleCollectionUnlink(tmp->mStyleStack[i].filterChainObserver); + } + for (size_t x = 0 ; x < tmp->mHitRegionsOptions.Length(); x++) { + RegionInfo& info = tmp->mHitRegionsOptions[x]; + if (info.mElement) { + ImplCycleCollectionUnlink(info.mElement); + } + } + NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER +NS_IMPL_CYCLE_COLLECTION_UNLINK_END + +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCanvasElement) + for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) { + ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::STROKE], "Stroke CanvasPattern"); + ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::FILL], "Fill CanvasPattern"); + ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].gradientStyles[Style::STROKE], "Stroke CanvasGradient"); + ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].gradientStyles[Style::FILL], "Fill CanvasGradient"); + ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].filterChainObserver, "Filter Chain Observer"); + } + for (size_t x = 0 ; x < tmp->mHitRegionsOptions.Length(); x++) { + RegionInfo& info = tmp->mHitRegionsOptions[x]; + if (info.mElement) { + ImplCycleCollectionTraverse(cb, info.mElement, "Hit region fallback element"); + } + } + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END + +NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CanvasRenderingContext2D) + +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CanvasRenderingContext2D) + if (nsCCUncollectableMarker::sGeneration && tmp->IsBlack()) { + dom::Element* canvasElement = tmp->mCanvasElement; + if (canvasElement) { + if (canvasElement->IsPurple()) { + canvasElement->RemovePurple(); + } + dom::Element::MarkNodeChildren(canvasElement); + } + return true; + } +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END + +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(CanvasRenderingContext2D) + return nsCCUncollectableMarker::sGeneration && tmp->IsBlack(); +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END + +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(CanvasRenderingContext2D) + return nsCCUncollectableMarker::sGeneration && tmp->IsBlack(); +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CanvasRenderingContext2D) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal) + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +/** + ** CanvasRenderingContext2D impl + **/ + + +// Initialize our static variables. +uintptr_t CanvasRenderingContext2D::sNumLivingContexts = 0; +DrawTarget* CanvasRenderingContext2D::sErrorTarget = nullptr; + + + +CanvasRenderingContext2D::CanvasRenderingContext2D(layers::LayersBackend aCompositorBackend) + : mRenderingMode(RenderingMode::OpenGLBackendMode) + , mCompositorBackend(aCompositorBackend) + // these are the default values from the Canvas spec + , mWidth(0), mHeight(0) + , mZero(false), mOpaque(false) + , mResetLayer(true) + , mIPC(false) + , mIsSkiaGL(false) + , mHasPendingStableStateCallback(false) + , mDrawObserver(nullptr) + , mIsEntireFrameInvalid(false) + , mPredictManyRedrawCalls(false) + , mIsCapturedFrameInvalid(false) + , mPathTransformWillUpdate(false) + , mInvalidateCount(0) +{ + sNumLivingContexts++; + + mShutdownObserver = new CanvasShutdownObserver(this); + nsContentUtils::RegisterShutdownObserver(mShutdownObserver); + + // The default is to use OpenGL mode + if (AllowOpenGLCanvas()) { + mDrawObserver = new CanvasDrawObserver(this); + } else { + mRenderingMode = RenderingMode::SoftwareBackendMode; + } +} + +CanvasRenderingContext2D::~CanvasRenderingContext2D() +{ + RemoveDrawObserver(); + RemovePostRefreshObserver(); + RemoveShutdownObserver(); + Reset(); + // Drop references from all CanvasRenderingContext2DUserData to this context + for (uint32_t i = 0; i < mUserDatas.Length(); ++i) { + mUserDatas[i]->Forget(); + } + sNumLivingContexts--; + if (!sNumLivingContexts) { + NS_IF_RELEASE(sErrorTarget); + } + RemoveDemotableContext(this); +} + +JSObject* +CanvasRenderingContext2D::WrapObject(JSContext* aCx, JS::Handle aGivenProto) +{ + return CanvasRenderingContext2DBinding::Wrap(aCx, this, aGivenProto); +} + +bool +CanvasRenderingContext2D::ParseColor(const nsAString& aString, + nscolor* aColor) +{ + nsIDocument* document = mCanvasElement + ? mCanvasElement->OwnerDoc() + : nullptr; + + // Pass the CSS Loader object to the parser, to allow parser error + // reports to include the outer window ID. + nsCSSParser parser(document ? document->CSSLoader() : nullptr); + nsCSSValue value; + if (!parser.ParseColorString(aString, nullptr, 0, value)) { + return false; + } + + if (value.IsNumericColorUnit()) { + // if we already have a color we can just use it directly + *aColor = value.GetColorValue(); + } else { + // otherwise resolve it + nsCOMPtr presShell = GetPresShell(); + RefPtr parentContext; + if (mCanvasElement && mCanvasElement->IsInUncomposedDoc()) { + // Inherit from the canvas element. + parentContext = nsComputedDOMStyle::GetStyleContextForElement( + mCanvasElement, nullptr, presShell); + } + + Unused << nsRuleNode::ComputeColor( + value, presShell ? presShell->GetPresContext() : nullptr, parentContext, + *aColor); + } + return true; +} + +nsresult +CanvasRenderingContext2D::Reset() +{ + if (mCanvasElement) { + mCanvasElement->InvalidateCanvas(); + } + + // only do this for non-docshell created contexts, + // since those are the ones that we created a surface for + if (mTarget && IsTargetValid() && !mDocShell) { + gCanvasAzureMemoryUsed -= mWidth * mHeight * 4; + } + + bool forceReset = true; + ReturnTarget(forceReset); + mTarget = nullptr; + mBufferProvider = nullptr; + + // reset hit regions + mHitRegionsOptions.ClearAndRetainStorage(); + + // Since the target changes the backing texture will change, and this will + // no longer be valid. + mIsEntireFrameInvalid = false; + mPredictManyRedrawCalls = false; + mIsCapturedFrameInvalid = false; + + return NS_OK; +} + +void +CanvasRenderingContext2D::OnShutdown() +{ + mShutdownObserver = nullptr; + + RefPtr provider = mBufferProvider; + + Reset(); + + if (provider) { + provider->OnShutdown(); + } +} + +void +CanvasRenderingContext2D::RemoveShutdownObserver() +{ + if (mShutdownObserver) { + nsContentUtils::UnregisterShutdownObserver(mShutdownObserver); + mShutdownObserver = nullptr; + } +} + +void +CanvasRenderingContext2D::SetStyleFromString(const nsAString& aStr, + Style aWhichStyle) +{ + MOZ_ASSERT(!aStr.IsVoid()); + + nscolor color; + if (!ParseColor(aStr, &color)) { + return; + } + + CurrentState().SetColorStyle(aWhichStyle, color); +} + +void +CanvasRenderingContext2D::GetStyleAsUnion(OwningStringOrCanvasGradientOrCanvasPattern& aValue, + Style aWhichStyle) +{ + const ContextState& state = CurrentState(); + if (state.patternStyles[aWhichStyle]) { + aValue.SetAsCanvasPattern() = state.patternStyles[aWhichStyle]; + } else if (state.gradientStyles[aWhichStyle]) { + aValue.SetAsCanvasGradient() = state.gradientStyles[aWhichStyle]; + } else { + StyleColorToString(state.colorStyles[aWhichStyle], aValue.SetAsString()); + } +} + +// static +void +CanvasRenderingContext2D::StyleColorToString(const nscolor& aColor, nsAString& aStr) +{ + // We can't reuse the normal CSS color stringification code, + // because the spec calls for a different algorithm for canvas. + if (NS_GET_A(aColor) == 255) { + CopyUTF8toUTF16(nsPrintfCString("#%02x%02x%02x", + NS_GET_R(aColor), + NS_GET_G(aColor), + NS_GET_B(aColor)), + aStr); + } else { + CopyUTF8toUTF16(nsPrintfCString("rgba(%d, %d, %d, ", + NS_GET_R(aColor), + NS_GET_G(aColor), + NS_GET_B(aColor)), + aStr); + aStr.AppendFloat(nsStyleUtil::ColorComponentToFloat(NS_GET_A(aColor))); + aStr.Append(')'); + } +} + +nsresult +CanvasRenderingContext2D::Redraw() +{ + mIsCapturedFrameInvalid = true; + + if (mIsEntireFrameInvalid) { + return NS_OK; + } + + mIsEntireFrameInvalid = true; + + if (!mCanvasElement) { + NS_ASSERTION(mDocShell, "Redraw with no canvas element or docshell!"); + return NS_OK; + } + + nsSVGEffects::InvalidateDirectRenderingObservers(mCanvasElement); + + mCanvasElement->InvalidateCanvasContent(nullptr); + + return NS_OK; +} + +void +CanvasRenderingContext2D::Redraw(const gfx::Rect& aR) +{ + mIsCapturedFrameInvalid = true; + + ++mInvalidateCount; + + if (mIsEntireFrameInvalid) { + return; + } + + if (mPredictManyRedrawCalls || + mInvalidateCount > kCanvasMaxInvalidateCount) { + Redraw(); + return; + } + + if (!mCanvasElement) { + NS_ASSERTION(mDocShell, "Redraw with no canvas element or docshell!"); + return; + } + + nsSVGEffects::InvalidateDirectRenderingObservers(mCanvasElement); + + mCanvasElement->InvalidateCanvasContent(&aR); +} + +void +CanvasRenderingContext2D::DidRefresh() +{ + if (IsTargetValid() && mIsSkiaGL) { + SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue(); + MOZ_ASSERT(glue); + + auto gl = glue->GetGLContext(); + gl->FlushIfHeavyGLCallsSinceLastFlush(); + } +} + +void +CanvasRenderingContext2D::RedrawUser(const gfxRect& aR) +{ + mIsCapturedFrameInvalid = true; + + if (mIsEntireFrameInvalid) { + ++mInvalidateCount; + return; + } + + gfx::Rect newr = mTarget->GetTransform().TransformBounds(ToRect(aR)); + Redraw(newr); +} + +bool +CanvasRenderingContext2D::AllowOpenGLCanvas() const +{ + // If we somehow didn't have the correct compositor in the constructor, + // we could do something like this to get it: + // + // HTMLCanvasElement* el = GetCanvas(); + // if (el) { + // mCompositorBackend = el->GetCompositorBackendType(); + // } + // + // We could have LAYERS_NONE if there was no widget at the time of + // canvas creation, but in that case the + // HTMLCanvasElement::GetCompositorBackendType would return LAYERS_NONE + // as well, so it wouldn't help much. + + return (mCompositorBackend == LayersBackend::LAYERS_OPENGL) && + gfxPlatform::GetPlatform()->AllowOpenGLCanvas(); +} + +bool CanvasRenderingContext2D::SwitchRenderingMode(RenderingMode aRenderingMode) +{ + if (!IsTargetValid() || mRenderingMode == aRenderingMode) { + return false; + } + + MOZ_ASSERT(mBufferProvider); + +#ifdef USE_SKIA_GPU + // Do not attempt to switch into GL mode if the platform doesn't allow it. + if ((aRenderingMode == RenderingMode::OpenGLBackendMode) && + !AllowOpenGLCanvas()) { + return false; + } +#endif + + RefPtr oldBufferProvider = mBufferProvider; + + // Return the old target to the buffer provider. + // We need to do this before calling EnsureTarget. + ReturnTarget(); + mTarget = nullptr; + mBufferProvider = nullptr; + mResetLayer = true; + + // Borrowing the snapshot must be done after ReturnTarget. + RefPtr snapshot = oldBufferProvider->BorrowSnapshot(); + + // Recreate mTarget using the new rendering mode + RenderingMode attemptedMode = EnsureTarget(nullptr, aRenderingMode); + if (!IsTargetValid()) { + oldBufferProvider->ReturnSnapshot(snapshot.forget()); + return false; + } + + // We succeeded, so update mRenderingMode to reflect reality + mRenderingMode = attemptedMode; + + // Restore the content from the old DrawTarget + // Clips and transform were already restored in EnsureTarget. + mTarget->CopySurface(snapshot, IntRect(0, 0, mWidth, mHeight), IntPoint()); + oldBufferProvider->ReturnSnapshot(snapshot.forget()); + return true; +} + +void CanvasRenderingContext2D::Demote() +{ + if (SwitchRenderingMode(RenderingMode::SoftwareBackendMode)) { + RemoveDemotableContext(this); + } +} + +std::vector& +CanvasRenderingContext2D::DemotableContexts() +{ + // This is a list of raw pointers to cycle-collected objects. We need to ensure + // that we remove elements from it during UNLINK (which can happen considerably before + // the actual destructor) since the object is logically destroyed at that point + // and will be in an inconsistant state. + static std::vector contexts; + return contexts; +} + +void +CanvasRenderingContext2D::DemoteOldestContextIfNecessary() +{ + const size_t kMaxContexts = 64; + + std::vector& contexts = DemotableContexts(); + if (contexts.size() < kMaxContexts) + return; + + CanvasRenderingContext2D* oldest = contexts.front(); + if (oldest->SwitchRenderingMode(RenderingMode::SoftwareBackendMode)) { + RemoveDemotableContext(oldest); + } +} + +void +CanvasRenderingContext2D::AddDemotableContext(CanvasRenderingContext2D* aContext) +{ + std::vector::iterator iter = std::find(DemotableContexts().begin(), DemotableContexts().end(), aContext); + if (iter != DemotableContexts().end()) + return; + + DemotableContexts().push_back(aContext); +} + +void +CanvasRenderingContext2D::RemoveDemotableContext(CanvasRenderingContext2D* aContext) +{ + std::vector::iterator iter = std::find(DemotableContexts().begin(), DemotableContexts().end(), aContext); + if (iter != DemotableContexts().end()) + DemotableContexts().erase(iter); +} + +bool +CanvasRenderingContext2D::CheckSizeForSkiaGL(IntSize aSize) { + MOZ_ASSERT(NS_IsMainThread()); + + int minsize = Preferences::GetInt("gfx.canvas.min-size-for-skia-gl", 128); + if (aSize.width < minsize || aSize.height < minsize) { + return false; + } + + // Maximum pref allows 3 different options: + // 0 means unlimited size + // > 0 means use value as an absolute threshold + // < 0 means use the number of screen pixels as a threshold + int maxsize = Preferences::GetInt("gfx.canvas.max-size-for-skia-gl", 0); + + // unlimited max size + if (!maxsize) { + return true; + } + + // absolute max size threshold + if (maxsize > 0) { + return aSize.width <= maxsize && aSize.height <= maxsize; + } + + // Cache the number of pixels on the primary screen + static int32_t gScreenPixels = -1; + if (gScreenPixels < 0) { + // Default to historical mobile screen size of 980x480, like FishIEtank. + // In addition, allow skia use up to this size even if the screen is smaller. + // A lot content expects this size to work well. + // See Bug 999841 + if (gfxPlatform::GetPlatform()->HasEnoughTotalSystemMemoryForSkiaGL()) { + gScreenPixels = 980 * 480; + } + + nsCOMPtr screenManager = + do_GetService("@mozilla.org/gfx/screenmanager;1"); + if (screenManager) { + nsCOMPtr primaryScreen; + screenManager->GetPrimaryScreen(getter_AddRefs(primaryScreen)); + if (primaryScreen) { + int32_t x, y, width, height; + primaryScreen->GetRect(&x, &y, &width, &height); + + gScreenPixels = std::max(gScreenPixels, width * height); + } + } + } + + // Just always use a scale of 1.0. It can be changed if a lot of contents need it. + static double gDefaultScale = 1.0; + + double scale = gDefaultScale > 0 ? gDefaultScale : 1.0; + int32_t threshold = ceil(scale * scale * gScreenPixels); + + // screen size acts as max threshold + return threshold < 0 || (aSize.width * aSize.height) <= threshold; +} + +void +CanvasRenderingContext2D::ScheduleStableStateCallback() +{ + if (mHasPendingStableStateCallback) { + return; + } + mHasPendingStableStateCallback = true; + + nsContentUtils::RunInStableState( + NewRunnableMethod(this, &CanvasRenderingContext2D::OnStableState) + ); +} + +void +CanvasRenderingContext2D::OnStableState() +{ + if (!mHasPendingStableStateCallback) { + return; + } + + ReturnTarget(); + + mHasPendingStableStateCallback = false; +} + +void +CanvasRenderingContext2D::RestoreClipsAndTransformToTarget() +{ + // Restore clips and transform. + mTarget->SetTransform(Matrix()); + + if (mTarget->GetBackendType() == gfx::BackendType::CAIRO) { + // Cairo doesn't play well with huge clips. When given a very big clip it + // will try to allocate big mask surface without taking the target + // size into account which can cause OOM. See bug 1034593. + // This limits the clip extents to the size of the canvas. + // A fix in Cairo would probably be preferable, but requires somewhat + // invasive changes. + mTarget->PushClipRect(gfx::Rect(0, 0, mWidth, mHeight)); + } + + for (const auto& style : mStyleStack) { + for (const auto& clipOrTransform : style.clipsAndTransforms) { + if (clipOrTransform.IsClip()) { + mTarget->PushClip(clipOrTransform.clip); + } else { + mTarget->SetTransform(clipOrTransform.transform); + } + } + } +} + +CanvasRenderingContext2D::RenderingMode +CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect, + RenderingMode aRenderingMode) +{ + if (AlreadyShutDown()) { + gfxCriticalError() << "Attempt to render into a Canvas2d after shutdown."; + SetErrorState(); + return aRenderingMode; + } + + // This would make no sense, so make sure we don't get ourselves in a mess + MOZ_ASSERT(mRenderingMode != RenderingMode::DefaultBackendMode); + + RenderingMode mode = (aRenderingMode == RenderingMode::DefaultBackendMode) ? mRenderingMode : aRenderingMode; + + if (mTarget && mode == mRenderingMode) { + return mRenderingMode; + } + + // Check that the dimensions are sane + if (mWidth > gfxPrefs::MaxCanvasSize() || + mHeight > gfxPrefs::MaxCanvasSize() || + mWidth < 0 || mHeight < 0) { + + SetErrorState(); + return aRenderingMode; + } + + // If the next drawing command covers the entire canvas, we can skip copying + // from the previous frame and/or clearing the canvas. + gfx::Rect canvasRect(0, 0, mWidth, mHeight); + bool canDiscardContent = aCoveredRect && + CurrentState().transform.TransformBounds(*aCoveredRect).Contains(canvasRect); + + // If a clip is active we don't know for sure that the next drawing command + // will really cover the entire canvas. + for (const auto& style : mStyleStack) { + if (!canDiscardContent) { + break; + } + for (const auto& clipOrTransform : style.clipsAndTransforms) { + if (clipOrTransform.IsClip()) { + canDiscardContent = false; + break; + } + } + } + + ScheduleStableStateCallback(); + + IntRect persistedRect = canDiscardContent ? IntRect() + : IntRect(0, 0, mWidth, mHeight); + + if (mBufferProvider && mode == mRenderingMode) { + mTarget = mBufferProvider->BorrowDrawTarget(persistedRect); + + if (mTarget && !mBufferProvider->PreservesDrawingState()) { + RestoreClipsAndTransformToTarget(); + } + + if (mTarget) { + return mode; + } + } + + RefPtr newTarget; + RefPtr newProvider; + + if (mode == RenderingMode::OpenGLBackendMode && + !TrySkiaGLTarget(newTarget, newProvider)) { + // Fall back to software. + mode = RenderingMode::SoftwareBackendMode; + } + + if (mode == RenderingMode::SoftwareBackendMode && + !TrySharedTarget(newTarget, newProvider) && + !TryBasicTarget(newTarget, newProvider)) { + SetErrorState(); + return mode; + } + + MOZ_ASSERT(newTarget); + MOZ_ASSERT(newProvider); + + mTarget = newTarget.forget(); + mBufferProvider = newProvider.forget(); + + RegisterAllocation(); + + // Skia expects the unused X channel to contains 0 even for opaque operations + // so we can't skip clearing in that case, even if we are going to cover the + // entire canvas in the next drawing operation. + if (!canDiscardContent || mTarget->GetBackendType() == gfx::BackendType::SKIA) { + mTarget->ClearRect(canvasRect); + } + + RestoreClipsAndTransformToTarget(); + + // Force a full layer transaction since we didn't have a layer before + // and now we might need one. + if (mCanvasElement) { + mCanvasElement->InvalidateCanvas(); + } + // Calling Redraw() tells our invalidation machinery that the entire + // canvas is already invalid, which can speed up future drawing. + Redraw(); + + return mode; +} + +void +CanvasRenderingContext2D::SetInitialState() +{ + // Set up the initial canvas defaults + mPathBuilder = nullptr; + mPath = nullptr; + mDSPathBuilder = nullptr; + mPathTransformWillUpdate = false; + + mStyleStack.Clear(); + ContextState* state = mStyleStack.AppendElement(); + state->globalAlpha = 1.0; + + state->colorStyles[Style::FILL] = NS_RGB(0,0,0); + state->colorStyles[Style::STROKE] = NS_RGB(0,0,0); + state->shadowColor = NS_RGBA(0,0,0,0); +} + +void +CanvasRenderingContext2D::SetErrorState() +{ + EnsureErrorTarget(); + + if (mTarget && mTarget != sErrorTarget) { + gCanvasAzureMemoryUsed -= mWidth * mHeight * 4; + } + + mTarget = sErrorTarget; + mBufferProvider = nullptr; + + // clear transforms, clips, etc. + SetInitialState(); +} + +void +CanvasRenderingContext2D::RegisterAllocation() +{ + // XXX - It would make more sense to track the allocation in + // PeristentBufferProvider, rather than here. + static bool registered = false; + // FIXME: Disable the reporter for now, see bug 1241865 + if (!registered && false) { + registered = true; + RegisterStrongMemoryReporter(new Canvas2dPixelsReporter()); + } + + gCanvasAzureMemoryUsed += mWidth * mHeight * 4; + JSContext* context = nsContentUtils::GetCurrentJSContext(); + if (context) { + JS_updateMallocCounter(context, mWidth * mHeight * 4); + } +} + +static already_AddRefed +LayerManagerFromCanvasElement(nsINode* aCanvasElement) +{ + if (!aCanvasElement || !aCanvasElement->OwnerDoc()) { + return nullptr; + } + + return nsContentUtils::PersistentLayerManagerForDocument(aCanvasElement->OwnerDoc()); +} + +bool +CanvasRenderingContext2D::TrySkiaGLTarget(RefPtr& aOutDT, + RefPtr& aOutProvider) +{ + aOutDT = nullptr; + aOutProvider = nullptr; + + mIsSkiaGL = false; + + IntSize size(mWidth, mHeight); + if (!AllowOpenGLCanvas() || !CheckSizeForSkiaGL(size)) { + return false; + } + + + RefPtr layerManager = LayerManagerFromCanvasElement(mCanvasElement); + + if (!layerManager) { + return false; + } + + DemoteOldestContextIfNecessary(); + mBufferProvider = nullptr; + +#ifdef USE_SKIA_GPU + SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue(); + if (!glue || !glue->GetGrContext() || !glue->GetGLContext()) { + return false; + } + + SurfaceFormat format = GetSurfaceFormat(); + aOutDT = Factory::CreateDrawTargetSkiaWithGrContext(glue->GetGrContext(), + size, format); + if (!aOutDT) { + gfxCriticalNote << "Failed to create a SkiaGL DrawTarget, falling back to software\n"; + return false; + } + + MOZ_ASSERT(aOutDT->GetType() == DrawTargetType::HARDWARE_RASTER); + + AddDemotableContext(this); + aOutProvider = new PersistentBufferProviderBasic(aOutDT); + mIsSkiaGL = true; + // Drop a note in the debug builds if we ever use accelerated Skia canvas. + gfxWarningOnce() << "Using SkiaGL canvas."; +#endif + + // could still be null if USE_SKIA_GPU is not #defined. + return !!aOutDT; +} + +bool +CanvasRenderingContext2D::TrySharedTarget(RefPtr& aOutDT, + RefPtr& aOutProvider) +{ + aOutDT = nullptr; + aOutProvider = nullptr; + + if (!mCanvasElement || !mCanvasElement->OwnerDoc()) { + return false; + } + + RefPtr layerManager = LayerManagerFromCanvasElement(mCanvasElement); + + if (!layerManager) { + return false; + } + + aOutProvider = layerManager->CreatePersistentBufferProvider(GetSize(), GetSurfaceFormat()); + + if (!aOutProvider) { + return false; + } + + // We can pass an empty persisted rect since we just created the buffer + // provider (nothing to restore). + aOutDT = aOutProvider->BorrowDrawTarget(IntRect()); + MOZ_ASSERT(aOutDT); + + return !!aOutDT; +} + +bool +CanvasRenderingContext2D::TryBasicTarget(RefPtr& aOutDT, + RefPtr& aOutProvider) +{ + aOutDT = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(GetSize(), + GetSurfaceFormat()); + if (!aOutDT) { + return false; + } + + aOutProvider = new PersistentBufferProviderBasic(aOutDT); + return true; +} + +int32_t +CanvasRenderingContext2D::GetWidth() const +{ + return mWidth; +} + +int32_t +CanvasRenderingContext2D::GetHeight() const +{ + return mHeight; +} + +NS_IMETHODIMP +CanvasRenderingContext2D::SetDimensions(int32_t aWidth, int32_t aHeight) +{ + ClearTarget(); + + // Zero sized surfaces can cause problems. + mZero = false; + if (aHeight == 0) { + aHeight = 1; + mZero = true; + } + if (aWidth == 0) { + aWidth = 1; + mZero = true; + } + mWidth = aWidth; + mHeight = aHeight; + + return NS_OK; +} + +void +CanvasRenderingContext2D::ClearTarget() +{ + Reset(); + + mResetLayer = true; + + SetInitialState(); + + // For vertical writing-mode, unless text-orientation is sideways, + // we'll modify the initial value of textBaseline to 'middle'. + RefPtr canvasStyle; + if (mCanvasElement && mCanvasElement->IsInUncomposedDoc()) { + nsCOMPtr presShell = GetPresShell(); + if (presShell) { + canvasStyle = + nsComputedDOMStyle::GetStyleContextForElement(mCanvasElement, + nullptr, + presShell); + if (canvasStyle) { + WritingMode wm(canvasStyle); + if (wm.IsVertical() && !wm.IsSideways()) { + CurrentState().textBaseline = TextBaseline::MIDDLE; + } + } + } + } +} + +void +CanvasRenderingContext2D::ReturnTarget(bool aForceReset) +{ + if (mTarget && mBufferProvider && mTarget != sErrorTarget) { + CurrentState().transform = mTarget->GetTransform(); + if (aForceReset || !mBufferProvider->PreservesDrawingState()) { + for (const auto& style : mStyleStack) { + for (const auto& clipOrTransform : style.clipsAndTransforms) { + if (clipOrTransform.IsClip()) { + mTarget->PopClip(); + } + } + } + + if (mTarget->GetBackendType() == gfx::BackendType::CAIRO) { + // With the cairo backend we pushed an extra clip rect which we have to + // balance out here. See the comment in RestoreClipsAndTransformToTarget. + mTarget->PopClip(); + } + + mTarget->SetTransform(Matrix()); + } + + mBufferProvider->ReturnDrawTarget(mTarget.forget()); + } +} + +NS_IMETHODIMP +CanvasRenderingContext2D::InitializeWithDrawTarget(nsIDocShell* aShell, + NotNull aTarget) +{ + RemovePostRefreshObserver(); + mDocShell = aShell; + AddPostRefreshObserverIfNecessary(); + + IntSize size = aTarget->GetSize(); + SetDimensions(size.width, size.height); + + mTarget = aTarget; + mBufferProvider = new PersistentBufferProviderBasic(aTarget); + + if (mTarget->GetBackendType() == gfx::BackendType::CAIRO) { + // Cf comment in EnsureTarget + mTarget->PushClipRect(gfx::Rect(Point(0, 0), Size(mWidth, mHeight))); + } + + return NS_OK; +} + +NS_IMETHODIMP +CanvasRenderingContext2D::SetIsOpaque(bool aIsOpaque) +{ + if (aIsOpaque != mOpaque) { + mOpaque = aIsOpaque; + ClearTarget(); + } + + return NS_OK; +} + +NS_IMETHODIMP +CanvasRenderingContext2D::SetIsIPC(bool aIsIPC) +{ + if (aIsIPC != mIPC) { + mIPC = aIsIPC; + ClearTarget(); + } + + return NS_OK; +} + +NS_IMETHODIMP +CanvasRenderingContext2D::SetContextOptions(JSContext* aCx, + JS::Handle aOptions, + ErrorResult& aRvForDictionaryInit) +{ + if (aOptions.isNullOrUndefined()) { + return NS_OK; + } + + // This shouldn't be called before drawing starts, so there should be no drawtarget yet + MOZ_ASSERT(!mTarget); + + ContextAttributes2D attributes; + if (!attributes.Init(aCx, aOptions)) { + aRvForDictionaryInit.Throw(NS_ERROR_UNEXPECTED); + return NS_ERROR_UNEXPECTED; + } + + if (Preferences::GetBool("gfx.canvas.willReadFrequently.enable", false)) { + // Use software when there is going to be a lot of readback + if (attributes.mWillReadFrequently) { + + // We want to lock into software, so remove the observer that + // may potentially change that... + RemoveDrawObserver(); + mRenderingMode = RenderingMode::SoftwareBackendMode; + } + } + + if (!attributes.mAlpha) { + SetIsOpaque(true); + } + + return NS_OK; +} + +UniquePtr +CanvasRenderingContext2D::GetImageBuffer(int32_t* aFormat) +{ + UniquePtr ret; + + *aFormat = 0; + + RefPtr snapshot; + if (mTarget) { + snapshot = mTarget->Snapshot(); + } else if (mBufferProvider) { + snapshot = mBufferProvider->BorrowSnapshot(); + } else { + EnsureTarget(); + if (!IsTargetValid()) { + return nullptr; + } + snapshot = mTarget->Snapshot(); + } + + if (snapshot) { + RefPtr data = snapshot->GetDataSurface(); + if (data && data->GetSize() == GetSize()) { + *aFormat = imgIEncoder::INPUT_FORMAT_HOSTARGB; + ret = SurfaceToPackedBGRA(data); + } + } + + if (!mTarget && mBufferProvider) { + mBufferProvider->ReturnSnapshot(snapshot.forget()); + } + + return ret; +} + +nsString CanvasRenderingContext2D::GetHitRegion(const mozilla::gfx::Point& aPoint) +{ + for (size_t x = 0 ; x < mHitRegionsOptions.Length(); x++) { + RegionInfo& info = mHitRegionsOptions[x]; + if (info.mPath->ContainsPoint(aPoint, Matrix())) { + return info.mId; + } + } + return nsString(); +} + +NS_IMETHODIMP +CanvasRenderingContext2D::GetInputStream(const char* aMimeType, + const char16_t* aEncoderOptions, + nsIInputStream** aStream) +{ + nsCString enccid("@mozilla.org/image/encoder;2?type="); + enccid += aMimeType; + nsCOMPtr encoder = do_CreateInstance(enccid.get()); + if (!encoder) { + return NS_ERROR_FAILURE; + } + + int32_t format = 0; + UniquePtr imageBuffer = GetImageBuffer(&format); + if (!imageBuffer) { + return NS_ERROR_FAILURE; + } + + return ImageEncoder::GetInputStream(mWidth, mHeight, imageBuffer.get(), + format, encoder, aEncoderOptions, + aStream); +} + +SurfaceFormat +CanvasRenderingContext2D::GetSurfaceFormat() const +{ + return mOpaque ? SurfaceFormat::B8G8R8X8 : SurfaceFormat::B8G8R8A8; +} + +// +// state +// + +void +CanvasRenderingContext2D::Save() +{ + EnsureTarget(); + if (MOZ_UNLIKELY(!mTarget || mStyleStack.IsEmpty())) { + SetErrorState(); + return; + } + mStyleStack[mStyleStack.Length() - 1].transform = mTarget->GetTransform(); + mStyleStack.SetCapacity(mStyleStack.Length() + 1); + mStyleStack.AppendElement(CurrentState()); + + if (mStyleStack.Length() > MAX_STYLE_STACK_SIZE) { + // This is not fast, but is better than OOMing and shouldn't be hit by + // reasonable code. + mStyleStack.RemoveElementAt(0); + } +} + +void +CanvasRenderingContext2D::Restore() +{ + if (MOZ_UNLIKELY(mStyleStack.Length() < 2)) { + return; + } + + TransformWillUpdate(); + if (!IsTargetValid()) { + return; + } + + for (const auto& clipOrTransform : CurrentState().clipsAndTransforms) { + if (clipOrTransform.IsClip()) { + mTarget->PopClip(); + } + } + + mStyleStack.RemoveElementAt(mStyleStack.Length() - 1); + + mTarget->SetTransform(CurrentState().transform); +} + +// +// transformations +// + +void +CanvasRenderingContext2D::Scale(double aX, double aY, ErrorResult& aError) +{ + TransformWillUpdate(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + Matrix newMatrix = mTarget->GetTransform(); + newMatrix.PreScale(aX, aY); + + SetTransformInternal(newMatrix); +} + +void +CanvasRenderingContext2D::Rotate(double aAngle, ErrorResult& aError) +{ + TransformWillUpdate(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + Matrix newMatrix = Matrix::Rotation(aAngle) * mTarget->GetTransform(); + + SetTransformInternal(newMatrix); +} + +void +CanvasRenderingContext2D::Translate(double aX, double aY, ErrorResult& aError) +{ + TransformWillUpdate(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + Matrix newMatrix = mTarget->GetTransform(); + newMatrix.PreTranslate(aX, aY); + + SetTransformInternal(newMatrix); +} + +void +CanvasRenderingContext2D::Transform(double aM11, double aM12, double aM21, + double aM22, double aDx, double aDy, + ErrorResult& aError) +{ + TransformWillUpdate(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + Matrix newMatrix(aM11, aM12, aM21, aM22, aDx, aDy); + newMatrix *= mTarget->GetTransform(); + + SetTransformInternal(newMatrix); +} + +void +CanvasRenderingContext2D::SetTransform(double aM11, double aM12, + double aM21, double aM22, + double aDx, double aDy, + ErrorResult& aError) +{ + TransformWillUpdate(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + SetTransformInternal(Matrix(aM11, aM12, aM21, aM22, aDx, aDy)); +} + +void +CanvasRenderingContext2D::SetTransformInternal(const Matrix& aTransform) +{ + if (!aTransform.IsFinite()) { + return; + } + + // Save the transform in the clip stack to be able to replay clips properly. + auto& clipsAndTransforms = CurrentState().clipsAndTransforms; + if (clipsAndTransforms.IsEmpty() || clipsAndTransforms.LastElement().IsClip()) { + clipsAndTransforms.AppendElement(ClipState(aTransform)); + } else { + // If the last item is a transform we can replace it instead of appending + // a new item. + clipsAndTransforms.LastElement().transform = aTransform; + } + mTarget->SetTransform(aTransform); +} + +void +CanvasRenderingContext2D::ResetTransform(ErrorResult& aError) +{ + SetTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, aError); +} + +static void +MatrixToJSObject(JSContext* aCx, const Matrix& aMatrix, + JS::MutableHandle aResult, ErrorResult& aError) +{ + double elts[6] = { aMatrix._11, aMatrix._12, + aMatrix._21, aMatrix._22, + aMatrix._31, aMatrix._32 }; + + // XXX Should we enter GetWrapper()'s compartment? + JS::Rooted val(aCx); + if (!ToJSValue(aCx, elts, &val)) { + aError.Throw(NS_ERROR_OUT_OF_MEMORY); + } else { + aResult.set(&val.toObject()); + } +} + +static bool +ObjectToMatrix(JSContext* aCx, JS::Handle aObj, Matrix& aMatrix, + ErrorResult& aError) +{ + uint32_t length; + if (!JS_GetArrayLength(aCx, aObj, &length) || length != 6) { + // Not an array-like thing or wrong size + aError.Throw(NS_ERROR_INVALID_ARG); + return false; + } + + Float* elts[] = { &aMatrix._11, &aMatrix._12, &aMatrix._21, &aMatrix._22, + &aMatrix._31, &aMatrix._32 }; + for (uint32_t i = 0; i < 6; ++i) { + JS::Rooted elt(aCx); + double d; + if (!JS_GetElement(aCx, aObj, i, &elt)) { + aError.Throw(NS_ERROR_FAILURE); + return false; + } + if (!CoerceDouble(elt, &d)) { + aError.Throw(NS_ERROR_INVALID_ARG); + return false; + } + if (!FloatValidate(d)) { + // This is weird, but it's the behavior of SetTransform() + return false; + } + *elts[i] = Float(d); + } + return true; +} + +void +CanvasRenderingContext2D::SetMozCurrentTransform(JSContext* aCx, + JS::Handle aCurrentTransform, + ErrorResult& aError) +{ + EnsureTarget(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + Matrix newCTM; + if (ObjectToMatrix(aCx, aCurrentTransform, newCTM, aError) && newCTM.IsFinite()) { + mTarget->SetTransform(newCTM); + } +} + +void +CanvasRenderingContext2D::GetMozCurrentTransform(JSContext* aCx, + JS::MutableHandle aResult, + ErrorResult& aError) +{ + EnsureTarget(); + + MatrixToJSObject(aCx, mTarget ? mTarget->GetTransform() : Matrix(), + aResult, aError); +} + +void +CanvasRenderingContext2D::SetMozCurrentTransformInverse(JSContext* aCx, + JS::Handle aCurrentTransform, + ErrorResult& aError) +{ + EnsureTarget(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + Matrix newCTMInverse; + if (ObjectToMatrix(aCx, aCurrentTransform, newCTMInverse, aError)) { + // XXX ERRMSG we need to report an error to developers here! (bug 329026) + if (newCTMInverse.Invert() && newCTMInverse.IsFinite()) { + mTarget->SetTransform(newCTMInverse); + } + } +} + +void +CanvasRenderingContext2D::GetMozCurrentTransformInverse(JSContext* aCx, + JS::MutableHandle aResult, + ErrorResult& aError) +{ + EnsureTarget(); + + if (!mTarget) { + MatrixToJSObject(aCx, Matrix(), aResult, aError); + return; + } + + Matrix ctm = mTarget->GetTransform(); + + if (!ctm.Invert()) { + double NaN = JS_GetNaNValue(aCx).toDouble(); + ctm = Matrix(NaN, NaN, NaN, NaN, NaN, NaN); + } + + MatrixToJSObject(aCx, ctm, aResult, aError); +} + +// +// colors +// + +void +CanvasRenderingContext2D::SetStyleFromUnion(const StringOrCanvasGradientOrCanvasPattern& aValue, + Style aWhichStyle) +{ + if (aValue.IsString()) { + SetStyleFromString(aValue.GetAsString(), aWhichStyle); + return; + } + + if (aValue.IsCanvasGradient()) { + SetStyleFromGradient(aValue.GetAsCanvasGradient(), aWhichStyle); + return; + } + + if (aValue.IsCanvasPattern()) { + SetStyleFromPattern(aValue.GetAsCanvasPattern(), aWhichStyle); + return; + } + + MOZ_ASSERT_UNREACHABLE("Invalid union value"); +} + +void +CanvasRenderingContext2D::SetFillRule(const nsAString& aString) +{ + FillRule rule; + + if (aString.EqualsLiteral("evenodd")) + rule = FillRule::FILL_EVEN_ODD; + else if (aString.EqualsLiteral("nonzero")) + rule = FillRule::FILL_WINDING; + else + return; + + CurrentState().fillRule = rule; +} + +void +CanvasRenderingContext2D::GetFillRule(nsAString& aString) +{ + switch (CurrentState().fillRule) { + case FillRule::FILL_WINDING: + aString.AssignLiteral("nonzero"); break; + case FillRule::FILL_EVEN_ODD: + aString.AssignLiteral("evenodd"); break; + } +} +// +// gradients and patterns +// +already_AddRefed +CanvasRenderingContext2D::CreateLinearGradient(double aX0, double aY0, double aX1, double aY1) +{ + RefPtr grad = + new CanvasLinearGradient(this, Point(aX0, aY0), Point(aX1, aY1)); + + return grad.forget(); +} + +already_AddRefed +CanvasRenderingContext2D::CreateRadialGradient(double aX0, double aY0, double aR0, + double aX1, double aY1, double aR1, + ErrorResult& aError) +{ + if (aR0 < 0.0 || aR1 < 0.0) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + + RefPtr grad = + new CanvasRadialGradient(this, Point(aX0, aY0), aR0, Point(aX1, aY1), aR1); + + return grad.forget(); +} + +already_AddRefed +CanvasRenderingContext2D::CreatePattern(const CanvasImageSource& aSource, + const nsAString& aRepeat, + ErrorResult& aError) +{ + CanvasPattern::RepeatMode repeatMode = + CanvasPattern::RepeatMode::NOREPEAT; + + if (aRepeat.IsEmpty() || aRepeat.EqualsLiteral("repeat")) { + repeatMode = CanvasPattern::RepeatMode::REPEAT; + } else if (aRepeat.EqualsLiteral("repeat-x")) { + repeatMode = CanvasPattern::RepeatMode::REPEATX; + } else if (aRepeat.EqualsLiteral("repeat-y")) { + repeatMode = CanvasPattern::RepeatMode::REPEATY; + } else if (aRepeat.EqualsLiteral("no-repeat")) { + repeatMode = CanvasPattern::RepeatMode::NOREPEAT; + } else { + aError.Throw(NS_ERROR_DOM_SYNTAX_ERR); + return nullptr; + } + + Element* htmlElement; + if (aSource.IsHTMLCanvasElement()) { + HTMLCanvasElement* canvas = &aSource.GetAsHTMLCanvasElement(); + htmlElement = canvas; + + nsIntSize size = canvas->GetSize(); + if (size.width == 0 || size.height == 0) { + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Special case for Canvas, which could be an Azure canvas! + nsICanvasRenderingContextInternal* srcCanvas = canvas->GetContextAtIndex(0); + if (srcCanvas) { + // This might not be an Azure canvas! + RefPtr srcSurf = srcCanvas->GetSurfaceSnapshot(); + if (!srcSurf) { + JSContext* context = nsContentUtils::GetCurrentJSContext(); + if (context) { + JS_ReportWarningASCII(context, + "CanvasRenderingContext2D.createPattern()" + " failed to snapshot source canvas."); + } + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + RefPtr pat = + new CanvasPattern(this, srcSurf, repeatMode, htmlElement->NodePrincipal(), canvas->IsWriteOnly(), false); + + return pat.forget(); + } + } else if (aSource.IsHTMLImageElement()) { + HTMLImageElement* img = &aSource.GetAsHTMLImageElement(); + if (img->IntrinsicState().HasState(NS_EVENT_STATE_BROKEN)) { + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + htmlElement = img; + } else if (aSource.IsHTMLVideoElement()) { + auto& video = aSource.GetAsHTMLVideoElement(); + video.MarkAsContentSource(mozilla::dom::HTMLVideoElement::CallerAPI::CREATE_PATTERN); + htmlElement = &video; + } else { + // Special case for ImageBitmap + ImageBitmap& imgBitmap = aSource.GetAsImageBitmap(); + EnsureTarget(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + RefPtr srcSurf = imgBitmap.PrepareForDrawTarget(mTarget); + if (!srcSurf) { + JSContext* context = nsContentUtils::GetCurrentJSContext(); + if (context) { + JS_ReportWarningASCII(context, + "CanvasRenderingContext2D.createPattern()" + " failed to prepare source ImageBitmap."); + } + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // An ImageBitmap never taints others so we set principalForSecurityCheck to + // nullptr and set CORSUsed to true for passing the security check in + // CanvasUtils::DoDrawImageSecurityCheck(). + RefPtr pat = + new CanvasPattern(this, srcSurf, repeatMode, nullptr, false, true); + + return pat.forget(); + } + + EnsureTarget(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // The canvas spec says that createPattern should use the first frame + // of animated images + nsLayoutUtils::SurfaceFromElementResult res = + nsLayoutUtils::SurfaceFromElement(htmlElement, + nsLayoutUtils::SFE_WANT_FIRST_FRAME, mTarget); + + if (!res.GetSourceSurface()) { + return nullptr; + } + + RefPtr pat = new CanvasPattern(this, res.GetSourceSurface(), repeatMode, + res.mPrincipal, res.mIsWriteOnly, + res.mCORSUsed); + return pat.forget(); +} + +// +// shadows +// +void +CanvasRenderingContext2D::SetShadowColor(const nsAString& aShadowColor) +{ + nscolor color; + if (!ParseColor(aShadowColor, &color)) { + return; + } + + CurrentState().shadowColor = color; +} + +// +// filters +// + +static already_AddRefed +CreateDeclaration(nsINode* aNode, + const nsCSSPropertyID aProp1, const nsAString& aValue1, bool* aChanged1, + const nsCSSPropertyID aProp2, const nsAString& aValue2, bool* aChanged2) +{ + nsIPrincipal* principal = aNode->NodePrincipal(); + nsIDocument* document = aNode->OwnerDoc(); + + nsIURI* docURL = document->GetDocumentURI(); + nsIURI* baseURL = document->GetDocBaseURI(); + + // Pass the CSS Loader object to the parser, to allow parser error reports + // to include the outer window ID. + nsCSSParser parser(document->CSSLoader()); + + RefPtr declaration = + parser.ParseStyleAttribute(EmptyString(), docURL, baseURL, principal); + + if (aProp1 != eCSSProperty_UNKNOWN) { + parser.ParseProperty(aProp1, aValue1, docURL, baseURL, principal, + declaration, aChanged1, false); + } + + if (aProp2 != eCSSProperty_UNKNOWN) { + parser.ParseProperty(aProp2, aValue2, docURL, baseURL, principal, + declaration, aChanged2, false); + } + + declaration->SetImmutable(); + return declaration.forget(); +} + +static already_AddRefed +CreateFontDeclaration(const nsAString& aFont, + nsINode* aNode, + bool* aOutFontChanged) +{ + bool lineHeightChanged; + return CreateDeclaration(aNode, + eCSSProperty_font, aFont, aOutFontChanged, + eCSSProperty_line_height, NS_LITERAL_STRING("normal"), &lineHeightChanged); +} + +static already_AddRefed +GetFontParentStyleContext(Element* aElement, nsIPresShell* aPresShell, + ErrorResult& aError) +{ + if (aElement && aElement->IsInUncomposedDoc()) { + // Inherit from the canvas element. + RefPtr result = + nsComputedDOMStyle::GetStyleContextForElement(aElement, nullptr, + aPresShell); + if (!result) { + aError.Throw(NS_ERROR_FAILURE); + return nullptr; + } + return result.forget(); + } + + // otherwise inherit from default (10px sans-serif) + + nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko(); + if (!styleSet) { + // XXXheycam ServoStyleSets do not support resolving style from a list of + // rules yet. + NS_ERROR("stylo: cannot resolve style for canvas from a ServoStyleSet yet"); + aError.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + bool changed; + RefPtr parentRule = + CreateFontDeclaration(NS_LITERAL_STRING("10px sans-serif"), + aPresShell->GetDocument(), &changed); + + nsTArray> parentRules; + parentRules.AppendElement(parentRule); + RefPtr result = + styleSet->ResolveStyleForRules(nullptr, parentRules); + + if (!result) { + aError.Throw(NS_ERROR_FAILURE); + return nullptr; + } + return result.forget(); +} + +static bool +PropertyIsInheritOrInitial(Declaration* aDeclaration, const nsCSSPropertyID aProperty) +{ + // We know the declaration is not !important, so we can use + // GetNormalBlock(). + const nsCSSValue* filterVal = + aDeclaration->GetNormalBlock()->ValueFor(aProperty); + return (!filterVal || (filterVal->GetUnit() == eCSSUnit_Unset || + filterVal->GetUnit() == eCSSUnit_Inherit || + filterVal->GetUnit() == eCSSUnit_Initial)); +} + +static already_AddRefed +GetFontStyleContext(Element* aElement, const nsAString& aFont, + nsIPresShell* aPresShell, + nsAString& aOutUsedFont, + ErrorResult& aError) +{ + nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko(); + if (!styleSet) { + // XXXheycam ServoStyleSets do not support resolving style from a list of + // rules yet. + NS_ERROR("stylo: cannot resolve style for canvas from a ServoStyleSet yet"); + aError.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + bool fontParsedSuccessfully = false; + RefPtr decl = + CreateFontDeclaration(aFont, aPresShell->GetDocument(), + &fontParsedSuccessfully); + + if (!fontParsedSuccessfully) { + // We got a syntax error. The spec says this value must be ignored. + return nullptr; + } + + // In addition to unparseable values, the spec says we need to reject + // 'inherit' and 'initial'. The easiest way to check for this is to look + // at font-size-adjust, which the font shorthand resets to either 'none' or + // '-moz-system-font'. + if (PropertyIsInheritOrInitial(decl, eCSSProperty_font_size_adjust)) { + return nullptr; + } + + // have to get a parent style context for inherit-like relative + // values (2em, bolder, etc.) + RefPtr parentContext = + GetFontParentStyleContext(aElement, aPresShell, aError); + + if (aError.Failed()) { + aError.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + MOZ_RELEASE_ASSERT(parentContext, + "GFX: GetFontParentStyleContext should have returned an error if it couldn't get a parent context."); + + MOZ_ASSERT(!aPresShell->IsDestroying(), + "GetFontParentStyleContext should have returned an error if the presshell is being destroyed."); + + nsTArray> rules; + rules.AppendElement(decl); + // add a rule to prevent text zoom from affecting the style + rules.AppendElement(new nsDisableTextZoomStyleRule); + + RefPtr sc = + styleSet->ResolveStyleForRules(parentContext, rules); + + // The font getter is required to be reserialized based on what we + // parsed (including having line-height removed). (Older drafts of + // the spec required font sizes be converted to pixels, but that no + // longer seems to be required.) + decl->GetPropertyValueByID(eCSSProperty_font, aOutUsedFont); + + return sc.forget(); +} + +static already_AddRefed +CreateFilterDeclaration(const nsAString& aFilter, + nsINode* aNode, + bool* aOutFilterChanged) +{ + bool dummy; + return CreateDeclaration(aNode, + eCSSProperty_filter, aFilter, aOutFilterChanged, + eCSSProperty_UNKNOWN, EmptyString(), &dummy); +} + +static already_AddRefed +ResolveStyleForFilter(const nsAString& aFilterString, + nsIPresShell* aPresShell, + nsStyleContext* aParentContext, + ErrorResult& aError) +{ + nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko(); + if (!styleSet) { + // XXXheycam ServoStyleSets do not support resolving style from a list of + // rules yet. + NS_ERROR("stylo: cannot resolve style for canvas from a ServoStyleSet yet"); + aError.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + nsIDocument* document = aPresShell->GetDocument(); + bool filterChanged = false; + RefPtr decl = + CreateFilterDeclaration(aFilterString, document, &filterChanged); + + if (!filterChanged) { + // Refuse to accept the filter, but do not throw an error. + return nullptr; + } + + // In addition to unparseable values, the spec says we need to reject + // 'inherit' and 'initial'. + if (PropertyIsInheritOrInitial(decl, eCSSProperty_filter)) { + return nullptr; + } + + nsTArray> rules; + rules.AppendElement(decl); + + RefPtr sc = + styleSet->ResolveStyleForRules(aParentContext, rules); + + return sc.forget(); +} + +bool +CanvasRenderingContext2D::ParseFilter(const nsAString& aString, + nsTArray& aFilterChain, + ErrorResult& aError) +{ + if (!mCanvasElement && !mDocShell) { + NS_WARNING("Canvas element must be non-null or a docshell must be provided"); + aError.Throw(NS_ERROR_FAILURE); + return false; + } + + nsCOMPtr presShell = GetPresShell(); + if (!presShell) { + aError.Throw(NS_ERROR_FAILURE); + return false; + } + + nsString usedFont; + RefPtr parentContext = + GetFontStyleContext(mCanvasElement, GetFont(), + presShell, usedFont, aError); + if (!parentContext) { + aError.Throw(NS_ERROR_FAILURE); + return false; + } + + RefPtr sc = + ResolveStyleForFilter(aString, presShell, parentContext, aError); + + if (!sc) { + return false; + } + + aFilterChain = sc->StyleEffects()->mFilters; + return true; +} + +void +CanvasRenderingContext2D::SetFilter(const nsAString& aFilter, ErrorResult& aError) +{ + nsTArray filterChain; + if (ParseFilter(aFilter, filterChain, aError)) { + CurrentState().filterString = aFilter; + filterChain.SwapElements(CurrentState().filterChain); + if (mCanvasElement) { + CurrentState().filterChainObserver = + new CanvasFilterChainObserver(CurrentState().filterChain, + mCanvasElement, this); + UpdateFilter(); + } + } +} + +class CanvasUserSpaceMetrics : public UserSpaceMetricsWithSize +{ +public: + CanvasUserSpaceMetrics(const gfx::IntSize& aSize, const nsFont& aFont, + nsIAtom* aFontLanguage, bool aExplicitLanguage, + nsPresContext* aPresContext) + : mSize(aSize) + , mFont(aFont) + , mFontLanguage(aFontLanguage) + , mExplicitLanguage(aExplicitLanguage) + , mPresContext(aPresContext) + { + } + + virtual float GetEmLength() const override + { + return NSAppUnitsToFloatPixels(mFont.size, + nsPresContext::AppUnitsPerCSSPixel()); + } + + virtual float GetExLength() const override + { + nsDeviceContext* dc = mPresContext->DeviceContext(); + nsFontMetrics::Params params; + params.language = mFontLanguage; + params.explicitLanguage = mExplicitLanguage; + params.textPerf = mPresContext->GetTextPerfMetrics(); + RefPtr fontMetrics = dc->GetMetricsFor(mFont, params); + return NSAppUnitsToFloatPixels(fontMetrics->XHeight(), + nsPresContext::AppUnitsPerCSSPixel()); + } + + virtual gfx::Size GetSize() const override + { return Size(mSize); } + +private: + gfx::IntSize mSize; + const nsFont& mFont; + nsIAtom* mFontLanguage; + bool mExplicitLanguage; + nsPresContext* mPresContext; +}; + +void +CanvasRenderingContext2D::UpdateFilter() +{ + nsCOMPtr presShell = GetPresShell(); + if (!presShell || presShell->IsDestroying()) { + // Ensure we set an empty filter and update the state to + // reflect the current "taint" status of the canvas + CurrentState().filter = FilterDescription(); + CurrentState().filterSourceGraphicTainted = + (mCanvasElement && mCanvasElement->IsWriteOnly()); + return; + } + + // The filter might reference an SVG filter that is declared inside this + // document. Flush frames so that we'll have an nsSVGFilterFrame to work + // with. + presShell->FlushPendingNotifications(Flush_Frames); + MOZ_RELEASE_ASSERT(!mStyleStack.IsEmpty()); + if (MOZ_UNLIKELY(presShell->IsDestroying())) { + return; + } + + bool sourceGraphicIsTainted = + (mCanvasElement && mCanvasElement->IsWriteOnly()); + + CurrentState().filter = + nsFilterInstance::GetFilterDescription(mCanvasElement, + CurrentState().filterChain, + sourceGraphicIsTainted, + CanvasUserSpaceMetrics(GetSize(), + CurrentState().fontFont, + CurrentState().fontLanguage, + CurrentState().fontExplicitLanguage, + presShell->GetPresContext()), + gfxRect(0, 0, mWidth, mHeight), + CurrentState().filterAdditionalImages); + CurrentState().filterSourceGraphicTainted = sourceGraphicIsTainted; +} + +// +// rects +// + +static bool +ValidateRect(double& aX, double& aY, double& aWidth, double& aHeight, bool aIsZeroSizeValid) +{ + if (!aIsZeroSizeValid && (aWidth == 0.0 || aHeight == 0.0)) { + return false; + } + + // bug 1018527 + // The values of canvas API input are in double precision, but Moz2D APIs are + // using float precision. Bypass canvas API calls when the input is out of + // float precision to avoid precision problem + if (!std::isfinite((float)aX) | !std::isfinite((float)aY) | + !std::isfinite((float)aWidth) | !std::isfinite((float)aHeight)) { + return false; + } + + // bug 1074733 + // The canvas spec does not forbid rects with negative w or h, so given + // corners (x, y), (x+w, y), (x+w, y+h), and (x, y+h) we must generate + // the appropriate rect by flipping negative dimensions. This prevents + // draw targets from receiving "empty" rects later on. + if (aWidth < 0) { + aWidth = -aWidth; + aX -= aWidth; + } + if (aHeight < 0) { + aHeight = -aHeight; + aY -= aHeight; + } + return true; +} + +void +CanvasRenderingContext2D::ClearRect(double aX, double aY, double aW, + double aH) +{ + // Do not allow zeros - it's a no-op at that point per spec. + if (!ValidateRect(aX, aY, aW, aH, false)) { + return; + } + + gfx::Rect clearRect(aX, aY, aW, aH); + + EnsureTarget(&clearRect); + if (!IsTargetValid()) { + return; + } + + mTarget->ClearRect(clearRect); + + RedrawUser(gfxRect(aX, aY, aW, aH)); +} + +void +CanvasRenderingContext2D::FillRect(double aX, double aY, double aW, double aH) +{ + if (!ValidateRect(aX, aY, aW, aH, true)) { + return; + } + + const ContextState* state = &CurrentState(); + if (state->patternStyles[Style::FILL]) { + CanvasPattern::RepeatMode repeat = + state->patternStyles[Style::FILL]->mRepeat; + // In the FillRect case repeat modes are easy to deal with. + bool limitx = repeat == CanvasPattern::RepeatMode::NOREPEAT || + repeat == CanvasPattern::RepeatMode::REPEATY; + bool limity = repeat == CanvasPattern::RepeatMode::NOREPEAT || + repeat == CanvasPattern::RepeatMode::REPEATX; + + IntSize patternSize = + state->patternStyles[Style::FILL]->mSurface->GetSize(); + + // We always need to execute painting for non-over operators, even if + // we end up with w/h = 0. + if (limitx) { + if (aX < 0) { + aW += aX; + if (aW < 0) { + aW = 0; + } + + aX = 0; + } + if (aX + aW > patternSize.width) { + aW = patternSize.width - aX; + if (aW < 0) { + aW = 0; + } + } + } + if (limity) { + if (aY < 0) { + aH += aY; + if (aH < 0) { + aH = 0; + } + + aY = 0; + } + if (aY + aH > patternSize.height) { + aH = patternSize.height - aY; + if (aH < 0) { + aH = 0; + } + } + } + } + state = nullptr; + + CompositionOp op = UsedOperation(); + bool discardContent = PatternIsOpaque(Style::FILL) + && (op == CompositionOp::OP_OVER || op == CompositionOp::OP_SOURCE); + const gfx::Rect fillRect(aX, aY, aW, aH); + EnsureTarget(discardContent ? &fillRect : nullptr); + if (!IsTargetValid()) { + return; + } + + gfx::Rect bounds; + const bool needBounds = NeedToCalculateBounds(); + if (!IsTargetValid()) { + return; + } + if (needBounds) { + bounds = mTarget->GetTransform().TransformBounds(fillRect); + } + + AntialiasMode antialiasMode = CurrentState().imageSmoothingEnabled ? + AntialiasMode::DEFAULT : AntialiasMode::NONE; + + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + target->FillRect(gfx::Rect(aX, aY, aW, aH), + CanvasGeneralPattern().ForStyle(this, Style::FILL, mTarget), + DrawOptions(CurrentState().globalAlpha, op, antialiasMode)); + + RedrawUser(gfxRect(aX, aY, aW, aH)); +} + +void +CanvasRenderingContext2D::StrokeRect(double aX, double aY, double aW, double aH) +{ + if (!aW && !aH) { + return; + } + + if (!ValidateRect(aX, aY, aW, aH, true)) { + return; + } + + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + + const bool needBounds = NeedToCalculateBounds(); + if (!IsTargetValid()) { + return; + } + + gfx::Rect bounds; + if (needBounds) { + const ContextState& state = CurrentState(); + bounds = gfx::Rect(aX - state.lineWidth / 2.0f, aY - state.lineWidth / 2.0f, + aW + state.lineWidth, aH + state.lineWidth); + bounds = mTarget->GetTransform().TransformBounds(bounds); + } + + auto op = UsedOperation(); + if (!IsTargetValid()) { + return; + } + + if (!aH) { + CapStyle cap = CapStyle::BUTT; + if (CurrentState().lineJoin == JoinStyle::ROUND) { + cap = CapStyle::ROUND; + } + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + + const ContextState& state = CurrentState(); + target-> + StrokeLine(Point(aX, aY), Point(aX + aW, aY), + CanvasGeneralPattern().ForStyle(this, Style::STROKE, mTarget), + StrokeOptions(state.lineWidth, state.lineJoin, + cap, state.miterLimit, + state.dash.Length(), + state.dash.Elements(), + state.dashOffset), + DrawOptions(state.globalAlpha, op)); + return; + } + + if (!aW) { + CapStyle cap = CapStyle::BUTT; + if (CurrentState().lineJoin == JoinStyle::ROUND) { + cap = CapStyle::ROUND; + } + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + + const ContextState& state = CurrentState(); + target-> + StrokeLine(Point(aX, aY), Point(aX, aY + aH), + CanvasGeneralPattern().ForStyle(this, Style::STROKE, mTarget), + StrokeOptions(state.lineWidth, state.lineJoin, + cap, state.miterLimit, + state.dash.Length(), + state.dash.Elements(), + state.dashOffset), + DrawOptions(state.globalAlpha, op)); + return; + } + + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + + const ContextState& state = CurrentState(); + target-> + StrokeRect(gfx::Rect(aX, aY, aW, aH), + CanvasGeneralPattern().ForStyle(this, Style::STROKE, mTarget), + StrokeOptions(state.lineWidth, state.lineJoin, + state.lineCap, state.miterLimit, + state.dash.Length(), + state.dash.Elements(), + state.dashOffset), + DrawOptions(state.globalAlpha, op)); + + Redraw(); +} + +// +// path bits +// + +void +CanvasRenderingContext2D::BeginPath() +{ + mPath = nullptr; + mPathBuilder = nullptr; + mDSPathBuilder = nullptr; + mPathTransformWillUpdate = false; +} + +void +CanvasRenderingContext2D::Fill(const CanvasWindingRule& aWinding) +{ + EnsureUserSpacePath(aWinding); + + if (!mPath) { + return; + } + + const bool needBounds = NeedToCalculateBounds(); + if (!IsTargetValid()) { + return; + } + gfx::Rect bounds; + if (needBounds) { + bounds = mPath->GetBounds(mTarget->GetTransform()); + } + + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + + auto op = UsedOperation(); + if (!IsTargetValid() || !target) { + return; + } + target->Fill(mPath, + CanvasGeneralPattern().ForStyle(this, Style::FILL, mTarget), + DrawOptions(CurrentState().globalAlpha, op)); + Redraw(); +} + +void CanvasRenderingContext2D::Fill(const CanvasPath& aPath, const CanvasWindingRule& aWinding) +{ + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + + RefPtr gfxpath = aPath.GetPath(aWinding, mTarget); + if (!gfxpath) { + return; + } + + const bool needBounds = NeedToCalculateBounds(); + if (!IsTargetValid()) { + return; + } + gfx::Rect bounds; + if (needBounds) { + bounds = gfxpath->GetBounds(mTarget->GetTransform()); + } + + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + + auto op = UsedOperation(); + if (!IsTargetValid() || !target) { + return; + } + target->Fill(gfxpath, + CanvasGeneralPattern().ForStyle(this, Style::FILL, mTarget), + DrawOptions(CurrentState().globalAlpha, op)); + Redraw(); +} + +void +CanvasRenderingContext2D::Stroke() +{ + EnsureUserSpacePath(); + + if (!mPath) { + return; + } + + const ContextState* state = &CurrentState(); + StrokeOptions strokeOptions(state->lineWidth, state->lineJoin, + state->lineCap, state->miterLimit, + state->dash.Length(), state->dash.Elements(), + state->dashOffset); + state = nullptr; + + const bool needBounds = NeedToCalculateBounds(); + if (!IsTargetValid()) { + return; + } + gfx::Rect bounds; + if (needBounds) { + bounds = + mPath->GetStrokedBounds(strokeOptions, mTarget->GetTransform()); + } + + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + + auto op = UsedOperation(); + if (!IsTargetValid() || !target) { + return; + } + target->Stroke(mPath, + CanvasGeneralPattern().ForStyle(this, Style::STROKE, mTarget), + strokeOptions, DrawOptions(CurrentState().globalAlpha, op)); + Redraw(); +} + +void +CanvasRenderingContext2D::Stroke(const CanvasPath& aPath) +{ + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + + RefPtr gfxpath = aPath.GetPath(CanvasWindingRule::Nonzero, mTarget); + + if (!gfxpath) { + return; + } + + const ContextState* state = &CurrentState(); + StrokeOptions strokeOptions(state->lineWidth, state->lineJoin, + state->lineCap, state->miterLimit, + state->dash.Length(), state->dash.Elements(), + state->dashOffset); + state = nullptr; + + const bool needBounds = NeedToCalculateBounds(); + if (!IsTargetValid()) { + return; + } + gfx::Rect bounds; + if (needBounds) { + bounds = + gfxpath->GetStrokedBounds(strokeOptions, mTarget->GetTransform()); + } + + AdjustedTarget target(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!target) { + return; + } + + auto op = UsedOperation(); + if (!IsTargetValid() || !target) { + return; + } + target->Stroke(gfxpath, + CanvasGeneralPattern().ForStyle(this, Style::STROKE, mTarget), + strokeOptions, DrawOptions(CurrentState().globalAlpha, op)); + Redraw(); +} + +void CanvasRenderingContext2D::DrawFocusIfNeeded(mozilla::dom::Element& aElement, + ErrorResult& aRv) +{ + EnsureUserSpacePath(); + if (!mPath) { + return; + } + + if (DrawCustomFocusRing(aElement)) { + AutoSaveRestore asr(this); + + // set state to conforming focus state + ContextState* state = &CurrentState(); + state->globalAlpha = 1.0; + state->shadowBlur = 0; + state->shadowOffset.x = 0; + state->shadowOffset.y = 0; + state->op = mozilla::gfx::CompositionOp::OP_OVER; + + state->lineCap = CapStyle::BUTT; + state->lineJoin = mozilla::gfx::JoinStyle::MITER_OR_BEVEL; + state->lineWidth = 1; + state->dash.Clear(); + + // color and style of the rings is the same as for image maps + // set the background focus color + state->SetColorStyle(Style::STROKE, NS_RGBA(255, 255, 255, 255)); + state = nullptr; + + // draw the focus ring + Stroke(); + if (!mPath) { + return; + } + + // set dashing for foreground + nsTArray& dash = CurrentState().dash; + for (uint32_t i = 0; i < 2; ++i) { + if (!dash.AppendElement(1, fallible)) { + aRv.Throw(NS_ERROR_OUT_OF_MEMORY); + return; + } + } + + // set the foreground focus color + CurrentState().SetColorStyle(Style::STROKE, NS_RGBA(0,0,0, 255)); + // draw the focus ring + Stroke(); + if (!mPath) { + return; + } + } +} + +bool CanvasRenderingContext2D::DrawCustomFocusRing(mozilla::dom::Element& aElement) +{ + EnsureUserSpacePath(); + + HTMLCanvasElement* canvas = GetCanvas(); + + if (!canvas|| !nsContentUtils::ContentIsDescendantOf(&aElement, canvas)) { + return false; + } + + nsIFocusManager* fm = nsFocusManager::GetFocusManager(); + if (fm) { + // check that the element i focused + nsCOMPtr focusedElement; + fm->GetFocusedElement(getter_AddRefs(focusedElement)); + if (SameCOMIdentity(aElement.AsDOMNode(), focusedElement)) { + if (nsPIDOMWindowOuter* window = aElement.OwnerDoc()->GetWindow()) { + return window->ShouldShowFocusRing(); + } + } + } + + return false; +} + +void +CanvasRenderingContext2D::Clip(const CanvasWindingRule& aWinding) +{ + EnsureUserSpacePath(aWinding); + + if (!mPath) { + return; + } + + mTarget->PushClip(mPath); + CurrentState().clipsAndTransforms.AppendElement(ClipState(mPath)); +} + +void +CanvasRenderingContext2D::Clip(const CanvasPath& aPath, const CanvasWindingRule& aWinding) +{ + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + + RefPtr gfxpath = aPath.GetPath(aWinding, mTarget); + + if (!gfxpath) { + return; + } + + mTarget->PushClip(gfxpath); + CurrentState().clipsAndTransforms.AppendElement(ClipState(gfxpath)); +} + +void +CanvasRenderingContext2D::ArcTo(double aX1, double aY1, double aX2, + double aY2, double aRadius, + ErrorResult& aError) +{ + if (aRadius < 0) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + EnsureWritablePath(); + + // Current point in user space! + Point p0; + if (mPathBuilder) { + p0 = mPathBuilder->CurrentPoint(); + } else { + Matrix invTransform = mTarget->GetTransform(); + if (!invTransform.Invert()) { + return; + } + + p0 = invTransform.TransformPoint(mDSPathBuilder->CurrentPoint()); + } + + Point p1(aX1, aY1); + Point p2(aX2, aY2); + + // Execute these calculations in double precision to avoid cumulative + // rounding errors. + double dir, a2, b2, c2, cosx, sinx, d, anx, any, + bnx, bny, x3, y3, x4, y4, cx, cy, angle0, angle1; + bool anticlockwise; + + if (p0 == p1 || p1 == p2 || aRadius == 0) { + LineTo(p1.x, p1.y); + return; + } + + // Check for colinearity + dir = (p2.x - p1.x) * (p0.y - p1.y) + (p2.y - p1.y) * (p1.x - p0.x); + if (dir == 0) { + LineTo(p1.x, p1.y); + return; + } + + + // XXX - Math for this code was already available from the non-azure code + // and would be well tested. Perhaps converting to bezier directly might + // be more efficient longer run. + a2 = (p0.x-aX1)*(p0.x-aX1) + (p0.y-aY1)*(p0.y-aY1); + b2 = (aX1-aX2)*(aX1-aX2) + (aY1-aY2)*(aY1-aY2); + c2 = (p0.x-aX2)*(p0.x-aX2) + (p0.y-aY2)*(p0.y-aY2); + cosx = (a2+b2-c2)/(2*sqrt(a2*b2)); + + sinx = sqrt(1 - cosx*cosx); + d = aRadius / ((1 - cosx) / sinx); + + anx = (aX1-p0.x) / sqrt(a2); + any = (aY1-p0.y) / sqrt(a2); + bnx = (aX1-aX2) / sqrt(b2); + bny = (aY1-aY2) / sqrt(b2); + x3 = aX1 - anx*d; + y3 = aY1 - any*d; + x4 = aX1 - bnx*d; + y4 = aY1 - bny*d; + anticlockwise = (dir < 0); + cx = x3 + any*aRadius*(anticlockwise ? 1 : -1); + cy = y3 - anx*aRadius*(anticlockwise ? 1 : -1); + angle0 = atan2((y3-cy), (x3-cx)); + angle1 = atan2((y4-cy), (x4-cx)); + + + LineTo(x3, y3); + + Arc(cx, cy, aRadius, angle0, angle1, anticlockwise, aError); +} + +void +CanvasRenderingContext2D::Arc(double aX, double aY, double aR, + double aStartAngle, double aEndAngle, + bool aAnticlockwise, ErrorResult& aError) +{ + if (aR < 0.0) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + EnsureWritablePath(); + + ArcToBezier(this, Point(aX, aY), Size(aR, aR), aStartAngle, aEndAngle, aAnticlockwise); +} + +void +CanvasRenderingContext2D::Rect(double aX, double aY, double aW, double aH) +{ + EnsureWritablePath(); + + if (mPathBuilder) { + mPathBuilder->MoveTo(Point(aX, aY)); + mPathBuilder->LineTo(Point(aX + aW, aY)); + mPathBuilder->LineTo(Point(aX + aW, aY + aH)); + mPathBuilder->LineTo(Point(aX, aY + aH)); + mPathBuilder->Close(); + } else { + mDSPathBuilder->MoveTo(mTarget->GetTransform().TransformPoint(Point(aX, aY))); + mDSPathBuilder->LineTo(mTarget->GetTransform().TransformPoint(Point(aX + aW, aY))); + mDSPathBuilder->LineTo(mTarget->GetTransform().TransformPoint(Point(aX + aW, aY + aH))); + mDSPathBuilder->LineTo(mTarget->GetTransform().TransformPoint(Point(aX, aY + aH))); + mDSPathBuilder->Close(); + } +} + +void +CanvasRenderingContext2D::Ellipse(double aX, double aY, double aRadiusX, double aRadiusY, + double aRotation, double aStartAngle, double aEndAngle, + bool aAnticlockwise, ErrorResult& aError) +{ + if (aRadiusX < 0.0 || aRadiusY < 0.0) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + EnsureWritablePath(); + + ArcToBezier(this, Point(aX, aY), Size(aRadiusX, aRadiusY), aStartAngle, aEndAngle, + aAnticlockwise, aRotation); +} + +void +CanvasRenderingContext2D::EnsureWritablePath() +{ + EnsureTarget(); + // NOTE: IsTargetValid() may be false here (mTarget == sErrorTarget) but we + // go ahead and create a path anyway since callers depend on that. + + if (mDSPathBuilder) { + return; + } + + FillRule fillRule = CurrentState().fillRule; + + if (mPathBuilder) { + if (mPathTransformWillUpdate) { + mPath = mPathBuilder->Finish(); + mDSPathBuilder = + mPath->TransformedCopyToBuilder(mPathToDS, fillRule); + mPath = nullptr; + mPathBuilder = nullptr; + mPathTransformWillUpdate = false; + } + return; + } + + if (!mPath) { + NS_ASSERTION(!mPathTransformWillUpdate, "mPathTransformWillUpdate should be false, if all paths are null"); + mPathBuilder = mTarget->CreatePathBuilder(fillRule); + } else if (!mPathTransformWillUpdate) { + mPathBuilder = mPath->CopyToBuilder(fillRule); + } else { + mDSPathBuilder = + mPath->TransformedCopyToBuilder(mPathToDS, fillRule); + mPathTransformWillUpdate = false; + mPath = nullptr; + } +} + +void +CanvasRenderingContext2D::EnsureUserSpacePath(const CanvasWindingRule& aWinding) +{ + FillRule fillRule = CurrentState().fillRule; + if (aWinding == CanvasWindingRule::Evenodd) + fillRule = FillRule::FILL_EVEN_ODD; + + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + + if (!mPath && !mPathBuilder && !mDSPathBuilder) { + mPathBuilder = mTarget->CreatePathBuilder(fillRule); + } + + if (mPathBuilder) { + mPath = mPathBuilder->Finish(); + mPathBuilder = nullptr; + } + + if (mPath && + mPathTransformWillUpdate) { + mDSPathBuilder = + mPath->TransformedCopyToBuilder(mPathToDS, fillRule); + mPath = nullptr; + mPathTransformWillUpdate = false; + } + + if (mDSPathBuilder) { + RefPtr dsPath; + dsPath = mDSPathBuilder->Finish(); + mDSPathBuilder = nullptr; + + Matrix inverse = mTarget->GetTransform(); + if (!inverse.Invert()) { + NS_WARNING("Could not invert transform"); + return; + } + + mPathBuilder = + dsPath->TransformedCopyToBuilder(inverse, fillRule); + mPath = mPathBuilder->Finish(); + mPathBuilder = nullptr; + } + + if (mPath && mPath->GetFillRule() != fillRule) { + mPathBuilder = mPath->CopyToBuilder(fillRule); + mPath = mPathBuilder->Finish(); + mPathBuilder = nullptr; + } + + NS_ASSERTION(mPath, "mPath should exist"); +} + +void +CanvasRenderingContext2D::TransformWillUpdate() +{ + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + + // Store the matrix that would transform the current path to device + // space. + if (mPath || mPathBuilder) { + if (!mPathTransformWillUpdate) { + // If the transform has already been updated, but a device space builder + // has not been created yet mPathToDS contains the right transform to + // transform the current mPath into device space. + // We should leave it alone. + mPathToDS = mTarget->GetTransform(); + } + mPathTransformWillUpdate = true; + } +} + +// +// text +// + +void +CanvasRenderingContext2D::SetFont(const nsAString& aFont, + ErrorResult& aError) +{ + SetFontInternal(aFont, aError); +} + +bool +CanvasRenderingContext2D::SetFontInternal(const nsAString& aFont, + ErrorResult& aError) +{ + /* + * If font is defined with relative units (e.g. ems) and the parent + * style context changes in between calls, setting the font to the + * same value as previous could result in a different computed value, + * so we cannot have the optimization where we check if the new font + * string is equal to the old one. + */ + + if (!mCanvasElement && !mDocShell) { + NS_WARNING("Canvas element must be non-null or a docshell must be provided"); + aError.Throw(NS_ERROR_FAILURE); + return false; + } + + nsCOMPtr presShell = GetPresShell(); + if (!presShell) { + aError.Throw(NS_ERROR_FAILURE); + return false; + } + + nsString usedFont; + RefPtr sc = + GetFontStyleContext(mCanvasElement, aFont, presShell, usedFont, aError); + if (!sc) { + return false; + } + + const nsStyleFont* fontStyle = sc->StyleFont(); + + nsPresContext* c = presShell->GetPresContext(); + + // Purposely ignore the font size that respects the user's minimum + // font preference (fontStyle->mFont.size) in favor of the computed + // size (fontStyle->mSize). See + // https://bugzilla.mozilla.org/show_bug.cgi?id=698652. + MOZ_ASSERT(!fontStyle->mAllowZoom, + "expected text zoom to be disabled on this nsStyleFont"); + nsFont resizedFont(fontStyle->mFont); + // Create a font group working in units of CSS pixels instead of the usual + // device pixels, to avoid being affected by page zoom. nsFontMetrics will + // convert nsFont size in app units to device pixels for the font group, so + // here we first apply to the size the equivalent of a conversion from device + // pixels to CSS pixels, to adjust for the difference in expectations from + // other nsFontMetrics clients. + resizedFont.size = + (fontStyle->mSize * c->AppUnitsPerDevPixel()) / c->AppUnitsPerCSSPixel(); + + nsFontMetrics::Params params; + params.language = fontStyle->mLanguage; + params.explicitLanguage = fontStyle->mExplicitLanguage; + params.userFontSet = c->GetUserFontSet(); + params.textPerf = c->GetTextPerfMetrics(); + RefPtr metrics = + c->DeviceContext()->GetMetricsFor(resizedFont, params); + + gfxFontGroup* newFontGroup = metrics->GetThebesFontGroup(); + CurrentState().fontGroup = newFontGroup; + NS_ASSERTION(CurrentState().fontGroup, "Could not get font group"); + CurrentState().font = usedFont; + CurrentState().fontFont = fontStyle->mFont; + CurrentState().fontFont.size = fontStyle->mSize; + CurrentState().fontLanguage = fontStyle->mLanguage; + CurrentState().fontExplicitLanguage = fontStyle->mExplicitLanguage; + + return true; +} + +void +CanvasRenderingContext2D::SetTextAlign(const nsAString& aTextAlign) +{ + if (aTextAlign.EqualsLiteral("start")) + CurrentState().textAlign = TextAlign::START; + else if (aTextAlign.EqualsLiteral("end")) + CurrentState().textAlign = TextAlign::END; + else if (aTextAlign.EqualsLiteral("left")) + CurrentState().textAlign = TextAlign::LEFT; + else if (aTextAlign.EqualsLiteral("right")) + CurrentState().textAlign = TextAlign::RIGHT; + else if (aTextAlign.EqualsLiteral("center")) + CurrentState().textAlign = TextAlign::CENTER; +} + +void +CanvasRenderingContext2D::GetTextAlign(nsAString& aTextAlign) +{ + switch (CurrentState().textAlign) + { + case TextAlign::START: + aTextAlign.AssignLiteral("start"); + break; + case TextAlign::END: + aTextAlign.AssignLiteral("end"); + break; + case TextAlign::LEFT: + aTextAlign.AssignLiteral("left"); + break; + case TextAlign::RIGHT: + aTextAlign.AssignLiteral("right"); + break; + case TextAlign::CENTER: + aTextAlign.AssignLiteral("center"); + break; + } +} + +void +CanvasRenderingContext2D::SetTextBaseline(const nsAString& aTextBaseline) +{ + if (aTextBaseline.EqualsLiteral("top")) + CurrentState().textBaseline = TextBaseline::TOP; + else if (aTextBaseline.EqualsLiteral("hanging")) + CurrentState().textBaseline = TextBaseline::HANGING; + else if (aTextBaseline.EqualsLiteral("middle")) + CurrentState().textBaseline = TextBaseline::MIDDLE; + else if (aTextBaseline.EqualsLiteral("alphabetic")) + CurrentState().textBaseline = TextBaseline::ALPHABETIC; + else if (aTextBaseline.EqualsLiteral("ideographic")) + CurrentState().textBaseline = TextBaseline::IDEOGRAPHIC; + else if (aTextBaseline.EqualsLiteral("bottom")) + CurrentState().textBaseline = TextBaseline::BOTTOM; +} + +void +CanvasRenderingContext2D::GetTextBaseline(nsAString& aTextBaseline) +{ + switch (CurrentState().textBaseline) + { + case TextBaseline::TOP: + aTextBaseline.AssignLiteral("top"); + break; + case TextBaseline::HANGING: + aTextBaseline.AssignLiteral("hanging"); + break; + case TextBaseline::MIDDLE: + aTextBaseline.AssignLiteral("middle"); + break; + case TextBaseline::ALPHABETIC: + aTextBaseline.AssignLiteral("alphabetic"); + break; + case TextBaseline::IDEOGRAPHIC: + aTextBaseline.AssignLiteral("ideographic"); + break; + case TextBaseline::BOTTOM: + aTextBaseline.AssignLiteral("bottom"); + break; + } +} + +/* + * Helper function that replaces the whitespace characters in a string + * with U+0020 SPACE. The whitespace characters are defined as U+0020 SPACE, + * U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000B LINE + * TABULATION, U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR). + * @param str The string whose whitespace characters to replace. + */ +static inline void +TextReplaceWhitespaceCharacters(nsAutoString& aStr) +{ + aStr.ReplaceChar("\x09\x0A\x0B\x0C\x0D", char16_t(' ')); +} + +void +CanvasRenderingContext2D::FillText(const nsAString& aText, double aX, + double aY, + const Optional& aMaxWidth, + ErrorResult& aError) +{ + aError = DrawOrMeasureText(aText, aX, aY, aMaxWidth, TextDrawOperation::FILL, nullptr); +} + +void +CanvasRenderingContext2D::StrokeText(const nsAString& aText, double aX, + double aY, + const Optional& aMaxWidth, + ErrorResult& aError) +{ + aError = DrawOrMeasureText(aText, aX, aY, aMaxWidth, TextDrawOperation::STROKE, nullptr); +} + +TextMetrics* +CanvasRenderingContext2D::MeasureText(const nsAString& aRawText, + ErrorResult& aError) +{ + float width; + Optional maxWidth; + aError = DrawOrMeasureText(aRawText, 0, 0, maxWidth, TextDrawOperation::MEASURE, &width); + if (aError.Failed()) { + return nullptr; + } + + return new TextMetrics(width); +} + +void +CanvasRenderingContext2D::AddHitRegion(const HitRegionOptions& aOptions, ErrorResult& aError) +{ + RefPtr path; + if (aOptions.mPath) { + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + path = aOptions.mPath->GetPath(CanvasWindingRule::Nonzero, mTarget); + } + + if (!path) { + // check if the path is valid + EnsureUserSpacePath(CanvasWindingRule::Nonzero); + path = mPath; + } + + if (!path) { + aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } + + // get the bounds of the current path. They are relative to the canvas + gfx::Rect bounds(path->GetBounds(mTarget->GetTransform())); + if ((bounds.width == 0) || (bounds.height == 0) || !bounds.IsFinite()) { + // The specified region has no pixels. + aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } + + // remove old hit region first + RemoveHitRegion(aOptions.mId); + + if (aOptions.mControl) { + // also remove regions with this control + for (size_t x = 0; x < mHitRegionsOptions.Length(); x++) { + RegionInfo& info = mHitRegionsOptions[x]; + if (info.mElement == aOptions.mControl) { + mHitRegionsOptions.RemoveElementAt(x); + break; + } + } +#ifdef ACCESSIBILITY + aOptions.mControl->SetProperty(nsGkAtoms::hitregion, new bool(true), + nsINode::DeleteProperty); +#endif + } + + // finally, add the region to the list + RegionInfo info; + info.mId = aOptions.mId; + info.mElement = aOptions.mControl; + RefPtr pathBuilder = path->TransformedCopyToBuilder(mTarget->GetTransform()); + info.mPath = pathBuilder->Finish(); + + mHitRegionsOptions.InsertElementAt(0, info); +} + +void +CanvasRenderingContext2D::RemoveHitRegion(const nsAString& aId) +{ + if (aId.Length() == 0) { + return; + } + + for (size_t x = 0; x < mHitRegionsOptions.Length(); x++) { + RegionInfo& info = mHitRegionsOptions[x]; + if (info.mId == aId) { + mHitRegionsOptions.RemoveElementAt(x); + + return; + } + } +} + +void +CanvasRenderingContext2D::ClearHitRegions() +{ + mHitRegionsOptions.Clear(); +} + +bool +CanvasRenderingContext2D::GetHitRegionRect(Element* aElement, nsRect& aRect) +{ + for (unsigned int x = 0; x < mHitRegionsOptions.Length(); x++) { + RegionInfo& info = mHitRegionsOptions[x]; + if (info.mElement == aElement) { + gfx::Rect bounds(info.mPath->GetBounds()); + gfxRect rect(bounds.x, bounds.y, bounds.width, bounds.height); + aRect = nsLayoutUtils::RoundGfxRectToAppRect(rect, AppUnitsPerCSSPixel()); + + return true; + } + } + + return false; +} + +/** + * Used for nsBidiPresUtils::ProcessText + */ +struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcessor +{ + typedef CanvasRenderingContext2D::Style Style; + + CanvasBidiProcessor() + : nsBidiPresUtils::BidiProcessor() + { + if (Preferences::GetBool(GFX_MISSING_FONTS_NOTIFY_PREF)) { + mMissingFonts = new gfxMissingFontRecorder(); + } + } + + ~CanvasBidiProcessor() + { + // notify front-end code if we encountered missing glyphs in any script + if (mMissingFonts) { + mMissingFonts->Flush(); + } + } + + typedef CanvasRenderingContext2D::ContextState ContextState; + + virtual void SetText(const char16_t* aText, int32_t aLength, nsBidiDirection aDirection) + { + mFontgrp->UpdateUserFonts(); // ensure user font generation is current + // adjust flags for current direction run + uint32_t flags = mTextRunFlags; + if (aDirection == NSBIDI_RTL) { + flags |= gfxTextRunFactory::TEXT_IS_RTL; + } else { + flags &= ~gfxTextRunFactory::TEXT_IS_RTL; + } + mTextRun = mFontgrp->MakeTextRun(aText, + aLength, + mDrawTarget, + mAppUnitsPerDevPixel, + flags, + mMissingFonts); + } + + virtual nscoord GetWidth() + { + gfxTextRun::Metrics textRunMetrics = mTextRun->MeasureText( + mDoMeasureBoundingBox ? gfxFont::TIGHT_INK_EXTENTS + : gfxFont::LOOSE_INK_EXTENTS, mDrawTarget); + + // this only measures the height; the total width is gotten from the + // the return value of ProcessText. + if (mDoMeasureBoundingBox) { + textRunMetrics.mBoundingBox.Scale(1.0 / mAppUnitsPerDevPixel); + mBoundingBox = mBoundingBox.Union(textRunMetrics.mBoundingBox); + } + + return NSToCoordRound(textRunMetrics.mAdvanceWidth); + } + + already_AddRefed GetGradientFor(Style aStyle) + { + RefPtr pattern; + CanvasGradient* gradient = mCtx->CurrentState().gradientStyles[aStyle]; + CanvasGradient::Type type = gradient->GetType(); + + switch (type) { + case CanvasGradient::Type::RADIAL: { + auto radial = static_cast(gradient); + pattern = new gfxPattern(radial->mCenter1.x, radial->mCenter1.y, + radial->mRadius1, radial->mCenter2.x, + radial->mCenter2.y, radial->mRadius2); + break; + } + case CanvasGradient::Type::LINEAR: { + auto linear = static_cast(gradient); + pattern = new gfxPattern(linear->mBegin.x, linear->mBegin.y, + linear->mEnd.x, linear->mEnd.y); + break; + } + default: + MOZ_ASSERT(false, "Should be linear or radial gradient."); + return nullptr; + } + + for (auto stop : gradient->mRawStops) { + pattern->AddColorStop(stop.offset, stop.color); + } + + return pattern.forget(); + } + + gfx::ExtendMode CvtCanvasRepeatToGfxRepeat( + CanvasPattern::RepeatMode aRepeatMode) + { + switch (aRepeatMode) { + case CanvasPattern::RepeatMode::REPEAT: + return gfx::ExtendMode::REPEAT; + case CanvasPattern::RepeatMode::REPEATX: + return gfx::ExtendMode::REPEAT_X; + case CanvasPattern::RepeatMode::REPEATY: + return gfx::ExtendMode::REPEAT_Y; + case CanvasPattern::RepeatMode::NOREPEAT: + return gfx::ExtendMode::CLAMP; + default: + return gfx::ExtendMode::CLAMP; + } + } + + already_AddRefed GetPatternFor(Style aStyle) + { + const CanvasPattern* pat = mCtx->CurrentState().patternStyles[aStyle]; + RefPtr pattern = new gfxPattern(pat->mSurface, Matrix()); + pattern->SetExtend(CvtCanvasRepeatToGfxRepeat(pat->mRepeat)); + return pattern.forget(); + } + + virtual void DrawText(nscoord aXOffset, nscoord aWidth) + { + gfxPoint point = mPt; + bool rtl = mTextRun->IsRightToLeft(); + bool verticalRun = mTextRun->IsVertical(); + RefPtr pattern; + + gfxFloat& inlineCoord = verticalRun ? point.y : point.x; + inlineCoord += aXOffset; + + // offset is given in terms of left side of string + if (rtl) { + // Bug 581092 - don't use rounded pixel width to advance to + // right-hand end of run, because this will cause different + // glyph positioning for LTR vs RTL drawing of the same + // glyph string on OS X and DWrite where textrun widths may + // involve fractional pixels. + gfxTextRun::Metrics textRunMetrics = + mTextRun->MeasureText(mDoMeasureBoundingBox ? + gfxFont::TIGHT_INK_EXTENTS : + gfxFont::LOOSE_INK_EXTENTS, + mDrawTarget); + inlineCoord += textRunMetrics.mAdvanceWidth; + // old code was: + // point.x += width * mAppUnitsPerDevPixel; + // TODO: restore this if/when we move to fractional coords + // throughout the text layout process + } + + mCtx->EnsureTarget(); + if (!mCtx->IsTargetValid()) { + return; + } + + // Defer the tasks to gfxTextRun which will handle color/svg-in-ot fonts + // appropriately. + StrokeOptions strokeOpts; + DrawOptions drawOpts; + Style style = (mOp == CanvasRenderingContext2D::TextDrawOperation::FILL) + ? Style::FILL + : Style::STROKE; + + AdjustedTarget target(mCtx); + if (!target) { + return; + } + + RefPtr thebes = + gfxContext::CreatePreservingTransformOrNull(target); + if (!thebes) { + // If CreatePreservingTransformOrNull returns null, it will also have + // issued a gfxCriticalNote already, so here we'll just bail out. + return; + } + gfxTextRun::DrawParams params(thebes); + + const ContextState* state = &mCtx->CurrentState(); + if (state->StyleIsColor(style)) { // Color + nscolor fontColor = state->colorStyles[style]; + if (style == Style::FILL) { + params.context->SetColor(Color::FromABGR(fontColor)); + } else { + params.textStrokeColor = fontColor; + } + } else { + if (state->gradientStyles[style]) { // Gradient + pattern = GetGradientFor(style); + } else if (state->patternStyles[style]) { // Pattern + pattern = GetPatternFor(style); + } else { + MOZ_ASSERT(false, "Should never reach here."); + return; + } + MOZ_ASSERT(pattern, "No valid pattern."); + + if (style == Style::FILL) { + params.context->SetPattern(pattern); + } else { + params.textStrokePattern = pattern; + } + } + + drawOpts.mAlpha = state->globalAlpha; + drawOpts.mCompositionOp = mCtx->UsedOperation(); + if (!mCtx->IsTargetValid()) { + return; + } + state = &mCtx->CurrentState(); + params.drawOpts = &drawOpts; + + if (style == Style::STROKE) { + strokeOpts.mLineWidth = state->lineWidth; + strokeOpts.mLineJoin = state->lineJoin; + strokeOpts.mLineCap = state->lineCap; + strokeOpts.mMiterLimit = state->miterLimit; + strokeOpts.mDashLength = state->dash.Length(); + strokeOpts.mDashPattern = + (strokeOpts.mDashLength > 0) ? state->dash.Elements() : 0; + strokeOpts.mDashOffset = state->dashOffset; + + params.drawMode = DrawMode::GLYPH_STROKE; + params.strokeOpts = &strokeOpts; + } + + mTextRun->Draw(gfxTextRun::Range(mTextRun.get()), point, params); + } + + // current text run + RefPtr mTextRun; + + // pointer to a screen reference context used to measure text and such + RefPtr mDrawTarget; + + // Pointer to the draw target we should fill our text to + CanvasRenderingContext2D* mCtx; + + // position of the left side of the string, alphabetic baseline + gfxPoint mPt; + + // current font + gfxFontGroup* mFontgrp; + + // to record any unsupported characters found in the text, + // and notify front-end if it is interested + nsAutoPtr mMissingFonts; + + // dev pixel conversion factor + int32_t mAppUnitsPerDevPixel; + + // operation (fill or stroke) + CanvasRenderingContext2D::TextDrawOperation mOp; + + // union of bounding boxes of all runs, needed for shadows + gfxRect mBoundingBox; + + // flags to use when creating textrun, based on CSS style + uint32_t mTextRunFlags; + + // true iff the bounding box should be measured + bool mDoMeasureBoundingBox; +}; + +nsresult +CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText, + float aX, + float aY, + const Optional& aMaxWidth, + TextDrawOperation aOp, + float* aWidth) +{ + nsresult rv; + + if (!mCanvasElement && !mDocShell) { + NS_WARNING("Canvas element must be non-null or a docshell must be provided"); + return NS_ERROR_FAILURE; + } + + nsCOMPtr presShell = GetPresShell(); + if (!presShell) + return NS_ERROR_FAILURE; + + nsIDocument* document = presShell->GetDocument(); + + // replace all the whitespace characters with U+0020 SPACE + nsAutoString textToDraw(aRawText); + TextReplaceWhitespaceCharacters(textToDraw); + + // According to spec, the API should return an empty array if maxWidth was provided + // but is less than or equal to zero or equal to NaN. + if (aMaxWidth.WasPassed() && (aMaxWidth.Value() <= 0 || IsNaN(aMaxWidth.Value()))) { + textToDraw.Truncate(); + } + + // for now, default to ltr if not in doc + bool isRTL = false; + + RefPtr canvasStyle; + if (mCanvasElement && mCanvasElement->IsInUncomposedDoc()) { + // try to find the closest context + canvasStyle = + nsComputedDOMStyle::GetStyleContextForElement(mCanvasElement, + nullptr, + presShell); + if (!canvasStyle) { + return NS_ERROR_FAILURE; + } + + isRTL = canvasStyle->StyleVisibility()->mDirection == + NS_STYLE_DIRECTION_RTL; + } else { + isRTL = GET_BIDI_OPTION_DIRECTION(document->GetBidiOptions()) == IBMBIDI_TEXTDIRECTION_RTL; + } + + // This is only needed to know if we can know the drawing bounding box easily. + const bool doCalculateBounds = NeedToCalculateBounds(); + if (presShell->IsDestroying()) { + return NS_ERROR_FAILURE; + } + + gfxFontGroup* currentFontStyle = GetCurrentFontStyle(); + if (!currentFontStyle) { + return NS_ERROR_FAILURE; + } + + MOZ_ASSERT(!presShell->IsDestroying(), + "GetCurrentFontStyle() should have returned null if the presshell is being destroyed"); + + // ensure user font set is up to date + currentFontStyle-> + SetUserFontSet(presShell->GetPresContext()->GetUserFontSet()); + + if (currentFontStyle->GetStyle()->size == 0.0F) { + if (aWidth) { + *aWidth = 0; + } + return NS_OK; + } + + if (!IsFinite(aX) || !IsFinite(aY)) { + return NS_OK; + } + + CanvasBidiProcessor processor; + + // If we don't have a style context, we can't set up vertical-text flags + // (for now, at least; perhaps we need new Canvas API to control this). + processor.mTextRunFlags = canvasStyle ? + nsLayoutUtils::GetTextRunFlagsForStyle(canvasStyle, + canvasStyle->StyleFont(), + canvasStyle->StyleText(), + 0) : 0; + + GetAppUnitsValues(&processor.mAppUnitsPerDevPixel, nullptr); + processor.mPt = gfxPoint(aX, aY); + processor.mDrawTarget = + gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget(); + + // If we don't have a target then we don't have a transform. A target won't + // be needed in the case where we're measuring the text size. This allows + // to avoid creating a target if it's only being used to measure text sizes. + if (mTarget) { + processor.mDrawTarget->SetTransform(mTarget->GetTransform()); + } + processor.mCtx = this; + processor.mOp = aOp; + processor.mBoundingBox = gfxRect(0, 0, 0, 0); + processor.mDoMeasureBoundingBox = doCalculateBounds || !mIsEntireFrameInvalid; + processor.mFontgrp = currentFontStyle; + + nscoord totalWidthCoord; + + // calls bidi algo twice since it needs the full text width and the + // bounding boxes before rendering anything + nsBidi bidiEngine; + rv = nsBidiPresUtils::ProcessText(textToDraw.get(), + textToDraw.Length(), + isRTL ? NSBIDI_RTL : NSBIDI_LTR, + presShell->GetPresContext(), + processor, + nsBidiPresUtils::MODE_MEASURE, + nullptr, + 0, + &totalWidthCoord, + &bidiEngine); + if (NS_FAILED(rv)) { + return rv; + } + + float totalWidth = float(totalWidthCoord) / processor.mAppUnitsPerDevPixel; + if (aWidth) { + *aWidth = totalWidth; + } + + // if only measuring, don't need to do any more work + if (aOp==TextDrawOperation::MEASURE) { + return NS_OK; + } + + // offset pt.x based on text align + gfxFloat anchorX; + + const ContextState& state = CurrentState(); + if (state.textAlign == TextAlign::CENTER) { + anchorX = .5; + } else if (state.textAlign == TextAlign::LEFT || + (!isRTL && state.textAlign == TextAlign::START) || + (isRTL && state.textAlign == TextAlign::END)) { + anchorX = 0; + } else { + anchorX = 1; + } + + processor.mPt.x -= anchorX * totalWidth; + + // offset pt.y (or pt.x, for vertical text) based on text baseline + processor.mFontgrp->UpdateUserFonts(); // ensure user font generation is current + const gfxFont::Metrics& fontMetrics = + processor.mFontgrp->GetFirstValidFont()->GetMetrics(gfxFont::eHorizontal); + + gfxFloat baselineAnchor; + + switch (state.textBaseline) + { + case TextBaseline::HANGING: + // fall through; best we can do with the information available + case TextBaseline::TOP: + baselineAnchor = fontMetrics.emAscent; + break; + case TextBaseline::MIDDLE: + baselineAnchor = (fontMetrics.emAscent - fontMetrics.emDescent) * .5f; + break; + case TextBaseline::IDEOGRAPHIC: + // fall through; best we can do with the information available + case TextBaseline::ALPHABETIC: + baselineAnchor = 0; + break; + case TextBaseline::BOTTOM: + baselineAnchor = -fontMetrics.emDescent; + break; + default: + MOZ_CRASH("GFX: unexpected TextBaseline"); + } + + // We can't query the textRun directly, as it may not have been created yet; + // so instead we check the flags that will be used to initialize it. + uint16_t runOrientation = + (processor.mTextRunFlags & gfxTextRunFactory::TEXT_ORIENT_MASK); + if (runOrientation != gfxTextRunFactory::TEXT_ORIENT_HORIZONTAL) { + if (runOrientation == gfxTextRunFactory::TEXT_ORIENT_VERTICAL_MIXED || + runOrientation == gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT) { + // Adjust to account for mTextRun being shaped using center baseline + // rather than alphabetic. + baselineAnchor -= (fontMetrics.emAscent - fontMetrics.emDescent) * .5f; + } + processor.mPt.x -= baselineAnchor; + } else { + processor.mPt.y += baselineAnchor; + } + + // correct bounding box to get it to be the correct size/position + processor.mBoundingBox.width = totalWidth; + processor.mBoundingBox.MoveBy(processor.mPt); + + processor.mPt.x *= processor.mAppUnitsPerDevPixel; + processor.mPt.y *= processor.mAppUnitsPerDevPixel; + + EnsureTarget(); + if (!IsTargetValid()) { + return NS_ERROR_FAILURE; + } + + Matrix oldTransform = mTarget->GetTransform(); + // if text is over aMaxWidth, then scale the text horizontally such that its + // width is precisely aMaxWidth + if (aMaxWidth.WasPassed() && aMaxWidth.Value() > 0 && + totalWidth > aMaxWidth.Value()) { + Matrix newTransform = oldTransform; + + // Translate so that the anchor point is at 0,0, then scale and then + // translate back. + newTransform.PreTranslate(aX, 0); + newTransform.PreScale(aMaxWidth.Value() / totalWidth, 1); + newTransform.PreTranslate(-aX, 0); + /* we do this to avoid an ICE in the android compiler */ + Matrix androidCompilerBug = newTransform; + mTarget->SetTransform(androidCompilerBug); + } + + // save the previous bounding box + gfxRect boundingBox = processor.mBoundingBox; + + // don't ever need to measure the bounding box twice + processor.mDoMeasureBoundingBox = false; + + rv = nsBidiPresUtils::ProcessText(textToDraw.get(), + textToDraw.Length(), + isRTL ? NSBIDI_RTL : NSBIDI_LTR, + presShell->GetPresContext(), + processor, + nsBidiPresUtils::MODE_DRAW, + nullptr, + 0, + nullptr, + &bidiEngine); + + + mTarget->SetTransform(oldTransform); + + if (aOp == CanvasRenderingContext2D::TextDrawOperation::FILL && + !doCalculateBounds) { + RedrawUser(boundingBox); + return NS_OK; + } + + Redraw(); + return NS_OK; +} + +gfxFontGroup* +CanvasRenderingContext2D::GetCurrentFontStyle() +{ + // use lazy initilization for the font group since it's rather expensive + if (!CurrentState().fontGroup) { + ErrorResult err; + NS_NAMED_LITERAL_STRING(kDefaultFontStyle, "10px sans-serif"); + static float kDefaultFontSize = 10.0; + nsCOMPtr presShell = GetPresShell(); + bool fontUpdated = SetFontInternal(kDefaultFontStyle, err); + if (err.Failed() || !fontUpdated) { + err.SuppressException(); + gfxFontStyle style; + style.size = kDefaultFontSize; + gfxTextPerfMetrics* tp = nullptr; + if (presShell && !presShell->IsDestroying()) { + tp = presShell->GetPresContext()->GetTextPerfMetrics(); + } + int32_t perDevPixel, perCSSPixel; + GetAppUnitsValues(&perDevPixel, &perCSSPixel); + gfxFloat devToCssSize = gfxFloat(perDevPixel) / gfxFloat(perCSSPixel); + CurrentState().fontGroup = + gfxPlatform::GetPlatform()->CreateFontGroup(FontFamilyList(eFamily_sans_serif), + &style, tp, + nullptr, devToCssSize); + if (CurrentState().fontGroup) { + CurrentState().font = kDefaultFontStyle; + } else { + NS_ERROR("Default canvas font is invalid"); + } + } + } + + return CurrentState().fontGroup; +} + +// +// line caps/joins +// + +void +CanvasRenderingContext2D::SetLineCap(const nsAString& aLinecapStyle) +{ + CapStyle cap; + + if (aLinecapStyle.EqualsLiteral("butt")) { + cap = CapStyle::BUTT; + } else if (aLinecapStyle.EqualsLiteral("round")) { + cap = CapStyle::ROUND; + } else if (aLinecapStyle.EqualsLiteral("square")) { + cap = CapStyle::SQUARE; + } else { + // XXX ERRMSG we need to report an error to developers here! (bug 329026) + return; + } + + CurrentState().lineCap = cap; +} + +void +CanvasRenderingContext2D::GetLineCap(nsAString& aLinecapStyle) +{ + switch (CurrentState().lineCap) { + case CapStyle::BUTT: + aLinecapStyle.AssignLiteral("butt"); + break; + case CapStyle::ROUND: + aLinecapStyle.AssignLiteral("round"); + break; + case CapStyle::SQUARE: + aLinecapStyle.AssignLiteral("square"); + break; + } +} + +void +CanvasRenderingContext2D::SetLineJoin(const nsAString& aLinejoinStyle) +{ + JoinStyle j; + + if (aLinejoinStyle.EqualsLiteral("round")) { + j = JoinStyle::ROUND; + } else if (aLinejoinStyle.EqualsLiteral("bevel")) { + j = JoinStyle::BEVEL; + } else if (aLinejoinStyle.EqualsLiteral("miter")) { + j = JoinStyle::MITER_OR_BEVEL; + } else { + // XXX ERRMSG we need to report an error to developers here! (bug 329026) + return; + } + + CurrentState().lineJoin = j; +} + +void +CanvasRenderingContext2D::GetLineJoin(nsAString& aLinejoinStyle, ErrorResult& aError) +{ + switch (CurrentState().lineJoin) { + case JoinStyle::ROUND: + aLinejoinStyle.AssignLiteral("round"); + break; + case JoinStyle::BEVEL: + aLinejoinStyle.AssignLiteral("bevel"); + break; + case JoinStyle::MITER_OR_BEVEL: + aLinejoinStyle.AssignLiteral("miter"); + break; + default: + aError.Throw(NS_ERROR_FAILURE); + } +} + +void +CanvasRenderingContext2D::SetLineDash(const Sequence& aSegments, + ErrorResult& aRv) +{ + nsTArray dash; + + for (uint32_t x = 0; x < aSegments.Length(); x++) { + if (aSegments[x] < 0.0) { + // Pattern elements must be finite "numbers" >= 0, with "finite" + // taken care of by WebIDL + return; + } + + if (!dash.AppendElement(aSegments[x], fallible)) { + aRv.Throw(NS_ERROR_OUT_OF_MEMORY); + return; + } + } + if (aSegments.Length() % 2) { // If the number of elements is odd, concatenate again + for (uint32_t x = 0; x < aSegments.Length(); x++) { + if (!dash.AppendElement(aSegments[x], fallible)) { + aRv.Throw(NS_ERROR_OUT_OF_MEMORY); + return; + } + } + } + + CurrentState().dash = Move(dash); +} + +void +CanvasRenderingContext2D::GetLineDash(nsTArray& aSegments) const { + const nsTArray& dash = CurrentState().dash; + aSegments.Clear(); + + for (uint32_t x = 0; x < dash.Length(); x++) { + aSegments.AppendElement(dash[x]); + } +} + +void +CanvasRenderingContext2D::SetLineDashOffset(double aOffset) { + CurrentState().dashOffset = aOffset; +} + +double +CanvasRenderingContext2D::LineDashOffset() const { + return CurrentState().dashOffset; +} + +bool +CanvasRenderingContext2D::IsPointInPath(double aX, double aY, const CanvasWindingRule& aWinding) +{ + if (!FloatValidate(aX, aY)) { + return false; + } + + EnsureUserSpacePath(aWinding); + if (!mPath) { + return false; + } + + if (mPathTransformWillUpdate) { + return mPath->ContainsPoint(Point(aX, aY), mPathToDS); + } + + return mPath->ContainsPoint(Point(aX, aY), mTarget->GetTransform()); +} + +bool CanvasRenderingContext2D::IsPointInPath(const CanvasPath& aPath, double aX, double aY, const CanvasWindingRule& aWinding) +{ + if (!FloatValidate(aX, aY)) { + return false; + } + + EnsureTarget(); + if (!IsTargetValid()) { + return false; + } + + RefPtr tempPath = aPath.GetPath(aWinding, mTarget); + + return tempPath->ContainsPoint(Point(aX, aY), mTarget->GetTransform()); +} + +bool +CanvasRenderingContext2D::IsPointInStroke(double aX, double aY) +{ + if (!FloatValidate(aX, aY)) { + return false; + } + + EnsureUserSpacePath(); + if (!mPath) { + return false; + } + + const ContextState &state = CurrentState(); + + StrokeOptions strokeOptions(state.lineWidth, + state.lineJoin, + state.lineCap, + state.miterLimit, + state.dash.Length(), + state.dash.Elements(), + state.dashOffset); + + if (mPathTransformWillUpdate) { + return mPath->StrokeContainsPoint(strokeOptions, Point(aX, aY), mPathToDS); + } + return mPath->StrokeContainsPoint(strokeOptions, Point(aX, aY), mTarget->GetTransform()); +} + +bool CanvasRenderingContext2D::IsPointInStroke(const CanvasPath& aPath, double aX, double aY) +{ + if (!FloatValidate(aX, aY)) { + return false; + } + + EnsureTarget(); + if (!IsTargetValid()) { + return false; + } + + RefPtr tempPath = aPath.GetPath(CanvasWindingRule::Nonzero, mTarget); + + const ContextState &state = CurrentState(); + + StrokeOptions strokeOptions(state.lineWidth, + state.lineJoin, + state.lineCap, + state.miterLimit, + state.dash.Length(), + state.dash.Elements(), + state.dashOffset); + + return tempPath->StrokeContainsPoint(strokeOptions, Point(aX, aY), mTarget->GetTransform()); +} + +// Returns a surface that contains only the part needed to draw aSourceRect. +// On entry, aSourceRect is relative to aSurface, and on return aSourceRect is +// relative to the returned surface. +static already_AddRefed +ExtractSubrect(SourceSurface* aSurface, gfx::Rect* aSourceRect, DrawTarget* aTargetDT) +{ + gfx::Rect roundedOutSourceRect = *aSourceRect; + roundedOutSourceRect.RoundOut(); + gfx::IntRect roundedOutSourceRectInt; + if (!roundedOutSourceRect.ToIntRect(&roundedOutSourceRectInt)) { + RefPtr surface(aSurface); + return surface.forget(); + } + + RefPtr subrectDT = + aTargetDT->CreateSimilarDrawTarget(roundedOutSourceRectInt.Size(), SurfaceFormat::B8G8R8A8); + + if (!subrectDT) { + RefPtr surface(aSurface); + return surface.forget(); + } + + *aSourceRect -= roundedOutSourceRect.TopLeft(); + + subrectDT->CopySurface(aSurface, roundedOutSourceRectInt, IntPoint()); + return subrectDT->Snapshot(); +} + +// +// image +// + +static void +ClipImageDimension(double& aSourceCoord, double& aSourceSize, int32_t aImageSize, + double& aDestCoord, double& aDestSize) +{ + double scale = aDestSize / aSourceSize; + if (aSourceCoord < 0.0) { + double destEnd = aDestCoord + aDestSize; + aDestCoord -= aSourceCoord * scale; + aDestSize = destEnd - aDestCoord; + aSourceSize += aSourceCoord; + aSourceCoord = 0.0; + } + double delta = aImageSize - (aSourceCoord + aSourceSize); + if (delta < 0.0) { + aDestSize += delta * scale; + aSourceSize = aImageSize - aSourceCoord; + } +} + +// Acts like nsLayoutUtils::SurfaceFromElement, but it'll attempt +// to pull a SourceSurface from our cache. This allows us to avoid +// reoptimizing surfaces if content and canvas backends are different. +nsLayoutUtils::SurfaceFromElementResult +CanvasRenderingContext2D::CachedSurfaceFromElement(Element* aElement) +{ + nsLayoutUtils::SurfaceFromElementResult res; + nsCOMPtr imageLoader = do_QueryInterface(aElement); + if (!imageLoader) { + return res; + } + + nsCOMPtr imgRequest; + imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST, + getter_AddRefs(imgRequest)); + if (!imgRequest) { + return res; + } + + uint32_t status = 0; + if (NS_FAILED(imgRequest->GetImageStatus(&status)) || + !(status & imgIRequest::STATUS_LOAD_COMPLETE)) { + return res; + } + + nsCOMPtr principal; + if (NS_FAILED(imgRequest->GetImagePrincipal(getter_AddRefs(principal))) || + !principal) { + return res; + } + + res.mSourceSurface = + CanvasImageCache::LookupAllCanvas(aElement, mIsSkiaGL); + if (!res.mSourceSurface) { + return res; + } + + int32_t corsmode = imgIRequest::CORS_NONE; + if (NS_SUCCEEDED(imgRequest->GetCORSMode(&corsmode))) { + res.mCORSUsed = corsmode != imgIRequest::CORS_NONE; + } + + res.mSize = res.mSourceSurface->GetSize(); + res.mPrincipal = principal.forget(); + res.mIsWriteOnly = false; + res.mImageRequest = imgRequest.forget(); + + return res; +} + +// drawImage(in HTMLImageElement image, in float dx, in float dy); +// -- render image from 0,0 at dx,dy top-left coords +// drawImage(in HTMLImageElement image, in float dx, in float dy, in float dw, in float dh); +// -- render image from 0,0 at dx,dy top-left coords clipping it to dw,dh +// drawImage(in HTMLImageElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh); +// -- render the region defined by (sx,sy,sw,wh) in image-local space into the region (dx,dy,dw,dh) on the canvas + +// If only dx and dy are passed in then optional_argc should be 0. If only +// dx, dy, dw and dh are passed in then optional_argc should be 2. The only +// other valid value for optional_argc is 6 if sx, sy, sw, sh, dx, dy, dw and dh +// are all passed in. + +void +CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage, + double aSx, double aSy, double aSw, + double aSh, double aDx, double aDy, + double aDw, double aDh, + uint8_t aOptional_argc, + ErrorResult& aError) +{ + if (mDrawObserver) { + mDrawObserver->DidDrawCall(CanvasDrawObserver::DrawCallType::DrawImage); + } + + MOZ_ASSERT(aOptional_argc == 0 || aOptional_argc == 2 || aOptional_argc == 6); + + if (!ValidateRect(aDx, aDy, aDw, aDh, true)) { + return; + } + if (aOptional_argc == 6) { + if (!ValidateRect(aSx, aSy, aSw, aSh, true)) { + return; + } + } + + RefPtr srcSurf; + gfx::IntSize imgSize; + + Element* element = nullptr; + + EnsureTarget(); + if (!IsTargetValid()) { + return; + } + + if (aImage.IsHTMLCanvasElement()) { + HTMLCanvasElement* canvas = &aImage.GetAsHTMLCanvasElement(); + element = canvas; + nsIntSize size = canvas->GetSize(); + if (size.width == 0 || size.height == 0) { + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return; + } + } else if (aImage.IsImageBitmap()) { + ImageBitmap& imageBitmap = aImage.GetAsImageBitmap(); + srcSurf = imageBitmap.PrepareForDrawTarget(mTarget); + + if (!srcSurf) { + return; + } + + imgSize = gfx::IntSize(imageBitmap.Width(), imageBitmap.Height()); + } + else { + if (aImage.IsHTMLImageElement()) { + HTMLImageElement* img = &aImage.GetAsHTMLImageElement(); + element = img; + } else { + HTMLVideoElement* video = &aImage.GetAsHTMLVideoElement(); + video->MarkAsContentSource(mozilla::dom::HTMLVideoElement::CallerAPI::DRAW_IMAGE); + element = video; + } + + srcSurf = + CanvasImageCache::LookupCanvas(element, mCanvasElement, &imgSize, mIsSkiaGL); + } + + nsLayoutUtils::DirectDrawInfo drawInfo; + +#ifdef USE_SKIA_GPU + if (mRenderingMode == RenderingMode::OpenGLBackendMode && + mIsSkiaGL && + !srcSurf && + aImage.IsHTMLVideoElement() && + AllowOpenGLCanvas()) { + mozilla::gl::GLContext* gl = gfxPlatform::GetPlatform()->GetSkiaGLGlue()->GetGLContext(); + MOZ_ASSERT(gl); + + HTMLVideoElement* video = &aImage.GetAsHTMLVideoElement(); + if (!video) { + return; + } + + if (video->ContainsRestrictedContent()) { + aError.Throw(NS_ERROR_NOT_AVAILABLE); + return; + } + + uint16_t readyState; + if (NS_SUCCEEDED(video->GetReadyState(&readyState)) && + readyState < nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA) { + // still loading, just return + return; + } + + // If it doesn't have a principal, just bail + nsCOMPtr principal = video->GetCurrentVideoPrincipal(); + if (!principal) { + aError.Throw(NS_ERROR_NOT_AVAILABLE); + return; + } + + mozilla::layers::ImageContainer* container = video->GetImageContainer(); + if (!container) { + aError.Throw(NS_ERROR_NOT_AVAILABLE); + return; + } + + AutoLockImage lockImage(container); + layers::Image* srcImage = lockImage.GetImage(); + if (!srcImage) { + aError.Throw(NS_ERROR_NOT_AVAILABLE); + return; + } + + gl->MakeCurrent(); + GLuint videoTexture = 0; + gl->fGenTextures(1, &videoTexture); + // skiaGL expect upload on drawing, and uses texture 0 for texturing, + // so we must active texture 0 and bind the texture for it. + gl->fActiveTexture(LOCAL_GL_TEXTURE0); + gl->fBindTexture(LOCAL_GL_TEXTURE_2D, videoTexture); + + gl->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGB, srcImage->GetSize().width, srcImage->GetSize().height, 0, LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_SHORT_5_6_5, nullptr); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR); + + const gl::OriginPos destOrigin = gl::OriginPos::TopLeft; + bool ok = gl->BlitHelper()->BlitImageToTexture(srcImage, srcImage->GetSize(), + videoTexture, LOCAL_GL_TEXTURE_2D, + destOrigin); + if (ok) { + NativeSurface texSurf; + texSurf.mType = NativeSurfaceType::OPENGL_TEXTURE; + texSurf.mFormat = SurfaceFormat::R5G6B5_UINT16; + texSurf.mSize.width = srcImage->GetSize().width; + texSurf.mSize.height = srcImage->GetSize().height; + texSurf.mSurface = (void*)((uintptr_t)videoTexture); + + srcSurf = mTarget->CreateSourceSurfaceFromNativeSurface(texSurf); + if (!srcSurf) { + gl->fDeleteTextures(1, &videoTexture); + } + imgSize.width = srcImage->GetSize().width; + imgSize.height = srcImage->GetSize().height; + + int32_t displayWidth = video->VideoWidth(); + int32_t displayHeight = video->VideoHeight(); + aSw *= (double)imgSize.width / (double)displayWidth; + aSh *= (double)imgSize.height / (double)displayHeight; + } else { + gl->fDeleteTextures(1, &videoTexture); + } + srcImage = nullptr; + + if (mCanvasElement) { + CanvasUtils::DoDrawImageSecurityCheck(mCanvasElement, + principal, false, + video->GetCORSMode() != CORS_NONE); + } + } +#endif + if (!srcSurf) { + // The canvas spec says that drawImage should draw the first frame + // of animated images. We also don't want to rasterize vector images. + uint32_t sfeFlags = nsLayoutUtils::SFE_WANT_FIRST_FRAME | + nsLayoutUtils::SFE_NO_RASTERIZING_VECTORS; + + nsLayoutUtils::SurfaceFromElementResult res = + CanvasRenderingContext2D::CachedSurfaceFromElement(element); + + if (!res.mSourceSurface) { + res = nsLayoutUtils::SurfaceFromElement(element, sfeFlags, mTarget); + } + + if (!res.mSourceSurface && !res.mDrawInfo.mImgContainer) { + // The spec says to silently do nothing in the following cases: + // - The element is still loading. + // - The image is bad, but it's not in the broken state (i.e., we could + // decode the headers and get the size). + if (!res.mIsStillLoading && !res.mHasSize) { + aError.Throw(NS_ERROR_NOT_AVAILABLE); + } + return; + } + + imgSize = res.mSize; + + // Scale sw/sh based on aspect ratio + if (aImage.IsHTMLVideoElement()) { + HTMLVideoElement* video = &aImage.GetAsHTMLVideoElement(); + int32_t displayWidth = video->VideoWidth(); + int32_t displayHeight = video->VideoHeight(); + aSw *= (double)imgSize.width / (double)displayWidth; + aSh *= (double)imgSize.height / (double)displayHeight; + } + + if (mCanvasElement) { + CanvasUtils::DoDrawImageSecurityCheck(mCanvasElement, + res.mPrincipal, res.mIsWriteOnly, + res.mCORSUsed); + } + + if (res.mSourceSurface) { + if (res.mImageRequest) { + CanvasImageCache::NotifyDrawImage(element, mCanvasElement, res.mSourceSurface, imgSize, mIsSkiaGL); + } + srcSurf = res.mSourceSurface; + } else { + drawInfo = res.mDrawInfo; + } + } + + if (aOptional_argc == 0) { + aSx = aSy = 0.0; + aDw = aSw = (double) imgSize.width; + aDh = aSh = (double) imgSize.height; + } else if (aOptional_argc == 2) { + aSx = aSy = 0.0; + aSw = (double) imgSize.width; + aSh = (double) imgSize.height; + } + + if (aSw == 0.0 || aSh == 0.0) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + ClipImageDimension(aSx, aSw, imgSize.width, aDx, aDw); + ClipImageDimension(aSy, aSh, imgSize.height, aDy, aDh); + + if (aSw <= 0.0 || aSh <= 0.0 || + aDw <= 0.0 || aDh <= 0.0) { + // source and/or destination are fully clipped, so nothing is painted + return; + } + + SamplingFilter samplingFilter; + AntialiasMode antialiasMode; + + if (CurrentState().imageSmoothingEnabled) { + samplingFilter = gfx::SamplingFilter::LINEAR; + antialiasMode = AntialiasMode::DEFAULT; + } else { + samplingFilter = gfx::SamplingFilter::POINT; + antialiasMode = AntialiasMode::NONE; + } + + const bool needBounds = NeedToCalculateBounds(); + if (!IsTargetValid()) { + return; + } + gfx::Rect bounds; + if (needBounds) { + bounds = gfx::Rect(aDx, aDy, aDw, aDh); + bounds = mTarget->GetTransform().TransformBounds(bounds); + } + + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + if (srcSurf) { + gfx::Rect sourceRect(aSx, aSy, aSw, aSh); + if (element == mCanvasElement) { + // srcSurf is a snapshot of mTarget. If we draw to mTarget now, we'll + // trigger a COW copy of the whole canvas into srcSurf. That's a huge + // waste if sourceRect doesn't cover the whole canvas. + // We avoid copying the whole canvas by manually copying just the part + // that we need. + srcSurf = ExtractSubrect(srcSurf, &sourceRect, mTarget); + } + AdjustedTarget tempTarget(this, bounds.IsEmpty() ? nullptr : &bounds); + if (!tempTarget) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + auto op = UsedOperation(); + if (!IsTargetValid() || !tempTarget) { + return; + } + tempTarget-> + DrawSurface(srcSurf, + gfx::Rect(aDx, aDy, aDw, aDh), + sourceRect, + DrawSurfaceOptions(samplingFilter, SamplingBounds::UNBOUNDED), + DrawOptions(CurrentState().globalAlpha, op, antialiasMode)); + } else { + DrawDirectlyToCanvas(drawInfo, &bounds, + gfx::Rect(aDx, aDy, aDw, aDh), + gfx::Rect(aSx, aSy, aSw, aSh), + imgSize); + } + + RedrawUser(gfxRect(aDx, aDy, aDw, aDh)); +} + +void +CanvasRenderingContext2D::DrawDirectlyToCanvas( + const nsLayoutUtils::DirectDrawInfo& aImage, + gfx::Rect* aBounds, + gfx::Rect aDest, + gfx::Rect aSrc, + gfx::IntSize aImgSize) +{ + MOZ_ASSERT(aSrc.width > 0 && aSrc.height > 0, + "Need positive source width and height"); + + AdjustedTarget tempTarget(this, aBounds->IsEmpty() ? nullptr: aBounds); + if (!tempTarget) { + return; + } + + // Get any existing transforms on the context, including transformations used + // for context shadow. + Matrix matrix = tempTarget->GetTransform(); + gfxMatrix contextMatrix; + contextMatrix = gfxMatrix(matrix._11, matrix._12, matrix._21, + matrix._22, matrix._31, matrix._32); + gfxSize contextScale(contextMatrix.ScaleFactors(true)); + + // Scale the dest rect to include the context scale. + aDest.Scale(contextScale.width, contextScale.height); + + // Scale the image size to the dest rect, and adjust the source rect to match. + gfxSize scale(aDest.width / aSrc.width, aDest.height / aSrc.height); + IntSize scaledImageSize = IntSize::Ceil(aImgSize.width * scale.width, + aImgSize.height * scale.height); + aSrc.Scale(scale.width, scale.height); + + // We're wrapping tempTarget's (our) DrawTarget here, so we need to restore + // the matrix even though this is a temp gfxContext. + AutoRestoreTransform autoRestoreTransform(mTarget); + + RefPtr context = gfxContext::CreateOrNull(tempTarget); + if (!context) { + gfxDevCrash(LogReason::InvalidContext) << "Canvas context problem"; + return; + } + context->SetMatrix(contextMatrix. + Scale(1.0 / contextScale.width, + 1.0 / contextScale.height). + Translate(aDest.x - aSrc.x, aDest.y - aSrc.y)); + + // FLAG_CLAMP is added for increased performance, since we never tile here. + uint32_t modifiedFlags = aImage.mDrawingFlags | imgIContainer::FLAG_CLAMP; + + CSSIntSize sz(scaledImageSize.width, scaledImageSize.height); // XXX hmm is scaledImageSize really in CSS pixels? + SVGImageContext svgContext(sz, Nothing(), CurrentState().globalAlpha); + + auto result = aImage.mImgContainer-> + Draw(context, scaledImageSize, + ImageRegion::Create(gfxRect(aSrc.x, aSrc.y, aSrc.width, aSrc.height)), + aImage.mWhichFrame, SamplingFilter::GOOD, Some(svgContext), modifiedFlags); + + if (result != DrawResult::SUCCESS) { + NS_WARNING("imgIContainer::Draw failed"); + } +} + +void +CanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& aOp, + ErrorResult& aError) +{ + CompositionOp comp_op; + +#define CANVAS_OP_TO_GFX_OP(cvsop, op2d) \ + if (aOp.EqualsLiteral(cvsop)) \ + comp_op = CompositionOp::OP_##op2d; + + CANVAS_OP_TO_GFX_OP("copy", SOURCE) + else CANVAS_OP_TO_GFX_OP("source-atop", ATOP) + else CANVAS_OP_TO_GFX_OP("source-in", IN) + else CANVAS_OP_TO_GFX_OP("source-out", OUT) + else CANVAS_OP_TO_GFX_OP("source-over", OVER) + else CANVAS_OP_TO_GFX_OP("destination-in", DEST_IN) + else CANVAS_OP_TO_GFX_OP("destination-out", DEST_OUT) + else CANVAS_OP_TO_GFX_OP("destination-over", DEST_OVER) + else CANVAS_OP_TO_GFX_OP("destination-atop", DEST_ATOP) + else CANVAS_OP_TO_GFX_OP("lighter", ADD) + else CANVAS_OP_TO_GFX_OP("xor", XOR) + else CANVAS_OP_TO_GFX_OP("multiply", MULTIPLY) + else CANVAS_OP_TO_GFX_OP("screen", SCREEN) + else CANVAS_OP_TO_GFX_OP("overlay", OVERLAY) + else CANVAS_OP_TO_GFX_OP("darken", DARKEN) + else CANVAS_OP_TO_GFX_OP("lighten", LIGHTEN) + else CANVAS_OP_TO_GFX_OP("color-dodge", COLOR_DODGE) + else CANVAS_OP_TO_GFX_OP("color-burn", COLOR_BURN) + else CANVAS_OP_TO_GFX_OP("hard-light", HARD_LIGHT) + else CANVAS_OP_TO_GFX_OP("soft-light", SOFT_LIGHT) + else CANVAS_OP_TO_GFX_OP("difference", DIFFERENCE) + else CANVAS_OP_TO_GFX_OP("exclusion", EXCLUSION) + else CANVAS_OP_TO_GFX_OP("hue", HUE) + else CANVAS_OP_TO_GFX_OP("saturation", SATURATION) + else CANVAS_OP_TO_GFX_OP("color", COLOR) + else CANVAS_OP_TO_GFX_OP("luminosity", LUMINOSITY) + // XXX ERRMSG we need to report an error to developers here! (bug 329026) + else return; + +#undef CANVAS_OP_TO_GFX_OP + CurrentState().op = comp_op; +} + +void +CanvasRenderingContext2D::GetGlobalCompositeOperation(nsAString& aOp, + ErrorResult& aError) +{ + CompositionOp comp_op = CurrentState().op; + +#define CANVAS_OP_TO_GFX_OP(cvsop, op2d) \ + if (comp_op == CompositionOp::OP_##op2d) \ + aOp.AssignLiteral(cvsop); + + CANVAS_OP_TO_GFX_OP("copy", SOURCE) + else CANVAS_OP_TO_GFX_OP("destination-atop", DEST_ATOP) + else CANVAS_OP_TO_GFX_OP("destination-in", DEST_IN) + else CANVAS_OP_TO_GFX_OP("destination-out", DEST_OUT) + else CANVAS_OP_TO_GFX_OP("destination-over", DEST_OVER) + else CANVAS_OP_TO_GFX_OP("lighter", ADD) + else CANVAS_OP_TO_GFX_OP("source-atop", ATOP) + else CANVAS_OP_TO_GFX_OP("source-in", IN) + else CANVAS_OP_TO_GFX_OP("source-out", OUT) + else CANVAS_OP_TO_GFX_OP("source-over", OVER) + else CANVAS_OP_TO_GFX_OP("xor", XOR) + else CANVAS_OP_TO_GFX_OP("multiply", MULTIPLY) + else CANVAS_OP_TO_GFX_OP("screen", SCREEN) + else CANVAS_OP_TO_GFX_OP("overlay", OVERLAY) + else CANVAS_OP_TO_GFX_OP("darken", DARKEN) + else CANVAS_OP_TO_GFX_OP("lighten", LIGHTEN) + else CANVAS_OP_TO_GFX_OP("color-dodge", COLOR_DODGE) + else CANVAS_OP_TO_GFX_OP("color-burn", COLOR_BURN) + else CANVAS_OP_TO_GFX_OP("hard-light", HARD_LIGHT) + else CANVAS_OP_TO_GFX_OP("soft-light", SOFT_LIGHT) + else CANVAS_OP_TO_GFX_OP("difference", DIFFERENCE) + else CANVAS_OP_TO_GFX_OP("exclusion", EXCLUSION) + else CANVAS_OP_TO_GFX_OP("hue", HUE) + else CANVAS_OP_TO_GFX_OP("saturation", SATURATION) + else CANVAS_OP_TO_GFX_OP("color", COLOR) + else CANVAS_OP_TO_GFX_OP("luminosity", LUMINOSITY) + else { + aError.Throw(NS_ERROR_FAILURE); + } + +#undef CANVAS_OP_TO_GFX_OP +} + +void +CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& aWindow, double aX, + double aY, double aW, double aH, + const nsAString& aBgColor, + uint32_t aFlags, ErrorResult& aError) +{ + MOZ_ASSERT(aWindow.IsInnerWindow()); + + if (int32_t(aW) == 0 || int32_t(aH) == 0) { + return; + } + + // protect against too-large surfaces that will cause allocation + // or overflow issues + if (!Factory::CheckSurfaceSize(IntSize(int32_t(aW), int32_t(aH)), 0xffff)) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + // Flush layout updates + if (!(aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH)) { + nsContentUtils::FlushLayoutForTree(aWindow.AsInner()->GetOuterWindow()); + } + + CompositionOp op = UsedOperation(); + bool discardContent = GlobalAlpha() == 1.0f + && (op == CompositionOp::OP_OVER || op == CompositionOp::OP_SOURCE); + const gfx::Rect drawRect(aX, aY, aW, aH); + EnsureTarget(discardContent ? &drawRect : nullptr); + + if (!IsTargetValid()) { + return; + } + + // We can't allow web apps to call this until we fix at least the + // following potential security issues: + // -- rendering cross-domain IFRAMEs and then extracting the results + // -- rendering the user's theme and then extracting the results + // -- rendering native anonymous content (e.g., file input paths; + // scrollbars should be allowed) + if (!nsContentUtils::IsCallerChrome()) { + // not permitted to use DrawWindow + // XXX ERRMSG we need to report an error to developers here! (bug 329026) + aError.Throw(NS_ERROR_DOM_SECURITY_ERR); + return; + } + + RefPtr presContext; + nsIDocShell* docshell = aWindow.GetDocShell(); + if (docshell) { + docshell->GetPresContext(getter_AddRefs(presContext)); + } + if (!presContext) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + nscolor backgroundColor; + if (!ParseColor(aBgColor, &backgroundColor)) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + nsRect r(nsPresContext::CSSPixelsToAppUnits((float)aX), + nsPresContext::CSSPixelsToAppUnits((float)aY), + nsPresContext::CSSPixelsToAppUnits((float)aW), + nsPresContext::CSSPixelsToAppUnits((float)aH)); + uint32_t renderDocFlags = (nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING | + nsIPresShell::RENDER_DOCUMENT_RELATIVE); + if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_CARET) { + renderDocFlags |= nsIPresShell::RENDER_CARET; + } + if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_VIEW) { + renderDocFlags &= ~(nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING | + nsIPresShell::RENDER_DOCUMENT_RELATIVE); + } + if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_USE_WIDGET_LAYERS) { + renderDocFlags |= nsIPresShell::RENDER_USE_WIDGET_LAYERS; + } + if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_ASYNC_DECODE_IMAGES) { + renderDocFlags |= nsIPresShell::RENDER_ASYNC_DECODE_IMAGES; + } + if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH) { + renderDocFlags |= nsIPresShell::RENDER_DRAWWINDOW_NOT_FLUSHING; + } + + // gfxContext-over-Azure may modify the DrawTarget's transform, so + // save and restore it + Matrix matrix = mTarget->GetTransform(); + double sw = matrix._11 * aW; + double sh = matrix._22 * aH; + if (!sw || !sh) { + return; + } + + RefPtr thebes; + RefPtr drawDT; + // Rendering directly is faster and can be done if mTarget supports Azure + // and does not need alpha blending. + // Since the pre-transaction callback calls ReturnTarget, we can't have a + // gfxContext wrapped around it when using a shared buffer provider because + // the DrawTarget's shared buffer may be unmapped in ReturnTarget. + op = CompositionOp::OP_ADD; + if (gfxPlatform::GetPlatform()->SupportsAzureContentForDrawTarget(mTarget) && + GlobalAlpha() == 1.0f) { + op = UsedOperation(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + } + if (op == CompositionOp::OP_OVER && + (!mBufferProvider || mBufferProvider->GetType() != LayersBackend::LAYERS_CLIENT)) + { + thebes = gfxContext::CreateOrNull(mTarget); + MOZ_ASSERT(thebes); // already checked the draw target above + // (in SupportsAzureContentForDrawTarget) + thebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21, + matrix._22, matrix._31, matrix._32)); + } else { + IntSize dtSize = IntSize::Ceil(sw, sh); + if (!Factory::AllowedSurfaceSize(dtSize)) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + drawDT = + gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(dtSize, + SurfaceFormat::B8G8R8A8); + if (!drawDT || !drawDT->IsValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + thebes = gfxContext::CreateOrNull(drawDT); + MOZ_ASSERT(thebes); // alrady checked the draw target above + thebes->SetMatrix(gfxMatrix::Scaling(matrix._11, matrix._22)); + } + + nsCOMPtr shell = presContext->PresShell(); + + Unused << shell->RenderDocument(r, renderDocFlags, backgroundColor, thebes); + // If this canvas was contained in the drawn window, the pre-transaction callback + // may have returned its DT. If so, we must reacquire it here. + EnsureTarget(discardContent ? &drawRect : nullptr); + + if (drawDT) { + RefPtr snapshot = drawDT->Snapshot(); + if (NS_WARN_IF(!snapshot)) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + RefPtr data = snapshot->GetDataSurface(); + if (!data || !Factory::AllowedSurfaceSize(data->GetSize())) { + gfxCriticalError() << "Unexpected invalid data source surface " << + (data ? data->GetSize() : IntSize(0,0)); + aError.Throw(NS_ERROR_FAILURE); + return; + } + + DataSourceSurface::MappedSurface rawData; + if (NS_WARN_IF(!data->Map(DataSourceSurface::READ, &rawData))) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + RefPtr source = + mTarget->CreateSourceSurfaceFromData(rawData.mData, + data->GetSize(), + rawData.mStride, + data->GetFormat()); + data->Unmap(); + + if (!source) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + op = UsedOperation(); + if (!IsTargetValid()) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + gfx::Rect destRect(0, 0, aW, aH); + gfx::Rect sourceRect(0, 0, sw, sh); + mTarget->DrawSurface(source, destRect, sourceRect, + DrawSurfaceOptions(gfx::SamplingFilter::POINT), + DrawOptions(GlobalAlpha(), op, + AntialiasMode::NONE)); + } else { + mTarget->SetTransform(matrix); + } + + // note that x and y are coordinates in the document that + // we're drawing; x and y are drawn to 0,0 in current user + // space. + RedrawUser(gfxRect(0, 0, aW, aH)); +} + +void +CanvasRenderingContext2D::AsyncDrawXULElement(nsXULElement& aElem, + double aX, double aY, + double aW, double aH, + const nsAString& aBgColor, + uint32_t aFlags, + ErrorResult& aError) +{ + // We can't allow web apps to call this until we fix at least the + // following potential security issues: + // -- rendering cross-domain IFRAMEs and then extracting the results + // -- rendering the user's theme and then extracting the results + // -- rendering native anonymous content (e.g., file input paths; + // scrollbars should be allowed) + if (!nsContentUtils::IsCallerChrome()) { + // not permitted to use DrawWindow + // XXX ERRMSG we need to report an error to developers here! (bug 329026) + aError.Throw(NS_ERROR_DOM_SECURITY_ERR); + return; + } + +#if 0 + nsCOMPtr loaderOwner = do_QueryInterface(&elem); + if (!loaderOwner) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + RefPtr frameloader = loaderOwner->GetFrameLoader(); + if (!frameloader) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + PBrowserParent *child = frameloader->GetRemoteBrowser(); + if (!child) { + nsIDocShell* docShell = frameLoader->GetExistingDocShell(); + if (!docShell) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + nsCOMPtr window = docShell->GetWindow(); + if (!window) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + return DrawWindow(window->GetCurrentInnerWindow(), aX, aY, aW, aH, + aBgColor, aFlags); + } + + // protect against too-large surfaces that will cause allocation + // or overflow issues + if (!Factory::CheckSurfaceSize(IntSize(aW, aH), 0xffff)) { + aError.Throw(NS_ERROR_FAILURE); + return; + } + + bool flush = + (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH) == 0; + + uint32_t renderDocFlags = nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING; + if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_CARET) { + renderDocFlags |= nsIPresShell::RENDER_CARET; + } + if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_VIEW) { + renderDocFlags &= ~nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING; + } + + nsRect rect(nsPresContext::CSSPixelsToAppUnits(aX), + nsPresContext::CSSPixelsToAppUnits(aY), + nsPresContext::CSSPixelsToAppUnits(aW), + nsPresContext::CSSPixelsToAppUnits(aH)); + if (mIPC) { + PDocumentRendererParent *pdocrender = + child->SendPDocumentRendererConstructor(rect, + mThebes->CurrentMatrix(), + nsString(aBGColor), + renderDocFlags, flush, + nsIntSize(mWidth, mHeight)); + if (!pdocrender) + return NS_ERROR_FAILURE; + + DocumentRendererParent *docrender = + static_cast(pdocrender); + + docrender->SetCanvasContext(this, mThebes); + } +#endif +} + +// +// device pixel getting/setting +// + +already_AddRefed +CanvasRenderingContext2D::GetImageData(JSContext* aCx, double aSx, + double aSy, double aSw, + double aSh, ErrorResult& aError) +{ + if (mDrawObserver) { + mDrawObserver->DidDrawCall(CanvasDrawObserver::DrawCallType::GetImageData); + } + + if (!mCanvasElement && !mDocShell) { + NS_ERROR("No canvas element and no docshell in GetImageData!!!"); + aError.Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + // Check only if we have a canvas element; if we were created with a docshell, + // then it's special internal use. + if (mCanvasElement && mCanvasElement->IsWriteOnly() && + !nsContentUtils::IsCallerChrome()) + { + // XXX ERRMSG we need to report an error to developers here! (bug 329026) + aError.Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + if (!IsFinite(aSx) || !IsFinite(aSy) || + !IsFinite(aSw) || !IsFinite(aSh)) { + aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return nullptr; + } + + if (!aSw || !aSh) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + + int32_t x = JS::ToInt32(aSx); + int32_t y = JS::ToInt32(aSy); + int32_t wi = JS::ToInt32(aSw); + int32_t hi = JS::ToInt32(aSh); + + // Handle negative width and height by flipping the rectangle over in the + // relevant direction. + uint32_t w, h; + if (aSw < 0) { + w = -wi; + x -= w; + } else { + w = wi; + } + if (aSh < 0) { + h = -hi; + y -= h; + } else { + h = hi; + } + + if (w == 0) { + w = 1; + } + if (h == 0) { + h = 1; + } + + JS::Rooted array(aCx); + aError = GetImageDataArray(aCx, x, y, w, h, array.address()); + if (aError.Failed()) { + return nullptr; + } + MOZ_ASSERT(array); + + RefPtr imageData = new ImageData(w, h, *array); + return imageData.forget(); +} + +nsresult +CanvasRenderingContext2D::GetImageDataArray(JSContext* aCx, + int32_t aX, + int32_t aY, + uint32_t aWidth, + uint32_t aHeight, + JSObject** aRetval) +{ + if (mDrawObserver) { + mDrawObserver->DidDrawCall(CanvasDrawObserver::DrawCallType::GetImageData); + } + + MOZ_ASSERT(aWidth && aHeight); + + CheckedInt len = CheckedInt(aWidth) * aHeight * 4; + if (!len.isValid()) { + return NS_ERROR_DOM_INDEX_SIZE_ERR; + } + + CheckedInt rightMost = CheckedInt(aX) + aWidth; + CheckedInt bottomMost = CheckedInt(aY) + aHeight; + + if (!rightMost.isValid() || !bottomMost.isValid()) { + return NS_ERROR_DOM_SYNTAX_ERR; + } + + JS::Rooted darray(aCx, JS_NewUint8ClampedArray(aCx, len.value())); + if (!darray) { + return NS_ERROR_OUT_OF_MEMORY; + } + + if (mZero) { + *aRetval = darray; + return NS_OK; + } + + IntRect srcRect(0, 0, mWidth, mHeight); + IntRect destRect(aX, aY, aWidth, aHeight); + IntRect srcReadRect = srcRect.Intersect(destRect); + RefPtr readback; + DataSourceSurface::MappedSurface rawData; + if (!srcReadRect.IsEmpty()) { + RefPtr snapshot; + if (!mTarget && mBufferProvider) { + snapshot = mBufferProvider->BorrowSnapshot(); + } else { + EnsureTarget(); + if (!IsTargetValid()) { + return NS_ERROR_FAILURE; + } + snapshot = mTarget->Snapshot(); + } + + if (snapshot) { + readback = snapshot->GetDataSurface(); + } + + if (!mTarget && mBufferProvider) { + mBufferProvider->ReturnSnapshot(snapshot.forget()); + } + + if (!readback || !readback->Map(DataSourceSurface::READ, &rawData)) { + return NS_ERROR_OUT_OF_MEMORY; + } + } + + IntRect dstWriteRect = srcReadRect; + dstWriteRect.MoveBy(-aX, -aY); + + JS::AutoCheckCannotGC nogc; + bool isShared; + uint8_t* data = JS_GetUint8ClampedArrayData(darray, &isShared, nogc); + MOZ_ASSERT(!isShared); // Should not happen, data was created above + + uint8_t* src; + uint32_t srcStride; + if (readback) { + srcStride = rawData.mStride; + src = rawData.mData + srcReadRect.y * srcStride + srcReadRect.x * 4; + } else { + src = data; + srcStride = aWidth * 4; + } + + uint8_t* dst = data + dstWriteRect.y * (aWidth * 4) + dstWriteRect.x * 4; + + if (mOpaque) { + for (int32_t j = 0; j < dstWriteRect.height; ++j) { + for (int32_t i = 0; i < dstWriteRect.width; ++i) { + // XXX Is there some useful swizzle MMX we can use here? +#if MOZ_LITTLE_ENDIAN + uint8_t b = *src++; + uint8_t g = *src++; + uint8_t r = *src++; + src++; +#else + src++; + uint8_t r = *src++; + uint8_t g = *src++; + uint8_t b = *src++; +#endif + *dst++ = r; + *dst++ = g; + *dst++ = b; + *dst++ = 255; + } + src += srcStride - (dstWriteRect.width * 4); + dst += (aWidth * 4) - (dstWriteRect.width * 4); + } + } else + for (int32_t j = 0; j < dstWriteRect.height; ++j) { + for (int32_t i = 0; i < dstWriteRect.width; ++i) { + // XXX Is there some useful swizzle MMX we can use here? +#if MOZ_LITTLE_ENDIAN + uint8_t b = *src++; + uint8_t g = *src++; + uint8_t r = *src++; + uint8_t a = *src++; +#else + uint8_t a = *src++; + uint8_t r = *src++; + uint8_t g = *src++; + uint8_t b = *src++; +#endif + // Convert to non-premultiplied color + *dst++ = gfxUtils::sUnpremultiplyTable[a * 256 + r]; + *dst++ = gfxUtils::sUnpremultiplyTable[a * 256 + g]; + *dst++ = gfxUtils::sUnpremultiplyTable[a * 256 + b]; + *dst++ = a; + } + src += srcStride - (dstWriteRect.width * 4); + dst += (aWidth * 4) - (dstWriteRect.width * 4); + } + + if (readback) { + readback->Unmap(); + } + + *aRetval = darray; + return NS_OK; +} + +void +CanvasRenderingContext2D::EnsureErrorTarget() +{ + if (sErrorTarget) { + return; + } + + RefPtr errorTarget = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(IntSize(1, 1), SurfaceFormat::B8G8R8A8); + MOZ_ASSERT(errorTarget, "Failed to allocate the error target!"); + + sErrorTarget = errorTarget; + NS_ADDREF(sErrorTarget); +} + +void +CanvasRenderingContext2D::FillRuleChanged() +{ + if (mPath) { + mPathBuilder = mPath->CopyToBuilder(CurrentState().fillRule); + mPath = nullptr; + } +} + +void +CanvasRenderingContext2D::PutImageData(ImageData& aImageData, double aDx, + double aDy, ErrorResult& aError) +{ + RootedTypedArray arr(RootingCx()); + DebugOnly inited = arr.Init(aImageData.GetDataObject()); + MOZ_ASSERT(inited); + + aError = PutImageData_explicit(JS::ToInt32(aDx), JS::ToInt32(aDy), + aImageData.Width(), aImageData.Height(), + &arr, false, 0, 0, 0, 0); +} + +void +CanvasRenderingContext2D::PutImageData(ImageData& aImageData, double aDx, + double aDy, double aDirtyX, + double aDirtyY, double aDirtyWidth, + double aDirtyHeight, + ErrorResult& aError) +{ + RootedTypedArray arr(RootingCx()); + DebugOnly inited = arr.Init(aImageData.GetDataObject()); + MOZ_ASSERT(inited); + + aError = PutImageData_explicit(JS::ToInt32(aDx), JS::ToInt32(aDy), + aImageData.Width(), aImageData.Height(), + &arr, true, + JS::ToInt32(aDirtyX), + JS::ToInt32(aDirtyY), + JS::ToInt32(aDirtyWidth), + JS::ToInt32(aDirtyHeight)); +} + +nsresult +CanvasRenderingContext2D::PutImageData_explicit(int32_t aX, int32_t aY, uint32_t aW, uint32_t aH, + dom::Uint8ClampedArray* aArray, + bool aHasDirtyRect, int32_t aDirtyX, int32_t aDirtyY, + int32_t aDirtyWidth, int32_t aDirtyHeight) +{ + if (mDrawObserver) { + mDrawObserver->DidDrawCall(CanvasDrawObserver::DrawCallType::PutImageData); + } + + if (aW == 0 || aH == 0) { + return NS_ERROR_DOM_INVALID_STATE_ERR; + } + + IntRect dirtyRect; + IntRect imageDataRect(0, 0, aW, aH); + + if (aHasDirtyRect) { + // fix up negative dimensions + if (aDirtyWidth < 0) { + NS_ENSURE_TRUE(aDirtyWidth != INT_MIN, NS_ERROR_DOM_INDEX_SIZE_ERR); + + CheckedInt32 checkedDirtyX = CheckedInt32(aDirtyX) + aDirtyWidth; + + if (!checkedDirtyX.isValid()) + return NS_ERROR_DOM_INDEX_SIZE_ERR; + + aDirtyX = checkedDirtyX.value(); + aDirtyWidth = -aDirtyWidth; + } + + if (aDirtyHeight < 0) { + NS_ENSURE_TRUE(aDirtyHeight != INT_MIN, NS_ERROR_DOM_INDEX_SIZE_ERR); + + CheckedInt32 checkedDirtyY = CheckedInt32(aDirtyY) + aDirtyHeight; + + if (!checkedDirtyY.isValid()) + return NS_ERROR_DOM_INDEX_SIZE_ERR; + + aDirtyY = checkedDirtyY.value(); + aDirtyHeight = -aDirtyHeight; + } + + // bound the dirty rect within the imageData rectangle + dirtyRect = imageDataRect.Intersect(IntRect(aDirtyX, aDirtyY, aDirtyWidth, aDirtyHeight)); + + if (dirtyRect.Width() <= 0 || dirtyRect.Height() <= 0) + return NS_OK; + } else { + dirtyRect = imageDataRect; + } + + dirtyRect.MoveBy(IntPoint(aX, aY)); + dirtyRect = IntRect(0, 0, mWidth, mHeight).Intersect(dirtyRect); + + if (dirtyRect.Width() <= 0 || dirtyRect.Height() <= 0) { + return NS_OK; + } + + aArray->ComputeLengthAndData(); + + uint32_t dataLen = aArray->Length(); + + uint32_t len = aW * aH * 4; + if (dataLen != len) { + return NS_ERROR_DOM_INVALID_STATE_ERR; + } + + uint32_t copyWidth = dirtyRect.Width(); + uint32_t copyHeight = dirtyRect.Height(); + RefPtr imgsurf = new gfxImageSurface(gfx::IntSize(copyWidth, copyHeight), + SurfaceFormat::A8R8G8B8_UINT32, + false); + if (!imgsurf || imgsurf->CairoStatus()) { + return NS_ERROR_FAILURE; + } + + uint32_t copyX = dirtyRect.x - aX; + uint32_t copyY = dirtyRect.y - aY; + //uint8_t *src = aArray->Data(); + uint8_t *dst = imgsurf->Data(); + uint8_t* srcLine = aArray->Data() + copyY * (aW * 4) + copyX * 4; + // For opaque canvases, we must still premultiply the RGB components, but write the alpha as opaque. + uint8_t alphaMask = mOpaque ? 255 : 0; +#if 0 + printf("PutImageData_explicit: dirty x=%d y=%d w=%d h=%d copy x=%d y=%d w=%d h=%d ext x=%d y=%d w=%d h=%d\n", + dirtyRect.x, dirtyRect.y, copyWidth, copyHeight, + copyX, copyY, copyWidth, copyHeight, + x, y, w, h); +#endif + for (uint32_t j = 0; j < copyHeight; j++) { + uint8_t *src = srcLine; + for (uint32_t i = 0; i < copyWidth; i++) { + uint8_t r = *src++; + uint8_t g = *src++; + uint8_t b = *src++; + uint8_t a = *src++; + + // Convert to premultiplied color (losslessly if the input came from getImageData) +#if MOZ_LITTLE_ENDIAN + *dst++ = gfxUtils::sPremultiplyTable[a * 256 + b]; + *dst++ = gfxUtils::sPremultiplyTable[a * 256 + g]; + *dst++ = gfxUtils::sPremultiplyTable[a * 256 + r]; + *dst++ = a | alphaMask; +#else + *dst++ = a | alphaMask; + *dst++ = gfxUtils::sPremultiplyTable[a * 256 + r]; + *dst++ = gfxUtils::sPremultiplyTable[a * 256 + g]; + *dst++ = gfxUtils::sPremultiplyTable[a * 256 + b]; +#endif + } + srcLine += aW * 4; + } + + // The canvas spec says that the current path, transformation matrix, shadow attributes, + // global alpha, the clipping region, and global composition operator must not affect the + // getImageData() and putImageData() methods. + const gfx::Rect putRect(dirtyRect); + EnsureTarget(&putRect); + + if (!IsTargetValid()) { + return NS_ERROR_FAILURE; + } + + RefPtr sourceSurface = + mTarget->CreateSourceSurfaceFromData(imgsurf->Data(), IntSize(copyWidth, copyHeight), imgsurf->Stride(), SurfaceFormat::B8G8R8A8); + + // In certain scenarios, requesting larger than 8k image fails. Bug 803568 + // covers the details of how to run into it, but the full detailed + // investigation hasn't been done to determine the underlying cause. We + // will just handle the failure to allocate the surface to avoid a crash. + if (!sourceSurface) { + return NS_ERROR_FAILURE; + } + + mTarget->CopySurface(sourceSurface, + IntRect(0, 0, + dirtyRect.width, dirtyRect.height), + IntPoint(dirtyRect.x, dirtyRect.y)); + + Redraw(gfx::Rect(dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height)); + + return NS_OK; +} + +static already_AddRefed +CreateImageData(JSContext* aCx, CanvasRenderingContext2D* aContext, + uint32_t aW, uint32_t aH, ErrorResult& aError) +{ + if (aW == 0) + aW = 1; + if (aH == 0) + aH = 1; + + CheckedInt len = CheckedInt(aW) * aH * 4; + if (!len.isValid()) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + + // Create the fast typed array; it's initialized to 0 by default. + JSObject* darray = Uint8ClampedArray::Create(aCx, aContext, len.value()); + if (!darray) { + aError.Throw(NS_ERROR_OUT_OF_MEMORY); + return nullptr; + } + + RefPtr imageData = + new mozilla::dom::ImageData(aW, aH, *darray); + return imageData.forget(); +} + +already_AddRefed +CanvasRenderingContext2D::CreateImageData(JSContext* aCx, double aSw, + double aSh, ErrorResult& aError) +{ + if (!aSw || !aSh) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + + int32_t wi = JS::ToInt32(aSw); + int32_t hi = JS::ToInt32(aSh); + + uint32_t w = Abs(wi); + uint32_t h = Abs(hi); + return mozilla::dom::CreateImageData(aCx, this, w, h, aError); +} + +already_AddRefed +CanvasRenderingContext2D::CreateImageData(JSContext* aCx, + ImageData& aImagedata, + ErrorResult& aError) +{ + return mozilla::dom::CreateImageData(aCx, this, aImagedata.Width(), + aImagedata.Height(), aError); +} + +static uint8_t g2DContextLayerUserData; + + +uint32_t +CanvasRenderingContext2D::SkiaGLTex() const +{ + if (!mTarget) { + return 0; + } + MOZ_ASSERT(IsTargetValid()); + return (uint32_t)(uintptr_t)mTarget->GetNativeSurface(NativeSurfaceType::OPENGL_TEXTURE); +} + +void CanvasRenderingContext2D::RemoveDrawObserver() +{ + if (mDrawObserver) { + delete mDrawObserver; + mDrawObserver = nullptr; + } +} + +already_AddRefed +CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder, + Layer* aOldLayer, + LayerManager* aManager, + bool aMirror /* = false */) +{ + if (aMirror) { + // Not supported for CanvasRenderingContext2D + return nullptr; + } + + if (mOpaque || mIsSkiaGL) { + // If we're opaque then make sure we have a surface so we paint black + // instead of transparent. + // If we're using SkiaGL, then SkiaGLTex() below needs the target to + // be accessible. + EnsureTarget(); + } + + // Don't call EnsureTarget() ... if there isn't already a surface, then + // we have nothing to paint and there is no need to create a surface just + // to paint nothing. Also, EnsureTarget() can cause creation of a persistent + // layer manager which must NOT happen during a paint. + if ((!mBufferProvider && !mTarget) || !IsTargetValid()) { + // No DidTransactionCallback will be received, so mark the context clean + // now so future invalidations will be dispatched. + MarkContextClean(); + return nullptr; + } + + if (!mResetLayer && aOldLayer) { + auto userData = + static_cast( + aOldLayer->GetUserData(&g2DContextLayerUserData)); + + CanvasLayer::Data data; + + if (mIsSkiaGL) { + GLuint skiaGLTex = SkiaGLTex(); + if (skiaGLTex) { + SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue(); + MOZ_ASSERT(glue); + data.mGLContext = glue->GetGLContext(); + data.mFrontbufferGLTex = skiaGLTex; + } + } + + data.mBufferProvider = mBufferProvider; + + if (userData && + userData->IsForContext(this) && + static_cast(aOldLayer)->IsDataValid(data)) { + RefPtr ret = aOldLayer; + return ret.forget(); + } + } + + RefPtr canvasLayer = aManager->CreateCanvasLayer(); + if (!canvasLayer) { + NS_WARNING("CreateCanvasLayer returned null!"); + // No DidTransactionCallback will be received, so mark the context clean + // now so future invalidations will be dispatched. + MarkContextClean(); + return nullptr; + } + CanvasRenderingContext2DUserData* userData = nullptr; + // Make the layer tell us whenever a transaction finishes (including + // the current transaction), so we can clear our invalidation state and + // start invalidating again. We need to do this for all layers since + // callers of DrawWindow may be expecting to receive normal invalidation + // notifications after this paint. + + // The layer will be destroyed when we tear down the presentation + // (at the latest), at which time this userData will be destroyed, + // releasing the reference to the element. + // The userData will receive DidTransactionCallbacks, which flush the + // the invalidation state to indicate that the canvas is up to date. + userData = new CanvasRenderingContext2DUserData(this); + canvasLayer->SetDidTransactionCallback( + CanvasRenderingContext2DUserData::DidTransactionCallback, userData); + canvasLayer->SetUserData(&g2DContextLayerUserData, userData); + + CanvasLayer::Data data; + data.mSize = GetSize(); + data.mHasAlpha = !mOpaque; + + canvasLayer->SetPreTransactionCallback( + CanvasRenderingContext2DUserData::PreTransactionCallback, userData); + + + if (mIsSkiaGL) { + GLuint skiaGLTex = SkiaGLTex(); + if (skiaGLTex) { + SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue(); + MOZ_ASSERT(glue); + data.mGLContext = glue->GetGLContext(); + data.mFrontbufferGLTex = skiaGLTex; + } + } + + data.mBufferProvider = mBufferProvider; + + canvasLayer->Initialize(data); + uint32_t flags = mOpaque ? Layer::CONTENT_OPAQUE : 0; + canvasLayer->SetContentFlags(flags); + canvasLayer->Updated(); + + mResetLayer = false; + + return canvasLayer.forget(); +} + +void +CanvasRenderingContext2D::MarkContextClean() +{ + if (mInvalidateCount > 0) { + mPredictManyRedrawCalls = mInvalidateCount > kCanvasMaxInvalidateCount; + } + mIsEntireFrameInvalid = false; + mInvalidateCount = 0; +} + +void +CanvasRenderingContext2D::MarkContextCleanForFrameCapture() +{ + mIsCapturedFrameInvalid = false; +} + +bool +CanvasRenderingContext2D::IsContextCleanForFrameCapture() +{ + return !mIsCapturedFrameInvalid; +} + +bool +CanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager* aManager) +{ + return !aManager->CanUseCanvasLayerForSize(GetSize()); +} + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasPath, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasPath, Release) + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasPath, mParent) + +CanvasPath::CanvasPath(nsISupports* aParent) + : mParent(aParent) +{ + mPathBuilder = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()->CreatePathBuilder(); +} + +CanvasPath::CanvasPath(nsISupports* aParent, already_AddRefed aPathBuilder) + : mParent(aParent), mPathBuilder(aPathBuilder) +{ + if (!mPathBuilder) { + mPathBuilder = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()->CreatePathBuilder(); + } +} + +JSObject* +CanvasPath::WrapObject(JSContext* aCx, JS::Handle aGivenProto) +{ + return Path2DBinding::Wrap(aCx, this, aGivenProto); +} + +already_AddRefed +CanvasPath::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) +{ + RefPtr path = new CanvasPath(aGlobal.GetAsSupports()); + return path.forget(); +} + +already_AddRefed +CanvasPath::Constructor(const GlobalObject& aGlobal, CanvasPath& aCanvasPath, ErrorResult& aRv) +{ + RefPtr tempPath = aCanvasPath.GetPath(CanvasWindingRule::Nonzero, + gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()); + + RefPtr path = new CanvasPath(aGlobal.GetAsSupports(), tempPath->CopyToBuilder()); + return path.forget(); +} + +already_AddRefed +CanvasPath::Constructor(const GlobalObject& aGlobal, const nsAString& aPathString, ErrorResult& aRv) +{ + RefPtr tempPath = SVGContentUtils::GetPath(aPathString); + if (!tempPath) { + return Constructor(aGlobal, aRv); + } + + RefPtr path = new CanvasPath(aGlobal.GetAsSupports(), tempPath->CopyToBuilder()); + return path.forget(); +} + +void +CanvasPath::ClosePath() +{ + EnsurePathBuilder(); + + mPathBuilder->Close(); +} + +void +CanvasPath::MoveTo(double aX, double aY) +{ + EnsurePathBuilder(); + + mPathBuilder->MoveTo(Point(ToFloat(aX), ToFloat(aY))); +} + +void +CanvasPath::LineTo(double aX, double aY) +{ + EnsurePathBuilder(); + + mPathBuilder->LineTo(Point(ToFloat(aX), ToFloat(aY))); +} + +void +CanvasPath::QuadraticCurveTo(double aCpx, double aCpy, double aX, double aY) +{ + EnsurePathBuilder(); + + mPathBuilder->QuadraticBezierTo(gfx::Point(ToFloat(aCpx), ToFloat(aCpy)), + gfx::Point(ToFloat(aX), ToFloat(aY))); +} + +void +CanvasPath::BezierCurveTo(double aCp1x, double aCp1y, + double aCp2x, double aCp2y, + double aX, double aY) +{ + BezierTo(gfx::Point(ToFloat(aCp1x), ToFloat(aCp1y)), + gfx::Point(ToFloat(aCp2x), ToFloat(aCp2y)), + gfx::Point(ToFloat(aX), ToFloat(aY))); +} + +void +CanvasPath::ArcTo(double aX1, double aY1, double aX2, double aY2, double aRadius, + ErrorResult& aError) +{ + if (aRadius < 0) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + EnsurePathBuilder(); + + // Current point in user space! + Point p0 = mPathBuilder->CurrentPoint(); + Point p1(aX1, aY1); + Point p2(aX2, aY2); + + // Execute these calculations in double precision to avoid cumulative + // rounding errors. + double dir, a2, b2, c2, cosx, sinx, d, anx, any, + bnx, bny, x3, y3, x4, y4, cx, cy, angle0, angle1; + bool anticlockwise; + + if (p0 == p1 || p1 == p2 || aRadius == 0) { + LineTo(p1.x, p1.y); + return; + } + + // Check for colinearity + dir = (p2.x - p1.x) * (p0.y - p1.y) + (p2.y - p1.y) * (p1.x - p0.x); + if (dir == 0) { + LineTo(p1.x, p1.y); + return; + } + + + // XXX - Math for this code was already available from the non-azure code + // and would be well tested. Perhaps converting to bezier directly might + // be more efficient longer run. + a2 = (p0.x-aX1)*(p0.x-aX1) + (p0.y-aY1)*(p0.y-aY1); + b2 = (aX1-aX2)*(aX1-aX2) + (aY1-aY2)*(aY1-aY2); + c2 = (p0.x-aX2)*(p0.x-aX2) + (p0.y-aY2)*(p0.y-aY2); + cosx = (a2+b2-c2)/(2*sqrt(a2*b2)); + + sinx = sqrt(1 - cosx*cosx); + d = aRadius / ((1 - cosx) / sinx); + + anx = (aX1-p0.x) / sqrt(a2); + any = (aY1-p0.y) / sqrt(a2); + bnx = (aX1-aX2) / sqrt(b2); + bny = (aY1-aY2) / sqrt(b2); + x3 = aX1 - anx*d; + y3 = aY1 - any*d; + x4 = aX1 - bnx*d; + y4 = aY1 - bny*d; + anticlockwise = (dir < 0); + cx = x3 + any*aRadius*(anticlockwise ? 1 : -1); + cy = y3 - anx*aRadius*(anticlockwise ? 1 : -1); + angle0 = atan2((y3-cy), (x3-cx)); + angle1 = atan2((y4-cy), (x4-cx)); + + + LineTo(x3, y3); + + Arc(cx, cy, aRadius, angle0, angle1, anticlockwise, aError); +} + +void +CanvasPath::Rect(double aX, double aY, double aW, double aH) +{ + MoveTo(aX, aY); + LineTo(aX + aW, aY); + LineTo(aX + aW, aY + aH); + LineTo(aX, aY + aH); + ClosePath(); +} + +void +CanvasPath::Arc(double aX, double aY, double aRadius, + double aStartAngle, double aEndAngle, bool aAnticlockwise, + ErrorResult& aError) +{ + if (aRadius < 0.0) { + aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + EnsurePathBuilder(); + + ArcToBezier(this, Point(aX, aY), Size(aRadius, aRadius), aStartAngle, aEndAngle, aAnticlockwise); +} + +void +CanvasPath::Ellipse(double x, double y, double radiusX, double radiusY, + double rotation, double startAngle, double endAngle, + bool anticlockwise, ErrorResult& error) +{ + if (radiusX < 0.0 || radiusY < 0.0) { + error.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return; + } + + EnsurePathBuilder(); + + ArcToBezier(this, Point(x, y), Size(radiusX, radiusY), startAngle, endAngle, + anticlockwise, rotation); +} + +void +CanvasPath::LineTo(const gfx::Point& aPoint) +{ + EnsurePathBuilder(); + + mPathBuilder->LineTo(aPoint); +} + +void +CanvasPath::BezierTo(const gfx::Point& aCP1, + const gfx::Point& aCP2, + const gfx::Point& aCP3) +{ + EnsurePathBuilder(); + + mPathBuilder->BezierTo(aCP1, aCP2, aCP3); +} + +void +CanvasPath::AddPath(CanvasPath& aCanvasPath, const Optional>& aMatrix) +{ + RefPtr tempPath = aCanvasPath.GetPath(CanvasWindingRule::Nonzero, + gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()); + + if (aMatrix.WasPassed()) { + const SVGMatrix& m = aMatrix.Value(); + Matrix transform(m.A(), m.B(), m.C(), m.D(), m.E(), m.F()); + + if (!transform.IsIdentity()) { + RefPtr tempBuilder = tempPath->TransformedCopyToBuilder(transform, FillRule::FILL_WINDING); + tempPath = tempBuilder->Finish(); + } + } + + EnsurePathBuilder(); // in case a path is added to itself + tempPath->StreamToSink(mPathBuilder); +} + +already_AddRefed +CanvasPath::GetPath(const CanvasWindingRule& aWinding, const DrawTarget* aTarget) const +{ + FillRule fillRule = FillRule::FILL_WINDING; + if (aWinding == CanvasWindingRule::Evenodd) { + fillRule = FillRule::FILL_EVEN_ODD; + } + + if (mPath && + (mPath->GetBackendType() == aTarget->GetBackendType()) && + (mPath->GetFillRule() == fillRule)) { + RefPtr path(mPath); + return path.forget(); + } + + if (!mPath) { + // if there is no path, there must be a pathbuilder + MOZ_ASSERT(mPathBuilder); + mPath = mPathBuilder->Finish(); + if (!mPath) { + RefPtr path(mPath); + return path.forget(); + } + + mPathBuilder = nullptr; + } + + // retarget our backend if we're used with a different backend + if (mPath->GetBackendType() != aTarget->GetBackendType()) { + RefPtr tmpPathBuilder = aTarget->CreatePathBuilder(fillRule); + mPath->StreamToSink(tmpPathBuilder); + mPath = tmpPathBuilder->Finish(); + } else if (mPath->GetFillRule() != fillRule) { + RefPtr tmpPathBuilder = mPath->CopyToBuilder(fillRule); + mPath = tmpPathBuilder->Finish(); + } + + RefPtr path(mPath); + return path.forget(); +} + +void +CanvasPath::EnsurePathBuilder() const +{ + if (mPathBuilder) { + return; + } + + // if there is not pathbuilder, there must be a path + MOZ_ASSERT(mPath); + mPathBuilder = mPath->CopyToBuilder(); + mPath = nullptr; +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h new file mode 100644 index 000000000..c3ee3bdcb --- /dev/null +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -0,0 +1,1156 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef CanvasRenderingContext2D_h +#define CanvasRenderingContext2D_h + +#include "mozilla/Attributes.h" +#include +#include "nsIDOMCanvasRenderingContext2D.h" +#include "nsICanvasRenderingContextInternal.h" +#include "mozilla/RefPtr.h" +#include "nsColor.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "mozilla/dom/HTMLVideoElement.h" +#include "gfxTextRun.h" +#include "mozilla/ErrorResult.h" +#include "mozilla/dom/CanvasGradient.h" +#include "mozilla/dom/CanvasRenderingContext2DBinding.h" +#include "mozilla/dom/CanvasPattern.h" +#include "mozilla/gfx/Rect.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/UniquePtr.h" +#include "gfx2DGlue.h" +#include "imgIEncoder.h" +#include "nsLayoutUtils.h" +#include "mozilla/EnumeratedArray.h" +#include "FilterSupport.h" +#include "nsSVGEffects.h" +#include "Layers.h" + +class nsGlobalWindow; +class nsXULElement; + +namespace mozilla { +namespace gl { +class SourceSurface; +} // namespace gl + +namespace dom { +class HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElementOrImageBitmap; +typedef HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElementOrImageBitmap CanvasImageSource; +class ImageData; +class StringOrCanvasGradientOrCanvasPattern; +class OwningStringOrCanvasGradientOrCanvasPattern; +class TextMetrics; +class CanvasFilterChainObserver; +class CanvasPath; + +extern const mozilla::gfx::Float SIGMA_MAX; + +template class Optional; + +struct CanvasBidiProcessor; +class CanvasRenderingContext2DUserData; +class CanvasDrawObserver; +class CanvasShutdownObserver; + +/** + ** CanvasRenderingContext2D + **/ +class CanvasRenderingContext2D final : + public nsICanvasRenderingContextInternal, + public nsWrapperCache +{ + virtual ~CanvasRenderingContext2D(); + +public: + explicit CanvasRenderingContext2D(layers::LayersBackend aCompositorBackend); + + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) override; + + HTMLCanvasElement* GetCanvas() const + { + if (!mCanvasElement || mCanvasElement->IsInNativeAnonymousSubtree()) { + return nullptr; + } + + // corresponds to changes to the old bindings made in bug 745025 + return mCanvasElement->GetOriginalCanvas(); + } + + void Save(); + void Restore(); + void Scale(double aX, double aY, mozilla::ErrorResult& aError); + void Rotate(double aAngle, mozilla::ErrorResult& aError); + void Translate(double aX, double aY, mozilla::ErrorResult& aError); + void Transform(double aM11, double aM12, double aM21, double aM22, double aDx, + double aDy, mozilla::ErrorResult& aError); + void SetTransform(double aM11, double aM12, double aM21, double aM22, double aDx, + double aDy, mozilla::ErrorResult& aError); + void ResetTransform(mozilla::ErrorResult& aError); + + double GlobalAlpha() + { + return CurrentState().globalAlpha; + } + + // Useful for silencing cast warnings + static mozilla::gfx::Float ToFloat(double aValue) { return mozilla::gfx::Float(aValue); } + + void SetGlobalAlpha(double aGlobalAlpha) + { + if (aGlobalAlpha >= 0.0 && aGlobalAlpha <= 1.0) { + CurrentState().globalAlpha = ToFloat(aGlobalAlpha); + } + } + + void GetGlobalCompositeOperation(nsAString& aOp, mozilla::ErrorResult& aError); + void SetGlobalCompositeOperation(const nsAString& aOp, + mozilla::ErrorResult& aError); + + void GetStrokeStyle(OwningStringOrCanvasGradientOrCanvasPattern& aValue) + { + GetStyleAsUnion(aValue, Style::STROKE); + } + + void SetStrokeStyle(const StringOrCanvasGradientOrCanvasPattern& aValue) + { + SetStyleFromUnion(aValue, Style::STROKE); + } + + void GetFillStyle(OwningStringOrCanvasGradientOrCanvasPattern& aValue) + { + GetStyleAsUnion(aValue, Style::FILL); + } + + void SetFillStyle(const StringOrCanvasGradientOrCanvasPattern& aValue) + { + SetStyleFromUnion(aValue, Style::FILL); + } + + already_AddRefed + CreateLinearGradient(double aX0, double aY0, double aX1, double aY1); + already_AddRefed + CreateRadialGradient(double aX0, double aY0, double aR0, double aX1, double aY1, + double aR1, ErrorResult& aError); + already_AddRefed + CreatePattern(const CanvasImageSource& aElement, + const nsAString& aRepeat, ErrorResult& aError); + + double ShadowOffsetX() + { + return CurrentState().shadowOffset.x; + } + + void SetShadowOffsetX(double aShadowOffsetX) + { + CurrentState().shadowOffset.x = ToFloat(aShadowOffsetX); + } + + double ShadowOffsetY() + { + return CurrentState().shadowOffset.y; + } + + void SetShadowOffsetY(double aShadowOffsetY) + { + CurrentState().shadowOffset.y = ToFloat(aShadowOffsetY); + } + + double ShadowBlur() + { + return CurrentState().shadowBlur; + } + + void SetShadowBlur(double aShadowBlur) + { + if (aShadowBlur >= 0.0) { + CurrentState().shadowBlur = ToFloat(aShadowBlur); + } + } + + void GetShadowColor(nsAString& aShadowColor) + { + StyleColorToString(CurrentState().shadowColor, aShadowColor); + } + + void GetFilter(nsAString& aFilter) + { + aFilter = CurrentState().filterString; + } + + void SetShadowColor(const nsAString& aShadowColor); + void SetFilter(const nsAString& aFilter, mozilla::ErrorResult& aError); + void ClearRect(double aX, double aY, double aW, double aH); + void FillRect(double aX, double aY, double aW, double aH); + void StrokeRect(double aX, double aY, double aW, double aH); + void BeginPath(); + void Fill(const CanvasWindingRule& aWinding); + void Fill(const CanvasPath& aPath, const CanvasWindingRule& aWinding); + void Stroke(); + void Stroke(const CanvasPath& aPath); + void DrawFocusIfNeeded(mozilla::dom::Element& aElement, ErrorResult& aRv); + bool DrawCustomFocusRing(mozilla::dom::Element& aElement); + void Clip(const CanvasWindingRule& aWinding); + void Clip(const CanvasPath& aPath, const CanvasWindingRule& aWinding); + bool IsPointInPath(double aX, double aY, const CanvasWindingRule& aWinding); + bool IsPointInPath(const CanvasPath& aPath, double aX, double aY, const CanvasWindingRule& aWinding); + bool IsPointInStroke(double aX, double aY); + bool IsPointInStroke(const CanvasPath& aPath, double aX, double aY); + void FillText(const nsAString& aText, double aX, double aY, + const Optional& aMaxWidth, + mozilla::ErrorResult& aError); + void StrokeText(const nsAString& aText, double aX, double aY, + const Optional& aMaxWidth, + mozilla::ErrorResult& aError); + TextMetrics* + MeasureText(const nsAString& aRawText, mozilla::ErrorResult& aError); + + void AddHitRegion(const HitRegionOptions& aOptions, mozilla::ErrorResult& aError); + void RemoveHitRegion(const nsAString& aId); + void ClearHitRegions(); + + void DrawImage(const CanvasImageSource& aImage, + double aDx, double aDy, mozilla::ErrorResult& aError) + { + DrawImage(aImage, 0.0, 0.0, 0.0, 0.0, aDx, aDy, 0.0, 0.0, 0, aError); + } + + void DrawImage(const CanvasImageSource& aImage, + double aDx, double aDy, double aDw, double aDh, + mozilla::ErrorResult& aError) + { + DrawImage(aImage, 0.0, 0.0, 0.0, 0.0, aDx, aDy, aDw, aDh, 2, aError); + } + + void DrawImage(const CanvasImageSource& aImage, + double aSx, double aSy, double aSw, double aSh, double aDx, + double aDy, double aDw, double aDh, mozilla::ErrorResult& aError) + { + DrawImage(aImage, aSx, aSy, aSw, aSh, aDx, aDy, aDw, aDh, 6, aError); + } + + already_AddRefed + CreateImageData(JSContext* aCx, double aSw, double aSh, + mozilla::ErrorResult& aError); + already_AddRefed + CreateImageData(JSContext* aCx, ImageData& aImagedata, + mozilla::ErrorResult& aError); + already_AddRefed + GetImageData(JSContext* aCx, double aSx, double aSy, double aSw, double aSh, + mozilla::ErrorResult& aError); + void PutImageData(ImageData& aImageData, + double aDx, double aDy, mozilla::ErrorResult& aError); + void PutImageData(ImageData& aImageData, + double aDx, double aDy, double aDirtyX, double aDirtyY, + double aDirtyWidth, double aDirtyHeight, + mozilla::ErrorResult& aError); + + double LineWidth() + { + return CurrentState().lineWidth; + } + + void SetLineWidth(double aWidth) + { + if (aWidth > 0.0) { + CurrentState().lineWidth = ToFloat(aWidth); + } + } + void GetLineCap(nsAString& aLinecapStyle); + void SetLineCap(const nsAString& aLinecapStyle); + void GetLineJoin(nsAString& aLinejoinStyle, mozilla::ErrorResult& aError); + void SetLineJoin(const nsAString& aLinejoinStyle); + + double MiterLimit() + { + return CurrentState().miterLimit; + } + + void SetMiterLimit(double aMiter) + { + if (aMiter > 0.0) { + CurrentState().miterLimit = ToFloat(aMiter); + } + } + + void GetFont(nsAString& aFont) + { + aFont = GetFont(); + } + + void SetFont(const nsAString& aFont, mozilla::ErrorResult& aError); + void GetTextAlign(nsAString& aTextAlign); + void SetTextAlign(const nsAString& aTextAlign); + void GetTextBaseline(nsAString& aTextBaseline); + void SetTextBaseline(const nsAString& aTextBaseline); + + void ClosePath() + { + EnsureWritablePath(); + + if (mPathBuilder) { + mPathBuilder->Close(); + } else { + mDSPathBuilder->Close(); + } + } + + void MoveTo(double aX, double aY) + { + EnsureWritablePath(); + + if (mPathBuilder) { + mPathBuilder->MoveTo(mozilla::gfx::Point(ToFloat(aX), ToFloat(aY))); + } else { + mDSPathBuilder->MoveTo(mTarget->GetTransform().TransformPoint( + mozilla::gfx::Point(ToFloat(aX), ToFloat(aY)))); + } + } + + void LineTo(double aX, double aY) + { + EnsureWritablePath(); + + LineTo(mozilla::gfx::Point(ToFloat(aX), ToFloat(aY))); + } + + void QuadraticCurveTo(double aCpx, double aCpy, double aX, double aY) + { + EnsureWritablePath(); + + if (mPathBuilder) { + mPathBuilder->QuadraticBezierTo(mozilla::gfx::Point(ToFloat(aCpx), ToFloat(aCpy)), + mozilla::gfx::Point(ToFloat(aX), ToFloat(aY))); + } else { + mozilla::gfx::Matrix transform = mTarget->GetTransform(); + mDSPathBuilder->QuadraticBezierTo(transform.TransformPoint( + mozilla::gfx::Point(ToFloat(aCpx), ToFloat(aCpy))), + transform.TransformPoint( + mozilla::gfx::Point(ToFloat(aX), ToFloat(aY)))); + } + } + + void BezierCurveTo(double aCp1x, double aCp1y, double aCp2x, double aCp2y, double aX, double aY) + { + EnsureWritablePath(); + + BezierTo(mozilla::gfx::Point(ToFloat(aCp1x), ToFloat(aCp1y)), + mozilla::gfx::Point(ToFloat(aCp2x), ToFloat(aCp2y)), + mozilla::gfx::Point(ToFloat(aX), ToFloat(aY))); + } + + void ArcTo(double aX1, double aY1, double aX2, double aY2, double aRadius, + mozilla::ErrorResult& aError); + void Rect(double aX, double aY, double aW, double aH); + void Arc(double aX, double aY, double aRadius, double aStartAngle, + double aEndAngle, bool aAnticlockwise, mozilla::ErrorResult& aError); + void Ellipse(double aX, double aY, double aRadiusX, double aRadiusY, + double aRotation, double aStartAngle, double aEndAngle, + bool aAnticlockwise, ErrorResult& aError); + + void GetMozCurrentTransform(JSContext* aCx, + JS::MutableHandle aResult, + mozilla::ErrorResult& aError); + void SetMozCurrentTransform(JSContext* aCx, + JS::Handle aCurrentTransform, + mozilla::ErrorResult& aError); + void GetMozCurrentTransformInverse(JSContext* aCx, + JS::MutableHandle aResult, + mozilla::ErrorResult& aError); + void SetMozCurrentTransformInverse(JSContext* aCx, + JS::Handle aCurrentTransform, + mozilla::ErrorResult& aError); + void GetFillRule(nsAString& aFillRule); + void SetFillRule(const nsAString& aFillRule); + + void SetLineDash(const Sequence& aSegments, + mozilla::ErrorResult& aRv); + void GetLineDash(nsTArray& aSegments) const; + + void SetLineDashOffset(double aOffset); + double LineDashOffset() const; + + void GetMozTextStyle(nsAString& aMozTextStyle) + { + GetFont(aMozTextStyle); + } + + void SetMozTextStyle(const nsAString& aMozTextStyle, + mozilla::ErrorResult& aError) + { + SetFont(aMozTextStyle, aError); + } + + bool ImageSmoothingEnabled() + { + return CurrentState().imageSmoothingEnabled; + } + + void SetImageSmoothingEnabled(bool aImageSmoothingEnabled) + { + if (aImageSmoothingEnabled != CurrentState().imageSmoothingEnabled) { + CurrentState().imageSmoothingEnabled = aImageSmoothingEnabled; + } + } + + void DrawWindow(nsGlobalWindow& aWindow, double aX, double aY, + double aW, double aH, + const nsAString& aBgColor, uint32_t aFlags, + mozilla::ErrorResult& aError); + void AsyncDrawXULElement(nsXULElement& aElem, double aX, double aY, double aW, + double aH, const nsAString& aBgColor, uint32_t aFlags, + mozilla::ErrorResult& aError); + + enum RenderingMode { + SoftwareBackendMode, + OpenGLBackendMode, + DefaultBackendMode + }; + + bool SwitchRenderingMode(RenderingMode aRenderingMode); + + // Eventually this should be deprecated. Keeping for now to keep the binding functional. + void Demote(); + + nsresult Redraw(); + + virtual int32_t GetWidth() const override; + virtual int32_t GetHeight() const override; + gfx::IntSize GetSize() const { return gfx::IntSize(mWidth, mHeight); } + + // nsICanvasRenderingContextInternal + /** + * Gets the pres shell from either the canvas element or the doc shell + */ + virtual nsIPresShell *GetPresShell() override { + if (mCanvasElement) { + return mCanvasElement->OwnerDoc()->GetShell(); + } + if (mDocShell) { + return mDocShell->GetPresShell(); + } + return nullptr; + } + NS_IMETHOD SetDimensions(int32_t aWidth, int32_t aHeight) override; + NS_IMETHOD InitializeWithDrawTarget(nsIDocShell* aShell, + NotNull aTarget) override; + + NS_IMETHOD GetInputStream(const char* aMimeType, + const char16_t* aEncoderOptions, + nsIInputStream** aStream) override; + + already_AddRefed GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override + { + EnsureTarget(); + if (aPremultAlpha) { + *aPremultAlpha = true; + } + return mTarget->Snapshot(); + } + + NS_IMETHOD SetIsOpaque(bool aIsOpaque) override; + bool GetIsOpaque() override { return mOpaque; } + NS_IMETHOD Reset() override; + already_AddRefed GetCanvasLayer(nsDisplayListBuilder* aBuilder, + Layer* aOldLayer, + LayerManager* aManager, + bool aMirror = false) override; + virtual bool ShouldForceInactiveLayer(LayerManager* aManager) override; + void MarkContextClean() override; + void MarkContextCleanForFrameCapture() override; + bool IsContextCleanForFrameCapture() override; + NS_IMETHOD SetIsIPC(bool aIsIPC) override; + // this rect is in canvas device space + void Redraw(const mozilla::gfx::Rect& aR); + NS_IMETHOD Redraw(const gfxRect& aR) override { Redraw(ToRect(aR)); return NS_OK; } + NS_IMETHOD SetContextOptions(JSContext* aCx, + JS::Handle aOptions, + ErrorResult& aRvForDictionaryInit) override; + + /** + * An abstract base class to be implemented by callers wanting to be notified + * that a refresh has occurred. Callers must ensure an observer is removed + * before it is destroyed. + */ + virtual void DidRefresh() override; + + // this rect is in mTarget's current user space + void RedrawUser(const gfxRect& aR); + + // nsISupports interface + CC + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + + NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(CanvasRenderingContext2D) + + enum class CanvasMultiGetterType : uint8_t { + STRING = 0, + PATTERN = 1, + GRADIENT = 2 + }; + + enum class Style : uint8_t { + STROKE = 0, + FILL, + MAX + }; + + nsINode* GetParentObject() + { + return mCanvasElement; + } + + void LineTo(const mozilla::gfx::Point& aPoint) + { + if (mPathBuilder) { + mPathBuilder->LineTo(aPoint); + } else { + mDSPathBuilder->LineTo(mTarget->GetTransform().TransformPoint(aPoint)); + } + } + + void BezierTo(const mozilla::gfx::Point& aCP1, + const mozilla::gfx::Point& aCP2, + const mozilla::gfx::Point& aCP3) + { + if (mPathBuilder) { + mPathBuilder->BezierTo(aCP1, aCP2, aCP3); + } else { + mozilla::gfx::Matrix transform = mTarget->GetTransform(); + mDSPathBuilder->BezierTo(transform.TransformPoint(aCP1), + transform.TransformPoint(aCP2), + transform.TransformPoint(aCP3)); + } + } + + friend class CanvasRenderingContext2DUserData; + + virtual UniquePtr GetImageBuffer(int32_t* aFormat) override; + + + // Given a point, return hit region ID if it exists + nsString GetHitRegion(const mozilla::gfx::Point& aPoint) override; + + + // return true and fills in the bound rect if element has a hit region. + bool GetHitRegionRect(Element* aElement, nsRect& aRect) override; + + void OnShutdown(); + + // Check the global setup, as well as the compositor type: + bool AllowOpenGLCanvas() const; + +protected: + nsresult GetImageDataArray(JSContext* aCx, int32_t aX, int32_t aY, + uint32_t aWidth, uint32_t aHeight, + JSObject** aRetval); + + nsresult PutImageData_explicit(int32_t aX, int32_t aY, uint32_t aW, uint32_t aH, + dom::Uint8ClampedArray* aArray, + bool aHasDirtyRect, int32_t aDirtyX, int32_t aDirtyY, + int32_t aDirtyWidth, int32_t aDirtyHeight); + + /** + * Internal method to complete initialisation, expects mTarget to have been set + */ + nsresult Initialize(int32_t aWidth, int32_t aHeight); + + nsresult InitializeWithTarget(mozilla::gfx::DrawTarget* aSurface, + int32_t aWidth, int32_t aHeight); + + /** + * The number of living nsCanvasRenderingContexts. When this goes down to + * 0, we free the premultiply and unpremultiply tables, if they exist. + */ + static uintptr_t sNumLivingContexts; + + static mozilla::gfx::DrawTarget* sErrorTarget; + + void SetTransformInternal(const mozilla::gfx::Matrix& aTransform); + + // Some helpers. Doesn't modify a color on failure. + void SetStyleFromUnion(const StringOrCanvasGradientOrCanvasPattern& aValue, + Style aWhichStyle); + void SetStyleFromString(const nsAString& aStr, Style aWhichStyle); + + void SetStyleFromGradient(CanvasGradient& aGradient, Style aWhichStyle) + { + CurrentState().SetGradientStyle(aWhichStyle, &aGradient); + } + + void SetStyleFromPattern(CanvasPattern& aPattern, Style aWhichStyle) + { + CurrentState().SetPatternStyle(aWhichStyle, &aPattern); + } + + void GetStyleAsUnion(OwningStringOrCanvasGradientOrCanvasPattern& aValue, + Style aWhichStyle); + + // Returns whether a color was successfully parsed. + bool ParseColor(const nsAString& aString, nscolor* aColor); + + static void StyleColorToString(const nscolor& aColor, nsAString& aStr); + + // Returns whether a filter was successfully parsed. + bool ParseFilter(const nsAString& aString, + nsTArray& aFilterChain, + ErrorResult& aError); + + // Returns whether the font was successfully updated. + bool SetFontInternal(const nsAString& aFont, mozilla::ErrorResult& aError); + + + /** + * Creates the error target, if it doesn't exist + */ + static void EnsureErrorTarget(); + + /* This function ensures there is a writable pathbuilder available, this + * pathbuilder may be working in user space or in device space or + * device space. + * After calling this function mPathTransformWillUpdate will be false + */ + void EnsureWritablePath(); + + // Ensures a path in UserSpace is available. + void EnsureUserSpacePath(const CanvasWindingRule& aWinding = CanvasWindingRule::Nonzero); + + /** + * Needs to be called before updating the transform. This makes a call to + * EnsureTarget() so you don't have to. + */ + void TransformWillUpdate(); + + // Report the fillRule has changed. + void FillRuleChanged(); + + /** + * Create the backing surfacing, if it doesn't exist. If there is an error + * in creating the target then it will put sErrorTarget in place. If there + * is in turn an error in creating the sErrorTarget then they would both + * be null so IsTargetValid() would still return null. + * + * Returns the actual rendering mode being used by the created target. + */ + RenderingMode EnsureTarget(const gfx::Rect* aCoveredRect = nullptr, + RenderingMode aRenderMode = RenderingMode::DefaultBackendMode); + + void RestoreClipsAndTransformToTarget(); + + bool TrySkiaGLTarget(RefPtr& aOutDT, + RefPtr& aOutProvider); + + bool TrySharedTarget(RefPtr& aOutDT, + RefPtr& aOutProvider); + + bool TryBasicTarget(RefPtr& aOutDT, + RefPtr& aOutProvider); + + void RegisterAllocation(); + + void SetInitialState(); + + void SetErrorState(); + + /** + * This method is run at the end of the event-loop spin where + * ScheduleStableStateCallback was called. + * + * We use it to unlock resources that need to be locked while drawing. + */ + void OnStableState(); + + /** + * Cf. OnStableState. + */ + void ScheduleStableStateCallback(); + + /** + * Disposes an old target and prepares to lazily create a new target. + */ + void ClearTarget(); + + /* + * Returns the target to the buffer provider. i.e. this will queue a frame for + * rendering. + */ + void ReturnTarget(bool aForceReset = false); + + /** + * Check if the target is valid after calling EnsureTarget. + */ + bool IsTargetValid() const { + return (sErrorTarget == nullptr || mTarget != sErrorTarget) && (mBufferProvider != nullptr || mTarget); + } + + /** + * Returns the surface format this canvas should be allocated using. Takes + * into account mOpaque, platform requirements, etc. + */ + mozilla::gfx::SurfaceFormat GetSurfaceFormat() const; + + /** + * Returns true if we know for sure that the pattern for a given style is opaque. + * Usefull to know if we can discard the content below in certain situations. + */ + bool PatternIsOpaque(Style aStyle) const; + + /** + * Update CurrentState().filter with the filter description for + * CurrentState().filterChain. + * Flushes the PresShell, so the world can change if you call this function. + */ + void UpdateFilter(); + + nsLayoutUtils::SurfaceFromElementResult + CachedSurfaceFromElement(Element* aElement); + + void DrawImage(const CanvasImageSource& aImgElt, + double aSx, double aSy, double aSw, double aSh, + double aDx, double aDy, double aDw, double aDh, + uint8_t aOptional_argc, mozilla::ErrorResult& aError); + + void DrawDirectlyToCanvas(const nsLayoutUtils::DirectDrawInfo& aImage, + mozilla::gfx::Rect* aBounds, + mozilla::gfx::Rect aDest, + mozilla::gfx::Rect aSrc, + gfx::IntSize aImgSize); + + nsString& GetFont() + { + /* will initilize the value if not set, else does nothing */ + GetCurrentFontStyle(); + + return CurrentState().font; + } + + // This function maintains a list of raw pointers to cycle-collected + // objects. We need to ensure that no entries persist beyond unlink, + // since the objects are logically destructed at that point. + static std::vector& DemotableContexts(); + static void DemoteOldestContextIfNecessary(); + + static void AddDemotableContext(CanvasRenderingContext2D* aContext); + static void RemoveDemotableContext(CanvasRenderingContext2D* aContext); + + RenderingMode mRenderingMode; + + layers::LayersBackend mCompositorBackend; + + // Member vars + int32_t mWidth, mHeight; + + // This is true when the canvas is valid, but of zero size, this requires + // specific behavior on some operations. + bool mZero; + + bool mOpaque; + + // This is true when the next time our layer is retrieved we need to + // recreate it (i.e. our backing surface changed) + bool mResetLayer; + // This is needed for drawing in drawAsyncXULElement + bool mIPC; + // True if the current DrawTarget is using skia-gl, used so we can avoid + // requesting the DT from mBufferProvider to check. + bool mIsSkiaGL; + + bool mHasPendingStableStateCallback; + + nsTArray mUserDatas; + + // If mCanvasElement is not provided, then a docshell is + nsCOMPtr mDocShell; + + // This is created lazily so it is necessary to call EnsureTarget before + // accessing it. In the event of an error it will be equal to + // sErrorTarget. + RefPtr mTarget; + + RefPtr mBufferProvider; + + uint32_t SkiaGLTex() const; + + // This observes our draw calls at the beginning of the canvas + // lifetime and switches to software or GPU mode depending on + // what it thinks is best + CanvasDrawObserver* mDrawObserver; + void RemoveDrawObserver(); + + RefPtr mShutdownObserver; + void RemoveShutdownObserver(); + bool AlreadyShutDown() const { return !mShutdownObserver; } + + /** + * Flag to avoid duplicate calls to InvalidateFrame. Set to true whenever + * Redraw is called, reset to false when Render is called. + */ + bool mIsEntireFrameInvalid; + /** + * When this is set, the first call to Redraw(gfxRect) should set + * mIsEntireFrameInvalid since we expect it will be followed by + * many more Redraw calls. + */ + bool mPredictManyRedrawCalls; + + /** + * Flag to avoid unnecessary surface copies to FrameCaptureListeners in the + * case when the canvas is not currently being drawn into and not rendered + * but canvas capturing is still ongoing. + */ + bool mIsCapturedFrameInvalid; + + /** + * We also have a device space pathbuilder. The reason for this is as + * follows, when a path is being built, but the transform changes, we + * can no longer keep a single path in userspace, considering there's + * several 'user spaces' now. We therefore transform the current path + * into device space, and add all operations to this path in device + * space. + * + * When then finally executing a render, the Azure drawing API expects + * the path to be in userspace. We could then set an identity transform + * on the DrawTarget and do all drawing in device space. This is + * undesirable because it requires transforming patterns, gradients, + * clips, etc. into device space and it would not work for stroking. + * What we do instead is convert the path back to user space when it is + * drawn, and draw it with the current transform. This makes all drawing + * occur correctly. + * + * There's never both a device space path builder and a user space path + * builder present at the same time. There is also never a path and a + * path builder present at the same time. When writing proceeds on an + * existing path the Path is cleared and a new builder is created. + * + * mPath is always in user-space. + */ + RefPtr mPath; + RefPtr mDSPathBuilder; + RefPtr mPathBuilder; + bool mPathTransformWillUpdate; + mozilla::gfx::Matrix mPathToDS; + + /** + * Number of times we've invalidated before calling redraw + */ + uint32_t mInvalidateCount; + static const uint32_t kCanvasMaxInvalidateCount = 100; + + /** + * State information for hit regions + */ + struct RegionInfo + { + nsString mId; + // fallback element for a11y + RefPtr mElement; + // Path of the hit region in the 2d context coordinate space (not user space) + RefPtr mPath; + }; + + nsTArray mHitRegionsOptions; + + /** + * Returns true if a shadow should be drawn along with a + * drawing operation. + */ + bool NeedToDrawShadow() + { + const ContextState& state = CurrentState(); + + // The spec says we should not draw shadows if the operator is OVER. + // If it's over and the alpha value is zero, nothing needs to be drawn. + return NS_GET_A(state.shadowColor) != 0 && + (state.shadowBlur != 0.f || state.shadowOffset.x != 0.f || state.shadowOffset.y != 0.f); + } + + /** + * Returns true if the result of a drawing operation should be + * drawn with a filter. + */ + bool NeedToApplyFilter() + { + return EnsureUpdatedFilter().mPrimitives.Length() > 0; + } + + /** + * Calls UpdateFilter if the canvas's WriteOnly state has changed between the + * last call to UpdateFilter and now. + */ + const gfx::FilterDescription& EnsureUpdatedFilter() { + bool isWriteOnly = mCanvasElement && mCanvasElement->IsWriteOnly(); + if (CurrentState().filterSourceGraphicTainted != isWriteOnly) { + UpdateFilter(); + EnsureTarget(); + } + MOZ_ASSERT(CurrentState().filterSourceGraphicTainted == isWriteOnly); + return CurrentState().filter; + } + + bool NeedToCalculateBounds() + { + return NeedToDrawShadow() || NeedToApplyFilter(); + } + + mozilla::gfx::CompositionOp UsedOperation() + { + if (NeedToDrawShadow() || NeedToApplyFilter()) { + // In this case the shadow or filter rendering will use the operator. + return mozilla::gfx::CompositionOp::OP_OVER; + } + + return CurrentState().op; + } + + // text + +protected: + enum class TextAlign : uint8_t { + START, + END, + LEFT, + RIGHT, + CENTER + }; + + enum class TextBaseline : uint8_t { + TOP, + HANGING, + MIDDLE, + ALPHABETIC, + IDEOGRAPHIC, + BOTTOM + }; + + enum class TextDrawOperation : uint8_t { + FILL, + STROKE, + MEASURE + }; + +protected: + gfxFontGroup *GetCurrentFontStyle(); + + /** + * Implementation of the fillText, strokeText, and measure functions with + * the operation abstracted to a flag. + */ + nsresult DrawOrMeasureText(const nsAString& aText, + float aX, + float aY, + const Optional& aMaxWidth, + TextDrawOperation aOp, + float* aWidth); + + bool CheckSizeForSkiaGL(mozilla::gfx::IntSize aSize); + + // A clip or a transform, recorded and restored in order. + struct ClipState { + explicit ClipState(mozilla::gfx::Path* aClip) + : clip(aClip) + {} + + explicit ClipState(const mozilla::gfx::Matrix& aTransform) + : transform(aTransform) + {} + + bool IsClip() const { return !!clip; } + + RefPtr clip; + mozilla::gfx::Matrix transform; + }; + + // state stack handling + class ContextState { + public: + ContextState() : textAlign(TextAlign::START), + textBaseline(TextBaseline::ALPHABETIC), + shadowColor(0), + lineWidth(1.0f), + miterLimit(10.0f), + globalAlpha(1.0f), + shadowBlur(0.0), + dashOffset(0.0f), + op(mozilla::gfx::CompositionOp::OP_OVER), + fillRule(mozilla::gfx::FillRule::FILL_WINDING), + lineCap(mozilla::gfx::CapStyle::BUTT), + lineJoin(mozilla::gfx::JoinStyle::MITER_OR_BEVEL), + filterString(u"none"), + filterSourceGraphicTainted(false), + imageSmoothingEnabled(true), + fontExplicitLanguage(false) + { } + + ContextState(const ContextState& aOther) + : fontGroup(aOther.fontGroup), + fontLanguage(aOther.fontLanguage), + fontFont(aOther.fontFont), + gradientStyles(aOther.gradientStyles), + patternStyles(aOther.patternStyles), + colorStyles(aOther.colorStyles), + font(aOther.font), + textAlign(aOther.textAlign), + textBaseline(aOther.textBaseline), + shadowColor(aOther.shadowColor), + transform(aOther.transform), + shadowOffset(aOther.shadowOffset), + lineWidth(aOther.lineWidth), + miterLimit(aOther.miterLimit), + globalAlpha(aOther.globalAlpha), + shadowBlur(aOther.shadowBlur), + dash(aOther.dash), + dashOffset(aOther.dashOffset), + op(aOther.op), + fillRule(aOther.fillRule), + lineCap(aOther.lineCap), + lineJoin(aOther.lineJoin), + filterString(aOther.filterString), + filterChain(aOther.filterChain), + filterChainObserver(aOther.filterChainObserver), + filter(aOther.filter), + filterAdditionalImages(aOther.filterAdditionalImages), + filterSourceGraphicTainted(aOther.filterSourceGraphicTainted), + imageSmoothingEnabled(aOther.imageSmoothingEnabled), + fontExplicitLanguage(aOther.fontExplicitLanguage) + { } + + void SetColorStyle(Style aWhichStyle, nscolor aColor) + { + colorStyles[aWhichStyle] = aColor; + gradientStyles[aWhichStyle] = nullptr; + patternStyles[aWhichStyle] = nullptr; + } + + void SetPatternStyle(Style aWhichStyle, CanvasPattern* aPat) + { + gradientStyles[aWhichStyle] = nullptr; + patternStyles[aWhichStyle] = aPat; + } + + void SetGradientStyle(Style aWhichStyle, CanvasGradient* aGrad) + { + gradientStyles[aWhichStyle] = aGrad; + patternStyles[aWhichStyle] = nullptr; + } + + /** + * returns true iff the given style is a solid color. + */ + bool StyleIsColor(Style aWhichStyle) const + { + return !(patternStyles[aWhichStyle] || gradientStyles[aWhichStyle]); + } + + int32_t ShadowBlurRadius() const + { + static const gfxFloat GAUSSIAN_SCALE_FACTOR = (3 * sqrt(2 * M_PI) / 4) * 1.5; + return (int32_t)floor(ShadowBlurSigma() * GAUSSIAN_SCALE_FACTOR + 0.5); + } + + mozilla::gfx::Float ShadowBlurSigma() const + { + return std::min(SIGMA_MAX, shadowBlur / 2.0f); + } + + nsTArray clipsAndTransforms; + + RefPtr fontGroup; + nsCOMPtr fontLanguage; + nsFont fontFont; + + EnumeratedArray> gradientStyles; + EnumeratedArray> patternStyles; + EnumeratedArray colorStyles; + + nsString font; + TextAlign textAlign; + TextBaseline textBaseline; + + nscolor shadowColor; + + mozilla::gfx::Matrix transform; + mozilla::gfx::Point shadowOffset; + mozilla::gfx::Float lineWidth; + mozilla::gfx::Float miterLimit; + mozilla::gfx::Float globalAlpha; + mozilla::gfx::Float shadowBlur; + nsTArray dash; + mozilla::gfx::Float dashOffset; + + mozilla::gfx::CompositionOp op; + mozilla::gfx::FillRule fillRule; + mozilla::gfx::CapStyle lineCap; + mozilla::gfx::JoinStyle lineJoin; + + nsString filterString; + nsTArray filterChain; + RefPtr filterChainObserver; + mozilla::gfx::FilterDescription filter; + nsTArray> filterAdditionalImages; + + // This keeps track of whether the canvas was "tainted" or not when + // we last used a filter. This is a security measure, whereby the + // canvas is flipped to write-only if a cross-origin image is drawn to it. + // This is to stop bad actors from reading back data they shouldn't have + // access to. + // + // This also limits what filters we can apply to the context; in particular + // feDisplacementMap is restricted. + // + // We keep track of this to ensure that if this gets out of sync with the + // tainted state of the canvas itself, we update our filters accordingly. + bool filterSourceGraphicTainted; + + bool imageSmoothingEnabled; + bool fontExplicitLanguage; + }; + + AutoTArray mStyleStack; + + inline ContextState& CurrentState() { + return mStyleStack[mStyleStack.Length() - 1]; + } + + inline const ContextState& CurrentState() const { + return mStyleStack[mStyleStack.Length() - 1]; + } + + friend class CanvasGeneralPattern; + friend class CanvasFilterChainObserver; + friend class AdjustedTarget; + friend class AdjustedTargetForShadow; + friend class AdjustedTargetForFilter; + + // other helpers + void GetAppUnitsValues(int32_t* aPerDevPixel, int32_t* aPerCSSPixel) + { + // If we don't have a canvas element, we just return something generic. + int32_t devPixel = 60; + int32_t cssPixel = 60; + + nsIPresShell *ps = GetPresShell(); + nsPresContext *pc; + + if (!ps) goto FINISH; + pc = ps->GetPresContext(); + if (!pc) goto FINISH; + devPixel = pc->AppUnitsPerDevPixel(); + cssPixel = pc->AppUnitsPerCSSPixel(); + + FINISH: + if (aPerDevPixel) + *aPerDevPixel = devPixel; + if (aPerCSSPixel) + *aPerCSSPixel = cssPixel; + } + + friend struct CanvasBidiProcessor; + friend class CanvasDrawObserver; +}; + +} // namespace dom +} // namespace mozilla + +#endif /* CanvasRenderingContext2D_h */ diff --git a/dom/canvas/CanvasRenderingContextHelper.cpp b/dom/canvas/CanvasRenderingContextHelper.cpp new file mode 100644 index 000000000..3000e59bd --- /dev/null +++ b/dom/canvas/CanvasRenderingContextHelper.cpp @@ -0,0 +1,304 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "CanvasRenderingContextHelper.h" +#include "ImageBitmapRenderingContext.h" +#include "ImageEncoder.h" +#include "mozilla/dom/CanvasRenderingContext2D.h" +#include "mozilla/Telemetry.h" +#include "mozilla/UniquePtr.h" +#include "nsContentUtils.h" +#include "nsDOMJSUtils.h" +#include "nsIScriptContext.h" +#include "nsJSUtils.h" +#include "WebGL1Context.h" +#include "WebGL2Context.h" + +namespace mozilla { +namespace dom { + +void +CanvasRenderingContextHelper::ToBlob(JSContext* aCx, + nsIGlobalObject* aGlobal, + BlobCallback& aCallback, + const nsAString& aType, + JS::Handle aParams, + ErrorResult& aRv) +{ + // Encoder callback when encoding is complete. + class EncodeCallback : public EncodeCompleteCallback + { + public: + EncodeCallback(nsIGlobalObject* aGlobal, BlobCallback* aCallback) + : mGlobal(aGlobal) + , mBlobCallback(aCallback) {} + + // This is called on main thread. + nsresult ReceiveBlob(already_AddRefed aBlob) + { + RefPtr blob = aBlob; + + ErrorResult rv; + uint64_t size = blob->GetSize(rv); + if (rv.Failed()) { + rv.SuppressException(); + } else { + AutoJSAPI jsapi; + if (jsapi.Init(mGlobal)) { + JS_updateMallocCounter(jsapi.cx(), size); + } + } + + RefPtr newBlob = Blob::Create(mGlobal, blob->Impl()); + + mBlobCallback->Call(*newBlob, rv); + + mGlobal = nullptr; + mBlobCallback = nullptr; + + return rv.StealNSResult(); + } + + nsCOMPtr mGlobal; + RefPtr mBlobCallback; + }; + + RefPtr callback = + new EncodeCallback(aGlobal, &aCallback); + + ToBlob(aCx, aGlobal, callback, aType, aParams, aRv); +} + +void +CanvasRenderingContextHelper::ToBlob(JSContext* aCx, + nsIGlobalObject* aGlobal, + EncodeCompleteCallback* aCallback, + const nsAString& aType, + JS::Handle aParams, + ErrorResult& aRv) +{ + nsAutoString type; + nsContentUtils::ASCIIToLower(aType, type); + + nsAutoString params; + bool usingCustomParseOptions; + aRv = ParseParams(aCx, type, aParams, params, &usingCustomParseOptions); + if (aRv.Failed()) { + return; + } + + if (mCurrentContext) { + // We disallow canvases of width or height zero, and set them to 1, so + // we will have a discrepancy with the sizes of the canvas and the context. + // That discrepancy is OK, the rest are not. + nsIntSize elementSize = GetWidthHeight(); + if ((elementSize.width != mCurrentContext->GetWidth() && + (elementSize.width != 0 || mCurrentContext->GetWidth() != 1)) || + (elementSize.height != mCurrentContext->GetHeight() && + (elementSize.height != 0 || mCurrentContext->GetHeight() != 1))) { + aRv.Throw(NS_ERROR_FAILURE); + return; + } + } + + UniquePtr imageBuffer; + int32_t format = 0; + if (mCurrentContext) { + imageBuffer = mCurrentContext->GetImageBuffer(&format); + } + + RefPtr callback = aCallback; + + aRv = ImageEncoder::ExtractDataAsync(type, + params, + usingCustomParseOptions, + Move(imageBuffer), + format, + GetWidthHeight(), + callback); +} + +already_AddRefed +CanvasRenderingContextHelper::CreateContext(CanvasContextType aContextType) +{ + return CreateContextHelper(aContextType, layers::LayersBackend::LAYERS_NONE); +} + +already_AddRefed +CanvasRenderingContextHelper::CreateContextHelper(CanvasContextType aContextType, + layers::LayersBackend aCompositorBackend) +{ + MOZ_ASSERT(aContextType != CanvasContextType::NoContext); + RefPtr ret; + + switch (aContextType) { + case CanvasContextType::NoContext: + break; + + case CanvasContextType::Canvas2D: + Telemetry::Accumulate(Telemetry::CANVAS_2D_USED, 1); + ret = new CanvasRenderingContext2D(aCompositorBackend); + break; + + case CanvasContextType::WebGL1: + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1); + + ret = WebGL1Context::Create(); + if (!ret) + return nullptr; + + break; + + case CanvasContextType::WebGL2: + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1); + + ret = WebGL2Context::Create(); + if (!ret) + return nullptr; + + break; + + case CanvasContextType::ImageBitmap: + ret = new ImageBitmapRenderingContext(); + + break; + } + MOZ_ASSERT(ret); + + return ret.forget(); +} + +already_AddRefed +CanvasRenderingContextHelper::GetContext(JSContext* aCx, + const nsAString& aContextId, + JS::Handle aContextOptions, + ErrorResult& aRv) +{ + CanvasContextType contextType; + if (!CanvasUtils::GetCanvasContextType(aContextId, &contextType)) + return nullptr; + + if (!mCurrentContext) { + // This canvas doesn't have a context yet. + RefPtr context; + context = CreateContext(contextType); + if (!context) { + return nullptr; + } + + // Ensure that the context participates in CC. Note that returning a + // CC participant from QI doesn't addref. + nsXPCOMCycleCollectionParticipant* cp = nullptr; + CallQueryInterface(context, &cp); + if (!cp) { + aRv.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + mCurrentContext = context.forget(); + mCurrentContextType = contextType; + + nsresult rv = UpdateContext(aCx, aContextOptions, aRv); + if (NS_FAILED(rv)) { + // See bug 645792 and bug 1215072. + // We want to throw only if dictionary initialization fails, + // so only in case aRv has been set to some error value. + if (contextType == CanvasContextType::WebGL1) + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 0); + else if (contextType == CanvasContextType::WebGL2) + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 0); + return nullptr; + } + if (contextType == CanvasContextType::WebGL1) + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_SUCCESS, 1); + else if (contextType == CanvasContextType::WebGL2) + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL2_SUCCESS, 1); + } else { + // We already have a context of some type. + if (contextType != mCurrentContextType) + return nullptr; + } + + nsCOMPtr context = mCurrentContext; + return context.forget(); +} + +nsresult +CanvasRenderingContextHelper::UpdateContext(JSContext* aCx, + JS::Handle aNewContextOptions, + ErrorResult& aRvForDictionaryInit) +{ + if (!mCurrentContext) + return NS_OK; + + nsIntSize sz = GetWidthHeight(); + + nsCOMPtr currentContext = mCurrentContext; + + nsresult rv = currentContext->SetIsOpaque(GetOpaqueAttr()); + if (NS_FAILED(rv)) { + mCurrentContext = nullptr; + return rv; + } + + rv = currentContext->SetContextOptions(aCx, aNewContextOptions, + aRvForDictionaryInit); + if (NS_FAILED(rv)) { + mCurrentContext = nullptr; + return rv; + } + + rv = currentContext->SetDimensions(sz.width, sz.height); + if (NS_FAILED(rv)) { + mCurrentContext = nullptr; + } + + return rv; +} + +nsresult +CanvasRenderingContextHelper::ParseParams(JSContext* aCx, + const nsAString& aType, + const JS::Value& aEncoderOptions, + nsAString& outParams, + bool* const outUsingCustomParseOptions) +{ + // Quality parameter is only valid for the image/jpeg MIME type + if (aType.EqualsLiteral("image/jpeg")) { + if (aEncoderOptions.isNumber()) { + double quality = aEncoderOptions.toNumber(); + // Quality must be between 0.0 and 1.0, inclusive + if (quality >= 0.0 && quality <= 1.0) { + outParams.AppendLiteral("quality="); + outParams.AppendInt(NS_lround(quality * 100.0)); + } + } + } + + // If we haven't parsed the aParams check for proprietary options. + // The proprietary option -moz-parse-options will take a image lib encoder + // parse options string as is and pass it to the encoder. + *outUsingCustomParseOptions = false; + if (outParams.Length() == 0 && aEncoderOptions.isString()) { + NS_NAMED_LITERAL_STRING(mozParseOptions, "-moz-parse-options:"); + nsAutoJSString paramString; + if (!paramString.init(aCx, aEncoderOptions.toString())) { + return NS_ERROR_FAILURE; + } + if (StringBeginsWith(paramString, mozParseOptions)) { + nsDependentSubstring parseOptions = Substring(paramString, + mozParseOptions.Length(), + paramString.Length() - + mozParseOptions.Length()); + outParams.Append(parseOptions); + *outUsingCustomParseOptions = true; + } + } + + return NS_OK; +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/CanvasRenderingContextHelper.h b/dom/canvas/CanvasRenderingContextHelper.h new file mode 100644 index 000000000..d28864f02 --- /dev/null +++ b/dom/canvas/CanvasRenderingContextHelper.h @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef MOZILLA_DOM_CANVASRENDERINGCONTEXTHELPER_H_ +#define MOZILLA_DOM_CANVASRENDERINGCONTEXTHELPER_H_ + +#include "mozilla/dom/BindingDeclarations.h" +#include "mozilla/layers/LayersTypes.h" +#include "nsSize.h" + +class nsICanvasRenderingContextInternal; +class nsIGlobalObject; + +namespace mozilla { + +class ErrorResult; + +namespace dom { + +class BlobCallback; +class EncodeCompleteCallback; + +enum class CanvasContextType : uint8_t { + NoContext, + Canvas2D, + WebGL1, + WebGL2, + ImageBitmap +}; + +/** + * Povides common RenderingContext functionality used by both OffscreenCanvas + * and HTMLCanvasElement. + */ +class CanvasRenderingContextHelper +{ +public: + virtual already_AddRefed + GetContext(JSContext* aCx, + const nsAString& aContextId, + JS::Handle aContextOptions, + ErrorResult& aRv); + + virtual bool GetOpaqueAttr() = 0; + +protected: + virtual nsresult UpdateContext(JSContext* aCx, + JS::Handle aNewContextOptions, + ErrorResult& aRvForDictionaryInit); + + virtual nsresult ParseParams(JSContext* aCx, + const nsAString& aType, + const JS::Value& aEncoderOptions, + nsAString& outParams, + bool* const outCustomParseOptions); + + void ToBlob(JSContext* aCx, nsIGlobalObject* global, BlobCallback& aCallback, + const nsAString& aType, JS::Handle aParams, + ErrorResult& aRv); + + void ToBlob(JSContext* aCx, nsIGlobalObject* aGlobal, EncodeCompleteCallback* aCallback, + const nsAString& aType, JS::Handle aParams, + ErrorResult& aRv); + + virtual already_AddRefed + CreateContext(CanvasContextType aContextType); + + already_AddRefed + CreateContextHelper(CanvasContextType aContextType, + layers::LayersBackend aCompositorBackend); + + virtual nsIntSize GetWidthHeight() = 0; + + CanvasContextType mCurrentContextType; + nsCOMPtr mCurrentContext; +}; + +} // namespace dom +} // namespace mozilla + +#endif // MOZILLA_DOM_CANVASRENDERINGCONTEXTHELPER_H_ diff --git a/dom/canvas/CanvasUtils.cpp b/dom/canvas/CanvasUtils.cpp new file mode 100644 index 000000000..c7cfed83f --- /dev/null +++ b/dom/canvas/CanvasUtils.cpp @@ -0,0 +1,130 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include +#include + +#include "prprf.h" + +#include "nsIServiceManager.h" + +#include "nsIConsoleService.h" +#include "nsIDOMCanvasRenderingContext2D.h" +#include "nsICanvasRenderingContextInternal.h" +#include "nsIHTMLCollection.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "nsIPrincipal.h" + +#include "nsGfxCIID.h" + +#include "nsTArray.h" + +#include "CanvasUtils.h" +#include "mozilla/gfx/Matrix.h" +#include "WebGL2Context.h" + +using namespace mozilla::gfx; + +namespace mozilla { +namespace CanvasUtils { + +bool +GetCanvasContextType(const nsAString& str, dom::CanvasContextType* const out_type) +{ + if (str.EqualsLiteral("2d")) { + *out_type = dom::CanvasContextType::Canvas2D; + return true; + } + + if (str.EqualsLiteral("experimental-webgl")) { + *out_type = dom::CanvasContextType::WebGL1; + return true; + } + +#ifdef MOZ_WEBGL_CONFORMANT + if (str.EqualsLiteral("webgl")) { + /* WebGL 1.0, $2.1 "Context Creation": + * If the user agent supports both the webgl and experimental-webgl + * canvas context types, they shall be treated as aliases. + */ + *out_type = dom::CanvasContextType::WebGL1; + return true; + } +#endif + + if (WebGL2Context::IsSupported()) { + if (str.EqualsLiteral("webgl2")) { + *out_type = dom::CanvasContextType::WebGL2; + return true; + } + } + + if (str.EqualsLiteral("bitmaprenderer")) { + *out_type = dom::CanvasContextType::ImageBitmap; + return true; + } + + return false; +} + +/** + * This security check utility might be called from an source that never taints + * others. For example, while painting a CanvasPattern, which is created from an + * ImageBitmap, onto a canvas. In this case, the caller could set the CORSUsed + * true in order to pass this check and leave the aPrincipal to be a nullptr + * since the aPrincipal is not going to be used. + */ +void +DoDrawImageSecurityCheck(dom::HTMLCanvasElement *aCanvasElement, + nsIPrincipal *aPrincipal, + bool forceWriteOnly, + bool CORSUsed) +{ + // Callers should ensure that mCanvasElement is non-null before calling this + if (!aCanvasElement) { + NS_WARNING("DoDrawImageSecurityCheck called without canvas element!"); + return; + } + + if (aCanvasElement->IsWriteOnly()) + return; + + // If we explicitly set WriteOnly just do it and get out + if (forceWriteOnly) { + aCanvasElement->SetWriteOnly(); + return; + } + + // No need to do a security check if the image used CORS for the load + if (CORSUsed) + return; + + NS_PRECONDITION(aPrincipal, "Must have a principal here"); + + if (aCanvasElement->NodePrincipal()->Subsumes(aPrincipal)) { + // This canvas has access to that image anyway + return; + } + + aCanvasElement->SetWriteOnly(); +} + +bool +CoerceDouble(const JS::Value& v, double* d) +{ + if (v.isDouble()) { + *d = v.toDouble(); + } else if (v.isInt32()) { + *d = double(v.toInt32()); + } else if (v.isUndefined()) { + *d = 0.0; + } else { + return false; + } + return true; +} + +} // namespace CanvasUtils +} // namespace mozilla diff --git a/dom/canvas/CanvasUtils.h b/dom/canvas/CanvasUtils.h new file mode 100644 index 000000000..a69b8bd72 --- /dev/null +++ b/dom/canvas/CanvasUtils.h @@ -0,0 +1,162 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef _CANVASUTILS_H_ +#define _CANVASUTILS_H_ + +#include "CanvasRenderingContextHelper.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/dom/ToJSValue.h" +#include "jsapi.h" +#include "mozilla/FloatingPoint.h" + +class nsIPrincipal; + +namespace mozilla { + +namespace dom { +class HTMLCanvasElement; +} // namespace dom + +namespace CanvasUtils { + +bool GetCanvasContextType(const nsAString& str, dom::CanvasContextType* const out_type); + +// Check that the rectangle [x,y,w,h] is a subrectangle of [0,0,realWidth,realHeight] + +inline bool CheckSaneSubrectSize(int32_t x, int32_t y, int32_t w, int32_t h, + int32_t realWidth, int32_t realHeight) { + CheckedInt32 checked_xmost = CheckedInt32(x) + w; + CheckedInt32 checked_ymost = CheckedInt32(y) + h; + + return w >= 0 && h >= 0 && x >= 0 && y >= 0 && + checked_xmost.isValid() && + checked_xmost.value() <= realWidth && + checked_ymost.isValid() && + checked_ymost.value() <= realHeight; +} + +// Flag aCanvasElement as write-only if drawing an image with aPrincipal +// onto it would make it such. + +void DoDrawImageSecurityCheck(dom::HTMLCanvasElement *aCanvasElement, + nsIPrincipal *aPrincipal, + bool forceWriteOnly, + bool CORSUsed); + +// Make a double out of |v|, treating undefined values as 0.0 (for +// the sake of sparse arrays). Return true iff coercion +// succeeded. +bool CoerceDouble(const JS::Value& v, double* d); + + /* Float validation stuff */ +#define VALIDATE(_f) if (!IsFinite(_f)) return false + +inline bool FloatValidate (double f1) { + VALIDATE(f1); + return true; +} + +inline bool FloatValidate (double f1, double f2) { + VALIDATE(f1); VALIDATE(f2); + return true; +} + +inline bool FloatValidate (double f1, double f2, double f3) { + VALIDATE(f1); VALIDATE(f2); VALIDATE(f3); + return true; +} + +inline bool FloatValidate (double f1, double f2, double f3, double f4) { + VALIDATE(f1); VALIDATE(f2); VALIDATE(f3); VALIDATE(f4); + return true; +} + +inline bool FloatValidate (double f1, double f2, double f3, double f4, double f5) { + VALIDATE(f1); VALIDATE(f2); VALIDATE(f3); VALIDATE(f4); VALIDATE(f5); + return true; +} + +inline bool FloatValidate (double f1, double f2, double f3, double f4, double f5, double f6) { + VALIDATE(f1); VALIDATE(f2); VALIDATE(f3); VALIDATE(f4); VALIDATE(f5); VALIDATE(f6); + return true; +} + +#undef VALIDATE + +template +nsresult +JSValToDashArray(JSContext* cx, const JS::Value& patternArray, + nsTArray& dashes) +{ + // The cap is pretty arbitrary. 16k should be enough for + // anybody... + static const uint32_t MAX_NUM_DASHES = 1 << 14; + + if (!patternArray.isPrimitive()) { + JS::Rooted obj(cx, patternArray.toObjectOrNull()); + uint32_t length; + if (!JS_GetArrayLength(cx, obj, &length)) { + // Not an array-like thing + return NS_ERROR_INVALID_ARG; + } else if (length > MAX_NUM_DASHES) { + // Too many dashes in the pattern + return NS_ERROR_ILLEGAL_VALUE; + } + + bool haveNonzeroElement = false; + for (uint32_t i = 0; i < length; ++i) { + JS::Rooted elt(cx); + double d; + if (!JS_GetElement(cx, obj, i, &elt)) { + return NS_ERROR_FAILURE; + } + if (!(CoerceDouble(elt, &d) && + FloatValidate(d) && + d >= 0.0)) { + // Pattern elements must be finite "numbers" >= 0. + return NS_ERROR_INVALID_ARG; + } else if (d > 0.0) { + haveNonzeroElement = true; + } + if (!dashes.AppendElement(d, mozilla::fallible)) { + return NS_ERROR_OUT_OF_MEMORY; + } + } + + if (dashes.Length() > 0 && !haveNonzeroElement) { + // An all-zero pattern makes no sense. + return NS_ERROR_ILLEGAL_VALUE; + } + } else if (!(patternArray.isUndefined() || patternArray.isNull())) { + // undefined and null mean "reset to no dash". Any other + // random garbage is a type error. + return NS_ERROR_INVALID_ARG; + } + + return NS_OK; +} + +template +void +DashArrayToJSVal(nsTArray& dashes, + JSContext* cx, + JS::MutableHandle retval, + mozilla::ErrorResult& rv) +{ + if (dashes.IsEmpty()) { + retval.setNull(); + return; + } + JS::Rooted val(cx); + if (!mozilla::dom::ToJSValue(cx, dashes, retval)) { + rv.Throw(NS_ERROR_OUT_OF_MEMORY); + } +} + +} // namespace CanvasUtils +} // namespace mozilla + +#endif /* _CANVASUTILS_H_ */ diff --git a/dom/canvas/DocumentRendererChild.cpp b/dom/canvas/DocumentRendererChild.cpp new file mode 100644 index 000000000..15dd5fc52 --- /dev/null +++ b/dom/canvas/DocumentRendererChild.cpp @@ -0,0 +1,94 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/ipc/DocumentRendererChild.h" + +#include "base/basictypes.h" + +#include "gfx2DGlue.h" +#include "gfxPattern.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/RefPtr.h" +#include "nsPIDOMWindow.h" +#include "nsIDOMWindow.h" +#include "nsIDocShell.h" +#include "nsIInterfaceRequestorUtils.h" +#include "nsComponentManagerUtils.h" +#include "nsCSSParser.h" +#include "nsPresContext.h" +#include "nsCOMPtr.h" +#include "nsColor.h" +#include "gfxContext.h" +#include "nsLayoutUtils.h" +#include "nsContentUtils.h" +#include "nsCSSValue.h" +#include "nsRuleNode.h" +#include "mozilla/gfx/Matrix.h" + +using namespace mozilla; +using namespace mozilla::gfx; +using namespace mozilla::ipc; + +DocumentRendererChild::DocumentRendererChild() +{} + +DocumentRendererChild::~DocumentRendererChild() +{} + +bool +DocumentRendererChild::RenderDocument(nsPIDOMWindowOuter* window, + const nsRect& documentRect, + const mozilla::gfx::Matrix& transform, + const nsString& aBGColor, + uint32_t renderFlags, + bool flushLayout, + const nsIntSize& renderSize, + nsCString& data) +{ + if (flushLayout) + nsContentUtils::FlushLayoutForTree(window); + + RefPtr presContext; + if (window) { + nsIDocShell* docshell = window->GetDocShell(); + if (docshell) { + docshell->GetPresContext(getter_AddRefs(presContext)); + } + } + if (!presContext) + return false; + + nsCSSParser parser; + nsCSSValue bgColorValue; + if (!parser.ParseColorString(aBGColor, nullptr, 0, bgColorValue)) { + return false; + } + + nscolor bgColor; + if (!nsRuleNode::ComputeColor(bgColorValue, presContext, nullptr, bgColor)) { + return false; + } + + // Draw directly into the output array. + data.SetLength(renderSize.width * renderSize.height * 4); + + RefPtr dt = + Factory::CreateDrawTargetForData(BackendType::CAIRO, + reinterpret_cast(data.BeginWriting()), + IntSize(renderSize.width, renderSize.height), + 4 * renderSize.width, + SurfaceFormat::B8G8R8A8); + if (!dt || !dt->IsValid()) { + gfxWarning() << "DocumentRendererChild::RenderDocument failed to Factory::CreateDrawTargetForData"; + return false; + } + RefPtr ctx = gfxContext::CreateOrNull(dt); + MOZ_ASSERT(ctx); // already checked the draw target above + ctx->SetMatrix(mozilla::gfx::ThebesMatrix(transform)); + + nsCOMPtr shell = presContext->PresShell(); + shell->RenderDocument(documentRect, renderFlags, bgColor, ctx); + + return true; +} diff --git a/dom/canvas/DocumentRendererChild.h b/dom/canvas/DocumentRendererChild.h new file mode 100644 index 000000000..463ba2707 --- /dev/null +++ b/dom/canvas/DocumentRendererChild.h @@ -0,0 +1,37 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_DocumentRendererChild +#define mozilla_dom_DocumentRendererChild + +#include "mozilla/ipc/PDocumentRendererChild.h" +#include "nsString.h" +#include "gfxContext.h" + +class nsIDOMWindow; + +namespace mozilla { +namespace ipc { + +class DocumentRendererChild : public PDocumentRendererChild +{ +public: + DocumentRendererChild(); + virtual ~DocumentRendererChild(); + + bool RenderDocument(nsPIDOMWindowOuter* window, + const nsRect& documentRect, const gfx::Matrix& transform, + const nsString& bgcolor, + uint32_t renderFlags, bool flushLayout, + const nsIntSize& renderSize, nsCString& data); + +private: + + DISALLOW_EVIL_CONSTRUCTORS(DocumentRendererChild); +}; + +} // namespace ipc +} // namespace mozilla + +#endif diff --git a/dom/canvas/DocumentRendererParent.cpp b/dom/canvas/DocumentRendererParent.cpp new file mode 100644 index 000000000..d9578ac4e --- /dev/null +++ b/dom/canvas/DocumentRendererParent.cpp @@ -0,0 +1,63 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/ipc/DocumentRendererParent.h" + +#include "gfx2DGlue.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/gfx/PathHelpers.h" +#include "mozilla/RefPtr.h" +#include "nsICanvasRenderingContextInternal.h" + +using namespace mozilla; +using namespace mozilla::gfx; +using namespace mozilla::ipc; + +DocumentRendererParent::DocumentRendererParent() +{} + +DocumentRendererParent::~DocumentRendererParent() +{} + +void DocumentRendererParent::SetCanvasContext(nsICanvasRenderingContextInternal* aCanvas, + gfxContext* ctx) +{ + mCanvas = aCanvas; + mCanvasContext = ctx; +} + +void DocumentRendererParent::DrawToCanvas(const nsIntSize& aSize, + const nsCString& aData) +{ + if (!mCanvas || !mCanvasContext) + return; + + DrawTarget* drawTarget = mCanvasContext->GetDrawTarget(); + Rect rect(0, 0, aSize.width, aSize.height); + MaybeSnapToDevicePixels(rect, *drawTarget, true); + RefPtr dataSurface = + Factory::CreateWrappingDataSourceSurface(reinterpret_cast(const_cast(aData).BeginWriting()), + aSize.width * 4, + IntSize(aSize.width, aSize.height), + SurfaceFormat::B8G8R8A8); + SurfacePattern pattern(dataSurface, ExtendMode::CLAMP); + drawTarget->FillRect(rect, pattern); + + gfxRect damageRect = mCanvasContext->UserToDevice(ThebesRect(rect)); + mCanvas->Redraw(damageRect); +} + +void +DocumentRendererParent::ActorDestroy(ActorDestroyReason aWhy) +{ + // Implement me! Bug 1005139 +} + +bool +DocumentRendererParent::Recv__delete__(const nsIntSize& renderedSize, + const nsCString& data) +{ + DrawToCanvas(renderedSize, data); + return true; +} diff --git a/dom/canvas/DocumentRendererParent.h b/dom/canvas/DocumentRendererParent.h new file mode 100644 index 000000000..432aa8264 --- /dev/null +++ b/dom/canvas/DocumentRendererParent.h @@ -0,0 +1,44 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_DocumentRendererParent +#define mozilla_dom_DocumentRendererParent + +#include "mozilla/ipc/PDocumentRendererParent.h" +#include "nsCOMPtr.h" +#include "nsString.h" +#include "gfxContext.h" + +class nsICanvasRenderingContextInternal; + +namespace mozilla { +namespace ipc { + +class DocumentRendererParent : public PDocumentRendererParent +{ +public: + DocumentRendererParent(); + virtual ~DocumentRendererParent(); + + void SetCanvasContext(nsICanvasRenderingContextInternal* aCanvas, + gfxContext* ctx); + void DrawToCanvas(const nsIntSize& renderedSize, + const nsCString& aData); + + virtual void ActorDestroy(ActorDestroyReason aWhy) override; + + virtual bool Recv__delete__(const nsIntSize& renderedSize, + const nsCString& data) override; + +private: + nsCOMPtr mCanvas; + RefPtr mCanvasContext; + + DISALLOW_EVIL_CONSTRUCTORS(DocumentRendererParent); +}; + +} // namespace ipc +} // namespace mozilla + +#endif diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp new file mode 100644 index 000000000..6588e0aa3 --- /dev/null +++ b/dom/canvas/ImageBitmap.cpp @@ -0,0 +1,2133 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/dom/ImageBitmap.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/dom/ImageBitmapBinding.h" +#include "mozilla/dom/Promise.h" +#include "mozilla/dom/StructuredCloneTags.h" +#include "mozilla/dom/WorkerPrivate.h" +#include "mozilla/dom/WorkerRunnable.h" +#include "mozilla/gfx/2D.h" +#include "ImageBitmapColorUtils.h" +#include "ImageBitmapUtils.h" +#include "ImageUtils.h" +#include "imgTools.h" +#include "libyuv.h" + +using namespace mozilla::gfx; +using namespace mozilla::layers; + +namespace mozilla { +namespace dom { + +using namespace workers; + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ImageBitmap, mParent) +NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageBitmap) +NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageBitmap) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageBitmap) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +/* + * If either aRect.width or aRect.height are negative, then return a new IntRect + * which represents the same rectangle as the aRect does but with positive width + * and height. + */ +static IntRect +FixUpNegativeDimension(const IntRect& aRect, ErrorResult& aRv) +{ + gfx::IntRect rect = aRect; + + // fix up negative dimensions + if (rect.width < 0) { + CheckedInt32 checkedX = CheckedInt32(rect.x) + rect.width; + + if (!checkedX.isValid()) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return rect; + } + + rect.x = checkedX.value(); + rect.width = -(rect.width); + } + + if (rect.height < 0) { + CheckedInt32 checkedY = CheckedInt32(rect.y) + rect.height; + + if (!checkedY.isValid()) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return rect; + } + + rect.y = checkedY.value(); + rect.height = -(rect.height); + } + + return rect; +} + +/* + * This helper function copies the data of the given DataSourceSurface, + * _aSurface_, in the given area, _aCropRect_, into a new DataSourceSurface. + * This might return null if it can not create a new SourceSurface or it cannot + * read data from the given _aSurface_. + * + * Warning: Even though the area of _aCropRect_ is just the same as the size of + * _aSurface_, this function still copy data into a new + * DataSourceSurface. + */ +static already_AddRefed +CropAndCopyDataSourceSurface(DataSourceSurface* aSurface, const IntRect& aCropRect) +{ + MOZ_ASSERT(aSurface); + + // Check the aCropRect + ErrorResult error; + const IntRect positiveCropRect = FixUpNegativeDimension(aCropRect, error); + if (NS_WARN_IF(error.Failed())) { + error.SuppressException(); + return nullptr; + } + + // Calculate the size of the new SourceSurface. + // We cannot keep using aSurface->GetFormat() to create new DataSourceSurface, + // since it might be SurfaceFormat::B8G8R8X8 which does not handle opacity, + // however the specification explicitly define that "If any of the pixels on + // this rectangle are outside the area where the input bitmap was placed, then + // they will be transparent black in output." + // So, instead, we force the output format to be SurfaceFormat::B8G8R8A8. + const SurfaceFormat format = SurfaceFormat::B8G8R8A8; + const int bytesPerPixel = BytesPerPixel(format); + const IntSize dstSize = IntSize(positiveCropRect.width, + positiveCropRect.height); + const uint32_t dstStride = dstSize.width * bytesPerPixel; + + // Create a new SourceSurface. + RefPtr dstDataSurface = + Factory::CreateDataSourceSurfaceWithStride(dstSize, format, dstStride, true); + + if (NS_WARN_IF(!dstDataSurface)) { + return nullptr; + } + + // Only do copying and cropping when the positiveCropRect intersects with + // the size of aSurface. + const IntRect surfRect(IntPoint(0, 0), aSurface->GetSize()); + if (surfRect.Intersects(positiveCropRect)) { + const IntRect surfPortion = surfRect.Intersect(positiveCropRect); + const IntPoint dest(std::max(0, surfPortion.X() - positiveCropRect.X()), + std::max(0, surfPortion.Y() - positiveCropRect.Y())); + + // Copy the raw data into the newly created DataSourceSurface. + DataSourceSurface::ScopedMap srcMap(aSurface, DataSourceSurface::READ); + DataSourceSurface::ScopedMap dstMap(dstDataSurface, DataSourceSurface::WRITE); + if (NS_WARN_IF(!srcMap.IsMapped()) || + NS_WARN_IF(!dstMap.IsMapped())) { + return nullptr; + } + + uint8_t* srcBufferPtr = srcMap.GetData() + surfPortion.y * srcMap.GetStride() + + surfPortion.x * bytesPerPixel; + uint8_t* dstBufferPtr = dstMap.GetData() + dest.y * dstMap.GetStride() + + dest.x * bytesPerPixel; + CheckedInt copiedBytesPerRaw = + CheckedInt(surfPortion.width) * bytesPerPixel; + if (!copiedBytesPerRaw.isValid()) { + return nullptr; + } + + for (int i = 0; i < surfPortion.height; ++i) { + memcpy(dstBufferPtr, srcBufferPtr, copiedBytesPerRaw.value()); + srcBufferPtr += srcMap.GetStride(); + dstBufferPtr += dstMap.GetStride(); + } + } + + return dstDataSurface.forget(); +} + +/* + * Encapsulate the given _aSurface_ into a layers::SourceSurfaceImage. + */ +static already_AddRefed +CreateImageFromSurface(SourceSurface* aSurface) +{ + MOZ_ASSERT(aSurface); + RefPtr image = + new layers::SourceSurfaceImage(aSurface->GetSize(), aSurface); + return image.forget(); +} + +/* + * CreateImageFromRawData(), CreateSurfaceFromRawData() and + * CreateImageFromRawDataInMainThreadSyncTask are helpers for + * create-from-ImageData case + */ +static already_AddRefed +CreateSurfaceFromRawData(const gfx::IntSize& aSize, + uint32_t aStride, + gfx::SurfaceFormat aFormat, + uint8_t* aBuffer, + uint32_t aBufferLength, + const Maybe& aCropRect) +{ + MOZ_ASSERT(!aSize.IsEmpty()); + MOZ_ASSERT(aBuffer); + + // Wrap the source buffer into a SourceSurface. + RefPtr dataSurface = + Factory::CreateWrappingDataSourceSurface(aBuffer, aStride, aSize, aFormat); + + if (NS_WARN_IF(!dataSurface)) { + return nullptr; + } + + // The temporary cropRect variable is equal to the size of source buffer if we + // do not need to crop, or it equals to the given cropping size. + const IntRect cropRect = aCropRect.valueOr(IntRect(0, 0, aSize.width, aSize.height)); + + // Copy the source buffer in the _cropRect_ area into a new SourceSurface. + RefPtr result = CropAndCopyDataSourceSurface(dataSurface, cropRect); + + if (NS_WARN_IF(!result)) { + return nullptr; + } + + return result.forget(); +} + +static already_AddRefed +CreateImageFromRawData(const gfx::IntSize& aSize, + uint32_t aStride, + gfx::SurfaceFormat aFormat, + uint8_t* aBuffer, + uint32_t aBufferLength, + const Maybe& aCropRect) +{ + MOZ_ASSERT(NS_IsMainThread()); + + // Copy and crop the source buffer into a SourceSurface. + RefPtr rgbaSurface = + CreateSurfaceFromRawData(aSize, aStride, aFormat, + aBuffer, aBufferLength, + aCropRect); + + if (NS_WARN_IF(!rgbaSurface)) { + return nullptr; + } + + // Convert RGBA to BGRA + RefPtr rgbaDataSurface = rgbaSurface->GetDataSurface(); + RefPtr bgraDataSurface = + Factory::CreateDataSourceSurfaceWithStride(rgbaDataSurface->GetSize(), + SurfaceFormat::B8G8R8A8, + rgbaDataSurface->Stride()); + + DataSourceSurface::MappedSurface rgbaMap; + DataSourceSurface::MappedSurface bgraMap; + + if (NS_WARN_IF(!rgbaDataSurface->Map(DataSourceSurface::MapType::READ, &rgbaMap)) || + NS_WARN_IF(!bgraDataSurface->Map(DataSourceSurface::MapType::WRITE, &bgraMap))) { + return nullptr; + } + + libyuv::ABGRToARGB(rgbaMap.mData, rgbaMap.mStride, + bgraMap.mData, bgraMap.mStride, + bgraDataSurface->GetSize().width, + bgraDataSurface->GetSize().height); + + rgbaDataSurface->Unmap(); + bgraDataSurface->Unmap(); + + // Create an Image from the BGRA SourceSurface. + RefPtr image = CreateImageFromSurface(bgraDataSurface); + + if (NS_WARN_IF(!image)) { + return nullptr; + } + + return image.forget(); +} + +/* + * This is a synchronous task. + * This class is used to create a layers::SourceSurfaceImage from raw data in the main + * thread. While creating an ImageBitmap from an ImageData, we need to create + * a SouceSurface from the ImageData's raw data and then set the SourceSurface + * into a layers::SourceSurfaceImage. However, the layers::SourceSurfaceImage asserts the + * setting operation in the main thread, so if we are going to create an + * ImageBitmap from an ImageData off the main thread, we post an event to the + * main thread to create a layers::SourceSurfaceImage from an ImageData's raw data. + */ +class CreateImageFromRawDataInMainThreadSyncTask final : + public WorkerMainThreadRunnable +{ +public: + CreateImageFromRawDataInMainThreadSyncTask(uint8_t* aBuffer, + uint32_t aBufferLength, + uint32_t aStride, + gfx::SurfaceFormat aFormat, + const gfx::IntSize& aSize, + const Maybe& aCropRect, + layers::Image** aImage) + : WorkerMainThreadRunnable(GetCurrentThreadWorkerPrivate(), + NS_LITERAL_CSTRING("ImageBitmap :: Create Image from Raw Data")) + , mImage(aImage) + , mBuffer(aBuffer) + , mBufferLength(aBufferLength) + , mStride(aStride) + , mFormat(aFormat) + , mSize(aSize) + , mCropRect(aCropRect) + { + MOZ_ASSERT(!(*aImage), "Don't pass an existing Image into CreateImageFromRawDataInMainThreadSyncTask."); + } + + bool MainThreadRun() override + { + RefPtr image = + CreateImageFromRawData(mSize, mStride, mFormat, + mBuffer, mBufferLength, + mCropRect); + + if (NS_WARN_IF(!image)) { + return false; + } + + image.forget(mImage); + + return true; + } + +private: + layers::Image** mImage; + uint8_t* mBuffer; + uint32_t mBufferLength; + uint32_t mStride; + gfx::SurfaceFormat mFormat; + gfx::IntSize mSize; + const Maybe& mCropRect; +}; + +static bool +CheckSecurityForHTMLElements(bool aIsWriteOnly, bool aCORSUsed, nsIPrincipal* aPrincipal) +{ + MOZ_ASSERT(aPrincipal); + + if (aIsWriteOnly) { + return false; + } + + if (!aCORSUsed) { + nsIGlobalObject* incumbentSettingsObject = GetIncumbentGlobal(); + if (NS_WARN_IF(!incumbentSettingsObject)) { + return false; + } + + nsIPrincipal* principal = incumbentSettingsObject->PrincipalOrNull(); + if (NS_WARN_IF(!principal) || !(principal->Subsumes(aPrincipal))) { + return false; + } + } + + return true; +} + +static bool +CheckSecurityForHTMLElements(const nsLayoutUtils::SurfaceFromElementResult& aRes) +{ + return CheckSecurityForHTMLElements(aRes.mIsWriteOnly, aRes.mCORSUsed, aRes.mPrincipal); +} + +/* + * A wrapper to the nsLayoutUtils::SurfaceFromElement() function followed by the + * security checking. + */ +template +static already_AddRefed +GetSurfaceFromElement(nsIGlobalObject* aGlobal, HTMLElementType& aElement, ErrorResult& aRv) +{ + nsLayoutUtils::SurfaceFromElementResult res = + nsLayoutUtils::SurfaceFromElement(&aElement, nsLayoutUtils::SFE_WANT_FIRST_FRAME); + + // check origin-clean + if (!CheckSecurityForHTMLElements(res)) { + aRv.Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + RefPtr surface = res.GetSourceSurface(); + + if (NS_WARN_IF(!surface)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + return surface.forget(); +} + +/* + * The specification doesn't allow to create an ImegeBitmap from a vector image. + * This function is used to check if the given HTMLImageElement contains a + * raster image. + */ +static bool +HasRasterImage(HTMLImageElement& aImageEl) +{ + nsresult rv; + + nsCOMPtr imgRequest; + rv = aImageEl.GetRequest(nsIImageLoadingContent::CURRENT_REQUEST, + getter_AddRefs(imgRequest)); + if (NS_SUCCEEDED(rv) && imgRequest) { + nsCOMPtr imgContainer; + rv = imgRequest->GetImage(getter_AddRefs(imgContainer)); + if (NS_SUCCEEDED(rv) && imgContainer && + imgContainer->GetType() == imgIContainer::TYPE_RASTER) { + return true; + } + } + + return false; +} + +ImageBitmap::ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData, + bool aIsPremultipliedAlpha /* = true */) + : mParent(aGlobal) + , mData(aData) + , mSurface(nullptr) + , mDataWrapper(new ImageUtils(mData)) + , mPictureRect(0, 0, aData->GetSize().width, aData->GetSize().height) + , mIsPremultipliedAlpha(aIsPremultipliedAlpha) + , mIsCroppingAreaOutSideOfSourceImage(false) +{ + MOZ_ASSERT(aData, "aData is null in ImageBitmap constructor."); +} + +ImageBitmap::~ImageBitmap() +{ +} + +JSObject* +ImageBitmap::WrapObject(JSContext* aCx, JS::Handle aGivenProto) +{ + return ImageBitmapBinding::Wrap(aCx, this, aGivenProto); +} + +void +ImageBitmap::Close() +{ + mData = nullptr; + mSurface = nullptr; + mPictureRect.SetEmpty(); +} + +void +ImageBitmap::SetPictureRect(const IntRect& aRect, ErrorResult& aRv) +{ + mPictureRect = FixUpNegativeDimension(aRect, aRv); +} + +void +ImageBitmap::SetIsCroppingAreaOutSideOfSourceImage(const IntSize& aSourceSize, + const Maybe& aCroppingRect) +{ + // No cropping at all. + if (aCroppingRect.isNothing()) { + mIsCroppingAreaOutSideOfSourceImage = false; + return; + } + + if (aCroppingRect->X() < 0 || aCroppingRect->Y() < 0 || + aCroppingRect->Width() > aSourceSize.width || + aCroppingRect->Height() > aSourceSize.height) { + mIsCroppingAreaOutSideOfSourceImage = true; + } +} + +static already_AddRefed +ConvertColorFormatIfNeeded(RefPtr aSurface) +{ + const SurfaceFormat srcFormat = aSurface->GetFormat(); + if (srcFormat == SurfaceFormat::R8G8B8A8 || + srcFormat == SurfaceFormat::B8G8R8A8 || + srcFormat == SurfaceFormat::R8G8B8X8 || + srcFormat == SurfaceFormat::B8G8R8X8 || + srcFormat == SurfaceFormat::A8R8G8B8 || + srcFormat == SurfaceFormat::X8R8G8B8) { + return aSurface.forget(); + } + + if (srcFormat == SurfaceFormat::A8 || + srcFormat == SurfaceFormat::Depth) { + return nullptr; + } + + const int bytesPerPixel = BytesPerPixel(SurfaceFormat::B8G8R8A8); + const IntSize dstSize = aSurface->GetSize(); + const uint32_t dstStride = dstSize.width * bytesPerPixel; + + RefPtr dstDataSurface = + Factory::CreateDataSourceSurfaceWithStride(dstSize, + SurfaceFormat::B8G8R8A8, + dstStride); + + RefPtr srcDataSurface = aSurface->GetDataSurface(); + if (NS_WARN_IF(!srcDataSurface)) { + return nullptr; + } + + DataSourceSurface::ScopedMap srcMap(srcDataSurface, DataSourceSurface::READ); + DataSourceSurface::ScopedMap dstMap(dstDataSurface, DataSourceSurface::WRITE); + if (NS_WARN_IF(!srcMap.IsMapped()) || NS_WARN_IF(!dstMap.IsMapped())) { + return nullptr; + } + + int rv = 0; + if (srcFormat == SurfaceFormat::R8G8B8) { + rv = RGB24ToBGRA32(srcMap.GetData(), srcMap.GetStride(), + dstMap.GetData(), dstMap.GetStride(), + dstSize.width, dstSize.height); + } else if (srcFormat == SurfaceFormat::B8G8R8) { + rv = BGR24ToBGRA32(srcMap.GetData(), srcMap.GetStride(), + dstMap.GetData(), dstMap.GetStride(), + dstSize.width, dstSize.height); + } else if (srcFormat == SurfaceFormat::HSV) { + rv = HSVToBGRA32((const float*)srcMap.GetData(), srcMap.GetStride(), + dstMap.GetData(), dstMap.GetStride(), + dstSize.width, dstSize.height); + } else if (srcFormat == SurfaceFormat::Lab) { + rv = LabToBGRA32((const float*)srcMap.GetData(), srcMap.GetStride(), + dstMap.GetData(), dstMap.GetStride(), + dstSize.width, dstSize.height); + } + + if (NS_WARN_IF(rv != 0)) { + return nullptr; + } + + return dstDataSurface.forget(); +} + +/* + * The functionality of PrepareForDrawTarget method: + * (1) Get a SourceSurface from the mData (which is a layers::Image). + * (2) Convert the SourceSurface to format B8G8R8A8 if the original format is + * R8G8B8, B8G8R8, HSV or Lab. + * Note: if the original format is A8 or Depth, then return null directly. + * (3) Do cropping if the size of SourceSurface does not equal to the + * mPictureRect. + * (4) Pre-multiply alpha if needed. + */ +already_AddRefed +ImageBitmap::PrepareForDrawTarget(gfx::DrawTarget* aTarget) +{ + MOZ_ASSERT(aTarget); + + if (!mData) { + return nullptr; + } + + if (!mSurface) { + mSurface = mData->GetAsSourceSurface(); + + if (!mSurface) { + return nullptr; + } + } + + // Check if we need to convert the format. + // Convert R8G8B8/B8G8R8/HSV/Lab to B8G8R8A8. + // Return null if the original format is A8 or Depth. + mSurface = ConvertColorFormatIfNeeded(mSurface); + if (NS_WARN_IF(!mSurface)) { + return nullptr; + } + + RefPtr target = aTarget; + IntRect surfRect(0, 0, mSurface->GetSize().width, mSurface->GetSize().height); + + // Check if we still need to crop our surface + if (!mPictureRect.IsEqualEdges(surfRect)) { + + IntRect surfPortion = surfRect.Intersect(mPictureRect); + + // the crop lies entirely outside the surface area, nothing to draw + if (surfPortion.IsEmpty()) { + mSurface = nullptr; + RefPtr surface(mSurface); + return surface.forget(); + } + + IntPoint dest(std::max(0, surfPortion.X() - mPictureRect.X()), + std::max(0, surfPortion.Y() - mPictureRect.Y())); + + // We must initialize this target with mPictureRect.Size() because the + // specification states that if the cropping area is given, then return an + // ImageBitmap with the size equals to the cropping area. + target = target->CreateSimilarDrawTarget(mPictureRect.Size(), + target->GetFormat()); + + if (!target) { + mSurface = nullptr; + RefPtr surface(mSurface); + return surface.forget(); + } + + target->CopySurface(mSurface, surfPortion, dest); + mSurface = target->Snapshot(); + + // Make mCropRect match new surface we've cropped to + mPictureRect.MoveTo(0, 0); + } + + // Pre-multiply alpha here. + // Apply pre-multiply alpha only if mIsPremultipliedAlpha is false. + // Ignore this step if the source surface does not have alpha channel; this + // kind of source surfaces might come form layers::PlanarYCbCrImage. + if (!mIsPremultipliedAlpha && + mSurface->GetFormat() != SurfaceFormat::B8G8R8X8 && + mSurface->GetFormat() != SurfaceFormat::R8G8B8X8 && + mSurface->GetFormat() != SurfaceFormat::X8R8G8B8) { + MOZ_ASSERT(mSurface->GetFormat() == SurfaceFormat::R8G8B8A8 || + mSurface->GetFormat() == SurfaceFormat::B8G8R8A8 || + mSurface->GetFormat() == SurfaceFormat::A8R8G8B8); + + RefPtr dstSurface = mSurface->GetDataSurface(); + MOZ_ASSERT(dstSurface); + + RefPtr srcSurface; + DataSourceSurface::MappedSurface srcMap; + DataSourceSurface::MappedSurface dstMap; + + if (!dstSurface->Map(DataSourceSurface::MapType::READ_WRITE, &dstMap)) { + srcSurface = dstSurface; + if (!srcSurface->Map(DataSourceSurface::READ, &srcMap)) { + gfxCriticalError() << "Failed to map source surface for premultiplying alpha."; + return nullptr; + } + + dstSurface = Factory::CreateDataSourceSurface(srcSurface->GetSize(), srcSurface->GetFormat()); + + if (!dstSurface || !dstSurface->Map(DataSourceSurface::MapType::WRITE, &dstMap)) { + gfxCriticalError() << "Failed to map destination surface for premultiplying alpha."; + srcSurface->Unmap(); + return nullptr; + } + } + + uint8_t rIndex = 0; + uint8_t gIndex = 0; + uint8_t bIndex = 0; + uint8_t aIndex = 0; + + if (mSurface->GetFormat() == SurfaceFormat::R8G8B8A8) { + rIndex = 0; + gIndex = 1; + bIndex = 2; + aIndex = 3; + } else if (mSurface->GetFormat() == SurfaceFormat::B8G8R8A8) { + rIndex = 2; + gIndex = 1; + bIndex = 0; + aIndex = 3; + } else if (mSurface->GetFormat() == SurfaceFormat::A8R8G8B8) { + rIndex = 1; + gIndex = 2; + bIndex = 3; + aIndex = 0; + } + + for (int i = 0; i < dstSurface->GetSize().height; ++i) { + uint8_t* bufferPtr = dstMap.mData + dstMap.mStride * i; + uint8_t* srcBufferPtr = srcSurface ? srcMap.mData + srcMap.mStride * i : bufferPtr; + for (int i = 0; i < dstSurface->GetSize().width; ++i) { + uint8_t r = *(srcBufferPtr+rIndex); + uint8_t g = *(srcBufferPtr+gIndex); + uint8_t b = *(srcBufferPtr+bIndex); + uint8_t a = *(srcBufferPtr+aIndex); + + *(bufferPtr+rIndex) = gfxUtils::sPremultiplyTable[a * 256 + r]; + *(bufferPtr+gIndex) = gfxUtils::sPremultiplyTable[a * 256 + g]; + *(bufferPtr+bIndex) = gfxUtils::sPremultiplyTable[a * 256 + b]; + *(bufferPtr+aIndex) = a; + + bufferPtr += 4; + srcBufferPtr += 4; + } + } + + dstSurface->Unmap(); + if (srcSurface) { + srcSurface->Unmap(); + } + + mSurface = dstSurface; + } + + // Replace our surface with one optimized for the target we're about to draw + // to, under the assumption it'll likely be drawn again to that target. + // This call should be a no-op for already-optimized surfaces + mSurface = target->OptimizeSourceSurface(mSurface); + + RefPtr surface(mSurface); + return surface.forget(); +} + +already_AddRefed +ImageBitmap::TransferAsImage() +{ + RefPtr image = mData; + Close(); + return image.forget(); +} + +UniquePtr +ImageBitmap::ToCloneData() const +{ + UniquePtr result(new ImageBitmapCloneData()); + result->mPictureRect = mPictureRect; + result->mIsPremultipliedAlpha = mIsPremultipliedAlpha; + result->mIsCroppingAreaOutSideOfSourceImage = mIsCroppingAreaOutSideOfSourceImage; + RefPtr surface = mData->GetAsSourceSurface(); + result->mSurface = surface->GetDataSurface(); + MOZ_ASSERT(result->mSurface); + + return Move(result); +} + +/* static */ already_AddRefed +ImageBitmap::CreateFromCloneData(nsIGlobalObject* aGlobal, + ImageBitmapCloneData* aData) +{ + RefPtr data = CreateImageFromSurface(aData->mSurface); + + RefPtr ret = new ImageBitmap(aGlobal, data, + aData->mIsPremultipliedAlpha); + + ret->mIsCroppingAreaOutSideOfSourceImage = + aData->mIsCroppingAreaOutSideOfSourceImage; + + ErrorResult rv; + ret->SetPictureRect(aData->mPictureRect, rv); + return ret.forget(); +} + +/* static */ already_AddRefed +ImageBitmap::CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal, + OffscreenCanvas& aOffscreenCanvas, + ErrorResult& aRv) +{ + // Check origin-clean. + if (aOffscreenCanvas.IsWriteOnly()) { + aRv.Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + nsLayoutUtils::SurfaceFromElementResult res = + nsLayoutUtils::SurfaceFromOffscreenCanvas(&aOffscreenCanvas, + nsLayoutUtils::SFE_WANT_FIRST_FRAME); + + RefPtr surface = res.GetSourceSurface(); + + if (NS_WARN_IF(!surface)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + RefPtr data = + CreateImageFromSurface(surface); + + RefPtr ret = new ImageBitmap(aGlobal, data); + return ret.forget(); +} + +/* static */ already_AddRefed +ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLImageElement& aImageEl, + const Maybe& aCropRect, ErrorResult& aRv) +{ + // Check if the image element is completely available or not. + if (!aImageEl.Complete()) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Check if the image element is a bitmap (e.g. it's a vector graphic) or not. + if (!HasRasterImage(aImageEl)) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Get the SourceSurface out from the image element and then do security + // checking. + RefPtr surface = GetSurfaceFromElement(aGlobal, aImageEl, aRv); + + if (NS_WARN_IF(aRv.Failed())) { + return nullptr; + } + + // Create ImageBitmap. + RefPtr data = CreateImageFromSurface(surface); + + if (NS_WARN_IF(!data)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + RefPtr ret = new ImageBitmap(aGlobal, data); + + // Set the picture rectangle. + if (ret && aCropRect.isSome()) { + ret->SetPictureRect(aCropRect.ref(), aRv); + } + + // Set mIsCroppingAreaOutSideOfSourceImage. + ret->SetIsCroppingAreaOutSideOfSourceImage(surface->GetSize(), aCropRect); + + return ret.forget(); +} + +/* static */ already_AddRefed +ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl, + const Maybe& aCropRect, ErrorResult& aRv) +{ + aVideoEl.MarkAsContentSource(mozilla::dom::HTMLVideoElement::CallerAPI::CREATE_IMAGEBITMAP); + + // Check network state. + if (aVideoEl.NetworkState() == HTMLMediaElement::NETWORK_EMPTY) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Check ready state. + // Cannot be HTMLMediaElement::HAVE_NOTHING or HTMLMediaElement::HAVE_METADATA. + if (aVideoEl.ReadyState() <= HTMLMediaElement::HAVE_METADATA) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Check security. + nsCOMPtr principal = aVideoEl.GetCurrentVideoPrincipal(); + bool CORSUsed = aVideoEl.GetCORSMode() != CORS_NONE; + if (!CheckSecurityForHTMLElements(false, CORSUsed, principal)) { + aRv.Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + // Create ImageBitmap. + ImageContainer *container = aVideoEl.GetImageContainer(); + + if (!container) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + AutoLockImage lockImage(container); + layers::Image* data = lockImage.GetImage(); + if (!data) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + RefPtr ret = new ImageBitmap(aGlobal, data); + + // Set the picture rectangle. + if (ret && aCropRect.isSome()) { + ret->SetPictureRect(aCropRect.ref(), aRv); + } + + // Set mIsCroppingAreaOutSideOfSourceImage. + ret->SetIsCroppingAreaOutSideOfSourceImage(data->GetSize(), aCropRect); + + return ret.forget(); +} + +/* static */ already_AddRefed +ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvasEl, + const Maybe& aCropRect, ErrorResult& aRv) +{ + if (aCanvasEl.Width() == 0 || aCanvasEl.Height() == 0) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + RefPtr surface = GetSurfaceFromElement(aGlobal, aCanvasEl, aRv); + + if (NS_WARN_IF(aRv.Failed())) { + return nullptr; + } + + // Crop the source surface if needed. + RefPtr croppedSurface; + IntRect cropRect = aCropRect.valueOr(IntRect()); + + // If the HTMLCanvasElement's rendering context is WebGL, then the snapshot + // we got from the HTMLCanvasElement is a DataSourceSurface which is a copy + // of the rendering context. We handle cropping in this case. + if ((aCanvasEl.GetCurrentContextType() == CanvasContextType::WebGL1 || + aCanvasEl.GetCurrentContextType() == CanvasContextType::WebGL2) && + aCropRect.isSome()) { + // The _surface_ must be a DataSourceSurface. + MOZ_ASSERT(surface->GetType() == SurfaceType::DATA, + "The snapshot SourceSurface from WebGL rendering contest is not \ + DataSourceSurface."); + RefPtr dataSurface = surface->GetDataSurface(); + croppedSurface = CropAndCopyDataSourceSurface(dataSurface, cropRect); + cropRect.MoveTo(0, 0); + } + else { + croppedSurface = surface; + } + + if (NS_WARN_IF(!croppedSurface)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + // Create an Image from the SourceSurface. + RefPtr data = CreateImageFromSurface(croppedSurface); + + if (NS_WARN_IF(!data)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + RefPtr ret = new ImageBitmap(aGlobal, data); + + // Set the picture rectangle. + if (ret && aCropRect.isSome()) { + ret->SetPictureRect(cropRect, aRv); + } + + // Set mIsCroppingAreaOutSideOfSourceImage. + ret->SetIsCroppingAreaOutSideOfSourceImage(surface->GetSize(), aCropRect); + + return ret.forget(); +} + +/* static */ already_AddRefed +ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData, + const Maybe& aCropRect, ErrorResult& aRv) +{ + // Copy data into SourceSurface. + dom::Uint8ClampedArray array; + DebugOnly inited = array.Init(aImageData.GetDataObject()); + MOZ_ASSERT(inited); + + array.ComputeLengthAndData(); + const SurfaceFormat FORMAT = SurfaceFormat::R8G8B8A8; + const uint32_t BYTES_PER_PIXEL = BytesPerPixel(FORMAT); + const uint32_t imageWidth = aImageData.Width(); + const uint32_t imageHeight = aImageData.Height(); + const uint32_t imageStride = imageWidth * BYTES_PER_PIXEL; + const uint32_t dataLength = array.Length(); + const gfx::IntSize imageSize(imageWidth, imageHeight); + + // Check the ImageData is neutered or not. + if (imageWidth == 0 || imageHeight == 0 || + (imageWidth * imageHeight * BYTES_PER_PIXEL) != dataLength) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Create and Crop the raw data into a layers::Image + RefPtr data; + if (NS_IsMainThread()) { + data = CreateImageFromRawData(imageSize, imageStride, FORMAT, + array.Data(), dataLength, + aCropRect); + } else { + RefPtr task + = new CreateImageFromRawDataInMainThreadSyncTask(array.Data(), + dataLength, + imageStride, + FORMAT, + imageSize, + aCropRect, + getter_AddRefs(data)); + task->Dispatch(aRv); + } + + if (NS_WARN_IF(!data)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + // Create an ImageBimtap. + // ImageData's underlying data is not alpha-premultiplied. + RefPtr ret = new ImageBitmap(aGlobal, data, false); + + // The cropping information has been handled in the CreateImageFromRawData() + // function. + + // Set mIsCroppingAreaOutSideOfSourceImage. + ret->SetIsCroppingAreaOutSideOfSourceImage(imageSize, aCropRect); + + return ret.forget(); +} + +/* static */ already_AddRefed +ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, CanvasRenderingContext2D& aCanvasCtx, + const Maybe& aCropRect, ErrorResult& aRv) +{ + // Check origin-clean. + if (aCanvasCtx.GetCanvas()->IsWriteOnly()) { + aRv.Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + RefPtr surface = aCanvasCtx.GetSurfaceSnapshot(); + + if (NS_WARN_IF(!surface)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + const IntSize surfaceSize = surface->GetSize(); + if (surfaceSize.width == 0 || surfaceSize.height == 0) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + RefPtr data = CreateImageFromSurface(surface); + + if (NS_WARN_IF(!data)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + RefPtr ret = new ImageBitmap(aGlobal, data); + + // Set the picture rectangle. + if (ret && aCropRect.isSome()) { + ret->SetPictureRect(aCropRect.ref(), aRv); + } + + // Set mIsCroppingAreaOutSideOfSourceImage. + ret->SetIsCroppingAreaOutSideOfSourceImage(surface->GetSize(), aCropRect); + + return ret.forget(); +} + +/* static */ already_AddRefed +ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageBitmap& aImageBitmap, + const Maybe& aCropRect, ErrorResult& aRv) +{ + if (!aImageBitmap.mData) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + RefPtr data = aImageBitmap.mData; + RefPtr ret = new ImageBitmap(aGlobal, data, aImageBitmap.mIsPremultipliedAlpha); + + // Set the picture rectangle. + if (ret && aCropRect.isSome()) { + ret->SetPictureRect(aCropRect.ref(), aRv); + } + + // Set mIsCroppingAreaOutSideOfSourceImage. + if (aImageBitmap.mIsCroppingAreaOutSideOfSourceImage == true) { + ret->mIsCroppingAreaOutSideOfSourceImage = true; + } else { + ret->SetIsCroppingAreaOutSideOfSourceImage(aImageBitmap.mPictureRect.Size(), + aCropRect); + } + + return ret.forget(); +} + +class FulfillImageBitmapPromise +{ +protected: + FulfillImageBitmapPromise(Promise* aPromise, ImageBitmap* aImageBitmap) + : mPromise(aPromise) + , mImageBitmap(aImageBitmap) + { + MOZ_ASSERT(aPromise); + } + + void DoFulfillImageBitmapPromise() + { + mPromise->MaybeResolve(mImageBitmap); + } + +private: + RefPtr mPromise; + RefPtr mImageBitmap; +}; + +class FulfillImageBitmapPromiseTask final : public Runnable, + public FulfillImageBitmapPromise +{ +public: + FulfillImageBitmapPromiseTask(Promise* aPromise, ImageBitmap* aImageBitmap) + : FulfillImageBitmapPromise(aPromise, aImageBitmap) + { + } + + NS_IMETHOD Run() override + { + DoFulfillImageBitmapPromise(); + return NS_OK; + } +}; + +class FulfillImageBitmapPromiseWorkerTask final : public WorkerSameThreadRunnable, + public FulfillImageBitmapPromise +{ +public: + FulfillImageBitmapPromiseWorkerTask(Promise* aPromise, ImageBitmap* aImageBitmap) + : WorkerSameThreadRunnable(GetCurrentThreadWorkerPrivate()), + FulfillImageBitmapPromise(aPromise, aImageBitmap) + { + } + + bool WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override + { + DoFulfillImageBitmapPromise(); + return true; + } +}; + +static void +AsyncFulfillImageBitmapPromise(Promise* aPromise, ImageBitmap* aImageBitmap) +{ + if (NS_IsMainThread()) { + nsCOMPtr task = + new FulfillImageBitmapPromiseTask(aPromise, aImageBitmap); + NS_DispatchToCurrentThread(task); // Actually, to the main-thread. + } else { + RefPtr task = + new FulfillImageBitmapPromiseWorkerTask(aPromise, aImageBitmap); + task->Dispatch(); // Actually, to the current worker-thread. + } +} + +static already_AddRefed +DecodeBlob(Blob& aBlob) +{ + // Get the internal stream of the blob. + nsCOMPtr stream; + ErrorResult error; + aBlob.Impl()->GetInternalStream(getter_AddRefs(stream), error); + if (NS_WARN_IF(error.Failed())) { + error.SuppressException(); + return nullptr; + } + + // Get the MIME type string of the blob. + // The type will be checked in the DecodeImage() method. + nsAutoString mimeTypeUTF16; + aBlob.GetType(mimeTypeUTF16); + + // Get the Component object. + nsCOMPtr imgtool = do_GetService(NS_IMGTOOLS_CID); + if (NS_WARN_IF(!imgtool)) { + return nullptr; + } + + // Decode image. + NS_ConvertUTF16toUTF8 mimeTypeUTF8(mimeTypeUTF16); // NS_ConvertUTF16toUTF8 ---|> nsAutoCString + nsCOMPtr imgContainer; + nsresult rv = imgtool->DecodeImage(stream, mimeTypeUTF8, getter_AddRefs(imgContainer)); + if (NS_WARN_IF(NS_FAILED(rv))) { + return nullptr; + } + + // Get the surface out. + uint32_t frameFlags = imgIContainer::FLAG_SYNC_DECODE | imgIContainer::FLAG_WANT_DATA_SURFACE; + uint32_t whichFrame = imgIContainer::FRAME_FIRST; + RefPtr surface = imgContainer->GetFrame(whichFrame, frameFlags); + + if (NS_WARN_IF(!surface)) { + return nullptr; + } + + return surface.forget(); +} + +static already_AddRefed +DecodeAndCropBlob(Blob& aBlob, Maybe& aCropRect, + /*Output*/ IntSize& sourceSize) +{ + // Decode the blob into a SourceSurface. + RefPtr surface = DecodeBlob(aBlob); + + if (NS_WARN_IF(!surface)) { + return nullptr; + } + + // Set the _sourceSize_ output parameter. + sourceSize = surface->GetSize(); + + // Crop the source surface if needed. + RefPtr croppedSurface = surface; + + if (aCropRect.isSome()) { + // The blob is just decoded into a RasterImage and not optimized yet, so the + // _surface_ we get is a DataSourceSurface which wraps the RasterImage's + // raw buffer. + // + // The _surface_ might already be optimized so that its type is not + // SurfaceType::DATA. However, we could keep using the generic cropping and + // copying since the decoded buffer is only used in this ImageBitmap so we + // should crop it to save memory usage. + // + // TODO: Bug1189632 is going to refactor this create-from-blob part to + // decode the blob off the main thread. Re-check if we should do + // cropping at this moment again there. + RefPtr dataSurface = surface->GetDataSurface(); + croppedSurface = CropAndCopyDataSourceSurface(dataSurface, aCropRect.ref()); + aCropRect->MoveTo(0, 0); + } + + if (NS_WARN_IF(!croppedSurface)) { + return nullptr; + } + + // Create an Image from the source surface. + RefPtr image = CreateImageFromSurface(croppedSurface); + + if (NS_WARN_IF(!image)) { + return nullptr; + } + + return image.forget(); +} + +class CreateImageBitmapFromBlob +{ +protected: + CreateImageBitmapFromBlob(Promise* aPromise, + nsIGlobalObject* aGlobal, + Blob& aBlob, + const Maybe& aCropRect) + : mPromise(aPromise), + mGlobalObject(aGlobal), + mBlob(&aBlob), + mCropRect(aCropRect) + { + } + + virtual ~CreateImageBitmapFromBlob() + { + } + + // Returns true on success, false on failure. + bool DoCreateImageBitmapFromBlob() + { + RefPtr imageBitmap = CreateImageBitmap(); + + // handle errors while creating ImageBitmap + // (1) error occurs during reading of the object + // (2) the image data is not in a supported file format + // (3) the image data is corrupted + // All these three cases should reject the promise with "InvalidStateError" + // DOMException + if (!imageBitmap) { + return false; + } + + if (imageBitmap && mCropRect.isSome()) { + ErrorResult rv; + imageBitmap->SetPictureRect(mCropRect.ref(), rv); + + if (rv.Failed()) { + mPromise->MaybeReject(rv); + return false; + } + } + + mPromise->MaybeResolve(imageBitmap); + return true; + } + + // Will return null on failure. In that case, mPromise will already + // be rejected with the right thing. + virtual already_AddRefed CreateImageBitmap() = 0; + + RefPtr mPromise; + nsCOMPtr mGlobalObject; + RefPtr mBlob; + Maybe mCropRect; +}; + +class CreateImageBitmapFromBlobTask final : public Runnable, + public CreateImageBitmapFromBlob +{ +public: + CreateImageBitmapFromBlobTask(Promise* aPromise, + nsIGlobalObject* aGlobal, + Blob& aBlob, + const Maybe& aCropRect) + :CreateImageBitmapFromBlob(aPromise, aGlobal, aBlob, aCropRect) + { + } + + NS_IMETHOD Run() override + { + DoCreateImageBitmapFromBlob(); + return NS_OK; + } + +private: + already_AddRefed CreateImageBitmap() override + { + // _sourceSize_ is used to get the original size of the source image, + // before being cropped. + IntSize sourceSize; + + // Keep the orignal cropping rectangle because the mCropRect might be + // modified in DecodeAndCropBlob(). + Maybe originalCropRect = mCropRect; + + RefPtr data = DecodeAndCropBlob(*mBlob, mCropRect, sourceSize); + + if (NS_WARN_IF(!data)) { + mPromise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Create ImageBitmap object. + RefPtr imageBitmap = new ImageBitmap(mGlobalObject, data); + + // Set mIsCroppingAreaOutSideOfSourceImage. + imageBitmap->SetIsCroppingAreaOutSideOfSourceImage(sourceSize, originalCropRect); + + return imageBitmap.forget(); + } +}; + +class CreateImageBitmapFromBlobWorkerTask final : public WorkerSameThreadRunnable, + public CreateImageBitmapFromBlob +{ + // This is a synchronous task. + class DecodeBlobInMainThreadSyncTask final : public WorkerMainThreadRunnable + { + public: + DecodeBlobInMainThreadSyncTask(WorkerPrivate* aWorkerPrivate, + Blob& aBlob, + Maybe& aCropRect, + layers::Image** aImage, + IntSize& aSourceSize) + : WorkerMainThreadRunnable(aWorkerPrivate, + NS_LITERAL_CSTRING("ImageBitmap :: Create Image from Blob")) + , mBlob(aBlob) + , mCropRect(aCropRect) + , mImage(aImage) + , mSourceSize(aSourceSize) + { + } + + bool MainThreadRun() override + { + RefPtr image = DecodeAndCropBlob(mBlob, mCropRect, mSourceSize); + + if (NS_WARN_IF(!image)) { + return true; + } + + image.forget(mImage); + + return true; + } + + private: + Blob& mBlob; + Maybe& mCropRect; + layers::Image** mImage; + IntSize mSourceSize; + }; + +public: + CreateImageBitmapFromBlobWorkerTask(Promise* aPromise, + nsIGlobalObject* aGlobal, + mozilla::dom::Blob& aBlob, + const Maybe& aCropRect) + : WorkerSameThreadRunnable(GetCurrentThreadWorkerPrivate()), + CreateImageBitmapFromBlob(aPromise, aGlobal, aBlob, aCropRect) + { + } + + bool WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override + { + return DoCreateImageBitmapFromBlob(); + } + +private: + already_AddRefed CreateImageBitmap() override + { + // _sourceSize_ is used to get the original size of the source image, + // before being cropped. + IntSize sourceSize; + + // Keep the orignal cropping rectangle because the mCropRect might be + // modified in DecodeAndCropBlob(). + Maybe originalCropRect = mCropRect; + + RefPtr data; + + ErrorResult rv; + RefPtr task = + new DecodeBlobInMainThreadSyncTask(mWorkerPrivate, *mBlob, mCropRect, + getter_AddRefs(data), sourceSize); + task->Dispatch(rv); // This is a synchronous call. + + if (NS_WARN_IF(rv.Failed())) { + // XXXbz does this really make sense if we're shutting down? Ah, well. + mPromise->MaybeReject(rv); + return nullptr; + } + + if (NS_WARN_IF(!data)) { + mPromise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + + // Create ImageBitmap object. + RefPtr imageBitmap = new ImageBitmap(mGlobalObject, data); + + // Set mIsCroppingAreaOutSideOfSourceImage. + imageBitmap->SetIsCroppingAreaOutSideOfSourceImage(sourceSize, originalCropRect); + + return imageBitmap.forget(); + } + +}; + +static void +AsyncCreateImageBitmapFromBlob(Promise* aPromise, nsIGlobalObject* aGlobal, + Blob& aBlob, const Maybe& aCropRect) +{ + if (NS_IsMainThread()) { + nsCOMPtr task = + new CreateImageBitmapFromBlobTask(aPromise, aGlobal, aBlob, aCropRect); + NS_DispatchToCurrentThread(task); // Actually, to the main-thread. + } else { + RefPtr task = + new CreateImageBitmapFromBlobWorkerTask(aPromise, aGlobal, aBlob, aCropRect); + task->Dispatch(); // Actually, to the current worker-thread. + } +} + +/* static */ already_AddRefed +ImageBitmap::Create(nsIGlobalObject* aGlobal, const ImageBitmapSource& aSrc, + const Maybe& aCropRect, ErrorResult& aRv) +{ + MOZ_ASSERT(aGlobal); + + RefPtr promise = Promise::Create(aGlobal, aRv); + + if (NS_WARN_IF(aRv.Failed())) { + return nullptr; + } + + if (aCropRect.isSome() && (aCropRect->Width() == 0 || aCropRect->Height() == 0)) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return promise.forget(); + } + + RefPtr imageBitmap; + + if (aSrc.IsHTMLImageElement()) { + MOZ_ASSERT(NS_IsMainThread(), + "Creating ImageBitmap from HTMLImageElement off the main thread."); + imageBitmap = CreateInternal(aGlobal, aSrc.GetAsHTMLImageElement(), aCropRect, aRv); + } else if (aSrc.IsHTMLVideoElement()) { + MOZ_ASSERT(NS_IsMainThread(), + "Creating ImageBitmap from HTMLVideoElement off the main thread."); + imageBitmap = CreateInternal(aGlobal, aSrc.GetAsHTMLVideoElement(), aCropRect, aRv); + } else if (aSrc.IsHTMLCanvasElement()) { + MOZ_ASSERT(NS_IsMainThread(), + "Creating ImageBitmap from HTMLCanvasElement off the main thread."); + imageBitmap = CreateInternal(aGlobal, aSrc.GetAsHTMLCanvasElement(), aCropRect, aRv); + } else if (aSrc.IsImageData()) { + imageBitmap = CreateInternal(aGlobal, aSrc.GetAsImageData(), aCropRect, aRv); + } else if (aSrc.IsCanvasRenderingContext2D()) { + MOZ_ASSERT(NS_IsMainThread(), + "Creating ImageBitmap from CanvasRenderingContext2D off the main thread."); + imageBitmap = CreateInternal(aGlobal, aSrc.GetAsCanvasRenderingContext2D(), aCropRect, aRv); + } else if (aSrc.IsImageBitmap()) { + imageBitmap = CreateInternal(aGlobal, aSrc.GetAsImageBitmap(), aCropRect, aRv); + } else if (aSrc.IsBlob()) { + AsyncCreateImageBitmapFromBlob(promise, aGlobal, aSrc.GetAsBlob(), aCropRect); + return promise.forget(); + } else { + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + } + + if (!aRv.Failed()) { + AsyncFulfillImageBitmapPromise(promise, imageBitmap); + } + + return promise.forget(); +} + +/*static*/ JSObject* +ImageBitmap::ReadStructuredClone(JSContext* aCx, + JSStructuredCloneReader* aReader, + nsIGlobalObject* aParent, + const nsTArray>& aClonedSurfaces, + uint32_t aIndex) +{ + MOZ_ASSERT(aCx); + MOZ_ASSERT(aReader); + // aParent might be null. + + uint32_t picRectX_; + uint32_t picRectY_; + uint32_t picRectWidth_; + uint32_t picRectHeight_; + uint32_t isPremultipliedAlpha_; + uint32_t isCroppingAreaOutSideOfSourceImage_; + + if (!JS_ReadUint32Pair(aReader, &picRectX_, &picRectY_) || + !JS_ReadUint32Pair(aReader, &picRectWidth_, &picRectHeight_) || + !JS_ReadUint32Pair(aReader, &isPremultipliedAlpha_, + &isCroppingAreaOutSideOfSourceImage_)) { + return nullptr; + } + + int32_t picRectX = BitwiseCast(picRectX_); + int32_t picRectY = BitwiseCast(picRectY_); + int32_t picRectWidth = BitwiseCast(picRectWidth_); + int32_t picRectHeight = BitwiseCast(picRectHeight_); + + // Create a new ImageBitmap. + MOZ_ASSERT(!aClonedSurfaces.IsEmpty()); + MOZ_ASSERT(aIndex < aClonedSurfaces.Length()); + + // RefPtr needs to go out of scope before toObjectOrNull() is + // called because the static analysis thinks dereferencing XPCOM objects + // can GC (because in some cases it can!), and a return statement with a + // JSObject* type means that JSObject* is on the stack as a raw pointer + // while destructors are running. + JS::Rooted value(aCx); + { + RefPtr img = CreateImageFromSurface(aClonedSurfaces[aIndex]); + RefPtr imageBitmap = + new ImageBitmap(aParent, img, isPremultipliedAlpha_); + + imageBitmap->mIsCroppingAreaOutSideOfSourceImage = + isCroppingAreaOutSideOfSourceImage_; + + ErrorResult error; + imageBitmap->SetPictureRect(IntRect(picRectX, picRectY, + picRectWidth, picRectHeight), error); + if (NS_WARN_IF(error.Failed())) { + error.SuppressException(); + return nullptr; + } + + if (!GetOrCreateDOMReflector(aCx, imageBitmap, &value)) { + return nullptr; + } + } + + return &(value.toObject()); +} + +/*static*/ bool +ImageBitmap::WriteStructuredClone(JSStructuredCloneWriter* aWriter, + nsTArray>& aClonedSurfaces, + ImageBitmap* aImageBitmap) +{ + MOZ_ASSERT(aWriter); + MOZ_ASSERT(aImageBitmap); + + const uint32_t picRectX = BitwiseCast(aImageBitmap->mPictureRect.x); + const uint32_t picRectY = BitwiseCast(aImageBitmap->mPictureRect.y); + const uint32_t picRectWidth = BitwiseCast(aImageBitmap->mPictureRect.width); + const uint32_t picRectHeight = BitwiseCast(aImageBitmap->mPictureRect.height); + const uint32_t isPremultipliedAlpha = aImageBitmap->mIsPremultipliedAlpha ? 1 : 0; + const uint32_t isCroppingAreaOutSideOfSourceImage = aImageBitmap->mIsCroppingAreaOutSideOfSourceImage ? 1 : 0; + + // Indexing the cloned surfaces and send the index to the receiver. + uint32_t index = aClonedSurfaces.Length(); + + if (NS_WARN_IF(!JS_WriteUint32Pair(aWriter, SCTAG_DOM_IMAGEBITMAP, index)) || + NS_WARN_IF(!JS_WriteUint32Pair(aWriter, picRectX, picRectY)) || + NS_WARN_IF(!JS_WriteUint32Pair(aWriter, picRectWidth, picRectHeight)) || + NS_WARN_IF(!JS_WriteUint32Pair(aWriter, isPremultipliedAlpha, + isCroppingAreaOutSideOfSourceImage))) { + return false; + } + + RefPtr surface = + aImageBitmap->mData->GetAsSourceSurface(); + RefPtr snapshot = surface->GetDataSurface(); + RefPtr dstDataSurface; + { + // DataSourceSurfaceD2D1::GetStride() will call EnsureMapped implicitly and + // won't Unmap after exiting function. So instead calling GetStride() + // directly, using ScopedMap to get stride. + DataSourceSurface::ScopedMap map(snapshot, DataSourceSurface::READ); + dstDataSurface = + Factory::CreateDataSourceSurfaceWithStride(snapshot->GetSize(), + snapshot->GetFormat(), + map.GetStride(), + true); + } + MOZ_ASSERT(dstDataSurface); + Factory::CopyDataSourceSurface(snapshot, dstDataSurface); + aClonedSurfaces.AppendElement(dstDataSurface); + return true; +} + +/*static*/ bool +ImageBitmap::ExtensionsEnabled(JSContext* aCx, JSObject*) +{ + if (NS_IsMainThread()) { + return Preferences::GetBool("canvas.imagebitmap_extensions.enabled"); + } else { + WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx); + MOZ_ASSERT(workerPrivate); + return workerPrivate->ImageBitmapExtensionsEnabled(); + } +} + +// ImageBitmap extensions. +ImageBitmapFormat +ImageBitmap::FindOptimalFormat(const Optional>& aPossibleFormats, + ErrorResult& aRv) +{ + MOZ_ASSERT(mDataWrapper, "No ImageBitmapFormatUtils functionalities."); + + ImageBitmapFormat platformFormat = mDataWrapper->GetFormat(); + + if (!aPossibleFormats.WasPassed() || + aPossibleFormats.Value().Contains(platformFormat)) { + return platformFormat; + } else { + // If no matching is found, FindBestMatchingFromat() returns + // ImageBitmapFormat::EndGuard_ and we throw an exception. + ImageBitmapFormat optimalFormat = + FindBestMatchingFromat(platformFormat, aPossibleFormats.Value()); + + if (optimalFormat == ImageBitmapFormat::EndGuard_) { + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + } + + return optimalFormat; + } +} + +int32_t +ImageBitmap::MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv) +{ + MOZ_ASSERT(mDataWrapper, "No ImageBitmapFormatUtils functionalities."); + + if (aFormat == mDataWrapper->GetFormat()) { + return mDataWrapper->GetBufferLength(); + } else { + return CalculateImageBufferSize(aFormat, Width(), Height()); + } +} + +template +class MapDataIntoBufferSource +{ +protected: + MapDataIntoBufferSource(JSContext* aCx, + Promise *aPromise, + ImageBitmap *aImageBitmap, + const T& aBuffer, + int32_t aOffset, + ImageBitmapFormat aFormat) + : mPromise(aPromise) + , mImageBitmap(aImageBitmap) + , mBuffer(aCx, aBuffer.Obj()) + , mOffset(aOffset) + , mFormat(aFormat) + { + MOZ_ASSERT(mPromise); + MOZ_ASSERT(JS_IsArrayBufferObject(mBuffer) || + JS_IsArrayBufferViewObject(mBuffer)); + } + + virtual ~MapDataIntoBufferSource() = default; + + void DoMapDataIntoBufferSource() + { + ErrorResult error; + + // Prepare destination buffer. + uint8_t* bufferData = nullptr; + uint32_t bufferLength = 0; + bool isSharedMemory = false; + if (JS_IsArrayBufferObject(mBuffer)) { + js::GetArrayBufferLengthAndData(mBuffer, &bufferLength, &isSharedMemory, &bufferData); + } else if (JS_IsArrayBufferViewObject(mBuffer)) { + js::GetArrayBufferViewLengthAndData(mBuffer, &bufferLength, &isSharedMemory, &bufferData); + } else { + error.Throw(NS_ERROR_NOT_IMPLEMENTED); + mPromise->MaybeReject(error); + return; + } + + if (NS_WARN_IF(!bufferData) || NS_WARN_IF(!bufferLength)) { + error.Throw(NS_ERROR_NOT_AVAILABLE); + mPromise->MaybeReject(error); + return; + } + + // Check length. + const int32_t neededBufferLength = + mImageBitmap->MappedDataLength(mFormat, error); + + if (((int32_t)bufferLength - mOffset) < neededBufferLength) { + error.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + mPromise->MaybeReject(error); + return; + } + + // Call ImageBitmapFormatUtils. + UniquePtr layout = + mImageBitmap->mDataWrapper->MapDataInto(bufferData, + mOffset, + bufferLength, + mFormat, + error); + + if (NS_WARN_IF(!layout)) { + mPromise->MaybeReject(error); + return; + } + + mPromise->MaybeResolve(*layout); + } + + RefPtr mPromise; + RefPtr mImageBitmap; + JS::PersistentRooted mBuffer; + int32_t mOffset; + ImageBitmapFormat mFormat; +}; + +template +class MapDataIntoBufferSourceTask final : public Runnable, + public MapDataIntoBufferSource +{ +public: + MapDataIntoBufferSourceTask(JSContext* aCx, + Promise *aPromise, + ImageBitmap *aImageBitmap, + const T& aBuffer, + int32_t aOffset, + ImageBitmapFormat aFormat) + : MapDataIntoBufferSource(aCx, aPromise, aImageBitmap, aBuffer, aOffset, aFormat) + { + } + + virtual ~MapDataIntoBufferSourceTask() = default; + + NS_IMETHOD Run() override + { + MapDataIntoBufferSource::DoMapDataIntoBufferSource(); + return NS_OK; + } +}; + +template +class MapDataIntoBufferSourceWorkerTask final : public WorkerSameThreadRunnable, + public MapDataIntoBufferSource +{ +public: + MapDataIntoBufferSourceWorkerTask(JSContext* aCx, + Promise *aPromise, + ImageBitmap *aImageBitmap, + const T& aBuffer, + int32_t aOffset, + ImageBitmapFormat aFormat) + : WorkerSameThreadRunnable(GetCurrentThreadWorkerPrivate()), + MapDataIntoBufferSource(aCx, aPromise, aImageBitmap, aBuffer, aOffset, aFormat) + { + } + + virtual ~MapDataIntoBufferSourceWorkerTask() = default; + + bool WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override + { + MapDataIntoBufferSource::DoMapDataIntoBufferSource(); + return true; + } +}; + +void AsyncMapDataIntoBufferSource(JSContext* aCx, + Promise *aPromise, + ImageBitmap *aImageBitmap, + const ArrayBufferViewOrArrayBuffer& aBuffer, + int32_t aOffset, + ImageBitmapFormat aFormat) +{ + MOZ_ASSERT(aCx); + MOZ_ASSERT(aPromise); + MOZ_ASSERT(aImageBitmap); + + if (NS_IsMainThread()) { + nsCOMPtr task; + + if (aBuffer.IsArrayBuffer()) { + const ArrayBuffer& buffer = aBuffer.GetAsArrayBuffer(); + task = new MapDataIntoBufferSourceTask(aCx, aPromise, aImageBitmap, buffer, aOffset, aFormat); + } else if (aBuffer.IsArrayBufferView()) { + const ArrayBufferView& bufferView = aBuffer.GetAsArrayBufferView(); + task = new MapDataIntoBufferSourceTask(aCx, aPromise, aImageBitmap, bufferView, aOffset, aFormat); + } + + NS_DispatchToCurrentThread(task); // Actually, to the main-thread. + } else { + RefPtr task; + + if (aBuffer.IsArrayBuffer()) { + const ArrayBuffer& buffer = aBuffer.GetAsArrayBuffer(); + task = new MapDataIntoBufferSourceWorkerTask(aCx, aPromise, aImageBitmap, buffer, aOffset, aFormat); + } else if (aBuffer.IsArrayBufferView()) { + const ArrayBufferView& bufferView = aBuffer.GetAsArrayBufferView(); + task = new MapDataIntoBufferSourceWorkerTask(aCx, aPromise, aImageBitmap, bufferView, aOffset, aFormat); + } + + task->Dispatch(); // Actually, to the current worker-thread. + } +} + +already_AddRefed +ImageBitmap::MapDataInto(JSContext* aCx, + ImageBitmapFormat aFormat, + const ArrayBufferViewOrArrayBuffer& aBuffer, + int32_t aOffset, ErrorResult& aRv) +{ + MOZ_ASSERT(mDataWrapper, "No ImageBitmapFormatUtils functionalities."); + MOZ_ASSERT(aCx, "No JSContext while calling ImageBitmap::MapDataInto()."); + + RefPtr promise = Promise::Create(mParent, aRv); + + if (NS_WARN_IF(aRv.Failed())) { + return nullptr; + } + + // Check for cases that should throws. + // Case 1: + // If image bitmap was cropped to the source rectangle so that it contains any + // transparent black pixels (cropping area is outside of the source image), + // then reject promise with IndexSizeError and abort these steps. + if (mIsCroppingAreaOutSideOfSourceImage) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return promise.forget(); + } + + // Case 2: + // If the image bitmap is going to be accessed in YUV422/YUV422 series with a + // cropping area starts at an odd x or y coordinate. + if (aFormat == ImageBitmapFormat::YUV422P || + aFormat == ImageBitmapFormat::YUV420P || + aFormat == ImageBitmapFormat::YUV420SP_NV12 || + aFormat == ImageBitmapFormat::YUV420SP_NV21) { + if ((mPictureRect.x & 1) || (mPictureRect.y & 1)) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return promise.forget(); + } + } + + AsyncMapDataIntoBufferSource(aCx, promise, this, aBuffer, aOffset, aFormat); + return promise.forget(); +} + +// ImageBitmapFactories extensions. +static SurfaceFormat +ImageFormatToSurfaceFromat(mozilla::dom::ImageBitmapFormat aFormat) +{ + switch(aFormat) { + case ImageBitmapFormat::RGBA32: + return SurfaceFormat::R8G8B8A8; + case ImageBitmapFormat::BGRA32: + return SurfaceFormat::B8G8R8A8; + case ImageBitmapFormat::RGB24: + return SurfaceFormat::R8G8B8; + case ImageBitmapFormat::BGR24: + return SurfaceFormat::B8G8R8; + case ImageBitmapFormat::GRAY8: + return SurfaceFormat::A8; + case ImageBitmapFormat::HSV: + return SurfaceFormat::HSV; + case ImageBitmapFormat::Lab: + return SurfaceFormat::Lab; + case ImageBitmapFormat::DEPTH: + return SurfaceFormat::Depth; + default: + return SurfaceFormat::UNKNOWN; + } +} + +static already_AddRefed +CreateImageFromBufferSourceRawData(const uint8_t*aBufferData, + uint32_t aBufferLength, + mozilla::dom::ImageBitmapFormat aFormat, + const Sequence& aLayout) +{ + MOZ_ASSERT(aBufferData); + MOZ_ASSERT(aBufferLength > 0); + + switch(aFormat) { + case ImageBitmapFormat::RGBA32: + case ImageBitmapFormat::BGRA32: + case ImageBitmapFormat::RGB24: + case ImageBitmapFormat::BGR24: + case ImageBitmapFormat::GRAY8: + case ImageBitmapFormat::HSV: + case ImageBitmapFormat::Lab: + case ImageBitmapFormat::DEPTH: + { + const nsTArray& channels = aLayout; + MOZ_ASSERT(channels.Length() != 0, "Empty Channels."); + + const SurfaceFormat srcFormat = ImageFormatToSurfaceFromat(aFormat); + const uint32_t srcStride = channels[0].mStride; + const IntSize srcSize(channels[0].mWidth, channels[0].mHeight); + + RefPtr dstDataSurface = + Factory::CreateDataSourceSurfaceWithStride(srcSize, srcFormat, srcStride); + + if (NS_WARN_IF(!dstDataSurface)) { + return nullptr; + } + + // Copy the raw data into the newly created DataSourceSurface. + DataSourceSurface::ScopedMap dstMap(dstDataSurface, DataSourceSurface::WRITE); + if (NS_WARN_IF(!dstMap.IsMapped())) { + return nullptr; + } + + const uint8_t* srcBufferPtr = aBufferData; + uint8_t* dstBufferPtr = dstMap.GetData(); + + for (int i = 0; i < srcSize.height; ++i) { + memcpy(dstBufferPtr, srcBufferPtr, srcStride); + srcBufferPtr += srcStride; + dstBufferPtr += dstMap.GetStride(); + } + + // Create an Image from the BGRA SourceSurface. + RefPtr surface = dstDataSurface; + RefPtr image = CreateImageFromSurface(surface); + + if (NS_WARN_IF(!image)) { + return nullptr; + } + + return image.forget(); + } + case ImageBitmapFormat::YUV444P: + case ImageBitmapFormat::YUV422P: + case ImageBitmapFormat::YUV420P: + case ImageBitmapFormat::YUV420SP_NV12: + case ImageBitmapFormat::YUV420SP_NV21: + { + // Prepare the PlanarYCbCrData. + const ChannelPixelLayout& yLayout = aLayout[0]; + const ChannelPixelLayout& uLayout = aFormat != ImageBitmapFormat::YUV420SP_NV21 ? aLayout[1] : aLayout[2]; + const ChannelPixelLayout& vLayout = aFormat != ImageBitmapFormat::YUV420SP_NV21 ? aLayout[2] : aLayout[1]; + + layers::PlanarYCbCrData data; + + // Luminance buffer + data.mYChannel = const_cast(aBufferData + yLayout.mOffset); + data.mYStride = yLayout.mStride; + data.mYSize = gfx::IntSize(yLayout.mWidth, yLayout.mHeight); + data.mYSkip = yLayout.mSkip; + + // Chroma buffers + data.mCbChannel = const_cast(aBufferData + uLayout.mOffset); + data.mCrChannel = const_cast(aBufferData + vLayout.mOffset); + data.mCbCrStride = uLayout.mStride; + data.mCbCrSize = gfx::IntSize(uLayout.mWidth, uLayout.mHeight); + data.mCbSkip = uLayout.mSkip; + data.mCrSkip = vLayout.mSkip; + + // Picture rectangle. + // We set the picture rectangle to exactly the size of the source image to + // keep the full original data. + data.mPicX = 0; + data.mPicY = 0; + data.mPicSize = data.mYSize; + + // Create a layers::Image and set data. + if (aFormat == ImageBitmapFormat::YUV444P || + aFormat == ImageBitmapFormat::YUV422P || + aFormat == ImageBitmapFormat::YUV420P) { + RefPtr image = + new layers::RecyclingPlanarYCbCrImage(new layers::BufferRecycleBin()); + + if (NS_WARN_IF(!image)) { + return nullptr; + } + + // Set Data. + if (NS_WARN_IF(!image->CopyData(data))) { + return nullptr; + } + + return image.forget(); + } else { + RefPtrimage = new layers::NVImage(); + + if (NS_WARN_IF(!image)) { + return nullptr; + } + + // Set Data. + if (NS_WARN_IF(!image->SetData(data))) { + return nullptr; + } + + return image.forget(); + } + } + default: + return nullptr; + } +} + +/* + * This is a synchronous task. + * This class is used to create a layers::CairoImage from raw data in the main + * thread. While creating an ImageBitmap from an BufferSource, we need to create + * a SouceSurface from the BufferSource raw data and then set the SourceSurface + * into a layers::CairoImage. However, the layers::CairoImage asserts the + * setting operation in the main thread, so if we are going to create an + * ImageBitmap from an BufferSource off the main thread, we post an event to the + * main thread to create a layers::CairoImage from an BufferSource raw data. + * + * TODO: Once the layers::CairoImage is constructible off the main thread, which + * means the SouceSurface could be released anywhere, we do not need this + * task anymore. + */ +class CreateImageFromBufferSourceRawDataInMainThreadSyncTask final : + public WorkerMainThreadRunnable +{ +public: + CreateImageFromBufferSourceRawDataInMainThreadSyncTask(const uint8_t* aBuffer, + uint32_t aBufferLength, + mozilla::dom::ImageBitmapFormat aFormat, + const Sequence& aLayout, + /*output*/ layers::Image** aImage) + : WorkerMainThreadRunnable(GetCurrentThreadWorkerPrivate(), + NS_LITERAL_CSTRING("ImageBitmap-extensions :: Create Image from BufferSource Raw Data")) + , mImage(aImage) + , mBuffer(aBuffer) + , mBufferLength(aBufferLength) + , mFormat(aFormat) + , mLayout(aLayout) + { + MOZ_ASSERT(!(*aImage), "Don't pass an existing Image into CreateImageFromBufferSourceRawDataInMainThreadSyncTask."); + } + + bool MainThreadRun() override + { + RefPtr image = + CreateImageFromBufferSourceRawData(mBuffer, mBufferLength, mFormat, mLayout); + + if (NS_WARN_IF(!image)) { + return true; + } + + image.forget(mImage); + + return true; + } + +private: + layers::Image** mImage; + const uint8_t* mBuffer; + uint32_t mBufferLength; + mozilla::dom::ImageBitmapFormat mFormat; + const Sequence& mLayout; +}; + +/*static*/ already_AddRefed +ImageBitmap::Create(nsIGlobalObject* aGlobal, + const ImageBitmapSource& aBuffer, + int32_t aOffset, int32_t aLength, + mozilla::dom::ImageBitmapFormat aFormat, + const Sequence& aLayout, + ErrorResult& aRv) +{ + MOZ_ASSERT(aGlobal); + + RefPtr promise = Promise::Create(aGlobal, aRv); + + if (NS_WARN_IF(aRv.Failed())) { + return nullptr; + } + + uint8_t* bufferData = nullptr; + uint32_t bufferLength = 0; + + if (aBuffer.IsArrayBuffer()) { + const ArrayBuffer& buffer = aBuffer.GetAsArrayBuffer(); + buffer.ComputeLengthAndData(); + bufferData = buffer.Data(); + bufferLength = buffer.Length(); + } else if (aBuffer.IsArrayBufferView()) { + const ArrayBufferView& bufferView = aBuffer.GetAsArrayBufferView(); + bufferView.ComputeLengthAndData(); + bufferData = bufferView.Data(); + bufferLength = bufferView.Length(); + } else { + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + return promise.forget(); + } + + MOZ_ASSERT(bufferData && bufferLength > 0, "Cannot read data from BufferSource."); + + // Check the buffer. + if (((uint32_t)(aOffset + aLength) > bufferLength)) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return promise.forget(); + } + + // Create and Crop the raw data into a layers::Image + RefPtr data; + if (NS_IsMainThread()) { + data = CreateImageFromBufferSourceRawData(bufferData + aOffset, bufferLength, + aFormat, aLayout); + } else { + RefPtr task = + new CreateImageFromBufferSourceRawDataInMainThreadSyncTask(bufferData + aOffset, + bufferLength, + aFormat, + aLayout, + getter_AddRefs(data)); + task->Dispatch(aRv); + } + + if (NS_WARN_IF(!data)) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return promise.forget(); + } + + // Create an ImageBimtap. + // Assume the data from an external buffer is not alpha-premultiplied. + RefPtr imageBitmap = new ImageBitmap(aGlobal, data, false); + + // We don't need to call SetPictureRect() here because there is no cropping + // supported and the ImageBitmap's mPictureRect is the size of the source + // image in default + + // We don't need to set mIsCroppingAreaOutSideOfSourceImage here because there + // is no cropping supported and the mIsCroppingAreaOutSideOfSourceImage is + // false in default. + + AsyncFulfillImageBitmapPromise(promise, imageBitmap); + + return promise.forget(); +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/ImageBitmap.h b/dom/canvas/ImageBitmap.h new file mode 100644 index 000000000..2119c6bda --- /dev/null +++ b/dom/canvas/ImageBitmap.h @@ -0,0 +1,290 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_ImageBitmap_h +#define mozilla_dom_ImageBitmap_h + +#include "mozilla/Attributes.h" +#include "mozilla/dom/ImageBitmapSource.h" +#include "mozilla/dom/TypedArray.h" +#include "mozilla/gfx/Rect.h" +#include "mozilla/Maybe.h" +#include "mozilla/UniquePtr.h" +#include "nsCycleCollectionParticipant.h" + +struct JSContext; +struct JSStructuredCloneReader; +struct JSStructuredCloneWriter; + +class nsIGlobalObject; + +namespace mozilla { + +class ErrorResult; + +namespace gfx { +class DataSourceSurface; +class DrawTarget; +class SourceSurface; +} + +namespace layers { +class Image; +} + +namespace dom { +class OffscreenCanvas; + +namespace workers { +class WorkerStructuredCloneClosure; +} + +class ArrayBufferViewOrArrayBuffer; +class CanvasRenderingContext2D; +struct ChannelPixelLayout; +class CreateImageBitmapFromBlob; +class CreateImageBitmapFromBlobTask; +class CreateImageBitmapFromBlobWorkerTask; +class File; +class HTMLCanvasElement; +class HTMLImageElement; +class HTMLVideoElement; +enum class ImageBitmapFormat : uint32_t; +class ImageData; +class ImageUtils; +template class MapDataIntoBufferSource; +class Promise; +class PostMessageEvent; // For StructuredClone between windows. + +struct ImageBitmapCloneData final +{ + RefPtr mSurface; + gfx::IntRect mPictureRect; + bool mIsPremultipliedAlpha; + bool mIsCroppingAreaOutSideOfSourceImage; +}; + +/* + * ImageBitmap is an opaque handler to several kinds of image-like objects from + * HTMLImageElement, HTMLVideoElement, HTMLCanvasElement, ImageData to + * CanvasRenderingContext2D and Image Blob. + * + * An ImageBitmap could be painted to a canvas element. + * + * Generally, an ImageBitmap only keeps a reference to its source object's + * buffer, but if the source object is an ImageData, an Blob or a + * HTMLCanvasElement with WebGL rendering context, the ImageBitmap copy the + * source object's buffer. + */ +class ImageBitmap final : public nsISupports, + public nsWrapperCache +{ +public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageBitmap) + + nsCOMPtr GetParentObject() const { return mParent; } + + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + + uint32_t Width() const + { + return mPictureRect.Width(); + } + + uint32_t Height() const + { + return mPictureRect.Height(); + } + + void Close(); + + /* + * The PrepareForDrawTarget() might return null if the mPictureRect does not + * intersect with the size of mData. + */ + already_AddRefed + PrepareForDrawTarget(gfx::DrawTarget* aTarget); + + /* + * Transfer ownership of buffer to caller. So this function call + * Close() implicitly. + */ + already_AddRefed + TransferAsImage(); + + UniquePtr + ToCloneData() const; + + static already_AddRefed + CreateFromCloneData(nsIGlobalObject* aGlobal, ImageBitmapCloneData* aData); + + static already_AddRefed + CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal, + OffscreenCanvas& aOffscreenCanvas, + ErrorResult& aRv); + + static already_AddRefed + Create(nsIGlobalObject* aGlobal, const ImageBitmapSource& aSrc, + const Maybe& aCropRect, ErrorResult& aRv); + + static already_AddRefed + Create(nsIGlobalObject* aGlobal, + const ImageBitmapSource& aBuffer, + int32_t aOffset, int32_t aLength, + mozilla::dom::ImageBitmapFormat aFormat, + const Sequence& aLayout, + ErrorResult& aRv); + + static JSObject* + ReadStructuredClone(JSContext* aCx, + JSStructuredCloneReader* aReader, + nsIGlobalObject* aParent, + const nsTArray>& aClonedSurfaces, + uint32_t aIndex); + + static bool + WriteStructuredClone(JSStructuredCloneWriter* aWriter, + nsTArray>& aClonedSurfaces, + ImageBitmap* aImageBitmap); + + // Mozilla Extensions + static bool ExtensionsEnabled(JSContext* aCx, JSObject* aObj); + + friend CreateImageBitmapFromBlob; + friend CreateImageBitmapFromBlobTask; + friend CreateImageBitmapFromBlobWorkerTask; + + template + friend class MapDataIntoBufferSource; + + // Mozilla Extensions + ImageBitmapFormat + FindOptimalFormat(const Optional>& aPossibleFormats, + ErrorResult& aRv); + + int32_t + MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv); + + already_AddRefed + MapDataInto(JSContext* aCx, + ImageBitmapFormat aFormat, + const ArrayBufferViewOrArrayBuffer& aBuffer, + int32_t aOffset, ErrorResult& aRv); + +protected: + + /* + * The default value of aIsPremultipliedAlpha is TRUE because that the + * data stored in HTMLImageElement, HTMLVideoElement, HTMLCanvasElement, + * CanvasRenderingContext2D are alpha-premultiplied in default. + * + * Actually, if one HTMLCanvasElement's rendering context is WebGLContext, it + * is possible to get un-premultipliedAlpha data out. But, we do not do it in + * the CreateInternal(from HTMLCanvasElement) method. + * + * It is also possible to decode an image which is encoded with alpha channel + * to be non-premultipliedAlpha. This could be applied in + * 1) the CreateInternal(from HTMLImageElement) method (which might trigger + * re-decoding if the original decoded data is alpha-premultiplied) and + * 2) while decoding a blob. But we do not do it in both code path too. + * + * ImageData's underlying data is triggered as non-premultipliedAlpha, so set + * the aIsPremultipliedAlpha to be false in the + * CreateInternal(from ImageData) method. + */ + ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData, + bool aIsPremultipliedAlpha = true); + + virtual ~ImageBitmap(); + + void SetPictureRect(const gfx::IntRect& aRect, ErrorResult& aRv); + + void SetIsCroppingAreaOutSideOfSourceImage(const gfx::IntSize& aSourceSize, + const Maybe& aCroppingRect); + + static already_AddRefed + CreateInternal(nsIGlobalObject* aGlobal, HTMLImageElement& aImageEl, + const Maybe& aCropRect, ErrorResult& aRv); + + static already_AddRefed + CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl, + const Maybe& aCropRect, ErrorResult& aRv); + + static already_AddRefed + CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvasEl, + const Maybe& aCropRect, ErrorResult& aRv); + + static already_AddRefed + CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData, + const Maybe& aCropRect, ErrorResult& aRv); + + static already_AddRefed + CreateInternal(nsIGlobalObject* aGlobal, CanvasRenderingContext2D& aCanvasCtx, + const Maybe& aCropRect, ErrorResult& aRv); + + static already_AddRefed + CreateInternal(nsIGlobalObject* aGlobal, ImageBitmap& aImageBitmap, + const Maybe& aCropRect, ErrorResult& aRv); + + nsCOMPtr mParent; + + /* + * The mData is the data buffer of an ImageBitmap, so the mData must not be + * null. + * + * The mSurface is a cache for drawing the ImageBitmap onto a + * HTMLCanvasElement. The mSurface is null while the ImageBitmap is created + * and then will be initialized while the PrepareForDrawTarget() method is + * called first time. + * + * The mSurface might just be a reference to the same data buffer of the mData + * if the are of mPictureRect is just the same as the mData's size. Or, it is + * a independent data buffer which is copied and cropped form the mData's data + * buffer. + */ + RefPtr mData; + RefPtr mSurface; + + /* + * This is used in the ImageBitmap-Extensions implementation. + * ImageUtils is a wrapper to layers::Image, which add some common methods for + * accessing the layers::Image's data. + */ + UniquePtr mDataWrapper; + + /* + * The mPictureRect is the size of the source image in default, however, if + * users specify the cropping area while creating an ImageBitmap, then this + * mPictureRect is the cropping area. + * + * Note that if the CreateInternal() copies and crops data from the source + * image, then this mPictureRect is just the size of the final mData. + * + * The mPictureRect will be used at PrepareForDrawTarget() while user is going + * to draw this ImageBitmap into a HTMLCanvasElement. + */ + gfx::IntRect mPictureRect; + + const bool mIsPremultipliedAlpha; + + /* + * Set mIsCroppingAreaOutSideOfSourceImage if image bitmap was cropped to the + * source rectangle so that it contains any transparent black pixels (cropping + * area is outside of the source image). + * This is used in mapDataInto() to check if we should reject promise with + * IndexSizeError. + */ + bool mIsCroppingAreaOutSideOfSourceImage; + +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_ImageBitmap_h + + diff --git a/dom/canvas/ImageBitmapColorUtils.cpp b/dom/canvas/ImageBitmapColorUtils.cpp new file mode 100644 index 000000000..2b65c1f10 --- /dev/null +++ b/dom/canvas/ImageBitmapColorUtils.cpp @@ -0,0 +1,2080 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "ImageBitmapColorUtils.h" + +namespace mozilla { +namespace dom { + +/* + * Utility function form libyuv source files. + */ +static __inline int32 clamp0(int32 v) { + return ((-(v) >> 31) & (v)); +} + +static __inline int32 clamp255(int32 v) { + return (((255 - (v)) >> 31) | (v)) & 255; +} + +static __inline uint32 Clamp(int32 val) { + int v = clamp0(val); + return (uint32)(clamp255(v)); +} + +#define YG 74 /* (int8)(1.164 * 64 + 0.5) */ + +#define UB 127 /* min(63,(int8)(2.018 * 64)) */ +#define UG -25 /* (int8)(-0.391 * 64 - 0.5) */ +#define UR 0 + +#define VB 0 +#define VG -52 /* (int8)(-0.813 * 64 - 0.5) */ +#define VR 102 /* (int8)(1.596 * 64 + 0.5) */ + +// Bias +#define BB UB * 128 + VB * 128 +#define BG UG * 128 + VG * 128 +#define BR UR * 128 + VR * 128 + +static __inline void +YuvPixel(uint8 y, uint8 u, uint8 v, uint8* b, uint8* g, uint8* r) +{ + int32 y1 = ((int32)(y) - 16) * YG; + *b = Clamp((int32)((u * UB + v * VB) - (BB) + y1) >> 6); + *g = Clamp((int32)((u * UG + v * VG) - (BG) + y1) >> 6); + *r = Clamp((int32)((u * UR + v * VR) - (BR) + y1) >> 6); +} + +static __inline int +RGBToY(uint8 r, uint8 g, uint8 b) +{ + return (66 * r + 129 * g + 25 * b + 0x1080) >> 8; +} + +static __inline int +RGBToU(uint8 r, uint8 g, uint8 b) +{ + return (112 * b - 74 * g - 38 * r + 0x8080) >> 8; +} + +static __inline int +RGBToV(uint8 r, uint8 g, uint8 b) +{ + return (112 * r - 94 * g - 18 * b + 0x8080) >> 8; +} + +/* + * Generic functions. + */ +template +static int +RGBFamilyToRGBAFamily(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + static_assert(aSrcRIndex == 0 || aSrcRIndex == 2, "Wrong SrcR index."); + static_assert(aSrcGIndex == 1, "Wrong SrcG index."); + static_assert(aSrcBIndex == 0 || aSrcBIndex == 2, "Wrong SrcB index."); + static_assert(aDstRIndex == 0 || aDstRIndex == 2, "Wrong DstR index."); + static_assert(aDstGIndex == 1, "Wrong DstG index."); + static_assert(aDstBIndex == 0 || aDstBIndex == 2, "Wrong DstB index."); + static_assert(aDstAIndex == 3, "Wrong DstA index."); + + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + for (int j = 0; j < aWidth; ++j) { + uint8_t r = *(srcBuffer + aSrcRIndex); + uint8_t g = *(srcBuffer + aSrcGIndex); + uint8_t b = *(srcBuffer + aSrcBIndex); + *(dstBuffer + aDstRIndex) = r; + *(dstBuffer + aDstGIndex) = g; + *(dstBuffer + aDstBIndex) = b; + *(dstBuffer + aDstAIndex) = 255; + srcBuffer += 3; + dstBuffer += 4; + } + } + + return 0; +} + +template +static int +RGBAFamilyToRGBFamily(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + static_assert(aSrcRIndex == 0 || aSrcRIndex == 2, "Wrong SrcR index."); + static_assert(aSrcGIndex == 1, "Wrong SrcG index."); + static_assert(aSrcBIndex == 0 || aSrcBIndex == 2, "Wrong SrcB index."); + static_assert(aDstRIndex == 0 || aDstRIndex == 2, "Wrong DstR index."); + static_assert(aDstGIndex == 1, "Wrong DstG index."); + static_assert(aDstBIndex == 0 || aDstBIndex == 2, "Wrong DstB index."); + + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + for (int j = 0; j < aWidth; ++j) { + uint8_t r = *(srcBuffer + aSrcRIndex); + uint8_t g = *(srcBuffer + aSrcGIndex); + uint8_t b = *(srcBuffer + aSrcBIndex); + *(dstBuffer + aDstRIndex) = r; + *(dstBuffer + aDstGIndex) = g; + *(dstBuffer + aDstBIndex) = b; + srcBuffer += 4; + dstBuffer += 3; + } + } + + return 0; +} + +template +void +YUVFamilyToRGBFamily_Row(const uint8_t* aYBuffer, + const uint8_t* aUBuffer, + const uint8_t* aVBuffer, + uint8_t* aDstBuffer, + int aWidth) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + + for (int j = 0; j < aWidth - 1; j += 2) { + YuvPixel(aYBuffer[aPixel1YOffset], aUBuffer[aPixel1UOffset], aVBuffer[aPixel1VOffset], + aDstBuffer + aBIndex, aDstBuffer + aGIndex, aDstBuffer + aRIndex); + YuvPixel(aYBuffer[aPixel2YOffset], aUBuffer[aPixel2UOffset], aVBuffer[aPixel2VOffset], + aDstBuffer + aBIndex + 3, aDstBuffer + aGIndex + 3, aDstBuffer + aRIndex + 3); + aYBuffer += aYStep; + aUBuffer += aUStep; + aVBuffer += aVStep; + aDstBuffer += 6; + } + + if (aWidth & 1) { + YuvPixel(aYBuffer[aPixel1YOffset], aUBuffer[aPixel1UOffset], aVBuffer[aPixel1VOffset], + aDstBuffer + aBIndex, aDstBuffer + aGIndex, aDstBuffer + aRIndex); + } +} + +template +void +YUVFamilyToRGBAFamily_Row(const uint8_t* aYBuffer, + const uint8_t* aUBuffer, + const uint8_t* aVBuffer, + uint8_t* aDstBuffer, + int aWidth) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + static_assert(aAIndex == 3, "Wrong A index."); + + for (int j = 0; j < aWidth - 1; j += 2) { + YuvPixel(aYBuffer[aPixel1YOffset], aUBuffer[aPixel1UOffset], aVBuffer[aPixel1VOffset], + aDstBuffer + aBIndex, aDstBuffer + aGIndex, aDstBuffer + aRIndex); + YuvPixel(aYBuffer[aPixel2YOffset], aUBuffer[aPixel2UOffset], aVBuffer[aPixel2VOffset], + aDstBuffer + aBIndex + 4, aDstBuffer + aGIndex + 4, aDstBuffer + aRIndex + 4); + aDstBuffer[aAIndex] = 255; + aDstBuffer[aAIndex + 4] = 255; + + aYBuffer += aYStep; + aUBuffer += aUStep; + aVBuffer += aVStep; + aDstBuffer += 8; + } + + if (aWidth & 1) { + YuvPixel(aYBuffer[aPixel1YOffset], aUBuffer[aPixel1UOffset], aVBuffer[aPixel1VOffset], + aDstBuffer + aBIndex, aDstBuffer + aGIndex, aDstBuffer + aRIndex); + aDstBuffer[aAIndex] = 255; + } +} + +template< int aRIndex, int aGIndex, int aBIndex> +static void +RGBFamilyToY_Row(const uint8_t* aSrcBuffer, uint8_t* aYBuffer, int aWidth) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + + for (int j = 0; j < aWidth - 1; j += 2) { + aYBuffer[0] = RGBToY(aSrcBuffer[aRIndex], aSrcBuffer[aGIndex], aSrcBuffer[aBIndex]); + aYBuffer[1] = RGBToY(aSrcBuffer[aRIndex + 3], aSrcBuffer[aGIndex + 3], aSrcBuffer[aBIndex + 3]); + + aYBuffer += 2; + aSrcBuffer += 3 * 2; + } + + if (aWidth & 1) { + aYBuffer[0] = RGBToY(aSrcBuffer[aRIndex], aSrcBuffer[aGIndex], aSrcBuffer[aBIndex]); + } +} + +template< int aRIndex, int aGIndex, int aBIndex, int aUStep, int aVStep> +static void +RGBFamilyToUV_Row(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aUBuffer, uint8_t* aVBuffer, int aWidth) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + + uint8_t averageR = 0; + uint8_t averageG = 0; + uint8_t averageB = 0; + + const uint8_t* aSrcBufferNextRow = aSrcBuffer + aSrcStride; + for (int j = 0; j < aWidth - 1; j += 2) { + averageR = (aSrcBuffer[aRIndex] + aSrcBuffer[aRIndex + 3] + aSrcBufferNextRow[aRIndex] + aSrcBufferNextRow[aRIndex + 3]) >> 2; + averageG = (aSrcBuffer[aGIndex] + aSrcBuffer[aGIndex + 3] + aSrcBufferNextRow[aGIndex] + aSrcBufferNextRow[aGIndex + 3]) >> 2; + averageB = (aSrcBuffer[aBIndex] + aSrcBuffer[aBIndex + 3] + aSrcBufferNextRow[aBIndex] + aSrcBufferNextRow[aBIndex + 3]) >> 2; + + aUBuffer[0] = RGBToU(averageR, averageG, averageB); + aVBuffer[0] = RGBToV(averageR, averageG, averageB); + + aUBuffer += aUStep; + aVBuffer += aVStep; + aSrcBuffer += 3 * 2; + aSrcBufferNextRow += 3 * 2; + } + + if (aWidth & 1) { + averageR = (aSrcBuffer[aRIndex] + aSrcBufferNextRow[aRIndex]) >> 1; + averageG = (aSrcBuffer[aGIndex] + aSrcBufferNextRow[aGIndex]) >> 1; + averageB = (aSrcBuffer[aBIndex] + aSrcBufferNextRow[aBIndex]) >> 1; + + aUBuffer[0] = RGBToU(averageR, averageG, averageB); + aVBuffer[0] = RGBToV(averageR, averageG, averageB); + } +} + +template< int aRIndex, int aGIndex, int aBIndex> +static void +RGBAFamilyToY_Row(const uint8_t* aSrcBuffer, uint8_t* aYBuffer, int aWidth) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + + for (int j = 0; j < aWidth - 1; j += 2) { + aYBuffer[0] = RGBToY(aSrcBuffer[aRIndex], aSrcBuffer[aGIndex], aSrcBuffer[aBIndex]); + aYBuffer[1] = RGBToY(aSrcBuffer[aRIndex + 4], aSrcBuffer[aGIndex + 4], aSrcBuffer[aBIndex + 4]); + + aYBuffer += 2; + aSrcBuffer += 4 * 2; + } + + if (aWidth & 1) { + aYBuffer[0] = RGBToY(aSrcBuffer[aRIndex], aSrcBuffer[aGIndex], aSrcBuffer[aBIndex]); + } +} + +template< int aRIndex, int aGIndex, int aBIndex, int aUStep, int aVStep> +static void +RGBAFamilyToUV_Row(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aUBuffer, uint8_t* aVBuffer, int aWidth) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + + uint8_t averageR = 0; + uint8_t averageG = 0; + uint8_t averageB = 0; + + const uint8_t* aSrcBufferNextRow = aSrcBuffer + aSrcStride; + for (int j = 0; j < aWidth - 1; j += 2) { + averageR = (aSrcBuffer[aRIndex] + aSrcBuffer[aRIndex + 4] + aSrcBufferNextRow[aRIndex] + aSrcBufferNextRow[aRIndex + 4]) >> 2; + averageG = (aSrcBuffer[aGIndex] + aSrcBuffer[aGIndex + 4] + aSrcBufferNextRow[aGIndex] + aSrcBufferNextRow[aGIndex + 4]) >> 2; + averageB = (aSrcBuffer[aBIndex] + aSrcBuffer[aBIndex + 4] + aSrcBufferNextRow[aBIndex] + aSrcBufferNextRow[aBIndex + 4]) >> 2; + + aUBuffer[0] = RGBToU(averageR, averageG, averageB); + aVBuffer[0] = RGBToV(averageR, averageG, averageB); + + aUBuffer += aUStep; + aVBuffer += aVStep; + aSrcBuffer += 4 * 2; + aSrcBufferNextRow += 4 * 2; + } + + if (aWidth & 1) { + averageR = (aSrcBuffer[aRIndex] + aSrcBufferNextRow[aRIndex]) >> 1; + averageG = (aSrcBuffer[aGIndex] + aSrcBufferNextRow[aGIndex]) >> 1; + averageB = (aSrcBuffer[aBIndex] + aSrcBufferNextRow[aBIndex]) >> 1; + + aUBuffer[0] = RGBToU(averageR, averageG, averageB); + aVBuffer[0] = RGBToV(averageR, averageG, averageB); + } +} + +/* + * RGB family -> RGBA family. + */ +int +RGB24ToRGBA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToRGBAFamily<0, 1, 2, 0, 1, 2, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGR24ToRGBA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToRGBAFamily<2, 1, 0, 0, 1, 2, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +RGB24ToBGRA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToRGBAFamily<0, 1, 2, 2, 1, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGR24ToBGRA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToRGBAFamily<2, 1, 0, 2, 1, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +/* + * RGBA family -> RGB family. + */ +int +RGBA32ToRGB24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBAFamilyToRGBFamily<0, 1, 2, 0, 1, 2>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGRA32ToRGB24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBAFamilyToRGBFamily<2, 1, 0, 0, 1, 2>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +RGBA32ToBGR24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBAFamilyToRGBFamily<0, 1, 2, 2, 1, 0>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGRA32ToBGR24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBAFamilyToRGBFamily<2, 1, 0, 2, 1, 0>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +/* + * Among RGB family. + */ +int +RGB24Copy(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + MOZ_ASSERT(aSrcStride == aDstStride, "RGB24Copy: aSrcStride != aDstStride"); + + const uint32_t length = aHeight * aDstStride; + memcpy(aDstBuffer, aSrcBuffer, length); + return 0; +} + +int +RGB24ToBGR24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + for (int j = 0; j < aWidth; ++j) { + *(dstBuffer + 0) = *(srcBuffer + 2); + *(dstBuffer + 1) = *(srcBuffer + 1); + *(dstBuffer + 2) = *(srcBuffer + 0); + srcBuffer += 3; + dstBuffer += 3; + } + } + + return 0; +} + +/* + * YUV family -> RGB family. + */ +int +YUV444PToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 1, 2>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV422PToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 0, 1, 2>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV420PToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + const uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 0, 1, 2>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV12ToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + const uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 0, 1, 2>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV21ToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + const uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 0, 1, 2>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV444PToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 1, 0>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV422PToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 2, 1, 0>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV420PToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + const uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 2, 1, 0>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV12ToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + const uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 2, 1, 0>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV21ToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + const uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 2, 1, 0>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +/* + * YUV family -> RGBA family. + */ +int +YUV444PToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 1, 2, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV422PToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 0, 1, 2, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV420PToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + const uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 0, 1, 2, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV12ToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + const uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 0, 1, 2, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV21ToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + const uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 0, 1, 2, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV444PToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 1, 0, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV422PToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * i; + const uint8_t* vBuffer = aVBuffer + aVStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 2, 1, 0, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +YUV420PToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + const uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 1, 1, 2, 1, 0, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV12ToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + const uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 2, 1, 0, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +int +NV21ToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* yBuffer = aYBuffer + aYStride * i; + const uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + const uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + YUVFamilyToRGBAFamily_Row<0, 0, 0, 1, 0, 0, 2, 2, 2, 2, 1, 0, 3>(yBuffer, + uBuffer, + vBuffer, + dstBuffer, + aWidth); + } + + return 0; +} + +/* + * RGB family -> YUV family. + */ +int +RGB24ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + for (int j = 0; j < aWidth; ++j) { + yBuffer[0] = RGBToY(srcBuffer[0], srcBuffer[1], srcBuffer[2]); + uBuffer[0] = RGBToU(srcBuffer[0], srcBuffer[1], srcBuffer[2]); + vBuffer[0] = RGBToV(srcBuffer[0], srcBuffer[1], srcBuffer[2]); + + yBuffer += 1; + uBuffer += 1; + vBuffer += 1; + srcBuffer += 3; + } + } + + return 0; +} + +int +RGB24ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + RGBFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<0, 1, 2, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +RGB24ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + RGBFamilyToY_Row<0, 1, 2>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBFamilyToUV_Row<0, 1, 2, 1, 1>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<0, 1, 2, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +RGB24ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + RGBFamilyToY_Row<0, 1, 2>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +RGB24ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aVUBuffer, int aVUStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + RGBFamilyToY_Row<0, 1, 2>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGR24ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + for (int j = 0; j < aWidth; ++j) { + yBuffer[0] = RGBToY(srcBuffer[2], srcBuffer[1], srcBuffer[0]); + uBuffer[0] = RGBToU(srcBuffer[2], srcBuffer[1], srcBuffer[0]); + vBuffer[0] = RGBToV(srcBuffer[2], srcBuffer[1], srcBuffer[0]); + + yBuffer += 1; + uBuffer += 1; + vBuffer += 1; + srcBuffer += 3; + } + } + + return 0; +} + +int +BGR24ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + RGBFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<2, 1, 0, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGR24ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + RGBFamilyToY_Row<2, 1, 0>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBFamilyToUV_Row<2, 1, 0, 1, 1>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<2, 1, 0, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGR24ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + RGBFamilyToY_Row<2, 1, 0>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGR24ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aVUBuffer, int aVUStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + RGBFamilyToY_Row<2, 1, 0>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +/* + * RGBA family -> YUV family. + */ +int +RGBA32ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + for (int j = 0; j < aWidth; ++j) { + yBuffer[0] = RGBToY(srcBuffer[0], srcBuffer[1], srcBuffer[2]); + uBuffer[0] = RGBToU(srcBuffer[0], srcBuffer[1], srcBuffer[2]); + vBuffer[0] = RGBToV(srcBuffer[0], srcBuffer[1], srcBuffer[2]); + + yBuffer += 1; + uBuffer += 1; + vBuffer += 1; + srcBuffer += 4; + } + } + + return 0; +} + +int +RGBA32ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<0, 1, 2, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +RGBA32ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBAFamilyToUV_Row<0, 1, 2, 1, 1>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<0, 1, 2, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +RGBA32ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBAFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +RGBA32ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aVUBuffer, int aVUStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBAFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBAFamilyToY_Row<0, 1, 2>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<0, 1, 2, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGRA32ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + for (int j = 0; j < aWidth; ++j) { + yBuffer[0] = RGBToY(srcBuffer[2], srcBuffer[1], srcBuffer[0]); + uBuffer[0] = RGBToU(srcBuffer[2], srcBuffer[1], srcBuffer[0]); + vBuffer[0] = RGBToV(srcBuffer[2], srcBuffer[1], srcBuffer[0]); + + yBuffer += 1; + uBuffer += 1; + vBuffer += 1; + srcBuffer += 4; + } + } + + return 0; +} + +int +BGRA32ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * i; + uint8_t* vBuffer = aVBuffer + aVStride * i; + + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<2, 1, 0, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGRA32ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBAFamilyToUV_Row<2, 1, 0, 1, 1>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUBuffer + aUStride * (i / 2); + uint8_t* vBuffer = aVBuffer + aVStride * (i / 2); + + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<2, 1, 0, 1, 1>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGRA32ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBAFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aUVBuffer + aUVStride * (i / 2); + uint8_t* vBuffer = aUVBuffer + aUVStride * (i / 2) + 1; + + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +int +BGRA32ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aVUBuffer, int aVUStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight - 1; i += 2) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer + aSrcStride, yBuffer + aYStride, aWidth); + RGBAFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, aSrcStride, uBuffer, vBuffer, aWidth); + } + + if (aHeight & 1) { + const int i = aHeight - 1; + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* yBuffer = aYBuffer + aYStride * i; + uint8_t* uBuffer = aVUBuffer + aVUStride * (i / 2) + 1; + uint8_t* vBuffer = aVUBuffer + aVUStride * (i / 2); + + RGBAFamilyToY_Row<2, 1, 0>(srcBuffer, yBuffer, aWidth); + + // Pass 0 as the aSrcStride so we don't sample next row's RGB information. + RGBAFamilyToUV_Row<2, 1, 0, 2, 2>(srcBuffer, 0, uBuffer, vBuffer, aWidth); + } + + return 0; +} + +/* + * RGBA/RGB family -> HSV. + * Reference: + * (1) https://en.wikipedia.org/wiki/HSL_and_HSV + * (2) OpenCV implementation: + * http://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html + */ +const float EPSILON = 1e-10f; + +template +int +RGBFamilyToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + float* dstBuffer = (float*)((uint8_t*)(aDstBuffer) + aDstStride * i); + + for (int j = 0; j < aWidth; ++j) { + const float r = (float)(srcBuffer[aRIndex]) / 255.0f; + const float g = (float)(srcBuffer[aGIndex]) / 255.0f; + const float b = (float)(srcBuffer[aBIndex]) / 255.0f; + float& h = dstBuffer[0]; + float& s = dstBuffer[1]; + float& v = dstBuffer[2]; + + float min = r; + if (g < min) min = g; + if (b < min) min = b; + + float max = r; + if (g > max) max = g; + if (b > max) max = b; + + const float diff = max - min + EPSILON; // Prevent dividing by zero. + + // Calculate v. + v = max; + + // Calculate s. + if (max == 0.0f) { + s = 0.0f; + } else { + s = diff / v; + } + + // Calculate h. + if (max == r) { + h = 60.0f * (g - b) / diff; + } else if (max == g) { + h = 60.0f * (b - r) / diff + 120.0f; + } else if (max == b) { + h = 60.0f * (r - g) / diff + 240.0f; + } + + if (h < 0.0f) { + h += 360.0f; + } + + // Step one pixel. + srcBuffer += aSrcStep; + dstBuffer += 3; + } + } + + return 0; +} + +static const int sector_data[][3]= {{0,3,1}, {2,0,1}, {1,0,3}, {1,2,0}, {3,1,0}, {0,1,2}}; + +// If the destination is a RGB24 or BGR24, set the aAIndex to be 0, 1 or 2, +// so that the r, g or b value will be set to 255 first than to the right value. +template +int +HSVToRGBAFamily(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + static_assert(aAIndex == 0 || aAIndex == 1 || aAIndex == 2 || aAIndex == 3, "Wrong A index."); + + for (int i = 0; i < aHeight; ++i) { + const float* srcBuffer = (const float*)((const uint8_t*)(aSrcBuffer) + aSrcStride * i); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + for (int j = 0; j < aWidth; ++j) { + const float h = srcBuffer[0]; + const float s = srcBuffer[1]; + const float v = srcBuffer[2]; + + // Calculate h-prime which should be in range [0, 6). -> h should be in + // range [0, 360). + float hPrime = h / 60.0f; + if (hPrime < 0.0f) + do hPrime += 6.0f; while (hPrime < 0.0f); + else if (hPrime >= 6.0f) + do hPrime -= 6.0f; while (hPrime >= 6.0f); + const int sector = floor(hPrime); + const float hMod1 = hPrime - sector; + + float values[4]; + values[0] = v; + values[1] = v * (1.0f - s); + values[2] = v * (1.0f - s * hMod1); + values[3] = v * (1.0f - s * (1.0f - hMod1)); + + dstBuffer[aAIndex] = 255; + dstBuffer[aRIndex] = Clamp(values[sector_data[sector][0]] * 255.0f); + dstBuffer[aGIndex] = Clamp(values[sector_data[sector][1]] * 255.0f); + dstBuffer[aBIndex] = Clamp(values[sector_data[sector][2]] * 255.0f); + + // Step one pixel. + srcBuffer += 3; + dstBuffer += aDstStep; + } + } + + return 0; +} + +int +RGBA32ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToHSV<0, 1, 2, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGRA32ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToHSV<2, 1, 0, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +RGB24ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToHSV<0, 1, 2, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGR24ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToHSV<2, 1, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +HSVToRGBA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return HSVToRGBAFamily<0, 1, 2, 3, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +HSVToBGRA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return HSVToRGBAFamily<2, 1, 0, 3, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +HSVToRGB24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return HSVToRGBAFamily<0, 1, 2, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +HSVToBGR24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return HSVToRGBAFamily<2, 1, 0, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +/* + * RGBA/RGB family -> Lab. + * Reference: + * (1) https://en.wikipedia.org/wiki/SRGB + * (2) https://en.wikipedia.org/wiki/Lab_color_space + * (3) OpenCV implementation: + * http://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html + */ +static const float sRGBToXYZ_D65[] = {0.412453f, 0.357580f, 0.180423f, + 0.212671f, 0.715160f, 0.072169f, + 0.019334f, 0.119193f, 0.950227f}; +static const float XYZTosRGB_D65[] = {3.240479f, -1.53715f, -0.498535f, + -0.969256f, 1.875991f, 0.041556f, + 0.055648f, -0.204043f, 1.057311f}; +static const float whitept_D65[] = {0.950456f, 1.0f, 1.088754f}; +static const float _magic = std::pow((6.0 / 29.0), 3.0); // should be around 0.008856. +static const float _1_3 = 1.0f / 3.0f; +static const float _a = std::pow((29.0 / 6.0), 2.0) / 3.0; // should be around 7.787. +static const float _b = 16.0f / 116.0f; // should be around 0.1379. + +template +int +RGBFamilyToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + + const float C0 = sRGBToXYZ_D65[0] / whitept_D65[0], + C1 = sRGBToXYZ_D65[1] / whitept_D65[0], + C2 = sRGBToXYZ_D65[2] / whitept_D65[0], + C3 = sRGBToXYZ_D65[3] / whitept_D65[1], + C4 = sRGBToXYZ_D65[4] / whitept_D65[1], + C5 = sRGBToXYZ_D65[5] / whitept_D65[1], + C6 = sRGBToXYZ_D65[6] / whitept_D65[2], + C7 = sRGBToXYZ_D65[7] / whitept_D65[2], + C8 = sRGBToXYZ_D65[8] / whitept_D65[2]; + + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + float* dstBuffer = (float*)((uint8_t*)(aDstBuffer) + aDstStride * i); + + for (int j = 0; j < aWidth; ++j) { + float r = (float)(srcBuffer[aRIndex]) / 255.0f; + float g = (float)(srcBuffer[aGIndex]) / 255.0f; + float b = (float)(srcBuffer[aBIndex]) / 255.0f; + + // gamma correction of sRGB + r = r <= 0.04045f ? r / 12.92f : std::pow((r + 0.055) / 1.055, 2.4); + g = g <= 0.04045f ? g / 12.92f : std::pow((g + 0.055) / 1.055, 2.4); + b = b <= 0.04045f ? b / 12.92f : std::pow((b + 0.055) / 1.055, 2.4); + + const float X = C0 * r + C1 * g + C2 * b; + const float Y = C3 * r + C4 * g + C5 * b; + const float Z = C6 * r + C7 * g + C8 * b; + + const float FX = X > _magic ? std::pow(X, _1_3) : (_a * X + _b); + const float FY = Y > _magic ? std::pow(Y, _1_3) : (_a * Y + _b); + const float FZ = Z > _magic ? std::pow(Z, _1_3) : (_a * Z + _b); + + dstBuffer[0] = 116.0f * FY - 16.0f; + dstBuffer[1] = 500.0f * (FX - FY); + dstBuffer[2] = 200.0f * (FY - FZ); + + // Step one pixel. + srcBuffer += aSrcStep; + dstBuffer += 3; + } + } + return 0; +} + +// If the destination is a RGB24 or BGR24, set the aAIndex to be 0, 1 or 2, +// so that the r, g or b value will be set to 255 first than to the right value. +template +int +LabToRGBAFamily(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + static_assert(aAIndex == 0 || aAIndex == 1 || aAIndex == 2 || aAIndex == 3, "Wrong A index."); + + const float C0 = XYZTosRGB_D65[0] * whitept_D65[0], + C1 = XYZTosRGB_D65[1] * whitept_D65[1], + C2 = XYZTosRGB_D65[2] * whitept_D65[2], + C3 = XYZTosRGB_D65[3] * whitept_D65[0], + C4 = XYZTosRGB_D65[4] * whitept_D65[1], + C5 = XYZTosRGB_D65[5] * whitept_D65[2], + C6 = XYZTosRGB_D65[6] * whitept_D65[0], + C7 = XYZTosRGB_D65[7] * whitept_D65[1], + C8 = XYZTosRGB_D65[8] * whitept_D65[2]; + + for (int i = 0; i < aHeight; ++i) { + const float* srcBuffer = (const float*)((const uint8_t*)(aSrcBuffer) + aSrcStride * i); + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + for (int j = 0; j < aWidth; ++j) { + const float L = srcBuffer[0]; + const float a = srcBuffer[1]; + const float b = srcBuffer[2]; + + const float FY = (L + 16.0f) / 116.0f; + const float FX = (a / 500.0f) + FY; + const float FZ = FY - (b / 200.0f); + + const float X = FX > 6.0f / 29.0f ? std::pow((double)FX, 3.0) : 3.0 * std::pow((6.0 / 29.0), 2.0) * (FX - (4.0 / 29.0)); + const float Y = FY > 6.0f / 29.0f ? std::pow((double)FY, 3.0) : 3.0 * std::pow((6.0 / 29.0), 2.0) * (FY - (4.0 / 29.0)); + const float Z = FZ > 6.0f / 29.0f ? std::pow((double)FZ, 3.0) : 3.0 * std::pow((6.0 / 29.0), 2.0) * (FZ - (4.0 / 29.0)); + + const float r0 = C0 * X + C1 * Y + C2 * Z; + const float g0 = C3 * X + C4 * Y + C5 * Z; + const float b0 = C6 * X + C7 * Y + C8 * Z; + + // Apply gamma curve of sRGB to the linear rgb values. + dstBuffer[aAIndex] = 255; + dstBuffer[aRIndex] = Clamp((r0 <= 0.0031308f ? r0 * 12.92f : 1.055 * std::pow((double)r0, 1.0 / 2.4) - 0.055) * 255.0); + dstBuffer[aGIndex] = Clamp((g0 <= 0.0031308f ? g0 * 12.92f : 1.055 * std::pow((double)g0, 1.0 / 2.4) - 0.055) * 255.0); + dstBuffer[aBIndex] = Clamp((b0 <= 0.0031308f ? b0 * 12.92f : 1.055 * std::pow((double)b0, 1.0 / 2.4) - 0.055) * 255.0); + + // Step one pixel. + srcBuffer += 3; + dstBuffer += aDstStep; + } + } + return 0; +} + +int +RGBA32ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToLab<0, 1, 2, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGRA32ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToLab<2, 1, 0, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +RGB24ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToLab<0, 1, 2, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGR24ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToLab<2, 1, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +LabToRGBA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return LabToRGBAFamily<0, 1, 2, 3, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +LabToBGRA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return LabToRGBAFamily<2, 1, 0, 3, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +LabToRGB24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return LabToRGBAFamily<0, 1, 2, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +LabToBGR24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return LabToRGBAFamily<2, 1, 0, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +/* + * RGBA/RGB family -> Gray8. + * Reference: + * (1) OpenCV implementation: + * http://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html + */ +template +int +RGBFamilyToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + static_assert(aRIndex == 0 || aRIndex == 2, "Wrong R index."); + static_assert(aGIndex == 1, "Wrong G index."); + static_assert(aBIndex == 0 || aBIndex == 2, "Wrong B index."); + + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcBuffer = aSrcBuffer + aSrcStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + for (int j = 0; j < aWidth; ++j) { + dstBuffer[j] = 0.299 * srcBuffer[aRIndex] + + 0.587 * srcBuffer[aGIndex] + + 0.114 * srcBuffer[aBIndex]; + srcBuffer += aSrcStep; + } + } + + return 0; +} + +int +RGB24ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToGray8<0, 1, 2, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGR24ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToGray8<2, 1, 0, 3>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +RGBA32ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToGray8<0, 1, 2, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +BGRA32ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return RGBFamilyToGray8<2, 1, 0, 4>(aSrcBuffer, aSrcStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +/* + * YUV family -> Gray8. + * Reference: + * (1) OpenCV implementation: + * http://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html + */ +int +YUVFamilyToGray8(const uint8_t* aSrcYBuffer, int aSrcYStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + for (int i = 0; i < aHeight; ++i) { + const uint8_t* srcYBuffer = aSrcYBuffer + aSrcYStride * i; + uint8_t* dstBuffer = aDstBuffer + aDstStride * i; + + memcpy(dstBuffer, srcYBuffer, aDstStride); + } + + return 0; +} + +int +YUV444PToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t*, int, + const uint8_t*, int, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return YUVFamilyToGray8(aYBuffer, aYStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +YUV422PToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t*, int, + const uint8_t*, int, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return YUVFamilyToGray8(aYBuffer, aYStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +YUV420PToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t*, int, + const uint8_t*, int, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return YUVFamilyToGray8(aYBuffer, aYStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +NV12ToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t*, int, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return YUVFamilyToGray8(aYBuffer, aYStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +int +NV21ToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t*, int, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight) +{ + return YUVFamilyToGray8(aYBuffer, aYStride, + aDstBuffer, aDstStride, + aWidth, aHeight); +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/ImageBitmapColorUtils.h b/dom/canvas/ImageBitmapColorUtils.h new file mode 100644 index 000000000..892fbb541 --- /dev/null +++ b/dom/canvas/ImageBitmapColorUtils.h @@ -0,0 +1,501 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_ImageBitmapColorUtils_h +#define mozilla_dom_ImageBitmapColorUtils_h + +#include "mozilla/UniquePtr.h" +#include "nsTArrayForwardDeclare.h" + +namespace mozilla { +namespace dom { + +/* + * RGB family -> RGBA family. + */ +int +RGB24ToRGBA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGR24ToRGBA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); +int +RGB24ToBGRA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGR24ToBGRA32(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +/* + * RGBA family -> RGB family. + */ +int +RGBA32ToRGB24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGRA32ToRGB24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); +int +RGBA32ToBGR24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGRA32ToBGR24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +/* + * Among RGB family. + */ +int +RGB24Copy(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +#define BGR24Copy RGB24Copy +#define RGB24ToRGB24 RGB24Copy +#define BGR24ToBGR24 BGR24Copy + +int +RGB24ToBGR24(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +#define BGR24ToRGB24 RGB24ToBGR24 + +/* + * YUV family -> RGB family. + */ +int +YUV444PToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV422PToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV420PToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV12ToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV21ToRGB24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV444PToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV422PToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV420PToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV12ToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV21ToBGR24(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +/* + * YUV family -> RGBA family. + */ +int +YUV444PToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV422PToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV420PToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV12ToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV21ToRGBA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV444PToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV422PToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV420PToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV12ToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUVBuffer, int aUVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV21ToBGRA32(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aVUBuffer, int aVUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +/* + * RGB family -> YUV family. + */ +int +RGB24ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +RGB24ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +RGB24ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); +int +RGB24ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight); + +int +RGB24ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aVUBuffer, int aVUStride, + int aWidth, int aHeight); + +int +BGR24ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +BGR24ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +BGR24ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +BGR24ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight); + +int +BGR24ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight); + +/* + * RGBA family -> YUV family. + */ +int +RGBA32ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +RGBA32ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +RGBA32ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); +int +RGBA32ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight); + +int +RGBA32ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aVUBuffer, int aVUStride, + int aWidth, int aHeight); + +int +BGRA32ToYUV444P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +BGRA32ToYUV422P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + +int +BGRA32ToYUV420P(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUBuffer, int aUStride, + uint8_t* aVBuffer, int aVStride, + int aWidth, int aHeight); + + +int +BGRA32ToNV12(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight); + +int +BGRA32ToNV21(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aYBuffer, int aYStride, + uint8_t* aUVBuffer, int aUVStride, + int aWidth, int aHeight); + +/* + * RGBA/RGB family <-> HSV family. + */ +int +RGBA32ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGRA32ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +RGB24ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGR24ToHSV(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +HSVToRGBA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +HSVToBGRA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +HSVToRGB24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +HSVToBGR24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +/* + * RGBA/RGB family <-> Lab family. + */ +int +RGBA32ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGRA32ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +RGB24ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGR24ToLab(const uint8_t* aSrcBuffer, int aSrcStride, + float* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +LabToRGBA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +LabToBGRA32(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +LabToRGB24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +LabToBGR24(const float* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +/* + * RGBA/RGB family -> Gray8. + */ +int +RGB24ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGR24ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +RGBA32ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +BGRA32ToGray8(const uint8_t* aSrcBuffer, int aSrcStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +/* + * YUV family -> Gray8. + */ +int +YUV444PToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV422PToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +YUV420PToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + const uint8_t* aVBuffer, int aVStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV12ToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +int +NV21ToGray8(const uint8_t* aYBuffer, int aYStride, + const uint8_t* aUBuffer, int aUStride, + uint8_t* aDstBuffer, int aDstStride, + int aWidth, int aHeight); + +} // namespace dom +} // namespace mozilla +#endif // mozilla_dom_ImageBitmapColorUtils_h diff --git a/dom/canvas/ImageBitmapRenderingContext.cpp b/dom/canvas/ImageBitmapRenderingContext.cpp new file mode 100644 index 000000000..8f5074554 --- /dev/null +++ b/dom/canvas/ImageBitmapRenderingContext.cpp @@ -0,0 +1,314 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "ImageBitmapRenderingContext.h" +#include "mozilla/dom/ImageBitmapRenderingContextBinding.h" +#include "ImageContainer.h" +#include "ImageLayers.h" + +namespace mozilla { +namespace dom { + +ImageBitmapRenderingContext::ImageBitmapRenderingContext() + : mWidth(0) + , mHeight(0) +{ +} + +ImageBitmapRenderingContext::~ImageBitmapRenderingContext() +{ + RemovePostRefreshObserver(); +} + +JSObject* +ImageBitmapRenderingContext::WrapObject(JSContext* aCx, JS::Handle aGivenProto) +{ + return ImageBitmapRenderingContextBinding::Wrap(aCx, this, aGivenProto); +} + +already_AddRefed +ImageBitmapRenderingContext::ClipToIntrinsicSize() +{ + if (!mImage) { + return nullptr; + } + + // If image is larger than canvas intrinsic size, clip it to the intrinsic size. + RefPtr surface; + RefPtr result; + if (mWidth < mImage->GetSize().width || + mHeight < mImage->GetSize().height) { + surface = MatchWithIntrinsicSize(); + } else { + surface = mImage->GetAsSourceSurface(); + } + result = new layers::SourceSurfaceImage(gfx::IntSize(mWidth, mHeight), surface); + return result.forget(); +} + +void +ImageBitmapRenderingContext::TransferImageBitmap(ImageBitmap& aImageBitmap) +{ + TransferFromImageBitmap(aImageBitmap); +} + +void +ImageBitmapRenderingContext::TransferFromImageBitmap(ImageBitmap& aImageBitmap) +{ + Reset(); + mImage = aImageBitmap.TransferAsImage(); + + if (!mImage) { + return; + } + + Redraw(gfxRect(0, 0, mWidth, mHeight)); +} + +int32_t +ImageBitmapRenderingContext::GetWidth() const +{ + return mWidth; +} + +int32_t +ImageBitmapRenderingContext::GetHeight() const +{ + return mHeight; +} + +NS_IMETHODIMP +ImageBitmapRenderingContext::SetDimensions(int32_t aWidth, int32_t aHeight) +{ + mWidth = aWidth; + mHeight = aHeight; + return NS_OK; +} + +NS_IMETHODIMP +ImageBitmapRenderingContext::InitializeWithDrawTarget(nsIDocShell* aDocShell, + NotNull aTarget) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +already_AddRefed +ImageBitmapRenderingContext::MatchWithIntrinsicSize() +{ + RefPtr surface = mImage->GetAsSourceSurface(); + RefPtr temp = + Factory::CreateDataSourceSurface(IntSize(mWidth, mHeight), surface->GetFormat()); + if (!temp) { + return nullptr; + } + + DataSourceSurface::ScopedMap map(temp, DataSourceSurface::READ_WRITE); + if (!map.IsMapped()) { + return nullptr; + } + + RefPtr dt = + Factory::CreateDrawTargetForData(BackendType::CAIRO, + map.GetData(), + temp->GetSize(), + map.GetStride(), + temp->GetFormat()); + if (!dt || !dt->IsValid()) { + gfxWarning() << "ImageBitmapRenderingContext::MatchWithIntrinsicSize failed"; + return nullptr; + } + + + dt->ClearRect(Rect(0, 0, mWidth, mHeight)); + dt->CopySurface(surface, + IntRect(0, 0, surface->GetSize().width, + surface->GetSize().height), + IntPoint(0, 0)); + + return temp.forget(); +} + +mozilla::UniquePtr +ImageBitmapRenderingContext::GetImageBuffer(int32_t* aFormat) +{ + *aFormat = 0; + + if (!mImage) { + return nullptr; + } + + RefPtr surface = mImage->GetAsSourceSurface(); + RefPtr data = surface->GetDataSurface(); + if (!data) { + return nullptr; + } + + if (data->GetSize() != IntSize(mWidth, mHeight)) { + data = MatchWithIntrinsicSize(); + } + + *aFormat = imgIEncoder::INPUT_FORMAT_HOSTARGB; + return SurfaceToPackedBGRA(data); +} + +NS_IMETHODIMP +ImageBitmapRenderingContext::GetInputStream(const char* aMimeType, + const char16_t* aEncoderOptions, + nsIInputStream** aStream) +{ + nsCString enccid("@mozilla.org/image/encoder;2?type="); + enccid += aMimeType; + nsCOMPtr encoder = do_CreateInstance(enccid.get()); + if (!encoder) { + return NS_ERROR_FAILURE; + } + + int32_t format = 0; + UniquePtr imageBuffer = GetImageBuffer(&format); + if (!imageBuffer) { + return NS_ERROR_FAILURE; + } + + return ImageEncoder::GetInputStream(mWidth, mHeight, imageBuffer.get(), format, + encoder, aEncoderOptions, aStream); +} + +already_AddRefed +ImageBitmapRenderingContext::GetSurfaceSnapshot(bool* aPremultAlpha) +{ + if (!mImage) { + return nullptr; + } + + if (aPremultAlpha) { + *aPremultAlpha = true; + } + + RefPtr surface = mImage->GetAsSourceSurface(); + if (surface->GetSize() != IntSize(mWidth, mHeight)) { + return MatchWithIntrinsicSize(); + } + + return surface.forget(); +} + +NS_IMETHODIMP +ImageBitmapRenderingContext::SetIsOpaque(bool aIsOpaque) +{ + return NS_OK; +} + +bool +ImageBitmapRenderingContext::GetIsOpaque() +{ + return false; +} + +NS_IMETHODIMP +ImageBitmapRenderingContext::Reset() +{ + if (mCanvasElement) { + mCanvasElement->InvalidateCanvas(); + } + + mImage = nullptr; + + return NS_OK; +} + +already_AddRefed +ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder, + Layer* aOldLayer, + LayerManager* aManager, + bool aMirror /* = false */) +{ + if (aMirror) { + // Not supported for ImageBitmapRenderingContext + return nullptr; + } + + if (!mImage) { + // No DidTransactionCallback will be received, so mark the context clean + // now so future invalidations will be dispatched. + MarkContextClean(); + return nullptr; + } + + RefPtr imageLayer; + + if (aOldLayer) { + imageLayer = static_cast(aOldLayer); + } else { + imageLayer = aManager->CreateImageLayer(); + } + + RefPtr imageContainer = imageLayer->GetContainer(); + if (!imageContainer) { + imageContainer = aManager->CreateImageContainer(); + imageLayer->SetContainer(imageContainer); + } + + AutoTArray imageList; + RefPtr image = ClipToIntrinsicSize(); + imageList.AppendElement(ImageContainer::NonOwningImage(image)); + imageContainer->SetCurrentImages(imageList); + + return imageLayer.forget(); +} + +void +ImageBitmapRenderingContext::MarkContextClean() +{ +} + +NS_IMETHODIMP +ImageBitmapRenderingContext::Redraw(const gfxRect& aDirty) +{ + if (!mCanvasElement) { + return NS_OK; + } + + mozilla::gfx::Rect rect = ToRect(aDirty); + mCanvasElement->InvalidateCanvasContent(&rect); + return NS_OK; +} + +NS_IMETHODIMP +ImageBitmapRenderingContext::SetIsIPC(bool aIsIPC) +{ + return NS_OK; +} + +void +ImageBitmapRenderingContext::DidRefresh() +{ +} + +void +ImageBitmapRenderingContext::MarkContextCleanForFrameCapture() +{ +} + +bool +ImageBitmapRenderingContext::IsContextCleanForFrameCapture() +{ + return true; +} + +NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageBitmapRenderingContext) +NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageBitmapRenderingContext) + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ImageBitmapRenderingContext, + mCanvasElement, + mOffscreenCanvas) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageBitmapRenderingContext) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal) + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +} +} diff --git a/dom/canvas/ImageBitmapRenderingContext.h b/dom/canvas/ImageBitmapRenderingContext.h new file mode 100644 index 000000000..0a72aa427 --- /dev/null +++ b/dom/canvas/ImageBitmapRenderingContext.h @@ -0,0 +1,98 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef ImageBitmapRenderingContext_h +#define ImageBitmapRenderingContext_h + +#include "nsICanvasRenderingContextInternal.h" +#include "nsWrapperCache.h" + +namespace mozilla { + +namespace gfx { +class DataSourceSurface; +class DrawTarget; +class SourceSurface; +} + +namespace layers { +class Image; +class ImageContainer; +} + +namespace dom { + +/** + * The purpose of ImageBitmapRenderingContext is to provide a faster and efficient + * way to display ImageBitmap. Simply call TransferFromImageBitmap() then we'll transfer + * the surface of ImageBitmap to this context and then to use it to display. + * + * See more details in spec: https://wiki.whatwg.org/wiki/OffscreenCanvas + */ +class ImageBitmapRenderingContext final : + public nsICanvasRenderingContextInternal, + public nsWrapperCache +{ + virtual ~ImageBitmapRenderingContext(); + +public: + ImageBitmapRenderingContext(); + + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + + // nsISupports interface + CC + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageBitmapRenderingContext) + + void TransferImageBitmap(ImageBitmap& aImageBitmap); + void TransferFromImageBitmap(ImageBitmap& aImageBitmap); + + // nsICanvasRenderingContextInternal + virtual int32_t GetWidth() const override; + virtual int32_t GetHeight() const override; + + NS_IMETHOD SetDimensions(int32_t aWidth, int32_t aHeight) override; + + NS_IMETHOD InitializeWithDrawTarget(nsIDocShell* aDocShell, + NotNull aTarget) override; + + virtual mozilla::UniquePtr GetImageBuffer(int32_t* aFormat) override; + NS_IMETHOD GetInputStream(const char* aMimeType, + const char16_t* aEncoderOptions, + nsIInputStream** aStream) override; + + virtual already_AddRefed + GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override; + + NS_IMETHOD SetIsOpaque(bool aIsOpaque) override; + virtual bool GetIsOpaque() override; + NS_IMETHOD Reset() override; + virtual already_AddRefed GetCanvasLayer(nsDisplayListBuilder* aBuilder, + Layer* aOldLayer, + LayerManager* aManager, + bool aMirror = false) override; + virtual void MarkContextClean() override; + + NS_IMETHOD Redraw(const gfxRect& aDirty) override; + NS_IMETHOD SetIsIPC(bool aIsIPC) override; + + virtual void DidRefresh() override; + + virtual void MarkContextCleanForFrameCapture() override; + virtual bool IsContextCleanForFrameCapture() override; + +protected: + already_AddRefed MatchWithIntrinsicSize(); + already_AddRefed ClipToIntrinsicSize(); + int32_t mWidth; + int32_t mHeight; + + RefPtr mImage; +}; + +} +} + +#endif /* ImageBitmapRenderingContext_h */ diff --git a/dom/canvas/ImageBitmapSource.h b/dom/canvas/ImageBitmapSource.h new file mode 100644 index 000000000..776c2d1de --- /dev/null +++ b/dom/canvas/ImageBitmapSource.h @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_ImageBitmapSource_h +#define mozilla_dom_ImageBitmapSource_h + +namespace mozilla { +namespace dom { + +// So we don't have to forward declare this elsewhere. +class HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOrCanvasRenderingContext2DOrImageBitmapOrArrayBufferViewOrArrayBuffer; +typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOrCanvasRenderingContext2DOrImageBitmapOrArrayBufferViewOrArrayBuffer + ImageBitmapSource; + +} +} + +#endif diff --git a/dom/canvas/ImageBitmapUtils.cpp b/dom/canvas/ImageBitmapUtils.cpp new file mode 100644 index 000000000..7f2f36876 --- /dev/null +++ b/dom/canvas/ImageBitmapUtils.cpp @@ -0,0 +1,2778 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "ImageBitmapUtils.h" +#include "ImageBitmapColorUtils.h" +#include "ImageContainer.h" +#include "libyuv.h" +#include "mozilla/dom/ImageBitmapBinding.h" +#include "mozilla/Function.h" +#include "mozilla/gfx/2D.h" + +using namespace libyuv; +using namespace mozilla::gfx; + +namespace mozilla { +namespace dom { +namespace imagebitmapformat { + +class Utils; +class Utils_RGBA32; +class Utils_BGRA32; +class Utils_RGB24; +class Utils_BGR24; +class Utils_Gray8; +class Utils_YUV444P; +class Utils_YUV422P; +class Utils_YUV420P; +class Utils_YUV420SP_NV12; +class Utils_YUV420SP_NV21; +class Utils_HSV; +class Utils_Lab; +class Utils_Depth; + +static int GetBytesPerPixelValue(ChannelPixelLayoutDataType aDataType) +{ + switch (aDataType) + { + case ChannelPixelLayoutDataType::Uint8: + return sizeof(uint8_t); + case ChannelPixelLayoutDataType::Int8: + return sizeof(int8_t); + case ChannelPixelLayoutDataType::Uint16: + return sizeof(uint16_t); + case ChannelPixelLayoutDataType::Int16: + return sizeof(int16_t); + case ChannelPixelLayoutDataType::Uint32: + return sizeof(uint32_t); + case ChannelPixelLayoutDataType::Int32: + return sizeof(int32_t); + case ChannelPixelLayoutDataType::Float32: + return sizeof(float); + case ChannelPixelLayoutDataType::Float64: + return sizeof(double); + default: + return 0; + } +} + +/* + * The UtilsUniquePtr is a UniquePtr to ImageBitmapFormatUtils with a customized + * deleter which does nothing. This is used as the return type of + * ImageBitmapFormatUtils::GetUtils to prevent users deleting the returned + * pointer. + */ +struct DoNotDelete { void operator()(void* p) {} }; +using UtilsUniquePtr = UniquePtr; + +/* + * ImageBitmapFormatUtils is an abstract class which provides interfaces to + * extract information of each ImageBitmapFormat and interfaces to convert + * image data between different ImageBitmapFormats. For each kind of + * ImageBitmapFromat, we derive a subclass from the ImageBitmapFormatUtils to + * implement functionalities that are subject to the specific ImageBitmapFormat. + * + * ImageBitmapFormatUtils is an abstract class and its sub-classes are designed + * as singletons. The singleton instance of sub-classes could be initialized and + * accessed via the ImageBitmapFormatUtils::GetUtils() static method. The + * singleton instance is a static local variable which does not need to be + * released manually and, with the C++11 static initialization, the + * initialization is thread-safe. + * + * ImageBitmapFormatUtils and its sub-classes are designed to unify operations + * of ImageBitmap-extensions over different kinds of ImageBitmapFormats; they + * provide following functionalities: + * + * (1) Create default/customized ImagePixelLayout object of each kind of + * ImageBitmapFormat. + * (2) Store the channel counts of each ImageBitmapFormat. + * (3) Calculate the needed buffer size of each kind of ImageBitmapFormat with + * given width, height and stride. + * (4) Perform color conversion between supported ImageBitmapFormats. We use + * _double dispatching_ to identify the source format and destination format + * at run time. The _double dispatching_ here is mainly implemented by + * overriding the _convertTo_ method over the ImageBitmapFormatUtils class + * hierarchy and overloading the _convertFrom_ methods over all sub-classes + * of ImageBitmapFormatUtils. + */ +class Utils +{ +public: + // Get the singleton utility instance of the given ImageBitmapFormat. + static UtilsUniquePtr GetUtils(ImageBitmapFormat aFormat); + + // Get the needed buffer size to store image data in the current + // ImageBitmapFormat with the given width and height. + // The current ImageBitmapFormat is the format used to implement the concrete + // subclass of which the current instance is initialized. + virtual uint32_t NeededBufferSize(uint32_t width, uint32_t height) = 0; + + // Creates a default ImagePixelLayout object of the current ImageBitmapFormat + // with the given width, height and stride. + virtual UniquePtr + CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) = 0; + + // Convert the source image data (stored in the aSrcBuffer and described by + // the aSrcLayout) from the current ImageBitmapFormat to the given + // ImageBitmapFormat, aDstFormat. + // The converted image data is stored in the aDstBuffer and described by the + // returned ImagePixelLayout object. + virtual UniquePtr + ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + // ConvertFrom(): + // Convert the source image data (which is in the aSrcFormat format, the pixel + // layout is described by the aSrcLayout and the raw data is stored in the + // aSrcBuffer) to the current ImageBitmapFormat. + // The converted image data is stored in the aDstBuffer and described by the + // returned ImagePixelLayout object. + virtual UniquePtr + ConvertFrom(Utils_RGBA32* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_BGRA32* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_RGB24* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_BGR24* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_YUV444P* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_YUV422P* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_YUV420P* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_YUV420SP_NV12* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_YUV420SP_NV21* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_HSV* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_Lab* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + virtual UniquePtr + ConvertFrom(Utils_Depth* aSrcFormat, const uint8_t* aSrcBuffer, const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) = 0; + + // Check whether or not the current ImageBitmapFormat can be converted from + // the given ImageBitmapFormat. + virtual bool + CanConvertFrom(ImageBitmapFormat aSrcFormat) = 0; + + // Get the number of channels. + uint8_t GetChannelCount() const + { + return mChannels; + } + +protected: + Utils(uint32_t aChannels, + ChannelPixelLayoutDataType aDataType) + : mChannels(aChannels) + , mBytesPerPixelValue(GetBytesPerPixelValue(aDataType)) + , mDataType(aDataType) + { + } + + virtual ~Utils() + { + } + + const uint8_t mChannels; + const int mBytesPerPixelValue; + const ChannelPixelLayoutDataType mDataType; +}; + +#define DECLARE_Utils(NAME) \ +class Utils_ ## NAME : public Utils \ +{ \ +private: \ + explicit Utils_ ## NAME (); \ + ~Utils_ ## NAME () = default; \ + Utils_ ## NAME (Utils_ ## NAME const &) = delete; \ + Utils_ ## NAME (Utils_ ## NAME &&) = delete; \ + Utils_ ## NAME & operator=(Utils_ ## NAME const &) = delete; \ + Utils_ ## NAME & operator=(Utils_ ## NAME &&) = delete; \ + \ +public: \ + static Utils_ ## NAME & GetInstance(); \ + \ + virtual uint32_t NeededBufferSize(uint32_t aWidth, uint32_t aHeight) override; \ + \ + virtual UniquePtr \ + CreateDefaultLayout(uint32_t, uint32_t, uint32_t) override; \ + \ + virtual UniquePtr \ + ConvertTo(Utils*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_RGBA32*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_BGRA32*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_RGB24*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_BGR24*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_Gray8*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_YUV444P*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_YUV422P*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_YUV420P*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_YUV420SP_NV12*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_YUV420SP_NV21*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_HSV*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_Lab*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual UniquePtr \ + ConvertFrom(Utils_Depth*, const uint8_t*, const ImagePixelLayout*, uint8_t*) override; \ + \ + virtual bool \ + CanConvertFrom(ImageBitmapFormat) override; \ +}; + +DECLARE_Utils(RGBA32) +DECLARE_Utils(BGRA32) +DECLARE_Utils(RGB24) +DECLARE_Utils(BGR24) +DECLARE_Utils(Gray8) +DECLARE_Utils(YUV444P) +DECLARE_Utils(YUV422P) +DECLARE_Utils(YUV420P) +DECLARE_Utils(YUV420SP_NV12) +DECLARE_Utils(YUV420SP_NV21) +DECLARE_Utils(HSV) +DECLARE_Utils(Lab) +DECLARE_Utils(Depth) + +#undef DECLARE_Utils + +/* + * ImageBitmapFormatUtils. + */ +/* static */ UtilsUniquePtr +Utils::GetUtils(ImageBitmapFormat aFormat) +{ + switch(aFormat) + { + case ImageBitmapFormat::RGBA32: + return UtilsUniquePtr(&Utils_RGBA32::GetInstance()); + case ImageBitmapFormat::BGRA32: + return UtilsUniquePtr(&Utils_BGRA32::GetInstance()); + case ImageBitmapFormat::RGB24: + return UtilsUniquePtr(&Utils_RGB24::GetInstance()); + case ImageBitmapFormat::BGR24: + return UtilsUniquePtr(&Utils_BGR24::GetInstance()); + case ImageBitmapFormat::GRAY8: + return UtilsUniquePtr(&Utils_Gray8::GetInstance()); + case ImageBitmapFormat::YUV444P: + return UtilsUniquePtr(&Utils_YUV444P::GetInstance()); + case ImageBitmapFormat::YUV422P: + return UtilsUniquePtr(&Utils_YUV422P::GetInstance()); + case ImageBitmapFormat::YUV420P: + return UtilsUniquePtr(&Utils_YUV420P::GetInstance()); + case ImageBitmapFormat::YUV420SP_NV12: + return UtilsUniquePtr(&Utils_YUV420SP_NV12::GetInstance()); + case ImageBitmapFormat::YUV420SP_NV21: + return UtilsUniquePtr(&Utils_YUV420SP_NV21::GetInstance()); + case ImageBitmapFormat::HSV: + return UtilsUniquePtr(&Utils_HSV::GetInstance()); + case ImageBitmapFormat::Lab: + return UtilsUniquePtr(&Utils_Lab::GetInstance()); + case ImageBitmapFormat::DEPTH: + return UtilsUniquePtr(&Utils_Depth::GetInstance()); + default: + return nullptr; + } +} + +/* + * Helper functions. + */ +template +static UniquePtr +CvtSimpleImgToSimpleImg(Utils* aSrcUtils, const SrcType* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, DstType* aDstBuffer, + ImageBitmapFormat aDstFormat, int aDstChannelCount, + mozilla::function converter) +{ + MOZ_ASSERT(aSrcUtils, "Convert color from a null utility object."); + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + const nsTArray& channels = *aSrcLayout; + MOZ_ASSERT(channels.Length() == aSrcUtils->GetChannelCount(), + "The channel count is wrong."); + + const int dstStride = channels[0].mWidth * aDstChannelCount * sizeof(DstType); + int rv = converter(aSrcBuffer, channels[0].mStride, + aDstBuffer, dstStride, + channels[0].mWidth, channels[0].mHeight); + + if (NS_WARN_IF(rv != 0)) { + return nullptr; + } + + return CreateDefaultPixelLayout(aDstFormat, channels[0].mWidth, + channels[0].mHeight, dstStride); +} + +static UniquePtr +CvtYUVImgToSimpleImg(Utils* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer, + ImageBitmapFormat aDstFormat, int aDstChannelCount, + mozilla::function converter) +{ + MOZ_ASSERT(aSrcUtils, "Convert color from a null utility object."); + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + const nsTArray& channels = *aSrcLayout; + MOZ_ASSERT(channels.Length() == aSrcUtils->GetChannelCount(), + "The channel count is wrong."); + + const int dstStride = channels[0].mWidth * aDstChannelCount * sizeof(uint8_t); + int rv = converter(aSrcBuffer + channels[0].mOffset, channels[0].mStride, + aSrcBuffer + channels[1].mOffset, channels[1].mStride, + aSrcBuffer + channels[2].mOffset, channels[2].mStride, + aDstBuffer, dstStride, + channels[0].mWidth, channels[0].mHeight); + + if (NS_WARN_IF(rv != 0)) { + return nullptr; + } + + return CreateDefaultPixelLayout(aDstFormat, channels[0].mWidth, + channels[0].mHeight, dstStride); +} + +static UniquePtr +CvtNVImgToSimpleImg(Utils* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer, + ImageBitmapFormat aDstFormat, int aDstChannelCount, + mozilla::function converter) +{ + MOZ_ASSERT(aSrcUtils, "Convert color from a null utility object."); + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + const nsTArray& channels = *aSrcLayout; + MOZ_ASSERT(channels.Length() == aSrcUtils->GetChannelCount(), + "The channel count is wrong."); + + const int dstStride = channels[0].mWidth * aDstChannelCount * sizeof(uint8_t); + int rv = converter(aSrcBuffer + channels[0].mOffset, channels[0].mStride, + aSrcBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer, dstStride, + channels[0].mWidth, channels[0].mHeight); + + if (NS_WARN_IF(rv != 0)) { + return nullptr; + } + + return CreateDefaultPixelLayout(aDstFormat, channels[0].mWidth, + channels[0].mHeight, dstStride); +} + +static UniquePtr +CvtSimpleImgToYUVImg(Utils* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer, + ImageBitmapFormat aDstFormat, + mozilla::function converter) +{ + MOZ_ASSERT(aSrcUtils, "Convert color from a null utility object."); + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultPixelLayout(aDstFormat, (*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout."); + + const nsTArray& channels = *layout; + + int rv = converter(aSrcBuffer, (*aSrcLayout)[0].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer + channels[2].mOffset, channels[2].mStride, + channels[0].mWidth, channels[0].mHeight); + + if (NS_WARN_IF(rv != 0)) { + return nullptr; + } + + return layout; +} + +static UniquePtr +CvtSimpleImgToNVImg(Utils* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer, + ImageBitmapFormat aDstFormat, + mozilla::function converter) +{ + MOZ_ASSERT(aSrcUtils, "Convert color from a null utility object."); + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultPixelLayout(aDstFormat, (*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout."); + + const nsTArray& channels = *layout; + + int rv = converter(aSrcBuffer, (*aSrcLayout)[0].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + channels[0].mWidth, channels[0].mHeight); + + if (NS_WARN_IF(rv != 0)) { + return nullptr; + } + + return layout; +} + +template +static UniquePtr +TwoPassConversion(SrcUtilsType* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer, + ImageBitmapFormat aMiddleFormat, DstUtilsType* aDstUtils) +{ + MOZ_ASSERT(aSrcUtils, "Convert color from a null source utility."); + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + // I444 -> I420 -> I422 + UtilsUniquePtr yuv420PUtils = Utils::GetUtils(aMiddleFormat); + UniquePtr yuv420PBuffer(new uint8_t[yuv420PUtils->NeededBufferSize((*aSrcLayout)[0].mWidth, (*aSrcLayout)[0].mHeight)]); + UniquePtr yuv420PLayout = yuv420PUtils->ConvertFrom(aSrcUtils, aSrcBuffer, aSrcLayout, yuv420PBuffer.get()); + return yuv420PUtils->ConvertTo(aDstUtils, yuv420PBuffer.get(), yuv420PLayout.get(), aDstBuffer); +} + +static UniquePtr +PureCopy(Utils* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer, + ImageBitmapFormat aDstFormat) +{ + MOZ_ASSERT(aSrcUtils, "Convert color from a null utility object."); + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + const nsTArray& channels = *aSrcLayout; + MOZ_ASSERT(channels.Length() == aSrcUtils->GetChannelCount(), + "The channel count is wrong."); + + + uint32_t length = 0; + + if (aDstFormat == ImageBitmapFormat::RGBA32 || + aDstFormat == ImageBitmapFormat::BGRA32 || + aDstFormat == ImageBitmapFormat::RGB24 || + aDstFormat == ImageBitmapFormat::BGR24 || + aDstFormat == ImageBitmapFormat::GRAY8 || + aDstFormat == ImageBitmapFormat::HSV || + aDstFormat == ImageBitmapFormat::Lab || + aDstFormat == ImageBitmapFormat::DEPTH) { + length = channels[0].mHeight * channels[0].mStride; + } else if (aDstFormat == ImageBitmapFormat::YUV444P || + aDstFormat == ImageBitmapFormat::YUV422P || + aDstFormat == ImageBitmapFormat::YUV420P) { + length = channels[0].mHeight * channels[0].mStride + + channels[1].mHeight * channels[1].mStride + + channels[2].mHeight * channels[2].mStride; + } else if (aDstFormat == ImageBitmapFormat::YUV420SP_NV12 || + aDstFormat == ImageBitmapFormat::YUV420SP_NV21) { + length = channels[0].mHeight * channels[0].mStride + + channels[1].mHeight * channels[1].mStride; + } + + memcpy(aDstBuffer, aSrcBuffer, length); + + UniquePtr layout(new ImagePixelLayout(*aSrcLayout)); + return layout; +} + +UniquePtr +CreateDefaultLayoutForSimpleImage(uint32_t aWidth, uint32_t aHeight, + uint32_t aStride, int aChannels, + int aBytesPerPixelValue, + ChannelPixelLayoutDataType aDataType) +{ + UniquePtr layout(new ImagePixelLayout(aChannels)); + + // set mChannels + for (uint8_t i = 0; i < aChannels; ++i) { + ChannelPixelLayout* channel = layout->AppendElement(); + channel->mOffset = i * aBytesPerPixelValue; + channel->mWidth = aWidth; + channel->mHeight = aHeight; + channel->mDataType = aDataType; //ChannelPixelLayoutDataType::Uint8; + channel->mStride = aStride; + channel->mSkip = aChannels - 1; + } + + return layout; +} + +/* + * Utils_RGBA32. + */ +/* static */Utils_RGBA32& +Utils_RGBA32::GetInstance() +{ + static Utils_RGBA32 instance; + return instance; +} + +Utils_RGBA32::Utils_RGBA32() +: Utils(4, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_RGBA32::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_RGBA32::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_RGBA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_BGRA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &libyuv::ABGRToARGB); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_RGB24* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &RGB24ToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_BGR24* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &BGR24ToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &YUV444PToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &YUV422PToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &libyuv::I420ToABGR); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &NV12ToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &NV21ToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_HSV* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &HSVToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_Lab* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGBA32, 4, &LabToRGBA32); +} + +UniquePtr +Utils_RGBA32::ConvertFrom(Utils_Depth* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_RGBA32::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_RGBA32::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +/* + * Utils_BGRA32. + */ +/* static */Utils_BGRA32& +Utils_BGRA32::GetInstance() +{ + static Utils_BGRA32 instance; + return instance; +} + +Utils_BGRA32::Utils_BGRA32() +: Utils(4, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_BGRA32::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_BGRA32::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_RGBA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &libyuv::ABGRToARGB); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_BGRA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_RGB24* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &RGB24ToBGRA32); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_BGR24* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &BGR24ToBGRA32); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &YUV444PToBGRA32); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &libyuv::I422ToARGB); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &libyuv::I420ToARGB); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &libyuv::NV12ToARGB); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &libyuv::NV21ToARGB); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_HSV* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &HSVToBGRA32); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_Lab* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGRA32, 4, &LabToBGRA32); +} + +UniquePtr +Utils_BGRA32::ConvertFrom(Utils_Depth* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_BGRA32::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::RGBA32 || + aSrcFormat == ImageBitmapFormat::BGRA32 || + aSrcFormat == ImageBitmapFormat::YUV420P) { + return true; + } + + return false; +} + +UniquePtr +Utils_BGRA32::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +/* + * Utils_RGB24. + */ +/* static */Utils_RGB24& +Utils_RGB24::GetInstance() +{ + static Utils_RGB24 instance; + return instance; +} + +Utils_RGB24::Utils_RGB24() +: Utils(3, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_RGB24::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_RGB24::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_RGBA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &RGBA32ToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_BGRA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &BGRA32ToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &BGR24ToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &YUV444PToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &YUV422PToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &YUV420PToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &NV12ToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &NV21ToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_HSV* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &HSVToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_Lab* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, 3, &LabToRGB24); +} + +UniquePtr +Utils_RGB24::ConvertFrom(Utils_Depth* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_RGB24::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_RGB24::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +/* + * Utils_BGR24. + */ +/* static */Utils_BGR24& +Utils_BGR24::GetInstance() +{ + static Utils_BGR24 instance; + return instance; +} + +Utils_BGR24::Utils_BGR24() +: Utils(3, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_BGR24::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_BGR24::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_RGBA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &RGBA32ToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_BGRA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &BGRA32ToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &RGB24ToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &YUV444PToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &YUV422PToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &YUV420PToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &NV12ToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &NV21ToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_HSV* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &HSVToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_Lab* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, (const float*)aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::BGR24, 3, &LabToBGR24); +} + +UniquePtr +Utils_BGR24::ConvertFrom(Utils_Depth* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_BGR24::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_BGR24::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +/* + * Utils_Gray8. + */ +/* static */Utils_Gray8& +Utils_Gray8::GetInstance() +{ + static Utils_Gray8 instance; + return instance; +} + +Utils_Gray8::Utils_Gray8() +: Utils(1, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_Gray8::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_Gray8::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_RGBA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &RGBA32ToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_BGRA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &BGRA32ToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &RGB24ToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &BGR24ToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_Gray8* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &YUV444PToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &YUV422PToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtYUVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &YUV420PToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &NV12ToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtNVImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::GRAY8, 1, &NV21ToGray8); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Gray8::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_Gray8::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_Gray8::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +/* + * class Utils_YUV444P. + */ +/* static */Utils_YUV444P& +Utils_YUV444P::GetInstance() +{ + static Utils_YUV444P instance; + return instance; +} + +Utils_YUV444P::Utils_YUV444P() +: Utils(3, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_YUV444P::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_YUV444P::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_RGBA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV444P, &RGBA32ToYUV444P); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_BGRA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV444P, &libyuv::ARGBToI444); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV444P, &RGB24ToYUV444P); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV444P, &BGR24ToYUV444P); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV444P); +} + +// TODO: optimize me. +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_YUV420P*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV444P"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + int rv = I420ToI444(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aSrcBuffer + srcChannels[2].mOffset, srcChannels[2].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer + channels[2].mOffset, channels[2].mStride, + channels[0].mWidth, channels[0].mHeight); + + if (NS_WARN_IF(rv != 0)) { + return nullptr; + } + + return layout; +} + +// TODO: optimize me. +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +// TODO: optimize me. +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV444P::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_YUV444P::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_YUV444P::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + UniquePtr layout(new ImagePixelLayout(mChannels)); + + // set mChannels + ChannelPixelLayout* ychannel = layout->AppendElement(); + ChannelPixelLayout* uchannel = layout->AppendElement(); + ChannelPixelLayout* vchannel = layout->AppendElement(); + ychannel->mOffset = 0; + ychannel->mWidth = aWidth; + ychannel->mHeight = aHeight; + ychannel->mDataType = ChannelPixelLayoutDataType::Uint8; + ychannel->mStride = aStride; + ychannel->mSkip = 0; // aYSkip; + + uchannel->mOffset = ychannel->mOffset + ychannel->mStride * ychannel->mHeight; + uchannel->mWidth = aWidth; + uchannel->mHeight = aHeight; + uchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + uchannel->mStride = aStride; + uchannel->mSkip = 0; // aUSkip; + + vchannel->mOffset = uchannel->mOffset + uchannel->mStride * uchannel->mHeight; + vchannel->mWidth = aWidth; + vchannel->mHeight = aHeight; + vchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + vchannel->mStride = aStride; + vchannel->mSkip = 0; // aVSkip; + + return layout; +} + +/* + * class Utils_YUV422P. + */ +/* static */Utils_YUV422P& +Utils_YUV422P::GetInstance() +{ + static Utils_YUV422P instance; + return instance; +} + +Utils_YUV422P::Utils_YUV422P() +: Utils(3, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_YUV422P::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * mBytesPerPixelValue + + 2 * ((aWidth + 1) / 2) * aHeight * mBytesPerPixelValue; +} + +UniquePtr +Utils_YUV422P::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_RGBA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV422P, &RGBA32ToYUV422P); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_BGRA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV422P, &libyuv::ARGBToI422); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV422P, &RGB24ToYUV422P); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV422P, &BGR24ToYUV422P); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +// TODO: optimize me. +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV422P); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_YUV420P*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV422P"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + libyuv::I420ToI422(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aSrcBuffer + srcChannels[2].mOffset, srcChannels[2].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer + channels[2].mOffset, channels[2].mStride, + channels[0].mWidth, channels[0].mHeight); + + return layout; +} + +// TODO: optimize me. +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +// TODO: optimize me. +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV422P::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_YUV422P::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_YUV422P::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + UniquePtr layout(new ImagePixelLayout(mChannels)); + + // set mChannels + ChannelPixelLayout* ychannel = layout->AppendElement(); + ChannelPixelLayout* uchannel = layout->AppendElement(); + ChannelPixelLayout* vchannel = layout->AppendElement(); + ychannel->mOffset = 0; + ychannel->mWidth = aWidth; + ychannel->mHeight = aHeight; + ychannel->mDataType = ChannelPixelLayoutDataType::Uint8; + ychannel->mStride = aStride; + ychannel->mSkip = 0; // aYSkip; + + uchannel->mOffset = ychannel->mOffset + ychannel->mStride * ychannel->mHeight; + uchannel->mWidth = (aWidth + 1) / 2; + uchannel->mHeight = aHeight; + uchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + uchannel->mStride = (aStride + 1) / 2; + uchannel->mSkip = 0; // aUSkip; + + vchannel->mOffset = uchannel->mOffset + uchannel->mStride * uchannel->mHeight; + vchannel->mWidth = (aWidth + 1) / 2; + vchannel->mHeight = aHeight; + vchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + vchannel->mStride = (aStride + 1) / 2; + vchannel->mSkip = 0; // aVSkip; + + return layout; +} + +/* + * Utils_YUV420P. + */ +/* static */Utils_YUV420P& +Utils_YUV420P::GetInstance() +{ + static Utils_YUV420P instance; + return instance; +} + +Utils_YUV420P::Utils_YUV420P() +: Utils(3, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_YUV420P::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * mBytesPerPixelValue + + 2 * ((aWidth + 1) / 2) * ((aHeight + 1) / 2) * mBytesPerPixelValue; +} + +UniquePtr +Utils_YUV420P::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_RGBA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, &libyuv::ABGRToI420); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_BGRA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, &libyuv::ARGBToI420); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, &RGB24ToYUV420P); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToYUVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, &BGR24ToYUV420P); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_YUV444P*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV420P"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + libyuv::I444ToI420(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aSrcBuffer + srcChannels[2].mOffset, srcChannels[2].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer + channels[2].mOffset, channels[2].mStride, + channels[0].mWidth, channels[0].mHeight); + + return layout; +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_YUV422P*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV420P"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + libyuv::I422ToI420(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aSrcBuffer + srcChannels[2].mOffset, srcChannels[2].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer + channels[2].mOffset, channels[2].mStride, + channels[0].mWidth, channels[0].mHeight); + + return layout; +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_YUV420SP_NV12*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV420P"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + libyuv::NV12ToI420(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer + channels[2].mOffset, channels[2].mStride, + channels[0].mWidth, channels[0].mHeight); + + return layout; +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_YUV420SP_NV21*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV420P"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + libyuv::NV21ToI420(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + aDstBuffer + channels[2].mOffset, channels[2].mStride, + channels[0].mWidth, channels[0].mHeight); + + return layout; +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV420P::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_YUV420P::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_YUV420P::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + UniquePtr layout(new ImagePixelLayout(mChannels)); + + // set mChannels + ChannelPixelLayout* ychannel = layout->AppendElement(); + ChannelPixelLayout* uchannel = layout->AppendElement(); + ChannelPixelLayout* vchannel = layout->AppendElement(); + ychannel->mOffset = 0; + ychannel->mWidth = aWidth; + ychannel->mHeight = aHeight; + ychannel->mDataType = ChannelPixelLayoutDataType::Uint8; + ychannel->mStride = aStride; + ychannel->mSkip = 0; // aYSkip; + + uchannel->mOffset = ychannel->mOffset + ychannel->mStride * ychannel->mHeight; + uchannel->mWidth = (aWidth + 1) / 2; + uchannel->mHeight = (aHeight + 1) / 2; + uchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + uchannel->mStride = (aStride + 1) / 2; + uchannel->mSkip = 0; // aUSkip; + + vchannel->mOffset = uchannel->mOffset + uchannel->mStride * uchannel->mHeight; + vchannel->mWidth = (aWidth + 1) / 2; + vchannel->mHeight = (aHeight + 1) / 2; + vchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + vchannel->mStride = (aStride + 1) / 2; + vchannel->mSkip = 0; // aVSkip; + + return layout; +} + +/* + * class Utils_YUV420SP_NV12. + */ +/* static */Utils_YUV420SP_NV12& +Utils_YUV420SP_NV12::GetInstance() +{ + static Utils_YUV420SP_NV12 instance; + return instance; +} + +Utils_YUV420SP_NV12::Utils_YUV420SP_NV12() +: Utils(3, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_YUV420SP_NV12::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * mBytesPerPixelValue + + 2 * ((aWidth + 1) / 2) * ((aHeight + 1) / 2) * mBytesPerPixelValue; +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_RGBA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV12, &RGBA32ToNV12); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_BGRA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV12, &libyuv::ARGBToNV12); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV12, &RGB24ToNV12); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV12, &BGR24ToNV12); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +// TODO: optimize me. +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +// TODO: optimize me. +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_YUV420P*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV420SP_NV12"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + libyuv::I420ToNV12(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aSrcBuffer + srcChannels[2].mOffset, srcChannels[2].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + channels[0].mWidth, channels[0].mHeight); + + return layout; +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV12); +} + +// TODO: optimize me. +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV420SP_NV12::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_YUV420SP_NV12::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_YUV420SP_NV12::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + UniquePtr layout(new ImagePixelLayout(mChannels)); + + // set mChannels + ChannelPixelLayout* ychannel = layout->AppendElement(); + ChannelPixelLayout* uchannel = layout->AppendElement(); + ChannelPixelLayout* vchannel = layout->AppendElement(); + ychannel->mOffset = 0; + ychannel->mWidth = aWidth; + ychannel->mHeight = aHeight; + ychannel->mDataType = ChannelPixelLayoutDataType::Uint8; + ychannel->mStride = aStride; + ychannel->mSkip = 0; // aYSkip; + + uchannel->mOffset = ychannel->mOffset + ychannel->mStride * ychannel->mHeight; + uchannel->mWidth = (aWidth + 1) / 2; + uchannel->mHeight = (aHeight + 1) / 2; + uchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + uchannel->mStride = uchannel->mWidth * 2; + uchannel->mSkip = 1; // aUSkip; + + vchannel->mOffset = ychannel->mOffset + ychannel->mStride * ychannel->mHeight + 1; + vchannel->mWidth = (aWidth + 1) / 2; + vchannel->mHeight = (aHeight + 1) / 2; + vchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + vchannel->mStride = vchannel->mWidth * 2; + vchannel->mSkip = 1; // aVSkip; + + return layout; +} + +/* + * class Utils_YUV420SP_NV21. + */ +/* static */Utils_YUV420SP_NV21& +Utils_YUV420SP_NV21::GetInstance() +{ + static Utils_YUV420SP_NV21 instance; + return instance; +} + +Utils_YUV420SP_NV21::Utils_YUV420SP_NV21() +: Utils(3, ChannelPixelLayoutDataType::Uint8) +{ +} + +uint32_t +Utils_YUV420SP_NV21::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * mBytesPerPixelValue + + 2 * ((aWidth + 1) / 2) * ((aHeight + 1) / 2) * mBytesPerPixelValue; +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_RGBA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV21, &RGBA32ToNV21); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_BGRA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV21, &libyuv::ARGBToNV21); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV21, &RGB24ToNV21); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToNVImg(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV21, &BGR24ToNV21); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +// TODO: optimize me. +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +// TODO: optimize me. +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_YUV420P*, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UniquePtr layout = + CreateDefaultLayout((*aSrcLayout)[0].mWidth, + (*aSrcLayout)[0].mHeight, + (*aSrcLayout)[0].mWidth); + + MOZ_ASSERT(layout, "Cannot create a ImagePixelLayout of YUV420SP_NV21"); + + const nsTArray& channels = *layout; + + const nsTArray& srcChannels = *aSrcLayout; + + libyuv::I420ToNV21(aSrcBuffer + srcChannels[0].mOffset, srcChannels[0].mStride, + aSrcBuffer + srcChannels[1].mOffset, srcChannels[1].mStride, + aSrcBuffer + srcChannels[2].mOffset, srcChannels[2].mStride, + aDstBuffer + channels[0].mOffset, channels[0].mStride, + aDstBuffer + channels[1].mOffset, channels[1].mStride, + channels[0].mWidth, channels[0].mHeight); + + return layout; +} + +// TODO: optimize me. +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420P, this); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::YUV420SP_NV21); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_YUV420SP_NV21::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_YUV420SP_NV21::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_YUV420SP_NV21::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + UniquePtr layout(new ImagePixelLayout(mChannels)); + + // set mChannels + ChannelPixelLayout* ychannel = layout->AppendElement(); + ChannelPixelLayout* vchannel = layout->AppendElement(); // v is the 2nd channel. + ChannelPixelLayout* uchannel = layout->AppendElement(); // u is the 3rd channel. + ychannel->mOffset = 0; + ychannel->mWidth = aWidth; + ychannel->mHeight = aHeight; + ychannel->mDataType = ChannelPixelLayoutDataType::Uint8; + ychannel->mStride = aStride; + ychannel->mSkip = 0; // aYSkip; + + vchannel->mOffset = ychannel->mOffset + ychannel->mStride * ychannel->mHeight; + vchannel->mWidth = (aWidth + 1) / 2; + vchannel->mHeight = (aHeight + 1) / 2; + vchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + vchannel->mStride = vchannel->mWidth * 2; + vchannel->mSkip = 1; // aVSkip; + + uchannel->mOffset = ychannel->mOffset + ychannel->mStride * ychannel->mHeight + 1; + uchannel->mWidth = (aWidth + 1) / 2; + uchannel->mHeight = (aHeight + 1) / 2; + uchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + uchannel->mStride = uchannel->mWidth * 2; + uchannel->mSkip = 1; // aUSkip; + + return layout; +} + +/* + * Utils_HSV. + */ +/* static */Utils_HSV& +Utils_HSV::GetInstance() +{ + static Utils_HSV instance; + return instance; +} + +Utils_HSV::Utils_HSV() +: Utils(3, ChannelPixelLayoutDataType::Float32) +{ +} + +uint32_t +Utils_HSV::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_HSV::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_RGBA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::HSV, 3, &RGBA32ToHSV); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_BGRA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcFormat, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::HSV, 3, &BGRA32ToHSV); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::HSV, 3, &RGB24ToHSV); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::HSV, 3, &BGR24ToHSV); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::HSV); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_HSV::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_HSV::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_HSV::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +/* + * Utils_Lab. + */ +/* static */Utils_Lab& +Utils_Lab::GetInstance() +{ + static Utils_Lab instance; + return instance; +} + +Utils_Lab::Utils_Lab() +: Utils(3, ChannelPixelLayoutDataType::Float32) +{ +} + +uint32_t +Utils_Lab::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_Lab::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_RGBA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::Lab, 3, &RGBA32ToLab); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_BGRA32* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::Lab, 3, &BGRA32ToLab); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::Lab, 3, &RGB24ToLab); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return CvtSimpleImgToSimpleImg(aSrcUtils, aSrcBuffer, aSrcLayout, (float*)aDstBuffer, ImageBitmapFormat::Lab, 3, &BGR24ToLab); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return TwoPassConversion(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::RGB24, this); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::Lab); +} + +UniquePtr +Utils_Lab::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +bool +Utils_Lab::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::GRAY8 || + aSrcFormat == ImageBitmapFormat::DEPTH) { + return false; + } + + return true; +} + +UniquePtr +Utils_Lab::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +/* + * Utils_Depth. + */ +/* static */Utils_Depth& +Utils_Depth::GetInstance() +{ + static Utils_Depth instance; + return instance; +} + +Utils_Depth::Utils_Depth() +: Utils(1, ChannelPixelLayoutDataType::Uint16) +{ +} + +uint32_t +Utils_Depth::NeededBufferSize(uint32_t aWidth, uint32_t aHeight) +{ + return aWidth * aHeight * (uint32_t)mChannels * mBytesPerPixelValue; +} + +UniquePtr +Utils_Depth::ConvertTo(Utils* aDstFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return aDstFormat->ConvertFrom(this, aSrcBuffer, aSrcLayout, aDstBuffer); +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_RGBA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_BGRA32* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_RGB24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_BGR24* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_Gray8* aSrcFormat, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_YUV444P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_YUV422P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_YUV420P* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_YUV420SP_NV12* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_YUV420SP_NV21* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_HSV* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_Lab* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return nullptr; +} + +UniquePtr +Utils_Depth::ConvertFrom(Utils_Depth* aSrcUtils, const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, uint8_t* aDstBuffer) +{ + return PureCopy(aSrcUtils, aSrcBuffer, aSrcLayout, aDstBuffer, ImageBitmapFormat::DEPTH); +} + +bool +Utils_Depth::CanConvertFrom(ImageBitmapFormat aSrcFormat) +{ + if (aSrcFormat == ImageBitmapFormat::DEPTH ) { + return true; + } + + return false; +} + +UniquePtr +Utils_Depth::CreateDefaultLayout(uint32_t aWidth, uint32_t aHeight, uint32_t aStride) +{ + return CreateDefaultLayoutForSimpleImage(aWidth, aHeight, aStride, mChannels, mBytesPerPixelValue, mDataType); +} + +} // namespace imagebitmapformat + +/* + * Global functions. + */ + +using namespace mozilla::dom::imagebitmapformat; + +UniquePtr +CreateDefaultPixelLayout(ImageBitmapFormat aFormat, uint32_t aWidth, + uint32_t aHeight, uint32_t aStride) +{ + UtilsUniquePtr format = Utils::GetUtils(aFormat); + MOZ_ASSERT(format, "Cannot get a valid ImageBitmapFormatUtils instance."); + + return format->CreateDefaultLayout(aWidth, aHeight, aStride); +} + +UniquePtr +CreatePixelLayoutFromPlanarYCbCrData(const layers::PlanarYCbCrData* aData) +{ + if (!aData) { + // something wrong + return nullptr; + } + + UniquePtr layout(new ImagePixelLayout(3)); + + ChannelPixelLayout* ychannel = layout->AppendElement(); + ChannelPixelLayout* uchannel = layout->AppendElement(); + ChannelPixelLayout* vchannel = layout->AppendElement(); + + ychannel->mOffset = 0; + + if (aData->mCrChannel - aData->mCbChannel > 0) { + uchannel->mOffset = ychannel->mOffset + (aData->mCbChannel - aData->mYChannel); + vchannel->mOffset = uchannel->mOffset + (aData->mCrChannel - aData->mCbChannel); + } else { + uchannel->mOffset = ychannel->mOffset + (aData->mCrChannel - aData->mYChannel); + vchannel->mOffset = uchannel->mOffset + (aData->mCbChannel - aData->mCrChannel); + } + + ychannel->mWidth = aData->mYSize.width; + ychannel->mHeight = aData->mYSize.height; + ychannel->mDataType = ChannelPixelLayoutDataType::Uint8; + ychannel->mStride = aData->mYStride; + ychannel->mSkip = aData->mYSkip; + + uchannel->mWidth = aData->mCbCrSize.width; + uchannel->mHeight = aData->mCbCrSize.height; + uchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + uchannel->mStride = aData->mCbCrStride; + uchannel->mSkip = aData->mCbSkip; + + vchannel->mWidth = aData->mCbCrSize.width; + vchannel->mHeight = aData->mCbCrSize.height; + vchannel->mDataType = ChannelPixelLayoutDataType::Uint8; + vchannel->mStride = aData->mCbCrStride; + vchannel->mSkip = aData->mCrSkip; + + return layout; +} + +uint8_t +GetChannelCountOfImageFormat(ImageBitmapFormat aFormat) +{ + UtilsUniquePtr format = Utils::GetUtils(aFormat); + MOZ_ASSERT(format, "Cannot get a valid ImageBitmapFormatUtils instance."); + + return format->GetChannelCount(); +} + +uint32_t +CalculateImageBufferSize(ImageBitmapFormat aFormat, + uint32_t aWidth, uint32_t aHeight) +{ + UtilsUniquePtr format = Utils::GetUtils(aFormat); + MOZ_ASSERT(format, "Cannot get a valid ImageBitmapFormatUtils instance."); + + return format->NeededBufferSize(aWidth, aHeight); +} + +UniquePtr +CopyAndConvertImageData(ImageBitmapFormat aSrcFormat, + const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, + ImageBitmapFormat aDstFormat, + uint8_t* aDstBuffer) +{ + MOZ_ASSERT(aSrcBuffer, "Convert color from a null buffer."); + MOZ_ASSERT(aSrcLayout, "Convert color from a null layout."); + MOZ_ASSERT(aDstBuffer, "Convert color to a null buffer."); + + UtilsUniquePtr srcFormat = Utils::GetUtils(aSrcFormat); + UtilsUniquePtr dstFormat = Utils::GetUtils(aDstFormat); + MOZ_ASSERT(srcFormat, "Cannot get a valid ImageBitmapFormatUtils instance."); + MOZ_ASSERT(dstFormat, "Cannot get a valid ImageBitmapFormatUtils instance."); + + return srcFormat->ConvertTo(dstFormat.get(), aSrcBuffer, aSrcLayout, aDstBuffer); +} + +ImageBitmapFormat +FindBestMatchingFromat(ImageBitmapFormat aSrcFormat, + const Sequence& aCandidates) { + + for(auto& candidate : aCandidates) { + UtilsUniquePtr candidateFormat = Utils::GetUtils(candidate); + MOZ_ASSERT(candidateFormat, "Cannot get a valid ImageBitmapFormatUtils instance."); + + if (candidateFormat->CanConvertFrom(aSrcFormat)) { + return candidate; + } + } + + return ImageBitmapFormat::EndGuard_; +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/ImageBitmapUtils.h b/dom/canvas/ImageBitmapUtils.h new file mode 100644 index 000000000..39be43d8a --- /dev/null +++ b/dom/canvas/ImageBitmapUtils.h @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_ImageBitmapUtils_h +#define mozilla_dom_ImageBitmapUtils_h + +#include "mozilla/UniquePtr.h" +#include "nsTArrayForwardDeclare.h" + +namespace mozilla { + +namespace layers { +class Image; +struct PlanarYCbCrData; +} + +namespace dom { + +struct ChannelPixelLayout; +template class Sequence; + +typedef nsTArray ImagePixelLayout; + +/* + * This function creates an ImagePixelLayout object which describes the + * default layout of the given ImageBitmapFormat with the given width, height + * and stride. + */ +UniquePtr +CreateDefaultPixelLayout(ImageBitmapFormat aFormat, + uint32_t aWidth, uint32_t aHeight, uint32_t aStride); + +/* + * This function extracts information from the aImage parameter to customize + * the ImagePixelLayout object, that is, this function creates a customized + * ImagePixelLayout object which exactly describes the pixel layout of the + * given aImage. + */ +UniquePtr +CreatePixelLayoutFromPlanarYCbCrData(const layers::PlanarYCbCrData* aData); + +/* + * Get the number of channels of the given ImageBitmapFormat. + */ +uint8_t +GetChannelCountOfImageFormat(ImageBitmapFormat aFormat); + +/* + * Get the needed buffer size to store the image data in the given + * ImageBitmapFormat with the given width and height. + */ +uint32_t +CalculateImageBufferSize(ImageBitmapFormat aFormat, + uint32_t aWidth, uint32_t aHeight); + +/* + * This function always copies the image data in _aSrcBuffer_ into _aDstBuffer_ + * and it also performs color conversion if the _aSrcFormat_ and the + * _aDstFormat_ are different. + * + * The source image is stored in the _aSrcBuffer_ and the corresponding pixel + * layout is described by the _aSrcLayout_. + * + * The copied and converted image will be stored in the _aDstBuffer_, which + * should be allocated with enough size before invoking this function and the + * needed size could be found by the CalculateImageBufferSize() method. + * + * The returned ImagePixelLayout object describes the pixel layout of the result + * image and will be null if on failure. + */ +UniquePtr +CopyAndConvertImageData(ImageBitmapFormat aSrcFormat, + const uint8_t* aSrcBuffer, + const ImagePixelLayout* aSrcLayout, + ImageBitmapFormat aDstFormat, + uint8_t* aDstBuffer); + +/* + * This function tries to find the best ImageBitmapFormat, from the aCandiates, + * which can be converted from the aSrcFormat. The algorithm now merely returns + * the FIRST one, from the aCandidates, which can be converted from the + * aSrcFormat. + * + * TODO: The algorithm should be updated after we implement optimizations for + * different platforms (different kinds of layers::Image), considering + * that some conversion might be cheaper through hardware. + */ +ImageBitmapFormat +FindBestMatchingFromat(ImageBitmapFormat aSrcFormat, + const Sequence& aCandidates); + +} // namespace dom +} // namespace mozilla + + +#endif // mozilla_dom_ImageBitmapUtils_h diff --git a/dom/canvas/ImageData.cpp b/dom/canvas/ImageData.cpp new file mode 100644 index 000000000..b201fa279 --- /dev/null +++ b/dom/canvas/ImageData.cpp @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 et tw=78: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/dom/ImageData.h" + +#include "mozilla/CheckedInt.h" +#include "mozilla/HoldDropJSObjects.h" +#include "mozilla/dom/ImageDataBinding.h" + +#include "jsapi.h" + +namespace mozilla { +namespace dom { + +NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageData) +NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageData) + +NS_IMPL_CYCLE_COLLECTION_CLASS(ImageData) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageData) + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ImageData) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mData) +NS_IMPL_CYCLE_COLLECTION_TRACE_END + +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ImageData) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END + +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ImageData) + tmp->DropData(); +NS_IMPL_CYCLE_COLLECTION_UNLINK_END + +//static +already_AddRefed +ImageData::Constructor(const GlobalObject& aGlobal, + const uint32_t aWidth, + const uint32_t aHeight, + ErrorResult& aRv) +{ + if (aWidth == 0 || aHeight == 0) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + CheckedInt length = CheckedInt(aWidth) * aHeight * 4; + if (!length.isValid()) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + js::AssertSameCompartment(aGlobal.Context(), aGlobal.Get()); + JSObject* data = Uint8ClampedArray::Create(aGlobal.Context(), + length.value()); + if (!data) { + aRv.Throw(NS_ERROR_OUT_OF_MEMORY); + return nullptr; + } + RefPtr imageData = new ImageData(aWidth, aHeight, *data); + return imageData.forget(); +} + +//static +already_AddRefed +ImageData::Constructor(const GlobalObject& aGlobal, + const Uint8ClampedArray& aData, + const uint32_t aWidth, + const Optional& aHeight, + ErrorResult& aRv) +{ + aData.ComputeLengthAndData(); + + uint32_t length = aData.Length(); + if (length == 0 || length % 4) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + length /= 4; + if (aWidth == 0) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + uint32_t height = length / aWidth; + if (length != aWidth * height || + (aHeight.WasPassed() && aHeight.Value() != height)) { + aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + return nullptr; + } + if (JS_GetTypedArraySharedness(aData.Obj())) { + // Throw if the object is mapping shared memory (must opt in). + aRv.ThrowTypeError(NS_LITERAL_STRING("Argument of ImageData constructor")); + return nullptr; + } + RefPtr imageData = new ImageData(aWidth, height, *aData.Obj()); + return imageData.forget(); +} + +void +ImageData::HoldData() +{ + mozilla::HoldJSObjects(this); +} + +void +ImageData::DropData() +{ + if (mData) { + mData = nullptr; + mozilla::DropJSObjects(this); + } +} + +bool +ImageData::WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) +{ + return ImageDataBinding::Wrap(aCx, this, aGivenProto, aReflector); +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/ImageData.h b/dom/canvas/ImageData.h new file mode 100644 index 000000000..50f2c6535 --- /dev/null +++ b/dom/canvas/ImageData.h @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 et tw=78: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_ImageData_h +#define mozilla_dom_ImageData_h + +#include "nsIDOMCanvasRenderingContext2D.h" + +#include "mozilla/Attributes.h" +#include "mozilla/dom/BindingUtils.h" +#include "mozilla/dom/TypedArray.h" +#include + +#include "nsCycleCollectionParticipant.h" +#include "nsISupportsImpl.h" +#include "js/GCAPI.h" + +namespace mozilla { +namespace dom { + +class ImageData final : public nsISupports +{ + ~ImageData() + { + MOZ_COUNT_DTOR(ImageData); + DropData(); + } + +public: + ImageData(uint32_t aWidth, uint32_t aHeight, JSObject& aData) + : mWidth(aWidth) + , mHeight(aHeight) + , mData(&aData) + { + MOZ_COUNT_CTOR(ImageData); + HoldData(); + } + + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageData) + + static already_AddRefed + Constructor(const GlobalObject& aGlobal, + const uint32_t aWidth, + const uint32_t aHeight, + ErrorResult& aRv); + + static already_AddRefed + Constructor(const GlobalObject& aGlobal, + const Uint8ClampedArray& aData, + const uint32_t aWidth, + const Optional& aHeight, + ErrorResult& aRv); + + uint32_t Width() const + { + return mWidth; + } + uint32_t Height() const + { + return mHeight; + } + void GetData(JSContext* cx, JS::MutableHandle aData) const + { + aData.set(GetDataObject()); + } + JSObject* GetDataObject() const + { + return mData; + } + + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); + +private: + void HoldData(); + void DropData(); + + ImageData() = delete; + + uint32_t mWidth, mHeight; + JS::Heap mData; +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_ImageData_h diff --git a/dom/canvas/ImageUtils.cpp b/dom/canvas/ImageUtils.cpp new file mode 100644 index 000000000..8ff710689 --- /dev/null +++ b/dom/canvas/ImageUtils.cpp @@ -0,0 +1,291 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "ImageUtils.h" +#include "ImageBitmapUtils.h" +#include "ImageContainer.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/dom/ImageBitmapBinding.h" +#include "mozilla/ErrorResult.h" + +using namespace mozilla::layers; +using namespace mozilla::gfx; + +namespace mozilla { +namespace dom { + +static ImageBitmapFormat +GetImageBitmapFormatFromSurfaceFromat(SurfaceFormat aSurfaceFormat) +{ + switch (aSurfaceFormat) { + case SurfaceFormat::B8G8R8A8: + case SurfaceFormat::B8G8R8X8: + return ImageBitmapFormat::BGRA32; + case SurfaceFormat::R8G8B8A8: + case SurfaceFormat::R8G8B8X8: + return ImageBitmapFormat::RGBA32; + case SurfaceFormat::R8G8B8: + return ImageBitmapFormat::RGB24; + case SurfaceFormat::B8G8R8: + return ImageBitmapFormat::BGR24; + case SurfaceFormat::HSV: + return ImageBitmapFormat::HSV; + case SurfaceFormat::Lab: + return ImageBitmapFormat::Lab; + case SurfaceFormat::Depth: + return ImageBitmapFormat::DEPTH; + case SurfaceFormat::A8: + return ImageBitmapFormat::GRAY8; + case SurfaceFormat::R5G6B5_UINT16: + case SurfaceFormat::YUV: + case SurfaceFormat::NV12: + case SurfaceFormat::UNKNOWN: + default: + return ImageBitmapFormat::EndGuard_; + } +} + +static ImageBitmapFormat +GetImageBitmapFormatFromPlanarYCbCrData(layers::PlanarYCbCrData const *aData) +{ + MOZ_ASSERT(aData); + + if (aData->mYSkip == 0 && aData->mCbSkip == 0 && aData->mCrSkip == 0) { // Possibly three planes. + if (aData->mCbChannel >= aData->mYChannel + aData->mYSize.height * aData->mYStride && + aData->mCrChannel >= aData->mCbChannel + aData->mCbCrSize.height * aData->mCbCrStride) { // Three planes. + if (aData->mYSize.height == aData->mCbCrSize.height) { + if (aData->mYSize.width == aData->mCbCrSize.width) { + return ImageBitmapFormat::YUV444P; + } else if (((aData->mYSize.width + 1) / 2) == aData->mCbCrSize.width) { + return ImageBitmapFormat::YUV422P; + } + } else if (((aData->mYSize.height + 1) / 2) == aData->mCbCrSize.height) { + if (((aData->mYSize.width + 1) / 2) == aData->mCbCrSize.width) { + return ImageBitmapFormat::YUV420P; + } + } + } + } else if (aData->mYSkip == 0 && aData->mCbSkip == 1 && aData->mCrSkip == 1) { // Possibly two planes. + if (aData->mCbChannel >= aData->mYChannel + aData->mYSize.height * aData->mYStride && + aData->mCbChannel == aData->mCrChannel - 1) { // Two planes. + if (((aData->mYSize.height + 1) / 2) == aData->mCbCrSize.height && + ((aData->mYSize.width + 1) / 2) == aData->mCbCrSize.width) { + return ImageBitmapFormat::YUV420SP_NV12; // Y-Cb-Cr + } + } else if (aData->mCrChannel >= aData->mYChannel + aData->mYSize.height * aData->mYStride && + aData->mCrChannel == aData->mCbChannel - 1) { // Two planes. + if (((aData->mYSize.height + 1) / 2) == aData->mCbCrSize.height && + ((aData->mYSize.width + 1) / 2) == aData->mCbCrSize.width) { + return ImageBitmapFormat::YUV420SP_NV21; // Y-Cr-Cb + } + } + } + + return ImageBitmapFormat::EndGuard_; +} + +// ImageUtils::Impl implements the _generic_ algorithm which always readback +// data in RGBA format into CPU memory. +// Since layers::CairoImage is just a warpper to a DataSourceSurface, the +// implementation of CairoSurfaceImpl is nothing different to the generic +// version. +class ImageUtils::Impl +{ +public: + explicit Impl(layers::Image* aImage) + : mImage(aImage) + , mSurface(nullptr) + { + } + + virtual ~Impl() + { + } + + virtual ImageBitmapFormat + GetFormat() const + { + return GetImageBitmapFormatFromSurfaceFromat(Surface()->GetFormat()); + } + + virtual uint32_t + GetBufferLength() const + { + const uint32_t stride = Surface()->Stride(); + const IntSize size = Surface()->GetSize(); + return (uint32_t)(size.height * stride); + } + + virtual UniquePtr + MapDataInto(uint8_t* aBuffer, + uint32_t aOffset, + uint32_t aBufferLength, + ImageBitmapFormat aFormat, + ErrorResult& aRv) const + { + DataSourceSurface::ScopedMap map(Surface(), DataSourceSurface::READ); + if (!map.IsMapped()) { + aRv.Throw(NS_ERROR_ILLEGAL_VALUE); + return nullptr; + } + + // Copy or convert data. + UniquePtr srcLayout = + CreateDefaultPixelLayout(GetFormat(), Surface()->GetSize().width, + Surface()->GetSize().height, map.GetStride()); + + // Prepare destination buffer. + uint8_t* dstBuffer = aBuffer + aOffset; + UniquePtr dstLayout = + CopyAndConvertImageData(GetFormat(), map.GetData(), srcLayout.get(), + aFormat, dstBuffer); + + if (!dstLayout) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + return dstLayout; + } + +protected: + Impl() {} + + DataSourceSurface* Surface() const + { + if (!mSurface) { + RefPtr surface = mImage->GetAsSourceSurface(); + MOZ_ASSERT(surface); + + mSurface = surface->GetDataSurface(); + MOZ_ASSERT(mSurface); + } + + return mSurface.get(); + } + + RefPtr mImage; + mutable RefPtr mSurface; +}; + +// YUVImpl is optimized for the layers::PlanarYCbCrImage and layers::NVImage. +// This implementation does not readback data in RGBA format but keep it in YUV +// format family. +class YUVImpl final : public ImageUtils::Impl +{ +public: + explicit YUVImpl(layers::Image* aImage) + : Impl(aImage) + { + MOZ_ASSERT(aImage->GetFormat() == ImageFormat::PLANAR_YCBCR || + aImage->GetFormat() == ImageFormat::NV_IMAGE); + } + + ImageBitmapFormat GetFormat() const override + { + return GetImageBitmapFormatFromPlanarYCbCrData(GetPlanarYCbCrData()); + } + + uint32_t GetBufferLength() const override + { + if (mImage->GetFormat() == ImageFormat::PLANAR_YCBCR) { + return mImage->AsPlanarYCbCrImage()->GetDataSize(); + } else { + return mImage->AsNVImage()->GetBufferSize(); + } + } + + UniquePtr + MapDataInto(uint8_t* aBuffer, + uint32_t aOffset, + uint32_t aBufferLength, + ImageBitmapFormat aFormat, + ErrorResult& aRv) const override + { + // Prepare source buffer and pixel layout. + const PlanarYCbCrData* data = GetPlanarYCbCrData(); + + UniquePtr srcLayout = + CreatePixelLayoutFromPlanarYCbCrData(data); + + // Do conversion. + UniquePtr dstLayout = + CopyAndConvertImageData(GetFormat(), data->mYChannel, srcLayout.get(), + aFormat, aBuffer+aOffset); + + if (!dstLayout) { + aRv.Throw(NS_ERROR_NOT_AVAILABLE); + return nullptr; + } + + return dstLayout; + } + +private: + const PlanarYCbCrData* GetPlanarYCbCrData() const + { + if (mImage->GetFormat() == ImageFormat::PLANAR_YCBCR) { + return mImage->AsPlanarYCbCrImage()->GetData(); + } else { + return mImage->AsNVImage()->GetData(); + } + } +}; + +// TODO: optimize for other platforms. +// For GONK: implement GrallocImageImpl, GrallocPlanarYCbCrImpl and GonkCameraImpl. +// For Windows: implement D3D9RGB32TextureImpl and D3D11ShareHandleTextureImpl. +// Others: SharedBGRImpl, MACIOSrufaceImpl, GLImageImpl, SurfaceTextureImpl +// EGLImageImpl and OverlayImegImpl. + +ImageUtils::ImageUtils(layers::Image* aImage) +: mImpl(nullptr) +{ + MOZ_ASSERT(aImage, "Create ImageUtils with nullptr."); + switch(aImage->GetFormat()) { + case mozilla::ImageFormat::PLANAR_YCBCR: + case mozilla::ImageFormat::NV_IMAGE: + mImpl = new YUVImpl(aImage); + break; + case mozilla::ImageFormat::CAIRO_SURFACE: + default: + mImpl = new Impl(aImage); + } +} + +ImageUtils::~ImageUtils() +{ + if (mImpl) { delete mImpl; mImpl = nullptr; } +} + +ImageBitmapFormat +ImageUtils::GetFormat() const +{ + MOZ_ASSERT(mImpl); + return mImpl->GetFormat(); +} + +uint32_t +ImageUtils::GetBufferLength() const +{ + MOZ_ASSERT(mImpl); + return mImpl->GetBufferLength(); +} + +UniquePtr +ImageUtils::MapDataInto(uint8_t* aBuffer, + uint32_t aOffset, + uint32_t aBufferLength, + ImageBitmapFormat aFormat, + ErrorResult& aRv) const +{ + MOZ_ASSERT(mImpl); + MOZ_ASSERT(aBuffer, "Map data into a null buffer."); + return mImpl->MapDataInto(aBuffer, aOffset, aBufferLength, aFormat, aRv); +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/ImageUtils.h b/dom/canvas/ImageUtils.h new file mode 100644 index 000000000..b64c33704 --- /dev/null +++ b/dom/canvas/ImageUtils.h @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_ImageBitmapFormatUtils_h +#define mozilla_dom_ImageBitmapFormatUtils_h + +#include "mozilla/UniquePtr.h" +#include "nsTArrayForwardDeclare.h" + +namespace mozilla { + +namespace layers { +class Image; +} + +class ErrorResult; + +namespace dom { + +struct ChannelPixelLayout; +enum class ImageBitmapFormat : uint32_t; + +typedef nsTArray ImagePixelLayout; + +/* + * ImageUtils is a wrapper around layers::Image. It provides three unified + * methods to all sub-classes of layers::Image, which are: + * + * (1) GetFormat() converts the image's format into ImageBitmapFormat enum. + * (2) GetBufferLength() returns the number of bytes that are used to store + * the image's underlying raw data. + * (3) MapDataInto() writes the image's underlying raw data into a given + * ArrayBuffer in the given format. (If the given format is different from + * the existing format, the ImageUtils uses the ImageBitmapFormatUtils to + * performa color conversion.) + * + * In theory, the functionalities of this class could be merged into the + * interface of layers::Image. However, this is designed as a isolated wrapper + * because we don't want to pollute the layers::Image's interface with methods + * that are only meaningful to the ImageBitmap. + */ +class ImageUtils +{ +public: + class Impl; + ImageUtils() = delete; + ImageUtils(const ImageUtils&) = delete; + ImageUtils(ImageUtils&&) = delete; + ImageUtils& operator=(const ImageUtils&) = delete; + ImageUtils& operator=(ImageUtils&&) = delete; + + explicit ImageUtils(layers::Image* aImage); + ~ImageUtils(); + + ImageBitmapFormat GetFormat() const; + + uint32_t GetBufferLength() const; + + UniquePtr + MapDataInto(uint8_t* aBuffer, uint32_t aOffset, uint32_t aBufferLength, + ImageBitmapFormat aFormat, ErrorResult& aRv) const; + +protected: + Impl* mImpl; +}; + +} // namespace dom +} // namespace mozilla + +#endif /* mozilla_dom_ImageBitmapFormatUtils_h */ diff --git a/dom/canvas/MurmurHash3.cpp b/dom/canvas/MurmurHash3.cpp new file mode 100644 index 000000000..87cf70934 --- /dev/null +++ b/dom/canvas/MurmurHash3.cpp @@ -0,0 +1,340 @@ +//----------------------------------------------------------------------------- +// MurmurHash3 was written by Austin Appleby, and is placed in the public +// domain. The author hereby disclaims copyright to this source code. + +// Note - The x86 and x64 versions do _not_ produce the same results, as the +// algorithms are optimized for their respective platforms. You can still +// compile and run any of them on any platform, but your performance with the +// non-native version will be less than optimal. + +#include "MurmurHash3.h" +#include + +namespace { + +//----------------------------------------------------------------------------- +// Platform-specific functions and macros + +// Microsoft Visual Studio + +#if defined(_MSC_VER) + +#define FORCE_INLINE __forceinline + +#define ROTL32(x,y) _rotl(x,y) +#define ROTL64(x,y) _rotl64(x,y) + +#define BIG_CONSTANT(x) (x) + +// Other compilers + +#else // defined(_MSC_VER) + +// We can't do always_inline, becasue -Werror -Wattribute will trigger +// a "might not be able to inline" warning. +//#define FORCE_INLINE __attribute__((always_inline)) +#define FORCE_INLINE inline + +inline uint32_t rotl32 ( uint32_t x, int8_t r ) +{ + return (x << r) | (x >> (32 - r)); +} + +inline uint64_t rotl64 ( uint64_t x, int8_t r ) +{ + return (x << r) | (x >> (64 - r)); +} + +#define ROTL32(x,y) rotl32(x,y) +#define ROTL64(x,y) rotl64(x,y) + +#define BIG_CONSTANT(x) (x##LLU) + +#endif // !defined(_MSC_VER) + +//----------------------------------------------------------------------------- +// Block read - if your platform needs to do endian-swapping or can only +// handle aligned reads, do the conversion here + +FORCE_INLINE uint32_t getblock ( const uint32_t * p, int i ) +{ + return p[i]; +} + +FORCE_INLINE uint64_t getblock ( const uint64_t * p, int i ) +{ + return p[i]; +} + +//----------------------------------------------------------------------------- +// Finalization mix - force all bits of a hash block to avalanche + +FORCE_INLINE uint32_t fmix ( uint32_t h ) +{ + h ^= h >> 16; + h *= 0x85ebca6b; + h ^= h >> 13; + h *= 0xc2b2ae35; + h ^= h >> 16; + + return h; +} + +//---------- + +FORCE_INLINE uint64_t fmix ( uint64_t k ) +{ + k ^= k >> 33; + k *= BIG_CONSTANT(0xff51afd7ed558ccd); + k ^= k >> 33; + k *= BIG_CONSTANT(0xc4ceb9fe1a85ec53); + k ^= k >> 33; + + return k; +} + +} // unnamed namespace + +//----------------------------------------------------------------------------- + +void MurmurHash3_x86_32 ( const void * key, int len, + uint32_t seed, void * out ) +{ + const uint8_t * data = (const uint8_t*)key; + const int nblocks = len / 4; + + uint32_t h1 = seed; + + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; + + //---------- + // body + + const uint32_t * blocks = (const uint32_t *)(data + nblocks*4); + + for(int i = -nblocks; i; i++) + { + uint32_t k1 = getblock(blocks,i); + + k1 *= c1; + k1 = ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + } + + //---------- + // tail + + const uint8_t * tail = (const uint8_t*)(data + nblocks*4); + + uint32_t k1 = 0; + + switch(len & 3) + { + case 3: k1 ^= tail[2] << 16; + case 2: k1 ^= tail[1] << 8; + case 1: k1 ^= tail[0]; + k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; + } + + //---------- + // finalization + + h1 ^= len; + + h1 = fmix(h1); + + *(uint32_t*)out = h1; +} + +//----------------------------------------------------------------------------- + +void MurmurHash3_x86_128 ( const void * key, const int len, + uint32_t seed, void * out ) +{ + const uint8_t * data = (const uint8_t*)key; + const int nblocks = len / 16; + + uint32_t h1 = seed; + uint32_t h2 = seed; + uint32_t h3 = seed; + uint32_t h4 = seed; + + const uint32_t c1 = 0x239b961b; + const uint32_t c2 = 0xab0e9789; + const uint32_t c3 = 0x38b34ae5; + const uint32_t c4 = 0xa1e38b93; + + //---------- + // body + + const uint32_t * blocks = (const uint32_t *)(data + nblocks*16); + + for(int i = -nblocks; i; i++) + { + uint32_t k1 = getblock(blocks,i*4+0); + uint32_t k2 = getblock(blocks,i*4+1); + uint32_t k3 = getblock(blocks,i*4+2); + uint32_t k4 = getblock(blocks,i*4+3); + + k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; + + h1 = ROTL32(h1,19); h1 += h2; h1 = h1*5+0x561ccd1b; + + k2 *= c2; k2 = ROTL32(k2,16); k2 *= c3; h2 ^= k2; + + h2 = ROTL32(h2,17); h2 += h3; h2 = h2*5+0x0bcaa747; + + k3 *= c3; k3 = ROTL32(k3,17); k3 *= c4; h3 ^= k3; + + h3 = ROTL32(h3,15); h3 += h4; h3 = h3*5+0x96cd1c35; + + k4 *= c4; k4 = ROTL32(k4,18); k4 *= c1; h4 ^= k4; + + h4 = ROTL32(h4,13); h4 += h1; h4 = h4*5+0x32ac3b17; + } + + //---------- + // tail + + const uint8_t * tail = (const uint8_t*)(data + nblocks*16); + + uint32_t k1 = 0; + uint32_t k2 = 0; + uint32_t k3 = 0; + uint32_t k4 = 0; + + switch(len & 15) + { + case 15: k4 ^= tail[14] << 16; + case 14: k4 ^= tail[13] << 8; + case 13: k4 ^= tail[12] << 0; + k4 *= c4; k4 = ROTL32(k4,18); k4 *= c1; h4 ^= k4; + + case 12: k3 ^= tail[11] << 24; + case 11: k3 ^= tail[10] << 16; + case 10: k3 ^= tail[ 9] << 8; + case 9: k3 ^= tail[ 8] << 0; + k3 *= c3; k3 = ROTL32(k3,17); k3 *= c4; h3 ^= k3; + + case 8: k2 ^= tail[ 7] << 24; + case 7: k2 ^= tail[ 6] << 16; + case 6: k2 ^= tail[ 5] << 8; + case 5: k2 ^= tail[ 4] << 0; + k2 *= c2; k2 = ROTL32(k2,16); k2 *= c3; h2 ^= k2; + + case 4: k1 ^= tail[ 3] << 24; + case 3: k1 ^= tail[ 2] << 16; + case 2: k1 ^= tail[ 1] << 8; + case 1: k1 ^= tail[ 0] << 0; + k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; + } + + //---------- + // finalization + + h1 ^= len; h2 ^= len; h3 ^= len; h4 ^= len; + + h1 += h2; h1 += h3; h1 += h4; + h2 += h1; h3 += h1; h4 += h1; + + h1 = fmix(h1); + h2 = fmix(h2); + h3 = fmix(h3); + h4 = fmix(h4); + + h1 += h2; h1 += h3; h1 += h4; + h2 += h1; h3 += h1; h4 += h1; + + ((uint32_t*)out)[0] = h1; + ((uint32_t*)out)[1] = h2; + ((uint32_t*)out)[2] = h3; + ((uint32_t*)out)[3] = h4; +} + +//----------------------------------------------------------------------------- + +void MurmurHash3_x64_128 ( const void * key, const int len, + const uint32_t seed, void * out ) +{ + const uint8_t * data = (const uint8_t*)key; + const int nblocks = len / 16; + + uint64_t h1 = seed; + uint64_t h2 = seed; + + const uint64_t c1 = BIG_CONSTANT(0x87c37b91114253d5); + const uint64_t c2 = BIG_CONSTANT(0x4cf5ad432745937f); + + //---------- + // body + + const uint64_t * blocks = (const uint64_t *)(data); + + for(int i = 0; i < nblocks; i++) + { + uint64_t k1 = getblock(blocks,i*2+0); + uint64_t k2 = getblock(blocks,i*2+1); + + k1 *= c1; k1 = ROTL64(k1,31); k1 *= c2; h1 ^= k1; + + h1 = ROTL64(h1,27); h1 += h2; h1 = h1*5+0x52dce729; + + k2 *= c2; k2 = ROTL64(k2,33); k2 *= c1; h2 ^= k2; + + h2 = ROTL64(h2,31); h2 += h1; h2 = h2*5+0x38495ab5; + } + + //---------- + // tail + + const uint8_t * tail = (const uint8_t*)(data + nblocks*16); + + uint64_t k1 = 0; + uint64_t k2 = 0; + + switch(len & 15) + { + case 15: k2 ^= uint64_t(tail[14]) << 48; + case 14: k2 ^= uint64_t(tail[13]) << 40; + case 13: k2 ^= uint64_t(tail[12]) << 32; + case 12: k2 ^= uint64_t(tail[11]) << 24; + case 11: k2 ^= uint64_t(tail[10]) << 16; + case 10: k2 ^= uint64_t(tail[ 9]) << 8; + case 9: k2 ^= uint64_t(tail[ 8]) << 0; + k2 *= c2; k2 = ROTL64(k2,33); k2 *= c1; h2 ^= k2; + + case 8: k1 ^= uint64_t(tail[ 7]) << 56; + case 7: k1 ^= uint64_t(tail[ 6]) << 48; + case 6: k1 ^= uint64_t(tail[ 5]) << 40; + case 5: k1 ^= uint64_t(tail[ 4]) << 32; + case 4: k1 ^= uint64_t(tail[ 3]) << 24; + case 3: k1 ^= uint64_t(tail[ 2]) << 16; + case 2: k1 ^= uint64_t(tail[ 1]) << 8; + case 1: k1 ^= uint64_t(tail[ 0]) << 0; + k1 *= c1; k1 = ROTL64(k1,31); k1 *= c2; h1 ^= k1; + } + + //---------- + // finalization + + h1 ^= len; h2 ^= len; + + h1 += h2; + h2 += h1; + + h1 = fmix(h1); + h2 = fmix(h2); + + h1 += h2; + h2 += h1; + + ((uint64_t*)out)[0] = h1; + ((uint64_t*)out)[1] = h2; +} + +//----------------------------------------------------------------------------- diff --git a/dom/canvas/MurmurHash3.h b/dom/canvas/MurmurHash3.h new file mode 100644 index 000000000..adb52004e --- /dev/null +++ b/dom/canvas/MurmurHash3.h @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------------- +// MurmurHash3 was written by Austin Appleby, and is placed in the public +// domain. The author hereby disclaims copyright to this source code. + +#ifndef _MURMURHASH3_H_ +#define _MURMURHASH3_H_ + +//----------------------------------------------------------------------------- +// Platform-specific functions and macros + +#include + +//----------------------------------------------------------------------------- + +void MurmurHash3_x86_32 ( const void * key, int len, uint32_t seed, void * out ); + +void MurmurHash3_x86_128 ( const void * key, int len, uint32_t seed, void * out ); + +void MurmurHash3_x64_128 ( const void * key, int len, uint32_t seed, void * out ); + +//----------------------------------------------------------------------------- + +#endif // _MURMURHASH3_H_ \ No newline at end of file diff --git a/dom/canvas/OffscreenCanvas.cpp b/dom/canvas/OffscreenCanvas.cpp new file mode 100644 index 000000000..0d188c24e --- /dev/null +++ b/dom/canvas/OffscreenCanvas.cpp @@ -0,0 +1,371 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "OffscreenCanvas.h" + +#include "mozilla/dom/OffscreenCanvasBinding.h" +#include "mozilla/dom/WorkerPrivate.h" +#include "mozilla/dom/WorkerScope.h" +#include "mozilla/layers/AsyncCanvasRenderer.h" +#include "mozilla/layers/CanvasClient.h" +#include "mozilla/layers/ImageBridgeChild.h" +#include "mozilla/Telemetry.h" +#include "CanvasRenderingContext2D.h" +#include "CanvasUtils.h" +#include "GLScreenBuffer.h" +#include "WebGL1Context.h" +#include "WebGL2Context.h" + +namespace mozilla { +namespace dom { + +OffscreenCanvasCloneData::OffscreenCanvasCloneData(layers::AsyncCanvasRenderer* aRenderer, + uint32_t aWidth, uint32_t aHeight, + layers::LayersBackend aCompositorBackend, + bool aNeutered, bool aIsWriteOnly) + : mRenderer(aRenderer) + , mWidth(aWidth) + , mHeight(aHeight) + , mCompositorBackendType(aCompositorBackend) + , mNeutered(aNeutered) + , mIsWriteOnly(aIsWriteOnly) +{ +} + +OffscreenCanvasCloneData::~OffscreenCanvasCloneData() +{ +} + +OffscreenCanvas::OffscreenCanvas(nsIGlobalObject* aGlobal, + uint32_t aWidth, + uint32_t aHeight, + layers::LayersBackend aCompositorBackend, + layers::AsyncCanvasRenderer* aRenderer) + : DOMEventTargetHelper(aGlobal) + , mAttrDirty(false) + , mNeutered(false) + , mIsWriteOnly(false) + , mWidth(aWidth) + , mHeight(aHeight) + , mCompositorBackendType(aCompositorBackend) + , mCanvasRenderer(aRenderer) +{} + +OffscreenCanvas::~OffscreenCanvas() +{ + ClearResources(); +} + +JSObject* +OffscreenCanvas::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) +{ + return OffscreenCanvasBinding::Wrap(aCx, this, aGivenProto); +} + +/* static */ already_AddRefed +OffscreenCanvas::Constructor(const GlobalObject& aGlobal, + uint32_t aWidth, + uint32_t aHeight, + ErrorResult& aRv) +{ + nsCOMPtr global = do_QueryInterface(aGlobal.GetAsSupports()); + RefPtr offscreenCanvas = + new OffscreenCanvas(global, aWidth, aHeight, + layers::LayersBackend::LAYERS_NONE, nullptr); + return offscreenCanvas.forget(); +} + +void +OffscreenCanvas::ClearResources() +{ + if (mCanvasClient) { + mCanvasClient->Clear(); + + if (mCanvasRenderer) { + nsCOMPtr activeThread = mCanvasRenderer->GetActiveThread(); + MOZ_RELEASE_ASSERT(activeThread, "GFX: failed to get active thread."); + bool current; + activeThread->IsOnCurrentThread(¤t); + MOZ_RELEASE_ASSERT(current, "GFX: active thread is not current thread."); + mCanvasRenderer->SetCanvasClient(nullptr); + mCanvasRenderer->mContext = nullptr; + mCanvasRenderer->mGLContext = nullptr; + mCanvasRenderer->ResetActiveThread(); + } + + mCanvasClient = nullptr; + } +} + +already_AddRefed +OffscreenCanvas::GetContext(JSContext* aCx, + const nsAString& aContextId, + JS::Handle aContextOptions, + ErrorResult& aRv) +{ + if (mNeutered) { + aRv.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + // We only support WebGL in workers for now + CanvasContextType contextType; + if (!CanvasUtils::GetCanvasContextType(aContextId, &contextType)) { + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + return nullptr; + } + + if (!(contextType == CanvasContextType::WebGL1 || + contextType == CanvasContextType::WebGL2 || + contextType == CanvasContextType::ImageBitmap)) + { + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + return nullptr; + } + + already_AddRefed result = + CanvasRenderingContextHelper::GetContext(aCx, + aContextId, + aContextOptions, + aRv); + + if (!mCurrentContext) { + return nullptr; + } + + if (mCanvasRenderer) { + if (contextType == CanvasContextType::WebGL1 || + contextType == CanvasContextType::WebGL2) { + WebGLContext* webGL = static_cast(mCurrentContext.get()); + gl::GLContext* gl = webGL->GL(); + mCanvasRenderer->mContext = mCurrentContext; + mCanvasRenderer->SetActiveThread(); + mCanvasRenderer->mGLContext = gl; + mCanvasRenderer->SetIsAlphaPremultiplied(webGL->IsPremultAlpha() || !gl->Caps().alpha); + + if (RefPtr imageBridge = ImageBridgeChild::GetSingleton()) { + TextureFlags flags = TextureFlags::ORIGIN_BOTTOM_LEFT; + mCanvasClient = imageBridge->CreateCanvasClient(CanvasClient::CanvasClientTypeShSurf, flags); + mCanvasRenderer->SetCanvasClient(mCanvasClient); + + gl::GLScreenBuffer* screen = gl->Screen(); + gl::SurfaceCaps caps = screen->mCaps; + auto forwarder = mCanvasClient->GetForwarder(); + + UniquePtr factory = + gl::GLScreenBuffer::CreateFactory(gl, caps, forwarder, flags); + + if (factory) + screen->Morph(Move(factory)); + } + } + } + + return result; +} + +already_AddRefed +OffscreenCanvas::CreateContext(CanvasContextType aContextType) +{ + RefPtr ret = + CanvasRenderingContextHelper::CreateContext(aContextType); + + ret->SetOffscreenCanvas(this); + return ret.forget(); +} + +void +OffscreenCanvas::CommitFrameToCompositor() +{ + if (!mCanvasRenderer) { + // This offscreen canvas doesn't associate to any HTML canvas element. + // So, just bail out. + return; + } + + // The attributes has changed, we have to notify main + // thread to change canvas size. + if (mAttrDirty) { + if (mCanvasRenderer) { + mCanvasRenderer->SetWidth(mWidth); + mCanvasRenderer->SetHeight(mHeight); + mCanvasRenderer->NotifyElementAboutAttributesChanged(); + } + mAttrDirty = false; + } + + if (mCurrentContext) { + static_cast(mCurrentContext.get())->PresentScreenBuffer(); + } + + if (mCanvasRenderer && mCanvasRenderer->mGLContext) { + mCanvasRenderer->NotifyElementAboutInvalidation(); + ImageBridgeChild::GetSingleton()-> + UpdateAsyncCanvasRenderer(mCanvasRenderer); + } +} + +OffscreenCanvasCloneData* +OffscreenCanvas::ToCloneData() +{ + return new OffscreenCanvasCloneData(mCanvasRenderer, mWidth, mHeight, + mCompositorBackendType, mNeutered, mIsWriteOnly); +} + +already_AddRefed +OffscreenCanvas::TransferToImageBitmap() +{ + ErrorResult rv; + nsCOMPtr globalObject = GetGlobalObject(); + RefPtr result = ImageBitmap::CreateFromOffscreenCanvas(globalObject, *this, rv); + + // Clear the content. + if ((mCurrentContextType == CanvasContextType::WebGL1 || + mCurrentContextType == CanvasContextType::WebGL2)) + { + WebGLContext* webGL = static_cast(mCurrentContext.get()); + webGL->ClearScreen(); + } + + return result.forget(); +} + +already_AddRefed +OffscreenCanvas::ToBlob(JSContext* aCx, + const nsAString& aType, + JS::Handle aParams, + ErrorResult& aRv) +{ + // do a trust check if this is a write-only canvas + if (mIsWriteOnly) { + aRv.Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + nsCOMPtr global = GetGlobalObject(); + + RefPtr promise = Promise::Create(global, aRv); + if (aRv.Failed()) { + return nullptr; + } + + // Encoder callback when encoding is complete. + class EncodeCallback : public EncodeCompleteCallback + { + public: + EncodeCallback(nsIGlobalObject* aGlobal, Promise* aPromise) + : mGlobal(aGlobal) + , mPromise(aPromise) {} + + // This is called on main thread. + nsresult ReceiveBlob(already_AddRefed aBlob) + { + RefPtr blob = aBlob; + + ErrorResult rv; + uint64_t size = blob->GetSize(rv); + if (rv.Failed()) { + rv.SuppressException(); + } else { + AutoJSAPI jsapi; + if (jsapi.Init(mGlobal)) { + JS_updateMallocCounter(jsapi.cx(), size); + } + } + + if (mPromise) { + RefPtr newBlob = Blob::Create(mGlobal, blob->Impl()); + mPromise->MaybeResolve(newBlob); + } + + mGlobal = nullptr; + mPromise = nullptr; + + return rv.StealNSResult(); + } + + nsCOMPtr mGlobal; + RefPtr mPromise; + }; + + RefPtr callback = + new EncodeCallback(global, promise); + + CanvasRenderingContextHelper::ToBlob(aCx, global, + callback, aType, aParams, aRv); + + return promise.forget(); +} + +already_AddRefed +OffscreenCanvas::GetSurfaceSnapshot(bool* aPremultAlpha) +{ + if (!mCurrentContext) { + return nullptr; + } + + return mCurrentContext->GetSurfaceSnapshot(aPremultAlpha); +} + +nsCOMPtr +OffscreenCanvas::GetGlobalObject() +{ + if (NS_IsMainThread()) { + return GetParentObject(); + } + + dom::workers::WorkerPrivate* workerPrivate = + dom::workers::GetCurrentThreadWorkerPrivate(); + return workerPrivate->GlobalScope(); +} + +/* static */ already_AddRefed +OffscreenCanvas::CreateFromCloneData(nsIGlobalObject* aGlobal, OffscreenCanvasCloneData* aData) +{ + MOZ_ASSERT(aData); + RefPtr wc = + new OffscreenCanvas(aGlobal, aData->mWidth, aData->mHeight, + aData->mCompositorBackendType, aData->mRenderer); + if (aData->mNeutered) { + wc->SetNeutered(); + } + return wc.forget(); +} + +/* static */ bool +OffscreenCanvas::PrefEnabled(JSContext* aCx, JSObject* aObj) +{ + if (NS_IsMainThread()) { + return Preferences::GetBool("gfx.offscreencanvas.enabled"); + } else { + WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx); + MOZ_ASSERT(workerPrivate); + return workerPrivate->OffscreenCanvasEnabled(); + } +} + +/* static */ bool +OffscreenCanvas::PrefEnabledOnWorkerThread(JSContext* aCx, JSObject* aObj) +{ + if (NS_IsMainThread()) { + return true; + } + + return PrefEnabled(aCx, aObj); +} + +NS_IMPL_CYCLE_COLLECTION_INHERITED(OffscreenCanvas, DOMEventTargetHelper, mCurrentContext) + +NS_IMPL_ADDREF_INHERITED(OffscreenCanvas, DOMEventTargetHelper) +NS_IMPL_RELEASE_INHERITED(OffscreenCanvas, DOMEventTargetHelper) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(OffscreenCanvas) + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper) + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/OffscreenCanvas.h b/dom/canvas/OffscreenCanvas.h new file mode 100644 index 000000000..759543942 --- /dev/null +++ b/dom/canvas/OffscreenCanvas.h @@ -0,0 +1,214 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef MOZILLA_DOM_OFFSCREENCANVAS_H_ +#define MOZILLA_DOM_OFFSCREENCANVAS_H_ + +#include "mozilla/DOMEventTargetHelper.h" +#include "mozilla/layers/LayersTypes.h" +#include "mozilla/RefPtr.h" +#include "CanvasRenderingContextHelper.h" +#include "nsCycleCollectionParticipant.h" + +struct JSContext; + +namespace mozilla { + +class ErrorResult; + +namespace layers { +class AsyncCanvasRenderer; +class CanvasClient; +} // namespace layers + +namespace dom { +class Blob; +class ImageBitmap; + +// This is helper class for transferring OffscreenCanvas to worker thread. +// Because OffscreenCanvas is not thread-safe. So we cannot pass Offscreen- +// Canvas to worker thread directly. Thus, we create this helper class and +// store necessary data in it then pass it to worker thread. +struct OffscreenCanvasCloneData final +{ + OffscreenCanvasCloneData(layers::AsyncCanvasRenderer* aRenderer, + uint32_t aWidth, uint32_t aHeight, + layers::LayersBackend aCompositorBackend, + bool aNeutered, bool aIsWriteOnly); + ~OffscreenCanvasCloneData(); + + RefPtr mRenderer; + uint32_t mWidth; + uint32_t mHeight; + layers::LayersBackend mCompositorBackendType; + bool mNeutered; + bool mIsWriteOnly; +}; + +class OffscreenCanvas final : public DOMEventTargetHelper + , public CanvasRenderingContextHelper +{ +public: + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OffscreenCanvas, DOMEventTargetHelper) + + OffscreenCanvas(nsIGlobalObject* aGlobal, + uint32_t aWidth, + uint32_t aHeight, + layers::LayersBackend aCompositorBackend, + layers::AsyncCanvasRenderer* aRenderer); + + nsCOMPtr GetParentObject() const { return GetOwnerGlobal(); } + + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; + + static already_AddRefed + Constructor(const GlobalObject& aGlobal, + uint32_t aWidth, + uint32_t aHeight, + ErrorResult& aRv); + + void ClearResources(); + + uint32_t Width() const + { + return mWidth; + } + + uint32_t Height() const + { + return mHeight; + } + + void SetWidth(uint32_t aWidth, ErrorResult& aRv) + { + if (mNeutered) { + aRv.Throw(NS_ERROR_FAILURE); + return; + } + + if (mWidth != aWidth) { + mWidth = aWidth; + CanvasAttrChanged(); + } + } + + void SetHeight(uint32_t aHeight, ErrorResult& aRv) + { + if (mNeutered) { + aRv.Throw(NS_ERROR_FAILURE); + return; + } + + if (mHeight != aHeight) { + mHeight = aHeight; + CanvasAttrChanged(); + } + } + + already_AddRefed + TransferToImageBitmap(); + + already_AddRefed + ToBlob(JSContext* aCx, + const nsAString& aType, + JS::Handle aParams, + ErrorResult& aRv); + + nsICanvasRenderingContextInternal* GetContext() const + { + return mCurrentContext; + } + + already_AddRefed GetSurfaceSnapshot(bool* aPremultAlpha = nullptr); + + static already_AddRefed + CreateFromCloneData(nsIGlobalObject* aGlobal, OffscreenCanvasCloneData* aData); + + static bool PrefEnabled(JSContext* aCx, JSObject* aObj); + + // Return true on main-thread, and return gfx.offscreencanvas.enabled + // on worker thread. + static bool PrefEnabledOnWorkerThread(JSContext* aCx, JSObject* aObj); + + OffscreenCanvasCloneData* ToCloneData(); + + void CommitFrameToCompositor(); + + virtual bool GetOpaqueAttr() override + { + return false; + } + + virtual nsIntSize GetWidthHeight() override + { + return nsIntSize(mWidth, mHeight); + } + + virtual already_AddRefed + CreateContext(CanvasContextType aContextType) override; + + virtual already_AddRefed + GetContext(JSContext* aCx, + const nsAString& aContextId, + JS::Handle aContextOptions, + ErrorResult& aRv) override; + + void SetNeutered() + { + mNeutered = true; + } + + bool IsNeutered() const + { + return mNeutered; + } + + void SetWriteOnly() + { + mIsWriteOnly = true; + } + + bool IsWriteOnly() const + { + return mIsWriteOnly; + } + + layers::LayersBackend GetCompositorBackendType() const + { + return mCompositorBackendType; + } + +private: + ~OffscreenCanvas(); + + nsCOMPtr GetGlobalObject(); + + void CanvasAttrChanged() + { + mAttrDirty = true; + ErrorResult dummy; + UpdateContext(nullptr, JS::NullHandleValue, dummy); + } + + bool mAttrDirty; + bool mNeutered; + bool mIsWriteOnly; + + uint32_t mWidth; + uint32_t mHeight; + + layers::LayersBackend mCompositorBackendType; + + RefPtr mCanvasClient; + RefPtr mCanvasRenderer; +}; + +} // namespace dom +} // namespace mozilla + +#endif // MOZILLA_DOM_OFFSCREENCANVAS_H_ diff --git a/dom/canvas/TexUnpackBlob.cpp b/dom/canvas/TexUnpackBlob.cpp new file mode 100644 index 000000000..e964a58fd --- /dev/null +++ b/dom/canvas/TexUnpackBlob.cpp @@ -0,0 +1,831 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "TexUnpackBlob.h" + +#include "GLBlitHelper.h" +#include "GLContext.h" +#include "mozilla/dom/Element.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "mozilla/RefPtr.h" +#include "nsLayoutUtils.h" +#include "WebGLBuffer.h" +#include "WebGLContext.h" +#include "WebGLTexelConversions.h" +#include "WebGLTexture.h" + +namespace mozilla { +namespace webgl { + +static bool +IsPIValidForDOM(const webgl::PackingInfo& pi) +{ + // https://www.khronos.org/registry/webgl/specs/latest/2.0/#TEXTURE_TYPES_FORMATS_FROM_DOM_ELEMENTS_TABLE + + // Just check for invalid individual formats and types, not combinations. + switch (pi.format) { + case LOCAL_GL_RGB: + case LOCAL_GL_RGBA: + case LOCAL_GL_LUMINANCE_ALPHA: + case LOCAL_GL_LUMINANCE: + case LOCAL_GL_ALPHA: + case LOCAL_GL_RED: + case LOCAL_GL_RED_INTEGER: + case LOCAL_GL_RG: + case LOCAL_GL_RG_INTEGER: + case LOCAL_GL_RGB_INTEGER: + case LOCAL_GL_RGBA_INTEGER: + break; + + case LOCAL_GL_SRGB: + case LOCAL_GL_SRGB_ALPHA: + // Allowed in WebGL1+EXT_srgb + break; + + default: + return false; + } + + switch (pi.type) { + case LOCAL_GL_UNSIGNED_BYTE: + case LOCAL_GL_UNSIGNED_SHORT_5_6_5: + case LOCAL_GL_UNSIGNED_SHORT_4_4_4_4: + case LOCAL_GL_UNSIGNED_SHORT_5_5_5_1: + case LOCAL_GL_HALF_FLOAT: + case LOCAL_GL_HALF_FLOAT_OES: + case LOCAL_GL_FLOAT: + case LOCAL_GL_UNSIGNED_INT_10F_11F_11F_REV: + break; + + default: + return false; + } + + return true; +} + +static bool +ValidatePIForDOM(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) +{ + if (!IsPIValidForDOM(pi)) { + webgl->ErrorInvalidOperation("%s: Format or type is invalid for DOM sources.", + funcName); + return false; + } + return true; +} + +static WebGLTexelFormat +FormatForPackingInfo(const PackingInfo& pi) +{ + switch (pi.type) { + case LOCAL_GL_UNSIGNED_BYTE: + switch (pi.format) { + case LOCAL_GL_RED: + case LOCAL_GL_LUMINANCE: + case LOCAL_GL_RED_INTEGER: + return WebGLTexelFormat::R8; + + case LOCAL_GL_ALPHA: + return WebGLTexelFormat::A8; + + case LOCAL_GL_LUMINANCE_ALPHA: + return WebGLTexelFormat::RA8; + + case LOCAL_GL_RGB: + case LOCAL_GL_RGB_INTEGER: + return WebGLTexelFormat::RGB8; + + case LOCAL_GL_RGBA: + case LOCAL_GL_RGBA_INTEGER: + return WebGLTexelFormat::RGBA8; + + case LOCAL_GL_RG: + case LOCAL_GL_RG_INTEGER: + return WebGLTexelFormat::RG8; + + default: + break; + } + break; + + case LOCAL_GL_UNSIGNED_SHORT_5_6_5: + if (pi.format == LOCAL_GL_RGB) + return WebGLTexelFormat::RGB565; + break; + + case LOCAL_GL_UNSIGNED_SHORT_5_5_5_1: + if (pi.format == LOCAL_GL_RGBA) + return WebGLTexelFormat::RGBA5551; + break; + + case LOCAL_GL_UNSIGNED_SHORT_4_4_4_4: + if (pi.format == LOCAL_GL_RGBA) + return WebGLTexelFormat::RGBA4444; + break; + + case LOCAL_GL_HALF_FLOAT: + case LOCAL_GL_HALF_FLOAT_OES: + switch (pi.format) { + case LOCAL_GL_RED: + case LOCAL_GL_LUMINANCE: + return WebGLTexelFormat::R16F; + + case LOCAL_GL_ALPHA: return WebGLTexelFormat::A16F; + case LOCAL_GL_LUMINANCE_ALPHA: return WebGLTexelFormat::RA16F; + case LOCAL_GL_RG: return WebGLTexelFormat::RG16F; + case LOCAL_GL_RGB: return WebGLTexelFormat::RGB16F; + case LOCAL_GL_RGBA: return WebGLTexelFormat::RGBA16F; + + default: + break; + } + break; + + case LOCAL_GL_FLOAT: + switch (pi.format) { + case LOCAL_GL_RED: + case LOCAL_GL_LUMINANCE: + return WebGLTexelFormat::R32F; + + case LOCAL_GL_ALPHA: return WebGLTexelFormat::A32F; + case LOCAL_GL_LUMINANCE_ALPHA: return WebGLTexelFormat::RA32F; + case LOCAL_GL_RG: return WebGLTexelFormat::RG32F; + case LOCAL_GL_RGB: return WebGLTexelFormat::RGB32F; + case LOCAL_GL_RGBA: return WebGLTexelFormat::RGBA32F; + + default: + break; + } + break; + + case LOCAL_GL_UNSIGNED_INT_10F_11F_11F_REV: + if (pi.format == LOCAL_GL_RGB) + return WebGLTexelFormat::RGB11F11F10F; + break; + + default: + break; + } + + return WebGLTexelFormat::FormatNotSupportingAnyConversion; +} + +//////////////////// + +static bool +ValidateUnpackPixels(WebGLContext* webgl, const char* funcName, uint32_t fullRows, + uint32_t tailPixels, webgl::TexUnpackBlob* blob) +{ + if (!blob->mWidth || !blob->mHeight || !blob->mDepth) + return true; + + const auto usedPixelsPerRow = CheckedUint32(blob->mSkipPixels) + blob->mWidth; + if (!usedPixelsPerRow.isValid() || usedPixelsPerRow.value() > blob->mRowLength) { + webgl->ErrorInvalidOperation("%s: UNPACK_SKIP_PIXELS + width >" + " UNPACK_ROW_LENGTH.", + funcName); + return false; + } + + if (blob->mHeight > blob->mImageHeight) { + webgl->ErrorInvalidOperation("%s: height > UNPACK_IMAGE_HEIGHT.", funcName); + return false; + } + + ////// + + // The spec doesn't bound SKIP_ROWS + height <= IMAGE_HEIGHT, unfortunately. + auto skipFullRows = CheckedUint32(blob->mSkipImages) * blob->mImageHeight; + skipFullRows += blob->mSkipRows; + + MOZ_ASSERT(blob->mDepth >= 1); + MOZ_ASSERT(blob->mHeight >= 1); + auto usedFullRows = CheckedUint32(blob->mDepth - 1) * blob->mImageHeight; + usedFullRows += blob->mHeight - 1; // Full rows in the final image, excluding the tail. + + const auto fullRowsNeeded = skipFullRows + usedFullRows; + if (!fullRowsNeeded.isValid()) { + webgl->ErrorOutOfMemory("%s: Invalid calculation for required row count.", + funcName); + return false; + } + + if (fullRows > fullRowsNeeded.value()) + return true; + + if (fullRows == fullRowsNeeded.value() && tailPixels >= usedPixelsPerRow.value()) { + blob->mNeedsExactUpload = true; + return true; + } + + webgl->ErrorInvalidOperation("%s: Desired upload requires more data than is" + " available: (%u rows plus %u pixels needed, %u rows" + " plus %u pixels available)", + funcName, fullRowsNeeded.value(), + usedPixelsPerRow.value(), fullRows, tailPixels); + return false; +} + +static bool +ValidateUnpackBytes(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi, size_t availByteCount, + webgl::TexUnpackBlob* blob) +{ + if (!blob->mWidth || !blob->mHeight || !blob->mDepth) + return true; + + const auto bytesPerPixel = webgl::BytesPerPixel(pi); + const auto bytesPerRow = CheckedUint32(blob->mRowLength) * bytesPerPixel; + const auto rowStride = RoundUpToMultipleOf(bytesPerRow, blob->mAlignment); + + const auto fullRows = availByteCount / rowStride; + if (!fullRows.isValid()) { + webgl->ErrorOutOfMemory("%s: Unacceptable upload size calculated."); + return false; + } + + const auto bodyBytes = fullRows.value() * rowStride.value(); + const auto tailPixels = (availByteCount - bodyBytes) / bytesPerPixel; + + return ValidateUnpackPixels(webgl, funcName, fullRows.value(), tailPixels, blob); +} + +//////////////////// + +static uint32_t +ZeroOn2D(TexImageTarget target, uint32_t val) +{ + return (IsTarget3D(target) ? val : 0); +} + +static uint32_t +FallbackOnZero(uint32_t val, uint32_t fallback) +{ + return (val ? val : fallback); +} + +TexUnpackBlob::TexUnpackBlob(const WebGLContext* webgl, TexImageTarget target, + uint32_t rowLength, uint32_t width, uint32_t height, + uint32_t depth, bool srcIsPremult) + : mAlignment(webgl->mPixelStore_UnpackAlignment) + , mRowLength(rowLength) + , mImageHeight(FallbackOnZero(ZeroOn2D(target, webgl->mPixelStore_UnpackImageHeight), + height)) + + , mSkipPixels(webgl->mPixelStore_UnpackSkipPixels) + , mSkipRows(webgl->mPixelStore_UnpackSkipRows) + , mSkipImages(ZeroOn2D(target, webgl->mPixelStore_UnpackSkipImages)) + + , mWidth(width) + , mHeight(height) + , mDepth(depth) + + , mSrcIsPremult(srcIsPremult) + + , mNeedsExactUpload(false) +{ + MOZ_ASSERT_IF(!IsTarget3D(target), mDepth == 1); +} + +bool +TexUnpackBlob::ConvertIfNeeded(WebGLContext* webgl, const char* funcName, + const uint32_t rowLength, const uint32_t rowCount, + WebGLTexelFormat srcFormat, + const uint8_t* const srcBegin, const ptrdiff_t srcStride, + WebGLTexelFormat dstFormat, const ptrdiff_t dstStride, + const uint8_t** const out_begin, + UniqueBuffer* const out_anchoredBuffer) const +{ + MOZ_ASSERT(srcFormat != WebGLTexelFormat::FormatNotSupportingAnyConversion); + MOZ_ASSERT(dstFormat != WebGLTexelFormat::FormatNotSupportingAnyConversion); + + *out_begin = srcBegin; + + if (!rowLength || !rowCount) + return true; + + const auto& dstIsPremult = webgl->mPixelStore_PremultiplyAlpha; + const auto srcOrigin = (webgl->mPixelStore_FlipY ? gl::OriginPos::TopLeft + : gl::OriginPos::BottomLeft); + const auto dstOrigin = gl::OriginPos::BottomLeft; + + if (srcFormat != dstFormat) { + webgl->GenerateWarning("%s: Conversion requires pixel reformatting.", funcName); + } else if (mSrcIsPremult != dstIsPremult) { + webgl->GenerateWarning("%s: Conversion requires change in" + "alpha-premultiplication.", + funcName); + } else if (srcOrigin != dstOrigin) { + webgl->GenerateWarning("%s: Conversion requires y-flip.", funcName); + } else if (srcStride != dstStride) { + webgl->GenerateWarning("%s: Conversion requires change in stride.", funcName); + } else { + return true; + } + + //// + + const auto dstTotalBytes = CheckedUint32(rowCount) * dstStride; + if (!dstTotalBytes.isValid()) { + webgl->ErrorOutOfMemory("%s: Calculation failed.", funcName); + return false; + } + + UniqueBuffer dstBuffer = calloc(1, dstTotalBytes.value()); + if (!dstBuffer.get()) { + webgl->ErrorOutOfMemory("%s: Failed to allocate dest buffer.", funcName); + return false; + } + const auto dstBegin = static_cast(dstBuffer.get()); + + //// + + // And go!: + bool wasTrivial; + if (!ConvertImage(rowLength, rowCount, + srcBegin, srcStride, srcOrigin, srcFormat, mSrcIsPremult, + dstBegin, dstStride, dstOrigin, dstFormat, dstIsPremult, + &wasTrivial)) + { + webgl->ErrorImplementationBug("%s: ConvertImage failed.", funcName); + return false; + } + + *out_begin = dstBegin; + *out_anchoredBuffer = Move(dstBuffer); + return true; +} + +static GLenum +DoTexOrSubImage(bool isSubImage, gl::GLContext* gl, TexImageTarget target, GLint level, + const DriverUnpackInfo* dui, GLint xOffset, GLint yOffset, GLint zOffset, + GLsizei width, GLsizei height, GLsizei depth, const void* data) +{ + if (isSubImage) { + return DoTexSubImage(gl, target, level, xOffset, yOffset, zOffset, width, height, + depth, dui->ToPacking(), data); + } else { + return DoTexImage(gl, target, level, dui, width, height, depth, data); + } +} + +////////////////////////////////////////////////////////////////////////////////////////// +// TexUnpackBytes + +TexUnpackBytes::TexUnpackBytes(const WebGLContext* webgl, TexImageTarget target, + uint32_t width, uint32_t height, uint32_t depth, + bool isClientData, const uint8_t* ptr, size_t availBytes) + : TexUnpackBlob(webgl, target, + FallbackOnZero(webgl->mPixelStore_UnpackRowLength, width), + width, height, depth, false) + , mIsClientData(isClientData) + , mPtr(ptr) + , mAvailBytes(availBytes) +{ } + +bool +TexUnpackBytes::Validate(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) +{ + if (mIsClientData && !mPtr) + return true; + + return ValidateUnpackBytes(webgl, funcName, pi, mAvailBytes, this); +} + +bool +TexUnpackBytes::TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName, + WebGLTexture* tex, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLint xOffset, + GLint yOffset, GLint zOffset, GLenum* const out_error) const +{ + WebGLContext* webgl = tex->mContext; + + const auto pi = dui->ToPacking(); + const auto format = FormatForPackingInfo(pi); + const auto bytesPerPixel = webgl::BytesPerPixel(pi); + + const uint8_t* uploadPtr = mPtr; + UniqueBuffer tempBuffer; + + do { + if (!mIsClientData || !mPtr) + break; + + if (!webgl->mPixelStore_FlipY && + !webgl->mPixelStore_PremultiplyAlpha) + { + break; + } + + if (webgl->mPixelStore_UnpackImageHeight || + webgl->mPixelStore_UnpackSkipImages || + webgl->mPixelStore_UnpackRowLength || + webgl->mPixelStore_UnpackSkipRows || + webgl->mPixelStore_UnpackSkipPixels) + { + webgl->ErrorInvalidOperation("%s: Non-DOM-Element uploads with alpha-premult" + " or y-flip do not support subrect selection.", + funcName); + return false; + } + + webgl->GenerateWarning("%s: Alpha-premult and y-flip are deprecated for" + " non-DOM-Element uploads.", + funcName); + + const uint32_t rowLength = mWidth; + const uint32_t rowCount = mHeight * mDepth; + const auto stride = RoundUpToMultipleOf(rowLength * bytesPerPixel, mAlignment); + if (!ConvertIfNeeded(webgl, funcName, rowLength, rowCount, format, mPtr, stride, + format, stride, &uploadPtr, &tempBuffer)) + { + return false; + } + } while (false); + + ////// + + const auto& gl = webgl->gl; + + bool useParanoidHandling = false; + if (mNeedsExactUpload && webgl->mBoundPixelUnpackBuffer) { + webgl->GenerateWarning("%s: Uploads from a buffer with a final row with a byte" + " count smaller than the row stride can incur extra" + " overhead.", + funcName); + + if (gl->WorkAroundDriverBugs()) { + useParanoidHandling |= (gl->Vendor() == gl::GLVendor::NVIDIA); + } + } + + if (!useParanoidHandling) { + if (webgl->mBoundPixelUnpackBuffer) { + gl->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, + webgl->mBoundPixelUnpackBuffer->mGLName); + } + + *out_error = DoTexOrSubImage(isSubImage, gl, target, level, dui, xOffset, yOffset, + zOffset, mWidth, mHeight, mDepth, uploadPtr); + + if (webgl->mBoundPixelUnpackBuffer) { + gl->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, 0); + } + return true; + } + + ////// + + MOZ_ASSERT(webgl->mBoundPixelUnpackBuffer); + + if (!isSubImage) { + // Alloc first to catch OOMs. + AssertUintParamCorrect(gl, LOCAL_GL_PIXEL_UNPACK_BUFFER, 0); + *out_error = DoTexOrSubImage(false, gl, target, level, dui, xOffset, yOffset, + zOffset, mWidth, mHeight, mDepth, nullptr); + if (*out_error) + return true; + } + + const ScopedLazyBind bindPBO(gl, LOCAL_GL_PIXEL_UNPACK_BUFFER, + webgl->mBoundPixelUnpackBuffer); + + ////// + + // Make our sometimes-implicit values explicit. Also this keeps them constant when we + // ask for height=mHeight-1 and such. + gl->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, mRowLength); + gl->fPixelStorei(LOCAL_GL_UNPACK_IMAGE_HEIGHT, mImageHeight); + + if (mDepth > 1) { + *out_error = DoTexOrSubImage(true, gl, target, level, dui, xOffset, yOffset, + zOffset, mWidth, mHeight, mDepth-1, uploadPtr); + } + + // Skip the images we uploaded. + gl->fPixelStorei(LOCAL_GL_UNPACK_SKIP_IMAGES, mSkipImages + mDepth - 1); + + if (mHeight > 1) { + *out_error = DoTexOrSubImage(true, gl, target, level, dui, xOffset, yOffset, + zOffset+mDepth-1, mWidth, mHeight-1, 1, uploadPtr); + } + + const auto totalSkipRows = CheckedUint32(mSkipImages) * mImageHeight + mSkipRows; + const auto totalFullRows = CheckedUint32(mDepth - 1) * mImageHeight + mHeight - 1; + const auto tailOffsetRows = totalSkipRows + totalFullRows; + + const auto bytesPerRow = CheckedUint32(mRowLength) * bytesPerPixel; + const auto rowStride = RoundUpToMultipleOf(bytesPerRow, mAlignment); + if (!rowStride.isValid()) { + MOZ_CRASH("Should be checked earlier."); + } + const auto tailOffsetBytes = tailOffsetRows * rowStride; + + uploadPtr += tailOffsetBytes.value(); + + ////// + + gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, 1); // No stride padding. + gl->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, 0); // No padding in general. + gl->fPixelStorei(LOCAL_GL_UNPACK_SKIP_IMAGES, 0); // Don't skip images, + gl->fPixelStorei(LOCAL_GL_UNPACK_SKIP_ROWS, 0); // or rows. + // Keep skipping pixels though! + + *out_error = DoTexOrSubImage(true, gl, target, level, dui, xOffset, + yOffset+mHeight-1, zOffset+mDepth-1, mWidth, 1, 1, + uploadPtr); + + // Reset all our modified state. + gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, webgl->mPixelStore_UnpackAlignment); + gl->fPixelStorei(LOCAL_GL_UNPACK_IMAGE_HEIGHT, webgl->mPixelStore_UnpackImageHeight); + gl->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, webgl->mPixelStore_UnpackRowLength); + gl->fPixelStorei(LOCAL_GL_UNPACK_SKIP_IMAGES, webgl->mPixelStore_UnpackSkipImages); + gl->fPixelStorei(LOCAL_GL_UNPACK_SKIP_ROWS, webgl->mPixelStore_UnpackSkipRows); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// TexUnpackImage + +TexUnpackImage::TexUnpackImage(const WebGLContext* webgl, TexImageTarget target, + uint32_t width, uint32_t height, uint32_t depth, + layers::Image* image, bool isAlphaPremult) + : TexUnpackBlob(webgl, target, image->GetSize().width, width, height, depth, + isAlphaPremult) + , mImage(image) +{ } + +TexUnpackImage::~TexUnpackImage() +{ } + +bool +TexUnpackImage::Validate(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) +{ + if (!ValidatePIForDOM(webgl, funcName, pi)) + return false; + + const auto fullRows = mImage->GetSize().height; + return ValidateUnpackPixels(webgl, funcName, fullRows, 0, this); +} + +bool +TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName, + WebGLTexture* tex, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLint xOffset, + GLint yOffset, GLint zOffset, GLenum* const out_error) const +{ + MOZ_ASSERT_IF(needsRespec, !isSubImage); + + WebGLContext* webgl = tex->mContext; + + gl::GLContext* gl = webgl->GL(); + gl->MakeCurrent(); + + if (needsRespec) { + *out_error = DoTexOrSubImage(isSubImage, gl, target.get(), level, dui, xOffset, + yOffset, zOffset, mWidth, mHeight, mDepth, + nullptr); + if (*out_error) + return true; + } + + do { + if (mDepth != 1) + break; + + const auto& dstIsPremult = webgl->mPixelStore_PremultiplyAlpha; + if (mSrcIsPremult != dstIsPremult) + break; + + if (dui->unpackFormat != LOCAL_GL_RGB && dui->unpackFormat != LOCAL_GL_RGBA) + break; + + if (dui->unpackType != LOCAL_GL_UNSIGNED_BYTE) + break; + + gl::ScopedFramebuffer scopedFB(gl); + gl::ScopedBindFramebuffer bindFB(gl, scopedFB.FB()); + + { + gl::GLContext::LocalErrorScope errorScope(*gl); + + gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0, + target.get(), tex->mGLName, level); + + if (errorScope.GetError()) + break; + } + + const GLenum status = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); + if (status != LOCAL_GL_FRAMEBUFFER_COMPLETE) + break; + + const gfx::IntSize destSize(mWidth, mHeight); + const auto dstOrigin = (webgl->mPixelStore_FlipY ? gl::OriginPos::TopLeft + : gl::OriginPos::BottomLeft); + if (!gl->BlitHelper()->BlitImageToFramebuffer(mImage, destSize, scopedFB.FB(), + dstOrigin)) + { + break; + } + + // Blitting was successful, so we're done! + *out_error = 0; + return true; + } while (false); + + webgl->GenerateWarning("%s: Failed to hit GPU-copy fast-path. Falling back to CPU" + " upload.", + funcName); + + const RefPtr surf = mImage->GetAsSourceSurface(); + + RefPtr dataSurf; + if (surf) { + // WARNING: OSX can lose our MakeCurrent here. + dataSurf = surf->GetDataSurface(); + } + if (!dataSurf) { + webgl->ErrorOutOfMemory("%s: GetAsSourceSurface or GetDataSurface failed after" + " blit failed for TexUnpackImage.", + funcName); + return false; + } + + const TexUnpackSurface surfBlob(webgl, target, mWidth, mHeight, mDepth, dataSurf, + mSrcIsPremult); + + return surfBlob.TexOrSubImage(isSubImage, needsRespec, funcName, tex, target, level, + dui, xOffset, yOffset, zOffset, out_error); +} + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// TexUnpackSurface + +TexUnpackSurface::TexUnpackSurface(const WebGLContext* webgl, TexImageTarget target, + uint32_t width, uint32_t height, uint32_t depth, + gfx::DataSourceSurface* surf, bool isAlphaPremult) + : TexUnpackBlob(webgl, target, surf->GetSize().width, width, height, depth, + isAlphaPremult) + , mSurf(surf) +{ } + +////////// + +static bool +GetFormatForSurf(gfx::SourceSurface* surf, WebGLTexelFormat* const out_texelFormat, + uint8_t* const out_bpp) +{ + const auto surfFormat = surf->GetFormat(); + switch (surfFormat) { + case gfx::SurfaceFormat::B8G8R8A8: + *out_texelFormat = WebGLTexelFormat::BGRA8; + *out_bpp = 4; + return true; + + case gfx::SurfaceFormat::B8G8R8X8: + *out_texelFormat = WebGLTexelFormat::BGRX8; + *out_bpp = 4; + return true; + + case gfx::SurfaceFormat::R8G8B8A8: + *out_texelFormat = WebGLTexelFormat::RGBA8; + *out_bpp = 4; + return true; + + case gfx::SurfaceFormat::R8G8B8X8: + *out_texelFormat = WebGLTexelFormat::RGBX8; + *out_bpp = 4; + return true; + + case gfx::SurfaceFormat::R5G6B5_UINT16: + *out_texelFormat = WebGLTexelFormat::RGB565; + *out_bpp = 2; + return true; + + case gfx::SurfaceFormat::A8: + *out_texelFormat = WebGLTexelFormat::A8; + *out_bpp = 1; + return true; + + case gfx::SurfaceFormat::YUV: + // Ugh... + NS_ERROR("We don't handle uploads from YUV sources yet."); + // When we want to, check out gfx/ycbcr/YCbCrUtils.h. (specifically + // GetYCbCrToRGBDestFormatAndSize and ConvertYCbCrToRGB) + return false; + + default: + return false; + } +} + +////////// + +bool +TexUnpackSurface::Validate(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) +{ + if (!ValidatePIForDOM(webgl, funcName, pi)) + return false; + + const auto fullRows = mSurf->GetSize().height; + return ValidateUnpackPixels(webgl, funcName, fullRows, 0, this); +} + +bool +TexUnpackSurface::TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName, + WebGLTexture* tex, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dstDUI, GLint xOffset, + GLint yOffset, GLint zOffset, + GLenum* const out_error) const +{ + const auto& webgl = tex->mContext; + + //// + + const auto rowLength = mSurf->GetSize().width; + const auto rowCount = mSurf->GetSize().height; + + const auto& dstPI = dstDUI->ToPacking(); + const auto& dstBPP = webgl::BytesPerPixel(dstPI); + const auto dstFormat = FormatForPackingInfo(dstPI); + + //// + + WebGLTexelFormat srcFormat; + uint8_t srcBPP; + if (!GetFormatForSurf(mSurf, &srcFormat, &srcBPP)) { + webgl->ErrorImplementationBug("%s: GetFormatForSurf failed for" + " WebGLTexelFormat::%u.", + funcName, uint32_t(mSurf->GetFormat())); + return false; + } + + gfx::DataSourceSurface::ScopedMap map(mSurf, gfx::DataSourceSurface::MapType::READ); + if (!map.IsMapped()) { + webgl->ErrorOutOfMemory("%s: Failed to map source surface for upload.", funcName); + return false; + } + + const auto& srcBegin = map.GetData(); + const auto& srcStride = map.GetStride(); + + //// + + const auto srcRowLengthBytes = rowLength * srcBPP; + + const uint8_t maxGLAlignment = 8; + uint8_t srcAlignment = 1; + for (; srcAlignment <= maxGLAlignment; srcAlignment *= 2) { + const auto strideGuess = RoundUpToMultipleOf(srcRowLengthBytes, srcAlignment); + if (strideGuess == srcStride) + break; + } + const uint32_t dstAlignment = (srcAlignment > maxGLAlignment) ? 1 : srcAlignment; + + const auto dstRowLengthBytes = rowLength * dstBPP; + const auto dstStride = RoundUpToMultipleOf(dstRowLengthBytes, dstAlignment); + + //// + + const uint8_t* dstBegin = srcBegin; + UniqueBuffer tempBuffer; + if (!ConvertIfNeeded(webgl, funcName, rowLength, rowCount, srcFormat, srcBegin, + srcStride, dstFormat, dstStride, &dstBegin, &tempBuffer)) + { + return false; + } + + //// + + const auto& gl = webgl->gl; + MOZ_ALWAYS_TRUE( gl->MakeCurrent() ); + + gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, dstAlignment); + if (webgl->IsWebGL2()) { + gl->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, rowLength); + } + + *out_error = DoTexOrSubImage(isSubImage, gl, target.get(), level, dstDUI, xOffset, + yOffset, zOffset, mWidth, mHeight, mDepth, dstBegin); + + gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, webgl->mPixelStore_UnpackAlignment); + if (webgl->IsWebGL2()) { + gl->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, webgl->mPixelStore_UnpackRowLength); + } + + return true; +} + +} // namespace webgl +} // namespace mozilla diff --git a/dom/canvas/TexUnpackBlob.h b/dom/canvas/TexUnpackBlob.h new file mode 100644 index 000000000..d2328c587 --- /dev/null +++ b/dom/canvas/TexUnpackBlob.h @@ -0,0 +1,154 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef TEX_UNPACK_BLOB_H_ +#define TEX_UNPACK_BLOB_H_ + +#include "GLContextTypes.h" +#include "mozilla/RefPtr.h" +#include "WebGLStrongTypes.h" +#include "WebGLTypes.h" + + +namespace mozilla { + +class UniqueBuffer; +class WebGLContext; +class WebGLTexture; + +namespace dom { +class Element; +class HTMLCanvasElement; +class HTMLVideoElement; +} // namespace dom + +namespace gfx { +class DataSourceSurface; +} // namespace gfx + +namespace layers { +class Image; +class ImageContainer; +} // namespace layers + +namespace webgl { + +struct PackingInfo; +struct DriverUnpackInfo; + +class TexUnpackBlob +{ +public: + const uint32_t mAlignment; + const uint32_t mRowLength; + const uint32_t mImageHeight; + const uint32_t mSkipPixels; + const uint32_t mSkipRows; + const uint32_t mSkipImages; + const uint32_t mWidth; + const uint32_t mHeight; + const uint32_t mDepth; + + const bool mSrcIsPremult; + + bool mNeedsExactUpload; + +protected: + TexUnpackBlob(const WebGLContext* webgl, TexImageTarget target, uint32_t rowLength, + uint32_t width, uint32_t height, uint32_t depth, bool isSrcPremult); + +public: + virtual ~TexUnpackBlob() { } + +protected: + bool ConvertIfNeeded(WebGLContext* webgl, const char* funcName, + const uint32_t rowLength, const uint32_t rowCount, + WebGLTexelFormat srcFormat, + const uint8_t* const srcBegin, const ptrdiff_t srcStride, + WebGLTexelFormat dstFormat, const ptrdiff_t dstStride, + + const uint8_t** const out_begin, + UniqueBuffer* const out_anchoredBuffer) const; + +public: + virtual bool HasData() const { return true; } + + virtual bool Validate(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) = 0; + + // Returns false when we've generated a WebGL error. + // Returns true but with a non-zero *out_error if we still need to generate a WebGL + // error. + virtual bool TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName, + WebGLTexture* tex, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLint xOffset, + GLint yOffset, GLint zOffset, + GLenum* const out_error) const = 0; +}; + +class TexUnpackBytes final : public TexUnpackBlob +{ +public: + const bool mIsClientData; + const uint8_t* const mPtr; + const size_t mAvailBytes; + + TexUnpackBytes(const WebGLContext* webgl, TexImageTarget target, uint32_t width, + uint32_t height, uint32_t depth, bool isClientData, const uint8_t* ptr, + size_t availBytes); + + virtual bool HasData() const override { return !mIsClientData || bool(mPtr); } + + virtual bool Validate(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) override; + virtual bool TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName, + WebGLTexture* tex, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLint xOffset, + GLint yOffset, GLint zOffset, + GLenum* const out_error) const override; +}; + +class TexUnpackImage final : public TexUnpackBlob +{ +public: + const RefPtr mImage; + + TexUnpackImage(const WebGLContext* webgl, TexImageTarget target, uint32_t width, + uint32_t height, uint32_t depth, layers::Image* image, + bool isAlphaPremult); + + ~TexUnpackImage(); // Prevent needing to define layers::Image in the header. + + virtual bool Validate(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) override; + virtual bool TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName, + WebGLTexture* tex, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLint xOffset, + GLint yOffset, GLint zOffset, + GLenum* const out_error) const override; +}; + +class TexUnpackSurface final : public TexUnpackBlob +{ +public: + const RefPtr mSurf; + + TexUnpackSurface(const WebGLContext* webgl, TexImageTarget target, uint32_t width, + uint32_t height, uint32_t depth, gfx::DataSourceSurface* surf, + bool isAlphaPremult); + + virtual bool Validate(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) override; + virtual bool TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName, + WebGLTexture* tex, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLint xOffset, + GLint yOffset, GLint zOffset, + GLenum* const out_error) const override; +}; + +} // namespace webgl +} // namespace mozilla + +#endif // TEX_UNPACK_BLOB_H_ diff --git a/dom/canvas/TextMetrics.h b/dom/canvas/TextMetrics.h new file mode 100644 index 000000000..ca38b7a4e --- /dev/null +++ b/dom/canvas/TextMetrics.h @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_TextMetrics_h +#define mozilla_dom_TextMetrics_h + +#include "mozilla/dom/CanvasRenderingContext2DBinding.h" +#include "mozilla/dom/NonRefcountedDOMObject.h" + +namespace mozilla { +namespace dom { + +class TextMetrics final : public NonRefcountedDOMObject +{ +public: + explicit TextMetrics(float aValue) : width(aValue) + { + MOZ_COUNT_CTOR(TextMetrics); + } + + ~TextMetrics() + { + MOZ_COUNT_DTOR(TextMetrics); + } + + float Width() const + { + return width; + } + + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) + { + return TextMetricsBinding::Wrap(aCx, this, aGivenProto, aReflector); + } + +private: + float width; +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_TextMetrics_h diff --git a/dom/canvas/WebGL1Context.cpp b/dom/canvas/WebGL1Context.cpp new file mode 100644 index 000000000..c1818a3f9 --- /dev/null +++ b/dom/canvas/WebGL1Context.cpp @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL1Context.h" + +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "mozilla/Telemetry.h" +#include "WebGLFormats.h" + +namespace mozilla { + +/*static*/ WebGL1Context* +WebGL1Context::Create() +{ + return new WebGL1Context(); +} + +WebGL1Context::WebGL1Context() + : WebGLContext() +{ +} + +WebGL1Context::~WebGL1Context() +{ +} + +UniquePtr +WebGL1Context::CreateFormatUsage(gl::GLContext* gl) const +{ + return webgl::FormatUsageAuthority::CreateForWebGL1(gl); +} + +JSObject* +WebGL1Context::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLRenderingContextBinding::Wrap(cx, this, givenProto); +} + +} // namespace mozilla + +nsresult +NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** out_result) +{ + mozilla::Telemetry::Accumulate(mozilla::Telemetry::CANVAS_WEBGL_USED, 1); + + nsIDOMWebGLRenderingContext* ctx = mozilla::WebGL1Context::Create(); + + NS_ADDREF(*out_result = ctx); + return NS_OK; +} diff --git a/dom/canvas/WebGL1Context.h b/dom/canvas/WebGL1Context.h new file mode 100644 index 000000000..b58d57fed --- /dev/null +++ b/dom/canvas/WebGL1Context.h @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_1_CONTEXT_H_ +#define WEBGL_1_CONTEXT_H_ + +#include "WebGLContext.h" + +namespace mozilla { + +class WebGL1Context + : public WebGLContext +{ +public: + static WebGL1Context* Create(); + +private: + WebGL1Context(); + + virtual UniquePtr + CreateFormatUsage(gl::GLContext* gl) const override; + +public: + virtual ~WebGL1Context(); + + virtual bool IsWebGL2() const override { + return false; + } + + // nsWrapperCache + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + +private: + virtual bool ValidateAttribPointerType(bool integerMode, GLenum type, + uint32_t* alignment, + const char* info) override; + virtual bool ValidateUniformMatrixTranspose(bool transpose, const char* info) override; +}; + +} // namespace mozilla + +#endif // WEBGL_1_CONTEXT_H_ diff --git a/dom/canvas/WebGL1ContextUniforms.cpp b/dom/canvas/WebGL1ContextUniforms.cpp new file mode 100644 index 000000000..706eac945 --- /dev/null +++ b/dom/canvas/WebGL1ContextUniforms.cpp @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL1Context.h" + +namespace mozilla { + +bool +WebGL1Context::ValidateAttribPointerType(bool /*integerMode*/, GLenum type, + uint32_t* out_alignment, const char* info) +{ + MOZ_ASSERT(out_alignment); + if (!out_alignment) + return false; + + switch (type) { + case LOCAL_GL_BYTE: + case LOCAL_GL_UNSIGNED_BYTE: + *out_alignment = 1; + return true; + + case LOCAL_GL_SHORT: + case LOCAL_GL_UNSIGNED_SHORT: + *out_alignment = 2; + return true; + // XXX case LOCAL_GL_FIXED: + case LOCAL_GL_FLOAT: + *out_alignment = 4; + return true; + } + + ErrorInvalidEnumInfo(info, type); + return false; +} + +bool +WebGL1Context::ValidateUniformMatrixTranspose(bool transpose, const char* info) +{ + if (transpose) { + ErrorInvalidValue("%s: transpose must be FALSE as per the " + "OpenGL ES 2.0 spec", info); + return false; + } + + return true; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2Context.cpp b/dom/canvas/WebGL2Context.cpp new file mode 100644 index 000000000..f9a1eba4b --- /dev/null +++ b/dom/canvas/WebGL2Context.cpp @@ -0,0 +1,187 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "gfxPrefs.h" +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "mozilla/ArrayUtils.h" +#include "mozilla/Telemetry.h" +#include "nsPrintfCString.h" +#include "WebGLBuffer.h" +#include "WebGLFormats.h" +#include "WebGLTransformFeedback.h" + +namespace mozilla { + +WebGL2Context::WebGL2Context() + : WebGLContext() +{ + MOZ_ASSERT(IsSupported(), "not supposed to create a WebGL2Context" + "context when not supported"); +} + +WebGL2Context::~WebGL2Context() +{ + +} + +UniquePtr +WebGL2Context::CreateFormatUsage(gl::GLContext* gl) const +{ + return webgl::FormatUsageAuthority::CreateForWebGL2(gl); +} + +/*static*/ bool +WebGL2Context::IsSupported() +{ + return gfxPrefs::WebGL2Enabled(); +} + +/*static*/ WebGL2Context* +WebGL2Context::Create() +{ + return new WebGL2Context(); +} + +JSObject* +WebGL2Context::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGL2RenderingContextBinding::Wrap(cx, this, givenProto); +} + +//////////////////////////////////////////////////////////////////////////////// +// WebGL 2 initialisation + +static const gl::GLFeature kRequiredFeatures[] = { + gl::GLFeature::blend_minmax, + gl::GLFeature::clear_buffers, + gl::GLFeature::copy_buffer, + gl::GLFeature::depth_texture, + gl::GLFeature::draw_instanced, + gl::GLFeature::draw_range_elements, + gl::GLFeature::element_index_uint, + gl::GLFeature::frag_color_float, + gl::GLFeature::frag_depth, + gl::GLFeature::framebuffer_object, + gl::GLFeature::get_integer_indexed, + gl::GLFeature::get_integer64_indexed, + gl::GLFeature::gpu_shader4, + gl::GLFeature::instanced_arrays, + gl::GLFeature::instanced_non_arrays, + gl::GLFeature::map_buffer_range, // Used by GetBufferSubData. + gl::GLFeature::occlusion_query2, + gl::GLFeature::packed_depth_stencil, + gl::GLFeature::query_objects, + gl::GLFeature::renderbuffer_color_float, + gl::GLFeature::renderbuffer_color_half_float, + gl::GLFeature::sRGB_framebuffer, + gl::GLFeature::sRGB_texture, + gl::GLFeature::sampler_objects, + gl::GLFeature::standard_derivatives, + gl::GLFeature::texture_3D, + gl::GLFeature::texture_3D_compressed, + gl::GLFeature::texture_3D_copy, + gl::GLFeature::texture_float, + gl::GLFeature::texture_half_float, + gl::GLFeature::texture_half_float_linear, + gl::GLFeature::texture_non_power_of_two, + gl::GLFeature::texture_storage, + gl::GLFeature::transform_feedback2, + gl::GLFeature::uniform_buffer_object, + gl::GLFeature::uniform_matrix_nonsquare, + gl::GLFeature::vertex_array_object +}; + +bool +WebGLContext::InitWebGL2(FailureReason* const out_failReason) +{ + MOZ_ASSERT(IsWebGL2(), "WebGLContext is not a WebGL 2 context!"); + + std::vector missingList; + + const auto fnGatherMissing = [&](gl::GLFeature cur) { + if (!gl->IsSupported(cur)) { + missingList.push_back(cur); + } + }; + + const auto fnGatherMissing2 = [&](gl::GLFeature main, gl::GLFeature alt) { + if (!gl->IsSupported(main) && !gl->IsSupported(alt)) { + missingList.push_back(main); + } + }; + + //// + + for (const auto& cur : kRequiredFeatures) { + fnGatherMissing(cur); + } + + // On desktop, we fake occlusion_query_boolean with occlusion_query if + // necessary. (See WebGL2ContextQueries.cpp) + fnGatherMissing2(gl::GLFeature::occlusion_query_boolean, + gl::GLFeature::occlusion_query); + +#ifdef XP_MACOSX + // On OSX, GL core profile is used. This requires texture swizzle + // support to emulate legacy texture formats: ALPHA, LUMINANCE, + // and LUMINANCE_ALPHA. + fnGatherMissing(gl::GLFeature::texture_swizzle); +#endif + + fnGatherMissing2(gl::GLFeature::prim_restart_fixed, + gl::GLFeature::prim_restart); + + //// + + if (missingList.size()) { + nsAutoCString exts; + for (auto itr = missingList.begin(); itr != missingList.end(); ++itr) { + exts.AppendLiteral("\n "); + exts.Append(gl::GLContext::GetFeatureName(*itr)); + } + + const nsPrintfCString reason("WebGL 2 requires support for the following" + " features: %s", + exts.BeginReading()); + *out_failReason = FailureReason("FEATURE_FAILURE_WEBGL2_OCCL", reason); + return false; + } + + // we initialise WebGL 2 related stuff. + gl->GetUIntegerv(LOCAL_GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, + &mGLMaxTransformFeedbackSeparateAttribs); + gl->GetUIntegerv(LOCAL_GL_MAX_UNIFORM_BUFFER_BINDINGS, + &mGLMaxUniformBufferBindings); + + mIndexedUniformBufferBindings.resize(mGLMaxUniformBufferBindings); + + mDefaultTransformFeedback = new WebGLTransformFeedback(this, 0); + mBoundTransformFeedback = mDefaultTransformFeedback; + + gl->fGenTransformFeedbacks(1, &mEmptyTFO); + + //// + + if (!gl->IsGLES()) { + // Desktop OpenGL requires the following to be enabled in order to + // support sRGB operations on framebuffers. + gl->fEnable(LOCAL_GL_FRAMEBUFFER_SRGB_EXT); + } + + if (gl->IsSupported(gl::GLFeature::prim_restart_fixed)) { + gl->fEnable(LOCAL_GL_PRIMITIVE_RESTART_FIXED_INDEX); + } else { + MOZ_ASSERT(gl->IsSupported(gl::GLFeature::prim_restart)); + } + + ////// + + return true; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2Context.h b/dom/canvas/WebGL2Context.h new file mode 100644 index 000000000..8bb6d5c95 --- /dev/null +++ b/dom/canvas/WebGL2Context.h @@ -0,0 +1,433 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL2CONTEXT_H_ +#define WEBGL2CONTEXT_H_ + +#include "WebGLContext.h" + +namespace mozilla { + +class ErrorResult; +class WebGLSampler; +class WebGLSync; +class WebGLTransformFeedback; +class WebGLVertexArrayObject; +namespace dom { +class OwningUnsignedLongOrUint32ArrayOrBoolean; +class OwningWebGLBufferOrLongLong; +} // namespace dom + +class WebGL2Context + : public WebGLContext +{ +public: + + virtual ~WebGL2Context(); + + static bool IsSupported(); + static WebGL2Context* Create(); + + virtual bool IsWebGL2() const override + { + return true; + } + + // ------------------------------------------------------------------------- + // IMPLEMENT nsWrapperCache + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + + // ------------------------------------------------------------------------- + // Buffer objects - WebGL2ContextBuffers.cpp + + void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, + GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + +private: + template + void GetBufferSubDataT(GLenum target, GLintptr offset, const BufferT& data); + +public: + void GetBufferSubData(GLenum target, GLintptr srcByteOffset, + const dom::ArrayBufferView& dstData, GLuint dstElemOffset, + GLuint dstElemCountOverride); + + // ------------------------------------------------------------------------- + // Framebuffer objects - WebGL2ContextFramebuffers.cpp + + void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); + void FramebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture* texture, GLint level, GLint layer); + + virtual JS::Value GetFramebufferAttachmentParameter(JSContext* cx, GLenum target, + GLenum attachment, GLenum pname, + ErrorResult& rv) override; + // Make the inline version from the superclass visible here. + using WebGLContext::GetFramebufferAttachmentParameter; + + void InvalidateFramebuffer(GLenum target, const dom::Sequence& attachments, + ErrorResult& rv); + void InvalidateSubFramebuffer (GLenum target, const dom::Sequence& attachments, GLint x, GLint y, + GLsizei width, GLsizei height, ErrorResult& rv); + void ReadBuffer(GLenum mode); + + + // ------------------------------------------------------------------------- + // Renderbuffer objects - WebGL2ContextRenderbuffers.cpp + + void GetInternalformatParameter(JSContext*, GLenum target, GLenum internalformat, + GLenum pname, JS::MutableHandleValue retval, + ErrorResult& rv); + void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, + GLsizei width, GLsizei height); + + + // ------------------------------------------------------------------------- + // Texture objects - WebGL2ContextTextures.cpp + + void TexStorage2D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, + GLsizei height) + { + const char funcName[] = "TexStorage2D"; + const uint8_t funcDims = 2; + const GLsizei depth = 1; + TexStorage(funcName, funcDims, target, levels, internalFormat, width, height, + depth); + } + + void TexStorage3D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth) + { + const char funcName[] = "TexStorage3D"; + const uint8_t funcDims = 3; + TexStorage(funcName, funcDims, target, levels, internalFormat, width, height, + depth); + } + +protected: + void TexStorage(const char* funcName, uint8_t funcDims, GLenum target, GLsizei levels, + GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth); + + //////////////////////////////////// + +public: + template + void CompressedTexImage3D(GLenum target, GLint level, GLenum internalFormat, + GLsizei width, GLsizei height, GLsizei depth, GLint border, + const T& anySrc, GLuint viewElemOffset = 0, + GLuint viewElemLengthOverride = 0) + { + const char funcName[] = "compressedTexImage3D"; + const uint8_t funcDims = 3; + const TexImageSourceAdapter src(&anySrc, viewElemOffset, viewElemLengthOverride); + CompressedTexImage(funcName, funcDims, target, level, internalFormat, width, + height, depth, border, src); + } + + template + void CompressedTexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, GLsizei width, GLsizei height, + GLsizei depth, GLenum unpackFormat, const T& anySrc, + GLuint viewElemOffset = 0, + GLuint viewElemLengthOverride = 0) + { + const char funcName[] = "compressedTexSubImage3D"; + const uint8_t funcDims = 3; + const TexImageSourceAdapter src(&anySrc, viewElemOffset, viewElemLengthOverride); + CompressedTexSubImage(funcName, funcDims, target, level, xOffset, yOffset, + zOffset, width, height, depth, unpackFormat, src); + } + + //////////////////////////////////// + + void CopyTexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, GLint x, GLint y, GLsizei width, + GLsizei height) + { + const char funcName[] = "copyTexSubImage3D"; + const uint8_t funcDims = 3; + CopyTexSubImage(funcName, funcDims, target, level, xOffset, yOffset, zOffset, + x, y, width, height); + } + + //////////////////////////////////// + + template + void TexImage3D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLint border, GLenum unpackFormat, + GLenum unpackType, const T& anySrc, ErrorResult& out_error) + { + const TexImageSourceAdapter src(&anySrc, &out_error); + TexImage3D(target, level, internalFormat, width, height, depth, border, + unpackFormat, unpackType, src); + } + + void TexImage3D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLint border, GLenum unpackFormat, + GLenum unpackType, const dom::ArrayBufferView& view, + GLuint viewElemOffset, ErrorResult&) + { + const TexImageSourceAdapter src(&view, viewElemOffset); + TexImage3D(target, level, internalFormat, width, height, depth, border, + unpackFormat, unpackType, src); + } + +protected: + void TexImage3D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLint border, GLenum unpackFormat, + GLenum unpackType, const TexImageSource& src) + { + const char funcName[] = "texImage3D"; + const uint8_t funcDims = 3; + TexImage(funcName, funcDims, target, level, internalFormat, width, height, depth, + border, unpackFormat, unpackType, src); + } + + //////////////////////////////////// + +public: + template + void TexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, GLsizei width, GLsizei height, GLsizei depth, + GLenum unpackFormat, GLenum unpackType, const T& anySrc, + ErrorResult& out_error) + { + const TexImageSourceAdapter src(&anySrc, &out_error); + TexSubImage3D(target, level, xOffset, yOffset, zOffset, width, height, depth, + unpackFormat, unpackType, src); + } + + void TexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, GLsizei width, GLsizei height, GLsizei depth, + GLenum unpackFormat, GLenum unpackType, + const dom::Nullable& maybeSrcView, + GLuint srcElemOffset, ErrorResult&) + { + if (IsContextLost()) + return; + + if (!ValidateNonNull("texSubImage3D", maybeSrcView)) + return; + const auto& srcView = maybeSrcView.Value(); + + const TexImageSourceAdapter src(&srcView, srcElemOffset); + TexSubImage3D(target, level, xOffset, yOffset, zOffset, width, height, depth, + unpackFormat, unpackType, src); + } + +protected: + void TexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, GLsizei width, GLsizei height, GLsizei depth, + GLenum unpackFormat, GLenum unpackType, const TexImageSource& src) + { + const char funcName[] = "texSubImage3D"; + const uint8_t funcDims = 3; + TexSubImage(funcName, funcDims, target, level, xOffset, yOffset, zOffset, width, + height, depth, unpackFormat, unpackType, src); + } + +public: + // ------------------------------------------------------------------------- + // Programs and shaders - WebGL2ContextPrograms.cpp + GLint GetFragDataLocation(const WebGLProgram& program, const nsAString& name); + + + // ------------------------------------------------------------------------- + // Uniforms and attributes - WebGL2ContextUniforms.cpp + void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); + + //////////////// + + // GL 3.0 & ES 3.0 + void VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w, + const char* funcName = nullptr); + void VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w, + const char* funcName = nullptr); + + void VertexAttribI4iv(GLuint index, const Int32ListU& list) { + const auto& arr = Int32Arr::From(list); + if (!ValidateAttribArraySetter("vertexAttribI4iv", 4, arr.elemCount)) + return; + + const auto& itr = arr.elemBytes; + VertexAttribI4i(index, itr[0], itr[1], itr[2], itr[3]); + } + + void VertexAttribI4uiv(GLuint index, const Uint32ListU& list) { + const auto& arr = Uint32Arr::From(list); + if (!ValidateAttribArraySetter("vertexAttribI4uiv", 4, arr.elemCount)) + return; + + const auto& itr = arr.elemBytes; + VertexAttribI4ui(index, itr[0], itr[1], itr[2], itr[3]); + } + + // ------------------------------------------------------------------------- + // Writing to the drawing buffer + + /* Implemented in WebGLContext + void VertexAttribDivisor(GLuint index, GLuint divisor); + void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); + void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount); + */ + + void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, + GLenum type, WebGLintptr byteOffset) + { + const char funcName[] = "drawRangeElements"; + if (IsContextLost()) + return; + + if (end < start) { + ErrorInvalidValue("%s: end must be >= start.", funcName); + return; + } + + DrawElements(mode, count, type, byteOffset, funcName); + } + + // ------------------------------------------------------------------------ + // Multiple Render Targets - WebGL2ContextMRTs.cpp + /* Implemented in WebGLContext + void DrawBuffers(const dom::Sequence& buffers); + */ + +private: + bool ValidateClearBuffer(const char* funcName, GLenum buffer, GLint drawBuffer, + size_t availElemCount, GLuint elemOffset, GLenum funcType); + + void ClearBufferfv(GLenum buffer, GLint drawBuffer, const Float32Arr& src, + GLuint srcElemOffset); + void ClearBufferiv(GLenum buffer, GLint drawBuffer, const Int32Arr& src, + GLuint srcElemOffset); + void ClearBufferuiv(GLenum buffer, GLint drawBuffer, const Uint32Arr& src, + GLuint srcElemOffset); + +public: + void ClearBufferfv(GLenum buffer, GLint drawBuffer, const Float32ListU& list, + GLuint srcElemOffset) + { + ClearBufferfv(buffer, drawBuffer, Float32Arr::From(list), srcElemOffset); + } + void ClearBufferiv(GLenum buffer, GLint drawBuffer, const Int32ListU& list, + GLuint srcElemOffset) + { + ClearBufferiv(buffer, drawBuffer, Int32Arr::From(list), srcElemOffset); + } + void ClearBufferuiv(GLenum buffer, GLint drawBuffer, const Uint32ListU& list, + GLuint srcElemOffset) + { + ClearBufferuiv(buffer, drawBuffer, Uint32Arr::From(list), srcElemOffset); + } + + void ClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); + + // ------------------------------------------------------------------------- + // Sampler Objects - WebGL2ContextSamplers.cpp + + already_AddRefed CreateSampler(); + void DeleteSampler(WebGLSampler* sampler); + bool IsSampler(const WebGLSampler* sampler); + void BindSampler(GLuint unit, WebGLSampler* sampler); + void SamplerParameteri(WebGLSampler& sampler, GLenum pname, GLint param); + void SamplerParameterf(WebGLSampler& sampler, GLenum pname, GLfloat param); + void GetSamplerParameter(JSContext*, const WebGLSampler& sampler, GLenum pname, + JS::MutableHandleValue retval); + + + // ------------------------------------------------------------------------- + // Sync objects - WebGL2ContextSync.cpp + + const GLuint64 kMaxClientWaitSyncTimeoutNS = 1000 * 1000 * 1000; // 1000ms in ns. + + already_AddRefed FenceSync(GLenum condition, GLbitfield flags); + bool IsSync(const WebGLSync* sync); + void DeleteSync(WebGLSync* sync); + GLenum ClientWaitSync(const WebGLSync& sync, GLbitfield flags, GLuint64 timeout); + void WaitSync(const WebGLSync& sync, GLbitfield flags, GLint64 timeout); + void GetSyncParameter(JSContext*, const WebGLSync& sync, GLenum pname, + JS::MutableHandleValue retval); + + + // ------------------------------------------------------------------------- + // Transform Feedback - WebGL2ContextTransformFeedback.cpp + + already_AddRefed CreateTransformFeedback(); + void DeleteTransformFeedback(WebGLTransformFeedback* tf); + bool IsTransformFeedback(const WebGLTransformFeedback* tf); + void BindTransformFeedback(GLenum target, WebGLTransformFeedback* tf); + void BeginTransformFeedback(GLenum primitiveMode); + void EndTransformFeedback(); + void PauseTransformFeedback(); + void ResumeTransformFeedback(); + void TransformFeedbackVaryings(WebGLProgram& program, + const dom::Sequence& varyings, + GLenum bufferMode); + already_AddRefed + GetTransformFeedbackVarying(const WebGLProgram& program, GLuint index); + + + // ------------------------------------------------------------------------- + // Uniform Buffer Objects and Transform Feedback Buffers - WebGL2ContextUniforms.cpp + // TODO(djg): Implemented in WebGLContext +/* + void BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer); + void BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer, GLintptr offset, GLsizeiptr size); +*/ + virtual JS::Value GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv) override; + // Make the inline version from the superclass visible here. + using WebGLContext::GetParameter; + void GetIndexedParameter(JSContext* cx, GLenum target, GLuint index, + JS::MutableHandleValue retval, ErrorResult& rv); + void GetUniformIndices(const WebGLProgram& program, + const dom::Sequence& uniformNames, + dom::Nullable< nsTArray >& retval); + void GetActiveUniforms(JSContext* cx, const WebGLProgram& program, + const dom::Sequence& uniformIndices, GLenum pname, + JS::MutableHandleValue retval); + + GLuint GetUniformBlockIndex(const WebGLProgram& program, + const nsAString& uniformBlockName); + void GetActiveUniformBlockParameter(JSContext*, const WebGLProgram& program, + GLuint uniformBlockIndex, GLenum pname, + JS::MutableHandleValue retval, ErrorResult& rv); + void GetActiveUniformBlockName(const WebGLProgram& program, GLuint uniformBlockIndex, + nsAString& retval); + void UniformBlockBinding(WebGLProgram& program, GLuint uniformBlockIndex, + GLuint uniformBlockBinding); + + + // ------------------------------------------------------------------------- + // Vertex Array Object - WebGL2ContextVAOs.cpp + // TODO(djg): Implemented in WebGLContext +/* + already_AddRefed CreateVertexArray(); + void DeleteVertexArray(WebGLVertexArrayObject* vertexArray); + bool IsVertexArray(WebGLVertexArrayObject* vertexArray); + void BindVertexArray(WebGLVertexArrayObject* vertexArray); +*/ + +private: + WebGL2Context(); + virtual UniquePtr + CreateFormatUsage(gl::GLContext* gl) const override; + + virtual bool IsTexParamValid(GLenum pname) const override; + + void UpdateBoundQuery(GLenum target, WebGLQuery* query); + + // CreateVertexArrayImpl is assumed to be infallible. + virtual WebGLVertexArray* CreateVertexArrayImpl() override; + virtual bool ValidateAttribPointerType(bool integerMode, GLenum type, + uint32_t* alignment, + const char* info) override; + virtual bool ValidateUniformMatrixTranspose(bool transpose, const char* info) override; +}; + +} // namespace mozilla + +#endif diff --git a/dom/canvas/WebGL2ContextBuffers.cpp b/dom/canvas/WebGL2ContextBuffers.cpp new file mode 100644 index 000000000..f59fa08b8 --- /dev/null +++ b/dom/canvas/WebGL2ContextBuffers.cpp @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "WebGLBuffer.h" +#include "WebGLTransformFeedback.h" + +namespace mozilla { + +// ------------------------------------------------------------------------- +// Buffer objects + +void +WebGL2Context::CopyBufferSubData(GLenum readTarget, GLenum writeTarget, + GLintptr readOffset, GLintptr writeOffset, + GLsizeiptr size) +{ + const char funcName[] = "copyBufferSubData"; + if (IsContextLost()) + return; + + const auto& readBuffer = ValidateBufferSelection(funcName, readTarget); + if (!readBuffer) + return; + + const auto& writeBuffer = ValidateBufferSelection(funcName, writeTarget); + if (!writeBuffer) + return; + + if (!ValidateNonNegative(funcName, "readOffset", readOffset) || + !ValidateNonNegative(funcName, "writeOffset", writeOffset) || + !ValidateNonNegative(funcName, "size", size)) + { + return; + } + + const auto fnValidateOffsetSize = [&](const char* info, GLintptr offset, + const WebGLBuffer* buffer) + { + const auto neededBytes = CheckedInt(offset) + size; + if (!neededBytes.isValid() || neededBytes.value() > buffer->ByteLength()) { + ErrorInvalidValue("%s: Invalid %s range.", funcName, info); + return false; + } + return true; + }; + + if (!fnValidateOffsetSize("read", readOffset, readBuffer) || + !fnValidateOffsetSize("write", writeOffset, writeBuffer)) + { + return; + } + + if (readBuffer == writeBuffer) { + MOZ_ASSERT((CheckedInt(readOffset) + size).isValid()); + MOZ_ASSERT((CheckedInt(writeOffset) + size).isValid()); + + const bool separate = (readOffset + size <= writeOffset || + writeOffset + size <= readOffset); + if (!separate) { + ErrorInvalidValue("%s: ranges [readOffset, readOffset + size) and" + " [writeOffset, writeOffset + size) overlap", + funcName); + return; + } + } + + const auto& readType = readBuffer->Content(); + const auto& writeType = writeBuffer->Content(); + MOZ_ASSERT(readType != WebGLBuffer::Kind::Undefined); + MOZ_ASSERT(writeType != WebGLBuffer::Kind::Undefined); + if (writeType != readType) { + ErrorInvalidOperation("%s: Can't copy %s data to %s data.", + funcName, + (readType == WebGLBuffer::Kind::OtherData) ? "other" + : "element", + (writeType == WebGLBuffer::Kind::OtherData) ? "other" + : "element"); + return; + } + + gl->MakeCurrent(); + const ScopedLazyBind readBind(gl, readTarget, readBuffer); + const ScopedLazyBind writeBind(gl, writeTarget, writeBuffer); + gl->fCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); +} + +void +WebGL2Context::GetBufferSubData(GLenum target, GLintptr srcByteOffset, + const dom::ArrayBufferView& dstData, GLuint dstElemOffset, + GLuint dstElemCountOverride) +{ + const char funcName[] = "getBufferSubData"; + if (IsContextLost()) + return; + + if (!ValidateNonNegative(funcName, "srcByteOffset", srcByteOffset)) + return; + + uint8_t* bytes; + size_t byteLen; + if (!ValidateArrayBufferView(funcName, dstData, dstElemOffset, dstElemCountOverride, + &bytes, &byteLen)) + { + return; + } + + //// + + const auto& buffer = ValidateBufferSelection(funcName, target); + if (!buffer) + return; + + if (!buffer->ValidateRange(funcName, srcByteOffset, byteLen)) + return; + + //// + + if (!CheckedInt(byteLen).isValid()) { + ErrorOutOfMemory("%s: Size too large.", funcName); + return; + } + const GLsizeiptr glByteLen(byteLen); + + //// + + gl->MakeCurrent(); + const ScopedLazyBind readBind(gl, target, buffer); + + if (byteLen) { + const bool isTF = (target == LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER); + GLenum mapTarget = target; + if (isTF) { + gl->fBindTransformFeedback(LOCAL_GL_TRANSFORM_FEEDBACK, mEmptyTFO); + gl->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, buffer->mGLName); + mapTarget = LOCAL_GL_ARRAY_BUFFER; + } + + const auto mappedBytes = gl->fMapBufferRange(mapTarget, srcByteOffset, glByteLen, + LOCAL_GL_MAP_READ_BIT); + memcpy(bytes, mappedBytes, byteLen); + gl->fUnmapBuffer(mapTarget); + + if (isTF) { + const GLuint vbo = (mBoundArrayBuffer ? mBoundArrayBuffer->mGLName : 0); + gl->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, vbo); + const GLuint tfo = (mBoundTransformFeedback ? mBoundTransformFeedback->mGLName + : 0); + gl->fBindTransformFeedback(LOCAL_GL_TRANSFORM_FEEDBACK, tfo); + } + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextFramebuffers.cpp b/dom/canvas/WebGL2ContextFramebuffers.cpp new file mode 100644 index 000000000..c22bb9190 --- /dev/null +++ b/dom/canvas/WebGL2ContextFramebuffers.cpp @@ -0,0 +1,339 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "GLScreenBuffer.h" +#include "WebGLContextUtils.h" +#include "WebGLFormats.h" +#include "WebGLFramebuffer.h" + +namespace mozilla { + +void +WebGL2Context::BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + if (IsContextLost()) + return; + + const GLbitfield validBits = LOCAL_GL_COLOR_BUFFER_BIT | + LOCAL_GL_DEPTH_BUFFER_BIT | + LOCAL_GL_STENCIL_BUFFER_BIT; + if ((mask | validBits) != validBits) { + ErrorInvalidValue("blitFramebuffer: Invalid bit set in mask."); + return; + } + + switch (filter) { + case LOCAL_GL_NEAREST: + case LOCAL_GL_LINEAR: + break; + default: + ErrorInvalidEnumInfo("blitFramebuffer: Bad `filter`:", filter); + return; + } + + //// + + const auto& readFB = mBoundReadFramebuffer; + if (readFB && + !readFB->ValidateAndInitAttachments("blitFramebuffer's READ_FRAMEBUFFER")) + { + return; + } + + const auto& drawFB = mBoundDrawFramebuffer; + if (drawFB && + !drawFB->ValidateAndInitAttachments("blitFramebuffer's DRAW_FRAMEBUFFER")) + { + return; + } + + //// + + if (!mBoundReadFramebuffer) { + ClearBackbufferIfNeeded(); + } + + WebGLFramebuffer::BlitFramebuffer(this, + readFB, srcX0, srcY0, srcX1, srcY1, + drawFB, dstX0, dstY0, dstX1, dstY1, + mask, filter); +} + +void +WebGL2Context::FramebufferTextureLayer(GLenum target, GLenum attachment, + WebGLTexture* texture, GLint level, GLint layer) +{ + const char funcName[] = "framebufferTextureLayer"; + if (IsContextLost()) + return; + + if (!ValidateFramebufferTarget(target, funcName)) + return; + + WebGLFramebuffer* fb; + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + case LOCAL_GL_DRAW_FRAMEBUFFER: + fb = mBoundDrawFramebuffer; + break; + + case LOCAL_GL_READ_FRAMEBUFFER: + fb = mBoundReadFramebuffer; + break; + + default: + MOZ_CRASH("GFX: Bad target."); + } + + if (!fb) + return ErrorInvalidOperation("%s: Cannot modify framebuffer 0.", funcName); + + fb->FramebufferTextureLayer(funcName, attachment, texture, level, layer); +} + +JS::Value +WebGL2Context::GetFramebufferAttachmentParameter(JSContext* cx, + GLenum target, + GLenum attachment, + GLenum pname, + ErrorResult& out_error) +{ + return WebGLContext::GetFramebufferAttachmentParameter(cx, target, attachment, pname, + out_error); +} + +//// + +static bool +ValidateBackbufferAttachmentEnum(WebGLContext* webgl, const char* funcName, + GLenum attachment) +{ + switch (attachment) { + case LOCAL_GL_COLOR: + case LOCAL_GL_DEPTH: + case LOCAL_GL_STENCIL: + return true; + + default: + webgl->ErrorInvalidEnum("%s: attachment: invalid enum value 0x%x.", + funcName, attachment); + return false; + } +} + +static bool +ValidateFramebufferAttachmentEnum(WebGLContext* webgl, const char* funcName, + GLenum attachment) +{ + switch (attachment) { + case LOCAL_GL_DEPTH_ATTACHMENT: + case LOCAL_GL_STENCIL_ATTACHMENT: + case LOCAL_GL_DEPTH_STENCIL_ATTACHMENT: + return true; + } + + if (attachment < LOCAL_GL_COLOR_ATTACHMENT0) { + webgl->ErrorInvalidEnum("%s: attachment: invalid enum value 0x%x.", + funcName, attachment); + return false; + } + + if (attachment > webgl->LastColorAttachmentEnum()) { + // That these errors have different types is ridiculous. + webgl->ErrorInvalidOperation("%s: Too-large LOCAL_GL_COLOR_ATTACHMENTn.", + funcName); + return false; + } + + return true; +} + +bool +WebGLContext::ValidateInvalidateFramebuffer(const char* funcName, GLenum target, + const dom::Sequence& attachments, + ErrorResult* const out_rv, + std::vector* const scopedVector, + GLsizei* const out_glNumAttachments, + const GLenum** const out_glAttachments) +{ + if (IsContextLost()) + return false; + + gl->MakeCurrent(); + + if (!ValidateFramebufferTarget(target, funcName)) + return false; + + const WebGLFramebuffer* fb; + bool isDefaultFB; + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + case LOCAL_GL_DRAW_FRAMEBUFFER: + fb = mBoundDrawFramebuffer; + isDefaultFB = gl->Screen()->IsDrawFramebufferDefault(); + break; + + case LOCAL_GL_READ_FRAMEBUFFER: + fb = mBoundReadFramebuffer; + isDefaultFB = gl->Screen()->IsReadFramebufferDefault(); + break; + + default: + MOZ_CRASH("GFX: Bad target."); + } + + *out_glNumAttachments = attachments.Length(); + *out_glAttachments = attachments.Elements(); + + if (fb) { + for (const auto& attachment : attachments) { + if (!ValidateFramebufferAttachmentEnum(this, funcName, attachment)) + return false; + } + } else { + for (const auto& attachment : attachments) { + if (!ValidateBackbufferAttachmentEnum(this, funcName, attachment)) + return false; + } + + if (!isDefaultFB) { + MOZ_ASSERT(scopedVector->empty()); + scopedVector->reserve(attachments.Length()); + for (const auto& attachment : attachments) { + switch (attachment) { + case LOCAL_GL_COLOR: + scopedVector->push_back(LOCAL_GL_COLOR_ATTACHMENT0); + break; + + case LOCAL_GL_DEPTH: + scopedVector->push_back(LOCAL_GL_DEPTH_ATTACHMENT); + break; + + case LOCAL_GL_STENCIL: + scopedVector->push_back(LOCAL_GL_STENCIL_ATTACHMENT); + break; + + default: + MOZ_CRASH(); + } + } + *out_glNumAttachments = scopedVector->size(); + *out_glAttachments = scopedVector->data(); + } + } + + //// + + if (!fb) { + ClearBackbufferIfNeeded(); + + // Don't do more validation after these. + Invalidate(); + mShouldPresent = true; + } + + return true; +} + +void +WebGL2Context::InvalidateFramebuffer(GLenum target, + const dom::Sequence& attachments, + ErrorResult& rv) +{ + const char funcName[] = "invalidateSubFramebuffer"; + + std::vector scopedVector; + GLsizei glNumAttachments; + const GLenum* glAttachments; + if (!ValidateInvalidateFramebuffer(funcName, target, attachments, &rv, &scopedVector, + &glNumAttachments, &glAttachments)) + { + return; + } + + //// + + // Some drivers (like OSX 10.9 GL) just don't support invalidate_framebuffer. + const bool useFBInvalidation = (mAllowFBInvalidation && + gl->IsSupported(gl::GLFeature::invalidate_framebuffer)); + if (useFBInvalidation) { + gl->fInvalidateFramebuffer(target, glNumAttachments, glAttachments); + return; + } + + // Use clear instead? + // No-op for now. +} + +void +WebGL2Context::InvalidateSubFramebuffer(GLenum target, const dom::Sequence& attachments, + GLint x, GLint y, GLsizei width, GLsizei height, + ErrorResult& rv) +{ + const char funcName[] = "invalidateSubFramebuffer"; + + if (!ValidateNonNegative(funcName, "width", width) || + !ValidateNonNegative(funcName, "height", height)) + { + return; + } + + std::vector scopedVector; + GLsizei glNumAttachments; + const GLenum* glAttachments; + if (!ValidateInvalidateFramebuffer(funcName, target, attachments, &rv, &scopedVector, + &glNumAttachments, &glAttachments)) + { + return; + } + + //// + + // Some drivers (like OSX 10.9 GL) just don't support invalidate_framebuffer. + const bool useFBInvalidation = (mAllowFBInvalidation && + gl->IsSupported(gl::GLFeature::invalidate_framebuffer)); + if (useFBInvalidation) { + gl->fInvalidateSubFramebuffer(target, glNumAttachments, glAttachments, x, y, + width, height); + return; + } + + // Use clear instead? + // No-op for now. +} + +void +WebGL2Context::ReadBuffer(GLenum mode) +{ + const char funcName[] = "readBuffer"; + if (IsContextLost()) + return; + + if (mBoundReadFramebuffer) { + mBoundReadFramebuffer->ReadBuffer(funcName, mode); + return; + } + + // Operating on the default framebuffer. + if (mode != LOCAL_GL_NONE && + mode != LOCAL_GL_BACK) + { + nsCString enumName; + EnumName(mode, &enumName); + ErrorInvalidOperation("%s: If READ_FRAMEBUFFER is null, `mode` must be BACK or" + " NONE. Was %s.", + funcName, enumName.BeginReading()); + return; + } + + gl->Screen()->SetReadBuffer(mode); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextMRTs.cpp b/dom/canvas/WebGL2ContextMRTs.cpp new file mode 100644 index 000000000..18e235bd6 --- /dev/null +++ b/dom/canvas/WebGL2ContextMRTs.cpp @@ -0,0 +1,188 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "WebGLFramebuffer.h" + +namespace mozilla { + +bool +WebGL2Context::ValidateClearBuffer(const char* funcName, GLenum buffer, GLint drawBuffer, + size_t availElemCount, GLuint elemOffset, + GLenum funcType) +{ + if (elemOffset > availElemCount) { + ErrorInvalidValue("%s: Offset too big for list.", funcName); + return false; + } + availElemCount -= elemOffset; + + //// + + size_t requiredElements; + GLint maxDrawBuffer; + switch (buffer) { + case LOCAL_GL_COLOR: + requiredElements = 4; + maxDrawBuffer = mGLMaxDrawBuffers - 1; + break; + + case LOCAL_GL_DEPTH: + case LOCAL_GL_STENCIL: + requiredElements = 1; + maxDrawBuffer = 0; + break; + + case LOCAL_GL_DEPTH_STENCIL: + requiredElements = 2; + maxDrawBuffer = 0; + break; + + default: + ErrorInvalidEnumInfo(funcName, buffer); + return false; + } + + if (drawBuffer < 0 || drawBuffer > maxDrawBuffer) { + ErrorInvalidValue("%s: Invalid drawbuffer %d. This buffer only supports" + " `drawbuffer` values between 0 and %u.", + funcName, drawBuffer, maxDrawBuffer); + return false; + } + + if (availElemCount < requiredElements) { + ErrorInvalidValue("%s: Not enough elements. Require %u. Given %u.", + funcName, requiredElements, availElemCount); + return false; + } + + //// + + MakeContextCurrent(); + + const auto& fb = mBoundDrawFramebuffer; + if (fb) { + if (!fb->ValidateAndInitAttachments(funcName)) + return false; + + if (!fb->ValidateClearBufferType(funcName, buffer, drawBuffer, funcType)) + return false; + } else if (buffer == LOCAL_GL_COLOR) { + if (drawBuffer != 0) + return true; + + if (mDefaultFB_DrawBuffer0 == LOCAL_GL_NONE) + return true; + + if (funcType != LOCAL_GL_FLOAT) { + ErrorInvalidOperation("%s: For default framebuffer, COLOR is always of type" + " FLOAT.", + funcName); + return false; + } + } + + return true; +} + +//// + +void +WebGL2Context::ClearBufferfv(GLenum buffer, GLint drawBuffer, const Float32Arr& src, + GLuint srcElemOffset) +{ + const char funcName[] = "clearBufferfv"; + if (IsContextLost()) + return; + + if (buffer != LOCAL_GL_COLOR && + buffer != LOCAL_GL_DEPTH) + { + ErrorInvalidEnum("%s: buffer must be COLOR or DEPTH.", funcName); + return; + } + + if (!ValidateClearBuffer(funcName, buffer, drawBuffer, src.elemCount, srcElemOffset, + LOCAL_GL_FLOAT)) + { + return; + } + + ScopedDrawCallWrapper wrapper(*this); + const auto ptr = src.elemBytes + srcElemOffset; + gl->fClearBufferfv(buffer, drawBuffer, ptr); +} + +void +WebGL2Context::ClearBufferiv(GLenum buffer, GLint drawBuffer, const Int32Arr& src, + GLuint srcElemOffset) +{ + const char funcName[] = "clearBufferiv"; + if (IsContextLost()) + return; + + if (buffer != LOCAL_GL_COLOR && + buffer != LOCAL_GL_STENCIL) + { + ErrorInvalidEnum("%s: buffer must be COLOR or STENCIL.", funcName); + return; + } + + if (!ValidateClearBuffer(funcName, buffer, drawBuffer, src.elemCount, srcElemOffset, + LOCAL_GL_INT)) + { + return; + } + + ScopedDrawCallWrapper wrapper(*this); + const auto ptr = src.elemBytes + srcElemOffset; + gl->fClearBufferiv(buffer, drawBuffer, ptr); +} + +void +WebGL2Context::ClearBufferuiv(GLenum buffer, GLint drawBuffer, const Uint32Arr& src, + GLuint srcElemOffset) +{ + const char funcName[] = "clearBufferuiv"; + if (IsContextLost()) + return; + + if (buffer != LOCAL_GL_COLOR) + return ErrorInvalidEnum("%s: buffer must be COLOR.", funcName); + + if (!ValidateClearBuffer(funcName, buffer, drawBuffer, src.elemCount, srcElemOffset, + LOCAL_GL_UNSIGNED_INT)) + { + return; + } + + ScopedDrawCallWrapper wrapper(*this); + const auto ptr = src.elemBytes + srcElemOffset; + gl->fClearBufferuiv(buffer, drawBuffer, ptr); +} + +//// + +void +WebGL2Context::ClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, + GLint stencil) +{ + const char funcName[] = "clearBufferfi"; + if (IsContextLost()) + return; + + if (buffer != LOCAL_GL_DEPTH_STENCIL) + return ErrorInvalidEnum("%s: buffer must be DEPTH_STENCIL.", funcName); + + if (!ValidateClearBuffer(funcName, buffer, drawBuffer, 2, 0, 0)) + return; + + ScopedDrawCallWrapper wrapper(*this); + gl->fClearBufferfi(buffer, drawBuffer, depth, stencil); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextPrograms.cpp b/dom/canvas/WebGL2ContextPrograms.cpp new file mode 100644 index 000000000..b53798e75 --- /dev/null +++ b/dom/canvas/WebGL2ContextPrograms.cpp @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "WebGLProgram.h" + +namespace mozilla { + +// ------------------------------------------------------------------------- +// Programs and shaders + +GLint +WebGL2Context::GetFragDataLocation(const WebGLProgram& prog, const nsAString& name) +{ + if (IsContextLost()) + return -1; + + if (!ValidateObject("getFragDataLocation: program", prog)) + return -1; + + return prog.GetFragDataLocation(name); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextQueries.cpp b/dom/canvas/WebGL2ContextQueries.cpp new file mode 100644 index 000000000..a2eafcfc4 --- /dev/null +++ b/dom/canvas/WebGL2ContextQueries.cpp @@ -0,0 +1,232 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" +#include "GLContext.h" +#include "WebGLQuery.h" +#include "gfxPrefs.h" +#include "nsThreadUtils.h" + +namespace mozilla { + +/* + * We fake ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE with + * SAMPLES_PASSED on desktop. + * + * OpenGL ES 3.0 spec 4.1.6: + * If the target of the query is ANY_SAMPLES_PASSED_CONSERVATIVE, an + * implementation may choose to use a less precise version of the test which + * can additionally set the samples-boolean state to TRUE in some other + * implementation-dependent cases. + */ + +WebGLRefPtr* +WebGLContext::ValidateQuerySlotByTarget(const char* funcName, GLenum target) +{ + if (IsWebGL2()) { + switch (target) { + case LOCAL_GL_ANY_SAMPLES_PASSED: + case LOCAL_GL_ANY_SAMPLES_PASSED_CONSERVATIVE: + return &mQuerySlot_SamplesPassed; + + case LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: + return &mQuerySlot_TFPrimsWritten; + + default: + break; + } + } + + if (IsExtensionEnabled(WebGLExtensionID::EXT_disjoint_timer_query)) { + switch (target) { + case LOCAL_GL_TIME_ELAPSED_EXT: + return &mQuerySlot_TimeElapsed; + + default: + break; + } + } + + ErrorInvalidEnum("%s: Bad `target`.", funcName); + return nullptr; +} + + +// ------------------------------------------------------------------------- +// Query Objects + +already_AddRefed +WebGLContext::CreateQuery(const char* funcName) +{ + if (!funcName) { + funcName = "createQuery"; + } + + if (IsContextLost()) + return nullptr; + + RefPtr globj = new WebGLQuery(this); + return globj.forget(); +} + +void +WebGLContext::DeleteQuery(WebGLQuery* query, const char* funcName) +{ + if (!funcName) { + funcName = "deleteQuery"; + } + + if (!ValidateDeleteObject(funcName, query)) + return; + + query->DeleteQuery(); +} + +bool +WebGLContext::IsQuery(const WebGLQuery* query, const char* funcName) +{ + if (!funcName) { + funcName = "isQuery"; + } + + if (!ValidateIsObject(funcName, query)) + return false; + + return query->IsQuery(); +} + +void +WebGLContext::BeginQuery(GLenum target, WebGLQuery& query, const char* funcName) +{ + if (!funcName) { + funcName = "beginQuery"; + } + + if (IsContextLost()) + return; + + if (!ValidateObject(funcName, query)) + return; + + const auto& slot = ValidateQuerySlotByTarget(funcName, target); + if (!slot) + return; + + if (*slot) + return ErrorInvalidOperation("%s: Query target already active.", funcName); + + //// + + query.BeginQuery(target, *slot); +} + +void +WebGLContext::EndQuery(GLenum target, const char* funcName) +{ + if (!funcName) { + funcName = "endQuery"; + } + + if (IsContextLost()) + return; + + const auto& slot = ValidateQuerySlotByTarget(funcName, target); + if (!slot) + return; + + const auto& query = *slot; + if (!query) + return ErrorInvalidOperation("%s: Query target not active.", funcName); + + query->EndQuery(); +} + +void +WebGLContext::GetQuery(JSContext* cx, GLenum target, GLenum pname, + JS::MutableHandleValue retval, const char* funcName) +{ + if (!funcName) { + funcName = "getQuery"; + } + + retval.setNull(); + if (IsContextLost()) + return; + + switch (pname) { + case LOCAL_GL_CURRENT_QUERY_EXT: + { + if (IsExtensionEnabled(WebGLExtensionID::EXT_disjoint_timer_query) && + target == LOCAL_GL_TIMESTAMP) + { + // Doesn't seem illegal to ask about, but is always null. + // TIMESTAMP has no slot, so ValidateQuerySlotByTarget would generate + // INVALID_ENUM. + return; + } + + const auto& slot = ValidateQuerySlotByTarget(funcName, target); + if (!slot || !*slot) + return; + + const auto& query = *slot; + if (target != query->Target()) + return; + + JS::Rooted v(cx); + dom::GetOrCreateDOMReflector(cx, slot->get(), &v); + retval.set(v); + } + return; + + case LOCAL_GL_QUERY_COUNTER_BITS_EXT: + if (!IsExtensionEnabled(WebGLExtensionID::EXT_disjoint_timer_query)) + break; + + if (target != LOCAL_GL_TIME_ELAPSED_EXT && + target != LOCAL_GL_TIMESTAMP_EXT) + { + ErrorInvalidEnum("%s: Bad pname for target.", funcName); + return; + } + + { + GLint bits = 0; + gl->fGetQueryiv(target, pname, &bits); + + if (!Has64BitTimestamps() && bits > 32) { + bits = 32; + } + retval.set(JS::Int32Value(bits)); + } + return; + + default: + break; + } + + ErrorInvalidEnum("%s: Bad pname.", funcName); + return; +} + +void +WebGLContext::GetQueryParameter(JSContext*, const WebGLQuery& query, GLenum pname, + JS::MutableHandleValue retval, const char* funcName) +{ + if (!funcName) { + funcName = "getQueryParameter"; + } + + retval.setNull(); + if (IsContextLost()) + return; + + if (!ValidateObject(funcName, query)) + return; + + query.GetQueryParameter(pname, retval); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextRenderbuffers.cpp b/dom/canvas/WebGL2ContextRenderbuffers.cpp new file mode 100644 index 000000000..7a6163729 --- /dev/null +++ b/dom/canvas/WebGL2ContextRenderbuffers.cpp @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "WebGLContextUtils.h" + +namespace mozilla { + +void +WebGL2Context::GetInternalformatParameter(JSContext* cx, GLenum target, + GLenum internalformat, GLenum pname, + JS::MutableHandleValue retval, + ErrorResult& out_rv) +{ + const char funcName[] = "getInternalfomratParameter"; + retval.setObjectOrNull(nullptr); + + if (IsContextLost()) + return; + + if (target != LOCAL_GL_RENDERBUFFER) { + ErrorInvalidEnum("%s: `target` must be RENDERBUFFER, was: 0x%04x.", funcName, + target); + return; + } + + // GLES 3.0.4 $4.4.4 p212: + // "An internal format is color-renderable if it is one of the formats from table 3.13 + // noted as color-renderable or if it is unsized format RGBA or RGB." + + GLenum sizedFormat; + switch (internalformat) { + case LOCAL_GL_RGB: + sizedFormat = LOCAL_GL_RGB8; + break; + case LOCAL_GL_RGBA: + sizedFormat = LOCAL_GL_RGBA8; + break; + default: + sizedFormat = internalformat; + break; + } + + // In RenderbufferStorage, we allow DEPTH_STENCIL. Therefore, it is accepted for + // internalformat as well. Please ignore the conformance test fail for DEPTH_STENCIL. + + const auto usage = mFormatUsage->GetRBUsage(sizedFormat); + if (!usage) { + ErrorInvalidEnum("%s: `internalformat` must be color-, depth-, or stencil-renderable, was: 0x%04x.", + funcName, internalformat); + return; + } + + if (pname != LOCAL_GL_SAMPLES) { + ErrorInvalidEnumInfo("%s: `pname` must be SAMPLES, was 0x%04x.", funcName, pname); + return; + } + + GLint* samples = nullptr; + GLint sampleCount = 0; + gl->fGetInternalformativ(LOCAL_GL_RENDERBUFFER, internalformat, + LOCAL_GL_NUM_SAMPLE_COUNTS, 1, &sampleCount); + if (sampleCount > 0) { + samples = new GLint[sampleCount]; + gl->fGetInternalformativ(LOCAL_GL_RENDERBUFFER, internalformat, LOCAL_GL_SAMPLES, + sampleCount, samples); + } + + JSObject* obj = dom::Int32Array::Create(cx, this, sampleCount, samples); + if (!obj) { + out_rv = NS_ERROR_OUT_OF_MEMORY; + } + + delete[] samples; + + retval.setObjectOrNull(obj); +} + +void +WebGL2Context::RenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalFormat, + GLsizei width, GLsizei height) +{ + const char funcName[] = "renderbufferStorageMultisample"; + if (IsContextLost()) + return; + + RenderbufferStorage_base(funcName, target, samples, internalFormat, width, height); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextSamplers.cpp b/dom/canvas/WebGL2ContextSamplers.cpp new file mode 100644 index 000000000..bf5e04779 --- /dev/null +++ b/dom/canvas/WebGL2ContextSamplers.cpp @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" +#include "WebGLSampler.h" +#include "GLContext.h" + +namespace mozilla { + +already_AddRefed +WebGL2Context::CreateSampler() +{ + if (IsContextLost()) + return nullptr; + + GLuint sampler; + MakeContextCurrent(); + gl->fGenSamplers(1, &sampler); + + RefPtr globj = new WebGLSampler(this, sampler); + return globj.forget(); +} + +void +WebGL2Context::DeleteSampler(WebGLSampler* sampler) +{ + if (!ValidateDeleteObject("deleteSampler", sampler)) + return; + + for (int n = 0; n < mGLMaxTextureUnits; n++) { + if (mBoundSamplers[n] == sampler) { + mBoundSamplers[n] = nullptr; + + InvalidateResolveCacheForTextureWithTexUnit(n); + } + } + + sampler->RequestDelete(); +} + +bool +WebGL2Context::IsSampler(const WebGLSampler* sampler) +{ + if (!ValidateIsObject("isSampler", sampler)) + return false; + + MakeContextCurrent(); + return gl->fIsSampler(sampler->mGLName); +} + +void +WebGL2Context::BindSampler(GLuint unit, WebGLSampler* sampler) +{ + if (IsContextLost()) + return; + + if (sampler && !ValidateObject("bindSampler", *sampler)) + return; + + if (GLint(unit) >= mGLMaxTextureUnits) + return ErrorInvalidValue("bindSampler: unit must be < %d", mGLMaxTextureUnits); + + //// + + gl->MakeCurrent(); + gl->fBindSampler(unit, sampler ? sampler->mGLName : 0); + + InvalidateResolveCacheForTextureWithTexUnit(unit); + mBoundSamplers[unit] = sampler; +} + +void +WebGL2Context::SamplerParameteri(WebGLSampler& sampler, GLenum pname, GLint param) +{ + const char funcName[] = "samplerParameteri"; + if (IsContextLost()) + return; + + if (!ValidateObject(funcName, sampler)) + return; + + sampler.SamplerParameter(funcName, pname, FloatOrInt(param)); +} + +void +WebGL2Context::SamplerParameterf(WebGLSampler& sampler, GLenum pname, GLfloat param) +{ + const char funcName[] = "samplerParameterf"; + if (IsContextLost()) + return; + + if (!ValidateObject(funcName, sampler)) + return; + + sampler.SamplerParameter(funcName, pname, FloatOrInt(param)); +} + +void +WebGL2Context::GetSamplerParameter(JSContext*, const WebGLSampler& sampler, GLenum pname, + JS::MutableHandleValue retval) +{ + const char funcName[] = "getSamplerParameter"; + retval.setNull(); + + if (IsContextLost()) + return; + + if (!ValidateObject(funcName, sampler)) + return; + + //// + + gl->MakeCurrent(); + + switch (pname) { + case LOCAL_GL_TEXTURE_MIN_FILTER: + case LOCAL_GL_TEXTURE_MAG_FILTER: + case LOCAL_GL_TEXTURE_WRAP_S: + case LOCAL_GL_TEXTURE_WRAP_T: + case LOCAL_GL_TEXTURE_WRAP_R: + case LOCAL_GL_TEXTURE_COMPARE_MODE: + case LOCAL_GL_TEXTURE_COMPARE_FUNC: + { + GLint param = 0; + gl->fGetSamplerParameteriv(sampler.mGLName, pname, ¶m); + retval.set(JS::Int32Value(param)); + } + return; + + case LOCAL_GL_TEXTURE_MIN_LOD: + case LOCAL_GL_TEXTURE_MAX_LOD: + { + GLfloat param = 0; + gl->fGetSamplerParameterfv(sampler.mGLName, pname, ¶m); + retval.set(JS::Float32Value(param)); + } + return; + + default: + ErrorInvalidEnumArg(funcName, "pname", pname); + return; + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextState.cpp b/dom/canvas/WebGL2ContextState.cpp new file mode 100644 index 000000000..be0a7a3cb --- /dev/null +++ b/dom/canvas/WebGL2ContextState.cpp @@ -0,0 +1,202 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "WebGLBuffer.h" +#include "WebGLContextUtils.h" +#include "WebGLFramebuffer.h" +#include "WebGLSampler.h" +#include "WebGLTransformFeedback.h" +#include "WebGLVertexArray.h" + +namespace mozilla { + +JS::Value +WebGL2Context::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv) +{ + // The following cases are handled in WebGLContext::GetParameter(): + // case LOCAL_GL_MAX_COLOR_ATTACHMENTS: + // case LOCAL_GL_MAX_DRAW_BUFFERS: + // case LOCAL_GL_DRAW_BUFFERi: + + if (IsContextLost()) + return JS::NullValue(); + + MakeContextCurrent(); + + switch (pname) { + /* GLboolean */ + case LOCAL_GL_RASTERIZER_DISCARD: + case LOCAL_GL_SAMPLE_ALPHA_TO_COVERAGE: + case LOCAL_GL_SAMPLE_COVERAGE: { + realGLboolean b = 0; + gl->fGetBooleanv(pname, &b); + return JS::BooleanValue(bool(b)); + } + + case LOCAL_GL_TRANSFORM_FEEDBACK_ACTIVE: + return JS::BooleanValue(mBoundTransformFeedback->mIsActive); + case LOCAL_GL_TRANSFORM_FEEDBACK_PAUSED: + return JS::BooleanValue(mBoundTransformFeedback->mIsPaused); + + /* GLenum */ + case LOCAL_GL_READ_BUFFER: { + if (!mBoundReadFramebuffer) + return JS::Int32Value(gl->Screen()->GetReadBufferMode()); + + if (!mBoundReadFramebuffer->ColorReadBuffer()) + return JS::Int32Value(LOCAL_GL_NONE); + + return JS::Int32Value(mBoundReadFramebuffer->ColorReadBuffer()->mAttachmentPoint); + } + + case LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT: + /* fall through */ + + /* GLint */ + case LOCAL_GL_MAX_COMBINED_UNIFORM_BLOCKS: + case LOCAL_GL_MAX_ELEMENTS_INDICES: + case LOCAL_GL_MAX_ELEMENTS_VERTICES: + case LOCAL_GL_MAX_FRAGMENT_INPUT_COMPONENTS: + case LOCAL_GL_MAX_FRAGMENT_UNIFORM_BLOCKS: + case LOCAL_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: + case LOCAL_GL_MAX_PROGRAM_TEXEL_OFFSET: + case LOCAL_GL_MAX_SAMPLES: + case LOCAL_GL_MAX_TEXTURE_LOD_BIAS: + case LOCAL_GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: + case LOCAL_GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: + case LOCAL_GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: + case LOCAL_GL_MAX_UNIFORM_BUFFER_BINDINGS: + case LOCAL_GL_MAX_VERTEX_OUTPUT_COMPONENTS: + case LOCAL_GL_MAX_VERTEX_UNIFORM_BLOCKS: + case LOCAL_GL_MAX_VERTEX_UNIFORM_COMPONENTS: + case LOCAL_GL_MIN_PROGRAM_TEXEL_OFFSET: + case LOCAL_GL_PACK_ROW_LENGTH: + case LOCAL_GL_PACK_SKIP_PIXELS: + case LOCAL_GL_PACK_SKIP_ROWS: + case LOCAL_GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: + case LOCAL_GL_UNPACK_IMAGE_HEIGHT: + case LOCAL_GL_UNPACK_ROW_LENGTH: { + GLint val; + gl->fGetIntegerv(pname, &val); + return JS::Int32Value(val); + } + + case LOCAL_GL_UNPACK_SKIP_IMAGES: + return JS::Int32Value(mPixelStore_UnpackSkipImages); + + case LOCAL_GL_UNPACK_SKIP_PIXELS: + return JS::Int32Value(mPixelStore_UnpackSkipPixels); + + case LOCAL_GL_UNPACK_SKIP_ROWS: + return JS::Int32Value(mPixelStore_UnpackSkipRows); + + case LOCAL_GL_MAX_3D_TEXTURE_SIZE: + return JS::Int32Value(mImplMax3DTextureSize); + + case LOCAL_GL_MAX_ARRAY_TEXTURE_LAYERS: + return JS::Int32Value(mImplMaxArrayTextureLayers); + + case LOCAL_GL_MAX_VARYING_COMPONENTS: { + // On OS X Core Profile this is buggy. The spec says that the + // value is 4 * GL_MAX_VARYING_VECTORS + GLint val; + gl->fGetIntegerv(LOCAL_GL_MAX_VARYING_VECTORS, &val); + return JS::Int32Value(4*val); + } + + /* GLint64 */ + case LOCAL_GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL: + return JS::NumberValue(kMaxClientWaitSyncTimeoutNS); + + case LOCAL_GL_MAX_ELEMENT_INDEX: + // GL_MAX_ELEMENT_INDEX becomes available in GL 4.3 or via ES3 + // compatibility + if (!gl->IsSupported(gl::GLFeature::ES3_compatibility)) + return JS::NumberValue(UINT32_MAX); + + /*** fall through to fGetInteger64v ***/ + MOZ_FALLTHROUGH; + + case LOCAL_GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: + case LOCAL_GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: + case LOCAL_GL_MAX_UNIFORM_BLOCK_SIZE: { + GLint64 val; + gl->fGetInteger64v(pname, &val); + return JS::DoubleValue(static_cast(val)); + } + + + /* GLuint64 */ + case LOCAL_GL_MAX_SERVER_WAIT_TIMEOUT: { + GLuint64 val; + gl->fGetInteger64v(pname, (GLint64*) &val); + return JS::DoubleValue(static_cast(val)); + } + + case LOCAL_GL_COPY_READ_BUFFER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundCopyReadBuffer.get(), rv); + + case LOCAL_GL_COPY_WRITE_BUFFER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundCopyWriteBuffer.get(), rv); + + case LOCAL_GL_PIXEL_PACK_BUFFER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundPixelPackBuffer.get(), rv); + + case LOCAL_GL_PIXEL_UNPACK_BUFFER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundPixelUnpackBuffer.get(), rv); + + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: + { + const auto& tf = mBoundTransformFeedback; + return WebGLObjectAsJSValue(cx, tf->mGenericBufferBinding.get(), rv); + } + + case LOCAL_GL_UNIFORM_BUFFER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundUniformBuffer.get(), rv); + + // DRAW_FRAMEBUFFER_BINDING is the same as FRAMEBUFFER_BINDING. + case LOCAL_GL_READ_FRAMEBUFFER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundReadFramebuffer.get(), rv); + + case LOCAL_GL_SAMPLER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundSamplers[mActiveTexture].get(), rv); + + case LOCAL_GL_TEXTURE_BINDING_2D_ARRAY: + return WebGLObjectAsJSValue(cx, mBound2DArrayTextures[mActiveTexture].get(), rv); + + case LOCAL_GL_TEXTURE_BINDING_3D: + return WebGLObjectAsJSValue(cx, mBound3DTextures[mActiveTexture].get(), rv); + + case LOCAL_GL_TRANSFORM_FEEDBACK_BINDING: + { + const WebGLTransformFeedback* tf = mBoundTransformFeedback; + if (tf == mDefaultTransformFeedback) { + tf = nullptr; + } + return WebGLObjectAsJSValue(cx, tf, rv); + } + + case LOCAL_GL_VERTEX_ARRAY_BINDING: { + WebGLVertexArray* vao = + (mBoundVertexArray != mDefaultVertexArray) ? mBoundVertexArray.get() : nullptr; + return WebGLObjectAsJSValue(cx, vao, rv); + } + + case LOCAL_GL_VERSION: + return StringValue(cx, "WebGL 2.0", rv); + + case LOCAL_GL_SHADING_LANGUAGE_VERSION: + return StringValue(cx, "WebGL GLSL ES 3.00", rv); + + default: + return WebGLContext::GetParameter(cx, pname, rv); + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextSync.cpp b/dom/canvas/WebGL2ContextSync.cpp new file mode 100644 index 000000000..5a5ac2b0a --- /dev/null +++ b/dom/canvas/WebGL2ContextSync.cpp @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "WebGLSync.h" + +namespace mozilla { + +// ------------------------------------------------------------------------- +// Sync objects + +already_AddRefed +WebGL2Context::FenceSync(GLenum condition, GLbitfield flags) +{ + if (IsContextLost()) + return nullptr; + + if (condition != LOCAL_GL_SYNC_GPU_COMMANDS_COMPLETE) { + ErrorInvalidEnum("fenceSync: condition must be SYNC_GPU_COMMANDS_COMPLETE"); + return nullptr; + } + + if (flags != 0) { + ErrorInvalidValue("fenceSync: flags must be 0"); + return nullptr; + } + + MakeContextCurrent(); + RefPtr globj = new WebGLSync(this, condition, flags); + return globj.forget(); +} + +bool +WebGL2Context::IsSync(const WebGLSync* sync) +{ + if (!ValidateIsObject("isSync", sync)) + return false; + + return true; +} + +void +WebGL2Context::DeleteSync(WebGLSync* sync) +{ + if (!ValidateDeleteObject("deleteSync", sync)) + return; + + sync->RequestDelete(); +} + +GLenum +WebGL2Context::ClientWaitSync(const WebGLSync& sync, GLbitfield flags, GLuint64 timeout) +{ + const char funcName[] = "clientWaitSync"; + if (IsContextLost()) + return LOCAL_GL_WAIT_FAILED; + + if (!ValidateObject(funcName, sync)) + return LOCAL_GL_WAIT_FAILED; + + if (flags != 0 && flags != LOCAL_GL_SYNC_FLUSH_COMMANDS_BIT) { + ErrorInvalidValue("%s: `flags` must be SYNC_FLUSH_COMMANDS_BIT or 0.", funcName); + return LOCAL_GL_WAIT_FAILED; + } + + if (timeout > kMaxClientWaitSyncTimeoutNS) { + ErrorInvalidOperation("%s: `timeout` must not exceed %s nanoseconds.", funcName, + "MAX_CLIENT_WAIT_TIMEOUT_WEBGL"); + return LOCAL_GL_WAIT_FAILED; + } + + MakeContextCurrent(); + return gl->fClientWaitSync(sync.mGLName, flags, timeout); +} + +void +WebGL2Context::WaitSync(const WebGLSync& sync, GLbitfield flags, GLint64 timeout) +{ + const char funcName[] = "waitSync"; + if (IsContextLost()) + return; + + if (!ValidateObject(funcName, sync)) + return; + + if (flags != 0) { + ErrorInvalidValue("%s: `flags` must be 0.", funcName); + return; + } + + if (timeout != -1) { + ErrorInvalidValue("%s: `timeout` must be TIMEOUT_IGNORED.", funcName); + return; + } + + MakeContextCurrent(); + gl->fWaitSync(sync.mGLName, flags, LOCAL_GL_TIMEOUT_IGNORED); +} + +void +WebGL2Context::GetSyncParameter(JSContext*, const WebGLSync& sync, GLenum pname, + JS::MutableHandleValue retval) +{ + const char funcName[] = "getSyncParameter"; + retval.setNull(); + if (IsContextLost()) + return; + + if (!ValidateObject(funcName, sync)) + return; + + //// + + gl->MakeCurrent(); + + GLint result = 0; + switch (pname) { + case LOCAL_GL_OBJECT_TYPE: + case LOCAL_GL_SYNC_STATUS: + case LOCAL_GL_SYNC_CONDITION: + case LOCAL_GL_SYNC_FLAGS: + gl->fGetSynciv(sync.mGLName, pname, 1, nullptr, &result); + retval.set(JS::Int32Value(result)); + return; + + default: + ErrorInvalidEnum("%s: Invalid pname 0x%04x", funcName, pname); + return; + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextTextures.cpp b/dom/canvas/WebGL2ContextTextures.cpp new file mode 100644 index 000000000..52baac7bc --- /dev/null +++ b/dom/canvas/WebGL2ContextTextures.cpp @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "GLContext.h" +#include "WebGL2Context.h" +#include "WebGLContextUtils.h" +#include "WebGLTexture.h" + +namespace mozilla { + +void +WebGL2Context::TexStorage(const char* funcName, uint8_t funcDims, GLenum rawTarget, + GLsizei levels, GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth) +{ + TexTarget target; + WebGLTexture* tex; + if (!ValidateTexTarget(this, funcName, funcDims, rawTarget, &target, &tex)) + return; + + tex->TexStorage(funcName, target, levels, internalFormat, width, height, depth); +} + +//////////////////// + +/*virtual*/ bool +WebGL2Context::IsTexParamValid(GLenum pname) const +{ + switch (pname) { + case LOCAL_GL_TEXTURE_BASE_LEVEL: + case LOCAL_GL_TEXTURE_COMPARE_FUNC: + case LOCAL_GL_TEXTURE_COMPARE_MODE: + case LOCAL_GL_TEXTURE_IMMUTABLE_FORMAT: + case LOCAL_GL_TEXTURE_IMMUTABLE_LEVELS: + case LOCAL_GL_TEXTURE_MAX_LEVEL: + case LOCAL_GL_TEXTURE_WRAP_R: + case LOCAL_GL_TEXTURE_MAX_LOD: + case LOCAL_GL_TEXTURE_MIN_LOD: + return true; + + default: + return WebGLContext::IsTexParamValid(pname); + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextTransformFeedback.cpp b/dom/canvas/WebGL2ContextTransformFeedback.cpp new file mode 100644 index 000000000..48bdf756c --- /dev/null +++ b/dom/canvas/WebGL2ContextTransformFeedback.cpp @@ -0,0 +1,160 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" +#include "WebGLActiveInfo.h" +#include "WebGLProgram.h" +#include "WebGLTransformFeedback.h" +#include "GLContext.h" + +namespace mozilla { + +// ------------------------------------------------------------------------- +// Transform Feedback + +already_AddRefed +WebGL2Context::CreateTransformFeedback() +{ + if (IsContextLost()) + return nullptr; + + MakeContextCurrent(); + GLuint tf = 0; + gl->fGenTransformFeedbacks(1, &tf); + + RefPtr ret = new WebGLTransformFeedback(this, tf); + return ret.forget(); +} + +void +WebGL2Context::DeleteTransformFeedback(WebGLTransformFeedback* tf) +{ + const char funcName[] = "deleteTransformFeedback"; + if (!ValidateDeleteObject(funcName, tf)) + return; + + if (tf->mIsActive) { + ErrorInvalidOperation("%s: Cannot delete active transform feedbacks.", funcName); + return; + } + + if (mBoundTransformFeedback == tf) { + BindTransformFeedback(LOCAL_GL_TRANSFORM_FEEDBACK, nullptr); + } + + tf->RequestDelete(); +} + +bool +WebGL2Context::IsTransformFeedback(const WebGLTransformFeedback* tf) +{ + if (!ValidateIsObject("isTransformFeedback", tf)) + return false; + + MakeContextCurrent(); + return gl->fIsTransformFeedback(tf->mGLName); +} + +void +WebGL2Context::BindTransformFeedback(GLenum target, WebGLTransformFeedback* tf) +{ + const char funcName[] = "bindTransformFeedback"; + if (IsContextLost()) + return; + + if (target != LOCAL_GL_TRANSFORM_FEEDBACK) + return ErrorInvalidEnum("%s: `target` must be TRANSFORM_FEEDBACK.", funcName); + + if (tf && !ValidateObject(funcName, *tf)) + return; + + if (mBoundTransformFeedback->mIsActive && + !mBoundTransformFeedback->mIsPaused) + { + ErrorInvalidOperation("%s: Currently bound transform feedback is active and not" + " paused.", + funcName); + return; + } + + //// + + if (mBoundTransformFeedback) { + mBoundTransformFeedback->AddBufferBindCounts(-1); + } + + mBoundTransformFeedback = (tf ? tf : mDefaultTransformFeedback); + + MakeContextCurrent(); + gl->fBindTransformFeedback(target, mBoundTransformFeedback->mGLName); + + if (mBoundTransformFeedback) { + mBoundTransformFeedback->AddBufferBindCounts(+1); + } +} + +void +WebGL2Context::BeginTransformFeedback(GLenum primMode) +{ + if (IsContextLost()) + return; + + mBoundTransformFeedback->BeginTransformFeedback(primMode); +} + +void +WebGL2Context::EndTransformFeedback() +{ + if (IsContextLost()) + return; + + mBoundTransformFeedback->EndTransformFeedback(); +} + +void +WebGL2Context::PauseTransformFeedback() +{ + if (IsContextLost()) + return; + + mBoundTransformFeedback->PauseTransformFeedback(); +} + +void +WebGL2Context::ResumeTransformFeedback() +{ + if (IsContextLost()) + return; + + mBoundTransformFeedback->ResumeTransformFeedback(); +} + +void +WebGL2Context::TransformFeedbackVaryings(WebGLProgram& program, + const dom::Sequence& varyings, + GLenum bufferMode) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("transformFeedbackVaryings: program", program)) + return; + + program.TransformFeedbackVaryings(varyings, bufferMode); +} + +already_AddRefed +WebGL2Context::GetTransformFeedbackVarying(const WebGLProgram& program, GLuint index) +{ + if (IsContextLost()) + return nullptr; + + if (!ValidateObject("getTransformFeedbackVarying: program", program)) + return nullptr; + + return program.GetTransformFeedbackVarying(index); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextUniforms.cpp b/dom/canvas/WebGL2ContextUniforms.cpp new file mode 100644 index 000000000..7f8c07332 --- /dev/null +++ b/dom/canvas/WebGL2ContextUniforms.cpp @@ -0,0 +1,308 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "mozilla/RefPtr.h" +#include "WebGLBuffer.h" +#include "WebGLContext.h" +#include "WebGLProgram.h" +#include "WebGLUniformLocation.h" +#include "WebGLVertexArray.h" +#include "WebGLVertexAttribData.h" + +namespace mozilla { + +bool +WebGL2Context::ValidateUniformMatrixTranspose(bool /*transpose*/, const char* /*info*/) +{ + return true; +} + +// ------------------------------------------------------------------------- +// Uniforms + +void +WebGLContext::Uniform1ui(WebGLUniformLocation* loc, GLuint v0) +{ + if (!ValidateUniformSetter(loc, 1, LOCAL_GL_UNSIGNED_INT, "uniform1ui")) + return; + + MakeContextCurrent(); + gl->fUniform1ui(loc->mLoc, v0); +} + +void +WebGLContext::Uniform2ui(WebGLUniformLocation* loc, GLuint v0, GLuint v1) +{ + if (!ValidateUniformSetter(loc, 2, LOCAL_GL_UNSIGNED_INT, "uniform2ui")) + return; + + MakeContextCurrent(); + gl->fUniform2ui(loc->mLoc, v0, v1); +} + +void +WebGLContext::Uniform3ui(WebGLUniformLocation* loc, GLuint v0, GLuint v1, GLuint v2) +{ + if (!ValidateUniformSetter(loc, 3, LOCAL_GL_UNSIGNED_INT, "uniform3ui")) + return; + + MakeContextCurrent(); + gl->fUniform3ui(loc->mLoc, v0, v1, v2); +} + +void +WebGLContext::Uniform4ui(WebGLUniformLocation* loc, GLuint v0, GLuint v1, GLuint v2, + GLuint v3) +{ + if (!ValidateUniformSetter(loc, 4, LOCAL_GL_UNSIGNED_INT, "uniform4ui")) + return; + + MakeContextCurrent(); + gl->fUniform4ui(loc->mLoc, v0, v1, v2, v3); +} + +// ------------------------------------------------------------------------- +// Uniform Buffer Objects and Transform Feedback Buffers + +void +WebGL2Context::GetIndexedParameter(JSContext* cx, GLenum target, GLuint index, + JS::MutableHandleValue retval, ErrorResult& out_error) +{ + const char funcName[] = "getIndexedParameter"; + retval.set(JS::NullValue()); + if (IsContextLost()) + return; + + const std::vector* bindings; + switch (target) { + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_START: + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: + bindings = &(mBoundTransformFeedback->mIndexedBindings); + break; + + case LOCAL_GL_UNIFORM_BUFFER_BINDING: + case LOCAL_GL_UNIFORM_BUFFER_START: + case LOCAL_GL_UNIFORM_BUFFER_SIZE: + bindings = &mIndexedUniformBufferBindings; + break; + + default: + ErrorInvalidEnumInfo("getIndexedParameter: target", target); + return; + } + + if (index >= bindings->size()) { + ErrorInvalidValue("%s: `index` must be < %s.", funcName, + "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS"); + return; + } + const auto& binding = (*bindings)[index]; + + JS::Value ret = JS::NullValue(); + + switch (target) { + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: + case LOCAL_GL_UNIFORM_BUFFER_BINDING: + if (binding.mBufferBinding) { + ret = WebGLObjectAsJSValue(cx, binding.mBufferBinding.get(), out_error); + } + break; + + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_START: + case LOCAL_GL_UNIFORM_BUFFER_START: + ret = JS::NumberValue(binding.mRangeStart); + break; + + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: + case LOCAL_GL_UNIFORM_BUFFER_SIZE: + ret = JS::NumberValue(binding.mRangeSize); + break; + } + + retval.set(ret); +} + +void +WebGL2Context::GetUniformIndices(const WebGLProgram& program, + const dom::Sequence& uniformNames, + dom::Nullable< nsTArray >& retval) +{ + retval.SetNull(); + if (IsContextLost()) + return; + + if (!ValidateObject("getUniformIndices: program", program)) + return; + + if (!uniformNames.Length()) + return; + + program.GetUniformIndices(uniformNames, retval); +} + +static bool +ValidateUniformEnum(WebGLContext* webgl, GLenum pname, const char* info) +{ + switch (pname) { + case LOCAL_GL_UNIFORM_TYPE: + case LOCAL_GL_UNIFORM_SIZE: + case LOCAL_GL_UNIFORM_BLOCK_INDEX: + case LOCAL_GL_UNIFORM_OFFSET: + case LOCAL_GL_UNIFORM_ARRAY_STRIDE: + case LOCAL_GL_UNIFORM_MATRIX_STRIDE: + case LOCAL_GL_UNIFORM_IS_ROW_MAJOR: + return true; + + default: + webgl->ErrorInvalidEnumArg(info, "pname", pname); + return false; + } +} + +void +WebGL2Context::GetActiveUniforms(JSContext* cx, const WebGLProgram& program, + const dom::Sequence& uniformIndices, + GLenum pname, JS::MutableHandleValue retval) +{ + const char funcName[] = "getActiveUniforms"; + retval.setNull(); + if (IsContextLost()) + return; + + if (!ValidateUniformEnum(this, pname, funcName)) + return; + + if (!ValidateObject("getActiveUniforms: program", program)) + return; + + const auto& numActiveUniforms = program.LinkInfo()->uniforms.size(); + for (const auto& curIndex : uniformIndices) { + if (curIndex >= numActiveUniforms) { + ErrorInvalidValue("%s: Too-large active uniform index queried.", funcName); + return; + } + } + + const auto& count = uniformIndices.Length(); + + JS::Rooted array(cx, JS_NewArrayObject(cx, count)); + UniquePtr samples(new GLint[count]); + if (!array || !samples) { + ErrorOutOfMemory("%s: Failed to allocate buffers.", funcName); + return; + } + retval.setObject(*array); + + MakeContextCurrent(); + gl->fGetActiveUniformsiv(program.mGLName, count, uniformIndices.Elements(), pname, + samples.get()); + + switch (pname) { + case LOCAL_GL_UNIFORM_TYPE: + case LOCAL_GL_UNIFORM_SIZE: + case LOCAL_GL_UNIFORM_BLOCK_INDEX: + case LOCAL_GL_UNIFORM_OFFSET: + case LOCAL_GL_UNIFORM_ARRAY_STRIDE: + case LOCAL_GL_UNIFORM_MATRIX_STRIDE: + for (size_t i = 0; i < count; ++i) { + JS::RootedValue value(cx); + value = JS::Int32Value(samples[i]); + if (!JS_DefineElement(cx, array, i, value, JSPROP_ENUMERATE)) + return; + } + break; + case LOCAL_GL_UNIFORM_IS_ROW_MAJOR: + for (size_t i = 0; i < count; ++i) { + JS::RootedValue value(cx); + value = JS::BooleanValue(samples[i]); + if (!JS_DefineElement(cx, array, i, value, JSPROP_ENUMERATE)) + return; + } + break; + + default: + MOZ_CRASH("Invalid pname"); + } +} + +GLuint +WebGL2Context::GetUniformBlockIndex(const WebGLProgram& program, + const nsAString& uniformBlockName) +{ + if (IsContextLost()) + return 0; + + if (!ValidateObject("getUniformBlockIndex: program", program)) + return 0; + + return program.GetUniformBlockIndex(uniformBlockName); +} + +void +WebGL2Context::GetActiveUniformBlockParameter(JSContext* cx, const WebGLProgram& program, + GLuint uniformBlockIndex, GLenum pname, + JS::MutableHandleValue out_retval, + ErrorResult& out_error) +{ + out_retval.setNull(); + if (IsContextLost()) + return; + + if (!ValidateObject("getActiveUniformBlockParameter: program", program)) + return; + + MakeContextCurrent(); + + switch(pname) { + case LOCAL_GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: + case LOCAL_GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: + case LOCAL_GL_UNIFORM_BLOCK_BINDING: + case LOCAL_GL_UNIFORM_BLOCK_DATA_SIZE: + case LOCAL_GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: + out_retval.set(program.GetActiveUniformBlockParam(uniformBlockIndex, pname)); + return; + + case LOCAL_GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: + out_retval.set(program.GetActiveUniformBlockActiveUniforms(cx, uniformBlockIndex, + &out_error)); + return; + } + + ErrorInvalidEnumInfo("getActiveUniformBlockParameter: parameter", pname); +} + +void +WebGL2Context::GetActiveUniformBlockName(const WebGLProgram& program, + GLuint uniformBlockIndex, nsAString& retval) +{ + retval.SetIsVoid(true); + if (IsContextLost()) + return; + + if (!ValidateObject("getActiveUniformBlockName: program", program)) + return; + + program.GetActiveUniformBlockName(uniformBlockIndex, retval); +} + +void +WebGL2Context::UniformBlockBinding(WebGLProgram& program, GLuint uniformBlockIndex, + GLuint uniformBlockBinding) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("uniformBlockBinding: program", program)) + return; + + program.UniformBlockBinding(uniformBlockIndex, uniformBlockBinding); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextVAOs.cpp b/dom/canvas/WebGL2ContextVAOs.cpp new file mode 100644 index 000000000..5e58c91b0 --- /dev/null +++ b/dom/canvas/WebGL2ContextVAOs.cpp @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" +#include "GLContext.h" +#include "WebGLVertexArrayObject.h" + +namespace mozilla { + +// ------------------------------------------------------------------------- +// Vertex Array Object + +WebGLVertexArray* +WebGL2Context::CreateVertexArrayImpl() +{ + return dom::WebGLVertexArrayObject::Create(this); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGL2ContextVertices.cpp b/dom/canvas/WebGL2ContextVertices.cpp new file mode 100644 index 000000000..5c1b2fd60 --- /dev/null +++ b/dom/canvas/WebGL2ContextVertices.cpp @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGL2Context.h" + +#include "GLContext.h" +#include "WebGLVertexArray.h" +#include "WebGLVertexAttribData.h" + +#include "mozilla/Casting.h" + +namespace mozilla { + +bool +WebGL2Context::ValidateAttribPointerType(bool integerMode, GLenum type, + uint32_t* out_alignment, const char* info) +{ + MOZ_ASSERT(out_alignment); + + switch (type) { + case LOCAL_GL_BYTE: + case LOCAL_GL_UNSIGNED_BYTE: + *out_alignment = 1; + return true; + + case LOCAL_GL_SHORT: + case LOCAL_GL_UNSIGNED_SHORT: + *out_alignment = 2; + return true; + + case LOCAL_GL_INT: + case LOCAL_GL_UNSIGNED_INT: + *out_alignment = 4; + return true; + } + + if (!integerMode) { + switch (type) { + case LOCAL_GL_HALF_FLOAT: + *out_alignment = 2; + return true; + + case LOCAL_GL_FLOAT: + case LOCAL_GL_FIXED: + case LOCAL_GL_INT_2_10_10_10_REV: + case LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV: + *out_alignment = 4; + return true; + } + } + + ErrorInvalidEnum("%s: invalid enum value 0x%x", info, type); + return false; +} + +// ------------------------------------------------------------------------- +// Vertex Attributes + +void +WebGL2Context::VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, + GLintptr offset) +{ + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, "vertexAttribIPointer")) + return; + + if (!ValidateAttribPointer(true, index, size, type, LOCAL_GL_FALSE, stride, offset, + "vertexAttribIPointer")) + { + return; + } + + MOZ_ASSERT(mBoundVertexArray); + + InvalidateBufferFetching(); + + MakeContextCurrent(); + gl->fVertexAttribIPointer(index, size, type, stride, reinterpret_cast(offset)); + + WebGLVertexAttribData& vd = mBoundVertexArray->mAttribs[index]; + const bool integerFunc = true; + const bool normalized = false; + vd.VertexAttribPointer(integerFunc, mBoundArrayBuffer, size, type, normalized, stride, + offset); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLActiveInfo.cpp b/dom/canvas/WebGLActiveInfo.cpp new file mode 100644 index 000000000..e13f47c0a --- /dev/null +++ b/dom/canvas/WebGLActiveInfo.cpp @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLActiveInfo.h" + +#include "mozilla/dom/WebGLRenderingContextBinding.h" + +namespace mozilla { + +static uint8_t +ElemSizeFromType(GLenum elemType) +{ + switch (elemType) { + case LOCAL_GL_BOOL: + case LOCAL_GL_FLOAT: + case LOCAL_GL_INT: + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_SAMPLER_2D: + case LOCAL_GL_SAMPLER_3D: + case LOCAL_GL_SAMPLER_CUBE: + case LOCAL_GL_SAMPLER_2D_SHADOW: + case LOCAL_GL_SAMPLER_2D_ARRAY: + case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW: + case LOCAL_GL_SAMPLER_CUBE_SHADOW: + case LOCAL_GL_INT_SAMPLER_2D: + case LOCAL_GL_INT_SAMPLER_3D: + case LOCAL_GL_INT_SAMPLER_CUBE: + case LOCAL_GL_INT_SAMPLER_2D_ARRAY: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: + return 1; + + case LOCAL_GL_BOOL_VEC2: + case LOCAL_GL_FLOAT_VEC2: + case LOCAL_GL_INT_VEC2: + case LOCAL_GL_UNSIGNED_INT_VEC2: + return 2; + + case LOCAL_GL_BOOL_VEC3: + case LOCAL_GL_FLOAT_VEC3: + case LOCAL_GL_INT_VEC3: + case LOCAL_GL_UNSIGNED_INT_VEC3: + return 3; + + case LOCAL_GL_BOOL_VEC4: + case LOCAL_GL_FLOAT_VEC4: + case LOCAL_GL_INT_VEC4: + case LOCAL_GL_UNSIGNED_INT_VEC4: + case LOCAL_GL_FLOAT_MAT2: + return 4; + + case LOCAL_GL_FLOAT_MAT2x3: + case LOCAL_GL_FLOAT_MAT3x2: + return 6; + + case LOCAL_GL_FLOAT_MAT2x4: + case LOCAL_GL_FLOAT_MAT4x2: + return 8; + + case LOCAL_GL_FLOAT_MAT3: + return 9; + + case LOCAL_GL_FLOAT_MAT3x4: + case LOCAL_GL_FLOAT_MAT4x3: + return 12; + + case LOCAL_GL_FLOAT_MAT4: + return 16; + + default: + MOZ_CRASH("GFX: Bad `elemType`."); + } +} + +//////////////////// + +WebGLActiveInfo::WebGLActiveInfo(WebGLContext* webgl, GLint elemCount, GLenum elemType, + bool isArray, const nsACString& baseUserName, + const nsACString& baseMappedName) + : mWebGL(webgl) + , mElemCount(elemCount) + , mElemType(elemType) + , mBaseUserName(baseUserName) + , mIsArray(isArray) + , mElemSize(ElemSizeFromType(elemType)) + , mBaseMappedName(baseMappedName) +{ } + +bool +WebGLActiveInfo::IsSampler() const +{ + switch (mElemType) { + case LOCAL_GL_SAMPLER_2D: + case LOCAL_GL_SAMPLER_3D: + case LOCAL_GL_SAMPLER_CUBE: + case LOCAL_GL_SAMPLER_2D_SHADOW: + case LOCAL_GL_SAMPLER_2D_ARRAY: + case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW: + case LOCAL_GL_SAMPLER_CUBE_SHADOW: + case LOCAL_GL_INT_SAMPLER_2D: + case LOCAL_GL_INT_SAMPLER_3D: + case LOCAL_GL_INT_SAMPLER_CUBE: + case LOCAL_GL_INT_SAMPLER_2D_ARRAY: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: + return true; + + default: + return false; + } +} + +//////////////////////////////////////////////////////////////////////////////// + +JSObject* +WebGLActiveInfo::WrapObject(JSContext* js, JS::Handle givenProto) +{ + return dom::WebGLActiveInfoBinding::Wrap(js, this, givenProto); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLActiveInfo) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLActiveInfo, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLActiveInfo, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLActiveInfo.h b/dom/canvas/WebGLActiveInfo.h new file mode 100644 index 000000000..4a3c81758 --- /dev/null +++ b/dom/canvas/WebGLActiveInfo.h @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_ACTIVE_INFO_H_ +#define WEBGL_ACTIVE_INFO_H_ + +#include "GLDefs.h" +#include "mozilla/Attributes.h" +#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS +#include "nsISupportsImpl.h" // NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING +#include "nsString.h" +#include "nsWrapperCache.h" + +namespace mozilla { + +class WebGLContext; + +class WebGLActiveInfo final + : public nsWrapperCache +{ +public: + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLActiveInfo) + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLActiveInfo) + + virtual JSObject* WrapObject(JSContext* js, JS::Handle givenProto) override; + + WebGLContext* GetParentObject() const { + return mWebGL; + } + + WebGLContext* const mWebGL; + + // ActiveInfo state: + const uint32_t mElemCount; // `size` + const GLenum mElemType; // `type` + const nsCString mBaseUserName; // `name`, but ASCII, and without any final "[0]". + + // Not actually part of ActiveInfo: + const bool mIsArray; + const uint8_t mElemSize; + const nsCString mBaseMappedName; // Without any final "[0]". + + bool IsSampler() const; + + WebGLActiveInfo(WebGLContext* webgl, GLint elemCount, GLenum elemType, bool isArray, + const nsACString& baseUserName, const nsACString& baseMappedName); + + /* GLES 2.0.25, p33: + * This command will return as much information about active + * attributes as possible. If no information is available, length will + * be set to zero and name will be an empty string. This situation + * could arise if GetActiveAttrib is issued after a failed link. + * + * It's the same for GetActiveUniform. + */ + static WebGLActiveInfo* CreateInvalid(WebGLContext* webgl) { + return new WebGLActiveInfo(webgl); + } + + // WebIDL attributes + GLint Size() const { + return mElemCount; + } + + GLenum Type() const { + return mElemType; + } + + void GetName(nsString& retval) const { + CopyASCIItoUTF16(mBaseUserName, retval); + if (mIsArray) + retval.AppendLiteral("[0]"); + } + +private: + explicit WebGLActiveInfo(WebGLContext* webgl) + : mWebGL(webgl) + , mElemCount(0) + , mElemType(0) + , mBaseUserName("") + , mIsArray(false) + , mElemSize(0) + , mBaseMappedName("") + { } + + // Private destructor, to discourage deletion outside of Release(): + ~WebGLActiveInfo() { } +}; + +////////// + +bool IsElemTypeSampler(GLenum elemType); + +} // namespace mozilla + +#endif // WEBGL_ACTIVE_INFO_H_ diff --git a/dom/canvas/WebGLBuffer.cpp b/dom/canvas/WebGLBuffer.cpp new file mode 100644 index 000000000..f202c9950 --- /dev/null +++ b/dom/canvas/WebGLBuffer.cpp @@ -0,0 +1,290 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLBuffer.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLElementArrayCache.h" + +namespace mozilla { + +WebGLBuffer::WebGLBuffer(WebGLContext* webgl, GLuint buf) + : WebGLRefCountedObject(webgl) + , mGLName(buf) + , mContent(Kind::Undefined) + , mUsage(LOCAL_GL_STATIC_DRAW) + , mByteLength(0) + , mTFBindCount(0) + , mNonTFBindCount(0) +{ + mContext->mBuffers.insertBack(this); +} + +WebGLBuffer::~WebGLBuffer() +{ + DeleteOnce(); +} + +void +WebGLBuffer::SetContentAfterBind(GLenum target) +{ + if (mContent != Kind::Undefined) + return; + + switch (target) { + case LOCAL_GL_ELEMENT_ARRAY_BUFFER: + mContent = Kind::ElementArray; + if (!mCache) { + mCache.reset(new WebGLElementArrayCache); + } + break; + + case LOCAL_GL_ARRAY_BUFFER: + case LOCAL_GL_PIXEL_PACK_BUFFER: + case LOCAL_GL_PIXEL_UNPACK_BUFFER: + case LOCAL_GL_UNIFORM_BUFFER: + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER: + case LOCAL_GL_COPY_READ_BUFFER: + case LOCAL_GL_COPY_WRITE_BUFFER: + mContent = Kind::OtherData; + break; + + default: + MOZ_CRASH("GFX: invalid target"); + } +} + +void +WebGLBuffer::Delete() +{ + mContext->MakeContextCurrent(); + mContext->gl->fDeleteBuffers(1, &mGLName); + mByteLength = 0; + mCache = nullptr; + LinkedListElement::remove(); // remove from mContext->mBuffers +} + +//////////////////////////////////////// + +static bool +ValidateBufferUsageEnum(WebGLContext* webgl, const char* funcName, GLenum usage) +{ + switch (usage) { + case LOCAL_GL_STREAM_DRAW: + case LOCAL_GL_STATIC_DRAW: + case LOCAL_GL_DYNAMIC_DRAW: + return true; + + case LOCAL_GL_DYNAMIC_COPY: + case LOCAL_GL_DYNAMIC_READ: + case LOCAL_GL_STATIC_COPY: + case LOCAL_GL_STATIC_READ: + case LOCAL_GL_STREAM_COPY: + case LOCAL_GL_STREAM_READ: + if (MOZ_LIKELY(webgl->IsWebGL2())) + return true; + break; + + default: + break; + } + + webgl->ErrorInvalidEnum("%s: Invalid `usage`: 0x%04x", funcName, usage); + return false; +} + +void +WebGLBuffer::BufferData(GLenum target, size_t size, const void* data, GLenum usage) +{ + const char funcName[] = "bufferData"; + + // Careful: data.Length() could conceivably be any uint32_t, but GLsizeiptr + // is like intptr_t. + if (!CheckedInt(size).isValid()) + return mContext->ErrorOutOfMemory("%s: bad size", funcName); + + if (!ValidateBufferUsageEnum(mContext, funcName, usage)) + return; + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + const ScopedLazyBind lazyBind(gl, target, this); + mContext->InvalidateBufferFetching(); + +#ifdef XP_MACOSX + // bug 790879 + if (gl->WorkAroundDriverBugs() && + size > INT32_MAX) + { + mContext->ErrorOutOfMemory("%s: Allocation size too large.", funcName); + return; + } +#endif + + const bool sizeChanges = (size != ByteLength()); + if (sizeChanges) { + gl::GLContext::LocalErrorScope errorScope(*gl); + gl->fBufferData(target, size, data, usage); + const auto error = errorScope.GetError(); + + if (error) { + MOZ_ASSERT(error == LOCAL_GL_OUT_OF_MEMORY); + mContext->ErrorOutOfMemory("%s: Error from driver: 0x%04x", funcName, error); + return; + } + } else { + gl->fBufferData(target, size, data, usage); + } + + mUsage = usage; + mByteLength = size; + + // Warning: Possibly shared memory. See bug 1225033. + if (!ElementArrayCacheBufferData(data, size)) { + mByteLength = 0; + mContext->ErrorOutOfMemory("%s: Failed update index buffer cache.", funcName); + } +} + +bool +WebGLBuffer::ValidateRange(const char* funcName, size_t byteOffset, size_t byteLen) const +{ + auto availLength = mByteLength; + if (byteOffset > availLength) { + mContext->ErrorInvalidValue("%s: Offset passes the end of the buffer.", funcName); + return false; + } + availLength -= byteOffset; + + if (byteLen > availLength) { + mContext->ErrorInvalidValue("%s: Offset+size passes the end of the buffer.", + funcName); + return false; + } + + return true; +} + +//////////////////////////////////////// + +bool +WebGLBuffer::ElementArrayCacheBufferData(const void* ptr, + size_t bufferSizeInBytes) +{ + if (mContext->IsWebGL2()) + return true; + + if (mContent == Kind::ElementArray) + return mCache->BufferData(ptr, bufferSizeInBytes); + + return true; +} + +void +WebGLBuffer::ElementArrayCacheBufferSubData(size_t pos, const void* ptr, + size_t updateSizeInBytes) +{ + if (mContext->IsWebGL2()) + return; + + if (mContent == Kind::ElementArray) + mCache->BufferSubData(pos, ptr, updateSizeInBytes); +} + +size_t +WebGLBuffer::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const +{ + size_t sizeOfCache = mCache ? mCache->SizeOfIncludingThis(mallocSizeOf) + : 0; + return mallocSizeOf(this) + sizeOfCache; +} + +bool +WebGLBuffer::Validate(GLenum type, uint32_t maxAllowed, size_t first, size_t count) const +{ + if (mContext->IsWebGL2()) + return true; + + return mCache->Validate(type, maxAllowed, first, count); +} + +bool +WebGLBuffer::IsElementArrayUsedWithMultipleTypes() const +{ + if (mContext->IsWebGL2()) + return false; + + return mCache->BeenUsedWithMultipleTypes(); +} + +//// + +bool +WebGLBuffer::ValidateCanBindToTarget(const char* funcName, GLenum target) +{ + /* https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.1 + * + * In the WebGL 2 API, buffers have their WebGL buffer type + * initially set to undefined. Calling bindBuffer, bindBufferRange + * or bindBufferBase with the target argument set to any buffer + * binding point except COPY_READ_BUFFER or COPY_WRITE_BUFFER will + * then set the WebGL buffer type of the buffer being bound + * according to the table above. + * + * Any call to one of these functions which attempts to bind a + * WebGLBuffer that has the element array WebGL buffer type to a + * binding point that falls under other data, or bind a + * WebGLBuffer which has the other data WebGL buffer type to + * ELEMENT_ARRAY_BUFFER will generate an INVALID_OPERATION error, + * and the state of the binding point will remain untouched. + */ + + if (mContent == WebGLBuffer::Kind::Undefined) + return true; + + switch (target) { + case LOCAL_GL_COPY_READ_BUFFER: + case LOCAL_GL_COPY_WRITE_BUFFER: + return true; + + case LOCAL_GL_ELEMENT_ARRAY_BUFFER: + if (mContent == WebGLBuffer::Kind::ElementArray) + return true; + break; + + case LOCAL_GL_ARRAY_BUFFER: + case LOCAL_GL_PIXEL_PACK_BUFFER: + case LOCAL_GL_PIXEL_UNPACK_BUFFER: + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER: + case LOCAL_GL_UNIFORM_BUFFER: + if (mContent == WebGLBuffer::Kind::OtherData) + return true; + break; + + default: + MOZ_CRASH(); + } + + const auto dataType = (mContent == WebGLBuffer::Kind::OtherData) ? "other" + : "element"; + mContext->ErrorInvalidOperation("%s: Buffer already contains %s data.", funcName, + dataType); + return false; +} + +JSObject* +WebGLBuffer::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLBufferBinding::Wrap(cx, this, givenProto); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLBuffer) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLBuffer, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLBuffer, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLBuffer.h b/dom/canvas/WebGLBuffer.h new file mode 100644 index 000000000..883712aad --- /dev/null +++ b/dom/canvas/WebGLBuffer.h @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_BUFFER_H_ +#define WEBGL_BUFFER_H_ + +#include "GLDefs.h" +#include "mozilla/LinkedList.h" +#include "mozilla/UniquePtr.h" +#include "nsWrapperCache.h" + +#include "WebGLObjectModel.h" +#include "WebGLTypes.h" + +namespace mozilla { + +class WebGLElementArrayCache; + +class WebGLBuffer final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + friend class WebGLContext; + friend class WebGL2Context; + friend class WebGLTexture; + +public: + enum class Kind { + Undefined, + ElementArray, + OtherData + }; + + WebGLBuffer(WebGLContext* webgl, GLuint buf); + + void SetContentAfterBind(GLenum target); + Kind Content() const { return mContent; } + + void Delete(); + + size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; + + GLenum Usage() const { return mUsage; } + size_t ByteLength() const { return mByteLength; } + + bool ElementArrayCacheBufferData(const void* ptr, size_t bufferSizeInBytes); + + void ElementArrayCacheBufferSubData(size_t pos, const void* ptr, + size_t updateSizeInBytes); + + bool Validate(GLenum type, uint32_t max_allowed, size_t first, size_t count) const; + bool ValidateRange(const char* funcName, size_t byteOffset, size_t byteLen) const; + + bool IsElementArrayUsedWithMultipleTypes() const; + + WebGLContext* GetParentObject() const { + return mContext; + } + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + + bool ValidateCanBindToTarget(const char* funcName, GLenum target); + void BufferData(GLenum target, size_t size, const void* data, GLenum usage); + + //// + + static void AddBindCount(GLenum target, WebGLBuffer* buffer, int8_t addVal) { + if (!buffer) + return; + + if (target == LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER) { + MOZ_ASSERT_IF(addVal < 0, buffer->mTFBindCount >= size_t(-addVal)); + buffer->mTFBindCount += addVal; + } else { + MOZ_ASSERT_IF(addVal < 0, buffer->mNonTFBindCount >= size_t(-addVal)); + buffer->mNonTFBindCount += addVal; + } + } + + static void SetSlot(GLenum target, WebGLBuffer* newBuffer, + WebGLRefPtr* const out_slot) + { + WebGLBuffer* const oldBuffer = *out_slot; + AddBindCount(target, oldBuffer, -1); + AddBindCount(target, newBuffer, +1); + *out_slot = newBuffer; + } + + bool IsBoundForTF() const { return bool(mTFBindCount); } + bool IsBoundForNonTF() const { return bool(mNonTFBindCount); } + + //// + + const GLenum mGLName; + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLBuffer) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLBuffer) + +protected: + ~WebGLBuffer(); + + Kind mContent; + GLenum mUsage; + size_t mByteLength; + UniquePtr mCache; + size_t mTFBindCount; + size_t mNonTFBindCount; +}; + +} // namespace mozilla + +#endif // WEBGL_BUFFER_H_ diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp new file mode 100644 index 000000000..176d56f8c --- /dev/null +++ b/dom/canvas/WebGLContext.cpp @@ -0,0 +1,2480 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" + +#include + +#include "AccessCheck.h" +#include "gfxContext.h" +#include "gfxCrashReporterUtils.h" +#include "gfxPattern.h" +#include "gfxPrefs.h" +#include "gfxUtils.h" +#include "GLBlitHelper.h" +#include "GLContext.h" +#include "GLContextProvider.h" +#include "GLReadTexImageHelper.h" +#include "GLScreenBuffer.h" +#include "ImageContainer.h" +#include "ImageEncoder.h" +#include "Layers.h" +#include "LayerUserData.h" +#include "mozilla/dom/BindingUtils.h" +#include "mozilla/dom/Event.h" +#include "mozilla/dom/HTMLVideoElement.h" +#include "mozilla/dom/ImageData.h" +#include "mozilla/dom/WebGLContextEvent.h" +#include "mozilla/EnumeratedArrayCycleCollection.h" +#include "mozilla/Preferences.h" +#include "mozilla/ProcessPriorityManager.h" +#include "mozilla/ScopeExit.h" +#include "mozilla/Services.h" +#include "mozilla/Telemetry.h" +#include "nsContentUtils.h" +#include "nsDisplayList.h" +#include "nsError.h" +#include "nsIClassInfoImpl.h" +#include "nsIConsoleService.h" +#include "nsIDOMEvent.h" +#include "nsIGfxInfo.h" +#include "nsIObserverService.h" +#include "nsIVariant.h" +#include "nsIWidget.h" +#include "nsIXPConnect.h" +#include "nsServiceManagerUtils.h" +#include "nsSVGEffects.h" +#include "prenv.h" +#include "ScopedGLHelpers.h" +#include "VRManagerChild.h" +#include "mozilla/layers/TextureClientSharedSurface.h" + +#ifdef MOZ_WIDGET_GONK +#include "mozilla/layers/ShadowLayers.h" +#endif + +// Local +#include "CanvasUtils.h" +#include "WebGL1Context.h" +#include "WebGLActiveInfo.h" +#include "WebGLBuffer.h" +#include "WebGLContextLossHandler.h" +#include "WebGLContextUtils.h" +#include "WebGLExtensions.h" +#include "WebGLFramebuffer.h" +#include "WebGLMemoryTracker.h" +#include "WebGLObjectModel.h" +#include "WebGLProgram.h" +#include "WebGLQuery.h" +#include "WebGLSampler.h" +#include "WebGLShader.h" +#include "WebGLSync.h" +#include "WebGLTransformFeedback.h" +#include "WebGLVertexArray.h" +#include "WebGLVertexAttribData.h" + +#ifdef MOZ_WIDGET_COCOA +#include "nsCocoaFeatures.h" +#endif + +#ifdef XP_WIN +#include "WGLLibrary.h" +#endif + +// Generated +#include "mozilla/dom/WebGLRenderingContextBinding.h" + + +namespace mozilla { + +using namespace mozilla::dom; +using namespace mozilla::gfx; +using namespace mozilla::gl; +using namespace mozilla::layers; + +WebGLContextOptions::WebGLContextOptions() + : alpha(true) + , depth(true) + , stencil(false) + , premultipliedAlpha(true) + , antialias(true) + , preserveDrawingBuffer(false) + , failIfMajorPerformanceCaveat(false) +{ + // Set default alpha state based on preference. + if (gfxPrefs::WebGLDefaultNoAlpha()) + alpha = false; +} + + +/*static*/ const uint32_t WebGLContext::kMinMaxColorAttachments = 4; +/*static*/ const uint32_t WebGLContext::kMinMaxDrawBuffers = 4; + +WebGLContext::WebGLContext() + : WebGLContextUnchecked(nullptr) + , mBufferFetchingIsVerified(false) + , mBufferFetchingHasPerVertex(false) + , mMaxFetchedVertices(0) + , mMaxFetchedInstances(0) + , mLayerIsMirror(false) + , mBypassShaderValidation(false) + , mEmptyTFO(0) + , mContextLossHandler(this) + , mNeedsFakeNoAlpha(false) + , mNeedsFakeNoDepth(false) + , mNeedsFakeNoStencil(false) + , mNeedsEmulatedLoneDepthStencil(false) + , mAllowFBInvalidation(gfxPrefs::WebGLFBInvalidation()) +{ + mGeneration = 0; + mInvalidated = false; + mCapturedFrameInvalidated = false; + mShouldPresent = true; + mResetLayer = true; + mOptionsFrozen = false; + mMinCapability = false; + mDisableExtensions = false; + mIsMesa = false; + mEmitContextLostErrorOnce = false; + mWebGLError = 0; + mUnderlyingGLError = 0; + + mActiveTexture = 0; + + mStencilRefFront = 0; + mStencilRefBack = 0; + mStencilValueMaskFront = 0; + mStencilValueMaskBack = 0; + mStencilWriteMaskFront = 0; + mStencilWriteMaskBack = 0; + mDepthWriteMask = 0; + mStencilClearValue = 0; + mDepthClearValue = 0; + mContextLostErrorSet = false; + + mViewportX = 0; + mViewportY = 0; + mViewportWidth = 0; + mViewportHeight = 0; + + mDitherEnabled = 1; + mRasterizerDiscardEnabled = 0; // OpenGL ES 3.0 spec p244 + mScissorTestEnabled = 0; + mDepthTestEnabled = 0; + mStencilTestEnabled = 0; + + if (NS_IsMainThread()) { + // XXX mtseng: bug 709490, not thread safe + WebGLMemoryTracker::AddWebGLContext(this); + } + + mAllowContextRestore = true; + mLastLossWasSimulated = false; + mContextStatus = ContextNotLost; + mLoseContextOnMemoryPressure = false; + mCanLoseContextInForeground = true; + mRestoreWhenVisible = false; + + mAlreadyGeneratedWarnings = 0; + mAlreadyWarnedAboutFakeVertexAttrib0 = false; + mAlreadyWarnedAboutViewportLargerThanDest = false; + + mMaxWarnings = gfxPrefs::WebGLMaxWarningsPerContext(); + if (mMaxWarnings < -1) { + GenerateWarning("webgl.max-warnings-per-context size is too large (seems like a negative value wrapped)"); + mMaxWarnings = 0; + } + + mLastUseIndex = 0; + + InvalidateBufferFetching(); + + mDisableFragHighP = false; + + mDrawCallsSinceLastFlush = 0; +} + +WebGLContext::~WebGLContext() +{ + RemovePostRefreshObserver(); + + DestroyResourcesAndContext(); + if (NS_IsMainThread()) { + // XXX mtseng: bug 709490, not thread safe + WebGLMemoryTracker::RemoveWebGLContext(this); + } +} + +template +void +ClearLinkedList(LinkedList& list) +{ + while (!list.isEmpty()) { + list.getLast()->DeleteOnce(); + } +} + +void +WebGLContext::DestroyResourcesAndContext() +{ + if (!gl) + return; + + gl->MakeCurrent(); + + mBound2DTextures.Clear(); + mBoundCubeMapTextures.Clear(); + mBound3DTextures.Clear(); + mBound2DArrayTextures.Clear(); + mBoundSamplers.Clear(); + mBoundArrayBuffer = nullptr; + mBoundCopyReadBuffer = nullptr; + mBoundCopyWriteBuffer = nullptr; + mBoundPixelPackBuffer = nullptr; + mBoundPixelUnpackBuffer = nullptr; + mBoundUniformBuffer = nullptr; + mCurrentProgram = nullptr; + mActiveProgramLinkInfo = nullptr; + mBoundDrawFramebuffer = nullptr; + mBoundReadFramebuffer = nullptr; + mBoundRenderbuffer = nullptr; + mBoundVertexArray = nullptr; + mDefaultVertexArray = nullptr; + mBoundTransformFeedback = nullptr; + mDefaultTransformFeedback = nullptr; + + mQuerySlot_SamplesPassed = nullptr; + mQuerySlot_TFPrimsWritten = nullptr; + mQuerySlot_TimeElapsed = nullptr; + + mIndexedUniformBufferBindings.clear(); + + ////// + + ClearLinkedList(mBuffers); + ClearLinkedList(mFramebuffers); + ClearLinkedList(mPrograms); + ClearLinkedList(mQueries); + ClearLinkedList(mRenderbuffers); + ClearLinkedList(mSamplers); + ClearLinkedList(mShaders); + ClearLinkedList(mSyncs); + ClearLinkedList(mTextures); + ClearLinkedList(mTransformFeedbacks); + ClearLinkedList(mVertexArrays); + + ////// + + if (mEmptyTFO) { + gl->fDeleteTransformFeedbacks(1, &mEmptyTFO); + mEmptyTFO = 0; + } + + ////// + + mFakeBlack_2D_0000 = nullptr; + mFakeBlack_2D_0001 = nullptr; + mFakeBlack_CubeMap_0000 = nullptr; + mFakeBlack_CubeMap_0001 = nullptr; + mFakeBlack_3D_0000 = nullptr; + mFakeBlack_3D_0001 = nullptr; + mFakeBlack_2D_Array_0000 = nullptr; + mFakeBlack_2D_Array_0001 = nullptr; + + if (mFakeVertexAttrib0BufferObject) { + gl->fDeleteBuffers(1, &mFakeVertexAttrib0BufferObject); + mFakeVertexAttrib0BufferObject = 0; + } + + // disable all extensions except "WEBGL_lose_context". see bug #927969 + // spec: http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2 + for (size_t i = 0; i < size_t(WebGLExtensionID::Max); ++i) { + WebGLExtensionID extension = WebGLExtensionID(i); + + if (!IsExtensionEnabled(extension) || (extension == WebGLExtensionID::WEBGL_lose_context)) + continue; + + mExtensions[extension]->MarkLost(); + mExtensions[extension] = nullptr; + } + + // We just got rid of everything, so the context had better + // have been going away. + if (GLContext::ShouldSpew()) { + printf_stderr("--- WebGL context destroyed: %p\n", gl.get()); + } + + MOZ_ASSERT(gl); + mGL_OnlyClearInDestroyResourcesAndContext = nullptr; + MOZ_ASSERT(!gl); +} + +void +WebGLContext::Invalidate() +{ + if (!mCanvasElement) + return; + + mCapturedFrameInvalidated = true; + + if (mInvalidated) + return; + + nsSVGEffects::InvalidateDirectRenderingObservers(mCanvasElement); + + mInvalidated = true; + mCanvasElement->InvalidateCanvasContent(nullptr); +} + +void +WebGLContext::OnVisibilityChange() +{ + if (!IsContextLost()) { + return; + } + + if (!mRestoreWhenVisible || mLastLossWasSimulated) { + return; + } + + ForceRestoreContext(); +} + +void +WebGLContext::OnMemoryPressure() +{ + bool shouldLoseContext = mLoseContextOnMemoryPressure; + + if (!mCanLoseContextInForeground && + ProcessPriorityManager::CurrentProcessIsForeground()) + { + shouldLoseContext = false; + } + + if (shouldLoseContext) + ForceLoseContext(); +} + +// +// nsICanvasRenderingContextInternal +// + +NS_IMETHODIMP +WebGLContext::SetContextOptions(JSContext* cx, JS::Handle options, + ErrorResult& aRvForDictionaryInit) +{ + if (options.isNullOrUndefined() && mOptionsFrozen) + return NS_OK; + + WebGLContextAttributes attributes; + if (!attributes.Init(cx, options)) { + aRvForDictionaryInit.Throw(NS_ERROR_UNEXPECTED); + return NS_ERROR_UNEXPECTED; + } + + WebGLContextOptions newOpts; + + newOpts.stencil = attributes.mStencil; + newOpts.depth = attributes.mDepth; + newOpts.premultipliedAlpha = attributes.mPremultipliedAlpha; + newOpts.antialias = attributes.mAntialias; + newOpts.preserveDrawingBuffer = attributes.mPreserveDrawingBuffer; + newOpts.failIfMajorPerformanceCaveat = attributes.mFailIfMajorPerformanceCaveat; + + if (attributes.mAlpha.WasPassed()) + newOpts.alpha = attributes.mAlpha.Value(); + + // Don't do antialiasing if we've disabled MSAA. + if (!gfxPrefs::MSAALevel()) + newOpts.antialias = false; + +#if 0 + GenerateWarning("aaHint: %d stencil: %d depth: %d alpha: %d premult: %d preserve: %d\n", + newOpts.antialias ? 1 : 0, + newOpts.stencil ? 1 : 0, + newOpts.depth ? 1 : 0, + newOpts.alpha ? 1 : 0, + newOpts.premultipliedAlpha ? 1 : 0, + newOpts.preserveDrawingBuffer ? 1 : 0); +#endif + + if (mOptionsFrozen && newOpts != mOptions) { + // Error if the options are already frozen, and the ones that were asked for + // aren't the same as what they were originally. + return NS_ERROR_FAILURE; + } + + mOptions = newOpts; + return NS_OK; +} + +int32_t +WebGLContext::GetWidth() const +{ + return mWidth; +} + +int32_t +WebGLContext::GetHeight() const +{ + return mHeight; +} + +/* So there are a number of points of failure here. We might fail based + * on EGL vs. WGL, or we might fail to alloc a too-large size, or we + * might not be able to create a context with a certain combo of context + * creation attribs. + * + * We don't want to test the complete fallback matrix. (for now, at + * least) Instead, attempt creation in this order: + * 1. By platform API. (e.g. EGL vs. WGL) + * 2. By context creation attribs. + * 3. By size. + * + * That is, try to create headless contexts based on the platform API. + * Next, create dummy-sized backbuffers for the contexts with the right + * caps. Finally, resize the backbuffer to an acceptable size given the + * requested size. + */ + +static bool +IsFeatureInBlacklist(const nsCOMPtr& gfxInfo, int32_t feature, + nsCString* const out_blacklistId) +{ + int32_t status; + if (!NS_SUCCEEDED(gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo, feature, + *out_blacklistId, &status))) + { + return false; + } + + return status != nsIGfxInfo::FEATURE_STATUS_OK; +} + +static bool +HasAcceleratedLayers(const nsCOMPtr& gfxInfo) +{ + int32_t status; + + nsCString discardFailureId; + gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo, + nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, + discardFailureId, + &status); + if (status) + return true; + gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo, + nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS, + discardFailureId, + &status); + if (status) + return true; + gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo, + nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS, + discardFailureId, + &status); + if (status) + return true; + gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo, + nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, + discardFailureId, + &status); + if (status) + return true; + gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo, + nsIGfxInfo::FEATURE_OPENGL_LAYERS, + discardFailureId, + &status); + if (status) + return true; + + return false; +} + +static void +PopulateCapFallbackQueue(const gl::SurfaceCaps& baseCaps, + std::queue* out_fallbackCaps) +{ + out_fallbackCaps->push(baseCaps); + + // Dropping antialias drops our quality, but not our correctness. + // The user basically doesn't have to handle if this fails, they + // just get reduced quality. + if (baseCaps.antialias) { + gl::SurfaceCaps nextCaps(baseCaps); + nextCaps.antialias = false; + PopulateCapFallbackQueue(nextCaps, out_fallbackCaps); + } + + // If we have to drop one of depth or stencil, we'd prefer to keep + // depth. However, the client app will need to handle if this + // doesn't work. + if (baseCaps.stencil) { + gl::SurfaceCaps nextCaps(baseCaps); + nextCaps.stencil = false; + PopulateCapFallbackQueue(nextCaps, out_fallbackCaps); + } + + if (baseCaps.depth) { + gl::SurfaceCaps nextCaps(baseCaps); + nextCaps.depth = false; + PopulateCapFallbackQueue(nextCaps, out_fallbackCaps); + } +} + +static gl::SurfaceCaps +BaseCaps(const WebGLContextOptions& options, WebGLContext* webgl) +{ + gl::SurfaceCaps baseCaps; + + baseCaps.color = true; + baseCaps.alpha = options.alpha; + baseCaps.antialias = options.antialias; + baseCaps.depth = options.depth; + baseCaps.premultAlpha = options.premultipliedAlpha; + baseCaps.preserve = options.preserveDrawingBuffer; + baseCaps.stencil = options.stencil; + + if (!baseCaps.alpha) + baseCaps.premultAlpha = true; + + // we should really have this behind a + // |gfxPlatform::GetPlatform()->GetScreenDepth() == 16| check, but + // for now it's just behind a pref for testing/evaluation. + baseCaps.bpp16 = gfxPrefs::WebGLPrefer16bpp(); + +#ifdef MOZ_WIDGET_GONK + do { + auto canvasElement = webgl->GetCanvas(); + if (!canvasElement) + break; + + auto ownerDoc = canvasElement->OwnerDoc(); + nsIWidget* docWidget = nsContentUtils::WidgetForDocument(ownerDoc); + if (!docWidget) + break; + + layers::LayerManager* layerManager = docWidget->GetLayerManager(); + if (!layerManager) + break; + + // XXX we really want "AsSurfaceAllocator" here for generality + layers::ShadowLayerForwarder* forwarder = layerManager->AsShadowForwarder(); + if (!forwarder) + break; + + baseCaps.surfaceAllocator = forwarder->GetTextureForwarder(); + } while (false); +#endif + + // Done with baseCaps construction. + + if (!gfxPrefs::WebGLForceMSAA()) { + const nsCOMPtr gfxInfo = services::GetGfxInfo(); + + nsCString blocklistId; + if (IsFeatureInBlacklist(gfxInfo, nsIGfxInfo::FEATURE_WEBGL_MSAA, &blocklistId)) { + webgl->GenerateWarning("Disallowing antialiased backbuffers due" + " to blacklisting."); + baseCaps.antialias = false; + } + } + + return baseCaps; +} + +//////////////////////////////////////// + +static already_AddRefed +CreateGLWithEGL(const gl::SurfaceCaps& caps, gl::CreateContextFlags flags, + WebGLContext* webgl, + std::vector* const out_failReasons) +{ + const gfx::IntSize dummySize(16, 16); + nsCString failureId; + RefPtr gl = gl::GLContextProviderEGL::CreateOffscreen(dummySize, caps, + flags, &failureId); + if (gl && gl->IsANGLE()) { + gl = nullptr; + } + + if (!gl) { + out_failReasons->push_back(WebGLContext::FailureReason( + failureId, + "Error during EGL OpenGL init." + )); + return nullptr; + } + + return gl.forget(); +} + +static already_AddRefed +CreateGLWithANGLE(const gl::SurfaceCaps& caps, gl::CreateContextFlags flags, + WebGLContext* webgl, + std::vector* const out_failReasons) +{ + const gfx::IntSize dummySize(16, 16); + nsCString failureId; + RefPtr gl = gl::GLContextProviderEGL::CreateOffscreen(dummySize, caps, + flags, &failureId); + if (gl && !gl->IsANGLE()) { + gl = nullptr; + } + + if (!gl) { + out_failReasons->push_back(WebGLContext::FailureReason( + failureId, + "Error during ANGLE OpenGL init." + )); + return nullptr; + } + + return gl.forget(); +} + +static already_AddRefed +CreateGLWithDefault(const gl::SurfaceCaps& caps, gl::CreateContextFlags flags, + WebGLContext* webgl, + std::vector* const out_failReasons) +{ + const gfx::IntSize dummySize(16, 16); + nsCString failureId; + RefPtr gl = gl::GLContextProvider::CreateOffscreen(dummySize, caps, + flags, &failureId); + if (gl && gl->IsANGLE()) { + gl = nullptr; + } + + if (!gl) { + out_failReasons->push_back(WebGLContext::FailureReason( + failureId, + "Error during native OpenGL init." + )); + return nullptr; + } + + return gl.forget(); +} + +//////////////////////////////////////// + +bool +WebGLContext::CreateAndInitGLWith(FnCreateGL_T fnCreateGL, + const gl::SurfaceCaps& baseCaps, + gl::CreateContextFlags flags, + std::vector* const out_failReasons) +{ + std::queue fallbackCaps; + PopulateCapFallbackQueue(baseCaps, &fallbackCaps); + + MOZ_RELEASE_ASSERT(!gl, "GFX: Already have a context."); + RefPtr potentialGL; + while (!fallbackCaps.empty()) { + const gl::SurfaceCaps& caps = fallbackCaps.front(); + potentialGL = fnCreateGL(caps, flags, this, out_failReasons); + if (potentialGL) + break; + + fallbackCaps.pop(); + } + if (!potentialGL) { + out_failReasons->push_back(FailureReason("FEATURE_FAILURE_WEBGL_EXHAUSTED_CAPS", + "Exhausted GL driver caps.")); + return false; + } + + FailureReason reason; + + mGL_OnlyClearInDestroyResourcesAndContext = potentialGL; + MOZ_RELEASE_ASSERT(gl); + if (!InitAndValidateGL(&reason)) { + DestroyResourcesAndContext(); + MOZ_RELEASE_ASSERT(!gl); + + // The fail reason here should be specific enough for now. + out_failReasons->push_back(reason); + return false; + } + + return true; +} + +bool +WebGLContext::CreateAndInitGL(bool forceEnabled, + std::vector* const out_failReasons) +{ + const gl::SurfaceCaps baseCaps = BaseCaps(mOptions, this); + gl::CreateContextFlags flags = gl::CreateContextFlags::NO_VALIDATION; + bool tryNativeGL = true; + bool tryANGLE = false; + + if (forceEnabled) { + flags |= gl::CreateContextFlags::FORCE_ENABLE_HARDWARE; + } + + if (IsWebGL2()) { + flags |= gl::CreateContextFlags::PREFER_ES3; + } else { + flags |= gl::CreateContextFlags::REQUIRE_COMPAT_PROFILE; + } + + ////// + + const bool useEGL = PR_GetEnv("MOZ_WEBGL_FORCE_EGL"); + +#ifdef XP_WIN + tryNativeGL = false; + tryANGLE = true; + + if (gfxPrefs::WebGLDisableWGL()) { + tryNativeGL = false; + } + + if (gfxPrefs::WebGLDisableANGLE() || PR_GetEnv("MOZ_WEBGL_FORCE_OPENGL") || useEGL) { + tryNativeGL = true; + tryANGLE = false; + } +#endif + + if (tryNativeGL && !forceEnabled) { + const nsCOMPtr gfxInfo = services::GetGfxInfo(); + const auto feature = nsIGfxInfo::FEATURE_WEBGL_OPENGL; + + FailureReason reason; + if (IsFeatureInBlacklist(gfxInfo, feature, &reason.key)) { + reason.info = "Refused to create native OpenGL context because of blacklist" + " entry: "; + reason.info.Append(reason.key); + + out_failReasons->push_back(reason); + + GenerateWarning(reason.info.BeginReading()); + tryNativeGL = false; + } + } + + ////// + + if (tryNativeGL) { + if (useEGL) + return CreateAndInitGLWith(CreateGLWithEGL, baseCaps, flags, out_failReasons); + + if (CreateAndInitGLWith(CreateGLWithDefault, baseCaps, flags, out_failReasons)) + return true; + } + + ////// + + if (tryANGLE) + return CreateAndInitGLWith(CreateGLWithANGLE, baseCaps, flags, out_failReasons); + + ////// + + out_failReasons->push_back(FailureReason("FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS", + "Exhausted GL driver options.")); + return false; +} + +// Fallback for resizes: +bool +WebGLContext::ResizeBackbuffer(uint32_t requestedWidth, + uint32_t requestedHeight) +{ + uint32_t width = requestedWidth; + uint32_t height = requestedHeight; + + bool resized = false; + while (width || height) { + width = width ? width : 1; + height = height ? height : 1; + + gfx::IntSize curSize(width, height); + if (gl->ResizeOffscreen(curSize)) { + resized = true; + break; + } + + width /= 2; + height /= 2; + } + + if (!resized) + return false; + + mWidth = gl->OffscreenSize().width; + mHeight = gl->OffscreenSize().height; + MOZ_ASSERT((uint32_t)mWidth == width); + MOZ_ASSERT((uint32_t)mHeight == height); + + if (width != requestedWidth || + height != requestedHeight) + { + GenerateWarning("Requested size %dx%d was too large, but resize" + " to %dx%d succeeded.", + requestedWidth, requestedHeight, + width, height); + } + return true; +} + +void +WebGLContext::ThrowEvent_WebGLContextCreationError(const nsACString& text) +{ + RefPtr target = mCanvasElement; + if (!target && mOffscreenCanvas) { + target = mOffscreenCanvas; + } else if (!target) { + GenerateWarning("Failed to create WebGL context: %s", text.BeginReading()); + return; + } + + const auto kEventName = NS_LITERAL_STRING("webglcontextcreationerror"); + + WebGLContextEventInit eventInit; + // eventInit.mCancelable = true; // The spec says this, but it's silly. + eventInit.mStatusMessage = NS_ConvertASCIItoUTF16(text); + + const RefPtr event = WebGLContextEvent::Constructor(target, + kEventName, + eventInit); + event->SetTrusted(true); + + bool didPreventDefault; + target->DispatchEvent(event, &didPreventDefault); + + ////// + + GenerateWarning("Failed to create WebGL context: %s", text.BeginReading()); +} + +NS_IMETHODIMP +WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight) +{ + if (signedWidth < 0 || signedHeight < 0) { + if (!gl) { + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID, + NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_SIZE")); + } + GenerateWarning("Canvas size is too large (seems like a negative value wrapped)"); + return NS_ERROR_OUT_OF_MEMORY; + } + + uint32_t width = signedWidth; + uint32_t height = signedHeight; + + // Early success return cases + + // May have a OffscreenCanvas instead of an HTMLCanvasElement + if (GetCanvas()) + GetCanvas()->InvalidateCanvas(); + + // Zero-sized surfaces can cause problems. + if (width == 0) + width = 1; + + if (height == 0) + height = 1; + + // If we already have a gl context, then we just need to resize it + if (gl) { + if ((uint32_t)mWidth == width && + (uint32_t)mHeight == height) + { + return NS_OK; + } + + if (IsContextLost()) + return NS_OK; + + MakeContextCurrent(); + + // If we've already drawn, we should commit the current buffer. + PresentScreenBuffer(); + + if (IsContextLost()) { + GenerateWarning("WebGL context was lost due to swap failure."); + return NS_OK; + } + + // ResizeOffscreen scraps the current prod buffer before making a new one. + if (!ResizeBackbuffer(width, height)) { + GenerateWarning("WebGL context failed to resize."); + ForceLoseContext(); + return NS_OK; + } + + // everything's good, we're done here + mResetLayer = true; + mBackbufferNeedsClear = true; + + return NS_OK; + } + + nsCString failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_UNKOWN"); + auto autoTelemetry = mozilla::MakeScopeExit([&] { + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID, + failureId); + }); + + // End of early return cases. + // At this point we know that we're not just resizing an existing context, + // we are initializing a new context. + + // if we exceeded either the global or the per-principal limit for WebGL contexts, + // lose the oldest-used context now to free resources. Note that we can't do that + // in the WebGLContext constructor as we don't have a canvas element yet there. + // Here is the right place to do so, as we are about to create the OpenGL context + // and that is what can fail if we already have too many. + LoseOldestWebGLContextIfLimitExceeded(); + + // We're going to create an entirely new context. If our + // generation is not 0 right now (that is, if this isn't the first + // context we're creating), we may have to dispatch a context lost + // event. + + // If incrementing the generation would cause overflow, + // don't allow it. Allowing this would allow us to use + // resource handles created from older context generations. + if (!(mGeneration + 1).isValid()) { + // exit without changing the value of mGeneration + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_TOO_MANY"); + const nsLiteralCString text("Too many WebGL contexts created this run."); + ThrowEvent_WebGLContextCreationError(text); + return NS_ERROR_FAILURE; + } + + // increment the generation number - Do this early because later + // in CreateOffscreenGL(), "default" objects are created that will + // pick up the old generation. + ++mGeneration; + + bool disabled = gfxPrefs::WebGLDisabled(); + + // TODO: When we have software webgl support we should use that instead. + disabled |= gfxPlatform::InSafeMode(); + + if (disabled) { + if (gfxPlatform::InSafeMode()) { + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_SAFEMODE"); + } else { + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_DISABLED"); + } + const nsLiteralCString text("WebGL is currently disabled."); + ThrowEvent_WebGLContextCreationError(text); + return NS_ERROR_FAILURE; + } + + if (gfxPrefs::WebGLDisableFailIfMajorPerformanceCaveat()) { + mOptions.failIfMajorPerformanceCaveat = false; + } + + if (mOptions.failIfMajorPerformanceCaveat) { + nsCOMPtr gfxInfo = services::GetGfxInfo(); + if (!HasAcceleratedLayers(gfxInfo)) { + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_PERF_CAVEAT"); + const nsLiteralCString text("failIfMajorPerformanceCaveat: Compositor is not" + " hardware-accelerated."); + ThrowEvent_WebGLContextCreationError(text); + return NS_ERROR_FAILURE; + } + } + + // Alright, now let's start trying. + bool forceEnabled = gfxPrefs::WebGLForceEnabled(); + ScopedGfxFeatureReporter reporter("WebGL", forceEnabled); + + MOZ_ASSERT(!gl); + std::vector failReasons; + if (!CreateAndInitGL(forceEnabled, &failReasons)) { + nsCString text("WebGL creation failed: "); + for (const auto& cur : failReasons) { + Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID, cur.key); + + text.AppendASCII("\n* "); + text.Append(cur.info); + } + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_REASON"); + ThrowEvent_WebGLContextCreationError(text); + return NS_ERROR_FAILURE; + } + MOZ_ASSERT(gl); + MOZ_ASSERT_IF(mOptions.alpha, gl->Caps().alpha); + + if (mOptions.failIfMajorPerformanceCaveat) { + if (gl->IsWARP()) { + DestroyResourcesAndContext(); + MOZ_ASSERT(!gl); + + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_PERF_WARP"); + const nsLiteralCString text("failIfMajorPerformanceCaveat: Driver is not" + " hardware-accelerated."); + ThrowEvent_WebGLContextCreationError(text); + return NS_ERROR_FAILURE; + } + +#ifdef XP_WIN + if (gl->GetContextType() == gl::GLContextType::WGL && + !gl::sWGLLib.HasDXInterop2()) + { + DestroyResourcesAndContext(); + MOZ_ASSERT(!gl); + + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_DXGL_INTEROP2"); + const nsLiteralCString text("Caveat: WGL without DXGLInterop2."); + ThrowEvent_WebGLContextCreationError(text); + return NS_ERROR_FAILURE; + } +#endif + } + + if (!ResizeBackbuffer(width, height)) { + failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_BACKBUFFER"); + const nsLiteralCString text("Initializing WebGL backbuffer failed."); + ThrowEvent_WebGLContextCreationError(text); + return NS_ERROR_FAILURE; + } + + if (GLContext::ShouldSpew()) { + printf_stderr("--- WebGL context created: %p\n", gl.get()); + } + + mResetLayer = true; + mOptionsFrozen = true; + + // Update our internal stuff: + if (gl->WorkAroundDriverBugs()) { + if (!mOptions.alpha && gl->Caps().alpha) + mNeedsFakeNoAlpha = true; + + if (!mOptions.depth && gl->Caps().depth) + mNeedsFakeNoDepth = true; + + if (!mOptions.stencil && gl->Caps().stencil) + mNeedsFakeNoStencil = true; + +#ifdef MOZ_WIDGET_COCOA + if (!nsCocoaFeatures::IsAtLeastVersion(10, 12) && + gl->Vendor() == GLVendor::Intel) + { + mNeedsEmulatedLoneDepthStencil = true; + } +#endif + } + + // Update mOptions. + if (!gl->Caps().depth) + mOptions.depth = false; + + if (!gl->Caps().stencil) + mOptions.stencil = false; + + mOptions.antialias = gl->Caps().antialias; + + ////// + // Initial setup. + + MakeContextCurrent(); + + gl->fViewport(0, 0, mWidth, mHeight); + mViewportX = mViewportY = 0; + mViewportWidth = mWidth; + mViewportHeight = mHeight; + + gl->fScissor(0, 0, mWidth, mHeight); + gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0); + + ////// + // Check everything + + AssertCachedBindings(); + AssertCachedGlobalState(); + + MOZ_ASSERT(gl->Caps().color); + + MOZ_ASSERT_IF(!mNeedsFakeNoAlpha, gl->Caps().alpha == mOptions.alpha); + MOZ_ASSERT_IF(mNeedsFakeNoAlpha, !mOptions.alpha && gl->Caps().alpha); + + MOZ_ASSERT_IF(!mNeedsFakeNoDepth, gl->Caps().depth == mOptions.depth); + MOZ_ASSERT_IF(mNeedsFakeNoDepth, !mOptions.depth && gl->Caps().depth); + + MOZ_ASSERT_IF(!mNeedsFakeNoStencil, gl->Caps().stencil == mOptions.stencil); + MOZ_ASSERT_IF(mNeedsFakeNoStencil, !mOptions.stencil && gl->Caps().stencil); + + MOZ_ASSERT(gl->Caps().antialias == mOptions.antialias); + MOZ_ASSERT(gl->Caps().preserve == mOptions.preserveDrawingBuffer); + + ////// + // Clear immediately, because we need to present the cleared initial buffer + mBackbufferNeedsClear = true; + ClearBackbufferIfNeeded(); + + mShouldPresent = true; + + ////// + + reporter.SetSuccessful(); + + failureId = NS_LITERAL_CSTRING("SUCCESS"); + return NS_OK; +} + +void +WebGLContext::ClearBackbufferIfNeeded() +{ + if (!mBackbufferNeedsClear) + return; + + ClearScreen(); + + mBackbufferNeedsClear = false; +} + +void +WebGLContext::LoseOldestWebGLContextIfLimitExceeded() +{ +#ifdef MOZ_GFX_OPTIMIZE_MOBILE + // some mobile devices can't have more than 8 GL contexts overall + const size_t kMaxWebGLContextsPerPrincipal = 2; + const size_t kMaxWebGLContexts = 4; +#else + const size_t kMaxWebGLContextsPerPrincipal = 16; + const size_t kMaxWebGLContexts = 32; +#endif + MOZ_ASSERT(kMaxWebGLContextsPerPrincipal < kMaxWebGLContexts); + + if (!NS_IsMainThread()) { + // XXX mtseng: bug 709490, WebGLMemoryTracker is not thread safe. + return; + } + + // it's important to update the index on a new context before losing old contexts, + // otherwise new unused contexts would all have index 0 and we couldn't distinguish older ones + // when choosing which one to lose first. + UpdateLastUseIndex(); + + WebGLMemoryTracker::ContextsArrayType& contexts = WebGLMemoryTracker::Contexts(); + + // quick exit path, should cover a majority of cases + if (contexts.Length() <= kMaxWebGLContextsPerPrincipal) + return; + + // note that here by "context" we mean "non-lost context". See the check for + // IsContextLost() below. Indeed, the point of this function is to maybe lose + // some currently non-lost context. + + uint64_t oldestIndex = UINT64_MAX; + uint64_t oldestIndexThisPrincipal = UINT64_MAX; + const WebGLContext* oldestContext = nullptr; + const WebGLContext* oldestContextThisPrincipal = nullptr; + size_t numContexts = 0; + size_t numContextsThisPrincipal = 0; + + for(size_t i = 0; i < contexts.Length(); ++i) { + // don't want to lose ourselves. + if (contexts[i] == this) + continue; + + if (contexts[i]->IsContextLost()) + continue; + + if (!contexts[i]->GetCanvas()) { + // Zombie context: the canvas is already destroyed, but something else + // (typically the compositor) is still holding on to the context. + // Killing zombies is a no-brainer. + const_cast(contexts[i])->LoseContext(); + continue; + } + + numContexts++; + if (contexts[i]->mLastUseIndex < oldestIndex) { + oldestIndex = contexts[i]->mLastUseIndex; + oldestContext = contexts[i]; + } + + nsIPrincipal* ourPrincipal = GetCanvas()->NodePrincipal(); + nsIPrincipal* theirPrincipal = contexts[i]->GetCanvas()->NodePrincipal(); + bool samePrincipal; + nsresult rv = ourPrincipal->Equals(theirPrincipal, &samePrincipal); + if (NS_SUCCEEDED(rv) && samePrincipal) { + numContextsThisPrincipal++; + if (contexts[i]->mLastUseIndex < oldestIndexThisPrincipal) { + oldestIndexThisPrincipal = contexts[i]->mLastUseIndex; + oldestContextThisPrincipal = contexts[i]; + } + } + } + + if (numContextsThisPrincipal > kMaxWebGLContextsPerPrincipal) { + GenerateWarning("Exceeded %d live WebGL contexts for this principal, losing the " + "least recently used one.", kMaxWebGLContextsPerPrincipal); + MOZ_ASSERT(oldestContextThisPrincipal); // if we reach this point, this can't be null + const_cast(oldestContextThisPrincipal)->LoseContext(); + } else if (numContexts > kMaxWebGLContexts) { + GenerateWarning("Exceeded %d live WebGL contexts, losing the least recently used one.", + kMaxWebGLContexts); + MOZ_ASSERT(oldestContext); // if we reach this point, this can't be null + const_cast(oldestContext)->LoseContext(); + } +} + +UniquePtr +WebGLContext::GetImageBuffer(int32_t* out_format) +{ + *out_format = 0; + + // Use GetSurfaceSnapshot() to make sure that appropriate y-flip gets applied + bool premult; + RefPtr snapshot = + GetSurfaceSnapshot(mOptions.premultipliedAlpha ? nullptr : &premult); + if (!snapshot) { + return nullptr; + } + + MOZ_ASSERT(mOptions.premultipliedAlpha || !premult, "We must get unpremult when we ask for it!"); + + RefPtr dataSurface = snapshot->GetDataSurface(); + + return gfxUtils::GetImageBuffer(dataSurface, mOptions.premultipliedAlpha, + out_format); +} + +NS_IMETHODIMP +WebGLContext::GetInputStream(const char* mimeType, + const char16_t* encoderOptions, + nsIInputStream** out_stream) +{ + NS_ASSERTION(gl, "GetInputStream on invalid context?"); + if (!gl) + return NS_ERROR_FAILURE; + + // Use GetSurfaceSnapshot() to make sure that appropriate y-flip gets applied + bool premult; + RefPtr snapshot = + GetSurfaceSnapshot(mOptions.premultipliedAlpha ? nullptr : &premult); + if (!snapshot) + return NS_ERROR_FAILURE; + + MOZ_ASSERT(mOptions.premultipliedAlpha || !premult, "We must get unpremult when we ask for it!"); + + RefPtr dataSurface = snapshot->GetDataSurface(); + return gfxUtils::GetInputStream(dataSurface, mOptions.premultipliedAlpha, mimeType, + encoderOptions, out_stream); +} + +void +WebGLContext::UpdateLastUseIndex() +{ + static CheckedInt sIndex = 0; + + sIndex++; + + // should never happen with 64-bit; trying to handle this would be riskier than + // not handling it as the handler code would never get exercised. + if (!sIndex.isValid()) + NS_RUNTIMEABORT("Can't believe it's been 2^64 transactions already!"); + + mLastUseIndex = sIndex.value(); +} + +static uint8_t gWebGLLayerUserData; +static uint8_t gWebGLMirrorLayerUserData; + +class WebGLContextUserData : public LayerUserData +{ +public: + explicit WebGLContextUserData(HTMLCanvasElement* canvas) + : mCanvas(canvas) + {} + + /* PreTransactionCallback gets called by the Layers code every time the + * WebGL canvas is going to be composited. + */ + static void PreTransactionCallback(void* data) { + WebGLContextUserData* userdata = static_cast(data); + HTMLCanvasElement* canvas = userdata->mCanvas; + WebGLContext* webgl = static_cast(canvas->GetContextAtIndex(0)); + + // Prepare the context for composition + webgl->BeginComposition(); + } + + /** DidTransactionCallback gets called by the Layers code everytime the WebGL canvas gets composite, + * so it really is the right place to put actions that have to be performed upon compositing + */ + static void DidTransactionCallback(void* data) { + WebGLContextUserData* userdata = static_cast(data); + HTMLCanvasElement* canvas = userdata->mCanvas; + WebGLContext* webgl = static_cast(canvas->GetContextAtIndex(0)); + + // Clean up the context after composition + webgl->EndComposition(); + } + +private: + RefPtr mCanvas; +}; + +already_AddRefed +WebGLContext::GetCanvasLayer(nsDisplayListBuilder* builder, + Layer* oldLayer, + LayerManager* manager, + bool aMirror /*= false*/) +{ + if (IsContextLost()) + return nullptr; + + if (!mResetLayer && oldLayer && + oldLayer->HasUserData(aMirror ? &gWebGLMirrorLayerUserData : &gWebGLLayerUserData)) { + RefPtr ret = oldLayer; + return ret.forget(); + } + + RefPtr canvasLayer = manager->CreateCanvasLayer(); + if (!canvasLayer) { + NS_WARNING("CreateCanvasLayer returned null!"); + return nullptr; + } + + WebGLContextUserData* userData = nullptr; + if (builder->IsPaintingToWindow() && mCanvasElement && !aMirror) { + // Make the layer tell us whenever a transaction finishes (including + // the current transaction), so we can clear our invalidation state and + // start invalidating again. We need to do this for the layer that is + // being painted to a window (there shouldn't be more than one at a time, + // and if there is, flushing the invalidation state more often than + // necessary is harmless). + + // The layer will be destroyed when we tear down the presentation + // (at the latest), at which time this userData will be destroyed, + // releasing the reference to the element. + // The userData will receive DidTransactionCallbacks, which flush the + // the invalidation state to indicate that the canvas is up to date. + userData = new WebGLContextUserData(mCanvasElement); + canvasLayer->SetDidTransactionCallback( + WebGLContextUserData::DidTransactionCallback, userData); + canvasLayer->SetPreTransactionCallback( + WebGLContextUserData::PreTransactionCallback, userData); + } + + canvasLayer->SetUserData(aMirror ? &gWebGLMirrorLayerUserData : &gWebGLLayerUserData, userData); + + CanvasLayer::Data data; + data.mGLContext = gl; + data.mSize = nsIntSize(mWidth, mHeight); + data.mHasAlpha = gl->Caps().alpha; + data.mIsGLAlphaPremult = IsPremultAlpha() || !data.mHasAlpha; + data.mIsMirror = aMirror; + + canvasLayer->Initialize(data); + uint32_t flags = gl->Caps().alpha ? 0 : Layer::CONTENT_OPAQUE; + canvasLayer->SetContentFlags(flags); + canvasLayer->Updated(); + + mResetLayer = false; + // We only wish to update mLayerIsMirror when a new layer is returned. + // If a cached layer is returned above, aMirror is not changing since + // the last cached layer was created and mLayerIsMirror is still valid. + mLayerIsMirror = aMirror; + + return canvasLayer.forget(); +} + +layers::LayersBackend +WebGLContext::GetCompositorBackendType() const +{ + if (mCanvasElement) { + return mCanvasElement->GetCompositorBackendType(); + } else if (mOffscreenCanvas) { + return mOffscreenCanvas->GetCompositorBackendType(); + } + + return LayersBackend::LAYERS_NONE; +} + +void +WebGLContext::Commit() +{ + if (mOffscreenCanvas) { + mOffscreenCanvas->CommitFrameToCompositor(); + } +} + +void +WebGLContext::GetCanvas(Nullable& retval) +{ + if (mCanvasElement) { + MOZ_RELEASE_ASSERT(!mOffscreenCanvas, "GFX: Canvas is offscreen."); + + if (mCanvasElement->IsInNativeAnonymousSubtree()) { + retval.SetNull(); + } else { + retval.SetValue().SetAsHTMLCanvasElement() = mCanvasElement; + } + } else if (mOffscreenCanvas) { + retval.SetValue().SetAsOffscreenCanvas() = mOffscreenCanvas; + } else { + retval.SetNull(); + } +} + +void +WebGLContext::GetContextAttributes(dom::Nullable& retval) +{ + retval.SetNull(); + if (IsContextLost()) + return; + + dom::WebGLContextAttributes& result = retval.SetValue(); + + result.mAlpha.Construct(mOptions.alpha); + result.mDepth = mOptions.depth; + result.mStencil = mOptions.stencil; + result.mAntialias = mOptions.antialias; + result.mPremultipliedAlpha = mOptions.premultipliedAlpha; + result.mPreserveDrawingBuffer = mOptions.preserveDrawingBuffer; + result.mFailIfMajorPerformanceCaveat = mOptions.failIfMajorPerformanceCaveat; +} + +NS_IMETHODIMP +WebGLContext::MozGetUnderlyingParamString(uint32_t pname, nsAString& retval) +{ + if (IsContextLost()) + return NS_OK; + + retval.SetIsVoid(true); + + MakeContextCurrent(); + + switch (pname) { + case LOCAL_GL_VENDOR: + case LOCAL_GL_RENDERER: + case LOCAL_GL_VERSION: + case LOCAL_GL_SHADING_LANGUAGE_VERSION: + case LOCAL_GL_EXTENSIONS: + { + const char* s = (const char*)gl->fGetString(pname); + retval.Assign(NS_ConvertASCIItoUTF16(nsDependentCString(s))); + break; + } + + default: + return NS_ERROR_INVALID_ARG; + } + + return NS_OK; +} + +void +WebGLContext::ClearScreen() +{ + MakeContextCurrent(); + ScopedBindFramebuffer autoFB(gl, 0); + + const bool changeDrawBuffers = (mDefaultFB_DrawBuffer0 != LOCAL_GL_BACK); + if (changeDrawBuffers) { + gl->Screen()->SetDrawBuffer(LOCAL_GL_BACK); + } + + GLbitfield bufferBits = LOCAL_GL_COLOR_BUFFER_BIT; + if (mOptions.depth) + bufferBits |= LOCAL_GL_DEPTH_BUFFER_BIT; + if (mOptions.stencil) + bufferBits |= LOCAL_GL_STENCIL_BUFFER_BIT; + + ForceClearFramebufferWithDefaultValues(bufferBits, mNeedsFakeNoAlpha); + + if (changeDrawBuffers) { + gl->Screen()->SetDrawBuffer(mDefaultFB_DrawBuffer0); + } +} + +void +WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield clearBits, + bool fakeNoAlpha) +{ + MakeContextCurrent(); + + const bool initializeColorBuffer = bool(clearBits & LOCAL_GL_COLOR_BUFFER_BIT); + const bool initializeDepthBuffer = bool(clearBits & LOCAL_GL_DEPTH_BUFFER_BIT); + const bool initializeStencilBuffer = bool(clearBits & LOCAL_GL_STENCIL_BUFFER_BIT); + + // Fun GL fact: No need to worry about the viewport here, glViewport is just + // setting up a coordinates transformation, it doesn't affect glClear at all. + AssertCachedGlobalState(); + + // Prepare GL state for clearing. + gl->fDisable(LOCAL_GL_SCISSOR_TEST); + + if (initializeColorBuffer) { + gl->fColorMask(1, 1, 1, 1); + + if (fakeNoAlpha) { + gl->fClearColor(0.0f, 0.0f, 0.0f, 1.0f); + } else { + gl->fClearColor(0.0f, 0.0f, 0.0f, 0.0f); + } + } + + if (initializeDepthBuffer) { + gl->fDepthMask(1); + gl->fClearDepth(1.0f); + } + + if (initializeStencilBuffer) { + // "The clear operation always uses the front stencil write mask + // when clearing the stencil buffer." + gl->fStencilMaskSeparate(LOCAL_GL_FRONT, 0xffffffff); + gl->fStencilMaskSeparate(LOCAL_GL_BACK, 0xffffffff); + gl->fClearStencil(0); + } + + if (mRasterizerDiscardEnabled) { + gl->fDisable(LOCAL_GL_RASTERIZER_DISCARD); + } + + // Do the clear! + gl->fClear(clearBits); + + // And reset! + if (mScissorTestEnabled) + gl->fEnable(LOCAL_GL_SCISSOR_TEST); + + if (mRasterizerDiscardEnabled) { + gl->fEnable(LOCAL_GL_RASTERIZER_DISCARD); + } + + // Restore GL state after clearing. + if (initializeColorBuffer) { + gl->fColorMask(mColorWriteMask[0], + mColorWriteMask[1], + mColorWriteMask[2], + mColorWriteMask[3]); + gl->fClearColor(mColorClearValue[0], + mColorClearValue[1], + mColorClearValue[2], + mColorClearValue[3]); + } + + if (initializeDepthBuffer) { + gl->fDepthMask(mDepthWriteMask); + gl->fClearDepth(mDepthClearValue); + } + + if (initializeStencilBuffer) { + gl->fStencilMaskSeparate(LOCAL_GL_FRONT, mStencilWriteMaskFront); + gl->fStencilMaskSeparate(LOCAL_GL_BACK, mStencilWriteMaskBack); + gl->fClearStencil(mStencilClearValue); + } +} + +// For an overview of how WebGL compositing works, see: +// https://wiki.mozilla.org/Platform/GFX/WebGL/Compositing +bool +WebGLContext::PresentScreenBuffer() +{ + if (IsContextLost()) { + return false; + } + + if (!mShouldPresent) { + return false; + } + MOZ_ASSERT(!mBackbufferNeedsClear); + + gl->MakeCurrent(); + + GLScreenBuffer* screen = gl->Screen(); + MOZ_ASSERT(screen); + + if (!screen->PublishFrame(screen->Size())) { + ForceLoseContext(); + return false; + } + + if (!mOptions.preserveDrawingBuffer) { + mBackbufferNeedsClear = true; + } + + mShouldPresent = false; + + return true; +} + +// Prepare the context for capture before compositing +void +WebGLContext::BeginComposition() +{ + // Present our screenbuffer, if needed. + PresentScreenBuffer(); + mDrawCallsSinceLastFlush = 0; +} + +// Clean up the context after captured for compositing +void +WebGLContext::EndComposition() +{ + // Mark ourselves as no longer invalidated. + MarkContextClean(); + UpdateLastUseIndex(); +} + +void +WebGLContext::DummyReadFramebufferOperation(const char* funcName) +{ + if (!mBoundReadFramebuffer) + return; // Infallible. + + const auto status = mBoundReadFramebuffer->CheckFramebufferStatus(funcName); + + if (status != LOCAL_GL_FRAMEBUFFER_COMPLETE) { + ErrorInvalidFramebufferOperation("%s: Framebuffer must be complete.", + funcName); + } +} + +bool +WebGLContext::Has64BitTimestamps() const +{ + // 'sync' provides glGetInteger64v either by supporting ARB_sync, GL3+, or GLES3+. + return gl->IsSupported(GLFeature::sync); +} + +static bool +CheckContextLost(GLContext* gl, bool* const out_isGuilty) +{ + MOZ_ASSERT(gl); + MOZ_ASSERT(out_isGuilty); + + bool isEGL = gl->GetContextType() == gl::GLContextType::EGL; + + GLenum resetStatus = LOCAL_GL_NO_ERROR; + if (gl->IsSupported(GLFeature::robustness)) { + gl->MakeCurrent(); + resetStatus = gl->fGetGraphicsResetStatus(); + } else if (isEGL) { + // Simulate a ARB_robustness guilty context loss for when we + // get an EGL_CONTEXT_LOST error. It may not actually be guilty, + // but we can't make any distinction. + if (!gl->MakeCurrent(true) && gl->IsContextLost()) { + resetStatus = LOCAL_GL_UNKNOWN_CONTEXT_RESET_ARB; + } + } + + if (resetStatus == LOCAL_GL_NO_ERROR) { + *out_isGuilty = false; + return false; + } + + // Assume guilty unless we find otherwise! + bool isGuilty = true; + switch (resetStatus) { + case LOCAL_GL_INNOCENT_CONTEXT_RESET_ARB: + // Either nothing wrong, or not our fault. + isGuilty = false; + break; + case LOCAL_GL_GUILTY_CONTEXT_RESET_ARB: + NS_WARNING("WebGL content on the page definitely caused the graphics" + " card to reset."); + break; + case LOCAL_GL_UNKNOWN_CONTEXT_RESET_ARB: + NS_WARNING("WebGL content on the page might have caused the graphics" + " card to reset"); + // If we can't tell, assume guilty. + break; + default: + MOZ_ASSERT(false, "Unreachable."); + // If we do get here, let's pretend to be guilty as an escape plan. + break; + } + + if (isGuilty) { + NS_WARNING("WebGL context on this page is considered guilty, and will" + " not be restored."); + } + + *out_isGuilty = isGuilty; + return true; +} + +bool +WebGLContext::TryToRestoreContext() +{ + if (NS_FAILED(SetDimensions(mWidth, mHeight))) + return false; + + return true; +} + +void +WebGLContext::RunContextLossTimer() +{ + mContextLossHandler.RunTimer(); +} + +class UpdateContextLossStatusTask : public CancelableRunnable +{ + RefPtr mWebGL; + +public: + explicit UpdateContextLossStatusTask(WebGLContext* webgl) + : mWebGL(webgl) + { + } + + NS_IMETHOD Run() override { + if (mWebGL) + mWebGL->UpdateContextLossStatus(); + + return NS_OK; + } + + nsresult Cancel() override { + mWebGL = nullptr; + return NS_OK; + } +}; + +void +WebGLContext::EnqueueUpdateContextLossStatus() +{ + nsCOMPtr task = new UpdateContextLossStatusTask(this); + NS_DispatchToCurrentThread(task); +} + +// We use this timer for many things. Here are the things that it is activated for: +// 1) If a script is using the MOZ_WEBGL_lose_context extension. +// 2) If we are using EGL and _NOT ANGLE_, we query periodically to see if the +// CONTEXT_LOST_WEBGL error has been triggered. +// 3) If we are using ANGLE, or anything that supports ARB_robustness, query the +// GPU periodically to see if the reset status bit has been set. +// In all of these situations, we use this timer to send the script context lost +// and restored events asynchronously. For example, if it triggers a context loss, +// the webglcontextlost event will be sent to it the next time the robustness timer +// fires. +// Note that this timer mechanism is not used unless one of these 3 criteria +// are met. +// At a bare minimum, from context lost to context restores, it would take 3 +// full timer iterations: detection, webglcontextlost, webglcontextrestored. +void +WebGLContext::UpdateContextLossStatus() +{ + if (!mCanvasElement && !mOffscreenCanvas) { + // the canvas is gone. That happens when the page was closed before we got + // this timer event. In this case, there's nothing to do here, just don't crash. + return; + } + if (mContextStatus == ContextNotLost) { + // We don't know that we're lost, but we might be, so we need to + // check. If we're guilty, don't allow restores, though. + + bool isGuilty = true; + MOZ_ASSERT(gl); // Shouldn't be missing gl if we're NotLost. + bool isContextLost = CheckContextLost(gl, &isGuilty); + + if (isContextLost) { + if (isGuilty) + mAllowContextRestore = false; + + ForceLoseContext(); + } + + // Fall through. + } + + if (mContextStatus == ContextLostAwaitingEvent) { + // The context has been lost and we haven't yet triggered the + // callback, so do that now. + const auto kEventName = NS_LITERAL_STRING("webglcontextlost"); + const bool kCanBubble = true; + const bool kIsCancelable = true; + bool useDefaultHandler; + + if (mCanvasElement) { + nsContentUtils::DispatchTrustedEvent( + mCanvasElement->OwnerDoc(), + static_cast(mCanvasElement), + kEventName, + kCanBubble, + kIsCancelable, + &useDefaultHandler); + } else { + // OffscreenCanvas case + RefPtr event = new Event(mOffscreenCanvas, nullptr, nullptr); + event->InitEvent(kEventName, kCanBubble, kIsCancelable); + event->SetTrusted(true); + mOffscreenCanvas->DispatchEvent(event, &useDefaultHandler); + } + + // We sent the callback, so we're just 'regular lost' now. + mContextStatus = ContextLost; + // If we're told to use the default handler, it means the script + // didn't bother to handle the event. In this case, we shouldn't + // auto-restore the context. + if (useDefaultHandler) + mAllowContextRestore = false; + + // Fall through. + } + + if (mContextStatus == ContextLost) { + // Context is lost, and we've already sent the callback. We + // should try to restore the context if we're both allowed to, + // and supposed to. + + // Are we allowed to restore the context? + if (!mAllowContextRestore) + return; + + // If we're only simulated-lost, we shouldn't auto-restore, and + // instead we should wait for restoreContext() to be called. + if (mLastLossWasSimulated) + return; + + // Restore when the app is visible + if (mRestoreWhenVisible) + return; + + ForceRestoreContext(); + return; + } + + if (mContextStatus == ContextLostAwaitingRestore) { + // Context is lost, but we should try to restore it. + + if (!mAllowContextRestore) { + // We might decide this after thinking we'd be OK restoring + // the context, so downgrade. + mContextStatus = ContextLost; + return; + } + + if (!TryToRestoreContext()) { + // Failed to restore. Try again later. + mContextLossHandler.RunTimer(); + return; + } + + // Revival! + mContextStatus = ContextNotLost; + + if (mCanvasElement) { + nsContentUtils::DispatchTrustedEvent( + mCanvasElement->OwnerDoc(), + static_cast(mCanvasElement), + NS_LITERAL_STRING("webglcontextrestored"), + true, + true); + } else { + RefPtr event = new Event(mOffscreenCanvas, nullptr, nullptr); + event->InitEvent(NS_LITERAL_STRING("webglcontextrestored"), true, true); + event->SetTrusted(true); + bool unused; + mOffscreenCanvas->DispatchEvent(event, &unused); + } + + mEmitContextLostErrorOnce = true; + return; + } +} + +void +WebGLContext::ForceLoseContext(bool simulateLosing) +{ + printf_stderr("WebGL(%p)::ForceLoseContext\n", this); + MOZ_ASSERT(!IsContextLost()); + mContextStatus = ContextLostAwaitingEvent; + mContextLostErrorSet = false; + + // Burn it all! + DestroyResourcesAndContext(); + mLastLossWasSimulated = simulateLosing; + + // Queue up a task, since we know the status changed. + EnqueueUpdateContextLossStatus(); +} + +void +WebGLContext::ForceRestoreContext() +{ + printf_stderr("WebGL(%p)::ForceRestoreContext\n", this); + mContextStatus = ContextLostAwaitingRestore; + mAllowContextRestore = true; // Hey, you did say 'force'. + + // Queue up a task, since we know the status changed. + EnqueueUpdateContextLossStatus(); +} + +void +WebGLContext::MakeContextCurrent() const +{ + gl->MakeCurrent(); +} + +already_AddRefed +WebGLContext::GetSurfaceSnapshot(bool* out_premultAlpha) +{ + if (!gl) + return nullptr; + + bool hasAlpha = mOptions.alpha; + SurfaceFormat surfFormat = hasAlpha ? SurfaceFormat::B8G8R8A8 + : SurfaceFormat::B8G8R8X8; + RefPtr surf; + surf = Factory::CreateDataSourceSurfaceWithStride(IntSize(mWidth, mHeight), + surfFormat, + mWidth * 4); + if (NS_WARN_IF(!surf)) { + return nullptr; + } + + gl->MakeCurrent(); + { + ScopedBindFramebuffer autoFB(gl, 0); + ClearBackbufferIfNeeded(); + + // Save, override, then restore glReadBuffer. + const GLenum readBufferMode = gl->Screen()->GetReadBufferMode(); + + if (readBufferMode != LOCAL_GL_BACK) { + gl->fReadBuffer(LOCAL_GL_BACK); + } + ReadPixelsIntoDataSurface(gl, surf); + + if (readBufferMode != LOCAL_GL_BACK) { + gl->fReadBuffer(readBufferMode); + } + } + + if (out_premultAlpha) { + *out_premultAlpha = true; + } + bool srcPremultAlpha = mOptions.premultipliedAlpha; + if (!srcPremultAlpha) { + if (out_premultAlpha) { + *out_premultAlpha = false; + } else if(hasAlpha) { + gfxUtils::PremultiplyDataSurface(surf, surf); + } + } + + RefPtr dt = + Factory::CreateDrawTarget(BackendType::CAIRO, + IntSize(mWidth, mHeight), + SurfaceFormat::B8G8R8A8); + + if (!dt) { + return nullptr; + } + + dt->SetTransform(Matrix::Translation(0.0, mHeight).PreScale(1.0, -1.0)); + + dt->DrawSurface(surf, + Rect(0, 0, mWidth, mHeight), + Rect(0, 0, mWidth, mHeight), + DrawSurfaceOptions(), + DrawOptions(1.0f, CompositionOp::OP_SOURCE)); + + return dt->Snapshot(); +} + +void +WebGLContext::DidRefresh() +{ + if (gl) { + gl->FlushIfHeavyGLCallsSinceLastFlush(); + } +} + +bool +WebGLContext::ValidateCurFBForRead(const char* funcName, + const webgl::FormatUsageInfo** const out_format, + uint32_t* const out_width, uint32_t* const out_height) +{ + if (!mBoundReadFramebuffer) { + const GLenum readBufferMode = gl->Screen()->GetReadBufferMode(); + if (readBufferMode == LOCAL_GL_NONE) { + ErrorInvalidOperation("%s: Can't read from backbuffer when readBuffer mode is" + " NONE.", + funcName); + return false; + } + + ClearBackbufferIfNeeded(); + + // FIXME - here we're assuming that the default framebuffer is backed by + // UNSIGNED_BYTE that might not always be true, say if we had a 16bpp default + // framebuffer. + auto effFormat = mOptions.alpha ? webgl::EffectiveFormat::RGBA8 + : webgl::EffectiveFormat::RGB8; + + *out_format = mFormatUsage->GetUsage(effFormat); + MOZ_ASSERT(*out_format); + + *out_width = mWidth; + *out_height = mHeight; + return true; + } + + return mBoundReadFramebuffer->ValidateForRead(funcName, out_format, out_width, + out_height); +} + +//////////////////////////////////////////////////////////////////////////////// + +WebGLContext::ScopedDrawCallWrapper::ScopedDrawCallWrapper(WebGLContext& webgl) + : mWebGL(webgl) + , mFakeNoAlpha(ShouldFakeNoAlpha(webgl)) + , mFakeNoDepth(ShouldFakeNoDepth(webgl)) + , mFakeNoStencil(ShouldFakeNoStencil(webgl)) +{ + if (!mWebGL.mBoundDrawFramebuffer) { + mWebGL.ClearBackbufferIfNeeded(); + } + + if (mFakeNoAlpha) { + mWebGL.gl->fColorMask(mWebGL.mColorWriteMask[0], + mWebGL.mColorWriteMask[1], + mWebGL.mColorWriteMask[2], + false); + } + if (mFakeNoDepth) { + mWebGL.gl->fDisable(LOCAL_GL_DEPTH_TEST); + } + if (mFakeNoStencil) { + mWebGL.gl->fDisable(LOCAL_GL_STENCIL_TEST); + } +} + +WebGLContext::ScopedDrawCallWrapper::~ScopedDrawCallWrapper() +{ + if (mFakeNoAlpha) { + mWebGL.gl->fColorMask(mWebGL.mColorWriteMask[0], + mWebGL.mColorWriteMask[1], + mWebGL.mColorWriteMask[2], + mWebGL.mColorWriteMask[3]); + } + if (mFakeNoDepth) { + mWebGL.gl->fEnable(LOCAL_GL_DEPTH_TEST); + } + if (mFakeNoStencil) { + MOZ_ASSERT(mWebGL.mStencilTestEnabled); + mWebGL.gl->fEnable(LOCAL_GL_STENCIL_TEST); + } + + if (!mWebGL.mBoundDrawFramebuffer) { + mWebGL.Invalidate(); + mWebGL.mShouldPresent = true; + } +} + +/*static*/ bool +WebGLContext::ScopedDrawCallWrapper::HasDepthButNoStencil(const WebGLFramebuffer* fb) +{ + const auto& depth = fb->DepthAttachment(); + const auto& stencil = fb->StencilAttachment(); + return depth.IsDefined() && !stencil.IsDefined(); +} + +//// + +void +WebGLContext::OnBeforeReadCall() +{ + if (!mBoundReadFramebuffer) { + ClearBackbufferIfNeeded(); + } +} + +//////////////////////////////////////// + +IndexedBufferBinding::IndexedBufferBinding() + : mRangeStart(0) + , mRangeSize(0) +{ } + +uint64_t +IndexedBufferBinding::ByteCount() const +{ + if (!mBufferBinding) + return 0; + + uint64_t bufferSize = mBufferBinding->ByteLength(); + if (!mRangeSize) // BindBufferBase + return bufferSize; + + if (mRangeStart >= bufferSize) + return 0; + bufferSize -= mRangeStart; + + return std::min(bufferSize, mRangeSize); +} + +//////////////////////////////////////// + +ScopedUnpackReset::ScopedUnpackReset(WebGLContext* webgl) + : ScopedGLWrapper(webgl->gl) + , mWebGL(webgl) +{ + if (mWebGL->mPixelStore_UnpackAlignment != 4) mGL->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, 4); + + if (mWebGL->IsWebGL2()) { + if (mWebGL->mPixelStore_UnpackRowLength != 0) mGL->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH , 0); + if (mWebGL->mPixelStore_UnpackImageHeight != 0) mGL->fPixelStorei(LOCAL_GL_UNPACK_IMAGE_HEIGHT, 0); + if (mWebGL->mPixelStore_UnpackSkipPixels != 0) mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_PIXELS , 0); + if (mWebGL->mPixelStore_UnpackSkipRows != 0) mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_ROWS , 0); + if (mWebGL->mPixelStore_UnpackSkipImages != 0) mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_IMAGES , 0); + + if (mWebGL->mBoundPixelUnpackBuffer) mGL->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, 0); + } +} + +void +ScopedUnpackReset::UnwrapImpl() +{ + mGL->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, mWebGL->mPixelStore_UnpackAlignment); + + if (mWebGL->IsWebGL2()) { + mGL->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH , mWebGL->mPixelStore_UnpackRowLength ); + mGL->fPixelStorei(LOCAL_GL_UNPACK_IMAGE_HEIGHT, mWebGL->mPixelStore_UnpackImageHeight); + mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_PIXELS , mWebGL->mPixelStore_UnpackSkipPixels ); + mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_ROWS , mWebGL->mPixelStore_UnpackSkipRows ); + mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_IMAGES , mWebGL->mPixelStore_UnpackSkipImages ); + + GLuint pbo = 0; + if (mWebGL->mBoundPixelUnpackBuffer) { + pbo = mWebGL->mBoundPixelUnpackBuffer->mGLName; + } + + mGL->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, pbo); + } +} + +//////////////////// + +void +ScopedFBRebinder::UnwrapImpl() +{ + const auto fnName = [&](WebGLFramebuffer* fb) { + return fb ? fb->mGLName : 0; + }; + + if (mWebGL->IsWebGL2()) { + mGL->fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER, fnName(mWebGL->mBoundDrawFramebuffer)); + mGL->fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER, fnName(mWebGL->mBoundReadFramebuffer)); + } else { + MOZ_ASSERT(mWebGL->mBoundDrawFramebuffer == mWebGL->mBoundReadFramebuffer); + mGL->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, fnName(mWebGL->mBoundDrawFramebuffer)); + } +} + +//////////////////// + +static GLenum +TargetIfLazy(GLenum target) +{ + switch (target) { + case LOCAL_GL_PIXEL_PACK_BUFFER: + case LOCAL_GL_PIXEL_UNPACK_BUFFER: + return target; + + default: + return 0; + } +} + +ScopedLazyBind::ScopedLazyBind(gl::GLContext* gl, GLenum target, const WebGLBuffer* buf) + : ScopedGLWrapper(gl) + , mTarget(buf ? TargetIfLazy(target) : 0) + , mBuf(buf) +{ + if (mTarget) { + mGL->fBindBuffer(mTarget, mBuf->mGLName); + } +} + +void +ScopedLazyBind::UnwrapImpl() +{ + if (mTarget) { + mGL->fBindBuffer(mTarget, 0); + } +} + +//////////////////////////////////////// + +bool +Intersect(const int32_t srcSize, const int32_t read0, const int32_t readSize, + int32_t* const out_intRead0, int32_t* const out_intWrite0, + int32_t* const out_intSize) +{ + MOZ_ASSERT(srcSize >= 0); + MOZ_ASSERT(readSize >= 0); + const auto read1 = int64_t(read0) + readSize; + + int32_t intRead0 = read0; // Clearly doesn't need validation. + int64_t intWrite0 = 0; + int64_t intSize = readSize; + + if (read1 <= 0 || read0 >= srcSize) { + // Disjoint ranges. + intSize = 0; + } else { + if (read0 < 0) { + const auto diff = int64_t(0) - read0; + MOZ_ASSERT(diff >= 0); + intRead0 = 0; + intWrite0 = diff; + intSize -= diff; + } + if (read1 > srcSize) { + const auto diff = int64_t(read1) - srcSize; + MOZ_ASSERT(diff >= 0); + intSize -= diff; + } + + if (!CheckedInt(intWrite0).isValid() || + !CheckedInt(intSize).isValid()) + { + return false; + } + } + + *out_intRead0 = intRead0; + *out_intWrite0 = intWrite0; + *out_intSize = intSize; + return true; +} + +//////////////////////////////////////////////////////////////////////////////// + +CheckedUint32 +WebGLContext::GetUnpackSize(bool isFunc3D, uint32_t width, uint32_t height, + uint32_t depth, uint8_t bytesPerPixel) +{ + if (!width || !height || !depth) + return 0; + + //////////////// + + const auto& maybeRowLength = mPixelStore_UnpackRowLength; + const auto& maybeImageHeight = mPixelStore_UnpackImageHeight; + + const auto usedPixelsPerRow = CheckedUint32(mPixelStore_UnpackSkipPixels) + width; + const auto stridePixelsPerRow = (maybeRowLength ? CheckedUint32(maybeRowLength) + : usedPixelsPerRow); + + const auto usedRowsPerImage = CheckedUint32(mPixelStore_UnpackSkipRows) + height; + const auto strideRowsPerImage = (maybeImageHeight ? CheckedUint32(maybeImageHeight) + : usedRowsPerImage); + + const uint32_t skipImages = (isFunc3D ? mPixelStore_UnpackSkipImages + : 0); + const CheckedUint32 usedImages = CheckedUint32(skipImages) + depth; + + //////////////// + + CheckedUint32 strideBytesPerRow = bytesPerPixel * stridePixelsPerRow; + strideBytesPerRow = RoundUpToMultipleOf(strideBytesPerRow, + mPixelStore_UnpackAlignment); + + const CheckedUint32 strideBytesPerImage = strideBytesPerRow * strideRowsPerImage; + + //////////////// + + CheckedUint32 usedBytesPerRow = bytesPerPixel * usedPixelsPerRow; + // Don't round this to the alignment, since alignment here is really just used for + // establishing stride, particularly in WebGL 1, where you can't set ROW_LENGTH. + + CheckedUint32 totalBytes = strideBytesPerImage * (usedImages - 1); + totalBytes += strideBytesPerRow * (usedRowsPerImage - 1); + totalBytes += usedBytesPerRow; + + return totalBytes; +} + +already_AddRefed +WebGLContext::GetVRFrame() +{ + if (!mLayerIsMirror) { + /** + * Do not allow VR frame submission until a mirroring canvas layer has + * been returned by GetCanvasLayer + */ + return nullptr; + } + + VRManagerChild* vrmc = VRManagerChild::Get(); + if (!vrmc) { + return nullptr; + } + + /** + * Swap buffers as though composition has occurred. + * We will then share the resulting front buffer to be submitted to the VR + * compositor. + */ + BeginComposition(); + EndComposition(); + + gl::GLScreenBuffer* screen = gl->Screen(); + if (!screen) { + return nullptr; + } + + RefPtr sharedSurface = screen->Front(); + if (!sharedSurface) { + return nullptr; + } + + if (sharedSurface && sharedSurface->GetAllocator() != vrmc) { + RefPtr dest = + screen->Factory()->NewTexClient(sharedSurface->GetSize()); + if (!dest) { + return nullptr; + } + gl::SharedSurface* destSurf = dest->Surf(); + destSurf->ProducerAcquire(); + SharedSurface::ProdCopy(sharedSurface->Surf(), dest->Surf(), + screen->Factory()); + destSurf->ProducerRelease(); + + return dest.forget(); + } + + return sharedSurface.forget(); +} + +bool +WebGLContext::StartVRPresentation() +{ + VRManagerChild* vrmc = VRManagerChild::Get(); + if (!vrmc) { + return false; + } + gl::GLScreenBuffer* screen = gl->Screen(); + if (!screen) { + return false; + } + gl::SurfaceCaps caps = screen->mCaps; + + UniquePtr factory = + gl::GLScreenBuffer::CreateFactory(gl, + caps, + vrmc, + vrmc->GetBackendType(), + TextureFlags::ORIGIN_BOTTOM_LEFT); + + if (factory) { + screen->Morph(Move(factory)); + } + return true; +} + +//////////////////////////////////////////////////////////////////////////////// + +static inline size_t +SizeOfViewElem(const dom::ArrayBufferView& view) +{ + const auto& elemType = view.Type(); + if (elemType == js::Scalar::MaxTypedArrayViewType) // DataViews. + return 1; + + return js::Scalar::byteSize(elemType); +} + +bool +WebGLContext::ValidateArrayBufferView(const char* funcName, + const dom::ArrayBufferView& view, GLuint elemOffset, + GLuint elemCountOverride, uint8_t** const out_bytes, + size_t* const out_byteLen) +{ + view.ComputeLengthAndData(); + uint8_t* const bytes = view.DataAllowShared(); + const size_t byteLen = view.LengthAllowShared(); + + const auto& elemSize = SizeOfViewElem(view); + + size_t elemCount = byteLen / elemSize; + if (elemOffset > elemCount) { + ErrorInvalidValue("%s: Invalid offset into ArrayBufferView.", funcName); + return false; + } + elemCount -= elemOffset; + + if (elemCountOverride) { + if (elemCountOverride > elemCount) { + ErrorInvalidValue("%s: Invalid sub-length for ArrayBufferView.", funcName); + return false; + } + elemCount = elemCountOverride; + } + + *out_bytes = bytes + (elemOffset * elemSize); + *out_byteLen = elemCount * elemSize; + return true; +} + +//////////////////////////////////////////////////////////////////////////////// +// XPCOM goop + +void +ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& callback, + const std::vector& field, + const char* name, uint32_t flags) +{ + for (const auto& cur : field) { + ImplCycleCollectionTraverse(callback, cur.mBufferBinding, name, flags); + } +} + +void +ImplCycleCollectionUnlink(std::vector& field) +{ + field.clear(); +} + +//// + +NS_IMPL_CYCLE_COLLECTING_ADDREF(WebGLContext) +NS_IMPL_CYCLE_COLLECTING_RELEASE(WebGLContext) + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebGLContext, + mCanvasElement, + mOffscreenCanvas, + mExtensions, + mBound2DTextures, + mBoundCubeMapTextures, + mBound3DTextures, + mBound2DArrayTextures, + mBoundSamplers, + mBoundArrayBuffer, + mBoundCopyReadBuffer, + mBoundCopyWriteBuffer, + mBoundPixelPackBuffer, + mBoundPixelUnpackBuffer, + mBoundTransformFeedback, + mBoundUniformBuffer, + mCurrentProgram, + mBoundDrawFramebuffer, + mBoundReadFramebuffer, + mBoundRenderbuffer, + mBoundVertexArray, + mDefaultVertexArray, + mQuerySlot_SamplesPassed, + mQuerySlot_TFPrimsWritten, + mQuerySlot_TimeElapsed) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebGLContext) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsIDOMWebGLRenderingContext) + NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal) + NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) + // If the exact way we cast to nsISupports here ever changes, fix our + // ToSupports() method. + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMWebGLRenderingContext) +NS_INTERFACE_MAP_END + +} // namespace mozilla diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h new file mode 100644 index 000000000..b4d416a33 --- /dev/null +++ b/dom/canvas/WebGLContext.h @@ -0,0 +1,2201 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGLCONTEXT_H_ +#define WEBGLCONTEXT_H_ + +#include + +#include "GLContextTypes.h" +#include "GLDefs.h" +#include "mozilla/Attributes.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "mozilla/dom/TypedArray.h" +#include "mozilla/EnumeratedArray.h" +#include "mozilla/ErrorResult.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/LinkedList.h" +#include "mozilla/UniquePtr.h" +#include "nsCycleCollectionNoteChild.h" +#include "nsICanvasRenderingContextInternal.h" +#include "nsLayoutUtils.h" +#include "nsTArray.h" +#include "nsWrapperCache.h" +#include "SurfaceTypes.h" +#include "ScopedGLHelpers.h" +#include "TexUnpackBlob.h" + +#ifdef XP_MACOSX +#include "ForceDiscreteGPUHelperCGL.h" +#endif + +// Local +#include "WebGLContextLossHandler.h" +#include "WebGLContextUnchecked.h" +#include "WebGLFormats.h" +#include "WebGLObjectModel.h" +#include "WebGLStrongTypes.h" +#include "WebGLTexture.h" + +// Generated +#include "nsIDOMEventListener.h" +#include "nsIDOMWebGLRenderingContext.h" +#include "nsICanvasRenderingContextInternal.h" +#include "nsIObserver.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "nsWrapperCache.h" +#include "nsLayoutUtils.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" + +class nsIDocShell; + +/* + * Minimum value constants defined in 6.2 State Tables of OpenGL ES - 2.0.25 + * https://bugzilla.mozilla.org/show_bug.cgi?id=686732 + * + * Exceptions: some of the following values are set to higher values than in the spec because + * the values in the spec are ridiculously low. They are explicitly marked below + */ +#define MINVALUE_GL_MAX_TEXTURE_SIZE 1024 // Different from the spec, which sets it to 64 on page 162 +#define MINVALUE_GL_MAX_CUBE_MAP_TEXTURE_SIZE 512 // Different from the spec, which sets it to 16 on page 162 +#define MINVALUE_GL_MAX_VERTEX_ATTRIBS 8 // Page 164 +#define MINVALUE_GL_MAX_FRAGMENT_UNIFORM_VECTORS 16 // Page 164 +#define MINVALUE_GL_MAX_VERTEX_UNIFORM_VECTORS 128 // Page 164 +#define MINVALUE_GL_MAX_VARYING_VECTORS 8 // Page 164 +#define MINVALUE_GL_MAX_TEXTURE_IMAGE_UNITS 8 // Page 164 +#define MINVALUE_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0 // Page 164 +#define MINVALUE_GL_MAX_RENDERBUFFER_SIZE 1024 // Different from the spec, which sets it to 1 on page 164 +#define MINVALUE_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 8 // Page 164 + +/* + * Minimum value constants define in 6.2 State Tables of OpenGL ES - 3.0.4 + */ +#define MINVALUE_GL_MAX_3D_TEXTURE_SIZE 256 +#define MINVALUE_GL_MAX_ARRAY_TEXTURE_LAYERS 256 + +/* + * WebGL-only GLenums + */ +#define LOCAL_GL_BROWSER_DEFAULT_WEBGL 0x9244 +#define LOCAL_GL_CONTEXT_LOST_WEBGL 0x9242 +#define LOCAL_GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL 0x9247 +#define LOCAL_GL_UNPACK_COLORSPACE_CONVERSION_WEBGL 0x9243 +#define LOCAL_GL_UNPACK_FLIP_Y_WEBGL 0x9240 +#define LOCAL_GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL 0x9241 + +namespace mozilla { +class ScopedCopyTexImageSource; +class ScopedResolveTexturesForDraw; +class ScopedUnpackReset; +class WebGLActiveInfo; +class WebGLBuffer; +class WebGLExtensionBase; +class WebGLFramebuffer; +class WebGLProgram; +class WebGLQuery; +class WebGLRenderbuffer; +class WebGLSampler; +class WebGLShader; +class WebGLShaderPrecisionFormat; +class WebGLSync; +class WebGLTexture; +class WebGLTransformFeedback; +class WebGLUniformLocation; +class WebGLVertexArray; + +namespace dom { +class Element; +class ImageData; +class OwningHTMLCanvasElementOrOffscreenCanvas; +struct WebGLContextAttributes; +template struct Nullable; +} // namespace dom + +namespace gfx { +class SourceSurface; +class VRLayerChild; +} // namespace gfx + +namespace webgl { +struct LinkedProgramInfo; +class ShaderValidator; +class TexUnpackBlob; +struct UniformInfo; +struct UniformBlockInfo; +} // namespace webgl + +WebGLTexelFormat GetWebGLTexelFormat(TexInternalFormat format); + +void AssertUintParamCorrect(gl::GLContext* gl, GLenum pname, GLuint shadow); + +struct WebGLContextOptions +{ + // these are defaults + WebGLContextOptions(); + + bool operator==(const WebGLContextOptions& other) const { + return + alpha == other.alpha && + depth == other.depth && + stencil == other.stencil && + premultipliedAlpha == other.premultipliedAlpha && + antialias == other.antialias && + preserveDrawingBuffer == other.preserveDrawingBuffer; + } + + bool operator!=(const WebGLContextOptions& other) const { + return !operator==(other); + } + + bool alpha; + bool depth; + bool stencil; + bool premultipliedAlpha; + bool antialias; + bool preserveDrawingBuffer; + bool failIfMajorPerformanceCaveat; +}; + +// From WebGLContextUtils +TexTarget TexImageTargetToTexTarget(TexImageTarget texImageTarget); + +struct WebGLIntOrFloat { + const enum { + Int, + Float, + Uint + } mType; + + union { + GLint i; + GLfloat f; + GLuint u; + } mValue; + + explicit WebGLIntOrFloat(GLint i) : mType(Int) { mValue.i = i; } + explicit WebGLIntOrFloat(GLfloat f) : mType(Float) { mValue.f = f; } + + GLint AsInt() const { return (mType == Int) ? mValue.i : NS_lroundf(mValue.f); } + GLfloat AsFloat() const { return (mType == Float) ? mValue.f : GLfloat(mValue.i); } +}; + +struct IndexedBufferBinding +{ + WebGLRefPtr mBufferBinding; + uint64_t mRangeStart; + uint64_t mRangeSize; + + IndexedBufferBinding(); + + uint64_t ByteCount() const; +}; + +//// + +struct FloatOrInt final // For TexParameter[fi] and friends. +{ + const bool isFloat; + const GLfloat f; + const GLint i; + + explicit FloatOrInt(GLint x) + : isFloat(false) + , f(x) + , i(x) + { } + + explicit FloatOrInt(GLfloat x) + : isFloat(true) + , f(x) + , i(roundf(x)) + { } + + FloatOrInt& operator =(const FloatOrInt& x) { + memcpy(this, &x, sizeof(x)); + return *this; + } +}; + +//////////////////////////////////// + +struct TexImageSource +{ + const dom::ArrayBufferView* mView; + GLuint mViewElemOffset; + GLuint mViewElemLengthOverride; + + const WebGLsizeiptr* mPboOffset; + + const dom::ImageBitmap* mImageBitmap; + const dom::ImageData* mImageData; + + const dom::Element* mDomElem; + ErrorResult* mOut_error; + +protected: + TexImageSource() { + memset(this, 0, sizeof(*this)); + } +}; + +//// + +struct TexImageSourceAdapter final : public TexImageSource +{ + TexImageSourceAdapter(const dom::Nullable* maybeView, + ErrorResult*) + { + if (!maybeView->IsNull()) { + mView = &(maybeView->Value()); + } + } + + TexImageSourceAdapter(const dom::ArrayBufferView* view, ErrorResult*) { + mView = view; + } + + TexImageSourceAdapter(const dom::ArrayBufferView* view, GLuint viewElemOffset, + GLuint viewElemLengthOverride = 0) + { + mView = view; + mViewElemOffset = viewElemOffset; + mViewElemLengthOverride = viewElemLengthOverride; + } + + TexImageSourceAdapter(const WebGLsizeiptr* pboOffset, GLuint ignored1, GLuint ignored2 = 0) { + mPboOffset = pboOffset; + } + + TexImageSourceAdapter(const WebGLsizeiptr* pboOffset, ErrorResult* ignored) { + mPboOffset = pboOffset; + } + + TexImageSourceAdapter(const dom::ImageBitmap* imageBitmap, ErrorResult*) { + mImageBitmap = imageBitmap; + } + + TexImageSourceAdapter(const dom::ImageData* imageData, ErrorResult*) { + mImageData = imageData; + } + + TexImageSourceAdapter(const dom::Element* domElem, ErrorResult* const out_error) { + mDomElem = domElem; + mOut_error = out_error; + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class WebGLContext + : public nsIDOMWebGLRenderingContext + , public nsICanvasRenderingContextInternal + , public nsSupportsWeakReference + , public WebGLContextUnchecked + , public WebGLRectangleObject + , public nsWrapperCache +{ + friend class ScopedDrawHelper; + friend class ScopedDrawWithTransformFeedback; + friend class ScopedFBRebinder; + friend class WebGL2Context; + friend class WebGLContextUserData; + friend class WebGLExtensionCompressedTextureATC; + friend class WebGLExtensionCompressedTextureES3; + friend class WebGLExtensionCompressedTextureETC1; + friend class WebGLExtensionCompressedTexturePVRTC; + friend class WebGLExtensionCompressedTextureS3TC; + friend class WebGLExtensionDepthTexture; + friend class WebGLExtensionDisjointTimerQuery; + friend class WebGLExtensionDrawBuffers; + friend class WebGLExtensionLoseContext; + friend class WebGLExtensionVertexArray; + friend class WebGLMemoryTracker; + friend struct webgl::UniformBlockInfo; + + enum { + UNPACK_FLIP_Y_WEBGL = 0x9240, + UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241, + CONTEXT_LOST_WEBGL = 0x9242, + UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243, + BROWSER_DEFAULT_WEBGL = 0x9244, + UNMASKED_VENDOR_WEBGL = 0x9245, + UNMASKED_RENDERER_WEBGL = 0x9246 + }; + + static const uint32_t kMinMaxColorAttachments; + static const uint32_t kMinMaxDrawBuffers; + +public: + WebGLContext(); + +protected: + virtual ~WebGLContext(); + +public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(WebGLContext, + nsIDOMWebGLRenderingContext) + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override = 0; + + NS_DECL_NSIDOMWEBGLRENDERINGCONTEXT + + virtual void OnVisibilityChange() override; + virtual void OnMemoryPressure() override; + + // nsICanvasRenderingContextInternal + virtual int32_t GetWidth() const override; + virtual int32_t GetHeight() const override; + + NS_IMETHOD SetDimensions(int32_t width, int32_t height) override; + NS_IMETHOD InitializeWithDrawTarget(nsIDocShell*, + NotNull) override + { + return NS_ERROR_NOT_IMPLEMENTED; + } + + NS_IMETHOD Reset() override { + /* (InitializeWithSurface) */ + return NS_ERROR_NOT_IMPLEMENTED; + } + + virtual UniquePtr GetImageBuffer(int32_t* out_format) override; + NS_IMETHOD GetInputStream(const char* mimeType, + const char16_t* encoderOptions, + nsIInputStream** out_stream) override; + + already_AddRefed + GetSurfaceSnapshot(bool* out_premultAlpha) override; + + NS_IMETHOD SetIsOpaque(bool) override { return NS_OK; }; + bool GetIsOpaque() override { return false; } + NS_IMETHOD SetContextOptions(JSContext* cx, + JS::Handle options, + ErrorResult& aRvForDictionaryInit) override; + + NS_IMETHOD SetIsIPC(bool) override { + return NS_ERROR_NOT_IMPLEMENTED; + } + + /** + * An abstract base class to be implemented by callers wanting to be notified + * that a refresh has occurred. Callers must ensure an observer is removed + * before it is destroyed. + */ + virtual void DidRefresh() override; + + NS_IMETHOD Redraw(const gfxRect&) override { + return NS_ERROR_NOT_IMPLEMENTED; + } + + void SynthesizeGLError(GLenum err); + void SynthesizeGLError(GLenum err, const char* fmt, ...); + + void ErrorInvalidEnum(const char* fmt = 0, ...); + void ErrorInvalidOperation(const char* fmt = 0, ...); + void ErrorInvalidValue(const char* fmt = 0, ...); + void ErrorInvalidFramebufferOperation(const char* fmt = 0, ...); + void ErrorInvalidEnumInfo(const char* info, GLenum enumValue); + void ErrorInvalidEnumInfo(const char* info, const char* funcName, + GLenum enumValue); + void ErrorOutOfMemory(const char* fmt = 0, ...); + void ErrorImplementationBug(const char* fmt = 0, ...); + + void ErrorInvalidEnumArg(const char* funcName, const char* argName, GLenum val); + + const char* ErrorName(GLenum error); + + /** + * Return displayable name for GLenum. + * This version is like gl::GLenumToStr but with out the GL_ prefix to + * keep consistency with how errors are reported from WebGL. + * Returns hex formatted version of glenum if glenum is unknown. + */ + static void EnumName(GLenum val, nsCString* out_name); + + void DummyReadFramebufferOperation(const char* funcName); + + WebGLTexture* ActiveBoundTextureForTarget(const TexTarget texTarget) const { + switch (texTarget.get()) { + case LOCAL_GL_TEXTURE_2D: + return mBound2DTextures[mActiveTexture]; + case LOCAL_GL_TEXTURE_CUBE_MAP: + return mBoundCubeMapTextures[mActiveTexture]; + case LOCAL_GL_TEXTURE_3D: + return mBound3DTextures[mActiveTexture]; + case LOCAL_GL_TEXTURE_2D_ARRAY: + return mBound2DArrayTextures[mActiveTexture]; + default: + MOZ_CRASH("GFX: bad target"); + } + } + + /* Use this function when you have the texture image target, for example: + * GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_[POSITIVE|NEGATIVE]_[X|Y|Z], and + * not the actual texture binding target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. + */ + WebGLTexture* + ActiveBoundTextureForTexImageTarget(const TexImageTarget texImgTarget) const + { + const TexTarget texTarget = TexImageTargetToTexTarget(texImgTarget); + return ActiveBoundTextureForTarget(texTarget); + } + + void InvalidateResolveCacheForTextureWithTexUnit(const GLuint); + + already_AddRefed + GetCanvasLayer(nsDisplayListBuilder* builder, Layer* oldLayer, + LayerManager* manager, + bool aMirror = false) override; + + // Note that 'clean' here refers to its invalidation state, not the + // contents of the buffer. + void MarkContextClean() override { mInvalidated = false; } + + void MarkContextCleanForFrameCapture() override { mCapturedFrameInvalidated = false; } + + bool IsContextCleanForFrameCapture() override { return !mCapturedFrameInvalidated; } + + gl::GLContext* GL() const { return gl; } + + bool IsPremultAlpha() const { return mOptions.premultipliedAlpha; } + + bool IsPreservingDrawingBuffer() const { return mOptions.preserveDrawingBuffer; } + + bool PresentScreenBuffer(); + + // Prepare the context for capture before compositing + void BeginComposition(); + // Clean up the context after captured for compositing + void EndComposition(); + + // a number that increments every time we have an event that causes + // all context resources to be lost. + uint32_t Generation() const { return mGeneration.value(); } + + // This is similar to GLContext::ClearSafely, but tries to minimize the + // amount of work it does. + // It only clears the buffers we specify, and can reset its state without + // first having to query anything, as WebGL knows its state at all times. + void ForceClearFramebufferWithDefaultValues(GLbitfield bufferBits, bool fakeNoAlpha); + + // Calls ForceClearFramebufferWithDefaultValues() for the Context's 'screen'. + void ClearScreen(); + void ClearBackbufferIfNeeded(); + + bool MinCapabilityMode() const { return mMinCapability; } + + void RunContextLossTimer(); + void UpdateContextLossStatus(); + void EnqueueUpdateContextLossStatus(); + + bool TryToRestoreContext(); + + void AssertCachedBindings(); + void AssertCachedGlobalState(); + + dom::HTMLCanvasElement* GetCanvas() const { return mCanvasElement; } + + // WebIDL WebGLRenderingContext API + void Commit(); + void GetCanvas(Nullable& retval); + GLsizei DrawingBufferWidth() const { return IsContextLost() ? 0 : mWidth; } + GLsizei DrawingBufferHeight() const { + return IsContextLost() ? 0 : mHeight; + } + + layers::LayersBackend GetCompositorBackendType() const; + + void + GetContextAttributes(dom::Nullable& retval); + + bool IsContextLost() const { return mContextStatus != ContextNotLost; } + void GetSupportedExtensions(dom::Nullable< nsTArray >& retval, + dom::CallerType callerType); + void GetExtension(JSContext* cx, const nsAString& name, + JS::MutableHandle retval, + dom::CallerType callerType, ErrorResult& rv); + void AttachShader(WebGLProgram& prog, WebGLShader& shader); + void BindAttribLocation(WebGLProgram& prog, GLuint location, + const nsAString& name); + void BindFramebuffer(GLenum target, WebGLFramebuffer* fb); + void BindRenderbuffer(GLenum target, WebGLRenderbuffer* fb); + void BindVertexArray(WebGLVertexArray* vao); + void BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a); + void BlendEquation(GLenum mode); + void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); + void BlendFunc(GLenum sfactor, GLenum dfactor); + void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, + GLenum srcAlpha, GLenum dstAlpha); + GLenum CheckFramebufferStatus(GLenum target); + void Clear(GLbitfield mask); + void ClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a); + void ClearDepth(GLclampf v); + void ClearStencil(GLint v); + void ColorMask(WebGLboolean r, WebGLboolean g, WebGLboolean b, WebGLboolean a); + void CompileShader(WebGLShader& shader); + void CompileShaderANGLE(WebGLShader* shader); + void CompileShaderBypass(WebGLShader* shader, const nsCString& shaderSource); + already_AddRefed CreateFramebuffer(); + already_AddRefed CreateProgram(); + already_AddRefed CreateRenderbuffer(); + already_AddRefed CreateShader(GLenum type); + already_AddRefed CreateVertexArray(); + void CullFace(GLenum face); + void DeleteFramebuffer(WebGLFramebuffer* fb); + void DeleteProgram(WebGLProgram* prog); + void DeleteRenderbuffer(WebGLRenderbuffer* rb); + void DeleteShader(WebGLShader* shader); + void DeleteVertexArray(WebGLVertexArray* vao); + void DepthFunc(GLenum func); + void DepthMask(WebGLboolean b); + void DepthRange(GLclampf zNear, GLclampf zFar); + void DetachShader(WebGLProgram& prog, const WebGLShader& shader); + void DrawBuffers(const dom::Sequence& buffers); + void Flush(); + void Finish(); + void FramebufferRenderbuffer(GLenum target, GLenum attachment, + GLenum rbTarget, WebGLRenderbuffer* rb); + void FramebufferTexture2D(GLenum target, GLenum attachment, + GLenum texImageTarget, WebGLTexture* tex, + GLint level); + + void FrontFace(GLenum mode); + already_AddRefed GetActiveAttrib(const WebGLProgram& prog, + GLuint index); + already_AddRefed GetActiveUniform(const WebGLProgram& prog, + GLuint index); + + void + GetAttachedShaders(const WebGLProgram& prog, + dom::Nullable>>& retval); + + GLint GetAttribLocation(const WebGLProgram& prog, const nsAString& name); + JS::Value GetBufferParameter(GLenum target, GLenum pname); + + void GetBufferParameter(JSContext*, GLenum target, GLenum pname, + JS::MutableHandle retval) + { + retval.set(GetBufferParameter(target, pname)); + } + + GLenum GetError(); + virtual JS::Value GetFramebufferAttachmentParameter(JSContext* cx, GLenum target, + GLenum attachment, GLenum pname, + ErrorResult& rv); + + void GetFramebufferAttachmentParameter(JSContext* cx, GLenum target, + GLenum attachment, GLenum pname, + JS::MutableHandle retval, + ErrorResult& rv) + { + retval.set(GetFramebufferAttachmentParameter(cx, target, attachment, + pname, rv)); + } + + JS::Value GetProgramParameter(const WebGLProgram& prog, GLenum pname); + + void GetProgramParameter(JSContext*, const WebGLProgram& prog, GLenum pname, + JS::MutableHandle retval) + { + retval.set(GetProgramParameter(prog, pname)); + } + + void GetProgramInfoLog(const WebGLProgram& prog, nsACString& retval); + void GetProgramInfoLog(const WebGLProgram& prog, nsAString& retval); + JS::Value GetRenderbufferParameter(GLenum target, GLenum pname); + + void GetRenderbufferParameter(JSContext*, GLenum target, GLenum pname, + JS::MutableHandle retval) + { + retval.set(GetRenderbufferParameter(target, pname)); + } + + JS::Value GetShaderParameter(const WebGLShader& shader, GLenum pname); + + void GetShaderParameter(JSContext*, const WebGLShader& shader, GLenum pname, + JS::MutableHandle retval) + { + retval.set(GetShaderParameter(shader, pname)); + } + + already_AddRefed + GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype); + + void GetShaderInfoLog(const WebGLShader& shader, nsACString& retval); + void GetShaderInfoLog(const WebGLShader& shader, nsAString& retval); + void GetShaderSource(const WebGLShader& shader, nsAString& retval); + + JS::Value GetUniform(JSContext* cx, const WebGLProgram& prog, + const WebGLUniformLocation& loc); + + void GetUniform(JSContext* cx, const WebGLProgram& prog, + const WebGLUniformLocation& loc, + JS::MutableHandle retval) + { + retval.set(GetUniform(cx, prog, loc)); + } + + already_AddRefed + GetUniformLocation(const WebGLProgram& prog, const nsAString& name); + + void Hint(GLenum target, GLenum mode); + bool IsFramebuffer(const WebGLFramebuffer* fb); + bool IsProgram(const WebGLProgram* prog); + bool IsRenderbuffer(const WebGLRenderbuffer* rb); + bool IsShader(const WebGLShader* shader); + bool IsVertexArray(const WebGLVertexArray* vao); + void LineWidth(GLfloat width); + void LinkProgram(WebGLProgram& prog); + void PixelStorei(GLenum pname, GLint param); + void PolygonOffset(GLfloat factor, GLfloat units); + + already_AddRefed GetVRFrame(); + bool StartVRPresentation(); + + //// + + webgl::PackingInfo + ValidImplementationColorReadPI(const webgl::FormatUsageInfo* usage) const; + +protected: + bool ReadPixels_SharedPrecheck(ErrorResult* const out_error); + void ReadPixelsImpl(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, + GLenum type, void* data, uint32_t dataLen); + bool DoReadPixelsAndConvert(const webgl::FormatInfo* srcFormat, GLint x, GLint y, + GLsizei width, GLsizei height, GLenum format, + GLenum destType, void* dest, uint32_t dataLen, + uint32_t rowStride); +public: + void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, + GLenum type, const dom::Nullable& maybeView, + ErrorResult& rv) + { + const char funcName[] = "readPixels"; + if (maybeView.IsNull()) { + ErrorInvalidValue("%s: `pixels` must not be null.", funcName); + return; + } + ReadPixels(x, y, width, height, format, type, maybeView.Value(), 0, rv); + } + + void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, + GLenum type, WebGLsizeiptr offset, ErrorResult& out_error); + + void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, + GLenum type, const dom::ArrayBufferView& dstData, GLuint dstOffset, + ErrorResult& out_error); + + //// + + void RenderbufferStorage(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height); +protected: + void RenderbufferStorage_base(const char* funcName, GLenum target, + GLsizei samples, GLenum internalformat, + GLsizei width, GLsizei height); +public: + void SampleCoverage(GLclampf value, WebGLboolean invert); + void Scissor(GLint x, GLint y, GLsizei width, GLsizei height); + void ShaderSource(WebGLShader& shader, const nsAString& source); + void StencilFunc(GLenum func, GLint ref, GLuint mask); + void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); + void StencilMask(GLuint mask); + void StencilMaskSeparate(GLenum face, GLuint mask); + void StencilOp(GLenum sfail, GLenum dpfail, GLenum dppass); + void StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, + GLenum dppass); + + ////// + + void Uniform1f(WebGLUniformLocation* loc, GLfloat x); + void Uniform2f(WebGLUniformLocation* loc, GLfloat x, GLfloat y); + void Uniform3f(WebGLUniformLocation* loc, GLfloat x, GLfloat y, GLfloat z); + void Uniform4f(WebGLUniformLocation* loc, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + + void Uniform1i(WebGLUniformLocation* loc, GLint x); + void Uniform2i(WebGLUniformLocation* loc, GLint x, GLint y); + void Uniform3i(WebGLUniformLocation* loc, GLint x, GLint y, GLint z); + void Uniform4i(WebGLUniformLocation* loc, GLint x, GLint y, GLint z, GLint w); + + void Uniform1ui(WebGLUniformLocation* loc, GLuint v0); + void Uniform2ui(WebGLUniformLocation* loc, GLuint v0, GLuint v1); + void Uniform3ui(WebGLUniformLocation* loc, GLuint v0, GLuint v1, GLuint v2); + void Uniform4ui(WebGLUniformLocation* loc, GLuint v0, GLuint v1, GLuint v2, + GLuint v3); + + ////////////////////////// + + typedef dom::Float32ArrayOrUnrestrictedFloatSequence Float32ListU; + typedef dom::Int32ArrayOrLongSequence Int32ListU; + typedef dom::Uint32ArrayOrUnsignedLongSequence Uint32ListU; + +protected: + template + struct Arr { + const size_t elemCount; + const elemT* const elemBytes; + + private: + static size_t ComputeAndReturnLength(const viewT& view) { + view.ComputeLengthAndData(); + return view.LengthAllowShared(); + } + + public: + explicit Arr(const viewT& view) + : elemCount(ComputeAndReturnLength(view)) + , elemBytes(view.DataAllowShared()) + { } + + explicit Arr(const dom::Sequence& seq) + : elemCount(seq.Length()) + , elemBytes(seq.Elements()) + { } + + Arr(size_t _elemCount, const elemT* _elemBytes) + : elemCount(_elemCount) + , elemBytes(_elemBytes) + { } + + //// + + static Arr From(const Float32ListU& list) { + if (list.IsFloat32Array()) + return Arr(list.GetAsFloat32Array()); + + return Arr(list.GetAsUnrestrictedFloatSequence()); + } + + static Arr From(const Int32ListU& list) { + if (list.IsInt32Array()) + return Arr(list.GetAsInt32Array()); + + return Arr(list.GetAsLongSequence()); + } + + static Arr From(const Uint32ListU& list) { + if (list.IsUint32Array()) + return Arr(list.GetAsUint32Array()); + + return Arr(list.GetAsUnsignedLongSequence()); + } + }; + + typedef Arr Float32Arr; + typedef Arr Int32Arr; + typedef Arr Uint32Arr; + + //////////////// + + void UniformNfv(const char* funcName, uint8_t N, WebGLUniformLocation* loc, + const Float32Arr& arr, GLuint elemOffset, GLuint elemCountOverride); + void UniformNiv(const char* funcName, uint8_t N, WebGLUniformLocation* loc, + const Int32Arr& arr, GLuint elemOffset, GLuint elemCountOverride); + void UniformNuiv(const char* funcName, uint8_t N, WebGLUniformLocation* loc, + const Uint32Arr& arr, GLuint elemOffset, GLuint elemCountOverride); + + void UniformMatrixAxBfv(const char* funcName, uint8_t A, uint8_t B, + WebGLUniformLocation* loc, bool transpose, + const Float32Arr& arr, GLuint elemOffset, + GLuint elemCountOverride); + + //////////////// + +public: + #define FOO(N) \ + void Uniform ## N ## fv(WebGLUniformLocation* loc, const Float32ListU& list, \ + GLuint elemOffset = 0, GLuint elemCountOverride = 0) \ + { \ + UniformNfv("uniform" #N "fv", N, loc, Float32Arr::From(list), elemOffset, \ + elemCountOverride); \ + } + + FOO(1) + FOO(2) + FOO(3) + FOO(4) + + #undef FOO + + ////// + + #define FOO(N) \ + void Uniform ## N ## iv(WebGLUniformLocation* loc, const Int32ListU& list, \ + GLuint elemOffset = 0, GLuint elemCountOverride = 0) \ + { \ + UniformNiv("uniform" #N "iv", N, loc, Int32Arr::From(list), elemOffset, \ + elemCountOverride); \ + } + + FOO(1) + FOO(2) + FOO(3) + FOO(4) + + #undef FOO + + ////// + + #define FOO(N) \ + void Uniform ## N ## uiv(WebGLUniformLocation* loc, const Uint32ListU& list, \ + GLuint elemOffset = 0, GLuint elemCountOverride = 0) \ + { \ + UniformNuiv("uniform" #N "uiv", N, loc, Uint32Arr::From(list), elemOffset, \ + elemCountOverride); \ + } + + FOO(1) + FOO(2) + FOO(3) + FOO(4) + + #undef FOO + + ////// + + #define FOO(X,A,B) \ + void UniformMatrix ## X ## fv(WebGLUniformLocation* loc, bool transpose, \ + const Float32ListU& list, GLuint elemOffset = 0, \ + GLuint elemCountOverride = 0) \ + { \ + UniformMatrixAxBfv("uniformMatrix" #X "fv", A, B, loc, transpose, \ + Float32Arr::From(list), elemOffset, elemCountOverride); \ + } + + FOO(2,2,2) + FOO(2x3,2,3) + FOO(2x4,2,4) + + FOO(3x2,3,2) + FOO(3,3,3) + FOO(3x4,3,4) + + FOO(4x2,4,2) + FOO(4x3,4,3) + FOO(4,4,4) + + #undef FOO + + //////////////////////////////////// + + void UseProgram(WebGLProgram* prog); + + bool ValidateAttribArraySetter(const char* name, uint32_t count, + uint32_t arrayLength); + bool ValidateUniformLocation(WebGLUniformLocation* loc, const char* funcName); + bool ValidateUniformSetter(WebGLUniformLocation* loc, uint8_t setterSize, + GLenum setterType, const char* funcName); + bool ValidateUniformArraySetter(WebGLUniformLocation* loc, + uint8_t setterElemSize, GLenum setterType, + uint32_t setterArraySize, const char* funcName, + uint32_t* out_numElementsToUpload); + bool ValidateUniformMatrixArraySetter(WebGLUniformLocation* loc, + uint8_t setterCols, + uint8_t setterRows, + GLenum setterType, + uint32_t setterArraySize, + bool setterTranspose, + const char* funcName, + uint32_t* out_numElementsToUpload); + void ValidateProgram(const WebGLProgram& prog); + bool ValidateUniformLocation(const char* info, WebGLUniformLocation* loc); + bool ValidateSamplerUniformSetter(const char* info, + WebGLUniformLocation* loc, GLint value); + void Viewport(GLint x, GLint y, GLsizei width, GLsizei height); +// ----------------------------------------------------------------------------- +// WEBGL_lose_context +public: + void LoseContext(); + void RestoreContext(); + +// ----------------------------------------------------------------------------- +// Buffer Objects (WebGLContextBuffers.cpp) + void BindBuffer(GLenum target, WebGLBuffer* buffer); + void BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buf); + void BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buf, + WebGLintptr offset, WebGLsizeiptr size); + +private: + void BufferDataImpl(GLenum target, size_t dataLen, const uint8_t* data, GLenum usage); + +public: + void BufferData(GLenum target, WebGLsizeiptr size, GLenum usage); + void BufferData(GLenum target, const dom::Nullable& maybeSrc, + GLenum usage); + void BufferData(GLenum target, const dom::ArrayBufferView& srcData, GLenum usage, + GLuint srcElemOffset = 0, GLuint srcElemCountOverride = 0); + +private: + void BufferSubDataImpl(GLenum target, WebGLsizeiptr dstByteOffset, + size_t srcDataLen, const uint8_t* srcData); + +public: + void BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset, + const dom::ArrayBufferView& src, GLuint srcElemOffset = 0, + GLuint srcElemCountOverride = 0); + void BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset, + const dom::ArrayBuffer& src); + void BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset, + const dom::SharedArrayBuffer& src); + + already_AddRefed CreateBuffer(); + void DeleteBuffer(WebGLBuffer* buf); + bool IsBuffer(WebGLBuffer* buf); + +protected: + // bound buffer state + WebGLRefPtr mBoundArrayBuffer; + WebGLRefPtr mBoundCopyReadBuffer; + WebGLRefPtr mBoundCopyWriteBuffer; + WebGLRefPtr mBoundPixelPackBuffer; + WebGLRefPtr mBoundPixelUnpackBuffer; + WebGLRefPtr mBoundUniformBuffer; + + std::vector mIndexedUniformBufferBindings; + + WebGLRefPtr& GetBufferSlotByTarget(GLenum target); + WebGLRefPtr& GetBufferSlotByTargetIndexed(GLenum target, + GLuint index); + +// ----------------------------------------------------------------------------- +// Queries (WebGL2ContextQueries.cpp) +protected: + WebGLRefPtr mQuerySlot_SamplesPassed; + WebGLRefPtr mQuerySlot_TFPrimsWritten; + WebGLRefPtr mQuerySlot_TimeElapsed; + + WebGLRefPtr* + ValidateQuerySlotByTarget(const char* funcName, GLenum target); + +public: + already_AddRefed CreateQuery(const char* funcName = nullptr); + void DeleteQuery(WebGLQuery* query, const char* funcName = nullptr); + bool IsQuery(const WebGLQuery* query, const char* funcName = nullptr); + void BeginQuery(GLenum target, WebGLQuery& query, const char* funcName = nullptr); + void EndQuery(GLenum target, const char* funcName = nullptr); + void GetQuery(JSContext* cx, GLenum target, GLenum pname, + JS::MutableHandleValue retval, const char* funcName = nullptr); + void GetQueryParameter(JSContext* cx, const WebGLQuery& query, GLenum pname, + JS::MutableHandleValue retval, const char* funcName = nullptr); + + +// ----------------------------------------------------------------------------- +// State and State Requests (WebGLContextState.cpp) +public: + void Disable(GLenum cap); + void Enable(GLenum cap); + bool GetStencilBits(GLint* const out_stencilBits); + bool GetChannelBits(const char* funcName, GLenum pname, GLint* const out_val); + virtual JS::Value GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv); + + void GetParameter(JSContext* cx, GLenum pname, + JS::MutableHandle retval, ErrorResult& rv) + { + retval.set(GetParameter(cx, pname, rv)); + } + + void GetParameterIndexed(JSContext* cx, GLenum pname, GLuint index, + JS::MutableHandle retval); + bool IsEnabled(GLenum cap); + +private: + // State tracking slots + realGLboolean mDitherEnabled; + realGLboolean mRasterizerDiscardEnabled; + realGLboolean mScissorTestEnabled; + realGLboolean mDepthTestEnabled; + realGLboolean mStencilTestEnabled; + GLenum mGenerateMipmapHint; + + bool ValidateCapabilityEnum(GLenum cap, const char* info); + realGLboolean* GetStateTrackingSlot(GLenum cap); + +// ----------------------------------------------------------------------------- +// Texture funcions (WebGLContextTextures.cpp) +public: + void ActiveTexture(GLenum texUnit); + void BindTexture(GLenum texTarget, WebGLTexture* tex); + already_AddRefed CreateTexture(); + void DeleteTexture(WebGLTexture* tex); + void GenerateMipmap(GLenum texTarget); + + void GetTexParameter(JSContext*, GLenum texTarget, GLenum pname, + JS::MutableHandle retval) + { + retval.set(GetTexParameter(texTarget, pname)); + } + + bool IsTexture(WebGLTexture* tex); + + void TexParameterf(GLenum texTarget, GLenum pname, GLfloat param) { + TexParameter_base(texTarget, pname, FloatOrInt(param)); + } + + void TexParameteri(GLenum texTarget, GLenum pname, GLint param) { + TexParameter_base(texTarget, pname, FloatOrInt(param)); + } + +protected: + JS::Value GetTexParameter(GLenum texTarget, GLenum pname); + void TexParameter_base(GLenum texTarget, GLenum pname, const FloatOrInt& param); + + virtual bool IsTexParamValid(GLenum pname) const; + + //////////////////////////////////// + +public: + template + void CompressedTexImage2D(GLenum target, GLint level, GLenum internalFormat, + GLsizei width, GLsizei height, GLint border, + const T& anySrc, GLuint viewElemOffset = 0, + GLuint viewElemLengthOverride = 0) + { + const char funcName[] = "compressedTexImage2D"; + const uint8_t funcDims = 2; + const GLsizei depth = 1; + const TexImageSourceAdapter src(&anySrc, viewElemOffset, viewElemLengthOverride); + CompressedTexImage(funcName, funcDims, target, level, internalFormat, width, + height, depth, border, src); + } + + template + void CompressedTexSubImage2D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLsizei width, GLsizei height, GLenum unpackFormat, + const T& anySrc, GLuint viewElemOffset = 0, + GLuint viewElemLengthOverride = 0) + { + const char funcName[] = "compressedTexSubImage2D"; + const uint8_t funcDims = 2; + const GLint zOffset = 0; + const GLsizei depth = 1; + const TexImageSourceAdapter src(&anySrc, viewElemOffset, viewElemLengthOverride); + CompressedTexSubImage(funcName, funcDims, target, level, xOffset, yOffset, + zOffset, width, height, depth, unpackFormat, src); + } + +protected: + void CompressedTexImage(const char* funcName, uint8_t funcDims, GLenum target, + GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLint border, + const TexImageSource& src); + + void CompressedTexSubImage(const char* funcName, uint8_t funcDims, GLenum target, + GLint level, GLint xOffset, GLint yOffset, GLint zOffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum unpackFormat, const TexImageSource& src); + + //////////////////////////////////// + +public: + void CopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint x, + GLint y, GLsizei width, GLsizei height, GLint border); + + void CopyTexSubImage2D(GLenum target, GLint level, GLint xOffset, + GLint yOffset, GLint x, GLint y, GLsizei width, + GLsizei height) + { + const char funcName[] = "copyTexSubImage2D"; + const uint8_t funcDims = 2; + const GLint zOffset = 0; + CopyTexSubImage(funcName, funcDims, target, level, xOffset, yOffset, zOffset, + x, y, width, height); + } + +protected: + void CopyTexSubImage(const char* funcName, uint8_t funcDims, GLenum target, + GLint level, GLint xOffset, GLint yOffset, GLint zOffset, + GLint x, GLint y, GLsizei width, GLsizei height); + + //////////////////////////////////// + // TexImage + + // Implicit width/height uploads + +public: + template + void TexImage2D(GLenum target, GLint level, GLenum internalFormat, + GLenum unpackFormat, GLenum unpackType, const T& src, + ErrorResult& out_error) + { + GLsizei width = 0; + GLsizei height = 0; + GLint border = 0; + TexImage2D(target, level, internalFormat, width, height, border, unpackFormat, + unpackType, src, out_error); + } + + template + void TexSubImage2D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLenum unpackFormat, GLenum unpackType, const T& src, + ErrorResult& out_error) + { + GLsizei width = 0; + GLsizei height = 0; + TexSubImage2D(target, level, xOffset, yOffset, width, height, unpackFormat, + unpackType, src, out_error); + } + + //// + + template + void TexImage2D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLint border, GLenum unpackFormat, GLenum unpackType, + const T& anySrc, ErrorResult& out_error) + { + const TexImageSourceAdapter src(&anySrc, &out_error); + TexImage2D(target, level, internalFormat, width, height, border, unpackFormat, + unpackType, src); + } + + void TexImage2D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLint border, GLenum unpackFormat, GLenum unpackType, + const dom::ArrayBufferView& view, GLuint viewElemOffset, + ErrorResult&) + { + const TexImageSourceAdapter src(&view, viewElemOffset); + TexImage2D(target, level, internalFormat, width, height, border, unpackFormat, + unpackType, src); + } + +protected: + void TexImage2D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLint border, GLenum unpackFormat, + GLenum unpackType, const TexImageSource& src) + { + const char funcName[] = "texImage2D"; + const uint8_t funcDims = 2; + const GLsizei depth = 1; + TexImage(funcName, funcDims, target, level, internalFormat, width, height, depth, + border, unpackFormat, unpackType, src); + } + + void TexImage(const char* funcName, uint8_t funcDims, GLenum target, GLint level, + GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, + GLint border, GLenum unpackFormat, GLenum unpackType, + const TexImageSource& src); + + //// + +public: + template + void TexSubImage2D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLsizei width, GLsizei height, GLenum unpackFormat, + GLenum unpackType, const T& anySrc, ErrorResult& out_error) + { + const TexImageSourceAdapter src(&anySrc, &out_error); + TexSubImage2D(target, level, xOffset, yOffset, width, height, unpackFormat, + unpackType, src); + } + + void TexSubImage2D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLsizei width, GLsizei height, GLenum unpackFormat, + GLenum unpackType, const dom::ArrayBufferView& view, + GLuint viewElemOffset, ErrorResult&) + { + const TexImageSourceAdapter src(&view, viewElemOffset); + TexSubImage2D(target, level, xOffset, yOffset, width, height, unpackFormat, + unpackType, src); + } + +protected: + void TexSubImage2D(GLenum target, GLint level, GLint xOffset, GLint yOffset, + GLsizei width, GLsizei height, GLenum unpackFormat, + GLenum unpackType, const TexImageSource& src) + { + const char funcName[] = "texSubImage2D"; + const uint8_t funcDims = 2; + const GLint zOffset = 0; + const GLsizei depth = 1; + TexSubImage(funcName, funcDims, target, level, xOffset, yOffset, zOffset, width, + height, depth, unpackFormat, unpackType, src); + } + + void TexSubImage(const char* funcName, uint8_t funcDims, GLenum target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, GLenum unpackFormat, + GLenum unpackType, const TexImageSource& src); + + //////////////////////////////////// + // WebGLTextureUpload.cpp +public: + UniquePtr + From(const char* funcName, TexImageTarget target, GLsizei rawWidth, GLsizei rawHeight, + GLsizei rawDepth, GLint border, const TexImageSource& src, + dom::Uint8ClampedArray* const scopedArr); + +protected: + bool ValidateTexImageSpecification(const char* funcName, uint8_t funcDims, + GLenum texImageTarget, GLint level, + GLsizei width, GLsizei height, GLsizei depth, + GLint border, + TexImageTarget* const out_target, + WebGLTexture** const out_texture, + WebGLTexture::ImageInfo** const out_imageInfo); + bool ValidateTexImageSelection(const char* funcName, uint8_t funcDims, + GLenum texImageTarget, GLint level, GLint xOffset, + GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, + TexImageTarget* const out_target, + WebGLTexture** const out_texture, + WebGLTexture::ImageInfo** const out_imageInfo); + bool ValidateUnpackInfo(const char* funcName, bool usePBOs, GLenum format, + GLenum type, webgl::PackingInfo* const out); + + UniquePtr + FromDomElem(const char* funcName, TexImageTarget target, uint32_t width, + uint32_t height, uint32_t depth, const dom::Element& elem, + ErrorResult* const out_error); + + UniquePtr + FromCompressed(const char* funcName, TexImageTarget target, GLsizei rawWidth, + GLsizei rawHeight, GLsizei rawDepth, GLint border, + const TexImageSource& src); + +// ----------------------------------------------------------------------------- +// Vertices Feature (WebGLContextVertices.cpp) + GLenum mPrimRestartTypeBytes; + +public: + void DrawArrays(GLenum mode, GLint first, GLsizei count); + void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, + GLsizei primcount); + void DrawElements(GLenum mode, GLsizei count, GLenum type, + WebGLintptr byteOffset, const char* funcName = nullptr); + void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, + WebGLintptr byteOffset, GLsizei primcount); + + void EnableVertexAttribArray(GLuint index); + void DisableVertexAttribArray(GLuint index); + + JS::Value GetVertexAttrib(JSContext* cx, GLuint index, GLenum pname, + ErrorResult& rv); + + void GetVertexAttrib(JSContext* cx, GLuint index, GLenum pname, + JS::MutableHandle retval, ErrorResult& rv) + { + retval.set(GetVertexAttrib(cx, index, pname, rv)); + } + + WebGLsizeiptr GetVertexAttribOffset(GLuint index, GLenum pname); + + //// + + void VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w, + const char* funcName = nullptr); + + //// + + void VertexAttrib1f(GLuint index, GLfloat x) { + VertexAttrib4f(index, x, 0, 0, 1, "vertexAttrib1f"); + } + void VertexAttrib2f(GLuint index, GLfloat x, GLfloat y) { + VertexAttrib4f(index, x, y, 0, 1, "vertexAttrib2f"); + } + void VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) { + VertexAttrib4f(index, x, y, z, 1, "vertexAttrib3f"); + } + + //// + + void VertexAttrib1fv(GLuint index, const Float32ListU& list) { + const char funcName[] = "vertexAttrib1fv"; + const auto& arr = Float32Arr::From(list); + if (!ValidateAttribArraySetter(funcName, 1, arr.elemCount)) + return; + + VertexAttrib4f(index, arr.elemBytes[0], 0, 0, 1, funcName); + } + + void VertexAttrib2fv(GLuint index, const Float32ListU& list) { + const char funcName[] = "vertexAttrib2fv"; + const auto& arr = Float32Arr::From(list); + if (!ValidateAttribArraySetter(funcName, 2, arr.elemCount)) + return; + + VertexAttrib4f(index, arr.elemBytes[0], arr.elemBytes[1], 0, 1, funcName); + } + + void VertexAttrib3fv(GLuint index, const Float32ListU& list) { + const char funcName[] = "vertexAttrib3fv"; + const auto& arr = Float32Arr::From(list); + if (!ValidateAttribArraySetter(funcName, 3, arr.elemCount)) + return; + + VertexAttrib4f(index, arr.elemBytes[0], arr.elemBytes[1], arr.elemBytes[2], 1, + funcName); + } + + void VertexAttrib4fv(GLuint index, const Float32ListU& list) { + const char funcName[] = "vertexAttrib4fv"; + const auto& arr = Float32Arr::From(list); + if (!ValidateAttribArraySetter(funcName, 4, arr.elemCount)) + return; + + VertexAttrib4f(index, arr.elemBytes[0], arr.elemBytes[1], arr.elemBytes[2], + arr.elemBytes[3], funcName); + } + + //// + + void VertexAttribPointer(GLuint index, GLint size, GLenum type, + WebGLboolean normalized, GLsizei stride, + WebGLintptr byteOffset); + void VertexAttribDivisor(GLuint index, GLuint divisor); + +private: + // Cache the max number of vertices and instances that can be read from + // bound VBOs (result of ValidateBuffers). + bool mBufferFetchingIsVerified; + bool mBufferFetchingHasPerVertex; + uint32_t mMaxFetchedVertices; + uint32_t mMaxFetchedInstances; + bool mBufferFetch_IsAttrib0Active; + + bool DrawArrays_check(const char* funcName, GLenum mode, GLint first, + GLsizei vertCount, GLsizei instanceCount); + bool DrawElements_check(const char* funcName, GLenum mode, GLsizei vertCount, + GLenum type, WebGLintptr byteOffset, + GLsizei instanceCount); + bool DrawInstanced_check(const char* info); + void Draw_cleanup(const char* funcName); + + void VertexAttrib1fv_base(GLuint index, uint32_t arrayLength, + const GLfloat* ptr); + void VertexAttrib2fv_base(GLuint index, uint32_t arrayLength, + const GLfloat* ptr); + void VertexAttrib3fv_base(GLuint index, uint32_t arrayLength, + const GLfloat* ptr); + void VertexAttrib4fv_base(GLuint index, uint32_t arrayLength, + const GLfloat* ptr); + + bool ValidateBufferFetching(const char* info); + bool BindArrayAttribToLocation0(WebGLProgram* prog); + +// ----------------------------------------------------------------------------- +// PROTECTED +protected: + WebGLVertexAttrib0Status WhatDoesVertexAttrib0Need() const; + bool DoFakeVertexAttrib0(const char* funcName, GLuint vertexCount); + void UndoFakeVertexAttrib0(); + + inline void InvalidateBufferFetching() + { + mBufferFetchingIsVerified = false; + mBufferFetchingHasPerVertex = false; + mMaxFetchedVertices = 0; + mMaxFetchedInstances = 0; + } + + CheckedUint32 mGeneration; + + WebGLContextOptions mOptions; + + bool mInvalidated; + bool mCapturedFrameInvalidated; + bool mResetLayer; + bool mLayerIsMirror; + bool mOptionsFrozen; + bool mMinCapability; + bool mDisableExtensions; + bool mIsMesa; + bool mLoseContextOnMemoryPressure; + bool mCanLoseContextInForeground; + bool mRestoreWhenVisible; + bool mShouldPresent; + bool mBackbufferNeedsClear; + bool mDisableFragHighP; + + template + void DeleteWebGLObjectsArray(nsTArray& array); + + GLuint mActiveTexture; + GLenum mDefaultFB_DrawBuffer0; + + // glGetError sources: + bool mEmitContextLostErrorOnce; + GLenum mWebGLError; + GLenum mUnderlyingGLError; + GLenum GetAndFlushUnderlyingGLErrors(); + + bool mBypassShaderValidation; + + webgl::ShaderValidator* CreateShaderValidator(GLenum shaderType) const; + + // some GL constants + uint32_t mGLMaxVertexAttribs; + int32_t mGLMaxTextureUnits; + int32_t mGLMaxTextureImageUnits; + int32_t mGLMaxVertexTextureImageUnits; + int32_t mGLMaxVaryingVectors; + int32_t mGLMaxFragmentUniformVectors; + int32_t mGLMaxVertexUniformVectors; + uint32_t mGLMaxTransformFeedbackSeparateAttribs; + GLuint mGLMaxUniformBufferBindings; + + // What is supported: + uint32_t mGLMaxColorAttachments; + uint32_t mGLMaxDrawBuffers; + // What we're allowing: + uint32_t mImplMaxColorAttachments; + uint32_t mImplMaxDrawBuffers; + + uint32_t mImplMaxViewportDims[2]; + +public: + GLenum LastColorAttachmentEnum() const { + return LOCAL_GL_COLOR_ATTACHMENT0 + mImplMaxColorAttachments - 1; + } + + const decltype(mOptions)& Options() const { return mOptions; } + +protected: + + // Texture sizes are often not actually the GL values. Let's be explicit that these + // are implementation limits. + uint32_t mImplMaxTextureSize; + uint32_t mImplMaxCubeMapTextureSize; + uint32_t mImplMax3DTextureSize; + uint32_t mImplMaxArrayTextureLayers; + uint32_t mImplMaxRenderbufferSize; + +public: + GLuint MaxVertexAttribs() const { + return mGLMaxVertexAttribs; + } + + GLuint GLMaxTextureUnits() const { + return mGLMaxTextureUnits; + } + + bool IsFormatValidForFB(TexInternalFormat format) const; + +protected: + // Represents current status of the context with respect to context loss. + // That is, whether the context is lost, and what part of the context loss + // process we currently are at. + // This is used to support the WebGL spec's asyncronous nature in handling + // context loss. + enum ContextStatus { + // The context is stable; there either are none or we don't know of any. + ContextNotLost, + // The context has been lost, but we have not yet sent an event to the + // script informing it of this. + ContextLostAwaitingEvent, + // The context has been lost, and we have sent the script an event + // informing it of this. + ContextLost, + // The context is lost, an event has been sent to the script, and the + // script correctly handled the event. We are waiting for the context to + // be restored. + ContextLostAwaitingRestore + }; + + // ------------------------------------------------------------------------- + // WebGL extensions (implemented in WebGLContextExtensions.cpp) + typedef EnumeratedArray> ExtensionsArrayType; + + ExtensionsArrayType mExtensions; + + // enable an extension. the extension should not be enabled before. + void EnableExtension(WebGLExtensionID ext); + + // Enable an extension if it's supported. Return the extension on success. + WebGLExtensionBase* EnableSupportedExtension(dom::CallerType callerType, + WebGLExtensionID ext); + +public: + // returns true if the extension has been enabled by calling getExtension. + bool IsExtensionEnabled(WebGLExtensionID ext) const; + +protected: + // returns true if the extension is supported for this caller type (this decides what getSupportedExtensions exposes) + bool IsExtensionSupported(dom::CallerType callerType, + WebGLExtensionID ext) const; + bool IsExtensionSupported(WebGLExtensionID ext) const; + + static const char* GetExtensionString(WebGLExtensionID ext); + + nsTArray mCompressedTextureFormats; + + // ------------------------------------------------------------------------- + // WebGL 2 specifics (implemented in WebGL2Context.cpp) +public: + virtual bool IsWebGL2() const = 0; + + struct FailureReason { + nsCString key; // For reporting. + nsCString info; + + FailureReason() { } + + template + FailureReason(const A& _key, const B& _info) + : key(nsCString(_key)) + , info(nsCString(_info)) + { } + }; +protected: + bool InitWebGL2(FailureReason* const out_failReason); + + bool CreateAndInitGL(bool forceEnabled, + std::vector* const out_failReasons); + + bool ResizeBackbuffer(uint32_t width, uint32_t height); + + typedef already_AddRefed FnCreateGL_T(const gl::SurfaceCaps& caps, + gl::CreateContextFlags flags, + WebGLContext* webgl, + std::vector* const out_failReasons); + + bool CreateAndInitGLWith(FnCreateGL_T fnCreateGL, const gl::SurfaceCaps& baseCaps, + gl::CreateContextFlags flags, + std::vector* const out_failReasons); + + void ThrowEvent_WebGLContextCreationError(const nsACString& text); + + // ------------------------------------------------------------------------- + // Validation functions (implemented in WebGLContextValidate.cpp) + bool InitAndValidateGL(FailureReason* const out_failReason); + + bool ValidateBlendEquationEnum(GLenum cap, const char* info); + bool ValidateBlendFuncDstEnum(GLenum mode, const char* info); + bool ValidateBlendFuncSrcEnum(GLenum mode, const char* info); + bool ValidateBlendFuncEnumsCompatibility(GLenum sfactor, GLenum dfactor, + const char* info); + bool ValidateComparisonEnum(GLenum target, const char* info); + bool ValidateStencilOpEnum(GLenum action, const char* info); + bool ValidateFaceEnum(GLenum face, const char* info); + bool ValidateTexInputData(GLenum type, js::Scalar::Type jsArrayType, + WebGLTexImageFunc func, WebGLTexDimensions dims); + bool ValidateDrawModeEnum(GLenum mode, const char* info); + bool ValidateAttribIndex(GLuint index, const char* info); + bool ValidateAttribPointer(bool integerMode, GLuint index, GLint size, GLenum type, + WebGLboolean normalized, GLsizei stride, + WebGLintptr byteOffset, const char* info); + bool ValidateStencilParamsForDrawCall(); + + bool ValidateCopyTexImage(TexInternalFormat srcFormat, TexInternalFormat dstformat, + WebGLTexImageFunc func, WebGLTexDimensions dims); + + bool ValidateTexImage(TexImageTarget texImageTarget, + GLint level, GLenum internalFormat, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint width, GLint height, GLint depth, + GLint border, GLenum format, GLenum type, + WebGLTexImageFunc func, WebGLTexDimensions dims); + bool ValidateTexImageFormat(GLenum internalFormat, WebGLTexImageFunc func, + WebGLTexDimensions dims); + bool ValidateTexImageType(GLenum type, WebGLTexImageFunc func, + WebGLTexDimensions dims); + bool ValidateTexImageFormatAndType(GLenum format, GLenum type, + WebGLTexImageFunc func, + WebGLTexDimensions dims); + bool ValidateCompTexImageInternalFormat(GLenum format, + WebGLTexImageFunc func, + WebGLTexDimensions dims); + bool ValidateCopyTexImageInternalFormat(GLenum format, + WebGLTexImageFunc func, + WebGLTexDimensions dims); + bool ValidateTexImageSize(TexImageTarget texImageTarget, GLint level, + GLint width, GLint height, GLint depth, + WebGLTexImageFunc func, WebGLTexDimensions dims); + bool ValidateTexSubImageSize(GLint x, GLint y, GLint z, GLsizei width, + GLsizei height, GLsizei depth, + GLsizei baseWidth, GLsizei baseHeight, + GLsizei baseDepth, WebGLTexImageFunc func, + WebGLTexDimensions dims); + bool ValidateCompTexImageSize(GLint level, GLenum internalFormat, + GLint xoffset, GLint yoffset, GLsizei width, + GLsizei height, GLsizei levelWidth, + GLsizei levelHeight, WebGLTexImageFunc func, + WebGLTexDimensions dims); + bool ValidateCompTexImageDataSize(GLint level, GLenum internalFormat, + GLsizei width, GLsizei height, + uint32_t byteLength, + WebGLTexImageFunc func, + WebGLTexDimensions dims); + + bool ValidateUniformLocationForProgram(WebGLUniformLocation* location, + WebGLProgram* program, + const char* funcName); + + bool ValidateCurFBForRead(const char* funcName, + const webgl::FormatUsageInfo** const out_format, + uint32_t* const out_width, uint32_t* const out_height); + + bool HasDrawBuffers() const { + return IsWebGL2() || + IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers); + } + + WebGLRefPtr* ValidateBufferSlot(const char* funcName, GLenum target); +public: + WebGLBuffer* ValidateBufferSelection(const char* funcName, GLenum target); +protected: + IndexedBufferBinding* ValidateIndexedBufferSlot(const char* funcName, GLenum target, + GLuint index); + + bool ValidateIndexedBufferBinding(const char* funcName, GLenum target, GLuint index, + WebGLRefPtr** const out_genericBinding, + IndexedBufferBinding** const out_indexedBinding); + + bool ValidateNonNegative(const char* funcName, const char* argName, int64_t val) { + if (MOZ_UNLIKELY(val < 0)) { + ErrorInvalidValue("%s: `%s` must be non-negative.", funcName, argName); + return false; + } + return true; + } + +public: + template + bool ValidateNonNull(const char* funcName, const dom::Nullable& maybe) { + if (maybe.IsNull()) { + ErrorInvalidValue("%s: `null` is invalid.", funcName); + return false; + } + return true; + } + + bool ValidateArrayBufferView(const char* funcName, const dom::ArrayBufferView& view, + GLuint elemOffset, GLuint elemCountOverride, + uint8_t** const out_bytes, size_t* const out_byteLen); + +protected: + //// + + void Invalidate(); + void DestroyResourcesAndContext(); + + void MakeContextCurrent() const; + + // helpers + + bool ConvertImage(size_t width, size_t height, size_t srcStride, + size_t dstStride, const uint8_t* src, uint8_t* dst, + WebGLTexelFormat srcFormat, bool srcPremultiplied, + WebGLTexelFormat dstFormat, bool dstPremultiplied, + size_t dstTexelSize); + + ////// +public: + bool ValidateObjectAllowDeleted(const char* funcName, + const WebGLContextBoundObject& object) + { + if (!object.IsCompatibleWithContext(this)) { + ErrorInvalidOperation("%s: Object from different WebGL context (or older" + " generation of this one) passed as argument.", + funcName); + return false; + } + + return true; + } + + bool ValidateObject(const char* funcName, const WebGLDeletableObject& object, + bool isShaderOrProgram = false) + { + if (!ValidateObjectAllowDeleted(funcName, object)) + return false; + + if (isShaderOrProgram) { + /* GLES 3.0.5 p45: + * "Commands that accept shader or program object names will generate the + * error INVALID_VALUE if the provided name is not the name of either a + * shader or program object[.]" + * Further, shaders and programs appear to be different from other objects, + * in that their lifetimes are better defined. However, they also appear to + * allow use of objects marked for deletion, and only reject + * actually-destroyed objects. + */ + if (object.IsDeleted()) { + ErrorInvalidValue("%s: Shader or program object argument cannot have been" + " deleted.", + funcName); + return false; + } + } else { + if (object.IsDeleteRequested()) { + ErrorInvalidOperation("%s: Object argument cannot have been marked for" + " deletion.", + funcName); + return false; + } + } + + return true; + } + + //// + + bool ValidateObject(const char* funcName, const WebGLProgram& object); + bool ValidateObject(const char* funcName, const WebGLShader& object); + + //// + + bool ValidateIsObject(const char* funcName, + const WebGLDeletableObject* object) const + { + if (IsContextLost()) + return false; + + if (!object) + return false; + + if (!object->IsCompatibleWithContext(this)) + return false; + + if (object->IsDeleted()) + return false; + + return true; + } + + bool ValidateDeleteObject(const char* funcName, const WebGLDeletableObject* object) { + if (IsContextLost()) + return false; + + if (!object) + return false; + + if (!ValidateObjectAllowDeleted(funcName, *object)) + return false; + + if (object->IsDeleteRequested()) + return false; + + return true; + } + + //// + +private: + // ------------------------------------------------------------------------- + // Context customization points + virtual WebGLVertexArray* CreateVertexArrayImpl(); + + virtual bool ValidateAttribPointerType(bool integerMode, GLenum type, uint32_t* alignment, const char* info) = 0; + virtual bool ValidateUniformMatrixTranspose(bool transpose, const char* info) = 0; + +public: + void ForceLoseContext(bool simulateLoss = false); + +protected: + void ForceRestoreContext(); + + nsTArray > mBound2DTextures; + nsTArray > mBoundCubeMapTextures; + nsTArray > mBound3DTextures; + nsTArray > mBound2DArrayTextures; + nsTArray > mBoundSamplers; + + void ResolveTexturesForDraw() const; + + WebGLRefPtr mCurrentProgram; + RefPtr mActiveProgramLinkInfo; + + bool ValidateFramebufferTarget(GLenum target, const char* const info); + bool ValidateInvalidateFramebuffer(const char* funcName, GLenum target, + const dom::Sequence& attachments, + ErrorResult* const out_rv, + std::vector* const scopedVector, + GLsizei* const out_glNumAttachments, + const GLenum** const out_glAttachments); + + WebGLRefPtr mBoundDrawFramebuffer; + WebGLRefPtr mBoundReadFramebuffer; + WebGLRefPtr mBoundRenderbuffer; + WebGLRefPtr mBoundTransformFeedback; + WebGLRefPtr mBoundVertexArray; + + LinkedList mBuffers; + LinkedList mFramebuffers; + LinkedList mPrograms; + LinkedList mQueries; + LinkedList mRenderbuffers; + LinkedList mSamplers; + LinkedList mShaders; + LinkedList mSyncs; + LinkedList mTextures; + LinkedList mTransformFeedbacks; + LinkedList mVertexArrays; + + WebGLRefPtr mDefaultTransformFeedback; + WebGLRefPtr mDefaultVertexArray; + + // PixelStore parameters + uint32_t mPixelStore_UnpackImageHeight; + uint32_t mPixelStore_UnpackSkipImages; + uint32_t mPixelStore_UnpackRowLength; + uint32_t mPixelStore_UnpackSkipRows; + uint32_t mPixelStore_UnpackSkipPixels; + uint32_t mPixelStore_UnpackAlignment; + uint32_t mPixelStore_PackRowLength; + uint32_t mPixelStore_PackSkipRows; + uint32_t mPixelStore_PackSkipPixels; + uint32_t mPixelStore_PackAlignment; + + CheckedUint32 GetUnpackSize(bool isFunc3D, uint32_t width, uint32_t height, + uint32_t depth, uint8_t bytesPerPixel); + + bool ValidatePackSize(const char* funcName, uint32_t width, uint32_t height, + uint8_t bytesPerPixel, uint32_t* const out_rowStride, + uint32_t* const out_endOffset); + + GLenum mPixelStore_ColorspaceConversion; + bool mPixelStore_FlipY; + bool mPixelStore_PremultiplyAlpha; + + //////////////////////////////////// + class FakeBlackTexture { + public: + static UniquePtr Create(gl::GLContext* gl, + TexTarget target, + FakeBlackType type); + gl::GLContext* const mGL; + const GLuint mGLName; + + ~FakeBlackTexture(); + protected: + explicit FakeBlackTexture(gl::GLContext* gl); + }; + + UniquePtr mFakeBlack_2D_0000; + UniquePtr mFakeBlack_2D_0001; + UniquePtr mFakeBlack_CubeMap_0000; + UniquePtr mFakeBlack_CubeMap_0001; + UniquePtr mFakeBlack_3D_0000; + UniquePtr mFakeBlack_3D_0001; + UniquePtr mFakeBlack_2D_Array_0000; + UniquePtr mFakeBlack_2D_Array_0001; + + bool BindFakeBlack(uint32_t texUnit, TexTarget target, FakeBlackType fakeBlack); + + //////////////////////////////////// + +protected: + GLuint mEmptyTFO; + + // Generic Vertex Attributes + // Though CURRENT_VERTEX_ATTRIB is listed under "Vertex Shader State" in the spec + // state tables, this isn't vertex shader /object/ state. This array is merely state + // useful to vertex shaders, but is global state. + UniquePtr mGenericVertexAttribTypes; + uint8_t mGenericVertexAttrib0Data[sizeof(float) * 4]; + + GLuint mFakeVertexAttrib0BufferObject; + size_t mFakeVertexAttrib0BufferObjectSize; + bool mFakeVertexAttrib0DataDefined; + uint8_t mFakeVertexAttrib0Data[sizeof(float) * 4]; + + JSObject* GetVertexAttribFloat32Array(JSContext* cx, GLuint index); + JSObject* GetVertexAttribInt32Array(JSContext* cx, GLuint index); + JSObject* GetVertexAttribUint32Array(JSContext* cx, GLuint index); + + GLint mStencilRefFront; + GLint mStencilRefBack; + GLuint mStencilValueMaskFront; + GLuint mStencilValueMaskBack; + GLuint mStencilWriteMaskFront; + GLuint mStencilWriteMaskBack; + realGLboolean mColorWriteMask[4]; + realGLboolean mDepthWriteMask; + GLfloat mColorClearValue[4]; + GLint mStencilClearValue; + GLfloat mDepthClearValue; + + GLint mViewportX; + GLint mViewportY; + GLsizei mViewportWidth; + GLsizei mViewportHeight; + bool mAlreadyWarnedAboutViewportLargerThanDest; + + GLfloat mLineWidth; + + WebGLContextLossHandler mContextLossHandler; + bool mAllowContextRestore; + bool mLastLossWasSimulated; + ContextStatus mContextStatus; + bool mContextLostErrorSet; + + // Used for some hardware (particularly Tegra 2 and 4) that likes to + // be Flushed while doing hundreds of draw calls. + int mDrawCallsSinceLastFlush; + + int mAlreadyGeneratedWarnings; + int mMaxWarnings; + bool mAlreadyWarnedAboutFakeVertexAttrib0; + + bool ShouldGenerateWarnings() const; + + uint64_t mLastUseIndex; + + bool mNeedsFakeNoAlpha; + bool mNeedsFakeNoDepth; + bool mNeedsFakeNoStencil; + bool mNeedsEmulatedLoneDepthStencil; + + const bool mAllowFBInvalidation; + + bool Has64BitTimestamps() const; + + struct ScopedDrawCallWrapper final { + WebGLContext& mWebGL; + const bool mFakeNoAlpha; + const bool mFakeNoDepth; + const bool mFakeNoStencil; + + static bool ShouldFakeNoAlpha(WebGLContext& webgl) { + // We should only be doing this if we're about to draw to the backbuffer, but + // the backbuffer needs to have this fake-no-alpha workaround. + return !webgl.mBoundDrawFramebuffer && + webgl.mNeedsFakeNoAlpha && + webgl.mColorWriteMask[3] != false; + } + + static bool ShouldFakeNoDepth(WebGLContext& webgl) { + // We should only be doing this if we're about to draw to the backbuffer. + return !webgl.mBoundDrawFramebuffer && + webgl.mNeedsFakeNoDepth && + webgl.mDepthTestEnabled; + } + + static bool HasDepthButNoStencil(const WebGLFramebuffer* fb); + + static bool ShouldFakeNoStencil(WebGLContext& webgl) { + if (!webgl.mStencilTestEnabled) + return false; + + if (!webgl.mBoundDrawFramebuffer) { + if (webgl.mNeedsFakeNoStencil) + return true; + + if (webgl.mNeedsEmulatedLoneDepthStencil && + webgl.mOptions.depth && !webgl.mOptions.stencil) + { + return true; + } + + return false; + } + + if (webgl.mNeedsEmulatedLoneDepthStencil && + HasDepthButNoStencil(webgl.mBoundDrawFramebuffer)) + { + return true; + } + + return false; + } + + //// + + explicit ScopedDrawCallWrapper(WebGLContext& webgl); + ~ScopedDrawCallWrapper(); + }; + + void OnBeforeReadCall(); + + void LoseOldestWebGLContextIfLimitExceeded(); + void UpdateLastUseIndex(); + + template + JS::Value WebGLObjectAsJSValue(JSContext* cx, const WebGLObjectType*, + ErrorResult& rv) const; + template + JSObject* WebGLObjectAsJSObject(JSContext* cx, const WebGLObjectType*, + ErrorResult& rv) const; + +#ifdef XP_MACOSX + // see bug 713305. This RAII helper guarantees that we're on the discrete GPU, during its lifetime + // Debouncing note: we don't want to switch GPUs too frequently, so try to not create and destroy + // these objects at high frequency. Having WebGLContext's hold one such object seems fine, + // because WebGLContext objects only go away during GC, which shouldn't happen too frequently. + // If in the future GC becomes much more frequent, we may have to revisit then (maybe use a timer). + ForceDiscreteGPUHelperCGL mForceDiscreteGPUHelper; +#endif + +public: + // console logging helpers + void GenerateWarning(const char* fmt, ...); + void GenerateWarning(const char* fmt, va_list ap); + +public: + UniquePtr mFormatUsage; + + virtual UniquePtr + CreateFormatUsage(gl::GLContext* gl) const = 0; + + + const decltype(mBound2DTextures)* TexListForElemType(GLenum elemType) const; + + // Friend list + friend class ScopedCopyTexImageSource; + friend class ScopedResolveTexturesForDraw; + friend class ScopedUnpackReset; + friend class webgl::TexUnpackBlob; + friend class webgl::TexUnpackBytes; + friend class webgl::TexUnpackImage; + friend class webgl::TexUnpackSurface; + friend struct webgl::UniformInfo; + friend class WebGLTexture; + friend class WebGLFBAttachPoint; + friend class WebGLFramebuffer; + friend class WebGLRenderbuffer; + friend class WebGLProgram; + friend class WebGLQuery; + friend class WebGLBuffer; + friend class WebGLSampler; + friend class WebGLShader; + friend class WebGLSync; + friend class WebGLTransformFeedback; + friend class WebGLUniformLocation; + friend class WebGLVertexArray; + friend class WebGLVertexArrayFake; + friend class WebGLVertexArrayGL; +}; + +// used by DOM bindings in conjunction with GetParentObject +inline nsISupports* +ToSupports(WebGLContext* webgl) +{ + return static_cast(webgl); +} + +// Returns `value` rounded to the next highest multiple of `multiple`. +// AKA PadToAlignment, StrideForAlignment. +template +V +RoundUpToMultipleOf(const V& value, const M& multiple) +{ + return ((value + multiple - 1) / multiple) * multiple; +} + +bool +ValidateTexTarget(WebGLContext* webgl, const char* funcName, uint8_t funcDims, + GLenum rawTexTarget, TexTarget* const out_texTarget, + WebGLTexture** const out_tex); +bool +ValidateTexImageTarget(WebGLContext* webgl, const char* funcName, uint8_t funcDims, + GLenum rawTexImageTarget, TexImageTarget* const out_texImageTarget, + WebGLTexture** const out_tex); + +class UniqueBuffer +{ + // Like UniquePtr<>, but for void* and malloc/calloc/free. + void* mBuffer; + +public: + UniqueBuffer() + : mBuffer(nullptr) + { } + + MOZ_IMPLICIT UniqueBuffer(void* buffer) + : mBuffer(buffer) + { } + + ~UniqueBuffer() { + free(mBuffer); + } + + UniqueBuffer(UniqueBuffer&& other) { + this->mBuffer = other.mBuffer; + other.mBuffer = nullptr; + } + + UniqueBuffer& operator =(UniqueBuffer&& other) { + free(this->mBuffer); + this->mBuffer = other.mBuffer; + other.mBuffer = nullptr; + return *this; + } + + UniqueBuffer& operator =(void* newBuffer) { + free(this->mBuffer); + this->mBuffer = newBuffer; + return *this; + } + + explicit operator bool() const { return bool(mBuffer); } + + void* get() const { return mBuffer; } + + UniqueBuffer(const UniqueBuffer& other) = delete; // construct using Move()! + void operator =(const UniqueBuffer& other) = delete; // assign using Move()! +}; + +class ScopedUnpackReset final + : public gl::ScopedGLWrapper +{ + friend struct gl::ScopedGLWrapper; + +private: + WebGLContext* const mWebGL; + +public: + explicit ScopedUnpackReset(WebGLContext* webgl); + +private: + void UnwrapImpl(); +}; + +class ScopedFBRebinder final + : public gl::ScopedGLWrapper +{ + friend struct gl::ScopedGLWrapper; + +private: + WebGLContext* const mWebGL; + +public: + explicit ScopedFBRebinder(WebGLContext* webgl) + : ScopedGLWrapper(webgl->gl) + , mWebGL(webgl) + { } + +private: + void UnwrapImpl(); +}; + +class ScopedLazyBind final + : public gl::ScopedGLWrapper +{ + friend struct gl::ScopedGLWrapper; + + const GLenum mTarget; + const WebGLBuffer* const mBuf; + +public: + ScopedLazyBind(gl::GLContext* gl, GLenum target, const WebGLBuffer* buf); + +private: + void UnwrapImpl(); +}; + +//// + +bool +Intersect(int32_t srcSize, int32_t read0, int32_t readSize, int32_t* out_intRead0, + int32_t* out_intWrite0, int32_t* out_intSize); + +//// + +void +ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& callback, + const std::vector& field, + const char* name, uint32_t flags = 0); + +void +ImplCycleCollectionUnlink(std::vector& field); + +} // namespace mozilla + +#endif diff --git a/dom/canvas/WebGLContextBuffers.cpp b/dom/canvas/WebGLContextBuffers.cpp new file mode 100644 index 000000000..af506c01c --- /dev/null +++ b/dom/canvas/WebGLContextBuffers.cpp @@ -0,0 +1,531 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" + +#include "GLContext.h" +#include "WebGLBuffer.h" +#include "WebGLVertexArray.h" + +namespace mozilla { + +WebGLRefPtr* +WebGLContext::ValidateBufferSlot(const char* funcName, GLenum target) +{ + WebGLRefPtr* slot = nullptr; + + switch (target) { + case LOCAL_GL_ARRAY_BUFFER: + slot = &mBoundArrayBuffer; + break; + + case LOCAL_GL_ELEMENT_ARRAY_BUFFER: + slot = &(mBoundVertexArray->mElementArrayBuffer); + break; + } + + if (IsWebGL2()) { + switch (target) { + case LOCAL_GL_COPY_READ_BUFFER: + slot = &mBoundCopyReadBuffer; + break; + + case LOCAL_GL_COPY_WRITE_BUFFER: + slot = &mBoundCopyWriteBuffer; + break; + + case LOCAL_GL_PIXEL_PACK_BUFFER: + slot = &mBoundPixelPackBuffer; + break; + + case LOCAL_GL_PIXEL_UNPACK_BUFFER: + slot = &mBoundPixelUnpackBuffer; + break; + + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER: + slot = &(mBoundTransformFeedback->mGenericBufferBinding); + break; + + case LOCAL_GL_UNIFORM_BUFFER: + slot = &mBoundUniformBuffer; + break; + } + } + + if (!slot) { + ErrorInvalidEnum("%s: Bad `target`: 0x%04x", funcName, target); + return nullptr; + } + + return slot; +} + +WebGLBuffer* +WebGLContext::ValidateBufferSelection(const char* funcName, GLenum target) +{ + const auto& slot = ValidateBufferSlot(funcName, target); + if (!slot) + return nullptr; + const auto& buffer = *slot; + + if (!buffer) { + ErrorInvalidOperation("%s: Buffer for `target` is null.", funcName); + return nullptr; + } + + if (target == LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER) { + if (mBoundTransformFeedback->IsActiveAndNotPaused()) { + ErrorInvalidOperation("%s: Cannot select TRANSFORM_FEEDBACK_BUFFER when" + " transform feedback is active and unpaused.", + funcName); + return nullptr; + } + if (buffer->IsBoundForNonTF()) { + ErrorInvalidOperation("%s: Specified WebGLBuffer is currently bound for" + " non-transform-feedback.", + funcName); + return nullptr; + } + } else { + if (buffer->IsBoundForTF()) { + ErrorInvalidOperation("%s: Specified WebGLBuffer is currently bound for" + " transform feedback.", + funcName); + return nullptr; + } + } + + return buffer.get(); +} + +IndexedBufferBinding* +WebGLContext::ValidateIndexedBufferSlot(const char* funcName, GLenum target, GLuint index) +{ + decltype(mIndexedUniformBufferBindings)* bindings; + const char* maxIndexEnum; + switch (target) { + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER: + bindings = &(mBoundTransformFeedback->mIndexedBindings); + maxIndexEnum = "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS"; + break; + + case LOCAL_GL_UNIFORM_BUFFER: + bindings = &mIndexedUniformBufferBindings; + maxIndexEnum = "MAX_UNIFORM_BUFFER_BINDINGS"; + break; + + default: + ErrorInvalidEnum("%s: Bad `target`: 0x%04x", funcName, target); + return nullptr; + } + + if (index >= bindings->size()) { + ErrorInvalidValue("%s: `index` >= %s.", funcName, maxIndexEnum); + return nullptr; + } + + return &(*bindings)[index]; +} + +//////////////////////////////////////// + +void +WebGLContext::BindBuffer(GLenum target, WebGLBuffer* buffer) +{ + const char funcName[] = "bindBuffer"; + if (IsContextLost()) + return; + + if (buffer && !ValidateObject(funcName, *buffer)) + return; + + const auto& slot = ValidateBufferSlot(funcName, target); + if (!slot) + return; + + if (buffer && !buffer->ValidateCanBindToTarget(funcName, target)) + return; + + gl->MakeCurrent(); + gl->fBindBuffer(target, buffer ? buffer->mGLName : 0); + + WebGLBuffer::SetSlot(target, buffer, slot); + if (buffer) { + buffer->SetContentAfterBind(target); + } + + switch (target) { + case LOCAL_GL_PIXEL_PACK_BUFFER: + case LOCAL_GL_PIXEL_UNPACK_BUFFER: + gl->fBindBuffer(target, 0); + break; + } +} + +//////////////////////////////////////// + +bool +WebGLContext::ValidateIndexedBufferBinding(const char* funcName, GLenum target, + GLuint index, + WebGLRefPtr** const out_genericBinding, + IndexedBufferBinding** const out_indexedBinding) +{ + *out_genericBinding = ValidateBufferSlot(funcName, target); + if (!*out_genericBinding) + return false; + + *out_indexedBinding = ValidateIndexedBufferSlot(funcName, target, index); + if (!*out_indexedBinding) + return false; + + if (target == LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER && + mBoundTransformFeedback->mIsActive) + { + ErrorInvalidOperation("%s: Cannot update indexed buffer bindings on active" + " transform feedback objects.", + funcName); + return false; + } + + return true; +} + +void +WebGLContext::BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer) +{ + const char funcName[] = "bindBufferBase"; + if (IsContextLost()) + return; + + if (buffer && !ValidateObject(funcName, *buffer)) + return; + + WebGLRefPtr* genericBinding; + IndexedBufferBinding* indexedBinding; + if (!ValidateIndexedBufferBinding(funcName, target, index, &genericBinding, + &indexedBinding)) + { + return; + } + + if (buffer && !buffer->ValidateCanBindToTarget(funcName, target)) + return; + + //// + + gl->MakeCurrent(); + gl->fBindBufferBase(target, index, buffer ? buffer->mGLName : 0); + + //// + + WebGLBuffer::SetSlot(target, buffer, genericBinding); + WebGLBuffer::SetSlot(target, buffer, &indexedBinding->mBufferBinding); + indexedBinding->mRangeStart = 0; + indexedBinding->mRangeSize = 0; + + if (buffer) { + buffer->SetContentAfterBind(target); + } +} + +void +WebGLContext::BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer, + WebGLintptr offset, WebGLsizeiptr size) +{ + const char funcName[] = "bindBufferRange"; + if (IsContextLost()) + return; + + if (buffer && !ValidateObject(funcName, *buffer)) + return; + + if (!ValidateNonNegative(funcName, "offset", offset) || + !ValidateNonNegative(funcName, "size", size)) + { + return; + } + + WebGLRefPtr* genericBinding; + IndexedBufferBinding* indexedBinding; + if (!ValidateIndexedBufferBinding(funcName, target, index, &genericBinding, + &indexedBinding)) + { + return; + } + + if (buffer && !buffer->ValidateCanBindToTarget(funcName, target)) + return; + + if (buffer && !size) { + ErrorInvalidValue("%s: size must be non-zero for non-null buffer.", funcName); + return; + } + + //// + + gl->MakeCurrent(); + + switch (target) { + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER: + if (offset % 4 != 0 || size % 4 != 0) { + ErrorInvalidValue("%s: For %s, `offset` and `size` must be multiples of 4.", + funcName, "TRANSFORM_FEEDBACK_BUFFER"); + return; + } + break; + + case LOCAL_GL_UNIFORM_BUFFER: + { + GLuint offsetAlignment = 0; + gl->GetUIntegerv(LOCAL_GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &offsetAlignment); + if (offset % offsetAlignment != 0) { + ErrorInvalidValue("%s: For %s, `offset` must be a multiple of %s.", + funcName, "UNIFORM_BUFFER", + "UNIFORM_BUFFER_OFFSET_ALIGNMENT"); + return; + } + } + break; + } + + //// + +#ifdef XP_MACOSX + if (buffer && buffer->Content() == WebGLBuffer::Kind::Undefined && + gl->WorkAroundDriverBugs()) + { + // BindBufferRange will fail if the buffer's contents is undefined. + // Bind so driver initializes the buffer. + gl->fBindBuffer(target, buffer->mGLName); + } +#endif + + gl->fBindBufferRange(target, index, buffer ? buffer->mGLName : 0, offset, size); + + //// + + WebGLBuffer::SetSlot(target, buffer, genericBinding); + WebGLBuffer::SetSlot(target, buffer, &indexedBinding->mBufferBinding); + indexedBinding->mRangeStart = offset; + indexedBinding->mRangeSize = size; + + if (buffer) { + buffer->SetContentAfterBind(target); + } +} + +//////////////////////////////////////// + +void +WebGLContext::BufferDataImpl(GLenum target, size_t dataLen, const uint8_t* data, + GLenum usage) +{ + const char funcName[] = "bufferData"; + + const auto& buffer = ValidateBufferSelection(funcName, target); + if (!buffer) + return; + + buffer->BufferData(target, dataLen, data, usage); +} + +//// + +void +WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage) +{ + const char funcName[] = "bufferData"; + if (IsContextLost()) + return; + + if (!ValidateNonNegative(funcName, "size", size)) + return; + + //// + + const UniqueBuffer zeroBuffer(calloc(size, 1)); + if (!zeroBuffer) + return ErrorOutOfMemory("%s: Failed to allocate zeros.", funcName); + + BufferDataImpl(target, size_t(size), (const uint8_t*)zeroBuffer.get(), usage); +} + +void +WebGLContext::BufferData(GLenum target, const dom::Nullable& maybeSrc, + GLenum usage) +{ + if (IsContextLost()) + return; + + if (!ValidateNonNull("bufferData", maybeSrc)) + return; + const auto& src = maybeSrc.Value(); + + src.ComputeLengthAndData(); + BufferDataImpl(target, src.LengthAllowShared(), src.DataAllowShared(), usage); +} + +void +WebGLContext::BufferData(GLenum target, const dom::ArrayBufferView& src, GLenum usage, + GLuint srcElemOffset, GLuint srcElemCountOverride) +{ + const char funcName[] = "bufferData"; + if (IsContextLost()) + return; + + uint8_t* bytes; + size_t byteLen; + if (!ValidateArrayBufferView(funcName, src, srcElemOffset, srcElemCountOverride, + &bytes, &byteLen)) + { + return; + } + + BufferDataImpl(target, byteLen, bytes, usage); +} + +//////////////////////////////////////// + +void +WebGLContext::BufferSubDataImpl(GLenum target, WebGLsizeiptr dstByteOffset, + size_t dataLen, const uint8_t* data) +{ + const char funcName[] = "bufferSubData"; + + if (!ValidateNonNegative(funcName, "byteOffset", dstByteOffset)) + return; + + const auto& buffer = ValidateBufferSelection(funcName, target); + if (!buffer) + return; + + if (!buffer->ValidateRange(funcName, dstByteOffset, dataLen)) + return; + + if (!CheckedInt(dataLen).isValid()) { + ErrorOutOfMemory("%s: Size too large.", funcName); + return; + } + const GLintptr glDataLen(dataLen); + + //// + + MakeContextCurrent(); + const ScopedLazyBind lazyBind(gl, target, buffer); + + // Warning: Possibly shared memory. See bug 1225033. + gl->fBufferSubData(target, dstByteOffset, glDataLen, data); + + // Warning: Possibly shared memory. See bug 1225033. + buffer->ElementArrayCacheBufferSubData(dstByteOffset, data, size_t(glDataLen)); +} + +void +WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset, + const dom::ArrayBuffer& src) +{ + if (IsContextLost()) + return; + + src.ComputeLengthAndData(); + BufferSubDataImpl(target, dstByteOffset, src.LengthAllowShared(), + src.DataAllowShared()); +} + +void +WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset, + const dom::ArrayBufferView& src, GLuint srcElemOffset, + GLuint srcElemCountOverride) +{ + const char funcName[] = "bufferSubData"; + if (IsContextLost()) + return; + + uint8_t* bytes; + size_t byteLen; + if (!ValidateArrayBufferView(funcName, src, srcElemOffset, srcElemCountOverride, + &bytes, &byteLen)) + { + return; + } + + BufferSubDataImpl(target, dstByteOffset, byteLen, bytes); +} + +//////////////////////////////////////// + +already_AddRefed +WebGLContext::CreateBuffer() +{ + if (IsContextLost()) + return nullptr; + + GLuint buf = 0; + MakeContextCurrent(); + gl->fGenBuffers(1, &buf); + + RefPtr globj = new WebGLBuffer(this, buf); + return globj.forget(); +} + +void +WebGLContext::DeleteBuffer(WebGLBuffer* buffer) +{ + if (!ValidateDeleteObject("deleteBuffer", buffer)) + return; + + //// + + const auto fnClearIfBuffer = [&](GLenum target, WebGLRefPtr& bindPoint) { + if (bindPoint == buffer) { + WebGLBuffer::SetSlot(target, nullptr, &bindPoint); + } + }; + + fnClearIfBuffer(0, mBoundArrayBuffer); + fnClearIfBuffer(0, mBoundVertexArray->mElementArrayBuffer); + + for (auto& cur : mBoundVertexArray->mAttribs) { + fnClearIfBuffer(0, cur.mBuf); + } + + // WebGL binding points + if (IsWebGL2()) { + fnClearIfBuffer(0, mBoundCopyReadBuffer); + fnClearIfBuffer(0, mBoundCopyWriteBuffer); + fnClearIfBuffer(0, mBoundPixelPackBuffer); + fnClearIfBuffer(0, mBoundPixelUnpackBuffer); + fnClearIfBuffer(0, mBoundUniformBuffer); + fnClearIfBuffer(LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER, + mBoundTransformFeedback->mGenericBufferBinding); + + if (!mBoundTransformFeedback->mIsActive) { + for (auto& binding : mBoundTransformFeedback->mIndexedBindings) { + fnClearIfBuffer(LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER, + binding.mBufferBinding); + } + } + + for (auto& binding : mIndexedUniformBufferBindings) { + fnClearIfBuffer(0, binding.mBufferBinding); + } + } + + //// + + buffer->RequestDelete(); +} + +bool +WebGLContext::IsBuffer(WebGLBuffer* buffer) +{ + if (!ValidateIsObject("isBuffer", buffer)) + return false; + + MakeContextCurrent(); + return gl->fIsBuffer(buffer->mGLName); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextDraw.cpp b/dom/canvas/WebGLContextDraw.cpp new file mode 100644 index 000000000..66fca7689 --- /dev/null +++ b/dom/canvas/WebGLContextDraw.cpp @@ -0,0 +1,1256 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" + +#include "GLContext.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/UniquePtrExtensions.h" +#include "nsPrintfCString.h" +#include "WebGLBuffer.h" +#include "WebGLContextUtils.h" +#include "WebGLFramebuffer.h" +#include "WebGLProgram.h" +#include "WebGLRenderbuffer.h" +#include "WebGLShader.h" +#include "WebGLTexture.h" +#include "WebGLVertexArray.h" +#include "WebGLVertexAttribData.h" + +#include + +namespace mozilla { + +// For a Tegra workaround. +static const int MAX_DRAW_CALLS_SINCE_FLUSH = 100; + +//////////////////////////////////////// + +class ScopedResolveTexturesForDraw +{ + struct TexRebindRequest + { + uint32_t texUnit; + WebGLTexture* tex; + }; + + WebGLContext* const mWebGL; + std::vector mRebindRequests; + +public: + ScopedResolveTexturesForDraw(WebGLContext* webgl, const char* funcName, + bool* const out_error); + ~ScopedResolveTexturesForDraw(); +}; + +bool +WebGLTexture::IsFeedback(WebGLContext* webgl, const char* funcName, uint32_t texUnit, + const std::vector& fbAttachments) const +{ + auto itr = fbAttachments.cbegin(); + for (; itr != fbAttachments.cend(); ++itr) { + const auto& attach = *itr; + if (attach->Texture() == this) + break; + } + + if (itr == fbAttachments.cend()) + return false; + + //// + + const auto minLevel = mBaseMipmapLevel; + uint32_t maxLevel; + if (!MaxEffectiveMipmapLevel(texUnit, &maxLevel)) { + // No valid mips. Will need fake-black. + return false; + } + + //// + + for (; itr != fbAttachments.cend(); ++itr) { + const auto& attach = *itr; + if (attach->Texture() != this) + continue; + + const auto dstLevel = attach->MipLevel(); + + if (minLevel <= dstLevel && dstLevel <= maxLevel) { + webgl->ErrorInvalidOperation("%s: Feedback loop detected between tex target" + " 0x%04x, tex unit %u, levels %u-%u; and" + " framebuffer attachment 0x%04x, level %u.", + funcName, mTarget.get(), texUnit, minLevel, + maxLevel, attach->mAttachmentPoint, dstLevel); + return true; + } + } + + return false; +} + +ScopedResolveTexturesForDraw::ScopedResolveTexturesForDraw(WebGLContext* webgl, + const char* funcName, + bool* const out_error) + : mWebGL(webgl) +{ + MOZ_ASSERT(mWebGL->gl->IsCurrent()); + + if (!mWebGL->mActiveProgramLinkInfo) { + mWebGL->ErrorInvalidOperation("%s: The current program is not linked.", funcName); + *out_error = true; + return; + } + + const std::vector* attachList = nullptr; + const auto& fb = mWebGL->mBoundDrawFramebuffer; + if (fb) { + if (!fb->ValidateAndInitAttachments(funcName)) { + *out_error = true; + return; + } + + attachList = &(fb->ResolvedCompleteData()->texDrawBuffers); + } else { + webgl->ClearBackbufferIfNeeded(); + } + + MOZ_ASSERT(mWebGL->mActiveProgramLinkInfo); + const auto& uniformSamplers = mWebGL->mActiveProgramLinkInfo->uniformSamplers; + for (const auto& uniform : uniformSamplers) { + const auto& texList = *(uniform->mSamplerTexList); + + for (const auto& texUnit : uniform->mSamplerValues) { + if (texUnit >= texList.Length()) + continue; + + const auto& tex = texList[texUnit]; + if (!tex) + continue; + + if (attachList && + tex->IsFeedback(mWebGL, funcName, texUnit, *attachList)) + { + *out_error = true; + return; + } + + FakeBlackType fakeBlack; + if (!tex->ResolveForDraw(funcName, texUnit, &fakeBlack)) { + mWebGL->ErrorOutOfMemory("%s: Failed to resolve textures for draw.", + funcName); + *out_error = true; + return; + } + + if (fakeBlack == FakeBlackType::None) + continue; + + if (!mWebGL->BindFakeBlack(texUnit, tex->Target(), fakeBlack)) { + mWebGL->ErrorOutOfMemory("%s: Failed to create fake black texture.", + funcName); + *out_error = true; + return; + } + + mRebindRequests.push_back({texUnit, tex}); + } + } + + *out_error = false; +} + +ScopedResolveTexturesForDraw::~ScopedResolveTexturesForDraw() +{ + if (!mRebindRequests.size()) + return; + + gl::GLContext* gl = mWebGL->gl; + + for (const auto& itr : mRebindRequests) { + gl->fActiveTexture(LOCAL_GL_TEXTURE0 + itr.texUnit); + gl->fBindTexture(itr.tex->Target().get(), itr.tex->mGLName); + } + + gl->fActiveTexture(LOCAL_GL_TEXTURE0 + mWebGL->mActiveTexture); +} + +bool +WebGLContext::BindFakeBlack(uint32_t texUnit, TexTarget target, FakeBlackType fakeBlack) +{ + MOZ_ASSERT(fakeBlack == FakeBlackType::RGBA0000 || + fakeBlack == FakeBlackType::RGBA0001); + + const auto fnGetSlot = [this, target, fakeBlack]() -> UniquePtr* + { + switch (fakeBlack) { + case FakeBlackType::RGBA0000: + switch (target.get()) { + case LOCAL_GL_TEXTURE_2D : return &mFakeBlack_2D_0000; + case LOCAL_GL_TEXTURE_CUBE_MAP: return &mFakeBlack_CubeMap_0000; + case LOCAL_GL_TEXTURE_3D : return &mFakeBlack_3D_0000; + case LOCAL_GL_TEXTURE_2D_ARRAY: return &mFakeBlack_2D_Array_0000; + default: return nullptr; + } + + case FakeBlackType::RGBA0001: + switch (target.get()) { + case LOCAL_GL_TEXTURE_2D : return &mFakeBlack_2D_0001; + case LOCAL_GL_TEXTURE_CUBE_MAP: return &mFakeBlack_CubeMap_0001; + case LOCAL_GL_TEXTURE_3D : return &mFakeBlack_3D_0001; + case LOCAL_GL_TEXTURE_2D_ARRAY: return &mFakeBlack_2D_Array_0001; + default: return nullptr; + } + + default: + return nullptr; + } + }; + + UniquePtr* slot = fnGetSlot(); + if (!slot) { + MOZ_CRASH("GFX: fnGetSlot failed."); + } + UniquePtr& fakeBlackTex = *slot; + + if (!fakeBlackTex) { + fakeBlackTex = FakeBlackTexture::Create(gl, target, fakeBlack); + if (!fakeBlackTex) { + return false; + } + } + + gl->fActiveTexture(LOCAL_GL_TEXTURE0 + texUnit); + gl->fBindTexture(target.get(), fakeBlackTex->mGLName); + gl->fActiveTexture(LOCAL_GL_TEXTURE0 + mActiveTexture); + return true; +} + +//////////////////////////////////////// + +bool +WebGLContext::DrawInstanced_check(const char* info) +{ + MOZ_ASSERT(IsWebGL2() || + IsExtensionEnabled(WebGLExtensionID::ANGLE_instanced_arrays)); + if (!mBufferFetchingHasPerVertex) { + /* http://www.khronos.org/registry/gles/extensions/ANGLE/ANGLE_instanced_arrays.txt + * If all of the enabled vertex attribute arrays that are bound to active + * generic attributes in the program have a non-zero divisor, the draw + * call should return INVALID_OPERATION. + * + * NB: This also appears to apply to NV_instanced_arrays, though the + * INVALID_OPERATION emission is not explicitly stated. + * ARB_instanced_arrays does not have this restriction. + */ + ErrorInvalidOperation("%s: at least one vertex attribute divisor should be 0", info); + return false; + } + + return true; +} + +bool +WebGLContext::DrawArrays_check(const char* funcName, GLenum mode, GLint first, + GLsizei vertCount, GLsizei instanceCount) +{ + if (!ValidateDrawModeEnum(mode, funcName)) + return false; + + if (!ValidateNonNegative(funcName, "first", first) || + !ValidateNonNegative(funcName, "vertCount", vertCount) || + !ValidateNonNegative(funcName, "instanceCount", instanceCount)) + { + return false; + } + + if (!ValidateStencilParamsForDrawCall()) + return false; + + if (IsWebGL2() && !gl->IsSupported(gl::GLFeature::prim_restart_fixed)) { + MOZ_ASSERT(gl->IsSupported(gl::GLFeature::prim_restart)); + if (mPrimRestartTypeBytes != 0) { + mPrimRestartTypeBytes = 0; + + // OSX appears to have severe perf issues with leaving this enabled. + gl->fDisable(LOCAL_GL_PRIMITIVE_RESTART); + } + } + + if (!vertCount || !instanceCount) + return false; // No error, just early out. + + if (!ValidateBufferFetching(funcName)) + return false; + + const auto checked_firstPlusCount = CheckedInt(first) + vertCount; + if (!checked_firstPlusCount.isValid()) { + ErrorInvalidOperation("%s: overflow in first+vertCount", funcName); + return false; + } + + if (uint32_t(checked_firstPlusCount.value()) > mMaxFetchedVertices) { + ErrorInvalidOperation("%s: Bound vertex attribute buffers do not have sufficient" + " size for given first and count.", + funcName); + return false; + } + + return true; +} + +//////////////////////////////////////// + +template +static bool +DoSetsIntersect(const std::set& a, const std::set& b) +{ + std::vector intersection; + std::set_intersection(a.begin(), a.end(), b.begin(), b.end(), + std::back_inserter(intersection)); + return bool(intersection.size()); +} + +class ScopedDrawHelper final +{ + WebGLContext* const mWebGL; + bool mDidFake; + +public: + ScopedDrawHelper(WebGLContext* webgl, const char* funcName, uint32_t firstVertex, + uint32_t vertCount, uint32_t instanceCount, bool* const out_error) + : mWebGL(webgl) + , mDidFake(false) + { + if (instanceCount > mWebGL->mMaxFetchedInstances) { + mWebGL->ErrorInvalidOperation("%s: Bound instance attribute buffers do not" + " have sufficient size for given" + " `instanceCount`.", + funcName); + *out_error = true; + return; + } + + MOZ_ASSERT(mWebGL->gl->IsCurrent()); + + if (mWebGL->mBoundDrawFramebuffer) { + if (!mWebGL->mBoundDrawFramebuffer->ValidateAndInitAttachments(funcName)) { + *out_error = true; + return; + } + } else { + mWebGL->ClearBackbufferIfNeeded(); + } + + //// + + const size_t requiredVerts = firstVertex + vertCount; + if (!mWebGL->DoFakeVertexAttrib0(funcName, requiredVerts)) { + *out_error = true; + return; + } + mDidFake = true; + + //// + // Check UBO sizes. + + const auto& linkInfo = mWebGL->mActiveProgramLinkInfo; + + for (const auto& cur : linkInfo->uniformBlocks) { + const auto& dataSize = cur->mDataSize; + const auto& binding = cur->mBinding; + if (!binding) { + mWebGL->ErrorInvalidOperation("%s: Buffer for uniform block is null.", + funcName); + *out_error = true; + return; + } + + const auto availByteCount = binding->ByteCount(); + if (dataSize > availByteCount) { + mWebGL->ErrorInvalidOperation("%s: Buffer for uniform block is smaller" + " than UNIFORM_BLOCK_DATA_SIZE.", + funcName); + *out_error = true; + return; + } + + if (binding->mBufferBinding->IsBoundForTF()) { + mWebGL->ErrorInvalidOperation("%s: Buffer for uniform block is bound or" + " in use for transform feedback.", + funcName); + *out_error = true; + return; + } + } + + //// + + const auto& tfo = mWebGL->mBoundTransformFeedback; + if (tfo && tfo->IsActiveAndNotPaused()) { + uint32_t numUsed; + switch (linkInfo->transformFeedbackBufferMode) { + case LOCAL_GL_INTERLEAVED_ATTRIBS: + numUsed = 1; + break; + + case LOCAL_GL_SEPARATE_ATTRIBS: + numUsed = linkInfo->transformFeedbackVaryings.size(); + break; + + default: + MOZ_CRASH(); + } + + for (uint32_t i = 0; i < numUsed; ++i) { + const auto& buffer = tfo->mIndexedBindings[i].mBufferBinding; + if (buffer->IsBoundForNonTF()) { + mWebGL->ErrorInvalidOperation("%s: Transform feedback varying %u's" + " buffer is bound for" + " non-transform-feedback.", + funcName, i); + *out_error = true; + return; + } + } + } + + //// + + for (const auto& progAttrib : linkInfo->attribs) { + const auto& loc = progAttrib.mLoc; + if (loc == -1) + continue; + + const auto& attribData = mWebGL->mBoundVertexArray->mAttribs[loc]; + + GLenum attribDataBaseType; + if (attribData.mEnabled) { + attribDataBaseType = attribData.BaseType(); + + if (attribData.mBuf->IsBoundForTF()) { + mWebGL->ErrorInvalidOperation("%s: Vertex attrib %u's buffer is bound" + " or in use for transform feedback.", + funcName, loc); + *out_error = true; + return; + } + } else { + attribDataBaseType = mWebGL->mGenericVertexAttribTypes[loc]; + } + + if (attribDataBaseType != progAttrib.mBaseType) { + nsCString progType, dataType; + WebGLContext::EnumName(progAttrib.mBaseType, &progType); + WebGLContext::EnumName(attribDataBaseType, &dataType); + mWebGL->ErrorInvalidOperation("%s: Vertex attrib %u requires data of type" + " %s, but is being supplied with type %s.", + funcName, loc, progType.BeginReading(), + dataType.BeginReading()); + *out_error = true; + return; + } + } + + //// + + mWebGL->RunContextLossTimer(); + } + + ~ScopedDrawHelper() { + if (mDidFake) { + mWebGL->UndoFakeVertexAttrib0(); + } + } +}; + +//////////////////////////////////////// + +static uint32_t +UsedVertsForTFDraw(GLenum mode, uint32_t vertCount) +{ + uint8_t vertsPerPrim; + + switch (mode) { + case LOCAL_GL_POINTS: + vertsPerPrim = 1; + break; + case LOCAL_GL_LINES: + vertsPerPrim = 2; + break; + case LOCAL_GL_TRIANGLES: + vertsPerPrim = 3; + break; + default: + MOZ_CRASH("`mode`"); + } + + return vertCount / vertsPerPrim * vertsPerPrim; +} + +class ScopedDrawWithTransformFeedback final +{ + WebGLContext* const mWebGL; + WebGLTransformFeedback* const mTFO; + const bool mWithTF; + uint32_t mUsedVerts; + +public: + ScopedDrawWithTransformFeedback(WebGLContext* webgl, const char* funcName, + GLenum mode, uint32_t vertCount, + uint32_t instanceCount, bool* const out_error) + : mWebGL(webgl) + , mTFO(mWebGL->mBoundTransformFeedback) + , mWithTF(mTFO && + mTFO->mIsActive && + !mTFO->mIsPaused) + , mUsedVerts(0) + { + *out_error = false; + if (!mWithTF) + return; + + if (mode != mTFO->mActive_PrimMode) { + mWebGL->ErrorInvalidOperation("%s: Drawing with transform feedback requires" + " `mode` to match BeginTransformFeedback's" + " `primitiveMode`.", + funcName); + *out_error = true; + return; + } + + const auto usedVertsPerInstance = UsedVertsForTFDraw(mode, vertCount); + const auto usedVerts = CheckedInt(usedVertsPerInstance) * instanceCount; + + const auto remainingCapacity = mTFO->mActive_VertCapacity - mTFO->mActive_VertPosition; + if (!usedVerts.isValid() || + usedVerts.value() > remainingCapacity) + { + mWebGL->ErrorInvalidOperation("%s: Insufficient buffer capacity remaining for" + " transform feedback.", + funcName); + *out_error = true; + return; + } + + mUsedVerts = usedVerts.value(); + } + + void Advance() const { + if (!mWithTF) + return; + + mTFO->mActive_VertPosition += mUsedVerts; + } +}; + +//////////////////////////////////////// + +void +WebGLContext::DrawArrays(GLenum mode, GLint first, GLsizei vertCount) +{ + const char funcName[] = "drawArrays"; + if (IsContextLost()) + return; + + MakeContextCurrent(); + + bool error = false; + ScopedResolveTexturesForDraw scopedResolve(this, funcName, &error); + if (error) + return; + + const GLsizei instanceCount = 1; + if (!DrawArrays_check(funcName, mode, first, vertCount, instanceCount)) + return; + + const ScopedDrawHelper scopedHelper(this, funcName, first, vertCount, instanceCount, &error); + if (error) + return; + + const ScopedDrawWithTransformFeedback scopedTF(this, funcName, mode, vertCount, + instanceCount, &error); + if (error) + return; + + { + ScopedDrawCallWrapper wrapper(*this); + gl->fDrawArrays(mode, first, vertCount); + } + + Draw_cleanup(funcName); + scopedTF.Advance(); +} + +void +WebGLContext::DrawArraysInstanced(GLenum mode, GLint first, GLsizei vertCount, + GLsizei instanceCount) +{ + const char funcName[] = "drawArraysInstanced"; + if (IsContextLost()) + return; + + MakeContextCurrent(); + + bool error = false; + ScopedResolveTexturesForDraw scopedResolve(this, funcName, &error); + if (error) + return; + + if (!DrawArrays_check(funcName, mode, first, vertCount, instanceCount)) + return; + + if (!DrawInstanced_check(funcName)) + return; + + const ScopedDrawHelper scopedHelper(this, funcName, first, vertCount, instanceCount, &error); + if (error) + return; + + const ScopedDrawWithTransformFeedback scopedTF(this, funcName, mode, vertCount, + instanceCount, &error); + if (error) + return; + + { + ScopedDrawCallWrapper wrapper(*this); + gl->fDrawArraysInstanced(mode, first, vertCount, instanceCount); + } + + Draw_cleanup(funcName); + scopedTF.Advance(); +} + +//////////////////////////////////////// + +bool +WebGLContext::DrawElements_check(const char* funcName, GLenum mode, GLsizei vertCount, + GLenum type, WebGLintptr byteOffset, + GLsizei instanceCount) +{ + if (!ValidateDrawModeEnum(mode, funcName)) + return false; + + if (mBoundTransformFeedback && + mBoundTransformFeedback->mIsActive && + !mBoundTransformFeedback->mIsPaused) + { + ErrorInvalidOperation("%s: DrawElements* functions are incompatible with" + " transform feedback.", + funcName); + return false; + } + + if (!ValidateNonNegative(funcName, "vertCount", vertCount) || + !ValidateNonNegative(funcName, "byteOffset", byteOffset) || + !ValidateNonNegative(funcName, "instanceCount", instanceCount)) + { + return false; + } + + if (!ValidateStencilParamsForDrawCall()) + return false; + + if (!vertCount || !instanceCount) + return false; // No error, just early out. + + uint8_t bytesPerElem = 0; + switch (type) { + case LOCAL_GL_UNSIGNED_BYTE: + bytesPerElem = 1; + break; + + case LOCAL_GL_UNSIGNED_SHORT: + bytesPerElem = 2; + break; + + case LOCAL_GL_UNSIGNED_INT: + if (IsWebGL2() || IsExtensionEnabled(WebGLExtensionID::OES_element_index_uint)) { + bytesPerElem = 4; + } + break; + } + + if (!bytesPerElem) { + ErrorInvalidEnum("%s: Invalid `type`: 0x%04x", funcName, type); + return false; + } + + if (byteOffset % bytesPerElem != 0) { + ErrorInvalidOperation("%s: `byteOffset` must be a multiple of the size of `type`", + funcName); + return false; + } + + //// + + if (IsWebGL2() && !gl->IsSupported(gl::GLFeature::prim_restart_fixed)) { + MOZ_ASSERT(gl->IsSupported(gl::GLFeature::prim_restart)); + if (mPrimRestartTypeBytes != bytesPerElem) { + mPrimRestartTypeBytes = bytesPerElem; + + const uint32_t ones = UINT32_MAX >> (32 - 8*mPrimRestartTypeBytes); + gl->fEnable(LOCAL_GL_PRIMITIVE_RESTART); + gl->fPrimitiveRestartIndex(ones); + } + } + + //// + + const GLsizei first = byteOffset / bytesPerElem; + const CheckedUint32 checked_byteCount = bytesPerElem * CheckedUint32(vertCount); + + if (!checked_byteCount.isValid()) { + ErrorInvalidValue("%s: Overflow in byteCount.", funcName); + return false; + } + + if (!mBoundVertexArray->mElementArrayBuffer) { + ErrorInvalidOperation("%s: Must have element array buffer binding.", funcName); + return false; + } + + WebGLBuffer& elemArrayBuffer = *mBoundVertexArray->mElementArrayBuffer; + + if (!elemArrayBuffer.ByteLength()) { + ErrorInvalidOperation("%s: Bound element array buffer doesn't have any data.", + funcName); + return false; + } + + CheckedInt checked_neededByteCount = checked_byteCount.toChecked() + byteOffset; + + if (!checked_neededByteCount.isValid()) { + ErrorInvalidOperation("%s: Overflow in byteOffset+byteCount.", funcName); + return false; + } + + if (uint32_t(checked_neededByteCount.value()) > elemArrayBuffer.ByteLength()) { + ErrorInvalidOperation("%s: Bound element array buffer is too small for given" + " count and offset.", + funcName); + return false; + } + + if (!ValidateBufferFetching(funcName)) + return false; + + if (!mMaxFetchedVertices || + !elemArrayBuffer.Validate(type, mMaxFetchedVertices - 1, first, vertCount)) + { + ErrorInvalidOperation("%s: bound vertex attribute buffers do not have sufficient " + "size for given indices from the bound element array", + funcName); + return false; + } + + // Bug 1008310 - Check if buffer has been used with a different previous type + if (elemArrayBuffer.IsElementArrayUsedWithMultipleTypes()) { + nsCString typeName; + WebGLContext::EnumName(type, &typeName); + GenerateWarning("%s: bound element array buffer previously used with a type other than " + "%s, this will affect performance.", + funcName, typeName.BeginReading()); + } + + return true; +} + +static void +HandleDrawElementsErrors(WebGLContext* webgl, const char* funcName, + gl::GLContext::LocalErrorScope& errorScope) +{ + const auto err = errorScope.GetError(); + if (err == LOCAL_GL_INVALID_OPERATION) { + webgl->ErrorInvalidOperation("%s: Driver rejected indexed draw call, possibly" + " due to out-of-bounds indices.", funcName); + return; + } + + MOZ_ASSERT(!err); + if (err) { + webgl->ErrorImplementationBug("%s: Unexpected driver error during indexed draw" + " call. Please file a bug.", + funcName); + return; + } +} + +void +WebGLContext::DrawElements(GLenum mode, GLsizei vertCount, GLenum type, + WebGLintptr byteOffset, const char* funcName) +{ + if (!funcName) { + funcName = "drawElements"; + } + + if (IsContextLost()) + return; + + MakeContextCurrent(); + + bool error = false; + ScopedResolveTexturesForDraw scopedResolve(this, funcName, &error); + if (error) + return; + + const GLsizei instanceCount = 1; + if (!DrawElements_check(funcName, mode, vertCount, type, byteOffset, instanceCount)) + return; + + const ScopedDrawHelper scopedHelper(this, funcName, 0, mMaxFetchedVertices, instanceCount, + &error); + if (error) + return; + + { + ScopedDrawCallWrapper wrapper(*this); + { + UniquePtr errorScope; + + if (gl->IsANGLE()) { + errorScope.reset(new gl::GLContext::LocalErrorScope(*gl)); + } + + gl->fDrawElements(mode, vertCount, type, + reinterpret_cast(byteOffset)); + + if (errorScope) { + HandleDrawElementsErrors(this, funcName, *errorScope); + } + } + } + + Draw_cleanup(funcName); +} + +void +WebGLContext::DrawElementsInstanced(GLenum mode, GLsizei vertCount, GLenum type, + WebGLintptr byteOffset, GLsizei instanceCount) +{ + const char funcName[] = "drawElementsInstanced"; + if (IsContextLost()) + return; + + MakeContextCurrent(); + + bool error = false; + ScopedResolveTexturesForDraw scopedResolve(this, funcName, &error); + if (error) + return; + + if (!DrawElements_check(funcName, mode, vertCount, type, byteOffset, instanceCount)) + return; + + if (!DrawInstanced_check(funcName)) + return; + + const ScopedDrawHelper scopedHelper(this, funcName, 0, mMaxFetchedVertices, instanceCount, + &error); + if (error) + return; + + { + ScopedDrawCallWrapper wrapper(*this); + { + UniquePtr errorScope; + + if (gl->IsANGLE()) { + errorScope.reset(new gl::GLContext::LocalErrorScope(*gl)); + } + + gl->fDrawElementsInstanced(mode, vertCount, type, + reinterpret_cast(byteOffset), + instanceCount); + if (errorScope) { + HandleDrawElementsErrors(this, funcName, *errorScope); + } + } + } + + Draw_cleanup(funcName); +} + +//////////////////////////////////////// + +void +WebGLContext::Draw_cleanup(const char* funcName) +{ + if (gl->WorkAroundDriverBugs()) { + if (gl->Renderer() == gl::GLRenderer::Tegra) { + mDrawCallsSinceLastFlush++; + + if (mDrawCallsSinceLastFlush >= MAX_DRAW_CALLS_SINCE_FLUSH) { + gl->fFlush(); + mDrawCallsSinceLastFlush = 0; + } + } + } + + // Let's check for a really common error: Viewport is larger than the actual + // destination framebuffer. + uint32_t destWidth = mViewportWidth; + uint32_t destHeight = mViewportHeight; + + if (mBoundDrawFramebuffer) { + const auto& drawBuffers = mBoundDrawFramebuffer->ColorDrawBuffers(); + for (const auto& cur : drawBuffers) { + if (!cur->IsDefined()) + continue; + cur->Size(&destWidth, &destHeight); + break; + } + } else { + destWidth = mWidth; + destHeight = mHeight; + } + + if (mViewportWidth > int32_t(destWidth) || + mViewportHeight > int32_t(destHeight)) + { + if (!mAlreadyWarnedAboutViewportLargerThanDest) { + GenerateWarning("%s: Drawing to a destination rect smaller than the viewport" + " rect. (This warning will only be given once)", + funcName); + mAlreadyWarnedAboutViewportLargerThanDest = true; + } + } +} + +/* + * Verify that state is consistent for drawing, and compute max number of elements (maxAllowedCount) + * that will be legal to be read from bound VBOs. + */ + +bool +WebGLContext::ValidateBufferFetching(const char* info) +{ + MOZ_ASSERT(mCurrentProgram); + // Note that mCurrentProgram->IsLinked() is NOT GUARANTEED. + MOZ_ASSERT(mActiveProgramLinkInfo); + +#ifdef DEBUG + GLint currentProgram = 0; + MakeContextCurrent(); + gl->fGetIntegerv(LOCAL_GL_CURRENT_PROGRAM, ¤tProgram); + MOZ_ASSERT(GLuint(currentProgram) == mCurrentProgram->mGLName, + "WebGL: current program doesn't agree with GL state"); +#endif + + if (mBufferFetchingIsVerified) + return true; + + bool hasPerVertex = false; + uint32_t maxVertices = UINT32_MAX; + uint32_t maxInstances = UINT32_MAX; + const uint32_t attribCount = mBoundVertexArray->mAttribs.Length(); + + uint32_t i = 0; + for (const auto& vd : mBoundVertexArray->mAttribs) { + // If the attrib array isn't enabled, there's nothing to check; + // it's a static value. + if (!vd.mEnabled) + continue; + + if (!vd.mBuf) { + ErrorInvalidOperation("%s: no VBO bound to enabled vertex attrib index %du!", + info, i); + return false; + } + + ++i; + } + + mBufferFetch_IsAttrib0Active = false; + + for (const auto& attrib : mActiveProgramLinkInfo->attribs) { + if (attrib.mLoc == -1) + continue; + + const uint32_t attribLoc(attrib.mLoc); + if (attribLoc >= attribCount) + continue; + + if (attribLoc == 0) { + mBufferFetch_IsAttrib0Active = true; + } + + const auto& vd = mBoundVertexArray->mAttribs[attribLoc]; + if (!vd.mEnabled) + continue; + + const auto& bufByteLen = vd.mBuf->ByteLength(); + if (vd.ByteOffset() > bufByteLen) { + maxVertices = 0; + maxInstances = 0; + break; + } + + size_t availBytes = bufByteLen - vd.ByteOffset(); + if (vd.BytesPerVertex() > availBytes) { + maxVertices = 0; + maxInstances = 0; + break; + } + availBytes -= vd.BytesPerVertex(); + const size_t vertCapacity = 1 + availBytes / vd.ExplicitStride(); + + if (vd.mDivisor == 0) { + if (vertCapacity < maxVertices) { + maxVertices = vertCapacity; + } + hasPerVertex = true; + } else { + const auto curMaxInstances = CheckedInt(vertCapacity) * vd.mDivisor; + // If this isn't valid, it's because we overflowed, which means we can support + // *too much*. Don't update maxInstances in this case. + if (curMaxInstances.isValid() && + curMaxInstances.value() < maxInstances) + { + maxInstances = curMaxInstances.value(); + } + } + } + + mBufferFetchingIsVerified = true; + mBufferFetchingHasPerVertex = hasPerVertex; + mMaxFetchedVertices = maxVertices; + mMaxFetchedInstances = maxInstances; + + return true; +} + +WebGLVertexAttrib0Status +WebGLContext::WhatDoesVertexAttrib0Need() const +{ + MOZ_ASSERT(mCurrentProgram); + MOZ_ASSERT(mActiveProgramLinkInfo); + + const auto& isAttribArray0Enabled = mBoundVertexArray->mAttribs[0].mEnabled; + + bool legacyAttrib0 = gl->IsCompatibilityProfile(); +#ifdef XP_MACOSX + if (gl->WorkAroundDriverBugs()) { + // Failures in conformance/attribs/gl-disabled-vertex-attrib. + // Even in Core profiles on NV. Sigh. + legacyAttrib0 |= (gl->Vendor() == gl::GLVendor::NVIDIA); + } +#endif + + if (!legacyAttrib0) + return WebGLVertexAttrib0Status::Default; + + if (isAttribArray0Enabled && mBufferFetch_IsAttrib0Active) + return WebGLVertexAttrib0Status::Default; + + if (mBufferFetch_IsAttrib0Active) + return WebGLVertexAttrib0Status::EmulatedInitializedArray; + + // Ensure that the legacy code has enough buffer. + return WebGLVertexAttrib0Status::EmulatedUninitializedArray; +} + +bool +WebGLContext::DoFakeVertexAttrib0(const char* funcName, GLuint vertexCount) +{ + if (!vertexCount) { + vertexCount = 1; + } + + const auto whatDoesAttrib0Need = WhatDoesVertexAttrib0Need(); + if (MOZ_LIKELY(whatDoesAttrib0Need == WebGLVertexAttrib0Status::Default)) + return true; + + if (!mAlreadyWarnedAboutFakeVertexAttrib0) { + GenerateWarning("Drawing without vertex attrib 0 array enabled forces the browser " + "to do expensive emulation work when running on desktop OpenGL " + "platforms, for example on Mac. It is preferable to always draw " + "with vertex attrib 0 array enabled, by using bindAttribLocation " + "to bind some always-used attribute to location 0."); + mAlreadyWarnedAboutFakeVertexAttrib0 = true; + } + + gl->fEnableVertexAttribArray(0); + + if (!mFakeVertexAttrib0BufferObject) { + gl->fGenBuffers(1, &mFakeVertexAttrib0BufferObject); + mFakeVertexAttrib0BufferObjectSize = 0; + } + gl->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mFakeVertexAttrib0BufferObject); + + //// + + switch (mGenericVertexAttribTypes[0]) { + case LOCAL_GL_FLOAT: + gl->fVertexAttribPointer(0, 4, LOCAL_GL_FLOAT, false, 0, 0); + break; + + case LOCAL_GL_INT: + gl->fVertexAttribIPointer(0, 4, LOCAL_GL_INT, 0, 0); + break; + + case LOCAL_GL_UNSIGNED_INT: + gl->fVertexAttribIPointer(0, 4, LOCAL_GL_UNSIGNED_INT, 0, 0); + break; + + default: + MOZ_CRASH(); + } + + //// + + const auto bytesPerVert = sizeof(mFakeVertexAttrib0Data); + const auto checked_dataSize = CheckedUint32(vertexCount) * bytesPerVert; + if (!checked_dataSize.isValid()) { + ErrorOutOfMemory("Integer overflow trying to construct a fake vertex attrib 0 array for a draw-operation " + "with %d vertices. Try reducing the number of vertices.", vertexCount); + return false; + } + const auto dataSize = checked_dataSize.value(); + + if (mFakeVertexAttrib0BufferObjectSize < dataSize) { + gl->fBufferData(LOCAL_GL_ARRAY_BUFFER, dataSize, nullptr, LOCAL_GL_DYNAMIC_DRAW); + mFakeVertexAttrib0BufferObjectSize = dataSize; + mFakeVertexAttrib0DataDefined = false; + } + + if (whatDoesAttrib0Need == WebGLVertexAttrib0Status::EmulatedUninitializedArray) + return true; + + //// + + if (mFakeVertexAttrib0DataDefined && + memcmp(mFakeVertexAttrib0Data, mGenericVertexAttrib0Data, bytesPerVert) == 0) + { + return true; + } + + //// + + const UniqueBuffer data(malloc(dataSize)); + if (!data) { + ErrorOutOfMemory("%s: Failed to allocate fake vertex attrib 0 array.", + funcName); + return false; + } + auto itr = (uint8_t*)data.get(); + const auto itrEnd = itr + dataSize; + while (itr != itrEnd) { + memcpy(itr, mGenericVertexAttrib0Data, bytesPerVert); + itr += bytesPerVert; + } + + { + gl::GLContext::LocalErrorScope errorScope(*gl); + + gl->fBufferSubData(LOCAL_GL_ARRAY_BUFFER, 0, dataSize, data.get()); + + const auto err = errorScope.GetError(); + if (err) { + ErrorOutOfMemory("%s: Failed to upload fake vertex attrib 0 data.", funcName); + return false; + } + } + + //// + + memcpy(mFakeVertexAttrib0Data, mGenericVertexAttrib0Data, bytesPerVert); + mFakeVertexAttrib0DataDefined = true; + return true; +} + +void +WebGLContext::UndoFakeVertexAttrib0() +{ + const auto whatDoesAttrib0Need = WhatDoesVertexAttrib0Need(); + if (MOZ_LIKELY(whatDoesAttrib0Need == WebGLVertexAttrib0Status::Default)) + return; + + if (mBoundVertexArray->mAttribs[0].mBuf) { + const WebGLVertexAttribData& attrib0 = mBoundVertexArray->mAttribs[0]; + gl->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, attrib0.mBuf->mGLName); + attrib0.DoVertexAttribPointer(gl, 0); + } else { + gl->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, 0); + } + + gl->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mBoundArrayBuffer ? mBoundArrayBuffer->mGLName : 0); +} + +static GLuint +CreateGLTexture(gl::GLContext* gl) +{ + MOZ_ASSERT(gl->IsCurrent()); + GLuint ret = 0; + gl->fGenTextures(1, &ret); + return ret; +} + +UniquePtr +WebGLContext::FakeBlackTexture::Create(gl::GLContext* gl, TexTarget target, + FakeBlackType type) +{ + GLenum texFormat; + switch (type) { + case FakeBlackType::RGBA0000: + texFormat = LOCAL_GL_RGBA; + break; + + case FakeBlackType::RGBA0001: + texFormat = LOCAL_GL_RGB; + break; + + default: + MOZ_CRASH("GFX: bad type"); + } + + UniquePtr result(new FakeBlackTexture(gl)); + gl::ScopedBindTexture scopedBind(gl, result->mGLName, target.get()); + + gl->fTexParameteri(target.get(), LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_NEAREST); + gl->fTexParameteri(target.get(), LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_NEAREST); + + // We allocate our zeros on the heap, and we overallocate (16 bytes instead of 4) to + // minimize the risk of running into a driver bug in texImage2D, as it is a bit + // unusual maybe to create 1x1 textures, and the stack may not have the alignment that + // TexImage2D expects. + + const webgl::DriverUnpackInfo dui = {texFormat, texFormat, LOCAL_GL_UNSIGNED_BYTE}; + UniqueBuffer zeros = moz_xcalloc(1, 16); // Infallible allocation. + + MOZ_ASSERT(gl->IsCurrent()); + + if (target == LOCAL_GL_TEXTURE_CUBE_MAP) { + for (int i = 0; i < 6; ++i) { + const TexImageTarget curTarget = LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X + i; + const GLenum error = DoTexImage(gl, curTarget.get(), 0, &dui, 1, 1, 1, + zeros.get()); + if (error) { + return nullptr; + } + } + } else { + const GLenum error = DoTexImage(gl, target.get(), 0, &dui, 1, 1, 1, + zeros.get()); + if (error) { + return nullptr; + } + } + + return result; +} + +WebGLContext::FakeBlackTexture::FakeBlackTexture(gl::GLContext* gl) + : mGL(gl) + , mGLName(CreateGLTexture(gl)) +{ +} + +WebGLContext::FakeBlackTexture::~FakeBlackTexture() +{ + mGL->MakeCurrent(); + mGL->fDeleteTextures(1, &mGLName); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextExtensions.cpp b/dom/canvas/WebGLContextExtensions.cpp new file mode 100644 index 000000000..28ba14fa2 --- /dev/null +++ b/dom/canvas/WebGLContextExtensions.cpp @@ -0,0 +1,480 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" +#include "WebGLContextUtils.h" +#include "WebGLExtensions.h" +#include "gfxPrefs.h" +#include "GLContext.h" + +#include "nsString.h" +#include "mozilla/Preferences.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "AccessCheck.h" + +namespace mozilla { + +/*static*/ const char* +WebGLContext::GetExtensionString(WebGLExtensionID ext) +{ + typedef EnumeratedArray names_array_t; + + static names_array_t sExtensionNamesEnumeratedArray; + static bool initialized = false; + + if (!initialized) { + initialized = true; + +#define WEBGL_EXTENSION_IDENTIFIER(x) \ + sExtensionNamesEnumeratedArray[WebGLExtensionID::x] = #x; + + WEBGL_EXTENSION_IDENTIFIER(ANGLE_instanced_arrays) + WEBGL_EXTENSION_IDENTIFIER(EXT_blend_minmax) + WEBGL_EXTENSION_IDENTIFIER(EXT_color_buffer_float) + WEBGL_EXTENSION_IDENTIFIER(EXT_color_buffer_half_float) + WEBGL_EXTENSION_IDENTIFIER(EXT_frag_depth) + WEBGL_EXTENSION_IDENTIFIER(EXT_shader_texture_lod) + WEBGL_EXTENSION_IDENTIFIER(EXT_sRGB) + WEBGL_EXTENSION_IDENTIFIER(EXT_texture_filter_anisotropic) + WEBGL_EXTENSION_IDENTIFIER(EXT_disjoint_timer_query) + WEBGL_EXTENSION_IDENTIFIER(OES_element_index_uint) + WEBGL_EXTENSION_IDENTIFIER(OES_standard_derivatives) + WEBGL_EXTENSION_IDENTIFIER(OES_texture_float) + WEBGL_EXTENSION_IDENTIFIER(OES_texture_float_linear) + WEBGL_EXTENSION_IDENTIFIER(OES_texture_half_float) + WEBGL_EXTENSION_IDENTIFIER(OES_texture_half_float_linear) + WEBGL_EXTENSION_IDENTIFIER(OES_vertex_array_object) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_color_buffer_float) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_compressed_texture_atc) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_compressed_texture_etc) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_compressed_texture_etc1) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_compressed_texture_pvrtc) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_compressed_texture_s3tc) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_debug_renderer_info) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_debug_shaders) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_depth_texture) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_draw_buffers) + WEBGL_EXTENSION_IDENTIFIER(WEBGL_lose_context) + +#undef WEBGL_EXTENSION_IDENTIFIER + } + + return sExtensionNamesEnumeratedArray[ext]; +} + +bool +WebGLContext::IsExtensionEnabled(WebGLExtensionID ext) const +{ + return mExtensions[ext]; +} + +bool WebGLContext::IsExtensionSupported(dom::CallerType callerType, + WebGLExtensionID ext) const +{ + bool allowPrivilegedExts = false; + + // Chrome contexts need access to debug information even when + // webgl.disable-extensions is set. This is used in the graphics + // section of about:support + if (callerType == dom::CallerType::System) { + allowPrivilegedExts = true; + } + + if (gfxPrefs::WebGLPrivilegedExtensionsEnabled()) { + allowPrivilegedExts = true; + } + + if (allowPrivilegedExts) { + switch (ext) { + case WebGLExtensionID::WEBGL_debug_renderer_info: + return true; + case WebGLExtensionID::WEBGL_debug_shaders: + return true; + default: + // For warnings-as-errors. + break; + } + } + + return IsExtensionSupported(ext); +} + +bool +WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const +{ + if (mDisableExtensions) + return false; + + // Extensions for both WebGL 1 and 2. + switch (ext) { + // In alphabetical order + // EXT_ + case WebGLExtensionID::EXT_disjoint_timer_query: + return WebGLExtensionDisjointTimerQuery::IsSupported(this); + case WebGLExtensionID::EXT_texture_filter_anisotropic: + return gl->IsExtensionSupported(gl::GLContext::EXT_texture_filter_anisotropic); + + // OES_ + case WebGLExtensionID::OES_texture_float_linear: + return gl->IsSupported(gl::GLFeature::texture_float_linear); + + // WEBGL_ + case WebGLExtensionID::WEBGL_compressed_texture_atc: + return gl->IsExtensionSupported(gl::GLContext::AMD_compressed_ATC_texture); + case WebGLExtensionID::WEBGL_compressed_texture_etc: + return gl->IsSupported(gl::GLFeature::ES3_compatibility); + case WebGLExtensionID::WEBGL_compressed_texture_etc1: + return gl->IsExtensionSupported(gl::GLContext::OES_compressed_ETC1_RGB8_texture); + case WebGLExtensionID::WEBGL_compressed_texture_pvrtc: + return gl->IsExtensionSupported(gl::GLContext::IMG_texture_compression_pvrtc); + case WebGLExtensionID::WEBGL_compressed_texture_s3tc: + if (gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_s3tc)) + return true; + + return gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_dxt1) && + gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt3) && + gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt5); + + case WebGLExtensionID::WEBGL_debug_renderer_info: + return Preferences::GetBool("webgl.enable-debug-renderer-info", false); + + case WebGLExtensionID::WEBGL_lose_context: + // We always support this extension. + return true; + + default: + // For warnings-as-errors. + break; + } + + if (IsWebGL2()) { + // WebGL2-only extensions + switch (ext) { + // EXT_ + case WebGLExtensionID::EXT_color_buffer_float: + return WebGLExtensionEXTColorBufferFloat::IsSupported(this); + + default: + // For warnings-as-errors. + break; + } + } else { + // WebGL1-only extensions + switch (ext) { + // ANGLE_ + case WebGLExtensionID::ANGLE_instanced_arrays: + return WebGLExtensionInstancedArrays::IsSupported(this); + + // EXT_ + case WebGLExtensionID::EXT_blend_minmax: + return WebGLExtensionBlendMinMax::IsSupported(this); + case WebGLExtensionID::EXT_color_buffer_half_float: + return WebGLExtensionColorBufferHalfFloat::IsSupported(this); + case WebGLExtensionID::EXT_frag_depth: + return WebGLExtensionFragDepth::IsSupported(this); + case WebGLExtensionID::EXT_shader_texture_lod: + return gl->IsSupported(gl::GLFeature::shader_texture_lod); + case WebGLExtensionID::EXT_sRGB: + return WebGLExtensionSRGB::IsSupported(this); + + // OES_ + case WebGLExtensionID::OES_element_index_uint: + return gl->IsSupported(gl::GLFeature::element_index_uint); + case WebGLExtensionID::OES_standard_derivatives: + return gl->IsSupported(gl::GLFeature::standard_derivatives); + case WebGLExtensionID::OES_texture_float: + return WebGLExtensionTextureFloat::IsSupported(this); + case WebGLExtensionID::OES_texture_half_float: + return WebGLExtensionTextureHalfFloat::IsSupported(this); + case WebGLExtensionID::OES_texture_half_float_linear: + return gl->IsSupported(gl::GLFeature::texture_half_float_linear); + + case WebGLExtensionID::OES_vertex_array_object: + return true; + + // WEBGL_ + case WebGLExtensionID::WEBGL_color_buffer_float: + return WebGLExtensionColorBufferFloat::IsSupported(this); + case WebGLExtensionID::WEBGL_depth_texture: + // WEBGL_depth_texture supports DEPTH_STENCIL textures + if (!gl->IsSupported(gl::GLFeature::packed_depth_stencil)) + return false; + + return gl->IsSupported(gl::GLFeature::depth_texture) || + gl->IsExtensionSupported(gl::GLContext::ANGLE_depth_texture); + case WebGLExtensionID::WEBGL_draw_buffers: + return WebGLExtensionDrawBuffers::IsSupported(this); + default: + // For warnings-as-errors. + break; + } + + if (gfxPrefs::WebGLDraftExtensionsEnabled()) { + /* + switch (ext) { + default: + // For warnings-as-errors. + break; + } + */ + } + } + + return false; +} + +static bool +CompareWebGLExtensionName(const nsACString& name, const char* other) +{ + return name.Equals(other, nsCaseInsensitiveCStringComparator()); +} + +WebGLExtensionBase* +WebGLContext::EnableSupportedExtension(dom::CallerType callerType, + WebGLExtensionID ext) +{ + if (!IsExtensionEnabled(ext)) { + if (!IsExtensionSupported(callerType, ext)) + return nullptr; + + EnableExtension(ext); + } + + return mExtensions[ext]; +} + +void +WebGLContext::GetExtension(JSContext* cx, + const nsAString& wideName, + JS::MutableHandle retval, + dom::CallerType callerType, + ErrorResult& rv) +{ + retval.set(nullptr); + + if (IsContextLost()) + return; + + NS_LossyConvertUTF16toASCII name(wideName); + + WebGLExtensionID ext = WebGLExtensionID::Unknown; + + // step 1: figure what extension is wanted + for (size_t i = 0; i < size_t(WebGLExtensionID::Max); i++) { + WebGLExtensionID extension = WebGLExtensionID(i); + + if (CompareWebGLExtensionName(name, GetExtensionString(extension))) { + ext = extension; + break; + } + } + + if (ext == WebGLExtensionID::Unknown) { + // We keep backward compatibility for these deprecated vendor-prefixed + // alias. Do not add new ones anymore. Hide it behind the + // webgl.enable-draft-extensions flag instead. + + if (CompareWebGLExtensionName(name, "MOZ_WEBGL_lose_context")) { + ext = WebGLExtensionID::WEBGL_lose_context; + + } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_compressed_texture_s3tc")) { + ext = WebGLExtensionID::WEBGL_compressed_texture_s3tc; + + } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_compressed_texture_atc")) { + ext = WebGLExtensionID::WEBGL_compressed_texture_atc; + + } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_compressed_texture_pvrtc")) { + ext = WebGLExtensionID::WEBGL_compressed_texture_pvrtc; + + } else if (CompareWebGLExtensionName(name, "MOZ_WEBGL_depth_texture")) { + ext = WebGLExtensionID::WEBGL_depth_texture; + } + + if (ext != WebGLExtensionID::Unknown) { + GenerateWarning("getExtension('%s'): MOZ_ prefixed WebGL extension" + " strings are deprecated. Support for them will be" + " removed in the future. Use unprefixed extension" + " strings. To get draft extensions, set the" + " webgl.enable-draft-extensions preference.", + name.get()); + } + } + + if (ext == WebGLExtensionID::Unknown) + return; + + // step 2: check if the extension is supported + if (!IsExtensionSupported(callerType, ext)) + return; + + // step 3: if the extension hadn't been previously been created, create it now, thus enabling it + WebGLExtensionBase* extObj = EnableSupportedExtension(callerType, ext); + if (!extObj) + return; + + // Step 4: Enable any implied extensions. + switch (ext) { + case WebGLExtensionID::OES_texture_float: + EnableSupportedExtension(callerType, + WebGLExtensionID::WEBGL_color_buffer_float); + break; + + case WebGLExtensionID::OES_texture_half_float: + EnableSupportedExtension(callerType, + WebGLExtensionID::EXT_color_buffer_half_float); + break; + + default: + break; + } + + retval.set(WebGLObjectAsJSObject(cx, extObj, rv)); +} + +void +WebGLContext::EnableExtension(WebGLExtensionID ext) +{ + MOZ_ASSERT(IsExtensionEnabled(ext) == false); + + WebGLExtensionBase* obj = nullptr; + switch (ext) { + // ANGLE_ + case WebGLExtensionID::ANGLE_instanced_arrays: + obj = new WebGLExtensionInstancedArrays(this); + break; + + // EXT_ + case WebGLExtensionID::EXT_blend_minmax: + obj = new WebGLExtensionBlendMinMax(this); + break; + case WebGLExtensionID::EXT_color_buffer_float: + obj = new WebGLExtensionEXTColorBufferFloat(this); + break; + case WebGLExtensionID::EXT_color_buffer_half_float: + obj = new WebGLExtensionColorBufferHalfFloat(this); + break; + case WebGLExtensionID::EXT_disjoint_timer_query: + obj = new WebGLExtensionDisjointTimerQuery(this); + break; + case WebGLExtensionID::EXT_frag_depth: + obj = new WebGLExtensionFragDepth(this); + break; + case WebGLExtensionID::EXT_shader_texture_lod: + obj = new WebGLExtensionShaderTextureLod(this); + break; + case WebGLExtensionID::EXT_sRGB: + obj = new WebGLExtensionSRGB(this); + break; + case WebGLExtensionID::EXT_texture_filter_anisotropic: + obj = new WebGLExtensionTextureFilterAnisotropic(this); + break; + + // OES_ + case WebGLExtensionID::OES_element_index_uint: + obj = new WebGLExtensionElementIndexUint(this); + break; + case WebGLExtensionID::OES_standard_derivatives: + obj = new WebGLExtensionStandardDerivatives(this); + break; + case WebGLExtensionID::OES_texture_float: + obj = new WebGLExtensionTextureFloat(this); + break; + case WebGLExtensionID::OES_texture_float_linear: + obj = new WebGLExtensionTextureFloatLinear(this); + break; + case WebGLExtensionID::OES_texture_half_float: + obj = new WebGLExtensionTextureHalfFloat(this); + break; + case WebGLExtensionID::OES_texture_half_float_linear: + obj = new WebGLExtensionTextureHalfFloatLinear(this); + break; + case WebGLExtensionID::OES_vertex_array_object: + obj = new WebGLExtensionVertexArray(this); + break; + + // WEBGL_ + case WebGLExtensionID::WEBGL_color_buffer_float: + obj = new WebGLExtensionColorBufferFloat(this); + break; + case WebGLExtensionID::WEBGL_compressed_texture_atc: + obj = new WebGLExtensionCompressedTextureATC(this); + break; + case WebGLExtensionID::WEBGL_compressed_texture_etc: + obj = new WebGLExtensionCompressedTextureES3(this); + break; + case WebGLExtensionID::WEBGL_compressed_texture_etc1: + obj = new WebGLExtensionCompressedTextureETC1(this); + break; + case WebGLExtensionID::WEBGL_compressed_texture_pvrtc: + obj = new WebGLExtensionCompressedTexturePVRTC(this); + break; + case WebGLExtensionID::WEBGL_compressed_texture_s3tc: + obj = new WebGLExtensionCompressedTextureS3TC(this); + break; + case WebGLExtensionID::WEBGL_debug_renderer_info: + obj = new WebGLExtensionDebugRendererInfo(this); + break; + case WebGLExtensionID::WEBGL_debug_shaders: + obj = new WebGLExtensionDebugShaders(this); + break; + case WebGLExtensionID::WEBGL_depth_texture: + obj = new WebGLExtensionDepthTexture(this); + break; + case WebGLExtensionID::WEBGL_draw_buffers: + obj = new WebGLExtensionDrawBuffers(this); + break; + case WebGLExtensionID::WEBGL_lose_context: + obj = new WebGLExtensionLoseContext(this); + break; + + default: + MOZ_ASSERT(false, "should not get there."); + } + + mExtensions[ext] = obj; +} + +void +WebGLContext::GetSupportedExtensions(dom::Nullable< nsTArray >& retval, + dom::CallerType callerType) +{ + retval.SetNull(); + if (IsContextLost()) + return; + + nsTArray& arr = retval.SetValue(); + + for (size_t i = 0; i < size_t(WebGLExtensionID::Max); i++) { + WebGLExtensionID extension = WebGLExtensionID(i); + + if (IsExtensionSupported(callerType, extension)) { + const char* extStr = GetExtensionString(extension); + arr.AppendElement(NS_ConvertUTF8toUTF16(extStr)); + } + } + + /** + * We keep backward compatibility for these deprecated vendor-prefixed + * alias. Do not add new ones anymore. Hide it behind the + * webgl.enable-draft-extensions flag instead. + */ + if (IsExtensionSupported(callerType, WebGLExtensionID::WEBGL_lose_context)) + arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_lose_context")); + if (IsExtensionSupported(callerType, + WebGLExtensionID::WEBGL_compressed_texture_s3tc)) + arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_s3tc")); + if (IsExtensionSupported(callerType, + WebGLExtensionID::WEBGL_compressed_texture_atc)) + arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_atc")); + if (IsExtensionSupported(callerType, + WebGLExtensionID::WEBGL_compressed_texture_pvrtc)) + arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_pvrtc")); + if (IsExtensionSupported(callerType, + WebGLExtensionID::WEBGL_depth_texture)) + arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_depth_texture")); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextFramebufferOperations.cpp b/dom/canvas/WebGLContextFramebufferOperations.cpp new file mode 100644 index 000000000..8b797d8a8 --- /dev/null +++ b/dom/canvas/WebGLContextFramebufferOperations.cpp @@ -0,0 +1,228 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" +#include "WebGLTexture.h" +#include "WebGLRenderbuffer.h" +#include "WebGLFramebuffer.h" +#include "GLContext.h" +#include "GLScreenBuffer.h" + +namespace mozilla { + +void +WebGLContext::Clear(GLbitfield mask) +{ + const char funcName[] = "clear"; + + if (IsContextLost()) + return; + + MakeContextCurrent(); + + uint32_t m = mask & (LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT | LOCAL_GL_STENCIL_BUFFER_BIT); + if (mask != m) + return ErrorInvalidValue("%s: invalid mask bits", funcName); + + if (mask == 0) { + GenerateWarning("Calling gl.clear(0) has no effect."); + } else if (mRasterizerDiscardEnabled) { + GenerateWarning("Calling gl.clear() with RASTERIZER_DISCARD enabled has no effects."); + } + + if (mBoundDrawFramebuffer) { + if (!mBoundDrawFramebuffer->ValidateAndInitAttachments(funcName)) + return; + + if (mask & LOCAL_GL_COLOR_BUFFER_BIT) { + for (const auto& cur : mBoundDrawFramebuffer->ColorDrawBuffers()) { + if (!cur->IsDefined()) + continue; + + switch (cur->Format()->format->componentType) { + case webgl::ComponentType::Float: + case webgl::ComponentType::NormInt: + case webgl::ComponentType::NormUInt: + break; + + default: + ErrorInvalidOperation("%s: Color draw buffers must be floating-point" + " or fixed-point. (normalized (u)ints)", + funcName); + return; + } + } + } + } + + ScopedDrawCallWrapper wrapper(*this); + gl->fClear(mask); +} + +static GLfloat +GLClampFloat(GLfloat val) +{ + if (val < 0.0) + return 0.0; + + if (val > 1.0) + return 1.0; + + return val; +} + +void +WebGLContext::ClearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) +{ + if (IsContextLost()) + return; + + MakeContextCurrent(); + + const bool supportsFloatColorBuffers = (IsExtensionEnabled(WebGLExtensionID::EXT_color_buffer_float) || + IsExtensionEnabled(WebGLExtensionID::EXT_color_buffer_half_float) || + IsExtensionEnabled(WebGLExtensionID::WEBGL_color_buffer_float)); + if (!supportsFloatColorBuffers) { + r = GLClampFloat(r); + g = GLClampFloat(g); + b = GLClampFloat(b); + a = GLClampFloat(a); + } + + gl->fClearColor(r, g, b, a); + + mColorClearValue[0] = r; + mColorClearValue[1] = g; + mColorClearValue[2] = b; + mColorClearValue[3] = a; +} + +void +WebGLContext::ClearDepth(GLclampf v) +{ + if (IsContextLost()) + return; + + MakeContextCurrent(); + mDepthClearValue = GLClampFloat(v); + gl->fClearDepth(mDepthClearValue); +} + +void +WebGLContext::ClearStencil(GLint v) +{ + if (IsContextLost()) + return; + + MakeContextCurrent(); + mStencilClearValue = v; + gl->fClearStencil(v); +} + +void +WebGLContext::ColorMask(WebGLboolean r, WebGLboolean g, WebGLboolean b, WebGLboolean a) +{ + if (IsContextLost()) + return; + + MakeContextCurrent(); + mColorWriteMask[0] = r; + mColorWriteMask[1] = g; + mColorWriteMask[2] = b; + mColorWriteMask[3] = a; + gl->fColorMask(r, g, b, a); +} + +void +WebGLContext::DepthMask(WebGLboolean b) +{ + if (IsContextLost()) + return; + + MakeContextCurrent(); + mDepthWriteMask = b; + gl->fDepthMask(b); +} + +void +WebGLContext::DrawBuffers(const dom::Sequence& buffers) +{ + const char funcName[] = "drawBuffers"; + if (IsContextLost()) + return; + + if (mBoundDrawFramebuffer) { + mBoundDrawFramebuffer->DrawBuffers(funcName, buffers); + return; + } + + // GLES 3.0.4 p186: + // "If the GL is bound to the default framebuffer, then `n` must be 1 and the + // constant must be BACK or NONE. [...] If DrawBuffers is supplied with a + // constant other than BACK and NONE, or with a value of `n` other than 1, the + // error INVALID_OPERATION is generated." + if (buffers.Length() != 1) { + ErrorInvalidOperation("%s: For the default framebuffer, `buffers` must have a" + " length of 1.", + funcName); + return; + } + + switch (buffers[0]) { + case LOCAL_GL_NONE: + case LOCAL_GL_BACK: + break; + + default: + ErrorInvalidOperation("%s: For the default framebuffer, `buffers[0]` must be" + " BACK or NONE.", + funcName); + return; + } + + mDefaultFB_DrawBuffer0 = buffers[0]; + gl->Screen()->SetDrawBuffer(buffers[0]); +} + +void +WebGLContext::StencilMask(GLuint mask) +{ + if (IsContextLost()) + return; + + mStencilWriteMaskFront = mask; + mStencilWriteMaskBack = mask; + + MakeContextCurrent(); + gl->fStencilMask(mask); +} + +void +WebGLContext::StencilMaskSeparate(GLenum face, GLuint mask) +{ + if (IsContextLost()) + return; + + if (!ValidateFaceEnum(face, "stencilMaskSeparate: face")) + return; + + switch (face) { + case LOCAL_GL_FRONT_AND_BACK: + mStencilWriteMaskFront = mask; + mStencilWriteMaskBack = mask; + break; + case LOCAL_GL_FRONT: + mStencilWriteMaskFront = mask; + break; + case LOCAL_GL_BACK: + mStencilWriteMaskBack = mask; + break; + } + + MakeContextCurrent(); + gl->fStencilMaskSeparate(face, mask); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp new file mode 100644 index 000000000..e58fcd0d8 --- /dev/null +++ b/dom/canvas/WebGLContextGL.cpp @@ -0,0 +1,2367 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" +#include "WebGL2Context.h" + +#include "WebGLActiveInfo.h" +#include "WebGLContextUtils.h" +#include "WebGLBuffer.h" +#include "WebGLVertexAttribData.h" +#include "WebGLShader.h" +#include "WebGLProgram.h" +#include "WebGLUniformLocation.h" +#include "WebGLFormats.h" +#include "WebGLFramebuffer.h" +#include "WebGLRenderbuffer.h" +#include "WebGLShaderPrecisionFormat.h" +#include "WebGLTexture.h" +#include "WebGLExtensions.h" +#include "WebGLVertexArray.h" + +#include "nsDebug.h" +#include "nsReadableUtils.h" +#include "nsString.h" + +#include "gfxContext.h" +#include "gfxPlatform.h" +#include "GLContext.h" + +#include "nsContentUtils.h" +#include "nsError.h" +#include "nsLayoutUtils.h" + +#include "CanvasUtils.h" +#include "gfxUtils.h" + +#include "jsfriendapi.h" + +#include "WebGLTexelConversions.h" +#include "WebGLValidateStrings.h" +#include + +// needed to check if current OS is lower than 10.7 +#if defined(MOZ_WIDGET_COCOA) +#include "nsCocoaFeatures.h" +#endif + +#include "mozilla/DebugOnly.h" +#include "mozilla/dom/BindingUtils.h" +#include "mozilla/dom/ImageData.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/EndianUtils.h" +#include "mozilla/RefPtr.h" +#include "mozilla/UniquePtrExtensions.h" + +namespace mozilla { + +bool +WebGLContext::ValidateObject(const char* funcName, const WebGLProgram& object) +{ + return ValidateObject(funcName, object, true); +} + +bool +WebGLContext::ValidateObject(const char* funcName, const WebGLShader& object) +{ + return ValidateObject(funcName, object, true); +} + +using namespace mozilla::dom; +using namespace mozilla::gfx; +using namespace mozilla::gl; + +// +// WebGL API +// + +void +WebGLContext::ActiveTexture(GLenum texture) +{ + if (IsContextLost()) + return; + + if (texture < LOCAL_GL_TEXTURE0 || + texture >= LOCAL_GL_TEXTURE0 + uint32_t(mGLMaxTextureUnits)) + { + return ErrorInvalidEnum( + "ActiveTexture: texture unit %d out of range. " + "Accepted values range from TEXTURE0 to TEXTURE0 + %d. " + "Notice that TEXTURE0 != 0.", + texture, mGLMaxTextureUnits); + } + + MakeContextCurrent(); + mActiveTexture = texture - LOCAL_GL_TEXTURE0; + gl->fActiveTexture(texture); +} + +void +WebGLContext::AttachShader(WebGLProgram& program, WebGLShader& shader) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("attachShader: program", program) || + !ValidateObject("attachShader: shader", shader)) + { + return; + } + + program.AttachShader(&shader); +} + +void +WebGLContext::BindAttribLocation(WebGLProgram& prog, GLuint location, + const nsAString& name) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("bindAttribLocation: program", prog)) + return; + + prog.BindAttribLocation(location, name); +} + +void +WebGLContext::BindFramebuffer(GLenum target, WebGLFramebuffer* wfb) +{ + if (IsContextLost()) + return; + + if (!ValidateFramebufferTarget(target, "bindFramebuffer")) + return; + + if (wfb && !ValidateObject("bindFramebuffer", *wfb)) + return; + + MakeContextCurrent(); + + if (!wfb) { + gl->fBindFramebuffer(target, 0); + } else { + GLuint framebuffername = wfb->mGLName; + gl->fBindFramebuffer(target, framebuffername); +#ifdef ANDROID + wfb->mIsFB = true; +#endif + } + + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + mBoundDrawFramebuffer = wfb; + mBoundReadFramebuffer = wfb; + break; + case LOCAL_GL_DRAW_FRAMEBUFFER: + mBoundDrawFramebuffer = wfb; + break; + case LOCAL_GL_READ_FRAMEBUFFER: + mBoundReadFramebuffer = wfb; + break; + default: + break; + } +} + +void +WebGLContext::BindRenderbuffer(GLenum target, WebGLRenderbuffer* wrb) +{ + if (IsContextLost()) + return; + + if (target != LOCAL_GL_RENDERBUFFER) + return ErrorInvalidEnumInfo("bindRenderbuffer: target", target); + + if (wrb && !ValidateObject("bindRenderbuffer", *wrb)) + return; + + // Usually, we would now call into glBindRenderbuffer. However, since we have to + // potentially emulate packed-depth-stencil, there's not a specific renderbuffer that + // we know we should bind here. + // Instead, we do all renderbuffer binding lazily. + + if (wrb) { + wrb->mHasBeenBound = true; + } + + mBoundRenderbuffer = wrb; +} + +void WebGLContext::BlendEquation(GLenum mode) +{ + if (IsContextLost()) + return; + + if (!ValidateBlendEquationEnum(mode, "blendEquation: mode")) + return; + + MakeContextCurrent(); + gl->fBlendEquation(mode); +} + +void WebGLContext::BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) +{ + if (IsContextLost()) + return; + + if (!ValidateBlendEquationEnum(modeRGB, "blendEquationSeparate: modeRGB") || + !ValidateBlendEquationEnum(modeAlpha, "blendEquationSeparate: modeAlpha")) + return; + + MakeContextCurrent(); + gl->fBlendEquationSeparate(modeRGB, modeAlpha); +} + +void WebGLContext::BlendFunc(GLenum sfactor, GLenum dfactor) +{ + if (IsContextLost()) + return; + + if (!ValidateBlendFuncSrcEnum(sfactor, "blendFunc: sfactor") || + !ValidateBlendFuncDstEnum(dfactor, "blendFunc: dfactor")) + return; + + if (!ValidateBlendFuncEnumsCompatibility(sfactor, dfactor, "blendFuncSeparate: srcRGB and dstRGB")) + return; + + MakeContextCurrent(); + gl->fBlendFunc(sfactor, dfactor); +} + +void +WebGLContext::BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, + GLenum srcAlpha, GLenum dstAlpha) +{ + if (IsContextLost()) + return; + + if (!ValidateBlendFuncSrcEnum(srcRGB, "blendFuncSeparate: srcRGB") || + !ValidateBlendFuncSrcEnum(srcAlpha, "blendFuncSeparate: srcAlpha") || + !ValidateBlendFuncDstEnum(dstRGB, "blendFuncSeparate: dstRGB") || + !ValidateBlendFuncDstEnum(dstAlpha, "blendFuncSeparate: dstAlpha")) + return; + + // note that we only check compatibity for the RGB enums, no need to for the Alpha enums, see + // "Section 6.8 forgetting to mention alpha factors?" thread on the public_webgl mailing list + if (!ValidateBlendFuncEnumsCompatibility(srcRGB, dstRGB, "blendFuncSeparate: srcRGB and dstRGB")) + return; + + MakeContextCurrent(); + gl->fBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); +} + +GLenum +WebGLContext::CheckFramebufferStatus(GLenum target) +{ + const char funcName[] = "checkFramebufferStatus"; + if (IsContextLost()) + return LOCAL_GL_FRAMEBUFFER_UNSUPPORTED; + + if (!ValidateFramebufferTarget(target, funcName)) + return 0; + + WebGLFramebuffer* fb; + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + case LOCAL_GL_DRAW_FRAMEBUFFER: + fb = mBoundDrawFramebuffer; + break; + + case LOCAL_GL_READ_FRAMEBUFFER: + fb = mBoundReadFramebuffer; + break; + + default: + MOZ_CRASH("GFX: Bad target."); + } + + if (!fb) + return LOCAL_GL_FRAMEBUFFER_COMPLETE; + + return fb->CheckFramebufferStatus(funcName).get(); +} + +already_AddRefed +WebGLContext::CreateProgram() +{ + if (IsContextLost()) + return nullptr; + RefPtr globj = new WebGLProgram(this); + return globj.forget(); +} + +already_AddRefed +WebGLContext::CreateShader(GLenum type) +{ + if (IsContextLost()) + return nullptr; + + if (type != LOCAL_GL_VERTEX_SHADER && + type != LOCAL_GL_FRAGMENT_SHADER) + { + ErrorInvalidEnumInfo("createShader: type", type); + return nullptr; + } + + RefPtr shader = new WebGLShader(this, type); + return shader.forget(); +} + +void +WebGLContext::CullFace(GLenum face) +{ + if (IsContextLost()) + return; + + if (!ValidateFaceEnum(face, "cullFace")) + return; + + MakeContextCurrent(); + gl->fCullFace(face); +} + +void +WebGLContext::DeleteFramebuffer(WebGLFramebuffer* fbuf) +{ + if (!ValidateDeleteObject("deleteFramebuffer", fbuf)) + return; + + fbuf->RequestDelete(); + + if (mBoundReadFramebuffer == mBoundDrawFramebuffer) { + if (mBoundDrawFramebuffer == fbuf) { + BindFramebuffer(LOCAL_GL_FRAMEBUFFER, + static_cast(nullptr)); + } + } else if (mBoundDrawFramebuffer == fbuf) { + BindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER, + static_cast(nullptr)); + } else if (mBoundReadFramebuffer == fbuf) { + BindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER, + static_cast(nullptr)); + } +} + +void +WebGLContext::DeleteRenderbuffer(WebGLRenderbuffer* rbuf) +{ + if (!ValidateDeleteObject("deleteRenderbuffer", rbuf)) + return; + + if (mBoundDrawFramebuffer) + mBoundDrawFramebuffer->DetachRenderbuffer(rbuf); + + if (mBoundReadFramebuffer) + mBoundReadFramebuffer->DetachRenderbuffer(rbuf); + + rbuf->InvalidateStatusOfAttachedFBs(); + + if (mBoundRenderbuffer == rbuf) + BindRenderbuffer(LOCAL_GL_RENDERBUFFER, nullptr); + + rbuf->RequestDelete(); +} + +void +WebGLContext::DeleteTexture(WebGLTexture* tex) +{ + if (!ValidateDeleteObject("deleteTexture", tex)) + return; + + if (mBoundDrawFramebuffer) + mBoundDrawFramebuffer->DetachTexture(tex); + + if (mBoundReadFramebuffer) + mBoundReadFramebuffer->DetachTexture(tex); + + GLuint activeTexture = mActiveTexture; + for (int32_t i = 0; i < mGLMaxTextureUnits; i++) { + if (mBound2DTextures[i] == tex || + mBoundCubeMapTextures[i] == tex || + mBound3DTextures[i] == tex || + mBound2DArrayTextures[i] == tex) + { + ActiveTexture(LOCAL_GL_TEXTURE0 + i); + BindTexture(tex->Target().get(), nullptr); + } + } + ActiveTexture(LOCAL_GL_TEXTURE0 + activeTexture); + + tex->RequestDelete(); +} + +void +WebGLContext::DeleteProgram(WebGLProgram* prog) +{ + if (!ValidateDeleteObject("deleteProgram", prog)) + return; + + prog->RequestDelete(); +} + +void +WebGLContext::DeleteShader(WebGLShader* shader) +{ + if (!ValidateDeleteObject("deleteShader", shader)) + return; + + shader->RequestDelete(); +} + +void +WebGLContext::DetachShader(WebGLProgram& program, const WebGLShader& shader) +{ + if (IsContextLost()) + return; + + // It's valid to attempt to detach a deleted shader, since it's still a + // shader. + if (!ValidateObject("detachShader: program", program) || + !ValidateObjectAllowDeleted("detachShader: shader", shader)) + { + return; + } + + program.DetachShader(&shader); +} + +void +WebGLContext::DepthFunc(GLenum func) +{ + if (IsContextLost()) + return; + + if (!ValidateComparisonEnum(func, "depthFunc")) + return; + + MakeContextCurrent(); + gl->fDepthFunc(func); +} + +void +WebGLContext::DepthRange(GLfloat zNear, GLfloat zFar) +{ + if (IsContextLost()) + return; + + if (zNear > zFar) + return ErrorInvalidOperation("depthRange: the near value is greater than the far value!"); + + MakeContextCurrent(); + gl->fDepthRange(zNear, zFar); +} + +void +WebGLContext::FramebufferRenderbuffer(GLenum target, GLenum attachment, + GLenum rbtarget, WebGLRenderbuffer* wrb) +{ + const char funcName[] = "framebufferRenderbuffer"; + if (IsContextLost()) + return; + + if (!ValidateFramebufferTarget(target, funcName)) + return; + + WebGLFramebuffer* fb; + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + case LOCAL_GL_DRAW_FRAMEBUFFER: + fb = mBoundDrawFramebuffer; + break; + + case LOCAL_GL_READ_FRAMEBUFFER: + fb = mBoundReadFramebuffer; + break; + + default: + MOZ_CRASH("GFX: Bad target."); + } + + if (!fb) + return ErrorInvalidOperation("%s: Cannot modify framebuffer 0.", funcName); + + fb->FramebufferRenderbuffer(funcName, attachment, rbtarget, wrb); +} + +void +WebGLContext::FramebufferTexture2D(GLenum target, + GLenum attachment, + GLenum textarget, + WebGLTexture* tobj, + GLint level) +{ + const char funcName[] = "framebufferTexture2D"; + if (IsContextLost()) + return; + + if (!ValidateFramebufferTarget(target, funcName)) + return; + + WebGLFramebuffer* fb; + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + case LOCAL_GL_DRAW_FRAMEBUFFER: + fb = mBoundDrawFramebuffer; + break; + + case LOCAL_GL_READ_FRAMEBUFFER: + fb = mBoundReadFramebuffer; + break; + + default: + MOZ_CRASH("GFX: Bad target."); + } + + if (!fb) + return ErrorInvalidOperation("%s: Cannot modify framebuffer 0.", funcName); + + fb->FramebufferTexture2D(funcName, attachment, textarget, tobj, level); +} + +void +WebGLContext::FrontFace(GLenum mode) +{ + if (IsContextLost()) + return; + + switch (mode) { + case LOCAL_GL_CW: + case LOCAL_GL_CCW: + break; + default: + return ErrorInvalidEnumInfo("frontFace: mode", mode); + } + + MakeContextCurrent(); + gl->fFrontFace(mode); +} + +already_AddRefed +WebGLContext::GetActiveAttrib(const WebGLProgram& prog, GLuint index) +{ + if (IsContextLost()) + return nullptr; + + if (!ValidateObject("getActiveAttrib: program", prog)) + return nullptr; + + return prog.GetActiveAttrib(index); +} + +already_AddRefed +WebGLContext::GetActiveUniform(const WebGLProgram& prog, GLuint index) +{ + if (IsContextLost()) + return nullptr; + + if (!ValidateObject("getActiveUniform: program", prog)) + return nullptr; + + return prog.GetActiveUniform(index); +} + +void +WebGLContext::GetAttachedShaders(const WebGLProgram& prog, + dom::Nullable>>& retval) +{ + retval.SetNull(); + if (IsContextLost()) + return; + + if (!ValidateObject("getAttachedShaders", prog)) + return; + + prog.GetAttachedShaders(&retval.SetValue()); +} + +GLint +WebGLContext::GetAttribLocation(const WebGLProgram& prog, const nsAString& name) +{ + if (IsContextLost()) + return -1; + + if (!ValidateObject("getAttribLocation: program", prog)) + return -1; + + return prog.GetAttribLocation(name); +} + +JS::Value +WebGLContext::GetBufferParameter(GLenum target, GLenum pname) +{ + const char funcName[] = "getBufferParameter"; + if (IsContextLost()) + return JS::NullValue(); + + const auto& slot = ValidateBufferSlot(funcName, target); + if (!slot) + return JS::NullValue(); + const auto& buffer = *slot; + + if (!buffer) { + ErrorInvalidOperation("%s: Buffer for `target` is null.", funcName); + return JS::NullValue(); + } + + switch (pname) { + case LOCAL_GL_BUFFER_SIZE: + return JS::NumberValue(buffer->ByteLength()); + + case LOCAL_GL_BUFFER_USAGE: + return JS::NumberValue(buffer->Usage()); + + default: + ErrorInvalidEnumInfo("getBufferParameter: parameter", pname); + return JS::NullValue(); + } +} + +JS::Value +WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx, + GLenum target, + GLenum attachment, + GLenum pname, + ErrorResult& rv) +{ + const char funcName[] = "getFramebufferAttachmentParameter"; + + if (IsContextLost()) + return JS::NullValue(); + + if (!ValidateFramebufferTarget(target, funcName)) + return JS::NullValue(); + + WebGLFramebuffer* fb; + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + case LOCAL_GL_DRAW_FRAMEBUFFER: + fb = mBoundDrawFramebuffer; + break; + + case LOCAL_GL_READ_FRAMEBUFFER: + fb = mBoundReadFramebuffer; + break; + + default: + MOZ_CRASH("GFX: Bad target."); + } + + MakeContextCurrent(); + + if (fb) + return fb->GetAttachmentParameter(funcName, cx, target, attachment, pname, &rv); + + //////////////////////////////////// + + if (!IsWebGL2()) { + ErrorInvalidOperation("%s: Querying against the default framebuffer is not" + " allowed in WebGL 1.", + funcName); + return JS::NullValue(); + } + + switch (attachment) { + case LOCAL_GL_BACK: + case LOCAL_GL_DEPTH: + case LOCAL_GL_STENCIL: + break; + + default: + ErrorInvalidEnum("%s: For the default framebuffer, can only query COLOR, DEPTH," + " or STENCIL.", + funcName); + return JS::NullValue(); + } + + switch (pname) { + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: + switch (attachment) { + case LOCAL_GL_BACK: + break; + case LOCAL_GL_DEPTH: + if (!mOptions.depth) { + return JS::Int32Value(LOCAL_GL_NONE); + } + break; + case LOCAL_GL_STENCIL: + if (!mOptions.stencil) { + return JS::Int32Value(LOCAL_GL_NONE); + } + break; + default: + ErrorInvalidEnum("%s: With the default framebuffer, can only query COLOR, DEPTH," + " or STENCIL for GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", + funcName); + return JS::NullValue(); + } + return JS::Int32Value(LOCAL_GL_FRAMEBUFFER_DEFAULT); + + //////////////// + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + if (attachment == LOCAL_GL_BACK) + return JS::NumberValue(8); + return JS::NumberValue(0); + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + if (attachment == LOCAL_GL_BACK) { + if (mOptions.alpha) { + return JS::NumberValue(8); + } + ErrorInvalidOperation("The default framebuffer doesn't contain an alpha buffer"); + return JS::NullValue(); + } + return JS::NumberValue(0); + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + if (attachment == LOCAL_GL_DEPTH) { + if (mOptions.depth) { + return JS::NumberValue(24); + } + ErrorInvalidOperation("The default framebuffer doesn't contain an depth buffer"); + return JS::NullValue(); + } + return JS::NumberValue(0); + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + if (attachment == LOCAL_GL_STENCIL) { + if (mOptions.stencil) { + return JS::NumberValue(8); + } + ErrorInvalidOperation("The default framebuffer doesn't contain an stencil buffer"); + return JS::NullValue(); + } + return JS::NumberValue(0); + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: + if (attachment == LOCAL_GL_STENCIL) { + if (mOptions.stencil) { + return JS::NumberValue(LOCAL_GL_UNSIGNED_INT); + } + ErrorInvalidOperation("The default framebuffer doesn't contain an stencil buffer"); + } else if (attachment == LOCAL_GL_DEPTH) { + if (mOptions.depth) { + return JS::NumberValue(LOCAL_GL_UNSIGNED_NORMALIZED); + } + ErrorInvalidOperation("The default framebuffer doesn't contain an depth buffer"); + } else { // LOCAL_GL_BACK + return JS::NumberValue(LOCAL_GL_UNSIGNED_NORMALIZED); + } + return JS::NullValue(); + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: + if (attachment == LOCAL_GL_STENCIL) { + if (!mOptions.stencil) { + ErrorInvalidOperation("The default framebuffer doesn't contain an stencil buffer"); + return JS::NullValue(); + } + } else if (attachment == LOCAL_GL_DEPTH) { + if (!mOptions.depth) { + ErrorInvalidOperation("The default framebuffer doesn't contain an depth buffer"); + return JS::NullValue(); + } + } + return JS::NumberValue(LOCAL_GL_LINEAR); + } + + ErrorInvalidEnum("%s: Invalid pname: 0x%04x", funcName, pname); + return JS::NullValue(); +} + +JS::Value +WebGLContext::GetRenderbufferParameter(GLenum target, GLenum pname) +{ + if (IsContextLost()) + return JS::NullValue(); + + if (target != LOCAL_GL_RENDERBUFFER) { + ErrorInvalidEnumInfo("getRenderbufferParameter: target", target); + return JS::NullValue(); + } + + if (!mBoundRenderbuffer) { + ErrorInvalidOperation("getRenderbufferParameter: no render buffer is bound"); + return JS::NullValue(); + } + + MakeContextCurrent(); + + switch (pname) { + case LOCAL_GL_RENDERBUFFER_SAMPLES: + if (!IsWebGL2()) + break; + MOZ_FALLTHROUGH; + + case LOCAL_GL_RENDERBUFFER_WIDTH: + case LOCAL_GL_RENDERBUFFER_HEIGHT: + case LOCAL_GL_RENDERBUFFER_RED_SIZE: + case LOCAL_GL_RENDERBUFFER_GREEN_SIZE: + case LOCAL_GL_RENDERBUFFER_BLUE_SIZE: + case LOCAL_GL_RENDERBUFFER_ALPHA_SIZE: + case LOCAL_GL_RENDERBUFFER_DEPTH_SIZE: + case LOCAL_GL_RENDERBUFFER_STENCIL_SIZE: + case LOCAL_GL_RENDERBUFFER_INTERNAL_FORMAT: + { + // RB emulation means we have to ask the RB itself. + GLint i = mBoundRenderbuffer->GetRenderbufferParameter(target, pname); + return JS::Int32Value(i); + } + + default: + break; + } + + ErrorInvalidEnumInfo("getRenderbufferParameter: parameter", pname); + return JS::NullValue(); +} + +already_AddRefed +WebGLContext::CreateTexture() +{ + if (IsContextLost()) + return nullptr; + + GLuint tex = 0; + MakeContextCurrent(); + gl->fGenTextures(1, &tex); + + RefPtr globj = new WebGLTexture(this, tex); + return globj.forget(); +} + +static GLenum +GetAndClearError(GLenum* errorVar) +{ + MOZ_ASSERT(errorVar); + GLenum ret = *errorVar; + *errorVar = LOCAL_GL_NO_ERROR; + return ret; +} + +GLenum +WebGLContext::GetError() +{ + /* WebGL 1.0: Section 5.14.3: Setting and getting state: + * If the context's webgl context lost flag is set, returns + * CONTEXT_LOST_WEBGL the first time this method is called. + * Afterward, returns NO_ERROR until the context has been + * restored. + * + * WEBGL_lose_context: + * [When this extension is enabled: ] loseContext and + * restoreContext are allowed to generate INVALID_OPERATION errors + * even when the context is lost. + */ + + if (IsContextLost()) { + if (mEmitContextLostErrorOnce) { + mEmitContextLostErrorOnce = false; + return LOCAL_GL_CONTEXT_LOST; + } + // Don't return yet, since WEBGL_lose_contexts contradicts the + // original spec, and allows error generation while lost. + } + + GLenum err = GetAndClearError(&mWebGLError); + if (err != LOCAL_GL_NO_ERROR) + return err; + + if (IsContextLost()) + return LOCAL_GL_NO_ERROR; + + // Either no WebGL-side error, or it's already been cleared. + // UnderlyingGL-side errors, now. + + MakeContextCurrent(); + GetAndFlushUnderlyingGLErrors(); + + err = GetAndClearError(&mUnderlyingGLError); + return err; +} + +JS::Value +WebGLContext::GetProgramParameter(const WebGLProgram& prog, GLenum pname) +{ + if (IsContextLost()) + return JS::NullValue(); + + if (!ValidateObjectAllowDeleted("getProgramParameter: program", prog)) + return JS::NullValue(); + + return prog.GetProgramParameter(pname); +} + +void +WebGLContext::GetProgramInfoLog(const WebGLProgram& prog, nsAString& retval) +{ + retval.SetIsVoid(true); + + if (IsContextLost()) + return; + + if (!ValidateObject("getProgramInfoLog: program", prog)) + return; + + prog.GetProgramInfoLog(&retval); +} + +JS::Value +WebGLContext::GetUniform(JSContext* js, const WebGLProgram& prog, + const WebGLUniformLocation& loc) +{ + if (IsContextLost()) + return JS::NullValue(); + + if (!ValidateObject("getUniform: `program`", prog)) + return JS::NullValue(); + + if (!ValidateObjectAllowDeleted("getUniform: `location`", loc)) + return JS::NullValue(); + + if (!loc.ValidateForProgram(&prog, "getUniform")) + return JS::NullValue(); + + return loc.GetUniform(js); +} + +already_AddRefed +WebGLContext::GetUniformLocation(const WebGLProgram& prog, const nsAString& name) +{ + if (IsContextLost()) + return nullptr; + + if (!ValidateObject("getUniformLocation: program", prog)) + return nullptr; + + return prog.GetUniformLocation(name); +} + +void +WebGLContext::Hint(GLenum target, GLenum mode) +{ + if (IsContextLost()) + return; + + bool isValid = false; + + switch (target) { + case LOCAL_GL_GENERATE_MIPMAP_HINT: + mGenerateMipmapHint = mode; + + // Deprecated and removed in desktop GL Core profiles. + if (gl->IsCoreProfile()) + return; + + isValid = true; + break; + + case LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT: + if (IsWebGL2() || + IsExtensionEnabled(WebGLExtensionID::OES_standard_derivatives)) + { + isValid = true; + } + break; + } + + if (!isValid) + return ErrorInvalidEnum("hint: invalid hint"); + + MakeContextCurrent(); + gl->fHint(target, mode); +} + +bool +WebGLContext::IsFramebuffer(const WebGLFramebuffer* fb) +{ + if (!ValidateIsObject("isFramebuffer", fb)) + return false; + +#ifdef ANDROID + if (gl->WorkAroundDriverBugs() && + gl->Renderer() == GLRenderer::AndroidEmulator) + { + return fb->mIsFB; + } +#endif + + MakeContextCurrent(); + return gl->fIsFramebuffer(fb->mGLName); +} + +bool +WebGLContext::IsProgram(const WebGLProgram* prog) +{ + if (!ValidateIsObject("isProgram", prog)) + return false; + + return true; +} + +bool +WebGLContext::IsRenderbuffer(const WebGLRenderbuffer* rb) +{ + if (!ValidateIsObject("isRenderbuffer", rb)) + return false; + + return rb->mHasBeenBound; +} + +bool +WebGLContext::IsShader(const WebGLShader* shader) +{ + if (!ValidateIsObject("isShader", shader)) + return false; + + return true; +} + +void +WebGLContext::LinkProgram(WebGLProgram& prog) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("linkProgram", prog)) + return; + + prog.LinkProgram(); + + if (!prog.IsLinked()) { + // If we failed to link, but `prog == mCurrentProgram`, we are *not* supposed to + // null out mActiveProgramLinkInfo. + return; + } + + if (&prog == mCurrentProgram) { + mActiveProgramLinkInfo = prog.LinkInfo(); + + if (gl->WorkAroundDriverBugs() && + gl->Vendor() == gl::GLVendor::NVIDIA) + { + gl->fUseProgram(prog.mGLName); + } + } +} + +void +WebGLContext::PixelStorei(GLenum pname, GLint param) +{ + if (IsContextLost()) + return; + + if (IsWebGL2()) { + uint32_t* pValueSlot = nullptr; + switch (pname) { + case LOCAL_GL_UNPACK_IMAGE_HEIGHT: + pValueSlot = &mPixelStore_UnpackImageHeight; + break; + + case LOCAL_GL_UNPACK_SKIP_IMAGES: + pValueSlot = &mPixelStore_UnpackSkipImages; + break; + + case LOCAL_GL_UNPACK_ROW_LENGTH: + pValueSlot = &mPixelStore_UnpackRowLength; + break; + + case LOCAL_GL_UNPACK_SKIP_ROWS: + pValueSlot = &mPixelStore_UnpackSkipRows; + break; + + case LOCAL_GL_UNPACK_SKIP_PIXELS: + pValueSlot = &mPixelStore_UnpackSkipPixels; + break; + + case LOCAL_GL_PACK_ROW_LENGTH: + pValueSlot = &mPixelStore_PackRowLength; + break; + + case LOCAL_GL_PACK_SKIP_ROWS: + pValueSlot = &mPixelStore_PackSkipRows; + break; + + case LOCAL_GL_PACK_SKIP_PIXELS: + pValueSlot = &mPixelStore_PackSkipPixels; + break; + } + + if (pValueSlot) { + if (param < 0) { + ErrorInvalidValue("pixelStorei: param must be >= 0."); + return; + } + + MakeContextCurrent(); + gl->fPixelStorei(pname, param); + *pValueSlot = param; + return; + } + } + + switch (pname) { + case UNPACK_FLIP_Y_WEBGL: + mPixelStore_FlipY = bool(param); + return; + + case UNPACK_PREMULTIPLY_ALPHA_WEBGL: + mPixelStore_PremultiplyAlpha = bool(param); + return; + + case UNPACK_COLORSPACE_CONVERSION_WEBGL: + switch (param) { + case LOCAL_GL_NONE: + case BROWSER_DEFAULT_WEBGL: + mPixelStore_ColorspaceConversion = param; + return; + + default: + ErrorInvalidEnumInfo("pixelStorei: colorspace conversion parameter", + param); + return; + } + + case LOCAL_GL_PACK_ALIGNMENT: + case LOCAL_GL_UNPACK_ALIGNMENT: + switch (param) { + case 1: + case 2: + case 4: + case 8: + if (pname == LOCAL_GL_PACK_ALIGNMENT) + mPixelStore_PackAlignment = param; + else if (pname == LOCAL_GL_UNPACK_ALIGNMENT) + mPixelStore_UnpackAlignment = param; + + MakeContextCurrent(); + gl->fPixelStorei(pname, param); + return; + + default: + ErrorInvalidValue("pixelStorei: invalid pack/unpack alignment value"); + return; + } + + + + default: + break; + } + + ErrorInvalidEnumInfo("pixelStorei: parameter", pname); +} + +bool +WebGLContext::DoReadPixelsAndConvert(const webgl::FormatInfo* srcFormat, GLint x, GLint y, + GLsizei width, GLsizei height, GLenum format, + GLenum destType, void* dest, uint32_t destSize, + uint32_t rowStride) +{ + // On at least Win+NV, we'll get PBO errors if we don't have at least + // `rowStride * height` bytes available to read into. + const auto naiveBytesNeeded = CheckedUint32(rowStride) * height; + const bool isDangerCloseToEdge = (!naiveBytesNeeded.isValid() || + naiveBytesNeeded.value() > destSize); + const bool useParanoidHandling = (gl->WorkAroundDriverBugs() && + isDangerCloseToEdge && + mBoundPixelPackBuffer); + if (!useParanoidHandling) { + gl->fReadPixels(x, y, width, height, format, destType, dest); + return true; + } + + // Read everything but the last row. + const auto bodyHeight = height - 1; + if (bodyHeight) { + gl->fReadPixels(x, y, width, bodyHeight, format, destType, dest); + } + + // Now read the last row. + gl->fPixelStorei(LOCAL_GL_PACK_ALIGNMENT, 1); + gl->fPixelStorei(LOCAL_GL_PACK_ROW_LENGTH, 0); + gl->fPixelStorei(LOCAL_GL_PACK_SKIP_ROWS, 0); + + const auto tailRowOffset = (char*)dest + rowStride * bodyHeight; + gl->fReadPixels(x, y+bodyHeight, width, 1, format, destType, tailRowOffset); + + gl->fPixelStorei(LOCAL_GL_PACK_ALIGNMENT, mPixelStore_PackAlignment); + gl->fPixelStorei(LOCAL_GL_PACK_ROW_LENGTH, mPixelStore_PackRowLength); + gl->fPixelStorei(LOCAL_GL_PACK_SKIP_ROWS, mPixelStore_PackSkipRows); + return true; +} + +static bool +GetJSScalarFromGLType(GLenum type, js::Scalar::Type* const out_scalarType) +{ + switch (type) { + case LOCAL_GL_BYTE: + *out_scalarType = js::Scalar::Int8; + return true; + + case LOCAL_GL_UNSIGNED_BYTE: + *out_scalarType = js::Scalar::Uint8; + return true; + + case LOCAL_GL_SHORT: + *out_scalarType = js::Scalar::Int16; + return true; + + case LOCAL_GL_HALF_FLOAT: + case LOCAL_GL_HALF_FLOAT_OES: + case LOCAL_GL_UNSIGNED_SHORT: + case LOCAL_GL_UNSIGNED_SHORT_4_4_4_4: + case LOCAL_GL_UNSIGNED_SHORT_5_5_5_1: + case LOCAL_GL_UNSIGNED_SHORT_5_6_5: + *out_scalarType = js::Scalar::Uint16; + return true; + + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV: + case LOCAL_GL_UNSIGNED_INT_5_9_9_9_REV: + case LOCAL_GL_UNSIGNED_INT_10F_11F_11F_REV: + case LOCAL_GL_UNSIGNED_INT_24_8: + *out_scalarType = js::Scalar::Uint32; + return true; + case LOCAL_GL_INT: + *out_scalarType = js::Scalar::Int32; + return true; + + case LOCAL_GL_FLOAT: + *out_scalarType = js::Scalar::Float32; + return true; + + default: + return false; + } +} + +bool +WebGLContext::ReadPixels_SharedPrecheck(ErrorResult* const out_error) +{ + if (IsContextLost()) + return false; + + if (mCanvasElement && + mCanvasElement->IsWriteOnly() && + !nsContentUtils::IsCallerChrome()) + { + GenerateWarning("readPixels: Not allowed"); + out_error->Throw(NS_ERROR_DOM_SECURITY_ERR); + return false; + } + + return true; +} + +bool +WebGLContext::ValidatePackSize(const char* funcName, uint32_t width, uint32_t height, + uint8_t bytesPerPixel, uint32_t* const out_rowStride, + uint32_t* const out_endOffset) +{ + if (!width || !height) { + *out_rowStride = 0; + *out_endOffset = 0; + return true; + } + + // GLES 3.0.4, p116 (PACK_ functions like UNPACK_) + + const auto rowLength = (mPixelStore_PackRowLength ? mPixelStore_PackRowLength + : width); + const auto skipPixels = mPixelStore_PackSkipPixels; + const auto skipRows = mPixelStore_PackSkipRows; + const auto alignment = mPixelStore_PackAlignment; + + const auto usedPixelsPerRow = CheckedUint32(skipPixels) + width; + const auto usedRowsPerImage = CheckedUint32(skipRows) + height; + + if (!usedPixelsPerRow.isValid() || usedPixelsPerRow.value() > rowLength) { + ErrorInvalidOperation("%s: SKIP_PIXELS + width > ROW_LENGTH.", funcName); + return false; + } + + const auto rowLengthBytes = CheckedUint32(rowLength) * bytesPerPixel; + const auto rowStride = RoundUpToMultipleOf(rowLengthBytes, alignment); + + const auto usedBytesPerRow = usedPixelsPerRow * bytesPerPixel; + const auto usedBytesPerImage = (usedRowsPerImage - 1) * rowStride + usedBytesPerRow; + + if (!rowStride.isValid() || !usedBytesPerImage.isValid()) { + ErrorInvalidOperation("%s: Invalid UNPACK_ params.", funcName); + return false; + } + + *out_rowStride = rowStride.value(); + *out_endOffset = usedBytesPerImage.value(); + return true; +} + +void +WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, + GLenum type, const dom::ArrayBufferView& dstView, + GLuint dstElemOffset, ErrorResult& out_error) +{ + const char funcName[] = "readPixels"; + if (!ReadPixels_SharedPrecheck(&out_error)) + return; + + if (mBoundPixelPackBuffer) { + ErrorInvalidOperation("%s: PIXEL_PACK_BUFFER must be null.", funcName); + return; + } + + //// + + js::Scalar::Type reqScalarType; + if (!GetJSScalarFromGLType(type, &reqScalarType)) { + ErrorInvalidEnum("%s: Bad `type`.", funcName); + return; + } + + const auto& viewElemType = dstView.Type(); + if (viewElemType != reqScalarType) { + ErrorInvalidOperation("%s: `pixels` type does not match `type`.", funcName); + return; + } + + //// + + uint8_t* bytes; + size_t byteLen; + if (!ValidateArrayBufferView(funcName, dstView, dstElemOffset, 0, &bytes, &byteLen)) + return; + + //// + + ReadPixelsImpl(x, y, width, height, format, type, bytes, byteLen); +} + +void +WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, + GLenum type, WebGLsizeiptr offset, ErrorResult& out_error) +{ + const char funcName[] = "readPixels"; + if (!ReadPixels_SharedPrecheck(&out_error)) + return; + + const auto& buffer = ValidateBufferSelection(funcName, LOCAL_GL_PIXEL_PACK_BUFFER); + if (!buffer) + return; + + ////// + + if (!ValidateNonNegative(funcName, "offset", offset)) + return; + + { + const auto bytesPerType = webgl::BytesPerPixel({LOCAL_GL_RED, type}); + + if (offset % bytesPerType != 0) { + ErrorInvalidOperation("%s: `offset` must be divisible by the size of `type`" + " in bytes.", + funcName); + return; + } + } + + ////// + + const auto bytesAvailable = buffer->ByteLength(); + const auto checkedBytesAfterOffset = CheckedUint32(bytesAvailable) - offset; + + uint32_t bytesAfterOffset = 0; + if (checkedBytesAfterOffset.isValid()) { + bytesAfterOffset = checkedBytesAfterOffset.value(); + } + + gl->MakeCurrent(); + const ScopedLazyBind lazyBind(gl, LOCAL_GL_PIXEL_PACK_BUFFER, buffer); + + ReadPixelsImpl(x, y, width, height, format, type, (void*)offset, bytesAfterOffset); +} + +static webgl::PackingInfo +DefaultReadPixelPI(const webgl::FormatUsageInfo* usage) +{ + MOZ_ASSERT(usage->IsRenderable()); + + switch (usage->format->componentType) { + case webgl::ComponentType::NormUInt: + return { LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE }; + + case webgl::ComponentType::Int: + return { LOCAL_GL_RGBA_INTEGER, LOCAL_GL_INT }; + + case webgl::ComponentType::UInt: + return { LOCAL_GL_RGBA_INTEGER, LOCAL_GL_UNSIGNED_INT }; + + case webgl::ComponentType::Float: + return { LOCAL_GL_RGBA, LOCAL_GL_FLOAT }; + + default: + MOZ_CRASH(); + } +} + +static bool +ArePossiblePackEnums(const WebGLContext* webgl, const webgl::PackingInfo& pi) +{ + // OpenGL ES 2.0 $4.3.1 - IMPLEMENTATION_COLOR_READ_{TYPE/FORMAT} is a valid + // combination for glReadPixels()... + + // So yeah, we are actually checking that these are valid as /unpack/ formats, instead + // of /pack/ formats here, but it should cover the INVALID_ENUM cases. + if (!webgl->mFormatUsage->AreUnpackEnumsValid(pi.format, pi.type)) + return false; + + // Only valid when pulled from: + // * GLES 2.0.25 p105: + // "table 3.4, excluding formats LUMINANCE and LUMINANCE_ALPHA." + // * GLES 3.0.4 p193: + // "table 3.2, excluding formats DEPTH_COMPONENT and DEPTH_STENCIL." + switch (pi.format) { + case LOCAL_GL_LUMINANCE: + case LOCAL_GL_LUMINANCE_ALPHA: + case LOCAL_GL_DEPTH_COMPONENT: + case LOCAL_GL_DEPTH_STENCIL: + return false; + } + + if (pi.type == LOCAL_GL_UNSIGNED_INT_24_8) + return false; + + return true; +} + +webgl::PackingInfo +WebGLContext::ValidImplementationColorReadPI(const webgl::FormatUsageInfo* usage) const +{ + const auto defaultPI = DefaultReadPixelPI(usage); + + // ES2_compatibility always returns RGBA/UNSIGNED_BYTE, so branch on actual IsGLES(). + // Also OSX+NV generates an error here. + if (!gl->IsGLES()) + return defaultPI; + + webgl::PackingInfo implPI; + gl->fGetIntegerv(LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT, (GLint*)&implPI.format); + gl->fGetIntegerv(LOCAL_GL_IMPLEMENTATION_COLOR_READ_TYPE, (GLint*)&implPI.type); + + if (!ArePossiblePackEnums(this, implPI)) + return defaultPI; + + return implPI; +} + +static bool +ValidateReadPixelsFormatAndType(const webgl::FormatUsageInfo* srcUsage, + const webgl::PackingInfo& pi, gl::GLContext* gl, + WebGLContext* webgl) +{ + const char funcName[] = "readPixels"; + + if (!ArePossiblePackEnums(webgl, pi)) { + webgl->ErrorInvalidEnum("%s: Unexpected format or type.", funcName); + return false; + } + + const auto defaultPI = DefaultReadPixelPI(srcUsage); + if (pi == defaultPI) + return true; + + //// + + // OpenGL ES 3.0.4 p194 - When the internal format of the rendering surface is + // RGB10_A2, a third combination of format RGBA and type UNSIGNED_INT_2_10_10_10_REV + // is accepted. + + if (webgl->IsWebGL2() && + srcUsage->format->effectiveFormat == webgl::EffectiveFormat::RGB10_A2 && + pi.format == LOCAL_GL_RGBA && + pi.type == LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV) + { + return true; + } + + //// + + MOZ_ASSERT(gl->IsCurrent()); + const auto implPI = webgl->ValidImplementationColorReadPI(srcUsage); + if (pi == implPI) + return true; + + //// + + webgl->ErrorInvalidOperation("%s: Incompatible format or type.", funcName); + return false; +} + +void +WebGLContext::ReadPixelsImpl(GLint x, GLint y, GLsizei rawWidth, GLsizei rawHeight, + GLenum packFormat, GLenum packType, void* dest, + uint32_t dataLen) +{ + if (rawWidth < 0 || rawHeight < 0) { + ErrorInvalidValue("readPixels: negative size passed"); + return; + } + + const uint32_t width(rawWidth); + const uint32_t height(rawHeight); + + ////// + + MakeContextCurrent(); + + const webgl::FormatUsageInfo* srcFormat; + uint32_t srcWidth; + uint32_t srcHeight; + if (!ValidateCurFBForRead("readPixels", &srcFormat, &srcWidth, &srcHeight)) + return; + + ////// + + const webgl::PackingInfo pi = {packFormat, packType}; + if (!ValidateReadPixelsFormatAndType(srcFormat, pi, gl, this)) + return; + + uint8_t bytesPerPixel; + if (!webgl::GetBytesPerPixel(pi, &bytesPerPixel)) { + ErrorInvalidOperation("readPixels: Unsupported format and type."); + return; + } + + ////// + + uint32_t rowStride; + uint32_t bytesNeeded; + if (!ValidatePackSize("readPixels", width, height, bytesPerPixel, &rowStride, + &bytesNeeded)) + { + return; + } + + if (bytesNeeded > dataLen) { + ErrorInvalidOperation("readPixels: buffer too small"); + return; + } + + //// + + int32_t readX, readY; + int32_t writeX, writeY; + int32_t rwWidth, rwHeight; + if (!Intersect(srcWidth, x, width, &readX, &writeX, &rwWidth) || + !Intersect(srcHeight, y, height, &readY, &writeY, &rwHeight)) + { + ErrorOutOfMemory("readPixels: Bad subrect selection."); + return; + } + + //////////////// + // Now that the errors are out of the way, on to actually reading! + + OnBeforeReadCall(); + + if (!rwWidth || !rwHeight) { + // Disjoint rects, so we're done already. + DummyReadFramebufferOperation("readPixels"); + return; + } + + if (uint32_t(rwWidth) == width && + uint32_t(rwHeight) == height) + { + DoReadPixelsAndConvert(srcFormat->format, x, y, width, height, packFormat, + packType, dest, dataLen, rowStride); + return; + } + + // Read request contains out-of-bounds pixels. Unfortunately: + // GLES 3.0.4 p194 "Obtaining Pixels from the Framebuffer": + // "If any of these pixels lies outside of the window allocated to the current GL + // context, or outside of the image attached to the currently bound framebuffer + // object, then the values obtained for those pixels are undefined." + + // This is a slow-path, so warn people away! + GenerateWarning("readPixels: Out-of-bounds reads with readPixels are deprecated, and" + " may be slow."); + + //////////////////////////////////// + // Read only the in-bounds pixels. + + if (IsWebGL2()) { + if (!mPixelStore_PackRowLength) { + gl->fPixelStorei(LOCAL_GL_PACK_ROW_LENGTH, + mPixelStore_PackSkipPixels + width); + } + gl->fPixelStorei(LOCAL_GL_PACK_SKIP_PIXELS, mPixelStore_PackSkipPixels + writeX); + gl->fPixelStorei(LOCAL_GL_PACK_SKIP_ROWS, mPixelStore_PackSkipRows + writeY); + + DoReadPixelsAndConvert(srcFormat->format, readX, readY, rwWidth, rwHeight, + packFormat, packType, dest, dataLen, rowStride); + + gl->fPixelStorei(LOCAL_GL_PACK_ROW_LENGTH, mPixelStore_PackRowLength); + gl->fPixelStorei(LOCAL_GL_PACK_SKIP_PIXELS, mPixelStore_PackSkipPixels); + gl->fPixelStorei(LOCAL_GL_PACK_SKIP_ROWS, mPixelStore_PackSkipRows); + } else { + // I *did* say "hilariously slow". + + uint8_t* row = (uint8_t*)dest + writeX * bytesPerPixel; + row += writeY * rowStride; + for (uint32_t j = 0; j < uint32_t(rwHeight); j++) { + DoReadPixelsAndConvert(srcFormat->format, readX, readY+j, rwWidth, 1, + packFormat, packType, row, dataLen, rowStride); + row += rowStride; + } + } +} + +void +WebGLContext::RenderbufferStorage_base(const char* funcName, GLenum target, + GLsizei samples, GLenum internalFormat, + GLsizei width, GLsizei height) +{ + if (IsContextLost()) + return; + + if (target != LOCAL_GL_RENDERBUFFER) { + ErrorInvalidEnumInfo("`target`", funcName, target); + return; + } + + if (!mBoundRenderbuffer) { + ErrorInvalidOperation("%s: Called on renderbuffer 0.", funcName); + return; + } + + if (samples < 0) { + ErrorInvalidValue("%s: `samples` must be >= 0.", funcName); + return; + } + + if (width < 0 || height < 0) { + ErrorInvalidValue("%s: `width` and `height` must be >= 0.", funcName); + return; + } + + mBoundRenderbuffer->RenderbufferStorage(funcName, uint32_t(samples), internalFormat, + uint32_t(width), uint32_t(height)); +} + +void +WebGLContext::RenderbufferStorage(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height) +{ + RenderbufferStorage_base("renderbufferStorage", target, 0, internalFormat, width, + height); +} + +void +WebGLContext::Scissor(GLint x, GLint y, GLsizei width, GLsizei height) +{ + if (IsContextLost()) + return; + + if (width < 0 || height < 0) + return ErrorInvalidValue("scissor: negative size"); + + MakeContextCurrent(); + gl->fScissor(x, y, width, height); +} + +void +WebGLContext::StencilFunc(GLenum func, GLint ref, GLuint mask) +{ + if (IsContextLost()) + return; + + if (!ValidateComparisonEnum(func, "stencilFunc: func")) + return; + + mStencilRefFront = ref; + mStencilRefBack = ref; + mStencilValueMaskFront = mask; + mStencilValueMaskBack = mask; + + MakeContextCurrent(); + gl->fStencilFunc(func, ref, mask); +} + +void +WebGLContext::StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) +{ + if (IsContextLost()) + return; + + if (!ValidateFaceEnum(face, "stencilFuncSeparate: face") || + !ValidateComparisonEnum(func, "stencilFuncSeparate: func")) + return; + + switch (face) { + case LOCAL_GL_FRONT_AND_BACK: + mStencilRefFront = ref; + mStencilRefBack = ref; + mStencilValueMaskFront = mask; + mStencilValueMaskBack = mask; + break; + case LOCAL_GL_FRONT: + mStencilRefFront = ref; + mStencilValueMaskFront = mask; + break; + case LOCAL_GL_BACK: + mStencilRefBack = ref; + mStencilValueMaskBack = mask; + break; + } + + MakeContextCurrent(); + gl->fStencilFuncSeparate(face, func, ref, mask); +} + +void +WebGLContext::StencilOp(GLenum sfail, GLenum dpfail, GLenum dppass) +{ + if (IsContextLost()) + return; + + if (!ValidateStencilOpEnum(sfail, "stencilOp: sfail") || + !ValidateStencilOpEnum(dpfail, "stencilOp: dpfail") || + !ValidateStencilOpEnum(dppass, "stencilOp: dppass")) + return; + + MakeContextCurrent(); + gl->fStencilOp(sfail, dpfail, dppass); +} + +void +WebGLContext::StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) +{ + if (IsContextLost()) + return; + + if (!ValidateFaceEnum(face, "stencilOpSeparate: face") || + !ValidateStencilOpEnum(sfail, "stencilOpSeparate: sfail") || + !ValidateStencilOpEnum(dpfail, "stencilOpSeparate: dpfail") || + !ValidateStencilOpEnum(dppass, "stencilOpSeparate: dppass")) + return; + + MakeContextCurrent(); + gl->fStencilOpSeparate(face, sfail, dpfail, dppass); +} + +//////////////////////////////////////////////////////////////////////////////// +// Uniform setters. + +class ValidateIfSampler +{ + const WebGLUniformLocation* const mLoc; + const size_t mDataCount; + const GLint* const mData; + bool mIsValidatedSampler; + +public: + ValidateIfSampler(WebGLContext* webgl, const char* funcName, + WebGLUniformLocation* loc, size_t dataCount, const GLint* data, + bool* const out_error) + : mLoc(loc) + , mDataCount(dataCount) + , mData(data) + , mIsValidatedSampler(false) + { + if (!mLoc->mInfo->mSamplerTexList) { + *out_error = false; + return; + } + + for (size_t i = 0; i < mDataCount; i++) { + const auto& val = mData[i]; + if (val < 0 || uint32_t(val) >= webgl->GLMaxTextureUnits()) { + webgl->ErrorInvalidValue("%s: This uniform location is a sampler, but %d" + " is not a valid texture unit.", + funcName, val); + *out_error = true; + return; + } + } + + mIsValidatedSampler = true; + *out_error = false; + } + + ~ValidateIfSampler() { + if (!mIsValidatedSampler) + return; + + auto& samplerValues = mLoc->mInfo->mSamplerValues; + + for (size_t i = 0; i < mDataCount; i++) { + const size_t curIndex = mLoc->mArrayIndex + i; + if (curIndex >= samplerValues.size()) + break; + + samplerValues[curIndex] = mData[i]; + } + } +}; + +//////////////////// + +void +WebGLContext::Uniform1i(WebGLUniformLocation* loc, GLint a1) +{ + const char funcName[] = "uniform1i"; + if (!ValidateUniformSetter(loc, 1, LOCAL_GL_INT, funcName)) + return; + + bool error; + const ValidateIfSampler validate(this, funcName, loc, 1, &a1, &error); + if (error) + return; + + MakeContextCurrent(); + gl->fUniform1i(loc->mLoc, a1); +} + +void +WebGLContext::Uniform2i(WebGLUniformLocation* loc, GLint a1, GLint a2) +{ + const char funcName[] = "uniform2i"; + if (!ValidateUniformSetter(loc, 2, LOCAL_GL_INT, funcName)) + return; + + MakeContextCurrent(); + gl->fUniform2i(loc->mLoc, a1, a2); +} + +void +WebGLContext::Uniform3i(WebGLUniformLocation* loc, GLint a1, GLint a2, GLint a3) +{ + const char funcName[] = "uniform3i"; + if (!ValidateUniformSetter(loc, 3, LOCAL_GL_INT, funcName)) + return; + + MakeContextCurrent(); + gl->fUniform3i(loc->mLoc, a1, a2, a3); +} + +void +WebGLContext::Uniform4i(WebGLUniformLocation* loc, GLint a1, GLint a2, GLint a3, + GLint a4) +{ + const char funcName[] = "uniform4i"; + if (!ValidateUniformSetter(loc, 4, LOCAL_GL_INT, funcName)) + return; + + MakeContextCurrent(); + gl->fUniform4i(loc->mLoc, a1, a2, a3, a4); +} + +////////// + +void +WebGLContext::Uniform1f(WebGLUniformLocation* loc, GLfloat a1) +{ + const char funcName[] = "uniform1f"; + if (!ValidateUniformSetter(loc, 1, LOCAL_GL_FLOAT, funcName)) + return; + + MakeContextCurrent(); + gl->fUniform1f(loc->mLoc, a1); +} + +void +WebGLContext::Uniform2f(WebGLUniformLocation* loc, GLfloat a1, GLfloat a2) +{ + const char funcName[] = "uniform2f"; + if (!ValidateUniformSetter(loc, 2, LOCAL_GL_FLOAT, funcName)) + return; + + MakeContextCurrent(); + gl->fUniform2f(loc->mLoc, a1, a2); +} + +void +WebGLContext::Uniform3f(WebGLUniformLocation* loc, GLfloat a1, GLfloat a2, + GLfloat a3) +{ + const char funcName[] = "uniform3f"; + if (!ValidateUniformSetter(loc, 3, LOCAL_GL_FLOAT, funcName)) + return; + + MakeContextCurrent(); + gl->fUniform3f(loc->mLoc, a1, a2, a3); +} + +void +WebGLContext::Uniform4f(WebGLUniformLocation* loc, GLfloat a1, GLfloat a2, + GLfloat a3, GLfloat a4) +{ + const char funcName[] = "uniform4f"; + if (!ValidateUniformSetter(loc, 4, LOCAL_GL_FLOAT, funcName)) + return; + + MakeContextCurrent(); + gl->fUniform4f(loc->mLoc, a1, a2, a3, a4); +} + +//////////////////////////////////////// +// Array + +static bool +ValidateArrOffsetAndCount(WebGLContext* webgl, const char* funcName, size_t elemsAvail, + GLuint elemOffset, GLuint elemCountOverride, + size_t* const out_elemCount) +{ + if (elemOffset > elemsAvail) { + webgl->ErrorInvalidValue("%s: Bad offset into list.", funcName); + return false; + } + elemsAvail -= elemOffset; + + if (elemCountOverride) { + if (elemCountOverride > elemsAvail) { + webgl->ErrorInvalidValue("%s: Bad count override for sub-list.", funcName); + return false; + } + elemsAvail = elemCountOverride; + } + + *out_elemCount = elemsAvail; + return true; +} + +void +WebGLContext::UniformNiv(const char* funcName, uint8_t N, WebGLUniformLocation* loc, + const Int32Arr& arr, GLuint elemOffset, GLuint elemCountOverride) +{ + size_t elemCount; + if (!ValidateArrOffsetAndCount(this, funcName, arr.elemCount, elemOffset, + elemCountOverride, &elemCount)) + { + return; + } + const auto elemBytes = arr.elemBytes + elemOffset; + + uint32_t numElementsToUpload; + if (!ValidateUniformArraySetter(loc, N, LOCAL_GL_INT, elemCount, funcName, + &numElementsToUpload)) + { + return; + } + + bool error; + const ValidateIfSampler samplerValidator(this, funcName, loc, numElementsToUpload, + elemBytes, &error); + if (error) + return; + + static const decltype(&gl::GLContext::fUniform1iv) kFuncList[] = { + &gl::GLContext::fUniform1iv, + &gl::GLContext::fUniform2iv, + &gl::GLContext::fUniform3iv, + &gl::GLContext::fUniform4iv + }; + const auto func = kFuncList[N-1]; + + MakeContextCurrent(); + (gl->*func)(loc->mLoc, numElementsToUpload, elemBytes); +} + +void +WebGLContext::UniformNuiv(const char* funcName, uint8_t N, WebGLUniformLocation* loc, + const Uint32Arr& arr, GLuint elemOffset, + GLuint elemCountOverride) +{ + size_t elemCount; + if (!ValidateArrOffsetAndCount(this, funcName, arr.elemCount, elemOffset, + elemCountOverride, &elemCount)) + { + return; + } + const auto elemBytes = arr.elemBytes + elemOffset; + + uint32_t numElementsToUpload; + if (!ValidateUniformArraySetter(loc, N, LOCAL_GL_UNSIGNED_INT, elemCount, funcName, + &numElementsToUpload)) + { + return; + } + MOZ_ASSERT(!loc->mInfo->mSamplerTexList, "Should not be a sampler."); + + static const decltype(&gl::GLContext::fUniform1uiv) kFuncList[] = { + &gl::GLContext::fUniform1uiv, + &gl::GLContext::fUniform2uiv, + &gl::GLContext::fUniform3uiv, + &gl::GLContext::fUniform4uiv + }; + const auto func = kFuncList[N-1]; + + MakeContextCurrent(); + (gl->*func)(loc->mLoc, numElementsToUpload, elemBytes); +} + +void +WebGLContext::UniformNfv(const char* funcName, uint8_t N, WebGLUniformLocation* loc, + const Float32Arr& arr, GLuint elemOffset, + GLuint elemCountOverride) +{ + size_t elemCount; + if (!ValidateArrOffsetAndCount(this, funcName, arr.elemCount, elemOffset, + elemCountOverride, &elemCount)) + { + return; + } + const auto elemBytes = arr.elemBytes + elemOffset; + + uint32_t numElementsToUpload; + if (!ValidateUniformArraySetter(loc, N, LOCAL_GL_FLOAT, elemCount, funcName, + &numElementsToUpload)) + { + return; + } + MOZ_ASSERT(!loc->mInfo->mSamplerTexList, "Should not be a sampler."); + + static const decltype(&gl::GLContext::fUniform1fv) kFuncList[] = { + &gl::GLContext::fUniform1fv, + &gl::GLContext::fUniform2fv, + &gl::GLContext::fUniform3fv, + &gl::GLContext::fUniform4fv + }; + const auto func = kFuncList[N-1]; + + MakeContextCurrent(); + (gl->*func)(loc->mLoc, numElementsToUpload, elemBytes); +} + +void +WebGLContext::UniformMatrixAxBfv(const char* funcName, uint8_t A, uint8_t B, + WebGLUniformLocation* loc, bool transpose, + const Float32Arr& arr, GLuint elemOffset, + GLuint elemCountOverride) +{ + size_t elemCount; + if (!ValidateArrOffsetAndCount(this, funcName, arr.elemCount, elemOffset, + elemCountOverride, &elemCount)) + { + return; + } + const auto elemBytes = arr.elemBytes + elemOffset; + + uint32_t numElementsToUpload; + if (!ValidateUniformMatrixArraySetter(loc, A, B, LOCAL_GL_FLOAT, elemCount, + transpose, funcName, &numElementsToUpload)) + { + return; + } + MOZ_ASSERT(!loc->mInfo->mSamplerTexList, "Should not be a sampler."); + + static const decltype(&gl::GLContext::fUniformMatrix2fv) kFuncList[] = { + &gl::GLContext::fUniformMatrix2fv, + &gl::GLContext::fUniformMatrix2x3fv, + &gl::GLContext::fUniformMatrix2x4fv, + + &gl::GLContext::fUniformMatrix3x2fv, + &gl::GLContext::fUniformMatrix3fv, + &gl::GLContext::fUniformMatrix3x4fv, + + &gl::GLContext::fUniformMatrix4x2fv, + &gl::GLContext::fUniformMatrix4x3fv, + &gl::GLContext::fUniformMatrix4fv + }; + const auto func = kFuncList[3*(A-2) + (B-2)]; + + MakeContextCurrent(); + (gl->*func)(loc->mLoc, numElementsToUpload, transpose, elemBytes); +} + +//////////////////////////////////////////////////////////////////////////////// + +void +WebGLContext::UseProgram(WebGLProgram* prog) +{ + if (IsContextLost()) + return; + + if (!prog) { + mCurrentProgram = nullptr; + mActiveProgramLinkInfo = nullptr; + return; + } + + if (!ValidateObject("useProgram", *prog)) + return; + + if (prog->UseProgram()) { + mCurrentProgram = prog; + mActiveProgramLinkInfo = mCurrentProgram->LinkInfo(); + } +} + +void +WebGLContext::ValidateProgram(const WebGLProgram& prog) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("validateProgram", prog)) + return; + + prog.ValidateProgram(); +} + +already_AddRefed +WebGLContext::CreateFramebuffer() +{ + if (IsContextLost()) + return nullptr; + + GLuint fbo = 0; + MakeContextCurrent(); + gl->fGenFramebuffers(1, &fbo); + + RefPtr globj = new WebGLFramebuffer(this, fbo); + return globj.forget(); +} + +already_AddRefed +WebGLContext::CreateRenderbuffer() +{ + if (IsContextLost()) + return nullptr; + + MakeContextCurrent(); + RefPtr globj = new WebGLRenderbuffer(this); + return globj.forget(); +} + +void +WebGLContext::Viewport(GLint x, GLint y, GLsizei width, GLsizei height) +{ + if (IsContextLost()) + return; + + if (width < 0 || height < 0) + return ErrorInvalidValue("viewport: negative size"); + + width = std::min(width, (GLsizei)mImplMaxViewportDims[0]); + height = std::min(height, (GLsizei)mImplMaxViewportDims[1]); + + MakeContextCurrent(); + gl->fViewport(x, y, width, height); + + mViewportX = x; + mViewportY = y; + mViewportWidth = width; + mViewportHeight = height; +} + +void +WebGLContext::CompileShader(WebGLShader& shader) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("compileShader", shader)) + return; + + shader.CompileShader(); +} + +JS::Value +WebGLContext::GetShaderParameter(const WebGLShader& shader, GLenum pname) +{ + if (IsContextLost()) + return JS::NullValue(); + + if (!ValidateObjectAllowDeleted("getShaderParameter: shader", shader)) + return JS::NullValue(); + + return shader.GetShaderParameter(pname); +} + +void +WebGLContext::GetShaderInfoLog(const WebGLShader& shader, nsAString& retval) +{ + retval.SetIsVoid(true); + + if (IsContextLost()) + return; + + if (!ValidateObject("getShaderInfoLog: shader", shader)) + return; + + shader.GetShaderInfoLog(&retval); +} + +already_AddRefed +WebGLContext::GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype) +{ + if (IsContextLost()) + return nullptr; + + switch (shadertype) { + case LOCAL_GL_FRAGMENT_SHADER: + case LOCAL_GL_VERTEX_SHADER: + break; + default: + ErrorInvalidEnumInfo("getShaderPrecisionFormat: shadertype", shadertype); + return nullptr; + } + + switch (precisiontype) { + case LOCAL_GL_LOW_FLOAT: + case LOCAL_GL_MEDIUM_FLOAT: + case LOCAL_GL_HIGH_FLOAT: + case LOCAL_GL_LOW_INT: + case LOCAL_GL_MEDIUM_INT: + case LOCAL_GL_HIGH_INT: + break; + default: + ErrorInvalidEnumInfo("getShaderPrecisionFormat: precisiontype", precisiontype); + return nullptr; + } + + MakeContextCurrent(); + GLint range[2], precision; + + if (mDisableFragHighP && + shadertype == LOCAL_GL_FRAGMENT_SHADER && + (precisiontype == LOCAL_GL_HIGH_FLOAT || + precisiontype == LOCAL_GL_HIGH_INT)) + { + precision = 0; + range[0] = 0; + range[1] = 0; + } else { + gl->fGetShaderPrecisionFormat(shadertype, precisiontype, range, &precision); + } + + RefPtr retShaderPrecisionFormat + = new WebGLShaderPrecisionFormat(this, range[0], range[1], precision); + return retShaderPrecisionFormat.forget(); +} + +void +WebGLContext::GetShaderSource(const WebGLShader& shader, nsAString& retval) +{ + retval.SetIsVoid(true); + + if (IsContextLost()) + return; + + if (!ValidateObject("getShaderSource: shader", shader)) + return; + + shader.GetShaderSource(&retval); +} + +void +WebGLContext::ShaderSource(WebGLShader& shader, const nsAString& source) +{ + if (IsContextLost()) + return; + + if (!ValidateObject("shaderSource: shader", shader)) + return; + + shader.ShaderSource(source); +} + +void +WebGLContext::LoseContext() +{ + if (IsContextLost()) + return ErrorInvalidOperation("loseContext: Context is already lost."); + + ForceLoseContext(true); +} + +void +WebGLContext::RestoreContext() +{ + if (!IsContextLost()) + return ErrorInvalidOperation("restoreContext: Context is not lost."); + + if (!mLastLossWasSimulated) { + return ErrorInvalidOperation("restoreContext: Context loss was not simulated." + " Cannot simulate restore."); + } + // If we're currently lost, and the last loss was simulated, then + // we're currently only simulated-lost, allowing us to call + // restoreContext(). + + if (!mAllowContextRestore) + return ErrorInvalidOperation("restoreContext: Context cannot be restored."); + + ForceRestoreContext(); +} + +void +WebGLContext::BlendColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) { + if (IsContextLost()) + return; + MakeContextCurrent(); + gl->fBlendColor(r, g, b, a); +} + +void +WebGLContext::Flush() { + if (IsContextLost()) + return; + MakeContextCurrent(); + gl->fFlush(); +} + +void +WebGLContext::Finish() { + if (IsContextLost()) + return; + MakeContextCurrent(); + gl->fFinish(); +} + +void +WebGLContext::LineWidth(GLfloat width) +{ + if (IsContextLost()) + return; + + // Doing it this way instead of `if (width <= 0.0)` handles NaNs. + const bool isValid = width > 0.0; + if (!isValid) { + ErrorInvalidValue("lineWidth: `width` must be positive and non-zero."); + return; + } + + mLineWidth = width; + + if (gl->IsCoreProfile() && width > 1.0) { + width = 1.0; + } + + MakeContextCurrent(); + gl->fLineWidth(width); +} + +void +WebGLContext::PolygonOffset(GLfloat factor, GLfloat units) { + if (IsContextLost()) + return; + MakeContextCurrent(); + gl->fPolygonOffset(factor, units); +} + +void +WebGLContext::SampleCoverage(GLclampf value, WebGLboolean invert) { + if (IsContextLost()) + return; + MakeContextCurrent(); + gl->fSampleCoverage(value, invert); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextLossHandler.cpp b/dom/canvas/WebGLContextLossHandler.cpp new file mode 100644 index 000000000..1f50896a5 --- /dev/null +++ b/dom/canvas/WebGLContextLossHandler.cpp @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContextLossHandler.h" + +#include "mozilla/DebugOnly.h" +#include "nsISupportsImpl.h" +#include "nsITimer.h" +#include "nsThreadUtils.h" +#include "WebGLContext.h" + +namespace mozilla { + +class WatchdogTimerEvent final : public nsITimerCallback +{ + const WeakPtr mHandler; + +public: + NS_DECL_ISUPPORTS + + explicit WatchdogTimerEvent(WebGLContextLossHandler* handler) + : mHandler(handler) + { } + +private: + virtual ~WatchdogTimerEvent() { } + + NS_IMETHOD Notify(nsITimer*) override { + if (mHandler) { + mHandler->TimerCallback(); + } + return NS_OK; + } +}; + +NS_IMPL_ISUPPORTS(WatchdogTimerEvent, nsITimerCallback, nsISupports) + +//////////////////////////////////////// + +WebGLContextLossHandler::WebGLContextLossHandler(WebGLContext* webgl) + : mWebGL(webgl) + , mTimer(do_CreateInstance(NS_TIMER_CONTRACTID)) + , mTimerPending(false) + , mShouldRunTimerAgain(false) +#ifdef DEBUG + , mThread(NS_GetCurrentThread()) +#endif +{ + MOZ_ASSERT(mThread); +} + +WebGLContextLossHandler::~WebGLContextLossHandler() +{ + // NS_GetCurrentThread() returns null during shutdown. + const DebugOnly callingThread = NS_GetCurrentThread(); + MOZ_ASSERT(callingThread == mThread || !callingThread); +} + +//////////////////// + +void +WebGLContextLossHandler::RunTimer() +{ + MOZ_ASSERT(NS_GetCurrentThread() == mThread); + + // If the timer was already running, don't restart it here. Instead, + // wait until the previous call is done, then fire it one more time. + // This is also an optimization to prevent unnecessary + // cross-communication between threads. + if (mTimerPending) { + mShouldRunTimerAgain = true; + return; + } + + const RefPtr event = new WatchdogTimerEvent(this); + const uint32_t kDelayMS = 1000; + mTimer->InitWithCallback(event, kDelayMS, nsITimer::TYPE_ONE_SHOT); + + mTimerPending = true; +} + +//////////////////// + +void +WebGLContextLossHandler::TimerCallback() +{ + MOZ_ASSERT(NS_GetCurrentThread() == mThread); + + mTimerPending = false; + + const bool runOnceMore = mShouldRunTimerAgain; + mShouldRunTimerAgain = false; + + mWebGL->UpdateContextLossStatus(); + + if (runOnceMore && !mTimerPending) { + RunTimer(); + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextLossHandler.h b/dom/canvas/WebGLContextLossHandler.h new file mode 100644 index 000000000..096fdc387 --- /dev/null +++ b/dom/canvas/WebGLContextLossHandler.h @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_CONTEXT_LOSS_HANDLER_H_ +#define WEBGL_CONTEXT_LOSS_HANDLER_H_ + +#include "mozilla/WeakPtr.h" +#include "nsCOMPtr.h" + +class nsIThread; +class nsITimer; + +namespace mozilla { +class WebGLContext; + +class WebGLContextLossHandler final : public SupportsWeakPtr +{ + WebGLContext* const mWebGL; + const nsCOMPtr mTimer; // If we don't hold a ref to the timer, it will think + bool mTimerPending; // that it's been discarded, and be canceled 'for our + bool mShouldRunTimerAgain; // convenience'. +#ifdef DEBUG + nsIThread* const mThread; +#endif + + friend class WatchdogTimerEvent; + +public: + MOZ_DECLARE_WEAKREFERENCE_TYPENAME(WebGLContextLossHandler) + + explicit WebGLContextLossHandler(WebGLContext* webgl); + ~WebGLContextLossHandler(); + + void RunTimer(); + +private: + void TimerCallback(); +}; + +} // namespace mozilla + +#endif // WEBGL_CONTEXT_LOSS_HANDLER_H_ diff --git a/dom/canvas/WebGLContextNotSupported.cpp b/dom/canvas/WebGLContextNotSupported.cpp new file mode 100644 index 000000000..f39a5bac2 --- /dev/null +++ b/dom/canvas/WebGLContextNotSupported.cpp @@ -0,0 +1,10 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIDOMWebGLRenderingContext.h" + +#define DUMMY(func,rtype) nsresult func (rtype **) { return NS_ERROR_FAILURE; } + +DUMMY(NS_NewCanvasRenderingContextWebGL, nsIDOMWebGLRenderingContext) diff --git a/dom/canvas/WebGLContextState.cpp b/dom/canvas/WebGLContextState.cpp new file mode 100644 index 000000000..e0234f5c6 --- /dev/null +++ b/dom/canvas/WebGLContextState.cpp @@ -0,0 +1,732 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" + +#include "GLContext.h" +#include "GLScreenBuffer.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/Preferences.h" +#include "nsString.h" +#include "WebGLBuffer.h" +#include "WebGLContextUtils.h" +#include "WebGLFramebuffer.h" +#include "WebGLProgram.h" +#include "WebGLRenderbuffer.h" +#include "WebGLShader.h" +#include "WebGLTexture.h" +#include "WebGLVertexArray.h" + +namespace mozilla { + +void +WebGLContext::Disable(GLenum cap) +{ + if (IsContextLost()) + return; + + if (!ValidateCapabilityEnum(cap, "disable")) + return; + + realGLboolean* trackingSlot = GetStateTrackingSlot(cap); + + if (trackingSlot) + { + *trackingSlot = 0; + } + + MakeContextCurrent(); + gl->fDisable(cap); +} + +void +WebGLContext::Enable(GLenum cap) +{ + if (IsContextLost()) + return; + + if (!ValidateCapabilityEnum(cap, "enable")) + return; + + realGLboolean* trackingSlot = GetStateTrackingSlot(cap); + + if (trackingSlot) + { + *trackingSlot = 1; + } + + MakeContextCurrent(); + gl->fEnable(cap); +} + +static JS::Value +StringValue(JSContext* cx, const nsAString& str, ErrorResult& rv) +{ + JSString* jsStr = JS_NewUCStringCopyN(cx, str.BeginReading(), str.Length()); + if (!jsStr) { + rv.Throw(NS_ERROR_OUT_OF_MEMORY); + return JS::NullValue(); + } + + return JS::StringValue(jsStr); +} + +bool +WebGLContext::GetStencilBits(GLint* const out_stencilBits) +{ + *out_stencilBits = 0; + if (mBoundDrawFramebuffer) { + if (mBoundDrawFramebuffer->StencilAttachment().IsDefined() && + mBoundDrawFramebuffer->DepthStencilAttachment().IsDefined()) + { + // Error, we don't know which stencil buffer's bits to use + ErrorInvalidFramebufferOperation("getParameter: framebuffer has two stencil buffers bound"); + return false; + } + + if (mBoundDrawFramebuffer->StencilAttachment().IsDefined() || + mBoundDrawFramebuffer->DepthStencilAttachment().IsDefined()) + { + *out_stencilBits = 8; + } + } else if (mOptions.stencil) { + *out_stencilBits = 8; + } + + return true; +} + +bool +WebGLContext::GetChannelBits(const char* funcName, GLenum pname, GLint* const out_val) +{ + if (mBoundDrawFramebuffer) { + if (!mBoundDrawFramebuffer->ValidateAndInitAttachments(funcName)) + return false; + } + + if (!mBoundDrawFramebuffer) { + switch (pname) { + case LOCAL_GL_RED_BITS: + case LOCAL_GL_GREEN_BITS: + case LOCAL_GL_BLUE_BITS: + *out_val = 8; + break; + + case LOCAL_GL_ALPHA_BITS: + *out_val = (mOptions.alpha ? 8 : 0); + break; + + case LOCAL_GL_DEPTH_BITS: + if (mOptions.depth) { + *out_val = gl->Screen()->DepthBits(); + } else { + *out_val = 0; + } + break; + + case LOCAL_GL_STENCIL_BITS: + *out_val = (mOptions.stencil ? 8 : 0); + break; + + default: + MOZ_CRASH("GFX: bad pname"); + } + return true; + } + + if (!gl->IsCoreProfile()) { + gl->fGetIntegerv(pname, out_val); + return true; + } + + GLenum fbAttachment = 0; + GLenum fbPName = 0; + switch (pname) { + case LOCAL_GL_RED_BITS: + fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0; + fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE; + break; + + case LOCAL_GL_GREEN_BITS: + fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0; + fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE; + break; + + case LOCAL_GL_BLUE_BITS: + fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0; + fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE; + break; + + case LOCAL_GL_ALPHA_BITS: + fbAttachment = LOCAL_GL_COLOR_ATTACHMENT0; + fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE; + break; + + case LOCAL_GL_DEPTH_BITS: + fbAttachment = LOCAL_GL_DEPTH_ATTACHMENT; + fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE; + break; + + case LOCAL_GL_STENCIL_BITS: + fbAttachment = LOCAL_GL_STENCIL_ATTACHMENT; + fbPName = LOCAL_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE; + break; + + default: + MOZ_CRASH("GFX: bad pname"); + } + + gl->fGetFramebufferAttachmentParameteriv(LOCAL_GL_DRAW_FRAMEBUFFER, fbAttachment, + fbPName, out_val); + return true; +} + +JS::Value +WebGLContext::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv) +{ + const char funcName[] = "getParameter"; + + if (IsContextLost()) + return JS::NullValue(); + + MakeContextCurrent(); + + if (MinCapabilityMode()) { + switch(pname) { + //////////////////////////// + // Single-value params + + // int + case LOCAL_GL_MAX_VERTEX_ATTRIBS: + return JS::Int32Value(MINVALUE_GL_MAX_VERTEX_ATTRIBS); + + case LOCAL_GL_MAX_FRAGMENT_UNIFORM_VECTORS: + return JS::Int32Value(MINVALUE_GL_MAX_FRAGMENT_UNIFORM_VECTORS); + + case LOCAL_GL_MAX_VERTEX_UNIFORM_VECTORS: + return JS::Int32Value(MINVALUE_GL_MAX_VERTEX_UNIFORM_VECTORS); + + case LOCAL_GL_MAX_VARYING_VECTORS: + return JS::Int32Value(MINVALUE_GL_MAX_VARYING_VECTORS); + + case LOCAL_GL_MAX_TEXTURE_SIZE: + return JS::Int32Value(MINVALUE_GL_MAX_TEXTURE_SIZE); + + case LOCAL_GL_MAX_CUBE_MAP_TEXTURE_SIZE: + return JS::Int32Value(MINVALUE_GL_MAX_CUBE_MAP_TEXTURE_SIZE); + + case LOCAL_GL_MAX_TEXTURE_IMAGE_UNITS: + return JS::Int32Value(MINVALUE_GL_MAX_TEXTURE_IMAGE_UNITS); + + case LOCAL_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: + return JS::Int32Value(MINVALUE_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS); + + case LOCAL_GL_MAX_RENDERBUFFER_SIZE: + return JS::Int32Value(MINVALUE_GL_MAX_RENDERBUFFER_SIZE); + + default: + // Return the real value; we're not overriding this one + break; + } + } + + if (IsWebGL2() || IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)) { + if (pname == LOCAL_GL_MAX_COLOR_ATTACHMENTS) { + return JS::Int32Value(mImplMaxColorAttachments); + + } else if (pname == LOCAL_GL_MAX_DRAW_BUFFERS) { + return JS::Int32Value(mImplMaxDrawBuffers); + + } else if (pname >= LOCAL_GL_DRAW_BUFFER0 && + pname < GLenum(LOCAL_GL_DRAW_BUFFER0 + mImplMaxDrawBuffers)) + { + GLint ret = LOCAL_GL_NONE; + if (!mBoundDrawFramebuffer) { + if (pname == LOCAL_GL_DRAW_BUFFER0) { + ret = gl->Screen()->GetDrawBufferMode(); + } + } else { + gl->fGetIntegerv(pname, &ret); + } + return JS::Int32Value(ret); + } + } + + if (IsWebGL2() || IsExtensionEnabled(WebGLExtensionID::OES_vertex_array_object)) { + if (pname == LOCAL_GL_VERTEX_ARRAY_BINDING) { + WebGLVertexArray* vao = + (mBoundVertexArray != mDefaultVertexArray) ? mBoundVertexArray.get() : nullptr; + return WebGLObjectAsJSValue(cx, vao, rv); + } + } + + if (IsExtensionEnabled(WebGLExtensionID::EXT_disjoint_timer_query)) { + switch (pname) { + case LOCAL_GL_TIMESTAMP_EXT: + { + uint64_t val = 0; + if (Has64BitTimestamps()) { + gl->fGetInteger64v(pname, (GLint64*)&val); + } else { + gl->fGetIntegerv(pname, (GLint*)&val); + } + // TODO: JS doesn't support 64-bit integers. Be lossy and + // cast to double (53 bits) + return JS::NumberValue(val); + } + + case LOCAL_GL_GPU_DISJOINT_EXT: + { + realGLboolean val = false; // Not disjoint by default. + if (gl->IsExtensionSupported(gl::GLContext::EXT_disjoint_timer_query)) { + gl->fGetBooleanv(pname, &val); + } + return JS::BooleanValue(val); + } + + default: + break; + } + } + + // Privileged string params exposed by WEBGL_debug_renderer_info. + // The privilege check is done in WebGLContext::IsExtensionSupported. + // So here we just have to check that the extension is enabled. + if (IsExtensionEnabled(WebGLExtensionID::WEBGL_debug_renderer_info)) { + switch (pname) { + case UNMASKED_VENDOR_WEBGL: + case UNMASKED_RENDERER_WEBGL: + { + const char* overridePref = nullptr; + GLenum driverEnum = LOCAL_GL_NONE; + + switch (pname) { + case UNMASKED_RENDERER_WEBGL: + overridePref = "webgl.renderer-string-override"; + driverEnum = LOCAL_GL_RENDERER; + break; + case UNMASKED_VENDOR_WEBGL: + overridePref = "webgl.vendor-string-override"; + driverEnum = LOCAL_GL_VENDOR; + break; + default: + MOZ_CRASH("GFX: bad `pname`"); + } + + bool hasRetVal = false; + + nsAutoString ret; + if (overridePref) { + nsresult res = Preferences::GetString(overridePref, &ret); + if (NS_SUCCEEDED(res) && ret.Length() > 0) + hasRetVal = true; + } + + if (!hasRetVal) { + const char* chars = reinterpret_cast(gl->fGetString(driverEnum)); + ret = NS_ConvertASCIItoUTF16(chars); + hasRetVal = true; + } + + return StringValue(cx, ret, rv); + } + } + } + + if (IsWebGL2() || IsExtensionEnabled(WebGLExtensionID::OES_standard_derivatives)) { + if (pname == LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT) { + GLint i = 0; + gl->fGetIntegerv(pname, &i); + return JS::Int32Value(i); + } + } + + if (IsExtensionEnabled(WebGLExtensionID::EXT_texture_filter_anisotropic)) { + if (pname == LOCAL_GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT) { + GLfloat f = 0.f; + gl->fGetFloatv(pname, &f); + return JS::NumberValue(f); + } + } + + switch (pname) { + // + // String params + // + case LOCAL_GL_VENDOR: + case LOCAL_GL_RENDERER: + return StringValue(cx, "Mozilla", rv); + case LOCAL_GL_VERSION: + return StringValue(cx, "WebGL 1.0", rv); + case LOCAL_GL_SHADING_LANGUAGE_VERSION: + return StringValue(cx, "WebGL GLSL ES 1.0", rv); + + //////////////////////////////// + // Single-value params + + // unsigned int + case LOCAL_GL_CULL_FACE_MODE: + case LOCAL_GL_FRONT_FACE: + case LOCAL_GL_ACTIVE_TEXTURE: + case LOCAL_GL_STENCIL_FUNC: + case LOCAL_GL_STENCIL_FAIL: + case LOCAL_GL_STENCIL_PASS_DEPTH_FAIL: + case LOCAL_GL_STENCIL_PASS_DEPTH_PASS: + case LOCAL_GL_STENCIL_BACK_FUNC: + case LOCAL_GL_STENCIL_BACK_FAIL: + case LOCAL_GL_STENCIL_BACK_PASS_DEPTH_FAIL: + case LOCAL_GL_STENCIL_BACK_PASS_DEPTH_PASS: + case LOCAL_GL_DEPTH_FUNC: + case LOCAL_GL_BLEND_SRC_RGB: + case LOCAL_GL_BLEND_SRC_ALPHA: + case LOCAL_GL_BLEND_DST_RGB: + case LOCAL_GL_BLEND_DST_ALPHA: + case LOCAL_GL_BLEND_EQUATION_RGB: + case LOCAL_GL_BLEND_EQUATION_ALPHA: { + GLint i = 0; + gl->fGetIntegerv(pname, &i); + return JS::NumberValue(uint32_t(i)); + } + + case LOCAL_GL_GENERATE_MIPMAP_HINT: + return JS::NumberValue(mGenerateMipmapHint); + + case LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT: + case LOCAL_GL_IMPLEMENTATION_COLOR_READ_TYPE: { + const webgl::FormatUsageInfo* usage; + uint32_t width, height; + if (!ValidateCurFBForRead(funcName, &usage, &width, &height)) + return JS::NullValue(); + + const auto implPI = ValidImplementationColorReadPI(usage); + + GLenum ret; + if (pname == LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT) { + ret = implPI.format; + } else { + ret = implPI.type; + } + return JS::NumberValue(uint32_t(ret)); + } + + // int + case LOCAL_GL_STENCIL_REF: + case LOCAL_GL_STENCIL_BACK_REF: { + GLint stencilBits = 0; + if (!GetStencilBits(&stencilBits)) + return JS::NullValue(); + + // Assuming stencils have 8 bits + const GLint stencilMask = (1 << stencilBits) - 1; + + GLint refValue = 0; + gl->fGetIntegerv(pname, &refValue); + + return JS::Int32Value(refValue & stencilMask); + } + + case LOCAL_GL_STENCIL_CLEAR_VALUE: + case LOCAL_GL_UNPACK_ALIGNMENT: + case LOCAL_GL_PACK_ALIGNMENT: + case LOCAL_GL_SUBPIXEL_BITS: + case LOCAL_GL_SAMPLE_BUFFERS: + case LOCAL_GL_SAMPLES: + case LOCAL_GL_MAX_VERTEX_ATTRIBS: + case LOCAL_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: + case LOCAL_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: + case LOCAL_GL_MAX_TEXTURE_IMAGE_UNITS: { + GLint i = 0; + gl->fGetIntegerv(pname, &i); + return JS::Int32Value(i); + } + + case LOCAL_GL_RED_BITS: + case LOCAL_GL_GREEN_BITS: + case LOCAL_GL_BLUE_BITS: + case LOCAL_GL_ALPHA_BITS: + case LOCAL_GL_DEPTH_BITS: + case LOCAL_GL_STENCIL_BITS: { + // Deprecated and removed in GL Core profiles, so special handling required. + GLint val; + if (!GetChannelBits(funcName, pname, &val)) + return JS::NullValue(); + + return JS::Int32Value(val); + } + + case LOCAL_GL_MAX_TEXTURE_SIZE: + return JS::Int32Value(mImplMaxTextureSize); + + case LOCAL_GL_MAX_CUBE_MAP_TEXTURE_SIZE: + return JS::Int32Value(mImplMaxCubeMapTextureSize); + + case LOCAL_GL_MAX_RENDERBUFFER_SIZE: + return JS::Int32Value(mImplMaxRenderbufferSize); + + case LOCAL_GL_MAX_VERTEX_UNIFORM_VECTORS: + return JS::Int32Value(mGLMaxVertexUniformVectors); + + case LOCAL_GL_MAX_FRAGMENT_UNIFORM_VECTORS: + return JS::Int32Value(mGLMaxFragmentUniformVectors); + + case LOCAL_GL_MAX_VARYING_VECTORS: + return JS::Int32Value(mGLMaxVaryingVectors); + + case LOCAL_GL_COMPRESSED_TEXTURE_FORMATS: { + uint32_t length = mCompressedTextureFormats.Length(); + JSObject* obj = dom::Uint32Array::Create(cx, this, length, + mCompressedTextureFormats.Elements()); + if (!obj) { + rv = NS_ERROR_OUT_OF_MEMORY; + } + return JS::ObjectOrNullValue(obj); + } + + // unsigned int. here we may have to return very large values like 2^32-1 that can't be represented as + // javascript integer values. We just return them as doubles and javascript doesn't care. + case LOCAL_GL_STENCIL_BACK_VALUE_MASK: + return JS::DoubleValue(mStencilValueMaskBack); // pass as FP value to allow large values such as 2^32-1. + + case LOCAL_GL_STENCIL_BACK_WRITEMASK: + return JS::DoubleValue(mStencilWriteMaskBack); + + case LOCAL_GL_STENCIL_VALUE_MASK: + return JS::DoubleValue(mStencilValueMaskFront); + + case LOCAL_GL_STENCIL_WRITEMASK: + return JS::DoubleValue(mStencilWriteMaskFront); + + // float + case LOCAL_GL_LINE_WIDTH: + return JS::DoubleValue(mLineWidth); + + case LOCAL_GL_DEPTH_CLEAR_VALUE: + case LOCAL_GL_POLYGON_OFFSET_FACTOR: + case LOCAL_GL_POLYGON_OFFSET_UNITS: + case LOCAL_GL_SAMPLE_COVERAGE_VALUE: { + GLfloat f = 0.f; + gl->fGetFloatv(pname, &f); + return JS::DoubleValue(f); + } + + // bool + case LOCAL_GL_BLEND: + case LOCAL_GL_DEPTH_TEST: + case LOCAL_GL_STENCIL_TEST: + case LOCAL_GL_CULL_FACE: + case LOCAL_GL_DITHER: + case LOCAL_GL_POLYGON_OFFSET_FILL: + case LOCAL_GL_SCISSOR_TEST: + case LOCAL_GL_SAMPLE_COVERAGE_INVERT: + case LOCAL_GL_DEPTH_WRITEMASK: { + realGLboolean b = 0; + gl->fGetBooleanv(pname, &b); + return JS::BooleanValue(bool(b)); + } + + // bool, WebGL-specific + case UNPACK_FLIP_Y_WEBGL: + return JS::BooleanValue(mPixelStore_FlipY); + case UNPACK_PREMULTIPLY_ALPHA_WEBGL: + return JS::BooleanValue(mPixelStore_PremultiplyAlpha); + + // uint, WebGL-specific + case UNPACK_COLORSPACE_CONVERSION_WEBGL: + return JS::NumberValue(uint32_t(mPixelStore_ColorspaceConversion)); + + //////////////////////////////// + // Complex values + + // 2 floats + case LOCAL_GL_DEPTH_RANGE: + case LOCAL_GL_ALIASED_POINT_SIZE_RANGE: + case LOCAL_GL_ALIASED_LINE_WIDTH_RANGE: { + GLenum driverPName = pname; + if (gl->IsCoreProfile() && + driverPName == LOCAL_GL_ALIASED_POINT_SIZE_RANGE) + { + driverPName = LOCAL_GL_POINT_SIZE_RANGE; + } + + GLfloat fv[2] = { 0 }; + gl->fGetFloatv(driverPName, fv); + JSObject* obj = dom::Float32Array::Create(cx, this, 2, fv); + if (!obj) { + rv = NS_ERROR_OUT_OF_MEMORY; + } + return JS::ObjectOrNullValue(obj); + } + + // 4 floats + case LOCAL_GL_COLOR_CLEAR_VALUE: + case LOCAL_GL_BLEND_COLOR: { + GLfloat fv[4] = { 0 }; + gl->fGetFloatv(pname, fv); + JSObject* obj = dom::Float32Array::Create(cx, this, 4, fv); + if (!obj) { + rv = NS_ERROR_OUT_OF_MEMORY; + } + return JS::ObjectOrNullValue(obj); + } + + // 2 ints + case LOCAL_GL_MAX_VIEWPORT_DIMS: { + GLint iv[2] = { 0 }; + gl->fGetIntegerv(pname, iv); + JSObject* obj = dom::Int32Array::Create(cx, this, 2, iv); + if (!obj) { + rv = NS_ERROR_OUT_OF_MEMORY; + } + return JS::ObjectOrNullValue(obj); + } + + // 4 ints + case LOCAL_GL_SCISSOR_BOX: + case LOCAL_GL_VIEWPORT: { + GLint iv[4] = { 0 }; + gl->fGetIntegerv(pname, iv); + JSObject* obj = dom::Int32Array::Create(cx, this, 4, iv); + if (!obj) { + rv = NS_ERROR_OUT_OF_MEMORY; + } + return JS::ObjectOrNullValue(obj); + } + + // 4 bools + case LOCAL_GL_COLOR_WRITEMASK: { + realGLboolean gl_bv[4] = { 0 }; + gl->fGetBooleanv(pname, gl_bv); + bool vals[4] = { bool(gl_bv[0]), bool(gl_bv[1]), + bool(gl_bv[2]), bool(gl_bv[3]) }; + JS::Rooted arr(cx); + if (!dom::ToJSValue(cx, vals, &arr)) { + rv = NS_ERROR_OUT_OF_MEMORY; + } + return arr; + } + + case LOCAL_GL_ARRAY_BUFFER_BINDING: { + return WebGLObjectAsJSValue(cx, mBoundArrayBuffer.get(), rv); + } + + case LOCAL_GL_ELEMENT_ARRAY_BUFFER_BINDING: { + return WebGLObjectAsJSValue(cx, mBoundVertexArray->mElementArrayBuffer.get(), rv); + } + + case LOCAL_GL_RENDERBUFFER_BINDING: { + return WebGLObjectAsJSValue(cx, mBoundRenderbuffer.get(), rv); + } + + // DRAW_FRAMEBUFFER_BINDING is the same as FRAMEBUFFER_BINDING. + case LOCAL_GL_FRAMEBUFFER_BINDING: { + return WebGLObjectAsJSValue(cx, mBoundDrawFramebuffer.get(), rv); + } + + case LOCAL_GL_CURRENT_PROGRAM: { + return WebGLObjectAsJSValue(cx, mCurrentProgram.get(), rv); + } + + case LOCAL_GL_TEXTURE_BINDING_2D: { + return WebGLObjectAsJSValue(cx, mBound2DTextures[mActiveTexture].get(), rv); + } + + case LOCAL_GL_TEXTURE_BINDING_CUBE_MAP: { + return WebGLObjectAsJSValue(cx, mBoundCubeMapTextures[mActiveTexture].get(), rv); + } + + default: + break; + } + + ErrorInvalidEnumInfo("getParameter: parameter", pname); + return JS::NullValue(); +} + +void +WebGLContext::GetParameterIndexed(JSContext* cx, GLenum pname, GLuint index, + JS::MutableHandle retval) +{ + if (IsContextLost()) { + retval.setNull(); + return; + } + + MakeContextCurrent(); + + switch (pname) { + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: + { + if (index >= mGLMaxTransformFeedbackSeparateAttribs) { + ErrorInvalidValue("getParameterIndexed: index should be less than MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", index); + retval.setNull(); + return; + } + retval.setNull(); // See bug 903594 + return; + } + + default: + break; + } + + ErrorInvalidEnumInfo("getParameterIndexed: parameter", pname); + retval.setNull(); +} + +bool +WebGLContext::IsEnabled(GLenum cap) +{ + if (IsContextLost()) + return false; + + if (!ValidateCapabilityEnum(cap, "isEnabled")) + return false; + + MakeContextCurrent(); + return gl->fIsEnabled(cap); +} + +bool +WebGLContext::ValidateCapabilityEnum(GLenum cap, const char* info) +{ + switch (cap) { + case LOCAL_GL_BLEND: + case LOCAL_GL_CULL_FACE: + case LOCAL_GL_DEPTH_TEST: + case LOCAL_GL_DITHER: + case LOCAL_GL_POLYGON_OFFSET_FILL: + case LOCAL_GL_SAMPLE_ALPHA_TO_COVERAGE: + case LOCAL_GL_SAMPLE_COVERAGE: + case LOCAL_GL_SCISSOR_TEST: + case LOCAL_GL_STENCIL_TEST: + return true; + case LOCAL_GL_RASTERIZER_DISCARD: + return IsWebGL2(); + default: + ErrorInvalidEnumInfo(info, cap); + return false; + } +} + +realGLboolean* +WebGLContext::GetStateTrackingSlot(GLenum cap) +{ + switch (cap) { + case LOCAL_GL_DEPTH_TEST: + return &mDepthTestEnabled; + case LOCAL_GL_DITHER: + return &mDitherEnabled; + case LOCAL_GL_RASTERIZER_DISCARD: + return &mRasterizerDiscardEnabled; + case LOCAL_GL_SCISSOR_TEST: + return &mScissorTestEnabled; + case LOCAL_GL_STENCIL_TEST: + return &mStencilTestEnabled; + } + + return nullptr; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextTextures.cpp b/dom/canvas/WebGLContextTextures.cpp new file mode 100644 index 000000000..30716438f --- /dev/null +++ b/dom/canvas/WebGLContextTextures.cpp @@ -0,0 +1,415 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" +#include "WebGLContextUtils.h" +#include "WebGLBuffer.h" +#include "WebGLVertexAttribData.h" +#include "WebGLShader.h" +#include "WebGLProgram.h" +#include "WebGLUniformLocation.h" +#include "WebGLFramebuffer.h" +#include "WebGLRenderbuffer.h" +#include "WebGLShaderPrecisionFormat.h" +#include "WebGLTexture.h" +#include "WebGLExtensions.h" +#include "WebGLVertexArray.h" + +#include "nsString.h" +#include "nsDebug.h" +#include "nsReadableUtils.h" + +#include "gfxContext.h" +#include "gfxPlatform.h" +#include "GLContext.h" + +#include "nsContentUtils.h" +#include "nsError.h" +#include "nsLayoutUtils.h" + +#include "CanvasUtils.h" +#include "gfxUtils.h" + +#include "jsfriendapi.h" + +#include "WebGLTexelConversions.h" +#include "WebGLValidateStrings.h" +#include + +// needed to check if current OS is lower than 10.7 +#if defined(MOZ_WIDGET_COCOA) +#include "nsCocoaFeatures.h" +#endif + +#include "mozilla/DebugOnly.h" +#include "mozilla/dom/BindingUtils.h" +#include "mozilla/dom/ImageData.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/EndianUtils.h" + +namespace mozilla { + +static bool +IsValidTexTarget(WebGLContext* webgl, uint8_t funcDims, GLenum rawTexTarget, + TexTarget* const out) +{ + uint8_t targetDims; + + switch (rawTexTarget) { + case LOCAL_GL_TEXTURE_2D: + case LOCAL_GL_TEXTURE_CUBE_MAP: + targetDims = 2; + break; + + case LOCAL_GL_TEXTURE_3D: + case LOCAL_GL_TEXTURE_2D_ARRAY: + if (!webgl->IsWebGL2()) + return false; + + targetDims = 3; + break; + + default: + return false; + } + + // Some funcs (like GenerateMipmap) doesn't know the dimension, so don't check it. + if (funcDims && targetDims != funcDims) + return false; + + *out = rawTexTarget; + return true; +} + +static bool +IsValidTexImageTarget(WebGLContext* webgl, uint8_t funcDims, GLenum rawTexImageTarget, + TexImageTarget* const out) +{ + uint8_t targetDims; + + switch (rawTexImageTarget) { + case LOCAL_GL_TEXTURE_2D: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + targetDims = 2; + break; + + case LOCAL_GL_TEXTURE_3D: + case LOCAL_GL_TEXTURE_2D_ARRAY: + if (!webgl->IsWebGL2()) + return false; + + targetDims = 3; + break; + + default: + return false; + } + + if (targetDims != funcDims) + return false; + + *out = rawTexImageTarget; + return true; +} + +bool +ValidateTexTarget(WebGLContext* webgl, const char* funcName, uint8_t funcDims, + GLenum rawTexTarget, TexTarget* const out_texTarget, + WebGLTexture** const out_tex) +{ + if (webgl->IsContextLost()) + return false; + + TexTarget texTarget; + if (!IsValidTexTarget(webgl, funcDims, rawTexTarget, &texTarget)) { + webgl->ErrorInvalidEnum("%s: Invalid texTarget.", funcName); + return false; + } + + WebGLTexture* tex = webgl->ActiveBoundTextureForTarget(texTarget); + if (!tex) { + webgl->ErrorInvalidOperation("%s: No texture is bound to this target.", funcName); + return false; + } + + *out_texTarget = texTarget; + *out_tex = tex; + return true; +} + +bool +ValidateTexImageTarget(WebGLContext* webgl, const char* funcName, uint8_t funcDims, + GLenum rawTexImageTarget, TexImageTarget* const out_texImageTarget, + WebGLTexture** const out_tex) +{ + if (webgl->IsContextLost()) + return false; + + TexImageTarget texImageTarget; + if (!IsValidTexImageTarget(webgl, funcDims, rawTexImageTarget, &texImageTarget)) { + webgl->ErrorInvalidEnum("%s: Invalid texImageTarget.", funcName); + return false; + } + + WebGLTexture* tex = webgl->ActiveBoundTextureForTexImageTarget(texImageTarget); + if (!tex) { + webgl->ErrorInvalidOperation("%s: No texture is bound to this target.", funcName); + return false; + } + + *out_texImageTarget = texImageTarget; + *out_tex = tex; + return true; +} + +/*virtual*/ bool +WebGLContext::IsTexParamValid(GLenum pname) const +{ + switch (pname) { + case LOCAL_GL_TEXTURE_MIN_FILTER: + case LOCAL_GL_TEXTURE_MAG_FILTER: + case LOCAL_GL_TEXTURE_WRAP_S: + case LOCAL_GL_TEXTURE_WRAP_T: + return true; + + case LOCAL_GL_TEXTURE_MAX_ANISOTROPY_EXT: + return IsExtensionEnabled(WebGLExtensionID::EXT_texture_filter_anisotropic); + + default: + return false; + } +} + +void +WebGLContext::InvalidateResolveCacheForTextureWithTexUnit(const GLuint texUnit) +{ + if (mBound2DTextures[texUnit]) + mBound2DTextures[texUnit]->InvalidateResolveCache(); + if (mBoundCubeMapTextures[texUnit]) + mBoundCubeMapTextures[texUnit]->InvalidateResolveCache(); + if (mBound3DTextures[texUnit]) + mBound3DTextures[texUnit]->InvalidateResolveCache(); + if (mBound2DArrayTextures[texUnit]) + mBound2DArrayTextures[texUnit]->InvalidateResolveCache(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// GL calls + +void +WebGLContext::BindTexture(GLenum rawTarget, WebGLTexture* newTex) +{ + if (IsContextLost()) + return; + + if (newTex && !ValidateObject("bindTexture", *newTex)) + return; + + // Need to check rawTarget first before comparing against newTex->Target() as + // newTex->Target() returns a TexTarget, which will assert on invalid value. + WebGLRefPtr* currentTexPtr = nullptr; + switch (rawTarget) { + case LOCAL_GL_TEXTURE_2D: + currentTexPtr = &mBound2DTextures[mActiveTexture]; + break; + + case LOCAL_GL_TEXTURE_CUBE_MAP: + currentTexPtr = &mBoundCubeMapTextures[mActiveTexture]; + break; + + case LOCAL_GL_TEXTURE_3D: + if (IsWebGL2()) + currentTexPtr = &mBound3DTextures[mActiveTexture]; + break; + + case LOCAL_GL_TEXTURE_2D_ARRAY: + if (IsWebGL2()) + currentTexPtr = &mBound2DArrayTextures[mActiveTexture]; + break; + } + + if (!currentTexPtr) { + ErrorInvalidEnumInfo("bindTexture: target", rawTarget); + return; + } + + const TexTarget texTarget(rawTarget); + + MakeContextCurrent(); + + if (newTex) { + if (!newTex->BindTexture(texTarget)) + return; + } else { + gl->fBindTexture(texTarget.get(), 0); + } + + *currentTexPtr = newTex; +} + +void +WebGLContext::GenerateMipmap(GLenum rawTexTarget) +{ + const char funcName[] = "generateMipmap"; + const uint8_t funcDims = 0; + + TexTarget texTarget; + WebGLTexture* tex; + if (!ValidateTexTarget(this, funcName, funcDims, rawTexTarget, &texTarget, &tex)) + return; + + tex->GenerateMipmap(texTarget); +} + +JS::Value +WebGLContext::GetTexParameter(GLenum rawTexTarget, GLenum pname) +{ + const char funcName[] = "getTexParameter"; + const uint8_t funcDims = 0; + + TexTarget texTarget; + WebGLTexture* tex; + if (!ValidateTexTarget(this, funcName, funcDims, rawTexTarget, &texTarget, &tex)) + return JS::NullValue(); + + if (!IsTexParamValid(pname)) { + ErrorInvalidEnumInfo("getTexParameter: pname", pname); + return JS::NullValue(); + } + + return tex->GetTexParameter(texTarget, pname); +} + +bool +WebGLContext::IsTexture(WebGLTexture* tex) +{ + if (!ValidateIsObject("isTexture", tex)) + return false; + + return tex->IsTexture(); +} + +void +WebGLContext::TexParameter_base(GLenum rawTexTarget, GLenum pname, + const FloatOrInt& param) +{ + const char funcName[] = "texParameter"; + const uint8_t funcDims = 0; + + TexTarget texTarget; + WebGLTexture* tex; + if (!ValidateTexTarget(this, funcName, funcDims, rawTexTarget, &texTarget, &tex)) + return; + + tex->TexParameter(texTarget, pname, param); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// Uploads + +void +WebGLContext::CompressedTexImage(const char* funcName, uint8_t funcDims, GLenum rawTarget, + GLint level, GLenum internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLint border, + const TexImageSource& src) +{ + TexImageTarget target; + WebGLTexture* tex; + if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex)) + return; + + tex->CompressedTexImage(funcName, target, level, internalFormat, width, height, depth, + border, src); +} + +void +WebGLContext::CompressedTexSubImage(const char* funcName, uint8_t funcDims, + GLenum rawTarget, GLint level, GLint xOffset, + GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, GLenum unpackFormat, + const TexImageSource& src) +{ + TexImageTarget target; + WebGLTexture* tex; + if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex)) + return; + + tex->CompressedTexSubImage(funcName, target, level, xOffset, yOffset, zOffset, width, + height, depth, unpackFormat, src); +} + +//// + +void +WebGLContext::CopyTexImage2D(GLenum rawTarget, GLint level, GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border) +{ + const char funcName[] = "copyTexImage2D"; + const uint8_t funcDims = 2; + + TexImageTarget target; + WebGLTexture* tex; + if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex)) + return; + + tex->CopyTexImage2D(target, level, internalFormat, x, y, width, height, border); +} + +void +WebGLContext::CopyTexSubImage(const char* funcName, uint8_t funcDims, GLenum rawTarget, + GLint level, GLint xOffset, GLint yOffset, GLint zOffset, + GLint x, GLint y, GLsizei width, GLsizei height) +{ + TexImageTarget target; + WebGLTexture* tex; + if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex)) + return; + + tex->CopyTexSubImage(funcName, target, level, xOffset, yOffset, zOffset, x, y, width, + height); +} + +//// + +void +WebGLContext::TexImage(const char* funcName, uint8_t funcDims, GLenum rawTarget, + GLint level, GLenum internalFormat, GLsizei width, GLsizei height, + GLsizei depth, GLint border, GLenum unpackFormat, + GLenum unpackType, const TexImageSource& src) +{ + TexImageTarget target; + WebGLTexture* tex; + if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex)) + return; + + const webgl::PackingInfo pi = {unpackFormat, unpackType}; + tex->TexImage(funcName, target, level, internalFormat, width, height, depth, border, + pi, src); +} + +void +WebGLContext::TexSubImage(const char* funcName, uint8_t funcDims, GLenum rawTarget, + GLint level, GLint xOffset, GLint yOffset, GLint zOffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum unpackFormat, GLenum unpackType, + const TexImageSource& src) +{ + TexImageTarget target; + WebGLTexture* tex; + if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex)) + return; + + const webgl::PackingInfo pi = {unpackFormat, unpackType}; + tex->TexSubImage(funcName, target, level, xOffset, yOffset, zOffset, width, height, + depth, pi, src); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextUnchecked.cpp b/dom/canvas/WebGLContextUnchecked.cpp new file mode 100644 index 000000000..d00586f11 --- /dev/null +++ b/dom/canvas/WebGLContextUnchecked.cpp @@ -0,0 +1,19 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set ts=8 sts=4 et sw=4 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContextUnchecked.h" + +#include "GLContext.h" +#include "WebGLSampler.h" + +namespace mozilla { + +WebGLContextUnchecked::WebGLContextUnchecked(gl::GLContext* _gl) + : mGL_OnlyClearInDestroyResourcesAndContext(_gl) + , gl(mGL_OnlyClearInDestroyResourcesAndContext) // const reference +{ } + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextUnchecked.h b/dom/canvas/WebGLContextUnchecked.h new file mode 100644 index 000000000..eb5736f15 --- /dev/null +++ b/dom/canvas/WebGLContextUnchecked.h @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set ts=8 sts=4 et sw=4 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGLCONTEXTUNCHECKED_H +#define WEBGLCONTEXTUNCHECKED_H + +#include "mozilla/RefPtr.h" +#include "WebGLTypes.h" + +namespace mozilla { + +class WebGLBuffer; +class WebGLSampler; + +class WebGLContextUnchecked +{ +public: + explicit WebGLContextUnchecked(gl::GLContext* gl); + +protected: + // We've had issues in the past with nulling `gl` without actually releasing + // all of our resources. This construction ensures that we are aware that we + // should only null `gl` in DestroyResourcesAndContext. + RefPtr mGL_OnlyClearInDestroyResourcesAndContext; +public: + // Grab a const reference so we can see changes, but can't make changes. + const decltype(mGL_OnlyClearInDestroyResourcesAndContext)& gl; +}; + +} // namespace mozilla + +#endif // !WEBGLCONTEXTUNCHECKED_H diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp new file mode 100644 index 000000000..9c0d34939 --- /dev/null +++ b/dom/canvas/WebGLContextUtils.cpp @@ -0,0 +1,877 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContextUtils.h" +#include "WebGLContext.h" + +#include "GLContext.h" +#include "jsapi.h" +#include "mozilla/dom/ScriptSettings.h" +#include "mozilla/Preferences.h" +#include "nsIDOMDataContainerEvent.h" +#include "nsIDOMEvent.h" +#include "nsIScriptSecurityManager.h" +#include "nsIVariant.h" +#include "nsPrintfCString.h" +#include "nsServiceManagerUtils.h" +#include "prprf.h" +#include +#include "WebGLBuffer.h" +#include "WebGLExtensions.h" +#include "WebGLFramebuffer.h" +#include "WebGLProgram.h" +#include "WebGLTexture.h" +#include "WebGLVertexArray.h" + +namespace mozilla { + +TexTarget +TexImageTargetToTexTarget(TexImageTarget texImageTarget) +{ + switch (texImageTarget.get()) { + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + return LOCAL_GL_TEXTURE_CUBE_MAP; + + default: + return texImageTarget.get(); + } +} + +JS::Value +StringValue(JSContext* cx, const char* chars, ErrorResult& rv) +{ + JSString* str = JS_NewStringCopyZ(cx, chars); + if (!str) { + rv.Throw(NS_ERROR_OUT_OF_MEMORY); + return JS::NullValue(); + } + + return JS::StringValue(str); +} + +void +WebGLContext::GenerateWarning(const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + + GenerateWarning(fmt, ap); + + va_end(ap); +} + +void +WebGLContext::GenerateWarning(const char* fmt, va_list ap) +{ + if (!ShouldGenerateWarnings()) + return; + + mAlreadyGeneratedWarnings++; + + char buf[1024]; + PR_vsnprintf(buf, 1024, fmt, ap); + + // no need to print to stderr, as JS_ReportWarning takes care of this for us. + + if (!mCanvasElement) { + return; + } + + dom::AutoJSAPI api; + if (!api.Init(mCanvasElement->OwnerDoc()->GetScopeObject())) { + return; + } + + JSContext* cx = api.cx(); + JS_ReportWarningASCII(cx, "WebGL: %s", buf); + if (!ShouldGenerateWarnings()) { + JS_ReportWarningASCII(cx, + "WebGL: No further warnings will be reported for" + " this WebGL context." + " (already reported %d warnings)", + mAlreadyGeneratedWarnings); + } +} + +bool +WebGLContext::ShouldGenerateWarnings() const +{ + if (mMaxWarnings == -1) + return true; + + return mAlreadyGeneratedWarnings < mMaxWarnings; +} + +void +WebGLContext::SynthesizeGLError(GLenum err) +{ + /* ES2 section 2.5 "GL Errors" states that implementations can have + * multiple 'flags', as errors might be caught in different parts of + * a distributed implementation. + * We're signing up as a distributed implementation here, with + * separate flags for WebGL and the underlying GLContext. + */ + if (!mWebGLError) + mWebGLError = err; +} + +void +WebGLContext::SynthesizeGLError(GLenum err, const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + GenerateWarning(fmt, va); + va_end(va); + + return SynthesizeGLError(err); +} + +void +WebGLContext::ErrorInvalidEnum(const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + GenerateWarning(fmt, va); + va_end(va); + + return SynthesizeGLError(LOCAL_GL_INVALID_ENUM); +} + +void +WebGLContext::ErrorInvalidEnumInfo(const char* info, GLenum enumValue) +{ + nsCString name; + EnumName(enumValue, &name); + + return ErrorInvalidEnum("%s: invalid enum value %s", info, name.BeginReading()); +} + +void +WebGLContext::ErrorInvalidEnumInfo(const char* info, const char* funcName, + GLenum enumValue) +{ + nsCString name; + EnumName(enumValue, &name); + + ErrorInvalidEnum("%s: %s: Invalid enum: 0x%04x (%s).", funcName, info, + enumValue, name.BeginReading()); +} + +void +WebGLContext::ErrorInvalidOperation(const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + GenerateWarning(fmt, va); + va_end(va); + + return SynthesizeGLError(LOCAL_GL_INVALID_OPERATION); +} + +void +WebGLContext::ErrorInvalidValue(const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + GenerateWarning(fmt, va); + va_end(va); + + return SynthesizeGLError(LOCAL_GL_INVALID_VALUE); +} + +void +WebGLContext::ErrorInvalidFramebufferOperation(const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + GenerateWarning(fmt, va); + va_end(va); + + return SynthesizeGLError(LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION); +} + +void +WebGLContext::ErrorOutOfMemory(const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + GenerateWarning(fmt, va); + va_end(va); + + return SynthesizeGLError(LOCAL_GL_OUT_OF_MEMORY); +} + +void +WebGLContext::ErrorImplementationBug(const char* fmt, ...) +{ + const nsPrintfCString warning("Implementation bug, please file at %s! %s", + "https://bugzilla.mozilla.org/", fmt); + + va_list va; + va_start(va, fmt); + GenerateWarning(warning.BeginReading(), va); + va_end(va); + + MOZ_ASSERT(false, "WebGLContext::ErrorImplementationBug"); + NS_ERROR("WebGLContext::ErrorImplementationBug"); + return SynthesizeGLError(LOCAL_GL_OUT_OF_MEMORY); +} + +const char* +WebGLContext::ErrorName(GLenum error) +{ + switch(error) { + case LOCAL_GL_INVALID_ENUM: + return "INVALID_ENUM"; + case LOCAL_GL_INVALID_OPERATION: + return "INVALID_OPERATION"; + case LOCAL_GL_INVALID_VALUE: + return "INVALID_VALUE"; + case LOCAL_GL_OUT_OF_MEMORY: + return "OUT_OF_MEMORY"; + case LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION: + return "INVALID_FRAMEBUFFER_OPERATION"; + case LOCAL_GL_NO_ERROR: + return "NO_ERROR"; + default: + MOZ_ASSERT(false); + return "[unknown WebGL error]"; + } +} + +// This version is fallible and will return nullptr if unrecognized. +static const char* +GetEnumName(GLenum val) +{ + switch (val) { +#define XX(x) case LOCAL_GL_##x: return #x + XX(NONE); + XX(ALPHA); + XX(ATC_RGB); + XX(ATC_RGBA_EXPLICIT_ALPHA); + XX(ATC_RGBA_INTERPOLATED_ALPHA); + XX(COMPRESSED_RGBA_PVRTC_2BPPV1); + XX(COMPRESSED_RGBA_PVRTC_4BPPV1); + XX(COMPRESSED_RGBA_S3TC_DXT1_EXT); + XX(COMPRESSED_RGBA_S3TC_DXT3_EXT); + XX(COMPRESSED_RGBA_S3TC_DXT5_EXT); + XX(COMPRESSED_RGB_PVRTC_2BPPV1); + XX(COMPRESSED_RGB_PVRTC_4BPPV1); + XX(COMPRESSED_RGB_S3TC_DXT1_EXT); + XX(DEPTH_ATTACHMENT); + XX(DEPTH_COMPONENT); + XX(DEPTH_COMPONENT16); + XX(DEPTH_COMPONENT32); + XX(DEPTH_STENCIL); + XX(DEPTH24_STENCIL8); + XX(DRAW_FRAMEBUFFER); + XX(ETC1_RGB8_OES); + XX(FLOAT); + XX(INT); + XX(FRAMEBUFFER); + XX(HALF_FLOAT); + XX(LUMINANCE); + XX(LUMINANCE_ALPHA); + XX(READ_FRAMEBUFFER); + XX(RGB); + XX(RGB16F); + XX(RGB32F); + XX(RGBA); + XX(RGBA16F); + XX(RGBA32F); + XX(SRGB); + XX(SRGB_ALPHA); + XX(TEXTURE_2D); + XX(TEXTURE_3D); + XX(TEXTURE_CUBE_MAP); + XX(TEXTURE_CUBE_MAP_NEGATIVE_X); + XX(TEXTURE_CUBE_MAP_NEGATIVE_Y); + XX(TEXTURE_CUBE_MAP_NEGATIVE_Z); + XX(TEXTURE_CUBE_MAP_POSITIVE_X); + XX(TEXTURE_CUBE_MAP_POSITIVE_Y); + XX(TEXTURE_CUBE_MAP_POSITIVE_Z); + XX(UNSIGNED_BYTE); + XX(UNSIGNED_INT); + XX(UNSIGNED_INT_24_8); + XX(UNSIGNED_SHORT); + XX(UNSIGNED_SHORT_4_4_4_4); + XX(UNSIGNED_SHORT_5_5_5_1); + XX(UNSIGNED_SHORT_5_6_5); + XX(READ_BUFFER); + XX(UNPACK_ROW_LENGTH); + XX(UNPACK_SKIP_ROWS); + XX(UNPACK_SKIP_PIXELS); + XX(PACK_ROW_LENGTH); + XX(PACK_SKIP_ROWS); + XX(PACK_SKIP_PIXELS); + XX(COLOR); + XX(DEPTH); + XX(STENCIL); + XX(RED); + XX(RGB8); + XX(RGBA8); + XX(RGB10_A2); + XX(TEXTURE_BINDING_3D); + XX(UNPACK_SKIP_IMAGES); + XX(UNPACK_IMAGE_HEIGHT); + XX(TEXTURE_WRAP_R); + XX(MAX_3D_TEXTURE_SIZE); + XX(UNSIGNED_INT_2_10_10_10_REV); + XX(MAX_ELEMENTS_VERTICES); + XX(MAX_ELEMENTS_INDICES); + XX(TEXTURE_MIN_LOD); + XX(TEXTURE_MAX_LOD); + XX(TEXTURE_BASE_LEVEL); + XX(TEXTURE_MAX_LEVEL); + XX(MIN); + XX(MAX); + XX(DEPTH_COMPONENT24); + XX(MAX_TEXTURE_LOD_BIAS); + XX(TEXTURE_COMPARE_MODE); + XX(TEXTURE_COMPARE_FUNC); + XX(CURRENT_QUERY); + XX(QUERY_RESULT); + XX(QUERY_RESULT_AVAILABLE); + XX(STREAM_READ); + XX(STREAM_COPY); + XX(STATIC_READ); + XX(STATIC_COPY); + XX(DYNAMIC_READ); + XX(DYNAMIC_COPY); + XX(MAX_DRAW_BUFFERS); + XX(DRAW_BUFFER0); + XX(DRAW_BUFFER1); + XX(DRAW_BUFFER2); + XX(DRAW_BUFFER3); + XX(DRAW_BUFFER4); + XX(DRAW_BUFFER5); + XX(DRAW_BUFFER6); + XX(DRAW_BUFFER7); + XX(DRAW_BUFFER8); + XX(DRAW_BUFFER9); + XX(DRAW_BUFFER10); + XX(DRAW_BUFFER11); + XX(DRAW_BUFFER12); + XX(DRAW_BUFFER13); + XX(DRAW_BUFFER14); + XX(DRAW_BUFFER15); + XX(MAX_FRAGMENT_UNIFORM_COMPONENTS); + XX(MAX_VERTEX_UNIFORM_COMPONENTS); + XX(SAMPLER_3D); + XX(SAMPLER_2D_SHADOW); + XX(FRAGMENT_SHADER_DERIVATIVE_HINT); + XX(PIXEL_PACK_BUFFER); + XX(PIXEL_UNPACK_BUFFER); + XX(PIXEL_PACK_BUFFER_BINDING); + XX(PIXEL_UNPACK_BUFFER_BINDING); + XX(FLOAT_MAT2x3); + XX(FLOAT_MAT2x4); + XX(FLOAT_MAT3x2); + XX(FLOAT_MAT3x4); + XX(FLOAT_MAT4x2); + XX(FLOAT_MAT4x3); + XX(SRGB8); + XX(SRGB8_ALPHA8); + XX(COMPARE_REF_TO_TEXTURE); + XX(VERTEX_ATTRIB_ARRAY_INTEGER); + XX(MAX_ARRAY_TEXTURE_LAYERS); + XX(MIN_PROGRAM_TEXEL_OFFSET); + XX(MAX_PROGRAM_TEXEL_OFFSET); + XX(MAX_VARYING_COMPONENTS); + XX(TEXTURE_2D_ARRAY); + XX(TEXTURE_BINDING_2D_ARRAY); + XX(R11F_G11F_B10F); + XX(UNSIGNED_INT_10F_11F_11F_REV); + XX(RGB9_E5); + XX(UNSIGNED_INT_5_9_9_9_REV); + XX(TRANSFORM_FEEDBACK_BUFFER_MODE); + XX(MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS); + XX(TRANSFORM_FEEDBACK_VARYINGS); + XX(TRANSFORM_FEEDBACK_BUFFER_START); + XX(TRANSFORM_FEEDBACK_BUFFER_SIZE); + XX(TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); + XX(RASTERIZER_DISCARD); + XX(MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS); + XX(MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS); + XX(INTERLEAVED_ATTRIBS); + XX(SEPARATE_ATTRIBS); + XX(TRANSFORM_FEEDBACK_BUFFER); + XX(TRANSFORM_FEEDBACK_BUFFER_BINDING); + XX(RGBA32UI); + XX(RGB32UI); + XX(RGBA16UI); + XX(RGB16UI); + XX(RGBA8UI); + XX(RGB8UI); + XX(RGBA32I); + XX(RGB32I); + XX(RGBA16I); + XX(RGB16I); + XX(RGBA8I); + XX(RGB8I); + XX(RED_INTEGER); + XX(RGB_INTEGER); + XX(RGBA_INTEGER); + XX(SAMPLER_2D_ARRAY); + XX(SAMPLER_2D_ARRAY_SHADOW); + XX(SAMPLER_CUBE_SHADOW); + XX(UNSIGNED_INT_VEC2); + XX(UNSIGNED_INT_VEC3); + XX(UNSIGNED_INT_VEC4); + XX(INT_SAMPLER_2D); + XX(INT_SAMPLER_3D); + XX(INT_SAMPLER_CUBE); + XX(INT_SAMPLER_2D_ARRAY); + XX(UNSIGNED_INT_SAMPLER_2D); + XX(UNSIGNED_INT_SAMPLER_3D); + XX(UNSIGNED_INT_SAMPLER_CUBE); + XX(UNSIGNED_INT_SAMPLER_2D_ARRAY); + XX(DEPTH_COMPONENT32F); + XX(DEPTH32F_STENCIL8); + XX(FLOAT_32_UNSIGNED_INT_24_8_REV); + XX(FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING); + XX(FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE); + XX(FRAMEBUFFER_ATTACHMENT_RED_SIZE); + XX(FRAMEBUFFER_ATTACHMENT_GREEN_SIZE); + XX(FRAMEBUFFER_ATTACHMENT_BLUE_SIZE); + XX(FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE); + XX(FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE); + XX(FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE); + XX(FRAMEBUFFER_DEFAULT); + XX(DEPTH_STENCIL_ATTACHMENT); + XX(UNSIGNED_NORMALIZED); + XX(DRAW_FRAMEBUFFER_BINDING); + XX(READ_FRAMEBUFFER_BINDING); + XX(RENDERBUFFER_SAMPLES); + XX(FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER); + XX(MAX_COLOR_ATTACHMENTS); + XX(COLOR_ATTACHMENT0); + XX(COLOR_ATTACHMENT1); + XX(COLOR_ATTACHMENT2); + XX(COLOR_ATTACHMENT3); + XX(COLOR_ATTACHMENT4); + XX(COLOR_ATTACHMENT5); + XX(COLOR_ATTACHMENT6); + XX(COLOR_ATTACHMENT7); + XX(COLOR_ATTACHMENT8); + XX(COLOR_ATTACHMENT9); + XX(COLOR_ATTACHMENT10); + XX(COLOR_ATTACHMENT11); + XX(COLOR_ATTACHMENT12); + XX(COLOR_ATTACHMENT13); + XX(COLOR_ATTACHMENT14); + XX(COLOR_ATTACHMENT15); + XX(FRAMEBUFFER_INCOMPLETE_MULTISAMPLE); + XX(MAX_SAMPLES); + XX(RG); + XX(RG_INTEGER); + XX(R8); + XX(RG8); + XX(R16F); + XX(R32F); + XX(RG16F); + XX(RG32F); + XX(R8I); + XX(R8UI); + XX(R16I); + XX(R16UI); + XX(R32I); + XX(R32UI); + XX(RG8I); + XX(RG8UI); + XX(RG16I); + XX(RG16UI); + XX(RG32I); + XX(RG32UI); + XX(VERTEX_ARRAY_BINDING); + XX(R8_SNORM); + XX(RG8_SNORM); + XX(RGB8_SNORM); + XX(RGBA8_SNORM); + XX(SIGNED_NORMALIZED); + XX(PRIMITIVE_RESTART_FIXED_INDEX); + XX(COPY_READ_BUFFER); + XX(COPY_WRITE_BUFFER); + XX(UNIFORM_BUFFER); + XX(UNIFORM_BUFFER_BINDING); + XX(UNIFORM_BUFFER_START); + XX(UNIFORM_BUFFER_SIZE); + XX(MAX_VERTEX_UNIFORM_BLOCKS); + XX(MAX_FRAGMENT_UNIFORM_BLOCKS); + XX(MAX_COMBINED_UNIFORM_BLOCKS); + XX(MAX_UNIFORM_BUFFER_BINDINGS); + XX(MAX_UNIFORM_BLOCK_SIZE); + XX(MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS); + XX(MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS); + XX(UNIFORM_BUFFER_OFFSET_ALIGNMENT); + XX(ACTIVE_UNIFORM_BLOCKS); + XX(UNIFORM_TYPE); + XX(UNIFORM_SIZE); + XX(UNIFORM_BLOCK_INDEX); + XX(UNIFORM_OFFSET); + XX(UNIFORM_ARRAY_STRIDE); + XX(UNIFORM_MATRIX_STRIDE); + XX(UNIFORM_IS_ROW_MAJOR); + XX(UNIFORM_BLOCK_BINDING); + XX(UNIFORM_BLOCK_DATA_SIZE); + XX(UNIFORM_BLOCK_ACTIVE_UNIFORMS); + XX(UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES); + XX(UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER); + XX(UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER); + XX(MAX_VERTEX_OUTPUT_COMPONENTS); + XX(MAX_FRAGMENT_INPUT_COMPONENTS); + XX(MAX_SERVER_WAIT_TIMEOUT); + XX(OBJECT_TYPE); + XX(SYNC_CONDITION); + XX(SYNC_STATUS); + XX(SYNC_FLAGS); + XX(SYNC_FENCE); + XX(SYNC_GPU_COMMANDS_COMPLETE); + XX(UNSIGNALED); + XX(SIGNALED); + XX(ALREADY_SIGNALED); + XX(TIMEOUT_EXPIRED); + XX(CONDITION_SATISFIED); + XX(WAIT_FAILED); + XX(VERTEX_ATTRIB_ARRAY_DIVISOR); + XX(ANY_SAMPLES_PASSED); + XX(ANY_SAMPLES_PASSED_CONSERVATIVE); + XX(SAMPLER_BINDING); + XX(RGB10_A2UI); + XX(TEXTURE_SWIZZLE_R); + XX(TEXTURE_SWIZZLE_G); + XX(TEXTURE_SWIZZLE_B); + XX(TEXTURE_SWIZZLE_A); + XX(GREEN); + XX(BLUE); + XX(INT_2_10_10_10_REV); + XX(TRANSFORM_FEEDBACK); + XX(TRANSFORM_FEEDBACK_PAUSED); + XX(TRANSFORM_FEEDBACK_ACTIVE); + XX(TRANSFORM_FEEDBACK_BINDING); + XX(COMPRESSED_R11_EAC); + XX(COMPRESSED_SIGNED_R11_EAC); + XX(COMPRESSED_RG11_EAC); + XX(COMPRESSED_SIGNED_RG11_EAC); + XX(COMPRESSED_RGB8_ETC2); + XX(COMPRESSED_SRGB8_ETC2); + XX(COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2); + XX(COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2); + XX(COMPRESSED_RGBA8_ETC2_EAC); + XX(COMPRESSED_SRGB8_ALPHA8_ETC2_EAC); + XX(TEXTURE_IMMUTABLE_FORMAT); + XX(MAX_ELEMENT_INDEX); + XX(NUM_SAMPLE_COUNTS); + XX(TEXTURE_IMMUTABLE_LEVELS); +#undef XX + } + + return nullptr; +} + +/*static*/ void +WebGLContext::EnumName(GLenum val, nsCString* out_name) +{ + const char* name = GetEnumName(val); + if (name) { + *out_name = name; + return; + } + + *out_name = nsPrintfCString("", val); +} + +void +WebGLContext::ErrorInvalidEnumArg(const char* funcName, const char* argName, GLenum val) +{ + nsCString enumName; + EnumName(val, &enumName); + ErrorInvalidEnum("%s: Bad `%s`: %s", funcName, argName, enumName.BeginReading()); +} + +bool +IsCompressedTextureFormat(GLenum format) +{ + switch (format) { + case LOCAL_GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: + case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: + case LOCAL_GL_ATC_RGB: + case LOCAL_GL_ATC_RGBA_EXPLICIT_ALPHA: + case LOCAL_GL_ATC_RGBA_INTERPOLATED_ALPHA: + case LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1: + case LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1: + case LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1: + case LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1: + case LOCAL_GL_ETC1_RGB8_OES: + case LOCAL_GL_COMPRESSED_R11_EAC: + case LOCAL_GL_COMPRESSED_SIGNED_R11_EAC: + case LOCAL_GL_COMPRESSED_RG11_EAC: + case LOCAL_GL_COMPRESSED_SIGNED_RG11_EAC: + case LOCAL_GL_COMPRESSED_RGB8_ETC2: + case LOCAL_GL_COMPRESSED_SRGB8_ETC2: + case LOCAL_GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case LOCAL_GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case LOCAL_GL_COMPRESSED_RGBA8_ETC2_EAC: + case LOCAL_GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: + return true; + default: + return false; + } +} + + +bool +IsTextureFormatCompressed(TexInternalFormat format) +{ + return IsCompressedTextureFormat(format.get()); +} + +GLenum +WebGLContext::GetAndFlushUnderlyingGLErrors() +{ + // Get and clear GL error in ALL cases. + GLenum error = gl->fGetError(); + + // Only store in mUnderlyingGLError if is hasn't already recorded an + // error. + if (!mUnderlyingGLError) + mUnderlyingGLError = error; + + return error; +} + +#ifdef DEBUG +// For NaNs, etc. +static bool +IsCacheCorrect(float cached, float actual) +{ + if (IsNaN(cached)) { + // GL is allowed to do anything it wants for NaNs, so if we're shadowing + // a NaN, then whatever `actual` is might be correct. + return true; + } + + return cached == actual; +} + +void +AssertUintParamCorrect(gl::GLContext* gl, GLenum pname, GLuint shadow) +{ + GLuint val = 0; + gl->GetUIntegerv(pname, &val); + if (val != shadow) { + printf_stderr("Failed 0x%04x shadow: Cached 0x%x/%u, should be 0x%x/%u.\n", + pname, shadow, shadow, val, val); + MOZ_ASSERT(false, "Bad cached value."); + } +} + +void +AssertMaskedUintParamCorrect(gl::GLContext* gl, GLenum pname, GLuint mask, + GLuint shadow) +{ + GLuint val = 0; + gl->GetUIntegerv(pname, &val); + + const GLuint valMasked = val & mask; + const GLuint shadowMasked = shadow & mask; + + if (valMasked != shadowMasked) { + printf_stderr("Failed 0x%04x shadow: Cached 0x%x/%u, should be 0x%x/%u.\n", + pname, shadowMasked, shadowMasked, valMasked, valMasked); + MOZ_ASSERT(false, "Bad cached value."); + } +} +#else +void +AssertUintParamCorrect(gl::GLContext*, GLenum, GLuint) +{ +} +#endif + +void +WebGLContext::AssertCachedBindings() +{ +#ifdef DEBUG + MakeContextCurrent(); + + GetAndFlushUnderlyingGLErrors(); + + if (IsWebGL2() || IsExtensionEnabled(WebGLExtensionID::OES_vertex_array_object)) { + GLuint bound = mBoundVertexArray ? mBoundVertexArray->GLName() : 0; + AssertUintParamCorrect(gl, LOCAL_GL_VERTEX_ARRAY_BINDING, bound); + } + + // Framebuffers + if (IsWebGL2()) { + GLuint bound = mBoundDrawFramebuffer ? mBoundDrawFramebuffer->mGLName + : 0; + AssertUintParamCorrect(gl, LOCAL_GL_DRAW_FRAMEBUFFER_BINDING, bound); + + bound = mBoundReadFramebuffer ? mBoundReadFramebuffer->mGLName : 0; + AssertUintParamCorrect(gl, LOCAL_GL_READ_FRAMEBUFFER_BINDING, bound); + } else { + MOZ_ASSERT(mBoundDrawFramebuffer == mBoundReadFramebuffer); + GLuint bound = mBoundDrawFramebuffer ? mBoundDrawFramebuffer->mGLName + : 0; + AssertUintParamCorrect(gl, LOCAL_GL_FRAMEBUFFER_BINDING, bound); + } + + GLint stencilBits = 0; + if (GetStencilBits(&stencilBits)) { // Depends on current draw framebuffer. + const GLuint stencilRefMask = (1 << stencilBits) - 1; + + AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_REF, stencilRefMask, mStencilRefFront); + AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_REF, stencilRefMask, mStencilRefBack); + } + + // Program + GLuint bound = mCurrentProgram ? mCurrentProgram->mGLName : 0; + AssertUintParamCorrect(gl, LOCAL_GL_CURRENT_PROGRAM, bound); + + // Textures + GLenum activeTexture = mActiveTexture + LOCAL_GL_TEXTURE0; + AssertUintParamCorrect(gl, LOCAL_GL_ACTIVE_TEXTURE, activeTexture); + + WebGLTexture* curTex = ActiveBoundTextureForTarget(LOCAL_GL_TEXTURE_2D); + bound = curTex ? curTex->mGLName : 0; + AssertUintParamCorrect(gl, LOCAL_GL_TEXTURE_BINDING_2D, bound); + + curTex = ActiveBoundTextureForTarget(LOCAL_GL_TEXTURE_CUBE_MAP); + bound = curTex ? curTex->mGLName : 0; + AssertUintParamCorrect(gl, LOCAL_GL_TEXTURE_BINDING_CUBE_MAP, bound); + + // Buffers + bound = mBoundArrayBuffer ? mBoundArrayBuffer->mGLName : 0; + AssertUintParamCorrect(gl, LOCAL_GL_ARRAY_BUFFER_BINDING, bound); + + MOZ_ASSERT(mBoundVertexArray); + WebGLBuffer* curBuff = mBoundVertexArray->mElementArrayBuffer; + bound = curBuff ? curBuff->mGLName : 0; + AssertUintParamCorrect(gl, LOCAL_GL_ELEMENT_ARRAY_BUFFER_BINDING, bound); + + MOZ_ASSERT(!GetAndFlushUnderlyingGLErrors()); +#endif + + // We do not check the renderbuffer binding, because we never rely on it matching. +} + +void +WebGLContext::AssertCachedGlobalState() +{ +#ifdef DEBUG + MakeContextCurrent(); + + GetAndFlushUnderlyingGLErrors(); + + //////////////// + + // Draw state + MOZ_ASSERT(gl->fIsEnabled(LOCAL_GL_DEPTH_TEST) == mDepthTestEnabled); + MOZ_ASSERT(gl->fIsEnabled(LOCAL_GL_DITHER) == mDitherEnabled); + MOZ_ASSERT_IF(IsWebGL2(), + gl->fIsEnabled(LOCAL_GL_RASTERIZER_DISCARD) == mRasterizerDiscardEnabled); + MOZ_ASSERT(gl->fIsEnabled(LOCAL_GL_SCISSOR_TEST) == mScissorTestEnabled); + MOZ_ASSERT(gl->fIsEnabled(LOCAL_GL_STENCIL_TEST) == mStencilTestEnabled); + + realGLboolean colorWriteMask[4] = {0, 0, 0, 0}; + gl->fGetBooleanv(LOCAL_GL_COLOR_WRITEMASK, colorWriteMask); + MOZ_ASSERT(colorWriteMask[0] == mColorWriteMask[0] && + colorWriteMask[1] == mColorWriteMask[1] && + colorWriteMask[2] == mColorWriteMask[2] && + colorWriteMask[3] == mColorWriteMask[3]); + + GLfloat colorClearValue[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + gl->fGetFloatv(LOCAL_GL_COLOR_CLEAR_VALUE, colorClearValue); + MOZ_ASSERT(IsCacheCorrect(mColorClearValue[0], colorClearValue[0]) && + IsCacheCorrect(mColorClearValue[1], colorClearValue[1]) && + IsCacheCorrect(mColorClearValue[2], colorClearValue[2]) && + IsCacheCorrect(mColorClearValue[3], colorClearValue[3])); + + realGLboolean depthWriteMask = 0; + gl->fGetBooleanv(LOCAL_GL_DEPTH_WRITEMASK, &depthWriteMask); + MOZ_ASSERT(depthWriteMask == mDepthWriteMask); + + GLfloat depthClearValue = 0.0f; + gl->fGetFloatv(LOCAL_GL_DEPTH_CLEAR_VALUE, &depthClearValue); + MOZ_ASSERT(IsCacheCorrect(mDepthClearValue, depthClearValue)); + + AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_CLEAR_VALUE, mStencilClearValue); + + // GLES 3.0.4, $4.1.4, p177: + // [...] the front and back stencil mask are both set to the value `2^s - 1`, where + // `s` is greater than or equal to the number of bits in the deepest stencil buffer + // supported by the GL implementation. + const int maxStencilBits = 8; + const GLuint maxStencilBitsMask = (1 << maxStencilBits) - 1; + AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_VALUE_MASK, maxStencilBitsMask, mStencilValueMaskFront); + AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_VALUE_MASK, maxStencilBitsMask, mStencilValueMaskBack); + + AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_WRITEMASK, maxStencilBitsMask, mStencilWriteMaskFront); + AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_WRITEMASK, maxStencilBitsMask, mStencilWriteMaskBack); + + // Viewport + GLint int4[4] = {0, 0, 0, 0}; + gl->fGetIntegerv(LOCAL_GL_VIEWPORT, int4); + MOZ_ASSERT(int4[0] == mViewportX && + int4[1] == mViewportY && + int4[2] == mViewportWidth && + int4[3] == mViewportHeight); + + AssertUintParamCorrect(gl, LOCAL_GL_PACK_ALIGNMENT, mPixelStore_PackAlignment); + AssertUintParamCorrect(gl, LOCAL_GL_UNPACK_ALIGNMENT, mPixelStore_UnpackAlignment); + + if (IsWebGL2()) { + AssertUintParamCorrect(gl, LOCAL_GL_UNPACK_IMAGE_HEIGHT, mPixelStore_UnpackImageHeight); + AssertUintParamCorrect(gl, LOCAL_GL_UNPACK_SKIP_IMAGES , mPixelStore_UnpackSkipImages); + AssertUintParamCorrect(gl, LOCAL_GL_UNPACK_ROW_LENGTH , mPixelStore_UnpackRowLength); + AssertUintParamCorrect(gl, LOCAL_GL_UNPACK_SKIP_ROWS , mPixelStore_UnpackSkipRows); + AssertUintParamCorrect(gl, LOCAL_GL_UNPACK_SKIP_PIXELS , mPixelStore_UnpackSkipPixels); + AssertUintParamCorrect(gl, LOCAL_GL_PACK_ROW_LENGTH , mPixelStore_PackRowLength); + AssertUintParamCorrect(gl, LOCAL_GL_PACK_SKIP_ROWS , mPixelStore_PackSkipRows); + AssertUintParamCorrect(gl, LOCAL_GL_PACK_SKIP_PIXELS , mPixelStore_PackSkipPixels); + } + + MOZ_ASSERT(!GetAndFlushUnderlyingGLErrors()); +#endif +} + +const char* +InfoFrom(WebGLTexImageFunc func, WebGLTexDimensions dims) +{ + switch (dims) { + case WebGLTexDimensions::Tex2D: + switch (func) { + case WebGLTexImageFunc::TexImage: return "texImage2D"; + case WebGLTexImageFunc::TexSubImage: return "texSubImage2D"; + case WebGLTexImageFunc::CopyTexImage: return "copyTexImage2D"; + case WebGLTexImageFunc::CopyTexSubImage: return "copyTexSubImage2D"; + case WebGLTexImageFunc::CompTexImage: return "compressedTexImage2D"; + case WebGLTexImageFunc::CompTexSubImage: return "compressedTexSubImage2D"; + default: + MOZ_CRASH("GFX: invalid 2D TexDimensions"); + } + case WebGLTexDimensions::Tex3D: + switch (func) { + case WebGLTexImageFunc::TexImage: return "texImage3D"; + case WebGLTexImageFunc::TexSubImage: return "texSubImage3D"; + case WebGLTexImageFunc::CopyTexSubImage: return "copyTexSubImage3D"; + case WebGLTexImageFunc::CompTexSubImage: return "compressedTexSubImage3D"; + default: + MOZ_CRASH("GFX: invalid 3D TexDimensions"); + } + default: + MOZ_CRASH("GFX: invalid TexDimensions"); + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextUtils.h b/dom/canvas/WebGLContextUtils.h new file mode 100644 index 000000000..5401fc878 --- /dev/null +++ b/dom/canvas/WebGLContextUtils.h @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_CONTEXT_UTILS_H_ +#define WEBGL_CONTEXT_UTILS_H_ + +#include "WebGLContext.h" + +#include "mozilla/Assertions.h" +#include "mozilla/dom/BindingUtils.h" + +#include "WebGLStrongTypes.h" + +namespace mozilla { + +// For use with the different texture calls, i.e. +// TexImage2D, CopyTex[Sub]Image2D, ... +// that take a "target" parameter. This parameter is not always the same as +// the texture binding location, like GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. +// For example, cube maps would pass GL_TEXTURE_CUBE_MAP_[POS|NEG]_[X|Y|Z] +// instead of just GL_TEXTURE_CUBE_MAP. +// +// This function converts the texture image target to the texture target a.k.a. +// binding location. The returned binding location can be used to check that +// the currently bound texture is appropriate for this texImageTarget. +// +// Returns GL_NONE if passed an invalid texture image target +TexTarget TexImageTargetToTexTarget(TexImageTarget texImageTarget); + +// Helper function to create a JS::Value from a C string +JS::Value StringValue(JSContext* cx, const char* str, ErrorResult& rv); + +struct GLComponents +{ + unsigned char mComponents; + + enum Components { + Red = (1 << 0), + Green = (1 << 1), + Blue = (1 << 2), + Alpha = (1 << 3), + Stencil = (1 << 4), + Depth = (1 << 5), + }; + + GLComponents() + : mComponents(0) + {} + + explicit GLComponents(TexInternalFormat format); + + // Returns true iff other has all (or more) of + // the components present in this GLComponents + bool IsSubsetOf(const GLComponents& other) const; +}; + +template +JS::Value +WebGLContext::WebGLObjectAsJSValue(JSContext* cx, const WebGLObjectType* object, + ErrorResult& rv) const +{ + if (!object) + return JS::NullValue(); + + MOZ_ASSERT(this == object->mContext); + JS::Rooted v(cx); + JS::Rooted wrapper(cx, GetWrapper()); + JSAutoCompartment ac(cx, wrapper); + if (!dom::GetOrCreateDOMReflector(cx, const_cast(object), &v)) { + rv.Throw(NS_ERROR_FAILURE); + return JS::NullValue(); + } + return v; +} + +template +JSObject* +WebGLContext::WebGLObjectAsJSObject(JSContext* cx, + const WebGLObjectType* object, + ErrorResult& rv) const +{ + JS::Value v = WebGLObjectAsJSValue(cx, object, rv); + if (v.isNull()) + return nullptr; + + return &v.toObject(); +} + +/** + * Return the displayable name for the texture function that is the + * source for validation. + */ +const char* InfoFrom(WebGLTexImageFunc func, WebGLTexDimensions dims); + +} // namespace mozilla + +#endif // WEBGL_CONTEXT_UTILS_H_ diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp new file mode 100644 index 000000000..ebf0aa8c2 --- /dev/null +++ b/dom/canvas/WebGLContextValidate.cpp @@ -0,0 +1,816 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" + +#include +#include "angle/ShaderLang.h" +#include "CanvasUtils.h" +#include "gfxPrefs.h" +#include "GLContext.h" +#include "jsfriendapi.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/Preferences.h" +#include "mozilla/Services.h" +#include "nsIObserverService.h" +#include "nsPrintfCString.h" +#include "WebGLActiveInfo.h" +#include "WebGLBuffer.h" +#include "WebGLContextUtils.h" +#include "WebGLFramebuffer.h" +#include "WebGLProgram.h" +#include "WebGLRenderbuffer.h" +#include "WebGLSampler.h" +#include "WebGLShader.h" +#include "WebGLTexture.h" +#include "WebGLUniformLocation.h" +#include "WebGLValidateStrings.h" +#include "WebGLVertexArray.h" +#include "WebGLVertexAttribData.h" + +#if defined(MOZ_WIDGET_COCOA) +#include "nsCocoaFeatures.h" +#endif + +namespace mozilla { + +bool +WebGLContext::ValidateBlendEquationEnum(GLenum mode, const char* info) +{ + switch (mode) { + case LOCAL_GL_FUNC_ADD: + case LOCAL_GL_FUNC_SUBTRACT: + case LOCAL_GL_FUNC_REVERSE_SUBTRACT: + return true; + + case LOCAL_GL_MIN: + case LOCAL_GL_MAX: + if (IsWebGL2() || + IsExtensionEnabled(WebGLExtensionID::EXT_blend_minmax)) + { + return true; + } + + break; + + default: + break; + } + + ErrorInvalidEnumInfo(info, mode); + return false; +} + +bool +WebGLContext::ValidateBlendFuncDstEnum(GLenum factor, const char* info) +{ + switch (factor) { + case LOCAL_GL_ZERO: + case LOCAL_GL_ONE: + case LOCAL_GL_SRC_COLOR: + case LOCAL_GL_ONE_MINUS_SRC_COLOR: + case LOCAL_GL_DST_COLOR: + case LOCAL_GL_ONE_MINUS_DST_COLOR: + case LOCAL_GL_SRC_ALPHA: + case LOCAL_GL_ONE_MINUS_SRC_ALPHA: + case LOCAL_GL_DST_ALPHA: + case LOCAL_GL_ONE_MINUS_DST_ALPHA: + case LOCAL_GL_CONSTANT_COLOR: + case LOCAL_GL_ONE_MINUS_CONSTANT_COLOR: + case LOCAL_GL_CONSTANT_ALPHA: + case LOCAL_GL_ONE_MINUS_CONSTANT_ALPHA: + return true; + + default: + ErrorInvalidEnumInfo(info, factor); + return false; + } +} + +bool +WebGLContext::ValidateBlendFuncSrcEnum(GLenum factor, const char* info) +{ + if (factor == LOCAL_GL_SRC_ALPHA_SATURATE) + return true; + + return ValidateBlendFuncDstEnum(factor, info); +} + +bool +WebGLContext::ValidateBlendFuncEnumsCompatibility(GLenum sfactor, + GLenum dfactor, + const char* info) +{ + bool sfactorIsConstantColor = sfactor == LOCAL_GL_CONSTANT_COLOR || + sfactor == LOCAL_GL_ONE_MINUS_CONSTANT_COLOR; + bool sfactorIsConstantAlpha = sfactor == LOCAL_GL_CONSTANT_ALPHA || + sfactor == LOCAL_GL_ONE_MINUS_CONSTANT_ALPHA; + bool dfactorIsConstantColor = dfactor == LOCAL_GL_CONSTANT_COLOR || + dfactor == LOCAL_GL_ONE_MINUS_CONSTANT_COLOR; + bool dfactorIsConstantAlpha = dfactor == LOCAL_GL_CONSTANT_ALPHA || + dfactor == LOCAL_GL_ONE_MINUS_CONSTANT_ALPHA; + if ( (sfactorIsConstantColor && dfactorIsConstantAlpha) || + (dfactorIsConstantColor && sfactorIsConstantAlpha) ) + { + ErrorInvalidOperation("%s are mutually incompatible, see section 6.8 in" + " the WebGL 1.0 spec", info); + return false; + } + + return true; +} + +bool +WebGLContext::ValidateComparisonEnum(GLenum target, const char* info) +{ + switch (target) { + case LOCAL_GL_NEVER: + case LOCAL_GL_LESS: + case LOCAL_GL_LEQUAL: + case LOCAL_GL_GREATER: + case LOCAL_GL_GEQUAL: + case LOCAL_GL_EQUAL: + case LOCAL_GL_NOTEQUAL: + case LOCAL_GL_ALWAYS: + return true; + + default: + ErrorInvalidEnumInfo(info, target); + return false; + } +} + +bool +WebGLContext::ValidateStencilOpEnum(GLenum action, const char* info) +{ + switch (action) { + case LOCAL_GL_KEEP: + case LOCAL_GL_ZERO: + case LOCAL_GL_REPLACE: + case LOCAL_GL_INCR: + case LOCAL_GL_INCR_WRAP: + case LOCAL_GL_DECR: + case LOCAL_GL_DECR_WRAP: + case LOCAL_GL_INVERT: + return true; + + default: + ErrorInvalidEnumInfo(info, action); + return false; + } +} + +bool +WebGLContext::ValidateFaceEnum(GLenum face, const char* info) +{ + switch (face) { + case LOCAL_GL_FRONT: + case LOCAL_GL_BACK: + case LOCAL_GL_FRONT_AND_BACK: + return true; + + default: + ErrorInvalidEnumInfo(info, face); + return false; + } +} + +bool +WebGLContext::ValidateDrawModeEnum(GLenum mode, const char* info) +{ + switch (mode) { + case LOCAL_GL_TRIANGLES: + case LOCAL_GL_TRIANGLE_STRIP: + case LOCAL_GL_TRIANGLE_FAN: + case LOCAL_GL_POINTS: + case LOCAL_GL_LINE_STRIP: + case LOCAL_GL_LINE_LOOP: + case LOCAL_GL_LINES: + return true; + + default: + ErrorInvalidEnumInfo(info, mode); + return false; + } +} + +bool +WebGLContext::ValidateUniformLocation(WebGLUniformLocation* loc, const char* funcName) +{ + /* GLES 2.0.25, p38: + * If the value of location is -1, the Uniform* commands will silently + * ignore the data passed in, and the current uniform values will not be + * changed. + */ + if (!loc) + return false; + + if (!ValidateObjectAllowDeleted(funcName, *loc)) + return false; + + if (!mCurrentProgram) { + ErrorInvalidOperation("%s: No program is currently bound.", funcName); + return false; + } + + return loc->ValidateForProgram(mCurrentProgram, funcName); +} + +bool +WebGLContext::ValidateAttribArraySetter(const char* name, uint32_t setterElemSize, + uint32_t arrayLength) +{ + if (IsContextLost()) + return false; + + if (arrayLength < setterElemSize) { + ErrorInvalidValue("%s: Array must have >= %d elements.", name, + setterElemSize); + return false; + } + + return true; +} + +bool +WebGLContext::ValidateUniformSetter(WebGLUniformLocation* loc, + uint8_t setterElemSize, GLenum setterType, + const char* funcName) +{ + if (IsContextLost()) + return false; + + if (!ValidateUniformLocation(loc, funcName)) + return false; + + if (!loc->ValidateSizeAndType(setterElemSize, setterType, funcName)) + return false; + + return true; +} + +bool +WebGLContext::ValidateUniformArraySetter(WebGLUniformLocation* loc, + uint8_t setterElemSize, + GLenum setterType, + uint32_t setterArraySize, + const char* funcName, + uint32_t* const out_numElementsToUpload) +{ + if (IsContextLost()) + return false; + + if (!ValidateUniformLocation(loc, funcName)) + return false; + + if (!loc->ValidateSizeAndType(setterElemSize, setterType, funcName)) + return false; + + if (!loc->ValidateArrayLength(setterElemSize, setterArraySize, funcName)) + return false; + + const auto& elemCount = loc->mInfo->mActiveInfo->mElemCount; + MOZ_ASSERT(elemCount > loc->mArrayIndex); + const uint32_t uniformElemCount = elemCount - loc->mArrayIndex; + + *out_numElementsToUpload = std::min(uniformElemCount, + setterArraySize / setterElemSize); + return true; +} + +bool +WebGLContext::ValidateUniformMatrixArraySetter(WebGLUniformLocation* loc, + uint8_t setterCols, + uint8_t setterRows, + GLenum setterType, + uint32_t setterArraySize, + bool setterTranspose, + const char* funcName, + uint32_t* const out_numElementsToUpload) +{ + const uint8_t setterElemSize = setterCols * setterRows; + + if (IsContextLost()) + return false; + + if (!ValidateUniformLocation(loc, funcName)) + return false; + + if (!loc->ValidateSizeAndType(setterElemSize, setterType, funcName)) + return false; + + if (!loc->ValidateArrayLength(setterElemSize, setterArraySize, funcName)) + return false; + + if (!ValidateUniformMatrixTranspose(setterTranspose, funcName)) + return false; + + const auto& elemCount = loc->mInfo->mActiveInfo->mElemCount; + MOZ_ASSERT(elemCount > loc->mArrayIndex); + const uint32_t uniformElemCount = elemCount - loc->mArrayIndex; + + *out_numElementsToUpload = std::min(uniformElemCount, + setterArraySize / setterElemSize); + return true; +} + +bool +WebGLContext::ValidateAttribIndex(GLuint index, const char* info) +{ + bool valid = (index < MaxVertexAttribs()); + + if (!valid) { + if (index == GLuint(-1)) { + ErrorInvalidValue("%s: -1 is not a valid `index`. This value" + " probably comes from a getAttribLocation()" + " call, where this return value -1 means" + " that the passed name didn't correspond to" + " an active attribute in the specified" + " program.", info); + } else { + ErrorInvalidValue("%s: `index` must be less than" + " MAX_VERTEX_ATTRIBS.", info); + } + } + + return valid; +} + +bool +WebGLContext::ValidateAttribPointer(bool integerMode, GLuint index, GLint size, GLenum type, + WebGLboolean normalized, GLsizei stride, + WebGLintptr byteOffset, const char* info) +{ + WebGLBuffer* buffer = mBoundArrayBuffer; + if (!buffer) { + ErrorInvalidOperation("%s: must have valid GL_ARRAY_BUFFER binding", info); + return false; + } + + uint32_t requiredAlignment = 0; + if (!ValidateAttribPointerType(integerMode, type, &requiredAlignment, info)) + return false; + + // requiredAlignment should always be a power of two + MOZ_ASSERT(IsPowerOfTwo(requiredAlignment)); + GLsizei requiredAlignmentMask = requiredAlignment - 1; + + if (size < 1 || size > 4) { + ErrorInvalidValue("%s: invalid element size", info); + return false; + } + + switch (type) { + case LOCAL_GL_INT_2_10_10_10_REV: + case LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV: + if (size != 4) { + ErrorInvalidOperation("%s: size must be 4 for this type.", info); + return false; + } + break; + } + + // see WebGL spec section 6.6 "Vertex Attribute Data Stride" + if (stride < 0 || stride > 255) { + ErrorInvalidValue("%s: negative or too large stride", info); + return false; + } + + if (byteOffset < 0) { + ErrorInvalidValue("%s: negative offset", info); + return false; + } + + if (stride & requiredAlignmentMask) { + ErrorInvalidOperation("%s: stride doesn't satisfy the alignment " + "requirement of given type", info); + return false; + } + + if (byteOffset & requiredAlignmentMask) { + ErrorInvalidOperation("%s: byteOffset doesn't satisfy the alignment " + "requirement of given type", info); + return false; + } + + return true; +} + +bool +WebGLContext::ValidateStencilParamsForDrawCall() +{ + const char msg[] = "%s set different front and back stencil %s. Drawing in" + " this configuration is not allowed."; + + if (mStencilRefFront != mStencilRefBack) { + ErrorInvalidOperation(msg, "stencilFuncSeparate", "reference values"); + return false; + } + + if (mStencilValueMaskFront != mStencilValueMaskBack) { + ErrorInvalidOperation(msg, "stencilFuncSeparate", "value masks"); + return false; + } + + if (mStencilWriteMaskFront != mStencilWriteMaskBack) { + ErrorInvalidOperation(msg, "stencilMaskSeparate", "write masks"); + return false; + } + + return true; +} + +static inline int32_t +FloorPOT(int32_t x) +{ + MOZ_ASSERT(x > 0); + int32_t pot = 1; + while (pot < 0x40000000) { + if (x < pot*2) + break; + pot *= 2; + } + return pot; +} + +bool +WebGLContext::InitAndValidateGL(FailureReason* const out_failReason) +{ + MOZ_RELEASE_ASSERT(gl, "GFX: GL not initialized"); + + // Unconditionally create a new format usage authority. This is + // important when restoring contexts and extensions need to add + // formats back into the authority. + mFormatUsage = CreateFormatUsage(gl); + if (!mFormatUsage) { + *out_failReason = { "FEATURE_FAILURE_WEBGL_FORMAT", + "Failed to create mFormatUsage." }; + return false; + } + + GLenum error = gl->fGetError(); + if (error != LOCAL_GL_NO_ERROR) { + const nsPrintfCString reason("GL error 0x%x occurred during OpenGL context" + " initialization, before WebGL initialization!", + error); + *out_failReason = { "FEATURE_FAILURE_WEBGL_GLERR_1", reason }; + return false; + } + + mMinCapability = gfxPrefs::WebGLMinCapabilityMode(); + mDisableExtensions = gfxPrefs::WebGLDisableExtensions(); + mLoseContextOnMemoryPressure = gfxPrefs::WebGLLoseContextOnMemoryPressure(); + mCanLoseContextInForeground = gfxPrefs::WebGLCanLoseContextInForeground(); + mRestoreWhenVisible = gfxPrefs::WebGLRestoreWhenVisible(); + + if (MinCapabilityMode()) + mDisableFragHighP = true; + + // These are the default values, see 6.2 State tables in the + // OpenGL ES 2.0.25 spec. + mColorWriteMask[0] = 1; + mColorWriteMask[1] = 1; + mColorWriteMask[2] = 1; + mColorWriteMask[3] = 1; + mDepthWriteMask = 1; + mColorClearValue[0] = 0.f; + mColorClearValue[1] = 0.f; + mColorClearValue[2] = 0.f; + mColorClearValue[3] = 0.f; + mDepthClearValue = 1.f; + mStencilClearValue = 0; + mStencilRefFront = 0; + mStencilRefBack = 0; + + mLineWidth = 1.0; + + /* + // Technically, we should be setting mStencil[...] values to + // `allOnes`, but either ANGLE breaks or the SGX540s on Try break. + GLuint stencilBits = 0; + gl->GetUIntegerv(LOCAL_GL_STENCIL_BITS, &stencilBits); + GLuint allOnes = ~(UINT32_MAX << stencilBits); + mStencilValueMaskFront = allOnes; + mStencilValueMaskBack = allOnes; + mStencilWriteMaskFront = allOnes; + mStencilWriteMaskBack = allOnes; + */ + + gl->GetUIntegerv(LOCAL_GL_STENCIL_VALUE_MASK, &mStencilValueMaskFront); + gl->GetUIntegerv(LOCAL_GL_STENCIL_BACK_VALUE_MASK, &mStencilValueMaskBack); + gl->GetUIntegerv(LOCAL_GL_STENCIL_WRITEMASK, &mStencilWriteMaskFront); + gl->GetUIntegerv(LOCAL_GL_STENCIL_BACK_WRITEMASK, &mStencilWriteMaskBack); + + AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_VALUE_MASK, mStencilValueMaskFront); + AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_VALUE_MASK, mStencilValueMaskBack); + AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_WRITEMASK, mStencilWriteMaskFront); + AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_WRITEMASK, mStencilWriteMaskBack); + + mDitherEnabled = true; + mRasterizerDiscardEnabled = false; + mScissorTestEnabled = false; + mGenerateMipmapHint = LOCAL_GL_DONT_CARE; + + // Bindings, etc. + mActiveTexture = 0; + mDefaultFB_DrawBuffer0 = LOCAL_GL_BACK; + + mEmitContextLostErrorOnce = true; + mWebGLError = LOCAL_GL_NO_ERROR; + mUnderlyingGLError = LOCAL_GL_NO_ERROR; + + mBound2DTextures.Clear(); + mBoundCubeMapTextures.Clear(); + mBound3DTextures.Clear(); + mBound2DArrayTextures.Clear(); + mBoundSamplers.Clear(); + + mBoundArrayBuffer = nullptr; + mCurrentProgram = nullptr; + + mBoundDrawFramebuffer = nullptr; + mBoundReadFramebuffer = nullptr; + mBoundRenderbuffer = nullptr; + + MakeContextCurrent(); + + if (MinCapabilityMode()) + mGLMaxVertexAttribs = MINVALUE_GL_MAX_VERTEX_ATTRIBS; + else + gl->GetUIntegerv(LOCAL_GL_MAX_VERTEX_ATTRIBS, &mGLMaxVertexAttribs); + + if (mGLMaxVertexAttribs < 8) { + const nsPrintfCString reason("GL_MAX_VERTEX_ATTRIBS: %d is < 8!", + mGLMaxVertexAttribs); + *out_failReason = { "FEATURE_FAILURE_WEBGL_V_ATRB", reason }; + return false; + } + + // Note: GL_MAX_TEXTURE_UNITS is fixed at 4 for most desktop hardware, + // even though the hardware supports much more. The + // GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS value is the accurate value. + if (MinCapabilityMode()) + mGLMaxTextureUnits = MINVALUE_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS; + else + mGLMaxTextureUnits = gl->GetIntAs(LOCAL_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS); + + if (mGLMaxTextureUnits < 8) { + const nsPrintfCString reason("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: %d is < 8!", + mGLMaxTextureUnits); + *out_failReason = { "FEATURE_FAILURE_WEBGL_T_UNIT", reason }; + return false; + } + + mBound2DTextures.SetLength(mGLMaxTextureUnits); + mBoundCubeMapTextures.SetLength(mGLMaxTextureUnits); + mBound3DTextures.SetLength(mGLMaxTextureUnits); + mBound2DArrayTextures.SetLength(mGLMaxTextureUnits); + mBoundSamplers.SetLength(mGLMaxTextureUnits); + + gl->fGetIntegerv(LOCAL_GL_MAX_VIEWPORT_DIMS, (GLint*)mImplMaxViewportDims); + + //////////////// + + if (MinCapabilityMode()) { + mImplMaxTextureSize = MINVALUE_GL_MAX_TEXTURE_SIZE; + mImplMaxCubeMapTextureSize = MINVALUE_GL_MAX_CUBE_MAP_TEXTURE_SIZE; + mImplMaxRenderbufferSize = MINVALUE_GL_MAX_RENDERBUFFER_SIZE; + + mImplMax3DTextureSize = MINVALUE_GL_MAX_3D_TEXTURE_SIZE; + mImplMaxArrayTextureLayers = MINVALUE_GL_MAX_ARRAY_TEXTURE_LAYERS; + + mGLMaxTextureImageUnits = MINVALUE_GL_MAX_TEXTURE_IMAGE_UNITS; + mGLMaxVertexTextureImageUnits = MINVALUE_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS; + } else { + gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, (GLint*)&mImplMaxTextureSize); + gl->fGetIntegerv(LOCAL_GL_MAX_CUBE_MAP_TEXTURE_SIZE, (GLint*)&mImplMaxCubeMapTextureSize); + gl->fGetIntegerv(LOCAL_GL_MAX_RENDERBUFFER_SIZE, (GLint*)&mImplMaxRenderbufferSize); + + if (!gl->GetPotentialInteger(LOCAL_GL_MAX_3D_TEXTURE_SIZE, (GLint*)&mImplMax3DTextureSize)) + mImplMax3DTextureSize = 0; + if (!gl->GetPotentialInteger(LOCAL_GL_MAX_ARRAY_TEXTURE_LAYERS, (GLint*)&mImplMaxArrayTextureLayers)) + mImplMaxArrayTextureLayers = 0; + + gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_IMAGE_UNITS, &mGLMaxTextureImageUnits); + gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &mGLMaxVertexTextureImageUnits); + } + + // If we don't support a target, its max size is 0. We should only floor-to-POT if the + // value if it's non-zero. (NB log2(0) is -Inf, so zero isn't an integer power-of-two) + const auto fnFloorPOTIfSupported = [](uint32_t& val) { + if (val) { + val = FloorPOT(val); + } + }; + + fnFloorPOTIfSupported(mImplMaxTextureSize); + fnFloorPOTIfSupported(mImplMaxCubeMapTextureSize); + fnFloorPOTIfSupported(mImplMaxRenderbufferSize); + + fnFloorPOTIfSupported(mImplMax3DTextureSize); + fnFloorPOTIfSupported(mImplMaxArrayTextureLayers); + + //////////////// + + mGLMaxColorAttachments = 1; + mGLMaxDrawBuffers = 1; + gl->GetPotentialInteger(LOCAL_GL_MAX_COLOR_ATTACHMENTS, + (GLint*)&mGLMaxColorAttachments); + gl->GetPotentialInteger(LOCAL_GL_MAX_DRAW_BUFFERS, (GLint*)&mGLMaxDrawBuffers); + + if (MinCapabilityMode()) { + mGLMaxColorAttachments = std::min(mGLMaxColorAttachments, + kMinMaxColorAttachments); + mGLMaxDrawBuffers = std::min(mGLMaxDrawBuffers, kMinMaxDrawBuffers); + } + + if (IsWebGL2()) { + mImplMaxColorAttachments = mGLMaxColorAttachments; + mImplMaxDrawBuffers = std::min(mGLMaxDrawBuffers, mImplMaxColorAttachments); + } else { + mImplMaxColorAttachments = 1; + mImplMaxDrawBuffers = 1; + } + + //////////////// + + if (MinCapabilityMode()) { + mGLMaxFragmentUniformVectors = MINVALUE_GL_MAX_FRAGMENT_UNIFORM_VECTORS; + mGLMaxVertexUniformVectors = MINVALUE_GL_MAX_VERTEX_UNIFORM_VECTORS; + mGLMaxVaryingVectors = MINVALUE_GL_MAX_VARYING_VECTORS; + } else { + if (gl->IsSupported(gl::GLFeature::ES2_compatibility)) { + gl->fGetIntegerv(LOCAL_GL_MAX_FRAGMENT_UNIFORM_VECTORS, &mGLMaxFragmentUniformVectors); + gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_UNIFORM_VECTORS, &mGLMaxVertexUniformVectors); + gl->fGetIntegerv(LOCAL_GL_MAX_VARYING_VECTORS, &mGLMaxVaryingVectors); + } else { + gl->fGetIntegerv(LOCAL_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &mGLMaxFragmentUniformVectors); + mGLMaxFragmentUniformVectors /= 4; + gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_UNIFORM_COMPONENTS, &mGLMaxVertexUniformVectors); + mGLMaxVertexUniformVectors /= 4; + + /* We are now going to try to read GL_MAX_VERTEX_OUTPUT_COMPONENTS + * and GL_MAX_FRAGMENT_INPUT_COMPONENTS, however these constants + * only entered the OpenGL standard at OpenGL 3.2. So we will try + * reading, and check OpenGL error for INVALID_ENUM. + * + * On the public_webgl list, "problematic GetParameter pnames" + * thread, the following formula was given: + * maxVaryingVectors = min(GL_MAX_VERTEX_OUTPUT_COMPONENTS, + * GL_MAX_FRAGMENT_INPUT_COMPONENTS) / 4 + */ + GLint maxVertexOutputComponents = 0; + GLint maxFragmentInputComponents = 0; + + const bool ok = (gl->GetPotentialInteger(LOCAL_GL_MAX_VERTEX_OUTPUT_COMPONENTS, + &maxVertexOutputComponents) && + gl->GetPotentialInteger(LOCAL_GL_MAX_FRAGMENT_INPUT_COMPONENTS, + &maxFragmentInputComponents)); + + if (ok) { + mGLMaxVaryingVectors = std::min(maxVertexOutputComponents, + maxFragmentInputComponents) / 4; + } else { + mGLMaxVaryingVectors = 16; + // 16 = 64/4, and 64 is the min value for + // maxVertexOutputComponents in the OpenGL 3.2 spec. + } + } + } + + if (gl->IsCompatibilityProfile()) { + gl->fEnable(LOCAL_GL_POINT_SPRITE); + } + + if (!gl->IsGLES()) { + gl->fEnable(LOCAL_GL_PROGRAM_POINT_SIZE); + } + +#ifdef XP_MACOSX + if (gl->WorkAroundDriverBugs() && + gl->Vendor() == gl::GLVendor::ATI && + !nsCocoaFeatures::IsAtLeastVersion(10,9)) + { + // The Mac ATI driver, in all known OSX version up to and including + // 10.8, renders points sprites upside-down. (Apple bug 11778921) + gl->fPointParameterf(LOCAL_GL_POINT_SPRITE_COORD_ORIGIN, + LOCAL_GL_LOWER_LEFT); + } +#endif + + if (gl->IsSupported(gl::GLFeature::seamless_cube_map_opt_in)) { + gl->fEnable(LOCAL_GL_TEXTURE_CUBE_MAP_SEAMLESS); + } + + // Check the shader validator pref + mBypassShaderValidation = gfxPrefs::WebGLBypassShaderValidator(); + + // initialize shader translator + if (!ShInitialize()) { + *out_failReason = { "FEATURE_FAILURE_WEBGL_GLSL", + "GLSL translator initialization failed!" }; + return false; + } + + // Mesa can only be detected with the GL_VERSION string, of the form + // "2.1 Mesa 7.11.0" + const char* versionStr = (const char*)(gl->fGetString(LOCAL_GL_VERSION)); + mIsMesa = strstr(versionStr, "Mesa"); + + // Notice that the point of calling fGetError here is not only to check for + // errors, but also to reset the error flags so that a subsequent WebGL + // getError call will give the correct result. + error = gl->fGetError(); + if (error != LOCAL_GL_NO_ERROR) { + const nsPrintfCString reason("GL error 0x%x occurred during WebGL context" + " initialization!", + error); + *out_failReason = { "FEATURE_FAILURE_WEBGL_GLERR_2", reason }; + return false; + } + + if (IsWebGL2() && + !InitWebGL2(out_failReason)) + { + // Todo: Bug 898404: Only allow WebGL2 on GL>=3.0 on desktop GL. + return false; + } + + mDefaultVertexArray = WebGLVertexArray::Create(this); + mDefaultVertexArray->mAttribs.SetLength(mGLMaxVertexAttribs); + mBoundVertexArray = mDefaultVertexArray; + + // OpenGL core profiles remove the default VAO object from version + // 4.0.0. We create a default VAO for all core profiles, + // regardless of version. + // + // GL Spec 4.0.0: + // (https://www.opengl.org/registry/doc/glspec40.core.20100311.pdf) + // in Section E.2.2 "Removed Features", pg 397: "[...] The default + // vertex array object (the name zero) is also deprecated. [...]" + + if (gl->IsCoreProfile()) { + mDefaultVertexArray->GenVertexArray(); + mDefaultVertexArray->BindVertexArray(); + } + + mPixelStore_FlipY = false; + mPixelStore_PremultiplyAlpha = false; + mPixelStore_ColorspaceConversion = BROWSER_DEFAULT_WEBGL; + + // GLES 3.0.4, p259: + mPixelStore_UnpackImageHeight = 0; + mPixelStore_UnpackSkipImages = 0; + mPixelStore_UnpackRowLength = 0; + mPixelStore_UnpackSkipRows = 0; + mPixelStore_UnpackSkipPixels = 0; + mPixelStore_UnpackAlignment = 4; + mPixelStore_PackRowLength = 0; + mPixelStore_PackSkipRows = 0; + mPixelStore_PackSkipPixels = 0; + mPixelStore_PackAlignment = 4; + + mPrimRestartTypeBytes = 0; + + mGenericVertexAttribTypes.reset(new GLenum[mGLMaxVertexAttribs]); + std::fill_n(mGenericVertexAttribTypes.get(), mGLMaxVertexAttribs, LOCAL_GL_FLOAT); + + static const float kDefaultGenericVertexAttribData[4] = { 0, 0, 0, 1 }; + memcpy(mGenericVertexAttrib0Data, kDefaultGenericVertexAttribData, + sizeof(mGenericVertexAttrib0Data)); + + mFakeVertexAttrib0BufferObject = 0; + + return true; +} + +bool +WebGLContext::ValidateFramebufferTarget(GLenum target, + const char* const info) +{ + bool isValid = true; + switch (target) { + case LOCAL_GL_FRAMEBUFFER: + break; + + case LOCAL_GL_DRAW_FRAMEBUFFER: + case LOCAL_GL_READ_FRAMEBUFFER: + isValid = IsWebGL2(); + break; + + default: + isValid = false; + break; + } + + if (MOZ_LIKELY(isValid)) { + return true; + } + + ErrorInvalidEnumArg(info, "target", target); + return false; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextVertexArray.cpp b/dom/canvas/WebGLContextVertexArray.cpp new file mode 100644 index 000000000..5b7a10f22 --- /dev/null +++ b/dom/canvas/WebGLContextVertexArray.cpp @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" + +#include "GLContext.h" +#include "WebGLBuffer.h" +#include "WebGLVertexArray.h" +#include "WebGLVertexAttribData.h" + +namespace mozilla { + +void +WebGLContext::BindVertexArray(WebGLVertexArray* array) +{ + if (IsContextLost()) + return; + + if (array && !ValidateObject("bindVertexArrayObject", *array)) + return; + + InvalidateBufferFetching(); + + MakeContextCurrent(); + + if (mBoundVertexArray) { + mBoundVertexArray->AddBufferBindCounts(-1); + } + + if (array == nullptr) { + array = mDefaultVertexArray; + } + + array->BindVertexArray(); + + MOZ_ASSERT(mBoundVertexArray == array); + if (mBoundVertexArray) { + mBoundVertexArray->AddBufferBindCounts(+1); + } +} + +already_AddRefed +WebGLContext::CreateVertexArray() +{ + if (IsContextLost()) + return nullptr; + + RefPtr globj = CreateVertexArrayImpl(); + + MakeContextCurrent(); + globj->GenVertexArray(); + + return globj.forget(); +} + +WebGLVertexArray* +WebGLContext::CreateVertexArrayImpl() +{ + return WebGLVertexArray::Create(this); +} + +void +WebGLContext::DeleteVertexArray(WebGLVertexArray* array) +{ + if (!ValidateDeleteObject("deleteVertexArray", array)) + return; + + if (mBoundVertexArray == array) + BindVertexArray(static_cast(nullptr)); + + array->RequestDelete(); +} + +bool +WebGLContext::IsVertexArray(const WebGLVertexArray* array) +{ + if (!ValidateIsObject("isVertexArray", array)) + return false; + + MakeContextCurrent(); + return array->IsVertexArray(); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLContextVertices.cpp b/dom/canvas/WebGLContextVertices.cpp new file mode 100644 index 000000000..ba3156693 --- /dev/null +++ b/dom/canvas/WebGLContextVertices.cpp @@ -0,0 +1,344 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" + +#include "GLContext.h" +#include "mozilla/CheckedInt.h" +#include "WebGLBuffer.h" +#include "WebGLFramebuffer.h" +#include "WebGLProgram.h" +#include "WebGLRenderbuffer.h" +#include "WebGLShader.h" +#include "WebGLTexture.h" +#include "WebGLVertexArray.h" +#include "WebGLVertexAttribData.h" + +#include "mozilla/Casting.h" + +namespace mozilla { + +JSObject* +WebGLContext::GetVertexAttribFloat32Array(JSContext* cx, GLuint index) +{ + GLfloat attrib[4]; + if (index) { + gl->fGetVertexAttribfv(index, LOCAL_GL_CURRENT_VERTEX_ATTRIB, attrib); + } else { + memcpy(attrib, mGenericVertexAttrib0Data, sizeof(mGenericVertexAttrib0Data)); + } + return dom::Float32Array::Create(cx, this, 4, attrib); +} + +JSObject* +WebGLContext::GetVertexAttribInt32Array(JSContext* cx, GLuint index) +{ + GLint attrib[4]; + if (index) { + gl->fGetVertexAttribIiv(index, LOCAL_GL_CURRENT_VERTEX_ATTRIB, attrib); + } else { + memcpy(attrib, mGenericVertexAttrib0Data, sizeof(mGenericVertexAttrib0Data)); + } + return dom::Int32Array::Create(cx, this, 4, attrib); +} + +JSObject* +WebGLContext::GetVertexAttribUint32Array(JSContext* cx, GLuint index) +{ + GLuint attrib[4]; + if (index) { + gl->fGetVertexAttribIuiv(index, LOCAL_GL_CURRENT_VERTEX_ATTRIB, attrib); + } else { + memcpy(attrib, mGenericVertexAttrib0Data, sizeof(mGenericVertexAttrib0Data)); + } + return dom::Uint32Array::Create(cx, this, 4, attrib); +} + +//////////////////////////////////////// + +void +WebGLContext::VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w, + const char* funcName) +{ + if (!funcName) { + funcName = "vertexAttrib4f"; + } + + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, funcName)) + return; + + //// + + gl->MakeCurrent(); + if (index || !gl->IsCompatibilityProfile()) { + gl->fVertexAttrib4f(index, x, y, z, w); + } + + //// + + mGenericVertexAttribTypes[index] = LOCAL_GL_FLOAT; + + if (!index) { + const float data[4] = { x, y, z, w }; + memcpy(mGenericVertexAttrib0Data, data, sizeof(data)); + } +} + +void +WebGL2Context::VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w, + const char* funcName) +{ + if (!funcName) { + funcName = "vertexAttribI4i"; + } + + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, funcName)) + return; + + //// + + gl->MakeCurrent(); + if (index || !gl->IsCompatibilityProfile()) { + gl->fVertexAttribI4i(index, x, y, z, w); + } + + //// + + mGenericVertexAttribTypes[index] = LOCAL_GL_INT; + + if (!index) { + const int32_t data[4] = { x, y, z, w }; + memcpy(mGenericVertexAttrib0Data, data, sizeof(data)); + } +} + +void +WebGL2Context::VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w, + const char* funcName) +{ + if (!funcName) { + funcName = "vertexAttribI4ui"; + } + + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, funcName)) + return; + + //// + + gl->MakeCurrent(); + if (index || !gl->IsCompatibilityProfile()) { + gl->fVertexAttribI4ui(index, x, y, z, w); + } + + //// + + mGenericVertexAttribTypes[index] = LOCAL_GL_UNSIGNED_INT; + + if (!index) { + const uint32_t data[4] = { x, y, z, w }; + memcpy(mGenericVertexAttrib0Data, data, sizeof(data)); + } +} + +//////////////////////////////////////// + +void +WebGLContext::EnableVertexAttribArray(GLuint index) +{ + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, "enableVertexAttribArray")) + return; + + MakeContextCurrent(); + InvalidateBufferFetching(); + + gl->fEnableVertexAttribArray(index); + + MOZ_ASSERT(mBoundVertexArray); + mBoundVertexArray->mAttribs[index].mEnabled = true; +} + +void +WebGLContext::DisableVertexAttribArray(GLuint index) +{ + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, "disableVertexAttribArray")) + return; + + MakeContextCurrent(); + InvalidateBufferFetching(); + + if (index || !gl->IsCompatibilityProfile()) { + gl->fDisableVertexAttribArray(index); + } + + MOZ_ASSERT(mBoundVertexArray); + mBoundVertexArray->mAttribs[index].mEnabled = false; +} + +JS::Value +WebGLContext::GetVertexAttrib(JSContext* cx, GLuint index, GLenum pname, + ErrorResult& rv) +{ + const char funcName[] = "getVertexAttrib"; + if (IsContextLost()) + return JS::NullValue(); + + if (!ValidateAttribIndex(index, funcName)) + return JS::NullValue(); + + MOZ_ASSERT(mBoundVertexArray); + + MakeContextCurrent(); + + switch (pname) { + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: + return WebGLObjectAsJSValue(cx, mBoundVertexArray->mAttribs[index].mBuf.get(), rv); + + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_STRIDE: + return JS::Int32Value(mBoundVertexArray->mAttribs[index].Stride()); + + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_SIZE: + return JS::Int32Value(mBoundVertexArray->mAttribs[index].Size()); + + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_TYPE: + return JS::Int32Value(mBoundVertexArray->mAttribs[index].Type()); + + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_INTEGER: + if (IsWebGL2()) + return JS::BooleanValue(mBoundVertexArray->mAttribs[index].IntegerFunc()); + + break; + + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_DIVISOR: + if (IsWebGL2() || + IsExtensionEnabled(WebGLExtensionID::ANGLE_instanced_arrays)) + { + return JS::Int32Value(mBoundVertexArray->mAttribs[index].mDivisor); + } + break; + + case LOCAL_GL_CURRENT_VERTEX_ATTRIB: + { + JS::RootedObject obj(cx); + switch (mGenericVertexAttribTypes[index]) { + case LOCAL_GL_FLOAT: + obj = GetVertexAttribFloat32Array(cx, index); + break; + + case LOCAL_GL_INT: + obj = GetVertexAttribInt32Array(cx, index); + break; + + case LOCAL_GL_UNSIGNED_INT: + obj = GetVertexAttribUint32Array(cx, index); + break; + } + + if (!obj) + rv.Throw(NS_ERROR_OUT_OF_MEMORY); + return JS::ObjectOrNullValue(obj); + } + + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_ENABLED: + return JS::BooleanValue(mBoundVertexArray->mAttribs[index].mEnabled); + + case LOCAL_GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: + return JS::BooleanValue(mBoundVertexArray->mAttribs[index].Normalized()); + + default: + break; + } + + ErrorInvalidEnumInfo("getVertexAttrib: parameter", pname); + return JS::NullValue(); +} + +WebGLsizeiptr +WebGLContext::GetVertexAttribOffset(GLuint index, GLenum pname) +{ + if (IsContextLost()) + return 0; + + if (!ValidateAttribIndex(index, "getVertexAttribOffset")) + return 0; + + if (pname != LOCAL_GL_VERTEX_ATTRIB_ARRAY_POINTER) { + ErrorInvalidEnum("getVertexAttribOffset: bad parameter"); + return 0; + } + + MOZ_ASSERT(mBoundVertexArray); + return mBoundVertexArray->mAttribs[index].ByteOffset(); +} + +void +WebGLContext::VertexAttribPointer(GLuint index, GLint size, GLenum type, + WebGLboolean normalized, GLsizei stride, + WebGLintptr byteOffset) +{ + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, "vertexAttribPointer")) + return; + + if (!ValidateAttribPointer(false, index, size, type, normalized, stride, byteOffset, "vertexAttribPointer")) + return; + + MOZ_ASSERT(mBoundVertexArray); + + InvalidateBufferFetching(); + + /* XXX make work with bufferSubData & heterogeneous types + if (type != mBoundArrayBuffer->GLType()) + return ErrorInvalidOperation("vertexAttribPointer: type must match bound VBO type: %d != %d", type, mBoundArrayBuffer->GLType()); + */ + + MakeContextCurrent(); + gl->fVertexAttribPointer(index, size, type, normalized, stride, + reinterpret_cast(byteOffset)); + + WebGLVertexAttribData& vd = mBoundVertexArray->mAttribs[index]; + const bool integerFunc = false; + vd.VertexAttribPointer(integerFunc, mBoundArrayBuffer, size, type, normalized, stride, + byteOffset); +} + +void +WebGLContext::VertexAttribDivisor(GLuint index, GLuint divisor) +{ + if (IsContextLost()) + return; + + if (!ValidateAttribIndex(index, "vertexAttribDivisor")) + return; + + MOZ_ASSERT(mBoundVertexArray); + + WebGLVertexAttribData& vd = mBoundVertexArray->mAttribs[index]; + vd.mDivisor = divisor; + + InvalidateBufferFetching(); + + MakeContextCurrent(); + + gl->fVertexAttribDivisor(index, divisor); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLElementArrayCache.cpp b/dom/canvas/WebGLElementArrayCache.cpp new file mode 100644 index 000000000..a0591445a --- /dev/null +++ b/dom/canvas/WebGLElementArrayCache.cpp @@ -0,0 +1,622 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLElementArrayCache.h" + +#include +#include +#include +#include +#include "mozilla/Assertions.h" +#include "mozilla/MathAlgorithms.h" +#include "mozilla/MemoryReporting.h" + +namespace mozilla { + +/* WebGLElementArrayCacheTree contains most of the implementation of + * WebGLElementArrayCache, which performs WebGL element array buffer validation + * for drawElements. + * + * Attention: Here lie nontrivial data structures, bug-prone algorithms, and + * non-canonical tweaks! Whence the explanatory comments, and compiled unit + * test. + * + * *** What problem are we solving here? *** + * + * WebGL::DrawElements has to validate that the elements are in range wrt the + * current vertex attribs. This boils down to the problem, given an array of + * integers, of computing the maximum in an arbitrary sub-array. The naive + * algorithm has linear complexity; this has been a major performance problem, + * see bug 569431. In that bug, we took the approach of caching the max for the + * whole array, which does cover most cases (DrawElements typically consumes the + * whole element array buffer) but doesn't help in other use cases: + * - when doing "partial DrawElements" i.e. consuming only part of the element + * array buffer + * - when doing frequent "partial buffer updates" i.e. bufferSubData calls + * updating parts of the element array buffer + * + * *** The solution: A binary tree *** + * + * The solution implemented here is to use a binary tree as the cache data + * structure. Each tree node contains the max of its two children nodes. In this + * way, finding the maximum in any contiguous sub-array has log complexity + * instead of linear complexity. + * + * Simplistically, if the element array is: + * + * [1 4 3 2] + * + * then the corresponding tree is: + * + * 4 + * _/ \_ + * 4 3 + * / \ / \ + * 1 4 3 2 + * + * In practice, the bottom-most levels of the tree are both the largest to store + * (because they have more nodes), and the least useful performance-wise + * (because each node in the bottom levels concerns only few entries in the + * elements array buffer, it is cheap to compute). + * + * For this reason, we stop the tree a few levels above, so that each tree leaf + * actually corresponds to more than one element array entry. + * + * The number of levels that we "drop" is |kSkippedBottomTreeLevels| and the + * number of element array entries that each leaf corresponds to, is + * |kElementsPerLeaf|. This being a binary tree, we have: + * + * kElementsPerLeaf = 2 ^ kSkippedBottomTreeLevels. + * + * *** Storage layout of the binary tree *** + * + * We take advantage of the specifics of the situation to avoid generalist tree + * storage and instead store the tree entries in a vector, mTreeData. + * + * TreeData is always a vector of length: + * + * 2 * (number of leaves). + * + * Its data layout is as follows: mTreeData[0] is unused, mTreeData[1] is the + * root node, then at offsets 2..3 is the tree level immediately below the root + * node, then at offsets 4..7 is the tree level below that, etc. + * + * The figure below illustrates this by writing at each tree node the offset + * into mTreeData at which it is stored: + * + * 1 + * _/ \_ + * 2 3 + * / \ / \ + * 4 5 6 7 + * ... + * + * Thus, under the convention that the root level is level 0, we see that level + * N is stored at offsets: + * + * [ 2^n .. 2^(n+1) - 1 ] + * + * in mTreeData. Likewise, all the usual tree operations have simple + * mathematical expressions in terms of mTreeData offsets, see all the methods + * such as ParentNode, LeftChildNode, etc. + * + * *** Design constraint: Element types aren't known at buffer-update time *** + * + * Note that a key constraint that we're operating under, is that we don't know + * the types of the elements by the time WebGL bufferData/bufferSubData methods + * are called. The type of elements is only specified in the drawElements call. + * This means that we may potentially have to store caches for multiple element + * types, for the same element array buffer. Since we don't know yet how many + * element types we'll eventually support (extensions add more), the concern + * about memory usage is serious. This is addressed by kSkippedBottomTreeLevels + * as explained above. Of course, in the typical case where each element array + * buffer is only ever used with one type, this is also addressed by having + * WebGLElementArrayCache lazily create trees for each type only upon first use. + * + * Another consequence of this constraint is that when updating the trees, we + * have to update all existing trees. So if trees for types uint8_t, uint16_t + * and uint32_t have ever been constructed for this buffer, every subsequent + * update will have to update all trees even if one of the types is never used + * again. That's inefficient, but content should not put indices of different + * types in the same element array buffer anyways. Different index types can + * only be consumed in separate drawElements calls, so nothing particular is + * to be achieved by lumping them in the same buffer object. + */ +template +struct WebGLElementArrayCacheTree +{ + /* A too-high kSkippedBottomTreeLevels would harm the performance of small + * drawElements calls. A too-low kSkippedBottomTreeLevels would cause undue + * memory usage. The current value has been validated by some benchmarking. + * See bug 732660. + */ + static const size_t kSkippedBottomTreeLevels = 3; + static const size_t kElementsPerLeaf = 1 << kSkippedBottomTreeLevels; + // Since kElementsPerLeaf is POT: + static const size_t kElementsPerLeafMask = kElementsPerLeaf - 1; + +private: + // The WebGLElementArrayCache that owns this tree: + WebGLElementArrayCache& mParent; + + // The tree's internal data storage. Its length is 2 * (number of leaves) + // because of its data layout explained in the above class comment. + FallibleTArray mTreeData; + +public: + // Constructor. Takes a reference to the WebGLElementArrayCache that is to be + // the parent. Does not initialize the tree. Should be followed by a call + // to Update() to attempt initializing the tree. + explicit WebGLElementArrayCacheTree(WebGLElementArrayCache& value) + : mParent(value) + { + } + + T GlobalMaximum() const { + return mTreeData[1]; + } + + // returns the index of the parent node; if treeIndex=1 (the root node), + // the return value is 0. + static size_t ParentNode(size_t treeIndex) { + MOZ_ASSERT(treeIndex > 1); + return treeIndex >> 1; + } + + static bool IsRightNode(size_t treeIndex) { + MOZ_ASSERT(treeIndex > 1); + return treeIndex & 1; + } + + static bool IsLeftNode(size_t treeIndex) { + MOZ_ASSERT(treeIndex > 1); + return !IsRightNode(treeIndex); + } + + static size_t SiblingNode(size_t treeIndex) { + MOZ_ASSERT(treeIndex > 1); + return treeIndex ^ 1; + } + + static size_t LeftChildNode(size_t treeIndex) { + MOZ_ASSERT(treeIndex); + return treeIndex << 1; + } + + static size_t RightChildNode(size_t treeIndex) { + MOZ_ASSERT(treeIndex); + return SiblingNode(LeftChildNode(treeIndex)); + } + + static size_t LeftNeighborNode(size_t treeIndex, size_t distance = 1) { + MOZ_ASSERT(treeIndex > 1); + return treeIndex - distance; + } + + static size_t RightNeighborNode(size_t treeIndex, size_t distance = 1) { + MOZ_ASSERT(treeIndex > 1); + return treeIndex + distance; + } + + size_t NumLeaves() const { + // See class comment for why we the tree storage size is 2 * numLeaves. + return mTreeData.Length() >> 1; + } + + size_t LeafForElement(size_t element) const { + size_t leaf = element / kElementsPerLeaf; + MOZ_ASSERT(leaf < NumLeaves()); + return leaf; + } + + size_t LeafForByte(size_t byte) const { + return LeafForElement(byte / sizeof(T)); + } + + // Returns the index, into the tree storage, where a given leaf is stored. + size_t TreeIndexForLeaf(size_t leaf) const { + // See above class comment. The tree storage is an array of length + // 2 * numLeaves. The leaves are stored in its second half. + return leaf + NumLeaves(); + } + + static size_t LastElementUnderSameLeaf(size_t element) { + return element | kElementsPerLeafMask; + } + + static size_t FirstElementUnderSameLeaf(size_t element) { + return element & ~kElementsPerLeafMask; + } + + static size_t NextMultipleOfElementsPerLeaf(size_t numElements) { + MOZ_ASSERT(numElements >= 1); + return ((numElements - 1) | kElementsPerLeafMask) + 1; + } + + bool Validate(T maxAllowed, size_t firstLeaf, size_t lastLeaf) + { + size_t firstTreeIndex = TreeIndexForLeaf(firstLeaf); + size_t lastTreeIndex = TreeIndexForLeaf(lastLeaf); + + while (true) { + // Given that we tweak these values in nontrivial ways, it doesn't + // hurt to do this sanity check. + MOZ_ASSERT(firstTreeIndex <= lastTreeIndex); + + // Final case where there is only one node to validate at the + // current tree level: + if (lastTreeIndex == firstTreeIndex) { + const T& curData = mTreeData[firstTreeIndex]; + return curData <= maxAllowed; + } + + // If the first node at current tree level is a right node, handle + // it individually and replace it with its right neighbor, which is + // a left node. + if (IsRightNode(firstTreeIndex)) { + const T& curData = mTreeData[firstTreeIndex]; + if (curData > maxAllowed) + return false; + + firstTreeIndex = RightNeighborNode(firstTreeIndex); + } + + // If the last node at current tree level is a left node, handle it + // individually and replace it with its left neighbor, which is a + // right node. + if (IsLeftNode(lastTreeIndex)) { + const T& curData = mTreeData[lastTreeIndex]; + if (curData > maxAllowed) + return false; + + lastTreeIndex = LeftNeighborNode(lastTreeIndex); + } + + /* At this point it can happen that firstTreeIndex and lastTreeIndex + * "crossed" eachother. That happens if firstTreeIndex was a right + * node and lastTreeIndex was its right neighor: In that case, both + * above tweaks happened and as a result, they ended up being + * swapped: LastTreeIndex is now the _left_ neighbor of + * firstTreeIndex. When that happens, there is nothing left to + * validate. + */ + if (lastTreeIndex == LeftNeighborNode(firstTreeIndex)) + return true; + + // Walk up one level. + firstTreeIndex = ParentNode(firstTreeIndex); + lastTreeIndex = ParentNode(lastTreeIndex); + } + } + + // Updates the tree from the parent's buffer contents. Fallible, as it + // may have to resize the tree storage. + bool Update(size_t firstByte, size_t lastByte); + + size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const + { + return mallocSizeOf(this) + + mTreeData.ShallowSizeOfExcludingThis(mallocSizeOf); + } +}; + +// TreeForType: just a template helper to select the right tree object for a given +// element type. +template +struct TreeForType {}; + +template<> +struct TreeForType +{ + static UniquePtr>& + Value(WebGLElementArrayCache* b) { + return b->mUint8Tree; + } +}; + +template<> +struct TreeForType +{ + static UniquePtr>& + Value(WebGLElementArrayCache* b) { + return b->mUint16Tree; + } +}; + +template<> +struct TreeForType +{ + static UniquePtr>& + Value(WebGLElementArrayCache* b) { + return b->mUint32Tree; + } +}; + +// Calling this method will 1) update the leaves in this interval +// from the raw buffer data, and 2) propagate this update up the tree. +template +bool +WebGLElementArrayCacheTree::Update(size_t firstByte, size_t lastByte) +{ + MOZ_ASSERT(firstByte <= lastByte); + MOZ_ASSERT(lastByte < mParent.mBytes.Length()); + + size_t numberOfElements = mParent.mBytes.Length() / sizeof(T); + size_t requiredNumLeaves = 0; + if (numberOfElements > 0) { + /* If we didn't require the number of leaves to be a power of two, then + * it would just be equal to + * + * ceil(numberOfElements / kElementsPerLeaf) + * + * The way we implement this (division+ceil) operation in integer + * arithmetic + * is as follows: + */ + size_t numLeavesNonPOT = (numberOfElements + kElementsPerLeaf - 1) / kElementsPerLeaf; + // It only remains to round that up to the next power of two: + requiredNumLeaves = RoundUpPow2(numLeavesNonPOT); + } + + // Step #0: If needed, resize our tree data storage. + if (requiredNumLeaves != NumLeaves()) { + // See class comment for why we the tree storage size is 2 * numLeaves. + if (!mTreeData.SetLength(2 * requiredNumLeaves, fallible)) { + mTreeData.Clear(); + return false; + } + MOZ_ASSERT(NumLeaves() == requiredNumLeaves); + + if (NumLeaves()) { + // When resizing, update the whole tree, not just the subset + // corresponding to the part of the buffer being updated. + memset(mTreeData.Elements(), 0, mTreeData.Length() * sizeof(T)); + firstByte = 0; + lastByte = mParent.mBytes.Length() - 1; + } + } + + if (NumLeaves() == 0) + return true; + + lastByte = std::min(lastByte, NumLeaves() * kElementsPerLeaf * sizeof(T) - 1); + if (firstByte > lastByte) + return true; + + size_t firstLeaf = LeafForByte(firstByte); + size_t lastLeaf = LeafForByte(lastByte); + + MOZ_ASSERT(firstLeaf <= lastLeaf && lastLeaf < NumLeaves()); + + size_t firstTreeIndex = TreeIndexForLeaf(firstLeaf); + size_t lastTreeIndex = TreeIndexForLeaf(lastLeaf); + + // Step #1: Initialize the tree leaves from plain buffer data. + // That is, each tree leaf must be set to the max of the |kElementsPerLeaf| + // corresponding buffer entries. + + // Condition-less scope to prevent leaking this scope's variables into the + // code below: + { + // TreeIndex is the index of the tree leaf we're writing, i.e. the + // destination index. + size_t treeIndex = firstTreeIndex; + // srcIndex is the index in the source buffer. + size_t srcIndex = firstLeaf * kElementsPerLeaf; + while (treeIndex <= lastTreeIndex) { + T m = 0; + size_t a = srcIndex; + size_t srcIndexNextLeaf = std::min(a + kElementsPerLeaf, numberOfElements); + for (; srcIndex < srcIndexNextLeaf; srcIndex++) { + m = std::max(m, mParent.Element(srcIndex)); + } + mTreeData[treeIndex] = m; + treeIndex++; + } + } + + // Step #2: Propagate the values up the tree. This is simply a matter of + // walking up the tree and setting each node to the max of its two children. + while (firstTreeIndex > 1) { + // Move up one level. + firstTreeIndex = ParentNode(firstTreeIndex); + lastTreeIndex = ParentNode(lastTreeIndex); + + // Fast-exit case where only one node is updated at the current level. + if (firstTreeIndex == lastTreeIndex) { + mTreeData[firstTreeIndex] = std::max(mTreeData[LeftChildNode(firstTreeIndex)], mTreeData[RightChildNode(firstTreeIndex)]); + continue; + } + + size_t child = LeftChildNode(firstTreeIndex); + size_t parent = firstTreeIndex; + while (parent <= lastTreeIndex) { + T a = mTreeData[child]; + child = RightNeighborNode(child); + T b = mTreeData[child]; + child = RightNeighborNode(child); + mTreeData[parent] = std::max(a, b); + parent = RightNeighborNode(parent); + } + } + + return true; +} + +WebGLElementArrayCache::WebGLElementArrayCache() +{ +} + +WebGLElementArrayCache::~WebGLElementArrayCache() +{ +} + +bool +WebGLElementArrayCache::BufferData(const void* ptr, size_t byteLength) +{ + if (mBytes.Length() != byteLength) { + if (!mBytes.SetLength(byteLength, fallible)) { + mBytes.Clear(); + return false; + } + } + MOZ_ASSERT(mBytes.Length() == byteLength); + return BufferSubData(0, ptr, byteLength); +} + +bool +WebGLElementArrayCache::BufferSubData(size_t pos, const void* ptr, + size_t updateByteLength) +{ + MOZ_ASSERT(pos + updateByteLength <= mBytes.Length()); + if (!updateByteLength) + return true; + + // Note, using memcpy on shared racy data is not well-defined, this + // will need to use safe-for-races operations when those become available. + // See bug 1225033. + if (ptr) + memcpy(mBytes.Elements() + pos, ptr, updateByteLength); + else + memset(mBytes.Elements() + pos, 0, updateByteLength); + return UpdateTrees(pos, pos + updateByteLength - 1); +} + +bool +WebGLElementArrayCache::UpdateTrees(size_t firstByte, size_t lastByte) +{ + bool result = true; + if (mUint8Tree) + result &= mUint8Tree->Update(firstByte, lastByte); + if (mUint16Tree) + result &= mUint16Tree->Update(firstByte, lastByte); + if (mUint32Tree) + result &= mUint32Tree->Update(firstByte, lastByte); + return result; +} + +template +bool +WebGLElementArrayCache::Validate(uint32_t maxAllowed, size_t firstElement, + size_t countElements) +{ + // If maxAllowed is >= the max T value, then there is no way that a T index + // could be invalid. + uint32_t maxTSize = std::numeric_limits::max(); + if (maxAllowed >= maxTSize) + return true; + + T maxAllowedT(maxAllowed); + + // Integer overflow must have been handled earlier, so we assert that + // maxAllowedT is exactly the max allowed value. + MOZ_ASSERT(uint32_t(maxAllowedT) == maxAllowed); + + if (!mBytes.Length() || !countElements) + return true; + + UniquePtr>& tree = TreeForType::Value(this); + if (!tree) { + tree = MakeUnique>(*this); + if (mBytes.Length()) { + bool valid = tree->Update(0, mBytes.Length() - 1); + if (!valid) { + // Do not assert here. This case would happen if an allocation + // failed. We've already settled on fallible allocations around + // here. + tree = nullptr; + return false; + } + } + } + + size_t lastElement = firstElement + countElements - 1; + + // Fast-exit path when the global maximum for the whole element array buffer + // falls in the allowed range: + T globalMax = tree->GlobalMaximum(); + if (globalMax <= maxAllowedT) + return true; + + const T* elements = Elements(); + + // Before calling tree->Validate, we have to validate ourselves the + // boundaries of the elements span, to round them to the nearest multiple of + // kElementsPerLeaf. + size_t firstElementAdjustmentEnd = std::min(lastElement, + tree->LastElementUnderSameLeaf(firstElement)); + while (firstElement <= firstElementAdjustmentEnd) { + const T& curData = elements[firstElement]; + if (curData > maxAllowedT) + return false; + + firstElement++; + } + size_t lastElementAdjustmentEnd = std::max(firstElement, + tree->FirstElementUnderSameLeaf(lastElement)); + while (lastElement >= lastElementAdjustmentEnd) { + const T& curData = elements[lastElement]; + if (curData > maxAllowedT) + return false; + + lastElement--; + } + + // at this point, for many tiny validations, we're already done. + if (firstElement > lastElement) + return true; + + // general case + return tree->Validate(maxAllowedT, tree->LeafForElement(firstElement), + tree->LeafForElement(lastElement)); +} + +bool +WebGLElementArrayCache::Validate(GLenum type, uint32_t maxAllowed, + size_t firstElement, size_t countElements) +{ + if (type == LOCAL_GL_UNSIGNED_BYTE) + return Validate(maxAllowed, firstElement, countElements); + if (type == LOCAL_GL_UNSIGNED_SHORT) + return Validate(maxAllowed, firstElement, countElements); + if (type == LOCAL_GL_UNSIGNED_INT) + return Validate(maxAllowed, firstElement, countElements); + + MOZ_ASSERT(false, "Invalid type."); + return false; +} + +template +static size_t +SizeOfNullable(mozilla::MallocSizeOf mallocSizeOf, const T& obj) +{ + if (!obj) + return 0; + return obj->SizeOfIncludingThis(mallocSizeOf); +} + +size_t +WebGLElementArrayCache::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const +{ + return mallocSizeOf(this) + + mBytes.ShallowSizeOfExcludingThis(mallocSizeOf) + + SizeOfNullable(mallocSizeOf, mUint8Tree) + + SizeOfNullable(mallocSizeOf, mUint16Tree) + + SizeOfNullable(mallocSizeOf, mUint32Tree); +} + +bool +WebGLElementArrayCache::BeenUsedWithMultipleTypes() const +{ + // C++ Standard ($4.7) + // "If the source type is bool, the value false is converted to zero and + // the value true is converted to one." + const int num_types_used = (mUint8Tree != nullptr) + + (mUint16Tree != nullptr) + + (mUint32Tree != nullptr); + return num_types_used > 1; +} + +} // end namespace mozilla diff --git a/dom/canvas/WebGLElementArrayCache.h b/dom/canvas/WebGLElementArrayCache.h new file mode 100644 index 000000000..eba0535a2 --- /dev/null +++ b/dom/canvas/WebGLElementArrayCache.h @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_ELEMENT_ARRAY_CACHE_H +#define WEBGL_ELEMENT_ARRAY_CACHE_H + +#include "GLDefs.h" +#include "mozilla/MemoryReporting.h" +#include "mozilla/UniquePtr.h" +#include "nscore.h" +#include "nsTArray.h" +#include + +namespace mozilla { + +template +struct WebGLElementArrayCacheTree; + +/* WebGLElementArrayCache implements WebGL element array buffer validation for + * drawElements. + * + * Its exposes methods meant to be called by WebGL method implementations: + * + * - Validate, to be called by WebGLContext::DrawElements, is where we use the + * cache. + * + * - BufferData and BufferSubData, to be called by eponymous WebGL methods, are + * how data is fed into the cache. + * + * Most of the implementation is hidden in the auxilary class template, + * WebGLElementArrayCacheTree. Refer to its code for design comments. + */ +class WebGLElementArrayCache { +public: + bool BufferData(const void* ptr, size_t byteLength); + bool BufferSubData(size_t pos, const void* ptr, size_t updateByteSize); + + bool Validate(GLenum type, uint32_t maxAllowed, size_t first, size_t count); + + template + T Element(size_t i) const { return Elements()[i]; } + + WebGLElementArrayCache(); + ~WebGLElementArrayCache(); + + size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; + bool BeenUsedWithMultipleTypes() const; + +private: + /* Returns true if a drawElements call with the given parameters should + * succeed, false otherwise. + * + * In other words, this returns true if all entries in the element array at + * positions: + * + * first .. first+count-1 + * + * are less than or equal to maxAllowed. + * + * Input parameters: + * maxAllowed: Maximum value to be allowed in the specificied portion of + * the element array. + * first: Start of the portion of the element array to consume. + * count: Number of entries from the element array to consume. + * + * Output parameter: + * out_upperBound: Upon success, is set to the actual maximum value in the + * specified range, which is then guaranteed to be less + * than or equal to maxAllowed. upon failure, is set to + * the first value in the specified range, that is greater + * than maxAllowed. + */ + template + bool Validate(uint32_t maxAllowed, size_t first, size_t count); + + template + const T* Elements() const { + return reinterpret_cast(mBytes.Elements()); + } + + template + T* Elements() { return reinterpret_cast(mBytes.Elements()); } + + bool UpdateTrees(size_t firstByte, size_t lastByte); + + template + friend struct WebGLElementArrayCacheTree; + template + friend struct TreeForType; + + FallibleTArray mBytes; + UniquePtr> mUint8Tree; + UniquePtr> mUint16Tree; + UniquePtr> mUint32Tree; +}; + +} // end namespace mozilla + +#endif // WEBGL_ELEMENT_ARRAY_CACHE_H diff --git a/dom/canvas/WebGLExtensionBase.cpp b/dom/canvas/WebGLExtensionBase.cpp new file mode 100644 index 000000000..b3a1b5476 --- /dev/null +++ b/dom/canvas/WebGLExtensionBase.cpp @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +namespace mozilla { + +WebGLExtensionBase::WebGLExtensionBase(WebGLContext* context) + : WebGLContextBoundObject(context) + , mIsLost(false) +{ +} + +WebGLExtensionBase::~WebGLExtensionBase() +{ +} + +void +WebGLExtensionBase::MarkLost() +{ + mIsLost = true; + + OnMarkLost(); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLExtensionBase) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLExtensionBase, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLExtensionBase, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionBlendMinMax.cpp b/dom/canvas/WebGLExtensionBlendMinMax.cpp new file mode 100644 index 000000000..b62f87015 --- /dev/null +++ b/dom/canvas/WebGLExtensionBlendMinMax.cpp @@ -0,0 +1,31 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionBlendMinMax::WebGLExtensionBlendMinMax(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); +} + +WebGLExtensionBlendMinMax::~WebGLExtensionBlendMinMax() +{ +} + +bool +WebGLExtensionBlendMinMax::IsSupported(const WebGLContext* webgl) +{ + return webgl->GL()->IsSupported(gl::GLFeature::blend_minmax); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionBlendMinMax, EXT_blend_minmax) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionColorBufferFloat.cpp b/dom/canvas/WebGLExtensionColorBufferFloat.cpp new file mode 100644 index 000000000..a3e76916d --- /dev/null +++ b/dom/canvas/WebGLExtensionColorBufferFloat.cpp @@ -0,0 +1,57 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { + +WebGLExtensionColorBufferFloat::WebGLExtensionColorBufferFloat(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); + + auto& fua = webgl->mFormatUsage; + + auto fnUpdateUsage = [&fua](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto usage = fua->EditUsage(effFormat); + usage->SetRenderable(); + fua->AllowRBFormat(sizedFormat, usage); + }; + +#define FOO(x) fnUpdateUsage(LOCAL_GL_ ## x, webgl::EffectiveFormat::x) + + // The extension doesn't actually add RGB32F; only RGBA32F. + FOO(RGBA32F); + +#undef FOO +} + +WebGLExtensionColorBufferFloat::~WebGLExtensionColorBufferFloat() +{ +} + +bool +WebGLExtensionColorBufferFloat::IsSupported(const WebGLContext* webgl) +{ + gl::GLContext* gl = webgl->GL(); + + // ANGLE supports this, but doesn't have a way to advertize its support, + // since it's compliant with WEBGL_color_buffer_float's clamping, but not + // EXT_color_buffer_float. + return gl->IsSupported(gl::GLFeature::renderbuffer_color_float) || + gl->IsANGLE(); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionColorBufferFloat, WEBGL_color_buffer_float) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionColorBufferHalfFloat.cpp b/dom/canvas/WebGLExtensionColorBufferHalfFloat.cpp new file mode 100644 index 000000000..de7cbc65c --- /dev/null +++ b/dom/canvas/WebGLExtensionColorBufferHalfFloat.cpp @@ -0,0 +1,51 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { + +WebGLExtensionColorBufferHalfFloat::WebGLExtensionColorBufferHalfFloat(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); + + auto& fua = webgl->mFormatUsage; + + auto fnUpdateUsage = [&fua](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto usage = fua->EditUsage(effFormat); + usage->SetRenderable(); + fua->AllowRBFormat(sizedFormat, usage); + }; + +#define FOO(x) fnUpdateUsage(LOCAL_GL_ ## x, webgl::EffectiveFormat::x) + + FOO(RGBA16F); + FOO(RGB16F); + +#undef FOO +} + +WebGLExtensionColorBufferHalfFloat::~WebGLExtensionColorBufferHalfFloat() +{ +} + +bool +WebGLExtensionColorBufferHalfFloat::IsSupported(const WebGLContext* webgl) +{ + return webgl->GL()->IsSupported(gl::GLFeature::renderbuffer_color_half_float); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionColorBufferHalfFloat, EXT_color_buffer_half_float) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionCompressedTextureATC.cpp b/dom/canvas/WebGLExtensionCompressedTextureATC.cpp new file mode 100644 index 000000000..b114016ce --- /dev/null +++ b/dom/canvas/WebGLExtensionCompressedTextureATC.cpp @@ -0,0 +1,46 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { + +WebGLExtensionCompressedTextureATC::WebGLExtensionCompressedTextureATC(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + RefPtr webgl_ = webgl; // Bug 1201275 + const auto fnAdd = [&webgl_](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto& fua = webgl_->mFormatUsage; + + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + fua->AllowSizedTexFormat(sizedFormat, usage); + + webgl_->mCompressedTextureFormats.AppendElement(sizedFormat); + }; + +#define FOO(x) LOCAL_GL_ ## x, webgl::EffectiveFormat::x + + fnAdd(FOO(ATC_RGB_AMD)); + fnAdd(FOO(ATC_RGBA_EXPLICIT_ALPHA_AMD)); + fnAdd(FOO(ATC_RGBA_INTERPOLATED_ALPHA_AMD)); + +#undef FOO +} + +WebGLExtensionCompressedTextureATC::~WebGLExtensionCompressedTextureATC() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionCompressedTextureATC, WEBGL_compressed_texture_atc) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionCompressedTextureES3.cpp b/dom/canvas/WebGLExtensionCompressedTextureES3.cpp new file mode 100644 index 000000000..974e4283f --- /dev/null +++ b/dom/canvas/WebGLExtensionCompressedTextureES3.cpp @@ -0,0 +1,68 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { + +WebGLExtensionCompressedTextureES3::WebGLExtensionCompressedTextureES3(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + // GLES 3.0.4, p147, table 3.19 + // GLES 3.0.4, p286+, $C.1 "ETC Compressed Texture Image Formats" + // Note that all compressed texture formats are filterable: + // GLES 3.0.4 p161: + // "[A] texture is complete unless any of the following conditions hold true: + // [...] + // * The effective internal format specified for the texture arrays is a sized + // internal color format that is not texture-filterable (see table 3.13) and [the + // mag filter requires filtering]." + // Compressed formats are not sized internal color formats, and indeed they are not + // listed in table 3.13. + + RefPtr webgl_ = webgl; // Bug 1201275 + const auto fnAdd = [&webgl_](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto& fua = webgl_->mFormatUsage; + + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + fua->AllowSizedTexFormat(sizedFormat, usage); + + webgl_->mCompressedTextureFormats.AppendElement(sizedFormat); + }; + +#define FOO(x) LOCAL_GL_ ## x, webgl::EffectiveFormat::x + + fnAdd(FOO(COMPRESSED_R11_EAC)); + fnAdd(FOO(COMPRESSED_SIGNED_R11_EAC)); + fnAdd(FOO(COMPRESSED_RG11_EAC)); + fnAdd(FOO(COMPRESSED_SIGNED_RG11_EAC)); + fnAdd(FOO(COMPRESSED_RGB8_ETC2)); + fnAdd(FOO(COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2)); + fnAdd(FOO(COMPRESSED_RGBA8_ETC2_EAC)); + + // sRGB support is manadatory in GL 4.3 and GL ES 3.0, which are the only + // versions to support ETC2. + fnAdd(FOO(COMPRESSED_SRGB8_ALPHA8_ETC2_EAC)); + fnAdd(FOO(COMPRESSED_SRGB8_ETC2)); + fnAdd(FOO(COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)); + +#undef FOO +} + +WebGLExtensionCompressedTextureES3::~WebGLExtensionCompressedTextureES3() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionCompressedTextureES3, WEBGL_compressed_texture_etc) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionCompressedTextureETC1.cpp b/dom/canvas/WebGLExtensionCompressedTextureETC1.cpp new file mode 100644 index 000000000..9f2d7a62a --- /dev/null +++ b/dom/canvas/WebGLExtensionCompressedTextureETC1.cpp @@ -0,0 +1,44 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { + +WebGLExtensionCompressedTextureETC1::WebGLExtensionCompressedTextureETC1(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + RefPtr webgl_ = webgl; // Bug 1201275 + const auto fnAdd = [&webgl_](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto& fua = webgl_->mFormatUsage; + + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + fua->AllowSizedTexFormat(sizedFormat, usage); + + webgl_->mCompressedTextureFormats.AppendElement(sizedFormat); + }; + +#define FOO(x) LOCAL_GL_ ## x, webgl::EffectiveFormat::x + + fnAdd(FOO(ETC1_RGB8_OES)); + +#undef FOO +} + +WebGLExtensionCompressedTextureETC1::~WebGLExtensionCompressedTextureETC1() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionCompressedTextureETC1, WEBGL_compressed_texture_etc1) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionCompressedTexturePVRTC.cpp b/dom/canvas/WebGLExtensionCompressedTexturePVRTC.cpp new file mode 100644 index 000000000..939ce7363 --- /dev/null +++ b/dom/canvas/WebGLExtensionCompressedTexturePVRTC.cpp @@ -0,0 +1,47 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { + +WebGLExtensionCompressedTexturePVRTC::WebGLExtensionCompressedTexturePVRTC(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + RefPtr webgl_ = webgl; // Bug 1201275 + const auto fnAdd = [&webgl_](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto& fua = webgl_->mFormatUsage; + + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + fua->AllowSizedTexFormat(sizedFormat, usage); + + webgl_->mCompressedTextureFormats.AppendElement(sizedFormat); + }; + +#define FOO(x) LOCAL_GL_ ## x, webgl::EffectiveFormat::x + + fnAdd(FOO(COMPRESSED_RGB_PVRTC_4BPPV1)); + fnAdd(FOO(COMPRESSED_RGB_PVRTC_2BPPV1)); + fnAdd(FOO(COMPRESSED_RGBA_PVRTC_4BPPV1)); + fnAdd(FOO(COMPRESSED_RGBA_PVRTC_2BPPV1)); + +#undef FOO +} + +WebGLExtensionCompressedTexturePVRTC::~WebGLExtensionCompressedTexturePVRTC() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionCompressedTexturePVRTC, WEBGL_compressed_texture_pvrtc) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionCompressedTextureS3TC.cpp b/dom/canvas/WebGLExtensionCompressedTextureS3TC.cpp new file mode 100644 index 000000000..c57693add --- /dev/null +++ b/dom/canvas/WebGLExtensionCompressedTextureS3TC.cpp @@ -0,0 +1,47 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { + +WebGLExtensionCompressedTextureS3TC::WebGLExtensionCompressedTextureS3TC(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + RefPtr webgl_ = webgl; // Bug 1201275 + const auto fnAdd = [&webgl_](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto& fua = webgl_->mFormatUsage; + + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + fua->AllowSizedTexFormat(sizedFormat, usage); + + webgl_->mCompressedTextureFormats.AppendElement(sizedFormat); + }; + +#define FOO(x) LOCAL_GL_ ## x, webgl::EffectiveFormat::x + + fnAdd(FOO(COMPRESSED_RGB_S3TC_DXT1_EXT)); + fnAdd(FOO(COMPRESSED_RGBA_S3TC_DXT1_EXT)); + fnAdd(FOO(COMPRESSED_RGBA_S3TC_DXT3_EXT)); + fnAdd(FOO(COMPRESSED_RGBA_S3TC_DXT5_EXT)); + +#undef FOO +} + +WebGLExtensionCompressedTextureS3TC::~WebGLExtensionCompressedTextureS3TC() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionCompressedTextureS3TC, WEBGL_compressed_texture_s3tc) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionDebugRendererInfo.cpp b/dom/canvas/WebGLExtensionDebugRendererInfo.cpp new file mode 100644 index 000000000..44f2334de --- /dev/null +++ b/dom/canvas/WebGLExtensionDebugRendererInfo.cpp @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionDebugRendererInfo::WebGLExtensionDebugRendererInfo(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionDebugRendererInfo::~WebGLExtensionDebugRendererInfo() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionDebugRendererInfo, WEBGL_debug_renderer_info) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionDebugShaders.cpp b/dom/canvas/WebGLExtensionDebugShaders.cpp new file mode 100644 index 000000000..75880465e --- /dev/null +++ b/dom/canvas/WebGLExtensionDebugShaders.cpp @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLShader.h" + +namespace mozilla { + +WebGLExtensionDebugShaders::WebGLExtensionDebugShaders(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionDebugShaders::~WebGLExtensionDebugShaders() +{ +} + +// If no source has been defined, compileShader() has not been called, or the +// translation has failed for shader, an empty string is returned; otherwise, +// return the translated source. +void +WebGLExtensionDebugShaders::GetTranslatedShaderSource(const WebGLShader& shader, + nsAString& retval) const +{ + retval.SetIsVoid(true); + + if (mIsLost) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "getTranslatedShaderSource"); + return; + } + + if (mContext->IsContextLost()) + return; + + if (!mContext->ValidateObject("getShaderTranslatedSource: shader", shader)) + return; + + shader.GetShaderTranslatedSource(&retval); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionDebugShaders, WEBGL_debug_shaders) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionDepthTexture.cpp b/dom/canvas/WebGLExtensionDepthTexture.cpp new file mode 100644 index 000000000..5afd6ba66 --- /dev/null +++ b/dom/canvas/WebGLExtensionDepthTexture.cpp @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionDepthTexture::WebGLExtensionDepthTexture(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + auto& fua = webgl->mFormatUsage; + + const auto fnAdd = [&fua](webgl::EffectiveFormat effFormat, GLenum unpackFormat, + GLenum unpackType) + { + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + usage->SetRenderable(); + + const webgl::PackingInfo pi = {unpackFormat, unpackType}; + const webgl::DriverUnpackInfo dui = {unpackFormat, unpackFormat, unpackType}; + fua->AddTexUnpack(usage, pi, dui); + + fua->AllowUnsizedTexFormat(pi, usage); + }; + + fnAdd(webgl::EffectiveFormat::DEPTH_COMPONENT16, LOCAL_GL_DEPTH_COMPONENT, + LOCAL_GL_UNSIGNED_SHORT); + + fnAdd(webgl::EffectiveFormat::DEPTH_COMPONENT24, LOCAL_GL_DEPTH_COMPONENT, + LOCAL_GL_UNSIGNED_INT); + + fnAdd(webgl::EffectiveFormat::DEPTH24_STENCIL8, LOCAL_GL_DEPTH_STENCIL, + LOCAL_GL_UNSIGNED_INT_24_8); +} + +WebGLExtensionDepthTexture::~WebGLExtensionDepthTexture() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionDepthTexture, WEBGL_depth_texture) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp new file mode 100644 index 000000000..e2e34f14e --- /dev/null +++ b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp @@ -0,0 +1,129 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "gfxPrefs.h" +#include "GLContext.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "mozilla/dom/BindingUtils.h" +#include "WebGLContext.h" +#include "WebGLQuery.h" + +namespace mozilla { + +WebGLExtensionDisjointTimerQuery::WebGLExtensionDisjointTimerQuery(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); +} + +WebGLExtensionDisjointTimerQuery::~WebGLExtensionDisjointTimerQuery() +{ +} + +already_AddRefed +WebGLExtensionDisjointTimerQuery::CreateQueryEXT() const +{ + const char funcName[] = "createQueryEXT"; + if (mIsLost) + return nullptr; + + return mContext->CreateQuery(funcName); +} + +void +WebGLExtensionDisjointTimerQuery::DeleteQueryEXT(WebGLQuery* query) const +{ + const char funcName[] = "deleteQueryEXT"; + if (mIsLost) + return; + + mContext->DeleteQuery(query, funcName); +} + +bool +WebGLExtensionDisjointTimerQuery::IsQueryEXT(const WebGLQuery* query) const +{ + const char funcName[] = "isQueryEXT"; + if (mIsLost) + return false; + + return mContext->IsQuery(query, funcName); +} + +void +WebGLExtensionDisjointTimerQuery::BeginQueryEXT(GLenum target, WebGLQuery& query) const +{ + const char funcName[] = "beginQueryEXT"; + if (mIsLost) + return; + + mContext->BeginQuery(target, query, funcName); +} + +void +WebGLExtensionDisjointTimerQuery::EndQueryEXT(GLenum target) const +{ + const char funcName[] = "endQueryEXT"; + if (mIsLost) + return; + + mContext->EndQuery(target, funcName); +} + +void +WebGLExtensionDisjointTimerQuery::QueryCounterEXT(WebGLQuery& query, GLenum target) const +{ + const char funcName[] = "queryCounterEXT"; + if (mIsLost) + return; + + if (!mContext->ValidateObject(funcName, query)) + return; + + query.QueryCounter(funcName, target); +} + +void +WebGLExtensionDisjointTimerQuery::GetQueryEXT(JSContext* cx, GLenum target, GLenum pname, + JS::MutableHandleValue retval) const +{ + const char funcName[] = "getQueryEXT"; + retval.setNull(); + if (mIsLost) + return; + + mContext->GetQuery(cx, target, pname, retval, funcName); +} + +void +WebGLExtensionDisjointTimerQuery::GetQueryObjectEXT(JSContext* cx, + const WebGLQuery& query, GLenum pname, + JS::MutableHandleValue retval) const +{ + const char funcName[] = "getQueryObjectEXT"; + retval.setNull(); + if (mIsLost) + return; + + mContext->GetQueryParameter(cx, query, pname, retval, funcName); +} + +bool +WebGLExtensionDisjointTimerQuery::IsSupported(const WebGLContext* webgl) +{ + webgl->MakeContextCurrent(); + gl::GLContext* gl = webgl->GL(); + return gl->IsSupported(gl::GLFeature::query_objects) && + gl->IsSupported(gl::GLFeature::get_query_object_i64v) && + gl->IsSupported(gl::GLFeature::query_counter); // provides GL_TIMESTAMP +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionDisjointTimerQuery, EXT_disjoint_timer_query) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionDrawBuffers.cpp b/dom/canvas/WebGLExtensionDrawBuffers.cpp new file mode 100644 index 000000000..27aa76cc7 --- /dev/null +++ b/dom/canvas/WebGLExtensionDrawBuffers.cpp @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFramebuffer.h" +#include "WebGLRenderbuffer.h" +#include "WebGLTexture.h" + +namespace mozilla { + +WebGLExtensionDrawBuffers::WebGLExtensionDrawBuffers(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); + + // WEBGL_draw_buffers: + // "The value of the MAX_COLOR_ATTACHMENTS_WEBGL parameter must be greater than or + // equal to that of the MAX_DRAW_BUFFERS_WEBGL parameter." + webgl->mImplMaxColorAttachments = webgl->mGLMaxColorAttachments; + webgl->mImplMaxDrawBuffers = std::min(webgl->mGLMaxDrawBuffers, + webgl->mImplMaxColorAttachments); +} + +WebGLExtensionDrawBuffers::~WebGLExtensionDrawBuffers() +{ +} + +void +WebGLExtensionDrawBuffers::DrawBuffersWEBGL(const dom::Sequence& buffers) +{ + if (mIsLost) { + mContext->ErrorInvalidOperation("drawBuffersWEBGL: Extension is lost."); + return; + } + + mContext->DrawBuffers(buffers); +} + +bool +WebGLExtensionDrawBuffers::IsSupported(const WebGLContext* webgl) +{ + gl::GLContext* gl = webgl->GL(); + + if (!gl->IsExtensionSupported(gl::GLContext::ARB_draw_buffers) && + !gl->IsExtensionSupported(gl::GLContext::EXT_draw_buffers)) + { + return false; + } + + // WEBGL_draw_buffers requires at least 4 color attachments. + if (webgl->mGLMaxDrawBuffers < webgl->kMinMaxDrawBuffers || + webgl->mGLMaxColorAttachments < webgl->kMinMaxColorAttachments) + { + return false; + } + + return true; +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionDrawBuffers, WEBGL_draw_buffers) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionEXTColorBufferFloat.cpp b/dom/canvas/WebGLExtensionEXTColorBufferFloat.cpp new file mode 100644 index 000000000..d5a0c608f --- /dev/null +++ b/dom/canvas/WebGLExtensionEXTColorBufferFloat.cpp @@ -0,0 +1,51 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +namespace mozilla { + +WebGLExtensionEXTColorBufferFloat::WebGLExtensionEXTColorBufferFloat(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); + + auto& fua = webgl->mFormatUsage; + + auto fnUpdateUsage = [&fua](GLenum sizedFormat, webgl::EffectiveFormat effFormat) { + auto usage = fua->EditUsage(effFormat); + usage->SetRenderable(); + fua->AllowRBFormat(sizedFormat, usage); + }; + +#define FOO(x) fnUpdateUsage(LOCAL_GL_ ## x, webgl::EffectiveFormat::x) + + FOO(R16F); + FOO(RG16F); + FOO(RGBA16F); + + FOO(R32F); + FOO(RG32F); + FOO(RGBA32F); + + FOO(R11F_G11F_B10F); + +#undef FOO +} + +/*static*/ bool +WebGLExtensionEXTColorBufferFloat::IsSupported(const WebGLContext* webgl) +{ + const gl::GLContext* gl = webgl->GL(); + return gl->IsSupported(gl::GLFeature::EXT_color_buffer_float); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionEXTColorBufferFloat, EXT_color_buffer_float) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionElementIndexUint.cpp b/dom/canvas/WebGLExtensionElementIndexUint.cpp new file mode 100644 index 000000000..b2946549e --- /dev/null +++ b/dom/canvas/WebGLExtensionElementIndexUint.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionElementIndexUint::WebGLExtensionElementIndexUint(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionElementIndexUint::~WebGLExtensionElementIndexUint() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionElementIndexUint, OES_element_index_uint) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionFragDepth.cpp b/dom/canvas/WebGLExtensionFragDepth.cpp new file mode 100644 index 000000000..130a3dede --- /dev/null +++ b/dom/canvas/WebGLExtensionFragDepth.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionFragDepth::WebGLExtensionFragDepth(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); +} + +WebGLExtensionFragDepth::~WebGLExtensionFragDepth() +{ +} + +bool +WebGLExtensionFragDepth::IsSupported(const WebGLContext* webgl) +{ + gl::GLContext* gl = webgl->GL(); + return gl->IsSupported(gl::GLFeature::frag_depth); +} + + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionFragDepth, EXT_frag_depth) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionInstancedArrays.cpp b/dom/canvas/WebGLExtensionInstancedArrays.cpp new file mode 100644 index 000000000..10d0533fe --- /dev/null +++ b/dom/canvas/WebGLExtensionInstancedArrays.cpp @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionInstancedArrays::WebGLExtensionInstancedArrays(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); +} + +WebGLExtensionInstancedArrays::~WebGLExtensionInstancedArrays() +{ +} + +void +WebGLExtensionInstancedArrays::DrawArraysInstancedANGLE(GLenum mode, + GLint first, + GLsizei count, + GLsizei primcount) +{ + if (mIsLost) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "drawArraysInstancedANGLE"); + return; + } + + mContext->DrawArraysInstanced(mode, first, count, primcount); +} + +void +WebGLExtensionInstancedArrays::DrawElementsInstancedANGLE(GLenum mode, + GLsizei count, + GLenum type, + WebGLintptr offset, + GLsizei primcount) +{ + if (mIsLost) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "drawElementsInstancedANGLE"); + return; + } + + mContext->DrawElementsInstanced(mode, count, type, offset, primcount); +} + +void +WebGLExtensionInstancedArrays::VertexAttribDivisorANGLE(GLuint index, + GLuint divisor) +{ + if (mIsLost) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "vertexAttribDivisorANGLE"); + return; + } + + mContext->VertexAttribDivisor(index, divisor); +} + +bool +WebGLExtensionInstancedArrays::IsSupported(const WebGLContext* webgl) +{ + gl::GLContext* gl = webgl->GL(); + return gl->IsSupported(gl::GLFeature::draw_instanced) && + gl->IsSupported(gl::GLFeature::instanced_arrays); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionInstancedArrays, ANGLE_instanced_arrays) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionLoseContext.cpp b/dom/canvas/WebGLExtensionLoseContext.cpp new file mode 100644 index 000000000..020731e63 --- /dev/null +++ b/dom/canvas/WebGLExtensionLoseContext.cpp @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionLoseContext::WebGLExtensionLoseContext(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionLoseContext::~WebGLExtensionLoseContext() +{ +} + +void +WebGLExtensionLoseContext::LoseContext() +{ + mContext->LoseContext(); +} + +void +WebGLExtensionLoseContext::RestoreContext() +{ + mContext->RestoreContext(); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionLoseContext, WEBGL_lose_context) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionSRGB.cpp b/dom/canvas/WebGLExtensionSRGB.cpp new file mode 100644 index 000000000..18c944e1b --- /dev/null +++ b/dom/canvas/WebGLExtensionSRGB.cpp @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +namespace mozilla { + +WebGLExtensionSRGB::WebGLExtensionSRGB(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); + + gl::GLContext* gl = webgl->GL(); + if (!gl->IsGLES()) { + // Desktop OpenGL requires the following to be enabled in order to + // support sRGB operations on framebuffers. + gl->MakeCurrent(); + gl->fEnable(LOCAL_GL_FRAMEBUFFER_SRGB_EXT); + } + + auto& fua = webgl->mFormatUsage; + + RefPtr gl_ = gl; // Bug 1201275 + const auto fnAdd = [&fua, &gl_](webgl::EffectiveFormat effFormat, GLenum format, + GLenum desktopUnpackFormat) + { + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + + webgl::DriverUnpackInfo dui = {format, format, LOCAL_GL_UNSIGNED_BYTE}; + const auto pi = dui.ToPacking(); + + if (!gl_->IsGLES()) + dui.unpackFormat = desktopUnpackFormat; + + fua->AddTexUnpack(usage, pi, dui); + + fua->AllowUnsizedTexFormat(pi, usage); + }; + + fnAdd(webgl::EffectiveFormat::SRGB8, LOCAL_GL_SRGB, LOCAL_GL_RGB); + fnAdd(webgl::EffectiveFormat::SRGB8_ALPHA8, LOCAL_GL_SRGB_ALPHA, LOCAL_GL_RGBA); + + auto usage = fua->EditUsage(webgl::EffectiveFormat::SRGB8_ALPHA8); + usage->SetRenderable(); + fua->AllowRBFormat(LOCAL_GL_SRGB8_ALPHA8, usage); +} + +WebGLExtensionSRGB::~WebGLExtensionSRGB() +{ +} + +bool +WebGLExtensionSRGB::IsSupported(const WebGLContext* webgl) +{ + gl::GLContext* gl = webgl->GL(); + + return gl->IsSupported(gl::GLFeature::sRGB_framebuffer) && + gl->IsSupported(gl::GLFeature::sRGB_texture); +} + + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionSRGB, EXT_sRGB) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionShaderTextureLod.cpp b/dom/canvas/WebGLExtensionShaderTextureLod.cpp new file mode 100644 index 000000000..55e023a7d --- /dev/null +++ b/dom/canvas/WebGLExtensionShaderTextureLod.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionShaderTextureLod::WebGLExtensionShaderTextureLod(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionShaderTextureLod::~WebGLExtensionShaderTextureLod() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionShaderTextureLod, EXT_shader_texture_lod) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionStandardDerivatives.cpp b/dom/canvas/WebGLExtensionStandardDerivatives.cpp new file mode 100644 index 000000000..57e6f9a7d --- /dev/null +++ b/dom/canvas/WebGLExtensionStandardDerivatives.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionStandardDerivatives::WebGLExtensionStandardDerivatives(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionStandardDerivatives::~WebGLExtensionStandardDerivatives() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionStandardDerivatives, OES_standard_derivatives) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionTextureFilterAnisotropic.cpp b/dom/canvas/WebGLExtensionTextureFilterAnisotropic.cpp new file mode 100644 index 000000000..bb6bee708 --- /dev/null +++ b/dom/canvas/WebGLExtensionTextureFilterAnisotropic.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLExtensionTextureFilterAnisotropic::WebGLExtensionTextureFilterAnisotropic(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionTextureFilterAnisotropic::~WebGLExtensionTextureFilterAnisotropic() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionTextureFilterAnisotropic, EXT_texture_filter_anisotropic) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionTextureFloat.cpp b/dom/canvas/WebGLExtensionTextureFloat.cpp new file mode 100644 index 000000000..4568e994e --- /dev/null +++ b/dom/canvas/WebGLExtensionTextureFloat.cpp @@ -0,0 +1,122 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +namespace mozilla { + +WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + MOZ_ASSERT(IsSupported(webgl)); + + auto& fua = webgl->mFormatUsage; + gl::GLContext* gl = webgl->GL(); + + webgl::PackingInfo pi; + webgl::DriverUnpackInfo dui; + const GLint* swizzle = nullptr; + + const auto fnAdd = [&fua, &pi, &dui, &swizzle](webgl::EffectiveFormat effFormat) + { + auto usage = fua->EditUsage(effFormat); + usage->textureSwizzleRGBA = swizzle; + fua->AddTexUnpack(usage, pi, dui); + + fua->AllowUnsizedTexFormat(pi, usage); + }; + + const bool needsSwizzle = gl->IsCoreProfile(); + MOZ_ASSERT_IF(needsSwizzle, gl->IsSupported(gl::GLFeature::texture_swizzle)); + + const bool needsSizedFormat = !gl->IsGLES(); + + //////////////// + + pi = {LOCAL_GL_RGBA, LOCAL_GL_FLOAT}; + dui = {pi.format, pi.format, pi.type}; + swizzle = nullptr; + if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_RGBA32F; + } + fnAdd(webgl::EffectiveFormat::RGBA32F); + + ////// + + pi = {LOCAL_GL_RGB, LOCAL_GL_FLOAT}; + dui = {pi.format, pi.format, pi.type}; + swizzle = nullptr; + if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_RGB32F; + } + fnAdd(webgl::EffectiveFormat::RGB32F); + + ////// + + pi = {LOCAL_GL_LUMINANCE, LOCAL_GL_FLOAT}; + dui = {pi.format, pi.format, pi.type}; + swizzle = nullptr; + if (needsSwizzle) { + dui = {LOCAL_GL_R32F, LOCAL_GL_RED, LOCAL_GL_FLOAT}; + swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA; + } else if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_LUMINANCE32F_ARB; + } + fnAdd(webgl::EffectiveFormat::Luminance32F); + + ////// + + pi = {LOCAL_GL_ALPHA, LOCAL_GL_FLOAT}; + dui = {pi.format, pi.format, pi.type}; + swizzle = nullptr; + if (needsSwizzle) { + dui = {LOCAL_GL_R32F, LOCAL_GL_RED, LOCAL_GL_FLOAT}; + swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA; + } else if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_ALPHA32F_ARB; + } + fnAdd(webgl::EffectiveFormat::Alpha32F); + + ////// + + pi = {LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_FLOAT}; + dui = {pi.format, pi.format, pi.type}; + swizzle = nullptr; + if (needsSwizzle) { + dui = {LOCAL_GL_RG32F, LOCAL_GL_RG, LOCAL_GL_FLOAT}; + swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA; + } else if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA32F_ARB; + } + fnAdd(webgl::EffectiveFormat::Luminance32FAlpha32F); +} + +WebGLExtensionTextureFloat::~WebGLExtensionTextureFloat() +{ +} + +bool +WebGLExtensionTextureFloat::IsSupported(const WebGLContext* webgl) +{ + gl::GLContext* gl = webgl->GL(); + + if (!gl->IsSupported(gl::GLFeature::texture_float)) + return false; + + const bool needsSwizzle = gl->IsCoreProfile(); + const bool hasSwizzle = gl->IsSupported(gl::GLFeature::texture_swizzle); + if (needsSwizzle && !hasSwizzle) + return false; + + return true; +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionTextureFloat, OES_texture_float) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionTextureFloatLinear.cpp b/dom/canvas/WebGLExtensionTextureFloatLinear.cpp new file mode 100644 index 000000000..43e9b5040 --- /dev/null +++ b/dom/canvas/WebGLExtensionTextureFloatLinear.cpp @@ -0,0 +1,32 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +namespace mozilla { + +WebGLExtensionTextureFloatLinear::WebGLExtensionTextureFloatLinear(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + auto& fua = webgl->mFormatUsage; + + fua->EditUsage(webgl::EffectiveFormat::RGBA32F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::RGB32F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::Luminance32FAlpha32F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::Luminance32F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::Alpha32F)->isFilterable = true; +} + +WebGLExtensionTextureFloatLinear::~WebGLExtensionTextureFloatLinear() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionTextureFloatLinear, OES_texture_float_linear) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionTextureHalfFloat.cpp b/dom/canvas/WebGLExtensionTextureHalfFloat.cpp new file mode 100644 index 000000000..e59f9b232 --- /dev/null +++ b/dom/canvas/WebGLExtensionTextureHalfFloat.cpp @@ -0,0 +1,129 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +namespace mozilla { + +WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + auto& fua = webgl->mFormatUsage; + gl::GLContext* gl = webgl->GL(); + + webgl::PackingInfo pi; + webgl::DriverUnpackInfo dui; + const GLint* swizzle = nullptr; + + const auto fnAdd = [&fua, &pi, &dui, &swizzle](webgl::EffectiveFormat effFormat) + { + auto usage = fua->EditUsage(effFormat); + usage->textureSwizzleRGBA = swizzle; + fua->AddTexUnpack(usage, pi, dui); + + fua->AllowUnsizedTexFormat(pi, usage); + }; + + const bool needsSwizzle = gl->IsCoreProfile(); + MOZ_ASSERT_IF(needsSwizzle, gl->IsSupported(gl::GLFeature::texture_swizzle)); + + const bool needsSizedFormat = !gl->IsGLES(); + + GLenum driverUnpackType = LOCAL_GL_HALF_FLOAT; + if (!gl->IsSupported(gl::GLFeature::texture_half_float)) { + MOZ_ASSERT(gl->IsExtensionSupported(gl::GLContext::OES_texture_half_float)); + driverUnpackType = LOCAL_GL_HALF_FLOAT_OES; + } + + //////////////// + + pi = {LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT_OES}; + dui = {pi.format, pi.format, driverUnpackType}; + swizzle = nullptr; + if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_RGBA16F; + } + fnAdd(webgl::EffectiveFormat::RGBA16F); + + ////// + + pi = {LOCAL_GL_RGB, LOCAL_GL_HALF_FLOAT_OES}; + dui = {pi.format, pi.format, driverUnpackType}; + swizzle = nullptr; + if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_RGB16F; + } + fnAdd(webgl::EffectiveFormat::RGB16F); + + ////// + + pi = {LOCAL_GL_LUMINANCE, LOCAL_GL_HALF_FLOAT_OES}; + dui = {pi.format, pi.format, driverUnpackType}; + swizzle = nullptr; + if (needsSwizzle) { + dui = {LOCAL_GL_R16F, LOCAL_GL_RED, driverUnpackType}; + swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA; + } else if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_LUMINANCE16F_ARB; + } + fnAdd(webgl::EffectiveFormat::Luminance16F); + + ////// + + pi = {LOCAL_GL_ALPHA, LOCAL_GL_HALF_FLOAT_OES}; + dui = {pi.format, pi.format, driverUnpackType}; + swizzle = nullptr; + if (needsSwizzle) { + dui = {LOCAL_GL_R16F, LOCAL_GL_RED, driverUnpackType}; + swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA; + } else if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_ALPHA16F_ARB; + } + fnAdd(webgl::EffectiveFormat::Alpha16F); + + ////// + + pi = {LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_HALF_FLOAT_OES}; + dui = {pi.format, pi.format, driverUnpackType}; + swizzle = nullptr; + if (needsSwizzle) { + dui = {LOCAL_GL_RG16F, LOCAL_GL_RG, driverUnpackType}; + swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA; + } else if (needsSizedFormat) { + dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA16F_ARB; + } + fnAdd(webgl::EffectiveFormat::Luminance16FAlpha16F); +} + +WebGLExtensionTextureHalfFloat::~WebGLExtensionTextureHalfFloat() +{ +} + +bool +WebGLExtensionTextureHalfFloat::IsSupported(const WebGLContext* webgl) +{ + gl::GLContext* gl = webgl->GL(); + + if (!gl->IsSupported(gl::GLFeature::texture_half_float) && + !gl->IsExtensionSupported(gl::GLContext::OES_texture_half_float)) + { + return false; + } + + const bool needsSwizzle = gl->IsCoreProfile(); + const bool hasSwizzle = gl->IsSupported(gl::GLFeature::texture_swizzle); + if (needsSwizzle && !hasSwizzle) + return false; + + return true; +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionTextureHalfFloat, OES_texture_half_float) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionTextureHalfFloatLinear.cpp b/dom/canvas/WebGLExtensionTextureHalfFloatLinear.cpp new file mode 100644 index 000000000..5097a0d6a --- /dev/null +++ b/dom/canvas/WebGLExtensionTextureHalfFloatLinear.cpp @@ -0,0 +1,32 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" +#include "WebGLFormats.h" + +namespace mozilla { + +WebGLExtensionTextureHalfFloatLinear::WebGLExtensionTextureHalfFloatLinear(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ + auto& fua = webgl->mFormatUsage; + + fua->EditUsage(webgl::EffectiveFormat::RGBA16F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::RGB16F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::Luminance16FAlpha16F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::Luminance16F)->isFilterable = true; + fua->EditUsage(webgl::EffectiveFormat::Alpha16F)->isFilterable = true; +} + +WebGLExtensionTextureHalfFloatLinear::~WebGLExtensionTextureHalfFloatLinear() +{ +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionTextureHalfFloatLinear, OES_texture_half_float_linear) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensionVertexArray.cpp b/dom/canvas/WebGLExtensionVertexArray.cpp new file mode 100644 index 000000000..0984582f5 --- /dev/null +++ b/dom/canvas/WebGLExtensionVertexArray.cpp @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLExtensions.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLBuffer.h" +#include "WebGLContext.h" +#include "WebGLVertexArray.h" + +namespace mozilla { + +WebGLExtensionVertexArray::WebGLExtensionVertexArray(WebGLContext* webgl) + : WebGLExtensionBase(webgl) +{ +} + +WebGLExtensionVertexArray::~WebGLExtensionVertexArray() +{ +} + +already_AddRefed +WebGLExtensionVertexArray::CreateVertexArrayOES() +{ + if (mIsLost) + return nullptr; + + return mContext->CreateVertexArray(); +} + +void +WebGLExtensionVertexArray::DeleteVertexArrayOES(WebGLVertexArray* array) +{ + if (mIsLost) + return; + + mContext->DeleteVertexArray(array); +} + +bool +WebGLExtensionVertexArray::IsVertexArrayOES(const WebGLVertexArray* array) +{ + if (mIsLost) + return false; + + return mContext->IsVertexArray(array); +} + +void +WebGLExtensionVertexArray::BindVertexArrayOES(WebGLVertexArray* array) +{ + if (mIsLost) + return; + + mContext->BindVertexArray(array); +} + +IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionVertexArray, OES_vertex_array_object) + +} // namespace mozilla diff --git a/dom/canvas/WebGLExtensions.h b/dom/canvas/WebGLExtensions.h new file mode 100644 index 000000000..741f6997f --- /dev/null +++ b/dom/canvas/WebGLExtensions.h @@ -0,0 +1,390 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_EXTENSIONS_H_ +#define WEBGL_EXTENSIONS_H_ + +#include "mozilla/AlreadyAddRefed.h" +#include "nsWrapperCache.h" +#include "WebGLObjectModel.h" +#include "WebGLTypes.h" + +namespace mozilla { + +namespace dom { +template +class Sequence; +} // namespace dom + +namespace webgl { +class FormatUsageAuthority; +} // namespace webgl + +class WebGLContext; +class WebGLShader; +class WebGLQuery; +class WebGLVertexArray; + +class WebGLExtensionBase + : public nsWrapperCache + , public WebGLContextBoundObject +{ +public: + explicit WebGLExtensionBase(WebGLContext* webgl); + + WebGLContext* GetParentObject() const { + return mContext; + } + + void MarkLost(); + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLExtensionBase) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLExtensionBase) + +protected: + virtual ~WebGLExtensionBase(); + + virtual void OnMarkLost() { } + + bool mIsLost; +}; + +#define DECL_WEBGL_EXTENSION_GOOP \ + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + +#define IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionType, WebGLBindingType)\ + JSObject* \ + WebGLExtensionType::WrapObject(JSContext* cx, JS::Handle givenProto) { \ + return dom::WebGLBindingType##Binding::Wrap(cx, this, givenProto); \ + } + +class WebGLExtensionCompressedTextureATC + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionCompressedTextureATC(WebGLContext*); + virtual ~WebGLExtensionCompressedTextureATC(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionCompressedTextureES3 + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionCompressedTextureES3(WebGLContext*); + virtual ~WebGLExtensionCompressedTextureES3(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionCompressedTextureETC1 + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionCompressedTextureETC1(WebGLContext*); + virtual ~WebGLExtensionCompressedTextureETC1(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionCompressedTexturePVRTC + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionCompressedTexturePVRTC(WebGLContext*); + virtual ~WebGLExtensionCompressedTexturePVRTC(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionCompressedTextureS3TC + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionCompressedTextureS3TC(WebGLContext*); + virtual ~WebGLExtensionCompressedTextureS3TC(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionDebugRendererInfo + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionDebugRendererInfo(WebGLContext*); + virtual ~WebGLExtensionDebugRendererInfo(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionDebugShaders + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionDebugShaders(WebGLContext*); + virtual ~WebGLExtensionDebugShaders(); + + void GetTranslatedShaderSource(const WebGLShader& shader, nsAString& retval) const; + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionDepthTexture + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionDepthTexture(WebGLContext*); + virtual ~WebGLExtensionDepthTexture(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionElementIndexUint + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionElementIndexUint(WebGLContext*); + virtual ~WebGLExtensionElementIndexUint(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionEXTColorBufferFloat + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionEXTColorBufferFloat(WebGLContext*); + virtual ~WebGLExtensionEXTColorBufferFloat() { } + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionFragDepth + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionFragDepth(WebGLContext*); + virtual ~WebGLExtensionFragDepth(); + + static bool IsSupported(const WebGLContext* context); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionLoseContext + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionLoseContext(WebGLContext*); + virtual ~WebGLExtensionLoseContext(); + + void LoseContext(); + void RestoreContext(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionSRGB + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionSRGB(WebGLContext*); + virtual ~WebGLExtensionSRGB(); + + static bool IsSupported(const WebGLContext* context); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionStandardDerivatives + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionStandardDerivatives(WebGLContext*); + virtual ~WebGLExtensionStandardDerivatives(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionShaderTextureLod + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionShaderTextureLod(WebGLContext*); + virtual ~WebGLExtensionShaderTextureLod(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionTextureFilterAnisotropic + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionTextureFilterAnisotropic(WebGLContext*); + virtual ~WebGLExtensionTextureFilterAnisotropic(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionTextureFloat + : public WebGLExtensionBase +{ +public: + static void InitWebGLFormats(webgl::FormatUsageAuthority* authority); + + explicit WebGLExtensionTextureFloat(WebGLContext*); + virtual ~WebGLExtensionTextureFloat(); + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionTextureFloatLinear + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionTextureFloatLinear(WebGLContext*); + virtual ~WebGLExtensionTextureFloatLinear(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionTextureHalfFloat + : public WebGLExtensionBase +{ +public: + static void InitWebGLFormats(webgl::FormatUsageAuthority* authority); + + explicit WebGLExtensionTextureHalfFloat(WebGLContext*); + virtual ~WebGLExtensionTextureHalfFloat(); + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionTextureHalfFloatLinear + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionTextureHalfFloatLinear(WebGLContext*); + virtual ~WebGLExtensionTextureHalfFloatLinear(); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionColorBufferFloat + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionColorBufferFloat(WebGLContext*); + virtual ~WebGLExtensionColorBufferFloat(); + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionColorBufferHalfFloat + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionColorBufferHalfFloat(WebGLContext*); + virtual ~WebGLExtensionColorBufferHalfFloat(); + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionDrawBuffers + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionDrawBuffers(WebGLContext*); + virtual ~WebGLExtensionDrawBuffers(); + + void DrawBuffersWEBGL(const dom::Sequence& buffers); + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionVertexArray + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionVertexArray(WebGLContext* webgl); + virtual ~WebGLExtensionVertexArray(); + + already_AddRefed CreateVertexArrayOES(); + void DeleteVertexArrayOES(WebGLVertexArray* array); + bool IsVertexArrayOES(const WebGLVertexArray* array); + void BindVertexArrayOES(WebGLVertexArray* array); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionInstancedArrays + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionInstancedArrays(WebGLContext* webgl); + virtual ~WebGLExtensionInstancedArrays(); + + void DrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, + GLsizei primcount); + void DrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, + WebGLintptr offset, GLsizei primcount); + void VertexAttribDivisorANGLE(GLuint index, GLuint divisor); + + static bool IsSupported(const WebGLContext* webgl); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionBlendMinMax + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionBlendMinMax(WebGLContext* webgl); + virtual ~WebGLExtensionBlendMinMax(); + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +class WebGLExtensionDisjointTimerQuery + : public WebGLExtensionBase +{ +public: + explicit WebGLExtensionDisjointTimerQuery(WebGLContext* webgl); + virtual ~WebGLExtensionDisjointTimerQuery(); + + already_AddRefed CreateQueryEXT() const; + void DeleteQueryEXT(WebGLQuery* query) const; + bool IsQueryEXT(const WebGLQuery* query) const; + void BeginQueryEXT(GLenum target, WebGLQuery& query) const; + void EndQueryEXT(GLenum target) const; + void QueryCounterEXT(WebGLQuery& query, GLenum target) const; + void GetQueryEXT(JSContext* cx, GLenum target, GLenum pname, + JS::MutableHandleValue retval) const; + void GetQueryObjectEXT(JSContext* cx, const WebGLQuery& query, + GLenum pname, JS::MutableHandleValue retval) const; + + static bool IsSupported(const WebGLContext*); + + DECL_WEBGL_EXTENSION_GOOP +}; + +} // namespace mozilla + +#endif // WEBGL_EXTENSIONS_H_ diff --git a/dom/canvas/WebGLFormats.cpp b/dom/canvas/WebGLFormats.cpp new file mode 100644 index 000000000..d2fc38548 --- /dev/null +++ b/dom/canvas/WebGLFormats.cpp @@ -0,0 +1,1126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLFormats.h" + +#include "gfxPrefs.h" +#include "GLContext.h" +#include "GLDefs.h" +#include "mozilla/gfx/Logging.h" +#include "mozilla/StaticMutex.h" + +#ifdef FOO +#error FOO is already defined! We use FOO() macros to keep things succinct in this file. +#endif + +namespace mozilla { +namespace webgl { + +template +static inline void +AlwaysInsert(std::map& dest, const K2& key, const V2& val) +{ + auto res = dest.insert({ key, val }); + bool didInsert = res.second; + MOZ_ALWAYS_TRUE(didInsert); +} + +template +static inline V* +FindOrNull(const std::map& dest, const K2& key) +{ + auto itr = dest.find(key); + if (itr == dest.end()) + return nullptr; + + return itr->second; +} + +// Returns a pointer to the in-place value for `key`. +template +static inline V* +FindPtrOrNull(std::map& dest, const K2& key) +{ + auto itr = dest.find(key); + if (itr == dest.end()) + return nullptr; + + return &(itr->second); +} + +////////////////////////////////////////////////////////////////////////////////////////// + +std::map gCompressedFormatInfoMap; +std::map gFormatInfoMap; + +static inline const CompressedFormatInfo* +GetCompressedFormatInfo(EffectiveFormat format) +{ + MOZ_ASSERT(!gCompressedFormatInfoMap.empty()); + return FindPtrOrNull(gCompressedFormatInfoMap, format); +} + +static inline FormatInfo* +GetFormatInfo_NoLock(EffectiveFormat format) +{ + MOZ_ASSERT(!gFormatInfoMap.empty()); + return FindPtrOrNull(gFormatInfoMap, format); +} + +////////////////////////////////////////////////////////////////////////////////////////// + +static void +AddCompressedFormatInfo(EffectiveFormat format, uint16_t bitsPerBlock, uint8_t blockWidth, + uint8_t blockHeight, CompressionFamily family) +{ + MOZ_ASSERT(bitsPerBlock % 8 == 0); + uint16_t bytesPerBlock = bitsPerBlock / 8; // The specs always state these in bits, + // but it's only ever useful to us as + // bytes. + MOZ_ASSERT(bytesPerBlock <= 255); + + const CompressedFormatInfo info = { format, uint8_t(bytesPerBlock), blockWidth, + blockHeight, family }; + AlwaysInsert(gCompressedFormatInfoMap, format, info); +} + +static void +InitCompressedFormatInfo() +{ + // GLES 3.0.4, p147, table 3.19 + // GLES 3.0.4, p286+, $C.1 "ETC Compressed Texture Image Formats" + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGB8_ETC2 , 64, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_SRGB8_ETC2 , 64, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGBA8_ETC2_EAC , 128, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC , 128, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_R11_EAC , 64, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RG11_EAC , 128, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_SIGNED_R11_EAC , 64, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_SIGNED_RG11_EAC , 128, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 , 64, 4, 4, CompressionFamily::ES3); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, 64, 4, 4, CompressionFamily::ES3); + + // AMD_compressed_ATC_texture + AddCompressedFormatInfo(EffectiveFormat::ATC_RGB_AMD , 64, 4, 4, CompressionFamily::ATC); + AddCompressedFormatInfo(EffectiveFormat::ATC_RGBA_EXPLICIT_ALPHA_AMD , 128, 4, 4, CompressionFamily::ATC); + AddCompressedFormatInfo(EffectiveFormat::ATC_RGBA_INTERPOLATED_ALPHA_AMD, 128, 4, 4, CompressionFamily::ATC); + + // EXT_texture_compression_s3tc + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGB_S3TC_DXT1_EXT , 64, 4, 4, CompressionFamily::S3TC); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGBA_S3TC_DXT1_EXT, 64, 4, 4, CompressionFamily::S3TC); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGBA_S3TC_DXT3_EXT, 128, 4, 4, CompressionFamily::S3TC); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGBA_S3TC_DXT5_EXT, 128, 4, 4, CompressionFamily::S3TC); + + // IMG_texture_compression_pvrtc + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGB_PVRTC_4BPPV1 , 256, 8, 8, CompressionFamily::PVRTC); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGBA_PVRTC_4BPPV1, 256, 8, 8, CompressionFamily::PVRTC); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGB_PVRTC_2BPPV1 , 256, 16, 8, CompressionFamily::PVRTC); + AddCompressedFormatInfo(EffectiveFormat::COMPRESSED_RGBA_PVRTC_2BPPV1, 256, 16, 8, CompressionFamily::PVRTC); + + // OES_compressed_ETC1_RGB8_texture + AddCompressedFormatInfo(EffectiveFormat::ETC1_RGB8_OES, 64, 4, 4, CompressionFamily::ETC1); +} + +////////////////////////////////////////////////////////////////////////////////////////// + +static void +AddFormatInfo(EffectiveFormat format, const char* name, GLenum sizedFormat, + uint8_t bytesPerPixel, uint8_t r, uint8_t g, uint8_t b, uint8_t a, + uint8_t d, uint8_t s, UnsizedFormat unsizedFormat, bool isSRGB, + ComponentType componentType) +{ + switch (unsizedFormat) { + case UnsizedFormat::R: + MOZ_ASSERT(r && !g && !b && !a && !d && !s); + break; + + case UnsizedFormat::RG: + MOZ_ASSERT(r && g && !b && !a && !d && !s); + break; + + case UnsizedFormat::RGB: + MOZ_ASSERT(r && g && b && !a && !d && !s); + break; + + case UnsizedFormat::RGBA: + MOZ_ASSERT(r && g && b && a && !d && !s); + break; + + case UnsizedFormat::L: + MOZ_ASSERT(r && !g && !b && !a && !d && !s); + break; + + case UnsizedFormat::A: + MOZ_ASSERT(!r && !g && !b && a && !d && !s); + break; + + case UnsizedFormat::LA: + MOZ_ASSERT(r && !g && !b && a && !d && !s); + break; + + case UnsizedFormat::D: + MOZ_ASSERT(!r && !g && !b && !a && d && !s); + break; + + case UnsizedFormat::S: + MOZ_ASSERT(!r && !g && !b && !a && !d && s); + break; + + case UnsizedFormat::DEPTH_STENCIL: + MOZ_ASSERT(!r && !g && !b && !a && d && s); + break; + } + + const CompressedFormatInfo* compressedFormatInfo = GetCompressedFormatInfo(format); + MOZ_ASSERT(!bytesPerPixel == bool(compressedFormatInfo)); + +#ifdef DEBUG + uint8_t totalBits = r + g + b + a + d + s; + if (format == EffectiveFormat::RGB9_E5) { + totalBits = 9 + 9 + 9 + 5; + } + + if (compressedFormatInfo) { + MOZ_ASSERT(totalBits); + MOZ_ASSERT(!bytesPerPixel); + } else { + MOZ_ASSERT(totalBits == bytesPerPixel*8); + } +#endif + + const FormatInfo info = { format, name, sizedFormat, unsizedFormat, componentType, + isSRGB, compressedFormatInfo, bytesPerPixel, r,g,b,a,d,s }; + AlwaysInsert(gFormatInfoMap, format, info); +} + +static void +InitFormatInfo() +{ +#define FOO(x) EffectiveFormat::x, #x, LOCAL_GL_ ## x + + // GLES 3.0.4, p130-132, table 3.13 + AddFormatInfo(FOO(R8 ), 1, 8, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::NormUInt); + AddFormatInfo(FOO(R8_SNORM ), 1, 8, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::NormInt ); + AddFormatInfo(FOO(RG8 ), 2, 8, 8, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::NormUInt); + AddFormatInfo(FOO(RG8_SNORM ), 2, 8, 8, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::NormInt ); + AddFormatInfo(FOO(RGB8 ), 3, 8, 8, 8, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt); + AddFormatInfo(FOO(RGB8_SNORM ), 3, 8, 8, 8, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormInt ); + AddFormatInfo(FOO(RGB565 ), 2, 5, 6, 5, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt); + AddFormatInfo(FOO(RGBA4 ), 2, 4, 4, 4, 4, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(RGB5_A1 ), 2, 5, 5, 5, 1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(RGBA8 ), 4, 8, 8, 8, 8, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(RGBA8_SNORM ), 4, 8, 8, 8, 8, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormInt ); + AddFormatInfo(FOO(RGB10_A2 ), 4, 10,10,10, 2, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(RGB10_A2UI ), 4, 10,10,10, 2, 0,0, UnsizedFormat::RGBA, false, ComponentType::UInt ); + + AddFormatInfo(FOO(SRGB8 ), 3, 8, 8, 8, 0, 0,0, UnsizedFormat::RGB , true , ComponentType::NormUInt); + AddFormatInfo(FOO(SRGB8_ALPHA8 ), 4, 8, 8, 8, 8, 0,0, UnsizedFormat::RGBA, true , ComponentType::NormUInt); + + AddFormatInfo(FOO(R16F ), 2, 16, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::Float ); + AddFormatInfo(FOO(RG16F ), 4, 16,16, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::Float ); + AddFormatInfo(FOO(RGB16F ), 6, 16,16,16, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::Float ); + AddFormatInfo(FOO(RGBA16F ), 8, 16,16,16,16, 0,0, UnsizedFormat::RGBA, false, ComponentType::Float ); + AddFormatInfo(FOO(R32F ), 4, 32, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::Float ); + AddFormatInfo(FOO(RG32F ), 8, 32,32, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::Float ); + AddFormatInfo(FOO(RGB32F ), 12, 32,32,32, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::Float ); + AddFormatInfo(FOO(RGBA32F ), 16, 32,32,32,32, 0,0, UnsizedFormat::RGBA, false, ComponentType::Float ); + + AddFormatInfo(FOO(R11F_G11F_B10F), 4, 11,11,10, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::Float ); + AddFormatInfo(FOO(RGB9_E5 ), 4, 14,14,14, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::Float ); + + AddFormatInfo(FOO(R8I ), 1, 8, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::Int ); + AddFormatInfo(FOO(R8UI ), 1, 8, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::UInt ); + AddFormatInfo(FOO(R16I ), 2, 16, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::Int ); + AddFormatInfo(FOO(R16UI ), 2, 16, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::UInt ); + AddFormatInfo(FOO(R32I ), 4, 32, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::Int ); + AddFormatInfo(FOO(R32UI ), 4, 32, 0, 0, 0, 0,0, UnsizedFormat::R , false, ComponentType::UInt ); + + AddFormatInfo(FOO(RG8I ), 2, 8, 8, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::Int ); + AddFormatInfo(FOO(RG8UI ), 2, 8, 8, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::UInt ); + AddFormatInfo(FOO(RG16I ), 4, 16,16, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::Int ); + AddFormatInfo(FOO(RG16UI ), 4, 16,16, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::UInt ); + AddFormatInfo(FOO(RG32I ), 8, 32,32, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::Int ); + AddFormatInfo(FOO(RG32UI ), 8, 32,32, 0, 0, 0,0, UnsizedFormat::RG , false, ComponentType::UInt ); + + AddFormatInfo(FOO(RGB8I ), 3, 8, 8, 8, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::Int ); + AddFormatInfo(FOO(RGB8UI ), 3, 8, 8, 8, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::UInt ); + AddFormatInfo(FOO(RGB16I ), 6, 16,16,16, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::Int ); + AddFormatInfo(FOO(RGB16UI ), 6, 16,16,16, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::UInt ); + AddFormatInfo(FOO(RGB32I ), 12, 32,32,32, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::Int ); + AddFormatInfo(FOO(RGB32UI ), 12, 32,32,32, 0, 0,0, UnsizedFormat::RGB , false, ComponentType::UInt ); + + AddFormatInfo(FOO(RGBA8I ), 4, 8, 8, 8, 8, 0,0, UnsizedFormat::RGBA, false, ComponentType::Int ); + AddFormatInfo(FOO(RGBA8UI ), 4, 8, 8, 8, 8, 0,0, UnsizedFormat::RGBA, false, ComponentType::UInt ); + AddFormatInfo(FOO(RGBA16I ), 8, 16,16,16,16, 0,0, UnsizedFormat::RGBA, false, ComponentType::Int ); + AddFormatInfo(FOO(RGBA16UI ), 8, 16,16,16,16, 0,0, UnsizedFormat::RGBA, false, ComponentType::UInt ); + AddFormatInfo(FOO(RGBA32I ), 16, 32,32,32,32, 0,0, UnsizedFormat::RGBA, false, ComponentType::Int ); + AddFormatInfo(FOO(RGBA32UI ), 16, 32,32,32,32, 0,0, UnsizedFormat::RGBA, false, ComponentType::UInt ); + + // GLES 3.0.4, p133, table 3.14 + AddFormatInfo(FOO(DEPTH_COMPONENT16 ), 2, 0,0,0,0, 16,0, UnsizedFormat::D , false, ComponentType::NormUInt); + AddFormatInfo(FOO(DEPTH_COMPONENT24 ), 3, 0,0,0,0, 24,0, UnsizedFormat::D , false, ComponentType::NormUInt); + AddFormatInfo(FOO(DEPTH_COMPONENT32F), 4, 0,0,0,0, 32,0, UnsizedFormat::D , false, ComponentType::Float); + AddFormatInfo(FOO(DEPTH24_STENCIL8 ), 4, 0,0,0,0, 24,8, UnsizedFormat::DEPTH_STENCIL, false, ComponentType::Special); + AddFormatInfo(FOO(DEPTH32F_STENCIL8 ), 5, 0,0,0,0, 32,8, UnsizedFormat::DEPTH_STENCIL, false, ComponentType::Special); + + // GLES 3.0.4, p205-206, "Required Renderbuffer Formats" + AddFormatInfo(FOO(STENCIL_INDEX8), 1, 0,0,0,0, 0,8, UnsizedFormat::S, false, ComponentType::UInt); + + // GLES 3.0.4, p147, table 3.19 + // GLES 3.0.4 p286+ $C.1 "ETC Compressed Texture Image Formats" + AddFormatInfo(FOO(COMPRESSED_RGB8_ETC2 ), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_SRGB8_ETC2 ), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB , true , ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RGBA8_ETC2_EAC ), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_SRGB8_ALPHA8_ETC2_EAC ), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, true , ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_R11_EAC ), 0, 1,0,0,0, 0,0, UnsizedFormat::R , false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RG11_EAC ), 0, 1,1,0,0, 0,0, UnsizedFormat::RG , false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_SIGNED_R11_EAC ), 0, 1,0,0,0, 0,0, UnsizedFormat::R , false, ComponentType::NormInt ); + AddFormatInfo(FOO(COMPRESSED_SIGNED_RG11_EAC ), 0, 1,1,0,0, 0,0, UnsizedFormat::RG , false, ComponentType::NormInt ); + AddFormatInfo(FOO(COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 ), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, true , ComponentType::NormUInt); + + // AMD_compressed_ATC_texture + AddFormatInfo(FOO(ATC_RGB_AMD ), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt); + AddFormatInfo(FOO(ATC_RGBA_EXPLICIT_ALPHA_AMD ), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(ATC_RGBA_INTERPOLATED_ALPHA_AMD), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + + // EXT_texture_compression_s3tc + AddFormatInfo(FOO(COMPRESSED_RGB_S3TC_DXT1_EXT ), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RGBA_S3TC_DXT1_EXT), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RGBA_S3TC_DXT3_EXT), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RGBA_S3TC_DXT5_EXT), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + + // IMG_texture_compression_pvrtc + AddFormatInfo(FOO(COMPRESSED_RGB_PVRTC_4BPPV1 ), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RGBA_PVRTC_4BPPV1), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RGB_PVRTC_2BPPV1 ), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt); + AddFormatInfo(FOO(COMPRESSED_RGBA_PVRTC_2BPPV1), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt); + + // OES_compressed_ETC1_RGB8_texture + AddFormatInfo(FOO(ETC1_RGB8_OES), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB, false, ComponentType::NormUInt); + +#undef FOO + + // 'Virtual' effective formats have no sizedFormat. +#define FOO(x) EffectiveFormat::x, #x, 0 + + // GLES 3.0.4, p128, table 3.12. + AddFormatInfo(FOO(Luminance8Alpha8), 2, 8,0,0,8, 0,0, UnsizedFormat::LA, false, ComponentType::NormUInt); + AddFormatInfo(FOO(Luminance8 ), 1, 8,0,0,0, 0,0, UnsizedFormat::L , false, ComponentType::NormUInt); + AddFormatInfo(FOO(Alpha8 ), 1, 0,0,0,8, 0,0, UnsizedFormat::A , false, ComponentType::NormUInt); + + // OES_texture_float + AddFormatInfo(FOO(Luminance32FAlpha32F), 8, 32,0,0,32, 0,0, UnsizedFormat::LA, false, ComponentType::Float); + AddFormatInfo(FOO(Luminance32F ), 4, 32,0,0, 0, 0,0, UnsizedFormat::L , false, ComponentType::Float); + AddFormatInfo(FOO(Alpha32F ), 4, 0,0,0,32, 0,0, UnsizedFormat::A , false, ComponentType::Float); + + // OES_texture_half_float + AddFormatInfo(FOO(Luminance16FAlpha16F), 4, 16,0,0,16, 0,0, UnsizedFormat::LA, false, ComponentType::Float); + AddFormatInfo(FOO(Luminance16F ), 2, 16,0,0, 0, 0,0, UnsizedFormat::L , false, ComponentType::Float); + AddFormatInfo(FOO(Alpha16F ), 2, 0,0,0,16, 0,0, UnsizedFormat::A , false, ComponentType::Float); + +#undef FOO + + //////////////////////////////////////////////////////////////////////////// + + const auto fnSetCopyDecay = [](EffectiveFormat src, EffectiveFormat asR, + EffectiveFormat asRG, EffectiveFormat asRGB, + EffectiveFormat asRGBA, EffectiveFormat asL, + EffectiveFormat asA, EffectiveFormat asLA) + { + auto& map = GetFormatInfo_NoLock(src)->copyDecayFormats; + + const auto fnSet = [&map](UnsizedFormat uf, EffectiveFormat ef) { + if (ef == EffectiveFormat::MAX) + return; + + const auto* format = GetFormatInfo_NoLock(ef); + MOZ_ASSERT(format->unsizedFormat == uf); + AlwaysInsert(map, uf, format); + }; + + fnSet(UnsizedFormat::R , asR); + fnSet(UnsizedFormat::RG , asRG); + fnSet(UnsizedFormat::RGB , asRGB); + fnSet(UnsizedFormat::RGBA, asRGBA); + fnSet(UnsizedFormat::L , asL); + fnSet(UnsizedFormat::A , asA); + fnSet(UnsizedFormat::LA , asLA); + }; + +#define SET_COPY_DECAY(src,asR,asRG,asRGB,asRGBA,asL,asA,asLA) \ + fnSetCopyDecay(EffectiveFormat::src, EffectiveFormat::asR, EffectiveFormat::asRG, \ + EffectiveFormat::asRGB, EffectiveFormat::asRGBA, EffectiveFormat::asL, \ + EffectiveFormat::asA, EffectiveFormat::asLA); + + ////// + +#define SET_BY_SUFFIX(X) \ + SET_COPY_DECAY( R##X, R##X, MAX, MAX, MAX, Luminance##X, MAX, MAX) \ + SET_COPY_DECAY( RG##X, R##X, RG##X, MAX, MAX, Luminance##X, MAX, MAX) \ + SET_COPY_DECAY( RGB##X, R##X, RG##X, RGB##X, MAX, Luminance##X, MAX, MAX) \ + SET_COPY_DECAY(RGBA##X, R##X, RG##X, RGB##X, RGBA##X, Luminance##X, Alpha##X, Luminance##X##Alpha##X) + + SET_BY_SUFFIX(8) // WebGL decided that RGB8 should be guaranteed renderable. + SET_BY_SUFFIX(16F) // RGB16F is renderable in EXT_color_buffer_half_float, though not + // EXT_color_buffer_float. + SET_BY_SUFFIX(32F) // Technically RGB32F is never renderable, but no harm here. + +#undef SET_BY_SUFFIX + + ////// + +#define SET_BY_SUFFIX(X) \ + SET_COPY_DECAY( R##X, R##X, MAX, MAX, MAX, MAX, MAX, MAX) \ + SET_COPY_DECAY( RG##X, R##X, RG##X, MAX, MAX, MAX, MAX, MAX) \ + SET_COPY_DECAY(RGBA##X, R##X, RG##X, RGB##X, RGBA##X, MAX, MAX, MAX) + + SET_BY_SUFFIX(8I) + SET_BY_SUFFIX(8UI) + + SET_BY_SUFFIX(16I) + SET_BY_SUFFIX(16UI) + + SET_BY_SUFFIX(32I) + SET_BY_SUFFIX(32UI) + +#undef SET_BY_SUFFIX + + ////// + + SET_COPY_DECAY( RGB565, R8, RG8, RGB565, MAX, Luminance8, MAX, MAX) + SET_COPY_DECAY( RGBA4, R8, RG8, RGB565, RGBA4, Luminance8, Alpha8, Luminance8Alpha8) + SET_COPY_DECAY( RGB5_A1, R8, RG8, RGB565, RGB5_A1, Luminance8, Alpha8, Luminance8Alpha8) + SET_COPY_DECAY( RGB10_A2, R8, RG8, RGB8, RGB10_A2, Luminance8, Alpha8, MAX) + + SET_COPY_DECAY(RGB10_A2UI, R8UI, RG8UI, RGB8UI, RGB10_A2UI, MAX, MAX, MAX) + + SET_COPY_DECAY(SRGB8_ALPHA8, MAX, MAX, MAX, SRGB8_ALPHA8, MAX, Alpha8, MAX) + + SET_COPY_DECAY(R11F_G11F_B10F, R16F, RG16F, R11F_G11F_B10F, MAX, Luminance16F, MAX, MAX) + +#undef SET_COPY_DECAY +} + +////////////////////////////////////////////////////////////////////////////////////////// + +bool gAreFormatTablesInitialized = false; + +static void +EnsureInitFormatTables(const StaticMutexAutoLock&) // Prove that you locked it! +{ + if (MOZ_LIKELY(gAreFormatTablesInitialized)) + return; + + gAreFormatTablesInitialized = true; + + InitCompressedFormatInfo(); + InitFormatInfo(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// Public funcs + +StaticMutex gFormatMapMutex; + +const FormatInfo* +GetFormat(EffectiveFormat format) +{ + StaticMutexAutoLock lock(gFormatMapMutex); + EnsureInitFormatTables(lock); + + return GetFormatInfo_NoLock(format); +} + +////////////////////////////////////////////////////////////////////////////////////////// + +const FormatInfo* +FormatInfo::GetCopyDecayFormat(UnsizedFormat uf) const +{ + return FindOrNull(this->copyDecayFormats, uf); +} + +bool +GetBytesPerPixel(const PackingInfo& packing, uint8_t* const out_bytes) +{ + uint8_t bytesPerChannel; + + switch (packing.type) { + case LOCAL_GL_UNSIGNED_SHORT_4_4_4_4: + case LOCAL_GL_UNSIGNED_SHORT_5_5_5_1: + case LOCAL_GL_UNSIGNED_SHORT_5_6_5: + *out_bytes = 2; + return true; + + case LOCAL_GL_UNSIGNED_INT_10F_11F_11F_REV: + case LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV: + case LOCAL_GL_UNSIGNED_INT_24_8: + case LOCAL_GL_UNSIGNED_INT_5_9_9_9_REV: + *out_bytes = 4; + return true; + + case LOCAL_GL_FLOAT_32_UNSIGNED_INT_24_8_REV: + *out_bytes = 8; + return true; + + // Alright, that's all the fixed-size unpackTypes. + + case LOCAL_GL_BYTE: + case LOCAL_GL_UNSIGNED_BYTE: + bytesPerChannel = 1; + break; + + case LOCAL_GL_SHORT: + case LOCAL_GL_UNSIGNED_SHORT: + case LOCAL_GL_HALF_FLOAT: + case LOCAL_GL_HALF_FLOAT_OES: + bytesPerChannel = 2; + break; + + case LOCAL_GL_INT: + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_FLOAT: + bytesPerChannel = 4; + break; + + default: + return false; + } + + uint8_t channels; + + switch (packing.format) { + case LOCAL_GL_RED: + case LOCAL_GL_RED_INTEGER: + case LOCAL_GL_LUMINANCE: + case LOCAL_GL_ALPHA: + case LOCAL_GL_DEPTH_COMPONENT: + channels = 1; + break; + + case LOCAL_GL_RG: + case LOCAL_GL_RG_INTEGER: + case LOCAL_GL_LUMINANCE_ALPHA: + channels = 2; + break; + + case LOCAL_GL_RGB: + case LOCAL_GL_RGB_INTEGER: + case LOCAL_GL_SRGB: + channels = 3; + break; + + case LOCAL_GL_BGRA: + case LOCAL_GL_RGBA: + case LOCAL_GL_RGBA_INTEGER: + case LOCAL_GL_SRGB_ALPHA: + channels = 4; + break; + + default: + return false; + } + + *out_bytes = bytesPerChannel * channels; + return true; +} + +uint8_t +BytesPerPixel(const PackingInfo& packing) +{ + uint8_t ret; + if (MOZ_LIKELY(GetBytesPerPixel(packing, &ret))) + return ret; + + gfxCriticalError() << "Bad `packing`: " << gfx::hexa(packing.format) << ", " + << gfx::hexa(packing.type); + MOZ_CRASH("Bad `packing`."); +} + +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +// FormatUsageAuthority + +bool +FormatUsageInfo::IsUnpackValid(const PackingInfo& key, + const DriverUnpackInfo** const out_value) const +{ + auto itr = validUnpacks.find(key); + if (itr == validUnpacks.end()) + return false; + + *out_value = &(itr->second); + return true; +} + +void +FormatUsageInfo::ResolveMaxSamples(gl::GLContext* gl) +{ + MOZ_ASSERT(!this->maxSamplesKnown); + MOZ_ASSERT(this->maxSamples == 0); + MOZ_ASSERT(gl->IsCurrent()); + + this->maxSamplesKnown = true; + + const GLenum internalFormat = this->format->sizedFormat; + if (!internalFormat) + return; + + if (!gl->IsSupported(gl::GLFeature::internalformat_query)) + return; // Leave it at 0. + + GLint maxSamplesGL = 0; + gl->fGetInternalformativ(LOCAL_GL_RENDERBUFFER, internalFormat, LOCAL_GL_SAMPLES, 1, + &maxSamplesGL); + + this->maxSamples = maxSamplesGL; +} + +//////////////////////////////////////// + +static void +AddSimpleUnsized(FormatUsageAuthority* fua, GLenum unpackFormat, GLenum unpackType, + EffectiveFormat effFormat) +{ + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + + const PackingInfo pi = {unpackFormat, unpackType}; + const DriverUnpackInfo dui = {unpackFormat, unpackFormat, unpackType}; + fua->AddTexUnpack(usage, pi, dui); + + fua->AllowUnsizedTexFormat(pi, usage); +}; + + +/*static*/ const GLint FormatUsageInfo::kLuminanceSwizzleRGBA[4] = { LOCAL_GL_RED, + LOCAL_GL_RED, + LOCAL_GL_RED, + LOCAL_GL_ONE }; +/*static*/ const GLint FormatUsageInfo::kAlphaSwizzleRGBA[4] = { LOCAL_GL_ZERO, + LOCAL_GL_ZERO, + LOCAL_GL_ZERO, + LOCAL_GL_RED }; +/*static*/ const GLint FormatUsageInfo::kLumAlphaSwizzleRGBA[4] = { LOCAL_GL_RED, + LOCAL_GL_RED, + LOCAL_GL_RED, + LOCAL_GL_GREEN }; + +static bool +AddLegacyFormats_LA8(FormatUsageAuthority* fua, gl::GLContext* gl) +{ + if (gl->IsCoreProfile()) { + if (!gl->IsSupported(gl::GLFeature::texture_swizzle)) + return false; + + PackingInfo pi; + DriverUnpackInfo dui; + + const auto fnAdd = [fua, &pi, &dui](EffectiveFormat effFormat, + const GLint* swizzle) + { + auto usage = fua->EditUsage(effFormat); + usage->isFilterable = true; + usage->textureSwizzleRGBA = swizzle; + + fua->AddTexUnpack(usage, pi, dui); + + fua->AllowUnsizedTexFormat(pi, usage); + }; + + pi = {LOCAL_GL_LUMINANCE, LOCAL_GL_UNSIGNED_BYTE}; + dui = {LOCAL_GL_R8, LOCAL_GL_RED, LOCAL_GL_UNSIGNED_BYTE}; + fnAdd(EffectiveFormat::Luminance8, FormatUsageInfo::kLuminanceSwizzleRGBA); + + pi = {LOCAL_GL_ALPHA, LOCAL_GL_UNSIGNED_BYTE}; + dui = {LOCAL_GL_R8, LOCAL_GL_RED, LOCAL_GL_UNSIGNED_BYTE}; + fnAdd(EffectiveFormat::Alpha8, FormatUsageInfo::kAlphaSwizzleRGBA); + + pi = {LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_UNSIGNED_BYTE}; + dui = {LOCAL_GL_RG8, LOCAL_GL_RG, LOCAL_GL_UNSIGNED_BYTE}; + fnAdd(EffectiveFormat::Luminance8Alpha8, FormatUsageInfo::kLumAlphaSwizzleRGBA); + } else { + AddSimpleUnsized(fua, LOCAL_GL_LUMINANCE , LOCAL_GL_UNSIGNED_BYTE, EffectiveFormat::Luminance8 ); + AddSimpleUnsized(fua, LOCAL_GL_ALPHA , LOCAL_GL_UNSIGNED_BYTE, EffectiveFormat::Alpha8 ); + AddSimpleUnsized(fua, LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_UNSIGNED_BYTE, EffectiveFormat::Luminance8Alpha8); + } + + return true; +} + +static bool +AddUnsizedFormats(FormatUsageAuthority* fua, gl::GLContext* gl) +{ + // GLES 2.0.25, p63, Table 3.4 + AddSimpleUnsized(fua, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE , EffectiveFormat::RGBA8 ); + AddSimpleUnsized(fua, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_SHORT_4_4_4_4, EffectiveFormat::RGBA4 ); + AddSimpleUnsized(fua, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_SHORT_5_5_5_1, EffectiveFormat::RGB5_A1); + AddSimpleUnsized(fua, LOCAL_GL_RGB , LOCAL_GL_UNSIGNED_BYTE , EffectiveFormat::RGB8 ); + AddSimpleUnsized(fua, LOCAL_GL_RGB , LOCAL_GL_UNSIGNED_SHORT_5_6_5 , EffectiveFormat::RGB565 ); + + // L, A, LA + return AddLegacyFormats_LA8(fua, gl); +} + +void +FormatUsageInfo::SetRenderable() +{ + this->isRenderable = true; + +#ifdef DEBUG + const auto format = this->format; + if (format->IsColorFormat()) { + const auto& map = format->copyDecayFormats; + const auto itr = map.find(format->unsizedFormat); + MOZ_ASSERT(itr != map.end(), "Renderable formats must be in copyDecayFormats."); + MOZ_ASSERT(itr->second == format); + } +#endif +} + +UniquePtr +FormatUsageAuthority::CreateForWebGL1(gl::GLContext* gl) +{ + UniquePtr ret(new FormatUsageAuthority); + const auto ptr = ret.get(); + + //////////////////////////////////////////////////////////////////////////// + // Usages + + const auto fnSet = [ptr](EffectiveFormat effFormat, bool isRenderable, + bool isFilterable) + { + MOZ_ASSERT(!ptr->GetUsage(effFormat)); + + auto usage = ptr->EditUsage(effFormat); + usage->isFilterable = isFilterable; + + if (isRenderable) { + usage->SetRenderable(); + } + }; + + // GLES 2.0.25, p117, Table 4.5 + // RGBA8 is made renderable in WebGL 1.0, "Framebuffer Object Attachments" + // render filter + // able able + fnSet(EffectiveFormat::RGBA8 , true, true); + fnSet(EffectiveFormat::RGBA4 , true, true); + fnSet(EffectiveFormat::RGB5_A1, true, true); + fnSet(EffectiveFormat::RGB565 , true, true); + + // RGB8 is not guaranteed to be renderable, but we should allow it for web-compat. + // Min-capability mode should mark this as non-renderable. + fnSet(EffectiveFormat::RGB8, true, true); + + fnSet(EffectiveFormat::Luminance8Alpha8, false, true); + fnSet(EffectiveFormat::Luminance8 , false, true); + fnSet(EffectiveFormat::Alpha8 , false, true); + + fnSet(EffectiveFormat::DEPTH_COMPONENT16, true, false); + fnSet(EffectiveFormat::STENCIL_INDEX8 , true, false); + + // Added in WebGL 1.0 spec: + fnSet(EffectiveFormat::DEPTH24_STENCIL8, true, false); + + //////////////////////////////////// + // RB formats + +#define FOO(x) ptr->AllowRBFormat(LOCAL_GL_ ## x, ptr->GetUsage(EffectiveFormat::x)) + + FOO(RGBA4 ); + FOO(RGB5_A1 ); + FOO(RGB565 ); + FOO(DEPTH_COMPONENT16); + FOO(STENCIL_INDEX8 ); + //FOO(DEPTH24_STENCIL8 ); // WebGL 1 uses DEPTH_STENCIL instead of DEPTH24_STENCIL8. + +#undef FOO + + ptr->AllowRBFormat(LOCAL_GL_DEPTH_STENCIL, + ptr->GetUsage(EffectiveFormat::DEPTH24_STENCIL8)); + + //////////////////////////////////////////////////////////////////////////// + + if (!AddUnsizedFormats(ptr, gl)) + return nullptr; + + return Move(ret); +} + +UniquePtr +FormatUsageAuthority::CreateForWebGL2(gl::GLContext* gl) +{ + UniquePtr ret(new FormatUsageAuthority); + const auto ptr = ret.get(); + + //////////////////////////////////////////////////////////////////////////// + // GLES 3.0.4 p111-113 + + const auto fnAddSizedUnpack = [ptr](EffectiveFormat effFormat, GLenum internalFormat, + GLenum unpackFormat, GLenum unpackType) + { + auto usage = ptr->EditUsage(effFormat); + + const PackingInfo pi = {unpackFormat, unpackType}; + const DriverUnpackInfo dui = {internalFormat, unpackFormat, unpackType}; + ptr->AddTexUnpack(usage, pi, dui); + }; + +#define FOO(x) EffectiveFormat::x, LOCAL_GL_ ## x + + // RGBA + fnAddSizedUnpack(FOO(RGBA8 ), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGBA4 ), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_SHORT_4_4_4_4 ); + fnAddSizedUnpack(FOO(RGBA4 ), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGB5_A1 ), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_SHORT_5_5_5_1 ); + fnAddSizedUnpack(FOO(RGB5_A1 ), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGB5_A1 ), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV); + fnAddSizedUnpack(FOO(SRGB8_ALPHA8), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGBA8_SNORM ), LOCAL_GL_RGBA, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(RGB10_A2 ), LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV); + fnAddSizedUnpack(FOO(RGBA16F ), LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT ); + fnAddSizedUnpack(FOO(RGBA16F ), LOCAL_GL_RGBA, LOCAL_GL_FLOAT ); + fnAddSizedUnpack(FOO(RGBA32F ), LOCAL_GL_RGBA, LOCAL_GL_FLOAT ); + + // RGBA_INTEGER + fnAddSizedUnpack(FOO(RGBA8UI ), LOCAL_GL_RGBA_INTEGER, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGBA8I ), LOCAL_GL_RGBA_INTEGER, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(RGBA16UI ), LOCAL_GL_RGBA_INTEGER, LOCAL_GL_UNSIGNED_SHORT ); + fnAddSizedUnpack(FOO(RGBA16I ), LOCAL_GL_RGBA_INTEGER, LOCAL_GL_SHORT ); + fnAddSizedUnpack(FOO(RGBA32UI ), LOCAL_GL_RGBA_INTEGER, LOCAL_GL_UNSIGNED_INT ); + fnAddSizedUnpack(FOO(RGBA32I ), LOCAL_GL_RGBA_INTEGER, LOCAL_GL_INT ); + fnAddSizedUnpack(FOO(RGB10_A2UI), LOCAL_GL_RGBA_INTEGER, LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV); + + // RGB + fnAddSizedUnpack(FOO(RGB8 ), LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(SRGB8 ), LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGB565 ), LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_SHORT_5_6_5 ); + fnAddSizedUnpack(FOO(RGB565 ), LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGB8_SNORM ), LOCAL_GL_RGB, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(R11F_G11F_B10F), LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_INT_10F_11F_11F_REV); + fnAddSizedUnpack(FOO(R11F_G11F_B10F), LOCAL_GL_RGB, LOCAL_GL_HALF_FLOAT ); + fnAddSizedUnpack(FOO(R11F_G11F_B10F), LOCAL_GL_RGB, LOCAL_GL_FLOAT ); + fnAddSizedUnpack(FOO(RGB16F ), LOCAL_GL_RGB, LOCAL_GL_HALF_FLOAT ); + fnAddSizedUnpack(FOO(RGB16F ), LOCAL_GL_RGB, LOCAL_GL_FLOAT ); + fnAddSizedUnpack(FOO(RGB9_E5 ), LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_INT_5_9_9_9_REV ); + fnAddSizedUnpack(FOO(RGB9_E5 ), LOCAL_GL_RGB, LOCAL_GL_HALF_FLOAT ); + fnAddSizedUnpack(FOO(RGB9_E5 ), LOCAL_GL_RGB, LOCAL_GL_FLOAT ); + fnAddSizedUnpack(FOO(RGB32F ), LOCAL_GL_RGB, LOCAL_GL_FLOAT ); + + // RGB_INTEGER + fnAddSizedUnpack(FOO(RGB8UI ), LOCAL_GL_RGB_INTEGER, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RGB8I ), LOCAL_GL_RGB_INTEGER, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(RGB16UI), LOCAL_GL_RGB_INTEGER, LOCAL_GL_UNSIGNED_SHORT); + fnAddSizedUnpack(FOO(RGB16I ), LOCAL_GL_RGB_INTEGER, LOCAL_GL_SHORT ); + fnAddSizedUnpack(FOO(RGB32UI), LOCAL_GL_RGB_INTEGER, LOCAL_GL_UNSIGNED_INT ); + fnAddSizedUnpack(FOO(RGB32I ), LOCAL_GL_RGB_INTEGER, LOCAL_GL_INT ); + + // RG + fnAddSizedUnpack(FOO(RG8 ), LOCAL_GL_RG, LOCAL_GL_UNSIGNED_BYTE); + fnAddSizedUnpack(FOO(RG8_SNORM), LOCAL_GL_RG, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(RG16F ), LOCAL_GL_RG, LOCAL_GL_HALF_FLOAT ); + fnAddSizedUnpack(FOO(RG16F ), LOCAL_GL_RG, LOCAL_GL_FLOAT ); + fnAddSizedUnpack(FOO(RG32F ), LOCAL_GL_RG, LOCAL_GL_FLOAT ); + + // RG_INTEGER + fnAddSizedUnpack(FOO(RG8UI ), LOCAL_GL_RG_INTEGER, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(RG8I ), LOCAL_GL_RG_INTEGER, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(RG16UI), LOCAL_GL_RG_INTEGER, LOCAL_GL_UNSIGNED_SHORT); + fnAddSizedUnpack(FOO(RG16I ), LOCAL_GL_RG_INTEGER, LOCAL_GL_SHORT ); + fnAddSizedUnpack(FOO(RG32UI), LOCAL_GL_RG_INTEGER, LOCAL_GL_UNSIGNED_INT ); + fnAddSizedUnpack(FOO(RG32I ), LOCAL_GL_RG_INTEGER, LOCAL_GL_INT ); + + // RED + fnAddSizedUnpack(FOO(R8 ), LOCAL_GL_RED, LOCAL_GL_UNSIGNED_BYTE); + fnAddSizedUnpack(FOO(R8_SNORM), LOCAL_GL_RED, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(R16F ), LOCAL_GL_RED, LOCAL_GL_HALF_FLOAT ); + fnAddSizedUnpack(FOO(R16F ), LOCAL_GL_RED, LOCAL_GL_FLOAT ); + fnAddSizedUnpack(FOO(R32F ), LOCAL_GL_RED, LOCAL_GL_FLOAT ); + + // RED_INTEGER + fnAddSizedUnpack(FOO(R8UI ), LOCAL_GL_RED_INTEGER, LOCAL_GL_UNSIGNED_BYTE ); + fnAddSizedUnpack(FOO(R8I ), LOCAL_GL_RED_INTEGER, LOCAL_GL_BYTE ); + fnAddSizedUnpack(FOO(R16UI), LOCAL_GL_RED_INTEGER, LOCAL_GL_UNSIGNED_SHORT); + fnAddSizedUnpack(FOO(R16I ), LOCAL_GL_RED_INTEGER, LOCAL_GL_SHORT ); + fnAddSizedUnpack(FOO(R32UI), LOCAL_GL_RED_INTEGER, LOCAL_GL_UNSIGNED_INT ); + fnAddSizedUnpack(FOO(R32I ), LOCAL_GL_RED_INTEGER, LOCAL_GL_INT ); + + // DEPTH_COMPONENT + fnAddSizedUnpack(FOO(DEPTH_COMPONENT16 ), LOCAL_GL_DEPTH_COMPONENT, LOCAL_GL_UNSIGNED_SHORT); + fnAddSizedUnpack(FOO(DEPTH_COMPONENT16 ), LOCAL_GL_DEPTH_COMPONENT, LOCAL_GL_UNSIGNED_INT ); + fnAddSizedUnpack(FOO(DEPTH_COMPONENT24 ), LOCAL_GL_DEPTH_COMPONENT, LOCAL_GL_UNSIGNED_INT ); + fnAddSizedUnpack(FOO(DEPTH_COMPONENT32F), LOCAL_GL_DEPTH_COMPONENT, LOCAL_GL_FLOAT ); + + // DEPTH_STENCIL + fnAddSizedUnpack(FOO(DEPTH24_STENCIL8 ), LOCAL_GL_DEPTH_STENCIL, LOCAL_GL_UNSIGNED_INT_24_8 ); + fnAddSizedUnpack(FOO(DEPTH32F_STENCIL8), LOCAL_GL_DEPTH_STENCIL, LOCAL_GL_FLOAT_32_UNSIGNED_INT_24_8_REV); + +#undef FOO + + //////////////////////////////////////////////////////////////////////////// + + // For renderable, see GLES 3.0.4, p212 "Framebuffer Completeness" + // For filterable, see GLES 3.0.4, p161 "...a texture is complete unless..." + + const auto fnAllowES3TexFormat = [ptr](GLenum sizedFormat, EffectiveFormat effFormat, + bool isRenderable, bool isFilterable) + { + auto usage = ptr->EditUsage(effFormat); + usage->isFilterable = isFilterable; + + if (isRenderable) { + usage->SetRenderable(); + } + + ptr->AllowSizedTexFormat(sizedFormat, usage); + + if (isRenderable) { + ptr->AllowRBFormat(sizedFormat, usage); + } + }; + +#define FOO(x) LOCAL_GL_ ## x, EffectiveFormat::x + + // GLES 3.0.4, p128-129 "Required Texture Formats" + // GLES 3.0.4, p130-132, table 3.13 + // render filter + // able able + fnAllowES3TexFormat(FOO(R8 ), true , true ); + fnAllowES3TexFormat(FOO(R8_SNORM ), false, true ); + fnAllowES3TexFormat(FOO(RG8 ), true , true ); + fnAllowES3TexFormat(FOO(RG8_SNORM ), false, true ); + fnAllowES3TexFormat(FOO(RGB8 ), true , true ); + fnAllowES3TexFormat(FOO(RGB8_SNORM ), false, true ); + fnAllowES3TexFormat(FOO(RGB565 ), true , true ); + fnAllowES3TexFormat(FOO(RGBA4 ), true , true ); + fnAllowES3TexFormat(FOO(RGB5_A1 ), true , true ); + fnAllowES3TexFormat(FOO(RGBA8 ), true , true ); + fnAllowES3TexFormat(FOO(RGBA8_SNORM), false, true ); + fnAllowES3TexFormat(FOO(RGB10_A2 ), true , true ); + fnAllowES3TexFormat(FOO(RGB10_A2UI ), true , false); + + fnAllowES3TexFormat(FOO(SRGB8 ), false, true); + fnAllowES3TexFormat(FOO(SRGB8_ALPHA8), true , true); + + fnAllowES3TexFormat(FOO(R16F ), false, true); + fnAllowES3TexFormat(FOO(RG16F ), false, true); + fnAllowES3TexFormat(FOO(RGB16F ), false, true); + fnAllowES3TexFormat(FOO(RGBA16F), false, true); + + fnAllowES3TexFormat(FOO(R32F ), false, false); + fnAllowES3TexFormat(FOO(RG32F ), false, false); + fnAllowES3TexFormat(FOO(RGB32F ), false, false); + fnAllowES3TexFormat(FOO(RGBA32F), false, false); + + fnAllowES3TexFormat(FOO(R11F_G11F_B10F), false, true); + fnAllowES3TexFormat(FOO(RGB9_E5 ), false, true); + + fnAllowES3TexFormat(FOO(R8I ), true, false); + fnAllowES3TexFormat(FOO(R8UI ), true, false); + fnAllowES3TexFormat(FOO(R16I ), true, false); + fnAllowES3TexFormat(FOO(R16UI), true, false); + fnAllowES3TexFormat(FOO(R32I ), true, false); + fnAllowES3TexFormat(FOO(R32UI), true, false); + + fnAllowES3TexFormat(FOO(RG8I ), true, false); + fnAllowES3TexFormat(FOO(RG8UI ), true, false); + fnAllowES3TexFormat(FOO(RG16I ), true, false); + fnAllowES3TexFormat(FOO(RG16UI), true, false); + fnAllowES3TexFormat(FOO(RG32I ), true, false); + fnAllowES3TexFormat(FOO(RG32UI), true, false); + + fnAllowES3TexFormat(FOO(RGB8I ), false, false); + fnAllowES3TexFormat(FOO(RGB8UI ), false, false); + fnAllowES3TexFormat(FOO(RGB16I ), false, false); + fnAllowES3TexFormat(FOO(RGB16UI), false, false); + fnAllowES3TexFormat(FOO(RGB32I ), false, false); + fnAllowES3TexFormat(FOO(RGB32UI), false, false); + + fnAllowES3TexFormat(FOO(RGBA8I ), true, false); + fnAllowES3TexFormat(FOO(RGBA8UI ), true, false); + fnAllowES3TexFormat(FOO(RGBA16I ), true, false); + fnAllowES3TexFormat(FOO(RGBA16UI), true, false); + fnAllowES3TexFormat(FOO(RGBA32I ), true, false); + fnAllowES3TexFormat(FOO(RGBA32UI), true, false); + + // GLES 3.0.4, p133, table 3.14 + fnAllowES3TexFormat(FOO(DEPTH_COMPONENT16 ), true, false); + fnAllowES3TexFormat(FOO(DEPTH_COMPONENT24 ), true, false); + fnAllowES3TexFormat(FOO(DEPTH_COMPONENT32F), true, false); + fnAllowES3TexFormat(FOO(DEPTH24_STENCIL8 ), true, false); + fnAllowES3TexFormat(FOO(DEPTH32F_STENCIL8 ), true, false); + +#undef FOO + + // GLES 3.0.4, p206, "Required Renderbuffer Formats": + // "Implementations are also required to support STENCIL_INDEX8. Requesting this + // internal format for a renderbuffer will allocate at least 8 stencil bit planes." + + auto usage = ptr->EditUsage(EffectiveFormat::STENCIL_INDEX8); + usage->SetRenderable(); + ptr->AllowRBFormat(LOCAL_GL_STENCIL_INDEX8, usage); + + //////////////// + // Legacy formats + + if (!AddUnsizedFormats(ptr, gl)) + return nullptr; + + ptr->AllowRBFormat(LOCAL_GL_DEPTH_STENCIL, + ptr->GetUsage(EffectiveFormat::DEPTH24_STENCIL8)); + + if (gfxPrefs::WebGL2CompatMode()) { + AddSimpleUnsized(ptr, LOCAL_GL_RGBA, LOCAL_GL_FLOAT, EffectiveFormat::RGBA32F); + AddSimpleUnsized(ptr, LOCAL_GL_RGB , LOCAL_GL_FLOAT, EffectiveFormat::RGB32F ); + + AddSimpleUnsized(ptr, LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT_OES, EffectiveFormat::RGBA16F); + AddSimpleUnsized(ptr, LOCAL_GL_RGB , LOCAL_GL_HALF_FLOAT_OES, EffectiveFormat::RGB16F ); + } + + //////////////////////////////////// + + return Move(ret); +} + +////////////////////////////////////////////////////////////////////////////////////////// + +void +FormatUsageAuthority::AddTexUnpack(FormatUsageInfo* usage, const PackingInfo& pi, + const DriverUnpackInfo& dui) +{ + // Don't AlwaysInsert here, since we'll see duplicates from sized and unsized formats. + auto res = usage->validUnpacks.insert({ pi, dui }); + auto itr = res.first; + + if (!usage->idealUnpack) { + // First one! + usage->idealUnpack = &(itr->second); + } + + mValidTexUnpackFormats.insert(pi.format); + mValidTexUnpackTypes.insert(pi.type); +} + +static bool +Contains(const std::set& set, GLenum key) +{ + return set.find(key) != set.end(); +} + +bool +FormatUsageAuthority::IsInternalFormatEnumValid(GLenum internalFormat) const +{ + return Contains(mValidTexInternalFormats, internalFormat); +} + +bool +FormatUsageAuthority::AreUnpackEnumsValid(GLenum unpackFormat, GLenum unpackType) const +{ + return (Contains(mValidTexUnpackFormats, unpackFormat) && + Contains(mValidTexUnpackTypes, unpackType)); +} + +//////////////////// + +void +FormatUsageAuthority::AllowRBFormat(GLenum sizedFormat, const FormatUsageInfo* usage) +{ + MOZ_ASSERT(!usage->format->compression); + MOZ_ASSERT(usage->format->sizedFormat); + MOZ_ASSERT(usage->IsRenderable()); + + AlwaysInsert(mRBFormatMap, sizedFormat, usage); +} + +void +FormatUsageAuthority::AllowSizedTexFormat(GLenum sizedFormat, + const FormatUsageInfo* usage) +{ + if (usage->format->compression) { + MOZ_ASSERT(usage->isFilterable, "Compressed formats should be filterable."); + } else { + MOZ_ASSERT(usage->validUnpacks.size() && usage->idealUnpack, + "AddTexUnpack() first."); + } + + AlwaysInsert(mSizedTexFormatMap, sizedFormat, usage); + + mValidTexInternalFormats.insert(sizedFormat); +} + +void +FormatUsageAuthority::AllowUnsizedTexFormat(const PackingInfo& pi, + const FormatUsageInfo* usage) +{ + MOZ_ASSERT(!usage->format->compression); + MOZ_ASSERT(usage->validUnpacks.size() && usage->idealUnpack, "AddTexUnpack() first."); + + AlwaysInsert(mUnsizedTexFormatMap, pi, usage); + + mValidTexInternalFormats.insert(pi.format); + mValidTexUnpackFormats.insert(pi.format); + mValidTexUnpackTypes.insert(pi.type); +} + +const FormatUsageInfo* +FormatUsageAuthority::GetRBUsage(GLenum sizedFormat) const +{ + return FindOrNull(mRBFormatMap, sizedFormat); +} + +const FormatUsageInfo* +FormatUsageAuthority::GetSizedTexUsage(GLenum sizedFormat) const +{ + return FindOrNull(mSizedTexFormatMap, sizedFormat); +} + +const FormatUsageInfo* +FormatUsageAuthority::GetUnsizedTexUsage(const PackingInfo& pi) const +{ + return FindOrNull(mUnsizedTexFormatMap, pi); +} + +FormatUsageInfo* +FormatUsageAuthority::EditUsage(EffectiveFormat format) +{ + auto itr = mUsageMap.find(format); + + if (itr == mUsageMap.end()) { + const FormatInfo* formatInfo = GetFormat(format); + MOZ_RELEASE_ASSERT(formatInfo, "GFX: no format info set."); + + FormatUsageInfo usage(formatInfo); + + auto res = mUsageMap.insert({ format, usage }); + DebugOnly didInsert = res.second; + MOZ_ASSERT(didInsert); + + itr = res.first; + } + + return &(itr->second); +} + +const FormatUsageInfo* +FormatUsageAuthority::GetUsage(EffectiveFormat format) const +{ + auto itr = mUsageMap.find(format); + if (itr == mUsageMap.end()) + return nullptr; + + return &(itr->second); +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace webgl +} // namespace mozilla diff --git a/dom/canvas/WebGLFormats.h b/dom/canvas/WebGLFormats.h new file mode 100644 index 000000000..41d89e063 --- /dev/null +++ b/dom/canvas/WebGLFormats.h @@ -0,0 +1,349 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_FORMATS_H_ +#define WEBGL_FORMATS_H_ + +#include +#include + +#include "mozilla/UniquePtr.h" +#include "WebGLTypes.h" + +namespace mozilla { +namespace webgl { + +typedef uint8_t EffectiveFormatValueT; + +enum class EffectiveFormat : EffectiveFormatValueT { + // GLES 3.0.4, p128-129, "Required Texture Formats" + // "Texture and renderbuffer color formats" + RGBA32I, + RGBA32UI, + RGBA16I, + RGBA16UI, + RGBA8, + RGBA8I, + RGBA8UI, + SRGB8_ALPHA8, + RGB10_A2, + RGB10_A2UI, + RGBA4, + RGB5_A1, + + RGB8, + RGB565, + + RG32I, + RG32UI, + RG16I, + RG16UI, + RG8, + RG8I, + RG8UI, + + R32I, + R32UI, + R16I, + R16UI, + R8, + R8I, + R8UI, + + // "Texture-only color formats" + RGBA32F, + RGBA16F, + RGBA8_SNORM, + + RGB32F, + RGB32I, + RGB32UI, + + RGB16F, + RGB16I, + RGB16UI, + + RGB8_SNORM, + RGB8I, + RGB8UI, + SRGB8, + + R11F_G11F_B10F, + RGB9_E5, + + RG32F, + RG16F, + RG8_SNORM, + + R32F, + R16F, + R8_SNORM, + + // "Depth formats" + DEPTH_COMPONENT32F, + DEPTH_COMPONENT24, + DEPTH_COMPONENT16, + + // "Combined depth+stencil formats" + DEPTH32F_STENCIL8, + DEPTH24_STENCIL8, + + // GLES 3.0.4, p205-206, "Required Renderbuffer Formats" + STENCIL_INDEX8, + + //////////////////////////////////// + + // GLES 3.0.4, p147, table 3.19 + // GLES 3.0.4, p286+, $C.1 "ETC Compressed Texture Image Formats" + COMPRESSED_R11_EAC, + COMPRESSED_SIGNED_R11_EAC, + COMPRESSED_RG11_EAC, + COMPRESSED_SIGNED_RG11_EAC, + COMPRESSED_RGB8_ETC2, + COMPRESSED_SRGB8_ETC2, + COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, + COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, + COMPRESSED_RGBA8_ETC2_EAC, + COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, + + // AMD_compressed_ATC_texture + ATC_RGB_AMD, + ATC_RGBA_EXPLICIT_ALPHA_AMD, + ATC_RGBA_INTERPOLATED_ALPHA_AMD, + + // EXT_texture_compression_s3tc + COMPRESSED_RGB_S3TC_DXT1_EXT, + COMPRESSED_RGBA_S3TC_DXT1_EXT, + COMPRESSED_RGBA_S3TC_DXT3_EXT, + COMPRESSED_RGBA_S3TC_DXT5_EXT, + + // IMG_texture_compression_pvrtc + COMPRESSED_RGB_PVRTC_4BPPV1, + COMPRESSED_RGBA_PVRTC_4BPPV1, + COMPRESSED_RGB_PVRTC_2BPPV1, + COMPRESSED_RGBA_PVRTC_2BPPV1, + + // OES_compressed_ETC1_RGB8_texture + ETC1_RGB8_OES, + + //////////////////////////////////// + + // GLES 3.0.4, p128, table 3.12. + Luminance8Alpha8, + Luminance8, + Alpha8, + + // OES_texture_float + Luminance32FAlpha32F, + Luminance32F, + Alpha32F, + + // OES_texture_half_float + Luminance16FAlpha16F, + Luminance16F, + Alpha16F, + + MAX, +}; + +enum class UnsizedFormat : uint8_t { + R, + RG, + RGB, + RGBA, + LA, + L, + A, + D, + S, + DEPTH_STENCIL, // `DS` is a macro on Solaris. (regset.h) +}; + +// GLES 3.0.4 p114 Table 3.4, p240 +enum class ComponentType : uint8_t { + None, + Int, // RGBA32I + UInt, // RGBA32UI, STENCIL_INDEX8 + NormInt, // RGBA8_SNORM + NormUInt, // RGBA8, DEPTH_COMPONENT16 + Float, // RGBA32F + Special, // DEPTH24_STENCIL8 +}; + +enum class CompressionFamily : uint8_t { + ETC1, + ES3, // ETC2 or EAC + ATC, + S3TC, + PVRTC, +}; + +//////////////////////////////////////////////////////////////////////////////// + +struct CompressedFormatInfo +{ + const EffectiveFormat effectiveFormat; + const uint8_t bytesPerBlock; + const uint8_t blockWidth; + const uint8_t blockHeight; + const CompressionFamily family; +}; + +struct FormatInfo +{ + const EffectiveFormat effectiveFormat; + const char* const name; + const GLenum sizedFormat; + const UnsizedFormat unsizedFormat; + const ComponentType componentType; + const bool isSRGB; + + const CompressedFormatInfo* const compression; + + const uint8_t estimatedBytesPerPixel; // 0 iff bool(compression). + + // In bits. Iff bool(compression), active channels are 1. + const uint8_t r; + const uint8_t g; + const uint8_t b; + const uint8_t a; + const uint8_t d; + const uint8_t s; + + ////// + + std::map copyDecayFormats; + + const FormatInfo* GetCopyDecayFormat(UnsizedFormat) const; + + bool IsColorFormat() const { + // Alpha is a 'color format' since it's 'color-attachable'. + return bool(compression) || + bool(r | g | b | a); + } +}; + +struct PackingInfo +{ + GLenum format; + GLenum type; + + bool operator <(const PackingInfo& x) const + { + if (format != x.format) + return format < x.format; + + return type < x.type; + } + + bool operator ==(const PackingInfo& x) const { + return (format == x.format && + type == x.type); + } +}; + +struct DriverUnpackInfo +{ + GLenum internalFormat; + GLenum unpackFormat; + GLenum unpackType; + + PackingInfo ToPacking() const { + return {unpackFormat, unpackType}; + } +}; + +////////////////////////////////////////////////////////////////////////////////////////// + +const FormatInfo* GetFormat(EffectiveFormat format); +uint8_t BytesPerPixel(const PackingInfo& packing); +bool GetBytesPerPixel(const PackingInfo& packing, uint8_t* const out_bytes); +/* +GLint ComponentSize(const FormatInfo* format, GLenum component); +GLenum ComponentType(const FormatInfo* format); +*/ +//////////////////////////////////////// + +struct FormatUsageInfo +{ + const FormatInfo* const format; +private: + bool isRenderable; +public: + bool isFilterable; + + std::map validUnpacks; + const DriverUnpackInfo* idealUnpack; + + const GLint* textureSwizzleRGBA; + + bool maxSamplesKnown; + uint32_t maxSamples; + + static const GLint kLuminanceSwizzleRGBA[4]; + static const GLint kAlphaSwizzleRGBA[4]; + static const GLint kLumAlphaSwizzleRGBA[4]; + + explicit FormatUsageInfo(const FormatInfo* _format) + : format(_format) + , isRenderable(false) + , isFilterable(false) + , idealUnpack(nullptr) + , textureSwizzleRGBA(nullptr) + , maxSamplesKnown(false) + , maxSamples(0) + { } + + bool IsRenderable() const { return isRenderable; } + void SetRenderable(); + + bool IsUnpackValid(const PackingInfo& key, + const DriverUnpackInfo** const out_value) const; + + void ResolveMaxSamples(gl::GLContext* gl); +}; + +class FormatUsageAuthority +{ + std::map mUsageMap; + + std::map mRBFormatMap; + std::map mSizedTexFormatMap; + std::map mUnsizedTexFormatMap; + + std::set mValidTexInternalFormats; + std::set mValidTexUnpackFormats; + std::set mValidTexUnpackTypes; + +public: + static UniquePtr CreateForWebGL1(gl::GLContext* gl); + static UniquePtr CreateForWebGL2(gl::GLContext* gl); + +private: + FormatUsageAuthority() { } + +public: + FormatUsageInfo* EditUsage(EffectiveFormat format); + const FormatUsageInfo* GetUsage(EffectiveFormat format) const; + + void AddTexUnpack(FormatUsageInfo* usage, const PackingInfo& pi, + const DriverUnpackInfo& dui); + + bool IsInternalFormatEnumValid(GLenum internalFormat) const; + bool AreUnpackEnumsValid(GLenum unpackFormat, GLenum unpackType) const; + + void AllowRBFormat(GLenum sizedFormat, const FormatUsageInfo* usage); + void AllowSizedTexFormat(GLenum sizedFormat, const FormatUsageInfo* usage); + void AllowUnsizedTexFormat(const PackingInfo& pi, const FormatUsageInfo* usage); + + const FormatUsageInfo* GetRBUsage(GLenum sizedFormat) const; + const FormatUsageInfo* GetSizedTexUsage(GLenum sizedFormat) const; + const FormatUsageInfo* GetUnsizedTexUsage(const PackingInfo& pi) const; +}; + +} // namespace webgl +} // namespace mozilla + +#endif // WEBGL_FORMATS_H_ diff --git a/dom/canvas/WebGLFramebuffer.cpp b/dom/canvas/WebGLFramebuffer.cpp new file mode 100644 index 000000000..35efa4f16 --- /dev/null +++ b/dom/canvas/WebGLFramebuffer.cpp @@ -0,0 +1,1952 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLFramebuffer.h" + +// You know it's going to be fun when these two show up: +#include +#include + +#include "GLContext.h" +#include "GLScreenBuffer.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "nsPrintfCString.h" +#include "WebGLContext.h" +#include "WebGLContextUtils.h" +#include "WebGLExtensions.h" +#include "WebGLRenderbuffer.h" +#include "WebGLTexture.h" + +namespace mozilla { + +WebGLFBAttachPoint::WebGLFBAttachPoint() + : mFB(nullptr) + , mAttachmentPoint(0) + , mTexImageTarget(LOCAL_GL_NONE) + , mTexImageLayer(0) + , mTexImageLevel(0) +{ } + +WebGLFBAttachPoint::WebGLFBAttachPoint(WebGLFramebuffer* fb, GLenum attachmentPoint) + : mFB(fb) + , mAttachmentPoint(attachmentPoint) + , mTexImageTarget(LOCAL_GL_NONE) + , mTexImageLayer(0) + , mTexImageLevel(0) +{ } + +WebGLFBAttachPoint::~WebGLFBAttachPoint() +{ + MOZ_ASSERT(mFB, "Should have been Init'd."); + MOZ_ASSERT(!mRenderbufferPtr); + MOZ_ASSERT(!mTexturePtr); +} + +void +WebGLFBAttachPoint::Unlink() +{ + Clear(); +} + +bool +WebGLFBAttachPoint::IsDeleteRequested() const +{ + return Texture() ? Texture()->IsDeleteRequested() + : Renderbuffer() ? Renderbuffer()->IsDeleteRequested() + : false; +} + +bool +WebGLFBAttachPoint::IsDefined() const +{ + /* + return (Renderbuffer() && Renderbuffer()->IsDefined()) || + (Texture() && Texture()->ImageInfoAt(mTexImageTarget, + mTexImageLevel).IsDefined()); + */ + return (Renderbuffer() || Texture()); +} + +const webgl::FormatUsageInfo* +WebGLFBAttachPoint::Format() const +{ + MOZ_ASSERT(IsDefined()); + + if (Texture()) + return Texture()->ImageInfoAt(mTexImageTarget, mTexImageLevel).mFormat; + + if (Renderbuffer()) + return Renderbuffer()->Format(); + + return nullptr; +} + +uint32_t +WebGLFBAttachPoint::Samples() const +{ + MOZ_ASSERT(IsDefined()); + + if (mRenderbufferPtr) + return mRenderbufferPtr->Samples(); + + return 0; +} + +bool +WebGLFBAttachPoint::HasAlpha() const +{ + return Format()->format->a; +} + +bool +WebGLFBAttachPoint::IsReadableFloat() const +{ + auto formatUsage = Format(); + MOZ_ASSERT(formatUsage); + + auto format = formatUsage->format; + if (!format->IsColorFormat()) + return false; + + return format->componentType == webgl::ComponentType::Float; +} + +void +WebGLFBAttachPoint::Clear() +{ + if (mRenderbufferPtr) { + MOZ_ASSERT(!mTexturePtr); + mRenderbufferPtr->UnmarkAttachment(*this); + } else if (mTexturePtr) { + mTexturePtr->ImageInfoAt(mTexImageTarget, mTexImageLevel).RemoveAttachPoint(this); + } + + mTexturePtr = nullptr; + mRenderbufferPtr = nullptr; + + OnBackingStoreRespecified(); +} + +void +WebGLFBAttachPoint::SetTexImage(WebGLTexture* tex, TexImageTarget target, GLint level, + GLint layer) +{ + Clear(); + + mTexturePtr = tex; + mTexImageTarget = target; + mTexImageLevel = level; + mTexImageLayer = layer; + + if (mTexturePtr) { + mTexturePtr->ImageInfoAt(mTexImageTarget, mTexImageLevel).AddAttachPoint(this); + } +} + +void +WebGLFBAttachPoint::SetRenderbuffer(WebGLRenderbuffer* rb) +{ + Clear(); + + mRenderbufferPtr = rb; + + if (mRenderbufferPtr) { + mRenderbufferPtr->MarkAttachment(*this); + } +} + +bool +WebGLFBAttachPoint::HasUninitializedImageData() const +{ + if (!HasImage()) + return false; + + if (mRenderbufferPtr) + return mRenderbufferPtr->HasUninitializedImageData(); + + MOZ_ASSERT(mTexturePtr); + + auto& imageInfo = mTexturePtr->ImageInfoAt(mTexImageTarget, mTexImageLevel); + MOZ_ASSERT(imageInfo.IsDefined()); + + return !imageInfo.IsDataInitialized(); +} + +void +WebGLFBAttachPoint::SetImageDataStatus(WebGLImageDataStatus newStatus) const +{ + if (!HasImage()) + return; + + if (mRenderbufferPtr) { + mRenderbufferPtr->mImageDataStatus = newStatus; + return; + } + + MOZ_ASSERT(mTexturePtr); + + auto& imageInfo = mTexturePtr->ImageInfoAt(mTexImageTarget, mTexImageLevel); + MOZ_ASSERT(imageInfo.IsDefined()); + + const bool isDataInitialized = (newStatus == WebGLImageDataStatus::InitializedImageData); + imageInfo.SetIsDataInitialized(isDataInitialized, mTexturePtr); +} + +bool +WebGLFBAttachPoint::HasImage() const +{ + if (Texture() && Texture()->ImageInfoAt(mTexImageTarget, mTexImageLevel).IsDefined()) + return true; + + if (Renderbuffer() && Renderbuffer()->IsDefined()) + return true; + + return false; +} + +void +WebGLFBAttachPoint::Size(uint32_t* const out_width, uint32_t* const out_height) const +{ + MOZ_ASSERT(HasImage()); + + if (Renderbuffer()) { + *out_width = Renderbuffer()->Width(); + *out_height = Renderbuffer()->Height(); + return; + } + + MOZ_ASSERT(Texture()); + MOZ_ASSERT(Texture()->ImageInfoAt(mTexImageTarget, mTexImageLevel).IsDefined()); + const auto& imageInfo = Texture()->ImageInfoAt(mTexImageTarget, mTexImageLevel); + + *out_width = imageInfo.mWidth; + *out_height = imageInfo.mHeight; +} + +void +WebGLFBAttachPoint::OnBackingStoreRespecified() const +{ + mFB->InvalidateFramebufferStatus(); +} + +void +WebGLFBAttachPoint::AttachmentName(nsCString* out) const +{ + switch (mAttachmentPoint) { + case LOCAL_GL_DEPTH_ATTACHMENT: + out->AssignLiteral("DEPTH_ATTACHMENT"); + return; + + case LOCAL_GL_STENCIL_ATTACHMENT: + out->AssignLiteral("STENCIL_ATTACHMENT"); + return; + + case LOCAL_GL_DEPTH_STENCIL_ATTACHMENT: + out->AssignLiteral("DEPTH_STENCIL_ATTACHMENT"); + return; + + default: + MOZ_ASSERT(mAttachmentPoint >= LOCAL_GL_COLOR_ATTACHMENT0); + out->AssignLiteral("COLOR_ATTACHMENT"); + const uint32_t n = mAttachmentPoint - LOCAL_GL_COLOR_ATTACHMENT0; + out->AppendInt(n); + return; + } +} + +bool +WebGLFBAttachPoint::IsComplete(WebGLContext* webgl, nsCString* const out_info) const +{ + MOZ_ASSERT(IsDefined()); + + if (!HasImage()) { + AttachmentName(out_info); + out_info->AppendLiteral("'s image is not defined"); + return false; + } + + uint32_t width; + uint32_t height; + Size(&width, &height); + if (!width || !height) { + AttachmentName(out_info); + out_info->AppendLiteral(" has no width or height"); + return false; + } + + const auto formatUsage = Format(); + if (!formatUsage->IsRenderable()) { + nsAutoCString attachName; + AttachmentName(&attachName); + + *out_info = nsPrintfCString("%s has an effective format of %s, which is not" + " renderable", + attachName.BeginReading(), formatUsage->format->name); + return false; + } + + if (webgl->IsWebGL2() && Texture() && + Texture()->IsCubeMap() && !Texture()->IsCubeComplete()) + { + AttachmentName(out_info); + out_info->AppendLiteral(" is not cube complete"); + return false; + } + + const auto format = formatUsage->format; + + bool hasRequiredBits; + + switch (mAttachmentPoint) { + case LOCAL_GL_DEPTH_ATTACHMENT: + hasRequiredBits = format->d; + break; + + case LOCAL_GL_STENCIL_ATTACHMENT: + hasRequiredBits = format->s; + break; + + case LOCAL_GL_DEPTH_STENCIL_ATTACHMENT: + MOZ_ASSERT(!webgl->IsWebGL2()); + hasRequiredBits = (format->d && format->s); + break; + + default: + MOZ_ASSERT(mAttachmentPoint >= LOCAL_GL_COLOR_ATTACHMENT0); + hasRequiredBits = format->IsColorFormat(); + break; + } + + if (!hasRequiredBits) { + AttachmentName(out_info); + out_info->AppendLiteral("'s format is missing required color/depth/stencil bits"); + return false; + } + + if (!webgl->IsWebGL2()) { + bool hasSurplusPlanes = false; + + switch (mAttachmentPoint) { + case LOCAL_GL_DEPTH_ATTACHMENT: + hasSurplusPlanes = format->s; + break; + + case LOCAL_GL_STENCIL_ATTACHMENT: + hasSurplusPlanes = format->d; + break; + } + + if (hasSurplusPlanes) { + AttachmentName(out_info); + out_info->AppendLiteral("'s format has depth or stencil bits when it" + " shouldn't"); + return false; + } + } + + return true; +} + +void +WebGLFBAttachPoint::Resolve(gl::GLContext* gl) const +{ + if (!HasImage()) + return; + + if (Renderbuffer()) { + Renderbuffer()->DoFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, mAttachmentPoint); + return; + } + MOZ_ASSERT(Texture()); + + MOZ_ASSERT(gl == Texture()->mContext->GL()); + + const auto& texName = Texture()->mGLName; + + //// + + const auto fnAttach2D = [&](GLenum attachmentPoint) { + gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, attachmentPoint, + mTexImageTarget.get(), texName, mTexImageLevel); + }; + + //// + + switch (mTexImageTarget.get()) { + case LOCAL_GL_TEXTURE_2D: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (mAttachmentPoint == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) { + fnAttach2D(LOCAL_GL_DEPTH_ATTACHMENT); + fnAttach2D(LOCAL_GL_STENCIL_ATTACHMENT); + } else { + fnAttach2D(mAttachmentPoint); + } + break; + + case LOCAL_GL_TEXTURE_2D_ARRAY: + case LOCAL_GL_TEXTURE_3D: + // If we have fFramebufferTextureLayer, we can rely on having + // DEPTH_STENCIL_ATTACHMENT. + gl->fFramebufferTextureLayer(LOCAL_GL_FRAMEBUFFER, mAttachmentPoint, texName, + mTexImageLevel, mTexImageLayer); + break; + } +} + +JS::Value +WebGLFBAttachPoint::GetParameter(const char* funcName, WebGLContext* webgl, JSContext* cx, + GLenum target, GLenum attachment, GLenum pname, + ErrorResult* const out_error) const +{ + const bool hasAttachment = (mTexturePtr || mRenderbufferPtr); + if (!hasAttachment) { + // Divergent between GLES 3 and 2. + + // GLES 2.0.25 p127: + // "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then querying any + // other pname will generate INVALID_ENUM." + + // GLES 3.0.4 p240: + // "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no framebuffer is + // bound to target. In this case querying pname + // FRAMEBUFFER_ATTACHMENT_OBJECT_NAME will return zero, and all other queries + // will generate an INVALID_OPERATION error." + switch (pname) { + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: + return JS::Int32Value(LOCAL_GL_NONE); + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + if (webgl->IsWebGL2()) + return JS::NullValue(); + + break; + + default: + break; + } + nsCString attachmentName; + WebGLContext::EnumName(attachment, &attachmentName); + if (webgl->IsWebGL2()) { + webgl->ErrorInvalidOperation("%s: No attachment at %s.", funcName, + attachmentName.BeginReading()); + } else { + webgl->ErrorInvalidEnum("%s: No attachment at %s.", funcName, + attachmentName.BeginReading()); + } + return JS::NullValue(); + } + + bool isPNameValid = false; + switch (pname) { + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: + return JS::Int32Value(mTexturePtr ? LOCAL_GL_TEXTURE + : LOCAL_GL_RENDERBUFFER); + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + return (mTexturePtr ? webgl->WebGLObjectAsJSValue(cx, mTexturePtr.get(), + *out_error) + : webgl->WebGLObjectAsJSValue(cx, mRenderbufferPtr.get(), + *out_error)); + + ////// + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: + if (mTexturePtr) + return JS::Int32Value(MipLevel()); + break; + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: + if (mTexturePtr) { + GLenum face = 0; + if (mTexturePtr->Target() == LOCAL_GL_TEXTURE_CUBE_MAP) { + face = ImageTarget().get(); + } + return JS::Int32Value(face); + } + break; + + ////// + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: + if (webgl->IsWebGL2() && mTexturePtr) { + int32_t layer = 0; + if (ImageTarget() == LOCAL_GL_TEXTURE_2D_ARRAY || + ImageTarget() == LOCAL_GL_TEXTURE_3D) + { + layer = Layer(); + } + return JS::Int32Value(layer); + } + break; + + ////// + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: + isPNameValid = webgl->IsWebGL2(); + break; + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: + isPNameValid = (webgl->IsWebGL2() || + webgl->IsExtensionEnabled(WebGLExtensionID::EXT_sRGB)); + break; + } + + if (!isPNameValid) { + webgl->ErrorInvalidEnum("%s: Invalid pname: 0x%04x", funcName, pname); + return JS::NullValue(); + } + + const auto usage = Format(); + if (!usage) { + if (pname == LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) + return JS::NumberValue(LOCAL_GL_LINEAR); + + return JS::NullValue(); + } + + auto format = usage->format; + + GLint ret = 0; + switch (pname) { + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + ret = format->r; + break; + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + ret = format->g; + break; + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + ret = format->b; + break; + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + ret = format->a; + break; + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + ret = format->d; + break; + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + ret = format->s; + break; + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: + ret = (format->isSRGB ? LOCAL_GL_SRGB + : LOCAL_GL_LINEAR); + break; + + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: + MOZ_ASSERT(attachment != LOCAL_GL_DEPTH_STENCIL_ATTACHMENT); + + if (format->componentType == webgl::ComponentType::Special) { + // Special format is used for DS mixed format(e.g. D24S8 and D32FS8). + MOZ_ASSERT(format->unsizedFormat == webgl::UnsizedFormat::DEPTH_STENCIL); + MOZ_ASSERT(attachment == LOCAL_GL_DEPTH_ATTACHMENT || + attachment == LOCAL_GL_STENCIL_ATTACHMENT); + + if (attachment == LOCAL_GL_DEPTH_ATTACHMENT) { + switch (format->effectiveFormat) { + case webgl::EffectiveFormat::DEPTH24_STENCIL8: + format = webgl::GetFormat(webgl::EffectiveFormat::DEPTH_COMPONENT24); + break; + case webgl::EffectiveFormat::DEPTH32F_STENCIL8: + format = webgl::GetFormat(webgl::EffectiveFormat::DEPTH_COMPONENT32F); + break; + default: + MOZ_ASSERT(false, "no matched DS format"); + break; + } + } else if (attachment == LOCAL_GL_STENCIL_ATTACHMENT) { + switch (format->effectiveFormat) { + case webgl::EffectiveFormat::DEPTH24_STENCIL8: + case webgl::EffectiveFormat::DEPTH32F_STENCIL8: + format = webgl::GetFormat(webgl::EffectiveFormat::STENCIL_INDEX8); + break; + default: + MOZ_ASSERT(false, "no matched DS format"); + break; + } + } + } + + switch (format->componentType) { + case webgl::ComponentType::None: + ret = LOCAL_GL_NONE; + break; + case webgl::ComponentType::Int: + ret = LOCAL_GL_INT; + break; + case webgl::ComponentType::UInt: + ret = LOCAL_GL_UNSIGNED_INT; + break; + case webgl::ComponentType::NormInt: + ret = LOCAL_GL_SIGNED_NORMALIZED; + break; + case webgl::ComponentType::NormUInt: + ret = LOCAL_GL_UNSIGNED_NORMALIZED; + break; + case webgl::ComponentType::Float: + ret = LOCAL_GL_FLOAT; + break; + default: + MOZ_ASSERT(false, "No matched component type"); + break; + } + break; + + default: + MOZ_ASSERT(false, "Missing case."); + break; + } + + return JS::Int32Value(ret); +} + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// WebGLFramebuffer + +WebGLFramebuffer::WebGLFramebuffer(WebGLContext* webgl, GLuint fbo) + : WebGLRefCountedObject(webgl) + , mGLName(fbo) +#ifdef ANDROID + , mIsFB(false) +#endif + , mDepthAttachment(this, LOCAL_GL_DEPTH_ATTACHMENT) + , mStencilAttachment(this, LOCAL_GL_STENCIL_ATTACHMENT) + , mDepthStencilAttachment(this, LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) +{ + mContext->mFramebuffers.insertBack(this); + + size_t i = 0; + for (auto& cur : mColorAttachments) { + new (&cur) WebGLFBAttachPoint(this, LOCAL_GL_COLOR_ATTACHMENT0 + i); + i++; + } + + mColorDrawBuffers.push_back(&mColorAttachments[0]); + mColorReadBuffer = &mColorAttachments[0]; +} + +void +WebGLFramebuffer::Delete() +{ + InvalidateFramebufferStatus(); + + mDepthAttachment.Clear(); + mStencilAttachment.Clear(); + mDepthStencilAttachment.Clear(); + + for (auto& cur : mColorAttachments) { + cur.Clear(); + } + + mContext->MakeContextCurrent(); + mContext->gl->fDeleteFramebuffers(1, &mGLName); + + LinkedListElement::removeFrom(mContext->mFramebuffers); + +#ifdef ANDROID + mIsFB = false; +#endif +} + +//// + +Maybe +WebGLFramebuffer::GetColorAttachPoint(GLenum attachPoint) +{ + if (attachPoint == LOCAL_GL_NONE) + return Some(nullptr); + + if (attachPoint < LOCAL_GL_COLOR_ATTACHMENT0) + return Nothing(); + + const size_t colorId = attachPoint - LOCAL_GL_COLOR_ATTACHMENT0; + + MOZ_ASSERT(mContext->mImplMaxColorAttachments <= kMaxColorAttachments); + if (colorId >= mContext->mImplMaxColorAttachments) + return Nothing(); + + return Some(&mColorAttachments[colorId]); +} + +Maybe +WebGLFramebuffer::GetAttachPoint(GLenum attachPoint) +{ + switch (attachPoint) { + case LOCAL_GL_DEPTH_STENCIL_ATTACHMENT: + return Some(&mDepthStencilAttachment); + + case LOCAL_GL_DEPTH_ATTACHMENT: + return Some(&mDepthAttachment); + + case LOCAL_GL_STENCIL_ATTACHMENT: + return Some(&mStencilAttachment); + + default: + return GetColorAttachPoint(attachPoint); + } +} + +#define FOR_EACH_ATTACHMENT(X) \ + X(mDepthAttachment); \ + X(mStencilAttachment); \ + X(mDepthStencilAttachment); \ + \ + for (auto& cur : mColorAttachments) { \ + X(cur); \ + } + +void +WebGLFramebuffer::DetachTexture(const WebGLTexture* tex) +{ + const auto fnDetach = [&](WebGLFBAttachPoint& attach) { + if (attach.Texture() == tex) { + attach.Clear(); + } + }; + + FOR_EACH_ATTACHMENT(fnDetach) +} + +void +WebGLFramebuffer::DetachRenderbuffer(const WebGLRenderbuffer* rb) +{ + const auto fnDetach = [&](WebGLFBAttachPoint& attach) { + if (attach.Renderbuffer() == rb) { + attach.Clear(); + } + }; + + FOR_EACH_ATTACHMENT(fnDetach) +} + +//////////////////////////////////////////////////////////////////////////////// +// Completeness + +bool +WebGLFramebuffer::HasDefinedAttachments() const +{ + bool hasAttachments = false; + const auto func = [&](const WebGLFBAttachPoint& attach) { + hasAttachments |= attach.IsDefined(); + }; + + FOR_EACH_ATTACHMENT(func) + return hasAttachments; +} + +bool +WebGLFramebuffer::HasIncompleteAttachments(nsCString* const out_info) const +{ + bool hasIncomplete = false; + const auto func = [&](const WebGLFBAttachPoint& cur) { + if (!cur.IsDefined()) + return; // Not defined, so can't count as incomplete. + + hasIncomplete |= !cur.IsComplete(mContext, out_info); + }; + + FOR_EACH_ATTACHMENT(func) + return hasIncomplete; +} + +bool +WebGLFramebuffer::AllImageRectsMatch() const +{ + MOZ_ASSERT(HasDefinedAttachments()); + DebugOnly fbStatusInfo; + MOZ_ASSERT(!HasIncompleteAttachments(&fbStatusInfo)); + + bool needsInit = true; + uint32_t width = 0; + uint32_t height = 0; + + bool hasMismatch = false; + const auto func = [&](const WebGLFBAttachPoint& attach) { + if (!attach.HasImage()) + return; + + uint32_t curWidth; + uint32_t curHeight; + attach.Size(&curWidth, &curHeight); + + if (needsInit) { + needsInit = false; + width = curWidth; + height = curHeight; + return; + } + + hasMismatch |= (curWidth != width || + curHeight != height); + }; + + FOR_EACH_ATTACHMENT(func) + return !hasMismatch; +} + +bool +WebGLFramebuffer::AllImageSamplesMatch() const +{ + MOZ_ASSERT(HasDefinedAttachments()); + DebugOnly fbStatusInfo; + MOZ_ASSERT(!HasIncompleteAttachments(&fbStatusInfo)); + + bool needsInit = true; + uint32_t samples = 0; + + bool hasMismatch = false; + const auto func = [&](const WebGLFBAttachPoint& attach) { + if (!attach.HasImage()) + return; + + const uint32_t curSamples = attach.Samples(); + + if (needsInit) { + needsInit = false; + samples = curSamples; + return; + } + + hasMismatch |= (curSamples != samples); + }; + + FOR_EACH_ATTACHMENT(func) + return !hasMismatch; +} + +#undef FOR_EACH_ATTACHMENT + +FBStatus +WebGLFramebuffer::PrecheckFramebufferStatus(nsCString* const out_info) const +{ + MOZ_ASSERT(mContext->mBoundDrawFramebuffer == this || + mContext->mBoundReadFramebuffer == this); + + if (!HasDefinedAttachments()) + return LOCAL_GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; // No attachments + + if (HasIncompleteAttachments(out_info)) + return LOCAL_GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; + + if (!AllImageRectsMatch()) + return LOCAL_GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; // Inconsistent sizes + + if (!AllImageSamplesMatch()) + return LOCAL_GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; // Inconsistent samples + + if (mContext->IsWebGL2()) { + MOZ_ASSERT(!mDepthStencilAttachment.IsDefined()); + } else { + const auto depthOrStencilCount = int(mDepthAttachment.IsDefined()) + + int(mStencilAttachment.IsDefined()) + + int(mDepthStencilAttachment.IsDefined()); + if (depthOrStencilCount > 1) + return LOCAL_GL_FRAMEBUFFER_UNSUPPORTED; + } + + return LOCAL_GL_FRAMEBUFFER_COMPLETE; +} + +//////////////////////////////////////// +// Validation + +bool +WebGLFramebuffer::ValidateAndInitAttachments(const char* funcName) +{ + MOZ_ASSERT(mContext->mBoundDrawFramebuffer == this || + mContext->mBoundReadFramebuffer == this); + + const auto fbStatus = CheckFramebufferStatus(funcName); + if (fbStatus == LOCAL_GL_FRAMEBUFFER_COMPLETE) + return true; + + mContext->ErrorInvalidFramebufferOperation("%s: Framebuffer must be" + " complete.", + funcName); + return false; +} + +bool +WebGLFramebuffer::ValidateClearBufferType(const char* funcName, GLenum buffer, + uint32_t drawBuffer, GLenum funcType) const +{ + if (buffer != LOCAL_GL_COLOR) + return true; + + const auto& attach = mColorAttachments[drawBuffer]; + if (!attach.IsDefined()) + return true; + + if (!count(mColorDrawBuffers.begin(), mColorDrawBuffers.end(), &attach)) + return true; // DRAW_BUFFERi set to NONE. + + GLenum attachType; + switch (attach.Format()->format->componentType) { + case webgl::ComponentType::Int: + attachType = LOCAL_GL_INT; + break; + case webgl::ComponentType::UInt: + attachType = LOCAL_GL_UNSIGNED_INT; + break; + default: + attachType = LOCAL_GL_FLOAT; + break; + } + + if (attachType != funcType) { + mContext->ErrorInvalidOperation("%s: This attachment is of type 0x%04x, but" + " this function is of type 0x%04x.", + funcName, attachType, funcType); + return false; + } + + return true; +} + +bool +WebGLFramebuffer::ValidateForRead(const char* funcName, + const webgl::FormatUsageInfo** const out_format, + uint32_t* const out_width, uint32_t* const out_height) +{ + if (!ValidateAndInitAttachments(funcName)) + return false; + + if (!mColorReadBuffer) { + mContext->ErrorInvalidOperation("%s: READ_BUFFER must not be NONE.", funcName); + return false; + } + + if (!mColorReadBuffer->IsDefined()) { + mContext->ErrorInvalidOperation("%s: The READ_BUFFER attachment is not defined.", + funcName); + return false; + } + + if (mColorReadBuffer->Samples()) { + mContext->ErrorInvalidOperation("%s: The READ_BUFFER attachment is multisampled.", + funcName); + return false; + } + + *out_format = mColorReadBuffer->Format(); + mColorReadBuffer->Size(out_width, out_height); + return true; +} + +//////////////////////////////////////////////////////////////////////////////// +// Resolution and caching + +void +WebGLFramebuffer::ResolveAttachments() const +{ + const auto& gl = mContext->gl; + + //// + // Nuke attachment points. + + for (uint32_t i = 0; i < mContext->mImplMaxColorAttachments; i++) { + const GLenum attachEnum = LOCAL_GL_COLOR_ATTACHMENT0 + i; + gl->fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, attachEnum, + LOCAL_GL_RENDERBUFFER, 0); + } + + gl->fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_DEPTH_ATTACHMENT, + LOCAL_GL_RENDERBUFFER, 0); + gl->fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_STENCIL_ATTACHMENT, + LOCAL_GL_RENDERBUFFER, 0); + + //// + + for (const auto& attach : mColorAttachments) { + attach.Resolve(gl); + } + + mDepthAttachment.Resolve(gl); + mStencilAttachment.Resolve(gl); + mDepthStencilAttachment.Resolve(gl); +} + +bool +WebGLFramebuffer::ResolveAttachmentData(const char* funcName) const +{ + ////// + // Check if we need to initialize anything + + const auto fnIs3D = [&](const WebGLFBAttachPoint& attach) { + const auto& tex = attach.Texture(); + if (!tex) + return false; + + const auto& info = tex->ImageInfoAt(attach.ImageTarget(), attach.MipLevel()); + if (info.mDepth == 1) + return false; + + return true; + }; + + uint32_t clearBits = 0; + std::vector attachmentsToClear; + std::vector colorAttachmentsToClear; + std::vector tex3DAttachmentsToInit; + + const auto fnGather = [&](const WebGLFBAttachPoint& attach, GLenum attachClearBits) { + if (!attach.HasUninitializedImageData()) + return false; + + if (fnIs3D(attach)) { + tex3DAttachmentsToInit.push_back(&attach); + return false; + } + + clearBits |= attachClearBits; + attachmentsToClear.push_back(&attach); + return true; + }; + + ////// + + for (auto& cur : mColorDrawBuffers) { + if (fnGather(*cur, LOCAL_GL_COLOR_BUFFER_BIT)) { + colorAttachmentsToClear.push_back(cur); + } + } + + fnGather(mDepthAttachment, LOCAL_GL_DEPTH_BUFFER_BIT); + fnGather(mStencilAttachment, LOCAL_GL_STENCIL_BUFFER_BIT); + fnGather(mDepthStencilAttachment, LOCAL_GL_DEPTH_BUFFER_BIT | + LOCAL_GL_STENCIL_BUFFER_BIT); + + ////// + + for (const auto& attach : tex3DAttachmentsToInit) { + const auto& tex = attach->Texture(); + if (!tex->InitializeImageData(funcName, attach->ImageTarget(), + attach->MipLevel())) + { + return false; + } + } + + if (clearBits) { + const auto fnDrawBuffers = [&](const std::vector& src) + { + std::vector enumList; + + for (const auto& cur : src) { + const auto& attachEnum = cur->mAttachmentPoint; + const GLenum attachId = attachEnum - LOCAL_GL_COLOR_ATTACHMENT0; + + while (enumList.size() < attachId) { + enumList.push_back(LOCAL_GL_NONE); + } + enumList.push_back(attachEnum); + } + + mContext->gl->fDrawBuffers(enumList.size(), enumList.data()); + }; + + //// + // Clear + + mContext->MakeContextCurrent(); + + const bool hasDrawBuffers = mContext->HasDrawBuffers(); + if (hasDrawBuffers) { + fnDrawBuffers(colorAttachmentsToClear); + } + + { + gl::ScopedBindFramebuffer autoBind(mContext->gl, mGLName); + + mContext->ForceClearFramebufferWithDefaultValues(clearBits, false); + } + + if (hasDrawBuffers) { + RefreshDrawBuffers(); + } + + // Mark initialized. + for (const auto& cur : attachmentsToClear) { + cur->SetImageDataStatus(WebGLImageDataStatus::InitializedImageData); + } + } + + return true; +} + +WebGLFramebuffer::ResolvedData::ResolvedData(const WebGLFramebuffer& parent) +{ + + texDrawBuffers.reserve(parent.mColorDrawBuffers.size() + 2); // +2 for depth+stencil. + + const auto fnCommon = [&](const WebGLFBAttachPoint& attach) { + if (!attach.IsDefined()) + return false; + + if (attach.Texture()) { + texDrawBuffers.push_back(&attach); + } + return true; + }; + + //// + + const auto fnDepthStencil = [&](const WebGLFBAttachPoint& attach) { + if (!fnCommon(attach)) + return; + + drawSet.insert(WebGLFBAttachPoint::Ordered(attach)); + readSet.insert(WebGLFBAttachPoint::Ordered(attach)); + }; + + fnDepthStencil(parent.mDepthAttachment); + fnDepthStencil(parent.mStencilAttachment); + fnDepthStencil(parent.mDepthStencilAttachment); + + //// + + for (const auto& pAttach : parent.mColorDrawBuffers) { + const auto& attach = *pAttach; + if (!fnCommon(attach)) + return; + + drawSet.insert(WebGLFBAttachPoint::Ordered(attach)); + } + + if (parent.mColorReadBuffer) { + const auto& attach = *parent.mColorReadBuffer; + if (!fnCommon(attach)) + return; + + readSet.insert(WebGLFBAttachPoint::Ordered(attach)); + } +} + +void +WebGLFramebuffer::RefreshResolvedData() +{ + if (mResolvedCompleteData) { + mResolvedCompleteData.reset(new ResolvedData(*this)); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Entrypoints + +FBStatus +WebGLFramebuffer::CheckFramebufferStatus(const char* funcName) +{ + if (IsResolvedComplete()) + return LOCAL_GL_FRAMEBUFFER_COMPLETE; + + // Ok, let's try to resolve it! + + nsCString statusInfo; + FBStatus ret = PrecheckFramebufferStatus(&statusInfo); + do { + if (ret != LOCAL_GL_FRAMEBUFFER_COMPLETE) + break; + + // Looks good on our end. Let's ask the driver. + gl::GLContext* const gl = mContext->gl; + gl->MakeCurrent(); + + const ScopedFBRebinder autoFB(mContext); + gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mGLName); + + //// + + ResolveAttachments(); // OK, attach everything properly! + RefreshDrawBuffers(); + RefreshReadBuffer(); + + ret = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); + + //// + + if (ret != LOCAL_GL_FRAMEBUFFER_COMPLETE) { + const nsPrintfCString text("Bad status according to the driver: 0x%04x", + ret.get()); + statusInfo = text; + break; + } + + if (!ResolveAttachmentData(funcName)) { + ret = LOCAL_GL_FRAMEBUFFER_UNSUPPORTED; + statusInfo.AssignLiteral("Failed to lazily-initialize attachment data."); + break; + } + + mResolvedCompleteData.reset(new ResolvedData(*this)); + return LOCAL_GL_FRAMEBUFFER_COMPLETE; + } while (false); + + MOZ_ASSERT(ret != LOCAL_GL_FRAMEBUFFER_COMPLETE); + mContext->GenerateWarning("%s: Framebuffer not complete. (status: 0x%04x) %s", + funcName, ret.get(), statusInfo.BeginReading()); + return ret; +} + +//// + +void +WebGLFramebuffer::RefreshDrawBuffers() const +{ + const auto& gl = mContext->gl; + if (!gl->IsSupported(gl::GLFeature::draw_buffers)) + return; + + // Prior to GL4.1, having a no-image FB attachment that's selected by DrawBuffers + // yields a framebuffer status of FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER. + // We could workaround this only on affected versions, but it's easier be + // unconditional. + std::vector driverBuffers(mContext->mImplMaxDrawBuffers, LOCAL_GL_NONE); + for (const auto& attach : mColorDrawBuffers) { + if (attach->HasImage()) { + const uint32_t index = attach->mAttachmentPoint - LOCAL_GL_COLOR_ATTACHMENT0; + driverBuffers[index] = attach->mAttachmentPoint; + } + } + + gl->fDrawBuffers(driverBuffers.size(), driverBuffers.data()); +} + +void +WebGLFramebuffer::RefreshReadBuffer() const +{ + const auto& gl = mContext->gl; + if (!gl->IsSupported(gl::GLFeature::read_buffer)) + return; + + // Prior to GL4.1, having a no-image FB attachment that's selected by ReadBuffer + // yields a framebuffer status of FRAMEBUFFER_INCOMPLETE_READ_BUFFER. + // We could workaround this only on affected versions, but it's easier be + // unconditional. + GLenum driverBuffer = LOCAL_GL_NONE; + if (mColorReadBuffer && mColorReadBuffer->HasImage()) { + driverBuffer = mColorReadBuffer->mAttachmentPoint; + } + + gl->fReadBuffer(driverBuffer); +} + +//// + +void +WebGLFramebuffer::DrawBuffers(const char* funcName, const dom::Sequence& buffers) +{ + if (buffers.Length() > mContext->mImplMaxDrawBuffers) { + // "An INVALID_VALUE error is generated if `n` is greater than MAX_DRAW_BUFFERS." + mContext->ErrorInvalidValue("%s: `buffers` must have a length <=" + " MAX_DRAW_BUFFERS.", funcName); + return; + } + + std::vector newColorDrawBuffers; + newColorDrawBuffers.reserve(buffers.Length()); + + for (size_t i = 0; i < buffers.Length(); i++) { + // "If the GL is bound to a draw framebuffer object, the `i`th buffer listed in + // bufs must be COLOR_ATTACHMENTi or NONE. Specifying a buffer out of order, + // BACK, or COLOR_ATTACHMENTm where `m` is greater than or equal to the value of + // MAX_COLOR_ATTACHMENTS, will generate the error INVALID_OPERATION. + + // WEBGL_draw_buffers: + // "The value of the MAX_COLOR_ATTACHMENTS_WEBGL parameter must be greater than or + // equal to that of the MAX_DRAW_BUFFERS_WEBGL parameter." + // This means that if buffers.Length() isn't larger than MaxDrawBuffers, it won't + // be larger than MaxColorAttachments. + const auto& cur = buffers[i]; + if (cur == LOCAL_GL_COLOR_ATTACHMENT0 + i) { + const auto& attach = mColorAttachments[i]; + newColorDrawBuffers.push_back(&attach); + } else if (cur != LOCAL_GL_NONE) { + const bool isColorEnum = (cur >= LOCAL_GL_COLOR_ATTACHMENT0 && + cur < mContext->LastColorAttachmentEnum()); + if (cur != LOCAL_GL_BACK && + !isColorEnum) + { + mContext->ErrorInvalidEnum("%s: Unexpected enum in buffers.", funcName); + return; + } + + mContext->ErrorInvalidOperation("%s: `buffers[i]` must be NONE or" + " COLOR_ATTACHMENTi.", + funcName); + return; + } + } + + //// + + mContext->MakeContextCurrent(); + + mColorDrawBuffers.swap(newColorDrawBuffers); + RefreshDrawBuffers(); // Calls glDrawBuffers. + RefreshResolvedData(); +} + +void +WebGLFramebuffer::ReadBuffer(const char* funcName, GLenum attachPoint) +{ + const auto& maybeAttach = GetColorAttachPoint(attachPoint); + if (!maybeAttach) { + const char text[] = "%s: `mode` must be a COLOR_ATTACHMENTi, for 0 <= i <" + " MAX_DRAW_BUFFERS."; + if (attachPoint == LOCAL_GL_BACK) { + mContext->ErrorInvalidOperation(text, funcName); + } else { + mContext->ErrorInvalidEnum(text, funcName); + } + return; + } + const auto& attach = maybeAttach.value(); // Might be nullptr. + + //// + + mContext->MakeContextCurrent(); + + mColorReadBuffer = attach; + RefreshReadBuffer(); // Calls glReadBuffer. + RefreshResolvedData(); +} + +//// + +void +WebGLFramebuffer::FramebufferRenderbuffer(const char* funcName, GLenum attachEnum, + GLenum rbtarget, WebGLRenderbuffer* rb) +{ + MOZ_ASSERT(mContext->mBoundDrawFramebuffer == this || + mContext->mBoundReadFramebuffer == this); + + // `attachment` + const auto maybeAttach = GetAttachPoint(attachEnum); + if (!maybeAttach || !maybeAttach.value()) { + mContext->ErrorInvalidEnum("%s: Bad `attachment`: 0x%x.", funcName, attachEnum); + return; + } + const auto& attach = maybeAttach.value(); + + // `rbTarget` + if (rbtarget != LOCAL_GL_RENDERBUFFER) { + mContext->ErrorInvalidEnumInfo("framebufferRenderbuffer: rbtarget:", rbtarget); + return; + } + + // `rb` + if (rb && !mContext->ValidateObject("framebufferRenderbuffer: rb", *rb)) + return; + + // End of validation. + + if (mContext->IsWebGL2() && attachEnum == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) { + mDepthAttachment.SetRenderbuffer(rb); + mStencilAttachment.SetRenderbuffer(rb); + } else { + attach->SetRenderbuffer(rb); + } + + InvalidateFramebufferStatus(); +} + +void +WebGLFramebuffer::FramebufferTexture2D(const char* funcName, GLenum attachEnum, + GLenum texImageTarget, WebGLTexture* tex, + GLint level) +{ + MOZ_ASSERT(mContext->mBoundDrawFramebuffer == this || + mContext->mBoundReadFramebuffer == this); + + // `attachment` + const auto maybeAttach = GetAttachPoint(attachEnum); + if (!maybeAttach || !maybeAttach.value()) { + mContext->ErrorInvalidEnum("%s: Bad `attachment`: 0x%x.", funcName, attachEnum); + return; + } + const auto& attach = maybeAttach.value(); + + // `texImageTarget` + if (texImageTarget != LOCAL_GL_TEXTURE_2D && + (texImageTarget < LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X || + texImageTarget > LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)) + { + mContext->ErrorInvalidEnumInfo("framebufferTexture2D: texImageTarget:", + texImageTarget); + return; + } + + // `texture` + if (tex) { + if (!mContext->ValidateObject("framebufferTexture2D: texture", *tex)) + return; + + if (!tex->HasEverBeenBound()) { + mContext->ErrorInvalidOperation("%s: `texture` has never been bound.", + funcName); + return; + } + + const TexTarget destTexTarget = TexImageTargetToTexTarget(texImageTarget); + if (tex->Target() != destTexTarget) { + mContext->ErrorInvalidOperation("%s: Mismatched texture and texture target.", + funcName); + return; + } + } + + // `level` + if (level < 0) + return mContext->ErrorInvalidValue("%s: `level` must not be negative.", funcName); + + if (mContext->IsWebGL2()) { + /* GLES 3.0.4 p208: + * If textarget is one of TEXTURE_CUBE_MAP_POSITIVE_X, + * TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, + * TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_Y, + * or TEXTURE_CUBE_MAP_NEGATIVE_Z, then level must be greater + * than or equal to zero and less than or equal to log2 of the + * value of MAX_CUBE_MAP_TEXTURE_SIZE. If textarget is TEXTURE_2D, + * level must be greater than or equal to zero and no larger than + * log2 of the value of MAX_TEXTURE_SIZE. Otherwise, an + * INVALID_VALUE error is generated. + */ + + if (texImageTarget == LOCAL_GL_TEXTURE_2D) { + if (uint32_t(level) > FloorLog2(mContext->mImplMaxTextureSize)) + return mContext->ErrorInvalidValue("%s: `level` is too large.", funcName); + } else { + MOZ_ASSERT(texImageTarget >= LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X && + texImageTarget <= LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z); + + if (uint32_t(level) > FloorLog2(mContext->mImplMaxCubeMapTextureSize)) + return mContext->ErrorInvalidValue("%s: `level` is too large.", funcName); + } + } else if (level != 0) { + return mContext->ErrorInvalidValue("%s: `level` must be 0.", funcName); + } + + // End of validation. + + if (mContext->IsWebGL2() && attachEnum == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) { + mDepthAttachment.SetTexImage(tex, texImageTarget, level); + mStencilAttachment.SetTexImage(tex, texImageTarget, level); + } else { + attach->SetTexImage(tex, texImageTarget, level); + } + + InvalidateFramebufferStatus(); +} + +void +WebGLFramebuffer::FramebufferTextureLayer(const char* funcName, GLenum attachEnum, + WebGLTexture* tex, GLint level, GLint layer) +{ + MOZ_ASSERT(mContext->mBoundDrawFramebuffer == this || + mContext->mBoundReadFramebuffer == this); + + // `attachment` + const auto maybeAttach = GetAttachPoint(attachEnum); + if (!maybeAttach || !maybeAttach.value()) { + mContext->ErrorInvalidEnum("%s: Bad `attachment`: 0x%x.", funcName, attachEnum); + return; + } + const auto& attach = maybeAttach.value(); + + // `level`, `layer` + if (layer < 0) + return mContext->ErrorInvalidValue("%s: `layer` must be >= 0.", funcName); + + if (level < 0) + return mContext->ErrorInvalidValue("%s: `level` must be >= 0.", funcName); + + // `texture` + TexImageTarget texImageTarget = LOCAL_GL_TEXTURE_3D; + if (tex) { + if (!mContext->ValidateObject("framebufferTextureLayer: texture", *tex)) + return; + + if (!tex->HasEverBeenBound()) { + mContext->ErrorInvalidOperation("%s: `texture` has never been bound.", + funcName); + return; + } + + texImageTarget = tex->Target().get(); + switch (texImageTarget.get()) { + case LOCAL_GL_TEXTURE_3D: + if (uint32_t(layer) >= mContext->mImplMax3DTextureSize) { + mContext->ErrorInvalidValue("%s: `layer` must be < %s.", funcName, + "MAX_3D_TEXTURE_SIZE"); + return; + } + + if (uint32_t(level) > FloorLog2(mContext->mImplMax3DTextureSize)) { + mContext->ErrorInvalidValue("%s: `level` must be <= log2(%s).", funcName, + "MAX_3D_TEXTURE_SIZE"); + return; + } + break; + + case LOCAL_GL_TEXTURE_2D_ARRAY: + if (uint32_t(layer) >= mContext->mImplMaxArrayTextureLayers) { + mContext->ErrorInvalidValue("%s: `layer` must be < %s.", funcName, + "MAX_ARRAY_TEXTURE_LAYERS"); + return; + } + + if (uint32_t(level) > FloorLog2(mContext->mImplMaxTextureSize)) { + mContext->ErrorInvalidValue("%s: `level` must be <= log2(%s).", funcName, + "MAX_TEXTURE_SIZE"); + return; + } + break; + + default: + mContext->ErrorInvalidOperation("%s: `texture` must be a TEXTURE_3D or" + " TEXTURE_2D_ARRAY.", + funcName); + return; + } + } + + // End of validation. + + if (mContext->IsWebGL2() && attachEnum == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) { + mDepthAttachment.SetTexImage(tex, texImageTarget, level, layer); + mStencilAttachment.SetTexImage(tex, texImageTarget, level, layer); + } else { + attach->SetTexImage(tex, texImageTarget, level, layer); + } + + InvalidateFramebufferStatus(); +} + +JS::Value +WebGLFramebuffer::GetAttachmentParameter(const char* funcName, JSContext* cx, + GLenum target, GLenum attachEnum, GLenum pname, + ErrorResult* const out_error) +{ + const auto maybeAttach = GetAttachPoint(attachEnum); + if (!maybeAttach || attachEnum == LOCAL_GL_NONE) { + mContext->ErrorInvalidEnum("%s: Can only query COLOR_ATTACHMENTi," + " DEPTH_ATTACHMENT, DEPTH_STENCIL_ATTACHMENT, or" + " STENCIL_ATTACHMENT for a framebuffer.", + funcName); + return JS::NullValue(); + } + auto attach = maybeAttach.value(); + + if (mContext->IsWebGL2() && attachEnum == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) { + // There are a couple special rules for this one. + + if (pname == LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) { + mContext->ErrorInvalidOperation("%s: Querying" + " FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" + " against DEPTH_STENCIL_ATTACHMENT is an" + " error.", + funcName); + return JS::NullValue(); + } + + if (mDepthAttachment.Renderbuffer() != mStencilAttachment.Renderbuffer() || + mDepthAttachment.Texture() != mStencilAttachment.Texture()) + { + mContext->ErrorInvalidOperation("%s: DEPTH_ATTACHMENT and STENCIL_ATTACHMENT" + " have different objects bound.", + funcName); + return JS::NullValue(); + } + + attach = &mDepthAttachment; + } + + return attach->GetParameter(funcName, mContext, cx, target, attachEnum, pname, + out_error); +} + +//////////////////// + +static void +GetBackbufferFormats(const WebGLContext* webgl, + const webgl::FormatInfo** const out_color, + const webgl::FormatInfo** const out_depth, + const webgl::FormatInfo** const out_stencil) +{ + const auto& options = webgl->Options(); + + const auto effFormat = (options.alpha ? webgl::EffectiveFormat::RGBA8 + : webgl::EffectiveFormat::RGB8); + *out_color = webgl::GetFormat(effFormat); + + *out_depth = nullptr; + *out_stencil = nullptr; + if (options.depth && options.stencil) { + *out_depth = webgl::GetFormat(webgl::EffectiveFormat::DEPTH24_STENCIL8); + *out_stencil = *out_depth; + } else { + if (options.depth) { + *out_depth = webgl::GetFormat(webgl::EffectiveFormat::DEPTH_COMPONENT16); + } + if (options.stencil) { + *out_stencil = webgl::GetFormat(webgl::EffectiveFormat::STENCIL_INDEX8); + } + } +} + +/*static*/ void +WebGLFramebuffer::BlitFramebuffer(WebGLContext* webgl, + const WebGLFramebuffer* srcFB, GLint srcX0, GLint srcY0, + GLint srcX1, GLint srcY1, + const WebGLFramebuffer* dstFB, GLint dstX0, GLint dstY0, + GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + const char funcName[] = "blitFramebuffer"; + const auto& gl = webgl->gl; + + //// + // Collect data + + const auto fnGetDepthAndStencilAttach = [](const WebGLFramebuffer* fb, + const WebGLFBAttachPoint** const out_depth, + const WebGLFBAttachPoint** const out_stencil) + { + *out_depth = nullptr; + *out_stencil = nullptr; + + if (!fb) + return; + + if (fb->mDepthStencilAttachment.IsDefined()) { + *out_depth = *out_stencil = &fb->mDepthStencilAttachment; + return; + } + if (fb->mDepthAttachment.IsDefined()) { + *out_depth = &fb->mDepthAttachment; + } + if (fb->mStencilAttachment.IsDefined()) { + *out_stencil = &fb->mStencilAttachment; + } + }; + + const WebGLFBAttachPoint* srcDepthAttach; + const WebGLFBAttachPoint* srcStencilAttach; + fnGetDepthAndStencilAttach(srcFB, &srcDepthAttach, &srcStencilAttach); + const WebGLFBAttachPoint* dstDepthAttach; + const WebGLFBAttachPoint* dstStencilAttach; + fnGetDepthAndStencilAttach(dstFB, &dstDepthAttach, &dstStencilAttach); + + //// + + const auto fnGetFormat = [](const WebGLFBAttachPoint* cur, + bool* const out_hasSamples) -> const webgl::FormatInfo* + { + if (!cur || !cur->IsDefined()) + return nullptr; + + *out_hasSamples |= bool(cur->Samples()); + return cur->Format()->format; + }; + + const auto fnNarrowComponentType = [&](const webgl::FormatInfo* format) { + switch (format->componentType) { + case webgl::ComponentType::NormInt: + case webgl::ComponentType::NormUInt: + return webgl::ComponentType::Float; + + default: + return format->componentType; + } + }; + + bool srcHasSamples; + const webgl::FormatInfo* srcColorFormat; + webgl::ComponentType srcColorType = webgl::ComponentType::None; + const webgl::FormatInfo* srcDepthFormat; + const webgl::FormatInfo* srcStencilFormat; + + if (srcFB) { + srcHasSamples = false; + srcColorFormat = fnGetFormat(srcFB->mColorReadBuffer, &srcHasSamples); + srcDepthFormat = fnGetFormat(srcDepthAttach, &srcHasSamples); + srcStencilFormat = fnGetFormat(srcStencilAttach, &srcHasSamples); + } else { + srcHasSamples = false; // Always false. + + GetBackbufferFormats(webgl, &srcColorFormat, &srcDepthFormat, &srcStencilFormat); + } + + if (srcColorFormat) { + srcColorType = fnNarrowComponentType(srcColorFormat); + } + + //// + + bool dstHasSamples; + const webgl::FormatInfo* dstDepthFormat; + const webgl::FormatInfo* dstStencilFormat; + bool dstHasColor = false; + bool colorFormatsMatch = true; + bool colorTypesMatch = true; + + const auto fnCheckColorFormat = [&](const webgl::FormatInfo* dstFormat) { + MOZ_ASSERT(dstFormat->r || dstFormat->g || dstFormat->b || dstFormat->a); + dstHasColor = true; + colorFormatsMatch &= (dstFormat == srcColorFormat); + colorTypesMatch &= ( fnNarrowComponentType(dstFormat) == srcColorType ); + }; + + if (dstFB) { + dstHasSamples = false; + + for (const auto& cur : dstFB->mColorDrawBuffers) { + const auto& format = fnGetFormat(cur, &dstHasSamples); + if (!format) + continue; + + fnCheckColorFormat(format); + } + + dstDepthFormat = fnGetFormat(dstDepthAttach, &dstHasSamples); + dstStencilFormat = fnGetFormat(dstStencilAttach, &dstHasSamples); + } else { + dstHasSamples = bool(gl->Screen()->Samples()); + + const webgl::FormatInfo* dstColorFormat; + GetBackbufferFormats(webgl, &dstColorFormat, &dstDepthFormat, &dstStencilFormat); + + fnCheckColorFormat(dstColorFormat); + } + + //// + // Clear unused buffer bits + + if (mask & LOCAL_GL_COLOR_BUFFER_BIT && + !srcColorFormat && !dstHasColor) + { + mask ^= LOCAL_GL_COLOR_BUFFER_BIT; + } + + if (mask & LOCAL_GL_DEPTH_BUFFER_BIT && + !srcDepthFormat && !dstDepthFormat) + { + mask ^= LOCAL_GL_DEPTH_BUFFER_BIT; + } + + if (mask & LOCAL_GL_STENCIL_BUFFER_BIT && + !srcStencilFormat && !dstStencilFormat) + { + mask ^= LOCAL_GL_STENCIL_BUFFER_BIT; + } + + //// + // Validation + + if (mask & LOCAL_GL_COLOR_BUFFER_BIT) { + if (srcColorFormat && filter == LOCAL_GL_LINEAR) { + const auto& type = srcColorFormat->componentType; + if (type == webgl::ComponentType::Int || + type == webgl::ComponentType::UInt) + { + webgl->ErrorInvalidOperation("%s: `filter` is LINEAR and READ_BUFFER" + " contains integer data.", + funcName); + return; + } + } + + if (!colorTypesMatch) { + webgl->ErrorInvalidOperation("%s: Color component types (fixed/float/uint/" + "int) must match.", + funcName); + return; + } + } + + const GLbitfield depthAndStencilBits = LOCAL_GL_DEPTH_BUFFER_BIT | + LOCAL_GL_STENCIL_BUFFER_BIT; + if (bool(mask & depthAndStencilBits) && + filter != LOCAL_GL_NEAREST) + { + webgl->ErrorInvalidOperation("%s: DEPTH_BUFFER_BIT and STENCIL_BUFFER_BIT can" + " only be used with NEAREST filtering.", + funcName); + return; + } + + /* GLES 3.0.4, p199: + * Calling BlitFramebuffer will result in an INVALID_OPERATION error if + * mask includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT, and the source + * and destination depth and stencil buffer formats do not match. + * + * jgilbert: The wording is such that if only DEPTH_BUFFER_BIT is specified, + * the stencil formats must match. This seems wrong. It could be a spec bug, + * or I could be missing an interaction in one of the earlier paragraphs. + */ + if (mask & LOCAL_GL_DEPTH_BUFFER_BIT && + dstDepthFormat && dstDepthFormat != srcDepthFormat) + { + webgl->ErrorInvalidOperation("%s: Depth buffer formats must match if selected.", + funcName); + return; + } + + if (mask & LOCAL_GL_STENCIL_BUFFER_BIT && + dstStencilFormat && dstStencilFormat != srcStencilFormat) + { + webgl->ErrorInvalidOperation("%s: Stencil buffer formats must match if selected.", + funcName); + return; + } + + //// + + if (dstHasSamples) { + webgl->ErrorInvalidOperation("%s: DRAW_FRAMEBUFFER may not have multiple" + " samples.", + funcName); + return; + } + + if (srcHasSamples) { + if (mask & LOCAL_GL_COLOR_BUFFER_BIT && + dstHasColor && !colorFormatsMatch) + { + webgl->ErrorInvalidOperation("%s: Color buffer formats must match if" + " selected, when reading from a multisampled" + " source.", + funcName); + return; + } + + if (dstX0 != srcX0 || + dstX1 != srcX1 || + dstY0 != srcY0 || + dstY1 != srcY1) + { + webgl->ErrorInvalidOperation("%s: If the source is multisampled, then the" + " source and dest regions must match exactly.", + funcName); + return; + } + } + + //// + // Check for feedback + + if (srcFB && dstFB) { + const WebGLFBAttachPoint* feedback = nullptr; + + if (mask & LOCAL_GL_COLOR_BUFFER_BIT) { + MOZ_ASSERT(srcFB->mColorReadBuffer->IsDefined()); + for (const auto& cur : dstFB->mColorDrawBuffers) { + if (srcFB->mColorReadBuffer->IsEquivalentForFeedback(*cur)) { + feedback = cur; + break; + } + } + } + + if (mask & LOCAL_GL_DEPTH_BUFFER_BIT && + srcDepthAttach->IsEquivalentForFeedback(*dstDepthAttach)) + { + feedback = dstDepthAttach; + } + + if (mask & LOCAL_GL_STENCIL_BUFFER_BIT && + srcStencilAttach->IsEquivalentForFeedback(*dstStencilAttach)) + { + feedback = dstStencilAttach; + } + + if (feedback) { + webgl->ErrorInvalidOperation("%s: Feedback detected into DRAW_FRAMEBUFFER's" + " 0x%04x attachment.", + funcName, feedback->mAttachmentPoint); + return; + } + } else if (!srcFB && !dstFB) { + webgl->ErrorInvalidOperation("%s: Feedback with default framebuffer.", funcName); + return; + } + + //// + + gl->MakeCurrent(); + webgl->OnBeforeReadCall(); + WebGLContext::ScopedDrawCallWrapper wrapper(*webgl); + gl->fBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, + mask, filter); +} + +//////////////////////////////////////////////////////////////////////////////// +// Goop. + +JSObject* +WebGLFramebuffer::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLFramebufferBinding::Wrap(cx, this, givenProto); +} + +inline void +ImplCycleCollectionUnlink(mozilla::WebGLFBAttachPoint& field) +{ + field.Unlink(); +} + +inline void +ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& callback, + mozilla::WebGLFBAttachPoint& field, + const char* name, + uint32_t flags = 0) +{ + CycleCollectionNoteChild(callback, field.Texture(), name, flags); + CycleCollectionNoteChild(callback, field.Renderbuffer(), name, flags); +} + +template +inline void +ImplCycleCollectionUnlink(C& field) +{ + for (auto& cur : field) { + cur.Unlink(); + } +} + +template +inline void +ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& callback, + C& field, + const char* name, + uint32_t flags = 0) +{ + for (auto& cur : field) { + ImplCycleCollectionTraverse(callback, cur, name, flags); + } +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebGLFramebuffer, + mDepthAttachment, + mStencilAttachment, + mDepthStencilAttachment, + mColorAttachments) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLFramebuffer, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLFramebuffer, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLFramebuffer.h b/dom/canvas/WebGLFramebuffer.h new file mode 100644 index 000000000..ac457c098 --- /dev/null +++ b/dom/canvas/WebGLFramebuffer.h @@ -0,0 +1,295 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_FRAMEBUFFER_H_ +#define WEBGL_FRAMEBUFFER_H_ + +#include + +#include "mozilla/LinkedList.h" +#include "mozilla/WeakPtr.h" +#include "nsWrapperCache.h" + +#include "WebGLObjectModel.h" +#include "WebGLRenderbuffer.h" +#include "WebGLStrongTypes.h" +#include "WebGLTexture.h" +#include "WebGLTypes.h" + +namespace mozilla { + +class WebGLFramebuffer; +class WebGLRenderbuffer; +class WebGLTexture; + +template +class PlacementArray; + +namespace gl { + class GLContext; +} // namespace gl + +class WebGLFBAttachPoint final +{ + friend class WebGLFramebuffer; +public: + WebGLFramebuffer* const mFB; + const GLenum mAttachmentPoint; + +protected: + WebGLRefPtr mTexturePtr; + WebGLRefPtr mRenderbufferPtr; + TexImageTarget mTexImageTarget; + GLint mTexImageLayer; + uint32_t mTexImageLevel; + + //// + + WebGLFBAttachPoint(); + WebGLFBAttachPoint(WebGLFramebuffer* fb, GLenum attachmentPoint); + +public: + ~WebGLFBAttachPoint(); + + //// + + void Unlink(); + + bool IsDefined() const; + bool IsDeleteRequested() const; + + const webgl::FormatUsageInfo* Format() const; + uint32_t Samples() const; + + bool HasAlpha() const; + bool IsReadableFloat() const; + + void Clear(); + + void SetTexImage(WebGLTexture* tex, TexImageTarget target, GLint level, + GLint layer = 0); + void SetRenderbuffer(WebGLRenderbuffer* rb); + + WebGLTexture* Texture() const { return mTexturePtr; } + WebGLRenderbuffer* Renderbuffer() const { return mRenderbufferPtr; } + + TexImageTarget ImageTarget() const { + return mTexImageTarget; + } + GLint Layer() const { + return mTexImageLayer; + } + uint32_t MipLevel() const { + return mTexImageLevel; + } + void AttachmentName(nsCString* out) const; + + bool HasUninitializedImageData() const; + void SetImageDataStatus(WebGLImageDataStatus x) const; + + void Size(uint32_t* const out_width, uint32_t* const out_height) const; + + bool HasImage() const; + bool IsComplete(WebGLContext* webgl, nsCString* const out_info) const; + + void Resolve(gl::GLContext* gl) const; + + JS::Value GetParameter(const char* funcName, WebGLContext* webgl, JSContext* cx, + GLenum target, GLenum attachment, GLenum pname, + ErrorResult* const out_error) const; + + void OnBackingStoreRespecified() const; + + bool IsEquivalentForFeedback(const WebGLFBAttachPoint& other) const { + if (!IsDefined() || !other.IsDefined()) + return false; + +#define _(X) X == other.X + return ( _(mRenderbufferPtr) && + _(mTexturePtr) && + _(mTexImageTarget.get()) && + _(mTexImageLevel) && + _(mTexImageLayer) ); +#undef _ + } + + //// + + struct Ordered { + const WebGLFBAttachPoint& mRef; + + explicit Ordered(const WebGLFBAttachPoint& ref) + : mRef(ref) + { } + + bool operator<(const Ordered& other) const { + MOZ_ASSERT(mRef.IsDefined() && other.mRef.IsDefined()); + +#define ORDER_BY(X) if (X != other.X) return X < other.X; + + ORDER_BY(mRef.mRenderbufferPtr) + ORDER_BY(mRef.mTexturePtr) + ORDER_BY(mRef.mTexImageTarget.get()) + ORDER_BY(mRef.mTexImageLevel) + ORDER_BY(mRef.mTexImageLayer) + +#undef ORDER_BY + return false; + } + }; +}; + +class WebGLFramebuffer final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement + , public SupportsWeakPtr +{ + friend class WebGLContext; + +public: + MOZ_DECLARE_WEAKREFERENCE_TYPENAME(WebGLFramebuffer) + + const GLuint mGLName; + +protected: +#ifdef ANDROID + // Bug 1140459: Some drivers (including our test slaves!) don't + // give reasonable answers for IsRenderbuffer, maybe others. + // This shows up on Android 2.3 emulator. + // + // So we track the `is a Framebuffer` state ourselves. + bool mIsFB; +#endif + + //// + + WebGLFBAttachPoint mDepthAttachment; + WebGLFBAttachPoint mStencilAttachment; + WebGLFBAttachPoint mDepthStencilAttachment; + + // In theory, this number can be unbounded based on the driver. However, no driver + // appears to expose more than 8. We might as well stop there too, for now. + // (http://opengl.gpuinfo.org/gl_stats_caps_single.php?listreportsbycap=GL_MAX_COLOR_ATTACHMENTS) + static const size_t kMaxColorAttachments = 8; // jgilbert's MacBook Pro exposes 8. + WebGLFBAttachPoint mColorAttachments[kMaxColorAttachments]; + + //// + + std::vector mColorDrawBuffers; // Non-null + const WebGLFBAttachPoint* mColorReadBuffer; // Null if NONE + + //// + + struct ResolvedData { + // IsFeedback + std::vector texDrawBuffers; // Non-null + std::set drawSet; + std::set readSet; + + explicit ResolvedData(const WebGLFramebuffer& parent); + }; + + UniquePtr mResolvedCompleteData; + + //// + +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLFramebuffer) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLFramebuffer) + + WebGLFramebuffer(WebGLContext* webgl, GLuint fbo); + + WebGLContext* GetParentObject() const { return mContext; } + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + +private: + ~WebGLFramebuffer() { + DeleteOnce(); + } + +public: + void Delete(); + + //// + + bool HasDefinedAttachments() const; + bool HasIncompleteAttachments(nsCString* const out_info) const; + bool AllImageRectsMatch() const; + bool AllImageSamplesMatch() const; + FBStatus PrecheckFramebufferStatus(nsCString* const out_info) const; + +protected: + Maybe GetAttachPoint(GLenum attachment); // Fallible + Maybe GetColorAttachPoint(GLenum attachment); // Fallible + void ResolveAttachments() const; + void RefreshDrawBuffers() const; + void RefreshReadBuffer() const; + bool ResolveAttachmentData(const char* funcName) const; + +public: + void DetachTexture(const WebGLTexture* tex); + void DetachRenderbuffer(const WebGLRenderbuffer* rb); + bool ValidateAndInitAttachments(const char* funcName); + bool ValidateClearBufferType(const char* funcName, GLenum buffer, uint32_t drawBuffer, + GLenum funcType) const; + + bool ValidateForRead(const char* info, + const webgl::FormatUsageInfo** const out_format, + uint32_t* const out_width, uint32_t* const out_height); + + //////////////// + // Getters + +#define GETTER(X) const decltype(m##X)& X() const { return m##X; } + + GETTER(DepthAttachment) + GETTER(StencilAttachment) + GETTER(DepthStencilAttachment) + GETTER(ColorDrawBuffers) + GETTER(ColorReadBuffer) + GETTER(ResolvedCompleteData) + +#undef GETTER + + //////////////// + // Invalidation + + bool IsResolvedComplete() const { return bool(mResolvedCompleteData); } + + void InvalidateFramebufferStatus() { + mResolvedCompleteData = nullptr; + } + + void RefreshResolvedData(); + + //////////////// + // WebGL funcs + + FBStatus CheckFramebufferStatus(const char* funcName); + void FramebufferRenderbuffer(const char* funcName, GLenum attachment, GLenum rbtarget, + WebGLRenderbuffer* rb); + void FramebufferTexture2D(const char* funcName, GLenum attachment, + GLenum texImageTarget, WebGLTexture* tex, GLint level); + void FramebufferTextureLayer(const char* funcName, GLenum attachment, + WebGLTexture* tex, GLint level, GLint layer); + void DrawBuffers(const char* funcName, const dom::Sequence& buffers); + void ReadBuffer(const char* funcName, GLenum attachPoint); + + JS::Value GetAttachmentParameter(const char* funcName, JSContext* cx, GLenum target, + GLenum attachment, GLenum pname, + ErrorResult* const out_error); + + static void BlitFramebuffer(WebGLContext* webgl, + const WebGLFramebuffer* src, GLint srcX0, GLint srcY0, + GLint srcX1, GLint srcY1, + const WebGLFramebuffer* dst, GLint dstX0, GLint dstY0, + GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); +}; + +} // namespace mozilla + +#endif // WEBGL_FRAMEBUFFER_H_ diff --git a/dom/canvas/WebGLFramebufferAttachable.cpp b/dom/canvas/WebGLFramebufferAttachable.cpp new file mode 100644 index 000000000..fd92b80f8 --- /dev/null +++ b/dom/canvas/WebGLFramebufferAttachable.cpp @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLFramebufferAttachable.h" + +#include "WebGLFramebuffer.h" + +namespace mozilla { + +void +WebGLFramebufferAttachable::MarkAttachment(const WebGLFBAttachPoint& attachment) +{ + if (mAttachmentPoints.Contains(&attachment)) + return; // Already attached. Ignore. + + mAttachmentPoints.AppendElement(&attachment); +} + +void +WebGLFramebufferAttachable::UnmarkAttachment(const WebGLFBAttachPoint& attachment) +{ + const size_t i = mAttachmentPoints.IndexOf(&attachment); + if (i == mAttachmentPoints.NoIndex) { + MOZ_ASSERT(false, "Is not attached to FB"); + return; + } + + mAttachmentPoints.RemoveElementAt(i); +} + +void +WebGLFramebufferAttachable::InvalidateStatusOfAttachedFBs() const +{ + const size_t count = mAttachmentPoints.Length(); + for (size_t i = 0; i < count; ++i) { + MOZ_ASSERT(mAttachmentPoints[i]->mFB); + mAttachmentPoints[i]->mFB->InvalidateFramebufferStatus(); + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLFramebufferAttachable.h b/dom/canvas/WebGLFramebufferAttachable.h new file mode 100644 index 000000000..a65cf34fc --- /dev/null +++ b/dom/canvas/WebGLFramebufferAttachable.h @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_FRAMEBUFFER_ATTACHABLE_H_ +#define WEBGL_FRAMEBUFFER_ATTACHABLE_H_ + +#include "nsTArray.h" + +namespace mozilla { +class WebGLFBAttachPoint; + +class WebGLFramebufferAttachable +{ + nsTArray mAttachmentPoints; + +public: + // Track FBO/Attachment combinations + void MarkAttachment(const WebGLFBAttachPoint& attachment); + void UnmarkAttachment(const WebGLFBAttachPoint& attachment); + void InvalidateStatusOfAttachedFBs() const; +}; + +} // namespace mozilla + +#endif // !WEBGLFRAMEBUFFERATTACHABLE_H_ diff --git a/dom/canvas/WebGLInternalFormatsTable.h b/dom/canvas/WebGLInternalFormatsTable.h new file mode 100644 index 000000000..bd4fa8b37 --- /dev/null +++ b/dom/canvas/WebGLInternalFormatsTable.h @@ -0,0 +1,82 @@ +// intentionally no include guard here. + +#ifndef HANDLE_WEBGL_INTERNAL_FORMAT +#error This header is meant to be included by other files defining HANDLE_WEBGL_INTERNAL_FORMAT. +#endif + +#define WEBGL_INTERNAL_FORMAT(effectiveinternalformat, unsizedinternalformat, type) \ + HANDLE_WEBGL_INTERNAL_FORMAT(LOCAL_GL_##effectiveinternalformat, \ + LOCAL_GL_##unsizedinternalformat, \ + LOCAL_GL_##type) + +// OpenGL ES 3.0.3, Table 3.2 +// +// Maps effective internal formats to (unsized internal format, type) pairs. +// +// Effective int. fmt. Unsized int. fmt. Type +WEBGL_INTERNAL_FORMAT(ALPHA8, ALPHA, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(LUMINANCE8, LUMINANCE, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(LUMINANCE8_ALPHA8, LUMINANCE_ALPHA, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(RGB8, RGB, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(RGBA4, RGBA, UNSIGNED_SHORT_4_4_4_4) +WEBGL_INTERNAL_FORMAT(RGB5_A1, RGBA, UNSIGNED_SHORT_5_5_5_1) +WEBGL_INTERNAL_FORMAT(RGBA8, RGBA, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(RGB10_A2, RGBA, UNSIGNED_INT_2_10_10_10_REV) +WEBGL_INTERNAL_FORMAT(DEPTH_COMPONENT16, DEPTH_COMPONENT, UNSIGNED_SHORT) +WEBGL_INTERNAL_FORMAT(DEPTH_COMPONENT24, DEPTH_COMPONENT, UNSIGNED_INT) +WEBGL_INTERNAL_FORMAT(R8, RED, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(RG8, RG, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(R16F, RED, HALF_FLOAT) +WEBGL_INTERNAL_FORMAT(R32F, RED, FLOAT) +WEBGL_INTERNAL_FORMAT(RG16F, RG, HALF_FLOAT) +WEBGL_INTERNAL_FORMAT(RG32F, RG, FLOAT) +WEBGL_INTERNAL_FORMAT(R8I, RED_INTEGER, BYTE) +WEBGL_INTERNAL_FORMAT(R8UI, RED_INTEGER, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(R16I, RED_INTEGER, SHORT) +WEBGL_INTERNAL_FORMAT(R16UI, RED_INTEGER, UNSIGNED_SHORT) +WEBGL_INTERNAL_FORMAT(R32I, RED_INTEGER, INT) +WEBGL_INTERNAL_FORMAT(R32UI, RED_INTEGER, UNSIGNED_INT) +WEBGL_INTERNAL_FORMAT(RG8I, RG_INTEGER, BYTE) +WEBGL_INTERNAL_FORMAT(RG8UI, RG_INTEGER, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(RG16I, RG_INTEGER, SHORT) +WEBGL_INTERNAL_FORMAT(RG16UI, RG_INTEGER, UNSIGNED_SHORT) +WEBGL_INTERNAL_FORMAT(RG32I, RG_INTEGER, INT) +WEBGL_INTERNAL_FORMAT(RG32UI, RG_INTEGER, UNSIGNED_INT) +WEBGL_INTERNAL_FORMAT(RGBA32F, RGBA, FLOAT) +WEBGL_INTERNAL_FORMAT(RGB32F, RGB, FLOAT) +WEBGL_INTERNAL_FORMAT(ALPHA32F_EXT, ALPHA, FLOAT) +WEBGL_INTERNAL_FORMAT(LUMINANCE32F_EXT, LUMINANCE, FLOAT) +WEBGL_INTERNAL_FORMAT(LUMINANCE_ALPHA32F_EXT, LUMINANCE_ALPHA, FLOAT) +WEBGL_INTERNAL_FORMAT(RGBA16F, RGBA, HALF_FLOAT) +WEBGL_INTERNAL_FORMAT(RGB16F, RGB, HALF_FLOAT) +WEBGL_INTERNAL_FORMAT(ALPHA16F_EXT, ALPHA, HALF_FLOAT) +WEBGL_INTERNAL_FORMAT(LUMINANCE16F_EXT, LUMINANCE, HALF_FLOAT) +WEBGL_INTERNAL_FORMAT(LUMINANCE_ALPHA16F_EXT, LUMINANCE_ALPHA, HALF_FLOAT) +WEBGL_INTERNAL_FORMAT(DEPTH24_STENCIL8, DEPTH_STENCIL, UNSIGNED_INT_24_8) +WEBGL_INTERNAL_FORMAT(R11F_G11F_B10F, RGB, UNSIGNED_INT_10F_11F_11F_REV) +WEBGL_INTERNAL_FORMAT(RGB9_E5, RGB, UNSIGNED_INT_5_9_9_9_REV) +WEBGL_INTERNAL_FORMAT(SRGB8, SRGB, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(SRGB8_ALPHA8, SRGB_ALPHA, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(DEPTH_COMPONENT32F, DEPTH_COMPONENT, FLOAT) +WEBGL_INTERNAL_FORMAT(DEPTH32F_STENCIL8, DEPTH_STENCIL, FLOAT_32_UNSIGNED_INT_24_8_REV) +WEBGL_INTERNAL_FORMAT(RGB565, RGB, UNSIGNED_SHORT_5_6_5) +WEBGL_INTERNAL_FORMAT(RGBA32UI, RGBA_INTEGER, UNSIGNED_INT) +WEBGL_INTERNAL_FORMAT(RGB32UI, RGB_INTEGER, UNSIGNED_INT) +WEBGL_INTERNAL_FORMAT(RGBA16UI, RGBA_INTEGER, UNSIGNED_SHORT) +WEBGL_INTERNAL_FORMAT(RGB16UI, RGB_INTEGER, UNSIGNED_SHORT) +WEBGL_INTERNAL_FORMAT(RGBA8UI, RGBA_INTEGER, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(RGB8UI, RGB_INTEGER, UNSIGNED_BYTE) +WEBGL_INTERNAL_FORMAT(RGBA32I, RGBA_INTEGER, INT) +WEBGL_INTERNAL_FORMAT(RGB32I, RGB_INTEGER, INT) +WEBGL_INTERNAL_FORMAT(RGBA16I, RGBA_INTEGER, SHORT) +WEBGL_INTERNAL_FORMAT(RGB16I, RGB_INTEGER, SHORT) +WEBGL_INTERNAL_FORMAT(RGBA8I, RGBA_INTEGER, BYTE) +WEBGL_INTERNAL_FORMAT(RGB8I, RGB_INTEGER, BYTE) +WEBGL_INTERNAL_FORMAT(R8_SNORM, RED, BYTE) +WEBGL_INTERNAL_FORMAT(RG8_SNORM, RG, BYTE) +WEBGL_INTERNAL_FORMAT(RGB8_SNORM, RGB, BYTE) +WEBGL_INTERNAL_FORMAT(RGBA8_SNORM, RGBA, BYTE) +WEBGL_INTERNAL_FORMAT(RGB10_A2UI, RGBA_INTEGER, UNSIGNED_INT_2_10_10_10_REV) + +#undef WEBGL_INTERNAL_FORMAT +#undef HANDLE_WEBGL_INTERNAL_FORMAT diff --git a/dom/canvas/WebGLMemoryTracker.cpp b/dom/canvas/WebGLMemoryTracker.cpp new file mode 100644 index 000000000..8d3999f79 --- /dev/null +++ b/dom/canvas/WebGLMemoryTracker.cpp @@ -0,0 +1,261 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLMemoryTracker.h" + +#include "WebGLBuffer.h" +#include "WebGLContext.h" +#include "WebGLVertexAttribData.h" +#include "WebGLProgram.h" +#include "WebGLRenderbuffer.h" +#include "WebGLShader.h" +#include "WebGLTexture.h" +#include "WebGLUniformLocation.h" + +namespace mozilla { + +NS_IMETHODIMP +WebGLMemoryTracker::CollectReports(nsIHandleReportCallback* aHandleReport, + nsISupports* aData, bool) +{ + MOZ_COLLECT_REPORT( + "webgl-texture-memory", KIND_OTHER, UNITS_BYTES, GetTextureMemoryUsed(), + "Memory used by WebGL textures. The OpenGL implementation is free to " + "store these textures in either video memory or main memory. This " + "measurement is only a lower bound, actual memory usage may be higher " + "for example if the storage is strided."); + + MOZ_COLLECT_REPORT( + "webgl-texture-count", KIND_OTHER, UNITS_COUNT, GetTextureCount(), + "Number of WebGL textures."); + + MOZ_COLLECT_REPORT( + "webgl-buffer-memory", KIND_OTHER, UNITS_BYTES, GetBufferMemoryUsed(), + "Memory used by WebGL buffers. The OpenGL implementation is free to " + "store these buffers in either video memory or main memory. This " + "measurement is only a lower bound, actual memory usage may be higher " + "for example if the storage is strided."); + + MOZ_COLLECT_REPORT( + "explicit/webgl/buffer-cache-memory", KIND_HEAP, UNITS_BYTES, + GetBufferCacheMemoryUsed(), + "Memory used by WebGL buffer caches. The WebGL implementation caches " + "the contents of element array buffers only. This adds up with the " + "'webgl-buffer-memory' value, but contrary to it, this one represents " + "bytes on the heap, not managed by OpenGL."); + + MOZ_COLLECT_REPORT( + "webgl-buffer-count", KIND_OTHER, UNITS_COUNT, GetBufferCount(), + "Number of WebGL buffers."); + + MOZ_COLLECT_REPORT( + "webgl-renderbuffer-memory", KIND_OTHER, UNITS_BYTES, + GetRenderbufferMemoryUsed(), + "Memory used by WebGL renderbuffers. The OpenGL implementation is free " + "to store these renderbuffers in either video memory or main memory. " + "This measurement is only a lower bound, actual memory usage may be " + "higher, for example if the storage is strided."); + + MOZ_COLLECT_REPORT( + "webgl-renderbuffer-count", KIND_OTHER, UNITS_COUNT, + GetRenderbufferCount(), + "Number of WebGL renderbuffers."); + + MOZ_COLLECT_REPORT( + "explicit/webgl/shader", KIND_HEAP, UNITS_BYTES, GetShaderSize(), + "Combined size of WebGL shader ASCII sources and translation logs " + "cached on the heap."); + + MOZ_COLLECT_REPORT( + "webgl-shader-count", KIND_OTHER, UNITS_COUNT, GetShaderCount(), + "Number of WebGL shaders."); + + MOZ_COLLECT_REPORT( + "webgl-context-count", KIND_OTHER, UNITS_COUNT, GetContextCount(), + "Number of WebGL contexts."); + + return NS_OK; +} + +NS_IMPL_ISUPPORTS(WebGLMemoryTracker, nsIMemoryReporter) + +StaticRefPtr WebGLMemoryTracker::sUniqueInstance; + +WebGLMemoryTracker* +WebGLMemoryTracker::UniqueInstance() +{ + if (!sUniqueInstance) { + sUniqueInstance = new WebGLMemoryTracker; + sUniqueInstance->InitMemoryReporter(); + } + return sUniqueInstance; +} + +WebGLMemoryTracker::WebGLMemoryTracker() +{ +} + +void +WebGLMemoryTracker::InitMemoryReporter() +{ + RegisterWeakMemoryReporter(this); +} + +WebGLMemoryTracker::~WebGLMemoryTracker() +{ + UnregisterWeakMemoryReporter(this); +} + +MOZ_DEFINE_MALLOC_SIZE_OF(WebGLBufferMallocSizeOf) + +int64_t +WebGLMemoryTracker::GetBufferCacheMemoryUsed() +{ + const ContextsArrayType& contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLBuffer* buffer = contexts[i]->mBuffers.getFirst(); + buffer; + buffer = buffer->getNext()) + { + if (buffer->Content() == WebGLBuffer::Kind::ElementArray) { + result += buffer->SizeOfIncludingThis(WebGLBufferMallocSizeOf); + } + } + } + return result; +} + +MOZ_DEFINE_MALLOC_SIZE_OF(WebGLShaderMallocSizeOf) + +int64_t +WebGLMemoryTracker::GetShaderSize() +{ + const ContextsArrayType& contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLShader* shader = contexts[i]->mShaders.getFirst(); + shader; + shader = shader->getNext()) + { + result += shader->SizeOfIncludingThis(WebGLShaderMallocSizeOf); + } + } + return result; +} + +/*static*/ int64_t +WebGLMemoryTracker::GetTextureMemoryUsed() +{ + const ContextsArrayType & contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLTexture* texture = contexts[i]->mTextures.getFirst(); + texture; + texture = texture->getNext()) + { + result += texture->MemoryUsage(); + } + } + return result; +} + +/*static*/ int64_t +WebGLMemoryTracker::GetTextureCount() +{ + const ContextsArrayType & contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLTexture* texture = contexts[i]->mTextures.getFirst(); + texture; + texture = texture->getNext()) + { + result++; + } + } + return result; +} + +/*static*/ int64_t +WebGLMemoryTracker::GetBufferMemoryUsed() +{ + const ContextsArrayType & contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLBuffer* buffer = contexts[i]->mBuffers.getFirst(); + buffer; + buffer = buffer->getNext()) + { + result += buffer->ByteLength(); + } + } + return result; +} + +/*static*/ int64_t +WebGLMemoryTracker::GetBufferCount() +{ + const ContextsArrayType & contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLBuffer* buffer = contexts[i]->mBuffers.getFirst(); + buffer; + buffer = buffer->getNext()) + { + result++; + } + } + return result; +} + +/*static*/ int64_t +WebGLMemoryTracker::GetRenderbufferMemoryUsed() +{ + const ContextsArrayType & contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLRenderbuffer* rb = contexts[i]->mRenderbuffers.getFirst(); + rb; + rb = rb->getNext()) + { + result += rb->MemoryUsage(); + } + } + return result; +} + +/*static*/ int64_t +WebGLMemoryTracker::GetRenderbufferCount() +{ + const ContextsArrayType & contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLRenderbuffer* rb = contexts[i]->mRenderbuffers.getFirst(); + rb; + rb = rb->getNext()) + { + result++; + } + } + return result; +} + +/*static*/ int64_t +WebGLMemoryTracker::GetShaderCount() +{ + const ContextsArrayType & contexts = Contexts(); + int64_t result = 0; + for(size_t i = 0; i < contexts.Length(); ++i) { + for (const WebGLShader* shader = contexts[i]->mShaders.getFirst(); + shader; + shader = shader->getNext()) + { + result++; + } + } + return result; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLMemoryTracker.h b/dom/canvas/WebGLMemoryTracker.h new file mode 100644 index 000000000..2f4b63e6e --- /dev/null +++ b/dom/canvas/WebGLMemoryTracker.h @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_MEMORY_TRACKER_H_ +#define WEBGL_MEMORY_TRACKER_H_ + +#include "mozilla/StaticPtr.h" +#include "nsIMemoryReporter.h" + +namespace mozilla { + +class WebGLContext; + +class WebGLMemoryTracker : public nsIMemoryReporter +{ + NS_DECL_THREADSAFE_ISUPPORTS + NS_DECL_NSIMEMORYREPORTER + + WebGLMemoryTracker(); + static StaticRefPtr sUniqueInstance; + + // Here we store plain pointers, not RefPtrs: we don't want the + // WebGLMemoryTracker unique instance to keep alive all + // WebGLContexts ever created. + typedef nsTArray ContextsArrayType; + ContextsArrayType mContexts; + + void InitMemoryReporter(); + + static WebGLMemoryTracker* UniqueInstance(); + + static ContextsArrayType& Contexts() { return UniqueInstance()->mContexts; } + + friend class WebGLContext; + + public: + + static void AddWebGLContext(const WebGLContext* c) { + Contexts().AppendElement(c); + } + + static void RemoveWebGLContext(const WebGLContext* c) { + ContextsArrayType & contexts = Contexts(); + contexts.RemoveElement(c); + if (contexts.IsEmpty()) { + sUniqueInstance = nullptr; + } + } + + private: + virtual ~WebGLMemoryTracker(); + + static int64_t GetTextureMemoryUsed(); + + static int64_t GetTextureCount(); + + static int64_t GetBufferMemoryUsed(); + + static int64_t GetBufferCacheMemoryUsed(); + + static int64_t GetBufferCount(); + + static int64_t GetRenderbufferMemoryUsed(); + + static int64_t GetRenderbufferCount(); + + static int64_t GetShaderSize(); + + static int64_t GetShaderCount(); + + static int64_t GetContextCount() { + return Contexts().Length(); + } +}; + +} // namespace mozilla + +#endif // WEBGL_MEMORY_TRACKER_H_ diff --git a/dom/canvas/WebGLObjectModel.cpp b/dom/canvas/WebGLObjectModel.cpp new file mode 100644 index 000000000..92941b183 --- /dev/null +++ b/dom/canvas/WebGLObjectModel.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLObjectModel.h" + +#include "WebGLContext.h" + +namespace mozilla { + +WebGLContextBoundObject::WebGLContextBoundObject(WebGLContext* webgl) + : mContext(webgl) + , mContextGeneration(webgl->Generation()) +{ +} + +bool +WebGLContextBoundObject::IsCompatibleWithContext(const WebGLContext* other) const +{ + return (mContext == other && + mContextGeneration == other->Generation()); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLObjectModel.h b/dom/canvas/WebGLObjectModel.h new file mode 100644 index 000000000..e19d2fd8e --- /dev/null +++ b/dom/canvas/WebGLObjectModel.h @@ -0,0 +1,365 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGLOBJECTMODEL_H_ +#define WEBGLOBJECTMODEL_H_ + +#include "nsCycleCollectionNoteChild.h" + +#include "WebGLTypes.h" + +namespace mozilla { + +template class LinkedList; +class WebGLContext; + +//// + +// This class is a mixin for objects that are tied to a specific +// context (which is to say, all of them). They provide initialization +// as well as comparison with the current context. +class WebGLContextBoundObject +{ +public: + WebGLContext* const mContext; +private: + const uint32_t mContextGeneration; + +public: + explicit WebGLContextBoundObject(WebGLContext* webgl); + + bool IsCompatibleWithContext(const WebGLContext* other) const; +}; + +//// + +class WebGLDeletableObject : public WebGLContextBoundObject +{ + template friend class WebGLRefCountedObject; + +private: + enum DeletionStatus { Default, DeleteRequested, Deleted }; + + DeletionStatus mDeletionStatus; + + //// + + explicit WebGLDeletableObject(WebGLContext* webgl) + : WebGLContextBoundObject(webgl) + , mDeletionStatus(Default) + { } + + ~WebGLDeletableObject() { + MOZ_ASSERT(mDeletionStatus == Deleted, + "Derived class destructor must call DeleteOnce()."); + } + +public: + bool IsDeleted() const { return mDeletionStatus == Deleted; } + bool IsDeleteRequested() const { return mDeletionStatus != Default; } +}; + +/* Each WebGL object class WebGLFoo wants to: + * - inherit WebGLRefCountedObject + * - implement a Delete() method + * - have its destructor call DeleteOnce() + * + * This base class provides two features to WebGL object types: + * 1. support for OpenGL object reference counting + * 2. support for OpenGL deletion statuses + * + ***** 1. OpenGL object reference counting ***** + * + * WebGL objects such as WebGLTexture's really have two different refcounts: + * the XPCOM refcount, that is directly exposed to JavaScript, and the OpenGL + * refcount. + * + * For example, when in JavaScript one does: var newname = existingTexture; + * that increments the XPCOM refcount, but doesn't affect the OpenGL refcount. + * When one attaches the texture to a framebuffer object, that does increment + * its OpenGL refcount (and also its XPCOM refcount, to prevent the regular + * XPCOM refcounting mechanism from destroying objects prematurely). + * + * The actual OpenGL refcount is opaque to us (it's internal to the OpenGL + * implementation) but is affects the WebGL semantics that we have to implement: + * for example, a WebGLTexture that is attached to a WebGLFramebuffer must not + * be actually deleted, even if deleteTexture has been called on it, and even + * if JavaScript doesn't have references to it anymore. We can't just rely on + * OpenGL to keep alive the underlying OpenGL texture for us, for a variety of + * reasons, most importantly: we'd need to know when OpenGL objects are actually + * deleted, and OpenGL doesn't notify us about that, so we would have to query + * status very often with glIsXxx calls which isn't practical. + * + * This means that we have to keep track of the OpenGL refcount ourselves, + * in addition to the XPCOM refcount. + * + * This class implements such a refcount, see the mWebGLRefCnt + * member. In order to avoid name clashes (with regular XPCOM refcounting) + * in the derived class, we prefix members with 'WebGL', whence the names + * WebGLAddRef, WebGLRelease, etc. + * + * In practice, WebGLAddRef and WebGLRelease are only called from the + * WebGLRefPtr class. + * + ***** 2. OpenGL deletion statuses ***** + * + * In OpenGL, an object can go through 3 different deletion statuses during its + * lifetime, which correspond to the 3 enum values for DeletionStatus in this + * class: + * - the Default status, which it has from its creation to when the suitable + * glDeleteXxx function is called on it; + * - the DeleteRequested status, which is has from when the suitable + * glDeleteXxx function is called on it to when it is no longer referenced by + * other OpenGL objects. For example, a texture that is attached to a + * non-current FBO will enter that status when glDeleteTexture is called on + * it. For objects with that status, GL_DELETE_STATUS queries return true, + * but glIsXxx functions still return true. + * - the Deleted status, which is the status of objects on which the suitable + * glDeleteXxx function has been called, and that are not referenced by other + * OpenGL objects. + * + * This state is stored in the mDeletionStatus member of this class. + * + * When the GL refcount hits zero, if the status is DeleteRequested then we call + * the Delete() method on the derived class and the status becomes Deleted. This + * is what the MaybeDelete() function does. + * + * The DeleteOnce() function implemented here is a helper to ensure that we + * don't call Delete() twice on the same object. Since the derived class's + * destructor needs to call DeleteOnce() which calls Delete(), we can't allow + * either to be virtual. Strictly speaking, we could let them be virtual if the + * derived class were final, but that would be impossible to enforce and would + * lead to strange bugs if it were subclassed. + * + * This WebGLRefCountedObject class takes the Derived type as template + * parameter, as a means to allow DeleteOnce to call Delete() on the Derived + * class, without either method being virtual. This is a common C++ pattern + * known as the "curiously recursive template pattern (CRTP)". + */ + +template +class WebGLRefCountedObject : public WebGLDeletableObject +{ + friend class WebGLContext; + template friend void ClearLinkedList(LinkedList& list); + +private: + nsAutoRefCnt mWebGLRefCnt; + +public: + explicit WebGLRefCountedObject(WebGLContext* webgl) + : WebGLDeletableObject(webgl) + { } + + ~WebGLRefCountedObject() { + MOZ_ASSERT(mWebGLRefCnt == 0, + "Destroying WebGL object still referenced by other WebGL" + " objects."); + } + + // called by WebGLRefPtr + void WebGLAddRef() { + ++mWebGLRefCnt; + } + + // called by WebGLRefPtr + void WebGLRelease() { + MOZ_ASSERT(mWebGLRefCnt > 0, + "Releasing WebGL object with WebGL refcnt already zero"); + --mWebGLRefCnt; + MaybeDelete(); + } + + // this is the function that WebGL.deleteXxx() functions want to call + void RequestDelete() { + if (mDeletionStatus == Default) + mDeletionStatus = DeleteRequested; + MaybeDelete(); + } + +protected: + void DeleteOnce() { + if (mDeletionStatus != Deleted) { + static_cast(this)->Delete(); + mDeletionStatus = Deleted; + } + } + +private: + void MaybeDelete() { + if (mWebGLRefCnt == 0 && + mDeletionStatus == DeleteRequested) + { + DeleteOnce(); + } + } +}; + +/* This WebGLRefPtr class is meant to be used for references between WebGL + * objects. For example, a WebGLProgram holds WebGLRefPtr's to the WebGLShader's + * attached to it. + * + * Why the need for a separate refptr class? The only special thing that + * WebGLRefPtr does is that it increments and decrements the WebGL refcount of + * WebGLRefCountedObject's, in addition to incrementing and decrementing the + * usual XPCOM refcount. + * + * This means that by using a WebGLRefPtr instead of a nsRefPtr, you ensure that + * the WebGL refcount is incremented, which means that the object will be kept + * alive by this reference even if the matching webgl.deleteXxx() function is + * called on it. + */ +template +class WebGLRefPtr +{ +public: + WebGLRefPtr() + : mRawPtr(0) + {} + + WebGLRefPtr(const WebGLRefPtr& smartPtr) + : mRawPtr(smartPtr.mRawPtr) + { + AddRefOnPtr(mRawPtr); + } + + explicit WebGLRefPtr(T* rawPtr) + : mRawPtr(rawPtr) + { + AddRefOnPtr(mRawPtr); + } + + ~WebGLRefPtr() { + ReleasePtr(mRawPtr); + } + + WebGLRefPtr& + operator=(const WebGLRefPtr& rhs) + { + assign_with_AddRef(rhs.mRawPtr); + return *this; + } + + WebGLRefPtr& + operator=(T* rhs) + { + assign_with_AddRef(rhs); + return *this; + } + + T* get() const { + return static_cast(mRawPtr); + } + + operator T*() const { + return get(); + } + + T* operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN { + MOZ_ASSERT(mRawPtr != 0, "You can't dereference a nullptr WebGLRefPtr with operator->()!"); + return get(); + } + + T& operator*() const { + MOZ_ASSERT(mRawPtr != 0, "You can't dereference a nullptr WebGLRefPtr with operator*()!"); + return *get(); + } + +private: + + static void AddRefOnPtr(T* rawPtr) { + if (rawPtr) { + rawPtr->WebGLAddRef(); + rawPtr->AddRef(); + } + } + + static void ReleasePtr(T* rawPtr) { + if (rawPtr) { + rawPtr->WebGLRelease(); // must be done first before Release(), as Release() might actually destroy the object + rawPtr->Release(); + } + } + + void assign_with_AddRef(T* rawPtr) { + AddRefOnPtr(rawPtr); + assign_assuming_AddRef(rawPtr); + } + + void assign_assuming_AddRef(T* newPtr) { + T* oldPtr = mRawPtr; + mRawPtr = newPtr; + ReleasePtr(oldPtr); + } + +protected: + T* mRawPtr; +}; + +// this class is a mixin for GL objects that have dimensions +// that we need to track. +class WebGLRectangleObject +{ +public: + WebGLRectangleObject() + : mWidth(0) + , mHeight(0) + {} + + WebGLRectangleObject(GLsizei width, GLsizei height) + : mWidth(width) + , mHeight(height) + {} + + GLsizei Width() const { return mWidth; } + void width(GLsizei value) { mWidth = value; } + + GLsizei Height() const { return mHeight; } + void height(GLsizei value) { mHeight = value; } + + void setDimensions(GLsizei width, GLsizei height) { + mWidth = width; + mHeight = height; + } + + void setDimensions(WebGLRectangleObject* rect) { + if (rect) { + mWidth = rect->Width(); + mHeight = rect->Height(); + } else { + mWidth = 0; + mHeight = 0; + } + } + + bool HasSameDimensionsAs(const WebGLRectangleObject& other) const { + return Width() == other.Width() && Height() == other.Height(); + } + +protected: + GLsizei mWidth; + GLsizei mHeight; +}; + +}// namespace mozilla + +template +inline void +ImplCycleCollectionUnlink(mozilla::WebGLRefPtr& field) +{ + field = nullptr; +} + +template +inline void +ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& callback, + const mozilla::WebGLRefPtr& field, + const char* name, + uint32_t flags = 0) +{ + CycleCollectionNoteChild(callback, field.get(), name, flags); +} + +#endif diff --git a/dom/canvas/WebGLProgram.cpp b/dom/canvas/WebGLProgram.cpp new file mode 100644 index 000000000..fa7997f22 --- /dev/null +++ b/dom/canvas/WebGLProgram.cpp @@ -0,0 +1,1645 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLProgram.h" + +#include "GLContext.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "mozilla/RefPtr.h" +#include "nsPrintfCString.h" +#include "WebGLActiveInfo.h" +#include "WebGLContext.h" +#include "WebGLShader.h" +#include "WebGLTransformFeedback.h" +#include "WebGLUniformLocation.h" +#include "WebGLValidateStrings.h" + +namespace mozilla { + +/* If `name`: "foo[3]" + * Then returns true, with + * `out_baseName`: "foo" + * `out_isArray`: true + * `out_index`: 3 + * + * If `name`: "foo" + * Then returns true, with + * `out_baseName`: "foo" + * `out_isArray`: false + * `out_index`: 0 + */ +static bool +ParseName(const nsCString& name, nsCString* const out_baseName, + bool* const out_isArray, size_t* const out_arrayIndex) +{ + int32_t indexEnd = name.RFind("]"); + if (indexEnd == -1 || + (uint32_t)indexEnd != name.Length() - 1) + { + *out_baseName = name; + *out_isArray = false; + *out_arrayIndex = 0; + return true; + } + + int32_t indexOpenBracket = name.RFind("["); + if (indexOpenBracket == -1) + return false; + + uint32_t indexStart = indexOpenBracket + 1; + uint32_t indexLen = indexEnd - indexStart; + if (indexLen == 0) + return false; + + const nsAutoCString indexStr(Substring(name, indexStart, indexLen)); + + nsresult errorcode; + int32_t indexNum = indexStr.ToInteger(&errorcode); + if (NS_FAILED(errorcode)) + return false; + + if (indexNum < 0) + return false; + + *out_baseName = StringHead(name, indexOpenBracket); + *out_isArray = true; + *out_arrayIndex = indexNum; + return true; +} + +static void +AssembleName(const nsCString& baseName, bool isArray, size_t arrayIndex, + nsCString* const out_name) +{ + *out_name = baseName; + if (isArray) { + out_name->Append('['); + out_name->AppendInt(uint64_t(arrayIndex)); + out_name->Append(']'); + } +} + +//// + +static GLenum +AttribBaseType(GLenum attribType) +{ + switch (attribType) { + case LOCAL_GL_FLOAT: + case LOCAL_GL_FLOAT_VEC2: + case LOCAL_GL_FLOAT_VEC3: + case LOCAL_GL_FLOAT_VEC4: + + case LOCAL_GL_FLOAT_MAT2: + case LOCAL_GL_FLOAT_MAT2x3: + case LOCAL_GL_FLOAT_MAT2x4: + + case LOCAL_GL_FLOAT_MAT3x2: + case LOCAL_GL_FLOAT_MAT3: + case LOCAL_GL_FLOAT_MAT3x4: + + case LOCAL_GL_FLOAT_MAT4x2: + case LOCAL_GL_FLOAT_MAT4x3: + case LOCAL_GL_FLOAT_MAT4: + return LOCAL_GL_FLOAT; + + case LOCAL_GL_INT: + case LOCAL_GL_INT_VEC2: + case LOCAL_GL_INT_VEC3: + case LOCAL_GL_INT_VEC4: + return LOCAL_GL_INT; + + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_UNSIGNED_INT_VEC2: + case LOCAL_GL_UNSIGNED_INT_VEC3: + case LOCAL_GL_UNSIGNED_INT_VEC4: + return LOCAL_GL_UNSIGNED_INT; + + default: + MOZ_ASSERT(false, "unexpected attrib elemType"); + return 0; + } +} + +//// + +/*static*/ const webgl::UniformInfo::TexListT* +webgl::UniformInfo::GetTexList(WebGLActiveInfo* activeInfo) +{ + const auto& webgl = activeInfo->mWebGL; + + switch (activeInfo->mElemType) { + case LOCAL_GL_SAMPLER_2D: + case LOCAL_GL_SAMPLER_2D_SHADOW: + case LOCAL_GL_INT_SAMPLER_2D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D: + return &webgl->mBound2DTextures; + + case LOCAL_GL_SAMPLER_CUBE: + case LOCAL_GL_SAMPLER_CUBE_SHADOW: + case LOCAL_GL_INT_SAMPLER_CUBE: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE: + return &webgl->mBoundCubeMapTextures; + + case LOCAL_GL_SAMPLER_3D: + case LOCAL_GL_INT_SAMPLER_3D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D: + return &webgl->mBound3DTextures; + + case LOCAL_GL_SAMPLER_2D_ARRAY: + case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW: + case LOCAL_GL_INT_SAMPLER_2D_ARRAY: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: + return &webgl->mBound2DArrayTextures; + + default: + return nullptr; + } +} + +webgl::UniformInfo::UniformInfo(WebGLActiveInfo* activeInfo) + : mActiveInfo(activeInfo) + , mSamplerTexList(GetTexList(activeInfo)) +{ + if (mSamplerTexList) { + mSamplerValues.assign(mActiveInfo->mElemCount, 0); + } +} + +////////// + +//#define DUMP_SHADERVAR_MAPPINGS + +static already_AddRefed +QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl) +{ + WebGLContext* const webgl = prog->mContext; + + RefPtr info(new webgl::LinkedProgramInfo(prog)); + + GLuint maxAttribLenWithNull = 0; + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, + (GLint*)&maxAttribLenWithNull); + if (maxAttribLenWithNull < 1) + maxAttribLenWithNull = 1; + + GLuint maxUniformLenWithNull = 0; + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_ACTIVE_UNIFORM_MAX_LENGTH, + (GLint*)&maxUniformLenWithNull); + if (maxUniformLenWithNull < 1) + maxUniformLenWithNull = 1; + + GLuint maxUniformBlockLenWithNull = 0; + if (gl->IsSupported(gl::GLFeature::uniform_buffer_object)) { + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, + (GLint*)&maxUniformBlockLenWithNull); + if (maxUniformBlockLenWithNull < 1) + maxUniformBlockLenWithNull = 1; + } + + GLuint maxTransformFeedbackVaryingLenWithNull = 0; + if (gl->IsSupported(gl::GLFeature::transform_feedback2)) { + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, + (GLint*)&maxTransformFeedbackVaryingLenWithNull); + if (maxTransformFeedbackVaryingLenWithNull < 1) + maxTransformFeedbackVaryingLenWithNull = 1; + } + + // Attribs (can't be arrays) + + GLuint numActiveAttribs = 0; + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_ACTIVE_ATTRIBUTES, + (GLint*)&numActiveAttribs); + + for (GLuint i = 0; i < numActiveAttribs; i++) { + nsAutoCString mappedName; + mappedName.SetLength(maxAttribLenWithNull - 1); + + GLsizei lengthWithoutNull = 0; + GLint elemCount = 0; // `size` + GLenum elemType = 0; // `type` + gl->fGetActiveAttrib(prog->mGLName, i, mappedName.Length()+1, &lengthWithoutNull, + &elemCount, &elemType, mappedName.BeginWriting()); + GLenum error = gl->fGetError(); + if (error != LOCAL_GL_NO_ERROR) { + gfxCriticalNote << "Failed to do glGetActiveAttrib: " << error; + } + + mappedName.SetLength(lengthWithoutNull); + + //// + + nsCString userName; + if (!prog->FindAttribUserNameByMappedName(mappedName, &userName)) { + userName = mappedName; + } + + /////// + + GLint loc = gl->fGetAttribLocation(prog->mGLName, + mappedName.BeginReading()); + if (gl->WorkAroundDriverBugs() && + mappedName.EqualsIgnoreCase("gl_", 3)) + { + // Bug 1328559: Appears problematic on ANGLE and OSX, but not Linux or Win+GL. + loc = -1; + } +#ifdef DUMP_SHADERVAR_MAPPINGS + printf_stderr("[attrib %u/%u] @%i %s->%s\n", i, numActiveAttribs, loc, + userName.BeginReading(), mappedName.BeginReading()); +#endif + MOZ_ASSERT_IF(mappedName.EqualsIgnoreCase("gl_", 3), loc == -1); + + /////// + + const bool isArray = false; + const RefPtr activeInfo = new WebGLActiveInfo(webgl, elemCount, + elemType, isArray, + userName, + mappedName); + const GLenum baseType = AttribBaseType(elemType); + const webgl::AttribInfo attrib = {activeInfo, loc, baseType}; + info->attribs.push_back(attrib); + } + + // Uniforms (can be basically anything) + + const bool needsCheckForArrays = gl->WorkAroundDriverBugs(); + + GLuint numActiveUniforms = 0; + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_ACTIVE_UNIFORMS, + (GLint*)&numActiveUniforms); + + for (GLuint i = 0; i < numActiveUniforms; i++) { + nsAutoCString mappedName; + mappedName.SetLength(maxUniformLenWithNull - 1); + + GLsizei lengthWithoutNull = 0; + GLint elemCount = 0; // `size` + GLenum elemType = 0; // `type` + gl->fGetActiveUniform(prog->mGLName, i, mappedName.Length()+1, &lengthWithoutNull, + &elemCount, &elemType, mappedName.BeginWriting()); + + mappedName.SetLength(lengthWithoutNull); + + /////// + + nsAutoCString baseMappedName; + bool isArray; + size_t arrayIndex; + if (!ParseName(mappedName, &baseMappedName, &isArray, &arrayIndex)) + MOZ_CRASH("GFX: Failed to parse `mappedName` received from driver."); + + // Note that for good drivers, `isArray` should already be correct. + // However, if FindUniform succeeds, it will be validator-guaranteed correct. + + /////// + + nsAutoCString baseUserName; + if (!prog->FindUniformByMappedName(baseMappedName, &baseUserName, &isArray)) { + // Validator likely missing. + baseUserName = baseMappedName; + + if (needsCheckForArrays && !isArray) { + // By GLES 3, GetUniformLocation("foo[0]") should return -1 if `foo` is + // not an array. Our current linux Try slaves return the location of `foo` + // anyways, though. + std::string mappedNameStr = baseMappedName.BeginReading(); + mappedNameStr += "[0]"; + + GLint loc = gl->fGetUniformLocation(prog->mGLName, mappedNameStr.c_str()); + if (loc != -1) + isArray = true; + } + } + + /////// + +#ifdef DUMP_SHADERVAR_MAPPINGS + printf_stderr("[uniform %u/%u] %s->%s\n", i, numActiveUniforms, + baseUserName.BeginReading(), mappedName.BeginReading()); +#endif + + /////// + + const RefPtr activeInfo = new WebGLActiveInfo(webgl, elemCount, + elemType, isArray, + baseUserName, + baseMappedName); + + auto* uniform = new webgl::UniformInfo(activeInfo); + info->uniforms.push_back(uniform); + + if (uniform->mSamplerTexList) { + info->uniformSamplers.push_back(uniform); + } + } + + // Uniform Blocks (can be arrays, but can't contain sampler types) + + if (gl->IsSupported(gl::GLFeature::uniform_buffer_object)) { + GLuint numActiveUniformBlocks = 0; + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_ACTIVE_UNIFORM_BLOCKS, + (GLint*)&numActiveUniformBlocks); + + for (GLuint i = 0; i < numActiveUniformBlocks; i++) { + nsAutoCString mappedName; + mappedName.SetLength(maxUniformBlockLenWithNull - 1); + + GLint lengthWithoutNull; + gl->fGetActiveUniformBlockiv(prog->mGLName, i, LOCAL_GL_UNIFORM_BLOCK_NAME_LENGTH, &lengthWithoutNull); + gl->fGetActiveUniformBlockName(prog->mGLName, i, maxUniformBlockLenWithNull, &lengthWithoutNull, mappedName.BeginWriting()); + mappedName.SetLength(lengthWithoutNull); + + //// + + nsCString userName; + if (!prog->UnmapUniformBlockName(mappedName, &userName)) + continue; + +#ifdef DUMP_SHADERVAR_MAPPINGS + printf_stderr("[uniform block %u/%u] %s->%s\n", i, numActiveUniformBlocks, + userName.BeginReading(), mappedName.BeginReading()); +#endif + + //// + + GLuint dataSize = 0; + gl->fGetActiveUniformBlockiv(prog->mGLName, i, + LOCAL_GL_UNIFORM_BLOCK_DATA_SIZE, + (GLint*)&dataSize); + + + auto* block = new webgl::UniformBlockInfo(webgl, userName, mappedName, + dataSize); + info->uniformBlocks.push_back(block); + } + } + + // Transform feedback varyings (can be arrays) + + if (gl->IsSupported(gl::GLFeature::transform_feedback2)) { + GLuint numTransformFeedbackVaryings = 0; + gl->fGetProgramiv(prog->mGLName, LOCAL_GL_TRANSFORM_FEEDBACK_VARYINGS, + (GLint*)&numTransformFeedbackVaryings); + + for (GLuint i = 0; i < numTransformFeedbackVaryings; i++) { + nsAutoCString mappedName; + mappedName.SetLength(maxTransformFeedbackVaryingLenWithNull - 1); + + GLint lengthWithoutNull; + GLsizei elemCount; + GLenum elemType; + gl->fGetTransformFeedbackVarying(prog->mGLName, i, + maxTransformFeedbackVaryingLenWithNull, + &lengthWithoutNull, &elemCount, &elemType, + mappedName.BeginWriting()); + mappedName.SetLength(lengthWithoutNull); + + //// + + nsAutoCString baseMappedName; + bool isArray; + size_t arrayIndex; + if (!ParseName(mappedName, &baseMappedName, &isArray, &arrayIndex)) + MOZ_CRASH("GFX: Failed to parse `mappedName` received from driver."); + + nsAutoCString baseUserName; + if (!prog->FindVaryingByMappedName(mappedName, &baseUserName, &isArray)) { + baseUserName = baseMappedName; + } + + //// + +#ifdef DUMP_SHADERVAR_MAPPINGS + printf_stderr("[transform feedback varying %u/%u] %s->%s\n", i, + numTransformFeedbackVaryings, baseUserName.BeginReading(), + mappedName.BeginReading()); +#endif + + const RefPtr activeInfo = new WebGLActiveInfo(webgl, + elemCount, + elemType, + isArray, + baseUserName, + mappedName); + info->transformFeedbackVaryings.push_back(activeInfo); + } + } + + // Frag outputs + + prog->EnumerateFragOutputs(info->fragDataMap); + + return info.forget(); +} + +//////////////////////////////////////////////////////////////////////////////// + +webgl::LinkedProgramInfo::LinkedProgramInfo(WebGLProgram* prog) + : prog(prog) + , transformFeedbackBufferMode(prog->mNextLink_TransformFeedbackBufferMode) +{ } + +webgl::LinkedProgramInfo::~LinkedProgramInfo() +{ + for (auto& cur : uniforms) { + delete cur; + } + for (auto& cur : uniformBlocks) { + delete cur; + } +} + +//////////////////////////////////////////////////////////////////////////////// +// WebGLProgram + +static GLuint +CreateProgram(gl::GLContext* gl) +{ + gl->MakeCurrent(); + return gl->fCreateProgram(); +} + +WebGLProgram::WebGLProgram(WebGLContext* webgl) + : WebGLRefCountedObject(webgl) + , mGLName(CreateProgram(webgl->GL())) + , mNumActiveTFOs(0) + , mNextLink_TransformFeedbackBufferMode(LOCAL_GL_INTERLEAVED_ATTRIBS) +{ + mContext->mPrograms.insertBack(this); +} + +WebGLProgram::~WebGLProgram() +{ + DeleteOnce(); +} + +void +WebGLProgram::Delete() +{ + gl::GLContext* gl = mContext->GL(); + + gl->MakeCurrent(); + gl->fDeleteProgram(mGLName); + + mVertShader = nullptr; + mFragShader = nullptr; + + mMostRecentLinkInfo = nullptr; + + LinkedListElement::removeFrom(mContext->mPrograms); +} + +//////////////////////////////////////////////////////////////////////////////// +// GL funcs + +void +WebGLProgram::AttachShader(WebGLShader* shader) +{ + WebGLRefPtr* shaderSlot; + switch (shader->mType) { + case LOCAL_GL_VERTEX_SHADER: + shaderSlot = &mVertShader; + break; + case LOCAL_GL_FRAGMENT_SHADER: + shaderSlot = &mFragShader; + break; + default: + mContext->ErrorInvalidOperation("attachShader: Bad type for shader."); + return; + } + + if (*shaderSlot) { + if (shader == *shaderSlot) { + mContext->ErrorInvalidOperation("attachShader: `shader` is already attached."); + } else { + mContext->ErrorInvalidOperation("attachShader: Only one of each type of" + " shader may be attached to a program."); + } + return; + } + + *shaderSlot = shader; + + mContext->MakeContextCurrent(); + mContext->gl->fAttachShader(mGLName, shader->mGLName); +} + +void +WebGLProgram::BindAttribLocation(GLuint loc, const nsAString& name) +{ + if (!ValidateGLSLVariableName(name, mContext, "bindAttribLocation")) + return; + + if (loc >= mContext->MaxVertexAttribs()) { + mContext->ErrorInvalidValue("bindAttribLocation: `location` must be less than" + " MAX_VERTEX_ATTRIBS."); + return; + } + + if (StringBeginsWith(name, NS_LITERAL_STRING("gl_"))) { + mContext->ErrorInvalidOperation("bindAttribLocation: Can't set the location of a" + " name that starts with 'gl_'."); + return; + } + + NS_LossyConvertUTF16toASCII asciiName(name); + + auto res = mNextLink_BoundAttribLocs.insert({asciiName, loc}); + + const bool wasInserted = res.second; + if (!wasInserted) { + auto itr = res.first; + itr->second = loc; + } +} + +void +WebGLProgram::DetachShader(const WebGLShader* shader) +{ + MOZ_ASSERT(shader); + + WebGLRefPtr* shaderSlot; + switch (shader->mType) { + case LOCAL_GL_VERTEX_SHADER: + shaderSlot = &mVertShader; + break; + case LOCAL_GL_FRAGMENT_SHADER: + shaderSlot = &mFragShader; + break; + default: + mContext->ErrorInvalidOperation("attachShader: Bad type for shader."); + return; + } + + if (*shaderSlot != shader) { + mContext->ErrorInvalidOperation("detachShader: `shader` is not attached."); + return; + } + + *shaderSlot = nullptr; + + mContext->MakeContextCurrent(); + mContext->gl->fDetachShader(mGLName, shader->mGLName); +} + +already_AddRefed +WebGLProgram::GetActiveAttrib(GLuint index) const +{ + if (!mMostRecentLinkInfo) { + RefPtr ret = WebGLActiveInfo::CreateInvalid(mContext); + return ret.forget(); + } + + const auto& attribs = mMostRecentLinkInfo->attribs; + + if (index >= attribs.size()) { + mContext->ErrorInvalidValue("`index` (%i) must be less than %s (%i).", + index, "ACTIVE_ATTRIBS", attribs.size()); + return nullptr; + } + + RefPtr ret = attribs[index].mActiveInfo; + return ret.forget(); +} + +already_AddRefed +WebGLProgram::GetActiveUniform(GLuint index) const +{ + if (!mMostRecentLinkInfo) { + // According to the spec, this can return null. + RefPtr ret = WebGLActiveInfo::CreateInvalid(mContext); + return ret.forget(); + } + + const auto& uniforms = mMostRecentLinkInfo->uniforms; + + if (index >= uniforms.size()) { + mContext->ErrorInvalidValue("`index` (%i) must be less than %s (%i).", + index, "ACTIVE_UNIFORMS", uniforms.size()); + return nullptr; + } + + RefPtr ret = uniforms[index]->mActiveInfo; + return ret.forget(); +} + +void +WebGLProgram::GetAttachedShaders(nsTArray>* const out) const +{ + out->TruncateLength(0); + + if (mVertShader) + out->AppendElement(mVertShader); + + if (mFragShader) + out->AppendElement(mFragShader); +} + +GLint +WebGLProgram::GetAttribLocation(const nsAString& userName_wide) const +{ + if (!ValidateGLSLVariableName(userName_wide, mContext, "getAttribLocation")) + return -1; + + if (!IsLinked()) { + mContext->ErrorInvalidOperation("getAttribLocation: `program` must be linked."); + return -1; + } + + const NS_LossyConvertUTF16toASCII userName(userName_wide); + + const webgl::AttribInfo* info; + if (!LinkInfo()->FindAttrib(userName, &info)) + return -1; + + return GLint(info->mLoc); +} + +static GLint +GetFragDataByUserName(const WebGLProgram* prog, + const nsCString& userName) +{ + nsCString mappedName; + if (!prog->LinkInfo()->MapFragDataName(userName, &mappedName)) + return -1; + + return prog->mContext->gl->fGetFragDataLocation(prog->mGLName, mappedName.BeginReading()); +} + +GLint +WebGLProgram::GetFragDataLocation(const nsAString& userName_wide) const +{ + if (!ValidateGLSLVariableName(userName_wide, mContext, "getFragDataLocation")) + return -1; + + if (!IsLinked()) { + mContext->ErrorInvalidOperation("getFragDataLocation: `program` must be linked."); + return -1; + } + + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + + const NS_LossyConvertUTF16toASCII userName(userName_wide); +#ifdef XP_MACOSX + if (gl->WorkAroundDriverBugs()) { + // OSX doesn't return locs for indexed names, just the base names. + // Indicated by failure in: conformance2/programs/gl-get-frag-data-location.html + bool isArray; + size_t arrayIndex; + nsCString baseUserName; + if (!ParseName(userName, &baseUserName, &isArray, &arrayIndex)) + return -1; + + if (arrayIndex >= mContext->mImplMaxDrawBuffers) + return -1; + + const auto baseLoc = GetFragDataByUserName(this, baseUserName); + const auto loc = baseLoc + GLint(arrayIndex); + return loc; + } +#endif + return GetFragDataByUserName(this, userName); +} + +void +WebGLProgram::GetProgramInfoLog(nsAString* const out) const +{ + CopyASCIItoUTF16(mLinkLog, *out); +} + +static GLint +GetProgramiv(gl::GLContext* gl, GLuint program, GLenum pname) +{ + GLint ret = 0; + gl->fGetProgramiv(program, pname, &ret); + return ret; +} + +JS::Value +WebGLProgram::GetProgramParameter(GLenum pname) const +{ + gl::GLContext* gl = mContext->gl; + gl->MakeCurrent(); + + if (mContext->IsWebGL2()) { + switch (pname) { + case LOCAL_GL_ACTIVE_UNIFORM_BLOCKS: + if (!IsLinked()) + return JS::NumberValue(0); + return JS::NumberValue(LinkInfo()->uniformBlocks.size()); + + case LOCAL_GL_TRANSFORM_FEEDBACK_VARYINGS: + if (!IsLinked()) + return JS::NumberValue(0); + return JS::NumberValue(LinkInfo()->transformFeedbackVaryings.size()); + + case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_MODE: + if (!IsLinked()) + return JS::NumberValue(LOCAL_GL_INTERLEAVED_ATTRIBS); + return JS::NumberValue(LinkInfo()->transformFeedbackBufferMode); + } + } + + switch (pname) { + case LOCAL_GL_ATTACHED_SHADERS: + return JS::NumberValue( int(bool(mVertShader.get())) + int(bool(mFragShader)) ); + + case LOCAL_GL_ACTIVE_UNIFORMS: + if (!IsLinked()) + return JS::NumberValue(0); + return JS::NumberValue(LinkInfo()->uniforms.size()); + + case LOCAL_GL_ACTIVE_ATTRIBUTES: + if (!IsLinked()) + return JS::NumberValue(0); + return JS::NumberValue(LinkInfo()->attribs.size()); + + case LOCAL_GL_DELETE_STATUS: + return JS::BooleanValue(IsDeleteRequested()); + + case LOCAL_GL_LINK_STATUS: + return JS::BooleanValue(IsLinked()); + + case LOCAL_GL_VALIDATE_STATUS: +#ifdef XP_MACOSX + // See comment in ValidateProgram. + if (gl->WorkAroundDriverBugs()) + return JS::BooleanValue(true); +#endif + // Todo: Implement this in our code. + return JS::BooleanValue(bool(GetProgramiv(gl, mGLName, pname))); + + default: + mContext->ErrorInvalidEnumInfo("getProgramParameter: `pname`", + pname); + return JS::NullValue(); + } +} + +GLuint +WebGLProgram::GetUniformBlockIndex(const nsAString& userName_wide) const +{ + if (!ValidateGLSLVariableName(userName_wide, mContext, "getUniformBlockIndex")) + return LOCAL_GL_INVALID_INDEX; + + if (!IsLinked()) { + mContext->ErrorInvalidOperation("getUniformBlockIndex: `program` must be linked."); + return LOCAL_GL_INVALID_INDEX; + } + + const NS_LossyConvertUTF16toASCII userName(userName_wide); + + const webgl::UniformBlockInfo* info = nullptr; + for (const auto& cur : LinkInfo()->uniformBlocks) { + if (cur->mUserName == userName) { + info = cur; + break; + } + } + if (!info) + return LOCAL_GL_INVALID_INDEX; + + const auto& mappedName = info->mMappedName; + + gl::GLContext* gl = mContext->GL(); + gl->MakeCurrent(); + return gl->fGetUniformBlockIndex(mGLName, mappedName.BeginReading()); +} + +void +WebGLProgram::GetActiveUniformBlockName(GLuint uniformBlockIndex, nsAString& retval) const +{ + if (!IsLinked()) { + mContext->ErrorInvalidOperation("getActiveUniformBlockName: `program` must be linked."); + return; + } + + const webgl::LinkedProgramInfo* linkInfo = LinkInfo(); + GLuint uniformBlockCount = (GLuint) linkInfo->uniformBlocks.size(); + if (uniformBlockIndex >= uniformBlockCount) { + mContext->ErrorInvalidValue("getActiveUniformBlockName: index %u invalid.", uniformBlockIndex); + return; + } + + const auto& blockInfo = linkInfo->uniformBlocks[uniformBlockIndex]; + retval.Assign(NS_ConvertASCIItoUTF16(blockInfo->mUserName)); +} + +JS::Value +WebGLProgram::GetActiveUniformBlockParam(GLuint uniformBlockIndex, GLenum pname) const +{ + if (!IsLinked()) { + mContext->ErrorInvalidOperation("getActiveUniformBlockParameter: `program` must be linked."); + return JS::NullValue(); + } + + const webgl::LinkedProgramInfo* linkInfo = LinkInfo(); + GLuint uniformBlockCount = (GLuint)linkInfo->uniformBlocks.size(); + if (uniformBlockIndex >= uniformBlockCount) { + mContext->ErrorInvalidValue("getActiveUniformBlockParameter: index %u invalid.", uniformBlockIndex); + return JS::NullValue(); + } + + gl::GLContext* gl = mContext->GL(); + GLint param = 0; + + switch (pname) { + case LOCAL_GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: + case LOCAL_GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: + gl->fGetActiveUniformBlockiv(mGLName, uniformBlockIndex, pname, ¶m); + return JS::BooleanValue(bool(param)); + + case LOCAL_GL_UNIFORM_BLOCK_BINDING: + case LOCAL_GL_UNIFORM_BLOCK_DATA_SIZE: + case LOCAL_GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: + gl->fGetActiveUniformBlockiv(mGLName, uniformBlockIndex, pname, ¶m); + return JS::NumberValue(param); + + default: + MOZ_CRASH("bad `pname`."); + } +} + +JS::Value +WebGLProgram::GetActiveUniformBlockActiveUniforms(JSContext* cx, GLuint uniformBlockIndex, + ErrorResult* const out_error) const +{ + const char funcName[] = "getActiveUniformBlockParameter"; + if (!IsLinked()) { + mContext->ErrorInvalidOperation("%s: `program` must be linked.", funcName); + return JS::NullValue(); + } + + const webgl::LinkedProgramInfo* linkInfo = LinkInfo(); + GLuint uniformBlockCount = (GLuint)linkInfo->uniformBlocks.size(); + if (uniformBlockIndex >= uniformBlockCount) { + mContext->ErrorInvalidValue("%s: Index %u invalid.", funcName, uniformBlockIndex); + return JS::NullValue(); + } + + gl::GLContext* gl = mContext->GL(); + GLint activeUniformCount = 0; + gl->fGetActiveUniformBlockiv(mGLName, uniformBlockIndex, + LOCAL_GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, + &activeUniformCount); + JS::RootedObject obj(cx, dom::Uint32Array::Create(cx, mContext, activeUniformCount, + nullptr)); + if (!obj) { + *out_error = NS_ERROR_OUT_OF_MEMORY; + return JS::NullValue(); + } + + dom::Uint32Array result; + DebugOnly inited = result.Init(obj); + MOZ_ASSERT(inited); + result.ComputeLengthAndData(); + gl->fGetActiveUniformBlockiv(mGLName, uniformBlockIndex, + LOCAL_GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, + (GLint*)result.Data()); + + return JS::ObjectValue(*obj); +} + +already_AddRefed +WebGLProgram::GetUniformLocation(const nsAString& userName_wide) const +{ + if (!ValidateGLSLVariableName(userName_wide, mContext, "getUniformLocation")) + return nullptr; + + if (!IsLinked()) { + mContext->ErrorInvalidOperation("getUniformLocation: `program` must be linked."); + return nullptr; + } + + const NS_LossyConvertUTF16toASCII userName(userName_wide); + + // GLES 2.0.25, Section 2.10, p35 + // If the the uniform location is an array, then the location of the first + // element of that array can be retrieved by either using the name of the + // uniform array, or the name of the uniform array appended with "[0]". + nsCString mappedName; + size_t arrayIndex; + webgl::UniformInfo* info; + if (!LinkInfo()->FindUniform(userName, &mappedName, &arrayIndex, &info)) + return nullptr; + + gl::GLContext* gl = mContext->GL(); + gl->MakeCurrent(); + + GLint loc = gl->fGetUniformLocation(mGLName, mappedName.BeginReading()); + if (loc == -1) + return nullptr; + + RefPtr locObj = new WebGLUniformLocation(mContext, LinkInfo(), + info, loc, arrayIndex); + return locObj.forget(); +} + +void +WebGLProgram::GetUniformIndices(const dom::Sequence& uniformNames, + dom::Nullable< nsTArray >& retval) const +{ + const char funcName[] = "getUniformIndices"; + if (!IsLinked()) { + mContext->ErrorInvalidOperation("%s: `program` must be linked.", funcName); + return; + } + + size_t count = uniformNames.Length(); + nsTArray& arr = retval.SetValue(); + + gl::GLContext* gl = mContext->GL(); + gl->MakeCurrent(); + + for (size_t i = 0; i < count; i++) { + const NS_LossyConvertUTF16toASCII userName(uniformNames[i]); + + nsCString mappedName; + size_t arrayIndex; + webgl::UniformInfo* info; + if (!LinkInfo()->FindUniform(userName, &mappedName, &arrayIndex, &info)) { + arr.AppendElement(LOCAL_GL_INVALID_INDEX); + continue; + } + + const GLchar* const mappedNameBegin = mappedName.get(); + + GLuint index = LOCAL_GL_INVALID_INDEX; + gl->fGetUniformIndices(mGLName, 1, &mappedNameBegin, &index); + arr.AppendElement(index); + } +} + +void +WebGLProgram::UniformBlockBinding(GLuint uniformBlockIndex, + GLuint uniformBlockBinding) const +{ + const char funcName[] = "getActiveUniformBlockName"; + if (!IsLinked()) { + mContext->ErrorInvalidOperation("%s: `program` must be linked.", funcName); + return; + } + + const auto& uniformBlocks = LinkInfo()->uniformBlocks; + if (uniformBlockIndex >= uniformBlocks.size()) { + mContext->ErrorInvalidValue("%s: Index %u invalid.", funcName, uniformBlockIndex); + return; + } + const auto& uniformBlock = uniformBlocks[uniformBlockIndex]; + + const auto& indexedBindings = mContext->mIndexedUniformBufferBindings; + if (uniformBlockBinding >= indexedBindings.size()) { + mContext->ErrorInvalidValue("%s: Binding %u invalid.", funcName, + uniformBlockBinding); + return; + } + const auto& indexedBinding = indexedBindings[uniformBlockBinding]; + + //// + + gl::GLContext* gl = mContext->GL(); + gl->MakeCurrent(); + gl->fUniformBlockBinding(mGLName, uniformBlockIndex, uniformBlockBinding); + + //// + + uniformBlock->mBinding = &indexedBinding; +} + +bool +WebGLProgram::ValidateForLink() +{ + if (!mVertShader || !mVertShader->IsCompiled()) { + mLinkLog.AssignLiteral("Must have a compiled vertex shader attached."); + return false; + } + + if (!mFragShader || !mFragShader->IsCompiled()) { + mLinkLog.AssignLiteral("Must have an compiled fragment shader attached."); + return false; + } + + if (!mFragShader->CanLinkTo(mVertShader, &mLinkLog)) + return false; + + const auto& gl = mContext->gl; + + if (gl->WorkAroundDriverBugs() && + mContext->mIsMesa) + { + // Bug 777028: Mesa can't handle more than 16 samplers per program, + // counting each array entry. + size_t numSamplerUniforms_upperBound = mVertShader->CalcNumSamplerUniforms() + + mFragShader->CalcNumSamplerUniforms(); + if (numSamplerUniforms_upperBound > 16) { + mLinkLog.AssignLiteral("Programs with more than 16 samplers are disallowed on" + " Mesa drivers to avoid crashing."); + return false; + } + + // Bug 1203135: Mesa crashes internally if we exceed the reported maximum attribute count. + if (mVertShader->NumAttributes() > mContext->MaxVertexAttribs()) { + mLinkLog.AssignLiteral("Number of attributes exceeds Mesa's reported max" + " attribute count."); + return false; + } + } + + return true; +} + +void +WebGLProgram::LinkProgram() +{ + const char funcName[] = "linkProgram"; + + if (mNumActiveTFOs) { + mContext->ErrorInvalidOperation("%s: Program is in-use by one or more active" + " transform feedback objects.", + funcName); + return; + } + + mContext->MakeContextCurrent(); + mContext->InvalidateBufferFetching(); // we do it early in this function + // as some of the validation changes program state + + mLinkLog.Truncate(); + mMostRecentLinkInfo = nullptr; + + if (!ValidateForLink()) { + mContext->GenerateWarning("%s: %s", funcName, mLinkLog.BeginReading()); + return; + } + + // Bind the attrib locations. + // This can't be done trivially, because we have to deal with mapped attrib names. + for (const auto& pair : mNextLink_BoundAttribLocs) { + const auto& name = pair.first; + const auto& index = pair.second; + + mVertShader->BindAttribLocation(mGLName, name, index); + } + + // Storage for transform feedback varyings before link. + // (Work around for bug seen on nVidia drivers.) + std::vector scopedMappedTFVaryings; + + if (mContext->IsWebGL2()) { + mVertShader->MapTransformFeedbackVaryings(mNextLink_TransformFeedbackVaryings, + &scopedMappedTFVaryings); + + std::vector driverVaryings; + driverVaryings.reserve(scopedMappedTFVaryings.size()); + for (const auto& cur : scopedMappedTFVaryings) { + driverVaryings.push_back(cur.c_str()); + } + + mContext->gl->fTransformFeedbackVaryings(mGLName, driverVaryings.size(), + driverVaryings.data(), + mNextLink_TransformFeedbackBufferMode); + } + + LinkAndUpdate(); + + if (mMostRecentLinkInfo) { + nsCString postLinkLog; + if (ValidateAfterTentativeLink(&postLinkLog)) + return; + + mMostRecentLinkInfo = nullptr; + mLinkLog = postLinkLog; + } + + // Failed link. + if (mContext->ShouldGenerateWarnings()) { + // report shader/program infoLogs as warnings. + // note that shader compilation errors can be deferred to linkProgram, + // which is why we can't do anything in compileShader. In practice we could + // report in compileShader the translation errors generated by ANGLE, + // but it seems saner to keep a single way of obtaining shader infologs. + if (!mLinkLog.IsEmpty()) { + mContext->GenerateWarning("linkProgram: Failed to link, leaving the following" + " log:\n%s\n", + mLinkLog.BeginReading()); + } + } +} + +static uint8_t +NumUsedLocationsByElemType(GLenum elemType) +{ + // GLES 3.0.4 p55 + + switch (elemType) { + case LOCAL_GL_FLOAT_MAT2: + case LOCAL_GL_FLOAT_MAT2x3: + case LOCAL_GL_FLOAT_MAT2x4: + return 2; + + case LOCAL_GL_FLOAT_MAT3x2: + case LOCAL_GL_FLOAT_MAT3: + case LOCAL_GL_FLOAT_MAT3x4: + return 3; + + case LOCAL_GL_FLOAT_MAT4x2: + case LOCAL_GL_FLOAT_MAT4x3: + case LOCAL_GL_FLOAT_MAT4: + return 4; + + default: + return 1; + } +} + +static uint8_t +NumComponents(GLenum elemType) +{ + switch (elemType) { + case LOCAL_GL_FLOAT: + case LOCAL_GL_INT: + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_BOOL: + return 1; + + case LOCAL_GL_FLOAT_VEC2: + case LOCAL_GL_INT_VEC2: + case LOCAL_GL_UNSIGNED_INT_VEC2: + case LOCAL_GL_BOOL_VEC2: + return 2; + + case LOCAL_GL_FLOAT_VEC3: + case LOCAL_GL_INT_VEC3: + case LOCAL_GL_UNSIGNED_INT_VEC3: + case LOCAL_GL_BOOL_VEC3: + return 3; + + case LOCAL_GL_FLOAT_VEC4: + case LOCAL_GL_INT_VEC4: + case LOCAL_GL_UNSIGNED_INT_VEC4: + case LOCAL_GL_BOOL_VEC4: + case LOCAL_GL_FLOAT_MAT2: + return 4; + + case LOCAL_GL_FLOAT_MAT2x3: + case LOCAL_GL_FLOAT_MAT3x2: + return 6; + + case LOCAL_GL_FLOAT_MAT2x4: + case LOCAL_GL_FLOAT_MAT4x2: + return 8; + + case LOCAL_GL_FLOAT_MAT3: + return 9; + + case LOCAL_GL_FLOAT_MAT3x4: + case LOCAL_GL_FLOAT_MAT4x3: + return 12; + + case LOCAL_GL_FLOAT_MAT4: + return 16; + + default: + MOZ_CRASH("`elemType`"); + } +} + +bool +WebGLProgram::ValidateAfterTentativeLink(nsCString* const out_linkLog) const +{ + const auto& linkInfo = mMostRecentLinkInfo; + const auto& gl = mContext->gl; + + // Check if the attrib name conflicting to uniform name + for (const auto& attrib : linkInfo->attribs) { + const auto& attribName = attrib.mActiveInfo->mBaseUserName; + + for (const auto& uniform : linkInfo->uniforms) { + const auto& uniformName = uniform->mActiveInfo->mBaseUserName; + if (attribName == uniformName) { + *out_linkLog = nsPrintfCString("Attrib name conflicts with uniform name:" + " %s", + attribName.BeginReading()); + return false; + } + } + } + + std::map attribsByLoc; + for (const auto& attrib : linkInfo->attribs) { + if (attrib.mLoc == -1) + continue; + + const auto& elemType = attrib.mActiveInfo->mElemType; + const auto numUsedLocs = NumUsedLocationsByElemType(elemType); + for (uint32_t i = 0; i < numUsedLocs; i++) { + const uint32_t usedLoc = attrib.mLoc + i; + + const auto res = attribsByLoc.insert({usedLoc, &attrib}); + const bool& didInsert = res.second; + if (!didInsert) { + const auto& aliasingName = attrib.mActiveInfo->mBaseUserName; + const auto& itrExisting = res.first; + const auto& existingInfo = itrExisting->second; + const auto& existingName = existingInfo->mActiveInfo->mBaseUserName; + *out_linkLog = nsPrintfCString("Attrib \"%s\" aliases locations used by" + " attrib \"%s\".", + aliasingName.BeginReading(), + existingName.BeginReading()); + return false; + } + } + } + + // Forbid: + // * Unrecognized varying name + // * Duplicate varying name + // * Too many components for specified buffer mode + if (mNextLink_TransformFeedbackVaryings.size()) { + GLuint maxComponentsPerIndex = 0; + switch (mNextLink_TransformFeedbackBufferMode) { + case LOCAL_GL_INTERLEAVED_ATTRIBS: + gl->GetUIntegerv(LOCAL_GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, + &maxComponentsPerIndex); + break; + + case LOCAL_GL_SEPARATE_ATTRIBS: + gl->GetUIntegerv(LOCAL_GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, + &maxComponentsPerIndex); + break; + + default: + MOZ_CRASH("`bufferMode`"); + } + + std::vector componentsPerVert; + std::set alreadyUsed; + for (const auto& wideUserName : mNextLink_TransformFeedbackVaryings) { + if (!componentsPerVert.size() || + mNextLink_TransformFeedbackBufferMode == LOCAL_GL_SEPARATE_ATTRIBS) + { + componentsPerVert.push_back(0); + } + + //// + + const WebGLActiveInfo* curInfo = nullptr; + for (const auto& info : linkInfo->transformFeedbackVaryings) { + const NS_ConvertASCIItoUTF16 info_wideUserName(info->mBaseUserName); + if (info_wideUserName == wideUserName) { + curInfo = info.get(); + break; + } + } + + if (!curInfo) { + const NS_LossyConvertUTF16toASCII asciiUserName(wideUserName); + *out_linkLog = nsPrintfCString("Transform feedback varying \"%s\" not" + " found.", + asciiUserName.BeginReading()); + return false; + } + + const auto insertResPair = alreadyUsed.insert(curInfo); + const auto& didInsert = insertResPair.second; + if (!didInsert) { + const NS_LossyConvertUTF16toASCII asciiUserName(wideUserName); + *out_linkLog = nsPrintfCString("Transform feedback varying \"%s\"" + " specified twice.", + asciiUserName.BeginReading()); + return false; + } + + //// + + size_t varyingComponents = NumComponents(curInfo->mElemType); + varyingComponents *= curInfo->mElemCount; + + auto& totalComponentsForIndex = *(componentsPerVert.rbegin()); + totalComponentsForIndex += varyingComponents; + + if (totalComponentsForIndex > maxComponentsPerIndex) { + const NS_LossyConvertUTF16toASCII asciiUserName(wideUserName); + *out_linkLog = nsPrintfCString("Transform feedback varying \"%s\"" + " pushed `componentsForIndex` over the" + " limit of %u.", + asciiUserName.BeginReading(), + maxComponentsPerIndex); + return false; + } + } + + linkInfo->componentsPerTFVert.swap(componentsPerVert); + } + + return true; +} + +bool +WebGLProgram::UseProgram() const +{ + const char funcName[] = "useProgram"; + + if (!mMostRecentLinkInfo) { + mContext->ErrorInvalidOperation("%s: Program has not been successfully linked.", + funcName); + return false; + } + + if (mContext->mBoundTransformFeedback && + mContext->mBoundTransformFeedback->mIsActive && + !mContext->mBoundTransformFeedback->mIsPaused) + { + mContext->ErrorInvalidOperation("%s: Transform feedback active and not paused.", + funcName); + return false; + } + + mContext->MakeContextCurrent(); + + mContext->InvalidateBufferFetching(); + + mContext->gl->fUseProgram(mGLName); + return true; +} + +void +WebGLProgram::ValidateProgram() const +{ + mContext->MakeContextCurrent(); + gl::GLContext* gl = mContext->gl; + +#ifdef XP_MACOSX + // See bug 593867 for NVIDIA and bug 657201 for ATI. The latter is confirmed + // with Mac OS 10.6.7. + if (gl->WorkAroundDriverBugs()) { + mContext->GenerateWarning("validateProgram: Implemented as a no-op on" + " Mac to work around crashes."); + return; + } +#endif + + gl->fValidateProgram(mGLName); +} + + +//////////////////////////////////////////////////////////////////////////////// + +void +WebGLProgram::LinkAndUpdate() +{ + mMostRecentLinkInfo = nullptr; + + gl::GLContext* gl = mContext->gl; + gl->fLinkProgram(mGLName); + + // Grab the program log. + GLuint logLenWithNull = 0; + gl->fGetProgramiv(mGLName, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&logLenWithNull); + if (logLenWithNull > 1) { + mLinkLog.SetLength(logLenWithNull - 1); + gl->fGetProgramInfoLog(mGLName, logLenWithNull, nullptr, mLinkLog.BeginWriting()); + } else { + mLinkLog.SetLength(0); + } + + GLint ok = 0; + gl->fGetProgramiv(mGLName, LOCAL_GL_LINK_STATUS, &ok); + if (!ok) + return; + + mMostRecentLinkInfo = QueryProgramInfo(this, gl); + MOZ_RELEASE_ASSERT(mMostRecentLinkInfo, "GFX: most recent link info not set."); +} + +bool +WebGLProgram::FindAttribUserNameByMappedName(const nsACString& mappedName, + nsCString* const out_userName) const +{ + if (mVertShader->FindAttribUserNameByMappedName(mappedName, out_userName)) + return true; + + return false; +} + +bool +WebGLProgram::FindVaryingByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const +{ + if (mVertShader->FindVaryingByMappedName(mappedName, out_userName, out_isArray)) + return true; + + return false; +} + + +bool +WebGLProgram::FindUniformByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const +{ + if (mVertShader->FindUniformByMappedName(mappedName, out_userName, out_isArray)) + return true; + + if (mFragShader->FindUniformByMappedName(mappedName, out_userName, out_isArray)) + return true; + + return false; +} + +void +WebGLProgram::TransformFeedbackVaryings(const dom::Sequence& varyings, + GLenum bufferMode) +{ + const char funcName[] = "transformFeedbackVaryings"; + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + + switch (bufferMode) { + case LOCAL_GL_INTERLEAVED_ATTRIBS: + break; + + case LOCAL_GL_SEPARATE_ATTRIBS: + { + GLuint maxAttribs = 0; + gl->GetUIntegerv(LOCAL_GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, + &maxAttribs); + if (varyings.Length() > maxAttribs) { + mContext->ErrorInvalidValue("%s: Length of `varyings` exceeds %s.", + funcName, + "TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS"); + return; + } + } + break; + + default: + mContext->ErrorInvalidEnum("%s: Bad `bufferMode`: 0x%04x.", funcName, bufferMode); + return; + } + + //// + + mNextLink_TransformFeedbackVaryings.assign(varyings.Elements(), + varyings.Elements() + varyings.Length()); + mNextLink_TransformFeedbackBufferMode = bufferMode; +} + +already_AddRefed +WebGLProgram::GetTransformFeedbackVarying(GLuint index) const +{ + // No docs in the WebGL 2 spec for this function. Taking the language for + // getActiveAttrib, which states that the function returns null on any error. + if (!IsLinked()) { + mContext->ErrorInvalidOperation("getTransformFeedbackVarying: `program` must be " + "linked."); + return nullptr; + } + + if (index >= LinkInfo()->transformFeedbackVaryings.size()) { + mContext->ErrorInvalidValue("getTransformFeedbackVarying: `index` is greater or " + "equal to TRANSFORM_FEEDBACK_VARYINGS."); + return nullptr; + } + + RefPtr ret = LinkInfo()->transformFeedbackVaryings[index]; + return ret.forget(); +} + +bool +WebGLProgram::UnmapUniformBlockName(const nsCString& mappedName, + nsCString* const out_userName) const +{ + nsCString baseMappedName; + bool isArray; + size_t arrayIndex; + if (!ParseName(mappedName, &baseMappedName, &isArray, &arrayIndex)) + return false; + + nsCString baseUserName; + if (!mVertShader->UnmapUniformBlockName(baseMappedName, &baseUserName) && + !mFragShader->UnmapUniformBlockName(baseMappedName, &baseUserName)) + { + return false; + } + + AssembleName(baseUserName, isArray, arrayIndex, out_userName); + return true; +} + +void +WebGLProgram::EnumerateFragOutputs(std::map &out_FragOutputs) const +{ + MOZ_ASSERT(mFragShader); + + mFragShader->EnumerateFragOutputs(out_FragOutputs); +} + +//////////////////////////////////////////////////////////////////////////////// + +bool +IsBaseName(const nsCString& name) +{ + if (!name.Length()) + return true; + + return name[name.Length() - 1] != ']'; // Doesn't end in ']'. +} + +bool +webgl::LinkedProgramInfo::FindAttrib(const nsCString& userName, + const webgl::AttribInfo** const out) const +{ + // VS inputs cannot be arrays or structures. + // `userName` is thus always `baseUserName`. + for (const auto& attrib : attribs) { + if (attrib.mActiveInfo->mBaseUserName == userName) { + *out = &attrib; + return true; + } + } + + return false; +} + +bool +webgl::LinkedProgramInfo::FindUniform(const nsCString& userName, + nsCString* const out_mappedName, + size_t* const out_arrayIndex, + webgl::UniformInfo** const out_info) const +{ + nsCString baseUserName; + bool isArray; + size_t arrayIndex; + if (!ParseName(userName, &baseUserName, &isArray, &arrayIndex)) + return false; + + webgl::UniformInfo* info = nullptr; + for (const auto& uniform : uniforms) { + if (uniform->mActiveInfo->mBaseUserName == baseUserName) { + info = uniform; + break; + } + } + if (!info) + return false; + + const auto& baseMappedName = info->mActiveInfo->mBaseMappedName; + AssembleName(baseMappedName, isArray, arrayIndex, out_mappedName); + + *out_arrayIndex = arrayIndex; + *out_info = info; + return true; +} + +bool +webgl::LinkedProgramInfo::MapFragDataName(const nsCString& userName, + nsCString* const out_mappedName) const +{ + // FS outputs can be arrays, but not structures. + + if (!fragDataMap.size()) { + // No mappings map from validation, so just forward it. + *out_mappedName = userName; + return true; + } + + nsCString baseUserName; + bool isArray; + size_t arrayIndex; + if (!ParseName(userName, &baseUserName, &isArray, &arrayIndex)) + return false; + + const auto itr = fragDataMap.find(baseUserName); + if (itr == fragDataMap.end()) + return false; + + const auto& baseMappedName = itr->second; + AssembleName(baseMappedName, isArray, arrayIndex, out_mappedName); + return true; +} + +//////////////////////////////////////////////////////////////////////////////// + +JSObject* +WebGLProgram::WrapObject(JSContext* js, JS::Handle givenProto) +{ + return dom::WebGLProgramBinding::Wrap(js, this, givenProto); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebGLProgram, mVertShader, mFragShader) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLProgram, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLProgram, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLProgram.h b/dom/canvas/WebGLProgram.h new file mode 100644 index 000000000..0f08d3df3 --- /dev/null +++ b/dom/canvas/WebGLProgram.h @@ -0,0 +1,217 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_PROGRAM_H_ +#define WEBGL_PROGRAM_H_ + +#include +#include +#include +#include + +#include "mozilla/LinkedList.h" +#include "mozilla/RefPtr.h" +#include "mozilla/WeakPtr.h" +#include "nsString.h" +#include "nsWrapperCache.h" + +#include "WebGLContext.h" +#include "WebGLObjectModel.h" + +namespace mozilla { +class ErrorResult; +class WebGLActiveInfo; +class WebGLProgram; +class WebGLShader; +class WebGLUniformLocation; + +namespace dom { +template struct Nullable; +class OwningUnsignedLongOrUint32ArrayOrBoolean; +template class Sequence; +} // namespace dom + +namespace webgl { + +struct AttribInfo final +{ + const RefPtr mActiveInfo; + const GLint mLoc; // -1 for active built-ins + const GLenum mBaseType; +}; + +struct UniformInfo final +{ + typedef decltype(WebGLContext::mBound2DTextures) TexListT; + + const RefPtr mActiveInfo; + const TexListT* const mSamplerTexList; + std::vector mSamplerValues; + +protected: + static const TexListT* + GetTexList(WebGLActiveInfo* activeInfo); + +public: + explicit UniformInfo(WebGLActiveInfo* activeInfo); +}; + +struct UniformBlockInfo final +{ + const nsCString mUserName; + const nsCString mMappedName; + const uint32_t mDataSize; + + const IndexedBufferBinding* mBinding; + + UniformBlockInfo(WebGLContext* webgl, const nsACString& userName, + const nsACString& mappedName, uint32_t dataSize) + : mUserName(userName) + , mMappedName(mappedName) + , mDataSize(dataSize) + , mBinding(&webgl->mIndexedUniformBufferBindings[0]) + { } +}; + +struct LinkedProgramInfo final + : public RefCounted + , public SupportsWeakPtr +{ + friend class WebGLProgram; + + MOZ_DECLARE_REFCOUNTED_TYPENAME(LinkedProgramInfo) + MOZ_DECLARE_WEAKREFERENCE_TYPENAME(LinkedProgramInfo) + + ////// + + WebGLProgram* const prog; + const GLenum transformFeedbackBufferMode; + + std::vector attribs; + std::vector uniforms; // Owns its contents. + std::vector uniformBlocks; // Owns its contents. + std::vector> transformFeedbackVaryings; + + // Needed for draw call validation. + std::vector uniformSamplers; + + mutable std::vector componentsPerTFVert; + + ////// + + // The maps for the frag data names to the translated names. + std::map fragDataMap; + + explicit LinkedProgramInfo(WebGLProgram* prog); + ~LinkedProgramInfo(); + + bool FindAttrib(const nsCString& userName, const AttribInfo** const out_info) const; + bool FindUniform(const nsCString& userName, nsCString* const out_mappedName, + size_t* const out_arrayIndex, UniformInfo** const out_info) const; + bool MapFragDataName(const nsCString& userName, + nsCString* const out_mappedName) const; +}; + +} // namespace webgl + +class WebGLProgram final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + friend class WebGLTransformFeedback; + friend struct webgl::LinkedProgramInfo; + +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLProgram) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLProgram) + + explicit WebGLProgram(WebGLContext* webgl); + + void Delete(); + + // GL funcs + void AttachShader(WebGLShader* shader); + void BindAttribLocation(GLuint index, const nsAString& name); + void DetachShader(const WebGLShader* shader); + already_AddRefed GetActiveAttrib(GLuint index) const; + already_AddRefed GetActiveUniform(GLuint index) const; + void GetAttachedShaders(nsTArray>* const out) const; + GLint GetAttribLocation(const nsAString& name) const; + GLint GetFragDataLocation(const nsAString& name) const; + void GetProgramInfoLog(nsAString* const out) const; + JS::Value GetProgramParameter(GLenum pname) const; + GLuint GetUniformBlockIndex(const nsAString& name) const; + void GetActiveUniformBlockName(GLuint uniformBlockIndex, nsAString& name) const; + JS::Value GetActiveUniformBlockParam(GLuint uniformBlockIndex, GLenum pname) const; + JS::Value GetActiveUniformBlockActiveUniforms(JSContext* cx, GLuint uniformBlockIndex, + ErrorResult* const out_error) const; + already_AddRefed GetUniformLocation(const nsAString& name) const; + void GetUniformIndices(const dom::Sequence& uniformNames, + dom::Nullable< nsTArray >& retval) const; + void UniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) const; + + void LinkProgram(); + bool UseProgram() const; + void ValidateProgram() const; + + //////////////// + + bool FindAttribUserNameByMappedName(const nsACString& mappedName, + nsCString* const out_userName) const; + bool FindVaryingByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const; + bool FindUniformByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const; + bool UnmapUniformBlockName(const nsCString& mappedName, + nsCString* const out_userName) const; + + void TransformFeedbackVaryings(const dom::Sequence& varyings, + GLenum bufferMode); + already_AddRefed GetTransformFeedbackVarying(GLuint index) const; + + void EnumerateFragOutputs(std::map &out_FragOutputs) const; + + bool IsLinked() const { return mMostRecentLinkInfo; } + + const webgl::LinkedProgramInfo* LinkInfo() const { + return mMostRecentLinkInfo.get(); + } + + WebGLContext* GetParentObject() const { + return mContext; + } + + virtual JSObject* WrapObject(JSContext* js, JS::Handle givenProto) override; + +private: + ~WebGLProgram(); + + void LinkAndUpdate(); + bool ValidateForLink(); + bool ValidateAfterTentativeLink(nsCString* const out_linkLog) const; + +public: + const GLuint mGLName; + +private: + WebGLRefPtr mVertShader; + WebGLRefPtr mFragShader; + size_t mNumActiveTFOs; + + std::map mNextLink_BoundAttribLocs; + + std::vector mNextLink_TransformFeedbackVaryings; + GLenum mNextLink_TransformFeedbackBufferMode; + + nsCString mLinkLog; + RefPtr mMostRecentLinkInfo; +}; + +} // namespace mozilla + +#endif // WEBGL_PROGRAM_H_ diff --git a/dom/canvas/WebGLQuery.cpp b/dom/canvas/WebGLQuery.cpp new file mode 100644 index 000000000..ea71243c9 --- /dev/null +++ b/dom/canvas/WebGLQuery.cpp @@ -0,0 +1,270 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLQuery.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "nsContentUtils.h" +#include "WebGLContext.h" + +namespace mozilla { + +class AvailableRunnable final : public Runnable +{ + const RefPtr mQuery; + +public: + explicit AvailableRunnable(WebGLQuery* query) + : mQuery(query) + { } + + NS_IMETHOD Run() override { + mQuery->mCanBeAvailable = true; + return NS_OK; + } +}; + +//// + +static GLuint +GenQuery(gl::GLContext* gl) +{ + gl->MakeCurrent(); + + GLuint ret = 0; + gl->fGenQueries(1, &ret); + return ret; +} + +WebGLQuery::WebGLQuery(WebGLContext* webgl) + : WebGLRefCountedObject(webgl) + , mGLName(GenQuery(mContext->gl)) + , mTarget(0) + , mActiveSlot(nullptr) + , mCanBeAvailable(false) +{ + mContext->mQueries.insertBack(this); +} + +void +WebGLQuery::Delete() +{ + mContext->MakeContextCurrent(); + mContext->gl->fDeleteQueries(1, &mGLName); + LinkedListElement::removeFrom(mContext->mQueries); +} + +//// + +static GLenum +TargetForDriver(const gl::GLContext* gl, GLenum target) +{ + switch (target) { + case LOCAL_GL_ANY_SAMPLES_PASSED: + case LOCAL_GL_ANY_SAMPLES_PASSED_CONSERVATIVE: + break; + + default: + return target; + } + + if (gl->IsSupported(gl::GLFeature::occlusion_query_boolean)) + return target; + + if (gl->IsSupported(gl::GLFeature::occlusion_query2)) + return LOCAL_GL_ANY_SAMPLES_PASSED; + + return LOCAL_GL_SAMPLES_PASSED; +} + +void +WebGLQuery::BeginQuery(GLenum target, WebGLRefPtr& slot) +{ + const char funcName[] = "beginQuery"; + + if (mTarget && target != mTarget) { + mContext->ErrorInvalidOperation("%s: Queries cannot change targets.", funcName); + return; + } + + //// + + mTarget = target; + mActiveSlot = &slot; + *mActiveSlot = this; + + //// + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + + const auto driverTarget = TargetForDriver(gl, mTarget); + gl->fBeginQuery(driverTarget, mGLName); +} + +void +WebGLQuery::EndQuery() +{ + *mActiveSlot = nullptr; + mActiveSlot = nullptr; + mCanBeAvailable = false; + + //// + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + + const auto driverTarget = TargetForDriver(gl, mTarget); + gl->fEndQuery(driverTarget); + + //// + + NS_DispatchToCurrentThread(new AvailableRunnable(this)); +} + +void +WebGLQuery::GetQueryParameter(GLenum pname, JS::MutableHandleValue retval) const +{ + const char funcName[] = "getQueryParameter"; + + switch (pname) { + case LOCAL_GL_QUERY_RESULT_AVAILABLE: + case LOCAL_GL_QUERY_RESULT: + break; + + default: + mContext->ErrorInvalidEnumArg(funcName, "pname", pname); + return; + } + + if (!mTarget) { + mContext->ErrorInvalidOperation("%s: Query has never been active.", funcName); + return; + } + + if (mActiveSlot) + return mContext->ErrorInvalidOperation("%s: Query is still active.", funcName); + + // End of validation + //// + + // We must usually wait for an event loop before the query can be available. + const bool canBeAvailable = (mCanBeAvailable || gfxPrefs::WebGLImmediateQueries()); + if (!canBeAvailable) { + if (pname == LOCAL_GL_QUERY_RESULT_AVAILABLE) { + retval.set(JS::BooleanValue(false)); + } + return; + } + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + + uint64_t val = 0; + switch (pname) { + case LOCAL_GL_QUERY_RESULT_AVAILABLE: + gl->fGetQueryObjectuiv(mGLName, pname, (GLuint*)&val); + retval.set(JS::BooleanValue(bool(val))); + return; + + case LOCAL_GL_QUERY_RESULT: + switch (mTarget) { + case LOCAL_GL_TIME_ELAPSED_EXT: + case LOCAL_GL_TIMESTAMP_EXT: + if (mContext->Has64BitTimestamps()) { + gl->fGetQueryObjectui64v(mGLName, pname, &val); + break; + } + MOZ_FALLTHROUGH; + + default: + gl->fGetQueryObjectuiv(mGLName, LOCAL_GL_QUERY_RESULT, (GLuint*)&val); + break; + } + + switch (mTarget) { + case LOCAL_GL_ANY_SAMPLES_PASSED: + case LOCAL_GL_ANY_SAMPLES_PASSED_CONSERVATIVE: + retval.set(JS::BooleanValue(bool(val))); + break; + + case LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: + case LOCAL_GL_TIME_ELAPSED_EXT: + case LOCAL_GL_TIMESTAMP_EXT: + retval.set(JS::NumberValue(val)); + break; + + default: + MOZ_CRASH("Bad `mTarget`."); + } + return; + + default: + MOZ_CRASH("Bad `pname`."); + } +} + +bool +WebGLQuery::IsQuery() const +{ + MOZ_ASSERT(!IsDeleted()); + + if (!mTarget) + return false; + + return true; +} + +void +WebGLQuery::DeleteQuery() +{ + MOZ_ASSERT(!IsDeleteRequested()); + + if (mActiveSlot) { + EndQuery(); + } + + RequestDelete(); +} + +void +WebGLQuery::QueryCounter(const char* funcName, GLenum target) +{ + if (target != LOCAL_GL_TIMESTAMP_EXT) { + mContext->ErrorInvalidEnum("%s: `target` must be TIMESTAMP_EXT.", funcName, + target); + return; + } + + if (mTarget && target != mTarget) { + mContext->ErrorInvalidOperation("%s: Queries cannot change targets.", funcName); + return; + } + + mTarget = target; + mCanBeAvailable = false; + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + gl->fQueryCounter(mGLName, mTarget); + + NS_DispatchToCurrentThread(new AvailableRunnable(this)); +} + +//// + +JSObject* +WebGLQuery::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLQueryBinding::Wrap(cx, this, givenProto); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLQuery) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLQuery, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLQuery, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLQuery.h b/dom/canvas/WebGLQuery.h new file mode 100644 index 000000000..132e70ae9 --- /dev/null +++ b/dom/canvas/WebGLQuery.h @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_QUERY_H_ +#define WEBGL_QUERY_H_ + +#include "mozilla/LinkedList.h" +#include "nsWrapperCache.h" + +#include "WebGLObjectModel.h" +#include "nsThreadUtils.h" + +namespace mozilla { + +class WebGLQuery final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + friend class AvailableRunnable; + friend class WebGLRefCountedObject; + +public: + const GLuint mGLName; +private: + GLenum mTarget; + WebGLRefPtr* mActiveSlot; + + bool mCanBeAvailable; // Track whether the event loop has spun + + //// +public: + GLenum Target() const { return mTarget; } + bool IsActive() const { return bool(mActiveSlot); } + + //// + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery) + + explicit WebGLQuery(WebGLContext* webgl); + +private: + ~WebGLQuery() { + DeleteOnce(); + }; + + // WebGLRefCountedObject + void Delete(); + +public: + WebGLContext* GetParentObject() const { return mContext; } + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + + //// + + void BeginQuery(GLenum target, WebGLRefPtr& slot); + void DeleteQuery(); + void EndQuery(); + void GetQueryParameter(GLenum pname, JS::MutableHandleValue retval) const; + bool IsQuery() const; + void QueryCounter(const char* funcName, GLenum target); +}; + +} // namespace mozilla + +#endif // WEBGL_QUERY_H_ diff --git a/dom/canvas/WebGLRenderbuffer.cpp b/dom/canvas/WebGLRenderbuffer.cpp new file mode 100644 index 000000000..ec076fdbb --- /dev/null +++ b/dom/canvas/WebGLRenderbuffer.cpp @@ -0,0 +1,302 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLRenderbuffer.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "ScopedGLHelpers.h" +#include "WebGLContext.h" +#include "WebGLStrongTypes.h" +#include "WebGLTexture.h" + +namespace mozilla { + +static GLenum +DepthFormatForDepthStencilEmu(gl::GLContext* gl) +{ + // We might not be able to get 24-bit, so let's pretend! + if (gl->IsGLES() && !gl->IsExtensionSupported(gl::GLContext::OES_depth24)) + return LOCAL_GL_DEPTH_COMPONENT16; + + return LOCAL_GL_DEPTH_COMPONENT24; +} + +JSObject* +WebGLRenderbuffer::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLRenderbufferBinding::Wrap(cx, this, givenProto); +} + +static GLuint +DoCreateRenderbuffer(gl::GLContext* gl) +{ + MOZ_ASSERT(gl->IsCurrent()); + + GLuint ret = 0; + gl->fGenRenderbuffers(1, &ret); + return ret; +} + +static bool +EmulatePackedDepthStencil(gl::GLContext* gl) +{ + return !gl->IsSupported(gl::GLFeature::packed_depth_stencil); +} + +WebGLRenderbuffer::WebGLRenderbuffer(WebGLContext* webgl) + : WebGLRefCountedObject(webgl) + , mPrimaryRB( DoCreateRenderbuffer(webgl->gl) ) + , mEmulatePackedDepthStencil( EmulatePackedDepthStencil(webgl->gl) ) + , mSecondaryRB(0) + , mFormat(nullptr) + , mSamples(0) + , mImageDataStatus(WebGLImageDataStatus::NoImageData) + , mHasBeenBound(false) +{ + mContext->mRenderbuffers.insertBack(this); +} + +void +WebGLRenderbuffer::Delete() +{ + mContext->MakeContextCurrent(); + + mContext->gl->fDeleteRenderbuffers(1, &mPrimaryRB); + if (mSecondaryRB) + mContext->gl->fDeleteRenderbuffers(1, &mSecondaryRB); + + LinkedListElement::removeFrom(mContext->mRenderbuffers); +} + +int64_t +WebGLRenderbuffer::MemoryUsage() const +{ + // If there is no defined format, we're not taking up any memory + if (!mFormat) + return 0; + + const auto bytesPerPixel = mFormat->format->estimatedBytesPerPixel; + const int64_t pixels = int64_t(mWidth) * int64_t(mHeight); + + const int64_t totalSize = pixels * bytesPerPixel; + return totalSize; +} + +static GLenum +DoRenderbufferStorageMaybeMultisample(gl::GLContext* gl, GLsizei samples, + GLenum internalFormat, GLsizei width, + GLsizei height) +{ + MOZ_ASSERT_IF(samples >= 1, gl->IsSupported(gl::GLFeature::framebuffer_multisample)); + + // Certain OpenGL ES renderbuffer formats may not exist on desktop OpenGL. + switch (internalFormat) { + case LOCAL_GL_RGBA4: + case LOCAL_GL_RGB5_A1: + // 16-bit RGBA formats are not supported on desktop GL. + if (!gl->IsGLES()) + internalFormat = LOCAL_GL_RGBA8; + break; + + case LOCAL_GL_RGB565: + // RGB565 is not supported on desktop GL. + if (!gl->IsGLES()) + internalFormat = LOCAL_GL_RGB8; + break; + + case LOCAL_GL_DEPTH_COMPONENT16: + if (!gl->IsGLES() || gl->IsExtensionSupported(gl::GLContext::OES_depth24)) + internalFormat = LOCAL_GL_DEPTH_COMPONENT24; + else if (gl->IsSupported(gl::GLFeature::packed_depth_stencil)) + internalFormat = LOCAL_GL_DEPTH24_STENCIL8; + break; + + case LOCAL_GL_DEPTH_STENCIL: + MOZ_CRASH("GFX: GL_DEPTH_STENCIL is not valid here."); + break; + + default: + break; + } + + gl::GLContext::LocalErrorScope errorScope(*gl); + + if (samples > 0) { + gl->fRenderbufferStorageMultisample(LOCAL_GL_RENDERBUFFER, samples, + internalFormat, width, height); + } else { + gl->fRenderbufferStorage(LOCAL_GL_RENDERBUFFER, internalFormat, width, height); + } + + return errorScope.GetError(); +} + +GLenum +WebGLRenderbuffer::DoRenderbufferStorage(uint32_t samples, + const webgl::FormatUsageInfo* format, + uint32_t width, uint32_t height) +{ + MOZ_ASSERT(mContext->mBoundRenderbuffer == this); + + gl::GLContext* gl = mContext->gl; + MOZ_ASSERT(samples <= 256); // Sanity check. + + GLenum primaryFormat = format->format->sizedFormat; + GLenum secondaryFormat = 0; + + if (mEmulatePackedDepthStencil && primaryFormat == LOCAL_GL_DEPTH24_STENCIL8) { + primaryFormat = DepthFormatForDepthStencilEmu(gl); + secondaryFormat = LOCAL_GL_STENCIL_INDEX8; + } + + gl->fBindRenderbuffer(LOCAL_GL_RENDERBUFFER, mPrimaryRB); + GLenum error = DoRenderbufferStorageMaybeMultisample(gl, samples, primaryFormat, + width, height); + if (error) + return error; + + if (secondaryFormat) { + if (!mSecondaryRB) { + gl->fGenRenderbuffers(1, &mSecondaryRB); + } + + gl->fBindRenderbuffer(LOCAL_GL_RENDERBUFFER, mSecondaryRB); + error = DoRenderbufferStorageMaybeMultisample(gl, samples, secondaryFormat, + width, height); + if (error) + return error; + } else if (mSecondaryRB) { + gl->fDeleteRenderbuffers(1, &mSecondaryRB); + mSecondaryRB = 0; + } + + return 0; +} + +void +WebGLRenderbuffer::RenderbufferStorage(const char* funcName, uint32_t samples, + GLenum internalFormat, uint32_t width, + uint32_t height) +{ + const auto usage = mContext->mFormatUsage->GetRBUsage(internalFormat); + if (!usage) { + mContext->ErrorInvalidEnum("%s: Invalid `internalFormat`: 0x%04x.", funcName, + internalFormat); + return; + } + + if (width > mContext->mImplMaxRenderbufferSize || + height > mContext->mImplMaxRenderbufferSize) + { + mContext->ErrorInvalidValue("%s: Width or height exceeds maximum renderbuffer" + " size.", + funcName); + return; + } + + mContext->MakeContextCurrent(); + + if (!usage->maxSamplesKnown) { + const_cast(usage)->ResolveMaxSamples(mContext->gl); + } + MOZ_ASSERT(usage->maxSamplesKnown); + + if (samples > usage->maxSamples) { + mContext->ErrorInvalidOperation("%s: `samples` is out of the valid range.", funcName); + return; + } + + // Validation complete. + + const GLenum error = DoRenderbufferStorage(samples, usage, width, height); + if (error) { + const char* errorName = mContext->ErrorName(error); + mContext->GenerateWarning("%s generated error %s", funcName, errorName); + return; + } + + mSamples = samples; + mFormat = usage; + mWidth = width; + mHeight = height; + mImageDataStatus = WebGLImageDataStatus::UninitializedImageData; + + InvalidateStatusOfAttachedFBs(); +} + +void +WebGLRenderbuffer::DoFramebufferRenderbuffer(FBTarget target, GLenum attachment) const +{ + gl::GLContext* gl = mContext->gl; + + if (attachment == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) { + const GLuint stencilRB = (mSecondaryRB ? mSecondaryRB : mPrimaryRB); + gl->fFramebufferRenderbuffer(target.get(), LOCAL_GL_DEPTH_ATTACHMENT, + LOCAL_GL_RENDERBUFFER, mPrimaryRB); + gl->fFramebufferRenderbuffer(target.get(), LOCAL_GL_STENCIL_ATTACHMENT, + LOCAL_GL_RENDERBUFFER, stencilRB); + return; + } + + gl->fFramebufferRenderbuffer(target.get(), attachment, + LOCAL_GL_RENDERBUFFER, mPrimaryRB); +} + +GLint +WebGLRenderbuffer::GetRenderbufferParameter(RBTarget target, + RBParam pname) const +{ + gl::GLContext* gl = mContext->gl; + + switch (pname.get()) { + case LOCAL_GL_RENDERBUFFER_STENCIL_SIZE: + if (!mFormat) + return 0; + + if (!mFormat->format->s) + return 0; + + return 8; + + case LOCAL_GL_RENDERBUFFER_SAMPLES: + case LOCAL_GL_RENDERBUFFER_WIDTH: + case LOCAL_GL_RENDERBUFFER_HEIGHT: + case LOCAL_GL_RENDERBUFFER_RED_SIZE: + case LOCAL_GL_RENDERBUFFER_GREEN_SIZE: + case LOCAL_GL_RENDERBUFFER_BLUE_SIZE: + case LOCAL_GL_RENDERBUFFER_ALPHA_SIZE: + case LOCAL_GL_RENDERBUFFER_DEPTH_SIZE: + { + gl->fBindRenderbuffer(LOCAL_GL_RENDERBUFFER, mPrimaryRB); + GLint i = 0; + gl->fGetRenderbufferParameteriv(target.get(), pname.get(), &i); + return i; + } + + case LOCAL_GL_RENDERBUFFER_INTERNAL_FORMAT: + { + GLenum ret = LOCAL_GL_RGBA4; + if (mFormat) { + ret = mFormat->format->sizedFormat; + + if (!mContext->IsWebGL2() && ret == LOCAL_GL_DEPTH24_STENCIL8) { + ret = LOCAL_GL_DEPTH_STENCIL; + } + } + return ret; + } + } + + MOZ_ASSERT(false, "This function should only be called with valid `pname`."); + return 0; +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLRenderbuffer) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLRenderbuffer, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLRenderbuffer, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLRenderbuffer.h b/dom/canvas/WebGLRenderbuffer.h new file mode 100644 index 000000000..d16110375 --- /dev/null +++ b/dom/canvas/WebGLRenderbuffer.h @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_RENDERBUFFER_H_ +#define WEBGL_RENDERBUFFER_H_ + +#include "mozilla/LinkedList.h" +#include "nsWrapperCache.h" + +#include "WebGLFramebufferAttachable.h" +#include "WebGLObjectModel.h" +#include "WebGLStrongTypes.h" + +namespace mozilla { +namespace webgl { +struct FormatUsageInfo; +} + +class WebGLRenderbuffer final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement + , public WebGLRectangleObject + , public WebGLFramebufferAttachable +{ + friend class WebGLContext; + friend class WebGLFramebuffer; + friend class WebGLFBAttachPoint; + +public: + const GLuint mPrimaryRB; +protected: + const bool mEmulatePackedDepthStencil; + GLuint mSecondaryRB; + const webgl::FormatUsageInfo* mFormat; + GLsizei mSamples; + + WebGLImageDataStatus mImageDataStatus; + + bool mHasBeenBound; + +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLRenderbuffer) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLRenderbuffer) + + explicit WebGLRenderbuffer(WebGLContext* webgl); + + void Delete(); + + bool HasUninitializedImageData() const { + MOZ_ASSERT(mImageDataStatus != WebGLImageDataStatus::NoImageData); + return mImageDataStatus == WebGLImageDataStatus::UninitializedImageData; + } + + bool IsDefined() const { + if (!mFormat) { + MOZ_ASSERT(!mWidth && !mHeight); + return false; + } + return true; + } + + GLsizei Samples() const { return mSamples; } + + const webgl::FormatUsageInfo* Format() const { return mFormat; } + + int64_t MemoryUsage() const; + + WebGLContext* GetParentObject() const { + return mContext; + } + + void RenderbufferStorage(const char* funcName, uint32_t samples, + GLenum internalFormat, uint32_t width, uint32_t height); + // Only handles a subset of `pname`s. + GLint GetRenderbufferParameter(RBTarget target, RBParam pname) const; + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + +protected: + ~WebGLRenderbuffer() { + DeleteOnce(); + } + + void DoFramebufferRenderbuffer(FBTarget target, GLenum attachment) const; + GLenum DoRenderbufferStorage(uint32_t samples, const webgl::FormatUsageInfo* format, + uint32_t width, uint32_t height); +}; + +} // namespace mozilla + +#endif // WEBGL_RENDERBUFFER_H_ diff --git a/dom/canvas/WebGLSampler.cpp b/dom/canvas/WebGLSampler.cpp new file mode 100644 index 000000000..b777eaeff --- /dev/null +++ b/dom/canvas/WebGLSampler.cpp @@ -0,0 +1,214 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLSampler.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLSampler::WebGLSampler(WebGLContext* webgl, GLuint sampler) + : WebGLRefCountedObject(webgl) + , mGLName(sampler) + , mMinFilter(LOCAL_GL_NEAREST_MIPMAP_LINEAR) + , mMagFilter(LOCAL_GL_LINEAR) + , mWrapS(LOCAL_GL_REPEAT) + , mWrapT(LOCAL_GL_REPEAT) + , mWrapR(LOCAL_GL_REPEAT) + , mMinLod(-1000) + , mMaxLod(1000) + , mCompareMode(LOCAL_GL_NONE) + , mCompareFunc(LOCAL_GL_LEQUAL) +{ + mContext->mSamplers.insertBack(this); +} + +WebGLSampler::~WebGLSampler() +{ + DeleteOnce(); +} + +void +WebGLSampler::Delete() +{ + mContext->MakeContextCurrent(); + mContext->gl->fDeleteSamplers(1, &mGLName); + + removeFrom(mContext->mSamplers); +} + +WebGLContext* +WebGLSampler::GetParentObject() const +{ + return mContext; +} + +JSObject* +WebGLSampler::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLSamplerBinding::Wrap(cx, this, givenProto); +} + +static bool +ValidateSamplerParameterParams(WebGLContext* webgl, const char* funcName, GLenum pname, + const FloatOrInt& param) +{ + const auto& paramInt = param.i; + + switch (pname) { + case LOCAL_GL_TEXTURE_MIN_FILTER: + switch (paramInt) { + case LOCAL_GL_NEAREST: + case LOCAL_GL_LINEAR: + case LOCAL_GL_NEAREST_MIPMAP_NEAREST: + case LOCAL_GL_NEAREST_MIPMAP_LINEAR: + case LOCAL_GL_LINEAR_MIPMAP_NEAREST: + case LOCAL_GL_LINEAR_MIPMAP_LINEAR: + return true; + + default: + break; + } + break; + + case LOCAL_GL_TEXTURE_MAG_FILTER: + switch (paramInt) { + case LOCAL_GL_NEAREST: + case LOCAL_GL_LINEAR: + return true; + + default: + break; + } + break; + + case LOCAL_GL_TEXTURE_WRAP_S: + case LOCAL_GL_TEXTURE_WRAP_T: + case LOCAL_GL_TEXTURE_WRAP_R: + switch (paramInt) { + case LOCAL_GL_CLAMP_TO_EDGE: + case LOCAL_GL_REPEAT: + case LOCAL_GL_MIRRORED_REPEAT: + return true; + + default: + break; + } + break; + + case LOCAL_GL_TEXTURE_MIN_LOD: + case LOCAL_GL_TEXTURE_MAX_LOD: + return true; + + case LOCAL_GL_TEXTURE_COMPARE_MODE: + switch (paramInt) { + case LOCAL_GL_NONE: + case LOCAL_GL_COMPARE_REF_TO_TEXTURE: + return true; + + default: + break; + } + break; + + case LOCAL_GL_TEXTURE_COMPARE_FUNC: + switch (paramInt) { + case LOCAL_GL_LEQUAL: + case LOCAL_GL_GEQUAL: + case LOCAL_GL_LESS: + case LOCAL_GL_GREATER: + case LOCAL_GL_EQUAL: + case LOCAL_GL_NOTEQUAL: + case LOCAL_GL_ALWAYS: + case LOCAL_GL_NEVER: + return true; + + default: + break; + } + break; + + default: + webgl->ErrorInvalidEnumArg(funcName, "pname", pname); + return false; + } + + webgl->ErrorInvalidEnumArg(funcName, "param", paramInt); + return false; +} + +void +WebGLSampler::SamplerParameter(const char* funcName, GLenum pname, + const FloatOrInt& param) +{ + if (!ValidateSamplerParameterParams(mContext, funcName, pname, param)) + return; + + switch (pname) { + case LOCAL_GL_TEXTURE_MIN_FILTER: + mMinFilter = param.i; + break; + + case LOCAL_GL_TEXTURE_MAG_FILTER: + mMagFilter = param.i; + break; + + case LOCAL_GL_TEXTURE_WRAP_S: + mWrapS = param.i; + break; + + case LOCAL_GL_TEXTURE_WRAP_T: + mWrapT = param.i; + break; + + case LOCAL_GL_TEXTURE_WRAP_R: + mWrapR = param.i; + break; + + case LOCAL_GL_TEXTURE_COMPARE_MODE: + mCompareMode = param.i; + break; + + case LOCAL_GL_TEXTURE_COMPARE_FUNC: + mCompareFunc = param.i; + break; + + case LOCAL_GL_TEXTURE_MIN_LOD: + mMinLod = param.f; + break; + + case LOCAL_GL_TEXTURE_MAX_LOD: + mMaxLod = param.f; + break; + + default: + MOZ_CRASH("GFX: Unhandled pname"); + break; + } + + for (uint32_t i = 0; i < mContext->mBoundSamplers.Length(); ++i) { + if (this == mContext->mBoundSamplers[i]) + mContext->InvalidateResolveCacheForTextureWithTexUnit(i); + } + + //// + + mContext->gl->MakeCurrent(); + if (param.isFloat) { + mContext->gl->fSamplerParameterf(mGLName, pname, param.f); + } else { + mContext->gl->fSamplerParameteri(mGLName, pname, param.i); + } +} + +//// + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLSampler) +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLSampler, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLSampler, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLSampler.h b/dom/canvas/WebGLSampler.h new file mode 100644 index 000000000..1cf039984 --- /dev/null +++ b/dom/canvas/WebGLSampler.h @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_SAMPLER_H_ +#define WEBGL_SAMPLER_H_ + +#include "mozilla/LinkedList.h" +#include "nsWrapperCache.h" +#include "WebGLObjectModel.h" +#include "WebGLStrongTypes.h" + +namespace mozilla { + +class WebGLSampler final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + friend class WebGLContext2; + friend class WebGLTexture; + +public: + WebGLSampler(WebGLContext* webgl, GLuint sampler); + + const GLuint mGLName; + + void Delete(); + WebGLContext* GetParentObject() const; + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + + void SamplerParameter(const char* funcName, GLenum pname, const FloatOrInt& param); + +private: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSampler) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSampler) + + TexMinFilter mMinFilter; + TexMagFilter mMagFilter; + TexWrap mWrapS; + TexWrap mWrapT; + TexWrap mWrapR; + GLfloat mMinLod; + GLfloat mMaxLod; + TexCompareMode mCompareMode; + TexCompareFunc mCompareFunc; + +private: + ~WebGLSampler(); +}; + +} // namespace mozilla + +#endif // WEBGL_SAMPLER_H_ diff --git a/dom/canvas/WebGLShader.cpp b/dom/canvas/WebGLShader.cpp new file mode 100644 index 000000000..37380f1e0 --- /dev/null +++ b/dom/canvas/WebGLShader.cpp @@ -0,0 +1,465 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLShader.h" + +#include "angle/ShaderLang.h" +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "mozilla/MemoryReporting.h" +#include "nsPrintfCString.h" +#include "nsString.h" +#include "prenv.h" +#include "WebGLContext.h" +#include "WebGLObjectModel.h" +#include "WebGLShaderValidator.h" +#include "WebGLValidateStrings.h" + +namespace mozilla { + +// On success, writes to out_validator and out_translatedSource. +// On failure, writes to out_translationLog. +static bool +Translate(const nsACString& source, webgl::ShaderValidator* validator, + nsACString* const out_translationLog, nsACString* const out_translatedSource) +{ + if (!validator->ValidateAndTranslate(source.BeginReading())) { + validator->GetInfoLog(out_translationLog); + return false; + } + + // Success + validator->GetOutput(out_translatedSource); + return true; +} + +template +static bool +SubstringStartsWith(const std::string& testStr, size_t offset, const char (& refStr)[N]) +{ + for (size_t i = 0; i < N-1; i++) { + if (testStr[offset + i] != refStr[i]) + return false; + } + return true; +} + +/* On success, writes to out_translatedSource. + * On failure, writes to out_translationLog. + * + * Requirements: + * #version is either omitted, `#version 100`, or `version 300 es`. + */ +static bool +TranslateWithoutValidation(const nsACString& sourceNS, bool isWebGL2, + nsACString* const out_translationLog, + nsACString* const out_translatedSource) +{ + std::string source = sourceNS.BeginReading(); + + size_t versionStrStart = source.find("#version"); + size_t versionStrLen; + uint32_t glesslVersion; + + if (versionStrStart != std::string::npos) { + static const char versionStr100[] = "#version 100\n"; + static const char versionStr300es[] = "#version 300 es\n"; + + if (isWebGL2 && SubstringStartsWith(source, versionStrStart, versionStr300es)) { + glesslVersion = 300; + versionStrLen = strlen(versionStr300es); + + } else if (SubstringStartsWith(source, versionStrStart, versionStr100)) { + glesslVersion = 100; + versionStrLen = strlen(versionStr100); + + } else { + nsPrintfCString error("#version, if declared, must be %s.", + isWebGL2 ? "`100` or `300 es`" + : "`100`"); + *out_translationLog = error; + return false; + } + } else { + versionStrStart = 0; + versionStrLen = 0; + glesslVersion = 100; + } + + std::string reversionedSource = source; + reversionedSource.erase(versionStrStart, versionStrLen); + + switch (glesslVersion) { + case 100: + /* According to ARB_ES2_compatibility extension glsl + * should accept #version 100 for ES 2 shaders. */ + reversionedSource.insert(versionStrStart, "#version 100\n"); + break; + case 300: + reversionedSource.insert(versionStrStart, "#version 330\n"); + break; + default: + MOZ_CRASH("GFX: Bad `glesslVersion`."); + } + + out_translatedSource->Assign(reversionedSource.c_str(), + reversionedSource.length()); + return true; +} + +static void +GetCompilationStatusAndLog(gl::GLContext* gl, GLuint shader, bool* const out_success, + nsACString* const out_log) +{ + GLint compileStatus = LOCAL_GL_FALSE; + gl->fGetShaderiv(shader, LOCAL_GL_COMPILE_STATUS, &compileStatus); + + // It's simpler if we always get the log. + GLint lenWithNull = 0; + gl->fGetShaderiv(shader, LOCAL_GL_INFO_LOG_LENGTH, &lenWithNull); + + if (lenWithNull > 1) { + // SetLength takes the length without the null. + out_log->SetLength(lenWithNull - 1); + gl->fGetShaderInfoLog(shader, lenWithNull, nullptr, out_log->BeginWriting()); + } else { + out_log->SetLength(0); + } + + *out_success = (compileStatus == LOCAL_GL_TRUE); +} + +//////////////////////////////////////////////////////////////////////////////// + +static GLuint +CreateShader(gl::GLContext* gl, GLenum type) +{ + gl->MakeCurrent(); + return gl->fCreateShader(type); +} + +WebGLShader::WebGLShader(WebGLContext* webgl, GLenum type) + : WebGLRefCountedObject(webgl) + , mGLName(CreateShader(webgl->GL(), type)) + , mType(type) + , mTranslationSuccessful(false) + , mCompilationSuccessful(false) +{ + mContext->mShaders.insertBack(this); +} + +WebGLShader::~WebGLShader() +{ + DeleteOnce(); +} + +void +WebGLShader::ShaderSource(const nsAString& source) +{ + StripComments stripComments(source); + const nsAString& cleanSource = Substring(stripComments.result().Elements(), + stripComments.length()); + if (!ValidateGLSLString(cleanSource, mContext, "shaderSource")) + return; + + // We checked that the source stripped of comments is in the + // 7-bit ASCII range, so we can skip the NS_IsAscii() check. + const NS_LossyConvertUTF16toASCII sourceCString(cleanSource); + + if (mContext->gl->WorkAroundDriverBugs()) { + const size_t maxSourceLength = 0x3ffff; + if (sourceCString.Length() > maxSourceLength) { + mContext->ErrorInvalidValue("shaderSource: Source has more than %d" + " characters. (Driver workaround)", + maxSourceLength); + return; + } + } + + if (PR_GetEnv("MOZ_WEBGL_DUMP_SHADERS")) { + printf_stderr("////////////////////////////////////////\n"); + printf_stderr("// MOZ_WEBGL_DUMP_SHADERS:\n"); + + // Wow - Roll Your Own Foreach-Lines because printf_stderr has a hard-coded + // internal size, so long strings are truncated. + + int32_t start = 0; + int32_t end = sourceCString.Find("\n", false, start, -1); + while (end > -1) { + const nsCString line(sourceCString.BeginReading() + start, end - start); + printf_stderr("%s\n", line.BeginReading()); + start = end + 1; + end = sourceCString.Find("\n", false, start, -1); + } + + printf_stderr("////////////////////////////////////////\n"); + } + + mSource = source; + mCleanSource = sourceCString; +} + +void +WebGLShader::CompileShader() +{ + mValidator = nullptr; + mTranslationSuccessful = false; + mCompilationSuccessful = false; + + gl::GLContext* gl = mContext->gl; + + mValidator.reset(mContext->CreateShaderValidator(mType)); + + bool success; + if (mValidator) { + success = Translate(mCleanSource, mValidator.get(), &mValidationLog, + &mTranslatedSource); + } else { + success = TranslateWithoutValidation(mCleanSource, mContext->IsWebGL2(), + &mValidationLog, &mTranslatedSource); + } + + if (!success) + return; + + mTranslationSuccessful = true; + + gl->MakeCurrent(); + + const char* const parts[] = { + mTranslatedSource.BeginReading() + }; + gl->fShaderSource(mGLName, ArrayLength(parts), parts, nullptr); + + gl->fCompileShader(mGLName); + + GetCompilationStatusAndLog(gl, mGLName, &mCompilationSuccessful, &mCompilationLog); +} + +void +WebGLShader::GetShaderInfoLog(nsAString* out) const +{ + const nsCString& log = !mTranslationSuccessful ? mValidationLog + : mCompilationLog; + CopyASCIItoUTF16(log, *out); +} + +JS::Value +WebGLShader::GetShaderParameter(GLenum pname) const +{ + switch (pname) { + case LOCAL_GL_SHADER_TYPE: + return JS::NumberValue(mType); + + case LOCAL_GL_DELETE_STATUS: + return JS::BooleanValue(IsDeleteRequested()); + + case LOCAL_GL_COMPILE_STATUS: + return JS::BooleanValue(mCompilationSuccessful); + + default: + mContext->ErrorInvalidEnumInfo("getShaderParameter: `pname`", pname); + return JS::NullValue(); + } +} + +void +WebGLShader::GetShaderSource(nsAString* out) const +{ + out->SetIsVoid(false); + *out = mSource; +} + +void +WebGLShader::GetShaderTranslatedSource(nsAString* out) const +{ + if (!mCompilationSuccessful) { + mContext->ErrorInvalidOperation("getShaderTranslatedSource: Shader has" + " not been successfully compiled."); + return; + } + + out->SetIsVoid(false); + CopyASCIItoUTF16(mTranslatedSource, *out); +} + +//////////////////////////////////////////////////////////////////////////////// + +bool +WebGLShader::CanLinkTo(const WebGLShader* prev, nsCString* const out_log) const +{ + if (!mValidator) + return true; + + return mValidator->CanLinkTo(prev->mValidator.get(), out_log); +} + +size_t +WebGLShader::CalcNumSamplerUniforms() const +{ + if (mValidator) + return mValidator->CalcNumSamplerUniforms(); + + // TODO + return 0; +} + +size_t +WebGLShader::NumAttributes() const +{ + if (mValidator) + return mValidator->NumAttributes(); + + // TODO + return 0; +} + +void +WebGLShader::BindAttribLocation(GLuint prog, const nsCString& userName, + GLuint index) const +{ + std::string userNameStr(userName.BeginReading()); + + const std::string* mappedNameStr = &userNameStr; + if (mValidator) + mValidator->FindAttribMappedNameByUserName(userNameStr, &mappedNameStr); + + mContext->gl->fBindAttribLocation(prog, index, mappedNameStr->c_str()); +} + +bool +WebGLShader::FindAttribUserNameByMappedName(const nsACString& mappedName, + nsCString* const out_userName) const +{ + if (!mValidator) + return false; + + const std::string mappedNameStr(mappedName.BeginReading()); + const std::string* userNameStr; + if (!mValidator->FindAttribUserNameByMappedName(mappedNameStr, &userNameStr)) + return false; + + *out_userName = userNameStr->c_str(); + return true; +} + +bool +WebGLShader::FindVaryingByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const +{ + if (!mValidator) + return false; + + const std::string mappedNameStr(mappedName.BeginReading()); + std::string userNameStr; + if (!mValidator->FindVaryingByMappedName(mappedNameStr, &userNameStr, out_isArray)) + return false; + + *out_userName = userNameStr.c_str(); + return true; +} + +bool +WebGLShader::FindUniformByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const +{ + if (!mValidator) + return false; + + const std::string mappedNameStr(mappedName.BeginReading(), mappedName.Length()); + std::string userNameStr; + if (!mValidator->FindUniformByMappedName(mappedNameStr, &userNameStr, out_isArray)) + return false; + + *out_userName = userNameStr.c_str(); + return true; +} + +bool +WebGLShader::UnmapUniformBlockName(const nsACString& baseMappedName, + nsCString* const out_baseUserName) const +{ + if (!mValidator) { + *out_baseUserName = baseMappedName; + return true; + } + + return mValidator->UnmapUniformBlockName(baseMappedName, out_baseUserName); +} + +void +WebGLShader::EnumerateFragOutputs(std::map &out_FragOutputs) const +{ + out_FragOutputs.clear(); + + if (!mValidator) { + return; + } + mValidator->EnumerateFragOutputs(out_FragOutputs); +} + +void +WebGLShader::MapTransformFeedbackVaryings(const std::vector& varyings, + std::vector* out_mappedVaryings) const +{ + MOZ_ASSERT(mType == LOCAL_GL_VERTEX_SHADER); + MOZ_ASSERT(out_mappedVaryings); + + out_mappedVaryings->clear(); + out_mappedVaryings->reserve(varyings.size()); + + for (const auto& wideUserName : varyings) { + const NS_LossyConvertUTF16toASCII mozUserName(wideUserName); // Don't validate here. + const std::string userName(mozUserName.BeginReading(), mozUserName.Length()); + const std::string* pMappedName = &userName; + if (mValidator) { + mValidator->FindVaryingMappedNameByUserName(userName, &pMappedName); + } + out_mappedVaryings->push_back(*pMappedName); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Boilerplate + +JSObject* +WebGLShader::WrapObject(JSContext* js, JS::Handle givenProto) +{ + return dom::WebGLShaderBinding::Wrap(js, this, givenProto); +} + +size_t +WebGLShader::SizeOfIncludingThis(MallocSizeOf mallocSizeOf) const +{ + size_t validatorSize = mValidator ? mallocSizeOf(mValidator.get()) + : 0; + return mallocSizeOf(this) + + mSource.SizeOfExcludingThisIfUnshared(mallocSizeOf) + + mCleanSource.SizeOfExcludingThisIfUnshared(mallocSizeOf) + + validatorSize + + mValidationLog.SizeOfExcludingThisIfUnshared(mallocSizeOf) + + mTranslatedSource.SizeOfExcludingThisIfUnshared(mallocSizeOf) + + mCompilationLog.SizeOfExcludingThisIfUnshared(mallocSizeOf); +} + +void +WebGLShader::Delete() +{ + gl::GLContext* gl = mContext->GL(); + + gl->MakeCurrent(); + gl->fDeleteShader(mGLName); + + LinkedListElement::removeFrom(mContext->mShaders); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLShader) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLShader, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLShader, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLShader.h b/dom/canvas/WebGLShader.h new file mode 100644 index 000000000..419c1f0aa --- /dev/null +++ b/dom/canvas/WebGLShader.h @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_SHADER_H_ +#define WEBGL_SHADER_H_ + +#include +#include +#include + +#include "GLDefs.h" +#include "mozilla/LinkedList.h" +#include "mozilla/MemoryReporting.h" +#include "nsString.h" +#include "nsWrapperCache.h" + +#include "WebGLObjectModel.h" + +namespace mozilla { + +namespace webgl { +class ShaderValidator; +} // namespace webgl + +class WebGLShader final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + friend class WebGLContext; + friend class WebGLProgram; + +public: + WebGLShader(WebGLContext* webgl, GLenum type); + +protected: + ~WebGLShader(); + +public: + // GL funcs + void CompileShader(); + JS::Value GetShaderParameter(GLenum pname) const; + void GetShaderInfoLog(nsAString* out) const; + void GetShaderSource(nsAString* out) const; + void GetShaderTranslatedSource(nsAString* out) const; + void ShaderSource(const nsAString& source); + + // Util funcs + bool CanLinkTo(const WebGLShader* prev, nsCString* const out_log) const; + size_t CalcNumSamplerUniforms() const; + size_t NumAttributes() const; + bool FindAttribUserNameByMappedName(const nsACString& mappedName, + nsCString* const out_userName) const; + bool FindVaryingByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const; + bool FindUniformByMappedName(const nsACString& mappedName, + nsCString* const out_userName, + bool* const out_isArray) const; + bool UnmapUniformBlockName(const nsACString& baseMappedName, + nsCString* const out_baseUserName) const; + + void EnumerateFragOutputs(std::map &out_FragOutputs) const; + + bool IsCompiled() const { + return mTranslationSuccessful && mCompilationSuccessful; + } + +private: + void BindAttribLocation(GLuint prog, const nsCString& userName, GLuint index) const; + void MapTransformFeedbackVaryings(const std::vector& varyings, + std::vector* out_mappedVaryings) const; + +public: + // Other funcs + size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; + void Delete(); + + WebGLContext* GetParentObject() const { return mContext; } + + virtual JSObject* WrapObject(JSContext* js, JS::Handle givenProto) override; + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLShader) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLShader) + +public: + const GLuint mGLName; + const GLenum mType; + +protected: + nsString mSource; + nsCString mCleanSource; + + UniquePtr mValidator; + nsCString mValidationLog; + bool mTranslationSuccessful; + nsCString mTranslatedSource; + + bool mCompilationSuccessful; + nsCString mCompilationLog; +}; + +} // namespace mozilla + +#endif // WEBGL_SHADER_H_ diff --git a/dom/canvas/WebGLShaderPrecisionFormat.cpp b/dom/canvas/WebGLShaderPrecisionFormat.cpp new file mode 100644 index 000000000..f1590878b --- /dev/null +++ b/dom/canvas/WebGLShaderPrecisionFormat.cpp @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLShaderPrecisionFormat.h" + +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +bool +WebGLShaderPrecisionFormat::WrapObject(JSContext* cx, + JS::Handle givenProto, + JS::MutableHandle reflector) +{ + return dom::WebGLShaderPrecisionFormatBinding::Wrap(cx, this, givenProto, reflector); +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLShaderPrecisionFormat.h b/dom/canvas/WebGLShaderPrecisionFormat.h new file mode 100644 index 000000000..49af0db21 --- /dev/null +++ b/dom/canvas/WebGLShaderPrecisionFormat.h @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_SHADER_PRECISION_FORMAT_H_ +#define WEBGL_SHADER_PRECISION_FORMAT_H_ + +#include "WebGLObjectModel.h" + +namespace mozilla { + +class WebGLShaderPrecisionFormat final + : public WebGLContextBoundObject +{ +public: + WebGLShaderPrecisionFormat(WebGLContext* context, GLint rangeMin, + GLint rangeMax, GLint precision) + : WebGLContextBoundObject(context) + , mRangeMin(rangeMin) + , mRangeMax(rangeMax) + , mPrecision(precision) + { } + + bool WrapObject(JSContext* cx, JS::Handle givenProto, JS::MutableHandle reflector); + + // WebIDL WebGLShaderPrecisionFormat API + GLint RangeMin() const { + return mRangeMin; + } + + GLint RangeMax() const { + return mRangeMax; + } + + GLint Precision() const { + return mPrecision; + } + + NS_INLINE_DECL_REFCOUNTING(WebGLShaderPrecisionFormat) + +private: + // Private destructor, to discourage deletion outside of Release(): + ~WebGLShaderPrecisionFormat() { } + + GLint mRangeMin; + GLint mRangeMax; + GLint mPrecision; +}; + +} // namespace mozilla + +#endif // WEBGL_SHADER_PRECISION_FORMAT_H_ diff --git a/dom/canvas/WebGLShaderValidator.cpp b/dom/canvas/WebGLShaderValidator.cpp new file mode 100644 index 000000000..80ba359a3 --- /dev/null +++ b/dom/canvas/WebGLShaderValidator.cpp @@ -0,0 +1,604 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLShaderValidator.h" + +#include "angle/ShaderLang.h" +#include "gfxPrefs.h" +#include "GLContext.h" +#include "mozilla/Preferences.h" +#include "MurmurHash3.h" +#include "nsPrintfCString.h" +#include +#include +#include "WebGLContext.h" + +namespace mozilla { +namespace webgl { + +uint64_t +IdentifierHashFunc(const char* name, size_t len) +{ + // NB: we use the x86 function everywhere, even though it's suboptimal perf + // on x64. They return different results; not sure if that's a requirement. + uint64_t hash[2]; + MurmurHash3_x86_128(name, len, 0, hash); + return hash[0]; +} + +static ShCompileOptions +ChooseValidatorCompileOptions(const ShBuiltInResources& resources, + const mozilla::gl::GLContext* gl) +{ + ShCompileOptions options = SH_VARIABLES | + SH_ENFORCE_PACKING_RESTRICTIONS | + SH_OBJECT_CODE | + SH_INIT_GL_POSITION; + + // Sampler arrays indexed with non-constant expressions are forbidden in + // GLSL 1.30 and later. + // ESSL 3 requires constant-integral-expressions for this as well. + // Just do it universally. + options |= SH_UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX; + +#ifndef XP_MACOSX + // We want to do this everywhere, but to do this on Mac, we need + // to do it only on Mac OSX > 10.6 as this causes the shader + // compiler in 10.6 to crash + options |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS; +#endif + +#ifdef XP_MACOSX + if (gl->WorkAroundDriverBugs()) { + // Work around https://bugs.webkit.org/show_bug.cgi?id=124684, + // https://chromium.googlesource.com/angle/angle/+/5e70cf9d0b1bb + options |= SH_UNFOLD_SHORT_CIRCUIT; + + // Work around that Mac drivers handle struct scopes incorrectly. + options |= SH_REGENERATE_STRUCT_NAMES; + options |= SH_INIT_OUTPUT_VARIABLES; + } +#endif + + if (gfxPrefs::WebGLAllANGLEOptions()) { + options = -1; + + options ^= SH_INTERMEDIATE_TREE; + options ^= SH_LINE_DIRECTIVES; + options ^= SH_SOURCE_PATH; + + options ^= SH_LIMIT_EXPRESSION_COMPLEXITY; + options ^= SH_LIMIT_CALL_STACK_DEPTH; + + options ^= SH_EXPAND_SELECT_HLSL_INTEGER_POW_EXPRESSIONS; + options ^= SH_HLSL_GET_DIMENSIONS_IGNORES_BASE_LEVEL; + + options ^= SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT; + options ^= SH_REMOVE_INVARIANT_AND_CENTROID_FOR_ESSL3; + } + + if (resources.MaxExpressionComplexity > 0) { + options |= SH_LIMIT_EXPRESSION_COMPLEXITY; + } + if (resources.MaxCallStackDepth > 0) { + options |= SH_LIMIT_CALL_STACK_DEPTH; + } + + return options; +} + +} // namespace webgl + +//////////////////////////////////////// + +static ShShaderOutput +ShaderOutput(gl::GLContext* gl) +{ + if (gl->IsGLES()) { + return SH_ESSL_OUTPUT; + } else { + uint32_t version = gl->ShadingLanguageVersion(); + switch (version) { + case 100: return SH_GLSL_COMPATIBILITY_OUTPUT; + case 120: return SH_GLSL_COMPATIBILITY_OUTPUT; + case 130: return SH_GLSL_130_OUTPUT; + case 140: return SH_GLSL_140_OUTPUT; + case 150: return SH_GLSL_150_CORE_OUTPUT; + case 330: return SH_GLSL_330_CORE_OUTPUT; + case 400: return SH_GLSL_400_CORE_OUTPUT; + case 410: return SH_GLSL_410_CORE_OUTPUT; + case 420: return SH_GLSL_420_CORE_OUTPUT; + case 430: return SH_GLSL_430_CORE_OUTPUT; + case 440: return SH_GLSL_440_CORE_OUTPUT; + case 450: return SH_GLSL_450_CORE_OUTPUT; + default: + MOZ_ASSERT(false, "GFX: Unexpected GLSL version."); + } + } + + return SH_GLSL_COMPATIBILITY_OUTPUT; +} + +webgl::ShaderValidator* +WebGLContext::CreateShaderValidator(GLenum shaderType) const +{ + if (mBypassShaderValidation) + return nullptr; + + const auto spec = (IsWebGL2() ? SH_WEBGL2_SPEC : SH_WEBGL_SPEC); + const auto outputLanguage = ShaderOutput(gl); + + ShBuiltInResources resources; + memset(&resources, 0, sizeof(resources)); + ShInitBuiltInResources(&resources); + + resources.HashFunction = webgl::IdentifierHashFunc; + + resources.MaxVertexAttribs = mGLMaxVertexAttribs; + resources.MaxVertexUniformVectors = mGLMaxVertexUniformVectors; + resources.MaxVaryingVectors = mGLMaxVaryingVectors; + resources.MaxVertexTextureImageUnits = mGLMaxVertexTextureImageUnits; + resources.MaxCombinedTextureImageUnits = mGLMaxTextureUnits; + resources.MaxTextureImageUnits = mGLMaxTextureImageUnits; + resources.MaxFragmentUniformVectors = mGLMaxFragmentUniformVectors; + + const bool hasMRTs = (IsWebGL2() || + IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)); + resources.MaxDrawBuffers = (hasMRTs ? mGLMaxDrawBuffers : 1); + + if (IsExtensionEnabled(WebGLExtensionID::EXT_frag_depth)) + resources.EXT_frag_depth = 1; + + if (IsExtensionEnabled(WebGLExtensionID::OES_standard_derivatives)) + resources.OES_standard_derivatives = 1; + + if (IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)) + resources.EXT_draw_buffers = 1; + + if (IsExtensionEnabled(WebGLExtensionID::EXT_shader_texture_lod)) + resources.EXT_shader_texture_lod = 1; + + // Tell ANGLE to allow highp in frag shaders. (unless disabled) + // If underlying GLES doesn't have highp in frag shaders, it should complain anyways. + resources.FragmentPrecisionHigh = mDisableFragHighP ? 0 : 1; + + if (gl->WorkAroundDriverBugs()) { +#ifdef XP_MACOSX + if (gl->Vendor() == gl::GLVendor::NVIDIA) { + // Work around bug 890432 + resources.MaxExpressionComplexity = 1000; + } +#endif + } + + const auto compileOptions = webgl::ChooseValidatorCompileOptions(resources, gl); + return webgl::ShaderValidator::Create(shaderType, spec, outputLanguage, resources, + compileOptions); +} + +//////////////////////////////////////// + +namespace webgl { + +/*static*/ ShaderValidator* +ShaderValidator::Create(GLenum shaderType, ShShaderSpec spec, + ShShaderOutput outputLanguage, + const ShBuiltInResources& resources, + ShCompileOptions compileOptions) +{ + ShHandle handle = ShConstructCompiler(shaderType, spec, outputLanguage, &resources); + if (!handle) + return nullptr; + + return new ShaderValidator(handle, compileOptions, resources.MaxVaryingVectors); +} + +ShaderValidator::~ShaderValidator() +{ + ShDestruct(mHandle); +} + +bool +ShaderValidator::ValidateAndTranslate(const char* source) +{ + MOZ_ASSERT(!mHasRun); + mHasRun = true; + + const char* const parts[] = { + source + }; + return ShCompile(mHandle, parts, ArrayLength(parts), mCompileOptions); +} + +void +ShaderValidator::GetInfoLog(nsACString* out) const +{ + MOZ_ASSERT(mHasRun); + + const std::string &log = ShGetInfoLog(mHandle); + out->Assign(log.data(), log.length()); +} + +void +ShaderValidator::GetOutput(nsACString* out) const +{ + MOZ_ASSERT(mHasRun); + + const std::string &output = ShGetObjectCode(mHandle); + out->Assign(output.data(), output.length()); +} + +template +static bool +StartsWith(const std::string& haystack, const char (&needle)[N]) +{ + return haystack.compare(0, N - 1, needle) == 0; +} + +bool +ShaderValidator::CanLinkTo(const ShaderValidator* prev, nsCString* const out_log) const +{ + if (!prev) { + nsPrintfCString error("Passed in NULL prev ShaderValidator."); + *out_log = error; + return false; + } + + const auto shaderVersion = ShGetShaderVersion(mHandle); + if (ShGetShaderVersion(prev->mHandle) != shaderVersion) { + nsPrintfCString error("Vertex shader version %d does not match" + " fragment shader version %d.", + ShGetShaderVersion(prev->mHandle), + ShGetShaderVersion(mHandle)); + *out_log = error; + return false; + } + + { + const std::vector* vertPtr = ShGetUniforms(prev->mHandle); + const std::vector* fragPtr = ShGetUniforms(mHandle); + if (!vertPtr || !fragPtr) { + nsPrintfCString error("Could not create uniform list."); + *out_log = error; + return false; + } + + for (auto itrFrag = fragPtr->begin(); itrFrag != fragPtr->end(); ++itrFrag) { + for (auto itrVert = vertPtr->begin(); itrVert != vertPtr->end(); ++itrVert) { + if (itrVert->name != itrFrag->name) + continue; + + if (!itrVert->isSameUniformAtLinkTime(*itrFrag)) { + nsPrintfCString error("Uniform `%s` is not linkable between" + " attached shaders.", + itrFrag->name.c_str()); + *out_log = error; + return false; + } + + break; + } + } + } + { + const auto vertVars = sh::GetInterfaceBlocks(prev->mHandle); + const auto fragVars = sh::GetInterfaceBlocks(mHandle); + if (!vertVars || !fragVars) { + nsPrintfCString error("Could not create uniform block list."); + *out_log = error; + return false; + } + + for (const auto& fragVar : *fragVars) { + for (const auto& vertVar : *vertVars) { + if (vertVar.name != fragVar.name) + continue; + + if (!vertVar.isSameInterfaceBlockAtLinkTime(fragVar)) { + nsPrintfCString error("Interface block `%s` is not linkable between" + " attached shaders.", + fragVar.name.c_str()); + *out_log = error; + return false; + } + + break; + } + } + } + + const auto& vertVaryings = ShGetVaryings(prev->mHandle); + const auto& fragVaryings = ShGetVaryings(mHandle); + if (!vertVaryings || !fragVaryings) { + nsPrintfCString error("Could not create varying list."); + *out_log = error; + return false; + } + + { + std::vector staticUseVaryingList; + + for (const auto& fragVarying : *fragVaryings) { + static const char prefix[] = "gl_"; + if (StartsWith(fragVarying.name, prefix)) { + if (fragVarying.staticUse) { + staticUseVaryingList.push_back(fragVarying); + } + continue; + } + + bool definedInVertShader = false; + bool staticVertUse = false; + + for (const auto& vertVarying : *vertVaryings) { + if (vertVarying.name != fragVarying.name) + continue; + + if (!vertVarying.isSameVaryingAtLinkTime(fragVarying, shaderVersion)) { + nsPrintfCString error("Varying `%s`is not linkable between" + " attached shaders.", + fragVarying.name.c_str()); + *out_log = error; + return false; + } + + definedInVertShader = true; + staticVertUse = vertVarying.staticUse; + break; + } + + if (!definedInVertShader && fragVarying.staticUse) { + nsPrintfCString error("Varying `%s` has static-use in the frag" + " shader, but is undeclared in the vert" + " shader.", fragVarying.name.c_str()); + *out_log = error; + return false; + } + + if (staticVertUse && fragVarying.staticUse) { + staticUseVaryingList.push_back(fragVarying); + } + } + + if (!ShCheckVariablesWithinPackingLimits(mMaxVaryingVectors, + staticUseVaryingList)) + { + *out_log = "Statically used varyings do not fit within packing limits. (see" + " GLSL ES Specification 1.0.17, p111)"; + return false; + } + } + + if (shaderVersion == 100) { + // Enforce ESSL1 invariant linking rules. + bool isInvariant_Position = false; + bool isInvariant_PointSize = false; + bool isInvariant_FragCoord = false; + bool isInvariant_PointCoord = false; + + for (const auto& varying : *vertVaryings) { + if (varying.name == "gl_Position") { + isInvariant_Position = varying.isInvariant; + } else if (varying.name == "gl_PointSize") { + isInvariant_PointSize = varying.isInvariant; + } + } + + for (const auto& varying : *fragVaryings) { + if (varying.name == "gl_FragCoord") { + isInvariant_FragCoord = varying.isInvariant; + } else if (varying.name == "gl_PointCoord") { + isInvariant_PointCoord = varying.isInvariant; + } + } + + //// + + const auto fnCanBuiltInsLink = [](bool vertIsInvariant, bool fragIsInvariant) { + if (vertIsInvariant) + return true; + + return !fragIsInvariant; + }; + + if (!fnCanBuiltInsLink(isInvariant_Position, isInvariant_FragCoord)) { + *out_log = "gl_Position must be invariant if gl_FragCoord is. (see GLSL ES" + " Specification 1.0.17, p39)"; + return false; + } + + if (!fnCanBuiltInsLink(isInvariant_PointSize, isInvariant_PointCoord)) { + *out_log = "gl_PointSize must be invariant if gl_PointCoord is. (see GLSL ES" + " Specification 1.0.17, p39)"; + return false; + } + } + + return true; +} + +size_t +ShaderValidator::CalcNumSamplerUniforms() const +{ + size_t accum = 0; + + const std::vector& uniforms = *ShGetUniforms(mHandle); + + for (auto itr = uniforms.begin(); itr != uniforms.end(); ++itr) { + GLenum type = itr->type; + if (type == LOCAL_GL_SAMPLER_2D || + type == LOCAL_GL_SAMPLER_CUBE) + { + accum += itr->arraySize; + } + } + + return accum; +} + +size_t +ShaderValidator::NumAttributes() const +{ + return ShGetAttributes(mHandle)->size(); +} + +// Attribs cannot be structs or arrays, and neither can vertex inputs in ES3. +// Therefore, attrib names are always simple. +bool +ShaderValidator::FindAttribUserNameByMappedName(const std::string& mappedName, + const std::string** const out_userName) const +{ + const std::vector& attribs = *ShGetAttributes(mHandle); + for (auto itr = attribs.begin(); itr != attribs.end(); ++itr) { + if (itr->mappedName == mappedName) { + *out_userName = &(itr->name); + return true; + } + } + + return false; +} + +bool +ShaderValidator::FindAttribMappedNameByUserName(const std::string& userName, + const std::string** const out_mappedName) const +{ + const std::vector& attribs = *ShGetAttributes(mHandle); + for (auto itr = attribs.begin(); itr != attribs.end(); ++itr) { + if (itr->name == userName) { + *out_mappedName = &(itr->mappedName); + return true; + } + } + + return false; +} + +bool +ShaderValidator::FindVaryingByMappedName(const std::string& mappedName, + std::string* const out_userName, + bool* const out_isArray) const +{ + const std::vector& varyings = *ShGetVaryings(mHandle); + for (auto itr = varyings.begin(); itr != varyings.end(); ++itr) { + const sh::ShaderVariable* found; + if (!itr->findInfoByMappedName(mappedName, &found, out_userName)) + continue; + + *out_isArray = found->isArray(); + return true; + } + + return false; +} + +bool +ShaderValidator::FindVaryingMappedNameByUserName(const std::string& userName, + const std::string** const out_mappedName) const +{ + const std::vector& attribs = *ShGetVaryings(mHandle); + for (auto itr = attribs.begin(); itr != attribs.end(); ++itr) { + if (itr->name == userName) { + *out_mappedName = &(itr->mappedName); + return true; + } + } + + return false; +} +// This must handle names like "foo.bar[0]". +bool +ShaderValidator::FindUniformByMappedName(const std::string& mappedName, + std::string* const out_userName, + bool* const out_isArray) const +{ + const std::vector& uniforms = *ShGetUniforms(mHandle); + for (auto itr = uniforms.begin(); itr != uniforms.end(); ++itr) { + const sh::ShaderVariable* found; + if (!itr->findInfoByMappedName(mappedName, &found, out_userName)) + continue; + + *out_isArray = found->isArray(); + return true; + } + + const size_t dotPos = mappedName.find("."); + + const std::vector& interfaces = *ShGetInterfaceBlocks(mHandle); + for (const auto& interface : interfaces) { + + std::string mappedFieldName; + const bool hasInstanceName = !interface.instanceName.empty(); + + // If the InterfaceBlock has an instanceName, all variables defined + // within the block are qualified with the block name, as opposed + // to being placed in the global scope. + if (hasInstanceName) { + + // If mappedName has no block name prefix, skip + if (std::string::npos == dotPos) + continue; + + // If mappedName has a block name prefix that doesn't match, skip + const std::string mappedInterfaceBlockName = mappedName.substr(0, dotPos); + if (interface.mappedName != mappedInterfaceBlockName) + continue; + + mappedFieldName = mappedName.substr(dotPos + 1); + } else { + mappedFieldName = mappedName; + } + + for (const auto& field : interface.fields) { + const sh::ShaderVariable* found; + + if (!field.findInfoByMappedName(mappedFieldName, &found, out_userName)) + continue; + + if (hasInstanceName) { + // Prepend the user name of the interface that matched + *out_userName = interface.name + "." + *out_userName; + } + + *out_isArray = found->isArray(); + return true; + } + } + + return false; +} + +bool +ShaderValidator::UnmapUniformBlockName(const nsACString& baseMappedName, + nsCString* const out_baseUserName) const +{ + const std::vector& interfaces = *ShGetInterfaceBlocks(mHandle); + for (const auto& interface : interfaces) { + const nsDependentCString interfaceMappedName(interface.mappedName.data(), + interface.mappedName.size()); + if (baseMappedName == interfaceMappedName) { + *out_baseUserName = interface.name.data(); + return true; + } + } + + return false; +} + +void +ShaderValidator::EnumerateFragOutputs(std::map &out_FragOutputs) const +{ + const auto* fragOutputs = ShGetOutputVariables(mHandle); + + if (fragOutputs) { + for (const auto& fragOutput : *fragOutputs) { + out_FragOutputs.insert({nsCString(fragOutput.name.c_str()), + nsCString(fragOutput.mappedName.c_str())}); + } + } +} + +} // namespace webgl +} // namespace mozilla diff --git a/dom/canvas/WebGLShaderValidator.h b/dom/canvas/WebGLShaderValidator.h new file mode 100644 index 000000000..deb1c7c7f --- /dev/null +++ b/dom/canvas/WebGLShaderValidator.h @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_SHADER_VALIDATOR_H_ +#define WEBGL_SHADER_VALIDATOR_H_ + +#include "angle/ShaderLang.h" +#include "GLDefs.h" +#include "nsString.h" +#include + +namespace mozilla { +namespace webgl { + +class ShaderValidator final +{ + const ShHandle mHandle; + const ShCompileOptions mCompileOptions; + const int mMaxVaryingVectors; + bool mHasRun; + +public: + static ShaderValidator* Create(GLenum shaderType, ShShaderSpec spec, + ShShaderOutput outputLanguage, + const ShBuiltInResources& resources, + ShCompileOptions compileOptions); + +private: + ShaderValidator(ShHandle handle, ShCompileOptions compileOptions, + int maxVaryingVectors) + : mHandle(handle) + , mCompileOptions(compileOptions) + , mMaxVaryingVectors(maxVaryingVectors) + , mHasRun(false) + { } + +public: + ~ShaderValidator(); + + bool ValidateAndTranslate(const char* source); + void GetInfoLog(nsACString* out) const; + void GetOutput(nsACString* out) const; + bool CanLinkTo(const ShaderValidator* prev, nsCString* const out_log) const; + size_t CalcNumSamplerUniforms() const; + size_t NumAttributes() const; + + bool FindAttribUserNameByMappedName(const std::string& mappedName, + const std::string** const out_userName) const; + + bool FindAttribMappedNameByUserName(const std::string& userName, + const std::string** const out_mappedName) const; + + bool FindVaryingMappedNameByUserName(const std::string& userName, + const std::string** const out_mappedName) const; + + bool FindVaryingByMappedName(const std::string& mappedName, + std::string* const out_userName, + bool* const out_isArray) const; + bool FindUniformByMappedName(const std::string& mappedName, + std::string* const out_userName, + bool* const out_isArray) const; + bool UnmapUniformBlockName(const nsACString& baseMappedName, + nsCString* const out_baseUserName) const; + + void EnumerateFragOutputs(std::map &out_FragOutputs) const; + + bool ValidateTransformFeedback(const std::vector& userNames, + uint32_t maxComponents, nsCString* const out_errorText, + std::vector* const out_mappedNames); +}; + +} // namespace webgl +} // namespace mozilla + +#endif // WEBGL_SHADER_VALIDATOR_H_ diff --git a/dom/canvas/WebGLStrongTypes.h b/dom/canvas/WebGLStrongTypes.h new file mode 100644 index 000000000..039673a99 --- /dev/null +++ b/dom/canvas/WebGLStrongTypes.h @@ -0,0 +1,457 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_STRONG_TYPES_H_ +#define WEBGL_STRONG_TYPES_H_ + +#include + +#include "GLDefs.h" +#include "mozilla/ArrayUtils.h" +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" + +/* Usage: + * =========== + * + * To create a new type from a set of GLenums do the following: + * + * STRONG_GLENUM_BEGIN(TypeName) + * STRONG_GLENUM_VALUE(ENUM1), + * STRONG_GLENUM_VALUE(ENUM2), + * ... + * STRONG_GLENUM_END() + * + * where TypeName is the name you want to give the type. Now simply use TypeName + * instead of GLenum. The enum values must be given without GL_ prefix. + * + * ~~~~~~~~~~~~~~~~ + * Important Notes: + * ~~~~~~~~~~~~~~~~ + * + * Boolean operators (==, !=) are provided in an effort to prevent some mistakes + * when using constants. For example we want to make sure that GL_ENUM_X is + * a valid value for the type in code like: + * + * if (myNewType == STRONG_GLENUM_VALUE(SOME_ENUM)) + * ... + * + * The operators will assert that STRONG_GLENUM_VALUE(SOME_ENUM) is a value that + * myNewType can have. + * + * ---- + * + * A get() method is provided to allow access to the underlying GLenum. This + * method should ideally only be called when passing parameters to the gl->fXXXX + * functions, and be used very minimally everywhere else. + * + * Definitely XXX - DO NOT DO - XXX: + * + * if (myNewType.get() == STRONG_GLENUM_VALUE(SOME_ENUM)) + * ... + * + * As that undermines the debug checks that were implemented in the ==, and != + * operators. If you see code like this it should be treated with suspicion. + * + * Background: + * =========== + * + * This macro is the first step in an effort to make the WebGL code safer. + * Many of the different functions take GLenum as their parameter which leads + * to bugs because of subtle differences in the enums purpose. For example there + * are two types of 'texture targets'. One is the texture binding locations: + * + * GL_TEXTURE_2D + * GL_TEXTURE_CUBE_MAP + * + * Yet, this is not the same as texture image targets: + * + * GL_TEXTURE_2D + * GL_TEXTURE_CUBE_MAP_POSITIVE_X + * GL_TEXTURE_CUBE_MAP_NEGATIVE_X + * GL_TEXTURE_CUBE_MAP_POSITIVE_Y + * ... + * + * This subtle distinction has already led to many bugs in the texture code + * because of invalid assumptions about what type goes where. The macro below + * is an attempt at fixing this by providing a small wrapper around GLenum that + * validates its values. + * + * Comparison between STRONG_GLENUM's vs. enum classes + * =================================================== + * + * The present STRONG_GLENUM's differ from ordinary enum classes + * in that they assert at runtime that their values are legal, and in that they + * allow implicit conversion from integers to STRONG_GLENUM's but disallow + * implicit conversion from STRONG_GLENUM's to integers (enum classes are the + * opposite). + * + * When to use GLenum's vs. STRONG_GLENUM's vs. enum classes + * ========================================================= + * + * Rule of thumb: + * * For unchecked GLenum constants, such as WebGL method parameters that + * haven't been validated yet, use GLenum. + * * For already-validated GLenum constants, use STRONG_GLENUM's. + * * For custom constants that aren't GL enum values, use enum classes. + */ + +template +class StrongGLenum final +{ +private: + static const GLenum NonexistantGLenum = 0xdeaddead; + + GLenum mValue; + + static void AssertOnceThatEnumValuesAreSorted() { +#ifdef DEBUG + static bool alreadyChecked = false; + if (alreadyChecked) { + return; + } + for (size_t i = 1; i < Details::valuesCount(); i++) { + MOZ_ASSERT(Details::values()[i] > Details::values()[i - 1], + "GLenum values should be sorted in ascending order"); + } + alreadyChecked = true; +#endif + } + +public: + StrongGLenum() +#ifdef DEBUG + : mValue(NonexistantGLenum) +#endif + { + AssertOnceThatEnumValuesAreSorted(); + } + + MOZ_IMPLICIT StrongGLenum(GLenum value) + : mValue(value) + { + AssertOnceThatEnumValuesAreSorted(); + MOZ_ASSERT(IsValueLegal(mValue)); + } + + GLenum get() const { + MOZ_ASSERT(mValue != NonexistantGLenum); + return mValue; + } + + bool operator==(const StrongGLenum& other) const { + return get() == other.get(); + } + + bool operator!=(const StrongGLenum& other) const { + return get() != other.get(); + } + + bool operator<=(const StrongGLenum& other) const { + return get() <= other.get(); + } + + bool operator>=(const StrongGLenum& other) const { + return get() >= other.get(); + } + + static bool IsValueLegal(GLenum value) { + if (value > UINT16_MAX) { + return false; + } + return std::binary_search(Details::values(), + Details::values() + Details::valuesCount(), + uint16_t(value)); + } +}; + +template +bool operator==(GLenum a, StrongGLenum
b) +{ + return a == b.get(); +} + +template +bool operator!=(GLenum a, StrongGLenum
b) +{ + return a != b.get(); +} + +template +bool operator==(StrongGLenum
a, GLenum b) +{ + return a.get() == b; +} + +template +bool operator!=(StrongGLenum
a, GLenum b) +{ + return a.get() != b; +} + +#define STRONG_GLENUM_BEGIN(NAME) \ + const uint16_t NAME##Values[] = { + +#define STRONG_GLENUM_VALUE(VALUE) LOCAL_GL_##VALUE + +#define STRONG_GLENUM_END(NAME) \ + }; \ + struct NAME##Details { \ + static size_t valuesCount() { return MOZ_ARRAY_LENGTH(NAME##Values); } \ + static const uint16_t* values() { return NAME##Values; } \ + }; \ + typedef StrongGLenum NAME; + +//////////////////////////////////////////////////////////////////////////////// +// Add types below. + +STRONG_GLENUM_BEGIN(TexImageTarget) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(TEXTURE_2D), + STRONG_GLENUM_VALUE(TEXTURE_3D), + STRONG_GLENUM_VALUE(TEXTURE_CUBE_MAP_POSITIVE_X), + STRONG_GLENUM_VALUE(TEXTURE_CUBE_MAP_NEGATIVE_X), + STRONG_GLENUM_VALUE(TEXTURE_CUBE_MAP_POSITIVE_Y), + STRONG_GLENUM_VALUE(TEXTURE_CUBE_MAP_NEGATIVE_Y), + STRONG_GLENUM_VALUE(TEXTURE_CUBE_MAP_POSITIVE_Z), + STRONG_GLENUM_VALUE(TEXTURE_CUBE_MAP_NEGATIVE_Z), + STRONG_GLENUM_VALUE(TEXTURE_2D_ARRAY), +STRONG_GLENUM_END(TexImageTarget) + +STRONG_GLENUM_BEGIN(TexTarget) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(TEXTURE_2D), + STRONG_GLENUM_VALUE(TEXTURE_3D), + STRONG_GLENUM_VALUE(TEXTURE_CUBE_MAP), + STRONG_GLENUM_VALUE(TEXTURE_2D_ARRAY), +STRONG_GLENUM_END(TexTarget) + +STRONG_GLENUM_BEGIN(TexType) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(BYTE), + STRONG_GLENUM_VALUE(UNSIGNED_BYTE), + STRONG_GLENUM_VALUE(SHORT), + STRONG_GLENUM_VALUE(UNSIGNED_SHORT), + STRONG_GLENUM_VALUE(INT), + STRONG_GLENUM_VALUE(UNSIGNED_INT), + STRONG_GLENUM_VALUE(FLOAT), + STRONG_GLENUM_VALUE(HALF_FLOAT), + STRONG_GLENUM_VALUE(UNSIGNED_SHORT_4_4_4_4), + STRONG_GLENUM_VALUE(UNSIGNED_SHORT_5_5_5_1), + STRONG_GLENUM_VALUE(UNSIGNED_SHORT_5_6_5), + STRONG_GLENUM_VALUE(UNSIGNED_INT_2_10_10_10_REV), + STRONG_GLENUM_VALUE(UNSIGNED_INT_24_8), + STRONG_GLENUM_VALUE(UNSIGNED_INT_10F_11F_11F_REV), + STRONG_GLENUM_VALUE(UNSIGNED_INT_5_9_9_9_REV), + STRONG_GLENUM_VALUE(HALF_FLOAT_OES), + STRONG_GLENUM_VALUE(FLOAT_32_UNSIGNED_INT_24_8_REV), +STRONG_GLENUM_END(TexType) + +STRONG_GLENUM_BEGIN(TexMinFilter) + STRONG_GLENUM_VALUE(NEAREST), + STRONG_GLENUM_VALUE(LINEAR), + STRONG_GLENUM_VALUE(NEAREST_MIPMAP_NEAREST), + STRONG_GLENUM_VALUE(LINEAR_MIPMAP_NEAREST), + STRONG_GLENUM_VALUE(NEAREST_MIPMAP_LINEAR), + STRONG_GLENUM_VALUE(LINEAR_MIPMAP_LINEAR), +STRONG_GLENUM_END(TexMinFilter) + +STRONG_GLENUM_BEGIN(TexMagFilter) + STRONG_GLENUM_VALUE(NEAREST), + STRONG_GLENUM_VALUE(LINEAR), +STRONG_GLENUM_END(TexMagFilter) + +STRONG_GLENUM_BEGIN(TexWrap) + STRONG_GLENUM_VALUE(REPEAT), + STRONG_GLENUM_VALUE(CLAMP_TO_EDGE), + STRONG_GLENUM_VALUE(MIRRORED_REPEAT), +STRONG_GLENUM_END(TexWrap) + +STRONG_GLENUM_BEGIN(TexCompareMode) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(COMPARE_REF_TO_TEXTURE), +STRONG_GLENUM_END(TexCompareMode) + +STRONG_GLENUM_BEGIN(TexCompareFunc) + STRONG_GLENUM_VALUE(NEVER), + STRONG_GLENUM_VALUE(LESS), + STRONG_GLENUM_VALUE(EQUAL), + STRONG_GLENUM_VALUE(LEQUAL), + STRONG_GLENUM_VALUE(GREATER), + STRONG_GLENUM_VALUE(NOTEQUAL), + STRONG_GLENUM_VALUE(GEQUAL), + STRONG_GLENUM_VALUE(ALWAYS), +STRONG_GLENUM_END(TexCompareFunc) + +STRONG_GLENUM_BEGIN(TexFormat) + STRONG_GLENUM_VALUE(NONE), // 0x0000 + STRONG_GLENUM_VALUE(DEPTH_COMPONENT), // 0x1902 + STRONG_GLENUM_VALUE(RED), // 0x1903 + STRONG_GLENUM_VALUE(ALPHA), // 0x1906 + STRONG_GLENUM_VALUE(RGB), // 0x1907 + STRONG_GLENUM_VALUE(RGBA), // 0x1908 + STRONG_GLENUM_VALUE(LUMINANCE), // 0x1909 + STRONG_GLENUM_VALUE(LUMINANCE_ALPHA), // 0x190A + STRONG_GLENUM_VALUE(RG), // 0x8227 + STRONG_GLENUM_VALUE(RG_INTEGER), // 0x8228 + STRONG_GLENUM_VALUE(DEPTH_STENCIL), // 0x84F9 + STRONG_GLENUM_VALUE(SRGB), // 0x8C40 + STRONG_GLENUM_VALUE(SRGB_ALPHA), // 0x8C42 + STRONG_GLENUM_VALUE(RED_INTEGER), // 0x8D94 + STRONG_GLENUM_VALUE(RGB_INTEGER), // 0x8D98 + STRONG_GLENUM_VALUE(RGBA_INTEGER), // 0x8D99 +STRONG_GLENUM_END(TexFormat) + +STRONG_GLENUM_BEGIN(TexInternalFormat) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(DEPTH_COMPONENT), + STRONG_GLENUM_VALUE(RED), + STRONG_GLENUM_VALUE(ALPHA), + STRONG_GLENUM_VALUE(RGB), + STRONG_GLENUM_VALUE(RGBA), + STRONG_GLENUM_VALUE(LUMINANCE), + STRONG_GLENUM_VALUE(LUMINANCE_ALPHA), + STRONG_GLENUM_VALUE(ALPHA8), + STRONG_GLENUM_VALUE(LUMINANCE8), + STRONG_GLENUM_VALUE(LUMINANCE8_ALPHA8), + STRONG_GLENUM_VALUE(RGB8), + STRONG_GLENUM_VALUE(RGBA4), + STRONG_GLENUM_VALUE(RGB5_A1), + STRONG_GLENUM_VALUE(RGBA8), + STRONG_GLENUM_VALUE(RGB10_A2), + STRONG_GLENUM_VALUE(DEPTH_COMPONENT16), + STRONG_GLENUM_VALUE(DEPTH_COMPONENT24), + STRONG_GLENUM_VALUE(RG), + STRONG_GLENUM_VALUE(RG_INTEGER), + STRONG_GLENUM_VALUE(R8), + STRONG_GLENUM_VALUE(RG8), + STRONG_GLENUM_VALUE(R16F), + STRONG_GLENUM_VALUE(R32F), + STRONG_GLENUM_VALUE(RG16F), + STRONG_GLENUM_VALUE(RG32F), + STRONG_GLENUM_VALUE(R8I), + STRONG_GLENUM_VALUE(R8UI), + STRONG_GLENUM_VALUE(R16I), + STRONG_GLENUM_VALUE(R16UI), + STRONG_GLENUM_VALUE(R32I), + STRONG_GLENUM_VALUE(R32UI), + STRONG_GLENUM_VALUE(RG8I), + STRONG_GLENUM_VALUE(RG8UI), + STRONG_GLENUM_VALUE(RG16I), + STRONG_GLENUM_VALUE(RG16UI), + STRONG_GLENUM_VALUE(RG32I), + STRONG_GLENUM_VALUE(RG32UI), + STRONG_GLENUM_VALUE(COMPRESSED_RGB_S3TC_DXT1_EXT), + STRONG_GLENUM_VALUE(COMPRESSED_RGBA_S3TC_DXT1_EXT), + STRONG_GLENUM_VALUE(COMPRESSED_RGBA_S3TC_DXT3_EXT), + STRONG_GLENUM_VALUE(COMPRESSED_RGBA_S3TC_DXT5_EXT), + STRONG_GLENUM_VALUE(DEPTH_STENCIL), + STRONG_GLENUM_VALUE(ATC_RGBA_INTERPOLATED_ALPHA), + STRONG_GLENUM_VALUE(RGBA32F), + STRONG_GLENUM_VALUE(RGB32F), + STRONG_GLENUM_VALUE(ALPHA32F_EXT), + STRONG_GLENUM_VALUE(LUMINANCE32F_EXT), + STRONG_GLENUM_VALUE(LUMINANCE_ALPHA32F_EXT), + STRONG_GLENUM_VALUE(RGBA16F), + STRONG_GLENUM_VALUE(RGB16F), + STRONG_GLENUM_VALUE(ALPHA16F_EXT), + STRONG_GLENUM_VALUE(LUMINANCE16F_EXT), + STRONG_GLENUM_VALUE(LUMINANCE_ALPHA16F_EXT), + STRONG_GLENUM_VALUE(DEPTH24_STENCIL8), + STRONG_GLENUM_VALUE(COMPRESSED_RGB_PVRTC_4BPPV1), + STRONG_GLENUM_VALUE(COMPRESSED_RGB_PVRTC_2BPPV1), + STRONG_GLENUM_VALUE(COMPRESSED_RGBA_PVRTC_4BPPV1), + STRONG_GLENUM_VALUE(COMPRESSED_RGBA_PVRTC_2BPPV1), + STRONG_GLENUM_VALUE(R11F_G11F_B10F), + STRONG_GLENUM_VALUE(RGB9_E5), + STRONG_GLENUM_VALUE(SRGB), + STRONG_GLENUM_VALUE(SRGB8), + STRONG_GLENUM_VALUE(SRGB_ALPHA), + STRONG_GLENUM_VALUE(SRGB8_ALPHA8), + STRONG_GLENUM_VALUE(ATC_RGB), + STRONG_GLENUM_VALUE(ATC_RGBA_EXPLICIT_ALPHA), + STRONG_GLENUM_VALUE(DEPTH_COMPONENT32F), + STRONG_GLENUM_VALUE(DEPTH32F_STENCIL8), + STRONG_GLENUM_VALUE(RGB565), + STRONG_GLENUM_VALUE(ETC1_RGB8_OES), + STRONG_GLENUM_VALUE(RGBA32UI), + STRONG_GLENUM_VALUE(RGB32UI), + STRONG_GLENUM_VALUE(RGBA16UI), + STRONG_GLENUM_VALUE(RGB16UI), + STRONG_GLENUM_VALUE(RGBA8UI), + STRONG_GLENUM_VALUE(RGB8UI), + STRONG_GLENUM_VALUE(RGBA32I), + STRONG_GLENUM_VALUE(RGB32I), + STRONG_GLENUM_VALUE(RGBA16I), + STRONG_GLENUM_VALUE(RGB16I), + STRONG_GLENUM_VALUE(RGBA8I), + STRONG_GLENUM_VALUE(RGB8I), + STRONG_GLENUM_VALUE(RED_INTEGER), + STRONG_GLENUM_VALUE(RGB_INTEGER), + STRONG_GLENUM_VALUE(RGBA_INTEGER), + STRONG_GLENUM_VALUE(R8_SNORM), + STRONG_GLENUM_VALUE(RG8_SNORM), + STRONG_GLENUM_VALUE(RGB8_SNORM), + STRONG_GLENUM_VALUE(RGBA8_SNORM), + STRONG_GLENUM_VALUE(RGB10_A2UI), +STRONG_GLENUM_END(TexInternalFormat) + +STRONG_GLENUM_BEGIN(FBTarget) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(READ_FRAMEBUFFER), + STRONG_GLENUM_VALUE(DRAW_FRAMEBUFFER), + STRONG_GLENUM_VALUE(FRAMEBUFFER), +STRONG_GLENUM_END(FBTarget) + +STRONG_GLENUM_BEGIN(RBTarget) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(RENDERBUFFER), +STRONG_GLENUM_END(RBTarget) + +STRONG_GLENUM_BEGIN(FBStatus) + STRONG_GLENUM_VALUE(FRAMEBUFFER_COMPLETE), + STRONG_GLENUM_VALUE(FRAMEBUFFER_INCOMPLETE_ATTACHMENT), + STRONG_GLENUM_VALUE(FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT), + STRONG_GLENUM_VALUE(FRAMEBUFFER_INCOMPLETE_DIMENSIONS), + STRONG_GLENUM_VALUE(FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER), + STRONG_GLENUM_VALUE(FRAMEBUFFER_INCOMPLETE_READ_BUFFER), + STRONG_GLENUM_VALUE(FRAMEBUFFER_UNSUPPORTED), +STRONG_GLENUM_END(FBStatus) + +STRONG_GLENUM_BEGIN(RBParam) + STRONG_GLENUM_VALUE(RENDERBUFFER_SAMPLES), + STRONG_GLENUM_VALUE(RENDERBUFFER_WIDTH), + STRONG_GLENUM_VALUE(RENDERBUFFER_HEIGHT), + STRONG_GLENUM_VALUE(RENDERBUFFER_INTERNAL_FORMAT), + STRONG_GLENUM_VALUE(RENDERBUFFER_RED_SIZE), + STRONG_GLENUM_VALUE(RENDERBUFFER_GREEN_SIZE), + STRONG_GLENUM_VALUE(RENDERBUFFER_BLUE_SIZE), + STRONG_GLENUM_VALUE(RENDERBUFFER_ALPHA_SIZE), + STRONG_GLENUM_VALUE(RENDERBUFFER_DEPTH_SIZE), + STRONG_GLENUM_VALUE(RENDERBUFFER_STENCIL_SIZE), +STRONG_GLENUM_END(RBParam) + +STRONG_GLENUM_BEGIN(VAOBinding) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(VERTEX_ARRAY_BINDING), +STRONG_GLENUM_END(VAOBinding) + +STRONG_GLENUM_BEGIN(BufferBinding) + STRONG_GLENUM_VALUE(NONE), // 0x0000 + STRONG_GLENUM_VALUE(ARRAY_BUFFER), // 0x8892 + STRONG_GLENUM_VALUE(ELEMENT_ARRAY_BUFFER), // 0x8893 + STRONG_GLENUM_VALUE(PIXEL_PACK_BUFFER), // 0x88EB + STRONG_GLENUM_VALUE(PIXEL_UNPACK_BUFFER), // 0x88EC + STRONG_GLENUM_VALUE(UNIFORM_BUFFER), // 0x8A11 + STRONG_GLENUM_VALUE(TRANSFORM_FEEDBACK_BUFFER), // 0x8C8E +STRONG_GLENUM_END(BufferBinding) + +STRONG_GLENUM_BEGIN(QueryBinding) + STRONG_GLENUM_VALUE(NONE), + STRONG_GLENUM_VALUE(TIME_ELAPSED_EXT), + STRONG_GLENUM_VALUE(TIMESTAMP_EXT), +STRONG_GLENUM_END(QueryBinding) + +#endif // WEBGL_STRONG_TYPES_H_ diff --git a/dom/canvas/WebGLSync.cpp b/dom/canvas/WebGLSync.cpp new file mode 100644 index 000000000..c6988fba6 --- /dev/null +++ b/dom/canvas/WebGLSync.cpp @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLSync.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLSync::WebGLSync(WebGLContext* webgl, GLenum condition, GLbitfield flags) + : WebGLRefCountedObject(webgl) +{ + mContext->mSyncs.insertBack(this); + mGLName = mContext->gl->fFenceSync(condition, flags); +} + +WebGLSync::~WebGLSync() +{ + DeleteOnce(); +} + +void +WebGLSync::Delete() +{ + mContext->MakeContextCurrent(); + mContext->gl->fDeleteSync(mGLName); + mGLName = 0; + LinkedListElement::removeFrom(mContext->mSyncs); +} + +WebGLContext* +WebGLSync::GetParentObject() const +{ + return mContext; +} + +// ------------------------------------------------------------------------- +// IMPLEMENT NS +JSObject* +WebGLSync::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLSyncBinding::Wrap(cx, this, givenProto); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLSync) +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLSync, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLSync, Release); + +} // namespace mozilla diff --git a/dom/canvas/WebGLSync.h b/dom/canvas/WebGLSync.h new file mode 100644 index 000000000..7a31b9c60 --- /dev/null +++ b/dom/canvas/WebGLSync.h @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_SYNC_H_ +#define WEBGL_SYNC_H_ + +#include "mozilla/LinkedList.h" +#include "nsWrapperCache.h" +#include "WebGLObjectModel.h" + +namespace mozilla { + +class WebGLSync final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + friend class WebGL2Context; + +public: + WebGLSync(WebGLContext* webgl, GLenum condition, GLbitfield flags); + + void Delete(); + WebGLContext* GetParentObject() const; + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSync) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSync) + +private: + ~WebGLSync(); + + GLsync mGLName; +}; + +} // namespace mozilla + +#endif // WEBGL_SYNC_H_ diff --git a/dom/canvas/WebGLTexelConversions.cpp b/dom/canvas/WebGLTexelConversions.cpp new file mode 100644 index 000000000..f6ffe0cae --- /dev/null +++ b/dom/canvas/WebGLTexelConversions.cpp @@ -0,0 +1,435 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLContext.h" +#include "WebGLTexelConversions.h" + +namespace mozilla { + +using namespace WebGLTexelConversions; + +namespace { + +/** @class WebGLImageConverter + * + * This class is just a helper to implement WebGLContext::ConvertImage below. + * + * Design comments: + * + * WebGLContext::ConvertImage has to handle hundreds of format conversion paths. + * It is important to minimize executable code size here. Instead of passing around + * a large number of function parameters hundreds of times, we create a + * WebGLImageConverter object once, storing these parameters, and then we call + * the run() method on it. + */ +class WebGLImageConverter +{ + const size_t mWidth, mHeight; + const void* const mSrcStart; + void* const mDstStart; + const ptrdiff_t mSrcStride, mDstStride; + bool mAlreadyRun; + bool mSuccess; + + /* + * Returns sizeof(texel)/sizeof(type). The point is that we will iterate over + * texels with typed pointers and this value will tell us by how much we need + * to increment these pointers to advance to the next texel. + */ + template + static size_t NumElementsPerTexelForFormat() { + switch (Format) { + case WebGLTexelFormat::A8: + case WebGLTexelFormat::A16F: + case WebGLTexelFormat::A32F: + case WebGLTexelFormat::R8: + case WebGLTexelFormat::R16F: + case WebGLTexelFormat::R32F: + case WebGLTexelFormat::RGB565: + case WebGLTexelFormat::RGB11F11F10F: + case WebGLTexelFormat::RGBA4444: + case WebGLTexelFormat::RGBA5551: + return 1; + case WebGLTexelFormat::RA8: + case WebGLTexelFormat::RA16F: + case WebGLTexelFormat::RA32F: + case WebGLTexelFormat::RG8: + case WebGLTexelFormat::RG16F: + case WebGLTexelFormat::RG32F: + return 2; + case WebGLTexelFormat::RGB8: + case WebGLTexelFormat::RGB16F: + case WebGLTexelFormat::RGB32F: + return 3; + case WebGLTexelFormat::RGBA8: + case WebGLTexelFormat::RGBA16F: + case WebGLTexelFormat::RGBA32F: + case WebGLTexelFormat::BGRX8: + case WebGLTexelFormat::BGRA8: + return 4; + default: + MOZ_ASSERT(false, "Unknown texel format. Coding mistake?"); + return 0; + } + } + + /* + * This is the completely format-specific templatized conversion function, + * that will be instantiated hundreds of times for all different combinations. + * It is important to avoid generating useless code here. In particular, many + * instantiations of this function template will never be called, so we try + * to return immediately in these cases to allow the compiler to avoid generating + * useless code. + */ + template + void run() + { + // check for never-called cases. We early-return to allow the compiler + // to avoid generating this code. It would be tempting to abort() instead, + // as returning early does leave the destination surface with uninitialized + // data, but that would not allow the compiler to avoid generating this code. + // So instead, we return early, so Success() will return false, and the caller + // must check that and abort in that case. See WebGLContext::ConvertImage. + + if (SrcFormat == DstFormat && + PremultiplicationOp == WebGLTexelPremultiplicationOp::None) + { + // Should have used a fast exit path earlier, rather than entering this function. + // we explicitly return here to allow the compiler to avoid generating this code + return; + } + + // Only textures uploaded from DOM elements or ImageData can allow DstFormat != SrcFormat. + // DOM elements can only give BGRA8, BGRX8, A8, RGB565 formats. See DOMElementToImageSurface. + // ImageData is always RGBA8. So all other SrcFormat will always satisfy DstFormat==SrcFormat, + // so we can avoid compiling the code for all the unreachable paths. + const bool CanSrcFormatComeFromDOMElementOrImageData + = SrcFormat == WebGLTexelFormat::BGRA8 || + SrcFormat == WebGLTexelFormat::BGRX8 || + SrcFormat == WebGLTexelFormat::A8 || + SrcFormat == WebGLTexelFormat::RGB565 || + SrcFormat == WebGLTexelFormat::RGBA8; + if (!CanSrcFormatComeFromDOMElementOrImageData && + SrcFormat != DstFormat) + { + return; + } + + // Likewise, only textures uploaded from DOM elements or ImageData can possibly have to be unpremultiplied. + if (!CanSrcFormatComeFromDOMElementOrImageData && + PremultiplicationOp == WebGLTexelPremultiplicationOp::Unpremultiply) + { + return; + } + + // there is no point in premultiplication/unpremultiplication + // in the following cases: + // - the source format has no alpha + // - the source format has no color + // - the destination format has no color + if (!HasAlpha(SrcFormat) || + !HasColor(SrcFormat) || + !HasColor(DstFormat)) + { + + if (PremultiplicationOp != WebGLTexelPremultiplicationOp::None) + { + return; + } + } + + // end of early return cases. + + MOZ_ASSERT(!mAlreadyRun, "converter should be run only once!"); + mAlreadyRun = true; + + // gather some compile-time meta-data about the formats at hand. + + typedef + typename DataTypeForFormat::Type + SrcType; + typedef + typename DataTypeForFormat::Type + DstType; + + const WebGLTexelFormat IntermediateSrcFormat + = IntermediateFormat::Value; + const WebGLTexelFormat IntermediateDstFormat + = IntermediateFormat::Value; + typedef + typename DataTypeForFormat::Type + IntermediateSrcType; + typedef + typename DataTypeForFormat::Type + IntermediateDstType; + + const size_t NumElementsPerSrcTexel = NumElementsPerTexelForFormat(); + const size_t NumElementsPerDstTexel = NumElementsPerTexelForFormat(); + const size_t MaxElementsPerTexel = 4; + MOZ_ASSERT(NumElementsPerSrcTexel <= MaxElementsPerTexel, "unhandled format"); + MOZ_ASSERT(NumElementsPerDstTexel <= MaxElementsPerTexel, "unhandled format"); + + // we assume that the strides are multiples of the sizeof of respective types. + // this assumption will allow us to iterate over src and dst images using typed + // pointers, e.g. uint8_t* or uint16_t* or float*, instead of untyped pointers. + // So this assumption allows us to write cleaner and safer code, but it might + // not be true forever and if it eventually becomes wrong, we'll have to revert + // to always iterating using uint8_t* pointers regardless of the types at hand. + MOZ_ASSERT(mSrcStride % sizeof(SrcType) == 0 && + mDstStride % sizeof(DstType) == 0, + "Unsupported: texture stride is not a multiple of sizeof(type)"); + const ptrdiff_t srcStrideInElements = mSrcStride / sizeof(SrcType); + const ptrdiff_t dstStrideInElements = mDstStride / sizeof(DstType); + + const SrcType* srcRowStart = static_cast(mSrcStart); + DstType* dstRowStart = static_cast(mDstStart); + + // the loop performing the texture format conversion + for (size_t i = 0; i < mHeight; ++i) { + const SrcType* srcRowEnd = srcRowStart + mWidth * NumElementsPerSrcTexel; + const SrcType* srcPtr = srcRowStart; + DstType* dstPtr = dstRowStart; + while (srcPtr != srcRowEnd) { + // convert a single texel. We proceed in 3 steps: unpack the source texel + // so the corresponding interchange format (e.g. unpack RGB565 to RGBA8), + // convert the resulting data type to the destination type (e.g. convert + // from RGBA8 to RGBA32F), and finally pack the destination texel + // (e.g. pack RGBA32F to RGB32F). + IntermediateSrcType unpackedSrc[MaxElementsPerTexel]; + IntermediateDstType unpackedDst[MaxElementsPerTexel]; + + // unpack a src texel to corresponding intermediate src format. + // for example, unpack RGB565 to RGBA8 + unpack(srcPtr, unpackedSrc); + // convert the data type to the destination type, if needed. + // for example, convert RGBA8 to RGBA32F + convertType(unpackedSrc, unpackedDst); + // pack the destination texel. + // for example, pack RGBA32F to RGB32F + pack(unpackedDst, dstPtr); + + srcPtr += NumElementsPerSrcTexel; + dstPtr += NumElementsPerDstTexel; + } + srcRowStart += srcStrideInElements; + dstRowStart += dstStrideInElements; + } + + mSuccess = true; + return; + } + + template + void run(WebGLTexelPremultiplicationOp premultiplicationOp) + { + #define WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP(PremultiplicationOp) \ + case PremultiplicationOp: \ + return run(); + + switch (premultiplicationOp) { + WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP(WebGLTexelPremultiplicationOp::None) + WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP(WebGLTexelPremultiplicationOp::Premultiply) + WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP(WebGLTexelPremultiplicationOp::Unpremultiply) + default: + MOZ_ASSERT(false, "unhandled case. Coding mistake?"); + } + + #undef WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP + } + + template + void run(WebGLTexelFormat dstFormat, + WebGLTexelPremultiplicationOp premultiplicationOp) + { + #define WEBGLIMAGECONVERTER_CASE_DSTFORMAT(DstFormat) \ + case DstFormat: \ + return run(premultiplicationOp); + + switch (dstFormat) { + // 1-channel formats + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::A8) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::A16F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::A32F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::R8) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::R16F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::R32F) + // 2-channel formats + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RA8) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RA16F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RA32F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RG8) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RG16F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RG32F) + // 3-channel formats + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGB565) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGB8) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGB11F11F10F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGB16F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGB32F) + // 4-channel formats + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGBA4444) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGBA5551) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGBA8) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGBA16F) + WEBGLIMAGECONVERTER_CASE_DSTFORMAT(WebGLTexelFormat::RGBA32F) + + default: + MOZ_ASSERT(false, "unhandled case. Coding mistake?"); + } + + #undef WEBGLIMAGECONVERTER_CASE_DSTFORMAT + } + +public: + + void run(WebGLTexelFormat srcFormat, + WebGLTexelFormat dstFormat, + WebGLTexelPremultiplicationOp premultiplicationOp) + { + #define WEBGLIMAGECONVERTER_CASE_SRCFORMAT(SrcFormat) \ + case SrcFormat: \ + return run(dstFormat, premultiplicationOp); + + switch (srcFormat) { + // 1-channel formats + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::A8) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::A16F) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::A32F) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::R8) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::R16F) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::R32F) + // 2-channel formats + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RA8) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RA16F) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RA32F) + // 3-channel formats + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGB565) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGB8) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGB16F) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGB32F) + // 4-channel formats + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGBA4444) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGBA5551) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGBA8) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGBA16F) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::RGBA32F) + // DOM element source formats + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::BGRX8) + WEBGLIMAGECONVERTER_CASE_SRCFORMAT(WebGLTexelFormat::BGRA8) + + default: + MOZ_ASSERT(false, "unhandled case. Coding mistake?"); + } + + #undef WEBGLIMAGECONVERTER_CASE_SRCFORMAT + } + + WebGLImageConverter(size_t width, size_t height, + const void* srcStart, void* dstStart, + ptrdiff_t srcStride, ptrdiff_t dstStride) + : mWidth(width), mHeight(height), + mSrcStart(srcStart), mDstStart(dstStart), + mSrcStride(srcStride), mDstStride(dstStride), + mAlreadyRun(false), mSuccess(false) + {} + + bool Success() const { + return mSuccess; + } +}; + +} // end anonymous namespace + +bool +ConvertImage(size_t width, size_t height, + const void* srcBegin, size_t srcStride, gl::OriginPos srcOrigin, + WebGLTexelFormat srcFormat, bool srcPremultiplied, + void* dstBegin, size_t dstStride, gl::OriginPos dstOrigin, + WebGLTexelFormat dstFormat, bool dstPremultiplied, + bool* const out_wasTrivial) +{ + *out_wasTrivial = true; + + if (srcFormat == WebGLTexelFormat::FormatNotSupportingAnyConversion || + dstFormat == WebGLTexelFormat::FormatNotSupportingAnyConversion) + { + return false; + } + + if (!width || !height) + return true; + + const bool shouldYFlip = (srcOrigin != dstOrigin); + + const bool canSkipPremult = (!HasAlpha(srcFormat) || + !HasColor(srcFormat) || + !HasColor(dstFormat)); + + WebGLTexelPremultiplicationOp premultOp; + if (canSkipPremult) { + premultOp = WebGLTexelPremultiplicationOp::None; + } else if (!srcPremultiplied && dstPremultiplied) { + premultOp = WebGLTexelPremultiplicationOp::Premultiply; + } else if (srcPremultiplied && !dstPremultiplied) { + premultOp = WebGLTexelPremultiplicationOp::Unpremultiply; + } else { + premultOp = WebGLTexelPremultiplicationOp::None; + } + + const uint8_t* srcItr = (const uint8_t*)srcBegin; + const uint8_t* const srcEnd = srcItr + srcStride * height; + uint8_t* dstItr = (uint8_t*)dstBegin; + ptrdiff_t dstItrStride = dstStride; + if (shouldYFlip) { + dstItr = dstItr + dstStride * (height - 1); + dstItrStride = -dstItrStride; + } + + if (srcFormat == dstFormat && premultOp == WebGLTexelPremultiplicationOp::None) { + // Fast exit path: we just have to memcpy all the rows. + // + // The case where absolutely nothing needs to be done is supposed to have + // been handled earlier (in TexImage2D_base, etc). + // + // So the case we're handling here is when even though no format conversion is + // needed, we still might have to flip vertically and/or to adjust to a different + // stride. + + // We ignore canSkipPremult for this perf trap, since it's an avoidable perf cliff + // under the WebGL API user's control. + MOZ_ASSERT((srcPremultiplied != dstPremultiplied || + shouldYFlip || + srcStride != dstStride), + "Performance trap -- should handle this case earlier to avoid memcpy"); + + const auto bytesPerPixel = TexelBytesForFormat(srcFormat); + const size_t bytesPerRow = bytesPerPixel * width; + + while (srcItr != srcEnd) { + memcpy(dstItr, srcItr, bytesPerRow); + srcItr += srcStride; + dstItr += dstItrStride; + } + return true; + } + + *out_wasTrivial = false; + + WebGLImageConverter converter(width, height, srcItr, dstItr, srcStride, dstItrStride); + converter.run(srcFormat, dstFormat, premultOp); + + if (!converter.Success()) { + // the dst image may be left uninitialized, so we better not try to + // continue even in release builds. This should never happen anyway, + // and would be a bug in our code. + NS_RUNTIMEABORT("programming mistake in WebGL texture conversions"); + } + + return true; +} + +} // end namespace mozilla diff --git a/dom/canvas/WebGLTexelConversions.h b/dom/canvas/WebGLTexelConversions.h new file mode 100644 index 000000000..19af9f65e --- /dev/null +++ b/dom/canvas/WebGLTexelConversions.h @@ -0,0 +1,1345 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010 Mozilla Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WEBGLTEXELCONVERSIONS_H_ +#define WEBGLTEXELCONVERSIONS_H_ + +#ifdef __SUNPRO_CC +#define __restrict +#endif + +#include "WebGLTypes.h" +#include +#include "mozilla/Attributes.h" +#include "mozilla/Casting.h" + +namespace mozilla { + +bool ConvertImage(size_t width, size_t height, + const void* srcBegin, size_t srcStride, gl::OriginPos srcOrigin, + WebGLTexelFormat srcFormat, bool srcPremultiplied, + void* dstBegin, size_t dstStride, gl::OriginPos dstOrigin, + WebGLTexelFormat dstFormat, bool dstPremultiplied, + bool* out_wasTrivial); + +////////////////////////////////////////////////////////////////////////////////////////// + +// single precision float +// seeeeeeeemmmmmmmmmmmmmmmmmmmmmmm + +// half precision float +// seeeeemmmmmmmmmm + +// IEEE 16bits floating point: +const uint16_t kFloat16Value_Zero = 0x0000; // = 0000000000000000b +const uint16_t kFloat16Value_One = 0x3C00; // = 0011110000000000b +const uint16_t kFloat16Value_Infinity = 0x7C00; // = 0111110000000000b +const uint16_t kFloat16Value_NaN = 0x7FFF; // = 011111yyyyyyyyyyb (nonzero y) + +MOZ_ALWAYS_INLINE uint16_t +packToFloat16(float v) +{ + union { + float f32Value; + uint32_t f32Bits; + }; + + f32Value = v; + + // pull the sign from v into f16bits + uint16_t f16Bits = uint16_t(f32Bits >> 16) & 0x8000; + const uint32_t mantissa = f32Bits & 0x7FFFFF; + const uint32_t exp = (f32Bits >> 23) & 0xFF; + + // Adapted from: OpenGL ES 2.0 Programming Guide Appx. + // Converting Float to Half-Float + // 143 = 255 - 127 + 15 + // = sp_max - sp_bias + hp_bias + if (exp >= 143) { + if (mantissa && exp == 0xFF) { + // Single precision was NaN + return f16Bits | kFloat16Value_NaN; + } else { + // Outside range, store as infinity + return f16Bits | kFloat16Value_Infinity; + } + } + + // too small, try to make a denormalized number + // 112 = 255 - 127 - (15 + 1) + // = sp_max - sp_bias - (hp_bias + 1) + if (exp <= 112) { + return f16Bits | uint16_t(mantissa >> (14 + 112 - exp)); + } + + f16Bits |= uint16_t(exp - 112) << 10; + f16Bits |= uint16_t(mantissa >> 13) & 0x03FF; + + return f16Bits; +} + +MOZ_ALWAYS_INLINE float +unpackFromFloat16(uint16_t v) +{ + union { + float f32Value; + uint32_t f32Bits; + }; + + // grab sign bit + f32Bits = uint32_t(v & 0x8000) << 16; + uint16_t exp = (v >> 10) & 0x001F; + uint16_t mantissa = v & 0x03FF; + + if (!exp) { + // Handle denormalized numbers + // Adapted from: OpenGL ES 2.0 Programming Guide Appx. + // Converting Float to Half-Float + if (mantissa) { + exp = 112; // See packToFloat16 + mantissa <<= 1; + // For every leading zero, decrement the exponent + // and shift the mantissa to the left + while ((mantissa & (1 << 10)) == 0) { + mantissa <<= 1; + --exp; + } + mantissa &= 0x03FF; + + f32Bits |= (exp << 23) | (mantissa << 13); + + // Denormalized number + return f32Value; + } + + // +/- zero + return f32Value; + } + + if (exp == 0x001F) { + if (v & 0x03FF) { + // this is a NaN + f32Bits |= 0x7FFFFFFF; + } else { + // this is -inf or +inf + f32Bits |= 0x7F800000; + } + return f32Value; + } + + f32Bits |= uint32_t(exp + (-15 + 127)) << 23; + f32Bits |= uint32_t(v & 0x03FF) << 13; + + return f32Value; +} + +// These routines come from angle/common/mathutil.h +// They are copied here to remove the dependency on ANGLE headers +// included from mathutil.h +MOZ_ALWAYS_INLINE uint16_t +packToFloat11(float fp32) +{ + const unsigned int float32MantissaMask = 0x7FFFFF; + const unsigned int float32ExponentMask = 0x7F800000; + const unsigned int float32SignMask = 0x80000000; + const unsigned int float32ValueMask = ~float32SignMask; + const unsigned int float32ExponentFirstBit = 23; + const unsigned int float32ExponentBias = 127; + + const unsigned short float11Max = 0x7BF; + const unsigned short float11MantissaMask = 0x3F; + const unsigned short float11ExponentMask = 0x7C0; + const unsigned short float11BitMask = 0x7FF; + const unsigned int float11ExponentBias = 14; + + const unsigned int float32Maxfloat11 = 0x477E0000; + const unsigned int float32Minfloat11 = 0x38800000; + + const unsigned int float32Bits = BitwiseCast(fp32); + const bool float32Sign = (float32Bits & float32SignMask) == float32SignMask; + + unsigned int float32Val = float32Bits & float32ValueMask; + + if ((float32Val & float32ExponentMask) == float32ExponentMask) + { + // INF or NAN + if ((float32Val & float32MantissaMask) != 0) + { + return float11ExponentMask | (((float32Val >> 17) | (float32Val >> 11) | (float32Val >> 6) | (float32Val)) & float11MantissaMask); + } + else if (float32Sign) + { + // -INF is clamped to 0 since float11 is positive only + return 0; + } + else + { + return float11ExponentMask; + } + } + else if (float32Sign) + { + // float11 is positive only, so clamp to zero + return 0; + } + else if (float32Val > float32Maxfloat11) + { + // The number is too large to be represented as a float11, set to max + return float11Max; + } + else + { + if (float32Val < float32Minfloat11) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + const unsigned int shift = (float32ExponentBias - float11ExponentBias) - (float32Val >> float32ExponentFirstBit); + float32Val = ((1 << float32ExponentFirstBit) | (float32Val & float32MantissaMask)) >> shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + float32Val += 0xC8000000; + } + + return ((float32Val + 0xFFFF + ((float32Val >> 17) & 1)) >> 17) & float11BitMask; + } +} + +MOZ_ALWAYS_INLINE uint16_t +packToFloat10(float fp32) +{ + const unsigned int float32MantissaMask = 0x7FFFFF; + const unsigned int float32ExponentMask = 0x7F800000; + const unsigned int float32SignMask = 0x80000000; + const unsigned int float32ValueMask = ~float32SignMask; + const unsigned int float32ExponentFirstBit = 23; + const unsigned int float32ExponentBias = 127; + + const unsigned short float10Max = 0x3DF; + const unsigned short float10MantissaMask = 0x1F; + const unsigned short float10ExponentMask = 0x3E0; + const unsigned short float10BitMask = 0x3FF; + const unsigned int float10ExponentBias = 14; + + const unsigned int float32Maxfloat10 = 0x477C0000; + const unsigned int float32Minfloat10 = 0x38800000; + + const unsigned int float32Bits = BitwiseCast(fp32); + const bool float32Sign = (float32Bits & float32SignMask) == float32SignMask; + + unsigned int float32Val = float32Bits & float32ValueMask; + + if ((float32Val & float32ExponentMask) == float32ExponentMask) + { + // INF or NAN + if ((float32Val & float32MantissaMask) != 0) + { + return float10ExponentMask | (((float32Val >> 18) | (float32Val >> 13) | (float32Val >> 3) | (float32Val)) & float10MantissaMask); + } + else if (float32Sign) + { + // -INF is clamped to 0 since float11 is positive only + return 0; + } + else + { + return float10ExponentMask; + } + } + else if (float32Sign) + { + // float10 is positive only, so clamp to zero + return 0; + } + else if (float32Val > float32Maxfloat10) + { + // The number is too large to be represented as a float11, set to max + return float10Max; + } + else + { + if (float32Val < float32Minfloat10) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + const unsigned int shift = (float32ExponentBias - float10ExponentBias) - (float32Val >> float32ExponentFirstBit); + float32Val = ((1 << float32ExponentFirstBit) | (float32Val & float32MantissaMask)) >> shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + float32Val += 0xC8000000; + } + + return ((float32Val + 0x1FFFF + ((float32Val >> 18) & 1)) >> 18) & float10BitMask; + } +} + + +enum class WebGLTexelPremultiplicationOp : int { + None, + Premultiply, + Unpremultiply +}; + +namespace WebGLTexelConversions { + +template +struct IsFloatFormat +{ + static const bool Value = + Format == WebGLTexelFormat::A32F || + Format == WebGLTexelFormat::R32F || + Format == WebGLTexelFormat::RA32F || + Format == WebGLTexelFormat::RG32F || + Format == WebGLTexelFormat::RGB11F11F10F || + Format == WebGLTexelFormat::RGB32F || + Format == WebGLTexelFormat::RGBA32F; +}; + +template +struct IsHalfFloatFormat +{ + static const bool Value = + Format == WebGLTexelFormat::A16F || + Format == WebGLTexelFormat::R16F || + Format == WebGLTexelFormat::RA16F || + Format == WebGLTexelFormat::RG16F || + Format == WebGLTexelFormat::RGB16F || + Format == WebGLTexelFormat::RGBA16F; +}; + +template +struct Is16bppFormat +{ + static const bool Value = + Format == WebGLTexelFormat::RGB565 || + Format == WebGLTexelFormat::RGBA4444 || + Format == WebGLTexelFormat::RGBA5551; +}; + +template::Value, + bool Is16bpp = Is16bppFormat::Value, + bool IsHalfFloat = IsHalfFloatFormat::Value> +struct DataTypeForFormat +{ + typedef uint8_t Type; +}; + +template +struct DataTypeForFormat +{ + typedef float Type; +}; + +template +struct DataTypeForFormat +{ + typedef uint16_t Type; +}; + +template +struct DataTypeForFormat +{ + typedef uint16_t Type; +}; + +template<> +struct DataTypeForFormat +{ + typedef uint32_t Type; +}; + +template +struct IntermediateFormat +{ + static const WebGLTexelFormat Value + = IsFloatFormat::Value + ? WebGLTexelFormat::RGBA32F + : IsHalfFloatFormat::Value ? WebGLTexelFormat::RGBA16F + : WebGLTexelFormat::RGBA8; +}; + +inline size_t TexelBytesForFormat(WebGLTexelFormat format) { + switch (format) { + case WebGLTexelFormat::A8: + case WebGLTexelFormat::R8: + return 1; + case WebGLTexelFormat::A16F: + case WebGLTexelFormat::R16F: + case WebGLTexelFormat::RA8: + case WebGLTexelFormat::RG8: + case WebGLTexelFormat::RGB565: + case WebGLTexelFormat::RGBA4444: + case WebGLTexelFormat::RGBA5551: + return 2; + case WebGLTexelFormat::RGB8: + return 3; + case WebGLTexelFormat::A32F: + case WebGLTexelFormat::R32F: + case WebGLTexelFormat::RA16F: + case WebGLTexelFormat::RG16F: + case WebGLTexelFormat::RGB11F11F10F: + case WebGLTexelFormat::RGBA8: + case WebGLTexelFormat::BGRX8: + case WebGLTexelFormat::BGRA8: + return 4; + case WebGLTexelFormat::RGB16F: + return 6; + case WebGLTexelFormat::RA32F: + case WebGLTexelFormat::RG32F: + case WebGLTexelFormat::RGBA16F: + return 8; + case WebGLTexelFormat::RGB32F: + return 12; + case WebGLTexelFormat::RGBA32F: + return 16; + default: + MOZ_ASSERT(false, "Unknown texel format. Coding mistake?"); + return 0; + } +} + +MOZ_ALWAYS_INLINE bool HasAlpha(WebGLTexelFormat format) { + return (format == WebGLTexelFormat::A8 || + format == WebGLTexelFormat::A16F || + format == WebGLTexelFormat::A32F || + format == WebGLTexelFormat::RA8 || + format == WebGLTexelFormat::RA16F || + format == WebGLTexelFormat::RA32F || + format == WebGLTexelFormat::RGBA4444 || + format == WebGLTexelFormat::RGBA5551 || + format == WebGLTexelFormat::RGBA8 || + format == WebGLTexelFormat::RGBA16F || + format == WebGLTexelFormat::RGBA32F || + format == WebGLTexelFormat::BGRA8); +} + +MOZ_ALWAYS_INLINE bool HasColor(WebGLTexelFormat format) { + return (format == WebGLTexelFormat::R8 || + format == WebGLTexelFormat::R16F || + format == WebGLTexelFormat::R32F || + format == WebGLTexelFormat::RA8 || + format == WebGLTexelFormat::RA16F || + format == WebGLTexelFormat::RA32F || + format == WebGLTexelFormat::RG8 || + format == WebGLTexelFormat::RG16F || + format == WebGLTexelFormat::RG32F || + format == WebGLTexelFormat::RGB565 || + format == WebGLTexelFormat::RGB8 || + format == WebGLTexelFormat::RGB11F11F10F || + format == WebGLTexelFormat::RGB16F || + format == WebGLTexelFormat::RGB32F || + format == WebGLTexelFormat::RGBA4444 || + format == WebGLTexelFormat::RGBA5551 || + format == WebGLTexelFormat::RGBA8 || + format == WebGLTexelFormat::RGBA16F || + format == WebGLTexelFormat::RGBA32F || + format == WebGLTexelFormat::BGRX8 || + format == WebGLTexelFormat::BGRA8); +} + +/****** BEGIN CODE SHARED WITH WEBKIT ******/ + +// the pack/unpack functions here are originally from this file: +// http://trac.webkit.org/browser/trunk/WebCore/platform/graphics/GraphicsContext3D.cpp + +//---------------------------------------------------------------------- +// Pixel unpacking routines. + +template +MOZ_ALWAYS_INLINE void +unpack(const SrcType* __restrict src, + DstType* __restrict dst) +{ + MOZ_ASSERT(false, "Unimplemented texture format conversion"); +} + +//////////////////////////////////////////////////////////////////////////////// +// 1-channel formats +template<> MOZ_ALWAYS_INLINE void +unpack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = 0; + dst[1] = 0; + dst[2] = 0; + dst[3] = src[0]; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = kFloat16Value_Zero; + dst[1] = kFloat16Value_Zero; + dst[2] = kFloat16Value_Zero; + dst[3] = src[0]; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = 0; + dst[1] = 0; + dst[2] = 0; + dst[3] = src[0]; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[0]; + dst[2] = src[0]; + dst[3] = 0xFF; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[0]; + dst[2] = src[0]; + dst[3] = kFloat16Value_One; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[0]; + dst[2] = src[0]; + dst[3] = 1.0f; +} + +//////////////////////////////////////////////////////////////////////////////// +// 2-channel formats +template<> MOZ_ALWAYS_INLINE void +unpack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[0]; + dst[2] = src[0]; + dst[3] = src[1]; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[0]; + dst[2] = src[0]; + dst[3] = src[1]; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[0]; + dst[2] = src[0]; + dst[3] = src[1]; +} + +//////////////////////////////////////////////////////////////////////////////// +// 3-channel formats +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint8_t* __restrict dst) +{ + uint16_t packedValue = src[0]; + uint8_t r = (packedValue >> 11) & 0x1F; + uint8_t g = (packedValue >> 5) & 0x3F; + uint8_t b = packedValue & 0x1F; + dst[0] = (r << 3) | (r & 0x7); + dst[1] = (g << 2) | (g & 0x3); + dst[2] = (b << 3) | (b & 0x7); + dst[3] = 0xFF; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = 0xFF; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = kFloat16Value_One; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = 1.0f; +} + +//////////////////////////////////////////////////////////////////////////////// +// 4-channel formats +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint8_t* __restrict dst) +{ + uint16_t packedValue = src[0]; + uint8_t r = (packedValue >> 12) & 0x0F; + uint8_t g = (packedValue >> 8) & 0x0F; + uint8_t b = (packedValue >> 4) & 0x0F; + uint8_t a = packedValue & 0x0F; + dst[0] = (r << 4) | r; + dst[1] = (g << 4) | g; + dst[2] = (b << 4) | b; + dst[3] = (a << 4) | a; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint8_t* __restrict dst) +{ + uint16_t packedValue = src[0]; + uint8_t r = (packedValue >> 11) & 0x1F; + uint8_t g = (packedValue >> 6) & 0x1F; + uint8_t b = (packedValue >> 1) & 0x1F; + dst[0] = (r << 3) | (r & 0x7); + dst[1] = (g << 3) | (g & 0x7); + dst[2] = (b << 3) | (b & 0x7); + dst[3] = (packedValue & 0x1) ? 0xFF : 0; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +//////////////////////////////////////////////////////////////////////////////// +// DOM element formats +template<> MOZ_ALWAYS_INLINE void +unpack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[2]; + dst[1] = src[1]; + dst[2] = src[0]; + dst[3] = 0xFF; +} + +template<> MOZ_ALWAYS_INLINE void +unpack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[2]; + dst[1] = src[1]; + dst[2] = src[0]; + dst[3] = src[3]; +} + +//---------------------------------------------------------------------- +// Pixel packing routines. +// + +template +MOZ_ALWAYS_INLINE void +pack(const SrcType* __restrict src, + DstType* __restrict dst) +{ + MOZ_CRASH("GFX: Unimplemented texture format conversion"); +} + +//////////////////////////////////////////////////////////////////////////////// +// 1-channel formats +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + dst[0] = srcR; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + dst[0] = srcR; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = unpackFromFloat16(src[3]); + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float unpackedAlpha = unpackFromFloat16(src[3]); + float scaleFactor = unpackedAlpha ? 1.0f / unpackedAlpha : 1.0f; + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3]; + dst[0] = src[0] * scaleFactor; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3] ? 1.0f / src[3] : 1.0f; + dst[0] = src[0] * scaleFactor; +} + +//////////////////////////////////////////////////////////////////////////////// +// 2-channel formats +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + dst[0] = srcR; + dst[1] = src[3]; +} + +// FIXME: this routine is lossy and must be removed. +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + dst[0] = srcR; + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = unpackFromFloat16(src[3]); + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float unpackedAlpha = unpackFromFloat16(src[3]); + float scaleFactor = unpackedAlpha ? 1.0f / unpackedAlpha : 1.0f; + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3]; + dst[0] = src[0] * scaleFactor; + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3] ? 1.0f / src[3] : 1.0f; + dst[0] = src[0] * scaleFactor; + dst[1] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + dst[0] = srcR; + dst[1] = srcG; +} + +// FIXME: this routine is lossy and must be removed. +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + dst[0] = srcR; + dst[1] = srcG; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = unpackFromFloat16(src[3]); + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = packToFloat16(unpackFromFloat16(src[1]) * scaleFactor); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float unpackedAlpha = unpackFromFloat16(src[3]); + float scaleFactor = unpackedAlpha ? 1.0f / unpackedAlpha : 1.0f; + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = packToFloat16(unpackFromFloat16(src[1]) * scaleFactor); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3]; + dst[0] = src[0] * scaleFactor; + dst[1] = src[1] * scaleFactor; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3] ? 1.0f / src[3] : 1.0f; + dst[0] = src[0] * scaleFactor; + dst[1] = src[1] * scaleFactor; +} + +//////////////////////////////////////////////////////////////////////////////// +// 3-channel formats +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + *dst = ( ((src[0] & 0xF8) << 8) + | ((src[1] & 0xFC) << 3) + | ((src[2] & 0xF8) >> 3)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + *dst = ( ((srcR & 0xF8) << 8) + | ((srcG & 0xFC) << 3) + | ((srcB & 0xF8) >> 3)); +} + +// FIXME: this routine is lossy and must be removed. +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + *dst = ( ((srcR & 0xF8) << 8) + | ((srcG & 0xFC) << 3) + | ((srcB & 0xF8) >> 3)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + dst[0] = srcR; + dst[1] = srcG; + dst[2] = srcB; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + dst[0] = srcR; + dst[1] = srcG; + dst[2] = srcB; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, uint32_t* __restrict dst) +{ + dst[0] = ((packToFloat11(src[0]) << 0) | + (packToFloat11(src[1]) << 11) | + (packToFloat10(src[2]) << 22)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, uint32_t* __restrict dst) +{ + float scaleFactor = src[3]; + dst[0] = ((packToFloat11(src[0] * scaleFactor) << 0) | + (packToFloat11(src[1] * scaleFactor) << 11) | + (packToFloat10(src[2] * scaleFactor) << 22)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, uint32_t* __restrict dst) +{ + float scaleFactor = src[3] ? 1.0f / src[3] : 1.0f; + dst[0] = ((packToFloat11(src[0] * scaleFactor) << 0) | + (packToFloat11(src[1] * scaleFactor) << 11) | + (packToFloat10(src[2] * scaleFactor) << 22)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = unpackFromFloat16(src[3]); + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = packToFloat16(unpackFromFloat16(src[1]) * scaleFactor); + dst[2] = packToFloat16(unpackFromFloat16(src[2]) * scaleFactor); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float unpackedAlpha = unpackFromFloat16(src[3]); + float scaleFactor = unpackedAlpha ? 1.0f / unpackedAlpha : 1.0f; + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = packToFloat16(unpackFromFloat16(src[1]) * scaleFactor); + dst[2] = packToFloat16(unpackFromFloat16(src[2]) * scaleFactor); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3]; + dst[0] = src[0] * scaleFactor; + dst[1] = src[1] * scaleFactor; + dst[2] = src[2] * scaleFactor; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3] ? 1.0f / src[3] : 1.0f; + dst[0] = src[0] * scaleFactor; + dst[1] = src[1] * scaleFactor; + dst[2] = src[2] * scaleFactor; +} + +//////////////////////////////////////////////////////////////////////////////// +// 4-channel formats +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + *dst = ( ((src[0] & 0xF0) << 8) + | ((src[1] & 0xF0) << 4) + | (src[2] & 0xF0) + | (src[3] >> 4) ); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + *dst = ( ((srcR & 0xF0) << 8) + | ((srcG & 0xF0) << 4) + | (srcB & 0xF0) + | (src[3] >> 4)); +} + +// FIXME: this routine is lossy and must be removed. +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + *dst = ( ((srcR & 0xF0) << 8) + | ((srcG & 0xF0) << 4) + | (srcB & 0xF0) + | (src[3] >> 4)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + *dst = ( ((src[0] & 0xF8) << 8) + | ((src[1] & 0xF8) << 3) + | ((src[2] & 0xF8) >> 2) + | (src[3] >> 7)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + *dst = ( ((srcR & 0xF8) << 8) + | ((srcG & 0xF8) << 3) + | ((srcB & 0xF8) >> 2) + | (src[3] >> 7)); +} + +// FIXME: this routine is lossy and must be removed. +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + *dst = ( ((srcR & 0xF8) << 8) + | ((srcG & 0xF8) << 3) + | ((srcB & 0xF8) >> 2) + | (src[3] >> 7)); +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] / 255.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + dst[0] = srcR; + dst[1] = srcG; + dst[2] = srcB; + dst[3] = src[3]; +} + +// FIXME: this routine is lossy and must be removed. +template<> MOZ_ALWAYS_INLINE void +pack(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f; + uint8_t srcR = static_cast(src[0] * scaleFactor); + uint8_t srcG = static_cast(src[1] * scaleFactor); + uint8_t srcB = static_cast(src[2] * scaleFactor); + dst[0] = srcR; + dst[1] = srcG; + dst[2] = srcB; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float scaleFactor = unpackFromFloat16(src[3]); + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = packToFloat16(unpackFromFloat16(src[1]) * scaleFactor); + dst[2] = packToFloat16(unpackFromFloat16(src[2]) * scaleFactor); + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + float unpackedAlpha = unpackFromFloat16(src[3]); + float scaleFactor = unpackedAlpha ? 1.0f / unpackedAlpha : 1.0f; + dst[0] = packToFloat16(unpackFromFloat16(src[0]) * scaleFactor); + dst[1] = packToFloat16(unpackFromFloat16(src[1]) * scaleFactor); + dst[2] = packToFloat16(unpackFromFloat16(src[2]) * scaleFactor); + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3]; + dst[0] = src[0] * scaleFactor; + dst[1] = src[1] * scaleFactor; + dst[2] = src[2] * scaleFactor; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +pack(const float* __restrict src, float* __restrict dst) +{ + float scaleFactor = src[3] ? 1.0f / src[3] : 1.0f; + dst[0] = src[0] * scaleFactor; + dst[1] = src[1] * scaleFactor; + dst[2] = src[2] * scaleFactor; + dst[3] = src[3]; +} + +/****** END CODE SHARED WITH WEBKIT ******/ + +template MOZ_ALWAYS_INLINE void +convertType(const SrcType* __restrict src, DstType* __restrict dst) +{ + MOZ_ASSERT(false, "Unimplemented texture format conversion"); +} + +template<> MOZ_ALWAYS_INLINE void +convertType(const uint8_t* __restrict src, uint8_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +convertType(const uint16_t* __restrict src, uint16_t* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +convertType(const float* __restrict src, float* __restrict dst) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} + +template<> MOZ_ALWAYS_INLINE void +convertType(const uint8_t* __restrict src, float* __restrict dst) +{ + const float scaleFactor = 1.f / 255.0f; + dst[0] = src[0] * scaleFactor; + dst[1] = src[1] * scaleFactor; + dst[2] = src[2] * scaleFactor; + dst[3] = src[3] * scaleFactor; +} + +template<> MOZ_ALWAYS_INLINE void +convertType(const uint8_t* __restrict src, uint16_t* __restrict dst) +{ + const float scaleFactor = 1.f / 255.0f; + dst[0] = packToFloat16(src[0] * scaleFactor); + dst[1] = packToFloat16(src[1] * scaleFactor); + dst[2] = packToFloat16(src[2] * scaleFactor); + dst[3] = packToFloat16(src[3] * scaleFactor); +} + +} // end namespace WebGLTexelConversions + +} // end namespace mozilla + +#endif // WEBGLTEXELCONVERSIONS_H_ diff --git a/dom/canvas/WebGLTexture.cpp b/dom/canvas/WebGLTexture.cpp new file mode 100644 index 000000000..767ff610a --- /dev/null +++ b/dom/canvas/WebGLTexture.cpp @@ -0,0 +1,1226 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLTexture.h" + +#include +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "mozilla/gfx/Logging.h" +#include "mozilla/MathAlgorithms.h" +#include "mozilla/Scoped.h" +#include "mozilla/Unused.h" +#include "ScopedGLHelpers.h" +#include "WebGLContext.h" +#include "WebGLContextUtils.h" +#include "WebGLFramebuffer.h" +#include "WebGLSampler.h" +#include "WebGLTexelConversions.h" + +namespace mozilla { + +/*static*/ const WebGLTexture::ImageInfo WebGLTexture::ImageInfo::kUndefined; + +//////////////////////////////////////// + +template +static inline T& +Mutable(const T& x) +{ + return const_cast(x); +} + +void +WebGLTexture::ImageInfo::Clear() +{ + if (!IsDefined()) + return; + + OnRespecify(); + + Mutable(mFormat) = LOCAL_GL_NONE; + Mutable(mWidth) = 0; + Mutable(mHeight) = 0; + Mutable(mDepth) = 0; + + MOZ_ASSERT(!IsDefined()); +} + +WebGLTexture::ImageInfo& +WebGLTexture::ImageInfo::operator =(const ImageInfo& a) +{ + MOZ_ASSERT(a.IsDefined()); + + Mutable(mFormat) = a.mFormat; + Mutable(mWidth) = a.mWidth; + Mutable(mHeight) = a.mHeight; + Mutable(mDepth) = a.mDepth; + + mIsDataInitialized = a.mIsDataInitialized; + + // But *don't* transfer mAttachPoints! + MOZ_ASSERT(a.mAttachPoints.empty()); + OnRespecify(); + + return *this; +} + +bool +WebGLTexture::ImageInfo::IsPowerOfTwo() const +{ + return mozilla::IsPowerOfTwo(mWidth) && + mozilla::IsPowerOfTwo(mHeight) && + mozilla::IsPowerOfTwo(mDepth); +} + +void +WebGLTexture::ImageInfo::AddAttachPoint(WebGLFBAttachPoint* attachPoint) +{ + const auto pair = mAttachPoints.insert(attachPoint); + DebugOnly didInsert = pair.second; + MOZ_ASSERT(didInsert); +} + +void +WebGLTexture::ImageInfo::RemoveAttachPoint(WebGLFBAttachPoint* attachPoint) +{ + DebugOnly numElemsErased = mAttachPoints.erase(attachPoint); + MOZ_ASSERT_IF(IsDefined(), numElemsErased == 1); +} + +void +WebGLTexture::ImageInfo::OnRespecify() const +{ + for (auto cur : mAttachPoints) { + cur->OnBackingStoreRespecified(); + } +} + +size_t +WebGLTexture::ImageInfo::MemoryUsage() const +{ + if (!IsDefined()) + return 0; + + const auto bytesPerTexel = mFormat->format->estimatedBytesPerPixel; + return size_t(mWidth) * size_t(mHeight) * size_t(mDepth) * bytesPerTexel; +} + +void +WebGLTexture::ImageInfo::SetIsDataInitialized(bool isDataInitialized, WebGLTexture* tex) +{ + MOZ_ASSERT(tex); + MOZ_ASSERT(this >= &tex->mImageInfoArr[0]); + MOZ_ASSERT(this < &tex->mImageInfoArr[kMaxLevelCount * kMaxFaceCount]); + + mIsDataInitialized = isDataInitialized; + tex->InvalidateResolveCache(); +} + +//////////////////////////////////////// + +JSObject* +WebGLTexture::WrapObject(JSContext* cx, JS::Handle givenProto) { + return dom::WebGLTextureBinding::Wrap(cx, this, givenProto); +} + +WebGLTexture::WebGLTexture(WebGLContext* webgl, GLuint tex) + : WebGLRefCountedObject(webgl) + , mGLName(tex) + , mTarget(LOCAL_GL_NONE) + , mFaceCount(0) + , mMinFilter(LOCAL_GL_NEAREST_MIPMAP_LINEAR) + , mMagFilter(LOCAL_GL_LINEAR) + , mWrapS(LOCAL_GL_REPEAT) + , mWrapT(LOCAL_GL_REPEAT) + , mImmutable(false) + , mImmutableLevelCount(0) + , mBaseMipmapLevel(0) + , mMaxMipmapLevel(1000) + , mTexCompareMode(LOCAL_GL_NONE) + , mIsResolved(false) + , mResolved_Swizzle(nullptr) +{ + mContext->mTextures.insertBack(this); +} + +void +WebGLTexture::Delete() +{ + for (auto& cur : mImageInfoArr) { + cur.Clear(); + } + + mContext->MakeContextCurrent(); + mContext->gl->fDeleteTextures(1, &mGLName); + + LinkedListElement::removeFrom(mContext->mTextures); +} + +size_t +WebGLTexture::MemoryUsage() const +{ + if (IsDeleted()) + return 0; + + size_t accum = 0; + for (const auto& cur : mImageInfoArr) { + accum += cur.MemoryUsage(); + } + return accum; +} + +void +WebGLTexture::SetImageInfo(ImageInfo* target, const ImageInfo& newInfo) +{ + *target = newInfo; + + InvalidateResolveCache(); +} + +void +WebGLTexture::SetImageInfosAtLevel(uint32_t level, const ImageInfo& newInfo) +{ + for (uint8_t i = 0; i < mFaceCount; i++) { + ImageInfoAtFace(i, level) = newInfo; + } + + InvalidateResolveCache(); +} + +bool +WebGLTexture::IsMipmapComplete(const char* funcName, uint32_t texUnit, + bool* const out_initFailed) +{ + *out_initFailed = false; + MOZ_ASSERT(DoesMinFilterRequireMipmap()); + // GLES 3.0.4, p161 + + uint32_t maxLevel; + if (!MaxEffectiveMipmapLevel(texUnit, &maxLevel)) + return false; + + // "* `level_base <= level_max`" + if (mBaseMipmapLevel > maxLevel) + return false; + + // Make a copy so we can modify it. + const ImageInfo& baseImageInfo = BaseImageInfo(); + + // Reference dimensions based on the current level. + uint32_t refWidth = baseImageInfo.mWidth; + uint32_t refHeight = baseImageInfo.mHeight; + uint32_t refDepth = baseImageInfo.mDepth; + MOZ_ASSERT(refWidth && refHeight && refDepth); + + for (uint32_t level = mBaseMipmapLevel; level <= maxLevel; level++) { + if (!EnsureLevelInitialized(funcName, level)) { + *out_initFailed = true; + return false; + } + + // "A cube map texture is mipmap complete if each of the six texture images, + // considered individually, is mipmap complete." + + for (uint8_t face = 0; face < mFaceCount; face++) { + const ImageInfo& cur = ImageInfoAtFace(face, level); + + // "* The set of mipmap arrays `level_base` through `q` (where `q` is defined + // the "Mipmapping" discussion of section 3.8.10) were each specified with + // the same effective internal format." + + // "* The dimensions of the arrays follow the sequence described in the + // "Mipmapping" discussion of section 3.8.10." + + if (cur.mWidth != refWidth || + cur.mHeight != refHeight || + cur.mDepth != refDepth || + cur.mFormat != baseImageInfo.mFormat) + { + return false; + } + } + + // GLES 3.0.4, p158: + // "[...] until the last array is reached with dimension 1 x 1 x 1." + if (mTarget == LOCAL_GL_TEXTURE_3D) { + if (refWidth == 1 && + refHeight == 1 && + refDepth == 1) + { + break; + } + + refDepth = std::max(uint32_t(1), refDepth / 2); + } else { + // TEXTURE_2D_ARRAY may have depth != 1, but that's normal. + if (refWidth == 1 && + refHeight == 1) + { + break; + } + } + + refWidth = std::max(uint32_t(1), refWidth / 2); + refHeight = std::max(uint32_t(1), refHeight / 2); + } + + return true; +} + +bool +WebGLTexture::IsCubeComplete() const +{ + // GLES 3.0.4, p161 + // "[...] a cube map texture is cube complete if the following conditions all hold + // true: + // * The `level_base` arrays of each of the six texture images making up the cube map + // have identical, positive, and square dimensions. + // * The `level_base` arrays were each specified with the same effective internal + // format." + + // Note that "cube complete" does not imply "mipmap complete". + + const ImageInfo& reference = BaseImageInfo(); + if (!reference.IsDefined()) + return false; + + auto refWidth = reference.mWidth; + auto refFormat = reference.mFormat; + + for (uint8_t face = 0; face < mFaceCount; face++) { + const ImageInfo& cur = ImageInfoAtFace(face, mBaseMipmapLevel); + if (!cur.IsDefined()) + return false; + + MOZ_ASSERT(cur.mDepth == 1); + if (cur.mFormat != refFormat || // Check effective formats. + cur.mWidth != refWidth || // Check both width and height against refWidth to + cur.mHeight != refWidth) // to enforce positive and square dimensions. + { + return false; + } + } + + return true; +} + +bool +WebGLTexture::IsComplete(const char* funcName, uint32_t texUnit, + const char** const out_reason, bool* const out_initFailed) +{ + *out_initFailed = false; + + const auto maxLevel = kMaxLevelCount - 1; + if (mBaseMipmapLevel > maxLevel) { + *out_reason = "`level_base` too high."; + return false; + } + + if (!EnsureLevelInitialized(funcName, mBaseMipmapLevel)) { + *out_initFailed = true; + return false; + } + + // Texture completeness is established at GLES 3.0.4, p160-161. + // "[A] texture is complete unless any of the following conditions hold true:" + + // "* Any dimension of the `level_base` array is not positive." + const ImageInfo& baseImageInfo = BaseImageInfo(); + if (!baseImageInfo.IsDefined()) { + // In case of undefined texture image, we don't print any message because this is + // a very common and often legitimate case (asynchronous texture loading). + *out_reason = nullptr; + return false; + } + + if (!baseImageInfo.mWidth || !baseImageInfo.mHeight || !baseImageInfo.mDepth) { + *out_reason = "The dimensions of `level_base` are not all positive."; + return false; + } + + // "* The texture is a cube map texture, and is not cube complete." + if (IsCubeMap() && !IsCubeComplete()) { + *out_reason = "Cubemaps must be \"cube complete\"."; + return false; + } + + WebGLSampler* sampler = mContext->mBoundSamplers[texUnit]; + TexMinFilter minFilter = sampler ? sampler->mMinFilter : mMinFilter; + TexMagFilter magFilter = sampler ? sampler->mMagFilter : mMagFilter; + + // "* The minification filter requires a mipmap (is neither NEAREST nor LINEAR) and + // the texture is not mipmap complete." + const bool requiresMipmap = (minFilter != LOCAL_GL_NEAREST && + minFilter != LOCAL_GL_LINEAR); + if (requiresMipmap && !IsMipmapComplete(funcName, texUnit, out_initFailed)) { + if (*out_initFailed) + return false; + + *out_reason = "Because the minification filter requires mipmapping, the texture" + " must be \"mipmap complete\"."; + return false; + } + + const bool isMinFilteringNearest = (minFilter == LOCAL_GL_NEAREST || + minFilter == LOCAL_GL_NEAREST_MIPMAP_NEAREST); + const bool isMagFilteringNearest = (magFilter == LOCAL_GL_NEAREST); + const bool isFilteringNearestOnly = (isMinFilteringNearest && isMagFilteringNearest); + if (!isFilteringNearestOnly) { + auto formatUsage = baseImageInfo.mFormat; + auto format = formatUsage->format; + + bool isFilterable = formatUsage->isFilterable; + + // "* The effective internal format specified for the texture arrays is a sized + // internal depth or depth and stencil format, the value of + // TEXTURE_COMPARE_MODE is NONE[1], and either the magnification filter is not + // NEAREST, or the minification filter is neither NEAREST nor + // NEAREST_MIPMAP_NEAREST." + // [1]: This sounds suspect, but is explicitly noted in the change log for GLES + // 3.0.1: + // "* Clarify that a texture is incomplete if it has a depth component, no + // shadow comparison, and linear filtering (also Bug 9481)." + if (format->d && mTexCompareMode != LOCAL_GL_NONE) { + isFilterable = true; + } + + // "* The effective internal format specified for the texture arrays is a sized + // internal color format that is not texture-filterable, and either the + // magnification filter is not NEAREST or the minification filter is neither + // NEAREST nor NEAREST_MIPMAP_NEAREST." + // Since all (GLES3) unsized color formats are filterable just like their sized + // equivalents, we don't have to care whether its sized or not. + if (!isFilterable) { + *out_reason = "Because minification or magnification filtering is not NEAREST" + " or NEAREST_MIPMAP_NEAREST, and the texture's format must be" + " \"texture-filterable\"."; + return false; + } + } + + // Texture completeness is effectively (though not explicitly) amended for GLES2 by + // the "Texture Access" section under $3.8 "Fragment Shaders". This also applies to + // vertex shaders, as noted on GLES 2.0.25, p41. + if (!mContext->IsWebGL2()) { + // GLES 2.0.25, p87-88: + // "Calling a sampler from a fragment shader will return (R,G,B,A)=(0,0,0,1) if + // any of the following conditions are true:" + + // "* A two-dimensional sampler is called, the minification filter is one that + // requires a mipmap[...], and the sampler's associated texture object is not + // complete[.]" + // (already covered) + + // "* A two-dimensional sampler is called, the minification filter is not one that + // requires a mipmap (either NEAREST nor[sic] LINEAR), and either dimension of + // the level zero array of the associated texture object is not positive." + // (already covered) + + // "* A two-dimensional sampler is called, the corresponding texture image is a + // non-power-of-two image[...], and either the texture wrap mode is not + // CLAMP_TO_EDGE, or the minification filter is neither NEAREST nor LINEAR." + + // "* A cube map sampler is called, any of the corresponding texture images are + // non-power-of-two images, and either the texture wrap mode is not + // CLAMP_TO_EDGE, or the minification filter is neither NEAREST nor LINEAR." + if (!baseImageInfo.IsPowerOfTwo()) { + TexWrap wrapS = sampler ? sampler->mWrapS : mWrapS; + TexWrap wrapT = sampler ? sampler->mWrapT : mWrapT; + // "either the texture wrap mode is not CLAMP_TO_EDGE" + if (wrapS != LOCAL_GL_CLAMP_TO_EDGE || + wrapT != LOCAL_GL_CLAMP_TO_EDGE) + { + *out_reason = "Non-power-of-two textures must have a wrap mode of" + " CLAMP_TO_EDGE."; + return false; + } + + // "or the minification filter is neither NEAREST nor LINEAR" + if (requiresMipmap) { + *out_reason = "Mipmapping requires power-of-two textures."; + return false; + } + } + + // "* A cube map sampler is called, and either the corresponding cube map texture + // image is not cube complete, or TEXTURE_MIN_FILTER is one that requires a + // mipmap and the texture is not mipmap cube complete." + // (already covered) + } + + return true; +} + +bool +WebGLTexture::MaxEffectiveMipmapLevel(uint32_t texUnit, uint32_t* const out) const +{ + WebGLSampler* sampler = mContext->mBoundSamplers[texUnit]; + TexMinFilter minFilter = sampler ? sampler->mMinFilter : mMinFilter; + if (minFilter == LOCAL_GL_NEAREST || + minFilter == LOCAL_GL_LINEAR) + { + // No extra mips used. + *out = mBaseMipmapLevel; + return true; + } + + const auto& imageInfo = BaseImageInfo(); + if (!imageInfo.IsDefined()) + return false; + + uint32_t maxLevelBySize = mBaseMipmapLevel + imageInfo.PossibleMipmapLevels() - 1; + *out = std::min(maxLevelBySize, mMaxMipmapLevel); + return true; +} + +bool +WebGLTexture::GetFakeBlackType(const char* funcName, uint32_t texUnit, + FakeBlackType* const out_fakeBlack) +{ + const char* incompleteReason; + bool initFailed = false; + if (!IsComplete(funcName, texUnit, &incompleteReason, &initFailed)) { + if (initFailed) { + mContext->ErrorOutOfMemory("%s: Failed to initialize texture data.", + funcName); + return false; // The world just exploded. + } + + if (incompleteReason) { + mContext->GenerateWarning("%s: Active texture %u for target 0x%04x is" + " 'incomplete', and will be rendered as" + " RGBA(0,0,0,1), as per the GLES 2.0.24 $3.8.2: %s", + funcName, texUnit, mTarget.get(), + incompleteReason); + } + *out_fakeBlack = FakeBlackType::RGBA0001; + return true; + } + + + *out_fakeBlack = FakeBlackType::None; + return true; +} + +static void +SetSwizzle(gl::GLContext* gl, TexTarget target, const GLint* swizzle) +{ + static const GLint kNoSwizzle[4] = { LOCAL_GL_RED, LOCAL_GL_GREEN, LOCAL_GL_BLUE, + LOCAL_GL_ALPHA }; + if (!swizzle) { + swizzle = kNoSwizzle; + } else if (!gl->IsSupported(gl::GLFeature::texture_swizzle)) { + MOZ_CRASH("GFX: Needs swizzle feature to swizzle!"); + } + + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_R, swizzle[0]); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_G, swizzle[1]); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_B, swizzle[2]); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_A, swizzle[3]); +} + +bool +WebGLTexture::ResolveForDraw(const char* funcName, uint32_t texUnit, + FakeBlackType* const out_fakeBlack) +{ + if (!mIsResolved) { + if (!GetFakeBlackType(funcName, texUnit, &mResolved_FakeBlack)) + return false; + + // Check which swizzle we should use. Since the texture must be complete at this + // point, just grab the format off any valid image. + const GLint* newSwizzle = nullptr; + if (mResolved_FakeBlack == FakeBlackType::None) { + const auto& cur = ImageInfoAtFace(0, mBaseMipmapLevel); + newSwizzle = cur.mFormat->textureSwizzleRGBA; + } + + // Only set the swizzle if it changed since last time we did it. + if (newSwizzle != mResolved_Swizzle) { + mResolved_Swizzle = newSwizzle; + + // Set the new swizzle! + mContext->gl->fActiveTexture(LOCAL_GL_TEXTURE0 + texUnit); + SetSwizzle(mContext->gl, mTarget, mResolved_Swizzle); + mContext->gl->fActiveTexture(LOCAL_GL_TEXTURE0 + mContext->mActiveTexture); + } + + mIsResolved = true; + } + + *out_fakeBlack = mResolved_FakeBlack; + return true; +} + +bool +WebGLTexture::EnsureImageDataInitialized(const char* funcName, TexImageTarget target, + uint32_t level) +{ + auto& imageInfo = ImageInfoAt(target, level); + if (!imageInfo.IsDefined()) + return true; + + if (imageInfo.IsDataInitialized()) + return true; + + return InitializeImageData(funcName, target, level); +} + +bool +WebGLTexture::EnsureLevelInitialized(const char* funcName, uint32_t level) +{ + if (mTarget != LOCAL_GL_TEXTURE_CUBE_MAP) + return EnsureImageDataInitialized(funcName, mTarget.get(), level); + + for (GLenum texImageTarget = LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X; + texImageTarget <= LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; + ++texImageTarget) + { + if (!EnsureImageDataInitialized(funcName, texImageTarget, level)) + return false; + } + return true; +} + +static void +ZeroANGLEDepthTexture(WebGLContext* webgl, GLuint tex, + const webgl::FormatUsageInfo* usage, uint32_t width, + uint32_t height) +{ + const auto& format = usage->format; + GLenum attachPoint = 0; + GLbitfield clearBits = 0; + + if (format->d) { + attachPoint = LOCAL_GL_DEPTH_ATTACHMENT; + clearBits |= LOCAL_GL_DEPTH_BUFFER_BIT; + } + + if (format->s) { + attachPoint = (format->d ? LOCAL_GL_DEPTH_STENCIL_ATTACHMENT + : LOCAL_GL_STENCIL_ATTACHMENT); + clearBits |= LOCAL_GL_STENCIL_BUFFER_BIT; + } + + MOZ_RELEASE_ASSERT(attachPoint && clearBits, "GFX: No bits cleared."); + + //// + const auto& gl = webgl->gl; + MOZ_ASSERT(gl->IsCurrent()); + + gl::ScopedFramebuffer scopedFB(gl); + const gl::ScopedBindFramebuffer scopedBindFB(gl, scopedFB.FB()); + + gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, attachPoint, LOCAL_GL_TEXTURE_2D, + tex, 0); + + const auto& status = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); + MOZ_RELEASE_ASSERT(status == LOCAL_GL_FRAMEBUFFER_COMPLETE); + + //// + + const bool fakeNoAlpha = false; + webgl->ForceClearFramebufferWithDefaultValues(clearBits, fakeNoAlpha); +} + +static bool +ZeroTextureData(WebGLContext* webgl, const char* funcName, GLuint tex, + TexImageTarget target, uint32_t level, + const webgl::FormatUsageInfo* usage, uint32_t width, uint32_t height, + uint32_t depth) +{ + // This has two usecases: + // 1. Lazy zeroing of uninitialized textures: + // a. Before draw, when FakeBlack isn't viable. (TexStorage + Draw*) + // b. Before partial upload. (TexStorage + TexSubImage) + // 2. Zero subrects from out-of-bounds blits. (CopyTex(Sub)Image) + + // We have no sympathy for any of these cases. + + // "Doctor, it hurts when I do this!" "Well don't do that!" + webgl->GenerateWarning("%s: This operation requires zeroing texture data. This is" + " slow.", + funcName); + + gl::GLContext* gl = webgl->GL(); + gl->MakeCurrent(); + + GLenum scopeBindTarget; + switch (target.get()) { + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + scopeBindTarget = LOCAL_GL_TEXTURE_CUBE_MAP; + break; + default: + scopeBindTarget = target.get(); + break; + } + const gl::ScopedBindTexture scopeBindTexture(gl, tex, scopeBindTarget); + auto compression = usage->format->compression; + if (compression) { + auto sizedFormat = usage->format->sizedFormat; + MOZ_RELEASE_ASSERT(sizedFormat, "GFX: texture sized format not set"); + + const auto fnSizeInBlocks = [](CheckedUint32 pixels, uint8_t pixelsPerBlock) { + return RoundUpToMultipleOf(pixels, pixelsPerBlock) / pixelsPerBlock; + }; + + const auto widthBlocks = fnSizeInBlocks(width, compression->blockWidth); + const auto heightBlocks = fnSizeInBlocks(height, compression->blockHeight); + + CheckedUint32 checkedByteCount = compression->bytesPerBlock; + checkedByteCount *= widthBlocks; + checkedByteCount *= heightBlocks; + checkedByteCount *= depth; + + if (!checkedByteCount.isValid()) + return false; + + const size_t byteCount = checkedByteCount.value(); + + UniqueBuffer zeros = calloc(1, byteCount); + if (!zeros) + return false; + + ScopedUnpackReset scopedReset(webgl); + gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, 1); // Don't bother with striding it + // well. + + const auto error = DoCompressedTexSubImage(gl, target.get(), level, 0, 0, 0, + width, height, depth, sizedFormat, + byteCount, zeros.get()); + return !error; + } + + const auto driverUnpackInfo = usage->idealUnpack; + MOZ_RELEASE_ASSERT(driverUnpackInfo, "GFX: ideal unpack info not set."); + + if (webgl->IsExtensionEnabled(WebGLExtensionID::WEBGL_depth_texture) && + gl->IsANGLE() && + usage->format->d) + { + // ANGLE_depth_texture does not allow uploads, so we have to clear. + // (Restriction because of D3D9) + MOZ_ASSERT(target == LOCAL_GL_TEXTURE_2D); + MOZ_ASSERT(level == 0); + ZeroANGLEDepthTexture(webgl, tex, usage, width, height); + return true; + } + + const webgl::PackingInfo packing = driverUnpackInfo->ToPacking(); + + const auto bytesPerPixel = webgl::BytesPerPixel(packing); + + CheckedUint32 checkedByteCount = bytesPerPixel; + checkedByteCount *= width; + checkedByteCount *= height; + checkedByteCount *= depth; + + if (!checkedByteCount.isValid()) + return false; + + const size_t byteCount = checkedByteCount.value(); + + UniqueBuffer zeros = calloc(1, byteCount); + if (!zeros) + return false; + + ScopedUnpackReset scopedReset(webgl); + gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, 1); // Don't bother with striding it well. + const auto error = DoTexSubImage(gl, target, level, 0, 0, 0, width, height, depth, + packing, zeros.get()); + return !error; +} + +bool +WebGLTexture::InitializeImageData(const char* funcName, TexImageTarget target, + uint32_t level) +{ + auto& imageInfo = ImageInfoAt(target, level); + MOZ_ASSERT(imageInfo.IsDefined()); + MOZ_ASSERT(!imageInfo.IsDataInitialized()); + + const auto& usage = imageInfo.mFormat; + const auto& width = imageInfo.mWidth; + const auto& height = imageInfo.mHeight; + const auto& depth = imageInfo.mDepth; + + if (!ZeroTextureData(mContext, funcName, mGLName, target, level, usage, width, height, + depth)) + { + return false; + } + + imageInfo.SetIsDataInitialized(true, this); + return true; +} + +void +WebGLTexture::ClampLevelBaseAndMax() +{ + if (!mImmutable) + return; + + // GLES 3.0.4, p158: + // "For immutable-format textures, `level_base` is clamped to the range + // `[0, levels-1]`, `level_max` is then clamped to the range ` + // `[level_base, levels-1]`, where `levels` is the parameter passed to + // TexStorage* for the texture object." + mBaseMipmapLevel = Clamp(mBaseMipmapLevel, 0, mImmutableLevelCount - 1); + mMaxMipmapLevel = Clamp(mMaxMipmapLevel, mBaseMipmapLevel, + mImmutableLevelCount - 1); +} + +void +WebGLTexture::PopulateMipChain(uint32_t firstLevel, uint32_t lastLevel) +{ + const ImageInfo& baseImageInfo = ImageInfoAtFace(0, firstLevel); + MOZ_ASSERT(baseImageInfo.IsDefined()); + + uint32_t refWidth = baseImageInfo.mWidth; + uint32_t refHeight = baseImageInfo.mHeight; + uint32_t refDepth = baseImageInfo.mDepth; + if (!refWidth || !refHeight || !refDepth) + return; + + for (uint32_t level = firstLevel + 1; level <= lastLevel; level++) { + bool isMinimal = (refWidth == 1 && + refHeight == 1); + if (mTarget == LOCAL_GL_TEXTURE_3D) { + isMinimal &= (refDepth == 1); + } + + // Higher levels are unaffected. + if (isMinimal) + break; + + refWidth = std::max(uint32_t(1), refWidth / 2); + refHeight = std::max(uint32_t(1), refHeight / 2); + if (mTarget == LOCAL_GL_TEXTURE_3D) { // But not TEXTURE_2D_ARRAY! + refDepth = std::max(uint32_t(1), refDepth / 2); + } + + const ImageInfo cur(baseImageInfo.mFormat, refWidth, refHeight, refDepth, + baseImageInfo.IsDataInitialized()); + + SetImageInfosAtLevel(level, cur); + } +} + +////////////////////////////////////////////////////////////////////////////////////////// +// GL calls + +bool +WebGLTexture::BindTexture(TexTarget texTarget) +{ + if (IsDeleted()) { + mContext->ErrorInvalidOperation("bindTexture: Cannot bind a deleted object."); + return false; + } + + const bool isFirstBinding = !HasEverBeenBound(); + if (!isFirstBinding && mTarget != texTarget) { + mContext->ErrorInvalidOperation("bindTexture: This texture has already been bound" + " to a different target."); + return false; + } + + mTarget = texTarget; + + mContext->gl->fBindTexture(mTarget.get(), mGLName); + + if (isFirstBinding) { + mFaceCount = IsCubeMap() ? 6 : 1; + + gl::GLContext* gl = mContext->gl; + + // Thanks to the WebKit people for finding this out: GL_TEXTURE_WRAP_R + // is not present in GLES 2, but is present in GL and it seems as if for + // cube maps we need to set it to GL_CLAMP_TO_EDGE to get the expected + // GLES behavior. + // If we are WebGL 2 though, we'll want to leave it as REPEAT. + const bool hasWrapR = gl->IsSupported(gl::GLFeature::texture_3D); + if (IsCubeMap() && hasWrapR && !mContext->IsWebGL2()) { + gl->fTexParameteri(texTarget.get(), LOCAL_GL_TEXTURE_WRAP_R, + LOCAL_GL_CLAMP_TO_EDGE); + } + } + + return true; +} + + +void +WebGLTexture::GenerateMipmap(TexTarget texTarget) +{ + // GLES 3.0.4 p160: + // "Mipmap generation replaces texel array levels level base + 1 through q with arrays + // derived from the level base array, regardless of their previous contents. All + // other mipmap arrays, including the level base array, are left unchanged by this + // computation." + const ImageInfo& baseImageInfo = BaseImageInfo(); + if (!baseImageInfo.IsDefined()) { + mContext->ErrorInvalidOperation("generateMipmap: The base level of the texture is" + " not defined."); + return; + } + + if (IsCubeMap() && !IsCubeComplete()) { + mContext->ErrorInvalidOperation("generateMipmap: Cube maps must be \"cube" + " complete\"."); + return; + } + + if (!mContext->IsWebGL2() && !baseImageInfo.IsPowerOfTwo()) { + mContext->ErrorInvalidOperation("generateMipmap: The base level of the texture" + " does not have power-of-two dimensions."); + return; + } + + auto format = baseImageInfo.mFormat->format; + if (format->compression) { + mContext->ErrorInvalidOperation("generateMipmap: Texture data at base level is" + " compressed."); + return; + } + + if (format->d) { + mContext->ErrorInvalidOperation("generateMipmap: Depth textures are not" + " supported."); + return; + } + + // OpenGL ES 3.0.4 p160: + // If the level base array was not specified with an unsized internal format from + // table 3.3 or a sized internal format that is both color-renderable and + // texture-filterable according to table 3.13, an INVALID_OPERATION error + // is generated. + const auto usage = baseImageInfo.mFormat; + bool canGenerateMipmap = (usage->IsRenderable() && usage->isFilterable); + switch (usage->format->effectiveFormat) { + case webgl::EffectiveFormat::Luminance8: + case webgl::EffectiveFormat::Alpha8: + case webgl::EffectiveFormat::Luminance8Alpha8: + // Non-color-renderable formats from Table 3.3. + canGenerateMipmap = true; + break; + default: + break; + } + + if (!canGenerateMipmap) { + mContext->ErrorInvalidOperation("generateMipmap: Texture at base level is not unsized" + " internal format or is not" + " color-renderable or texture-filterable."); + return; + } + + // Done with validation. Do the operation. + + mContext->MakeContextCurrent(); + gl::GLContext* gl = mContext->gl; + + if (gl->WorkAroundDriverBugs()) { + // bug 696495 - to work around failures in the texture-mips.html test on various drivers, we + // set the minification filter before calling glGenerateMipmap. This should not carry a significant performance + // overhead so we do it unconditionally. + // + // note that the choice of GL_NEAREST_MIPMAP_NEAREST really matters. See Chromium bug 101105. + gl->fTexParameteri(texTarget.get(), LOCAL_GL_TEXTURE_MIN_FILTER, + LOCAL_GL_NEAREST_MIPMAP_NEAREST); + gl->fGenerateMipmap(texTarget.get()); + gl->fTexParameteri(texTarget.get(), LOCAL_GL_TEXTURE_MIN_FILTER, + mMinFilter.get()); + } else { + gl->fGenerateMipmap(texTarget.get()); + } + + // Record the results. + // Note that we don't use MaxEffectiveMipmapLevel() here, since that returns + // mBaseMipmapLevel if the min filter doesn't require mipmaps. + const uint32_t maxLevel = mBaseMipmapLevel + baseImageInfo.PossibleMipmapLevels() - 1; + PopulateMipChain(mBaseMipmapLevel, maxLevel); +} + +JS::Value +WebGLTexture::GetTexParameter(TexTarget texTarget, GLenum pname) +{ + mContext->MakeContextCurrent(); + + GLint i = 0; + GLfloat f = 0.0f; + + switch (pname) { + case LOCAL_GL_TEXTURE_MIN_FILTER: + return JS::NumberValue(uint32_t(mMinFilter.get())); + + case LOCAL_GL_TEXTURE_MAG_FILTER: + return JS::NumberValue(uint32_t(mMagFilter.get())); + + case LOCAL_GL_TEXTURE_WRAP_S: + return JS::NumberValue(uint32_t(mWrapS.get())); + + case LOCAL_GL_TEXTURE_WRAP_T: + return JS::NumberValue(uint32_t(mWrapT.get())); + + case LOCAL_GL_TEXTURE_BASE_LEVEL: + return JS::NumberValue(mBaseMipmapLevel); + + case LOCAL_GL_TEXTURE_COMPARE_MODE: + return JS::NumberValue(uint32_t(mTexCompareMode)); + + case LOCAL_GL_TEXTURE_MAX_LEVEL: + return JS::NumberValue(mMaxMipmapLevel); + + case LOCAL_GL_TEXTURE_IMMUTABLE_FORMAT: + return JS::BooleanValue(mImmutable); + + case LOCAL_GL_TEXTURE_IMMUTABLE_LEVELS: + return JS::NumberValue(uint32_t(mImmutableLevelCount)); + + case LOCAL_GL_TEXTURE_COMPARE_FUNC: + case LOCAL_GL_TEXTURE_WRAP_R: + mContext->gl->fGetTexParameteriv(texTarget.get(), pname, &i); + return JS::NumberValue(uint32_t(i)); + + case LOCAL_GL_TEXTURE_MAX_ANISOTROPY_EXT: + case LOCAL_GL_TEXTURE_MAX_LOD: + case LOCAL_GL_TEXTURE_MIN_LOD: + mContext->gl->fGetTexParameterfv(texTarget.get(), pname, &f); + return JS::NumberValue(float(f)); + + default: + MOZ_CRASH("GFX: Unhandled pname."); + } +} + +bool +WebGLTexture::IsTexture() const +{ + return HasEverBeenBound() && !IsDeleted(); +} + +// Here we have to support all pnames with both int and float params. +// See this discussion: +// https://www.khronos.org/webgl/public-mailing-list/archives/1008/msg00014.html +void +WebGLTexture::TexParameter(TexTarget texTarget, GLenum pname, const FloatOrInt& param) +{ + bool isPNameValid = false; + switch (pname) { + // GLES 2.0.25 p76: + case LOCAL_GL_TEXTURE_WRAP_S: + case LOCAL_GL_TEXTURE_WRAP_T: + case LOCAL_GL_TEXTURE_MIN_FILTER: + case LOCAL_GL_TEXTURE_MAG_FILTER: + isPNameValid = true; + break; + + // GLES 3.0.4 p149-150: + case LOCAL_GL_TEXTURE_BASE_LEVEL: + case LOCAL_GL_TEXTURE_COMPARE_MODE: + case LOCAL_GL_TEXTURE_COMPARE_FUNC: + case LOCAL_GL_TEXTURE_MAX_LEVEL: + case LOCAL_GL_TEXTURE_MAX_LOD: + case LOCAL_GL_TEXTURE_MIN_LOD: + case LOCAL_GL_TEXTURE_WRAP_R: + if (mContext->IsWebGL2()) + isPNameValid = true; + break; + + case LOCAL_GL_TEXTURE_MAX_ANISOTROPY_EXT: + if (mContext->IsExtensionEnabled(WebGLExtensionID::EXT_texture_filter_anisotropic)) + isPNameValid = true; + break; + } + + if (!isPNameValid) { + mContext->ErrorInvalidEnumInfo("texParameter: pname", pname); + return; + } + + //////////////// + // Validate params and invalidate if needed. + + bool paramBadEnum = false; + bool paramBadValue = false; + + switch (pname) { + case LOCAL_GL_TEXTURE_BASE_LEVEL: + case LOCAL_GL_TEXTURE_MAX_LEVEL: + paramBadValue = (param.i < 0); + break; + + case LOCAL_GL_TEXTURE_COMPARE_MODE: + paramBadValue = (param.i != LOCAL_GL_NONE && + param.i != LOCAL_GL_COMPARE_REF_TO_TEXTURE); + break; + + case LOCAL_GL_TEXTURE_COMPARE_FUNC: + switch (param.i) { + case LOCAL_GL_LEQUAL: + case LOCAL_GL_GEQUAL: + case LOCAL_GL_LESS: + case LOCAL_GL_GREATER: + case LOCAL_GL_EQUAL: + case LOCAL_GL_NOTEQUAL: + case LOCAL_GL_ALWAYS: + case LOCAL_GL_NEVER: + break; + + default: + paramBadValue = true; + break; + } + break; + + case LOCAL_GL_TEXTURE_MIN_FILTER: + switch (param.i) { + case LOCAL_GL_NEAREST: + case LOCAL_GL_LINEAR: + case LOCAL_GL_NEAREST_MIPMAP_NEAREST: + case LOCAL_GL_LINEAR_MIPMAP_NEAREST: + case LOCAL_GL_NEAREST_MIPMAP_LINEAR: + case LOCAL_GL_LINEAR_MIPMAP_LINEAR: + break; + + default: + paramBadEnum = true; + break; + } + break; + + case LOCAL_GL_TEXTURE_MAG_FILTER: + switch (param.i) { + case LOCAL_GL_NEAREST: + case LOCAL_GL_LINEAR: + break; + + default: + paramBadEnum = true; + break; + } + break; + + case LOCAL_GL_TEXTURE_WRAP_S: + case LOCAL_GL_TEXTURE_WRAP_T: + case LOCAL_GL_TEXTURE_WRAP_R: + switch (param.i) { + case LOCAL_GL_CLAMP_TO_EDGE: + case LOCAL_GL_MIRRORED_REPEAT: + case LOCAL_GL_REPEAT: + break; + + default: + paramBadEnum = true; + break; + } + break; + + case LOCAL_GL_TEXTURE_MAX_ANISOTROPY_EXT: + if (param.f < 1.0f) + paramBadValue = true; + + break; + } + + if (paramBadEnum) { + if (!param.isFloat) { + mContext->ErrorInvalidEnum("texParameteri: pname 0x%04x: Invalid param" + " 0x%04x.", + pname, param.i); + } else { + mContext->ErrorInvalidEnum("texParameterf: pname 0x%04x: Invalid param %g.", + pname, param.f); + } + return; + } + + if (paramBadValue) { + if (!param.isFloat) { + mContext->ErrorInvalidValue("texParameteri: pname 0x%04x: Invalid param %i" + " (0x%x).", + pname, param.i, param.i); + } else { + mContext->ErrorInvalidValue("texParameterf: pname 0x%04x: Invalid param %g.", + pname, param.f); + } + return; + } + + //////////////// + // Store any needed values + + FloatOrInt clamped = param; + switch (pname) { + case LOCAL_GL_TEXTURE_BASE_LEVEL: + mBaseMipmapLevel = clamped.i; + ClampLevelBaseAndMax(); + clamped = FloatOrInt(GLint(mBaseMipmapLevel)); + break; + + case LOCAL_GL_TEXTURE_MAX_LEVEL: + mMaxMipmapLevel = clamped.i; + ClampLevelBaseAndMax(); + clamped = FloatOrInt(GLint(mMaxMipmapLevel)); + break; + + case LOCAL_GL_TEXTURE_MIN_FILTER: + mMinFilter = clamped.i; + break; + + case LOCAL_GL_TEXTURE_MAG_FILTER: + mMagFilter = clamped.i; + break; + + case LOCAL_GL_TEXTURE_WRAP_S: + mWrapS = clamped.i; + break; + + case LOCAL_GL_TEXTURE_WRAP_T: + mWrapT = clamped.i; + break; + + case LOCAL_GL_TEXTURE_COMPARE_MODE: + mTexCompareMode = clamped.i; + break; + + // We don't actually need to store the WRAP_R, since it doesn't change texture + // completeness rules. + } + + // Only a couple of pnames don't need to invalidate our resolve status cache. + switch (pname) { + case LOCAL_GL_TEXTURE_MAX_ANISOTROPY_EXT: + case LOCAL_GL_TEXTURE_WRAP_R: + break; + + default: + InvalidateResolveCache(); + break; + } + + //////////////// + + mContext->MakeContextCurrent(); + if (!clamped.isFloat) + mContext->gl->fTexParameteri(texTarget.get(), pname, clamped.i); + else + mContext->gl->fTexParameterf(texTarget.get(), pname, clamped.f); +} + +//////////////////////////////////////////////////////////////////////////////// + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLTexture) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLTexture, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLTexture, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLTexture.h b/dom/canvas/WebGLTexture.h new file mode 100644 index 000000000..66e781f23 --- /dev/null +++ b/dom/canvas/WebGLTexture.h @@ -0,0 +1,444 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_TEXTURE_H_ +#define WEBGL_TEXTURE_H_ + +#include +#include +#include +#include + +#include "mozilla/Assertions.h" +#include "mozilla/CheckedInt.h" +#include "mozilla/dom/TypedArray.h" +#include "mozilla/LinkedList.h" +#include "nsWrapperCache.h" + +#include "WebGLFramebufferAttachable.h" +#include "WebGLObjectModel.h" +#include "WebGLStrongTypes.h" +#include "WebGLTypes.h" + +namespace mozilla { +class ErrorResult; +class WebGLContext; +struct FloatOrInt; +struct TexImageSource; + +namespace dom { +class Element; +class HTMLVideoElement; +class ImageData; +class ArrayBufferViewOrSharedArrayBufferView; +} // namespace dom + +namespace layers { +class Image; +} // namespace layers + +namespace webgl { +struct DriverUnpackInfo; +struct FormatUsageInfo; +struct PackingInfo; +class TexUnpackBlob; +} // namespace webgl + + +bool +DoesTargetMatchDimensions(WebGLContext* webgl, TexImageTarget target, uint8_t dims, + const char* funcName); + + +// NOTE: When this class is switched to new DOM bindings, update the (then-slow) +// WrapObject calls in GetParameter and GetFramebufferAttachmentParameter. +class WebGLTexture final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + // Friends + friend class WebGLContext; + friend class WebGLFramebuffer; + + //////////////////////////////////// + // Members +public: + const GLuint mGLName; + +protected: + TexTarget mTarget; + + static const uint8_t kMaxFaceCount = 6; + uint8_t mFaceCount; // 6 for cube maps, 1 otherwise. + + TexMinFilter mMinFilter; + TexMagFilter mMagFilter; + TexWrap mWrapS, mWrapT; + + bool mImmutable; // Set by texStorage* + uint8_t mImmutableLevelCount; + + uint32_t mBaseMipmapLevel; // Set by texParameter (defaults to 0) + uint32_t mMaxMipmapLevel; // Set by texParameter (defaults to 1000) + // You almost certainly don't want to query mMaxMipmapLevel. + // You almost certainly want MaxEffectiveMipmapLevel(). + + GLenum mTexCompareMode; + + // Resolvable optimizations: + bool mIsResolved; + FakeBlackType mResolved_FakeBlack; + const GLint* mResolved_Swizzle; // nullptr means 'default swizzle'. + +public: + class ImageInfo; + + // numLevels = log2(size) + 1 + // numLevels(16k) = log2(16k) + 1 = 14 + 1 = 15 + // numLevels(1M) = log2(1M) + 1 = 19.9 + 1 ~= 21 + // Or we can just max this out to 31, which is the number of unsigned bits in GLsizei. + static const uint8_t kMaxLevelCount = 31; + + // And in turn, it needs these forwards: +protected: + // We need to forward these. + void SetImageInfo(ImageInfo* target, const ImageInfo& newInfo); + void SetImageInfosAtLevel(uint32_t level, const ImageInfo& newInfo); + +public: + // We store information about the various images that are part of this + // texture. (cubemap faces, mipmap levels) + class ImageInfo + { + friend void WebGLTexture::SetImageInfo(ImageInfo* target, + const ImageInfo& newInfo); + friend void WebGLTexture::SetImageInfosAtLevel(uint32_t level, + const ImageInfo& newInfo); + + public: + static const ImageInfo kUndefined; + + // This is the "effective internal format" of the texture, an official + // OpenGL spec concept, see OpenGL ES 3.0.3 spec, section 3.8.3, page + // 126 and below. + const webgl::FormatUsageInfo* const mFormat; + + const uint32_t mWidth; + const uint32_t mHeight; + const uint32_t mDepth; + + protected: + bool mIsDataInitialized; + + std::set mAttachPoints; + + public: + ImageInfo() + : mFormat(LOCAL_GL_NONE) + , mWidth(0) + , mHeight(0) + , mDepth(0) + , mIsDataInitialized(false) + { } + + ImageInfo(const webgl::FormatUsageInfo* format, uint32_t width, uint32_t height, + uint32_t depth, bool isDataInitialized) + : mFormat(format) + , mWidth(width) + , mHeight(height) + , mDepth(depth) + , mIsDataInitialized(isDataInitialized) + { + MOZ_ASSERT(mFormat); + } + + void Clear(); + + ~ImageInfo() { + if (!IsDefined()) + Clear(); + } + + protected: + ImageInfo& operator =(const ImageInfo& a); + + public: + uint32_t PossibleMipmapLevels() const { + // GLES 3.0.4, 3.8 - Mipmapping: `floor(log2(largest_of_dims)) + 1` + const uint32_t largest = std::max(std::max(mWidth, mHeight), mDepth); + MOZ_ASSERT(largest != 0); + return FloorLog2Size(largest) + 1; + } + + bool IsPowerOfTwo() const; + + void AddAttachPoint(WebGLFBAttachPoint* attachPoint); + void RemoveAttachPoint(WebGLFBAttachPoint* attachPoint); + void OnRespecify() const; + + size_t MemoryUsage() const; + + bool IsDefined() const { + if (mFormat == LOCAL_GL_NONE) { + MOZ_ASSERT(!mWidth && !mHeight && !mDepth); + return false; + } + + return true; + } + + bool IsDataInitialized() const { return mIsDataInitialized; } + + void SetIsDataInitialized(bool isDataInitialized, WebGLTexture* tex); + }; + + ImageInfo mImageInfoArr[kMaxLevelCount * kMaxFaceCount]; + + //////////////////////////////////// +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTexture) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTexture) + + WebGLTexture(WebGLContext* webgl, GLuint tex); + + void Delete(); + + bool HasEverBeenBound() const { return mTarget != LOCAL_GL_NONE; } + TexTarget Target() const { return mTarget; } + + WebGLContext* GetParentObject() const { + return mContext; + } + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + +protected: + ~WebGLTexture() { + DeleteOnce(); + } + +public: + //////////////////////////////////// + // GL calls + bool BindTexture(TexTarget texTarget); + void GenerateMipmap(TexTarget texTarget); + JS::Value GetTexParameter(TexTarget texTarget, GLenum pname); + bool IsTexture() const; + void TexParameter(TexTarget texTarget, GLenum pname, const FloatOrInt& param); + + //////////////////////////////////// + // WebGLTextureUpload.cpp + +protected: + void TexOrSubImageBlob(bool isSubImage, const char* funcName, TexImageTarget target, + GLint level, GLenum internalFormat, GLint xOffset, + GLint yOffset, GLint zOffset, + const webgl::PackingInfo& pi, + const webgl::TexUnpackBlob* blob); + + bool ValidateTexImageSpecification(const char* funcName, TexImageTarget target, + GLint level, uint32_t width, uint32_t height, + uint32_t depth, + WebGLTexture::ImageInfo** const out_imageInfo); + bool ValidateTexImageSelection(const char* funcName, TexImageTarget target, + GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, uint32_t width, uint32_t height, + uint32_t depth, + WebGLTexture::ImageInfo** const out_imageInfo); + bool ValidateCopyTexImageForFeedback(const char* funcName, uint32_t level, GLint layer = 0) const; + + bool ValidateUnpack(const char* funcName, const webgl::TexUnpackBlob* blob, + bool isFunc3D, const webgl::PackingInfo& srcPI) const; +public: + void TexStorage(const char* funcName, TexTarget target, GLsizei levels, + GLenum sizedFormat, GLsizei width, GLsizei height, GLsizei depth); + void TexImage(const char* funcName, TexImageTarget target, GLint level, + GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, + GLint border, const webgl::PackingInfo& pi, const TexImageSource& src); + void TexSubImage(const char* funcName, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, const webgl::PackingInfo& pi, + const TexImageSource& src); +protected: + void TexImage(const char* funcName, TexImageTarget target, GLint level, + GLenum internalFormat, const webgl::PackingInfo& pi, + const webgl::TexUnpackBlob* blob); + void TexSubImage(const char* funcName, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, + const webgl::PackingInfo& pi, const webgl::TexUnpackBlob* blob); +public: + void CompressedTexImage(const char* funcName, TexImageTarget target, GLint level, + GLenum internalFormat, GLsizei width, GLsizei height, + GLsizei depth, GLint border, const TexImageSource& src); + void CompressedTexSubImage(const char* funcName, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, GLenum sizedUnpackFormat, + const TexImageSource& src); + + void CopyTexImage2D(TexImageTarget target, GLint level, GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, GLint border); + void CopyTexSubImage(const char* funcName, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLint x, GLint y, + GLsizei width, GLsizei height); + + //////////////////////////////////// + +protected: + void ClampLevelBaseAndMax(); + + void PopulateMipChain(uint32_t baseLevel, uint32_t maxLevel); + + bool MaxEffectiveMipmapLevel(uint32_t texUnit, uint32_t* const out) const; + + static uint8_t FaceForTarget(TexImageTarget texImageTarget) { + GLenum rawTexImageTarget = texImageTarget.get(); + switch (rawTexImageTarget) { + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + return rawTexImageTarget - LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X; + + default: + return 0; + } + } + + ImageInfo& ImageInfoAtFace(uint8_t face, uint32_t level) { + MOZ_ASSERT(face < mFaceCount); + MOZ_ASSERT(level < kMaxLevelCount); + size_t pos = (level * mFaceCount) + face; + return mImageInfoArr[pos]; + } + + const ImageInfo& ImageInfoAtFace(uint8_t face, uint32_t level) const { + return const_cast(this)->ImageInfoAtFace(face, level); + } + +public: + ImageInfo& ImageInfoAt(TexImageTarget texImageTarget, GLint level) { + auto face = FaceForTarget(texImageTarget); + return ImageInfoAtFace(face, level); + } + + const ImageInfo& ImageInfoAt(TexImageTarget texImageTarget, GLint level) const { + return const_cast(this)->ImageInfoAt(texImageTarget, level); + } + + void SetImageInfoAt(TexImageTarget texImageTarget, GLint level, + const ImageInfo& val) + { + ImageInfo* target = &ImageInfoAt(texImageTarget, level); + SetImageInfo(target, val); + } + + const ImageInfo& BaseImageInfo() const { + if (mBaseMipmapLevel >= kMaxLevelCount) + return ImageInfo::kUndefined; + + return ImageInfoAtFace(0, mBaseMipmapLevel); + } + + size_t MemoryUsage() const; + + bool InitializeImageData(const char* funcName, TexImageTarget target, uint32_t level); +protected: + bool EnsureImageDataInitialized(const char* funcName, TexImageTarget target, + uint32_t level); + bool EnsureLevelInitialized(const char* funcName, uint32_t level); + + bool CheckFloatTextureFilterParams() const { + // Without OES_texture_float_linear, only NEAREST and + // NEAREST_MIMPAMP_NEAREST are supported. + return mMagFilter == LOCAL_GL_NEAREST && + (mMinFilter == LOCAL_GL_NEAREST || + mMinFilter == LOCAL_GL_NEAREST_MIPMAP_NEAREST); + } + + bool AreBothWrapModesClampToEdge() const { + return mWrapS == LOCAL_GL_CLAMP_TO_EDGE && + mWrapT == LOCAL_GL_CLAMP_TO_EDGE; + } + +public: + bool DoesMinFilterRequireMipmap() const { + return !(mMinFilter == LOCAL_GL_NEAREST || + mMinFilter == LOCAL_GL_LINEAR); + } + + void SetGeneratedMipmap(); + + void SetCustomMipmap(); + + bool AreAllLevel0ImageInfosEqual() const; + + bool IsMipmapComplete(const char* funcName, uint32_t texUnit, + bool* const out_initFailed); + + bool IsCubeComplete() const; + + bool IsComplete(const char* funcName, uint32_t texUnit, const char** const out_reason, + bool* const out_initFailed); + + bool IsMipmapCubeComplete() const; + + bool IsCubeMap() const { return (mTarget == LOCAL_GL_TEXTURE_CUBE_MAP); } + + // Resolve cache optimizations +protected: + bool GetFakeBlackType(const char* funcName, uint32_t texUnit, + FakeBlackType* const out_fakeBlack); +public: + bool IsFeedback(WebGLContext* webgl, const char* funcName, uint32_t texUnit, + const std::vector& fbAttachments) const; + + bool ResolveForDraw(const char* funcName, uint32_t texUnit, + FakeBlackType* const out_fakeBlack); + + void InvalidateResolveCache() { mIsResolved = false; } +}; + +inline TexImageTarget +TexImageTargetForTargetAndFace(TexTarget target, uint8_t face) +{ + switch (target.get()) { + case LOCAL_GL_TEXTURE_2D: + case LOCAL_GL_TEXTURE_3D: + MOZ_ASSERT(face == 0); + return target.get(); + case LOCAL_GL_TEXTURE_CUBE_MAP: + MOZ_ASSERT(face < 6); + return LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X + face; + default: + MOZ_CRASH("GFX: TexImageTargetForTargetAndFace"); + } +} + +already_AddRefed +ImageFromVideo(dom::HTMLVideoElement* elem); + +bool +IsTarget3D(TexImageTarget target); + +GLenum +DoTexImage(gl::GLContext* gl, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLsizei width, GLsizei height, + GLsizei depth, const void* data); +GLenum +DoTexSubImage(gl::GLContext* gl, TexImageTarget target, GLint level, GLint xOffset, + GLint yOffset, GLint zOffset, GLsizei width, GLsizei height, + GLsizei depth, const webgl::PackingInfo& pi, const void* data); +GLenum +DoCompressedTexSubImage(gl::GLContext* gl, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, GLenum sizedUnpackFormat, + GLsizei dataSize, const void* data); + +} // namespace mozilla + +#endif // WEBGL_TEXTURE_H_ diff --git a/dom/canvas/WebGLTextureUpload.cpp b/dom/canvas/WebGLTextureUpload.cpp new file mode 100644 index 000000000..612d5889d --- /dev/null +++ b/dom/canvas/WebGLTextureUpload.cpp @@ -0,0 +1,2242 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLTexture.h" + +#include + +#include "CanvasUtils.h" +#include "gfxPrefs.h" +#include "GLBlitHelper.h" +#include "GLContext.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/dom/HTMLVideoElement.h" +#include "mozilla/dom/ImageBitmap.h" +#include "mozilla/dom/ImageData.h" +#include "mozilla/MathAlgorithms.h" +#include "mozilla/Scoped.h" +#include "mozilla/Unused.h" +#include "ScopedGLHelpers.h" +#include "TexUnpackBlob.h" +#include "WebGLBuffer.h" +#include "WebGLContext.h" +#include "WebGLContextUtils.h" +#include "WebGLFramebuffer.h" +#include "WebGLTexelConversions.h" + +namespace mozilla { + +/* This file handles: + * TexStorage2D(texTarget, levels, internalFormat, width, height) + * TexStorage3D(texTarget, levels, intenralFormat, width, height, depth) + * + * TexImage2D(texImageTarget, level, internalFormat, width, height, border, unpackFormat, + * unpackType, data) + * TexImage3D(texImageTarget, level, internalFormat, width, height, depth, border, + * unpackFormat, unpackType, data) + * TexSubImage2D(texImageTarget, level, xOffset, yOffset, width, height, unpackFormat, + * unpackType, data) + * TexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, width, height, depth, + * unpackFormat, unpackType, data) + * + * CompressedTexImage2D(texImageTarget, level, internalFormat, width, height, border, + * imageSize, data) + * CompressedTexImage3D(texImageTarget, level, internalFormat, width, height, depth, + * border, imageSize, data) + * CompressedTexSubImage2D(texImageTarget, level, xOffset, yOffset, width, height, + * sizedUnpackFormat, imageSize, data) + * CompressedTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, width, + * height, depth, sizedUnpackFormat, imageSize, data) + * + * CopyTexImage2D(texImageTarget, level, internalFormat, x, y, width, height, border) + * CopyTexImage3D - "Because the framebuffer is inhererntly two-dimensional, there is no + * CopyTexImage3D command." + * CopyTexSubImage2D(texImageTarget, level, xOffset, yOffset, x, y, width, height) + * CopyTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, x, y, width, + * height) + */ + +static bool +ValidateExtents(WebGLContext* webgl, const char* funcName, GLsizei width, GLsizei height, + GLsizei depth, GLint border, uint32_t* const out_width, + uint32_t* const out_height, uint32_t* const out_depth) +{ + // Check border + if (border != 0) { + webgl->ErrorInvalidValue("%s: `border` must be 0.", funcName); + return false; + } + + if (width < 0 || height < 0 || depth < 0) { + /* GL ES Version 2.0.25 - 3.7.1 Texture Image Specification + * "If wt and ht are the specified image width and height, + * and if either wt or ht are less than zero, then the error + * INVALID_VALUE is generated." + */ + webgl->ErrorInvalidValue("%s: `width`/`height`/`depth` must be >= 0.", funcName); + return false; + } + + *out_width = width; + *out_height = height; + *out_depth = depth; + return true; +} + +//////////////////////////////////////// +// ArrayBufferView? + +static inline bool +DoesJSTypeMatchUnpackType(GLenum unpackType, js::Scalar::Type jsType) +{ + switch (unpackType) { + case LOCAL_GL_BYTE: + return jsType == js::Scalar::Type::Int8; + + case LOCAL_GL_UNSIGNED_BYTE: + return jsType == js::Scalar::Type::Uint8 || + jsType == js::Scalar::Type::Uint8Clamped; + + case LOCAL_GL_SHORT: + return jsType == js::Scalar::Type::Int16; + + case LOCAL_GL_UNSIGNED_SHORT: + case LOCAL_GL_UNSIGNED_SHORT_4_4_4_4: + case LOCAL_GL_UNSIGNED_SHORT_5_5_5_1: + case LOCAL_GL_UNSIGNED_SHORT_5_6_5: + case LOCAL_GL_HALF_FLOAT: + case LOCAL_GL_HALF_FLOAT_OES: + return jsType == js::Scalar::Type::Uint16; + + case LOCAL_GL_INT: + return jsType == js::Scalar::Type::Int32; + + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV: + case LOCAL_GL_UNSIGNED_INT_10F_11F_11F_REV: + case LOCAL_GL_UNSIGNED_INT_5_9_9_9_REV: + case LOCAL_GL_UNSIGNED_INT_24_8: + return jsType == js::Scalar::Type::Uint32; + + case LOCAL_GL_FLOAT: + return jsType == js::Scalar::Type::Float32; + + default: + return false; + } +} + +static bool +ValidateViewType(WebGLContext* webgl, const char* funcName, GLenum unpackType, + const TexImageSource& src) +{ + if (!src.mView) + return true; + const auto& view = *(src.mView); + + const auto& jsType = view.Type(); + if (!DoesJSTypeMatchUnpackType(unpackType, jsType)) { + webgl->ErrorInvalidOperation("%s: ArrayBufferView type not compatible with" + " `type`.", + funcName); + return false; + } + + return true; +} + +static bool +ValidateUnpackInfo(WebGLContext* webgl, const char* funcName, + const webgl::PackingInfo& pi) +{ + if (!webgl->mFormatUsage->AreUnpackEnumsValid(pi.format, pi.type)) { + webgl->ErrorInvalidEnum("%s: Invalid unpack format/type: 0x%04x/0x%04x", funcName, + pi.format, pi.type); + return false; + } + + return true; +} + +//////////////////////////////////////////////////////////////////////////////// + +static UniquePtr +FromView(WebGLContext* webgl, const char* funcName, TexImageTarget target, + uint32_t width, uint32_t height, uint32_t depth, + const dom::ArrayBufferView* view, GLuint viewElemOffset, + GLuint viewElemLengthOverride) +{ + const bool isClientData = true; + const uint8_t* bytes = nullptr; + size_t availByteCount = 0; + if (view) { + if (!webgl->ValidateArrayBufferView(funcName, *view, viewElemOffset, + viewElemLengthOverride, + const_cast(&bytes), + &availByteCount)) + { + return nullptr; + } + } + return MakeUnique(webgl, target, width, height, depth, + isClientData, bytes, availByteCount); +} + +static UniquePtr +FromPboOffset(WebGLContext* webgl, const char* funcName, TexImageTarget target, + uint32_t width, uint32_t height, uint32_t depth, WebGLsizeiptr pboOffset) +{ + if (pboOffset < 0) { + webgl->ErrorInvalidValue("%s: offset cannot be negative.", funcName); + return nullptr; + } + + const auto& buffer = webgl->ValidateBufferSelection(funcName, + LOCAL_GL_PIXEL_UNPACK_BUFFER); + if (!buffer) + return nullptr; + + size_t availBufferBytes = buffer->ByteLength(); + if (size_t(pboOffset) > availBufferBytes) { + webgl->ErrorInvalidOperation("%s: Offset is passed end of buffer.", funcName); + return nullptr; + } + availBufferBytes -= pboOffset; + + const bool isClientData = false; + const auto ptr = (const uint8_t*)pboOffset; + return MakeUnique(webgl, target, width, height, depth, + isClientData, ptr, availBufferBytes); +} + +static UniquePtr +FromImageBitmap(WebGLContext* webgl, const char* funcName, TexImageTarget target, + uint32_t width, uint32_t height, uint32_t depth, + const dom::ImageBitmap& imageBitmap) +{ + UniquePtr cloneData = Move(imageBitmap.ToCloneData()); + const RefPtr surf = cloneData->mSurface; + + //// + + if (!width) { + width = surf->GetSize().width; + } + + if (!height) { + height = surf->GetSize().height; + } + + //// + + + // WhatWG "HTML Living Standard" (30 October 2015): + // "The getImageData(sx, sy, sw, sh) method [...] Pixels must be returned as + // non-premultiplied alpha values." + const bool isAlphaPremult = cloneData->mIsPremultipliedAlpha; + return MakeUnique(webgl, target, width, height, depth, surf, + isAlphaPremult); +} + +static UniquePtr +FromImageData(WebGLContext* webgl, const char* funcName, TexImageTarget target, + uint32_t width, uint32_t height, uint32_t depth, + const dom::ImageData& imageData, dom::Uint8ClampedArray* scopedArr) +{ + DebugOnly inited = scopedArr->Init(imageData.GetDataObject()); + MOZ_ASSERT(inited); + + scopedArr->ComputeLengthAndData(); + const DebugOnly dataSize = scopedArr->Length(); + const void* const data = scopedArr->Data(); + + const gfx::IntSize size(imageData.Width(), imageData.Height()); + const size_t stride = size.width * 4; + const gfx::SurfaceFormat surfFormat = gfx::SurfaceFormat::R8G8B8A8; + + MOZ_ASSERT(dataSize == stride * size.height); + + uint8_t* wrappableData = (uint8_t*)data; + + const RefPtr surf = + gfx::Factory::CreateWrappingDataSourceSurface(wrappableData, stride, size, + surfFormat); + if (!surf) { + webgl->ErrorOutOfMemory("%s: OOM in FromImageData.", funcName); + return nullptr; + } + + //// + + if (!width) { + width = imageData.Width(); + } + + if (!height) { + height = imageData.Height(); + } + + //// + + // WhatWG "HTML Living Standard" (30 October 2015): + // "The getImageData(sx, sy, sw, sh) method [...] Pixels must be returned as + // non-premultiplied alpha values." + const bool isAlphaPremult = false; + return MakeUnique(webgl, target, width, height, depth, surf, + isAlphaPremult); +} + +UniquePtr +WebGLContext::FromDomElem(const char* funcName, TexImageTarget target, uint32_t width, + uint32_t height, uint32_t depth, const dom::Element& elem, + ErrorResult* const out_error) +{ + uint32_t flags = nsLayoutUtils::SFE_WANT_IMAGE_SURFACE | + nsLayoutUtils::SFE_USE_ELEMENT_SIZE_IF_VECTOR; + + if (mPixelStore_ColorspaceConversion == LOCAL_GL_NONE) + flags |= nsLayoutUtils::SFE_NO_COLORSPACE_CONVERSION; + + if (!mPixelStore_PremultiplyAlpha) + flags |= nsLayoutUtils::SFE_PREFER_NO_PREMULTIPLY_ALPHA; + + RefPtr idealDrawTarget = nullptr; // Don't care for now. + auto sfer = nsLayoutUtils::SurfaceFromElement(const_cast(&elem), flags, + idealDrawTarget); + + ////// + + uint32_t elemWidth = 0; + uint32_t elemHeight = 0; + layers::Image* layersImage = nullptr; + if (!gfxPrefs::WebGLDisableDOMBlitUploads() && sfer.mLayersImage) { + layersImage = sfer.mLayersImage; + elemWidth = layersImage->GetSize().width; + elemHeight = layersImage->GetSize().height; + } + + RefPtr dataSurf; + if (!layersImage && sfer.GetSourceSurface()) { + const auto surf = sfer.GetSourceSurface(); + elemWidth = surf->GetSize().width; + elemHeight = surf->GetSize().height; + + // WARNING: OSX can lose our MakeCurrent here. + dataSurf = surf->GetDataSurface(); + } + + ////// + + if (!width) { + width = elemWidth; + } + + if (!height) { + height = elemHeight; + } + + //// + + if (!layersImage && !dataSurf) { + const bool isClientData = true; + return MakeUnique(this, target, width, height, depth, + isClientData, nullptr, 0); + } + + ////// + + // While it's counter-intuitive, the shape of the SFEResult API means that we should + // try to pull out a surface first, and then, if we do pull out a surface, check + // CORS/write-only/etc.. + + if (!sfer.mCORSUsed) { + auto& srcPrincipal = sfer.mPrincipal; + nsIPrincipal* dstPrincipal = GetCanvas()->NodePrincipal(); + + if (!dstPrincipal->Subsumes(srcPrincipal)) { + GenerateWarning("%s: Cross-origin elements require CORS.", funcName); + out_error->Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + } + + if (sfer.mIsWriteOnly) { + // mIsWriteOnly defaults to true, and so will be true even if SFE merely + // failed. Thus we must test mIsWriteOnly after successfully retrieving an + // Image or SourceSurface. + GenerateWarning("%s: Element is write-only, thus cannot be uploaded.", funcName); + out_error->Throw(NS_ERROR_DOM_SECURITY_ERR); + return nullptr; + } + + ////// + // Ok, we're good! + + const bool isAlphaPremult = sfer.mIsPremultiplied; + + if (layersImage) { + return MakeUnique(this, target, width, height, depth, + layersImage, isAlphaPremult); + } + + MOZ_ASSERT(dataSurf); + return MakeUnique(this, target, width, height, depth, + dataSurf, isAlphaPremult); +} + +//////////////////////////////////////// + +UniquePtr +WebGLContext::From(const char* funcName, TexImageTarget target, GLsizei rawWidth, + GLsizei rawHeight, GLsizei rawDepth, GLint border, + const TexImageSource& src, dom::Uint8ClampedArray* const scopedArr) +{ + uint32_t width, height, depth; + if (!ValidateExtents(this, funcName, rawWidth, rawHeight, rawDepth, border, &width, + &height, &depth)) + { + return nullptr; + } + + if (src.mPboOffset) { + return FromPboOffset(this, funcName, target, width, height, depth, + *(src.mPboOffset)); + } + + if (mBoundPixelUnpackBuffer) { + ErrorInvalidOperation("%s: PIXEL_UNPACK_BUFFER must be null.", funcName); + return nullptr; + } + + if (src.mImageBitmap) { + return FromImageBitmap(this, funcName, target, width, height, depth, + *(src.mImageBitmap)); + } + + if (src.mImageData) { + return FromImageData(this, funcName, target, width, height, depth, + *(src.mImageData), scopedArr); + } + + if (src.mDomElem) { + return FromDomElem(funcName, target, width, height, depth, *(src.mDomElem), + src.mOut_error); + } + + return FromView(this, funcName, target, width, height, depth, src.mView, + src.mViewElemOffset, src.mViewElemLengthOverride); +} + +//////////////////////////////////////////////////////////////////////////////// + +static UniquePtr +ValidateTexOrSubImage(WebGLContext* webgl, const char* funcName, TexImageTarget target, + GLsizei rawWidth, GLsizei rawHeight, GLsizei rawDepth, + GLint border, const webgl::PackingInfo& pi, + const TexImageSource& src, dom::Uint8ClampedArray* const scopedArr) +{ + if (!ValidateUnpackInfo(webgl, funcName, pi)) + return nullptr; + + if (!ValidateViewType(webgl, funcName, pi.type, src)) + return nullptr; + + auto blob = webgl->From(funcName, target, rawWidth, rawHeight, rawDepth, border, src, + scopedArr); + if (!blob || !blob->Validate(webgl, funcName, pi)) + return nullptr; + + return Move(blob); +} + +void +WebGLTexture::TexImage(const char* funcName, TexImageTarget target, GLint level, + GLenum internalFormat, GLsizei width, GLsizei height, + GLsizei depth, GLint border, const webgl::PackingInfo& pi, + const TexImageSource& src) +{ + dom::RootedTypedArray scopedArr(dom::RootingCx()); + const auto blob = ValidateTexOrSubImage(mContext, funcName, target, width, height, + depth, border, pi, src, &scopedArr); + if (!blob) + return; + + TexImage(funcName, target, level, internalFormat, pi, blob.get()); +} + +void +WebGLTexture::TexSubImage(const char* funcName, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, + const webgl::PackingInfo& pi, const TexImageSource& src) +{ + const GLint border = 0; + dom::RootedTypedArray scopedArr(dom::RootingCx()); + const auto blob = ValidateTexOrSubImage(mContext, funcName, target, width, height, + depth, border, pi, src, &scopedArr); + if (!blob) + return; + + if (!blob->HasData()) { + mContext->ErrorInvalidValue("%s: Source must not be null.", funcName); + return; + } + + TexSubImage(funcName, target, level, xOffset, yOffset, zOffset, pi, blob.get()); +} + +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// + +static bool +ValidateTexImage(WebGLContext* webgl, WebGLTexture* texture, const char* funcName, + TexImageTarget target, GLint level, + WebGLTexture::ImageInfo** const out_imageInfo) +{ + // Check level + if (level < 0) { + webgl->ErrorInvalidValue("%s: `level` must be >= 0.", funcName); + return false; + } + + if (level >= WebGLTexture::kMaxLevelCount) { + webgl->ErrorInvalidValue("%s: `level` is too large.", funcName); + return false; + } + + WebGLTexture::ImageInfo& imageInfo = texture->ImageInfoAt(target, level); + + *out_imageInfo = &imageInfo; + return true; +} + +// For *TexImage* +bool +WebGLTexture::ValidateTexImageSpecification(const char* funcName, TexImageTarget target, + GLint rawLevel, uint32_t width, + uint32_t height, uint32_t depth, + WebGLTexture::ImageInfo** const out_imageInfo) +{ + if (mImmutable) { + mContext->ErrorInvalidOperation("%s: Specified texture is immutable.", funcName); + return false; + } + + // Do this early to validate `level`. + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImage(mContext, this, funcName, target, rawLevel, &imageInfo)) + return false; + const uint32_t level(rawLevel); + + if (mTarget == LOCAL_GL_TEXTURE_CUBE_MAP && + width != height) + { + mContext->ErrorInvalidValue("%s: Cube map images must be square.", funcName); + return false; + } + + /* GLES 3.0.4, p133-134: + * GL_MAX_TEXTURE_SIZE is *not* the max allowed texture size. Rather, it is the + * max (width/height) size guaranteed not to generate an INVALID_VALUE for too-large + * dimensions. Sizes larger than GL_MAX_TEXTURE_SIZE *may or may not* result in an + * INVALID_VALUE, or possibly GL_OOM. + * + * However, we have needed to set our maximums lower in the past to prevent resource + * corruption. Therefore we have mImplMaxTextureSize, which is neither necessarily + * lower nor higher than MAX_TEXTURE_SIZE. + * + * Note that mImplMaxTextureSize must be >= than the advertized MAX_TEXTURE_SIZE. + * For simplicity, we advertize MAX_TEXTURE_SIZE as mImplMaxTextureSize. + */ + + uint32_t maxWidthHeight = 0; + uint32_t maxDepth = 0; + uint32_t maxLevel = 0; + + MOZ_ASSERT(level <= 31); + switch (target.get()) { + case LOCAL_GL_TEXTURE_2D: + maxWidthHeight = mContext->mImplMaxTextureSize >> level; + maxDepth = 1; + maxLevel = CeilingLog2(mContext->mImplMaxTextureSize); + break; + + case LOCAL_GL_TEXTURE_3D: + maxWidthHeight = mContext->mImplMax3DTextureSize >> level; + maxDepth = maxWidthHeight; + maxLevel = CeilingLog2(mContext->mImplMax3DTextureSize); + break; + + case LOCAL_GL_TEXTURE_2D_ARRAY: + maxWidthHeight = mContext->mImplMaxTextureSize >> level; + // "The maximum number of layers for two-dimensional array textures (depth) + // must be at least MAX_ARRAY_TEXTURE_LAYERS for all levels." + maxDepth = mContext->mImplMaxArrayTextureLayers; + maxLevel = CeilingLog2(mContext->mImplMaxTextureSize); + break; + + default: // cube maps + MOZ_ASSERT(IsCubeMap()); + maxWidthHeight = mContext->mImplMaxCubeMapTextureSize >> level; + maxDepth = 1; + maxLevel = CeilingLog2(mContext->mImplMaxCubeMapTextureSize); + break; + } + + if (level > maxLevel) { + mContext->ErrorInvalidValue("%s: Requested level is not supported for target.", + funcName); + return false; + } + + if (width > maxWidthHeight || + height > maxWidthHeight || + depth > maxDepth) + { + mContext->ErrorInvalidValue("%s: Requested size at this level is unsupported.", + funcName); + return false; + } + + { + /* GL ES Version 2.0.25 - 3.7.1 Texture Image Specification + * "If level is greater than zero, and either width or + * height is not a power-of-two, the error INVALID_VALUE is + * generated." + * + * This restriction does not apply to GL ES Version 3.0+. + */ + bool requirePOT = (!mContext->IsWebGL2() && level != 0); + + if (requirePOT) { + if (!IsPowerOfTwo(width) || !IsPowerOfTwo(height)) { + mContext->ErrorInvalidValue("%s: For level > 0, width and height must be" + " powers of two.", + funcName); + return false; + } + } + } + + *out_imageInfo = imageInfo; + return true; +} + +// For *TexSubImage* +bool +WebGLTexture::ValidateTexImageSelection(const char* funcName, TexImageTarget target, + GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, uint32_t width, uint32_t height, + uint32_t depth, + WebGLTexture::ImageInfo** const out_imageInfo) +{ + // The conformance test wants bad arg checks before imageInfo checks. + if (xOffset < 0 || yOffset < 0 || zOffset < 0) { + mContext->ErrorInvalidValue("%s: Offsets must be >=0.", funcName); + return false; + } + + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImage(mContext, this, funcName, target, level, &imageInfo)) + return false; + + if (!imageInfo->IsDefined()) { + mContext->ErrorInvalidOperation("%s: The specified TexImage has not yet been" + " specified.", + funcName); + return false; + } + + const auto totalX = CheckedUint32(xOffset) + width; + const auto totalY = CheckedUint32(yOffset) + height; + const auto totalZ = CheckedUint32(zOffset) + depth; + + if (!totalX.isValid() || totalX.value() > imageInfo->mWidth || + !totalY.isValid() || totalY.value() > imageInfo->mHeight || + !totalZ.isValid() || totalZ.value() > imageInfo->mDepth) + { + mContext->ErrorInvalidValue("%s: Offset+size must be <= the size of the existing" + " specified image.", + funcName); + return false; + } + + *out_imageInfo = imageInfo; + return true; +} + +static bool +ValidateCompressedTexUnpack(WebGLContext* webgl, const char* funcName, GLsizei width, + GLsizei height, GLsizei depth, + const webgl::FormatInfo* format, size_t dataSize) +{ + auto compression = format->compression; + + auto bytesPerBlock = compression->bytesPerBlock; + auto blockWidth = compression->blockWidth; + auto blockHeight = compression->blockHeight; + + auto widthInBlocks = CheckedUint32(width) / blockWidth; + auto heightInBlocks = CheckedUint32(height) / blockHeight; + if (width % blockWidth) widthInBlocks += 1; + if (height % blockHeight) heightInBlocks += 1; + + const CheckedUint32 blocksPerImage = widthInBlocks * heightInBlocks; + const CheckedUint32 bytesPerImage = bytesPerBlock * blocksPerImage; + const CheckedUint32 bytesNeeded = bytesPerImage * depth; + + if (!bytesNeeded.isValid()) { + webgl->ErrorOutOfMemory("%s: Overflow while computing the needed buffer size.", + funcName); + return false; + } + + if (dataSize != bytesNeeded.value()) { + webgl->ErrorInvalidValue("%s: Provided buffer's size must match expected size." + " (needs %u, has %u)", + funcName, bytesNeeded.value(), dataSize); + return false; + } + + return true; +} + +static bool +DoChannelsMatchForCopyTexImage(const webgl::FormatInfo* srcFormat, + const webgl::FormatInfo* dstFormat) +{ + // GLES 3.0.4 p140 Table 3.16 "Valid CopyTexImage source framebuffer/destination + // texture base internal format combinations." + + switch (srcFormat->unsizedFormat) { + case webgl::UnsizedFormat::RGBA: + switch (dstFormat->unsizedFormat) { + case webgl::UnsizedFormat::A: + case webgl::UnsizedFormat::L: + case webgl::UnsizedFormat::LA: + case webgl::UnsizedFormat::R: + case webgl::UnsizedFormat::RG: + case webgl::UnsizedFormat::RGB: + case webgl::UnsizedFormat::RGBA: + return true; + default: + return false; + } + + case webgl::UnsizedFormat::RGB: + switch (dstFormat->unsizedFormat) { + case webgl::UnsizedFormat::L: + case webgl::UnsizedFormat::R: + case webgl::UnsizedFormat::RG: + case webgl::UnsizedFormat::RGB: + return true; + default: + return false; + } + + case webgl::UnsizedFormat::RG: + switch (dstFormat->unsizedFormat) { + case webgl::UnsizedFormat::L: + case webgl::UnsizedFormat::R: + case webgl::UnsizedFormat::RG: + return true; + default: + return false; + } + + case webgl::UnsizedFormat::R: + switch (dstFormat->unsizedFormat) { + case webgl::UnsizedFormat::L: + case webgl::UnsizedFormat::R: + return true; + default: + return false; + } + + default: + return false; + } +} + +static bool +EnsureImageDataInitializedForUpload(WebGLTexture* tex, const char* funcName, + TexImageTarget target, GLint level, GLint xOffset, + GLint yOffset, GLint zOffset, uint32_t width, + uint32_t height, uint32_t depth, + WebGLTexture::ImageInfo* imageInfo, + bool* const out_uploadWillInitialize) +{ + *out_uploadWillInitialize = false; + + if (!imageInfo->IsDataInitialized()) { + const bool isFullUpload = (!xOffset && !yOffset && !zOffset && + width == imageInfo->mWidth && + height == imageInfo->mHeight && + depth == imageInfo->mDepth); + if (isFullUpload) { + *out_uploadWillInitialize = true; + } else { + WebGLContext* webgl = tex->mContext; + webgl->GenerateWarning("%s: Texture has not been initialized prior to a" + " partial upload, forcing the browser to clear it." + " This may be slow.", + funcName); + if (!tex->InitializeImageData(funcName, target, level)) { + MOZ_ASSERT(false, "Unexpected failure to init image data."); + return false; + } + } + } + + return true; +} + +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +// Actual calls + +static inline GLenum +DoTexStorage(gl::GLContext* gl, TexTarget target, GLsizei levels, GLenum sizedFormat, + GLsizei width, GLsizei height, GLsizei depth) +{ + gl::GLContext::LocalErrorScope errorScope(*gl); + + switch (target.get()) { + case LOCAL_GL_TEXTURE_2D: + case LOCAL_GL_TEXTURE_CUBE_MAP: + MOZ_ASSERT(depth == 1); + gl->fTexStorage2D(target.get(), levels, sizedFormat, width, height); + break; + + case LOCAL_GL_TEXTURE_3D: + case LOCAL_GL_TEXTURE_2D_ARRAY: + gl->fTexStorage3D(target.get(), levels, sizedFormat, width, height, depth); + break; + + default: + MOZ_CRASH("GFX: bad target"); + } + + return errorScope.GetError(); +} + +bool +IsTarget3D(TexImageTarget target) +{ + switch (target.get()) { + case LOCAL_GL_TEXTURE_2D: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + return false; + + case LOCAL_GL_TEXTURE_3D: + case LOCAL_GL_TEXTURE_2D_ARRAY: + return true; + + default: + MOZ_CRASH("GFX: bad target"); + } +} + +GLenum +DoTexImage(gl::GLContext* gl, TexImageTarget target, GLint level, + const webgl::DriverUnpackInfo* dui, GLsizei width, GLsizei height, + GLsizei depth, const void* data) +{ + const GLint border = 0; + + gl::GLContext::LocalErrorScope errorScope(*gl); + + if (IsTarget3D(target)) { + gl->fTexImage3D(target.get(), level, dui->internalFormat, width, height, depth, + border, dui->unpackFormat, dui->unpackType, data); + } else { + MOZ_ASSERT(depth == 1); + gl->fTexImage2D(target.get(), level, dui->internalFormat, width, height, border, + dui->unpackFormat, dui->unpackType, data); + } + + return errorScope.GetError(); +} + +GLenum +DoTexSubImage(gl::GLContext* gl, TexImageTarget target, GLint level, GLint xOffset, + GLint yOffset, GLint zOffset, GLsizei width, GLsizei height, GLsizei depth, + const webgl::PackingInfo& pi, const void* data) +{ + gl::GLContext::LocalErrorScope errorScope(*gl); + + if (IsTarget3D(target)) { + gl->fTexSubImage3D(target.get(), level, xOffset, yOffset, zOffset, width, height, + depth, pi.format, pi.type, data); + } else { + MOZ_ASSERT(zOffset == 0); + MOZ_ASSERT(depth == 1); + gl->fTexSubImage2D(target.get(), level, xOffset, yOffset, width, height, + pi.format, pi.type, data); + } + + return errorScope.GetError(); +} + +static inline GLenum +DoCompressedTexImage(gl::GLContext* gl, TexImageTarget target, GLint level, + GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, + GLsizei dataSize, const void* data) +{ + const GLint border = 0; + + gl::GLContext::LocalErrorScope errorScope(*gl); + + if (IsTarget3D(target)) { + gl->fCompressedTexImage3D(target.get(), level, internalFormat, width, height, + depth, border, dataSize, data); + } else { + MOZ_ASSERT(depth == 1); + gl->fCompressedTexImage2D(target.get(), level, internalFormat, width, height, + border, dataSize, data); + } + + return errorScope.GetError(); +} + +GLenum +DoCompressedTexSubImage(gl::GLContext* gl, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLsizei width, + GLsizei height, GLsizei depth, GLenum sizedUnpackFormat, + GLsizei dataSize, const void* data) +{ + gl::GLContext::LocalErrorScope errorScope(*gl); + + if (IsTarget3D(target)) { + gl->fCompressedTexSubImage3D(target.get(), level, xOffset, yOffset, zOffset, + width, height, depth, sizedUnpackFormat, dataSize, + data); + } else { + MOZ_ASSERT(zOffset == 0); + MOZ_ASSERT(depth == 1); + gl->fCompressedTexSubImage2D(target.get(), level, xOffset, yOffset, width, + height, sizedUnpackFormat, dataSize, data); + } + + return errorScope.GetError(); +} + +static inline GLenum +DoCopyTexImage2D(gl::GLContext* gl, TexImageTarget target, GLint level, + GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) +{ + const GLint border = 0; + + gl::GLContext::LocalErrorScope errorScope(*gl); + + MOZ_ASSERT(!IsTarget3D(target)); + gl->fCopyTexImage2D(target.get(), level, internalFormat, x, y, width, height, + border); + + return errorScope.GetError(); +} + +static inline GLenum +DoCopyTexSubImage(gl::GLContext* gl, TexImageTarget target, GLint level, GLint xOffset, + GLint yOffset, GLint zOffset, GLint x, GLint y, GLsizei width, + GLsizei height) +{ + gl::GLContext::LocalErrorScope errorScope(*gl); + + if (IsTarget3D(target)) { + gl->fCopyTexSubImage3D(target.get(), level, xOffset, yOffset, zOffset, x, y, + width, height); + } else { + MOZ_ASSERT(zOffset == 0); + gl->fCopyTexSubImage2D(target.get(), level, xOffset, yOffset, x, y, width, + height); + } + + return errorScope.GetError(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +// Actual (mostly generic) function implementations + +static bool +ValidateCompressedTexImageRestrictions(const char* funcName, WebGLContext* webgl, + TexImageTarget target, uint32_t level, + const webgl::FormatInfo* format, uint32_t width, + uint32_t height, uint32_t depth) +{ + const auto fnIsDimValid_S3TC = [level](uint32_t size, uint32_t blockSize) { + if (size % blockSize == 0) + return true; + + if (level == 0) + return false; + + return (size == 0 || size == 1 || size == 2); + }; + + switch (format->compression->family) { + case webgl::CompressionFamily::PVRTC: + if (!IsPowerOfTwo(width) || !IsPowerOfTwo(height)) { + webgl->ErrorInvalidValue("%s: %s requires power-of-two width and height.", + funcName, format->name); + return false; + } + + break; + + case webgl::CompressionFamily::S3TC: + if (!fnIsDimValid_S3TC(width, format->compression->blockWidth) || + !fnIsDimValid_S3TC(height, format->compression->blockHeight)) + { + webgl->ErrorInvalidOperation("%s: %s requires that width and height are" + " block-aligned, or, if level>0, equal to 0, 1," + " or 2.", + funcName, format->name); + return false; + } + + break; + + // Default: There are no restrictions on CompressedTexImage. + default: // ATC, ETC1, ES3 + break; + } + + return true; +} + +static bool +ValidateTargetForFormat(const char* funcName, WebGLContext* webgl, TexImageTarget target, + const webgl::FormatInfo* format) +{ + // GLES 3.0.4 p127: + // "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL are + // supported by texture image specification commands only if `target` is TEXTURE_2D, + // TEXTURE_2D_ARRAY, or TEXTURE_CUBE_MAP. Using these formats in conjunction with any + // other `target` will result in an INVALID_OPERATION error." + + switch (format->effectiveFormat) { + // TEXTURE_2D_ARRAY but not TEXTURE_3D: + // D and DS formats + case webgl::EffectiveFormat::DEPTH_COMPONENT16: + case webgl::EffectiveFormat::DEPTH_COMPONENT24: + case webgl::EffectiveFormat::DEPTH_COMPONENT32F: + case webgl::EffectiveFormat::DEPTH24_STENCIL8: + case webgl::EffectiveFormat::DEPTH32F_STENCIL8: + // CompressionFamily::ES3 + case webgl::EffectiveFormat::COMPRESSED_R11_EAC: + case webgl::EffectiveFormat::COMPRESSED_SIGNED_R11_EAC: + case webgl::EffectiveFormat::COMPRESSED_RG11_EAC: + case webgl::EffectiveFormat::COMPRESSED_SIGNED_RG11_EAC: + case webgl::EffectiveFormat::COMPRESSED_RGB8_ETC2: + case webgl::EffectiveFormat::COMPRESSED_SRGB8_ETC2: + case webgl::EffectiveFormat::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case webgl::EffectiveFormat::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case webgl::EffectiveFormat::COMPRESSED_RGBA8_ETC2_EAC: + case webgl::EffectiveFormat::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: + // CompressionFamily::S3TC + case webgl::EffectiveFormat::COMPRESSED_RGB_S3TC_DXT1_EXT: + case webgl::EffectiveFormat::COMPRESSED_RGBA_S3TC_DXT1_EXT: + case webgl::EffectiveFormat::COMPRESSED_RGBA_S3TC_DXT3_EXT: + case webgl::EffectiveFormat::COMPRESSED_RGBA_S3TC_DXT5_EXT: + if (target == LOCAL_GL_TEXTURE_3D) { + webgl->ErrorInvalidOperation("%s: Format %s cannot be used with TEXTURE_3D.", + funcName, format->name); + return false; + } + break; + + // No 3D targets: + // CompressionFamily::ATC + case webgl::EffectiveFormat::ATC_RGB_AMD: + case webgl::EffectiveFormat::ATC_RGBA_EXPLICIT_ALPHA_AMD: + case webgl::EffectiveFormat::ATC_RGBA_INTERPOLATED_ALPHA_AMD: + // CompressionFamily::PVRTC + case webgl::EffectiveFormat::COMPRESSED_RGB_PVRTC_4BPPV1: + case webgl::EffectiveFormat::COMPRESSED_RGBA_PVRTC_4BPPV1: + case webgl::EffectiveFormat::COMPRESSED_RGB_PVRTC_2BPPV1: + case webgl::EffectiveFormat::COMPRESSED_RGBA_PVRTC_2BPPV1: + // CompressionFamily::ETC1 + case webgl::EffectiveFormat::ETC1_RGB8_OES: + if (target == LOCAL_GL_TEXTURE_3D || + target == LOCAL_GL_TEXTURE_2D_ARRAY) + { + webgl->ErrorInvalidOperation("%s: Format %s cannot be used with TEXTURE_3D or" + " TEXTURE_2D_ARRAY.", + funcName, format->name); + return false; + } + break; + + default: + break; + } + + return true; +} + +void +WebGLTexture::TexStorage(const char* funcName, TexTarget target, GLsizei levels, + GLenum sizedFormat, GLsizei width, GLsizei height, GLsizei depth) +{ + // Check levels + if (levels < 1) { + mContext->ErrorInvalidValue("%s: `levels` must be >= 1.", funcName); + return; + } + + if (!width || !height || !depth) { + mContext->ErrorInvalidValue("%s: Dimensions must be non-zero.", funcName); + return; + } + + const TexImageTarget testTarget = IsCubeMap() ? LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X + : target.get(); + const GLint testLevel = 0; + + WebGLTexture::ImageInfo* testImageInfo; + if (!ValidateTexImageSpecification(funcName, testTarget, testLevel, width, height, + depth, &testImageInfo)) + { + return; + } + MOZ_ASSERT(testImageInfo); + mozilla::Unused << testImageInfo; + + auto dstUsage = mContext->mFormatUsage->GetSizedTexUsage(sizedFormat); + if (!dstUsage) { + mContext->ErrorInvalidEnum("%s: Invalid internalformat: 0x%04x", funcName, + sizedFormat); + return; + } + auto dstFormat = dstUsage->format; + + if (!ValidateTargetForFormat(funcName, mContext, testTarget, dstFormat)) + return; + + if (dstFormat->compression) { + if (!ValidateCompressedTexImageRestrictions(funcName, mContext, testTarget, + testLevel, dstFormat, width, height, + depth)) + { + return; + } + } + + //////////////////////////////////// + + const auto lastLevel = levels - 1; + MOZ_ASSERT(lastLevel <= 31, "Right-shift is only defined for bits-1."); + + const uint32_t lastLevelWidth = uint32_t(width) >> lastLevel; + const uint32_t lastLevelHeight = uint32_t(height) >> lastLevel; + const uint32_t lastLevelDepth = uint32_t(depth) >> lastLevel; + + // If these are all zero, then some earlier level was the final 1x1x1 level. + if (!lastLevelWidth && !lastLevelHeight && !lastLevelDepth) { + mContext->ErrorInvalidOperation("%s: Too many levels requested for the given" + " dimensions. (levels: %u, width: %u, height: %u," + " depth: %u)", + funcName, levels, width, height, depth); + return; + } + + //////////////////////////////////// + // Do the thing! + + mContext->gl->MakeCurrent(); + + GLenum error = DoTexStorage(mContext->gl, target.get(), levels, sizedFormat, width, + height, depth); + + if (error == LOCAL_GL_OUT_OF_MEMORY) { + mContext->ErrorOutOfMemory("%s: Ran out of memory during texture allocation.", + funcName); + return; + } + if (error) { + MOZ_RELEASE_ASSERT(false, "GFX: We should have caught all other errors."); + mContext->ErrorInvalidOperation("%s: Unexpected error during texture allocation.", + funcName); + return; + } + + //////////////////////////////////// + // Update our specification data. + + const bool isDataInitialized = false; + const WebGLTexture::ImageInfo newInfo(dstUsage, width, height, depth, + isDataInitialized); + SetImageInfosAtLevel(0, newInfo); + + PopulateMipChain(0, levels-1); + + mImmutable = true; + mImmutableLevelCount = levels; +} + +//////////////////////////////////////// +// Tex(Sub)Image + +void +WebGLTexture::TexImage(const char* funcName, TexImageTarget target, GLint level, + GLenum internalFormat, const webgl::PackingInfo& pi, + const webgl::TexUnpackBlob* blob) +{ + //////////////////////////////////// + // Get dest info + + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImageSpecification(funcName, target, level, blob->mWidth, + blob->mHeight, blob->mDepth, &imageInfo)) + { + return; + } + MOZ_ASSERT(imageInfo); + + const auto& fua = mContext->mFormatUsage; + if (!fua->IsInternalFormatEnumValid(internalFormat)) { + mContext->ErrorInvalidValue("%s: Invalid internalformat: 0x%04x", + funcName, internalFormat); + return; + } + + auto dstUsage = fua->GetSizedTexUsage(internalFormat); + if (!dstUsage) { + if (internalFormat != pi.format) { + /* GL ES Version 3.0.4 - 3.8.3 Texture Image Specification + * "Specifying a combination of values for format, type, and + * internalformat that is not listed as a valid combination + * in tables 3.2 or 3.3 generates the error INVALID_OPERATION." + */ + mContext->ErrorInvalidOperation("%s: Unsized internalFormat must match" + " unpack format.", + funcName); + return; + } + + dstUsage = fua->GetUnsizedTexUsage(pi); + } + + if (!dstUsage) { + mContext->ErrorInvalidOperation("%s: Invalid internalformat/format/type:" + " 0x%04x/0x%04x/0x%04x", + funcName, internalFormat, pi.format, pi.type); + return; + } + + const webgl::DriverUnpackInfo* driverUnpackInfo; + if (!dstUsage->IsUnpackValid(pi, &driverUnpackInfo)) { + mContext->ErrorInvalidOperation("%s: Mismatched internalFormat and format/type:" + " 0x%04x and 0x%04x/0x%04x", + funcName, internalFormat, pi.format, pi.type); + return; + } + + //////////////////////////////////// + // Check that source and dest info are compatible + auto dstFormat = dstUsage->format; + + if (!ValidateTargetForFormat(funcName, mContext, target, dstFormat)) + return; + + if (!mContext->IsWebGL2() && dstFormat->d) { + if (target != LOCAL_GL_TEXTURE_2D || + blob->HasData() || + level != 0) + { + mContext->ErrorInvalidOperation("%s: With format %s, this function may only" + " be called with target=TEXTURE_2D," + " data=null, and level=0.", + funcName, dstFormat->name); + return; + } + } + + //////////////////////////////////// + // Do the thing! + + MOZ_ALWAYS_TRUE( mContext->gl->MakeCurrent() ); + MOZ_ASSERT(mContext->gl->IsCurrent()); + + // It's tempting to do allocation first, and TexSubImage second, but this is generally + // slower. + + const ImageInfo newImageInfo(dstUsage, blob->mWidth, blob->mHeight, blob->mDepth, + blob->HasData()); + + const bool isSubImage = false; + const bool needsRespec = (imageInfo->mWidth != newImageInfo.mWidth || + imageInfo->mHeight != newImageInfo.mHeight || + imageInfo->mDepth != newImageInfo.mDepth || + imageInfo->mFormat != newImageInfo.mFormat); + const GLint xOffset = 0; + const GLint yOffset = 0; + const GLint zOffset = 0; + + GLenum glError; + if (!blob->TexOrSubImage(isSubImage, needsRespec, funcName, this, target, level, + driverUnpackInfo, xOffset, yOffset, zOffset, &glError)) + { + return; + } + + if (glError == LOCAL_GL_OUT_OF_MEMORY) { + mContext->ErrorOutOfMemory("%s: Driver ran out of memory during upload.", + funcName); + return; + } + + if (glError) { + mContext->ErrorInvalidOperation("%s: Unexpected error during upload: 0x%04x", + funcName, glError); + printf_stderr("%s: dui: %x/%x/%x\n", funcName, driverUnpackInfo->internalFormat, + driverUnpackInfo->unpackFormat, driverUnpackInfo->unpackType); + MOZ_ASSERT(false, "Unexpected GL error."); + return; + } + + //////////////////////////////////// + // Update our specification data. + + SetImageInfo(imageInfo, newImageInfo); +} + +void +WebGLTexture::TexSubImage(const char* funcName, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, + const webgl::PackingInfo& pi, const webgl::TexUnpackBlob* blob) +{ + //////////////////////////////////// + // Get dest info + + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImageSelection(funcName, target, level, xOffset, yOffset, zOffset, + blob->mWidth, blob->mHeight, blob->mDepth, &imageInfo)) + { + return; + } + MOZ_ASSERT(imageInfo); + + auto dstUsage = imageInfo->mFormat; + auto dstFormat = dstUsage->format; + + if (dstFormat->compression) { + mContext->ErrorInvalidEnum("%s: Specified TexImage must not be compressed.", + funcName); + return; + } + + if (!mContext->IsWebGL2() && dstFormat->d) { + mContext->ErrorInvalidOperation("%s: Function may not be called on a texture of" + " format %s.", + funcName, dstFormat->name); + return; + } + + //////////////////////////////////// + // Get source info + + const webgl::DriverUnpackInfo* driverUnpackInfo; + if (!dstUsage->IsUnpackValid(pi, &driverUnpackInfo)) { + mContext->ErrorInvalidOperation("%s: Mismatched internalFormat and format/type:" + " %s and 0x%04x/0x%04x", + funcName, dstFormat->name, pi.format, pi.type); + return; + } + + //////////////////////////////////// + // Do the thing! + + mContext->gl->MakeCurrent(); + + bool uploadWillInitialize; + if (!EnsureImageDataInitializedForUpload(this, funcName, target, level, xOffset, + yOffset, zOffset, blob->mWidth, + blob->mHeight, blob->mDepth, imageInfo, + &uploadWillInitialize)) + { + return; + } + + const bool isSubImage = true; + const bool needsRespec = false; + + GLenum glError; + if (!blob->TexOrSubImage(isSubImage, needsRespec, funcName, this, target, level, + driverUnpackInfo, xOffset, yOffset, zOffset, &glError)) + { + return; + } + + if (glError == LOCAL_GL_OUT_OF_MEMORY) { + mContext->ErrorOutOfMemory("%s: Driver ran out of memory during upload.", + funcName); + return; + } + + if (glError) { + mContext->ErrorInvalidOperation("%s: Unexpected error during upload: 0x04x", + funcName, glError); + MOZ_ASSERT(false, "Unexpected GL error."); + return; + } + + //////////////////////////////////// + // Update our specification data? + + if (uploadWillInitialize) { + imageInfo->SetIsDataInitialized(true, this); + } +} + +//////////////////////////////////////// +// CompressedTex(Sub)Image + +UniquePtr +WebGLContext::FromCompressed(const char* funcName, TexImageTarget target, + GLsizei rawWidth, GLsizei rawHeight, GLsizei rawDepth, + GLint border, const TexImageSource& src) +{ + uint32_t width, height, depth; + if (!ValidateExtents(this, funcName, rawWidth, rawHeight, rawDepth, border, &width, + &height, &depth)) + { + return nullptr; + } + + if (src.mPboOffset) { + return FromPboOffset(this, funcName, target, width, height, depth, + *(src.mPboOffset)); + } + + if (mBoundPixelUnpackBuffer) { + ErrorInvalidOperation("%s: PIXEL_UNPACK_BUFFER must be null.", funcName); + return nullptr; + } + + return FromView(this, funcName, target, width, height, depth, src.mView, + src.mViewElemOffset, src.mViewElemLengthOverride); +} + +void +WebGLTexture::CompressedTexImage(const char* funcName, TexImageTarget target, GLint level, + GLenum internalFormat, GLsizei rawWidth, + GLsizei rawHeight, GLsizei rawDepth, GLint border, + const TexImageSource& src) +{ + const auto blob = mContext->FromCompressed(funcName, target, rawWidth, rawHeight, + rawDepth, border, src); + if (!blob) + return; + + //////////////////////////////////// + // Get dest info + + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImageSpecification(funcName, target, level, blob->mWidth, + blob->mHeight, blob->mDepth, &imageInfo)) + { + return; + } + MOZ_ASSERT(imageInfo); + + auto usage = mContext->mFormatUsage->GetSizedTexUsage(internalFormat); + if (!usage) { + mContext->ErrorInvalidEnum("%s: Invalid internalFormat: 0x%04x", funcName, + internalFormat); + return; + } + + auto format = usage->format; + if (!format->compression) { + mContext->ErrorInvalidEnum("%s: Specified internalFormat must be compressed.", + funcName); + return; + } + + if (!ValidateTargetForFormat(funcName, mContext, target, format)) + return; + + //////////////////////////////////// + // Get source info + + if (!ValidateCompressedTexUnpack(mContext, funcName, blob->mWidth, blob->mHeight, + blob->mDepth, format, blob->mAvailBytes)) + { + return; + } + + //////////////////////////////////// + // Check that source is compatible with dest + + if (!ValidateCompressedTexImageRestrictions(funcName, mContext, target, level, format, + blob->mWidth, blob->mHeight, + blob->mDepth)) + { + return; + } + + //////////////////////////////////// + // Do the thing! + + mContext->gl->MakeCurrent(); + + // Warning: Possibly shared memory. See bug 1225033. + GLenum error = DoCompressedTexImage(mContext->gl, target, level, internalFormat, + blob->mWidth, blob->mHeight, blob->mDepth, + blob->mAvailBytes, blob->mPtr); + if (error == LOCAL_GL_OUT_OF_MEMORY) { + mContext->ErrorOutOfMemory("%s: Ran out of memory during upload.", funcName); + return; + } + if (error) { + MOZ_RELEASE_ASSERT(false, "GFX: We should have caught all other errors."); + mContext->GenerateWarning("%s: Unexpected error during texture upload. Context" + " lost.", + funcName); + mContext->ForceLoseContext(); + return; + } + + //////////////////////////////////// + // Update our specification data. + + const bool isDataInitialized = true; + const ImageInfo newImageInfo(usage, blob->mWidth, blob->mHeight, blob->mDepth, + isDataInitialized); + SetImageInfo(imageInfo, newImageInfo); +} + +static inline bool +IsSubImageBlockAligned(const webgl::CompressedFormatInfo* compression, + const WebGLTexture::ImageInfo* imageInfo, GLint xOffset, + GLint yOffset, uint32_t width, uint32_t height) +{ + if (xOffset % compression->blockWidth != 0 || + yOffset % compression->blockHeight != 0) + { + return false; + } + + if (width % compression->blockWidth != 0 && xOffset + width != imageInfo->mWidth) + return false; + + if (height % compression->blockHeight != 0 && yOffset + height != imageInfo->mHeight) + return false; + + return true; +} + +void +WebGLTexture::CompressedTexSubImage(const char* funcName, TexImageTarget target, + GLint level, GLint xOffset, GLint yOffset, + GLint zOffset, GLsizei rawWidth, GLsizei rawHeight, + GLsizei rawDepth, GLenum sizedUnpackFormat, + const TexImageSource& src) +{ + const GLint border = 0; + const auto blob = mContext->FromCompressed(funcName, target, rawWidth, rawHeight, + rawDepth, border, src); + if (!blob) + return; + + //////////////////////////////////// + // Get dest info + + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImageSelection(funcName, target, level, xOffset, yOffset, zOffset, + blob->mWidth, blob->mHeight, blob->mDepth, &imageInfo)) + { + return; + } + MOZ_ASSERT(imageInfo); + + auto dstUsage = imageInfo->mFormat; + auto dstFormat = dstUsage->format; + + //////////////////////////////////// + // Get source info + + auto srcUsage = mContext->mFormatUsage->GetSizedTexUsage(sizedUnpackFormat); + if (!srcUsage->format->compression) { + mContext->ErrorInvalidEnum("%s: Specified format must be compressed.", funcName); + return; + } + + if (srcUsage != dstUsage) { + mContext->ErrorInvalidOperation("%s: `format` must match the format of the" + " existing texture image.", + funcName); + return; + } + + auto format = srcUsage->format; + MOZ_ASSERT(format == dstFormat); + if (!ValidateCompressedTexUnpack(mContext, funcName, blob->mWidth, blob->mHeight, + blob->mDepth, format, blob->mAvailBytes)) + { + return; + } + + //////////////////////////////////// + // Check that source is compatible with dest + + switch (format->compression->family) { + // Forbidden: + case webgl::CompressionFamily::ETC1: + case webgl::CompressionFamily::ATC: + mContext->ErrorInvalidOperation("%s: Format does not allow sub-image" + " updates.", funcName); + return; + + // Block-aligned: + case webgl::CompressionFamily::ES3: // Yes, the ES3 formats don't match the ES3 + case webgl::CompressionFamily::S3TC: // default behavior. + if (!IsSubImageBlockAligned(dstFormat->compression, imageInfo, xOffset, yOffset, + blob->mWidth, blob->mHeight)) + { + mContext->ErrorInvalidOperation("%s: Format requires block-aligned sub-image" + " updates.", + funcName); + return; + } + break; + + // Full-only: (The ES3 default) + default: // PVRTC + if (xOffset || yOffset || + blob->mWidth != imageInfo->mWidth || + blob->mHeight != imageInfo->mHeight) + { + mContext->ErrorInvalidOperation("%s: Format does not allow partial sub-image" + " updates.", + funcName); + return; + } + break; + } + + //////////////////////////////////// + // Do the thing! + + mContext->gl->MakeCurrent(); + + bool uploadWillInitialize; + if (!EnsureImageDataInitializedForUpload(this, funcName, target, level, xOffset, + yOffset, zOffset, blob->mWidth, + blob->mHeight, blob->mDepth, imageInfo, + &uploadWillInitialize)) + { + return; + } + + // Warning: Possibly shared memory. See bug 1225033. + GLenum error = DoCompressedTexSubImage(mContext->gl, target, level, xOffset, yOffset, + zOffset, blob->mWidth, blob->mHeight, + blob->mDepth, sizedUnpackFormat, + blob->mAvailBytes, blob->mPtr); + if (error == LOCAL_GL_OUT_OF_MEMORY) { + mContext->ErrorOutOfMemory("%s: Ran out of memory during upload.", funcName); + return; + } + if (error) { + MOZ_RELEASE_ASSERT(false, "GFX: We should have caught all other errors."); + mContext->GenerateWarning("%s: Unexpected error during texture upload. Context" + " lost.", + funcName); + mContext->ForceLoseContext(); + return; + } + + //////////////////////////////////// + // Update our specification data? + + if (uploadWillInitialize) { + imageInfo->SetIsDataInitialized(true, this); + } +} + +//////////////////////////////////////// +// CopyTex(Sub)Image + +static bool +ValidateCopyTexImageFormats(WebGLContext* webgl, const char* funcName, + const webgl::FormatInfo* srcFormat, + const webgl::FormatInfo* dstFormat) +{ + MOZ_ASSERT(!srcFormat->compression); + if (dstFormat->compression) { + webgl->ErrorInvalidEnum("%s: Specified destination must not have a compressed" + " format.", + funcName); + return false; + } + + if (dstFormat->effectiveFormat == webgl::EffectiveFormat::RGB9_E5) { + webgl->ErrorInvalidOperation("%s: RGB9_E5 is an invalid destination for" + " CopyTex(Sub)Image. (GLES 3.0.4 p145)", + funcName); + return false; + } + + if (!DoChannelsMatchForCopyTexImage(srcFormat, dstFormat)) { + webgl->ErrorInvalidOperation("%s: Destination channels must be compatible with" + " source channels. (GLES 3.0.4 p140 Table 3.16)", + funcName); + return false; + } + + return true; +} + +//////////////////////////////////////////////////////////////////////////////// + +class ScopedCopyTexImageSource +{ + WebGLContext* const mWebGL; + GLuint mRB; + GLuint mFB; + +public: + ScopedCopyTexImageSource(WebGLContext* webgl, const char* funcName, uint32_t srcWidth, + uint32_t srcHeight, const webgl::FormatInfo* srcFormat, + const webgl::FormatUsageInfo* dstUsage); + ~ScopedCopyTexImageSource(); +}; + +ScopedCopyTexImageSource::ScopedCopyTexImageSource(WebGLContext* webgl, + const char* funcName, + uint32_t srcWidth, uint32_t srcHeight, + const webgl::FormatInfo* srcFormat, + const webgl::FormatUsageInfo* dstUsage) + : mWebGL(webgl) + , mRB(0) + , mFB(0) +{ + switch (dstUsage->format->unsizedFormat) { + case webgl::UnsizedFormat::L: + case webgl::UnsizedFormat::A: + case webgl::UnsizedFormat::LA: + webgl->GenerateWarning("%s: Copying to a LUMINANCE, ALPHA, or LUMINANCE_ALPHA" + " is deprecated, and has severely reduced performance" + " on some platforms.", + funcName); + break; + + default: + MOZ_ASSERT(!dstUsage->textureSwizzleRGBA); + return; + } + + if (!dstUsage->textureSwizzleRGBA) + return; + + gl::GLContext* gl = webgl->gl; + + GLenum sizedFormat; + + switch (srcFormat->componentType) { + case webgl::ComponentType::NormUInt: + sizedFormat = LOCAL_GL_RGBA8; + break; + + case webgl::ComponentType::Float: + if (webgl->IsExtensionEnabled(WebGLExtensionID::WEBGL_color_buffer_float)) { + sizedFormat = LOCAL_GL_RGBA32F; + break; + } + + if (webgl->IsExtensionEnabled(WebGLExtensionID::EXT_color_buffer_half_float)) { + sizedFormat = LOCAL_GL_RGBA16F; + break; + } + MOZ_CRASH("GFX: Should be able to request CopyTexImage from Float."); + + default: + MOZ_CRASH("GFX: Should be able to request CopyTexImage from this type."); + } + + gl::ScopedTexture scopedTex(gl); + gl::ScopedBindTexture scopedBindTex(gl, scopedTex.Texture(), LOCAL_GL_TEXTURE_2D); + + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_NEAREST); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_NEAREST); + + GLint blitSwizzle[4] = {LOCAL_GL_ZERO}; + switch (dstUsage->format->unsizedFormat) { + case webgl::UnsizedFormat::L: + blitSwizzle[0] = LOCAL_GL_RED; + break; + + case webgl::UnsizedFormat::A: + blitSwizzle[0] = LOCAL_GL_ALPHA; + break; + + case webgl::UnsizedFormat::LA: + blitSwizzle[0] = LOCAL_GL_RED; + blitSwizzle[1] = LOCAL_GL_ALPHA; + break; + + default: + MOZ_CRASH("GFX: Unhandled unsizedFormat."); + } + + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_R, blitSwizzle[0]); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_G, blitSwizzle[1]); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_B, blitSwizzle[2]); + gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_SWIZZLE_A, blitSwizzle[3]); + + gl->fCopyTexImage2D(LOCAL_GL_TEXTURE_2D, 0, sizedFormat, 0, 0, srcWidth, + srcHeight, 0); + + // Now create the swizzled FB we'll be exposing. + + GLuint rgbaRB = 0; + gl->fGenRenderbuffers(1, &rgbaRB); + gl::ScopedBindRenderbuffer scopedRB(gl, rgbaRB); + gl->fRenderbufferStorage(LOCAL_GL_RENDERBUFFER, sizedFormat, srcWidth, srcHeight); + + GLuint rgbaFB = 0; + gl->fGenFramebuffers(1, &rgbaFB); + gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, rgbaFB); + gl->fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0, + LOCAL_GL_RENDERBUFFER, rgbaRB); + + const GLenum status = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); + if (status != LOCAL_GL_FRAMEBUFFER_COMPLETE) { + MOZ_CRASH("GFX: Temp framebuffer is not complete."); + } + + // Restore RB binding. + scopedRB.Unwrap(); // This function should really have a better name. + + // Draw-blit rgbaTex into rgbaFB. + const gfx::IntSize srcSize(srcWidth, srcHeight); + gl->BlitHelper()->DrawBlitTextureToFramebuffer(scopedTex.Texture(), rgbaFB, + srcSize, srcSize); + + // Restore Tex2D binding and destroy the temp tex. + scopedBindTex.Unwrap(); + scopedTex.Unwrap(); + + // Leave RB and FB alive, and FB bound. + mRB = rgbaRB; + mFB = rgbaFB; +} + +template +static inline GLenum +ToGLHandle(const T& obj) +{ + return (obj ? obj->mGLName : 0); +} + +ScopedCopyTexImageSource::~ScopedCopyTexImageSource() +{ + if (!mFB) { + MOZ_ASSERT(!mRB); + return; + } + MOZ_ASSERT(mRB); + + gl::GLContext* gl = mWebGL->gl; + + // If we're swizzling, it's because we're on a GL core (3.2+) profile, which has + // split framebuffer support. + gl->fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER, + ToGLHandle(mWebGL->mBoundDrawFramebuffer)); + gl->fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER, + ToGLHandle(mWebGL->mBoundReadFramebuffer)); + + gl->fDeleteFramebuffers(1, &mFB); + gl->fDeleteRenderbuffers(1, &mRB); +} + +//////////////////////////////////////////////////////////////////////////////// + +static bool +GetUnsizedFormatForCopy(GLenum internalFormat, webgl::UnsizedFormat* const out) +{ + switch (internalFormat) { + case LOCAL_GL_RED: *out = webgl::UnsizedFormat::R; break; + case LOCAL_GL_RG: *out = webgl::UnsizedFormat::RG; break; + case LOCAL_GL_RGB: *out = webgl::UnsizedFormat::RGB; break; + case LOCAL_GL_RGBA: *out = webgl::UnsizedFormat::RGBA; break; + case LOCAL_GL_LUMINANCE: *out = webgl::UnsizedFormat::L; break; + case LOCAL_GL_ALPHA: *out = webgl::UnsizedFormat::A; break; + case LOCAL_GL_LUMINANCE_ALPHA: *out = webgl::UnsizedFormat::LA; break; + + default: + return false; + } + + return true; +} + +static const webgl::FormatUsageInfo* +ValidateCopyDestUsage(const char* funcName, WebGLContext* webgl, + const webgl::FormatInfo* srcFormat, GLenum internalFormat) +{ + const auto& fua = webgl->mFormatUsage; + + auto dstUsage = fua->GetSizedTexUsage(internalFormat); + if (!dstUsage) { + // Ok, maybe it's unsized. + webgl::UnsizedFormat unsizedFormat; + if (!GetUnsizedFormatForCopy(internalFormat, &unsizedFormat)) { + webgl->ErrorInvalidEnum("%s: Unrecongnized internalFormat 0x%04x.", funcName, + internalFormat); + return nullptr; + } + + const auto dstFormat = srcFormat->GetCopyDecayFormat(unsizedFormat); + if (dstFormat) { + dstUsage = fua->GetUsage(dstFormat->effectiveFormat); + } + if (!dstUsage) { + webgl->ErrorInvalidOperation("%s: 0x%04x is not a valid unsized format for" + " source format %s.", + funcName, internalFormat, srcFormat->name); + return nullptr; + } + + return dstUsage; + } + // Alright, it's sized. + + const auto dstFormat = dstUsage->format; + + if (dstFormat->componentType != srcFormat->componentType) { + webgl->ErrorInvalidOperation("%s: For sized internalFormats, source and dest" + " component types must match. (source: %s, dest:" + " %s)", + funcName, srcFormat->name, dstFormat->name); + return nullptr; + } + + bool componentSizesMatch = true; + if (dstFormat->r) { + componentSizesMatch &= (dstFormat->r == srcFormat->r); + } + if (dstFormat->g) { + componentSizesMatch &= (dstFormat->g == srcFormat->g); + } + if (dstFormat->b) { + componentSizesMatch &= (dstFormat->b == srcFormat->b); + } + if (dstFormat->a) { + componentSizesMatch &= (dstFormat->a == srcFormat->a); + } + + if (!componentSizesMatch) { + webgl->ErrorInvalidOperation("%s: For sized internalFormats, source and dest" + " component sizes must match exactly. (source: %s," + " dest: %s)", + funcName, srcFormat->name, dstFormat->name); + return nullptr; + } + + return dstUsage; +} + +bool +WebGLTexture::ValidateCopyTexImageForFeedback(const char* funcName, uint32_t level, GLint layer) const +{ + const auto& fb = mContext->mBoundReadFramebuffer; + if (fb) { + const auto& attach = fb->ColorReadBuffer(); + MOZ_ASSERT(attach); + + if (attach->Texture() == this && + attach->Layer() == layer && + uint32_t(attach->MipLevel()) == level) + { + // Note that the TexImageTargets *don't* have to match for this to be + // undefined per GLES 3.0.4 p211, thus an INVALID_OP in WebGL. + mContext->ErrorInvalidOperation("%s: Feedback loop detected, as this texture" + " is already attached to READ_FRAMEBUFFER's" + " READ_BUFFER-selected COLOR_ATTACHMENT%u.", + funcName, attach->mAttachmentPoint); + return false; + } + } + return true; +} + +static bool +DoCopyTexOrSubImage(WebGLContext* webgl, const char* funcName, bool isSubImage, + const WebGLTexture* tex, TexImageTarget target, GLint level, + GLint xWithinSrc, GLint yWithinSrc, + uint32_t srcTotalWidth, uint32_t srcTotalHeight, + const webgl::FormatUsageInfo* srcUsage, + GLint xOffset, GLint yOffset, GLint zOffset, + uint32_t dstWidth, uint32_t dstHeight, + const webgl::FormatUsageInfo* dstUsage) +{ + const auto& gl = webgl->gl; + + //// + + int32_t readX, readY; + int32_t writeX, writeY; + int32_t rwWidth, rwHeight; + if (!Intersect(srcTotalWidth, xWithinSrc, dstWidth, &readX, &writeX, &rwWidth) || + !Intersect(srcTotalHeight, yWithinSrc, dstHeight, &readY, &writeY, &rwHeight)) + { + webgl->ErrorOutOfMemory("%s: Bad subrect selection.", funcName); + return false; + } + + writeX += xOffset; + writeY += yOffset; + + //// + + GLenum error = 0; + do { + const auto& idealUnpack = dstUsage->idealUnpack; + if (!isSubImage) { + UniqueBuffer buffer; + + if (uint32_t(rwWidth) != dstWidth || uint32_t(rwHeight) != dstHeight) { + const auto& pi = idealUnpack->ToPacking(); + CheckedUint32 byteCount = BytesPerPixel(pi); + byteCount *= dstWidth; + byteCount *= dstHeight; + + if (byteCount.isValid()) { + buffer = calloc(1, byteCount.value()); + } + + if (!buffer.get()) { + webgl->ErrorOutOfMemory("%s: Ran out of memory allocating zeros.", + funcName); + return false; + } + } + + const ScopedUnpackReset unpackReset(webgl); + gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, 1); + error = DoTexImage(gl, target, level, idealUnpack, dstWidth, dstHeight, 1, + buffer.get()); + if (error) + break; + } + + if (!rwWidth || !rwHeight) { + // There aren't any pixels to copy, so we're 'done'. + return true; + } + + const auto& srcFormat = srcUsage->format; + ScopedCopyTexImageSource maybeSwizzle(webgl, funcName, srcTotalWidth, + srcTotalHeight, srcFormat, dstUsage); + + error = DoCopyTexSubImage(gl, target, level, writeX, writeY, zOffset, readX, + readY, rwWidth, rwHeight); + if (error) + break; + + return true; + } while (false); + + if (error == LOCAL_GL_OUT_OF_MEMORY) { + webgl->ErrorOutOfMemory("%s: Ran out of memory during texture copy.", funcName); + return false; + } + + if (gl->IsANGLE() && error == LOCAL_GL_INVALID_OPERATION) { + webgl->ErrorImplementationBug("%s: ANGLE is particular about CopyTexSubImage" + " formats matching exactly.", + funcName); + return false; + } + + MOZ_RELEASE_ASSERT(false, "GFX: We should have caught all other errors."); + webgl->GenerateWarning("%s: Unexpected error during texture copy. Context lost.", + funcName); + webgl->ForceLoseContext(); + return false; +} + +// There is no CopyTexImage3D. +void +WebGLTexture::CopyTexImage2D(TexImageTarget target, GLint level, GLenum internalFormat, + GLint x, GLint y, GLsizei rawWidth, GLsizei rawHeight, + GLint border) +{ + const char funcName[] = "copyTexImage2D"; + + //////////////////////////////////// + // Get dest info + + uint32_t width, height, depth; + if (!ValidateExtents(mContext, funcName, rawWidth, rawHeight, 1, border, &width, + &height, &depth)) + { + return; + } + + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImageSpecification(funcName, target, level, width, height, depth, + &imageInfo)) + { + return; + } + MOZ_ASSERT(imageInfo); + + //////////////////////////////////// + // Get source info + + const webgl::FormatUsageInfo* srcUsage; + uint32_t srcTotalWidth; + uint32_t srcTotalHeight; + if (!mContext->ValidateCurFBForRead(funcName, &srcUsage, &srcTotalWidth, + &srcTotalHeight)) + { + return; + } + + if (!ValidateCopyTexImageForFeedback(funcName, level)) + return; + + //////////////////////////////////// + // Check that source and dest info are compatible + + const auto& srcFormat = srcUsage->format; + const auto dstUsage = ValidateCopyDestUsage(funcName, mContext, srcFormat, + internalFormat); + if (!dstUsage) + return; + + const auto& dstFormat = dstUsage->format; + if (!ValidateTargetForFormat(funcName, mContext, target, dstFormat)) + return; + + if (!mContext->IsWebGL2() && dstFormat->d) { + mContext->ErrorInvalidOperation("%s: Function may not be called with format %s.", + funcName, dstFormat->name); + return; + } + + if (!ValidateCopyTexImageFormats(mContext, funcName, srcFormat, dstFormat)) + return; + + //////////////////////////////////// + // Do the thing! + + mContext->gl->MakeCurrent(); + mContext->OnBeforeReadCall(); + + const bool isSubImage = false; + if (!DoCopyTexOrSubImage(mContext, funcName, isSubImage, this, target, level, x, y, + srcTotalWidth, srcTotalHeight, srcUsage, 0, 0, 0, width, + height, dstUsage)) + { + return; + } + + //////////////////////////////////// + // Update our specification data. + + const bool isDataInitialized = true; + const ImageInfo newImageInfo(dstUsage, width, height, depth, isDataInitialized); + SetImageInfo(imageInfo, newImageInfo); +} + +void +WebGLTexture::CopyTexSubImage(const char* funcName, TexImageTarget target, GLint level, + GLint xOffset, GLint yOffset, GLint zOffset, GLint x, + GLint y, GLsizei rawWidth, GLsizei rawHeight) +{ + uint32_t width, height, depth; + if (!ValidateExtents(mContext, funcName, rawWidth, rawHeight, 1, 0, &width, + &height, &depth)) + { + return; + } + + //////////////////////////////////// + // Get dest info + + WebGLTexture::ImageInfo* imageInfo; + if (!ValidateTexImageSelection(funcName, target, level, xOffset, yOffset, zOffset, + width, height, depth, &imageInfo)) + { + return; + } + MOZ_ASSERT(imageInfo); + + auto dstUsage = imageInfo->mFormat; + MOZ_ASSERT(dstUsage); + + auto dstFormat = dstUsage->format; + if (!mContext->IsWebGL2() && dstFormat->d) { + mContext->ErrorInvalidOperation("%s: Function may not be called on a texture of" + " format %s.", + funcName, dstFormat->name); + return; + } + + //////////////////////////////////// + // Get source info + + const webgl::FormatUsageInfo* srcUsage; + uint32_t srcTotalWidth; + uint32_t srcTotalHeight; + if (!mContext->ValidateCurFBForRead(funcName, &srcUsage, &srcTotalWidth, + &srcTotalHeight)) + { + return; + } + + if (!ValidateCopyTexImageForFeedback(funcName, level, zOffset)) + return; + + //////////////////////////////////// + // Check that source and dest info are compatible + + auto srcFormat = srcUsage->format; + if (!ValidateCopyTexImageFormats(mContext, funcName, srcFormat, dstFormat)) + return; + + //////////////////////////////////// + // Do the thing! + + mContext->gl->MakeCurrent(); + mContext->OnBeforeReadCall(); + + bool uploadWillInitialize; + if (!EnsureImageDataInitializedForUpload(this, funcName, target, level, xOffset, + yOffset, zOffset, width, height, depth, + imageInfo, &uploadWillInitialize)) + { + return; + } + + const bool isSubImage = true; + if (!DoCopyTexOrSubImage(mContext, funcName, isSubImage, this, target, level, x, y, + srcTotalWidth, srcTotalHeight, srcUsage, xOffset, yOffset, + zOffset, width, height, dstUsage)) + { + return; + } + + //////////////////////////////////// + // Update our specification data? + + if (uploadWillInitialize) { + imageInfo->SetIsDataInitialized(true, this); + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLTransformFeedback.cpp b/dom/canvas/WebGLTransformFeedback.cpp new file mode 100644 index 000000000..feec581ea --- /dev/null +++ b/dom/canvas/WebGLTransformFeedback.cpp @@ -0,0 +1,214 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLTransformFeedback.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "WebGL2Context.h" + +namespace mozilla { + +WebGLTransformFeedback::WebGLTransformFeedback(WebGLContext* webgl, GLuint tf) + : WebGLRefCountedObject(webgl) + , mGLName(tf) + , mIndexedBindings(webgl->mGLMaxTransformFeedbackSeparateAttribs) + , mIsPaused(false) + , mIsActive(false) +{ + mContext->mTransformFeedbacks.insertBack(this); +} + +WebGLTransformFeedback::~WebGLTransformFeedback() +{ + DeleteOnce(); +} + +void +WebGLTransformFeedback::Delete() +{ + if (mGLName) { + mContext->MakeContextCurrent(); + mContext->gl->fDeleteTransformFeedbacks(1, &mGLName); + } + removeFrom(mContext->mTransformFeedbacks); +} + +//////////////////////////////////////// + +void +WebGLTransformFeedback::BeginTransformFeedback(GLenum primMode) +{ + const char funcName[] = "beginTransformFeedback"; + + if (mIsActive) + return mContext->ErrorInvalidOperation("%s: Already active.", funcName); + + switch (primMode) { + case LOCAL_GL_POINTS: + case LOCAL_GL_LINES: + case LOCAL_GL_TRIANGLES: + break; + default: + mContext->ErrorInvalidEnum("%s: `primitiveMode` must be one of POINTS, LINES, or" + " TRIANGLES.", + funcName); + return; + } + + const auto& prog = mContext->mCurrentProgram; + if (!prog || + !prog->IsLinked() || + !prog->LinkInfo()->componentsPerTFVert.size()) + { + mContext->ErrorInvalidOperation("%s: Current program not valid for transform" + " feedback.", + funcName); + return; + } + + const auto& linkInfo = prog->LinkInfo(); + const auto& componentsPerTFVert = linkInfo->componentsPerTFVert; + + size_t minVertCapacity = SIZE_MAX; + for (size_t i = 0; i < componentsPerTFVert.size(); i++) { + const auto& indexedBinding = mIndexedBindings[i]; + const auto& componentsPerVert = componentsPerTFVert[i]; + + const auto& buffer = indexedBinding.mBufferBinding; + if (!buffer) { + mContext->ErrorInvalidOperation("%s: No buffer attached to required transform" + " feedback index %u.", + funcName, (uint32_t)i); + return; + } + + const size_t vertCapacity = buffer->ByteLength() / 4 / componentsPerVert; + minVertCapacity = std::min(minVertCapacity, vertCapacity); + } + + //// + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + gl->fBeginTransformFeedback(primMode); + + //// + + mIsActive = true; + MOZ_ASSERT(!mIsPaused); + + mActive_Program = prog; + mActive_PrimMode = primMode; + mActive_VertPosition = 0; + mActive_VertCapacity = minVertCapacity; + + //// + + mActive_Program->mNumActiveTFOs++; +} + + +void +WebGLTransformFeedback::EndTransformFeedback() +{ + const char funcName[] = "endTransformFeedback"; + + if (!mIsActive) + return mContext->ErrorInvalidOperation("%s: Not active.", funcName); + + //// + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + gl->fEndTransformFeedback(); + + //// + + mIsActive = false; + mIsPaused = false; + + //// + + mActive_Program->mNumActiveTFOs--; +} + +void +WebGLTransformFeedback::PauseTransformFeedback() +{ + const char funcName[] = "pauseTransformFeedback"; + + if (!mIsActive || + mIsPaused) + { + mContext->ErrorInvalidOperation("%s: Not active or is paused.", funcName); + return; + } + + //// + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + gl->fPauseTransformFeedback(); + + //// + + mIsPaused = true; +} + +void +WebGLTransformFeedback::ResumeTransformFeedback() +{ + const char funcName[] = "resumeTransformFeedback"; + + if (!mIsPaused) + return mContext->ErrorInvalidOperation("%s: Not paused.", funcName); + + if (mContext->mCurrentProgram != mActive_Program) { + mContext->ErrorInvalidOperation("%s: Active program differs from original.", + funcName); + return; + } + + //// + + const auto& gl = mContext->gl; + gl->MakeCurrent(); + gl->fResumeTransformFeedback(); + + //// + + MOZ_ASSERT(mIsActive); + mIsPaused = false; +} + +//////////////////////////////////////// + +void +WebGLTransformFeedback::AddBufferBindCounts(int8_t addVal) const +{ + const GLenum target = LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER; + WebGLBuffer::AddBindCount(target, mGenericBufferBinding.get(), addVal); + for (const auto& binding : mIndexedBindings) { + WebGLBuffer::AddBindCount(target, binding.mBufferBinding.get(), addVal); + } +} + +//////////////////////////////////////// + +JSObject* +WebGLTransformFeedback::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLTransformFeedbackBinding::Wrap(cx, this, givenProto); +} + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLTransformFeedback, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLTransformFeedback, Release) +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebGLTransformFeedback, + mGenericBufferBinding, + mIndexedBindings, + mActive_Program) + +} // namespace mozilla diff --git a/dom/canvas/WebGLTransformFeedback.h b/dom/canvas/WebGLTransformFeedback.h new file mode 100644 index 000000000..aa57372a5 --- /dev/null +++ b/dom/canvas/WebGLTransformFeedback.h @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_TRANSFORM_FEEDBACK_H_ +#define WEBGL_TRANSFORM_FEEDBACK_H_ + +#include "mozilla/LinkedList.h" +#include "nsWrapperCache.h" +#include "WebGLObjectModel.h" + +namespace mozilla { + +class WebGLTransformFeedback final + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ + friend class ScopedDrawHelper; + friend class ScopedDrawWithTransformFeedback; + friend class WebGLContext; + friend class WebGL2Context; + friend class WebGLProgram; + +public: + const GLuint mGLName; +private: + // GLES 3.0.4 p267, Table 6.24 "Transform Feedback State" + WebGLRefPtr mGenericBufferBinding; + std::vector mIndexedBindings; + bool mIsPaused; + bool mIsActive; + // Not in state tables: + WebGLRefPtr mActive_Program; + MOZ_INIT_OUTSIDE_CTOR GLenum mActive_PrimMode; + MOZ_INIT_OUTSIDE_CTOR size_t mActive_VertPosition; + MOZ_INIT_OUTSIDE_CTOR size_t mActive_VertCapacity; + +public: + WebGLTransformFeedback(WebGLContext* webgl, GLuint tf); +private: + ~WebGLTransformFeedback(); + +public: + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTransformFeedback) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTransformFeedback) + + void Delete(); + WebGLContext* GetParentObject() const { return mContext; } + virtual JSObject* WrapObject(JSContext*, JS::Handle) override; + + bool IsActiveAndNotPaused() const { return mIsActive && !mIsPaused; } + + void AddBufferBindCounts(int8_t addVal) const; + + // GL Funcs + void BeginTransformFeedback(GLenum primMode); + void EndTransformFeedback(); + void PauseTransformFeedback(); + void ResumeTransformFeedback(); +}; + +} // namespace mozilla + +#endif // WEBGL_TRANSFORM_FEEDBACK_H_ diff --git a/dom/canvas/WebGLTypes.h b/dom/canvas/WebGLTypes.h new file mode 100644 index 000000000..42b8701f3 --- /dev/null +++ b/dom/canvas/WebGLTypes.h @@ -0,0 +1,176 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGLTYPES_H_ +#define WEBGLTYPES_H_ + +// Most WebIDL typedefs are identical to their OpenGL counterparts. +#include "GLTypes.h" + +// Manual reflection of WebIDL typedefs that are different from their +// OpenGL counterparts. +typedef int64_t WebGLsizeiptr; +typedef int64_t WebGLintptr; +typedef bool WebGLboolean; + +namespace mozilla { +namespace gl { +class GLContext; // This is going to be needed a lot. +} // namespace gl + +/* + * WebGLTextureFakeBlackStatus is an enum to track what needs to use a dummy 1x1 black + * texture, which we refer to as a 'fake black' texture. + * + * There are two things that can cause us to use such 'fake black' textures: + * + * (1) OpenGL ES rules on sampling incomplete textures specify that they + * must be sampled as RGBA(0, 0, 0, 1) (opaque black). We have to implement these rules + * ourselves, if only because we do not always run on OpenGL ES, and also + * because this is dangerously close to the kind of case where we don't + * want to trust the driver with corner cases of texture memory accesses. + * + * (2) OpenGL has cases where a renderbuffer, or a texture image, can contain + * uninitialized image data. See below the comment about WebGLImageDataStatus. + * WebGL must never have access to uninitialized image data. The WebGL 1 spec, + * section 4.1 'Resource Restrictions', specifies that in any such case, the + * uninitialized image data must be exposed to WebGL as if it were filled + * with zero bytes, which means it's either opaque or transparent black + * depending on whether the image format has alpha. + */ + +enum class FakeBlackType : uint8_t { + None, + RGBA0001, // Incomplete textures and uninitialized no-alpha color textures. + RGBA0000, // Uninitialized with-alpha color textures. +}; + +/* + * Implementing WebGL (or OpenGL ES 2.0) on top of desktop OpenGL requires + * emulating the vertex attrib 0 array when it's not enabled. Indeed, + * OpenGL ES 2.0 allows drawing without vertex attrib 0 array enabled, but + * desktop OpenGL does not allow that. + */ +enum class WebGLVertexAttrib0Status : uint8_t { + Default, // default status - no emulation needed + EmulatedUninitializedArray, // need an artificial attrib 0 array, but contents may be left uninitialized + EmulatedInitializedArray // need an artificial attrib 0 array, and contents must be initialized +}; + +/* + * Enum to track the status of image data (renderbuffer or texture image) presence + * and initialization. + * + * - NoImageData is the initial state before any image data is allocated. + * - InitializedImageData is the state after image data is allocated and initialized. + * - UninitializedImageData is an intermediate state where data is allocated but not + * initialized. It is the state that renderbuffers are in after a renderbufferStorage call, + * and it is the state that texture images are in after a texImage2D call with null data. + */ +enum class WebGLImageDataStatus : uint8_t { + NoImageData, + UninitializedImageData, + InitializedImageData +}; + +/* + * The formats that may participate, either as source or destination formats, + * in WebGL texture conversions. This includes: + * - all the formats accepted by WebGL.texImage2D, e.g. RGBA4444 + * - additional formats provided by extensions, e.g. RGB32F + * - additional source formats, depending on browser details, used when uploading + * textures from DOM elements. See gfxImageSurface::Format(). + */ +enum class WebGLTexelFormat : uint8_t { + // returned by SurfaceFromElementResultToImageSurface to indicate absence of image data + None, + // common value for formats for which format conversions are not supported + FormatNotSupportingAnyConversion, + // dummy pseudo-format meaning "use the other format". + // For example, if SrcFormat=Auto and DstFormat=RGB8, then the source + // is implicitly treated as being RGB8 itself. + Auto, + // 1-channel formats + A8, + A16F, // OES_texture_half_float + A32F, // OES_texture_float + R8, + R16F, // OES_texture_half_float + R32F, // OES_texture_float + // 2-channel formats + RA8, + RA16F, // OES_texture_half_float + RA32F, // OES_texture_float + RG8, + RG16F, + RG32F, + // 3-channel formats + RGB8, + RGB565, + RGB11F11F10F, + RGB16F, // OES_texture_half_float + RGB32F, // OES_texture_float + // 4-channel formats + RGBA8, + RGBA5551, + RGBA4444, + RGBA16F, // OES_texture_half_float + RGBA32F, // OES_texture_float + // DOM element source only formats. + RGBX8, + BGRX8, + BGRA8 +}; + +enum class WebGLTexImageFunc : uint8_t { + TexImage, + TexSubImage, + CopyTexImage, + CopyTexSubImage, + CompTexImage, + CompTexSubImage, +}; + +enum class WebGLTexDimensions : uint8_t { + Tex2D, + Tex3D +}; + +// Please keep extensions in alphabetic order. +enum class WebGLExtensionID : uint8_t { + ANGLE_instanced_arrays, + EXT_blend_minmax, + EXT_color_buffer_float, + EXT_color_buffer_half_float, + EXT_frag_depth, + EXT_sRGB, + EXT_shader_texture_lod, + EXT_texture_filter_anisotropic, + EXT_disjoint_timer_query, + OES_element_index_uint, + OES_standard_derivatives, + OES_texture_float, + OES_texture_float_linear, + OES_texture_half_float, + OES_texture_half_float_linear, + OES_vertex_array_object, + WEBGL_color_buffer_float, + WEBGL_compressed_texture_atc, + WEBGL_compressed_texture_etc, + WEBGL_compressed_texture_etc1, + WEBGL_compressed_texture_pvrtc, + WEBGL_compressed_texture_s3tc, + WEBGL_debug_renderer_info, + WEBGL_debug_shaders, + WEBGL_depth_texture, + WEBGL_draw_buffers, + WEBGL_lose_context, + Max, + Unknown +}; + +} // namespace mozilla + +#endif diff --git a/dom/canvas/WebGLUniformLocation.cpp b/dom/canvas/WebGLUniformLocation.cpp new file mode 100644 index 000000000..ccd6685b0 --- /dev/null +++ b/dom/canvas/WebGLUniformLocation.cpp @@ -0,0 +1,318 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLUniformLocation.h" + +#include "GLContext.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLActiveInfo.h" +#include "WebGLContext.h" +#include "WebGLProgram.h" + +namespace mozilla { + +WebGLUniformLocation::WebGLUniformLocation(WebGLContext* webgl, + const webgl::LinkedProgramInfo* linkInfo, + webgl::UniformInfo* info, GLuint loc, + size_t arrayIndex) + : WebGLContextBoundObject(webgl) + , mLinkInfo(linkInfo) + , mInfo(info) + , mLoc(loc) + , mArrayIndex(arrayIndex) +{ } + +WebGLUniformLocation::~WebGLUniformLocation() +{ } + +bool +WebGLUniformLocation::ValidateForProgram(const WebGLProgram* prog, + const char* funcName) const +{ + // Check the weak-pointer. + if (!mLinkInfo) { + mContext->ErrorInvalidOperation("%s: This uniform location is obsolete because" + " its program has been successfully relinked.", + funcName); + return false; + } + + if (mLinkInfo->prog != prog) { + mContext->ErrorInvalidOperation("%s: This uniform location corresponds to a" + " different program.", funcName); + return false; + } + + return true; +} + +static bool +IsUniformSetterTypeValid(GLenum setterType, GLenum uniformType) +{ + // The order in this switch matches table 2.10 from OpenGL ES + // 3.0.4 (Aug 27, 2014) es_spec_3.0.4.pdf + switch (uniformType) { + case LOCAL_GL_FLOAT: + case LOCAL_GL_FLOAT_VEC2: + case LOCAL_GL_FLOAT_VEC3: + case LOCAL_GL_FLOAT_VEC4: + return setterType == LOCAL_GL_FLOAT; + + case LOCAL_GL_INT: + case LOCAL_GL_INT_VEC2: + case LOCAL_GL_INT_VEC3: + case LOCAL_GL_INT_VEC4: + return setterType == LOCAL_GL_INT; + + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_UNSIGNED_INT_VEC2: + case LOCAL_GL_UNSIGNED_INT_VEC3: + case LOCAL_GL_UNSIGNED_INT_VEC4: + return setterType == LOCAL_GL_UNSIGNED_INT; + + /* bool can be set via any function: 0, 0.0f -> FALSE, _ -> TRUE */ + case LOCAL_GL_BOOL: + case LOCAL_GL_BOOL_VEC2: + case LOCAL_GL_BOOL_VEC3: + case LOCAL_GL_BOOL_VEC4: + return (setterType == LOCAL_GL_INT || + setterType == LOCAL_GL_FLOAT || + setterType == LOCAL_GL_UNSIGNED_INT); + + case LOCAL_GL_FLOAT_MAT2: + case LOCAL_GL_FLOAT_MAT3: + case LOCAL_GL_FLOAT_MAT4: + case LOCAL_GL_FLOAT_MAT2x3: + case LOCAL_GL_FLOAT_MAT2x4: + case LOCAL_GL_FLOAT_MAT3x2: + case LOCAL_GL_FLOAT_MAT3x4: + case LOCAL_GL_FLOAT_MAT4x2: + case LOCAL_GL_FLOAT_MAT4x3: + return setterType == LOCAL_GL_FLOAT; + + /* Samplers can only be set via Uniform1i */ + case LOCAL_GL_SAMPLER_2D: + case LOCAL_GL_SAMPLER_3D: + case LOCAL_GL_SAMPLER_CUBE: + case LOCAL_GL_SAMPLER_2D_SHADOW: + case LOCAL_GL_SAMPLER_2D_ARRAY: + case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW: + case LOCAL_GL_SAMPLER_CUBE_SHADOW: + + case LOCAL_GL_INT_SAMPLER_2D: + case LOCAL_GL_INT_SAMPLER_3D: + case LOCAL_GL_INT_SAMPLER_CUBE: + case LOCAL_GL_INT_SAMPLER_2D_ARRAY: + + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: + return setterType == LOCAL_GL_INT; + + default: + MOZ_CRASH("GFX: Bad `uniformType`."); + } +} + +bool +WebGLUniformLocation::ValidateSizeAndType(uint8_t setterElemSize, GLenum setterType, + const char* funcName) const +{ + MOZ_ASSERT(mLinkInfo); + + const auto& uniformElemSize = mInfo->mActiveInfo->mElemSize; + if (setterElemSize != uniformElemSize) { + mContext->ErrorInvalidOperation("%s: Function used differs from uniform size: %i", + funcName, uniformElemSize); + return false; + } + + const auto& uniformElemType = mInfo->mActiveInfo->mElemType; + if (!IsUniformSetterTypeValid(setterType, uniformElemType)) { + mContext->ErrorInvalidOperation("%s: Function used is incompatible with uniform" + " type: %i", + funcName, uniformElemType); + return false; + } + + return true; +} + +bool +WebGLUniformLocation::ValidateArrayLength(uint8_t setterElemSize, size_t setterArraySize, + const char* funcName) const +{ + MOZ_ASSERT(mLinkInfo); + + if (setterArraySize == 0 || + setterArraySize % setterElemSize) + { + mContext->ErrorInvalidValue("%s: Expected an array of length a multiple of %d," + " got an array of length %d.", + funcName, setterElemSize, setterArraySize); + return false; + } + + /* GLES 2.0.25, Section 2.10, p38 + * When loading `N` elements starting at an arbitrary position `k` in a uniform + * declared as an array, elements `k` through `k + N - 1` in the array will be + * replaced with the new values. Values for any array element that exceeds the + * highest array element index used, as reported by `GetActiveUniform`, will be + * ignored by GL. + */ + if (!mInfo->mActiveInfo->mIsArray && + setterArraySize != setterElemSize) + { + mContext->ErrorInvalidOperation("%s: Expected an array of length exactly %d" + " (since this uniform is not an array uniform)," + " got an array of length %d.", + funcName, setterElemSize, setterArraySize); + return false; + } + + return true; +} + +JS::Value +WebGLUniformLocation::GetUniform(JSContext* js) const +{ + MOZ_ASSERT(mLinkInfo); + + const uint8_t elemSize = mInfo->mActiveInfo->mElemSize; + static const uint8_t kMaxElemSize = 16; + MOZ_ASSERT(elemSize <= kMaxElemSize); + + GLuint prog = mLinkInfo->prog->mGLName; + + gl::GLContext* gl = mContext->GL(); + gl->MakeCurrent(); + + switch (mInfo->mActiveInfo->mElemType) { + case LOCAL_GL_INT: + case LOCAL_GL_INT_VEC2: + case LOCAL_GL_INT_VEC3: + case LOCAL_GL_INT_VEC4: + case LOCAL_GL_SAMPLER_2D: + case LOCAL_GL_SAMPLER_3D: + case LOCAL_GL_SAMPLER_CUBE: + case LOCAL_GL_SAMPLER_2D_SHADOW: + case LOCAL_GL_SAMPLER_2D_ARRAY: + case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW: + case LOCAL_GL_SAMPLER_CUBE_SHADOW: + case LOCAL_GL_INT_SAMPLER_2D: + case LOCAL_GL_INT_SAMPLER_3D: + case LOCAL_GL_INT_SAMPLER_CUBE: + case LOCAL_GL_INT_SAMPLER_2D_ARRAY: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE: + case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: + { + GLint buffer[kMaxElemSize] = {0}; + gl->fGetUniformiv(prog, mLoc, buffer); + + if (elemSize == 1) + return JS::Int32Value(buffer[0]); + + JSObject* obj = dom::Int32Array::Create(js, mContext, elemSize, buffer); + if (!obj) { + mContext->ErrorOutOfMemory("getUniform: Out of memory."); + return JS::NullValue(); + } + return JS::ObjectOrNullValue(obj); + } + + case LOCAL_GL_BOOL: + case LOCAL_GL_BOOL_VEC2: + case LOCAL_GL_BOOL_VEC3: + case LOCAL_GL_BOOL_VEC4: + { + GLint buffer[kMaxElemSize] = {0}; + gl->fGetUniformiv(prog, mLoc, buffer); + + if (elemSize == 1) + return JS::BooleanValue(buffer[0]); + + bool boolBuffer[kMaxElemSize]; + for (uint8_t i = 0; i < kMaxElemSize; i++) + boolBuffer[i] = buffer[i]; + + JS::RootedValue val(js); + // Be careful: we don't want to convert all of |uv|! + if (!dom::ToJSValue(js, boolBuffer, elemSize, &val)) { + mContext->ErrorOutOfMemory("getUniform: Out of memory."); + return JS::NullValue(); + } + return val; + } + + case LOCAL_GL_FLOAT: + case LOCAL_GL_FLOAT_VEC2: + case LOCAL_GL_FLOAT_VEC3: + case LOCAL_GL_FLOAT_VEC4: + case LOCAL_GL_FLOAT_MAT2: + case LOCAL_GL_FLOAT_MAT3: + case LOCAL_GL_FLOAT_MAT4: + case LOCAL_GL_FLOAT_MAT2x3: + case LOCAL_GL_FLOAT_MAT2x4: + case LOCAL_GL_FLOAT_MAT3x2: + case LOCAL_GL_FLOAT_MAT3x4: + case LOCAL_GL_FLOAT_MAT4x2: + case LOCAL_GL_FLOAT_MAT4x3: + { + GLfloat buffer[16] = {0.0f}; + gl->fGetUniformfv(prog, mLoc, buffer); + + if (elemSize == 1) + return JS::DoubleValue(buffer[0]); + + JSObject* obj = dom::Float32Array::Create(js, mContext, elemSize, buffer); + if (!obj) { + mContext->ErrorOutOfMemory("getUniform: Out of memory."); + return JS::NullValue(); + } + return JS::ObjectOrNullValue(obj); + } + + case LOCAL_GL_UNSIGNED_INT: + case LOCAL_GL_UNSIGNED_INT_VEC2: + case LOCAL_GL_UNSIGNED_INT_VEC3: + case LOCAL_GL_UNSIGNED_INT_VEC4: + { + GLuint buffer[kMaxElemSize] = {0}; + gl->fGetUniformuiv(prog, mLoc, buffer); + + if (elemSize == 1) + return JS::DoubleValue(buffer[0]); // This is Double because only Int32 is special cased. + + JSObject* obj = dom::Uint32Array::Create(js, mContext, elemSize, buffer); + if (!obj) { + mContext->ErrorOutOfMemory("getUniform: Out of memory."); + return JS::NullValue(); + } + return JS::ObjectOrNullValue(obj); + } + + default: + MOZ_CRASH("GFX: Invalid elemType."); + } +} + +//////////////////////////////////////////////////////////////////////////////// + +JSObject* +WebGLUniformLocation::WrapObject(JSContext* js, JS::Handle givenProto) +{ + return dom::WebGLUniformLocationBinding::Wrap(js, this, givenProto); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLUniformLocation) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLUniformLocation, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLUniformLocation, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLUniformLocation.h b/dom/canvas/WebGLUniformLocation.h new file mode 100644 index 000000000..f9710efe1 --- /dev/null +++ b/dom/canvas/WebGLUniformLocation.h @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_UNIFORM_LOCATION_H_ +#define WEBGL_UNIFORM_LOCATION_H_ + +#include "GLDefs.h" +#include "mozilla/WeakPtr.h" +#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS +#include "nsISupportsImpl.h" // NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING +#include "nsWrapperCache.h" + +#include "WebGLObjectModel.h" + +struct JSContext; + +namespace mozilla { +class WebGLActiveInfo; +class WebGLContext; +class WebGLProgram; + +namespace webgl { +struct LinkedProgramInfo; +struct UniformInfo; +} // namespace webgl + +class WebGLUniformLocation final + : public nsWrapperCache + , public WebGLContextBoundObject +{ +public: + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLUniformLocation) + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLUniformLocation) + + virtual JSObject* WrapObject(JSContext* js, JS::Handle givenProto) override; + + WebGLContext* GetParentObject() const { + return mContext; + } + + ////// + + const WeakPtr mLinkInfo; + webgl::UniformInfo* const mInfo; + const GLuint mLoc; + const size_t mArrayIndex; + + ////// + + WebGLUniformLocation(WebGLContext* webgl, const webgl::LinkedProgramInfo* linkInfo, + webgl::UniformInfo* info, GLuint loc, size_t arrayIndex); + + bool ValidateForProgram(const WebGLProgram* prog, const char* funcName) const; + bool ValidateSizeAndType(uint8_t setterElemSize, GLenum setterType, + const char* funcName) const; + bool ValidateArrayLength(uint8_t setterElemSize, size_t setterArraySize, + const char* funcName) const; + + JS::Value GetUniform(JSContext* js) const; + + // Needed for certain helper functions like ValidateObject. + // `WebGLUniformLocation`s can't be 'Deleted' in the WebGL sense. + bool IsDeleted() const { return false; } + +protected: + ~WebGLUniformLocation(); +}; + +} // namespace mozilla + +#endif // WEBGL_UNIFORM_LOCATION_H_ diff --git a/dom/canvas/WebGLValidateStrings.cpp b/dom/canvas/WebGLValidateStrings.cpp new file mode 100644 index 000000000..9df3fef70 --- /dev/null +++ b/dom/canvas/WebGLValidateStrings.cpp @@ -0,0 +1,169 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLValidateStrings.h" + +#include "nsString.h" +#include "WebGLContext.h" + +namespace mozilla { +// The following code was taken from the WebKit WebGL implementation, +// which can be found here: +// http://trac.webkit.org/browser/trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp?rev=93625#L121 +// Note that some modifications were done to adapt it to Mozilla. +/****** BEGIN CODE TAKEN FROM WEBKIT ******/ +bool IsValidGLSLCharacter(char16_t c) +{ + // Printing characters are valid except " $ ` @ \ ' DEL. + if (c >= 32 && c <= 126 && + c != '"' && c != '$' && c != '`' && c != '@' && c != '\\' && c != '\'') + { + return true; + } + + // Horizontal tab, line feed, vertical tab, form feed, carriage return + // are also valid. + if (c >= 9 && c <= 13) { + return true; + } + + return false; +} + +void StripComments::process(char16_t c) +{ + if (isNewline(c)) { + // No matter what state we are in, pass through newlines + // so we preserve line numbers. + emit(c); + + if (m_parseState != InMultiLineComment) + m_parseState = BeginningOfLine; + + return; + } + + char16_t temp = 0; + switch (m_parseState) { + case BeginningOfLine: + // If it's an ASCII space. + if (c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9))) { + emit(c); + break; + } + + if (c == '#') { + m_parseState = InPreprocessorDirective; + emit(c); + break; + } + + // Transition to normal state and re-handle character. + m_parseState = MiddleOfLine; + process(c); + break; + + case MiddleOfLine: + if (c == '/' && peek(temp)) { + if (temp == '/') { + m_parseState = InSingleLineComment; + emit(' '); + advance(); + break; + } + + if (temp == '*') { + m_parseState = InMultiLineComment; + // Emit the comment start in case the user has + // an unclosed comment and we want to later + // signal an error. + emit('/'); + emit('*'); + advance(); + break; + } + } + + emit(c); + break; + + case InPreprocessorDirective: + // No matter what the character is, just pass it + // through. Do not parse comments in this state. This + // might not be the right thing to do long term, but it + // should handle the #error preprocessor directive. + emit(c); + break; + + case InSingleLineComment: + // The newline code at the top of this function takes care + // of resetting our state when we get out of the + // single-line comment. Swallow all other characters. + break; + + case InMultiLineComment: + if (c == '*' && peek(temp) && temp == '/') { + emit('*'); + emit('/'); + m_parseState = MiddleOfLine; + advance(); + break; + } + + // Swallow all other characters. Unclear whether we may + // want or need to just emit a space per character to try + // to preserve column numbers for debugging purposes. + break; + } +} + +/****** END CODE TAKEN FROM WEBKIT ******/ + +bool +ValidateGLSLString(const nsAString& string, WebGLContext* webgl, const char* funcName) +{ + for (size_t i = 0; i < string.Length(); ++i) { + if (!IsValidGLSLCharacter(string.CharAt(i))) { + webgl->ErrorInvalidValue("%s: String contains the illegal character '%d'", + funcName, string.CharAt(i)); + return false; + } + } + + return true; +} + +bool +ValidateGLSLVariableName(const nsAString& name, WebGLContext* webgl, const char* funcName) +{ + if (name.IsEmpty()) + return false; + + const uint32_t maxSize = webgl->IsWebGL2() ? 1024 : 256; + if (name.Length() > maxSize) { + webgl->ErrorInvalidValue("%s: Identifier is %d characters long, exceeds the" + " maximum allowed length of %d characters.", + funcName, name.Length(), maxSize); + return false; + } + + if (!ValidateGLSLString(name, webgl, funcName)) + return false; + + nsString prefix1 = NS_LITERAL_STRING("webgl_"); + nsString prefix2 = NS_LITERAL_STRING("_webgl_"); + + if (Substring(name, 0, prefix1.Length()).Equals(prefix1) || + Substring(name, 0, prefix2.Length()).Equals(prefix2)) + { + webgl->ErrorInvalidOperation("%s: String contains a reserved GLSL prefix.", + funcName); + return false; + } + + return true; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLValidateStrings.h b/dom/canvas/WebGLValidateStrings.h new file mode 100644 index 000000000..3305fc1b9 --- /dev/null +++ b/dom/canvas/WebGLValidateStrings.h @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2011 Mozilla Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WEBGL_VALIDATE_STRINGS_H_ +#define WEBGL_VALIDATE_STRINGS_H_ + +#include "nsString.h" +#include "nsTArray.h" + +namespace mozilla { + +class WebGLContext; + +// The following code was taken from the WebKit WebGL implementation, +// which can be found here: +// http://trac.webkit.org/browser/trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp?rev=93625#L121 +// Note that some modifications were done to adapt it to Mozilla. +/****** BEGIN CODE TAKEN FROM WEBKIT ******/ +// Strips comments from shader text. This allows non-ASCII characters +// to be used in comments without potentially breaking OpenGL +// implementations not expecting characters outside the GLSL ES set. +class StripComments { +public: + explicit StripComments(const nsAString& str) + : m_parseState(BeginningOfLine) + , m_end(str.EndReading()) + , m_current(str.BeginReading()) + , m_position(0) + { + m_result.SetLength(str.Length()); + parse(); + } + + const nsTArray& result() + { + return m_result; + } + + size_t length() + { + return m_position; + } + +private: + bool hasMoreCharacters() + { + return (m_current < m_end); + } + + void parse() + { + while (hasMoreCharacters()) { + process(current()); + // process() might advance the position. + if (hasMoreCharacters()) + advance(); + } + } + + void process(char16_t); + + bool peek(char16_t& character) + { + if (m_current + 1 >= m_end) + return false; + character = *(m_current + 1); + return true; + } + + char16_t current() + { + //ASSERT(m_position < m_length); + return *m_current; + } + + void advance() + { + ++m_current; + } + + bool isNewline(char16_t character) + { + // Don't attempt to canonicalize newline related characters. + return (character == '\n' || character == '\r'); + } + + void emit(char16_t character) + { + m_result[m_position++] = character; + } + + enum ParseState { + // Have not seen an ASCII non-whitespace character yet on + // this line. Possible that we might see a preprocessor + // directive. + BeginningOfLine, + + // Have seen at least one ASCII non-whitespace character + // on this line. + MiddleOfLine, + + // Handling a preprocessor directive. Passes through all + // characters up to the end of the line. Disables comment + // processing. + InPreprocessorDirective, + + // Handling a single-line comment. The comment text is + // replaced with a single space. + InSingleLineComment, + + // Handling a multi-line comment. Newlines are passed + // through to preserve line numbers. + InMultiLineComment + }; + + ParseState m_parseState; + const char16_t* m_end; + const char16_t* m_current; + size_t m_position; + nsTArray m_result; +}; + +/****** END CODE TAKEN FROM WEBKIT ******/ + +bool ValidateGLSLString(const nsAString& string, WebGLContext* webgl, + const char* funcName); + +bool ValidateGLSLVariableName(const nsAString& name, WebGLContext* webgl, + const char* funcName); + +} // namespace mozilla + +#endif // WEBGL_VALIDATE_STRINGS_H_ diff --git a/dom/canvas/WebGLVertexArray.cpp b/dom/canvas/WebGLVertexArray.cpp new file mode 100644 index 000000000..e0c30ab51 --- /dev/null +++ b/dom/canvas/WebGLVertexArray.cpp @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLVertexArray.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGLRenderingContextBinding.h" +#include "WebGLBuffer.h" +#include "WebGLContext.h" +#include "WebGLVertexArrayGL.h" +#include "WebGLVertexArrayFake.h" + +namespace mozilla { + +JSObject* +WebGLVertexArray::WrapObject(JSContext* cx, JS::Handle givenProto) +{ + return dom::WebGLVertexArrayObjectBinding::Wrap(cx, this, givenProto); +} + +WebGLVertexArray::WebGLVertexArray(WebGLContext* webgl) + : WebGLRefCountedObject(webgl) + , mGLName(0) +{ + mAttribs.SetLength(mContext->mGLMaxVertexAttribs); + mContext->mVertexArrays.insertBack(this); +} + +WebGLVertexArray::~WebGLVertexArray() +{ + MOZ_ASSERT(IsDeleted()); +} + +void +WebGLVertexArray::AddBufferBindCounts(int8_t addVal) const +{ + const GLenum target = 0; // Anything non-TF is fine. + WebGLBuffer::AddBindCount(target, mElementArrayBuffer.get(), addVal); + for (const auto& attrib : mAttribs) { + WebGLBuffer::AddBindCount(target, attrib.mBuf.get(), addVal); + } +} + +WebGLVertexArray* +WebGLVertexArray::Create(WebGLContext* webgl) +{ + WebGLVertexArray* array; + if (webgl->gl->IsSupported(gl::GLFeature::vertex_array_object)) { + array = new WebGLVertexArrayGL(webgl); + } else { + array = new WebGLVertexArrayFake(webgl); + } + return array; +} + +void +WebGLVertexArray::Delete() +{ + DeleteImpl(); + + LinkedListElement::removeFrom(mContext->mVertexArrays); + mElementArrayBuffer = nullptr; + mAttribs.Clear(); +} + +bool +WebGLVertexArray::IsVertexArray() const +{ + return IsVertexArrayImpl(); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebGLVertexArray, + mAttribs, + mElementArrayBuffer) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLVertexArray, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLVertexArray, Release) + +} // namespace mozilla diff --git a/dom/canvas/WebGLVertexArray.h b/dom/canvas/WebGLVertexArray.h new file mode 100644 index 000000000..74f714af1 --- /dev/null +++ b/dom/canvas/WebGLVertexArray.h @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_VERTEX_ARRAY_H_ +#define WEBGL_VERTEX_ARRAY_H_ + +#include "nsTArray.h" +#include "mozilla/LinkedList.h" +#include "nsWrapperCache.h" + +#include "WebGLObjectModel.h" +#include "WebGLStrongTypes.h" +#include "WebGLVertexAttribData.h" + +namespace mozilla { + +class WebGLVertexArrayFake; + +class WebGLVertexArray + : public nsWrapperCache + , public WebGLRefCountedObject + , public LinkedListElement +{ +public: + static WebGLVertexArray* Create(WebGLContext* webgl); + + void BindVertexArray() { + // Bind to dummy value to signal that this vertex array has ever been + // bound. + BindVertexArrayImpl(); + }; + + // Implement parent classes: + void Delete(); + bool IsVertexArray() const; + + WebGLContext* GetParentObject() const { + return mContext; + } + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLVertexArray) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLVertexArray) + + GLuint GLName() const { return mGLName; } + + void AddBufferBindCounts(int8_t addVal) const; + +protected: + explicit WebGLVertexArray(WebGLContext* webgl); + virtual ~WebGLVertexArray(); + + virtual void GenVertexArray() = 0; + virtual void BindVertexArrayImpl() = 0; + virtual void DeleteImpl() = 0; + virtual bool IsVertexArrayImpl() const = 0; + + GLuint mGLName; + nsTArray mAttribs; + WebGLRefPtr mElementArrayBuffer; + + friend class ScopedDrawHelper; + friend class WebGLContext; + friend class WebGLVertexArrayFake; + friend class WebGL2Context; +}; + +} // namespace mozilla + +#endif // WEBGL_VERTEX_ARRAY_H_ diff --git a/dom/canvas/WebGLVertexArrayFake.cpp b/dom/canvas/WebGLVertexArrayFake.cpp new file mode 100644 index 000000000..ee9df6dac --- /dev/null +++ b/dom/canvas/WebGLVertexArrayFake.cpp @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLVertexArrayFake.h" + +#include "GLContext.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLVertexArrayFake::WebGLVertexArrayFake(WebGLContext* webgl) + : WebGLVertexArray(webgl) + , mIsVAO(false) +{ } + +void +WebGLVertexArrayFake::BindVertexArrayImpl() +{ + // Go through and re-bind all buffers and setup all + // vertex attribute pointers + gl::GLContext* gl = mContext->gl; + + WebGLRefPtr prevVertexArray = mContext->mBoundVertexArray; + + mContext->mBoundVertexArray = this; + + WebGLRefPtr prevBuffer = mContext->mBoundArrayBuffer; + mContext->BindBuffer(LOCAL_GL_ELEMENT_ARRAY_BUFFER, mElementArrayBuffer); + + size_t i = 0; + for (const auto& vd : mAttribs) { + mContext->BindBuffer(LOCAL_GL_ARRAY_BUFFER, vd.mBuf); + vd.DoVertexAttribPointer(gl, i); + + if (vd.mEnabled) { + gl->fEnableVertexAttribArray(i); + } else { + gl->fDisableVertexAttribArray(i); + } + ++i; + } + + size_t len = prevVertexArray->mAttribs.Length(); + for (; i < len; ++i) { + const auto& vd = prevVertexArray->mAttribs[i]; + + if (vd.mEnabled) { + gl->fDisableVertexAttribArray(i); + } + } + + mContext->BindBuffer(LOCAL_GL_ARRAY_BUFFER, prevBuffer); + mIsVAO = true; +} + +void +WebGLVertexArrayFake::DeleteImpl() +{ + mIsVAO = false; +} + +bool +WebGLVertexArrayFake::IsVertexArrayImpl() const +{ + return mIsVAO; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLVertexArrayFake.h b/dom/canvas/WebGLVertexArrayFake.h new file mode 100644 index 000000000..b7dc569e1 --- /dev/null +++ b/dom/canvas/WebGLVertexArrayFake.h @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_VERTEX_ARRAY_FAKE_H_ +#define WEBGL_VERTEX_ARRAY_FAKE_H_ + +#include "WebGLVertexArray.h" + +namespace mozilla { + +class WebGLVertexArrayFake final + : public WebGLVertexArray +{ + friend class WebGLVertexArray; + +protected: + virtual void BindVertexArrayImpl() override; + virtual void DeleteImpl() override; + virtual void GenVertexArray() override {}; + virtual bool IsVertexArrayImpl() const override; + +private: + explicit WebGLVertexArrayFake(WebGLContext* webgl); + + ~WebGLVertexArrayFake() { + DeleteOnce(); + } + + bool mIsVAO; +}; + +} // namespace mozilla + +#endif // WEBGL_VERTEX_ARRAY_FAKE_H_ diff --git a/dom/canvas/WebGLVertexArrayGL.cpp b/dom/canvas/WebGLVertexArrayGL.cpp new file mode 100644 index 000000000..aa7313150 --- /dev/null +++ b/dom/canvas/WebGLVertexArrayGL.cpp @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLVertexArrayGL.h" + +#include "GLContext.h" +#include "WebGLContext.h" + +namespace mozilla { + +WebGLVertexArrayGL::WebGLVertexArrayGL(WebGLContext* webgl) + : WebGLVertexArray(webgl) + , mIsVAO(false) +{ } + +WebGLVertexArrayGL::~WebGLVertexArrayGL() +{ + DeleteOnce(); +} + +void +WebGLVertexArrayGL::DeleteImpl() +{ + mElementArrayBuffer = nullptr; + + mContext->MakeContextCurrent(); + mContext->gl->fDeleteVertexArrays(1, &mGLName); + + mIsVAO = false; +} + +void +WebGLVertexArrayGL::BindVertexArrayImpl() +{ + mContext->mBoundVertexArray = this; + mContext->gl->fBindVertexArray(mGLName); + + mIsVAO = true; +} + +void +WebGLVertexArrayGL::GenVertexArray() +{ + mContext->gl->fGenVertexArrays(1, &mGLName); +} + +bool +WebGLVertexArrayGL::IsVertexArrayImpl() const +{ + gl::GLContext* gl = mContext->gl; + if (gl->WorkAroundDriverBugs()) + { + return mIsVAO; + } + + mContext->MakeContextCurrent(); + return mContext->gl->fIsVertexArray(mGLName) != 0; +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLVertexArrayGL.h b/dom/canvas/WebGLVertexArrayGL.h new file mode 100644 index 000000000..8ab172470 --- /dev/null +++ b/dom/canvas/WebGLVertexArrayGL.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_VERTEX_ARRAY_GL_H_ +#define WEBGL_VERTEX_ARRAY_GL_H_ + +#include "WebGLVertexArray.h" + +namespace mozilla { + +class WebGLVertexArrayGL + : public WebGLVertexArray +{ + friend class WebGLVertexArray; + +public: + virtual void DeleteImpl() override; + virtual void BindVertexArrayImpl() override; + virtual void GenVertexArray() override; + virtual bool IsVertexArrayImpl() const override; + +protected: + explicit WebGLVertexArrayGL(WebGLContext* webgl); + ~WebGLVertexArrayGL(); + + // Bug 1140459: Some drivers (including our test slaves!) don't + // give reasonable answers for IsVertexArray, maybe others. + // + // So we track the `is a VAO` state ourselves. + bool mIsVAO; +}; + +} // namespace mozilla + +#endif // WEBGL_VERTEX_ARRAY_GL_H_ diff --git a/dom/canvas/WebGLVertexArrayObject.cpp b/dom/canvas/WebGLVertexArrayObject.cpp new file mode 100644 index 000000000..5d43fcb6c --- /dev/null +++ b/dom/canvas/WebGLVertexArrayObject.cpp @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLVertexArrayObject.h" + +#include "GLContext.h" +#include "mozilla/dom/WebGL2RenderingContextBinding.h" +#include "WebGLContext.h" + +namespace mozilla { +namespace dom { + +WebGLVertexArray* +WebGLVertexArrayObject::Create(WebGLContext* webgl) +{ + // WebGL 2: This is core in GL ES 3. If support is missing something + // is very wrong. + bool vaoSupport = webgl->GL()->IsSupported(gl::GLFeature::vertex_array_object); + MOZ_RELEASE_ASSERT(vaoSupport, "GFX: Vertex Array Objects aren't supported."); + if (vaoSupport) + return new WebGLVertexArrayObject(webgl); + + return nullptr; +} + +JSObject* +WebGLVertexArrayObject::WrapObject(JSContext* cx, + JS::Handle givenProto) +{ + return dom::WebGLVertexArrayObjectBinding::Wrap(cx, this, givenProto); +} + +} // namespace dom +} // namespace mozilla diff --git a/dom/canvas/WebGLVertexArrayObject.h b/dom/canvas/WebGLVertexArrayObject.h new file mode 100644 index 000000000..a58bff9eb --- /dev/null +++ b/dom/canvas/WebGLVertexArrayObject.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef mozilla_dom_WebGLVertexArrayObject_h +#define mozilla_dom_WebGLVertexArrayObject_h + +#include "WebGLVertexArrayGL.h" + +namespace mozilla { +namespace dom { + +/** + * This class implements the DOM bindings for WebGL 2 VAO. + * + * This exists to so the object returned from gl.createVertexArray() + * is an instance of WebGLVertexArrayObject (to match the WebGL 2 + * spec.) + */ +class WebGLVertexArrayObject final + : public WebGLVertexArrayGL +{ +public: + static WebGLVertexArray* Create(WebGLContext* webgl); + + virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override; + +private: + explicit WebGLVertexArrayObject(WebGLContext* webgl) + : WebGLVertexArrayGL(webgl) + { } + + ~WebGLVertexArrayObject() { + DeleteOnce(); + } +}; + +} // namespace dom +} // namespace mozilla + +#endif // !mozilla_dom_WebGLVertexArrayObject_h diff --git a/dom/canvas/WebGLVertexAttribData.cpp b/dom/canvas/WebGLVertexAttribData.cpp new file mode 100644 index 000000000..b5aee18e5 --- /dev/null +++ b/dom/canvas/WebGLVertexAttribData.cpp @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "WebGLVertexAttribData.h" + +#include "GLContext.h" +#include "WebGLBuffer.h" + +namespace mozilla { + +static uint8_t +CalcBytesPerVertex(GLenum type, uint8_t size) +{ + uint8_t bytesPerType; + switch (type) { + case LOCAL_GL_INT_2_10_10_10_REV: + case LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV: + return 4; + + case LOCAL_GL_BYTE: + case LOCAL_GL_UNSIGNED_BYTE: + bytesPerType = 1; + break; + + case LOCAL_GL_HALF_FLOAT: + case LOCAL_GL_SHORT: + case LOCAL_GL_UNSIGNED_SHORT: + bytesPerType = 2; + break; + + case LOCAL_GL_FIXED: // GLES 3.0.4 p9: 32-bit signed, with 16 fractional bits. + case LOCAL_GL_FLOAT: + case LOCAL_GL_INT: + case LOCAL_GL_UNSIGNED_INT: + bytesPerType = 4; + break; + + default: + MOZ_CRASH("Bad `type`."); + } + + return bytesPerType * size; +} + +static GLenum +AttribPointerBaseType(bool integerFunc, GLenum type) +{ + if (!integerFunc) + return LOCAL_GL_FLOAT; + + switch (type) { + case LOCAL_GL_BYTE: + case LOCAL_GL_SHORT: + case LOCAL_GL_INT: + return LOCAL_GL_INT; + + case LOCAL_GL_UNSIGNED_BYTE: + case LOCAL_GL_UNSIGNED_SHORT: + case LOCAL_GL_UNSIGNED_INT: + return LOCAL_GL_UNSIGNED_INT; + + default: + MOZ_CRASH(); + } +} + +void +WebGLVertexAttribData::VertexAttribPointer(bool integerFunc, WebGLBuffer* buf, + uint8_t size, GLenum type, bool normalized, + uint32_t stride, uint64_t byteOffset) +{ + mIntegerFunc = integerFunc; + WebGLBuffer::SetSlot(0, buf, &mBuf); + mType = type; + mBaseType = AttribPointerBaseType(integerFunc, type); + mSize = size; + mBytesPerVertex = CalcBytesPerVertex(mType, mSize); + mNormalized = normalized; + mStride = stride; + mExplicitStride = (mStride ? mStride : mBytesPerVertex); + mByteOffset = byteOffset; +} + +void +WebGLVertexAttribData::DoVertexAttribPointer(gl::GLContext* gl, GLuint index) const +{ + if (mIntegerFunc) { + gl->fVertexAttribIPointer(index, mSize, mType, mStride, + (const void*)mByteOffset); + } else { + gl->fVertexAttribPointer(index, mSize, mType, mNormalized, mStride, + (const void*)mByteOffset); + } +} + +} // namespace mozilla diff --git a/dom/canvas/WebGLVertexAttribData.h b/dom/canvas/WebGLVertexAttribData.h new file mode 100644 index 000000000..9d79b4f94 --- /dev/null +++ b/dom/canvas/WebGLVertexAttribData.h @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef WEBGL_VERTEX_ATTRIB_DATA_H_ +#define WEBGL_VERTEX_ATTRIB_DATA_H_ + +#include "GLDefs.h" +#include "WebGLObjectModel.h" + +namespace mozilla { + +class WebGLBuffer; + +class WebGLVertexAttribData final +{ +public: + uint32_t mDivisor; + bool mEnabled; + +private: + bool mIntegerFunc; +public: + WebGLRefPtr mBuf; +private: + GLenum mType; + GLenum mBaseType; + uint8_t mSize; // num of mType vals per vert + uint8_t mBytesPerVertex; + bool mNormalized; + uint32_t mStride; // bytes + uint32_t mExplicitStride; + uint64_t mByteOffset; + +public: + +#define GETTER(X) const decltype(m##X)& X() const { return m##X; } + + GETTER(IntegerFunc) + GETTER(Type) + GETTER(BaseType) + GETTER(Size) + GETTER(BytesPerVertex) + GETTER(Normalized) + GETTER(Stride) + GETTER(ExplicitStride) + GETTER(ByteOffset) + +#undef GETTER + + // note that these initial values are what GL initializes vertex attribs to + WebGLVertexAttribData() + : mDivisor(0) + , mEnabled(false) + { + VertexAttribPointer(false, nullptr, 4, LOCAL_GL_FLOAT, false, 0, 0); + } + + void VertexAttribPointer(bool integerFunc, WebGLBuffer* buf, uint8_t size, + GLenum type, bool normalized, uint32_t stride, + uint64_t byteOffset); + + void DoVertexAttribPointer(gl::GLContext* gl, GLuint index) const; +}; + +} // namespace mozilla + +inline void +ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& callback, + mozilla::WebGLVertexAttribData& field, + const char* name, + uint32_t flags = 0) +{ + CycleCollectionNoteChild(callback, field.mBuf.get(), name, flags); +} + +#endif // WEBGL_VERTEX_ATTRIB_DATA_H_ diff --git a/dom/canvas/crashtests/0px-size-font-667225.html b/dom/canvas/crashtests/0px-size-font-667225.html new file mode 100644 index 000000000..9de65f8f5 --- /dev/null +++ b/dom/canvas/crashtests/0px-size-font-667225.html @@ -0,0 +1,19 @@ + + + + + + diff --git a/dom/canvas/crashtests/0px-size-font-shadow.html b/dom/canvas/crashtests/0px-size-font-shadow.html new file mode 100644 index 000000000..1298f3fa1 --- /dev/null +++ b/dom/canvas/crashtests/0px-size-font-shadow.html @@ -0,0 +1,17 @@ + + + + + + diff --git a/dom/canvas/crashtests/1099143-1.html b/dom/canvas/crashtests/1099143-1.html new file mode 100644 index 000000000..30bb3a003 --- /dev/null +++ b/dom/canvas/crashtests/1099143-1.html @@ -0,0 +1,5 @@ + diff --git a/dom/canvas/crashtests/1161277-1.html b/dom/canvas/crashtests/1161277-1.html new file mode 100644 index 000000000..3e04dc46d --- /dev/null +++ b/dom/canvas/crashtests/1161277-1.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/dom/canvas/crashtests/1183363.html b/dom/canvas/crashtests/1183363.html new file mode 100644 index 000000000..2044a8092 --- /dev/null +++ b/dom/canvas/crashtests/1183363.html @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/dom/canvas/crashtests/1190705.html b/dom/canvas/crashtests/1190705.html new file mode 100644 index 000000000..64795decb --- /dev/null +++ b/dom/canvas/crashtests/1190705.html @@ -0,0 +1,17 @@ + + + + + + + diff --git a/dom/canvas/crashtests/1223740-1.html b/dom/canvas/crashtests/1223740-1.html new file mode 100644 index 000000000..d5d969693 --- /dev/null +++ b/dom/canvas/crashtests/1223740-1.html @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/1225381-1.html b/dom/canvas/crashtests/1225381-1.html new file mode 100644 index 000000000..4519508a3 --- /dev/null +++ b/dom/canvas/crashtests/1225381-1.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/1229932-1.html b/dom/canvas/crashtests/1229932-1.html new file mode 100644 index 000000000..b5f06ff85 --- /dev/null +++ b/dom/canvas/crashtests/1229932-1.html @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/1229983-1.html b/dom/canvas/crashtests/1229983-1.html new file mode 100644 index 000000000..a865c569e --- /dev/null +++ b/dom/canvas/crashtests/1229983-1.html @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/1233613.html b/dom/canvas/crashtests/1233613.html new file mode 100644 index 000000000..d949c3b21 --- /dev/null +++ b/dom/canvas/crashtests/1233613.html @@ -0,0 +1,19 @@ + + diff --git a/dom/canvas/crashtests/1244850-1.html b/dom/canvas/crashtests/1244850-1.html new file mode 100644 index 000000000..015baf2c0 --- /dev/null +++ b/dom/canvas/crashtests/1244850-1.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/dom/canvas/crashtests/1246775-1.html b/dom/canvas/crashtests/1246775-1.html new file mode 100644 index 000000000..8c4ddabdf --- /dev/null +++ b/dom/canvas/crashtests/1246775-1.html @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/1283113-1.html b/dom/canvas/crashtests/1283113-1.html new file mode 100644 index 000000000..50234169b --- /dev/null +++ b/dom/canvas/crashtests/1283113-1.html @@ -0,0 +1,25 @@ + + + + + + + diff --git a/dom/canvas/crashtests/1284356-1.html b/dom/canvas/crashtests/1284356-1.html new file mode 100644 index 000000000..bbdb135b0 --- /dev/null +++ b/dom/canvas/crashtests/1284356-1.html @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/dom/canvas/crashtests/1284578-1.html b/dom/canvas/crashtests/1284578-1.html new file mode 100644 index 000000000..ba6e5f963 --- /dev/null +++ b/dom/canvas/crashtests/1284578-1.html @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/dom/canvas/crashtests/1286458-1.html b/dom/canvas/crashtests/1286458-1.html new file mode 100644 index 000000000..1241a5f0e --- /dev/null +++ b/dom/canvas/crashtests/1286458-1.html @@ -0,0 +1,20 @@ + + + + + + + diff --git a/dom/canvas/crashtests/1287515-1.html b/dom/canvas/crashtests/1287515-1.html new file mode 100644 index 000000000..37dc8a2a0 --- /dev/null +++ b/dom/canvas/crashtests/1287515-1.html @@ -0,0 +1,7 @@ + + diff --git a/dom/canvas/crashtests/1287652-1.html b/dom/canvas/crashtests/1287652-1.html new file mode 100644 index 000000000..7eaccd58a --- /dev/null +++ b/dom/canvas/crashtests/1287652-1.html @@ -0,0 +1,8 @@ + + diff --git a/dom/canvas/crashtests/1288872-1.html b/dom/canvas/crashtests/1288872-1.html new file mode 100644 index 000000000..de57311a5 --- /dev/null +++ b/dom/canvas/crashtests/1288872-1.html @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/dom/canvas/crashtests/1290628-1.html b/dom/canvas/crashtests/1290628-1.html new file mode 100644 index 000000000..a2502f70a --- /dev/null +++ b/dom/canvas/crashtests/1290628-1.html @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/dom/canvas/crashtests/1298576-1.html b/dom/canvas/crashtests/1298576-1.html new file mode 100644 index 000000000..b3936027e --- /dev/null +++ b/dom/canvas/crashtests/1298576-1.html @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/dom/canvas/crashtests/1299062-1.html b/dom/canvas/crashtests/1299062-1.html new file mode 100644 index 000000000..2f33b889a --- /dev/null +++ b/dom/canvas/crashtests/1299062-1.html @@ -0,0 +1,5 @@ + + diff --git a/dom/canvas/crashtests/1305312-1.html b/dom/canvas/crashtests/1305312-1.html new file mode 100644 index 000000000..3bd0b8c00 --- /dev/null +++ b/dom/canvas/crashtests/1305312-1.html @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/dom/canvas/crashtests/1334647-1.html b/dom/canvas/crashtests/1334647-1.html new file mode 100644 index 000000000..b4510afeb --- /dev/null +++ b/dom/canvas/crashtests/1334647-1.html @@ -0,0 +1,8 @@ + diff --git a/dom/canvas/crashtests/1357092.html b/dom/canvas/crashtests/1357092.html new file mode 100644 index 000000000..110aa7e86 --- /dev/null +++ b/dom/canvas/crashtests/1357092.html @@ -0,0 +1,10 @@ + + + + + diff --git a/dom/canvas/crashtests/360293-1.html b/dom/canvas/crashtests/360293-1.html new file mode 100644 index 000000000..8a0859e41 --- /dev/null +++ b/dom/canvas/crashtests/360293-1.html @@ -0,0 +1,35 @@ + + + + + Firefox: no crash | crash
+ + + + + + + diff --git a/dom/canvas/crashtests/421715-1.html b/dom/canvas/crashtests/421715-1.html new file mode 100644 index 000000000..c2ea9b28a --- /dev/null +++ b/dom/canvas/crashtests/421715-1.html @@ -0,0 +1,41 @@ + + + + + + + No canvas support. + + diff --git a/dom/canvas/crashtests/553938-1.html b/dom/canvas/crashtests/553938-1.html new file mode 100644 index 000000000..97e6b6c8a --- /dev/null +++ b/dom/canvas/crashtests/553938-1.html @@ -0,0 +1,20 @@ + + + + + ImageData Crash Test + + + + + + diff --git a/dom/canvas/crashtests/647480.html b/dom/canvas/crashtests/647480.html new file mode 100644 index 000000000..15b6b6a1b --- /dev/null +++ b/dom/canvas/crashtests/647480.html @@ -0,0 +1,104 @@ + + + + + + + diff --git a/dom/canvas/crashtests/727547.html b/dom/canvas/crashtests/727547.html new file mode 100644 index 000000000..005841de8 --- /dev/null +++ b/dom/canvas/crashtests/727547.html @@ -0,0 +1,7 @@ + + + diff --git a/dom/canvas/crashtests/729116.html b/dom/canvas/crashtests/729116.html new file mode 100644 index 000000000..679f9d296 --- /dev/null +++ b/dom/canvas/crashtests/729116.html @@ -0,0 +1,18 @@ + + + + + + diff --git a/dom/canvas/crashtests/743499-negative-size.html b/dom/canvas/crashtests/743499-negative-size.html new file mode 100644 index 000000000..7cfcd55b2 --- /dev/null +++ b/dom/canvas/crashtests/743499-negative-size.html @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/dom/canvas/crashtests/745699-1.html b/dom/canvas/crashtests/745699-1.html new file mode 100644 index 000000000..c65acf201 --- /dev/null +++ b/dom/canvas/crashtests/745699-1.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/dom/canvas/crashtests/745818-large-source.html b/dom/canvas/crashtests/745818-large-source.html new file mode 100644 index 000000000..a5be76be0 --- /dev/null +++ b/dom/canvas/crashtests/745818-large-source.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + diff --git a/dom/canvas/crashtests/746813-1.html b/dom/canvas/crashtests/746813-1.html new file mode 100644 index 000000000..18e52b4c9 --- /dev/null +++ b/dom/canvas/crashtests/746813-1.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/dom/canvas/crashtests/767337-1.html b/dom/canvas/crashtests/767337-1.html new file mode 100644 index 000000000..3c2c4ebd1 --- /dev/null +++ b/dom/canvas/crashtests/767337-1.html @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/dom/canvas/crashtests/779426.html b/dom/canvas/crashtests/779426.html new file mode 100644 index 000000000..ded3455b8 --- /dev/null +++ b/dom/canvas/crashtests/779426.html @@ -0,0 +1,19 @@ + + + + + + + diff --git a/dom/canvas/crashtests/780392-1.html b/dom/canvas/crashtests/780392-1.html new file mode 100644 index 000000000..2112c9a75 --- /dev/null +++ b/dom/canvas/crashtests/780392-1.html @@ -0,0 +1,10 @@ + + + + + + + diff --git a/dom/canvas/crashtests/789933-1.html b/dom/canvas/crashtests/789933-1.html new file mode 100644 index 000000000..a5f2f3437 --- /dev/null +++ b/dom/canvas/crashtests/789933-1.html @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/794463-1.html b/dom/canvas/crashtests/794463-1.html new file mode 100644 index 000000000..5726baa74 --- /dev/null +++ b/dom/canvas/crashtests/794463-1.html @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/dom/canvas/crashtests/802926-1.html b/dom/canvas/crashtests/802926-1.html new file mode 100644 index 000000000..a42ca50c1 --- /dev/null +++ b/dom/canvas/crashtests/802926-1.html @@ -0,0 +1,6 @@ + + diff --git a/dom/canvas/crashtests/896047-1.html b/dom/canvas/crashtests/896047-1.html new file mode 100644 index 000000000..2b121b227 --- /dev/null +++ b/dom/canvas/crashtests/896047-1.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/896047-2.html b/dom/canvas/crashtests/896047-2.html new file mode 100644 index 000000000..4cd12dfb4 --- /dev/null +++ b/dom/canvas/crashtests/896047-2.html @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/916128-1.html b/dom/canvas/crashtests/916128-1.html new file mode 100644 index 000000000..cddd5185e --- /dev/null +++ b/dom/canvas/crashtests/916128-1.html @@ -0,0 +1,13 @@ + diff --git a/dom/canvas/crashtests/934939-1.html b/dom/canvas/crashtests/934939-1.html new file mode 100644 index 000000000..d2ffbf475 --- /dev/null +++ b/dom/canvas/crashtests/934939-1.html @@ -0,0 +1,8 @@ + + + diff --git a/dom/canvas/crashtests/crashtests.list b/dom/canvas/crashtests/crashtests.list new file mode 100644 index 000000000..9da7dafa1 --- /dev/null +++ b/dom/canvas/crashtests/crashtests.list @@ -0,0 +1,44 @@ +load 0px-size-font-667225.html +load 0px-size-font-shadow.html +load 360293-1.html +load 421715-1.html +load 553938-1.html +load 647480.html +load 727547.html +load 729116.html +load 745699-1.html +load 746813-1.html +load 743499-negative-size.html +skip-if(Android) load 745818-large-source.html # Bug XXX - Crashes Android mid-run w/o a stack +load 767337-1.html +load 779426.html +skip-if(Android) load 780392-1.html +skip-if(Android) skip-if(gtkWidget&&isDebugBuild) load 789933-1.html # bug 1155252 for linux +load 794463-1.html +load 802926-1.html +load 896047-1.html +load 916128-1.html +load 934939-1.html +load 1099143-1.html +load 1161277-1.html +load 1183363.html +load 1190705.html +load 1223740-1.html +load 1225381-1.html +skip-if(azureCairo) load 1229983-1.html +load 1229932-1.html +load 1244850-1.html +load 1246775-1.html +load 1284356-1.html +load 1284578-1.html +skip-if(d2d) load 1287515-1.html +load 1287652-1.html +load 1288872-1.html +load 1290628-1.html +load 1283113-1.html +load 1286458-1.html +load 1299062-1.html +load 1305312-1.html +load 1298576-1.html +load 1334647-1.html +load 1357092.html diff --git a/dom/canvas/crashtests/texImage2D.html b/dom/canvas/crashtests/texImage2D.html new file mode 100644 index 000000000..370b00857 --- /dev/null +++ b/dom/canvas/crashtests/texImage2D.html @@ -0,0 +1,8 @@ + + + diff --git a/dom/canvas/gtest/TestImageBitmapColorUtils.cpp b/dom/canvas/gtest/TestImageBitmapColorUtils.cpp new file mode 100644 index 000000000..85ebe42ce --- /dev/null +++ b/dom/canvas/gtest/TestImageBitmapColorUtils.cpp @@ -0,0 +1,2585 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "ImageBitmapColorUtils.h" +#include "mozilla/dom/ImageBitmapBinding.h" +#include "libyuv.h" + +using namespace mozilla::dom; + +template +class Image { +public: + explicit Image(int aChannelCount) + : mChannelCount(aChannelCount), mData(nullptr) + { + } + + virtual ~Image() { + if (mData) delete[] mData; + } + + int mChannelCount; + T* mData; +}; + +template +class SimpleImage : public Image +{ +public: + SimpleImage(int aWidth, int aHeight, int aChannelCount) + : Image(aChannelCount) + , mWidth(aWidth) + , mHeight(aHeight) + , mStride(aWidth * aChannelCount * sizeof(T)) + { + Image::mData = new T[mHeight * mStride]; + } + + virtual ~SimpleImage() {} + + T GetPixelValue(int i, int j, int c) const + { + // The unit of mStride is byte. + const uint8_t* data = (const uint8_t*)Image::mData; + return *((T*)(data + i * mStride) + j * Image::mChannelCount + c); + } + + int mWidth; + int mHeight; + int mStride; +}; + +class RGBA32DataSinglePixel : public SimpleImage { +public: + RGBA32DataSinglePixel(int r, int g, int b, int a) + : SimpleImage(1, 1, 4) + { + mData[0] = r; + mData[1] = g; + mData[2] = b; + mData[3] = a; + } +}; + +class RGB24Data : public SimpleImage { +public: + RGB24Data() + : SimpleImage(3, 3, 3) + { + int i = 0; + mData[i + 0] = 0; mData[i + 1] = 0; mData[i + 2] = 0; + mData[i + 3] = 255; mData[i + 4] = 0; mData[i + 5] = 0; + mData[i + 6] = 0; mData[i + 7] = 255; mData[i + 8] = 0; + + i = 1 * mStride; + mData[i + 0] = 0; mData[i + 1] = 0; mData[i + 2] = 255; + mData[i + 3] = 255; mData[i + 4] = 255; mData[i + 5] = 0; + mData[i + 6] = 0; mData[i + 7] = 255; mData[i + 8] = 255; + + i = 2 * mStride; + mData[i + 0] = 255; mData[i + 1] = 0; mData[i + 2] = 255; + mData[i + 3] = 255; mData[i + 4] = 255; mData[i + 5] = 255; + mData[i + 6] = 128; mData[i + 7] = 128; mData[i + 8] = 128; + } +}; + +class BGR24Data : public SimpleImage { +public: + BGR24Data() + : SimpleImage(3, 3, 3) + { + int i = 0; + mData[i + 2] = 0; mData[i + 1] = 0; mData[i + 0] = 0; + mData[i + 5] = 255; mData[i + 4] = 0; mData[i + 3] = 0; + mData[i + 8] = 0; mData[i + 7] = 255; mData[i + 6] = 0; + + i = 1 * mStride; + mData[i + 2] = 0; mData[i + 1] = 0; mData[i + 0] = 255; + mData[i + 5] = 255; mData[i + 4] = 255; mData[i + 3] = 0; + mData[i + 8] = 0; mData[i + 7] = 255; mData[i + 6] = 255; + + i = 2 * mStride; + mData[i + 2] = 255; mData[i + 1] = 0; mData[i + 0] = 255; + mData[i + 5] = 255; mData[i + 4] = 255; mData[i + 3] = 255; + mData[i + 8] = 128; mData[i + 7] = 128; mData[i + 6] = 128; + } +}; + +class RGBA32Data : public SimpleImage { +public: + RGBA32Data() + : SimpleImage(3, 3, 4) + { + int i = 0; + mData[i + 0] = 0; mData[i + 1] = 0; mData[i + 2] = 0; mData[i + 3] = 255; + mData[i + 4] = 255; mData[i + 5] = 0; mData[i + 6] = 0; mData[i + 7] = 255; + mData[i + 8] = 0; mData[i + 9] = 255; mData[i + 10] = 0; mData[i + 11] = 255; + + i = 1 * mStride; + mData[i + 0] = 0; mData[i + 1] = 0; mData[i + 2] = 255; mData[i + 3] = 255; + mData[i + 4] = 255; mData[i + 5] = 255; mData[i + 6] = 0; mData[i + 7] = 255; + mData[i + 8] = 0; mData[i + 9] = 255; mData[i + 10] = 255; mData[i + 11] = 255; + + i = 2 * mStride; + mData[i + 0] = 255; mData[i + 1] = 0; mData[i + 2] = 255; mData[i + 3] = 255; + mData[i + 4] = 255; mData[i + 5] = 255; mData[i + 6] = 255; mData[i + 7] = 255; + mData[i + 8] = 128; mData[i + 9] = 128; mData[i + 10] = 128; mData[i + 11] = 255; + } +}; + +class BGRA32Data : public SimpleImage { +public: + BGRA32Data() + : SimpleImage(3, 3, 4) + { + int i = 0; + mData[i + 2] = 0; mData[i + 1] = 0; mData[i + 0] = 0; mData[i + 3] = 255; + mData[i + 6] = 255; mData[i + 5] = 0; mData[i + 4] = 0; mData[i + 7] = 255; + mData[i + 10] = 0; mData[i + 9] = 255; mData[i + 8] = 0; mData[i + 11] = 255; + + i = 1 * mStride; + mData[i + 2] = 0; mData[i + 1] = 0; mData[i + 0] = 255; mData[i + 3] = 255; + mData[i + 6] = 255; mData[i + 5] = 255; mData[i + 4] = 0; mData[i + 7] = 255; + mData[i + 10] = 0; mData[i + 9] = 255; mData[i + 8] = 255; mData[i + 11] = 255; + + i = 2 * mStride; + mData[i + 2] = 255; mData[i + 1] = 0; mData[i + 0] = 255; mData[i + 3] = 255; + mData[i + 6] = 255; mData[i + 5] = 255; mData[i + 4] = 255; mData[i + 7] = 255; + mData[i + 10] = 128; mData[i + 9] = 128; mData[i + 8] = 128; mData[i + 11] = 255; + } +}; + +class RGBA32Image : public SimpleImage +{ +public: + RGBA32Image(int aWidth, int aHeight, int aChannelCount) + : SimpleImage(aWidth, aHeight, aChannelCount) + {} + + const uint8_t* GetPixel(int x, int y) const { + return mData + mStride * y + x * mChannelCount; + } +}; + +class RGBA32DataFromYUV444PData : public RGBA32Image { +public: + RGBA32DataFromYUV444PData() + : RGBA32Image(3, 3, 4) + { +// libyuv: (16, 128, 128) --> (0, 0, 0, 255) +// libyuv: (82, 90, 240) --> (254, 0, 0, 255) +// libyuv: (144, 54, 34) --> (0, 253, 1, 255) +// libyuv: (41, 240, 110) --> (0, 0, 251, 255) +// libyuv: (210, 16, 146) --> (253, 253, 2, 255) +// libyuv: (169, 166, 16) --> (0, 253, 252, 255) +// libyuv: (107, 202, 222) --> (255, 0, 252, 255) +// libyuv: (235, 128, 128) --> (253, 253, 253, 255) +// libyuv: (126, 128, 128) --> (127, 127, 127, 255) + + int i = 0; + mData[i + 0] = 0; mData[i + 1] = 0; mData[i + 2] = 0; mData[i + 3] = 255; + mData[i + 4] = 254; mData[i + 5] = 0; mData[i + 6] = 0; mData[i + 7] = 255; + mData[i + 8] = 0; mData[i + 9] = 253; mData[i + 10] = 1; mData[i + 11] = 255; + + i = 1 * mStride; + mData[i + 0] = 0; mData[i + 1] = 0; mData[i + 2] = 251; mData[i + 3] = 255; + mData[i + 4] = 253; mData[i + 5] = 253; mData[i + 6] = 2; mData[i + 7] = 255; + mData[i + 8] = 0; mData[i + 9] = 253; mData[i + 10] = 252; mData[i + 11] = 255; + + i = 2 * mStride; + mData[i + 0] = 255; mData[i + 1] = 0; mData[i + 2] = 252; mData[i + 3] = 255; + mData[i + 4] = 253; mData[i + 5] = 253; mData[i + 6] = 253; mData[i + 7] = 255; + mData[i + 8] = 127; mData[i + 9] = 127; mData[i + 10] = 127; mData[i + 11] = 255; + } +}; + +class RGBA32DataFromYUV422PData : public RGBA32Image { +public: + RGBA32DataFromYUV422PData() + : RGBA32Image(3, 3, 4) + { +// libyuv: (16, 109, 184) --> (89, 0, 0, 255) +// libyuv: (82, 109, 184) --> (165, 38, 38, 255) +// libyuv: (144, 54, 34) --> (0, 253, 1, 255) +// libyuv: (41, 128, 128) --> (28, 28, 28, 255) +// libyuv: (210, 128, 128) --> (224, 224, 224, 255) +// libyuv: (169, 166, 16) --> (0, 253, 252, 255) +// libyuv: (107, 165, 175) --> (180, 52, 178, 255) +// libyuv: (235, 165, 175) --> (255, 200, 255, 255) +// libyuv: (126, 128, 128) --> (127, 127, 127, 255) + + int i = 0; + mData[i + 0] = 89; mData[i + 1] = 0; mData[i + 2] = 0; mData[i + 3] = 255; + mData[i + 4] = 165; mData[i + 5] = 38; mData[i + 6] = 38; mData[i + 7] = 255; + mData[i + 8] = 0; mData[i + 9] = 253; mData[i + 10] = 1; mData[i + 11] = 255; + + i = 1 * mStride; + mData[i + 0] = 28; mData[i + 1] = 28; mData[i + 2] = 28; mData[i + 3] = 255; + mData[i + 4] = 224; mData[i + 5] = 224; mData[i + 6] = 224; mData[i + 7] = 255; + mData[i + 8] = 0; mData[i + 9] = 253; mData[i + 10] = 252; mData[i + 11] = 255; + + i = 2 * mStride; + mData[i + 0] = 180; mData[i + 1] = 52; mData[i + 2] = 178; mData[i + 3] = 255; + mData[i + 4] = 255; mData[i + 5] = 200; mData[i + 6] = 255; mData[i + 7] = 255; + mData[i + 8] = 127; mData[i + 9] = 127; mData[i + 10] = 127; mData[i + 11] = 255; + } +}; + +class RGBA32DataFromYUV420PData : public RGBA32Image { +public: + RGBA32DataFromYUV420PData() + : RGBA32Image(3, 3, 4) + { +// libyuv: (16, 119, 156) --> (44, 0, 0, 255) +// libyuv: (82, 119, 156) --> (120, 57, 58, 255) +// libyuv: (144, 110, 25) --> (0, 238, 112, 255) +// libyuv: (41, 119, 156) --> (73, 9, 11, 255) +// libyuv: (210, 119, 156) --> (255, 205, 206, 255) +// libyuv: (169, 110, 25) --> (12, 255, 141, 255) +// libyuv: (107, 165, 175) --> (180, 52, 178, 255) +// libyuv: (235, 165, 175) --> (255, 200, 255, 255) +// libyuv: (126, 128, 128) --> (127, 127, 127, 255) + + int i = 0; + mData[i + 0] = 44; mData[i + 1] = 0; mData[i + 2] = 0; mData[i + 3] = 255; + mData[i + 4] = 120; mData[i + 5] = 57; mData[i + 6] = 58; mData[i + 7] = 255; + mData[i + 8] = 0; mData[i + 9] = 238; mData[i + 10] = 112; mData[i + 11] = 255; + + i = 1 * mStride; + mData[i + 0] = 73; mData[i + 1] = 9; mData[i + 2] = 11; mData[i + 3] = 255; + mData[i + 4] = 255; mData[i + 5] = 205; mData[i + 6] = 206; mData[i + 7] = 255; + mData[i + 8] = 12; mData[i + 9] = 255; mData[i + 10] = 141; mData[i + 11] = 255; + + i = 2 * mStride; + mData[i + 0] = 180; mData[i + 1] = 52; mData[i + 2] = 178; mData[i + 3] = 255; + mData[i + 4] = 255; mData[i + 5] = 200; mData[i + 6] = 255; mData[i + 7] = 255; + mData[i + 8] = 127; mData[i + 9] = 127; mData[i + 10] = 127; mData[i + 11] = 255; + } +}; + +class GrayData : public SimpleImage { +public: + GrayData() + : SimpleImage(3, 3, 1) + { + int i = 0; + mData[i + 0] = 0; mData[i + 1] = 76; mData[i + 2] = 149; + + i = 1 * mStride; + mData[i + 0] = 29; mData[i + 1] = 225; mData[i + 2] = 178; + + i = 2 * mStride; + mData[i + 0] = 105; mData[i + 1] = 255; mData[i + 2] = 127; + } +}; + +class YUVImage : public Image +{ +public: + YUVImage(int aYWidth, int aYHeight, int aYStride, + int aUWidth, int aUHeight, int aUStride, + int aVWidth, int aVHeight, int aVStride) + : Image(3) + , mYWidth(aYWidth), mYHeight(aYHeight), mYStride(aYStride) + , mUWidth(aUWidth), mUHeight(aUHeight), mUStride(aUStride) + , mVWidth(aVWidth), mVHeight(aVHeight), mVStride(aVStride) + { + mData = new uint8_t[mYHeight * mYStride + mUHeight * mUStride + mVHeight * mVStride]; + } + + uint8_t* YBuffer() const { return mData; } + uint8_t* UBuffer() const { return YBuffer() + mYHeight * mYStride; } + uint8_t* VBuffer() const { return UBuffer() + mUHeight * mUStride; } + + int mYWidth; + int mYHeight; + int mYStride; + int mUWidth; + int mUHeight; + int mUStride; + int mVWidth; + int mVHeight; + int mVStride; +}; + +class NVImage : public Image +{ +public: + NVImage(int aYWidth, int aYHeight, int aYStride, + int aUVWidth, int aUVHeight, int aUVStride) + : Image(3) + , mYWidth(aYWidth), mYHeight(aYHeight), mYStride(aYStride) + , mUVWidth(aUVWidth), mUVHeight(aUVHeight), mUVStride(aUVStride) + { + mData = new uint8_t[mYHeight * mYStride + mUVHeight * mUVStride]; + } + + uint8_t* YBuffer() const { return mData; } + uint8_t* UVBuffer() const { return YBuffer() + mYHeight * mYStride; } + + int mYWidth; + int mYHeight; + int mYStride; + int mUVWidth; + int mUVHeight; + int mUVStride; +}; + +class YUV444PData : public YUVImage +{ +public: + YUV444PData() + :YUVImage(3, 3, 3, 3, 3, 3, 3, 3, 3) + { +// libyuv: (0, 0, 0) --> (16, 128, 128) +// libyuv: (255, 0, 0) --> (82, 90, 240) +// libyuv: (0, 255, 0) --> (144, 54, 34) +// libyuv: (0, 0, 255) --> (41, 240, 110) +// libyuv: (255, 255, 0) --> (210, 16, 146) +// libyuv: (0, 255, 255) --> (169, 166, 16) +// libyuv: (255, 0, 255) --> (107, 202, 222) +// libyuv: (255, 255, 255) --> (235, 128, 128) +// libyuv: (128, 128, 128) --> (126, 128, 128) + + YBuffer()[0] = 16; YBuffer()[1] = 82; YBuffer()[2] = 144; + YBuffer()[3] = 41; YBuffer()[4] = 210; YBuffer()[5] = 169; + YBuffer()[6] = 107; YBuffer()[7] = 235; YBuffer()[8] = 126; + + UBuffer()[0] = 128; UBuffer()[1] = 90; UBuffer()[2] = 54; + UBuffer()[3] = 240; UBuffer()[4] = 16; UBuffer()[5] = 166; + UBuffer()[6] = 202; UBuffer()[7] = 128; UBuffer()[8] = 128; + + VBuffer()[0] = 128; VBuffer()[1] = 240; VBuffer()[2] = 34; + VBuffer()[3] = 110; VBuffer()[4] = 146; VBuffer()[5] = 16; + VBuffer()[6] = 222; VBuffer()[7] = 128; VBuffer()[8] = 128; + } +}; + +class YUV422PData : public YUVImage +{ +public: + YUV422PData() + :YUVImage(3, 3, 3, 2, 3, 2, 2, 3, 2) + { + YBuffer()[0] = 16; YBuffer()[1] = 82; YBuffer()[2] = 144; + YBuffer()[3] = 41; YBuffer()[4] = 210; YBuffer()[5] = 169; + YBuffer()[6] = 107; YBuffer()[7] = 235; YBuffer()[8] = 126; + + UBuffer()[0] = 109; UBuffer()[1] = 54; + UBuffer()[2] = 128; UBuffer()[3] = 166; + UBuffer()[4] = 165; UBuffer()[5] = 128; + + VBuffer()[0] = 184; VBuffer()[1] = 34; + VBuffer()[2] = 128; VBuffer()[3] = 16; + VBuffer()[4] = 175; VBuffer()[5] = 128; + } +}; + +class YUV420PData : public YUVImage +{ +public: + YUV420PData() + :YUVImage(3, 3, 3, 2, 2, 2, 2, 2, 2) + { + YBuffer()[0] = 16; YBuffer()[1] = 82; YBuffer()[2] = 144; + YBuffer()[3] = 41; YBuffer()[4] = 210; YBuffer()[5] = 169; + YBuffer()[6] = 107; YBuffer()[7] = 235; YBuffer()[8] = 126; + + UBuffer()[0] = 119; UBuffer()[1] = 110; + UBuffer()[2] = 165; UBuffer()[3] = 128; + + VBuffer()[0] = 156; VBuffer()[1] = 25; + VBuffer()[2] = 175; VBuffer()[3] = 128; + } +}; + +class NV12Data : public NVImage +{ +public: + NV12Data() + :NVImage(3, 3, 3, 2, 2, 4) + { + YBuffer()[0] = 16; YBuffer()[1] = 82; YBuffer()[2] = 144; + YBuffer()[3] = 41; YBuffer()[4] = 210; YBuffer()[5] = 169; + YBuffer()[6] = 107; YBuffer()[7] = 235; YBuffer()[8] = 126; + + // U + UVBuffer()[0] = 119; + UVBuffer()[2] = 110; + UVBuffer()[4] = 165; + UVBuffer()[6] = 128; + + // V + UVBuffer()[1] = 156; + UVBuffer()[3] = 25; + UVBuffer()[5] = 175; + UVBuffer()[7] = 128; + } +}; + +class NV21Data : public NVImage +{ +public: + NV21Data() + :NVImage(3, 3, 3, 2, 2, 4) + { + YBuffer()[0] = 16; YBuffer()[1] = 82; YBuffer()[2] = 144; + YBuffer()[3] = 41; YBuffer()[4] = 210; YBuffer()[5] = 169; + YBuffer()[6] = 107; YBuffer()[7] = 235; YBuffer()[8] = 126; + + // U + UVBuffer()[1] = 119; + UVBuffer()[3] = 110; + UVBuffer()[5] = 165; + UVBuffer()[7] = 128; + + // V + UVBuffer()[0] = 156; + UVBuffer()[2] = 25; + UVBuffer()[4] = 175; + UVBuffer()[6] = 128; + } +}; + +class HSVData : public SimpleImage +{ +public: + HSVData() + : SimpleImage(3, 3, 3) + { + int i = 0; + mData[i + 0] = 0.0f; mData[i + 1] = 0.0f; mData[i + 2] = 0.0f; + mData[i + 3] = 0.0f; mData[i + 4] = 1.0f; mData[i + 5] = 1.0f; + mData[i + 6] = 120.0f; mData[i + 7] = 1.0f; mData[i + 8] = 1.0f; + + i += mWidth * mChannelCount; + mData[i + 0] = 240.0f; mData[i + 1] = 1.0f; mData[i + 2] = 1.0f; + mData[i + 3] = 60.0f; mData[i + 4] = 1.0f; mData[i + 5] = 1.0f; + mData[i + 6] = 180.0f; mData[i + 7] = 1.0f; mData[i + 8] = 1.0f; + + i += mWidth * mChannelCount; + mData[i + 0] = 300.0f; mData[i + 1] = 1.0f; mData[i + 2] = 1.0f; + mData[i + 3] = 0.0f; mData[i + 4] = 0.0f; mData[i + 5] = 1.0f; + mData[i + 6] = 0.0f; mData[i + 7] = 0.0f; mData[i + 8] = 0.50196081f; + } +}; + +class LabData : public SimpleImage +{ +public: + LabData() + : SimpleImage(3, 3, 3) + { + int i = 0; + mData[i + 0] = 0.0f; mData[i + 1] = 0.0f; mData[i + 2] = 0.0f; + mData[i + 3] = 53.240585f; mData[i + 4] = 80.094185f; mData[i + 5] = 67.201538f; + mData[i + 6] = 87.7351f; mData[i + 7] = -86.181252f; mData[i + 8] = 83.177483f; + + i += mWidth * mChannelCount; + mData[i + 0] = 32.29567f; mData[i + 1] = 79.186989f; mData[i + 2] = -107.86176f; + mData[i + 3] = 97.139511f; mData[i + 4] = -21.552414f; mData[i + 5] = 94.475792f; + mData[i + 6] = 91.113297f; mData[i + 7] = -48.088551f; mData[i + 8] = -14.130962f; + + i += mWidth * mChannelCount; + mData[i + 0] = 60.323502f; mData[i + 1] = 98.235161f; mData[i + 2] = -60.825493f; + mData[i + 3] = 100.0f; mData[i + 4] = 0.0f; mData[i + 5] = 0.0f; + mData[i + 6] = 53.585014f; mData[i + 7] = 0.0f; mData[i + 8] = 0.0f; + } +}; + +/* + * From RGB24. + */ + +TEST(ImageBitmapColorUtils, RGB24ToRGB24_) +{ + const RGB24Data srcData; + const RGB24Data dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = RGB24ToRGB24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToBGR24_) +{ + const RGB24Data srcData; + const BGR24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = RGB24ToBGR24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToRGBA32) +{ + const RGB24Data srcData; + const RGBA32Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = RGB24ToRGBA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + 255); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToBGRA32) +{ + const RGB24Data srcData; + const BGRA32Data dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = RGB24ToBGRA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + 255); + } + } +} + + +//static void tryLibyuv(int r, int g, int b) +//{ +// const RGBA32DataSinglePixel srcData(r, g, b, 255); +// YUVImage result_(1, 1, 1, 1, 1, 1, 1, 1, 1); +// +// int length = result_.mYHeight * result_.mYStride + +// result_.mUHeight * result_.mUStride + +// result_.mVHeight * result_.mVStride; +// +// int rv = libyuv::ABGRToI420(srcData.mData, srcData.mStride, +// result_.YBuffer(), result_.mYStride, +// result_.UBuffer(), result_.mUStride, +// result_.VBuffer(), result_.mVStride, +// result_.mWidth, result_.mHeight); +// +// printf_stderr("\nlibyuv: (%hhu, %hhu, %hhu) --> (%hhu, %hhu, %hhu) \n", +// r, g, b, +// result_.YBuffer()[0], +// result_.UBuffer()[0], +// result_.VBuffer()[0]); +//} + +//static void tryLibyuv(int y, int u, int v) +//{ +// uint8_t* yuvPixel = new uint8_t[3]; +// uint8_t* rgbaPixel = new uint8_t[4]; +// +// yuvPixel[0] = y; +// yuvPixel[1] = u; +// yuvPixel[2] = v; +// +// int rv = libyuv::I420ToABGR(yuvPixel + 0, 1, +// yuvPixel + 1, 1, +// yuvPixel + 2, 1, +// rgbaPixel, 4, +// 1, 1); +// +// printf_stderr("\nlibyuv: (%hhu, %hhu, %hhu) --> (%hhu, %hhu, %hhu, %hhu) \n", +// yuvPixel[0], yuvPixel[1], yuvPixel[2], +// rgbaPixel[0], rgbaPixel[1], rgbaPixel[2], rgbaPixel[3]); +//} + +TEST(ImageBitmapColorUtils, RGB24ToYUV444P) +{ + const RGB24Data srcData; + const YUV444PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride); + + int rv = RGB24ToYUV444P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToYUV422P) +{ + const RGB24Data srcData; + const YUV422PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride); + + int rv = RGB24ToYUV422P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToYUV420P) +{ + const RGB24Data srcData; + const YUV420PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride); + + int rv = RGB24ToYUV420P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToNV12) +{ + const RGB24Data srcData; + const NV12Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = RGB24ToNV12(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToNV21) +{ + const RGB24Data srcData; + const NV21Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = RGB24ToNV21(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToHSV) +{ + const RGB24Data srcData; + const HSVData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = RGB24ToHSV(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToLab) +{ + const RGB24Data srcData; + const LabData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = RGB24ToLab(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, RGB24ToGray8) +{ + const RGB24Data srcData; + const GrayData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 1); + + int rv = RGB24ToGray8(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + dstData.mData[i * dstData.mStride + j]); + } + } +} + +/* + * From BGR24. + */ + +TEST(ImageBitmapColorUtils, BGR24ToRGB24_) +{ + const BGR24Data srcData; + const RGB24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = BGR24ToRGB24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToBGR24_) +{ + const BGR24Data srcData; + const BGR24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = BGR24ToBGR24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToRGBA32) +{ + const BGR24Data srcData; + const RGBA32Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = BGR24ToRGBA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + 255); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToBGRA32) +{ + const BGR24Data srcData; + const BGRA32Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = BGR24ToBGRA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + 255); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToYUV444P) +{ + const BGR24Data srcData; + const YUV444PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride); + + int rv = BGR24ToYUV444P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToYUV422P) +{ + const BGR24Data srcData; + const YUV422PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride); + + int rv = BGR24ToYUV422P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToYUV420P) +{ + const BGR24Data srcData; + const YUV420PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride); + + int rv = BGR24ToYUV420P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToNV12) +{ + const BGR24Data srcData; + const NV12Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = BGR24ToNV12(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToNV21) +{ + const BGR24Data srcData; + const NV21Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = BGR24ToNV21(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToHSV) +{ + const BGR24Data srcData; + const HSVData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = BGR24ToHSV(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToLab) +{ + const BGR24Data srcData; + const LabData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = BGR24ToLab(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, BGR24ToGray8) +{ + const BGR24Data srcData; + const GrayData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 1); + + int rv = BGR24ToGray8(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + dstData.mData[i * dstData.mStride + j]); + } + } +} + +/* + * From RGBA32. + */ +TEST(ImageBitmapColorUtils, RGBA32ToRGB24) +{ + const RGBA32Data srcData; + const RGB24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = RGBA32ToRGB24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToBGR24) +{ + const RGBA32Data srcData; + const BGR24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = RGBA32ToBGR24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToYUV444P) +{ + const RGBA32Data srcData; + const YUV444PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride); + + int rv = RGBA32ToYUV444P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToYUV422P) +{ + const RGBA32Data srcData; + const YUV422PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride); + + int rv = RGBA32ToYUV422P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToYUV420P) +{ + const RGBA32Data srcData; + const YUV420PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride); + + int rv = RGBA32ToYUV420P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToNV12) +{ + const RGBA32Data srcData; + const NV12Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = RGBA32ToNV12(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToNV21) +{ + const RGBA32Data srcData; + const NV21Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = RGBA32ToNV21(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToHSV) +{ + const RGBA32Data srcData; + const HSVData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = RGBA32ToHSV(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToLab) +{ + const RGBA32Data srcData; + const LabData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = RGBA32ToLab(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, RGBA32ToGray8) +{ + const RGBA32Data srcData; + const GrayData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 1); + + int rv = RGBA32ToGray8(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + dstData.mData[i * dstData.mStride + j]); + } + } +} + +/* + * From BGRA32. + */ +TEST(ImageBitmapColorUtils, BGRA32ToRGB24) +{ + const BGRA32Data srcData; + const RGB24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = BGRA32ToRGB24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToBGR24) +{ + const BGRA32Data srcData; + const BGR24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = BGRA32ToBGR24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]); + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToYUV444P) +{ + const BGRA32Data srcData; + const YUV444PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth, srcData.mHeight, srcData.mStride); + + int rv = BGRA32ToYUV444P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToYUV422P) +{ + const BGRA32Data srcData; + const YUV422PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride); + + int rv = BGRA32ToYUV422P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToYUV420P) +{ + const BGRA32Data srcData; + const YUV420PData dstData; + + YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride); + + int rv = BGRA32ToYUV420P(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UBuffer(), result_.mUStride, + result_.VBuffer(), result_.mVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUHeight; ++i) { + for (int j = 0; j < dstData.mUWidth; ++j) { + EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j], + result_.UBuffer()[i * result_.mUStride + j]); + EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j], + result_.VBuffer()[i * result_.mVStride + j]); + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToNV12) +{ + const BGRA32Data srcData; + const NV12Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = BGRA32ToNV12(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToNV21) +{ + const BGRA32Data srcData; + const NV21Data dstData; + + NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride, + srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1, srcData.mStride + 10); + + int rv = BGRA32ToNV21(srcData.mData, srcData.mStride, + result_.YBuffer(), result_.mYStride, + result_.UVBuffer(), result_.mUVStride, + result_.mYWidth, result_.mYHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mYHeight; ++i) { + for (int j = 0; j < dstData.mYWidth; ++j) { + EXPECT_EQ(dstData.YBuffer()[i * dstData.mYStride + j], + result_.YBuffer()[i * result_.mYStride + j]); + } + } + + for (int i = 0; i < dstData.mUVHeight; ++i) { + for (int j = 0; j < dstData.mUVWidth; ++j) { + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]); + EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1], + result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]); + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToHSV) +{ + const BGRA32Data srcData; + const HSVData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = BGRA32ToHSV(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToLab) +{ + const BGRA32Data srcData; + const LabData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 3); + + int rv = BGRA32ToLab(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const double actualValue = result_.GetPixelValue(i, j, c); + const double expectedValue = dstData.GetPixelValue(i, j, c); + const double diff = std::abs(actualValue - expectedValue); + EXPECT_LT(diff, 1.0); + } + } + } +} + +TEST(ImageBitmapColorUtils, BGRA32ToGray8) +{ + const BGRA32Data srcData; + const GrayData dstData; + + SimpleImage result_(srcData.mWidth, srcData.mHeight, 1); + + int rv = BGRA32ToGray8(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < dstData.mHeight; ++i) { + for (int j = 0; j < dstData.mWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + dstData.mData[i * dstData.mStride + j]); + } + } +} + +/* + * From YUV444P. + */ +TEST(ImageBitmapColorUtils, YUV444PToRGB24) +{ + const YUV444PData srcData; + const RGBA32DataFromYUV444PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = YUV444PToRGB24(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV444PToBGR24) +{ + const YUV444PData srcData; + const RGBA32DataFromYUV444PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = YUV444PToBGR24(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV444PToRGBA32) +{ + const YUV444PData srcData; + const RGBA32DataFromYUV444PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = YUV444PToRGBA32(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV444PToBGRA32) +{ + const YUV444PData srcData; + const RGBA32DataFromYUV444PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = YUV444PToBGRA32(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV444PToGray8) +{ + const YUV444PData srcData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 1); + + int rv = YUV444PToGray8(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + srcData.YBuffer()[i * srcData.mYStride + j]); + } + } +} + +/* + * From YUV422P. + */ +TEST(ImageBitmapColorUtils, YUV422PToRGB24) +{ + const YUV422PData srcData; + const RGBA32DataFromYUV422PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = YUV422PToRGB24(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV422PToBGR24) +{ + const YUV422PData srcData; + const RGBA32DataFromYUV422PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = YUV422PToBGR24(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV422PToRGBA32) +{ + const YUV422PData srcData; + const RGBA32DataFromYUV422PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = YUV422PToRGBA32(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV422PToBGRA32) +{ + const YUV422PData srcData; + const RGBA32DataFromYUV422PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = YUV422PToBGRA32(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV422PToGray8) +{ + const YUV422PData srcData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 1); + + int rv = YUV422PToGray8(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + srcData.YBuffer()[i * srcData.mYStride + j]); + } + } +} + +/* + * From YUV420P. + */ +TEST(ImageBitmapColorUtils, YUV420PToRGB24) +{ + const YUV420PData srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = YUV420PToRGB24(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV420PToBGR24) +{ + const YUV420PData srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = YUV420PToBGR24(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV420PToRGBA32) +{ + const YUV420PData srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = YUV420PToRGBA32(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV420PToBGRA32) +{ + const YUV420PData srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = YUV420PToBGRA32(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, YUV420PToGray8) +{ + const YUV420PData srcData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 1); + + int rv = YUV420PToGray8(srcData.YBuffer(), srcData.mYStride, + srcData.UBuffer(), srcData.mUStride, + srcData.VBuffer(), srcData.mVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + srcData.YBuffer()[i * srcData.mYStride + j]); + } + } +} + +/* + * From NV12. + */ +TEST(ImageBitmapColorUtils, NV12ToRGB24) +{ + const NV12Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = NV12ToRGB24(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + } + } +} + +TEST(ImageBitmapColorUtils, NV12ToBGR24) +{ + const NV12Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = NV12ToBGR24(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + } + } +} + +TEST(ImageBitmapColorUtils, NV12ToRGBA32) +{ + const NV12Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = NV12ToRGBA32(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, NV12ToBGRA32) +{ + const NV12Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = NV12ToBGRA32(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, NV12ToGray8) +{ + const NV12Data srcData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 1); + + int rv = NV12ToGray8(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + srcData.YBuffer()[i * srcData.mYStride + j]); + } + } +} + +/* + * From NV21. + */ +TEST(ImageBitmapColorUtils, NV21ToRGB24) +{ + const NV21Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = NV21ToRGB24(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + } + } +} + +TEST(ImageBitmapColorUtils, NV21ToBGR24) +{ + const NV21Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 3); + + int rv = NV21ToBGR24(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + } + } +} + +TEST(ImageBitmapColorUtils, NV21ToRGBA32) +{ + const NV21Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = NV21ToRGBA32(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, NV21ToBGRA32) +{ + const NV21Data srcData; + const RGBA32DataFromYUV420PData dstData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, dstData.mChannelCount); + + int rv = NV21ToBGRA32(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 0], + dstData.GetPixel(j, i)[2]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 1], + dstData.GetPixel(j, i)[1]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 2], + dstData.GetPixel(j, i)[0]); + EXPECT_EQ(result_.mData[i * result_.mStride + j * result_.mChannelCount + 3], + dstData.GetPixel(j, i)[3]); + } + } +} + +TEST(ImageBitmapColorUtils, NV21ToGray8) +{ + const NV21Data srcData; + SimpleImage result_(srcData.mYWidth, srcData.mYHeight, 1); + + int rv = NV21ToGray8(srcData.YBuffer(), srcData.mYStride, + srcData.UVBuffer(), srcData.mUVStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mYHeight; ++i) { + for (int j = 0; j < srcData.mYWidth; ++j) { + EXPECT_EQ(result_.mData[i * result_.mStride + j], + srcData.YBuffer()[i * srcData.mYStride + j]); + } + } +} + +/* + * From HSV. + */ +TEST(ImageBitmapColorUtils, HSVToRGB24) +{ + const HSVData srcData; + const RGB24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = HSVToRGB24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + EXPECT_EQ(result_.GetPixelValue(i, j, c), + dstData.GetPixelValue(i, j, c)); + } + } + } +} + +TEST(ImageBitmapColorUtils, HSVToBGR24) +{ + const HSVData srcData; + const BGR24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = HSVToBGR24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + EXPECT_EQ(result_.GetPixelValue(i, j, c), + dstData.GetPixelValue(i, j, c)); + } + } + } +} + +TEST(ImageBitmapColorUtils, HSVToRGBA32) +{ + const HSVData srcData; + const RGBA32Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = HSVToRGBA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + EXPECT_EQ(result_.GetPixelValue(i, j, c), + dstData.GetPixelValue(i, j, c)); + } + } + } +} + +TEST(ImageBitmapColorUtils, HSVToBGRA32) +{ + const HSVData srcData; + const BGRA32Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = HSVToBGRA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + EXPECT_EQ(result_.GetPixelValue(i, j, c), + dstData.GetPixelValue(i, j, c)); + } + } + } +} + +/* + * From Lab. + */ +TEST(ImageBitmapColorUtils, LabToRGB24) +{ + const LabData srcData; + const RGB24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = LabToRGB24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const uint8_t actualValue = result_.GetPixelValue(i, j, c); + const uint8_t expectedValue = dstData.GetPixelValue(i, j, c); + const int diff = std::abs(actualValue - expectedValue); + EXPECT_LE(diff, 1); + } + } + } +} + +TEST(ImageBitmapColorUtils, LabToBGR24) +{ + const LabData srcData; + const BGR24Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = LabToBGR24(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const uint8_t actualValue = result_.GetPixelValue(i, j, c); + const uint8_t expectedValue = dstData.GetPixelValue(i, j, c); + const int diff = std::abs(actualValue - expectedValue); + EXPECT_LE(diff, 1); + } + } + } +} + +TEST(ImageBitmapColorUtils, LabToRGBA32) +{ + const LabData srcData; + const RGBA32Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = LabToRGBA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const uint8_t actualValue = result_.GetPixelValue(i, j, c); + const uint8_t expectedValue = dstData.GetPixelValue(i, j, c); + const int diff = std::abs(actualValue - expectedValue); + EXPECT_LE(diff, 1); + } + } + } +} + +TEST(ImageBitmapColorUtils, LabToBGRA32) +{ + const LabData srcData; + const BGRA32Data dstData; + SimpleImage result_(srcData.mWidth, srcData.mHeight, dstData.mChannelCount); + + int rv = LabToBGRA32(srcData.mData, srcData.mStride, + result_.mData, result_.mStride, + result_.mWidth, result_.mHeight); + + ASSERT_TRUE(rv == 0); + + for (int i = 0; i < srcData.mHeight; ++i) { + for (int j = 0; j < srcData.mWidth; ++j) { + for (int c = 0; c < dstData.mChannelCount; ++c) { + const uint8_t actualValue = result_.GetPixelValue(i, j, c); + const uint8_t expectedValue = dstData.GetPixelValue(i, j, c); + const int diff = std::abs(actualValue - expectedValue); + EXPECT_LE(diff, 1); + } + } + } +} diff --git a/dom/canvas/gtest/TestWebGLElementArrayCache.cpp b/dom/canvas/gtest/TestWebGLElementArrayCache.cpp new file mode 100644 index 000000000..c8ffc8701 --- /dev/null +++ b/dom/canvas/gtest/TestWebGLElementArrayCache.cpp @@ -0,0 +1,206 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/Assertions.h" + +#include "WebGLElementArrayCache.h" + +#include +#include +#include "nscore.h" +#include "nsTArray.h" + +void +MakeRandomVector(nsTArray& a, size_t size) +{ + a.SetLength(size); + // only the most-significant bits of rand() are reasonably random. + // RAND_MAX can be as low as 0x7fff, and we need 8 bits for the result, so we can only + // ignore the 7 least significant bits. + for (size_t i = 0; i < size; i++) + a[i] = static_cast((unsigned int)(rand()) >> 7); +} + +template +T +RandomInteger(T a, T b) +{ + T result(a + rand() % (b - a + 1)); + return result; +} + +template +GLenum +GLType() +{ + switch (sizeof(T)) { + case 4: return LOCAL_GL_UNSIGNED_INT; + case 2: return LOCAL_GL_UNSIGNED_SHORT; + case 1: return LOCAL_GL_UNSIGNED_BYTE; + default: + MOZ_RELEASE_ASSERT(false); + return 0; + } +} + +void +CheckValidate(bool expectSuccess, mozilla::WebGLElementArrayCache& c, GLenum type, + uint32_t maxAllowed, size_t first, size_t count) +{ + const bool success = c.Validate(type, maxAllowed, first, count); + ASSERT_TRUE(success == expectSuccess); +} + +template +void +CheckValidateOneTypeVariousBounds(mozilla::WebGLElementArrayCache& c, size_t firstByte, + size_t countBytes) +{ + size_t first = firstByte / sizeof(T); + size_t count = countBytes / sizeof(T); + + GLenum type = GLType(); + + T max = 0; + for (size_t i = 0; i < count; i++) + if (c.Element(first + i) > max) + max = c.Element(first + i); + + CheckValidate(true, c, type, max, first, count); + CheckValidate(true, c, type, T(-1), first, count); + if (T(max + 1)) CheckValidate(true, c, type, T(max + 1), first, count); + if (max > 0) { + CheckValidate(false, c, type, max - 1, first, count); + CheckValidate(false, c, type, 0, first, count); + } +} + +void CheckValidateAllTypes(mozilla::WebGLElementArrayCache& c, size_t firstByte, + size_t countBytes) +{ + CheckValidateOneTypeVariousBounds(c, firstByte, countBytes); + CheckValidateOneTypeVariousBounds(c, firstByte, countBytes); + CheckValidateOneTypeVariousBounds(c, firstByte, countBytes); +} + +template +void +CheckSanity() +{ + const size_t numElems = 64; // should be significantly larger than tree leaf size to + // ensure we exercise some nontrivial tree-walking + T data[numElems] = {1,0,3,1,2,6,5,4}; // intentionally specify only 8 elements for now + size_t numBytes = numElems * sizeof(T); + ASSERT_TRUE(numBytes == sizeof(data)); + + GLenum type = GLType(); + + mozilla::WebGLElementArrayCache c; + c.BufferData(data, numBytes); + CheckValidate(true, c, type, 6, 0, 8); + CheckValidate(false, c, type, 5, 0, 8); + CheckValidate(true, c, type, 3, 0, 3); + CheckValidate(false, c, type, 2, 0, 3); + CheckValidate(true, c, type, 6, 2, 4); + CheckValidate(false, c, type, 5, 2, 4); + + c.BufferSubData(5*sizeof(T), data, sizeof(T)); + CheckValidate(true, c, type, 5, 0, 8); + CheckValidate(false, c, type, 4, 0, 8); + + // now test a somewhat larger size to ensure we exceed the size of a tree leaf + for(size_t i = 0; i < numElems; i++) + data[i] = numElems - i; + c.BufferData(data, numBytes); + CheckValidate(true, c, type, numElems, 0, numElems); + CheckValidate(false, c, type, numElems - 1, 0, numElems); + + ASSERT_TRUE(numElems > 10); + CheckValidate(true, c, type, numElems - 10, 10, numElems - 10); + CheckValidate(false, c, type, numElems - 11, 10, numElems - 10); +} + +template +void +CheckUintOverflow() +{ + // This test is only for integer types smaller than uint32_t + static_assert(sizeof(T) < sizeof(uint32_t), "This test is only for integer types \ + smaller than uint32_t"); + + const size_t numElems = 64; // should be significantly larger than tree leaf size to + // ensure we exercise some nontrivial tree-walking + T data[numElems]; + size_t numBytes = numElems * sizeof(T); + ASSERT_TRUE(numBytes == sizeof(data)); + + GLenum type = GLType(); + + mozilla::WebGLElementArrayCache c; + + for(size_t i = 0; i < numElems; i++) + data[i] = numElems - i; + c.BufferData(data, numBytes); + + // bug 825205 + uint32_t bigValWrappingToZero = uint32_t(T(-1)) + 1; + CheckValidate(true, c, type, bigValWrappingToZero, 0, numElems); + CheckValidate(true, c, type, bigValWrappingToZero - 1, 0, numElems); + CheckValidate(false, c, type, 0, 0, numElems); +} + +TEST(WebGLElementArrayCache, Test) +{ + srand(0); // do not want a random seed here. + + CheckSanity(); + CheckSanity(); + CheckSanity(); + + CheckUintOverflow(); + CheckUintOverflow(); + + nsTArray v, vsub; + mozilla::WebGLElementArrayCache b; + + for (int maxBufferSize = 1; maxBufferSize <= 4096; maxBufferSize *= 2) { + // See bug 800612. We originally had | repeat = min(maxBufferSize, 20) | + // and a real bug was only caught on Windows and not on Linux due to rand() + // producing different values. In that case, the minimum value by which to replace + // this 20 to reproduce the bug on Linux, was 25. Replacing it with 64 should give + // us some comfort margin. + int repeat = std::min(maxBufferSize, 64); + for (int i = 0; i < repeat; i++) { + size_t size = RandomInteger(0, maxBufferSize); + MakeRandomVector(v, size); + b.BufferData(v.Elements(), size); + CheckValidateAllTypes(b, 0, size); + + for (int j = 0; j < 16; j++) { + for (int bufferSubDataCalls = 1; bufferSubDataCalls <= 8; bufferSubDataCalls *= 2) { + for (int validateCalls = 1; validateCalls <= 8; validateCalls *= 2) { + + size_t offset = 0, subsize = 0; + + for (int k = 0; k < bufferSubDataCalls; k++) { + offset = RandomInteger(0, size); + subsize = RandomInteger(0, size - offset); + MakeRandomVector(vsub, subsize); + b.BufferSubData(offset, vsub.Elements(), subsize); + } + + for (int k = 0; k < validateCalls; k++) { + offset = RandomInteger(0, size); + subsize = RandomInteger(0, size - offset); + CheckValidateAllTypes(b, offset, subsize); + } + } // validateCalls + } // bufferSubDataCalls + } // j + } // i + } // maxBufferSize +} + diff --git a/dom/canvas/gtest/moz.build b/dom/canvas/gtest/moz.build new file mode 100644 index 000000000..a87b6fe6b --- /dev/null +++ b/dom/canvas/gtest/moz.build @@ -0,0 +1,17 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +UNIFIED_SOURCES += [ + 'TestImageBitmapColorUtils.cpp', + 'TestWebGLElementArrayCache.cpp', +] + +LOCAL_INCLUDES += [ + '/dom/canvas', + '/media/libyuv/include' +] + +FINAL_LIBRARY = 'xul-gtest' diff --git a/dom/canvas/moz.build b/dom/canvas/moz.build new file mode 100644 index 000000000..2b2ceba52 --- /dev/null +++ b/dom/canvas/moz.build @@ -0,0 +1,202 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +TEST_DIRS += [ + 'gtest' +] + +# Change the following line(s) to avoid bug 1081323 (clobber after changing a manifest): +# * Adjust failure errata for webgl-conf. + +MOCHITEST_MANIFESTS += [ + 'test/crash/mochitest.ini', + 'test/crossorigin/mochitest.ini', + 'test/mochitest.ini', + 'test/webgl-conf/generated-mochitest.ini', + 'test/webgl-mochitest/mochitest.ini', +] + +MOCHITEST_CHROME_MANIFESTS += ['test/chrome/chrome.ini'] + +EXPORTS += [ + 'nsICanvasRenderingContextInternal.h', +] + +EXPORTS.mozilla.ipc += [ + 'DocumentRendererChild.h', + 'DocumentRendererParent.h', +] + +EXPORTS.mozilla.dom += [ + 'CanvasGradient.h', + 'CanvasPath.h', + 'CanvasPattern.h', + 'CanvasRenderingContext2D.h', + 'CanvasRenderingContextHelper.h', + 'CanvasUtils.h', + 'ImageBitmap.h', + 'ImageBitmapRenderingContext.h', + 'ImageBitmapSource.h', + 'ImageData.h', + 'OffscreenCanvas.h', + 'TextMetrics.h', + 'WebGLVertexArrayObject.h', +] + +# Canvas 2D and common sources +UNIFIED_SOURCES += [ + 'CanvasImageCache.cpp', + 'CanvasRenderingContext2D.cpp', + 'CanvasRenderingContextHelper.cpp', + 'CanvasUtils.cpp', + 'DocumentRendererChild.cpp', + 'DocumentRendererParent.cpp', + 'ImageBitmap.cpp', + 'ImageBitmapColorUtils.cpp', + 'ImageBitmapRenderingContext.cpp', + 'ImageBitmapUtils.cpp', + 'ImageData.cpp', + 'OffscreenCanvas.cpp', +] + +SOURCES += [ + 'ImageUtils.cpp', +] + +# WebGL Sources +UNIFIED_SOURCES += [ + 'TexUnpackBlob.cpp', + 'WebGL1Context.cpp', + 'WebGL1ContextUniforms.cpp', + 'WebGL2Context.cpp', + 'WebGL2ContextBuffers.cpp', + 'WebGL2ContextFramebuffers.cpp', + 'WebGL2ContextMRTs.cpp', + 'WebGL2ContextPrograms.cpp', + 'WebGL2ContextQueries.cpp', + 'WebGL2ContextRenderbuffers.cpp', + 'WebGL2ContextSamplers.cpp', + 'WebGL2ContextState.cpp', + 'WebGL2ContextSync.cpp', + 'WebGL2ContextTextures.cpp', + 'WebGL2ContextTransformFeedback.cpp', + 'WebGL2ContextUniforms.cpp', + 'WebGL2ContextVAOs.cpp', + 'WebGL2ContextVertices.cpp', + 'WebGLActiveInfo.cpp', + 'WebGLBuffer.cpp', + 'WebGLContext.cpp', + 'WebGLContextBuffers.cpp', + 'WebGLContextDraw.cpp', + 'WebGLContextExtensions.cpp', + 'WebGLContextFramebufferOperations.cpp', + 'WebGLContextGL.cpp', + 'WebGLContextLossHandler.cpp', + 'WebGLContextState.cpp', + 'WebGLContextTextures.cpp', + 'WebGLContextUnchecked.cpp', + 'WebGLContextUtils.cpp', + 'WebGLContextValidate.cpp', + 'WebGLContextVertexArray.cpp', + 'WebGLContextVertices.cpp', + 'WebGLElementArrayCache.cpp', + 'WebGLExtensionBase.cpp', + 'WebGLExtensionBlendMinMax.cpp', + 'WebGLExtensionColorBufferFloat.cpp', + 'WebGLExtensionColorBufferHalfFloat.cpp', + 'WebGLExtensionCompressedTextureATC.cpp', + 'WebGLExtensionCompressedTextureES3.cpp', + 'WebGLExtensionCompressedTextureETC1.cpp', + 'WebGLExtensionCompressedTexturePVRTC.cpp', + 'WebGLExtensionCompressedTextureS3TC.cpp', + 'WebGLExtensionDebugRendererInfo.cpp', + 'WebGLExtensionDebugShaders.cpp', + 'WebGLExtensionDepthTexture.cpp', + 'WebGLExtensionDisjointTimerQuery.cpp', + 'WebGLExtensionDrawBuffers.cpp', + 'WebGLExtensionElementIndexUint.cpp', + 'WebGLExtensionEXTColorBufferFloat.cpp', + 'WebGLExtensionFragDepth.cpp', + 'WebGLExtensionInstancedArrays.cpp', + 'WebGLExtensionLoseContext.cpp', + 'WebGLExtensionShaderTextureLod.cpp', + 'WebGLExtensionSRGB.cpp', + 'WebGLExtensionStandardDerivatives.cpp', + 'WebGLExtensionTextureFilterAnisotropic.cpp', + 'WebGLExtensionTextureFloat.cpp', + 'WebGLExtensionTextureFloatLinear.cpp', + 'WebGLExtensionTextureHalfFloat.cpp', + 'WebGLExtensionTextureHalfFloatLinear.cpp', + 'WebGLExtensionVertexArray.cpp', + 'WebGLFormats.cpp', + 'WebGLFramebuffer.cpp', + 'WebGLFramebufferAttachable.cpp', + 'WebGLMemoryTracker.cpp', + 'WebGLObjectModel.cpp', + 'WebGLProgram.cpp', + 'WebGLQuery.cpp', + 'WebGLRenderbuffer.cpp', + 'WebGLSampler.cpp', + 'WebGLShader.cpp', + 'WebGLShaderPrecisionFormat.cpp', + 'WebGLShaderValidator.cpp', + 'WebGLSync.cpp', + 'WebGLTexelConversions.cpp', + 'WebGLTexture.cpp', + 'WebGLTextureUpload.cpp', + 'WebGLTransformFeedback.cpp', + 'WebGLUniformLocation.cpp', + 'WebGLValidateStrings.cpp', + 'WebGLVertexArray.cpp', + 'WebGLVertexArrayFake.cpp', + 'WebGLVertexArrayGL.cpp', + 'WebGLVertexArrayObject.cpp', + 'WebGLVertexAttribData.cpp', +] + +SOURCES += [ + 'MurmurHash3.cpp', +] + +# Suppress warnings from third-party code. +if CONFIG['CLANG_CXX']: + SOURCES['MurmurHash3.cpp'].flags += ['-Wno-implicit-fallthrough'] + +LOCAL_INCLUDES += [ + '/js/xpconnect/wrappers', +] + +include('/ipc/chromium/chromium-config.mozbuild') + +FINAL_LIBRARY = 'xul' +LOCAL_INCLUDES += [ + '../workers', + '/dom/base', + '/dom/html', + '/dom/svg', + '/dom/workers', + '/dom/xul', + '/gfx/gl', + '/image', + '/js/xpconnect/src', + '/layout/generic', + '/layout/style', + '/layout/xul', + '/media/libyuv/include', +] + +CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] +CXXFLAGS += CONFIG['TK_CFLAGS'] + +LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] + +if CONFIG['GNU_CXX']: + CXXFLAGS += ['-Wno-error=shadow'] + +if CONFIG['_MSC_VER']: + # This is intended as a temporary workaround to unblock compilation + # on VS2015 in warnings as errors mode. + CXXFLAGS += ['-wd4312'] diff --git a/dom/canvas/nsICanvasRenderingContextInternal.h b/dom/canvas/nsICanvasRenderingContextInternal.h new file mode 100644 index 000000000..968d9b611 --- /dev/null +++ b/dom/canvas/nsICanvasRenderingContextInternal.h @@ -0,0 +1,194 @@ +/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef nsICanvasRenderingContextInternal_h___ +#define nsICanvasRenderingContextInternal_h___ + +#include "mozilla/gfx/2D.h" +#include "nsISupports.h" +#include "nsIInputStream.h" +#include "nsIDocShell.h" +#include "nsRefreshDriver.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "mozilla/dom/OffscreenCanvas.h" +#include "mozilla/RefPtr.h" +#include "mozilla/UniquePtr.h" +#include "mozilla/NotNull.h" + +#define NS_ICANVASRENDERINGCONTEXTINTERNAL_IID \ +{ 0xb84f2fed, 0x9d4b, 0x430b, \ + { 0xbd, 0xfb, 0x85, 0x57, 0x8a, 0xc2, 0xb4, 0x4b } } + +class nsDisplayListBuilder; + +namespace mozilla { +namespace layers { +class CanvasLayer; +class Layer; +class LayerManager; +} // namespace layers +namespace gfx { +class SourceSurface; +} // namespace gfx +} // namespace mozilla + +class nsICanvasRenderingContextInternal : + public nsISupports, + public nsAPostRefreshObserver +{ +public: + typedef mozilla::layers::CanvasLayer CanvasLayer; + typedef mozilla::layers::Layer Layer; + typedef mozilla::layers::LayerManager LayerManager; + + NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANVASRENDERINGCONTEXTINTERNAL_IID) + + void SetCanvasElement(mozilla::dom::HTMLCanvasElement* parentCanvas) + { + RemovePostRefreshObserver(); + mCanvasElement = parentCanvas; + AddPostRefreshObserverIfNecessary(); + } + + virtual nsIPresShell *GetPresShell() { + if (mCanvasElement) { + return mCanvasElement->OwnerDoc()->GetShell(); + } + return nullptr; + } + + void RemovePostRefreshObserver() + { + if (mRefreshDriver) { + mRefreshDriver->RemovePostRefreshObserver(this); + mRefreshDriver = nullptr; + } + } + + void AddPostRefreshObserverIfNecessary() + { + if (!GetPresShell() || + !GetPresShell()->GetPresContext() || + !GetPresShell()->GetPresContext()->RefreshDriver()) { + return; + } + mRefreshDriver = GetPresShell()->GetPresContext()->RefreshDriver(); + mRefreshDriver->AddPostRefreshObserver(this); + } + + mozilla::dom::HTMLCanvasElement* GetParentObject() const + { + return mCanvasElement; + } + + void SetOffscreenCanvas(mozilla::dom::OffscreenCanvas* aOffscreenCanvas) + { + mOffscreenCanvas = aOffscreenCanvas; + } + + // Dimensions of the canvas, in pixels. + virtual int32_t GetWidth() const = 0; + virtual int32_t GetHeight() const = 0; + + // Sets the dimensions of the canvas, in pixels. Called + // whenever the size of the element changes. + NS_IMETHOD SetDimensions(int32_t width, int32_t height) = 0; + + // Initializes with an nsIDocShell and DrawTarget. The size is taken from the + // DrawTarget. + NS_IMETHOD InitializeWithDrawTarget(nsIDocShell *aDocShell, + mozilla::NotNull aTarget) = 0; + + // Creates an image buffer. Returns null on failure. + virtual mozilla::UniquePtr GetImageBuffer(int32_t* format) = 0; + + // Gives you a stream containing the image represented by this context. + // The format is given in mimeTime, for example "image/png". + // + // If the image format does not support transparency or includeTransparency + // is false, alpha will be discarded and the result will be the image + // composited on black. + NS_IMETHOD GetInputStream(const char *mimeType, + const char16_t *encoderOptions, + nsIInputStream **stream) = 0; + + // This gets an Azure SourceSurface for the canvas, this will be a snapshot + // of the canvas at the time it was called. + // If premultAlpha is provided, then it assumed the callee can handle + // un-premultiplied surfaces, and *premultAlpha will be set to false + // if one is returned. + virtual already_AddRefed GetSurfaceSnapshot(bool* premultAlpha = nullptr) = 0; + + // If this context is opaque, the backing store of the canvas should + // be created as opaque; all compositing operators should assume the + // dst alpha is always 1.0. If this is never called, the context + // defaults to false (not opaque). + NS_IMETHOD SetIsOpaque(bool isOpaque) = 0; + virtual bool GetIsOpaque() = 0; + + // Invalidate this context and release any held resources, in preperation + // for possibly reinitializing with SetDimensions/InitializeWithSurface. + NS_IMETHOD Reset() = 0; + + // Return the CanvasLayer for this context, creating + // one for the given layer manager if not available. + virtual already_AddRefed GetCanvasLayer(nsDisplayListBuilder* builder, + Layer *oldLayer, + LayerManager *manager, + bool aMirror = false) = 0; + + // Return true if the canvas should be forced to be "inactive" to ensure + // it can be drawn to the screen even if it's too large to be blitted by + // an accelerated CanvasLayer. + virtual bool ShouldForceInactiveLayer(LayerManager *manager) { return false; } + + virtual void MarkContextClean() = 0; + + // Called when a frame is captured. + virtual void MarkContextCleanForFrameCapture() = 0; + + // Whether the context is clean or has been invalidated since the last frame + // was captured. + virtual bool IsContextCleanForFrameCapture() = 0; + + // Redraw the dirty rectangle of this canvas. + NS_IMETHOD Redraw(const gfxRect &dirty) = 0; + + NS_IMETHOD SetContextOptions(JSContext* cx, JS::Handle options, + mozilla::ErrorResult& aRvForDictionaryInit) + { + return NS_OK; + } + + // return true and fills in the bounding rect if elementis a child and has a hit region. + virtual bool GetHitRegionRect(mozilla::dom::Element* element, nsRect& rect) { return false; } + + // Given a point, return hit region ID if it exists or an empty string if it doesn't + virtual nsString GetHitRegion(const mozilla::gfx::Point& point) { return nsString(); } + + virtual void OnVisibilityChange() {} + + virtual void OnMemoryPressure() {} + + // + // shmem support + // + + // If this context can be set to use Mozilla's Shmem segments as its backing + // store, this will set it to that state. Note that if you have drawn + // anything into this canvas before changing the shmem state, it will be + // lost. + NS_IMETHOD SetIsIPC(bool isIPC) = 0; + +protected: + RefPtr mCanvasElement; + RefPtr mOffscreenCanvas; + RefPtr mRefreshDriver; +}; + +NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasRenderingContextInternal, + NS_ICANVASRENDERINGCONTEXTINTERNAL_IID) + +#endif /* nsICanvasRenderingContextInternal_h___ */ diff --git a/dom/canvas/test/android.json b/dom/canvas/test/android.json new file mode 100644 index 000000000..6170e32fb --- /dev/null +++ b/dom/canvas/test/android.json @@ -0,0 +1,6 @@ +{ + "runtests": {}, + "excludetests": { + "dom/canvas/test/webgl/test_webgl_conformance_test_suite.html": "" + } +} diff --git a/dom/canvas/test/captureStream_common.js b/dom/canvas/test/captureStream_common.js new file mode 100644 index 000000000..3fca8df4b --- /dev/null +++ b/dom/canvas/test/captureStream_common.js @@ -0,0 +1,250 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/* + * Util base class to help test a captured canvas element. Initializes the + * output canvas (used for testing the color of video elements), and optionally + * overrides the default element |width| and |height|. + */ +function CaptureStreamTestHelper(width, height) { + this.cout = document.createElement('canvas'); + if (width) { + this.elemWidth = width; + } + if (height) { + this.elemHeight = height; + } + this.cout.width = this.elemWidth; + this.cout.height = this.elemHeight; + document.body.appendChild(this.cout); +} + +CaptureStreamTestHelper.prototype = { + /* Predefined colors for use in the methods below. */ + black: { data: [0, 0, 0, 255], name: "black" }, + blackTransparent: { data: [0, 0, 0, 0], name: "blackTransparent" }, + green: { data: [0, 255, 0, 255], name: "green" }, + red: { data: [255, 0, 0, 255], name: "red" }, + blue: { data: [0, 0, 255, 255], name: "blue"}, + grey: { data: [128, 128, 128, 255], name: "grey" }, + + /* Default element size for createAndAppendElement() */ + elemWidth: 100, + elemHeight: 100, + + /* + * Perform the drawing operation on each animation frame until stop is called + * on the returned object. + */ + startDrawing: function (f) { + var stop = false; + var draw = () => { + f(); + if (!stop) { window.requestAnimationFrame(draw); } + }; + draw(); + return { stop: () => stop = true }; + }, + + /* Request a frame from the stream played by |video|. */ + requestFrame: function (video) { + info("Requesting frame from " + video.id); + video.srcObject.requestFrame(); + }, + + /* + * Returns the pixel at (|offsetX|, |offsetY|) (from top left corner) of + * |video| as an array of the pixel's color channels: [R,G,B,A]. Allows + * optional scaling of the drawImage() call (so that a 1x1 black image + * won't just draw 1 pixel in the corner) + */ + getPixel: function (video, offsetX, offsetY, width, height) { + offsetX = offsetX || 0; // Set to 0 if not passed in. + offsetY = offsetY || 0; // Set to 0 if not passed in. + width = width || 0; // Set to 0 if not passed in. + height = height || 0; // Set to 0 if not passed in. + + // Avoids old values in case of a transparent image. + CaptureStreamTestHelper2D.prototype.clear.call(this, this.cout); + + var ctxout = this.cout.getContext('2d'); + if (width != 0 || height != 0) { + ctxout.drawImage(video, 0, 0, width, height); + } else { + ctxout.drawImage(video, 0, 0); + } + return ctxout.getImageData(offsetX, offsetY, 1, 1).data; + }, + + /* + * Returns true if px lies within the per-channel |threshold| of the + * referenced color for all channels. px is on the form of an array of color + * channels, [R,G,B,A]. Each channel is in the range [0, 255]. + */ + isPixel: function (px, refColor, threshold) { + threshold = threshold || 0; // Default to 0 (exact match) if not passed in. + return px.every((ch, i) => Math.abs(ch - refColor.data[i]) <= threshold); + }, + + /* + * Returns true if px lies further away than |threshold| of the + * referenced color for any channel. px is on the form of an array of color + * channels, [R,G,B,A]. Each channel is in the range [0, 255]. + */ + isPixelNot: function (px, refColor, threshold) { + if (threshold === undefined) { + // Default to 127 (should be sufficiently far away) if not passed in. + threshold = 127; + } + return px.some((ch, i) => Math.abs(ch - refColor.data[i]) > threshold); + }, + + /* + * Behaves like isPixelNot but ignores the alpha channel. + */ + isOpaquePixelNot: function(px, refColor, threshold) { + px[3] = refColor.data[3]; + return h.isPixelNot(px, refColor, threshold); + }, + + /* + * Returns a promise that resolves when the provided function |test| + * returns true. + */ + waitForPixel: function (video, offsetX, offsetY, test, timeout, width, height) { + return new Promise(resolve => { + const startTime = video.currentTime; + var ontimeupdate = () => { + var pixelMatch = false; + try { + pixelMatch = test(this.getPixel(video, offsetX, offsetY, width, height)); + } catch (e) { + info("Waiting for pixel but no video available: " + e + "\n" + e.stack); + } + if (!pixelMatch && + (!timeout || video.currentTime < startTime + (timeout / 1000.0))) { + // No match yet and, + // No timeout (waiting indefinitely) or |timeout| has not passed yet. + return; + } + video.removeEventListener("timeupdate", ontimeupdate); + resolve(pixelMatch); + }; + video.addEventListener("timeupdate", ontimeupdate); + }); + }, + + /* + * Returns a promise that resolves when the top left pixel of |video| matches + * on all channels. Use |threshold| for fuzzy matching the color on each + * channel, in the range [0,255]. + */ + waitForPixelColor: function (video, refColor, threshold, infoString) { + info("Waiting for video " + video.id + " to match [" + + refColor.data.join(',') + "] - " + refColor.name + + " (" + infoString + ")"); + return this.waitForPixel(video, 0, 0, + px => this.isPixel(px, refColor, threshold)) + .then(() => ok(true, video.id + " " + infoString)); + }, + + /* + * Returns a promise that resolves after |timeout| ms of playback or when the + * top left pixel of |video| becomes |refColor|. The test is failed if the + * timeout is not reached. + */ + waitForPixelColorTimeout: function (video, refColor, threshold, timeout, infoString) { + info("Waiting for " + video.id + " to time out after " + timeout + + "ms against [" + refColor.data.join(',') + "] - " + refColor.name); + return this.waitForPixel(video, 0, 0, + px => this.isPixel(px, refColor, threshold), + timeout) + .then(result => ok(!result, video.id + " " + infoString)); + }, + + /* Create an element of type |type| with id |id| and append it to the body. */ + createAndAppendElement: function (type, id) { + var e = document.createElement(type); + e.id = id; + e.width = this.elemWidth; + e.height = this.elemHeight; + if (type === 'video') { + e.autoplay = true; + } + document.body.appendChild(e); + return e; + }, +} + +/* Sub class holding 2D-Canvas specific helpers. */ +function CaptureStreamTestHelper2D(width, height) { + CaptureStreamTestHelper.call(this, width, height); +} + +CaptureStreamTestHelper2D.prototype = Object.create(CaptureStreamTestHelper.prototype); +CaptureStreamTestHelper2D.prototype.constructor = CaptureStreamTestHelper2D; + +/* Clear all drawn content on |canvas|. */ +CaptureStreamTestHelper2D.prototype.clear = function(canvas) { + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, canvas.width, canvas.height); +}; + +/* Draw the color |color| to the source canvas |canvas|. Format [R,G,B,A]. */ +CaptureStreamTestHelper2D.prototype.drawColor = function(canvas, color) { + var ctx = canvas.getContext('2d'); + var rgba = color.data.slice(); // Copy to not overwrite the original array + rgba[3] = rgba[3] / 255.0; // Convert opacity to double in range [0,1] + info("Drawing color " + rgba.join(',')); + ctx.fillStyle = "rgba(" + rgba.join(',') + ")"; + + // Only fill top left corner to test that output is not flipped or rotated. + ctx.fillRect(0, 0, canvas.width / 2, canvas.height / 2); +}; + +/* Test that the given 2d canvas is NOT origin-clean. */ +CaptureStreamTestHelper2D.prototype.testNotClean = function(canvas) { + var ctx = canvas.getContext('2d'); + var error = "OK"; + try { + var data = ctx.getImageData(0, 0, 1, 1); + } catch(e) { + error = e.name; + } + is(error, "SecurityError", + "Canvas '" + canvas.id + "' should not be origin-clean"); +}; + +/* Sub class holding WebGL specific helpers. */ +function CaptureStreamTestHelperWebGL(width, height) { + CaptureStreamTestHelper.call(this, width, height); +} + +CaptureStreamTestHelperWebGL.prototype = Object.create(CaptureStreamTestHelper.prototype); +CaptureStreamTestHelperWebGL.prototype.constructor = CaptureStreamTestHelperWebGL; + +/* Set the (uniform) color location for future draw calls. */ +CaptureStreamTestHelperWebGL.prototype.setFragmentColorLocation = function(colorLocation) { + this.colorLocation = colorLocation; +}; + +/* Clear the given WebGL context with |color|. */ +CaptureStreamTestHelperWebGL.prototype.clearColor = function(canvas, color) { + info("WebGL: clearColor(" + color.name + ")"); + var gl = canvas.getContext('webgl'); + var conv = color.data.map(i => i / 255.0); + gl.clearColor(conv[0], conv[1], conv[2], conv[3]); + gl.clear(gl.COLOR_BUFFER_BIT); +}; + +/* Set an already setFragmentColorLocation() to |color| and drawArrays() */ +CaptureStreamTestHelperWebGL.prototype.drawColor = function(canvas, color) { + info("WebGL: drawArrays(" + color.name + ")"); + var gl = canvas.getContext('webgl'); + var conv = color.data.map(i => i / 255.0); + gl.uniform4f(this.colorLocation, conv[0], conv[1], conv[2], conv[3]); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); +}; diff --git a/dom/canvas/test/chrome/chrome.ini b/dom/canvas/test/chrome/chrome.ini new file mode 100644 index 000000000..6f7c96c27 --- /dev/null +++ b/dom/canvas/test/chrome/chrome.ini @@ -0,0 +1,8 @@ +[DEFAULT] +skip-if = os == 'android' +support-files = nonchrome_webgl_debug_renderer_info.html + +[test_webgl_debug_renderer_info.html] +subsuite = gpu +[test_drawWindow_widget_layers.html] +support-files = ../file_drawWindow_source.html ../file_drawWindow_common.js diff --git a/dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html b/dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html new file mode 100644 index 000000000..4668f2baf --- /dev/null +++ b/dom/canvas/test/chrome/nonchrome_webgl_debug_renderer_info.html @@ -0,0 +1,83 @@ + + + + diff --git a/dom/canvas/test/chrome/test_drawWindow_widget_layers.html b/dom/canvas/test/chrome/test_drawWindow_widget_layers.html new file mode 100644 index 000000000..a1f357f5a --- /dev/null +++ b/dom/canvas/test/chrome/test_drawWindow_widget_layers.html @@ -0,0 +1,54 @@ + + + + + Test for canvas drawWindow + + + + + + + +Mozilla Bug + + diff --git a/dom/canvas/test/chrome/test_webgl_debug_renderer_info.html b/dom/canvas/test/chrome/test_webgl_debug_renderer_info.html new file mode 100644 index 000000000..9d4d38c3c --- /dev/null +++ b/dom/canvas/test/chrome/test_webgl_debug_renderer_info.html @@ -0,0 +1,102 @@ + + + + + Test for WEBGL_debug_renderer_info chrome-only extension + + + + + + +
+
+
+ + diff --git a/dom/canvas/test/crash/1251091-1.png b/dom/canvas/test/crash/1251091-1.png new file mode 100644 index 000000000..078b19a56 Binary files /dev/null and b/dom/canvas/test/crash/1251091-1.png differ diff --git a/dom/canvas/test/crash/file_1251091-1.html b/dom/canvas/test/crash/file_1251091-1.html new file mode 100644 index 000000000..520a393b4 --- /dev/null +++ b/dom/canvas/test/crash/file_1251091-1.html @@ -0,0 +1,51 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dom/canvas/test/crash/file_616401.html b/dom/canvas/test/crash/file_616401.html new file mode 100644 index 000000000..eb5a0bcf4 --- /dev/null +++ b/dom/canvas/test/crash/file_616401.html @@ -0,0 +1,8 @@ + + diff --git a/dom/canvas/test/crash/file_798802-1.html b/dom/canvas/test/crash/file_798802-1.html new file mode 100644 index 000000000..92ab50fd8 --- /dev/null +++ b/dom/canvas/test/crash/file_798802-1.html @@ -0,0 +1,18 @@ + + + + + + + diff --git a/dom/canvas/test/crash/file_bug1233613.html b/dom/canvas/test/crash/file_bug1233613.html new file mode 100644 index 000000000..d949c3b21 --- /dev/null +++ b/dom/canvas/test/crash/file_bug1233613.html @@ -0,0 +1,19 @@ + + diff --git a/dom/canvas/test/crash/file_texImage2D.html b/dom/canvas/test/crash/file_texImage2D.html new file mode 100644 index 000000000..370b00857 --- /dev/null +++ b/dom/canvas/test/crash/file_texImage2D.html @@ -0,0 +1,8 @@ + + + diff --git a/dom/canvas/test/crash/mochitest.ini b/dom/canvas/test/crash/mochitest.ini new file mode 100644 index 000000000..4f2f7776e --- /dev/null +++ b/dom/canvas/test/crash/mochitest.ini @@ -0,0 +1,16 @@ +[DEFAULT] +subsuite = webgl +support-files = + file_bug1233613.html + file_texImage2D.html + file_616401.html + file_798802-1.html + file_1251091-1.html + 1251091-1.png + +[test_bug1233613.html] +[test_texImage2D.html] +[test_616401.html] +[test_798802-1.html] +[test_1251091-1.html] +[test_createImageBitmap-video.html] diff --git a/dom/canvas/test/crash/test_1251091-1.html b/dom/canvas/test/crash/test_1251091-1.html new file mode 100644 index 000000000..77dbe16d8 --- /dev/null +++ b/dom/canvas/test/crash/test_1251091-1.html @@ -0,0 +1,30 @@ + + + + + Test for webgl crashing + + + + + + + + + + diff --git a/dom/canvas/test/crash/test_616401.html b/dom/canvas/test/crash/test_616401.html new file mode 100644 index 000000000..e496a7384 --- /dev/null +++ b/dom/canvas/test/crash/test_616401.html @@ -0,0 +1,30 @@ + + + + + Test for webgl crashing + + + + + + + + + + diff --git a/dom/canvas/test/crash/test_798802-1.html b/dom/canvas/test/crash/test_798802-1.html new file mode 100644 index 000000000..701bfeaab --- /dev/null +++ b/dom/canvas/test/crash/test_798802-1.html @@ -0,0 +1,30 @@ + + + + + Test for webgl crashing + + + + + + + + + + diff --git a/dom/canvas/test/crash/test_bug1233613.html b/dom/canvas/test/crash/test_bug1233613.html new file mode 100644 index 000000000..047318900 --- /dev/null +++ b/dom/canvas/test/crash/test_bug1233613.html @@ -0,0 +1,30 @@ + + + + + Test for webgl crashing + + + + + + + + + + diff --git a/dom/canvas/test/crash/test_createImageBitmap-video.html b/dom/canvas/test/crash/test_createImageBitmap-video.html new file mode 100644 index 000000000..7a858688c --- /dev/null +++ b/dom/canvas/test/crash/test_createImageBitmap-video.html @@ -0,0 +1,34 @@ + + + + + Test for canvas crashing + + + + + + + + + + diff --git a/dom/canvas/test/crash/test_texImage2D.html b/dom/canvas/test/crash/test_texImage2D.html new file mode 100644 index 000000000..4f299621a --- /dev/null +++ b/dom/canvas/test/crash/test_texImage2D.html @@ -0,0 +1,30 @@ + + + + + Test for webgl crashing + + + + + + + + + + diff --git a/dom/canvas/test/crossorigin/image-allow-credentials.png b/dom/canvas/test/crossorigin/image-allow-credentials.png new file mode 100644 index 000000000..df24ac6d3 Binary files /dev/null and b/dom/canvas/test/crossorigin/image-allow-credentials.png differ diff --git a/dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ b/dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ new file mode 100644 index 000000000..a03f99a9c --- /dev/null +++ b/dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ @@ -0,0 +1,2 @@ +Access-Control-Allow-Origin: http://mochi.test:8888 +Access-Control-Allow-Credentials: true diff --git a/dom/canvas/test/crossorigin/image-allow-star.png b/dom/canvas/test/crossorigin/image-allow-star.png new file mode 100644 index 000000000..df24ac6d3 Binary files /dev/null and b/dom/canvas/test/crossorigin/image-allow-star.png differ diff --git a/dom/canvas/test/crossorigin/image-allow-star.png^headers^ b/dom/canvas/test/crossorigin/image-allow-star.png^headers^ new file mode 100644 index 000000000..cb762eff8 --- /dev/null +++ b/dom/canvas/test/crossorigin/image-allow-star.png^headers^ @@ -0,0 +1 @@ +Access-Control-Allow-Origin: * diff --git a/dom/canvas/test/crossorigin/image.png b/dom/canvas/test/crossorigin/image.png new file mode 100644 index 000000000..df24ac6d3 Binary files /dev/null and b/dom/canvas/test/crossorigin/image.png differ diff --git a/dom/canvas/test/crossorigin/mochitest.ini b/dom/canvas/test/crossorigin/mochitest.ini new file mode 100644 index 000000000..d39872b13 --- /dev/null +++ b/dom/canvas/test/crossorigin/mochitest.ini @@ -0,0 +1,15 @@ +[DEFAULT] +support-files = + image-allow-credentials.png + image-allow-credentials.png^headers^ + image-allow-star.png + image-allow-star.png^headers^ + image.png + video.sjs + +[test_canvas2d_crossorigin.html] +[test_video_crossorigin.html] +subsuite = gpu +[test_webgl_crossorigin_textures.html] +subsuite = gpu + diff --git a/dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html b/dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html new file mode 100644 index 000000000..ef8ba96dc --- /dev/null +++ b/dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html @@ -0,0 +1,212 @@ + + + + + Test for Bug 685518 + + + + +Mozilla Bug 685518 +

+ +
+
+
+ + diff --git a/dom/canvas/test/crossorigin/test_video_crossorigin.html b/dom/canvas/test/crossorigin/test_video_crossorigin.html new file mode 100644 index 000000000..0ac69ac1a --- /dev/null +++ b/dom/canvas/test/crossorigin/test_video_crossorigin.html @@ -0,0 +1,219 @@ + + + + + Test for Bug 682299 + + + + + +Mozilla Bug 682299 +

+ +
+
+
+ + diff --git a/dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html b/dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html new file mode 100644 index 000000000..545048a34 --- /dev/null +++ b/dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html @@ -0,0 +1,143 @@ + +WebGL cross-origin textures test + + + + +

FAIL (fallback content)

+
+ diff --git a/dom/canvas/test/crossorigin/video.sjs b/dom/canvas/test/crossorigin/video.sjs new file mode 100644 index 000000000..5b154d0e6 --- /dev/null +++ b/dom/canvas/test/crossorigin/video.sjs @@ -0,0 +1,43 @@ +function parseQuery(request, key) { + var params = request.queryString.split('&'); + for (var j = 0; j < params.length; ++j) { + var p = params[j]; + if (p == key) + return true; + if (p.indexOf(key + "=") == 0) + return p.substring(key.length + 1); + if (p.indexOf("=") < 0 && key == "") + return p; + } + return false; +} + +function handleRequest(request, response) { + var name = parseQuery(request, "name"); + var type = parseQuery(request, "type"); + var cors = parseQuery(request, "cors"); + var file = Components.classes["@mozilla.org/file/directory_service;1"]. + getService(Components.interfaces.nsIProperties). + get("CurWorkD", Components.interfaces.nsILocalFile); + var fis = Components.classes['@mozilla.org/network/file-input-stream;1']. + createInstance(Components.interfaces.nsIFileInputStream); + var bis = Components.classes["@mozilla.org/binaryinputstream;1"]. + createInstance(Components.interfaces.nsIBinaryInputStream); + var split = name.split("/"); + for(var i = 0; i < split.length; ++i) { + file.append(split[i]); + } + fis.init(file, -1, -1, false); + bis.setInputStream(fis); + var bytes = bis.readBytes(bis.available()); + response.setHeader("Content-Length", ""+bytes.length, false); + response.setHeader("Content-Type", type, false); + if (cors == "anonymous") { + response.setHeader("Access-Control-Allow-Origin", "*", false); + } else if (cors == "use-credentials") { + response.setHeader("Access-Control-Allow-Origin", "http://mochi.test:8888", false); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + } + response.write(bytes, bytes.length); + bis.close(); +} diff --git a/dom/canvas/test/file_drawImage_document_domain.html b/dom/canvas/test/file_drawImage_document_domain.html new file mode 100644 index 000000000..fa31251bd --- /dev/null +++ b/dom/canvas/test/file_drawImage_document_domain.html @@ -0,0 +1,30 @@ + + + + diff --git a/dom/canvas/test/file_drawWindow_common.js b/dom/canvas/test/file_drawWindow_common.js new file mode 100644 index 000000000..2f4c385d3 --- /dev/null +++ b/dom/canvas/test/file_drawWindow_common.js @@ -0,0 +1,159 @@ +const CANVAS_WIDTH = 200; +const CANVAS_HEIGHT = 100; + +function runDrawWindowTests(win, drawWindowFlags, transparentBackground) { + + function make_canvas() { + var canvas = document.createElement("canvas"); + canvas.setAttribute("height", CANVAS_HEIGHT); + canvas.setAttribute("width", CANVAS_WIDTH); + document.body.appendChild(canvas); + return canvas; + } + + var testCanvas = make_canvas(); + var refCanvas = make_canvas(); + + var testCx = testCanvas.getContext("2d"); + var refCx = refCanvas.getContext("2d"); + + var testWrapCx = SpecialPowers.wrap(testCx); + var refWrapCx = SpecialPowers.wrap(refCx); + + function clearRef(fillStyle) { + refCx.setTransform(1, 0, 0, 1, 0, 0); + refCx.fillStyle = fillStyle; + refCx.fillRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); + } + function clearTest(fillStyle) { + testCx.setTransform(1, 0, 0, 1, 0, 0); + testCx.fillStyle = fillStyle; + testCx.fillRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); + } + function clear(fillStyle) { + clearRef(fillStyle); + clearTest(fillStyle); + } + + // Basic tests of drawing the whole document on a background + + clear("white"); + testWrapCx.drawWindow(win, 0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, + "rgb(255, 255, 255)", drawWindowFlags); + refCx.fillStyle = "fuchsia"; + refCx.fillRect(10, 10, 20, 20); + refCx.fillStyle = "aqua"; + refCx.fillRect(50, 10, 20, 20); + refCx.fillStyle = "yellow"; + refCx.fillRect(90, 10, 20, 20); + assertSnapshots(testCanvas, refCanvas, true /* equal */, null /*no fuzz*/, + "full draw of source on white background", "reference"); + + clearTest("white"); + testWrapCx.drawWindow(win, 0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, + "rgb(255, 255, 0)", drawWindowFlags); + assertSnapshots(testCanvas, refCanvas, + !transparentBackground /* not equal */, null /*no fuzz*/, + "full draw of source on yellow background", "reference"); + + clearRef("yellow"); + refCx.fillStyle = "fuchsia"; + refCx.fillRect(10, 10, 20, 20); + refCx.fillStyle = "aqua"; + refCx.fillRect(50, 10, 20, 20); + refCx.fillStyle = "yellow"; + refCx.fillRect(90, 10, 20, 20); + + assertSnapshots(testCanvas, refCanvas, transparentBackground /* equal */, + null /*no fuzz*/, + "full draw of source on yellow background", "reference"); + + // Test drawing a region within the document. + + clear("white"); + + testCx.translate(17, 31); + testWrapCx.drawWindow(win, 40, 0, 40, 40, + "white", drawWindowFlags); + + refCx.fillStyle = "aqua"; + refCx.fillRect(17 + 10, 31 + 10, 20, 20); + + assertSnapshots(testCanvas, refCanvas, true /* equal */, null /*no fuzz*/, + "draw of subrect of source with matching background", + "reference"); + + clear("blue"); + + testCx.translate(17, 31); + testWrapCx.drawWindow(win, 40, 0, 35, 45, + "green", drawWindowFlags); + + if (transparentBackground) { + refCx.fillStyle = "green"; + } else { + refCx.fillStyle = "white"; + } + refCx.fillRect(17, 31, 35, 45); + refCx.fillStyle = "aqua"; + refCx.fillRect(17 + 10, 31 + 10, 20, 20); + + assertSnapshots(testCanvas, refCanvas, true /* equal */, null /*no fuzz*/, + "draw of subrect of source with different background", + "reference"); + + // Test transparency of background not disturbing what is behind + clear("blue"); + + testCx.translate(17, 31); + testWrapCx.drawWindow(win, 40, 0, 35, 45, + "transparent", drawWindowFlags); + + if (!transparentBackground) { + refCx.fillStyle = "white"; + refCx.fillRect(17, 31, 35, 45); + } + refCx.fillStyle = "aqua"; + refCx.fillRect(17 + 10, 31 + 10, 20, 20); + + assertSnapshots(testCanvas, refCanvas, true /* equal */, null /*no fuzz*/, + "draw of subrect of source with different background", + "reference"); + + // Test that multiple drawWindow calls draw at correct positions. + clear("blue"); + + testCx.translate(9, 3); + // 5, 8 is 5, 2 from the corner of the fuchsia square + testWrapCx.drawWindow(win, 5, 8, 30, 25, + "maroon", drawWindowFlags); + // 35, 0 is 15, 10 from the corner of the aqua square + testWrapCx.drawWindow(win, 35, 0, 50, 40, + "transparent", drawWindowFlags); + testCx.translate(15, 0); + // 85, 5 is 5, 5 from the corner of the yellow square + testWrapCx.drawWindow(win, 85, 5, 30, 25, + "transparent", drawWindowFlags); + + if (transparentBackground) { + refCx.fillStyle = "maroon"; + refCx.fillRect(9, 3, 30, 25); + refCx.fillStyle = "fuchsia"; + refCx.fillRect(9 + 5, 3 + 2, 20, 20); + } else { + refCx.fillStyle = "white"; + refCx.fillRect(9, 3, 50, 40); + } + refCx.fillStyle = "aqua"; + refCx.fillRect(9 + 15, 3 + 10, 20, 20); + if (!transparentBackground) { + refCx.fillStyle = "white"; + refCx.fillRect(9 + 15, 3, 30, 25); + } + refCx.fillStyle = "yellow"; + refCx.fillRect(9 + 15 + 5, 3 + 0 + 5, 20, 20); + + assertSnapshots(testCanvas, refCanvas, true /* equal */, null /*no fuzz*/, + "multiple drawWindow calls on top of each other", + "reference"); +} diff --git a/dom/canvas/test/file_drawWindow_source.html b/dom/canvas/test/file_drawWindow_source.html new file mode 100644 index 000000000..cd536e4b6 --- /dev/null +++ b/dom/canvas/test/file_drawWindow_source.html @@ -0,0 +1,10 @@ + +
diff --git a/dom/canvas/test/image_anim-gr.gif b/dom/canvas/test/image_anim-gr.gif new file mode 100644 index 000000000..45263e0af Binary files /dev/null and b/dom/canvas/test/image_anim-gr.gif differ diff --git a/dom/canvas/test/image_anim-gr.png b/dom/canvas/test/image_anim-gr.png new file mode 100644 index 000000000..925e2efc9 Binary files /dev/null and b/dom/canvas/test/image_anim-gr.png differ diff --git a/dom/canvas/test/image_anim-poster-gr.png b/dom/canvas/test/image_anim-poster-gr.png new file mode 100644 index 000000000..694120737 Binary files /dev/null and b/dom/canvas/test/image_anim-poster-gr.png differ diff --git a/dom/canvas/test/image_broken.png b/dom/canvas/test/image_broken.png new file mode 100644 index 000000000..f2581017b Binary files /dev/null and b/dom/canvas/test/image_broken.png differ diff --git a/dom/canvas/test/image_error-early.png b/dom/canvas/test/image_error-early.png new file mode 100644 index 000000000..5df7507e2 --- /dev/null +++ b/dom/canvas/test/image_error-early.png @@ -0,0 +1 @@ +ERROR diff --git a/dom/canvas/test/image_ggrr-256x256.png b/dom/canvas/test/image_ggrr-256x256.png new file mode 100644 index 000000000..0342e4a38 Binary files /dev/null and b/dom/canvas/test/image_ggrr-256x256.png differ diff --git a/dom/canvas/test/image_green-16x16.png b/dom/canvas/test/image_green-16x16.png new file mode 100644 index 000000000..e19a3ffdd Binary files /dev/null and b/dom/canvas/test/image_green-16x16.png differ diff --git a/dom/canvas/test/image_green-1x1.png b/dom/canvas/test/image_green-1x1.png new file mode 100644 index 000000000..862d1dd10 Binary files /dev/null and b/dom/canvas/test/image_green-1x1.png differ diff --git a/dom/canvas/test/image_green-redirect b/dom/canvas/test/image_green-redirect new file mode 100644 index 000000000..e69de29bb diff --git a/dom/canvas/test/image_green-redirect^headers^ b/dom/canvas/test/image_green-redirect^headers^ new file mode 100644 index 000000000..a5b6cb744 --- /dev/null +++ b/dom/canvas/test/image_green-redirect^headers^ @@ -0,0 +1,2 @@ +HTTP 302 Moved +Location: http://example.com/tests/dom/canvas/test/image_green-1x1.png diff --git a/dom/canvas/test/image_green.png b/dom/canvas/test/image_green.png new file mode 100644 index 000000000..28a1faab3 Binary files /dev/null and b/dom/canvas/test/image_green.png differ diff --git a/dom/canvas/test/image_red-16x16.png b/dom/canvas/test/image_red-16x16.png new file mode 100644 index 000000000..9038fef78 Binary files /dev/null and b/dom/canvas/test/image_red-16x16.png differ diff --git a/dom/canvas/test/image_red.png b/dom/canvas/test/image_red.png new file mode 100644 index 000000000..a6e195d59 Binary files /dev/null and b/dom/canvas/test/image_red.png differ diff --git a/dom/canvas/test/image_red_crossorigin_credentials.png b/dom/canvas/test/image_red_crossorigin_credentials.png new file mode 100644 index 000000000..a6e195d59 Binary files /dev/null and b/dom/canvas/test/image_red_crossorigin_credentials.png differ diff --git a/dom/canvas/test/image_red_crossorigin_credentials.png^headers^ b/dom/canvas/test/image_red_crossorigin_credentials.png^headers^ new file mode 100644 index 000000000..a03f99a9c --- /dev/null +++ b/dom/canvas/test/image_red_crossorigin_credentials.png^headers^ @@ -0,0 +1,2 @@ +Access-Control-Allow-Origin: http://mochi.test:8888 +Access-Control-Allow-Credentials: true diff --git a/dom/canvas/test/image_redtransparent.png b/dom/canvas/test/image_redtransparent.png new file mode 100644 index 000000000..75da08c3d Binary files /dev/null and b/dom/canvas/test/image_redtransparent.png differ diff --git a/dom/canvas/test/image_rgrg-256x256.png b/dom/canvas/test/image_rgrg-256x256.png new file mode 100644 index 000000000..e6fba3daa Binary files /dev/null and b/dom/canvas/test/image_rgrg-256x256.png differ diff --git a/dom/canvas/test/image_rrgg-256x256.png b/dom/canvas/test/image_rrgg-256x256.png new file mode 100644 index 000000000..7f6351565 Binary files /dev/null and b/dom/canvas/test/image_rrgg-256x256.png differ diff --git a/dom/canvas/test/image_transparent.png b/dom/canvas/test/image_transparent.png new file mode 100644 index 000000000..2b498699a Binary files /dev/null and b/dom/canvas/test/image_transparent.png differ diff --git a/dom/canvas/test/image_transparent50.png b/dom/canvas/test/image_transparent50.png new file mode 100644 index 000000000..55f8e6932 Binary files /dev/null and b/dom/canvas/test/image_transparent50.png differ diff --git a/dom/canvas/test/image_yellow.png b/dom/canvas/test/image_yellow.png new file mode 100644 index 000000000..51e8aaf38 Binary files /dev/null and b/dom/canvas/test/image_yellow.png differ diff --git a/dom/canvas/test/image_yellow75.png b/dom/canvas/test/image_yellow75.png new file mode 100644 index 000000000..2bb82c983 Binary files /dev/null and b/dom/canvas/test/image_yellow75.png differ diff --git a/dom/canvas/test/imagebitmap_bug1239300.js b/dom/canvas/test/imagebitmap_bug1239300.js new file mode 100644 index 000000000..58af7cd0e --- /dev/null +++ b/dom/canvas/test/imagebitmap_bug1239300.js @@ -0,0 +1,19 @@ +function testBug1239300() { + return new Promise(function(resolve, reject) { + createImageBitmap(new Blob()).then( + function() { + ok(false, "The promise should be rejected with InvalidStateError."); + reject(); + }, + function(result) { + if (result.name == "InvalidStateError") { + ok(true, "The promise should be rejected with InvalidStateError."); + resolve(); + } else { + ok(false, "The promise should be rejected with InvalidStateError."); + reject(); + } + } + ); + }); +} \ No newline at end of file diff --git a/dom/canvas/test/imagebitmap_bug1239752.js b/dom/canvas/test/imagebitmap_bug1239752.js new file mode 100644 index 000000000..86e9d6f52 --- /dev/null +++ b/dom/canvas/test/imagebitmap_bug1239752.js @@ -0,0 +1,85 @@ +var RGBAValues = [[42,142,23,148], + [234,165,177,91], + [74,228,75,195], + [140,108,73,65], + [25,177,3,201], + [127,104,12,199], + [196,93,240,131], + [250,121,231,189], + [175,131,215,190], + [145,122,166,70], + [18,196,210,162], + [225,1,90,188], + [223,216,182,233], + [115,48,168,56], + [50,206,198,199], + [152,28,70,130], + [176,134,133,51], + [148,46,43,144], + [78,171,141,95], + [24,177,102,110], + [0,27,127,91], + [31,221,41,170], + [85,7,218,146], + [65,30,198,238], + [121,56,123,88], + [246,39,140,146], + [174,195,254,149], + [29,153,92,116], + [17,240,5,111], + [38,162,84,143], + [237,159,201,244], + [93,68,14,246], + [143,142,82,221], + [187,215,243,154], + [24,121,220,53], + [80,153,151,219], + [202,241,250,191]]; + +function createOneTest(rgbaValue) { + return new Promise(function(resolve, reject) { + var tolerance = 5; + var r = rgbaValue[0]; + var g = rgbaValue[1]; + var b = rgbaValue[2]; + var a = rgbaValue[3]; + var imageData = new ImageData(new Uint8ClampedArray([r, g, b, a]), 1, 1); + + var newImageData; + createImageBitmap(imageData).then( + function(imageBitmap) { + var context = document.createElement("canvas").getContext("2d"); + context.drawImage(imageBitmap, 0, 0); + newImageData = context.getImageData(0, 0, 1, 1); + var newR = newImageData.data[0]; + var newG = newImageData.data[1]; + var newB = newImageData.data[2]; + var newA = newImageData.data[3]; + var isTheSame = Math.abs(r - newR) <= tolerance && + Math.abs(g - newG) <= tolerance && + Math.abs(b - newB) <= tolerance && + Math.abs(a - newA) <= tolerance; + ok(isTheSame, "newImageData(" + newR + "," + newG + "," + newB + "," + newA + + ") should equal to imageData(" + r + "," + g + "," + b + "," + a + ")." + + "Premultiplied Alpha is handled while creating ImageBitmap from ImageData."); + if (isTheSame) { + resolve(); + } else { + reject(); + } + }, + function() { + reject(); + } + ); + }); +} + +function testBug1239752() { + var tests = []; + for (var i = 0; i < RGBAValues.length; ++i) { + tests.push(createOneTest(RGBAValues[i])); + } + + return Promise.all(tests); +} \ No newline at end of file diff --git a/dom/canvas/test/imagebitmap_extensions.html b/dom/canvas/test/imagebitmap_extensions.html new file mode 100644 index 000000000..d66fe9ad1 --- /dev/null +++ b/dom/canvas/test/imagebitmap_extensions.html @@ -0,0 +1,49 @@ + + + Test ImageBitmap Extensions (Bug 1141979) + + + + + + + + + + diff --git a/dom/canvas/test/imagebitmap_extensions.js b/dom/canvas/test/imagebitmap_extensions.js new file mode 100644 index 000000000..21b0a7152 --- /dev/null +++ b/dom/canvas/test/imagebitmap_extensions.js @@ -0,0 +1,526 @@ +function failed(ex) { + ok(false, "Promise failure: " + ex); +} + +function isPixel(sourceType, bitmapFormat, imageData, bitmapImageData, x, y, tolerance) { + if (imageData.width != bitmapImageData.width || + imageData.height != bitmapImageData.height) { + ok(false, "Wrong dimension"); + } + + var index = 4 * (y * imageData.width + x); + + var pr = imageData.data[index+0], + pg = imageData.data[index+1], + pb = imageData.data[index+2], + pa = imageData.data[index+3]; + + if (bitmapFormat == "RGBA32" || bitmapFormat == "RGBX32") { + var bpr = bitmapImageData.data[index+0], + bpg = bitmapImageData.data[index+1], + bpb = bitmapImageData.data[index+2], + bpa = bitmapImageData.data[index+3]; + } + else if (bitmapFormat == "BGRA32" || bitmapFormat == "BGRX32") { + var bpb = bitmapImageData.data[index+0], + bpg = bitmapImageData.data[index+1], + bpr = bitmapImageData.data[index+2], + bpa = bitmapImageData.data[index+3]; + } + else { + // format might be one of the followings: "R5G6B5", "A8", "YUV", "" + ok(false, "Not supported ImageFormat: " + bitmapFormat); + } + + ok(pr - tolerance <= bpr && bpr <= pr + tolerance && + pg - tolerance <= bpg && bpg <= pg + tolerance && + pb - tolerance <= bpb && bpb <= pb + tolerance && + pa - tolerance <= bpa && bpa <= pa + tolerance, + "pixel[" + x + "][" + y + "]: " + sourceType + " is "+pr+","+pg+","+pb+","+pa+"; ImageBitmap is "+ bpr + "," + bpg + "," + bpb + "," + bpa); +} + +function promiseThrows(p, name) { + var didThrow; + return p.then(function() { didThrow = false; }, + function() { didThrow = true; }) + .then(function() { ok(didThrow, name); }); +} + +function testExceptions() { + return Promise.all([ + promiseThrows(testColorConversion("GRAY8", "RGBA32", undefined, true), "[Exception] Cannot convert from GRAY8 to RGBA32"), + promiseThrows(testColorConversion("GRAY8", "BGRA32", undefined, true), "[Exception] Cannot convert from GRAY8 to BGRA32"), + promiseThrows(testColorConversion("GRAY8", "RGB24", undefined, true), "[Exception] Cannot convert from GRAY8 to RGB24"), + promiseThrows(testColorConversion("GRAY8", "BGR24", undefined, true), "[Exception] Cannot convert from GRAY8 to BGR24"), + promiseThrows(testColorConversion("GRAY8", "YUV444P", undefined, true), "[Exception] Cannot convert from GRAY8 to YUV444P"), + promiseThrows(testColorConversion("GRAY8", "YUV422P", undefined, true), "[Exception] Cannot convert from GRAY8 to YUV422P"), + promiseThrows(testColorConversion("GRAY8", "YUV420P", undefined, true), "[Exception] Cannot convert from GRAY8 to YUV420P"), + promiseThrows(testColorConversion("GRAY8", "YUV420SP_NV12", undefined, true), "[Exception] Cannot convert from GRAY8 to YUV420SP_NV12"), + promiseThrows(testColorConversion("GRAY8", "YUV420SP_NV21", undefined, true), "[Exception] Cannot convert from GRAY8 to YUV420SP_NV21"), + promiseThrows(testColorConversion("GRAY8", "HSV", undefined, true), "[Exception] Cannot convert from GRAY8 to HSV"), + promiseThrows(testColorConversion("GRAY8", "Lab", undefined, true), "[Exception] Cannot convert from GRAY8 to Lab"), + promiseThrows(testColorConversion("GRAY8", "DEPTH", undefined, true), "[Exception] Cannot convert from GRAY8 to DEPTH"), + + promiseThrows(testColorConversion("DEPTH", "RGBA32", undefined, true), "[Exception] Cannot convert from DEPTH to RGBA32"), + promiseThrows(testColorConversion("DEPTH", "BGRA32", undefined, true), "[Exception] Cannot convert from DEPTH to BGRA32"), + promiseThrows(testColorConversion("DEPTH", "RGB24", undefined, true), "[Exception] Cannot convert from DEPTH to RGB24"), + promiseThrows(testColorConversion("DEPTH", "BGR24", undefined, true), "[Exception] Cannot convert from DEPTH to BGR24"), + promiseThrows(testColorConversion("DEPTH", "GRAY8", undefined, true), "[Exception] Cannot convert from DEPTH to GRAY8"), + promiseThrows(testColorConversion("DEPTH", "YUV444P", undefined, true), "[Exception] Cannot convert from DEPTH to YUV444P"), + promiseThrows(testColorConversion("DEPTH", "YUV422P", undefined, true), "[Exception] Cannot convert from DEPTH to YUV422P"), + promiseThrows(testColorConversion("DEPTH", "YUV420P", undefined, true), "[Exception] Cannot convert from DEPTH to YUV420P"), + promiseThrows(testColorConversion("DEPTH", "YUV420SP_NV12", undefined, true), "[Exception] Cannot convert from DEPTH to YUV420SP_NV12"), + promiseThrows(testColorConversion("DEPTH", "YUV420SP_NV21", undefined, true), "[Exception] Cannot convert from DEPTH to YUV420SP_NV21"), + promiseThrows(testColorConversion("DEPTH", "HSV", undefined, true), "[Exception] Cannot convert from DEPTH to HSV"), + promiseThrows(testColorConversion("DEPTH", "Lab", undefined, true), "[Exception] Cannot convert from DEPTH to Lab"), + + promiseThrows(testColorConversion("RGBA32", "DEPTH", undefined, true), "[Exception] Cannot convert from RGBA32 to DEPTH"), + promiseThrows(testColorConversion("BGRA32", "DEPTH", undefined, true), "[Exception] Cannot convert from BGRA32 to DEPTH"), + promiseThrows(testColorConversion("RGB24", "DEPTH", undefined, true), "[Exception] Cannot convert from RGB24 to DEPTH"), + promiseThrows(testColorConversion("BGR24", "DEPTH", undefined, true), "[Exception] Cannot convert from BGR24 to DEPTH"), + promiseThrows(testColorConversion("YUV444P", "DEPTH", undefined, true), "[Exception] Cannot convert from YUV444P to DEPTH"), + promiseThrows(testColorConversion("YUV422P", "DEPTH", undefined, true), "[Exception] Cannot convert from YUV422P to DEPTH"), + promiseThrows(testColorConversion("YUV420P", "DEPTH", undefined, true), "[Exception] Cannot convert from YUV420P to DEPTH"), + promiseThrows(testColorConversion("YUV420SP_NV12", "DEPTH", undefined, true), "[Exception] Cannot convert from YUV420SP_NV12 to DEPTH"), + promiseThrows(testColorConversion("YUV420SP_NV21", "DEPTH", undefined, true), "[Exception] Cannot convert from YUV420SP_NV21 to DEPTH"), + promiseThrows(testColorConversion("HSV", "DEPTH", undefined, true), "[Exception] Cannot convert from HSV to DEPTH"), + promiseThrows(testColorConversion("Lab", "DEPTH", undefined, true), "[Exception] Cannot convert from Lab to DEPTH"), + ]); +} + +function testInvalidAccess(sources) { + + function callMapDataIntoWithImageBitmapCroppedOutSideOfTheSourceImage(source) { + return new Promise(function(resolve, reject) { + var p = createImageBitmap(source, -1, -1, 2, 2); + p.then( + function(bitmap) { + var format = bitmap.findOptimalFormat(); + var length = bitmap.mappedDataLength(format); + var buffer = new ArrayBuffer(length); + bitmap.mapDataInto(format, buffer, 0).then( + function(layout) { resolve(); }, + function(error) { reject(error); } + ); + }, + function() { resolve(); }); + }); + }; + + var testCases = sources.map( function(source) { + return promiseThrows(callMapDataIntoWithImageBitmapCroppedOutSideOfTheSourceImage(source), + "[Exception] mapDataInto() should throw with transparent black."); }); + + return Promise.all(testCases); +} + +function testColorConversions() { + return Promise.all([// From RGBA32 + testColorConversion("RGBA32", "RGBA32"), + testColorConversion("RGBA32", "BGRA32"), + testColorConversion("RGBA32", "RGB24"), + testColorConversion("RGBA32", "BGR24"), + testColorConversion("RGBA32", "GRAY8"), + testColorConversion("RGBA32", "YUV444P"), + testColorConversion("RGBA32", "YUV422P"), + testColorConversion("RGBA32", "YUV420P", 2), + testColorConversion("RGBA32", "YUV420SP_NV12"), + testColorConversion("RGBA32", "YUV420SP_NV21"), + testColorConversion("RGBA32", "HSV", 0.01), + testColorConversion("RGBA32", "Lab", 0.5), + + // From BGRA32 + testColorConversion("BGRA32", "RGBA32"), + testColorConversion("BGRA32", "BGRA32"), + testColorConversion("BGRA32", "RGB24"), + testColorConversion("BGRA32", "BGR24"), + testColorConversion("BGRA32", "GRAY8"), + testColorConversion("BGRA32", "YUV444P", 3), + testColorConversion("BGRA32", "YUV422P", 2), + testColorConversion("BGRA32", "YUV420P", 2), + testColorConversion("BGRA32", "YUV420SP_NV12", 2), + testColorConversion("BGRA32", "YUV420SP_NV21", 2), + testColorConversion("BGRA32", "HSV", 0.01), + testColorConversion("BGRA32", "Lab", 0.5), + + // From RGB24 + testColorConversion("RGB24", "RGBA32"), + testColorConversion("RGB24", "BGRA32"), + testColorConversion("RGB24", "RGB24"), + testColorConversion("RGB24", "BGR24"), + testColorConversion("RGB24", "GRAY8"), + testColorConversion("RGB24", "YUV444P"), + testColorConversion("RGB24", "YUV422P"), + testColorConversion("RGB24", "YUV420P"), + testColorConversion("RGB24", "YUV420SP_NV12"), + testColorConversion("RGB24", "YUV420SP_NV21"), + testColorConversion("RGB24", "HSV", 0.01), + testColorConversion("RGB24", "Lab", 0.5), + + // From BGR24 + testColorConversion("BGR24", "RGBA32"), + testColorConversion("BGR24", "BGRA32"), + testColorConversion("BGR24", "RGB24"), + testColorConversion("BGR24", "BGR24"), + testColorConversion("BGR24", "GRAY8"), + testColorConversion("BGR24", "YUV444P"), + testColorConversion("BGR24", "YUV422P"), + testColorConversion("BGR24", "YUV420P"), + testColorConversion("BGR24", "YUV420SP_NV12"), + testColorConversion("BGR24", "YUV420SP_NV21"), + testColorConversion("BGR24", "HSV", 0.01), + testColorConversion("BGR24", "Lab", 0.5), + + // From YUV444P + testColorConversion("YUV444P", "RGBA32"), + testColorConversion("YUV444P", "BGRA32"), + testColorConversion("YUV444P", "RGB24"), + testColorConversion("YUV444P", "BGR24"), + testColorConversion("YUV444P", "GRAY8"), + testColorConversion("YUV444P", "YUV444P"), + testColorConversion("YUV444P", "YUV422P", 4), + testColorConversion("YUV444P", "YUV420P", 3), + testColorConversion("YUV444P", "YUV420SP_NV12", 3), + testColorConversion("YUV444P", "YUV420SP_NV21", 3), + testColorConversion("YUV444P", "HSV", 0.01), + testColorConversion("YUV444P", "Lab", 0.01), + + // From YUV422P + testColorConversion("YUV422P", "RGBA32"), + testColorConversion("YUV422P", "BGRA32", 2), + testColorConversion("YUV422P", "RGB24"), + testColorConversion("YUV422P", "BGR24"), + testColorConversion("YUV422P", "GRAY8"), + testColorConversion("YUV422P", "YUV444P", 3), + testColorConversion("YUV422P", "YUV422P"), + testColorConversion("YUV422P", "YUV420P"), + testColorConversion("YUV422P", "YUV420SP_NV12"), + testColorConversion("YUV422P", "YUV420SP_NV21"), + testColorConversion("YUV422P", "HSV", 0.01), + testColorConversion("YUV422P", "Lab", 0.01), + + // From YUV420P + testColorConversion("YUV420P", "RGBA32", 2), + testColorConversion("YUV420P", "BGRA32", 2), + testColorConversion("YUV420P", "RGB24"), + testColorConversion("YUV420P", "BGR24"), + testColorConversion("YUV420P", "GRAY8"), + testColorConversion("YUV420P", "YUV444P", 3), + testColorConversion("YUV420P", "YUV422P", 1), + testColorConversion("YUV420P", "YUV420P"), + testColorConversion("YUV420P", "YUV420SP_NV12"), + testColorConversion("YUV420P", "YUV420SP_NV21"), + testColorConversion("YUV420P", "HSV", 0.01), + testColorConversion("YUV420P", "Lab", 0.01), + + // From NV12 + testColorConversion("YUV420SP_NV12", "RGBA32"), + testColorConversion("YUV420SP_NV12", "BGRA32", 2), + testColorConversion("YUV420SP_NV12", "RGB24"), + testColorConversion("YUV420SP_NV12", "BGR24"), + testColorConversion("YUV420SP_NV12", "GRAY8"), + testColorConversion("YUV420SP_NV12", "YUV444P", 3), + testColorConversion("YUV420SP_NV12", "YUV422P", 1), + testColorConversion("YUV420SP_NV12", "YUV420P"), + testColorConversion("YUV420SP_NV12", "YUV420SP_NV12"), + testColorConversion("YUV420SP_NV12", "YUV420SP_NV21"), + testColorConversion("YUV420SP_NV12", "HSV", 0.01), + testColorConversion("YUV420SP_NV12", "Lab", 0.01), + + // From NV21 + testColorConversion("YUV420SP_NV21", "RGBA32"), + testColorConversion("YUV420SP_NV21", "BGRA32", 2), + testColorConversion("YUV420SP_NV21", "RGB24"), + testColorConversion("YUV420SP_NV21", "BGR24"), + testColorConversion("YUV420SP_NV21", "GRAY8"), + testColorConversion("YUV420SP_NV21", "YUV444P", 3), + testColorConversion("YUV420SP_NV21", "YUV422P", 1), + testColorConversion("YUV420SP_NV21", "YUV420P"), + testColorConversion("YUV420SP_NV21", "YUV420SP_NV12"), + testColorConversion("YUV420SP_NV21", "YUV420SP_NV21"), + testColorConversion("YUV420SP_NV21", "HSV", 0.01), + testColorConversion("YUV420SP_NV21", "Lab", 0.01), + + // From HSV + testColorConversion("HSV", "RGBA32"), + testColorConversion("HSV", "BGRA32"), + testColorConversion("HSV", "RGB24"), + testColorConversion("HSV", "BGR24"), + testColorConversion("HSV", "GRAY8"), + testColorConversion("HSV", "YUV444P"), + testColorConversion("HSV", "YUV422P"), + testColorConversion("HSV", "YUV420P"), + testColorConversion("HSV", "YUV420SP_NV12"), + testColorConversion("HSV", "YUV420SP_NV21"), + testColorConversion("HSV", "HSV", 0), + testColorConversion("HSV", "Lab", 0.5), + + // From Lab + testColorConversion("Lab", "RGBA32", 1), + testColorConversion("Lab", "BGRA32", 1), + testColorConversion("Lab", "RGB24", 1), + testColorConversion("Lab", "BGR24", 1), + testColorConversion("Lab", "GRAY8", 1), + testColorConversion("Lab", "YUV444P", 1), + testColorConversion("Lab", "YUV422P", 1), + testColorConversion("Lab", "YUV420P", 1), + testColorConversion("Lab", "YUV420SP_NV12", 1), + testColorConversion("Lab", "YUV420SP_NV21", 1), + testColorConversion("Lab", "HSV", 0.5), + testColorConversion("Lab", "Lab", 0), + + // From GRAY8 + testColorConversion("GRAY8", "GRAY8"), + + // From DEPTH + testColorConversion("DEPTH", "DEPTH", 0, Uint16Array), + ]); +} + +function testDraw() { + return Promise.all([doOneDrawTest("RGB24"), + doOneDrawTest("BGR24"), + doOneDrawTest("YUV444P", 5), + doOneDrawTest("YUV422P", 2), + doOneDrawTest("YUV420P", 2), + doOneDrawTest("YUV420SP_NV12", 2), + doOneDrawTest("YUV420SP_NV21", 2), + doOneDrawTest("HSV", 2), + doOneDrawTest("Lab", 2)]); +} + +// Create an ImageBitmap, _bitmap_, from the _source_. +// Read the underlying data of _bitmap_ into _bitmapBuffer_. +// Compare the _bitmapBuffer_ with gGroundTruthImageData. +function testAccessing_randomTest(sourceType, source, duration) { + return new Promise(function(resolve, reject) { + var p = createImageBitmap(source); + p.then( + function(bitmap) { + bitmapFormat = "RGBA32"; + var bitmapBufferLength = bitmap.mappedDataLength(bitmapFormat); + + var bitmapBuffer = new ArrayBuffer(bitmapBufferLength); + var bitmapBufferView = new Uint8ClampedArray(bitmapBuffer, 0, bitmapBufferLength); + var promise = bitmap.mapDataInto(bitmapFormat, bitmapBuffer, 0); + promise.then( + function(bitmapPixelLayout) { + // Prepare. + bitmapImageData = new ImageData(bitmapBufferView, bitmap.width, bitmap.height); + + // Test. + for (var t = 0; t < 50; ++t) { + var randomX = Math.floor(Math.random() * 240); + var randomY = Math.floor(Math.random() * 175); + isPixel(sourceType, "RGBA32", gGroundTruthImageData, bitmapImageData, randomX, randomY, duration); + } + + resolve(); + }, + function(ev) { failed(ev); reject(); }); + }, + function(ev) { failed(ev); reject(); }); + }); +} + +// Create an ImageBitmap, _bitmap_, from the _source_. +// Read the underlying data of _bitmap_ into _bitmapBuffer_. +// Create another ImageBitmap, _bitmap2_, from _bitmapBuffer_. +// Read the underlying data of _bitmap2_ into _bitmapBuffer2_. +// Compare the _bitmapBuffer2_ with gGroundTruthImageData. +function testCreateFromArrayBffer_randomTest(sourceType, source, duration) { + return new Promise(function(resolve, reject) { + var p = createImageBitmap(source); + p.then( + function(bitmap) { + bitmapFormat = "RGBA32"; + var bitmapBufferLength = bitmap.mappedDataLength(bitmapFormat); + + var bitmapBuffer = new ArrayBuffer(bitmapBufferLength); + var bitmapBufferView = new Uint8ClampedArray(bitmapBuffer, 0, bitmapBufferLength); + var promiseMapDataInto = bitmap.mapDataInto(bitmapFormat, bitmapBuffer, 0); + promiseMapDataInto.then( + function(bitmapPixelLayout) { + // Create a new ImageBitmap from an ArrayBuffer. + var p2 = createImageBitmap(bitmapBufferView, + 0, + bitmapBufferLength, + bitmapFormat, + bitmapPixelLayout); + + p2.then( + function(bitmap2) { + bitmapFormat2 = "RGBA32"; + var bitmapBufferLength2 = bitmap2.mappedDataLength(bitmapFormat2); + + var bitmapBuffer2 = new ArrayBuffer(bitmapBufferLength2); + var bitmapBufferView2 = new Uint8ClampedArray(bitmapBuffer2, 0, bitmapBufferLength2); + var promise2 = bitmap2.mapDataInto(bitmapFormat2, bitmapBuffer2, 0); + promise2.then( + function(bitmapPixelLayout2) { + // Prepare. + var bitmapImageData2 = new ImageData(bitmapBufferView2, bitmap2.width, bitmap2.height); + + // Test. + for (var t = 0; t < 50; ++t) { + var randomX = Math.floor(Math.random() * 240); + var randomY = Math.floor(Math.random() * 175); + isPixel(sourceType, "RGBA32", gGroundTruthImageData, bitmapImageData2, randomX, randomY, duration); + } + + resolve(); + }, + function(ev) { failed(ev); reject(); }); + }, + function(ev) { console.log("p2 rejected!"); failed(ev); reject(); }); + }, + function(ev) { console.log("promiseMapDataInto rejected!"); failed(ev); reject(); }); + }, + function(ev) { failed(ev); reject(); }); + }); +} + +function testColorConversion(sourceFromat, destinationFormat, tolerance, shouldThrow) { + + tolerance = tolerance || 0; + shouldThrow = shouldThrow || false; + + return new Promise(function(resolve, reject) { + var [srcData, dstData] = getTestData(sourceFromat, destinationFormat); + + ok(!!srcData, "Get valid srcData of type:" + sourceFromat); + ok(!!dstData, "Get valid dstData of type:" + destinationFormat); + + // printInfo(sourceFromat, srcData); + // printInfo(destinationFormat, dstData); + + // Create a new ImageBitmap from an ArrayBuffer. + var p = createImageBitmap(srcData.buffer, + 0, + srcData.bufferLength, + srcData.format, + srcData.pixelLayout); + + p.then( + function(srcBitmap) { + ok(!!srcBitmap, "Should get a valid srcBitmap."); + ok(srcBitmap.findOptimalFormat() == sourceFromat, "srcBitmap.findOptimalFormat():" + srcBitmap.findOptimalFormat() + + " should equal to sourceFromat:" + sourceFromat); + + var dstBufferLength = srcBitmap.mappedDataLength(destinationFormat); + var dstBuffer = new ArrayBuffer(dstBufferLength); + var dstBufferView = new dstData.ArrayType(dstBuffer, 0, dstBufferLength / dstData.ArrayType.BYTES_PER_ELEMENT); + + // Do color conversion here. + var p2 = srcBitmap.mapDataInto(destinationFormat, dstBuffer, 0); + p2.then( + function(dstPixelLayout) { + var dataPixalLayout = dstData.pixelLayout; + + // Check pixel layout. + ok(dstPixelLayout.length == dstData.channelCount, "dstPixelLayout.length:" + dstPixelLayout.length + + " should equal to dstData.channelCount:" + dstData.channelCount); + + for (var c = 0; c < dstData.channelCount; ++c) { + var dstChannelLayout = dstPixelLayout[c]; + var dataChannelLayout = dataPixalLayout[c]; + ok(dstChannelLayout.width == dataChannelLayout.width, "channel[" + c + "] dstChannelLayout.width:" + dstChannelLayout.width + " should equal to dataChannelLayout.width:" + dataChannelLayout.width); + ok(dstChannelLayout.height == dataChannelLayout.height, "channel[" + c + "] dstChannelLayout.height:" + dstChannelLayout.height + " should equal to dataChannelLayout.height:" + dataChannelLayout.height); + ok(dstChannelLayout.skip == dataChannelLayout.skip, "channel[" + c + "] dstChannelLayout.skip:" + dstChannelLayout.skip + " should equal to dataChannelLayout.skip:" + dataChannelLayout.skip); + + for (var i = 0; i < dstChannelLayout.height; ++i) { + for (var j = 0; j < dstChannelLayout.width; ++j) { + var byteOffset = dstChannelLayout.offset + i * dstChannelLayout.stride + j * (dstChannelLayout.skip + 1) * dstData.ArrayType.BYTES_PER_ELEMENT; + var view = new dstData.ArrayType(dstBuffer, byteOffset, 1); + var dstBufferViewValue = view[0]; + var dstDataValue = dstData.getPixelValue(i, j, c); + ok(Math.abs(dstBufferViewValue - dstDataValue) <= tolerance, + "[" + sourceFromat + " -> " + destinationFormat + "] pixel(" + i + "," + j + ") channnel(" + c + + "): dstBufferViewValue:" + dstBufferViewValue + + " should equal to dstDataValue:" + dstDataValue); + } + } + } + + resolve(); + }, + function(ev) { + // If the "mapDataInto" throws, the flow goes here. + if (!shouldThrow) { failed(ev); } + reject(); + } + ); + }, + function(ev) { + reject(ev); + } + ); + }); +} + +function doOneDrawTest(sourceFromat, tolerance) { + tolerance = tolerance || 0; + var destinationFormat = "RGBA32"; + + return new Promise(function(resolve, reject) { + + var [srcData, dstData] = getTestData(sourceFromat, destinationFormat); + ok(!!srcData, "Get valid srcData of type:" + sourceFromat); + ok(!!dstData, "Get valid dstData of type:" + destinationFormat); + + var p = createImageBitmap(srcData.buffer, + 0, + srcData.bufferLength, + srcData.format, + srcData.pixelLayout); + + p.then( + function(srcBitmap) { + ok(!!srcBitmap, "Should get a valid srcBitmap."); + ok(srcBitmap.findOptimalFormat() == sourceFromat, "srcBitmap.findOptimalFormat():" + srcBitmap.findOptimalFormat() + + " should equal to sourceFromat:" + sourceFromat); + + var canvas = document.createElement("canvas"); + canvas.width = srcBitmap.width; + canvas.height = srcBitmap.height; + var ctx = canvas.getContext("2d"); + + ctx.drawImage(srcBitmap, 0, 0, srcBitmap.width, srcBitmap.height); + + // Get an ImageData from the canvas. + var imageData = ctx.getImageData(0, 0, srcBitmap.width, srcBitmap.height); + + for (var i = 0; i < srcBitmap.height; ++i) { + for (var j = 0; j < srcBitmap.width; ++j) { + var pixelOffset = i * srcBitmap.width * dstData.channelCount + j * dstData.channelCount; + var dstImageDataValue_R = imageData.data[pixelOffset + 0]; + var dstImageDataValue_G = imageData.data[pixelOffset + 1]; + var dstImageDataValue_B = imageData.data[pixelOffset + 2]; + var dstImageDataValue_A = imageData.data[pixelOffset + 3]; + + var logPrefix = "[" + sourceFromat + " -> " + destinationFormat + "] pixel(" + i + "," + j + ")"; + + var dstDataValue_R = dstData.getPixelValue(i, j, 0); + var dstDataValue_G = dstData.getPixelValue(i, j, 1); + var dstDataValue_B = dstData.getPixelValue(i, j, 2); + var dstDataValue_A = dstData.getPixelValue(i, j, 3); + ok(Math.abs(dstImageDataValue_R - dstDataValue_R) <= tolerance, + logPrefix + "channnel(R): dstImageDataValue:" + dstImageDataValue_R + " should equal to dstDataValue_R: " + dstDataValue_R); + ok(Math.abs(dstImageDataValue_G - dstDataValue_G) <= tolerance, + logPrefix + "channnel(G): dstImageDataValue:" + dstImageDataValue_G + " should equal to dstDataValue_G: " + dstDataValue_G); + ok(Math.abs(dstImageDataValue_B - dstDataValue_B) <= tolerance, + logPrefix + "channnel(B): dstImageDataValue:" + dstImageDataValue_B + " should equal to dstDataValue_B: " + dstDataValue_B); + ok(Math.abs(dstImageDataValue_A - dstDataValue_A) <= tolerance, + logPrefix + "channnel(A): dstImageDataValue:" + dstImageDataValue_A + " should equal to dstDataValue_A: " + dstDataValue_A); + } + } + + resolve(); + }, + function(ev) { + failed(ev); + reject(ev); + } + ); + }); +} \ No newline at end of file diff --git a/dom/canvas/test/imagebitmap_extensions_data.js b/dom/canvas/test/imagebitmap_extensions_data.js new file mode 100644 index 000000000..0dd785aa5 --- /dev/null +++ b/dom/canvas/test/imagebitmap_extensions_data.js @@ -0,0 +1,1066 @@ +class Image { + constructor(channelCount, format, ArrayType) { + this.channelCount = channelCount; + this.format = format; + this.ArrayType = ArrayType; + this.pixelLayout = []; + this.buffer = undefined; + this.data = undefined; + }; +}; + +class TypedSimpleImage extends Image { + constructor(width, height, channelCount, format, ArrayType) { + super(channelCount, format, ArrayType); + this.width = width; + this.height = height; + this.stride = this.width * this.channelCount * this.ArrayType.BYTES_PER_ELEMENT; + this.bufferLength = this.height * this.stride; + this.buffer = new ArrayBuffer(this.bufferLength); + this.data = new this.ArrayType(this.buffer, 0, this.height * this.width * this.channelCount); + + // initialize pixel layout + for (var c = 0; c < this.channelCount; ++c) { + this.pixelLayout.push({offset:c * this.ArrayType.BYTES_PER_ELEMENT, + width:this.width, + height:this.height, + dataType:"uint8", + stride:this.stride, + skip:(this.channelCount - 1)}); + } + }; + + getPixelValue(i, j, c) { + var dataChannelLayout = this.pixelLayout[c]; + return this.data[i * this.width * this.channelCount + j * this.channelCount + c]; + } +}; + +class Uint8SimpleImage extends TypedSimpleImage { + constructor(width, height, channelCount, format) { + super(width, height, channelCount, format, Uint8ClampedArray); + }; +}; + +class Uint16SimpleImage extends TypedSimpleImage { + constructor(width, height, channelCount, format) { + super(width, height, channelCount, format, Uint16Array); + }; +}; + +class FloatSimpleImage extends TypedSimpleImage { + constructor(width, height, channelCount, format) { + super(width, height, channelCount, format, Float32Array); + }; +}; + +class DoubleSimpleImage extends TypedSimpleImage { + constructor(width, height, channelCount, format) { + super(width, height, channelCount, format, Float64Array); + }; +}; + +class RGBA32Data extends Uint8SimpleImage { + constructor() { + super(3, 3, 4, "RGBA32"); + + var i = 0; + this.data[i + 0] = 0; this.data[i + 1] = 0; this.data[i + 2] = 0; this.data[i + 3] = 255; + this.data[i + 4] = 255; this.data[i + 5] = 0; this.data[i + 6] = 0; this.data[i + 7] = 255; + this.data[i + 8] = 0; this.data[i + 9] = 255; this.data[i + 10] = 0; this.data[i + 11] = 255; + + i += this.stride; + this.data[i + 0] = 0; this.data[i + 1] = 0; this.data[i + 2] = 255; this.data[i + 3] = 255; + this.data[i + 4] = 255; this.data[i + 5] = 255; this.data[i + 6] = 0; this.data[i + 7] = 255; + this.data[i + 8] = 0; this.data[i + 9] = 255; this.data[i + 10] = 255; this.data[i + 11] = 255; + + i += this.stride; + this.data[i + 0] = 255; this.data[i + 1] = 0; this.data[i + 2] = 255; this.data[i + 3] = 255; + this.data[i + 4] = 255; this.data[i + 5] = 255; this.data[i + 6] = 255; this.data[i + 7] = 255; + this.data[i + 8] = 128; this.data[i + 9] = 128; this.data[i + 10] = 128; this.data[i + 11] = 255; + }; +}; + +class BGRA32Data extends Uint8SimpleImage { + constructor() { + super(3, 3, 4, "BGRA32"); + + var i = 0; + this.data[i + 2] = 0; this.data[i + 1] = 0; this.data[i + 0] = 0; this.data[i + 3] = 255; + this.data[i + 6] = 255; this.data[i + 5] = 0; this.data[i + 4] = 0; this.data[i + 7] = 255; + this.data[i + 10] = 0; this.data[i + 9] = 255; this.data[i + 8] = 0; this.data[i + 11] = 255; + + i += this.stride; + this.data[i + 2] = 0; this.data[i + 1] = 0; this.data[i + 0] = 255; this.data[i + 3] = 255; + this.data[i + 6] = 255; this.data[i + 5] = 255; this.data[i + 4] = 0; this.data[i + 7] = 255; + this.data[i + 10] = 0; this.data[i + 9] = 255; this.data[i + 8] = 255; this.data[i + 11] = 255; + + i += this.stride; + this.data[i + 2] = 255; this.data[i + 1] = 0; this.data[i + 0] = 255; this.data[i + 3] = 255; + this.data[i + 6] = 255; this.data[i + 5] = 255; this.data[i + 4] = 255; this.data[i + 7] = 255; + this.data[i + 10] = 128; this.data[i + 9] = 128; this.data[i + 8] = 128; this.data[i + 11] = 255; + }; +}; + +class RGB24Data extends Uint8SimpleImage { + constructor() { + super(3, 3, 3, "RGB24"); + + var i = 0; + this.data[i + 0] = 0; this.data[i + 1] = 0; this.data[i + 2] = 0; + this.data[i + 3] = 255; this.data[i + 4] = 0; this.data[i + 5] = 0; + this.data[i + 6] = 0; this.data[i + 7] = 255; this.data[i + 8] = 0; + + i += this.stride; + this.data[i + 0] = 0; this.data[i + 1] = 0; this.data[i + 2] = 255; + this.data[i + 3] = 255; this.data[i + 4] = 255; this.data[i + 5] = 0; + this.data[i + 6] = 0; this.data[i + 7] = 255; this.data[i + 8] = 255; + + i += this.stride; + this.data[i + 0] = 255; this.data[i + 1] = 0; this.data[i + 2] = 255; + this.data[i + 3] = 255; this.data[i + 4] = 255; this.data[i + 5] = 255; + this.data[i + 6] = 128; this.data[i + 7] = 128; this.data[i + 8] = 128; + }; +}; + +class BGR24Data extends Uint8SimpleImage { + constructor() { + super(3, 3, 3, "BGR24"); + + var i = 0; + this.data[i + 2] = 0; this.data[i + 1] = 0; this.data[i + 0] = 0; + this.data[i + 5] = 255; this.data[i + 4] = 0; this.data[i + 3] = 0; + this.data[i + 8] = 0; this.data[i + 7] = 255; this.data[i + 6] = 0; + + i += this.stride; + this.data[i + 2] = 0; this.data[i + 1] = 0; this.data[i + 0] = 255; + this.data[i + 5] = 255; this.data[i + 4] = 255; this.data[i + 3] = 0; + this.data[i + 8] = 0; this.data[i + 7] = 255; this.data[i + 6] = 255; + + i += this.stride; + this.data[i + 2] = 255; this.data[i + 1] = 0; this.data[i + 0] = 255; + this.data[i + 5] = 255; this.data[i + 4] = 255; this.data[i + 3] = 255; + this.data[i + 8] = 128; this.data[i + 7] = 128; this.data[i + 6] = 128; + }; +}; + +class Gray8Data extends Uint8SimpleImage { + constructor() { + super(3, 3, 1, "GRAY8"); + + var i = 0; + this.data[i + 0] = 0; this.data[i + 1] = 76; this.data[i + 2] = 149; + + i += this.stride; + this.data[i + 0] = 29; this.data[i + 1] = 225; this.data[i + 2] = 178; + + i += this.stride; + this.data[i + 0] = 105; this.data[i + 1] = 255; this.data[i + 2] = 127; + }; +}; + +class RGBA32DataFromYUV444PData extends Uint8SimpleImage { + constructor(redIndex, greenIndex, blueIndex, alphaIndex) { + + // Get the exact format. + var channelCount_ = !!alphaIndex ? 4 : 3; + var format_; + if (redIndex == 0) { + if (channelCount_ == 3) { + format_ = "RGBA32"; + } else { + format_ = "RGB24"; + } + } else if (redIndex == 2) { + if (channelCount_ == 3) { + format_ = "BGRA32"; + } else { + format_ = "BGR24"; + } + } else { + return undefined; + } + + // Call parent's consturctor. + super(3, 3, channelCount_, format_); + + // Calculate parameters for setting data. + var rIndex = redIndex; // 0 or 2 + var gIndex = 1; + var bIndex = redIndex ^ 2; // 0 or 2 + var aIndex = alphaIndex || 0; // If alphaIndex == undefined --> aIndex = 0; + var shift0 = 0; + var shift1 = channelCount_; + var shift2 = channelCount_ * 2; + + // Set the data. + var i = 0; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 0; this.data[i + gIndex + shift0] = 0; this.data[i + bIndex + shift0] = 0; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 254; this.data[i + gIndex + shift1] = 0; this.data[i + bIndex + shift1] = 0; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 0; this.data[i + gIndex + shift2] = 253; this.data[i + bIndex + shift2] = 1; + + i += this.stride; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 0; this.data[i + gIndex + shift0] = 0; this.data[i + bIndex + shift0] = 251; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 253; this.data[i + gIndex + shift1] = 253; this.data[i + bIndex + shift1] = 2; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 0; this.data[i + gIndex + shift2] = 253; this.data[i + bIndex + shift2] = 252; + + i += this.stride; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 255; this.data[i + gIndex + shift0] = 0; this.data[i + bIndex + shift0] = 252; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 253; this.data[i + gIndex + shift1] = 253; this.data[i + bIndex + shift1] = 253; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 127; this.data[i + gIndex + shift2] = 127; this.data[i + bIndex + shift2] = 127; + }; +}; + +class RGBA32DataFromYUV422PData extends Uint8SimpleImage { + constructor(redIndex, greenIndex, blueIndex, alphaIndex) { + + // Get the exact format. + var channelCount_ = !!alphaIndex ? 4 : 3; + var format_; + if (redIndex == 0) { + if (channelCount_ == 3) { + format_ = "RGBA32"; + } else { + format_ = "RGB24"; + } + } else if (redIndex == 2) { + if (channelCount_ == 3) { + format_ = "BGRA32"; + } else { + format_ = "BGR24"; + } + } else { + return undefined; + } + + // Call parent's consturctor. + super(3, 3, channelCount_, format_); + + // Calculate parameters for setting data. + var rIndex = redIndex; // 0 or 2 + var gIndex = 1; + var bIndex = redIndex ^ 2; // 0 or 2 + var aIndex = alphaIndex || 0; // If alphaIndex == undefined --> aIndex = 0; + var shift0 = 0; + var shift1 = channelCount_; + var shift2 = channelCount_ * 2; + + // Set the data. + var i = 0; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 89; this.data[i + gIndex + shift0] = 0; this.data[i + bIndex + shift0] = 0; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 165; this.data[i + gIndex + shift1] = 38; this.data[i + bIndex + shift1] = 38; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 0; this.data[i + gIndex + shift2] = 253; this.data[i + bIndex + shift2] = 1; + + i += this.stride; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 28; this.data[i + gIndex + shift0] = 28; this.data[i + bIndex + shift0] = 28; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 224; this.data[i + gIndex + shift1] = 224; this.data[i + bIndex + shift1] = 224; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 0; this.data[i + gIndex + shift2] = 253; this.data[i + bIndex + shift2] = 252; + + i += this.stride; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 180; this.data[i + gIndex + shift0] = 52; this.data[i + bIndex + shift0] = 178; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 255; this.data[i + gIndex + shift1] = 200; this.data[i + bIndex + shift1] = 255; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 127; this.data[i + gIndex + shift2] = 127; this.data[i + bIndex + shift2] = 127; + }; +}; + +class RGBA32DataFromYUV420PData extends Uint8SimpleImage { + constructor(redIndex, greenIndex, blueIndex, alphaIndex) { + + // Get the exact format. + var channelCount_ = !!alphaIndex ? 4 : 3; + var format_; + if (redIndex == 0) { + if (channelCount_ == 3) { + format_ = "RGBA32"; + } else { + format_ = "RGB24"; + } + } else if (redIndex == 2) { + if (channelCount_ == 3) { + format_ = "BGRA32"; + } else { + format_ = "BGR24"; + } + } else { + return undefined; + } + + // Call parent's consturctor. + super(3, 3, channelCount_, format_); + + // Calculate parameters for setting data. + var rIndex = redIndex; // 0 or 2 + var gIndex = 1; + var bIndex = redIndex ^ 2; // 0 or 2 + var aIndex = alphaIndex || 0; // If alphaIndex == undefined --> aIndex = 0; + var shift0 = 0; + var shift1 = channelCount_; + var shift2 = channelCount_ * 2; + + // Set the data. + var i = 0; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 44; this.data[i + gIndex + shift0] = 0; this.data[i + bIndex + shift0] = 0; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 120; this.data[i + gIndex + shift1] = 57; this.data[i + bIndex + shift1] = 58; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 0; this.data[i + gIndex + shift2] = 238; this.data[i + bIndex + shift2] = 112; + + i += this.stride; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 73; this.data[i + gIndex + shift0] = 9; this.data[i + bIndex + shift0] = 11; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 255; this.data[i + gIndex + shift1] = 205; this.data[i + bIndex + shift1] = 206; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 12; this.data[i + gIndex + shift2] = 255; this.data[i + bIndex + shift2] = 141; + + i += this.stride; + this.data[i + aIndex + shift0] = 255; this.data[i + rIndex + shift0] = 180; this.data[i + gIndex + shift0] = 52; this.data[i + bIndex + shift0] = 178; + this.data[i + aIndex + shift1] = 255; this.data[i + rIndex + shift1] = 255; this.data[i + gIndex + shift1] = 200; this.data[i + bIndex + shift1] = 255; + this.data[i + aIndex + shift2] = 255; this.data[i + rIndex + shift2] = 127; this.data[i + gIndex + shift2] = 127; this.data[i + bIndex + shift2] = 127; + }; +}; + +class Gray8DataFromYUVData extends Uint8SimpleImage { + constructor() { + super(3, 3, 1, "GRAY8"); + + var i = 0; + this.data[i + 0] = 16; this.data[i + 1] = 82; this.data[i + 2] = 144; + + i += this.stride; + this.data[i + 0] = 41; this.data[i + 1] = 210; this.data[i + 2] = 169; + + i += this.stride; + this.data[i + 0] = 107; this.data[i + 1] = 235; this.data[i + 2] = 126; + }; +}; + +class YUVImage extends Image { + constructor(yWidth, yHeight, uWidth, uHeight, vWidth, vHeight, format) { + super(3, format, Uint8ClampedArray); + this.yWidth = yWidth; + this.yHeight = yHeight; + this.yStride = this.yWidth * this.ArrayType.BYTES_PER_ELEMENT; + this.uWidth = uWidth; + this.uHeight = uHeight; + this.uStride = this.uWidth * this.ArrayType.BYTES_PER_ELEMENT; + this.vWidth = vWidth; + this.vHeight = vHeight; + this.vStride = this.vWidth * this.ArrayType.BYTES_PER_ELEMENT; + this.bufferLength = this.yHeight * this.yStride + + this.uHeight * this.uStride + + this.vHeight * this.vStride + this.buffer = new ArrayBuffer(this.bufferLength); + this.data = new this.ArrayType(this.buffer, 0, this.bufferLength); + this.yData = new this.ArrayType(this.buffer, 0, this.yHeight * this.yStride); + this.uData = new this.ArrayType(this.buffer, + this.yHeight * this.yStride, + this.uHeight * this.uStride); + this.vData = new this.ArrayType(this.buffer, + this.yHeight * this.yStride + this.uHeight * this.uStride, + this.vHeight * this.vStride); + + // Initialize pixel layout. + // y channel. + this.pixelLayout.push({offset:0, + width:this.yWidth, + height:this.yHeight, + dataType:"uint8", + stride:this.yStride, + skip:0}); + + // u channel. + this.pixelLayout.push({offset:(this.yHeight * this.yStride), + width:this.uWidth, + height:this.uHeight, + dataType:"uint8", + stride:this.uStride, + skip:0}); + + // v channel. + this.pixelLayout.push({offset:(this.yHeight * this.yStride + this.uHeight * this.uStride), + width:this.vWidth, + height:this.vHeight, + dataType:"uint8", + stride:this.vStride, + skip:0}); + }; + + getPixelValue(i, j, c) { + var dataChannelLayout = this.pixelLayout[c]; + return this.data[dataChannelLayout.offset + i * dataChannelLayout.stride + j * (dataChannelLayout.skip + 1)]; + } +}; + +class YUV444PData extends YUVImage { + constructor() { + super(3, 3, 3, 3, 3, 3, "YUV444P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 128; this.uData[1] = 90; this.uData[2] = 54; + this.uData[3] = 240; this.uData[4] = 16; this.uData[5] = 166; + this.uData[6] = 202; this.uData[7] = 128; this.uData[8] = 128; + + this.vData[0] = 128; this.vData[1] = 240; this.vData[2] = 34; + this.vData[3] = 110; this.vData[4] = 146; this.vData[5] = 16; + this.vData[6] = 222; this.vData[7] = 128; this.vData[8] = 128; + } +}; + +class YUV444PDataFromYUV422PData extends YUVImage { + constructor() { + super(3, 3, 3, 3, 3, 3, "YUV444P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 108; this.uData[1] = 81; this.uData[2] = 53; + this.uData[3] = 126; this.uData[4] = 112; this.uData[5] = 98; + this.uData[6] = 144; this.uData[7] = 144; this.uData[8] = 144; + + this.vData[0] = 182; this.vData[1] = 108; this.vData[2] = 33; + this.vData[3] = 166; this.vData[4] = 109; this.vData[5] = 51; + this.vData[6] = 150; this.vData[7] = 110; this.vData[8] = 70; + } +}; + +class YUV444PDataFromYUV420PData extends YUVImage { + constructor() { + super(3, 3, 3, 3, 3, 3, "YUV444P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 118; this.uData[1] = 113; this.uData[2] = 109; + this.uData[3] = 140; this.uData[4] = 128; this.uData[5] = 117; + this.uData[6] = 162; this.uData[7] = 144; this.uData[8] = 126; + + this.vData[0] = 154; this.vData[1] = 90; this.vData[2] = 24; + this.vData[3] = 163; this.vData[4] = 119; this.vData[5] = 75; + this.vData[6] = 172; this.vData[7] = 149; this.vData[8] = 126; + } +}; + +class YUV422PData extends YUVImage { + constructor() { + super(3, 3, 2, 3, 2, 3, "YUV422P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 109; this.uData[1] = 54; + this.uData[2] = 128; this.uData[3] = 166; + this.uData[4] = 165; this.uData[5] = 128; + + this.vData[0] = 184; this.vData[1] = 34; + this.vData[2] = 128; this.vData[3] = 16; + this.vData[4] = 175; this.vData[5] = 128; + } +}; + +class YUV422PDataFromYUV444PData extends YUVImage { + constructor() { + super(3, 3, 2, 3, 2, 3, "YUV422P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 133; this.uData[1] = 78; + this.uData[2] = 164; this.uData[3] = 109; + this.uData[4] = 180; this.uData[5] = 125; + + this.vData[0] = 145; this.vData[1] = 74; + this.vData[2] = 165; this.vData[3] = 95; + this.vData[4] = 175; this.vData[5] = 105; + } +}; + +class YUV422PDataFromYUV420PData extends YUVImage { + constructor() { + super(3, 3, 2, 3, 2, 3, "YUV422P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 119; this.uData[1] = 110; + this.uData[2] = 149; this.uData[3] = 121; + this.uData[4] = 164; this.uData[5] = 127; + + this.vData[0] = 156; this.vData[1] = 25; + this.vData[2] = 168; this.vData[3] = 93; + this.vData[4] = 174; this.vData[5] = 127; + } +}; + +class YUV420PData extends YUVImage { + constructor() { + super(3, 3, 2, 2, 2, 2, "YUV420P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 119; this.uData[1] = 110; + this.uData[2] = 165; this.uData[3] = 128; + + this.vData[0] = 156; this.vData[1] = 25; + this.vData[2] = 175; this.vData[3] = 128; + } +}; + +class YUV420PDataFromYUV444PData extends YUVImage { + constructor() { + super(3, 3, 2, 2, 2, 2, "YUV420P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 133; this.uData[1] = 78; + this.uData[2] = 181; this.uData[3] = 126; + + this.vData[0] = 145; this.vData[1] = 74; + this.vData[2] = 176; this.vData[3] = 106; + } +}; + +class YUV420PDataFromYUV422PData extends YUVImage { + constructor() { + super(3, 3, 2, 2, 2, 2, "YUV420P"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + this.uData[0] = 109; this.uData[1] = 54; + this.uData[2] = 147; this.uData[3] = 147; + + this.vData[0] = 184; this.vData[1] = 34; + this.vData[2] = 152; this.vData[3] = 72; + } +}; + +class NVImage extends Image { + constructor(yWidth, yHeight, uvWidth, uvHeight, format) { + super(3, format, Uint8ClampedArray); + this.yWidth = yWidth; + this.yHeight = yHeight; + this.yStride = this.yWidth * this.ArrayType.BYTES_PER_ELEMENT; + this.uvWidth = uvWidth; + this.uvHeight = uvHeight; + this.uvStride = this.uvWidth * 2 * this.ArrayType.BYTES_PER_ELEMENT; + this.bufferLength = this.yHeight * this.yStride + this.uvHeight * this.uvStride; + this.buffer = new ArrayBuffer(this.bufferLength); + this.data = new this.ArrayType(this.buffer, 0, this.bufferLength); + this.yData = new this.ArrayType(this.buffer, 0, this.yHeight * this.yStride); + this.uvData = new this.ArrayType(this.buffer, + this.yHeight * this.yStride, + this.uvHeight * this.uvStride); + + // Initialize pixel layout. + // y channel. + this.pixelLayout.push({offset:0, + width:this.yWidth, + height:this.yHeight, + dataType:"uint8", + stride:this.yStride, + skip:0}); + // v channel. + this.pixelLayout.push({offset:(this.yHeight * this.yStride), + width:this.uvWidth, + height:this.uvHeight, + dataType:"uint8", + stride:this.uvStride, + skip:1}); + + // u channel. + this.pixelLayout.push({offset:(this.yHeight * this.yStride + this.ArrayType.BYTES_PER_ELEMENT), + width:this.uvWidth, + height:this.uvHeight, + dataType:"uint8", + stride:this.uvStride, + skip:1}); + }; + + getPixelValue(i, j, c) { + var dataChannelLayout = this.pixelLayout[c]; + return this.data[dataChannelLayout.offset + i * dataChannelLayout.stride + j * (dataChannelLayout.skip + 1)]; + } +}; + +class NV12Data extends NVImage { + constructor() { + super(3, 3, 2, 2, "YUV420SP_NV12"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + // U + this.uvData[0] = 119; + this.uvData[2] = 110; + this.uvData[4] = 165; + this.uvData[6] = 128; + + // V + this.uvData[1] = 156; + this.uvData[3] = 25; + this.uvData[5] = 175; + this.uvData[7] = 128; + }; +}; + +class NV12DataFromYUV444PData extends NVImage { + constructor() { + super(3, 3, 2, 2, "YUV420SP_NV12"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + // U + this.uvData[0] = 133; + this.uvData[2] = 78; + this.uvData[4] = 181; + this.uvData[6] = 126; + + // V + this.uvData[1] = 145; + this.uvData[3] = 74; + this.uvData[5] = 176; + this.uvData[7] = 106; + }; +}; + +class NV12DataFromYUV422PData extends NVImage { + constructor() { + super(3, 3, 2, 2, "YUV420SP_NV12"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + // U + this.uvData[0] = 109; + this.uvData[2] = 54; + this.uvData[4] = 147; + this.uvData[6] = 147; + + // V + this.uvData[1] = 184; + this.uvData[3] = 34; + this.uvData[5] = 152; + this.uvData[7] = 72; + }; +}; + +class NV21Data extends NVImage { + constructor() { + super(3, 3, 2, 2, "YUV420SP_NV21"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + // U + this.uvData[1] = 119; + this.uvData[3] = 110; + this.uvData[5] = 165; + this.uvData[7] = 128; + + // V + this.uvData[0] = 156; + this.uvData[2] = 25; + this.uvData[4] = 175; + this.uvData[6] = 128; + }; +}; + +class NV21DataFromYUV444PData extends NVImage { + constructor() { + super(3, 3, 2, 2, "YUV420SP_NV12"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + // V + this.uvData[1] = 133; + this.uvData[3] = 78; + this.uvData[5] = 181; + this.uvData[7] = 126; + + // U + this.uvData[0] = 145; + this.uvData[2] = 74; + this.uvData[4] = 176; + this.uvData[6] = 106; + }; +}; + +class NV21DataFromYUV422PData extends NVImage { + constructor() { + super(3, 3, 2, 2, "YUV420SP_NV12"); + + this.yData[0] = 16; this.yData[1] = 82; this.yData[2] = 144; + this.yData[3] = 41; this.yData[4] = 210; this.yData[5] = 169; + this.yData[6] = 107; this.yData[7] = 235; this.yData[8] = 126; + + // V + this.uvData[1] = 109; + this.uvData[3] = 54; + this.uvData[5] = 147; + this.uvData[7] = 147; + + // U + this.uvData[0] = 184; + this.uvData[2] = 34; + this.uvData[4] = 152; + this.uvData[6] = 72; + }; +}; + +class HSVData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 0.0; this.data[i + 1] = 0.0; this.data[i + 2] = 0.0; + this.data[i + 3] = 0.0; this.data[i + 4] = 1.0; this.data[i + 5] = 1.0; + this.data[i + 6] = 120.0; this.data[i + 7] = 1.0; this.data[i + 8] = 1.0; + + i += this.width * this.channelCount; + this.data[i + 0] = 240.0; this.data[i + 1] = 1.0; this.data[i + 2] = 1.0; + this.data[i + 3] = 60.0; this.data[i + 4] = 1.0; this.data[i + 5] = 1.0; + this.data[i + 6] = 180.0; this.data[i + 7] = 1.0; this.data[i + 8] = 1.0; + + i += this.width * this.channelCount; + this.data[i + 0] = 300.0; this.data[i + 1] = 1.0; this.data[i + 2] = 1.0; + this.data[i + 3] = 0.0; this.data[i + 4] = 0.0; this.data[i + 5] = 1.0; + this.data[i + 6] = 0.0; this.data[i + 7] = 0.0; this.data[i + 8] = 0.50196081; + }; +}; + +class HSVDataFromLabData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 0.0; this.data[i + 1] = 0.0; this.data[i + 2] = 0.0; + this.data[i + 3] = 0.0; this.data[i + 4] = 1.0; this.data[i + 5] = 0.996078; + this.data[i + 6] = 120.0; this.data[i + 7] = 1.0; this.data[i + 8] = 1.0; + + i += this.width * this.channelCount; + this.data[i + 0] = 240.0; this.data[i + 1] = 1.0; this.data[i + 2] = 1.0; + this.data[i + 3] = 60.235294; this.data[i + 4] = 1.0; this.data[i + 5] = 1.0; + this.data[i + 6] = 179.764706; this.data[i + 7] = 1.0; this.data[i + 8] = 1.0; + + i += this.width * this.channelCount; + this.data[i + 0] = 300.0; this.data[i + 1] = 1.0; this.data[i + 2] = 1.0; + this.data[i + 3] = 0.0; this.data[i + 4] = 0.003922; this.data[i + 5] = 1.0; + this.data[i + 6] = 59.999998; this.data[i + 7] = 0.007813; this.data[i + 8] = 0.501961; + }; +}; + +class HSVDataFromYUV444PData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 0.0; this.data[i + 1] = 0.0; this.data[i + 2] = 0.0; + this.data[i + 3] = 0.0; this.data[i + 4] = 1.0000000001003937; this.data[i + 5] = 0.996078431372549; + this.data[i + 6] = 120.23715415017372; this.data[i + 7] = 1.0000000001007905; this.data[i + 8] = 0.9921568627450981; + + i += this.width * this.channelCount; + this.data[i + 0] = 240.0; this.data[i + 1] = 1.0000000001015936; this.data[i + 2] = 0.984313725490196; + this.data[i + 3] = 59.99999999390438; this.data[i + 4] = 0.9920948617608696; this.data[i + 5] = 0.9921568627450981; + this.data[i + 6] = 179.76284584377885; this.data[i + 7] = 1.0000000001007905; this.data[i + 8] = 0.9921568627450981; + + i += this.width * this.channelCount; + this.data[i + 0] = 300.7058823588706; this.data[i + 1] = 1.0000000001; this.data[i + 2] = 1.0; + this.data[i + 3] = 0.0; this.data[i + 4] = 0.0; this.data[i + 5] = 0.9921568627450981; + this.data[i + 6] = 0.0; this.data[i + 7] = 0.0; this.data[i + 8] = 0.4980392156862745; + }; +}; + +class HSVDataFromYUV422PData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 0.0; this.data[i + 1] = 1.0000000002865168; this.data[i + 2] = 0.34901960784313724; + this.data[i + 3] = 0.0; this.data[i + 4] = 0.7696969698515151; this.data[i + 5] = 0.6470588235294118; + this.data[i + 6] = 120.23715415017372; this.data[i + 7] = 1.0000000001007905; this.data[i + 8] = 0.9921568627450981; + + i += this.width * this.channelCount; + this.data[i + 0] = 0; this.data[i + 1] = 0.0; this.data[i + 2] = 0.10980392156862745; + this.data[i + 3] = 0; this.data[i + 4] = 0.0; this.data[i + 5] = 0.8784313725490196; + this.data[i + 6] = 179.76284584377885; this.data[i + 7] = 1.0000000001007905; this.data[i + 8] = 0.9921568627450981; + + i += this.width * this.channelCount; + this.data[i + 0] = 300.93750001176636; this.data[i + 1] = 0.7111111112527777; this.data[i + 2] = 0.7058823529411765; + this.data[i + 3] = 300.0000000278182; this.data[i + 4] = 0.21568627460980394; this.data[i + 5] = 1.0; + this.data[i + 6] = 0.0; this.data[i + 7] = 0.0; this.data[i + 8] = 0.4980392156862745; + }; +}; + +class HSVDataFromYUV420PData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 0.0; this.data[i + 1] = 1.0000000005795455; this.data[i + 2] = 0.17254901960784313; + this.data[i + 3] = 359.04761904800455; this.data[i + 4] = 0.5250000002125; this.data[i + 5] = 0.47058823529411764; + this.data[i + 6] = 148.23529411462184; this.data[i + 7] = 1.000000000107143; this.data[i + 8] = 0.9333333333333333; + + i += this.width * this.channelCount; + this.data[i + 0] = 358.1250000007471; this.data[i + 1] = 0.8767123291164385; this.data[i + 2] = 0.28627450980392155; + this.data[i + 3] = 358.800000000612; this.data[i + 4] = 0.196078431472549; this.data[i + 5] = 1.0; + this.data[i + 6] = 151.85185184850937; this.data[i + 7] = 0.9529411765705882; this.data[i + 8] = 1.0; + + i += this.width * this.channelCount; + this.data[i + 0] = 300.93750001176636; this.data[i + 1] = 0.7111111112527777; this.data[i + 2] = 0.7058823529411765; + this.data[i + 3] = 300.0000000278182; this.data[i + 4] = 0.21568627460980394; this.data[i + 5] = 1.0; + this.data[i + 6] = 0.0; this.data[i + 7] = 0.0; this.data[i + 8] = 0.4980392156862745; + }; +}; + +class LabData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "Lab"); + + var i = 0; + this.data[i + 0] = 0.0; this.data[i + 1] = 0.0; this.data[i + 2] = 0.0; + this.data[i + 3] = 53.240585; this.data[i + 4] = 80.094185; this.data[i + 5] = 67.201538; + this.data[i + 6] = 87.7351; this.data[i + 7] = -86.181252; this.data[i + 8] = 83.177483; + + i += this.width * this.channelCount; + this.data[i + 0] = 32.29567; this.data[i + 1] = 79.186989; this.data[i + 2] = -107.86176; + this.data[i + 3] = 97.139511; this.data[i + 4] = -21.552414; this.data[i + 5] = 94.475792; + this.data[i + 6] = 91.113297; this.data[i + 7] = -48.088551; this.data[i + 8] = -14.130962; + + i += this.width * this.channelCount; + this.data[i + 0] = 60.323502; this.data[i + 1] = 98.235161; this.data[i + 2] = -60.825493; + this.data[i + 3] = 100.0; this.data[i + 4] = 0.0; this.data[i + 5] = 0.0; + this.data[i + 6] = 53.585014; this.data[i + 7] = 0.0; this.data[i + 8] = 0.0; + }; +}; + +class LabDataFromYUV444PData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 0.0; this.data[i + 1] = 0.0; this.data[i + 2] = 0.0; + this.data[i + 3] = 53.034610465388056; this.data[i + 4] = 79.85590203914461; this.data[i + 5] = 67.0016253024788; + this.data[i + 6] = 87.11875689267448; this.data[i + 7] = -85.65429374039535; this.data[i + 8] = 82.60623202041464; + + i += this.width * this.channelCount; + this.data[i + 0] = 31.720345672804157; this.data[i + 1] = 78.24367895044873; this.data[i + 2] = -106.5768337072531; + this.data[i + 3] = 96.46792120648958; this.data[i + 4] = -21.409519847697347; this.data[i + 5] = 93.77548135780542; + this.data[i + 6] = 90.44660871821826; this.data[i + 7] = -48.089026724461526; this.data[i + 8] = -13.571034820412686; + + i += this.width * this.channelCount; + this.data[i + 0] = 60.151950936932494; this.data[i + 1] = 97.82071254270292; this.data[i + 2] = -59.43734830934828; + this.data[i + 3] = 99.30958687208283; this.data[i + 4] = 0.0; this.data[i + 5] = 0.0; + this.data[i + 6] = 53.19277745493915; this.data[i + 7] = 0.0; this.data[i + 8] = 0.0; + }; +}; + +class LabDataFromYUV422PData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 16.127781199491146; this.data[i + 1] = 37.16386506574049; this.data[i + 2] = 25.043689417354877; + this.data[i + 3] = 36.981683077525915; this.data[i + 4] = 50.903511613481115; this.data[i + 5] = 32.31142038484883; + this.data[i + 6] = 87.11875689267448; this.data[i + 7] = -85.65429374039535; this.data[i + 8] = 82.60623202041464; + + i += this.width * this.channelCount; + this.data[i + 0] = 10.268184311230112; this.data[i + 1] = 0.0; this.data[i + 2] = 0.0; + this.data[i + 3] = 89.1772802290269; this.data[i + 4] = 0.0; this.data[i + 5] = 0.0; + this.data[i + 6] = 90.44660871821826; this.data[i + 7] = -48.089026724461526; this.data[i + 8] = -13.571034820412686; + + i += this.width * this.channelCount; + this.data[i + 0] = 46.144074613608296; this.data[i + 1] = 65.16894552944552; this.data[i + 2] = -40.267933584999625; + this.data[i + 3] = 86.8938834807636; this.data[i + 4] = 28.462923575986455; this.data[i + 5] = -19.464966592414633; + this.data[i + 6] = 53.19277745493915; this.data[i + 7] = 0.0; this.data[i + 8] = 0.0; + }; +}; + +class LabDataFromYUV420PData extends FloatSimpleImage { + constructor() { + super(3, 3, 3, "HSV"); + + var i = 0; + this.data[i + 0] = 4.838519820745088; this.data[i + 1] = 21.141105340568455; this.data[i + 2] = 7.645700032099379; + this.data[i + 3] = 32.31563239702677; this.data[i + 4] = 27.57546933915833; this.data[i + 5] = 12.300896526188554; + this.data[i + 6] = 83.08065258991849; this.data[i + 7] = -73.895752859582; this.data[i + 8] = 47.405921341516176; + + i += this.width * this.channelCount; + this.data[i + 0] = 13.450503010545155; this.data[i + 1] = 29.406984528513203; this.data[i + 2] = 16.333350166067607; + this.data[i + 3] = 86.69267491397105; this.data[i + 4] = 17.77388194061319; this.data[i + 5] = 6.21670853560361; + this.data[i + 6] = 88.693447032887; this.data[i + 7] = -74.34828426368617; this.data[i + 8] = 40.64106565615555; + + i += this.width * this.channelCount; + this.data[i + 0] = 46.144074613608296; this.data[i + 1] = 65.16894552944552; this.data[i + 2] = -40.267933584999625; + this.data[i + 3] = 86.8938834807636; this.data[i + 4] = 28.462923575986455; this.data[i + 5] = -19.464966592414633; + this.data[i + 6] = 53.19277745493915; this.data[i + 7] = 0.0; this.data[i + 8] = 0.0; + }; +}; + +class DepthData extends Uint16SimpleImage { + constructor() { + super(3, 3, 1, "DEPTH"); + + var i = 0; + this.data[i + 0] = 2; this.data[i + 1] = 4; this.data[i + 2] = 8; + + i += this.width * this.channelCount; + this.data[i + 0] = 16; this.data[i + 1] = 32; this.data[i + 2] = 64; + + i += this.width * this.channelCount; + this.data[i + 0] = 128; this.data[i + 1] = 256; this.data[i + 2] = 512; + }; +}; + +function getData(format, originalFormat) { + if (format == "RGBA32") { + if (originalFormat == "YUV444P") { + return new RGBA32DataFromYUV444PData(0, 1, 2, 3); + } else if (originalFormat == "YUV422P") { + return new RGBA32DataFromYUV422PData(0, 1, 2, 3); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new RGBA32DataFromYUV420PData(0, 1, 2, 3); + } else { + return new RGBA32Data(); + } + } else if (format == "BGRA32") { + if (originalFormat == "YUV444P") { + return new RGBA32DataFromYUV444PData(2, 1, 0, 3); + } else if (originalFormat == "YUV422P") { + return new RGBA32DataFromYUV422PData(2, 1, 0, 3); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new RGBA32DataFromYUV420PData(2, 1, 0, 3); + } else { + return new BGRA32Data(); + } + } else if (format == "RGB24") { + if (originalFormat == "YUV444P") { + return new RGBA32DataFromYUV444PData(0, 1, 2); + } else if (originalFormat == "YUV422P") { + return new RGBA32DataFromYUV422PData(0, 1, 2); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new RGBA32DataFromYUV420PData(0, 1, 2); + } else { + return new RGB24Data(); + } + } else if (format == "BGR24") { + if (originalFormat == "YUV444P") { + return new RGBA32DataFromYUV444PData(2, 1, 0); + } else if (originalFormat == "YUV422P") { + return new RGBA32DataFromYUV422PData(2, 1, 0); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new RGBA32DataFromYUV420PData(2, 1, 0); + } else { + return new BGR24Data(); + } + } else if (format == "GRAY8") { + if (originalFormat == "YUV444P" || + originalFormat == "YUV422P" || + originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new Gray8DataFromYUVData(); + } else { + return new Gray8Data(); + } + } else if (format == "YUV444P") { + if (originalFormat == "YUV422P") { + return new YUV444PDataFromYUV422PData(); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new YUV444PDataFromYUV420PData(); + } else { + return new YUV444PData(); + } + } else if (format == "YUV422P") { + if (originalFormat == "YUV444P") { + return new YUV422PDataFromYUV444PData(); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new YUV422PDataFromYUV420PData(); + } else { + return new YUV422PData(); + } + } else if (format == "YUV420P") { + if (originalFormat == "YUV444P") { + return new YUV420PDataFromYUV444PData(); + } else if (originalFormat == "YUV422P") { + return new YUV420PDataFromYUV422PData(); + } else { + return new YUV420PData(); + } + } else if (format == "YUV420SP_NV12") { + if (originalFormat == "YUV444P") { + return new NV12DataFromYUV444PData(); + } else if (originalFormat == "YUV422P") { + return new NV12DataFromYUV422PData(); + } else { + return new NV12Data(); + } + } else if (format == "YUV420SP_NV21") { + if (originalFormat == "YUV444P") { + return new NV21DataFromYUV444PData(); + } else if (originalFormat == "YUV422P") { + return new NV21DataFromYUV422PData(); + } else { + return new NV21Data(); + } + } else if (format == "HSV") { + if (originalFormat == "YUV444P") { + return new HSVDataFromYUV444PData(); + } else if (originalFormat == "YUV422P") { + return new HSVDataFromYUV422PData(); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new HSVDataFromYUV420PData(); + } else if (originalFormat == "Lab") { + return new HSVDataFromLabData(); + } else { + return new HSVData(); + } + } else if (format == "Lab") { + if (originalFormat == "YUV444P") { + return new LabDataFromYUV444PData(); + } else if (originalFormat == "YUV422P") { + return new LabDataFromYUV422PData(); + } else if (originalFormat == "YUV420P" || + originalFormat == "YUV420SP_NV12" || + originalFormat == "YUV420SP_NV21") { + return new LabDataFromYUV420PData(); + } else { + return new LabData(); + } + } else if (format == "DEPTH") { + return new DepthData(); + } +} + +function getTestData(sourceFromat, destinationFormat) { + return [getData(sourceFromat), getData(destinationFormat, sourceFromat)]; +} \ No newline at end of file diff --git a/dom/canvas/test/imagebitmap_extensions_on_worker.js b/dom/canvas/test/imagebitmap_extensions_on_worker.js new file mode 100644 index 000000000..63116e80e --- /dev/null +++ b/dom/canvas/test/imagebitmap_extensions_on_worker.js @@ -0,0 +1,47 @@ +importScripts("imagebitmap_extensions_data.js"); +importScripts("imagebitmap_extensions.js"); + +var gGroundTruthImageData; +var gImageData; +var gImageBitmap; +var gPNGBlob; +var gJPEGBlob; + +onmessage = function(event) { + if (event.data.type == "setSources") { + gGroundTruthImageData = event.data.groundTruthImageData; + gImageData = event.data.imageData; + gImageBitmap = event.data.imageBitmap; + gPNGBlob = event.data.pngBlob; + gJPEGBlob = event.data.jpegBlob; + + ok(!!gGroundTruthImageData, "Get gGroundTruthImageData!"); + ok(!!gImageData, "Get gImageData!"); + ok(!!gImageBitmap, "Get gImageBitmap!"); + ok(!!gPNGBlob, "Get gPNGBlob!"); + ok(!!gJPEGBlob, "Get gJPEGBlob!"); + + runTests(); + } +}; + +function ok(expect, msg) { + postMessage({"type": "status", status: !!expect, msg: msg}); +} + +function runTests() { + testExceptions(). + then(testColorConversions()). + then( function() { return Promise.all([testAccessing_randomTest("ImageData", gImageData, 0), + testAccessing_randomTest("ImageBitmap", gImageBitmap, 0), + testAccessing_randomTest("PNG", gPNGBlob, 0), + testAccessing_randomTest("JPEG", gJPEGBlob, 10) // JPEG loses information + ]); }). + then( function() { return Promise.all([testCreateFromArrayBffer_randomTest("ImageData", gImageData, 0), + testCreateFromArrayBffer_randomTest("ImageBitmap", gImageBitmap, 0), + testCreateFromArrayBffer_randomTest("PNG", gPNGBlob, 0), + testCreateFromArrayBffer_randomTest("JPEG", gJPEGBlob, 10) // JPEG loses information + ]); }). + then(function() { return testInvalidAccess([gImageData, gImageBitmap, gPNGBlob, gJPEGBlob]); } ). + then(function() {postMessage({"type": "finish"});}, function(ev) { failed(ev); postMessage({"type": "finish"}); }); +} \ No newline at end of file diff --git a/dom/canvas/test/imagebitmap_extensions_prepareSources.js b/dom/canvas/test/imagebitmap_extensions_prepareSources.js new file mode 100644 index 000000000..db077a098 --- /dev/null +++ b/dom/canvas/test/imagebitmap_extensions_prepareSources.js @@ -0,0 +1,94 @@ +var gImage; +var gVideo; +var gCanvas; +var gCtx; +var gImageData; +var gImageBitmap; +var gPNGBlob; +var gJPEGBlob; + +var gGroundTruthImageData; + +function prepareSources() { + gVideo = document.createElement("video"); + gVideo.src = "http://example.com/tests/dom/canvas/test/crossorigin/video.sjs?name=tests/dom/media/test/320x240.ogv&type=video/ogg&cors=anonymous"; + gVideo.crossOrigin = "anonymous"; + gVideo.autoplay = "true" + + + gCanvas = document.createElement("canvas"); + gCtx = gCanvas.getContext("2d"); + + var resolver; + var promise = new Promise(function(resolve, reject) { + resolver = resolve; + }); + + // Prepare video. + gVideo.onloadeddata = function() { + ok(gVideo, "[Prepare Sources] gVideo is ok."); + + // Prepare canvas. + gCanvas.width = gVideo.videoWidth; + gCanvas.height = gVideo.videoHeight; + gCtx.drawImage(gVideo, 0, 0); + ok(gCanvas, "[Prepare Sources] gCanvas is ok."); + ok(gCtx, "[Prepare Sources] gCtx is ok."); + + // Prepare gGroundTruthImageData. + gGroundTruthImageData = gCtx.getImageData(0, 0, gCanvas.width, gCanvas.height); + ok(gGroundTruthImageData, "[Prepare Sources] gGroundTruthImageData is ok."); + + // Prepare image. + gImage = document.createElement("img"); + gImage.src = gCanvas.toDataURL(); + var resolverImage; + var promiseImage = new Promise(function(resolve, reject) { + resolverImage = resolve; + }); + gImage.onload = function() { + resolverImage(true); + } + + // Prepare ImageData. + gImageData = gCtx.getImageData(0, 0, gCanvas.width, gCanvas.height); + ok(gImageData, "[Prepare Sources] gImageData is ok."); + + // Prepapre PNG Blob. + var promisePNGBlob = new Promise(function(resolve, reject) { + gCanvas.toBlob(function(blob) { + gPNGBlob = blob; + ok(gPNGBlob, "[Prepare Sources] gPNGBlob is ok."); + resolve(true); + }); + }); + + // Prepare JPEG Blob. + var promiseJPEGBlob = new Promise(function(resolve, reject) { + gCanvas.toBlob(function(blob) { + gJPEGBlob = blob; + ok(gJPEGBlob, "[Prepare Sources] gJPEGBlob is ok."); + resolve(true); + }, "image/jpeg", 1.00); + }); + + // Prepare ImageBitmap. + var promiseImageBitmap = new Promise(function(resolve, reject) { + var p = createImageBitmap(gCanvas); + p.then(function(bitmap) { + gImageBitmap = bitmap; + ok(gImageBitmap, "[Prepare Sources] gImageBitmap is ok."); + resolve(true); + }); + }); + + resolver(Promise.all([ + promiseImage, + promisePNGBlob, + promiseJPEGBlob, + promiseImageBitmap + ])) + } + + return promise; +} \ No newline at end of file diff --git a/dom/canvas/test/imagebitmap_on_worker.js b/dom/canvas/test/imagebitmap_on_worker.js new file mode 100644 index 000000000..be7046710 --- /dev/null +++ b/dom/canvas/test/imagebitmap_on_worker.js @@ -0,0 +1,86 @@ +importScripts("imagebitmap_bug1239300.js"); + +function ok(expect, msg) { + postMessage({type: "status", status: !!expect, msg: msg}); +} + +function doneTask() { + postMessage({type: "doneTask"}); +} + +function promiseThrows(p, name) { + var didThrow; + return p.then(function() { didThrow = false; }, + function() { didThrow = true; }) + .then(function() { ok(didThrow, "[TestException] " + name); }); +} + +onmessage = function(event) { + if (event.data.type == "testImageData") { + var width = event.data.width; + var height = event.data.height; + var imageData = event.data.source; + ok(imageData, "[CreateFromImageData] An ImageData is passed into worker.") + ok(imageData.width == width, "[CreateFromImageData] Passed ImageData has right width = " + width); + ok(imageData.height == height, "[CreateFromImageData] Passed ImageData has right height = " + height); + + var promise = createImageBitmap(imageData); + promise.then(function(bitmap) { + ok(bitmap, "[CreateFromImageData] ImageBitmap is created successfully."); + ok(bitmap.width == width, "[CreateFromImageData] ImageBitmap.width = " + bitmap.width + ", expected witdth = " + width); + ok(bitmap.height == height, "[CreateFromImageData] ImageBitmap.height = " + bitmap.height + ", expected height = " + height); + + doneTask(); + }); + } else if (event.data.type == "testBlob") { + var width = event.data.width; + var height = event.data.height; + var blob = event.data.source; + ok(blob, "[CreateFromBlob] A Blob object is passed into worker."); + + var promise = createImageBitmap(blob); + promise.then(function(bitmap) { + ok(bitmap, "[CreateFromBlob] ImageBitmap is created successfully."); + ok(bitmap.width == width, "[CreateFromBlob] ImageBitmap.width = " + bitmap.width + ", expected witdth = " + width); + ok(bitmap.height == height, "[CreateFromBlob] ImageBitmap.height = " + bitmap.height + ", expected height = " + height); + + doneTask(); + }); + } else if (event.data.type == "testImageBitmap") { + var width = event.data.width; + var height = event.data.height; + var source = event.data.source; + ok(source, "[CreateFromImageBitmap] A soruce object is passed into worker."); + + var promise = createImageBitmap(source); + promise.then(function(bitmap) { + ok(bitmap, "[CreateFromImageBitmap] ImageBitmap is created successfully."); + ok(bitmap.width == width, "[CreateFromImageBitmap] ImageBitmap.width = " + bitmap.width + ", expected witdth = " + width); + ok(bitmap.height == height, "[CreateFromImageBitmap] ImageBitmap.height = " + bitmap.height + ", expected height = " + height); + + var promise2 = createImageBitmap(bitmap); + promise2.then(function(bitmap2) { + ok(bitmap2, "[CreateFromImageBitmap] 2nd ImageBitmap is created successfully."); + ok(bitmap.width == width, "[CreateFromImageBitmap] ImageBitmap.width = " + bitmap.width + ", expected witdth = " + width); + ok(bitmap.height == height, "[CreateFromImageBitmap] ImageBitmap.height = " + bitmap.height + ", expected height = " + height); + + doneTask(); + }); + }); + } else if (event.data.type == "testException") { + var source = event.data.source; + if (event.data.sx) { + var sx = event.data.sx; + var sy = event.data.sy; + var sw = event.data.sw; + var sh = event.data.sh; + promiseThrows(createImageBitmap(source, sx, sy, sw, sh), event.data.msg); + } else { + promiseThrows(createImageBitmap(source), event.data.msg); + } + doneTask(); + } else if (event.data.type == "testBug1239300") { + var promise = testBug1239300(); + promise.then(doneTask, doneTask); + } +}; \ No newline at end of file diff --git a/dom/canvas/test/imagebitmap_structuredclone.js b/dom/canvas/test/imagebitmap_structuredclone.js new file mode 100644 index 000000000..56bbdf228 --- /dev/null +++ b/dom/canvas/test/imagebitmap_structuredclone.js @@ -0,0 +1,35 @@ +function ok(expect, msg) { + postMessage({"type": "status", status: !!expect, msg: msg}); +} + +onmessage = function(event) { + ok(!!event.data.bitmap1, "Get the 1st ImageBitmap from the main script."); + ok(!!event.data.bitmap2, "Get the 2nd ImageBitmap from the main script."); + ok(!!event.data.bitmap3, "Get the 3rd ImageBitmap from the main script."); + + // send the first original ImageBitmap back to the main-thread + postMessage({"type":"bitmap1", + "bitmap":event.data.bitmap1}); + + // create a new ImageBitmap from the 2nd original ImageBitmap + // and then send the newly created ImageBitmap back to the main-thread + var promise = createImageBitmap(event.data.bitmap2); + promise.then( + function(bitmap) { + ok(true, "Successfully create a new ImageBitmap from the 2nd original bitmap in worker."); + + // send the newly created ImageBitmap back to the main-thread + postMessage({"type":"bitmap2", "bitmap":bitmap}); + + // finish the test + postMessage({"type": "finish"}); + }, + function() { + ok(false, "Cannot create a new bitmap from the original bitmap in worker."); + } + ); + + // send the third original ImageBitmap back to the main-thread + postMessage({"type":"bitmap3", + "bitmap":event.data.bitmap3}); +} diff --git a/dom/canvas/test/imagebitmap_structuredclone_iframe.html b/dom/canvas/test/imagebitmap_structuredclone_iframe.html new file mode 100644 index 000000000..b14b40312 --- /dev/null +++ b/dom/canvas/test/imagebitmap_structuredclone_iframe.html @@ -0,0 +1,38 @@ + + + + + diff --git a/dom/canvas/test/imagebitmap_structuredclone_utils.js b/dom/canvas/test/imagebitmap_structuredclone_utils.js new file mode 100644 index 000000000..39dda37c8 --- /dev/null +++ b/dom/canvas/test/imagebitmap_structuredclone_utils.js @@ -0,0 +1,157 @@ +var gImage1; +var gImage2; +var gImageBitmap1; +var gImageBitmap2; + +// Bug 1239752. +var gImageData; +var gImageBitmap3; + +function comparePixelColor(testImgageData, groundTruthImageData, x, y, tolerance, info) { + ok(testImgageData.width == groundTruthImageData.width && testImgageData.height == groundTruthImageData.height, + "testImgageData and groundTruthImageData should have the same dimension."); + + var index = (groundTruthImageData.width * y + x) * 4; + var r = groundTruthImageData.data[index + 0]; + var g = groundTruthImageData.data[index + 1]; + var b = groundTruthImageData.data[index + 2]; + var a = groundTruthImageData.data[index + 3]; + var newR = testImgageData.data[index + 0]; + var newG = testImgageData.data[index + 1]; + var newB = testImgageData.data[index + 2]; + var newA = testImgageData.data[index + 3]; + var isTheSame = Math.abs(r - newR) <= tolerance && + Math.abs(g - newG) <= tolerance && + Math.abs(b - newB) <= tolerance && + Math.abs(a - newA) <= tolerance; + ok(isTheSame, "[" + info + "] " + + "newImageData(" + newR + "," + newG + "," + newB + "," + newA + + ") should equal to imageData(" + r + "," + g + "," + b + "," + a + ")."); +} + +function compareImageBitmapWithImageElement(imageBitmap, imageElement) { + var canvas1 = document.createElement('canvas'); + var canvas2 = document.createElement('canvas'); + + canvas1.width = imageElement.naturalWidth; + canvas1.height = imageElement.naturalHeight; + canvas2.width = imageElement.naturalWidth; + canvas2.height = imageElement.naturalHeight; + + var ctx1 = canvas1.getContext('2d'); + var ctx2 = canvas2.getContext('2d'); + + ctx1.drawImage(imageElement, 0, 0); + ctx2.drawImage(imageBitmap, 0, 0); + + document.body.appendChild(canvas1); + document.body.appendChild(canvas2); + + var imageData1 = ctx1.getImageData(0, 0, canvas1.width, canvas1.height); + var imageData2 = ctx2.getImageData(0, 0, canvas2.width, canvas2.height); + + // Create an array of pixels that is going to be tested. + var pixels = []; + var xGap = imageElement.naturalWidth / 4; + var yGap = imageElement.naturalHeight / 4; + for (var y = 0; y < imageElement.naturalHeight; y += yGap) { + for (var x = 0; x < imageElement.naturalWidth; x += xGap) { + pixels.push({"x":x, "y":y}); + } + } + + // Also, put the button-right pixel into pixels. + pixels.push({"x":imageElement.naturalWidth-1, "y":imageElement.naturalHeight-1}); + + // Do the test. + for (var pixel of pixels) { + comparePixelColor(imageData2, imageData1, pixel.x, pixel.y, 0); + } +} + +function compareImageBitmapWithImageData(imageBitmap, imageData, info) { + var canvas1 = document.createElement('canvas'); + + canvas1.width = imageBitmap.width; + canvas1.height = imageBitmap.height; + + var ctx1 = canvas1.getContext('2d'); + + ctx1.drawImage(imageBitmap, 0, 0); + + document.body.appendChild(canvas1); + + var imageData1 = ctx1.getImageData(0, 0, canvas1.width, canvas1.height); + + // Create an array of pixels that is going to be tested. + var pixels = []; + var xGap = imageBitmap.width / 4; + var yGap = imageBitmap.height / 4; + for (var y = 0; y < imageBitmap.height; y += yGap) { + for (var x = 0; x < imageBitmap.width; x += xGap) { + pixels.push({"x":x, "y":y}); + } + } + + // Also, put the button-right pixel into pixels. + pixels.push({"x":imageBitmap.width-1, "y":imageBitmap.height-1}); + + // Do the test. + for (var pixel of pixels) { + comparePixelColor(imageData1, imageData, pixel.x, pixel.y, 5, info); + } +} + +function prepareImageBitmaps() { + gImage1 = document.createElement('img'); + gImage2 = document.createElement('img'); + gImage1.src = "image_rgrg-256x256.png"; + gImage2.src = "image_yellow.png"; + + var p1 = new Promise(function(resolve, reject) { + gImage1.onload = function() { + var promise = createImageBitmap(gImage1); + promise.then(function(bitmap) { + gImageBitmap1 = bitmap; + resolve(true); + }); + } + }); + + var p2 = new Promise(function(resolve, reject) { + gImage2.onload = function() { + var promise = createImageBitmap(gImage2); + promise.then(function(bitmap) { + gImageBitmap2 = bitmap; + resolve(true); + }); + } + }); + + var p3 = new Promise(function(resolve, reject) { + // Create an ImageData with random colors. + var width = 5; + var height = 10; + var data = [43,143,24,148, 235,165,179,91, 74,228,75,195, 141,109,74,65, 25,177,3,201, + 128,105,12,199, 196,93,241,131, 250,121,232,189, 175,131,216,190, 145,123,167,70, + 18,196,210,162, 225,1,90,188, 223,216,182,233, 118,50,168,56, 51,206,198,199, + 153,29,70,130, 180,135,135,51, 148,46,44,144, 80,171,142,95, 25,178,102,110, + 0,28,128,91, 31,222,42,170, 85,8,218,146, 65,30,198,238, 121,57,124,88, + 246,40,141,146, 174,195,255,149, 30,153,92,116, 18,241,6,111, 39,162,85,143, + 237,159,201,244, 93,68,14,246, 143,143,83,221, 187,215,243,154, 24,125,221,53, + 80,153,151,219, 202,241,250,191, 153,129,181,57, 94,18,136,231, 41,252,168,207, + 213,103,118,172, 53,213,184,204, 25,29,249,199, 101,55,49,167, 25,23,173,78, + 19,234,205,155, 250,175,44,201, 215,92,25,59, 25,29,249,199, 153,129,181,57]; + + gImageData = new ImageData(new Uint8ClampedArray(data), width, height); + + // Create an ImageBitmap from the above ImageData. + createImageBitmap(gImageData).then( + (bitmap) => { gImageBitmap3 = bitmap; resolve(true); }, + () => { reject(); } + ); + + }); + + return Promise.all([p1, p2, p3]); +} \ No newline at end of file diff --git a/dom/canvas/test/mochitest.ini b/dom/canvas/test/mochitest.ini new file mode 100644 index 000000000..0347c54a7 --- /dev/null +++ b/dom/canvas/test/mochitest.ini @@ -0,0 +1,303 @@ +[DEFAULT] +support-files = + android.json + file_drawImage_document_domain.html + image_anim-gr.gif + image_anim-gr.png + image_anim-poster-gr.png + image_broken.png + image_error-early.png + image_ggrr-256x256.png + image_green-16x16.png + image_green-1x1.png + image_green-redirect + image_green-redirect^headers^ + image_green.png + image_red-16x16.png + image_red.png + image_red_crossorigin_credentials.png + image_red_crossorigin_credentials.png^headers^ + image_redtransparent.png + image_rgrg-256x256.png + image_rrgg-256x256.png + image_transparent.png + image_transparent50.png + image_yellow.png + image_yellow75.png + imagebitmap_bug1239300.js + imagebitmap_bug1239752.js + imagebitmap_extensions.html + imagebitmap_extensions.js + imagebitmap_extensions_data.js + imagebitmap_extensions_on_worker.js + imagebitmap_extensions_prepareSources.js + imagebitmap_on_worker.js + imagebitmap_structuredclone.js + imagebitmap_structuredclone_iframe.html + imagebitmap_structuredclone_utils.js + offscreencanvas.js + offscreencanvas_mask.svg + offscreencanvas_neuter.js + offscreencanvas_serviceworker_inner.html + +[test_2d.clearRect.image.offscreen.html] +[test_2d.clip.winding.html] +[test_2d.composite.canvas.color-burn.html] +[test_2d.composite.canvas.color-dodge.html] +[test_2d.composite.canvas.color.html] +[test_2d.composite.canvas.darken.html] +[test_2d.composite.canvas.destination-atop.html] +[test_2d.composite.canvas.destination-in.html] +[test_2d.composite.canvas.difference.html] +[test_2d.composite.canvas.exclusion.html] +[test_2d.composite.canvas.hard-light.html] +[test_2d.composite.canvas.hue.html] +[test_2d.composite.canvas.lighten.html] +[test_2d.composite.canvas.luminosity.html] +[test_2d.composite.canvas.multiply.html] +[test_2d.composite.canvas.overlay.html] +[test_2d.composite.canvas.saturation.html] +[test_2d.composite.canvas.screen.html] +[test_2d.composite.canvas.soft-light.html] +[test_2d.composite.canvas.source-in.html] +[test_2d.composite.canvas.source-out.html] +[test_2d.composite.image.destination-atop.html] +[test_2d.composite.image.destination-in.html] +[test_2d.composite.image.source-in.html] +[test_2d.composite.image.source-out.html] +# xor and lighter aren't well handled by cairo; they mostly work, but we don't want +# to test that +[test_2d.composite.solid.xor.html] +disabled = +[test_2d.composite.solid.lighter.html] +disabled = +[test_2d.composite.transparent.xor.html] +disabled = +[test_2d.composite.transparent.lighter.html] +disabled = +[test_2d.composite.image.xor.html] +disabled = +[test_2d.composite.image.lighter.html] +disabled = +[test_2d.composite.canvas.xor.html] +disabled = +[test_2d.composite.canvas.lighter.html] +disabled = +[test_2d.composite.clip.xor.html] +disabled = +[test_2d.composite.clip.lighter.html] +disabled = +[test_2d.composite.solid.color-burn.html] +[test_2d.composite.solid.color-dodge.html] +[test_2d.composite.solid.color.html] +[test_2d.composite.solid.darken.html] +[test_2d.composite.solid.difference.html] +[test_2d.composite.solid.exclusion.html] +[test_2d.composite.solid.hard-light.html] +[test_2d.composite.solid.hue.html] +[test_2d.composite.solid.lighten.html] +[test_2d.composite.solid.luminosity.html] +[test_2d.composite.solid.multiply.html] +[test_2d.composite.solid.overlay.html] +[test_2d.composite.solid.saturation.html] +[test_2d.composite.solid.screen.html] +[test_2d.composite.solid.soft-light.html] +[test_2d.composite.uncovered.image.destination-atop.html] +# This test fails in Suite on Linux for some reason, disable it there +skip-if = (os == 'linux' && buildapp == 'suite') +[test_2d.composite.uncovered.fill.color-burn.html] +[test_2d.composite.uncovered.fill.color-dodge.html] +[test_2d.composite.uncovered.fill.color.html] +[test_2d.composite.uncovered.fill.darken.html] +[test_2d.composite.uncovered.fill.difference.html] +[test_2d.composite.uncovered.fill.exclusion.html] +[test_2d.composite.uncovered.fill.hard-light.html] +[test_2d.composite.uncovered.fill.hue.html] +[test_2d.composite.uncovered.fill.lighten.html] +[test_2d.composite.uncovered.fill.luminosity.html] +[test_2d.composite.uncovered.fill.multiply.html] +[test_2d.composite.uncovered.fill.overlay.html] +[test_2d.composite.uncovered.fill.saturation.html] +[test_2d.composite.uncovered.fill.screen.html] +[test_2d.composite.uncovered.fill.soft-light.html] +# Tests that fail on non-Mac (bug 407107) +[test_2d.composite.uncovered.fill.source-in.html] +skip-if = toolkit != 'cocoa' +[test_2d.composite.uncovered.fill.destination-in.html] +skip-if = toolkit != 'cocoa' +[test_2d.composite.uncovered.fill.source-out.html] +skip-if = toolkit != 'cocoa' +[test_2d.composite.uncovered.fill.destination-atop.html] +skip-if = toolkit != 'cocoa' +[test_2d.composite.uncovered.image.destination-in.html] +[test_2d.composite.uncovered.image.source-in.html] +[test_2d.composite.uncovered.image.source-out.html] +# Tests that fail on non-Mac (bug 407107) +[test_2d.composite.uncovered.pattern.source-in.html] +skip-if = toolkit != 'cocoa' +[test_2d.composite.uncovered.pattern.destination-in.html] +skip-if = toolkit != 'cocoa' +[test_2d.composite.uncovered.pattern.source-out.html] +skip-if = toolkit != 'cocoa' +[test_2d.composite.uncovered.pattern.destination-atop.html] +skip-if = toolkit != 'cocoa' +[test_2d.drawImage.zerocanvas.html] +[test_2d.fill.winding.html] +[test_2d.fill.pattern.imageSmoothingEnabled.html] +# These tests do not pass on any platform; Quartz backend won't pass them +# because we fall back to pixman when one circle doesn't contain the other. +# See bug 512647. +[test_2d.gradient.radial.cone.shape2.html] +disabled = bug 512647 +[test_2d.gradient.radial.cone.behind.html] +disabled = bug 512647 +[test_2d.gradient.radial.cone.beside.html] +disabled = bug 512647 +# This is an issue with Quartz's handling of radial gradients and some numeric +# imprecision that results in errors here. SkiaGL (on Android) also has +# a similar problem. +[test_2d.gradient.radial.inside2.html] +skip-if = toolkit == 'cocoa' || toolkit == 'android' +[test_2d.gradient.radial.inside3.html] +skip-if = toolkit == 'cocoa' || toolkit == 'android' +[test_2d.gradient.radial.outside1.html] +skip-if = toolkit == 'cocoa' || toolkit == 'android' +[test_2d.gradient.radial.cone.front.html] +skip-if = toolkit == 'cocoa' || toolkit == 'android' +[test_2d.gradient.radial.cone.top.html] +skip-if = toolkit == 'cocoa' || toolkit == 'android' +# Tests that fail on non-Mac (bug 407107) +[test_2d.gradient.radial.outside2.html] +skip-if = toolkit != 'cocoa' +[test_2d.gradient.radial.outside3.html] +disabled = bug 1038277 +# These tests only pass on Mac OS X >= 10.5; see bug 450114 +[test_2d.gradient.radial.touch1.html] +disabled = bug 450114 +[test_2d.gradient.radial.touch2.html] +disabled = bug 450114 +[test_2d.gradient.radial.touch3.html] +disabled = bug 450114 +[test_2d.gradient.radial.equal.html] +disabled = bug 450114 +[test_2d.isPointInPath.winding.html] +[test_2d.line.cap.closed.html] +# This is another Quartz bug -- closed paths that don't lie fully within the +# destination bounds seem to have problems with the BEVEL/SQUARE join/cap combo. +# The joins are rendered as if with MITER; the correct behaviour is also seen +# if BUTT is used instead of SQUARE. +skip-if = toolkit == 'cocoa' +[test_2d.line.join.parallel.html] +# Tests that fail on Mac (possibly because spec is underdefined?). Bug 407105 +# XXX vlad don't test these anywhere, cairo behaviour changed +skip-if = toolkit == 'cocoa' +# Tests that fail on non-Mac (bug 407107) +[test_2d.path.arc.shape.3.html] +skip-if = toolkit != 'cocoa' +[test_2d.path.rect.selfintersect.html] +skip-if = toolkit != 'cocoa' +# This test is bogus according to the spec; see bug 407107 +[test_2d.path.rect.zero.6.html] +disabled = bug 407107 +[test_2d.strokeRect.zero.5.html] +[test_bitmaprenderer.html] +[test_bug232227.html] +[test_bug613794.html] +[test_bug764125.html] +[test_bug856472.html] +[test_bug866575.html] +[test_bug902651.html] +[test_bug1215072.html] +subsuite = gpu +[test_canvas.html] +skip-if = (android_version == '18' && debug) #android 4.3 debug bug 1143317 +[test_canvas_focusring.html] +skip-if = os == 'win' +[test_canvas_font_setter.html] +[test_canvas_path.html] +[test_hitregion_canvas.html] +[test_hitregion_event.html] +skip-if = os == "android" +[test_canvas_strokeStyle_getter.html] +[test_capture.html] +support-files = captureStream_common.js +[test_drawImageIncomplete.html] +[test_drawImage_document_domain.html] +[test_drawImage_edge_cases.html] +[test_drawWindow.html] +support-files = file_drawWindow_source.html file_drawWindow_common.js +[test_imagebitmap.html] +tags = imagebitmap +[test_imagebitmap_close.html] +tags = imagebitmap +[test_imagebitmap_cropping.html] +tags = imagebitmap +[test_imagebitmap_extensions.html] +tags = imagebitmap +[test_imagebitmap_extensions_on_worker.html] +tags = imagebitmap +[test_imagebitmap_on_worker.html] +tags = imagebitmap +[test_imagebitmap_structuredclone.html] +tags = imagebitmap +[test_imagebitmap_structuredclone_iframe.html] +tags = imagebitmap +[test_imagebitmap_structuredclone_window.html] +tags = imagebitmap +[test_imagebitmap_transfer.html] +tags = imagebitmap +[test_ImageData_ctor.html] +[test_isPointInStroke.html] +[test_mozGetAsFile.html] +[test_strokeText_throw.html] +[test_toBlob.html] +[test_toDataURL_alpha.html] +[test_toDataURL_lowercase_ascii.html] +[test_toDataURL_parameters.html] +[test_windingRuleUndefined.html] +[test_2d.fillText.gradient.html] +[test_2d_composite_canvaspattern_setTransform.html] +[test_createPattern_broken.html] +[test_filter.html] +skip-if = (e10s && debug && os == 'win') +[test_filter_tainted.html] +[test_offscreencanvas_toblob.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_toimagebitmap.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_basic_webgl.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_dynamic_fallback.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_sharedworker.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_serviceworker.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_neuter.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_many.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_sizechange.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 +[test_offscreencanvas_subworker.html] +subsuite = gpu +tags = offscreencanvas +skip-if = 1 diff --git a/dom/canvas/test/offscreencanvas.js b/dom/canvas/test/offscreencanvas.js new file mode 100644 index 000000000..50e6a1d53 --- /dev/null +++ b/dom/canvas/test/offscreencanvas.js @@ -0,0 +1,364 @@ +/* WebWorker for test_offscreencanvas_*.html */ +(function(){ + +var port = null; + +function isInWorker() { + try { + return !(self instanceof Window); + } catch (e) { + return true; + } +} + +function postMessageGeneral(data) { + if (isInWorker()) { + if (port) { + port.postMessage(data); + } else { + postMessage(data); + } + } else { + postMessage(data, "*"); + } +} + +function ok(expect, msg) { + postMessageGeneral({type: "test", result: !!expect, name: msg}); +} + +function finish() { + postMessageGeneral({type: "finish"}); +} + +function drawCount(count) { + postMessageGeneral({type: "draw", count: count}); +} + +function sendBlob(blob) { + postMessageGeneral({type: "blob", blob: blob}); +} + +function sendImageBitmap(img) { + if (port) { + port.postMessage({type: "imagebitmap", bitmap: img}); + } else { + postMessage({type: "imagebitmap", bitmap: img}); + } +} + +//-------------------------------------------------------------------- +// WebGL Drawing Functions +//-------------------------------------------------------------------- +function createDrawFunc(canvas) { + var gl; + + try { + gl = canvas.getContext("experimental-webgl"); + } catch (e) {} + + if (!gl) { + ok(false, "WebGL is unavailable"); + return null; + } + + var vertSrc = "attribute vec2 position; \ + void main(void) { \ + gl_Position = vec4(position, 0.0, 1.0); \ + }"; + + var fragSrc = "precision mediump float; \ + void main(void) { \ + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); \ + }"; + + // Returns a valid shader, or null on errors. + var createShader = function(src, t) { + var shader = gl.createShader(t); + + gl.shaderSource(shader, src); + gl.compileShader(shader); + + return shader; + }; + + var createProgram = function(vsSrc, fsSrc) { + var vs = createShader(vsSrc, gl.VERTEX_SHADER); + var fs = createShader(fsSrc, gl.FRAGMENT_SHADER); + + var prog = gl.createProgram(); + gl.attachShader(prog, vs); + gl.attachShader(prog, fs); + gl.linkProgram(prog); + + if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) { + var str = "Shader program linking failed:"; + str += "\nShader program info log:\n" + gl.getProgramInfoLog(prog); + str += "\n\nVert shader log:\n" + gl.getShaderInfoLog(vs); + str += "\n\nFrag shader log:\n" + gl.getShaderInfoLog(fs); + console.log(str); + ok(false, "Shader program linking failed"); + return null; + } + + return prog; + }; + + gl.disable(gl.DEPTH_TEST); + + var program = createProgram(vertSrc, fragSrc); + ok(program, "Creating shader program"); + + program.positionAttr = gl.getAttribLocation(program, "position"); + ok(program.positionAttr >= 0, "position attribute should be valid"); + + var vertCoordArr = new Float32Array([ + -1, -1, + 1, -1, + -1, 1, + 1, 1, + ]); + var vertCoordBuff = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vertCoordBuff); + gl.bufferData(gl.ARRAY_BUFFER, vertCoordArr, gl.STATIC_DRAW); + + var checkGLError = function(prefix, refValue) { + if (!refValue) { + refValue = 0; + } + + var error = gl.getError(); + ok(error == refValue, + prefix + 'gl.getError should be 0x' + refValue.toString(16) + + ', was 0x' + error.toString(16) + '.'); + }; + + var testPixel = function(x, y, refData, infoString) { + var pixel = new Uint8Array(4); + gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); + + var pixelMatches = pixel[0] == refData[0] && + pixel[1] == refData[1] && + pixel[2] == refData[2] && + pixel[3] == refData[3]; + ok(pixelMatches, infoString); + }; + + var preDraw = function(prefix) { + gl.clearColor(1.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + testPixel(0, 0, [255, 0, 0, 255], prefix + 'Should be red before drawing.'); + }; + + var postDraw = function(prefix) { + testPixel(0, 0, [0, 255, 0, 255], prefix + 'Should be green after drawing.'); + }; + + gl.useProgram(program); + gl.enableVertexAttribArray(program.position); + gl.vertexAttribPointer(program.position, 2, gl.FLOAT, false, 0, 0); + + // Start drawing + checkGLError('after setup'); + + return function(prefix, needCommitFrame) { + if (prefix) { + prefix = "[" + prefix + "] "; + } else { + prefix = ""; + } + + gl.viewport(0, 0, canvas.width, canvas.height); + checkGLError(prefix + "[viewport]"); + + preDraw(prefix); + checkGLError(prefix + "[predraw]"); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); + checkGLError(prefix + "[drawarrays]"); + postDraw(prefix); + checkGLError(prefix + "[postdraw]"); + if (needCommitFrame) { + gl.commit(); + checkGLError(prefix + "[commit]"); + } + checkGLError(prefix); + }; +} + +/* entry point */ +function entryFunction(testStr, subtests, offscreenCanvas) { + var test = testStr; + var canvas = offscreenCanvas; + if (test == "webgl_imagebitmap") { + canvas = new OffscreenCanvas(64, 64); + } + + if (test != "subworker") { + ok(canvas, "Canvas successfully transfered to worker"); + ok(canvas.getContext, "Canvas has getContext"); + + ok(canvas.width == 64, "OffscreenCanvas width should be 64"); + ok(canvas.height == 64, "OffscreenCanvas height should be 64"); + } + + var draw; + + //------------------------------------------------------------------------ + // Basic WebGL test + //------------------------------------------------------------------------ + if (test == "webgl") { + draw = createDrawFunc(canvas); + if (!draw) { + finish(); + return; + } + + var count = 0; + var iid = setInterval(function() { + if (count++ > 20) { + clearInterval(iid); + ok(true, "Worker is done"); + finish(); + return; + } + draw("loop " +count, true); + }, 0); + } + //------------------------------------------------------------------------ + // Test dynamic fallback + //------------------------------------------------------------------------ + else if (test == "webgl_fallback") { + draw = createDrawFunc(canvas); + if (!draw) { + return; + } + + var count = 0; + var iid = setInterval(function() { + ++count; + draw("loop " + count, true); + drawCount(count); + }, 0); + } + //------------------------------------------------------------------------ + // Test toBlob + //------------------------------------------------------------------------ + else if (test == "webgl_toblob") { + draw = createDrawFunc(canvas); + if (!draw) { + return; + } + + draw("", false); + canvas.toBlob().then(function(blob) { + sendBlob(blob); + }); + } + //------------------------------------------------------------------------ + // Test toImageBitmap + //------------------------------------------------------------------------ + else if (test == "webgl_imagebitmap") { + draw = createDrawFunc(canvas); + if (!draw) { + return; + } + + draw("", false); + var imgBitmap = canvas.transferToImageBitmap(); + sendImageBitmap(imgBitmap); + } + //------------------------------------------------------------------------ + // Canvas Size Change from Worker + //------------------------------------------------------------------------ + else if (test == "webgl_changesize") { + draw = createDrawFunc(canvas); + if (!draw) { + finish(); + return; + } + + draw("64x64", true); + + setTimeout(function() { + canvas.width = 128; + canvas.height = 128; + draw("Increased to 128x128", true); + + setTimeout(function() { + canvas.width = 32; + canvas.width = 32; + draw("Decreased to 32x32", true); + + setTimeout(function() { + canvas.width = 64; + canvas.height = 64; + draw("Increased to 64x64", true); + + ok(true, "Worker is done"); + finish(); + }, 0); + }, 0); + }, 0); + } + //------------------------------------------------------------------------ + // Using OffscreenCanvas from sub workers + //------------------------------------------------------------------------ + else if (test == "subworker") { + /* subworker tests take a list of tests to run on children */ + var stillRunning = 0; + subtests.forEach(function (subtest) { + ++stillRunning; + var subworker = new Worker('offscreencanvas.js'); + subworker.onmessage = function(evt) { + /* report finish to parent when all children are finished */ + if (evt.data.type == "finish") { + subworker.terminate(); + if (--stillRunning == 0) { + ok(true, "Worker is done"); + finish(); + } + return; + } + /* relay all other messages to parent */ + postMessage(evt.data); + }; + + var findTransferables = function(t) { + if (t.test == "subworker") { + var result = []; + t.subtests.forEach(function(test) { + result = result.concat(findTransferables(test)); + }); + + return result; + } else { + return [t.canvas]; + } + }; + + subworker.postMessage(subtest, findTransferables(subtest)); + }); + } +}; + +onmessage = function(evt) { + port = evt.ports[0]; + entryFunction(evt.data.test, evt.data.subtests, evt.data.canvas); +}; + +onconnect = function(evt) { + port = evt.ports[0]; + + port.addEventListener('message', function(evt) { + entryFunction(evt.data.test, evt.data.subtests, evt.data.canvas); + }); + + port.start(); +}; + +if (!isInWorker()) { + window.entryFunction = entryFunction; +} + +})(); diff --git a/dom/canvas/test/offscreencanvas_mask.svg b/dom/canvas/test/offscreencanvas_mask.svg new file mode 100644 index 000000000..34347b68b --- /dev/null +++ b/dom/canvas/test/offscreencanvas_mask.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/dom/canvas/test/offscreencanvas_neuter.js b/dom/canvas/test/offscreencanvas_neuter.js new file mode 100644 index 000000000..30648d740 --- /dev/null +++ b/dom/canvas/test/offscreencanvas_neuter.js @@ -0,0 +1 @@ +/* empty worker for test_offscreencanvas_disable.html */ diff --git a/dom/canvas/test/offscreencanvas_serviceworker_inner.html b/dom/canvas/test/offscreencanvas_serviceworker_inner.html new file mode 100644 index 000000000..b153f9524 --- /dev/null +++ b/dom/canvas/test/offscreencanvas_serviceworker_inner.html @@ -0,0 +1,32 @@ + + + +WebGL in OffscreenCanvas + + + + + + diff --git a/dom/canvas/test/reftest/1177726-text-stroke-bounds-ref.html b/dom/canvas/test/reftest/1177726-text-stroke-bounds-ref.html new file mode 100644 index 000000000..46d37d8ed --- /dev/null +++ b/dom/canvas/test/reftest/1177726-text-stroke-bounds-ref.html @@ -0,0 +1,24 @@ + + + + + Testcase for bug 1177726 + + + + +

No canvas.

+
+ + + + diff --git a/dom/canvas/test/reftest/1177726-text-stroke-bounds.html b/dom/canvas/test/reftest/1177726-text-stroke-bounds.html new file mode 100644 index 000000000..1f459ce0b --- /dev/null +++ b/dom/canvas/test/reftest/1177726-text-stroke-bounds.html @@ -0,0 +1,28 @@ + + + + + Testcase for bug 1177726 + + + + +

No canvas.

+
+ + + + diff --git a/dom/canvas/test/reftest/black.html b/dom/canvas/test/reftest/black.html new file mode 100644 index 000000000..d2c721b1d --- /dev/null +++ b/dom/canvas/test/reftest/black.html @@ -0,0 +1,9 @@ + + + + + + +
+ + diff --git a/dom/canvas/test/reftest/capturestream.html b/dom/canvas/test/reftest/capturestream.html new file mode 100644 index 000000000..b07ab394b --- /dev/null +++ b/dom/canvas/test/reftest/capturestream.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/clip-multiple-move-1-ref.html b/dom/canvas/test/reftest/clip-multiple-move-1-ref.html new file mode 100644 index 000000000..4e85b7656 --- /dev/null +++ b/dom/canvas/test/reftest/clip-multiple-move-1-ref.html @@ -0,0 +1,22 @@ + + + + + + diff --git a/dom/canvas/test/reftest/clip-multiple-move-1.html b/dom/canvas/test/reftest/clip-multiple-move-1.html new file mode 100644 index 000000000..3dbd0391d --- /dev/null +++ b/dom/canvas/test/reftest/clip-multiple-move-1.html @@ -0,0 +1,27 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/clip-multiple-move-2-ref.html b/dom/canvas/test/reftest/clip-multiple-move-2-ref.html new file mode 100644 index 000000000..8b3d37a36 --- /dev/null +++ b/dom/canvas/test/reftest/clip-multiple-move-2-ref.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/clip-multiple-move-2.html b/dom/canvas/test/reftest/clip-multiple-move-2.html new file mode 100644 index 000000000..55e272f35 --- /dev/null +++ b/dom/canvas/test/reftest/clip-multiple-move-2.html @@ -0,0 +1,32 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/clip-multiple-paths-badref.html b/dom/canvas/test/reftest/clip-multiple-paths-badref.html new file mode 100644 index 000000000..42a987a19 --- /dev/null +++ b/dom/canvas/test/reftest/clip-multiple-paths-badref.html @@ -0,0 +1,22 @@ + + + + + + diff --git a/dom/canvas/test/reftest/clip-multiple-paths.html b/dom/canvas/test/reftest/clip-multiple-paths.html new file mode 100644 index 000000000..0e1e0d499 --- /dev/null +++ b/dom/canvas/test/reftest/clip-multiple-paths.html @@ -0,0 +1,27 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/colors-no-alpha.png b/dom/canvas/test/reftest/colors-no-alpha.png new file mode 100644 index 000000000..5c6f48a40 Binary files /dev/null and b/dom/canvas/test/reftest/colors-no-alpha.png differ diff --git a/dom/canvas/test/reftest/colors-non-premult.png b/dom/canvas/test/reftest/colors-non-premult.png new file mode 100644 index 000000000..727fe15a8 Binary files /dev/null and b/dom/canvas/test/reftest/colors-non-premult.png differ diff --git a/dom/canvas/test/reftest/colors-premult.png b/dom/canvas/test/reftest/colors-premult.png new file mode 100644 index 000000000..98d5e0fec Binary files /dev/null and b/dom/canvas/test/reftest/colors-premult.png differ diff --git a/dom/canvas/test/reftest/drawCustomFocusRing-ref.html b/dom/canvas/test/reftest/drawCustomFocusRing-ref.html new file mode 100644 index 000000000..e1499ff1e --- /dev/null +++ b/dom/canvas/test/reftest/drawCustomFocusRing-ref.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/drawCustomFocusRing.html b/dom/canvas/test/reftest/drawCustomFocusRing.html new file mode 100644 index 000000000..acb18b083 --- /dev/null +++ b/dom/canvas/test/reftest/drawCustomFocusRing.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/drawFocusIfNeeded-ref.html b/dom/canvas/test/reftest/drawFocusIfNeeded-ref.html new file mode 100644 index 000000000..f22f6e72c --- /dev/null +++ b/dom/canvas/test/reftest/drawFocusIfNeeded-ref.html @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/drawFocusIfNeeded.html b/dom/canvas/test/reftest/drawFocusIfNeeded.html new file mode 100644 index 000000000..048723fd4 --- /dev/null +++ b/dom/canvas/test/reftest/drawFocusIfNeeded.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/filters/default-color.html b/dom/canvas/test/reftest/filters/default-color.html new file mode 100644 index 000000000..82fb5eda3 --- /dev/null +++ b/dom/canvas/test/reftest/filters/default-color.html @@ -0,0 +1,16 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/drop-shadow-transformed.html b/dom/canvas/test/reftest/filters/drop-shadow-transformed.html new file mode 100644 index 000000000..0cf33deea --- /dev/null +++ b/dom/canvas/test/reftest/filters/drop-shadow-transformed.html @@ -0,0 +1,17 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/drop-shadow.html b/dom/canvas/test/reftest/filters/drop-shadow.html new file mode 100644 index 000000000..6977b7d5e --- /dev/null +++ b/dom/canvas/test/reftest/filters/drop-shadow.html @@ -0,0 +1,16 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1-ref.html b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1-ref.html new file mode 100644 index 000000000..897d0565f --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1-ref.html @@ -0,0 +1,12 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1.html b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1.html new file mode 100644 index 000000000..28c3d7d02 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-1.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2-ref.html b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2-ref.html new file mode 100644 index 000000000..9e416dbe9 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2-ref.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2.html b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2.html new file mode 100644 index 000000000..3abc4ae82 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-grayscale-2.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1-ref.html b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1-ref.html new file mode 100644 index 000000000..f471335c8 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1-ref.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1.html b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1.html new file mode 100644 index 000000000..898a3d926 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-1.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2-ref.html b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2-ref.html new file mode 100644 index 000000000..64762a3a6 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2-ref.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2.html b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2.html new file mode 100644 index 000000000..41c9c5c64 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-filter-opacity-2.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-shadow-1.html b/dom/canvas/test/reftest/filters/fillText-with-shadow-1.html new file mode 100644 index 000000000..a84b2fe92 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-shadow-1.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-with-shadow-2.html b/dom/canvas/test/reftest/filters/fillText-with-shadow-2.html new file mode 100644 index 000000000..17975bf37 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-with-shadow-2.html @@ -0,0 +1,15 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-without-shadow-1-ref.html b/dom/canvas/test/reftest/filters/fillText-without-shadow-1-ref.html new file mode 100644 index 000000000..5d332e3f0 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-without-shadow-1-ref.html @@ -0,0 +1,12 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/fillText-without-shadow-2-ref.html b/dom/canvas/test/reftest/filters/fillText-without-shadow-2-ref.html new file mode 100644 index 000000000..946917583 --- /dev/null +++ b/dom/canvas/test/reftest/filters/fillText-without-shadow-2-ref.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/global-alpha-ref.html b/dom/canvas/test/reftest/filters/global-alpha-ref.html new file mode 100644 index 000000000..257758140 --- /dev/null +++ b/dom/canvas/test/reftest/filters/global-alpha-ref.html @@ -0,0 +1,18 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/global-alpha.html b/dom/canvas/test/reftest/filters/global-alpha.html new file mode 100644 index 000000000..8b6eb9752 --- /dev/null +++ b/dom/canvas/test/reftest/filters/global-alpha.html @@ -0,0 +1,17 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/global-composite-operation-ref.html b/dom/canvas/test/reftest/filters/global-composite-operation-ref.html new file mode 100644 index 000000000..cad908935 --- /dev/null +++ b/dom/canvas/test/reftest/filters/global-composite-operation-ref.html @@ -0,0 +1,26 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/global-composite-operation.html b/dom/canvas/test/reftest/filters/global-composite-operation.html new file mode 100644 index 000000000..61a6f206a --- /dev/null +++ b/dom/canvas/test/reftest/filters/global-composite-operation.html @@ -0,0 +1,21 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/liveness.html b/dom/canvas/test/reftest/filters/liveness.html new file mode 100644 index 000000000..1f3b75d78 --- /dev/null +++ b/dom/canvas/test/reftest/filters/liveness.html @@ -0,0 +1,18 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/multiple-drop-shadows.html b/dom/canvas/test/reftest/filters/multiple-drop-shadows.html new file mode 100644 index 000000000..f8d9261c6 --- /dev/null +++ b/dom/canvas/test/reftest/filters/multiple-drop-shadows.html @@ -0,0 +1,16 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/ref.html b/dom/canvas/test/reftest/filters/ref.html new file mode 100644 index 000000000..bb634fe66 --- /dev/null +++ b/dom/canvas/test/reftest/filters/ref.html @@ -0,0 +1,17 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/reftest-stylo.list b/dom/canvas/test/reftest/filters/reftest-stylo.list new file mode 100644 index 000000000..a90746965 --- /dev/null +++ b/dom/canvas/test/reftest/filters/reftest-stylo.list @@ -0,0 +1,21 @@ +# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing +default-preferences pref(canvas.filters.enabled,true) + +== default-color.html default-color.html +== drop-shadow.html drop-shadow.html +== drop-shadow-transformed.html drop-shadow-transformed.html +fuzzy-if(azureSkia,1,1500) == global-alpha.html global-alpha.html +== global-composite-operation.html global-composite-operation.html +== liveness.html liveness.html +== multiple-drop-shadows.html multiple-drop-shadows.html +== shadow.html shadow.html +== subregion-fill-paint.html subregion-fill-paint.html +== subregion-stroke-paint.html subregion-stroke-paint.html +== svg-bbox.html svg-bbox.html +== svg-inline.html svg-inline.html +== svg-liveness.html svg-liveness.html +== svg-off-screen.html svg-off-screen.html +== units.html units.html +== units-em.html units-em.html +== units-ex.html units-ex.html +== units-off-screen.html units-off-screen.html diff --git a/dom/canvas/test/reftest/filters/reftest.list b/dom/canvas/test/reftest/filters/reftest.list new file mode 100644 index 000000000..983030715 --- /dev/null +++ b/dom/canvas/test/reftest/filters/reftest.list @@ -0,0 +1,30 @@ +default-preferences pref(canvas.filters.enabled,true) + +== default-color.html ref.html +== drop-shadow.html ref.html +== drop-shadow-transformed.html ref.html +fuzzy-if(azureSkia,1,1500) == global-alpha.html global-alpha-ref.html +== global-composite-operation.html global-composite-operation-ref.html +== liveness.html ref.html +== multiple-drop-shadows.html shadow-ref.html +== shadow.html shadow-ref.html +== subregion-fill-paint.html subregion-ref.html +== subregion-stroke-paint.html subregion-ref.html +== svg-bbox.html svg-bbox-ref.html +== svg-inline.html ref.html +== svg-liveness.html ref.html +== svg-off-screen.html ref.html +== units.html ref.html +== units-em.html ref.html +== units-ex.html ref.html +== units-off-screen.html ref.html +fuzzy(1,700) == fillText-with-filter-opacity-1.html fillText-with-filter-opacity-1-ref.html +fuzzy(1,302) == fillText-with-filter-opacity-2.html fillText-with-filter-opacity-2-ref.html +fuzzy(1,400) == strokeText-with-filter-grayscale-1.html strokeText-with-filter-grayscale-1-ref.html +fuzzy(1,400) == strokeText-with-filter-grayscale-2.html strokeText-with-filter-grayscale-2-ref.html +!= fillText-with-shadow-1.html fillText-without-shadow-1-ref.html +!= fillText-with-shadow-2.html fillText-without-shadow-2-ref.html +fuzzy(1,400) == fillText-with-filter-grayscale-1.html fillText-with-filter-grayscale-1-ref.html +fuzzy(1,400) == fillText-with-filter-grayscale-2.html fillText-with-filter-grayscale-2-ref.html +!= strokeText-with-shadow-1.html strokeText-without-shadow-1-ref.html +!= strokeText-with-shadow-2.html strokeText-without-shadow-2-ref.html diff --git a/dom/canvas/test/reftest/filters/shadow-ref.html b/dom/canvas/test/reftest/filters/shadow-ref.html new file mode 100644 index 000000000..736c5f94d --- /dev/null +++ b/dom/canvas/test/reftest/filters/shadow-ref.html @@ -0,0 +1,19 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/shadow.html b/dom/canvas/test/reftest/filters/shadow.html new file mode 100644 index 000000000..61de33bdc --- /dev/null +++ b/dom/canvas/test/reftest/filters/shadow.html @@ -0,0 +1,18 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1-ref.html b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1-ref.html new file mode 100644 index 000000000..e576da629 --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1-ref.html @@ -0,0 +1,12 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1.html b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1.html new file mode 100644 index 000000000..76ef3271e --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-1.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2-ref.html b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2-ref.html new file mode 100644 index 000000000..e020ab205 --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2-ref.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2.html b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2.html new file mode 100644 index 000000000..60e337498 --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-with-filter-grayscale-2.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-with-shadow-1.html b/dom/canvas/test/reftest/filters/strokeText-with-shadow-1.html new file mode 100644 index 000000000..6c7ecf137 --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-with-shadow-1.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-with-shadow-2.html b/dom/canvas/test/reftest/filters/strokeText-with-shadow-2.html new file mode 100644 index 000000000..3b8b8be47 --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-with-shadow-2.html @@ -0,0 +1,15 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-without-shadow-1-ref.html b/dom/canvas/test/reftest/filters/strokeText-without-shadow-1-ref.html new file mode 100644 index 000000000..120cce9eb --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-without-shadow-1-ref.html @@ -0,0 +1,12 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/strokeText-without-shadow-2-ref.html b/dom/canvas/test/reftest/filters/strokeText-without-shadow-2-ref.html new file mode 100644 index 000000000..0892587a5 --- /dev/null +++ b/dom/canvas/test/reftest/filters/strokeText-without-shadow-2-ref.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/subregion-fill-paint.html b/dom/canvas/test/reftest/filters/subregion-fill-paint.html new file mode 100644 index 000000000..854190359 --- /dev/null +++ b/dom/canvas/test/reftest/filters/subregion-fill-paint.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/filters/subregion-ref.html b/dom/canvas/test/reftest/filters/subregion-ref.html new file mode 100644 index 000000000..97b231b94 --- /dev/null +++ b/dom/canvas/test/reftest/filters/subregion-ref.html @@ -0,0 +1,15 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/subregion-stroke-paint.html b/dom/canvas/test/reftest/filters/subregion-stroke-paint.html new file mode 100644 index 000000000..24ed92a9b --- /dev/null +++ b/dom/canvas/test/reftest/filters/subregion-stroke-paint.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/filters/svg-bbox-ref.html b/dom/canvas/test/reftest/filters/svg-bbox-ref.html new file mode 100644 index 000000000..323cea948 --- /dev/null +++ b/dom/canvas/test/reftest/filters/svg-bbox-ref.html @@ -0,0 +1,15 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/svg-bbox.html b/dom/canvas/test/reftest/filters/svg-bbox.html new file mode 100644 index 000000000..f25e26355 --- /dev/null +++ b/dom/canvas/test/reftest/filters/svg-bbox.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/filters/svg-inline.html b/dom/canvas/test/reftest/filters/svg-inline.html new file mode 100644 index 000000000..f9be99800 --- /dev/null +++ b/dom/canvas/test/reftest/filters/svg-inline.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/filters/svg-liveness.html b/dom/canvas/test/reftest/filters/svg-liveness.html new file mode 100644 index 000000000..732fe7562 --- /dev/null +++ b/dom/canvas/test/reftest/filters/svg-liveness.html @@ -0,0 +1,64 @@ + + + + + + + + diff --git a/dom/canvas/test/reftest/filters/svg-off-screen.html b/dom/canvas/test/reftest/filters/svg-off-screen.html new file mode 100644 index 000000000..1aa22cd99 --- /dev/null +++ b/dom/canvas/test/reftest/filters/svg-off-screen.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/filters/units-em.html b/dom/canvas/test/reftest/filters/units-em.html new file mode 100644 index 000000000..44f76dc4b --- /dev/null +++ b/dom/canvas/test/reftest/filters/units-em.html @@ -0,0 +1,21 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/units-ex.html b/dom/canvas/test/reftest/filters/units-ex.html new file mode 100644 index 000000000..3bf4fadd7 --- /dev/null +++ b/dom/canvas/test/reftest/filters/units-ex.html @@ -0,0 +1,17 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/units-off-screen.html b/dom/canvas/test/reftest/filters/units-off-screen.html new file mode 100644 index 000000000..879e575c1 --- /dev/null +++ b/dom/canvas/test/reftest/filters/units-off-screen.html @@ -0,0 +1,21 @@ + + + + + + diff --git a/dom/canvas/test/reftest/filters/units-pt.html b/dom/canvas/test/reftest/filters/units-pt.html new file mode 100644 index 000000000..74fecb3d8 --- /dev/null +++ b/dom/canvas/test/reftest/filters/units-pt.html @@ -0,0 +1,16 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/filters/units.html b/dom/canvas/test/reftest/filters/units.html new file mode 100644 index 000000000..d12abdeb1 --- /dev/null +++ b/dom/canvas/test/reftest/filters/units.html @@ -0,0 +1,16 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/green.png b/dom/canvas/test/reftest/green.png new file mode 100644 index 000000000..348330a55 Binary files /dev/null and b/dom/canvas/test/reftest/green.png differ diff --git a/dom/canvas/test/reftest/mozCurrentTransform-ref.html b/dom/canvas/test/reftest/mozCurrentTransform-ref.html new file mode 100644 index 000000000..2581d87e4 --- /dev/null +++ b/dom/canvas/test/reftest/mozCurrentTransform-ref.html @@ -0,0 +1,15 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/mozCurrentTransform.html b/dom/canvas/test/reftest/mozCurrentTransform.html new file mode 100644 index 000000000..0f10ec4bc --- /dev/null +++ b/dom/canvas/test/reftest/mozCurrentTransform.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/mozCurrentTransformInverse.html b/dom/canvas/test/reftest/mozCurrentTransformInverse.html new file mode 100644 index 000000000..95831f880 --- /dev/null +++ b/dom/canvas/test/reftest/mozCurrentTransformInverse.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/dom/canvas/test/reftest/reftest-stylo.list b/dom/canvas/test/reftest/reftest-stylo.list new file mode 100644 index 000000000..795c0672a --- /dev/null +++ b/dom/canvas/test/reftest/reftest-stylo.list @@ -0,0 +1,169 @@ +# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing +# WebGL Reftests! +default-preferences pref(webgl.force-enabled,true) pref(media.useAudioChannelAPI,true) pref(dom.audiochannel.mutedByDefault,false) + +# Check that disabling works: +== webgl-disable-test.html?nogl webgl-disable-test.html?nogl +pref(webgl.disabled,true) == webgl-disable-test.html webgl-disable-test.html + +# Basic WebGL tests: +# Do we get pixels to the screen at all? +# Neither of these should ever break. +== webgl-clear-test.html webgl-clear-test.html +pref(webgl.force-layers-readback,true) == webgl-clear-test.html?readback webgl-clear-test.html?readback + +# Make sure that our choice of attribs doesn't break rendering. +== webgl-clear-test.html?depth webgl-clear-test.html?depth +== webgl-clear-test.html?stencil webgl-clear-test.html?stencil +== webgl-clear-test.html?depth&stencil webgl-clear-test.html?depth&stencil + +# Check that resize works: +== webgl-resize-test.html webgl-resize-test.html + +# Check that captureStream() displays in a local video element +== webgl-capturestream-test.html?preserve webgl-capturestream-test.html?preserve + +# Some of the failure conditions are a little crazy. I'm (jgilbert) setting these based on +# failures encountered when running on Try, and then targetting the Try config by +# differences in the `sandbox` contents. That is, I'm labeling based on symptoms rather +# than cause. +# WinXP R: winWidget && layersGPUAccelerated && !d3d11 +# Win7+ R: winWidget && layersGPUAccelerated && d3d11 +# Win7+ Ru: winWidget && !layersGPUAccelerated && d3d11 +# (Note that we have to remove spaces when used below) + +# IMPORTANT: Expected outcomes are evaluated left-to-right, and they replace eachother. +# That means that if an unconditional status (`fuzzy()`) is to the right of another status +# (such as fails-if), it will overwrite the old status. +# +# As such, all unconditional statuses should be to the left of conditional statuses. +# (See /layout/tools/reftest/reftest.js:945) + +# Does we draw the correct colors in the correct places? +# Combinations: PowerSet([readback, aa, preserve, premult, alpha]) x [frame=1,frame=6] +# This is 2^6 = 64 combinations. +== webgl-color-test.html?frame=1&__&________&_______&_____ webgl-color-test.html?frame=1&__&________&_______&_____ +== webgl-color-test.html?frame=1&aa&________&_______&_____ webgl-color-test.html?frame=1&aa&________&_______&_____ +== webgl-color-test.html?frame=1&__&preserve&_______&_____ webgl-color-test.html?frame=1&__&preserve&_______&_____ +== webgl-color-test.html?frame=1&aa&preserve&_______&_____ webgl-color-test.html?frame=1&aa&preserve&_______&_____ +== webgl-color-test.html?frame=1&__&________&premult&_____ webgl-color-test.html?frame=1&__&________&premult&_____ +== webgl-color-test.html?frame=1&aa&________&premult&_____ webgl-color-test.html?frame=1&aa&________&premult&_____ +== webgl-color-test.html?frame=1&__&preserve&premult&_____ webgl-color-test.html?frame=1&__&preserve&premult&_____ +== webgl-color-test.html?frame=1&aa&preserve&premult&_____ webgl-color-test.html?frame=1&aa&preserve&premult&_____ +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=1&__&________&_______&alpha webgl-color-test.html?frame=1&__&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=1&aa&________&_______&alpha webgl-color-test.html?frame=1&aa&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=1&__&preserve&_______&alpha webgl-color-test.html?frame=1&__&preserve&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=1&aa&preserve&_______&alpha webgl-color-test.html?frame=1&aa&preserve&_______&alpha +== webgl-color-test.html?frame=1&__&________&premult&alpha webgl-color-test.html?frame=1&__&________&premult&alpha +== webgl-color-test.html?frame=1&aa&________&premult&alpha webgl-color-test.html?frame=1&aa&________&premult&alpha +== webgl-color-test.html?frame=1&__&preserve&premult&alpha webgl-color-test.html?frame=1&__&preserve&premult&alpha +== webgl-color-test.html?frame=1&aa&preserve&premult&alpha webgl-color-test.html?frame=1&aa&preserve&premult&alpha + +== webgl-color-test.html?frame=6&__&________&_______&_____ webgl-color-test.html?frame=6&__&________&_______&_____ +== webgl-color-test.html?frame=6&aa&________&_______&_____ webgl-color-test.html?frame=6&aa&________&_______&_____ +== webgl-color-test.html?frame=6&__&preserve&_______&_____ webgl-color-test.html?frame=6&__&preserve&_______&_____ +== webgl-color-test.html?frame=6&aa&preserve&_______&_____ webgl-color-test.html?frame=6&aa&preserve&_______&_____ +== webgl-color-test.html?frame=6&__&________&premult&_____ webgl-color-test.html?frame=6&__&________&premult&_____ +== webgl-color-test.html?frame=6&aa&________&premult&_____ webgl-color-test.html?frame=6&aa&________&premult&_____ +== webgl-color-test.html?frame=6&__&preserve&premult&_____ webgl-color-test.html?frame=6&__&preserve&premult&_____ +== webgl-color-test.html?frame=6&aa&preserve&premult&_____ webgl-color-test.html?frame=6&aa&preserve&premult&_____ +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=6&__&________&_______&alpha webgl-color-test.html?frame=6&__&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=6&aa&________&_______&alpha webgl-color-test.html?frame=6&aa&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=6&__&preserve&_______&alpha webgl-color-test.html?frame=6&__&preserve&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) == webgl-color-test.html?frame=6&aa&preserve&_______&alpha webgl-color-test.html?frame=6&aa&preserve&_______&alpha +== webgl-color-test.html?frame=6&__&________&premult&alpha webgl-color-test.html?frame=6&__&________&premult&alpha +== webgl-color-test.html?frame=6&aa&________&premult&alpha webgl-color-test.html?frame=6&aa&________&premult&alpha +== webgl-color-test.html?frame=6&__&preserve&premult&alpha webgl-color-test.html?frame=6&__&preserve&premult&alpha +== webgl-color-test.html?frame=6&aa&preserve&premult&alpha webgl-color-test.html?frame=6&aa&preserve&premult&alpha + +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&_______&_____ webgl-color-test.html?frame=1&readback&__&________&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&_______&_____ webgl-color-test.html?frame=1&readback&aa&________&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&_______&_____ webgl-color-test.html?frame=1&readback&__&preserve&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&_______&_____ webgl-color-test.html?frame=1&readback&aa&preserve&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&premult&_____ webgl-color-test.html?frame=1&readback&__&________&premult&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&premult&_____ webgl-color-test.html?frame=1&readback&aa&________&premult&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&premult&_____ webgl-color-test.html?frame=1&readback&__&preserve&premult&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&premult&_____ webgl-color-test.html?frame=1&readback&aa&preserve&premult&_____ +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&_______&alpha webgl-color-test.html?frame=1&readback&__&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&_______&alpha webgl-color-test.html?frame=1&readback&aa&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&_______&alpha webgl-color-test.html?frame=1&readback&__&preserve&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&_______&alpha webgl-color-test.html?frame=1&readback&aa&preserve&_______&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&premult&alpha webgl-color-test.html?frame=1&readback&__&________&premult&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&premult&alpha webgl-color-test.html?frame=1&readback&aa&________&premult&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&premult&alpha webgl-color-test.html?frame=1&readback&__&preserve&premult&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&premult&alpha webgl-color-test.html?frame=1&readback&aa&preserve&premult&alpha + +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&_______&_____ webgl-color-test.html?frame=6&readback&__&________&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&_______&_____ webgl-color-test.html?frame=6&readback&aa&________&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&_______&_____ webgl-color-test.html?frame=6&readback&__&preserve&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&_____ webgl-color-test.html?frame=6&readback&aa&preserve&_______&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&premult&_____ webgl-color-test.html?frame=6&readback&__&________&premult&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&premult&_____ webgl-color-test.html?frame=6&readback&aa&________&premult&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&premult&_____ webgl-color-test.html?frame=6&readback&__&preserve&premult&_____ +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&premult&_____ webgl-color-test.html?frame=6&readback&aa&preserve&premult&_____ +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&_______&alpha webgl-color-test.html?frame=6&readback&__&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&_______&alpha webgl-color-test.html?frame=6&readback&aa&________&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&_______&alpha webgl-color-test.html?frame=6&readback&__&preserve&_______&alpha +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&alpha webgl-color-test.html?frame=6&readback&aa&preserve&_______&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&premult&alpha webgl-color-test.html?frame=6&readback&__&________&premult&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&premult&alpha webgl-color-test.html?frame=6&readback&aa&________&premult&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&premult&alpha webgl-color-test.html?frame=6&readback&__&preserve&premult&alpha +pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&premult&alpha webgl-color-test.html?frame=6&readback&aa&preserve&premult&alpha + +# Check for hanging bindings/state settings: +== webgl-hanging-fb-test.html?__&________ webgl-hanging-fb-test.html?__&________ +== webgl-hanging-fb-test.html?aa&________ webgl-hanging-fb-test.html?aa&________ +== webgl-hanging-fb-test.html?__&preserve webgl-hanging-fb-test.html?__&preserve +== webgl-hanging-fb-test.html?aa&preserve webgl-hanging-fb-test.html?aa&preserve +pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&__&________ webgl-hanging-fb-test.html?readback&__&________ +pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&aa&________ webgl-hanging-fb-test.html?readback&aa&________ +pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&__&preserve webgl-hanging-fb-test.html?readback&__&preserve +pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&aa&preserve webgl-hanging-fb-test.html?readback&aa&preserve + +== webgl-hanging-scissor-test.html?__ webgl-hanging-scissor-test.html?__ +== webgl-hanging-scissor-test.html?aa webgl-hanging-scissor-test.html?aa +pref(webgl.force-layers-readback,true) == webgl-hanging-scissor-test.html?readback&__ webgl-hanging-scissor-test.html?readback&__ +pref(webgl.force-layers-readback,true) == webgl-hanging-scissor-test.html?readback&aa webgl-hanging-scissor-test.html?readback&aa + + +# Check that our experimental prefs still work: + +# 16bpp for Android/B2G: [16bpp] * PowerSet([readback, premult, alpha]) +# RGB565 dithers 127 to [123,132]. (Max error: 5) +# RGBA4444 dithers 128 to [119,136], and 191 to [192]. (Max error: 9) +fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&_______&_____ webgl-color-test.html?16bpp&________&_______&_____ +fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&_______&_____ webgl-color-test.html?16bpp&readback&_______&_____ +fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&premult&_____ webgl-color-test.html?16bpp&________&premult&_____ +fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&premult&_____ webgl-color-test.html?16bpp&readback&premult&_____ +fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&_______&alpha webgl-color-test.html?16bpp&________&_______&alpha +fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&_______&alpha webgl-color-test.html?16bpp&readback&_______&alpha +fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&premult&alpha webgl-color-test.html?16bpp&________&premult&alpha +fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&premult&alpha webgl-color-test.html?16bpp&readback&premult&alpha + +# Force native GL (Windows): +skip-if(!winWidget) pref(webgl.disable-angle,true) == webgl-color-test.html?native-gl webgl-color-test.html?native-gl + + +# Non-WebGL Reftests! + +# Do we correctly handle multiple clip paths? +== clip-multiple-paths.html clip-multiple-paths.html + +# Bug 1255062 +== clip-multiple-move-1.html clip-multiple-move-1.html +== clip-multiple-move-2.html clip-multiple-move-2.html + +# Bug 815648 +== stroketext-shadow.html stroketext-shadow.html + +# focus rings +pref(canvas.focusring.enabled,true) skip-if(B2G) skip-if(cocoaWidget) skip-if(winWidget) needs-focus == drawFocusIfNeeded.html drawFocusIfNeeded.html +pref(canvas.customfocusring.enabled,true) skip-if(B2G) skip-if(cocoaWidget) skip-if(Android) skip-if(winWidget) fuzzy-if(gtkWidget,64,410) needs-focus == drawCustomFocusRing.html drawCustomFocusRing.html + +# Check that captureStream() displays in a local video element +skip == capturestream.html capturestream.html + +fuzzy-if(azureSkia,16,2) fuzzy-if(Android,3,40) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,1) == 1177726-text-stroke-bounds.html 1177726-text-stroke-bounds.html + +# Canvas Filter Reftests +include filters/reftest-stylo.list diff --git a/dom/canvas/test/reftest/reftest.list b/dom/canvas/test/reftest/reftest.list new file mode 100644 index 000000000..257f28c25 --- /dev/null +++ b/dom/canvas/test/reftest/reftest.list @@ -0,0 +1,173 @@ +# WebGL Reftests! +default-preferences pref(webgl.force-enabled,true) pref(media.useAudioChannelAPI,true) pref(dom.audiochannel.mutedByDefault,false) + +# Check that disabling works: +skip-if(Android) == webgl-disable-test.html?nogl wrapper.html?green.png +pref(webgl.disabled,true) skip-if(Android) == webgl-disable-test.html wrapper.html?green.png + +# Basic WebGL tests: +# Do we get pixels to the screen at all? +# Neither of these should ever break. +skip-if(Android) == webgl-clear-test.html wrapper.html?green.png +pref(webgl.force-layers-readback,true) skip-if(Android) == webgl-clear-test.html?readback wrapper.html?green.png + +# Make sure that our choice of attribs doesn't break rendering. +skip-if(Android) == webgl-clear-test.html?depth wrapper.html?green.png +skip-if(Android) == webgl-clear-test.html?stencil wrapper.html?green.png +skip-if(Android) == webgl-clear-test.html?depth&stencil wrapper.html?green.png + +# Check that resize works: +skip-if(Android) == webgl-resize-test.html wrapper.html?green.png + +# Check that captureStream() displays in a local video element +skip-if(Android) == webgl-capturestream-test.html?preserve wrapper.html?green.png + +# Some of the failure conditions are a little crazy. I'm (jgilbert) setting these based on +# failures encountered when running on Try, and then targetting the Try config by +# differences in the `sandbox` contents. That is, I'm labeling based on symptoms rather +# than cause. +# WinXP R: winWidget && layersGPUAccelerated && !d3d11 +# Win7+ R: winWidget && layersGPUAccelerated && d3d11 +# Win7+ Ru: winWidget && !layersGPUAccelerated && d3d11 +# (Note that we have to remove spaces when used below) + +# IMPORTANT: Expected outcomes are evaluated left-to-right, and they replace eachother. +# That means that if an unconditional status (`fuzzy()`) is to the right of another status +# (such as fails-if), it will overwrite the old status. +# +# As such, all unconditional statuses should be to the left of conditional statuses. +# (See /layout/tools/reftest/reftest.js:945) + +# Does we draw the correct colors in the correct places? +# Combinations: PowerSet([readback, aa, preserve, premult, alpha]) x [frame=1,frame=6] +# This is 2^6 = 64 combinations. +skip-if(Android) == webgl-color-test.html?frame=1&__&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=1&aa&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=1&__&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=1&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=1&__&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=1&aa&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=1&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=1&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&__&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&aa&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&__&preserve&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png +skip-if(Android) == webgl-color-test.html?frame=1&__&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) == webgl-color-test.html?frame=1&aa&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) == webgl-color-test.html?frame=1&__&preserve&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) == webgl-color-test.html?frame=1&aa&preserve&premult&alpha wrapper.html?colors-premult.png + +skip-if(Android) == webgl-color-test.html?frame=6&__&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=6&aa&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=6&__&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=6&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=6&__&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=6&aa&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=6&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) == webgl-color-test.html?frame=6&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&__&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&aa&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&__&preserve&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png +skip-if(Android) == webgl-color-test.html?frame=6&__&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) == webgl-color-test.html?frame=6&aa&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) == webgl-color-test.html?frame=6&__&preserve&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) == webgl-color-test.html?frame=6&aa&preserve&premult&alpha wrapper.html?colors-premult.png + +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&premult&alpha wrapper.html?colors-premult.png + +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&premult&alpha wrapper.html?colors-premult.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&premult&alpha wrapper.html?colors-premult.png + +# Check for hanging bindings/state settings: +skip-if(Android) == webgl-hanging-fb-test.html?__&________ wrapper.html?green.png +skip-if(Android) == webgl-hanging-fb-test.html?aa&________ wrapper.html?green.png +skip-if(Android) == webgl-hanging-fb-test.html?__&preserve wrapper.html?green.png +skip-if(Android) == webgl-hanging-fb-test.html?aa&preserve wrapper.html?green.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&__&________ wrapper.html?green.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&aa&________ wrapper.html?green.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&__&preserve wrapper.html?green.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-hanging-fb-test.html?readback&aa&preserve wrapper.html?green.png + +skip-if(Android) == webgl-hanging-scissor-test.html?__ wrapper.html?green.png +skip-if(Android) == webgl-hanging-scissor-test.html?aa wrapper.html?green.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-hanging-scissor-test.html?readback&__ wrapper.html?green.png +skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-hanging-scissor-test.html?readback&aa wrapper.html?green.png + + +# Check that our experimental prefs still work: + +# 16bpp for Android: [16bpp] * PowerSet([readback, premult, alpha]) +# RGB565 dithers 127 to [123,132]. (Max error: 5) +# RGBA4444 dithers 128 to [119,136], and 191 to [192]. (Max error: 9) +# Bug 1285531 - tests disabled for memory corruption +fuzzy(5,30000) skip pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&_______&_____ wrapper.html?colors-no-alpha.png +fuzzy(5,30000) skip pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&_______&_____ wrapper.html?colors-no-alpha.png +fuzzy(5,30000) skip pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&premult&_____ wrapper.html?colors-no-alpha.png +fuzzy(5,30000) skip pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&premult&_____ wrapper.html?colors-no-alpha.png +fuzzy(9,40000) skip pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(9,40000) skip pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&_______&alpha wrapper.html?colors-non-premult.png +fuzzy(9,40000) skip pref(webgl.prefer-16bpp,true) == webgl-color-test.html?16bpp&________&premult&alpha wrapper.html?colors-premult.png +fuzzy(9,40000) skip pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) == webgl-color-test.html?16bpp&readback&premult&alpha wrapper.html?colors-premult.png + +# Force native GL (Windows): +skip-if(!winWidget) pref(webgl.disable-angle,true) == webgl-color-test.html?native-gl wrapper.html?colors-no-alpha.png + + +# Non-WebGL Reftests! + +# Do we correctly handle multiple clip paths? +!= clip-multiple-paths.html clip-multiple-paths-badref.html + +# Bug 1255062 +== clip-multiple-move-1.html clip-multiple-move-1-ref.html +== clip-multiple-move-2.html clip-multiple-move-2-ref.html + +# Bug 815648 +== stroketext-shadow.html stroketext-shadow-ref.html + +# focus rings +pref(canvas.focusring.enabled,true) skip-if(cocoaWidget) skip-if(winWidget) needs-focus == drawFocusIfNeeded.html drawFocusIfNeeded-ref.html +pref(canvas.customfocusring.enabled,true) skip-if(Android||cocoaWidget||winWidget) fuzzy-if(gtkWidget,64,410) needs-focus == drawCustomFocusRing.html drawCustomFocusRing-ref.html + +# Check that captureStream() displays in a local video element +== capturestream.html wrapper.html?green.png + +fuzzy-if(azureSkia,16,2) fuzzy-if(Android,3,40) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,1) == 1177726-text-stroke-bounds.html 1177726-text-stroke-bounds-ref.html + +# Canvas Filter Reftests +include filters/reftest.list + +# Bug 1305963 +== mozCurrentTransform.html mozCurrentTransform-ref.html +== mozCurrentTransformInverse.html mozCurrentTransform-ref.html diff --git a/dom/canvas/test/reftest/stroketext-shadow-ref.html b/dom/canvas/test/reftest/stroketext-shadow-ref.html new file mode 100644 index 000000000..1a77caaaa --- /dev/null +++ b/dom/canvas/test/reftest/stroketext-shadow-ref.html @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/dom/canvas/test/reftest/stroketext-shadow.html b/dom/canvas/test/reftest/stroketext-shadow.html new file mode 100644 index 000000000..acfa8d892 --- /dev/null +++ b/dom/canvas/test/reftest/stroketext-shadow.html @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/dom/canvas/test/reftest/webgl-capturestream-test.html b/dom/canvas/test/reftest/webgl-capturestream-test.html new file mode 100644 index 000000000..efd343702 --- /dev/null +++ b/dom/canvas/test/reftest/webgl-capturestream-test.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + + +
+ + + diff --git a/dom/canvas/test/reftest/webgl-clear-test.html b/dom/canvas/test/reftest/webgl-clear-test.html new file mode 100644 index 000000000..9be310c8a --- /dev/null +++ b/dom/canvas/test/reftest/webgl-clear-test.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + +
+ + + diff --git a/dom/canvas/test/reftest/webgl-color-test.html b/dom/canvas/test/reftest/webgl-color-test.html new file mode 100644 index 000000000..acbddd806 --- /dev/null +++ b/dom/canvas/test/reftest/webgl-color-test.html @@ -0,0 +1,123 @@ + + + + + + + + + + + + +
+ + + diff --git a/dom/canvas/test/reftest/webgl-disable-test.html b/dom/canvas/test/reftest/webgl-disable-test.html new file mode 100644 index 000000000..30581ec25 --- /dev/null +++ b/dom/canvas/test/reftest/webgl-disable-test.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/webgl-hanging-fb-test.html b/dom/canvas/test/reftest/webgl-hanging-fb-test.html new file mode 100644 index 000000000..3f950d829 --- /dev/null +++ b/dom/canvas/test/reftest/webgl-hanging-fb-test.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/webgl-hanging-scissor-test.html b/dom/canvas/test/reftest/webgl-hanging-scissor-test.html new file mode 100644 index 000000000..fb035153f --- /dev/null +++ b/dom/canvas/test/reftest/webgl-hanging-scissor-test.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/webgl-resize-test.html b/dom/canvas/test/reftest/webgl-resize-test.html new file mode 100644 index 000000000..879479e05 --- /dev/null +++ b/dom/canvas/test/reftest/webgl-resize-test.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/reftest/webgl-utils.js b/dom/canvas/test/reftest/webgl-utils.js new file mode 100644 index 000000000..06f34ca91 --- /dev/null +++ b/dom/canvas/test/reftest/webgl-utils.js @@ -0,0 +1,82 @@ +"use strict"; + +function parseArgs() { + var query = window.location.search.substring(1); + + var split = query.split("&"); + + var args = {} + for (var i = 0; i < split.length; i++) { + var pair = split[i].split("="); + + var key = pair[0]; + var value = true; + if (pair.length >= 2) { + eval("value = " + decodeURIComponent(pair[1]) + ";"); + } + + args[key] = value; + } + + return args; +} + +var gArgs = null; +function arg(key, defaultVal) { + if (gArgs === null) { + gArgs = parseArgs(); + } + + if (!(key in gArgs)) + return defaultVal; + + return gArgs[key]; +} + +function initGL(canvas) { + if (arg("nogl")) + return null; + + var gl = null; + + var withAA = arg("aa", false); + var withAlpha = arg("alpha", false); + var withDepth = arg("depth", false); + var withPremult = arg("premult", false); + var withPreserve = arg("preserve", false); + var withStencil = arg("stencil", false); + + try { + var argDict = { + alpha: withAlpha, + depth: withDepth, + stencil: withStencil, + antialias: withAA, + premultipliedAlpha: withPremult, + preserveDrawingBuffer: withPreserve, + }; + gl = canvas.getContext("experimental-webgl", argDict); + } catch(e) {} + + return gl; +} + +function rAF(func) { + var raf = window.requestAnimationFrame; + raf(func); +} + +var MAX_WAIT_FOR_COMPOSITE_DELAY_MS = 500; + +function waitForComposite(func) { + var isDone = false; + var doneFunc = function () { + if (isDone) + return; + isDone = true; + func(); + }; + + rAF(doneFunc); + setTimeout(doneFunc, MAX_WAIT_FOR_COMPOSITE_DELAY_MS); +} diff --git a/dom/canvas/test/reftest/white.png b/dom/canvas/test/reftest/white.png new file mode 100644 index 000000000..23b21c59c Binary files /dev/null and b/dom/canvas/test/reftest/white.png differ diff --git a/dom/canvas/test/reftest/wrapper.html b/dom/canvas/test/reftest/wrapper.html new file mode 100644 index 000000000..1b59b226c --- /dev/null +++ b/dom/canvas/test/reftest/wrapper.html @@ -0,0 +1,27 @@ + + + +Image reftest wrapper + + + + + + + + + diff --git a/dom/canvas/test/test_2d.clearRect.image.offscreen.html b/dom/canvas/test/test_2d.clearRect.image.offscreen.html new file mode 100644 index 000000000..1024c1488 --- /dev/null +++ b/dom/canvas/test/test_2d.clearRect.image.offscreen.html @@ -0,0 +1,42 @@ + + + + + + + +

+ + +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_2d.clip.winding.html b/dom/canvas/test/test_2d.clip.winding.html new file mode 100644 index 000000000..10303fe3f --- /dev/null +++ b/dom/canvas/test/test_2d.clip.winding.html @@ -0,0 +1,52 @@ + +Canvas test: 2d.clip.winding + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.canvas.color-burn.html b/dom/canvas/test/test_2d.composite.canvas.color-burn.html new file mode 100644 index 000000000..7639eb215 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.color-burn.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.color-dodge.html b/dom/canvas/test/test_2d.composite.canvas.color-dodge.html new file mode 100644 index 000000000..13330c0fa --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.color-dodge.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.color.html b/dom/canvas/test/test_2d.composite.canvas.color.html new file mode 100644 index 000000000..048da5d5f --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.color.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.darken.html b/dom/canvas/test/test_2d.composite.canvas.darken.html new file mode 100644 index 000000000..9af5a4445 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.darken.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.destination-atop.html b/dom/canvas/test/test_2d.composite.canvas.destination-atop.html new file mode 100644 index 000000000..ee05a6e73 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.destination-atop.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.destination-atop + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.destination-in.html b/dom/canvas/test/test_2d.composite.canvas.destination-in.html new file mode 100644 index 000000000..2bccfe49d --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.destination-in.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.destination-in + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.difference.html b/dom/canvas/test/test_2d.composite.canvas.difference.html new file mode 100644 index 000000000..c8ce4bf58 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.difference.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.exclusion.html b/dom/canvas/test/test_2d.composite.canvas.exclusion.html new file mode 100644 index 000000000..dd90d56d0 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.exclusion.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.hard-light.html b/dom/canvas/test/test_2d.composite.canvas.hard-light.html new file mode 100644 index 000000000..bd533ba5b --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.hard-light.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.hue.html b/dom/canvas/test/test_2d.composite.canvas.hue.html new file mode 100644 index 000000000..0c49aaf97 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.hue.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.lighten.html b/dom/canvas/test/test_2d.composite.canvas.lighten.html new file mode 100644 index 000000000..7620970cf --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.lighten.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.lighter.html b/dom/canvas/test/test_2d.composite.canvas.lighter.html new file mode 100644 index 000000000..0748bdde4 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.lighter.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.lighter + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.luminosity.html b/dom/canvas/test/test_2d.composite.canvas.luminosity.html new file mode 100644 index 000000000..169bd2b5c --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.luminosity.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.multiply.html b/dom/canvas/test/test_2d.composite.canvas.multiply.html new file mode 100644 index 000000000..4a1fccdfb --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.multiply.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.overlay.html b/dom/canvas/test/test_2d.composite.canvas.overlay.html new file mode 100644 index 000000000..c3eaaa781 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.overlay.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.saturation.html b/dom/canvas/test/test_2d.composite.canvas.saturation.html new file mode 100644 index 000000000..cd1e61fb9 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.saturation.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.screen.html b/dom/canvas/test/test_2d.composite.canvas.screen.html new file mode 100644 index 000000000..919d0d501 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.screen.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.soft-light.html b/dom/canvas/test/test_2d.composite.canvas.soft-light.html new file mode 100644 index 000000000..048da5d5f --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.soft-light.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.source-in.html b/dom/canvas/test/test_2d.composite.canvas.source-in.html new file mode 100644 index 000000000..30ebe67bd --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.source-in.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.source-in + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.source-out.html b/dom/canvas/test/test_2d.composite.canvas.source-out.html new file mode 100644 index 000000000..1048f820c --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.source-out.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.source-out + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.canvas.xor.html b/dom/canvas/test/test_2d.composite.canvas.xor.html new file mode 100644 index 000000000..048da5d5f --- /dev/null +++ b/dom/canvas/test/test_2d.composite.canvas.xor.html @@ -0,0 +1,44 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.clip.lighter.html b/dom/canvas/test/test_2d.composite.clip.lighter.html new file mode 100644 index 000000000..ede6dadf6 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.clip.lighter.html @@ -0,0 +1,43 @@ + +Canvas test: 2d.composite.clip.lighter + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.clip.xor.html b/dom/canvas/test/test_2d.composite.clip.xor.html new file mode 100644 index 000000000..84ec8c65a --- /dev/null +++ b/dom/canvas/test/test_2d.composite.clip.xor.html @@ -0,0 +1,43 @@ + +Canvas test: 2d.composite.clip.xor + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.image.destination-atop.html b/dom/canvas/test/test_2d.composite.image.destination-atop.html new file mode 100644 index 000000000..798383060 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.image.destination-atop.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.image.destination-atop + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.image.destination-in.html b/dom/canvas/test/test_2d.composite.image.destination-in.html new file mode 100644 index 000000000..d0fed661d --- /dev/null +++ b/dom/canvas/test/test_2d.composite.image.destination-in.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.image.destination-in + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.image.lighter.html b/dom/canvas/test/test_2d.composite.image.lighter.html new file mode 100644 index 000000000..0d9c9e34e --- /dev/null +++ b/dom/canvas/test/test_2d.composite.image.lighter.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.image.lighter + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.image.source-in.html b/dom/canvas/test/test_2d.composite.image.source-in.html new file mode 100644 index 000000000..e87c89c36 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.image.source-in.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.image.source-in + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.image.source-out.html b/dom/canvas/test/test_2d.composite.image.source-out.html new file mode 100644 index 000000000..27249939a --- /dev/null +++ b/dom/canvas/test/test_2d.composite.image.source-out.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.image.source-out + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.image.xor.html b/dom/canvas/test/test_2d.composite.image.xor.html new file mode 100644 index 000000000..c3d6ee349 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.image.xor.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.image.xor + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.solid.color-burn.html b/dom/canvas/test/test_2d.composite.solid.color-burn.html new file mode 100644 index 000000000..902858ed9 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.color-burn.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.color-dodge.html b/dom/canvas/test/test_2d.composite.solid.color-dodge.html new file mode 100644 index 000000000..dd2008ee9 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.color-dodge.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.color.html b/dom/canvas/test/test_2d.composite.solid.color.html new file mode 100644 index 000000000..6becadbaa --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.color.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.darken.html b/dom/canvas/test/test_2d.composite.solid.darken.html new file mode 100644 index 000000000..88c281ba8 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.darken.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.difference.html b/dom/canvas/test/test_2d.composite.solid.difference.html new file mode 100644 index 000000000..202d27a77 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.difference.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.exclusion.html b/dom/canvas/test/test_2d.composite.solid.exclusion.html new file mode 100644 index 000000000..3c07e68e9 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.exclusion.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.hard-light.html b/dom/canvas/test/test_2d.composite.solid.hard-light.html new file mode 100644 index 000000000..36648dc0b --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.hard-light.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.hue.html b/dom/canvas/test/test_2d.composite.solid.hue.html new file mode 100644 index 000000000..c531fe328 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.hue.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.lighten.html b/dom/canvas/test/test_2d.composite.solid.lighten.html new file mode 100644 index 000000000..ced8d2abd --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.lighten.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.lighter.html b/dom/canvas/test/test_2d.composite.solid.lighter.html new file mode 100644 index 000000000..00f33a8b6 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.lighter.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.luminosity.html b/dom/canvas/test/test_2d.composite.solid.luminosity.html new file mode 100644 index 000000000..ccb4eea8b --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.luminosity.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.multiply.html b/dom/canvas/test/test_2d.composite.solid.multiply.html new file mode 100644 index 000000000..cd09000b3 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.multiply.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.overlay.html b/dom/canvas/test/test_2d.composite.solid.overlay.html new file mode 100644 index 000000000..1037636af --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.overlay.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.saturation.html b/dom/canvas/test/test_2d.composite.solid.saturation.html new file mode 100644 index 000000000..7c1031350 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.saturation.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.screen.html b/dom/canvas/test/test_2d.composite.solid.screen.html new file mode 100644 index 000000000..71da5859e --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.screen.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.soft-light.html b/dom/canvas/test/test_2d.composite.solid.soft-light.html new file mode 100644 index 000000000..b2ef4982b --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.soft-light.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.solid.xor.html b/dom/canvas/test/test_2d.composite.solid.xor.html new file mode 100644 index 000000000..1c545bba6 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.solid.xor.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.solid.xor + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.transparent.lighter.html b/dom/canvas/test/test_2d.composite.transparent.lighter.html new file mode 100644 index 000000000..2529475c4 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.transparent.lighter.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.transparent.lighter + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.transparent.xor.html b/dom/canvas/test/test_2d.composite.transparent.xor.html new file mode 100644 index 000000000..779875f29 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.transparent.xor.html @@ -0,0 +1,39 @@ + +Canvas test: 2d.composite.transparent.xor + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.color-burn.html b/dom/canvas/test/test_2d.composite.uncovered.fill.color-burn.html new file mode 100644 index 000000000..45697da2a --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.color-burn.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.color-dodge.html b/dom/canvas/test/test_2d.composite.uncovered.fill.color-dodge.html new file mode 100644 index 000000000..ef9855459 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.color-dodge.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.color.html b/dom/canvas/test/test_2d.composite.uncovered.fill.color.html new file mode 100644 index 000000000..6354b2a7f --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.color.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.darken.html b/dom/canvas/test/test_2d.composite.uncovered.fill.darken.html new file mode 100644 index 000000000..5513e7dea --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.darken.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.destination-atop.html b/dom/canvas/test/test_2d.composite.uncovered.fill.destination-atop.html new file mode 100644 index 000000000..da78d2123 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.destination-atop.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.destination-atop + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.destination-in.html b/dom/canvas/test/test_2d.composite.uncovered.fill.destination-in.html new file mode 100644 index 000000000..5bca1f0c4 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.destination-in.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.destination-in + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.difference.html b/dom/canvas/test/test_2d.composite.uncovered.fill.difference.html new file mode 100644 index 000000000..4393dedbf --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.difference.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.exclusion.html b/dom/canvas/test/test_2d.composite.uncovered.fill.exclusion.html new file mode 100644 index 000000000..745f0978b --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.exclusion.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.hard-light.html b/dom/canvas/test/test_2d.composite.uncovered.fill.hard-light.html new file mode 100644 index 000000000..7d6eade45 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.hard-light.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.hue.html b/dom/canvas/test/test_2d.composite.uncovered.fill.hue.html new file mode 100644 index 000000000..7c529ffb5 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.hue.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.lighten.html b/dom/canvas/test/test_2d.composite.uncovered.fill.lighten.html new file mode 100644 index 000000000..8f80beab2 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.lighten.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.luminosity.html b/dom/canvas/test/test_2d.composite.uncovered.fill.luminosity.html new file mode 100644 index 000000000..167610640 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.luminosity.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.multiply.html b/dom/canvas/test/test_2d.composite.uncovered.fill.multiply.html new file mode 100644 index 000000000..f47df2416 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.multiply.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.overlay.html b/dom/canvas/test/test_2d.composite.uncovered.fill.overlay.html new file mode 100644 index 000000000..d93a2311f --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.overlay.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.saturation.html b/dom/canvas/test/test_2d.composite.uncovered.fill.saturation.html new file mode 100644 index 000000000..af7bd2290 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.saturation.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.screen.html b/dom/canvas/test/test_2d.composite.uncovered.fill.screen.html new file mode 100644 index 000000000..56b1ec046 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.screen.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.soft-light.html b/dom/canvas/test/test_2d.composite.uncovered.fill.soft-light.html new file mode 100644 index 000000000..8cbf1b6df --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.soft-light.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.source-in.html b/dom/canvas/test/test_2d.composite.uncovered.fill.source-in.html new file mode 100644 index 000000000..fb1a04a64 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.source-in.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-in + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.fill.source-out.html b/dom/canvas/test/test_2d.composite.uncovered.fill.source-out.html new file mode 100644 index 000000000..af2782a84 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.fill.source-out.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.fill.source-out + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.composite.uncovered.image.destination-atop.html b/dom/canvas/test/test_2d.composite.uncovered.image.destination-atop.html new file mode 100644 index 000000000..0285f5467 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.image.destination-atop.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.image.destination-atop + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.uncovered.image.destination-in.html b/dom/canvas/test/test_2d.composite.uncovered.image.destination-in.html new file mode 100644 index 000000000..298ce9ad9 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.image.destination-in.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.image.destination-in + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.uncovered.image.source-in.html b/dom/canvas/test/test_2d.composite.uncovered.image.source-in.html new file mode 100644 index 000000000..cb9815d0b --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.image.source-in.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.image.source-in + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.uncovered.image.source-out.html b/dom/canvas/test/test_2d.composite.uncovered.image.source-out.html new file mode 100644 index 000000000..00dc8a0f4 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.image.source-out.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.image.source-out + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.uncovered.pattern.destination-atop.html b/dom/canvas/test/test_2d.composite.uncovered.pattern.destination-atop.html new file mode 100644 index 000000000..df2efaf18 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.pattern.destination-atop.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.pattern.destination-atop + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.uncovered.pattern.destination-in.html b/dom/canvas/test/test_2d.composite.uncovered.pattern.destination-in.html new file mode 100644 index 000000000..2431688f4 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.pattern.destination-in.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.pattern.destination-in + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.uncovered.pattern.source-in.html b/dom/canvas/test/test_2d.composite.uncovered.pattern.source-in.html new file mode 100644 index 000000000..b73e96418 --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.pattern.source-in.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.pattern.source-in + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.composite.uncovered.pattern.source-out.html b/dom/canvas/test/test_2d.composite.uncovered.pattern.source-out.html new file mode 100644 index 000000000..333033e8c --- /dev/null +++ b/dom/canvas/test/test_2d.composite.uncovered.pattern.source-out.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.composite.uncovered.pattern.source-out + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.drawImage.zerocanvas.html b/dom/canvas/test/test_2d.drawImage.zerocanvas.html new file mode 100644 index 000000000..aa9ea2140 --- /dev/null +++ b/dom/canvas/test/test_2d.drawImage.zerocanvas.html @@ -0,0 +1,55 @@ + +Canvas test: 2d.drawImage.zerocanvas + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.fill.pattern.imageSmoothingEnabled.html b/dom/canvas/test/test_2d.fill.pattern.imageSmoothingEnabled.html new file mode 100644 index 000000000..bdadf5ebf --- /dev/null +++ b/dom/canvas/test/test_2d.fill.pattern.imageSmoothingEnabled.html @@ -0,0 +1,81 @@ + +Canvas test: 2d.fill.pattern.imageSmoothingEnabled + + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_2d.fill.winding.html b/dom/canvas/test/test_2d.fill.winding.html new file mode 100644 index 000000000..56d7d9782 --- /dev/null +++ b/dom/canvas/test/test_2d.fill.winding.html @@ -0,0 +1,50 @@ + +Canvas test: 2d.fill.winding + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.fillText.gradient.html b/dom/canvas/test/test_2d.fillText.gradient.html new file mode 100644 index 000000000..72183bd50 --- /dev/null +++ b/dom/canvas/test/test_2d.fillText.gradient.html @@ -0,0 +1,55 @@ + +Canvas test: 2d.composite.canvas.xor + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.cone.behind.html b/dom/canvas/test/test_2d.gradient.radial.cone.behind.html new file mode 100644 index 000000000..45fcdd2f4 --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.cone.behind.html @@ -0,0 +1,62 @@ + +Canvas test: 2d.gradient.radial.cone.behind + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.cone.beside.html b/dom/canvas/test/test_2d.gradient.radial.cone.beside.html new file mode 100644 index 000000000..456920cfa --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.cone.beside.html @@ -0,0 +1,62 @@ + +Canvas test: 2d.gradient.radial.cone.beside + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.cone.front.html b/dom/canvas/test/test_2d.gradient.radial.cone.front.html new file mode 100644 index 000000000..bf056b81a --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.cone.front.html @@ -0,0 +1,50 @@ + +Canvas test: 2d.gradient.radial.cone.front + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.cone.shape2.html b/dom/canvas/test/test_2d.gradient.radial.cone.shape2.html new file mode 100644 index 000000000..d15d1dd4e --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.cone.shape2.html @@ -0,0 +1,71 @@ + +Canvas test: 2d.gradient.radial.cone.shape2 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.cone.top.html b/dom/canvas/test/test_2d.gradient.radial.cone.top.html new file mode 100644 index 000000000..69d99d790 --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.cone.top.html @@ -0,0 +1,64 @@ + +Canvas test: 2d.gradient.radial.cone.top + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.equal.html b/dom/canvas/test/test_2d.gradient.radial.equal.html new file mode 100644 index 000000000..ecf7a8e1a --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.equal.html @@ -0,0 +1,62 @@ + +Canvas test: 2d.gradient.radial.equal + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.inside2.html b/dom/canvas/test/test_2d.gradient.radial.inside2.html new file mode 100644 index 000000000..cc91bb7ae --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.inside2.html @@ -0,0 +1,50 @@ + +Canvas test: 2d.gradient.radial.inside2 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.inside3.html b/dom/canvas/test/test_2d.gradient.radial.inside3.html new file mode 100644 index 000000000..5b9bf658c --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.inside3.html @@ -0,0 +1,51 @@ + +Canvas test: 2d.gradient.radial.inside3 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.outside1.html b/dom/canvas/test/test_2d.gradient.radial.outside1.html new file mode 100644 index 000000000..3f3e2b1d7 --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.outside1.html @@ -0,0 +1,50 @@ + +Canvas test: 2d.gradient.radial.outside1 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.outside2.html b/dom/canvas/test/test_2d.gradient.radial.outside2.html new file mode 100644 index 000000000..d7fc75105 --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.outside2.html @@ -0,0 +1,62 @@ + +Canvas test: 2d.gradient.radial.outside2 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.outside3.html b/dom/canvas/test/test_2d.gradient.radial.outside3.html new file mode 100644 index 000000000..029a28d1a --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.outside3.html @@ -0,0 +1,63 @@ + +Canvas test: 2d.gradient.radial.outside3 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.touch1.html b/dom/canvas/test/test_2d.gradient.radial.touch1.html new file mode 100644 index 000000000..1ed681ebf --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.touch1.html @@ -0,0 +1,62 @@ + +Canvas test: 2d.gradient.radial.touch1 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.touch2.html b/dom/canvas/test/test_2d.gradient.radial.touch2.html new file mode 100644 index 000000000..33c3e2174 --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.touch2.html @@ -0,0 +1,64 @@ + +Canvas test: 2d.gradient.radial.touch2 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.gradient.radial.touch3.html b/dom/canvas/test/test_2d.gradient.radial.touch3.html new file mode 100644 index 000000000..eb7eebcd5 --- /dev/null +++ b/dom/canvas/test/test_2d.gradient.radial.touch3.html @@ -0,0 +1,62 @@ + +Canvas test: 2d.gradient.radial.touch3 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.isPointInPath.winding.html b/dom/canvas/test/test_2d.isPointInPath.winding.html new file mode 100644 index 000000000..f947475e1 --- /dev/null +++ b/dom/canvas/test/test_2d.isPointInPath.winding.html @@ -0,0 +1,28 @@ + +Canvas test: 2d.isPointInPath.winding + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.line.cap.closed.html b/dom/canvas/test/test_2d.line.cap.closed.html new file mode 100644 index 000000000..c4354e8fe --- /dev/null +++ b/dom/canvas/test/test_2d.line.cap.closed.html @@ -0,0 +1,53 @@ + +Canvas test: 2d.line.cap.closed + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.line.join.parallel.html b/dom/canvas/test/test_2d.line.join.parallel.html new file mode 100644 index 000000000..333fa2af1 --- /dev/null +++ b/dom/canvas/test/test_2d.line.join.parallel.html @@ -0,0 +1,49 @@ + +Canvas test: 2d.line.join.parallel + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.path.arc.shape.3.html b/dom/canvas/test/test_2d.path.arc.shape.3.html new file mode 100644 index 000000000..15fac23af --- /dev/null +++ b/dom/canvas/test/test_2d.path.arc.shape.3.html @@ -0,0 +1,57 @@ + +Canvas test: 2d.path.arc.shape.3 + + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.path.rect.selfintersect.html b/dom/canvas/test/test_2d.path.rect.selfintersect.html new file mode 100644 index 000000000..e4fc13ede --- /dev/null +++ b/dom/canvas/test/test_2d.path.rect.selfintersect.html @@ -0,0 +1,50 @@ + +Canvas test: 2d.path.rect.selfintersect + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.path.rect.zero.6.html b/dom/canvas/test/test_2d.path.rect.zero.6.html new file mode 100644 index 000000000..3e61e119d --- /dev/null +++ b/dom/canvas/test/test_2d.path.rect.zero.6.html @@ -0,0 +1,52 @@ + +Canvas test: 2d.path.rect.zero.6 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d.strokeRect.zero.5.html b/dom/canvas/test/test_2d.strokeRect.zero.5.html new file mode 100644 index 000000000..904749abb --- /dev/null +++ b/dom/canvas/test/test_2d.strokeRect.zero.5.html @@ -0,0 +1,37 @@ + +Canvas test: 2d.strokeRect.zero.5 + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html b/dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html new file mode 100644 index 000000000..6e46774d0 --- /dev/null +++ b/dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html @@ -0,0 +1,78 @@ + +Canvas Tests + + + + + +

Canvas test: 2d.composite.canvaspattern.setTransform

+

FAIL +(fallback content)

+ + + + + + + diff --git a/dom/canvas/test/test_ImageData_ctor.html b/dom/canvas/test/test_ImageData_ctor.html new file mode 100644 index 000000000..cb4329454 --- /dev/null +++ b/dom/canvas/test/test_ImageData_ctor.html @@ -0,0 +1,80 @@ + +Canvas test: ImageData + + + +
+ + diff --git a/dom/canvas/test/test_bitmaprenderer.html b/dom/canvas/test/test_bitmaprenderer.html new file mode 100644 index 000000000..4c76fae9b --- /dev/null +++ b/dom/canvas/test/test_bitmaprenderer.html @@ -0,0 +1,172 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + + diff --git a/dom/canvas/test/test_bug1215072.html b/dom/canvas/test/test_bug1215072.html new file mode 100644 index 000000000..7e0095ca2 --- /dev/null +++ b/dom/canvas/test/test_bug1215072.html @@ -0,0 +1,76 @@ + + + + + + Test for Bug 1215072 + + + + + +Mozilla Bug 1215072 +

+ +
+
+ + diff --git a/dom/canvas/test/test_bug232227.html b/dom/canvas/test/test_bug232227.html new file mode 100644 index 000000000..da4c0e015 --- /dev/null +++ b/dom/canvas/test/test_bug232227.html @@ -0,0 +1,151 @@ + + + + + Test for Bug 232227 + + + + +Mozilla Bug 232227 + + + + + + diff --git a/dom/canvas/test/test_bug613794.html b/dom/canvas/test/test_bug613794.html new file mode 100644 index 000000000..d17a52637 --- /dev/null +++ b/dom/canvas/test/test_bug613794.html @@ -0,0 +1,41 @@ + + + + + Test for Bug 613794 + + + + +Mozilla Bug 613794 +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_bug753758.html b/dom/canvas/test/test_bug753758.html new file mode 100644 index 000000000..e9001fd58 --- /dev/null +++ b/dom/canvas/test/test_bug753758.html @@ -0,0 +1,35 @@ + + + + + Test for Bug 753758 + + + + +Mozilla Bug 753758 +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_bug764125.html b/dom/canvas/test/test_bug764125.html new file mode 100644 index 000000000..5b15c0ea8 --- /dev/null +++ b/dom/canvas/test/test_bug764125.html @@ -0,0 +1,36 @@ + + + + + Test for Bug 764125 + + + + +Mozilla Bug 764125 +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_bug856472.html b/dom/canvas/test/test_bug856472.html new file mode 100644 index 000000000..3ca14d5dc --- /dev/null +++ b/dom/canvas/test/test_bug856472.html @@ -0,0 +1,31 @@ + + + + + Test for Bug 856472 + + + + +Mozilla Bug 856472 +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_bug866575.html b/dom/canvas/test/test_bug866575.html new file mode 100644 index 000000000..cdb2dc9c6 --- /dev/null +++ b/dom/canvas/test/test_bug866575.html @@ -0,0 +1,34 @@ + + + + + Test for Bug 866575 + + + + +Mozilla Bug 866575 +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_bug902651.html b/dom/canvas/test/test_bug902651.html new file mode 100644 index 000000000..249113801 --- /dev/null +++ b/dom/canvas/test/test_bug902651.html @@ -0,0 +1,44 @@ + +Canvas test: canvas demotion + + + +

FAIL (fallback content)

+ + diff --git a/dom/canvas/test/test_canvas.html b/dom/canvas/test/test_canvas.html new file mode 100644 index 000000000..cf0a79f35 --- /dev/null +++ b/dom/canvas/test/test_canvas.html @@ -0,0 +1,25808 @@ + +Canvas Tests + + + + + + + + +

Canvas test: 2d.canvas.readonly

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.canvas.reference

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.clip

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.globalalpha

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.globalcomposite

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.negative

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.path

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.shadow

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.transform

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.zero

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.canvas.copy

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.destination-atop

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.destination-in

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.destination-out

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.destination-over

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.lighter

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.source-atop

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.source-in

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.source-out

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.source-over

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.canvas.xor

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.clip.copy

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.destination-atop

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.destination-in

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.destination-out

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.destination-over

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.lighter

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.source-atop

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.source-in

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.source-out

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.source-over

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.clip.xor

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.globalAlpha.canvas

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.globalAlpha.canvaspattern - bug 401790

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.globalAlpha.default

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.globalAlpha.fill

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.globalAlpha.image

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.globalAlpha.imagepattern - bug 401790

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.globalAlpha.invalid

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.globalAlpha.range

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.image.copy

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.destination-atop

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.destination-in

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.destination-out

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.destination-over

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.lighter

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.source-atop

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.source-in

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.source-out

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.source-over

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.image.xor

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.operation.casesensitive - bug 401788

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.clear

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.darker

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.default

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.get

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.highlight - bug 401788

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.nullsuffix - bug 401788

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.over

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.operation.unrecognised - bug 401788

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.copy

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.destination-atop

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.destination-in

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.destination-out

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.destination-over

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.lighter

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.source-atop

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.source-in

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.source-out

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.source-over

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.solid.xor

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.copy

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.destination-atop

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.destination-in

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.destination-out

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.destination-over

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.lighter

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.source-atop

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.source-in

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.source-out

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.source-over

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.transparent.xor

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.uncovered.fill.copy

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.uncovered.fill.destination-atop

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.uncovered.fill.destination-in

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.uncovered.fill.source-in

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.uncovered.fill.source-out

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.composite.uncovered.image.copy

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.image.destination-atop

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.image.destination-in

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.image.source-in

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.image.source-out

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.pattern.copy

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.pattern.destination-atop

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.pattern.destination-in

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.pattern.source-in

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.composite.uncovered.pattern.source-out

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.3arg

+

FAIL (fallback content)

+ + + + + + +

Canvas test: 2d.drawImage.5arg

+

FAIL (fallback content)

+ + + + + + +

Canvas test: 2d.drawImage.9arg.basic

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.9arg.destpos

+

FAIL (fallback content)

+ + + + + + +

Canvas test: 2d.drawImage.9arg.destsize

+

FAIL (fallback content)

+ + + + + + +

Canvas test: 2d.drawImage.9arg.sourcepos

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.9arg.sourcesize

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.alpha

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.animated.apng

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.animated.gif

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.animated.poster

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.broken

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.canvas

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.drawImage.clip

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.composite

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.floatsource

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.incomplete

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.drawImage.negativedest

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.negativesource

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.nonfinite

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.nowrap

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.null

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.drawImage.path

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.self.1 - bug 433235

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.drawImage.self.2 - bug 433235

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.drawImage.transform

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.drawImage.wrongtype

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.drawImage.zerosource

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.fillRect.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillRect.clip

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillRect.negative

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillRect.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillRect.path

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillRect.shadow

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillRect.transform

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillRect.zero

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.default

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.get.semitransparent

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.get.solid

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.get.transparent

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.invalidstring

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.invalidtype

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.current.basic

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.current.changed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.current.removed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hex3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hex6

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-clamp-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-clamp-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-clamp-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsl-clamp-4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-clamp-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-clamp-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-clamp-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-clamp-4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-clamp-5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.hsla-clamp-6

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.html4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hex3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hex6

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hsl-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hsl-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hsl-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hsl-4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hsl-5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hsla-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.hsla-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.name-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.name-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.name-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgb-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgb-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgb-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgb-4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgb-5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgb-6

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgb-7

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgba-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgba-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgba-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgba-4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.invalid.rgba-5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgb-clamp-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgb-clamp-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgb-clamp-3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgb-clamp-4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgb-clamp-5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgb-num

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgb-percent

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgba-clamp-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgba-clamp-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgba-num-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgba-num-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgba-percent

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgba-solid-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.rgba-solid-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.svg-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.svg-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.system

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.transparent-1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.fillStyle.parse.transparent-2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.getcontext.exists

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.getcontext.shared

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.getcontext.unique

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.empty

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.alpha

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.colour

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.colouralpha

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.multiple

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.outside

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.overlap

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.overlap2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.solid

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.vertical

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.interpolate.zerosize

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.linear.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.linear.transform.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.linear.transform.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.linear.transform.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.object.compare

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.object.crosscanvas

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.object.invalidcolour

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.object.invalidoffset

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.object.return

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.object.type

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.object.update

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.behind

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.beside

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.bottom

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.cylinder

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.front

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.shape1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.shape2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.cone.top

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.equal

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.inside1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.inside2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.inside3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.outside1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.outside2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.outside3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.touch1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.touch2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.touch3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.transform.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.transform.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.gradient.radial.transform.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.basic - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create1.basic - bug 630040

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.initial - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create1.initial - bug 630040

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.large - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.negative - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.nonfinite - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.round - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.tiny - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.type - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create1.type - bug 630040

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create.zero - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.create1.zero - bug 630040

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.basic

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.clamp

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.nonpremul

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.order.alpha

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.order.cols

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.order.rgb

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.order.rows

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.range

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.source.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.source.outside

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.source.size

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.tiny

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.type

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.unaffected

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.get.zero

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.clamp

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.ctor

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.nan

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.properties

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.readonly

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.round

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.set

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.string

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.object.undefined

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.alpha

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.basic

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.clip - bug 433397

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.created - bug 433004

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.cross

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.dirty.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.dirty.outside

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.dirty.rect1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.dirty.rect2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.dirty.zero

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.modified

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.null - bug 421715

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.path

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.unaffected

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.unchanged

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageData.put.wrongtype

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.cap.butt

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.cap.closed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.cap.invalid - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.cap.open

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.cap.round

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.cap.square

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.cross

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.defaults

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.join.bevel

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.join.closed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.join.invalid - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.join.miter

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.join.open

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.join.parallel

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.join.round

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.miter.acute

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.miter.exceeded

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.miter.invalid

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.miter.lineedge - bug 401791

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.miter.obtuse

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.miter.rightangle - bug 401791

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.miter.within

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.union

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.width.basic

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.width.invalid

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.line.width.transformed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.missingargs

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.angle.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.angle.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.angle.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.angle.4

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.angle.5

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.angle.6

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.empty

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.end

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.nonempty

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.scale.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.scale.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.selfintersect.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.selfintersect.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.shape.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.shape.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.shape.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.shape.4

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.shape.5

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.twopie.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.twopie.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.twopie.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.twopie.4

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.zero.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.zero.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arc.zeroradius

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.coincide.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.coincide.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.collinear.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.collinear.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.collinear.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.emptysubpath

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.scale

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.shape.curve1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.shape.curve2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.shape.end

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.shape.start

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.transformation

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.zero.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.arcTo.zero.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.beginPath

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.bezierCurveTo.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.bezierCurveTo.emptysubpath

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.bezierCurveTo.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.bezierCurveTo.scaled

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.bezierCurveTo.shape

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.clip.basic.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.clip.basic.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.clip.empty

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.clip.intersect

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.clip.unaffected

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.clip.winding.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.clip.winding.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.closePath.empty

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.closePath.newline

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.closePath.nextpoint

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.fill.closed.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.fill.closed.unaffected

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.fill.overlap

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.fill.winding.add

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.fill.winding.subtract.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.fill.winding.subtract.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.fill.winding.subtract.3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.initial

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.arc

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.basic.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.basic.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.bezier

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.bigarc

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.edge

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.empty

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.outside

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.subpath

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.transform.1 - bug 405300

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.transform.2 - bug 405300

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.transform.3 - bug 405300

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.unclosed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.isPointInPath.winding

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.lineTo.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.lineTo.emptysubpath

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.lineTo.nextpoint

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.lineTo.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.moveTo.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.moveTo.multiple

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.moveTo.newsubpath

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.moveTo.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.quadraticCurveTo.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.quadraticCurveTo.emptysubpath

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.quadraticCurveTo.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.quadraticCurveTo.scaled

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.quadraticCurveTo.shape

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.closed

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.end.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.end.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.negative

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.newsubpath

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.selfintersect

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.winding

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.zero.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.zero.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.zero.3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.zero.4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.zero.5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.rect.zero.6

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.empty

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.overlap

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.prune.arc

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.prune.closed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.prune.corner

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.prune.curve

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.prune.line

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.prune.rect

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.scale1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.scale2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.skew

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.unaffected

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.stroke.union

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.transformation.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.transformation.changing

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.transformation.multiple

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.animated.gif

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.basic.canvas

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.basic.image

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.basic.nocontext

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.basic.type

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.basic.zerocanvas

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.crosscanvas

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.image.null

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.image.string

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.image.undefined

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.modify.canvas1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.modify.canvas2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.modify.image1

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.modify.image2

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.norepeat.basic

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.norepeat.coord1

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.norepeat.coord2

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.norepeat.coord3

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.norepeat.outside

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.orientation.canvas

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.paint.orientation.image

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeat.basic

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeat.coord1

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeat.coord2

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeat.coord3

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeat.outside

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeatx.basic

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeatx.coord1

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeatx.outside

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeaty.basic

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeaty.coord1

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.paint.repeaty.outside

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.repeat.case

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.repeat.empty

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.repeat.null

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.pattern.repeat.nullsuffix

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.repeat.undefined

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.pattern.repeat.unrecognised

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.scaled

+ +

FAIL (fallback content)

+ + + +

Canvas test: 2d.shadow.alpha.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.alpha.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.alpha.3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.alpha.4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.alpha.5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.attributes.shadowBlur.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.attributes.shadowBlur.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.attributes.shadowColor.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.attributes.shadowColor.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.attributes.shadowOffset.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.attributes.shadowOffset.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.basic.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.basic.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.blur.high

+

FAIL (fallback content)

+ + + +

Canvas test: 2d.shadow.blur.low

+

FAIL (fallback content)

+ + + +

Canvas test: 2d.shadow.canvas.alpha

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.canvas.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.canvas.transparent.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.canvas.transparent.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.clip.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.clip.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.clip.3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.composite.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.composite.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.composite.3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.composite.4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.gradient.alpha

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.gradient.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.gradient.transparent.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.gradient.transparent.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.image.alpha

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.image.basic

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.image.scale

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.image.section

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.image.transparent.1

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.image.transparent.2

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.offset.negativeX

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.offset.negativeY

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.offset.positiveX

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.offset.positiveY

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.outside

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.pattern.alpha

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.pattern.basic

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.pattern.transparent.1

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.pattern.transparent.2

+

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.shadow.stroke.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.stroke.cap.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.stroke.cap.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.stroke.join.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.stroke.join.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.stroke.join.3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.transform.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.shadow.transform.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.bitmap

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.clip

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.fillStyle

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.globalAlpha

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.globalCompositeOperation

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.lineCap

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.lineJoin

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.lineWidth

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.miterLimit

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.path

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.shadowBlur

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.shadowColor

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.shadowOffsetX

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.shadowOffsetY

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.stack

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.stackdepth

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.strokeStyle

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.transformation

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.state.saverestore.underflow - bug 296821

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.basic

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.clip

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.globalalpha

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.globalcomposite

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.negative

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.path

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.shadow

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.transform

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.zero.1

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.zero.2

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.zero.3

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.zero.4

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeRect.zero.5

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.strokeStyle.default

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.text.align.default

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.text.align.invalid

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.text.baseline.default

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.text.baseline.invalid

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.order

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.rotate.direction

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.rotate.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.rotate.radians

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.rotate.wrap

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.rotate.wrapnegative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.rotate.zero

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.scale.basic

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.scale.large

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.scale.multiple

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.scale.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.scale.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.scale.zero

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.setTransform.multiple

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.setTransform.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.setTransform.skewed

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.transform.identity

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.transform.multiply

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.transform.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.transform.skewed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.translate.basic

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.transformation.translate.nonfinite

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.type.exists

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.type.extend

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.type.prototype

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.type.replace

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.voidreturn

+ +

FAIL (fallback content)

+ + + + + +

Test for Bug 397524

+Mozilla Bug 397524 +

+ + + + + + +

+ +
+
+
+ + + +

Canvas test: toDataURL.png

+

FAIL (fallback content)

+ + + +

Canvas test: context.arguments.extra

+

FAIL (fallback content)

+ + + + +

Canvas test: context.arguments.missing

+

FAIL (fallback content)

+ + + + +

Canvas test: context.casesensitive - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: context.emptystring - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: context.unrecognised.badname - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: context.unrecognised.badsuffix - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: context.unrecognised.nullsuffix - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: context.unrecognised.unicode - bug 401788

+ +

FAIL (fallback content)

+ + + + +

Canvas test: fallback.basic

+ +

FAIL (fallback content)

+ + + + +

Canvas test: fallback.multiple

+ +

FAIL

FAIL

+ + + + +

Canvas test: fallback.nested

+ +

FAIL (fallback content)

FAIL (fallback content)

+ + + + +

Canvas test: initial.colour

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.2dstate

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.clip

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.different

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.gradient

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.path

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.pattern

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.same

+ +

FAIL (fallback content)

+ + + + +

Canvas test: initial.reset.transform

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.default

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.badsuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.floatsuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.nonnumber

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.percentsuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.whitespace

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.zero

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.parse.zerosuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.reflect.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.reflect.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.removed

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.badsuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.floatsuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.nonnumber

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.percentsuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.whitespace

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.zero

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.setAttribute.zerosuffix

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.style

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.type.get

+ +

FAIL (fallback content)

+ + + + +

Canvas test: size.attributes.type.set

+ +

FAIL (fallback content)

+ + + + +

Canvas test: text.font

+

FAIL (fallback content)

+ + + + +

Canvas test: text.measure

+

FAIL (fallback content)

+ + + + +

Canvas test: text.space.replace

+

FAIL (fallback content)

+ + + + +

Canvas test: text.textAlign

+

FAIL (fallback content)

+ + + + +

Canvas test: text.textBaseline

+

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.arguments.1 - bug 401795

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.arguments.2 - bug 401795

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.arguments.3 - bug 401795

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.complexcolours

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.default

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.lowercase - bug 401795

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.nocontext

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.png

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.primarycolours

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.unrecognised - bug 401795

+ +

FAIL (fallback content)

+ + + + +

Canvas test: toDataURL.zerosize

+ +

FAIL (fallback content)

+ + + + +

Canvas test: type.exists

+ +

FAIL (fallback content)

+ + + + +

Canvas test: type.extend

+ +

FAIL (fallback content)

+ + + + +

Canvas test: type.name

+ +

FAIL (fallback content)

+ + + + +

Canvas test: type.prototype

+ +

FAIL (fallback content)

+ + + + +

Canvas test: type.replace

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imagedata_coercion

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.imageRenderingQuality

+
+ + + +

Canvas test: zero_dimensions

+ + + +

Canvas test: zero_dimensions_image_data

+ + + +

Canvas test: getImageData_after_zero_canvas

+ + + +

Canvas test: test_opaque

+ + + +

Canvas test: 2d.transformation.transform.identity

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.clearRect.testdoubleprecision

+

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.angle.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.angle.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.angle.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.angle.4

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.angle.5

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.angle.6

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.empty

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.end

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.negative

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.nonempty

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.nonfinite

+ +

FAIL (fallback content)

+ + + + + +

Canvas test: 2d.path.ellipse.scale.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.scale.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.selfintersect.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.selfintersect.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.shape.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.shape.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.shape.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.shape.4

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.twopie.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.twopie.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.twopie.3

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.twopie.4

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.zero.1

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.zero.2

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.zeroradius

+ +

FAIL (fallback content)

+ + + + +

Canvas test: 2d.path.ellipse.rotate

+ +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_canvas_focusring.html b/dom/canvas/test/test_canvas_focusring.html new file mode 100644 index 000000000..9e2e832b3 --- /dev/null +++ b/dom/canvas/test/test_canvas_focusring.html @@ -0,0 +1,100 @@ + +Canvas Tests + + + + + +

Canvas test: drawCustomFocusRing

++ + + + + + +

Canvas test: drawFocusIfNeeded

+ + + + + + + + diff --git a/dom/canvas/test/test_canvas_font_setter.html b/dom/canvas/test/test_canvas_font_setter.html new file mode 100644 index 000000000..85973fe11 --- /dev/null +++ b/dom/canvas/test/test_canvas_font_setter.html @@ -0,0 +1,68 @@ + + + + + Test for Bug + + + + +Mozilla Bug + +
+
+
+ + diff --git a/dom/canvas/test/test_canvas_path.html b/dom/canvas/test/test_canvas_path.html new file mode 100644 index 000000000..acce891ae --- /dev/null +++ b/dom/canvas/test/test_canvas_path.html @@ -0,0 +1,447 @@ + +Canvas Tests + + + + + +

Canvas test: test_drawClipPath_canvas

++ + + + +

Canvas test: test_drawFillPath_canvas

++ + + + +

Canvas test: test_drawStrokePath_canvas

++ + + + +

Canvas test: test_large_canvas

++ + + + +

Canvas test: test_isPointInPath_canvas

++ + + + +

Canvas test: test_isPointInStroke_canvas

++ + + + +

Canvas test: test_pathconstructor_canvas

++ + + + +

Canvas test: test_addpath_canvas

++ + + + + diff --git a/dom/canvas/test/test_canvas_strokeStyle_getter.html b/dom/canvas/test/test_canvas_strokeStyle_getter.html new file mode 100644 index 000000000..5c03733a9 --- /dev/null +++ b/dom/canvas/test/test_canvas_strokeStyle_getter.html @@ -0,0 +1,38 @@ + + + + + Test for Bug 587106 + + + + +Mozilla Bug 587106 +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_capture.html b/dom/canvas/test/test_capture.html new file mode 100644 index 000000000..0f4031c08 --- /dev/null +++ b/dom/canvas/test/test_capture.html @@ -0,0 +1,141 @@ + + + +Canvas2D test: CaptureStream() + + + + + + + diff --git a/dom/canvas/test/test_createPattern_broken.html b/dom/canvas/test/test_createPattern_broken.html new file mode 100644 index 000000000..b4d66dc9e --- /dev/null +++ b/dom/canvas/test/test_createPattern_broken.html @@ -0,0 +1,35 @@ + + + + + Test for createPattern with a broken image + + + + + + + + + + + diff --git a/dom/canvas/test/test_drawImageIncomplete.html b/dom/canvas/test/test_drawImageIncomplete.html new file mode 100644 index 000000000..f08eaa0ba --- /dev/null +++ b/dom/canvas/test/test_drawImageIncomplete.html @@ -0,0 +1,59 @@ + + + + + Test for Bug 517056 + + + + +Mozilla Bug 517056 +

+ +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_drawImage_document_domain.html b/dom/canvas/test/test_drawImage_document_domain.html new file mode 100644 index 000000000..313bda4be --- /dev/null +++ b/dom/canvas/test/test_drawImage_document_domain.html @@ -0,0 +1,48 @@ + + + + + + Test for Bug 567511 + + + + +Mozilla Bug 567511 +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_drawImage_edge_cases.html b/dom/canvas/test/test_drawImage_edge_cases.html new file mode 100644 index 000000000..7147d4a6a --- /dev/null +++ b/dom/canvas/test/test_drawImage_edge_cases.html @@ -0,0 +1,42 @@ + + + + + + + +

+ + +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_drawWindow.html b/dom/canvas/test/test_drawWindow.html new file mode 100644 index 000000000..57f17e6e7 --- /dev/null +++ b/dom/canvas/test/test_drawWindow.html @@ -0,0 +1,55 @@ + + + + + Test for canvas drawWindow + + + + + + + +Mozilla Bug + + + diff --git a/dom/canvas/test/test_filter.html b/dom/canvas/test/test_filter.html new file mode 100644 index 000000000..f4cac00a4 --- /dev/null +++ b/dom/canvas/test/test_filter.html @@ -0,0 +1,45 @@ + + + + + diff --git a/dom/canvas/test/test_filter_tainted.html b/dom/canvas/test/test_filter_tainted.html new file mode 100644 index 000000000..e809b05a0 --- /dev/null +++ b/dom/canvas/test/test_filter_tainted.html @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/dom/canvas/test/test_hitregion_canvas.html b/dom/canvas/test/test_hitregion_canvas.html new file mode 100644 index 000000000..452cb33b6 --- /dev/null +++ b/dom/canvas/test/test_hitregion_canvas.html @@ -0,0 +1,84 @@ + +Canvas Tests + + + + + +

Canvas test: hit regions

+ + + + + + + + diff --git a/dom/canvas/test/test_hitregion_event.html b/dom/canvas/test/test_hitregion_event.html new file mode 100644 index 000000000..4f74d8200 --- /dev/null +++ b/dom/canvas/test/test_hitregion_event.html @@ -0,0 +1,93 @@ + + + + Test click events on canvas hit regions + + + + + +

+ + +

+ +
+
+
+ + diff --git a/dom/canvas/test/test_imagebitmap.html b/dom/canvas/test/test_imagebitmap.html new file mode 100644 index 000000000..b3d3c08ad --- /dev/null +++ b/dom/canvas/test/test_imagebitmap.html @@ -0,0 +1,346 @@ + +Test ImageBitmap + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/test_imagebitmap_close.html b/dom/canvas/test/test_imagebitmap_close.html new file mode 100644 index 000000000..86e14d67d --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_close.html @@ -0,0 +1,93 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + + diff --git a/dom/canvas/test/test_imagebitmap_cropping.html b/dom/canvas/test/test_imagebitmap_cropping.html new file mode 100644 index 000000000..be7cd086f --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_cropping.html @@ -0,0 +1,274 @@ + +Test ImageBitmap Cropping (Bug 1190210) + + + + + + diff --git a/dom/canvas/test/test_imagebitmap_extensions.html b/dom/canvas/test/test_imagebitmap_extensions.html new file mode 100644 index 000000000..aae0ee481 --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_extensions.html @@ -0,0 +1,37 @@ + + + Test ImageBitmap Extensions (Bug 1141979) + + + + + +
+ + diff --git a/dom/canvas/test/test_imagebitmap_extensions_on_worker.html b/dom/canvas/test/test_imagebitmap_extensions_on_worker.html new file mode 100644 index 000000000..8287e0d83 --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_extensions_on_worker.html @@ -0,0 +1,39 @@ + + + Test ImageBitmap Extensions On Worker (Bug 1141979) + + + + + +
+ + + diff --git a/dom/canvas/test/test_imagebitmap_on_worker.html b/dom/canvas/test/test_imagebitmap_on_worker.html new file mode 100644 index 000000000..1680a4c34 --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_on_worker.html @@ -0,0 +1,142 @@ + +Test ImageBitmap on Worker + + + + + + diff --git a/dom/canvas/test/test_imagebitmap_structuredclone.html b/dom/canvas/test/test_imagebitmap_structuredclone.html new file mode 100644 index 000000000..32c3ba91e --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_structuredclone.html @@ -0,0 +1,38 @@ + +Test ImageBitmap : Structured Clone + + + + + + + diff --git a/dom/canvas/test/test_imagebitmap_structuredclone_iframe.html b/dom/canvas/test/test_imagebitmap_structuredclone_iframe.html new file mode 100644 index 000000000..b2c7ae65e --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_structuredclone_iframe.html @@ -0,0 +1,45 @@ + +Test ImageBitmap : StructuredClone between main window and iframe + + + + +
+ + + diff --git a/dom/canvas/test/test_imagebitmap_structuredclone_window.html b/dom/canvas/test/test_imagebitmap_structuredclone_window.html new file mode 100644 index 000000000..89881c779 --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_structuredclone_window.html @@ -0,0 +1,27 @@ + +Test ImageBitmap : StructuredClone main window to main window + + + + + + + diff --git a/dom/canvas/test/test_imagebitmap_transfer.html b/dom/canvas/test/test_imagebitmap_transfer.html new file mode 100644 index 000000000..99eee5dcd --- /dev/null +++ b/dom/canvas/test/test_imagebitmap_transfer.html @@ -0,0 +1,46 @@ + +Test ImageBitmap : Transfer + + + + + + + diff --git a/dom/canvas/test/test_isPointInStroke.html b/dom/canvas/test/test_isPointInStroke.html new file mode 100644 index 000000000..f48cab1cd --- /dev/null +++ b/dom/canvas/test/test_isPointInStroke.html @@ -0,0 +1,244 @@ + + + + + Canvas test: isPointInStroke + + + + +

FAIL (fallback content)

+ + + + + diff --git a/dom/canvas/test/test_mozGetAsFile.html b/dom/canvas/test/test_mozGetAsFile.html new file mode 100644 index 000000000..0975fcb9c --- /dev/null +++ b/dom/canvas/test/test_mozGetAsFile.html @@ -0,0 +1,50 @@ + +Canvas test: mozGetAsFile + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_offscreencanvas_basic_webgl.html b/dom/canvas/test/test_offscreencanvas_basic_webgl.html new file mode 100644 index 000000000..55b186812 --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_basic_webgl.html @@ -0,0 +1,62 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_dynamic_fallback.html b/dom/canvas/test/test_offscreencanvas_dynamic_fallback.html new file mode 100644 index 000000000..8e4f0f8de --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_dynamic_fallback.html @@ -0,0 +1,80 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_many.html b/dom/canvas/test/test_offscreencanvas_many.html new file mode 100644 index 000000000..6bf2680c5 --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_many.html @@ -0,0 +1,67 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_neuter.html b/dom/canvas/test/test_offscreencanvas_neuter.html new file mode 100644 index 000000000..2af080c7c --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_neuter.html @@ -0,0 +1,78 @@ + + + +OffscreenCanvas: Test neutering + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_serviceworker.html b/dom/canvas/test/test_offscreencanvas_serviceworker.html new file mode 100644 index 000000000..887b94fc6 --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_serviceworker.html @@ -0,0 +1,52 @@ + + + +WebGL in OffscreenCanvas + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_sharedworker.html b/dom/canvas/test/test_offscreencanvas_sharedworker.html new file mode 100644 index 000000000..28d7ce37c --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_sharedworker.html @@ -0,0 +1,47 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_sizechange.html b/dom/canvas/test/test_offscreencanvas_sizechange.html new file mode 100644 index 000000000..cecbac348 --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_sizechange.html @@ -0,0 +1,41 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_subworker.html b/dom/canvas/test/test_offscreencanvas_subworker.html new file mode 100644 index 000000000..b3fbae821 --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_subworker.html @@ -0,0 +1,90 @@ + + + +OffscreenCanvas: Test subworkers + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_toblob.html b/dom/canvas/test/test_offscreencanvas_toblob.html new file mode 100644 index 000000000..d5cc2c02d --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_toblob.html @@ -0,0 +1,91 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + + + + diff --git a/dom/canvas/test/test_offscreencanvas_toimagebitmap.html b/dom/canvas/test/test_offscreencanvas_toimagebitmap.html new file mode 100644 index 000000000..e07f4f335 --- /dev/null +++ b/dom/canvas/test/test_offscreencanvas_toimagebitmap.html @@ -0,0 +1,69 @@ + + + +WebGL in OffscreenCanvas + + + + + + + + + + diff --git a/dom/canvas/test/test_strokeText_throw.html b/dom/canvas/test/test_strokeText_throw.html new file mode 100644 index 000000000..59a6975ea --- /dev/null +++ b/dom/canvas/test/test_strokeText_throw.html @@ -0,0 +1,68 @@ + + + + + + Test for Bug 728629 + + + + + +Mozilla Bug 728629 +

+ +
+
+ + diff --git a/dom/canvas/test/test_toBlob.html b/dom/canvas/test/test_toBlob.html new file mode 100644 index 000000000..34d87dba8 --- /dev/null +++ b/dom/canvas/test/test_toBlob.html @@ -0,0 +1,47 @@ + +Canvas test: toBlob + + + +

FAIL (fallback content)

+ + + diff --git a/dom/canvas/test/test_toDataURL_alpha.html b/dom/canvas/test/test_toDataURL_alpha.html new file mode 100644 index 000000000..b79f02f30 --- /dev/null +++ b/dom/canvas/test/test_toDataURL_alpha.html @@ -0,0 +1,206 @@ + + + +Canvas test: toDataURL parameters (Bug 564388) + + + + +

+For image types that do not support an alpha channel, the image must be +composited onto a solid black background using the source-over operator, +and the resulting image must be the one used to create the data: URL. +

+

See: + +http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-canvas-todataurl + +

+

Mozilla + Bug 650720 +

+

Output:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Type:image/pngimage/jpegimage/bmp
(24 bpp)
image/bmp
(32 bpp)
rgba(128, 255, 128, 0.5) +

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

rgba(255, 128, 128, 0.75) +

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

rgba(128, 128, 255, 0.25) +

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

rgba(255, 255, 255, 1.0) +

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

rgba(255, 255, 255, 0) +

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

rgba(0, 0, 0, 1.0) +

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

rgba(0, 0, 0, 0) +

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+

FAIL (fallback content)

+ + + + diff --git a/dom/canvas/test/test_toDataURL_lowercase_ascii.html b/dom/canvas/test/test_toDataURL_lowercase_ascii.html new file mode 100644 index 000000000..4f0061e90 --- /dev/null +++ b/dom/canvas/test/test_toDataURL_lowercase_ascii.html @@ -0,0 +1,20 @@ + +Canvas test: toDataURL.lowercase.ascii + + + +

FAIL (fallback content)

+ diff --git a/dom/canvas/test/test_toDataURL_parameters.html b/dom/canvas/test/test_toDataURL_parameters.html new file mode 100644 index 000000000..2cc8b0bb7 --- /dev/null +++ b/dom/canvas/test/test_toDataURL_parameters.html @@ -0,0 +1,54 @@ + +Canvas test: toDataURL parameters (Bug 564388) + + + +

+This test covers the JPEG quality parameter. If (when) the HTML5 spec changes the +allowed parameters for ToDataURL, new tests should go here. +

+

FAIL (fallback content)

+ diff --git a/dom/canvas/test/test_windingRuleUndefined.html b/dom/canvas/test/test_windingRuleUndefined.html new file mode 100644 index 000000000..b423cde5a --- /dev/null +++ b/dom/canvas/test/test_windingRuleUndefined.html @@ -0,0 +1,34 @@ + + + + + + Test for Bug 861938 + + + + +Mozilla Bug 861938 +

+ +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/always-fail.html b/dom/canvas/test/webgl-conf/always-fail.html new file mode 100644 index 000000000..0b7a778f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/always-fail.html @@ -0,0 +1,20 @@ + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/00_test_list.txt new file mode 100644 index 000000000..dcecb40e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/00_test_list.txt @@ -0,0 +1,8 @@ +// files that end in .txt list other tests +// other lines are assumed to be .html files + +conformance/00_test_list.txt +conformance/more/00_test_list.txt +// Disable deqp tests temporarily +// deqp/00_test_list.txt +--min-version 2.0.0 conformance2/00_test_list.txt diff --git a/dom/canvas/test/webgl-conf/checkout/CONFORMANCE_RULES.txt b/dom/canvas/test/webgl-conf/checkout/CONFORMANCE_RULES.txt new file mode 100644 index 000000000..c267d34b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/CONFORMANCE_RULES.txt @@ -0,0 +1,127 @@ +Rules for Claiming a Conformant WebGL Implementation +==================================================== + +The WebGL API is a web standard, and many web browser implementers +deliver their browser on multiple operating systems (OSs). WebGL +implementations also typically rely on the presence of an OpenGL or +OpenGL ES implementation on the OS. It can be appreciated that a WebGL +implementation therefore has many dependencies. This document attempts +to clarify to potential implementers the rules the Khronos Group uses +to judge whether a particular WebGL implementation is conformant. + +There are two primary reasons to submit conformance results: + + A) A web browser implementer desires to certify their WebGL + implementation as conformant. + + B) A GPU manufacturer delivering an embedded system including web + browser with WebGL support desires to certify their WebGL + implementation as conformant. + +Each of these situations carries different constraints, so the +conformance rules are phrased differently for each. Typically, a web +browser implementer aims to certify that the WebGL "layer" is correct. +A GPU vendor typically aims to certify that a given device is +physically capable of passing the tests. + +A newly-developed WebGL implementation should not support the "webgl" +HTML Canvas context type by default in a shipping version of the +product until reaching conformance. It is acceptable to give end users +an option to turn on WebGL support in a non-conformant implementation +as long as the documentation for that option clearly indicates that +the implementation is not yet conformant and may have compatibility +issues. It is suggested that the Canvas context type +"experimental-webgl" may be supported by default in such +implementations. + +A WebGL implementation might reach conformance, but a subsequent +graphics driver release on a particular OS might introduce a +regression causing failures of one or more of the WebGL conformance +tests. In this situation it is not required to revoke support for the +"webgl" HTML Canvas context type. The WebGL implementer should work +with the GPU vendor to ensure the driver regression is fixed. A +situation like this would, however, prevent the WebGL implementer from +conforming to a subsequent version of the test suite. + +(A) Conformance Rules for a Web Browser Implementer +=================================================== + +1. Conformance on a particular operating system + +On a given OS, a WebGL implementation will be considered to conform to +a particular version of the conformance suite if the suite passes with +no test failures on at least two GPUs, each from a different +vendor. If the OS only supports a GPU from one vendor, the two-GPU +requirement is dropped. + +2. Conformance across multiple operating systems + +A WebGL implementation will be considered to conform to a particular +version of the conformance suite if it passes rule (1) on all of the +OSs on which the WebGL implementation is intended to be supported. + +3. Conformance as the web browser is upgraded + +WebGL conformance results submitted for an earlier version of the +browser carry forward to later versions of the browser that do not +cause any previously passing test to fail. + +4. Conformance as the operating system is upgraded + +If a new version is released of one of the OSs on which a WebGL +implementation is intended to run, then WebGL conformance results +submitted for earlier versions of that OS carry forward. Future +conformance results must be submitted against the new version of the +OS. If it is anticipated that the older OS version will be supported +for some time, then future conformance results must be submitted +separately for both the old and new versions of the OS. + +(B) Conformance Rules for a GPU Vendor +====================================== + +A GPU vendor submitting conformance results for a WebGL implementation +typically does so because the device containing the GPU includes a +built-in web browser. In this case the following rules apply: + +1. Conformance results must be submitted for each GPU and operating +system combination to be certified. It is not required to submit +results for different devices containing the same GPU and running the +same operating system that do not cause any previously passing test to +fail. + +2. Conformance results carry forward for a given GPU as the operating +system and graphics driver are upgraded but do not cause any previously +passing test to fail. + +Discussion +========== + +A WebGL implementation intended to ship on three OSs may reach +conformance on two of them, but due to graphics driver bugs, may be +unable to reach conformance on the third. In this situation the +implementation is not yet considered to be conformant. + +An existing WebGL implementation which conformed to an earlier version +of the test suite is not required to remove support for the "webgl" +HTML Canvas context type while in the process of conforming to a later +version of the test suite. However, the implementer must not advertise +conformance to the later version until it has been reached. It is +acceptable for the implementer to advertise details of their +conformance, for example number or percentage of passing or failing +tests, or names of passing or failing tests. + +A GPU vendor might submit conformance results in order to use the +WebGL logo in a marketing campaign. In this situation, results may be +submitted in advance of the product becoming available through sales +channels, per the rules above. + +The WebGL API has strict security requirements. Even one failing test +may indicate a serious security issue in the WebGL implementation. For +this reason, no exceptions for failing conformance tests will be +granted. + +The Khronos Group determines whether a particular WebGL implementation +is conformant based on the implementer's conformance suite +submissions, on multiple OSs and on multiple GPUs as necessary, using +the rules above. An implementer shall not judge their own +implementation conformant simply by applying the above rules. diff --git a/dom/canvas/test/webgl-conf/checkout/README.md b/dom/canvas/test/webgl-conf/checkout/README.md new file mode 100644 index 000000000..6baee99dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/README.md @@ -0,0 +1,79 @@ +Welcome to the WebGL Conformance Test Suite +=========================================== + +Note: Before adding a new test or editing an existing test +[please read these guidelines](test-guidelines.md). + +This is the WebGL conformance test suite. You can find a the current "live" +version at [https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html](https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html) + +NOTE TO USERS: Unless you are a WebGL implementor, there is no need to submit +a conformance result using this process. Should you discover bugs in your +browser's WebGL implementation, either via this test suite or otherwise, +please report them through your browser vendor's bug tracking system. + +FOR WEBGL IMPLEMENTORS: Please follow the instructions below to create +a formal conformance submission. + +1. Open webgl-conformance-tests.html in your target browser + +2. Press the "run tests" button + +3. At the end of the run, press "display text summary" + +4. Verify that the User Agent and WebGL renderer strings identify your browser and target correctly. + +5. Copy the contents of the text summary (starting with "WebGL Conformance Test Results") and send via email to + webgl_conformance_submissions@khronos.org + +Please see CONFORMANCE_RULES.txt in this directory for guidelines +about what constitutes a conformant WebGL implementation. + +Usage Notes: +------------ + +There are various URL options you can pass in. + + run: Set to 1 to start the tests automatically + + Example: webgl-conformance-tests.html?run=1 + + version: Set to the version of the harness you wish to run. Tests + at this version or below will be run + + Example: webgl-conformance-tests.html?version=1.3.2 + + minVersion: Set to the minimum version of each test to include. Only tests + at this version or above will be included. + + Example: webgl-conformance-tests.html?minVersion=1.3.2 + + fast: Only run tests not marked with --slow + + Example: webgl-conformance-tests.html?fast=true + + skip: Comma separated list of regular expressions of which tests to skip. + + Example: webgl-conformance-tests.html?skip=glsl,.*destruction\.html + + include: Comma separated list of regular expressions of which tests to include. + + Example: webgl-conformance-tests.html?include=glsl,.*destruction\.html + + frames: The number of iframes to use to run tests in parallel. + + Example: webgl-conformance-tests.html?frames=8 + + Note the tests are not required to run with anything other than frames = 1. + +History +------- + +The dates below are when work on the conformance suite version was started. + +- 2011/02/24: Version 1.0.0 +- 2012/02/23: Version 1.0.1 +- 2012/03/20: Version 1.0.2 +- 2013/02/14: Version 1.0.3 +- 2013/10/11: Version 2.0.0 (beta) +- 2014/11/14: Version 1.0.4 diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/AUTHORS b/dom/canvas/test/webgl-conf/checkout/closure-library/AUTHORS new file mode 100644 index 000000000..d5fa71f80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/AUTHORS @@ -0,0 +1,19 @@ +# This is a list of contributors to the Closure Library. + +# Names should be added to this file like so: +# Name or Organization + +Google Inc. +Stellar Science Ltd. +Mohamed Mansour +Bjorn Tipling +SameGoal LLC +Guido Tapia +Andrew Mattie +Ilia Mirkin +Ivan Kozik +Rich Dougherty +Chad Killingsworth +Dan Pupius +Mike Dunn +Kengo Toda diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/CONTRIBUTING b/dom/canvas/test/webgl-conf/checkout/closure-library/CONTRIBUTING new file mode 100644 index 000000000..bab94181d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/CONTRIBUTING @@ -0,0 +1,48 @@ +Closure Library welcomes patches/pulls for features and bugfixes. + +For contributors inside Google, follow the instructions given here: +http://go/closure-contributors + +For contributors external to Google, follow the instructions given here: + +Notes on Contributions to Closure Library + +Google Individual Contributor License + +In all cases, contributors must sign a contributor license agreement, +either for an individual or corporation, before a patch can be +accepted. Please fill out the agreement for an individual or a +corporation, as appropriate. + +https://developers.google.com/open-source/cla/individual +https://developers.google.com/open-source/cla/corporate + +If you or your organization is not listed there already, you should +add an entry to the AUTHORS file as part of your patch. + +If you plan to add a significant component or large chunk of code, it +is recommended to bring it up on the discussion list for a design +discussion before writing code. + +If appropriate, write a unit test that demonstrates your patch. Tests are the +best way to ensure that future contributors do not break your code +accidentally. + +To change the Closure Library source, you must submit a pull request +in GitHub. See the GitHub documentation here: + +https://help.github.com/categories/63/articles + +Closure Library developers monitor outstanding pull requests. They may +request changes on the pull request before accepting. They will also +verify that the CLA has been signed. + +Oftentimes, the pull request will not be directly merged, but patched to +the internal Google codebase to verify that unit and integration tests +will Closure pass before submitting (and optionally make changes to +the patch to match style, fix text, or to make the code or comments +clearer). In this case, the issue associated with the pull request +will be closed when the patch pushed to the repository via the MOE +(Make Open Easy) system. + +https://code.google.com/p/moe-java/ diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/LICENSE b/dom/canvas/test/webgl-conf/checkout/closure-library/LICENSE new file mode 100644 index 000000000..d9a10c0d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/README-Khronos.txt b/dom/canvas/test/webgl-conf/checkout/closure-library/README-Khronos.txt new file mode 100644 index 000000000..64d81e51c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/README-Khronos.txt @@ -0,0 +1,20 @@ +This is a partial snapshot of the Closure library workspace from: + + https://github.com/google/closure-library + +It contains only the portions needed to type check the ported dEQP +tests, namely: + + closure/goog/base.js + closure/goog/deps.js + +and supporting scripts in closure/bin/ . + +The current version snapshotted here is: + +----- +commit 57bdfe0093cc158fb3a58d2c5f7d75ece8c4b45b +Author: Nathan Naze +Date: Fri Apr 24 18:38:26 2015 -0400 + + fix bad merge diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/README.md b/dom/canvas/test/webgl-conf/checkout/closure-library/README.md new file mode 100644 index 000000000..d794d1b9b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/README.md @@ -0,0 +1,9 @@ +# Closure Library + +Closure Library is a powerful, low-level JavaScript library designed +for building complex and scalable web applications. It is used by many +Google web applications, such as Gmail and Google Docs. + +For more information, visit the +[Google Developers](https://developers.google.com/closure/library) or +[GitHub](https://github.com/google/closure-library) sites. diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/closurebuilder.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/closurebuilder.py new file mode 100644 index 000000000..9e4e2eb33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/closurebuilder.py @@ -0,0 +1,287 @@ +#!/usr/bin/env python +# +# Copyright 2009 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utility for Closure Library dependency calculation. + +ClosureBuilder scans source files to build dependency info. From the +dependencies, the script can produce a manifest in dependency order, +a concatenated script, or compiled output from the Closure Compiler. + +Paths to files can be expressed as individual arguments to the tool (intended +for use with find and xargs). As a convenience, --root can be used to specify +all JS files below a directory. + +usage: %prog [options] [file1.js file2.js ...] +""" + +__author__ = 'nnaze@google.com (Nathan Naze)' + + +import logging +import optparse +import os +import sys + +import depstree +import jscompiler +import source +import treescan + + +def _GetOptionsParser(): + """Get the options parser.""" + + parser = optparse.OptionParser(__doc__) + parser.add_option('-i', + '--input', + dest='inputs', + action='append', + default=[], + help='One or more input files to calculate dependencies ' + 'for. The namespaces in this file will be combined with ' + 'those given with the -n flag to form the set of ' + 'namespaces to find dependencies for.') + parser.add_option('-n', + '--namespace', + dest='namespaces', + action='append', + default=[], + help='One or more namespaces to calculate dependencies ' + 'for. These namespaces will be combined with those given ' + 'with the -i flag to form the set of namespaces to find ' + 'dependencies for. A Closure namespace is a ' + 'dot-delimited path expression declared with a call to ' + 'goog.provide() (e.g. "goog.array" or "foo.bar").') + parser.add_option('--root', + dest='roots', + action='append', + default=[], + help='The paths that should be traversed to build the ' + 'dependencies.') + parser.add_option('-o', + '--output_mode', + dest='output_mode', + type='choice', + action='store', + choices=['list', 'script', 'compiled'], + default='list', + help='The type of output to generate from this script. ' + 'Options are "list" for a list of filenames, "script" ' + 'for a single script containing the contents of all the ' + 'files, or "compiled" to produce compiled output with ' + 'the Closure Compiler. Default is "list".') + parser.add_option('-c', + '--compiler_jar', + dest='compiler_jar', + action='store', + help='The location of the Closure compiler .jar file.') + parser.add_option('-f', + '--compiler_flags', + dest='compiler_flags', + default=[], + action='append', + help='Additional flags to pass to the Closure compiler. ' + 'To pass multiple flags, --compiler_flags has to be ' + 'specified multiple times.') + parser.add_option('-j', + '--jvm_flags', + dest='jvm_flags', + default=[], + action='append', + help='Additional flags to pass to the JVM compiler. ' + 'To pass multiple flags, --jvm_flags has to be ' + 'specified multiple times.') + parser.add_option('--output_file', + dest='output_file', + action='store', + help=('If specified, write output to this path instead of ' + 'writing to standard output.')) + + return parser + + +def _GetInputByPath(path, sources): + """Get the source identified by a path. + + Args: + path: str, A path to a file that identifies a source. + sources: An iterable collection of source objects. + + Returns: + The source from sources identified by path, if found. Converts to + real paths for comparison. + """ + for js_source in sources: + # Convert both to real paths for comparison. + if os.path.realpath(path) == os.path.realpath(js_source.GetPath()): + return js_source + + +def _GetClosureBaseFile(sources): + """Given a set of sources, returns the one base.js file. + + Note that if zero or two or more base.js files are found, an error message + will be written and the program will be exited. + + Args: + sources: An iterable of _PathSource objects. + + Returns: + The _PathSource representing the base Closure file. + """ + base_files = [ + js_source for js_source in sources if _IsClosureBaseFile(js_source)] + + if not base_files: + logging.error('No Closure base.js file found.') + sys.exit(1) + if len(base_files) > 1: + logging.error('More than one Closure base.js files found at these paths:') + for base_file in base_files: + logging.error(base_file.GetPath()) + sys.exit(1) + return base_files[0] + + +def _IsClosureBaseFile(js_source): + """Returns true if the given _PathSource is the Closure base.js source.""" + return (os.path.basename(js_source.GetPath()) == 'base.js' and + js_source.provides == set(['goog'])) + + +class _PathSource(source.Source): + """Source file subclass that remembers its file path.""" + + def __init__(self, path): + """Initialize a source. + + Args: + path: str, Path to a JavaScript file. The source string will be read + from this file. + """ + super(_PathSource, self).__init__(source.GetFileContents(path)) + + self._path = path + + def __str__(self): + return 'PathSource %s' % self._path + + def GetPath(self): + """Returns the path.""" + return self._path + + +def _WrapGoogModuleSource(src): + return ('goog.loadModule(function(exports) {{' + '"use strict";' + '{0}' + '\n' # terminate any trailing single line comment. + ';return exports' + '}});\n').format(src) + + +def main(): + logging.basicConfig(format=(sys.argv[0] + ': %(message)s'), + level=logging.INFO) + options, args = _GetOptionsParser().parse_args() + + # Make our output pipe. + if options.output_file: + out = open(options.output_file, 'w') + else: + out = sys.stdout + + sources = set() + + logging.info('Scanning paths...') + for path in options.roots: + for js_path in treescan.ScanTreeForJsFiles(path): + sources.add(_PathSource(js_path)) + + # Add scripts specified on the command line. + for js_path in args: + sources.add(_PathSource(js_path)) + + logging.info('%s sources scanned.', len(sources)) + + # Though deps output doesn't need to query the tree, we still build it + # to validate dependencies. + logging.info('Building dependency tree..') + tree = depstree.DepsTree(sources) + + input_namespaces = set() + inputs = options.inputs or [] + for input_path in inputs: + js_input = _GetInputByPath(input_path, sources) + if not js_input: + logging.error('No source matched input %s', input_path) + sys.exit(1) + input_namespaces.update(js_input.provides) + + input_namespaces.update(options.namespaces) + + if not input_namespaces: + logging.error('No namespaces found. At least one namespace must be ' + 'specified with the --namespace or --input flags.') + sys.exit(2) + + # The Closure Library base file must go first. + base = _GetClosureBaseFile(sources) + deps = [base] + tree.GetDependencies(input_namespaces) + + output_mode = options.output_mode + if output_mode == 'list': + out.writelines([js_source.GetPath() + '\n' for js_source in deps]) + elif output_mode == 'script': + for js_source in deps: + src = js_source.GetSource() + if js_source.is_goog_module: + src = _WrapGoogModuleSource(src) + out.write(src + '\n') + elif output_mode == 'compiled': + logging.warning("""\ +Closure Compiler now natively understands and orders Closure dependencies and +is prefererred over using this script for performing JavaScript compilation. + +Please migrate your codebase. + +See: +https://github.com/google/closure-compiler/wiki/Manage-Closure-Dependencies +""") + + # Make sure a .jar is specified. + if not options.compiler_jar: + logging.error('--compiler_jar flag must be specified if --output is ' + '"compiled"') + sys.exit(2) + + # Will throw an error if the compilation fails. + compiled_source = jscompiler.Compile( + options.compiler_jar, + [js_source.GetPath() for js_source in deps], + jvm_flags=options.jvm_flags, + compiler_flags=options.compiler_flags) + + logging.info('JavaScript compilation succeeded.') + out.write(compiled_source) + + else: + logging.error('Invalid value for --output flag.') + sys.exit(2) + + +if __name__ == '__main__': + main() diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depstree.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depstree.py new file mode 100644 index 000000000..f288dd3aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depstree.py @@ -0,0 +1,189 @@ +# Copyright 2009 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Class to represent a full Closure Library dependency tree. + +Offers a queryable tree of dependencies of a given set of sources. The tree +will also do logical validation to prevent duplicate provides and circular +dependencies. +""" + +__author__ = 'nnaze@google.com (Nathan Naze)' + + +class DepsTree(object): + """Represents the set of dependencies between source files.""" + + def __init__(self, sources): + """Initializes the tree with a set of sources. + + Args: + sources: A set of JavaScript sources. + + Raises: + MultipleProvideError: A namespace is provided by muplitple sources. + NamespaceNotFoundError: A namespace is required but never provided. + """ + + self._sources = sources + self._provides_map = dict() + + # Ensure nothing was provided twice. + for source in sources: + for provide in source.provides: + if provide in self._provides_map: + raise MultipleProvideError( + provide, [self._provides_map[provide], source]) + + self._provides_map[provide] = source + + # Check that all required namespaces are provided. + for source in sources: + for require in source.requires: + if require not in self._provides_map: + raise NamespaceNotFoundError(require, source) + + def GetDependencies(self, required_namespaces): + """Get source dependencies, in order, for the given namespaces. + + Args: + required_namespaces: A string (for one) or list (for one or more) of + namespaces. + + Returns: + A list of source objects that provide those namespaces and all + requirements, in dependency order. + + Raises: + NamespaceNotFoundError: A namespace is requested but doesn't exist. + CircularDependencyError: A cycle is detected in the dependency tree. + """ + if isinstance(required_namespaces, str): + required_namespaces = [required_namespaces] + + deps_sources = [] + + for namespace in required_namespaces: + for source in DepsTree._ResolveDependencies( + namespace, [], self._provides_map, []): + if source not in deps_sources: + deps_sources.append(source) + + return deps_sources + + @staticmethod + def _ResolveDependencies(required_namespace, deps_list, provides_map, + traversal_path): + """Resolve dependencies for Closure source files. + + Follows the dependency tree down and builds a list of sources in dependency + order. This function will recursively call itself to fill all dependencies + below the requested namespaces, and then append its sources at the end of + the list. + + Args: + required_namespace: String of required namespace. + deps_list: List of sources in dependency order. This function will append + the required source once all of its dependencies are satisfied. + provides_map: Map from namespace to source that provides it. + traversal_path: List of namespaces of our path from the root down the + dependency/recursion tree. Used to identify cyclical dependencies. + This is a list used as a stack -- when the function is entered, the + current namespace is pushed and popped right before returning. + Each recursive call will check that the current namespace does not + appear in the list, throwing a CircularDependencyError if it does. + + Returns: + The given deps_list object filled with sources in dependency order. + + Raises: + NamespaceNotFoundError: A namespace is requested but doesn't exist. + CircularDependencyError: A cycle is detected in the dependency tree. + """ + + source = provides_map.get(required_namespace) + if not source: + raise NamespaceNotFoundError(required_namespace) + + if required_namespace in traversal_path: + traversal_path.append(required_namespace) # do this *after* the test + + # This must be a cycle. + raise CircularDependencyError(traversal_path) + + # If we don't have the source yet, we'll have to visit this namespace and + # add the required dependencies to deps_list. + if source not in deps_list: + traversal_path.append(required_namespace) + + for require in source.requires: + + # Append all other dependencies before we append our own. + DepsTree._ResolveDependencies(require, deps_list, provides_map, + traversal_path) + deps_list.append(source) + + traversal_path.pop() + + return deps_list + + +class BaseDepsTreeError(Exception): + """Base DepsTree error.""" + + def __init__(self): + Exception.__init__(self) + + +class CircularDependencyError(BaseDepsTreeError): + """Raised when a dependency cycle is encountered.""" + + def __init__(self, dependency_list): + BaseDepsTreeError.__init__(self) + self._dependency_list = dependency_list + + def __str__(self): + return ('Encountered circular dependency:\n%s\n' % + '\n'.join(self._dependency_list)) + + +class MultipleProvideError(BaseDepsTreeError): + """Raised when a namespace is provided more than once.""" + + def __init__(self, namespace, sources): + BaseDepsTreeError.__init__(self) + self._namespace = namespace + self._sources = sources + + def __str__(self): + source_strs = map(str, self._sources) + + return ('Namespace "%s" provided more than once in sources:\n%s\n' % + (self._namespace, '\n'.join(source_strs))) + + +class NamespaceNotFoundError(BaseDepsTreeError): + """Raised when a namespace is requested but not provided.""" + + def __init__(self, namespace, source=None): + BaseDepsTreeError.__init__(self) + self._namespace = namespace + self._source = source + + def __str__(self): + msg = 'Namespace "%s" never provided.' % self._namespace + if self._source: + msg += ' Required in %s' % self._source + return msg diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depswriter.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depswriter.py new file mode 100644 index 000000000..bc3be88a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/depswriter.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python +# +# Copyright 2009 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Generates out a Closure deps.js file given a list of JavaScript sources. + +Paths can be specified as arguments or (more commonly) specifying trees +with the flags (call with --help for descriptions). + +Usage: depswriter.py [path/to/js1.js [path/to/js2.js] ...] +""" + +import logging +import optparse +import os +import posixpath +import shlex +import sys + +import source +import treescan + + +__author__ = 'nnaze@google.com (Nathan Naze)' + + +def MakeDepsFile(source_map): + """Make a generated deps file. + + Args: + source_map: A dict map of the source path to source.Source object. + + Returns: + str, A generated deps file source. + """ + + # Write in path alphabetical order + paths = sorted(source_map.keys()) + + lines = [] + + for path in paths: + js_source = source_map[path] + + # We don't need to add entries that don't provide anything. + if js_source.provides: + lines.append(_GetDepsLine(path, js_source)) + + return ''.join(lines) + + +def _GetDepsLine(path, js_source): + """Get a deps.js file string for a source.""" + + provides = sorted(js_source.provides) + requires = sorted(js_source.requires) + module = 'true' if js_source.is_goog_module else 'false' + + return 'goog.addDependency(\'%s\', %s, %s, %s);\n' % ( + path, provides, requires, module) + + +def _GetOptionsParser(): + """Get the options parser.""" + + parser = optparse.OptionParser(__doc__) + + parser.add_option('--output_file', + dest='output_file', + action='store', + help=('If specified, write output to this path instead of ' + 'writing to standard output.')) + parser.add_option('--root', + dest='roots', + default=[], + action='append', + help='A root directory to scan for JS source files. ' + 'Paths of JS files in generated deps file will be ' + 'relative to this path. This flag may be specified ' + 'multiple times.') + parser.add_option('--root_with_prefix', + dest='roots_with_prefix', + default=[], + action='append', + help='A root directory to scan for JS source files, plus ' + 'a prefix (if either contains a space, surround with ' + 'quotes). Paths in generated deps file will be relative ' + 'to the root, but preceded by the prefix. This flag ' + 'may be specified multiple times.') + parser.add_option('--path_with_depspath', + dest='paths_with_depspath', + default=[], + action='append', + help='A path to a source file and an alternate path to ' + 'the file in the generated deps file (if either contains ' + 'a space, surround with whitespace). This flag may be ' + 'specified multiple times.') + return parser + + +def _NormalizePathSeparators(path): + """Replaces OS-specific path separators with POSIX-style slashes. + + Args: + path: str, A file path. + + Returns: + str, The path with any OS-specific path separators (such as backslash on + Windows) replaced with URL-compatible forward slashes. A no-op on systems + that use POSIX paths. + """ + return path.replace(os.sep, posixpath.sep) + + +def _GetRelativePathToSourceDict(root, prefix=''): + """Scans a top root directory for .js sources. + + Args: + root: str, Root directory. + prefix: str, Prefix for returned paths. + + Returns: + dict, A map of relative paths (with prefix, if given), to source.Source + objects. + """ + # Remember and restore the cwd when we're done. We work from the root so + # that paths are relative from the root. + start_wd = os.getcwd() + os.chdir(root) + + path_to_source = {} + for path in treescan.ScanTreeForJsFiles('.'): + prefixed_path = _NormalizePathSeparators(os.path.join(prefix, path)) + path_to_source[prefixed_path] = source.Source(source.GetFileContents(path)) + + os.chdir(start_wd) + + return path_to_source + + +def _GetPair(s): + """Return a string as a shell-parsed tuple. Two values expected.""" + try: + # shlex uses '\' as an escape character, so they must be escaped. + s = s.replace('\\', '\\\\') + first, second = shlex.split(s) + return (first, second) + except: + raise Exception('Unable to parse input line as a pair: %s' % s) + + +def main(): + """CLI frontend to MakeDepsFile.""" + logging.basicConfig(format=(sys.argv[0] + ': %(message)s'), + level=logging.INFO) + options, args = _GetOptionsParser().parse_args() + + path_to_source = {} + + # Roots without prefixes + for root in options.roots: + path_to_source.update(_GetRelativePathToSourceDict(root)) + + # Roots with prefixes + for root_and_prefix in options.roots_with_prefix: + root, prefix = _GetPair(root_and_prefix) + path_to_source.update(_GetRelativePathToSourceDict(root, prefix=prefix)) + + # Source paths + for path in args: + path_to_source[path] = source.Source(source.GetFileContents(path)) + + # Source paths with alternate deps paths + for path_with_depspath in options.paths_with_depspath: + srcpath, depspath = _GetPair(path_with_depspath) + path_to_source[depspath] = source.Source(source.GetFileContents(srcpath)) + + # Make our output pipe. + if options.output_file: + out = open(options.output_file, 'w') + else: + out = sys.stdout + + out.write('// This file was autogenerated by %s.\n' % sys.argv[0]) + out.write('// Please do not edit.\n') + + out.write(MakeDepsFile(path_to_source)) + + +if __name__ == '__main__': + main() diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/jscompiler.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/jscompiler.py new file mode 100644 index 000000000..cc6eb55f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/jscompiler.py @@ -0,0 +1,135 @@ +# Copyright 2010 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utility to use the Closure Compiler CLI from Python.""" + + +import logging +import os +import re +import subprocess + + +# Pulls just the major and minor version numbers from the first line of +# 'java -version'. Versions are in the format of [0-9]+\.[0-9]+\..* See: +# http://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html +_VERSION_REGEX = re.compile(r'"([0-9]+)\.([0-9]+)') + + +class JsCompilerError(Exception): + """Raised if there's an error in calling the compiler.""" + pass + + +def _GetJavaVersionString(): + """Get the version string from the Java VM.""" + return subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT) + + +def _ParseJavaVersion(version_string): + """Returns a 2-tuple for the current version of Java installed. + + Args: + version_string: String of the Java version (e.g. '1.7.2-ea'). + + Returns: + The major and minor versions, as a 2-tuple (e.g. (1, 7)). + """ + match = _VERSION_REGEX.search(version_string) + if match: + version = tuple(int(x, 10) for x in match.groups()) + assert len(version) == 2 + return version + + +def _JavaSupports32BitMode(): + """Determines whether the JVM supports 32-bit mode on the platform.""" + # Suppresses process output to stderr and stdout from showing up in the + # console as we're only trying to determine 32-bit JVM support. + supported = False + try: + devnull = open(os.devnull, 'wb') + return subprocess.call( + ['java', '-d32', '-version'], stdout=devnull, stderr=devnull) == 0 + except IOError: + pass + else: + devnull.close() + return supported + + +def _GetJsCompilerArgs(compiler_jar_path, java_version, source_paths, + jvm_flags, compiler_flags): + """Assembles arguments for call to JsCompiler.""" + + if java_version < (1, 7): + raise JsCompilerError('Closure Compiler requires Java 1.7 or higher. ' + 'Please visit http://www.java.com/getjava') + + args = ['java'] + + # Add JVM flags we believe will produce the best performance. See + # https://groups.google.com/forum/#!topic/closure-library-discuss/7w_O9-vzlj4 + + # Attempt 32-bit mode if available (Java 7 on Mac OS X does not support 32-bit + # mode, for example). + if _JavaSupports32BitMode(): + args += ['-d32'] + + # Prefer the "client" VM. + args += ['-client'] + + # Add JVM flags, if any + if jvm_flags: + args += jvm_flags + + # Add the application JAR. + args += ['-jar', compiler_jar_path] + + for path in source_paths: + args += ['--js', path] + + # Add compiler flags, if any. + if compiler_flags: + args += compiler_flags + + return args + + +def Compile(compiler_jar_path, source_paths, + jvm_flags=None, + compiler_flags=None): + """Prepares command-line call to Closure Compiler. + + Args: + compiler_jar_path: Path to the Closure compiler .jar file. + source_paths: Source paths to build, in order. + jvm_flags: A list of additional flags to pass on to JVM. + compiler_flags: A list of additional flags to pass on to Closure Compiler. + + Returns: + The compiled source, as a string, or None if compilation failed. + """ + + java_version = _ParseJavaVersion(_GetJavaVersionString()) + + args = _GetJsCompilerArgs( + compiler_jar_path, java_version, source_paths, jvm_flags, compiler_flags) + + logging.info('Compiling with the following command: %s', ' '.join(args)) + + try: + return subprocess.check_output(args) + except subprocess.CalledProcessError: + raise JsCompilerError('JavaScript compilation failed.') diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/source.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/source.py new file mode 100644 index 000000000..be5e0d8ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/source.py @@ -0,0 +1,127 @@ +# Copyright 2009 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Scans a source JS file for its provided and required namespaces. + +Simple class to scan a JavaScript file and express its dependencies. +""" + +__author__ = 'nnaze@google.com' + + +import re + +_BASE_REGEX_STRING = r'^\s*goog\.%s\(\s*[\'"](.+)[\'"]\s*\)' +_MODULE_REGEX = re.compile(_BASE_REGEX_STRING % 'module') +_PROVIDE_REGEX = re.compile(_BASE_REGEX_STRING % 'provide') + +_REQUIRE_REGEX_STRING = (r'^\s*(?:(?:var|let|const)\s+[a-zA-Z_$][a-zA-Z0-9$_]*' + r'\s*=\s*)?goog\.require\(\s*[\'"](.+)[\'"]\s*\)') +_REQUIRES_REGEX = re.compile(_REQUIRE_REGEX_STRING) + + +class Source(object): + """Scans a JavaScript source for its provided and required namespaces.""" + + # Matches a "/* ... */" comment. + # Note: We can't definitively distinguish a "/*" in a string literal without a + # state machine tokenizer. We'll assume that a line starting with whitespace + # and "/*" is a comment. + _COMMENT_REGEX = re.compile( + r""" + ^\s* # Start of a new line and whitespace + /\* # Opening "/*" + .*? # Non greedy match of any characters (including newlines) + \*/ # Closing "*/""", + re.MULTILINE | re.DOTALL | re.VERBOSE) + + def __init__(self, source): + """Initialize a source. + + Args: + source: str, The JavaScript source. + """ + + self.provides = set() + self.requires = set() + self.is_goog_module = False + + self._source = source + self._ScanSource() + + def GetSource(self): + """Get the source as a string.""" + return self._source + + @classmethod + def _StripComments(cls, source): + return cls._COMMENT_REGEX.sub('', source) + + @classmethod + def _HasProvideGoogFlag(cls, source): + """Determines whether the @provideGoog flag is in a comment.""" + for comment_content in cls._COMMENT_REGEX.findall(source): + if '@provideGoog' in comment_content: + return True + + return False + + def _ScanSource(self): + """Fill in provides and requires by scanning the source.""" + + stripped_source = self._StripComments(self.GetSource()) + + source_lines = stripped_source.splitlines() + for line in source_lines: + match = _PROVIDE_REGEX.match(line) + if match: + self.provides.add(match.group(1)) + match = _MODULE_REGEX.match(line) + if match: + self.provides.add(match.group(1)) + self.is_goog_module = True + match = _REQUIRES_REGEX.match(line) + if match: + self.requires.add(match.group(1)) + + # Closure's base file implicitly provides 'goog'. + # This is indicated with the @provideGoog flag. + if self._HasProvideGoogFlag(self.GetSource()): + + if len(self.provides) or len(self.requires): + raise Exception( + 'Base file should not provide or require namespaces.') + + self.provides.add('goog') + + +def GetFileContents(path): + """Get a file's contents as a string. + + Args: + path: str, Path to file. + + Returns: + str, Contents of file. + + Raises: + IOError: An error occurred opening or reading the file. + + """ + fileobj = open(path) + try: + return fileobj.read() + finally: + fileobj.close() diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/treescan.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/treescan.py new file mode 100644 index 000000000..6694593aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/build/treescan.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python +# +# Copyright 2010 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Shared utility functions for scanning directory trees.""" + +import os +import re + + +__author__ = 'nnaze@google.com (Nathan Naze)' + + +# Matches a .js file path. +_JS_FILE_REGEX = re.compile(r'^.+\.js$') + + +def ScanTreeForJsFiles(root): + """Scans a directory tree for JavaScript files. + + Args: + root: str, Path to a root directory. + + Returns: + An iterable of paths to JS files, relative to cwd. + """ + return ScanTree(root, path_filter=_JS_FILE_REGEX) + + +def ScanTree(root, path_filter=None, ignore_hidden=True): + """Scans a directory tree for files. + + Args: + root: str, Path to a root directory. + path_filter: A regular expression filter. If set, only paths matching + the path_filter are returned. + ignore_hidden: If True, do not follow or return hidden directories or files + (those starting with a '.' character). + + Yields: + A string path to files, relative to cwd. + """ + + def OnError(os_error): + raise os_error + + for dirpath, dirnames, filenames in os.walk(root, onerror=OnError): + # os.walk allows us to modify dirnames to prevent decent into particular + # directories. Avoid hidden directories. + for dirname in dirnames: + if ignore_hidden and dirname.startswith('.'): + dirnames.remove(dirname) + + for filename in filenames: + + # nothing that starts with '.' + if ignore_hidden and filename.startswith('.'): + continue + + fullpath = os.path.join(dirpath, filename) + + if path_filter and not path_filter.match(fullpath): + continue + + yield os.path.normpath(fullpath) diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/calcdeps.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/calcdeps.py new file mode 100644 index 000000000..9cb1a6db0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/calcdeps.py @@ -0,0 +1,590 @@ +#!/usr/bin/env python +# +# Copyright 2006 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Calculates JavaScript dependencies without requiring Google's build system. + +This tool is deprecated and is provided for legacy users. +See build/closurebuilder.py and build/depswriter.py for the current tools. + +It iterates over a number of search paths and builds a dependency tree. With +the inputs provided, it walks the dependency tree and outputs all the files +required for compilation. +""" + + + + + +try: + import distutils.version +except ImportError: + # distutils is not available in all environments + distutils = None + +import logging +import optparse +import os +import re +import subprocess +import sys + + +_BASE_REGEX_STRING = '^\s*goog\.%s\(\s*[\'"](.+)[\'"]\s*\)' +req_regex = re.compile(_BASE_REGEX_STRING % 'require') +prov_regex = re.compile(_BASE_REGEX_STRING % 'provide') +ns_regex = re.compile('^ns:((\w+\.)*(\w+))$') +version_regex = re.compile('[\.0-9]+') + + +def IsValidFile(ref): + """Returns true if the provided reference is a file and exists.""" + return os.path.isfile(ref) + + +def IsJsFile(ref): + """Returns true if the provided reference is a Javascript file.""" + return ref.endswith('.js') + + +def IsNamespace(ref): + """Returns true if the provided reference is a namespace.""" + return re.match(ns_regex, ref) is not None + + +def IsDirectory(ref): + """Returns true if the provided reference is a directory.""" + return os.path.isdir(ref) + + +def ExpandDirectories(refs): + """Expands any directory references into inputs. + + Description: + Looks for any directories in the provided references. Found directories + are recursively searched for .js files, which are then added to the result + list. + + Args: + refs: a list of references such as files, directories, and namespaces + + Returns: + A list of references with directories removed and replaced by any + .js files that are found in them. Also, the paths will be normalized. + """ + result = [] + for ref in refs: + if IsDirectory(ref): + # Disable 'Unused variable' for subdirs + # pylint: disable=unused-variable + for (directory, subdirs, filenames) in os.walk(ref): + for filename in filenames: + if IsJsFile(filename): + result.append(os.path.join(directory, filename)) + else: + result.append(ref) + return map(os.path.normpath, result) + + +class DependencyInfo(object): + """Represents a dependency that is used to build and walk a tree.""" + + def __init__(self, filename): + self.filename = filename + self.provides = [] + self.requires = [] + + def __str__(self): + return '%s Provides: %s Requires: %s' % (self.filename, + repr(self.provides), + repr(self.requires)) + + +def BuildDependenciesFromFiles(files): + """Build a list of dependencies from a list of files. + + Description: + Takes a list of files, extracts their provides and requires, and builds + out a list of dependency objects. + + Args: + files: a list of files to be parsed for goog.provides and goog.requires. + + Returns: + A list of dependency objects, one for each file in the files argument. + """ + result = [] + filenames = set() + for filename in files: + if filename in filenames: + continue + + # Python 3 requires the file encoding to be specified + if (sys.version_info[0] < 3): + file_handle = open(filename, 'r') + else: + file_handle = open(filename, 'r', encoding='utf8') + + try: + dep = CreateDependencyInfo(filename, file_handle) + result.append(dep) + finally: + file_handle.close() + + filenames.add(filename) + + return result + + +def CreateDependencyInfo(filename, source): + """Create dependency info. + + Args: + filename: Filename for source. + source: File-like object containing source. + + Returns: + A DependencyInfo object with provides and requires filled. + """ + dep = DependencyInfo(filename) + for line in source: + if re.match(req_regex, line): + dep.requires.append(re.search(req_regex, line).group(1)) + if re.match(prov_regex, line): + dep.provides.append(re.search(prov_regex, line).group(1)) + return dep + + +def BuildDependencyHashFromDependencies(deps): + """Builds a hash for searching dependencies by the namespaces they provide. + + Description: + Dependency objects can provide multiple namespaces. This method enumerates + the provides of each dependency and adds them to a hash that can be used + to easily resolve a given dependency by a namespace it provides. + + Args: + deps: a list of dependency objects used to build the hash. + + Raises: + Exception: If a multiple files try to provide the same namepace. + + Returns: + A hash table { namespace: dependency } that can be used to resolve a + dependency by a namespace it provides. + """ + dep_hash = {} + for dep in deps: + for provide in dep.provides: + if provide in dep_hash: + raise Exception('Duplicate provide (%s) in (%s, %s)' % ( + provide, + dep_hash[provide].filename, + dep.filename)) + dep_hash[provide] = dep + return dep_hash + + +def CalculateDependencies(paths, inputs): + """Calculates the dependencies for given inputs. + + Description: + This method takes a list of paths (files, directories) and builds a + searchable data structure based on the namespaces that each .js file + provides. It then parses through each input, resolving dependencies + against this data structure. The final output is a list of files, + including the inputs, that represent all of the code that is needed to + compile the given inputs. + + Args: + paths: the references (files, directories) that are used to build the + dependency hash. + inputs: the inputs (files, directories, namespaces) that have dependencies + that need to be calculated. + + Raises: + Exception: if a provided input is invalid. + + Returns: + A list of all files, including inputs, that are needed to compile the given + inputs. + """ + deps = BuildDependenciesFromFiles(paths + inputs) + search_hash = BuildDependencyHashFromDependencies(deps) + result_list = [] + seen_list = [] + for input_file in inputs: + if IsNamespace(input_file): + namespace = re.search(ns_regex, input_file).group(1) + if namespace not in search_hash: + raise Exception('Invalid namespace (%s)' % namespace) + input_file = search_hash[namespace].filename + if not IsValidFile(input_file) or not IsJsFile(input_file): + raise Exception('Invalid file (%s)' % input_file) + seen_list.append(input_file) + file_handle = open(input_file, 'r') + try: + for line in file_handle: + if re.match(req_regex, line): + require = re.search(req_regex, line).group(1) + ResolveDependencies(require, search_hash, result_list, seen_list) + finally: + file_handle.close() + result_list.append(input_file) + + # All files depend on base.js, so put it first. + base_js_path = FindClosureBasePath(paths) + if base_js_path: + result_list.insert(0, base_js_path) + else: + logging.warning('Closure Library base.js not found.') + + return result_list + + +def FindClosureBasePath(paths): + """Given a list of file paths, return Closure base.js path, if any. + + Args: + paths: A list of paths. + + Returns: + The path to Closure's base.js file including filename, if found. + """ + + for path in paths: + pathname, filename = os.path.split(path) + + if filename == 'base.js': + f = open(path) + + is_base = False + + # Sanity check that this is the Closure base file. Check that this + # is where goog is defined. This is determined by the @provideGoog + # flag. + for line in f: + if '@provideGoog' in line: + is_base = True + break + + f.close() + + if is_base: + return path + +def ResolveDependencies(require, search_hash, result_list, seen_list): + """Takes a given requirement and resolves all of the dependencies for it. + + Description: + A given requirement may require other dependencies. This method + recursively resolves all dependencies for the given requirement. + + Raises: + Exception: when require does not exist in the search_hash. + + Args: + require: the namespace to resolve dependencies for. + search_hash: the data structure used for resolving dependencies. + result_list: a list of filenames that have been calculated as dependencies. + This variable is the output for this function. + seen_list: a list of filenames that have been 'seen'. This is required + for the dependency->dependant ordering. + """ + if require not in search_hash: + raise Exception('Missing provider for (%s)' % require) + + dep = search_hash[require] + if not dep.filename in seen_list: + seen_list.append(dep.filename) + for sub_require in dep.requires: + ResolveDependencies(sub_require, search_hash, result_list, seen_list) + result_list.append(dep.filename) + + +def GetDepsLine(dep, base_path): + """Returns a JS string for a dependency statement in the deps.js file. + + Args: + dep: The dependency that we're printing. + base_path: The path to Closure's base.js including filename. + """ + return 'goog.addDependency("%s", %s, %s);' % ( + GetRelpath(dep.filename, base_path), dep.provides, dep.requires) + + +def GetRelpath(path, start): + """Return a relative path to |path| from |start|.""" + # NOTE: Python 2.6 provides os.path.relpath, which has almost the same + # functionality as this function. Since we want to support 2.4, we have + # to implement it manually. :( + path_list = os.path.abspath(os.path.normpath(path)).split(os.sep) + start_list = os.path.abspath( + os.path.normpath(os.path.dirname(start))).split(os.sep) + + common_prefix_count = 0 + for i in range(0, min(len(path_list), len(start_list))): + if path_list[i] != start_list[i]: + break + common_prefix_count += 1 + + # Always use forward slashes, because this will get expanded to a url, + # not a file path. + return '/'.join(['..'] * (len(start_list) - common_prefix_count) + + path_list[common_prefix_count:]) + + +def PrintLine(msg, out): + out.write(msg) + out.write('\n') + + +def PrintDeps(source_paths, deps, out): + """Print out a deps.js file from a list of source paths. + + Args: + source_paths: Paths that we should generate dependency info for. + deps: Paths that provide dependency info. Their dependency info should + not appear in the deps file. + out: The output file. + + Returns: + True on success, false if it was unable to find the base path + to generate deps relative to. + """ + base_path = FindClosureBasePath(source_paths + deps) + if not base_path: + return False + + PrintLine('// This file was autogenerated by calcdeps.py', out) + excludesSet = set(deps) + + for dep in BuildDependenciesFromFiles(source_paths + deps): + if not dep.filename in excludesSet: + PrintLine(GetDepsLine(dep, base_path), out) + + return True + + +def PrintScript(source_paths, out): + for index, dep in enumerate(source_paths): + PrintLine('// Input %d' % index, out) + f = open(dep, 'r') + PrintLine(f.read(), out) + f.close() + + +def GetJavaVersion(): + """Returns the string for the current version of Java installed.""" + proc = subprocess.Popen(['java', '-version'], stderr=subprocess.PIPE) + proc.wait() + version_line = proc.stderr.read().splitlines()[0] + return version_regex.search(version_line).group() + + +def FilterByExcludes(options, files): + """Filters the given files by the exlusions specified at the command line. + + Args: + options: The flags to calcdeps. + files: The files to filter. + Returns: + A list of files. + """ + excludes = [] + if options.excludes: + excludes = ExpandDirectories(options.excludes) + + excludesSet = set(excludes) + return [i for i in files if not i in excludesSet] + + +def GetPathsFromOptions(options): + """Generates the path files from flag options. + + Args: + options: The flags to calcdeps. + Returns: + A list of files in the specified paths. (strings). + """ + + search_paths = options.paths + if not search_paths: + search_paths = ['.'] # Add default folder if no path is specified. + + search_paths = ExpandDirectories(search_paths) + return FilterByExcludes(options, search_paths) + + +def GetInputsFromOptions(options): + """Generates the inputs from flag options. + + Args: + options: The flags to calcdeps. + Returns: + A list of inputs (strings). + """ + inputs = options.inputs + if not inputs: # Parse stdin + logging.info('No inputs specified. Reading from stdin...') + inputs = filter(None, [line.strip('\n') for line in sys.stdin.readlines()]) + + logging.info('Scanning files...') + inputs = ExpandDirectories(inputs) + + return FilterByExcludes(options, inputs) + + +def Compile(compiler_jar_path, source_paths, out, flags=None): + """Prepares command-line call to Closure compiler. + + Args: + compiler_jar_path: Path to the Closure compiler .jar file. + source_paths: Source paths to build, in order. + flags: A list of additional flags to pass on to Closure compiler. + """ + args = ['java', '-jar', compiler_jar_path] + for path in source_paths: + args += ['--js', path] + + if flags: + args += flags + + logging.info('Compiling with the following command: %s', ' '.join(args)) + proc = subprocess.Popen(args, stdout=subprocess.PIPE) + (stdoutdata, stderrdata) = proc.communicate() + if proc.returncode != 0: + logging.error('JavaScript compilation failed.') + sys.exit(1) + else: + out.write(stdoutdata) + + +def main(): + """The entrypoint for this script.""" + + logging.basicConfig(format='calcdeps.py: %(message)s', level=logging.INFO) + + usage = 'usage: %prog [options] arg' + parser = optparse.OptionParser(usage) + parser.add_option('-i', + '--input', + dest='inputs', + action='append', + help='The inputs to calculate dependencies for. Valid ' + 'values can be files, directories, or namespaces ' + '(ns:goog.net.XhrIo). Only relevant to "list" and ' + '"script" output.') + parser.add_option('-p', + '--path', + dest='paths', + action='append', + help='The paths that should be traversed to build the ' + 'dependencies.') + parser.add_option('-d', + '--dep', + dest='deps', + action='append', + help='Directories or files that should be traversed to ' + 'find required dependencies for the deps file. ' + 'Does not generate dependency information for names ' + 'provided by these files. Only useful in "deps" mode.') + parser.add_option('-e', + '--exclude', + dest='excludes', + action='append', + help='Files or directories to exclude from the --path ' + 'and --input flags') + parser.add_option('-o', + '--output_mode', + dest='output_mode', + action='store', + default='list', + help='The type of output to generate from this script. ' + 'Options are "list" for a list of filenames, "script" ' + 'for a single script containing the contents of all the ' + 'file, "deps" to generate a deps.js file for all ' + 'paths, or "compiled" to produce compiled output with ' + 'the Closure compiler.') + parser.add_option('-c', + '--compiler_jar', + dest='compiler_jar', + action='store', + help='The location of the Closure compiler .jar file.') + parser.add_option('-f', + '--compiler_flag', + '--compiler_flags', # for backwards compatability + dest='compiler_flags', + action='append', + help='Additional flag to pass to the Closure compiler. ' + 'May be specified multiple times to pass multiple flags.') + parser.add_option('--output_file', + dest='output_file', + action='store', + help=('If specified, write output to this path instead of ' + 'writing to standard output.')) + + (options, args) = parser.parse_args() + + search_paths = GetPathsFromOptions(options) + + if options.output_file: + out = open(options.output_file, 'w') + else: + out = sys.stdout + + if options.output_mode == 'deps': + result = PrintDeps(search_paths, ExpandDirectories(options.deps or []), out) + if not result: + logging.error('Could not find Closure Library in the specified paths') + sys.exit(1) + + return + + inputs = GetInputsFromOptions(options) + + logging.info('Finding Closure dependencies...') + deps = CalculateDependencies(search_paths, inputs) + output_mode = options.output_mode + + if output_mode == 'script': + PrintScript(deps, out) + elif output_mode == 'list': + # Just print out a dep per line + for dep in deps: + PrintLine(dep, out) + elif output_mode == 'compiled': + # Make sure a .jar is specified. + if not options.compiler_jar: + logging.error('--compiler_jar flag must be specified if --output is ' + '"compiled"') + sys.exit(1) + + # User friendly version check. + if distutils and not (distutils.version.LooseVersion(GetJavaVersion()) > + distutils.version.LooseVersion('1.6')): + logging.error('Closure Compiler requires Java 1.6 or higher.') + logging.error('Please visit http://www.java.com/getjava') + sys.exit(1) + + Compile(options.compiler_jar, deps, out, options.compiler_flags) + + else: + logging.error('Invalid value for --output flag.') + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/scopify.py b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/scopify.py new file mode 100644 index 000000000..d8057efbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/bin/scopify.py @@ -0,0 +1,221 @@ +#!/usr/bin/python +# +# Copyright 2010 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Automatically converts codebases over to goog.scope. + +Usage: +cd path/to/my/dir; +../../../../javascript/closure/bin/scopify.py + +Scans every file in this directory, recursively. Looks for existing +goog.scope calls, and goog.require'd symbols. If it makes sense to +generate a goog.scope call for the file, then we will do so, and +try to auto-generate some aliases based on the goog.require'd symbols. + +Known Issues: + + When a file is goog.scope'd, the file contents will be indented +2. + This may put some lines over 80 chars. These will need to be fixed manually. + + We will only try to create aliases for capitalized names. We do not check + to see if those names will conflict with any existing locals. + + This creates merge conflicts for every line of every outstanding change. + If you intend to run this on your codebase, make sure your team members + know. Better yet, send them this script so that they can scopify their + outstanding changes and "accept theirs". + + When an alias is "captured", it can no longer be stubbed out for testing. + Run your tests. + +""" + +__author__ = 'nicksantos@google.com (Nick Santos)' + +import os.path +import re +import sys + +REQUIRES_RE = re.compile(r"goog.require\('([^']*)'\)") + +# Edit this manually if you want something to "always" be aliased. +# TODO(nicksantos): Add a flag for this. +DEFAULT_ALIASES = {} + +def Transform(lines): + """Converts the contents of a file into javascript that uses goog.scope. + + Arguments: + lines: A list of strings, corresponding to each line of the file. + Returns: + A new list of strings, or None if the file was not modified. + """ + requires = [] + + # Do an initial scan to be sure that this file can be processed. + for line in lines: + # Skip this file if it has already been scopified. + if line.find('goog.scope') != -1: + return None + + # If there are any global vars or functions, then we also have + # to skip the whole file. We might be able to deal with this + # more elegantly. + if line.find('var ') == 0 or line.find('function ') == 0: + return None + + for match in REQUIRES_RE.finditer(line): + requires.append(match.group(1)) + + if len(requires) == 0: + return None + + # Backwards-sort the requires, so that when one is a substring of another, + # we match the longer one first. + for val in DEFAULT_ALIASES.values(): + if requires.count(val) == 0: + requires.append(val) + + requires.sort() + requires.reverse() + + # Generate a map of requires to their aliases + aliases_to_globals = DEFAULT_ALIASES.copy() + for req in requires: + index = req.rfind('.') + if index == -1: + alias = req + else: + alias = req[(index + 1):] + + # Don't scopify lowercase namespaces, because they may conflict with + # local variables. + if alias[0].isupper(): + aliases_to_globals[alias] = req + + aliases_to_matchers = {} + globals_to_aliases = {} + for alias, symbol in aliases_to_globals.items(): + globals_to_aliases[symbol] = alias + aliases_to_matchers[alias] = re.compile('\\b%s\\b' % symbol) + + # Insert a goog.scope that aliases all required symbols. + result = [] + + START = 0 + SEEN_REQUIRES = 1 + IN_SCOPE = 2 + + mode = START + aliases_used = set() + insertion_index = None + num_blank_lines = 0 + for line in lines: + if mode == START: + result.append(line) + + if re.search(REQUIRES_RE, line): + mode = SEEN_REQUIRES + + elif mode == SEEN_REQUIRES: + if (line and + not re.search(REQUIRES_RE, line) and + not line.isspace()): + # There should be two blank lines before goog.scope + result += ['\n'] * 2 + result.append('goog.scope(function() {\n') + insertion_index = len(result) + result += ['\n'] * num_blank_lines + mode = IN_SCOPE + elif line.isspace(): + # Keep track of the number of blank lines before each block of code so + # that we can move them after the goog.scope line if necessary. + num_blank_lines += 1 + else: + # Print the blank lines we saw before this code block + result += ['\n'] * num_blank_lines + num_blank_lines = 0 + result.append(line) + + if mode == IN_SCOPE: + for symbol in requires: + if not symbol in globals_to_aliases: + continue + + alias = globals_to_aliases[symbol] + matcher = aliases_to_matchers[alias] + for match in matcher.finditer(line): + # Check to make sure we're not in a string. + # We do this by being as conservative as possible: + # if there are any quote or double quote characters + # before the symbol on this line, then bail out. + before_symbol = line[:match.start(0)] + if before_symbol.count('"') > 0 or before_symbol.count("'") > 0: + continue + + line = line.replace(match.group(0), alias) + aliases_used.add(alias) + + if line.isspace(): + # Truncate all-whitespace lines + result.append('\n') + else: + result.append(line) + + if len(aliases_used): + aliases_used = [alias for alias in aliases_used] + aliases_used.sort() + aliases_used.reverse() + for alias in aliases_used: + symbol = aliases_to_globals[alias] + result.insert(insertion_index, + 'var %s = %s;\n' % (alias, symbol)) + result.append('}); // goog.scope\n') + return result + else: + return None + +def TransformFileAt(path): + """Converts a file into javascript that uses goog.scope. + + Arguments: + path: A path to a file. + """ + f = open(path) + lines = Transform(f.readlines()) + if lines: + f = open(path, 'w') + for l in lines: + f.write(l) + f.close() + +if __name__ == '__main__': + args = sys.argv[1:] + if not len(args): + args = '.' + + for file_name in args: + if os.path.isdir(file_name): + for root, dirs, files in os.walk(file_name): + for name in files: + if name.endswith('.js') and \ + not os.path.islink(os.path.join(root, name)): + TransformFileAt(os.path.join(root, name)) + else: + if file_name.endswith('.js') and \ + not os.path.islink(file_name): + TransformFileAt(file_name) diff --git a/dom/canvas/test/webgl-conf/checkout/closure-library/closure/goog/base.js b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/goog/base.js new file mode 100644 index 000000000..a96333017 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/closure-library/closure/goog/base.js @@ -0,0 +1,2496 @@ +// Copyright 2006 The Closure Library Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Bootstrap for the Google JS Library (Closure). + * + * In uncompiled mode base.js will write out Closure's deps file, unless the + * global CLOSURE_NO_DEPS is set to true. This allows projects to + * include their own deps file(s) from different locations. + * + * @author arv@google.com (Erik Arvidsson) + * + * @provideGoog + */ + + +/** + * @define {boolean} Overridden to true by the compiler when --closure_pass + * or --mark_as_compiled is specified. + */ +var COMPILED = false; + + +/** + * Base namespace for the Closure library. Checks to see goog is already + * defined in the current scope before assigning to prevent clobbering if + * base.js is loaded more than once. + * + * @const + */ +var goog = goog || {}; + + +/** + * Reference to the global context. In most cases this will be 'window'. + */ +goog.global = this; + + +/** + * A hook for overriding the define values in uncompiled mode. + * + * In uncompiled mode, {@code CLOSURE_UNCOMPILED_DEFINES} may be defined before + * loading base.js. If a key is defined in {@code CLOSURE_UNCOMPILED_DEFINES}, + * {@code goog.define} will use the value instead of the default value. This + * allows flags to be overwritten without compilation (this is normally + * accomplished with the compiler's "define" flag). + * + * Example: + *
+ *   var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};
+ * 
+ * + * @type {Object|undefined} + */ +goog.global.CLOSURE_UNCOMPILED_DEFINES; + + +/** + * A hook for overriding the define values in uncompiled or compiled mode, + * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code. In + * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence. + * + * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or + * string literals or the compiler will emit an error. + * + * While any @define value may be set, only those set with goog.define will be + * effective for uncompiled code. + * + * Example: + *
+ *   var CLOSURE_DEFINES = {'goog.DEBUG': false} ;
+ * 
+ * + * @type {Object|undefined} + */ +goog.global.CLOSURE_DEFINES; + + +/** + * Returns true if the specified value is not undefined. + * WARNING: Do not use this to test if an object has a property. Use the in + * operator instead. + * + * @param {?} val Variable to test. + * @return {boolean} Whether variable is defined. + */ +goog.isDef = function(val) { + // void 0 always evaluates to undefined and hence we do not need to depend on + // the definition of the global variable named 'undefined'. + return val !== void 0; +}; + + +/** + * Builds an object structure for the provided namespace path, ensuring that + * names that already exist are not overwritten. For example: + * "a.b.c" -> a = {};a.b={};a.b.c={}; + * Used by goog.provide and goog.exportSymbol. + * @param {string} name name of the object that this file defines. + * @param {*=} opt_object the object to expose at the end of the path. + * @param {Object=} opt_objectToExportTo The object to add the path to; default + * is |goog.global|. + * @private + */ +goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) { + var parts = name.split('.'); + var cur = opt_objectToExportTo || goog.global; + + // Internet Explorer exhibits strange behavior when throwing errors from + // methods externed in this manner. See the testExportSymbolExceptions in + // base_test.html for an example. + if (!(parts[0] in cur) && cur.execScript) { + cur.execScript('var ' + parts[0]); + } + + // Certain browsers cannot parse code in the form for((a in b); c;); + // This pattern is produced by the JSCompiler when it collapses the + // statement above into the conditional loop below. To prevent this from + // happening, use a for-loop and reserve the init logic as below. + + // Parentheses added to eliminate strict JS warning in Firefox. + for (var part; parts.length && (part = parts.shift());) { + if (!parts.length && goog.isDef(opt_object)) { + // last part and we have an object; use it + cur[part] = opt_object; + } else if (cur[part]) { + cur = cur[part]; + } else { + cur = cur[part] = {}; + } + } +}; + + +/** + * Defines a named value. In uncompiled mode, the value is retrieved from + * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and + * has the property specified, and otherwise used the defined defaultValue. + * When compiled the default can be overridden using the compiler + * options or the value set in the CLOSURE_DEFINES object. + * + * @param {string} name The distinguished name to provide. + * @param {string|number|boolean} defaultValue + */ +goog.define = function(name, defaultValue) { + var value = defaultValue; + if (!COMPILED) { + if (goog.global.CLOSURE_UNCOMPILED_DEFINES && + Object.prototype.hasOwnProperty.call( + goog.global.CLOSURE_UNCOMPILED_DEFINES, name)) { + value = goog.global.CLOSURE_UNCOMPILED_DEFINES[name]; + } else if (goog.global.CLOSURE_DEFINES && + Object.prototype.hasOwnProperty.call( + goog.global.CLOSURE_DEFINES, name)) { + value = goog.global.CLOSURE_DEFINES[name]; + } + } + goog.exportPath_(name, value); +}; + + +/** + * @define {boolean} DEBUG is provided as a convenience so that debugging code + * that should not be included in a production js_binary can be easily stripped + * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most + * toString() methods should be declared inside an "if (goog.DEBUG)" conditional + * because they are generally used for debugging purposes and it is difficult + * for the JSCompiler to statically determine whether they are used. + */ +goog.define('goog.DEBUG', true); + + +/** + * @define {string} LOCALE defines the locale being used for compilation. It is + * used to select locale specific data to be compiled in js binary. BUILD rule + * can specify this value by "--define goog.LOCALE=" as JSCompiler + * option. + * + * Take into account that the locale code format is important. You should use + * the canonical Unicode format with hyphen as a delimiter. Language must be + * lowercase, Language Script - Capitalized, Region - UPPERCASE. + * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN. + * + * See more info about locale codes here: + * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers + * + * For language codes you should use values defined by ISO 693-1. See it here + * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from + * this rule: the Hebrew language. For legacy reasons the old code (iw) should + * be used instead of the new code (he), see http://wiki/Main/IIISynonyms. + */ +goog.define('goog.LOCALE', 'en'); // default to en + + +/** + * @define {boolean} Whether this code is running on trusted sites. + * + * On untrusted sites, several native functions can be defined or overridden by + * external libraries like Prototype, Datejs, and JQuery and setting this flag + * to false forces closure to use its own implementations when possible. + * + * If your JavaScript can be loaded by a third party site and you are wary about + * relying on non-standard implementations, specify + * "--define goog.TRUSTED_SITE=false" to the JSCompiler. + */ +goog.define('goog.TRUSTED_SITE', true); + + +/** + * @define {boolean} Whether a project is expected to be running in strict mode. + * + * This define can be used to trigger alternate implementations compatible with + * running in EcmaScript Strict mode or warn about unavailable functionality. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode + * + */ +goog.define('goog.STRICT_MODE_COMPATIBLE', false); + + +/** + * @define {boolean} Whether code that calls {@link goog.setTestOnly} should + * be disallowed in the compilation unit. + */ +goog.define('goog.DISALLOW_TEST_ONLY_CODE', COMPILED && !goog.DEBUG); + + +/** + * Defines a namespace in Closure. + * + * A namespace may only be defined once in a codebase. It may be defined using + * goog.provide() or goog.module(). + * + * The presence of one or more goog.provide() calls in a file indicates + * that the file defines the given objects/namespaces. + * Provided symbols must not be null or undefined. + * + * In addition, goog.provide() creates the object stubs for a namespace + * (for example, goog.provide("goog.foo.bar") will create the object + * goog.foo.bar if it does not already exist). + * + * Build tools also scan for provide/require/module statements + * to discern dependencies, build dependency files (see deps.js), etc. + * + * @see goog.require + * @see goog.module + * @param {string} name Namespace provided by this file in the form + * "goog.package.part". + */ +goog.provide = function(name) { + if (!COMPILED) { + // Ensure that the same namespace isn't provided twice. + // A goog.module/goog.provide maps a goog.require to a specific file + if (goog.isProvided_(name)) { + throw Error('Namespace "' + name + '" already declared.'); + } + } + + goog.constructNamespace_(name); +}; + + +/** + * @param {string} name Namespace provided by this file in the form + * "goog.package.part". + * @param {Object=} opt_obj The object to embed in the namespace. + * @private + */ +goog.constructNamespace_ = function(name, opt_obj) { + if (!COMPILED) { + delete goog.implicitNamespaces_[name]; + + var namespace = name; + while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) { + if (goog.getObjectByName(namespace)) { + break; + } + goog.implicitNamespaces_[namespace] = true; + } + } + + goog.exportPath_(name, opt_obj); +}; + + +/** + * Module identifier validation regexp. + * Note: This is a conservative check, it is very possible to be more lenient, + * the primary exclusion here is "/" and "\" and a leading ".", these + * restrictions are intended to leave the door open for using goog.require + * with relative file paths rather than module identifiers. + * @private + */ +goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/; + + +/** + * Defines a module in Closure. + * + * Marks that this file must be loaded as a module and claims the namespace. + * + * A namespace may only be defined once in a codebase. It may be defined using + * goog.provide() or goog.module(). + * + * goog.module() has three requirements: + * - goog.module may not be used in the same file as goog.provide. + * - goog.module must be the first statement in the file. + * - only one goog.module is allowed per file. + * + * When a goog.module annotated file is loaded, it is enclosed in + * a strict function closure. This means that: + * - any variables declared in a goog.module file are private to the file + * (not global), though the compiler is expected to inline the module. + * - The code must obey all the rules of "strict" JavaScript. + * - the file will be marked as "use strict" + * + * NOTE: unlike goog.provide, goog.module does not declare any symbols by + * itself. If declared symbols are desired, use + * goog.module.declareLegacyNamespace(). + * + * + * See the public goog.module proposal: http://goo.gl/Va1hin + * + * @param {string} name Namespace provided by this file in the form + * "goog.package.part", is expected but not required. + */ +goog.module = function(name) { + if (!goog.isString(name) || + !name || + name.search(goog.VALID_MODULE_RE_) == -1) { + throw Error('Invalid module identifier'); + } + if (!goog.isInModuleLoader_()) { + throw Error('Module ' + name + ' has been loaded incorrectly.'); + } + if (goog.moduleLoaderState_.moduleName) { + throw Error('goog.module may only be called once per module.'); + } + + // Store the module name for the loader. + goog.moduleLoaderState_.moduleName = name; + if (!COMPILED) { + // Ensure that the same namespace isn't provided twice. + // A goog.module/goog.provide maps a goog.require to a specific file + if (goog.isProvided_(name)) { + throw Error('Namespace "' + name + '" already declared.'); + } + delete goog.implicitNamespaces_[name]; + } +}; + + +/** + * @param {string} name The module identifier. + * @return {?} The module exports for an already loaded module or null. + * + * Note: This is not an alternative to goog.require, it does not + * indicate a hard dependency, instead it is used to indicate + * an optional dependency or to access the exports of a module + * that has already been loaded. + * @suppress {missingProvide} + */ +goog.module.get = function(name) { + return goog.module.getInternal_(name); +}; + + +/** + * @param {string} name The module identifier. + * @return {?} The module exports for an already loaded module or null. + * @private + */ +goog.module.getInternal_ = function(name) { + if (!COMPILED) { + if (goog.isProvided_(name)) { + // goog.require only return a value with-in goog.module files. + return name in goog.loadedModules_ ? + goog.loadedModules_[name] : + goog.getObjectByName(name); + } else { + return null; + } + } +}; + + +/** + * @private {?{ + * moduleName: (string|undefined), + * declareTestMethods: boolean + * }} + */ +goog.moduleLoaderState_ = null; + + +/** + * @private + * @return {boolean} Whether a goog.module is currently being initialized. + */ +goog.isInModuleLoader_ = function() { + return goog.moduleLoaderState_ != null; +}; + + +/** + * Indicate that a module's exports that are known test methods should + * be copied to the global object. This makes the test methods visible to + * test runners that inspect the global object. + * + * TODO(johnlenz): Make the test framework aware of goog.module so + * that this isn't necessary. Alternately combine this with goog.setTestOnly + * to minimize boiler plate. + * @suppress {missingProvide} + */ +goog.module.declareTestMethods = function() { + if (!goog.isInModuleLoader_()) { + throw new Error('goog.module.declareTestMethods must be called from ' + + 'within a goog.module'); + } + goog.moduleLoaderState_.declareTestMethods = true; +}; + + +/** + * Provide the module's exports as a globally accessible object under the + * module's declared name. This is intended to ease migration to goog.module + * for files that have existing usages. + * @suppress {missingProvide} + */ +goog.module.declareLegacyNamespace = function() { + if (!COMPILED && !goog.isInModuleLoader_()) { + throw new Error('goog.module.declareLegacyNamespace must be called from ' + + 'within a goog.module'); + } + if (!COMPILED && !goog.moduleLoaderState_.moduleName) { + throw Error('goog.module must be called prior to ' + + 'goog.module.declareLegacyNamespace.'); + } + goog.moduleLoaderState_.declareLegacyNamespace = true; +}; + + +/** + * Marks that the current file should only be used for testing, and never for + * live code in production. + * + * In the case of unit tests, the message may optionally be an exact namespace + * for the test (e.g. 'goog.stringTest'). The linter will then ignore the extra + * provide (if not explicitly defined in the code). + * + * @param {string=} opt_message Optional message to add to the error that's + * raised when used in production code. + */ +goog.setTestOnly = function(opt_message) { + if (goog.DISALLOW_TEST_ONLY_CODE) { + opt_message = opt_message || ''; + throw Error('Importing test-only code into non-debug environment' + + (opt_message ? ': ' + opt_message : '.')); + } +}; + + +/** + * Forward declares a symbol. This is an indication to the compiler that the + * symbol may be used in the source yet is not required and may not be provided + * in compilation. + * + * The most common usage of forward declaration is code that takes a type as a + * function parameter but does not need to require it. By forward declaring + * instead of requiring, no hard dependency is made, and (if not required + * elsewhere) the namespace may never be required and thus, not be pulled + * into the JavaScript binary. If it is required elsewhere, it will be type + * checked as normal. + * + * + * @param {string} name The namespace to forward declare in the form of + * "goog.package.part". + */ +goog.forwardDeclare = function(name) {}; + + +if (!COMPILED) { + + /** + * Check if the given name has been goog.provided. This will return false for + * names that are available only as implicit namespaces. + * @param {string} name name of the object to look for. + * @return {boolean} Whether the name has been provided. + * @private + */ + goog.isProvided_ = function(name) { + return (name in goog.loadedModules_) || + (!goog.implicitNamespaces_[name] && + goog.isDefAndNotNull(goog.getObjectByName(name))); + }; + + /** + * Namespaces implicitly defined by goog.provide. For example, + * goog.provide('goog.events.Event') implicitly declares that 'goog' and + * 'goog.events' must be namespaces. + * + * @type {!Object} + * @private + */ + goog.implicitNamespaces_ = {'goog.module': true}; + + // NOTE: We add goog.module as an implicit namespace as goog.module is defined + // here and because the existing module package has not been moved yet out of + // the goog.module namespace. This satisifies both the debug loader and + // ahead-of-time dependency management. +} + + +/** + * Returns an object based on its fully qualified external name. The object + * is not found if null or undefined. If you are using a compilation pass that + * renames property names beware that using this function will not find renamed + * properties. + * + * @param {string} name The fully qualified name. + * @param {Object=} opt_obj The object within which to look; default is + * |goog.global|. + * @return {?} The value (object or primitive) or, if not found, null. + */ +goog.getObjectByName = function(name, opt_obj) { + var parts = name.split('.'); + var cur = opt_obj || goog.global; + for (var part; part = parts.shift(); ) { + if (goog.isDefAndNotNull(cur[part])) { + cur = cur[part]; + } else { + return null; + } + } + return cur; +}; + + +/** + * Globalizes a whole namespace, such as goog or goog.lang. + * + * @param {!Object} obj The namespace to globalize. + * @param {Object=} opt_global The object to add the properties to. + * @deprecated Properties may be explicitly exported to the global scope, but + * this should no longer be done in bulk. + */ +goog.globalize = function(obj, opt_global) { + var global = opt_global || goog.global; + for (var x in obj) { + global[x] = obj[x]; + } +}; + + +/** + * Adds a dependency from a file to the files it requires. + * @param {string} relPath The path to the js file. + * @param {!Array} provides An array of strings with + * the names of the objects this file provides. + * @param {!Array} requires An array of strings with + * the names of the objects this file requires. + * @param {boolean=} opt_isModule Whether this dependency must be loaded as + * a module as declared by goog.module. + */ +goog.addDependency = function(relPath, provides, requires, opt_isModule) { + if (goog.DEPENDENCIES_ENABLED) { + var provide, require; + var path = relPath.replace(/\\/g, '/'); + var deps = goog.dependencies_; + for (var i = 0; provide = provides[i]; i++) { + deps.nameToPath[provide] = path; + deps.pathIsModule[path] = !!opt_isModule; + } + for (var j = 0; require = requires[j]; j++) { + if (!(path in deps.requires)) { + deps.requires[path] = {}; + } + deps.requires[path][require] = true; + } + } +}; + + + + +// NOTE(nnaze): The debug DOM loader was included in base.js as an original way +// to do "debug-mode" development. The dependency system can sometimes be +// confusing, as can the debug DOM loader's asynchronous nature. +// +// With the DOM loader, a call to goog.require() is not blocking -- the script +// will not load until some point after the current script. If a namespace is +// needed at runtime, it needs to be defined in a previous script, or loaded via +// require() with its registered dependencies. +// User-defined namespaces may need their own deps file. See http://go/js_deps, +// http://go/genjsdeps, or, externally, DepsWriter. +// https://developers.google.com/closure/library/docs/depswriter +// +// Because of legacy clients, the DOM loader can't be easily removed from +// base.js. Work is being done to make it disableable or replaceable for +// different environments (DOM-less JavaScript interpreters like Rhino or V8, +// for example). See bootstrap/ for more information. + + +/** + * @define {boolean} Whether to enable the debug loader. + * + * If enabled, a call to goog.require() will attempt to load the namespace by + * appending a script tag to the DOM (if the namespace has been registered). + * + * If disabled, goog.require() will simply assert that the namespace has been + * provided (and depend on the fact that some outside tool correctly ordered + * the script). + */ +goog.define('goog.ENABLE_DEBUG_LOADER', true); + + +/** + * @param {string} msg + * @private + */ +goog.logToConsole_ = function(msg) { + if (goog.global.console) { + goog.global.console['error'](msg); + } +}; + + +/** + * Implements a system for the dynamic resolution of dependencies that works in + * parallel with the BUILD system. Note that all calls to goog.require will be + * stripped by the JSCompiler when the --closure_pass option is used. + * @see goog.provide + * @param {string} name Namespace to include (as was given in goog.provide()) in + * the form "goog.package.part". + * @return {?} If called within a goog.module file, the associated namespace or + * module otherwise null. + */ +goog.require = function(name) { + + // If the object already exists we do not need do do anything. + if (!COMPILED) { + if (goog.ENABLE_DEBUG_LOADER && goog.IS_OLD_IE_) { + goog.maybeProcessDeferredDep_(name); + } + + if (goog.isProvided_(name)) { + if (goog.isInModuleLoader_()) { + return goog.module.getInternal_(name); + } else { + return null; + } + } + + if (goog.ENABLE_DEBUG_LOADER) { + var path = goog.getPathFromDeps_(name); + if (path) { + goog.included_[path] = true; + goog.writeScripts_(); + return null; + } + } + + var errorMessage = 'goog.require could not find: ' + name; + goog.logToConsole_(errorMessage); + + throw Error(errorMessage); + } +}; + + +/** + * Path for included scripts. + * @type {string} + */ +goog.basePath = ''; + + +/** + * A hook for overriding the base path. + * @type {string|undefined} + */ +goog.global.CLOSURE_BASE_PATH; + + +/** + * Whether to write out Closure's deps file. By default, the deps are written. + * @type {boolean|undefined} + */ +goog.global.CLOSURE_NO_DEPS; + + +/** + * A function to import a single script. This is meant to be overridden when + * Closure is being run in non-HTML contexts, such as web workers. It's defined + * in the global scope so that it can be set before base.js is loaded, which + * allows deps.js to be imported properly. + * + * The function is passed the script source, which is a relative URI. It should + * return true if the script was imported, false otherwise. + * @type {(function(string): boolean)|undefined} + */ +goog.global.CLOSURE_IMPORT_SCRIPT; + + +/** + * Null function used for default values of callbacks, etc. + * @return {void} Nothing. + */ +goog.nullFunction = function() {}; + + +/** + * The identity function. Returns its first argument. + * + * @param {*=} opt_returnValue The single value that will be returned. + * @param {...*} var_args Optional trailing arguments. These are ignored. + * @return {?} The first argument. We can't know the type -- just pass it along + * without type. + * @deprecated Use goog.functions.identity instead. + */ +goog.identityFunction = function(opt_returnValue, var_args) { + return opt_returnValue; +}; + + +/** + * When defining a class Foo with an abstract method bar(), you can do: + * Foo.prototype.bar = goog.abstractMethod + * + * Now if a subclass of Foo fails to override bar(), an error will be thrown + * when bar() is invoked. + * + * Note: This does not take the name of the function to override as an argument + * because that would make it more difficult to obfuscate our JavaScript code. + * + * @type {!Function} + * @throws {Error} when invoked to indicate the method should be overridden. + */ +goog.abstractMethod = function() { + throw Error('unimplemented abstract method'); +}; + + +/** + * Adds a {@code getInstance} static method that always returns the same + * instance object. + * @param {!Function} ctor The constructor for the class to add the static + * method to. + */ +goog.addSingletonGetter = function(ctor) { + ctor.getInstance = function() { + if (ctor.instance_) { + return ctor.instance_; + } + if (goog.DEBUG) { + // NOTE: JSCompiler can't optimize away Array#push. + goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor; + } + return ctor.instance_ = new ctor; + }; +}; + + +/** + * All singleton classes that have been instantiated, for testing. Don't read + * it directly, use the {@code goog.testing.singleton} module. The compiler + * removes this variable if unused. + * @type {!Array} + * @private + */ +goog.instantiatedSingletons_ = []; + + +/** + * @define {boolean} Whether to load goog.modules using {@code eval} when using + * the debug loader. This provides a better debugging experience as the + * source is unmodified and can be edited using Chrome Workspaces or similar. + * However in some environments the use of {@code eval} is banned + * so we provide an alternative. + */ +goog.define('goog.LOAD_MODULE_USING_EVAL', true); + + +/** + * @define {boolean} Whether the exports of goog.modules should be sealed when + * possible. + */ +goog.define('goog.SEAL_MODULE_EXPORTS', goog.DEBUG); + + +/** + * The registry of initialized modules: + * the module identifier to module exports map. + * @private @const {!Object} + */ +goog.loadedModules_ = {}; + + +/** + * True if goog.dependencies_ is available. + * @const {boolean} + */ +goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; + + +if (goog.DEPENDENCIES_ENABLED) { + /** + * Object used to keep track of urls that have already been added. This record + * allows the prevention of circular dependencies. + * @private {!Object} + */ + goog.included_ = {}; + + + /** + * This object is used to keep track of dependencies and other data that is + * used for loading scripts. + * @private + * @type {{ + * pathIsModule: !Object, + * nameToPath: !Object, + * requires: !Object>, + * visited: !Object, + * written: !Object, + * deferred: !Object + * }} + */ + goog.dependencies_ = { + pathIsModule: {}, // 1 to 1 + + nameToPath: {}, // 1 to 1 + + requires: {}, // 1 to many + + // Used when resolving dependencies to prevent us from visiting file twice. + visited: {}, + + written: {}, // Used to keep track of script files we have written. + + deferred: {} // Used to track deferred module evaluations in old IEs + }; + + + /** + * Tries to detect whether is in the context of an HTML document. + * @return {boolean} True if it looks like HTML document. + * @private + */ + goog.inHtmlDocument_ = function() { + var doc = goog.global.document; + return typeof doc != 'undefined' && + 'write' in doc; // XULDocument misses write. + }; + + + /** + * Tries to detect the base path of base.js script that bootstraps Closure. + * @private + */ + goog.findBasePath_ = function() { + if (goog.isDef(goog.global.CLOSURE_BASE_PATH)) { + goog.basePath = goog.global.CLOSURE_BASE_PATH; + return; + } else if (!goog.inHtmlDocument_()) { + return; + } + var doc = goog.global.document; + var scripts = doc.getElementsByTagName('SCRIPT'); + // Search backwards since the current script is in almost all cases the one + // that has base.js. + for (var i = scripts.length - 1; i >= 0; --i) { + var script = /** @type {!HTMLScriptElement} */ (scripts[i]); + var src = script.src; + var qmark = src.lastIndexOf('?'); + var l = qmark == -1 ? src.length : qmark; + if (src.substr(l - 7, 7) == 'base.js') { + goog.basePath = src.substr(0, l - 7); + return; + } + } + }; + + + /** + * Imports a script if, and only if, that script hasn't already been imported. + * (Must be called at execution time) + * @param {string} src Script source. + * @param {string=} opt_sourceText The optionally source text to evaluate + * @private + */ + goog.importScript_ = function(src, opt_sourceText) { + var importScript = goog.global.CLOSURE_IMPORT_SCRIPT || + goog.writeScriptTag_; + if (importScript(src, opt_sourceText)) { + goog.dependencies_.written[src] = true; + } + }; + + + /** @const @private {boolean} */ + goog.IS_OLD_IE_ = !!(!goog.global.atob && goog.global.document && + goog.global.document.all); + + + /** + * Given a URL initiate retrieval and execution of the module. + * @param {string} src Script source URL. + * @private + */ + goog.importModule_ = function(src) { + // In an attempt to keep browsers from timing out loading scripts using + // synchronous XHRs, put each load in its own script block. + var bootstrap = 'goog.retrieveAndExecModule_("' + src + '");'; + + if (goog.importScript_('', bootstrap)) { + goog.dependencies_.written[src] = true; + } + }; + + + /** @private {!Array} */ + goog.queuedModules_ = []; + + + /** + * Return an appropriate module text. Suitable to insert into + * a script tag (that is unescaped). + * @param {string} srcUrl + * @param {string} scriptText + * @return {string} + * @private + */ + goog.wrapModule_ = function(srcUrl, scriptText) { + if (!goog.LOAD_MODULE_USING_EVAL || !goog.isDef(goog.global.JSON)) { + return '' + + 'goog.loadModule(function(exports) {' + + '"use strict";' + + scriptText + + '\n' + // terminate any trailing single line comment. + ';return exports' + + '});' + + '\n//# sourceURL=' + srcUrl + '\n'; + } else { + return '' + + 'goog.loadModule(' + + goog.global.JSON.stringify( + scriptText + '\n//# sourceURL=' + srcUrl + '\n') + + ');'; + } + }; + + // On IE9 and earlier, it is necessary to handle + // deferred module loads. In later browsers, the + // code to be evaluated is simply inserted as a script + // block in the correct order. To eval deferred + // code at the right time, we piggy back on goog.require to call + // goog.maybeProcessDeferredDep_. + // + // The goog.requires are used both to bootstrap + // the loading process (when no deps are available) and + // declare that they should be available. + // + // Here we eval the sources, if all the deps are available + // either already eval'd or goog.require'd. This will + // be the case when all the dependencies have already + // been loaded, and the dependent module is loaded. + // + // But this alone isn't sufficient because it is also + // necessary to handle the case where there is no root + // that is not deferred. For that there we register for an event + // and trigger goog.loadQueuedModules_ handle any remaining deferred + // evaluations. + + /** + * Handle any remaining deferred goog.module evals. + * @private + */ + goog.loadQueuedModules_ = function() { + var count = goog.queuedModules_.length; + if (count > 0) { + var queue = goog.queuedModules_; + goog.queuedModules_ = []; + for (var i = 0; i < count; i++) { + var path = queue[i]; + goog.maybeProcessDeferredPath_(path); + } + } + }; + + + /** + * Eval the named module if its dependencies are + * available. + * @param {string} name The module to load. + * @private + */ + goog.maybeProcessDeferredDep_ = function(name) { + if (goog.isDeferredModule_(name) && + goog.allDepsAreAvailable_(name)) { + var path = goog.getPathFromDeps_(name); + goog.maybeProcessDeferredPath_(goog.basePath + path); + } + }; + + /** + * @param {string} name The module to check. + * @return {boolean} Whether the name represents a + * module whose evaluation has been deferred. + * @private + */ + goog.isDeferredModule_ = function(name) { + var path = goog.getPathFromDeps_(name); + if (path && goog.dependencies_.pathIsModule[path]) { + var abspath = goog.basePath + path; + return (abspath) in goog.dependencies_.deferred; + } + return false; + }; + + /** + * @param {string} name The module to check. + * @return {boolean} Whether the name represents a + * module whose declared dependencies have all been loaded + * (eval'd or a deferred module load) + * @private + */ + goog.allDepsAreAvailable_ = function(name) { + var path = goog.getPathFromDeps_(name); + if (path && (path in goog.dependencies_.requires)) { + for (var requireName in goog.dependencies_.requires[path]) { + if (!goog.isProvided_(requireName) && + !goog.isDeferredModule_(requireName)) { + return false; + } + } + } + return true; + }; + + + /** + * @param {string} abspath + * @private + */ + goog.maybeProcessDeferredPath_ = function(abspath) { + if (abspath in goog.dependencies_.deferred) { + var src = goog.dependencies_.deferred[abspath]; + delete goog.dependencies_.deferred[abspath]; + goog.globalEval(src); + } + }; + + + /** + * @param {function(?):?|string} moduleDef The module definition. + */ + goog.loadModule = function(moduleDef) { + // NOTE: we allow function definitions to be either in the from + // of a string to eval (which keeps the original source intact) or + // in a eval forbidden environment (CSP) we allow a function definition + // which in its body must call {@code goog.module}, and return the exports + // of the module. + var previousState = goog.moduleLoaderState_; + try { + goog.moduleLoaderState_ = { + moduleName: undefined, declareTestMethods: false}; + var exports; + if (goog.isFunction(moduleDef)) { + exports = moduleDef.call(goog.global, {}); + } else if (goog.isString(moduleDef)) { + exports = goog.loadModuleFromSource_.call(goog.global, moduleDef); + } else { + throw Error('Invalid module definition'); + } + + var moduleName = goog.moduleLoaderState_.moduleName; + if (!goog.isString(moduleName) || !moduleName) { + throw Error('Invalid module name \"' + moduleName + '\"'); + } + + // Don't seal legacy namespaces as they may be uses as a parent of + // another namespace + if (goog.moduleLoaderState_.declareLegacyNamespace) { + goog.constructNamespace_(moduleName, exports); + } else if (goog.SEAL_MODULE_EXPORTS && Object.seal) { + Object.seal(exports); + } + + goog.loadedModules_[moduleName] = exports; + if (goog.moduleLoaderState_.declareTestMethods) { + for (var entry in exports) { + if (entry.indexOf('test', 0) === 0 || + entry == 'tearDown' || + entry == 'setUp' || + entry == 'setUpPage' || + entry == 'tearDownPage') { + goog.global[entry] = exports[entry]; + } + } + } + } finally { + goog.moduleLoaderState_ = previousState; + } + }; + + + /** + * @param {string} source + * @return {!Object} + * @private + */ + goog.loadModuleFromSource_ = function(source) { + // NOTE: we avoid declaring parameters or local variables here to avoid + // masking globals or leaking values into the module definition. + 'use strict'; + var exports = {}; + eval(arguments[0]); + return exports; + }; + + + /** + * The default implementation of the import function. Writes a script tag to + * import the script. + * + * @param {string} src The script url. + * @param {string=} opt_sourceText The optionally source text to evaluate + * @return {boolean} True if the script was imported, false otherwise. + * @private + */ + goog.writeScriptTag_ = function(src, opt_sourceText) { + if (goog.inHtmlDocument_()) { + var doc = goog.global.document; + + // If the user tries to require a new symbol after document load, + // something has gone terribly wrong. Doing a document.write would + // wipe out the page. + if (doc.readyState == 'complete') { + // Certain test frameworks load base.js multiple times, which tries + // to write deps.js each time. If that happens, just fail silently. + // These frameworks wipe the page between each load of base.js, so this + // is OK. + var isDeps = /\bdeps.js$/.test(src); + if (isDeps) { + return false; + } else { + throw Error('Cannot write "' + src + '" after document load'); + } + } + + var isOldIE = goog.IS_OLD_IE_; + + if (opt_sourceText === undefined) { + if (!isOldIE) { + doc.write( + ' + +bindAttribLocation with aliasing + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html new file mode 100644 index 000000000..19f255102 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html @@ -0,0 +1,119 @@ + + + + + + + + +WebGL bindAttribLocation with Matrix Attributes Conformance Test + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html new file mode 100644 index 000000000..ee98fb7b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html @@ -0,0 +1,89 @@ + + + + + + +WebGL Repeated BindAttribLocation Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html new file mode 100644 index 000000000..c8657a159 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html @@ -0,0 +1,100 @@ + + + + + + +WebGL Disabled Vertex Attrib Test + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html new file mode 100644 index 000000000..8e7c2f5f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html @@ -0,0 +1,82 @@ + + + + + + + WebGL Enable Vertex Attrib Test + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html new file mode 100644 index 000000000..f97b71cc3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html @@ -0,0 +1,157 @@ + + + + + + + + +WebGL Matrix Attribute Conformance Test + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html new file mode 100644 index 000000000..252bae44c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html new file mode 100644 index 000000000..1392cd103 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html @@ -0,0 +1,152 @@ + + + + + + +WebGL Enable Vertex Attrib Zero Test + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html new file mode 100644 index 000000000..068a7cca0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html @@ -0,0 +1,49 @@ + + + + + + +WebGL vertexAttrib Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html new file mode 100644 index 000000000..1e537bbb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html @@ -0,0 +1,181 @@ + + + + + + + vertexattribpointer offsets test + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html new file mode 100644 index 000000000..cdfe450a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html @@ -0,0 +1,164 @@ + + + + + + +WebGL vertexAttribPointer Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt new file mode 100644 index 000000000..a13bcae9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt @@ -0,0 +1,12 @@ +buffer-bind-test.html +buffer-data-and-buffer-sub-data.html +--min-version 1.0.3 buffer-data-array-buffer-delete.html +--min-version 1.0.4 buffer-uninitialized.html +--min-version 1.0.2 element-array-buffer-delete-recreate.html +index-validation-copies-indices.html +index-validation-crash-with-buffer-sub-data.html +--min-version 1.0.2 index-validation-large-buffer.html +index-validation-verifies-too-many-indices.html +index-validation-with-resized-buffer.html +index-validation.html + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html new file mode 100644 index 000000000..e86c9e9fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html @@ -0,0 +1,87 @@ + + + + + + + WebGL BindBuffer conformance test. + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html new file mode 100644 index 000000000..444719c38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html @@ -0,0 +1,188 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html new file mode 100644 index 000000000..fc9ccb0b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html @@ -0,0 +1,80 @@ + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html new file mode 100644 index 000000000..7eb19de8d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html @@ -0,0 +1,123 @@ + + + + + + + + + + +
+
+ + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html new file mode 100644 index 000000000..75f1289c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html @@ -0,0 +1,90 @@ + + + + + + Element Array Buffer Deletion and Recreation Test + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html new file mode 100644 index 000000000..e25a25932 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html @@ -0,0 +1,73 @@ + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html new file mode 100644 index 000000000..d6a6d8828 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html @@ -0,0 +1,59 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html new file mode 100644 index 000000000..75d727733 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html @@ -0,0 +1,77 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html new file mode 100644 index 000000000..687b556c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html @@ -0,0 +1,71 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html new file mode 100644 index 000000000..cc0c1fda4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html @@ -0,0 +1,128 @@ + + + + + + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html new file mode 100644 index 000000000..4b14be215 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html @@ -0,0 +1,138 @@ + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt new file mode 100644 index 000000000..b1d74fca2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt @@ -0,0 +1,15 @@ +buffer-offscreen-test.html +buffer-preserve-test.html +canvas-test.html +canvas-zero-size.html +drawingbuffer-static-canvas-test.html +--min-version 1.0.2 drawingbuffer-hd-dpi-test.html +drawingbuffer-test.html +--min-version 1.0.3 draw-webgl-to-canvas-test.html +--min-version 1.0.3 draw-static-webgl-to-multiple-canvas-test.html +--min-version 1.0.2 framebuffer-bindings-unaffected-on-resize.html +--min-version 1.0.4 framebuffer-bindings-affected-by-to-data-url.html +--min-version 1.0.3 rapid-resizing.html +--min-version 1.0.2 texture-bindings-unaffected-on-resize.html +--min-version 1.0.2 to-data-url-test.html +viewport-unchanged-upon-resize.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html new file mode 100644 index 000000000..e4f3e49c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html @@ -0,0 +1,99 @@ + + + + + +WebGL required buffer clear behaviour test + + + + + + +
+ +
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html new file mode 100644 index 000000000..c956bdf30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html @@ -0,0 +1,87 @@ + + + + + +WebGL required buffer clear behaviour test + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html new file mode 100644 index 000000000..dda69f471 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html @@ -0,0 +1,212 @@ + + + + + + +WebGL Canvas Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html new file mode 100644 index 000000000..8d6763e61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html @@ -0,0 +1,64 @@ + + + + + + + Zero Size Canvas Test + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html new file mode 100644 index 000000000..37e3f04aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html @@ -0,0 +1,96 @@ + + + + + + +WebGL Canvas Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html new file mode 100644 index 000000000..1cc1914f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html @@ -0,0 +1,99 @@ + + + + + + +WebGL Canvas Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html new file mode 100644 index 000000000..ea566c5e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html @@ -0,0 +1,225 @@ + + + + + + +WebGL DrawingBuffer dimensions on HD-DPI machines test + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html new file mode 100644 index 000000000..cf906b83a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html @@ -0,0 +1,137 @@ + + + + + + +WebGL Canvas Conformance Tests + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html new file mode 100644 index 000000000..2594d65f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html @@ -0,0 +1,138 @@ + + + + + + +WebGL Canvas.drawingBufferWidth,drawingBufferHeight Conformance Tests + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html new file mode 100644 index 000000000..78ff900f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html @@ -0,0 +1,95 @@ + + + + + + +Verifies than GL framebuffer bindings do not change by toDataURL() + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html new file mode 100644 index 000000000..fa281ba75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html @@ -0,0 +1,106 @@ + + + + + + +Verifies that GL framebuffer bindings do not change when canvas is resized + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html new file mode 100644 index 000000000..b18e5fcc4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html @@ -0,0 +1,190 @@ + + + + + + +WebGL Rapid Resizing Test + + + + + +
+ + +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html new file mode 100644 index 000000000..898195ccd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html new file mode 100644 index 000000000..9fbbebf09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html @@ -0,0 +1,129 @@ + + + + + +WebGL toDataURL test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html new file mode 100644 index 000000000..cfc4cb016 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt new file mode 100644 index 000000000..078cbe8f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt @@ -0,0 +1,19 @@ +--max-version 1.9.9 constants-and-properties.html +--min-version 1.0.2 context-attribute-preserve-drawing-buffer.html +context-attributes-alpha-depth-stencil-antialias.html +--min-version 1.0.4 context-size-change.html +--min-version 1.0.4 context-no-alpha-fbo-with-alpha.html +--min-version 1.0.2 --slow context-creation-and-destruction.html +--min-version 1.0.3 --slow context-creation.html +--min-version 1.0.3 --slow context-eviction-with-garbage-collection.html +--min-version 1.0.3 context-hidden-alpha.html +--min-version 1.0.2 context-release-upon-reload.html +--min-version 1.0.2 context-release-with-workers.html +context-lost-restored.html +context-lost.html +--max-version 1.9.9 context-type-test.html +incorrect-context-object-behaviour.html +--max-version 1.9.9 methods.html +premultiplyalpha-test.html +resource-sharing-test.html +--min-version 1.0.4 user-defined-properties-on-context.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html new file mode 100644 index 000000000..7f3b5d4c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html @@ -0,0 +1,566 @@ + + + + + +WebGL Constants and Properties Test + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html new file mode 100644 index 000000000..cd443164a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html @@ -0,0 +1,129 @@ + + + + + + + + + + + + + +
+ + + +
+should look like +
+
+
+
+
+
+
+ + + +
+should look like +
+
+
+
+
+
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html new file mode 100644 index 000000000..6e69349a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html new file mode 100644 index 000000000..801bd11e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html @@ -0,0 +1,56 @@ + + + + + + +Test that contexts are freed and garbage collected reasonably + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html new file mode 100644 index 000000000..1fafb7e3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html @@ -0,0 +1,56 @@ + + + + + + +Test that you can create large numbers of WebGL contexts. + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html new file mode 100644 index 000000000..9c91d7d23 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html @@ -0,0 +1,78 @@ + + + + + + +Test that context eviction and garbage collection do not interfere with each other + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html new file mode 100644 index 000000000..431b30393 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + +
+
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html new file mode 100644 index 000000000..e0816a942 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html @@ -0,0 +1,306 @@ + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html new file mode 100644 index 000000000..d50725acb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html @@ -0,0 +1,374 @@ + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html new file mode 100644 index 000000000..1979bed38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html @@ -0,0 +1,98 @@ + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html new file mode 100644 index 000000000..d988131ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html @@ -0,0 +1,93 @@ + + + + + + +WebGL Context Release Test + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html new file mode 100644 index 000000000..0a7597c55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html @@ -0,0 +1,93 @@ + + + + + + +WebGL Context Release Test + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html new file mode 100644 index 000000000..60af6a827 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html @@ -0,0 +1,113 @@ + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html new file mode 100644 index 000000000..088ef42b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html @@ -0,0 +1,74 @@ + + + + + + +WebGL Canvas Conformance Tests + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html new file mode 100644 index 000000000..ec4fc9961 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html @@ -0,0 +1,88 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html new file mode 100644 index 000000000..a086a1677 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html @@ -0,0 +1,239 @@ + + + + + +WebGL Methods Test + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html new file mode 100644 index 000000000..a29154e00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html @@ -0,0 +1,266 @@ + + + + + + +Test the WebGL premultipliedAlpha context creation flag. + + + + + +
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/resource-sharing-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/resource-sharing-test.html new file mode 100644 index 000000000..2281683d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/resource-sharing-test.html @@ -0,0 +1,64 @@ + + + + + + +WebGL Resource Sharing. + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html new file mode 100644 index 000000000..31cba6acd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html @@ -0,0 +1,76 @@ + + + + + + +Simple WebGL context with Worker + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html new file mode 100644 index 000000000..87058e9fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html @@ -0,0 +1,75 @@ + + + + + + +Simple WebGL context + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js new file mode 100644 index 000000000..3680117c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js @@ -0,0 +1,4 @@ +// Simple worker used to provoke WebGL context release bugs on Chrome + +postMessage("Hello World"); +close(); \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html new file mode 100644 index 000000000..0afcc7c64 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html @@ -0,0 +1,70 @@ + + + + + +WebGL User-Defined Properties Test + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt new file mode 100644 index 000000000..8613963d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt @@ -0,0 +1,39 @@ +--min-version 1.0.3 --max-version 1.9.9 angle-instanced-arrays.html +--min-version 1.0.3 --max-version 1.9.9 angle-instanced-arrays-out-of-bounds.html +--min-version 1.0.3 --max-version 1.9.9 ext-blend-minmax.html +--min-version 1.0.4 ext-disjoint-timer-query.html +--min-version 1.0.3 --max-version 1.9.9 ext-frag-depth.html +--min-version 1.0.3 --max-version 1.9.9 ext-shader-texture-lod.html +--min-version 1.0.3 --max-version 1.9.9 ext-sRGB.html +--min-version 1.0.2 ext-texture-filter-anisotropic.html +--min-version 1.0.2 get-extension.html +--max-version 1.9.9 oes-standard-derivatives.html +--max-version 1.9.9 oes-texture-float-with-canvas.html +--max-version 1.9.9 oes-texture-float-with-image-data.html +--max-version 1.9.9 oes-texture-float-with-image.html +--max-version 1.9.9 oes-texture-float-with-video.html +--max-version 1.9.9 oes-texture-float.html +--max-version 1.9.9 oes-vertex-array-object.html +--min-version 1.0.3 --max-version 1.9.9 oes-vertex-array-object-bufferData.html +--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float.html +--min-version 1.0.3 oes-texture-float-linear.html +--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-linear.html +--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-canvas.html +--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-image-data.html +--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-image.html +--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-video.html +--min-version 1.0.2 --max-version 1.9.9 oes-element-index-uint.html +webgl-debug-renderer-info.html +webgl-debug-shaders.html +--min-version 1.0.3 webgl-compressed-texture-atc.html +--min-version 1.0.4 webgl-compressed-texture-etc.html +--min-version 1.0.3 webgl-compressed-texture-pvrtc.html +--min-version 1.0.2 webgl-compressed-texture-s3tc.html +--min-version 1.0.4 webgl-compressed-texture-s3tc-srgb.html +--min-version 1.0.3 webgl-compressed-texture-size-limit.html +--min-version 1.0.2 --max-version 1.9.9 webgl-depth-texture.html +--min-version 1.0.3 --max-version 1.9.9 webgl-draw-buffers.html +--min-version 1.0.4 --max-version 1.9.9 webgl-draw-buffers-framebuffer-unsupported.html +--min-version 1.0.4 --max-version 1.9.9 webgl-draw-buffers-max-draw-buffers.html +--min-version 1.0.3 webgl-shared-resources.html + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html new file mode 100644 index 000000000..d632c9d37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html new file mode 100644 index 000000000..791326425 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html @@ -0,0 +1,652 @@ + + + + + + +WebGL ANGLE_instanced_arrays Conformance Tests + + + + + + +
+ +
+ + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html new file mode 100644 index 000000000..315dbd742 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html @@ -0,0 +1,246 @@ + + + + + + +WebGL EXT_blend_minmax Conformance Tests + + + + + +
+ +
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html new file mode 100644 index 000000000..bb349c4b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html @@ -0,0 +1,326 @@ + + + + + + +WebGL EXT_disjoint_timer_query Conformance Tests + + + + + +
+ +
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html new file mode 100644 index 000000000..6c71d42e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html @@ -0,0 +1,310 @@ + + + + + + +WebGL EXT_frag_depth Conformance Tests + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html new file mode 100644 index 000000000..ebb53b841 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html @@ -0,0 +1,430 @@ + + + + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html new file mode 100644 index 000000000..04c30064c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html @@ -0,0 +1,362 @@ + + + + + +WebGL EXT_shader_texture_lod Conformance Tests + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html new file mode 100644 index 000000000..e802bf0b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html @@ -0,0 +1,190 @@ + + + + + + +WebGL EXT_texture_filter_anisotropic Conformance Tests + + + + + +
+ +
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html new file mode 100644 index 000000000..89e73ee03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html @@ -0,0 +1,120 @@ + + + + + + +WebGL Extension Conformance Tests + + + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html new file mode 100644 index 000000000..9ee46555d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html @@ -0,0 +1,447 @@ + + + + + + +WebGL OES_element_index_uint Conformance Tests + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html new file mode 100644 index 000000000..6636b3766 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html @@ -0,0 +1,421 @@ + + + + + + +WebGL OES_standard_derivatives Conformance Tests + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html new file mode 100644 index 000000000..fdb35d536 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + + +
+ +
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html new file mode 100644 index 000000000..36584616a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html new file mode 100644 index 000000000..8ab3300a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html new file mode 100644 index 000000000..ac0293a3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html new file mode 100644 index 000000000..03b2d00f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html new file mode 100644 index 000000000..4df5e008b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html @@ -0,0 +1,291 @@ + + + + + + +WebGL OES_texture_float Conformance Tests + + + + + +
+ +
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html new file mode 100644 index 000000000..b9d18f785 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + +
+ +
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html new file mode 100644 index 000000000..4fac6b877 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html new file mode 100644 index 000000000..1fca1daaa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html new file mode 100644 index 000000000..075130f38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html new file mode 100644 index 000000000..ceaca294f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html new file mode 100644 index 000000000..a676c8ab3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html @@ -0,0 +1,496 @@ + + + + + + +WebGL OES_texture_half_float Conformance Tests + + + + + +
+ + +
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html new file mode 100644 index 000000000..d9262967a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html @@ -0,0 +1,215 @@ + + + + + + +WebGL OES_vertex_array_object_bufferData Conformance Tests + + + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html new file mode 100644 index 000000000..4bd2a4fd8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html @@ -0,0 +1,738 @@ + + + + + + +WebGL OES_vertex_array_object Conformance Tests + + + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-atc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-atc.html new file mode 100644 index 000000000..7bc4a7463 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-atc.html @@ -0,0 +1,431 @@ + + + + + + + + + +WebGL WEBGL_compressed_texture_atc Conformance Tests + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html new file mode 100644 index 000000000..56f5552d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html @@ -0,0 +1,154 @@ + + + + + + +WebGL WEBGL_compressed_texture_etc Conformance Tests + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html new file mode 100644 index 000000000..8c05b1f5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html @@ -0,0 +1,392 @@ + + + + + + + + + +WebGL WEBGL_compressed_texture_pvrtc Conformance Tests + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html new file mode 100644 index 000000000..4d71440b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html @@ -0,0 +1,711 @@ + + + + + + + + + +WebGL WEBGL_compressed_texture_s3tc_srgb Conformance Tests + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc.html new file mode 100644 index 000000000..2f57e0a24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc.html @@ -0,0 +1,736 @@ + + + + + + + + + +WebGL WEBGL_compressed_texture_s3tc Conformance Tests + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html new file mode 100644 index 000000000..47574aae4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html @@ -0,0 +1,246 @@ + + + + + + +WebGL compressed texture size limit conformance test + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html new file mode 100644 index 000000000..5470d8d08 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html @@ -0,0 +1,125 @@ + + + + + + +WebGL WebGL_debug_renderer_info Conformance Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html new file mode 100644 index 000000000..e54b4e634 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html @@ -0,0 +1,165 @@ + + + + + + +WebGL WebGL_debug_shaders Conformance Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html new file mode 100644 index 000000000..256ff6fd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html @@ -0,0 +1,352 @@ + + + + + + + + +WebGL WEBGL_depth_texture Conformance Tests + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html new file mode 100644 index 000000000..3f5c3a089 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html @@ -0,0 +1,147 @@ + + + + + + +WebGL WEBGL_draw_buffers FRAMEBUFFER_UNSUPPORTED Test + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html new file mode 100644 index 000000000..6c2c5471b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html @@ -0,0 +1,139 @@ + + + + + + +WebGL WEBGL_draw_buffers gl_FragData[gl_MaxDrawBuffers] Conformance Test + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html new file mode 100644 index 000000000..d6f678d4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html @@ -0,0 +1,844 @@ + + + + + + +WebGL WEBGL_draw_buffers Conformance Tests + + + + + +
+ +
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-shared-resources.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-shared-resources.html new file mode 100644 index 000000000..92bd09198 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-shared-resources.html @@ -0,0 +1,861 @@ + + + + + + +WebGL WEBGL_Shared_Resources Conformance Test + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt new file mode 100644 index 000000000..a2ee6edb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt @@ -0,0 +1,11 @@ +bugs/00_test_list.txt +--min-version 1.0.3 constructors/00_test_list.txt +functions/00_test_list.txt +implicit/00_test_list.txt +--min-version 1.0.2 literals/00_test_list.txt +--min-version 1.0.2 matrices/00_test_list.txt +misc/00_test_list.txt +reserved/00_test_list.txt +--min-version 1.0.2 samplers/00_test_list.txt +variables/00_test_list.txt + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt new file mode 100644 index 000000000..26f268448 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt @@ -0,0 +1,39 @@ +--min-version 1.0.4 angle-ambiguous-function-call.html +--min-version 1.0.4 angle-constructor-invalid-parameters.html +--min-version 1.0.3 angle-d3d11-compiler-error.html +--min-version 1.0.3 angle-dx-variable-bug.html +--min-version 1.0.3 array-of-struct-with-int-first-position.html +--min-version 1.0.4 bool-type-cast-bug-int-float.html +--min-version 1.0.3 compare-loop-index-to-uniform.html +--min-version 1.0.3 complex-glsl-does-not-crash.html +--min-version 1.0.4 compound-assignment-type-combination.html +--min-version 1.0.3 conditional-discard-in-loop.html +--min-version 1.0.3 conditional-discard-optimization.html +--min-version 1.0.3 constant-precision-qualifier.html +--min-version 1.0.3 --max-version 1.99 essl3-shaders-with-webgl1.html +--min-version 1.0.4 floor-div-cos-should-not-truncate.html +--min-version 1.0.3 floored-division-accuracy.html +--min-version 1.0.3 fragcoord-linking-bug.html +--min-version 1.0.4 gl-fragcoord-multisampling-bug.html +--min-version 1.0.4 global-invariant-does-not-leak-across-shaders.html +--min-version 1.0.4 invariant-does-not-leak-across-shaders.html +--min-version 1.0.4 logic-inside-block-without-braces.html +--min-version 1.0.3 long-expressions-should-not-crash.html +--min-version 1.0.4 loop-if-loop-gradient.html +--min-version 1.0.3 modulo-arithmetic-accuracy.html +--min-version 1.0.3 multiplication-assignment.html +--min-version 1.0.3 nested-functions-should-not-crash.html +--min-version 1.0.4 nested-loops-with-break-and-continue.html +--min-version 1.0.4 nested-sequence-operator.html +--min-version 1.0.4 pow-of-small-constant-in-user-defined-function.html +--min-version 1.0.4 pow-with-constant-exponent-should-not-crash.html +--min-version 1.0.4 qualcomm-crash.html +--min-version 1.0.4 qualcomm-loop-with-continue-crash.html +--min-version 1.0.3 sampler-array-using-loop-index.html +--min-version 1.0.4 sampler-struct-function-arg.html +--min-version 1.0.4 sequence-operator-evaluation-order.html +--min-version 1.0.4 sketchfab-lighting-shader-crash.html +--min-version 1.0.4 struct-constructor-highp-bug.html +--min-version 1.0.3 temp-expressions-should-not-crash.html +--min-version 1.0.4 undefined-index-should-not-crash.html +--min-version 1.0.3 uniforms-should-not-lose-values.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md new file mode 100644 index 000000000..d917f6d74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md @@ -0,0 +1,18 @@ +BUGS +==== + +This folder is for GLSL tests that test driver specific bugs. + +Most tests in other folders are fairly generic. While they might +only fail on specific drivers the tests themselves are designed +to test something in a generic way. + +Tests in this folder on the otherhand are very targeted. They may +have very specific shaders that only fail under specific circumstances +on specific drivers. + +An example might be if there was a driver that failed only when +and identifier was named "ABC". It makes no sense to have a generic +test that says "must allow ABC". A generic test would test some +subset of all possible identifiers not just one. + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html new file mode 100644 index 000000000..f4c3f9d0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html @@ -0,0 +1,70 @@ + + + + + + +ANGLE ambiguous function call test + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html new file mode 100644 index 000000000..6e154ac14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html @@ -0,0 +1,77 @@ + + + + + + +ANGLE constructor bugs test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html new file mode 100644 index 000000000..cdccb2fcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html @@ -0,0 +1,117 @@ + + + + + + +ANGLE D3D11 Bug - Shader compilation error + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html new file mode 100644 index 000000000..2e637f4ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html @@ -0,0 +1,117 @@ + + + + + + +ANGLE D3D11 Bug - Variables beginning with "dx_" + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html new file mode 100644 index 000000000..b02dfe610 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html @@ -0,0 +1,162 @@ + + + + + + +Driver Bug - Array of structs with int or bool in first position + + + + + + + +
+
+ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html new file mode 100644 index 000000000..680529554 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html @@ -0,0 +1,333 @@ + + + + + + +Verify int(bool) and float(bool) work correctly (Mac AMD driver bug) + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html new file mode 100644 index 000000000..580b2f770 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html @@ -0,0 +1,87 @@ + + + + + + +Driver bug - Comparing loop index against uniform in a fragment shader should work + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html new file mode 100644 index 000000000..246e875c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html @@ -0,0 +1,212 @@ + + + + + + +Driver Bug - complex glsl should not crash + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html new file mode 100644 index 000000000..1cf01e580 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html @@ -0,0 +1,47 @@ + + + + + + +Result type should match the l-value type in compound assignment + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html new file mode 100644 index 000000000..73cdf651c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html @@ -0,0 +1,161 @@ + + + + + + + +Conditional discard in loop issue + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html new file mode 100644 index 000000000..81d67372f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html @@ -0,0 +1,138 @@ + + + + + + + + +ANGLE WebGL Shader Conditionals Repro + + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html new file mode 100644 index 000000000..687de76f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html @@ -0,0 +1,144 @@ + + + + + + +Bug - the precision qualifier of a constant variable should affect the precision of a consuming operation + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html new file mode 100644 index 000000000..d09e59b4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html @@ -0,0 +1,159 @@ + + + + + + +Browser bug - WebGL 1 context should not accept OpenGL ES 3 shading language shaders + + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html new file mode 100644 index 000000000..69a019aa1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html @@ -0,0 +1,80 @@ + + + + +Floor + divide + cosine should not truncate intermediate results. + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html new file mode 100644 index 000000000..7698d7822 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html @@ -0,0 +1,95 @@ + + + + + + + + +Floored Division Accuracy Bug + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html new file mode 100644 index 000000000..48085e0d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html @@ -0,0 +1,114 @@ + + + + + + +GLSL compiler bug referencing gl_FragCoord + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html new file mode 100644 index 000000000..ef1184d49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html @@ -0,0 +1,66 @@ + + + + +gl_FragCoord multisampling bug + + + + + +
+
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html new file mode 100644 index 000000000..ab5940415 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html @@ -0,0 +1,98 @@ + + + + + + +Global invariant does not leak across shaders + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html new file mode 100644 index 000000000..eac956e77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html @@ -0,0 +1,95 @@ + + + + + + +Invariant does not leak across shaders + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html new file mode 100644 index 000000000..99d611b05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html @@ -0,0 +1,125 @@ + + + + + + +Short-circuiting logic operator with side effects inside if statement without braces should work + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html new file mode 100644 index 000000000..2fbe67f28 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html @@ -0,0 +1,157 @@ + + + + + + +Driver Bug - long experssions should not crash + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html new file mode 100644 index 000000000..187a36acf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html @@ -0,0 +1,96 @@ + + + + + + +Gradient loop in if in loop crash + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html new file mode 100644 index 000000000..e54103c01 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html @@ -0,0 +1,95 @@ + + + + + + + + +Modulo Arithmetic Accuracy Bug + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html new file mode 100644 index 000000000..acc7e37ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html @@ -0,0 +1,80 @@ + + + + + + +Multiplication assignment operator compilation bug + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html new file mode 100644 index 000000000..5408ff5b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html @@ -0,0 +1,110 @@ + + + + + + +Driver Bug - nested functions should not crash + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html new file mode 100644 index 000000000..3438a17c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html @@ -0,0 +1,104 @@ + + + + + + +Using nested loops with break and/or continue statements in a fragment shader should work + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html new file mode 100644 index 000000000..9fab28e57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html @@ -0,0 +1,68 @@ + + + + + + +Nested sequence operator + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html new file mode 100644 index 000000000..ebc4819d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html @@ -0,0 +1,95 @@ + + + + + + +Bug - calculating powers of constants smaller than 1.0e-5 in user-defined functions should work + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html new file mode 100644 index 000000000..dedf3de17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html @@ -0,0 +1,86 @@ + + + + + + +Bug - pow() with constant vector exponent should not crash + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html new file mode 100644 index 000000000..89e50a841 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html @@ -0,0 +1,157 @@ + + + + + + +Qualcomm program link crash Tests + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html new file mode 100644 index 000000000..93cab6edc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html @@ -0,0 +1,92 @@ + + + + + + +Qualcomm loop with continue crash test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html new file mode 100644 index 000000000..d9cb50302 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html @@ -0,0 +1,102 @@ + + + + + + +Sampler arrays using loop index should compile fine. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html new file mode 100644 index 000000000..7391d409e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html @@ -0,0 +1,116 @@ + + + + + + + +Passing a struct containing a sampler to a function. + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html new file mode 100644 index 000000000..a2362923b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html @@ -0,0 +1,137 @@ + + + + + + +GLSL short-circuiting operators should be evaluated after previous operands in a sequence + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html new file mode 100644 index 000000000..daf53ecc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html @@ -0,0 +1,105 @@ + + + + + + +Sketchfab Lighting Shader Crash + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html new file mode 100644 index 000000000..bf35e13bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html @@ -0,0 +1,63 @@ + + + + +Struct constructor highp bug. + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html new file mode 100644 index 000000000..cddd35aad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html @@ -0,0 +1,121 @@ + + + + + + +Driver Bug - temp experssions should not crash + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html new file mode 100644 index 000000000..12aea32c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html @@ -0,0 +1,85 @@ + + + + + + +Bug - indexing with 'int()' should not crash + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html new file mode 100644 index 000000000..0231fc796 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html @@ -0,0 +1,102 @@ + + + + + + +Driver Bug - Uniforms should no lose values + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt new file mode 100644 index 000000000..6758bea8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt @@ -0,0 +1,14 @@ +glsl-construct-vec2.html +glsl-construct-vec3.html +glsl-construct-vec4.html +glsl-construct-ivec2.html +glsl-construct-ivec3.html +glsl-construct-ivec4.html +glsl-construct-bvec2.html +glsl-construct-bvec3.html +glsl-construct-bvec4.html +glsl-construct-mat2.html +glsl-construct-mat3.html +glsl-construct-mat4.html +--min-version 1.0.3 glsl-construct-vec-mat-corner-cases.html +--min-version 1.0.3 glsl-construct-vec-mat-index.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html new file mode 100644 index 000000000..2883e97b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html new file mode 100644 index 000000000..e75468e92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html new file mode 100644 index 000000000..6fd71fb35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html new file mode 100644 index 000000000..015582db1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html new file mode 100644 index 000000000..1f3a05991 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html new file mode 100644 index 000000000..1326db7d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html new file mode 100644 index 000000000..b2ffc72a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html new file mode 100644 index 000000000..6870d063c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html new file mode 100644 index 000000000..fdfcad06b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html new file mode 100644 index 000000000..0214832f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html @@ -0,0 +1,216 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html new file mode 100644 index 000000000..6aa826d58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html @@ -0,0 +1,75 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html new file mode 100644 index 000000000..92429e7a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html new file mode 100644 index 000000000..7dc9d431a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html new file mode 100644 index 000000000..c0218b510 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt new file mode 100644 index 000000000..dd06ea052 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt @@ -0,0 +1,36 @@ +glsl-function.html +glsl-function-abs.html +glsl-function-acos.html +glsl-function-asin.html +glsl-function-atan.html +glsl-function-atan-xy.html +glsl-function-ceil.html +glsl-function-clamp-float.html +glsl-function-clamp-gentype.html +glsl-function-cos.html +glsl-function-cross.html +glsl-function-distance.html +glsl-function-dot.html +glsl-function-faceforward.html +glsl-function-floor.html +glsl-function-fract.html +glsl-function-length.html +#glsl-function-lessThan.html +glsl-function-max-float.html +glsl-function-max-gentype.html +glsl-function-min-float.html +glsl-function-min-gentype.html +glsl-function-mix-float.html +glsl-function-mix-gentype.html +glsl-function-mod-float.html +glsl-function-mod-gentype.html +glsl-function-normalize.html +glsl-function-reflect.html +#glsl-function-refract.html +glsl-function-sign.html +glsl-function-sin.html +glsl-function-step-float.html +glsl-function-step-gentype.html +glsl-function-smoothstep-float.html +glsl-function-smoothstep-gentype.html + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html new file mode 100644 index 000000000..330a5e258 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html @@ -0,0 +1,66 @@ + + + + + + +GLSL abs function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html new file mode 100644 index 000000000..53f018180 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html @@ -0,0 +1,116 @@ + + + + + + +GLSL acos function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html new file mode 100644 index 000000000..832fb4725 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html @@ -0,0 +1,116 @@ + + + + + + +GLSL asin function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html new file mode 100644 index 000000000..a9c792356 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html @@ -0,0 +1,119 @@ + + + + + + +GLSL atan-xy function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html new file mode 100644 index 000000000..39cc4bab2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html @@ -0,0 +1,116 @@ + + + + + + +GLSL atan function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html new file mode 100644 index 000000000..203bb3ff9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html @@ -0,0 +1,74 @@ + + + + + + +GLSL ceil function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html new file mode 100644 index 000000000..aa38bc337 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html @@ -0,0 +1,77 @@ + + + + + + +GLSL clamp-gentype function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html new file mode 100644 index 000000000..9992bd63b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html @@ -0,0 +1,80 @@ + + + + + + +GLSL clamp-gentype function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html new file mode 100644 index 000000000..38077b9f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html @@ -0,0 +1,120 @@ + + + + + + +GLSL cos function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html new file mode 100644 index 000000000..492b15785 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html @@ -0,0 +1,74 @@ + + + + + + +GLSL cross function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html new file mode 100644 index 000000000..76f8dd299 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html @@ -0,0 +1,109 @@ + + + + + + +GLSL distance function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html new file mode 100644 index 000000000..993a0339b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html @@ -0,0 +1,111 @@ + + + + + + +GLSL dot function test + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html new file mode 100644 index 000000000..d91f52540 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html @@ -0,0 +1,87 @@ + + + + + + +GLSL faceforward function test + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html new file mode 100644 index 000000000..bb470ec86 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html @@ -0,0 +1,73 @@ + + + + + + +GLSL floor function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html new file mode 100644 index 000000000..5f8960999 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html @@ -0,0 +1,71 @@ + + + + + + +GLSL fract function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html new file mode 100644 index 000000000..d2e7e9108 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html @@ -0,0 +1,108 @@ + + + + + + +GLSL length function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html new file mode 100644 index 000000000..647fce0b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html @@ -0,0 +1,73 @@ + + + + + + +GLSL lessThan function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html new file mode 100644 index 000000000..2c99677a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html @@ -0,0 +1,73 @@ + + + + + + +GLSL max-float function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html new file mode 100644 index 000000000..5fcb9b7c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html @@ -0,0 +1,73 @@ + + + + + + +GLSL max-gentype function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html new file mode 100644 index 000000000..1fac0d758 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html @@ -0,0 +1,73 @@ + + + + + + +GLSL min-float function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html new file mode 100644 index 000000000..2f2b65382 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html @@ -0,0 +1,73 @@ + + + + + + +GLSL min-gentype function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html new file mode 100644 index 000000000..d514b8a1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html @@ -0,0 +1,75 @@ + + + + + + +GLSL mix-float function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html new file mode 100644 index 000000000..18b1ef925 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html @@ -0,0 +1,75 @@ + + + + + + +GLSL mix-gentype function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html new file mode 100644 index 000000000..fb822c315 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html @@ -0,0 +1,74 @@ + + + + + + +GLSL mod-float function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html new file mode 100644 index 000000000..587264013 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html @@ -0,0 +1,77 @@ + + + + + + +GLSL mod-gentype function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html new file mode 100644 index 000000000..c4bcdbb16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html @@ -0,0 +1,80 @@ + + + + + + +GLSL normalize function test + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html new file mode 100644 index 000000000..a4d6753e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html @@ -0,0 +1,82 @@ + + + + + + +GLSL reflect function test + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html new file mode 100644 index 000000000..590695957 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html @@ -0,0 +1,91 @@ + + + + + + +GLSL refract function test + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html new file mode 100644 index 000000000..5f6882b50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html @@ -0,0 +1,73 @@ + + + + + + +GLSL sign function test + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html new file mode 100644 index 000000000..edf1d8709 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html @@ -0,0 +1,117 @@ + + + + + + +GLSL sin function test + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html new file mode 100644 index 000000000..c74371ebd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html @@ -0,0 +1,118 @@ + + + + + + +GLSL smoothstep-float function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html new file mode 100644 index 000000000..6c31eff3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html @@ -0,0 +1,77 @@ + + + + + + +GLSL smoothstep-gentype function test + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html new file mode 100644 index 000000000..2df9d9785 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html @@ -0,0 +1,73 @@ + + + + + + +GLSL step-float function test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html new file mode 100644 index 000000000..1426a4a1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html @@ -0,0 +1,72 @@ + + + + + + +GLSL step-gentype function test + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html new file mode 100644 index 000000000..489c64604 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html @@ -0,0 +1,60 @@ + + + + + + +GLSL function test test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt new file mode 100644 index 000000000..d700b29a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt @@ -0,0 +1,65 @@ +add_int_float.vert.html +add_int_mat2.vert.html +add_int_mat3.vert.html +add_int_mat4.vert.html +add_int_vec2.vert.html +add_int_vec3.vert.html +add_int_vec4.vert.html +add_ivec2_vec2.vert.html +add_ivec3_vec3.vert.html +add_ivec4_vec4.vert.html +assign_int_to_float.vert.html +assign_ivec2_to_vec2.vert.html +assign_ivec3_to_vec3.vert.html +assign_ivec4_to_vec4.vert.html +construct_struct.vert.html +divide_int_float.vert.html +divide_int_mat2.vert.html +divide_int_mat3.vert.html +divide_int_mat4.vert.html +divide_int_vec2.vert.html +divide_int_vec3.vert.html +divide_int_vec4.vert.html +divide_ivec2_vec2.vert.html +divide_ivec3_vec3.vert.html +divide_ivec4_vec4.vert.html +equal_int_float.vert.html +equal_ivec2_vec2.vert.html +equal_ivec3_vec3.vert.html +equal_ivec4_vec4.vert.html +function_int_float.vert.html +function_ivec2_vec2.vert.html +function_ivec3_vec3.vert.html +function_ivec4_vec4.vert.html +greater_than.vert.html +greater_than_equal.vert.html +less_than.vert.html +less_than_equal.vert.html +multiply_int_float.vert.html +multiply_int_mat2.vert.html +multiply_int_mat3.vert.html +multiply_int_mat4.vert.html +multiply_int_vec2.vert.html +multiply_int_vec3.vert.html +multiply_int_vec4.vert.html +multiply_ivec2_vec2.vert.html +multiply_ivec3_vec3.vert.html +multiply_ivec4_vec4.vert.html +not_equal_int_float.vert.html +not_equal_ivec2_vec2.vert.html +not_equal_ivec3_vec3.vert.html +not_equal_ivec4_vec4.vert.html +subtract_int_float.vert.html +subtract_int_mat2.vert.html +subtract_int_mat3.vert.html +subtract_int_mat4.vert.html +subtract_int_vec2.vert.html +subtract_int_vec3.vert.html +subtract_int_vec4.vert.html +subtract_ivec2_vec2.vert.html +subtract_ivec3_vec3.vert.html +subtract_ivec4_vec4.vert.html +ternary_int_float.vert.html +ternary_ivec2_vec2.vert.html +ternary_ivec3_vec3.vert.html +ternary_ivec4_vec4.vert.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html new file mode 100644 index 000000000..7b9beffd8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html new file mode 100644 index 000000000..3c4df411f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html new file mode 100644 index 000000000..080bd1d26 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html new file mode 100644 index 000000000..04f97cd72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html new file mode 100644 index 000000000..f7d45342f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html new file mode 100644 index 000000000..c160126b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html new file mode 100644 index 000000000..cf42cdef1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html new file mode 100644 index 000000000..e656a2a1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html new file mode 100644 index 000000000..c5f3206d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html new file mode 100644 index 000000000..00edf8955 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html new file mode 100644 index 000000000..92bd2113f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html new file mode 100644 index 000000000..7458e2980 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html new file mode 100644 index 000000000..b2ba393ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html new file mode 100644 index 000000000..8e972d4ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html new file mode 100644 index 000000000..342692241 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html new file mode 100644 index 000000000..76db5eef7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html new file mode 100644 index 000000000..a58c1959a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html new file mode 100644 index 000000000..8f159b97a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html new file mode 100644 index 000000000..f80f18feb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html new file mode 100644 index 000000000..f1c355424 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html new file mode 100644 index 000000000..9039b0804 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html new file mode 100644 index 000000000..fc507e81e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html new file mode 100644 index 000000000..6a869e332 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html new file mode 100644 index 000000000..e1a8a1437 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html new file mode 100644 index 000000000..cb6468dde --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html new file mode 100644 index 000000000..89d234ab3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html new file mode 100644 index 000000000..e85bdea02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html new file mode 100644 index 000000000..f906a1b2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html new file mode 100644 index 000000000..97587a839 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html new file mode 100644 index 000000000..88ea4adff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html new file mode 100644 index 000000000..014c0ddc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html new file mode 100644 index 000000000..3e8ff779c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html new file mode 100644 index 000000000..53892ccf7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html new file mode 100644 index 000000000..0d74749a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html new file mode 100644 index 000000000..c468be837 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html new file mode 100644 index 000000000..aff3d0d4e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html new file mode 100644 index 000000000..373a59df4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html new file mode 100644 index 000000000..691e20cd9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html new file mode 100644 index 000000000..143963fcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html new file mode 100644 index 000000000..ed0ee541d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html new file mode 100644 index 000000000..df9eeb0a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html new file mode 100644 index 000000000..6fc2c6ba1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html new file mode 100644 index 000000000..a1ec600b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html new file mode 100644 index 000000000..3198d3219 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html new file mode 100644 index 000000000..4c93ef297 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html new file mode 100644 index 000000000..6ff18d568 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html new file mode 100644 index 000000000..613eb041f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html new file mode 100644 index 000000000..be59c934e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html new file mode 100644 index 000000000..97f8ea780 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html new file mode 100644 index 000000000..d87b7f7d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html new file mode 100644 index 000000000..6c76a0a60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html new file mode 100644 index 000000000..fb5525c18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html new file mode 100644 index 000000000..8eeb768f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html new file mode 100644 index 000000000..2f323250d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html new file mode 100644 index 000000000..338632595 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html new file mode 100644 index 000000000..f2a5696b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html new file mode 100644 index 000000000..f76533215 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html new file mode 100644 index 000000000..8a28c628a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html new file mode 100644 index 000000000..97d057437 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html new file mode 100644 index 000000000..f653848d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html new file mode 100644 index 000000000..4e2ab8d06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html new file mode 100644 index 000000000..69cd11fa5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html new file mode 100644 index 000000000..ba95e284b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html new file mode 100644 index 000000000..62a12557f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html new file mode 100644 index 000000000..a4748b94c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt new file mode 100644 index 000000000..50802bf34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt @@ -0,0 +1,3 @@ +float_literal.vert.html +--min-version 1.0.3 literal_precision.html +overflow_leak.vert.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html new file mode 100644 index 000000000..951e47676 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html @@ -0,0 +1,72 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html new file mode 100644 index 000000000..536441ce1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html @@ -0,0 +1,56 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html new file mode 100644 index 000000000..1f3a582ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html @@ -0,0 +1,82 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt new file mode 100644 index 000000000..74693de0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt @@ -0,0 +1,3 @@ +glsl-mat4-to-mat3.html +--min-version 1.0.3 glsl-mat3-construction.html +--min-version 1.0.4 matrix-compound-multiply.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html new file mode 100644 index 000000000..85abb9420 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html @@ -0,0 +1,93 @@ + + + + + + +GLSL mat3 construction test + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html new file mode 100644 index 000000000..e7e420a2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html @@ -0,0 +1,91 @@ + + + + + + +GLSL mat4 to mat3 test + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html new file mode 100644 index 000000000..828a52ade --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html @@ -0,0 +1,92 @@ + + + + + + +Matrix compound multiplication test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt new file mode 100644 index 000000000..5b2a97a00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt @@ -0,0 +1,114 @@ +--max-version 1.9.9 attrib-location-length-limits.html +--min-version 1.0.3 boolean_precision.html +--min-version 1.0.4 const-variable-initialization.html +embedded-struct-definitions-forbidden.html +--min-version 1.0.4 empty-declaration.html +empty_main.vert.html +--min-version 1.0.3 expression-list-in-declarator-initializer.html +gl_position_unset.vert.html +--min-version 1.0.4 global-variable-init.html +# this test is intentionally disabled as it is too strict and to hard to simulate +# glsl-2types-of-textures-on-same-unit.html +glsl-function-nodes.html +--min-version 1.0.2 glsl-vertex-branch.html +glsl-long-variable-names.html +non-ascii-comments.vert.html +non-ascii.vert.html +--min-version 1.0.2 re-compile-re-link.html +--min-version 1.0.4 sequence-operator-returns-constant.html +--min-version 1.0.3 shader-precision-format-obeyed.html +--min-version 1.0.3 shader-struct-scope.html +--min-version 1.0.2 shader-uniform-packing-restrictions.html +--min-version 1.0.2 shader-varying-packing-restrictions.html +--min-version 1.0.2 shader-with-256-character-define.html +shader-with-256-character-identifier.frag.html +--min-version 1.0.2 --max-version 1.9.9 shader-with-257-character-define.html +--max-version 1.9.9 shader-with-257-character-identifier.frag.html +shader-with-_webgl-identifier.vert.html +shader-with-arbitrary-indexing.frag.html +shader-with-arbitrary-indexing.vert.html +--min-version 1.0.2 shader-with-array-of-structs-containing-arrays.html +--min-version 1.0.2 shader-with-array-of-structs-uniform.html +shader-with-attrib-array.vert.html +shader-with-attrib-struct.vert.html +shader-with-clipvertex.vert.html +--min-version 1.0.2 shader-with-conditional-scoping.html +--min-version 1.0.2 shader-with-conditional-scoping-negative.html +shader-with-default-precision.frag.html +shader-with-default-precision.vert.html +shader-with-define-line-continuation.frag.html +shader-with-dfdx-no-ext.frag.html +shader-with-dfdx.frag.html +--min-version 1.0.2 shader-with-do-loop.html +shader-with-error-directive.html +shader-with-explicit-int-cast.vert.html +shader-with-float-return-value.frag.html +--min-version 1.0.2 shader-with-for-scoping.html +--min-version 1.0.2 shader-with-for-loop.html +shader-with-frag-depth.frag.html +shader-with-function-recursion.frag.html +--min-version 1.0.2 shader-with-function-scoped-struct.html +--min-version 1.0.2 shader-with-functional-scoping.html +--min-version 1.0.2 shader-with-comma-assignment.html +--min-version 1.0.2 shader-with-comma-conditional-assignment.html +--min-version 1.0.4 shader-with-comma-separated-variable-declarations.html +shader-with-glcolor.vert.html +shader-with-gles-1.frag.html +shader-with-gles-symbol.frag.html +shader-with-glprojectionmatrix.vert.html +shader-with-implicit-vec3-to-vec4-cast.vert.html +shader-with-include.vert.html +shader-with-int-return-value.frag.html +shader-with-invalid-identifier.frag.html +shader-with-ivec2-return-value.frag.html +shader-with-ivec3-return-value.frag.html +shader-with-ivec4-return-value.frag.html +shader-with-limited-indexing.frag.html +--min-version 1.0.2 shader-with-hex-int-constant-macro.html +shader-with-long-line.html +shader-with-non-ascii-error.frag.html +--min-version 1.0.2 shader-with-non-reserved-words.html +shader-with-precision.frag.html +--min-version 1.0.3 shader-with-preprocessor-whitespace.html +shader-with-quoted-error.frag.html +--min-version 1.0.2 shader-with-reserved-words.html +--min-version 1.0.2 shader-with-similar-uniform-array-names.html +--min-version 1.0.2 shader-with-too-many-uniforms.html +--min-version 1.0.4 shader-with-two-initializer-types.html +shader-with-undefined-preprocessor-symbol.frag.html +shader-with-uniform-in-loop-condition.vert.html +shader-with-vec2-return-value.frag.html +shader-with-vec3-return-value.frag.html +shader-with-vec4-return-value.frag.html +--min-version 1.0.2 shader-with-vec4-vec3-vec4-conditional.html +shader-with-version-100.frag.html +shader-with-version-100.vert.html +shader-with-version-120.vert.html +shader-with-version-130.vert.html +shader-with-webgl-identifier.vert.html +--min-version 1.0.2 shader-with-while-loop.html +shader-without-precision.frag.html +--min-version 1.0.3 shaders-with-constant-expression-loop-conditions.html +--min-version 1.0.3 shaders-with-invariance.html +--min-version 1.0.3 shaders-with-name-conflicts.html +--min-version 1.0.2 shaders-with-mis-matching-uniforms.html +--min-version 1.0.2 shaders-with-mis-matching-varyings.html +--min-version 1.0.2 shaders-with-missing-varyings.html +--min-version 1.0.3 shaders-with-uniform-structs.html +--min-version 1.0.2 shaders-with-varyings.html +shared.html +struct-nesting-exceeds-maximum.html +struct-nesting-under-maximum.html +--max-version 1.9.9 uniform-location-length-limits.html +--min-version 1.0.2 shader-with-short-circuiting-operators.html +--min-version 1.0.2 shader-with-global-variable-precision-mismatch.html +--min-version 1.0.2 large-loop-compile.html +--min-version 1.0.3 struct-equals.html +--min-version 1.0.4 struct-assign.html +--min-version 1.0.3 struct-mixed-array-declarators.html +--min-version 1.0.3 struct-nesting-of-variable-names.html +--min-version 1.0.3 struct-specifiers-in-uniforms.html +--min-version 1.0.3 struct-unary-operators.html +--min-version 1.0.4 ternary-operator-on-arrays.html +--min-version 1.0.3 ternary-operators-in-global-initializers.html +--min-version 1.0.3 ternary-operators-in-initializers.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html new file mode 100644 index 000000000..f63844d42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html @@ -0,0 +1,110 @@ + + + + + +WebGL attrib location length tests + + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
Verify limits on the lengths of attribute locations per WebGL spec, "Maximum Uniform and Attribute Location Lengths".
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html new file mode 100644 index 000000000..121301054 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html @@ -0,0 +1,93 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html new file mode 100644 index 000000000..4f771779d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html @@ -0,0 +1,265 @@ + + + + + + +All valid constant expressions should be allowed in the initialization of const variables + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html new file mode 100644 index 000000000..449d306a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html @@ -0,0 +1,62 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html new file mode 100644 index 000000000..720f88816 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html @@ -0,0 +1,132 @@ + + + + + + +WebGL GLSL Conformance Tests - empty declarations + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html new file mode 100644 index 000000000..80d1a14ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html @@ -0,0 +1,54 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html new file mode 100644 index 000000000..4cea555a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html new file mode 100644 index 000000000..3ee953d40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html new file mode 100644 index 000000000..c102c3c3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html @@ -0,0 +1,314 @@ + + + + + + +Global variable initializer restrictions + + + + + + + +
+
+ + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html new file mode 100644 index 000000000..11573e9c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html @@ -0,0 +1,153 @@ + + + + + + + WebGL GLSL 2 types of textures on same unit conformance test. + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html new file mode 100644 index 000000000..fd1be0495 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html @@ -0,0 +1,155 @@ + + + + + + +GLSL function nodes Test + + + + + + + + + + + + + + +
This tests against a Mac driver bug related to function calls.
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html new file mode 100644 index 000000000..631e3182c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html @@ -0,0 +1,248 @@ + + + + + + +glsl long variable name mapping tests + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html new file mode 100644 index 000000000..b790a89b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html @@ -0,0 +1,149 @@ + + + + + + +GLSL function nodes Test + + + + + + + + + + + + + + +
This tests against a Mac driver bug related to branches + inside of Vertex Shaders.
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs new file mode 100644 index 000000000..50970e6cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs @@ -0,0 +1,4 @@ +// Do not delete! +// Needed to help glsl-conformance tests. + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html new file mode 100644 index 000000000..f264b08a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html @@ -0,0 +1,193 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html new file mode 100644 index 000000000..a817654f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html new file mode 100644 index 000000000..61428b0cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html new file mode 100644 index 000000000..aa131a671 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html @@ -0,0 +1,171 @@ + + + + + + +WebGL Re-Compile and Re-link Shader conformance test. + + + + + + +
+
+ + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html new file mode 100644 index 000000000..bd73f224a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html @@ -0,0 +1,81 @@ + + + + + + +Sequence operator returns constant test + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html new file mode 100644 index 000000000..dbfdd3c7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html @@ -0,0 +1,104 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html new file mode 100644 index 000000000..37340c5a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html @@ -0,0 +1,252 @@ + + + + + + + + +Struct Scope Test + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html new file mode 100644 index 000000000..87d44927f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html @@ -0,0 +1,272 @@ + + + + + + +WebGL uniform packing restrctions Conformance Test + + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html new file mode 100644 index 000000000..24cf0f0e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html @@ -0,0 +1,209 @@ + + + + + + +WebGL varying packing restrictions Conformance Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html new file mode 100644 index 000000000..9d8a4ff19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html new file mode 100644 index 000000000..9d3892f23 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html @@ -0,0 +1,126 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html new file mode 100644 index 000000000..203547e96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html new file mode 100644 index 000000000..a0ac931bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html new file mode 100644 index 000000000..2e1c468b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html new file mode 100644 index 000000000..f681fd668 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html @@ -0,0 +1,62 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html new file mode 100644 index 000000000..d604ded46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html new file mode 100644 index 000000000..a74da59e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html @@ -0,0 +1,154 @@ + + + + + + +GLSL Array of Structs Containing Arrays + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html new file mode 100644 index 000000000..026e8d586 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html @@ -0,0 +1,166 @@ + + + + + + + +GLSL Array of Structs Uniform + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html new file mode 100644 index 000000000..0d4f78726 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html new file mode 100644 index 000000000..80a1c609c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html new file mode 100644 index 000000000..5e5e8ba50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html new file mode 100644 index 000000000..9a49db126 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html @@ -0,0 +1,62 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html new file mode 100644 index 000000000..8606e0bb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html @@ -0,0 +1,213 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html new file mode 100644 index 000000000..ad9a76c2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html new file mode 100644 index 000000000..9b46e97fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html @@ -0,0 +1,63 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html new file mode 100644 index 000000000..17651c63e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html @@ -0,0 +1,66 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html new file mode 100644 index 000000000..ca8c10cb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html new file mode 100644 index 000000000..a0001ca6a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-define-line-continuation.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-define-line-continuation.frag.html new file mode 100644 index 000000000..73f6bb6d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-define-line-continuation.frag.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html new file mode 100644 index 000000000..2040d7565 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html new file mode 100644 index 000000000..7445f9569 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html new file mode 100644 index 000000000..c5e02d958 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html new file mode 100644 index 000000000..45c1818e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html @@ -0,0 +1,72 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html new file mode 100644 index 000000000..52d990cca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html new file mode 100644 index 000000000..cf4db0a0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html @@ -0,0 +1,67 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html new file mode 100644 index 000000000..79b134132 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html @@ -0,0 +1,104 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html new file mode 100644 index 000000000..127b62ac1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html new file mode 100644 index 000000000..85cb0872e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html new file mode 100644 index 000000000..0bb6ed79c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html @@ -0,0 +1,66 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html new file mode 100644 index 000000000..41c12acd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html @@ -0,0 +1,63 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html new file mode 100644 index 000000000..4221414b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html new file mode 100644 index 000000000..68fc74126 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html @@ -0,0 +1,56 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html new file mode 100644 index 000000000..3930dfcb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html new file mode 100644 index 000000000..d3a376107 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html new file mode 100644 index 000000000..8b7fd4acc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html @@ -0,0 +1,149 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html new file mode 100644 index 000000000..add81bcc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html @@ -0,0 +1,56 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html new file mode 100644 index 000000000..08022e493 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html new file mode 100644 index 000000000..9bfcaeee5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html @@ -0,0 +1,259 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html new file mode 100644 index 000000000..c3e082460 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html @@ -0,0 +1,245 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html new file mode 100644 index 000000000..aa1b1336b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html new file mode 100644 index 000000000..565b66a2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html new file mode 100644 index 000000000..231d51393 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html @@ -0,0 +1,63 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html new file mode 100644 index 000000000..e0e7cfbc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html new file mode 100644 index 000000000..e8f0eb91f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html @@ -0,0 +1,63 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html new file mode 100644 index 000000000..f36e32513 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html @@ -0,0 +1,63 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html new file mode 100644 index 000000000..8528515c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html @@ -0,0 +1,63 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html new file mode 100644 index 000000000..a1be2f2bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html @@ -0,0 +1,75 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html new file mode 100644 index 000000000..126ab107c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html @@ -0,0 +1,88 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html new file mode 100644 index 000000000..5dcae8863 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words.html new file mode 100644 index 000000000..a48fdd9af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words.html @@ -0,0 +1,716 @@ + + + + + + +WebGL GLSL Conformance Tests - Non Reserved Words + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html new file mode 100644 index 000000000..bca81f6ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html new file mode 100644 index 000000000..593f505a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html @@ -0,0 +1,83 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html new file mode 100644 index 000000000..1f6867010 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html new file mode 100644 index 000000000..3eda25bf5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html @@ -0,0 +1,284 @@ + + + + + + +WebGL GLSL Conformance Tests - Reserved Words + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html new file mode 100644 index 000000000..202966f68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html @@ -0,0 +1,177 @@ + + + + + + +WebGL short-circuit evaluation + + + + + +
+
+ + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html new file mode 100644 index 000000000..8b6a95f10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html @@ -0,0 +1,130 @@ + + + + + + +GLSL similar names issue + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html new file mode 100644 index 000000000..c6f9c896a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html @@ -0,0 +1,144 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html new file mode 100644 index 000000000..d56ebd138 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html new file mode 100644 index 000000000..2ba3e8e27 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html @@ -0,0 +1,60 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html new file mode 100644 index 000000000..5731662c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html @@ -0,0 +1,63 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html new file mode 100644 index 000000000..ae453acff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html @@ -0,0 +1,65 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html new file mode 100644 index 000000000..400c346f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html @@ -0,0 +1,65 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html new file mode 100644 index 000000000..b9ba890ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html @@ -0,0 +1,65 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html new file mode 100644 index 000000000..943672426 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html new file mode 100644 index 000000000..19307ca19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html @@ -0,0 +1,62 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html new file mode 100644 index 000000000..8576b9070 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html new file mode 100644 index 000000000..71408de12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html new file mode 100644 index 000000000..a0f006b80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html new file mode 100644 index 000000000..b516e6607 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html new file mode 100644 index 000000000..5a349d075 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html new file mode 100644 index 000000000..d16f39b58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html new file mode 100644 index 000000000..5e67435df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html @@ -0,0 +1,136 @@ + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html new file mode 100644 index 000000000..b7e5edf55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html @@ -0,0 +1,353 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html new file mode 100644 index 000000000..bd7f77a3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html @@ -0,0 +1,108 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html new file mode 100644 index 000000000..f49426d1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html @@ -0,0 +1,101 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html new file mode 100644 index 000000000..bdbc48cb7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html @@ -0,0 +1,95 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html new file mode 100644 index 000000000..8dc84e01e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html @@ -0,0 +1,104 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html new file mode 100644 index 000000000..63301ab4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html @@ -0,0 +1,310 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html new file mode 100644 index 000000000..a33866596 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html @@ -0,0 +1,124 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html new file mode 100644 index 000000000..4776d2a15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html @@ -0,0 +1,172 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html new file mode 100644 index 000000000..26844fa13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html @@ -0,0 +1,233 @@ + + + + + + +GLSL Structure Assignment Test + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html new file mode 100644 index 000000000..fee52dbbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html @@ -0,0 +1,238 @@ + + + + + + +GLSL Structure Equals Test + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html new file mode 100644 index 000000000..c06002bcd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html new file mode 100644 index 000000000..c6fe02fbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html @@ -0,0 +1,76 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html new file mode 100644 index 000000000..dca72cc46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html new file mode 100644 index 000000000..b208358bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html @@ -0,0 +1,72 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html new file mode 100644 index 000000000..548d640ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html new file mode 100644 index 000000000..a2bdecb79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html @@ -0,0 +1,89 @@ + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html new file mode 100644 index 000000000..4c462b617 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html @@ -0,0 +1,85 @@ + + + + + + +WebGL GLSL Conformance Tests - Ternary operator on arrays + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html new file mode 100644 index 000000000..2b578b372 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html @@ -0,0 +1,86 @@ + + + + + + + + + + +Ternary Operators in Global Initializers + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html new file mode 100644 index 000000000..5a0f3d1cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html @@ -0,0 +1,143 @@ + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html new file mode 100644 index 000000000..58ec47617 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html @@ -0,0 +1,107 @@ + + + + + +WebGL uniform location length tests + + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
Verify limits on the lengths of uniform locations per WebGL spec, "Maximum Uniform and Attribute Location Lengths".
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt new file mode 100644 index 000000000..7c2da3e8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt @@ -0,0 +1,8 @@ +_webgl_field.vert.html +_webgl_function.vert.html +_webgl_struct.vert.html +_webgl_variable.vert.html +webgl_field.vert.html +webgl_function.vert.html +webgl_struct.vert.html +webgl_variable.vert.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html new file mode 100644 index 000000000..4d084a19b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html new file mode 100644 index 000000000..ce78598b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html new file mode 100644 index 000000000..d9dd14aba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html new file mode 100644 index 000000000..6c1fad348 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html @@ -0,0 +1,55 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html new file mode 100644 index 000000000..e39800af5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html @@ -0,0 +1,61 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html new file mode 100644 index 000000000..4285dd8b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html new file mode 100644 index 000000000..f080a40f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html new file mode 100644 index 000000000..3fdc5f844 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html @@ -0,0 +1,55 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt new file mode 100644 index 000000000..c0f612d81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt @@ -0,0 +1,4 @@ +glsl-function-texture2d-bias.html +glsl-function-texture2dlod.html +glsl-function-texture2dproj.html +--min-version 1.0.3 glsl-function-texture2dprojlod.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html new file mode 100644 index 000000000..da197eb15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html @@ -0,0 +1,122 @@ + + + + + + +WebGL texture2D GLSL conformance test. + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html new file mode 100644 index 000000000..2f1a8f95f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html @@ -0,0 +1,130 @@ + + + + + + +WebGL texture2D GLSL conformance test. + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html new file mode 100644 index 000000000..6d5c81cb7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html @@ -0,0 +1,137 @@ + + + + + + +WebGL texture2D GLSL conformance test. + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html new file mode 100644 index 000000000..388ec09a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html @@ -0,0 +1,161 @@ + + + + + + +WebGL texture2D GLSL conformance test. + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt new file mode 100644 index 000000000..31fe0f8f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt @@ -0,0 +1,6 @@ +gl-fragcoord.html +gl-frontfacing.html +gl-pointcoord.html +--min-version 1.0.2 glsl-built-ins.html +--min-version 1.0.3 gl-fragcoord-xy-values.html +--min-version 1.0.3 gl-fragdata-and-fragcolor.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html new file mode 100644 index 000000000..5c16faea2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html @@ -0,0 +1,206 @@ + + + + + + +gl-fragcoord Test + + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html new file mode 100644 index 000000000..c9c4ac4b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html @@ -0,0 +1,105 @@ + + + + + + +gl-fragcoord Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html new file mode 100644 index 000000000..59f294d36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html @@ -0,0 +1,59 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html new file mode 100644 index 000000000..c944f24ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html @@ -0,0 +1,107 @@ + + + + + + +gl-fragcoord Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html new file mode 100644 index 000000000..e7760fc72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html @@ -0,0 +1,162 @@ + + + + + + +gl-pointcoord Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html new file mode 100644 index 000000000..c4c624719 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html @@ -0,0 +1,127 @@ + + + + + + +WebGL GLSL built in variables Conformance Test + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt new file mode 100644 index 000000000..79eb84a48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt @@ -0,0 +1,6 @@ +--min-version 1.0.4 gl-line-width.html +gl-min-attribs.html +gl-max-texture-dimensions.html +gl-min-textures.html +gl-min-uniforms.html + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html new file mode 100644 index 000000000..3cd926150 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html @@ -0,0 +1,93 @@ + + + + + + +Verify that line width limits are enforced. + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html new file mode 100644 index 000000000..757e42749 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html @@ -0,0 +1,130 @@ + + + + + + +WebGL the max advertized texture size is supported. + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html new file mode 100644 index 000000000..244903464 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html @@ -0,0 +1,107 @@ + + + + + + +WebGL the minimum number of attributes are supported. + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html new file mode 100644 index 000000000..e4200dcd0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html @@ -0,0 +1,102 @@ + + + + + + +WebGL the minimum number of uniforms are supported. + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html new file mode 100644 index 000000000..864dd2c64 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html @@ -0,0 +1,126 @@ + + + + + + +WebGL the minimum number of uniforms are supported. + + + + + + +
+
+ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html new file mode 100644 index 000000000..4b5707e70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html @@ -0,0 +1,99 @@ + + + + + + +Check that ANGLE_instanced_arrays state does not leak to browser + + + + + + +
+This test must be run manually.
+
+This test tests that leaving state for ANGLE_instanced_arrays with non-default values at the
+end of rendering does not interfere with proper compositing of results.
+Failures seen on Linux and Mac with Chrome 32.
+See http://crbug.com/304927 for more info.
+
+You should see a green rectangle
+with black a outline on success.  Briefly flashing red is normal.
+
+ +
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html new file mode 100644 index 000000000..bf888ffae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html @@ -0,0 +1,111 @@ + + + + + + +Check that the canvas is NOT recomposited after unsucessful draw call + + + + + + +
+This test must be run manually.
+
+This test tests that a canvas is cleared
+even when a draw call has a zero count.
+
+You should see three white rectangles
+with black outlines on success.
+
+ + + +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html new file mode 100644 index 000000000..d1329b464 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html @@ -0,0 +1,71 @@ + + + + + + +Check that the canvas is NOT recomposited after calling readPixels + + + + + + +
+This test must be run manually.
+
+This test tests that a canvas is NOT cleared
+and recomposited after calling readPixels.
+
+You should see a green rectangle
+with black a outline on success.
+
+ +
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html new file mode 100644 index 000000000..611e928a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html @@ -0,0 +1,84 @@ + + + + + + +Check that the canvas is NOT recomposited after unsucessful draw call + + + + + + +
+This test must be run manually.
+
+This test tests that a canvas is NOT cleared
+when a draw call fails.
+
+You should see two green rectangles
+with black outlines on success.
+
+ + +
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html new file mode 100644 index 000000000..3b6d78fad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html @@ -0,0 +1,155 @@ + + + + + + +Check that framebuffers keep contents exiting fullscreen mode. + + + + + + +
+This test must be run manually.
+
+Checks that framebuffers keep their contents going into and out of fullscreen mode.
+
+Through the entire test you should see a red rectangle. If it is not red in all cases the test has failed.
+
+
+
+
+
+
+ +
+ should be red +
+
+
+
+
+
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt new file mode 100644 index 000000000..224b8f63b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt @@ -0,0 +1,15 @@ +bad-arguments-test.html +--min-version 1.0.2 boolean-argument-conversion.html +--min-version 1.0.2 delayed-drawing.html +error-reporting.html +--min-version 1.0.4 expando-loss.html +functions-returning-strings.html +--max-version 1.9.9 instanceof-test.html +invalid-passed-params.html +is-object.html +null-object-behaviour.html +object-deletion-behaviour.html +shader-precision-format.html +type-conversion-test.html +uninitialized-test.html +webgl-specific.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html new file mode 100644 index 000000000..234a53618 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html @@ -0,0 +1,121 @@ + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html new file mode 100644 index 000000000..be2719ad8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html @@ -0,0 +1,136 @@ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html new file mode 100644 index 000000000..1cbc1a8aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html @@ -0,0 +1,85 @@ + + + + + + +WebGL Delayed Drawing test. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html new file mode 100644 index 000000000..9c8e45724 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html @@ -0,0 +1,94 @@ + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html new file mode 100644 index 000000000..f7e5003b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html @@ -0,0 +1,243 @@ + + + + + + + + +WebGL Object Expandos Conformance Test + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html new file mode 100644 index 000000000..d14d5d5e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html @@ -0,0 +1,125 @@ + + + + + +WebGL Conformance Tests + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html new file mode 100644 index 000000000..4e9df8b61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html @@ -0,0 +1,65 @@ + + + + + + +WebGL instanceof test. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html new file mode 100644 index 000000000..64a6e43be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html @@ -0,0 +1,184 @@ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html new file mode 100644 index 000000000..4eaf736f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html @@ -0,0 +1,99 @@ + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html new file mode 100644 index 000000000..2d6348c8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html @@ -0,0 +1,110 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html new file mode 100644 index 000000000..1808e13a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html @@ -0,0 +1,464 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html new file mode 100644 index 000000000..d7d124d2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html @@ -0,0 +1,158 @@ + + + + + +WebGL shader precision format test. + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html new file mode 100644 index 000000000..09c56b731 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html @@ -0,0 +1,172 @@ + + + + + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html new file mode 100644 index 000000000..af1de4801 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html @@ -0,0 +1,214 @@ + + + + + +WebGL Uninitialized GL Resources Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html new file mode 100644 index 000000000..b94acfd41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html @@ -0,0 +1,132 @@ + + + + + + +WebGL GLES2 difference test. + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt new file mode 100644 index 000000000..1a09da036 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt @@ -0,0 +1,58 @@ +conformance/constants.html +conformance/getContext.html +conformance/methods.html +conformance/quickCheckAPI-A.html +conformance/quickCheckAPI-B1.html +conformance/quickCheckAPI-B2.html +conformance/quickCheckAPI-B3.html +conformance/quickCheckAPI-B4.html +conformance/quickCheckAPI-C.html +conformance/quickCheckAPI-D_G.html +conformance/quickCheckAPI-G_I.html +conformance/quickCheckAPI-L_S.html +conformance/quickCheckAPI-S_V.html +conformance/webGLArrays.html +functions/bindBuffer.html +functions/bindBufferBadArgs.html +functions/bindFramebufferLeaveNonZero.html +functions/bufferData.html +functions/bufferDataBadArgs.html +functions/bufferSubData.html +functions/bufferSubDataBadArgs.html +functions/copyTexImage2D.html +functions/copyTexImage2DBadArgs.html +functions/copyTexSubImage2D.html +functions/copyTexSubImage2DBadArgs.html +functions/deleteBufferBadArgs.html +functions/drawArrays.html +functions/drawArraysOutOfBounds.html +functions/drawElements.html +functions/drawElementsBadArgs.html +functions/isTests.html +--min-version 1.0.2 functions/isTestsBadArgs.html +functions/readPixels.html +functions/readPixelsBadArgs.html +functions/texImage2D.html +functions/texImage2DBadArgs.html +functions/texImage2DHTML.html +functions/texImage2DHTMLBadArgs.html +functions/texSubImage2D.html +functions/texSubImage2DBadArgs.html +functions/texSubImage2DHTML.html +functions/texSubImage2DHTMLBadArgs.html +functions/uniformf.html +functions/uniformfBadArgs.html +functions/uniformfArrayLen1.html +functions/uniformi.html +functions/uniformiBadArgs.html +functions/uniformMatrix.html +functions/uniformMatrixBadArgs.html +functions/vertexAttrib.html +functions/vertexAttribBadArgs.html +functions/vertexAttribPointer.html +functions/vertexAttribPointerBadArgs.html +glsl/arrayOutOfBounds.html +#glsl/longLoops.html // No interactive tests. +glsl/uniformOutOfBounds.html +#glsl/unusedAttribsUniforms.html // No interactive tests. + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/README.md b/dom/canvas/test/webgl-conf/checkout/conformance/more/README.md new file mode 100644 index 000000000..01937147f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/README.md @@ -0,0 +1,53 @@ +Tests for the WebGL canvas context +================================== + +These tests are intended to serve the following purposes: + + * Assert spec conformance + * Check the safety of the GL binding (bounds checking, same origin policy) + * Provide performance numbers for developers + + +Running the tests +----------------- + + 1. Install a browser with WebGL support + 2. Run ruby gen_tests.rb if you have modified the tests. + 3. Run ruby test_server.rb if you want to get test run output to test_server's stdout (especially useful for finding out which test crashed your browser.) + 4. Open all_tests.html in your browser. + + +Want to contribute? +------------------- + + 1. Fork this repo + 2. Run gen_tests.rb + 3. Look into templates/ to see which functions lack tests (also see methods.txt and nsICanvasRenderingContextWebGL.idl): + 1. copy methodName.html to functions/methodName.html and write tests that test the results of valid inputs. + 2. copy methodNameBadArgs.html to functions/methodNameBadArgs.html and write tests to assert that invalid inputs throw exceptions. + 3. If your test causes a segfault, add the following to the top of the script tag: Tests.autorun = false; Tests.message = "Caution: this may crash your browser"; + 4. For each performance test: + 1. Write a performance/myTestName.html and set Tests.autorun = false; + 5. If you have a test that you would like to run over the whole API or want to generate tests programmatically, add them to gen_tests.rb or write your own script. + 6. Create a commit for each file. (E.g. for f in $(git status | grep -e "^#\\s*functions/\\S*$" | sed "s/^#\s*//"); do git add $f; git commit -m $f; done) + 7. Send me a pull request. + 8. Congratulations, you're now a contributor! + + +For more information on WebGL: + + * Planet WebGL + * Learning WebGL + * WebGL on Khronos Message Boards + +Developer links: + + * WebGL on Mozilla Bugzilla + * WebGL on WebKit Bugzilla + * WebGL on Chromium Bugzilla + +What's the stuff in apigen? + + There are some Python scripts in the apigen/ directory that generate C++ based on the API definition files (gl2.h, api_modifications.txt, valid_args.txt.) The generated code is Mozilla XPCOM functions that check their args against the valid GLES 2.0 constants (as they were written on the man pages.) There's also some wackier stuff for checking copyTexImage2D and copyTexSubImage2D image dimensions against viewport dimensions. + + If you can use it to generate code for your WebGL implementation, it might save you 1500 lines of typing and testing. The last time I used it was summer 2009 to generate a patch for Canvas 3D, so it's likely somewhat out of date. diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html new file mode 100644 index 000000000..5bc669f30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html @@ -0,0 +1,399 @@ + + + + + + OpenGL ES 2.0 <canvas> context tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html new file mode 100644 index 000000000..ee4b1af9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html @@ -0,0 +1,399 @@ + + + + + + OpenGL ES 2.0 <canvas> context tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html new file mode 100644 index 000000000..0da1a4f3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html @@ -0,0 +1,399 @@ + + + + + + OpenGL ES 2.0 <canvas> context tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js new file mode 100644 index 000000000..31039b596 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js @@ -0,0 +1,86 @@ +/* +** 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. +*/ + +// ArgGenerators contains argument generators for WebGL functions. +// The argument generators are used for running random tests against the WebGL +// functions. +// +// ArgGenerators is an object consisting of functionName : argGen -properties. +// +// functionName is a WebGL context function name and the argGen is an argument +// generator object that encapsulates the requirements to run +// randomly generated tests on the WebGL function. +// +// An argGen object has the following methods: +// - setup -- set up state for testing the GL function, returns values +// that need cleanup in teardown. Run once before entering a +// test loop. +// - teardown -- do cleanup on setup's return values after testing is complete +// - generate -- generate a valid set of random arguments for the GL function +// - returnValueCleanup -- do cleanup on value returned by the tested GL function +// - cleanup -- do cleanup on generated arguments from generate +// - checkArgValidity -- check if passed args are valid. Has a call signature +// that matches generate's return value. Returns true +// if args are valid, false if not. +// +// Example test loop that demonstrates how the function args and return +// values flow together: +// +// var setupArgs = argGen.setup(); +// for (var i=0; i 0.5 ? null : GL.createFramebuffer()]; + }, + checkArgValidity : function(target, fbo) { + if (target != GL.FRAMEBUFFER) + return false; + if (fbo != null) + GL.bindFramebuffer(target, fbo); + return (fbo == null || GL.isFramebuffer(fbo)); + }, + cleanup : function(target, fbo) { + GL.bindFramebuffer(target, null); + if (fbo) + GL.deleteFramebuffer(fbo); + } + }, + bindRenderbuffer : { + generate : function() { + return [GL.RENDERBUFFER, Math.random() > 0.5 ? null : GL.createRenderbuffer()]; + }, + checkArgValidity : function(target, rbo) { + if (target != GL.RENDERBUFFER) + return false; + if (rbo != null) + GL.bindRenderbuffer(target, rbo); + return (rbo == null || GL.isRenderbuffer(rbo)); + }, + cleanup : function(target, rbo) { + GL.bindRenderbuffer(target, null); + if (rbo) + GL.deleteRenderbuffer(rbo); + } + }, + bindTexture : { + generate : function() { + return [bindTextureTarget.random(), Math.random() > 0.5 ? null : GL.createTexture()]; + }, + checkArgValidity : function(target, o) { + if (!bindTextureTarget.has(target)) + return false; + if (o != null) + GL.bindTexture(target, o); + return (o == null || GL.isTexture(o)); + }, + cleanup : function(target, o) { + GL.bindTexture(target, null); + if (o) + GL.deleteTexture(o); + } + }, + blendColor : { + generate : function() { return randomColor(); }, + teardown : function() { GL.blendColor(0,0,0,0); } + }, + blendEquation : { + generate : function() { return [blendEquationMode.random()]; }, + checkArgValidity : function(o) { return blendEquationMode.has(o); }, + teardown : function() { GL.blendEquation(GL.FUNC_ADD); } + }, + blendEquationSeparate : { + generate : function() { + return [blendEquationMode.random(), blendEquationMode.random()]; + }, + checkArgValidity : function(o,p) { + return blendEquationMode.has(o) && blendEquationMode.has(p); + }, + teardown : function() { GL.blendEquationSeparate(GL.FUNC_ADD, GL.FUNC_ADD); } + }, + blendFunc : { + generate : function() { + return [blendFuncSfactor.random(), blendFuncDfactor.random()]; + }, + checkArgValidity : function(s,d) { + return blendFuncSfactor.has(s) && blendFuncDfactor.has(d); + }, + teardown : function() { GL.blendFunc(GL.ONE, GL.ZERO); } + }, + blendFuncSeparate : { + generate : function() { + return [blendFuncSfactor.random(), blendFuncDfactor.random(), + blendFuncSfactor.random(), blendFuncDfactor.random()]; + }, + checkArgValidity : function(s,d,as,ad) { + return blendFuncSfactor.has(s) && blendFuncDfactor.has(d) && + blendFuncSfactor.has(as) && blendFuncDfactor.has(ad) ; + }, + teardown : function() { + GL.blendFuncSeparate(GL.ONE, GL.ZERO, GL.ONE, GL.ZERO); + } + } + +}; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js new file mode 100644 index 000000000..7b7f46c46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js @@ -0,0 +1,85 @@ +/* +** 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. +*/ + +// ArgGenerators contains argument generators for WebGL functions. +// The argument generators are used for running random tests against the WebGL +// functions. +// +// ArgGenerators is an object consisting of functionName : argGen -properties. +// +// functionName is a WebGL context function name and the argGen is an argument +// generator object that encapsulates the requirements to run +// randomly generated tests on the WebGL function. +// +// An argGen object has the following methods: +// - setup -- set up state for testing the GL function, returns values +// that need cleanup in teardown. Run once before entering a +// test loop. +// - teardown -- do cleanup on setup's return values after testing is complete +// - generate -- generate a valid set of random arguments for the GL function +// - returnValueCleanup -- do cleanup on value returned by the tested GL function +// - cleanup -- do cleanup on generated arguments from generate +// - checkArgValidity -- check if passed args are valid. Has a call signature +// that matches generate's return value. Returns true +// if args are valid, false if not. +// +// Example test loop that demonstrates how the function args and return +// values flow together: +// +// var setupArgs = argGen.setup(); +// for (var i=0; i= 0 && data.byteLength >= 0 && offset + data.byteLength <= 256; + }, + teardown : function(buf, ebuf) { + GL.deleteBuffer(buf); + GL.deleteBuffer(ebuf); + }, + } + +}; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js new file mode 100644 index 000000000..974ff7455 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js @@ -0,0 +1,136 @@ +/* +** 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. +*/ + +// ArgGenerators contains argument generators for WebGL functions. +// The argument generators are used for running random tests against the WebGL +// functions. +// +// ArgGenerators is an object consisting of functionName : argGen -properties. +// +// functionName is a WebGL context function name and the argGen is an argument +// generator object that encapsulates the requirements to run +// randomly generated tests on the WebGL function. +// +// An argGen object has the following methods: +// - setup -- set up state for testing the GL function, returns values +// that need cleanup in teardown. Run once before entering a +// test loop. +// - teardown -- do cleanup on setup's return values after testing is complete +// - generate -- generate a valid set of random arguments for the GL function +// - returnValueCleanup -- do cleanup on value returned by the tested GL function +// - cleanup -- do cleanup on generated arguments from generate +// - checkArgValidity -- check if passed args are valid. Has a call signature +// that matches generate's return value. Returns true +// if args are valid, false if not. +// +// Example test loop that demonstrates how the function args and return +// values flow together: +// +// var setupArgs = argGen.setup(); +// for (var i=0; i 0.5 ? null : GL.createFramebuffer()]; + }, + checkArgValidity : function(fbo) { + if (fbo != null) + GL.bindFramebuffer(GL.FRAMEBUFFER, fbo); + return fbo == null || GL.isFramebuffer(fbo); + }, + cleanup : function(fbo){ + GL.bindFramebuffer(GL.FRAMEBUFFER, null); + if (fbo != null) + try{ GL.deleteFramebuffer(fbo); } catch(e) {} + } + }, + clear : { + generate : function() { return [clearMask.random()]; }, + checkArgValidity : function(mask) { return clearMask.has(mask); } + }, + clearColor : { + generate : function() { return randomColor(); }, + teardown : function() { GL.clearColor(0,0,0,0); } + }, + clearDepth : { + generate : function() { return [Math.random()]; }, + teardown : function() { GL.clearDepth(1); } + }, + clearStencil : { + generate : function() { return [randomStencil()]; }, + teardown : function() { GL.clearStencil(0); } + }, + colorMask : { + generate : function() { + return [randomBool(), randomBool(), randomBool(), randomBool()]; + }, + teardown : function() { GL.colorMask(true, true, true, true); } + }, + compileShader : {}, // FIXME + copyTexImage2D : {}, // FIXME + copyTexSubImage2D : {}, // FIXME + createBuffer : { + generate : function() { return []; }, + returnValueCleanup : function(o) { GL.deleteBuffer(o); } + }, + createFramebuffer : { + generate : function() { return []; }, + returnValueCleanup : function(o) { GL.deleteFramebuffer(o); } + }, + createProgram : { + generate : function() { return []; }, + returnValueCleanup : function(o) { GL.deleteProgram(o); } + }, + createRenderbuffer : { + generate : function() { return []; }, + returnValueCleanup : function(o) { GL.deleteRenderbuffer(o); } + }, + createShader : { + generate : function() { return [shaderType.random()]; }, + checkArgValidity : function(t) { return shaderType.has(t); }, + returnValueCleanup : function(o) { GL.deleteShader(o); } + }, + createTexture : { + generate : function() { return []; }, + returnValueCleanup : function(o) { GL.deleteTexture(o); } + }, + cullFace : { + generate : function() { return [cullFace.random()]; }, + checkArgValidity : function(f) { return cullFace.has(f); }, + teardown : function() { GL.cullFace(GL.BACK); } + } + +}; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js new file mode 100644 index 000000000..7d218519d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js @@ -0,0 +1,252 @@ +/* +** 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. +*/ + +// ArgGenerators contains argument generators for WebGL functions. +// The argument generators are used for running random tests against the WebGL +// functions. +// +// ArgGenerators is an object consisting of functionName : argGen -properties. +// +// functionName is a WebGL context function name and the argGen is an argument +// generator object that encapsulates the requirements to run +// randomly generated tests on the WebGL function. +// +// An argGen object has the following methods: +// - setup -- set up state for testing the GL function, returns values +// that need cleanup in teardown. Run once before entering a +// test loop. +// - teardown -- do cleanup on setup's return values after testing is complete +// - generate -- generate a valid set of random arguments for the GL function +// - returnValueCleanup -- do cleanup on value returned by the tested GL function +// - cleanup -- do cleanup on generated arguments from generate +// - checkArgValidity -- check if passed args are valid. Has a call signature +// that matches generate's return value. Returns true +// if args are valid, false if not. +// +// Example test loop that demonstrates how the function args and return +// values flow together: +// +// var setupArgs = argGen.setup(); +// for (var i=0; i= 0 && castToInt(h) >= 0; + }, + teardown : function() { + GL.scissor(0,0,GL.canvas.width, GL.canvas.height); + } + }, + shaderSource : {}, // FIXME + stencilFunc : { + generate : function(){ + return [stencilFuncFunc.random(), randomInt(MaxStencilValue), randomInt(0xffffffff)]; + }, + checkArgValidity : function(func, ref, mask) { + return stencilFuncFunc.has(func) && castToInt(ref) >= 0 && castToInt(ref) < MaxStencilValue; + }, + teardown : function() { + GL.stencilFunc(GL.ALWAYS, 0, 0xffffffff); + } + }, + stencilFuncSeparate : { + generate : function(){ + return [cullFace.random(), stencilFuncFunc.random(), randomInt(MaxStencilValue), randomInt(0xffffffff)]; + }, + checkArgValidity : function(face, func, ref, mask) { + return cullFace.has(face) && stencilFuncFunc.has(func) && castToInt(ref) >= 0 && castToInt(ref) < MaxStencilValue; + }, + teardown : function() { + GL.stencilFunc(GL.ALWAYS, 0, 0xffffffff); + } + }, + stencilMask : { + generate : function() { return [randomInt(0xffffffff)]; }, + teardown : function() { GL.stencilMask(0xffffffff); } + } + +}; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js new file mode 100644 index 000000000..726f6ef05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js @@ -0,0 +1,229 @@ +/* +** 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. +*/ + +// ArgGenerators contains argument generators for WebGL functions. +// The argument generators are used for running random tests against the WebGL +// functions. +// +// ArgGenerators is an object consisting of functionName : argGen -properties. +// +// functionName is a WebGL context function name and the argGen is an argument +// generator object that encapsulates the requirements to run +// randomly generated tests on the WebGL function. +// +// An argGen object has the following methods: +// - setup -- set up state for testing the GL function, returns values +// that need cleanup in teardown. Run once before entering a +// test loop. +// - teardown -- do cleanup on setup's return values after testing is complete +// - generate -- generate a valid set of random arguments for the GL function +// - returnValueCleanup -- do cleanup on value returned by the tested GL function +// - cleanup -- do cleanup on generated arguments from generate +// - checkArgValidity -- check if passed args are valid. Has a call signature +// that matches generate's return value. Returns true +// if args are valid, false if not. +// +// Example test loop that demonstrates how the function args and return +// values flow together: +// +// var setupArgs = argGen.setup(); +// for (var i=0; i 0.5) { + pix = new Uint8Array(16*16*4); + } + return [ + texImageTarget.random(), 0, + format, 16, 16, 0, + format, GL.UNSIGNED_BYTE, pix + ]; + } + }, + checkArgValidity : function(target, level, internalformat, width, height, border, format, type, data) { + // or : function(target, level, internalformat, format, type, image) + if (!texImageTarget.has(target) || castToInt(level) < 0) + return false; + if (arguments.length <= 6) { + var xformat = width; + var xtype = height; + var ximage = border; + if ((ximage instanceof HTMLImageElement || + ximage instanceof HTMLVideoElement || + ximage instanceof HTMLCanvasElement || + ximage instanceof ImageData) && + texImageInternalFormat.has(internalformat) && + texImageFormat.has(xformat) && + texImageType.has(xtype) && + internalformat == xformat) + return true; + return false; + } + var w = castToInt(width), h = castToInt(height), b = castToInt(border); + return texImageInternalFormat.has(internalformat) && w >= 0 && h >= 0 && + b == 0 && (data == null || data.byteLength == w*h*4) && + texImageFormat.has(format) && texImageType.has(type) + && internalformat == format; + }, + teardown : function(tex, tex2) { + GL.bindTexture(GL.TEXTURE_2D, null); + GL.bindTexture(GL.TEXTURE_CUBE_MAP, null); + GL.deleteTexture(tex); + GL.deleteTexture(tex2); + } + }, + texParameterf : { + generate : function() { + var pname = texParameterPname.random(); + var param = texParameterParam[pname].random(); + return [bindTextureTarget.random(), pname, param]; + }, + checkArgValidity : function(target, pname, param) { + if (!bindTextureTarget.has(target)) + return false; + if (!texParameterPname.has(pname)) + return false; + return texParameterParam[pname].has(param); + } + }, + texParameteri : { + generate : function() { + var pname = texParameterPname.random(); + var param = texParameterParam[pname].random(); + return [bindTextureTarget.random(), pname, param]; + }, + checkArgValidity : function(target, pname, param) { + if (!bindTextureTarget.has(target)) + return false; + if (!texParameterPname.has(pname)) + return false; + return texParameterParam[pname].has(param); + } + }, + texSubImage2D : {}, // FIXME + +// U + + uniform1f : {}, // FIXME + uniform1fv : {}, // FIXME + uniform1i : {}, // FIXME + uniform1iv : {}, // FIXME + uniform2f : {}, // FIXME + uniform2fv : {}, // FIXME + uniform2i : {}, // FIXME + uniform2iv : {}, // FIXME + uniform3f : {}, // FIXME + uniform3fv : {}, // FIXME + uniform3i : {}, // FIXME + uniform3iv : {}, // FIXME + uniform4f : {}, // FIXME + uniform4fv : {}, // FIXME + uniform4i : {}, // FIXME + uniform4iv : {}, // FIXME + uniformMatrix2fv : {}, // FIXME + uniformMatrix3fv : {}, // FIXME + uniformMatrix4fv : {}, // FIXME + useProgram : {}, // FIXME + +// V + + validateProgram : {}, // FIXME + vertexAttrib1f : {}, // FIXME + vertexAttrib1fv : {}, // FIXME + vertexAttrib2f : {}, // FIXME + vertexAttrib2fv : {}, // FIXME + vertexAttrib3f : {}, // FIXME + vertexAttrib3fv : {}, // FIXME + vertexAttrib4f : {}, // FIXME + vertexAttrib4fv : {}, // FIXME + vertexAttribPointer : {}, // FIXME + viewport : { + generate : function() { + return [randomInt(3000)-1500, randomInt(3000)-1500, randomIntFromRange(0,3000), randomIntFromRange(0,3000)]; + }, + checkArgValidity : function(x,y,w,h) { + return castToInt(w) >= 0 && castToInt(h) >= 0; + }, + teardown : function() { + GL.viewport(0,0,GL.canvas.width, GL.canvas.height); + } + } + +}; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html new file mode 100644 index 000000000..02c1aed98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html @@ -0,0 +1,597 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html new file mode 100644 index 000000000..3fa94515c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html @@ -0,0 +1,372 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html new file mode 100644 index 000000000..a0c14e369 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html @@ -0,0 +1,137 @@ + + + + + + + + + + + + + +

Optional: Enter a comma-separated list of functions to fuzz (leave blank for full API)

+ +

+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html
new file mode 100644
index 000000000..42f388080
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html
new file mode 100644
index 000000000..b47b9dce2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+
+
+
+
+  
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html
new file mode 100644
index 000000000..532518ee8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html
new file mode 100644
index 000000000..4d096246a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html
new file mode 100644
index 000000000..1b7d2cc99
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html
new file mode 100644
index 000000000..6f0f5b2f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html
new file mode 100644
index 000000000..348a8756b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html
new file mode 100644
index 000000000..fccf07fdd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html
new file mode 100644
index 000000000..1a43b98a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html
new file mode 100644
index 000000000..cbf6f4be4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html
new file mode 100644
index 000000000..f0d62cd20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html
new file mode 100644
index 000000000..39c89e8ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js
new file mode 100644
index 000000000..b39feca14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js
@@ -0,0 +1,430 @@
+/*
+** 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.
+*/
+
+/*
+  QuickCheck tests for WebGL:
+
+    1. Write a valid arg generator for each function
+      1.1. Write valid arg predicates to use with random generator:
+            if value passes generator, accept it as valid.
+      1.2. Often needs initializing and cleanup:
+            setup - generate - cleanup
+            gl.createBuffer - test(bindBufferGenerator) - gl.deleteBuffer
+
+    2. Write an invalid arg generator
+      2.1. Take valid args, modify an arg until the args no longer pass
+            checkArgValidity.
+      2.2. Repeat for all args.
+
+    3. Test functions using the generators
+      3.1. Args generated with the valid arg generator should pass
+            assertOk(f(args))
+      3.2. Args generated with the invalid arg generator should pass
+            assertFail(f(args))
+*/
+var GLcanvas = document.createElement('canvas');
+var canvas2D = document.createElement('canvas');
+GLcanvas.width = GLcanvas.height = 256;
+GL = getGLContext(GLcanvas);
+Array.from = function(o) {
+  var a = [];
+  for (var i=0; i= 0;
+  if (bufData instanceof ArrayBuffer)
+    return true;
+  return WebGLArrayTypes.some(function(t) {
+    return bufData instanceof t;
+  });
+};
+
+isVertexAttribute = function(idx) {
+  if (typeof idx != 'number') return false;
+  return idx >= 0 && idx < MaxVertexAttribs;
+};
+
+isValidName = function(name) {
+  if (typeof name != 'string') return false;
+  for (var i=0; i 0.5; };
+
+randomStencil = function() {
+  return randomInt(MaxStencilValue);
+};
+
+randomLineWidth = function() {
+  var lo = LineWidthRange[0],
+      hi = LineWidthRange[1];
+  return randomFloatFromRange(lo, hi);
+};
+
+randomImage = function(w,h) {
+  var img;
+  var r = Math.random();
+  if (r < 0.25) {
+    img = document.createElement('canvas');
+    img.width = w; img.height = h;
+    img.getContext('2d').fillRect(0,0,w,h);
+  } else if (r < 0.5) {
+    img = document.createElement('video');
+    img.width = w; img.height = h;
+  } else if (r < 0.75) {
+    img = document.createElement('img');
+    img.width = w; img.height = h;
+  } else {
+    img = canvas2D.getContext('2d').createImageData(w,h);
+  }
+  return img
+};
+
+mutateArgs = function(args) {
+  var mutateCount = randomIntFromRange(1, args.length);
+  var newArgs = Array.from(args);
+  for (var i=0; i 31 && c < 128) ? str[ii] : "?");
+  }
+  return newStr.join('');
+};
+
+argsToString = function(args) {
+  return sanitize(args.map(function(a){return Object.toSource(a)}).join(","));
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html
new file mode 100644
index 000000000..06327fa62
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html
new file mode 100644
index 000000000..3dad83efc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/demos/opengl_web.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/demos/opengl_web.html
new file mode 100644
index 000000000..665c05c4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/demos/opengl_web.html
@@ -0,0 +1,607 @@
+
+
+
+
+
+
+OpenGL for the web
+
+
+
+    
+
+    
+
+    
+    
+    
+
+    
+    
+    
+    
+
+    
+    
+    
+    
+
+    
+
+
+    
+    

+
+    
+

OpenGL for the web

+

+The WebGL specification gives web developers access to an +OpenGL ES 2.0 drawing context for the canvas tag. What that means is +that you can finally harness the power of the GPU for awesome visuals +and heavy-duty number crunching in your web apps.

OpenGL ES 2.0 is a subset of OpenGL 2.0 aimed at embedded +devices and game consoles. As such, it's a very minimalistic low-level +API, even more so than desktop OpenGL. In fact, if you took desktop +OpenGL and stripped out everything but shaders, vertex arrays and +textures, you'd get something quite like OpenGL ES 2.0.

+

+ As there is no fixed-function pipeline, you need to write GLSL shaders to draw anything. +And you need to do your own transformation math, including keeping +track of the transformation matrix stack. So the raw API is really not +for the faint of heart; you do need to know your 3D math and shading +equations.

+

For example, to draw the spinning cubes on the +right - around 200 lines of application code, 250 lines of shaders and +800 lines of library code - I had to scrounge the internet for GLSL shaders +to do the transformation and lighting, write a small matrix math +library in JavaScript and a DOF blur shader. While highly educational, +it was also a rather steep hill to climb.

+

So, the intended audience of the raw context +interface are not really end-users, but library developers who can +write easy-to-use interfaces to the functionality, and 3D developers +who require a high level of control over the rendering pipeline.

+

The really cool thing about the OpenGL Canvas is +that it doesn't make policy decisions. There's no single set-in-stone +use case for it: In addition to 3D graphics, you can also use it for +filtering images, visualizing fluid dynamics, doing real-time video +effects, or just crunching a whole lot of FP math. If you can do it on +the GPU, you're in luck!

+
+
+

You can also place content above the canvas

+
+ diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/demos/video.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/demos/video.html new file mode 100644 index 000000000..7007633f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/demos/video.html @@ -0,0 +1,163 @@ + + + + + + + + + + + + +
+ This is a port of Paul Rouget's Canvas+Video green screen demo, plus a texture lookup from the Firefox logo based on the values of the green and red color channels. +
+
+ + +
+
+ +
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html new file mode 100644 index 000000000..9018746e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html new file mode 100644 index 000000000..0939b5957 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html new file mode 100644 index 000000000..de642f51b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html @@ -0,0 +1,50 @@ + + + + + +OpenGL for the web + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html new file mode 100644 index 000000000..eb3626a71 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html new file mode 100644 index 000000000..d722b97b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html new file mode 100644 index 000000000..dc9aae7e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html @@ -0,0 +1,138 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html new file mode 100644 index 000000000..a883b3ae2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html @@ -0,0 +1,94 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html new file mode 100644 index 000000000..fff367583 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html new file mode 100644 index 000000000..3124e2d89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html @@ -0,0 +1,109 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html new file mode 100644 index 000000000..206ab4e3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html new file mode 100644 index 000000000..a212c6850 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html @@ -0,0 +1,117 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html new file mode 100644 index 000000000..62a262bcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html new file mode 100644 index 000000000..0db772196 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArraysOutOfBounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArraysOutOfBounds.html new file mode 100644 index 000000000..ff6dc8453 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArraysOutOfBounds.html @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html new file mode 100644 index 000000000..18df57b97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElementsBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElementsBadArgs.html new file mode 100644 index 000000000..371f1c6eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElementsBadArgs.html @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html new file mode 100644 index 000000000..288299623 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html new file mode 100644 index 000000000..88dd9b7d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html @@ -0,0 +1,108 @@ + + + + + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html new file mode 100644 index 000000000..4f3639980 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html @@ -0,0 +1,63 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html new file mode 100644 index 000000000..a8711eac8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html new file mode 100644 index 000000000..adebf9612 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html @@ -0,0 +1,86 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html new file mode 100644 index 000000000..f35ede65d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html @@ -0,0 +1,107 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html new file mode 100644 index 000000000..4d03106bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html new file mode 100644 index 000000000..abd1a7d1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html new file mode 100644 index 000000000..a3b57af85 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html @@ -0,0 +1,91 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html new file mode 100644 index 000000000..81256c179 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html @@ -0,0 +1,116 @@ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html new file mode 100644 index 000000000..cdd5e69d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html new file mode 100644 index 000000000..6a466b26b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html new file mode 100644 index 000000000..647c383c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html new file mode 100644 index 000000000..df909b176 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html new file mode 100644 index 000000000..11b2958f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html new file mode 100644 index 000000000..776c3500a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html new file mode 100644 index 000000000..20e0af0bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html new file mode 100644 index 000000000..a206e7439 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html new file mode 100644 index 000000000..ba74649dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html new file mode 100644 index 000000000..292ecdfd6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html new file mode 100644 index 000000000..a9de20c5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html new file mode 100644 index 000000000..fef2fa583 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html new file mode 100644 index 000000000..ca1928140 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html new file mode 100644 index 000000000..66a457a72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/longLoops.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/longLoops.html new file mode 100644 index 000000000..0372052b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/longLoops.html @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html new file mode 100644 index 000000000..f4592e8f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/unusedAttribsUniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/unusedAttribsUniforms.html new file mode 100644 index 000000000..860033fe8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/unusedAttribsUniforms.html @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/index.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/index.html new file mode 100644 index 000000000..28f82a988 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/index.html @@ -0,0 +1,96 @@ + + + + + + WebGL tests + + + +

Tests for the WebGL canvas context

+ +

These tests are intended to serve the following purposes:

+
    +
  • Assert spec conformance (so that WebGL pages work the same across browsers and hardware)
  • +
  • Check the safety of the GL binding (bounds checking, same origin policy)
  • +
  • Provide performance numbers for developers
  • +
+ +

Test runners

+ + + +

Demos

+ + +

Running the tests

+ +
    +
  1. Install a browser with WebGL support
  2. +
  3. Open one of the test runners linked above in your browser.
  4. +
  5. For more control over the tests, go the GitHub page, see the readme, and clone the repo.
  6. +
+ +

Want to contribute?

+ +

See the README.

+

See the GitHub page.

+

Mail me at ilmari.heikkinen@gmail.com

+ + +

For more information on WebGL

+ + + +

Developer links

+ + + +

License

+ +

+ These tests are released under the BSD license. The images and videos used in the tests are the respective property of their authors. +

+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/CPUvsGPU.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/CPUvsGPU.html new file mode 100644 index 000000000..f04cd730c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/CPUvsGPU.html @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + +
+
CPU 1x Gaussian blur
+
+ +
GPU 1000x Gaussian blur
+
+
+ diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/bandwidth.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/bandwidth.html new file mode 100644 index 000000000..d942a2de2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/bandwidth.html @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + +

100x 256x256x4 texture upload with texImage2D (26.2MB total)

+

+

100x 256x256x4 texture upload with texSubImage2D (26.2MB total)

+

+

100x 256x256x4 texture upload with texImage2DHTML (26.2MB total)

+

+

100x 256x256x4 texture upload with texSubImage2DHTML (26.2MB total)

+

+

100x 256x256x4 readPixels (26.2MB total)

+

+

100x 256x256x4 getImageData (26.2MB total)

+

+

25x 256x256x4 float bufferData (6.6MB total)

+

+

25x 256x256x4 float bufferSubData (6.6MB total)

+

+

100x 256x256x4 float bufferData, reuse Float32Array (26.2MB total)

+

+

100x 256x256x4 float bufferSubData, reuse Float32Array (26.2MB total)

+

+

100x 256x256 vert VBO draw

+

+

100x 256x256 vert VBO draw, change VBO after each draw

+

+ +

1000x 256x256 texture draw

+

+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsGCPause.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsGCPause.html new file mode 100644 index 000000000..1391a30f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsGCPause.html @@ -0,0 +1,85 @@ + + + + + + + + + + + +

10 seconds of 60fps 200x mul4x4, frame time statistics

+

+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsMatrixMult.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsMatrixMult.html new file mode 100644 index 000000000..bb496fc7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsMatrixMult.html @@ -0,0 +1,77 @@ + + + + + + + + + + + +

1000000x JavaScript Matrix.mul4x4

+

+

1000x JavaScript transform stack

+

+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsToGLOverhead.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsToGLOverhead.html new file mode 100644 index 000000000..4118204a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/performance/jsToGLOverhead.html @@ -0,0 +1,67 @@ + + + + + + + + + + + + +

1000000x gl.getError() (measuring JS->GL call overhead)

+

+

1000000x fakeGl.getError() (measuring JS->JS call overhead)

+

+

1000000x i++ (measuring loop overhead)

+

+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css new file mode 100644 index 000000000..0758b43bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css @@ -0,0 +1,66 @@ +/* +Tests for the OpenGL ES 2.0 HTML Canvas context + +Copyright (C) 2009 Ilmari Heikkinen + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is 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 Software. + +THE SOFTWARE IS 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 SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +*/ +.ok { + color: green; +} +.fail { + color: red; +} +canvas { + display: none; +} +#test-status { + font-size: large; +} + +#test-log { + padding-left: 0.5em; + padding-right: 0.5em; + background: white; + color: black; +} +#test-log > div { + padding-bottom: 0.5em; +} +#test-log h2 { + font-size: 1em; + margin-bottom: 0em; + padding-top: 0.5em; +} +#test-log h3 { + font-size: small; + margin-left: 1.5em; + margin-bottom: 0em; + margin-top: 0.5em; +} +#test-log p { + margin-left: 4em; + font-size: small; + margin-top: 0em; + margin-bottom: 0.2em; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js new file mode 100644 index 000000000..2a0347907 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js @@ -0,0 +1,988 @@ +/* +Unit testing library for the OpenGL ES 2.0 HTML Canvas context +*/ + +/* +** 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. +*/ + +/* -- plaform specific code -- */ + +// WebKit +if (window.testRunner && !window.layoutTestController) { + window.layoutTestController = window.testRunner; +} + +if (window.layoutTestController) { + layoutTestController.overridePreference("WebKitWebGLEnabled", "1"); + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); + + // The WebKit testing system compares console output. + // Because the output of the WebGL Tests is GPU dependent + // we turn off console messages. + window.console.log = function() { }; + window.console.error = function() { }; + + // RAF doesn't work in LayoutTests. Disable it so the tests will + // use setTimeout instead. + window.requestAnimationFrame = undefined; + window.webkitRequestAnimationFrame = undefined; +} + +if (window.internals) { + window.internals.settings.setWebGLErrorsToConsoleEnabled(false); +} + +/* -- end platform specific code --*/ +Tests = { + autorun : true, + message : null, + delay : 0, + autoinit: true, + + startUnit : function(){ return []; }, + setup : function() { return arguments; }, + teardown : function() {}, + endUnit : function() {} +} + +var __testSuccess__ = true; +var __testFailCount__ = 0; +var __testLog__; +var __backlog__ = []; + +var getUrlOptions = (function() { + var _urlOptionsParsed = false; + var _urlOptions = {}; + return function() { + if (!_urlOptionsParsed) { + var s = window.location.href; + var q = s.indexOf("?"); + var e = s.indexOf("#"); + if (e < 0) { + e = s.length; + } + var query = s.substring(q + 1, e); + var pairs = query.split("&"); + for (var ii = 0; ii < pairs.length; ++ii) { + var keyValue = pairs[ii].split("="); + var key = keyValue[0]; + var value = decodeURIComponent(keyValue[1]); + _urlOptions[key] = value; + } + _urlOptionsParsed = true; + } + + return _urlOptions; + } +})(); + +if (typeof quietMode == 'undefined') { + var quietMode = (function() { + var _quietModeChecked = false; + var _isQuiet = false; + return function() { + if (!_quietModeChecked) { + _isQuiet = (getUrlOptions().quiet == 1); + _quietModeChecked = true; + } + return _isQuiet; + } + })(); +} + +Object.toSource = function(a, seen){ + if (a == null) return "null"; + if (typeof a == 'boolean') return a ? "true" : "false"; + if (typeof a == 'string') return '"' + a.replace(/"/g, '\\"') + '"'; + if (a instanceof HTMLElement) return a.toString(); + if (a.width && a.height && a.data) return "[ImageData]"; + if (a instanceof Array) { + if (!seen) seen = []; + var idx = seen.indexOf(a); + if (idx != -1) return '#'+(idx+1)+'#'; + seen.unshift(a); + var srcs = a.map(function(o){ return Object.toSource(o,seen) }); + var prefix = ''; + idx = seen.indexOf(a); + if (idx != -1) prefix = '#'+(idx+1)+'='; + return prefix + '[' + srcs.join(", ") + ']'; + } + if (typeof a == 'object') { + if (!seen) seen = []; + var idx = seen.indexOf(a); + if (idx != -1) return '#'+(idx+1)+'#'; + seen.unshift(a); + var members = []; + var name; + try { + for (var i in a) { + if (i.search(/^[a-zA-Z0-9]+$/) != -1) + name = i; + else + name = '"' + i.replace(/"/g, '\\"') + '"'; + var ai; + try { ai = a[i]; } + catch(e) { ai = 'null /*ERROR_ACCESSING*/'; } + var s = name + ':' + Object.toSource(ai, seen); + members.push(s); + } + } catch (e) {} + var prefix = ''; + idx = seen.indexOf(a); + if (idx != -1) prefix = '#'+(idx+1)+'='; + return prefix + '{' + members.join(", ") + '}' + } + if (typeof a == 'function') + return '('+a.toString().replace(/\n/g, " ").replace(/\s+/g, " ")+')'; + return a.toString(); +} + +function formatError(e) { + if (window.console) console.log(e); + var pathSegs = location.href.toString().split("/"); + var currentDoc = e.lineNumber != null ? pathSegs[pathSegs.length - 1] : null; + var trace = (e.filename || currentDoc) + ":" + e.lineNumber + (e.trace ? "\n"+e.trace : ""); + return e.message + "\n" + trace; +} + +function runTests() { + var h = document.getElementById('test-status'); + if (h == null) { + h = document.createElement('h1'); + h.id = 'test-status'; + document.body.appendChild(h); + } + h.textContent = ""; + var log = document.getElementById('test-log'); + if (log == null) { + log = document.createElement('div'); + log.id = 'test-log'; + document.body.appendChild(log); + } + while (log.childNodes.length > 0) + log.removeChild(log.firstChild); + + var setup_args = []; + + if (Tests.startUnit != null) { + __testLog__ = document.createElement('div'); + try { + setup_args = Tests.startUnit(); + if (__testLog__.childNodes.length > 0) + log.appendChild(__testLog__); + } catch(e) { + testFailed("startUnit", formatError(e)); + log.appendChild(__testLog__); + printTestStatus(); + return; + } + } + + var testsRun = false; + var allTestsSuccessful = true; + + for (var i in Tests) { + if (i.substring(0,4) != "test") continue; + __testLog__ = document.createElement('div'); + __testSuccess__ = true; + try { + doTestNotify (i); + var args = setup_args; + if (Tests.setup != null) + args = Tests.setup.apply(Tests, setup_args); + Tests[i].apply(Tests, args); + if (Tests.teardown != null) + Tests.teardown.apply(Tests, args); + } + catch (e) { + testFailed(i, e.name, formatError(e)); + } + if (__testSuccess__ == false) { + ++__testFailCount__; + } + var h = document.createElement('h2'); + h.textContent = i; + __testLog__.insertBefore(h, __testLog__.firstChild); + log.appendChild(__testLog__); + allTestsSuccessful = allTestsSuccessful && __testSuccess__ == true; + reportTestResultsToHarness(__testSuccess__, i); + doTestNotify (i+"--"+(__testSuccess__?"OK":"FAIL")); + testsRun = true; + } + + printTestStatus(testsRun); + if (Tests.endUnit != null) { + __testLog__ = document.createElement('div'); + try { + Tests.endUnit.apply(Tests, setup_args); + if (__testLog__.childNodes.length > 0) + log.appendChild(__testLog__); + } catch(e) { + testFailed("endUnit", e.name, formatError(e)); + log.appendChild(__testLog__); + } + } + notifyFinishedToHarness(allTestsSuccessful, "finished tests"); +} + +function doTestNotify(name) { + //try { + // var xhr = new XMLHttpRequest(); + // xhr.open("GET", "http://localhost:8888/"+name, true); + // xhr.send(null); + //} catch(e) {} +} + +function testFailed(assertName, name) { + var d = document.createElement('div'); + var h = document.createElement('h3'); + var d1 = document.createElement("span"); + h.appendChild(d1); + d1.appendChild(document.createTextNode("FAIL: ")); + d1.style.color = "red"; + h.appendChild(document.createTextNode( + name==null ? assertName : name + " (in " + assertName + ")")); + d.appendChild(h); + var args = [] + for (var i=2; il[ii]) { + testFailed("assertArrayEqualsWithEpsilon", name, v, p, l); + return false; + } + } + testPassed("assertArrayEqualsWithEpsilon", name, v, p, l); + return true; +} + +function assertNotEquals(name, v, p) { + if (p == null) { p = v; v = name; name = null; } + if (compare(v, p)) { + testFailed("assertNotEquals", name, v, p) + return false; + } else { + testPassed("assertNotEquals", name, v, p) + return true; + } +} + +function time(elementId, f) { + var s = document.getElementById(elementId); + var t0 = new Date().getTime(); + f(); + var t1 = new Date().getTime(); + s.textContent = 'Elapsed: '+(t1-t0)+' ms'; +} + +function randomFloat () { + // note that in fuzz-testing, this can used as the size of a buffer to allocate. + // so it shouldn't return astronomic values. The maximum value 10000000 is already quite big. + var fac = 1.0; + var r = Math.random(); + if (r < 0.25) + fac = 10; + else if (r < 0.4) + fac = 100; + else if (r < 0.5) + fac = 1000; + else if (r < 0.6) + fac = 100000; + else if (r < 0.7) + fac = 10000000; + else if (r < 0.8) + fac = NaN; + return -0.5*fac + Math.random() * fac; +} +function randomFloatFromRange(lo, hi) { + var r = Math.random(); + if (r < 0.05) + return lo; + else if (r > 0.95) + return hi; + else + return lo + Math.random()*(hi-lo); +} +function randomInt (sz) { + if (sz != null) + return Math.floor(Math.random()*sz); + else + return Math.floor(randomFloat()); +} +function randomIntFromRange(lo, hi) { + return Math.floor(randomFloatFromRange(lo, hi)); +} +function randomLength () { + var l = Math.floor(Math.random() * 256); + if (Math.random < 0.5) l = l / 10; + if (Math.random < 0.3) l = l / 10; + return l; +} +function randomSmallIntArray () { + var l = randomLength(); + var s = new Array(l); + for (var i=0; i + + + + +WebGL GLSL conformance test: abs_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag new file mode 100644 index 000000000..6bea68938 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (color.r - 0.5); + gl_FragColor = vec4(abs(c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag new file mode 100644 index 000000000..af4160817 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (color.r - 0.5); + if(c < 0.0) c *= -1.0; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert new file mode 100644 index 000000000..ab995eeb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (gtf_Color.r - 0.5); + color = vec4(abs(c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert new file mode 100644 index 000000000..b6cd22e50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (gtf_Color.r - 0.5); + if(c < 0.0) c *= -1.0; + + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag new file mode 100644 index 000000000..5dd0df27b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(abs(c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..043273bca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (color.rg - 0.5); + if((c[0] < 0.0)) c[0] *= -1.0; + if((c[1] < 0.0)) c[1] *= -1.0; + + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert new file mode 100644 index 000000000..391b24334 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + color = vec4(abs(c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..0e0cf0076 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + if((c[0] < 0.0)) c[0] *= -1.0; + if((c[1] < 0.0)) c[1] *= -1.0; + + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag new file mode 100644 index 000000000..3c61c301c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(abs(c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..91ea0ccf0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (color.rgb - 0.5); + if((c[0] < 0.0)) c[0] *= -1.0; + if((c[1] < 0.0)) c[1] *= -1.0; + if((c[2] < 0.0)) c[2] *= -1.0; + + + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert new file mode 100644 index 000000000..7b0098d09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(abs(c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..29798b28a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + if((c[0] < 0.0)) c[0] *= -1.0; + if((c[1] < 0.0)) c[1] *= -1.0; + if((c[2] < 0.0)) c[2] *= -1.0; + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt new file mode 100644 index 000000000..ebf5dc91f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +abs_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html new file mode 100644 index 000000000..c0258ea88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: acos_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag new file mode 100644 index 000000000..a1a2dc793 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (color.r - 0.5); + gl_FragColor = vec4(acos(c) / M_PI, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag new file mode 100644 index 000000000..c4079a51f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag @@ -0,0 +1,111 @@ + +/* +** 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. +*/ + + +/* The following files are direct copies of each other: + * + * GL/acos/acos_float_frag_xvary_ref.frag + * GL/asin/asin_float_frag_xvary_ref.frag + * + * Care should be taken to apply any changes to both. Only the last + * line where gl_FragColor is assigned should be different. + */ + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float asinValues[17]; + asinValues[0] = -1.5708; + asinValues[1] = -1.06544; + asinValues[2] = -0.848062; + asinValues[3] = -0.675132; + asinValues[4] = -0.523599; + asinValues[5] = -0.384397; + asinValues[6] = -0.25268; + asinValues[7] = -0.125328; + asinValues[8] = 0.0; + asinValues[9] = 0.125328; + asinValues[10] = 0.25268; + asinValues[11] = 0.384397; + asinValues[12] = 0.523599; + asinValues[13] = 0.675132; + asinValues[14] = 0.848062; + asinValues[15] = 1.06544; + asinValues[16] = 1.5708; + + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (color.r - 0.5); + + float arrVal = (c + 1.0) * 8.0; + int arr0 = int(floor(arrVal)); + float weight = arrVal - floor(arrVal); + float asin_c = 0.0; + + if (arr0 == 0) + asin_c = lerp(asinValues[0], asinValues[1], weight); + else if (arr0 == 1) + asin_c = lerp(asinValues[1], asinValues[2], weight); + else if (arr0 == 2) + asin_c = lerp(asinValues[2], asinValues[3], weight); + else if (arr0 == 3) + asin_c = lerp(asinValues[3], asinValues[4], weight); + else if (arr0 == 4) + asin_c = lerp(asinValues[4], asinValues[5], weight); + else if (arr0 == 5) + asin_c = lerp(asinValues[5], asinValues[6], weight); + else if (arr0 == 6) + asin_c = lerp(asinValues[6], asinValues[7], weight); + else if (arr0 == 7) + asin_c = lerp(asinValues[7], asinValues[8], weight); + else if (arr0 == 8) + asin_c = lerp(asinValues[8], asinValues[9], weight); + else if (arr0 == 9) + asin_c = lerp(asinValues[9], asinValues[10], weight); + else if (arr0 == 10) + asin_c = lerp(asinValues[10], asinValues[11], weight); + else if (arr0 == 11) + asin_c = lerp(asinValues[11], asinValues[12], weight); + else if (arr0 == 12) + asin_c = lerp(asinValues[12], asinValues[13], weight); + else if (arr0 == 13) + asin_c = lerp(asinValues[13], asinValues[14], weight); + else if (arr0 == 14) + asin_c = lerp(asinValues[14], asinValues[15], weight); + else if (arr0 == 15) + asin_c = lerp(asinValues[15], asinValues[16], weight); + else if (arr0 == 16) + asin_c = asinValues[16]; + + // acos(x) = PI/2 - asin(x) + gl_FragColor = vec4(0.5 - asin_c / M_PI, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert new file mode 100644 index 000000000..79269d10e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (gtf_Color.r - 0.5); + color = vec4(acos(c) / M_PI, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert new file mode 100644 index 000000000..8e05e26cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert @@ -0,0 +1,58 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (gtf_Color.r - 0.5); + + float acos_c = 0.0; + float scale = 1.0; + float sign = 1.0; + + // pow can't handle negative numbers so take advantage of symmetry + if(c < 0.0) + { + sign = -1.0; + c *= -1.0; + } + + // Taylors series expansion for acos + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + acos_c += scale * pow(c, float(i)) / float(i); + scale *= float(i) / float(i + 1); + } + acos_c = M_PI / 2.0 - sign * acos_c; + + color = vec4(acos_c / M_PI, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag new file mode 100644 index 000000000..e2204d1f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(acos(c) / M_PI, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..d48846ed3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag @@ -0,0 +1,147 @@ + +/* +** 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. +*/ + + +/* The following files are direct copies of each other: + * + * GL/acos/acos_vec2_frag_xvary_ref.frag + * GL/asin/asin_vec2_frag_xvary_ref.frag + * + * Care should be taken to apply any changes to both. Only the last + * line where gl_FragColor is assigned should be different. + */ + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float asinValues[17]; + asinValues[0] = -1.5708; + asinValues[1] = -1.06544; + asinValues[2] = -0.848062; + asinValues[3] = -0.675132; + asinValues[4] = -0.523599; + asinValues[5] = -0.384397; + asinValues[6] = -0.25268; + asinValues[7] = -0.125328; + asinValues[8] = 0.0; + asinValues[9] = 0.125328; + asinValues[10] = 0.25268; + asinValues[11] = 0.384397; + asinValues[12] = 0.523599; + asinValues[13] = 0.675132; + asinValues[14] = 0.848062; + asinValues[15] = 1.06544; + asinValues[16] = 1.5708; + + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (color.rg - 0.5); + + vec2 arrVal = (c + vec2(1.0, 1.0)) * 8.0; + int arr0x = int(floor(arrVal.x)); + int arr0y = int(floor(arrVal.y)); + vec2 weight = arrVal - floor(arrVal); + vec2 asin_c = vec2(0.0); + + if (arr0x == 0) + asin_c.x = lerp(asinValues[0], asinValues[1], weight.x); + else if (arr0x == 1) + asin_c.x = lerp(asinValues[1], asinValues[2], weight.x); + else if (arr0x == 2) + asin_c.x = lerp(asinValues[2], asinValues[3], weight.x); + else if (arr0x == 3) + asin_c.x = lerp(asinValues[3], asinValues[4], weight.x); + else if (arr0x == 4) + asin_c.x = lerp(asinValues[4], asinValues[5], weight.x); + else if (arr0x == 5) + asin_c.x = lerp(asinValues[5], asinValues[6], weight.x); + else if (arr0x == 6) + asin_c.x = lerp(asinValues[6], asinValues[7], weight.x); + else if (arr0x == 7) + asin_c.x = lerp(asinValues[7], asinValues[8], weight.x); + else if (arr0x == 8) + asin_c.x = lerp(asinValues[8], asinValues[9], weight.x); + else if (arr0x == 9) + asin_c.x = lerp(asinValues[9], asinValues[10], weight.x); + else if (arr0x == 10) + asin_c.x = lerp(asinValues[10], asinValues[11], weight.x); + else if (arr0x == 11) + asin_c.x = lerp(asinValues[11], asinValues[12], weight.x); + else if (arr0x == 12) + asin_c.x = lerp(asinValues[12], asinValues[13], weight.x); + else if (arr0x == 13) + asin_c.x = lerp(asinValues[13], asinValues[14], weight.x); + else if (arr0x == 14) + asin_c.x = lerp(asinValues[14], asinValues[15], weight.x); + else if (arr0x == 15) + asin_c.x = lerp(asinValues[15], asinValues[16], weight.x); + else if (arr0x == 16) + asin_c.x = asinValues[16]; + + if (arr0y == 0) + asin_c.y = lerp(asinValues[0], asinValues[1], weight.y); + else if (arr0y == 1) + asin_c.y = lerp(asinValues[1], asinValues[2], weight.y); + else if (arr0y == 2) + asin_c.y = lerp(asinValues[2], asinValues[3], weight.y); + else if (arr0y == 3) + asin_c.y = lerp(asinValues[3], asinValues[4], weight.y); + else if (arr0y == 4) + asin_c.y = lerp(asinValues[4], asinValues[5], weight.y); + else if (arr0y == 5) + asin_c.y = lerp(asinValues[5], asinValues[6], weight.y); + else if (arr0y == 6) + asin_c.y = lerp(asinValues[6], asinValues[7], weight.y); + else if (arr0y == 7) + asin_c.y = lerp(asinValues[7], asinValues[8], weight.y); + else if (arr0y == 8) + asin_c.y = lerp(asinValues[8], asinValues[9], weight.y); + else if (arr0y == 9) + asin_c.y = lerp(asinValues[9], asinValues[10], weight.y); + else if (arr0y == 10) + asin_c.y = lerp(asinValues[10], asinValues[11], weight.y); + else if (arr0y == 11) + asin_c.y = lerp(asinValues[11], asinValues[12], weight.y); + else if (arr0y == 12) + asin_c.y = lerp(asinValues[12], asinValues[13], weight.y); + else if (arr0y == 13) + asin_c.y = lerp(asinValues[13], asinValues[14], weight.y); + else if (arr0y == 14) + asin_c.y = lerp(asinValues[14], asinValues[15], weight.y); + else if (arr0y == 15) + asin_c.y = lerp(asinValues[15], asinValues[16], weight.y); + else if (arr0y == 16) + asin_c.y = asinValues[16]; + + // acos(x) = PI/2 - asin(x) + gl_FragColor = vec4(0.5 - asin_c / M_PI, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert new file mode 100644 index 000000000..c3751eceb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + color = vec4(acos(c) / M_PI, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..eb6bb5d96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + vec2 acos_c = vec2(0.0); + vec2 scale = vec2(1.0); + vec2 sign = vec2(1.0); + + // pow can't handle negative numbers so take advantage of symmetry + if(c.r < 0.0) + { + sign.r = -1.0; + c.r *= -1.0; + } + + // Taylors series expansion for acos + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + acos_c.r += scale.r * pow(c.r, float(i)) / float(i); + scale.r *= float(i) / float(i + 1); + } + acos_c.r = M_PI / 2.0 - sign.r * acos_c.r; + + // pow can't handle negative numbers so take advantage of symmetry + if(c.g < 0.0) + { + sign.g = -1.0; + c.g *= -1.0; + } + + // Taylors series expansion for acos + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + acos_c.g += scale.g * pow(c.g, float(i)) / float(i); + scale.g *= float(i) / float(i + 1); + } + acos_c.g = M_PI / 2.0 - sign.g * acos_c.g; + + color = vec4(acos_c / M_PI, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag new file mode 100644 index 000000000..0c3f1a976 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(acos(c) / M_PI, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..b0cac4a47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag @@ -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. +*/ + + +/* The following files are direct copies of each other: + * + * GL/acos/acos_vec3_frag_xvary_ref.frag + * GL/asin/asin_vec3_frag_xvary_ref.frag + * + * Care should be taken to apply any changes to both. Only the last + * line where gl_FragColor is assigned should be different. + */ + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float asinValues[17]; + asinValues[0] = -1.5708; + asinValues[1] = -1.06544; + asinValues[2] = -0.848062; + asinValues[3] = -0.675132; + asinValues[4] = -0.523599; + asinValues[5] = -0.384397; + asinValues[6] = -0.25268; + asinValues[7] = -0.125328; + asinValues[8] = 0.0; + asinValues[9] = 0.125328; + asinValues[10] = 0.25268; + asinValues[11] = 0.384397; + asinValues[12] = 0.523599; + asinValues[13] = 0.675132; + asinValues[14] = 0.848062; + asinValues[15] = 1.06544; + asinValues[16] = 1.5708; + + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (color.rgb - 0.5); + + vec3 arrVal = (c + vec3(1.0, 1.0, 1.0)) * 8.0; + int arr0x = int(floor(arrVal.x)); + int arr0y = int(floor(arrVal.y)); + int arr0z = int(floor(arrVal.z)); + vec3 weight = arrVal - floor(arrVal); + vec3 asin_c = vec3(0.0); + + if (arr0x == 0) + asin_c.x = lerp(asinValues[0], asinValues[1], weight.x); + else if (arr0x == 1) + asin_c.x = lerp(asinValues[1], asinValues[2], weight.x); + else if (arr0x == 2) + asin_c.x = lerp(asinValues[2], asinValues[3], weight.x); + else if (arr0x == 3) + asin_c.x = lerp(asinValues[3], asinValues[4], weight.x); + else if (arr0x == 4) + asin_c.x = lerp(asinValues[4], asinValues[5], weight.x); + else if (arr0x == 5) + asin_c.x = lerp(asinValues[5], asinValues[6], weight.x); + else if (arr0x == 6) + asin_c.x = lerp(asinValues[6], asinValues[7], weight.x); + else if (arr0x == 7) + asin_c.x = lerp(asinValues[7], asinValues[8], weight.x); + else if (arr0x == 8) + asin_c.x = lerp(asinValues[8], asinValues[9], weight.x); + else if (arr0x == 9) + asin_c.x = lerp(asinValues[9], asinValues[10], weight.x); + else if (arr0x == 10) + asin_c.x = lerp(asinValues[10], asinValues[11], weight.x); + else if (arr0x == 11) + asin_c.x = lerp(asinValues[11], asinValues[12], weight.x); + else if (arr0x == 12) + asin_c.x = lerp(asinValues[12], asinValues[13], weight.x); + else if (arr0x == 13) + asin_c.x = lerp(asinValues[13], asinValues[14], weight.x); + else if (arr0x == 14) + asin_c.x = lerp(asinValues[14], asinValues[15], weight.x); + else if (arr0x == 15) + asin_c.x = lerp(asinValues[15], asinValues[16], weight.x); + else if (arr0x == 16) + asin_c.x = asinValues[16]; + + if (arr0y == 0) + asin_c.y = lerp(asinValues[0], asinValues[1], weight.y); + else if (arr0y == 1) + asin_c.y = lerp(asinValues[1], asinValues[2], weight.y); + else if (arr0y == 2) + asin_c.y = lerp(asinValues[2], asinValues[3], weight.y); + else if (arr0y == 3) + asin_c.y = lerp(asinValues[3], asinValues[4], weight.y); + else if (arr0y == 4) + asin_c.y = lerp(asinValues[4], asinValues[5], weight.y); + else if (arr0y == 5) + asin_c.y = lerp(asinValues[5], asinValues[6], weight.y); + else if (arr0y == 6) + asin_c.y = lerp(asinValues[6], asinValues[7], weight.y); + else if (arr0y == 7) + asin_c.y = lerp(asinValues[7], asinValues[8], weight.y); + else if (arr0y == 8) + asin_c.y = lerp(asinValues[8], asinValues[9], weight.y); + else if (arr0y == 9) + asin_c.y = lerp(asinValues[9], asinValues[10], weight.y); + else if (arr0y == 10) + asin_c.y = lerp(asinValues[10], asinValues[11], weight.y); + else if (arr0y == 11) + asin_c.y = lerp(asinValues[11], asinValues[12], weight.y); + else if (arr0y == 12) + asin_c.y = lerp(asinValues[12], asinValues[13], weight.y); + else if (arr0y == 13) + asin_c.y = lerp(asinValues[13], asinValues[14], weight.y); + else if (arr0y == 14) + asin_c.y = lerp(asinValues[14], asinValues[15], weight.y); + else if (arr0y == 15) + asin_c.y = lerp(asinValues[15], asinValues[16], weight.y); + else if (arr0y == 16) + asin_c.y = asinValues[16]; + + if (arr0z == 0) + asin_c.z = lerp(asinValues[0], asinValues[1], weight.z); + else if (arr0z == 1) + asin_c.z = lerp(asinValues[1], asinValues[2], weight.z); + else if (arr0z == 2) + asin_c.z = lerp(asinValues[2], asinValues[3], weight.z); + else if (arr0z == 3) + asin_c.z = lerp(asinValues[3], asinValues[4], weight.z); + else if (arr0z == 4) + asin_c.z = lerp(asinValues[4], asinValues[5], weight.z); + else if (arr0z == 5) + asin_c.z = lerp(asinValues[5], asinValues[6], weight.z); + else if (arr0z == 6) + asin_c.z = lerp(asinValues[6], asinValues[7], weight.z); + else if (arr0z == 7) + asin_c.z = lerp(asinValues[7], asinValues[8], weight.z); + else if (arr0z == 8) + asin_c.z = lerp(asinValues[8], asinValues[9], weight.z); + else if (arr0z == 9) + asin_c.z = lerp(asinValues[9], asinValues[10], weight.z); + else if (arr0z == 10) + asin_c.z = lerp(asinValues[10], asinValues[11], weight.z); + else if (arr0z == 11) + asin_c.z = lerp(asinValues[11], asinValues[12], weight.z); + else if (arr0z == 12) + asin_c.z = lerp(asinValues[12], asinValues[13], weight.z); + else if (arr0z == 13) + asin_c.z = lerp(asinValues[13], asinValues[14], weight.z); + else if (arr0z == 14) + asin_c.z = lerp(asinValues[14], asinValues[15], weight.z); + else if (arr0z == 15) + asin_c.z = lerp(asinValues[15], asinValues[16], weight.z); + else if (arr0z == 16) + asin_c.z = asinValues[16]; + + // acos(x) = PI/2 - asin(x) + gl_FragColor = vec4(0.5 - asin_c / M_PI, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert new file mode 100644 index 000000000..5bc077388 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(acos(c) / M_PI, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..a382a4573 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert @@ -0,0 +1,89 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + vec3 acos_c = vec3(0.0); + vec3 scale = vec3(1.0); + vec3 sign = vec3(1.0); + + // pow can't handle negative numbers so take advantage of symmetry + if(c.r < 0.0) + { + sign.r = -1.0; + c.r *= -1.0; + } + + // Taylors series expansion for acos + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + acos_c.r += scale.r * pow(c.r, float(i)) / float(i); + scale.r *= float(i) / float(i + 1); + } + acos_c.r = M_PI / 2.0 - sign.r * acos_c.r; + + // pow can't handle negative numbers so take advantage of symmetry + if(c.g < 0.0) + { + sign.g = -1.0; + c.g *= -1.0; + } + + // Taylors series expansion for acos + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + acos_c.g += scale.g * pow(c.g, float(i)) / float(i); + scale.g *= float(i) / float(i + 1); + } + acos_c.g = M_PI / 2.0 - sign.g * acos_c.g; + + // pow can't handle negative numbers so take advantage of symmetry + if(c.b < 0.0) + { + sign.b = -1.0; + c.b *= -1.0; + } + + // Taylors series expansion for acos + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + acos_c.b += scale.b * pow(c.b, float(i)) / float(i); + scale.b *= float(i) / float(i + 1); + } + acos_c.b = M_PI / 2.0 - sign.b * acos_c.b; + + color = vec4(acos_c / M_PI, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt new file mode 100644 index 000000000..fc7eedaa0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +acos_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html new file mode 100644 index 000000000..1c62b96e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: all_001_to_004.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag new file mode 100644 index 000000000..0e3071418 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(4.0 * color.rg); // 3/4 true, 1/4 false + gl_FragColor = vec4(vec3(all(bvec2(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag new file mode 100644 index 000000000..7e760e76a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bool _all(in bvec2 a) +{ + bool temp = true; + + if(!a[0]) temp = false; + if(!a[1]) temp = false; + + return temp; +} + +void main (void) +{ + vec2 c = floor(4.0 * color.rg); // 3/4 true, 1/4 false + gl_FragColor = vec4(vec3(_all(bvec2(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert new file mode 100644 index 000000000..6beab14c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(4.0 * gtf_Color.rg); // 3/4 true, 1/4 false + color = vec4(vec3(all(bvec2(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert new file mode 100644 index 000000000..e4f5071b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bool _all(in bvec2 a) +{ + bool temp = true; + + if(!a[0]) temp = false; + if(!a[1]) temp = false; + + return temp; +} + +void main (void) +{ + vec2 c = floor(4.0 * gtf_Color.rg); // 3/4 true, 1/4 false + color = vec4(vec3(_all(bvec2(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag new file mode 100644 index 000000000..bab07bbbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(4.0 * color.rgb); // 3/4 true, 1/4 false + gl_FragColor = vec4(vec3(all(bvec3(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag new file mode 100644 index 000000000..a4e5a568c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bool _all(in bvec3 a) +{ + bool temp = true; + + if(!a[0]) temp = false; + if(!a[1]) temp = false; + if(!a[2]) temp = false; + + return temp; +} + +void main (void) +{ + vec3 c = floor(4.0 * color.rgb); // 3/4 true, 1/4 false + gl_FragColor = vec4(vec3(_all(bvec3(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert new file mode 100644 index 000000000..657970df4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(4.0 * gtf_Color.rgb); // 3/4 true, 1/4 false + color = vec4(vec3(all(bvec3(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert new file mode 100644 index 000000000..c16ff8236 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bool _all(in bvec3 a) +{ + bool temp = true; + + if(!a[0]) temp = false; + if(!a[1]) temp = false; + if(!a[2]) temp = false; + + return temp; +} + +void main (void) +{ + vec3 c = floor(4.0 * gtf_Color.rgb); // 3/4 true, 1/4 false + color = vec4(vec3(_all(bvec3(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt new file mode 100644 index 000000000..420ac35bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +all_001_to_004.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html new file mode 100644 index 000000000..05b70e678 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: any_001_to_004.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag new file mode 100644 index 000000000..83a21f61a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec3(any(bvec2(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag new file mode 100644 index 000000000..3df527098 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bool _any(in bvec2 a) +{ + bool temp = false; + + if(a[0]) temp = true; + if(a[1]) temp = true; + + return temp; +} + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec3(_any(bvec2(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert new file mode 100644 index 000000000..1388eda2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + color = vec4(vec3(any(bvec2(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert new file mode 100644 index 000000000..d39695746 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bool _any(in bvec2 a) +{ + bool temp = false; + + if(a[0]) temp = true; + if(a[1]) temp = true; + + return temp; +} + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + color = vec4(vec3(_any(bvec2(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag new file mode 100644 index 000000000..ba8701496 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec3(any(bvec3(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag new file mode 100644 index 000000000..899a204be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bool _any(in bvec3 a) +{ + bool temp = false; + + if(a[0]) temp = true; + if(a[1]) temp = true; + if(a[2]) temp = true; + + return temp; +} + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec3(_any(bvec3(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert new file mode 100644 index 000000000..b73943460 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + color = vec4(vec3(any(bvec3(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert new file mode 100644 index 000000000..87bf200c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bool _any(in bvec3 a) +{ + bool temp = false; + + if(a[0]) temp = true; + if(a[1]) temp = true; + if(a[2]) temp = true; + + return temp; +} + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + color = vec4(vec3(_any(bvec3(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt new file mode 100644 index 000000000..6ac424067 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +any_001_to_004.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html new file mode 100644 index 000000000..fa1ebaf2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html @@ -0,0 +1,221 @@ + + + + + +WebGL GLSL conformance test: array_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag new file mode 100644 index 000000000..015a4c5bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int i=0; + float new_mad[2]; + float gray = 0.0; + + new_mad[0]=float(1); + new_mad[1]=float(2); + + if( (new_mad[0] == 1.0) && (new_mad[1] == 2.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray,gray , gray, 1.0); + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert new file mode 100644 index 000000000..90c492550 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int i=0; + float new_mad[2]; + float gray = 0.0; + + new_mad[0]=float(1); + new_mad[1]=float(2); + + if( (new_mad[0] == 1.0) && (new_mad[1] == 2.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag new file mode 100644 index 000000000..24c17e59d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +uniform float new_mad2[2]; + +void main (void) +{ + int i=0; + float new_mad[2]; + float gray = 0.0; + + new_mad[0]=new_mad2[0]; + new_mad[1]=new_mad2[1]; + + if( (new_mad[0] == 45.0) && (new_mad[1] == 14.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert new file mode 100644 index 000000000..101c33320 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; +const int array_size = 2; +uniform float new_mad2[array_size]; + +void main (void) +{ + int i=0; + float new_mad[array_size]; + float gray = 0.0; + + new_mad[0] = new_mad2[0]; + new_mad[1] = new_mad2[1]; + + if( (new_mad[0] == 45.0) && (new_mad[1] == 14.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag new file mode 100644 index 000000000..ff3078408 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + + +void initialise_array(out float array[2], float init_val); +void main (void) +{ + int i=0; + float new_mad[2]; + float gray = 0.0; + initialise_array(new_mad,25.0); + if( (new_mad[0] == 25.0) && (new_mad[1] == 25.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +void initialise_array(out float array[2], float init_val) +{ + int i=0; + array[0] = init_val; + array[1] = init_val; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert new file mode 100644 index 000000000..a84e72dda --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void initialise_array(out float array[2], float init_val); + +void main (void) +{ + int i=0; + float new_mad[2]; + float gray = 0.0; + initialise_array(new_mad,25.0); + if( (new_mad[0] == 25.0) && (new_mad[1] == 25.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +void initialise_array(out float array[2], float init_val) +{ + array[0] = init_val; + array[1] = init_val; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt new file mode 100644 index 000000000..c7cbc1049 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +array_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html new file mode 100644 index 000000000..8f9858431 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: asin_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag new file mode 100644 index 000000000..51e81e8aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (color.r - 0.5); + gl_FragColor = vec4(asin(c) / M_PI + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag new file mode 100644 index 000000000..b8da316a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag @@ -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. +*/ + + +/* The following files are direct copies of each other: + * + * GL/acos/acos_float_frag_xvary_ref.frag + * GL/asin/asin_float_frag_xvary_ref.frag + * + * Care should be taken to apply any changes to both. Only the last + * line where gl_FragColor is assigned should be different. + */ + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float asinValues[17]; + asinValues[0] = -1.5708; + asinValues[1] = -1.06544; + asinValues[2] = -0.848062; + asinValues[3] = -0.675132; + asinValues[4] = -0.523599; + asinValues[5] = -0.384397; + asinValues[6] = -0.25268; + asinValues[7] = -0.125328; + asinValues[8] = 0.0; + asinValues[9] = 0.125328; + asinValues[10] = 0.25268; + asinValues[11] = 0.384397; + asinValues[12] = 0.523599; + asinValues[13] = 0.675132; + asinValues[14] = 0.848062; + asinValues[15] = 1.06544; + asinValues[16] = 1.5708; + + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (color.r - 0.5); + + float arrVal = (c + 1.0) * 8.0; + int arr0 = int(floor(arrVal)); + float weight = arrVal - floor(arrVal); + float asin_c = 0.0; + + if (arr0 == 0) + asin_c = lerp(asinValues[0], asinValues[1], weight); + else if (arr0 == 1) + asin_c = lerp(asinValues[1], asinValues[2], weight); + else if (arr0 == 2) + asin_c = lerp(asinValues[2], asinValues[3], weight); + else if (arr0 == 3) + asin_c = lerp(asinValues[3], asinValues[4], weight); + else if (arr0 == 4) + asin_c = lerp(asinValues[4], asinValues[5], weight); + else if (arr0 == 5) + asin_c = lerp(asinValues[5], asinValues[6], weight); + else if (arr0 == 6) + asin_c = lerp(asinValues[6], asinValues[7], weight); + else if (arr0 == 7) + asin_c = lerp(asinValues[7], asinValues[8], weight); + else if (arr0 == 8) + asin_c = lerp(asinValues[8], asinValues[9], weight); + else if (arr0 == 9) + asin_c = lerp(asinValues[9], asinValues[10], weight); + else if (arr0 == 10) + asin_c = lerp(asinValues[10], asinValues[11], weight); + else if (arr0 == 11) + asin_c = lerp(asinValues[11], asinValues[12], weight); + else if (arr0 == 12) + asin_c = lerp(asinValues[12], asinValues[13], weight); + else if (arr0 == 13) + asin_c = lerp(asinValues[13], asinValues[14], weight); + else if (arr0 == 14) + asin_c = lerp(asinValues[14], asinValues[15], weight); + else if (arr0 == 15) + asin_c = lerp(asinValues[15], asinValues[16], weight); + else if (arr0 == 16) + asin_c = asinValues[16]; + + gl_FragColor = vec4(asin_c / M_PI + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert new file mode 100644 index 000000000..d19424fcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (gtf_Color.r - 0.5); + color = vec4(asin(c) / M_PI + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert new file mode 100644 index 000000000..d75bae252 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert @@ -0,0 +1,57 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * (gtf_Color.r - 0.5); + + float asin_c = 0.0; + float scale = 1.0; + float sign = 1.0; + + // pow can't handle negative numbers so take advantage of symmetry + if(c < 0.0) + { + sign = -1.0; + c *= -1.0; + } + + // Taylors series expansion for asin + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + asin_c += scale * pow(c, float(i)) / float(i); + scale *= float(i) / float(i + 1); + } + + color = vec4(sign * asin_c / M_PI + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag new file mode 100644 index 000000000..207ec4ffe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(asin(c) / M_PI + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..3e221a7ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag @@ -0,0 +1,146 @@ + +/* +** 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. +*/ + + +/* The following files are direct copies of each other: + * + * GL/acos/acos_vec2_frag_xvary_ref.frag + * GL/asin/asin_vec2_frag_xvary_ref.frag + * + * Care should be taken to apply any changes to both. Only the last + * line where gl_FragColor is assigned should be different. + */ + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float asinValues[17]; + asinValues[0] = -1.5708; + asinValues[1] = -1.06544; + asinValues[2] = -0.848062; + asinValues[3] = -0.675132; + asinValues[4] = -0.523599; + asinValues[5] = -0.384397; + asinValues[6] = -0.25268; + asinValues[7] = -0.125328; + asinValues[8] = 0.0; + asinValues[9] = 0.125328; + asinValues[10] = 0.25268; + asinValues[11] = 0.384397; + asinValues[12] = 0.523599; + asinValues[13] = 0.675132; + asinValues[14] = 0.848062; + asinValues[15] = 1.06544; + asinValues[16] = 1.5708; + + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (color.rg - 0.5); + + vec2 arrVal = (c + vec2(1.0, 1.0)) * 8.0; + int arr0x = int(floor(arrVal.x)); + int arr0y = int(floor(arrVal.y)); + vec2 weight = arrVal - floor(arrVal); + vec2 asin_c = vec2(0.0); + + if (arr0x == 0) + asin_c.x = lerp(asinValues[0], asinValues[1], weight.x); + else if (arr0x == 1) + asin_c.x = lerp(asinValues[1], asinValues[2], weight.x); + else if (arr0x == 2) + asin_c.x = lerp(asinValues[2], asinValues[3], weight.x); + else if (arr0x == 3) + asin_c.x = lerp(asinValues[3], asinValues[4], weight.x); + else if (arr0x == 4) + asin_c.x = lerp(asinValues[4], asinValues[5], weight.x); + else if (arr0x == 5) + asin_c.x = lerp(asinValues[5], asinValues[6], weight.x); + else if (arr0x == 6) + asin_c.x = lerp(asinValues[6], asinValues[7], weight.x); + else if (arr0x == 7) + asin_c.x = lerp(asinValues[7], asinValues[8], weight.x); + else if (arr0x == 8) + asin_c.x = lerp(asinValues[8], asinValues[9], weight.x); + else if (arr0x == 9) + asin_c.x = lerp(asinValues[9], asinValues[10], weight.x); + else if (arr0x == 10) + asin_c.x = lerp(asinValues[10], asinValues[11], weight.x); + else if (arr0x == 11) + asin_c.x = lerp(asinValues[11], asinValues[12], weight.x); + else if (arr0x == 12) + asin_c.x = lerp(asinValues[12], asinValues[13], weight.x); + else if (arr0x == 13) + asin_c.x = lerp(asinValues[13], asinValues[14], weight.x); + else if (arr0x == 14) + asin_c.x = lerp(asinValues[14], asinValues[15], weight.x); + else if (arr0x == 15) + asin_c.x = lerp(asinValues[15], asinValues[16], weight.x); + else if (arr0x == 16) + asin_c.x = asinValues[16]; + + if (arr0y == 0) + asin_c.y = lerp(asinValues[0], asinValues[1], weight.y); + else if (arr0y == 1) + asin_c.y = lerp(asinValues[1], asinValues[2], weight.y); + else if (arr0y == 2) + asin_c.y = lerp(asinValues[2], asinValues[3], weight.y); + else if (arr0y == 3) + asin_c.y = lerp(asinValues[3], asinValues[4], weight.y); + else if (arr0y == 4) + asin_c.y = lerp(asinValues[4], asinValues[5], weight.y); + else if (arr0y == 5) + asin_c.y = lerp(asinValues[5], asinValues[6], weight.y); + else if (arr0y == 6) + asin_c.y = lerp(asinValues[6], asinValues[7], weight.y); + else if (arr0y == 7) + asin_c.y = lerp(asinValues[7], asinValues[8], weight.y); + else if (arr0y == 8) + asin_c.y = lerp(asinValues[8], asinValues[9], weight.y); + else if (arr0y == 9) + asin_c.y = lerp(asinValues[9], asinValues[10], weight.y); + else if (arr0y == 10) + asin_c.y = lerp(asinValues[10], asinValues[11], weight.y); + else if (arr0y == 11) + asin_c.y = lerp(asinValues[11], asinValues[12], weight.y); + else if (arr0y == 12) + asin_c.y = lerp(asinValues[12], asinValues[13], weight.y); + else if (arr0y == 13) + asin_c.y = lerp(asinValues[13], asinValues[14], weight.y); + else if (arr0y == 14) + asin_c.y = lerp(asinValues[14], asinValues[15], weight.y); + else if (arr0y == 15) + asin_c.y = lerp(asinValues[15], asinValues[16], weight.y); + else if (arr0y == 16) + asin_c.y = asinValues[16]; + + gl_FragColor = vec4(asin_c / M_PI + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert new file mode 100644 index 000000000..c51ca500f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + color = vec4(asin(c) / M_PI + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..9aeab86bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert @@ -0,0 +1,71 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + vec2 asin_c = vec2(0.0); + vec2 scale = vec2(1.0); + vec2 sign = vec2(1.0); + + // pow can't handle negative numbers so take advantage of symmetry + if(c.r < 0.0) + { + sign.r = -1.0; + c.r *= -1.0; + } + + // Taylors series expansion for asin + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + asin_c.r += scale.r * pow(c.r, float(i)) / float(i); + scale.r *= float(i) / float(i + 1); + } + + // pow can't handle negative numbers so take advantage of symmetry + if(c.g < 0.0) + { + sign.g = -1.0; + c.g *= -1.0; + } + + // Taylors series expansion for asin + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + asin_c.g += scale.g * pow(c.g, float(i)) / float(i); + scale.g *= float(i) / float(i + 1); + } + + color = vec4(sign * asin_c / M_PI + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag new file mode 100644 index 000000000..4a7cc79a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(asin(c) / M_PI + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..2eb4a8066 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag @@ -0,0 +1,182 @@ + +/* +** 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. +*/ + + +/* The following files are direct copies of each other: + * + * GL/acos/acos_vec3_frag_xvary_ref.frag + * GL/asin/asin_vec3_frag_xvary_ref.frag + * + * Care should be taken to apply any changes to both. Only the last + * line where gl_FragColor is assigned should be different. + */ + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float asinValues[17]; + asinValues[0] = -1.5708; + asinValues[1] = -1.06544; + asinValues[2] = -0.848062; + asinValues[3] = -0.675132; + asinValues[4] = -0.523599; + asinValues[5] = -0.384397; + asinValues[6] = -0.25268; + asinValues[7] = -0.125328; + asinValues[8] = 0.0; + asinValues[9] = 0.125328; + asinValues[10] = 0.25268; + asinValues[11] = 0.384397; + asinValues[12] = 0.523599; + asinValues[13] = 0.675132; + asinValues[14] = 0.848062; + asinValues[15] = 1.06544; + asinValues[16] = 1.5708; + + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (color.rgb - 0.5); + + vec3 arrVal = (c + vec3(1.0, 1.0, 1.0)) * 8.0; + int arr0x = int(floor(arrVal.x)); + int arr0y = int(floor(arrVal.y)); + int arr0z = int(floor(arrVal.z)); + vec3 weight = arrVal - floor(arrVal); + vec3 asin_c = vec3(0.0); + + if (arr0x == 0) + asin_c.x = lerp(asinValues[0], asinValues[1], weight.x); + else if (arr0x == 1) + asin_c.x = lerp(asinValues[1], asinValues[2], weight.x); + else if (arr0x == 2) + asin_c.x = lerp(asinValues[2], asinValues[3], weight.x); + else if (arr0x == 3) + asin_c.x = lerp(asinValues[3], asinValues[4], weight.x); + else if (arr0x == 4) + asin_c.x = lerp(asinValues[4], asinValues[5], weight.x); + else if (arr0x == 5) + asin_c.x = lerp(asinValues[5], asinValues[6], weight.x); + else if (arr0x == 6) + asin_c.x = lerp(asinValues[6], asinValues[7], weight.x); + else if (arr0x == 7) + asin_c.x = lerp(asinValues[7], asinValues[8], weight.x); + else if (arr0x == 8) + asin_c.x = lerp(asinValues[8], asinValues[9], weight.x); + else if (arr0x == 9) + asin_c.x = lerp(asinValues[9], asinValues[10], weight.x); + else if (arr0x == 10) + asin_c.x = lerp(asinValues[10], asinValues[11], weight.x); + else if (arr0x == 11) + asin_c.x = lerp(asinValues[11], asinValues[12], weight.x); + else if (arr0x == 12) + asin_c.x = lerp(asinValues[12], asinValues[13], weight.x); + else if (arr0x == 13) + asin_c.x = lerp(asinValues[13], asinValues[14], weight.x); + else if (arr0x == 14) + asin_c.x = lerp(asinValues[14], asinValues[15], weight.x); + else if (arr0x == 15) + asin_c.x = lerp(asinValues[15], asinValues[16], weight.x); + else if (arr0x == 16) + asin_c.x = asinValues[16]; + + if (arr0y == 0) + asin_c.y = lerp(asinValues[0], asinValues[1], weight.y); + else if (arr0y == 1) + asin_c.y = lerp(asinValues[1], asinValues[2], weight.y); + else if (arr0y == 2) + asin_c.y = lerp(asinValues[2], asinValues[3], weight.y); + else if (arr0y == 3) + asin_c.y = lerp(asinValues[3], asinValues[4], weight.y); + else if (arr0y == 4) + asin_c.y = lerp(asinValues[4], asinValues[5], weight.y); + else if (arr0y == 5) + asin_c.y = lerp(asinValues[5], asinValues[6], weight.y); + else if (arr0y == 6) + asin_c.y = lerp(asinValues[6], asinValues[7], weight.y); + else if (arr0y == 7) + asin_c.y = lerp(asinValues[7], asinValues[8], weight.y); + else if (arr0y == 8) + asin_c.y = lerp(asinValues[8], asinValues[9], weight.y); + else if (arr0y == 9) + asin_c.y = lerp(asinValues[9], asinValues[10], weight.y); + else if (arr0y == 10) + asin_c.y = lerp(asinValues[10], asinValues[11], weight.y); + else if (arr0y == 11) + asin_c.y = lerp(asinValues[11], asinValues[12], weight.y); + else if (arr0y == 12) + asin_c.y = lerp(asinValues[12], asinValues[13], weight.y); + else if (arr0y == 13) + asin_c.y = lerp(asinValues[13], asinValues[14], weight.y); + else if (arr0y == 14) + asin_c.y = lerp(asinValues[14], asinValues[15], weight.y); + else if (arr0y == 15) + asin_c.y = lerp(asinValues[15], asinValues[16], weight.y); + else if (arr0y == 16) + asin_c.y = asinValues[16]; + + if (arr0z == 0) + asin_c.z = lerp(asinValues[0], asinValues[1], weight.z); + else if (arr0z == 1) + asin_c.z = lerp(asinValues[1], asinValues[2], weight.z); + else if (arr0z == 2) + asin_c.z = lerp(asinValues[2], asinValues[3], weight.z); + else if (arr0z == 3) + asin_c.z = lerp(asinValues[3], asinValues[4], weight.z); + else if (arr0z == 4) + asin_c.z = lerp(asinValues[4], asinValues[5], weight.z); + else if (arr0z == 5) + asin_c.z = lerp(asinValues[5], asinValues[6], weight.z); + else if (arr0z == 6) + asin_c.z = lerp(asinValues[6], asinValues[7], weight.z); + else if (arr0z == 7) + asin_c.z = lerp(asinValues[7], asinValues[8], weight.z); + else if (arr0z == 8) + asin_c.z = lerp(asinValues[8], asinValues[9], weight.z); + else if (arr0z == 9) + asin_c.z = lerp(asinValues[9], asinValues[10], weight.z); + else if (arr0z == 10) + asin_c.z = lerp(asinValues[10], asinValues[11], weight.z); + else if (arr0z == 11) + asin_c.z = lerp(asinValues[11], asinValues[12], weight.z); + else if (arr0z == 12) + asin_c.z = lerp(asinValues[12], asinValues[13], weight.z); + else if (arr0z == 13) + asin_c.z = lerp(asinValues[13], asinValues[14], weight.z); + else if (arr0z == 14) + asin_c.z = lerp(asinValues[14], asinValues[15], weight.z); + else if (arr0z == 15) + asin_c.z = lerp(asinValues[15], asinValues[16], weight.z); + else if (arr0z == 16) + asin_c.z = asinValues[16]; + + gl_FragColor = vec4(asin_c / M_PI + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert new file mode 100644 index 000000000..15f0ce719 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(asin(c) / M_PI + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..648d0ad18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert @@ -0,0 +1,86 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + vec3 asin_c = vec3(0.0); + vec3 scale = vec3(1.0); + vec3 sign = vec3(1.0); + + // pow can't handle negative numbers so take advantage of symmetry + if(c.r < 0.0) + { + sign.r = -1.0; + c.r *= -1.0; + } + + // Taylors series expansion for asin + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + asin_c.r += scale.r * pow(c.r, float(i)) / float(i); + scale.r *= float(i) / float(i + 1); + } + + // pow can't handle negative numbers so take advantage of symmetry + if(c.g < 0.0) + { + sign.g = -1.0; + c.g *= -1.0; + } + + // Taylors series expansion for asin + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + asin_c.g += scale.g * pow(c.g, float(i)) / float(i); + scale.g *= float(i) / float(i + 1); + } + + // pow can't handle negative numbers so take advantage of symmetry + if(c.b < 0.0) + { + sign.b = -1.0; + c.b *= -1.0; + } + + // Taylors series expansion for asin + // 1000/2 iterations necessary to get the accuracy with this method + for(int i = 1; i < 1000; i += 2) + { + asin_c.b += scale.b * pow(c.b, float(i)) / float(i); + scale.b *= float(i) / float(i + 1); + } + + color = vec4(sign * asin_c / M_PI + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt new file mode 100644 index 000000000..c2de8233a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +asin_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html new file mode 100644 index 000000000..1362fbed9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: atan_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html new file mode 100644 index 000000000..39f1fe5ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: atan_009_to_012.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag new file mode 100644 index 000000000..0b3528ebb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 4.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4(atan(c) / M_PI + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag new file mode 100644 index 000000000..891ea8dd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag @@ -0,0 +1,72 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 4.0 * 2.0 * (color.r - 0.5); + float atan_c = 0.0; + float scale = 1.0; + float sign = 1.0; + vec4 result; + + if(c < 0.0) + { + sign = -1.0; + c *= -1.0; + } + + if(c <= 1.0) + { + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * atan_c / M_PI + 0.5, 0.0, 0.0, 1.0); + } + else + { + c = 1.0 / c; + + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * (M_PI / 2.0 - atan_c) / M_PI + 0.5, 0.0, 0.0, 1.0); + } + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag new file mode 100644 index 000000000..3b8f85e1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float x = 2.0 * (color.g - 0.5); + float y = 2.0 * (color.b - 0.5); + const float epsilon = 1.0e-4; + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x > epsilon || abs(y) > epsilon) + { + gl_FragColor = vec4(atan(y, x) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag new file mode 100644 index 000000000..42fa998db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag @@ -0,0 +1,88 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float x = 2.0 * (color.g - 0.5); + float y = 2.0 * (color.b - 0.5); + float atan_c = 0.0; + float scale = 1.0; + float sign = 1.0; + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + const float epsilon = 1.0e-4; + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x > epsilon || abs(y) > epsilon) + { + if(x < 0.0 ^^ y < 0.0) + { + sign = -1.0; + } + + if(abs(y) <= abs(x)) + { + float c = abs(y / x); + + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * atan_c / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + } + else + { + float c = abs(x / y); + + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * (M_PI / 2.0 - atan_c) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + } + + if(x < 0.0) + if(y < 0.0) result.r -= 0.5; + else if(y > 0.0) result.r += 0.5; + } + + gl_FragColor = result; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert new file mode 100644 index 000000000..ead9e4be1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 4.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4(atan(c) / M_PI + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert new file mode 100644 index 000000000..f0dd4e16f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 4.0 * 2.0 * (gtf_Color.r - 0.5); + float atan_c = 0.0; + float scale = 1.0; + float sign = 1.0; + vec4 result; + + if(c < 0.0) + { + sign = -1.0; + c *= -1.0; + } + + if(c <= 1.0) + { + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * atan_c / M_PI + 0.5, 0.0, 0.0, 1.0); + } + else + { + c = 1.0 / c; + + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * (M_PI / 2.0 - atan_c) / M_PI + 0.5, 0.0, 0.0, 1.0); + } + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert new file mode 100644 index 000000000..183da3343 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float x = 2.0 * (gtf_Color.g - 0.5); + float y = 2.0 * (gtf_Color.b - 0.5); + const float epsilon = 1.0e-4; + color = vec4(0.0, 0.0, 0.0, 1.0); + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x > epsilon || abs(y) > epsilon) + { + color = vec4(atan(y, x) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + } + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert new file mode 100644 index 000000000..c45e98f0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float x = 2.0 * (gtf_Color.g - 0.5); + float y = 2.0 * (gtf_Color.b - 0.5); + float atan_c = 0.0; + float scale = 1.0; + float sign = 1.0; + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + const float epsilon = 1.0e-4; + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x > epsilon || abs(y) > epsilon) + { + if(x < 0.0 ^^ y < 0.0) + { + sign = -1.0; + } + + if(abs(y) <= abs(x)) + { + float c = abs(y / x); + + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * atan_c / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + } + else + { + float c = abs(x / y); + + // Taylors series expansion for atan + for(int i = 1; i < 12; i += 2) + { + atan_c += scale * pow(c, float(i)) / float(i); + scale *= -1.0; + } + + result = vec4(sign * (M_PI / 2.0 - atan_c) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + } + + if(x < 0.0) + if(y < 0.0) result.r -= 0.5; + else if(y > 0.0) result.r += 0.5; + } + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag new file mode 100644 index 000000000..2801a4938 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 4.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(atan(c) / M_PI + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..96771584f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag @@ -0,0 +1,132 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 4.0 * 2.0 * (color.rg - 0.5); + vec2 atan_c = vec2(0.0); + vec2 scale = vec2(1.0); + vec2 sign = vec2(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + + if(c[0] < 0.0) + { + sign[0] = -1.0; + c[0] *= -1.0; + } + + if(c[0] <= 1.0) + { + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / M_PI + 0.5; + } + else + { + c[0] = 1.0 / c[0]; + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5; + } + + + if(c[1] < 0.0) + { + sign[1] = -1.0; + c[1] *= -1.0; + } + + if(c[1] <= 1.0) + { + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / M_PI + 0.5; + } + else + { + c[1] = 1.0 / c[1]; + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5; + } + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag new file mode 100644 index 000000000..c851ff070 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 x = 2.0 * (color.gg - 0.5); + vec2 y = 2.0 * (color.bb - 0.5); + const float epsilon = 1.0e-4; + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + gl_FragColor[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + gl_FragColor[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5; + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag new file mode 100644 index 000000000..0e16fd84d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag @@ -0,0 +1,150 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 x = 2.0 * (color.gg - 0.5); + vec2 y = 2.0 * (color.bb - 0.5); + vec2 c; + vec2 atan_c = vec2(0.0); + vec2 scale = vec2(1.0); + vec2 sign = vec2(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + const float epsilon = 1.0e-4; + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + if(x[0] < 0.0 ^^ y[0] < 0.0) + { + sign[0] = -1.0; + } + + if(abs(y[0]) <= abs(x[0])) + { + c[0] = abs(y[0] / x[0]); + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5; + } + else + { + c[0] = abs(x[0] / y[0]); + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[0] < 0.0) + if(y[0] < 0.0) result[0] -= 0.5; + else if(y[0] > 0.0) result[0] += 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + + if(x[1] < 0.0 ^^ y[1] < 0.0) + { + sign[1] = -1.0; + } + + if(abs(y[1]) <= abs(x[1])) + { + c[1] = abs(y[1] / x[1]); + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5; + } + else + { + c[1] = abs(x[1] / y[1]); + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] < 0.0) + if(y[1] < 0.0) result[1] -= 0.5; + else if(y[1] > 0.0) result[1] += 0.5; + } + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert new file mode 100644 index 000000000..c9740e5db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 4.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4(atan(c) / M_PI + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..f3ba4ce87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert @@ -0,0 +1,133 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 4.0 * 2.0 * (gtf_Color.rg - 0.5); + vec2 atan_c = vec2(0.0); + vec2 scale = vec2(1.0); + vec2 sign = vec2(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + + if(c[0] < 0.0) + { + sign[0] = -1.0; + c[0] *= -1.0; + } + + if(c[0] <= 1.0) + { + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / M_PI + 0.5; + } + else + { + c[0] = 1.0 / c[0]; + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5; + } + + + if(c[1] < 0.0) + { + sign[1] = -1.0; + c[1] *= -1.0; + } + + if(c[1] <= 1.0) + { + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / M_PI + 0.5; + } + else + { + c[1] = 1.0 / c[1]; + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5; + } + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert new file mode 100644 index 000000000..a56b33c9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 x = 2.0 * (gtf_Color.gg - 0.5); + vec2 y = 2.0 * (gtf_Color.bb - 0.5); + const float epsilon = 1.0e-4; + color = vec4(0.0, 0.0, 0.0, 1.0); + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + color[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + color[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5; + } + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert new file mode 100644 index 000000000..790b4a743 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert @@ -0,0 +1,150 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 x = 2.0 * (gtf_Color.gg - 0.5); + vec2 y = 2.0 * (gtf_Color.bb - 0.5); + vec2 c; + vec2 atan_c = vec2(0.0); + vec2 scale = vec2(1.0); + vec2 sign = vec2(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + const float epsilon = 1.0e-4; + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + if(x[0] < 0.0 ^^ y[0] < 0.0) + { + sign[0] = -1.0; + } + + if(abs(y[0]) <= abs(x[0])) + { + c[0] = abs(y[0] / x[0]); + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5; + } + else + { + c[0] = abs(x[0] / y[0]); + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[0] < 0.0) + if(y[0] < 0.0) result[0] -= 0.5; + else if(y[0] > 0.0) result[0] += 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + if(x[1] < 0.0 ^^ y[1] < 0.0) + { + sign[1] = -1.0; + } + + if(abs(y[1]) <= abs(x[1])) + { + c[1] = abs(y[1] / x[1]); + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5; + } + else + { + c[1] = abs(x[1] / y[1]); + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] < 0.0) + if(y[1] < 0.0) result[1] -= 0.5; + else if(y[1] > 0.0) result[1] += 0.5; + } + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag new file mode 100644 index 000000000..281ae2e62 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 4.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(atan(c) / M_PI + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..c8484b8dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag @@ -0,0 +1,178 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 4.0 * 2.0 * (color.rgb - 0.5); + vec3 atan_c = vec3(0.0); + vec3 scale = vec3(1.0); + vec3 sign = vec3(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + + + if(c[0] < 0.0) + { + sign[0] = -1.0; + c[0] *= -1.0; + } + + if(c[0] <= 1.0) + { + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / M_PI + 0.5; + } + else + { + c[0] = 1.0 / c[0]; + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5; + } + + if(c[1] < 0.0) + { + sign[1] = -1.0; + c[1] *= -1.0; + } + + if(c[1] <= 1.0) + { + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / M_PI + 0.5; + } + else + { + c[1] = 1.0 / c[1]; + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5; + } + + + if(c[2] < 0.0) + { + sign[2] = -1.0; + c[2] *= -1.0; + } + + if(c[2] <= 1.0) + { + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * atan_c[2] / M_PI + 0.5; + } + else + { + c[2] = 1.0 / c[2]; + + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / M_PI + 0.5; + } + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag new file mode 100644 index 000000000..08a18b8a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 x = 2.0 * (color.ggg - 0.5); + vec3 y = 2.0 * (color.bbb - 0.5); + const float epsilon = 1.0e-4; + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + gl_FragColor[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + gl_FragColor[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5; + } + + if(x[2] > epsilon || abs(y[2]) > epsilon) + { + gl_FragColor[2] = atan(y[2], x[2]) / (2.0 * M_PI) + 0.5; + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag new file mode 100644 index 000000000..9a97bb2be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag @@ -0,0 +1,203 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 x = 2.0 * (color.ggg - 0.5); + vec3 y = 2.0 * (color.bbb - 0.5); + vec3 c; + vec3 atan_c = vec3(0.0); + vec3 scale = vec3(1.0); + vec3 sign = vec3(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + const float epsilon = 1.0e-4; + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + if(x[0] < 0.0 ^^ y[0] < 0.0) + { + sign[0] = -1.0; + } + + if(abs(y[0]) <= abs(x[0])) + { + c[0] = abs(y[0] / x[0]); + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5; + } + else + { + c[0] = abs(x[0] / y[0]); + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[0] < 0.0) + if(y[0] < 0.0) result[0] -= 0.5; + else if(y[0] > 0.0) result[0] += 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + + if(x[1] < 0.0 ^^ y[1] < 0.0) + { + sign[1] = -1.0; + } + + if(abs(y[1]) <= abs(x[1])) + { + c[1] = abs(y[1] / x[1]); + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5; + } + else + { + c[1] = abs(x[1] / y[1]); + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] < 0.0) + if(y[1] < 0.0) result[1] -= 0.5; + else if(y[1] > 0.0) result[1] += 0.5; + } + + if(x[2] > epsilon || abs(y[2]) > epsilon) + { + + if(x[2] < 0.0 ^^ y[2] < 0.0) + { + sign[2] = -1.0; + } + + if(abs(y[2]) <= abs(x[2])) + { + c[2] = abs(y[2] / x[2]); + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * atan_c[2] / (2.0 * M_PI) + 0.5; + } + else + { + c[2] = abs(x[2] / y[2]); + + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / (2.0 * M_PI) + 0.5; + } + + if(x[2] < 0.0) + if(y[2] < 0.0) result[2] -= 0.5; + else if(y[2] > 0.0) result[2] += 0.5; + } + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert new file mode 100644 index 000000000..ad0d32787 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 4.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(atan(c) / M_PI + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..34a6ca3e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert @@ -0,0 +1,178 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 4.0 * 2.0 * (gtf_Color.rgb - 0.5); + vec3 atan_c = vec3(0.0); + vec3 scale = vec3(1.0); + vec3 sign = vec3(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + + if(c[0] < 0.0) + { + sign[0] = -1.0; + c[0] *= -1.0; + } + + if(c[0] <= 1.0) + { + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / M_PI + 0.5; + } + else + { + c[0] = 1.0 / c[0]; + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5; + } + + + if(c[1] < 0.0) + { + sign[1] = -1.0; + c[1] *= -1.0; + } + + if(c[1] <= 1.0) + { + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / M_PI + 0.5; + } + else + { + c[1] = 1.0 / c[1]; + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5; + } + + if(c[2] < 0.0) + { + sign[2] = -1.0; + c[2] *= -1.0; + } + + if(c[2] <= 1.0) + { + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * atan_c[2] / M_PI + 0.5; + } + else + { + c[2] = 1.0 / c[2]; + + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / M_PI + 0.5; + } + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert new file mode 100644 index 000000000..1b19a4c2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 x = 2.0 * (gtf_Color.ggg - 0.5); + vec3 y = 2.0 * (gtf_Color.bbb - 0.5); + const float epsilon = 1.0e-4; + color = vec4(0.0, 0.0, 0.0, 1.0); + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + color[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + color[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5; + } + + if(x[2] > epsilon || abs(y[2]) > epsilon) + { + color[2] = atan(y[2], x[2]) / (2.0 * M_PI) + 0.5; + } + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert new file mode 100644 index 000000000..d36106f72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert @@ -0,0 +1,202 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 x = 2.0 * (gtf_Color.ggg - 0.5); + vec3 y = 2.0 * (gtf_Color.bbb - 0.5); + vec3 c; + vec3 atan_c = vec3(0.0); + vec3 scale = vec3(1.0); + vec3 sign = vec3(1.0); + vec4 result = vec4(0.0, 0.0, 0.0, 1.0); + const float epsilon = 1.0e-4; + + // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent + if(x[0] > epsilon || abs(y[0]) > epsilon) + { + if(x[0] < 0.0 ^^ y[0] < 0.0) + { + sign[0] = -1.0; + } + + if(abs(y[0]) <= abs(x[0])) + { + c[0] = abs(y[0] / x[0]); + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5; + } + else + { + c[0] = abs(x[0] / y[0]); + + // Taylors series expansion for atan + atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9); + scale[0] *= -1.0; + atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11); + scale[0] *= -1.0; + + result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5; + } + + if(x[0] < 0.0) + if(y[0] < 0.0) result[0] -= 0.5; + else if(y[0] > 0.0) result[0] += 0.5; + } + + if(x[1] > epsilon || abs(y[1]) > epsilon) + { + if(x[1] < 0.0 ^^ y[1] < 0.0) + { + sign[1] = -1.0; + } + + if(abs(y[1]) <= abs(x[1])) + { + c[1] = abs(y[1] / x[1]); + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5; + } + else + { + c[1] = abs(x[1] / y[1]); + + // Taylors series expansion for atan + atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9); + scale[1] *= -1.0; + atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11); + scale[1] *= -1.0; + + result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5; + } + + if(x[1] < 0.0) + if(y[1] < 0.0) result[1] -= 0.5; + else if(y[1] > 0.0) result[1] += 0.5; + } + + if(x[2] > epsilon || abs(y[2]) > epsilon) + { + if(x[2] < 0.0 ^^ y[2] < 0.0) + { + sign[2] = -1.0; + } + + if(abs(y[2]) <= abs(x[2])) + { + c[2] = abs(y[2] / x[2]); + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * atan_c[2] / (2.0 * M_PI) + 0.5; + } + else + { + c[2] = abs(x[2] / y[2]); + + // Taylors series expansion for atan + atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9); + scale[2] *= -1.0; + atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11); + scale[2] *= -1.0; + + result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / (2.0 * M_PI) + 0.5; + } + + if(x[2] < 0.0) + if(y[2] < 0.0) result[2] -= 0.5; + else if(y[2] > 0.0) result[2] += 0.5; + } + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt new file mode 100644 index 000000000..1c305f211 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +atan_001_to_008.html +atan_009_to_012.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html new file mode 100644 index 000000000..d03c779cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: biConstants_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html new file mode 100644 index 000000000..d68845067 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: biConstants_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag new file mode 100644 index 000000000..94e9c6d0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxCombinedTextureImageUnits is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + gl_FragColor = vec4(float(gl_MaxCombinedTextureImageUnits) / 8.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert new file mode 100644 index 000000000..8dcfd2d98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxCombinedTextureImageUnits is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + color = vec4(float(gl_MaxCombinedTextureImageUnits) / 8.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag new file mode 100644 index 000000000..481f76a15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxDrawBuffers is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 1.0 will get clamped to 1.0 or white. + gl_FragColor = vec4(float(gl_MaxDrawBuffers) / 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert new file mode 100644 index 000000000..25cc2b469 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxDrawBuffers is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 1.0 will get clamped to 1.0 or white. + color = vec4(float(gl_MaxDrawBuffers) / 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag new file mode 100644 index 000000000..d54198995 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxFragmentUniformVectors is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 16.0 will get clamped to 1.0 or white. + gl_FragColor = vec4(float(gl_MaxFragmentUniformVectors) / 16.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert new file mode 100644 index 000000000..f430197c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxFragmentUniformVectors is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 16.0 will get clamped to 1.0 or white. + color = vec4(float(gl_MaxFragmentUniformVectors) / 16.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag new file mode 100644 index 000000000..55b7b2078 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxTextureImageUnits is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + gl_FragColor = vec4(float(gl_MaxTextureImageUnits) / 8.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert new file mode 100644 index 000000000..b0851a729 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxTextureImageUnits is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + color = vec4(float(gl_MaxTextureImageUnits) / 8.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag new file mode 100644 index 000000000..abd8e8bff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVaryingVectors is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + gl_FragColor = vec4(float(gl_MaxVaryingVectors) / 8.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert new file mode 100644 index 000000000..cfb2449cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVaryingVectors is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + color = vec4(float(gl_MaxVaryingVectors) / 8.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag new file mode 100644 index 000000000..f839f4c4e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVertexAttribs is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + gl_FragColor = vec4(float(gl_MaxVertexAttribs) / 8.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert new file mode 100644 index 000000000..ca7742902 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVertexAttribs is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 8.0 will get clamped to 1.0 or white. + color = vec4(float(gl_MaxVertexAttribs) / 8.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag new file mode 100644 index 000000000..946dbd827 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVertexTextureImageUnits is set and that its + // value is greater than or equal to the minimum value. + if(gl_MaxVertexTextureImageUnits >= 0) + gl_FragColor = vec4(1.0); + else + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert new file mode 100644 index 000000000..28306594d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVertexTextureImageUnits is set and that its + // value is greater than or equal to the minimum value. + if(gl_MaxVertexTextureImageUnits >= 0) + color = vec4(1.0); + else + color = vec4(0.0, 0.0, 0.0, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag new file mode 100644 index 000000000..735c7d0ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVertexUniformVectors is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 128.0 will get clamped to 1.0 or white. + gl_FragColor = vec4(float(gl_MaxVertexUniformVectors) / 128.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert new file mode 100644 index 000000000..b9e1b3387 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // This test verifies that gl_MaxVertexUniformVectors is set and that its + // value is greater than or equal to the minimum value. + // Values greater than 128.0 will get clamped to 1.0 or white. + color = vec4(float(gl_MaxVertexUniformVectors) / 128.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt new file mode 100644 index 000000000..15c403b1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +biConstants_001_to_008.html +biConstants_009_to_016.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag new file mode 100644 index 000000000..0dcfe2a9a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +void main(void) +{ + gl_FragColor = vec4(gl_DepthRange.near, gl_DepthRange.far, gl_DepthRange.diff, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert new file mode 100644 index 000000000..6f8288c1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main(void) +{ + color = vec4(gl_DepthRange.near, gl_DepthRange.far, gl_DepthRange.diff, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html new file mode 100644 index 000000000..54177fd39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: biuDepthRange_001_to_002.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt new file mode 100644 index 000000000..21f2fd2e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +biuDepthRange_001_to_002.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag new file mode 100644 index 000000000..2fed27f6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + half h1; // Not a basic type. + half2 h2; // Not a basic type. + half3 h3; // Not a basic type. + half4 h4; // Not a basic type. + float2 f2; // Not a basic type. + float3 f3; // Not a basic type. + float4 f4; // Not a basic type. + fixed fx1; // Not a basic type. + fixed2 fx2; // Not a basic type. + fixed3 fx3; // Not a basic type. + fixed4 fx4; // Not a basic type. + float3x3 f3x3; // Not a basic type. + float2x4 f2x4; // Not a basic type. + half4x4 h4x4; // Not a basic type. +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag new file mode 100644 index 000000000..17bf049bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i = round(1.3); // round is not a built-in function. +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag new file mode 100644 index 000000000..768ecc1ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump int; +#endif + +int radians(int f) +{ + return f; +} + +void main() +{ + int f = 45; + f = radians(f); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag new file mode 100644 index 000000000..3a83174a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + float f; + vec3 v; +}; + +void main() +{ + const vec4 v = (vec4(1,2,3,4), vec4(5,6,7,8)); // 5,6,7,8 + const s s1 = (s(9.0, vec3(10,11,12)), s(13.0, vec3(14,15,16))); // 13,14,15,16 + gl_FragColor = v + vec4(s1.f, s1.v); // 18, 20, 22, 24 +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert new file mode 100644 index 000000000..6d92a68d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +void main() +{ + + const struct s2 { + int i; + vec3 v3; + bvec4 bv4; + } s22 = s2(8, vec3(9, 10, 11), bvec4(true, false, true, false)); + + struct s4 { + int ii; + vec4 v4; + }; + + const struct s1 { + s2 ss; + int i; + float f; + mat4 m; + s4 s44; + } s11 = s1(s22, 2, 4.0, mat4(5), s4(6, vec4(7, 8, 9, 10))) ; + + const int field3 = s11.i * s11.ss.i; // constant folding (int * int) + const vec4 field4 = s11.s44.v4 * s11.s44.v4; // constant folding (vec4 * vec4) + // 49, 64, 81, 100 + const vec4 v4 = vec4(s11.ss.v3.y, s11.m[3][3], field3, field4[2]); // 10.0, 5.0, 16.0, 81.0 + gl_Position = v4; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert new file mode 100644 index 000000000..8ed470d04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert @@ -0,0 +1,438 @@ + +/* +** 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. +*/ + + +void main() +{ + struct s5 { + float k; + }; + const struct s { + int i; + float j; + s5 s55; + } ss = s(4,1.0, s5(1.0)); + + + const struct s2 { + int i; + vec3 v3; + bvec4 bv4; + } s22 = s2(8, vec3(9, 10, 11), bvec4(true, false, true, false)); + + struct s4 { + int ii; + vec4 v4; + }; + + const struct s1 { + s2 ss; + int i; + float f; + mat4 m; + s4 s44; + } s11 = s1(s22, 2, 4.0, mat4(5), s4(6, vec4(7, 8, 9, 10))) ; + + + const struct s7 { + int i; + mat3 m3; + } s77 = s7(12, mat3(15)); + + vec2 v21 = vec2(1); // Not a constant + const vec2 v22 = vec2(11); // 11.0, 11.0 + const vec4 v41 = vec4(2); // 2.0, 2.0, 2.0, 2.0 + const vec4 v43 = vec4(4,4,4,4); // 4.0, 4.0, 4.0, 4.0 + const vec4 v44 = vec4(5.0, 5.0, 5.0, 5.0); // 5.0, 5.0, 5.0, 5.0 + const vec4 v45 = vec4(v22, v22); // 11.0, 11.0, 11.0, 11.0 + const vec4 v46 = vec4(vec2(20, 21), vec2(22, 23)); // 20.0, 21.0, 22.0, 23.0 + + const vec3 v31 = vec3(s22.v3); // 9.0, 10.0, 11.0 + const vec3 v32 = vec3(s77.m3); // 15.0, 0, 0 + const vec3 v33 = vec3(s77.m3[2]); // 0, 0, 15.0 + const vec3 v34 = vec3(s77.m3[2][0]); // 0,0,0 + + + const mat4 m41 = mat4(1); // 1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1 + const mat4 m42 = mat4(v44, v44, v44, v44); // all 5s + const mat4 m43 = mat4( v43.x); // 4,0,0,0,0,4,0,0,0,0,0,4,0,0,0,0,0,4 + + const vec4 v47 = vec4(m41[0][0]); // 1.0,1.0,1.0,1.0 + + const mat4 m45 = mat4(s22.v3, v44, v45, v32, 50, 52); //9,10,11,5,5,5,5,11,11,11,11,15.0, 0,0, 50.0, 52.0 + //const mat3 m31 = mat3(1, mat2(1), 2.0, vec3(1)); // 1.0, 1,0,0,1,2,1,1,1 + const vec4 v48 = vec4(v31[0], v22[1], v41[0], v43[3]); //9, 11, 2, 4 + const vec4 v49 = vec4(s22.v3.xy, s22.v3.zx); // 9,10,11,9 + const vec4 v410 = vec4(v44.xy, v43.zx); //5,5,4,4 + + const vec4 v411 = vec4(m42[3]); // 5,5,5,5 + const vec4 v412 = vec4(m43[2]); // 0,0,4,0 + + const vec2 v23 = vec2(m41); // 1,0 + + const vec2 v24 = vec2(33, s11.i); // 33, 2 + + const vec4 v413 = vec4(vec2(1.0,2.0),ivec2(3.0,4.0)); // 1,2,3,4 + const ivec4 i41 = ivec4(1.0, 2.0, 3.0, 4.0); // 1,2,3,4 + + const ivec4 i42 = ivec4(6); // 6,6,6,6 + const ivec4 i43 = ivec4(v45); //11,11,11,11 + + const ivec4 i44 = ivec4(v44[0]); // 5,5,5,5 + const ivec4 i45 = ivec4(vec2(20, 21), vec2(22, 23)); // 20, 21, 22, 23 + const vec4 v414 = vec4(ivec2(29, 30), ivec2(31, 32)); // 29.0, 30.0, 31.0, 32.0 + const ivec4 i46 = ivec4(ivec2(2.0,3.0), ivec3(4.0,5.0,6.0)); + const ivec4 i47 = ivec4(i46); // 2,3,4,5 + const ivec4 i48 = ivec4(v414.x); // 29,29,29,29 + + const ivec4 i49 = ivec4(vec4(1)); // 1,1,1,1 + const ivec4 i414 = ivec4(mat4(14)); // 14, 0,0,0, + const ivec4 i410 = ivec4(m43); // 4,0,0,0 + const ivec4 i411 = ivec4(m43[1]); // 0, 4, 0, 0 + const ivec4 i412 = ivec4(s77.i); // 12, 12, 12, 12 + const ivec4 i416 = ivec4(s22.v3.zyx, 12); // 11, 10, 9, 12 + + const vec4 v415 = vec4(ivec2(35), ivec2(36)); // 35.0, 35.0 ,36.0 , 36.0 + + const bvec4 b41 = bvec4(1.0, 2.0, 3.0, 4.0); // true,true,true,true + + const bvec4 b42 = bvec4(6); // true,true,true,true + const bvec4 b43 = bvec4(v45); //true,true,true,true + + const bvec4 b44 = bvec4(v44[0]); // true,true,true,true + const bvec4 b45 = bvec4(vec2(0, 21), vec2(0, 1)); // false, true, false, true + const bvec4 b46 = bvec4(ivec2(0.0,3.0), ivec3(0,5.0,6.0)); // false, true, false, true + const bvec4 b47 = bvec4(i46); // true,true,true,true + const bvec4 b48 = bvec4(v414.x); // true,true,true,true + + const bvec4 b49 = bvec4(vec4(0)); // false,false,false,false + const bvec4 b414 = bvec4(mat4(14)); // true, false,false,false, + const bvec4 b410 = bvec4(m43); // true,false,false,false + const bvec4 b411 = bvec4(m43[1]); // false, true, false, false + const bvec4 b412 = bvec4(s77.i) ; // true, true, true, true + + const vec3 v35 = vec3(s11.s44.v4); // 7.0,8.0,9.0 + + + struct s10 { + int k; + }; + struct s9 { + float f; + s10 s101; + }; + const struct s8 { + int i; + s9 s99; + } s88 = s8(1, s9(2.0, s10(5))); + + struct st4 { + int m; + vec3 v3; + }; + struct st3 { + int k; + int l; + st4 st44; + }; + struct st2 { + float f; + st3 st33; + }; + const struct st1 { + int i; + st2 st22; + } st11 = st1(1, st2(2.0, st3(5, 6, st4(7, v35)))); + + const vec4 v416 = vec4(s88.s99.s101.k); // all 5s + const vec4 v417 = vec4(st11.st22.st33.st44.v3, s88.s99.s101.k); // 7.0, 8.0, 9.0, 5.0 + const vec3 v36 = vec3(s11.ss.v3); // 9, 10, 11 + + vec4 v418 = v416; // all 5s + const float f1 = v416[0]; // 5.0 + vec4 v419; + v419.xyz = st11.st22.st33.st44.v3; + mat4 m47; + + struct struct2 { + int k; + } struct22 = struct2(4); + + const struct struct1 { + struct2 sst2; + } struct11 = struct1(struct2(2)); + + const vec4 v420 = v417; // 7.0, 8.0, 9.0 , 5.0 + + vec4 v421 = vec4(s11.m); // 5, 0, 0, 0 + vec4 v422 = v420; // 7.0, 8.0, 9.0 , 5.0 + + vec4 v423 = s11.s44.v4; // 7, 8, 9, 10 + + int int1 = ss.i * ss.i; // 16 + int int2 = ss.i * 2; // 8 + + const vec4 v425 = v420 * v420; // 49, 64, 81, 25 + const vec4 v426 = s11.m * s11.s44.v4; // 35, 40, 45, 50 + const vec4 v427 = s11.s44.v4 * s11.m; // 35, 40, 45, 50 + + float ff = 2.0; + const float ffConst = 2.0; + + vec4 v428 = ff + v425; // ordinary assignment with binary node + vec3 v39 = vec3(5); + + vec3 v310 = s22.v3 + v39; //14, 15, 16 + + const vec4 v429 = v420 + v420; // 14, 16, 18, 10 + const vec4 v430 = v420 + ffConst; // 9, 10, 11,7 + const vec4 v432 = v429 + s11.f; // 18, 20, 22, 14 + + const vec4 v433 = vec4(s11.f + s11.f); // all 8s + const vec4 v434 = v432 + vec4(3); // 21, 23, 25, 17 + const mat4 m48 = s11.m + ffConst; // diagonal 7s and others 2s + const mat4 m49 = mat4(ffConst + s11.f); // diagonal 6s + const mat4 m410 = m48 + s11.f; // diagonal 11, others - 6s + + const mat4 m413 = m48 + m48 ; // diagonal 14, others 4 + const mat4 m414 = m413 + ffConst ; // diagonal 16, others 6 + + const vec4 v435 = ffConst + v420; // 9, 10, 11,7 + const vec4 v436 = s11.f + v429; // 18, 20, 22, 14 + const mat4 m415 = ffConst + s11.m; // diagonal 7s and others 2s + const mat4 m416 = s11.f + m48 ; // diagonal 11, others - 6s + const mat4 m417 = ffConst + m413 ; // diagonal 16, others 6 + + const vec4 v437 = v420 - v420; // 0, 0, 0, 0 + const vec4 v438 = v420 - ffConst; // 5, 6, 7,3 + const vec4 v440 = v429 - s11.f; // 10, 12, 14, 6 + + const vec4 v441 = vec4(s11.f - s11.f); // all 0s + const vec4 v442 = v432 - vec4(3); // 15, 17, 19, 11 + const mat4 m418 = s11.m - ffConst; // diagonal 3s and others -2s + const mat4 m419 = mat4(ffConst - s11.f); // diagonal -> -2s + const mat4 m420 = m48 - s11.f; // diagonal 3, others -> -2 + + const mat4 m423 = m48 - m48 ; // All 0s + const mat4 m424 = m413 - ffConst ; // diagonal 12, others 2 + + const vec4 v443 = ffConst - v420; // -5, -6, -7,-3 + const vec4 v444 = s11.f - v429; // -10, -12, -14, -6 + const mat4 m425 = ffConst - s11.m; // diagonal -3s and others 2s + const mat4 m426 = s11.f - m48 ; // diagonal -3, others 2s + const mat4 m427 = ffConst - m413 ; // diagonal -12, others -2 + + const vec4 v445 = v420 * v420; // 49, 64, 81, 25 + const vec4 v446 = v420 * ffConst; // 14, 16, 18,10 + const vec4 v448 = v429 * s11.f; // 56, 46, 72, 40 + + const vec4 v449 = vec4(s11.f * s11.f); // all 16 + const vec4 v450 = v432 * vec4(3); // 54, 60, 66, 42 + const mat4 m428 = s11.m * ffConst; // diagonal 10 and others 0s + const mat4 m429 = mat4(ffConst * s11.f); // diagonal 8 + const mat4 m430 = m48 * s11.f; // diagonal 28, others 8 + + const mat4 m433 = m48 * m48 ; // diagonal 61, others 36 + const mat4 m434 = m413 * ffConst ; // diagonal 28, others 8 + + const vec4 v451 = ffConst * v420; // 14, 16, 18,10 + const vec4 v452 = s11.f * v429; // 56, 64, 72, 40 + const mat4 m435 = ffConst * s11.m; // diagonal 10 and others 0s + const mat4 m436 = s11.f * m48 ; // diagonal 28, others - 8s + const mat4 m437 = ffConst * m413 ; // diagonal 28, others 8 + + const vec4 v453 = v420 / v420; // 1, 1, 1, 1 + const vec4 v454 = v420 / ffConst; // 3.5, 4, 4.5,2.5 + + const vec4 v457 = vec4(s11.f / s11.f); // all 1s + const vec4 v458 = v432 / vec4(3); // 6, 6.6666, 7.333, 4.6666 + const mat4 m438 = s11.m / ffConst; // diagonal 2.5 and others 0s + const mat4 m439 = mat4(ffConst / s11.f); // diagonal 0.5s + const mat4 m440 = m48 / s11.f; // diagonal 1.75, others 0.5s + + const mat4 m443 = m48 / m48 ; // All 1s + const mat4 m444 = m413 / ffConst ; // diagonal 7, others 2 + + const vec4 v459 = ffConst / v420; // .2857 , .25, .22, .4 + const vec4 v460 = s11.f / v429; // .2857, .25, .22, .4 + //const mat4 m445 = ffConst / s11.m; // divide by zero error + const mat4 m446 = s11.f / m48 ; // diagonal .571, others 2 + const mat4 m447 = ffConst / m413 ; // diagonal .1428, others 0.5 + + const vec4 v461 = v453 * m428; // 10, 10, 10, 10 + const vec4 v462 = v453 * m437; // 52, 52, 52, 52 + const vec4 v463 = m428 * v451; // 140, 160, 180, 100 + const vec4 v464 = m437 * v451; // 744, 784, 824, 664 + + int ii = 2; + const int iiConst = 2; + + const ivec4 i420 = ivec4( 7,8,9,5); // 7, 8, 9, 5 + + const ivec4 i429 = i420 + i420; // 14, 16, 18, 10 + const ivec4 i430 = i420 + iiConst; // 9, 10, 11,7 + const ivec4 i432 = i429 + ss.i; // 18, 20, 22, 14 + + const ivec4 i433 = ivec4(ss.i + ss.i); // all 8s + + const ivec4 i435 = iiConst + i420; // 9, 10, 11,7 + const ivec4 i436 = ss.i + i429; // 18, 20, 22, 14 + + const ivec4 i437 = i420 - i420; // 0, 0, 0, 0 + const ivec4 i438 = i420 - iiConst; // 5, 6, 7,3 + const ivec4 i440 = i429 - ss.i; // 10, 12, 14, 6 + + const ivec4 i441 = ivec4(ss.i - ss.i); // all 0s + + const ivec4 i443 = iiConst - i420; // -5, -6, -7,-3 + const ivec4 i444 = ss.i - i429; // -10, -12, -14, -6 + + const ivec4 i445 = i420 * i420; // 49, 64, 81, 25 + const ivec4 i446 = i420 * iiConst; // 14, 16, 18,10 + const ivec4 i448 = i429 * ss.i; // 56, 64, 72, 40 + + const ivec4 i449 = ivec4(ss.i * ss.i); // all 16 + + const ivec4 i451 = iiConst * i420; // 14, 16, 18,10 + const ivec4 i452 = ss.i * i429; // 56, 64, 72, 40 + + const ivec4 i453 = i420 / i420; // 1, 1, 1, 1 + const ivec4 i454 = i420 / iiConst; // 3, 4, 4,2 + const ivec4 i456 = i429 / ss.i; // 3, 4, 4, 2 + + const ivec4 i457 = ivec4(ss.i / ss.i); // all 1s + + const ivec4 i459 = iiConst / i420; // 0 , 0, 0,0 + const ivec4 i460 = ss.i / i429; // 0, 0, 0,0 + + const bvec4 b424 = bvec4(s22.bv4); + + const bool b1 = s22.bv4 == b424; // true + const bool b2 = i420 == i420; // true + const bool b3 = i420 == i445; // false + const bool b4 = v420 == v420; // true + const bool b5 = m430 == m434; // true + + const vec4 v465 = -v420; // -7, -8, -9, -5 + const mat4 m448 = -m447 ; // diagonal -.1428, others -0.5 + const ivec4 i465 = -i456 ; // -3, -4, -4,-2 + + const bool b7 = s22 == s22; + + const vec4 v466 = v432 + vec4(3,4,5,6); // 21, 24, 27, 20 + const vec4 v467 = v432 + vec4(vec2(3,4),5,6); // 21, 24, 27, 20 + const vec4 v468 = v432 + vec4(3, vec2(4, 5),vec2(6,7)); // 21, 24, 27, 20 + const vec4 v469 = vec4(v468) + vec4(3) + v468 + vec4(s77.m3[2][0]); // 45, 51, 57, 43 + + const bool b8 = ss == ss; // true + + struct st6 { + vec3 v; + }; + + struct st5 { + int i; + float f; + st6 st66; + } st55; + + const st5 st551 = st5(2, 4.0, st6(vec3(7))); + const st5 st552 = st5(2, 4.0, st6(vec3(7))); + + const bool b10 = st551 == st552; // true + + const bool b11 = st551.st66 == st552.st66; // true + + const st5 st553 = st5(2, 4.0, st6(vec3(8))); + + const bool b12 = st551.st66 == st553.st66; // false + const bool b13 = st551 == st553; // false + + const bool b14 = st551 != st552; // false + const bool b15 = st551.st66 != st552.st66; // false + const bool b16 = st551.st66 != st553.st66; // true + const bool b17 = st551 != st553; // true + + const bool b18 = s22.bv4 != b424; // false + const bool b19 = i420 != i420; // false + const bool b20 = i420 != i445; // true + const bool b21 = v420 != v420; // false + const bool b22 = m430 != m434; // false + + const int int10 = i420.xy.y; // 8 + + //float f = v470.x; + + + + const int int13 = -ss.i; + + const vec4 v474 = -vec4(0.5); + + int int14 = ii++; + int array[3]; + array[2]; + + const vec4 v478 = v466 * 2.0; // 42, 48, 54, 40 + + const vec4 v479 = iiConst > 1 ? v466 : v478; // 21, 24, 27, 20 + + const struct st7 { + int i; + bool b; + } st77 = st7(ss.i, true); + + const vec4 v481 = vec4(st77.i); + + const struct st8 { + int i; + } ; + + + const struct st9 { + s2 ss; + } st99 = st9(s22); + + const vec3 v312 = st99.ss.v3; // 9, 10, 11 + const vec4 v482 = mat4(1)[0]; // 1, 0, 0 , 0 + + const mat4 m450 = mat4(ss.i); // mat4(4) + const mat4 m451 = mat4(b20); // mat4(1) + const mat4 m452 = mat4(st77.b); // mat4(1) + + const vec4 v483 = vec4(vec4(3).x); // 3,3,3,3 + const mat4 m453 = mat4(vec4(5).x); // mat5(5) + + const vec4 v484 = vec4(mat4(6)[1]); // 0,6,0,0 + const mat4 m454 = mat4(mat4(6)[1][1]); // mat4(6) + + const vec4 v485 = vec4(st7(8, true).b); // 1,1,1,1 + + const vec4 v487 = vec4(vec4(12, 13, 14, 15).ab, 12, 14); + + int i20 = ss.i; + const vec4 v489 = -vec4(7,8,9,5); // -7, -8, -9, -5 + + gl_Position = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert new file mode 100644 index 000000000..79a63720f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +struct s { + float f; +} s1 = s(1.0); + +struct s3 { + int i; +} s3Inst; + +struct s2 { + float f; + s3 s3Inst; +} s2Inst = s2(1.0, s3(1)); + +void main() +{ + vec3 i = vec3(5.0, 4.0, ivec2(2.0, 1.0)); + ivec4 v2 = ivec4(1.0); + vec4 v4 = vec4(v2); + bvec4 v5 = bvec4(v2); + vec3 v6 = vec3(v5); + vec3 v = vec3(2, 2.0, 1); + vec3 v1 = vec3(1.2, v); + + mat3 m1 = mat3(v,v,v); + mat2 m2 = mat2(v, v6.x); + + gl_Position = vec4(1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag new file mode 100644 index 000000000..6582b57f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#version 100 +#extension extensionfoo : enable // warning extension not supported +#extension extensionfoo : disable // warning extension not supported +#extension extensionfoo : warn // warning extension not supported + +#extension all : disable // no error in the program +#extension all : warn // no error in the program + +#extension extensionfoo : enable // warning extension not supported +#extension extensionfoo : disable // warning extension not supported +#extension extensionfoo : warn // warning extension not supported +#ifdef GL_ES +precision mediump float; +#endif + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag new file mode 100644 index 000000000..eec6d43fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#extension all : disable // no error in the program +#extension all : warn // no error in the program +#ifdef GL_ES +precision mediump float; +#endif + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag new file mode 100644 index 000000000..18f3a4877 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#extension extensionfoo : enable // warning extension not supported +#extension extensionfoo : disable // warning extension not supported +#extension extensionfoo : warn // warning extension not supported +#ifdef GL_ES +precision mediump float; +#endif + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert new file mode 100644 index 000000000..1d13e58f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert @@ -0,0 +1,671 @@ + +/* +** 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. +*/ + + +struct gtf_MaterialParameters +{ +vec4 emission; +vec4 ambient; +vec4 diffuse; +vec4 specular; +float shininess; +}; +struct gtf_LightSourceParameters +{ +vec4 ambient; +vec4 diffuse; +vec4 specular; +vec4 position; +vec4 halfVector; +vec3 spotDirection; +float spotExponent; +float spotCutoff; +float spotCosCutoff; +float constantAttenuation; +float linearAttenuation; +float quadraticAttenuation; +}; +struct gtf_PointParameters { +float size; +float sizeMin; +float sizeMax; +float fadeThresholdSize; +float distanceConstantAttenuation; +float distanceLinearAttenuation; +float distanceQuadraticAttenuation; +}; +struct gtf_DepthRangeParameters { +float near; +float far; +float diff; +}; +struct gtf_LightModelParameters { +vec4 ambient; +}; +struct gtf_LightModelProducts { +vec4 sceneColor; +}; +struct gtf_LightProducts { +vec4 ambient; +vec4 diffuse; +vec4 specular; +}; +struct gtf_FogParameters { +vec4 color; +float density; +float start; +float end; +float scale; +}; +uniform int gtf_MaxFragmentUniformComponents; +uniform int gtf_MaxVertexUniformComponents; +uniform int gtf_MaxVertexTextureImageUnits; +uniform int gtf_MaxLights; +uniform int gtf_MaxClipPlanes; +uniform int gtf_MaxCombinedTextureImageUnits; +uniform int gtf_MaxTextureCoords; +uniform int gtf_MaxVertexAttribs; +uniform int gtf_MaxVaryingFloats; +uniform int gtf_MaxTextureUnits; +uniform int gtf_MaxDrawBuffers; +uniform int gtf_MaxTextureImageUnits; +uniform gtf_LightProducts gtf_FrontLightProduct[8]; +uniform gtf_LightModelProducts gtf_FrontLightModelProduct; +uniform gtf_DepthRangeParameters gtf_DepthRange; +uniform gtf_FogParameters gtf_Fog; +uniform gtf_PointParameters gtf_Point; +uniform gtf_LightModelParameters gtf_LightModel; +varying vec4 gtf_FogFragCoord; +varying vec4 gtf_BackColor; +varying vec4 gtf_BackSecondaryColor; +varying vec4 gtf_FrontSecondaryColor; +varying vec4 gtf_TexCoord[2]; +varying vec4 gtf_FrontColor; +uniform gtf_MaterialParameters gtf_FrontMaterial; +uniform gtf_LightSourceParameters gtf_LightSource[8]; +attribute vec4 gtf_MultiTexCoord1; +attribute vec4 gtf_MultiTexCoord2; +attribute vec4 gtf_SecondaryColor; +attribute vec4 gtf_Color; +attribute vec4 gtf_MultiTexCoord3; +attribute vec4 gtf_MultiTexCoord0; +attribute vec4 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_NormalMatrix; +uniform mat4 gtf_ProjectionMatrix; +uniform mat4 gtf_TextureMatrix[8]; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +void test_function(const in int in_int, inout int out_int); +int test_function1(in int in_int1, inout int in_out_int); + +uniform float array_float[2]; + +struct nested +{ + int a; + float f; +}; + +struct light1 +{ + float intensity; + vec3 position; + int test_int[2]; + nested light2; +} lightVar; +light1 ll2; + +void Assign (out light1 out1, in light1 in1) +{ + out1.intensity = in1.intensity; + out1.position = in1.position; + out1.test_int[0] = in1.test_int[0]; + out1.test_int[1] = in1.test_int[1]; + out1.light2 = in1.light2; +} + +struct light3 { + float i; +}; + +struct light4 { + float i; +}; + +struct light5 { + float i ; + float a[2]; +} light5_inst; + +uniform light3 uniformLight3; + +struct light6 { + float i; +}; +uniform light6 uniformLight6; + +struct slight10{ + float f; + }; +struct slight9{ + slight10 light10; + }; +struct slight8{ + slight9 light9; + }; +struct light7 { + slight8 light8; +} ; + + +light3 struct_var = light3(5.0); + +// Attribtue variables can only be Global +attribute float flt_attrib; +attribute vec2 vec2_attrib; +attribute vec3 vec3_attrib; +attribute vec4 vec4_attrib; +attribute mat2 mat2_attrib; +attribute mat3 mat3_attrib; +attribute mat4 mat4_attrib; + +uniform float flt_uniform; +uniform vec3 uniform_vec3; +uniform mat3 uniform_mat3; + +uniform sampler2D samp[3]; +uniform sampler2D samp1; + +const struct light12 { + int a; +} uniform_struct = light12(2); + +varying vec3 varying_vec3; +varying vec2 varying_vec2; +varying vec4 varying_vec4; +varying mat4 varying_mat4; +varying mat2 varying_mat2; +varying mat3 varying_mat3; +varying float varying_flt; + +float frequencies[2]; + +void test_function2(int func_int) +{ +} + +void test_function3(light3); +void test_function4(light5 ll20); +void test_function5(light1); +light6 test_function6(int a); + +const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0; +const bool BoolConst1 = true && true || false; +const bool BoolConst2 = false || !false && false; + +void main(void) +{ + + int test_int1 = 2; + const int const_test_int1 = 2; + + struct structMain { + float i; + } testStruct; + + struct { + structMain a; + } aStruct; + + testStruct.i = 5.0 ; + struct_var.i = 5.0; + + structMain newStruct, newStruct1; + testStruct = newStruct; + newStruct = newStruct1; + + lightVar.light2.f = 1.1; + + light1 ll1; + ll1.light2.a = 1; + + const struct const_struct { + float i; + } const_struct_inst = const_struct(1.0); + + //ll1 = ll2; + Assign (ll1, ll2); + ll1.light2 = ll2.light2; + ll1.light2 = ll1.light2; + ll1.light2.f = ll2.light2.f; + ll1.light2.f = ll1.light2.f; + + // lightVar = ll2; + // ll2 = lightVar; + Assign (lightVar, ll2); + Assign (ll2, lightVar); + + light5 ll10; + + light7 ll7[4]; + structMain newStruct2[2]; + newStruct2[0].i = 1.1; + + ll7[0].light8.light9.light10.f = 1.1; + + + bool test_bool4 = false ; + + bool test_bool5 = 1.2 > 3.0 ; + + int test_int2 = 047; + int test_int4 = 0xa8; // testing for hexadecimal numbers + + float test_float1 = 1.5; + float test_float2 = .01; + float test_float3 = 10.; + float test_float4 = 10.01; + float test_float5 = 23e+2; + float test_float6 = 23E-3; + float test_float8 = 23E2; + bool test_bool6 = BoolConst1 && ! (test_int1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (test_float1 != 0.0); + + vec4 color = vec4(0.0, 1.0, 0.0, 1.0); + vec4 color2 = vec4(0.0); + + vec3 color4 = vec3(test_float8); + + ivec4 test_int_vect1 = ivec4(1.0,1.0,1.0,1.0); + ivec3 test_int_vec3 = ivec3(1, 1, 1) ; + + bvec4 test_bool_vect1 = bvec4(1., 1., 1. , 1. ); + + vec2 test_vec2 = vec2(1., 1.); + vec2 test_vec3 = vec2(1., 1); + vec4 test_vec4 = vec4(test_int_vect1); + + vec2 test_vec5 = vec2(color4); + vec3 test_vec7 = vec3(color); + vec3 test_vec8 = vec3(test_vec2, test_float4); + vec3 test_vec9 = vec3(test_float4, test_vec2); + + vec4 test_vec10 = vec4(test_vec9, 0.01); + vec4 test_vec11 = vec4(0.01, test_vec9); + + vec4 test_vec12 = vec4(test_vec2, test_vec2); + + mat2 test_mat2 = mat2(test_float3); + mat3 test_mat3 = mat3(test_float3); + mat4 test_mat4 = mat4(test_float3); + + mat2 test_mat7 = mat2(test_vec2, test_vec2); + mat2 test_mat8 = mat2(01.01, 2.01, 3.01, 4.01); + + mat3 test_mat9 = mat3(test_vec7, test_vec7, test_vec7); + mat4 test_mat10 = mat4(test_vec10, test_vec10, test_vec10, test_vec10); + test_mat10[1] = test_vec10; + + + mat2 test_mat12 = mat2(test_vec2, 0.01, 0.01); + mat2 test_mat13 = mat2(0.01, 5., test_vec2); + mat2 test_mat15 = mat2(0.1, 5., test_vec2 ); + + //mat2 test_mat16 = mat2(test_mat9); + //mat2 test_mat17 = mat2(test_mat10); + + float freq1[2]; + float freq2[25]; + + for (int i=0; i<100; i++) + { + if (test_float1 < 1.0) + { + + } + else + { + break; + } + } + + freq2[1] = 1.9 ; + const int array_index = 2; + freq2[const_test_int1] = 1.9 ; + freq2[array_index] = 1.8; + + const int const_int = 5; + + test_float1 = varying_flt; + + int out_int; + int intArray[6]; + test_function(test_int1, test_int1); + test_function(test_int1, intArray[2]); + + vec3 vv = vec3(test_function1(test_int1, out_int)); + bool bool_var = true; + int test_int6 = int(bool_var); + test_float1 = float(bool_var); + test_float1 = float(test_int6); + test_int6 = int(test_float1); + bool_var = bool(test_int6); + bool_var = bool(test_float1); + test_float1 = float(test_vec9); + + test_vec2.x = 1.2; + test_vec2.y = 1.4; + test_vec2.xy; + + + color.zy = test_vec2; + + test_vec2[1] = 1.1; + + test_mat2[0][0] = 1.1; + + test_float1 += 1.0; + test_float1 -= 1.0; + test_float1 *= 1.0; + test_float1 /= 1.0; + + test_mat12 *= test_mat13 ; + test_mat12 *= test_float1; + test_vec2 *= test_float1; + test_vec2 *= test_mat12; + test_float1++; + test_float1--; + --test_float1; + ++test_float1; + test_float1; + test_int1++; + test_int1--; + + test_vec2 = test_vec2 + test_float1; + test_vec2 = test_float1 + test_vec2; + + test_mat12 = test_mat12 * test_mat13; + test_vec2 = test_vec2 * test_vec5; + + test_vec2++; + test_mat2++; + + bool test_bool2 = test_float2 > test_float3; + + bool test_bool3 = test_int1 > test_int6 ; + + test_bool3 = test_vec2 == test_vec5; + + test_bool2 = test_bool3 && test_bool4; + test_bool2 = test_bool3 || test_bool4; + test_bool2 = test_bool3 ^^ test_bool4; + + test_bool2 = !test_bool3; + + test_bool3 = !(test_int1 > test_int6) ; + + test_float1 = test_int1 > test_int6 ? test_float2 : test_float3; + test_vec2 = test_int1 > test_int6 ? test_vec2 : test_vec5; + if(test_bool2) + test_float1++; + else + test_float1--; + + if(test_float1 > test_float2) + test_float1++; + + if( test_bool2 ) + { + int if_int; + test_float1++; + } + + if(test_bool2) + if(test_bool3) + if(test_bool3) + test_float1++; + + for(int for_int=0; for_int < 5; for_int++) + { + // do nothing as such + } + + + for(int x1=0; x1 < 10; x1++) + { + if (!test_bool2) + break; + + int for_int; + } + + for(int x2=-10; x2 < 100; x2++) + { + test_bool2 = (test_float1 > test_float2); + if (!test_bool2) + break; + } + + for(int for_int1 = 0; for_int1 < 100; for_int1++) + { + if (!test_bool2) + break; + + int for_int; + } + + for(int for_int1 = 0; for_int1 < 100; for_int1++) + { + if (!test_bool2) + continue; + + int for_int; + } + + + for(int i=0; i<100; i++) + { + if (!(test_float1 > test_float2)) + { + break; + } + + break; + continue; + } + + for(int i=0; i<100; i++) + { + if (!test_bool2) + break; + + break; + } + + for (int i=0; i<100; i++) + { + int dowhile_int; + dowhile_int = 3; + + if (!test_bool2) + break; + } + + gl_Position = vec4(2.0, 3.0, 1.0, 1.1); + gl_Position = gtf_Vertex; + + + // VERTEX SHADER BUILT-IN ATTRIBUTES + + vec4 builtInV4 = gtf_Color + gtf_SecondaryColor + gtf_Vertex + gtf_MultiTexCoord0 + gtf_MultiTexCoord1 + gtf_MultiTexCoord2 + gtf_MultiTexCoord3; + + + int builtInI = gtf_MaxLights + gtf_MaxClipPlanes + gtf_MaxTextureUnits + gtf_MaxTextureCoords + gtf_MaxVertexAttribs + gtf_MaxVertexUniformComponents + gtf_MaxVaryingFloats + gtf_MaxVertexTextureImageUnits + gtf_MaxCombinedTextureImageUnits + gtf_MaxTextureImageUnits + gtf_MaxFragmentUniformComponents + gtf_MaxDrawBuffers ; + + + mat4 builtInM4 = gtf_ModelViewMatrix + gtf_ModelViewProjectionMatrix + gtf_ProjectionMatrix; + + gtf_NormalMatrix; + + gtf_TextureMatrix[gtf_MaxTextureCoords-1]; + gtf_TextureMatrix; + + gtf_DepthRange.near ; + + test_float1 = gtf_DepthRange.near; + test_float1 = gtf_DepthRange.far; + test_float1 = gtf_DepthRange.diff; + + gtf_Point.size; + gtf_Point.sizeMin; + gtf_Point.sizeMax; + gtf_Point.fadeThresholdSize ; + gtf_Point.distanceConstantAttenuation; + gtf_Point.distanceLinearAttenuation ; + gtf_Point.distanceQuadraticAttenuation; + + gtf_MaterialParameters test; + gtf_FrontMaterial.emission; + + color = gtf_FrontMaterial.emission; + color = gtf_FrontMaterial.ambient; + color = gtf_FrontMaterial.diffuse; + color = gtf_FrontMaterial.specular; + test_float1 = gtf_FrontMaterial.shininess; + + gtf_LightSourceParameters lightSource; + + float builtInFloat1 = gtf_LightSource[0].spotExponent; + color = gtf_LightSource[0].ambient; + color = lightSource.ambient; + color = lightSource.diffuse; + color = lightSource.specular; + color = lightSource.position; + color = lightSource.halfVector; + color4 = lightSource.spotDirection; + test_float1 = lightSource.spotExponent; + test_float1 = lightSource.spotCutoff; + test_float1 = lightSource.spotCosCutoff; + test_float1 = lightSource.constantAttenuation; + test_float1 = lightSource.linearAttenuation; + test_float1 = lightSource.quadraticAttenuation; + + color = gtf_LightModel.ambient; + + gtf_LightModelParameters lightModel; + color = gtf_LightModel.ambient; + color = lightModel.ambient; + + color = gtf_FrontLightModelProduct.sceneColor ; + + gtf_LightModelProducts lightModelProd; + + color = lightModelProd.sceneColor; + color = gtf_FrontLightModelProduct.sceneColor; + + color = gtf_FrontLightProduct[0].ambient; + color = gtf_FrontLightProduct[0].ambient; + gtf_LightProducts lightProd; + + color = lightProd.ambient; + color = lightProd.diffuse; + color = lightProd.specular; + + + test_float1 = gtf_Fog.density ; + test_float1 = gtf_Fog.start ; + test_float1 = gtf_Fog.end ; + test_float1 = gtf_Fog.scale ; + color = gtf_Fog.color ; + + gtf_FrontColor = vec4(1.0, 1.0, 1.0, 1.0); + gtf_BackColor = vec4(1.0, 1.0, 1.0, 1.0); + gtf_FrontSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0); + gtf_BackSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0); + + + // VARYING VARIABLES AVAILABLE IN FRAGMENT AND VERTEX SHADERS BOTH + gtf_TexCoord[0] = vec4(1.0, 1.0, 1.0, 1.0); + gtf_FogFragCoord = vec4(1.0, 1.0, 1.0, 1.0); + +} + +void test_function(const in int in_int, inout int out_int) +{ + out_int = 5; + int i = 5; + return ; +} + +int test_function1(in int in_int1, inout int in_out_int) +{ + float ff; + in_int1 = 5; + return in_int1; +} + +void test_function3(light3 ll) +{ + ll.i = 5.0; + varying_flt = 1.2; +} + +void test_function4(light5 ll20) +{ + ll20.i = 10.0; +} + +void test_function5(light1 struct_light1) +{ + struct_light1.light2.a = 1; + light5 ll5; + struct_light1.light2.f = ll5.i; + struct_light1.light2.f++; + struct_light1.light2.a++; +} + +light6 test_function6(int a) +{ + int x; + light6 funcStruct; + light7 funcStruct1; + -x; + x = x - x ; + mat2 m; + m++; + -m; + (m)++; + return funcStruct; +} + +float test_function7(light1 ll1, int light1 ) +{ + float f; + + struct ss1 { + int a; + }; + + return float(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag new file mode 100644 index 000000000..4bd543b62 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void testVoid (vec4 v, vec4 v1) +{ +} + +void testVoid (ivec4 v, ivec4 v1) +{ +} + +void main(void) +{ + vec4 v; + ivec4 i; + testVoid(i, i); + testVoid(v, v); + gl_FragColor = v; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert new file mode 100644 index 000000000..bd798e61a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +struct S2 +{ + float f; +}; + +struct S1 +{ + float f; + S2 s2; +}; + +float process(S1 s1); +float process(S2 s2); + +void main() +{ + S1 s1 = S1(1.0, S2(1.0)); + gl_Position = vec4(process(s1)); +} + +float process(S1 s1) +{ + return s1.f + process(s1.s2); +} + +float process(S2 s2) +{ + return s2.f; +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert new file mode 100644 index 000000000..b040dae31 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +vec3 bar(vec3, vec3); + +uniform vec2 v; + +bool foo(out vec3); + +void main() +{ + bool b1, b2, b3, b4, b5, b6; + + b1 = any(lessThan(v, v)); + + b2 = all(lessThanEqual(v, v)); + + b3 = any(not(greaterThan(v, v))); + + b4 = any(greaterThanEqual(v, v)); + + b5 = any(notEqual(v, v)); + + b6 = any(equal(v, v)); + + vec2 u; + if (b1 && b2 && b3 && b4 && b5 && b6) + u = v; + + gl_Position = vec4(u, u); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag new file mode 100644 index 000000000..67e842834 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag @@ -0,0 +1,81 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +vec4 test_function4(float); +vec4 test_function1(float); +vec4 test_function2(float); +vec4 test_function3(float); +float f = 2.6; + + +vec4 test_function1(float ff) +{ + vec4 func_vec4 = vec4(ff+f); + return func_vec4; +} + +float f1 = 1.5; + +vec4 test_function4(float ff) +{ + vec4 func_vec4 = vec4(f1); + return func_vec4; +} + +float f2 = 3.5; + +void main() +{ + vec4 v1 = test_function4(f2); + vec4 v2 = test_function1(f2); + vec4 v3 = test_function2(f2); + vec4 v4 = test_function3(f2); + + if (f1 > f2) { + gl_FragColor = v1 + v2 + v3 + v4; + } else + gl_FragColor = v1 + v2 + v3 + v4; +} + +float f4 = 5.5; +vec4 test_function3(float ff) +{ + if (ff > f4) + return vec4(ff); + else + return vec4(f4); +} + +float f3 = 4.5; +vec4 test_function2(float ff) +{ + vec4 func_vec4 = vec4(ff+f3); + return func_vec4; +} + +float f5 = 6.5; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag new file mode 100644 index 000000000..9f3e9b132 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag @@ -0,0 +1,68 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec3 a[8]; + +uniform bool ub; +varying mat4 vm; + +int foo(float); + +float bar(int i) +{ + return float(i); +} + +void main (void) +{ + const int x = 3; + mat4 a[4]; + vec4 v; + + for (float f = 0.0; f != 3.0; ++f) + { + } + + vec3 v3[x + x]; + + int vi = foo(2.3); + + vec3 v3_1 = v3[x]; + + float f1 = a[x][2].z * float(x); + f1 = a[x][2][2] * float(x); + f1 = v[2] * v[1]; + + const int ci = 2; + +} + +int foo(float f) +{ + return 2; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag new file mode 100644 index 000000000..20d30c26b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag @@ -0,0 +1,153 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0; +const bool BoolConst1 = true && true || false; +const bool BoolConst2 = false || !false && false; + +void main (void) +{ + float float1 = 4.0, float2 = floatConst2; + int int_1 = int(FloatConst1); + vec4 vec4_1; + vec3 vec3_1; +// unsigned int unsigned_int_1; + bool bool4, bool5; + + bool4 = bool5; + //float1 = bool5; + //bool5 = float1; + + bool4 = 4.0 > 5.0; + bool4 = !(3.2 != 0.0); + bool4 = bool(float1); + bool4 = bool(int_1); + float1 = float(bool4); + float1 = float(int_1); + int_1 = int(float1); + int_1 = int(bool4); + + { + int a, b, c; + + a = b; + b = c; + { + int b, c, d; + + b = c; + c = d; + { + int a, d, e; + + a = d; + d = e; + } + { + int a, b, c; + a = b; + b = c; + } + } + a = b; + b = c; + } + + { + float f1, f2; + vec3 v31, v32; + + max(f1, f2); + max(v31, v32); + + vec4 v4 = vec4(3.0); + vec3 v3 = -vec3(2.0, 1.0, 3.0); + mat2 m2 = mat2(3.0, 4.0, 6.0, 3.0); + //mat4 m4 = mat4(1.0, m2, v3, v4, m2); + } + + if (BoolConst1) + ++vec3_1; + else + --vec3_1; + + if (BoolConst2) + ++vec3_1; + else + --vec3_1; + + if (BoolConst1 || BoolConst2) + ++vec3_1; + else + --vec3_1; + + if (BoolConst2 && BoolConst1) + ++vec3_1; + else + --vec3_1; + + if (FloatConst1 != 0.0) + --int_1; + else + ++int_1; + + if (0 != 0) + ++int_1; + else + --int_1; + + bool4 = BoolConst1 && ! (int_1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (float1 != 0.0); + + float1 = 5 != 0 ? float1 : float(int_1); + float1 = 0 != 0 ? float1 : float(int_1); + + if (float1 != float1) + ++int_1; + else + --int_1; + + float1 = float1 != float1 ? float1 : float(int_1); + + --int_1; + ++float1; + (vec4_1.x)--; + vec3_1++; + + if (int_1 != 4) + discard; + + float1 = 4.0 + 6.0; + int ii,jj,kk; + float ff; + ii = jj, kk, ff; + + vec4_1 = vec4_1 + 2.0; + ivec4 iv; + iv = iv + 2; + gl_FragColor = vec4(float1+float1, float1, float1, float(int_1)); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert new file mode 100644 index 000000000..de66c0a3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert @@ -0,0 +1,166 @@ + +/* +** 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. +*/ + + +const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0; +const bool BoolConst1 = true && true || false; +const bool BoolConst2 = false || !false && false; + +void main (void) +{ + float float1 = 4.0, float2 = floatConst2; + int int_1 = int(FloatConst1); + vec4 vec4_1; + vec3 vec3_1 = vec3(1, 1, 1); + vec3 vec3_2 = vec3(0, 0, 0); +// unsigned int unsigned_int_1; + bool bool4, bool5; + + bool4 = bool5; + //float1 = bool5; + //bool5 = float1; + + bool4 = 4 > 5; + bool4 = !(3.2 != 0.0); + bool4 = bool(float1); + bool4 = bool(int_1); + float1 = float(bool4); + float1 = float(int_1); + int_1 = int(float1); + int_1 = int(bool4); + + { + int a, b, c; + + a = b; + b = c; + { + int b, c, d; + + b = c; + c = d; + { + int a, d, e; + + a = d; + d = e; + } + { + int a, b, c; + a = b; + b = c; + } + } + a = b; + b = c; + } + + { + float f1, f2; + vec3 v31, v32; + + max(f1, f2); + max(v31, v32); + + vec4 v4 = vec4(3.0); + vec3 v3 = -vec3(2.0, 1.0, 3.0); + mat2 m2 = mat2(3.0, 4.0, 6.0, 3.0); + //mat4 m4 = mat4(1.0, m2, v3, v4, m2); + } + + if (BoolConst1) + ++vec3_1; + else + --vec3_1; + + if (BoolConst2) + ++vec3_1; + else + --vec3_1; + + if (BoolConst1 || BoolConst2) + ++vec3_1; + else + --vec3_1; + + if (BoolConst2 && BoolConst1) + ++vec3_1; + else + --vec3_1; + + if (FloatConst1 != 0.0) + --int_1; + else + ++int_1; + + if (0 != 0) + ++int_1; + else + --int_1; + + bool4 = BoolConst1 && ! (int_1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (float1 != 0.0); + + float1 = 5 != 0 ? float1 : float(int_1); + float1 = BoolConst1 ? float1 : float(int_1); + + if (float1 != float1) + ++int_1; + else + --int_1; + + float1 = float1 != float1 ? float1 : float(int_1); + + --int_1; + ++float1; + (vec4_1.x)--; + vec3_1++; + + if (vec3_1.x > vec3_2.x) + float1 = 4.0 + 6.0; + + if (bool4 ^^ bool5) + float1 *= 2.4; + + if (false ^^ false) + float1 *= 2.5; + + if (true ^^ false) + float1 *= 2.6; + + { + int i; + } + + if (bool4) { + int i; + } else { + int i; + i = 5; + } + + mat4 m1; + m1[2][1] = 4.0; + + gl_Position = vec4(float1+float1, float1, float1, float(int_1)); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag new file mode 100644 index 000000000..952913b1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + vec4 v; +} s2; + +void main() +{ + s s1 = s(vec4(ivec4(4.0, vec2(5,6), 7.0))); + vec4 v = vec4(2,ivec2(3.0, 4.0), 5.0); + vec4 v4 = vec4(ivec4(8.0)); + + gl_FragColor = v4 + v + s1.v; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag new file mode 100644 index 000000000..285738052 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s{ + float f; + vec3 v; +} s1 ; +void main() +{ + vec4 v = vec4(float(vec2(1,2)), 5,6,7); // 1, 5, 6, 7 + vec4 v1 = vec4(3, vec2(ivec2(1,2)), 4); // 3, 1, 2, 4 + vec4 v2 = vec4(8, 9, vec4(ivec4(1,2,3,4))); // 8,9, 1,2 + vec2 v3 = vec2(v2); // 8,9 + vec4 v4 = vec4(v3, v2.z, v2.w); // 8,9,1,2 + + const vec4 v5 = vec4(2.0, s(2.0, vec3(3,4,5)).v); // 2,3,4,5 + gl_FragColor = v5 + v + v1 + v4 ; // 14, 18, 13, 18 +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag new file mode 100644 index 000000000..c92511b38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +//mutiple line macros - test case. + +#define test 5 +#define t1 1 +#define t2 2 +#define token (t1+t2) +#define test1 int sum =1; sum = test; sum = test+test; + +#define test2 { test1 sum = sum +token; sum = t2*t1; } + +void main(void) +{ + int test3=1; + test1 + test2; + test3 = test; + sum = test3; +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag new file mode 100644 index 000000000..1e67e2730 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag @@ -0,0 +1,132 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// Extensive testing on #if #else #elif #ifdef, #ifndef and #endif. + + +#define t1 1 + +#if(t1==1) + #define t2 2 +#endif + +#if (t2!=2) + #define t3 33 +#else + #define t3 3 +#endif + +#if (t3!=3) + #define t4 4 +#elif (t3==3) + #define t4 44 +#else + #define t4 0 +#endif + +#if defined(t5) + #define t6 6 +#elif (t3!=3) + #define t5 5 +#elif (t3==3) + #define t5 5 +#endif + +#ifdef t5 + #define t6 6 +#else + #define t7 7 +#endif + +#ifndef t8 + #define t8 8 +#endif + +#if defined t8 + #define t9 + #ifdef t9 + #define t10 10 + #endif +#elif + #define t11 11 +#endif + +#ifndef t8 + #define t12 12 +#else + #define t12 12 + #ifndef t13 + #define t13 13 + #endif + #ifdef t14 + #define t15 15 + #else + #if defined t8 + #define t16 16 + #endif + #endif +#endif + +#ifdef t1 + #ifdef t10 + #if defined t8 + #if defined(t3) + #ifndef t20 + #define t25 25 + #endif + #else + #define t15 15 + #define t24 24 + #endif + #endif + #endif +#else + #ifdef t21 + #define t22 22 + #else + #define t23 23 + #endif +#endif +#define t7 7 +#define t11 11 +#define t14 14 +#define t15 15 +#define t20 20 +#define t22 22 +#define t23 23 +#define t24 42 + +void main(void) +{ + int sum =0; + sum = t1+t2+t3+t4+t5; + sum = t6+t7+t8+t9+t10; + sum = t11+t12+t13+t14+t15; + sum = t16+t20+t22+t23+t25+t24; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag new file mode 100644 index 000000000..25a7d7474 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#define t1 2.3333333333333333 +#define t2 (0.978293600-1.0) +#define t3 .9090909090 +#define t4 26578235.000000083487 +#define t5 78e-03 +#define t6 78.100005E+05 +#define t7 6278.78e-5 + +void main(void){ + float tes=2e-3; + float test=3.2e-5; + float test1=0.99995500; + float test2=6789.983; + + test = t1+t2; + test = t3-t4; + tes = t5 * t6; + test2 = t7; + + gl_FragColor = vec4(test, tes, test1, test2); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag new file mode 100644 index 000000000..85c24f8fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v = vec2(1,5); + // at the end of next statement, values in + // v.x = 12, v.y = 12 + v.xy += v.yx += v.xy; + // v1 and v2, both are initialized with 12 + vec2 v1 = v, v2 = v; + + v1.xy += v2.yx += ++(v.xy); // v1 = 37, v2 = 25 each + v1.xy += v2.yx += (v.xy)++; // v1 = 75, v2 = 38 each + gl_FragColor = vec4(v1,v2); // 75, 75, 38, 38 +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert new file mode 100644 index 000000000..8875d94e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Normal; +uniform mat4 gtf_NormalMatrix; +void main(void) +{ + vec4 v = vec4(1,2,3,4); + vec3 v3 = vec3(5,6,7); + vec4 v4 = vec4(normalize(v3.yzy).xyz.zyx, 1.0); + gl_Position = v4 + vec4(normalize(gtf_NormalMatrix * gtf_Normal).xyz.zyx, v4.y); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag new file mode 100644 index 000000000..5c946606b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f, f1, f2; + f = f1 = f2; + f += f1 += f2; + + vec4 v, v1, v2; + v = v1 = v2; + v += v1 += v2; + v.wx = v1.zx = v2.yx; + v.wx += v1.zx += v2.yx; + + mat4 m, m1, m2; + m = m1 = m2; + m += m1 += m2; + m[3].wx = m1[2].zx = m2[1].yx; + m[3].wx += m1[2].zx += m2[1].yx; + + mat4 am[4], am1[4], am2[4]; + am[3] = am1[2] = am2[1]; + am[3] += am1[2] += am2[1]; + am[3][3].wx = am1[2][2].zx = am2[1][1].yx; + am[3][3].wx += am1[2][2].zx += am2[1][1].yx; + am[3][3].wx += am1[2][2].zx += ++(am2[1][1].yx); + am[3][3].wx += am1[2][2].zx += (am2[1][1].yx)++; + + gl_FragColor = vec4(am[3][3].z, m[3].w, v.w, f); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert new file mode 100644 index 000000000..c28627995 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +void main() +{ + vec4 v1 = vec4(5,6,7,8); + vec4 v2 = vec4(9,10, 11, 12); + vec3 v3 = (v1 * v2).ywx; + float f = (v2 * v1).z; + vec3 v4 = normalize((v1.ywx * v3).xyz).xyz; + gl_Position = vec4(v4, f); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag new file mode 100644 index 000000000..e1cc59e76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec4 v = vec4(5,6,7,8); + // value changes for lhs + // 8765, 6758, 857, 75 i.e. replace v.zx + // value changes for rhs + // 8765, 6758, 86 i.e replace with v.wy + // replace v.z with v.w + // replace v.x with v.y + // add 1.000000 to v.w and v.y + v.wzyx.zywx.wzy.zy = (v.wzyx.zywx.wx)++; + gl_FragColor = vec4(v); // 6,7,8,9 +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag new file mode 100644 index 000000000..cba34b2b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#version 100 +#ifdef GL_ES +precision mediump float; +#endif +/* #version can only be followed by number 100. The only statements before + #version can be comment or white spaces */ + +void main() +{ + gl_FragColor = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag new file mode 100644 index 000000000..a704944ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#version 100 +#version 100 +#ifdef GL_ES +precision mediump float; +#endif +/* Two version statements are not allowed since any #version must be the first non-whitespace, non-comment */ + +void main() +{ + gl_FragColor = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert new file mode 100644 index 000000000..f8df4570b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +int y = 1; + +int foo(int, int b[y]) // array size should be constant +{ + return 1; +} + +void main() +{ + int a[1]; + + gl_Position = vec4(1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag new file mode 100644 index 000000000..745cc458b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#include "GL/build/NVIDIA_Test_Include_frag.frag" diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag new file mode 100644 index 000000000..f42a80aa1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float MIN; +uniform float R0; +uniform float FOGC; +uniform float CUBE; +uniform float f; +uniform float o; +uniform float p; +uniform float w; +uniform float x; +uniform float y; +uniform float z; + +void main() +{ + gl_FragColor = vec4(f, o, p, w); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert new file mode 100644 index 000000000..13b97a22e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main(vec4 position : POSITION) +{ + gl_Position = position; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag new file mode 100644 index 000000000..f1f7004ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + const vec4 v = vec4(normalize(vec4(1))); // Builtin functions are constant expressions if all their parameters are constant expressions - code ok + const vec4 v1 = vec4(clamp(1.0, .20, 3.0)); // Builtin functions are constant expressions if all their parameters are constant expressions - code ok + float f = 1.0; + const vec4 v2 = vec4(float(vec4(1,2,3,f))); // f is not constant - code fails and test does not compile (expected) + + gl_FragColor = v + v1 + v2; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag new file mode 100644 index 000000000..add162fe3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + const vec4 v = vec2(2.0, 3.0); + gl_FragColor = v; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag new file mode 100644 index 000000000..3fbbf1c5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f = 2; // Should be 2.0 +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag new file mode 100644 index 000000000..df1232cd5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v = vec2(1.0, 2.0); + v *= 2.0; // Legal in GLSL. +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag new file mode 100644 index 000000000..7a79e24b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + mat4 m; + vec4 v; + bool b; + gl_FragColor = b ? v : m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag new file mode 100644 index 000000000..863c2ed77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2DRect samp; + +void main() +{ + gl_FragColor = texture2DRect(samp, vec2(0.0, 0.0)); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag new file mode 100644 index 000000000..62a2ce332 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +void main() +{ + float f[]; + float flt = f[5]; + float f[3]; // higher array index has already been used +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag new file mode 100644 index 000000000..8ba8323b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f[]; + int f[4]; // array redeclared with a different type +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag new file mode 100644 index 000000000..aff04d3ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int array[2][2]; // two dimentional arrays are not allowed +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag new file mode 100644 index 000000000..c3fc0d619 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + const int array[2]; // cannot declare const arrays +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag new file mode 100644 index 000000000..05fd376df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int array1[2], array2[2]; + bool b = array1 == array2; // equality operator does not work on arrays but works on array elements +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag new file mode 100644 index 000000000..2f7baf1d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f[-2]; // cannot declare arrays with negative size +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag new file mode 100644 index 000000000..36957dc40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i = 3; + float f[i]; // arrays should be declared with a constant size +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag new file mode 100644 index 000000000..109d7ad89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + const float index = 3.0; + float f[index]; // arrays should be declared with an integer expression not float +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag new file mode 100644 index 000000000..6e7dea3de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f[5]; + f[]; // array used without a size +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag new file mode 100644 index 000000000..2fd8795ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f[5]; + float f[]; // redeclaration of array already declared with a size +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag new file mode 100644 index 000000000..5a11791a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 array[2]; + array.xy; // arrays cannot directly be swizzled, however, an element of array can be swizzled +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert new file mode 100644 index 000000000..2726899e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert @@ -0,0 +1,31 @@ + +/* +** 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. +*/ + + +attribute int i; // attributes cannot be int or bool + +void main() +{ + gl_Position = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert new file mode 100644 index 000000000..f5bd8860d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert @@ -0,0 +1,31 @@ + +/* +** 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. +*/ + + +attribute float f[2]; // attributes cannot be arrays + +void main() +{ + gl_Position = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag new file mode 100644 index 000000000..af78ed7f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + attribute float foo; // attributes can be declared at global scope in vertex shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert new file mode 100644 index 000000000..1c35aea82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main() +{ + attribute float foo; // attributes can be declared at a global scope only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag new file mode 100644 index 000000000..bb50e2aa5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + break; // break keyword allowed only inside the loops +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html new file mode 100644 index 000000000..8bee781d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html new file mode 100644 index 000000000..29fa52e7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html new file mode 100644 index 000000000..b082dcfc2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_017_to_024.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html new file mode 100644 index 000000000..8c37cb575 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_025_to_032.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html new file mode 100644 index 000000000..a9ca7f104 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_033_to_040.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html new file mode 100644 index 000000000..e88d79153 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_041_to_048.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html new file mode 100644 index 000000000..1afa343d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_049_to_056.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html new file mode 100644 index 000000000..6995f5ff3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_057_to_064.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html new file mode 100644 index 000000000..79bc88ebf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_065_to_072.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html new file mode 100644 index 000000000..bc23517c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_073_to_080.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html new file mode 100644 index 000000000..dabae9cad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_081_to_088.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html new file mode 100644 index 000000000..241fc0f20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_089_to_096.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html new file mode 100644 index 000000000..cc49fd643 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_097_to_104.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html new file mode 100644 index 000000000..e9c786357 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_105_to_112.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html new file mode 100644 index 000000000..175919a92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_113_to_120.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html new file mode 100644 index 000000000..65005973f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_121_to_128.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html new file mode 100644 index 000000000..9955bc70e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_129_to_136.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html new file mode 100644 index 000000000..47c9fae4f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_137_to_144.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html new file mode 100644 index 000000000..a7b01e84f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_145_to_152.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html new file mode 100644 index 000000000..bcfb5242b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_153_to_160.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html new file mode 100644 index 000000000..834fee563 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_161_to_168.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html new file mode 100644 index 000000000..ff6938da0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html @@ -0,0 +1,131 @@ + + + + + +WebGL GLSL conformance test: build_169_to_176.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html new file mode 100644 index 000000000..8ac57b361 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html @@ -0,0 +1,71 @@ + + + + + +WebGL GLSL conformance test: build_177_to_178.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert new file mode 100644 index 000000000..5662a9e78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +void main() +{ + int i, j, k; + float f; + i = j, k, f; + i = (j, k, f); // float cannot be assigned to int + gl_Position = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag new file mode 100644 index 000000000..faa5f1618 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + const vec4 v = (vec4(1,2,3,4), vec4(5,6,7,8), 1.2); // right most value of comma operator shoul be a vec4 + const vec4 v1 = (vec3(0.2, 2.0), vec4(1,2,3,4), vec4(5,6,7,8)); + const vec4 v2 = (vec4(1,2,3,4), vec2(2.1, 2), vec4(5,6,7,8)); + gl_FragColor = v + v1 + v2; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert new file mode 100644 index 000000000..c1227a764 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +void main() +{ + int i, j, k; + float f; + i = j, k, f; + i = (j = k, f = 1.0); // float cannot be assigned to int + gl_Position = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert new file mode 100644 index 000000000..c66d9d755 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +void main() +{ + int i, j, k; + float f; + i = j, k, f; + i = j = k, f = 1.0; + i = j, k = (3, f); // float cannot be assigned to int + gl_Position = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag new file mode 100644 index 000000000..3274a5870 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + /****** // comment not closed +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag new file mode 100644 index 000000000..616f077ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f1,f2; + int i; + float f3 = i ? f1 : f2; // expression must be boolean and not int +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag new file mode 100644 index 000000000..5dcff4b0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f1,f2; + int i; + bool b; + float f3 = b ? i : f2; // second and third expression should of the type float +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag new file mode 100644 index 000000000..bf28fa73c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f1,f2; + bool b; + int i = b ? f1 : f2; // second and third expression type does not match the lvalue type +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag new file mode 100644 index 000000000..b93eeb02f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +vec2 func() +{ + vec2 v; + return v; +} + +void main() +{ + const vec3 v = vec3(1.0, func()); // user defined functions do not return const value + gl_FragColor = vec4(v, v); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag new file mode 100644 index 000000000..2e58b3c0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec4 v = vec4(1,2,3); // insufficient data provided for constructor, 4 values are required +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag new file mode 100644 index 000000000..d56b85f9e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec3 v; + vec4 v1 = vec4(v); // insufficient data specified for construction +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag new file mode 100644 index 000000000..8de87cc2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec3 v; + vec4 v1 = vec4(v,v,v); // too many arguments in the constructor +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag new file mode 100644 index 000000000..98b513745 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + continue; // continue keyword allowed only inside the loops +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag new file mode 100644 index 000000000..1b426b05e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f; + float f; // redeclaration of a variable +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag new file mode 100644 index 000000000..ce87ce363 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i = 08; // invalid octal number +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag new file mode 100644 index 000000000..7a673b578 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i = 0xa8g; // invalid hexadecimal number +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag new file mode 100644 index 000000000..79b9b52bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i = 1; + float f = 1.2; + float result = f * i; // auto promotion now allowed +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag new file mode 100644 index 000000000..bbfa81191 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D s; +void main() +{ + int i = int(s); // conversion not allowed +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag new file mode 100644 index 000000000..0221fe6a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + void v; // variable cannot be declared of the type void +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag new file mode 100644 index 000000000..b00b21227 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D samp1; +uniform sampler2D samp2 = samp1; // uniforms are read only + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag new file mode 100644 index 000000000..86369cc91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform int i = 1; // uniforms are read only + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag new file mode 100644 index 000000000..55f2fb653 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i = 1.0; // automatic type conversion does not take place, float cannot be converted to int +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag new file mode 100644 index 000000000..398d0c87f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f = 1; // int cannot be converted to float, use constructor to do the conversion explicitly +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag new file mode 100644 index 000000000..e64906c08 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + const float f; // constants must be initialized +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag new file mode 100644 index 000000000..6e05081cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float f; +void main() +{ + f = 1.0; // uniforms are read only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag new file mode 100644 index 000000000..0a6ba7828 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying float f; +void main() +{ + f = 1.0; // varyings cannot be written to in a fragment shader, they can be written to in a vertex shader +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag new file mode 100644 index 000000000..686685df3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying float f; +void main() +{ + float flt = 1.0; + flt++; + f++; // varyings in a fragment shader are read only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag new file mode 100644 index 000000000..e283e255b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main (void) +{ + gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert new file mode 100644 index 000000000..fc46a6ecd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +void main (void) +{ + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag new file mode 100644 index 000000000..59e7593f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f; + do { + } while(f); // condition should be boolean +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag new file mode 100644 index 000000000..0297c4e93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + dvec2 d; // dvec2 is not a valid datatype, reserved for future use +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag new file mode 100644 index 000000000..5973555bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + dvec3 d; // dvec3 is not a valid datatype, reserved for future use +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag new file mode 100644 index 000000000..2cafc8b22 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + dvec4 d; // dvec4 is not a valid datatype, reserved for future use +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag new file mode 100644 index 000000000..0d2e37dc7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#extension all : require // cannot use require or enable with all +#extension all : enable // cannot use require or enable with all + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag new file mode 100644 index 000000000..fb3c49f79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#extension foo : require // error extension not supported + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag new file mode 100644 index 000000000..bf3aad332 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#extension all : ddisablee // error, behavior is not supported + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag new file mode 100644 index 000000000..515844c4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#extension // error name and behavior not specified + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag new file mode 100644 index 000000000..9f1356d86 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#extension foo // ":" missing after extension name + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag new file mode 100644 index 000000000..ae18218c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#extension foo : // behavior not specified + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag new file mode 100644 index 000000000..30f9d4c49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +#extension foo behavior // ":" missing after extension name + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag new file mode 100644 index 000000000..c40c998ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float2 f; // float2 is not a valid datatype +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag new file mode 100644 index 000000000..407b184e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float3 f; // float3 is not a valid datatype +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag new file mode 100644 index 000000000..5ac6262a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float4 f; // float4 is not a valid datatype +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert new file mode 100644 index 000000000..ffde417a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main() +{ + gl_FrontFacing = true; // can be used in fragment shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert new file mode 100644 index 000000000..f2c4289d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main() +{ + gl_FragCoord = vec4(1.0); // can be used in fragment shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert new file mode 100644 index 000000000..9ddc58dc8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main() +{ + gl_FragColor = vec4(1.0); // can be used in fragment shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert new file mode 100644 index 000000000..1424f6201 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main() +{ + discard; // can be used in fragment shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert new file mode 100644 index 000000000..97c976a6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main() +{ + gl_FragDepth = 1.0; // can be used in fragment shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag new file mode 100644 index 000000000..5e03a5a67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(in int i); + +void main() +{ + float f; + // overloaded function not present + function(f); +} + +void function(in int i) +{ + i = 3; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag new file mode 100644 index 000000000..07cae0ea3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(int i) +{ + return i; // void function cannot return a value +} + +void main() +{ + int i; + function(i); +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag new file mode 100644 index 000000000..d2757c5c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(int i[]) // size of array must be specified +{ +} + +void main() +{ + int i[2]; + function(i); +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag new file mode 100644 index 000000000..1ab15cbdd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(const int i) +{ + i = 3; // const value cant be modified +} + +void main() +{ + int i; + function(i); +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag new file mode 100644 index 000000000..5e75363b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform int uniformInt; + +void function(out int i) +{ + i = 1; +} + +void main() +{ + function(uniformInt); // out and inout parameters cannot be uniform since uniforms cannot be modified +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag new file mode 100644 index 000000000..82c8acbf6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(const out int i) +{ // out parameters cannot be const + i = 3; +} + +void main() +{ + int i; + function(i); +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag new file mode 100644 index 000000000..d57b1a66d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(uniform int i) +{ // uniform qualifier cannot be used with function parameters +} + +void main() +{ + int i; + function(i); +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag new file mode 100644 index 000000000..287b60e82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(const inout int i) +{ // inout parameters cannot be const + i = 3; +} + +void main() +{ + int i; + function(i); +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag new file mode 100644 index 000000000..bf9f7248c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void function(inout int i); + +void main() +{ + int i; + function(i); +} + +// function definition has different parameter qualifiers than function declaration +void function(in int i) +{ + i = 3; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag new file mode 100644 index 000000000..8fc71311c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + hvec2 f; // hvec2 is not a valid datatype, reserved for future use +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag new file mode 100644 index 000000000..e7072b826 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + hvec3 f; // hvec3 is not a valid datatype, reserved for future use +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag new file mode 100644 index 000000000..ca70ea937 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + hvec4 f; // hvec4 is not a valid datatype, reserved for future use +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag new file mode 100644 index 000000000..d00a31894 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int 1i; // incorrect identifier name +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag new file mode 100644 index 000000000..84193c09d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int gl_int; // identifier name cannot begin with "gl_" +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag new file mode 100644 index 000000000..9ab484070 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i; + x; // identifier x used without being declared +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag new file mode 100644 index 000000000..ff1562404 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i; + if (i) // condition of if statement must be a boolean + i++; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag new file mode 100644 index 000000000..152d4fe32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v; + int i; + if (v) // vectors cannot be used as conditional expression for if statement + i++; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag new file mode 100644 index 000000000..838c05827 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + int i; +} s1; + +void main() +{ + s1.i++; + s1++; // structure cannot be incremented +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag new file mode 100644 index 000000000..029b06b39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i; + (i+i)++; // i+i is not an l-value +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag new file mode 100644 index 000000000..d98095856 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D sampler2d; + +void main() +{ + sampler2d++; // uniforms cannot be modified +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag new file mode 100644 index 000000000..ad1dc4501 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i; + i++ = 5; // i++ is not an l-value +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag new file mode 100644 index 000000000..fffd54d13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i; + ++i++; // ++i++ is equivalent to ++(i++) which fails because i++ is not an lvalue. (++i)++; is legal. +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt new file mode 100644 index 000000000..78dde7d62 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt @@ -0,0 +1,24 @@ +# this file is auto-generated. DO NOT EDIT. +build_001_to_008.html +build_009_to_016.html +build_017_to_024.html +build_025_to_032.html +build_033_to_040.html +build_041_to_048.html +build_049_to_056.html +build_057_to_064.html +build_065_to_072.html +build_073_to_080.html +build_081_to_088.html +build_089_to_096.html +build_097_to_104.html +build_105_to_112.html +build_113_to_120.html +build_121_to_128.html +build_129_to_136.html +build_137_to_144.html +build_145_to_152.html +build_153_to_160.html +build_161_to_168.html +build_169_to_176.html +build_177_to_178.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert new file mode 100644 index 000000000..617598ee5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert @@ -0,0 +1,28 @@ + +/* +** 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. +*/ + + +main() // return type of main should be void +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert new file mode 100644 index 000000000..fcd49232f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +void main(int i) // main function cannot take any parameters +{ + gl_Position = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert new file mode 100644 index 000000000..43b6cb72a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert @@ -0,0 +1,29 @@ + +/* +** 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. +*/ + + +int main() // return type of main should be void +{ + return 1; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag new file mode 100644 index 000000000..b5051acef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + mat3 m; + mat4 m1 = mat4(m); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert new file mode 100644 index 000000000..517780e0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert @@ -0,0 +1,30 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Normal; +void main() +{ + gtf_Normal = vec3(1.0,2.0,3.0); // cannot be modified an attribute +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag new file mode 100644 index 000000000..838c91603 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + 5 += 5; // l-value missing +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert new file mode 100644 index 000000000..bce0573b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert @@ -0,0 +1,30 @@ + +/* +** 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. +*/ + + +void main() +{ + int a // semicolon missing at the end of the statement + gl_Position = vec4(a); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag new file mode 100644 index 000000000..b088ce865 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f[3]; + f[3] = 1.0; // index of array greater than the size of the array +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag new file mode 100644 index 000000000..83f5dd413 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + const int i = 5; + i++; // const cannot be modified +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag new file mode 100644 index 000000000..f6e5d3ebb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v; + v.z = 1.2; // vec2 does not have a z component +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag new file mode 100644 index 000000000..53a6ace1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f1,f2,f3; + f3 = f1 > f2; // f1 > f2 result in a bool that cannot be assigned to a float +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag new file mode 100644 index 000000000..bac24a4bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + mat2 m1,m2; + bool b = m1 > m2; // greater-than operator can not operate on matrices, however, equal (==) and not equal (!=) operators can be used with matrices +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag new file mode 100644 index 000000000..796712885 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v2; + vec3 v3; + bool b = v2 == v3; // equal operator cannot operator on vectors of different sizes +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag new file mode 100644 index 000000000..def43a751 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f1,f2; + bool b = f1 && f2; // &&, || and ^^ operate on a boolean expression only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag new file mode 100644 index 000000000..a8073c48a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +//test for else elif mismatch +#define test(x,y) (x+y) + +void main(void){ + int sum =0; + #define x 8 + #endif + #if (x==8) + #undef x + #endif + + #if 1 + #undef x + #endif + + #if 1 + #define t4 4 + #endif + + sum=test(3,6)+t4; + #if 1 + #if 1 + #if 1 + #if 1 + #if 0 + #undef test + #else + #if 1 + #undef test + #endif + #if 0 + #undef test + #else + #if 0 + #undef test + #else + #if 1 + #undef test + #else + #undef test + #else + #jdhgj + #endif + #endif + #endif + #endif + #endif + #endif + #endif + #endif + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag new file mode 100644 index 000000000..22c491f82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +/* The program should terminate with an error message and not get into an + infinite loop */ +#ifdef name + +void main() +{ + gl_FragColor = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag new file mode 100644 index 000000000..3273e3ec7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag @@ -0,0 +1,81 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// tests for macro redifinition (t2) and the #if and #else nestings. +// takes care of elif also. + +#define t1 (1+2) +#define t2 2 +#define t2 3 + +// testing the if depth +#if (t1==3) + #define t3 3 + #if defined t2 + #define t4 4 + #if defined(t3) + #define t5 5 + #ifdef t5 + #define t6 6 + #ifndef t7 + #define t7 7 + #else + #define t8 8 + #endif + #endif + #else + #ifndef t8 + #define t8 8 + #elif (t8==8) + #define t9 9 + #else + #if defined t7 + #define t9 9 + #endif + #endif + #endif + #else + #define t10 10 + #endif +#endif + + +#define t8 8 +#define t9 9 +#define t10 10 + +void main(void) +{ + int sum=1 ; + sum = t1+t2; + sum = t3+t4; + sum = t5+t6; + sum = t7+t8; + sum = t9+t10; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag new file mode 100644 index 000000000..5d5845275 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag @@ -0,0 +1,77 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// #line directive-- test cases. +// chks for Invalid directives, all possible #line errors +// Also checks the correct verions of #line dorective. + +#define t1 1 +#define t2 2 + +# +# +# +# +#line 8 +#line "" +#line 3 3 + +#linekfj +#line c c +#line t1 t2 +#line 77 89 +#line 65.4 +#line message to the user +#line +#line345 + +void main(void) +{ + int sum =1; + sum = __LINE__; + sum = __FILE__; + #line 4 5 + sum = __LINE__; + sum = __FILE__; + #line 9 + sum = __LINE__ + __FILE__ ; + sum = __FILE__; + # + # + sum = __VERSION__; + sum = sum + __LINE__ ; + #line 4 5 + #line 5 8 + sum = __LINE__; + sum = __FILE__; + sum = __VERSION__; + +} + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag new file mode 100644 index 000000000..374464790 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// simple macro expansions. +// Tests for Too few macro arguments, too many macro arguments. +// Macros with no arguments. + +#define t1 -1 +#define t2 2 + +#define test -258 +#define test1 (test*test) +#define test2(x) (x+test1) +#define test3() (test2(8)*(test*test1)) +#define test4(x,y) (x+y) + +void main(void) +{ + int sum =0; + sum = test3(); + sum = test3(3); + + sum = test2(9); + sum = test2(9,8); + + sum = test4; + sum = test2(8,5,78,9); + sum = sum + test1; + sum = 8+58+sum; + sum = sum +test; + sum = (t1+t2); + sum = test4(test3(),test2(test3())); + sum = test4(3,8,5); + sum = test4(); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag new file mode 100644 index 000000000..501dab10c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag @@ -0,0 +1,77 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// #error and #pragma directives -- test cases. +// tests for errors in #pragma directive. + +#pragma optimize(on) +#pragma debug(off) + +int foo(int); + +void main(void) +{ + int sum =0; + #error ; + #error 78 + #error c + #error "message to the user " + #error message to the user + #error + #error + #define t1 1 + sum = t1*t1; + foo(sum); + +} + +#pragma optimize(off) +#pragma bind(on) +#pragma pack(off) + +int foo(int test) +{ + int binding=0; + binding = test; + return binding; +} + +#line 4 +#pragma +#line 5 6 +#pragma optmimize on +#pragma debug off +#pragma debug(off +#line 9 +#prgma bind(off) +#pragma bind +#pragma (on) +#pragma on (on) +#pragma optmize(on + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag new file mode 100644 index 000000000..0fc4b509a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// operator precedence and some macro expansions. + +#define test (1+2) +#define test1 (test*4) +#define test2 (test1/test) +//#define test3 (-1+2*3/4%test) +#define test3 (-1+2*3/4) +//#define test4 (test & test1 |test2) +#define test4 (test) +#define test5 (!8+~4+4-6) +#define test6 (test1>>1) +#define test7 (test1<<1) +#define test8 (test2^6) +#define test9 (test4 || test5 && test1) +#define test10 (0) + +void main(void) +{ + int sum =0; + sum = test4; + sum = test3*test2+test1-test; +// sum = test3/test6 + test4*test7 - test7 % test9; +// sum = test3/test6 + test4*test7 - test7; + sum = test10*test5; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag new file mode 100644 index 000000000..c4cc1e022 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag @@ -0,0 +1,68 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// testing for char constants in #if and #elif +// Also checking whether reserved words can be redefined. + +#define t1 c +#define t2 d +#define asm a + + #if(t1==c) + #define t3 3 + #elif(t1==d) + #define t4 4 + #elif(t2==c) + #define t5 5 + #endif + + #ifndef t1 + #define t7 7 + #elif (t2==d) + #define t6 6 + #endif + + #if (t2=='d') + #define half 5 + #else + #define half 8 + #endif + + #ifdef t22 + #define x 5 + #endif + + void main(void) + { + int sum =0,a=9; + + sum = half + sum; + sum = asm + a; + + } + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag new file mode 100644 index 000000000..d826522b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + bool b; + if (b) + { + int i = 1; + i++; + } + i++; // i is not declared in this scope +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag new file mode 100644 index 000000000..ebb871e8b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + { + int i = 1; + i++; + } + i++; // i is not declared in this scope +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag new file mode 100644 index 000000000..65dd3c133 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + int i; +} s1[2]; + +void main() +{ + s1.i = 1; // s1 is an array. s1[0].i is correct to use +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag new file mode 100644 index 000000000..1ead02703 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + int i; +} s1; + +void main() +{ + s1 = -s1; // cannot calculate negative of a structure +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag new file mode 100644 index 000000000..613b4fc14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + int i; +} uniform uniformStruct; // uniform keyword should be used before the keyword struct + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag new file mode 100644 index 000000000..031319ac0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + int i = 1.0; // struct members cannot be initialized at the time of structure declaration +} s1; + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag new file mode 100644 index 000000000..a53271af8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + uniform int i; // structure members cannot be declared with const qualifier +} s1; + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag new file mode 100644 index 000000000..14b9b662c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + const int i = 1; // structure members cannot be declared with const qualifier +} s1; + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag new file mode 100644 index 000000000..74a12af4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform struct s { + int i; +} s1; + +void main() +{ + s1.i = 1; // uniforms are read only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag new file mode 100644 index 000000000..937331496 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying struct s { + int i; +} s1; // structures cannot be declared with varying qualifier + +void main() +{ +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag new file mode 100644 index 000000000..7f9b0818f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + struct s { + } s1; // structures have to be declared with atleast one member +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag new file mode 100644 index 000000000..c83f398e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct s { + int i; +} s1; + +struct ss { + int i; +} s2; + +void main() +{ + s1 = s2; // two different structures cannot be assigned to each other +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag new file mode 100644 index 000000000..14babe347 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +const struct s { + int i; +} s1 = s(1); + +void main() +{ + s1.i = 1; // const struct members cannot be modified +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag new file mode 100644 index 000000000..39dddcb29 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v; + v.xy = 1.2; // swizzle needs two values, v.xy = vec2(1.2) is correct +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag new file mode 100644 index 000000000..8eb8162bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v; + v.xx = vec2(1,1); // x cannot be used twice in l-value +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag new file mode 100644 index 000000000..b8bdb5ef4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec2 v; + vec3 v3 = v.xyz; // v is a vec2 and does not have a z component +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag new file mode 100644 index 000000000..88d416ea9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + vec4 v; + vec4 v1 = (vec4) v; // incorrect typecasting, vec4(v) is correct +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag new file mode 100644 index 000000000..7ba746f65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct gtf_FogParameters { +vec4 color; +float density; +float start; +float end; +float scale; +}; +uniform gtf_FogParameters gtf_Fog; +void main() +{ + gtf_Fog.density = 1.0; // cannot modify a uniform +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag new file mode 100644 index 000000000..125bf56dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + uniform float foo; // uniforms can only be declared at a global scope +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag new file mode 100644 index 000000000..0938a024d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying float foo; + +void main() +{ + foo = 5.0; // varying cannot be written by a fragment shader +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag new file mode 100644 index 000000000..9873689f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying int foo; // varyings cannot be int or bool + +void main() +{ + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag new file mode 100644 index 000000000..0518876ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 v = vec4(1,1,1,1);//gl_TexCoord[0]; // varyings cannot be initialized + +void main() +{ + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag new file mode 100644 index 000000000..50a763055 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + varying float foo; // varyings can only be declared at a global scope +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag new file mode 100644 index 000000000..a88027ede --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + ivec4 v4; + v4 = v4 + 2.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag new file mode 100644 index 000000000..852640fe7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#pragma debug(on) +#version 100 // error #version should be the first statement in the program +#ifdef GL_ES +precision mediump float; +#endif + + +void main() +{ + gl_FragColor = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag new file mode 100644 index 000000000..980a2d5ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +/* This is a comment*/ int i; // This is a global decl +#version 100 // error #version should be the first statement in the program +#ifdef GL_ES +precision mediump float; +#endif + + +void main() +{ + gl_FragColor = vec4(1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag new file mode 100644 index 000000000..0e4547d43 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + gl_Position = vec4(4.0); // can be used in vertex shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag new file mode 100644 index 000000000..cc44d2496 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct gtf_PointParameters { +float size; +float sizeMin; +float sizeMax; +float fadeThresholdSize; +float distanceConstantAttenuation; +float distanceLinearAttenuation; +float distanceQuadraticAttenuation; +}; +uniform gtf_FogParameters gtf_Point; +void main() +{ + gtf_PointSize = 4.0; // can be used in vertex shader only +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert new file mode 100644 index 000000000..e4b1f4474 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert @@ -0,0 +1,30 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +void main() +{ + gtf_Vertex = vec4(1.0,2.0,3.0, 4.0); // cannot modify an attribute +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag new file mode 100644 index 000000000..64894fa34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + int i; + while(i) { // condition should be boolean + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag new file mode 100644 index 000000000..68df2b3bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + while(float f = 5.0) { // cannot declare variables in condition + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag new file mode 100644 index 000000000..d55d00194 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main() +{ + float f; + while(f) { // condition should be boolean + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html new file mode 100644 index 000000000..36bf3bf49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html @@ -0,0 +1,61 @@ + + + + + +WebGL GLSL conformance test: built_in_varying_array_out_of_bounds_001_to_001.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag new file mode 100644 index 000000000..4a83d9cfa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main(void) +{ + gl_FragColor = vec4(color[1], color[2], color[3], color[4]); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt new file mode 100644 index 000000000..be6485a1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +built_in_varying_array_out_of_bounds_001_to_001.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html new file mode 100644 index 000000000..5a90be9c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: ceil_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag new file mode 100644 index 000000000..dfb425e48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4((ceil(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag new file mode 100644 index 000000000..56b73e785 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float ceil_ref(float x) +{ + if(x != floor(x)) x = floor(x) + 1.0; + return x; +} + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert new file mode 100644 index 000000000..da5e9f800 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4((ceil(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert new file mode 100644 index 000000000..9872fd198 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +float ceil_ref(float x) +{ + if(x != floor(x)) x = floor(x) + 1.0; + return x; +} + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag new file mode 100644 index 000000000..836c69786 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4((ceil(c) + 10.0) / 20.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..4c624a57b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +vec2 ceil_ref(vec2 x) +{ + if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0; + if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0; + return x; +} + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert new file mode 100644 index 000000000..8240119c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4((ceil(c) + 10.0) / 20.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..7483c22cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +vec2 ceil_ref(vec2 x) +{ + if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0; + if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0; + return x; +} + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag new file mode 100644 index 000000000..45d026666 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4((ceil(c) + 10.0) / 20.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..652be10fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +vec3 ceil_ref(vec3 x) +{ + if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0; + if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0; + if(x[2] != floor(x[2])) x[2] = floor(x[2]) + 1.0; + return x; +} + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4((ceil_ref(c) + 10.0) / 20.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert new file mode 100644 index 000000000..e7a321345 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4((ceil(c) + 10.0) / 20.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..1bb4b8092 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +vec3 ceil_ref(vec3 x) +{ + if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0; + if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0; + if(x[2] != floor(x[2])) x[2] = floor(x[2]) + 1.0; + return x; +} + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4((ceil_ref(c) + 10.0) / 20.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt new file mode 100644 index 000000000..ed1a87ffa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +ceil_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html new file mode 100644 index 000000000..8f0661e2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: clamp_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag new file mode 100644 index 000000000..2c32377d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + float c = color.r; + gl_FragColor = vec4(clamp(c, min_c, max_c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag new file mode 100644 index 000000000..2b1e5a340 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + float c = color.r; + if(c > max_c) c = max_c; + if(c < min_c) c = min_c; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert new file mode 100644 index 000000000..68aa1a4b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + float c = gtf_Color.r; + color = vec4(clamp(c, min_c, max_c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert new file mode 100644 index 000000000..bc6d8c00e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + float c = gtf_Color.r; + if(c > max_c) c = max_c; + if(c < min_c) c = min_c; + + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag new file mode 100644 index 000000000..e912dd375 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 min_c = vec2(0.25, 0.25); + const vec2 max_c = vec2(0.75, 0.75); + vec2 c = color.rg; + gl_FragColor = vec4(clamp(c, min_c, max_c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag new file mode 100644 index 000000000..54face3fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 min_c = vec2(0.25, 0.25); + const vec2 max_c = vec2(0.75, 0.75); + vec2 c = color.rg; + if(c[0] < min_c[0]) c[0] = min_c[0]; + if(c[1] < min_c[1]) c[1] = min_c[1]; + if(c[0] > max_c[0]) c[0] = max_c[0]; + if(c[1] > max_c[1]) c[1] = max_c[1]; + + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert new file mode 100644 index 000000000..17474f371 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + vec2 c = gtf_Color.rg; + color = vec4(clamp(c, min_c, max_c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert new file mode 100644 index 000000000..e566319c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + vec2 c = gtf_Color.rg; + if(c[0] > max_c) c[0] = max_c; + if(c[0] < min_c) c[0] = min_c; + if(c[1] > max_c) c[1] = max_c; + if(c[1] < min_c) c[1] = min_c; + + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag new file mode 100644 index 000000000..c294c26bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 min_c = vec3(0.25, 0.25, 0.25); + const vec3 max_c = vec3(0.75, 0.75, 0.75); + vec3 c = color.rgb; + gl_FragColor = vec4(clamp(c, min_c, max_c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag new file mode 100644 index 000000000..e09f795b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 min_c = vec3(0.25, 0.25, 0.25); + const vec3 max_c = vec3(0.75, 0.75, 0.75); + vec3 c = color.rgb; + if(c[0] < min_c[0]) c[0] = min_c[0]; + if(c[1] < min_c[1]) c[1] = min_c[1]; + if(c[2] < min_c[2]) c[2] = min_c[2]; + if(c[0] > max_c[0]) c[0] = max_c[0]; + if(c[1] > max_c[1]) c[1] = max_c[1]; + if(c[2] > max_c[2]) c[2] = max_c[2]; + + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert new file mode 100644 index 000000000..50c14ffc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + vec3 c = gtf_Color.rgb; + color = vec4(clamp(c, min_c, max_c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert new file mode 100644 index 000000000..6ba4f0d42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + vec3 c = gtf_Color.rgb; + if(c[0] > max_c) c[0] = max_c; + if(c[0] < min_c) c[0] = min_c; + if(c[1] > max_c) c[1] = max_c; + if(c[1] < min_c) c[1] = min_c; + if(c[2] > max_c) c[2] = max_c; + if(c[2] < min_c) c[2] = min_c; + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt new file mode 100644 index 000000000..2fafa275a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +clamp_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html new file mode 100644 index 000000000..c453631f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: control_flow_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html new file mode 100644 index 000000000..ad4d098f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html @@ -0,0 +1,101 @@ + + + + + +WebGL GLSL conformance test: control_flow_009_to_010.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag new file mode 100644 index 000000000..ff23a7859 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int count = 0; + for(int i=0;i<5;i++) + { + count++; + if(count == 3) + break; + } + + float gray; + if( count == 3) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert new file mode 100644 index 000000000..84a517d94 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int count = 0; + for(int i=0;i<45;i++) + { + count++; + if(count == 29) + break; + } + float gray; + if( count == 29) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag new file mode 100644 index 000000000..df501385e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int count=0; + int val=0; + + for(int i=0;i<10;i++) + { + count++; + if(count == 5) + continue; + else + val += count; + } + + float gray; + if( val == 50) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert new file mode 100644 index 000000000..80da6b922 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int count=0; + int val=0; + for(int i=0;i<10;i++) + { + count++; + if(count == 5) + continue; + else + val += count; + } + + + float gray; + if( val == 50) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag new file mode 100644 index 000000000..dc0cdb59a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int count1 = 0, count2 = 0; + for(int i=0;i<4;i++) + { + count1++; + count2 = 0; + for(int j=0;j<4;j++) + { + count2++; + if(count2 == 3) + break; + } + if(count1 == 2) + break; + } + float gray; + if( (count1 == 2) && (count2 == 3)) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert new file mode 100644 index 000000000..47491be11 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int count1 = 0, count2 = 0; + for(int i=0;i<45;i++) + { + count1++; + count2 = 0; + for(int j=0;j<45;j++) + { + count2++; + if(count2 == 29) + break; + } + if(count1 == 29) + break; + } + float gray; + if( (count1 == 29) && (count2 == 29)) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag new file mode 100644 index 000000000..6651cc75c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag @@ -0,0 +1,61 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int count1 = 0, count2 = 0; + int val1 = 0, val2 = 0; + for(int i=0;i<4;i++) + { + count1++; + count2 = 0; + for(int j=0;j<4;j++) + { + count2++; + if(count2 == 2) + continue; + else + val2 += count2; + + } + + + if(count1 == 2) + continue; + else + val1 += count1; + + } + float gray; + if( (val1 == 8) && (val2 == 32) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert new file mode 100644 index 000000000..0b96b9a4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert @@ -0,0 +1,61 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int count1 = 0, count2 = 0; + int val1 = 0, val2 = 0; + for(int i=0;i<10;i++) + { + count1++; + count2 = 0; + for(int j=0;j<10;j++) + { + count2++; + if(count2 == 5) + continue; + else + val2 += count2; + + } + + + if(count1 == 5) + continue; + else + val1 += count1; + + } + float gray; + if( (val1 == 50) && (val2 == 500) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt new file mode 100644 index 000000000..fddcaa48a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +control_flow_001_to_008.html +control_flow_009_to_010.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag new file mode 100644 index 000000000..66525bf6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag @@ -0,0 +1,57 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int setval = 30; + + if(--setval!=29) + if( (setval+=11) == 40) + if(setval/4 == 11) + setval = 11; + else if(setval/4 == 10) + if(setval-3 == 37) + setval=12; + else setval = 9; + else setval = 10; + else setval = 30; + else if(setval == 29) + if((setval+=19) != 48) + setval = 13; + else if((setval+=19) == 29) + setval = 28; + else setval = 53; + else setval = 32; + float gray; + if( setval == 53 ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert new file mode 100644 index 000000000..f0d560b7c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert @@ -0,0 +1,57 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int setval = 30; + + if(--setval!=29) + if( (setval+=11) == 40) + if(setval/4 == 11) + setval = 11; + else if(setval/4 == 10) + if(setval-3 == 37) + setval=12; + else setval = 9; + else setval = 10; + else setval = 30; + else if(setval == 29) + if((setval+=19) != 48) + setval = 13; + else if((setval+=19) == 29) + setval = 28; + else setval = 53; + else setval = 32; + float gray; + if( setval == 53 ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html new file mode 100644 index 000000000..6fe118c5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: cos_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag new file mode 100644 index 000000000..4cef9e2e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + gl_FragColor = vec4(0.5 * cos(2.0 * M_PI * color.r) + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag new file mode 100644 index 000000000..fb906c198 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag @@ -0,0 +1,70 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * ( fract(abs(color.r)) - 0.5 ); + float sign = 1.0; + float cos_c = -1.0; + float fact_even = 1.0; + float fact_odd = 1.0; + float sum; + + // At this point c is in the range [-PI, PI) + + // Taylor-Maclaurin series expansion for cosine + // + // Apply the property that pow(a, b + c) = pow(a, b) * pow(a, c) + // and the property that 1.0/(a*b) = 1.0/a * 1.0/b + // to make sure no register ever overflows the range (-16384, +16384) + // mandated for mediump variables. + + for(int i = 2; i <= 10; i += 2) + { + // fact_even will hold at most the value 3840. + fact_even *= float(i); + + // fact_odd will always be smaller than fact_even + fact_odd *= float(i-1); + + // pow(c, float(i/2)) takes at most the value pow(PI, 5), which is approx. 306 + // abs(sum) is at most PI/2.0 + sum = sign * pow(abs(c), float(i/2))/fact_even; + + // abs(sum/fact_odd) is at most PI/2.0 + // cos_c is always bound in the range [-1.0, 1.0) + cos_c += pow(abs(c), float(i/2))*(sum/fact_odd); + + sign = -sign; + } + + gl_FragColor = vec4(0.5 * cos_c + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert new file mode 100644 index 000000000..ff1bf21de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + color = vec4(0.5 * cos(2.0 * M_PI * gtf_Color.r) + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert new file mode 100644 index 000000000..a47efbfbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * gtf_Color.r; + float sign = -1.0; + float cos_c = 1.0; + float fact = 1.0; + + // Taylor-Maclaurin series expansion for cosine + for(int i = 2; i <= 20; i += 2) + { + fact *= float(i)*float(i-1); + cos_c += sign*pow(c, float(i))/fact; + sign = -sign; + } + + color = vec4(0.5 * cos_c + 0.5, 0.0, 0.0, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag new file mode 100644 index 000000000..303bcd985 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + gl_FragColor = vec4(0.5 * cos(2.0 * M_PI * color.rg) + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..4b1c833cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag @@ -0,0 +1,74 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * ( fract(abs(color.rg)) - 0.5 ); + float sign = 1.0; + vec2 cos_c = vec2(-1.0, -1.0); + float fact_even = 1.0; + float fact_odd = 1.0; + vec2 sum; + vec2 exp; + + // At this point c is in the range [-PI, PI) + + // Taylor-Maclaurin series expansion for cosine + // + // Apply the property that pow(a, b + c) = pow(a, b) * pow(a, c) + // and the property that 1.0/(a*b) = 1.0/a * 1.0/b + // to make sure no register ever overflows the range (-16384, +16384) + // mandated for mediump variables. + + for(int i = 2; i <= 10; i += 2) + { + // fact_even will hold at most the value 3840. + fact_even *= float(i); + + // fact_odd will always be smaller than fact_even + fact_odd *= float(i-1); + + // exp is at most (5,5) + exp = vec2(float(i/2), float(i/2)); + + // pow(c, exp) takes at most the value pow(PI, 5), which is approx. 306 + // abs(sum) is at most PI/2.0 + sum = sign * pow(abs(c), exp)/fact_even; + + // abs(sum/fact_odd) is at most PI/2.0 + // cos_c is always bound in the range [-1.0, 1.0) + cos_c += pow(abs(c), exp)*(sum/fact_odd); + + sign = -sign; + } + + gl_FragColor = vec4(0.5 * cos_c + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert new file mode 100644 index 000000000..6c9daf513 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + color = vec4(0.5 * cos(2.0 * M_PI * gtf_Color.rg) + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..9aab45e87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * gtf_Color.rg; + float sign = -1.0; + vec2 cos_c = vec2(1.0, 1.0); + float fact = 1.0; + + // Taylor-Maclaurin series expansion for cosine + for(int i = 2; i <= 20; i += 2) + { + fact *= float(i)*float(i-1); + cos_c += sign*pow(c, vec2(float(i), float(i)))/fact; + sign = -sign; + } + + color = vec4(0.5 * cos_c + 0.5, 0.0, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag new file mode 100644 index 000000000..2470106a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + gl_FragColor = vec4(0.5 * cos(2.0 * M_PI * color.rgb) + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..948400d9d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag @@ -0,0 +1,74 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * ( fract(abs(color.rgb)) - 0.5 ); + float sign = 1.0; + vec3 cos_c = vec3(-1.0, -1.0, -1.0); + float fact_even = 1.0; + float fact_odd = 1.0; + vec3 sum; + vec3 exp; + + // At this point c is in the range [-PI, PI) + + // Taylor-Maclaurin series expansion for cosine + // + // Apply the property that pow(a, b + c) = pow(a, b) * pow(a, c) + // and the property that 1.0/(a*b) = 1.0/a * 1.0/b + // to make sure no register ever overflows the range (-16384, +16384) + // mandated for mediump variables. + + for(int i = 2; i <= 10; i += 2) + { + // fact_even will hold at most the value 3840. + fact_even *= float(i); + + // fact_odd will always be smaller than fact_even + fact_odd *= float(i-1); + + // exp is at most (5,5,5) + exp = vec3(float(i/2), float(i/2), float(i/2)); + + // pow(c, exp) takes at most the value pow(PI, 5), which is approx. 306 + // abs(sum) is at most PI/2.0 + sum = sign * pow(abs(c), exp)/fact_even; + + // abs(sum/fact_odd) is at most PI/2.0 + // cos_c is always bound in the range [-1.0, 1.0) + cos_c += pow(abs(c), exp)*(sum/fact_odd); + + sign = -sign; + } + + gl_FragColor = vec4(0.5 * cos_c + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert new file mode 100644 index 000000000..bde69506c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + color = vec4(0.5 * cos(2.0 * M_PI * gtf_Color.rgb) + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..cd8f9d837 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * gtf_Color.rgb; + float sign = -1.0; + vec3 cos_c = vec3(1.0,1.0,1.0); + float fact = 1.0; + + // Taylor-Maclaurin series expansion for cosine + for(int i = 2; i <= 20; i += 2) + { + fact *= float(i)*float(i-1); + cos_c += sign*pow(c, vec3(float(i),float(i),float(i)))/fact; + sign = -sign; + } + + color = vec4(0.5 * cos_c + 0.5, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt new file mode 100644 index 000000000..64f23d8c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +cos_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html new file mode 100644 index 000000000..5803ef1b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html @@ -0,0 +1,77 @@ + + + + + +WebGL GLSL conformance test: cross_001_to_002.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag new file mode 100644 index 000000000..3baaed544 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = vec3(1.0, 0.0, 0.0); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + gl_FragColor = vec4((cross(v1, v2) + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag new file mode 100644 index 000000000..7d1f21613 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = vec3(1.0, 0.0, 0.0); + vec3 v3; + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + v3.x = v1.y * v2.z - v2.y * v1.z; + v3.y = v2.x * v1.z - v1.x * v2.z; + v3.z = v1.x * v2.y - v2.x * v1.y; + gl_FragColor = vec4((v3 + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert new file mode 100644 index 000000000..6a3345f28 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = vec3(1.0, 0.0, 0.0); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + color = vec4((cross(v1, v2) + 1.0) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert new file mode 100644 index 000000000..7680ae035 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = vec3(1.0, 0.0, 0.0); + vec3 v3; + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + v3.x = v1.y * v2.z - v2.y * v1.z; + v3.y = v2.x * v1.z - v1.x * v2.z; + v3.z = v1.x * v2.y - v2.x * v1.y; + color = vec4((v3 + 1.0) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt new file mode 100644 index 000000000..4ce9794db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +cross_001_to_002.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag new file mode 100644 index 000000000..e9d460fb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert new file mode 100644 index 000000000..72e83fd03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html new file mode 100644 index 000000000..065e66f96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html @@ -0,0 +1,64 @@ + + + + + +WebGL GLSL conformance test: default_001_to_001.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag new file mode 100644 index 000000000..8db3c6954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].xy); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert new file mode 100644 index 000000000..1b5b7831a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 gtf_TexCoord[1]; +attribute vec4 gtf_MultiTexCoord0; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag new file mode 100644 index 000000000..3d543f343 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec4 result; + +void main (void) +{ + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt new file mode 100644 index 000000000..44c03e906 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +default_001_to_001.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html new file mode 100644 index 000000000..374311008 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: degrees_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag new file mode 100644 index 000000000..52d2e724a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * 2.0 * (color.r - 0.5); + gl_FragColor = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag new file mode 100644 index 000000000..b3675b045 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * 2.0 * (color.r - 0.5); + gl_FragColor = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert new file mode 100644 index 000000000..69b026d7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * 2.0 * (gtf_Color.r - 0.5); + color = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert new file mode 100644 index 000000000..4b919b44b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * 2.0 * (gtf_Color.r - 0.5); + color = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag new file mode 100644 index 000000000..3c01fb83e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..0706159c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert new file mode 100644 index 000000000..e7c59c300 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * 2.0 * (gtf_Color.rg - 0.5); + color = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..f2d52d129 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * 2.0 * (gtf_Color.rg - 0.5); + color = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag new file mode 100644 index 000000000..48c5cb1de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..e970bd141 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert new file mode 100644 index 000000000..520f0bb65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..ef8d0e4ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt new file mode 100644 index 000000000..caa0c110d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +degrees_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html new file mode 100644 index 000000000..9f46ba5a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html @@ -0,0 +1,89 @@ + + + + + +WebGL GLSL conformance test: discard_001_to_002.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag new file mode 100644 index 000000000..89c664cdf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + bool toDiscard = false; + if(color.r > 0.75) toDiscard = true; + else if(color.g > 0.75) toDiscard = true; + else if(color.b > 0.75) toDiscard = true; + + if (toDiscard) discard; + + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag new file mode 100644 index 000000000..05bb08a03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + if(color.r > 0.75 || color.g > 0.75 || color.b > 0.75) + { + /* The background color is black by default. + * Setting the fragment color to it simulates a discarded fragment. + */ + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } + else + { + gl_FragColor = color; + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag new file mode 100644 index 000000000..6420e95bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; + discard; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt new file mode 100644 index 000000000..ff9bfa993 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +discard_001_to_002.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html new file mode 100644 index 000000000..acdbde3da --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: distance_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag new file mode 100644 index 000000000..90d38ddcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(distance(color.r, 0.5)), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag new file mode 100644 index 000000000..d5c87c09e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(sqrt(pow(abs(color.r - 0.5), 2.0))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert new file mode 100644 index 000000000..574bf00c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(distance(gtf_Color.r, 0.5)), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert new file mode 100644 index 000000000..694c7d1f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(sqrt(pow(abs(gtf_Color.r - 0.5), 2.0))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag new file mode 100644 index 000000000..c39308d1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(distance(color.rg, vec2(0.5))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag new file mode 100644 index 000000000..61e180032 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(sqrt(pow(abs(color.r - 0.5), 2.0) + pow(abs(color.g - 0.5), 2.0))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert new file mode 100644 index 000000000..9807d91fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(distance(gtf_Color.rg, vec2(0.5))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert new file mode 100644 index 000000000..f70d7a78c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(sqrt(pow(abs(gtf_Color.r - 0.5), 2.0) + pow(abs(gtf_Color.g - 0.5), 2.0))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag new file mode 100644 index 000000000..c356d3424 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(distance(color.rgb, vec3(0.5))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag new file mode 100644 index 000000000..b016b64db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(sqrt(pow(abs(color.r - 0.5), 2.0) + pow(abs(color.g - 0.5), 2.0) + pow(abs(color.b - 0.5), 2.0))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert new file mode 100644 index 000000000..f0ce5c4bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(distance(gtf_Color.rgb, vec3(0.5))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert new file mode 100644 index 000000000..7fdd7f986 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(sqrt(pow(abs(gtf_Color.r - 0.5), 2.0) + pow(abs(gtf_Color.g - 0.5), 2.0) + pow(abs(gtf_Color.b - 0.5), 2.0))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt new file mode 100644 index 000000000..bfbce99ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +distance_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html new file mode 100644 index 000000000..94188a747 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: dot_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag new file mode 100644 index 000000000..4dfef129c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(dot(color.r, 1.0)), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag new file mode 100644 index 000000000..1d8b5594d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(color.r), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert new file mode 100644 index 000000000..d1df51840 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(dot(gtf_Color.r, 1.0)), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert new file mode 100644 index 000000000..3d37b84fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(gtf_Color.r), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag new file mode 100644 index 000000000..dc4389716 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(dot(color.rg, vec2(0.5))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag new file mode 100644 index 000000000..515e49651 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(color.r + color.g) * 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert new file mode 100644 index 000000000..48cc60154 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(dot(gtf_Color.rg, vec2(0.5))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert new file mode 100644 index 000000000..d5e6df67b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(gtf_Color.r + gtf_Color.g) * 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag new file mode 100644 index 000000000..55205c284 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(dot(color.rgb, vec3(0.3333))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag new file mode 100644 index 000000000..cc4a934fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(color.r + color.g + color.b) * 0.3333, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert new file mode 100644 index 000000000..69493de3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(dot(gtf_Color.rgb, vec3(0.3333))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert new file mode 100644 index 000000000..5fc4c8805 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(gtf_Color.r + gtf_Color.g + gtf_Color.b) * 0.3333, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt new file mode 100644 index 000000000..e87547fd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +dot_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html new file mode 100644 index 000000000..4342fa447 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: equal_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html new file mode 100644 index 000000000..ed5aa1a43 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: equal_009_to_012.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag new file mode 100644 index 000000000..f934ea91c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(equal(bvec2(c), bvec2(true))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag new file mode 100644 index 000000000..574f95e09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 eq(in bvec2 a, in bvec2 b) +{ + bvec2 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(eq(bvec2(c), bvec2(true))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert new file mode 100644 index 000000000..0644c69de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(equal(bvec2(c), bvec2(true))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert new file mode 100644 index 000000000..fefac9574 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 eq(in bvec2 a, in bvec2 b) +{ + bvec2 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(eq(bvec2(c), bvec2(true))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag new file mode 100644 index 000000000..f35039b82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(equal(bvec3(c), bvec3(true))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag new file mode 100644 index 000000000..e9047836e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 eq(in bvec3 a, in bvec3 b) +{ + bvec3 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + if(a[2] == b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(eq(bvec3(c), bvec3(true))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert new file mode 100644 index 000000000..8fd3ac79c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(equal(bvec3(c), bvec3(true))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert new file mode 100644 index 000000000..528c56cc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 eq(in bvec3 a, in bvec3 b) +{ + bvec3 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + if(a[2] == b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(eq(bvec3(c), bvec3(true))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag new file mode 100644 index 000000000..03586f303 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(equal(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag new file mode 100644 index 000000000..0d714400e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec2 eq(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(eq(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert new file mode 100644 index 000000000..eab3324fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(equal(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert new file mode 100644 index 000000000..738a3d93b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 eq(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(eq(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag new file mode 100644 index 000000000..34ab9ce3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(equal(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag new file mode 100644 index 000000000..3b6b2bc1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 eq(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + if(a[2] == b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(eq(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert new file mode 100644 index 000000000..dd8471555 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(equal(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert new file mode 100644 index 000000000..5884c39a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 eq(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + if(a[2] == b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(eq(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag new file mode 100644 index 000000000..33723d453 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(equal(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag new file mode 100644 index 000000000..b343d82a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 eq(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(eq(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert new file mode 100644 index 000000000..bebfbb5e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(equal(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert new file mode 100644 index 000000000..89290a760 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 eq(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(eq(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag new file mode 100644 index 000000000..fdccc6510 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(equal(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag new file mode 100644 index 000000000..541de8571 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 eq(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + if(a[2] == b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(eq(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert new file mode 100644 index 000000000..d975735f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(equal(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert new file mode 100644 index 000000000..1dc5e80ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 eq(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] == b[0]) result[0] = true; + else result[0] = false; + if(a[1] == b[1]) result[1] = true; + else result[1] = false; + if(a[2] == b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(eq(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt new file mode 100644 index 000000000..cd4a81eb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +equal_001_to_008.html +equal_009_to_012.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html new file mode 100644 index 000000000..6c7651220 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: exp_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html new file mode 100644 index 000000000..f93be54e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: exp_009_to_012.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag new file mode 100644 index 000000000..86ed7588c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp3 = 20.0855; + float c = color.r; + gl_FragColor = vec4(exp(3.0 * c) / exp3, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag new file mode 100644 index 000000000..f13fca97d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + const float exp3 = 20.0855; + float c = color.r; + gl_FragColor = vec4(pow(exp1, 3.0 * c) / exp3, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag new file mode 100644 index 000000000..785a46471 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = -color.r; + gl_FragColor = vec4(exp(3.0 * c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag new file mode 100644 index 000000000..08503fa51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + float c = color.r; + gl_FragColor = vec4(1.0 / pow(exp1, 3.0 * c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert new file mode 100644 index 000000000..df41faff3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp3 = 20.0855; + float c = gtf_Color.r; + color = vec4(exp(3.0 * c) / exp3, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert new file mode 100644 index 000000000..f83a25bb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + const float exp3 = 20.0855; + float c = gtf_Color.r; + color = vec4(pow(exp1, 3.0 * c) / exp3, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert new file mode 100644 index 000000000..7d1f08a6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = -gtf_Color.r; + color = vec4(exp(3.0 * c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert new file mode 100644 index 000000000..b429ff8ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + float c = gtf_Color.r; + color = vec4(1.0 / pow(exp1, 3.0 * c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag new file mode 100644 index 000000000..be85cb373 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp3 = 20.0855; + vec2 c = color.rg; + gl_FragColor = vec4(exp(3.0 * c) / exp3, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..9b11c7672 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + const float exp3 = 20.0855; + vec2 c = color.rg; + gl_FragColor = vec4(pow(vec2(exp1), 3.0 * c) / exp3, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag new file mode 100644 index 000000000..5a81055ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = -color.rg; + gl_FragColor = vec4(exp(3.0 * c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag new file mode 100644 index 000000000..ddfeae7f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + vec2 c = color.rg; + gl_FragColor = vec4(1.0 / pow(vec2(exp1), 3.0 * c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert new file mode 100644 index 000000000..c22d89ed3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp3 = 20.0855; + vec2 c = gtf_Color.rg; + color = vec4(exp(3.0 * c) / exp3, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..47a68f504 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + const float exp3 = 20.0855; + vec2 c = gtf_Color.rg; + color = vec4(pow(vec2(exp1), 3.0 * c) / exp3, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert new file mode 100644 index 000000000..aae926d6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = -gtf_Color.rg; + color = vec4(exp(3.0 * c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert new file mode 100644 index 000000000..900695648 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + vec2 c = gtf_Color.rg; + color = vec4(1.0 / pow(vec2(exp1), 3.0 * c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag new file mode 100644 index 000000000..446532a2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp3 = 20.0855; + vec3 c = color.rgb; + gl_FragColor = vec4(exp(3.0 * c) / exp3, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..b481b7dcd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + const float exp3 = 20.0855; + vec3 c = color.rgb; + gl_FragColor = vec4(pow(vec3(exp1), 3.0 * c) / exp3, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag new file mode 100644 index 000000000..a836e8786 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = -color.rgb; + gl_FragColor = vec4(exp(3.0 * c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag new file mode 100644 index 000000000..e710a7973 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + vec3 c = color.rgb; + gl_FragColor = vec4(1.0 / pow(vec3(exp1), 3.0 * c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert new file mode 100644 index 000000000..b1056c28a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp3 = 20.0855; + vec3 c = gtf_Color.rgb; + color = vec4(exp(3.0 * c) / exp3, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..f1385688c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + const float exp3 = 20.0855; + vec3 c = gtf_Color.rgb; + color = vec4(pow(vec3(exp1), 3.0 * c) / exp3, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert new file mode 100644 index 000000000..d6c6c5644 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = -gtf_Color.rgb; + color = vec4(exp(3.0 * c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert new file mode 100644 index 000000000..f361d9feb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float exp1 = 2.7183; + vec3 c = gtf_Color.rgb; + color = vec4(1.0 / pow(vec3(exp1), 3.0 * c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt new file mode 100644 index 000000000..4f56a2b32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +exp_001_to_008.html +exp_009_to_012.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html new file mode 100644 index 000000000..69095670b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: exp2_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html new file mode 100644 index 000000000..211fac0bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: exp2_009_to_012.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag new file mode 100644 index 000000000..922a733df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = color.r; + gl_FragColor = vec4(exp2(5.0 * c) / 32.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag new file mode 100644 index 000000000..88a6eae8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = color.r; + gl_FragColor = vec4(pow(2.0, 5.0 * c) / 32.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag new file mode 100644 index 000000000..914026405 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = -color.r; + gl_FragColor = vec4(exp2(5.0 * c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag new file mode 100644 index 000000000..d8167046f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = color.r; + gl_FragColor = vec4(1.0 / pow(2.0, 5.0 * c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert new file mode 100644 index 000000000..c3b914833 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = gtf_Color.r; + color = vec4(exp2(5.0 * c) / 32.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert new file mode 100644 index 000000000..69898a603 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = gtf_Color.r; + color = vec4(pow(2.0, 5.0 * c) / 32.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert new file mode 100644 index 000000000..8955e3cfb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = -gtf_Color.r; + color = vec4(exp2(5.0 * c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert new file mode 100644 index 000000000..2fc614e5a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = gtf_Color.r; + color = vec4(1.0 / pow(2.0, 5.0 * c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag new file mode 100644 index 000000000..8af82a79b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = color.rg; + gl_FragColor = vec4(exp2(5.0 * c) / 32.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..77c44ff3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = color.rg; + gl_FragColor = vec4(pow(vec2(2.0), 5.0 * c) / 32.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag new file mode 100644 index 000000000..b7805bead --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = -color.rg; + gl_FragColor = vec4(exp2(5.0 * c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag new file mode 100644 index 000000000..ddfaea250 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = color.rg; + gl_FragColor = vec4(1.0 / pow(vec2(2.0), 5.0 * c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert new file mode 100644 index 000000000..9903e6692 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = gtf_Color.rg; + color = vec4(exp2(5.0 * c) / 32.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..da02403b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = gtf_Color.rg; + color = vec4(pow(vec2(2.0), 5.0 * c) / 32.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert new file mode 100644 index 000000000..b94b23dd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = -gtf_Color.rg; + color = vec4(exp2(5.0 * c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert new file mode 100644 index 000000000..8284a474e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = gtf_Color.rg; + color = vec4(1.0 / pow(vec2(2.0), 5.0 * c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag new file mode 100644 index 000000000..1f289ce15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = color.rgb; + gl_FragColor = vec4(exp2(5.0 * c) / 32.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..b75546900 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = color.rgb; + gl_FragColor = vec4(pow(vec3(2.0), 5.0 * c) / 32.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag new file mode 100644 index 000000000..c401e57d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = -color.rgb; + gl_FragColor = vec4(exp2(5.0 * c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag new file mode 100644 index 000000000..6f945903d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = color.rgb; + gl_FragColor = vec4(1.0 / pow(vec3(2.0), 5.0 * c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert new file mode 100644 index 000000000..d59cb3ef5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = gtf_Color.rgb; + color = vec4(exp2(5.0 * c) / 32.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..3e8cc48a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = gtf_Color.rgb; + color = vec4(pow(vec3(2.0), 5.0 * c) / 32.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert new file mode 100644 index 000000000..4d154bc17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = -gtf_Color.rgb; + color = vec4(exp2(5.0 * c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert new file mode 100644 index 000000000..b0bc7818d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = gtf_Color.rgb; + color = vec4(1.0 / pow(vec3(2.0), 5.0 * c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt new file mode 100644 index 000000000..f893cd413 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +exp2_001_to_008.html +exp2_009_to_012.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html new file mode 100644 index 000000000..4d484d5e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: faceforward_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag new file mode 100644 index 000000000..07ef6fbf0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (color.g * 2.0) - 1.0; + float v2 = (color.b * 2.0) - 1.0; + + gl_FragColor = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag new file mode 100644 index 000000000..5b5b2fd3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (color.g * 2.0) - 1.0; + float v2 = (color.b * 2.0) - 1.0; + + if(dot(v1, v2) >= 0.0) v1 *= -1.0; + gl_FragColor = vec4((v1 + 1.0) / 2.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert new file mode 100644 index 000000000..77d5d796e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (gtf_Color.g * 2.0) - 1.0; + float v2 = (gtf_Color.b * 2.0) - 1.0; + + color = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert new file mode 100644 index 000000000..0e1d365b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (gtf_Color.g * 2.0) - 1.0; + float v2 = (gtf_Color.b * 2.0) - 1.0; + + if(dot(v1, v2) >= 0.0) v1 *= -1.0; + color = vec4((v1 + 1.0) / 2.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag new file mode 100644 index 000000000..ec0f1c2f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + gl_FragColor = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag new file mode 100644 index 000000000..a50f45485 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + if(dot(v1, v2) >= 0.0) v1 *= -1.0; + gl_FragColor = vec4((v1 + 1.0) / 2.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert new file mode 100644 index 000000000..80d186c97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + color = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert new file mode 100644 index 000000000..41a04ef60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + if(dot(v1, v2) >= 0.0) v1 *= -1.0; + color = vec4((v1 + 1.0) / 2.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag new file mode 100644 index 000000000..5db1d0fc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + gl_FragColor = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag new file mode 100644 index 000000000..fb68855f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + if(dot(v1, v2) >= 0.0) v1 *= -1.0; + gl_FragColor = vec4((v1 + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert new file mode 100644 index 000000000..a745681dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + color = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert new file mode 100644 index 000000000..d08a74620 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + if(dot(v1, v2) >= 0.0) v1 *= -1.0; + color = vec4((v1 + 1.0) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt new file mode 100644 index 000000000..4107e6397 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +faceforward_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html new file mode 100644 index 000000000..97033bf57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: floor_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag new file mode 100644 index 000000000..3f9188418 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4((floor(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag new file mode 100644 index 000000000..11ec5e6e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float floor_ref(float x) +{ + if(x >= 0.0) + x = float(int(x)); + else + x = float(int(x) - 1); + return x; +} + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert new file mode 100644 index 000000000..1ed8d39c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4((floor(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert new file mode 100644 index 000000000..5be14322e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +float floor_ref(float x) +{ + if(x >= 0.0) + x = float(int(x)); + else + x = float(int(x) - 1); + return x; +} + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag new file mode 100644 index 000000000..1a56a4fcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4((floor(c) + 10.0) / 20.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..f8aba8d5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +vec2 floor_ref(vec2 x) +{ + if(x[0] >= 0.0) + x[0] = float(int(x[0])); + else + x[0] = float(int(x[0]) - 1); + if(x[1] >= 0.0) + x[1] = float(int(x[1])); + else + x[1] = float(int(x[1]) - 1); + return x; +} + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert new file mode 100644 index 000000000..c977d879b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4((floor(c) + 10.0) / 20.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..232d5fee3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +vec2 floor_ref(vec2 x) +{ + if(x[0] >= 0.0) + x[0] = float(int(x[0])); + else + x[0] = float(int(x[0]) - 1); + if(x[1] >= 0.0) + x[1] = float(int(x[1])); + else + x[1] = float(int(x[1]) - 1); + return x; +} + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag new file mode 100644 index 000000000..bb7f72018 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4((floor(c) + 10.0) / 20.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..1209631ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +vec3 floor_ref(vec3 x) +{ + if(x[0] >= 0.0) + x[0] = float(int(x[0])); + else + x[0] = float(int(x[0]) - 1); + if(x[1] >= 0.0) + x[1] = float(int(x[1])); + else + x[1] = float(int(x[1]) - 1); + if(x[2] >= 0.0) + x[2] = float(int(x[2])); + else + x[2] = float(int(x[2]) - 1); + return x; +} + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4((floor_ref(c) + 10.0) / 20.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert new file mode 100644 index 000000000..febeb930c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4((floor(c) + 10.0) / 20.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..247aa1aa3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +vec3 floor_ref(vec3 x) +{ + if(x[0] >= 0.0) + x[0] = float(int(x[0])); + else + x[0] = float(int(x[0]) - 1); + if(x[1] >= 0.0) + x[1] = float(int(x[1])); + else + x[1] = float(int(x[1]) - 1); + if(x[2] >= 0.0) + x[2] = float(int(x[2])); + else + x[2] = float(int(x[2]) - 1); + return x; +} + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4((floor_ref(c) + 10.0) / 20.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt new file mode 100644 index 000000000..337787db8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +floor_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html new file mode 100644 index 000000000..a750cb2fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: fract_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag new file mode 100644 index 000000000..8ad6c92f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + c = abs(fract(c) - 0.5) * 2.0; + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag new file mode 100644 index 000000000..2105d7fcd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + c = abs((c - floor(c)) - 0.5) * 2.0; + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert new file mode 100644 index 000000000..8724037ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + c = abs(fract(c) - 0.5) * 2.0; + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert new file mode 100644 index 000000000..773fd7904 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + c = abs((c - floor(c)) - 0.5) * 2.0; + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag new file mode 100644 index 000000000..6d9e3fa0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + c = abs(fract(c) - 0.5) * 2.0; + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..222b2e96f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + c = abs((c - floor(c)) - 0.5) * 2.0; + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert new file mode 100644 index 000000000..bb8acce36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + c = abs(fract(c) - 0.5) * 2.0; + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..31546ff4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + c = abs((c - floor(c)) - 0.5) * 2.0; + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag new file mode 100644 index 000000000..bf409a7a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + c = abs(fract(c) - 0.5) * 2.0; + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..8a6842303 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + c = abs((c - floor(c)) - 0.5) * 2.0; + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert new file mode 100644 index 000000000..2d83b0348 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + c = abs(fract(c) - 0.5) * 2.0; + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..5092c8533 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + c = abs((c - floor(c)) - 0.5) * 2.0; + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt new file mode 100644 index 000000000..74ccc68b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +fract_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag new file mode 100644 index 000000000..594afd940 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag @@ -0,0 +1,102 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + + + +void qualifiers(in float a[4], out float b[4], inout float c[4], const in float d[4], float e[4]) +{ + b[0] = a[0]; + c[0] += d[0]; + a[0] += 1.0; + e[0] += 1.0; + + b[1] = a[1]; + c[1] += d[1]; + a[1] += 1.0; + e[1] += 1.0; + + b[2] = a[2]; + c[2] += d[2]; + a[2] += 1.0; + e[2] += 1.0; + + b[3] = a[3]; + c[3] += d[3]; + a[3] += 1.0; + e[3] += 1.0; +} + + + +void main (void) +{ + float a[4]; + float b[4]; + float c[4]; + float d[4]; + float e[4]; + float q = 0.0; + float q2 = 0.0; + + a[0] = 1.0; + b[0] = 2.0; + c[0] = 3.0; + d[0] = 4.0; + e[0] = 1.0; + + a[1] = 1.0; + b[1] = 2.0; + c[1] = 3.0; + d[1] = 4.0; + e[1] = 1.0; + + a[2] = 1.0; + b[2] = 2.0; + c[2] = 3.0; + d[2] = 4.0; + e[2] = 1.0; + + a[3] = 1.0; + b[3] = 2.0; + c[3] = 3.0; + d[3] = 4.0; + e[3] = 1.0; + + qualifiers(a, b, c, d, e); + + // randomly test a value + if(a[0] == 1.0) q += 1.0; + if(b[1] == 1.0) q += 2.0; + if(c[2] == 7.0) q += 4.0; + if(d[3] == 4.0) q2 += 1.0; + if(e[0] == 1.0) q2 += 2.0; + + gl_FragColor = vec4(vec2(q / 7.0, q2 / 3.0), 1.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert new file mode 100644 index 000000000..64d23d278 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert @@ -0,0 +1,103 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +void qualifiers(in float a[4], out float b[4], inout float c[4], const in float d[4], float e[4]) +{ + b[0] = a[0]; + c[0] += d[0]; + a[0] += 1.0; + e[0] += 1.0; + + b[1] = a[1]; + c[1] += d[1]; + a[1] += 1.0; + e[1] += 1.0; + + b[2] = a[2]; + c[2] += d[2]; + a[2] += 1.0; + e[2] += 1.0; + + b[3] = a[3]; + c[3] += d[3]; + a[3] += 1.0; + e[3] += 1.0; +} + + + + +void main (void) +{ + float a[4]; + float b[4]; + float c[4]; + float d[4]; + float e[4]; + float q = 0.0; + float q2 = 0.0; + + a[0] = 1.0; + b[0] = 2.0; + c[0] = 3.0; + d[0] = 4.0; + e[0] = 1.0; + + a[1] = 1.0; + b[1] = 2.0; + c[1] = 3.0; + d[1] = 4.0; + e[1] = 1.0; + + a[2] = 1.0; + b[2] = 2.0; + c[2] = 3.0; + d[2] = 4.0; + e[2] = 1.0; + + a[3] = 1.0; + b[3] = 2.0; + c[3] = 3.0; + d[3] = 4.0; + e[3] = 1.0; + + qualifiers(a, b, c, d, e); + + // randomly test a value + if(a[0] == 1.0) q += 1.0; + if(b[1] == 1.0) q += 2.0; + if(c[2] == 7.0) q += 4.0; + if(d[3] == 4.0) q2 += 1.0; + if(e[0] == 1.0) q2 += 2.0; + + color = vec4(vec2(q / 7.0, q2 / 3.0), 1.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag new file mode 100644 index 000000000..6ba41dea0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bool function(bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +bool function(bool par[3]) +{ + // Return the value of the array. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; + } + else + return false; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert new file mode 100644 index 000000000..3d643b152 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bool function(bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +bool function(bool par[3]) +{ + // Return the value of the array. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; + } + else + return false; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag new file mode 100644 index 000000000..900dbd263 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bool function(bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(par && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bool function(bool par) +{ + // Return the value of the parameter. + if(par) + { + // Test parameter qualifier (default is "in"). + par = false; + + return true; + } + else + return false; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert new file mode 100644 index 000000000..bbf763e94 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bool function(bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(par && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bool function(bool par) +{ + // Return the value of the parameter. + if(par) + { + // Test parameter qualifier (default is "in"). + par = false; + + return true; + } + else + return false; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag new file mode 100644 index 000000000..1d08ca5e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bool function(in bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bool function(in bool par[3]) +{ + // Return the value of the array. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; + } + else + return false; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert new file mode 100644 index 000000000..f8b3ec065 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bool function(in bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bool function(in bool par[3]) +{ + // Return the value of the array. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; + } + else + return false; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag new file mode 100644 index 000000000..bfc49e26f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bool function(in bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(par && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bool function(in bool par) +{ + // Return the value of the parameter. + if(par) + { + // Test parameter qualifier (default is "in"). + par = false; + + return true; + } + else + return false; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert new file mode 100644 index 000000000..a2d51b77d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bool function(in bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(par && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bool function(in bool par) +{ + // Return the value of the parameter. + if(par) + { + // Test parameter qualifier (default is "in"). + par = false; + + return true; + } + else + return false; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag new file mode 100644 index 000000000..51adf2723 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bool function(inout bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bool function(inout bool par[3]) +{ + // Return the value of the array. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; + } + else + return false; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert new file mode 100644 index 000000000..43429dc94 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bool function(inout bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bool function(inout bool par[3]) +{ + // Return the value of the array. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; + } + else + return false; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag new file mode 100644 index 000000000..af091de6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bool function(inout bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(!par && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bool function(inout bool par) +{ + // Return the value of the parameter. + if(par) + { + // Test parameter qualifier (default is "in"). + par = false; + + return true; + } + else + return false; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert new file mode 100644 index 000000000..41552dfee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bool function(inout bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(!par && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bool function(inout bool par) +{ + // Return the value of the parameter. + if(par) + { + // Test parameter qualifier (default is "in"). + par = false; + + return true; + } + else + return false; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag new file mode 100644 index 000000000..10df063d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bool function(out bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bool function(out bool par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert new file mode 100644 index 000000000..85615ac68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bool function(out bool par[3]); +bool is_all(const in bool array[3], const in bool value); +void set_all(out bool array[3], const in bool value); + +void main (void) +{ + bool par[3]; + bool ret = false; + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, true); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bool function(out bool par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return true; +} + +bool is_all(const in bool array[3], const in bool value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bool array[3], const in bool value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag new file mode 100644 index 000000000..0a67173a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bool function(out bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(!par && ret) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bool function(out bool par) +{ + // Test parameter qualifier (default is "in"). + par = false; + + return true; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert new file mode 100644 index 000000000..92a46a908 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bool function(out bool par); + +void main (void) +{ + bool par = true; + bool ret = false; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(!par && ret) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bool function(out bool par) +{ + // Test parameter qualifier (default is "in"). + par = false; + + return true; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag new file mode 100644 index 000000000..f8a77b898 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bvec4 function(bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +bvec4 function(bvec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert new file mode 100644 index 000000000..1a528b8cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bvec4 function(bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +bvec4 function(bvec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag new file mode 100644 index 000000000..d2f5c7e29 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bvec4 function(bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bvec4 function(bvec4 par) +{ + // Return the value of the parameter. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert new file mode 100644 index 000000000..e3354f23b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bvec4 function(bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bvec4 function(bvec4 par) +{ + // Return the value of the parameter. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag new file mode 100644 index 000000000..f4479e680 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bvec4 function(in bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +bvec4 function(in bvec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert new file mode 100644 index 000000000..ae5dde803 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bvec4 function(in bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +bvec4 function(in bvec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag new file mode 100644 index 000000000..a13cee3ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bvec4 function(in bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bvec4 function(in bvec4 par) +{ + // Return the value of the parameter. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert new file mode 100644 index 000000000..b919bf6b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bvec4 function(in bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return true. + if(is_all(par, true) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bvec4 function(in bvec4 par) +{ + // Return the value of the parameter. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag new file mode 100644 index 000000000..e61a00534 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bvec4 function(inout bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +bvec4 function(inout bvec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert new file mode 100644 index 000000000..710ff576a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bvec4 function(inout bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +bvec4 function(inout bvec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag new file mode 100644 index 000000000..5a114e9be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag @@ -0,0 +1,129 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bvec4 function(inout bvec4 par[10]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[10], const in bvec4 value); +void set_all(out bvec4 array[10], const in bvec4 value); + +void main (void) +{ + bvec4 par[10]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +bvec4 function(inout bvec4 par[10]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[10], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + if(array[3] != value) + ret = false; + if(array[4] != value) + ret = false; + if(array[5] != value) + ret = false; + if(array[6] != value) + ret = false; + if(array[7] != value) + ret = false; + if(array[8] != value) + ret = false; + if(array[9] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[10], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; + array[3] = value; + array[4] = value; + array[5] = value; + array[6] = value; + array[7] = value; + array[8] = value; + array[9] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert new file mode 100644 index 000000000..92f5db9a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert @@ -0,0 +1,129 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bvec4 function(inout bvec4 par[10]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[10], const in bvec4 value); +void set_all(out bvec4 array[10], const in bvec4 value); + +void main (void) +{ + bvec4 par[10]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +bvec4 function(inout bvec4 par[10]) +{ + // Return the value of the array. + if(is_all(par, bvec4(true, true, true, true))) + { + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[10], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + if(array[3] != value) + ret = false; + if(array[4] != value) + ret = false; + if(array[5] != value) + ret = false; + if(array[6] != value) + ret = false; + if(array[7] != value) + ret = false; + if(array[8] != value) + ret = false; + if(array[9] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[10], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; + array[3] = value; + array[4] = value; + array[5] = value; + array[6] = value; + array[7] = value; + array[8] = value; + array[9] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag new file mode 100644 index 000000000..e1f4a1f91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bvec4 function(inout bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bvec4 function(inout bvec4 par) +{ + // Return the value of the parameter. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert new file mode 100644 index 000000000..4f8820bc4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bvec4 function(inout bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bvec4 function(inout bvec4 par) +{ + // Return the value of the parameter. + if(is_all(par, true)) + { + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); + } + else + return bvec4(false, false, false, false); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag new file mode 100644 index 000000000..e3f50a63f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag @@ -0,0 +1,102 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +bvec4 function(out bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +bvec4 function(out bvec4 par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert new file mode 100644 index 000000000..b64a447b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert @@ -0,0 +1,102 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +bvec4 function(out bvec4 par[3]); +bool is_all(const in bvec4 par, const in bool value); +bool is_all(const in bvec4 array[3], const in bvec4 value); +void set_all(out bvec4 array[3], const in bvec4 value); + +void main (void) +{ + bvec4 par[3]; + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + // Initialize the entire array to true. + set_all(par, bvec4(true, true, true, true)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +bvec4 function(out bvec4 par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, bvec4(false, false, false, false)); + + return bvec4(true, true, true, true); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in bvec4 array[3], const in bvec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 array[3], const in bvec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag new file mode 100644 index 000000000..1f9236200 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +bvec4 function(out bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && is_all(ret, true)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +bvec4 function(out bvec4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert new file mode 100644 index 000000000..99c318fe7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +bvec4 function(out bvec4 par); +bool is_all(const in bvec4 par, const in bool value); +void set_all(out bvec4 par, const in bool value); + +void main (void) +{ + bvec4 par = bvec4(true, true, true, true); + bvec4 ret = bvec4(false, false, false, false); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return true. + if(is_all(par, false) && is_all(ret, true)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +bvec4 function(out bvec4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, false); + + return bvec4(true, true, true, true); +} + +bool is_all(const in bvec4 par, const in bool value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out bvec4 par, const in bool value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag new file mode 100644 index 000000000..b3a130eec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +float function(float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +float function(float par[3]) +{ + // Return the value of the array. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; + } + else + return 0.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert new file mode 100644 index 000000000..4763c1ad8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +float function(float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +float function(float par[3]) +{ + // Return the value of the array. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; + } + else + return 0.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag new file mode 100644 index 000000000..51d735717 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +float function(float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if((par == 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +float function(float par) +{ + // Return the value of the parameter. + if(par == 1.0) + { + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; + } + else + return 0.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert new file mode 100644 index 000000000..f41995b3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +float function(float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if((par == 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +float function(float par) +{ + // Return the value of the parameter. + if(par == 1.0) + { + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; + } + else + return 0.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag new file mode 100644 index 000000000..33e0ab611 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +float function(in float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +float function(in float par[3]) +{ + // Return the value of the array. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; + } + else + return 0.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert new file mode 100644 index 000000000..a685e7345 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +float function(in float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +float function(in float par[3]) +{ + // Return the value of the array. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; + } + else + return 0.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag new file mode 100644 index 000000000..09870afe5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +float function(in float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if((par == 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +float function(in float par) +{ + // Return the value of the parameter. + if(par == 1.0) + { + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; + } + else + return 0.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert new file mode 100644 index 000000000..f1f47f303 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +float function(in float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if((par == 1.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +float function(in float par) +{ + // Return the value of the parameter. + if(par == 1.0) + { + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; + } + else + return 0.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag new file mode 100644 index 000000000..fd0fa1096 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +float function(inout float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +float function(inout float par[3]) +{ + // Return the value of the array. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; + } + else + return 0.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert new file mode 100644 index 000000000..d4c82f266 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +float function(inout float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +float function(inout float par[3]) +{ + // Return the value of the array. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; + } + else + return 0.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag new file mode 100644 index 000000000..ce0d3d0c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +float function(inout float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if((par == 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +float function(inout float par) +{ + // Return the value of the parameter. + if(par == 1.0) + { + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; + } + else + return 0.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert new file mode 100644 index 000000000..04d063561 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +float function(inout float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if((par == 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +float function(inout float par) +{ + // Return the value of the parameter. + if(par == 1.0) + { + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; + } + else + return 0.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag new file mode 100644 index 000000000..3df819493 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +float function(out float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +float function(out float par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert new file mode 100644 index 000000000..212f4e846 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +float function(out float par[3]); +bool is_all(const in float array[3], const in float value); +void set_all(out float array[3], const in float value); + +void main (void) +{ + float par[3]; + float ret = 0.0; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, 1.0); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +float function(out float par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return 1.0; +} + +bool is_all(const in float array[3], const in float value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out float array[3], const in float value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag new file mode 100644 index 000000000..c0aafb071 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +float function(out float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if((par == 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +float function(out float par) +{ + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert new file mode 100644 index 000000000..48837c9f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +float function(out float par); + +void main (void) +{ + float par = 1.0; + float ret = 0.0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if((par == 0.0) && (ret == 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +float function(out float par) +{ + // Test parameter qualifier (default is "in"). + par = 0.0; + + return 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html new file mode 100644 index 000000000..1794e665a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html new file mode 100644 index 000000000..2904bb259 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html new file mode 100644 index 000000000..e2e2a4e04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_017_to_024.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html new file mode 100644 index 000000000..e3dc8b224 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_025_to_032.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html new file mode 100644 index 000000000..b1eeacc98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_033_to_040.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html new file mode 100644 index 000000000..eea38d83c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_041_to_048.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html new file mode 100644 index 000000000..27828a951 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_049_to_056.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html new file mode 100644 index 000000000..0385f2da0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_057_to_064.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html new file mode 100644 index 000000000..d849841b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_065_to_072.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html new file mode 100644 index 000000000..1a8c13901 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_073_to_080.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html new file mode 100644 index 000000000..3f2b88c5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_081_to_088.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html new file mode 100644 index 000000000..c624742fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_089_to_096.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html new file mode 100644 index 000000000..e71def193 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_097_to_104.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html new file mode 100644 index 000000000..a3813704b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_105_to_112.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html new file mode 100644 index 000000000..f8f723da9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: functions_113_to_120.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html new file mode 100644 index 000000000..ce9f9037c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html @@ -0,0 +1,201 @@ + + + + + +WebGL GLSL conformance test: functions_121_to_126.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt new file mode 100644 index 000000000..00b4fa8fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt @@ -0,0 +1,17 @@ +# this file is auto-generated. DO NOT EDIT. +functions_001_to_008.html +functions_009_to_016.html +functions_017_to_024.html +functions_025_to_032.html +functions_033_to_040.html +functions_041_to_048.html +functions_049_to_056.html +functions_057_to_064.html +functions_065_to_072.html +functions_073_to_080.html +functions_081_to_088.html +functions_089_to_096.html +functions_097_to_104.html +functions_105_to_112.html +functions_113_to_120.html +functions_121_to_126.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag new file mode 100644 index 000000000..59a502afe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +int function(int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +int function(int par[3]) +{ + // Return the value of the array. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; + } + else + return 0; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert new file mode 100644 index 000000000..8b9e0417d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +int function(int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +int function(int par[3]) +{ + // Return the value of the array. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; + } + else + return 0; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag new file mode 100644 index 000000000..3f9fc4438 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +int function(int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if((par == 1) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +int function(int par) +{ + // Return the value of the parameter. + if(par == 1) + { + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; + } + else + return 0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert new file mode 100644 index 000000000..73e895d7f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +int function(int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if((par == 1) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +int function(int par) +{ + // Return the value of the parameter. + if(par == 1) + { + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; + } + else + return 0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag new file mode 100644 index 000000000..b9e2910bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +int function(in int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +int function(in int par[3]) +{ + // Return the value of the array. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; + } + else + return 0; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert new file mode 100644 index 000000000..3d807a18e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +int function(in int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +int function(in int par[3]) +{ + // Return the value of the array. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; + } + else + return 0; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag new file mode 100644 index 000000000..4be3d649c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +int function(in int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if((par == 1) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +int function(in int par) +{ + // Return the value of the parameter. + if(par == 1) + { + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; + } + else + return 0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert new file mode 100644 index 000000000..020d79492 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +int function(in int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if((par == 1) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +int function(in int par) +{ + // Return the value of the parameter. + if(par == 1) + { + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; + } + else + return 0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag new file mode 100644 index 000000000..91d71268d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +int function(inout int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +int function(inout int par[3]) +{ + // Return the value of the array. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; + } + else + return 0; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert new file mode 100644 index 000000000..efaf9f449 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +int function(inout int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +int function(inout int par[3]) +{ + // Return the value of the array. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; + } + else + return 0; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag new file mode 100644 index 000000000..e2780c41c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +int function(inout int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if((par == 0) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +int function(inout int par) +{ + // Return the value of the parameter. + if(par == 1) + { + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; + } + else + return 0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert new file mode 100644 index 000000000..e252ac4cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +int function(inout int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if((par == 0) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +int function(inout int par) +{ + // Return the value of the parameter. + if(par == 1) + { + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; + } + else + return 0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag new file mode 100644 index 000000000..a46c860f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +int function(out int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +int function(out int par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert new file mode 100644 index 000000000..5dd10b833 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +int function(out int par[3]); +bool is_all(const in int array[3], const in int value); +void set_all(out int array[3], const in int value); + +void main (void) +{ + int par[3]; + int ret = 0; + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, 1); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +int function(out int par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return 1; +} + +bool is_all(const in int array[3], const in int value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out int array[3], const in int value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag new file mode 100644 index 000000000..822948a2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +int function(out int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if((par == 0) && (ret == 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +int function(out int par) +{ + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert new file mode 100644 index 000000000..6a5d0b85c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +int function(out int par); + +void main (void) +{ + int par = 1; + int ret = 0; + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if((par == 0) && (ret == 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +int function(out int par) +{ + // Test parameter qualifier (default is "in"). + par = 0; + + return 1; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag new file mode 100644 index 000000000..1ee72fd7f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +ivec4 function(ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +ivec4 function(ivec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert new file mode 100644 index 000000000..82be12d55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +ivec4 function(ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +ivec4 function(ivec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag new file mode 100644 index 000000000..1a66f95e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +ivec4 function(ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +ivec4 function(ivec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert new file mode 100644 index 000000000..3680ca051 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +ivec4 function(ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +ivec4 function(ivec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag new file mode 100644 index 000000000..7aa71b48a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +ivec4 function(in ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +ivec4 function(in ivec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert new file mode 100644 index 000000000..df24cc8ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +ivec4 function(in ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +ivec4 function(in ivec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag new file mode 100644 index 000000000..bc6c03adc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +ivec4 function(in ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +ivec4 function(in ivec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert new file mode 100644 index 000000000..1f0e3cd2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +ivec4 function(in ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1. + if(is_all(par, 1) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +ivec4 function(in ivec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag new file mode 100644 index 000000000..4aae9eebf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +ivec4 function(inout ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +ivec4 function(inout ivec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert new file mode 100644 index 000000000..069dae62c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +ivec4 function(inout ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +ivec4 function(inout ivec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag new file mode 100644 index 000000000..d2f509df7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag @@ -0,0 +1,129 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +ivec4 function(inout ivec4 par[10]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[10], const in ivec4 value); +void set_all(out ivec4 array[10], const in ivec4 value); + +void main (void) +{ + ivec4 par[10]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +ivec4 function(inout ivec4 par[10]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[10], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + if(array[3] != value) + ret = false; + if(array[4] != value) + ret = false; + if(array[5] != value) + ret = false; + if(array[6] != value) + ret = false; + if(array[7] != value) + ret = false; + if(array[8] != value) + ret = false; + if(array[9] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[10], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; + array[3] = value; + array[4] = value; + array[5] = value; + array[6] = value; + array[7] = value; + array[8] = value; + array[9] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert new file mode 100644 index 000000000..0c69946a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert @@ -0,0 +1,129 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +ivec4 function(inout ivec4 par[10]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[10], const in ivec4 value); +void set_all(out ivec4 array[10], const in ivec4 value); + +void main (void) +{ + ivec4 par[10]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +ivec4 function(inout ivec4 par[10]) +{ + // Return the value of the array. + if(is_all(par, ivec4(1, 1, 1, 1))) + { + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[10], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + if(array[3] != value) + ret = false; + if(array[4] != value) + ret = false; + if(array[5] != value) + ret = false; + if(array[6] != value) + ret = false; + if(array[7] != value) + ret = false; + if(array[8] != value) + ret = false; + if(array[9] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[10], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; + array[3] = value; + array[4] = value; + array[5] = value; + array[6] = value; + array[7] = value; + array[8] = value; + array[9] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag new file mode 100644 index 000000000..aa75e3262 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +ivec4 function(inout ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +ivec4 function(inout ivec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert new file mode 100644 index 000000000..40e9db60c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +ivec4 function(inout ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +ivec4 function(inout ivec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); + } + else + return ivec4(0, 0, 0, 0); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag new file mode 100644 index 000000000..88ec4b637 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag @@ -0,0 +1,102 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +ivec4 function(out ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +ivec4 function(out ivec4 par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert new file mode 100644 index 000000000..c33908198 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert @@ -0,0 +1,102 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +ivec4 function(out ivec4 par[3]); +bool is_all(const in ivec4 par, const in int value); +bool is_all(const in ivec4 array[3], const in ivec4 value); +void set_all(out ivec4 array[3], const in ivec4 value); + +void main (void) +{ + ivec4 par[3]; + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + // Initialize the entire array to 1. + set_all(par, ivec4(1, 1, 1, 1)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +ivec4 function(out ivec4 par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, ivec4(0, 0, 0, 0)); + + return ivec4(1, 1, 1, 1); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in ivec4 array[3], const in ivec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 array[3], const in ivec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag new file mode 100644 index 000000000..9886a204f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +ivec4 function(out ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && is_all(ret, 1)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +ivec4 function(out ivec4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert new file mode 100644 index 000000000..1e376e399 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +ivec4 function(out ivec4 par); +bool is_all(const in ivec4 par, const in int value); +void set_all(out ivec4 par, const in int value); + +void main (void) +{ + ivec4 par = ivec4(1, 1, 1, 1); + ivec4 ret = ivec4(0, 0, 0, 0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1. + if(is_all(par, 0) && is_all(ret, 1)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +ivec4 function(out ivec4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0); + + return ivec4(1, 1, 1, 1); +} + +bool is_all(const in ivec4 par, const in int value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out ivec4 par, const in int value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag new file mode 100644 index 000000000..9ee51b4a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag @@ -0,0 +1,141 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, mat_ones) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +mat4 function(mat4 par[2]) +{ + // Return the value of the array. + if(is_all(par, mat_ones)) + { + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; + } + else + return mat_zeros; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert new file mode 100644 index 000000000..fd810d298 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert @@ -0,0 +1,141 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, mat_ones) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +mat4 function(mat4 par[2]) +{ + // Return the value of the array. + if(is_all(par, mat_ones)) + { + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; + } + else + return mat_zeros; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag new file mode 100644 index 000000000..284dcaa2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +mat4 function(mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +mat4 function(mat4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + } + else + return mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert new file mode 100644 index 000000000..c3e32d388 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +mat4 function(mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +mat4 function(mat4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + } + else + return mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag new file mode 100644 index 000000000..4f17432df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag @@ -0,0 +1,141 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(in mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, mat_ones) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +mat4 function(in mat4 par[2]) +{ + // Return the value of the array. + if(is_all(par, mat_ones)) + { + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; + } + else + return mat_zeros; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert new file mode 100644 index 000000000..9d28c3693 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert @@ -0,0 +1,141 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(in mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, mat_ones) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +mat4 function(in mat4 par[2]) +{ + // Return the value of the array. + if(is_all(par, mat_ones)) + { + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; + } + else + return mat_zeros; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag new file mode 100644 index 000000000..fd1faebce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +mat4 function(in mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +mat4 function(in mat4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + } + else + return mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert new file mode 100644 index 000000000..d606b7a43 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +mat4 function(in mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +mat4 function(in mat4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + } + else + return mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag new file mode 100644 index 000000000..e0d21a4f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag @@ -0,0 +1,141 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(inout mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, mat_zeros) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +mat4 function(inout mat4 par[2]) +{ + // Return the value of the array. + if(is_all(par, mat_ones)) + { + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; + } + else + return mat_zeros; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert new file mode 100644 index 000000000..981a11972 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert @@ -0,0 +1,141 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(inout mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, mat_zeros) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +mat4 function(inout mat4 par[2]) +{ + // Return the value of the array. + if(is_all(par, mat_ones)) + { + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; + } + else + return mat_zeros; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag new file mode 100644 index 000000000..5ad7e1755 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +mat4 function(inout mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +mat4 function(inout mat4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + } + else + return mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert new file mode 100644 index 000000000..b56fe2a97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +mat4 function(inout mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +mat4 function(inout mat4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + } + else + return mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag new file mode 100644 index 000000000..61b5da604 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag @@ -0,0 +1,135 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(out mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, mat_zeros) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +mat4 function(out mat4 par[2]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert new file mode 100644 index 000000000..dcccaa317 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert @@ -0,0 +1,135 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +const mat4 mat_ones = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +const mat4 mat_zeros = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + +// Function declarations. +mat4 function(out mat4 par[2]); +bool is_all(const in mat4 par, const in float value); +bool is_all(const in mat4 array[2], const in mat4 value); +void set_all(out mat4 array[2], const in mat4 value); + +void main (void) +{ + mat4 par[2]; + mat4 ret = mat_zeros; + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, mat_ones); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, mat_zeros) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +mat4 function(out mat4 par[2]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, mat_zeros); + + return mat_ones; +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +bool is_all(const in mat4 array[2], const in mat4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 array[2], const in mat4 value) +{ + array[0] = value; + array[1] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag new file mode 100644 index 000000000..870ee304c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag @@ -0,0 +1,136 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +mat4 function(out mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +mat4 function(out mat4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert new file mode 100644 index 000000000..12a42d343 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert @@ -0,0 +1,136 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +mat4 function(out mat4 par); +bool is_all(const in mat4 par, const in float value); +void set_all(out mat4 par, const in float value); + +void main (void) +{ + mat4 par = mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); + mat4 ret = mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +mat4 function(out mat4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return mat4(1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0); +} + +bool is_all(const in mat4 par, const in float value) +{ + bool ret = true; + + if(par[0][0] != value) + ret = false; + if(par[0][1] != value) + ret = false; + if(par[0][2] != value) + ret = false; + if(par[0][3] != value) + ret = false; + + if(par[1][0] != value) + ret = false; + if(par[1][1] != value) + ret = false; + if(par[1][2] != value) + ret = false; + if(par[1][3] != value) + ret = false; + + if(par[2][0] != value) + ret = false; + if(par[2][1] != value) + ret = false; + if(par[2][2] != value) + ret = false; + if(par[2][3] != value) + ret = false; + + if(par[3][0] != value) + ret = false; + if(par[3][1] != value) + ret = false; + if(par[3][2] != value) + ret = false; + if(par[3][3] != value) + ret = false; + + return ret; +} + +void set_all(out mat4 par, const in float value) +{ + par[0][0] = value; + par[0][1] = value; + par[0][2] = value; + par[0][3] = value; + + par[1][0] = value; + par[1][1] = value; + par[1][2] = value; + par[1][3] = value; + + par[2][0] = value; + par[2][1] = value; + par[2][2] = value; + par[2][3] = value; + + par[3][0] = value; + par[3][1] = value; + par[3][2] = value; + par[3][3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag new file mode 100644 index 000000000..2328826d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + + + +float qualifiers(in float a, out float b, inout float c, const in float d, float e) +{ + b = a; + c += d; + a += 1.0; + return e; +} + + + +void main (void) +{ + float a = 1.0, b = 2.0, c = 3.0, d = 4.0, e = 1.0, f = 0.0; + float q = 0.0; + float q2 = 0.0; + + f = qualifiers(a, b, c, d, e); + + if(a == 1.0) q += 1.0; + if(b == 1.0) q += 2.0; + if(c == 7.0) q += 4.0; + if(d == 4.0) q2 += 1.0; + if(e == 1.0) q2 += 2.0; + if(f == 1.0) q2 += 4.0; + + gl_FragColor = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert new file mode 100644 index 000000000..b5b7095b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +float qualifiers(in float a, out float b, inout float c, const in float d, float e) +{ + b = a; + c += d; + a += 1.0; + return e; +} + + + +void main (void) +{ + float a = 1.0, b = 2.0, c = 3.0, d = 4.0, e = 1.0, f = 0.0; + float q = 0.0; + float q2 = 0.0; + + f = qualifiers(a, b, c, d, e); + + if(a == 1.0) q += 1.0; + if(b == 1.0) q += 2.0; + if(c == 7.0) q += 4.0; + if(d == 4.0) q2 += 1.0; + if(e == 1.0) q2 += 2.0; + if(f == 1.0) q2 += 4.0; + + color = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag new file mode 100644 index 000000000..f176cdb0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + float a; + float b; + float c; + float d; +}; + + + +sabcd qualifiers(in sabcd a, out sabcd b, inout sabcd c, const in sabcd d, +sabcd e) +{ + sabcd one = sabcd(1.0, 1.0, 1.0, 1.0); + + b = a; + + c.a += d.a; + c.b += d.b; + c.c += d.c; + c.d += d.d; + + a.a += one.a; + a.b += one.b; + a.c += one.c; + a.d += one.d; + + return e; +} + +void main (void) +{ + sabcd a = sabcd(1.0, 1.0, 1.0, 1.0); + sabcd b = sabcd(2.0, 2.0, 2.0, 2.0); + sabcd c = sabcd(3.0, 3.0, 3.0, 3.0); + sabcd d = sabcd(4.0, 4.0, 4.0, 4.0); + sabcd e = sabcd(1.0, 1.0, 1.0, 1.0); + sabcd f = sabcd(0.0, 0.0, 0.0, 0.0); + sabcd one = sabcd(1.0, 1.0, 1.0, 1.0); + sabcd four = sabcd(4.0, 4.0, 4.0, 4.0); + sabcd seven = sabcd(7.0, 7.0, 7.0, 7.0); + float q = 0.0; + float q2 = 0.0; + + f = qualifiers(a, b, c, d, e); + + if(a == one) q += 1.0; + if(b == one) q += 2.0; + if(c == seven) q += 4.0; + if(d == four) q2 += 1.0; + if(e == one) q2 += 2.0; + if(f == one) q2 += 4.0; + + gl_FragColor = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert new file mode 100644 index 000000000..8d0b205be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert @@ -0,0 +1,87 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + float a; + float b; + float c; + float d; +}; + + + +sabcd qualifiers(in sabcd a, out sabcd b, inout sabcd c, const in sabcd d, +sabcd e) +{ + sabcd one = sabcd(1.0, 1.0, 1.0, 1.0); + + b = a; + + c.a += d.a; + c.b += d.b; + c.c += d.c; + c.d += d.d; + + a.a += one.a; + a.b += one.b; + a.c += one.c; + a.d += one.d; + + return e; +} + +void main (void) +{ + sabcd a = sabcd(1.0, 1.0, 1.0, 1.0); + sabcd b = sabcd(2.0, 2.0, 2.0, 2.0); + sabcd c = sabcd(3.0, 3.0, 3.0, 3.0); + sabcd d = sabcd(4.0, 4.0, 4.0, 4.0); + sabcd e = sabcd(1.0, 1.0, 1.0, 1.0); + sabcd f = sabcd(0.0, 0.0, 0.0, 0.0); + sabcd one = sabcd(1.0, 1.0, 1.0, 1.0); + sabcd four = sabcd(4.0, 4.0, 4.0, 4.0); + sabcd seven = sabcd(7.0, 7.0, 7.0, 7.0); + float q = 0.0; + float q2 = 0.0; + + f = qualifiers(a, b, c, d, e); + + if(a == one) q += 1.0; + if(b == one) q += 2.0; + if(c == seven) q += 4.0; + if(d == four) q2 += 1.0; + if(e == one) q2 += 2.0; + if(f == one) q2 += 4.0; + + color = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag new file mode 100644 index 000000000..1ffc79ea3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +vec4 function(vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +vec4 function(vec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert new file mode 100644 index 000000000..df7c8af77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +vec4 function(vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +vec4 function(vec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag new file mode 100644 index 000000000..59691446f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +vec4 function(vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +vec4 function(vec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert new file mode 100644 index 000000000..f6ca32e10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +vec4 function(vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +vec4 function(vec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag new file mode 100644 index 000000000..9120bb381 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +vec4 function(in vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +vec4 function(in vec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert new file mode 100644 index 000000000..4805d42fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +vec4 function(in vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +vec4 function(in vec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag new file mode 100644 index 000000000..bbe63fa28 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +vec4 function(in vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +vec4 function(in vec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert new file mode 100644 index 000000000..c6ab4b4e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +vec4 function(in vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should remain unchanged by the function and the function should return 1.0. + if(is_all(par, 1.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +vec4 function(in vec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag new file mode 100644 index 000000000..3aafe1267 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +vec4 function(inout vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +vec4 function(inout vec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert new file mode 100644 index 000000000..1c0d04511 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert @@ -0,0 +1,108 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +vec4 function(inout vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +vec4 function(inout vec4 par[3]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag new file mode 100644 index 000000000..3f28f2822 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag @@ -0,0 +1,129 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +vec4 function(inout vec4 par[10]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[10], const in vec4 value); +void set_all(out vec4 array[10], const in vec4 value); + +void main (void) +{ + vec4 par[10]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +vec4 function(inout vec4 par[10]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[10], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + if(array[3] != value) + ret = false; + if(array[4] != value) + ret = false; + if(array[5] != value) + ret = false; + if(array[6] != value) + ret = false; + if(array[7] != value) + ret = false; + if(array[8] != value) + ret = false; + if(array[9] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[10], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; + array[3] = value; + array[4] = value; + array[5] = value; + array[6] = value; + array[7] = value; + array[8] = value; + array[9] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert new file mode 100644 index 000000000..7a3ba4e2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert @@ -0,0 +1,129 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +vec4 function(inout vec4 par[10]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[10], const in vec4 value); +void set_all(out vec4 array[10], const in vec4 value); + +void main (void) +{ + vec4 par[10]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +vec4 function(inout vec4 par[10]) +{ + // Return the value of the array. + if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0))) + { + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[10], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + if(array[3] != value) + ret = false; + if(array[4] != value) + ret = false; + if(array[5] != value) + ret = false; + if(array[6] != value) + ret = false; + if(array[7] != value) + ret = false; + if(array[8] != value) + ret = false; + if(array[9] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[10], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; + array[3] = value; + array[4] = value; + array[5] = value; + array[6] = value; + array[7] = value; + array[8] = value; + array[9] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag new file mode 100644 index 000000000..04a76748b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +vec4 function(inout vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +vec4 function(inout vec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert new file mode 100644 index 000000000..f35fbdd85 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +vec4 function(inout vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +vec4 function(inout vec4 par) +{ + // Return the value of the parameter. + if(is_all(par, 1.0)) + { + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); + } + else + return vec4(0.0, 0.0, 0.0, 0.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag new file mode 100644 index 000000000..c8ebf2cf6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag @@ -0,0 +1,102 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declarations. +vec4 function(out vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definitions. +vec4 function(out vec4 par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert new file mode 100644 index 000000000..df37032af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert @@ -0,0 +1,102 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declarations. +vec4 function(out vec4 par[3]); +bool is_all(const in vec4 par, const in float value); +bool is_all(const in vec4 array[3], const in vec4 value); +void set_all(out vec4 array[3], const in vec4 value); + +void main (void) +{ + vec4 par[3]; + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + // Initialize the entire array to 1.0. + set_all(par, vec4(1.0, 1.0, 1.0, 1.0)); + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definitions. +vec4 function(out vec4 par[3]) +{ + // Test parameter qualifier (default is "in"). + set_all(par, vec4(0.0, 0.0, 0.0, 0.0)); + + return vec4(1.0, 1.0, 1.0, 1.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +bool is_all(const in vec4 array[3], const in vec4 value) +{ + bool ret = true; + + if(array[0] != value) + ret = false; + if(array[1] != value) + ret = false; + if(array[2] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 array[3], const in vec4 value) +{ + array[0] = value; + array[1] = value; + array[2] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag new file mode 100644 index 000000000..403d87565 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +// Function declaration. +vec4 function(out vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +vec4 function(out vec4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert new file mode 100644 index 000000000..070945644 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert @@ -0,0 +1,85 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +// Function declaration. +vec4 function(out vec4 par); +bool is_all(const in vec4 par, const in float value); +void set_all(out vec4 par, const in float value); + +void main (void) +{ + vec4 par = vec4(1.0, 1.0, 1.0, 1.0); + vec4 ret = vec4(0.0, 0.0, 0.0, 0.0); + + float gray = 0.0; + + ret = function(par); + + // The parameter should be changed by the function and the function should return 1.0. + if(is_all(par, 0.0) && is_all(ret, 1.0)) + { + gray = 1.0; + } + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +vec4 function(out vec4 par) +{ + // Test parameter qualifier (default is "in"). + set_all(par, 0.0); + + return vec4(1.0, 1.0, 1.0, 1.0); +} + +bool is_all(const in vec4 par, const in float value) +{ + bool ret = true; + + if(par[0] != value) + ret = false; + if(par[1] != value) + ret = false; + if(par[2] != value) + ret = false; + if(par[3] != value) + ret = false; + + return ret; +} + +void set_all(out vec4 par, const in float value) +{ + par[0] = value; + par[1] = value; + par[2] = value; + par[3] = value; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag new file mode 100644 index 000000000..c926874ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float gray = 0.0; + +// Function declaration. +void function(void); + +void main (void) +{ + gray = 0.0; + + function(); + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + +// Function definition. +void function(void) +{ + gray = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert new file mode 100644 index 000000000..ebb2711ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +float gray = 0.0; + +// Function declaration. +void function(void); + +void main (void) +{ + gray = 0.0; + + function(); + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + +// Function definition. +void function(void) +{ + gray = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html new file mode 100644 index 000000000..c0a41c982 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html @@ -0,0 +1,110 @@ + + + + + +WebGL GLSL conformance test: gl_FragCoord_001_to_003.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag new file mode 100644 index 000000000..3efa089c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main(void) +{ + gl_FragColor = vec4(vec3(gl_FragCoord.w), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag new file mode 100644 index 000000000..722b9a70e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float viewportwidth; +uniform float viewportheight; + +void main(void) +{ + // The image width is 500 so scale the position to 0...1 for color + gl_FragColor = vec4(gl_FragCoord.x /viewportwidth , gl_FragCoord.y/viewportheight, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag new file mode 100644 index 000000000..29a66e1b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main(void) +{ + // The image width is 500x500 and the rectangle is 434x434 + // The green component corresponds to x (0...1 left to right) and the + // blue component corresponds to y (0...1 bottom to top) + gl_FragColor = vec4((434.0 / 500.0) * (color.gb - 0.5) + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag new file mode 100644 index 000000000..a18d52494 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag @@ -0,0 +1,32 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main(void) +{ + gl_FragColor = vec4(vec3(gl_FragCoord.z), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag new file mode 100644 index 000000000..7be3a42fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 position; + +void main(void) +{ + // Normalized device coordinates + float z = position.z / position.w; + float f = gl_DepthRange.far; + float n = gl_DepthRange.near; + + // Window coordinates + z = ((f - n) / 2.0) * z + (f + n) / 2.0; + + gl_FragColor = vec4(vec3(z), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert new file mode 100644 index 000000000..2779f89e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 position; + +void main(void) +{ + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + // Vertex's clip coordinates + position = gl_Position; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt new file mode 100644 index 000000000..588cde7bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +gl_FragCoord_001_to_003.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html new file mode 100644 index 000000000..bf5403b34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html @@ -0,0 +1,64 @@ + + + + + +WebGL GLSL conformance test: gl_FrontFacing_001_to_001.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag new file mode 100644 index 000000000..0c8d629ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +void main(void) +{ + if(gl_FrontFacing) + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); + else + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt new file mode 100644 index 000000000..624441919 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +gl_FrontFacing_001_to_001.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html new file mode 100644 index 000000000..689d35a14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: greaterThan_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag new file mode 100644 index 000000000..1a1f2f3b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThan(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag new file mode 100644 index 000000000..055d2c28e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec2 gt(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gt(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert new file mode 100644 index 000000000..f883a87a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThan(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert new file mode 100644 index 000000000..5c62957a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 gt(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gt(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag new file mode 100644 index 000000000..438a85f7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThan(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag new file mode 100644 index 000000000..9c673688a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 gt(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + if(a[2] > b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gt(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert new file mode 100644 index 000000000..6f7adb3fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThan(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert new file mode 100644 index 000000000..7499d53ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 gt(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + if(a[2] > b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gt(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag new file mode 100644 index 000000000..b5f5e8e91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThan(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag new file mode 100644 index 000000000..9265f2b4d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 gt(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gt(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert new file mode 100644 index 000000000..3354f3a37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThan(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert new file mode 100644 index 000000000..02bcfe213 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 gt(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gt(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag new file mode 100644 index 000000000..9be0df0e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThan(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag new file mode 100644 index 000000000..2f57d508f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 gt(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + if(a[2] > b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gt(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert new file mode 100644 index 000000000..64740d804 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThan(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert new file mode 100644 index 000000000..9cb211742 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 gt(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] > b[0]) result[0] = true; + else result[0] = false; + if(a[1] > b[1]) result[1] = true; + else result[1] = false; + if(a[2] > b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gt(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt new file mode 100644 index 000000000..9d2acae74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +greaterThan_001_to_008.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html new file mode 100644 index 000000000..0f2caff44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: greaterThanEqual_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag new file mode 100644 index 000000000..b58ffc8c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThanEqual(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag new file mode 100644 index 000000000..1981e8848 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec2 gte(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gte(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert new file mode 100644 index 000000000..a3d858e9a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThanEqual(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert new file mode 100644 index 000000000..bc91611ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 gte(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gte(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag new file mode 100644 index 000000000..d4f61eb69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThanEqual(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag new file mode 100644 index 000000000..673621f85 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 gte(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + if(a[2] >= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gte(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert new file mode 100644 index 000000000..7047c75d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThanEqual(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert new file mode 100644 index 000000000..b98de4a4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 gte(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + if(a[2] >= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gte(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag new file mode 100644 index 000000000..33bb5d47e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThanEqual(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag new file mode 100644 index 000000000..43c2c8574 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 gte(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gte(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert new file mode 100644 index 000000000..877bab3ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(greaterThanEqual(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert new file mode 100644 index 000000000..0c5f0b732 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 gte(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(gte(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag new file mode 100644 index 000000000..324f6a8f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThanEqual(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag new file mode 100644 index 000000000..d6f22f6bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 gte(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + if(a[2] >= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gte(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert new file mode 100644 index 000000000..238e93958 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(greaterThanEqual(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert new file mode 100644 index 000000000..d120e79a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 gte(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] >= b[0]) result[0] = true; + else result[0] = false; + if(a[1] >= b[1]) result[1] = true; + else result[1] = false; + if(a[2] >= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(gte(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt new file mode 100644 index 000000000..456288301 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +greaterThanEqual_001_to_008.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt new file mode 100644 index 000000000..6eb579d47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +inversesqrt_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html new file mode 100644 index 000000000..02728cd4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: inversesqrt_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag new file mode 100644 index 000000000..f0e126954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = (color.r * 99.0) + 1.0; + gl_FragColor = vec4(inversesqrt(c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag new file mode 100644 index 000000000..440b90b6e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = (color.r * 99.0) + 1.0; + gl_FragColor = vec4(1.0 / sqrt(c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert new file mode 100644 index 000000000..07f52dfcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = (gtf_Color.r * 99.0) + 1.0; + color = vec4(inversesqrt(c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert new file mode 100644 index 000000000..293646aab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = (gtf_Color.r * 99.0) + 1.0; + color = vec4(1.0 / sqrt(c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag new file mode 100644 index 000000000..b7bfff052 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = (color.rg * 99.0) + 1.0; + gl_FragColor = vec4(inversesqrt(c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..073da26ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = (color.rg * 99.0) + 1.0; + gl_FragColor = vec4(1.0 / sqrt(c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert new file mode 100644 index 000000000..cab16ca18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = (gtf_Color.rg * 99.0) + 1.0; + color = vec4(inversesqrt(c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..5fa949693 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = (gtf_Color.rg * 99.0) + 1.0; + color = vec4(1.0 / sqrt(c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag new file mode 100644 index 000000000..935fd3ef7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = (color.rgb * 99.0) + 1.0; + gl_FragColor = vec4(inversesqrt(c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..608253211 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = (color.rgb * 99.0) + 1.0; + gl_FragColor = vec4(1.0 / sqrt(c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert new file mode 100644 index 000000000..2cdd75937 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = (gtf_Color.rgb * 99.0) + 1.0; + color = vec4(inversesqrt(c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..f69629c79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = (gtf_Color.rgb * 99.0) + 1.0; + color = vec4(1.0 / sqrt(c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt new file mode 100644 index 000000000..9a3147ec3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +length_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html new file mode 100644 index 000000000..1837967ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: length_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag new file mode 100644 index 000000000..a82c9d35b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(length(color.r)), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag new file mode 100644 index 000000000..1d8b5594d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(color.r), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert new file mode 100644 index 000000000..97fc87505 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(length(gtf_Color.r)), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert new file mode 100644 index 000000000..3d37b84fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(gtf_Color.r), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag new file mode 100644 index 000000000..2d824ff60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(length(color.rg) / 2.0), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..f322b4d5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(sqrt(color.r*color.r + color.g*color.g) / 2.0), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert new file mode 100644 index 000000000..5becfad21 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(length(gtf_Color.rg) / 2.0), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..37f22c220 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(sqrt(gtf_Color.r*gtf_Color.r + gtf_Color.g*gtf_Color.g) / 2.0), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag new file mode 100644 index 000000000..7423f4c4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(length(color.rgb) / 3.0), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..f817d2b0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(vec3(sqrt(color.r*color.r + color.g*color.g + color.b*color.b) / 3.0), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert new file mode 100644 index 000000000..2dc32aceb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(length(gtf_Color.rgb) / 3.0), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..a4c07f034 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(vec3(sqrt(gtf_Color.r*gtf_Color.r + gtf_Color.g*gtf_Color.g + gtf_Color.b*gtf_Color.b) / 3.0), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt new file mode 100644 index 000000000..f49c916d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +lessThan_001_to_008.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html new file mode 100644 index 000000000..a82635b96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: lessThan_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag new file mode 100644 index 000000000..fa927f844 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThan(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag new file mode 100644 index 000000000..a7919ceb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec2 lt(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lt(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert new file mode 100644 index 000000000..3b68c5ff9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThan(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert new file mode 100644 index 000000000..34d5aa123 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 lt(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lt(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag new file mode 100644 index 000000000..c6c65d17f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThan(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag new file mode 100644 index 000000000..ca4af5661 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 lt(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + if(a[2] < b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lt(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert new file mode 100644 index 000000000..1368d2056 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThan(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert new file mode 100644 index 000000000..427e564bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 lt(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + if(a[2] < b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lt(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag new file mode 100644 index 000000000..fb8235bd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThan(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag new file mode 100644 index 000000000..239c3c036 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 lt(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lt(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert new file mode 100644 index 000000000..1c7a299b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThan(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert new file mode 100644 index 000000000..e2a09eb1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 lt(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lt(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag new file mode 100644 index 000000000..380c28d3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThan(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag new file mode 100644 index 000000000..e2306c5d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 lt(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + if(a[2] < b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lt(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert new file mode 100644 index 000000000..194a1953e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThan(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert new file mode 100644 index 000000000..9902018fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 lt(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] < b[0]) result[0] = true; + else result[0] = false; + if(a[1] < b[1]) result[1] = true; + else result[1] = false; + if(a[2] < b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lt(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt new file mode 100644 index 000000000..656332ccc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +lessThanEqual_001_to_008.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html new file mode 100644 index 000000000..71086917b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: lessThanEqual_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag new file mode 100644 index 000000000..397a2732b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThanEqual(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag new file mode 100644 index 000000000..554f4ea3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec2 lte(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lte(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert new file mode 100644 index 000000000..83a770a48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThanEqual(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert new file mode 100644 index 000000000..6b40030ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 lte(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lte(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag new file mode 100644 index 000000000..6e06ffe54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThanEqual(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag new file mode 100644 index 000000000..29c7453b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 lte(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + if(a[2] <= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lte(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert new file mode 100644 index 000000000..748b3ba82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThanEqual(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert new file mode 100644 index 000000000..89b39f51d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 lte(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + if(a[2] <= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lte(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag new file mode 100644 index 000000000..71d7501c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThanEqual(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag new file mode 100644 index 000000000..c14f65759 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 lte(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lte(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert new file mode 100644 index 000000000..ebc94285f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lessThanEqual(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert new file mode 100644 index 000000000..07a77b0a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 lte(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(lte(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag new file mode 100644 index 000000000..7351a8d0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThanEqual(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag new file mode 100644 index 000000000..d33f35d0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 lte(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + if(a[2] <= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lte(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert new file mode 100644 index 000000000..4ac0e0a82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lessThanEqual(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert new file mode 100644 index 000000000..52b55abb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 lte(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] <= b[0]) result[0] = true; + else result[0] = false; + if(a[1] <= b[1]) result[1] = true; + else result[1] = false; + if(a[2] <= b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(lte(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt new file mode 100644 index 000000000..beb1561c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +log_001_to_008.html +log_009_to_012.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html new file mode 100644 index 000000000..b197960e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: log_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html new file mode 100644 index 000000000..45a6c6282 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: log_009_to_012.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag new file mode 100644 index 000000000..c4685cc82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 31.0 * color.r + 1.0; + gl_FragColor = vec4(log(c) / 3.466, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag new file mode 100644 index 000000000..c9a26bc03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = (color.r + 0.01) / 1.01; + gl_FragColor = vec4(log(c) / -4.61, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag new file mode 100644 index 000000000..c255e618b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float x = (color.r + 0.01) / 1.01; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0; + + gl_FragColor = vec4(y / -4.61, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag new file mode 100644 index 000000000..472235d60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float x = 31.0 * color.r + 1.0; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0; + + gl_FragColor = vec4(y / 3.466, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert new file mode 100644 index 000000000..b6361d1d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 31.0 * gtf_Color.r + 1.0; + color = vec4(log(c) / 3.466, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert new file mode 100644 index 000000000..258894e5a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = (gtf_Color.r + 0.01) / 1.01; + color = vec4(log(c) / -4.61, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert new file mode 100644 index 000000000..fb19501b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float x = (gtf_Color.r + 0.01) / 1.01; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0; + + color = vec4(y / -4.61, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert new file mode 100644 index 000000000..4df24e358 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float x = 31.0 * gtf_Color.r + 1.0; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0; + + color = vec4(y / 3.466, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag new file mode 100644 index 000000000..9ecfb2576 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 31.0 * color.rg + 1.0; + gl_FragColor = vec4(log(c) / 3.466, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag new file mode 100644 index 000000000..9b36e90c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = (color.rg + 0.01) / 1.01; + gl_FragColor = vec4(log(c) / -4.61, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag new file mode 100644 index 000000000..5496f9db1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 x = (color.rg + 0.01) / 1.01; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0; + + gl_FragColor = vec4(y / -4.61, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..01d706c9d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 x = 31.0 * color.rg + 1.0; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0; + + gl_FragColor = vec4(y / 3.466, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert new file mode 100644 index 000000000..95dbc058b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 31.0 * gtf_Color.rg + 1.0; + color = vec4(log(c) / 3.466, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert new file mode 100644 index 000000000..9bd23ab76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = (gtf_Color.rg + 0.01) / 1.01; + color = vec4(log(c) / -4.61, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert new file mode 100644 index 000000000..3a23b5aa6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 x = (gtf_Color.rg + 0.01) / 1.01; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0; + + color = vec4(y / -4.61, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..4996ed1ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 x = 31.0 * gtf_Color.rg + 1.0; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0; + + color = vec4(y / 3.466, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag new file mode 100644 index 000000000..eb2db1ac8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 31.0 * color.rgb + 1.0; + gl_FragColor = vec4(log(c) / 3.466, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag new file mode 100644 index 000000000..a19f80ebc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = (color.rgb + 0.01) / 1.01; + gl_FragColor = vec4(log(c) / -4.61, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag new file mode 100644 index 000000000..1bdcbc690 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 x = (color.rgb + 0.01) / 1.01; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0; + + gl_FragColor = vec4(y / -4.61, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..74f4cd890 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 x = 31.0 * color.rgb + 1.0; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0; + + gl_FragColor = vec4(y / 3.466, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert new file mode 100644 index 000000000..76627e5fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 31.0 * gtf_Color.rgb + 1.0; + color = vec4(log(c) / 3.466, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert new file mode 100644 index 000000000..48d13cd75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = (gtf_Color.rgb + 0.01) / 1.01; + color = vec4(log(c) / -4.61, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert new file mode 100644 index 000000000..3905ef7cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 x = (gtf_Color.rgb + 0.01) / 1.01; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0; + + color = vec4(y / -4.61, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..c17738cfb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 x = 31.0 * gtf_Color.rgb + 1.0; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0; + + color = vec4(y / 3.466, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt new file mode 100644 index 000000000..4205bf17c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +log2_001_to_008.html +log2_009_to_012.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html new file mode 100644 index 000000000..672d46dff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: log2_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html new file mode 100644 index 000000000..908065986 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: log2_009_to_012.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag new file mode 100644 index 000000000..06c6a090a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 31.0 * color.r + 1.0; + gl_FragColor = vec4(log2(c) / 5.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag new file mode 100644 index 000000000..a6f3341ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = (color.r + 0.01) / 1.01; + gl_FragColor = vec4(log2(c) / -8.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag new file mode 100644 index 000000000..2185924ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + float x = (color.r + 0.01) / 1.01; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0 / ln2; + + gl_FragColor = vec4(y / -8.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag new file mode 100644 index 000000000..c43ea54d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + float x = 31.0 * color.r + 1.0; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0 / ln2; + + gl_FragColor = vec4(y / 5.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert new file mode 100644 index 000000000..51123e0cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 31.0 * gtf_Color.r + 1.0; + color = vec4(log2(c) / 5.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert new file mode 100644 index 000000000..1356d8dbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = (gtf_Color.r + 0.01) / 1.01; + color = vec4(log2(c) / -8.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert new file mode 100644 index 000000000..4871f988b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert @@ -0,0 +1,57 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + float x = (gtf_Color.r + 0.01) / 1.01; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0 / ln2; + + color = vec4(y / -8.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert new file mode 100644 index 000000000..ba305ff36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + +void main (void) +{ + float x = 31.0 * gtf_Color.r + 1.0; + float y = 0.0; + float z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + float p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0 / ln2; + + color = vec4(y / 5.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag new file mode 100644 index 000000000..e103f8fe5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 31.0 * color.rg + 1.0; + gl_FragColor = vec4(log2(c) / 5.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag new file mode 100644 index 000000000..c1646e3b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = (color.rg + 0.01) / 1.01; + gl_FragColor = vec4(log2(c) / -8.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag new file mode 100644 index 000000000..b360fd2d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec2 x = (color.rg + 0.01) / 1.01; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0 / ln2; + + gl_FragColor = vec4(y / -8.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..ba37c09cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec2 x = 31.0 * color.rg + 1.0; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0 / ln2; + + gl_FragColor = vec4(y / 5.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert new file mode 100644 index 000000000..81f012a45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 31.0 * gtf_Color.rg + 1.0; + color = vec4(log2(c) / 5.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert new file mode 100644 index 000000000..0cfaf5746 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = (gtf_Color.rg + 0.01) / 1.01; + color = vec4(log2(c) / -8.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert new file mode 100644 index 000000000..835f3da1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert @@ -0,0 +1,57 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec2 x = (gtf_Color.rg + 0.01) / 1.01; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0 / ln2; + + color = vec4(y / -8.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..8f79dd446 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec2 x = 31.0 * gtf_Color.rg + 1.0; + vec2 y = vec2(0.0); + vec2 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec2 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0 / ln2; + + color = vec4(y / 5.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag new file mode 100644 index 000000000..2b406997e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 31.0 * color.rgb + 1.0; + gl_FragColor = vec4(log2(c) / 5.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag new file mode 100644 index 000000000..614a6db9e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = (color.rgb + 0.01) / 1.01; + gl_FragColor = vec4(log2(c) / -8.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag new file mode 100644 index 000000000..32020337f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec3 x = (color.rgb + 0.01) / 1.01; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0 / ln2; + + gl_FragColor = vec4(y / -8.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..f84f000e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec3 x = 31.0 * color.rgb + 1.0; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0 / ln2; + + gl_FragColor = vec4(y / 5.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert new file mode 100644 index 000000000..e98b3703e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 31.0 * gtf_Color.rgb + 1.0; + color = vec4(log2(c) / 5.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert new file mode 100644 index 000000000..779abfe84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = (gtf_Color.rgb + 0.01) / 1.01; + color = vec4(log2(c) / -8.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert new file mode 100644 index 000000000..fda8284a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert @@ -0,0 +1,57 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec3 x = (gtf_Color.rgb + 0.01) / 1.01; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + // Note: z will always be negative between 0.01 and 1.0 and + // so will y since it is raised to an odd power, and the shader spec + // does not support pow(-x, y) where y is not a compile time constant + z = abs((x - 1.0) / (x + 1.0)); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= -2.0 / ln2; + + color = vec4(y / -8.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..9c8454faf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; +const float ln2 = 0.69314718055994530941723212145818; + + + +void main (void) +{ + vec3 x = 31.0 * gtf_Color.rgb + 1.0; + vec3 y = vec3(0.0); + vec3 z; // x-1 / x+1 + int n = 50; + + // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0 + // [x+1 3 (x+1) 5 (x+1) ] + z = (x - 1.0) / (x + 1.0); + vec3 p = z; + for(int i = 1; i <= 101; i += 2) + { + y += p / float(i); + p *= z * z; + } + y *= 2.0 / ln2; + + color = vec4(y / 5.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag new file mode 100644 index 000000000..c6b5af508 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +const int array_size = 2; + +void main (void) +{ + const mat2 a = mat2(1.0, 2.0, 3.0, 4.0); + const mat2 b = mat2(5.0, 6.0, 7.0, 8.0); + mat2 array[array_size]; + float gray; + + array[0] = a; + array[1] = b; + + if((array[0] == a) && (array[1] == b)) + gray = 1.0; + else + gray = 0.0; + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert new file mode 100644 index 000000000..859c040b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +const int array_size = 2; + +void main (void) +{ + const mat2 a = mat2(1.0, 2.0, 3.0, 4.0); + const mat2 b = mat2(5.0, 6.0, 7.0, 8.0); + mat2 array[array_size]; + float gray; + + array[0] = a; + array[1] = b; + + if((array[0] == a) && (array[1] == b)) + gray = 1.0; + else + gray = 0.0; + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag new file mode 100644 index 000000000..2d66cb16a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +const int array_size = 2; + +void main (void) +{ + const mat3 a = mat3(1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0); + const mat3 b = mat3(10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, + 16.0, 17.0, 18.0); + mat3 array[array_size]; + float gray; + + array[0] = a; + array[1] = b; + + if((array[0] == a) && (array[1] == b)) + gray = 1.0; + else + gray = 0.0; + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert new file mode 100644 index 000000000..ec5792f97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +const int array_size = 2; + +void main (void) +{ + const mat3 a = mat3(1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0); + const mat3 b = mat3(10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, + 16.0, 17.0, 18.0); + mat3 array[array_size]; + float gray; + + array[0] = a; + array[1] = b; + + if((array[0] == a) && (array[1] == b)) + gray = 1.0; + else + gray = 0.0; + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag new file mode 100644 index 000000000..f0750abb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +const int array_size = 2; + +void main (void) +{ + const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + const mat4 b = mat4(17.0, 18.0, 19.0, 20.0, + 21.0, 22.0, 23.0, 24.0, + 25.0, 26.0, 27.0, 28.0, + 29.0, 30.0, 31.0, 32.0); + mat4 array[array_size]; + float gray; + + array[0] = a; + array[1] = b; + + if((array[0] == a) && (array[1] == b)) + gray = 1.0; + else + gray = 0.0; + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert new file mode 100644 index 000000000..bb816ba1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +const int array_size = 2; + +void main (void) +{ + const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + const mat4 b = mat4(17.0, 18.0, 19.0, 20.0, + 21.0, 22.0, 23.0, 24.0, + 25.0, 26.0, 27.0, 28.0, + 29.0, 30.0, 31.0, 32.0); + mat4 array[array_size]; + float gray; + + array[0] = a; + array[1] = b; + + if((array[0] == a) && (array[1] == b)) + gray = 1.0; + else + gray = 0.0; + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag new file mode 100644 index 000000000..00f8504ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a constant 2 by 2 matrix with unique elements. + const mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Copy the constant matrix to another non-const matrix. + mat2 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[1][0] != 4.0) elms = false; + if(b[1][1] != 8.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert new file mode 100644 index 000000000..84e95ccbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert @@ -0,0 +1,72 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a constant 2 by 2 matrix with unique elements. + const mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Copy the constant matrix to another non-const matrix. + mat2 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[1][0] != 4.0) elms = false; + if(b[1][1] != 8.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag new file mode 100644 index 000000000..4eb12436b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag @@ -0,0 +1,70 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a constant 2 by 2 matrix with unique elements. + const mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[1][0] != 4.0) elms = false; + if(a[1][1] != 8.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert new file mode 100644 index 000000000..d1c6fd84c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert @@ -0,0 +1,69 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a constant 2 by 2 matrix with unique elements. + const mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[1][0] != 4.0) elms = false; + if(a[1][1] != 8.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag new file mode 100644 index 000000000..3b55111ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a constant 3 by 3 matrix with unique elements. + const mat3 a = mat3( 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0); + + // Copy the constant matrix to another non-const matrix. + mat3 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 3.0) elms = false; + if(b[1][0] != 4.0) elms = false; + if(b[1][1] != 5.0) elms = false; + if(b[1][2] != 6.0) elms = false; + if(b[2][0] != 7.0) elms = false; + if(b[2][1] != 8.0) elms = false; + if(b[2][2] != 9.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0]; + if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false; + x = b[0][1] + b[1][1] + b[2][1]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false; + x = b[0][2] + b[1][2] + b[2][2]; + if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2]; + if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false; + x = b[1][0] + b[1][1] + b[1][2]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2]; + if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert new file mode 100644 index 000000000..7a9282cc2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a constant 3 by 3 matrix with unique elements. + const mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0 + 8.0, 16.0, 32.0, // 2.0 16.0 128.0 + 64.0, 128.0, 256.0); // 4.0 32.0 256.0 + + // Copy the constant matrix to another non-const matrix. + mat3 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 4.0) elms = false; + if(b[1][0] != 8.0) elms = false; + if(b[1][1] != 16.0) elms = false; + if(b[1][2] != 32.0) elms = false; + if(b[2][0] != 64.0) elms = false; + if(b[2][1] != 128.0) elms = false; + if(b[2][2] != 256.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0]; + x = b[0][0] + b[1][0] + b[2][0]; + if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false; + x = b[0][1] + b[1][1] + b[2][1]; + if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false; + x = b[0][2] + b[1][2] + b[2][2]; + if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2]; + if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false; + x = b[1][0] + b[1][1] + b[1][2]; + if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2]; + if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag new file mode 100644 index 000000000..395151074 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a constant 3 by 3 matrix with unique elements. + const mat3 a = mat3( 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0); + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 3.0) elms = false; + if(a[1][0] != 4.0) elms = false; + if(a[1][1] != 5.0) elms = false; + if(a[1][2] != 6.0) elms = false; + if(a[2][0] != 7.0) elms = false; + if(a[2][1] != 8.0) elms = false; + if(a[2][2] != 9.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0]; + if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false; + x = a[0][1] + a[1][1] + a[2][1]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false; + x = a[0][2] + a[1][2] + a[2][2]; + if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2]; + if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false; + x = a[1][0] + a[1][1] + a[1][2]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2]; + if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert new file mode 100644 index 000000000..bb4e396e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert @@ -0,0 +1,79 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a constant 3 by 3 matrix with unique elements. + const mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0 + 8.0, 16.0, 32.0, // 2.0 16.0 128.0 + 64.0, 128.0, 256.0); // 4.0 32.0 256.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 4.0) elms = false; + if(a[1][0] != 8.0) elms = false; + if(a[1][1] != 16.0) elms = false; + if(a[1][2] != 32.0) elms = false; + if(a[2][0] != 64.0) elms = false; + if(a[2][1] != 128.0) elms = false; + if(a[2][2] != 256.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0]; + if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false; + x = a[0][1] + a[1][1] + a[2][1]; + if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false; + x = a[0][2] + a[1][2] + a[2][2]; + if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2]; + if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false; + x = a[1][0] + a[1][1] + a[1][2]; + if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2]; + if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag new file mode 100644 index 000000000..4bf0e97fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag @@ -0,0 +1,95 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a constant 4 by 4 matrix with unique elements. + const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + + // Copy the constant matrix to another non-const matrix. + mat4 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 3.0) elms = false; + if(b[0][3] != 4.0) elms = false; + if(b[1][0] != 5.0) elms = false; + if(b[1][1] != 6.0) elms = false; + if(b[1][2] != 7.0) elms = false; + if(b[1][3] != 8.0) elms = false; + if(b[2][0] != 9.0) elms = false; + if(b[2][1] != 10.0) elms = false; + if(b[2][2] != 11.0) elms = false; + if(b[2][3] != 12.0) elms = false; + if(b[3][0] != 13.0) elms = false; + if(b[3][1] != 14.0) elms = false; + if(b[3][2] != 15.0) elms = false; + if(b[3][3] != 16.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0] + b[3][0]; + if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1] + b[2][1] + b[3][1]; + if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false; + x = b[0][2] + b[1][2] + b[2][2] + b[3][2]; + if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false; + x = b[0][3] + b[1][3] + b[2][3] + b[3][3]; + if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2] + b[0][3]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1] + b[1][2] + b[1][3]; + if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2] + b[2][3]; + if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false; + x = b[3][0] + b[3][1] + b[3][2] + b[3][3]; + if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert new file mode 100644 index 000000000..8f119e19b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert @@ -0,0 +1,94 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a constant 4 by 4 matrix with unique elements. + const mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0 + 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0 + 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0 + 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0 + + // Copy the constant matrix to another non-const matrix. + mat4 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 4.0) elms = false; + if(b[0][3] != 8.0) elms = false; + if(b[1][0] != 16.0) elms = false; + if(b[1][1] != 32.0) elms = false; + if(b[1][2] != 64.0) elms = false; + if(b[1][3] != 128.0) elms = false; + if(b[2][0] != 256.0) elms = false; + if(b[2][1] != 512.0) elms = false; + if(b[2][2] != 1024.0) elms = false; + if(b[2][3] != 2048.0) elms = false; + if(b[3][0] != 4096.0) elms = false; + if(b[3][1] != 8192.0) elms = false; + if(b[3][2] != 16384.0) elms = false; + if(b[3][3] != 32768.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0] + b[3][0]; + if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1] + b[2][1] + b[3][1]; + if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false; + x = b[0][2] + b[1][2] + b[2][2] + b[3][2]; + if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false; + x = b[0][3] + b[1][3] + b[2][3] + b[3][3]; + if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2] + b[0][3]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1] + b[1][2] + b[1][3]; + if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2] + b[2][3]; + if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false; + x = b[3][0] + b[3][1] + b[3][2] + b[3][3]; + if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag new file mode 100644 index 000000000..02ed577c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag @@ -0,0 +1,92 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a constant 4 by 4 matrix with unique elements. + const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 3.0) elms = false; + if(a[0][3] != 4.0) elms = false; + if(a[1][0] != 5.0) elms = false; + if(a[1][1] != 6.0) elms = false; + if(a[1][2] != 7.0) elms = false; + if(a[1][3] != 8.0) elms = false; + if(a[2][0] != 9.0) elms = false; + if(a[2][1] != 10.0) elms = false; + if(a[2][2] != 11.0) elms = false; + if(a[2][3] != 12.0) elms = false; + if(a[3][0] != 13.0) elms = false; + if(a[3][1] != 14.0) elms = false; + if(a[3][2] != 15.0) elms = false; + if(a[3][3] != 16.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0] + a[3][0]; + if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1] + a[2][1] + a[3][1]; + if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false; + x = a[0][2] + a[1][2] + a[2][2] + a[3][2]; + if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false; + x = a[0][3] + a[1][3] + a[2][3] + a[3][3]; + if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2] + a[0][3]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1] + a[1][2] + a[1][3]; + if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2] + a[2][3]; + if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false; + x = a[3][0] + a[3][1] + a[3][2] + a[3][3]; + if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert new file mode 100644 index 000000000..730087dac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a constant 4 by 4 matrix with unique elements. + const mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0 + 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0 + 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0 + 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 4.0) elms = false; + if(a[0][3] != 8.0) elms = false; + if(a[1][0] != 16.0) elms = false; + if(a[1][1] != 32.0) elms = false; + if(a[1][2] != 64.0) elms = false; + if(a[1][3] != 128.0) elms = false; + if(a[2][0] != 256.0) elms = false; + if(a[2][1] != 512.0) elms = false; + if(a[2][2] != 1024.0) elms = false; + if(a[2][3] != 2048.0) elms = false; + if(a[3][0] != 4096.0) elms = false; + if(a[3][1] != 8192.0) elms = false; + if(a[3][2] != 16384.0) elms = false; + if(a[3][3] != 32768.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0] + a[3][0]; + if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1] + a[2][1] + a[3][1]; + if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false; + x = a[0][2] + a[1][2] + a[2][2] + a[3][2]; + if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false; + x = a[0][3] + a[1][3] + a[2][3] + a[3][3]; + if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2] + a[0][3]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1] + a[1][2] + a[1][3]; + if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2] + a[2][3]; + if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false; + x = a[3][0] + a[3][1] + a[3][2] + a[3][3]; + if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt new file mode 100644 index 000000000..730999d88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt @@ -0,0 +1,7 @@ +# this file is auto-generated. DO NOT EDIT. +mat_001_to_008.html +mat_009_to_016.html +mat_017_to_024.html +mat_025_to_032.html +mat_033_to_040.html +mat_041_to_046.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag new file mode 100644 index 000000000..431b64717 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat2 m = mat2(color.rg, color.ba); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if(m[0][0] != color.r) result = black; + if(m[0][1] != color.g) result = black; + if(m[1][0] != color.b) result = black; + if(m[1][1] != color.a) result = black; + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert new file mode 100644 index 000000000..6747a4898 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat2 m = mat2(gtf_Color.rg, gtf_Color.ba); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + + if(m[0][0] != gtf_Color.r) result = black; + if(m[0][1] != gtf_Color.g) result = black; + if(m[1][0] != gtf_Color.b) result = black; + if(m[1][1] != gtf_Color.a) result = black; + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag new file mode 100644 index 000000000..b74a9a71d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat2 m = mat2(color.r, color.g, color.b, color.a); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if(m[0][0] != color.r) result = black; + if(m[0][1] != color.g) result = black; + if(m[1][0] != color.b) result = black; + if(m[1][1] != color.a) result = black; + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert new file mode 100644 index 000000000..c5a7f1a48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat2 m = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + + if(m[0][0] != gtf_Color.r) result = black; + if(m[0][1] != gtf_Color.g) result = black; + if(m[1][0] != gtf_Color.b) result = black; + if(m[1][1] != gtf_Color.a) result = black; + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag new file mode 100644 index 000000000..12acbc5b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a 2 by 2 matrix with unique elements. + mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Copy the matrix to another non-const matrix. + mat2 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[1][0] != 4.0) elms = false; + if(b[1][1] != 8.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert new file mode 100644 index 000000000..6aeede3f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert @@ -0,0 +1,72 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a 2 by 2 matrix with unique elements. + mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Copy the matrix to another non-const matrix. + mat2 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[1][0] != 4.0) elms = false; + if(b[1][1] != 8.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag new file mode 100644 index 000000000..4c9954715 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat2 m = mat2(0.5); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if((m[0][0] != 0.5)) + result = black; + if((m[0][1] != 0.0)) + result = black; + + if((m[1][0] != 0.0)) + result = black; + if((m[1][1] != 0.5)) + result = black; + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert new file mode 100644 index 000000000..894b3a058 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat2 m = mat2(0.5); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if((m[0][0] != 0.5)) + result = black; + if((m[0][1] != 0.0)) + result = black; + if((m[1][0] != 0.0)) + result = black; + if((m[1][1] != 0.5)) + result = black; + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag new file mode 100644 index 000000000..a105f5fc6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag @@ -0,0 +1,70 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a 2 by 2 matrix with unique elements. + mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[1][0] != 4.0) elms = false; + if(a[1][1] != 8.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert new file mode 100644 index 000000000..93d56cfd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert @@ -0,0 +1,69 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a 2 by 2 matrix with unique elements. + mat2 a = mat2(1.0, 2.0, // 1.0 4.0 + 4.0, 8.0); // 2.0 8.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[1][0] != 4.0) elms = false; + if(a[1][1] != 8.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0]; + if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1]; + if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1]; + if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag new file mode 100644 index 000000000..133a71f84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat3 m = mat3(color.rgb, color.rgb, color.rgb); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if(m[0][0] != color.r) result = black; + if(m[0][1] != color.g) result = black; + if(m[0][2] != color.b) result = black; + if(m[1][0] != color.r) result = black; + if(m[1][1] != color.g) result = black; + if(m[1][2] != color.b) result = black; + if(m[2][0] != color.r) result = black; + if(m[2][1] != color.g) result = black; + if(m[2][2] != color.b) result = black; + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert new file mode 100644 index 000000000..c0b92b88f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat3 m = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if(m[0][0] != gtf_Color.r) result = black; + if(m[0][1] != gtf_Color.g) result = black; + if(m[0][2] != gtf_Color.b) result = black; + if(m[1][0] != gtf_Color.r) result = black; + if(m[1][1] != gtf_Color.g) result = black; + if(m[1][2] != gtf_Color.b) result = black; + if(m[2][0] != gtf_Color.r) result = black; + if(m[2][1] != gtf_Color.g) result = black; + if(m[2][2] != gtf_Color.b) result = black; + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag new file mode 100644 index 000000000..e65c7241e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat3 m = mat3(color.r, color.g, color.b, color.r, color.g, color.b, color.r, color.g, color.b); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if(m[0][0] != color.r) result = black; + if(m[0][1] != color.g) result = black; + if(m[0][2] != color.b) result = black; + if(m[1][0] != color.r) result = black; + if(m[1][1] != color.g) result = black; + if(m[1][2] != color.b) result = black; + if(m[2][0] != color.r) result = black; + if(m[2][1] != color.g) result = black; + if(m[2][2] != color.b) result = black; + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert new file mode 100644 index 000000000..b13848605 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat3 m = mat3(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.r, gtf_Color.g, gtf_Color.b); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + + if(m[0][0] != gtf_Color.r) result = black; + if(m[0][1] != gtf_Color.g) result = black; + if(m[0][2] != gtf_Color.b) result = black; + if(m[1][0] != gtf_Color.r) result = black; + if(m[1][1] != gtf_Color.g) result = black; + if(m[1][2] != gtf_Color.b) result = black; + if(m[2][0] != gtf_Color.r) result = black; + if(m[2][1] != gtf_Color.g) result = black; + if(m[2][2] != gtf_Color.b) result = black; + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag new file mode 100644 index 000000000..b2650591c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a 3 by 3 matrix with unique elements. + mat3 a = mat3( 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0); + + // Copy the matrix to another non-const matrix. + mat3 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 3.0) elms = false; + if(b[1][0] != 4.0) elms = false; + if(b[1][1] != 5.0) elms = false; + if(b[1][2] != 6.0) elms = false; + if(b[2][0] != 7.0) elms = false; + if(b[2][1] != 8.0) elms = false; + if(b[2][2] != 9.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0]; + if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false; + x = b[0][1] + b[1][1] + b[2][1]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false; + x = b[0][2] + b[1][2] + b[2][2]; + if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2]; + if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false; + x = b[1][0] + b[1][1] + b[1][2]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2]; + if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert new file mode 100644 index 000000000..a1c96502a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert @@ -0,0 +1,82 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a 3 by 3 matrix with unique elements. + mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0 + 8.0, 16.0, 32.0, // 2.0 16.0 128.0 + 64.0, 128.0, 256.0); // 4.0 32.0 256.0 + + // Copy the matrix to another non-const matrix. + mat3 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 4.0) elms = false; + if(b[1][0] != 8.0) elms = false; + if(b[1][1] != 16.0) elms = false; + if(b[1][2] != 32.0) elms = false; + if(b[2][0] != 64.0) elms = false; + if(b[2][1] != 128.0) elms = false; + if(b[2][2] != 256.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0]; + if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false; + x = b[0][1] + b[1][1] + b[2][1]; + if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false; + x = b[0][2] + b[1][2] + b[2][2]; + if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2]; + if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false; + x = b[1][0] + b[1][1] + b[1][2]; + if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2]; + if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag new file mode 100644 index 000000000..bd62d0e46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat3 m = mat3(0.5); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if((m[0][0] != 0.5)) + result = black; + if((m[0][1] != 0.0)) + result = black; + if((m[0][2] != 0.0)) + result = black; + + if((m[1][0] != 0.0)) + result = black; + if((m[1][1] != 0.5)) + result = black; + if((m[1][2] != 0.0)) + result = black; + + if((m[2][0] != 0.0)) + result = black; + if((m[2][1] != 0.0)) + result = black; + if((m[2][2] != 0.5)) + result = black; + + gl_FragColor = result; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert new file mode 100644 index 000000000..f42f47763 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat3 m = mat3(0.5); + vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + vec4 result = vec4(1.0, 1.0, 1.0, 1.0); + + if((m[0][0] != 0.5)) + result = black; + if((m[0][1] != 0.0)) + result = black; + if((m[0][2] != 0.0)) + result = black; + + if((m[1][0] != 0.0)) + result = black; + if((m[1][1] != 0.5)) + result = black; + if((m[1][2] != 0.0)) + result = black; + + if((m[2][0] != 0.0)) + result = black; + if((m[2][1] != 0.0)) + result = black; + if((m[2][2] != 0.5)) + result = black; + + color = result; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag new file mode 100644 index 000000000..29913992c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a 3 by 3 matrix with unique elements. + mat3 a = mat3( 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0); + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 3.0) elms = false; + if(a[1][0] != 4.0) elms = false; + if(a[1][1] != 5.0) elms = false; + if(a[1][2] != 6.0) elms = false; + if(a[2][0] != 7.0) elms = false; + if(a[2][1] != 8.0) elms = false; + if(a[2][2] != 9.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0]; + if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false; + x = a[0][1] + a[1][1] + a[2][1]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false; + x = a[0][2] + a[1][2] + a[2][2]; + if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2]; + if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false; + x = a[1][0] + a[1][1] + a[1][2]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2]; + if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert new file mode 100644 index 000000000..70588d0aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert @@ -0,0 +1,79 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a 3 by 3 matrix with unique elements. + mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0 + 8.0, 16.0, 32.0, // 2.0 16.0 128.0 + 64.0, 128.0, 256.0); // 4.0 32.0 256.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 4.0) elms = false; + if(a[1][0] != 8.0) elms = false; + if(a[1][1] != 16.0) elms = false; + if(a[1][2] != 32.0) elms = false; + if(a[2][0] != 64.0) elms = false; + if(a[2][1] != 128.0) elms = false; + if(a[2][2] != 256.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0]; + if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false; + x = a[0][1] + a[1][1] + a[2][1]; + if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false; + x = a[0][2] + a[1][2] + a[2][2]; + if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2]; + if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false; + x = a[1][0] + a[1][1] + a[1][2]; + if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2]; + if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag new file mode 100644 index 000000000..7440e65cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag @@ -0,0 +1,74 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + mat4 a = mat4( 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0; + int i; + + + sum1 += a[0][0]; + sum2 += a[1][0]; + sum3 += a[2][0]; + sum4 += a[3][0]; + + sum1 += a[0][1]; + sum2 += a[1][1]; + sum3 += a[2][1]; + sum4 += a[3][1]; + + sum1 += a[0][2]; + sum2 += a[1][2]; + sum3 += a[2][2]; + sum4 += a[3][2]; + + sum1 += a[0][3]; + sum2 += a[1][3]; + sum3 += a[2][3]; + sum4 += a[3][3]; + + if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) && + ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) && + ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) && + ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert new file mode 100644 index 000000000..485085355 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert @@ -0,0 +1,71 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + mat4 a = mat4(1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + + float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0; + int i; + + sum1 = sum1 + a[0][0]; + sum2 = sum2 + a[1][0]; + sum3 = sum3 + a[2][0]; + sum4 = sum4 + a[3][0]; + + sum1 = sum1 + a[0][1]; + sum2 = sum2 + a[1][1]; + sum3 = sum3 + a[2][1]; + sum4 = sum4 + a[3][1]; + + sum1 = sum1 + a[0][2]; + sum2 = sum2 + a[1][2]; + sum3 = sum3 + a[2][2]; + sum4 = sum4 + a[3][2]; + + sum1 = sum1 + a[0][3]; + sum2 = sum2 + a[1][3]; + sum3 = sum3 + a[2][3]; + sum4 = sum4 + a[3][3]; + + if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) && + ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) && + ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) && + ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag new file mode 100644 index 000000000..44b425a41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag @@ -0,0 +1,76 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + vec4 L1 = vec4(1.0, 2.0, 3.0, 4.0); + vec4 L2 = vec4(5.0, 6.0, 7.0, 8.0); + vec4 L3 = vec4(9.0, 10.0, 11.0, 12.0); + vec4 L4 = vec4(13.0, 14.0, 15.0, 16.0); + + mat4 a = mat4(L1,L2,L3,L4); + + float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0; + int i; + + sum1 = sum1 + a[0][0]; + sum2 = sum2 + a[1][0]; + sum3 = sum3 + a[2][0]; + sum4 = sum4 + a[3][0]; + + sum1 = sum1 + a[0][1]; + sum2 = sum2 + a[1][1]; + sum3 = sum3 + a[2][1]; + sum4 = sum4 + a[3][1]; + + sum1 = sum1 + a[0][2]; + sum2 = sum2 + a[1][2]; + sum3 = sum3 + a[2][2]; + sum4 = sum4 + a[3][2]; + + sum1 = sum1 + a[0][3]; + sum2 = sum2 + a[1][3]; + sum3 = sum3 + a[2][3]; + sum4 = sum4 + a[3][3]; + + if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) && + ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) && + ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) && + ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert new file mode 100644 index 000000000..77dce5eb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + vec4 L1 = vec4(1.0, 2.0, 3.0, 4.0); + vec4 L2 = vec4(5.0, 6.0, 7.0, 8.0); + vec4 L3 = vec4(9.0, 10.0, 11.0, 12.0); + vec4 L4 = vec4(13.0, 14.0, 15.0, 16.0); + + mat4 a = mat4(L1,L2,L3,L4); + + float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0; + int i; + + sum1 = sum1 + a[0][0]; + sum2 = sum2 + a[1][0]; + sum3 = sum3 + a[2][0]; + sum4 = sum4 + a[3][0]; + + sum1 = sum1 + a[0][1]; + sum2 = sum2 + a[1][1]; + sum3 = sum3 + a[2][1]; + sum4 = sum4 + a[3][1]; + + sum1 = sum1 + a[0][2]; + sum2 = sum2 + a[1][2]; + sum3 = sum3 + a[2][2]; + sum4 = sum4 + a[3][2]; + + sum1 = sum1 + a[0][3]; + sum2 = sum2 + a[1][3]; + sum3 = sum3 + a[2][3]; + sum4 = sum4 + a[3][3]; + + if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) && + ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) && + ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) && + ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag new file mode 100644 index 000000000..340fc51b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag @@ -0,0 +1,95 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a constant 4 by 4 matrix with unique elements. + mat4 a = mat4( 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + + // Copy the matrix to another non-const matrix. + mat4 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 3.0) elms = false; + if(b[0][3] != 4.0) elms = false; + if(b[1][0] != 5.0) elms = false; + if(b[1][1] != 6.0) elms = false; + if(b[1][2] != 7.0) elms = false; + if(b[1][3] != 8.0) elms = false; + if(b[2][0] != 9.0) elms = false; + if(b[2][1] != 10.0) elms = false; + if(b[2][2] != 11.0) elms = false; + if(b[2][3] != 12.0) elms = false; + if(b[3][0] != 13.0) elms = false; + if(b[3][1] != 14.0) elms = false; + if(b[3][2] != 15.0) elms = false; + if(b[3][3] != 16.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0] + b[3][0]; + if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1] + b[2][1] + b[3][1]; + if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false; + x = b[0][2] + b[1][2] + b[2][2] + b[3][2]; + if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false; + x = b[0][3] + b[1][3] + b[2][3] + b[3][3]; + if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2] + b[0][3]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1] + b[1][2] + b[1][3]; + if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2] + b[2][3]; + if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false; + x = b[3][0] + b[3][1] + b[3][2] + b[3][3]; + if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert new file mode 100644 index 000000000..ee5c07864 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert @@ -0,0 +1,94 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a 4 by 4 matrix with unique elements. + mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0 + 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0 + 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0 + 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0 + + // Copy the matrix to another non-const matrix. + mat4 b = a; + + // Check each element of the copy. + bool elms = true; + if(b[0][0] != 1.0) elms = false; + if(b[0][1] != 2.0) elms = false; + if(b[0][2] != 4.0) elms = false; + if(b[0][3] != 8.0) elms = false; + if(b[1][0] != 16.0) elms = false; + if(b[1][1] != 32.0) elms = false; + if(b[1][2] != 64.0) elms = false; + if(b[1][3] != 128.0) elms = false; + if(b[2][0] != 256.0) elms = false; + if(b[2][1] != 512.0) elms = false; + if(b[2][2] != 1024.0) elms = false; + if(b[2][3] != 2048.0) elms = false; + if(b[3][0] != 4096.0) elms = false; + if(b[3][1] != 8192.0) elms = false; + if(b[3][2] != 16384.0) elms = false; + if(b[3][3] != 32768.0) elms = false; + + // Add up each row of the copy. + bool rows = true; + x = b[0][0] + b[1][0] + b[2][0] + b[3][0]; + if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false; + x = b[0][1] + b[1][1] + b[2][1] + b[3][1]; + if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false; + x = b[0][2] + b[1][2] + b[2][2] + b[3][2]; + if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false; + x = b[0][3] + b[1][3] + b[2][3] + b[3][3]; + if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = b[0][0] + b[0][1] + b[0][2] + b[0][3]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = b[1][0] + b[1][1] + b[1][2] + b[1][3]; + if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false; + x = b[2][0] + b[2][1] + b[2][2] + b[2][3]; + if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false; + x = b[3][0] + b[3][1] + b[3][2] + b[3][3]; + if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag new file mode 100644 index 000000000..590852b80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag @@ -0,0 +1,92 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +/* This epsilon will work as long as the magnitude of the float is < 128. + * This can be seen by taking the spec relative mediump precision of 2^-10: + * 0.125 / 2^-10 = 128 + */ +#define ERROR_EPSILON (0.125) + +void main (void) +{ + float x; + // Declare a 4 by 4 matrix with unique elements. + mat4 a = mat4( 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 3.0) elms = false; + if(a[0][3] != 4.0) elms = false; + if(a[1][0] != 5.0) elms = false; + if(a[1][1] != 6.0) elms = false; + if(a[1][2] != 7.0) elms = false; + if(a[1][3] != 8.0) elms = false; + if(a[2][0] != 9.0) elms = false; + if(a[2][1] != 10.0) elms = false; + if(a[2][2] != 11.0) elms = false; + if(a[2][3] != 12.0) elms = false; + if(a[3][0] != 13.0) elms = false; + if(a[3][1] != 14.0) elms = false; + if(a[3][2] != 15.0) elms = false; + if(a[3][3] != 16.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0] + a[3][0]; + if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1] + a[2][1] + a[3][1]; + if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false; + x = a[0][2] + a[1][2] + a[2][2] + a[3][2]; + if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false; + x = a[0][3] + a[1][3] + a[2][3] + a[3][3]; + if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false; + + // Add up each column of the copy. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2] + a[0][3]; + if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1] + a[1][2] + a[1][3]; + if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2] + a[2][3]; + if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false; + x = a[3][0] + a[3][1] + a[3][2] + a[3][3]; + if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the fragment color. + gl_FragColor = vec4(gray, gray, gray, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert new file mode 100644 index 000000000..910729c2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert @@ -0,0 +1,91 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + float x; + // Declare a 4 by 4 matrix with unique elements. + mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0 + 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0 + 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0 + 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0 + + // Check each element. + bool elms = true; + if(a[0][0] != 1.0) elms = false; + if(a[0][1] != 2.0) elms = false; + if(a[0][2] != 4.0) elms = false; + if(a[0][3] != 8.0) elms = false; + if(a[1][0] != 16.0) elms = false; + if(a[1][1] != 32.0) elms = false; + if(a[1][2] != 64.0) elms = false; + if(a[1][3] != 128.0) elms = false; + if(a[2][0] != 256.0) elms = false; + if(a[2][1] != 512.0) elms = false; + if(a[2][2] != 1024.0) elms = false; + if(a[2][3] != 2048.0) elms = false; + if(a[3][0] != 4096.0) elms = false; + if(a[3][1] != 8192.0) elms = false; + if(a[3][2] != 16384.0) elms = false; + if(a[3][3] != 32768.0) elms = false; + + // Add up each row. + bool rows = true; + x = a[0][0] + a[1][0] + a[2][0] + a[3][0]; + if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false; + x = a[0][1] + a[1][1] + a[2][1] + a[3][1]; + if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false; + x = a[0][2] + a[1][2] + a[2][2] + a[3][2]; + if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false; + x = a[0][3] + a[1][3] + a[2][3] + a[3][3]; + if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false; + + // Add up each column. + bool cols = true; + x = a[0][0] + a[0][1] + a[0][2] + a[0][3]; + if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false; + x = a[1][0] + a[1][1] + a[1][2] + a[1][3]; + if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false; + x = a[2][0] + a[2][1] + a[2][2] + a[2][3]; + if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false; + x = a[3][0] + a[3][1] + a[3][2] + a[3][3]; + if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false; + + // Check if all of the operations were successful. + float gray = elms && rows && cols ? 1.0 : 0.0; + + // Assign the varying variable color. + color = vec4(gray, gray, gray, 1.0); + + // Transform the vertex position. + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html new file mode 100644 index 000000000..47ff2c10c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: mat_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html new file mode 100644 index 000000000..b46b33185 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: mat_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html new file mode 100644 index 000000000..22488176b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: mat_017_to_024.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html new file mode 100644 index 000000000..4238c2c99 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: mat_025_to_032.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html new file mode 100644 index 000000000..62af6cae5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: mat_033_to_040.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html new file mode 100644 index 000000000..3ac5b8cc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html @@ -0,0 +1,201 @@ + + + + + +WebGL GLSL conformance test: mat_041_to_046.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt new file mode 100644 index 000000000..f79e127c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +mat3_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html new file mode 100644 index 000000000..ad3f1e696 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html @@ -0,0 +1,363 @@ + + + + + +WebGL GLSL conformance test: mat3_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag new file mode 100644 index 000000000..47dc75b71 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// mat3arrayindirect0_frag.frag: Fragment shader solid color +// The vec3 values are determined at runtime. +// +// + +uniform mat3 testmat3[2]; +varying vec4 color; + +void main(void) +{ + vec3 result = vec3(0.0, 0.0, 0.0); + + /* + // No indirect indexing in fragment shaders + for(int j = 0; j < 3; j++) + { + result += testmat3[0][j] + testmat3[1][j]; + } + */ + result += testmat3[0][0] + testmat3[1][0]; + result += testmat3[0][1] + testmat3[1][1]; + result += testmat3[0][2] + testmat3[1][2]; + gl_FragColor = vec4(result/2.0, 0.5); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert new file mode 100644 index 000000000..b9427ba03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// mat3arrayindirect0_vert.vert: Vertex shader solid color +// The vec3 values are determined at runtime. +// +// + +uniform mat3 testmat3[2]; +varying vec4 color; + + +void main(void) +{ + vec3 result = vec3(0.0, 0.0, 0.0); + + for(int j = 0; j < 3; j++) + { + result += testmat3[0][j] + testmat3[1][j]; + } + + color = vec4(result/2.0, 0.5); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag new file mode 100644 index 000000000..ec4c4a927 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// mat3arrayindirect1_frag.frag: Fragment shader solid color testing indirect referencing into uniforms +// The vec3 values are determined at runtime. +// +// + +uniform mat3 testmat3[2]; +varying vec4 color; + +void main(void) +{ + vec3 result = vec3(0.0, 0.0, 0.0); + + /* + // No indirect indexing in fragment shaders + for(int j = 0; j < 3; j++) + { + result += testmat3[1][j]; + } +*/ + result += testmat3[1][0]; + result += testmat3[1][1]; + result += testmat3[1][2]; + gl_FragColor = vec4(result/2.0, 0.5); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert new file mode 100644 index 000000000..324366803 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// mat3arrayindirect1_vert.vert: Vertex shader solid color testing indirect referencing into uniforms +// The vec3 values are determined at runtime. +// +// + +uniform mat3 testmat3[2]; +varying vec4 color; + + +void main(void) +{ + vec3 result = vec3(0.0, 0.0, 0.0); + + for(int j = 0; j < 3; j++) + { + result += testmat3[1][j]; + } + + + color = vec4(result/2.0, 0.5); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag new file mode 100644 index 000000000..7bca3f11e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// mat3arraysimple_frag.frag: Fragment shader solid color testing indirect referencing into uniforms +// The vec3 values are determined at runtime. +// +// + +uniform mat3 testmat3[2]; +varying vec4 color; + +void main(void) +{ + vec3 result = vec3(0.0, 0.0, 0.0); + + result = testmat3[1][0] + testmat3[1][1] + testmat3[1][2]; + gl_FragColor = vec4(result/2.0, 0.5); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert new file mode 100644 index 000000000..ad39bd0d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// mat3arraysimple_vert.vert: Vertex shader solid color testing indirect referencing into uniforms +// The vec3 values are determined at runtime. +// +// + +uniform mat3 testmat3[2]; +varying vec4 color; + + +void main(void) +{ + vec3 result = vec3(0.0, 0.0, 0.0); + + result = testmat3[1][0] + testmat3[1][1] + testmat3[1][2]; + + color = vec4(result/2.0, 0.5); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt new file mode 100644 index 000000000..91d20c86e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +matrixCompMult_001_to_004.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html new file mode 100644 index 000000000..ec70ae04e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: matrixCompMult_001_to_004.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag new file mode 100644 index 000000000..8db7ddf3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat2 m1 = mat2(color.rg, color.ba); + mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0); + mat2 m3 = mat2(0.0); + + m3 = matrixCompMult(m1, m2); + gl_FragColor = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag new file mode 100644 index 000000000..fed33bea1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat2 m1 = mat2(color.rg, color.ba); + mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0); + mat2 m3 = mat2(0.0); + + m3[0][0] = m1[0][0] * m2[0][0]; + m3[0][1] = m1[0][1] * m2[0][1]; + m3[1][0] = m1[1][0] * m2[1][0]; + m3[1][1] = m1[1][1] * m2[1][1]; + + gl_FragColor = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert new file mode 100644 index 000000000..e912de35c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat2 m1 = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a); + mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0); + mat2 m3 = mat2(0.0); + + m3 = matrixCompMult(m1, m2); + color = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert new file mode 100644 index 000000000..cda02927d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat2 m1 = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a); + mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0); + mat2 m3 = mat2(0.0); + + m3[0][0] = m1[0][0] * m2[0][0]; + m3[0][1] = m1[0][1] * m2[0][1]; + m3[1][0] = m1[1][0] * m2[1][0]; + m3[1][1] = m1[1][1] * m2[1][1]; + + color = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag new file mode 100644 index 000000000..9392716dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat3 m1 = mat3(color.rgb, color.rgb, color.rgb); + mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0); + mat3 m3 = mat3(0.0); + vec3 result = vec3(0.0, 0.0, 0.0); + + m3 = matrixCompMult(m1, m2); + + result[0] += m3[0][0]; + result[0] += m3[0][1]; + result[0] += m3[0][2]; + + result[1] += m3[1][0]; + result[1] += m3[1][1]; + result[1] += m3[1][2]; + + result[2] += m3[2][0]; + result[2] += m3[2][1]; + result[2] += m3[2][2]; + + gl_FragColor = vec4(result / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag new file mode 100644 index 000000000..21365a0dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag @@ -0,0 +1,59 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + mat3 m1 = mat3(color.rgb, color.rgb, color.rgb); + mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0); + mat3 m3 = mat3(0.0); + vec3 result = vec3(0.0, 0.0, 0.0); + + m3[0][0] = m1[0][0] * m2[0][0]; + m3[0][1] = m1[0][1] * m2[0][1]; + m3[0][2] = m1[0][2] * m2[0][2]; + m3[1][0] = m1[1][0] * m2[1][0]; + m3[1][1] = m1[1][1] * m2[1][1]; + m3[1][2] = m1[1][2] * m2[1][2]; + m3[2][0] = m1[2][0] * m2[2][0]; + m3[2][1] = m1[2][1] * m2[2][1]; + m3[2][2] = m1[2][2] * m2[2][2]; + + result[0] += m3[0][0]; + result[0] += m3[0][1]; + result[0] += m3[0][2]; + result[1] += m3[1][0]; + result[1] += m3[1][1]; + result[1] += m3[1][2]; + result[2] += m3[2][0]; + result[2] += m3[2][1]; + result[2] += m3[2][2]; + + gl_FragColor = vec4(result / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert new file mode 100644 index 000000000..cd4f31873 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat3 m1 = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb); + mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0); + mat3 m3 = mat3(0.0); + vec3 result = vec3(0.0, 0.0, 0.0); + + m3 = matrixCompMult(m1, m2); + + result[0] += m3[0][0]; + result[0] += m3[0][1]; + result[0] += m3[0][2]; + + result[1] += m3[1][0]; + result[1] += m3[1][1]; + result[1] += m3[1][2]; + + result[2] += m3[2][0]; + result[2] += m3[2][1]; + result[2] += m3[2][2]; + + color = vec4(result / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert new file mode 100644 index 000000000..2288096cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert @@ -0,0 +1,64 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + mat3 m1 = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb); + mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0); + mat3 m3 = mat3(0.0); + vec3 result = vec3(0.0, 0.0, 0.0); + + m3[0][0] = m1[0][0] * m2[0][0]; + m3[0][1] = m1[0][1] * m2[0][1]; + m3[0][2] = m1[0][2] * m2[0][2]; + + m3[1][0] = m1[1][0] * m2[1][0]; + m3[1][1] = m1[1][1] * m2[1][1]; + m3[1][2] = m1[1][2] * m2[1][2]; + + m3[2][0] = m1[2][0] * m2[2][0]; + m3[2][1] = m1[2][1] * m2[2][1]; + m3[2][2] = m1[2][2] * m2[2][2]; + + result[0] += m3[0][0]; + result[0] += m3[0][1]; + result[0] += m3[0][2]; + + result[1] += m3[1][0]; + result[1] += m3[1][1]; + result[1] += m3[1][2]; + + result[2] += m3[2][0]; + result[2] += m3[2][1]; + result[2] += m3[2][2]; + + color = vec4(result / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt new file mode 100644 index 000000000..552692d67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +max_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html new file mode 100644 index 000000000..0928f4a48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: max_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..1dc582375 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = color.r; + gl_FragColor = vec4(max(c, max_c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..44188757e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = color.r; + if(c < max_c) c = max_c; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..18df63489 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = gtf_Color.r; + color = vec4(max(c, max_c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..44602be92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = gtf_Color.r; + if(c < max_c) c = max_c; + + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..12cccbaf5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = color.rg; + gl_FragColor = vec4(max(c, max_c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..63d52b2ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = color.rg; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..54a94edf5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + color = vec4(max(c, max_c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..b8ad06aa8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..b44d0c851 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + gl_FragColor = vec4(max(c, max_c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..d17d8cdea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + if(c[2] < max_c[2]) c[2] = max_c[2]; + + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..549f510fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + color = vec4(max(c, max_c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..84de20274 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + if(c[2] < max_c[2]) c[2] = max_c[2]; + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt new file mode 100644 index 000000000..5c675deae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +min_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html new file mode 100644 index 000000000..8be15c1d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: min_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..fdc3e23a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float min_c = 0.5; + float c = color.r; + gl_FragColor = vec4(min(c, min_c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..acf1eebb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float min_c = 0.5; + float c = color.r; + if(c > min_c) c = min_c; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..b854733dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.5; + float c = gtf_Color.r; + color = vec4(min(c, min_c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..73849e092 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.5; + float c = gtf_Color.r; + if(c > min_c) c = min_c; + + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..ea5563eb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 min_c = vec2(0.5, 0.5); + vec2 c = color.rg; + gl_FragColor = vec4(min(c, min_c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..82ae1b891 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +varying vec4 color; + +void main (void) +{ + const vec2 min_c = vec2(0.5, 0.5); + vec2 c = color.rg; + if(c[0] > min_c[0]) c[0] = min_c[0]; + if(c[1] > min_c[1]) c[1] = min_c[1]; + + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..ae6459783 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 min_c = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + color = vec4(min(c, min_c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..1f8d54b3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 min_c = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + if(c[0] > min_c[0]) c[0] = min_c[0]; + if(c[1] > min_c[1]) c[1] = min_c[1]; + + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..80232206f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 min_c = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + gl_FragColor = vec4(min(c, min_c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..2432efe93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 min_c = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + if(c[0] > min_c[0]) c[0] = min_c[0]; + if(c[1] > min_c[1]) c[1] = min_c[1]; + if(c[2] > min_c[2]) c[2] = min_c[2]; + + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..96629e770 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 min_c = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + color = vec4(min(c, min_c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..65d273dc3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 min_c = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + if(c[0] > min_c[0]) c[0] = min_c[0]; + if(c[1] > min_c[1]) c[1] = min_c[1]; + if(c[2] > min_c[2]) c[2] = min_c[2]; + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt new file mode 100644 index 000000000..f1c7ead98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +mix_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html new file mode 100644 index 000000000..0eac92687 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: mix_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag new file mode 100644 index 000000000..c04c6ba63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float y = 0.5; + const float a = 0.5; + float c = color.r; + gl_FragColor = vec4(mix(c, y, a), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag new file mode 100644 index 000000000..74f962959 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float y = 0.5; + const float a = 0.5; + float c = color.r; + + gl_FragColor = vec4(c * (1.0 - a) + y * a, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert new file mode 100644 index 000000000..bce996506 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float y = 0.5; + const float a = 0.5; + float c = gtf_Color.r; + color = vec4(mix(c, y, a), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert new file mode 100644 index 000000000..adce95219 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float y = 0.5; + const float a = 0.5; + float c = gtf_Color.r; + + color = vec4(c * (1.0 - a) + y * a, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag new file mode 100644 index 000000000..4578aa893 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 y = vec2(0.5, 0.5); + const vec2 a = vec2(0.5, 0.5); + gl_FragColor = vec4(mix(color.rg, y, a), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag new file mode 100644 index 000000000..b75166792 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 y = vec2(0.5, 0.5); + const vec2 a = vec2(0.5, 0.5); + vec2 c = color.rg; + + gl_FragColor = vec4(c * (1.0 - a) + y * a, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert new file mode 100644 index 000000000..ffdbd2677 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 y = vec2(0.5, 0.5); + const vec2 a = vec2(0.5, 0.5); + color = vec4(mix(gtf_Color.rg, y, a), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert new file mode 100644 index 000000000..38d2de727 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 y = vec2(0.5, 0.5); + const vec2 a = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + + color = vec4(c * (1.0 - a) + y * a, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag new file mode 100644 index 000000000..fef30dced --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 y = vec3(0.5, 0.5, 0.5); + const vec3 a = vec3(0.5, 0.5, 0.5); + gl_FragColor = vec4(mix(color.rgb, y, a), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag new file mode 100644 index 000000000..fda46efc7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 y = vec3(0.5, 0.5, 0.5); + const vec3 a = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + + gl_FragColor = vec4(c * (1.0 - a) + y * a, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert new file mode 100644 index 000000000..690f41ec9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 y = vec3(0.5, 0.5, 0.5); + const vec3 a = vec3(0.5, 0.5, 0.5); + color = vec4(mix(gtf_Color.rgb, y, a), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert new file mode 100644 index 000000000..d9dec9bbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 y = vec3(0.5, 0.5, 0.5); + const vec3 a = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + + color = vec4(c * (1.0 - a) + y * a, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt new file mode 100644 index 000000000..d369e576f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +mod_001_to_008.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html new file mode 100644 index 000000000..8ef0c3f49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html @@ -0,0 +1,179 @@ + + + + + +WebGL GLSL conformance test: mod_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag new file mode 100644 index 000000000..9f22543d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4(mod(c, 1.0), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag new file mode 100644 index 000000000..2c35298a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (color.r - 0.5); + c = c - 1.0 * floor(c / 1.0); + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert new file mode 100644 index 000000000..17d54ce21 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4(mod(c, 1.0), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert new file mode 100644 index 000000000..ad6fc8185 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 10.0 * 2.0 * (gtf_Color.r - 0.5); + c = c - 1.0 * floor(c / 1.0); + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag new file mode 100644 index 000000000..335b8ff49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(mod(c, 1.0), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag new file mode 100644 index 000000000..143a832ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (color.rg - 0.5); + c = c - 1.0 * floor(c / 1.0); + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert new file mode 100644 index 000000000..dad066a14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4(mod(c, 1.0), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert new file mode 100644 index 000000000..1f583fd97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5); + c = c - 1.0 * floor(c / 1.0); + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag new file mode 100644 index 000000000..1b8bd31d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(mod(c, 1.0), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag new file mode 100644 index 000000000..6f934b601 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (color.rgb - 0.5); + c = c - 1.0 * floor(c / 1.0); + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert new file mode 100644 index 000000000..468dd4d3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(mod(c, 1.0), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert new file mode 100644 index 000000000..1eb6c4ffc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5); + c = c - 1.0 * floor(c / 1.0); + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag new file mode 100644 index 000000000..a56c58125 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = vec4(mod(300.0, 100.0), 0.0, 0.0, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert new file mode 100644 index 000000000..9d126ea2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = vec4(mod(300.0, 100.0), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt new file mode 100644 index 000000000..56ce6dcbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +normalize_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html new file mode 100644 index 000000000..9f373d680 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: normalize_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag new file mode 100644 index 000000000..9d07f0390 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = color + vec4(0.25); + gl_FragColor = vec4(normalize(tmp_Color.r), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag new file mode 100644 index 000000000..1e96c743e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = color + vec4(0.25); + gl_FragColor = vec4(tmp_Color.r / length(tmp_Color.r), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert new file mode 100644 index 000000000..81e999b8b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = gtf_Color + vec4(0.25); + color = vec4(normalize(tmp_Color.r), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert new file mode 100644 index 000000000..29e23f5cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = gtf_Color + vec4(0.25); + color = vec4(tmp_Color.r / length(tmp_Color.r), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag new file mode 100644 index 000000000..be1756b5b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = color + vec4(0.25); + gl_FragColor = vec4(normalize(tmp_Color.rg), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..0e4e031ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = color + vec4(0.25); + gl_FragColor = vec4(tmp_Color.rg / length(tmp_Color.rg), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert new file mode 100644 index 000000000..4bea42efd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = gtf_Color + vec4(0.25); + color = vec4(normalize(tmp_Color.rg), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..b03a2c70b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = gtf_Color + vec4(0.25); + color = vec4(tmp_Color.rg / length(tmp_Color.rg), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag new file mode 100644 index 000000000..3f7e6eb1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = color + vec4(0.25); + gl_FragColor = vec4(normalize(tmp_Color.rgb), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..62f0cea72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = color + vec4(0.25); + gl_FragColor = vec4(tmp_Color.rgb / length(tmp_Color.rgb), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert new file mode 100644 index 000000000..33121c034 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = gtf_Color + vec4(0.25); + color = vec4(normalize(tmp_Color.rgb), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..665730a3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 tmp_Color = gtf_Color + vec4(0.25); + color = vec4(tmp_Color.rgb / length(tmp_Color.rgb), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt new file mode 100644 index 000000000..89038b744 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +not_001_to_004.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html new file mode 100644 index 000000000..95face7e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: not_001_to_004.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag new file mode 100644 index 000000000..129ba6669 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec2(not(bvec2(c))), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag new file mode 100644 index 000000000..3a94ec0fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag @@ -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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 _not(in bvec2 a) +{ + bvec2 result; + if(a[0]) result[0] = false; + else result[0] = true; + if(a[1]) result[1] = false; + else result[1] = true; + return result; +} + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec2(_not(bvec2(c))), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert new file mode 100644 index 000000000..3fb1ff972 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + color = vec4(vec2(not(bvec2(c))), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert new file mode 100644 index 000000000..974d78645 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 _not(in bvec2 a) +{ + bvec2 result; + if(a[0]) result[0] = false; + else result[0] = true; + if(a[1]) result[1] = false; + else result[1] = true; + return result; +} + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + color = vec4(vec2(_not(bvec2(c))), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag new file mode 100644 index 000000000..8b2d4e3e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec3(not(bvec3(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag new file mode 100644 index 000000000..2172e7683 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 _not(in bvec3 a) +{ + bvec3 result; + if(a[0]) result[0] = false; + else result[0] = true; + if(a[1]) result[1] = false; + else result[1] = true; + if(a[2]) result[2] = false; + else result[2] = true; + return result; +} + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + gl_FragColor = vec4(vec3(_not(bvec3(c))), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert new file mode 100644 index 000000000..554724cb6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + color = vec4(vec3(not(bvec3(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert new file mode 100644 index 000000000..d2a4a5d2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 _not(in bvec3 a) +{ + bvec3 result; + if(a[0]) result[0] = false; + else result[0] = true; + if(a[1]) result[1] = false; + else result[1] = true; + if(a[2]) result[2] = false; + else result[2] = true; + return result; +} + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + color = vec4(vec3(_not(bvec3(c))), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt new file mode 100644 index 000000000..9bc23768e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt @@ -0,0 +1,3 @@ +# this file is auto-generated. DO NOT EDIT. +notEqual_001_to_008.html +notEqual_009_to_012.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html new file mode 100644 index 000000000..6d1d7ad4e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: notEqual_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html new file mode 100644 index 000000000..00566d42d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html @@ -0,0 +1,103 @@ + + + + + +WebGL GLSL conformance test: notEqual_009_to_012.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag new file mode 100644 index 000000000..6c98f0de6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(notEqual(bvec2(c), bvec2(true))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag new file mode 100644 index 000000000..f51b8b6d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 ne(in bvec2 a, in bvec2 b) +{ + bvec2 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(ne(bvec2(c), bvec2(true))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert new file mode 100644 index 000000000..97fe2e9ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(notEqual(bvec2(c), bvec2(true))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert new file mode 100644 index 000000000..7944e8ac8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 ne(in bvec2 a, in bvec2 b) +{ + bvec2 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false + vec2 result = vec2(ne(bvec2(c), bvec2(true))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag new file mode 100644 index 000000000..36d6169af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(notEqual(bvec3(c), bvec3(true))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag new file mode 100644 index 000000000..7f4654dcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 ne(in bvec3 a, in bvec3 b) +{ + bvec3 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + if(a[2] != b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(ne(bvec3(c), bvec3(true))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert new file mode 100644 index 000000000..7688b8c91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(notEqual(bvec3(c), bvec3(true))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert new file mode 100644 index 000000000..4384aae39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 ne(in bvec3 a, in bvec3 b) +{ + bvec3 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + if(a[2] != b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false + vec3 result = vec3(ne(bvec3(c), bvec3(true))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag new file mode 100644 index 000000000..d8cb50a3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(notEqual(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag new file mode 100644 index 000000000..f96b4d896 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec2 ne(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(ne(ivec2(c), ivec2(0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert new file mode 100644 index 000000000..b49070b8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(notEqual(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert new file mode 100644 index 000000000..065b0e560 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 ne(in ivec2 a, in ivec2 b) +{ + bvec2 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(ne(ivec2(c), ivec2(0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag new file mode 100644 index 000000000..492456793 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(notEqual(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag new file mode 100644 index 000000000..069dd39af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 ne(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + if(a[2] != b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(ne(ivec3(c), ivec3(0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert new file mode 100644 index 000000000..a63d944ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(notEqual(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert new file mode 100644 index 000000000..c2de0814f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 ne(in ivec3 a, in ivec3 b) +{ + bvec3 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + if(a[2] != b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(ne(ivec3(c), ivec3(0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag new file mode 100644 index 000000000..95c56263f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(notEqual(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag new file mode 100644 index 000000000..1d4bd306a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +varying vec4 color; + +bvec2 ne(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(ne(c, vec2(0.0))); + gl_FragColor = vec4(result, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert new file mode 100644 index 000000000..01b8e8a39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(notEqual(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert new file mode 100644 index 000000000..0aaa91665 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec2 ne(in vec2 a, in vec2 b) +{ + bvec2 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + return result; +} + +void main (void) +{ + vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer + vec2 result = vec2(ne(c, vec2(0.0))); + color = vec4(result, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag new file mode 100644 index 000000000..2f96471c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(notEqual(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag new file mode 100644 index 000000000..56009be51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +bvec3 ne(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + if(a[2] != b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(ne(c, vec3(0.0))); + gl_FragColor = vec4(result, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert new file mode 100644 index 000000000..b6f115140 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(notEqual(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert new file mode 100644 index 000000000..78053b0f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +bvec3 ne(in vec3 a, in vec3 b) +{ + bvec3 result; + if(a[0] != b[0]) result[0] = true; + else result[0] = false; + if(a[1] != b[1]) result[1] = true; + else result[1] = false; + if(a[2] != b[2]) result[2] = true; + else result[2] = false; + return result; +} + +void main (void) +{ + vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer + vec3 result = vec3(ne(c, vec3(0.0))); + color = vec4(result, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag new file mode 100644 index 000000000..2967fc0d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + int resultadd = m + k; + int resultsubtract = m - k; + float gray; + if( ( resultadd == 114 ) && ( resultsubtract == 90 ) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert new file mode 100644 index 000000000..4eaa2f93d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + int resultadd = m + k; + int resultsubtract = m - k; + float gray; + if( ( resultadd == 114 ) && ( resultsubtract == 90 ) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag new file mode 100644 index 000000000..b31965674 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag @@ -0,0 +1,78 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 12; + int n = 102; + bool result = true; + int r = m; + + if( r==12 ) + result = result && true; + else + result = result && false; + + r += m; + + if( r == 24 ) + result = result && true; + else + result = result && false; + + r-= m; + + if( r == 12 ) + result = result && true; + else + result = result && false; + + r*= m; + + if ( r == 144 ) + result = result && true; + else + result = result && false; + + r/= m; + + // Integer divide can be implemented via float reciprocal, + // so the result need not be exact + if( r >= 11 && r <= 13 ) + result = result && true; + else + result = result && false; + + float gray; + if( result ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert new file mode 100644 index 000000000..a4728ed98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert @@ -0,0 +1,78 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m = 12; + int n = 102; + bool result = true; + int r = m; + + if( r==12 ) + result = result && true; + else + result = result && false; + + r += m; + + if( r == 24 ) + result = result && true; + else + result = result && false; + + r-= m; + + if( r == 12 ) + result = result && true; + else + result = result && false; + + r*= m; + + if ( r == 144 ) + result = result && true; + else + result = result && false; + + r/= m; + + // Integer divide can be implemented via float reciprocal, + // so the result need not be exact + if( r >= 11 && r <= 13 ) + result = result && true; + else + result = result && false; + + float gray; + if( result ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag new file mode 100644 index 000000000..e65ab2e47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + int result = m/k; + float gray; + // The rounding mode for integer divide is implementation-dependent + if( ( result == 8 ) || ( result == 9 ) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert new file mode 100644 index 000000000..3c9639884 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + int result = m/k; + float gray; + // The rounding mode for integer divide is implementation-dependent + if( ( result == 8 ) || ( result == 9 ) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag new file mode 100644 index 000000000..a8a5d471b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + bool equalto = (m == 102); + bool notequalto = (k != 102); + + float gray; + if( equalto && notequalto ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert new file mode 100644 index 000000000..34ef88e62 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + bool equalto = (m == 102); + bool notequalto = (k != 102); + + float gray; + if( equalto && notequalto ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt new file mode 100644 index 000000000..b6e176588 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt @@ -0,0 +1,5 @@ +# this file is auto-generated. DO NOT EDIT. +operators_001_to_008.html +operators_009_to_016.html +operators_017_to_024.html +operators_025_to_026.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag new file mode 100644 index 000000000..223557025 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag @@ -0,0 +1,111 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ +bool result = true; + bool a = true; + bool b = true; + + if( (a&&b) ) + result = result && true; + else + result = result && false; + + if( (a||b) ) + result = result && true; + else + result = result && false; + + if( !(a^^b) ) + result = result && true; + else + result = result && false; + + a = true; + b = false; + + if( !(a&&b) ) + result = result && true; + else + result = result && false; + + if( (a||b) ) + result = result && true; + else + result = result && false; + + if( (a^^b) ) + result = result && true; + else + result = result && false; + + a = false; + b = true; + + if( !(a&&b) ) + result = result && true; + else + result = result && false; + + if( (a||b) ) + result = result && true; + else + result = result && false; + + if( (a^^b) ) + result = result && true; + else + result = result && false; + + a = false; + b = false; + + if( !(a&&b) ) + result = result && true; + else + result = result && false; + + if( !(a||b) ) + result = result && true; + else + result = result && false; + + if( !(a^^b) ) + result = result && true; + else + result = result && false; + + float gray; + if( result ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert new file mode 100644 index 000000000..8de9aafc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert @@ -0,0 +1,111 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + bool result = true; + bool a = true; + bool b = true; + + if( (a&&b) ) + result = result && true; + else + result = result && false; + + if( (a||b) ) + result = result && true; + else + result = result && false; + + if( !(a^^b) ) + result = result && true; + else + result = result && false; + + a = true; + b = false; + + if( !(a&&b) ) + result = result && true; + else + result = result && false; + + if( (a||b) ) + result = result && true; + else + result = result && false; + + if( (a^^b) ) + result = result && true; + else + result = result && false; + + a = false; + b = true; + + if( !(a&&b) ) + result = result && true; + else + result = result && false; + + if( (a||b) ) + result = result && true; + else + result = result && false; + + if( (a^^b) ) + result = result && true; + else + result = result && false; + + a = false; + b = false; + + if( !(a&&b) ) + result = result && true; + else + result = result && false; + + if( !(a||b) ) + result = result && true; + else + result = result && false; + + if( !(a^^b) ) + result = result && true; + else + result = result && false; + + float gray; + if( result ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag new file mode 100644 index 000000000..dd23c5b13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + int result = m*k; + float gray; + if( ( result == 1224 ) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert new file mode 100644 index 000000000..138b12d9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + int result = m*k; + float gray; + if( ( result == 1224 ) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html new file mode 100644 index 000000000..dbe046306 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: operators_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html new file mode 100644 index 000000000..478c9b0dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: operators_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html new file mode 100644 index 000000000..1f358c193 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: operators_017_to_024.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html new file mode 100644 index 000000000..8cb934828 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html @@ -0,0 +1,101 @@ + + + + + +WebGL GLSL conformance test: operators_025_to_026.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag new file mode 100644 index 000000000..70da81709 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 23; + int k = m--; + float gray; + if( ( k == 23 ) && ( m == 22 ) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert new file mode 100644 index 000000000..27782385e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m=23; + int k = m--; + float gray; + if( (k==23) && (m==22) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag new file mode 100644 index 000000000..0fecc5d2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 23; + int k = m++; + float gray; + if( ( k == 23 ) && ( m == 24 ) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert new file mode 100644 index 000000000..30fa784e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m=23; + int k = m++; + float gray; + if( (k==23) && (m==24) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag new file mode 100644 index 000000000..92b04b785 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 23; + int k = --m; + float gray; + if( ( k == 22 ) && ( m == 22 ) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert new file mode 100644 index 000000000..4509b9b41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m=23; + int k = --m; + float gray; + if( (k==22) && (m==22) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag new file mode 100644 index 000000000..534b826a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 23; + int k = ++m; + float gray; + if( ( k == 24 ) && ( m == 24 ) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert new file mode 100644 index 000000000..4b51c6a32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m=23; + int k = ++m; + float gray; + if( (k==24) && (m==24) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag new file mode 100644 index 000000000..fe2716d0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + bool lessthan = (mk); + bool lessthanorequalto = (m <= 102); + bool greaterthanorequalto = (k >=12); + float gray; + if( !lessthan && greaterthan && lessthanorequalto && greaterthanorequalto ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert new file mode 100644 index 000000000..322bb8416 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + int m = 102; + int k = 12; + bool lessthan = (mk); + bool lessthanorequalto = (m <= 102); + bool greaterthanorequalto = (k >=12); + + float gray; + if( !lessthan && greaterthan && lessthanorequalto && greaterthanorequalto ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag new file mode 100644 index 000000000..9611e2c10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + int j = 30; + int k = 37; + int y = 10; + int n = 12; + bool result1 = false; + bool result2 = false; + (j>k)?( result1 = true ):( result1 = false ); + (yk)?( result1 = true ):( result1 = false ); + (y + + + + +WebGL GLSL conformance test: pow_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html new file mode 100644 index 000000000..9f1211bec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: pow_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html new file mode 100644 index 000000000..628ca3868 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: pow_017_to_024.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag new file mode 100644 index 000000000..dc2534ce4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (color.r - 0.5); + gl_FragColor = vec4(pow(2.0, 2.0 * c) / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag new file mode 100644 index 000000000..8e2cd4eef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (color.r - 0.5); + gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag new file mode 100644 index 000000000..60d20306a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (color.r - 0.5); + gl_FragColor = vec4(pow(0.5, 2.0 * c) / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag new file mode 100644 index 000000000..96be455a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = -2.0 * (color.r - 0.5); + gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag new file mode 100644 index 000000000..8682a0e9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 4.0 * (color.r); + gl_FragColor = vec4(pow(c, 2.0) / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag new file mode 100644 index 000000000..0b82bded5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 4.0 * (color.r); + gl_FragColor = vec4(c * c / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..e071d29a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 16.0 * color.r; + gl_FragColor = vec4(pow(c, 0.5) / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..5ff3ddbe9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 16.0 * color.r; + gl_FragColor = vec4(sqrt(c) / 4.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert new file mode 100644 index 000000000..83f22bb80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (gtf_Color.r - 0.5); + color = vec4(pow(2.0, 2.0 * c) / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert new file mode 100644 index 000000000..130327c6e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (gtf_Color.r - 0.5); + color = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert new file mode 100644 index 000000000..0533c7560 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (gtf_Color.r - 0.5); + color = vec4(pow(0.5, 2.0 * c) / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert new file mode 100644 index 000000000..fe9bdc84e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = -2.0 * (gtf_Color.r - 0.5); + color = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert new file mode 100644 index 000000000..f0be45abe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 4.0 * (gtf_Color.r); + color = vec4(pow(c, 2.0) / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert new file mode 100644 index 000000000..f76054b2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 4.0 * (gtf_Color.r); + color = vec4(c * c / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..7609fa589 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 16.0 * gtf_Color.r; + color = vec4(pow(c, 0.5) / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..f58d044b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 16.0 * gtf_Color.r; + color = vec4(sqrt(c) / 4.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag new file mode 100644 index 000000000..e47822c0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(pow(vec2(2.0), 2.0 * c) / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag new file mode 100644 index 000000000..30b360435 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag new file mode 100644 index 000000000..67daa4720 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(pow(vec2(0.5), 2.0 * c) / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag new file mode 100644 index 000000000..e7cc4c966 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = -2.0 * (color.rg - 0.5); + gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag new file mode 100644 index 000000000..6ae78c70d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 4.0 * (color.rg); + gl_FragColor = vec4(pow(c, vec2(2.0)) / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag new file mode 100644 index 000000000..0540ebe0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 4.0 * (color.rg); + gl_FragColor = vec4(c * c / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..196535a8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 16.0 * color.rg; + gl_FragColor = vec4(pow(c, vec2(0.5)) / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..cb591dc5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 16.0 * color.rg; + gl_FragColor = vec4(sqrt(c) / 4.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert new file mode 100644 index 000000000..ec59a85bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + color = vec4(pow(vec2(2.0), 2.0 * c) / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert new file mode 100644 index 000000000..35f12854d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + color = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert new file mode 100644 index 000000000..ab3c56d49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + color = vec4(pow(vec2(0.5), 2.0 * c) / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert new file mode 100644 index 000000000..d5a1a6202 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = -2.0 * (gtf_Color.rg - 0.5); + color = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert new file mode 100644 index 000000000..0411d3f0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 4.0 * (gtf_Color.rg); + color = vec4(pow(c, vec2(2.0)) / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert new file mode 100644 index 000000000..c83de7302 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 4.0 * (gtf_Color.rg); + color = vec4(c * c / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..80e7e176b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 16.0 * gtf_Color.rg; + color = vec4(pow(c, vec2(0.5)) / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..abf19d3b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 16.0 * gtf_Color.rg; + color = vec4(sqrt(c) / 4.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag new file mode 100644 index 000000000..7aa24fb92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(pow(vec3(2.0), 2.0 * c) / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag new file mode 100644 index 000000000..339406c5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag new file mode 100644 index 000000000..7b35c8664 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(pow(vec3(0.5), 2.0 * c) / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag new file mode 100644 index 000000000..9000d040f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = -2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag new file mode 100644 index 000000000..319fb17a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = color.rgb; + gl_FragColor = vec4(pow(c, vec3(2.0)) / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag new file mode 100644 index 000000000..439476d70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = color.rgb; + gl_FragColor = vec4(c * c / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag new file mode 100644 index 000000000..82b120f15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 16.0 * color.rgb; + gl_FragColor = vec4(pow(c, vec3(0.5)) / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 000000000..407bc1db2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 16.0 * color.rgb; + gl_FragColor = vec4(sqrt(c) / 4.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert new file mode 100644 index 000000000..875ff7f93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(pow(vec3(2.0), 2.0 * c) / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert new file mode 100644 index 000000000..155519ef1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(exp2(2.0 * c) / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert new file mode 100644 index 000000000..ebb4c42a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(pow(vec3(0.5), 2.0 * c) / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert new file mode 100644 index 000000000..d797011e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = -2.0 * (gtf_Color.rgb - 0.5); + color = vec4(exp2(2.0 * c) / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert new file mode 100644 index 000000000..38ef59d3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 4.0 * (gtf_Color.rgb); + color = vec4(pow(c, vec3(2.0)) / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert new file mode 100644 index 000000000..0cd2ef6ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 4.0 * (gtf_Color.rgb); + color = vec4(c * c / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert new file mode 100644 index 000000000..3ab236199 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 16.0 * gtf_Color.rgb; + color = vec4(pow(c, vec3(0.5)) / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 000000000..da9005673 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 16.0 * gtf_Color.rgb; + color = vec4(sqrt(c) / 4.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt new file mode 100644 index 000000000..891a82745 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +radians_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html new file mode 100644 index 000000000..3e76d34dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: radians_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag new file mode 100644 index 000000000..141c45d53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 360.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag new file mode 100644 index 000000000..5e9ba0b45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 360.0 * 2.0 * (color.r - 0.5); + gl_FragColor = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert new file mode 100644 index 000000000..8a858b641 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 360.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert new file mode 100644 index 000000000..2c21ac034 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 360.0 * 2.0 * (gtf_Color.r - 0.5); + color = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag new file mode 100644 index 000000000..594e26ac0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 360.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..6c95619e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 360.0 * 2.0 * (color.rg - 0.5); + gl_FragColor = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert new file mode 100644 index 000000000..b232f5646 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 360.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..9530c8b3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 360.0 * 2.0 * (gtf_Color.rg - 0.5); + color = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag new file mode 100644 index 000000000..5cebc76b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 360.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(radians(c) / (4.0 * M_PI) + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..3026b494c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 360.0 * 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert new file mode 100644 index 000000000..7f91ba404 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 360.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(radians(c) / (4.0 * M_PI) + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..74cad8da0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 360.0 * 2.0 * (gtf_Color.rgb - 0.5); + color = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt new file mode 100644 index 000000000..b32c960e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +reflect_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html new file mode 100644 index 000000000..33a7a5690 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: reflect_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag new file mode 100644 index 000000000..23780bbec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (color.g + 1.0) / 2.0; + float v2 = (color.b + 1.0) / 2.0; + + gl_FragColor = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag new file mode 100644 index 000000000..7c9a07eb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (color.g + 1.0) / 2.0; + float v2 = (color.b + 1.0) / 2.0; + + gl_FragColor = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert new file mode 100644 index 000000000..1881b976c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (gtf_Color.g + 1.0) / 2.0; + float v2 = (gtf_Color.b + 1.0) / 2.0; + + color = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert new file mode 100644 index 000000000..3b6162907 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (gtf_Color.g + 1.0) / 2.0; + float v2 = (gtf_Color.b + 1.0) / 2.0; + + color = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag new file mode 100644 index 000000000..d614676d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + gl_FragColor = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag new file mode 100644 index 000000000..07a4a7c74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + gl_FragColor = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert new file mode 100644 index 000000000..5f1e20ed1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + color = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert new file mode 100644 index 000000000..dee1b983c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + color = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag new file mode 100644 index 000000000..a7287f230 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + gl_FragColor = vec4((reflect(v1, v2) + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag new file mode 100644 index 000000000..cd1418958 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + gl_FragColor = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert new file mode 100644 index 000000000..f375b86a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + color = vec4((reflect(v1, v2) + 1.0) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert new file mode 100644 index 000000000..58a9b84f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + color = vec4((v1 - 2.0 * dot(v2, v1) * v2 + vec3(1.0)) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt new file mode 100644 index 000000000..c7deedd54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +refract_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html new file mode 100644 index 000000000..fd334768c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: refract_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag new file mode 100644 index 000000000..6cd7faa01 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (color.g + 1.0) / 2.0; + float v2 = (color.b + 1.0) / 2.0; + + gl_FragColor = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag new file mode 100644 index 000000000..a0159b0f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + // Both are unit vectors + float v1 = (color.g + 1.0) / 2.0; + float v2 = (color.b + 1.0) / 2.0; + + float result; + float eta = 0.5; + float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2)); + if(k < 0.0) + result = 0.0; + else + result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2; + + gl_FragColor = vec4((result + 1.0) / 2.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert new file mode 100644 index 000000000..83dcb5930 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + // Both are unit vectors + float v1 = (gtf_Color.g + 1.0) / 2.0; + float v2 = (gtf_Color.b + 1.0) / 2.0; + + color = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert new file mode 100644 index 000000000..31826c6c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + float v1 = (gtf_Color.g + 1.0) / 2.0; + float v2 = (gtf_Color.b + 1.0) / 2.0; + + float result; + float eta = 0.5; + float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2)); + if(k < 0.0) + result = 0.0; + else + result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2; + + color = vec4((result + 1.0) / 2.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag new file mode 100644 index 000000000..189a168f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + gl_FragColor = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag new file mode 100644 index 000000000..bad139c37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + vec2 result; + float eta = 0.5; + float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2)); + if(k < 0.0) + result = vec2(0.0); + else + result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2; + + gl_FragColor = vec4((result + 1.0) / 2.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert new file mode 100644 index 000000000..62b77e91c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + color = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert new file mode 100644 index 000000000..d01fb22ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec2 v1; + vec2 v2 = normalize(vec2(1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + + vec2 result; + float eta = 0.5; + float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2)); + if(k < 0.0) + result = vec2(0.0); + else + result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2; + + color = vec4((result + 1.0) / 2.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag new file mode 100644 index 000000000..421cf9b58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + gl_FragColor = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag new file mode 100644 index 000000000..16be25c1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag @@ -0,0 +1,55 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + + float theta = color.g * 2.0 * M_PI; + float phi = color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + vec3 result; + float eta = 0.5; + float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2)); + if(k < 0.0) + result = vec3(0.0); + else + result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2; + + gl_FragColor = vec4((result + 1.0) / 2.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert new file mode 100644 index 000000000..6423ca40e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + color = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert new file mode 100644 index 000000000..0fa9b7cbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert @@ -0,0 +1,55 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + + // Both are unit vectors + vec3 v1; + vec3 v2 = normalize(vec3(1.0, 1.0, 1.0)); + + float theta = gtf_Color.g * 2.0 * M_PI; + float phi = gtf_Color.b * 2.0 * M_PI; + v1.x = cos(theta) * sin(phi); + v1.y = sin(theta) * sin(phi); + v1.z = cos(phi); + + vec3 result; + float eta = 0.5; + float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2)); + if(k < 0.0) + result = vec3(0.0); + else + result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2; + + color = vec4((result + 1.0) / 2.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt new file mode 100644 index 000000000..b22bf9d68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +sign_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html new file mode 100644 index 000000000..7bba135ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: sign_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag new file mode 100644 index 000000000..0a3fcd169 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (color.r - 0.5); + gl_FragColor = vec4(c * sign(c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag new file mode 100644 index 000000000..082dea1d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (color.r - 0.5); + if(c > 0.0) c = 1.0 * c; + if(c < 0.0) c = -1.0 * c; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert new file mode 100644 index 000000000..e2a048f34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (gtf_Color.r - 0.5); + color = vec4(c * sign(c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert new file mode 100644 index 000000000..7646fb736 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 2.0 * (gtf_Color.r - 0.5); + if(c > 0.0) c = 1.0 * c; + if(c < 0.0) c = -1.0 * c; + + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag new file mode 100644 index 000000000..3dbdde207 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (color.rg - 0.5); + gl_FragColor = vec4(c * sign(c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..08a6c3d03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (color.rg - 0.5); + if(c[0] > 0.0) c[0] = 1.0 * c[0]; + if(c[0] < 0.0) c[0] = -1.0 * c[0]; + if(c[1] > 0.0) c[1] = 1.0 * c[1]; + if(c[1] < 0.0) c[1] = -1.0 * c[1]; + + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert new file mode 100644 index 000000000..fde1a269c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + color = vec4(c * sign(c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..000159fc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 2.0 * (gtf_Color.rg - 0.5); + if(c[0] > 0.0) c[0] = 1.0 * c[0]; + if(c[0] < 0.0) c[0] = -1.0 * c[0]; + if(c[1] > 0.0) c[1] = 1.0 * c[1]; + if(c[1] < 0.0) c[1] = -1.0 * c[1]; + + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag new file mode 100644 index 000000000..21b915804 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (color.rgb - 0.5); + gl_FragColor = vec4(c * (sign(c)), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..4646aadad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (color.rgb - 0.5); + + if(c[0] > 0.0) c[0] = 1.0 * c[0]; + if(c[0] < 0.0) c[0] = -1.0 * c[0]; + if(c[1] > 0.0) c[1] = 1.0 * c[1]; + if(c[1] < 0.0) c[1] = -1.0 * c[1]; + if(c[2] > 0.0) c[2] = 1.0 * c[2]; + if(c[2] < 0.0) c[2] = -1.0 * c[2]; + + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert new file mode 100644 index 000000000..991fbcad8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + color = vec4(c * sign(c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..d6cb2e711 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 2.0 * (gtf_Color.rgb - 0.5); + + if(c[0] > 0.0) c[0] = 1.0 * c[0]; + if(c[0] < 0.0) c[0] = -1.0 * c[0]; + if(c[1] > 0.0) c[1] = 1.0 * c[1]; + if(c[1] < 0.0) c[1] = -1.0 * c[1]; + if(c[2] > 0.0) c[2] = 1.0 * c[2]; + if(c[2] < 0.0) c[2] = -1.0 * c[2]; + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt new file mode 100644 index 000000000..2995c5658 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +sin_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html new file mode 100644 index 000000000..b2760c73f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: sin_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag new file mode 100644 index 000000000..ce1bd224f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + gl_FragColor = vec4(0.5 * sin(2.0 * M_PI * color.r) + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag new file mode 100644 index 000000000..16253c93b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag @@ -0,0 +1,101 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float sinValues[17]; + sinValues[0] = 0.0; + sinValues[1] = 0.382683; + sinValues[2] = 0.707107; + sinValues[3] = 0.92388; + sinValues[4] = 1.0; + sinValues[5] = 0.92388; + sinValues[6] = 0.707107; + sinValues[7] = 0.382683; + sinValues[8] = 0.0; + sinValues[9] = -0.382683; + sinValues[10] = -0.707107; + sinValues[11] = -0.92388; + sinValues[12] = -1.0; + sinValues[13] = -0.923879; + sinValues[14] = -0.707107; + sinValues[15] = -0.382683; + sinValues[16] = 0.0; + + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * color.r; + + float arrVal = c * 2.546478971; + int arr0 = int(floor(arrVal)); + float weight = arrVal - floor(arrVal); + float sin_c = 0.0; + + if (arr0 == 0) + sin_c = lerp(sinValues[0], sinValues[1], weight); + else if (arr0 == 1) + sin_c = lerp(sinValues[1], sinValues[2], weight); + else if (arr0 == 2) + sin_c = lerp(sinValues[2], sinValues[3], weight); + else if (arr0 == 3) + sin_c = lerp(sinValues[3], sinValues[4], weight); + else if (arr0 == 4) + sin_c = lerp(sinValues[4], sinValues[5], weight); + else if (arr0 == 5) + sin_c = lerp(sinValues[5], sinValues[6], weight); + else if (arr0 == 6) + sin_c = lerp(sinValues[6], sinValues[7], weight); + else if (arr0 == 7) + sin_c = lerp(sinValues[7], sinValues[8], weight); + else if (arr0 == 8) + sin_c = lerp(sinValues[8], sinValues[9], weight); + else if (arr0 == 9) + sin_c = lerp(sinValues[9], sinValues[10], weight); + else if (arr0 == 10) + sin_c = lerp(sinValues[10], sinValues[11], weight); + else if (arr0 == 11) + sin_c = lerp(sinValues[11], sinValues[12], weight); + else if (arr0 == 12) + sin_c = lerp(sinValues[12], sinValues[13], weight); + else if (arr0 == 13) + sin_c = lerp(sinValues[13], sinValues[14], weight); + else if (arr0 == 14) + sin_c = lerp(sinValues[14], sinValues[15], weight); + else if (arr0 == 15) + sin_c = lerp(sinValues[15], sinValues[16], weight); + else if (arr0 == 16) + sin_c = sinValues[16]; + + gl_FragColor = vec4(0.5 * sin_c + 0.5, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert new file mode 100644 index 000000000..e1fd79d72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + color = vec4(0.5 * sin(2.0 * M_PI * gtf_Color.r) + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert new file mode 100644 index 000000000..2e4a52afa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert @@ -0,0 +1,55 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 2.0 * M_PI * gtf_Color.r; + float sign = 1.0; + + float sin_c = 0.0; + float fact; + float fact_of; + + // Taylors series expansion for sin + for(int i = 0; i < 12; i++) + { + fact = 1.0; + for(int j = 2; j <= 23; j++) + if (j <= 2 * i + 1) + fact *= float(j); + + sin_c += sign * pow(c, 2.0 * float(i) + 1.0) / fact; + sign *= -1.0; + } + + color = vec4(0.5 * sin_c + 0.5, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag new file mode 100644 index 000000000..6227170b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + gl_FragColor = vec4(0.5 * sin(2.0 * M_PI * color.rg) + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..2d3fc7f37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag @@ -0,0 +1,137 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float sinValues[17]; + sinValues[0] = 0.0; + sinValues[1] = 0.382683; + sinValues[2] = 0.707107; + sinValues[3] = 0.92388; + sinValues[4] = 1.0; + sinValues[5] = 0.92388; + sinValues[6] = 0.707107; + sinValues[7] = 0.382683; + sinValues[8] = 0.0; + sinValues[9] = -0.382683; + sinValues[10] = -0.707107; + sinValues[11] = -0.92388; + sinValues[12] = -1.0; + sinValues[13] = -0.923879; + sinValues[14] = -0.707107; + sinValues[15] = -0.382683; + sinValues[16] = 0.0; + + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * color.rg; + + vec2 arrVal = c * 2.546478971; + int arr0x = int(floor(arrVal.x)); + int arr0y = int(floor(arrVal.y)); + vec2 weight = arrVal - floor(arrVal); + vec2 sin_c = vec2(0.0, 0.0); + + if (arr0x == 0) + sin_c.x = lerp(sinValues[0], sinValues[1], weight.x); + else if (arr0x == 1) + sin_c.x = lerp(sinValues[1], sinValues[2], weight.x); + else if (arr0x == 2) + sin_c.x = lerp(sinValues[2], sinValues[3], weight.x); + else if (arr0x == 3) + sin_c.x = lerp(sinValues[3], sinValues[4], weight.x); + else if (arr0x == 4) + sin_c.x = lerp(sinValues[4], sinValues[5], weight.x); + else if (arr0x == 5) + sin_c.x = lerp(sinValues[5], sinValues[6], weight.x); + else if (arr0x == 6) + sin_c.x = lerp(sinValues[6], sinValues[7], weight.x); + else if (arr0x == 7) + sin_c.x = lerp(sinValues[7], sinValues[8], weight.x); + else if (arr0x == 8) + sin_c.x = lerp(sinValues[8], sinValues[9], weight.x); + else if (arr0x == 9) + sin_c.x = lerp(sinValues[9], sinValues[10], weight.x); + else if (arr0x == 10) + sin_c.x = lerp(sinValues[10], sinValues[11], weight.x); + else if (arr0x == 11) + sin_c.x = lerp(sinValues[11], sinValues[12], weight.x); + else if (arr0x == 12) + sin_c.x = lerp(sinValues[12], sinValues[13], weight.x); + else if (arr0x == 13) + sin_c.x = lerp(sinValues[13], sinValues[14], weight.x); + else if (arr0x == 14) + sin_c.x = lerp(sinValues[14], sinValues[15], weight.x); + else if (arr0x == 15) + sin_c.x = lerp(sinValues[15], sinValues[16], weight.x); + else if (arr0x == 16) + sin_c.x = sinValues[16]; + + if (arr0y == 0) + sin_c.y = lerp(sinValues[0], sinValues[1], weight.y); + else if (arr0y == 1) + sin_c.y = lerp(sinValues[1], sinValues[2], weight.y); + else if (arr0y == 2) + sin_c.y = lerp(sinValues[2], sinValues[3], weight.y); + else if (arr0y == 3) + sin_c.y = lerp(sinValues[3], sinValues[4], weight.y); + else if (arr0y == 4) + sin_c.y = lerp(sinValues[4], sinValues[5], weight.y); + else if (arr0y == 5) + sin_c.y = lerp(sinValues[5], sinValues[6], weight.y); + else if (arr0y == 6) + sin_c.y = lerp(sinValues[6], sinValues[7], weight.y); + else if (arr0y == 7) + sin_c.y = lerp(sinValues[7], sinValues[8], weight.y); + else if (arr0y == 8) + sin_c.y = lerp(sinValues[8], sinValues[9], weight.y); + else if (arr0y == 9) + sin_c.y = lerp(sinValues[9], sinValues[10], weight.y); + else if (arr0y == 10) + sin_c.y = lerp(sinValues[10], sinValues[11], weight.y); + else if (arr0y == 11) + sin_c.y = lerp(sinValues[11], sinValues[12], weight.y); + else if (arr0y == 12) + sin_c.y = lerp(sinValues[12], sinValues[13], weight.y); + else if (arr0y == 13) + sin_c.y = lerp(sinValues[13], sinValues[14], weight.y); + else if (arr0y == 14) + sin_c.y = lerp(sinValues[14], sinValues[15], weight.y); + else if (arr0y == 15) + sin_c.y = lerp(sinValues[15], sinValues[16], weight.y); + else if (arr0y == 16) + sin_c.y = sinValues[16]; + + gl_FragColor = vec4(0.5 * sin_c + 0.5, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert new file mode 100644 index 000000000..615eb6793 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + color = vec4(0.5 * sin(2.0 * M_PI * gtf_Color.rg) + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..9c11df9a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert @@ -0,0 +1,79 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float sinValues[17]; + sinValues[0] = 0.0; + sinValues[1] = 0.382683; + sinValues[2] = 0.707107; + sinValues[3] = 0.92388; + sinValues[4] = 1.0; + sinValues[5] = 0.92388; + sinValues[6] = 0.707107; + sinValues[7] = 0.382683; + sinValues[8] = 0.0; + sinValues[9] = -0.382683; + sinValues[10] = -0.707107; + sinValues[11] = -0.92388; + sinValues[12] = -1.0; + sinValues[13] = -0.923879; + sinValues[14] = -0.707107; + sinValues[15] = -0.382683; + sinValues[16] = 0.0; + + const float M_PI = 3.14159265358979323846; + vec2 c = 2.0 * M_PI * gtf_Color.rg; + float sign = 1.0; + + vec2 sin_c = vec2(0.0); + float fact; + float fact_of; + + // Taylors series expansion for sin + for(int i = 0; i < 12; i++) + { + fact = 1.0; + for(int j = 2; j <= 23; j++) + if (j <= 2 * i + 1) + fact *= float(j); + + sin_c += sign * pow(c, vec2(2.0 * float(i) + 1.0)) / fact; + sign *= -1.0; + } + + color = vec4(0.5 * sin_c + 0.5, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag new file mode 100644 index 000000000..892e996e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + gl_FragColor = vec4(0.5 * sin(2.0 * M_PI * color.rgb) + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..44c586d2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag @@ -0,0 +1,173 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float sinValues[17]; + sinValues[0] = 0.0; + sinValues[1] = 0.382683; + sinValues[2] = 0.707107; + sinValues[3] = 0.92388; + sinValues[4] = 1.0; + sinValues[5] = 0.92388; + sinValues[6] = 0.707107; + sinValues[7] = 0.382683; + sinValues[8] = 0.0; + sinValues[9] = -0.382683; + sinValues[10] = -0.707107; + sinValues[11] = -0.92388; + sinValues[12] = -1.0; + sinValues[13] = -0.923879; + sinValues[14] = -0.707107; + sinValues[15] = -0.382683; + sinValues[16] = 0.0; + + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * color.rgb; + + vec3 arrVal = c * 2.546478971; + int arr0x = int(floor(arrVal.x)); + int arr0y = int(floor(arrVal.y)); + int arr0z = int(floor(arrVal.z)); + vec3 weight = arrVal - floor(arrVal); + vec3 sin_c = vec3(0.0, 0.0, 0.0); + + if (arr0x == 0) + sin_c.x = lerp(sinValues[0], sinValues[1], weight.x); + else if (arr0x == 1) + sin_c.x = lerp(sinValues[1], sinValues[2], weight.x); + else if (arr0x == 2) + sin_c.x = lerp(sinValues[2], sinValues[3], weight.x); + else if (arr0x == 3) + sin_c.x = lerp(sinValues[3], sinValues[4], weight.x); + else if (arr0x == 4) + sin_c.x = lerp(sinValues[4], sinValues[5], weight.x); + else if (arr0x == 5) + sin_c.x = lerp(sinValues[5], sinValues[6], weight.x); + else if (arr0x == 6) + sin_c.x = lerp(sinValues[6], sinValues[7], weight.x); + else if (arr0x == 7) + sin_c.x = lerp(sinValues[7], sinValues[8], weight.x); + else if (arr0x == 8) + sin_c.x = lerp(sinValues[8], sinValues[9], weight.x); + else if (arr0x == 9) + sin_c.x = lerp(sinValues[9], sinValues[10], weight.x); + else if (arr0x == 10) + sin_c.x = lerp(sinValues[10], sinValues[11], weight.x); + else if (arr0x == 11) + sin_c.x = lerp(sinValues[11], sinValues[12], weight.x); + else if (arr0x == 12) + sin_c.x = lerp(sinValues[12], sinValues[13], weight.x); + else if (arr0x == 13) + sin_c.x = lerp(sinValues[13], sinValues[14], weight.x); + else if (arr0x == 14) + sin_c.x = lerp(sinValues[14], sinValues[15], weight.x); + else if (arr0x == 15) + sin_c.x = lerp(sinValues[15], sinValues[16], weight.x); + else if (arr0x == 16) + sin_c.x = sinValues[16]; + + if (arr0y == 0) + sin_c.y = lerp(sinValues[0], sinValues[1], weight.y); + else if (arr0y == 1) + sin_c.y = lerp(sinValues[1], sinValues[2], weight.y); + else if (arr0y == 2) + sin_c.y = lerp(sinValues[2], sinValues[3], weight.y); + else if (arr0y == 3) + sin_c.y = lerp(sinValues[3], sinValues[4], weight.y); + else if (arr0y == 4) + sin_c.y = lerp(sinValues[4], sinValues[5], weight.y); + else if (arr0y == 5) + sin_c.y = lerp(sinValues[5], sinValues[6], weight.y); + else if (arr0y == 6) + sin_c.y = lerp(sinValues[6], sinValues[7], weight.y); + else if (arr0y == 7) + sin_c.y = lerp(sinValues[7], sinValues[8], weight.y); + else if (arr0y == 8) + sin_c.y = lerp(sinValues[8], sinValues[9], weight.y); + else if (arr0y == 9) + sin_c.y = lerp(sinValues[9], sinValues[10], weight.y); + else if (arr0y == 10) + sin_c.y = lerp(sinValues[10], sinValues[11], weight.y); + else if (arr0y == 11) + sin_c.y = lerp(sinValues[11], sinValues[12], weight.y); + else if (arr0y == 12) + sin_c.y = lerp(sinValues[12], sinValues[13], weight.y); + else if (arr0y == 13) + sin_c.y = lerp(sinValues[13], sinValues[14], weight.y); + else if (arr0y == 14) + sin_c.y = lerp(sinValues[14], sinValues[15], weight.y); + else if (arr0y == 15) + sin_c.y = lerp(sinValues[15], sinValues[16], weight.y); + else if (arr0y == 16) + sin_c.y = sinValues[16]; + + if (arr0z == 0) + sin_c.z = lerp(sinValues[0], sinValues[1], weight.z); + else if (arr0z == 1) + sin_c.z = lerp(sinValues[1], sinValues[2], weight.z); + else if (arr0z == 2) + sin_c.z = lerp(sinValues[2], sinValues[3], weight.z); + else if (arr0z == 3) + sin_c.z = lerp(sinValues[3], sinValues[4], weight.z); + else if (arr0z == 4) + sin_c.z = lerp(sinValues[4], sinValues[5], weight.z); + else if (arr0z == 5) + sin_c.z = lerp(sinValues[5], sinValues[6], weight.z); + else if (arr0z == 6) + sin_c.z = lerp(sinValues[6], sinValues[7], weight.z); + else if (arr0z == 7) + sin_c.z = lerp(sinValues[7], sinValues[8], weight.z); + else if (arr0z == 8) + sin_c.z = lerp(sinValues[8], sinValues[9], weight.z); + else if (arr0z == 9) + sin_c.z = lerp(sinValues[9], sinValues[10], weight.z); + else if (arr0z == 10) + sin_c.z = lerp(sinValues[10], sinValues[11], weight.z); + else if (arr0z == 11) + sin_c.z = lerp(sinValues[11], sinValues[12], weight.z); + else if (arr0z == 12) + sin_c.z = lerp(sinValues[12], sinValues[13], weight.z); + else if (arr0z == 13) + sin_c.z = lerp(sinValues[13], sinValues[14], weight.z); + else if (arr0z == 14) + sin_c.z = lerp(sinValues[14], sinValues[15], weight.z); + else if (arr0z == 15) + sin_c.z = lerp(sinValues[15], sinValues[16], weight.z); + else if (arr0z == 16) + sin_c.z = sinValues[16]; + + gl_FragColor = vec4(0.5 * sin_c + 0.5, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert new file mode 100644 index 000000000..d60370e45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + color = vec4(0.5 * sin(2.0 * M_PI * gtf_Color.rgb) + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..85578df07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert @@ -0,0 +1,79 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +float lerp(float a, float b, float s) +{ + return a + (b - a) * s; +} + +void main (void) +{ + float sinValues[17]; + sinValues[0] = 0.0; + sinValues[1] = 0.382683; + sinValues[2] = 0.707107; + sinValues[3] = 0.92388; + sinValues[4] = 1.0; + sinValues[5] = 0.92388; + sinValues[6] = 0.707107; + sinValues[7] = 0.382683; + sinValues[8] = 0.0; + sinValues[9] = -0.382683; + sinValues[10] = -0.707107; + sinValues[11] = -0.92388; + sinValues[12] = -1.0; + sinValues[13] = -0.923879; + sinValues[14] = -0.707107; + sinValues[15] = -0.382683; + sinValues[16] = 0.0; + + const float M_PI = 3.14159265358979323846; + vec3 c = 2.0 * M_PI * gtf_Color.rgb; + float sign = 1.0; + + vec3 sin_c = vec3(0.0); + float fact; + float fact_of; + + // Taylors series expansion for sin + for(int i = 0; i < 12; i++) + { + fact = 1.0; + for(int j = 2; j <= 23; j++) + if (j <= 2 * i + 1) + fact *= float(j); + + sin_c += sign * pow(c, vec3(2.0 * float(i) + 1.0)) / fact; + sign *= -1.0; + } + + color = vec4(0.5 * sin_c + 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt new file mode 100644 index 000000000..4121dd5f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +smoothstep_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html new file mode 100644 index 000000000..a62e3c8c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: smoothstep_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag new file mode 100644 index 000000000..f7b8ed3d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float edge0 = 0.25; + const float edge1 = 0.75; + gl_FragColor = vec4(smoothstep(edge0, edge1, color.r), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag new file mode 100644 index 000000000..92e49f0f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float edge0 = 0.25; + const float edge1 = 0.75; + float c = clamp((color.r - edge0) / (edge1 - edge0), 0.0, 1.0); + + gl_FragColor = vec4(c * c * (3.0 - 2.0 * c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert new file mode 100644 index 000000000..bf8ff22cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float edge0 = 0.25; + const float edge1 = 0.75; + color = vec4(smoothstep(edge0, edge1, gtf_Color.r), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert new file mode 100644 index 000000000..55422bffd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float edge0 = 0.25; + const float edge1 = 0.75; + float c = clamp((gtf_Color.r - edge0) / (edge1 - edge0), 0.0, 1.0); + + color = vec4(c * c * (3.0 - 2.0 * c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag new file mode 100644 index 000000000..bd235720c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 edge0 = vec2(0.25, 0.25); + const vec2 edge1 = vec2(0.75, 0.75); + gl_FragColor = vec4(smoothstep(edge0, edge1, color.rg), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag new file mode 100644 index 000000000..8790241d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 edge0 = vec2(0.25, 0.25); + const vec2 edge1 = vec2(0.75, 0.75); + vec2 c = clamp((color.rg - edge0) / (edge1 - edge0), 0.0, 1.0); + gl_FragColor = vec4(c * c * (3.0 - 2.0 * c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert new file mode 100644 index 000000000..06f12e328 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 edge0 = vec2(0.25, 0.25); + const vec2 edge1 = vec2(0.75, 0.75); + color = vec4(smoothstep(edge0, edge1, gtf_Color.rg), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert new file mode 100644 index 000000000..00b4f7a25 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 edge0 = vec2(0.25, 0.25); + const vec2 edge1 = vec2(0.75, 0.75); + vec2 c = clamp((gtf_Color.rg - edge0) / (edge1 - edge0), 0.0, 1.0); + color = vec4(c * c * (3.0 - 2.0 * c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag new file mode 100644 index 000000000..e7ad681e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 edge0 = vec3(0.25, 0.25, 0.25); + const vec3 edge1 = vec3(0.75, 0.75, 0.75); + gl_FragColor = vec4(smoothstep(edge0, edge1, color.rgb), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag new file mode 100644 index 000000000..e07971e0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 edge0 = vec3(0.25, 0.25, 0.25); + const vec3 edge1 = vec3(0.75, 0.75, 0.75); + vec3 c = clamp((color.rgb - edge0) / (edge1 - edge0), 0.0, 1.0); + + gl_FragColor = vec4(c * c * (3.0 - 2.0 * c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert new file mode 100644 index 000000000..e12ed9317 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 edge0 = vec3(0.25, 0.25, 0.25); + const vec3 edge1 = vec3(0.75, 0.75, 0.75); + color = vec4(smoothstep(edge0, edge1, gtf_Color.rgb), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert new file mode 100644 index 000000000..4798adb90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 edge0 = vec3(0.25, 0.25, 0.25); + const vec3 edge1 = vec3(0.75, 0.75, 0.75); + vec3 c = clamp((gtf_Color.rgb - edge0) / (edge1 - edge0), 0.0, 1.0); + + color = vec4(c * c * (3.0 - 2.0 * c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt new file mode 100644 index 000000000..a151ee644 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +sqrt_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html new file mode 100644 index 000000000..c7775111b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: sqrt_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag new file mode 100644 index 000000000..bb2604b18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = sqrt(100.0 * color.r); + gl_FragColor = vec4(c * c / 100.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag new file mode 100644 index 000000000..2055b814d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + float c = 100.0 * color.r; + gl_FragColor = vec4(c / 100.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert new file mode 100644 index 000000000..7982ebf2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = sqrt(100.0 * gtf_Color.r); + color = vec4(c * c / 100.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert new file mode 100644 index 000000000..eb4f14413 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + float c = 100.0 * gtf_Color.r; + color = vec4(c / 100.0, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag new file mode 100644 index 000000000..e70a2ccbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = sqrt(100.0 * color.rg); + gl_FragColor = vec4(c * c / 100.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..4253e1034 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 c = 100.0 * color.rg; + gl_FragColor = vec4(c / 100.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert new file mode 100644 index 000000000..30587af1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = sqrt(100.0 * gtf_Color.rg); + color = vec4(c * c / 100.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..cb61ec8f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 c = 100.0 * gtf_Color.rg; + color = vec4(c / 100.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag new file mode 100644 index 000000000..b4d5c281c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = sqrt(100.0 * color.rgb); + gl_FragColor = vec4(c * c / 100.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..1fb1f880a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 c = 100.0 * color.rgb; + gl_FragColor = vec4(c / 100.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert new file mode 100644 index 000000000..1e3c8beae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = sqrt(100.0 * gtf_Color.rgb); + color = vec4(c * c / 100.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..e54f86bab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 c = 100.0 * gtf_Color.rgb; + color = vec4(c / 100.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt new file mode 100644 index 000000000..6b8ac005d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +step_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html new file mode 100644 index 000000000..32f49088a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: step_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag new file mode 100644 index 000000000..94e69d79c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float edge = 0.5; + gl_FragColor = vec4(step(edge, color.r), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag new file mode 100644 index 000000000..b601eb78b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float edge = 0.5; + float c = color.r; + if(c >= edge) c = 1.0; + else c = 0.0; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert new file mode 100644 index 000000000..2a3834f21 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float edge = 0.5; + color = vec4(step(edge, gtf_Color.r), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert new file mode 100644 index 000000000..3db47cac6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float edge = 0.5; + float c = gtf_Color.r; + if(c >= edge) c = 1.0; + else c = 0.0; + + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag new file mode 100644 index 000000000..93cc99fe2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 edge = vec2(0.5, 0.5); + gl_FragColor = vec4(step(edge, color.rg), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag new file mode 100644 index 000000000..d8d361010 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 edge = vec2(0.5, 0.5); + vec2 c = color.rg; + if(c[0] >= edge[0]) + { + c[0] = 1.0; + } + else + { + c[0] = 0.0; + } + if(c[1] >= edge[1]) + { + c[1] = 1.0; + } + else + { + c[1] = 0.0; + } + + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert new file mode 100644 index 000000000..d0df73886 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 edge = vec2(0.5, 0.5); + color = vec4(step(edge, gtf_Color.rg), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert new file mode 100644 index 000000000..11c5640e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec2 edge = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + if(c[0] >= edge[0]) + { + c[0] = 1.0; + } + else + { + c[0] = 0.0; + } + if(c[1] >= edge[1]) + { + c[1] = 1.0; + } + else + { + c[1] = 0.0; + } + + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag new file mode 100644 index 000000000..87c64f539 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 edge = vec3(0.5, 0.5, 0.5); + gl_FragColor = vec4(step(edge, color.rgb), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag new file mode 100644 index 000000000..3d9968222 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag @@ -0,0 +1,61 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 edge = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + if(c[0] >= edge[0]) + { + c[0] = 1.0; + } + else + { + c[0] = 0.0; + } + if(c[1] >= edge[1]) + { + c[1] = 1.0; + } + else + { + c[1] = 0.0; + } + if(c[2] >= edge[2]) + { + c[2] = 1.0; + } + else + { + c[2] = 0.0; + } + + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert new file mode 100644 index 000000000..0ac85addc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 edge = vec3(0.5, 0.5, 0.5); + color = vec4(step(edge, gtf_Color.rgb), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert new file mode 100644 index 000000000..d85a52ebe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert @@ -0,0 +1,62 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 edge = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + if(c[0] >= edge[0]) + { + c[0] = 1.0; + } + else + { + c[0] = 0.0; + } + if(c[1] >= edge[1]) + { + c[1] = 1.0; + } + else + { + c[1] = 0.0; + } + if(c[2] >= edge[2]) + { + c[2] = 1.0; + } + else + { + c[2] = 0.0; + } + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt new file mode 100644 index 000000000..89c3da16e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt @@ -0,0 +1,8 @@ +# this file is auto-generated. DO NOT EDIT. +struct_001_to_008.html +struct_009_to_016.html +struct_017_to_024.html +struct_025_to_032.html +struct_033_to_040.html +struct_041_to_048.html +struct_049_to_056.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag new file mode 100644 index 000000000..feb6532ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void){ + struct second_nest + { + float sc_nt; + mat2 sc_mt2; + vec4 sc_vc4; + }; + + struct nest + { + ivec3 nt_ivc3; + bvec4 nt_bvc4; + second_nest nt_scne; + }; + + struct test_t + { + float t_fl; + vec2 t_vc2; + vec3 t_vc3; + mat4 t_mt4; + nest t_nested; + float t_2fl; + }; + + vec4 mt1 = vec4(31.0, 32.0, 33.0, 34.0); + vec4 mt2 = vec4(35.0, 36.0, 37.0, 38.0); + vec4 mt3 = vec4(39.0, 40.0, 41.0, 42.0); + vec4 mt4 = vec4(43.0, 44.0, 45.0, 46.0); + int i=0; + float sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0; + + test_t a = test_t(23.0, vec2(12.0, 13.0), + + vec3(163.0, 173.0, 183.0), + + mat4(mt1, mt2, mt3, mt4), + + nest( ivec3(73, 74, 75), + + bvec4(12, 0, 17.0, 193.0 ), + + second_nest(144.0, mat2(22.0, 23.0, 24.0, 25.0), vec4(57.0, 58.0, 59.0, 60.0 ) + ) + ), + + 203.0 + ); + + sum1 = a.t_mt4[0][0] + a.t_mt4[0][1] + a.t_mt4[0][2] + a.t_mt4[0][3]; + sum2 = a.t_mt4[1][0] + a.t_mt4[1][1] + a.t_mt4[1][2] + a.t_mt4[1][3]; + sum3 = a.t_mt4[2][0] + a.t_mt4[2][1] + a.t_mt4[2][2] + a.t_mt4[2][3]; + sum4 = a.t_mt4[3][0] + a.t_mt4[3][1] + a.t_mt4[3][2] + a.t_mt4[3][3]; + + float gray; + if( ( a.t_fl == 23.0 ) && + + (a.t_vc2[0] == 12.0) && (a.t_vc2[1] == 13.0) && + + (a.t_vc3[0] == 163.0) && (a.t_vc3[1] == 173.0) && (a.t_vc3[2] == 183.0) && + + (sum1 > 130.0-ERROR_EPSILON && sum1 < 130.0+ERROR_EPSILON ) && (sum2 > 146.0-ERROR_EPSILON && sum2 < 146.0+ERROR_EPSILON ) && (sum3 >162.0-ERROR_EPSILON && sum3 < 162.0+ERROR_EPSILON ) && (sum4 > 178.0-ERROR_EPSILON && sum4 < 178.0+ERROR_EPSILON ) && + (a.t_nested.nt_ivc3[0] == 73 ) && (a.t_nested.nt_ivc3[1] == 74 ) && (a.t_nested.nt_ivc3[2] == 75 ) && + + (a.t_nested.nt_bvc4[0] == true) && (a.t_nested.nt_bvc4[1] == false) && + + (a.t_nested.nt_bvc4[2] == true ) && (a.t_nested.nt_bvc4[0] == true) && + + (a.t_nested.nt_scne.sc_nt == 144.0) && + + (a.t_nested.nt_scne.sc_mt2[0][0] == 22.0 ) && (a.t_nested.nt_scne.sc_mt2[0][1] == 23.0 ) && + + (a.t_nested.nt_scne.sc_mt2[1][0] == 24.0 ) && (a.t_nested.nt_scne.sc_mt2[1][1] == 25.0 ) && + + (a.t_nested.nt_scne.sc_vc4[0] == 57.0 ) && (a.t_nested.nt_scne.sc_vc4[1] == 58.0 ) && + + (a.t_nested.nt_scne.sc_vc4[2] == 59.0 ) && (a.t_nested.nt_scne.sc_vc4[3] == 60.0) && + + (a.t_2fl == 203.0) + ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert new file mode 100644 index 000000000..a84aeb9df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +#define ERROR_EPSILON 0.1 + +void main (void) +{ + struct second_nest + { + float sc_nt; + mat2 sc_mt2; + vec4 sc_vc4; + }; + + struct nest + { + ivec3 nt_ivc3; + bvec4 nt_bvc4; + second_nest nt_scne; + }; + + struct test_t + { + float t_fl; + vec2 t_vc2; + vec3 t_vc3; + mat4 t_mt4; + nest t_nested; + float t_2fl; + }; + + vec4 mt1 = vec4(31.0, 32.0, 33.0, 34.0); + vec4 mt2 = vec4(35.0, 36.0, 37.0, 38.0); + vec4 mt3 = vec4(39.0, 40.0, 41.0, 42.0); + vec4 mt4 = vec4(43.0, 44.0, 45.0, 46.0); + int i=0; + float sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0; + + test_t a = test_t(23.0, vec2(12.0, 13.0), + + vec3(163.0, 173.0, 183.0), + + mat4(mt1, mt2, mt3, mt4), + + nest( ivec3(73, 74, 75), + + bvec4(12, 0, 17.0, 193.0 ), + + second_nest(144.0, mat2(22.0, 23.0, 24.0, 25.0), vec4(57.0, 58.0, 59.0, 60.0 ) + ) + ), + + 203.0 + ); + + sum1 = a.t_mt4[0][0] + a.t_mt4[0][1] + a.t_mt4[0][2] + a.t_mt4[0][3]; + sum2 = a.t_mt4[1][0] + a.t_mt4[1][1] + a.t_mt4[1][2] + a.t_mt4[1][3]; + sum3 = a.t_mt4[2][0] + a.t_mt4[2][1] + a.t_mt4[2][2] + a.t_mt4[2][3]; + sum4 = a.t_mt4[3][0] + a.t_mt4[3][1] + a.t_mt4[3][2] + a.t_mt4[3][3]; + + float gray; + if( ( a.t_fl == 23.0 ) && + + (a.t_vc2[0] == 12.0) && (a.t_vc2[1] == 13.0) && + + (a.t_vc3[0] == 163.0) && (a.t_vc3[1] == 173.0) && (a.t_vc3[2] == 183.0) && + + (sum1 > 130.0-ERROR_EPSILON && sum1 < 130.0+ERROR_EPSILON ) && (sum2 > 146.0-ERROR_EPSILON && sum2 < 146.0+ERROR_EPSILON ) && (sum3 >162.0-ERROR_EPSILON && sum3 < 162.0+ERROR_EPSILON ) && (sum4 > 178.0-ERROR_EPSILON && sum4 < 178.0+ERROR_EPSILON ) && + (a.t_nested.nt_ivc3[0] == 73 ) && (a.t_nested.nt_ivc3[1] == 74 ) && (a.t_nested.nt_ivc3[2] == 75 ) && + + (a.t_nested.nt_bvc4[0] == true) && (a.t_nested.nt_bvc4[1] == false) && + + (a.t_nested.nt_bvc4[2] == true ) && (a.t_nested.nt_bvc4[0] == true) && + + (a.t_nested.nt_scne.sc_nt == 144.0) && + + (a.t_nested.nt_scne.sc_mt2[0][0] == 22.0 ) && (a.t_nested.nt_scne.sc_mt2[0][1] == 23.0 ) && + + (a.t_nested.nt_scne.sc_mt2[1][0] == 24.0 ) && (a.t_nested.nt_scne.sc_mt2[1][1] == 25.0 ) && + + (a.t_nested.nt_scne.sc_vc4[0] == 57.0 ) && (a.t_nested.nt_scne.sc_vc4[1] == 58.0 ) && + + (a.t_nested.nt_scne.sc_vc4[2] == 59.0 ) && (a.t_nested.nt_scne.sc_vc4[3] == 60.0) && + + (a.t_2fl == 203.0) + ) + gray=1.0; + else gray=0.0; + + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html new file mode 100644 index 000000000..9d5f6b2ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: struct_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html new file mode 100644 index 000000000..142b59ba1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: struct_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html new file mode 100644 index 000000000..d98f867a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: struct_017_to_024.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html new file mode 100644 index 000000000..32dc9d6dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: struct_025_to_032.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html new file mode 100644 index 000000000..37da12e7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: struct_033_to_040.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html new file mode 100644 index 000000000..540693a8b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: struct_041_to_048.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html new file mode 100644 index 000000000..1cccbeb67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: struct_049_to_056.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag new file mode 100644 index 000000000..2c0439b4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + bool a; + bool b; + bool c; + bool d; +}; + + + +void main (void) +{ + sabcd s = sabcd(bool(12), bool(0), bool(25.5), bool(0.0)); + float gray = 0.0; + if( (s.a==true) && (s.b==false) && (s.c == true) && (s.d==false)) + gray=1.0; + else + gray =0.0; + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert new file mode 100644 index 000000000..56aade4f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + bool a; + bool b; + bool c; + bool d; +}; + + + +void main (void) +{ + sabcd s = sabcd(bool(12), bool(0), bool(25.5), bool(0.0)); + float gray = 0.0; + if( (s.a==true) && (s.b==false) && (s.c == true) && (s.d==false)) + gray=1.0; + else + gray =0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag new file mode 100644 index 000000000..d819f7a61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + bvec2 a; + bvec3 b; + bvec4 c; +}; + +void main (void) +{ + sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) ); + float gray = 0.0; + if( (s.a[0]) && (s.a[1]) && (s.b[0]) && (!s.b[1]) && (s.b[2]) && (s.c[0]) && (s.c[1]) && (s.c[2]) ) + gray=1.0; + else + gray =0.0; + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert new file mode 100644 index 000000000..4509de1b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + bvec2 a; + bvec3 b; + bvec4 c; +}; + +void main (void) +{ + sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) ); + float gray = 0.0; + if( (s.a[0]) && (s.a[1]) && (s.b[0]) && (!s.b[1]) && (s.b[2]) && (s.c[0]) && (s.c[1]) && (s.c[2]) ) + gray=1.0; + else + gray =0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag new file mode 100644 index 000000000..57139805b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + float a; + float b; + float c; + float d; +}; + + + +void main (void) +{ + sabcd s = sabcd(1.0, 2.0, 4.0, 8.0); + gl_FragColor = vec4(vec3((s.a + s.b + s.c + s.d) / 15.0), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert new file mode 100644 index 000000000..2bb966bf2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + float a; + float b; + float c; + float d; +}; + + + +void main (void) +{ + sabcd s = sabcd(1.0, 2.0, 4.0, 8.0); + color = vec4(vec3((s.a + s.b + s.c + s.d) / 15.0), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag new file mode 100644 index 000000000..2859cb8d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + mat2 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) ); + gl_FragColor = vec4( vec3( (s.a[0][0] + s.a[0][1] + s.a[1][0] + s.a[1][1]) / 80.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert new file mode 100644 index 000000000..a4c7f6df3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + mat2 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) ); + color = vec4( vec3( (s.a[0][0] + s.a[0][1] + s.a[1][0] + s.a[1][1]) / 80.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag new file mode 100644 index 000000000..8fe6b3dbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + mat3 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) ); + float sum=0.0; + int i,j; + + sum = sum + s.a[0][0]; + sum = sum + s.a[0][1]; + sum = sum + s.a[0][2]; + sum = sum + s.a[1][0]; + sum = sum + s.a[1][1]; + sum = sum + s.a[1][2]; + sum = sum + s.a[2][0]; + sum = sum + s.a[2][1]; + sum = sum + s.a[2][2]; + + gl_FragColor = vec4( vec3( sum / 550.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert new file mode 100644 index 000000000..173085e2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert @@ -0,0 +1,54 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + mat3 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) ); + float sum=0.0; + + sum = sum + s.a[0][0]; + sum = sum + s.a[0][1]; + sum = sum + s.a[0][2]; + + sum = sum + s.a[1][0]; + sum = sum + s.a[1][1]; + sum = sum + s.a[1][2]; + + sum = sum + s.a[2][0]; + sum = sum + s.a[2][1]; + sum = sum + s.a[2][2]; + + color = vec4( vec3( sum / 550.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag new file mode 100644 index 000000000..5c7e0facf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + mat4 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0, + 71.0, 63.0, 90.0, 118.0, + 128.0, 44.0, 57.0, 143.0, + 151.0, 14.0, 15.0, 21.0 ) ); + float sum=0.0; + int i,j; + + sum = sum + s.a[0][0]; + sum = sum + s.a[0][1]; + sum = sum + s.a[0][2]; + sum = sum + s.a[0][3]; + sum = sum + s.a[1][0]; + sum = sum + s.a[1][1]; + sum = sum + s.a[1][2]; + sum = sum + s.a[1][3]; + sum = sum + s.a[2][0]; + sum = sum + s.a[2][1]; + sum = sum + s.a[2][2]; + sum = sum + s.a[2][3]; + sum = sum + s.a[3][0]; + sum = sum + s.a[3][1]; + sum = sum + s.a[3][2]; + sum = sum + s.a[3][3]; + + gl_FragColor = vec4( vec3( sum / 995.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert new file mode 100644 index 000000000..4fdfdc1d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + mat4 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0, + 71.0, 63.0, 90.0, 118.0, + 128.0, 44.0, 57.0, 143.0, + 151.0, 14.0, 15.0, 21.0 ) ); + float sum=0.0; + + sum = sum + s.a[0][0]; + sum = sum + s.a[0][1]; + sum = sum + s.a[0][2]; + sum = sum + s.a[0][3]; + + sum = sum + s.a[1][0]; + sum = sum + s.a[1][1]; + sum = sum + s.a[1][2]; + sum = sum + s.a[1][3]; + + sum = sum + s.a[2][0]; + sum = sum + s.a[2][1]; + sum = sum + s.a[2][2]; + sum = sum + s.a[2][3]; + + sum = sum + s.a[3][0]; + sum = sum + s.a[3][1]; + sum = sum + s.a[3][2]; + sum = sum + s.a[3][3]; + + color = vec4( vec3( sum / 995.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag new file mode 100644 index 000000000..fbb8d7d09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + vec2 a; + vec2 b; +}; + + +void main (void) +{ + sabcd s = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) ); + + gl_FragColor = vec4( vec3( (s.a[0] + s.a[1] + s.b[0] + s.b[1]) / 80.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert new file mode 100644 index 000000000..a3660fe24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + vec2 a; + vec2 b; +}; + + + +void main (void) +{ + sabcd s = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) ); + color = vec4( vec3( (s.a[0] + s.a[1] + s.b[0] + s.b[1]) / 80.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag new file mode 100644 index 000000000..ab0245620 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + vec3 a; + vec3 b; +}; + + +void main (void) +{ + sabcd s = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) ); + + gl_FragColor = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.b[0] + s.b[1] + s.b[2]) / 150.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert new file mode 100644 index 000000000..e532d3956 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + vec3 a; + vec3 b; +}; + + + +void main (void) +{ + sabcd s = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) ); + color = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.b[0] + s.b[1] + s.b[2]) / 150.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag new file mode 100644 index 000000000..85d19e8ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + vec4 a; + vec4 b; +}; + +void main (void) +{ + sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) ); + gl_FragColor = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.a[3] + s.b[0] + s.b[1] + s.b[2] + s.b[3]) / 250.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert new file mode 100644 index 000000000..f85a3ad87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + vec4 a; + vec4 b; +}; + +void main (void) +{ + sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) ); + color = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.a[3] + s.b[0] + s.b[1] + s.b[2] + s.b[3]) / 250.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag new file mode 100644 index 000000000..232ee1acb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + bool a; + bool b; + bool c; + bool d; +}; + + + +void main (void) +{ + sabcd s1 = sabcd(bool(12), bool(0), bool(25.5), bool(0.0)); + sabcd s2 = sabcd(bool(0.0), bool(0.0), bool(0.0), bool(0.0)); + s2 = s1; + float gray = 0.0; + if( (s2.a==true) && (s2.b==false) && (s2.c == true) && (s2.d==false)) + gray=1.0; + else + gray =0.0; + gl_FragColor = vec4(gray,gray,gray,1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert new file mode 100644 index 000000000..965778e40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert @@ -0,0 +1,55 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + bool a; + bool b; + bool c; + bool d; +}; + + + +void main (void) +{ + sabcd s1 = sabcd(bool(12), bool(0), bool(25.5), bool(0.0)); + sabcd s2 = sabcd(bool(0.0), bool(0.0), bool(0.0), bool(0.0)); + s2 = s1; + float gray = 0.0; + if( (s2.a==true) && (s2.b==false) && (s2.c == true) && (s2.d==false)) + gray=1.0; + else + gray =0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag new file mode 100644 index 000000000..c84b2453b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + bvec2 a; + bvec3 b; + bvec4 c; +}; + +void main (void) +{ + sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) ); + sabcd s2 = sabcd( bvec2(0, 0), bvec3(0.0, 0.0, 0.0), bvec4(0.0, 0.0, 0.0, 0.0 ) ); + s2 = s; + float gray = 0.0; + if( (s2.a[0]) && (s2.a[1]) && (s2.b[0]) && (!s2.b[1]) && (s2.b[2]) && (s2.c[0]) && (s2.c[1]) && (s2.c[2]) ) + gray=1.0; + else + gray =0.0; + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert new file mode 100644 index 000000000..43b2aeda4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + bvec2 a; + bvec3 b; + bvec4 c; +}; + +void main (void) +{ + sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) ); + sabcd s2 = sabcd( bvec2(0, 0), bvec3(0.0, 0.0, 0.0), bvec4(0.0, 0.0, 0.0, 0.0 ) ); + s2 = s; + float gray = 0.0; + if( (s2.a[0]) && (s2.a[1]) && (s2.b[0]) && (!s2.b[1]) && (s2.b[2]) && (s2.c[0]) && (s2.c[1]) && (s2.c[2]) && (s2.c[3]) ) + gray=1.0; + else + gray =0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag new file mode 100644 index 000000000..b685fa442 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + float a; + float b; + float c; + float d; +}; + + + +void main (void) +{ + sabcd s = sabcd(1.0, 2.0, 4.0, 8.0); + sabcd s2 = sabcd(0.0, 0.0, 0.0, 0.0); + s2 = s; + gl_FragColor = vec4((s.a + s.b + s.c + s.d) / 15.0, (s2.a + s2.b + s2.c + s2.d) / 15.0, 1.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert new file mode 100644 index 000000000..157e29221 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert @@ -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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + float a; + float b; + float c; + float d; +}; + + + +void main (void) +{ + sabcd s = sabcd(1.0, 2.0, 4.0, 8.0); + sabcd s2 = sabcd(0.0, 0.0, 0.0, 0.0); + s2 = s; + color = vec4((s.a + s.b + s.c + s.d) / 15.0, (s2.a + s2.b + s2.c + s2.d) / 15.0, 1.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag new file mode 100644 index 000000000..35f4a0ea3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + mat2 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) ); + sabcd s2 = sabcd(mat2(0.0, 0.0, 0.0, 0.0) ); + s2 = s; + gl_FragColor = vec4( vec3( (s2.a[0][0] + s2.a[0][1] + s2.a[1][0] + s2.a[1][1]) / 80.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert new file mode 100644 index 000000000..e880bbbf1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + mat2 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) ); + sabcd s2 = sabcd(mat2(0.0, 0.0, 0.0, 0.0) ); + s2 = s; + color = vec4( vec3( (s2.a[0][0] + s2.a[0][1] + s2.a[1][0] + s2.a[1][1]) / 80.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag new file mode 100644 index 000000000..6439b0180 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag @@ -0,0 +1,55 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + mat3 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) ); + sabcd s2 = sabcd(mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ); + s2 = s; + float sum=0.0; + int i,j; + + sum = sum + s2.a[0][0]; + sum = sum + s2.a[0][1]; + sum = sum + s2.a[0][2]; + sum = sum + s2.a[1][0]; + sum = sum + s2.a[1][1]; + sum = sum + s2.a[1][2]; + sum = sum + s2.a[2][0]; + sum = sum + s2.a[2][1]; + sum = sum + s2.a[2][2]; + + gl_FragColor = vec4( vec3( sum / 550.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert new file mode 100644 index 000000000..2a53277a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert @@ -0,0 +1,56 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + mat3 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) ); + sabcd s2 = sabcd(mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ); + s2 = s; + float sum=0.0; + + sum = sum + s2.a[0][0]; + sum = sum + s2.a[0][1]; + sum = sum + s2.a[0][2]; + + sum = sum + s2.a[1][0]; + sum = sum + s2.a[1][1]; + sum = sum + s2.a[1][2]; + + sum = sum + s2.a[2][0]; + sum = sum + s2.a[2][1]; + sum = sum + s2.a[2][2]; + + color = vec4( vec3( sum / 550.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag new file mode 100644 index 000000000..53deba872 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag @@ -0,0 +1,68 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + mat4 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0, + 71.0, 63.0, 90.0, 118.0, + 128.0, 44.0, 57.0, 143.0, + 151.0, 14.0, 15.0, 21.0 ) ); + sabcd s2 = sabcd(mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0 ) ); + s2 = s; + float sum=0.0; + int i,j; + + sum = sum + s2.a[0][0]; + sum = sum + s2.a[0][1]; + sum = sum + s2.a[0][2]; + sum = sum + s2.a[0][3]; + sum = sum + s2.a[1][0]; + sum = sum + s2.a[1][1]; + sum = sum + s2.a[1][2]; + sum = sum + s2.a[1][3]; + sum = sum + s2.a[2][0]; + sum = sum + s2.a[2][1]; + sum = sum + s2.a[2][2]; + sum = sum + s2.a[2][3]; + sum = sum + s2.a[3][0]; + sum = sum + s2.a[3][1]; + sum = sum + s2.a[3][2]; + sum = sum + s2.a[3][3]; + + gl_FragColor = vec4( vec3( sum / 995.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert new file mode 100644 index 000000000..3c3752795 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert @@ -0,0 +1,70 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + mat4 a; +}; + +void main (void) +{ + sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0, + 71.0, 63.0, 90.0, 118.0, + 128.0, 44.0, 57.0, 143.0, + 151.0, 14.0, 15.0, 21.0 ) ); + sabcd s2 = sabcd(mat4(0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0 ) ); + s2 = s; + float sum=0.0; + + sum = sum + s2.a[0][0]; + sum = sum + s2.a[0][1]; + sum = sum + s2.a[0][2]; + sum = sum + s2.a[0][3]; + + sum = sum + s2.a[1][0]; + sum = sum + s2.a[1][1]; + sum = sum + s2.a[1][2]; + sum = sum + s2.a[1][3]; + + sum = sum + s2.a[2][0]; + sum = sum + s2.a[2][1]; + sum = sum + s2.a[2][2]; + sum = sum + s2.a[2][3]; + + sum = sum + s2.a[3][0]; + sum = sum + s2.a[3][1]; + sum = sum + s2.a[3][2]; + sum = sum + s2.a[3][3]; + + color = vec4( vec3( sum / 995.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag new file mode 100644 index 000000000..56c15b6e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + vec2 a; + vec2 b; +}; + + +void main (void) +{ + sabcd s1 = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) ); + sabcd s2 = sabcd(vec2(0.0, 0.0), vec2(0.0, 0.0) ); + s2 = s1; + gl_FragColor = vec4( vec3( (s2.a[0] + s2.a[1] + s2.b[0] + s2.b[1]) / 80.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert new file mode 100644 index 000000000..1ec34123f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + vec2 a; + vec2 b; +}; + + + +void main (void) +{ + sabcd s1 = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) ); + sabcd s2 = sabcd(vec2(0.0, 0.0), vec2(0.0, 0.0) ); + s2 = s1; + color = vec4( vec3( (s2.a[0] + s2.a[1] + s2.b[0] + s2.b[1]) / 80.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag new file mode 100644 index 000000000..7d0530c81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct sabcd +{ + vec3 a; + vec3 b; +}; + + +void main (void) +{ + sabcd s = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) ); + sabcd s2 = sabcd(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0 ) ); + s2 = s; + gl_FragColor = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.b[0] + s2.b[1] + s2.b[2]) / 150.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert new file mode 100644 index 000000000..a686f9c6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + + + +struct sabcd +{ + vec3 a; + vec3 b; +}; + + + +void main (void) +{ + sabcd s1 = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) ); + sabcd s2 = sabcd(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0 ) ); + s2 = s1; + color = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.b[0] + s2.b[1] + s2.b[2]) / 150.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag new file mode 100644 index 000000000..e628b8caf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct sabcd +{ + vec4 a; + vec4 b; +}; + +void main (void) +{ + sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) ); + sabcd s2 = sabcd(vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0 ) ); + s2 = s; + gl_FragColor = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.a[3] + s2.b[0] + s2.b[1] + s2.b[2] + s2.b[3]) / 250.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert new file mode 100644 index 000000000..70f46538a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct sabcd +{ + vec4 a; + vec4 b; +}; + +void main (void) +{ + sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) ); + sabcd s2 = sabcd(vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0 ) ); + s2 = s; + color = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.a[3] + s2.b[0] + s2.b[1] + s2.b[2] + s2.b[3]) / 250.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag new file mode 100644 index 000000000..1d0abca41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag @@ -0,0 +1,55 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + bool b; +}; + +struct nesta +{ + bool a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(bool(1.0), nestb(bool(0.0)))); + float gray = 0.0; + + if( (s.nest_a.a == true) && (s.nest_a.nest_b.b == false)) + gray=1.0; + else + gray =0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert new file mode 100644 index 000000000..8a52a6ab1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert @@ -0,0 +1,58 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + bool b; +}; + +struct nesta +{ + bool a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(bool(1.0), nestb(bool(0.0)))); + float gray = 0.0; + + if( (s.nest_a.a == true) && (s.nest_a.nest_b.b == false)) + gray=1.0; + else + gray =0.0; + color = vec4(gray, gray, gray, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag new file mode 100644 index 000000000..d13d2bbb6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag @@ -0,0 +1,71 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +struct nestb +{ + bvec2 a2; + bvec3 b2; + bvec4 c2; +}; + +struct nesta +{ + bvec2 a1; + bvec3 b1; + bvec4 c1; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest( nesta( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ), + nestb( bvec2(28, 0), bvec3(0.0, 0.0, 1.0), bvec4(0.0, 17.0, 145, 0 ) + ) + ) + ); + float gray = 0.0; + if( ( s.nest_a.a1[0] ) && ( s.nest_a.a1[1] ) && + ( s.nest_a.b1[0] ) && (! (s.nest_a.b1[1]) ) && ( s.nest_a.b1[2] ) && + ( s.nest_a.c1[0] ) && ( s.nest_a.c1[1] ) && ( s.nest_a.c1[2] ) && ( s.nest_a.c1[3] ) && + ( s.nest_a.nest_b.a2[0] ) && ( !( s.nest_a.nest_b.a2[1] ) ) && + (! ( s.nest_a.nest_b.b2[0] ) ) && (! ( s.nest_a.nest_b.b2[1] ) ) && (s.nest_a.nest_b.b2[2]) && + (! ( s.nest_a.nest_b.c2[0] ) ) && (s.nest_a.nest_b.c2[1]) && (s.nest_a.nest_b.c2[2]) && (! ( s.nest_a.nest_b.c2[3] ) ) + ) + gray=1.0; + else + gray =0.0; + + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert new file mode 100644 index 000000000..dfc515cac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert @@ -0,0 +1,74 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + bvec2 a2; + bvec3 b2; + bvec4 c2; +}; + +struct nesta +{ + bvec2 a1; + bvec3 b1; + bvec4 c1; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + + nest s = nest( nesta( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ), + nestb( bvec2(28, 0), bvec3(0.0, 0.0, 1.0), bvec4(0.0, 17.0, 145, 0 ) + ) + ) + ); + + float gray = 0.0; + + if( ( s.nest_a.a1[0] ) && ( s.nest_a.a1[1] ) && + ( s.nest_a.b1[0] ) && (! (s.nest_a.b1[1]) ) && ( s.nest_a.b1[2] ) && + ( s.nest_a.c1[0] ) && ( s.nest_a.c1[1] ) && ( s.nest_a.c1[2] ) && ( s.nest_a.c1[3] ) && + ( s.nest_a.nest_b.a2[0] ) && ( !( s.nest_a.nest_b.a2[1] ) ) && + (! ( s.nest_a.nest_b.b2[0] ) ) && (! ( s.nest_a.nest_b.b2[1] ) ) && (s.nest_a.nest_b.b2[2]) && + (! ( s.nest_a.nest_b.c2[0] ) ) && (s.nest_a.nest_b.c2[1]) && (s.nest_a.nest_b.c2[2]) && (! ( s.nest_a.nest_b.c2[3] ) ) + ) + gray=1.0; + else + gray =0.0; + color = vec4(gray, gray, gray, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag new file mode 100644 index 000000000..8cb2e49b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + float b; +}; + +struct nesta +{ + float a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(1.0, nestb(2.0))); + gl_FragColor = vec4(vec3((s.nest_a.a + s.nest_a.nest_b.b) / 3.0), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert new file mode 100644 index 000000000..18b3353c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + float b; +}; + +struct nesta +{ + float a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(1.0, nestb(2.0))); + color = vec4(vec3((s.nest_a.a + s.nest_a.nest_b.b) / 3.0), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag new file mode 100644 index 000000000..d08a7b148 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + mat2 b; +}; + +struct nesta +{ + mat2 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta( mat2(11, 13, 29, 33), nestb( mat2(12, 19, 79, 81) ) ) ); + + + gl_FragColor = vec4( vec3( (s.nest_a.a[0][0] + s.nest_a.a[0][1] + s.nest_a.a[1][0] + s.nest_a.a[1][1] + s.nest_a.nest_b.b[0][0] + s.nest_a.nest_b.b[0][1] + s.nest_a.nest_b.b[1][0] + s.nest_a.nest_b.b[1][1] ) / 277.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert new file mode 100644 index 000000000..770b63d74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + mat2 b; +}; + +struct nesta +{ + mat2 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta( mat2(11, 13, 29, 33), nestb( mat2(12, 19, 79, 81) ) ) ); + color = vec4( vec3( (s.nest_a.a[0][0] + s.nest_a.a[0][1] + s.nest_a.a[1][0] + s.nest_a.a[1][1] + s.nest_a.nest_b.b[0][0] + s.nest_a.nest_b.b[0][1] + s.nest_a.nest_b.b[1][0] + s.nest_a.nest_b.b[1][1] ) / 277.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag new file mode 100644 index 000000000..3e01ed5b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag @@ -0,0 +1,79 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + mat3 b; +}; + +struct nesta +{ + mat3 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta( mat3(11, 13, 29, 33, 63, 13, 49, 57, 71), nestb( mat3(12, 19, 79, 81, 35, 51, 73, 66, 23) ) ) ); + float sum1=0.0,sum2=0.0; + int i,j; + + sum1 = sum1 + s.nest_a.a[0][0]; + sum2 = sum2 + s.nest_a.nest_b.b[0][0]; + + sum1 = sum1 + s.nest_a.a[0][1]; + sum2 = sum2 + s.nest_a.nest_b.b[0][1]; + + sum1 = sum1 + s.nest_a.a[0][2]; + sum2 = sum2 + s.nest_a.nest_b.b[0][2]; + + sum1 = sum1 + s.nest_a.a[1][0]; + sum2 = sum2 + s.nest_a.nest_b.b[1][0]; + + sum1 = sum1 + s.nest_a.a[1][1]; + sum2 = sum2 + s.nest_a.nest_b.b[1][1]; + + sum1 = sum1 + s.nest_a.a[1][2]; + sum2 = sum2 + s.nest_a.nest_b.b[1][2]; + + sum1 = sum1 + s.nest_a.a[2][0]; + sum2 = sum2 + s.nest_a.nest_b.b[2][0]; + + sum1 = sum1 + s.nest_a.a[2][1]; + sum2 = sum2 + s.nest_a.nest_b.b[2][1]; + + sum1 = sum1 + s.nest_a.a[2][2]; + sum2 = sum2 + s.nest_a.nest_b.b[2][2]; + + gl_FragColor = vec4( vec3( ( sum1 + sum2 )/ 778.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert new file mode 100644 index 000000000..0c63e231d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert @@ -0,0 +1,74 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + mat3 b; +}; + +struct nesta +{ + mat3 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta( mat3(11, 13, 29, 33, 63, 13, 49, 57, 71), nestb( mat3(12, 19, 79, 81, 35, 51, 73, 66, 23) ) ) ); + float sum1=0.0,sum2=0.0; + + sum1 = sum1 + s.nest_a.a[0][0]; + sum2 = sum2 + s.nest_a.nest_b.b[0][0]; + sum1 = sum1 + s.nest_a.a[0][1]; + sum2 = sum2 + s.nest_a.nest_b.b[0][1]; + sum1 = sum1 + s.nest_a.a[0][2]; + sum2 = sum2 + s.nest_a.nest_b.b[0][2]; + + sum1 = sum1 + s.nest_a.a[1][0]; + sum2 = sum2 + s.nest_a.nest_b.b[1][0]; + sum1 = sum1 + s.nest_a.a[1][1]; + sum2 = sum2 + s.nest_a.nest_b.b[1][1]; + sum1 = sum1 + s.nest_a.a[1][2]; + sum2 = sum2 + s.nest_a.nest_b.b[1][2]; + + sum1 = sum1 + s.nest_a.a[2][0]; + sum2 = sum2 + s.nest_a.nest_b.b[2][0]; + sum1 = sum1 + s.nest_a.a[2][1]; + sum2 = sum2 + s.nest_a.nest_b.b[2][1]; + sum1 = sum1 + s.nest_a.a[2][2]; + sum2 = sum2 + s.nest_a.nest_b.b[2][2]; + + color = vec4( vec3( ( sum1 + sum2 )/ 778.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag new file mode 100644 index 000000000..03fb03c18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag @@ -0,0 +1,100 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + mat4 b; +}; + +struct nesta +{ + mat4 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta( mat4(11, 13, 29, 33, 63, 13, 49, 57, 71, 47, 91, 101, 167, 21, 39, 41), nestb( mat4(12, 19, 79, 81, 35, 51, 73, 66, 23, 134, 121, 156, 76, 23, 24, 78) ) ) ); + float sum1=0.0,sum2=0.0; + int i,j; + + sum1 = sum1 + s.nest_a.a[0][0]; + sum2 = sum2 + s.nest_a.nest_b.b[0][0]; + + sum1 = sum1 + s.nest_a.a[0][1]; + sum2 = sum2 + s.nest_a.nest_b.b[0][1]; + + sum1 = sum1 + s.nest_a.a[0][2]; + sum2 = sum2 + s.nest_a.nest_b.b[0][2]; + + sum1 = sum1 + s.nest_a.a[0][3]; + sum2 = sum2 + s.nest_a.nest_b.b[0][3]; + + sum1 = sum1 + s.nest_a.a[1][0]; + sum2 = sum2 + s.nest_a.nest_b.b[1][0]; + + sum1 = sum1 + s.nest_a.a[1][1]; + sum2 = sum2 + s.nest_a.nest_b.b[1][1]; + + sum1 = sum1 + s.nest_a.a[1][2]; + sum2 = sum2 + s.nest_a.nest_b.b[1][2]; + + sum1 = sum1 + s.nest_a.a[1][3]; + sum2 = sum2 + s.nest_a.nest_b.b[1][3]; + + sum1 = sum1 + s.nest_a.a[2][0]; + sum2 = sum2 + s.nest_a.nest_b.b[2][0]; + + sum1 = sum1 + s.nest_a.a[2][1]; + sum2 = sum2 + s.nest_a.nest_b.b[2][1]; + + sum1 = sum1 + s.nest_a.a[2][2]; + sum2 = sum2 + s.nest_a.nest_b.b[2][2]; + + sum1 = sum1 + s.nest_a.a[2][3]; + sum2 = sum2 + s.nest_a.nest_b.b[2][3]; + + sum1 = sum1 + s.nest_a.a[3][0]; + sum2 = sum2 + s.nest_a.nest_b.b[3][0]; + + sum1 = sum1 + s.nest_a.a[3][1]; + sum2 = sum2 + s.nest_a.nest_b.b[3][1]; + + sum1 = sum1 + s.nest_a.a[3][2]; + sum2 = sum2 + s.nest_a.nest_b.b[3][2]; + + sum1 = sum1 + s.nest_a.a[3][3]; + sum2 = sum2 + s.nest_a.nest_b.b[3][3]; + + gl_FragColor = vec4( vec3( ( sum1 + sum2 )/ 1897.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert new file mode 100644 index 000000000..89ae396b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert @@ -0,0 +1,89 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + mat4 b; +}; + +struct nesta +{ + mat4 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta( mat4(11, 13, 29, 33, 63, 13, 49, 57, 71, 47, 91, 101, 167, 21, 39, 41), nestb( mat4(12, 19, 79, 81, 35, 51, 73, 66, 23, 134, 121, 156, 76, 23, 24, 78) ) ) ); + float sum1=0.0,sum2=0.0; + + sum1 = sum1 + s.nest_a.a[0][0]; + sum2 = sum2 + s.nest_a.nest_b.b[0][0]; + sum1 = sum1 + s.nest_a.a[0][1]; + sum2 = sum2 + s.nest_a.nest_b.b[0][1]; + sum1 = sum1 + s.nest_a.a[0][2]; + sum2 = sum2 + s.nest_a.nest_b.b[0][2]; + sum1 = sum1 + s.nest_a.a[0][3]; + sum2 = sum2 + s.nest_a.nest_b.b[0][3]; + + sum1 = sum1 + s.nest_a.a[1][0]; + sum2 = sum2 + s.nest_a.nest_b.b[1][0]; + sum1 = sum1 + s.nest_a.a[1][1]; + sum2 = sum2 + s.nest_a.nest_b.b[1][1]; + sum1 = sum1 + s.nest_a.a[1][2]; + sum2 = sum2 + s.nest_a.nest_b.b[1][2]; + sum1 = sum1 + s.nest_a.a[1][3]; + sum2 = sum2 + s.nest_a.nest_b.b[1][3]; + + sum1 = sum1 + s.nest_a.a[2][0]; + sum2 = sum2 + s.nest_a.nest_b.b[2][0]; + sum1 = sum1 + s.nest_a.a[2][1]; + sum2 = sum2 + s.nest_a.nest_b.b[2][1]; + sum1 = sum1 + s.nest_a.a[2][2]; + sum2 = sum2 + s.nest_a.nest_b.b[2][2]; + sum1 = sum1 + s.nest_a.a[2][3]; + sum2 = sum2 + s.nest_a.nest_b.b[2][3]; + + sum1 = sum1 + s.nest_a.a[3][0]; + sum2 = sum2 + s.nest_a.nest_b.b[3][0]; + sum1 = sum1 + s.nest_a.a[3][1]; + sum2 = sum2 + s.nest_a.nest_b.b[3][1]; + sum1 = sum1 + s.nest_a.a[3][2]; + sum2 = sum2 + s.nest_a.nest_b.b[3][2]; + sum1 = sum1 + s.nest_a.a[3][3]; + sum2 = sum2 + s.nest_a.nest_b.b[3][3]; + + color = vec4( vec3( ( sum1 + sum2 )/ 1897.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag new file mode 100644 index 000000000..feff010e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag @@ -0,0 +1,50 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + vec2 b; +}; + +struct nesta +{ + vec2 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(vec2(11, 13), nestb(vec2(12, 19) ) ) ); + + gl_FragColor = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] ) / 55.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert new file mode 100644 index 000000000..d9db7a357 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + vec2 b; +}; + +struct nesta +{ + vec2 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(vec2(11, 13), nestb(vec2(12, 19) ) ) ); + color = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] ) / 55.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag new file mode 100644 index 000000000..6f2308257 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + vec3 b; +}; + +struct nesta +{ + vec3 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(vec3(11, 13, 17), nestb(vec3(12, 19, 29) ) ) ); + gl_FragColor = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2]) / 101.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert new file mode 100644 index 000000000..b07d8f1fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + vec3 b; +}; + +struct nesta +{ + vec3 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(vec3(11, 13, 17), nestb(vec3(12, 19, 29) ) ) ); + color = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2]) / 101.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag new file mode 100644 index 000000000..0d365ea01 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +struct nestb +{ + vec4 b; +}; + +struct nesta +{ + vec4 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(vec4(11, 13, 17, 31), nestb(vec4(12, 19, 29, 69) ) ) ); + gl_FragColor = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.a[3] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2] + s.nest_a.nest_b.b[3]) / 201.0 ), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert new file mode 100644 index 000000000..7dae13b12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +struct nestb +{ + vec4 b; +}; + +struct nesta +{ + vec4 a; + nestb nest_b; +}; + +struct nest +{ + nesta nest_a; +}; + +void main (void) +{ + nest s = nest(nesta(vec4(11, 13, 17, 31), nestb(vec4(12, 19, 29, 69) ) ) ); + color = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.a[3] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2] + s.nest_a.nest_b.b[3]) / 201.0 ), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt new file mode 100644 index 000000000..11fe45566 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt @@ -0,0 +1,16 @@ +# this file is auto-generated. DO NOT EDIT. +swizzlers_001_to_008.html +swizzlers_009_to_016.html +swizzlers_017_to_024.html +swizzlers_025_to_032.html +swizzlers_033_to_040.html +swizzlers_041_to_048.html +swizzlers_049_to_056.html +swizzlers_057_to_064.html +swizzlers_065_to_072.html +swizzlers_073_to_080.html +swizzlers_081_to_088.html +swizzlers_089_to_096.html +swizzlers_097_to_104.html +swizzlers_105_to_112.html +swizzlers_113_to_120.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html new file mode 100644 index 000000000..3c8d92978 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html new file mode 100644 index 000000000..9f289b96f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html new file mode 100644 index 000000000..d0c52cbbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_017_to_024.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html new file mode 100644 index 000000000..72303e756 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_025_to_032.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html new file mode 100644 index 000000000..72b0922ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_033_to_040.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html new file mode 100644 index 000000000..3b892c86d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_041_to_048.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html new file mode 100644 index 000000000..ab4f08905 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_049_to_056.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html new file mode 100644 index 000000000..13d000734 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_057_to_064.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html new file mode 100644 index 000000000..8457ad3fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_065_to_072.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html new file mode 100644 index 000000000..61cee9f7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_073_to_080.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html new file mode 100644 index 000000000..7f4b36daf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_081_to_088.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html new file mode 100644 index 000000000..34d68854f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_089_to_096.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html new file mode 100644 index 000000000..61f08e380 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_097_to_104.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html new file mode 100644 index 000000000..59ac7f39c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_105_to_112.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html new file mode 100644 index 000000000..fa086c3ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html @@ -0,0 +1,155 @@ + + + + + +WebGL GLSL conformance test: swizzlers_113_to_120.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag new file mode 100644 index 000000000..ad4c25030 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + vec3 t = m.bgr; + vec4 a = vec4(t.b, t.g, t.r ,al.a); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert new file mode 100644 index 000000000..b4caea0ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + vec3 t = m.bgr; + vec4 a = vec4(t.b, t.g, t.r, lightloc.a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag new file mode 100644 index 000000000..6b878fddb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + float k = m.g; + vec2 n = m.br; + vec4 a = vec4(n.g, k, n.r, al.a); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert new file mode 100644 index 000000000..615ad13e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + vec2 t = m.br; + float k = m.g; + vec4 a = vec4(t.g, k, t.r, lightloc.a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag new file mode 100644 index 000000000..c0d2fb496 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + float k = m.r; + vec2 n = m.gb; + vec4 a = vec4(k, n.r, n.g, al.a); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert new file mode 100644 index 000000000..99ea09fc4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + vec2 t = m.gb; + float k = m.r; + vec4 a = vec4(k, t.r, t.g, lightloc.a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag new file mode 100644 index 000000000..d0fd4432f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + vec3 t = m.grb; + vec4 a = vec4(t.g, t.r, t.b ,al.a); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert new file mode 100644 index 000000000..1b87fd842 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + vec3 t = m.grb; + vec4 a = vec4(t.g, t.r, t.b, lightloc.a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag new file mode 100644 index 000000000..b1af38f61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + float k = m.t; + vec2 n = m.ps; + vec4 a = vec4(n.t, k, n.s, al.q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert new file mode 100644 index 000000000..9ad785eda --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + vec2 t = m.ps; + float k = m.t; + vec4 a = vec4(t.t, k, t.s, lightloc.q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag new file mode 100644 index 000000000..e32c444ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + vec3 t = m.pts; + vec4 a = vec4(t.p, t.t, t.s ,al.q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert new file mode 100644 index 000000000..56dd2a5fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + vec3 t = m.pts; + vec4 a = vec4(t.p, t.t, t.s, lightloc.q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag new file mode 100644 index 000000000..f3a5db36f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + float k = m.g; + vec2 n = m.rb; + vec4 a = vec4(n.r, k, n.g, al.a); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert new file mode 100644 index 000000000..eba6b3337 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + vec2 t = m.rb; + float k = m.g; + vec4 a = vec4(t.r, k, t.g, lightloc.a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag new file mode 100644 index 000000000..a7765ae52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + float k = m.b; + vec2 n = m.rg; + vec4 a = vec4(n, k, al.a); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert new file mode 100644 index 000000000..ff44c4bd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + vec2 t = m.rg; + float k = m.b; + vec4 a = vec4(t, k, lightloc.a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag new file mode 100644 index 000000000..16ca1bf55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + vec4 a = vec4(m.rgb,al.a); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert new file mode 100644 index 000000000..3cbb049d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + vec4 a = vec4(m.rgb,lightloc.a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag new file mode 100644 index 000000000..1246e9f9a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + float k = m.t; + vec2 n = m.sp; + vec4 a = vec4(n.s, k, n.t, al.q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert new file mode 100644 index 000000000..4f3327c74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + vec2 t = m.sp; + float k = m.t; + vec4 a = vec4(t.s, k, t.t, lightloc.q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag new file mode 100644 index 000000000..73a9a27c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + float k = m.p; + vec2 n = m.st; + vec4 a = vec4(n, k, al.q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert new file mode 100644 index 000000000..240354816 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + vec2 t = m.st; + float k = m.p; + vec4 a = vec4(t, k, lightloc.q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag new file mode 100644 index 000000000..6a96f44ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + vec4 a = vec4(m.stp,al.q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert new file mode 100644 index 000000000..985e8f298 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + vec4 a = vec4(m.stp,lightloc.q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag new file mode 100644 index 000000000..86912c022 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + float k = m.s; + vec2 n = m.tp; + vec4 a = vec4(k, n.s, n.t, al.q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert new file mode 100644 index 000000000..c6f48a25f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + vec2 t = m.tp; + float k = m.s; + vec4 a = vec4(k, t.s, t.t, lightloc.q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag new file mode 100644 index 000000000..672cfa939 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + vec3 t = m.tsp; + vec4 a = vec4(t.t, t.s, t.p ,al.q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert new file mode 100644 index 000000000..0a031f395 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + vec3 t = m.tsp; + vec4 a = vec4(t.t, t.s, t.p, lightloc.q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag new file mode 100644 index 000000000..ac820d265 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + float k = m.z; + vec2 n = m.xy; + vec4 a = vec4(n, k, al.w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert new file mode 100644 index 000000000..03451256c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + vec2 t = m.xy; + float k = m.z; + vec4 a = vec4(t, k, lightloc.w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag new file mode 100644 index 000000000..011e0572e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + vec4 a = vec4(m.xyz,al.w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert new file mode 100644 index 000000000..ab46b50ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + vec4 a = vec4(m.xyz,lightloc.w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag new file mode 100644 index 000000000..58b59deca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + float k = m.y; + vec2 n = m.xz; + vec4 a = vec4(n.x, k, n.y, al.w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert new file mode 100644 index 000000000..d747725f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + vec2 t = m.xz; + float k = m.y; + vec4 a = vec4(t.x, k, t.y, lightloc.w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag new file mode 100644 index 000000000..2141bf300 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + vec3 t = m.yxz; + vec4 a = vec4(t.y, t.x, t.z ,al.w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert new file mode 100644 index 000000000..ebe9e6e63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + vec3 t = m.yxz; + vec4 a = vec4(t.y, t.x, t.z, lightloc.w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag new file mode 100644 index 000000000..92a8bd4fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + float k = m.x; + vec2 n = m.yz; + vec4 a = vec4(k, n.x, n.y, al.w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert new file mode 100644 index 000000000..4e43c5be2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + vec2 t = m.yz; + float k = m.x; + vec4 a = vec4(k, t.x, t.y, lightloc.w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag new file mode 100644 index 000000000..f3ff82389 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + float k = m.y; + vec2 n = m.zx; + vec4 a = vec4(n.y, k, n.x, al.w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert new file mode 100644 index 000000000..121ca1f67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + vec2 t = m.zx; + float k = m.y; + vec4 a = vec4(t.y, k, t.x, lightloc.w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag new file mode 100644 index 000000000..e36795592 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + vec3 t = m.zyx; + vec4 a = vec4(t.z, t.y, t.x ,al.w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert new file mode 100644 index 000000000..aa1f2e2d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + vec3 t = m.zyx; + vec4 a = vec4(t.z, t.y, t.x, lightloc.w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag new file mode 100644 index 000000000..9588e4020 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.ar; + vec2 n = al.bg; + vec4 a = vec4(m.g, n.g, n.r, m.r); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert new file mode 100644 index 000000000..4994e1093 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.ar; + vec2 n = lightloc.bg; + vec4 a = vec4(m.g, n.g, n.r, m.r); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag new file mode 100644 index 000000000..c3b91a5f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.arb; + float g = al.g; + vec4 a = vec4(m.g, g, m.b, m.r); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert new file mode 100644 index 000000000..fe1e74fed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.arb; + float g = lightloc.g; + vec4 a = vec4(m.g, g, m.b, m.r); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag new file mode 100644 index 000000000..0f78a8884 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.arbg; + vec4 a = vec4(m.g, m.a, m.b, m.r); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert new file mode 100644 index 000000000..e384b19ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.arbg; + vec4 a = vec4(m.g, m.a, m.b, m.r); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag new file mode 100644 index 000000000..0111f494e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.bar; + float g = al.g; + vec4 a = vec4(m.b, g, m.r, m.g); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert new file mode 100644 index 000000000..ab8b2b2dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.bar; + float g = lightloc.g; + vec4 a = vec4(m.b, g, m.r, m.g); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag new file mode 100644 index 000000000..2569183a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.barg; + vec4 a = vec4(m.b, m.a, m.r, m.g); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert new file mode 100644 index 000000000..2142720d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.barg; + vec4 a = vec4(m.b, m.a, m.r, m.g); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag new file mode 100644 index 000000000..ab9e05c0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.br; + vec2 n = al.ag; + vec4 a = vec4(m.g, n.g, m.r, n.r); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert new file mode 100644 index 000000000..c181e0c0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.br; + vec2 n = lightloc.ag; + vec4 a = vec4(m.g, n.g, m.r, n.r); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag new file mode 100644 index 000000000..b1462af6e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.gr; + vec2 n = al.ab; + vec4 a = vec4(m.g, m.r, n.g, n.r); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert new file mode 100644 index 000000000..bb3993f1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.gr; + vec2 n = lightloc.ab; + vec4 a = vec4(m.g, m.r, n.g, n.r); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag new file mode 100644 index 000000000..3388c78fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.gra; + float b = al.b; + vec4 a = vec4(m.g, m.r, b, m.b); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert new file mode 100644 index 000000000..1ec63ed75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.gra; + float b = lightloc.b; + vec4 a = vec4(m.g, m.r, b, m.b); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag new file mode 100644 index 000000000..f8d4f33c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.grab; + vec4 a = vec4(m.g, m.r, m.a, m.b); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert new file mode 100644 index 000000000..85f8d0c75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.grab; + vec4 a = vec4(m.g, m.r, m.a, m.b); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag new file mode 100644 index 000000000..84fe428ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.pqs; + float t = al.t; + vec4 a = vec4(m.p, t, m.s, m.t); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert new file mode 100644 index 000000000..1fa79b24b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.pqs; + float t = lightloc.t; + vec4 a = vec4(m.p, t, m.s, m.t); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag new file mode 100644 index 000000000..04cdf3536 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.pqst; + vec4 a = vec4(m.p, m.q, m.s, m.t); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert new file mode 100644 index 000000000..1a4d502a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.pqst; + vec4 a = vec4(m.p, m.q, m.s, m.t); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag new file mode 100644 index 000000000..2f932a49a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.ps; + vec2 n = al.qt; + vec4 a = vec4(m.t, n.t, m.s, n.s); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert new file mode 100644 index 000000000..7b6f4394d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.ps; + vec2 n = lightloc.qt; + vec4 a = vec4(m.t, n.t, m.s, n.s); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag new file mode 100644 index 000000000..e5d725eec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.qs; + vec2 n = al.pt; + vec4 a = vec4(m.t, n.t, n.s, m.s); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert new file mode 100644 index 000000000..0f36642ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.qs; + vec2 n = lightloc.pt; + vec4 a = vec4(m.t, n.t, n.s, m.s); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag new file mode 100644 index 000000000..8649155b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.qsp; + float t = al.t; + vec4 a = vec4(m.t, t, m.p, m.s); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert new file mode 100644 index 000000000..cdf2a3934 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.qsp; + float t = lightloc.t; + vec4 a = vec4(m.t, t, m.p, m.s); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag new file mode 100644 index 000000000..7c7ab1ca3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.qspt; + vec4 a = vec4(m.t, m.q, m.p, m.s); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert new file mode 100644 index 000000000..dec21c445 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.qspt; + vec4 a = vec4(m.t, m.q, m.p, m.s); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag new file mode 100644 index 000000000..1f6ba05db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + float r = al.r; + float g = al.g; + float b = al.b; + float a = al.a; + vec4 m = vec4(r,g,b,a); + gl_FragColor = m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert new file mode 100644 index 000000000..bd69ccbe2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + float r = lightloc.r; + float g = lightloc.g; + float b = lightloc.b; + float a = lightloc.a; + vec4 m = vec4(r, g, b, a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag new file mode 100644 index 000000000..7483c92f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.rg; + vec2 n = al.ba; + vec4 a = vec4(m,n); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert new file mode 100644 index 000000000..1b1fa0e25 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.rg; + vec2 n = lightloc.ba; + vec4 a = vec4(m,n); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag new file mode 100644 index 000000000..91f88ab55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.rgb; + float a = al.a; + vec4 b = vec4(m, a); + gl_FragColor = b; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert new file mode 100644 index 000000000..68e1a75b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.rgb; + float a = lightloc.a; + vec4 b = vec4(m, a); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * b; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag new file mode 100644 index 000000000..a470f51cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.rgba; + gl_FragColor = m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert new file mode 100644 index 000000000..adf605add --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.rgba; + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag new file mode 100644 index 000000000..b848511c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + float s = al.s; + float t = al.t; + float p = al.p; + float q = al.q; + vec4 m = vec4(s,t,p,q); + gl_FragColor = m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert new file mode 100644 index 000000000..689d7d5e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + float s = lightloc.s; + float t = lightloc.t; + float p = lightloc.p; + float q = lightloc.q; + vec4 m = vec4(s, t, p, q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag new file mode 100644 index 000000000..5d600a2cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.st; + vec2 n = al.pq; + vec4 a = vec4(m,n); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert new file mode 100644 index 000000000..9c57a8d5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.st; + vec2 n = lightloc.pq; + vec4 a = vec4(m,n); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag new file mode 100644 index 000000000..c709061a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.stp; + float q = al.q; + vec4 a = vec4(m, q); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert new file mode 100644 index 000000000..93316f4eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.stp; + float q = lightloc.q; + vec4 a = vec4(m, q); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag new file mode 100644 index 000000000..c97bf2207 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.stpq; + gl_FragColor = m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert new file mode 100644 index 000000000..e84962163 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.stpq; + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag new file mode 100644 index 000000000..45b472c10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.ts; + vec2 n = al.qp; + vec4 a = vec4(m.t, m.s, n.t, n.s); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert new file mode 100644 index 000000000..d433805fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.ts; + vec2 n = lightloc.qp; + vec4 a = vec4(m.t, m.s, n.t, n.s); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag new file mode 100644 index 000000000..b78c8e49e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.tsq; + float p = al.p; + vec4 a = vec4(m.t, m.s, p, m.p); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert new file mode 100644 index 000000000..c30c6aa95 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.tsq; + float p = lightloc.p; + vec4 a = vec4(m.t, m.s, p, m.p); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag new file mode 100644 index 000000000..cad5fab2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.tsqp; + vec4 a = vec4(m.t, m.s, m.q, m.p); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert new file mode 100644 index 000000000..7296ff0ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.tsqp; + vec4 a = vec4(m.t, m.s, m.q, m.p); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag new file mode 100644 index 000000000..2c23493b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.wx; + vec2 n = al.zy; + vec4 a = vec4(m.y, n.y, n.x, m.x); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert new file mode 100644 index 000000000..dd3af2d9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.wx; + vec2 n = lightloc.zy; + vec4 a = vec4(m.y, n.y, n.x, m.x); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag new file mode 100644 index 000000000..d0856d99a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.wxz; + float y = al.y; + vec4 a = vec4(m.y, y, m.z, m.x); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert new file mode 100644 index 000000000..3229f29aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.wxz; + float y = lightloc.y; + vec4 a = vec4(m.y, y, m.z, m.x); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag new file mode 100644 index 000000000..500a03fcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.wxzy; + vec4 a = vec4(m.y, m.w, m.z, m.x); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert new file mode 100644 index 000000000..147c13482 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.wxzy; + vec4 a = vec4(m.y, m.w, m.z, m.x); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag new file mode 100644 index 000000000..8b807bfd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + float x = al.x; + float y = al.y; + float z = al.z; + float w = al.w; + vec4 m = vec4(x,y,z,w); + gl_FragColor = m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert new file mode 100644 index 000000000..1b70abe6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + float x = lightloc.x; + float y = lightloc.y; + float z = lightloc.z; + float w = lightloc.w; + vec4 m = vec4(x, y, z, w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag new file mode 100644 index 000000000..89e6c8d0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.xy; + vec2 n = al.zw; + vec4 a = vec4(m,n); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert new file mode 100644 index 000000000..b0b7c276c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.xy; + vec2 n = lightloc.zw; + vec4 a = vec4(m,n); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag new file mode 100644 index 000000000..37be342cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.xyz; + float w = al.w; + vec4 a = vec4(m, w); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert new file mode 100644 index 000000000..8ae968d18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.xyz; + float w = lightloc.w; + vec4 a = vec4(m, w); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag new file mode 100644 index 000000000..4fc638f24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.xyzw; + gl_FragColor = m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert new file mode 100644 index 000000000..71b245113 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.xyzw; + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * m; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag new file mode 100644 index 000000000..403a9110a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.yx; + vec2 n = al.wz; + vec4 a = vec4(m.y, m.x, n.y, n.x); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert new file mode 100644 index 000000000..0d05df101 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.yx; + vec2 n = lightloc.wz; + vec4 a = vec4(m.y, m.x, n.y, n.x); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag new file mode 100644 index 000000000..07757ff1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.yxw; + float z = al.z; + vec4 a = vec4(m.y, m.x, z, m.z); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert new file mode 100644 index 000000000..00f5f2e7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.yxw; + float z = lightloc.z; + vec4 a = vec4(m.y, m.x, z, m.z); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag new file mode 100644 index 000000000..9e49edde7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.yxwz; + vec4 a = vec4(m.y, m.x, m.w, m.z); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert new file mode 100644 index 000000000..99bf91c1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.yxwz; + vec4 a = vec4(m.y, m.x, m.w, m.z); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag new file mode 100644 index 000000000..d67d7b138 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec3 m = al.zwx; + float y = al.y; + vec4 a = vec4(m.z, y, m.x, m.y); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert new file mode 100644 index 000000000..9bb3028eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec3 m = lightloc.zwx; + float y = lightloc.y; + vec4 a = vec4(m.z, y, m.x, m.y); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag new file mode 100644 index 000000000..6af3719cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec4 m = al.zwxy; + vec4 a = vec4(m.z, m.w, m.x, m.y); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert new file mode 100644 index 000000000..106077653 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec4 m = lightloc.zwxy; + vec4 a = vec4(m.z, m.w, m.x, m.y); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag new file mode 100644 index 000000000..059d5dcd0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; +void main (void) +{ + vec4 al = color; + vec2 m = al.zx; + vec2 n = al.wy; + vec4 a = vec4(m.y, n.y, m.x, n.x); + gl_FragColor = a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert new file mode 100644 index 000000000..ff8513507 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 lightloc = gtf_Vertex; + vec2 m = lightloc.zx; + vec2 n = lightloc.wy; + vec4 a = vec4(m.y, n.y, m.x, n.x); + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * a; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt new file mode 100644 index 000000000..443a00f70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +tan_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html new file mode 100644 index 000000000..fed7be01f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html @@ -0,0 +1,129 @@ + + + + + +WebGL GLSL conformance test: tan_001_to_006.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag new file mode 100644 index 000000000..f5c02d045 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 0.5 * M_PI * 2.0 * (color.r - 0.5); + float o; + + if(abs(c) < 0.5) // -45..45 + o = 0.5 * tan(c) + 0.5; + else // 45..90, -45..-90 + o = 0.5 / tan(c) + 0.5; + gl_FragColor = vec4(o, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag new file mode 100644 index 000000000..65a820e13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 0.5 * M_PI * 2.0 * (color.r - 0.5); + float o; + if(abs(c) < 0.5) // -45..45 + o = 0.5 * (sin(c) / cos(c)) + 0.5; + else // 45..90, -45..-90 + o = 0.5 * (cos(c) / sin(c)) + 0.5; + gl_FragColor = vec4(o, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert new file mode 100644 index 000000000..501b5725f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 0.5 * M_PI * 2.0 * (gtf_Color.r - 0.5); + float o; + + if(abs(c) < 0.5) // -45..45 + o = 0.5 * tan(c) + 0.5; + else // 45..90, -45..-90 + o = 0.5 / tan(c) + 0.5; + color = vec4(o, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert new file mode 100644 index 000000000..97cd3cca2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float c = 0.5 * M_PI * 2.0 * (gtf_Color.r - 0.5); + float o; + if(abs(c) < 0.5) // -45..45 + o = 0.5 * (sin(c) / cos(c)) + 0.5; + else // 45..90, -45..-90 + o = 0.5 * (cos(c) / sin(c)) + 0.5; + color = vec4(o, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag new file mode 100644 index 000000000..759e622e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 0.5 * M_PI * 2.0 * (color.rg - 0.5); + vec2 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * tan(c.r) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 / tan(c.r) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * tan(c.g) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 / tan(c.g) + 0.5; + + gl_FragColor = vec4(o, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag new file mode 100644 index 000000000..0b427094b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 0.5 * M_PI * 2.0 * (color.rg - 0.5); + vec2 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5; + + gl_FragColor = vec4(o, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert new file mode 100644 index 000000000..9bb1d5b0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 0.5 * M_PI * 2.0 * (gtf_Color.rg - 0.5); + vec2 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * tan(c.r) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 / tan(c.r) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * tan(c.g) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 / tan(c.g) + 0.5; + + color = vec4(o, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert new file mode 100644 index 000000000..fdd63bc2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert @@ -0,0 +1,48 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec2 c = 0.5 * M_PI * 2.0 * (gtf_Color.rg - 0.5); + vec2 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5; + + color = vec4(o, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag new file mode 100644 index 000000000..5e442b591 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 0.5 * M_PI * 2.0 * (color.rgb - 0.5); + vec3 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * tan(c.r) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 / tan(c.r) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * tan(c.g) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 / tan(c.g) + 0.5; + + if(abs(c.b) < 0.5) // -45..45 + o.b = 0.5 * tan(c.b) + 0.5; + else // 45..90, -45..-90 + o.b = 0.5 / tan(c.b) + 0.5; + + gl_FragColor = vec4(o, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag new file mode 100644 index 000000000..09d152b25 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 0.5 * M_PI * 2.0 * (color.rgb - 0.5); + vec3 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5; + + if(abs(c.b) < 0.5) // -45..45 + o.b = 0.5 * (sin(c.b) / cos(c.b)) + 0.5; + else // 45..90, -45..-90 + o.b = 0.5 * (cos(c.b) / sin(c.b)) + 0.5; + + gl_FragColor = vec4(o, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert new file mode 100644 index 000000000..66929bae6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 0.5 * M_PI * 2.0 * (gtf_Color.rgb - 0.5); + vec3 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * tan(c.r) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 / tan(c.r) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * tan(c.g) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 / tan(c.g) + 0.5; + + if(abs(c.b) < 0.5) // -45..45 + o.b = 0.5 * tan(c.b) + 0.5; + else // 45..90, -45..-90 + o.b = 0.5 / tan(c.b) + 0.5; + + color = vec4(o, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert new file mode 100644 index 000000000..fd99616ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert @@ -0,0 +1,53 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + vec3 c = 0.5 * M_PI * 2.0 * (gtf_Color.rgb - 0.5); + vec3 o; + if(abs(c.r) < 0.5) // -45..45 + o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5; + else // 45..90, -45..-90 + o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5; + + if(abs(c.g) < 0.5) // -45..45 + o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5; + else // 45..90, -45..-90 + o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5; + + if(abs(c.b) < 0.5) // -45..45 + o.b = 0.5 * (sin(c.b) / cos(c.b)) + 0.5; + else // 45..90, -45..-90 + o.b = 0.5 * (cos(c.b) / sin(c.b)) + 0.5; + + color = vec4(o, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag new file mode 100644 index 000000000..91f6ba069 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + bvec4 a = bvec4(0, 23, 0.0, 23.0); + float gray; + if( (a[0] == false) && (a[1] == true) && (a[2] == false) && (a[3] == true) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert new file mode 100644 index 000000000..9a672e0ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + bvec4 a = bvec4(0, 23, 0.0, 23.0); + float gray; + if( (a[0] == false) && (a[1] == true) && (a[2] == false) && (a[3] == true) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt new file mode 100644 index 000000000..e5ba07f12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt @@ -0,0 +1,4 @@ +# this file is auto-generated. DO NOT EDIT. +vec_001_to_008.html +vec_009_to_016.html +vec_017_to_018.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag new file mode 100644 index 000000000..a603bad89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + ivec3 a = ivec3(20, 13, 17); + float gray; + if( (a[0] == 20) && (a[1] == 13) && (a[2] == 17) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert new file mode 100644 index 000000000..81d0b3701 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + ivec3 a = ivec3(20, 13, 17); + float gray; + if( (a[0] == 20) && (a[1] == 13) && (a[2] == 17) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag new file mode 100644 index 000000000..d2b17980a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 a = vec2(13.0,53.0); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert new file mode 100644 index 000000000..0a1854c81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 a = vec2(13.0,53.0); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag new file mode 100644 index 000000000..6dae4e49b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 b = vec3(13.0, 53.0, 139.0); + vec2 a = vec2(b); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert new file mode 100644 index 000000000..b0be5bb6f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 b = vec3(13.0, 53.0, 139.0); + vec2 a = vec2(b); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag new file mode 100644 index 000000000..50f3b951b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 b = vec2(53.0, 139.0); + vec3 a = vec3(13.0, b); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert new file mode 100644 index 000000000..cb6dbca18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 b = vec2(53.0, 139.0); + vec3 a = vec3(13.0, b); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag new file mode 100644 index 000000000..d093aa29f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec2 b = vec2(13.0, 53.0); + vec3 a = vec3(b, 139.0); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert new file mode 100644 index 000000000..21da10689 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec2 b = vec2(13.0, 53.0); + vec3 a = vec3(b,139.0); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag new file mode 100644 index 000000000..b0c8e3b6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec4 b = vec4(13.0, 53.0, 139.0, 217.0); + vec3 a = vec3(b); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert new file mode 100644 index 000000000..60e3e4d79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec4 b = vec4(13.0, 53.0, 139.0, 217.0); + vec3 a = vec3(b); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag new file mode 100644 index 000000000..15ce47066 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + ivec4 init = ivec4(2,3,5,9); + vec4 a = vec4(init); + float gray; + if( (a[0] == 2.0) && (a[1] == 3.0) && (a[2] == 5.0) && (a[3] == 9.0) ) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert new file mode 100644 index 000000000..510fd123a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + ivec4 init = ivec4(2,3,5,9); + vec4 a = vec4(init); + float gray; + if( (a[0] == 2.0) && (a[1] == 3.0) && (a[2] == 5.0) && (a[3] == 9.0) ) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag new file mode 100644 index 000000000..6e330f797 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + vec3 b = vec3(13.0, 53.0, 139.0); + vec4 a = vec4(b, 217.0); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) && (a[3] == 217.0)) + gray=1.0; + else gray=0.0; + gl_FragColor = vec4(gray, gray, gray, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert new file mode 100644 index 000000000..3ad46ce59 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + vec3 b = vec3(13.0, 53.0, 139.0); + vec4 a = vec4(b, 217.0); + float gray; + if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) && (a[3] == 217.0)) + gray=1.0; + else gray=0.0; + color = vec4(gray, gray, gray, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html new file mode 100644 index 000000000..c29313166 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: vec_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html new file mode 100644 index 000000000..c771bfc7a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html @@ -0,0 +1,251 @@ + + + + + +WebGL GLSL conformance test: vec_009_to_016.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html new file mode 100644 index 000000000..9822fedb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html @@ -0,0 +1,101 @@ + + + + + +WebGL GLSL conformance test: vec_017_to_018.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt new file mode 100644 index 000000000..1d1f9189d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +vec3_001_to_008.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html new file mode 100644 index 000000000..26281f151 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html @@ -0,0 +1,333 @@ + + + + + +WebGL GLSL conformance test: vec3_001_to_008.html + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag new file mode 100644 index 000000000..80bd50878 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3array_frag.frag: Simple Fragment shader using vec3 to get colors. +// +// + +varying vec4 color; + +uniform vec3 lightPosition[2]; + +void main(void) +{ + vec3 v[2]; + + v[1] = vec3(color.r, color.g, color.b); + + + v[0] = lightPosition[1]; + + + gl_FragColor = vec4(v[1] + v[1], 0.0)/2.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert new file mode 100644 index 000000000..c0852715a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert @@ -0,0 +1,47 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3array_vert.vert: Simple vertex shader using vec3 to get colors. +// +// + +varying vec4 color; +uniform vec3 lightPosition[2]; + +void main(void) +{ + vec3 v[2]; + + v[1] = vec3(gtf_Color.r, gtf_Color.g, gtf_Color.b); + + v[0] = lightPosition[1]; + + color = vec4(v[1] + v[1], 0.0)/2.0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag new file mode 100644 index 000000000..0f3972477 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3arraydirect_frag.frag: Fragment shader solid color +// +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + gl_FragColor = vec4(lightPosition[0] + lightPosition[1], 0.0) * 0.5; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert new file mode 100644 index 000000000..05aa58d5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3arraydirect_vert.vert: Vertex shader solid color +// +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + + color = vec4(lightPosition[0] + lightPosition[1], 0.0) * 0.5; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag new file mode 100644 index 000000000..7e6e26e49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag @@ -0,0 +1,55 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3arrayindirect_frag.frag: Fragment shader solid color +// The vec3 values are determined at runtime. +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + int i; + + gl_FragColor = vec4(0.0); + + /* + // No indirect indexing in fragment shaders + for (i = 0; i < 2; i++) + { + gl_FragColor += vec4(lightPosition[i], 0.0); + } + */ + gl_FragColor += vec4(lightPosition[0], 0.0); + gl_FragColor += vec4(lightPosition[1], 0.0); + + gl_FragColor /= 2.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert new file mode 100644 index 000000000..671ecb6c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert @@ -0,0 +1,51 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3arrayindirect_vert.vert: Vertex shader solid color +// The vec3 values are determined at runtime. +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + color = vec4(0.0); + + for (int i = 0; i < 2; i++) + { + color += vec4(lightPosition[i], 0.0); + } + + color /= 2.0; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag new file mode 100644 index 000000000..5ec7bd239 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3Matrix_frag.frag: Fragment shader solid color +// +// +// + +uniform vec3 lightPosition; +varying vec4 color; + +void main(void) +{ + gl_FragColor = vec4(lightPosition, 0.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert new file mode 100644 index 000000000..3affb3095 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert @@ -0,0 +1,45 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3Matrix_vert.vert: Vertex shader solid color +// +// +// + +uniform vec3 lightPosition; +varying vec4 color; + +void main(void) +{ + + color = vec4(lightPosition, 0.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag new file mode 100644 index 000000000..dc65a5a71 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + gl_FragColor = color * texture2D(gtf_Texture0, gtf_TexCoord[0].xy); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert new file mode 100644 index 000000000..16a2c2a72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 gtf_TexCoord[1]; +attribute vec4 gtf_MultiTexCoord0; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag new file mode 100644 index 000000000..e605bf758 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag @@ -0,0 +1,68 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + +// This fragment shader computes an image representation of the derivative of +// sine. The derivative of sine is cosine. This shader's output is compared to +// the reference shader that computes an image representation of cosine +// directly. + +uniform float viewportwidth; +uniform float viewportheight; + +varying vec2 vertXY; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float sine; + float cosine; + +#ifdef GL_OES_standard_derivatives + sine = sin(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI)); + cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * dFdx(sine)); +#else + cosine = 0.5; +#endif + + if( gl_FragCoord.x < SAFETY_BOUND ) + { + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag new file mode 100644 index 000000000..6cae5b955 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag @@ -0,0 +1,61 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + +uniform float viewportwidth; +uniform float viewportheight; + +varying vec2 vertXY; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float cosine; + + if( gl_FragCoord.x < SAFETY_BOUND ) + { + // horizontal cosine wave with a period of 128 pixels +#ifdef GL_OES_standard_derivatives + cosine = REDUCE_RANGE(cos(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI))); +#else + cosine = 0.5; +#endif + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag new file mode 100644 index 000000000..dfeb3db7c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag @@ -0,0 +1,68 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + +// This fragment shader computes an image representation of the derivative of +// sine. The derivative of sine is cosine. This shader's output is compared to +// the reference shader that computes an image representation of cosine +// directly. + +uniform float viewportwidth; +uniform float viewportheight; + +varying vec2 vertXY; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float sine; + float cosine; + +#ifdef GL_OES_standard_derivatives + sine = sin(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI)); + cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * dFdy(sine)); +#else + cosine = 0.5; +#endif + + if( gl_FragCoord.y < SAFETY_BOUND ) + { + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert new file mode 100644 index 000000000..a373ce624 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag new file mode 100644 index 000000000..1036de455 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag @@ -0,0 +1,64 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + +uniform float viewportwidth; +uniform float viewportheight; + +varying vec2 vertXY; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float cosine; + + if( gl_FragCoord.y < SAFETY_BOUND ) + { + // vertical cosine wave with a period of 128 pixels + +#ifdef GL_OES_standard_derivatives + cosine = REDUCE_RANGE(cos(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI))); +#else + cosine = 0.5; +#endif + + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert new file mode 100644 index 000000000..a373ce624 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag new file mode 100644 index 000000000..e9d460fb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert new file mode 100644 index 000000000..4cb92aa77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag new file mode 100644 index 000000000..8db3c6954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].xy); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert new file mode 100644 index 000000000..1b5b7831a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 gtf_TexCoord[1]; +attribute vec4 gtf_MultiTexCoord0; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag new file mode 100644 index 000000000..cae6f5674 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + + +varying vec2 vertXY; + +uniform float viewportwidth; +uniform float viewportheight; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float func; + float funcfwidth; + +#ifdef GL_OES_standard_derivatives + // fwidth of average of horizontal and vertical sine waves with periods of 128 pixels, scaled to go from -1 to +1 + func = 0.5 * (sin(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI)) + sin(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI))); + funcfwidth = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * fwidth(func)); +#else + funcfwidth = 0.5; +#endif + + if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) ) + { + gl_FragColor = vec4(funcfwidth, funcfwidth, funcfwidth, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag new file mode 100644 index 000000000..023f07111 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + +varying vec2 vertXY; + +uniform float viewportwidth; +uniform float viewportheight; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float cosine; + float sine; + +#ifdef GL_OES_standard_derivatives + // fwidth of horizontal sine wave with a period of 128 pixels, scaled to go from -1 to +1 + sine = sin(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI)); + cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * fwidth(sine)); +#else + cosine = 0.5; +#endif + + if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) ) + { + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag new file mode 100644 index 000000000..24e6be013 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + + +varying vec2 vertXY; + +uniform float viewportwidth; +uniform float viewportheight; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float cosine; + float sine; + +#ifdef GL_OES_standard_derivatives + // fwidth of vertical sine wave with a period of 128 pixels, scaled to go from -1 to +1 + sine = sin(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI)); + cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * fwidth(sine)); +#else + cosine = 0.5; +#endif + + if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) ) + { + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag new file mode 100644 index 000000000..6dc825a78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag @@ -0,0 +1,64 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + + +uniform float viewportwidth; +uniform float viewportheight; + +varying vec2 vertXY; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float func; + + if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) ) + { + // average of horizontal and vertical abs cosine waves with periods of 128 pixels + +#ifdef GL_OES_standard_derivatives + func = REDUCE_RANGE(0.5 * (abs(cos(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI))) + abs(cos(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI))))); +#else + func = 0.5; +#endif + + gl_FragColor = vec4(func, func, func, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag new file mode 100644 index 000000000..5f7173c3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + +uniform float viewportwidth; +uniform float viewportheight; + +varying vec2 vertXY; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float cosine; + + if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) ) + { + // horizontal abs cosine wave with a period of 128 pixels + +#ifdef GL_OES_standard_derivatives + cosine = REDUCE_RANGE(abs(cos(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI)))); +#else + cosine = 0.5; +#endif + + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag new file mode 100644 index 000000000..1f25729b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag @@ -0,0 +1,64 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +#extension GL_OES_standard_derivatives : enable +precision mediump float; +#endif + +// setting a boundary for cases where screen sizes may exceed the precision +// of the arithmetic used. +#define SAFETY_BOUND 500.0 + +// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]. +// Accounts for precision errors magnified by derivative operation. +#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0 + + +uniform float viewportwidth; +uniform float viewportheight; + +varying vec2 vertXY; + +void main (void) +{ + const float M_PI = 3.14159265358979323846; + float cosine; + + if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) ) + { + // vertical abs cosine wave with a period of 128 pixels + +#ifdef GL_OES_standard_derivatives + cosine = REDUCE_RANGE(abs(cos(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI)))); +#else + cosine = 0.5; +#endif + + gl_FragColor = vec4(cosine, cosine, cosine, 1.0); + } + else discard; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert new file mode 100644 index 000000000..19f17bd5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying vec2 vertXY; + +void main (void) +{ + vertXY = gtf_Vertex.xy; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag new file mode 100644 index 000000000..b25540e1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0) * color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert new file mode 100644 index 000000000..3c0c0e076 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert @@ -0,0 +1,161 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +attribute vec3 gtf_Normal; +attribute vec4 gtf_MultiTexCoord0; + +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat3 gtf_NormalMatrix; + +varying vec4 gtf_TexCoord[1]; +varying vec4 color; + +vec4 Ambient; +vec4 Diffuse; +vec4 Specular; + +const vec3 lightPosition = vec3(0.0, 0.0, 1.0); +const vec3 spotDirection = vec3(0.0, 0.0, -1.0); +const float spotCutoff = 180.0; +const float spotExponent = 0.0; + +const float lightAttenuationConstant = 1.0; +const float lightAttenuationLinear = 0.0; +const float lightAttenuationQuadratic = 0.0; + +const vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 0.0); +vec4 lightDiffuse = vec4(1.0, 1.0, 1.0, 1.0); +vec4 lightSpecular = vec4(1.0, 1.0, 1.0, 1.0); + +const float materialShininess = 0.0; + +const vec4 sceneColor = vec4(0.0, 0.0, 0.0, 0.0); + +void spotLight(in int i, + in vec3 normal, + in vec3 eye, + in vec3 ecPosition3 + ) +{ + float nDotVP; // normal . light direction + float nDotHV; // normal . light half vector + float pf; // power factor + float spotDot; // cosine of angle between spotlight + float spotAttenuation; // spotlight attenuation factor + float attenuation; // computed attenuation factor + float d; // distance from surface to light source + vec3 VP; // direction from surface to light position + vec3 halfVector; // direction of maximum highlights + + // Compute vector from surface to light position + VP = lightPosition - ecPosition3; + + // Compute distance between surface and light position + d = length(VP); + + // Normalize the vector from surface to light position + VP = normalize(VP); + + // Compute attenuation + attenuation = 1.0 / (lightAttenuationConstant + + lightAttenuationLinear * d + + lightAttenuationQuadratic * d * d); + + // See if point on surface is inside cone of illumination + spotDot = dot(-VP, normalize(spotDirection)); + + if (spotDot < cos(radians(spotCutoff))) + spotAttenuation = 0.0; // light adds no contribution + else + spotAttenuation = pow(spotDot, spotExponent); + + // Combine the spotlight and distance attenuation. + attenuation *= spotAttenuation; + + halfVector = normalize(VP + eye); + + nDotVP = max(0.0, dot(normal, VP)); + nDotHV = max(0.0, dot(normal, halfVector)); + + if (nDotVP == 0.0) + pf = 0.0; + else + pf = pow(nDotHV, materialShininess); + + Ambient += lightAmbient * attenuation; + Diffuse += lightDiffuse * nDotVP * attenuation; + Specular += lightSpecular * pf * attenuation; +} + +vec3 fnormal(void) +{ + //Compute the normal + vec3 normal = gtf_NormalMatrix * gtf_Normal; + normal = normalize(normal); + + return normal; +} + +void flight(in vec3 normal, in vec4 ecPosition, float alphaFade) +{ + vec3 ecPosition3; + vec3 eye; + + ecPosition3 = (vec3 (ecPosition)) / ecPosition.w; + eye = vec3 (0.0, 0.0, 1.0); + + // Clear the light intensity accumulators + Ambient = vec4 (0.0); + Diffuse = vec4 (0.0); + Specular = vec4 (0.0); + + //lightSpecular = gtf_Color; + + spotLight(0, normal, eye, ecPosition3); + + color = sceneColor + + Ambient * gtf_Color + + Diffuse * gtf_Color; + color += Specular * gtf_Color; + color = clamp( color, 0.0, 1.0 ); + + color.a *= alphaFade; +} + +void main (void) +{ + vec3 transformedNormal; + float alphaFade = 1.0; + + vec4 ecPosition = gtf_Vertex; + + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + transformedNormal = fnormal(); + flight(transformedNormal, ecPosition, alphaFade); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag new file mode 100644 index 000000000..30115c372 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D gtf_Texture0; +uniform sampler2D gtf_Texture1; + +varying vec4 color; +varying vec4 gtf_TexCoord[2]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0); + gl_FragColor += texture2D(gtf_Texture1, gtf_TexCoord[1].st, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert new file mode 100644 index 000000000..a327a7e0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +uniform mat4 gtf_ModelViewProjectionMatrix; + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +attribute vec4 gtf_MultiTexCoord0; +attribute vec4 gtf_MultiTexCoord1; + +varying vec4 color; +varying vec4 gtf_TexCoord[2]; + +void main (void) +{ + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gtf_TexCoord[1] = gtf_MultiTexCoord1; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag new file mode 100644 index 000000000..e9d460fb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert new file mode 100644 index 000000000..2811521b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +attribute float gtf_PointSize; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = gtf_PointSize; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag new file mode 100644 index 000000000..3fc499ba0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + if (gtf_TexCoord[0].s == 1.0) + gl_FragColor = color; + else + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag new file mode 100644 index 000000000..e9d460fb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert new file mode 100644 index 000000000..72e83fd03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag new file mode 100644 index 000000000..8db3c6954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].xy); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert new file mode 100644 index 000000000..1b5b7831a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 gtf_TexCoord[1]; +attribute vec4 gtf_MultiTexCoord0; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag new file mode 100644 index 000000000..2f751e706 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert new file mode 100644 index 000000000..aafe53fbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert @@ -0,0 +1,149 @@ + +/* +** 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. +*/ + + +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat3 gtf_NormalMatrix; + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +attribute vec3 gtf_Normal; + +varying vec4 color; + +vec4 Ambient; +vec4 Diffuse; +vec4 Specular; + +const vec3 lightPosition = vec3(0.0, 0.0, 10.0); +const float lightAttenuationConstant = 1.0; +const float lightAttenuationLinear = 0.0; +const float lightAttenuationQuadratic = 0.0; + +const vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 0.0); +vec4 lightDiffuse = vec4(1.0, 0.0, 0.0, 1.0); + +const vec4 materialAmbient = vec4(0.0, 0.0, 0.0, 1.0); +const vec4 materialDiffuse = vec4(1.0, 1.0, 1.0, 1.0); +const vec4 materialSpecular = vec4(0.0, 0.0, 0.0, 0.0); +const float materialShininess = 20.0; + +const vec4 sceneColor = vec4(0.0, 0.0, 0.0, 0.0); + + +void pointLight(in int i, in vec3 normal, in vec3 eye, in vec3 ecPosition3) +{ + float nDotVP; // normal . light direction + float nDotHV; // normal . light half vector + float pf; // power factor + float attenuation; // computed attenuation factor + float d; // distance from surface to light source + vec3 VP; // direction from surface to light position + vec3 halfVector; // direction of maximum highlights + + // Compute vector from surface to light position + VP = lightPosition - ecPosition3; + + // Compute distance between surface and light position + d = length(VP); + + // Normalize the vector from surface to light position + VP = normalize(VP); + + // Compute attenuation + attenuation = 1.0 / (lightAttenuationConstant + + lightAttenuationLinear * d + + lightAttenuationQuadratic * d * d); + + halfVector = normalize(VP + eye); + + nDotVP = max(0.0, dot(normal, VP)); + nDotHV = max(0.0, dot(normal, halfVector)); + + if (nDotVP == 0.0) + { + pf = 0.0; + } + else + { + pf = pow(nDotHV, materialShininess); + + } + Ambient += lightAmbient * attenuation; + Diffuse += lightDiffuse * nDotVP * attenuation; +// Specular += lightSpecular * pf * attenuation; +} + +vec3 fnormal(void) +{ + //Compute the normal + vec3 normal = gtf_Normal * gtf_NormalMatrix; + normal = normalize(normal); + + // This should change to "return normal" but for this test, we force a normal pointing towards the light + // return normal + return vec3(0.0, 0.0, 1.0); +} + +void flight(in vec3 normal, in vec4 ecPosition, float alphaFade) +{ + vec3 ecPosition3; + vec3 eye; + + ecPosition3 = (vec3 (ecPosition)) / ecPosition.w; + eye = vec3 (0.0, 0.0, 1.0); + + // Clear the light intensity accumulators + Ambient = vec4 (0.0); + Diffuse = vec4 (0.0); + Specular = vec4 (0.0); + + lightDiffuse = gtf_Color; + + pointLight(0, normal, eye, ecPosition3); + + color = sceneColor + + Ambient * materialAmbient + + Diffuse * materialDiffuse; + color += Specular * materialSpecular; + color = clamp( color, 0.0, 1.0 ); + + color.a *= alphaFade; +} + + +void main (void) +{ + vec3 transformedNormal; + float alphaFade = 1.0; + + // Eye-coordinate position of vertex, needed in various calculations + vec4 ecPosition = gtf_ModelViewMatrix * gtf_Vertex; + + // Do fixed functionality vertex transform + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + transformedNormal = fnormal(); + flight(transformedNormal, ecPosition, alphaFade); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag new file mode 100644 index 000000000..e9d460fb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert new file mode 100644 index 000000000..da6387dcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag new file mode 100644 index 000000000..e9d460fb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert new file mode 100644 index 000000000..5ff012587 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform float gtf_PointSize; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = gtf_PointSize; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag new file mode 100644 index 000000000..96a04a9ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag @@ -0,0 +1,31 @@ + +/* +** 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. +*/ + + +uniform sampler2D gtf_Texture0; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gl_PointCoord.st); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert new file mode 100644 index 000000000..a85dd66bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute float gtf_PointSize; +uniform mat4 gtf_ModelViewProjectionMatrix; + +void main (void) +{ + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = gtf_PointSize; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag new file mode 100644 index 000000000..f91d4b0e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +varying vec4 color; +varying float dotClip[2]; + +void main (void) +{ + if (dotClip[0] >= 0.0 || dotClip[1] >= 0.0) + discard; + + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert new file mode 100644 index 000000000..ed27fe77e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert @@ -0,0 +1,44 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +varying float dotClip[2]; + +void main (void) +{ + vec4 userClipPlanes[2]; + userClipPlanes[0] = vec4(0.0, 1.0, 0.0, 0.0); + userClipPlanes[1] = vec4(-1.0, 0.0, 0.0, 0.0); + + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + dotClip[0] = dot(userClipPlanes[0], gl_Position); + dotClip[1] = dot(userClipPlanes[1], gl_Position); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag new file mode 100644 index 000000000..fd4718885 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float GrainSize; +uniform vec3 DarkColor; +uniform vec3 colorSpread; + +varying float lightIntensity; +varying vec3 Position; + +void main (void) +{ + // + // cheap noise + // + vec3 location = Position; + + vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0)); + vec3 noise = Position * 10.0 - floorvec - 0.5; + noise *= noise; + location += noise * 0.12; + + // + // distance from axis + // + float dist = location.x * location.x + location.z * location.z; + float grain = dist / GrainSize; + + // + // grain effects as function of distance + // + float brightness = fract(grain); + if (brightness > 0.5) + brightness = (1.0 - brightness); + vec3 color = DarkColor + 0.5 * brightness * (colorSpread); + + brightness = fract(grain*7.0); + if (brightness > 0.5) + brightness = 1.0 - brightness; + color -= 0.5 * brightness * colorSpread; + + // + // also as a function of lines parallel to the axis + // + brightness = fract(grain*47.0); + float line = fract(Position.z + Position.x); + float snap = floor(line * 30.0) * (1.0/30.0); + if (line < snap + 0.004) + color -= 0.5 * brightness * colorSpread; + + // + // apply lighting effects from vertex processor + // + color *= lightIntensity; + color = clamp(color, 0.0, 1.0); + + gl_FragColor = vec4(color, 0.1) +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert new file mode 100644 index 000000000..c73892a4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag new file mode 100644 index 000000000..870d53d05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag @@ -0,0 +1,64 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert new file mode 100644 index 000000000..8895eba88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute vec3 myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2[1]); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert new file mode 100644 index 000000000..c73892a4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag new file mode 100644 index 000000000..c37982eb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag @@ -0,0 +1,52 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// wobble.frag: Fragment shader for wobbling a texture +// +// author: Antonio Tejada +// +// + +varying vec3 Position; +varying float lightIntensity; + +/* Constants */ + +uniform sampler2D sampler2d; // value of sampler2d = 0 +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + vec3 lightColor = vec3(texture2D(sampler2d, vec2(gtf_TexCoord[0]))) * lightIntensity; + + vec3 ct = clamp(lightColor, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag new file mode 100644 index 000000000..fd4718885 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float GrainSize; +uniform vec3 DarkColor; +uniform vec3 colorSpread; + +varying float lightIntensity; +varying vec3 Position; + +void main (void) +{ + // + // cheap noise + // + vec3 location = Position; + + vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0)); + vec3 noise = Position * 10.0 - floorvec - 0.5; + noise *= noise; + location += noise * 0.12; + + // + // distance from axis + // + float dist = location.x * location.x + location.z * location.z; + float grain = dist / GrainSize; + + // + // grain effects as function of distance + // + float brightness = fract(grain); + if (brightness > 0.5) + brightness = (1.0 - brightness); + vec3 color = DarkColor + 0.5 * brightness * (colorSpread); + + brightness = fract(grain*7.0); + if (brightness > 0.5) + brightness = 1.0 - brightness; + color -= 0.5 * brightness * colorSpread; + + // + // also as a function of lines parallel to the axis + // + brightness = fract(grain*47.0); + float line = fract(Position.z + Position.x); + float snap = floor(line * 30.0) * (1.0/30.0); + if (line < snap + 0.004) + color -= 0.5 * brightness * colorSpread; + + // + // apply lighting effects from vertex processor + // + color *= lightIntensity; + color = clamp(color, 0.0, 1.0); + + gl_FragColor = vec4(color, 0.1) +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag new file mode 100644 index 000000000..92e465d7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag @@ -0,0 +1,46 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +varying vec4 color; +varying vec4 texCoord[1]; + +uniform sampler2D gtf_Texture0; +uniform int gtf_UseTexture; + +void main (void) +{ + if ( gtf_UseTexture == 1 ) + { + gl_FragColor = texture2D(gtf_Texture0, texCoord[0].xy); + } + else + { + gl_FragColor = color; + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert new file mode 100644 index 000000000..97b4bcf81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert @@ -0,0 +1,40 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +attribute vec4 gtf_MultiTexCoord0; + +varying vec4 texCoord[1]; +varying vec4 color; + +uniform mat4 gtf_ModelViewProjectionMatrix; + +void main (void) +{ + color = gtf_Color; + texCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert new file mode 100644 index 000000000..2f30ce654 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert @@ -0,0 +1,62 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec3 gtf_Normal; +attribute mat2 myAttrib2m; + +uniform mat3 gtf_NormalMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; + +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + float f = myAttrib2m[0][0]; + + float spec = clamp(dot(reflectVec, viewVec), f, 1.0); + //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert new file mode 100644 index 000000000..6653570d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert @@ -0,0 +1,62 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec3 gtf_Normal; +attribute mat3 myAttrib3m; + +uniform mat3 gtf_NormalMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; + +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + float f = myAttrib3m[0][0]; + + float spec = clamp(dot(reflectVec, viewVec), f, 1.0); + //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert new file mode 100644 index 000000000..41cbc95b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert @@ -0,0 +1,62 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec3 gtf_Normal; +attribute mat4 myAttrib4m; + +uniform mat3 gtf_NormalMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; + +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + float f = myAttrib4m[0][0]; + + float spec = clamp(dot(reflectVec, viewVec), f, 1.0); + //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert new file mode 100644 index 000000000..cbb971545 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert @@ -0,0 +1,65 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec3 gtf_Normal; +attribute float myAttrib1f; +attribute vec2 myAttrib2f; +attribute vec3 myAttrib3f; +attribute vec4 myAttrib4f; + +uniform mat3 gtf_NormalMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; + +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + float f = myAttrib1f + myAttrib2f[0] + myAttrib3f[0] + myAttrib4f[0]; + + float spec = clamp(dot(reflectVec, viewVec), f, 1.0); + //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag new file mode 100644 index 000000000..41c8d30a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag @@ -0,0 +1,62 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif + +uniform vec3 brickColor; +uniform vec3 mortarColor; +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert new file mode 100644 index 000000000..cc24e815f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert @@ -0,0 +1,88 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +varying float lightIntensity; +varying vec3 Position; + + // Used in the vertex shader. +uniform mat3 gtf_NormalMatrix; //< 1 +uniform mat4 gtf_ModelViewMatrix; //< 2 +uniform mat4 gtf_ModelViewProjectionMatrix; //< 3 +uniform float myAttrib1f; //< 4 +uniform vec2 myAttrib2f; //< 5 +uniform vec3 LightPosition; //< 6 +uniform vec4 myAttrib4f; //< 7 +uniform int myAttrib1i; //< 8 +uniform ivec2 myAttrib2i; //< 9 +uniform ivec3 myAttrib3i; //< 10 +uniform ivec4 myAttrib4i; //< 11 +uniform bool myAttrib1b; //< 12 +uniform bvec2 myAttrib2b; //< 13 +uniform bvec3 myAttrib3b; //< 14 +uniform bvec4 myAttrib4b; //< 15 +uniform mat2 myAttrib2m; //< 16 +uniform mat3 myAttrib3m; //< 17 +uniform mat4 myAttrib4m; //< 18 +uniform float myUniformfv[5]; //< 19 + // Used in the fragment shader. +uniform vec3 brickColor; //< 20 +uniform vec3 mortarColor; //< 21 +uniform float brickMortarWidth; //< 22 +uniform float brickMortarHeight; //< 23 +uniform float mwf; //< 24 +uniform float mhf; //< 25 + + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + float f = myAttrib1f + myAttrib2f[0] + myAttrib4f[0] + + float(myAttrib1i) + float(myAttrib2i[0]) + float(myAttrib3i[0]) + float(myAttrib4i[0]) + + float(myAttrib1b) + float(myAttrib2b[0]) + float(myAttrib3b[0]) + float(myAttrib4b[0]) + + myAttrib2m[0][0] + myAttrib3m[0][0] + myAttrib4m[0][0] + + myUniformfv[0] + myUniformfv[1] + myUniformfv[2] + myUniformfv[3] + myUniformfv[4]; + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), f, 1.0); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag new file mode 100644 index 000000000..2bec40d3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec3 colors; + +void main (void) +{ + gl_FragColor = vec4 (colors, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert new file mode 100644 index 000000000..2a94ead4f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute float myAttribute1; +attribute float myAttribute2; +attribute float myAttribute3; + +varying vec3 colors; + +void main(void) +{ + colors = vec3(myAttribute1, 0, 0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert new file mode 100644 index 000000000..24227d48f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag new file mode 100644 index 000000000..99c78e207 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec3 tc; + +void main (void) +{ + vec3 foo = tc; + gl_FragColor = vec4 (foo, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert new file mode 100644 index 000000000..cc4028a5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform vec3 triangleColor; +varying vec3 tc; + +void main(void) +{ + tc = triangleColor; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert new file mode 100644 index 000000000..24227d48f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag new file mode 100644 index 000000000..99c78e207 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec3 tc; + +void main (void) +{ + vec3 foo = tc; + gl_FragColor = vec4 (foo, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert new file mode 100644 index 000000000..cc4028a5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform vec3 triangleColor; +varying vec3 tc; + +void main(void) +{ + tc = triangleColor; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag new file mode 100644 index 000000000..5ca53807e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform bool funi1; +uniform bvec2 funi2; +uniform bvec3 funi3; +uniform bvec4 funi4; +varying vec4 color; + +void main (void) +{ + vec4 temp = vec4(0.0, 0.0, 0.0, 0.0); + if(funi1 || funi2[0] && funi2[1] && funi3[0] && funi3[1] && funi3[2] || funi4[0] && funi4[1] && funi4[2] && funi4[3]) + temp = vec4(1.0, 0.0, 0.5, 1.0); + gl_FragColor = temp + color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert new file mode 100644 index 000000000..1d9153361 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform bool vuni1; +uniform bvec2 vuni2; +uniform bvec3 vuni3; +uniform bvec4 vuni4; +varying vec4 color; + +void main (void) +{ + if(vuni1 || vuni2[0] && vuni2[1] && vuni3[0] && vuni3[1] && vuni3[2] || vuni4[0] && vuni4[1] && vuni4[2] && vuni4[3]) + color = vec4(1.0, 0.0, 0.5, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag new file mode 100644 index 000000000..6d7e37eba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform int funi1; +uniform ivec2 funi2; +uniform ivec3 funi3; +uniform ivec4 funi4; +varying vec4 color; + +void main (void) +{ + vec4 temp = vec4(float(funi1), float(funi2[0] + funi2[1]), float(funi3[0] + funi3[1] + funi3[2]), float(funi4[0] + funi4[1] + funi4[2] + funi4[3])); + gl_FragColor = temp + color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert new file mode 100644 index 000000000..d854d0f4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform int vuni1; +uniform ivec2 vuni2; +uniform ivec3 vuni3; +uniform ivec4 vuni4; +varying vec4 color; + +void main (void) +{ + color = vec4(float(vuni1), float(vuni2[0] + vuni2[1]), float(vuni3[0] + vuni3[1] + vuni3[2]), float(vuni4[0] + vuni4[1] + vuni4[2] + vuni4[3]) ); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag new file mode 100644 index 000000000..ea3f85995 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform mat2 funi2; +uniform mat3 funi3; +uniform mat4 funi4; +varying vec4 color; + +void main (void) +{ + vec4 temp = vec4( funi2[0][0] + funi2[0][1] + funi2[1][0] + funi2[1][1], + + funi3[0][0] + funi3[0][1] + funi3[0][2] + funi3[1][0] + funi3[1][1] + funi3[1][2] + funi3[2][0] + funi3[2][1] + funi3[2][2], + + funi4[0][0] + funi4[0][1] + funi4[0][2] + funi4[0][3] + funi4[1][0] + funi4[1][1] + funi4[1][2] + funi4[1][3] + funi4[2][0] + funi4[2][1] + funi4[2][2] + funi4[2][3] + funi4[3][0] + funi4[3][1] + funi4[3][2] + funi4[3][3], 1.0 ); + gl_FragColor = temp + color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert new file mode 100644 index 000000000..f3f6e0dcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat2 vuni2; +uniform mat3 vuni3; +uniform mat4 vuni4; +varying vec4 color; + +void main (void) +{ + color = vec4( vuni2[0][0] + vuni2[0][1] + vuni2[1][0] + vuni2[1][1], + + vuni3[0][0] + vuni3[0][1] + vuni3[0][2] + vuni3[1][0] + vuni3[1][1] + vuni3[1][2] + vuni3[2][0] + vuni3[2][1] + vuni3[2][2], + + vuni4[0][0] + vuni4[0][1] + vuni4[0][2] + vuni4[0][3] + vuni4[1][0] + vuni4[1][1] + vuni4[1][2] + vuni4[1][3] + vuni4[2][0] + vuni4[2][1] + vuni4[2][2] + vuni4[2][3] + vuni4[3][0] + vuni4[3][1] + vuni4[3][2] + vuni4[3][3], 1.0 ); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag new file mode 100644 index 000000000..e3f2c84db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float funi1; +uniform vec2 funi2; +uniform vec3 funi3; +uniform vec4 funi4; +varying vec4 color; + +void main (void) +{ + vec4 temp = vec4(funi1, funi2[0] + funi2[1], funi3[0] + funi3[1] + funi3[2], funi4[0] + funi4[1] + funi4[2] + funi4[3]); + gl_FragColor = temp + color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert new file mode 100644 index 000000000..86138149d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform float vuni1; +uniform vec2 vuni2; +uniform vec3 vuni3; +uniform vec4 vuni4; +varying vec4 color; + +void main (void) +{ + color = vec4(vuni1, vuni2[0] + vuni2[1], vuni3[0] + vuni3[1] + vuni3[2], vuni4[0] + vuni4[1] + vuni4[2] + vuni4[3]); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert new file mode 100644 index 000000000..e9b83a490 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute mat3 att3; +attribute mat4 att4; +varying vec4 color; + +void main (void) +{ + color = vec4( 1.0, + + att3[0][0] + att3[0][1] + att3[0][2] + att3[1][0] + att3[1][1] + att3[1][2] + att3[2][0] + att3[2][1] + att3[2][2], + + att4[0][0] + att4[0][1] + att4[0][2] + att4[0][3] + att4[1][0] + att4[1][1] + att4[1][2] + att4[1][3] + att4[2][0] + att4[2][1] + att4[2][2] + att4[2][3] + att4[3][0] + att4[3][1] + att4[3][2] + att4[3][3], 1.0 ); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert new file mode 100644 index 000000000..2d0fbeea7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert @@ -0,0 +1,41 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute mat2 att2; +attribute mat3 att3; +varying vec4 color; + +void main (void) +{ + color = vec4( att2[0][0] + att2[0][1] + att2[1][0] + att2[1][1], + + att3[0][0] + att3[0][1] + att3[0][2] + att3[1][0] + att3[1][1] + att3[1][2] + att3[2][0] + att3[2][1] + att3[2][2], + + 1.0, 1.0 ); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert new file mode 100644 index 000000000..fc870e739 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute float att1; +attribute vec2 att2; +attribute vec3 att3; +attribute vec4 att4; +varying vec4 color; + +void main (void) +{ + color = vec4(att1, att2.x + att2.y, att3.x + att3.y + att3.z, att4.x + att4.y + att4.z + att4.w); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag new file mode 100644 index 000000000..a8d9f3fe4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform bool color; + +void main (void) +{ + gl_FragColor = vec4 (float(color), 0.0, 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag new file mode 100644 index 000000000..ba62f2f2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying float col; + +void main (void) +{ + gl_FragColor = vec4 (col, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert new file mode 100644 index 000000000..a28e76a77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform bool color; +varying float col; +void main (void) +{ + col = float(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag new file mode 100644 index 000000000..9156be3c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float color; + +void main (void) +{ + gl_FragColor = vec4 (color, 0.0, 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag new file mode 100644 index 000000000..ac8f2b4cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying float col; +void main (void) +{ + gl_FragColor = vec4 (col, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert new file mode 100644 index 000000000..066994397 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform float color; +varying float col; +void main (void) +{ + col = color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag new file mode 100644 index 000000000..35d70bce9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform int color; + +void main (void) +{ + gl_FragColor = vec4 (color, 0.0, 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag new file mode 100644 index 000000000..ac8f2b4cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying float col; +void main (void) +{ + gl_FragColor = vec4 (col, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert new file mode 100644 index 000000000..7f22a9674 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform int color; +varying float col; +void main (void) +{ + col = float(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag new file mode 100644 index 000000000..c60e5e07d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float color[2]; + +void main (void) +{ + gl_FragColor = vec4 (color[0], color[1], 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag new file mode 100644 index 000000000..16960a59b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform int color[2]; + +void main (void) +{ + float r = float(color[0]); + float g = float(color[1]); + gl_FragColor = vec4 (r/256.0, g/256.0, 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag new file mode 100644 index 000000000..dd823e361 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 color[2]; + +void main (void) +{ + gl_FragColor = vec4 (color[0][0], color[0][1], color[1][0], color[1][1]); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag new file mode 100644 index 000000000..67577430b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform ivec2 color[2]; + +void main (void) +{ + float r = float(color[0][0]); + float g = float(color[0][1]); + float b = float(color[1][0]); + float a = float(color[1][1]); + + gl_FragColor = vec4 (r/256.0, g/256.0, b/256.0, a/256.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag new file mode 100644 index 000000000..8d7a6c3ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec3 color[2]; + +void main (void) +{ + gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2], + color[1][0] + color[1][1] + color[1][2], + 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag new file mode 100644 index 000000000..c4574b870 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform ivec3 color[2]; + +void main (void) +{ + float r = float(color[0][0] + color[0][1] + color[0][2]); + float g = float(color[1][0] + color[1][1] + color[1][2]); + + gl_FragColor = vec4(r/256.0, g/256.0, 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag new file mode 100644 index 000000000..5363d5e49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec4 color[2]; + +void main (void) +{ + gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2] + color[0][3], + color[1][0] + color[1][1] + color[1][2] + color[1][3], + 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag new file mode 100644 index 000000000..842735415 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform ivec4 color[2]; + +void main (void) +{ + float r = float(color[0][0] + color[0][1] + color[0][2] + color[0][3]); + float g = float(color[1][0] + color[1][1] + color[1][2] + color[1][3]); + + gl_FragColor = vec4 (r/256.0, g/256.0, 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag new file mode 100644 index 000000000..83e9039ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform bvec2 color; + +void main (void) +{ + gl_FragColor = vec4 (vec2(color), 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag new file mode 100644 index 000000000..7ce39a191 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec2 col; + +void main (void) +{ + gl_FragColor = vec4 (col[0], col[1], 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert new file mode 100644 index 000000000..b40967528 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform bvec2 color; +varying vec2 col; +void main (void) +{ + col = vec2(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag new file mode 100644 index 000000000..655e0d31d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 color; + +void main (void) +{ + gl_FragColor = vec4 (color, 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag new file mode 100644 index 000000000..14a4b2959 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec2 col; + +void main (void) +{ + gl_FragColor = vec4 (col, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert new file mode 100644 index 000000000..41ecaf70e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform vec2 color; +varying vec2 col; +void main (void) +{ + col = color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag new file mode 100644 index 000000000..edb986a0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform ivec2 color; + +void main (void) +{ + gl_FragColor = vec4 (color[0], color[1], 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag new file mode 100644 index 000000000..14a4b2959 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec2 col; + +void main (void) +{ + gl_FragColor = vec4 (col, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert new file mode 100644 index 000000000..8cd247668 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform ivec2 color; +varying vec2 col; +void main (void) +{ + col = vec2(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag new file mode 100644 index 000000000..98e98ac4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform mat2 color; + +void main (void) +{ + gl_FragColor = vec4 (color[0][0] + color[0][1], color[1][0] + color[1][1], 0.0, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag new file mode 100644 index 000000000..80f1ef9f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform bvec3 color; + +void main (void) +{ + gl_FragColor = vec4 (vec3(color), 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag new file mode 100644 index 000000000..be8e7b195 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec3 col; + +void main (void) +{ + gl_FragColor = vec4 (col[0], col[1], col[2], 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert new file mode 100644 index 000000000..d74e4a37f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform bvec3 color; +varying vec3 col; +void main (void) +{ + col = vec3(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag new file mode 100644 index 000000000..00e8aa71d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec3 color; + +void main (void) +{ + gl_FragColor = vec4 (color, 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag new file mode 100644 index 000000000..603ba0d65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec3 col; + +void main (void) +{ + gl_FragColor = vec4 (col, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert new file mode 100644 index 000000000..d35becff1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform vec3 color; +varying vec3 col; +void main (void) +{ + col = color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag new file mode 100644 index 000000000..a2f0a3cdd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform ivec3 color; + +void main (void) +{ + gl_FragColor = vec4 (color[0], color[1], color[2], 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag new file mode 100644 index 000000000..603ba0d65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec3 col; + +void main (void) +{ + gl_FragColor = vec4 (col, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert new file mode 100644 index 000000000..d27c38f58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform ivec3 color; +varying vec3 col; +void main (void) +{ + col = vec3(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag new file mode 100644 index 000000000..9de572884 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform mat3 color; + +void main (void) +{ + gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2], + color[1][0] + color[1][1] + color[1][2], + color[2][0] + color[2][1] + color[2][2], + 1.0); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag new file mode 100644 index 000000000..1700c2b76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform bvec4 color; + +void main (void) +{ + gl_FragColor = vec4 (float(color[0]), float(color[1]), float(color[2]), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag new file mode 100644 index 000000000..ee81a869b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 col; + +void main (void) +{ + gl_FragColor = vec4 (col[0], col[1], col[2], 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag new file mode 100644 index 000000000..024f3ca54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform bvec4 color; + +void main (void) +{ + gl_FragColor = vec4 (float(color[1]), float(color[2]), float(color[3]), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag new file mode 100644 index 000000000..408d60354 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 col; + +void main (void) +{ + gl_FragColor = vec4 (col[1], col[2], col[3], 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert new file mode 100644 index 000000000..a8ce5e1d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform bvec4 color; +varying vec4 col; +void main (void) +{ + col = vec4(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag new file mode 100644 index 000000000..bda6bc139 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec4 color; + +void main (void) +{ + gl_FragColor = vec4 (color[0], color[1], color[2], color[3]); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag new file mode 100644 index 000000000..4f771b09f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 col; + +void main (void) +{ + gl_FragColor = vec4 (col[0], col[1], col[2], col[3]); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert new file mode 100644 index 000000000..531294884 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform vec4 color; +varying vec4 col; +void main (void) +{ + col = color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag new file mode 100644 index 000000000..bd00e3c33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform ivec4 color; + +void main (void) +{ + gl_FragColor = vec4 (color[0], color[1], color[2], color[3]); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag new file mode 100644 index 000000000..4f771b09f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 col; + +void main (void) +{ + gl_FragColor = vec4 (col[0], col[1], col[2], col[3]); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert new file mode 100644 index 000000000..ea97a4255 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert @@ -0,0 +1,35 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute vec4 gtf_Color; +uniform ivec4 color; +varying vec4 col; +void main (void) +{ + col = vec4(color); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag new file mode 100644 index 000000000..030ef608f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform mat4 color; + +void main (void) +{ + gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2] + color[0][3], + color[1][0] + color[1][1] + color[1][2] + color[1][3], + color[2][0] + color[2][1] + color[2][2] + color[2][3], + color[3][0] + color[3][1] + color[3][2] + color[3][3]); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert new file mode 100644 index 000000000..45426238d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert @@ -0,0 +1,33 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; + +void main (void) +{ + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag new file mode 100644 index 000000000..fc4b633d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; // Apply it on a per vertex level +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert new file mode 100644 index 000000000..c5908900a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat4 transforms; +uniform mat4 anotherMatrix; + +varying vec4 color; + +void main(void) +{ + color = gtf_Color; // color is per vertex and matches glColor already used by Vertex + + gl_Position = gtf_ModelViewProjectionMatrix* transforms * anotherMatrix * gtf_Vertex; +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag new file mode 100644 index 000000000..fc4b633d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; // Apply it on a per vertex level +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert new file mode 100644 index 000000000..b28a0a52e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat4 transforms[2]; + +varying vec4 color; + +void main(void) +{ + color = gtf_Color; // color is per vertex and matches glColor already used by Vertex + + gl_Position = gtf_ModelViewProjectionMatrix* transforms[0] * transforms[1] * gtf_Vertex; +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag new file mode 100644 index 000000000..fc4b633d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + gl_FragColor = color; // Apply it on a per vertex level +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert new file mode 100644 index 000000000..1e4264cbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert @@ -0,0 +1,38 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat4 transforms; +varying vec4 color; + +void main(void) +{ + color = gtf_Color; // color is per vertex and matches glColor used + + gl_Position = gtf_ModelViewProjectionMatrix* transforms * gtf_Vertex; + +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag new file mode 100644 index 000000000..fd4718885 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float GrainSize; +uniform vec3 DarkColor; +uniform vec3 colorSpread; + +varying float lightIntensity; +varying vec3 Position; + +void main (void) +{ + // + // cheap noise + // + vec3 location = Position; + + vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0)); + vec3 noise = Position * 10.0 - floorvec - 0.5; + noise *= noise; + location += noise * 0.12; + + // + // distance from axis + // + float dist = location.x * location.x + location.z * location.z; + float grain = dist / GrainSize; + + // + // grain effects as function of distance + // + float brightness = fract(grain); + if (brightness > 0.5) + brightness = (1.0 - brightness); + vec3 color = DarkColor + 0.5 * brightness * (colorSpread); + + brightness = fract(grain*7.0); + if (brightness > 0.5) + brightness = 1.0 - brightness; + color -= 0.5 * brightness * colorSpread; + + // + // also as a function of lines parallel to the axis + // + brightness = fract(grain*47.0); + float line = fract(Position.z + Position.x); + float snap = floor(line * 30.0) * (1.0/30.0); + if (line < snap + 0.004) + color -= 0.5 * brightness * colorSpread; + + // + // apply lighting effects from vertex processor + // + color *= lightIntensity; + color = clamp(color, 0.0, 1.0); + + gl_FragColor = vec4(color, 0.1) +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert new file mode 100644 index 000000000..c73892a4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag new file mode 100644 index 000000000..9010f5a12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag @@ -0,0 +1,31 @@ + +/* +** 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. +*/ + + +varying mediump vec4 color; + +void main (void) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert new file mode 100644 index 000000000..4cc0174c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert @@ -0,0 +1,42 @@ + +/* +** 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. +*/ + + +attribute highp vec4 gtf_Color; +attribute highp vec4 gtf_Vertex; +uniform highp mat4 gtf_ModelViewProjectionMatrix; +varying highp vec4 color; + +void main (void) +{ + mediump int x = 5; + lowp int y = 3; + mediump float x2 = 5.0; + lowp float y2 = 1.0; + + color = vec4(x + y, x2 * y2, x, 1.0); + + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag new file mode 100644 index 000000000..966495e61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag @@ -0,0 +1,34 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 tc; + +void main (void) +{ + gl_FragColor = tc; +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert new file mode 100644 index 000000000..703847d5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert @@ -0,0 +1,37 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +attribute float gtf_Color; + +varying vec4 tc; + +void main (void) +{ + tc = vec4(gtf_Color, 0.0, 0.0, 1.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag new file mode 100644 index 000000000..fd4718885 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float GrainSize; +uniform vec3 DarkColor; +uniform vec3 colorSpread; + +varying float lightIntensity; +varying vec3 Position; + +void main (void) +{ + // + // cheap noise + // + vec3 location = Position; + + vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0)); + vec3 noise = Position * 10.0 - floorvec - 0.5; + noise *= noise; + location += noise * 0.12; + + // + // distance from axis + // + float dist = location.x * location.x + location.z * location.z; + float grain = dist / GrainSize; + + // + // grain effects as function of distance + // + float brightness = fract(grain); + if (brightness > 0.5) + brightness = (1.0 - brightness); + vec3 color = DarkColor + 0.5 * brightness * (colorSpread); + + brightness = fract(grain*7.0); + if (brightness > 0.5) + brightness = 1.0 - brightness; + color -= 0.5 * brightness * colorSpread; + + // + // also as a function of lines parallel to the axis + // + brightness = fract(grain*47.0); + float line = fract(Position.z + Position.x); + float snap = floor(line * 30.0) * (1.0/30.0); + if (line < snap + 0.004) + color -= 0.5 * brightness * colorSpread; + + // + // apply lighting effects from vertex processor + // + color *= lightIntensity; + color = clamp(color, 0.0, 1.0); + + gl_FragColor = vec4(color, 0.1) +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert new file mode 100644 index 000000000..6e3536513 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert @@ -0,0 +1,61 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Vertex_Color; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag new file mode 100644 index 000000000..b37c5a0e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag @@ -0,0 +1,39 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform vec4 color; +uniform ivec4 icolor; +uniform bool flag; + +void main (void) +{ + if(flag) + gl_FragColor = vec4 (icolor[0], icolor[1], icolor[2], icolor[3]); + else + gl_FragColor = vec4 (color[0], color[1], color[2], color[3]); +} \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag new file mode 100644 index 000000000..fd4718885 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float GrainSize; +uniform vec3 DarkColor; +uniform vec3 colorSpread; + +varying float lightIntensity; +varying vec3 Position; + +void main (void) +{ + // + // cheap noise + // + vec3 location = Position; + + vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0)); + vec3 noise = Position * 10.0 - floorvec - 0.5; + noise *= noise; + location += noise * 0.12; + + // + // distance from axis + // + float dist = location.x * location.x + location.z * location.z; + float grain = dist / GrainSize; + + // + // grain effects as function of distance + // + float brightness = fract(grain); + if (brightness > 0.5) + brightness = (1.0 - brightness); + vec3 color = DarkColor + 0.5 * brightness * (colorSpread); + + brightness = fract(grain*7.0); + if (brightness > 0.5) + brightness = 1.0 - brightness; + color -= 0.5 * brightness * colorSpread; + + // + // also as a function of lines parallel to the axis + // + brightness = fract(grain*47.0); + float line = fract(Position.z + Position.x); + float snap = floor(line * 30.0) * (1.0/30.0); + if (line < snap + 0.004) + color -= 0.5 * brightness * colorSpread; + + // + // apply lighting effects from vertex processor + // + color *= lightIntensity; + color = clamp(color, 0.0, 1.0); + + gl_FragColor = vec4(color, 0.1) +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert new file mode 100644 index 000000000..c73892a4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag new file mode 100644 index 000000000..906948954 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag @@ -0,0 +1,63 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float mortarThickness; +uniform vec3 brickColor; +uniform vec3 mortarColor; + +uniform float brickMortarWidth; +uniform float brickMortarHeight; +uniform float mwf; +uniform float mhf; + +varying vec3 Position; +varying float lightIntensity; + +void main (void) +{ + vec3 ct; + float ss, tt, w, h; + + vec3 pos = Position; + + ss = pos.x / brickMortarWidth; + tt = pos.z / brickMortarHeight; + + if (fract (tt * 0.5) > 0.5) + ss += 0.5; + + ss = fract (ss); + tt = fract (tt); + + w = step (mwf, ss) - step (1.0 - mwf, ss); + h = step (mhf, tt) - step (1.0 - mhf, tt); + + ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0); + + gl_FragColor = vec4 (ct, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert new file mode 100644 index 000000000..3b42e9d15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert @@ -0,0 +1,43 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; + +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform float Scale; + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex; + Position = vec3(gtf_Vertex) * Scale; + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag new file mode 100644 index 000000000..fd4718885 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag @@ -0,0 +1,83 @@ + +/* +** 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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +uniform float GrainSize; +uniform vec3 DarkColor; +uniform vec3 colorSpread; + +varying float lightIntensity; +varying vec3 Position; + +void main (void) +{ + // + // cheap noise + // + vec3 location = Position; + + vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0)); + vec3 noise = Position * 10.0 - floorvec - 0.5; + noise *= noise; + location += noise * 0.12; + + // + // distance from axis + // + float dist = location.x * location.x + location.z * location.z; + float grain = dist / GrainSize; + + // + // grain effects as function of distance + // + float brightness = fract(grain); + if (brightness > 0.5) + brightness = (1.0 - brightness); + vec3 color = DarkColor + 0.5 * brightness * (colorSpread); + + brightness = fract(grain*7.0); + if (brightness > 0.5) + brightness = 1.0 - brightness; + color -= 0.5 * brightness * colorSpread; + + // + // also as a function of lines parallel to the axis + // + brightness = fract(grain*47.0); + float line = fract(Position.z + Position.x); + float snap = floor(line * 30.0) * (1.0/30.0); + if (line < snap + 0.004) + color -= 0.5 * brightness * colorSpread; + + // + // apply lighting effects from vertex processor + // + color *= lightIntensity; + color = clamp(color, 0.0, 1.0); + + gl_FragColor = vec4(color, 0.1) +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert new file mode 100644 index 000000000..c73892a4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert @@ -0,0 +1,60 @@ + +/* +** 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. +*/ + + +attribute vec3 gtf_Normal; +attribute vec4 gtf_Vertex; +uniform mat3 gtf_NormalMatrix; +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying float lightIntensity; +varying vec3 Position; +uniform vec3 LightPosition; +uniform vec3 NotActiveOne; +attribute float myAttribute1; +attribute float myAttribute2; + +const float specularContribution = 0.7; +const float diffuseContribution = (1.0 - specularContribution); + +void main(void) { + vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color; + Position = vec3(gtf_Vertex); + vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal); + vec3 lightVec = normalize(LightPosition - vec3(pos)); + vec3 reflectVec = reflect(lightVec, tnorm); + vec3 viewVec = normalize(vec3(pos)); + + //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); + float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2); + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + spec = spec * spec; + + lightIntensity = diffuseContribution * dot(lightVec, tnorm) + + specularContribution * spec; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert new file mode 100644 index 000000000..6d5b454fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert @@ -0,0 +1,36 @@ + +/* +** 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. +*/ + + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_PointSize = 20.0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md new file mode 100644 index 000000000..e44d84eae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md @@ -0,0 +1,20 @@ +OpenGL ES 2.0 GLSL conformance tests +==================================== + +The python script, process-ogles2-tests.py, in this folder generates some +WebGL conformance tests from a subset of the OpenGL ES 2.0 conformance +tests. + +To run it you must have a copy of the OpenGL ES 2.0 conformance test +source then run it like this + + python process-ogles2-tests.py /GTF_ES/glsl/GTF/mustpass.run + +Note: Before running you can safely delete the GTF_ES folder in this +folder. Everything inside will be regenerated by the script above. + +IMPORTANT: From the OpenGL ES 2.0 conformance tests only the .vert and +.frag files are open source licenesed. All other files in that suite are +not open source. + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt new file mode 100644 index 000000000..e6b87db93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt @@ -0,0 +1,64 @@ +# this file is auto-generated. DO NOT EDIT. +GL/abs/input.run.txt +GL/acos/input.run.txt +GL/all/input.run.txt +GL/any/input.run.txt +GL/array/input.run.txt +GL/asin/input.run.txt +GL/atan/input.run.txt +GL/biConstants/input.run.txt +GL/biuDepthRange/input.run.txt +GL/build/input.run.txt +GL/built_in_varying_array_out_of_bounds/input.run.txt +GL/ceil/input.run.txt +GL/clamp/input.run.txt +GL/control_flow/input.run.txt +GL/cos/input.run.txt +GL/cross/input.run.txt +GL/default/input.run.txt +GL/degrees/input.run.txt +GL/discard/input.run.txt +GL/distance/input.run.txt +GL/dot/input.run.txt +GL/equal/input.run.txt +GL/exp/input.run.txt +GL/exp2/input.run.txt +GL/faceforward/input.run.txt +GL/floor/input.run.txt +GL/fract/input.run.txt +GL/functions/input.run.txt +GL/gl_FragCoord/input.run.txt +GL/gl_FrontFacing/input.run.txt +GL/greaterThan/input.run.txt +GL/greaterThanEqual/input.run.txt +GL/inversesqrt/input.run.txt +GL/length/input.run.txt +GL/lessThan/input.run.txt +GL/lessThanEqual/input.run.txt +GL/log/input.run.txt +GL/log2/input.run.txt +GL/mat/input.run.txt +GL/mat3/input.run.txt +GL/matrixCompMult/input.run.txt +GL/max/input.run.txt +GL/min/input.run.txt +GL/mix/input.run.txt +GL/mod/input.run.txt +GL/normalize/input.run.txt +GL/not/input.run.txt +GL/notEqual/input.run.txt +GL/operators/input.run.txt +GL/pow/input.run.txt +GL/radians/input.run.txt +GL/reflect/input.run.txt +GL/refract/input.run.txt +GL/sign/input.run.txt +GL/sin/input.run.txt +GL/smoothstep/input.run.txt +GL/sqrt/input.run.txt +GL/step/input.run.txt +GL/struct/input.run.txt +GL/swizzlers/input.run.txt +GL/tan/input.run.txt +GL/vec/input.run.txt +GL/vec3/input.run.txt diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js new file mode 100644 index 000000000..bcf58f27f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js @@ -0,0 +1,808 @@ +/* +** 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. +*/ +OpenGLESTestRunner = (function(){ +var wtu = WebGLTestUtils; +var gl; + +var HALF_GRID_MAX_SIZE = 32; +var KNOWN_ATTRIBS = [ + "gtf_Vertex", + "gtf_Color" +]; + +var GTFPIXELTOLERANCE = 24; +var GTFACCEPTABLEFAILURECONT = 10; +var GTFAMDPIXELTOLERANCE = 12; +var GTFSCORETOLERANCE = 0.65; +var GTFNCCTOLARANCEZERO = 0.25; +var GTFKERNALSIZE = 5; + +function log(msg) { + // debug(msg); +} + +function compareImages(refData, tstData, width, height, diff) { + function isPixelSame(offset) { + // First do simple check + if (Math.abs(refData[offset + 0] - tstData[offset + 0]) <= GTFPIXELTOLERANCE && + Math.abs(refData[offset + 1] - tstData[offset + 1]) <= GTFPIXELTOLERANCE && + Math.abs(refData[offset + 2] - tstData[offset + 2]) <= GTFPIXELTOLERANCE) { + return true; + } + + // TODO: Implement crazy check that's used in OpenGL ES 2.0 conformance tests. + // NOTE: on Desktop things seem to be working. Maybe the more complex check + // is needed for embedded systems? + return false; + } + + var same = true; + for (var yy = 0; yy < height; ++yy) { + for (var xx = 0; xx < width; ++xx) { + var offset = (yy * width + xx) * 4; + var diffOffset = ((height - yy - 1) * width + xx) * 4; + diff[diffOffset + 0] = 0; + diff[diffOffset + 1] = 0; + diff[diffOffset + 2] = 0; + diff[diffOffset + 3] = 255; + if (!isPixelSame(offset)) { + diff[diffOffset] = 255; + if (same) { + same = false; + testFailed("pixel @ (" + xx + ", " + yy + " was [" + + tstData[offset + 0] + "," + + tstData[offset + 1] + "," + + tstData[offset + 2] + "," + + tstData[offset + 3] + "] expected [" + + refData[offset + 0] + "," + + refData[offset + 1] + "," + + refData[offset + 2] + "," + + refData[offset + 3] + "]") + } + } + } + } + return same; +} + +function persp(fovy, aspect, n, f) { + var dz = f - n; + var rad = fovy / 2.0 * 3.14159265 / 180; + + var s = Math.sin(rad); + if (dz == 0 || s == 0 || aspect == 0) + return; + + var cot = Math.cos(rad) / s; + + return [ + cot / aspect, + 0.0, + 0.0, + 0.0, + + 0.0, + cot, + 0.0, + 0.0, + + 0.0, + 0.0, + -(f + n) / dz, + -1.0, + + 0.0, + 0.0, + -2.0 * f * n / dz, + 0.0 + ]; +} + +function setAttribs(attribs, buffers) { + for (var name in attribs) { + var buffer = buffers[name]; + if (!buffer) { + testFailed("no buffer for attrib:" + name); + continue; + } + var loc = attribs[name]; + log("setup attrib: " + loc + " as " + name); + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(buffer.data), gl.STATIC_DRAW); + gl.enableVertexAttribArray(loc); + gl.vertexAttribPointer(loc, buffer.numComponents, gl.FLOAT, false, 0, 0); + } +} + +function drawSquare(attribs) { + var buffers = { + "gtf_Vertex": { + data: [ + 1.0, -1.0, -2.0, + 1.0, 1.0, -2.0, + -1.0, -1.0, -2.0, + -1.0, 1.0, -2.0 + ], + numComponents: 3 + }, + "gtf_Color": { + data: [ + 0.5, 1.0, 0.0, + 0.0, 1.0, 1.0, + 1.0, 0.0, 0.0, + 0.5, 0.0, 1.0 + ], + numComponents: 3, + }, + "gtf_SecondaryColor": { + data: [ + 0.5, 0.0, 1.0, + 1.0, 0.0, 0.0, + 0.0, 1.0, 1.0, + 0.5, 1.0, 0.0 + ], + numComponents: 3, + }, + "gtf_Normal": { + data: [ + 0.5, 0.0, 1.0, + 1.0, 0.0, 0.0, + 0.0, 1.0, 1.0, + 0.5, 1.0, 0.0 + ], + numComponents: 3, + }, + "gtf_MultiTexCoord0": { + data: [ + 1.0, 0.0, + 1.0, 1.0, + 0.0, 0.0, + 0.0, 1.0 + ], + numComponents: 2, + }, + "gtf_FogCoord": { + data: [ + 0.0, + 1.0, + 0.0, + 1.0 + ], + numComponents: 1, + } + }; + setAttribs(attribs, buffers); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); +} + +function drawFrontBackSquare(attribs) { + var front = { + "gtf_Vertex": { + data: [ + 1.0, -1.0, -2.0, + 1.0, 0.0, -2.0, + -1.0, -1.0, -2.0, + -1.0, 0.0, -2.0 + ], + numComponents: 3 + }, + "gtf_Color": { + data: [ + 0.0, 1.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 1.0, 0.0 + ], + numComponents: 3, + }, + "gtf_MultiTexCoord0": { + data: [ + 1.0, 0.0, + 1.0, 0.5, + 0.0, 0.0, + 0.0, 0.5 + ], + numComponents: 2, + } + }; + setAttribs(attribs, front); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); + + var back = { + "gtf_Vertex": { + data: [ + 1.0, 1.0, -2.0, + 1.0, 0.0, -2.0, + -1.0, 1.0, -2.0, + -1.0, 0.0, -2.0 + ], + numComponents: 3 + }, + "gtf_Color": { + data: [ + 1.0, 0.0, 0.0, + 1.0, 0.0, 0.0, + 1.0, 0.0, 0.0, + 1.0, 0.0, 0.0 + ], + numComponents: 3, + }, + "gtf_MultiTexCoord0": { + data: [ + 1.0, 0.1, + 1.0, 0.5, + 0.0, 0.1, + 0.0, 0.5 + ], + numComponents: 2, + } + }; + setAttribs(attribs, back); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); +} + +function drawGrid(attribs, width, height) { + var n = Math.min(Math.floor(Math.max(width, height) / 4), HALF_GRID_MAX_SIZE); + + var numVertices = (n + n) * (n + n) * 6; + + var gridVertices = []; + var gridColors = []; + var gridSecColors = []; + var gridNormals = []; + var gridFogCoords = []; + var gridTexCoords0 = []; + + var currentVertex = 0; + var currentColor = 0; + var currentSecColor = 0; + var currentTexCoord0 = 0; + var currentNormal = 0; + var currentFogCoord = 0; + + var z = -2.0; + for(var i = -n; i < n; ++i) + { + var x1 = i / n; + var x2 = (i + 1) / n; + for(var j = -n; j < n; ++j) + { + var y1 = j / n; + var y2 = (j + 1) / n; + + // VERTEX 0 + gridVertices[currentVertex++] = x1; + gridVertices[currentVertex++] = y1; + gridVertices[currentVertex++] = z; + gridColors[currentColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0; + gridColors[currentColor++] = (x1 + 1.0) / 2.0; + gridColors[currentColor++] = (y1 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0; + gridSecColors[currentSecColor++] = (x2 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (x1 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (y1 + 1.0) / 2.0; + gridNormals[currentNormal++] = 1.0 - (x2 + y2 + 2.0) / 4.0; + gridNormals[currentNormal++] = (x2 + 1.0) / 2.0; + gridNormals[currentNormal++] = (y2 + 1.0) / 2.0; + gridFogCoords[currentFogCoord++] = (y1 + 1.0) / 2.0; + + // VERTEX 1 + gridVertices[currentVertex++] = x2; + gridVertices[currentVertex++] = y1; + gridVertices[currentVertex++] = z; + gridColors[currentColor++] = 1.0 - (x2 + y1 + 2.0) / 4.0; + gridColors[currentColor++] = (x2 + 1.0) / 2.0; + gridColors[currentColor++] = (y1 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = 1.0 - (x1 + y2 + 2.0) / 4.0; + gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (x2 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (y1 + 1.0) / 2.0; + gridNormals[currentNormal++] = 1.0 - (x1 + y2 + 2.0) / 4.0; + gridNormals[currentNormal++] = (x1 + 1.0) / 2.0; + gridNormals[currentNormal++] = (y2 + 1.0) / 2.0; + gridFogCoords[currentFogCoord++] = (y1 + 1.0) / 2.0; + + // VERTEX 2 + gridVertices[currentVertex++] = x2; + gridVertices[currentVertex++] = y2; + gridVertices[currentVertex++] = z; + gridColors[currentColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0; + gridColors[currentColor++] = (x2 + 1.0) / 2.0; + gridColors[currentColor++] = (y2 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0; + gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = (y1 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (x2 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (y2 + 1.0) / 2.0; + gridNormals[currentNormal++] = 1.0 - (x1 + y1 + 2.0) / 4.0; + gridNormals[currentNormal++] = (x1 + 1.0) / 2.0; + gridNormals[currentNormal++] = (y1 + 1.0) / 2.0; + gridFogCoords[currentFogCoord++] = (y2 + 1.0) / 2.0; + + // VERTEX 2 + gridVertices[currentVertex++] = x2; + gridVertices[currentVertex++] = y2; + gridVertices[currentVertex++] = z; + gridColors[currentColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0; + gridColors[currentColor++] = (x2 + 1.0) / 2.0; + gridColors[currentColor++] = (y2 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0; + gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = (y1 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (x2 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (y2 + 1.0) / 2.0; + gridNormals[currentNormal++] = 1.0 - (x1 + y1 + 2.0) / 4.0; + gridNormals[currentNormal++] = (x1 + 1.0) / 2.0; + gridNormals[currentNormal++] = (y1 + 1.0) / 2.0; + gridFogCoords[currentFogCoord++] = (y2 + 1.0) / 2.0; + + // VERTEX 3 + gridVertices[currentVertex++] = x1; + gridVertices[currentVertex++] = y2; + gridVertices[currentVertex++] = z; + gridColors[currentColor++] = 1.0 - (x1 + y2 + 2.0) / 4.0; + gridColors[currentColor++] = (x1 + 1.0) / 2.0; + gridColors[currentColor++] = (y2 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = 1.0 - (x2 + y1 + 2.0) / 4.0; + gridSecColors[currentSecColor++] = (x2 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = (y1 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (x1 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (y2 + 1.0) / 2.0; + gridNormals[currentNormal++] = 1.0 - (x2 + y1 + 2.0) / 4.0; + gridNormals[currentNormal++] = (x2 + 1.0) / 2.0; + gridNormals[currentNormal++] = (y1 + 1.0) / 2.0; + gridFogCoords[currentFogCoord++] = (y2 + 1.0) / 2.0; + + // VERTEX 0 + gridVertices[currentVertex++] = x1; + gridVertices[currentVertex++] = y1; + gridVertices[currentVertex++] = z; + gridColors[currentColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0; + gridColors[currentColor++] = (x1 + 1.0) / 2.0; + gridColors[currentColor++] = (y1 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0; + gridSecColors[currentSecColor++] = (x2 + 1.0) / 2.0; + gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (x1 + 1.0) / 2.0; + gridTexCoords0[currentTexCoord0++] = (y1 + 1.0) / 2.0; + gridNormals[currentNormal++] = 1.0 - (x2 + y2 + 2.0) / 4.0; + gridNormals[currentNormal++] = (x2 + 1.0) / 2.0; + gridNormals[currentNormal++] = (y2 + 1.0) / 2.0; + gridFogCoords[currentFogCoord++] = (y1 + 1.0) / 2.0; + } + } + + var buffers = { + "gtf_Vertex": { data: gridVertices, numComponents: 3 }, + "gtf_Color": { data: gridColors, numComponents: 3 }, + "gtf_SecondaryColor": { data: gridSecColors, numComponents: 3 }, + "gtf_Normal": { data: gridNormals, numComponents: 3 }, + "gtf_FogCoord": { data: gridFogCoords, numComponents: 1 }, + "gtf_MultiTexCoord0": { data: gridTexCoords0, numComponents: 2 } + }; + setAttribs(attribs, buffers); + gl.drawArrays(gl.TRIANGLES, 0, numVertices); +} + +var MODEL_FUNCS = { + square: drawSquare, + frontbacksquare: drawFrontBackSquare, + grid: drawGrid +}; + +function drawWithProgram(program, programInfo, test) { + gl.useProgram(program); + var attribs = { }; + + var numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES); + for (var ii = 0; ii < numAttribs; ++ii) { + var info = gl.getActiveAttrib(program, ii); + var name = info.name; + var location = gl.getAttribLocation(program, name); + attribs[name] = location; + + if (KNOWN_ATTRIBS.indexOf(name) < 0) { + testFailed("unknown attrib:" + name) + } + } + + var uniforms = { }; + var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); + for (var ii = 0; ii < numUniforms; ++ii) { + var info = gl.getActiveUniform(program, ii); + var name = info.name; + if (name.match(/\[0\]$/)) { + name = name.substr(0, name.length - 3); + } + var location = gl.getUniformLocation(program, name); + uniforms[name] = {location: location}; + } + + var getUniformLocation = function(name) { + var uniform = uniforms[name]; + if (uniform) { + uniform.used = true; + return uniform.location; + } + return null; + } + + // Set known uniforms + var loc = getUniformLocation("gtf_ModelViewProjectionMatrix"); + if (loc) { + gl.uniformMatrix4fv( + loc, + false, + persp(60, 1, 1, 30)); + } + var loc = getUniformLocation("viewportwidth"); + if (loc) { + gl.uniform1f(loc, gl.canvas.width); + } + var loc = getUniformLocation("viewportheight"); + if (loc) { + gl.uniform1f(loc, gl.canvas.height); + } + + // Set test specific uniforms + for (var name in programInfo.uniforms) { + var location = getUniformLocation(name); + if (!location) { + continue; + } + var uniform = programInfo.uniforms[name]; + var type = uniform.type; + var value = uniform.value; + var transpose = uniform.transpose; + if (transpose !== undefined) { + log("gl." + type + '("' + name + '", ' + transpose + ", " + value + ")"); + gl[type](location, transpose, value); + } else if (!type.match("v$")) { + var args = [location]; + for (var ii = 0; ii < value.length; ++ii) { + args.push(value[ii]); + } + gl[type].apply(gl, args); + log("gl." + type + '("' + name + '", ' + args.slice(1) + ")"); + } else { + log("gl." + type + '("' + name + '", ' + value + ")"); + gl[type](location, value); + } + var err = gl.getError(); + if (err != gl.NO_ERROR) { + testFailed(wtu.glEnumToString(gl, err) + " generated setting uniform: " + name); + } + } + + // Filter out specified built-in uniforms + if (programInfo.builtin_uniforms) { + var num_builtins_found = 0; + var valid_values = programInfo.builtin_uniforms.valid_values; + for (var index in valid_values) { + var uniform = uniforms[valid_values[index]]; + if (uniform) { + ++num_builtins_found; + uniform.builtin = true; + } + } + + var min_required = programInfo.builtin_uniforms.min_required; + if (num_builtins_found < min_required) { + testFailed("only found " + num_builtins_found + " of " + min_required + + " required built-in uniforms: " + valid_values); + } + } + + // Check for unset uniforms + for (var name in uniforms) { + var uniform = uniforms[name]; + if (!uniform.used && !uniform.builtin) { + testFailed("uniform " + name + " never set"); + } + } + + + for (var state in test.state) { + var fields = test.state[state]; + switch (state) { + case 'depthrange': + gl.depthRange(fields.near, fields.far); + break; + default: + testFailed("unknown state: " + state) + } + } + + gl.clearColor(0, 0, 0, 0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + + var model = test.model || "square"; + var fn = MODEL_FUNCS[model]; + if (!fn) { + testFailed("unknown model type: " + model) + } else { + log("draw as: " + model) + fn(attribs, gl.canvas.width, gl.canvas.height); + } + + var pixels = new Uint8Array(gl.canvas.width * gl.canvas.height * 4); + gl.readPixels(0, 0, gl.canvas.width, gl.canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + return { + width: gl.canvas.width, + height: gl.canvas.height, + pixels: pixels, + img: wtu.makeImageFromCanvas(gl.canvas) + }; +} + +function runProgram(programInfo, test, label, callback) { + var shaders = []; + var source = []; + var count = 0; + + function loadShader(path, type, index) { + wtu.loadTextFileAsync(path, function(success, text) { + addShader(success, text, type, path, index); + }); + } + + function addShader(success, text, type, path, index) { + ++count; + if (!success) { + testFailed("could not load: " + path); + } else { + var shader = wtu.loadShader(gl, text, type); + shaders.push(shader); + source[index] = text; + } + if (count == 2) { + var result; + if (shaders.length == 2) { + debug(""); + if (!quietMode()) { + var consoleDiv = document.getElementById("console"); + wtu.addShaderSources( + gl, consoleDiv, label + " vertex shader", shaders[0], source[0], + programInfo.vertexShader); + wtu.addShaderSources( + gl, consoleDiv, label + " fragment shader", shaders[1], source[1], + programInfo.fragmentShader); + } + var program = wtu.createProgram(gl, shaders[0], shaders[1]); + result = drawWithProgram(program, programInfo, test); + } + callback(result); + } + } + + loadShader(programInfo.vertexShader, gl.VERTEX_SHADER, 0); + loadShader(programInfo.fragmentShader, gl.FRAGMENT_SHADER, 1); +} + +function compareResults(expected, actual) { + var width = expected.width; + var height = expected.height; + var canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + var ctx = canvas.getContext("2d"); + var imgData = ctx.getImageData(0, 0, width, height); + var tolerance = 0; + + var expData = expected.pixels; + var actData = actual.pixels; + + var same = compareImages(expData, actData, width, height, imgData.data); + + var console = document.getElementById("console"); + var diffImg = null; + if (!same) { + ctx.putImageData(imgData, 0, 0); + diffImg = wtu.makeImageFromCanvas(canvas); + } + + if (!quietMode()) { + var div = document.createElement("div"); + div.className = "testimages"; + wtu.insertImage(div, "reference", expected.img); + wtu.insertImage(div, "test", actual.img); + if (diffImg) { + wtu.insertImage(div, "diff", diffImg); + } + div.appendChild(document.createElement('br')); + + console.appendChild(div); + } + + if (!same) { + testFailed("images are different"); + } else { + testPassed("images are the same"); + } + + if (!quietMode()) + console.appendChild(document.createElement('hr')); +} + +function runCompareTest(test, callback) { + debug(""); + debug("test: " + test.name); + var results = []; + var count = 0; + + function storeResults(index) { + return function(result) { + results[index] = result; + ++count; + if (count == 2) { + compareResults(results[0], results[1]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors"); + callback(); + } + } + } + + runProgram(test.referenceProgram, test, "reference", storeResults(0)); + runProgram(test.testProgram, test, "test", storeResults(1)); +} + +function runBuildTest(test, callback) { + debug(""); + debug("test: " + test.name); + + var shaders = [null, null]; + var source = ["",""]; + var success = [undefined, undefined]; + var count = 0; + + function loadShader(path, type, index) { + if (path == "empty") { + shaders[index] = gl.createShader(); + success[index] = true; + source[index] = "/* empty */"; + attachAndLink(); + } else { + wtu.loadTextFileAsync(path, function(loadSuccess, text) { + if (!loadSuccess) { + success[index] = false; + source[index] = "/* could not load */"; + testFailed("could not load:" + path); + } else { + source[index] = text; + shaders[index] = wtu.loadShader(gl, text, type, function(index) { + return function(msg) { + success[index] = false + } + }(index)); + if (success[index] === undefined) { + success[index] = true; + } + } + attachAndLink(); + }); + } + } + + function attachAndLink() { + ++count; + if (count == 2) { + if (!quietMode()) { + debug(""); + var c = document.getElementById("console"); + wtu.addShaderSource( + c, "vertex shader", source[0], test.testProgram.vertexShader); + debug("compile: " + (success[0] ? "success" : "fail")); + wtu.addShaderSource( + c, "fragment shader", source[1], test.testProgram.fragmentShader); + debug("compile: " + (success[1] ? "success" : "fail")); + } + compileSuccess = (success[0] && success[1]); + if (!test.compstat) { + if (compileSuccess) { + testFailed("expected compile failure but was successful"); + } else { + testPassed("expected compile failure and it failed"); + } + } else { + if (compileSuccess) { + testPassed("expected compile success and it was successful"); + } else { + testFailed("expected compile success but it failed"); + } + var linkSuccess = true; + var program = wtu.createProgram(gl, shaders[0], shaders[1], function() { + linkSuccess = false; + }); + if (linkSuccess !== test.linkstat) { + testFailed("expected link to " + (test.linkstat ? "succeed" : "fail")); + } else { + testPassed("shaders compiled and linked as expected."); + } + } + callback(); + } + } + + loadShader(test.testProgram.vertexShader, gl.VERTEX_SHADER, 0); + loadShader(test.testProgram.fragmentShader, gl.FRAGMENT_SHADER, 1); +} + +var testPatterns = { + compare: runCompareTest, + build: runBuildTest, + + dummy: null // just here to mark the end +}; + +function LogGLCall(functionName, args) { + console.log("gl." + functionName + "(" + + WebGLDebugUtils.glFunctionArgsToString(functionName, args) + ")"); +} + +// Runs the tests async since they will load shaders. +function run(obj) { + description(); + + var canvas = document.getElementById("example"); + gl = wtu.create3DContext(canvas); + if (window.WebGLDebugUtils) { + gl = WebGLDebugUtils.makeDebugContext(gl, undefined, LogGLCall); + } + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + if (gl.canvas.width != 500 || gl.canvas.height != 500) { + testFailed("canvas must be 500x500 pixels: Several shaders are hard coded to this size."); + } + + var tests = obj.tests; + var ndx = 0; + + function runNextTest() { + if (ndx < tests.length) { + var test = tests[ndx++]; + var fn = testPatterns[test.pattern]; + if (!fn) { + testFailed("test pattern: " + test.pattern + " not supoprted") + runNextTest(); + } else { + fn(test, runNextTest); + } + } else { + finishTest(); + } + } + runNextTest(); +} + +return { + run: run, +}; +}()); + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py new file mode 100644 index 000000000..5ef710a68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py @@ -0,0 +1,586 @@ +#!/usr/bin/python + +"""generates tests from OpenGL ES 2.0 .run/.test files.""" + +import os +import os.path +import sys +import re +import json +import shutil +from optparse import OptionParser +from xml.dom.minidom import parse + +if sys.version < '2.6': + print 'Wrong Python Version !!!: Need >= 2.6' + sys.exit(1) + +# each shader test generates up to 3 512x512 images. +# a 512x512 image takes 1meg of memory so set this +# number apporpriate for the platform with +# the smallest memory issue. At 8 that means +# at least 24 meg is needed to run the test. +MAX_TESTS_PER_SET = 8 + +VERBOSE = False + +FILTERS = [ + re.compile("GL/"), +] + +LICENSE = """ +/* +** 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. +*/ +""" + +COMMENT_RE = re.compile("/\*\n\*\*\s+Copyright.*?\*/", + re.IGNORECASE | re.DOTALL) +REMOVE_COPYRIGHT_RE = re.compile("\/\/\s+Copyright.*?\n", + re.IGNORECASE | re.DOTALL) +MATRIX_RE = re.compile("Matrix(\\d)") + +VALID_UNIFORM_TYPES = [ + "uniform1f", + "uniform1fv", + "uniform1fv", + "uniform1i", + "uniform1iv", + "uniform1iv", + "uniform2f", + "uniform2fv", + "uniform2fv", + "uniform2i", + "uniform2iv", + "uniform2iv", + "uniform3f", + "uniform3fv", + "uniform3fv", + "uniform3i", + "uniform3iv", + "uniform3iv", + "uniform4f", + "uniform4fv", + "uniform4fv", + "uniform4i", + "uniform4iv", + "uniform4ivy", + "uniformMatrix2fv", + "uniformMatrix2fv", + "uniformMatrix3fv", + "uniformMatrix3fv", + "uniformMatrix4fv", + "uniformMatrix4fv", +] + +SUBSTITUTIONS = [ + ("uniformmat3fv", "uniformMatrix3fv"), + ("uniformmat4fv", "uniformMatrix4fv"), +] + + +def Log(msg): + global VERBOSE + if VERBOSE: + print msg + + +def TransposeMatrix(values, dim): + size = dim * dim + count = len(values) / size + for m in range(0, count): + offset = m * size + for i in range(0, dim): + for j in range(i + 1, dim): + t = values[offset + i * dim + j] + values[offset + i * dim + j] = values[offset + j * dim + i] + values[offset + j * dim + i] = t + + +def GetValidTypeName(type_name): + global VALID_UNIFORM_TYPES + global SUBSTITUTIONS + for subst in SUBSTITUTIONS: + type_name = type_name.replace(subst[0], subst[1]) + if not type_name in VALID_UNIFORM_TYPES: + print "unknown type name: ", type_name + raise SyntaxError + return type_name + + +def WriteOpen(filename): + dirname = os.path.dirname(filename) + if len(dirname) > 0 and not os.path.exists(dirname): + os.makedirs(dirname) + return open(filename, "wb") + + +class TxtWriter(): + def __init__(self, filename): + self.filename = filename + self.lines = [] + + def Write(self, line): + self.lines.append(line) + + def Close(self): + if len(self.lines) > 0: + Log("Writing: %s" % self.filename) + f = WriteOpen(self.filename) + f.write("# this file is auto-generated. DO NOT EDIT.\n") + f.write("".join(self.lines)) + f.close() + + +def ReadFileAsLines(filename): + f = open(filename, "r") + lines = f.readlines() + f.close() + return [line.strip() for line in lines] + + +def ReadFile(filename): + f = open(filename, "r") + content = f.read() + f.close() + return content.replace("\r\n", "\n") + + +def Chunkify(list, chunk_size): + """divides an array into chunks of chunk_size""" + return [list[i:i + chunk_size] for i in range(0, len(list), chunk_size)] + + +def GetText(nodelist): + """Gets the text of from a list of nodes""" + rc = [] + for node in nodelist: + if node.nodeType == node.TEXT_NODE: + rc.append(node.data) + return ''.join(rc) + + +def GetElementText(node, name): + """Gets the text of an element""" + elements = node.getElementsByTagName(name) + if len(elements) > 0: + return GetText(elements[0].childNodes) + else: + return None + + +def GetBoolElement(node, name): + text = GetElementText(node, name) + return text.lower() == "true" + + +def GetModel(node): + """Gets the model""" + model = GetElementText(node, "model") + if model and len(model.strip()) == 0: + elements = node.getElementsByTagName("model") + if len(elements) > 0: + model = GetElementText(elements[0], "filename") + return model + + +def RelativizePaths(base, paths, template): + """converts paths to relative paths""" + rels = [] + for p in paths: + #print "---" + #print "base: ", os.path.abspath(base) + #print "path: ", os.path.abspath(p) + relpath = os.path.relpath(os.path.abspath(p), os.path.dirname(os.path.abspath(base))).replace("\\", "/") + #print "rel : ", relpath + rels.append(template % relpath) + return "\n".join(rels) + + +def CopyFile(filename, src, dst): + s = os.path.abspath(os.path.join(os.path.dirname(src), filename)) + d = os.path.abspath(os.path.join(os.path.dirname(dst), filename)) + dst_dir = os.path.dirname(d) + if not os.path.exists(dst_dir): + os.makedirs(dst_dir) + shutil.copyfile(s, d) + + +def CopyShader(filename, src, dst): + s = os.path.abspath(os.path.join(os.path.dirname(src), filename)) + d = os.path.abspath(os.path.join(os.path.dirname(dst), filename)) + text = ReadFile(s) + # By agreement with the Khronos OpenGL working group we are allowed + # to open source only the .vert and .frag files from the OpenGL ES 2.0 + # conformance tests. All other files from the OpenGL ES 2.0 conformance + # tests are not included. + marker = "insert-copyright-here" + new_text = COMMENT_RE.sub(marker, text) + if new_text == text: + print "no matching license found:", s + raise RuntimeError + new_text = REMOVE_COPYRIGHT_RE.sub("", new_text) + new_text = new_text.replace(marker, LICENSE) + f = WriteOpen(d) + f.write(new_text) + f.close() + + +def IsOneOf(string, regexs): + for regex in regexs: + if re.match(regex, string): + return True + return False + + +def CheckForUnknownTags(valid_tags, node, depth=1): + """do a hacky check to make sure we're not missing something.""" + for child in node.childNodes: + if child.localName and not IsOneOf(child.localName, valid_tags[0]): + print "unsupported tag:", child.localName + print "depth:", depth + raise SyntaxError + else: + if len(valid_tags) > 1: + CheckForUnknownTags(valid_tags[1:], child, depth + 1) + + +def IsFileWeWant(filename): + for f in FILTERS: + if f.search(filename): + return True + return False + + +class TestReader(): + """class to read and parse tests""" + + def __init__(self, basepath): + self.tests = [] + self.modes = {} + self.patterns = {} + self.basepath = basepath + + def Print(self, msg): + if self.verbose: + print msg + + def MakeOutPath(self, filename): + relpath = os.path.relpath(os.path.abspath(filename), os.path.dirname(os.path.abspath(self.basepath))) + return relpath + + def ReadTests(self, filename): + """reads a .run file and parses.""" + Log("reading %s" % filename) + outname = self.MakeOutPath(filename + ".txt") + f = TxtWriter(outname) + dirname = os.path.dirname(filename) + lines = ReadFileAsLines(filename) + count = 0 + tests_data = [] + for line in lines: + if len(line) > 0 and not line.startswith("#"): + fname = os.path.join(dirname, line) + if line.endswith(".run"): + if self.ReadTests(fname): + f.Write(line + ".txt\n") + count += 1 + elif line.endswith(".test"): + tests_data.extend(self.ReadTest(fname)) + else: + print "Error in %s:%d:%s" % (filename, count, line) + raise SyntaxError() + if len(tests_data): + global MAX_TESTS_PER_SET + sets = Chunkify(tests_data, MAX_TESTS_PER_SET) + id = 1 + for set in sets: + suffix = "_%03d_to_%03d" % (id, id + len(set) - 1) + test_outname = self.MakeOutPath(filename + suffix + ".html") + if os.path.basename(test_outname).startswith("input.run"): + dname = os.path.dirname(test_outname) + folder_name = os.path.basename(dname) + test_outname = os.path.join(dname, folder_name + suffix + ".html") + self.WriteTests(filename, test_outname, {"tests":set}) + f.Write(os.path.basename(test_outname) + "\n") + id += len(set) + count += 1 + f.Close() + return count + + def ReadTest(self, filename): + """reads a .test file and parses.""" + Log("reading %s" % filename) + dom = parse(filename) + tests = dom.getElementsByTagName("test") + tests_data = [] + outname = self.MakeOutPath(filename + ".html") + for test in tests: + if not IsFileWeWant(filename): + self.CopyShaders(test, filename, outname) + else: + test_data = self.ProcessTest(test, filename, outname, len(tests_data)) + if test_data: + tests_data.append(test_data) + return tests_data + + def ProcessTest(self, test, filename, outname, id): + """Process a test""" + mode = test.getAttribute("mode") + pattern = test.getAttribute("pattern") + self.modes[mode] = 1 + self.patterns[pattern] = 1 + Log ("%d: mode: %s pattern: %s" % (id, mode, pattern)) + method = getattr(self, 'Process_' + pattern) + test_data = method(test, filename, outname) + if test_data: + test_data["pattern"] = pattern + return test_data + + def WriteTests(self, filename, outname, tests_data): + Log("Writing %s" % outname) + template = """ + + + + +WebGL GLSL conformance test: %(title)s +%(css)s +%(scripts)s + + + +
+
+ + + +""" + css = [ + "../../resources/js-test-style.css", + "../../resources/ogles-tests.css", + ] + scripts = [ + "../../resources/js-test-pre.js", + "../../resources/webgl-test-utils.js", + "ogles-utils.js", + ] + css_html = RelativizePaths(outname, css, '') + scripts_html = RelativizePaths(outname, scripts, '') + + f = WriteOpen(outname) + f.write(template % { + "license": LICENSE, + "css": css_html, + "scripts": scripts_html, + "title": os.path.basename(outname), + "tests_data": json.dumps(tests_data, indent=2) + }) + f.close() + + + def CopyShaders(self, test, filename, outname): + """For tests we don't actually support yet, at least copy the shaders""" + shaders = test.getElementsByTagName("shader") + for shader in shaders: + for name in ["vertshader", "fragshader"]: + s = GetElementText(shader, name) + if s and s != "empty": + CopyShader(s, filename, outname) + + # + # pattern handlers. + # + + def Process_compare(self, test, filename, outname): + global MATRIX_RE + + valid_tags = [ + ["shader", "model", "glstate"], + ["uniform", "vertshader", "fragshader", "filename", "depthrange"], + ["name", "count", "transpose", "uniform*", "near", "far"], + ] + CheckForUnknownTags(valid_tags, test) + + # parse the test + shaders = test.getElementsByTagName("shader") + shaderInfos = [] + for shader in shaders: + v = GetElementText(shader, "vertshader") + f = GetElementText(shader, "fragshader") + CopyShader(v, filename, outname) + CopyShader(f, filename, outname) + info = { + "vertexShader": v, + "fragmentShader": f, + } + shaderInfos.append(info) + uniformElems = shader.getElementsByTagName("uniform") + if len(uniformElems) > 0: + uniforms = {} + info["uniforms"] = uniforms + for uniformElem in uniformElems: + uniform = {"count": 1} + for child in uniformElem.childNodes: + if child.localName == None: + pass + elif child.localName == "name": + uniforms[GetText(child.childNodes)] = uniform + elif child.localName == "count": + uniform["count"] = int(GetText(child.childNodes)) + elif child.localName == "transpose": + uniform["transpose"] = (GetText(child.childNodes) == "true") + else: + if "type" in uniform: + print "utype was:", uniform["type"], " found ", child.localName + raise SyntaxError + type_name = GetValidTypeName(child.localName) + uniform["type"] = type_name + valueText = GetText(child.childNodes).replace(",", " ") + uniform["value"] = [float(t) for t in valueText.split()] + m = MATRIX_RE.search(type_name) + if m: + # Why are these backward from the API?!?!? + TransposeMatrix(uniform["value"], int(m.group(1))) + data = { + "name": os.path.basename(outname), + "model": GetModel(test), + "referenceProgram": shaderInfos[1], + "testProgram": shaderInfos[0], + } + gl_states = test.getElementsByTagName("glstate") + if len(gl_states) > 0: + state = {} + data["state"] = state + for gl_state in gl_states: + for state_name in gl_state.childNodes: + if state_name.localName: + values = {} + for field in state_name.childNodes: + if field.localName: + values[field.localName] = GetText(field.childNodes) + state[state_name.localName] = values + return data + + def Process_shaderload(self, test, filename, outname): + """no need for shaderload tests""" + self.CopyShaders(test, filename, outname) + + def Process_extension(self, test, filename, outname): + """no need for extension tests""" + self.CopyShaders(test, filename, outname) + + def Process_createtests(self, test, filename, outname): + Log("createtests Not implemented: %s" % filename) + self.CopyShaders(test, filename, outname) + + def Process_GL2Test(self, test, filename, outname): + Log("GL2Test Not implemented: %s" % filename) + self.CopyShaders(test, filename, outname) + + def Process_uniformquery(self, test, filename, outname): + Log("uniformquery Not implemented: %s" % filename) + self.CopyShaders(test, filename, outname) + + def Process_egl_image_external(self, test, filename, outname): + """no need for egl_image_external tests""" + self.CopyShaders(test, filename, outname) + + def Process_dismount(self, test, filename, outname): + Log("dismount Not implemented: %s" % filename) + self.CopyShaders(test, filename, outname) + + def Process_build(self, test, filename, outname): + """don't need build tests""" + valid_tags = [ + ["shader", "compstat", "linkstat"], + ["vertshader", "fragshader"], + ] + CheckForUnknownTags(valid_tags, test) + + shader = test.getElementsByTagName("shader") + if not shader: + return None + vs = GetElementText(shader[0], "vertshader") + fs = GetElementText(shader[0], "fragshader") + if vs and vs != "empty": + CopyShader(vs, filename, outname) + if fs and fs != "empty": + CopyShader(fs, filename, outname) + data = { + "name": os.path.basename(outname), + "compstat": bool(GetBoolElement(test, "compstat")), + "linkstat": bool(GetBoolElement(test, "linkstat")), + "testProgram": { + "vertexShader": vs, + "fragmentShader": fs, + }, + } + attach = test.getElementsByTagName("attach") + if len(attach) > 0: + data["attachError"] = GetElementText(attach[0], "attacherror") + return data + + def Process_coverage(self, test, filename, outname): + Log("coverage Not implemented: %s" % filename) + self.CopyShaders(test, filename, outname) + + def Process_attributes(self, test, filename, outname): + Log("attributes Not implemented: %s" % filename) + self.CopyShaders(test, filename, outname) + + def Process_fixed(self, test, filename, outname): + """no need for fixed function tests""" + self.CopyShaders(test, filename, outname) + + +def main(argv): + """This is the main function.""" + global VERBOSE + + parser = OptionParser() + parser.add_option( + "-v", "--verbose", action="store_true", + help="prints more output.") + + (options, args) = parser.parse_args(args=argv) + + if len(args) < 1: + pass # fix me + + os.chdir(os.path.dirname(__file__) or '.') + + VERBOSE = options.verbose + + filename = args[0] + test_reader = TestReader(filename) + test_reader.ReadTests(filename) + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt new file mode 100644 index 000000000..fe74ff96d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt @@ -0,0 +1,11 @@ +get-active-test.html +gl-bind-attrib-location-test.html +--min-version 1.0.2 gl-bind-attrib-location-long-names-test.html +gl-get-active-attribute.html +gl-get-active-uniform.html +gl-getshadersource.html +gl-shader-test.html +invalid-UTF-16.html +--min-version 1.0.4 program-infolog.html +program-test.html +--min-version 1.0.2 use-program-crash-with-discard-in-fragment-shader.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html new file mode 100644 index 000000000..a52d3b107 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html @@ -0,0 +1,140 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html new file mode 100644 index 000000000..25834aa77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html @@ -0,0 +1,174 @@ + + + + + + +WebGL BindAttribLocation Long Names Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html new file mode 100644 index 000000000..4f1ea8385 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html @@ -0,0 +1,160 @@ + + + + + + +WebGL BindAttribLocation Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html new file mode 100644 index 000000000..a5e01f660 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html @@ -0,0 +1,106 @@ + + + + + + +WebGL getActiveAttrib conformance test. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html new file mode 100644 index 000000000..396de4a47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html @@ -0,0 +1,157 @@ + + + + + + +WebGL getActiveUniform conformance test. + + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html new file mode 100644 index 000000000..b90254e5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html @@ -0,0 +1,60 @@ + + + + + + + WebGL getShaderSource conformance test. + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html new file mode 100644 index 000000000..aec6f6d3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html @@ -0,0 +1,115 @@ + + + + + + +WebGL ShaderL Conformance Tests + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html new file mode 100644 index 000000000..48fda6ea4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html @@ -0,0 +1,69 @@ + + + + + + + + + + + +

+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html new file mode 100644 index 000000000..26b87df00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html @@ -0,0 +1,83 @@ + + + + + + +WebGL Program Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html new file mode 100644 index 000000000..2f03d200e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html @@ -0,0 +1,425 @@ + + + + + +WebGL Program Compiling/Linking Conformance Test + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html new file mode 100644 index 000000000..6cca23dc6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html @@ -0,0 +1,98 @@ + + + + + + +WebGL Program Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt new file mode 100644 index 000000000..bff4db57e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt @@ -0,0 +1,3 @@ +read-pixels-pack-alignment.html +read-pixels-test.html + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html new file mode 100644 index 000000000..702420ff8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html new file mode 100644 index 000000000..a80d7266d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html @@ -0,0 +1,318 @@ + + + + + + +WebGL ReadPixels conformance test. + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt new file mode 100644 index 000000000..104cada3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt @@ -0,0 +1,6 @@ +--min-version 1.0.3 feedback-loop.html +--max-version 1.9.9 framebuffer-object-attachment.html +--min-version 1.0.2 framebuffer-state-restoration.html +--max-version 1.9.9 framebuffer-test.html +renderbuffer-initialization.html + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html new file mode 100644 index 000000000..a9e3c0b14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html @@ -0,0 +1,125 @@ + + + + + + + WebGL Rendering Feedback Loop + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html new file mode 100644 index 000000000..f18454b0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html @@ -0,0 +1,663 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html new file mode 100644 index 000000000..a53065365 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html @@ -0,0 +1,128 @@ + + + + + + +WebGL Framebuffer state restoration Test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html new file mode 100644 index 000000000..1875a7529 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html @@ -0,0 +1,197 @@ + + + + + + +WebGL Framebuffer Test + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html new file mode 100644 index 000000000..5e55bd048 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html @@ -0,0 +1,120 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt new file mode 100644 index 000000000..e22f73b5a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt @@ -0,0 +1,28 @@ +--min-version 1.0.4 --max-version 1.9.9 clipping-wide-points.html +--min-version 1.0.2 culling.html +--min-version 1.0.4 default-texture-draw-bug.html +draw-arrays-out-of-bounds.html +draw-elements-out-of-bounds.html +--min-version 1.0.4 draw-with-changing-start-vertex-bug.html +--min-version 1.0.3 framebuffer-switch.html +--min-version 1.0.3 framebuffer-texture-switch.html +gl-clear.html +--min-version 1.0.3 gl-drawarrays.html +gl-drawelements.html +gl-scissor-test.html +--min-version 1.0.2 gl-scissor-fbo-test.html +--min-version 1.0.3 gl-scissor-canvas-dimensions.html +--min-version 1.0.3 gl-viewport-test.html +--min-version 1.0.3 many-draw-calls.html +more-than-65536-indices.html +multisample-corruption.html +--min-version 1.0.3 negative-one-index.html +out-of-bounds-index-buffers.html +--min-version 1.0.3 point-no-attributes.html +point-size.html +--min-version 1.0.4 point-specific-shader-variables.html +--min-version 1.0.3 point-with-gl-pointcoord-in-fragment-shader.html +--min-version 1.0.3 polygon-offset.html +--min-version 1.0.2 simple.html +triangle.html +line-loop-tri-fan.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html new file mode 100644 index 000000000..85234ec37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html @@ -0,0 +1,47 @@ + + + + + +Clipping wide points test + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html new file mode 100644 index 000000000..e35777ea8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html new file mode 100644 index 000000000..ec4978176 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html @@ -0,0 +1,90 @@ + + + + + +WebGL Default Texture Draw Bug Conformance Tests + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html new file mode 100644 index 000000000..4ab292367 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html new file mode 100644 index 000000000..06f49a8d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html new file mode 100644 index 000000000..6b817c341 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html @@ -0,0 +1,133 @@ + + + + + + +Draw with changing start vertex test + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html new file mode 100644 index 000000000..d4bede2c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html @@ -0,0 +1,111 @@ + + + + + + +WebGL framebuffer switching conformance test. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html new file mode 100644 index 000000000..d2115ccbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html @@ -0,0 +1,107 @@ + + + + + + +WebGL framebuffer texture attachment switching conformance test. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html new file mode 100644 index 000000000..7c3484894 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html @@ -0,0 +1,88 @@ + + + + + + +WebGL clear conformance test. + + + + + + +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html new file mode 100644 index 000000000..44fb7fe5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html @@ -0,0 +1,103 @@ + + + + + + +WebGL drawArrays Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html new file mode 100644 index 000000000..5c9a409f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html @@ -0,0 +1,128 @@ + + + + + + +WebGL drawElements Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html new file mode 100644 index 000000000..76f2abf64 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html @@ -0,0 +1,99 @@ + + + + + + +WebGL Scissor Canvas Dimensions Test + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html new file mode 100644 index 000000000..b9d46b728 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html @@ -0,0 +1,131 @@ + + + + + + +WebGL Scissor FBO Test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html new file mode 100644 index 000000000..b56463199 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html @@ -0,0 +1,116 @@ + + + + + + +WebGL Scissor Test + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test-2.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test-2.html new file mode 100644 index 000000000..61a026565 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test-2.html @@ -0,0 +1,76 @@ + + + + + + +WebGL Viewport Test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html new file mode 100644 index 000000000..b2fff7552 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html @@ -0,0 +1,133 @@ + + + + + + +WebGL Viewport Test + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html new file mode 100644 index 000000000..3853afda9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html new file mode 100644 index 000000000..df7e7be46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html @@ -0,0 +1,159 @@ + + + + + + + + + + + + + +
+ +
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html new file mode 100644 index 000000000..38744ce5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html @@ -0,0 +1,144 @@ + + + + + + +WebGL More than 65536 indices. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html new file mode 100644 index 000000000..d520c535c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html @@ -0,0 +1,60 @@ + + + + + + +WebGL Multisample Renderbuffer Corruption Test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html new file mode 100644 index 000000000..f28b6ace8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html @@ -0,0 +1,119 @@ + + + + + + +-1 Index Rendering Test + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html new file mode 100644 index 000000000..baa5e551b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html @@ -0,0 +1,156 @@ + + + + + + + + +WebGL Out-of-Bounds Index Buffer Conformance Test + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html new file mode 100644 index 000000000..4dbfdddb6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html new file mode 100644 index 000000000..14d4e60ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html new file mode 100644 index 000000000..06e686acd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html @@ -0,0 +1,185 @@ + + + + + + +Point-specific shader variables test + + + + + + +
+
+ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html new file mode 100644 index 000000000..16dcca0d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html @@ -0,0 +1,140 @@ + + + + + + +WebGL Point with gl_PointCoord in Fragment Shader Test + + + + + +
+ +
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html new file mode 100644 index 000000000..fd49f6741 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html new file mode 100644 index 000000000..b8496f011 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html @@ -0,0 +1,98 @@ + + + + + + +Simple Rendering Test + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html new file mode 100644 index 000000000..f2cfdb3af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html @@ -0,0 +1,94 @@ + + + + + + +Rendering Test + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html new file mode 100644 index 000000000..9e31a9c49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html @@ -0,0 +1,112 @@ + + + + + + +WebGL Vertex Texture Fetch. + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt new file mode 100644 index 000000000..a76c2f09f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt @@ -0,0 +1,8 @@ +gl-enable-enum-test.html +--max-version 1.9.9 gl-enum-tests.html +gl-get-calls.html +gl-geterror.html +--max-version 1.9.9 gl-getstring.html +--min-version 1.0.4 gl-initial-state.html +--max-version 1.9.9 gl-object-get-calls.html +--min-version 1.0.3 state-uneffected-after-compositing.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/diffs.txt b/dom/canvas/test/webgl-conf/checkout/conformance/state/diffs.txt new file mode 100644 index 000000000..24a17204f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/diffs.txt @@ -0,0 +1,69 @@ +4c4 +< ** Copyright (c) 2012 The Khronos Group Inc. +--- +> ** Copyright (c) 2015 The Khronos Group Inc. +34c34 +< +--- +> +45,62c45 +< 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(); +--- +> var gl = wtu.create3DContext(null, null, 2); +191a175,178 +> var validArray = new Array(gl.COLOR_ATTACHMENT0, gl.DEPTH_ATTACHMENT, gl.STENCIL_ATTACHMENT, gl.DEPTH_STENCIL_ATTACHMENT); +> for (var ii = 1; ii < gl.getParameter(gl.MAX_COLOR_ATTACHMENTS); ++ii) { +> validArray[validArray.length] = gl.COLOR_ATTACHMENT0 + ii; +> } +195,199c182 +< [ gl.COLOR_ATTACHMENT0, +< gl.DEPTH_ATTACHMENT, +< gl.STENCIL_ATTACHMENT, +< gl.DEPTH_STENCIL_ATTACHMENT +< ], +--- +> validArray, +257a241 +> gl.RENDERBUFFER_SAMPLES, +325c309 +< var boolProgram = wtu.loadProgramFromFile(gl, "../resources/boolUniformShader.vert", "../resources/noopUniformShader.frag"); +--- +> var boolProgram = wtu.loadProgramFromFile(gl, "../../conformance/resources/boolUniformShader.vert", "../../conformance/resources/noopUniformShader.frag"); +342c326 +< var intProgram = wtu.loadProgramFromFile(gl, "../resources/intUniformShader.vert", "../resources/noopUniformShader.frag"); +--- +> var intProgram = wtu.loadProgramFromFile(gl, "../../conformance/resources/intUniformShader.vert", "../../conformance/resources/noopUniformShader.frag"); +359c343 +< var floatProgram = wtu.loadProgramFromFile(gl, "../resources/floatUniformShader.vert", "../resources/noopUniformShader.frag"); +--- +> var floatProgram = wtu.loadProgramFromFile(gl, "../../conformance/resources/floatUniformShader.vert", "../../conformance/resources/noopUniformShader.frag"); +376c360 +< var samplerProgram = wtu.loadProgramFromFile(gl, "../resources/noopUniformShader.vert", "../resources/samplerUniformShader.frag"); +--- +> var samplerProgram = wtu.loadProgramFromFile(gl, "../../conformance/resources/noopUniformShader.vert", "../../conformance/resources/samplerUniformShader.frag"); +387c371 +< var matProgram = wtu.loadProgramFromFile(gl, "../resources/matUniformShader.vert", "../resources/noopUniformShader.frag"); +--- +> var matProgram = wtu.loadProgramFromFile(gl, "../../conformance/resources/matUniformShader.vert", "../../conformance/resources/noopUniformShader.frag"); +438c422,423 +< gl.CURRENT_VERTEX_ATTRIB +--- +> gl.CURRENT_VERTEX_ATTRIB, +> gl.VERTEX_ATTRIB_ARRAY_DIVISOR diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html new file mode 100644 index 000000000..c58b26e15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html @@ -0,0 +1,161 @@ + + + + + + +WebGL gl.ENABLE enums Conformance Tests + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html new file mode 100644 index 000000000..96fac1276 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html @@ -0,0 +1,50 @@ + + + + + + +WebGL gl enums Conformance Tests + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html new file mode 100644 index 000000000..46677de1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html @@ -0,0 +1,219 @@ + + + + + + +WebGL gl calls Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html new file mode 100644 index 000000000..037abca8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html @@ -0,0 +1,99 @@ + + + + + + +WebGL get error conformance test. + + + + + + + +
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html new file mode 100644 index 000000000..9e1bb26d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html @@ -0,0 +1,81 @@ + + + + + + +WebGL gl.getParameter Strings Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html new file mode 100644 index 000000000..5968299d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html @@ -0,0 +1,79 @@ + + + + + + +WebGL gl.getParameter initial values Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html new file mode 100644 index 000000000..0b3db6642 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html @@ -0,0 +1,47 @@ + + + + + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html new file mode 100644 index 000000000..e477734a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html @@ -0,0 +1,107 @@ + + + + + + +WebGL: Check that state is not lost by compositing + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt new file mode 100644 index 000000000..8af9a1384 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt @@ -0,0 +1,14 @@ +misc/00_test_list.txt +canvas/00_test_list.txt +--min-version 1.0.4 canvas_sub_rectangle/00_test_list.txt +image/00_test_list.txt +image_data/00_test_list.txt +--min-version 1.0.4 svg_image/00_test_list.txt +video/00_test_list.txt +webgl_canvas/00_test_list.txt +// image_bitmap_from_image_data/00_test_list.txt +// image_bitmap_from_image/00_test_list.txt +// image_bitmap_from_video/00_test_list.txt +// image_bitmap_from_canvas/00_test_list.txt +// image_bitmap_from_blob/00_test_list.txt +// image_bitmap_from_image_bitmap/00_test_list.txt diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..73ff34d33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..3e2d1935a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..7165150e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..38b4ec8fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..09819c299 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..e1dc7a51b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..cb08f2123 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..a61dd03d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..1050125c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..46a3888f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..389d24113 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..3377531b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..2bfe11ca8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..89bfefe93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..99dc50712 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..6755871ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..5174b0234 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..85c3461fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..d04819d42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..4532ef4a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..de01ffdb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..3bcdc7a9e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..afb442655 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..8b1a3fdb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..e675b7b3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..5dd21fb36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..1323f7c23 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..88bf5fe40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..b1a9d1c19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..36f6d02a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..d8f9a773a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..e18773fb7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..b896329ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..ecd52d07b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..70a1f0e1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..901d1ce28 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..39d2e0c13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..231972ea1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..d8c6bb45a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..3d5df92a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..1057e4397 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..31b178f66 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..5e3492f53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..65896e7f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..fdc4c39d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..e9c9684a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..e1c20e9f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..2b3a9720c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..33f76ff6f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..e60051e80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt new file mode 100644 index 000000000..505826de4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt @@ -0,0 +1,42 @@ +--max-version 1.9.9 compressed-tex-image.html +copy-tex-image-and-sub-image-2d.html +--min-version 1.0.2 copy-tex-image-2d-formats.html +--min-version 1.0.4 copy-tex-sub-image-2d-partial-texture.html +--min-version 1.0.4 cube-incomplete-fbo.html +--min-version 1.0.3 default-texture.html +--min-version 1.0.2 --max-version 1.9.9 gl-get-tex-parameter.html +gl-pixelstorei.html +gl-teximage.html +origin-clean-conformance.html +tex-image-and-sub-image-2d-with-array-buffer-view.html +tex-image-and-uniform-binding-bugs.html +--min-version 1.0.3 tex-image-canvas-corruption.html +--min-version 1.0.2 tex-image-webgl.html +tex-image-with-format-and-type.html +tex-image-with-invalid-data.html +--max-version 1.9.9 tex-input-validation.html +tex-sub-image-2d-bad-args.html +tex-sub-image-2d.html +texparameter-test.html +texture-active-bind-2.html +texture-active-bind.html +--min-version 1.0.2 texture-attachment-formats.html +--min-version 1.0.2 texture-clear.html +texture-complete.html +--min-version 1.0.3 texture-copying-feedback-loops.html +--min-version 1.0.4 texture-cube-as-fbo-attachment.html +--min-version 1.0.2 texture-hd-dpi.html +--min-version 1.0.2 --max-version 1.9.9 texture-formats-test.html +texture-mips.html +--max-version 1.9.9 texture-npot-video.html +--max-version 1.9.9 texture-npot.html +texture-size.html +texture-size-cube-maps.html +--min-version 1.0.2 texture-size-limit.html +--min-version 1.0.2 texture-sub-image-cube-maps.html +texture-transparent-pixels-initialized.html +--min-version 1.0.2 texture-upload-cube-maps.html +--min-version 1.0.3 texture-upload-size.html +--min-version 1.0.2 mipmap-fbo.html +--min-version 1.0.3 --max-version 1.9.9 texture-fakeblack.html +--min-version 1.0.3 texture-draw-with-2d-and-cube.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html new file mode 100644 index 000000000..80ab3109c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html @@ -0,0 +1,82 @@ + + + + + + +WebGL CompressedTexImage and CompressedTexSubImage Tests + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html new file mode 100644 index 000000000..49cf33499 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html @@ -0,0 +1,194 @@ + + + + + +Verify copyTexImage2D follows format restictions + + + + + + +
+ + +
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html new file mode 100644 index 000000000..bc5e2310c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-sub-image-2d-partial-texture.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-sub-image-2d-partial-texture.html new file mode 100644 index 000000000..3fa47a4c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-sub-image-2d-partial-texture.html @@ -0,0 +1,191 @@ + + + + + + +CopyTexSubImage2D partial destination texture test + + + + + +
+ +
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html new file mode 100644 index 000000000..a04e75aed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html @@ -0,0 +1,93 @@ + + + + + + +Test that cube incomplete textures can not be used as FBO attachments + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html new file mode 100644 index 000000000..a65975b7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html @@ -0,0 +1,63 @@ + + + + + + +Tests texture access with no texture bound + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html new file mode 100644 index 000000000..40caea725 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html @@ -0,0 +1,48 @@ + + + + + + +WebGL getTexParameter test + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html new file mode 100644 index 000000000..5ec41c965 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html @@ -0,0 +1,117 @@ + + + + + + +WebGL pixelStorei Test + + + + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html new file mode 100644 index 000000000..b6fa01afb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html @@ -0,0 +1,427 @@ + + + + + + +WebGL texImage2D conformance test. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html new file mode 100644 index 000000000..361179f8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html @@ -0,0 +1,130 @@ + + + + + + +Test if mipmap incomplete textures can be used as FBO attachments, and mipmap generation on a texture filled by an FBO works correctly + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html new file mode 100644 index 000000000..9d9acf727 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html @@ -0,0 +1,149 @@ + + + + + + +WebGL Origin Restrictions Conformance Tests + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html new file mode 100644 index 000000000..40cc019aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html @@ -0,0 +1,303 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html new file mode 100644 index 000000000..be836e2dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html @@ -0,0 +1,63 @@ + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html new file mode 100644 index 000000000..1976c53b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html @@ -0,0 +1,72 @@ + + + + + + +Testing 3D canvas is usable after being used as texImage2D source + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html new file mode 100644 index 000000000..829e14af6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html @@ -0,0 +1,99 @@ + + + + + + +WebGL texImage2D from WebGL conformance test. + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html new file mode 100644 index 000000000..af4cf4fbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html @@ -0,0 +1,743 @@ + + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html new file mode 100644 index 000000000..af8dcef6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html @@ -0,0 +1,179 @@ + + + + + + texImage2D and texSubImage2D tests with invalid data + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html new file mode 100644 index 000000000..451813848 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html @@ -0,0 +1,45 @@ + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html new file mode 100644 index 000000000..6eebc4b4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html @@ -0,0 +1,154 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html new file mode 100644 index 000000000..294663cc7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html new file mode 100644 index 000000000..06d06170c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html @@ -0,0 +1,150 @@ + + + + + + +WebGL TexParameter conformance test. + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html new file mode 100644 index 000000000..1a35e3cd4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html @@ -0,0 +1,231 @@ + + + + + + +WebGL ActiveTexture BindTexture conformance test #2 + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html new file mode 100644 index 000000000..5f7d74191 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html @@ -0,0 +1,140 @@ + + + + + + +WebGL ActiveTexture BindTexture conformance test. + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html new file mode 100644 index 000000000..8fa49f5d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html @@ -0,0 +1,197 @@ + + + + + + +WebGL Texture Attachment Format Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html new file mode 100644 index 000000000..7184ecc2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html @@ -0,0 +1,64 @@ + + + + + + +WebGL texture clear conformance test. + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html new file mode 100644 index 000000000..e95c0aa61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html @@ -0,0 +1,84 @@ + + + + + + +WebGL "Texture Complete" texture conformance test. + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html new file mode 100644 index 000000000..33c830ff6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html @@ -0,0 +1,103 @@ + + + + + + +WebGL Texture Copying Feedback Loops Test + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html new file mode 100644 index 000000000..dd3aa6fbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html @@ -0,0 +1,86 @@ + + + + + + +WebGL texture cube as FBO color attachment + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html new file mode 100644 index 000000000..630ecf91c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html @@ -0,0 +1,124 @@ + + + + + + +WebGL ActiveTexture BindTexture conformance test. + + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html new file mode 100644 index 000000000..b4f098a1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html @@ -0,0 +1,115 @@ + + + + + + +Tests if fake black textures are corectly implemented on desktops + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html new file mode 100644 index 000000000..3eb4cdd22 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html @@ -0,0 +1,287 @@ + + + + + + +WebGL Texture Format Conformance Tests + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html new file mode 100644 index 000000000..f06715a51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html @@ -0,0 +1,138 @@ + + + + + + +WebGL HD-DPI issues texture conformance test. + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html new file mode 100644 index 000000000..807bddf7a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html @@ -0,0 +1,318 @@ + + + + + + +WebGL texture mips conformance test. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html new file mode 100644 index 000000000..300f38f12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html @@ -0,0 +1,161 @@ + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html new file mode 100644 index 000000000..aa876bcb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html @@ -0,0 +1,326 @@ + + + + + + +WebGL Non-Power of 2 texture conformance test. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html new file mode 100644 index 000000000..e855a8072 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html @@ -0,0 +1,352 @@ + + + + + + +WebGL texture size cube map conformance test. + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html new file mode 100644 index 000000000..f2363a1d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html @@ -0,0 +1,171 @@ + + + + + + +WebGL texture size limit conformance test. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html new file mode 100644 index 000000000..89282495d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html @@ -0,0 +1,234 @@ + + + + + + +WebGL texture size conformance test. + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html new file mode 100644 index 000000000..c3ba904ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html @@ -0,0 +1,337 @@ + + + + + + +WebGL texture texSubImage2Ds cube map conformance test. + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html new file mode 100644 index 000000000..fc87f7fbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html @@ -0,0 +1,106 @@ + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html new file mode 100644 index 000000000..6618ff8c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html @@ -0,0 +1,73 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html new file mode 100644 index 000000000..b5b5a12e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html @@ -0,0 +1,169 @@ + + + + + + +WebGL texture upload size conformance test + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..0497a33e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..dba7ce559 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..f26490a74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..7bd9d9976 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..c0e8f9c06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..a32d53737 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..d61089ca5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..2c47f7a00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..6f0025671 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..a42ea67ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt new file mode 100644 index 000000000..07f29f640 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt @@ -0,0 +1,5 @@ +tex-2d-rgb-rgb-unsigned_byte.html +tex-2d-rgb-rgb-unsigned_short_5_6_5.html +tex-2d-rgba-rgba-unsigned_byte.html +tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..9cb3e37b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..f38dfef8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..e5bb12e06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..ef252e0d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..76878aef5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt new file mode 100644 index 000000000..732aad646 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt @@ -0,0 +1,7 @@ +array-buffer-crash.html +array-buffer-view-crash.html +array-unit-tests.html +data-view-crash.html +data-view-test.html +--min-version 1.0.2 typed-arrays-in-workers.html +--min-version 1.0.3 array-large-array-tests.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html new file mode 100644 index 000000000..9f34898f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html @@ -0,0 +1,61 @@ + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html new file mode 100644 index 000000000..50fe6d7fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html @@ -0,0 +1,60 @@ + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html new file mode 100644 index 000000000..8af76136a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html @@ -0,0 +1,102 @@ + + + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html new file mode 100644 index 000000000..c2e0fd7c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html @@ -0,0 +1,1124 @@ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html new file mode 100644 index 000000000..dbf8c5a12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html @@ -0,0 +1,54 @@ + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html new file mode 100644 index 000000000..ea032dddd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html @@ -0,0 +1,442 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html new file mode 100644 index 000000000..2404fc2fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html @@ -0,0 +1,278 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt new file mode 100644 index 000000000..008515acb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt @@ -0,0 +1,12 @@ +gl-uniform-arrays.html +# This test is no longer valid with the new packing restrictions +#--min-version 1.0.02 gl-uniform-unused-array-elements-get-truncated.html +gl-uniform-bool.html +gl-uniformmatrix4fv.html +gl-unknown-uniform.html +null-uniform-location.html +--min-version 1.0.2 out-of-bounds-uniform-array-access.html +--min-version 1.0.2 uniform-default-values.html +--min-version 1.0.3 uniform-values-per-program.html +uniform-location.html +uniform-samplers-test.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html new file mode 100644 index 000000000..c424db6f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html @@ -0,0 +1,510 @@ + + + + + + +WebGL uniform array Conformance Tests + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html new file mode 100644 index 000000000..be2a15998 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html @@ -0,0 +1,80 @@ + + + + + + +WebGL uniformMatrix Conformance Tests + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html new file mode 100644 index 000000000..b5d98f903 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html @@ -0,0 +1,104 @@ + + + + + + +WebGL uniform struct Conformance Test + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html new file mode 100644 index 000000000..f64854757 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html @@ -0,0 +1,135 @@ + + + + + + +WebGL uniform unused array elements get truncated Conformance Test + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html new file mode 100644 index 000000000..08e04d449 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html @@ -0,0 +1,110 @@ + + + + + + +WebGL uniformMatrix Conformance Tests + + + + + +
+
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html new file mode 100644 index 000000000..da852c24d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html @@ -0,0 +1,88 @@ + + + + + + +WebGL Unknown Uniform Conformance Test + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html new file mode 100644 index 000000000..3626765ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html @@ -0,0 +1,102 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html new file mode 100644 index 000000000..02c3b44fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html @@ -0,0 +1,189 @@ + + + + + + +WebGL out of bounds uniform array access. + + + + + +
+ + +
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html new file mode 100644 index 000000000..f16d0fd8b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html @@ -0,0 +1,360 @@ + + + + + + +WebGL uniform default values + + + + + + +
+
+ + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html new file mode 100644 index 000000000..5b5ddc7c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html @@ -0,0 +1,115 @@ + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html new file mode 100644 index 000000000..cb4768a75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html @@ -0,0 +1,132 @@ + + + + + + +WebGL sampler uniforms conformance test. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html new file mode 100644 index 000000000..2edf82d03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html @@ -0,0 +1,200 @@ + + + + + + +WebGL uniform values are per program conformance test. + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt new file mode 100644 index 000000000..c815d83d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt @@ -0,0 +1,16 @@ +attribs/00_test_list.txt +buffers/00_test_list.txt +context/00_test_list.txt +extensions/00_test_list.txt +glsl3/00_test_list.txt +misc/00_test_list.txt +programs/00_test_list.txt +query/00_test_list.txt +reading/00_test_list.txt +renderbuffers/00_test_list.txt +rendering/00_test_list.txt +samplers/00_test_list.txt +state/00_test_list.txt +textures/00_test_list.txt +transform_feedback/00_test_list.txt +vertex_arrays/00_test_list.txt diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/00_test_list.txt new file mode 100644 index 000000000..ae27d5e7c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/00_test_list.txt @@ -0,0 +1,4 @@ +gl-vertex-attrib.html +gl-vertex-attrib-i-render.html +gl-vertexattribipointer.html +gl-vertexattribipointer-offsets.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib-i-render.html b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib-i-render.html new file mode 100644 index 000000000..8c87fdbe6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib-i-render.html @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib.html b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib.html new file mode 100644 index 000000000..d2a0b9b48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertex-attrib.html @@ -0,0 +1,49 @@ + + + + + + +WebGL vertexAttrib Conformance Tests + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer-offsets.html b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer-offsets.html new file mode 100644 index 000000000..eb380940e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer-offsets.html @@ -0,0 +1,175 @@ + + + + + + +vertexAttribIPointer offsets tests + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer.html new file mode 100644 index 000000000..399429981 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/attribs/gl-vertexattribipointer.html @@ -0,0 +1,143 @@ + + + + + + +WebGL vertexAttribIPointer Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/00_test_list.txt new file mode 100644 index 000000000..96921fbea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/00_test_list.txt @@ -0,0 +1,9 @@ +bound-buffer-size-change-test.html +buffer-copying-contents.html +buffer-copying-restrictions.html +buffer-data-and-buffer-sub-data-sub-source.html +buffer-type-restrictions.html +buffer-overflow-test.html +get-buffer-sub-data.html +one-large-uniform-buffer.html +uniform-buffers.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/bound-buffer-size-change-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/bound-buffer-size-change-test.html new file mode 100644 index 000000000..a9d13496a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/bound-buffer-size-change-test.html @@ -0,0 +1,140 @@ + + + + + + +WebGL buffer size change test for bindBufferBase/bindBufferRange + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-contents.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-contents.html new file mode 100644 index 000000000..8006f2181 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-contents.html @@ -0,0 +1,197 @@ + + + + + + +WebGL buffer copying contents test. + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-restrictions.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-restrictions.html new file mode 100644 index 000000000..1833c53fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-copying-restrictions.html @@ -0,0 +1,123 @@ + + + + + + +WebGL buffer copying restrictions test. + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-data-and-buffer-sub-data-sub-source.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-data-and-buffer-sub-data-sub-source.html new file mode 100644 index 000000000..dbf7d45e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-data-and-buffer-sub-data-sub-source.html @@ -0,0 +1,204 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-overflow-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-overflow-test.html new file mode 100644 index 000000000..929692df8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-overflow-test.html @@ -0,0 +1,72 @@ + + + + + + +WebGL buffer overflow test for bindBufferRange + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-type-restrictions.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-type-restrictions.html new file mode 100644 index 000000000..57a8a8fbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/buffer-type-restrictions.html @@ -0,0 +1,141 @@ + + + + + + +WebGL buffer binding restrictions test. + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/get-buffer-sub-data.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/get-buffer-sub-data.html new file mode 100644 index 000000000..6026cc5cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/get-buffer-sub-data.html @@ -0,0 +1,176 @@ + + + + + + +WebGL getBufferSubData test. + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/getBufferSubData.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/getBufferSubData.html new file mode 100644 index 000000000..d751e8070 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/getBufferSubData.html @@ -0,0 +1,105 @@ + + + + + + +WebGL getBufferSubData test. + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/one-large-uniform-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/one-large-uniform-buffer.html new file mode 100644 index 000000000..5265e1dbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/one-large-uniform-buffer.html @@ -0,0 +1,152 @@ + + + + + + +WebGL Uniform Buffers Conformance Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/uniform-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/uniform-buffers.html new file mode 100644 index 000000000..8fc8db756 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/uniform-buffers.html @@ -0,0 +1,428 @@ + + + + + + +WebGL Uniform Buffers Conformance Tests + + + + + + + + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/context/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/context/00_test_list.txt new file mode 100644 index 000000000..e7cf36a35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/context/00_test_list.txt @@ -0,0 +1,4 @@ +constants-and-properties-2.html +context-attributes-depth-stencil-antialias-obeyed.html +context-type-test-2.html +methods-2.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/context/constants-and-properties-2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/context/constants-and-properties-2.html new file mode 100644 index 000000000..f2559f79c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/context/constants-and-properties-2.html @@ -0,0 +1,855 @@ + + + + + +WebGL2 Constants and Properties Test + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/context/context-attributes-depth-stencil-antialias-obeyed.html b/dom/canvas/test/webgl-conf/checkout/conformance2/context/context-attributes-depth-stencil-antialias-obeyed.html new file mode 100644 index 000000000..4d0c0966c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/context/context-attributes-depth-stencil-antialias-obeyed.html @@ -0,0 +1,110 @@ + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/context/context-type-test-2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/context/context-type-test-2.html new file mode 100644 index 000000000..27f8ef21b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/context/context-type-test-2.html @@ -0,0 +1,72 @@ + + + + + + +WebGL2 Canvas Conformance Tests + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/context/methods-2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/context/methods-2.html new file mode 100644 index 000000000..4dbf368b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/context/methods-2.html @@ -0,0 +1,329 @@ + + + + + +WebGL2 Methods Test + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/00_test_list.txt new file mode 100644 index 000000000..7ce7c8b57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/00_test_list.txt @@ -0,0 +1,4 @@ +ext-color-buffer-float.html +ext-disjoint-timer-query-webgl2.html +promoted-extensions.html +promoted-extensions-in-shaders.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-color-buffer-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-color-buffer-float.html new file mode 100644 index 000000000..58cb9becd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-color-buffer-float.html @@ -0,0 +1,419 @@ + + + + + + +WebGL EXT_color_buffer_float Conformance Tests + + + + + +
+ +
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html new file mode 100644 index 000000000..8969c108a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html @@ -0,0 +1,335 @@ + + + + + + +WebGL 2 EXT_disjoint_timer_query_webgl2 Conformance Tests + + + + + +
+ +
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions-in-shaders.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions-in-shaders.html new file mode 100644 index 000000000..8892adec5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions-in-shaders.html @@ -0,0 +1,136 @@ + + + + + + +Extensions promoted to core should not be possible to use in shaders + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions.html new file mode 100644 index 000000000..fe93eeec7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/promoted-extensions.html @@ -0,0 +1,86 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/00_test_list.txt new file mode 100644 index 000000000..68815488b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/00_test_list.txt @@ -0,0 +1,40 @@ +array-as-return-value.html +array-assign.html +array-assign-constructor.html +array-complex-indexing.html +array-element-increment.html +array-equality.html +array-in-complex-expression.html +array-length-side-effects.html +attrib-location-length-limits.html +bool-type-cast-bug-uint-ivec-uvec.html +compare-structs-containing-arrays.html +compound-assignment-type-combination.html +const-array-init.html +forbidden-operators.html +frag-depth.html +invalid-default-precision.html +invalid-invariant.html +loops-with-side-effects.html +misplaced-version-directive.html +--min-version 2.0.1 no-attribute-vertex-shader.html +sampler-no-precision.html +sequence-operator-returns-non-constant.html +shader-linking.html +shader-with-1024-character-define.html +shader-with-1024-character-identifier.frag.html +shader-with-1025-character-define.html +shader-with-1025-character-identifier.frag.html +shader-with-invalid-characters.html +shader-with-mis-matching-uniform-block.html +short-circuiting-in-loop-condition.html +texture-offset-out-of-range.html +--min-version 2.0.1 texture-offset-uniform-texture-coordinate.html +--min-version 2.0.1 tricky-loop-conditions.html +--min-version 2.0.1 unary-minus-operator-in-dynamic-loop.html +uniform-block-layouts.html +uniform-block-layout-match.html +uniform-location-length-limits.html +valid-invariant.html +vector-dynamic-indexing.html +--min-version 2.0.1 vector-dynamic-indexing-nv-driver-bug.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-as-return-value.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-as-return-value.html new file mode 100644 index 000000000..7138aaf82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-as-return-value.html @@ -0,0 +1,171 @@ + + + + + + +GLSL array as return value test + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign-constructor.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign-constructor.html new file mode 100644 index 000000000..ce47b2419 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign-constructor.html @@ -0,0 +1,129 @@ + + + + + + +GLSL array constructor assignment test + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign.html new file mode 100644 index 000000000..845fdcad5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-assign.html @@ -0,0 +1,114 @@ + + + + + + +GLSL array assignment test + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-complex-indexing.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-complex-indexing.html new file mode 100644 index 000000000..c7dc1106a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-complex-indexing.html @@ -0,0 +1,108 @@ + + + + + + +GLSL Indexing complex array expressions + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-element-increment.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-element-increment.html new file mode 100644 index 000000000..17946aea3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-element-increment.html @@ -0,0 +1,152 @@ + + + + + + +GLSL initialized array element increment/decrement test + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-equality.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-equality.html new file mode 100644 index 000000000..e810885f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-equality.html @@ -0,0 +1,106 @@ + + + + + + +GLSL array equality test + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-in-complex-expression.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-in-complex-expression.html new file mode 100644 index 000000000..8752acb26 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-in-complex-expression.html @@ -0,0 +1,165 @@ + + + + + + +GLSL array in complex expression test + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-length-side-effects.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-length-side-effects.html new file mode 100644 index 000000000..68df48073 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/array-length-side-effects.html @@ -0,0 +1,106 @@ + + + + + + +GLSL: test that length() method called on a complex expression does not compile + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/attrib-location-length-limits.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/attrib-location-length-limits.html new file mode 100644 index 000000000..7f8c6581b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/attrib-location-length-limits.html @@ -0,0 +1,110 @@ + + + + + + +WebGL attrib location length tests + + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
Verify limits on the lengths of attribute locations per WebGL 2 spec "Maximum Uniform and Attribute Location Lengths"
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/bool-type-cast-bug-uint-ivec-uvec.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/bool-type-cast-bug-uint-ivec-uvec.html new file mode 100644 index 000000000..5749d1990 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/bool-type-cast-bug-uint-ivec-uvec.html @@ -0,0 +1,389 @@ + + + + + + +Verify uint(bool), ivec(bvec), and uvec(bvec) work correctly (Mac AMD driver bug) + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compare-structs-containing-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compare-structs-containing-arrays.html new file mode 100644 index 000000000..26f2eb930 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compare-structs-containing-arrays.html @@ -0,0 +1,107 @@ + + + + + + +GLSL array equality test with structs containing arrays + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compound-assignment-type-combination.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compound-assignment-type-combination.html new file mode 100644 index 000000000..2ec40fa4f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/compound-assignment-type-combination.html @@ -0,0 +1,47 @@ + + + + + + +Result type should match the l-value type in compound assignment + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/const-array-init.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/const-array-init.html new file mode 100644 index 000000000..139aec188 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/const-array-init.html @@ -0,0 +1,119 @@ + + + + + + +Constant array initialization test + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/forbidden-operators.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/forbidden-operators.html new file mode 100644 index 000000000..ddc1626bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/forbidden-operators.html @@ -0,0 +1,145 @@ + + + + + + +WebGL GLSL Conformance Tests - Unsupported variants of operators + + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/frag-depth.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/frag-depth.html new file mode 100644 index 000000000..818248687 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/frag-depth.html @@ -0,0 +1,178 @@ + + + + + + +WebGL Frag Depth Conformance Tests + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-default-precision.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-default-precision.html new file mode 100644 index 000000000..dbbdf7e90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-default-precision.html @@ -0,0 +1,92 @@ + + + + + + +Default precision qualifiers should only work with int, float and sampler types + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-invariant.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-invariant.html new file mode 100644 index 000000000..c24e02724 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/invalid-invariant.html @@ -0,0 +1,109 @@ + + + + + + +Negative tests for the use of the invariant qualifier and pragma + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/loops-with-side-effects.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/loops-with-side-effects.html new file mode 100644 index 000000000..b3d36c928 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/loops-with-side-effects.html @@ -0,0 +1,232 @@ + + + + + + +WebGL Loops and side-effects test + + + + + +
+ +
+ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/misplaced-version-directive.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/misplaced-version-directive.html new file mode 100644 index 000000000..12816dda6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/misplaced-version-directive.html @@ -0,0 +1,132 @@ + + + + + + +#version directive should be on the very first line of a OpenGL ES Shading Language 3.00 shader + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/no-attribute-vertex-shader.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/no-attribute-vertex-shader.html new file mode 100644 index 000000000..eaf698572 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/no-attribute-vertex-shader.html @@ -0,0 +1,84 @@ + + + + + + +Test no attribute vertex shaders + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sampler-no-precision.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sampler-no-precision.html new file mode 100644 index 000000000..ae79373c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sampler-no-precision.html @@ -0,0 +1,109 @@ + + + + + + +GLSL sampler with no precision qualifier test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sequence-operator-returns-non-constant.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sequence-operator-returns-non-constant.html new file mode 100644 index 000000000..6841e0aa0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/sequence-operator-returns-non-constant.html @@ -0,0 +1,80 @@ + + + + + + +Sequence operator returns non-constant test + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-linking.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-linking.html new file mode 100644 index 000000000..1b05ff0db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-linking.html @@ -0,0 +1,105 @@ + + + + + + +OpenGL ES Shading Language 1.00 and OpenGL ES Shading Language 3.00 shaders should not link with each other + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-define.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-define.html new file mode 100644 index 000000000..f249c8400 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-define.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-identifier.frag.html new file mode 100644 index 000000000..9c57f3a48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-identifier.frag.html @@ -0,0 +1,126 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-define.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-define.html new file mode 100644 index 000000000..2fac28859 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-define.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-identifier.frag.html new file mode 100644 index 000000000..420a7094b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-identifier.frag.html @@ -0,0 +1,57 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-invalid-characters.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-invalid-characters.html new file mode 100644 index 000000000..cc08a22b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-invalid-characters.html @@ -0,0 +1,58 @@ + + + + + + +WebGL GLSL Conformance Tests + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-mis-matching-uniform-block.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-mis-matching-uniform-block.html new file mode 100644 index 000000000..5de678c4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-mis-matching-uniform-block.html @@ -0,0 +1,80 @@ + + + + + + +GLSL mis-matching uniform block + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/short-circuiting-in-loop-condition.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/short-circuiting-in-loop-condition.html new file mode 100644 index 000000000..b4551c537 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/short-circuiting-in-loop-condition.html @@ -0,0 +1,190 @@ + + + + + + +Short circuit in loop condition test + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-out-of-range.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-out-of-range.html new file mode 100644 index 000000000..eaac00887 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-out-of-range.html @@ -0,0 +1,127 @@ + + + + + + +GLSL out-of-range texture offset test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-uniform-texture-coordinate.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-uniform-texture-coordinate.html new file mode 100644 index 000000000..29895cdde --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-uniform-texture-coordinate.html @@ -0,0 +1,191 @@ + + + + + + +GLSL texture offset with uniform texture coordinates test + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/tricky-loop-conditions.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/tricky-loop-conditions.html new file mode 100644 index 000000000..9b3aad0fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/tricky-loop-conditions.html @@ -0,0 +1,348 @@ + + + + + + +GLSL tricky loop conditions and loop expressions + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/unary-minus-operator-in-dynamic-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/unary-minus-operator-in-dynamic-loop.html new file mode 100644 index 000000000..f43cc4f3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/unary-minus-operator-in-dynamic-loop.html @@ -0,0 +1,269 @@ + + + + + + + +Unary minus operator on int or uint variables in a dynamic loop in vertex shader should work + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layout-match.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layout-match.html new file mode 100644 index 000000000..bf837650f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layout-match.html @@ -0,0 +1,78 @@ + + + + + + +WebGL2 Uniform Block Layout Behavior Testing + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layouts.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layouts.html new file mode 100644 index 000000000..2dea0cd79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-block-layouts.html @@ -0,0 +1,84 @@ + + + + + + +Disallowed uniform block layouts + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-location-length-limits.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-location-length-limits.html new file mode 100644 index 000000000..0fc873866 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-location-length-limits.html @@ -0,0 +1,110 @@ + + + + + + +WebGL uniform location length tests + + + + + + + +There is supposed to be an example drawing here, but it's not important. + +
Verify limits on the lengths of uniform locations per WebGL 2 spec, "Maximum Uniform and Attribute Location Lengths".
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/valid-invariant.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/valid-invariant.html new file mode 100644 index 000000000..87354dc8b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/valid-invariant.html @@ -0,0 +1,116 @@ + + + + + + +Positive tests for the use of the invariant qualifier and pragma + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug.html new file mode 100644 index 000000000..c5945eff0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug.html @@ -0,0 +1,88 @@ + + + + + + +GLSL dynamic vector and matrix indexing test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing.html new file mode 100644 index 000000000..8628ec606 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/vector-dynamic-indexing.html @@ -0,0 +1,370 @@ + + + + + + +GLSL dynamic vector and matrix indexing test + + + + + + +
+
+ + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/00_test_list.txt new file mode 100644 index 000000000..d272e1a03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/00_test_list.txt @@ -0,0 +1,6 @@ +expando-loss-2.html +getextension-while-pbo-bound-stability.html +instanceof-test.html +object-deletion-behaviour-2.html +uninitialized-test-2.html +views-with-offsets.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/misc/expando-loss-2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/expando-loss-2.html new file mode 100644 index 000000000..06c4c11e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/expando-loss-2.html @@ -0,0 +1,305 @@ + + + + + + + + +WebGL 2 Object Expandos Conformance Test + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/misc/getextension-while-pbo-bound-stability.html b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/getextension-while-pbo-bound-stability.html new file mode 100644 index 000000000..e8ddcea8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/getextension-while-pbo-bound-stability.html @@ -0,0 +1,78 @@ + + + + + + +WebGL2 getExtension while PBO bound stability conformance test. + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/misc/instanceof-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/instanceof-test.html new file mode 100644 index 000000000..5cf3dedf0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/instanceof-test.html @@ -0,0 +1,65 @@ + + + + + + +WebGL instanceof test. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/misc/object-deletion-behaviour-2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/object-deletion-behaviour-2.html new file mode 100644 index 000000000..0157be957 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/object-deletion-behaviour-2.html @@ -0,0 +1,136 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/misc/uninitialized-test-2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/uninitialized-test-2.html new file mode 100644 index 000000000..39c439aec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/uninitialized-test-2.html @@ -0,0 +1,572 @@ + + + + + +WebGL 2 Uninitialized GL Resources Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/misc/views-with-offsets.html b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/views-with-offsets.html new file mode 100644 index 000000000..70b1d7ccf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/misc/views-with-offsets.html @@ -0,0 +1,341 @@ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/programs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/00_test_list.txt new file mode 100644 index 000000000..8f3726fdd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/00_test_list.txt @@ -0,0 +1,2 @@ +active-built-in-attribs.html +gl-get-frag-data-location.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/programs/active-built-in-attribs.html b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/active-built-in-attribs.html new file mode 100644 index 000000000..5818e2b3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/active-built-in-attribs.html @@ -0,0 +1,107 @@ + + + + + + +WebGL Conformance Tests: Verify validation for active built-in attribs + + + + + + +
+ +
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/programs/gl-get-frag-data-location.html b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/gl-get-frag-data-location.html new file mode 100644 index 000000000..dba36e58c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/gl-get-frag-data-location.html @@ -0,0 +1,121 @@ + + + + + + +WebGL Conformance Tests: Verify getFragDataLocation + + + + + + +
+ +
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/query/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/query/00_test_list.txt new file mode 100644 index 000000000..c40921bf8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/query/00_test_list.txt @@ -0,0 +1,2 @@ +occlusion-query.html +query.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query.html b/dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query.html new file mode 100644 index 000000000..cba410e77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query.html @@ -0,0 +1,158 @@ + + + + + + +WebGL Occlusion Query Conformance Tests + + + + + +
+ +
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/query/query.html b/dom/canvas/test/webgl-conf/checkout/conformance2/query/query.html new file mode 100644 index 000000000..79e2403b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/query/query.html @@ -0,0 +1,178 @@ + + + + + + +WebGL Query Conformance Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/reading/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/00_test_list.txt new file mode 100644 index 000000000..d5fe8b664 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/00_test_list.txt @@ -0,0 +1,5 @@ +--min-version 2.0.1 format-r11f-g11f-b10f.html +read-pixels-from-fbo-test.html +--min-version 2.0.1 read-pixels-from-rgb8-into-pbo-bug.html +read-pixels-into-pixel-pack-buffer.html +read-pixels-pack-parameters.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/reading/format-r11f-g11f-b10f.html b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/format-r11f-g11f-b10f.html new file mode 100644 index 000000000..9c1af964d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/format-r11f-g11f-b10f.html @@ -0,0 +1,287 @@ + + + + + + +Test Format R11F_G11F_B10F + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-fbo-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-fbo-test.html new file mode 100644 index 000000000..c9cf15d9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-fbo-test.html @@ -0,0 +1,659 @@ + + + + + + +WebGL 2 ReadPixels Test. + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-rgb8-into-pbo-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-rgb8-into-pbo-bug.html new file mode 100644 index 000000000..b81986961 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-from-rgb8-into-pbo-bug.html @@ -0,0 +1,106 @@ + + + + + + +WebGL 2 Conformance Test: readPixels from RGB8 Buffer Into Pixel Pack Buffer. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-into-pixel-pack-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-into-pixel-pack-buffer.html new file mode 100644 index 000000000..b9e8bf9c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-into-pixel-pack-buffer.html @@ -0,0 +1,173 @@ + + + + + + +WebGL 2 Conformance Test: ReadPixels Into Pixel Pack Buffer. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-pack-parameters.html b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-pack-parameters.html new file mode 100644 index 000000000..bcceae395 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/reading/read-pixels-pack-parameters.html @@ -0,0 +1,373 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/00_test_list.txt new file mode 100644 index 000000000..6445c9d48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/00_test_list.txt @@ -0,0 +1,7 @@ +framebuffer-object-attachment.html +framebuffer-test.html +framebuffer-texture-layer.html +invalidate-framebuffer.html +multisampled-renderbuffer-initialization.html +--min-version 2.0.1 multisample-with-full-sample-counts.html +readbuffer.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-object-attachment.html b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-object-attachment.html new file mode 100644 index 000000000..d4963e606 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-object-attachment.html @@ -0,0 +1,427 @@ + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-test.html new file mode 100644 index 000000000..135531d22 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-test.html @@ -0,0 +1,309 @@ + + + + + + +WebGL Framebuffer Test Against WebGL 2 + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-texture-layer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-texture-layer.html new file mode 100644 index 000000000..1b5fb694a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/framebuffer-texture-layer.html @@ -0,0 +1,165 @@ + + + + + + +WebGL FramebufferTextureLayer Test + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/invalidate-framebuffer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/invalidate-framebuffer.html new file mode 100644 index 000000000..b4811ab3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/invalidate-framebuffer.html @@ -0,0 +1,173 @@ + + + + + + +Invalidate Framebuffer Against WebGL 2 + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisample-with-full-sample-counts.html b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisample-with-full-sample-counts.html new file mode 100644 index 000000000..0a3f3ef4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisample-with-full-sample-counts.html @@ -0,0 +1,119 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisampled-renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisampled-renderbuffer-initialization.html new file mode 100644 index 000000000..58f2286ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/multisampled-renderbuffer-initialization.html @@ -0,0 +1,150 @@ + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/readbuffer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/readbuffer.html new file mode 100644 index 000000000..5be3c522b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/renderbuffers/readbuffer.html @@ -0,0 +1,195 @@ + + + + + + +Test readBuffer Against WebGL 2 + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/00_test_list.txt new file mode 100644 index 000000000..7aed37329 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/00_test_list.txt @@ -0,0 +1,25 @@ +attrib-type-match.html +blitframebuffer-filter-outofbounds.html +blitframebuffer-filter-srgb.html +blitframebuffer-multisampled-readbuffer.html +--min-version 2.0.1 blitframebuffer-outside-readbuffer.html +blitframebuffer-scissor-enabled.html +blitframebuffer-size-overflow.html +--min-version 2.0.1 blitframebuffer-srgb-and-linear-drawbuffers.html +--min-version 2.0.1 blitframebuffer-stencil-only.html +blitframebuffer-test.html +canvas-resizing-with-pbo-bound.html +clear-func-buffer-type-match.html +--min-version 2.0.1 clear-srgb-color-buffer.html +--min-version 2.0.1 clipping-wide-points.html +draw-buffers.html +element-index-uint.html +framebuffer-completeness-unaffected.html +framebuffer-unsupported.html +--min-version 2.0.1 fs-color-type-mismatch-color-buffer-type.html +instanced-arrays.html +--min-version 2.0.1 instanced-rendering-bug.html +out-of-bounds-index-buffers-after-copying.html +--min-version 2.0.1 rendering-sampling-feedback-loop.html +rgb-format-support.html +uniform-block-buffer-size.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/attrib-type-match.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/attrib-type-match.html new file mode 100644 index 000000000..5d810187f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/attrib-type-match.html @@ -0,0 +1,582 @@ + + + + + + +WebGL Conformance Tests: Vertex Attribute Type Match + + + + + + +
+ +
+ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-outofbounds.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-outofbounds.html new file mode 100644 index 000000000..358465214 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-outofbounds.html @@ -0,0 +1,199 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-srgb.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-srgb.html new file mode 100644 index 000000000..7cce19513 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-filter-srgb.html @@ -0,0 +1,183 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-multisampled-readbuffer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-multisampled-readbuffer.html new file mode 100644 index 000000000..568442a01 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-multisampled-readbuffer.html @@ -0,0 +1,134 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-outside-readbuffer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-outside-readbuffer.html new file mode 100644 index 000000000..00c5f86f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-outside-readbuffer.html @@ -0,0 +1,289 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-scissor-enabled.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-scissor-enabled.html new file mode 100644 index 000000000..d1077b9d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-scissor-enabled.html @@ -0,0 +1,182 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-size-overflow.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-size-overflow.html new file mode 100644 index 000000000..71e3ab7d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-size-overflow.html @@ -0,0 +1,98 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-srgb-and-linear-drawbuffers.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-srgb-and-linear-drawbuffers.html new file mode 100644 index 000000000..39803416f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-srgb-and-linear-drawbuffers.html @@ -0,0 +1,229 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-stencil-only.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-stencil-only.html new file mode 100644 index 000000000..9817b6240 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-stencil-only.html @@ -0,0 +1,192 @@ + + + + + + +WebGL BlitFramebuffer Stencil-only Tests + + + + + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-test.html new file mode 100644 index 000000000..0322abac3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/blitframebuffer-test.html @@ -0,0 +1,342 @@ + + + + + + +WebGL BlitFramebuffer Tests + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/canvas-resizing-with-pbo-bound.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/canvas-resizing-with-pbo-bound.html new file mode 100644 index 000000000..e09a4473a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/canvas-resizing-with-pbo-bound.html @@ -0,0 +1,130 @@ + + + + + + +WebGL 2 Resizing With PBO Bound Test + + + + + +
+ + +
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-func-buffer-type-match.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-func-buffer-type-match.html new file mode 100644 index 000000000..ac16ea251 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-func-buffer-type-match.html @@ -0,0 +1,166 @@ + + + + + + +Test clear and clearBuffer functions have to match fbo's buffer format + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-srgb-color-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-srgb-color-buffer.html new file mode 100644 index 000000000..b721a5d5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clear-srgb-color-buffer.html @@ -0,0 +1,109 @@ + + + + + + +Clear sRGB Color Buffer + + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clipping-wide-points.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clipping-wide-points.html new file mode 100644 index 000000000..8ca5305ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/clipping-wide-points.html @@ -0,0 +1,47 @@ + + + + + +Clipping wide points test + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/draw-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/draw-buffers.html new file mode 100644 index 000000000..b09491b6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/draw-buffers.html @@ -0,0 +1,581 @@ + + + + + + +WebGL Draw Buffers Conformance Tests + + + + + +
+ +
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/element-index-uint.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/element-index-uint.html new file mode 100644 index 000000000..f19529022 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/element-index-uint.html @@ -0,0 +1,426 @@ + + + + + + +WebGL Uint element indices Conformance Tests + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-completeness-unaffected.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-completeness-unaffected.html new file mode 100644 index 000000000..f614607f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-completeness-unaffected.html @@ -0,0 +1,113 @@ + + + + + + +Test drawBuffers, readBuffer, and fbo completeness + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-unsupported.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-unsupported.html new file mode 100644 index 000000000..2188ab0fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/framebuffer-unsupported.html @@ -0,0 +1,155 @@ + + + + + + +WebGL FRAMEBUFFER_UNSUPPORTED Test + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/fs-color-type-mismatch-color-buffer-type.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/fs-color-type-mismatch-color-buffer-type.html new file mode 100644 index 000000000..19eb6ff82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/fs-color-type-mismatch-color-buffer-type.html @@ -0,0 +1,190 @@ + + + + + + +The Color Types of Fragment Shader's Outputs Should Match The Data Types of Color Buffers + + + + + + +
+
+ + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-arrays.html new file mode 100644 index 000000000..dee7b387f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-arrays.html @@ -0,0 +1,242 @@ + + + + + + +WebGL Instanced Arrays Conformance Tests + + + + + + +
+ +
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-rendering-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-rendering-bug.html new file mode 100644 index 000000000..14d576f8d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/instanced-rendering-bug.html @@ -0,0 +1,275 @@ + + + + + + +WebGL Instanced Arrays Conformance Tests + + + + + + +
+ +
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/out-of-bounds-index-buffers-after-copying.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/out-of-bounds-index-buffers-after-copying.html new file mode 100644 index 000000000..e01f71753 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/out-of-bounds-index-buffers-after-copying.html @@ -0,0 +1,207 @@ + + + + + + + + +WebGL Out-of-Bounds Index Buffer Caused by CopyBufferSubData Conformance Test + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rendering-sampling-feedback-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rendering-sampling-feedback-loop.html new file mode 100644 index 000000000..9bbfe3a7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rendering-sampling-feedback-loop.html @@ -0,0 +1,148 @@ + + + + + + +WebGL Rendering and Sampling Feedback Loop Tests + + + + + + +
+
+ + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rgb-format-support.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rgb-format-support.html new file mode 100644 index 000000000..bb67edffb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/rgb-format-support.html @@ -0,0 +1,132 @@ + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/uniform-block-buffer-size.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/uniform-block-buffer-size.html new file mode 100644 index 000000000..96b111ec4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/uniform-block-buffer-size.html @@ -0,0 +1,249 @@ + + + + + + +WebGL UniformBlock Buffer Size Conformance Tests + + + + + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/00_test_list.txt new file mode 100644 index 000000000..02901856b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/00_test_list.txt @@ -0,0 +1,2 @@ +samplers.html +sampler-drawing-test.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/sampler-drawing-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/sampler-drawing-test.html new file mode 100644 index 000000000..ebe801121 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/sampler-drawing-test.html @@ -0,0 +1,145 @@ + + + + + + +WebGL Sampler Drawing Test + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/samplers.html b/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/samplers.html new file mode 100644 index 000000000..7d999136f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/samplers/samplers.html @@ -0,0 +1,251 @@ + + + + + + +WebGL Sampler Conformance Tests + + + + + +
+ +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/state/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/state/00_test_list.txt new file mode 100644 index 000000000..5bbd184e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/state/00_test_list.txt @@ -0,0 +1,4 @@ +gl-enum-tests.html +gl-get-calls.html +gl-getstring.html +gl-object-get-calls.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-enum-tests.html b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-enum-tests.html new file mode 100644 index 000000000..d87fcfe66 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-enum-tests.html @@ -0,0 +1,50 @@ + + + + + + +WebGL gl enums Conformance Tests + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-get-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-get-calls.html new file mode 100644 index 000000000..c47b6a754 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-get-calls.html @@ -0,0 +1,198 @@ + + + + + + +WebGL gl calls Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-getstring.html b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-getstring.html new file mode 100644 index 000000000..74782437f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-getstring.html @@ -0,0 +1,81 @@ + + + + + + +WebGL gl.getParameter Strings Conformance Tests + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-object-get-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-object-get-calls.html new file mode 100644 index 000000000..4647da958 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/state/gl-object-get-calls.html @@ -0,0 +1,47 @@ + + + + + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/sync/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/sync/00_test_list.txt new file mode 100644 index 000000000..474af6c76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/sync/00_test_list.txt @@ -0,0 +1 @@ +sync-webgl-specific.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/sync/sync-webgl-specific.html b/dom/canvas/test/webgl-conf/checkout/conformance2/sync/sync-webgl-specific.html new file mode 100644 index 000000000..33f57e10f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/sync/sync-webgl-specific.html @@ -0,0 +1,87 @@ + + + + + + +WebGL2 specific sync object behaviors + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/00_test_list.txt new file mode 100644 index 000000000..8efb86633 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/00_test_list.txt @@ -0,0 +1,14 @@ +misc/00_test_list.txt +canvas/00_test_list.txt +canvas_sub_rectangle/00_test_list.txt +image/00_test_list.txt +image_data/00_test_list.txt +svg_image/00_test_list.txt +video/00_test_list.txt +webgl_canvas/00_test_list.txt +// image_bitmap_from_image_data/00_test_list.txt +// image_bitmap_from_image/00_test_list.txt +// image_bitmap_from_video/00_test_list.txt +// image_bitmap_from_canvas/00_test_list.txt +// image_bitmap_from_blob/00_test_list.txt +// image_bitmap_from_image_bitmap/00_test_list.txt diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/00_test_list.txt new file mode 100644 index 000000000..11f7a2127 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +//tex-2d-rgb9_e5-rgb-half_float.html // crbug.com/663188 , Apple Radar 29259244 +//tex-2d-rgb9_e5-rgb-float.html // crbug.com/663188 , Apple Radar 29259244 +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +//tex-3d-rgb9_e5-rgb-half_float.html // crbug.com/663188 , Apple Radar 29259244 +//tex-3d-rgb9_e5-rgb-float.html // crbug.com/663188 , Apple Radar 29259244 +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..6b547ac8b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..81fd8aeaa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..2ed2b13fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..cfe9d2ccb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..cdfc2e788 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..182bf6ce0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..4782a7922 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..d105b8644 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..ce445c225 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..259472d61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..bbda0f2ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..ced626c19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..7cbcb2d11 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..70420bc52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..e467f7d13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..c4508b82b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..16f0d956f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..a673c3bd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..fc63b5fa7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..26312bfe7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..3b82480e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..2d0191514 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..e41ed2828 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..4a13fa2e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..f68e4550b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..dea7fa08b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..218819c15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..e2eda58ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..5d958f6b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..f17fba990 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..5fc22abb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..4f9e6450f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..e8e941fe3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..bd2327de8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..b829bbd15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..190e9ef84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..021aa1a1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..a4d5834c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..deb32bcd9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..1bbc06e66 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..073d8fdd7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..eac9885a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..1442fd360 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..761de35ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..0c3a2d11b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..6d2200268 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..7f7409751 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..ef1ac3824 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..2de9751bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..b10451e34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..e764eeb00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..a70423470 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..3d74f47cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..64ff23963 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..19b5ca3ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..d99d12209 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..77879e6a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..c70735518 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..f8d97e507 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..9134b8780 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..cbe9001c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..57c01fd7f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..9abd44c38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..07ae49233 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..98774a173 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..8e144bf17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..2337073ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..54fd4f285 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..625c8efbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..4ee2580d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..5d90c4dba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..88829f5a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..1920dce5a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..77c07c12d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..beb85cb89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..60ca1704c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..1ec67f133 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..686f21692 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..8a1c76f90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..5b8eccca5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..85fc52223 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..3f47ef8ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..5afa7d9d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..d68fbabd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..7ca9175ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..07fda071a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..759ac6d58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..01bf9fc3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..51ba3b24d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..220f97023 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..b01b853ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..2368b2787 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..3df399321 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..706ff8a83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..e6e355bf1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..c23a46955 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..f5e8ee7ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..a37cbfbfe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..c58f48b2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..cb40152a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..323fed8a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..589008006 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..6e9d2a437 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..88729bf37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..1431a709c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..5630e28e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..6aefb75bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..98f505550 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..6465c38cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..51e9805c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..32437fa94 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..374905d54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..548d62692 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..d7d9c32bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..a8054f477 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..d4948ff84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..81208a7a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..d33a0f39c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..53c180478 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..3a646f852 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..116b1f738 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..9edb28c39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..8120b145b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..a2943c01b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..fac5d17ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..963ed9d58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..6af541289 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..567cb1c9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..b55dbebaa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..399a54312 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..9ea4429c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..af22a4fe7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..22866ee02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..82aaed852 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..dcae50e48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..65b5342de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..705f6e8d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..eb0530539 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..7a844b742 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..b7b5ba56e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..4bac4c49f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..95509a45c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..04020c808 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..01fdc23f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..1d1e95681 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..d3ea929a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..cbb93c1a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..db5cfa109 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..548cbc29a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..a6067adec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..4896dbf76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..bd5ce0d61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..73d836533 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..3c08bfaa7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..c8e84a7d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..4f2f300ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..8f9837374 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..dc3152b72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..c765a5f5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..67b663838 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..3ae986891 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..f1f992521 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..978a6029d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..5c0f8cc2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..ff3196cf6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..0f43e328e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..5a3828744 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..d92b5d51e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..3da967699 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..b44bad08c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..6f8876eaa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..7d3033ac8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..148001417 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..d512de308 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..ddf60dba3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..c71248951 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..cc9b7d5d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..782d51323 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..3b71df74b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..a7924a69d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..010e4414e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..e39ad7a36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..d15648a61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..de860a2e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..47e040a91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..795b1b51b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..73a596802 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..6d29ac746 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..db748bb90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..4c99c4e17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..7fda71ca0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..5e59a54c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..e46f3a1f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..c50bf13de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..67b98fbbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..92c3c9f93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..c3992c793 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..4c1b67f83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..8406d706c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..f807cc0fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..b44046f70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..0726e9264 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..60f0d524b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..091cd5e5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..f6df2b1f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..0c0a51e1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..572ab7098 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..300070330 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..7c0894eb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..e1758a6c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..a77e58a9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..8d79d7820 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..771e75054 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..a49912df1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..c0b00573b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..8c65c888e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..10acc0684 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..4f62c820f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..5b6373455 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..40242265c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..8edd74dd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..988ce6823 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..dc9c8a397 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..62ce89ce5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..d5c3f1b15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..6b4554c18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..666e1c1e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..312d25014 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..a7272e88c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..5ed21a963 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..b315c9ebb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..955ff528a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..fe5aa16b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..a3e91c8c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..bd78d9d17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..5dfda1e91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..9de8a5bf2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..030e03648 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..fab1d4553 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..e3e80164c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..50f2e2a0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..26147618f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..8a184d29e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..fb0cbc354 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..5ec7f7bd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..a7f6d0a9d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..8813646dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..5ad01142c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..21007020c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..4ccfa88c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..d2d1bfd78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..83508aac0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..8c86a6b30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..c0b32eee9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..9b89ff1cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..ae8f4b63c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..ad88f79eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..553990c27 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..d02dee120 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..1c6e0cea5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..bb9d6ced6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..8d2c4b8fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..5edb6b72b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..fa5125f75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..043555e30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..1b38f946c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..78bd9c298 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..b072186b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..a504e0d5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..404642d1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..b94872f70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..48941d611 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..854a89943 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..a28e50daa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..751a59ef6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..2ee21555d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..d3126c0c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..52c3fee4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..11b1fc162 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..d1dee8079 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..dafa96ee4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..c59c22c68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..0668be8ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..d29d39d80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..33f958b69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..f78dffb07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..2aa9de120 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..edb07eeb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..fd6887f65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..630c5bddc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..1bc955101 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..5e6b3649b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..113d971fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..c900ea7f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..107b61c90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..6392b2a0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..36c7e2372 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..2c85f1cff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..124a55f83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..429c35ade --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..bd3fa2e9d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..9d71275ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..6b3e4ea8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..6902fd816 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..0cca1676f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..d339a2c03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..5ac15c214 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..5cf699967 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..8147dc511 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..04967de35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..ba34d3e24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..e8c54df9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..c56a5f54a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..6a1a2d292 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..02b5df10c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..0df69ca3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..cc9b85ef0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..de2dff29b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..999a51517 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..93cfcf18b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..bc02cbf31 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..7fe895e44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..a9b795e19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..8ffde47a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..d91b3ee8d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..9414f82e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..a5da180a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..c169471c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..180244d10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..8fd1a726a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..4a3202cdd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..4192fe0a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..7e760db1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..31a93322d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..3b6f6e2d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..e27caa11d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..ccbb77aee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..88a999d92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..916ff39f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..d1a397327 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..e88ac3c57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..1760d3a51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..b23b35ed6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..436f950d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..b3b3f8ae5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..aaff20c70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..96a9a90c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..6ec69ec45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..9d020e012 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..80c1f423f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..77401fb67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..98d2b15f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..7f5a331cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..ff0e71c55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..0989bc56b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..ef70fdd83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..150c16f77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..08333133a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..2f5d05b8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..6caaff778 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..960bb1bac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..36a3b44d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..f80326ba7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..1bba3ee69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..719bd65be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..24b2a55fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..6a6a45fa5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..12347dc2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..2a547291c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..69e6489df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..ae4a25038 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..eb0d22a48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..af0bea7ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..977fa61f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..6a572d202 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..27f8b2b09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..58614abe9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..a40bba577 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..732213717 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..ec1fb8c58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..ba381d5cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..2c3e686d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..b0f5fe087 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..e50a2dc32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..8e50cc6be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..086e99f2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..79fe9a027 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..9e010b2e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..bf0c2f690 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..3a9c6f7bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..bb9804305 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..077cd2a46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..298df9658 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..a7b95f232 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..aa0a6a961 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..fb83d01aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..023b9bc6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..5e9d5bfd7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..59eeb4ba5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..dfb66f0ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..a3ede9fce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..5e7503348 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..368f1db89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..513152f9e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..924e4d9e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..6096e4db3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..0d57592c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..86fbfa062 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..c1e04abe2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..ca7f7ee0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..569bd0f07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..01111b49c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..43dba6dec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..18a69e3f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..48ec0abe9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..395aa2719 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..30b7c98ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..aed842e3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..6dcf37149 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..f628b3e3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..46fb51024 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..846b41a33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..8ad76dc0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..213adf4fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..066f3376d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..70253ea32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..95858b899 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..3bbc31051 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..b19c37abb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..c2f91847a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..7e6b956af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..1bf7a388a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..99bb34bb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..242370669 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..8b1f700a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..e98f5bb1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..27c36ce87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..49fb286c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..9a82f6893 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..05662e05d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..83c8b2c2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..a2b8d4e8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..b55c964ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..38eca45e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..a455cbaa5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..31b93fdcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..293edf37b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..b5219174d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..a2c1a52e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..4b0a42de5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..9f6aed162 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..02cd1964f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..1f07abb3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..59c0ffe88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..ad4035f82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..f3f751b93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..d1b6aacc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..8d30de89f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..724d74d7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..301a6740a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..af023c92f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..dbb391934 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..5e1d283b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..c52ff4317 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..ae8ac74c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..581abec40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..273f90801 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..b3341c4d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..dc7ea62fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..89d148345 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..7ef4ce2b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..c4a0bdf1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..d10762c1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..d191d7b68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..1318b8764 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..3b6c64173 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..3089ee59b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..1404e8639 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..a0daebbec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..5e828f1d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..39ce8614a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..dd7455c2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..32e942c4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..ada0050f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..8e3fa5641 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..7b19ba387 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..18b45b27f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..316e00319 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..78a71f682 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..724614bd4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..9253e1548 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..728413f69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..bc273ac2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..447c03670 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..bad52a931 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..937c7d928 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..0a0368392 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..eb525c0a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..b553db96c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..563b7db43 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..59f67a6d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..e98e09340 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..31c81aa7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..53440c6a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..812404eca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..21f8c2b72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..d17c30861 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..c9d800afa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..4ee513fcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..920aad6a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..ab7c3c374 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..cee126a02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..3e40eed56 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..2e53195f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..477f8f64f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..bc1d59893 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..0f667f3f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..912272b84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..0f3f7be4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..4c363c78c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..166a83994 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..f8f4e2799 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..ab283a903 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..f49b3026b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..bb7af2f6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..478d4a1fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..d88a92535 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..59576c3a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..2d03f5493 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..002e8c81c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..9255dfa5b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..238702560 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..c2988b5e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..6612ccd0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..3c60199eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..66cc46c07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..b77b83dd7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..e2d479868 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..b0166bbff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..e588fd3db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..4c880f558 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..8f7480806 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..25209eaa5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..559df3f67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..0afe626c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..9d5b5a86b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..da1b36369 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..8f3bd1d53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..b2677769e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..cc4d2f80d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..0d3f05df7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..817b8df0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..a4c50abc6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..9bfcf5e45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..66693f2f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..a31a4324f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..ffba5ab55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..afbf25e54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..abfb28183 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..23dabe0c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..c41b8a941 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..2ed8411e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..fb9452329 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..83cf46af0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..9e1ba5a1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..b85de3f8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..1db836b20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..1f7746f9b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..59b9dd9ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..382413b55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..58b3445c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..9c79b3a8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..06dfa6301 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..39a05613f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..b1ff21030 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..ad5306725 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..90a3e30d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..ccd841a1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..4c4ceb258 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..06394f49b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..63ed59311 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..63ce6523e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..486bd2b55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..6346c4710 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..924f78476 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..2a5d83ddf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..867ebe0cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..48895c88c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..c0dbbf9b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..83c01c41e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..6b7261e06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..b505327ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..85aadc1db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..0eac4c0c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..e7a251570 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..f2252f6d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..7280b6643 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..3987a3f1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..d113de6d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..576bd2140 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..e0e304e15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..72948bae3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..5a395dab8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..dd8847b8d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..1775aaf1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..860aeaf20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..ac6c8924d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..3f40c0029 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..22375e0a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..d526e3d87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..2cf764e42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..24e5ffd2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..129358195 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..f25a09459 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..7602e59f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..71a61ddcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..9d05c6fa2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..9fe8d89a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..b4418a9f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..532c4199e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..39acc5603 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..716664169 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..c6b6ae23d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..504992c77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..ee70f073c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..c74cc5d06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..e9b10482b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..ac788d055 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..871e9589e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..87692588d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..d1b902872 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..305f70e77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r16f-red-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..ea45e38ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r32f-red-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..1ebaad01d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..4cdb85660 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..466c5bf81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..11498f477 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..226a88271 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg32f-rg-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..43c24420f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..821340aea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..32c51b294 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..d3210d41f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..46c461e44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..b0c08b64d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..f5abce1e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..2c90a20e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..0c2223ac6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..ba7b02e54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..712736a82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..3ce51a8e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..d28cb0fbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..4d133d66a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..c6f1c4e24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..d384eea95 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..786fc7c02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..28ed2a5d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..70fc5119e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..18f271c64 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..3c5c1186d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..eed3fc7db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/00_test_list.txt new file mode 100644 index 000000000..a25c3ec81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/00_test_list.txt @@ -0,0 +1,23 @@ +--min-version 2.0.1 active-3d-texture-bug.html +copy-texture-image.html +copy-texture-image-luma-format.html +copy-texture-image-webgl-specific.html +gl-get-tex-parameter.html +--min-version 2.0.1 integer-cubemap-texture-sampling.html +--min-version 2.0.1 integer-cubemap-specification-order-bug.html +mipmap-fbo.html +tex-3d-size-limit.html +tex-image-and-sub-image-with-array-buffer-view-sub-source.html +tex-image-with-bad-args.html +tex-image-with-bad-args-from-dom-elements.html +tex-image-with-different-data-source.html +tex-input-validation.html +tex-mipmap-levels.html +tex-new-formats.html +--min-version 2.0.1 tex-srgb-mipmap.html +tex-storage-2d.html +tex-storage-and-subimage-3d.html +tex-storage-compressed-formats.html +tex-unpack-params.html +texel-fetch-undefined.html +texture-npot.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/active-3d-texture-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/active-3d-texture-bug.html new file mode 100644 index 000000000..99cd0136b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/active-3d-texture-bug.html @@ -0,0 +1,145 @@ + + + + + + +WebGL Active TEXTURE1 Bug Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/compressed-tex-image.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/compressed-tex-image.html new file mode 100644 index 000000000..4423a8fd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/compressed-tex-image.html @@ -0,0 +1,94 @@ + + + + + + +WebGL CompressedTexImage and CompressedTexSubImage Tests + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-luma-format.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-luma-format.html new file mode 100644 index 000000000..a4279af3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-luma-format.html @@ -0,0 +1,187 @@ + + + + + + +WebGL CopyTexSubImage Tests + + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-webgl-specific.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-webgl-specific.html new file mode 100644 index 000000000..dcb364489 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image-webgl-specific.html @@ -0,0 +1,324 @@ + + + + + + +WebGL CopyTexImage Tests + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image.html new file mode 100644 index 000000000..f01da1238 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/copy-texture-image.html @@ -0,0 +1,248 @@ + + + + + + +WebGL CopyTexImage Tests + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/gl-get-tex-parameter.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/gl-get-tex-parameter.html new file mode 100644 index 000000000..691fb4e6a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/gl-get-tex-parameter.html @@ -0,0 +1,48 @@ + + + + + + +WebGL getTexParameter test + + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-specification-order-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-specification-order-bug.html new file mode 100644 index 000000000..5720a07d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-specification-order-bug.html @@ -0,0 +1,190 @@ + + + + + + +WebGL Integer Cubemap Texture Specification Order Bug Test + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-texture-sampling.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-texture-sampling.html new file mode 100644 index 000000000..95b3541c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/integer-cubemap-texture-sampling.html @@ -0,0 +1,190 @@ + + + + + + +WebGL Integer Cubemap Texture Sampling Tests + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/mipmap-fbo.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/mipmap-fbo.html new file mode 100644 index 000000000..efd8bc8a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/mipmap-fbo.html @@ -0,0 +1,71 @@ + + + + + + +Test if mipmap incomplete textures can be used as FBO attachments + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-3d-size-limit.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-3d-size-limit.html new file mode 100644 index 000000000..8e69f92eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-3d-size-limit.html @@ -0,0 +1,184 @@ + + + + + + +WebGL FramebufferTextureLayer Test + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-and-sub-image-with-array-buffer-view-sub-source.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-and-sub-image-with-array-buffer-view-sub-source.html new file mode 100644 index 000000000..b4c7bdf3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-and-sub-image-with-array-buffer-view-sub-source.html @@ -0,0 +1,218 @@ + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args-from-dom-elements.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args-from-dom-elements.html new file mode 100644 index 000000000..8f2968063 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args-from-dom-elements.html @@ -0,0 +1,149 @@ + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args.html new file mode 100644 index 000000000..8b60624be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-bad-args.html @@ -0,0 +1,76 @@ + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-different-data-source.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-different-data-source.html new file mode 100644 index 000000000..70b8d50c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-with-different-data-source.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-input-validation.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-input-validation.html new file mode 100644 index 000000000..32ac7cc1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-input-validation.html @@ -0,0 +1,45 @@ + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-mipmap-levels.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-mipmap-levels.html new file mode 100644 index 000000000..17920ea02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-mipmap-levels.html @@ -0,0 +1,280 @@ + + + + + + +WebGL2 Non-Power of 2 texture conformance test. + + + + + + +
+
+ + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html new file mode 100644 index 000000000..8c5fba975 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html @@ -0,0 +1,586 @@ + + + + + + +Conformance test for WebGL2 texture image formats specification + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-srgb-mipmap.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-srgb-mipmap.html new file mode 100644 index 000000000..e7f2cbbdd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-srgb-mipmap.html @@ -0,0 +1,227 @@ + + + + + + +WebGL texture mipmap conformance test. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-2d.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-2d.html new file mode 100644 index 000000000..e4c3c436a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-2d.html @@ -0,0 +1,294 @@ + + + + + + +texStorage2D conformance test + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-and-subimage-3d.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-and-subimage-3d.html new file mode 100644 index 000000000..8588d5b7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-and-subimage-3d.html @@ -0,0 +1,234 @@ + + + + + + +texStorage3D and texSubImage3D conformance test + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-compressed-formats.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-compressed-formats.html new file mode 100644 index 000000000..4f4295f10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-storage-compressed-formats.html @@ -0,0 +1,124 @@ + + + + + + +Conformance test for WebGL2 texStorage2D and texStorage3D with compressed format + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-unpack-params.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-unpack-params.html new file mode 100644 index 000000000..73c0958d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-unpack-params.html @@ -0,0 +1,612 @@ + + + + + + +WebGL2 texture unpack parameters conformance test. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texel-fetch-undefined.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texel-fetch-undefined.html new file mode 100644 index 000000000..7f176b573 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texel-fetch-undefined.html @@ -0,0 +1,104 @@ + + + + + + +WebGL texel fetch test. + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texture-npot.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texture-npot.html new file mode 100644 index 000000000..19ae44b19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/texture-npot.html @@ -0,0 +1,181 @@ + + + + + + +WebGL2 Non-Power of 2 texture conformance test. + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..60b59c5b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..f83d13bef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..4c113a9f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..4fb38b158 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..a78c615e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..b4a63f682 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..b6f1f11c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..853852bcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..42a0e264c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..acc0e2bf3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..0afad8e16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..531097552 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..f6c4e1ae6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..a56128bb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..34d2c45d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..ed32125a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..32aa4c58b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..190fa4d1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..2961b4cc2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..0f4032378 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..7af4b27a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..a880a7334 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..6f1ae47b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..f6b7822c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..b0a8a70c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..6f30a9c64 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..a0ed61e33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..73e1c4b59 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..7d8116f28 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..6709e3328 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..64a7e7e88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..efaceae98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..711b2975c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..bf3417311 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..2a1846d36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..291ed4932 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..47280f85c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..51f58ea3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..cb276fed7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..36b453283 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..1e99895c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..af6c805c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..83f2ee246 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..cbd463489 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..37e5b13dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..6e8e5aec7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..d31387d87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..762d386f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..8eec7f449 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..69671a088 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..52bbee64f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..2538f2e9e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..f2305ef0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..c676a4baa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..a80421772 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..5968e2cee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..afb0c2145 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..32cc0fa81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..79ae0e886 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..918b05133 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..5e1412875 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..162de72d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..a8f6e1b0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..8852eb844 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..463d3d0a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..526f2c6aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/svg_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/00_test_list.txt new file mode 100644 index 000000000..5ad5e132f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +tex-2d-rgb9_e5-rgb-half_float.html +tex-2d-rgb9_e5-rgb-float.html +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +tex-3d-rgb9_e5-rgb-half_float.html +tex-3d-rgb9_e5-rgb-float.html +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..94551f2e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..9b317e5a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..796ba790d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..d634a4bdf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..9eb053f50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..f9dc9f07e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..67ed30838 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..84e020078 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..555a6b076 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..8764f7e0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..1d1894d68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..c9d34d047 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..693dcd2e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..32790950d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..bf14e049a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..99f9d5b00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..c2306d1f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..0845d3489 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..79313ef44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..43bf0dda9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..5ae239894 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..0a5a4f6e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..f79679c57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..3903b121e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..f27445fd5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..df5e97a94 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..f805cb981 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..ca79e0492 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..3d58f78d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..a6fc33142 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..5810ca071 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..1c9c52501 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..fec7b6262 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..fc116042e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..83e04a7f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..84c7fdceb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..6a8099d24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..84e7c8e42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..64d754b44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..3f0a44fee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..0bbfa232a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..b5347e3fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..2fc47a44d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..16e0eeabe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..56e2318b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..517b1e52c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..8eeacaf68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..b391645ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..d5e76fc97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..bf8727686 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..837607286 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..a05031d1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..f85591fee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..77ef2deee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..4001b6ad4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..8ba88c696 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..be210eedb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..8a3b6582f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..73918d9cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..a3ee180e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..05e496b1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..495d03530 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..d566108a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..ee7f56369 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..c3721d3e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..0774f5b3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/00_test_list.txt new file mode 100644 index 000000000..11f7a2127 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/00_test_list.txt @@ -0,0 +1,66 @@ +tex-2d-r8-red-unsigned_byte.html +tex-2d-r16f-red-half_float.html +tex-2d-r16f-red-float.html +tex-2d-r32f-red-float.html +tex-2d-r8ui-red_integer-unsigned_byte.html +tex-2d-rg8-rg-unsigned_byte.html +tex-2d-rg16f-rg-half_float.html +tex-2d-rg16f-rg-float.html +tex-2d-rg32f-rg-float.html +tex-2d-rg8ui-rg_integer-unsigned_byte.html +tex-2d-rgb8-rgb-unsigned_byte.html +tex-2d-srgb8-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_byte.html +tex-2d-rgb565-rgb-unsigned_short_5_6_5.html +tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-2d-r11f_g11f_b10f-rgb-half_float.html +tex-2d-r11f_g11f_b10f-rgb-float.html +//tex-2d-rgb9_e5-rgb-half_float.html // crbug.com/663188 , Apple Radar 29259244 +//tex-2d-rgb9_e5-rgb-float.html // crbug.com/663188 , Apple Radar 29259244 +tex-2d-rgb16f-rgb-half_float.html +tex-2d-rgb16f-rgb-float.html +tex-2d-rgb32f-rgb-float.html +tex-2d-rgb8ui-rgb_integer-unsigned_byte.html +tex-2d-rgba8-rgba-unsigned_byte.html +tex-2d-srgb8_alpha8-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_byte.html +tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-2d-rgba4-rgba-unsigned_byte.html +tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-2d-rgba16f-rgba-half_float.html +tex-2d-rgba16f-rgba-float.html +tex-2d-rgba32f-rgba-float.html +tex-2d-rgba8ui-rgba_integer-unsigned_byte.html +tex-3d-r8-red-unsigned_byte.html +tex-3d-r16f-red-half_float.html +tex-3d-r16f-red-float.html +tex-3d-r32f-red-float.html +tex-3d-r8ui-red_integer-unsigned_byte.html +tex-3d-rg8-rg-unsigned_byte.html +tex-3d-rg16f-rg-half_float.html +tex-3d-rg16f-rg-float.html +tex-3d-rg32f-rg-float.html +tex-3d-rg8ui-rg_integer-unsigned_byte.html +tex-3d-rgb8-rgb-unsigned_byte.html +tex-3d-srgb8-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_byte.html +tex-3d-rgb565-rgb-unsigned_short_5_6_5.html +tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html +tex-3d-r11f_g11f_b10f-rgb-half_float.html +tex-3d-r11f_g11f_b10f-rgb-float.html +//tex-3d-rgb9_e5-rgb-half_float.html // crbug.com/663188 , Apple Radar 29259244 +//tex-3d-rgb9_e5-rgb-float.html // crbug.com/663188 , Apple Radar 29259244 +tex-3d-rgb16f-rgb-half_float.html +tex-3d-rgb16f-rgb-float.html +tex-3d-rgb32f-rgb-float.html +tex-3d-rgb8ui-rgb_integer-unsigned_byte.html +tex-3d-rgba8-rgba-unsigned_byte.html +tex-3d-srgb8_alpha8-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_byte.html +tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html +tex-3d-rgba4-rgba-unsigned_byte.html +tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html +tex-3d-rgba16f-rgba-half_float.html +tex-3d-rgba16f-rgba-float.html +tex-3d-rgba32f-rgba-float.html +tex-3d-rgba8ui-rgba_integer-unsigned_byte.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..1dd88a476 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..3cc4a6351 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..05e6bb6c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-float.html new file mode 100644 index 000000000..82c517a60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..321753ab7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r32f-red-float.html new file mode 100644 index 000000000..dec1d0104 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..b3c238f0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..2f9c65259 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..567435b4f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..36401846c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..7a3edfe39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..72764c9f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..26afa3069 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..0c26cd33e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..c3e59e605 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..a03ded686 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..3f7eeb260 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..98775d676 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..ff3b7c414 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..f95253772 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..72a1d7fd9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..c18b7f602 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..2bc53c5fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..b4d6dd2b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..c64491557 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..b90080b2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..2f63fcddf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..936a310c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..987478cc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..ba7140736 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..4b0d27c56 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..431bf4fbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..8f73974e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..75da7ff1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..28841e558 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..9debd6f90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-float.html new file mode 100644 index 000000000..1f1e0e4dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..56ac1af6a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r32f-red-float.html new file mode 100644 index 000000000..e6af6b3b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r32f-red-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..1584410a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..0dbfec5ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..0b2fb8c8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..de1172798 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..282f84f39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg32f-rg-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..79db52cfa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..6f4f507d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..3bb6f586b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..dd67acee0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..4ed387ad7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..9ef47f89d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..7a6550703 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..4b9783590 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..efde5c4d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..93c49cc5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..a6924b8f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..8cfb66a31 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..3a45134df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..fab6c80b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..72f7771aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..031df430e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..42b2fc552 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..40b1a7d5a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..5acd297a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..3c0fe9fa4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..aba5a19f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..c815ebae9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/00_test_list.txt new file mode 100644 index 000000000..84da3d3ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/00_test_list.txt @@ -0,0 +1,3 @@ +transform_feedback.html +two-unreferenced-varyings.html +unwritten-output-defaults-to-zero.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/transform_feedback.html b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/transform_feedback.html new file mode 100644 index 000000000..ef3d5dc10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/transform_feedback.html @@ -0,0 +1,454 @@ + + + + + + +WebGL Transform Feedback Conformance Tests + + + + + +
+ +
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/two-unreferenced-varyings.html b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/two-unreferenced-varyings.html new file mode 100644 index 000000000..b1d276b5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/two-unreferenced-varyings.html @@ -0,0 +1,157 @@ + + + + + + +WebGL Transform Feedback Conformance Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html new file mode 100644 index 000000000..7234c1dd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html @@ -0,0 +1,154 @@ + + + + + + +WebGL Transform Feedback Conformance Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/00_test_list.txt new file mode 100644 index 000000000..5b59a2173 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/00_test_list.txt @@ -0,0 +1 @@ +vertex-array-object.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/vertex-array-object.html b/dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/vertex-array-object.html new file mode 100644 index 000000000..b65e0425a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/vertex_arrays/vertex-array-object.html @@ -0,0 +1,684 @@ + + + + + + +WebGL vertex_array_object Conformance Tests + + + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt new file mode 100644 index 000000000..32ec5067a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt @@ -0,0 +1,7 @@ +// files that end in .txt list other tests +// other lines are assumed to be .html files + +--min-version 1.0.4 --max-version 1.9.9 data/gles2/shaders/00_test_list.txt +--min-version 2.0.0 data/gles3/shaders/00_test_list.txt +--min-version 2.0.0 framework/opengl/simplereference/00_test_list.txt +--min-version 2.0.0 functional/gles3/00_test_list.txt diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/LICENSE b/dom/canvas/test/webgl-conf/checkout/deqp/LICENSE new file mode 100644 index 000000000..0a93ef718 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/README.md b/dom/canvas/test/webgl-conf/checkout/deqp/README.md new file mode 100644 index 000000000..bdaf88f05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/README.md @@ -0,0 +1,21 @@ +DEQP tests for WebGL +=========================================== + +1. Running +Tests can be run as part of the WebGL Conformance suite or individually +by navigating to one of pages in functional/gles3 or in data/gles(2|3)/shaders/ + +2. Filtering +One can limit the tests to run with a 'filter' query. For example: + +functional/gles3/textureformat.html?filter=2d + +will executed only the tests with '2d' in the test name. +Filter query accepts a regular expression. + +3. Compiling. +The tests have been annotated for closure and can be compiled with run-closure script. + +4. Implementation notes. +Tests use a minimal subset of google closure library for dependency management. +The closure compiler is used solely for error checking. The compiler output is discarded. diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/build.py b/dom/canvas/test/webgl-conf/checkout/deqp/build.py new file mode 100644 index 000000000..5349a6c93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/build.py @@ -0,0 +1,283 @@ +#!/usr/bin/env python + +# +# Copyright (c) 2015 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. +# + +# Author: Mobica LTD + +import sys +import re +import os +import subprocess +import threading +from sys import stdout, stderr, argv + +# Running this script +# 1. To rebuild all dependencies: +# $ build.py deps +# 2. To build all targets without rebuilding dependencies +# $ build.py build +# 3. To build a single target without rebuilding dependencies +# $ build.py build +# See the table below for available targets +# 4. To rebuild all dependencies and targets +# $ build.py +# 5. To build dependencies for a single target +# $ build.py deps +# 6. To build dependencies for and compile a single target +# $ build.py + +# List of targets (short target name, closure namespace) +targets = { + 'textureformat': 'functional.gles3.es3fTextureFormatTests', + 'fboCompletenessTests': 'functional.gles3.es3fFboCompletenessTests', + 'fbomultisampletests': 'functional.gles3.es3fFboMultisampleTests', + 'fbostencilbuffertests': 'functional.gles3.es3fFboStencilbufferTests', + 'fragmentoutput': 'functional.gles3.es3fFragmentOutputTests', + 'framebufferblittests': 'functional.gles3.es3fFramebufferBlitTests', + 'instancedrenderingtests': 'functional.gles3.es3fInstancedRenderingTests', + 'pixelBufferObjectTest': 'functional.gles3.es3fPixelBufferObjectTest', + 'primitiverestarttests': 'functional.gles3.es3fPrimitiveRestartTests', + 'samplerobjecttests': 'functional.gles3.es3fSamplerObjectTests', + 'transformFeedbackTests': 'functional.gles3.es3fTransformFeedbackTests', + 'uniformapi': 'functional.gles3.es3fUniformApiTests', + 'uniformbuffers': 'functional.gles3.es3fUniformBlockTests', + 'vertexarrays': 'functional.gles3.es3fVertexArrayTests', + 'shaderlibrary': 'modules.shared.glsShaderLibrary', + 'negativebuffer': 'functional.gles3.es3fNegativeBufferApiTests', + 'sglrReferenceContextTest': 'framework.opengl.simplereference.sglrReferenceContextTest', + 'lifetime': 'functional.gles3.es3fLifetimeTests', + 'draw': 'functional.gles3.es3fDrawTests', + 'attriblocation': 'functional.gles3.es3fAttribLocationTests', + 'textureShadowTests': 'functional.gles3.es3fTextureShadowTests', + 'texturewrap': 'functional.gles3.es3fTextureWrapTests', + 'negativetextureapi': 'functional.gles3.es3fNegativeTextureApiTests', + 'multisample': 'functional.gles3.es3fMultisampleTests', + 'negativefragmentapi': 'functional.gles3.es3fNegativeFragmentApiTests', + 'negativevertexarrayapi': 'functional.gles3.es3fNegativeVertexArrayApiTests', + 'negativestateapi' : 'functional.gles3.es3fNegativeStateApiTests', + 'negativeshaderapi' : 'functional.gles3.es3fNegativeShaderApiTests', + 'rasterizerdiscard' : 'functional.gles3.es3fRasterizerDiscardTests', + 'buffercopy' : 'functional.gles3.es3fBufferCopyTests', + 'shaderindexing' : 'functional.gles3.es3fShaderIndexingTests', + 'shaderloop' : 'functional.gles3.es3fShaderLoopTests', + 'shaderstruct' : 'functional.gles3.es3fShaderStructTests', + 'shaderswitch' : 'functional.gles3.es3fShaderSwitchTests', + 'fborender' : 'functional.gles3.es3fFboRenderTest', + 'shaderderivate' : 'functional.gles3.es3fShaderDerivateTests', + 'builtinprecision' : 'functional.gles3.es3fBuiltinPrecisionTests', + 'shaderbuiltinvar' : 'functional.gles3.es3fShaderBuiltinVarTests', + 'texturefiltering' : 'functional.gles3.es3fTextureFilteringTests', + 'fbocolor' : 'functional.gles3.es3fFboColorbufferTests', + 'fragdepth' : 'functional.gles3.es3fFragDepthTests', + 'shaderop' : 'functional.gles3.es3fShaderOperatorTests', + 'vao' : 'functional.gles3.es3fVertexArrayObjectTests', + 'clip' : 'functional.gles3.es3fClippingTests', + 'inv' : 'functional.gles3.es3fFboInvalidateTests', + 'defvertattr' : 'functional.gles3.es3fDefaultVertexAttributeTests', + 'occlusion' : 'functional.gles3.es3fOcclusionQueryTests', + 'shaderapi' : 'functional.gles3.es3fShaderApiTests', + 'shaderpackingfunction' : 'functional.gles3.es3fShaderPackingFunctionTests', + 'shadercommonfunction' : 'functional.gles3.es3fShaderCommonFunctionTests', + 'shadermatrix' : 'functional.gles3.es3fShaderMatrixTest', + 'shaderprecision' : 'functional.gles3.es3fShaderPrecisionTests', + 'bstate': 'functional.gles3.es3fBooleanStateQuery', + 'shaderstate': 'functional.gles3.es3fShaderStateQueryTests', + 'fbostate' : 'functional.gles3.es3fFboStateQueryTests', + 'rbostate' : 'functional.gles3.es3fRboStateQueryTests', + 'bufferstate' : 'functional.gles3.es3fBufferObjectQueryTests', + 'samplerstate' : 'functional.gles3.es3fSamplerStateQueryTests', + 'texstate' : 'functional.gles3.es3fTextureStateQuery', + 'internalformatstate' : 'functional.gles3.es3fInternalFormatQueryTests', + 'texturespecification' : 'functional.gles3.es3fTextureSpecificationTests', + 'shadertexturefunction' : 'functional.gles3.es3fShaderTextureFunctionTests', + 'sync' : 'functional.gles3.es3fSyncTests', + 'readpixel' : 'functional.gles3.es3fReadPixelTests', + 'stringquery' : 'functional.gles3.es3fStringQueryTests', + 'indexedstate' : 'functional.gles3.es3fIndexedStateQueryTests', + 'integerstate' : 'functional.gles3.es3fIntegerStateQueryTests', + 'floatstate' : 'functional.gles3.es3fFloatStateQueryTests' +} + +total_errors = 0 +total_warnings = 0 + +results = dict() + +def dep_filename(target): + return target + '.dep' + +def compiled_filename(target): + return target + '.compiled' + +def write_to_file(outfile, cmdLine, redirect_stderr): + stderr = None + if redirect_stderr: + stderr = subprocess.STDOUT + + with open(outfile, "w") as out_file: + proc = subprocess.Popen(cmdLine, shell=True, stdout=subprocess.PIPE, stderr=stderr) + while proc.poll() is None: + line = proc.stdout.readline() + out_file.write(line) + + out_file.flush() + proc.wait() + +def read_file(file_path): + #File exist + if not file_exists(file_path): + sys.exit(2) + + fo = open(file_path) + lines = fo.read() + fo.close() + return lines + +def file_exists(file_path): + if not os.path.exists: + print "The file " + file_name + " doesn't exists" + return False + return True + +def build_deps(target, namespace): + cmdLine = 'python ../closure-library/closure/bin/build/closurebuilder.py --root=../closure-library --root=. --namespace=' + namespace + print cmdLine + write_to_file(dep_filename(target), cmdLine, False) + +def build_all_deps(): + for target in targets.keys(): + build_deps(target, targets[target]) + +def buildDepsFile(): + # the parameter "--root_with_prefix" is the relative path from the file goog/base.js to the root of the .js files we + # are working on. + cmdBuildDeps = 'python ../closure-library/closure/bin/build/depswriter.py --root_with_prefix=". ../../../deqp" > deqp-deps.js' + + # Calls the python program that generates the google closure dependencies + # write_to_file('deqp-deps.js', cmdBuildDeps, False) + proc = subprocess.Popen(cmdBuildDeps, shell=True, stdout=subprocess.PIPE, stderr=None) + proc.wait() + +def build_target(target, namespace): + global total_errors + global total_warnings + deps = read_file(dep_filename(target)) + cmdLine = 'java -jar compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --jscomp_warning undefinedVars --externs compiler_additional_extern.js' + for dep in deps.split('\n'): + dep = dep.strip() + if len(dep) > 0: + cmdLine += ' --js ' + dep + cmdLine += ' --closure_entry_point=' + namespace + print cmdLine + filename = compiled_filename(target) + write_to_file(filename, cmdLine, True) + compiled = read_file(filename) + result = re.search(r'(\d*)\s*error\(s\),\s*(\d*)\s*warning\(s\)', compiled) + errors = 0 + warnings = 0 + if result: + print target + ': ' + result.group(0) + errors = int(result.group(1)) + warnings = int(result.group(2)) + total_errors += errors + total_warnings += warnings + results[target] = [errors, warnings] + +def build_all_targets(): + for target in targets.keys(): + build_target(target, targets[target]) + +def format_target(target): + deps = read_file(dep_filename(target)) + fixjsstyle = 'fixjsstyle.py' + reformat = 'reformatting_tool.py' + for dep in deps.split('\n'): + dep = dep.strip() + if len(dep) > 0 and not re.search('closure-library.*base\.js', dep): + print fixjsstyle + ' ' + dep + subprocess.call(['python', fixjsstyle, dep]) + print reformat + ' -f ' + dep + subprocess.call(['python', reformat, '-f', dep]) + +def format_all_targets(): + for target in targets.keys(): + format_target(target) + +def pass_or_fail(): + if total_errors + total_warnings == 0: + print "Passed" + elif len(results) > 1: #display the summary only when building more than one target + passed = [k for k, v in results.iteritems() if v[0] + v[1] == 0] + failed = dict((k, v) for k, v in results.iteritems() if v[0] + v[1] != 0) + print "\nBuild Summary:" + # Print first the tests that passed + for target in passed: + print "{0:>30}\tPassed".format(target+":") + + # Print tests that failed. Fixed-width to improve readability + for target in failed: + errors = failed[target][0] + warnings = failed[target][1] + print "{0:>30}\tErrors: {1:4}\tWarnings: {2:4}".format(target+":", errors, warnings) + print "Compilation failed: {} error(s), {} warning(s).".format(total_errors, total_warnings) + +def main(argv): + if len(argv) == 0: + build_all_deps() + build_all_targets() + buildDepsFile() + pass_or_fail() + elif (argv[0] == 'deps'): + if len(argv) == 2: + target = argv[1] + build_deps(target, targets[target]) + else: + build_all_deps() + elif (argv[0] == 'format'): + if len(argv) == 2: + target = argv[1] + format_target(target) + else: + format_all_targets() + elif (argv[0] == 'build'): + if len(argv) == 2: + target = argv[1] + build_target(target, targets[target]) + else: + build_all_targets() + pass_or_fail() + elif (argv[0] == 'depfile'): + buildDepsFile() + elif (argv[0] == 'list'): + print "List of available targets:" + for target in targets.keys(): + print "\t{}".format(target) + else: + target = argv[0] + build_deps(target, targets[target]) + build_target(target, targets[target]) + pass_or_fail() + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/compiler.jar b/dom/canvas/test/webgl-conf/checkout/deqp/compiler.jar new file mode 100644 index 000000000..940f408ee Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/deqp/compiler.jar differ diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js b/dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js new file mode 100644 index 000000000..814a16e4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js @@ -0,0 +1,111 @@ +/* +** Copyright (c) 2015 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. +*/ + +/* Author: Mobica LTD */ + +/** + * @typedef {function(*): boolean} + */ +ArrayBuffer.isView; + +/** + * @param {?string} msg + */ +function description(msg){}; + +function finishTest(){}; + +/** @type {string} */ var _currentTestName; +/** + * @param {?string} name + */ +function setCurrentTestName(name){}; + +/** + * @param {string} msg + */ +function bufferedLogToConsole(msg){}; + +/** + * @constructor + * @param {string} message The error message. + */ +var TestFailedException = function (message) {}; + +/** + * Shows a message in case expression test fails. + * @param {boolean} exp + * @param {string} message + */ +function checkMessage(exp, message) {}; + +/** + * @param {boolean} assertion + * @param {?string} msg + * @param {boolean} verbose + * @param {boolean} exthrow + */ +function assertMsgOptions(assertion, msg, verbose, exthrow) {}; + +/** + * @param {Object|string} msg + */ +function debug(msg){}; + +/** + * @param {string} msg + * @param {boolean} exthrow + */ +function testFailedOptions(msg, exthrow){}; + +/** + * @param {string} msg + * @param {boolean} exthrow + */ +function testPassedOptions(msg, exthrow){}; + +/** + * @param {string=} msg + */ +function testFailed(msg){}; + +/** + * @param {string=} msg + */ +function testPassed(msg){}; + +/** + * Defines the exception type for a GL error. + * @constructor + * @param {string} message The error message. + * @param {number} error GL error code + */ +WebGLTestUtils.GLErrorException = function(message, error){ /** @type {string} */ this.message; }; + +/** @type {WebGL2RenderingContext} */ var gl; +/** @type {HTMLElement} */ var canvas; +/** @type {Object} */ var wtu; + +/** @type {{create3DContext: function(string):WebGL2RenderingContext, + loadTextFileAsync: function(string, function(boolean, string)), + glEnumToString: function(WebGL2RenderingContext, number):string }} */ var WebGLTestUtils; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt new file mode 100644 index 000000000..035e839a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt @@ -0,0 +1,15 @@ +conditionals.html +constants.html +constant_expressions.html +conversions.html +declarations.html +fragdata.html +functions.html +invalid_texture_functions.html +keywords.html +linkage.html +preprocessor.html +qualification_order.html +reserved_operators.html +scoping.html +swizzles.html diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html new file mode 100644 index 000000000..c80304c55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test new file mode 100644 index 000000000..7b5f59114 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test @@ -0,0 +1,333 @@ +group if "If Statements" + + case single_statement + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + if (in0 >= 1.0) + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case compound_statement + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (in0 >= 1.0) + { + out0 = 1.0; + out1 = 0.0; + } + ${OUTPUT} + } + "" + end + + case sequence_statements + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (in0 >= 1.0) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case sequence_condition + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (false, in0 >= 1.0) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case complex_condition + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0)) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case if_else + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 1.0) + out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case if_elseif + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + if (in0 >= 2.0) + out0 = 2.0; + else if (in0 >= 1.0) + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case if_elseif_else + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 2.0) + out0 = 2.0; + else if (in0 >= 1.0) + out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case mixed_if_elseif_else + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 2.0) + { + out0 = 2.0; + } + else if (in0 >= 1.0) + out0 = 2.0, out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + +end # if + +group invalid_if "Invalid If Conditionals" + + case missing_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + if true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + if (true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (5) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_zero_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_one_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (1) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_uniform_condition + expect compile_fail + + both "" + precision mediump float; + precision mediump int; + uniform int u0; + void main() + { + if (u0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (5.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_zero_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (0.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_one_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (1.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case sampler_condition + expect compile_fail + both "" + precision mediump float; + uniform sampler2D s0; + void main() + { + if (s0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_if diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html new file mode 100644 index 000000000..db92c09fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test new file mode 100644 index 000000000..355a4432a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test @@ -0,0 +1,288 @@ +group trivial "Trivial expressions" + + case float + values { output float out0 = 5.0; } + both "" + + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = 5.0; + out0 = a; + ${OUTPUT} + } + "" + end + + case int + values { output int out0 = 5; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a = 5; + out0 = a; + ${OUTPUT} + } + "" + end + + case bool + values { output bool out0 = true; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const bool a = true; + out0 = a; + ${OUTPUT} + } + "" + end + + case cast + values { output float out0 = 1.0; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = float(int(bool(true))); + out0 = a; + ${OUTPUT} + } + "" + end + +end # trivial + +group operators "Operators" + + case math_float + values { output float out0 = 2.19; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = 6.0/3.5 + 1.8*2.6 - 4.2; + out0 = a; + ${OUTPUT} + } + "" + end + + case math_vec + values { output float out0 = 15.0; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const vec3 a = (vec4(1.0, 2.0, 3.0, 4.0).zyx * vec3(1.0, 1.5, 3.0).xyz).xzy + (vec2(5.0)/vec2(2.5)).xxy; + out0 = a.x + a.y + a.z; + ${OUTPUT} + } + "" + end + + case math_int + values { output int out0 = 7; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const int a = 5-1 + 2*3 - 9/3; + out0 = a; + ${OUTPUT} + } + "" + end + + case math_ivec + values { output int out0 = 21; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const ivec3 a = ivec2(5-1, 4).xxy + ivec4(1*3, 9/3, 1+2, 8/4).xyz; + out0 = a.x + a.y + a.z; + ${OUTPUT} + } + "" + end + + case math_mat + values { output float out0 = 8.0; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const mat3 a = mat3(3.0) * mat3(4.0); + const mat4 b = mat4(a[1][1])*2.0; + const mat2 c = mat2(b[0][0]) / 3.0; + out0 = c[0][0]+c[1][0]; + ${OUTPUT} + } + "" + end + + case logical + values { output bool out0 = true; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const bool a = (!false || false) && (true ^^ false); + out0 = a; + ${OUTPUT} + } + "" + end + + case compare + values { output bool out0 = true; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const bool a = (false == false) && (true != false) && (1 < 2) && (3 <= 3) && ((1 > 1) != (1 >= 1)); + out0 = a; + ${OUTPUT} + } + "" + end + + case selection + values { output float out0 = 5.3; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = false ? 0.0 : (true ? 5.3 : 1.0); + out0 = a; + ${OUTPUT} + } + "" + end + +end # operators + +group complex_types "Arrays, structs & nested calls" + + case struct + values { output float out0 = 260.922; } + both "" + precision highp float; + ${DECLARATIONS} + + struct S + { + vec4 a; + int b; + }; + + void main() + { + const S s = S(vec4(1.5), 123); + out0 = length(s.a.xy)*float(s.b); + ${OUTPUT} + } + "" + end + + case nested_struct + values { output float out0 = 965.9; } + both "" + precision highp float; + ${DECLARATIONS} + + struct S + { + vec4 v; + int i; + }; + + struct T + { + S s; + bool b; + int i; + }; + + struct U + { + S s; + T t; + }; + + void main() + { + const S s = S(vec4(1.5), 123); + const T t = T(s, false, 3); + const U u = U(s, t); + const U v = U(S(vec4(1.3), 4), T(S(vec4(2.0), 5), true, 6)); + out0 = float(u.s.i*v.t.i + v.t.s.i)*v.s.v.x; // float(123*6 + 5)*1.3 + ${OUTPUT} + } + "" + end + + case array + values + { + input float in0 = [ 0.0 | 1.0]; + output float out0 = [0.0 | 1.0]; + } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + float a[int(max(-1.0, 2.0))]; + a[0] = -1.0; + a[1] = in0; + out0 = a[int(min(1.0, 2.0))]; + ${OUTPUT} + } + "" + end + + case nested_builtin_funcs + values { output float out0 = 3.05; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = sqrt( atan(sin(1.5)/cos(1.5)) /*1.5*/ * log2(exp2(log(exp(6.2) + 0.1)) + 0.1) /*~6.2*/); + out0 = a; + ${OUTPUT} + } + "" + end + +end # complex_types diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html new file mode 100644 index 000000000..d0c7c8662 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test new file mode 100644 index 000000000..c3887e708 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test @@ -0,0 +1,662 @@ +case float_input + values + { + input float in0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + } + values + { + input float in0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ]; + output float out0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ]; + } + + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = in0; + ${OUTPUT} + } + "" +end + +case float_uniform + values + { + uniform float uni0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + } + + both "" + precision highp float; + ${DECLARATIONS} + uniform float uni0; + void main() + { + out0 = uni0; + ${OUTPUT} + } + "" +end + +case float_0 + values { output float out0 = 1.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = +1.123; + ${OUTPUT} + } + "" +end + +case float_1 + values { output float out0 = -1.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.123; + ${OUTPUT} + } + "" +end + +case float_2 + values { output float out0 = 123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123.; + ${OUTPUT} + } + "" +end + +case float_3 + values { output float out0 = 0.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = .123; + ${OUTPUT} + } + "" +end + +case float_4 + values { output float out0 = 123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e+2; + ${OUTPUT} + } + "" +end + +case float_5 + values { output float out0 = -123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23E+2; + ${OUTPUT} + } + "" +end + +case float_6 + values { output float out0 = -123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23e2; + ${OUTPUT} + } + "" +end + +case float_7 + values { output float out0 = 0.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e-1; + ${OUTPUT} + } + "" +end + +case float_8 + values { output float out0 = 1000.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1e3; + ${OUTPUT} + } + "" +end + +case int_0 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123; + ${OUTPUT} + } + "" +end + +case int_1 + values { output int out0 = -321; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -321; + ${OUTPUT} + } + "" +end + +case int_2 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0x7B; + ${OUTPUT} + } + "" +end + +case int_3 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0X7b; + ${OUTPUT} + } + "" +end + +case int_4 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0173; + ${OUTPUT} + } + "" +end + +case bool_0 + values { output bool out0 = true; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = true; + ${OUTPUT} + } + "" +end + +case bool_1 + values { output bool out0 = false; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = false; + ${OUTPUT} + } + "" +end + +case const_float_global + values { output float out0 = 1000.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 1000.0; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_main + values { output float out0 = -1000.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant = -1000.0; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_function + values { output float out0 = -0.012; } + + both "" + precision mediump float; + ${DECLARATIONS} + float func() + { + const float theConstant = -0.012; + return theConstant; + } + void main() + { + out0 = func(); + ${OUTPUT} + } + "" +end + +case const_float_scope + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_1 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant = 100.0; + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_2 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + void main() + { + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_3 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_4 + values { output float out0 = 2.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + float func() + { + const float theConstant = 2.0; + return theConstant; + } + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = func(); + } + ${OUTPUT} + } + "" +end + +case const_float_operations_with_const + values { output float out0 = 21.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theGlobalConstant = 10.0; + float func() + { + const float theConstant = 2.0; + return theConstant; + } + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = func() * theGlobalConstant + theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_assignment_1 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_2 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + } + ${OUTPUT} + } + "" +end + +case const_float_assignment_3 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant1 = 10.0; + void main() + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_4 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant1 = 10.0; + float func() + { + const float theConstant2 = theConstant1; + return theConstant2; + } + void main() + { + out0 = func(); + ${OUTPUT} + } + "" +end + +case const_float_assign_uniform + expect compile_fail + values { output float out0 = 10.0; } + both "" + precision mediump float; + ${DECLARATIONS} + uniform float theUniform; + void main() + { + const float theConstant = theUniform; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_varying + expect compile_fail + values { output float out0 = 10.0; } + vertex "" + ${VERTEX_DECLARATIONS} + varying float theVarying; + void main() + { + theVarying = 1.0; + gl_Position = vec(1.0); + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float theVarying; + void main() + { + const float theConstant = theVarying; + out0 = theConstant; + ${FRAGMENT_OUTPUT} + } + "" +end + +case const_float_function_gotcha + desc "Function constant parameters are not really constants, so using them as constant expressions should fail." + expect compile_fail + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + float func(const float gotcha) + { + const float theConstant2 = gotcha; + return theConstant2*2.0; + } + void main() + { + const float theConstant = 10.0; + out0 = func(theConstant); + ${OUTPUT} + } + "" +end + +case const_float_from_int + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = float(10); + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec2 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec2(1.0, 10.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec3 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec3(1.0, 10.0, 20.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec4 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec4(1.0, 10.0, 20.0, -10.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_variable_1 + expect compile_fail + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + float theVariable = 20.0; + const float theConstant = theVariable; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_variable_2 + expect compile_fail + values { output float out0 = 50.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + float theVariable = 20.0; + theVariable += 30.0; + const float theConstant = theVariable; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_user_func + expect compile_fail + values { output float out0 = 50.0; } + both "" + precision mediump float; + ${DECLARATIONS} + float func() + { + return 50.0; + } + void main() + { + const float theConstant = func(); + out0 = theConstant; + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.html new file mode 100644 index 000000000..40aa8c862 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test new file mode 100644 index 000000000..51dd9c237 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test @@ -0,0 +1,5930 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group scalar_to_scalar "Scalar to Scalar Conversions" + + case float_to_float + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case float_to_int + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output int out0 = [ 0 | 1 | 2 | 3 | 0 | -8 | -20 | 36 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case float_to_bool + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bool out0 = [ false | true | true | true | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case int_to_float + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 | 5.0 | 8.0 | 11.0 | -12.0 | -66.0 | -192.0 | 255.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case int_to_int + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output int out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case int_to_bool + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bool out0 = [ false | true | true | true | true | true | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bool_to_float + values + { + input bool in0 = [ true | false ]; + output float out0 = [ 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bool_to_int + values + { + input bool in0 = [ true | false ]; + output int out0 = [ 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_scalar +group scalar_to_vector "Scalar to Vector Conversions" + + case float_to_vec2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(3.5, 3.5) | vec2(-0.5, -0.5) | vec2(-8.25, -8.25) | vec2(-20.125, -20.125) | vec2(36.8125, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(3.5, 3.5, 3.5) | vec3(-0.5, -0.5, -0.5) | vec3(-8.25, -8.25, -8.25) | vec3(-20.125, -20.125, -20.125) | vec3(36.8125, 36.8125, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.5, 3.5, 3.5, 3.5) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-8.25, -8.25, -8.25, -8.25) | vec4(-20.125, -20.125, -20.125, -20.125) | vec4(36.8125, 36.8125, 36.8125, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(3, 3) | ivec2(0, 0) | ivec2(-8, -8) | ivec2(-20, -20) | ivec2(36, 36) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(0, 0, 0) | ivec3(-8, -8, -8) | ivec3(-20, -20, -20) | ivec3(36, 36, 36) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(0, 0, 0, 0) | ivec4(-8, -8, -8, -8) | ivec4(-20, -20, -20, -20) | ivec4(36, 36, 36, 36) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(5.0, 5.0) | vec2(8.0, 8.0) | vec2(11.0, 11.0) | vec2(-12.0, -12.0) | vec2(-66.0, -66.0) | vec2(-192.0, -192.0) | vec2(255.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(5.0, 5.0, 5.0) | vec3(8.0, 8.0, 8.0) | vec3(11.0, 11.0, 11.0) | vec3(-12.0, -12.0, -12.0) | vec3(-66.0, -66.0, -66.0) | vec3(-192.0, -192.0, -192.0) | vec3(255.0, 255.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(5.0, 5.0, 5.0, 5.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(11.0, 11.0, 11.0, 11.0) | vec4(-12.0, -12.0, -12.0, -12.0) | vec4(-66.0, -66.0, -66.0, -66.0) | vec4(-192.0, -192.0, -192.0, -192.0) | vec4(255.0, 255.0, 255.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(5, 5) | ivec2(8, 8) | ivec2(11, 11) | ivec2(-12, -12) | ivec2(-66, -66) | ivec2(-192, -192) | ivec2(255, 255) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(5, 5, 5) | ivec3(8, 8, 8) | ivec3(11, 11, 11) | ivec3(-12, -12, -12) | ivec3(-66, -66, -66) | ivec3(-192, -192, -192) | ivec3(255, 255, 255) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(5, 5, 5, 5) | ivec4(8, 8, 8, 8) | ivec4(11, 11, 11, 11) | ivec4(-12, -12, -12, -12) | ivec4(-66, -66, -66, -66) | ivec4(-192, -192, -192, -192) | ivec4(255, 255, 255, 255) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec2 + values + { + input bool in0 = [ true | false ]; + output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec3 + values + { + input bool in0 = [ true | false ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec4 + values + { + input bool in0 = [ true | false ]; + output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec2 + values + { + input bool in0 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec3 + values + { + input bool in0 = [ true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec4 + values + { + input bool in0 = [ true | false ]; + output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec2 + values + { + input bool in0 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec3 + values + { + input bool in0 = [ true | false ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec4 + values + { + input bool in0 = [ true | false ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_vector +group vector_to_scalar "Vector to Scalar Conversions" + + case vec2_to_float + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_int + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bool + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_float + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_int + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bool + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_float + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_int + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bool + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_float + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_int + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bool + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_float + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_int + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bool + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_float + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_int + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bool + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_float + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_int + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bool + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_float + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_int + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bool + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_float + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_int + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bool + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_scalar +group vector_illegal "Illegal Vector Conversions" + + case vec2_to_vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + +end # vector_illegal +group vector_to_vector "Vector to Vector Conversions" + + case vec4_to_vec4 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec3 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec2 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec4 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec3 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec2 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec4 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec4 out0 = [ bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec3 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec2 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, -2.0, -4.0, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec3 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec2 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec3 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec2 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec3 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec2 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec4 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 1.0) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(0.0, 1.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec3 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec2 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec4 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec4 out0 = [ ivec4(1, 0, 0, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 1, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec3 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec2 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec4 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec3 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec2 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec3 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec3 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec3 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec3 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec2 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec3 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec2 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec3 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec2 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec3 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec2 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec3 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec2 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec3 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec2 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_vec2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec2 + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec2 + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec2 + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_vector +group scalar_to_matrix "Scalar to Matrix Conversions" + + case float_to_mat4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25) | mat4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125) | mat4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5) | mat3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5) | mat3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25) | mat3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125) | mat3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.5, 0.0, 0.0, 3.5) | mat2(-0.5, 0.0, 0.0, -0.5) | mat2(-8.25, 0.0, 0.0, -8.25) | mat2(-20.125, 0.0, 0.0, -20.125) | mat2(36.8125, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0) | mat4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0) | mat4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0) | mat4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0) | mat3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0) | mat3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0) | mat3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(5.0, 0.0, 0.0, 5.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(11.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, -12.0) | mat2(-66.0, 0.0, 0.0, -66.0) | mat2(-192.0, 0.0, 0.0, -192.0) | mat2(255.0, 0.0, 0.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4 + values + { + input bool in0 = [ true | false ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3 + values + { + input bool in0 = [ true | false ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2 + values + { + input bool in0 = [ true | false ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_matrix +group matrix_to_matrix "Matrix to Matrix Conversions" + + case mat4_to_mat4 + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3 + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2 + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4 + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.03125, 0.0625, 0.0, -0.75, 0.015625, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3 + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2 + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.03125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4 + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3 + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0) | mat3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2 + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + +end # matrix_to_matrix +group vector_combine "Vector Combine Constructors" + + case vec2_vec2_to_vec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(-0.5, -2.25, -32.0, 64.0) | vec4(-32.0, 64.0, 1.0, 1.25) | vec4(1.0, 1.25, 0.0, 0.5) | vec4(0.0, 0.5, -0.5, -2.25) | vec4(-0.75, -0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_ivec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output ivec4 out0 = [ ivec4(0, -2, -32, 64) | ivec4(-32, 64, 1, 1) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_bvec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_vec4 + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 1.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) | vec4(1.0, 1.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_ivec4 + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output ivec4 out0 = [ ivec4(0, 0, 1, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 1) | ivec4(0, 0, 1, 1) | ivec4(1, 1, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_bvec4 + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, false, false, false) | bvec4(false, true, false, true) | bvec4(false, false, true, true) | bvec4(true, true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_vec4 + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output vec4 out0 = [ vec4(1.0, 0.0, 3.5, 3.5) | vec4(0.0, 36.8125, 36.8125, 36.8125) | vec4(-0.5, -8.25, -8.25, 1.0) | vec4(-8.25, 2.0, 1.0, -8.25) | vec4(3.5, 3.5, 2.0, 2.0) | vec4(-20.125, 1.0, 0.0, 0.0) | vec4(36.8125, -20.125, -20.125, -0.5) | vec4(2.0, -0.5, -0.5, -20.125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_ivec4 + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output ivec4 out0 = [ ivec4(1, 0, 3, 3) | ivec4(0, 36, 36, 36) | ivec4(0, -8, -8, 1) | ivec4(-8, 2, 1, -8) | ivec4(3, 3, 2, 2) | ivec4(-20, 1, 0, 0) | ivec4(36, -20, -20, 0) | ivec4(2, 0, 0, -20) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_bvec4 + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_vec4 + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output vec4 out0 = [ vec4(-12.0, 2.0, 11.0, -192.0) | vec4(-66.0, 5.0, 255.0, -66.0) | vec4(2.0, -66.0, 5.0, 8.0) | vec4(5.0, 11.0, 8.0, -12.0) | vec4(8.0, -192.0, 2.0, 1.0) | vec4(-192.0, 8.0, -192.0, 2.0) | vec4(255.0, -12.0, -12.0, 0.0) | vec4(1.0, 1.0, -66.0, 255.0) | vec4(0.0, 255.0, 1.0, 5.0) | vec4(11.0, 0.0, 0.0, 11.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_ivec4 + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output ivec4 out0 = [ ivec4(-12, 2, 11, -192) | ivec4(-66, 5, 255, -66) | ivec4(2, -66, 5, 8) | ivec4(5, 11, 8, -12) | ivec4(8, -192, 2, 1) | ivec4(-192, 8, -192, 2) | ivec4(255, -12, -12, 0) | ivec4(1, 1, -66, 255) | ivec4(0, 255, 1, 5) | ivec4(11, 0, 0, 11) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_bvec4 + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_vec4 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output vec4 out0 = [ vec4(1.0, 0.0, 1.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_ivec4 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output ivec4 out0 = [ ivec4(1, 0, 1, 0) | ivec4(0, 1, 0, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_bvec4 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(false, true, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_vec4 + values + { + input bool in0 = [ true | true | true | false | false | false | true | false | true | false ]; + input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ]; + input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ]; + input bool in3 = [ true | true | false | false | true | false | false | false | true | true ]; + output vec4 out0 = [ vec4(1.0, 1.0, -192.0, 1.0) | vec4(1.0, 2.0, -12.0, 1.0) | vec4(1.0, 1.0, 2.0, 0.0) | vec4(0.0, 0.0, -66.0, 0.0) | vec4(0.0, 36.8125, 255.0, 1.0) | vec4(0.0, -8.25, 8.0, 0.0) | vec4(1.0, -0.5, 0.0, 0.0) | vec4(0.0, 3.5, 5.0, 0.0) | vec4(1.0, -20.125, 11.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_ivec4 + values + { + input bool in0 = [ true | true | true | false | false | false | true | false | true | false ]; + input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ]; + input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ]; + input bool in3 = [ true | true | false | false | true | false | false | false | true | true ]; + output ivec4 out0 = [ ivec4(1, 1, -192, 1) | ivec4(1, 2, -12, 1) | ivec4(1, 1, 2, 0) | ivec4(0, 0, -66, 0) | ivec4(0, 36, 255, 1) | ivec4(0, -8, 8, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 3, 5, 0) | ivec4(1, -20, 11, 1) | ivec4(0, 0, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_bvec4 + values + { + input bool in0 = [ true | true | true | false | false | false | true | false | true | false ]; + input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ]; + input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ]; + input bool in3 = [ true | true | false | false | true | false | false | false | true | true ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(false, false, true, false) | bvec4(false, true, true, true) | bvec4(false, true, true, false) | bvec4(true, true, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_vec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ]; + output vec4 out0 = [ vec4(-0.5, -2.25, 0.0, 0.0) | vec4(0.0, 0.5, 0.0, -2.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_ivec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ]; + output ivec4 out0 = [ ivec4(0, -2, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_bvec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, true, false, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_vec4 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ]; + output vec4 out0 = [ vec4(-32.0, 64.0, 0.0, 0.0) | vec4(-0.5, -2.25, 1.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(0.0, 0.5, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_ivec4 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ]; + output ivec4 out0 = [ ivec4(-32, 64, 0, 0) | ivec4(0, -2, 1, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_bvec4 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_vec4 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ]; + input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, -20.125) | vec4(0.0, 0.0, 0.0, 2.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 1.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 36.8125) | vec4(1.0, 1.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_ivec4 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ]; + input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ]; + output ivec4 out0 = [ ivec4(1, 0, 0, -8) | ivec4(0, 0, 0, -20) | ivec4(0, 0, 0, 2) | ivec4(0, 0, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 3) | ivec4(0, 1, 0, 36) | ivec4(1, 1, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_bvec4 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ]; + input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_vec4 + values + { + input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ]; + output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, 36.8125) | vec4(0.0, 0.5, 0.75, 3.5) | vec4(1.0, 1.25, 1.125, 1.0) | vec4(-0.5, -2.25, -4.875, -0.5) | vec4(-32.0, 64.0, -51.0, -8.25) | vec4(1.0, 1.25, 1.125, -20.125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_ivec4 + values + { + input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, 36) | ivec4(0, 0, 0, 3) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 0) | ivec4(-32, 64, -51, -8) | ivec4(1, 1, 1, -20) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_bvec4 + values + { + input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_vec4 + values + { + input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ]; + input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ]; + output vec4 out0 = [ vec4(-66.0, 0.0, 0.0, 8.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(-192.0, -32.0, 64.0, 11.0) | vec4(255.0, -32.0, 64.0, -192.0) | vec4(5.0, 1.0, 1.0, 255.0) | vec4(-12.0, 0.0, 0.0, -12.0) | vec4(0.0, 1.0, 1.0, 0.0) | vec4(2.0, 0.0, -2.0, -66.0) | vec4(1.0, 0.0, -2.0, 1.0) | vec4(11.0, 0.0, 0.0, 5.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_ivec4 + values + { + input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ]; + input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ]; + output ivec4 out0 = [ ivec4(-66, 0, 0, 8) | ivec4(8, 0, 0, 2) | ivec4(-192, -32, 64, 11) | ivec4(255, -32, 64, -192) | ivec4(5, 1, 1, 255) | ivec4(-12, 0, 0, -12) | ivec4(0, 1, 1, 0) | ivec4(2, 0, -2, -66) | ivec4(1, 0, -2, 1) | ivec4(11, 0, 0, 5) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_bvec4 + values + { + input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ]; + input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, true, false) | bvec4(true, false, true, true) | bvec4(true, false, true, true) | bvec4(true, false, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_vec4 + values + { + input bool in0 = [ true | true | true | true | false | false | false | false ]; + input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + output vec4 out0 = [ vec4(1.0, 2.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(1.0, 3.5, -32.0, 64.0) | vec4(1.0, -8.25, 1.0, 1.0) | vec4(0.0, 36.8125, 0.0, -2.0) | vec4(0.0, -20.125, 0.0, -2.0) | vec4(0.0, 1.0, 1.0, 1.0) | vec4(0.0, -0.5, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_ivec4 + values + { + input bool in0 = [ true | true | true | true | false | false | false | false ]; + input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(1, 2, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(1, 3, -32, 64) | ivec4(1, -8, 1, 1) | ivec4(0, 36, 0, -2) | ivec4(0, -20, 0, -2) | ivec4(0, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_bvec4 + values + { + input bool in0 = [ true | true | true | true | false | false | false | false ]; + input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(false, true, true, true) | bvec4(false, true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_vec3 + values + { + input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ]; + input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ]; + input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ]; + output vec3 out0 = [ vec3(3.5, -0.5, 0.0) | vec3(2.0, 1.0, 1.0) | vec3(-20.125, 2.0, 3.5) | vec3(-8.25, -20.125, -8.25) | vec3(36.8125, 0.0, -0.5) | vec3(1.0, -8.25, 36.8125) | vec3(0.0, 36.8125, -20.125) | vec3(-0.5, 3.5, 2.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_ivec3 + values + { + input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ]; + input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ]; + input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ]; + output ivec3 out0 = [ ivec3(3, 0, 0) | ivec3(2, 1, 1) | ivec3(-20, 2, 3) | ivec3(-8, -20, -8) | ivec3(36, 0, 0) | ivec3(1, -8, 36) | ivec3(0, 36, -20) | ivec3(0, 3, 2) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_bvec3 + values + { + input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ]; + input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ]; + input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ]; + output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_vec3 + values + { + input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ]; + input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ]; + input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ]; + output vec3 out0 = [ vec3(0.0, 2.0, -192.0) | vec3(2.0, 8.0, -12.0) | vec3(1.0, 11.0, -66.0) | vec3(5.0, -12.0, 8.0) | vec3(255.0, -192.0, 1.0) | vec3(8.0, 1.0, 2.0) | vec3(-66.0, -66.0, 5.0) | vec3(11.0, 5.0, 11.0) | vec3(-12.0, 255.0, 255.0) | vec3(-192.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_ivec3 + values + { + input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ]; + input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ]; + input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ]; + output ivec3 out0 = [ ivec3(0, 2, -192) | ivec3(2, 8, -12) | ivec3(1, 11, -66) | ivec3(5, -12, 8) | ivec3(255, -192, 1) | ivec3(8, 1, 2) | ivec3(-66, -66, 5) | ivec3(11, 5, 11) | ivec3(-12, 255, 255) | ivec3(-192, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_bvec3 + values + { + input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ]; + input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ]; + input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_vec3 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_ivec3 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_bvec3 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_vec3 + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | false | true ]; + input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ]; + input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ]; + output vec3 out0 = [ vec3(0.0, 0.0, -12.0) | vec3(1.0, 2.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, -0.5, 5.0) | vec3(0.0, -8.25, -66.0) | vec3(1.0, 3.5, 255.0) | vec3(0.0, -20.125, 11.0) | vec3(1.0, 1.0, 0.0) | vec3(0.0, 0.0, 8.0) | vec3(1.0, 36.8125, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_ivec3 + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | false | true ]; + input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ]; + input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ]; + output ivec3 out0 = [ ivec3(0, 0, -12) | ivec3(1, 2, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, -8, -66) | ivec3(1, 3, 255) | ivec3(0, -20, 11) | ivec3(1, 1, 0) | ivec3(0, 0, 8) | ivec3(1, 36, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_bvec3 + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | false | true ]; + input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ]; + input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, false) | bvec3(false, false, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_vec3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input bool in1 = [ false | true | false | true | true ]; + output vec3 out0 = [ vec3(-0.75, -0.0322580645161, 0.0) | vec3(1.0, 1.25, 1.0) | vec3(-0.5, -2.25, 0.0) | vec3(0.0, 0.5, 1.0) | vec3(-32.0, 64.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_ivec3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input bool in1 = [ false | true | false | true | true ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_bvec3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input bool in1 = [ false | true | false | true | true ]; + output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(false, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_vec3 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ]; + output vec3 out0 = [ vec3(1.0, 0.0, 2.0) | vec3(0.0, 0.0, 36.8125) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 1.0, -20.125) | vec3(0.0, 0.0, 1.0) | vec3(0.0, 1.0, -0.5) | vec3(0.0, 0.0, -8.25) | vec3(1.0, 1.0, 3.5) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_ivec3 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ]; + output ivec3 out0 = [ ivec3(1, 0, 2) | ivec3(0, 0, 36) | ivec3(1, 0, 0) | ivec3(0, 1, -20) | ivec3(0, 0, 1) | ivec3(0, 1, 0) | ivec3(0, 0, -8) | ivec3(1, 1, 3) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_bvec3 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, true) | bvec3(true, false, false) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_vec3 + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ]; + output vec3 out0 = [ vec3(0.0, 1.0, 0.0) | vec3(0.0, 1.0, 255.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 2.0) | vec3(0.0, 0.0, 8.0) | vec3(0.0, 0.0, 11.0) | vec3(1.0, 1.0, -192.0) | vec3(1.0, 0.0, 5.0) | vec3(1.0, 0.0, -12.0) | vec3(0.0, 0.0, -66.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_ivec3 + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ]; + output ivec3 out0 = [ ivec3(0, 1, 0) | ivec3(0, 1, 255) | ivec3(1, 1, 1) | ivec3(0, 0, 2) | ivec3(0, 0, 8) | ivec3(0, 0, 11) | ivec3(1, 1, -192) | ivec3(1, 0, 5) | ivec3(1, 0, -12) | ivec3(0, 0, -66) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_bvec3 + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, false, true) | bvec3(false, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_vec3 + values + { + input bool in0 = [ false | true | false | true | true ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 0.0, -2.0) | vec3(0.0, 0.0, 0.0) | vec3(1.0, -32.0, 64.0) | vec3(1.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_ivec3 + values + { + input bool in0 = [ false | true | false | true | true ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 0, -2) | ivec3(0, 0, 0) | ivec3(1, -32, 64) | ivec3(1, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_bvec3 + values + { + input bool in0 = [ false | true | false | true | true ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_vec2 + values + { + input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ]; + input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ]; + output vec2 out0 = [ vec2(2.0, 3.5) | vec2(3.5, -20.125) | vec2(-8.25, -0.5) | vec2(-0.5, 2.0) | vec2(0.0, 1.0) | vec2(-20.125, 0.0) | vec2(36.8125, 36.8125) | vec2(1.0, -8.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_ivec2 + values + { + input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ]; + input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ]; + output ivec2 out0 = [ ivec2(2, 3) | ivec2(3, -20) | ivec2(-8, 0) | ivec2(0, 2) | ivec2(0, 1) | ivec2(-20, 0) | ivec2(36, 36) | ivec2(1, -8) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_bvec2 + values + { + input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ]; + input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_vec2 + values + { + input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ]; + input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ]; + output vec2 out0 = [ vec2(8.0, -66.0) | vec2(255.0, 2.0) | vec2(-192.0, 255.0) | vec2(2.0, 8.0) | vec2(0.0, -12.0) | vec2(1.0, 5.0) | vec2(-12.0, -192.0) | vec2(11.0, 0.0) | vec2(-66.0, 1.0) | vec2(5.0, 11.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_ivec2 + values + { + input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ]; + input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ]; + output ivec2 out0 = [ ivec2(8, -66) | ivec2(255, 2) | ivec2(-192, 255) | ivec2(2, 8) | ivec2(0, -12) | ivec2(1, 5) | ivec2(-12, -192) | ivec2(11, 0) | ivec2(-66, 1) | ivec2(5, 11) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_bvec2 + values + { + input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ]; + input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_vec2 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_ivec2 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_bvec2 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_vec2 + values + { + input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ]; + input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ]; + output vec2 out0 = [ vec2(1.0, -192.0) | vec2(-0.5, -66.0) | vec2(-20.125, 255.0) | vec2(0.0, 1.0) | vec2(3.5, 2.0) | vec2(-8.25, 0.0) | vec2(36.8125, -12.0) | vec2(2.0, 5.0) | vec2(1.0, 11.0) | vec2(0.0, 8.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_ivec2 + values + { + input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ]; + input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ]; + output ivec2 out0 = [ ivec2(1, -192) | ivec2(0, -66) | ivec2(-20, 255) | ivec2(0, 1) | ivec2(3, 2) | ivec2(-8, 0) | ivec2(36, -12) | ivec2(2, 5) | ivec2(1, 11) | ivec2(0, 8) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_bvec2 + values + { + input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ]; + input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_vec2 + values + { + input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ]; + input bool in1 = [ true | false | false | false | true | true | false | true ]; + output vec2 out0 = [ vec2(2.0, 1.0) | vec2(-20.125, 0.0) | vec2(0.0, 0.0) | vec2(1.0, 0.0) | vec2(-8.25, 1.0) | vec2(-0.5, 1.0) | vec2(36.8125, 0.0) | vec2(3.5, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_ivec2 + values + { + input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ]; + input bool in1 = [ true | false | false | false | true | true | false | true ]; + output ivec2 out0 = [ ivec2(2, 1) | ivec2(-20, 0) | ivec2(0, 0) | ivec2(1, 0) | ivec2(-8, 1) | ivec2(0, 1) | ivec2(36, 0) | ivec2(3, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_bvec2 + values + { + input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ]; + input bool in1 = [ true | false | false | false | true | true | false | true ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_vec2 + values + { + input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ]; + input bool in1 = [ true | false | true | false | true | false | false | true | false | true ]; + output vec2 out0 = [ vec2(8.0, 1.0) | vec2(255.0, 0.0) | vec2(11.0, 1.0) | vec2(-66.0, 0.0) | vec2(0.0, 1.0) | vec2(-192.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 1.0) | vec2(5.0, 0.0) | vec2(2.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_ivec2 + values + { + input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ]; + input bool in1 = [ true | false | true | false | true | false | false | true | false | true ]; + output ivec2 out0 = [ ivec2(8, 1) | ivec2(255, 0) | ivec2(11, 1) | ivec2(-66, 0) | ivec2(0, 1) | ivec2(-192, 0) | ivec2(-12, 0) | ivec2(1, 1) | ivec2(5, 0) | ivec2(2, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_bvec2 + values + { + input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ]; + input bool in1 = [ true | false | true | false | true | false | false | true | false | true ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + +end # vector_combine +group matrix_combine "Matrix Combine Constructors" + + case vec2_vec2_to_mat2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) ]; + input vec2 in1 = [ vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ]; + output mat2 out0 = [ mat2(0.0, 0.5, -0.5, -2.25) | mat2(1.0, 1.25, -0.75, -0.0322580645161) | mat2(-32.0, 64.0, -32.0, 64.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.5) | mat2(-0.5, -2.25, 1.0, 1.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_mat2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_mat2 + values + { + input float in0 = [ 0.0 | -0.5 | -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | -8.25 ]; + input float in1 = [ -8.25 | 2.0 | -0.5 | -20.125 | 3.5 | 1.0 | 36.8125 | 0.0 ]; + input float in2 = [ 36.8125 | -8.25 | 3.5 | 2.0 | -0.5 | -20.125 | 1.0 | 0.0 ]; + input float in3 = [ 36.8125 | 0.0 | 2.0 | 3.5 | -8.25 | -0.5 | -20.125 | 1.0 ]; + output mat2 out0 = [ mat2(0.0, -8.25, 36.8125, 36.8125) | mat2(-0.5, 2.0, -8.25, 0.0) | mat2(-20.125, -0.5, 3.5, 2.0) | mat2(2.0, -20.125, 2.0, 3.5) | mat2(36.8125, 3.5, -0.5, -8.25) | mat2(1.0, 1.0, -20.125, -0.5) | mat2(3.5, 36.8125, 1.0, -20.125) | mat2(-8.25, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_mat2 + values + { + input int in0 = [ 2 | 0 | -66 | 8 | 1 | 255 | 5 | -12 | 11 | -192 ]; + input int in1 = [ -192 | 2 | 5 | -12 | -66 | 255 | 8 | 1 | 11 | 0 ]; + input int in2 = [ 2 | 11 | -192 | 255 | 1 | 5 | 0 | -12 | 8 | -66 ]; + input int in3 = [ 255 | 0 | 11 | -66 | 2 | 8 | -192 | 1 | -12 | 5 ]; + output mat2 out0 = [ mat2(2.0, -192.0, 2.0, 255.0) | mat2(0.0, 2.0, 11.0, 0.0) | mat2(-66.0, 5.0, -192.0, 11.0) | mat2(8.0, -12.0, 255.0, -66.0) | mat2(1.0, -66.0, 1.0, 2.0) | mat2(255.0, 255.0, 5.0, 8.0) | mat2(5.0, 8.0, 0.0, -192.0) | mat2(-12.0, 1.0, -12.0, 1.0) | mat2(11.0, 11.0, 8.0, -12.0) | mat2(-192.0, 0.0, -66.0, 5.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_mat2 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output mat2 out0 = [ mat2(0.0, 0.0, 1.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_mat2 + values + { + input bool in0 = [ false | true | true | false | false | true | true | true | false | false ]; + input float in1 = [ -0.5 | -20.125 | 3.5 | 2.0 | 1.0 | 0.0 | 0.0 | 1.0 | 36.8125 | -8.25 ]; + input int in2 = [ -66 | -192 | 5 | 255 | 0 | -12 | 11 | 1 | 2 | 8 ]; + input bool in3 = [ true | false | true | false | false | false | true | false | true | true ]; + output mat2 out0 = [ mat2(0.0, -0.5, -66.0, 1.0) | mat2(1.0, -20.125, -192.0, 0.0) | mat2(1.0, 3.5, 5.0, 1.0) | mat2(0.0, 2.0, 255.0, 0.0) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, -12.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 36.8125, 2.0, 1.0) | mat2(0.0, -8.25, 8.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_mat2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output mat2 out0 = [ mat2(0.0, 0.5, -32.0, 64.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, -2.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.0) | mat2(1.0, 1.25, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_mat2 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) ]; + output mat2 out0 = [ mat2(-32.0, 64.0, 0.0, 1.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(0.0, 0.5, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_mat2 + values + { + input bvec3 in0 = [ bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in1 = [ -20.125 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ]; + output mat2 out0 = [ mat2(0.0, 1.0, 0.0, -20.125) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(0.0, 0.0, 0.0, 3.5) | mat2(1.0, 0.0, 0.0, -8.25) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 2.0) | mat2(0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_mat2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ -8.25 | 36.8125 | -0.5 | -20.125 | 1.0 | 2.0 | 0.0 | 3.5 ]; + output mat2 out0 = [ mat2(0.0, 0.5, 0.75, -8.25) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(-0.75, -0.0322580645161, 0.0526315789474, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(0.0, 0.5, 0.75, 1.0) | mat2(-32.0, 64.0, -51.0, 2.0) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 3.5) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_mat2 + values + { + input int in0 = [ -66 | 255 | 8 | 0 | 5 | -12 | 1 | -192 | 2 | 11 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + input int in2 = [ 0 | -12 | 8 | -66 | 11 | 5 | 255 | 2 | 1 | -192 ]; + output mat2 out0 = [ mat2(-66.0, 0.0, -2.0, 0.0) | mat2(255.0, 0.0, 0.0, -12.0) | mat2(8.0, -32.0, 64.0, 8.0) | mat2(0.0, 1.0, 1.0, -66.0) | mat2(5.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, 5.0) | mat2(1.0, -32.0, 64.0, 255.0) | mat2(-192.0, 0.0, -2.0, 2.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(11.0, 1.0, 1.0, -192.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_mat2 + values + { + input bool in0 = [ true | true | true | false | true | false | false | false ]; + input float in1 = [ 0.0 | 1.0 | 2.0 | -0.5 | 3.5 | -20.125 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(1.0, 2.0, 0.0, -2.0) | mat2(0.0, -0.5, 0.0, 0.0) | mat2(1.0, 3.5, -32.0, 64.0) | mat2(0.0, -20.125, 0.0, -2.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, -8.25, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec3_to_mat3 + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ]; + input vec3 in1 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input vec3 in2 = [ vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.5, -2.25, -4.875, -0.5, -2.25, -4.875) | mat3(-0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75) | mat3(-32.0, 64.0, -51.0, 0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.5, 0.75, 1.0, 1.25, 1.125, 1.0, 1.25, 1.125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec3_to_mat3 + values + { + input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) ]; + output mat3 out0 = [ mat3(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0, 0.0, 0.0, 0.0) | mat3(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_int_bool_bool_to_mat3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) ]; + input float in2 = [ -20.125 | -8.25 | 3.5 | 1.0 | 1.0 | -0.5 | 2.0 | 0.0 | 36.8125 | 0.0 ]; + input float in3 = [ 0.0 | -0.5 | 1.0 | -20.125 | 36.8125 | 0.0 | -8.25 | 2.0 | 3.5 | 1.0 ]; + input int in4 = [ 2 | 11 | 1 | 0 | 8 | 5 | -66 | 255 | -192 | -12 ]; + input bool in5 = [ false | true | true | false | false | true | false | true | false | true ]; + input bool in6 = [ false | true | false | false | true | true | true | true | false | false ]; + output mat3 out0 = [ mat3(-0.75, -0.0322580645161, -32.0, 64.0, -20.125, 0.0, 2.0, 0.0, 0.0) | mat3(1.0, 1.25, 0.0, -2.0, -8.25, -0.5, 11.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 3.5, 1.0, 1.0, 1.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, -20.125, 0.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 1.0, 36.8125, 8.0, 0.0, 1.0) | mat3(-32.0, 64.0, 0.0, -2.0, -0.5, 0.0, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, -8.25, -66.0, 0.0, 1.0) | mat3(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 255.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 36.8125, 3.5, -192.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0, -12.0, 1.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec2_bool_bvec2_float_to_mat3 + values + { + input bool in0 = [ false | false | false | true | false | false | true | true | true | true ]; + input float in1 = [ 3.5 | -20.125 | 36.8125 | 0.0 | 2.0 | -8.25 | 1.0 | -0.5 | 1.0 | 0.0 ]; + input int in2 = [ 255 | -192 | 11 | 0 | 8 | 5 | -66 | 2 | -12 | 1 ]; + input vec2 in3 = [ vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) ]; + input bool in4 = [ true | true | false | false | false | true | false | true | false | true ]; + input bvec2 in5 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ]; + input float in6 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 1.0 | 0.0 | 1.0 | -20.125 | 2.0 ]; + output mat3 out0 = [ mat3(0.0, 3.5, 255.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0) | mat3(0.0, -20.125, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0, 36.8125) | mat3(0.0, 36.8125, 11.0, -0.5, -2.25, 0.0, 1.0, 1.0, 3.5) | mat3(1.0, 0.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0, -0.5) | mat3(0.0, 2.0, 8.0, -0.5, -2.25, 0.0, 1.0, 1.0, -8.25) | mat3(0.0, -8.25, 5.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 1.0) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 1.0, 0.0, 0.0) | mat3(1.0, -0.5, 2.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 1.0, -12.0, -0.75, -0.0322580645161, 0.0, 0.0, 0.0, -20.125) | mat3(1.0, 0.0, 1.0, -32.0, 64.0, 1.0, 0.0, 1.0, 2.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + case bool_bvec2_int_vec4_bool_to_mat3 + values + { + input bool in0 = [ true | false | false | false | false | true | true | true | true | false ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) ]; + input int in2 = [ 2 | -66 | 1 | 8 | -12 | 0 | 5 | 11 | 255 | -192 ]; + input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + input bool in4 = [ false | false | true | true | true | false | true | false | false | true ]; + output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, -0.5, -2.25, -4.875, 9.0, 0.0) | mat3(0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(0.0, 0.0, 0.0, 8.0, 1.0, 1.25, 1.125, 1.75, 1.0) | mat3(0.0, 0.0, 0.0, -12.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(1.0, 0.0, 0.0, 5.0, 0.0, 0.5, 0.75, 0.825, 1.0) | mat3(1.0, 1.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 0.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec2_bool_bool_to_mat3 + values + { + input float in0 = [ -0.5 | 36.8125 | 1.0 | 0.0 | -20.125 | 2.0 | -8.25 | 3.5 ]; + input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + input bool in3 = [ true | false | true | false | true | false | false | true ]; + input bool in4 = [ false | true | false | true | false | false | true | true ]; + output mat3 out0 = [ mat3(-0.5, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0) | mat3(36.8125, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 0.0, 1.0) | mat3(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(-8.25, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(3.5, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_vec4_to_mat4 + values + { + input vec4 in0 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in1 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(0.0, 0.5, 0.75, 0.825) ]; + output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.25, 1.125, 1.75, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4(-0.5, -2.25, -4.875, 9.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case ivec4_ivec4_ivec4_ivec4_to_mat4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) ]; + input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + input ivec4 in3 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 1.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bvec4_bvec4_bvec4_bvec4_to_mat4 + values + { + input bvec4 in0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ]; + input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, false) ]; + input bvec4 in2 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ]; + input bvec4 in3 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_ivec3_bvec3_vec4_ivec2_float_vec2_to_mat4 + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ]; + input bvec3 in2 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ]; + input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + input ivec2 in4 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + input float in5 = [ 3.5 | -20.125 | -8.25 | 0.0 | 36.8125 | -0.5 | 1.0 | 2.0 ]; + input vec2 in6 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + output mat4 out0 = [ mat4(-0.5, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, 0.0, 3.5, -32.0, 64.0) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, -2.0, -20.125, 1.0, 1.25) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0, -8.25, -0.75, -0.0322580645161) | mat4(2.0, -32.0, 64.0, -51.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, 0.0, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 36.8125, 1.0, 1.25) | mat4(36.8125, 0.0, -2.0, -4.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, -2.0, -0.5, 0.0, 0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0, 1.0, 0.0, 0.5) | mat4(0.0, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0, 2.0, -0.5, -2.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + +end # matrix_combine diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html new file mode 100644 index 000000000..f8f9435fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test new file mode 100644 index 000000000..4dfb0a4a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test @@ -0,0 +1,140 @@ +group invalid_declarations "Invalid declarations" + case attribute_in_vertex_main + expect compile_fail + vertex "" + void main() + { + attribute mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case attribute_in_fragment + expect compile_fail + vertex "" + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + attribute mediump float val; + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case uniform_in_vertex_main + expect compile_fail + vertex "" + void main() + { + uniform mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case uniform_in_fragment_main + expect compile_fail + vertex "" + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + uniform mediump float val; + gl_FragColor = vec4(1.0); + } + "" + end + + case varying_in_vertex_main + expect compile_fail + vertex "" + void main() + { + varying mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + varying mediump float val; + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case varying_in_fragment_main + expect compile_fail + vertex "" + varying mediump float val; + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + varying mediump float val; + gl_FragColor = vec4(1.0); + } + "" + end + + case invariant_attribute + expect compile_fail + vertex "" + invariant attribute mediump float val; + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case invariant_uniform + expect compile_fail + vertex "" + invariant uniform mediump float val; + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + +end # invalid_declarations diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html new file mode 100644 index 000000000..1e6f7e83a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test new file mode 100644 index 000000000..f7ba4f295 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test @@ -0,0 +1,76 @@ + +case invalid_assign_to_1 + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + gl_FragData[1] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_simple + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + gl_FragColor = vec4(1.0); + gl_FragData[0] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_static_if + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + if (false) + gl_FragColor = vec4(1.0); + else + gl_FragData[0] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_unused_func + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void unused (void) + { + gl_FragData[0] = vec4(1.0); + } + void main (void) + { + gl_FragColor = vec4(1.0); + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html new file mode 100644 index 000000000..f197df89a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test new file mode 100644 index 000000000..2161a4c81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test @@ -0,0 +1,3475 @@ +# Tests todo: +# - inout with varyings, attributes, uniforms (and arrays of 'em) +# - inout with arrays, array elements +# - inout with array elements +# - inout by-value semantics (arrays & elements & structs) + +# Done: +# - control flow: return, return in loop, etc. + +group datatypes "Function Parameter Data Types" + + case float_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec2 + values + { + input vec2 in0 = [ vec2(0.0, 1.0) | vec2(2.0, 2.5) ]; + output float out0 = [ -1.0 | -4.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (vec2 a) + { + return -(a.x + a.y); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec3 + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (vec3 a) + { + return -(a.x + a.y + a.z); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec4 + values + { + input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (vec4 a) + { + return -(a.x + a.y + a.z + a.w); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat2 + values + { + input mat2 in0 = mat2(0.5, -1.0, 0.2, -1.0); + output float out0 = 0.5; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (mat2 a) + { + //return -(a[0][0] + a[0][1] + a[1][0] + a[1][1]); + return a[0][0]; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat3 + values + { + input mat3 in0 = [ mat3(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0) | mat3(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0) ]; + output float out0 = [ -4.5 | -5.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (mat3 a) + { + return -(a[0][0] + a[0][1] + a[0][2] + a[1][0] + a[1][1] + a[1][2] + a[2][0] + a[2][1] + a[2][2]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat4 + values + { + input mat4 in0 = [ mat4(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -2.0, -2.0) | mat4(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0, 0.0, 2.0, -1.0, 1.0, 0.0, -1.0, 3.0) ]; + output float out0 = [ -5.5 | -9.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (mat4 a) + { + return -(a[0][0] + a[0][1] + a[0][2] + a[0][3] + a[1][0] + a[1][1] + a[1][2] + a[1][3] + a[2][0] + a[2][1] + a[2][2] + a[2][3] + a[3][0] + a[3][1] + a[3][2] + a[3][3]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_int + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (int a) + { + return -a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec2 + values + { + input ivec2 in0 = [ ivec2(-1, 0) | ivec2(1, 4) ]; + output int out0 = [ 1 | -5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec2 a) + { + return -(a.x + a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec3 + values + { + input ivec3 in0 = [ ivec3(-1, 0, 2) | ivec3(1, 4, -8) ]; + output int out0 = [ -1 | 3 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec3 a) + { + return -(a.x + a.y + a.z); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec4 + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec4 a) + { + return -(a.x + a.y + a.z + a.w); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bool a) + { + return !a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec2 + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bvec2 a) + { + return !(a.x == a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec3 + values + { + input bvec3 in0 = [ bvec3(true, true, false) | bvec3(true, false, false) ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bvec3 a) + { + return (a.x == a.y) == a.z; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec4 + values + { + input bvec4 in0 = [ bvec4(true, true, true, false) | bvec4(false, false, true, true) | bvec4(true, false, false, true) ]; + output bool out0 = [ false | true | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bvec4 a) + { + return ((a.x == a.y) == (a.z == a.w)); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case mat2 + values + { + input mat2 in0 = [ mat2(-2.0, 0.5, -1.0, 1.0) | mat2(1.0, -3.5, -3.5, 2.5) | mat2(-2.0, -2.0, 3.5, 0.0) ]; + output mat2 out0 = [ mat2(4.0, -1.0, 2.0, -2.0) | mat2(-2.0, 7.0, 7.0, -5.0) | mat2(4.0, 4.0, -7.0, -0.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + mat2 func (mat2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3 + values + { + input mat3 in0 = [ mat3(2.5, 0.0, 1.0, -2.5, 1.0, 3.0, 0.0, 2.0, 1.5) | mat3(-3.5, 2.0, 0.5, -1.5, -3.5, 2.5, 0.0, 1.5, 3.0) | mat3(1.5, 3.0, -1.0, 2.5, -0.5, 3.5, 3.0, -3.0, -2.5) ]; + output mat3 out0 = [ mat3(-5.0, -0.0, -2.0, 5.0, -2.0, -6.0, -0.0, -4.0, -3.0) | mat3(7.0, -4.0, -1.0, 3.0, 7.0, -5.0, -0.0, -3.0, -6.0) | mat3(-3.0, -6.0, 2.0, -5.0, 1.0, -7.0, -6.0, 6.0, 5.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + mat3 func (mat3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4 + values + { + input mat4 in0 = [ mat4(-2.0, 3.5, -0.5, 1.0, -1.5, 0.0, -1.0, -1.0, 0.5, 0.5, 3.0, 1.5, 3.0, 2.5, 3.5, 1.5) | mat4(-2.5, 2.5, 3.5, 3.0, 0.5, 1.5, -2.0, 2.5, 0.5, -1.5, -3.5, 2.5, 3.5, -3.0, 2.5, -0.5) | mat4(-2.5, -1.5, 2.0, 3.0, -3.5, 1.0, -3.5, 1.5, -1.5, 3.0, 3.5, 0.0, 3.5, -1.5, -3.0, 0.5) ]; + output mat4 out0 = [ mat4(4.0, -7.0, 1.0, -2.0, 3.0, -0.0, 2.0, 2.0, -1.0, -1.0, -6.0, -3.0, -6.0, -5.0, -7.0, -3.0) | mat4(5.0, -5.0, -7.0, -6.0, -1.0, -3.0, 4.0, -5.0, -1.0, 3.0, 7.0, -5.0, -7.0, 6.0, -5.0, 1.0) | mat4(5.0, 3.0, -4.0, -6.0, 7.0, -2.0, 7.0, -3.0, 3.0, -6.0, -7.0, -0.0, -7.0, 3.0, 6.0, -1.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + mat4 func (mat4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_struct + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + + float func (Pos p) + { + return -(p.a + p.b + p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + out0 = func(p); + ${OUTPUT} + } + "" + end + + case struct_struct + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + + Pos func (Pos p) + { + return Pos(-p.a, -p.b, -p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + p = func(p); + out0 = p.a + p.b + p.c; + ${OUTPUT} + } + "" + end + + case struct_nested_struct + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + struct Line { Pos start, end; }; + + Line func (Pos p) + { + return Line(p, Pos(-p.a, -p.b, -p.c)); + } + + float sum (Pos p) + { + return (p.a + p.b + p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + Line line = func(p); + out0 = sum(line.start) + (2.0 * sum(line.end)); + ${OUTPUT} + } + "" + end + + +end # datatypes + +group qualifiers "Function Parameter Qualifiers" + + case in_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_lowp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in lowp float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_lowp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out lowp float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_lowp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout lowp float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_highp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in highp float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_highp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out highp float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_highp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout highp float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case const_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (const float a) + { + float b = -a; + return 2.0 * b; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case const_in_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (const in float a) + { + float b = -a; + return 2.0 * b; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case in_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_lowp_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in lowp int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_lowp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out lowp int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_lowp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout lowp int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_highp_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in highp int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_highp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out highp int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_highp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout highp int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case const_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + int b = -a; + return 2 * b; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case const_in_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const in int a) + { + int b = -a; + return 2 * b; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case in_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a) + { + a = !a; + return a; + } + + void main() + { + ${SETUP} + bool f = in0; + bool g = func(f); + out0 = (f != g); + ${OUTPUT} + } + "" + end + + case out_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + void func (out bool a) + { + a = false; + } + + void main() + { + ${SETUP} + bool f = true; + func(f); + out0 = (in0 == f); + ${OUTPUT} + } + "" + end + + case inout_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + void func (inout bool a) + { + a = !a; + } + + void main() + { + ${SETUP} + bool f = true; + func(f); + out0 = (in0 == f); + ${OUTPUT} + } + "" + end + +end # qualifiers + +group declarations "Function Declarations" + + case void_vs_no_void + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + + float func (void) + { + return -1.0; + } + "" + end + + case in_vs_no_in + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + + float func (in float f) + { + return -f; + } + "" + end + + case default_vs_explicit_precision + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + + float func (mediump float f) + { + return -f; + } + "" + end + +end # declarations + +group overloading "Function Overloading" + + case user_func_arg_type_simple + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + int func (int a) + { + return -a; + } + + void main() + { + out0 = func(in0) * float(func(-1)); + ${OUTPUT} + } + "" + end + + case user_func_arg_float_types + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) { return -a; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + + void main() + { + out0 = func(func(func(func(vec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_int_types + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + out0 = func(func(func(func(ivec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_bool_types + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + out0 = func(func(func(func(bvec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_basic_types + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) { return -a; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + if (func(func(bvec4(false)).x)) + out0 = func(in0) * float(func(-1)); + else + out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_complex_types + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + struct Line { Pos start, end; }; + + float func (float a) { return -a; } + float func (float a[4]) { return a[0] + a[3]; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + vec4 func (vec4 a[4]) { return a[1] + a[2]; } + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + Pos func (Pos a) { return a; } + Line func (Line a) { return Line(a.end, a.start); } + + void main() + { + ${SETUP} + float arr[4]; + vec4 arr2[4]; + out0 = func(arr) + func(arr2).x; + if (func(func(bvec4(false)).x)) + out0 = func(in0) * float(func(-1)); + else + out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arguments + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + float func (float a, float b) + { + return a * b; + } + + void main() + { + out0 = func(in0) * func(-0.5, -2.0); + ${OUTPUT} + } + "" + end + + case builtin_sin + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int sin(int a) { return -a; } + + void main() + { + ${SETUP} + out0 = sin(in0); + ${OUTPUT} + } + "" + end + + case builtin_step + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int step (float i, float j, int a) { return -a; } + + void main() + { + ${SETUP} + out0 = step(0.0, 1.0, in0); + ${OUTPUT} + } + "" + end + + case array_size + values + { + output float out0 = [ 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f[3]) + { + return f[0]; + } + + float func (float f[4]) + { + return f[1]; + } + + void main () + { + ${SETUP} + float x[4]; + x[0] = -1.0; + x[1] = 1.0; + x[2] = x[3] = 0.0; + out0 = func(x); + ${OUTPUT} + } + "" + end + +end # overloading + +group array_arguments "Arrays as Arguments" + + case local_in_float + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (in float a[4]) + { + a[0] = -1.0; + a[2] = -4.0; + a[3] = -3.0 * a[1]; + return a[0]; + } + + void main() + { + float arr[4]; + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + float f = func(arr); + out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_float + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (in float a[4]) + { + a[0] = -1.0; + a[2] = -4.0; + a[3] = -3.0 * a[1]; + return a[0]; + } + + float arr[4]; + + void main() + { + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + float f = func(arr); + out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case local_in_int + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, -4) | ivec4(-7, -11, 13, 19) ]; + output ivec4 out0 = [ ivec4(0, -1, -2, 4) | ivec4(7, 11, -13, -19) ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a[4]) + { + a[0] = -1; + a[2] = -4; + a[3] = -3 * a[1]; + return a[0]; + } + + void main() + { + ${SETUP} + int arr[4]; + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + int f = func(arr); + out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_int + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, 4) | ivec4(-7, -11, 13, 19) ]; + output ivec4 out0 = [ ivec4(0, -1, -2, -4) | ivec4(7, 11, -13, -19) ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a[4]) + { + a[0] = -1; + a[2] = -4; + a[3] = -3 * a[1]; + return a[0]; + } + + int arr[4]; + + void main() + { + ${SETUP} + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + int f = func(arr); + out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + + "" + end + + case local_in_bool + values + { + input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a[4]) + { + a[0] = false; + a[2] = true; + a[3] = !a[1]; + return a[0]; + } + + void main() + { + ${SETUP} + bool arr[4]; + arr[0] = !in0.x; + arr[1] = !in0.y; + arr[2] = !in0.z; + arr[3] = !in0.w; + func(arr); + out0 = bvec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_bool + values + { + input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a[4]) + { + a[0] = false; + a[2] = true; + a[3] = !a[1]; + return a[0]; + } + + bool arr[4]; + + void main() + { + ${SETUP} + arr[0] = !in0.x; + arr[1] = !in0.y; + arr[2] = !in0.z; + arr[3] = !in0.w; + func(arr); + out0 = bvec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case test_helpers + desc "Check that helper functions are supported properly." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output float out0 = [ 1.0 | 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + void main() + { + float arr[4]; + set(arr, in0); + negate(arr); + out0 = float(test(arr, -in0)); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_local_in_on_call + desc "Check that local 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + a[0] = 2.123; + a[2] = -4.123; + return isEqual(a, b) ? 1.0 : -1.0; + } + + void main() + { + float arr[4]; + set(arr, in0); + out0 = in0 * func(arr, arr); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_global_in_on_call + desc "Check that global 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + a[0] = 2.123; + a[2] = -4.123; + return isEqual(a, b) ? 1.0 : -1.0; + } + + float arr[4]; + + void main() + { + set(arr, in0); + out0 = in0 * func(arr, arr); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_local_inout_on_call + desc "Check that local 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (inout float a[4], inout float b[4]) + { + negate(a); + return isEqual(a, b) ? 1.0 : -1.0; + } + + void main() + { + float arr[4]; + set(arr, in0); + float m = func(arr, arr); // returns -1.0 + float n = float(test(arr, in0) || test(arr, -in0)); + out0 = in0 * m * n; + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_global_inout_on_call + desc "Check that global 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + negate(a); + return isEqual(a, b) ? 1.0 : -1.0; + } + + float arr[4]; + + void main() + { + set(arr, in0); + float m = func(arr, arr); // returns -1.0 + float n = float(test(arr, in0) || test(arr, -in0)); + out0 = in0 * m * n; + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + +# vec4 get (in float arr[4]); +# void set (out float arr[4], vec4 val); +# void negate (inout float arr[4]); +# bool test (in float arr[4], vec4 ref); +# bool isEqual (in float a[4], in float b[4]); + +# float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } +# vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } +# void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } +# void negate (inout float arr[4]) { set(arr, -get(arr)); } +# bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } +# bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + +end # array_arguments + +#group qualifiers "Function Parameter Qualifiers" +# +#end # qualifiers + +group control_flow "Control Flow In Functions" + + case simple_return + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + a = a * -1.0; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_if + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + if (a != 0.0) + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_else + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + if (a == 0.0) + return 1.0; + else + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_loop + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 1; i++) + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_loop_if + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 3; i++) + { + if (i == 1) + return a; + else if (i > 1) + return -1.0; + a = -a; + } + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_loop + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 5; i++) + a = -a; + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_break + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + a = -a; + if (i == 4) + break; + } + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_continue + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + if (i == 4) + continue; + a = -a; + } + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_nested_loop + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + a = -a; + for (int j = 0; j < 4; j++) + { + a = -a; + if (i == 1) + return a; + } + if (i == 4) + return 1.0; + } + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_loop_sequence + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) // negate a + { + a = -a; + if (i == 4) + a = -a; + } + + for (int i = 6; i < 10; i++) // keep a + { + if (i == 8) + continue; + else if (i == 9) + break; + a = -a; + } + + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case mixed_return_break_continue + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + if (i == 0) + continue; + else if (i == 1) + { + } + else if (i == 3) + break; + else + return a; + a = -a; + } + + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + +end # control_flow + +group misc "Miscellaneous" + + case multi_arg_float + values + { + input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; # -sum(in0) + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float sum(vec4 v) { return (v.x + v.y + v.z + v.w); } + + float func (float a, vec3 b, vec2 c, vec2 d, vec4 e) + { + return -sum(vec4(a, b) + vec4(c, d)) + sum(e); + } + + void main() + { + ${SETUP} + out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0); + ${OUTPUT} + } + "" + end + + case multi_arg_int + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int sum(ivec4 v) { return (v.x + v.y + v.z + v.w); } + + int func (int a, ivec3 b, ivec2 c, ivec2 d, ivec4 e) + { + return -sum(ivec4(a, b) + ivec4(c, d)) + sum(e); + } + + void main() + { + ${SETUP} + out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0); + ${OUTPUT} + } + "" + end + + case argument_eval_order_1 + values + { + input int in0 = [ 0 | 1 | 3 | 5 ]; + output int out0 = [ -1 | 5 | 11 | 17 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + int func (float a, int b, bool c, int d) + { + if (c) + return b + int(a) + d; + else + return -1; + } + + void main () + { + ${SETUP} + float v0 = float(in0); + int v1 = in0; + out0 = func((v0 += 1.0), v1++, (v0 > 1.5), v1); + ${OUTPUT} + } + "" + end + + case argument_eval_order_2 + values + { + input int in0 = [ 0 | -1 | 3 | 5 ]; + output int out0 = [ 3 | -1 | 9 | 13 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + int g; + + int modG (int v) + { + g += v; + return v; + } + + int func (float a, int b, bool c, int d) + { + if (c) + return b + int(a) + d; + else + return -1; + } + + void main () + { + ${SETUP} + out0 = func(float(g = in0), modG(2), --g > 0, g); + ${OUTPUT} + } + "" + end + + case missing_returns + values + { + input float in0 = [ 1.0 | 2.0 | 3.0 ]; + output float out0 = [ -1.0 | -2.0 | -3.0 ]; + } + both "" + // Note specification says that returned value is undefined if no return + // statement has been executed. In this case func() is called only with + // positive values. + precision mediump float; + ${DECLARATIONS} + + float func (float f) + { + if (f > 0.0) + return -f; + } + + void main () + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + +end # misc + +group invalid "Invalid Functions" + case break_in_body + expect compile_fail + both "" + precision mediump float; + + void func () + { + break; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case continue_in_body + expect compile_fail + both "" + precision mediump float; + + void func () + { + continue; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_value_from_void_function + expect compile_fail + both "" + precision mediump float; + + void func () + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case extra_arguments + expect compile_fail + both "" + precision mediump float; + + void func (float f) + { + } + + void main () + { + func(1.0, 2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_arguments + expect compile_fail + both "" + precision mediump float; + + void func (float f) + { + } + + void main () + { + func(); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_argument_type + expect compile_fail + both "" + precision mediump float; + + void func (in f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_basetype_mismatch + expect compile_fail + both "" + precision mediump float; + precision mediump int; + + void func (float f) + { + } + + void main () + { + func(2); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_scalar_vector_mismatch + expect compile_fail + both "" + precision mediump float; + + void func (vec2 f) + { + } + + void main () + { + func(2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_vector_size_mismatch + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + } + + void main () + { + func(vec2(2.0)); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case duplicate_function + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f); + + void func (vec3 f) + { + } + + void func (vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_return_type + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f); + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + float func (vec3 f) + { + return f.x; + } + "" + end + + case prototype_unspecified_array_size + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f[]); + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_mismatch_argument_array_size + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f[3]); + void func (vec3 f[3]) + { + } + + void main () + { + vec3 array[4]; + func(array); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_argument_const + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f); + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_argument_array_const + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f[3]); + void func (const vec3 f[3]) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_array_inout + expect compile_fail + both "" + precision mediump float; + + void func (out vec3 f); + void func (inout vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_return_type + expect compile_fail + both "" + precision mediump float; + + func (float f); + func (inout vec3 f[3]) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_before_definition + expect compile_fail + both "" + precision mediump float; + + void main () + { + func(1.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + void func (float f) + { + } + + "" + end + + case return_array_in_struct + expect compile_fail + both "" + precision mediump float; + + struct Foo + { + float f; + float arr[2]; + }; + + Foo func () + { + Foo f; + f.f = 1.0; + f.arr[0] = 2.0; + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_precision_overload + expect compile_fail + both "" + precision mediump float; + + float func (lowp float f) + { + return f; + } + + float func (mediump float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_in_out_overload + expect compile_fail + both "" + precision mediump float; + + void func (in float f) + { + } + + void func (out float f) + { + f = 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_in_inout_overload + expect compile_fail + both "" + precision mediump float; + + void func (in float f) + { + } + + void func (inout float f) + { + f = -f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_out_inout_overload + expect compile_fail + both "" + precision mediump float; + + void func (out float f) + { + f = -1.0; + } + + void func (inout float f) + { + f = -f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_overload + expect compile_fail + both "" + precision mediump float; + + float func (float f) + { + return f; + } + + int func (float f) + { + return int(f); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_precision_overload + expect compile_fail + both "" + precision mediump float; + + lowp float func (float f) + { + return f; + } + + mediump float func (float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_const_overload + expect compile_fail + both "" + precision mediump float; + + float func (float f) + { + return f; + } + + const float func (float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_without_value + expect compile_fail + both "" + precision mediump float; + + float func (float f) + { + return; + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_prototype + expect compile_fail + both "" + precision mediump float; + + void main () + { + float func (float f); + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_definition + expect compile_fail + both "" + precision mediump float; + + void main () + { + float func (float f) + { + return 1.0; + } + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case name_type_conflict + expect compile_fail + both "" + precision mediump float; + + struct foo { float a; } + + float foo (float f) + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case const_overload + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + } + + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_local + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + uniform float u; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case varying_local + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + varying float v; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case attribute_local + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + attribute float a; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_argument + expect compile_fail + both "" + precision mediump float; + + void func (uniform vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case varying_argument + expect compile_fail + both "" + precision mediump float; + + void func (varying vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case attribute_argument + expect compile_fail + both "" + precision mediump float; + + void func (attribute vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_return_type + expect compile_fail + both "" + precision mediump float; + + uniform float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case varying_return_type + expect compile_fail + both "" + precision mediump float; + + varying float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case attribute_return_type + expect compile_fail + both "" + precision mediump float; + + attribute float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_invalid_return_type + expect compile_fail + both "" + precision mediump float; + + float main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_has_arguments + expect compile_fail + both "" + precision mediump float; + + void main (float f) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_missing_return_type + expect compile_fail + both "" + precision mediump float; + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_arg + expect compile_fail + both "" + precision mediump float; + + func (const float f) + { + f = 1.0; + } + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_array_arg + expect compile_fail + both "" + precision mediump float; + + func (const float f[3]) + { + f[0] = 1.0; + } + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case modify_const_arg + expect compile_fail + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case init_const_local_from_const_arg + expect compile_fail + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + const int b = -a; + return 2 * b; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case array_size_from_const_arg + expect compile_fail + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + int arr[a]; + arr[1] = 3; + return arr[1]; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case double_declare + expect compile_fail + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f); + float func (float f); + + float func (float f) + { + return -f; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html new file mode 100644 index 000000000..2085a16a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test new file mode 100644 index 000000000..7641da228 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test @@ -0,0 +1,90 @@ + +case texture2d_bias_in_vertex + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + uniform lowp sampler2D s; + + void main() + { + vec4 r = texture2D(s, vec2(1.0), 1.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +case texturecube_bias_in_vertex + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + uniform lowp samplerCube s; + + void main() + { + vec4 r = textureCube(s, vec3(1.0), 1.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +case texture2dlod_in_fragment + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + uniform sampler2D s; + + void main() + { + gl_FragColor = texture2DLod(s, vec2(0), 1.0); + } + "" +end + +case texturecubelod_in_fragment + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + uniform samplerCube s; + + void main() + { + gl_FragColor = textureCubeLod(s, vec3(0), 1.0); + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html new file mode 100644 index 000000000..3c7b576ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test new file mode 100644 index 000000000..16fc39065 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test @@ -0,0 +1,1613 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group keywords "Usage of keywords as identifiers." + + case attribute + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float attribute = 1.0; + ${OUTPUT} + } + "" + end + case const + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float const = 1.0; + ${OUTPUT} + } + "" + end + case uniform + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uniform = 1.0; + ${OUTPUT} + } + "" + end + case varying + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float varying = 1.0; + ${OUTPUT} + } + "" + end + case break + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float break = 1.0; + ${OUTPUT} + } + "" + end + case continue + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float continue = 1.0; + ${OUTPUT} + } + "" + end + case do + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float do = 1.0; + ${OUTPUT} + } + "" + end + case for + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float for = 1.0; + ${OUTPUT} + } + "" + end + case while + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float while = 1.0; + ${OUTPUT} + } + "" + end + case if + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float if = 1.0; + ${OUTPUT} + } + "" + end + case else + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float else = 1.0; + ${OUTPUT} + } + "" + end + case in + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float in = 1.0; + ${OUTPUT} + } + "" + end + case out + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float out = 1.0; + ${OUTPUT} + } + "" + end + case inout + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inout = 1.0; + ${OUTPUT} + } + "" + end + case float + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float float = 1.0; + ${OUTPUT} + } + "" + end + case int + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float int = 1.0; + ${OUTPUT} + } + "" + end + case void + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float void = 1.0; + ${OUTPUT} + } + "" + end + case bool + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bool = 1.0; + ${OUTPUT} + } + "" + end + case true + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float true = 1.0; + ${OUTPUT} + } + "" + end + case false + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float false = 1.0; + ${OUTPUT} + } + "" + end + case lowp + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float lowp = 1.0; + ${OUTPUT} + } + "" + end + case mediump + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mediump = 1.0; + ${OUTPUT} + } + "" + end + case highp + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float highp = 1.0; + ${OUTPUT} + } + "" + end + case precision + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float precision = 1.0; + ${OUTPUT} + } + "" + end + case invariant + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float invariant = 1.0; + ${OUTPUT} + } + "" + end + case discard + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float discard = 1.0; + ${OUTPUT} + } + "" + end + case return + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float return = 1.0; + ${OUTPUT} + } + "" + end + case mat2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2 = 1.0; + ${OUTPUT} + } + "" + end + case mat3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3 = 1.0; + ${OUTPUT} + } + "" + end + case mat4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4 = 1.0; + ${OUTPUT} + } + "" + end + case vec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec2 = 1.0; + ${OUTPUT} + } + "" + end + case vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec3 = 1.0; + ${OUTPUT} + } + "" + end + case vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec4 = 1.0; + ${OUTPUT} + } + "" + end + case ivec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec2 = 1.0; + ${OUTPUT} + } + "" + end + case ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec3 = 1.0; + ${OUTPUT} + } + "" + end + case ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec4 = 1.0; + ${OUTPUT} + } + "" + end + case bvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec2 = 1.0; + ${OUTPUT} + } + "" + end + case bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec3 = 1.0; + ${OUTPUT} + } + "" + end + case bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec4 = 1.0; + ${OUTPUT} + } + "" + end + case sampler2D + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2D = 1.0; + ${OUTPUT} + } + "" + end + case samplerCube + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerCube = 1.0; + ${OUTPUT} + } + "" + end + case struct + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float struct = 1.0; + ${OUTPUT} + } + "" + end + +end # keywords +group reserved_keywords "Usage of reserved keywords as identifiers." + + case asm + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float asm = 1.0; + ${OUTPUT} + } + "" + end + case class + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float class = 1.0; + ${OUTPUT} + } + "" + end + case union + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float union = 1.0; + ${OUTPUT} + } + "" + end + case enum + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float enum = 1.0; + ${OUTPUT} + } + "" + end + case typedef + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float typedef = 1.0; + ${OUTPUT} + } + "" + end + case template + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float template = 1.0; + ${OUTPUT} + } + "" + end + case this + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float this = 1.0; + ${OUTPUT} + } + "" + end + case packed + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float packed = 1.0; + ${OUTPUT} + } + "" + end + case goto + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float goto = 1.0; + ${OUTPUT} + } + "" + end + case switch + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float switch = 1.0; + ${OUTPUT} + } + "" + end + case default + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float default = 1.0; + ${OUTPUT} + } + "" + end + case inline + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inline = 1.0; + ${OUTPUT} + } + "" + end + case noinline + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float noinline = 1.0; + ${OUTPUT} + } + "" + end + case volatile + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float volatile = 1.0; + ${OUTPUT} + } + "" + end + case public + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float public = 1.0; + ${OUTPUT} + } + "" + end + case static + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float static = 1.0; + ${OUTPUT} + } + "" + end + case extern + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float extern = 1.0; + ${OUTPUT} + } + "" + end + case external + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float external = 1.0; + ${OUTPUT} + } + "" + end + case interface + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float interface = 1.0; + ${OUTPUT} + } + "" + end + case flat + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float flat = 1.0; + ${OUTPUT} + } + "" + end + case long + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float long = 1.0; + ${OUTPUT} + } + "" + end + case short + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float short = 1.0; + ${OUTPUT} + } + "" + end + case double + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float double = 1.0; + ${OUTPUT} + } + "" + end + case half + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float half = 1.0; + ${OUTPUT} + } + "" + end + case fixed + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fixed = 1.0; + ${OUTPUT} + } + "" + end + case unsigned + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float unsigned = 1.0; + ${OUTPUT} + } + "" + end + case superp + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float superp = 1.0; + ${OUTPUT} + } + "" + end + case input + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float input = 1.0; + ${OUTPUT} + } + "" + end + case output + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float output = 1.0; + ${OUTPUT} + } + "" + end + case hvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec2 = 1.0; + ${OUTPUT} + } + "" + end + case hvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec3 = 1.0; + ${OUTPUT} + } + "" + end + case hvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec4 = 1.0; + ${OUTPUT} + } + "" + end + case dvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec2 = 1.0; + ${OUTPUT} + } + "" + end + case dvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec3 = 1.0; + ${OUTPUT} + } + "" + end + case dvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec4 = 1.0; + ${OUTPUT} + } + "" + end + case fvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec2 = 1.0; + ${OUTPUT} + } + "" + end + case fvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec3 = 1.0; + ${OUTPUT} + } + "" + end + case fvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec4 = 1.0; + ${OUTPUT} + } + "" + end + case sampler1D + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1D = 1.0; + ${OUTPUT} + } + "" + end + case sampler3D + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3D = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DShadow + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DShadow + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRect + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case sampler3DRect + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3DRect = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRectShadow + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRectShadow = 1.0; + ${OUTPUT} + } + "" + end + case sizeof + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sizeof = 1.0; + ${OUTPUT} + } + "" + end + case cast + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float cast = 1.0; + ${OUTPUT} + } + "" + end + case namespace + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float namespace = 1.0; + ${OUTPUT} + } + "" + end + case using + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float using = 1.0; + ${OUTPUT} + } + "" + end + +end # reserved_keywords +group invalid_identifiers "Usage of invalid identifiers." + + case gl_begin + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float gl_Invalid = 1.0; + ${OUTPUT} + } + "" + end + case digit + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0123 = 1.0; + ${OUTPUT} + } + "" + end + case digit_begin + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0invalid = 1.0; + ${OUTPUT} + } + "" + end + +end # invalid_identifiers diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html new file mode 100644 index 000000000..adf118b7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test new file mode 100644 index 000000000..319a85858 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test @@ -0,0 +1,1715 @@ +# not declared in vertex shader, declared in fragment shader +case varying_1 + desc "varying declared in fragment shader, no reference in vertex shader" + values { output float out0 = 1.0; } + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + varying mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" +end + +# declared in vertex shader, no reference in frag shader +case varying_2 + desc "varying declared in vertex shader, no reference in fragment shader" + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# declared in vertex shader, declared in frag shader +case varying_3 + desc "varying declared in both vertex and fragment shader, but not used" + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# declared in vertex shader, static use in frag shader +case varying_4 + desc "varying declared in both shaders, statically used in fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + uniform bool u_false; + void main() + { + if (u_false) + gl_FragColor = vec4(var); + else + gl_FragColor = vec4(1.0); + } + "" +end + +# static use in vertex shader, no reference in fragment shader +case varying_5 + desc "varying declared and statically used in vertex shader, no reference in fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# static use in vertex shader, declared in fragment shader +case varying_6 + desc "varying declared and statically used in vertex shader, only declared in fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# static use in vertex shader, used in fragment shader +case varying_7 + desc "varying statically used in both vertex and fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + ${FRAGMENT_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + gl_FragColor = vec4(var); + else + gl_FragColor = vec4(1.0); + } + "" +end + +case varying_type_float + desc "varying of type float" + values + { + input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_vec2 + desc "varying of type vec2" + values + { + input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump vec2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying vec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_vec3 + desc "varying of type vec3" + values + { + input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump vec3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying vec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_vec4 + desc "varying of type vec4" + values + { + input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_mat2 + desc "varying of type mat2" + values + { + input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump mat2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mat2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_mat3 + desc "varying of type mat3" + values + { + input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump mat3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mat3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_mat4 + desc "varying of type mat4" + values + { + input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump mat4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mat4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +# differing precision tests +case varying_differing_precision_1 + desc "varying declared as highp in vertex shader, but mediump in fragment shader" + values + { + input float in0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + ${VERTEX_DECLARATIONS} + varying highp float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mediump float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +# differing precision tests +case varying_differing_precision_2 + desc "varying declared as highp in vertex shader, but lowp in fragment shader" + values + { + input float in0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + ${VERTEX_DECLARATIONS} + varying highp vec2 var; + void main() + { + var = vec2(in0, 2.0*in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying lowp vec2 var; + void main() + { + out0 = var.y - var.x; + ${FRAGMENT_OUTPUT} + } + "" +end + +# differing precision tests +case varying_differing_precision_3 + desc "varying declared as lowp in vertex shader, but mediump in fragment shader" + values + { + input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + ${VERTEX_DECLARATIONS} + varying lowp vec4 var; + void main() + { + var = vec4(in0, 2.0*in0, -in0, -in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mediump vec4 var; + void main() + { + out0 = var.x + var.y + var.z + var.w; + ${FRAGMENT_OUTPUT} + } + "" +end + +# mismatched type, static use but no runtime use in the fragment shader +case varying_type_mismatch_1 + desc "varying type mismatch (float vs. vec2), static use but no runtime use in the fragment shader" + expect link_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump vec2 var; + void main() + { + if (false) + { + gl_FragColor = vec4(var.y); + } + else + { + ${FRAG_COLOR} = vec4(1.0); + } + } + "" +end + +# mismatched type, varyings used +case varying_type_mismatch_2 + desc "varying type mismatch (float vs. vec2)" + expect link_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump vec2 var; + void main() + { + gl_FragColor = var.xyyx; + } + "" +end + +# no declaration in vertex shader, but static use in fragment +case varying_illegal_usage_1 + desc "varying not declared in vertex shader, but statically used in fragment shader" + expect link_fail + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + void main() + { + gl_FragColor = vec4(var); + } + "" +end + +# integer varyings not allowed +case invalid_varying_type_int + desc "integer varying used" + expect compile_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump int var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump int var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# bool varyings not allowed +case invalid_varying_type_bool + desc "boolean varying used" + expect compile_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying bool var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying bool var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# struct varyings not allowed +case invalid_varying_type_struct + desc "struct varying used" + expect compile_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying struct { mediump float foo; } var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying struct { mediump float foo; } var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +case varying_readback_1 + desc "read back (an already written) varying in the vertex shader" + values + { + input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ]; + output float out0 = [ 3.0 | 0.0 | -6.0 | 30.0 ]; + } + vertex "" + precision mediump float; + ${VERTEX_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + out0 = var1 + var2; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_writeback_1 + desc "write back a varying in the fragment shader" + expect compile_fail + vertex "" + precision mediump float; + ${VERTEX_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + var2 = var1; + out0 = var1; + ${FRAGMENT_OUTPUT} + } + "" +end + +# Struct linkage handling +case uniform_struct + desc "Same uniform struct in both shaders" + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b + val.a; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only + desc "Uniform struct declared in both, used only in vertex." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only + desc "Uniform struct declared in both, used only in fragment." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial + desc "Uniform struct declared in both, used partially in both." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vec4 + desc "Same uniform struct in both shaders. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only_vec4 + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 " + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only_vec4 + desc "Uniform struct declared in both, used only in fragment. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a.x + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4 + desc "Uniform struct declared in both, used partially in both. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vec4_vec3 + desc "Same uniform struct in both shaders. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only_vec4_vec3 + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only_vec4_vec3 + desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a.x + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4_vec3 + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vec4_float + desc "Same uniform struct in both shaders. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only_vec4_float + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only_vec4_float + desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a.x + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4_float + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4_struct + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b.c = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" +end + + + +case uniform_struct_partial_vec4_vec3_struct + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b.c = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec2_vec3 + desc "Uniform struct declared in both, used partially in both. Datatype vec2 and vec3" + values { + uniform vec2 val.a = vec2(1.0, 2.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec2_int + desc "Uniform struct declared in both, used partially in both. Datatype vec2 and int" + values { + uniform vec2 val.a = vec2(1.0, 2.0); + uniform int val.b = 2; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_int_float + desc "Uniform struct declared in both, used partially in both. Datatype int and float" + values { + uniform float val.a = 1.0; + uniform int val.b = 2; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_bvec2_vec2 + desc "Uniform struct declared in both, used partially in both. Datatype bvec2 and vec2" + values { + uniform bvec2 val.a = bvec2(true, true); + uniform vec2 val.b = vec2(1.0, 2.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_ivec2_vec2 + desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and vec2" + values { + uniform ivec2 val.a = ivec2(1, 2); + uniform vec2 val.b = vec2(1.0, 2.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_ivec2_ivec2 + desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and ivec2" + values { + uniform ivec2 val.a = ivec2(1, 2); + uniform ivec2 val.b = ivec2(1, 2); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + vec2(val.b).y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_type_conflict_1 + desc "Fragment struct has one less member than fragment version" + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_type_conflict_2 + desc "Vertex struct has int, fragment struct has float." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump int a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = float(val.a); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_type_conflict_3 + desc "Vertex struct has vec3, fragment struct has vec4." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec3 a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a.x; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_1 + desc "Vertex side struct has highp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {highp float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_2 + desc "Vertex side struct has mediump, fragment side struct lowp." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {lowp float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_3 + desc "Vertex side struct has lowp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_4 + desc "Vertex side struct has lowp, fragment side struct implicit mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_use_case_rip + desc "Complex Light struct from use case tests." + values { + uniform float val.constantAttenuation = 1.0; + uniform float val.quadraticAttenuation = 1.0; + output float out0 = 2.0; + } + vertex "" + struct Light + { + mediump vec3 color; + highp vec4 position; + highp vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + ${VERTEX_DECLARATIONS} + uniform Light val; + varying mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Light + { + mediump vec3 color; + highp vec4 position; + highp vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + struct Struct {float a;}; + uniform Light val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_use_case_rip_sans_highp + desc "Complex Light struct from use case tests, without highp usage" + values { + uniform float val.constantAttenuation = 1.0; + uniform float val.quadraticAttenuation = 1.0; + output float out0 = 2.0; + } + vertex "" + struct Light + { + mediump vec3 color; + mediump vec4 position; + mediump vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + ${VERTEX_DECLARATIONS} + uniform Light val; + varying mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Light + { + mediump vec3 color; + mediump vec4 position; + mediump vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + struct Struct {float a;}; + uniform Light val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html new file mode 100644 index 000000000..ac91d2280 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test new file mode 100644 index 000000000..7e3d25149 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test @@ -0,0 +1,4287 @@ +group basic "Basic Tests" + + case correct_phases + expect compile_fail + both "" + #define e +1 + void main() + { + mediump int n = 1e; + } + "" + end + + case invalid_identifier + expect compile_fail + both "" + #define e +1 + + void main() + { + mediump int 1xyz = 1; + } + "" + end + + case null_directive + values { output float out0 = 0.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # + # // comment + /*sfd*/ # /* */ + + void main() + { + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case invalid_directive + expect compile_fail + both "" + #defin AAA + + void main() + { + } + "" + end + + case missing_identifier + expect compile_fail + both "" + #define + + void main() + { + } + "" + end + + case empty_object + values { output float out0 = -1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # define VALUE + + void main() + { + out0 = VALUE - 1.0; + ${OUTPUT} + } + "" + end + + case empty_function + values { output float out0 = -1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # define VALUE(a) + + void main() + { + out0 = VALUE(2.0) - 1.0; + ${OUTPUT} + } + "" + end + + + case empty_directive + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # + + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case identifier_with_double_underscore + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + # define __VALUE__ 1 + + void main() + { + // __VALUE__ not used since it might be set by an "underlying software layer" + out0 = float(1.0); + ${OUTPUT} + } + "" + end +end # basic + +group definitions "Symbol Definition Tests" + + case define_value_and_function + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS:single-line} + # define VALUE (1.5 + 2.5) + # define FUNCTION(__LINE__, b) __LINE__+b + + void main() + { + out0 = FUNCTION(VALUE, ((0.2) + 1.8) ); + ${OUTPUT} + } + "" + end + + case undefine_object_invalid_syntax + expect compile_fail + both "" + precision mediump float; + #define VAL 2.0 + #undef VAL sdflkjfds + #define VAL 1.0 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VAL); + } + "" + end + + case undefine_invalid_object_1 + expect compile_fail + both "" + precision mediump float; + #undef __LINE__ + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__LINE__); + } + "" + end + + case undefine_invalid_object_2 + expect compile_fail + both "" + precision mediump float; + #undef __FILE__ + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__FILE__); + } + "" + end + + case undefine_invalid_object_3 + expect compile_fail + both "" + precision mediump float; + #undef __VERSION__ + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__VERSION__); + } + "" + end + + case undefine_invalid_object_4 + expect compile_fail + both "" + precision mediump float; + #undef GL_ES + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(GL_ES); + } + "" + end + + case undefine_function + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define FUNCTION(a,b) a+b + #undef FUNCTION + #define FUNCTION(a,b) a-b + + void main() + { + out0 = FUNCTION(3.0, 2.0); + ${OUTPUT} + } + "" + end + +end # definitions + +group invalid_definitions "Invalid Definition Tests" + + case define_non_identifier + expect compile_fail + both "" + precision mediump float; + #define 123 321 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_1 + expect compile_fail + both "" + precision mediump float; + #undef 123 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_2 + expect compile_fail + both "" + precision mediump float; + #undef foo.bar + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + +end # invalid_definitions + +group object_redefinitions "Object Redefinition Tests" + + case invalid_object_ident + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define AAAA 2.1 + # define VALUE (AAA - 1.0) + # define VALUE (AAAA - 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_whitespace + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA- 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_op + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA + 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_floatval_1 + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA - 1.1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_floatval_2 + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA - 1.0e-1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_intval_1 + expect compile_fail + both "" + precision mediump float; + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 2) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_intval_2 + expect compile_fail + both "" + precision mediump float; + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 0x1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case redefine_object_1 + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_ifdef + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #ifdef ADEFINE + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_undef_ifdef + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + #undef ADEFINE + + #ifdef ADEFINE + #define VALUE 0.0 + #else + #define VALUE 1.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_ifndef + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #ifndef ADEFINE + #define VALUE 0.0 + #else + #define VALUE 1.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_defined_1 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #if defined(ADEFINE) + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_defined_2 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #if defined ADEFINE + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_comment + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 /* fdsjklfdsjkl dsfjkhfdsjkh fdsjklhfdsjkh */ (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_multiline_comment + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 /* fdsjklfdsjkl + dsfjkhfdsjkh + fdsjklhfdsjkh */ (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + +end # object_redefinitions + +group invalid_redefinitions "Invalid Redefinitions Tests" + + case invalid_identifier_2 + expect compile_fail + both "" + precision mediump float; + # define GL_VALUE 1.0 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(GL_VALUE); + } + "" + end + +end # invalid_redefinitions + +group comments "Comment Tests" + + case multiline_comment_define + values { output float out0 = 4.2; } + both "" + precision mediump float; + ${DECLARATIONS} + #define VALUE /* current + value */ 4.2 + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case nested_comment + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + /* /* */ + out0 = 1.0; + // */ + ${OUTPUT} + } + "" + end + + case comment_trick_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + /*/ + out0 = 0.0; + /*/ + out0 = 1.0; + /**/ + ${OUTPUT} + } + "" + end + + case comment_trick_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + /**/ + out0 = 1.0; + /*/ + out0 = 0.0; + /**/ + ${OUTPUT} + } + "" + end + + case invalid_comment + expect compile_fail + both "" + precision mediump float; + void main() + { + /* /* */ */ + ${POSITION_FRAG_COLOR} = 1.0; + } + "" + end + + case unterminated_comment_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + /* + } + "" + end + + case unterminated_comment_2 + expect compile_fail + both "" + /* + precision mediump float; + void main() + { + } + "" + end + +end # comments + +group function_definitions "Function Definitions Tests" + + case same_object_and_function_param + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define VALUE 1.0 + #define FUNCTION(VALUE, B) (VALUE-B) + + void main() + { + out0 = FUNCTION(3.0, 2.0); + ${OUTPUT} + } + "" + end + + case complex_func + values { output float out0 = 518.5; } + both "" + precision mediump float; + ${DECLARATIONS} + #define AAA(a,b) a*(BBB(a,b)) + #define BBB(a,b) a-b + + void main() + { + out0 = BBB(AAA(8.0/4.0, 2.0)*BBB(2.0*2.0,0.75*2.0), AAA(40.0,10.0*BBB(5.0,3.0))); + ${OUTPUT} + } + "" + end + + case function_definition_with_comments + values { output float out0 = 3.0; } + both "" + precision mediump float; + ${DECLARATIONS} + /* sdfljk */ #/* sdfljk */define /* sdfljk */ FUNC( /* jklsfd*/a /*sfdjklh*/, /*sdfklj */b /*sdfklj*/) a+b + + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + +end # function_definitions + +group recursion "Recursions Tests" + + case recursion_1 + expect compile_fail + both "" + precision mediump float; + # define AAA AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_2 + expect compile_fail + both "" + precision mediump float; + # define AAA BBB + #define BBB AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_3 + expect compile_fail + both "" + precision mediump float; + # define AAA (1.0+BBB) + #define BBB (2.0+AAA) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_4 + expect compile_fail + both "" + precision mediump float; + # define AAA(a) AAA(a) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA(1.0)); + } + "" + end + + case recursion_5 + expect compile_fail + both "" + precision mediump float; + # define AAA(a, b) AAA(b, a) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA(1.0, 2.0)); + } + "" + end + +end # recursion + +group function_redefinitions "Function Redefinition Tests" + + case function_redefinition_1 + values { output float out0 = 3.0; } + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC( a, b) a+b + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case function_redefinition_2 + values { output float out0 = 3.0; } + both "" + precision mediump float; + # define FUNC(a,b) (a +b) + # define FUNC( a, b )(a +b) + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case function_redefinition_3 + values { output float out0 = 3.0; } + both "" + precision mediump float; + # define FUNC(a,b) (a +b) + # define FUNC(a,b)(a /* comment + */ +b) + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case invalid_function_redefinition_param_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(A,b) A+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0)); + } + "" + end + + case invalid_function_redefinition_param_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b,c) a+b+c + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case invalid_function_redefinition_param_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b) b+a + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0)); + } + "" + end + +end # functions_redefinitions + +group invalid_function_definitions "Invalid Function Definition Tests" + + case arguments_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC); + } + "" + end + + case arguments_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC()); + } + "" + end + + case arguments_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(((); + } + "" + end + + case arguments_4 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC)); + } + "" + end + + case arguments_5 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0)); + } + "" + end + + case arguments_6 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + } + "" + end + + case arguments_7 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,)); + } + "" + end + + case arguments_8 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case unique_param_name + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,a) a+a + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a + b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(,a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC( + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(A a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(A,B,C a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_4 + expect compile_fail + both "" + precision mediump float; + # define FUNC( + "" + end + +end # invalid_function_definitions + +group semantic "Semantic Tests" + + case ops_as_arguments + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define FOO(a, b) (1 a 9) b 2 + + void main() + { + out0 = float(FOO(+, *)); + ${OUTPUT} + } + "" + end + + case correct_order + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define FUNC(A) A + #define A 2.0 + + void main() + { + out0 = FUNC(A - 1.0); + ${OUTPUT} + } + "" + end + +end # semantic + +group predefined_macros "Predefined Macros Tests" + + case version + values { output float out0 = 100.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA __VERSION__ + out0 = float(AAA); + ${OUTPUT} + } + "" + end + + case gl_es_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + void main() + { + out0 = float(GL_ES); + ${OUTPUT} + } + "" + end + + case gl_es_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define AAA(A) A + + void main() + { + out0 = float(AAA(GL_ES)); + ${OUTPUT} + } + "" + end + + case line_1 + values { output float out0 = 1.0; } + both "" + const mediump int line = __LINE__; + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(line); + ${OUTPUT} + } + "" + end + + case line_2 + # Note: Arguments are macro replaced in the first stage. + # Macro replacement list is expanded in the last stage. + values { output vec4 out0 = vec4(11.0, 11.0, 9.0, 10.0); } + + both "" + precision mediump float; + ${DECLARATIONS:single-line} + #define BBB __LINE__, /* + */ __LINE__ + #define AAA(a,b) BBB, a, b + + void main() + { + out0 = vec4(AAA(__LINE__, + __LINE__ + )); + ${OUTPUT} + } + "" + end + + case file + values { output float out0 = 0.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(__FILE__); + ${OUTPUT} + } + "" + end + + case if_gl_es + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case if_version + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if __VERSION__ == 100 + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + +end # predefined_macros + +group conditional_inclusion "Conditional Inclusion Tests" + + case basic_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA asdf + + #if defined AAA && !defined(BBB) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_2 + values { output float out0 = 1.0; } + # Note: this is expected to fail contrary to native dEQP, + # see https://github.com/KhronosGroup/WebGL/pull/1523 + expect compile_fail + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA defined(BBB) + + #if !AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + out0 = -1.0; + #elif 0 + out0 = -2.0; + #elif 1 + out0 = 1.0; + #else + out0 = -3.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_4 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + out0 = -1.0; + #elif 0 + out0 = -2.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_5 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + out0 = 1.0; + #elif 0 + out0 = -2.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case unary_ops_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~2 >> 1) & 1) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case unary_ops_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~(- - - - - 1 + + + + + +1) >> 1) & 1) + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + +end # conditional_inclusion + +group invalid_ops "Invalid Operations Tests" + + case invalid_op_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !((~(+ ++1 - - - -1) >> 1) & 1) + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_op_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !((~(+ + +1 - -- -1) >> 1) & 1) + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_1 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_2 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined() + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_3 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined( + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_4 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined) + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_5 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined((AAA)) + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + #endif + } + "" + end + + case invalid_defined_expected_rparen + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined(AAA + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case defined_define + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define define 1 + #define AAA 1.0 + + void main() + { + out0 = AAA; + ${OUTPUT} + } + "" + end + +end # invalid_ops + +group undefined_identifiers "Undefined Identifiers Tests" + + case valid_undefined_identifier_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 || AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case valid_undefined_identifier_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 && AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case undefined_identifier_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 - CCC + (-AAA || BBB) + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if -A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_4 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if ~A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_5 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_6 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define A 1 + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_7 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define B 1 + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_8 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define B 1 + #define A 2 + #undef A + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_9 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_10 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define A 0 + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_11 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define A 0 + #define B 2 + #undef B + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_12 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define B 1 + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + +end # undefined_identifiers + +group invalid_conditionals "Invalid Conditionals Tests" + + case empty_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_if_defined + expect compile_fail + both "" + precision mediump float; + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef FOOBAR + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef GL_ES + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(2.0); + } + "" + end + + case elif_after_else + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(0.0); + #endif + } + "" + end + + case else_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case elif_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case endif_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case else_after_else + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !GL_ES + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case nested_elif_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + # elif + ${POSITION_FRAG_COLOR} = vec4(0.0); + # endif + #endif + } + "" + end + + case if_float + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1.231 + ${POSITION_FRAG_COLOR} = vec4(1.0); + # elif + ${POSITION_FRAG_COLOR} = vec4(0.0); + # endif + #endif + } + "" + end + + case tokens_after_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_elif + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #elif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_else + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #else foobar 1.231 + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_endif + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #else + #endif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef FOOBAR foobar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef FOOBAR ,, +- << barbar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_conditionals + +group conditionals "Conditionals Tests" + + case unterminated_nested_blocks + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + # if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case ifdef_1 + values { output float out0 = 1.0; } + both "" + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_2 + values { output float out0 = 1.0; } + both "" + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #if defined ( AAA) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case invalid_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case ifndef_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifndef_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define AAA + void main() + { + #ifndef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case invalid_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case mixed_conditional_inclusion + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #elif 1 + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case nested_if_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + # if __VERSION__ != 100 + out0 = -1.0; + # else + out0 = 1.0; + # endif + #endif + ${OUTPUT} + } + "" + end + + case nested_if_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + # if 0 + out0 = -1.0; + # else + # if 0 + out0 = -1.0; + # elif 1 + out0 = 1.0; + # else + out0 = -1.0; + # endif + # endif + #endif + ${OUTPUT} + } + "" + end + + case nested_if_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + # if 1 + out0 = -1.0; + # endif + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + +end # conditionals + +group directive "Directive Tests" + + case version + values { output float out0 = 1.0; } + both "" + /* asdf */ + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case version_is_less + expect compile_fail + both "" + #version 99 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_is_more + expect compile_fail + both "" + #version 101 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_missing + expect compile_fail + both "" + #version + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_1 + expect compile_fail + both "" + precision mediump float; + #version 100 + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_2 + expect compile_fail + both "" + #define FOO BAR + #version 100 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_1 + expect compile_fail + both "" + #version 100.0 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_2 + expect compile_fail + both "" + #version foobar + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_version + expect compile_fail + both "" + #version AAA + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case additional_tokens + expect compile_fail + both "" + #version 100 foobar + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error_with_no_tokens + expect compile_fail + both "" + #error + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error + expect compile_fail + both "" + #define AAA asdf + #error 1 * AAA /* comment */ + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # directive + +group builtin "Built-in Symbol Tests" + + case line + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 1 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 234 10 + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_expression + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line +20 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file_expression + values { output vec4 out0 = vec4(243.0, 243.0, 10.0, 10.0); } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line (233 +10) (+10) + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_defined_1 + values { output float out0 = 4.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 4 + #line A + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_defined_2 + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 10 + #line 234 A + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case empty_line + expect compile_fail + both "" + precision mediump float; + void main() + { + #line + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_line_file_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #line 22 1.234 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #line 233 10 2 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_4 + expect compile_fail + both "" + precision mediump float; + void main() + { + #line foobar + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + +end # builtin + +group pragmas "Pragma Tests" + + # Note: pragma_vertex was removed compared to the native dEQP. + # This test was in the gles2-failures.txt skip list in the + # native dEQP. While it seemed theoretically correct, in + # practice, linking the program failed on Mac OS on all GPU + # types. Since this version of the dEQP is unlikely to be + # revisited, the test was removed here, rather than adding it + # to tcuSkipList.js. + + # Note: pragma_fragment was removed compared to the native dEQP. + # This test was buggy; it required that a varying that was not + # invariant in the vertex shader, but invariant in the fragment + # shader, must link. The test was in the gles2-failures.txt skip + # list in the native test suite. To avoid confusion the test was + # removed here, rather than adding it to tcuSkipList.js. + + case pragma_macro_exp + values { output float out0 = 1.0; } + both "" + #define off INVALID + /* pragma line not macro expanded */ + #pragma debug(off) + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case pragma_unrecognized_debug + expect build_successful + both "" + #pragma debug(1.23) + + // unrecognized preprocessor token + + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case pragma_unrecognized_token + expect build_successful + both "" + #pragma **% + + // trailing bytes form a valid but unrecognized preprocessor token + + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # pragmas + +group extensions "Extension Tests" + + case basic + values { output float out0 = 1.0; } + both "" + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case macro_exp + values { output float out0 = 1.0; } + both "" + #define warn enable + + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case missing_extension_name + expect compile_fail + both "" + #extension + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_extension_name + expect compile_fail + both "" + #extension 2 : all + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_colon + expect compile_fail + both "" + #extension all + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case expected_colon + expect compile_fail + both "" + #extension all ; + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_behavior + expect compile_fail + both "" + #extension all : + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_1 + expect compile_fail + both "" + #extension all : WARN + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_2 + expect compile_fail + both "" + #extension all : require + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_name + expect compile_fail + both "" + #extension all* : warn + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_behavior + expect compile_fail + both "" + #extension all : war*n + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_comment + expect compile_fail + both "" + #extension all : warn /*asd + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end +end # extensions + +group expressions "Expression Tests" + + case shift_left + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL << 2) == 16 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case shift_right + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 5 + out0 = 0.0; + #if (VAL >> 1) == 2 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case cmp_less_than + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 5 + out0 = 0.0; + #if (VAL < 6) && (-VAL < -4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case less_or_equal + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL <= 6) && (-VAL <= -6) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case or + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL | 5) == 7 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case and + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL & 5) == 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case xor + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL ^ 5) == 3 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case mod + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 12 + out0 = 0.0; + #if (VAL % 5) == 2 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_value + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (( (4 ) ) ) + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_tricky + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (( (4 ) ) + out0 = 0.0; + #if VAL) >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_if_no + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_if + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL >= 4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_multi_if + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (4) + out0 = 0.0; + #if (((VAL)) >= (4)) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_single_if + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL >= 4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_ifelse_true + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + #if (VAL >= 4) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_ifelse_false + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + #if (VAL > 4) + out0 = 0.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_basic_0 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if -4 + 5 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_basic_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if (2 * 2) - 3 >= 0 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_simple_precedence_0 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 2 * 3 - 3 == 3 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_simple_precedence_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 2 - 2 / 2 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + void main() + { + #if defined(X) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + void main() + { + #if defined(X) == Y + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + void main() + { + #if defined(X) && defined(Y) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_4 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef X + void main() + { + #if defined(X) && defined(Y) + out0 = 0.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_5 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef X + void main() + { + #if defined(X) || defined(Y) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_6 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef Y + void main() + { + #if defined(X) && (defined(Y) || (X == 0)) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + +end # expressions + +group invalid_expressions "Invalid Expression Tests" + + case invalid_unary_expr + expect compile_fail + both "" + precision mediump float; + void main() + { + #if ! + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_binary_expr + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 3+4+ + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_expr + expect compile_fail + both "" + precision mediump float; + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 4 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 4 * * 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if (4)(4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unopened_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + #if ((4 + 7) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_expressions + +group operator_precedence "Operator precedence" + + + case modulo_vs_not + values { output float out0 = 1.0; } + both "" + + #if ( 8 % ! 0 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_not + values { output float out0 = 1.0; } + both "" + + #if ( 8 / ! 0 ) == 8 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_not + values { output float out0 = 1.0; } + both "" + + #if ( 8 * ! 0 ) == 8 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_bit_invert + values { output float out0 = 1.0; } + both "" + + #if ( 8 % ~ 4 ) == 3 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_minus + values { output float out0 = 1.0; } + both "" + + #if ( 8 % - 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_plus + values { output float out0 = 1.0; } + both "" + + #if ( 8 % + 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_bit_invert + values { output float out0 = 1.0; } + both "" + + #if ( 8 / ~ 2 ) == -2 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_minus + values { output float out0 = 1.0; } + both "" + + #if ( 8 / - 2 ) == -4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_plus + values { output float out0 = 1.0; } + both "" + + #if ( 8 / + 2 ) == 4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_bit_invert + values { output float out0 = 1.0; } + both "" + + #if ( 8 * ~ 2 ) == -24 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_minus + values { output float out0 = 1.0; } + both "" + + #if ( 8 * - 2 ) == -16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_plus + values { output float out0 = 1.0; } + both "" + + #if ( 8 * + 2 ) == 16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_modulo + values { output float out0 = 1.0; } + both "" + + #if ( 8 - 3 % 2 ) == 7 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_div + values { output float out0 = 1.0; } + both "" + + #if ( 8 - 3 / 2 ) == 7 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_mul + values { output float out0 = 1.0; } + both "" + + #if ( 8 - 3 * 2 ) == 2 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_modulo + values { output float out0 = 1.0; } + both "" + + #if ( 8 + 3 % 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_div + values { output float out0 = 1.0; } + both "" + + #if ( 8 + 3 / 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_mul + values { output float out0 = 1.0; } + both "" + + #if ( 8 + 3 * 2 ) == 14 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case rshift_vs_sub + values { output float out0 = 1.0; } + both "" + + #if ( 8 >> 3 - 2 ) == 4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case rshift_vs_add + values { output float out0 = 1.0; } + both "" + + #if ( 8 >> 3 + 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case lshift_vs_sub + values { output float out0 = 1.0; } + both "" + + #if ( 8 << 3 - 2 ) == 16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case lshift_vs_add + values { output float out0 = 1.0; } + both "" + + #if ( 8 << 3 + 2 ) == 256 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_or_equal_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 >= 3 >> 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_or_equal_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 >= 3 << 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_or_equal_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 <= 3 >> 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_or_equal_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 <= 3 << 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 > 3 >> 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 > 3 << 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 < 3 >> 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 < 3 << 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_greater_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 >= 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_less_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 <= 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_greater + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 > 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_less + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 < 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_greater_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 >= 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_less_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 <= 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_greater + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 > 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_less + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 < 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_and_vs_not_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 & 3 != 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_and_vs_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 & 3 == 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case xor_vs_bitwise_and + values { output float out0 = 1.0; } + both "" + + #if ( 8 ^ 3 & 2 ) == 10 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_or_vs_xor + values { output float out0 = 1.0; } + both "" + + #if ( 8 | 3 ^ 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_and_vs_bitwise_or + values { output float out0 = 1.0; } + both "" + + #if ( 0 && 3 | 2 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_and_vs_bitwise_and + values { output float out0 = 1.0; } + both "" + + #if ( 0 && 4 & 2 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_or_vs_logical_and + values { output float out0 = 1.0; } + both "" + + #if ( 0 || 4 && 0 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + +end # operator_precedence diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html new file mode 100644 index 000000000..be660758b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test new file mode 100644 index 000000000..4b20ad8ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test @@ -0,0 +1,785 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group variables "Order of qualification in variable declarations." + + group valid "Valid orderings." + + case invariant_storage_precision + expect pass + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + invariant varying lowp float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + invariant varying lowp float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision + expect pass + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying lowp float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying lowp float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage + expect pass + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + invariant varying float x0; + + uniform float x1; + + attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + invariant varying float x0; + + uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + + end # valid + group invalid "Invalid orderings." + + case invariant_precision_storage + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + invariant lowp varying float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + invariant lowp varying float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_precision + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying invariant lowp float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying invariant lowp float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying lowp invariant float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying lowp invariant float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_storage + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + lowp invariant varying float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + lowp invariant varying float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_invariant + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + lowp varying invariant float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + lowp varying invariant float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + lowp varying float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + lowp varying float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying invariant float x0; + + uniform float x1; + + attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying invariant float x0; + + uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + + end # invalid + +end # variables +group parameters "Order of qualification in function parameters." + + group valid "Valid orderings." + + case storage_parameter_precision + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const in lowp float x) + { + return x + 1.0; + } + + void foo1 ( out mediump float x) + { + x = 1.0; + } + + float foo2 ( inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case storage_parameter + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const in float x) + { + return x + 1.0; + } + + void foo1 ( out float x) + { + x = 1.0; + } + + float foo2 ( inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case storage_precision + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const lowp float x) + { + return x + 1.0; + } + + void foo1 ( mediump float x) + { + x = 1.0; + } + + float foo2 ( mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_precision + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in lowp float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + + end # valid + group invalid "Invalid orderings." + + case storage_precision_parameter + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const lowp in float x) + { + return x + 1.0; + } + + void foo1 ( mediump out float x) + { + x = 1.0; + } + + float foo2 ( mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_storage_precision + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in const lowp float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_precision_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in lowp const float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_storage_parameter + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp const in float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_parameter_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp in const float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in const float x) + { + return x + 1.0; + } + + void foo1 (out float x) + { + x = 1.0; + } + + float foo2 (inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp const float x) + { + return x + 1.0; + } + + void foo1 (mediump float x) + { + x = 1.0; + } + + float foo2 (mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_parameter + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp in float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + + end # invalid + +end # parameters diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html new file mode 100644 index 000000000..b98b97b77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test new file mode 100644 index 000000000..dda1f1aad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test @@ -0,0 +1,250 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +case operator_modulo + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value % 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_not + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value = ~value; + ${OUTPUT} + } + "" +end +case operator_bitwise_shift_left + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value << 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_shift_right + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value >> 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_and + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value & 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_xor + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value ^ 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_or + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value | 1; + ${OUTPUT} + } + "" +end +case operator_assign_modulo + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value %= 1; + ${OUTPUT} + } + "" +end +case operator_assign_shift_left + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value <<= 1; + ${OUTPUT} + } + "" +end +case operator_assign_shift_right + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value >>= 1; + ${OUTPUT} + } + "" +end +case operator_assign_and + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value &= 1; + ${OUTPUT} + } + "" +end +case operator_assign_xor + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value ^= 1; + ${OUTPUT} + } + "" +end +case operator_assign_or + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value |= 1; + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html new file mode 100644 index 000000000..5d01ef844 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test new file mode 100644 index 000000000..a387631af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test @@ -0,0 +1,823 @@ +group valid "Valid scoping and name redeclaration cases" + + case local_variable_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + void main() + { + ${SETUP} + int a = in0; + + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_local_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + { + int a = -1; + } + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + void main() + { + ${SETUP} + { + int a = in0; + + out0 = a; + } + ${OUTPUT} + } + "" + end + + case for_init_statement_variable_hides_local_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + for (int a = 0; a < 10; a++) + { + } + out0 = a; + ${OUTPUT} + } + "" + end + + case for_init_statement_variable_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = 5; + + void main() + { + ${SETUP} + for (int a = 0; a < 10; a++) + { + } + out0 = in0 + a - 5; + ${OUTPUT} + } + "" + end + + case variable_in_if_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = 1; + + void main() + { + ${SETUP} + if (true) + int a = 42; + out0 = a*in0; + ${OUTPUT} + } + "" + end + + case variable_from_outer_scope_visible_in_initializer + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + { + int a = a+5, b = a-5; + out0 = b; + a = 42; + } + out0 = out0 + a - in0; + ${OUTPUT} + } + "" + end + + case local_int_variable_hides_struct_type + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + struct S { int val; }; + + void main() + { + ${SETUP} + int S = S(in0).val; + out0 = S; + ${OUTPUT} + } + "" + end + + case local_struct_variable_hides_struct_type + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + struct S { int val; }; + + void main() + { + ${SETUP} + S S = S(in0); + out0 = S.val; + ${OUTPUT} + } + "" + end + + case local_variable_hides_function + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int foo (int x) { return x; } + + void main() + { + ${SETUP} + int foo = in0; + out0 = foo; + ${OUTPUT} + } + "" + end + + case function_parameter_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + int func (int a) { return a; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case function_parameter_hides_struct_type + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + struct S { int x; }; + + int func (int S) { return S; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case function_parameter_hides_function + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int func (int func) { return func; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case local_variable_in_inner_scope_hides_function_parameter + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + int func (int inp, int x) { { int x = 5; return inp + x - 5; } } + + void main() + { + ${SETUP} + out0 = func(in0, 42); + ${OUTPUT} + } + "" + end + +end + +group invalid "Invalid scoping behavior" + + case redeclare_global_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a; + float a; + + void main() + { + a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_local_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a; + float a; + a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_for_init_statement_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + for (int i = 0; i < 10; i++) + { + int i = 11; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_for_condition_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + for (int i = 0; int a = (i < 10); i++) + { + int a = 0; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_for_init_statement_variable_in_for_condition + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a; + for (int i = 0; int i = (i < 10); i++) + { + a = sin(i); + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_while_condition_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a = 0; + while (int i = (a < 5)) + { + int i = 11; + a += i; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_function + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func(float x); + float func(float x); + + float func(float x) { return x + 1.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case redefine_function + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func(float x); + + float func(float x) { return x + 1.0; } + float func(float x) { return x + 2.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case redeclare_builtin + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float sin(float x); + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case redefine_builtin + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float sin(float x) { return x + 1.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case conflict_function_struct + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void f(int x); + struct f { int x; }; + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1); + } + "" + end + + case conflict_function_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void f(int x); + float f; + + void main() + { + f = 1.0; + ${POSITION_FRAG_COLOR} = vec4(f); + } + "" + end + + case use_global_variable_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void func() + { + a = 2.0; + } + + float a; + + void main() + { + func(); + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_local_variable_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a = 1.0; + a = b; + float b = 2.0; + + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_struct_type_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func (float x) { return S(x).val; } + struct S { float val; }; + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case use_function_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func (float x) { return bar(x); } + float bar (float x) { return x; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case use_variable_from_block_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + { + float a = 1.0; + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_if_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + if (true) + float a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_else_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + if (false) + float a = 1.0; + else + float b = 2.0; + ${POSITION_FRAG_COLOR} = vec4(b); + } + "" + end + + case use_variable_from_if_in_else + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a = 1.0; + if (true) + { + float b = 2.0; + } + else + { + a = b; + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_for_init_statement_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float x = 0.0; + for (int i = 0; i < 10; i++) + { + x += sin(i); + } + ${POSITION_FRAG_COLOR} = vec4(float(i)); + } + "" + end + + case use_variable_from_while_condition_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a = 1; + while (bool b = (a == 1)) + { + a++; + } + ${POSITION_FRAG_COLOR} = vec4(float(b)); + } + "" + end + + case use_parameter_names_from_function_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func(float a, float b); + + float func(float x, float y) { return a+b; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0)); + } + "" + end + + case variable_not_visible_in_own_initializer + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float x = x; + ${POSITION_FRAG_COLOR} = vec4(x); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html new file mode 100644 index 000000000..864ad8046 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html @@ -0,0 +1,462 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.html new file mode 100644 index 000000000..542ca92d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test new file mode 100644 index 000000000..7e82c3e60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test @@ -0,0 +1,6811 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group vector_swizzles "Vector Swizzles" + + case mediump_vec2_x + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xx + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xy + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yx + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yxy + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xyxx + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yyyy + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_s + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ss + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_st + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ts + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tst + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec2_stss + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tttt + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec2_r + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rr + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rg + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gr + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_grg + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rgrr + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gggg + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_x + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec3_z + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zyx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xxx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzy + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_yxy + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xzx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyyx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzzz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_s + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec3_p + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pts + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sss + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppt + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_vec3_tst + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sps + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stts + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pppp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_r + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec3_b + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rgb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bgr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rrr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbg + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_grg + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rbr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rggr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbbb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_vec4_x + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec4_w + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wz + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_www + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyw + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzy + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyzw + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzyx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xxxx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyyy + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwww + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzzw + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwwy + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyxx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_zzwz + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_s + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec4_q + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qs + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qp + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ttq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpt + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stpq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpts + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ssss + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_tttt + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qppq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqt + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stss + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ppqp + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_r + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec4_a + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ar + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ab + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaa + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gga + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abg + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgba + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abgr + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rrrr + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gggg + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaaa + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abba + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaag + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgrr + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_bbab + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_x + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xx + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xy + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yx + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yxy + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xyxx + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yyyy + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_s + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ss + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_st + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ts + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tst + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_stss + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tttt + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_r + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rr + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rg + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gr + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_grg + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rgrr + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gggg + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_x + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_z + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zyx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xxx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzy + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_yxy + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xzx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyyx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzzz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_s + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_p + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pts + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sss + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppt + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_tst + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sps + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stts + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pppp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_r + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_b + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rgb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bgr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rrr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbg + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_grg + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rbr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rggr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbbb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_x + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_w + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wz + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_www + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyw + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzy + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyzw + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzyx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xxxx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyyy + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwww + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzzw + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwwy + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyxx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_zzwz + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_s + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_q + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qs + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qp + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ttq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpt + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stpq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpts + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ssss + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_tttt + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qppq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqt + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stss + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ppqp + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_r + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_a + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ar + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ab + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaa + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gga + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abg + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgba + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abgr + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rrrr + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gggg + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaaa + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abba + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaag + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgrr + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_bbab + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_x + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xx + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xy + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yx + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yxy + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xyxx + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yyyy + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_s + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ss + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_st + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ts + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tst + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_stss + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tttt + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_r + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rr + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rg + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gr + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_grg + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rgrr + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gggg + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_x + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_z + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zyx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xxx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzy + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_yxy + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xzx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyyx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzzz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_s + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_p + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pts + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sss + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppt + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_tst + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sps + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stts + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pppp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_r + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_b + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rgb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bgr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rrr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbg + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_grg + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rbr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rggr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbbb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_x + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_w + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wz + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_www + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyw + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzy + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyzw + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzyx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xxxx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyyy + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwww + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzzw + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwwy + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyxx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_zzwz + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_s + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_q + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qs + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qp + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ttq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpt + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stpq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpts + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ssss + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_tttt + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qppq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqt + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stss + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ppqp + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_r + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_a + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ar + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ab + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaa + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gga + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abg + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgba + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abgr + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rrrr + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gggg + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaaa + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abba + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaag + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgrr + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_bbab + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + +end # vector_swizzles diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html new file mode 100644 index 000000000..8d56d4dbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt new file mode 100644 index 000000000..d98d8130b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt @@ -0,0 +1,17 @@ +arrays.html +conditionals.html +constants.html +constant_expressions.html +conversions.html +declarations.html +fragdata.html +functions.html +invalid_texture_functions.html +keywords.html +linkage.html +negative.html +preprocessor.html +qualification_order.html +scoping.html +switch.html +swizzles.html diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html new file mode 100644 index 000000000..1a79102d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test new file mode 100644 index 000000000..f6276522b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test @@ -0,0 +1,1962 @@ +#X1. Type: float[5] // An array type with 5 elements +#X2. Return value: float[5] func() { ... } // Function with a 5-element array return value +#X3. Array constructor: float[3] (1.0, 2.0, 5.5) // 3-element array with given elements +# // Fails with array of matrices! +#X4. As unnamed parameter: void func(float[5]); +#X5. Variable declaration: float[5] a; // Equivalent to float a[5]; (?) +#X6. Empty brackets: float x[] = float[] (1.0, 2.0, 3.0); // Size of x is 3 +# float y[] = float[3] (1.0, 2.0, 3.0); // Size of y is 3 (equivalent) +# float z[] = y; // Size of z is 3 +#X7. Testing that 2-dimensional arrays don't work: float a[5][3]; // Illegal +# float[5] a[3]; // Illegal +#X8. Testing that array declaration with dynamic variables as array size won't work. +#X9. Testing length() operator: z.length(); // Returns 3 for z defined before +#X10. Test C/C++ style {}-constructor +#X11. Test struct arrays +#X12. Test array element access at initialization with const/dynamic values + +group constructor "Array constructors" + + case float3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[3] x; + x = float[3] (in0.z, in0.x, in0.y); + out0 = vec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case float4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 0.2) | vec4(7.4, -1.0, 2.0, -1.3) | vec4(3.0, 1.6, -2.0, 0.5) ]; + output vec4 out0 = [ vec4(2.0, 0.5, 0.2, 1.0) | vec4(2.0, 7.4, -1.3, -1.0) | vec4(-2.0, 3.0, 0.5, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[4] x; + x = float[4] (in0.z, in0.x, in0.w, in0.y); + out0 = vec4(x[0], x[1], x[2], x[3]); + ${OUTPUT} + } + "" + end + + case int3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[3] x; + x = int[3] (in0.z, in0.x, in0.y); + out0 = ivec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case int4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ]; + output ivec4 out0 = [ ivec4(2, 0, 0, 1) | ivec4(2, 7, -1, -1) | ivec4(-2, 3, 0, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[4] x; + x = int[4] (in0.z, in0.x, in0.w, in0.y); + out0 = ivec4(x[0], x[1], x[2], x[3]); + ${OUTPUT} + } + "" + end + + case bool3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, true, false) ]; + output bvec3 out0 = [ bvec3(false, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[3] x; + x = bool[3] (in0.z, in0.x, in0.y); + out0 = bvec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case bool4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, true, false, false) ]; + output bvec4 out0 = [ bvec4(false, true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[4] x; + x = bool[4] (in0.z, in0.x, in0.y, in0.w); + out0 = bvec4(x[0], x[1], x[2], x[3]); + ${OUTPUT} + } + "" + end + + case struct3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(2.0, -0.5, -1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + + + void main() + { + ${SETUP} + + struct test + { + float f; + vec3 v; + }; + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[3] x = test[3] (a, b, c); + + out0 = vec3(x[0].f, x[1].v.y, x[2].v.x); + ${OUTPUT} + } + "" + end + + case struct4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 1.5) ]; + output vec4 out0 = [ vec4(2.0, -0.5, -1.0, -1.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + + void main() + { + ${SETUP} + + + struct test + { + float f; + vec3 v; + }; + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + test d = test(-in0.w, vec3(-in0.w, -in0.x, -in0.z)); + + test[4] x = test[4] (a, b, c, d); + + out0 = vec4(x[0].f, x[1].v.y, x[2].v.x, x[3].v.x); + ${OUTPUT} + } + "" + end + + + case float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(7.4, -2.0, -1.0) | vec3(3.0, 2.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + + vec3[3] x; + x = vec3[3] ( vec3(in0.x, in0.y, in0.z) , + vec3(-in0.y, -in0.z, -in0.x), + vec3(in0.z, in0.x, in0.y) ); + out0 = vec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case int_vec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(5, -2, 1) | ivec3(7, -2, -1) | ivec3(3, 2, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + + ivec3[3] x; + x = ivec3[3] ( ivec3(in0.x, in0.y, in0.z) , + ivec3(-in0.y, -in0.z, -in0.x), + ivec3(in0.z, in0.x, in0.y) ); + out0 = ivec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case bool_vec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + + bvec3[3] x; + x = bvec3[3] ( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x), + bvec3(in0.z, in0.x, in0.y) ); + out0 = bvec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y) , + mat3( in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + +end # type + +group return "Arrays as return value" + + case float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float[3] func(vec3 a) + { + return float[3] (a.z, -a.x, a.y); + } + + void main() + { + ${SETUP} + float[3] x = func(in0); + out0 = vec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case int + version 300 es + values + { + input ivec3 in0 = [ ivec3(4, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, -4, 1) | ivec3(2, -7, -1) | ivec3(-2, -3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + int[3] func(ivec3 a) + { + return int[3] (a.z, -a.x, a.y); + } + + void main() + { + ${SETUP} + int[3] x = func(in0); + out0 = ivec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, true, true) ]; + output bvec3 out0 = [ bvec3(true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool[3] func(bvec3 a) + { + return bool[3] (a.z, a.x, a.y); + } + + void main() + { + ${SETUP} + bool[3] x = func(in0); + out0 = bvec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + + + case float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ]; + output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec3[3] func(vec3[3] a) + { + return vec3[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) , + vec3(in0.y, -in0.z, in0.x) , + vec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = vec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + test[3] func(test[3] a) + { + return test[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[3] t = test[3] (a, b, c); + test[3] x = func(t); + + out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x); + ${OUTPUT} + } + "" + end + + case int_vec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ]; + output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + ivec3[3] func(ivec3[3] a) + { + return ivec3[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) , + ivec3(in0.y, -in0.z, in0.x) , + ivec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = ivec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case bool_vec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + bvec3[3] func(bvec3[3] a) + { + return bvec3[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x) , + bvec3(in0.z, in0.x, in0.y) ); + x = func(x); + out0 = bvec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y); + a[2] = mat3(in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + +end # return + +group unnamed_parameter "Array type as unnamed parameter of a function prototype" + + case float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float[3] func(float[3]); + + void main() + { + ${SETUP} + float[3] a = float[3] (in0.x, in0.y, in0.z); + float[3] b = func(a); + out0 = vec3(b[0], b[1], b[2]); + ${OUTPUT} + } + + float[3] func(float[3] a) + { + return float[3] (a[2], a[0], a[1]); + } + + "" + end + + case int + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + int[3] func(int[3]); + + void main() + { + ${SETUP} + int[3] a = int[3] (in0.x, in0.y, in0.z); + int[3] b = func(a); + out0 = ivec3(b[0], b[1], b[2]); + ${OUTPUT} + } + + int[3] func(int[3] a) + { + return int[3] (a[2], a[0], a[1]); + } + + "" + end + + case bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, true, true) ]; + output bvec3 out0 = [ bvec3(true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool[3] func(bool[3]); + + void main() + { + ${SETUP} + bool[3] a = bool[3] (in0.x, in0.y, in0.z); + bool[3] b = func(a); + out0 = bvec3(b[0], b[1], b[2]); + ${OUTPUT} + } + + bool[3] func(bool[3] a) + { + return bool[3] (a[2], a[0], a[1]); + } + + "" + end + + case struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + test[3] func(test[3]); + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[3] t = test[3] (a, b, c); + test[3] x = func(t); + out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x); + ${OUTPUT} + } + + test[3] func(test[3] a) + { + return test[3] (a[1], a[2], a[0]); + } + + "" + end + + case float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ]; + output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec3[3] func(vec3[3]); + + void main() + { + ${SETUP} + vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) , + vec3(in0.y, -in0.z, in0.x) , + vec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = vec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + + vec3[3] func(vec3[3] a) + { + return vec3[3] (a[1], a[2], a[0]); + } + "" + end + + case int_vec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ]; + output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + ivec3[3] func(ivec3[3]); + + void main() + { + ${SETUP} + ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) , + ivec3(in0.y, -in0.z, in0.x) , + ivec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = ivec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + + ivec3[3] func(ivec3[3] a) + { + return ivec3[3] (a[1], a[2], a[0]); + } + "" + end + + case bool_vec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + bvec3[3] func(bvec3[3]); + + void main() + { + ${SETUP} + bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x) , + bvec3(in0.z, in0.x, in0.y) ); + x = func(x); + out0 = bvec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + + bvec3[3] func(bvec3[3] a) + { + return bvec3[3] (a[1], a[2], a[0]); + } + + "" + end + + case float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3]); + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + "" + end + + case int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3]); + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + "" + end + + case bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3]); + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y); + a[2] = mat3(in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + "" + end + +end # unnamed_parameter + +group declaration "Declaring arrays" + + case implicit_size_float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[] x = float[] (in0.z, in0.x, in0.y); + float[] y = x; + + out0 = vec3(y[0], y[1], y[2]); + ${OUTPUT} + } + "" + end + + case implicit_size_int + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[] x = int[] (in0.z, in0.x, in0.y); + int[] y = x; + + out0 = ivec3(y[0], y[1], y[2]); + ${OUTPUT} + } + "" + end + + case implicit_size_bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, true, true) ]; + output bvec3 out0 = [ bvec3(true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[] x = bool[] (in0.z, in0.x, in0.y); + bool[] y = x; + + out0 = bvec3(y[0], y[1], y[2]); + ${OUTPUT} + } + "" + end + + case implicit_size_struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[] x = test[] (c, b, a); + test[] y = x; + + out0 = vec3(y[0].v.x, y[1].v.y, y[2].v.z); + ${OUTPUT} + } + "" + end + + case implicit_size_float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ]; + output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3[] x = vec3[] ( vec3(in0.x, in0.y, -in0.z) , + vec3(in0.y, -in0.z, in0.x) , + vec3(-in0.z, in0.x, in0.y) ); + vec3[] y = x; + out0 = vec3(y[0].x, y[1].y, y[2].z); + ${OUTPUT} + } + "" + end + + case implicit_size_int_ivec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ]; + output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3[] x = ivec3[] ( ivec3(in0.x, in0.y, -in0.z) , + ivec3(in0.y, -in0.z, in0.x) , + ivec3(-in0.z, in0.x, in0.y) ); + ivec3[] y = x; + out0 = ivec3(y[0].x, y[1].y, y[2].z); + ${OUTPUT} + } + "" + end + + case implicit_size_bool_bvec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3[] x = bvec3[] ( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x) , + bvec3(in0.z, in0.x, in0.y) ); + bvec3[] y = x; + out0 = bvec3(y[0].x, y[1].y, y[2].z); + ${OUTPUT} + } + "" + end + + case implicit_size_float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case implicit_size_int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case implicit_size_bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y) , + mat3( in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + + case constant_expression_array_size + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + const int a = 4; + + void main () + { + const int b = 5; + float[a] array1; + float[b] array2; + float[array1.length()] array3; + float[a+b] array4; + ${OUTPUT} + } + "" + end + + case constant_expression_array_access + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + const int a = 3; + + void main () + { + ${SETUP} + const int b = 2; + float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [a]; + float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [b+2]; + float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [5]; + out0 = vec3(x, y, z); + ${OUTPUT} + } + "" + end + + case dynamic_expression_array_access + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + input ivec2 in1 = ivec2(3, 2); + output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ${SETUP} + float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x]; + float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.y+2]; + float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x+in1.y]; + out0 = vec3(x, y, z); + ${OUTPUT} + } + "" + end + + case multiple_declarations_single_statement_explicit + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(2.0, -1.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ${SETUP} + float[] x = float[6] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x), + y = float[2] (in0.x, -in0.y); + out0 = vec3(x[2], y[1], x[0]); + ${OUTPUT} + } + "" + end + + case multiple_declarations_single_statement_implicit + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) ]; + output ivec3 out0 = [ ivec3(2, -1, 5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ${SETUP} + int[] x = int[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x), + y = int[] (in0.x, -in0.y); + out0 = ivec3(x[2], y[1], x[0]); + ${OUTPUT} + } + "" + end + +end # declaration + +group length "Array length method" + + case float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[] x = float[3] (in0.z, in0.x, in0.y); + float[] y = float[] (in0.z, in0.x, in0.y, in0.x, in0.y); + float[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + + case int + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[] x = int[3] (in0.z, in0.x, in0.y); + int[] y = int[] (in0.z, in0.x, in0.y, in0.x, in0.y); + int[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + + case bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[] x = bool[3] (in0.z, in0.x, in0.y); + bool[] y = bool[] (in0.z, in0.x, in0.y, in0.x, in0.y); + bool[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + + case struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[] x = test[3] (a, b, c); + test[] y = test[] (c, a, b, b, a); + test[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + +end # length + +group invalid "Invalid Functions" + + case multidimensional_array1 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[5][3]; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case multidimensional_array2 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float[5] a[3]; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case multidimensional_uniform_array + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float a[3][2]; + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case multidimensional_array_in_uniform_block + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform MyBlock + { + float a[3][2]; + }; + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case dynamic_expression_array_size + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int a = 5; + float[a] array; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_declaration_without_var_name + version 300 es + expect compile_or_link_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int[]; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_declaration_with_var_name + version 300 es + expect compile_or_link_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int[] a; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c-style1 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[]; + a = float[3] { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c-style2 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[5] = { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html new file mode 100644 index 000000000..e786e1422 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test new file mode 100644 index 000000000..a3a5b476f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test @@ -0,0 +1,381 @@ +group if "If Statements" + + case single_statement + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + if (in0 >= 1.0) + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case compound_statement + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (in0 >= 1.0) + { + out0 = 1.0; + out1 = 0.0; + } + ${OUTPUT} + } + "" + end + + case sequence_statements + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (in0 >= 1.0) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case sequence_condition + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (false, in0 >= 1.0) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case complex_condition + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0)) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case if_else + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 1.0) + out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case if_elseif + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + if (in0 >= 2.0) + out0 = 2.0; + else if (in0 >= 1.0) + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case if_elseif_else + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 2.0) + out0 = 2.0; + else if (in0 >= 1.0) + out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case mixed_if_elseif_else + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 2.0) + { + out0 = 2.0; + } + else if (in0 >= 1.0) + out0 = 2.0, out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + +end # if + +group invalid_if "Invalid If Conditionals" + + case missing_parenthesis + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (5) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_zero_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_one_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (1) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_uniform_condition + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + precision mediump int; + uniform int u0; + ${DECLARATIONS} + void main() + { + if (u0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (5.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_zero_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (0.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_one_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (1.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case sampler_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + uniform sampler2D s0; + ${DECLARATIONS} + void main() + { + if (s0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_if diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html new file mode 100644 index 000000000..e74ca678f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test new file mode 100644 index 000000000..59c6cb6ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test @@ -0,0 +1,483 @@ +group trivial "Trivial expressions" + + case float + version 300 es + values { output float out0 = 5.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = 5.0; + out0 = a; + ${OUTPUT} + } + "" + end + + case int + version 300 es + values { output int out0 = 5; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a = 5; + out0 = a; + ${OUTPUT} + } + "" + end + + case bool + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const bool a = true; + out0 = a; + ${OUTPUT} + } + "" + end + + case cast + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = float(int(bool(true))); + out0 = a; + ${OUTPUT} + } + "" + end + +end # trivial + +group operators "Operators" + + case math_float + version 300 es + values { output float out0 = 2.19; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = 6.0/3.5 + 1.8*2.6 - 4.2; + out0 = a; + ${OUTPUT} + } + "" + end + + case math_vec + version 300 es + values { output float out0 = 15.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const vec3 a = (vec4(1.0, 2.0, 3.0, 4.0).zyx * vec3(1.0, 1.5, 3.0).xyz).xzy + (vec2(5.0)/vec2(2.5)).xxy; + out0 = a.x + a.y + a.z; + ${OUTPUT} + } + "" + end + + case math_int + version 300 es + values { output int out0 = 7; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const int a = 25%7 + 2*3 - 9/3; + out0 = a; + ${OUTPUT} + } + "" + end + + case math_ivec + version 300 es + values { output int out0 = 21; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const ivec3 a = ivec2(25%7, 4).xxy + ivec4(1*3, 9/3, 1+2, 8/4).xyz; + out0 = a.x + a.y + a.z; + ${OUTPUT} + } + "" + end + + case math_mat + version 300 es + values { output float out0 = 8.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const mat3 a = mat3(3.0) * mat3(4.0); + const mat4 b = mat4(a[1][1])*2.0; + const mat2 c = mat2(b[0][0]) / 3.0; + out0 = c[0][0]+c[1][0]; + ${OUTPUT} + } + "" + end + + case bitwise + version 300 es + values { output int out0 = 678332; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const int a = (((0xABBA<<4) ^ 0xCAFE) | (0xDCBA & (0xABCD>>2))) ^ (~0xDEAD & 0xBEEF); + out0 = a; + ${OUTPUT} + } + "" + end + + case logical + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const bool a = (!false || false) && (true ^^ false); + out0 = a; + ${OUTPUT} + } + "" + end + + case compare + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const bool a = (false == false) && (true != false) && (1 < 2) && (3 <= 3) && ((1 > 1) != (1 >= 1)); + out0 = a; + ${OUTPUT} + } + "" + end + + case selection + version 300 es + values { output float out0 = 5.3; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = false ? 0.0 : (true ? 5.3 : 1.0); + out0 = a; + ${OUTPUT} + } + "" + end + +end # operators + +group complex_types "Arrays & Structs" + + case struct + version 300 es + values { output float out0 = 260.922; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + struct S + { + vec4 a; + int b; + }; + + void main() + { + const S s = S(vec4(1.5), 123); + out0 = length(s.a.xy)*float(s.b); + ${OUTPUT} + } + "" + end + + case nested_struct + version 300 es + values { output float out0 = 965.9; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + struct S + { + vec4 v; + int i; + }; + + struct T + { + S s; + bool b; + int i; + }; + + struct U + { + S s; + T t; + }; + + void main() + { + const S s = S(vec4(1.5), 123); + const T t = T(s, false, 3); + const U u = U(s, t); + const U v = U(S(vec4(1.3), 4), T(S(vec4(2.0), 5), true, 6)); + out0 = float(u.s.i*v.t.i + v.t.s.i)*v.s.v.x; // float(123*6 + 5)*1.3 + ${OUTPUT} + } + "" + end + + case array_size + version 300 es + values { output int out0 = 1; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a[max(-1, 1)] = int[1](1); + out0 = a[0]; + ${OUTPUT} + } + "" + end + + case array_length + version 300 es + values { output int out0 = 2; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a[1] = int[1](1); + out0 = a.length() + a[0]; + ${OUTPUT} + } + "" + end + + case array + version 300 es + values { output float out0 = 4.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a[1+2+5] = float[8](0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0); + const float f = a[1+2+4]; + out0 = f + float(a.length()-8); + ${OUTPUT} + } + "" + end + +end # complex_types + +group other "Other operations" + + case switch_case + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ]; + output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int _0 = 0; + const int _1 = 1; + const int _2 = 2; + const int _3 = 3; + const int _4 = 4; + + switch(int(in0)) + { + case _0: + out0 = 0; + break; + case _1: + out0 = 1; + break; + case _2: + out0 = 2; + break; + case _3: + out0 = 3; + break; + case _4: + out0 = 4; + break; + case 5: + out0 = 10; + break; + default: + out0 = 100; + + } + ${OUTPUT} + } + "" + end + + case nested_builtin_funcs + version 300 es + values { output float out0 = 3.05; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = sqrt( atan(sin(1.5)/cos(1.5)) /*1.5*/ * log2(exp2(log(exp(6.2) + 0.1)) + 0.1) /*~6.2*/); + out0 = a; + ${OUTPUT} + } + "" + end + + case complex + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ]; + output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + struct T + { + vec4 v; + }; + + struct S + { + T t; + int i; + bool b; + }; + + void main() + { + const T t = T(vec4(1.0)); + const S s = S(t, 42, true); + const int _0 = int(sin(0.0)); + const int _1 = int(1.0); + const int _2 = 2 + int(float(_0>_1)); + const int _3 = min(gl_MaxVertexAttribs, 16)/4 - 1; + const int _4 = min(gl_MaxDrawBuffers, 4); + const ivec4 nums = ivec4(0, 1, 2, 3); + + switch(int(in0)) + { + case int(float(_0)): + out0 = ((true!=false) && (!false)) ? 0 : 25; + break; + case ivec3(_1).x: + out0 = 3*18/9-5; + break; + case nums[_2]: + out0 = int(length(vec4(1.0))+0.001); + break; + case _3: + out0 = 3; + break; + case clamp(_4, 1, 6): + out0 = (s.i-2)/10; + break; + case max(3, 5): + out0 = 10; + break; + default: + out0 = 100; + + } + ${OUTPUT} + } + "" + end +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html new file mode 100644 index 000000000..891af46e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test new file mode 100644 index 000000000..93e71b72b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test @@ -0,0 +1,1153 @@ +case float_input + version 300 es + values + { + input float in0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + } + values + { + input float in0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ]; + output float out0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = in0; + ${OUTPUT} + } + "" +end + +case float_uniform + version 300 es + values + { + uniform float uni0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + uniform float uni0; + void main() + { + out0 = uni0; + ${OUTPUT} + } + "" +end + +case float_0 + version 300 es + values { output float out0 = 1.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = +1.123; + ${OUTPUT} + } + "" +end + +case float_1 + version 300 es + values { output float out0 = -1.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.123; + ${OUTPUT} + } + "" +end + +case float_2 + version 300 es + values { output float out0 = 123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123.; + ${OUTPUT} + } + "" +end + +case float_3 + version 300 es + values { output float out0 = 0.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = .123; + ${OUTPUT} + } + "" +end + +case float_4 + version 300 es + values { output float out0 = 123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e+2; + ${OUTPUT} + } + "" +end + +case float_5 + version 300 es + values { output float out0 = -123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23E+2; + ${OUTPUT} + } + "" +end + +case float_6 + version 300 es + values { output float out0 = -123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23e2; + ${OUTPUT} + } + "" +end + +case float_7 + version 300 es + values { output float out0 = 0.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e-1; + ${OUTPUT} + } + "" +end + +case float_8 + version 300 es + values { output float out0 = 1000.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1e3; + ${OUTPUT} + } + "" +end + +case float_f_suffix_0 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1.0f; + out0 = value; + ${OUTPUT} + } + "" +end + +case float_f_suffix_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1.0F; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_0 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123; + ${OUTPUT} + } + "" +end + +case int_1 + version 300 es + values { output int out0 = -321; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -321; + ${OUTPUT} + } + "" +end + +case int_2 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0x7B; + ${OUTPUT} + } + "" +end + +case int_3 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0X7b; + ${OUTPUT} + } + "" +end + +case int_4 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0173; + ${OUTPUT} + } + "" +end + +case bool_0 + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = true; + ${OUTPUT} + } + "" +end + +case bool_1 + version 300 es + values { output bool out0 = false; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = false; + ${OUTPUT} + } + "" +end + +case const_float_global + version 300 es + values { output float out0 = 1000.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = 1000.0; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_main + version 300 es + values { output float out0 = -1000.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant = -1000.0; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_function + version 300 es + values { output float out0 = -0.012; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + float func() + { + const float theConstant = -0.012; + return theConstant; + } + void main() + { + out0 = func(); + ${OUTPUT} + } + "" +end + +case const_float_scope + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_1 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant = 100.0; + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_2 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + void main() + { + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_3 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_4 + version 300 es + values { output float out0 = 2.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + float func() + { + const float theConstant = 2.0; + return theConstant; + } + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = func(); + } + ${OUTPUT} + } + "" +end + +case const_float_operations_with_const + version 300 es + values { output float out0 = 21.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theGlobalConstant = 10.0; + float func() + { + const float theConstant = 2.0; + return theConstant; + } + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = func() * theGlobalConstant + theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_assignment_1 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_2 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + } + ${OUTPUT} + } + "" +end + +case const_float_assignment_3 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant1 = 10.0; + void main() + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_4 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant1 = 10.0; + float func() + { + const float theConstant2 = theConstant1; + return theConstant2; + } + void main() + { + out0 = func(); + ${OUTPUT} + } + "" +end + +case const_float_assign_uniform + version 300 es + expect compile_fail + values { output float out0 = 10.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float theUniform; + void main() + { + const float theConstant = theUniform; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_varying + version 300 es + expect compile_fail + values { output float out0 = 10.0; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out float theVarying; + void main() + { + theVarying = 1.0; + gl_Position = vec(1.0); + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float theVarying; + void main() + { + const float theConstant = theVarying; + out0 = theConstant; + ${FRAGMENT_OUTPUT} + } + "" +end + +case const_float_function_gotcha + version 300 es + desc "Function constant parameters are not really constants, so using them as constant expressions should fail." + expect compile_fail + values { output float out0 = 20.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + float func(const float gotcha) + { + const float theConstant2 = gotcha; + return theConstant2*2.0; + } + void main() + { + const float theConstant = 10.0; + out0 = func(theConstant); + ${OUTPUT} + } + "" +end + +case const_float_from_int + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = float(10); + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec2 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec2(1.0, 10.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec3 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec3(1.0, 10.0, 20.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec4 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec4(1.0, 10.0, 20.0, -10.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_variable_1 + version 300 es + expect compile_fail + values { output float out0 = 20.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + float theVariable = 20.0; + const float theConstant = theVariable; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_variable_2 + version 300 es + expect compile_fail + values { output float out0 = 50.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + float theVariable = 20.0; + theVariable += 30.0; + const float theConstant = theVariable; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_user_func + version 300 es + expect compile_fail + values { output float out0 = 50.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + float func() + { + return 50.0; + } + void main() + { + const float theConstant = func(); + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case int_decimal + version 300 es + values { output int out0 = 7; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 7; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_octal + version 300 es + values { output int out0 = 15; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 017; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_hexadecimal_0 + version 300 es + values { output int out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 0x2f; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_hexadecimal_1 + version 300 es + values { output int out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 0X2f; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_decimal_0 + version 300 es + values { output uint out0 = 7; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 7u; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_decimal_1 + version 300 es + values { output uint out0 = 7; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 7U; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_octal_0 + version 300 es + values { output uint out0 = 15; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 017u; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_octal_1 + version 300 es + values { output uint out0 = 15; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 017U; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_hexadecimal_0 + version 300 es + values { output uint out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 0x2fU; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_hexadecimal_1 + version 300 es + values { output uint out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 0X2fu; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_from_uint + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 7u; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case uint_from_int + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 7; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case int_from_float + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 7.0; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case uint_from_float + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 7.0; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case bool_from_int + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + bool value = 1; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case bool_from_uint + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + bool value = 1u; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case bool_from_float + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + bool value = 1.0; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case float_int_f_suffix_0 + expect compile_fail + version 300 es + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1f; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case float_int_f_suffix_1 + expect compile_fail + version 300 es + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1F; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case int_l_suffix + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 1l; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case uint_ul_suffix + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 1ul; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_octal_0 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 018; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_octal_1 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 09U; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_hexadecimal_0 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 0x2g7; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_hexadecimal_1 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 0X1h7u; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.html new file mode 100644 index 000000000..9b6f38deb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test new file mode 100644 index 000000000..968c2d264 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test @@ -0,0 +1,14246 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group scalar_to_scalar "Scalar to Scalar Conversions" + + case float_to_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case float_to_int + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output int out0 = [ 0 | 1 | 2 | 3 | 0 | -8 | -20 | 36 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case float_to_bool + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bool out0 = [ false | true | true | true | true | true | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case int_to_float + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 | 5.0 | 8.0 | 11.0 | -12.0 | -66.0 | -192.0 | 255.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case int_to_int + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output int out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case int_to_bool + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bool out0 = [ false | true | true | true | true | true | true | true | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uint_to_float + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output float out0 = [ 0.0 | 2.0 | 3.0 | 8.0 | 9.0 | 12.0 | 10.0 | 45.0 | 193.0 | 255.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uint_to_int + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output int out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bool + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output bool out0 = [ false | true | true | true | true | true | true | true | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bool_to_float + version 300 es + values + { + input bool in0 = [ true | false ]; + output float out0 = [ 1.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bool_to_int + version 300 es + values + { + input bool in0 = [ true | false ]; + output int out0 = [ 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case float_to_uint + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uint out0 = [ 0 | 1 | 2 | 3 | 0 | 8 | 20 | 36 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case int_to_uint + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uint out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uint + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uint out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uint + version 300 es + values + { + input bool in0 = [ true | false ]; + output uint out0 = [ 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_scalar +group scalar_to_vector "Scalar to Vector Conversions" + + case float_to_vec2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(3.5, 3.5) | vec2(-0.5, -0.5) | vec2(-8.25, -8.25) | vec2(-20.125, -20.125) | vec2(36.8125, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(3.5, 3.5, 3.5) | vec3(-0.5, -0.5, -0.5) | vec3(-8.25, -8.25, -8.25) | vec3(-20.125, -20.125, -20.125) | vec3(36.8125, 36.8125, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.5, 3.5, 3.5, 3.5) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-8.25, -8.25, -8.25, -8.25) | vec4(-20.125, -20.125, -20.125, -20.125) | vec4(36.8125, 36.8125, 36.8125, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(3, 3) | ivec2(0, 0) | ivec2(-8, -8) | ivec2(-20, -20) | ivec2(36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(0, 0, 0) | ivec3(-8, -8, -8) | ivec3(-20, -20, -20) | ivec3(36, 36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(0, 0, 0, 0) | ivec4(-8, -8, -8, -8) | ivec4(-20, -20, -20, -20) | ivec4(36, 36, 36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(5.0, 5.0) | vec2(8.0, 8.0) | vec2(11.0, 11.0) | vec2(-12.0, -12.0) | vec2(-66.0, -66.0) | vec2(-192.0, -192.0) | vec2(255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(5.0, 5.0, 5.0) | vec3(8.0, 8.0, 8.0) | vec3(11.0, 11.0, 11.0) | vec3(-12.0, -12.0, -12.0) | vec3(-66.0, -66.0, -66.0) | vec3(-192.0, -192.0, -192.0) | vec3(255.0, 255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(5.0, 5.0, 5.0, 5.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(11.0, 11.0, 11.0, 11.0) | vec4(-12.0, -12.0, -12.0, -12.0) | vec4(-66.0, -66.0, -66.0, -66.0) | vec4(-192.0, -192.0, -192.0, -192.0) | vec4(255.0, 255.0, 255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(5, 5) | ivec2(8, 8) | ivec2(11, 11) | ivec2(-12, -12) | ivec2(-66, -66) | ivec2(-192, -192) | ivec2(255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(5, 5, 5) | ivec3(8, 8, 8) | ivec3(11, 11, 11) | ivec3(-12, -12, -12) | ivec3(-66, -66, -66) | ivec3(-192, -192, -192) | ivec3(255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(5, 5, 5, 5) | ivec4(8, 8, 8, 8) | ivec4(11, 11, 11, 11) | ivec4(-12, -12, -12, -12) | ivec4(-66, -66, -66, -66) | ivec4(-192, -192, -192, -192) | ivec4(255, 255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_vec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(2.0, 2.0) | vec2(3.0, 3.0) | vec2(8.0, 8.0) | vec2(9.0, 9.0) | vec2(12.0, 12.0) | vec2(10.0, 10.0) | vec2(45.0, 45.0) | vec2(193.0, 193.0) | vec2(255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_vec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(2.0, 2.0, 2.0) | vec3(3.0, 3.0, 3.0) | vec3(8.0, 8.0, 8.0) | vec3(9.0, 9.0, 9.0) | vec3(12.0, 12.0, 12.0) | vec3(10.0, 10.0, 10.0) | vec3(45.0, 45.0, 45.0) | vec3(193.0, 193.0, 193.0) | vec3(255.0, 255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_vec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.0, 3.0, 3.0, 3.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(12.0, 12.0, 12.0, 12.0) | vec4(10.0, 10.0, 10.0, 10.0) | vec4(45.0, 45.0, 45.0, 45.0) | vec4(193.0, 193.0, 193.0, 193.0) | vec4(255.0, 255.0, 255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_ivec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(2, 2) | ivec2(3, 3) | ivec2(8, 8) | ivec2(9, 9) | ivec2(12, 12) | ivec2(10, 10) | ivec2(45, 45) | ivec2(193, 193) | ivec2(255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_ivec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(8, 8, 8) | ivec3(9, 9, 9) | ivec3(12, 12, 12) | ivec3(10, 10, 10) | ivec3(45, 45, 45) | ivec3(193, 193, 193) | ivec3(255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_ivec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(8, 8, 8, 8) | ivec4(9, 9, 9, 9) | ivec4(12, 12, 12, 12) | ivec4(10, 10, 10, 10) | ivec4(45, 45, 45, 45) | ivec4(193, 193, 193, 193) | ivec4(255, 255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bvec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bvec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bvec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_uvec2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(3, 3) | uvec2(0, 0) | uvec2(8, 8) | uvec2(20, 20) | uvec2(36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_uvec3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(0, 0, 0) | uvec3(8, 8, 8) | uvec3(20, 20, 20) | uvec3(36, 36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_uvec4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(0, 0, 0, 0) | uvec4(8, 8, 8, 8) | uvec4(20, 20, 20, 20) | uvec4(36, 36, 36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_uvec2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(5, 5) | uvec2(8, 8) | uvec2(11, 11) | uvec2(12, 12) | uvec2(66, 66) | uvec2(192, 192) | uvec2(255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_uvec3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(5, 5, 5) | uvec3(8, 8, 8) | uvec3(11, 11, 11) | uvec3(12, 12, 12) | uvec3(66, 66, 66) | uvec3(192, 192, 192) | uvec3(255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_uvec4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(5, 5, 5, 5) | uvec4(8, 8, 8, 8) | uvec4(11, 11, 11, 11) | uvec4(12, 12, 12, 12) | uvec4(66, 66, 66, 66) | uvec4(192, 192, 192, 192) | uvec4(255, 255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uvec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(2, 2) | uvec2(3, 3) | uvec2(8, 8) | uvec2(9, 9) | uvec2(12, 12) | uvec2(10, 10) | uvec2(45, 45) | uvec2(193, 193) | uvec2(255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uvec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(8, 8, 8) | uvec3(9, 9, 9) | uvec3(12, 12, 12) | uvec3(10, 10, 10) | uvec3(45, 45, 45) | uvec3(193, 193, 193) | uvec3(255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uvec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(8, 8, 8, 8) | uvec4(9, 9, 9, 9) | uvec4(12, 12, 12, 12) | uvec4(10, 10, 10, 10) | uvec4(45, 45, 45, 45) | uvec4(193, 193, 193, 193) | uvec4(255, 255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uvec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output uvec3 out0 = [ uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uvec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output uvec4 out0 = [ uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_vector +group vector_to_scalar "Vector to Scalar Conversions" + + case vec2_to_float + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_int + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bool + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_float + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_int + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bool + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_float + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_int + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bool + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_float + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_int + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bool + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_float + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_int + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bool + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_float + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_int + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bool + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_float + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_int + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bool + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_float + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_int + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bool + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_float + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_int + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bool + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_float + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_int + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bool + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_float + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_int + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_float + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_int + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bool + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_uint + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.5, 2.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_uint + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uint + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uint + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_uint + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uint + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uint + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uint + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uint + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uint + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output uint out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_uint + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output uint out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uint + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output uint out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_scalar +group vector_illegal "Illegal Vector Conversions" + + case vec2_to_vec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_vec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_ivec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + +end # vector_illegal +group vector_to_vector "Vector to Vector Conversions" + + case vec4_to_vec4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec3 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec2 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec3 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec2 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec4 out0 = [ bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec3 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec2 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, -2.0, -4.0, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec3 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec2 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec3 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec2 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec3 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec2 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_vec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 2.0, 4.0, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_vec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 2.0, 4.0) | vec3(32.0, 64.0, 51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_vec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_ivec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_ivec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_ivec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bvec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bvec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bvec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 1.0) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(0.0, 1.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec3 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec2 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec4 out0 = [ ivec4(1, 0, 0, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 1, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec3 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec2 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec3 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec2 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uvec4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uvec3 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uvec2 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uvec4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uvec3 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uvec2 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uvec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uvec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uvec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uvec4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output uvec4 out0 = [ uvec4(1, 0, 0, 1) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uvec3 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uvec2 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec2 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec2 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec2 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec2 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec2 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec2 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_vec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 2.0, 4.0) | vec3(32.0, 64.0, 51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_vec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_ivec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_ivec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bvec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bvec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_uvec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_uvec2 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_uvec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_uvec2 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uvec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uvec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_uvec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_uvec2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_vec2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec2 + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec2 + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec2 + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_vec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_ivec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bvec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_uvec2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.5, 2.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uvec2 + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uvec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uvec2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_vector +group scalar_to_matrix "Scalar to Matrix Conversions" + + case float_to_mat4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25) | mat4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125) | mat4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat4x3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0) | mat4x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0) | mat4x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0) | mat4x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat4x2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0) | mat4x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0) | mat4x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3x4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat3x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat3x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0) | mat3x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5) | mat3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5) | mat3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25) | mat3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125) | mat3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3x2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0) | mat3x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0) | mat3x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0) | mat3x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2x4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0) | mat2x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2x3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0) | mat2x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0) | mat2x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0) | mat2x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0) | mat2x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.5, 0.0, 0.0, 3.5) | mat2(-0.5, 0.0, 0.0, -0.5) | mat2(-8.25, 0.0, 0.0, -8.25) | mat2(-20.125, 0.0, 0.0, -20.125) | mat2(36.8125, 0.0, 0.0, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0) | mat4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0) | mat4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0) | mat4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4x3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0) | mat4x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0) | mat4x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0) | mat4x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4x2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3x4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat3x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat3x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat3x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0) | mat3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0) | mat3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0) | mat3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3x2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat3x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat3x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat3x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2x4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat2x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat2x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat2x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2x3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat2x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat2x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat2x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(5.0, 0.0, 0.0, 5.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(11.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, -12.0) | mat2(-66.0, 0.0, 0.0, -66.0) | mat2(-192.0, 0.0, 0.0, -192.0) | mat2(255.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0) | mat4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0) | mat4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0) | mat4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0) | mat4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat4x3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0) | mat4x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0) | mat4x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0) | mat4x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0) | mat4x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat4x2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat3x4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat3x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat3x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat3x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat3x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0) | mat3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0) | mat3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0) | mat3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0) | mat3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat3x2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat3x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat3x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat3x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat3x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat2x4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat2x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat2x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat2x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat2x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat2x3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat2x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat2x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat2x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat2x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.0, 0.0, 0.0, 3.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(9.0, 0.0, 0.0, 9.0) | mat2(12.0, 0.0, 0.0, 12.0) | mat2(10.0, 0.0, 0.0, 10.0) | mat2(45.0, 0.0, 0.0, 45.0) | mat2(193.0, 0.0, 0.0, 193.0) | mat2(255.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4x3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4x2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3x4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3x2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2x4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2x3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_matrix +group matrix_to_matrix "Matrix to Matrix Conversions" + + case mat4_to_mat4 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat4x3 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat4x2 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3x4 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3x2 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2x4 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2x3 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2 + version 300 es + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat4 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 9.975, -6.542, 0.015625, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat4x3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat4x2 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat3x4 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat3x2 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat2x4 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat2x3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat2 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat4 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 9.975, -6.542, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat4x3 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 9.975, -6.542, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat4x2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat3x4 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat3 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat3x2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat2x4 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat2x3 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat4x3 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat4x2 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat3x4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat3 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat3x2 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat2x4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat2x3 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat2 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4x3 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4x2 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3x4 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3x2 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2x4 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2x3 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2 + version 300 es + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat4 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat4x3 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat4x2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat3x4 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat3 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat3x2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat2x4 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat2x3 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat4x3 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat4x2 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat3x4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat3 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat3x2 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat2x4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat2x3 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat2 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat4 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat4x3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat4x2 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat3x4 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat3x2 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat2x4 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat2x3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat2 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4x3 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4x2 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0) | mat4x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3x4 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0) | mat3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3x2 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0) | mat3x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0) | mat3x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2x4 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0) | mat2x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0) | mat2x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2x3 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0) | mat2x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0) | mat2x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2 + version 300 es + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + +end # matrix_to_matrix +group vector_combine "Vector Combine Constructors" + + case vec2_vec2_to_vec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(-0.5, -2.25, -32.0, 64.0) | vec4(-32.0, 64.0, 1.0, 1.25) | vec4(1.0, 1.25, 0.0, 0.5) | vec4(0.0, 0.5, -0.5, -2.25) | vec4(-0.75, -0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_ivec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output ivec4 out0 = [ ivec4(0, -2, -32, 64) | ivec4(-32, 64, 1, 1) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_bvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_vec4 + version 300 es + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 1.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) | vec4(1.0, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_ivec4 + version 300 es + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output ivec4 out0 = [ ivec4(0, 0, 1, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 1) | ivec4(0, 0, 1, 1) | ivec4(1, 1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_bvec4 + version 300 es + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, false, false, false) | bvec4(false, true, false, true) | bvec4(false, false, true, true) | bvec4(true, true, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_vec4 + version 300 es + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output vec4 out0 = [ vec4(1.0, 0.0, 3.5, 3.5) | vec4(0.0, 36.8125, 36.8125, 36.8125) | vec4(-0.5, -8.25, -8.25, 1.0) | vec4(-8.25, 2.0, 1.0, -8.25) | vec4(3.5, 3.5, 2.0, 2.0) | vec4(-20.125, 1.0, 0.0, 0.0) | vec4(36.8125, -20.125, -20.125, -0.5) | vec4(2.0, -0.5, -0.5, -20.125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_ivec4 + version 300 es + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output ivec4 out0 = [ ivec4(1, 0, 3, 3) | ivec4(0, 36, 36, 36) | ivec4(0, -8, -8, 1) | ivec4(-8, 2, 1, -8) | ivec4(3, 3, 2, 2) | ivec4(-20, 1, 0, 0) | ivec4(36, -20, -20, 0) | ivec4(2, 0, 0, -20) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_bvec4 + version 300 es + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_vec4 + version 300 es + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output vec4 out0 = [ vec4(-12.0, 2.0, 11.0, -192.0) | vec4(-66.0, 5.0, 255.0, -66.0) | vec4(2.0, -66.0, 5.0, 8.0) | vec4(5.0, 11.0, 8.0, -12.0) | vec4(8.0, -192.0, 2.0, 1.0) | vec4(-192.0, 8.0, -192.0, 2.0) | vec4(255.0, -12.0, -12.0, 0.0) | vec4(1.0, 1.0, -66.0, 255.0) | vec4(0.0, 255.0, 1.0, 5.0) | vec4(11.0, 0.0, 0.0, 11.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_ivec4 + version 300 es + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output ivec4 out0 = [ ivec4(-12, 2, 11, -192) | ivec4(-66, 5, 255, -66) | ivec4(2, -66, 5, 8) | ivec4(5, 11, 8, -12) | ivec4(8, -192, 2, 1) | ivec4(-192, 8, -192, 2) | ivec4(255, -12, -12, 0) | ivec4(1, 1, -66, 255) | ivec4(0, 255, 1, 5) | ivec4(11, 0, 0, 11) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_bvec4 + version 300 es + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_vec4 + version 300 es + values + { + input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ]; + input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ]; + input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ]; + input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ]; + output vec4 out0 = [ vec4(193.0, 12.0, 9.0, 3.0) | vec4(3.0, 45.0, 8.0, 9.0) | vec4(255.0, 193.0, 12.0, 12.0) | vec4(8.0, 2.0, 2.0, 2.0) | vec4(10.0, 8.0, 255.0, 255.0) | vec4(9.0, 255.0, 45.0, 193.0) | vec4(2.0, 0.0, 3.0, 0.0) | vec4(12.0, 3.0, 0.0, 10.0) | vec4(0.0, 9.0, 193.0, 45.0) | vec4(45.0, 10.0, 10.0, 8.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_ivec4 + version 300 es + values + { + input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ]; + input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ]; + input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ]; + input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ]; + output ivec4 out0 = [ ivec4(193, 12, 9, 3) | ivec4(3, 45, 8, 9) | ivec4(255, 193, 12, 12) | ivec4(8, 2, 2, 2) | ivec4(10, 8, 255, 255) | ivec4(9, 255, 45, 193) | ivec4(2, 0, 3, 0) | ivec4(12, 3, 0, 10) | ivec4(0, 9, 193, 45) | ivec4(45, 10, 10, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_bvec4 + version 300 es + values + { + input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ]; + input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ]; + input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ]; + input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, true, false) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_vec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + output vec4 out0 = [ vec4(1.0, 1.0, 0.0, 0.0) | vec4(0.0, 0.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_ivec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + output ivec4 out0 = [ ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_bvec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, false, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_vec4 + version 300 es + values + { + input bool in0 = [ true | true | false | false | false | true | false | false | true | true ]; + input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ]; + input bool in3 = [ true | true | false | false | true | true | false | true | false | false ]; + output vec4 out0 = [ vec4(1.0, 36.8125, -66.0, 1.0) | vec4(1.0, 0.0, 2.0, 1.0) | vec4(0.0, -8.25, 255.0, 0.0) | vec4(0.0, 1.0, 11.0, 0.0) | vec4(0.0, -0.5, 1.0, 1.0) | vec4(1.0, 0.0, 8.0, 1.0) | vec4(0.0, 2.0, -192.0, 0.0) | vec4(0.0, -20.125, -12.0, 1.0) | vec4(1.0, 3.5, 0.0, 0.0) | vec4(1.0, 1.0, 5.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_ivec4 + version 300 es + values + { + input bool in0 = [ true | true | false | false | false | true | false | false | true | true ]; + input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ]; + input bool in3 = [ true | true | false | false | true | true | false | true | false | false ]; + output ivec4 out0 = [ ivec4(1, 36, -66, 1) | ivec4(1, 0, 2, 1) | ivec4(0, -8, 255, 0) | ivec4(0, 1, 11, 0) | ivec4(0, 0, 1, 1) | ivec4(1, 0, 8, 1) | ivec4(0, 2, -192, 0) | ivec4(0, -20, -12, 1) | ivec4(1, 3, 0, 0) | ivec4(1, 1, 5, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_bvec4 + version 300 es + values + { + input bool in0 = [ true | true | false | false | false | true | false | false | true | true ]; + input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ]; + input bool in3 = [ true | true | false | false | true | true | false | true | false | false ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_vec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 0.0, -2.0) | vec4(-0.5, -2.25, 0.0, 0.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_ivec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_bvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output bvec4 out0 = [ bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_vec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ]; + output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(-32.0, 64.0, 0.0, 0.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(0.0, 0.5, 1.0, 1.0) | vec4(-0.5, -2.25, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_ivec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 1) | ivec4(-32, 64, 0, 0) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) | ivec4(0, -2, 1, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_bvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ]; + output bvec4 out0 = [ bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, false, false) | bvec4(false, true, true, true) | bvec4(true, true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_vec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 0.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 2.0) | vec4(1.0, 1.0, 1.0, 0.0) | vec4(0.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(1.0, 0.0, 0.0, 36.8125) | vec4(0.0, 1.0, 0.0, -20.125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_ivec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ]; + output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(0, 0, 0, 3) | ivec4(0, 1, 0, 2) | ivec4(1, 1, 1, 0) | ivec4(0, 0, 0, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 0, 0, 36) | ivec4(0, 1, 0, -20) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_bvec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_vec4 + version 300 es + values + { + input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ]; + output vec4 out0 = [ vec4(-32.0, 64.0, -51.0, -0.5) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(1.0, 1.25, 1.125, 3.5) | vec4(-0.5, -2.25, -4.875, -20.125) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, -8.25) | vec4(0.0, 0.5, 0.75, 1.0) | vec4(1.0, 1.25, 1.125, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_ivec4 + version 300 es + values + { + input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ]; + output ivec4 out0 = [ ivec4(-32, 64, -51, 0) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 3) | ivec4(0, -2, -4, -20) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 1, 1, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_bvec4 + version 300 es + values + { + input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_vec4 + version 300 es + values + { + input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ]; + input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ]; + output vec4 out0 = [ vec4(-12.0, 0.0, -2.0, 1.0) | vec4(11.0, -32.0, 64.0, 11.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(255.0, 0.0, -2.0, -66.0) | vec4(0.0, 1.0, 1.0, -192.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(-66.0, -32.0, 64.0, -12.0) | vec4(2.0, 1.0, 1.0, 255.0) | vec4(-192.0, 0.0, 0.0, 5.0) | vec4(5.0, 0.0, 0.0, 8.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_ivec4 + version 300 es + values + { + input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ]; + input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ]; + output ivec4 out0 = [ ivec4(-12, 0, -2, 1) | ivec4(11, -32, 64, 11) | ivec4(8, 0, 0, 2) | ivec4(255, 0, -2, -66) | ivec4(0, 1, 1, -192) | ivec4(1, 0, 0, 0) | ivec4(-66, -32, 64, -12) | ivec4(2, 1, 1, 255) | ivec4(-192, 0, 0, 5) | ivec4(5, 0, 0, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_bvec4 + version 300 es + values + { + input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ]; + input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_vec4 + version 300 es + values + { + input bool in0 = [ true | false | false | false | true | true | true | false ]; + input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, -32.0, 64.0) | vec4(0.0, 2.0, 0.0, 0.0) | vec4(0.0, 3.5, 0.0, 0.0) | vec4(1.0, -20.125, 0.0, -2.0) | vec4(1.0, -0.5, 0.0, -2.0) | vec4(1.0, 36.8125, 0.0, 0.0) | vec4(0.0, -8.25, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_ivec4 + version 300 es + values + { + input bool in0 = [ true | false | false | false | true | true | true | false ]; + input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, -32, 64) | ivec4(0, 2, 0, 0) | ivec4(0, 3, 0, 0) | ivec4(1, -20, 0, -2) | ivec4(1, 0, 0, -2) | ivec4(1, 36, 0, 0) | ivec4(0, -8, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_bvec4 + version 300 es + values + { + input bool in0 = [ true | false | false | false | true | true | true | false ]; + input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, true, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(false, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_vec4 + version 300 es + values + { + input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 0.0) | vec4(-20.125, 0.0, 0.0, 0.0) | vec4(-8.25, 1.0, 1.0, 1.0) | vec4(-0.5, 0.0, 2.0, 4.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 1.0, 1.0, 1.0) | vec4(3.5, 0.0, 2.0, 4.0) | vec4(36.8125, 32.0, 64.0, 51.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_ivec4 + version 300 es + values + { + input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ]; + output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(-20, 0, 0, 0) | ivec4(-8, 1, 1, 1) | ivec4(0, 0, 2, 4) | ivec4(0, 0, 0, 0) | ivec4(2, 1, 1, 1) | ivec4(3, 0, 2, 4) | ivec4(36, 32, 64, 51) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_bvec4 + version 300 es + values + { + input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ]; + output bvec4 out0 = [ bvec4(true, false, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_vec4 + version 300 es + values + { + input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + input bool in2 = [ false | false | true | true | true | true | true | false | false | false ]; + output vec4 out0 = [ vec4(1.0, 0.0, 2.0, 0.0) | vec4(-192.0, 1.0, 1.0, 0.0) | vec4(-66.0, 0.0, 0.0, 1.0) | vec4(-12.0, 0.0, 2.0, 1.0) | vec4(0.0, 32.0, 64.0, 1.0) | vec4(2.0, 0.0, 0.0, 1.0) | vec4(11.0, 32.0, 64.0, 1.0) | vec4(8.0, 0.0, 0.0, 0.0) | vec4(255.0, 1.0, 1.0, 0.0) | vec4(5.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_ivec4 + version 300 es + values + { + input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + input bool in2 = [ false | false | true | true | true | true | true | false | false | false ]; + output ivec4 out0 = [ ivec4(1, 0, 2, 0) | ivec4(-192, 1, 1, 0) | ivec4(-66, 0, 0, 1) | ivec4(-12, 0, 2, 1) | ivec4(0, 32, 64, 1) | ivec4(2, 0, 0, 1) | ivec4(11, 32, 64, 1) | ivec4(8, 0, 0, 0) | ivec4(255, 1, 1, 0) | ivec4(5, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_bvec4 + version 300 es + values + { + input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + input bool in2 = [ false | false | true | true | true | true | true | false | false | false ]; + output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(true, true, true, false) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, false) | bvec4(true, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_uvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) | vec2(0.5, 2.25) | vec2(1.0, 1.25) ]; + input vec2 in1 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.0, 0.5) | vec2(0.75, 0.0322580645161) ]; + output uvec4 out0 = [ uvec4(32, 64, 0, 2) | uvec4(0, 0, 1, 1) | uvec4(0, 0, 32, 64) | uvec4(0, 2, 0, 0) | uvec4(1, 1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_uvec4 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) ]; + output uvec4 out0 = [ uvec4(1, 0, 1, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_uvec4 + version 300 es + values + { + input float in0 = [ 2.0 | 36.8125 | 0.0 | 20.125 | 1.0 | 0.5 | 8.25 | 3.5 ]; + input float in1 = [ 1.0 | 8.25 | 2.0 | 20.125 | 36.8125 | 0.0 | 0.5 | 3.5 ]; + input float in2 = [ 0.0 | 8.25 | 2.0 | 1.0 | 36.8125 | 20.125 | 0.5 | 3.5 ]; + input float in3 = [ 1.0 | 8.25 | 0.0 | 2.0 | 20.125 | 3.5 | 0.5 | 36.8125 ]; + output uvec4 out0 = [ uvec4(2, 1, 0, 1) | uvec4(36, 8, 8, 8) | uvec4(0, 2, 2, 0) | uvec4(20, 20, 1, 2) | uvec4(1, 36, 36, 20) | uvec4(0, 0, 20, 3) | uvec4(8, 0, 0, 0) | uvec4(3, 3, 3, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_uvec4 + version 300 es + values + { + input int in0 = [ 192 | 2 | 12 | 11 | 0 | 8 | 5 | 66 | 1 | 255 ]; + input int in1 = [ 66 | 12 | 5 | 1 | 0 | 192 | 8 | 255 | 11 | 2 ]; + input int in2 = [ 192 | 5 | 1 | 66 | 255 | 11 | 8 | 12 | 2 | 0 ]; + input int in3 = [ 255 | 5 | 11 | 12 | 2 | 1 | 66 | 0 | 8 | 192 ]; + output uvec4 out0 = [ uvec4(192, 66, 192, 255) | uvec4(2, 12, 5, 5) | uvec4(12, 5, 1, 11) | uvec4(11, 1, 66, 12) | uvec4(0, 0, 255, 2) | uvec4(8, 192, 11, 1) | uvec4(5, 8, 8, 66) | uvec4(66, 255, 12, 0) | uvec4(1, 11, 2, 8) | uvec4(255, 2, 0, 192) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_uvec4 + version 300 es + values + { + input uint in0 = [ 255 | 8 | 3 | 193 | 45 | 2 | 0 | 12 | 9 | 10 ]; + input uint in1 = [ 255 | 45 | 0 | 12 | 2 | 10 | 8 | 9 | 193 | 3 ]; + input uint in2 = [ 3 | 0 | 2 | 9 | 12 | 10 | 255 | 45 | 193 | 8 ]; + input uint in3 = [ 2 | 255 | 10 | 193 | 8 | 12 | 3 | 9 | 0 | 45 ]; + output uvec4 out0 = [ uvec4(255, 255, 3, 2) | uvec4(8, 45, 0, 255) | uvec4(3, 0, 2, 10) | uvec4(193, 12, 9, 193) | uvec4(45, 2, 12, 8) | uvec4(2, 10, 10, 12) | uvec4(0, 8, 255, 3) | uvec4(12, 9, 45, 9) | uvec4(9, 193, 193, 0) | uvec4(10, 3, 8, 45) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_uvec4 + version 300 es + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ true | false ]; + output uvec4 out0 = [ uvec4(0, 0, 1, 1) | uvec4(1, 1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_uvec4 + version 300 es + values + { + input bool in0 = [ true | false | false | true | false | true | true | true | false | false ]; + input float in1 = [ 20.125 | 0.0 | 1.0 | 3.5 | 1.0 | 0.0 | 0.5 | 8.25 | 2.0 | 36.8125 ]; + input int in2 = [ 66 | 192 | 1 | 2 | 5 | 11 | 8 | 12 | 255 | 0 ]; + input bool in3 = [ true | true | true | true | false | true | false | false | false | false ]; + output uvec4 out0 = [ uvec4(1, 20, 66, 1) | uvec4(0, 0, 192, 1) | uvec4(0, 1, 1, 1) | uvec4(1, 3, 2, 1) | uvec4(0, 1, 5, 0) | uvec4(1, 0, 11, 1) | uvec4(1, 0, 8, 0) | uvec4(1, 8, 12, 0) | uvec4(0, 2, 255, 0) | uvec4(0, 36, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_uvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) ]; + input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) | ivec2(0, 0) ]; + output uvec4 out0 = [ uvec4(0, 2, 1, 1) | uvec4(1, 1, 0, 2) | uvec4(32, 64, 32, 64) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_uvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.5, 2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, true) ]; + output uvec4 out0 = [ uvec4(32, 64, 0, 0) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(1, 1, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_uvec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) ]; + input float in1 = [ 2.0 | 0.0 | 36.8125 | 0.5 | 1.0 | 8.25 | 3.5 | 20.125 ]; + output uvec4 out0 = [ uvec4(1, 0, 0, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 1, 0, 36) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 8) | uvec4(1, 0, 0, 3) | uvec4(0, 0, 0, 20) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_uvec4 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 2.25, 4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(1.0, 1.25, 1.125) | vec3(0.75, 0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) ]; + input float in1 = [ 8.25 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.5 | 20.125 | 3.5 ]; + output uvec4 out0 = [ uvec4(0, 2, 4, 8) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 4, 36) | uvec4(32, 64, 51, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 20) | uvec4(0, 0, 0, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_uvec4 + version 300 es + values + { + input int in0 = [ 8 | 1 | 11 | 192 | 255 | 12 | 66 | 2 | 0 | 5 ]; + input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(32, 64) | ivec2(0, 2) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(32, 64) | ivec2(0, 0) ]; + input int in2 = [ 2 | 192 | 12 | 0 | 8 | 1 | 66 | 255 | 11 | 5 ]; + output uvec4 out0 = [ uvec4(8, 1, 1, 2) | uvec4(1, 0, 0, 192) | uvec4(11, 1, 1, 12) | uvec4(192, 32, 64, 0) | uvec4(255, 0, 2, 8) | uvec4(12, 0, 2, 1) | uvec4(66, 0, 0, 66) | uvec4(2, 0, 0, 255) | uvec4(0, 32, 64, 11) | uvec4(5, 0, 0, 5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_uvec4 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | false | true ]; + input float in1 = [ 8.25 | 0.5 | 2.0 | 20.125 | 0.0 | 36.8125 | 3.5 | 1.0 ]; + input ivec2 in2 = [ ivec2(32, 64) | ivec2(1, 1) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) ]; + output uvec4 out0 = [ uvec4(1, 8, 32, 64) | uvec4(1, 0, 1, 1) | uvec4(0, 2, 0, 2) | uvec4(0, 20, 0, 0) | uvec4(1, 0, 0, 0) | uvec4(0, 36, 0, 2) | uvec4(0, 3, 1, 1) | uvec4(1, 1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_uvec4 + version 300 es + values + { + input float in0 = [ 8.25 | 20.125 | 1.0 | 0.5 | 3.5 | 2.0 | 36.8125 | 0.0 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 2, 4) | uvec3(1, 1, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + output uvec4 out0 = [ uvec4(8, 0, 0, 0) | uvec4(20, 0, 0, 0) | uvec4(1, 0, 2, 4) | uvec4(0, 32, 64, 51) | uvec4(3, 0, 2, 4) | uvec4(2, 1, 1, 1) | uvec4(36, 1, 1, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_uvec4 + version 300 es + values + { + input int in0 = [ 2 | 1 | 11 | 66 | 192 | 12 | 8 | 255 | 0 | 5 ]; + input uvec2 in1 = [ uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) ]; + input bool in2 = [ true | false | false | false | false | true | true | true | false | true ]; + output uvec4 out0 = [ uvec4(2, 1, 1, 1) | uvec4(1, 0, 0, 0) | uvec4(11, 0, 0, 0) | uvec4(66, 0, 2, 0) | uvec4(192, 0, 0, 0) | uvec4(12, 0, 2, 1) | uvec4(8, 32, 64, 1) | uvec4(255, 1, 1, 1) | uvec4(0, 32, 64, 0) | uvec4(5, 0, 0, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_vec3 + version 300 es + values + { + input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ]; + input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ]; + input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ]; + output vec3 out0 = [ vec3(-0.5, 2.0, 1.0) | vec3(1.0, -20.125, 3.5) | vec3(3.5, 3.5, 2.0) | vec3(-8.25, 36.8125, -8.25) | vec3(36.8125, -8.25, -20.125) | vec3(0.0, 1.0, -0.5) | vec3(2.0, -0.5, 36.8125) | vec3(-20.125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_ivec3 + version 300 es + values + { + input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ]; + input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ]; + input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ]; + output ivec3 out0 = [ ivec3(0, 2, 1) | ivec3(1, -20, 3) | ivec3(3, 3, 2) | ivec3(-8, 36, -8) | ivec3(36, -8, -20) | ivec3(0, 1, 0) | ivec3(2, 0, 36) | ivec3(-20, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_bvec3 + version 300 es + values + { + input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ]; + input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ]; + input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_vec3 + version 300 es + values + { + input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ]; + input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ]; + input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ]; + output vec3 out0 = [ vec3(-192.0, 5.0, -192.0) | vec3(5.0, 1.0, 1.0) | vec3(-12.0, 8.0, 2.0) | vec3(0.0, 0.0, 5.0) | vec3(11.0, 2.0, -12.0) | vec3(8.0, -192.0, 8.0) | vec3(1.0, -12.0, 11.0) | vec3(-66.0, 255.0, 0.0) | vec3(255.0, -66.0, 255.0) | vec3(2.0, 11.0, -66.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_ivec3 + version 300 es + values + { + input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ]; + input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ]; + input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ]; + output ivec3 out0 = [ ivec3(-192, 5, -192) | ivec3(5, 1, 1) | ivec3(-12, 8, 2) | ivec3(0, 0, 5) | ivec3(11, 2, -12) | ivec3(8, -192, 8) | ivec3(1, -12, 11) | ivec3(-66, 255, 0) | ivec3(255, -66, 255) | ivec3(2, 11, -66) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_bvec3 + version 300 es + values + { + input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ]; + input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ]; + input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_vec3 + version 300 es + values + { + input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ]; + input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ]; + input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ]; + output vec3 out0 = [ vec3(8.0, 193.0, 12.0) | vec3(45.0, 2.0, 2.0) | vec3(2.0, 9.0, 193.0) | vec3(3.0, 8.0, 255.0) | vec3(255.0, 0.0, 8.0) | vec3(193.0, 255.0, 10.0) | vec3(12.0, 45.0, 45.0) | vec3(0.0, 3.0, 0.0) | vec3(9.0, 10.0, 3.0) | vec3(10.0, 12.0, 9.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_ivec3 + version 300 es + values + { + input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ]; + input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ]; + input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ]; + output ivec3 out0 = [ ivec3(8, 193, 12) | ivec3(45, 2, 2) | ivec3(2, 9, 193) | ivec3(3, 8, 255) | ivec3(255, 0, 8) | ivec3(193, 255, 10) | ivec3(12, 45, 45) | ivec3(0, 3, 0) | ivec3(9, 10, 3) | ivec3(10, 12, 9) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_bvec3 + version 300 es + values + { + input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ]; + input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ]; + input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_vec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_vec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | true | false | false | true ]; + input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ]; + input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ]; + output vec3 out0 = [ vec3(1.0, 0.0, 8.0) | vec3(1.0, 36.8125, -192.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, -8.25, 2.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 3.5, -12.0) | vec3(1.0, 1.0, 11.0) | vec3(0.0, -0.5, 255.0) | vec3(0.0, -20.125, 5.0) | vec3(1.0, 2.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | true | false | false | true ]; + input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ]; + input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ]; + output ivec3 out0 = [ ivec3(1, 0, 8) | ivec3(1, 36, -192) | ivec3(0, 0, -66) | ivec3(0, -8, 2) | ivec3(1, 1, 1) | ivec3(0, 3, -12) | ivec3(1, 1, 11) | ivec3(0, 0, 255) | ivec3(0, -20, 5) | ivec3(1, 2, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | true | false | false | true ]; + input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ]; + input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_vec3 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ]; + input bool in1 = [ false | true | true | true | false ]; + output vec3 out0 = [ vec3(1.0, 1.25, 0.0) | vec3(-0.75, -0.0322580645161, 1.0) | vec3(-32.0, 64.0, 1.0) | vec3(-0.5, -2.25, 1.0) | vec3(0.0, 0.5, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_ivec3 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ]; + input bool in1 = [ false | true | true | true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) | ivec3(0, -2, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_bvec3 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ]; + input bool in1 = [ false | true | true | true | false ]; + output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_vec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ]; + output vec3 out0 = [ vec3(1.0, 0.0, -20.125) | vec3(0.0, 1.0, 2.0) | vec3(0.0, 1.0, 36.8125) | vec3(1.0, 0.0, 1.0) | vec3(0.0, 0.0, 3.5) | vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, -8.25) | vec3(0.0, 0.0, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_ivec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ]; + output ivec3 out0 = [ ivec3(1, 0, -20) | ivec3(0, 1, 2) | ivec3(0, 1, 36) | ivec3(1, 0, 1) | ivec3(0, 0, 3) | ivec3(0, 0, 0) | ivec3(1, 1, -8) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_bvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_vec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, 0.0, 255.0) | vec3(1.0, 0.0, 8.0) | vec3(0.0, 0.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, 0.0, 5.0) | vec3(0.0, 1.0, 11.0) | vec3(0.0, 0.0, -12.0) | vec3(1.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_ivec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, -66) | ivec3(0, 0, 255) | ivec3(1, 0, 8) | ivec3(0, 0, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, 1, 11) | ivec3(0, 0, -12) | ivec3(1, 1, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_bvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_vec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + output vec3 out0 = [ vec3(1.0, 0.0, -2.0) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 1.0) | vec3(1.0, -32.0, 64.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + output ivec3 out0 = [ ivec3(1, 0, -2) | ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 1) | ivec3(1, -32, 64) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_vec3 + version 300 es + values + { + input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ]; + output vec3 out0 = [ vec3(-20.125, 0.0, 0.0) | vec3(36.8125, 0.0, 2.0) | vec3(-8.25, 32.0, 64.0) | vec3(2.0, 0.0, 0.0) | vec3(-0.5, 0.0, 2.0) | vec3(0.0, 0.0, 0.0) | vec3(3.5, 1.0, 1.0) | vec3(1.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_ivec3 + version 300 es + values + { + input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ]; + output ivec3 out0 = [ ivec3(-20, 0, 0) | ivec3(36, 0, 2) | ivec3(-8, 32, 64) | ivec3(2, 0, 0) | ivec3(0, 0, 2) | ivec3(0, 0, 0) | ivec3(3, 1, 1) | ivec3(1, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_bvec3 + version 300 es + values + { + input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_to_uvec3 + version 300 es + values + { + input float in0 = [ 8.25 | 20.125 | 2.0 | 3.5 | 0.5 | 36.8125 | 1.0 | 0.0 ]; + input float in1 = [ 1.0 | 0.0 | 3.5 | 36.8125 | 8.25 | 2.0 | 0.5 | 20.125 ]; + input float in2 = [ 20.125 | 0.5 | 8.25 | 36.8125 | 1.0 | 0.0 | 3.5 | 2.0 ]; + output uvec3 out0 = [ uvec3(8, 1, 20) | uvec3(20, 0, 0) | uvec3(2, 3, 8) | uvec3(3, 36, 36) | uvec3(0, 8, 1) | uvec3(36, 2, 0) | uvec3(1, 0, 3) | uvec3(0, 20, 2) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_uvec3 + version 300 es + values + { + input int in0 = [ 1 | 255 | 192 | 2 | 5 | 12 | 0 | 11 | 8 | 66 ]; + input int in1 = [ 192 | 66 | 5 | 8 | 11 | 1 | 0 | 255 | 12 | 2 ]; + input int in2 = [ 192 | 5 | 1 | 11 | 66 | 8 | 12 | 0 | 2 | 255 ]; + output uvec3 out0 = [ uvec3(1, 192, 192) | uvec3(255, 66, 5) | uvec3(192, 5, 1) | uvec3(2, 8, 11) | uvec3(5, 11, 66) | uvec3(12, 1, 8) | uvec3(0, 0, 12) | uvec3(11, 255, 0) | uvec3(8, 12, 2) | uvec3(66, 2, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_uvec3 + version 300 es + values + { + input uint in0 = [ 193 | 9 | 45 | 255 | 2 | 0 | 10 | 8 | 12 | 3 ]; + input uint in1 = [ 3 | 45 | 2 | 9 | 10 | 0 | 8 | 12 | 255 | 193 ]; + input uint in2 = [ 2 | 3 | 9 | 10 | 255 | 8 | 12 | 0 | 193 | 45 ]; + output uvec3 out0 = [ uvec3(193, 3, 2) | uvec3(9, 45, 3) | uvec3(45, 2, 9) | uvec3(255, 9, 10) | uvec3(2, 10, 255) | uvec3(0, 0, 8) | uvec3(10, 8, 12) | uvec3(8, 12, 0) | uvec3(12, 255, 193) | uvec3(3, 193, 45) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_uvec3 + version 300 es + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + output uvec3 out0 = [ uvec3(0, 0, 1) | uvec3(1, 1, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_uvec3 + version 300 es + values + { + input bool in0 = [ true | false | true | false | false | true | false | true | true | false ]; + input float in1 = [ 36.8125 | 20.125 | 1.0 | 0.0 | 3.5 | 1.0 | 2.0 | 0.5 | 0.0 | 8.25 ]; + input int in2 = [ 1 | 0 | 8 | 66 | 2 | 11 | 192 | 5 | 12 | 255 ]; + output uvec3 out0 = [ uvec3(1, 36, 1) | uvec3(0, 20, 0) | uvec3(1, 1, 8) | uvec3(0, 0, 66) | uvec3(0, 3, 2) | uvec3(1, 1, 11) | uvec3(0, 2, 192) | uvec3(1, 0, 5) | uvec3(1, 0, 12) | uvec3(0, 8, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_uvec3 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(32.0, 64.0) | vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(0.75, 0.0322580645161) ]; + input bool in1 = [ false | false | true | true | true ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(32, 64, 0) | uvec3(0, 2, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_uvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) ]; + input float in1 = [ 8.25 | 36.8125 | 20.125 | 2.0 | 0.0 | 1.0 | 0.5 | 3.5 ]; + output uvec3 out0 = [ uvec3(1, 1, 8) | uvec3(1, 0, 36) | uvec3(0, 1, 20) | uvec3(0, 0, 2) | uvec3(1, 0, 0) | uvec3(0, 1, 1) | uvec3(0, 0, 0) | uvec3(0, 0, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_uvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) ]; + input int in1 = [ 255 | 1 | 2 | 5 | 0 | 11 | 192 | 12 | 8 | 66 ]; + output uvec3 out0 = [ uvec3(1, 1, 255) | uvec3(0, 1, 1) | uvec3(0, 0, 2) | uvec3(1, 1, 5) | uvec3(0, 0, 0) | uvec3(1, 0, 11) | uvec3(0, 0, 192) | uvec3(0, 0, 12) | uvec3(0, 1, 8) | uvec3(1, 0, 66) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_uvec3 + version 300 es + values + { + input bool in0 = [ true | false | true | true | false ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(32, 64) ]; + output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 2) | uvec3(1, 1, 1) | uvec3(1, 0, 0) | uvec3(0, 32, 64) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_uvec3 + version 300 es + values + { + input float in0 = [ 2.0 | 8.25 | 20.125 | 3.5 | 0.0 | 0.5 | 36.8125 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + output uvec3 out0 = [ uvec3(2, 0, 2) | uvec3(8, 1, 1) | uvec3(20, 32, 64) | uvec3(3, 0, 0) | uvec3(0, 0, 2) | uvec3(0, 0, 0) | uvec3(36, 1, 1) | uvec3(1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_vec2 + version 300 es + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ]; + output vec2 out0 = [ vec2(-0.5, 1.0) | vec2(-20.125, -20.125) | vec2(1.0, 0.0) | vec2(2.0, 3.5) | vec2(3.5, -8.25) | vec2(36.8125, 36.8125) | vec2(-8.25, -0.5) | vec2(0.0, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_ivec2 + version 300 es + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ]; + output ivec2 out0 = [ ivec2(0, 1) | ivec2(-20, -20) | ivec2(1, 0) | ivec2(2, 3) | ivec2(3, -8) | ivec2(36, 36) | ivec2(-8, 0) | ivec2(0, 2) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_bvec2 + version 300 es + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_vec2 + version 300 es + values + { + input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ]; + input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ]; + output vec2 out0 = [ vec2(2.0, -192.0) | vec2(-66.0, 8.0) | vec2(0.0, 1.0) | vec2(5.0, 0.0) | vec2(-12.0, 5.0) | vec2(8.0, -66.0) | vec2(-192.0, 2.0) | vec2(1.0, 255.0) | vec2(11.0, 11.0) | vec2(255.0, -12.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_ivec2 + version 300 es + values + { + input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ]; + input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ]; + output ivec2 out0 = [ ivec2(2, -192) | ivec2(-66, 8) | ivec2(0, 1) | ivec2(5, 0) | ivec2(-12, 5) | ivec2(8, -66) | ivec2(-192, 2) | ivec2(1, 255) | ivec2(11, 11) | ivec2(255, -12) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_bvec2 + version 300 es + values + { + input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ]; + input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_vec2 + version 300 es + values + { + input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ]; + input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ]; + output vec2 out0 = [ vec2(9.0, 8.0) | vec2(12.0, 9.0) | vec2(0.0, 45.0) | vec2(255.0, 2.0) | vec2(8.0, 12.0) | vec2(45.0, 193.0) | vec2(3.0, 255.0) | vec2(2.0, 0.0) | vec2(10.0, 3.0) | vec2(193.0, 10.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_ivec2 + version 300 es + values + { + input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ]; + input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ]; + output ivec2 out0 = [ ivec2(9, 8) | ivec2(12, 9) | ivec2(0, 45) | ivec2(255, 2) | ivec2(8, 12) | ivec2(45, 193) | ivec2(3, 255) | ivec2(2, 0) | ivec2(10, 3) | ivec2(193, 10) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_bvec2 + version 300 es + values + { + input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ]; + input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_vec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_ivec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_bvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_vec2 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ]; + input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ]; + output vec2 out0 = [ vec2(0.0, -66.0) | vec2(3.5, 1.0) | vec2(0.0, 255.0) | vec2(2.0, -192.0) | vec2(-8.25, 8.0) | vec2(36.8125, 2.0) | vec2(-20.125, 0.0) | vec2(1.0, 5.0) | vec2(1.0, -12.0) | vec2(-0.5, 11.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_ivec2 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ]; + input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ]; + output ivec2 out0 = [ ivec2(0, -66) | ivec2(3, 1) | ivec2(0, 255) | ivec2(2, -192) | ivec2(-8, 8) | ivec2(36, 2) | ivec2(-20, 0) | ivec2(1, 5) | ivec2(1, -12) | ivec2(0, 11) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_bvec2 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ]; + input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_vec2 + version 300 es + values + { + input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ]; + input bool in1 = [ false | true | true | false | false | true | false | true ]; + output vec2 out0 = [ vec2(2.0, 0.0) | vec2(3.5, 1.0) | vec2(1.0, 1.0) | vec2(-20.125, 0.0) | vec2(-8.25, 0.0) | vec2(0.0, 1.0) | vec2(-0.5, 0.0) | vec2(36.8125, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_ivec2 + version 300 es + values + { + input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ]; + input bool in1 = [ false | true | true | false | false | true | false | true ]; + output ivec2 out0 = [ ivec2(2, 0) | ivec2(3, 1) | ivec2(1, 1) | ivec2(-20, 0) | ivec2(-8, 0) | ivec2(0, 1) | ivec2(0, 0) | ivec2(36, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_bvec2 + version 300 es + values + { + input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ]; + input bool in1 = [ false | true | true | false | false | true | false | true ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_vec2 + version 300 es + values + { + input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ]; + input bool in1 = [ true | false | false | false | true | false | true | false | true | true ]; + output vec2 out0 = [ vec2(255.0, 1.0) | vec2(2.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 0.0) | vec2(-192.0, 1.0) | vec2(5.0, 0.0) | vec2(8.0, 1.0) | vec2(0.0, 0.0) | vec2(-66.0, 1.0) | vec2(11.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_ivec2 + version 300 es + values + { + input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ]; + input bool in1 = [ true | false | false | false | true | false | true | false | true | true ]; + output ivec2 out0 = [ ivec2(255, 1) | ivec2(2, 0) | ivec2(-12, 0) | ivec2(1, 0) | ivec2(-192, 1) | ivec2(5, 0) | ivec2(8, 1) | ivec2(0, 0) | ivec2(-66, 1) | ivec2(11, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_bvec2 + version 300 es + values + { + input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ]; + input bool in1 = [ true | false | false | false | true | false | true | false | true | true ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_vec2 + version 300 es + values + { + input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ]; + input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ]; + output vec2 out0 = [ vec2(-66.0, 193.0) | vec2(1.0, 0.0) | vec2(-192.0, 2.0) | vec2(-12.0, 10.0) | vec2(5.0, 255.0) | vec2(255.0, 12.0) | vec2(11.0, 45.0) | vec2(0.0, 8.0) | vec2(2.0, 9.0) | vec2(8.0, 3.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_ivec2 + version 300 es + values + { + input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ]; + input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ]; + output ivec2 out0 = [ ivec2(-66, 193) | ivec2(1, 0) | ivec2(-192, 2) | ivec2(-12, 10) | ivec2(5, 255) | ivec2(255, 12) | ivec2(11, 45) | ivec2(0, 8) | ivec2(2, 9) | ivec2(8, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_bvec2 + version 300 es + values + { + input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ]; + input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_vec2 + version 300 es + values + { + input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ]; + output vec2 out0 = [ vec2(12.0, -20.125) | vec2(0.0, 0.0) | vec2(8.0, 3.5) | vec2(193.0, -8.25) | vec2(3.0, 0.0) | vec2(10.0, 1.0) | vec2(9.0, 2.0) | vec2(2.0, 36.8125) | vec2(45.0, -0.5) | vec2(255.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_ivec2 + version 300 es + values + { + input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ]; + output ivec2 out0 = [ ivec2(12, -20) | ivec2(0, 0) | ivec2(8, 3) | ivec2(193, -8) | ivec2(3, 0) | ivec2(10, 1) | ivec2(9, 2) | ivec2(2, 36) | ivec2(45, 0) | ivec2(255, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_bvec2 + version 300 es + values + { + input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_uvec2 + version 300 es + values + { + input float in0 = [ 8.25 | 36.8125 | 1.0 | 0.5 | 20.125 | 0.0 | 2.0 | 3.5 ]; + input float in1 = [ 0.5 | 36.8125 | 0.0 | 2.0 | 8.25 | 20.125 | 1.0 | 3.5 ]; + output uvec2 out0 = [ uvec2(8, 0) | uvec2(36, 36) | uvec2(1, 0) | uvec2(0, 2) | uvec2(20, 8) | uvec2(0, 20) | uvec2(2, 1) | uvec2(3, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_uvec2 + version 300 es + values + { + input int in0 = [ 0 | 12 | 8 | 11 | 255 | 66 | 192 | 2 | 5 | 1 ]; + input int in1 = [ 11 | 12 | 2 | 5 | 66 | 192 | 255 | 0 | 1 | 8 ]; + output uvec2 out0 = [ uvec2(0, 11) | uvec2(12, 12) | uvec2(8, 2) | uvec2(11, 5) | uvec2(255, 66) | uvec2(66, 192) | uvec2(192, 255) | uvec2(2, 0) | uvec2(5, 1) | uvec2(1, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_uvec2 + version 300 es + values + { + input uint in0 = [ 3 | 9 | 10 | 193 | 8 | 0 | 255 | 45 | 2 | 12 ]; + input uint in1 = [ 0 | 2 | 12 | 3 | 10 | 9 | 45 | 193 | 255 | 8 ]; + output uvec2 out0 = [ uvec2(3, 0) | uvec2(9, 2) | uvec2(10, 12) | uvec2(193, 3) | uvec2(8, 10) | uvec2(0, 9) | uvec2(255, 45) | uvec2(45, 193) | uvec2(2, 255) | uvec2(12, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_uvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_uvec2 + version 300 es + values + { + input float in0 = [ 8.25 | 1.0 | 0.5 | 3.5 | 2.0 | 0.0 | 36.8125 | 1.0 | 0.0 | 20.125 ]; + input int in1 = [ 0 | 255 | 12 | 5 | 192 | 2 | 66 | 11 | 1 | 8 ]; + output uvec2 out0 = [ uvec2(8, 0) | uvec2(1, 255) | uvec2(0, 12) | uvec2(3, 5) | uvec2(2, 192) | uvec2(0, 2) | uvec2(36, 66) | uvec2(1, 11) | uvec2(0, 1) | uvec2(20, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_uvec2 + version 300 es + values + { + input float in0 = [ 3.5 | 1.0 | 8.25 | 0.5 | 2.0 | 36.8125 | 0.0 | 20.125 ]; + input bool in1 = [ true | false | true | false | true | false | false | true ]; + output uvec2 out0 = [ uvec2(3, 1) | uvec2(1, 0) | uvec2(8, 1) | uvec2(0, 0) | uvec2(2, 1) | uvec2(36, 0) | uvec2(0, 0) | uvec2(20, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_uvec2 + version 300 es + values + { + input int in0 = [ 12 | 11 | 0 | 5 | 8 | 255 | 2 | 1 | 66 | 192 ]; + input bool in1 = [ true | true | false | false | false | true | false | false | true | true ]; + output uvec2 out0 = [ uvec2(12, 1) | uvec2(11, 1) | uvec2(0, 0) | uvec2(5, 0) | uvec2(8, 0) | uvec2(255, 1) | uvec2(2, 0) | uvec2(1, 0) | uvec2(66, 1) | uvec2(192, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_uvec2 + version 300 es + values + { + input int in0 = [ 8 | 5 | 1 | 0 | 11 | 12 | 192 | 66 | 255 | 2 ]; + input uint in1 = [ 8 | 10 | 45 | 255 | 9 | 193 | 2 | 3 | 0 | 12 ]; + output uvec2 out0 = [ uvec2(8, 8) | uvec2(5, 10) | uvec2(1, 45) | uvec2(0, 255) | uvec2(11, 9) | uvec2(12, 193) | uvec2(192, 2) | uvec2(66, 3) | uvec2(255, 0) | uvec2(2, 12) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_uvec2 + version 300 es + values + { + input uint in0 = [ 9 | 45 | 8 | 3 | 10 | 2 | 193 | 12 | 255 | 0 ]; + input float in1 = [ 3.5 | 20.125 | 2.0 | 0.0 | 1.0 | 36.8125 | 8.25 | 1.0 | 0.0 | 0.5 ]; + output uvec2 out0 = [ uvec2(9, 3) | uvec2(45, 20) | uvec2(8, 2) | uvec2(3, 0) | uvec2(10, 1) | uvec2(2, 36) | uvec2(193, 8) | uvec2(12, 1) | uvec2(255, 0) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + +end # vector_combine +group matrix_combine "Matrix Combine Constructors" + + case vec2_vec2_to_mat2 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input vec2 in1 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) ]; + output mat2 out0 = [ mat2(1.0, 1.25, 0.0, 0.5) | mat2(-32.0, 64.0, 1.0, 1.25) | mat2(-0.5, -2.25, -0.75, -0.0322580645161) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, -0.5, -2.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_mat2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) ]; + output mat2 out0 = [ mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_mat2 + version 300 es + values + { + input float in0 = [ -8.25 | 3.5 | 36.8125 | 2.0 | -20.125 | 1.0 | -0.5 | 0.0 ]; + input float in1 = [ 3.5 | -20.125 | 1.0 | 0.0 | -8.25 | 2.0 | 36.8125 | -0.5 ]; + input float in2 = [ 36.8125 | 3.5 | 0.0 | -20.125 | -0.5 | -8.25 | 1.0 | 2.0 ]; + input float in3 = [ -0.5 | 0.0 | -8.25 | -20.125 | 2.0 | 3.5 | 1.0 | 36.8125 ]; + output mat2 out0 = [ mat2(-8.25, 3.5, 36.8125, -0.5) | mat2(3.5, -20.125, 3.5, 0.0) | mat2(36.8125, 1.0, 0.0, -8.25) | mat2(2.0, 0.0, -20.125, -20.125) | mat2(-20.125, -8.25, -0.5, 2.0) | mat2(1.0, 2.0, -8.25, 3.5) | mat2(-0.5, 36.8125, 1.0, 1.0) | mat2(0.0, -0.5, 2.0, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_mat2 + version 300 es + values + { + input int in0 = [ 2 | 1 | -192 | 11 | -66 | 255 | 0 | 8 | -12 | 5 ]; + input int in1 = [ 11 | 255 | 5 | -66 | 8 | 2 | 0 | -12 | 1 | -192 ]; + input int in2 = [ 11 | 1 | -12 | 255 | 5 | 0 | 8 | -192 | 2 | -66 ]; + input int in3 = [ 2 | 1 | 0 | 8 | 255 | -66 | -192 | 11 | 5 | -12 ]; + output mat2 out0 = [ mat2(2.0, 11.0, 11.0, 2.0) | mat2(1.0, 255.0, 1.0, 1.0) | mat2(-192.0, 5.0, -12.0, 0.0) | mat2(11.0, -66.0, 255.0, 8.0) | mat2(-66.0, 8.0, 5.0, 255.0) | mat2(255.0, 2.0, 0.0, -66.0) | mat2(0.0, 0.0, 8.0, -192.0) | mat2(8.0, -12.0, -192.0, 11.0) | mat2(-12.0, 1.0, 2.0, 5.0) | mat2(5.0, -192.0, -66.0, -12.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_mat2 + version 300 es + values + { + input uint in0 = [ 193 | 9 | 12 | 45 | 10 | 2 | 8 | 3 | 255 | 0 ]; + input uint in1 = [ 0 | 255 | 12 | 193 | 3 | 2 | 45 | 9 | 8 | 10 ]; + input uint in2 = [ 3 | 9 | 10 | 2 | 12 | 193 | 255 | 0 | 8 | 45 ]; + input uint in3 = [ 45 | 12 | 9 | 3 | 2 | 255 | 10 | 8 | 193 | 0 ]; + output mat2 out0 = [ mat2(193.0, 0.0, 3.0, 45.0) | mat2(9.0, 255.0, 9.0, 12.0) | mat2(12.0, 12.0, 10.0, 9.0) | mat2(45.0, 193.0, 2.0, 3.0) | mat2(10.0, 3.0, 12.0, 2.0) | mat2(2.0, 2.0, 193.0, 255.0) | mat2(8.0, 45.0, 255.0, 10.0) | mat2(3.0, 9.0, 0.0, 8.0) | mat2(255.0, 8.0, 8.0, 193.0) | mat2(0.0, 10.0, 45.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_mat2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_mat2 + version 300 es + values + { + input bool in0 = [ false | true | false | true | true | false | true | true | false | false ]; + input float in1 = [ 2.0 | -0.5 | 0.0 | 1.0 | 1.0 | 36.8125 | 3.5 | 0.0 | -8.25 | -20.125 ]; + input int in2 = [ 0 | -12 | 8 | -192 | 1 | -66 | 5 | 11 | 2 | 255 ]; + input bool in3 = [ true | false | true | false | true | false | false | true | true | false ]; + output mat2 out0 = [ mat2(0.0, 2.0, 0.0, 1.0) | mat2(1.0, -0.5, -12.0, 0.0) | mat2(0.0, 0.0, 8.0, 1.0) | mat2(1.0, 1.0, -192.0, 0.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(0.0, 36.8125, -66.0, 0.0) | mat2(1.0, 3.5, 5.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(0.0, -8.25, 2.0, 1.0) | mat2(0.0, -20.125, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_mat2 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output mat2 out0 = [ mat2(1.0, 1.25, 0.0, -2.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_mat2 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) ]; + output mat2 out0 = [ mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-32.0, 64.0, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 0.0, 1.0) | mat2(0.0, 0.5, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_mat2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in1 = [ 36.8125 | -8.25 | 1.0 | -0.5 | 2.0 | -20.125 | 0.0 | 3.5 ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 36.8125) | mat2(0.0, 1.0, 0.0, -8.25) | mat2(0.0, 0.0, 0.0, 1.0) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(1.0, 0.0, 0.0, 2.0) | mat2(0.0, 1.0, 0.0, -20.125) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 0.0, 3.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_mat2 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input float in1 = [ -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 | -8.25 | 2.0 | 1.0 ]; + output mat2 out0 = [ mat2(1.0, 1.25, 1.125, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(0.0, 0.5, 0.75, 3.5) | mat2(-32.0, 64.0, -51.0, -8.25) | mat2(0.0, 0.5, 0.75, 2.0) | mat2(-0.75, -0.0322580645161, 0.0526315789474, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_mat2 + version 300 es + values + { + input int in0 = [ 8 | -192 | 2 | 0 | -66 | 255 | 5 | 1 | -12 | 11 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(1, 1) ]; + input int in2 = [ 2 | 1 | -12 | 0 | 11 | 8 | 255 | -192 | 5 | -66 ]; + output mat2 out0 = [ mat2(8.0, 0.0, -2.0, 2.0) | mat2(-192.0, 0.0, 0.0, 1.0) | mat2(2.0, -32.0, 64.0, -12.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-66.0, 0.0, 0.0, 11.0) | mat2(255.0, -32.0, 64.0, 8.0) | mat2(5.0, 0.0, 0.0, 255.0) | mat2(1.0, 0.0, -2.0, -192.0) | mat2(-12.0, 1.0, 1.0, 5.0) | mat2(11.0, 1.0, 1.0, -66.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_mat2 + version 300 es + values + { + input bool in0 = [ true | true | true | false | false | true | false | false ]; + input float in1 = [ 1.0 | -0.5 | -20.125 | 36.8125 | 2.0 | 0.0 | -8.25 | 3.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) ]; + output mat2 out0 = [ mat2(1.0, 1.0, 0.0, 0.0) | mat2(1.0, -0.5, 0.0, 0.0) | mat2(1.0, -20.125, 1.0, 1.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, 2.0, 1.0, 1.0) | mat2(1.0, 0.0, 0.0, -2.0) | mat2(0.0, -8.25, -32.0, 64.0) | mat2(0.0, 3.5, 0.0, -2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_mat2 + version 300 es + values + { + input float in0 = [ 36.8125 | 2.0 | -0.5 | 0.0 | -20.125 | 1.0 | 3.5 | -8.25 ]; + input uvec3 in1 = [ uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(32, 64, 51) | uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) ]; + output mat2 out0 = [ mat2(36.8125, 1.0, 1.0, 1.0) | mat2(2.0, 0.0, 2.0, 4.0) | mat2(-0.5, 0.0, 2.0, 4.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-20.125, 32.0, 64.0, 51.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(3.5, 0.0, 0.0, 0.0) | mat2(-8.25, 1.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_mat2 + version 300 es + values + { + input int in0 = [ 1 | -66 | 5 | -192 | 11 | 0 | 8 | 2 | -12 | 255 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 0) | uvec2(32, 64) ]; + input bool in2 = [ true | false | true | false | false | false | true | true | true | false ]; + output mat2 out0 = [ mat2(1.0, 0.0, 2.0, 1.0) | mat2(-66.0, 32.0, 64.0, 0.0) | mat2(5.0, 1.0, 1.0, 1.0) | mat2(-192.0, 0.0, 0.0, 0.0) | mat2(11.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(8.0, 0.0, 2.0, 1.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(-12.0, 0.0, 0.0, 1.0) | mat2(255.0, 32.0, 64.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_to_mat2x3 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) ]; + input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875) | mat2x3(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125) | mat2x3(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_bvec3_to_mat2x3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ]; + input bvec3 in1 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_float_float_to_mat2x3 + version 300 es + values + { + input float in0 = [ 1.0 | -8.25 | -20.125 | 36.8125 | -0.5 | 2.0 | 3.5 | 0.0 ]; + input float in1 = [ -0.5 | -20.125 | 36.8125 | -8.25 | 2.0 | 1.0 | 3.5 | 0.0 ]; + input float in2 = [ 3.5 | 1.0 | 36.8125 | -20.125 | -8.25 | -0.5 | 2.0 | 0.0 ]; + input float in3 = [ 1.0 | -8.25 | 0.0 | -20.125 | 2.0 | 3.5 | -0.5 | 36.8125 ]; + input float in4 = [ 1.0 | 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 ]; + input float in5 = [ 2.0 | -20.125 | -8.25 | -0.5 | 3.5 | 1.0 | 36.8125 | 0.0 ]; + output mat2x3 out0 = [ mat2x3(1.0, -0.5, 3.5, 1.0, 1.0, 2.0) | mat2x3(-8.25, -20.125, 1.0, -8.25, 0.0, -20.125) | mat2x3(-20.125, 36.8125, 36.8125, 0.0, 3.5, -8.25) | mat2x3(36.8125, -8.25, -20.125, -20.125, 2.0, -0.5) | mat2x3(-0.5, 2.0, -8.25, 2.0, -8.25, 3.5) | mat2x3(2.0, 1.0, -0.5, 3.5, -20.125, 1.0) | mat2x3(3.5, 3.5, 2.0, -0.5, -0.5, 36.8125) | mat2x3(0.0, 0.0, 0.0, 36.8125, 36.8125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case int_int_int_int_int_int_to_mat2x3 + version 300 es + values + { + input int in0 = [ 2 | 8 | -192 | 0 | 5 | -12 | 1 | 255 | -66 | 11 ]; + input int in1 = [ 1 | -192 | 8 | 0 | -12 | 2 | 11 | 255 | -66 | 5 ]; + input int in2 = [ -192 | 2 | -66 | 8 | 11 | 255 | 0 | 5 | -12 | 1 ]; + input int in3 = [ 2 | 11 | 255 | 0 | -66 | -12 | 5 | -192 | 8 | 1 ]; + input int in4 = [ 8 | 0 | -12 | -192 | 2 | -66 | 1 | 255 | 5 | 11 ]; + input int in5 = [ 0 | 11 | 5 | 8 | -12 | 255 | -192 | 2 | 1 | -66 ]; + output mat2x3 out0 = [ mat2x3(2.0, 1.0, -192.0, 2.0, 8.0, 0.0) | mat2x3(8.0, -192.0, 2.0, 11.0, 0.0, 11.0) | mat2x3(-192.0, 8.0, -66.0, 255.0, -12.0, 5.0) | mat2x3(0.0, 0.0, 8.0, 0.0, -192.0, 8.0) | mat2x3(5.0, -12.0, 11.0, -66.0, 2.0, -12.0) | mat2x3(-12.0, 2.0, 255.0, -12.0, -66.0, 255.0) | mat2x3(1.0, 11.0, 0.0, 5.0, 1.0, -192.0) | mat2x3(255.0, 255.0, 5.0, -192.0, 255.0, 2.0) | mat2x3(-66.0, -66.0, -12.0, 8.0, 5.0, 1.0) | mat2x3(11.0, 5.0, 1.0, 1.0, 11.0, -66.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_bool_bool_to_mat2x3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + input bool in3 = [ true | false ]; + input bool in4 = [ true | false ]; + input bool in5 = [ true | false ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 1.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_float_int_to_mat2x3 + version 300 es + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | true | false ]; + input float in1 = [ 0.0 | -8.25 | 2.0 | -20.125 | 3.5 | 0.0 | -0.5 | 36.8125 | 1.0 | 1.0 ]; + input int in2 = [ -66 | -12 | 2 | 8 | 255 | 11 | -192 | 1 | 5 | 0 ]; + input bool in3 = [ true | false | true | false | false | true | true | false | true | false ]; + input float in4 = [ 1.0 | 0.0 | -8.25 | 1.0 | 3.5 | -20.125 | -0.5 | 0.0 | 2.0 | 36.8125 ]; + input int in5 = [ 255 | -192 | 1 | 2 | -12 | -66 | 8 | 0 | 11 | 5 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, -66.0, 1.0, 1.0, 255.0) | mat2x3(1.0, -8.25, -12.0, 0.0, 0.0, -192.0) | mat2x3(0.0, 2.0, 2.0, 1.0, -8.25, 1.0) | mat2x3(1.0, -20.125, 8.0, 0.0, 1.0, 2.0) | mat2x3(0.0, 3.5, 255.0, 0.0, 3.5, -12.0) | mat2x3(1.0, 0.0, 11.0, 1.0, -20.125, -66.0) | mat2x3(0.0, -0.5, -192.0, 1.0, -0.5, 8.0) | mat2x3(1.0, 36.8125, 1.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 1.0, 5.0, 1.0, 2.0, 11.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 36.8125, 5.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec3_ivec3_to_mat2x3 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ]; + output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, 1.0, 1.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0) | mat2x3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0) | mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec4_to_mat2x3 + version 300 es + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output mat2x3 out0 = [ mat2x3(-32.0, 64.0, 1.0, 0.0, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.0, 1.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0) | mat2x3(1.0, 1.25, 1.0, 1.0, 1.0, 1.0) | mat2x3(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_ivec2_to_mat2x3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ 1.0 | -8.25 | 36.8125 | 2.0 | 3.5 | -0.5 | -20.125 | 0.0 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x3(1.0, 1.0, 1.0, 36.8125, -32.0, 64.0) | mat2x3(1.0, 0.0, 0.0, 2.0, 0.0, -2.0) | mat2x3(0.0, 0.0, 0.0, 3.5, 1.0, 1.0) | mat2x3(0.0, 1.0, 0.0, -0.5, 0.0, -2.0) | mat2x3(1.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_float_bvec2_to_mat2x3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 2.0 | 1.0 | -20.125 ]; + input bvec2 in2 = [ bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, -4.875, 36.8125, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.75, 3.5, 1.0, 0.0) | mat2x3(1.0, 1.25, 1.125, -0.5, 0.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -8.25, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 2.0, 1.0, 0.0) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.25, 1.125, -20.125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec2_to_mat2x4 + version 300 es + values + { + input vec3 in0 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) ]; + input vec3 in1 = [ vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input vec2 in2 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + output mat2x4 out0 = [ mat2x4(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -0.75, -0.0322580645161) | mat2x4(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875, -32.0, 64.0) | mat2x4(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25) | mat2x4(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 0.0, 0.5) | mat2x4(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125, -0.5, -2.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec2_to_mat2x4 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) ]; + output mat2x4 out0 = [ mat2x4(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, -2.0) | mat2x4(1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 1.0, 1.0) | mat2x4(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 0.0, 0.0) | mat2x4(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, -32.0, 64.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_int_bool_to_mat2x4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) ]; + input float in2 = [ -8.25 | -0.5 | 3.5 | 36.8125 | 0.0 | 0.0 | 2.0 | -20.125 | 1.0 | 1.0 ]; + input float in3 = [ 1.0 | 2.0 | -0.5 | 3.5 | 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | -20.125 ]; + input int in4 = [ 255 | 8 | 11 | -12 | -192 | 0 | 2 | 1 | -66 | 5 ]; + input bool in5 = [ true | false | false | true | false | true | true | false | true | false ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.5, 1.0, 1.0, -8.25, 1.0, 255.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, -2.0, -0.5, 2.0, 8.0, 0.0) | mat2x4(-0.5, -2.25, -32.0, 64.0, 3.5, -0.5, 11.0, 0.0) | mat2x4(0.0, 0.5, 0.0, -2.0, 36.8125, 3.5, -12.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, 0.0, 0.0, 36.8125, -192.0, 0.0) | mat2x4(1.0, 1.25, 0.0, 0.0, 0.0, -8.25, 0.0, 1.0) | mat2x4(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, 1.0, 2.0, 1.0) | mat2x4(1.0, 1.25, 0.0, 0.0, -20.125, 0.0, 1.0, 0.0) | mat2x4(-0.5, -2.25, 0.0, 0.0, 1.0, 0.0, -66.0, 1.0) | mat2x4(-0.75, -0.0322580645161, 1.0, 1.0, 1.0, -20.125, 5.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec2_bool_bvec2_to_mat2x4 + version 300 es + values + { + input bool in0 = [ false | true | false | true | true | true | false | false | false | true ]; + input float in1 = [ 0.0 | -0.5 | -20.125 | -8.25 | 0.0 | 2.0 | 3.5 | 1.0 | 1.0 | 36.8125 ]; + input int in2 = [ 2 | 1 | 255 | 8 | -66 | 0 | -12 | 5 | -192 | 11 ]; + input vec2 in3 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input bool in4 = [ true | false | false | true | false | false | true | true | true | false ]; + input bvec2 in5 = [ bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 2.0, -32.0, 64.0, 1.0, 1.0, 0.0) | mat2x4(1.0, -0.5, 1.0, -0.5, -2.25, 0.0, 1.0, 1.0) | mat2x4(0.0, -20.125, 255.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(1.0, -8.25, 8.0, -0.75, -0.0322580645161, 1.0, 1.0, 1.0) | mat2x4(1.0, 0.0, -66.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat2x4(1.0, 2.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(0.0, 3.5, -12.0, -32.0, 64.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, 5.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0) | mat2x4(1.0, 36.8125, 11.0, -0.75, -0.0322580645161, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bvec2_int_vec4_to_mat2x4 + version 300 es + values + { + input bool in0 = [ true | true | true | false | false | false | false | false | true | true ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) ]; + input int in2 = [ 8 | 1 | 5 | -66 | -192 | 11 | 255 | 0 | -12 | 2 ]; + input vec4 in3 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) ]; + output mat2x4 out0 = [ mat2x4(1.0, 1.0, 1.0, 8.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 0.0, 0.0, 1.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 1.0, 0.0, 5.0, -32.0, 64.0, -51.0, 24.0) | mat2x4(0.0, 0.0, 0.0, -66.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(0.0, 1.0, 0.0, 11.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 0.0, 1.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(1.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec2_bool_to_mat2x4 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | 36.8125 | 1.0 | -0.5 ]; + input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ]; + input ivec2 in2 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ]; + input bool in3 = [ true | true | false | true | false | false | false | true ]; + output mat2x4 out0 = [ mat2x4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat2x4(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0) | mat2x4(-8.25, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x4(-20.125, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec3_vec3_to_mat3x2 + version 300 es + values + { + input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input vec3 in1 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ]; + output mat3x2 out0 = [ mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125) | mat3x2(-0.5, -2.25, -4.875, -0.75, -0.0322580645161, 0.0526315789474) | mat3x2(0.0, 0.5, 0.75, -32.0, 64.0, -51.0) | mat3x2(-32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.5, 0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_bvec3_to_mat3x2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + input bvec3 in1 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 0.0, 1.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_float_float_to_mat3x2 + version 300 es + values + { + input float in0 = [ -8.25 | 36.8125 | -20.125 | -0.5 | 3.5 | 1.0 | 2.0 | 0.0 ]; + input float in1 = [ 2.0 | 3.5 | -20.125 | 36.8125 | 1.0 | 0.0 | -8.25 | -0.5 ]; + input float in2 = [ -0.5 | 2.0 | 1.0 | 0.0 | -8.25 | 36.8125 | -20.125 | 3.5 ]; + input float in3 = [ 36.8125 | 0.0 | 1.0 | -0.5 | 2.0 | 3.5 | -20.125 | -8.25 ]; + input float in4 = [ 36.8125 | 2.0 | 0.0 | -0.5 | 3.5 | -20.125 | -8.25 | 1.0 ]; + input float in5 = [ 0.0 | 36.8125 | -20.125 | -0.5 | 3.5 | 2.0 | 1.0 | -8.25 ]; + output mat3x2 out0 = [ mat3x2(-8.25, 2.0, -0.5, 36.8125, 36.8125, 0.0) | mat3x2(36.8125, 3.5, 2.0, 0.0, 2.0, 36.8125) | mat3x2(-20.125, -20.125, 1.0, 1.0, 0.0, -20.125) | mat3x2(-0.5, 36.8125, 0.0, -0.5, -0.5, -0.5) | mat3x2(3.5, 1.0, -8.25, 2.0, 3.5, 3.5) | mat3x2(1.0, 0.0, 36.8125, 3.5, -20.125, 2.0) | mat3x2(2.0, -8.25, -20.125, -20.125, -8.25, 1.0) | mat3x2(0.0, -0.5, 3.5, -8.25, 1.0, -8.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case int_int_int_int_int_int_to_mat3x2 + version 300 es + values + { + input int in0 = [ 8 | -192 | 2 | 11 | 255 | -66 | 5 | -12 | 1 | 0 ]; + input int in1 = [ 1 | 2 | -12 | 5 | 0 | 255 | 8 | 11 | -192 | -66 ]; + input int in2 = [ -12 | 11 | 2 | 1 | 8 | -66 | -192 | 5 | 255 | 0 ]; + input int in3 = [ -192 | 0 | -12 | 11 | 1 | -66 | 8 | 255 | 2 | 5 ]; + input int in4 = [ -12 | 5 | 0 | -66 | 255 | 8 | -192 | 11 | 2 | 1 ]; + input int in5 = [ -66 | -12 | 8 | 2 | 255 | 0 | -192 | 11 | 1 | 5 ]; + output mat3x2 out0 = [ mat3x2(8.0, 1.0, -12.0, -192.0, -12.0, -66.0) | mat3x2(-192.0, 2.0, 11.0, 0.0, 5.0, -12.0) | mat3x2(2.0, -12.0, 2.0, -12.0, 0.0, 8.0) | mat3x2(11.0, 5.0, 1.0, 11.0, -66.0, 2.0) | mat3x2(255.0, 0.0, 8.0, 1.0, 255.0, 255.0) | mat3x2(-66.0, 255.0, -66.0, -66.0, 8.0, 0.0) | mat3x2(5.0, 8.0, -192.0, 8.0, -192.0, -192.0) | mat3x2(-12.0, 11.0, 5.0, 255.0, 11.0, 11.0) | mat3x2(1.0, -192.0, 255.0, 2.0, 2.0, 1.0) | mat3x2(0.0, -66.0, 0.0, 5.0, 1.0, 5.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_bool_bool_to_mat3x2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + input bool in4 = [ false | true ]; + input bool in5 = [ false | true ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_float_int_to_mat3x2 + version 300 es + values + { + input bool in0 = [ true | false | true | true | false | true | false | true | false | false ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | 0.0 | 1.0 | -8.25 | 1.0 | 2.0 | 36.8125 | -0.5 ]; + input int in2 = [ 255 | -66 | 8 | -192 | 5 | 11 | 1 | 2 | 0 | -12 ]; + input bool in3 = [ true | false | false | true | false | true | true | false | false | true ]; + input float in4 = [ 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | -0.5 | 2.0 | 3.5 | 1.0 | 36.8125 ]; + input int in5 = [ -192 | 8 | 2 | 255 | -66 | -12 | 11 | 0 | 5 | 1 ]; + output mat3x2 out0 = [ mat3x2(1.0, -20.125, 255.0, 1.0, 0.0, -192.0) | mat3x2(0.0, 0.0, -66.0, 0.0, -20.125, 8.0) | mat3x2(1.0, 3.5, 8.0, 0.0, 1.0, 2.0) | mat3x2(1.0, 0.0, -192.0, 1.0, -8.25, 255.0) | mat3x2(0.0, 1.0, 5.0, 0.0, 0.0, -66.0) | mat3x2(1.0, -8.25, 11.0, 1.0, -0.5, -12.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 2.0, 11.0) | mat3x2(1.0, 2.0, 2.0, 0.0, 3.5, 0.0) | mat3x2(0.0, 36.8125, 0.0, 0.0, 1.0, 5.0) | mat3x2(0.0, -0.5, -12.0, 1.0, 36.8125, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec3_ivec3_to_mat3x2 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) ]; + input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.5, 0.75, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 0.0, -2.0, -4.0) | mat3x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3x2(-0.5, -2.25, -4.875, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec4_to_mat3x2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ]; + input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.5, 1.0, 1.0, 1.0, 1.0) | mat3x2(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 1.0) | mat3x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(-0.5, -2.25, 1.0, 0.0, 0.0, 1.0) | mat3x2(1.0, 1.25, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_ivec2_to_mat3x2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) ]; + input float in1 = [ -8.25 | 1.0 | 2.0 | -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, -8.25, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0) | mat3x2(0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, -0.5, 0.0, -2.0) | mat3x2(0.0, 1.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 36.8125, 0.0, -2.0) | mat3x2(1.0, 0.0, 0.0, 3.5, -32.0, 64.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_float_bvec2_to_mat3x2 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input float in1 = [ -8.25 | 36.8125 | -0.5 | 3.5 | 2.0 | -20.125 | 0.0 | 1.0 ]; + input bvec2 in2 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) ]; + output mat3x2 out0 = [ mat3x2(1.0, 1.25, 1.125, -8.25, 1.0, 0.0) | mat3x2(1.0, 1.25, 1.125, 36.8125, 0.0, 0.0) | mat3x2(-0.5, -2.25, -4.875, -0.5, 1.0, 1.0) | mat3x2(-0.5, -2.25, -4.875, 3.5, 0.0, 0.0) | mat3x2(-32.0, 64.0, -51.0, 2.0, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, -20.125, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, 0.0, 1.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec3_to_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input vec3 in1 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ]; + input vec3 in2 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) ]; + output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, 1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat3(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, 1.0, 1.25, 1.125) | mat3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75, 0.0, 0.5, 0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec3_to_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) ]; + input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) ]; + output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(0.0, -2.0, -4.0, 0.0, -2.0, -4.0, 0.0, 0.0, 0.0) | mat3(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) | mat3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_int_bool_bool_to_mat3 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(-32, 64) ]; + input float in2 = [ -0.5 | 3.5 | 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ]; + input float in3 = [ 3.5 | 0.0 | -20.125 | 36.8125 | 2.0 | -8.25 | -0.5 | 1.0 | 0.0 | 1.0 ]; + input int in4 = [ 0 | 11 | 5 | -192 | 8 | -66 | 1 | 2 | 255 | -12 ]; + input bool in5 = [ true | true | true | false | true | false | false | false | true | false ]; + input bool in6 = [ false | false | true | false | false | false | true | true | true | true ]; + output mat3 out0 = [ mat3(1.0, 1.25, 0.0, 0.0, -0.5, 3.5, 0.0, 1.0, 0.0) | mat3(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, 11.0, 1.0, 0.0) | mat3(0.0, 0.5, 1.0, 1.0, 0.0, -20.125, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, 0.0, -2.0, -20.125, 36.8125, -192.0, 0.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, 2.0, 8.0, 1.0, 0.0) | mat3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, -8.25, -66.0, 0.0, 0.0) | mat3(-0.5, -2.25, 1.0, 1.0, 0.0, -0.5, 1.0, 0.0, 1.0) | mat3(1.0, 1.25, -32.0, 64.0, 1.0, 1.0, 2.0, 0.0, 1.0) | mat3(0.0, 0.5, 0.0, 0.0, 2.0, 0.0, 255.0, 1.0, 1.0) | mat3(-32.0, 64.0, -32.0, 64.0, 36.8125, 1.0, -12.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec2_bool_bvec2_float_to_mat3 + version 300 es + values + { + input bool in0 = [ false | true | true | true | true | true | false | false | false | false ]; + input float in1 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 3.5 | -20.125 | 1.0 | 0.0 | 2.0 ]; + input int in2 = [ 8 | -66 | 5 | 1 | 0 | 2 | -12 | -192 | 11 | 255 ]; + input vec2 in3 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input bool in4 = [ true | false | true | false | false | true | true | false | true | false ]; + input bvec2 in5 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) ]; + input float in6 = [ -0.5 | 1.0 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.0 | 3.5 | -20.125 | -8.25 ]; + output mat3 out0 = [ mat3(0.0, -8.25, 8.0, 0.0, 0.5, 1.0, 0.0, 1.0, -0.5) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, -0.5, 5.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 36.8125, 1.0, -32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, -0.5, -2.25, 0.0, 1.0, 1.0, 36.8125) | mat3(1.0, 3.5, 2.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 2.0) | mat3(0.0, -20.125, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0, 0.0) | mat3(0.0, 1.0, -192.0, 0.0, 0.5, 0.0, 0.0, 0.0, 3.5) | mat3(0.0, 0.0, 11.0, 1.0, 1.25, 1.0, 0.0, 1.0, -20.125) | mat3(0.0, 2.0, 255.0, -0.75, -0.0322580645161, 0.0, 1.0, 1.0, -8.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + case bool_bvec2_int_vec4_bool_to_mat3 + version 300 es + values + { + input bool in0 = [ true | false | true | true | false | false | true | false | false | true ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in2 = [ -192 | 2 | 0 | 5 | 1 | -66 | 11 | -12 | 8 | 255 ]; + input vec4 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + input bool in4 = [ false | true | false | true | false | false | false | true | true | true ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, -192.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, 2.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 1.0, 5.0, -32.0, 64.0, -51.0, 24.0, 1.0) | mat3(0.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 0.0, 1.0, 11.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 1.0, 0.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(0.0, 1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(1.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec2_bool_bool_to_mat3 + version 300 es + values + { + input float in0 = [ -8.25 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -20.125 | 0.0 ]; + input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) ]; + input bool in3 = [ false | true | false | true | true | false | true | false ]; + input bool in4 = [ true | false | false | false | true | true | false | true ]; + output mat3 out0 = [ mat3(-8.25, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 1.0, 0.0) | mat3(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3(-0.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_to_mat3x4 + version 300 es + values + { + input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in1 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) ]; + input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ]; + output mat3x4 out0 = [ mat3x4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0) | mat3x4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat3x4(-32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat3x4(-0.5, -2.25, -4.875, 9.0, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat3x4(0.0, 0.5, 0.75, 0.825, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec4_ivec4_ivec4_to_mat3x4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ]; + input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + input ivec4 in2 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + output mat3x4 out0 = [ mat3x4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat3x4 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-0.5, -2.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, -2) ]; + input float in2 = [ 1.0 | -8.25 | 2.0 | 3.5 | -20.125 | 36.8125 | 0.0 | 1.0 | -0.5 | 0.0 ]; + input float in3 = [ -0.5 | 36.8125 | 1.0 | 1.0 | 0.0 | 3.5 | 2.0 | 0.0 | -8.25 | -20.125 ]; + input float in4 = [ -8.25 | 1.0 | 1.0 | 0.0 | 2.0 | 36.8125 | 0.0 | -20.125 | 3.5 | -0.5 ]; + input int in5 = [ 11 | 2 | 8 | 5 | 0 | -192 | 1 | -12 | 255 | -66 ]; + input int in6 = [ -12 | 5 | 8 | 1 | 0 | 255 | 11 | -192 | -66 | 2 ]; + input bool in7 = [ true | true | true | false | false | false | true | false | true | false ]; + input bool in8 = [ true | true | true | false | true | false | true | false | false | false ]; + input bool in9 = [ true | false | true | false | true | true | false | false | false | true ]; + output mat3x4 out0 = [ mat3x4(1.0, 1.25, 0.0, 0.0, 1.0, -0.5, -8.25, 11.0, -12.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, 1.0, 2.0, 5.0, 1.0, 1.0, 0.0) | mat3x4(0.0, 0.5, -32.0, 64.0, 2.0, 1.0, 1.0, 8.0, 8.0, 1.0, 1.0, 1.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, 3.5, 1.0, 0.0, 5.0, 1.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, -20.125, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3x4(-0.75, -0.0322580645161, -32.0, 64.0, 36.8125, 3.5, 36.8125, -192.0, 255.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 0.0, 1.0, 11.0, 1.0, 1.0, 0.0) | mat3x4(-0.75, -0.0322580645161, 0.0, -2.0, 1.0, 0.0, -20.125, -12.0, -192.0, 0.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, 0.0, -0.5, -8.25, 3.5, 255.0, -66.0, 1.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, -2.0, 0.0, -20.125, -0.5, -66.0, 2.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec3_bool_bvec3_float_bool_to_mat3x4 + version 300 es + values + { + input bool in0 = [ false | false | true | true | true | true | false | false | false | true ]; + input float in1 = [ 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -20.125 ]; + input int in2 = [ -66 | -192 | 255 | 8 | 0 | -12 | 5 | 2 | 11 | 1 ]; + input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) ]; + input bool in4 = [ false | true | true | true | false | false | true | true | false | false ]; + input bvec3 in5 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in6 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 2.0 | -20.125 | 1.0 | 0.0 | 3.5 ]; + input bool in7 = [ true | false | false | true | true | false | true | false | false | true ]; + output mat3x4 out0 = [ mat3x4(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 1.0, 0.0, 0.0, -8.25, 1.0) | mat3x4(0.0, -8.25, -192.0, -32.0, 64.0, -51.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(1.0, 1.0, 255.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, -0.5, 0.0) | mat3x4(1.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 36.8125, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.0, -12.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 0.0) | mat3x4(0.0, 2.0, 5.0, 1.0, 1.25, 1.125, 1.0, 1.0, 1.0, 1.0, -20.125, 1.0) | mat3x4(0.0, 3.5, 2.0, 1.0, 1.25, 1.125, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.0, -0.5, 11.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, -20.125, 1.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 3.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7); + ${OUTPUT} + } + "" + end + + case bool_bvec4_int_vec4_bool_float_to_mat3x4 + version 300 es + values + { + input bool in0 = [ false | true | true | true | false | false | false | true | false | true ]; + input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ]; + input int in2 = [ 255 | 2 | -192 | -12 | 11 | 1 | 0 | -66 | 8 | 5 ]; + input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + input bool in4 = [ true | true | true | false | false | false | true | true | false | false ]; + input float in5 = [ 36.8125 | 2.0 | -8.25 | 0.0 | 1.0 | 1.0 | -0.5 | 3.5 | 0.0 | -20.125 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 255.0, -0.5, -2.25, -4.875, 9.0, 1.0, 36.8125) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 1.0, 2.0) | mat3x4(1.0, 0.0, 1.0, 0.0, 0.0, -192.0, 1.0, 1.25, 1.125, 1.75, 1.0, -8.25) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 11.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 1.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, -0.5) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 1.0, 3.5) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 5.0, -0.5, -2.25, -4.875, 9.0, 0.0, -20.125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec4_bool_bool_int_to_mat3x4 + version 300 es + values + { + input float in0 = [ 36.8125 | 1.0 | 0.0 | 3.5 | -8.25 | -20.125 | 2.0 | 0.0 | 1.0 | -0.5 ]; + input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ]; + input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ]; + input bool in3 = [ true | false | true | true | false | true | true | false | false | false ]; + input bool in4 = [ true | false | false | true | true | false | false | false | true | true ]; + input int in5 = [ 1 | 5 | -12 | 8 | -192 | 2 | -66 | 255 | 11 | 0 ]; + output mat3x4 out0 = [ mat3x4(36.8125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 5.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0, -12.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 8.0) | mat3x4(-8.25, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, -192.0) | mat3x4(-20.125, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 2.0) | mat3x4(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -66.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 255.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 11.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec2_to_mat4x2 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ]; + input vec2 in2 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) ]; + output mat4x2 out0 = [ mat4x2(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 1.0, 1.25) | mat4x2(-32.0, 64.0, -51.0, -0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25) | mat4x2(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, -0.75, -0.0322580645161) | mat4x2(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -32.0, 64.0) | mat4x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125, 0.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec2_to_mat4x2 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ]; + input ivec3 in1 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ]; + input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, -2.0, -4.0, -32.0, 64.0) | mat4x2(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, -2.0, -4.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, 0.0, -2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_int_bool_to_mat4x2 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ]; + input float in2 = [ 3.5 | -8.25 | 2.0 | 36.8125 | -0.5 | 1.0 | 1.0 | 0.0 | -20.125 | 0.0 ]; + input float in3 = [ 0.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | 2.0 | 0.0 | -20.125 | 1.0 ]; + input int in4 = [ -12 | -66 | 11 | 5 | 8 | 255 | -192 | 2 | 1 | 0 ]; + input bool in5 = [ true | true | false | true | false | true | false | true | false | false ]; + output mat4x2 out0 = [ mat4x2(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, -12.0, 1.0) | mat4x2(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, -66.0, 1.0) | mat4x2(1.0, 1.25, -32.0, 64.0, 2.0, 3.5, 11.0, 0.0) | mat4x2(0.0, 0.5, 1.0, 1.0, 36.8125, 1.0, 5.0, 1.0) | mat4x2(-32.0, 64.0, 1.0, 1.0, -0.5, -0.5, 8.0, 0.0) | mat4x2(-0.75, -0.0322580645161, 0.0, 0.0, 1.0, -8.25, 255.0, 1.0) | mat4x2(-0.75, -0.0322580645161, -32.0, 64.0, 1.0, 2.0, -192.0, 0.0) | mat4x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0, 2.0, 1.0) | mat4x2(-0.5, -2.25, 0.0, 0.0, -20.125, -20.125, 1.0, 0.0) | mat4x2(1.0, 1.25, 0.0, -2.0, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec2_bool_bvec2_to_mat4x2 + version 300 es + values + { + input bool in0 = [ false | false | true | true | true | false | false | true | false | true ]; + input float in1 = [ 36.8125 | -8.25 | 3.5 | 1.0 | 2.0 | -0.5 | 0.0 | 1.0 | -20.125 | 0.0 ]; + input int in2 = [ -66 | 1 | -192 | 2 | 11 | 0 | 255 | 8 | 5 | -12 ]; + input vec2 in3 = [ vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bool in4 = [ true | false | false | false | false | true | true | true | false | true ]; + input bvec2 in5 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) ]; + output mat4x2 out0 = [ mat4x2(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0) | mat4x2(0.0, -8.25, 1.0, -0.75, -0.0322580645161, 0.0, 0.0, 1.0) | mat4x2(1.0, 3.5, -192.0, -32.0, 64.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 2.0, 0.0, 0.5, 0.0, 1.0, 1.0) | mat4x2(1.0, 2.0, 11.0, 1.0, 1.25, 0.0, 1.0, 0.0) | mat4x2(0.0, -0.5, 0.0, 1.0, 1.25, 1.0, 0.0, 1.0) | mat4x2(0.0, 0.0, 255.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 8.0, -32.0, 64.0, 1.0, 1.0, 1.0) | mat4x2(0.0, -20.125, 5.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bvec2_int_vec4_to_mat4x2 + version 300 es + values + { + input bool in0 = [ false | false | true | false | true | false | true | true | true | false ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ]; + input int in2 = [ -12 | 8 | 2 | 255 | 5 | -192 | 0 | 11 | 1 | -66 ]; + input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ]; + output mat4x2 out0 = [ mat4x2(0.0, 1.0, 0.0, -12.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(0.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 1.0, 0.0, 5.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825) | mat4x2(1.0, 0.0, 1.0, 11.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 1.0, 1.0, -66.0, 0.0, 0.5, 0.75, 0.825) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec2_bool_to_mat4x2 + version 300 es + values + { + input float in0 = [ 1.0 | -8.25 | -20.125 | 3.5 | -0.5 | 2.0 | 36.8125 | 0.0 ]; + input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ]; + input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + input bool in3 = [ true | true | false | true | true | false | false | false ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 0.0, 1.0, -32.0, 64.0, 1.0) | mat4x2(-8.25, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat4x2(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4x2(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x2(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 0.0) | mat4x2(36.8125, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_to_mat4x3 + version 300 es + values + { + input vec4 in0 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) ]; + input vec4 in1 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output mat4x3 out0 = [ mat4x3(-0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4x3(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4x3(0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4x3(-0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4x3(-32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec4_ivec4_ivec4_to_mat4x3 + version 300 es + values + { + input ivec4 in0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + input ivec4 in1 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) ]; + input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ]; + output mat4x3 out0 = [ mat4x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) | mat4x3(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0) | mat4x3(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat4x3 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + input float in2 = [ -20.125 | 3.5 | 2.0 | -0.5 | -8.25 | 0.0 | 1.0 | 0.0 | 1.0 | 36.8125 ]; + input float in3 = [ 0.0 | -8.25 | 36.8125 | 1.0 | 0.0 | -20.125 | 3.5 | 2.0 | -0.5 | 1.0 ]; + input float in4 = [ 0.0 | 1.0 | 3.5 | -20.125 | 0.0 | 36.8125 | 1.0 | -8.25 | 2.0 | -0.5 ]; + input int in5 = [ 2 | 8 | 1 | -192 | 0 | -12 | 11 | 255 | 5 | -66 ]; + input int in6 = [ 2 | -12 | 5 | 8 | 11 | 255 | 0 | -66 | 1 | -192 ]; + input bool in7 = [ true | true | false | true | false | false | false | true | false | true ]; + input bool in8 = [ true | false | false | true | true | false | true | true | false | false ]; + input bool in9 = [ false | true | false | false | false | false | true | true | true | true ]; + output mat4x3 out0 = [ mat4x3(-0.5, -2.25, 0.0, -2.0, -20.125, 0.0, 0.0, 2.0, 2.0, 1.0, 1.0, 0.0) | mat4x3(0.0, 0.5, -32.0, 64.0, 3.5, -8.25, 1.0, 8.0, -12.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 0.5, 1.0, 1.0, 2.0, 36.8125, 3.5, 1.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 1.25, -32.0, 64.0, -0.5, 1.0, -20.125, -192.0, 8.0, 1.0, 1.0, 0.0) | mat4x3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 11.0, 0.0, 1.0, 0.0) | mat4x3(-0.5, -2.25, 0.0, 0.0, 0.0, -20.125, 36.8125, -12.0, 255.0, 0.0, 0.0, 0.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, 3.5, 1.0, 11.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 1.25, 0.0, -2.0, 0.0, 2.0, -8.25, 255.0, -66.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, -0.5, 2.0, 5.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(-0.75, -0.0322580645161, 1.0, 1.0, 36.8125, 1.0, -0.5, -66.0, -192.0, 1.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec3_bool_bvec3_float_bool_to_mat4x3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | true | true | false | false | false ]; + input float in1 = [ -8.25 | 2.0 | 1.0 | -0.5 | 0.0 | 0.0 | 36.8125 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ 255 | 2 | 11 | 1 | 8 | -192 | 0 | -66 | -12 | 5 ]; + input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input bool in4 = [ true | true | false | false | true | false | false | false | true | true ]; + input bvec3 in5 = [ bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(true, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in6 = [ 1.0 | 0.0 | -0.5 | 36.8125 | 1.0 | -20.125 | 2.0 | 0.0 | -8.25 | 3.5 ]; + input bool in7 = [ true | true | false | false | false | false | true | true | false | true ]; + output mat4x3 out0 = [ mat4x3(1.0, -8.25, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 2.0, 2.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(0.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat4x3(0.0, -0.5, 1.0, -32.0, 64.0, -51.0, 0.0, 0.0, 1.0, 0.0, 36.8125, 0.0) | mat4x3(1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat4x3(1.0, 0.0, -192.0, 1.0, 1.25, 1.125, 0.0, 1.0, 0.0, 0.0, -20.125, 0.0) | mat4x3(1.0, 36.8125, 0.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 1.0) | mat4x3(0.0, -20.125, -66.0, 1.0, 1.25, 1.125, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 3.5, -12.0, -0.5, -2.25, -4.875, 1.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat4x3(0.0, 1.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 3.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7); + ${OUTPUT} + } + "" + end + + case bool_bvec4_int_vec4_bool_float_to_mat4x3 + version 300 es + values + { + input bool in0 = [ true | true | true | false | true | false | false | true | false | false ]; + input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, false, false, true) ]; + input int in2 = [ 5 | 11 | 0 | -192 | -66 | 255 | 1 | -12 | 8 | 2 ]; + input vec4 in3 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input bool in4 = [ false | true | true | false | true | false | true | true | false | false ]; + input float in5 = [ -20.125 | 0.0 | 1.0 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, -20.125) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 11.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 0.0, -0.5) | mat4x3(1.0, 1.0, 1.0, 1.0, 1.0, -66.0, 1.0, 1.25, 1.125, 1.75, 1.0, 3.5) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0, -8.25) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.5, 0.75, 0.825, 0.0, 2.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.5, 0.75, 0.825, 0.0, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec4_bool_bool_int_to_mat4x3 + version 300 es + values + { + input float in0 = [ 36.8125 | -0.5 | 3.5 | 2.0 | 1.0 | -20.125 | 0.0 | 0.0 | -8.25 | 1.0 ]; + input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ]; + input ivec4 in2 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, -2, -4, 9) ]; + input bool in3 = [ false | true | false | true | false | false | false | true | true | true ]; + input bool in4 = [ false | true | false | true | false | true | false | false | true | true ]; + input int in5 = [ 2 | 1 | 8 | 11 | 255 | 5 | 0 | -66 | -192 | -12 ]; + output mat4x3 out0 = [ mat4x3(36.8125, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 2.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x3(3.5, 1.0, 0.0, 0.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 8.0) | mat4x3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 11.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 255.0) | mat4x3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 5.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, -66.0) | mat4x3(-8.25, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -192.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -12.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_vec4_to_mat4 + version 300 es + values + { + input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in1 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + output mat4 out0 = [ mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0) | mat4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(-0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case ivec4_ivec4_ivec4_ivec4_to_mat4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ]; + input ivec4 in1 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + input ivec4 in3 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bvec4_bvec4_bvec4_bvec4_to_mat4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) ]; + input bvec4 in1 = [ bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + input bvec4 in2 = [ bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) ]; + input bvec4 in3 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_ivec3_bvec3_vec4_ivec2_float_vec2_to_mat4 + version 300 es + values + { + input float in0 = [ 2.0 | 1.0 | 3.5 | 0.0 | -20.125 | 36.8125 | -0.5 | -8.25 ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ]; + input bvec3 in2 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) ]; + input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input ivec2 in4 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) ]; + input float in5 = [ 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 | -20.125 | 1.0 | -0.5 ]; + input vec2 in6 = [ vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(1.0, 1.25) ]; + output mat4 out0 = [ mat4(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, 2.0, 0.0, 0.5) | mat4(1.0, -32.0, 64.0, -51.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 3.5, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, 36.8125, -32.0, 64.0) | mat4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, -8.25, 0.0, 0.5) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 0.0, -0.75, -0.0322580645161) | mat4(36.8125, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -20.125, -0.5, -2.25) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 1.0, 1.0, 1.25) | mat4(-8.25, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, -0.5, 1.0, 1.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + +end # matrix_combine diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html new file mode 100644 index 000000000..025d5933e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test new file mode 100644 index 000000000..86f98d983 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test @@ -0,0 +1,591 @@ +group invalid_declarations "Invalid declarations" + case in_in_vertex_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + in mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case out_in_vertex_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + out mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + in mediump float val; + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case in_in_fragment_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + out mediump float val; + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + in mediump float val; + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case out_in_fragment_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + out mediump float val; + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_in_vertex_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + uniform mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_in_fragment_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + uniform mediump float val; + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_block_in_main + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + void main() + { + uniform Block { mediump float val; }; + ${OUTPUT} + } + "" + end + + case invariant_attribute + version 300 es + expect compile_fail + vertex "" + #version 300 es + invariant in mediump float val; + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invariant_uniform + version 300 es + expect compile_fail + vertex "" + #version 300 es + invariant uniform mediump float val; + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invariant_uniform_block_1 + version 300 es + expect compile_fail + both "" + #version 300 es + invariant uniform Block { mediump float val; }; + ${DECLARATIONS} + void main() + { + ${OUTPUT} + } + "" + end + + case invariant_uniform_block_2 + version 300 es + expect compile_fail + both "" + #version 300 es + uniform Block { invariant mediump float val; }; + ${DECLARATIONS} + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_layout_qualifier + version 300 es + expect compile_fail + both "" + #version 300 es + layout(foobar) uniform Block + { + mediump float val; + }; + ${DECLARATIONS} + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_member_layout_qualifier + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + layout(foobar) uniform mediump float val; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_nested_struct_definition + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + struct S + { + mediump float v; + struct T + { + highp int i; + } t; + } s; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case nested_uniform_block + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + uniform Block2 + { + mediump float v; + } block2; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_sampler_2d + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + uniform sampler2D s; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_sampler_cube + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + uniform samplerCube s; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_missing_member_semicolon + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_missing_end_semicolon + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + } + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_member_name_1 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_member_name_2 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + }; + uniform Block2 + { + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_member_name_3 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform mediump float var; + uniform Block + { + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_block_name + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + }; + uniform Block + { + mediump float var2; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_instance_name_1 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + } block; + uniform Block2 + { + mediump float var2; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_instance_name_2 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform mediump float block; + uniform Block + { + mediump float var; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_instance_name_3 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float block; + }; + uniform Block2 + { + mediump float var2; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_array_without_instance_name_1 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block[2] + { + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_array_without_instance_name_2 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + } [2]; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_in + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + in mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_out + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + out mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_const + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + const mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + +end # invalid_declarations diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html new file mode 100644 index 000000000..3e531413a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test new file mode 100644 index 000000000..f7ba4f295 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test @@ -0,0 +1,76 @@ + +case invalid_assign_to_1 + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + gl_FragData[1] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_simple + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + gl_FragColor = vec4(1.0); + gl_FragData[0] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_static_if + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + if (false) + gl_FragColor = vec4(1.0); + else + gl_FragData[0] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_unused_func + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void unused (void) + { + gl_FragData[0] = vec4(1.0); + } + void main (void) + { + gl_FragColor = vec4(1.0); + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html new file mode 100644 index 000000000..65ff88fbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test new file mode 100644 index 000000000..767a03599 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test @@ -0,0 +1,4345 @@ +# Tests todo: +# - inout with varyings, attributes, uniforms (and arrays of 'em) +# - inout with arrays, array elements +# - inout with array elements +# - inout by-value semantics (arrays & elements & structs) + +# Done: +# - control flow: return, return in loop, etc. + +group datatypes "Function Parameter Data Types" + + case float_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 1.0) | vec2(2.0, 2.5) ]; + output float out0 = [ -1.0 | -4.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (vec2 a) + { + return -(a.x + a.y); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (vec3 a) + { + return -(a.x + a.y + a.z); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (vec4 a) + { + return -(a.x + a.y + a.z + a.w); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat2 + version 300 es + values + { + input mat2 in0 = [ mat2(0.0, 1.0, -2.0, 0.5) | mat2(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (mat2 a) + { + return -(a[0][0] + a[0][1] + a[1][0] + a[1][1]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat3 + version 300 es + values + { + input mat3 in0 = [ mat3(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0) | mat3(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0) ]; + output float out0 = [ -4.5 | -5.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (mat3 a) + { + return -(a[0][0] + a[0][1] + a[0][2] + a[1][0] + a[1][1] + a[1][2] + a[2][0] + a[2][1] + a[2][2]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat4 + version 300 es + values + { + input mat4 in0 = [ mat4(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -2.0, -2.0) | mat4(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0, 0.0, 2.0, -1.0, 1.0, 0.0, -1.0, 3.0) ]; + output float out0 = [ -5.5 | -9.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (mat4 a) + { + return -(a[0][0] + a[0][1] + a[0][2] + a[0][3] + a[1][0] + a[1][1] + a[1][2] + a[1][3] + a[2][0] + a[2][1] + a[2][2] + a[2][3] + a[3][0] + a[3][1] + a[3][2] + a[3][3]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_int + version 300 es + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (int a) + { + return -a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec2 + version 300 es + values + { + input ivec2 in0 = [ ivec2(-1, 0) | ivec2(1, 4) ]; + output int out0 = [ 1 | -5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec2 a) + { + return -(a.x + a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(-1, 0, 2) | ivec3(1, 4, -8) ]; + output int out0 = [ -1 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec3 a) + { + return -(a.x + a.y + a.z); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec4 a) + { + return -(a.x + a.y + a.z + a.w); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case uint_uint + version 300 es + values + { + input uint in0 = [ 1 | 0 | 2 | 4 ]; + output uint out0 = [ 1 | 0 | 4 | 16 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uint a) + { + return a*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case uint_uvec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(1, 0) | uvec2(2, 4) ]; + output uint out0 = [ 1 | 6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uvec2 a) + { + return (a.x + a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case uint_uvec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(1, 0, 2) | uvec3(1, 4, 8) ]; + output uint out0 = [ 3 | 13 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uvec3 a) + { + return (a.x + a.y + a.z); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case uint_uvec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(1, 0, 2, 2) | uvec4(1, 4, 8, 2) ]; + output uint out0 = [ 5 | 15 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uvec4 a) + { + return (a.x + a.y + a.z + a.w); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (bool a) + { + return !a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (bvec2 a) + { + return !(a.x == a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, true, false) | bvec3(true, false, false) ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (bvec3 a) + { + return (a.x == a.y) == a.z; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, true, true, false) | bvec4(false, false, true, true) | bvec4(true, false, false, true) ]; + output bool out0 = [ false | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (bvec4 a) + { + return ((a.x == a.y) == (a.z == a.w)); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case mat2 + version 300 es + values + { + input mat2 in0 = [ mat2(-2.0, 0.5, -1.0, 1.0) | mat2(1.0, -3.5, -3.5, 2.5) | mat2(-2.0, -2.0, 3.5, 0.0) ]; + output mat2 out0 = [ mat2(4.0, -1.0, 2.0, -2.0) | mat2(-2.0, 7.0, 7.0, -5.0) | mat2(4.0, 4.0, -7.0, -0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat2 func (mat2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat2x3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(2.5, 0.0, 1.0, -2.5, 1.0, 3.0) | mat2x3(0.0, 2.0, 1.5, -3.5, 2.0, 0.5) | mat2x3(-1.5, -3.5, 2.5, 0.0, 1.5, 3.0) ]; + output mat2x3 out0 = [ mat2x3(-5.0, -0.0, -2.0, 5.0, -2.0, -6.0) | mat2x3(-0.0, -4.0, -3.0, 7.0, -4.0, -1.0) | mat2x3(3.0, 7.0, -5.0, -0.0, -3.0, -6.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat2x3 func (mat2x3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat2x4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.5, 3.0, -1.0, 2.5, -0.5, 3.5, 3.0, -3.0) | mat2x4(-2.5, -2.0, 3.5, -0.5, 1.0, -1.5, 0.0, -1.0) | mat2x4(-1.0, 0.5, 0.5, 3.0, 1.5, 3.0, 2.5, 3.5) ]; + output mat2x4 out0 = [ mat2x4(-3.0, -6.0, 2.0, -5.0, 1.0, -7.0, -6.0, 6.0) | mat2x4(5.0, 4.0, -7.0, 1.0, -2.0, 3.0, -0.0, 2.0) | mat2x4(2.0, -1.0, -1.0, -6.0, -3.0, -6.0, -5.0, -7.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat2x4 func (mat2x4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3x2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.5, -2.5, 2.5, 3.5, 3.0, 0.5) | mat3x2(1.5, -2.0, 2.5, 0.5, -1.5, -3.5) | mat3x2(2.5, 3.5, -3.0, 2.5, -0.5, -2.5) ]; + output mat3x2 out0 = [ mat3x2(-3.0, 5.0, -5.0, -7.0, -6.0, -1.0) | mat3x2(-3.0, 4.0, -5.0, -1.0, 3.0, 7.0) | mat3x2(-5.0, -7.0, 6.0, -5.0, 1.0, 5.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3x2 func (mat3x2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3 + version 300 es + values + { + input mat3 in0 = [ mat3(-1.5, 2.0, 3.0, -3.5, 1.0, -3.5, 1.5, -1.5, 3.0) | mat3(3.5, 0.0, 3.5, -1.5, -3.0, 0.5, -3.5, -2.5, -0.5) | mat3(1.0, -2.5, -3.5, 3.0, -1.5, 3.5, 3.0, -1.0, -0.5) ]; + output mat3 out0 = [ mat3(3.0, -4.0, -6.0, 7.0, -2.0, 7.0, -3.0, 3.0, -6.0) | mat3(-7.0, -0.0, -7.0, 3.0, 6.0, -1.0, 7.0, 5.0, 1.0) | mat3(-2.0, 5.0, 7.0, -6.0, 3.0, -7.0, -6.0, 2.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3 func (mat3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3x4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(0.0, 1.0, 0.5, 0.5, 1.0, 3.5, 0.0, -0.5, 1.5, -2.0, -1.5, 3.5) | mat3x4(0.0, 0.5, -3.5, -0.5, 0.5, -3.5, 1.0, 1.0, -3.5, 1.0, -0.5, 1.5) | mat3x4(-1.0, 1.5, 2.0, -3.5, -3.5, 1.5, 3.5, -2.0, -0.5, 0.5, -1.5, -1.0) ]; + output mat3x4 out0 = [ mat3x4(-0.0, -2.0, -1.0, -1.0, -2.0, -7.0, -0.0, 1.0, -3.0, 4.0, 3.0, -7.0) | mat3x4(-0.0, -1.0, 7.0, 1.0, -1.0, 7.0, -2.0, -2.0, 7.0, -2.0, 1.0, -3.0) | mat3x4(2.0, -3.0, -4.0, 7.0, 7.0, -3.0, -7.0, 4.0, 1.0, -1.0, 3.0, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3x4 func (mat3x4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4x2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(-1.5, -1.0, 0.5, -1.5, -1.0, 2.0, -3.5, 0.5) | mat4x2(2.0, -1.5, -2.0, 2.5, -2.0, -2.5, -0.5, 1.5) | mat4x2(-3.0, -1.5, -1.0, 2.5, -0.5, 2.5, -2.5, -1.0) ]; + output mat4x2 out0 = [ mat4x2(3.0, 2.0, -1.0, 3.0, 2.0, -4.0, 7.0, -1.0) | mat4x2(-4.0, 3.0, 4.0, -5.0, 4.0, 5.0, 1.0, -3.0) | mat4x2(6.0, 3.0, 2.0, -5.0, 1.0, -5.0, 5.0, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat4x2 func (mat4x2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4x3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 3.0, -0.5, -2.0, -3.0, 0.0, -2.5, 2.5, 2.5, -2.5, -1.5, 2.5) | mat4x3(1.0, 2.5, -1.0, -3.0, -1.5, 2.0, -1.5, -1.0, -0.5, -0.5, -0.5, 3.0) | mat4x3(-2.5, -3.5, 3.5, 3.0, 3.5, -0.5, 3.5, 3.0, -2.0, 2.0, 2.5, 1.0) ]; + output mat4x3 out0 = [ mat4x3(-2.0, -6.0, 1.0, 4.0, 6.0, -0.0, 5.0, -5.0, -5.0, 5.0, 3.0, -5.0) | mat4x3(-2.0, -5.0, 2.0, 6.0, 3.0, -4.0, 3.0, 2.0, 1.0, 1.0, 1.0, -6.0) | mat4x3(5.0, 7.0, -7.0, -6.0, -7.0, 1.0, -7.0, -6.0, 4.0, -4.0, -5.0, -2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat4x3 func (mat4x3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4 + version 300 es + values + { + input mat4 in0 = [ mat4(0.0, -1.5, -1.0, -2.0, -3.0, 0.5, -1.5, 2.5, -3.5, 3.0, 1.5, 3.0, 3.0, 3.0, 0.5, -3.5) | mat4(2.0, -2.5, -1.5, 1.0, 0.0, -0.5, 3.5, 1.0, -1.0, -2.0, 2.5, 0.0, 2.0, -1.0, -2.5, 0.5) | mat4(2.5, -2.5, 2.0, 3.0, 2.5, 2.5, -3.5, 1.0, 2.5, -3.5, -1.5, -1.5, 0.0, -0.5, 0.0, 2.0) ]; + output mat4 out0 = [ mat4(-0.0, 3.0, 2.0, 4.0, 6.0, -1.0, 3.0, -5.0, 7.0, -6.0, -3.0, -6.0, -6.0, -6.0, -1.0, 7.0) | mat4(-4.0, 5.0, 3.0, -2.0, -0.0, 1.0, -7.0, -2.0, 2.0, 4.0, -5.0, -0.0, -4.0, 2.0, 5.0, -1.0) | mat4(-5.0, 5.0, -4.0, -6.0, -5.0, -5.0, 7.0, -2.0, -5.0, 7.0, 3.0, 3.0, -0.0, 1.0, -0.0, -4.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat4 func (mat4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + + float func (Pos p) + { + return -(p.a + p.b + p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + out0 = func(p); + ${OUTPUT} + } + "" + end + + case struct_struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + + Pos func (Pos p) + { + return Pos(-p.a, -p.b, -p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + p = func(p); + out0 = p.a + p.b + p.c; + ${OUTPUT} + } + "" + end + + case struct_nested_struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + struct Line { Pos start, end; }; + + Line func (Pos p) + { + return Line(p, Pos(-p.a, -p.b, -p.c)); + } + + float sum (Pos p) + { + return (p.a + p.b + p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + Line line = func(p); + out0 = sum(line.start) + (2.0 * sum(line.end)); + ${OUTPUT} + } + "" + end + + +end # datatypes + +group qualifiers "Function Parameter Qualifiers" + + case in_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_lowp_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in lowp float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_lowp_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out lowp float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_lowp_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout lowp float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_highp_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in highp float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_highp_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out highp float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_highp_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout highp float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case const_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (const float a) + { + float b = -a; + return 2.0 * b; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case const_in_float + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (const in float a) + { + float b = -a; + return 2.0 * b; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case in_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_lowp_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in lowp int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_lowp_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out lowp int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_lowp_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout lowp int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_highp_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in highp int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_highp_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out highp int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_highp_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout highp int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case const_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + int b = -a; + return 2 * b; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case const_in_int + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const in int a) + { + int b = -a; + return 2 * b; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case in_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a) + { + a = !a; + return a; + } + + void main() + { + ${SETUP} + bool f = in0; + bool g = func(f); + out0 = (f != g); + ${OUTPUT} + } + "" + end + + case out_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (out bool a) + { + a = false; + } + + void main() + { + ${SETUP} + bool f = true; + func(f); + out0 = (in0 == f); + ${OUTPUT} + } + "" + end + + case inout_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (inout bool a) + { + a = !a; + } + + void main() + { + ${SETUP} + bool f = true; + func(f); + out0 = (in0 == f); + ${OUTPUT} + } + "" + end + + case const_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (const bool a) + { + bool b = !a; + return b; + } + + void main() + { + ${SETUP} + bool f = in0; + bool g = func(f); + out0 = (f != g); + ${OUTPUT} + } + "" + end + +end # qualifiers + +group declarations "Function Declarations" + + case basic + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void); + + float func (void) + { + return -1.0; + } + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + "" + end + + case basic_arg + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + float func (float f) + { + return -f; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case define_after_use + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + + float func (void) + { + return -1.0; + } + "" + end + + case double_declare + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void); + + float func (void); + + float func (void) + { + return -1.0; + } + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + "" + end + + case declare_after_define + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void) + { + return -1.0; + } + + float func (void); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + "" + end + + case void_vs_no_void + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + + float func (void) + { + return -1.0; + } + "" + end + + case in_vs_no_in + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + + float func (in float f) + { + return -f; + } + "" + end + + case default_vs_explicit_precision + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + + float func (mediump float f) + { + return -f; + } + "" + end + + +end # declarations + +group overloading "Function Overloading" + + case user_func_arg_type_simple + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + int func (int a) + { + return -a; + } + + void main() + { + out0 = func(in0) * float(func(-1)); + ${OUTPUT} + } + "" + end + + case user_func_arg_float_types + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) { return -a; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + + void main() + { + out0 = func(func(func(func(vec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_int_types + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + out0 = func(func(func(func(ivec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_bool_types + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + out0 = func(func(func(func(bvec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_basic_types + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) { return -a; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + if (func(func(bvec4(false)).x)) + out0 = func(in0) * float(func(-1)); + else + out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_complex_types + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + struct Line { Pos start, end; }; + + float func (float a) { return -a; } + float func (float a[4]) { return a[0] + a[3]; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + vec4 func (vec4 a[4]) { return a[1] + a[2]; } + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + Pos func (Pos a) { return a; } + Line func (Line a) { return Line(a.end, a.start); } + + void main() + { + ${SETUP} + float arr[4]; + vec4 arr2[4]; + out0 = func(arr) + func(arr2).x; + if (func(func(bvec4(false)).x)) + out0 = func(in0) * float(func(-1)); + else + out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arguments + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + float func (float a, float b) + { + return a * b; + } + + void main() + { + out0 = func(in0) * func(-0.5, -2.0); + ${OUTPUT} + } + "" + end + + case array_size + version 300 es + values + { + output float out0 = [ 1.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f[3]) + { + return f[0]; + } + + float func (float f[4]) + { + return f[1]; + } + + void main () + { + ${SETUP} + float[4] x = float[4] (-1.0, 1.0, 0.0, 0.0); + out0 = func(x); + ${OUTPUT} + } + "" + end + +end # overloading + +group array_arguments "Arrays as Arguments" + + case local_in_float + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (in float a[4]) + { + a[0] = -1.0; + a[2] = -4.0; + a[3] = -3.0 * a[1]; + return a[0]; + } + + void main() + { + float arr[4]; + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + float f = func(arr); + out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_float + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (in float a[4]) + { + a[0] = -1.0; + a[2] = -4.0; + a[3] = -3.0 * a[1]; + return a[0]; + } + + float arr[4]; + + void main() + { + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + float f = func(arr); + out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case local_in_int + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, -4) | ivec4(-7, -11, 13, 19) ]; + output ivec4 out0 = [ ivec4(0, -1, -2, 4) | ivec4(7, 11, -13, -19) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a[4]) + { + a[0] = -1; + a[2] = -4; + a[3] = -3 * a[1]; + return a[0]; + } + + void main() + { + ${SETUP} + int arr[4]; + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + int f = func(arr); + out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_int + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, 4) | ivec4(-7, -11, 13, 19) ]; + output ivec4 out0 = [ ivec4(0, -1, -2, -4) | ivec4(7, 11, -13, -19) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a[4]) + { + a[0] = -1; + a[2] = -4; + a[3] = -3 * a[1]; + return a[0]; + } + + int arr[4]; + + void main() + { + ${SETUP} + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + int f = func(arr); + out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + + "" + end + + case local_in_bool + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a[4]) + { + a[0] = false; + a[2] = true; + a[3] = !a[1]; + return a[0]; + } + + void main() + { + ${SETUP} + bool arr[4]; + arr[0] = !in0.x; + arr[1] = !in0.y; + arr[2] = !in0.z; + arr[3] = !in0.w; + func(arr); + out0 = bvec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_bool + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a[4]) + { + a[0] = false; + a[2] = true; + a[3] = !a[1]; + return a[0]; + } + + bool arr[4]; + + void main() + { + ${SETUP} + arr[0] = !in0.x; + arr[1] = !in0.y; + arr[2] = !in0.z; + arr[3] = !in0.w; + func(arr); + out0 = bvec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case test_helpers + version 300 es + desc "Check that helper functions are supported properly." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output float out0 = [ 1.0 | 1.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + void main() + { + float arr[4]; + set(arr, in0); + negate(arr); + out0 = float(test(arr, -in0)); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_local_in_on_call + version 300 es + desc "Check that local 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + a[0] = 2.123; + a[2] = -4.123; + return isEqual(a, b) ? 1.0 : -1.0; + } + + void main() + { + float arr[4]; + set(arr, in0); + out0 = in0 * func(arr, arr); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_global_in_on_call + version 300 es + desc "Check that global 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + a[0] = 2.123; + a[2] = -4.123; + return isEqual(a, b) ? 1.0 : -1.0; + } + + float arr[4]; + + void main() + { + set(arr, in0); + out0 = in0 * func(arr, arr); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_local_inout_on_call + version 300 es + desc "Check that local 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (inout float a[4], inout float b[4]) + { + negate(a); + return isEqual(a, b) ? 1.0 : -1.0; + } + + void main() + { + float arr[4]; + set(arr, in0); + float m = func(arr, arr); // returns -1.0 + float n = float(test(arr, in0) || test(arr, -in0)); + out0 = in0 * m * n; + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_global_inout_on_call + version 300 es + desc "Check that global 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + negate(a); + return isEqual(a, b) ? 1.0 : -1.0; + } + + float arr[4]; + + void main() + { + set(arr, in0); + float m = func(arr, arr); // returns -1.0 + float n = float(test(arr, in0) || test(arr, -in0)); + out0 = in0 * m * n; + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + +# vec4 get (in float arr[4]); +# void set (out float arr[4], vec4 val); +# void negate (inout float arr[4]); +# bool test (in float arr[4], vec4 ref); +# bool isEqual (in float a[4], in float b[4]); + +# float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } +# vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } +# void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } +# void negate (inout float arr[4]) { set(arr, -get(arr)); } +# bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } +# bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + +end # array_arguments + +#group qualifiers "Function Parameter Qualifiers" +# +#end # qualifiers + +group control_flow "Control Flow In Functions" + + case simple_return + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + a = a * -1.0; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_if + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + if (a != 0.0) + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_else + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + if (a == 0.0) + return 1.0; + else + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_loop + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + while (a < 100.0) + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_loop_if + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + while (a < 100.0) + { + a = -a; + if (a != 0.0) + return a; + else + return -1.0; + } + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_loop + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 5; i++) + a = -a; + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_break + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + a = -a; + if (i == 4) + break; + } + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_continue + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + if (i == 4) + continue; + a = -a; + } + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_nested_loop + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + a = -a; + for (int j = 0; j < 4; j++) + { + a = -a; + if (i == 1) + return a; + } + if (i == 4) + return 1.0; + } + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_loop_sequence + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + int i; + for (i = 0; i < 6; i++) // negate a + { + a = -a; + if (i == 4) + a = -a; + } + + for (; i < 10; i++) // keep a + { + if (i == 8) + continue; + else if (i == 9) + break; + a = -a; + } + + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case mixed_return_break_continue + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + int i; + for (i = 0; i < 6; i++) + { + if (i == 0) + continue; + else if (i == 1) + { + } + else if (i == 3) + break; + else + return a; + a = -a; + } + + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + +end # control_flow + +group misc "Miscellaneous" + + case multi_arg_float + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; # -sum(in0) + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float sum(vec4 v) { return (v.x + v.y + v.z + v.w); } + + float func (float a, vec3 b, vec2 c, vec2 d, vec4 e) + { + return -sum(vec4(a, b) + vec4(c, d)) + sum(e); + } + + void main() + { + ${SETUP} + out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0); + ${OUTPUT} + } + "" + end + + case multi_arg_int + version 300 es + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int sum(ivec4 v) { return (v.x + v.y + v.z + v.w); } + + int func (int a, ivec3 b, ivec2 c, ivec2 d, ivec4 e) + { + return -sum(ivec4(a, b) + ivec4(c, d)) + sum(e); + } + + void main() + { + ${SETUP} + out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0); + ${OUTPUT} + } + "" + end + + case argument_eval_order_1 + version 300 es + values + { + input int in0 = [ 0 | 1 | 3 | 5 ]; + output int out0 = [ -1 | 5 | 11 | 17 ]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + int func (float a, int b, bool c, int d) + { + if (c) + return b + int(a) + d; + else + return -1; + } + + void main () + { + ${SETUP} + float v0 = float(in0); + int v1 = in0; + out0 = func((v0 += 1.0), v1++, (v0 > 1.5), v1); + ${OUTPUT} + } + "" + end + + case argument_eval_order_2 + version 300 es + values + { + input int in0 = [ 0 | -1 | 3 | 5 ]; + output int out0 = [ 3 | -1 | 9 | 13 ]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + int g; + + int modG (int v) + { + g += v; + return v; + } + + int func (float a, int b, bool c, int d) + { + if (c) + return b + int(a) + d; + else + return -1; + } + + void main () + { + ${SETUP} + out0 = func(float(g = in0), modG(2), --g > 0, g); + ${OUTPUT} + } + "" + end + +end # misc + +group invalid "Invalid Functions" + case break_in_body + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func () + { + break; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case continue_in_body + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func () + { + continue; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_value_from_void_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func () + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case extra_arguments + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (float f) + { + } + + void main () + { + func(1.0, 2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_arguments + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (float f) + { + } + + void main () + { + func(); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_argument_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (in f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_basetype_mismatch + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (float f) + { + } + + void main () + { + func(2); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_scalar_vector_mismatch + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec2 f) + { + } + + void main () + { + func(2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_vector_size_mismatch + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + } + + void main () + { + func(vec2(2.0)); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case duplicate_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f); + + void func (vec3 f) + { + } + + void func (vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f); + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + float func (vec3 f) + { + return f.x; + } + "" + end + + case prototype_unspecified_array_size + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f[]); + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_mismatch_argument_array_size + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f[3]); + void func (vec3 f[3]) + { + } + + void main () + { + vec3 array[4]; + func(array); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_argument_const + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f); + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_argument_array_const + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f[3]); + void func (const vec3 f[3]) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_array_inout + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (out vec3 f); + void func (inout vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + func (float f); + func (inout vec3 f[3]) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_before_definition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + func(1.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + void func (float f) + { + } + + "" + end + + case argument_precision_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (lowp float f) + { + return f; + } + + float func (mediump float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_in_out_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (in float f) + { + } + + void func (out float f) + { + f = 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_in_inout_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (in float f) + { + } + + void func (inout float f) + { + f = -f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_out_inout_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (out float f) + { + f = -1.0; + } + + void func (inout float f) + { + f = -f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f) + { + return f; + } + + int func (float f) + { + return int(f); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_precision_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + lowp float func (float f) + { + return f; + } + + mediump float func (float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_const_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f) + { + return f; + } + + const float func (float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_without_value + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f) + { + return; + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_prototype + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float func (float f); + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_definition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float func (float f) + { + return 1.0; + } + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case name_type_conflict + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct foo { float a; } + + float foo (float f) + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case const_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + } + + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + uniform float u; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case in_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + in float v; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case out_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + in float a; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case inout_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + inout float a; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_argument + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (uniform vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + uniform float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case in_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + in float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0))); + } + "" + end + + case out_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + out float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0))); + } + "" + end + + case inout_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + inout float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0))); + } + "" + end + + case main_invalid_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_has_arguments + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main (float f) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_missing_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_arg + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const float f) + { + f = 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_array_arg + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const float f[3]) + { + f[0] = 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case use_const_arg_in_const_expr + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const int i) + { + const int z = i+1; + return float(z); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(1)); + } + "" + end + + case use_const_arg_as_array_size + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const int i) + { + float f[i]; + f[0] = 1.0; + return f[0]; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(1)); + } + "" + end + + case overload_builtin_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int sin (int x) + { + return int(sin(float(x))); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(sin(1)); + } + "" + end + + case redefine_builtin_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float sin (float x) + { + return 0.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case basic_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float fib (float x) + { + if (x <= 1.0) + return x; + else + return fib(x-2.0) + fib(x-1.0); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(fib(5.0)); + } + "" + end + + case simple_tail_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float rec (float x) + { + if (x <= 0.0) + return 0.0; + else + return rec(x-1.0); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(rec(5.0)); + } + "" + end + + case dynamic_conditional_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float ua; + uniform float ub; + + float funcA (float x); + float funcB (float x); + + float funcA (float x) + { + if (ub+x > 0.0) + funcB(x*2.0); + else + return ub; + } + + float funcB (float x) + { + return sqrt(funcA(x)); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(funcB(ua)); + } + "" + end + + case dynamic_loop_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float ua; + uniform float ub; + + float funcA (float x); + float funcB (float x); + + float funcA (float x) + { + for (float z = 0.0; z < ub+x; z++) + { + if (z > 2.0) + funcB(z*2.0); + else + return z; + } + } + + float funcB (float x) + { + return sqrt(funcA(x)); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(funcB(ua)); + } + "" + end + + case dynamic_switch_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float ua; + uniform mediump int ub; + + float funcA (float x); + float funcB (float x); + + float funcA (float x) + { + switch (ub + int(x)) + { + case 0: return ua-1.0; + case 1: return ua; + case 2: return funcB(x*2.0); + default: return 0.0; + } + } + + float funcB (float x) + { + return sqrt(funcA(x)); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(funcB(ua)); + } + "" + end + + case modify_const_arg + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case init_const_local_from_const_arg + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + const int b = -a; + return 2 * b; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case array_size_from_const_arg + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + int arr[a]; + arr[1] = 3; + return arr[1]; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html new file mode 100644 index 000000000..98c13381d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test new file mode 100644 index 000000000..10d65b22e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test @@ -0,0 +1,1143 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +case texture_sampler3dshadow_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler3DShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texture(s, vec4(0))); + ${OUTPUT} + } + "" +end +case texture_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texture(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_samplercube_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_isamplercube_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_usamplercube_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_samplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_isamplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_usamplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_sampler2darrayshadow_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case texturelod_samplercubeshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case texturelod_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_isamplercube_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_usamplercube_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_isamplercube_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_usamplercube_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec2_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec3_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darray_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darray_vec3_ivec3_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercubeshadow_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercubeshadow_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darrayshadow_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darrayshadow_vec4_ivec2_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0), float(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercube_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_isamplercube_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_usamplercube_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2dshadow_ivec2_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec2(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercubeshadow_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2darrayshadow_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercube_ivec3_int_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2dshadow_ivec2_int_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec2(0), int(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercubeshadow_ivec3_int_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2darrayshadow_ivec3_int_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_samplercube_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_samplercube_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_samplercubeshadow_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_sampler2darrayshadow_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_sampler2darrayshadow_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_samplercube_vec3_float_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_samplercube_vec3_float_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_samplercubeshadow_vec3_float_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_sampler2darrayshadow_vec3_float_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_sampler2darrayshadow_vec3_float_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojlod_samplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureprojlod_sampler2darray_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureprojlod_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case texturegrad_sampler2darray_vec3_vec3_vec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGrad(s, vec3(0), vec3(0), vec3(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercube_vec3_vec3_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec3(0), vec3(0), vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercube_vec3_vec3_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec3(0), vec3(0), vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercubeshadow_vec4_vec3_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec4(0), vec3(0), vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercubeshadow_vec4_vec3_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec4(0), vec3(0), vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojgrad_samplercube_vec4_vec3_vec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGrad(s, vec4(0), vec3(0), vec3(0))); + ${OUTPUT} + } + "" +end +case textureprojgrad_sampler2darray_vec4_vec2_vec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGrad(s, vec4(0), vec2(0), vec2(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_samplercube_vec4_vec3_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec3(0), vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_samplercube_vec4_vec3_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec3(0), vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_sampler2darray_vec4_vec2_vec2_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec2(0), vec2(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_sampler2darray_vec4_vec2_vec2_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec2(0), vec2(0), ivec3(0))); + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html new file mode 100644 index 000000000..5899a9a27 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test new file mode 100644 index 000000000..b588cd74e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test @@ -0,0 +1,3219 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group keywords "Usage of keywords as identifiers." + + case const + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float const = 1.0; + ${OUTPUT} + } + "" + end + case uniform + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uniform = 1.0; + ${OUTPUT} + } + "" + end + case layout + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float layout = 1.0; + ${OUTPUT} + } + "" + end + case centroid + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float centroid = 1.0; + ${OUTPUT} + } + "" + end + case flat + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float flat = 1.0; + ${OUTPUT} + } + "" + end + case smooth + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float smooth = 1.0; + ${OUTPUT} + } + "" + end + case break + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float break = 1.0; + ${OUTPUT} + } + "" + end + case continue + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float continue = 1.0; + ${OUTPUT} + } + "" + end + case do + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float do = 1.0; + ${OUTPUT} + } + "" + end + case for + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float for = 1.0; + ${OUTPUT} + } + "" + end + case while + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float while = 1.0; + ${OUTPUT} + } + "" + end + case switch + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float switch = 1.0; + ${OUTPUT} + } + "" + end + case case + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float case = 1.0; + ${OUTPUT} + } + "" + end + case default + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float default = 1.0; + ${OUTPUT} + } + "" + end + case if + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float if = 1.0; + ${OUTPUT} + } + "" + end + case else + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float else = 1.0; + ${OUTPUT} + } + "" + end + case in + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float in = 1.0; + ${OUTPUT} + } + "" + end + case out + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float out = 1.0; + ${OUTPUT} + } + "" + end + case inout + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inout = 1.0; + ${OUTPUT} + } + "" + end + case float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float float = 1.0; + ${OUTPUT} + } + "" + end + case int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float int = 1.0; + ${OUTPUT} + } + "" + end + case void + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float void = 1.0; + ${OUTPUT} + } + "" + end + case bool + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bool = 1.0; + ${OUTPUT} + } + "" + end + case true + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float true = 1.0; + ${OUTPUT} + } + "" + end + case false + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float false = 1.0; + ${OUTPUT} + } + "" + end + case invariant + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float invariant = 1.0; + ${OUTPUT} + } + "" + end + case discard + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float discard = 1.0; + ${OUTPUT} + } + "" + end + case return + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float return = 1.0; + ${OUTPUT} + } + "" + end + case mat2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2 = 1.0; + ${OUTPUT} + } + "" + end + case mat3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3 = 1.0; + ${OUTPUT} + } + "" + end + case mat4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4 = 1.0; + ${OUTPUT} + } + "" + end + case mat2x2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2x2 = 1.0; + ${OUTPUT} + } + "" + end + case mat2x3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2x3 = 1.0; + ${OUTPUT} + } + "" + end + case mat2x4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2x4 = 1.0; + ${OUTPUT} + } + "" + end + case mat3x2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3x2 = 1.0; + ${OUTPUT} + } + "" + end + case mat3x3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3x3 = 1.0; + ${OUTPUT} + } + "" + end + case mat3x4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3x4 = 1.0; + ${OUTPUT} + } + "" + end + case mat4x2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4x2 = 1.0; + ${OUTPUT} + } + "" + end + case mat4x3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4x3 = 1.0; + ${OUTPUT} + } + "" + end + case mat4x4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4x4 = 1.0; + ${OUTPUT} + } + "" + end + case vec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec2 = 1.0; + ${OUTPUT} + } + "" + end + case vec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec3 = 1.0; + ${OUTPUT} + } + "" + end + case vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec4 = 1.0; + ${OUTPUT} + } + "" + end + case ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec2 = 1.0; + ${OUTPUT} + } + "" + end + case ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec3 = 1.0; + ${OUTPUT} + } + "" + end + case ivec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec4 = 1.0; + ${OUTPUT} + } + "" + end + case bvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec2 = 1.0; + ${OUTPUT} + } + "" + end + case bvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec3 = 1.0; + ${OUTPUT} + } + "" + end + case bvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec4 = 1.0; + ${OUTPUT} + } + "" + end + case uint + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uint = 1.0; + ${OUTPUT} + } + "" + end + case uvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uvec2 = 1.0; + ${OUTPUT} + } + "" + end + case uvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uvec3 = 1.0; + ${OUTPUT} + } + "" + end + case uvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uvec4 = 1.0; + ${OUTPUT} + } + "" + end + case lowp + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float lowp = 1.0; + ${OUTPUT} + } + "" + end + case mediump + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mediump = 1.0; + ${OUTPUT} + } + "" + end + case highp + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float highp = 1.0; + ${OUTPUT} + } + "" + end + case precision + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float precision = 1.0; + ${OUTPUT} + } + "" + end + case sampler2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2D = 1.0; + ${OUTPUT} + } + "" + end + case sampler3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3D = 1.0; + ${OUTPUT} + } + "" + end + case samplerCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerCube = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DShadow = 1.0; + ${OUTPUT} + } + "" + end + case samplerCubeShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerCubeShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DArray = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case isampler2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2D = 1.0; + ${OUTPUT} + } + "" + end + case isampler3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler3D = 1.0; + ${OUTPUT} + } + "" + end + case isamplerCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isamplerCube = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DArray = 1.0; + ${OUTPUT} + } + "" + end + case usampler2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2D = 1.0; + ${OUTPUT} + } + "" + end + case usampler3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler3D = 1.0; + ${OUTPUT} + } + "" + end + case usamplerCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usamplerCube = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DArray = 1.0; + ${OUTPUT} + } + "" + end + case struct + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float struct = 1.0; + ${OUTPUT} + } + "" + end + +end # keywords +group reserved_keywords "Usage of reserved keywords as identifiers." + + case attribute + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float attribute = 1.0; + ${OUTPUT} + } + "" + end + case varying + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float varying = 1.0; + ${OUTPUT} + } + "" + end + case coherent + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float coherent = 1.0; + ${OUTPUT} + } + "" + end + case restrict + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float restrict = 1.0; + ${OUTPUT} + } + "" + end + case readonly + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float readonly = 1.0; + ${OUTPUT} + } + "" + end + case writeonly + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float writeonly = 1.0; + ${OUTPUT} + } + "" + end + case resource + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float resource = 1.0; + ${OUTPUT} + } + "" + end + case atomic_uint + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float atomic_uint = 1.0; + ${OUTPUT} + } + "" + end + case noperspective + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float noperspective = 1.0; + ${OUTPUT} + } + "" + end + case patch + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float patch = 1.0; + ${OUTPUT} + } + "" + end + case sample + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sample = 1.0; + ${OUTPUT} + } + "" + end + case subroutine + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float subroutine = 1.0; + ${OUTPUT} + } + "" + end + case common + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float common = 1.0; + ${OUTPUT} + } + "" + end + case partition + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float partition = 1.0; + ${OUTPUT} + } + "" + end + case active + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float active = 1.0; + ${OUTPUT} + } + "" + end + case asm + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float asm = 1.0; + ${OUTPUT} + } + "" + end + case class + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float class = 1.0; + ${OUTPUT} + } + "" + end + case union + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float union = 1.0; + ${OUTPUT} + } + "" + end + case enum + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float enum = 1.0; + ${OUTPUT} + } + "" + end + case typedef + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float typedef = 1.0; + ${OUTPUT} + } + "" + end + case template + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float template = 1.0; + ${OUTPUT} + } + "" + end + case this + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float this = 1.0; + ${OUTPUT} + } + "" + end + case goto + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float goto = 1.0; + ${OUTPUT} + } + "" + end + case inline + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inline = 1.0; + ${OUTPUT} + } + "" + end + case noinline + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float noinline = 1.0; + ${OUTPUT} + } + "" + end + case volatile + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float volatile = 1.0; + ${OUTPUT} + } + "" + end + case public + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float public = 1.0; + ${OUTPUT} + } + "" + end + case static + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float static = 1.0; + ${OUTPUT} + } + "" + end + case extern + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float extern = 1.0; + ${OUTPUT} + } + "" + end + case external + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float external = 1.0; + ${OUTPUT} + } + "" + end + case interface + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float interface = 1.0; + ${OUTPUT} + } + "" + end + case long + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float long = 1.0; + ${OUTPUT} + } + "" + end + case short + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float short = 1.0; + ${OUTPUT} + } + "" + end + case double + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float double = 1.0; + ${OUTPUT} + } + "" + end + case half + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float half = 1.0; + ${OUTPUT} + } + "" + end + case fixed + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fixed = 1.0; + ${OUTPUT} + } + "" + end + case unsigned + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float unsigned = 1.0; + ${OUTPUT} + } + "" + end + case superp + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float superp = 1.0; + ${OUTPUT} + } + "" + end + case input + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float input = 1.0; + ${OUTPUT} + } + "" + end + case output + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float output = 1.0; + ${OUTPUT} + } + "" + end + case hvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec2 = 1.0; + ${OUTPUT} + } + "" + end + case hvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec3 = 1.0; + ${OUTPUT} + } + "" + end + case hvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec4 = 1.0; + ${OUTPUT} + } + "" + end + case dvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec2 = 1.0; + ${OUTPUT} + } + "" + end + case dvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec3 = 1.0; + ${OUTPUT} + } + "" + end + case dvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec4 = 1.0; + ${OUTPUT} + } + "" + end + case fvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec2 = 1.0; + ${OUTPUT} + } + "" + end + case fvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec3 = 1.0; + ${OUTPUT} + } + "" + end + case fvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec4 = 1.0; + ${OUTPUT} + } + "" + end + case sampler3DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3DRect = 1.0; + ${OUTPUT} + } + "" + end + case filter + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float filter = 1.0; + ${OUTPUT} + } + "" + end + case image1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1D = 1.0; + ${OUTPUT} + } + "" + end + case image2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2D = 1.0; + ${OUTPUT} + } + "" + end + case image3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image3D = 1.0; + ${OUTPUT} + } + "" + end + case imageCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float imageCube = 1.0; + ${OUTPUT} + } + "" + end + case iimage1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage1D = 1.0; + ${OUTPUT} + } + "" + end + case iimage2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage2D = 1.0; + ${OUTPUT} + } + "" + end + case iimage3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage3D = 1.0; + ${OUTPUT} + } + "" + end + case iimageCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimageCube = 1.0; + ${OUTPUT} + } + "" + end + case uimage1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage1D = 1.0; + ${OUTPUT} + } + "" + end + case uimage2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage2D = 1.0; + ${OUTPUT} + } + "" + end + case uimage3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage3D = 1.0; + ${OUTPUT} + } + "" + end + case uimageCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimageCube = 1.0; + ${OUTPUT} + } + "" + end + case image1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1DArray = 1.0; + ${OUTPUT} + } + "" + end + case image2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2DArray = 1.0; + ${OUTPUT} + } + "" + end + case iimage1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage1DArray = 1.0; + ${OUTPUT} + } + "" + end + case iimage2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage2DArray = 1.0; + ${OUTPUT} + } + "" + end + case uimage1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage1DArray = 1.0; + ${OUTPUT} + } + "" + end + case uimage2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage2DArray = 1.0; + ${OUTPUT} + } + "" + end + case image1DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1DShadow = 1.0; + ${OUTPUT} + } + "" + end + case image2DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2DShadow = 1.0; + ${OUTPUT} + } + "" + end + case image1DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case image2DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case imageBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float imageBuffer = 1.0; + ${OUTPUT} + } + "" + end + case iimageBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimageBuffer = 1.0; + ${OUTPUT} + } + "" + end + case uimageBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimageBuffer = 1.0; + ${OUTPUT} + } + "" + end + case sampler1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1D = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DArray = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case isampler1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler1D = 1.0; + ${OUTPUT} + } + "" + end + case isampler1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler1DArray = 1.0; + ${OUTPUT} + } + "" + end + case usampler1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler1D = 1.0; + ${OUTPUT} + } + "" + end + case usampler1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler1DArray = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRectShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRectShadow = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case samplerBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerBuffer = 1.0; + ${OUTPUT} + } + "" + end + case isamplerBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isamplerBuffer = 1.0; + ${OUTPUT} + } + "" + end + case usamplerBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usamplerBuffer = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DMS + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DMS = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DMS + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DMS = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DMS + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DMS = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DMSArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DMSArray = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DMSArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DMSArray = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DMSArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DMSArray = 1.0; + ${OUTPUT} + } + "" + end + case sizeof + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sizeof = 1.0; + ${OUTPUT} + } + "" + end + case cast + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float cast = 1.0; + ${OUTPUT} + } + "" + end + case namespace + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float namespace = 1.0; + ${OUTPUT} + } + "" + end + case using + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float using = 1.0; + ${OUTPUT} + } + "" + end + +end # reserved_keywords +group invalid_identifiers "Usage of invalid identifiers." + + case gl_begin + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float gl_Invalid = 1.0; + ${OUTPUT} + } + "" + end + case digit + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0123 = 1.0; + ${OUTPUT} + } + "" + end + case digit_begin + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0invalid = 1.0; + ${OUTPUT} + } + "" + end + case max_length + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdX = 1.0; + ${OUTPUT} + } + "" + end + +end # invalid_identifiers diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html new file mode 100644 index 000000000..c6ebbbc05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test new file mode 100644 index 000000000..4cdaa0618 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test @@ -0,0 +1,3833 @@ + +# Varying tests +group varying "Varying linkage" + + # Linking rules + group rules "Varying linking rules" + # not declared in vertex shader, declared in fragment shader + case fragment_declare + version 300 es + desc "varying declared in fragment shader, no reference in vertex shader" + values { output float out0 = 1.0; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" + end + + # declared in vertex shader, no reference in frag shader + case vertex_declare + version 300 es + desc "varying declared in vertex shader, no reference in fragment shader" + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # declared in vertex shader, declared in frag shader + case both_declare + version 300 es + desc "varying declared in both vertex and fragment shader, but not used" + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # declared in vertex shader, static use in frag shader + case vertex_declare_fragment_use + version 300 es + desc "varying declared in both shaders, statically used in fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + if (u_false) + ${FRAG_COLOR} = vec4(var); + else + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # static use in vertex shader, no reference in fragment shader + case vertex_use_fragment_declare + version 300 es + desc "varying declared and statically used in vertex shader, no reference in fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # static use in vertex shader, declared in fragment shader + case vertex_use_declare_fragment + version 300 es + desc "varying declared and statically used in vertex shader, only declared in fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # static use in vertex shader, used in fragment shader + case vertex_use_fragment_use + version 300 es + desc "varying statically used in both vertex and fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + if (u_false) + ${FRAG_COLOR} = vec4(var); + else + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # differing precision tests + case differing_precision_1 + version 300 es + desc "varying declared as highp in vertex shader, but mediump in fragment shader" + values + { + input float in0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out highp float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + # differing precision tests + case differing_precision_2 + version 300 es + desc "varying declared as highp in vertex shader, but lowp in fragment shader" + values + { + input float in0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out highp vec2 var; + void main() + { + var = vec2(in0, 2.0*in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in lowp vec2 var; + void main() + { + out0 = var.y - var.x; + ${FRAGMENT_OUTPUT} + } + "" + end + + # differing precision tests + case differing_precision_3 + version 300 es + desc "varying declared as lowp in vertex shader, but mediump in fragment shader" + values + { + input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out lowp vec4 var; + void main() + { + var = vec4(in0, 2.0*in0, -in0, -in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump vec4 var; + void main() + { + out0 = var.x + var.y + var.z + var.w; + ${FRAGMENT_OUTPUT} + } + "" + end + + # mismatched type, static use but no runtime use in the fragment shader + case type_mismatch_1 + version 300 es + desc "varying type mismatch (float vs. vec2), static use but no runtime use in the fragment shader" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump vec2 var; + void main() + { + if (false) + { + ${FRAG_COLOR} = vec4(var.y); + } + else + { + ${FRAG_COLOR} = vec4(1.0); + } + } + "" + end + + # mismatched type, varyings used + case type_mismatch_2 + version 300 es + desc "varying type mismatch (float vs. vec2)" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump vec2 var; + void main() + { + ${FRAG_COLOR} = var.xyyx; + } + "" + end + + # mismatched type, varyings used + case type_mismatch_3 + version 300 es + desc "varying type mismatch (int vs. uint)" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump int var; + void main() + { + var = 2; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in mediump uint var; + void main() + { + ${FRAG_COLOR} = vec4(var); + } + "" + end + + # mismatched type, varyings used + case struct_type_mismatch_1 + version 300 es + desc "struct member mismatch" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { highp float a; highp vec2 b; }; + out S var; + void main() + { + var.a = 2.0; + var.b = vec2(1.0, 0.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { highp float a; highp vec3 b; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(var.a, var.b); + } + "" + end + + # mismatched type, varyings unused in fragment shader (runtime) + case struct_type_mismatch_2 + version 300 es + desc "struct member mismatch" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { highp float a; highp vec2 b; }; + out S var; + void main() + { + var.a = 2.0; + var.b = vec2(1.0, 0.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { highp float a; highp vec3 b; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(var.a); + if (false) + ${FRAG_COLOR}.yzw = var.b; + } + "" + end + + # mismatched type, varyings unused in both (runtime) + case struct_type_mismatch_3 + version 300 es + desc "struct member mismatch" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { highp float a; highp vec2 b; }; + out S var; + void main() + { + var.a = 2.0; + if (false) + var.b = vec2(1.0, 0.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { highp float a; highp vec3 b; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(var.a); + if (false) + ${FRAG_COLOR}.yzw = var.b; + } + "" + end + + # interpolation_mismatch + case interpolation_mismatch_1 + version 300 es + desc "varying interpolation different (flat vs. smooth)" + expect link_fail + + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + in highp float in0; + flat out mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + ${FRAG_COLOR} = vec4(var); + } + "" + end + + # different interpolation + case differing_interpolation_2 + version 300 es + desc "varying interpolation different (smooth vs. centroid)" + values + { + input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + smooth out mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + centroid in mediump float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + # no declaration in vertex shader, but static use in fragment + case illegal_usage_1 + version 300 es + desc "varying not declared in vertex shader, but statically used in fragment shader" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + ${FRAG_COLOR} = vec4(var); + } + "" + end + + # non-flat integer varyings not allowed + case invalid_type_int + version 300 es + desc "integer varying used" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump int var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump int var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # non-flat integer varyings not allowed + case invalid_type_uint + version 300 es + desc "integer varying used" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump uint var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump uint var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # bool varyings not allowed + case invalid_type_bool + version 300 es + desc "boolean varying used" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out bool var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in bool var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_struct_array + version 300 es + desc "float array inside struct" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a[3]; }; + out S var; + void main() + { + var.a[0] = 1.0; + var.a[1] = 1.0; + var.a[2] = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a[3]; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_struct_struct + version 300 es + desc "struct inside struct" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; }; + struct T { S s; }; + out T var; + void main() + { + var.s.a = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; }; + struct T { S s; }; + in T var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_array_struct + version 300 es + desc "array of structs" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump int a; }; + flat out S var[2]; + void main() + { + ${VERTEX_SETUP} + var[0].a = 1; + var[1].a = 1; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump int a; }; + flat in S var[2]; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_array_array + version 300 es + desc "array of arrays" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var[2][2]; + void main() + { + ${VERTEX_SETUP} + var[0][0] = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump float var[2][2]; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + end + + group basic_types "Basic varying types" + case float + version 300 es + desc "varying of type float" + values + { + input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec2 + version 300 es + desc "varying of type vec2" + values + { + input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump vec2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in vec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec3 + version 300 es + desc "varying of type vec3" + values + { + input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump vec3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in vec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4 + version 300 es + desc "varying of type vec4" + values + { + input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2 + version 300 es + desc "varying of type mat2" + values + { + input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x3 + version 300 es + desc "varying of type mat2x3" + values + { + input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat2x3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat2x3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x4 + version 300 es + desc "varying of type mat2x4" + values + { + input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat2x4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat2x4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x2 + version 300 es + desc "varying of type mat3x2" + values + { + input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat3x2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat3x2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3 + version 300 es + desc "varying of type mat3" + values + { + input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x4 + version 300 es + desc "varying of type mat3x4" + values + { + input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat3x4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat3x4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x2 + version 300 es + desc "varying of type mat4x2" + values + { + input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat4x2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat4x2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x3 + version 300 es + desc "varying of type mat4x3" + values + { + input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat4x3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat4x3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4 + version 300 es + desc "varying of type mat4" + values + { + input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case int + version 300 es + desc "varying of type int" + values + { + input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump int var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in int var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec2 + version 300 es + desc "varying of type ivec2" + values + { + input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump ivec2 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in ivec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec3 + version 300 es + desc "varying of type ivec3" + values + { + input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump ivec3 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in ivec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec4 + version 300 es + desc "varying of type ivec4" + values + { + input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump ivec4 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in ivec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uint + version 300 es + desc "varying of type int" + values + { + input uint in0 = [ 1 | 2 | 3 | 16 ]; + output uint out0 = [ 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uint var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uint var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec2 + version 300 es + desc "varying of type uvec2" + values + { + input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uvec2 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uvec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec3 + version 300 es + desc "varying of type uvec3" + values + { + input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uvec3 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uvec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec4 + version 300 es + desc "varying of type uvec4" + values + { + input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uvec4 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uvec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group struct "Structure varyings" + case float + version 300 es + desc "varying of type float inside struct" + values + { + input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec2 + version 300 es + desc "varying of type vec2 inside struct" + values + { + input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump vec2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump vec2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec3 + version 300 es + desc "varying of type vec3 inside struct" + values + { + input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump vec3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump vec3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4 + version 300 es + desc "varying of type vec4 inside struct" + values + { + input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump vec4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump vec4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2 + version 300 es + desc "varying of type mat2 inside struct" + values + { + input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x3 + version 300 es + desc "varying of type mat2x3 inside struct" + values + { + input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat2x3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat2x3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x4 + version 300 es + desc "varying of type mat2x4 inside struct" + values + { + input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat2x4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat2x4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x2 + version 300 es + desc "varying of type mat3x2 inside struct" + values + { + input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat3x2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat3x2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3 + version 300 es + desc "varying of type mat3 inside struct" + values + { + input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x4 + version 300 es + desc "varying of type mat3x4 inside struct" + values + { + input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat3x4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat3x4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x2 + version 300 es + desc "varying of type mat4x2 inside struct" + values + { + input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat4x2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat4x2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x3 + version 300 es + desc "varying of type mat4x3 inside struct" + values + { + input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat4x3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat4x3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4 + version 300 es + desc "varying of type mat4 inside struct" + values + { + input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case int + version 300 es + desc "varying of type int inside struct" + values + { + input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump int a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump int a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec2 + version 300 es + desc "varying of type ivec2 inside struct" + values + { + input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump ivec2 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump ivec2 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec3 + version 300 es + desc "varying of type ivec3 inside struct" + values + { + input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump ivec3 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump ivec3 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec4 + version 300 es + desc "varying of type ivec4 inside struct" + values + { + input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump ivec4 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump ivec4 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uint + version 300 es + desc "varying of type uint in struct" + values + { + input uint in0 = [ 1 | 2 | 3 | 16 ]; + output uint out0 = [ 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uint a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uint a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec2 + version 300 es + desc "varying of type uvec2 inside struct" + values + { + input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uvec2 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uvec2 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec3 + version 300 es + desc "varying of type uvec3 inside struct" + values + { + input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uvec3 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uvec3 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec4 + version 300 es + desc "varying of type uvec4 inside struct" + values + { + input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uvec4 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uvec4 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case float_vec3 + version 300 es + desc "varyings of type float and vec3 inside struct" + values + { + input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + input vec3 in1 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + output vec3 out1 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; highp vec3 b; }; + out S var; + void main() + { + var.a = in0; + var.b = in1; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; highp vec3 b; }; + in S var; + void main() + { + out0 = var.a; + out1 = var.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case float_uvec2_vec3 + version 300 es + desc "varyings of type float and vec3 inside struct" + values + { + input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + input uvec2 in1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ]; + output uvec2 out1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ]; + input vec3 in2 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + output vec3 out2 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; highp uvec2 b; highp vec3 c; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + var.b = in1; + var.c = in2; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; highp uvec2 b; highp vec3 c; }; + flat in S var; + void main() + { + out0 = var.a; + out1 = var.b; + out2 = var.c; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group interpolation "Varying interpolation modes" + case smooth + version 300 es + desc "varying of type vec4" + values + { + input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + smooth out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + smooth in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case centroid + version 300 es + desc "varying of type vec4" + values + { + input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + centroid out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + centroid in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case flat + version 300 es + desc "varying of type vec4" + values + { + input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + flat in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group usage "Varying usage in shaders" + case readback_1 + version 300 es + desc "read back (an already written) varying in the vertex shader" + values + { + input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ]; + output float out0 = [ 3.0 | 0.0 | -6.0 | 30.0 ]; + } + vertex "" + #version 300 es + precision mediump float; + ${VERTEX_DECLARATIONS} + out float var1; + out float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float var1; + in float var2; + + void main() + { + out0 = var1 + var2; + ${FRAGMENT_OUTPUT} + } + "" + end + + case writeback_1 + version 300 es + desc "write back a varying in the fragment shader" + values + { + input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ]; + } + expect compile_fail + vertex "" + #version 300 es + precision mediump float; + ${VERTEX_DECLARATIONS} + out float var1; + out float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float var1; + in float var2; + + void main() + { + var2 = var1; + out0 = var1; + ${FRAGMENT_OUTPUT} + } + "" + end + end +end + +group uniform "Uniform linkage" + group basic "Default block uniforms of scalar and vector types" + case precision_conflict_1 + version 300 es + desc "Vertex side uniform has highp, fragment side uniform mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform highp float u_val; + out mediump float res; + void main() + { + res = u_val; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + uniform float u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = u_val + res; + ${FRAGMENT_OUTPUT} + } + "" + end + case precision_conflict_2 + version 300 es + desc "Vertex side uniform has highp, fragment side uniform mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform highp float u_val; + out mediump float res; + void main() + { + res = u_val; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision highp float; + uniform mediump float u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = u_val + res; + ${FRAGMENT_OUTPUT} + } + "" + end + case precision_conflict_3 + version 300 es + desc "Vertex side uniform has lowp, fragment side uniform highp." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform lowp int u_val; + out mediump float res; + void main() + { + res = float(u_val); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision highp float; + uniform highp int u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = float(u_val) + res; + ${FRAGMENT_OUTPUT} + } + "" + end + case precision_conflict_4 + version 300 es + desc "Vertex side uniform has lowp, fragment side uniform mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform lowp vec3 u_val; + out mediump float res; + void main() + { + res = u_val.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision highp float; + uniform mediump vec3 u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = u_val.z + res; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group struct "Uniform structs" + # Struct linkage handling + case basic + version 300 es + desc "Same uniform struct in both shaders" + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b + val.a; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only + version 300 es + desc "Uniform struct declared in both, used only in vertex." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only + version 300 es + desc "Uniform struct declared in both, used only in fragment." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a + val.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial + version 300 es + desc "Uniform struct declared in both, used partially in both." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4 + version 300 es + desc "Same uniform struct in both shaders. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only_vec4 + version 300 es + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 " + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only_vec4 + version 300 es + desc "Uniform struct declared in both, used only in fragment. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = val.a.x + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec4 + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4_vec3 + version 300 es + desc "Same uniform struct in both shaders. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only_vec4_vec3 + version 300 es + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only_vec4_vec3 + version 300 es + desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = val.a.x + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec4_vec3 + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4_float + version 300 es + desc "Same uniform struct in both shaders. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = val.b + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only_vec4_float + version 300 es + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only_vec4_float + version 300 es + desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = val.a.x + val.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec4_float + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec4_struct + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b.c = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec4_vec3_struct + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b.c = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec2_vec3 + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype vec2 and vec3" + values { + uniform vec2 val.a = vec2(1.0, 2.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec2_int + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype vec2 and int" + values { + uniform vec2 val.a = vec2(1.0, 2.0); + uniform int val.b = 2; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_int_float + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype int and float" + values { + uniform float val.a = 1.0; + uniform int val.b = 2; + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_bvec2_vec2 + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype bvec2 and vec2" + values { + uniform bvec2 val.a = bvec2(true, true); + uniform vec2 val.b = vec2(1.0, 2.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_ivec2_vec2 + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and vec2" + values { + uniform ivec2 val.a = ivec2(1, 2); + uniform vec2 val.b = vec2(1.0, 2.0); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_ivec2_ivec2 + version 300 es + desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and ivec2" + values { + uniform ivec2 val.a = ivec2(1, 2); + uniform ivec2 val.b = ivec2(1, 2); + output float out0 = 3.0; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + vec2(val.b).y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case type_conflict_1 + version 300 es + desc "Fragment struct has one less member than fragment version" + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case type_conflict_2 + version 300 es + desc "Vertex struct has int, fragment struct has float." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump int a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = float(val.a); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case type_conflict_3 + version 300 es + desc "Vertex struct has vec3, fragment struct has vec4." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec3 a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a.x; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_1 + version 300 es + desc "Vertex side struct has highp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {highp float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_2 + version 300 es + desc "Vertex side struct has mediump, fragment side struct lowp." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {lowp float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_3 + version 300 es + desc "Vertex side struct has lowp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_4 + version 300 es + desc "Vertex side struct has lowp, fragment side struct implicit mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case light_struct_highp + version 300 es + desc "Complex Light struct from use case tests." + values { + uniform float val.constantAttenuation = 1.0; + uniform float val.quadraticAttenuation = 1.0; + output float out0 = 2.0; + } + vertex "" + #version 300 es + struct Light + { + mediump vec3 color; + highp vec4 position; + highp vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + ${VERTEX_DECLARATIONS} + uniform Light val; + out mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Light + { + mediump vec3 color; + highp vec4 position; + highp vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + struct Struct {float a;}; + uniform Light val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" + end + + case light_struct_mediump + version 300 es + desc "Complex Light struct from use case tests, without highp usage" + values { + uniform float val.constantAttenuation = 1.0; + uniform float val.quadraticAttenuation = 1.0; + output float out0 = 2.0; + } + vertex "" + #version 300 es + struct Light + { + mediump vec3 color; + mediump vec4 position; + mediump vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + ${VERTEX_DECLARATIONS} + uniform Light val; + out mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Light + { + mediump vec3 color; + mediump vec4 position; + mediump vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + struct Struct {float a;}; + uniform Light val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group block "Uniform blocks" + case type_mismatch + version 300 es + expect link_fail + vertex "" + #version 300 es + + uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + uniform Block + { + highp vec3 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val, 1.0); + } + "" + end + + case members_mismatch + version 300 es + expect link_fail + vertex "" + #version 300 es + + uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + uniform Block + { + highp vec4 val; + lowp uint u; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val); + } + "" + end + + case layout_qualifier_mismatch_2 + version 300 es + expect compile_fail + vertex "" + #version 300 es + + layout(shared) uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + layout(packed) uniform Block + { + highp vec4 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val); + } + "" + end + + case layout_qualifier_mismatch_3 + version 300 es + expect link_fail + vertex "" + #version 300 es + + layout(row_major) uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + layout(column_major) uniform Block + { + highp vec4 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val); + } + "" + end + + case layout_qualifier_mismatch_4 + version 300 es + expect link_fail + vertex "" + #version 300 es + + layout(row_major) uniform Block + { + highp mat3 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val[0][1]; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + layout(column_major) uniform Block + { + highp mat3 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val[2], 1.0); + } + "" + end + + case layout_qualifier_mismatch_5 + version 300 es + expect link_fail + vertex "" + #version 300 es + + uniform Block + { + layout(row_major) uniform highp mat3 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val[0][1]; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + uniform Block + { + layout(column_major) uniform highp mat3 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val[2], 1.0); + } + "" + end + end +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html new file mode 100644 index 000000000..89236e542 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test new file mode 100644 index 000000000..c7b86eded --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test @@ -0,0 +1,100 @@ +# Generic invalid cases that don't fall into other categories + +group c_cast "C-style casts" + + case float_0 + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + float a = 0.0; + float b = (float)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case float_1 + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + int a = 0; + float b = (float)a; + ${POSITION_FRAG_COLOR} = vec4(b); + } + "" + end + + case float_2 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + highp float a = 0.0; + mediump float b = (mediump float)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case int + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + float a = 0.0; + int b = (int)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case uint + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + float a = 0.0; + uint b = (uint)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case bool + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + int a = 1; + bool b = (bool)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + +end # casts diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html new file mode 100644 index 000000000..f472cec46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test new file mode 100644 index 000000000..ebe385196 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test @@ -0,0 +1,5256 @@ +group basic "Basic Tests" + + case correct_phases + version 300 es + expect compile_fail + both "" + #version 300 es + #define e +1 + ${DECLARATIONS} + void main() + { + mediump int n = 1e; + ${OUTPUT} + } + "" + end + + case invalid_identifier + version 300 es + expect compile_fail + both "" + #version 300 es + #define e +1 + ${DECLARATIONS} + void main() + { + mediump int 1xyz = 1; + ${OUTPUT} + } + "" + end + + case null_directive + version 300 es + values { output float out0 = 0.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # + # // comment + /*sfd*/ # /* */ + + void main() + { + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case invalid_directive + version 300 es + expect compile_fail + both "" + #version 300 es + #defin AAA + ${DECLARATIONS} + + void main() + { + ${OUTPUT} + } + "" + end + + case missing_identifier + version 300 es + expect compile_fail + both "" + #version 300 es + #define + ${DECLARATIONS} + + void main() + { + ${OUTPUT} + } + "" + end + + case empty_object + version 300 es + values { output float out0 = -1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # define VALUE + + void main() + { + out0 = VALUE - 1.0; + ${OUTPUT} + } + "" + end + + case empty_function + version 300 es + values { output float out0 = -1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # define VALUE(a) + + void main() + { + out0 = VALUE(2.0) - 1.0; + ${OUTPUT} + } + "" + end + + case empty_directive + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # + + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case identifier_with_double_underscore + values { output float out0 = 1.0; } + version 300 es + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define __VALUE__ 1 + + void main() + { + // __VALUE__ not used since it might be set by an "underlying software layer" + out0 = float(1.0); + ${OUTPUT} + } + "" + end +end # basic + +group definitions "Symbol Definition Tests" + + case define_value_and_function + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS:single-line} + # define VALUE (1.5 + 2.5) + # define FUNCTION(__LINE__, b) __LINE__+b + + void main() + { + out0 = FUNCTION(VALUE, ((0.2) + 1.8) ); + ${OUTPUT} + } + "" + end + + case undefine_object_invalid_syntax + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define VAL 2.0 + #undef VAL sdflkjfds + #define VAL 1.0 + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VAL); + } + "" + end + + case undefine_invalid_object_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef __LINE__ + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__LINE__); + } + "" + end + + case undefine_invalid_object_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef __FILE__ + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__FILE__); + } + "" + end + + case undefine_invalid_object_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef __VERSION__ + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__VERSION__); + } + "" + end + + case undefine_invalid_object_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef GL_ES + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(GL_ES); + } + "" + end + + case undefine_function + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + #define FUNCTION(a,b) a+b + #undef FUNCTION + #define FUNCTION(a,b) a-b + ${DECLARATIONS} + + void main() + { + out0 = FUNCTION(3.0, 2.0); + ${OUTPUT} + } + "" + end + +end # definitions + +group invalid_definitions "Invalid Definition Tests" + + case define_non_identifier + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define 123 321 + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef 123 + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef foo.bar + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + +end # invalid_definitions + +group object_redefinitions "Object Redefinition Tests" + + case invalid_object_ident + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2.0 + # define AAAA 2.1 + # define VALUE (AAA - 1.0) + # define VALUE (AAAA - 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_whitespace + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA- 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_op + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA + 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_floatval_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA - 1.1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_floatval_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA - 1.0e-1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_intval_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 2) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_intval_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 0x1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case redefine_object_1 + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_ifdef + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #ifdef ADEFINE + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_undef_ifdef + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + #undef ADEFINE + + #ifdef ADEFINE + #define VALUE 0.0 + #else + #define VALUE 1.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_ifndef + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #ifndef ADEFINE + #define VALUE 0.0 + #else + #define VALUE 1.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_defined_1 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #if defined(ADEFINE) + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_defined_2 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #if defined ADEFINE + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_comment + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 /* fdsjklfdsjkl dsfjkhfdsjkh fdsjklhfdsjkh */ (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_multiline_comment + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 /* fdsjklfdsjkl + dsfjkhfdsjkh + fdsjklhfdsjkh */ (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + +end # object_redefinitions + +group invalid_redefinitions "Invalid Redefinitions Tests" + + case invalid_identifier_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define GL_VALUE 1.0 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(GL_VALUE); + } + "" + end + +end # invalid_redefinitions + +group comments "Comment Tests" + + case multiline_comment_define + version 300 es + values { output float out0 = 4.2; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define VALUE /* current + value */ 4.2 + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case nested_comment + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + /* /* */ + out0 = 1.0; + // */ + ${OUTPUT} + } + "" + end + + case comment_trick_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /*/ + out0 = 0.0; + /*/ + out0 = 1.0; + /**/ + ${OUTPUT} + } + "" + end + + case comment_trick_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /**/ + out0 = 1.0; + /*/ + out0 = 0.0; + /**/ + ${OUTPUT} + } + "" + end + + case invalid_comment + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /* /* */ */ + ${POSITION_FRAG_COLOR} = 1.0; + } + "" + end + + case unterminated_comment_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /* + } + "" + end + + case unterminated_comment_2 + version 300 es + expect compile_fail + both "" + #version 300 es + /* + precision mediump float; + ${DECLARATIONS} + void main() + { + } + "" + end + + case backslash_in_a_comment_1 + version 300 es + expect build_successful + both "" + #version 300 es + // \\note these are some declarations + precision mediump float; + ${DECLARATIONS} + // \\note this is the main function + void main() + { + // \\note this is a function body + ${OUTPUT} + } + "" + end + + case backslash_in_a_comment_2 + version 300 es + expect build_successful + both "" + #version 300 es + /* \\note these are some declarations */ + precision mediump float; + ${DECLARATIONS} + /* \\note this is the main function */ + void main() + { + /* \\note this is a function body */ + ${OUTPUT} + } + "" + end +end # comments + +group line_continuation "Line Continuation Tests" + + case comment + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + out0 = 1.0; + // comment \\ + out0 = -1.0; + ${OUTPUT} + } + "" + end + + case define + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define A(X) \\ + (-1.0*(X)) + + void main () + { + out0 = A(-1.0); + ${OUTPUT} + } + "" + end + + case preprocessing_token + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #def\\ + ine A(X) (-1.0*(X)) + + void main () + { + out0 = A(-1.0); + ${OUTPUT} + } + "" + end + + case token + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f\\ + oo = 1.0; + out0 = foo; + ${OUTPUT} + } + "" + end + + case middle_of_line + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define A a \\ b + #define B 1.0 + + void main () + { + out0 = B; + ${OUTPUT} + } + "" + end + +end # line_continuation + +group function_definitions "Function Definitions Tests" + + case same_object_and_function_param + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define VALUE 1.0 + #define FUNCTION(VALUE, B) (VALUE-B) + + void main() + { + out0 = FUNCTION(3.0, 2.0); + ${OUTPUT} + } + "" + end + + case complex_func + version 300 es + values { output float out0 = 518.5; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define AAA(a,b) a*(BBB(a,b)) + #define BBB(a,b) a-b + + void main() + { + out0 = BBB(AAA(8.0/4.0, 2.0)*BBB(2.0*2.0,0.75*2.0), AAA(40.0,10.0*BBB(5.0,3.0))); + ${OUTPUT} + } + "" + end + + case function_definition_with_comments + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + /* sdfljk */ #/* sdfljk */define /* sdfljk */ FUNC( /* jklsfd*/a /*sfdjklh*/, /*sdfklj */b /*sdfklj*/) a+b + + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + +end # function_definitions + +group recursion "Recursions Tests" + + case recursion_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA BBB + #define BBB AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA (1.0+BBB) + #define BBB (2.0+AAA) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA(a) AAA(a) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA(1.0)); + } + "" + end + + case recursion_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA(a, b) AAA(b, a) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA(1.0, 2.0)); + } + "" + end + +end # recursion + +group function_redefinitions "Function Redefinition Tests" + + case function_redefinition_1 + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC( a, b) a+b + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case function_redefinition_2 + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) (a +b) + # define FUNC( a, b )(a +b) + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case function_redefinition_3 + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) (a +b) + # define FUNC(a,b)(a /* comment + */ +b) + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case invalid_function_redefinition_param_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(A,b) A+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0)); + } + "" + end + + case invalid_function_redefinition_param_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b,c) a+b+c + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case invalid_function_redefinition_param_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b) b+a + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0)); + } + "" + end + +end # functions_redefinitions + +group invalid_function_definitions "Invalid Function Definition Tests" + + case arguments_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC); + } + "" + end + + case arguments_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC()); + } + "" + end + + case arguments_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(((); + } + "" + end + + case arguments_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC)); + } + "" + end + + case arguments_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0)); + } + "" + end + + case arguments_6 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + } + "" + end + + case arguments_7 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,)); + } + "" + end + + case arguments_8 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case unique_param_name + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,a) a+a + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a + b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(,a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC( + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(A a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(A,B,C a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC( + "" + end + +end # invalid_function_definitions + +group semantic "Semantic Tests" + + case ops_as_arguments + version 300 es + values { output float out0 = 20.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define FOO(a, b) (1 a 9) b 2 + + void main() + { + out0 = float(FOO(+, *)); + ${OUTPUT} + } + "" + end + + case correct_order + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define FUNC(A) A + #define A 2.0 + + void main() + { + out0 = FUNC(A - 1.0); + ${OUTPUT} + } + "" + end + +end # semantic + +group predefined_macros "Predefined Macros Tests" + + case version + version 300 es + values { output float out0 = 300.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA __VERSION__ + out0 = float(AAA); + ${OUTPUT} + } + "" + end + + case gl_es_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + out0 = float(GL_ES); + ${OUTPUT} + } + "" + end + + case gl_es_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define AAA(A) A + + void main() + { + out0 = float(AAA(GL_ES)); + ${OUTPUT} + } + "" + end + + case line_1 + version 300 es + values { output float out0 = 2.0; } + both "" + #version 300 es + const mediump int line = __LINE__; + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(line); + ${OUTPUT} + } + "" + end + + case line_2 + version 300 es + # Note: Arguments are macro replaced in the first stage. + # Macro replacement list is expanded in the last stage. + values { output vec4 out0 = vec4(12.0, 12.0, 10.0, 11.0); } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS:single-line} + #define BBB __LINE__, /* + */ __LINE__ + #define AAA(a,b) BBB, a, b + + void main() + { + out0 = vec4(AAA(__LINE__, + __LINE__ + )); + ${OUTPUT} + } + "" + end + + case file + version 300 es + values { output float out0 = 0.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(__FILE__); + ${OUTPUT} + } + "" + end + + case if_gl_es + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case if_version + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if __VERSION__ == 300 + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + +end # predefined_macros + +group conditional_inclusion "Conditional Inclusion Tests" + + case basic_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA asdf + + #if defined AAA && !defined(BBB) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_2 + version 300 es + values { output float out0 = 1.0; } + # Note: this is expected to fail contrary to native dEQP, + # see https://github.com/KhronosGroup/WebGL/pull/1523 + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA defined(BBB) + + #if !AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_macro_defined_test + version 300 es + values { output float out0 = 1.0; } + # Note: this is expected to fail contrary to native dEQP, + # see https://github.com/KhronosGroup/WebGL/pull/1523 + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA defined + + #if AAA AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_macro_undef + version 300 es + values { output float out0 = 1.0; } + # Note: this is expected to fail contrary to native dEQP, + # see https://github.com/KhronosGroup/WebGL/pull/1523 + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define BBB 1 + #define AAA defined(BBB) + #undef BBB + + #if !AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case define_defined + version 300 es + values { output float out0 = 1.0; } + # Note: this is expected to fail contrary to native dEQP, + # see https://github.com/KhronosGroup/WebGL/pull/1523 + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define CCC 1 + #define defined BBB + #define AAA defined + + #if AAA CCC + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case define_defined_outside_if + version 300 es + values { output float out0 = 1.0; } + # Note: this is expected to fail contrary to native dEQP, + # see https://github.com/KhronosGroup/WebGL/pull/1523 + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define CCC - 0.5 + #define defined 0.5 + #define AAA defined + out0 = 1.0 - (AAA CCC); + ${OUTPUT} + } + "" + end + + case defined_invalid_before_all_macros_replaced + version 300 es + expect compile_fail + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define FOO 1 + #define OPEN defined( + #define CLOSE FOO) + + #if OPEN CLOSE + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_3 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + out0 = -1.0; + #elif 0 + out0 = -2.0; + #elif 1 + out0 = 1.0; + #else + out0 = -3.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_4 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + out0 = -1.0; + #elif 0 + out0 = -2.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_5 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + out0 = 1.0; + #elif 0 + out0 = -2.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case unary_ops_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~2 >> 1) & 1) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case unary_ops_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~(- - - - - 1 + + + + + +1) >> 1) & 1) + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + +end # conditional_inclusion + +group invalid_ops "Invalid Operations Tests" + + case invalid_op_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~(+ ++1 - - - -1) >> 1) & 1) + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_op_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~(+ + +1 - -- -1) >> 1) & 1) + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined() + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined( + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined) + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined((AAA)) + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + #endif + } + "" + end + + case invalid_defined_expected_rparen + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined(AAA + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case defined_define + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define define 1 + #define AAA 1.0 + + void main() + { + out0 = AAA; + ${OUTPUT} + } + "" + end + +end # invalid_ops + +group undefined_identifiers "Undefined Identifiers Tests" + + case valid_undefined_identifier_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 || AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case valid_undefined_identifier_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 && AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case undefined_identifier_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 - CCC + (-AAA || BBB) + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if -A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if ~A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_6 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 1 + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_7 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define B 1 + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_8 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define B 1 + #define A 2 + #undef A + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_9 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_10 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 0 + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_11 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 0 + #define B 2 + #undef B + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_12 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define B 1 + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + +end # undefined_identifiers + +group invalid_conditionals "Invalid Conditionals Tests" + + case empty_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case empty_if_defined + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef FOOBAR + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef GL_ES + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(2.0); + } + "" + end + + case elif_after_else + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(0.0); + #endif + } + "" + end + + case else_without_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case elif_without_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case endif_without_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case else_after_else + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !GL_ES + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case nested_elif_without_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + # elif + ${POSITION_FRAG_COLOR} = vec4(0.0); + # endif + #endif + } + "" + end + + case if_float + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1.231 + ${POSITION_FRAG_COLOR} = vec4(1.0); + # elif + ${POSITION_FRAG_COLOR} = vec4(0.0); + # endif + #endif + } + "" + end + + case tokens_after_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_elif + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #elif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_else + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #else foobar 1.231 + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_endif + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #else + #endif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef FOOBAR foobar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef FOOBAR ,, +- << barbar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_nested_blocks + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + # if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_conditionals + +group conditionals "Conditionals Tests" + + case ifdef_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #if defined ( AAA) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_3 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifndef_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifndef_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define AAA + void main() + { + #ifndef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case mixed_conditional_inclusion + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #elif 1 + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case nested_if_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + # if __VERSION__ != 300 + out0 = -1.0; + # else + out0 = 1.0; + # endif + #endif + ${OUTPUT} + } + "" + end + + case nested_if_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + # if 0 + out0 = -1.0; + # else + # if 0 + out0 = -1.0; + # elif 1 + out0 = 1.0; + # else + out0 = -1.0; + # endif + # endif + #endif + ${OUTPUT} + } + "" + end + + case nested_if_3 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + # if 1 + out0 = -1.0; + # endif + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + +end # conditionals + +group directive "Directive Tests" + + case version_is_less + expect compile_fail + version 300 es + both "" + #version 299 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_is_more + expect compile_fail + version 300 es + both "" + #version 301 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_missing_es + expect compile_fail + version 300 es + both "" + #version 300 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_missing + expect compile_fail + version 300 es + both "" + #version + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_1 + expect compile_fail + version 300 es + both "" + precision mediump float; + #version 300 es + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_2 + expect compile_fail + version 300 es + both "" + #define FOO BAR + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_1 + expect compile_fail + version 300 es + both "" + #version 300 es.0 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_2 + expect compile_fail + version 300 es + both "" + #version foobar + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_version + expect compile_fail + version 300 es + both "" + #version AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case additional_tokens + expect compile_fail + version 300 es + both "" + #version 300 es foobar + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error_with_no_tokens + version 300 es + expect compile_fail + both "" + #version 300 es + #error + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error + version 300 es + expect compile_fail + both "" + #version 300 es + #define AAA asdf + #error 1 * AAA /* comment */ + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # directive + +group builtin "Built-in Symbol Tests" + + case line + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 1 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file + version 300 es + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 234 10 + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_expression + version 300 es + values { output float out0 = 20.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line +20 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file_expression + version 300 es + values { output vec4 out0 = vec4(243.0, 243.0, 10.0, 10.0); } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line (233 +10) (+10) + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_defined_1 + version 300 es + values { output float out0 = 4.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 4 + #line A + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_defined_2 + version 300 es + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 10 + #line 234 A + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case empty_line + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_line_file_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 22 1.234 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 233 10 2 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line foobar + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + +end # builtin + +group pragmas "Pragma Tests" + + case pragma_vertex + version 300 es + values { output float out0 = 1.0; } + vertex "" + #version 300 es + #pragma + #pragma STDGL invariant(all) + #pragma debug(off) + #pragma optimize(off) + + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" + end + + case pragma_fragment + version 300 es + values { output float out0 = 1.0; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + #pragma + #pragma debug(off) + #pragma optimize(off) + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" + end + + case pragma_macro_exp + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #define off INVALID + /* pragma line not macro expanded */ + #pragma debug(off) + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case pragma_unrecognized_debug + version 300 es + expect build_successful + both "" + #version 300 es + #pragma debug(1.23) + + // unrecognized preprocessor token + + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case pragma_unrecognized_token + # Note: upstream dEQP uses unicode characters here but we can't test + # this in WebGL because it requires strings passed to glShaderSource + # to be ASCII. This would cause the test to fail at glShaderSource + # instead of glCompileShader, which is not what we want to test. + version 300 es + expect build_successful + both "" + #version 300 es + #pragma **% + + // trailing bytes form a valid but unrecognized preprocessor token + + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # pragmas + +group extensions "Extension Tests" + + case basic + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case macro_exp + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #define warn enable + + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case missing_extension_name + version 300 es + expect compile_fail + both "" + #version 300 es + #extension + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_extension_name + version 300 es + expect compile_fail + both "" + #version 300 es + #extension 2 : all + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_colon + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case expected_colon + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all ; + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_behavior + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_1 + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : WARN + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_2 + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : require + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_name + # Note: upstream dEQP uses unicode characters here but we can't test + # this in WebGL because it requires strings passed to glShaderSource + # to be ASCII. This would cause the test to fail at glShaderSource + # instead of glCompileShader, which is not what we want to test. + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all* : warn + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_behavior + # Note: upstream dEQP uses unicode characters here but we can't test + # this in WebGL because it requires strings passed to glShaderSource + # to be ASCII. This would cause the test to fail at glShaderSource + # instead of glCompileShader, which is not what we want to test. + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : war*n + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_comment + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : warn /*asd + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case after_non_preprocessing_tokens + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + #extension all : disable + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end +end # extensions + +group expressions "Expression Tests" + + case shift_left + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL << 2) == 16 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case shift_right + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 5 + out0 = 0.0; + #if (VAL >> 1) == 2 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case cmp_less_than + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 5 + out0 = 0.0; + #if (VAL < 6) && (-VAL < -4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case less_or_equal + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL <= 6) && (-VAL <= -6) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case or + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL | 5) == 7 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case and + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL & 5) == 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case xor + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL ^ 5) == 3 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case mod + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 12 + out0 = 0.0; + #if (VAL % 5) == 2 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_value + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (( (4 ) ) ) + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_tricky + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (( (4 ) ) + out0 = 0.0; + #if VAL) >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_if_no + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_if + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL >= 4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_multi_if + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (4) + out0 = 0.0; + #if (((VAL)) >= (4)) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_single_if + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL >= 4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_ifelse_true + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + #if (VAL >= 4) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_ifelse_false + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + #if (VAL > 4) + out0 = 0.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_basic_0 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if -4 + 5 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_basic_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if (2 * 2) - 3 >= 0 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_simple_precedence_0 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 2 * 3 - 3 == 3 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_simple_precedence_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 2 - 2 / 2 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define X 0 + void main() + { + #if defined(X) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + void main() + { + #if defined(X) == Y + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_3 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + void main() + { + #if defined(X) && defined(Y) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_4 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef X + void main() + { + #if defined(X) && defined(Y) + out0 = 0.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_5 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef X + void main() + { + #if defined(X) || defined(Y) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_6 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef Y + void main() + { + #if defined(X) && (defined(Y) || (X == 0)) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + +end # expressions + +group invalid_expressions "Invalid Expression Tests" + + case invalid_unary_expr + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if ! + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_binary_expr + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 3+4+ + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_expr + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 4 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 4 * * 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if (4)(4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unopened_parenthesis + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if ((4 + 7) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_expressions + +group operator_precedence "Operator precedence" + + + case modulo_vs_not + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 % ! 0 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_not + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 / ! 0 ) == 8 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_not + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 * ! 0 ) == 8 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_bit_invert + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 % ~ 4 ) == 3 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_minus + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 % - 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_plus + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 % + 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_bit_invert + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 / ~ 2 ) == -2 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_minus + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 / - 2 ) == -4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_plus + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 / + 2 ) == 4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_bit_invert + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 * ~ 2 ) == -24 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_minus + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 * - 2 ) == -16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_plus + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 * + 2 ) == 16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_modulo + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 - 3 % 2 ) == 7 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_div + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 - 3 / 2 ) == 7 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_mul + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 - 3 * 2 ) == 2 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_modulo + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 + 3 % 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_div + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 + 3 / 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_mul + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 + 3 * 2 ) == 14 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case rshift_vs_sub + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 >> 3 - 2 ) == 4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case rshift_vs_add + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 >> 3 + 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case lshift_vs_sub + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 << 3 - 2 ) == 16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case lshift_vs_add + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 << 3 + 2 ) == 256 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_or_equal_vs_rshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 >= 3 >> 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_or_equal_vs_lshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 >= 3 << 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_or_equal_vs_rshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 <= 3 >> 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_or_equal_vs_lshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 <= 3 << 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_vs_rshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 > 3 >> 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_vs_lshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 > 3 << 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_vs_rshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 < 3 >> 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_vs_lshift + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 < 3 << 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_greater_or_equal + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 != 3 >= 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_less_or_equal + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 != 3 <= 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_greater + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 != 3 > 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_less + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 != 3 < 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_greater_or_equal + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 == 3 >= 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_less_or_equal + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 == 3 <= 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_greater + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 == 3 > 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_less + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 == 3 < 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_and_vs_not_equal + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 & 3 != 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_and_vs_equal + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 & 3 == 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case xor_vs_bitwise_and + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 ^ 3 & 2 ) == 10 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_or_vs_xor + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 8 | 3 ^ 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_and_vs_bitwise_or + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 0 && 3 | 2 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_and_vs_bitwise_and + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 0 && 4 & 2 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_or_vs_logical_and + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #if ( 0 || 4 && 0 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + +end # operator_precedence diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html new file mode 100644 index 000000000..d381f96f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test new file mode 100644 index 000000000..42c5b357f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test @@ -0,0 +1,2714 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group variables "Order of qualification in variable declarations." + + group valid "Valid orderings." + + case invariant_interp_storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_interp_storage + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out float x0; + + out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in float x0; + + in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + + end # valid + group invalid "Invalid orderings." + + case invariant_interp_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth lowp centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_interp_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out smooth lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_precision_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out lowp smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_precision_interp_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant lowp smooth centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_precision_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant lowp centroid out smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_invariant_storage_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth invariant centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_invariant_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth invariant lowp centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_invariant_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out invariant lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_precision_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out lowp invariant float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_precision_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth lowp invariant centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_precision_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth lowp centroid out invariant float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_interp_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant smooth lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_precision_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant lowp smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_invariant_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth invariant lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_precision_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth lowp invariant float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp invariant smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_interp_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp smooth invariant float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_interp_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp invariant smooth centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp invariant centroid out smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_interp_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp smooth invariant centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_interp_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp smooth centroid out invariant float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_invariant_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out invariant smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_interp_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out smooth invariant float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth lowp centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_interp_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp smooth centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out smooth float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth invariant centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out invariant float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant smooth float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth invariant float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant lowp centroid out float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp invariant float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp invariant centroid out float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out invariant float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant float x0; + + out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in float x0; + + in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_interp_storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_interp_storage_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out float x0; + + out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant centroid in float x0; + + in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + + end # invalid + +end # variables +group parameters "Order of qualification in function parameters." + + group valid "Valid orderings." + + case storage_parameter_precision + expect pass + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (const in lowp float x) + { + return x + 1.0; + } + + void foo1 ( out mediump float x) + { + x = 1.0; + } + + float foo2 ( inout highp float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case storage_parameter + expect pass + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (const in float x) + { + return x + 1.0; + } + + void foo1 ( out float x) + { + x = 1.0; + } + + float foo2 ( inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case storage_precision + expect pass + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (const lowp float x) + { + return x + 1.0; + } + + void foo1 ( mediump float x) + { + x = 1.0; + } + + float foo2 ( highp float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_precision + expect pass + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (in lowp float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout highp float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + + end # valid + group invalid "Invalid orderings." + + case storage_precision_parameter + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (const lowp in float x) + { + return x + 1.0; + } + + void foo1 ( mediump out float x) + { + x = 1.0; + } + + float foo2 ( highp inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_storage_precision + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (in const lowp float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout highp float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_precision_storage + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (in lowp const float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout highp float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_storage_parameter + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp const in float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (highp inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_parameter_storage + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp in const float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (highp inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_storage + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (in const float x) + { + return x + 1.0; + } + + void foo1 (out float x) + { + x = 1.0; + } + + float foo2 (inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_storage + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp const float x) + { + return x + 1.0; + } + + void foo1 (mediump float x) + { + x = 1.0; + } + + float foo2 (highp float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_parameter + expect compile_fail + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp in float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (highp inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + + end # invalid + +end # parameters diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html new file mode 100644 index 000000000..c525b32b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test new file mode 100644 index 000000000..4f195250f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test @@ -0,0 +1,901 @@ +group valid "Valid scoping and name redeclaration cases" + + case local_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + void main() + { + ${SETUP} + int a = in0; + + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_local_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + { + int a = -1; + } + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + void main() + { + ${SETUP} + { + int a = in0; + + out0 = a; + } + ${OUTPUT} + } + "" + end + + case for_init_statement_variable_hides_local_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + for (int a = 0; a < 10; a++) + { + } + out0 = a; + ${OUTPUT} + } + "" + end + + case while_condition_variable_hides_local_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + int i = 0; + while (bool a = (i < 1)) + { + i++; + } + out0 = a; + ${OUTPUT} + } + "" + end + + case for_init_statement_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = 5; + + void main() + { + ${SETUP} + for (int a = 0; a < 10; a++) + { + } + out0 = in0 + a - 5; + ${OUTPUT} + } + "" + end + + case while_condition_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = 5; + + void main() + { + ${SETUP} + int i = 0; + while (bool a = (i < 1)) + { + i++; + } + out0 = in0 + a - 5; + ${OUTPUT} + } + "" + end + + case variable_in_if_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = 1; + + void main() + { + ${SETUP} + if (true) + int a = 42; + out0 = a*in0; + ${OUTPUT} + } + "" + end + + case variable_from_outer_scope_visible_in_initializer + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + { + int a = a+5, b = a-5; + out0 = b; + a = 42; + } + out0 = out0 + a - in0; + ${OUTPUT} + } + "" + end + + case local_int_variable_hides_struct_type + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct S { int val; }; + + void main() + { + ${SETUP} + int S = S(in0).val; + out0 = S; + ${OUTPUT} + } + "" + end + + case local_struct_variable_hides_struct_type + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct S { int val; }; + + void main() + { + ${SETUP} + S S = S(in0); + out0 = S.val; + ${OUTPUT} + } + "" + end + + case local_variable_hides_function + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int foo (int x) { return x; } + + void main() + { + ${SETUP} + int foo = in0; + out0 = foo; + ${OUTPUT} + } + "" + end + + case function_parameter_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + int func (int a) { return a; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case function_parameter_hides_struct_type + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct S { int x; }; + + int func (int S) { return S; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case function_parameter_hides_function + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int func (int func) { return func; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case local_variable_in_inner_scope_hides_function_parameter + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + int func (int inp, int x) { { int x = 5; return inp + x - 5; } } + + void main() + { + ${SETUP} + out0 = func(in0, 42); + ${OUTPUT} + } + "" + end + + case redeclare_function + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int func (int x); + int func (int); + int func (int inp) { return inp; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + +end + +group invalid "Invalid scoping behavior" + + case redeclare_global_variable + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a; + float a; + + void main() + { + a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_local_variable + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a; + float a; + a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_for_init_statement_variable + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + for (int i = 0; i < 10; i++) + { + int i = 11; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_for_condition_variable + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + for (int i = 0; int a = (i < 10); i++) + { + int a = 0; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_for_init_statement_variable_in_for_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a; + for (int i = 0; int i = (i < 10); i++) + { + a = sin(i); + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_while_condition_variable + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a = 0; + while (int i = (a < 5)) + { + int i = 11; + a += i; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redefine_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func(float x); + + float func(float x) { return x + 1.0; } + float func(float x) { return x + 2.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case redeclare_builtin + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float sin(float x); + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case redefine_builtin + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float sin(float x) { return x + 1.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case conflict_function_struct + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void f(int x); + struct f { int x; }; + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1); + } + "" + end + + case conflict_function_variable + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void f(int x); + float f; + + void main() + { + f = 1.0; + ${POSITION_FRAG_COLOR} = vec4(f); + } + "" + end + + case use_global_variable_before_declaration + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func() + { + a = 2.0; + } + + float a; + + void main() + { + func(); + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_local_variable_before_declaration + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a = 1.0; + a = b; + float b = 2.0; + + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_struct_type_before_declaration + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float x) { return S(x).val; } + struct S { float val; }; + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case use_function_before_declaration + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float x) { return bar(x); } + float bar (float x) { return x; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case use_variable_from_block_in_outer_scope + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + { + float a = 1.0; + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_if_in_outer_scope + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + if (true) + float a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_else_in_outer_scope + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + if (false) + float a = 1.0; + else + float b = 2.0; + ${POSITION_FRAG_COLOR} = vec4(b); + } + "" + end + + case use_variable_from_if_in_else + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a = 1.0; + if (true) + { + float b = 2.0; + } + else + { + a = b; + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_for_init_statement_in_outer_scope + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + float x = 0.0; + for (int i = 0; i < 10; i++) + { + x += sin(i); + } + ${POSITION_FRAG_COLOR} = vec4(float(i)); + } + "" + end + + case use_variable_from_while_condition_in_outer_scope + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a = 1; + while (bool b = (a == 1)) + { + a++; + } + ${POSITION_FRAG_COLOR} = vec4(float(b)); + } + "" + end + + case use_parameter_names_from_function_declaration + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func(float a, float b); + + float func(float x, float y) { return a+b; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0)); + } + "" + end + + case variable_not_visible_in_own_initializer + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + float x = x; + ${POSITION_FRAG_COLOR} = vec4(x); + } + "" + end + + case local_variable_hides_function_parameter + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + float func (float inp, float x) { int x = 5.0; return inp + x - 5.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0)); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html new file mode 100644 index 000000000..9c9a5a0e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test new file mode 100644 index 000000000..687eb7eba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test @@ -0,0 +1,633 @@ + +case empty_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch () + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_float + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float c = 1.0; + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_bool + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + bool c = true; + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_ivec2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ivec2 c = ivec2(1, 1); + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_struct + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct S { int m; }; + + void main () + { + S c = S(1); + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case duplicate_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int c = 1; + switch (c) + { + case 1: + case 1: + break; + } + + ${OUTPUT} + } + "" +end + +case float_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int c = 1; + switch (c) + { + case 1.0: + break; + } + + ${OUTPUT} + } + "" +end + +case non_const_int_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int c = 1; + int l = 2; + switch (c) + { + case l: + break; + } + + ${OUTPUT} + } + "" +end + +case statement_before_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + case 1: + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + + ${OUTPUT} + } + "" +end + +case statement_before_default_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + default: + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + + ${OUTPUT} + } + "" +end + +case no_statement_after_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 0: + break; + case 1: + } + + ${OUTPUT} + } + "" +end + +case no_statement_after_default_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 0: + break; + default: + } + + ${OUTPUT} + } + "" +end + +case case_in_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + if (f > 0.0) + { + case 1: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + if (f > 0.0) + { + default: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case case_in_for_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + for (int i = 0; i < 2; i++) + { + case 1: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_for_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + for (int i = 0; i < 2; i++) + { + default: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case case_in_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + while (f > 0.0) + { + case 1: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + while (f > 0.0) + { + default: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case case_in_do_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + do + { + case 1: + f *= 2.0; + } while (f > 0.0); + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_do_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + do + { + default: + f *= 2.0; + } while (f > 0.0); + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case missing_colon + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case missing_opening_brace + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case missing_closing_brace + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + + ${OUTPUT} + } + "" +end + +case double_case + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case double_default_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + default: + break; + default: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case double_default_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + default default: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.html new file mode 100644 index 000000000..6f633be63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test new file mode 100644 index 000000000..2477ebb06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test @@ -0,0 +1,7459 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group vector_swizzles "Vector Swizzles" + + case mediump_vec2_x + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xx + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xy + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yx + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yxy + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xyxx + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yyyy + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_s + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ss + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_st + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ts + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tst + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec2_stss + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tttt + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec2_r + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rr + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rg + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gr + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_grg + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rgrr + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gggg + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_x + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec3_z + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xz + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zz + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyz + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zyx + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xxx + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzz + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzy + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_yxy + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xzx + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyyx + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzzz + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_s + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec3_p + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sp + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pp + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stp + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pts + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sss + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppp + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppt + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_vec3_tst + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sps + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stts + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pppp + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_r + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec3_b + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rb + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bb + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rgb + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bgr + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rrr + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbb + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbg + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_grg + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rbr + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rggr + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbbb + version 300 es + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_vec4_x + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec4_w + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wx + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wz + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_www + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyw + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzy + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyzw + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzyx + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xxxx + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyyy + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwww + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzzw + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwwy + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyxx + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_zzwz + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_s + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec4_q + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qs + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qp + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqq + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ttq + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpt + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stpq + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpts + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ssss + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_tttt + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqq + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qppq + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqt + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stss + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ppqp + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_r + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec4_a + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ar + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ab + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaa + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gga + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abg + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgba + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abgr + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rrrr + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gggg + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaaa + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abba + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaag + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgrr + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_bbab + version 300 es + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_x + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xx + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xy + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yx + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yxy + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xyxx + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yyyy + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_s + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ss + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_st + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ts + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tst + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_stss + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tttt + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_r + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rr + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rg + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gr + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_grg + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rgrr + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gggg + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_x + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_z + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xz + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zz + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyz + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zyx + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xxx + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzz + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzy + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_yxy + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xzx + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyyx + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzzz + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_s + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_p + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sp + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pp + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stp + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pts + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sss + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppp + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppt + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_tst + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sps + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stts + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pppp + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_r + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_b + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rb + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bb + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rgb + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bgr + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rrr + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbb + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbg + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_grg + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rbr + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rggr + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbbb + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_x + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_w + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wx + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wz + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_www + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyw + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzy + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyzw + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzyx + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xxxx + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyyy + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwww + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzzw + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwwy + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyxx + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_zzwz + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_s + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_q + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qs + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qp + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqq + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ttq + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpt + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stpq + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpts + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ssss + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_tttt + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqq + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qppq + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqt + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stss + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ppqp + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_r + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_a + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ar + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ab + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaa + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gga + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abg + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgba + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abgr + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rrrr + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gggg + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaaa + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abba + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaag + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgrr + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_bbab + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_x + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xx + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xy + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yx + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yxy + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xyxx + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yyyy + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_s + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ss + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_st + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ts + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tst + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_stss + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tttt + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_r + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rr + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rg + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gr + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_grg + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rgrr + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gggg + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_x + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_z + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xz + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zz + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyz + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zyx + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xxx + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzz + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzy + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_yxy + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xzx + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyyx + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzzz + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_s + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_p + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sp + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pp + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stp + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pts + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sss + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppp + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppt + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_tst + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sps + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stts + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pppp + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_r + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_b + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rb + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bb + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rgb + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bgr + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rrr + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbb + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbg + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_grg + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rbr + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rggr + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbbb + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_x + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_w + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wx + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wz + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_www + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyw + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzy + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyzw + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzyx + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xxxx + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyyy + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwww + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzzw + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwwy + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyxx + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_zzwz + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_s + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_q + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qs + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qp + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqq + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ttq + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpt + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stpq + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpts + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ssss + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_tttt + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqq + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qppq + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqt + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stss + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ppqp + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_r + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_a + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ar + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ab + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaa + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gga + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abg + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgba + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abgr + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rrrr + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gggg + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaaa + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abba + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaag + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgrr + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_bbab + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + +end # vector_swizzles diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html new file mode 100644 index 000000000..a1937f2ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html @@ -0,0 +1,36 @@ + + + +WebGL Shader Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js b/dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js new file mode 100644 index 000000000..4b38dce6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js @@ -0,0 +1,141 @@ +// This file was autogenerated by ../closure-library/closure/bin/build/depswriter.py. +// Please do not edit. +goog.addDependency('../../../deqp/framework/common/tcuBilinearImageCompare.js', ['framework.common.tcuBilinearImageCompare'], ['framework.common.tcuRGBA', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuCompressedTexture.js', ['framework.common.tcuCompressedTexture'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuFloat.js', ['framework.common.tcuFloat'], ['framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuFloatFormat.js', ['framework.common.tcuFloatFormat'], ['framework.common.tcuInterval', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuFuzzyImageCompare.js', ['framework.common.tcuFuzzyImageCompare'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom'], false); +goog.addDependency('../../../deqp/framework/common/tcuImageCompare.js', ['framework.common.tcuImageCompare'], ['framework.common.tcuBilinearImageCompare', 'framework.common.tcuFloat', 'framework.common.tcuFuzzyImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuInterval.js', ['framework.common.tcuInterval'], ['framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuLogImage.js', ['framework.common.tcuLogImage'], ['framework.common.tcuSurface', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuMatrix.js', ['framework.common.tcuMatrix'], ['framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuMatrixUtil.js', ['framework.common.tcuMatrixUtil'], ['framework.common.tcuMatrix'], false); +goog.addDependency('../../../deqp/framework/common/tcuPixelFormat.js', ['framework.common.tcuPixelFormat'], [], false); +goog.addDependency('../../../deqp/framework/common/tcuRGBA.js', ['framework.common.tcuRGBA'], ['framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuSkipList.js', ['framework.common.tcuSkipList'], [], false); +goog.addDependency('../../../deqp/framework/common/tcuStringTemplate.js', ['framework.common.tcuStringTemplate'], [], false); +goog.addDependency('../../../deqp/framework/common/tcuSurface.js', ['framework.common.tcuSurface'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/framework/common/tcuTestCase.js', ['framework.common.tcuTestCase'], ['framework.common.tcuSkipList'], false); +goog.addDependency('../../../deqp/framework/common/tcuTexCompareVerifier.js', ['framework.common.tcuTexCompareVerifier'], ['framework.common.tcuTexVerifierUtil', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuTexLookupVerifier.js', ['framework.common.tcuTexLookupVerifier'], ['framework.common.tcuTexVerifierUtil', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/common/tcuTexVerifierUtil.js', ['framework.common.tcuTexVerifierUtil'], ['framework.common.tcuFloat', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deUtil'], false); +goog.addDependency('../../../deqp/framework/common/tcuTexture.js', ['framework.common.tcuTexture'], ['framework.common.tcuFloat', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil'], false); +goog.addDependency('../../../deqp/framework/common/tcuTextureUtil.js', ['framework.common.tcuTextureUtil'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom'], false); +goog.addDependency('../../../deqp/framework/delibs/debase/deMath.js', ['framework.delibs.debase.deMath'], [], false); +goog.addDependency('../../../deqp/framework/delibs/debase/deRandom.js', ['framework.delibs.debase.deRandom'], [], false); +goog.addDependency('../../../deqp/framework/delibs/debase/deString.js', ['framework.delibs.debase.deString'], ['framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/delibs/debase/deUtil.js', ['framework.delibs.debase.deUtil'], ['framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/opengl/gluDrawUtil.js', ['framework.opengl.gluDrawUtil'], ['framework.opengl.gluShaderProgram'], false); +goog.addDependency('../../../deqp/framework/opengl/gluObjectWrapper.js', ['framework.opengl.gluObjectWrapper'], [], false); +goog.addDependency('../../../deqp/framework/opengl/gluPixelTransfer.js', ['framework.opengl.gluPixelTransfer'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/framework/opengl/gluShaderProgram.js', ['framework.opengl.gluShaderProgram'], [], false); +goog.addDependency('../../../deqp/framework/opengl/gluShaderUtil.js', ['framework.opengl.gluShaderUtil'], ['framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/opengl/gluStrUtil.js', ['framework.opengl.gluStrUtil'], [], false); +goog.addDependency('../../../deqp/framework/opengl/gluTexture.js', ['framework.opengl.gluTexture'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/framework/opengl/gluTextureUtil.js', ['framework.opengl.gluTextureUtil'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/framework/opengl/gluVarType.js', ['framework.opengl.gluVarType'], ['framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/framework/opengl/gluVarTypeUtil.js', ['framework.opengl.gluVarTypeUtil'], ['framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType'], false); +goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrGLContext.js', ['framework.opengl.simplereference.sglrGLContext'], ['framework.common.tcuPixelFormat', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrVertexAttrib'], false); +goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrReferenceContext.js', ['framework.opengl.simplereference.sglrReferenceContext'], ['framework.common.tcuMatrix', 'framework.common.tcuMatrixUtil', 'framework.common.tcuPixelFormat', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrReferenceUtils', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrVertexAttrib'], false); +goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrReferenceContextTest.js', ['framework.opengl.simplereference.sglrReferenceContextTest'], ['framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.opengl.gluDrawUtil', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false); +goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrReferenceUtils.js', ['framework.opengl.simplereference.sglrReferenceUtils'], ['framework.common.tcuFloat', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrShaders', 'framework.referencerenderer.rrVertexAttrib'], false); +goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrShaderProgram.js', ['framework.opengl.simplereference.sglrShaderProgram'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShaders', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrDefs.js', ['framework.referencerenderer.rrDefs'], [], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrFragmentOperations.js', ['framework.referencerenderer.rrFragmentOperations'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrRenderState'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrGenericVector.js', ['framework.referencerenderer.rrGenericVector'], [], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js', ['framework.referencerenderer.rrMultisamplePixelBufferAccess'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrRenderState.js', ['framework.referencerenderer.rrRenderState'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrMultisamplePixelBufferAccess'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrRenderer.js', ['framework.referencerenderer.rrRenderer'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrShaders.js', ['framework.referencerenderer.rrShaders'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrShadingContext.js', ['framework.referencerenderer.rrShadingContext'], ['framework.delibs.debase.deMath', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrUtil.js', ['framework.referencerenderer.rrUtil'], ['framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrVertexAttrib.js', ['framework.referencerenderer.rrVertexAttrib'], ['framework.common.tcuFloat', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrGenericVector'], false); +goog.addDependency('../../../deqp/framework/referencerenderer/rrVertexPacket.js', ['framework.referencerenderer.rrVertexPacket'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fApiCase.js', ['functional.gles3.es3fApiCase'], ['framework.common.tcuTestCase', 'framework.opengl.gluStrUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fAttribLocationTests.js', ['functional.gles3.es3fAttribLocationTests'], ['framework.opengl.gluShaderUtil', 'modules.shared.glsAttributeLocationTests'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fBooleanStateQuery.js', ['functional.gles3.es3fBooleanStateQuery'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fBufferCopyTests.js', ['functional.gles3.es3fBufferCopyTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'modules.shared.glsBufferTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fBufferObjectQueryTests.js', ['functional.gles3.es3fBufferObjectQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fBuiltinPrecisionTests.js', ['functional.gles3.es3fBuiltinPrecisionTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderProgram', 'modules.shared.glsBuiltinPrecisionTests'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fClippingTests.js', ['functional.gles3.es3fClippingTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fDefaultVertexAttributeTests.js', ['functional.gles3.es3fDefaultVertexAttributeTests'], ['framework.common.tcuLogImage', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fDrawTests.js', ['functional.gles3.es3fDrawTests'], ['framework.common.tcuLogImage', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluVarType', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket', 'modules.shared.glsDrawTests'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboColorbufferTests.js', ['functional.gles3.es3fFboColorbufferTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboCompletenessTests.js', ['functional.gles3.es3fFboCompletenessTests'], ['framework.common.tcuTestCase', 'modules.shared.glsFboCompletenessTests', 'modules.shared.glsFboUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboDepthbufferTests.js', ['functional.gles3.es3fFboDepthbufferTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboInvalidateTests.js', ['functional.gles3.es3fFboInvalidateTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboMultisampleTests.js', ['functional.gles3.es3fFboMultisampleTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboRenderTest.js', ['functional.gles3.es3fFboRenderTest'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboStateQueryTests.js', ['functional.gles3.es3fFboStateQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboStencilbufferTests.js', ['functional.gles3.es3fFboStencilbufferTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboTestCase.js', ['functional.gles3.es3fFboTestCase'], ['framework.common.tcuImageCompare', 'framework.common.tcuPixelFormat', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrRenderer', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFboTestUtil.js', ['functional.gles3.es3fFboTestUtil'], ['framework.common.tcuMatrix', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFloatStateQueryTests.js', ['functional.gles3.es3fFloatStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFragDepthTests.js', ['functional.gles3.es3fFragDepthTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFragmentOutputTests.js', ['functional.gles3.es3fFragmentOutputTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fFramebufferBlitTests.js', ['functional.gles3.es3fFramebufferBlitTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fIndexedStateQueryTests.js', ['functional.gles3.es3fIndexedStateQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fInstancedRenderingTests.js', ['functional.gles3.es3fInstancedRenderingTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fIntegerStateQueryTests.js', ['functional.gles3.es3fIntegerStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fInternalFormatQueryTests.js', ['functional.gles3.es3fInternalFormatQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fLifetimeTests.js', ['functional.gles3.es3fLifetimeTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderProgram', 'modules.shared.glsLifetimeTests', 'modules.shared.glsTextureTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fMultisampleTests.js', ['functional.gles3.es3fMultisampleTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluStrUtil', 'framework.opengl.gluTextureUtil', 'modules.shared.glsTextureTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fNegativeBufferApiTests.js', ['functional.gles3.es3fNegativeBufferApiTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluStrUtil', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fNegativeFragmentApiTests.js', ['functional.gles3.es3fNegativeFragmentApiTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fNegativeShaderApiTests.js', ['functional.gles3.es3fNegativeShaderApiTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderProgram', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fNegativeStateApiTests.js', ['functional.gles3.es3fNegativeStateApiTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderProgram', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fNegativeTextureApiTests.js', ['functional.gles3.es3fNegativeTextureApiTests'], ['framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.opengl.gluTexture', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js', ['functional.gles3.es3fNegativeVertexArrayApiTests'], ['framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.opengl.gluShaderProgram', 'framework.opengl.simplereference.sglrGLContext', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fOcclusionQueryTests.js', ['functional.gles3.es3fOcclusionQueryTests'], ['framework.common.tcuLogImage', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fPixelBufferObjectTest.js', ['functional.gles3.es3fPixelBufferObjectTest'], ['framework.common.tcuImageCompare', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fPrimitiveRestartTests.js', ['functional.gles3.es3fPrimitiveRestartTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fRasterizerDiscardTests.js', ['functional.gles3.es3fRasterizerDiscardTests'], ['framework.common.tcuLogImage', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fRboStateQueryTests.js', ['functional.gles3.es3fRboStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fReadPixelTests.js', ['functional.gles3.es3fReadPixelTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fSamplerObjectTests.js', ['functional.gles3.es3fSamplerObjectTests'], ['framework.common.tcuTestCase', 'modules.shared.glsSamplerObjectTest'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fSamplerStateQueryTests.js', ['functional.gles3.es3fSamplerStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderApiTests.js', ['functional.gles3.es3fShaderApiTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderBuiltinVarTests.js', ['functional.gles3.es3fShaderBuiltinVarTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket', 'modules.shared.glsShaderExecUtil', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderCommonFunctionTests.js', ['functional.gles3.es3fShaderCommonFunctionTests'], ['framework.common.tcuFloat', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'modules.shared.glsShaderExecUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderDerivateTests.js', ['functional.gles3.es3fShaderDerivateTests'], ['framework.common.tcuFloat', 'framework.common.tcuInterval', 'framework.common.tcuLogImage', 'framework.common.tcuMatrix', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuStringTemplate', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluPixelTransfer', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderIndexingTests.js', ['functional.gles3.es3fShaderIndexingTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderLoopTests.js', ['functional.gles3.es3fShaderLoopTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderMatrixTest.js', ['functional.gles3.es3fShaderMatrixTest'], ['framework.common.tcuMatrix', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderOperatorTests.js', ['functional.gles3.es3fShaderOperatorTests'], ['framework.common.tcuMatrix', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderPackingFunctionTests.js', ['functional.gles3.es3fShaderPackingFunctionTests'], ['framework.common.tcuFloat', 'framework.common.tcuMatrixUtil', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'modules.shared.glsShaderExecUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderPrecisionTests.js', ['functional.gles3.es3fShaderPrecisionTests'], ['framework.common.tcuFloat', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderStateQueryTests.js', ['functional.gles3.es3fShaderStateQueryTests'], ['framework.common.tcuMatrix', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderStructTests.js', ['functional.gles3.es3fShaderStructTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluTexture', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderSwitchTests.js', ['functional.gles3.es3fShaderSwitchTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fShaderTextureFunctionTests.js', ['functional.gles3.es3fShaderTextureFunctionTests'], ['framework.common.tcuMatrix', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'modules.shared.glsShaderRenderCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fStringQueryTests.js', ['functional.gles3.es3fStringQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fSyncTests.js', ['functional.gles3.es3fSyncTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fTextureFilteringTests.js', ['functional.gles3.es3fTextureFilteringTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'functional.gles3.es3fFboTestUtil', 'modules.shared.glsTextureTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fTextureFormatTests.js', ['functional.gles3.es3fTextureFormatTests'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluStrUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'modules.shared.glsTextureTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fTextureShadowTests.js', ['functional.gles3.es3fTextureShadowTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexCompareVerifier', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'modules.shared.glsTextureTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fTextureSpecificationTests.js', ['functional.gles3.es3fTextureSpecificationTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fTextureStateQuery.js', ['functional.gles3.es3fTextureStateQuery'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fTextureWrapTests.js', ['functional.gles3.es3fTextureWrapTests'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuPixelFormat', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'modules.shared.glsTextureTestUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fTransformFeedbackTests.js', ['functional.gles3.es3fTransformFeedbackTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'framework.opengl.gluVarTypeUtil'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fUniformApiTests.js', ['functional.gles3.es3fUniformApiTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluVarType'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fUniformBlockTests.js', ['functional.gles3.es3fUniformBlockTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'modules.shared.glsRandomUniformBlockCase', 'modules.shared.glsUniformBlockCase'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fVertexArrayObjectTests.js', ['functional.gles3.es3fVertexArrayObjectTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderProgram'], false); +goog.addDependency('../../../deqp/functional/gles3/es3fVertexArrayTests.js', ['functional.gles3.es3fVertexArrayTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluVarType', 'modules.shared.glsVertexArrayTests'], false); +goog.addDependency('../../../deqp/modules/shared/glsAttributeLocationTests.js', ['modules.shared.glsAttributeLocationTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsBufferTestUtil.js', ['modules.shared.glsBufferTestUtil'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsBuiltinPrecisionTests.js', ['modules.shared.glsBuiltinPrecisionTests'], ['framework.common.tcuFloatFormat', 'framework.common.tcuInterval', 'framework.common.tcuMatrix', 'framework.common.tcuMatrixUtil', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'framework.opengl.simplereference.sglrGLContext', 'modules.shared.glsBuiltinPrecisionTestsUnitTests', 'modules.shared.glsShaderExecUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js', ['modules.shared.glsBuiltinPrecisionTestsUnitTests'], ['framework.common.tcuInterval', 'framework.common.tcuMatrix'], false); +goog.addDependency('../../../deqp/modules/shared/glsDrawTests.js', ['modules.shared.glsDrawTests'], ['framework.common.tcuFloat', 'framework.common.tcuImageCompare', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluStrUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false); +goog.addDependency('../../../deqp/modules/shared/glsFboCompletenessTests.js', ['modules.shared.glsFboCompletenessTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluObjectWrapper', 'framework.opengl.gluStrUtil', 'modules.shared.glsFboUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsFboUtil.js', ['modules.shared.glsFboUtil'], ['framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsLifetimeTests.js', ['modules.shared.glsLifetimeTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuStringTemplate', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderProgram', 'modules.shared.glsTextureTestUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsRandomUniformBlockCase.js', ['modules.shared.glsRandomUniformBlockCase'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'modules.shared.glsUniformBlockCase'], false); +goog.addDependency('../../../deqp/modules/shared/glsSamplerObjectTest.js', ['modules.shared.glsSamplerObjectTest'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsShaderExecUtil.js', ['modules.shared.glsShaderExecUtil'], ['framework.common.tcuMatrix', 'framework.common.tcuMatrixUtil', 'framework.common.tcuTexture', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.gluVarType'], false); +goog.addDependency('../../../deqp/modules/shared/glsShaderLibrary.js', ['modules.shared.glsShaderLibrary'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderLibraryCase'], false); +goog.addDependency('../../../deqp/modules/shared/glsShaderLibraryCase.js', ['modules.shared.glsShaderLibraryCase'], ['framework.common.tcuTestCase', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsShaderRenderCase.js', ['modules.shared.glsShaderRenderCase'], ['framework.common.tcuImageCompare', 'framework.common.tcuMatrix', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsStateQuery.js', ['modules.shared.glsStateQuery'], [], false); +goog.addDependency('../../../deqp/modules/shared/glsTextureTestUtil.js', ['modules.shared.glsTextureTestUtil'], ['framework.common.tcuImageCompare', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuStringTemplate', 'framework.common.tcuSurface', 'framework.common.tcuTexCompareVerifier', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsUniformBlockCase.js', ['modules.shared.glsUniformBlockCase'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false); +goog.addDependency('../../../deqp/modules/shared/glsVertexArrayTests.js', ['modules.shared.glsVertexArrayTests'], ['framework.common.tcuFloat', 'framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js new file mode 100644 index 000000000..bc23104c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js @@ -0,0 +1,272 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuBilinearImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + + var tcuBilinearImageCompare = framework.common.tcuBilinearImageCompare; + var deMath = framework.delibs.debase.deMath; + var tcuTexture = framework.common.tcuTexture; + var tcuRGBA = framework.common.tcuRGBA; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + // for bilinear interpolation + /** @const {number} */ tcuBilinearImageCompare.NUM_SUBPIXEL_BITS = 8; + + // Algorithm assumes that colors are packed to 32-bit values as dictated by + // tcu::RGBA::*_SHIFT values. + + function UintRGBA8_R(color) { + return (color >> 24) & 0xff; + } + function UintRGBA8_G(color) { + return (color >> 16) & 0xff; + } + function UintRGBA8_B(color) { + return (color >> 8) & 0xff; + } + function UintRGBA8_A(color) { + return color & 0xff; + } + + /** + * @param {number} fx1 deUint32 + * @param {number} fy1 deUint32 + * @param {number} p00 deUint8 + * @param {number} p01 deUint8 + * @param {number} p10 deUint8 + * @param {number} p11 deUint8 + * @return {number} deUint8 + */ + tcuBilinearImageCompare.interpolateChannel = function(fx1, fy1, p00, p01, p10, p11) { + /** @const {number} */ var fx0 = (1 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) - fx1; + /** @const {number} */ var fy0 = (1 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) - fy1; + /** @const {number} */ + var half = 1 << (tcuBilinearImageCompare.NUM_SUBPIXEL_BITS * 2 - 1); + /** @const {number} */ var sum = + (fx0 * fy0 * p00) + + (fx1 * fy0 * p10) + + (fx0 * fy1 * p01) + + (fx1 * fy1 * p11); + /** @const {number} */ + var rounded = (sum + half) >> (tcuBilinearImageCompare.NUM_SUBPIXEL_BITS * 2); + + DE_ASSERT(deMath.deInRange32(rounded, 0, 0xff)); + return rounded; + }; + + tcuBilinearImageCompare.compareUintRGBA8Threshold = function(a, b, thr) { + if (a == b) + return true; + + return (Math.abs(UintRGBA8_R(a) - UintRGBA8_R(b)) <= thr.getRed() && + Math.abs(UintRGBA8_G(a) - UintRGBA8_G(b)) <= thr.getGreen() && + Math.abs(UintRGBA8_B(a) - UintRGBA8_B(b)) <= thr.getBlue() && + Math.abs(UintRGBA8_A(a) - UintRGBA8_A(b)) <= thr.getAlpha()); + }; + + /** + * @param {tcuTexture.RGBA8View} view + * @param {number} u + * @param {number} v + * @return {number} + */ + tcuBilinearImageCompare.bilinearSampleUintRGBA8 = function(view, u, v) { + /** @type {number} */ var x0 = u >> tcuBilinearImageCompare.NUM_SUBPIXEL_BITS; + /** @type {number} */ var y0 = v >> tcuBilinearImageCompare.NUM_SUBPIXEL_BITS; + /** @type {number} */ var x1 = x0 + 1; + /** @type {number} */ var y1 = y0 + 1; + + DE_ASSERT(x1 < view.getWidth()); + DE_ASSERT(y1 < view.getHeight()); + + /** @type {number} */ var fx1 = u - (x0 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS); + /** @type {number} */ var fy1 = v - (y0 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS); + + /** @type {Array} */ var channelsP00 = view.readUintRGBA8(x0, y0); + /** @type {Array} */ var channelsP10 = view.readUintRGBA8(x1, y0); + /** @type {Array} */ var channelsP01 = view.readUintRGBA8(x0, y1); + /** @type {Array} */ var channelsP11 = view.readUintRGBA8(x1, y1); + + /** @type {number} */ var res = 0; + + res = (tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_R(channelsP00), + UintRGBA8_R(channelsP01), UintRGBA8_R(channelsP10), UintRGBA8_R(channelsP11)) & 0xff) << 24; + res += (tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_G(channelsP00), + UintRGBA8_G(channelsP01), UintRGBA8_G(channelsP10), UintRGBA8_G(channelsP11)) & 0xff) << 16; + res += (tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_B(channelsP00), + UintRGBA8_B(channelsP01), UintRGBA8_B(channelsP10), UintRGBA8_B(channelsP11)) & 0xff) << 8; + res += tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_A(channelsP00), + UintRGBA8_A(channelsP01), UintRGBA8_A(channelsP10), UintRGBA8_A(channelsP11)) & 0xff; + + return res; + }; + + /** + * @param {tcuTexture.RGBA8View} reference + * @param {tcuTexture.RGBA8View} result + * @param {tcuRGBA.RGBA} threshold + * @param {number} x + * @param {number} y + * @return {boolean} + */ + tcuBilinearImageCompare.comparePixelRGBA8 = function(reference, result, threshold, x, y) { + /** @const {tcuRGBA.RGBA} */ var resPix = result.readUintRGBA8(x, y); + + // Step 1: Compare result pixel to 3x3 neighborhood pixels in reference. + /** @const {number} */ var x0 = Math.max(x - 1, 0); + /** @const {number} */ var x1 = x; + /** @const {number} */ + var x2 = Math.min(x + 1, reference.getWidth() - 1); + /** @const {number} */ var y0 = Math.max(y - 1, 0); + /** @const {number} */ var y1 = y; + /** @const {number} */ + var y2 = Math.min(y + 1, reference.getHeight() - 1); + + //tcuBilinearImageCompare.readRGBA8List (reference, x0, y0, x2, y2); + + if (tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x1, y1), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x0, y1), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x2, y1), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x0, y0), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x1, y0), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x2, y0), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x0, y2), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x1, y2), threshold) || + tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x2, y2), threshold)) + return true; + + // Step 2: Compare using bilinear sampling. + // \todo [pyry] Optimize sample positions! + /** @const {Array>} */ var s_offsets = [ + [226, 186], + [335, 235], + [279, 334], + [178, 272], + [112, 202], + [306, 117], + [396, 299], + [206, 382], + [146, 96], + [423, 155], + [361, 412], + [84, 339], + [48, 130], + [367, 43], + [455, 367], + [105, 439], + [83, 46], + [217, 24], + [461, 71], + [450, 459], + [239, 469], + [67, 267], + [459, 255], + [13, 416], + [10, 192], + [141, 502], + [503, 304], + [380, 506] + ]; + + for (var sampleNdx = 0; sampleNdx < s_offsets.length; sampleNdx++) { + /** @const {number} */ + var u = ((x - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) + s_offsets[sampleNdx][0]; + /** @const {number} */ + var v = ((y - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) + s_offsets[sampleNdx][1]; + + if (!deMath.deInBounds32(u, 0, (reference.getWidth() - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) || + !deMath.deInBounds32(v, 0, (reference.getHeight() - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS)) + continue; + + if (tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, tcuBilinearImageCompare.bilinearSampleUintRGBA8(reference, u, v), threshold)) + return true; + } + + return false; + }; + + /** + * @param {tcuTexture.RGBA8View} reference + * @param {tcuTexture.RGBA8View} result + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuRGBA.RGBA} threshold + * @return {boolean} + */ + tcuBilinearImageCompare.bilinearCompareRGBA8 = function(reference, result, errorMask, threshold) { + DE_ASSERT(reference.getFormat().isEqual(new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8))); + DE_ASSERT(result.getFormat().isEqual(new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8))); + + // Clear error mask first to green (faster this way). + errorMask.clear([0.0, 1.0, 0.0, 1.0]); + + /** @type {boolean} */ var allOk = true; + + for (var y = 0; y < reference.getHeight(); y++) { + for (var x = 0; x < reference.getWidth(); x++) { + if (!tcuBilinearImageCompare.comparePixelRGBA8(reference, result, threshold, x, y) && + !tcuBilinearImageCompare.comparePixelRGBA8(result, reference, threshold, x, y)) { + allOk = false; + errorMask.setPixel([1.0, 0.0, 0.0, 1.0], x, y); + } + } + } + + return allOk; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuRGBA.RGBA} threshold + * @return {boolean} + */ + tcuBilinearImageCompare.bilinearCompare = function(reference, result, errorMask, threshold) { + assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight() && result.getDepth() == reference.getDepth(), + 'Reference and result images have different dimensions', false, true); + + assertMsgOptions(errorMask.getWidth() == reference.getWidth() && errorMask.getHeight() == reference.getHeight() && errorMask.getDepth() == reference.getDepth(), + 'Reference and error mask images have different dimensions', false, true); + + /** @type {boolean} */ var isEqual = reference.getFormat().isEqual( + new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8)); + if (isEqual) { + /** @type {tcuTexture.RGBA8View} */ var refView = new tcuTexture.RGBA8View(reference); + /** @type {tcuTexture.RGBA8View} */ var resView = new tcuTexture.RGBA8View(result); + return tcuBilinearImageCompare.bilinearCompareRGBA8(refView, resView, errorMask, threshold); + } else + throw new Error('Unsupported format for bilinear comparison'); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js new file mode 100644 index 000000000..a309f81cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js @@ -0,0 +1,967 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/*--------------------------------------------------------------------*//*! + * \brief Map tcu::TextureFormat to GL pixel transfer format. + * + * Maps generic texture format description to GL pixel transfer format. + * If no mapping is found, throws tcu::InternalError. + * + * \param texFormat Generic texture format. + * \return GL pixel transfer format. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('framework.common.tcuCompressedTexture'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var tcuCompressedTexture = framework.common.tcuCompressedTexture; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + +/** + * @enum + */ +tcuCompressedTexture.Format = { + ETC1_RGB8: 0, + EAC_R11: 1, + EAC_SIGNED_R11: 2, + EAC_RG11: 3, + EAC_SIGNED_RG11: 4, + ETC2_RGB8: 5, + ETC2_SRGB8: 6, + ETC2_RGB8_PUNCHTHROUGH_ALPHA1: 7, + ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: 8, + ETC2_EAC_RGBA8: 9, + ETC2_EAC_SRGB8_ALPHA8: 10, + + ASTC_4x4_RGBA: 11, + ASTC_5x4_RGBA: 12, + ASTC_5x5_RGBA: 13, + ASTC_6x5_RGBA: 14, + ASTC_6x6_RGBA: 15, + ASTC_8x5_RGBA: 16, + ASTC_8x6_RGBA: 17, + ASTC_8x8_RGBA: 18, + ASTC_10x5_RGBA: 19, + ASTC_10x6_RGBA: 20, + ASTC_10x8_RGBA: 21, + ASTC_10x10_RGBA: 22, + ASTC_12x10_RGBA: 23, + ASTC_12x12_RGBA: 24, + ASTC_4x4_SRGB8_ALPHA8: 25, + ASTC_5x4_SRGB8_ALPHA8: 26, + ASTC_5x5_SRGB8_ALPHA8: 27, + ASTC_6x5_SRGB8_ALPHA8: 28, + ASTC_6x6_SRGB8_ALPHA8: 29, + ASTC_8x5_SRGB8_ALPHA8: 30, + ASTC_8x6_SRGB8_ALPHA8: 31, + ASTC_8x8_SRGB8_ALPHA8: 32, + ASTC_10x5_SRGB8_ALPHA8: 33, + ASTC_10x6_SRGB8_ALPHA8: 34, + ASTC_10x8_SRGB8_ALPHA8: 35, + ASTC_10x10_SRGB8_ALPHA8: 36, + ASTC_12x10_SRGB8_ALPHA8: 37, + ASTC_12x12_SRGB8_ALPHA8: 38 +}; + +tcuCompressedTexture.divRoundUp = function(a, b) { + return Math.floor(a / b) + ((a % b) ? 1 : 0); +}; + +tcuCompressedTexture.isEtcFormat = function(fmt) { + // WebGL2 supports ETC2 and EAC formats + switch (fmt) { + // case tcuCompressedTexture.Format.ETC1_RGB8: + case tcuCompressedTexture.Format.EAC_R11: + case tcuCompressedTexture.Format.EAC_SIGNED_R11: + case tcuCompressedTexture.Format.EAC_RG11: + case tcuCompressedTexture.Format.EAC_SIGNED_RG11: + case tcuCompressedTexture.Format.ETC2_RGB8: + case tcuCompressedTexture.Format.ETC2_SRGB8: + case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: + case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: + case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: + case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: + return true; + + default: + return false; + } +}; + +tcuCompressedTexture.etcDecompressInternal = function() { + +var ETC2_BLOCK_WIDTH = 4; +var ETC2_BLOCK_HEIGHT = 4; +var ETC2_UNCOMPRESSED_PIXEL_SIZE_A8 = 1; +var ETC2_UNCOMPRESSED_PIXEL_SIZE_R11 = 2; +var ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11 = 4; +var ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8 = 3; +var ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 = 4; +var ETC2_UNCOMPRESSED_BLOCK_SIZE_A8 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; +var ETC2_UNCOMPRESSED_BLOCK_SIZE_R11 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_R11; +var ETC2_UNCOMPRESSED_BLOCK_SIZE_RG11 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11; +var ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; +var ETC2_UNCOMPRESSED_BLOCK_SIZE_RGBA8 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8; + +/** + * @param {ArrayBuffer} src Source ArrayBuffer + * @return {Uint8Array} + */ +var get64BitBlock = function(src, blockNdx) { + var block = new Uint8Array(src, blockNdx * 8, 8); + return block; +}; + +/** + * @param {ArrayBuffer} src Source ArrayBuffer + * Return the first 64 bits of a 128 bit block. + */ +var get128BitBlockStart = function(src, blockNdx) { + return get64BitBlock(src, 2 * blockNdx); +}; + +/** + * @param {ArrayBuffer} src Source ArrayBuffer + * Return the last 64 bits of a 128 bit block. + */ +var get128BitBlockEnd = function(src, blockNdx) { + return get64BitBlock(src, 2 * blockNdx + 1); +}; + +var mask8 = function(src, low, high) { + if (low > 7 || high < 0) + return { + value: 0, + bits: 0 + }; + + var numBits = high - low + 1; + var mask = (1 << numBits) - 1; + + return { + value: (src >> low) & mask, + bits: numBits + }; +}; + +var getBits64 = function(src, low, high) { + var result = 0; + var bits = 0; + var lowIndex = low; + var highIndex = high; + for (var i = 7; i >= 0; i--) { + var v = mask8(src[i], Math.max(0, lowIndex), Math.min(7, highIndex)); + lowIndex = lowIndex - 8; + highIndex = highIndex - 8; + result = result | (v.value << bits); + bits = v.bits; + } + return result; +}; + +var getBit64 = function(src, bit) { + return getBits64(src, bit, bit); +}; + +var extendSigned3To8 = function(src) { + var isNeg = (src & (1 << 2)) != 0; + var val = isNeg ? src - 8 : src; + return val; +}; + +var extend4To8 = function(src) { + return src * 255 / 15; +}; + +var extend5To8 = function(src) { + return src * 255 / 31; +}; + +var extend6To8 = function(src) { + return src * 255 / 63; +}; + +var extend7To8 = function(src) { + return src * 255 / 127; +}; + +var extend11To16 = function(src) { + return src * 32.015144; +}; + +var extend11To16WithSign = function(src) { + if (src < 0) + return -extend11To16(-src); + else + return extend11To16(src); +}; + +/** + * @param { (Uint16Array|Int16Array) } dst + * @param {Uint8Array} src + * @param {boolean} signedMode + */ +var decompressEAC11Block = function(dst, src, signedMode) { + var modifierTable = [ + [-3, -6, -9, -15, 2, 5, 8, 14], + [-3, -7, -10, -13, 2, 6, 9, 12], + [-2, -5, -8, -13, 1, 4, 7, 12], + [-2, -4, -6, -13, 1, 3, 5, 12], + [-3, -6, -8, -12, 2, 5, 7, 11], + [-3, -7, -9, -11, 2, 6, 8, 10], + [-4, -7, -8, -11, 3, 6, 7, 10], + [-3, -5, -8, -11, 2, 4, 7, 10], + [-2, -6, -8, -10, 1, 5, 7, 9], + [-2, -5, -8, -10, 1, 4, 7, 9], + [-2, -4, -8, -10, 1, 3, 7, 9], + [-2, -5, -7, -10, 1, 4, 6, 9], + [-3, -4, -7, -10, 2, 3, 6, 9], + [-1, -2, -3, -10, 0, 1, 2, 9], + [-4, -6, -8, -9, 3, 5, 7, 8], + [-3, -5, -7, -9, 2, 4, 6, 8] + ]; + + var multiplier = getBits64(src, 52, 55); + var tableNdx = getBits64(src, 48, 51); + var baseCodeword = getBits64(src, 56, 63); + + if (signedMode) { + if (baseCodeword > 127) + baseCodeword -= 256; + if (baseCodeword == -128) + baseCodeword = -127; + } + + var pixelNdx = 0; + for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) { + for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++) { + var dstOffset = (y * ETC2_BLOCK_WIDTH + x); + var pixelBitNdx = 45 - 3 * pixelNdx; + var modifierNdx = (getBit64(src, pixelBitNdx + 2) << 2) | (getBit64(src, pixelBitNdx + 1) << 1) | getBit64(src, pixelBitNdx); + var modifier = modifierTable[tableNdx][modifierNdx]; + + if (signedMode) { + if (multiplier != 0) + dst[dstOffset] = deMath.clamp(baseCodeword * 8 + multiplier * modifier * 8, -1023, 1023); + else + dst[dstOffset] = deMath.clamp(baseCodeword * 8 + modifier, -1023, 1023); + } else { + if (multiplier != 0) + dst[dstOffset] = deMath.clamp(baseCodeword * 8 + 4 + multiplier * modifier * 8, 0, 2047); + else + dst[dstOffset] = deMath.clamp(baseCodeword * 8 + 4 + modifier, 0, 2047); + } + pixelNdx++; + } + } +}; + +var decompressEAC_R11 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src, signedMode) { + /** @const */ var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4); + /** @const */ var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4); + var dstPtr; + var dstRowPitch = dst.getRowPitch(); + var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_R11; + var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_R11); + var uncompressedBlock16; + if (signedMode) { + dstPtr = new Int16Array(dst.m_data); + uncompressedBlock16 = new Int16Array(uncompressedBlockArray); + } else { + dstPtr = new Uint16Array(dst.m_data); + uncompressedBlock16 = new Uint16Array(uncompressedBlockArray); + } + + for (var blockY = 0; blockY < numBlocksY; blockY++) { + for (var blockX = 0; blockX < numBlocksX; blockX++) { + /*const deUint64*/ var compressedBlock = get64BitBlock(src, blockY * numBlocksX + blockX); + + // Decompress. + decompressEAC11Block(uncompressedBlock16, compressedBlock, signedMode); + + // Write to dst. + var baseX = blockX * ETC2_BLOCK_WIDTH; + var baseY = blockY * ETC2_BLOCK_HEIGHT; + for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) { + for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) { + DE_ASSERT(ETC2_UNCOMPRESSED_PIXEL_SIZE_R11 == 2); + + if (signedMode) { + var srcIndex = y * ETC2_BLOCK_WIDTH + x; + var dstIndex = (baseY + y) * dstRowPitch / dstPixelSize + baseX + x; + + dstPtr[dstIndex] = extend11To16WithSign(uncompressedBlock16[srcIndex]); + } else { + var srcIndex = y * ETC2_BLOCK_WIDTH + x; + var dstIndex = (baseY + y) * dstRowPitch / dstPixelSize + baseX + x; + + dstPtr[dstIndex] = extend11To16(uncompressedBlock16[srcIndex]); + } + } + } + } + } +}; + +var decompressEAC_RG11 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src, signedMode) { + /** @const */ var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4); + /** @const */ var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4); + var dstPtr; + var dstRowPitch = dst.getRowPitch(); + var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11; + var uncompressedBlockArrayR = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_R11); + var uncompressedBlockArrayG = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_R11); + var uncompressedBlockR16; + var uncompressedBlockG16; + if (signedMode) { + dstPtr = new Int16Array(dst.m_data); + uncompressedBlockR16 = new Int16Array(uncompressedBlockArrayR); + uncompressedBlockG16 = new Int16Array(uncompressedBlockArrayG); + } else { + dstPtr = new Uint16Array(dst.m_data); + uncompressedBlockR16 = new Uint16Array(uncompressedBlockArrayR); + uncompressedBlockG16 = new Uint16Array(uncompressedBlockArrayG); + } + + for (var blockY = 0; blockY < numBlocksY; blockY++) { + for (var blockX = 0; blockX < numBlocksX; blockX++) { + /*const deUint64*/ var compressedBlockR = get128BitBlockStart(src, blockY * numBlocksX + blockX); + /*const deUint64*/ var compressedBlockG = get128BitBlockEnd(src, blockY * numBlocksX + blockX); + + // Decompress. + decompressEAC11Block(uncompressedBlockR16, compressedBlockR, signedMode); + decompressEAC11Block(uncompressedBlockG16, compressedBlockG, signedMode); + + // Write to dst. + var baseX = blockX * ETC2_BLOCK_WIDTH; + var baseY = blockY * ETC2_BLOCK_HEIGHT; + for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) { + for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) { + DE_ASSERT(ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11 == 4); + + if (signedMode) { + var srcIndex = y * ETC2_BLOCK_WIDTH + x; + var dstIndex = 2 * ((baseY + y) * dstRowPitch / dstPixelSize + baseX + x); + + dstPtr[dstIndex] = extend11To16WithSign(uncompressedBlockR16[srcIndex]); + dstPtr[dstIndex + 1] = extend11To16WithSign(uncompressedBlockG16[srcIndex]); + } else { + var srcIndex = y * ETC2_BLOCK_WIDTH + x; + var dstIndex = 2 * ((baseY + y) * dstRowPitch / dstPixelSize + baseX + x); + + dstPtr[dstIndex] = extend11To16(uncompressedBlockR16[srcIndex]); + dstPtr[dstIndex + 1] = extend11To16(uncompressedBlockG16[srcIndex]); + } + } + } + } + } +}; + +// if alphaMode is true, do PUNCHTHROUGH and store alpha to alphaDst; otherwise do ordinary ETC2 RGB8. +/** + * @param {Uint8Array} dst Destination array + * @param {Uint8Array} src Source array + * @param {Uint8Array} alphaDst Optional Alpha output channel + */ +var decompressETC2Block = function(dst, src, alphaDst, alphaMode) { + /** + * enum + */ + var Etc2Mode = { + MODE_INDIVIDUAL: 0, + MODE_DIFFERENTIAL: 1, + MODE_T: 2, + MODE_H: 3, + MODE_PLANAR: 4 + }; + + var diffOpaqueBit = getBit64(src, 33); + var selBR = getBits64(src, 59, 63); // 5 bits. + var selBG = getBits64(src, 51, 55); + var selBB = getBits64(src, 43, 47); + var selDR = extendSigned3To8(getBits64(src, 56, 58)); // 3 bits. + var selDG = extendSigned3To8(getBits64(src, 48, 50)); + var selDB = extendSigned3To8(getBits64(src, 40, 42)); + + var mode; + + if (!alphaMode && diffOpaqueBit == 0) + mode = Etc2Mode.MODE_INDIVIDUAL; + else if (!deMath.deInRange32(selBR + selDR, 0, 31)) + mode = Etc2Mode.MODE_T; + else if (!deMath.deInRange32(selBG + selDG, 0, 31)) + mode = Etc2Mode.MODE_H; + else if (!deMath.deInRange32(selBB + selDB, 0, 31)) + mode = Etc2Mode.MODE_PLANAR; + else + mode = Etc2Mode.MODE_DIFFERENTIAL; + + if (mode == Etc2Mode.MODE_INDIVIDUAL || mode == Etc2Mode.MODE_DIFFERENTIAL) { + // Individual and differential modes have some steps in common, handle them here. + var modifierTable = [ + // 00 01 10 11 + [2, 8, -2, -8], + [5, 17, -5, -17], + [9, 29, -9, -29], + [13, 42, -13, -42], + [18, 60, -18, -60], + [24, 80, -24, -80], + [33, 106, -33, -106], + [47, 183, -47, -183] + ]; + + var flipBit = getBit64(src, 32); + var table = [getBits64(src, 37, 39), getBits64(src, 34, 36)]; + var baseR = []; + var baseG = []; + var baseB = []; + + if (mode == Etc2Mode.MODE_INDIVIDUAL) { + // Individual mode, initial values. + baseR[0] = extend4To8(getBits64(src, 60, 63)); + baseR[1] = extend4To8(getBits64(src, 56, 59)); + baseG[0] = extend4To8(getBits64(src, 52, 55)); + baseG[1] = extend4To8(getBits64(src, 48, 51)); + baseB[0] = extend4To8(getBits64(src, 44, 47)); + baseB[1] = extend4To8(getBits64(src, 40, 43)); + } else { + // Differential mode, initial values. + baseR[0] = extend5To8(selBR); + baseG[0] = extend5To8(selBG); + baseB[0] = extend5To8(selBB); + + baseR[1] = extend5To8((selBR + selDR)); + baseG[1] = extend5To8((selBG + selDG)); + baseB[1] = extend5To8((selBB + selDB)); + } + + // Write final pixels for individual or differential mode. + var pixelNdx = 0; + for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) { + for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++, pixelNdx++) { + var dstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; + var subBlock = ((flipBit ? y : x) >= 2) ? 1 : 0; + var tableNdx = table[subBlock]; + var modifierNdx = (getBit64(src, 16 + pixelNdx) << 1) | getBit64(src, pixelNdx); + var alphaDstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; // Only needed for PUNCHTHROUGH version. + + // If doing PUNCHTHROUGH version (alphaMode), opaque bit may affect colors. + if (alphaMode && diffOpaqueBit == 0 && modifierNdx == 2) { + dst[dstOffset + 0] = 0; + dst[dstOffset + 1] = 0; + dst[dstOffset + 2] = 0; + alphaDst[alphaDstOffset] = 0; + } else { + var modifier; + + // PUNCHTHROUGH version and opaque bit may also affect modifiers. + if (alphaMode && diffOpaqueBit == 0 && (modifierNdx == 0 || modifierNdx == 2)) + modifier = 0; + else + modifier = modifierTable[tableNdx][modifierNdx]; + + dst[dstOffset + 0] = deMath.clamp(baseR[subBlock] + modifier, 0, 255); + dst[dstOffset + 1] = deMath.clamp(baseG[subBlock] + modifier, 0, 255); + dst[dstOffset + 2] = deMath.clamp(baseB[subBlock] + modifier, 0, 255); + + if (alphaMode) + alphaDst[alphaDstOffset] = 255; + } + } + } + } else if (mode == Etc2Mode.MODE_T || mode == Etc2Mode.MODE_H) { + // T and H modes have some steps in common, handle them here. + var distTable = [3, 6, 11, 16, 23, 32, 41, 64]; + + var paintR = []; + var paintG = []; + var paintB = []; + + if (mode == Etc2Mode.MODE_T) { + // T mode, calculate paint values. + var R1a = getBits64(src, 59, 60); + var R1b = getBits64(src, 56, 57); + var G1 = getBits64(src, 52, 55); + var B1 = getBits64(src, 48, 51); + var R2 = getBits64(src, 44, 47); + var G2 = getBits64(src, 40, 43); + var B2 = getBits64(src, 36, 39); + var distNdx = (getBits64(src, 34, 35) << 1) | getBit64(src, 32); + var dist = distTable[distNdx]; + + paintR[0] = extend4To8((R1a << 2) | R1b); + paintG[0] = extend4To8(G1); + paintB[0] = extend4To8(B1); + paintR[2] = extend4To8(R2); + paintG[2] = extend4To8(G2); + paintB[2] = extend4To8(B2); + paintR[1] = deMath.clamp(paintR[2] + dist, 0, 255); + paintG[1] = deMath.clamp(paintG[2] + dist, 0, 255); + paintB[1] = deMath.clamp(paintB[2] + dist, 0, 255); + paintR[3] = deMath.clamp(paintR[2] - dist, 0, 255); + paintG[3] = deMath.clamp(paintG[2] - dist, 0, 255); + paintB[3] = deMath.clamp(paintB[2] - dist, 0, 255); + } else { + // H mode, calculate paint values. + var R1 = getBits64(src, 59, 62); + var G1a = getBits64(src, 56, 58); + var G1b = getBit64(src, 52); + var B1a = getBit64(src, 51); + var B1b = getBits64(src, 47, 49); + var R2 = getBits64(src, 43, 46); + var G2 = getBits64(src, 39, 42); + var B2 = getBits64(src, 35, 38); + var baseR = []; + var baseG = []; + var baseB = []; + var baseValue = []; + var distNdx; + var dist; + + baseR[0] = extend4To8(R1); + baseG[0] = extend4To8((G1a << 1) | G1b); + baseB[0] = extend4To8((B1a << 3) | B1b); + baseR[1] = extend4To8(R2); + baseG[1] = extend4To8(G2); + baseB[1] = extend4To8(B2); + baseValue[0] = ((baseR[0]) << 16) | ((baseG[0]) << 8) | baseB[0]; + baseValue[1] = ((baseR[1]) << 16) | ((baseG[1]) << 8) | baseB[1]; + distNdx = (getBit64(src, 34) << 2) | (getBit64(src, 32) << 1); + if (baseValue[0] >= baseValue[1]) + distNdx += 1; + dist = distTable[distNdx]; + + paintR[0] = deMath.clamp(baseR[0] + dist, 0, 255); + paintG[0] = deMath.clamp(baseG[0] + dist, 0, 255); + paintB[0] = deMath.clamp(baseB[0] + dist, 0, 255); + paintR[1] = deMath.clamp(baseR[0] - dist, 0, 255); + paintG[1] = deMath.clamp(baseG[0] - dist, 0, 255); + paintB[1] = deMath.clamp(baseB[0] - dist, 0, 255); + paintR[2] = deMath.clamp(baseR[1] + dist, 0, 255); + paintG[2] = deMath.clamp(baseG[1] + dist, 0, 255); + paintB[2] = deMath.clamp(baseB[1] + dist, 0, 255); + paintR[3] = deMath.clamp(baseR[1] - dist, 0, 255); + paintG[3] = deMath.clamp(baseG[1] - dist, 0, 255); + paintB[3] = deMath.clamp(baseB[1] - dist, 0, 255); + } + + // Write final pixels for T or H mode. + var pixelNdx = 0; + for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) { + for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++, pixelNdx++) { + var dstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; + var paintNdx = (getBit64(src, 16 + pixelNdx) << 1) | getBit64(src, pixelNdx); + var alphaDstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; // Only needed for PUNCHTHROUGH version. + + if (alphaMode && diffOpaqueBit == 0 && paintNdx == 2) { + dst[dstOffset + 0] = 0; + dst[dstOffset + 1] = 0; + dst[dstOffset + 2] = 0; + alphaDst[alphaDstOffset] = 0; + } else { + dst[dstOffset + 0] = deMath.clamp(paintR[paintNdx], 0, 255); + dst[dstOffset + 1] = deMath.clamp(paintG[paintNdx], 0, 255); + dst[dstOffset + 2] = deMath.clamp(paintB[paintNdx], 0, 255); + + if (alphaMode) + alphaDst[alphaDstOffset] = 255; + } + } + } + } else { + // Planar mode. + var GO1 = getBit64(src, 56); + var GO2 = getBits64(src, 49, 54); + var BO1 = getBit64(src, 48); + var BO2 = getBits64(src, 43, 44); + var BO3 = getBits64(src, 39, 41); + var RH1 = getBits64(src, 34, 38); + var RH2 = getBit64(src, 32); + var RO = extend6To8(getBits64(src, 57, 62)); + var GO = extend7To8((GO1 << 6) | GO2); + var BO = extend6To8((BO1 << 5) | (BO2 << 3) | BO3); + var RH = extend6To8((RH1 << 1) | RH2); + var GH = extend7To8(getBits64(src, 25, 31)); + var BH = extend6To8(getBits64(src, 19, 24)); + var RV = extend6To8(getBits64(src, 13, 18)); + var GV = extend7To8(getBits64(src, 6, 12)); + var BV = extend6To8(getBits64(src, 0, 5)); + + // Write final pixels for planar mode. + for (var y = 0; y < 4; y++) { + for (var x = 0; x < 4; x++) { + var dstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; + var unclampedR = (x * (RH - RO) + y * (RV - RO) + 4 * RO + 2) / 4; + var unclampedG = (x * (GH - GO) + y * (GV - GO) + 4 * GO + 2) / 4; + var unclampedB = (x * (BH - BO) + y * (BV - BO) + 4 * BO + 2) / 4; + var alphaDstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; // Only needed for PUNCHTHROUGH version. + + dst[dstOffset + 0] = deMath.clamp(unclampedR, 0, 255); + dst[dstOffset + 1] = deMath.clamp(unclampedG, 0, 255); + dst[dstOffset + 2] = deMath.clamp(unclampedB, 0, 255); + + if (alphaMode) + alphaDst[alphaDstOffset] = 255; + } + } + } +}; + +var decompressEAC8Block = function(dst, src) { + var modifierTable = [ + [-3, -6, -9, -15, 2, 5, 8, 14], + [-3, -7, -10, -13, 2, 6, 9, 12], + [-2, -5, -8, -13, 1, 4, 7, 12], + [-2, -4, -6, -13, 1, 3, 5, 12], + [-3, -6, -8, -12, 2, 5, 7, 11], + [-3, -7, -9, -11, 2, 6, 8, 10], + [-4, -7, -8, -11, 3, 6, 7, 10], + [-3, -5, -8, -11, 2, 4, 7, 10], + [-2, -6, -8, -10, 1, 5, 7, 9], + [-2, -5, -8, -10, 1, 4, 7, 9], + [-2, -4, -8, -10, 1, 3, 7, 9], + [-2, -5, -7, -10, 1, 4, 6, 9], + [-3, -4, -7, -10, 2, 3, 6, 9], + [-1, -2, -3, -10, 0, 1, 2, 9], + [-4, -6, -8, -9, 3, 5, 7, 8], + [-3, -5, -7, -9, 2, 4, 6, 8] + ]; + + var baseCodeword = getBits64(src, 56, 63); + var multiplier = getBits64(src, 52, 55); + var tableNdx = getBits64(src, 48, 51); + + var pixelNdx = 0; + for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) { + for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++, pixelNdx++) { + var dstOffset = (y * ETC2_BLOCK_WIDTH + x); + var pixelBitNdx = 45 - 3 * pixelNdx; + var modifierNdx = (getBit64(src, pixelBitNdx + 2) << 2) | (getBit64(src, pixelBitNdx + 1) << 1) | getBit64(src, pixelBitNdx); + var modifier = modifierTable[tableNdx][modifierNdx]; + + dst[dstOffset] = deMath.clamp(baseCodeword + multiplier * modifier, 0, 255); + } + } +}; + +var decompressETC2 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src) { + var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4); + var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4); + var dstPtr = new Uint8Array(dst.m_data); + var dstRowPitch = dst.getRowPitch(); + var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; + var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8); + var uncompressedBlock = new Uint8Array(uncompressedBlockArray); + + for (var blockY = 0; blockY < numBlocksY; blockY++) { + for (var blockX = 0; blockX < numBlocksX; blockX++) { + var compressedBlock = get64BitBlock(src, blockY * numBlocksX + blockX); + + // Decompress. + decompressETC2Block(uncompressedBlock, compressedBlock, null, false); + + // Write to dst. + var baseX = blockX * ETC2_BLOCK_WIDTH; + var baseY = blockY * ETC2_BLOCK_HEIGHT; + for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) { + for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) { + var srcIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; + var dstIndex = (baseY + y) * dstRowPitch + (baseX + x) * dstPixelSize; + + for (var i = 0; i < ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; i++) + dstPtr[dstIndex + i] = uncompressedBlock[srcIndex + i]; + } + } + } + } +}; + +var decompressETC2_EAC_RGBA8 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src) { + var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4); + var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4); + var dstPtr = new Uint8Array(dst.m_data); + var dstRowPitch = dst.getRowPitch(); + var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8; + var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8); + var uncompressedBlock = new Uint8Array(uncompressedBlockArray); + var uncompressedBlockAlphaArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_A8); + var uncompressedBlockAlpha = new Uint8Array(uncompressedBlockAlphaArray); + + for (var blockY = 0; blockY < numBlocksY; blockY++) { + for (var blockX = 0; blockX < numBlocksX; blockX++) { + var compressedBlockAlpha = get128BitBlockStart(src, blockY * numBlocksX + blockX); + var compressedBlockRGB = get128BitBlockEnd(src, blockY * numBlocksX + blockX); + + // Decompress. + decompressETC2Block(uncompressedBlock, compressedBlockRGB, null, false); + decompressEAC8Block(uncompressedBlockAlpha, compressedBlockAlpha); + + // Write to dst. + var baseX = blockX * ETC2_BLOCK_WIDTH; + var baseY = blockY * ETC2_BLOCK_HEIGHT; + for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) { + for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) { + var srcIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; + var srcAlphaIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; + var dstIndex = (baseY + y) * dstRowPitch + (baseX + x) * dstPixelSize; + + for (var i = 0; i < ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1; i++) + dstPtr[dstIndex + i] = uncompressedBlock[srcIndex + i]; + dstPtr[dstIndex + ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1] = uncompressedBlockAlpha[srcAlphaIndex]; + + } + } + } + } +}; + +var decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src) { + var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4); + var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4); + var dstPtr = new Uint8Array(dst.m_data); + var dstRowPitch = dst.getRowPitch(); + var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8; + var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8); + var uncompressedBlock = new Uint8Array(uncompressedBlockArray); + var uncompressedBlockAlphaArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_A8); + var uncompressedBlockAlpha = new Uint8Array(uncompressedBlockAlphaArray); + + for (var blockY = 0; blockY < numBlocksY; blockY++) { + for (var blockX = 0; blockX < numBlocksX; blockX++) { + var compressedBlock = get64BitBlock(src, blockY * numBlocksX + blockX); + + // Decompress. + decompressETC2Block(uncompressedBlock, compressedBlock, uncompressedBlockAlpha, true); + + // Write to dst. + var baseX = blockX * ETC2_BLOCK_WIDTH; + var baseY = blockY * ETC2_BLOCK_HEIGHT; + for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) { + for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) { + var srcIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; + var srcAlphaIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; + var dstIndex = (baseY + y) * dstRowPitch + (baseX + x) * dstPixelSize; + + for (var i = 0; i < ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1; i++) + dstPtr[dstIndex + i] = uncompressedBlock[srcIndex + i]; + dstPtr[dstIndex + ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1] = uncompressedBlockAlpha[srcAlphaIndex]; + + } + } + } + } +}; + +return { + decompressEAC_R11: decompressEAC_R11, + decompressEAC_RG11: decompressEAC_RG11, + decompressETC2: decompressETC2, + decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1: decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1, + decompressETC2_EAC_RGBA8: decompressETC2_EAC_RGBA8 +}; + +}(); + +/** + * @constructor + * @param {tcuCompressedTexture.Format} format + * @param {number} width + * @param {number} height + * @param {number=} depth + */ +tcuCompressedTexture.CompressedTexture = function(format, width, height, depth) { + depth = depth === undefined ? 1 : depth; + this.setStorage(format, width, height, depth); + /** @type {Uint8Array} */ this.m_data; +}; + +/** + * @return {number} + */ +tcuCompressedTexture.CompressedTexture.prototype.getDataSize = function() { + return this.m_data.length; +}; + +/** + * @return {Uint8Array} + */ +tcuCompressedTexture.CompressedTexture.prototype.getData = function() { + return this.m_data; +}; + +/** + * @return {number} + */ +tcuCompressedTexture.CompressedTexture.prototype.getWidth = function() { + return this.m_width; +}; + +/** + * @return {number} + */ +tcuCompressedTexture.CompressedTexture.prototype.getHeight = function() { + return this.m_height; +}; + +/** + * @return {tcuCompressedTexture.Format} + */ +tcuCompressedTexture.CompressedTexture.prototype.getFormat = function() { + return this.m_format; +}; + +tcuCompressedTexture.CompressedTexture.prototype.setStorage = function(format, width, height, depth) { + depth = depth === undefined ? 1 : depth; + this.m_format = format; + this.m_width = width; + this.m_height = height; + this.m_depth = depth; + + if (tcuCompressedTexture.isEtcFormat(this.m_format)) { + DE_ASSERT(this.m_depth == 1); + + var blockSizeMultiplier = 0; // How many 64-bit parts each compressed block contains. + + switch (this.m_format) { + case tcuCompressedTexture.Format.ETC1_RGB8: blockSizeMultiplier = 1; break; + case tcuCompressedTexture.Format.EAC_R11: blockSizeMultiplier = 1; break; + case tcuCompressedTexture.Format.EAC_SIGNED_R11: blockSizeMultiplier = 1; break; + case tcuCompressedTexture.Format.EAC_RG11: blockSizeMultiplier = 2; break; + case tcuCompressedTexture.Format.EAC_SIGNED_RG11: blockSizeMultiplier = 2; break; + case tcuCompressedTexture.Format.ETC2_RGB8: blockSizeMultiplier = 1; break; + case tcuCompressedTexture.Format.ETC2_SRGB8: blockSizeMultiplier = 1; break; + case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: blockSizeMultiplier = 1; break; + case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: blockSizeMultiplier = 1; break; + case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: blockSizeMultiplier = 2; break; + case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: blockSizeMultiplier = 2; break; + + default: + throw new Error('Unsupported format ' + format); + break; + } + + this.m_array = new ArrayBuffer(blockSizeMultiplier * 8 * tcuCompressedTexture.divRoundUp(this.m_width, 4) * tcuCompressedTexture.divRoundUp(this.m_height, 4)); + this.m_data = new Uint8Array(this.m_array); + } + // else if (isASTCFormat(this.m_format)) + // { + // if (this.m_depth > 1) + // throw tcu::InternalError("3D ASTC textures not currently supported"); + + // const IVec3 blockSize = getASTCBlockSize(this.m_format); + // this.m_data.resize(ASTC_BLOCK_SIZE_BYTES * tcuCompressedTexture.divRoundUp(this.m_width, blockSize[0]) * tcuCompressedTexture.divRoundUp(this.m_height, blockSize[1]) * tcuCompressedTexture.divRoundUp(this.m_depth, blockSize[2])); + // } + // else + // { + // DE_ASSERT(this.m_format == FORMAT_LAST); + // DE_ASSERT(this.m_width == 0 && this.m_height == 0 && this.m_depth == 0); + // this.m_data.resize(0); + // } +}; + +/*--------------------------------------------------------------------*//*! + * \brief Get uncompressed texture format + *//*--------------------------------------------------------------------*/ +tcuCompressedTexture.CompressedTexture.prototype.getUncompressedFormat = function() { + if (tcuCompressedTexture.isEtcFormat(this.m_format)) { + switch (this.m_format) { + case tcuCompressedTexture.Format.ETC1_RGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8); + case tcuCompressedTexture.Format.EAC_R11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT16); + case tcuCompressedTexture.Format.EAC_SIGNED_R11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT16); + case tcuCompressedTexture.Format.EAC_RG11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT16); + case tcuCompressedTexture.Format.EAC_SIGNED_RG11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT16); + case tcuCompressedTexture.Format.ETC2_RGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8); + case tcuCompressedTexture.Format.ETC2_SRGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGB, tcuTexture.ChannelType.UNORM_INT8); + case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8); + case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8); + default: + throw new Error('Unsupported format ' + this.m_format); + } + } + // else if (isASTCFormat(m_format)) + // { + // if (isASTCSRGBFormat(m_format)) + // return TextureFormat(tcuTexture.ChannelType.sRGBA, tcuTexture.ChannelType.UNORM_INT8); + // else + // return TextureFormat(tcuTexture.ChannelType.RGBA, tcuTexture.ChannelType.HALF_FLOAT); + // } + // else + // { + // DE_ASSERT(false); + // return TextureFormat(); + // } +}; + +/** + * Decode to uncompressed pixel data + * @param {tcuTexture.PixelBufferAccess} dst Destination buffer + */ +tcuCompressedTexture.CompressedTexture.prototype.decompress = function(dst) { + DE_ASSERT(dst.getWidth() == this.m_width && dst.getHeight() == this.m_height && dst.getDepth() == 1); + var format = this.getUncompressedFormat(); + if (dst.getFormat().order != format.order || dst.getFormat().type != format.type) + throw new Error('Formats do not match.'); + + if (tcuCompressedTexture.isEtcFormat(this.m_format)) { + switch (this.m_format) { + // case tcuCompressedTexture.Format.ETC1_RGB8: decompressETC1 (dst, this.m_width, this.m_height, this.m_data); break; + case tcuCompressedTexture.Format.EAC_R11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_R11(dst, this.m_width, this.m_height, this.m_array, false); break; + case tcuCompressedTexture.Format.EAC_SIGNED_R11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_R11(dst, this.m_width, this.m_height, this.m_array, true); break; + case tcuCompressedTexture.Format.EAC_RG11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_RG11(dst, this.m_width, this.m_height, this.m_array, false); break; + case tcuCompressedTexture.Format.EAC_SIGNED_RG11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_RG11(dst, this.m_width, this.m_height, this.m_array, true); break; + case tcuCompressedTexture.Format.ETC2_RGB8: tcuCompressedTexture.etcDecompressInternal.decompressETC2(dst, this.m_width, this.m_height, this.m_array); break; + case tcuCompressedTexture.Format.ETC2_SRGB8: tcuCompressedTexture.etcDecompressInternal.decompressETC2(dst, this.m_width, this.m_height, this.m_array); break; + case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: tcuCompressedTexture.etcDecompressInternal.decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1(dst, this.m_width, this.m_height, this.m_array); break; + case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: tcuCompressedTexture.etcDecompressInternal.decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1(dst, this.m_width, this.m_height, this.m_array); break; + case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: tcuCompressedTexture.etcDecompressInternal.decompressETC2_EAC_RGBA8(dst, this.m_width, this.m_height, this.m_array); break; + case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: tcuCompressedTexture.etcDecompressInternal.decompressETC2_EAC_RGBA8(dst, this.m_width, this.m_height, this.m_array); break; + + default: + throw new Error('Unsupported format ' + this.m_format); + break; + } + } + // else if (isASTCFormat(m_format)) + // { + // const tcu::IVec3 blockSize = getASTCBlockSize(m_format); + // const bool isSRGBFormat = isASTCSRGBFormat(m_format); + + // if (blockSize[2] > 1) + // throw tcu::InternalError("3D ASTC textures not currently supported"); + + // decompressASTC(dst, m_width, m_height, &m_data[0], blockSize[0], blockSize[1], isSRGBFormat, isSRGBFormat || params.isASTCModeLDR); + // } /**/ + else + throw new Error('Unsupported format ' + this.m_format); +}; + + }); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js new file mode 100644 index 000000000..3d91ab5aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js @@ -0,0 +1,809 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuFloat'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var tcuFloat = framework.common.tcuFloat; +var deMath = framework.delibs.debase.deMath; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +tcuFloat.FloatFlags = { + FLOAT_HAS_SIGN: (1 << 0), + FLOAT_SUPPORT_DENORM: (1 << 1) +}; + +/** + * Defines a tcuFloat.FloatDescription object, which is an essential part of the tcuFloat.deFloat type. + * Holds the information that shapes the tcuFloat.deFloat. + * @constructor + */ +tcuFloat.FloatDescription = function(exponentBits, mantissaBits, exponentBias, flags) { + this.ExponentBits = exponentBits; + this.MantissaBits = mantissaBits; + this.ExponentBias = exponentBias; + this.Flags = flags; + + this.totalBitSize = 1 + this.ExponentBits + this.MantissaBits; + this.totalByteSize = Math.floor(this.totalBitSize / 8) + ((this.totalBitSize % 8) > 0 ? 1 : 0); +}; + +/** + * Builds a zero float of the current binary description. + * @param {number} sign + * @return {tcuFloat.deFloat} + */ +tcuFloat.FloatDescription.prototype.zero = function(sign) { + return tcuFloat.newDeFloatFromParameters(this.zeroNumber(sign), this); +}; + +tcuFloat.FloatDescription.prototype.zeroNumber = function(sign) { + return deMath.shiftLeft((sign > 0 ? 0 : 1), (this.ExponentBits + this.MantissaBits)); +}; + +/** + * Builds an infinity float representation of the current binary description. + * @param {number} sign + * @return {tcuFloat.deFloat} + */ +tcuFloat.FloatDescription.prototype.inf = function(sign) { + return tcuFloat.newDeFloatFromParameters(this.infNumber(sign), this); +}; + +tcuFloat.FloatDescription.prototype.infNumber = function(sign) { + return ((sign > 0 ? 0 : 1) << (this.ExponentBits + this.MantissaBits)) | + deMath.shiftLeft(((1 << this.ExponentBits) - 1), this.MantissaBits); //Unless using very large exponent types, native shift is safe here, i guess. +}; + +/** + * Builds a NaN float representation of the current binary description. + * @return {tcuFloat.deFloat} + */ +tcuFloat.FloatDescription.prototype.nan = function() { + return tcuFloat.newDeFloatFromParameters(this.nanNumber(), this); +}; + +tcuFloat.FloatDescription.prototype.nanNumber = function() { + return deMath.shiftLeft(1, (this.ExponentBits + this.MantissaBits)) - 1; +}; + +/** + * Builds a tcuFloat.deFloat number based on the description and the given + * sign, exponent and mantissa values. + * @param {number} sign + * @param {number} exponent + * @param {number} mantissa + * @return {tcuFloat.deFloat} + */ +tcuFloat.FloatDescription.prototype.construct = function(sign, exponent, mantissa) { + // Repurpose this otherwise invalid input as a shorthand notation for zero (no need for caller to care about internal representation) + /** @type {boolean} */ var isShorthandZero = exponent == 0 && mantissa == 0; + + // Handles the typical notation for zero (min exponent, mantissa 0). Note that the exponent usually used exponent (-ExponentBias) for zero/subnormals is not used. + // Instead zero/subnormals have the (normally implicit) leading mantissa bit set to zero. + + /** @type {boolean} */ var isDenormOrZero = (exponent == 1 - this.ExponentBias) && (deMath.shiftRight(mantissa, this.MantissaBits) == 0); + /** @type {number} */ var s = deMath.shiftLeft((sign < 0 ? 1 : 0), (this.ExponentBits + this.MantissaBits)); + /** @type {number} */ var exp = (isShorthandZero || isDenormOrZero) ? 0 : exponent + this.ExponentBias; + + DE_ASSERT(sign == +1 || sign == -1); + DE_ASSERT(isShorthandZero || isDenormOrZero || deMath.shiftRight(mantissa, this.MantissaBits) == 1); + DE_ASSERT((exp >> this.ExponentBits) == 0); //Native shift is safe + + return tcuFloat.newDeFloatFromParameters( + deMath.binaryOp( + deMath.binaryOp( + s, + deMath.shiftLeft(exp, this.MantissaBits), + deMath.BinaryOp.OR + ), + deMath.binaryOp( + mantissa, + deMath.shiftLeft(1, this.MantissaBits) - 1, + deMath.BinaryOp.AND + ), + deMath.BinaryOp.OR + ), + this + ); +}; + +/** + * Builds a tcuFloat.deFloat number based on the description and the given + * sign, exponent and binary mantissa values. + * @param {number} sign + * @param {number} exponent + * @param {number} mantissaBits The raw binary representation. + * @return {tcuFloat.deFloat} + */ +tcuFloat.FloatDescription.prototype.constructBits = function(sign, exponent, mantissaBits) { + /** @type {number} */ var signBit = sign < 0 ? 1 : 0; + /** @type {number} */ var exponentBits = exponent + this.ExponentBias; + + DE_ASSERT(sign == +1 || sign == -1); + DE_ASSERT((exponentBits >> this.ExponentBits) == 0); + DE_ASSERT(deMath.shiftRight(mantissaBits, this.MantissaBits) == 0); + + return tcuFloat.newDeFloatFromParameters( + deMath.binaryOp( + deMath.binaryOp( + deMath.shiftLeft( + signBit, + this.ExponentBits + this.MantissaBits + ), + deMath.shiftLeft(exponentBits, this.MantissaBits), + deMath.BinaryOp.OR + ), + mantissaBits, + deMath.BinaryOp.OR + ), + this + ); +}; + +/** + * Converts a tcuFloat.deFloat from it's own format description into the format described + * by this description. + * @param {tcuFloat.deFloat} other Other float to convert to this format description. + * @return {tcuFloat.deFloat} converted tcuFloat.deFloat + */ +tcuFloat.FloatDescription.prototype.convert = function(other) { + /** @type {number} */ var otherExponentBits = other.description.ExponentBits; + /** @type {number} */ var otherMantissaBits = other.description.MantissaBits; + /** @type {number} */ var otherExponentBias = other.description.ExponentBias; + /** @type {number} */ var otherFlags = other.description.Flags; + + /** @type {number} */ var bitDiff; + /** @type {number} */ var half; + /** @type {number} */ var bias; + + if (!(this.Flags & tcuFloat.FloatFlags.FLOAT_HAS_SIGN) && other.sign() < 0) { + // Negative number, truncate to zero. + return this.zero(+1); + } else if (other.isInf()) { + return this.inf(other.sign()); + } else if (other.isNaN()) { + return this.nan(); + } else if (other.isZero()) { + return this.zero(other.sign()); + } else { + /** @type {number} */ var eMin = 1 - this.ExponentBias; + /** @type {number} */ var eMax = ((1 << this.ExponentBits) - 2) - this.ExponentBias; + + /** @type {number} */ var s = deMath.shiftLeft(other.signBit(), (this.ExponentBits + this.MantissaBits)); // \note Not sign, but sign bit. + /** @type {number} */ var e = other.exponent(); + /** @type {number} */ var m = other.mantissa(); + + // Normalize denormalized values prior to conversion. + while (!deMath.binaryOp(m, deMath.shiftLeft(1, otherMantissaBits), deMath.BinaryOp.AND)) { + m = deMath.shiftLeft(m, 1); + e -= 1; + } + + if (e < eMin) { + // Underflow. + if ((this.Flags & tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM) && (eMin - e - 1 <= this.MantissaBits)) { + // Shift and round (RTE). + bitDiff = (otherMantissaBits - this.MantissaBits) + (eMin - e); + half = deMath.shiftLeft(1, (bitDiff - 1)) - 1; + bias = deMath.binaryOp(deMath.shiftRight(m, bitDiff), 1, deMath.BinaryOp.AND); + + return tcuFloat.newDeFloatFromParameters( + deMath.binaryOp( + s, + deMath.shiftRight( + m + half + bias, + bitDiff + ), + deMath.BinaryOp.OR + ), + this + ); + } else + return this.zero(other.sign()); + } else { + // Remove leading 1. + m = deMath.binaryOp(m, deMath.binaryNot(deMath.shiftLeft(1, otherMantissaBits)), deMath.BinaryOp.AND); + + if (this.MantissaBits < otherMantissaBits) { + // Round mantissa (round to nearest even). + bitDiff = otherMantissaBits - this.MantissaBits; + half = deMath.shiftLeft(1, (bitDiff - 1)) - 1; + bias = deMath.binaryOp(deMath.shiftRight(m, bitDiff), 1, deMath.BinaryOp.AND); + + m = deMath.shiftRight(m + half + bias, bitDiff); + + if (deMath.binaryOp(m, deMath.shiftLeft(1, this.MantissaBits), deMath.BinaryOp.AND)) { + // Overflow in mantissa. + m = 0; + e += 1; + } + } else { + bitDiff = this.MantissaBits - otherMantissaBits; + m = deMath.shiftLeft(m, bitDiff); + } + + if (e > eMax) { + // Overflow. + return this.inf(other.sign()); + } else { + DE_ASSERT(deMath.deInRange32(e, eMin, eMax)); + DE_ASSERT(deMath.binaryOp((e + this.ExponentBias), deMath.binaryNot(deMath.shiftLeft(1, this.ExponentBits) - 1), deMath.BinaryOp.AND) == 0); + DE_ASSERT(deMath.binaryOp(m, deMath.binaryNot(deMath.shiftLeft(1, this.MantissaBits) - 1), deMath.BinaryOp.AND) == 0); + + return tcuFloat.newDeFloatFromParameters( + deMath.binaryOp( + deMath.binaryOp( + s, + deMath.shiftLeft( + e + this.ExponentBias, + this.MantissaBits + ), + deMath.BinaryOp.OR + ), + m, + deMath.BinaryOp.OR + ), + this + ); + } + } + } +}; + +/** + * tcuFloat.deFloat class - Empty constructor, builds a 32 bit float by default + * @constructor + */ +tcuFloat.deFloat = function() { + this.description = tcuFloat.description32; + + this.m_buffer = null; + this.m_array = null; + this.bitValue = undefined; + this.signValue = undefined; + this.expValue = undefined; + this.mantissaValue = undefined; + + this.m_value = 0; +}; + +/** + * buffer - Get the deFloat's existing ArrayBuffer or create one if none exists. + * @return {ArrayBuffer} + */ +tcuFloat.deFloat.prototype.buffer = function() { + if (!this.m_buffer) + this.m_buffer = new ArrayBuffer(this.description.totalByteSize); + return this.m_buffer; +}; + +/** + * array - Get the deFloat's existing Uint8Array or create one if none exists. + * @return {Uint8Array} + */ +tcuFloat.deFloat.prototype.array = function() { + if (!this.m_array) + this.m_array = new Uint8Array(this.buffer()); + return this.m_array; +}; + +/** + * deFloatNumber - To be used immediately after constructor + * Builds a 32-bit tcuFloat.deFloat based on a 64-bit JS number. + * @param {number} jsnumber + * @return {tcuFloat.deFloat} + */ +tcuFloat.deFloat.prototype.deFloatNumber = function(jsnumber) { + var view32 = new DataView(this.buffer()); + view32.setFloat32(0, jsnumber, true); //little-endian + this.m_value = view32.getFloat32(0, true); //little-endian + + // Clear cached values + this.bitValue = undefined; + this.signValue = undefined; + this.expValue = undefined; + this.mantissaValue = undefined; + + return this; +}; + +/** + * Convenience function to build a 32-bit tcuFloat.deFloat based on a 64-bit JS number + * Builds a 32-bit tcuFloat.deFloat based on a 64-bit JS number. + * @param {number} jsnumber + * @return {tcuFloat.deFloat} + */ +tcuFloat.newDeFloatFromNumber = function(jsnumber) { + return new tcuFloat.deFloat().deFloatNumber(jsnumber); +}; + +/** + * deFloatBuffer - To be used immediately after constructor + * Builds a tcuFloat.deFloat based on a buffer and a format description. + * The buffer is assumed to contain data of the given description. + * @param {ArrayBuffer} buffer + * @param {tcuFloat.FloatDescription} description + * @return {tcuFloat.deFloat} + */ +tcuFloat.deFloat.prototype.deFloatBuffer = function(buffer, description) { + this.m_buffer = buffer; + this.m_array = new Uint8Array(this.m_buffer); + + this.m_value = deMath.arrayToNumber(this.m_array); + + // Clear cached values + this.bitValue = undefined; + this.signValue = undefined; + this.expValue = undefined; + this.mantissaValue = undefined; + + return this; +}; + +/** + * Convenience function to build a tcuFloat.deFloat based on a buffer and a format description + * The buffer is assumed to contain data of the given description. + * @param {ArrayBuffer} buffer + * @param {tcuFloat.FloatDescription} description + * @return {tcuFloat.deFloat} + */ +tcuFloat.newDeFloatFromBuffer = function(buffer, description) { + return new tcuFloat.deFloat().deFloatBuffer(buffer, description); +}; + +/** + * Set the tcuFloat.deFloat to the given number. + * It does not perform any conversion; it assumes the number is compatible with + * the previously set description. + * @param {number} jsnumber + * @return {tcuFloat.deFloat} + **/ +tcuFloat.deFloat.prototype.deFloatParametersNumber = function(jsnumber) { + this.m_value = jsnumber; + deMath.numberToArray(this.m_array, jsnumber); + + // Clear cached values + this.bitValue = undefined; + this.signValue = undefined; + this.expValue = undefined; + this.mantissaValue = undefined; + + return this; +}; + +/** + * Initializes a tcuFloat.deFloat from the given number, + * with the specified format description. + * It does not perform any conversion; it assumes the number is compatible with + * the given description. + * @param {number} jsnumber + * @param {tcuFloat.FloatDescription} description + * @return {tcuFloat.deFloat} + **/ +tcuFloat.deFloat.prototype.deFloatParameters = function(jsnumber, description) { + this.description = description; + + this.m_buffer = new ArrayBuffer(this.description.totalByteSize); + this.m_array = new Uint8Array(this.m_buffer); + + return this.deFloatParametersNumber(jsnumber); +}; + +/** + * Convenience function to create a tcuFloat.deFloat from the given number, + * with the specified format description. + * It does not perform any conversion; it assumes the number is compatible with + * the given description. + * @param {number} jsnumber + * @param {tcuFloat.FloatDescription} description + * @return {tcuFloat.deFloat} + **/ +tcuFloat.newDeFloatFromParameters = function(jsnumber, description) { + return new tcuFloat.deFloat().deFloatParameters(jsnumber, description); +}; + +/** + * Returns bit range [begin, end) + * @param {number} begin + * @param {number} end + * @return {number} + */ +tcuFloat.deFloat.prototype.getBitRange = function(begin, end) { + return deMath.getBitRange(this.bits(), begin, end); +}; + +/** + * Returns the raw binary representation value of the tcuFloat.deFloat + * @return {number} + */ +tcuFloat.deFloat.prototype.bits = function() { + if (typeof this.bitValue === 'undefined') + this.bitValue = deMath.arrayToNumber(this.array()); + return this.bitValue; +}; + +/** + * Returns the raw binary sign bit + * @return {number} + */ +tcuFloat.deFloat.prototype.signBit = function() { + if (typeof this.signValue === 'undefined') + this.signValue = this.getBitRange(this.description.totalBitSize - 1, this.description.totalBitSize); + return this.signValue; +}; + +/** + * Returns the raw binary exponent bits + * @return {number} + */ +tcuFloat.deFloat.prototype.exponentBits = function() { + if (typeof this.expValue === 'undefined') + this.expValue = this.getBitRange(this.description.MantissaBits, this.description.MantissaBits + this.description.ExponentBits); + return this.expValue; +}; + +/** + * Returns the raw binary mantissa bits + * @return {number} + */ +tcuFloat.deFloat.prototype.mantissaBits = function() { + if (typeof this.mantissaValue === 'undefined') + this.mantissaValue = this.getBitRange(0, this.description.MantissaBits); + return this.mantissaValue; +}; + +/** + * Returns the sign as a factor (-1 or 1) + * @return {number} + */ +tcuFloat.deFloat.prototype.sign = function() { + var sign = this.signBit(); + var signvalue = sign ? -1 : 1; + return signvalue; +}; + +/** + * Returns the real exponent, checking if it's a denorm or zero number or not + * @return {number} + */ +tcuFloat.deFloat.prototype.exponent = function() {return this.isDenorm() ? 1 - this.description.ExponentBias : this.exponentBits() - this.description.ExponentBias;}; + +/** + * Returns the (still raw) mantissa, checking if it's a denorm or zero number or not + * Makes the normally implicit bit explicit. + * @return {number} + */ +tcuFloat.deFloat.prototype.mantissa = function() {return this.isZero() || this.isDenorm() ? this.mantissaBits() : deMath.binaryOp(this.mantissaBits(), deMath.shiftLeft(1, this.description.MantissaBits), deMath.BinaryOp.OR);}; + +/** + * Returns if the number is infinity or not. + * @return {boolean} + */ +tcuFloat.deFloat.prototype.isInf = function() {return this.exponentBits() == ((1 << this.description.ExponentBits) - 1) && this.mantissaBits() == 0;}; + +/** + * Returns if the number is NaN or not. + * @return {boolean} + */ +tcuFloat.deFloat.prototype.isNaN = function() {return this.exponentBits() == ((1 << this.description.ExponentBits) - 1) && this.mantissaBits() != 0;}; + +/** + * Returns if the number is zero or not. + * @return {boolean} + */ +tcuFloat.deFloat.prototype.isZero = function() {return this.exponentBits() == 0 && this.mantissaBits() == 0;}; + +/** + * Returns if the number is denormalized or not. + * @return {boolean} + */ +tcuFloat.deFloat.prototype.isDenorm = function() {return this.exponentBits() == 0 && this.mantissaBits() != 0;}; + +/** + * Builds a zero float of the current binary description. + * @param {number} sign + * @return {tcuFloat.deFloat} + */ +tcuFloat.deFloat.prototype.zero = function(sign) { + return this.description.zero(sign); +}; + +/** + * Builds an infinity float representation of the current binary description. + * @param {number} sign + * @return {tcuFloat.deFloat} + */ +tcuFloat.deFloat.prototype.inf = function(sign) { + return this.description.inf(sign); +}; + +/** + * Builds a NaN float representation of the current binary description. + * @return {tcuFloat.deFloat} + */ +tcuFloat.deFloat.prototype.nan = function() { + return this.description.nan(); +}; + +/** + * Builds a float of the current binary description. + * Given a sign, exponent and mantissa. + * @param {number} sign + * @param {number} exponent + * @param {number} mantissa + * @return {tcuFloat.deFloat} + */ +tcuFloat.deFloat.prototype.construct = function(sign, exponent, mantissa) { + return this.description.construct(sign, exponent, mantissa); +}; + +/** + * Builds a float of the current binary description. + * Given a sign, exponent and a raw binary mantissa. + * @param {number} sign + * @param {number} exponent + * @param {number} mantissaBits Raw binary mantissa. + * @return {tcuFloat.deFloat} + */ +tcuFloat.deFloat.prototype.constructBits = function(sign, exponent, mantissaBits) { + return this.description.constructBits(sign, exponent, mantissaBits); +}; + +/** + * Calculates the JS float number from the internal representation. + * @return {number} The JS float value represented by this tcuFloat.deFloat. + */ +tcuFloat.deFloat.prototype.getValue = function() { + if ((this.description.Flags | tcuFloat.FloatFlags.FLOAT_HAS_SIGN) === 0 && this.sign() < 0) + return 0; + if (this.isInf()) + return Number.Infinity; + if (this.isNaN()) + return Number.NaN; + if (this.isZero()) + return this.sign() * 0; + /**@type {number} */ var mymantissa = this.mantissa(); + /**@type {number} */ var myexponent = this.exponent(); + /**@type {number} */ var sign = this.sign(); + + /**@type {number} */ var value = mymantissa / Math.pow(2, this.description.MantissaBits) * Math.pow(2, myexponent); + + if (this.description.Flags | tcuFloat.FloatFlags.FLOAT_HAS_SIGN != 0) + value = value * sign; + + return value; +}; + +tcuFloat.description10 = new tcuFloat.FloatDescription(5, 5, 15, 0); +tcuFloat.description11 = new tcuFloat.FloatDescription(5, 6, 15, 0); +tcuFloat.description16 = new tcuFloat.FloatDescription(5, 10, 15, tcuFloat.FloatFlags.FLOAT_HAS_SIGN); +tcuFloat.description32 = new tcuFloat.FloatDescription(8, 23, 127, tcuFloat.FloatFlags.FLOAT_HAS_SIGN | tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM); +tcuFloat.description64 = new tcuFloat.FloatDescription(11, 52, 1023, tcuFloat.FloatFlags.FLOAT_HAS_SIGN | tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM); + +tcuFloat.convertFloat32Inline = (function() { + var float32View = new Float32Array(1); + var int32View = new Int32Array(float32View.buffer); + + return function(fval, description) { + float32View[0] = fval; + var fbits = int32View[0]; + + var exponentBits = (fbits >> 23) & 0xff; + var mantissaBits = fbits & 0x7fffff; + var signBit = (fbits & 0x80000000) ? 1 : 0; + var sign = signBit ? -1 : 1; + + var isZero = exponentBits == 0 && mantissaBits == 0; + + var bitDiff; + var half; + var bias; + + if (!(description.Flags & tcuFloat.FloatFlags.FLOAT_HAS_SIGN) && sign < 0) { + // Negative number, truncate to zero. + return description.zeroNumber(+1); + } else if (exponentBits == ((1 << tcuFloat.description32.ExponentBits) - 1) && mantissaBits == 0) { // isInf + return description.infNumber(sign); + } else if (exponentBits == ((1 << tcuFloat.description32.ExponentBits) - 1) && mantissaBits != 0) { // isNaN + return description.nanNumber(); + } else if (isZero) { + return description.zeroNumber(sign); + } else { + var eMin = 1 - description.ExponentBias; + var eMax = ((1 << description.ExponentBits) - 2) - description.ExponentBias; + + var isDenorm = exponentBits == 0 && mantissaBits != 0; + + var s = signBit << (description.ExponentBits + description.MantissaBits); // \note Not sign, but sign bit. + var e = isDenorm ? 1 - tcuFloat.description32.ExponentBias : exponentBits - tcuFloat.description32.ExponentBias;// other.exponent(); + var m = isZero || isDenorm ? mantissaBits : mantissaBits | (1 << tcuFloat.description32.MantissaBits); // other.mantissa(); + + // Normalize denormalized values prior to conversion. + while (!(m & (1 << tcuFloat.description32.MantissaBits))) { + m = deMath.shiftLeft(m, 1); + e -= 1; + } + + if (e < eMin) { + // Underflow. + if ((description.Flags & tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM) && (eMin - e - 1 <= description.MantissaBits)) { + // Shift and round (RTE). + bitDiff = (tcuFloat.description32.MantissaBits - description.MantissaBits) + (eMin - e); + half = (1 << (bitDiff - 1)) - 1; + bias = ((m >> bitDiff) & 1); + return (s | ((m + half + bias) >> bitDiff)); + } else + return description.zeroNumber(sign); + } else { + // Remove leading 1. + m = (m & ~(1 << tcuFloat.description32.MantissaBits)); + + if (description.MantissaBits < tcuFloat.description32.MantissaBits) { + // Round mantissa (round to nearest even). + bitDiff = tcuFloat.description32.MantissaBits - description.MantissaBits; + half = (1 << (bitDiff - 1)) - 1; + bias = ((m >> bitDiff) & 1); + + m = (m + half + bias) >> bitDiff; + + if ((m & (1 << description.MantissaBits))) { + // Overflow in mantissa. + m = 0; + e += 1; + } + } else { + bitDiff = description.MantissaBits - tcuFloat.description32.MantissaBits; + m = (m << bitDiff); + } + + if (e > eMax) { + // Overflow. + return description.infNumber(sign); + } else { + DE_ASSERT(deMath.deInRange32(e, eMin, eMax)); + DE_ASSERT(((e + description.ExponentBias) & ~((1 << description.ExponentBits) - 1)) == 0); + DE_ASSERT((m & ~((1 << description.MantissaBits) - 1)) == 0); + + return (s | ((e + description.ExponentBias) << description.MantissaBits)) | m; + } + } + } + }; +})(); + +/** + * Builds a 10 bit tcuFloat.deFloat + * @param {number} value (64-bit JS float) + * @return {tcuFloat.deFloat} + */ +tcuFloat.newFloat10 = function(value) { + /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value); + return tcuFloat.description10.convert(other32); +}; + +/** + * Builds a 11 bit tcuFloat.deFloat + * @param {number} value (64-bit JS float) + * @return {tcuFloat.deFloat} + */ +tcuFloat.newFloat11 = function(value) { + /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value); + return tcuFloat.description11.convert(other32); +}; + +/** + * Builds a 16 bit tcuFloat.deFloat + * @param {number} value (64-bit JS float) + * @return {tcuFloat.deFloat} + */ +tcuFloat.newFloat16 = function(value) { + /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value); + return tcuFloat.description16.convert(other32); +}; + +/** + * Builds a 16 bit tcuFloat.deFloat from raw bits + * @param {number} value (16-bit value) + * @return {tcuFloat.deFloat} + */ +tcuFloat.newFloat32From16 = function(value) { + var other16 = tcuFloat.newDeFloatFromParameters(value, tcuFloat.description16); + return tcuFloat.description32.convert(other16); +}; + +/** + * Builds a 16 bit tcuFloat.deFloat with no denorm support + * @param {number} value (64-bit JS float) + * @return {tcuFloat.deFloat} + */ +tcuFloat.newFloat16NoDenorm = function(value) { + /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value); + return tcuFloat.description16.convert(other32); +}; + +/** + * Builds a 32 bit tcuFloat.deFloat + * @param {number} value (64-bit JS float) + * @return {tcuFloat.deFloat} + */ +tcuFloat.newFloat32 = function(value) { + return new tcuFloat.deFloat().deFloatNumber(value); +}; + +tcuFloat.numberToFloat11 = function(value) { + return tcuFloat.convertFloat32Inline(value, tcuFloat.description11); +}; + +tcuFloat.float11ToNumber = (function() { + var x = tcuFloat.newDeFloatFromParameters(0, tcuFloat.description11); + return function(float11) { + x.deFloatParametersNumber(float11); + return x.getValue(); + }; +})(); + +tcuFloat.numberToFloat10 = function(value) { + return tcuFloat.convertFloat32Inline(value, tcuFloat.description10); +}; + +tcuFloat.float10ToNumber = (function() { + var x = tcuFloat.newDeFloatFromParameters(0, tcuFloat.description10); + return function(float10) { + x.deFloatParametersNumber(float10); + return x.getValue(); + }; +})(); + +tcuFloat.numberToHalfFloat = function(value) { + return tcuFloat.convertFloat32Inline(value, tcuFloat.description16); +}; + +tcuFloat.numberToHalfFloatNoDenorm = function(value) { + return tcuFloat.newFloat16NoDenorm(value).bits(); +}; + +tcuFloat.halfFloatToNumber = (function() { + var x = tcuFloat.newDeFloatFromParameters(0, tcuFloat.description16); + return function(half) { + x.deFloatParametersNumber(half); + return x.getValue(); + }; +})(); + +tcuFloat.halfFloatToNumberNoDenorm = tcuFloat.halfFloatToNumber; + +/** + * Builds a 64 bit tcuFloat.deFloat + * @param {number} value (64-bit JS float) + * @return {tcuFloat.deFloat} + */ +tcuFloat.newFloat64 = function(value) { + return new tcuFloat.deFloat().deFloatParameters(value, tcuFloat.description64); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js new file mode 100644 index 000000000..a0b4dc82c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js @@ -0,0 +1,349 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program Tester Core + * ---------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Adjustable-precision floating point operations. + *//*--------------------------------------------------------------------*/ + 'use strict'; + goog.provide('framework.common.tcuFloatFormat'); + + goog.require('framework.common.tcuInterval'); +goog.require('framework.delibs.debase.deMath'); + + goog.scope(function() { + + var tcuFloatFormat = framework.common.tcuFloatFormat; + var deMath = framework.delibs.debase.deMath; + var tcuInterval = framework.common.tcuInterval; + + /** + * @param {tcuFloatFormat.YesNoMaybe} choice + * @param {tcuInterval.Interval} no + * @param {tcuInterval.Interval} yes + * @return {tcuInterval.Interval} + */ + tcuFloatFormat.chooseInterval = function(choice, no, yes) { + switch (choice) { + case tcuFloatFormat.YesNoMaybe.NO: return no; + case tcuFloatFormat.YesNoMaybe.YES: return yes; + case tcuFloatFormat.YesNoMaybe.MAYBE: return no.operatorOrBinary(yes); + default: throw new Error('Impossible case'); + } + }; + + /** + * @param {number} maxExp + * @param {number} fractionBits + * @return {number} + */ + tcuFloatFormat.computeMaxValue = function(maxExp, fractionBits) { + return deMath.deLdExp(1, maxExp) + deMath.deLdExp(Math.pow(2, fractionBits) - 1, maxExp - fractionBits); + }; + + /** + * @enum {number} + */ + tcuFloatFormat.YesNoMaybe = { + NO: 0, + MAYBE: 1, + YES: 2 + }; + + /** + * @constructor + * @param {number} minExp + * @param {number} maxExp + * @param {number} fractionBits + * @param {boolean} exactPrecision + * @param {tcuFloatFormat.YesNoMaybe=} hasSubnormal + * @param {tcuFloatFormat.YesNoMaybe=} hasInf + * @param {tcuFloatFormat.YesNoMaybe=} hasNaN + */ + tcuFloatFormat.FloatFormat = function(minExp, maxExp, fractionBits, exactPrecision, hasSubnormal, hasInf, hasNaN) { + // /** @type{number} */ var exponentShift (int exp) const; + // Interval clampValue (double d) const; + + /** @type {number} */ this.m_minExp = minExp; // Minimum exponent, inclusive + /** @type {number} */ this.m_maxExp = maxExp; // Maximum exponent, inclusive + /** @type {number} */ this.m_fractionBits = fractionBits; // Number of fractional bits in significand + /** @type {tcuFloatFormat.YesNoMaybe} */ this.m_hasSubnormal = hasSubnormal === undefined ? tcuFloatFormat.YesNoMaybe.MAYBE : hasSubnormal; // Does the format support denormalized numbers? + /** @type {tcuFloatFormat.YesNoMaybe} */ this.m_hasInf = hasInf === undefined ? tcuFloatFormat.YesNoMaybe.MAYBE : hasInf; // Does the format support infinities? + /** @type {tcuFloatFormat.YesNoMaybe} */ this.m_hasNaN = hasNaN === undefined ? tcuFloatFormat.YesNoMaybe.MAYBE : hasNaN; // Does the format support NaNs? + /** @type {boolean} */ this.m_exactPrecision = exactPrecision; // Are larger precisions disallowed? + /** @type {number} */ this.m_maxValue = tcuFloatFormat.computeMaxValue(maxExp, fractionBits); + }; + + /** + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.getMinExp = function() { + return this.m_minExp; + }; + + /** + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.getMaxExp = function() { + return this.m_maxExp; + }; + + /** + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.getMaxValue = function() { + return this.m_maxValue; + }; + + /** + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.getFractionBits = function() { + return this.m_fractionBits; + }; + + /** + * @return {tcuFloatFormat.YesNoMaybe} + */ + tcuFloatFormat.FloatFormat.prototype.hasSubnormal = function() { + return this.m_hasSubnormal; + }; + + /** + * @return {tcuFloatFormat.YesNoMaybe} + */ + tcuFloatFormat.FloatFormat.prototype.hasInf = function() { + return this.m_hasInf; + }; + + /** + * @param {number} x + * @param {number} count + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.ulp = function(x, count) { + var breakdown = deMath.deFractExp(Math.abs(x)); + /** @type {number} */ var exp = breakdown.exponent; + /** @type {number} */ var frac = breakdown.significand; + + if (isNaN(frac)) + return NaN; + else if (!isFinite(frac)) + return deMath.deLdExp(1.0, this.m_maxExp - this.m_fractionBits); + else if (frac == 1.0) { + // Harrison's ULP: choose distance to closest (i.e. next lower) at binade + // boundary. + --exp; + } else if (frac == 0.0) + exp = this.m_minExp; + + // ULP cannot be lower than the smallest quantum. + exp = Math.max(exp, this.m_minExp); + + /** @type {number} */ var oneULP = deMath.deLdExp(1.0, exp - this.m_fractionBits); + // ScopedRoundingMode ctx (DE_ROUNDINGMODE_TO_POSITIVE_INF); + + return oneULP * count; + }; + + /** + * Return the difference between the given nominal exponent and + * the exponent of the lowest significand bit of the + * representation of a number with this format. + * For normal numbers this is the number of significand bits, but + * for subnormals it is less and for values of exp where 2^exp is too + * small to represent it is <0 + * @param {number} exp + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.exponentShift = function(exp) { + return this.m_fractionBits - Math.max(this.m_minExp - exp, 0); + }; + + /** + * @param {number} d + * @param {boolean} upward + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.round = function(d, upward) { + var breakdown = deMath.deFractExp(d); + /** @type {number} */ var exp = breakdown.exponent; + /** @type {number} */ var frac = breakdown.significand; + + var shift = this.exponentShift(exp); + var shiftFrac = deMath.deLdExp(frac, shift); + var roundFrac = upward ? Math.ceil(shiftFrac) : Math.floor(shiftFrac); + + return deMath.deLdExp(roundFrac, exp - shift); + }; + + /** + * Return the range of numbers that `d` might be converted to in the + * floatformat, given its limitations with infinities, subnormals and maximum + * exponent. + * @param {number} d + * @return {tcuInterval.Interval} + */ + tcuFloatFormat.FloatFormat.prototype.clampValue = function(d) { + /** @type {number} */ var rSign = deMath.deSign(d); + /** @type {number} */ var rExp = 0; + + // DE_ASSERT(!isNaN(d)); + + var breakdown = deMath.deFractExp(d); + rExp = breakdown.exponent; + if (rExp < this.m_minExp) + return tcuFloatFormat.chooseInterval(this.m_hasSubnormal, new tcuInterval.Interval(rSign * 0.0), new tcuInterval.Interval(d)); + else if (!isFinite(d) || rExp > this.m_maxExp) + return tcuFloatFormat.chooseInterval(this.m_hasInf, new tcuInterval.Interval(rSign * this.getMaxValue()), new tcuInterval.Interval(rSign * Number.POSITIVE_INFINITY)); + + return new tcuInterval.Interval(d); + }; + + /** + * @param {number} d + * @param {boolean} upward + * @param {boolean} roundUnderOverflow + * @return {number} + */ + tcuFloatFormat.FloatFormat.prototype.roundOutDir = function(d, upward, roundUnderOverflow) { + var breakdown = deMath.deFractExp(d); + var exp = breakdown.exponent; + + if (roundUnderOverflow && exp > this.m_maxExp && (upward == (d < 0.0))) + return deMath.deSign(d) * this.getMaxValue(); + else + return this.round(d, upward); + }; + + /** + * @param {tcuInterval.Interval} x + * @param {boolean} roundUnderOverflow + * @return {tcuInterval.Interval} + */ + tcuFloatFormat.FloatFormat.prototype.roundOut = function(x, roundUnderOverflow) { + /** @type {tcuInterval.Interval} */ var ret = x.nan(); + + if (!x.empty()) { + var a = new tcuInterval.Interval(this.roundOutDir(x.lo(), false, roundUnderOverflow)); + var b = new tcuInterval.Interval(this.roundOutDir(x.hi(), true, roundUnderOverflow)); + ret.operatorOrAssignBinary(tcuInterval.withIntervals(a, b)); + } + return ret; + }; + + //! Return the range of numbers that might be used with this format to + //! represent a number within `x`. + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuFloatFormat.FloatFormat.prototype.convert = function(x) { + /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + /** @type {tcuInterval.Interval} */ var tmp = x; + + if (x.hasNaN()) { + // If NaN might be supported, NaN is a legal return value + if (this.m_hasNaN != tcuFloatFormat.YesNoMaybe.NO) + ret.operatorOrAssignBinary(new tcuInterval.Interval(NaN)); + + // If NaN might not be supported, any (non-NaN) value is legal, + // _subject_ to clamping. Hence we modify tmp, not ret. + if (this.m_hasNaN != tcuFloatFormat.YesNoMaybe.YES) + tmp = tcuInterval.unbounded(); + } + + // Round both bounds _inwards_ to closest representable values. + if (!tmp.empty()) + ret.operatorOrAssignBinary( + this.clampValue(this.round(tmp.lo(), true)).operatorOrBinary( + this.clampValue(this.round(tmp.hi(), false)))); + + // If this format's precision is not exact, the (possibly out-of-bounds) + // original value is also a possible result. + if (!this.m_exactPrecision) + ret.operatorOrAssignBinary(x); + + return ret; + }; + + /** + * @param {number} x + * @return {string} + */ + tcuFloatFormat.FloatFormat.prototype.floatToHex = function(x) { + if (isNaN(x)) + return 'NaN'; + else if (!isFinite(x)) + return (x < 0.0 ? '-' : '+') + ('inf'); + else if (x == 0.0) // \todo [2014-03-27 lauri] Negative zero + return '0.0'; + + return x.toString(10); + // TODO + // var breakdown = deMath.deFractExp(deAbs(x)); + // /** @type{number} */ var exp = breakdown.exponent; + // /** @type{number} */ var frac = breakdown.significand; + // /** @type{number} */ var shift = this.exponentShift(exp); + // /** @type{number} */ var bits = deUint64(deLdExp(frac, shift)); + // /** @type{number} */ var whole = bits >> m_fractionBits; + // /** @type{number} */ var fraction = bits & ((deUint64(1) << m_fractionBits) - 1); + // /** @type{number} */ var exponent = exp + m_fractionBits - shift; + // /** @type{number} */ var numDigits = (this.m_fractionBits + 3) / 4; + // /** @type{number} */ var aligned = fraction << (numDigits * 4 - m_fractionBits); + // /** @type{string} */ var oss = ''; + + // oss + (x < 0 ? '-' : '') + // + '0x' + whole + '.' + // + std::hex + std::setw(numDigits) + std::setfill('0') + aligned + // + 'p' + std::dec + std::setw(0) + exponent; + //return oss; + }; + + /** + * @param {tcuInterval.Interval} interval + * @return {string} + */ + tcuFloatFormat.FloatFormat.prototype.intervalToHex = function(interval) { + if (interval.empty()) + return interval.hasNaN() ? '{ NaN }' : '{}'; + + else if (interval.lo() == interval.hi()) + return ((interval.hasNaN() ? '{ NaN, ' : '{ ') + + this.floatToHex(interval.lo()) + ' }'); + else if (interval == tcuInterval.unbounded(true)) + return ''; + + return ((interval.hasNaN() ? '{ NaN } | ' : '') + + '[' + this.floatToHex(interval.lo()) + ', ' + this.floatToHex(interval.hi()) + ']'); + }; + + /** + * @return {tcuFloatFormat.FloatFormat} + */ + tcuFloatFormat.nativeDouble = function() { + return new tcuFloatFormat.FloatFormat(-1021 - 1, // min_exponent + 1024 - 1, // max_exponent + 53 - 1, // digits + true, // has_denorm + tcuFloatFormat.YesNoMaybe.YES, // has_infinity + tcuFloatFormat.YesNoMaybe.YES, // has_quiet_nan + tcuFloatFormat.YesNoMaybe.YES); // has_denorm + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js new file mode 100644 index 000000000..aea5bf7e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js @@ -0,0 +1,338 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuFuzzyImageCompare'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); + +goog.scope(function() { + +var tcuFuzzyImageCompare = framework.common.tcuFuzzyImageCompare; +var deMath = framework.delibs.debase.deMath; +var deRandom = framework.delibs.debase.deRandom; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * tcuFuzzyImageCompare.FuzzyCompareParams struct + * @constructor + * @param {number=} maxSampleSkip_ + * @param {number=} minErrThreshold_ + * @param {number=} errExp_ + */ + tcuFuzzyImageCompare.FuzzyCompareParams = function(maxSampleSkip_, minErrThreshold_, errExp_) { + /** @type {number} */ this.maxSampleSkip = maxSampleSkip_ === undefined ? 8 : maxSampleSkip_; + /** @type {number} */ this.minErrThreshold = minErrThreshold_ === undefined ? 4 : minErrThreshold_; + /** @type {number} */ this.errExp = errExp_ === undefined ? 4.0 : errExp_; + }; + + /** + * @param {Array} v + * @return {Array} + */ + tcuFuzzyImageCompare.roundArray4ToUint8Sat = function(v) { + return [ + deMath.clamp(Math.trunc(v[0] + 0.5), 0, 255), + deMath.clamp(Math.trunc(v[1] + 0.5), 0, 255), + deMath.clamp(Math.trunc(v[2] + 0.5), 0, 255), + deMath.clamp(Math.trunc(v[3] + 0.5), 0, 255) + ]; + }; + + /** + * @param {Array} pa + * @param {Array} pb + * @param {number} minErrThreshold + * @return {number} + */ + tcuFuzzyImageCompare.compareColors = function(pa, pb, minErrThreshold) { + /** @type {number}*/ var r = Math.max(Math.abs(pa[0] - pb[0]) - minErrThreshold, 0); + /** @type {number}*/ var g = Math.max(Math.abs(pa[1] - pb[1]) - minErrThreshold, 0); + /** @type {number}*/ var b = Math.max(Math.abs(pa[2] - pb[2]) - minErrThreshold, 0); + /** @type {number}*/ var a = Math.max(Math.abs(pa[3] - pb[3]) - minErrThreshold, 0); + + /** @type {number}*/ var scale = 1.0 / (255 - minErrThreshold); + /** @type {number}*/ var sqSum = (r * r + g * g + b * b + a * a) * (scale * scale); + + return Math.sqrt(sqSum); + }; + + /** + * @param {tcuTexture.RGBA8View} src + * @param {number} u + * @param {number} v + * @param {number} NumChannels + * @return {Array} + */ + tcuFuzzyImageCompare.bilinearSample = function(src, u, v, NumChannels) { + /** @type {number}*/ var w = src.width; + /** @type {number}*/ var h = src.height; + + /** @type {number}*/ var x0 = Math.floor(u - 0.5); + /** @type {number}*/ var x1 = x0 + 1; + /** @type {number}*/ var y0 = Math.floor(v - 0.5); + /** @type {number}*/ var y1 = y0 + 1; + + /** @type {number}*/ var i0 = deMath.clamp(x0, 0, w - 1); + /** @type {number}*/ var i1 = deMath.clamp(x1, 0, w - 1); + /** @type {number}*/ var j0 = deMath.clamp(y0, 0, h - 1); + /** @type {number}*/ var j1 = deMath.clamp(y1, 0, h - 1); + + /** @type {number}*/ var a = (u - 0.5) - Math.floor(u - 0.5); + /** @type {number}*/ var b = (u - 0.5) - Math.floor(u - 0.5); + + /** @type {Array} */ var p00 = src.read(i0, j0, NumChannels); + /** @type {Array} */ var p10 = src.read(i1, j0, NumChannels); + /** @type {Array} */ var p01 = src.read(i0, j1, NumChannels); + /** @type {Array} */ var p11 = src.read(i1, j1, NumChannels); + /** @type {number} */ var dst = 0; + + // Interpolate. + /** @type {Array}*/ var f = []; + for (var c = 0; c < NumChannels; c++) { + f[c] = p00[c] * (1.0 - a) * (1.0 - b) + + (p10[c] * a * (1.0 - b)) + + (p01[c] * (1.0 - a) * b) + + (p11[c] * a * b); + } + + return tcuFuzzyImageCompare.roundArray4ToUint8Sat(f); + }; + + /** + * @param {tcuTexture.RGBA8View} dst + * @param {tcuTexture.RGBA8View} src + * @param {number} shiftX + * @param {number} shiftY + * @param {Array} kernelX + * @param {Array} kernelY + * @param {number} DstChannels + * @param {number} SrcChannels + */ + tcuFuzzyImageCompare.separableConvolve = function(dst, src, shiftX, shiftY, kernelX, kernelY, DstChannels, SrcChannels) { + DE_ASSERT(dst.width == src.width && dst.height == src.height); + + /** @type {tcuTexture.TextureLevel} */ var tmp = new tcuTexture.TextureLevel(dst.getFormat(), dst.height, dst.width); + var tmpView = new tcuTexture.RGBA8View(tmp.getAccess()); + + /** @type {number} */ var kw = kernelX.length; + /** @type {number} */ var kh = kernelY.length; + + /** @type {Array} */ var sum = []; + /** @type {number} */ var f; + /** @type {Array} */ var p; + + // Horizontal pass + // \note Temporary surface is written in column-wise order + for (var j = 0; j < src.height; j++) { + for (var i = 0; i < src.width; i++) { + sum[0] = sum[1] = sum[2] = sum[3] = 0; + for (var kx = 0; kx < kw; kx++) { + f = kernelX[kw - kx - 1]; + p = src.read(deMath.clamp(i + kx - shiftX, 0, src.width - 1), j, SrcChannels); + sum = deMath.add(sum, deMath.scale(p, f)); + } + + sum = tcuFuzzyImageCompare.roundArray4ToUint8Sat(sum); + tmpView.write(j, i, sum, DstChannels); + } + } + + // Vertical pass + for (var j = 0; j < src.height; j++) { + for (var i = 0; i < src.width; i++) { + sum[0] = sum[1] = sum[2] = sum[3] = 0; + for (var ky = 0; ky < kh; ky++) { + f = kernelY[kh - ky - 1]; + p = tmpView.read(deMath.clamp(j + ky - shiftY, 0, tmpView.width - 1), i, DstChannels); + sum = deMath.add(sum, deMath.scale(p, f)); + } + + sum = tcuFuzzyImageCompare.roundArray4ToUint8Sat(sum); + dst.write(i, j, sum, DstChannels); + } + } + }; + + /** + * @param {tcuFuzzyImageCompare.FuzzyCompareParams} params + * @param {deRandom.Random} rnd + * @param {Array} pixel + * @param {tcuTexture.RGBA8View} surface + * @param {number} x + * @param {number} y + * @param {number} NumChannels + * @return {number} + */ + tcuFuzzyImageCompare.compareToNeighbor = function(params, rnd, pixel, surface, x, y, NumChannels) { + /** @type {number} */ var minErr = 100; + + // (x, y) + (0, 0) + minErr = Math.min(minErr, tcuFuzzyImageCompare.compareColors(pixel, surface.read(x, y, NumChannels), params.minErrThreshold)); + if (minErr == 0.0) + return minErr; + + // Area around (x, y) + /** @type {Array>} */ var s_coords = + [ + [-1, -1], + [0, -1], + [1, -1], + [-1, 0], + [1, 0], + [-1, 1], + [0, 1], + [1, 1] + ]; + + /** @type {number} */ var dx; + /** @type {number} */ var dy; + + for (var d = 0; d < s_coords.length; d++) { + dx = x + s_coords[d][0]; + dy = y + s_coords[d][1]; + + if (!deMath.deInBounds32(dx, 0, surface.width) || !deMath.deInBounds32(dy, 0, surface.height)) + continue; + + minErr = Math.min(minErr, tcuFuzzyImageCompare.compareColors(pixel, surface.read(dx, dy, NumChannels), params.minErrThreshold)); + if (minErr == 0.0) + return minErr; + } + + // Random bilinear-interpolated samples around (x, y) + for (var s = 0; s < 32; s++) { + dx = x + rnd.getFloat() * 2.0 - 0.5; + dy = y + rnd.getFloat() * 2.0 - 0.5; + + /** @type {Array} */ var sample = tcuFuzzyImageCompare.bilinearSample(surface, dx, dy, NumChannels); + + minErr = Math.min(minErr, tcuFuzzyImageCompare.compareColors(pixel, sample, params.minErrThreshold)); + if (minErr == 0.0) + return minErr; + } + + return minErr; + }; + + /** + * @param {Array} c + * @return {number} + */ + tcuFuzzyImageCompare.toGrayscale = function(c) { + return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @return {boolean} + */ + tcuFuzzyImageCompare.isFormatSupported = function(format) { + return format.type == tcuTexture.ChannelType.UNORM_INT8 && (format.order == tcuTexture.ChannelOrder.RGB || format.order == tcuTexture.ChannelOrder.RGBA); + }; + + /** + * @param {tcuFuzzyImageCompare.FuzzyCompareParams} params + * @param {tcuTexture.ConstPixelBufferAccess} ref + * @param {tcuTexture.ConstPixelBufferAccess} cmp + * @param {tcuTexture.PixelBufferAccess} errorMask + * @return {number} + */ + tcuFuzzyImageCompare.fuzzyCompare = function(params, ref, cmp, errorMask) { + assertMsgOptions(ref.getWidth() == cmp.getWidth() && ref.getHeight() == cmp.getHeight(), + 'Reference and result images have different dimensions', false, true); + + assertMsgOptions(ref.getWidth() == errorMask.getWidth() && ref.getHeight() == errorMask.getHeight(), + 'Reference and error mask images have different dimensions', false, true); + + if (!tcuFuzzyImageCompare.isFormatSupported(ref.getFormat()) || !tcuFuzzyImageCompare.isFormatSupported(cmp.getFormat())) + throw new Error('Unsupported format in fuzzy comparison'); + + /** @type {number} */ var width = ref.getWidth(); + /** @type {number} */ var height = ref.getHeight(); + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(667); + + // Filtered + /** @type {tcuTexture.TextureLevel} */ var refFiltered = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height); + /** @type {tcuTexture.TextureLevel} */ var cmpFiltered = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height); + + var refView = new tcuTexture.RGBA8View(ref); + var cmpView = new tcuTexture.RGBA8View(cmp); + var refFilteredView = new tcuTexture.RGBA8View(tcuTexture.PixelBufferAccess.newFromTextureLevel(refFiltered)); + var cmpFilteredView = new tcuTexture.RGBA8View(tcuTexture.PixelBufferAccess.newFromTextureLevel(cmpFiltered)); + + // Kernel = {0.15, 0.7, 0.15} + /** @type {Array} */ var kernel = [0.1, 0.8, 0.1]; + /** @type {number} */ var shift = Math.floor((kernel.length - 1) / 2); + + switch (ref.getFormat().order) { + case tcuTexture.ChannelOrder.RGBA: tcuFuzzyImageCompare.separableConvolve(refFilteredView, refView, shift, shift, kernel, kernel, 4, 4); break; + case tcuTexture.ChannelOrder.RGB: tcuFuzzyImageCompare.separableConvolve(refFilteredView, refView, shift, shift, kernel, kernel, 4, 3); break; + default: + throw new Error('tcuFuzzyImageCompare.fuzzyCompare - Invalid ChannelOrder'); + } + + switch (cmp.getFormat().order) { + case tcuTexture.ChannelOrder.RGBA: tcuFuzzyImageCompare.separableConvolve(cmpFilteredView, cmpView, shift, shift, kernel, kernel, 4, 4); break; + case tcuTexture.ChannelOrder.RGB: tcuFuzzyImageCompare.separableConvolve(cmpFilteredView, cmpView, shift, shift, kernel, kernel, 4, 3); break; + default: + throw new Error('tcuFuzzyImageCompare.fuzzyCompare - Invalid ChannelOrder'); + } + + /** @type {number} */ var numSamples = 0; + /** @type {number} */ var errSum = 0.0; + + // Clear error mask to green. + errorMask.clear([0.0, 1.0, 0.0, 1.0]); + + for (var y = 1; y < height - 1; y++) { + for (var x = 1; x < width - 1; x += params.maxSampleSkip > 0 ? rnd.getInt(0, params.maxSampleSkip) : 1) { + /** @type {number} */ var err = Math.min(tcuFuzzyImageCompare.compareToNeighbor(params, rnd, refFilteredView.read(x, y, 4), cmpFilteredView, x, y, 4), + tcuFuzzyImageCompare.compareToNeighbor(params, rnd, cmpFilteredView.read(x, y, 4), refFilteredView, x, y, 4)); + + err = Math.pow(err, params.errExp); + + errSum += err; + numSamples += 1; + + // Build error image. + /** @type {number} */ var red = err * 500.0; + /** @type {number} */ var luma = tcuFuzzyImageCompare.toGrayscale(cmp.getPixel(x, y)); + /** @type {number} */ var rF = 0.7 + 0.3 * luma; + errorMask.setPixel([red * rF, (1.0 - red) * rF, 0.0, 1.0], x, y); + + } + } + + // Scale error sum based on number of samples taken + errSum *= ((width - 2) * (height - 2)) / numSamples; + + return errSum; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js new file mode 100644 index 000000000..3a8138ef2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js @@ -0,0 +1,757 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuBilinearImageCompare'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.common.tcuFuzzyImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var tcuImageCompare = framework.common.tcuImageCompare; +var tcuSurface = framework.common.tcuSurface; +var deMath = framework.delibs.debase.deMath; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuFloat = framework.common.tcuFloat; +var tcuFuzzyImageCompare = framework.common.tcuFuzzyImageCompare; +var tcuBilinearImageCompare = framework.common.tcuBilinearImageCompare; +var tcuRGBA = framework.common.tcuRGBA; +var tcuLogImage = framework.common.tcuLogImage; + +/** + * @enum + */ +tcuImageCompare.CompareLogMode = { + EVERYTHING: 0, + RESULT: 1, + ON_ERROR: 2 +}; + +/** + * @param {framework.common.tcuTexture.ConstPixelBufferAccess} result + * @param {framework.common.tcuTexture.ConstPixelBufferAccess} reference + * @param {framework.common.tcuTexture.ConstPixelBufferAccess=} diff + */ +tcuImageCompare.displayImages = function(result, reference, diff) { + var limits = tcuImageCompare.computeScaleAndBias(reference, result); + tcuLogImage.logImage('Result', '', result, limits.scale, limits.bias); + tcuLogImage.logImage('Reference', '', reference, limits.scale, limits.bias); + if (diff) + tcuLogImage.logImage('Error', 'error mask', diff); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.ConstPixelBufferAccess} result + * @return {{scale: Array, bias: Array}} + */ +tcuImageCompare.computeScaleAndBias = function(reference, result) { + var minVal = []; + var maxVal = []; + var scale = []; + var bias = []; + + var eps = 0.0001; + var referenceRange = tcuTextureUtil.estimatePixelValueRange(reference); + var resultRange = tcuTextureUtil.estimatePixelValueRange(result); + + minVal[0] = Math.min(referenceRange[0][0], resultRange[0][0]); + minVal[1] = Math.min(referenceRange[0][1], resultRange[0][1]); + minVal[2] = Math.min(referenceRange[0][2], resultRange[0][2]); + minVal[3] = Math.min(referenceRange[0][3], resultRange[0][3]); + + maxVal[0] = Math.max(referenceRange[1][0], resultRange[1][0]); + maxVal[1] = Math.max(referenceRange[1][1], resultRange[1][1]); + maxVal[2] = Math.max(referenceRange[1][2], resultRange[1][2]); + maxVal[3] = Math.max(referenceRange[1][3], resultRange[1][3]); + + for (var c = 0; c < 4; c++) { + if (maxVal[c] - minVal[c] < eps) { + scale[c] = (maxVal[c] < eps) ? 1 : (1 / maxVal[c]); + bias[c] = (c == 3) ? (1 - maxVal[c] * scale[c]) : (0 - minVal[c] * scale[c]); + } else { + scale[c] = 1 / (maxVal[c] - minVal[c]); + bias[c] = 0 - minVal[c] * scale[c]; + } + } + return { + scale: scale, + bias: bias + }; +}; + +/** + * \brief Per-pixel threshold-based comparison + * + * This compare computes per-pixel differences between result and reference + * image. Comparison fails if any pixels exceed the given threshold value. + * + * This comparison can be used for integer- and fixed-point texture formats. + * Difference is computed in integer space. + * + * On failure error image is generated that shows where the failing pixels + * are. + * + * @param {string} imageSetName Name for image set when logging results + * @param {string} imageSetDesc Description for image set + * @param {tcuTexture.ConstPixelBufferAccess} reference Reference image + * @param {tcuTexture.ConstPixelBufferAccess} result Result image + * @param {Array} threshold Maximum allowed difference + * @param {tcuImageCompare.CompareLogMode=} logMode + * @param {Array< Array >} skipPixels pixels that are skipped comparison + * @return {boolean} true if comparison passes, false otherwise + */ + tcuImageCompare.intThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode, skipPixels) { + var width = reference.getWidth(); + var height = reference.getHeight(); + var depth = reference.getDepth(); + var errorMask = new tcuSurface.Surface(width, height); + + var maxDiff = [0, 0, 0, 0]; + // var pixelBias = [0, 0, 0, 0]; // Vec4 // TODO: check, only used in computeScaleAndBias, which is not included + // var pixelScale = [1, 1, 1, 1]; // Vec4 // TODO: check, only used in computeScaleAndBias + + assertMsgOptions(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth, + 'Reference and result images have different dimensions', false, true); + + for (var z = 0; z < depth; z++) { + for (var y = 0; y < height; y++) { + for (var x = 0; x < width; x++) { + if (skipPixels && skipPixels.length > 0) { + var skip = false; + for (var ii = 0; ii < skipPixels.length; ++ii) { + var refZ = (skipPixels[ii].length > 2 ? skipPixels[ii][2] : 0); + if (x == skipPixels[ii][0] && y == skipPixels[ii][1] && z == refZ) { + skip = true; + break; + } + } + if (skip) + continue; + } + var refPix = reference.getPixelInt(x, y, z); + var cmpPix = result.getPixelInt(x, y, z); + + var diff = deMath.absDiff(refPix, cmpPix); + var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold)); + + maxDiff = deMath.max(maxDiff, diff); + var color = [0, 255, 0, 255]; + if (!isOk) + color = [255, 0, 0, 255]; + errorMask.setPixel(x, y, color); + } + } + } + + var compareOk = deMath.boolAll(deMath.lessThanEqual(maxDiff, threshold)); + + if (!compareOk) { + debug('Image comparison failed: max difference = ' + maxDiff + ', threshold = ' + threshold); + tcuImageCompare.displayImages(result, reference, errorMask.getAccess()); + } + + return compareOk; +}; + +/** + * \brief Per-pixel threshold-based deviation-ignoring comparison + * + * This compare computes per-pixel differences between result and reference + * image. Pixel fails the test if there is no pixel matching the given + * threshold value in the search volume. Comparison fails if the number of + * failing pixels exceeds the given limit. + * + * If the search volume contains out-of-bounds pixels, comparison can be set + * to either ignore these pixels in search or to accept any pixel that has + * out-of-bounds pixels in its search volume. + * + * This comparison can be used for integer- and fixed-point texture formats. + * Difference is computed in integer space. + * + * On failure error image is generated that shows where the failing pixels + * are. + * + * @param {string} imageSetName Name for image set when logging results + * @param {string} imageSetDesc Description for image set + * @param {tcuTexture.ConstPixelBufferAccess} reference Reference image + * @param {tcuTexture.ConstPixelBufferAccess} result Result image + * @param {Array} threshold Maximum allowed difference + * @param {Array} maxPositionDeviation Maximum allowed distance in the search volume. + * @param {boolean} acceptOutOfBoundsAsAnyValue Accept any pixel in the boundary region + * @param {number} maxAllowedFailingPixels Maximum number of failing pixels + * @return {boolean} true if comparison passes, false otherwise + */ +tcuImageCompare.intThresholdPositionDeviationErrorThresholdCompare = function( + imageSetName, imageSetDesc, reference, result, threshold, maxPositionDeviation, acceptOutOfBoundsAsAnyValue, maxAllowedFailingPixels) { + /** @type {number} */ var width = reference.getWidth(); + /** @type {number} */ var height = reference.getHeight(); + /** @type {number} */ var depth = reference.getDepth(); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height); + /** @type {number} */ var numFailingPixels = tcuImageCompare.findNumPositionDeviationFailingPixels(errorMask.getAccess(), reference, result, threshold, maxPositionDeviation, acceptOutOfBoundsAsAnyValue); + var compareOk = numFailingPixels <= maxAllowedFailingPixels; + /** @type {Array} */ var pixelBias = [0.0, 0.0, 0.0, 0.0]; + /** @type {Array} */ var pixelScale = [1.0, 1.0, 1.0, 1.0]; + + if (!compareOk) { + debug('Position deviation error threshold image comparison failed: failed pixels = ' + numFailingPixels + ', threshold = ' + threshold); + tcuImageCompare.displayImages(result, reference, errorMask.getAccess()); + } else + tcuLogImage.logImage('Result', '', result); + + /*if (!compareOk) { + // All formats except normalized unsigned fixed point ones need remapping in order to fit into unorm channels in logged images. + if (tcuTexture.getTextureChannelClass(reference.getFormat().type) != tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT || + tcuTexture.getTextureChannelClass(result.getFormat().type) != tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) { + computeScaleAndBias(reference, result, pixelScale, pixelBias); + log << TestLog::Message << "Result and reference images are normalized with formula p * " << pixelScale << " + " << pixelBias << TestLog::EndMessage; + } + + if (!compareOk) + log << TestLog::Message + << "Image comparison failed:\n" + << "\tallowed position deviation = " << maxPositionDeviation << "\n" + << "\tcolor threshold = " << threshold + << TestLog::EndMessage; + log << TestLog::Message << "Number of failing pixels = " << numFailingPixels << ", max allowed = " << maxAllowedFailingPixels << TestLog::EndMessage; + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias) + << TestLog::Image("ErrorMask", "Error mask", errorMask) + << TestLog::EndImageSet; + } else if (logMode == COMPARE_LOG_RESULT) { + if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8)) + computePixelScaleBias(result, pixelScale, pixelBias); + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::EndImageSet; + }*/ + + return compareOk; +}; + +/** + * tcuImageCompare.floatUlpThresholdCompare + * @param {string} imageSetName + * @param {string} imageSetDesc + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {Array} threshold - previously used as an Uint32Array + * @return {boolean} + */ +tcuImageCompare.floatUlpThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold) { + /** @type {number} */ var width = reference.getWidth(); + /** @type {number} */ var height = reference.getHeight(); + /** @type {number} */ var depth = reference.getDepth(); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height); + + /** @type {Array} */ var maxDiff = [0, 0, 0, 0]; // UVec4 + // var pixelBias = [0, 0, 0, 0]; // Vec4 + // var pixelScale = [1, 1, 1, 1]; // Vec4 + + assertMsgOptions(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth, + 'Reference and result images have different dimensions', false, true); + + for (var z = 0; z < depth; z++) { + for (var y = 0; y < height; y++) { + for (var x = 0; x < width; x++) { + /** @type {ArrayBuffer} */ var arrayBufferRef = new ArrayBuffer(4 * 4); + /** @type {ArrayBuffer} */ var arrayBufferCmp = new ArrayBuffer(4 * 4); + + /** @type {Array} */ var refPix = reference.getPixel(x, y, z); // getPixel returns a Vec4 pixel color + + /** @type {Array} */ var cmpPix = result.getPixel(x, y, z); // getPixel returns a Vec4 pixel color + + /** @type {Uint32Array} */ var refBits = new Uint32Array(arrayBufferRef); // UVec4 + /** @type {Uint32Array} */ var cmpBits = new Uint32Array(arrayBufferCmp); // UVec4 + + // Instead of memcpy(), which is the way to do float->uint32 reinterpretation in C++ + for (var i = 0; i < refPix.length; i++) { + refBits[i] = tcuFloat.convertFloat32Inline(refPix[i], tcuFloat.description32); + cmpBits[i] = tcuFloat.convertFloat32Inline(cmpPix[i], tcuFloat.description32); + } + + /** @type {Array} */ var diff = deMath.absDiff(refBits, cmpBits); // UVec4 + /** @type {boolean} */ var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold)); + + maxDiff = deMath.max(maxDiff, diff); + + errorMask.setPixel(x, y, isOk ? [0, 255, 0, 255] : [255, 0, 0, 255]); + } + } + } + + /** @type {boolean} */ var compareOk = deMath.boolAll(deMath.lessThanEqual(maxDiff, threshold)); + + if (!compareOk) { + debug('Image comparison failed: max difference = ' + maxDiff + ', threshold = ' + threshold); + tcuImageCompare.displayImages(result, reference, errorMask.getAccess()); + } + + /*if (!compareOk || logMode == COMPARE_LOG_EVERYTHING) { + // All formats except normalized unsigned fixed point ones need remapping in order to fit into unorm channels in logged images. + if (tcu::getTextureChannelClass(reference.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT || + tcu::getTextureChannelClass(result.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT) { + computeScaleAndBias(reference, result, pixelScale, pixelBias); + log << TestLog::Message << "Result and reference images are normalized with formula p * " << pixelScale << " + " << pixelBias << TestLog::EndMessage; + } + + if (!compareOk) + log << TestLog::Message << "Image comparison failed: max difference = " << maxDiff << ", threshold = " << threshold << TestLog::EndMessage; + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias) + << TestLog::Image("ErrorMask", "Error mask", errorMask) + << TestLog::EndImageSet; + } else if (logMode == COMPARE_LOG_RESULT) { + if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8)) + computePixelScaleBias(result, pixelScale, pixelBias); + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::EndImageSet; + }*/ + + return compareOk; +}; + +/** + * tcuImageCompare.floatThresholdCompare + * @param {string} imageSetName + * @param {string} imageSetDesc + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {Array} threshold + * @return {boolean} + */ +tcuImageCompare.floatThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold) { + /** @type {number} */ var width = reference.getWidth(); + /** @type {number} */ var height = reference.getHeight(); + /** @type {number} */ var depth = reference.getDepth(); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height); + + /** @type {Array} */ var maxDiff = [0, 0, 0, 0]; // Vec4 + // var pixelBias = [0, 0, 0, 0]; // Vec4 + // var pixelScale = [1, 1, 1, 1]; // Vec4 + + assertMsgOptions(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth, + 'Reference and result images have different dimensions', false, true); + + for (var z = 0; z < depth; z++) { + for (var y = 0; y < height; y++) { + for (var x = 0; x < width; x++) { + var refPix = reference.getPixel(x, y, z); // Vec4 + var cmpPix = result.getPixel(x, y, z); // Vec4 + + /** @type {Array} */ var diff = deMath.absDiff(refPix, cmpPix); // Vec4 + /** @type {boolean} */ var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold)); + + maxDiff = deMath.max(maxDiff, diff); + + errorMask.setPixel(x, y, isOk ? [0, 255, 0, 255] : [255, 0, 0, 255]); + } + } + } + + /** @type {boolean} */ var compareOk = deMath.boolAll(deMath.lessThanEqual(maxDiff, threshold)); + + if (!compareOk) { + debug('Image comparison failed: max difference = ' + maxDiff + ', threshold = ' + threshold); + tcuImageCompare.displayImages(result, reference, errorMask.getAccess()); + } + + /*if (!compareOk || logMode == COMPARE_LOG_EVERYTHING) { + // All formats except normalized unsigned fixed point ones need remapping in order to fit into unorm channels in logged images. + if (tcu::getTextureChannelClass(reference.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT || + tcu::getTextureChannelClass(result.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT) { + computeScaleAndBias(reference, result, pixelScale, pixelBias); + log << TestLog::Message << "Result and reference images are normalized with formula p * " << pixelScale << " + " << pixelBias << TestLog::EndMessage; + } + + if (!compareOk) + log << TestLog::Message << "Image comparison failed: max difference = " << maxDiff << ", threshold = " << threshold << TestLog::EndMessage; + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias) + << TestLog::Image("ErrorMask", "Error mask", errorMask) + << TestLog::EndImageSet; + } else if (logMode == COMPARE_LOG_RESULT) { + if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8)) + computePixelScaleBias(result, pixelScale, pixelBias); + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::EndImageSet; + }*/ + + return compareOk; +}; + +/** + * \brief Per-pixel threshold-based comparison + * + * This compare computes per-pixel differences between result and reference + * image. Comparison fails if any pixels exceed the given threshold value. + * + * On failure error image is generated that shows where the failing pixels + * are. + * + * @param {string} imageSetName Name for image set when logging results + * @param {string} imageSetDesc Description for image set + * @param {tcuSurface.Surface} reference Reference image + * @param {tcuSurface.Surface} result Result image + * @param {Array} threshold Maximum allowed difference + * @param {tcuImageCompare.CompareLogMode=} logMode + * @param {Array< Array >} skipPixels pixels that are skipped comparison + * @return {boolean} true if comparison passes, false otherwise + */ +tcuImageCompare.pixelThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode, skipPixels) { + return tcuImageCompare.intThresholdCompare(imageSetName, imageSetDesc, reference.getAccess(), result.getAccess(), threshold, logMode, skipPixels); +}; + +/** + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {Array} threshold + * @param {Array} maxPositionDeviation + * @param {boolean} acceptOutOfBoundsAsAnyValue + * @return {number} + */ +tcuImageCompare.findNumPositionDeviationFailingPixels = function(errorMask, reference, result, threshold, maxPositionDeviation, acceptOutOfBoundsAsAnyValue) { + /** @type {number} */ var width = reference.getWidth(); + /** @type {number} */ var height = reference.getHeight(); + /** @type {number} */ var depth = reference.getDepth(); + /** @type {number} */ var numFailingPixels = 0; + + checkMessage(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth, 'Surfaces have different dimensions'); + + for (var z = 0; z < depth; z++) { + for (var y = 0; y < height; y++) { + for (var x = 0; x < width; x++) { + /** @type {Array} */ var refPix = reference.getPixelInt(x, y, z); + /** @type {Array} */ var cmpPix = result.getPixelInt(x, y, z); + + // Exact match + /** @type {Array} */ var diff = deMath.absDiff(refPix, cmpPix); + /** @type {boolean} */ var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold)); + + if (isOk) { + errorMask.setPixel([0, 0xff, 0, 0xff], x, y, z); + continue; + } + + // Accept over the image bounds pixels since they could be anything + + if (acceptOutOfBoundsAsAnyValue && + (x < maxPositionDeviation[0] || x + maxPositionDeviation[0] >= width || + y < maxPositionDeviation[1] || y + maxPositionDeviation[1] >= height || + z < maxPositionDeviation[2] || z + maxPositionDeviation[2] >= depth)) { + errorMask.setPixel([0, 0xff, 0, 0xff], x, y, z); + continue; + } + + // Find matching pixels for both result and reference pixel + + var pixelFoundForReference = false; + var pixelFoundForResult = false; + + // Find deviated result pixel for reference + + for (var sz = Math.max(0, z - maxPositionDeviation[2]); sz <= Math.min(depth - 1, z + maxPositionDeviation[2]) && !pixelFoundForReference; ++sz) + for (var sy = Math.max(0, y - maxPositionDeviation[1]); sy <= Math.min(height - 1, y + maxPositionDeviation[1]) && !pixelFoundForReference; ++sy) + for (var sx = Math.max(0, x - maxPositionDeviation[0]); sx <= Math.min(width - 1, x + maxPositionDeviation[0]) && !pixelFoundForReference; ++sx) { + /** @type {Array} */ var deviatedCmpPix = result.getPixelInt(sx, sy, sz); + diff = deMath.absDiff(refPix, deviatedCmpPix); + isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold)); + + pixelFoundForReference |= isOk; + } + + // Find deviated reference pixel for result + + for (var sz = Math.max(0, z - maxPositionDeviation[2]); sz <= Math.min(depth - 1, z + maxPositionDeviation[2]) && !pixelFoundForResult; ++sz) + for (var sy = Math.max(0, y - maxPositionDeviation[1]); sy <= Math.min(height - 1, y + maxPositionDeviation[1]) && !pixelFoundForResult; ++sy) + for (var sx = Math.max(0, x - maxPositionDeviation[0]); sx <= Math.min(width - 1, x + maxPositionDeviation[0]) && !pixelFoundForResult; ++sx) { + /** @type {Array} */ var deviatedRefPix = reference.getPixelInt(sx, sy, sz); + diff = deMath.absDiff(cmpPix, deviatedRefPix); + isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold)); + + pixelFoundForResult |= isOk; + } + + if (pixelFoundForReference && pixelFoundForResult) + errorMask.setPixel([0, 0xff, 0, 0xff], x, y, z); + else { + errorMask.setPixel([0xff, 0, 0, 0xff], x, y, z); + ++numFailingPixels; + } + } + } + } + + return numFailingPixels; +}; + + /** + * tcuImageCompare.fuzzyCompare + * @param {string} imageSetName + * @param {string} imageSetDesc + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {number} threshold + * @param {tcuImageCompare.CompareLogMode=} logMode + * @return {boolean} + */ +tcuImageCompare.fuzzyCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode) { + /** @type {tcuFuzzyImageCompare.FuzzyCompareParams} */ var params = new tcuFuzzyImageCompare.FuzzyCompareParams(); // Use defaults. + /** @type {tcuTexture.TextureLevel} */ var errorMask = new tcuTexture.TextureLevel( + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, + tcuTexture.ChannelType.UNORM_INT8), + reference.getWidth(), + reference.getHeight() + ); + /** @type {number} */ var difference = tcuFuzzyImageCompare.fuzzyCompare( + params, + reference, + result, + tcuTexture.PixelBufferAccess.newFromTextureLevel(errorMask) + ); + /** @type {boolean} */ var isOk = difference <= threshold; + /** @type {Array} */ var pixelBias = [0.0, 0.0, 0.0, 0.0]; + /** @type {Array} */ var pixelScale = [1.0, 1.0, 1.0, 1.0]; + + if (!isOk) { + debug('Fuzzy image comparison failed: difference = ' + difference + ', threshold = ' + threshold); + tcuImageCompare.displayImages(result, reference, errorMask.getAccess()); + } + + /* + if (!isOk || logMode == COMPARE_LOG_EVERYTHING) { + // Generate more accurate error mask. + params.maxSampleSkip = 0; + tcuImageCompare.fuzzyCompare(params, reference, result, errorMask.getAccess()); + + if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8) && reference.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8)) + computeScaleAndBias(reference, result, pixelScale, pixelBias); + + if (!isOk) + log << TestLog::Message << "Image comparison failed: difference = " << difference << ", threshold = " << threshold << TestLog::EndMessage; + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias) + << TestLog::Image("ErrorMask", "Error mask", errorMask) + << TestLog::EndImageSet; + } else if (logMode == COMPARE_LOG_RESULT) { + if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8)) + computePixelScaleBias(result, pixelScale, pixelBias); + + log << TestLog::ImageSet(imageSetName, imageSetDesc) + << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + << TestLog::EndImageSet; + } + */ + return isOk; +}; + +tcuImageCompare.unitTest = function() { + var width = 128; + var height = 128; + + var weirdLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT32), width, height); + var access = weirdLevel.getAccess(); + access.clear([0.1, 0.5, 0, 0]); + access.clear([0.11, 0.52, 0, 0], [0, width], [0, height / 2]); + access.clear([0.12, 0.52, 0, 0], [0, width], [height / 2, height / 2 + height / 8]); + var limits = tcuTextureUtil.computePixelScaleBias(access); + debug('Scale: ' + limits.scale); + debug('Bias: ' + limits.bias); + tcuLogImage.logImage('Weird', 'weird format without scaling', access); + tcuLogImage.logImage('Weird', 'weird format', access, limits.scale, limits.bias); + + var srcLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height); + var dstLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height); + var src = srcLevel.getAccess(); + var dst = dstLevel.getAccess(); + + src.clear(); + dst.clear(); + + for (var i = 0; i < width - 1; i++) { + for (var j = 0; j < height - 1; j++) { + src.setPixelInt([i, j, 90, 255], i, j); + dst.setPixelInt([i, j, 90, 255], i + 1, j + 1); + } + } + + debug('Src format: ' + src.getFormat()); + debug('Destination: ' + dst); + debug(src); + tcuLogImage.logImage('Source', 'Source image', src); + + if (!tcuImageCompare.fuzzyCompare('compare', 'compare similar images', src, dst, 0.05)) + throw new Error('Compare should return true'); + + src.clear(); + dst.clear(); + + for (var i = 0; i < width - 2; i++) { + for (var j = 0; j < height - 2; j++) { + src.setPixelInt([i, j, 90, 255], i, j); + dst.setPixelInt([i, j, 90, 255], i + 2, j + 2); + } + } + + if (tcuImageCompare.fuzzyCompare('compare', 'compare different images', src, dst, 0.05)) + throw new Error('Compare should return false'); + + debug('Passed'); +}; + +tcuImageCompare.unitTest2 = function() { + var width = 128; + var height = 128; + var srcLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height); + var dstLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height); + var src = srcLevel.getAccess(); + var dst = dstLevel.getAccess(); + var threshold = tcuRGBA.newRGBAComponents(1, 1, 1, 1); + debug('Threshold: ' + threshold); + + src.clear(); + dst.clear(); + + for (var i = 0; i < width - 1; i++) { + for (var j = 0; j < height - 1; j++) { + src.setPixelInt([i, j, 90, 255], i, j); + dst.setPixelInt([i, j, 90, 255], i, j); + } + } + if (!tcuImageCompare.bilinearCompare('compare', 'compare similar images', src, dst, threshold)) + throw new Error('Compare should return true'); + debug('bilinear compare the same images passed'); + + src.clear(); + dst.clear(); + + for (var i = 0; i < width - 1; i++) { + for (var j = 0; j < height - 1; j++) { + src.setPixelInt([i, j, 90, 255], i, j); + dst.setPixelInt([i, j + 1, 90, 255], i, j + 1); + } + } + if (!tcuImageCompare.bilinearCompare('compare', 'compare similar images', src, dst, threshold)) + throw new Error('Compare should return true'); + debug('bilinear compare very similar images passed'); + + src.clear(); + dst.clear(); + + for (var i = 0; i < width - 2; i++) { + for (var j = 0; j < height - 2; j++) { + src.setPixelInt([i, j, 90, 255], i, j); + // dst.setPixelInt([i, j, 90, 255], i + 2, j + 2); + } + } + + if (tcuImageCompare.bilinearCompare('compare', 'compare different images', src, dst, threshold)) + throw new Error('Compare should return false'); + + debug('bilinear compare very different images passed'); +}; + +/** + * Bilinear image comparison + * On failure error image is generated that shows where the failing pixels + * are. + * Currently supports only RGBA, UNORM_INT8 formats + * + * @param {string} imageSetName Name for image set when logging results + * @param {string} imageSetDesc Description for image set + * @param {tcuTexture.ConstPixelBufferAccess} reference Reference image + * @param {tcuTexture.ConstPixelBufferAccess} result Result image + * @param {tcuRGBA.RGBA} threshold Maximum local difference + * @param {tcuImageCompare.CompareLogMode=} logMode Logging mode + * @return {boolean} if comparison passes, false otherwise + */ +tcuImageCompare.bilinearCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode) { + /** @type {tcuTexture.TextureLevel} */ + var errorMask = new tcuTexture.TextureLevel( + new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGB, + tcuTexture.ChannelType.UNORM_INT8), + reference.getWidth(), + reference.getHeight()); + + /** @type {boolean} */ + var isOk = tcuBilinearImageCompare.bilinearCompare( + reference, + result, + tcuTexture.PixelBufferAccess.newFromTextureLevel(errorMask), + threshold); + + if (!isOk) { + debug('Image comparison failed: threshold = ' + threshold); + tcuImageCompare.displayImages(result, reference, errorMask.getAccess()); + } + + // /* @type {Array} */ var pixelBias = [0.0, 0.0, 0.0, 0.0]; + // /* @type {Array} */ var pixelScale = [1.0, 1.0, 1.0, 1.0]; + // if (!isOk || logMode == COMPARE_LOG_EVERYTHING) + // { + // if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8) && reference.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8)) + // computeScaleAndBias(reference, result, pixelScale, pixelBias); + // + // if (!isOk) + // log << TestLog::Message << "Image comparison failed, threshold = " << threshold << TestLog::EndMessage; + // + // log << TestLog::ImageSet(imageSetName, imageSetDesc) + // << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + // << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias) + // << TestLog::Image("ErrorMask", "Error mask", errorMask) + // << TestLog::EndImageSet; + // } + // else if (logMode == COMPARE_LOG_RESULT) + // { + // if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8)) + // computePixelScaleBias(result, pixelScale, pixelBias); + // + // log << TestLog::ImageSet(imageSetName, imageSetDesc) + // << TestLog::Image("Result", "Result", result, pixelScale, pixelBias) + // << TestLog::EndImageSet; + // } + + return isOk; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js new file mode 100644 index 000000000..23296c1f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js @@ -0,0 +1,609 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program Tester Core + * ---------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Interval arithmetic and floating point precisions. + *//*--------------------------------------------------------------------*/ + 'use strict'; + goog.provide('framework.common.tcuInterval'); + goog.require('framework.delibs.debase.deMath'); + + goog.scope(function() { + + var tcuInterval = framework.common.tcuInterval; + var deMath = framework.delibs.debase.deMath; + + /** + * @typedef {function(number):number} + */ + tcuInterval.DoubleFunc1; + + /** + * @typedef {function(number, number):number} + */ + tcuInterval.DoubleFunc2; + + /** + * @typedef {function(number,number,number):number} + */ + tcuInterval.DoubleFunc3; + + /** + * @typedef {function(number):tcuInterval.Interval} + */ + tcuInterval.DoubleIntervalFunc1; + + /** + * @typedef {function(number,number):tcuInterval.Interval} + */ + tcuInterval.DoubleIntervalFunc2; + + /** + * @typedef {function(number,number,number):tcuInterval.Interval} + */ + tcuInterval.DoubleIntervalFunc3; + + /** + * @param {function(number): number} func + * @param {tcuInterval.Interval} arg0 + * @return {tcuInterval.Interval} + */ + tcuInterval.applyMonotone1p = function(func, arg0) { + /** + * @param {number=} x + * @param {number=} y + * @return {number} + */ + var body = function(x, y) { + x = x || 0; + return func(x); + }; + return tcuInterval.applyMonotone1(arg0, + function(x) { return tcuInterval.setInterval(body, x); }); + }; + + /** + * @param {function(number): tcuInterval.Interval} func + * @param {tcuInterval.Interval} arg0 + * @return {tcuInterval.Interval} + */ + tcuInterval.applyMonotone1i = function(func, arg0) { + return tcuInterval.withIntervals(func(arg0.lo()), func(arg0.hi())); + }; + + /** + * @param {function(number, number): number} func + * @param {tcuInterval.Interval} arg0 + * @param {tcuInterval.Interval} arg1 + * @return {tcuInterval.Interval} + */ + tcuInterval.applyMonotone2p = function(func, arg0, arg1) { + /** + * @param {number=} x + * @param {number=} y + * @return {number} + */ + var body = function(x, y) { + x = x || 0; + y = y || 0; + return func(x, y); + }; + return tcuInterval.applyMonotone2(arg0, arg1, + function(x, y) { return tcuInterval.setInterval(body, x, y); }); + }; + + /** + * @param {function(number, number): tcuInterval.Interval} func + * @param {tcuInterval.Interval} arg0 + * @param {tcuInterval.Interval} arg1 + * @return {tcuInterval.Interval} + */ + tcuInterval.applyMonotone2i = function(func, arg0, arg1) { + /** @type {number} */ var lo0 = arg0.lo(); + /** @type {number} */ var hi0 = arg0.hi(); + /** @type {number} */ var lo1 = arg1.lo(); + /** @type {number} */ var hi1 = arg1.hi(); + var a = tcuInterval.withIntervals(func(lo0, lo1), func(lo0, hi1)); + var b = tcuInterval.withIntervals(func(hi0, lo1), func(hi0, hi1)); + return tcuInterval.withIntervals(a, b); + }; + + /** + * @constructor + * @param {number=} val + */ + tcuInterval.Interval = function(val) { + if (val === undefined) { + this.m_hasNaN = false; + this.m_lo = Number.POSITIVE_INFINITY; + this.m_hi = Number.NEGATIVE_INFINITY; + } else { + this.m_hasNaN = isNaN(val); + this.m_lo = this.m_hasNaN ? Number.POSITIVE_INFINITY : val; + this.m_hi = this.m_hasNaN ? Number.NEGATIVE_INFINITY : val; + } + }; + + tcuInterval.Interval.prototype.toString = function() { + var str = 'Interval(' + this.m_lo + ', ' + this.m_hi; + if (this.m_hasNaN) + str += ', hasNaN'; + str += ')'; + return str; + }; + + /** + * @param {tcuInterval.Interval} a + * @param {tcuInterval.Interval} b + * @return {tcuInterval.Interval} + */ + tcuInterval.withIntervals = function(a, b) { + /** @type {tcuInterval.Interval} */ var interval = new tcuInterval.Interval(); + interval.m_hasNaN = (a.m_hasNaN || b.m_hasNaN); + interval.m_lo = Math.min(a.m_lo, b.m_lo); + interval.m_hi = Math.max(a.m_hi, b.m_hi); + return interval; + }; + + /** + * @param {number} a + * @param {number} b + * @return {tcuInterval.Interval} + */ + tcuInterval.withNumbers = function(a, b) { + var x = new tcuInterval.Interval(a); + var y = new tcuInterval.Interval(b); + return tcuInterval.withIntervals(x, y); + }; + + /** + * @param {boolean} hasNaN_ + * @param {number} lo_ + * @param {number} hi_ + * @return {tcuInterval.Interval} + */ + tcuInterval.withParams = function(hasNaN_, lo_, hi_) { + /** @type {tcuInterval.Interval} */ var interval = new tcuInterval.Interval(); + interval.m_hasNaN = hasNaN_; + interval.m_lo = lo_; + interval.m_hi = hi_; + return interval; + }; + + /** + * @return {number} + */ + tcuInterval.Interval.prototype.length = function() { + return this.m_hi - this.m_lo; + }; + + /** + * @return {number} + */ + tcuInterval.Interval.prototype.lo = function() { + return this.m_lo; + }; + + /** + * @return {number} + */ + tcuInterval.Interval.prototype.hi = function() { + return this.m_hi; + }; + + /** + * @return {boolean} + */ + tcuInterval.Interval.prototype.hasNaN = function() { + return this.m_hasNaN; + }; + + /** + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.prototype.nan = function() { + return this.m_hasNaN ? new tcuInterval.Interval(NaN) : new tcuInterval.Interval(); + }; + + /** + * @return {boolean} + */ + tcuInterval.Interval.prototype.empty = function() { + return this.m_lo > this.m_hi; + }; + + /** + * @return {boolean} + */ + tcuInterval.Interval.prototype.isFinite = function() { + return isFinite(this.m_lo) && isFinite(this.m_hi); + }; + + /** + * @return {boolean} + */ + tcuInterval.Interval.prototype.isOrdinary = function() { + return !this.hasNaN() && !this.empty() && this.isFinite(); + }; + + /** + * @param {tcuInterval.Interval} other + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.prototype.operatorOrBinary = function(other) { + /** @type {tcuInterval.Interval} */ var temp = new tcuInterval.Interval(); + temp.m_hasNaN = this.m_hasNaN || other.m_hasNaN; + temp.m_lo = Math.min(this.m_lo, other.m_lo); + temp.m_hi = Math.max(this.m_hi, other.m_hi); + return temp; + }; + + /** + * @param {tcuInterval.Interval} other + */ + tcuInterval.Interval.prototype.operatorOrAssignBinary = function(other) { + /** @type {tcuInterval.Interval} */ var temp = this.operatorOrBinary(other); + this.m_hasNaN = temp.m_hasNaN; + this.m_lo = temp.m_lo; + this.m_hi = temp.m_hi; + }; + + /** + * @param {tcuInterval.Interval} other + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.prototype.operatorAndBinary = function(other) { + /** @type {tcuInterval.Interval} */ var temp = new tcuInterval.Interval(); + temp.m_hasNaN = this.m_hasNaN && other.m_hasNaN; + temp.m_lo = Math.max(this.m_lo, other.m_lo); + temp.m_hi = Math.min(this.m_hi, other.m_hi); + return temp; + }; + + /** + * @param {tcuInterval.Interval} other + */ + tcuInterval.Interval.prototype.operatorAndAssignBinary = function(other) { + /** @type {tcuInterval.Interval} */ var temp = this.operatorAndBinary(other); + this.m_hasNaN = temp.m_hasNaN; + this.m_lo = temp.m_lo; + this.m_hi = temp.m_hi; + }; + + /** + * @param {tcuInterval.Interval} other + * @return {boolean} + */ + tcuInterval.Interval.prototype.contains = function(other) { + return (other.lo() >= this.lo() && other.hi() <= this.hi() && + (!other.hasNaN() || this.hasNaN())); + }; + + /** + * @param {tcuInterval.Interval} other + * @return {boolean} + */ + tcuInterval.Interval.prototype.intersects = function(other) { + return ((other.hi() >= this.lo() && other.lo() >= this.hi()) || + (other.hasNaN() && this.hasNaN())); + }; + + /** + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.prototype.operatorNegative = function() { + /** @type {tcuInterval.Interval} */ var temp = new tcuInterval.Interval(); + temp.m_hasNaN = this.m_hasNaN; + temp.m_lo = -this.m_hi; + temp.m_hi = -this.m_lo; + return temp; + }; + + /** + * @param {boolean=} nan + * @return {tcuInterval.Interval} + */ + tcuInterval.unbounded = function(nan) { + if (nan === undefined) + nan = false; + return tcuInterval.withParams(nan, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY); + }; + + /** + * @return {number} + */ + tcuInterval.Interval.prototype.midpoint = function() { + return 0.5 * (this.hi() + this.lo()); // returns NaN when not bounded + }; + + /** + * @param {tcuInterval.Interval} other + * @return {boolean} + */ + tcuInterval.Interval.prototype.operatorCompare = function(other) { + return ((this.m_hasNaN == other.m_hasNaN) && + ((this.empty() && other.empty()) || + (this.m_lo == other.m_lo && this.m_hi == other.m_hi))); + }; + + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.operatorPositive = function(x) { + return x; + }; + + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.exp2 = function(x) { + // std::pow + return tcuInterval.applyMonotone2p(Math.pow, new tcuInterval.Interval(2), x); + }; + + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.exp = function(x) { + // std::exp + return tcuInterval.applyMonotone1p(Math.exp, x); + }; + + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.sign = function(x) { + // TODO + throw new Error('Unimplemented'); + }; + + /** + * @param {tcuInterval.Interval} x + * @param {tcuInterval.Interval} y + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.operatorSum = function(x, y) { + /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + + if (!x.empty() && !y.empty()) + ret = tcuInterval.setIntervalBounds(function(dummy) {return x.lo() + y.lo();}, function(dummy) {return x.hi() + y.hi();}); + if (x.hasNaN() || y.hasNaN()) + ret.operatorOrAssignBinary(new tcuInterval.Interval(NaN)); + + return ret; + }; + + /** + * @param {tcuInterval.Interval} x + * @param {tcuInterval.Interval} y + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.operatorSub = function(x, y) { + /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + + /** + * @param {number=} x + * @param {number=} y + * @return {tcuInterval.Interval} + */ + var body = function(x, y) { + return new tcuInterval.Interval(x - y); + }; + + ret = tcuInterval.applyMonotone2(x, y, body); + return ret; + }; + + /** + * @param {tcuInterval.Interval} x + * @param {tcuInterval.Interval} y + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.operatorMul = function(x, y) { + /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + + /** + * @param {number=} x + * @param {number=} y + * @return {tcuInterval.Interval} + */ + var body = function(x, y) { + return new tcuInterval.Interval(x * y); + }; + + ret = tcuInterval.applyMonotone2(x, y, body); + + return ret; + }; + + /** + * @param {tcuInterval.Interval} nom + * @param {tcuInterval.Interval} den + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.operatorDiv = function(nom, den) { + if (den.contains(new tcuInterval.Interval(0))) { + // \todo [2014-03-21 lauri] Non-inf endpoint when one den endpoint is + // zero and nom doesn't cross zero? + return tcuInterval.unbounded(); + } else { + /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + /** + * @param {number=} x + * @param {number=} y + * @return {tcuInterval.Interval} + */ + var body = function(x, y) { + return new tcuInterval.Interval(x / y); + }; + + ret = tcuInterval.applyMonotone2(nom, den, body); + + return ret; + } + }; + + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.prototype.abs = function(x) { + //std::abs + /** @type {tcuInterval.Interval} */ var mono = tcuInterval.applyMonotone1p(Math.abs, x); + var zero = new tcuInterval.Interval(0); + if (x.contains(zero)) + return tcuInterval.withIntervals(zero, mono); + + return mono; + }; + + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.sqrt = function(x) { + return tcuInterval.applyMonotone1p(Math.sqrt, x); + }; + + /** + * @param {tcuInterval.Interval} x + * @return {tcuInterval.Interval} + */ + tcuInterval.Interval.inverseSqrt = function(x) { + var ret = new tcuInterval.Interval(1); + ret = tcuInterval.Interval.operatorDiv(ret, tcuInterval.Interval.sqrt(x)); + return ret; + }; + +/** + * @param {function(number=, number=): number} setLow + * @param {function(number=, number=): number} setHigh + * @param {number=} arg0 + * @param {number=} arg1 + * @return {tcuInterval.Interval} + */ +tcuInterval.setIntervalBounds = function(setLow, setHigh, arg0, arg1) { + // TODO: No support for rounding modes. Originally, setLow() was rounded down and setHigh() rounded up + var lo = new tcuInterval.Interval(setLow(arg0, arg1)); + var hi = new tcuInterval.Interval(setHigh(arg0, arg1)); + return lo.operatorOrBinary(hi); +}; + +/** + * @param {function(number=, number=): number} set + * @param {number=} arg0 + * @param {number=} arg1 + * @return {tcuInterval.Interval} + */ +tcuInterval.setInterval = function(set, arg0, arg1) { + return tcuInterval.setIntervalBounds(set, set, arg0, arg1); +}; + +/** + * @param {tcuInterval.Interval} arg + * @param {function(number): tcuInterval.Interval} body + * @return {tcuInterval.Interval} + */ +tcuInterval.applyMonotone1 = function(arg, body) { + var ret = new tcuInterval.Interval(); + + if (!arg.empty()) { + var lo = body(arg.lo()); + var hi = body(arg.hi()); + ret = lo.operatorOrBinary(hi); + } + + if (arg.hasNaN()) { + ret = ret.operatorOrBinary(new tcuInterval.Interval(NaN)); + } + + return ret; +}; + +/** + * TODO: Check if this function works properly + * @param {tcuInterval.Interval} arg0 + * @param {tcuInterval.Interval} arg1 + * @param {function(number, number): tcuInterval.Interval} body + * @return {tcuInterval.Interval} + */ +tcuInterval.applyMonotone2 = function(arg0, arg1, body) { + var ret = new tcuInterval.Interval(); + + if (!arg0.empty() && !arg1.empty()) { + var lo0 = body(arg0.lo(), arg1.lo()); + var lo1 = body(arg0.lo(), arg1.hi()); + var hi0 = body(arg0.hi(), arg1.lo()); + var hi1 = body(arg0.hi(), arg1.hi()); + var a = lo0.operatorOrBinary(hi0); + var b = lo1.operatorOrBinary(hi1); + ret = a.operatorOrBinary(b); + } + + if (arg0.hasNaN() || arg1.hasNaN()) { + ret = ret.operatorOrBinary(new tcuInterval.Interval(NaN)); + } + + return ret; +}; + +/** + * TODO: Check if this function works properly + * @param {tcuInterval.Interval} arg0 + * @param {tcuInterval.Interval} arg1 + * @param {tcuInterval.Interval} arg2 + * @param {function(number, number, number): tcuInterval.Interval} body + * @return {tcuInterval.Interval} + */ +tcuInterval.applyMonotone3 = function(arg0, arg1, arg2, body) { + var ret = new tcuInterval.Interval(); + + if (!arg0.empty() && !arg1.empty() && !arg2.empty()) { + var i0 = body(arg0.lo(), arg1.lo(), arg2.lo()); + var i1 = body(arg0.lo(), arg1.lo(), arg2.hi()); + var i2 = body(arg0.lo(), arg1.hi(), arg2.lo()); + var i3 = body(arg0.lo(), arg1.hi(), arg2.hi()); + var i4 = body(arg0.hi(), arg1.lo(), arg2.lo()); + var i5 = body(arg0.hi(), arg1.lo(), arg2.hi()); + var i6 = body(arg0.hi(), arg1.hi(), arg2.lo()); + var i7 = body(arg0.hi(), arg1.hi(), arg2.hi()); + + var low = Math.min(i0.lo(), i1.lo(), i2.lo(), i3.lo(), i4.lo(), i5.lo(), i6.lo(), i7.lo()); + var high = Math.max(i0.hi(), i1.hi(), i2.hi(), i3.hi(), i4.hi(), i5.hi(), i6.hi(), i7.hi()); + var hasNaN = i0.hasNaN() || i1.hasNaN() || i2.hasNaN() || i3.hasNaN() || i4.hasNaN() || i5.hasNaN() || i6.hasNaN() || i7.hasNaN(); + + ret = tcuInterval.withParams(hasNaN, low, high); + } + + if (arg0.hasNaN() || arg1.hasNaN() || arg2.hasNaN()) { + ret = ret.operatorOrBinary(new tcuInterval.Interval(NaN)); + } + + return ret; +}; + +/** @const */ tcuInterval.POSITIVE_INFINITY = new tcuInterval.Interval(Infinity); +/** @const */ tcuInterval.NEGATIVE_INFINITY = new tcuInterval.Interval(-Infinity); +/** @const */ tcuInterval.ZERO = new tcuInterval.Interval(0); +/** @const */ tcuInterval.NAN = new tcuInterval.Interval(NaN); +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js new file mode 100644 index 000000000..2dabc9060 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js @@ -0,0 +1,163 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuLogImage'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var tcuLogImage = framework.common.tcuLogImage; +var tcuTexture = framework.common.tcuTexture; +var tcuSurface = framework.common.tcuSurface; +var deMath = framework.delibs.debase.deMath; + +/** @const */ var MAX_IMAGE_SIZE_2D = 4096; +/** + * @param {tcuTexture.ConstPixelBufferAccess} src + */ +tcuLogImage.createImage = function(ctx, src) { + var w = src.getWidth(); + var h = src.getHeight(); + var pixelSize = src.getFormat().getPixelSize(); + var imgData = ctx.createImageData(w, h); + var index = 0; + for (var y = 0; y < h; y++) { + for (var x = 0; x < w; x++) { + var pixel = src.getPixelInt(x, h - y - 1, 0); + for (var i = 0; i < pixelSize; i++) { + imgData.data[index] = pixel[i]; + index = index + 1; + } + if (pixelSize < 4) + imgData.data[index++] = 255; + } + } + return imgData; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} image + * @param {string} info + */ +tcuLogImage.logImageWithInfo = function(image, info) { + var elem = document.getElementById('console'); + var span = document.createElement('span'); + tcuLogImage.logImage.counter = tcuLogImage.logImage.counter || 0; + var i = tcuLogImage.logImage.counter++; + var width = image.getWidth(); + var height = image.getHeight(); + + elem.appendChild(span); + span.innerHTML = info + '

'; + + var imageCanvas = document.getElementById('logImage' + i); + var ctx = imageCanvas.getContext('2d'); + var data = tcuLogImage.createImage(ctx, image); + ctx.putImageData(data, 0, 0); +}; + + +/** + * @param {Array=} scale + * @param {Array=} bias + * @return {string} HTML string to add to log. + */ +tcuLogImage.logScaleAndBias = function(scale, bias) { + if (scale && bias) + return '
Image normalized with formula p * (' + scale + ') + (' + bias + ')'; + else if (scale) + return '
Image normalized with formula p * (' + scale + ')'; + else if (bias) + return '
Image normalized with formula p + (' + bias + ')'; + return ''; +}; + +/** + * @param {string} name + * @param {string} description + * @param {tcuTexture.ConstPixelBufferAccess} image + * @param {Array=} scale + * @param {Array=} bias + */ +tcuLogImage.logImageRGB = function(name, description, image, scale, bias) { + var elem = document.getElementById('console'); + var span = document.createElement('span'); + var info = name + ' ' + description + '
' + image; + if (scale || bias) + info += tcuLogImage.logScaleAndBias(scale, bias); + tcuLogImage.logImageWithInfo(image, info); +}; + +/** + * @param {string} name + * @param {string} description + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {Array=} pixelScale + * @param {Array=} pixelBias + */ +tcuLogImage.logImage = function(name, description, access, pixelScale, pixelBias) { + pixelScale = pixelScale || [1, 1, 1, 1]; + pixelBias = pixelBias || [0, 0, 0, 0]; + var format = access.getFormat(); + var width = access.getWidth(); + var height = access.getHeight(); + var depth = access.getDepth(); + var needScaling = pixelBias[0] != 0 || pixelBias[1] != 0 || pixelBias[2] != 0 || pixelBias[3] != 0 || + pixelScale[0] != 1 || pixelScale[1] != 1 || pixelScale[2] != 1 || pixelScale[3] != 1; + + if (depth == 1 && format.type == tcuTexture.ChannelType.UNORM_INT8 && + width <= MAX_IMAGE_SIZE_2D && height <= MAX_IMAGE_SIZE_2D && + (format.order == tcuTexture.ChannelOrder.RGB || tcuTexture.ChannelOrder.RGBA) && + !needScaling) + // Fast-path. + tcuLogImage.logImageRGB(name, description, access); + else if (depth == 1) { + var sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.LINEAR, tcuTexture.FilterMode.NEAREST); + var logImageSize = [width, height]; /* TODO: Add scaling */ + var logImageAccess = new tcuSurface.Surface(width, height).getAccess(); + + for (var y = 0; y < logImageAccess.getHeight(); y++) { + for (var x = 0; x < logImageAccess.getWidth(); x++) { + var yf = (y + 0.5) / logImageAccess.getHeight(); + var xf = (x + 0.5) / logImageAccess.getWidth(); + var s = access.sample2D(sampler, sampler.minFilter, xf, yf, 0); + + if (needScaling) + s = deMath.add(deMath.multiply(s, pixelScale), pixelBias); + + logImageAccess.setPixel(s, x, y); + } + } + var info = name + ' ' + description + '
' + access; + if (needScaling) { + info += tcuLogImage.logScaleAndBias(pixelScale, pixelBias); + } + + tcuLogImage.logImageWithInfo(logImageAccess, info); + } else { + /* TODO: Implement */ + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js new file mode 100644 index 000000000..e2959ecdc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js @@ -0,0 +1,354 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('framework.common.tcuMatrix'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + + var tcuMatrix = framework.common.tcuMatrix; + var deMath = framework.delibs.debase.deMath; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * @constructor + * @param {number} rows + * @param {number} cols + * @param {*=} value + * Initialize to identity. + */ + tcuMatrix.Matrix = function(rows, cols, value) { + value = value == undefined ? 1 : value; + this.rows = rows; + this.cols = cols; + this.matrix = []; + for (var i = 0; i < cols; i++) + this.matrix[i] = []; + for (var row = 0; row < rows; row++) + for (var col = 0; col < cols; col++) + this.set(row, col, (row == col) ? value : 0); + }; + + /** + * @param {number} rows + * @param {number} cols + * @param {Array} vector + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.matrixFromVector = function(rows, cols, vector) { + var matrix = new tcuMatrix.Matrix(rows, cols); + for (var row = 0; row < vector.length; row++) + for (var col = 0; col < vector.length; col++) + matrix.matrix[col][row] = row == col ? vector[row] : 0; + return matrix; + }; + + /** + * @param {number} rows + * @param {number} cols + * @param {Array} src + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.matrixFromDataArray = function(rows, cols, src) { + var matrix = new tcuMatrix.Matrix(rows, cols); + for (var row = 0; row < rows; row++) { + for (var col = 0; col < cols; col++) { + matrix.matrix[col][row] = src[row * cols + col]; + } + } + return matrix; + }; + + /** + * Fill the Matrix with data from array + * @param {number} rows + * @param {number} cols + * @param {Array} array + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.matrixFromArray = function(rows, cols, array) { + DE_ASSERT(array.length === rows * cols); + var matrix = new tcuMatrix.Matrix(rows, cols); + for (var row = 0; row < rows; row++) + for (var col = 0; col < cols; col++) + matrix.matrix[col][row] = array[row * cols + col]; + return matrix; + }; + + tcuMatrix.Matrix.prototype.set = function(x, y, value) { + this.isRangeValid(x, y); + this.matrix[y][x] = value; + }; + + tcuMatrix.Matrix.prototype.setRow = function(row, values) { + if (!deMath.deInBounds32(row, 0, this.rows)) + throw new Error('Rows out of range'); + if (values.length > this.cols) + throw new Error('Too many columns'); + for (var col = 0; col < values.length; col++) + this.matrix[col][row] = values[col]; + }; + + tcuMatrix.Matrix.prototype.setCol = function(col, values) { + if (!deMath.deInBounds32(col, 0, this.cols)) + throw new Error('Columns out of range'); + if (values.length > this.rows) + throw new Error('Too many rows'); + for (var row = 0; row < values.length; row++) + this.matrix[col][row] = values[row]; + }; + + tcuMatrix.Matrix.prototype.get = function(x, y) { + this.isRangeValid(x, y); + return this.matrix[y][x]; + }; + + tcuMatrix.Matrix.prototype.getColumn = function(y) { + return this.matrix[y]; + }; + + tcuMatrix.Matrix.prototype.isRangeValid = function(x, y) { + if (!deMath.deInBounds32(x, 0, this.rows)) + throw new Error('Rows out of range'); + if (!deMath.deInBounds32(y, 0, this.cols)) + throw new Error('Columns out of range'); + }; + + /** + * @return {Array} + */ + tcuMatrix.Matrix.prototype.getColumnMajorData = function() { + /** @type {Array} */ var a = []; + for (var col = 0; col < this.cols; col++) + for (var row = 0; row < this.rows; row++) + a.push(this.get(row, col)); + return a; + }; + + /** + * @param {tcuMatrix.Matrix} matrixA + * @param {tcuMatrix.Matrix} matrixB + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.add = function(matrixA, matrixB) { + var res = new tcuMatrix.Matrix(matrixA.rows, matrixB.cols); + for (var col = 0; col < matrixA.cols; col++) + for (var row = 0; row < matrixA.rows; row++) + res.set(row, col, matrixA.get(row, col) + matrixB.get(row, col)); + return res; + }; + + /** + * @param {tcuMatrix.Matrix} matrixA + * @param {tcuMatrix.Matrix} matrixB + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.subtract = function(matrixA, matrixB) { + var res = new tcuMatrix.Matrix(matrixA.rows, matrixB.cols); + for (var col = 0; col < matrixA.cols; col++) + for (var row = 0; row < matrixA.rows; row++) + res.set(row, col, matrixA.get(row, col) - matrixB.get(row, col)); + return res; + }; + + /** + * @param {tcuMatrix.Matrix} matrixA + * @param {tcuMatrix.Matrix} matrixB + * @return {tcuMatrix.Matrix} + * Multiplication of two matrices. + */ + tcuMatrix.multiply = function(matrixA, matrixB) { + if (matrixA.cols != matrixB.rows) + throw new Error('Wrong matrices sizes'); + var res = new tcuMatrix.Matrix(matrixA.rows, matrixB.cols); + for (var row = 0; row < matrixA.rows; row++) + for (var col = 0; col < matrixB.cols; col++) { + var v = 0; + for (var ndx = 0; ndx < matrixA.cols; ndx++) + v += matrixA.get(row, ndx) * matrixB.get(ndx, col); + res.set(row, col, v); + } + return res; + }; + + /** + * @param {tcuMatrix.Matrix} matrixA + * @param {tcuMatrix.Matrix} matrixB + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.divide = function(matrixA, matrixB) { + var res = new tcuMatrix.Matrix(matrixA.rows, matrixA.cols); + for (var col = 0; col < matrixA.cols; col++) + for (var row = 0; row < matrixA.rows; row++) + res.set(row, col, matrixA.get(row, col) / matrixB.get(row, col)); + return res; + }; + + /** + * @param {tcuMatrix.Matrix} mtx + * @param {Array} vec + * @return {Array} + */ + tcuMatrix.multiplyMatVec = function(mtx, vec) { + /** @type {Array} */ var res = []; + /** @type {number} */ var value; + for (var row = 0; row < mtx.rows; row++) { + value = 0; + for (var col = 0; col < mtx.cols; col++) + value += mtx.get(row, col) * vec[col]; + res[row] = value; + } + + return res; + }; + + /** + * @param {Array} vec + * @param {tcuMatrix.Matrix} mtx + * @return {Array} + */ + tcuMatrix.multiplyVecMat = function(vec, mtx) { + /** @type {Array} */ var res = []; + /** @type {number} */ var value; + for (var col = 0; col < mtx.cols; col++) { + value = 0; + for (var row = 0; row < mtx.rows; row++) + value += mtx.get(row, col) * vec[row]; + res[col] = value; + } + + return res; + }; + + tcuMatrix.Matrix.prototype.toString = function() { + var str = 'mat' + this.cols; + if (this.rows !== this.cols) + str += 'x' + this.rows; + str += '('; + for (var col = 0; col < this.cols; col++) { + str += '['; + for (var row = 0; row < this.rows; row++) { + str += this.matrix[col][row]; + if (row != this.rows - 1) + str += ', '; + } + str += ']'; + + if (col != this.cols - 1) + str += ', '; + } + str += ')'; + return str; + }; + + /** + * @param {tcuMatrix.Matrix} mtx + * @param {number} scalar + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.subtractMatScal = function(mtx, scalar) { + /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols); + for (var col = 0; col < mtx.cols; col++) + for (var row = 0; row < mtx.rows; row++) + res.set(row, col, mtx.get(row, col) - scalar); + + return res; + }; + + /** + * @param {tcuMatrix.Matrix} mtx + * @param {number} scalar + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.addMatScal = function(mtx, scalar) { + /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols); + for (var col = 0; col < mtx.cols; col++) + for (var row = 0; row < mtx.rows; row++) + res.set(row, col, mtx.get(row, col) + scalar); + + return res; + }; + + /** + * @param {tcuMatrix.Matrix} mtx + * @param {number} scalar + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.multiplyMatScal = function(mtx, scalar) { + /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols); + for (var col = 0; col < mtx.cols; col++) + for (var row = 0; row < mtx.rows; row++) + res.set(row, col, mtx.get(row, col) * scalar); + + return res; + }; + + /** + * @param {tcuMatrix.Matrix} mtx + * @param {number} scalar + * @return {tcuMatrix.Matrix} + */ + tcuMatrix.divideMatScal = function(mtx, scalar) { + /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols); + for (var col = 0; col < mtx.cols; col++) + for (var row = 0; row < mtx.rows; row++) + res.set(row, col, mtx.get(row, col) / scalar); + + return res; + }; + + /** + * @constructor + * @extends {tcuMatrix.Matrix} + */ + tcuMatrix.Mat2 = function() { + tcuMatrix.Matrix.call(this, 2, 2); + }; + + tcuMatrix.Mat2.prototype = Object.create(tcuMatrix.Matrix.prototype); + tcuMatrix.Mat2.prototype.constructor = tcuMatrix.Mat2; + + /** + * @constructor + * @extends {tcuMatrix.Matrix} + */ + tcuMatrix.Mat3 = function() { + tcuMatrix.Matrix.call(this, 3, 3); + }; + + tcuMatrix.Mat3.prototype = Object.create(tcuMatrix.Matrix.prototype); + tcuMatrix.Mat3.prototype.constructor = tcuMatrix.Mat3; + + /** + * @constructor + * @extends {tcuMatrix.Matrix} + */ + tcuMatrix.Mat4 = function() { + tcuMatrix.Matrix.call(this, 4, 4); + }; + + tcuMatrix.Mat4.prototype = Object.create(tcuMatrix.Matrix.prototype); + tcuMatrix.Mat4.prototype.constructor = tcuMatrix.Mat4; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js new file mode 100644 index 000000000..63dcaba87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js @@ -0,0 +1,70 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('framework.common.tcuMatrixUtil'); +goog.require('framework.common.tcuMatrix'); + +goog.scope(function() { + + var tcuMatrixUtil = framework.common.tcuMatrixUtil; + var tcuMatrix = framework.common.tcuMatrix; + + /** + * @param {Array} translation + * @return {tcuMatrix.Matrix} + */ + tcuMatrixUtil.translationMatrix = function(translation) { + var len = translation.length; + var res = new tcuMatrix.Matrix(len + 1, len + 1); + for (var row = 0; row < len; row++) + res.set(row, len, translation[row]); + return res; + }; + + /** + * Flatten an array of arrays or matrices + * @param {(Array> | Array)} a + * @return {Array} + */ + tcuMatrixUtil.flatten = function(a) { + if (a[0] instanceof Array) { + var merged = []; + return merged.concat.apply(merged, a); + } + + if (a[0] instanceof tcuMatrix.Matrix) { + /** @type {tcuMatrix.Matrix} */ var m = a[0]; + var rows = m.rows; + var cols = m.cols; + var size = a.length; + var result = []; + for (var col = 0; col < cols; col++) + for (var i = 0; i < size; i++) + result.push(a[i].getColumn(col)); + return [].concat.apply([], result); + } + + if (typeof(a[0]) === 'number') + return a; + + throw new Error('Invalid input'); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js new file mode 100644 index 000000000..daf3297a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js @@ -0,0 +1,79 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuPixelFormat'); + +goog.scope(function() { + +var tcuPixelFormat = framework.common.tcuPixelFormat; + +/** + * @constructor + * @param {number=} r + * @param {number=} g + * @param {number=} b + * @param {number=} a + */ +tcuPixelFormat.PixelFormat = function(r, g, b, a) { + this.redBits = r || 0; + this.greenBits = g || 0; + this.blueBits = b || 0; + this.alphaBits = a || 0; +}; + +/** + * @param {WebGL2RenderingContext} context + * @return {tcuPixelFormat.PixelFormat} + */ +tcuPixelFormat.PixelFormatFromContext = function(context) { + var r = /** @type {number} */ (context.getParameter(gl.RED_BITS)); + var g = /** @type {number} */ (context.getParameter(gl.GREEN_BITS)); + var b = /** @type {number} */ (context.getParameter(gl.BLUE_BITS)); + var a = /** @type {number} */ (context.getParameter(gl.ALPHA_BITS)); + + return new tcuPixelFormat.PixelFormat(r, g, b, a); +}; + +/** + * @param {number} r + * @param {number} g + * @param {number} b + * @param {number} a + * @return {boolean} + */ +tcuPixelFormat.PixelFormat.prototype.equals = function(r, g, b, a) { + return this.redBits === r && + this.greenBits === g && + this.blueBits === b && + this.alphaBits === a; +}; + +/** + * @return {Array} + */ +tcuPixelFormat.PixelFormat.prototype.getColorThreshold = function() { + return [1 << (8 - this.redBits), + 1 << (8 - this.greenBits), + 1 << (8 - this.blueBits), + (this.alphaBits > 0) ? (1 << (8 - this.alphaBits)) : 0]; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js new file mode 100644 index 000000000..0bab841d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js @@ -0,0 +1,279 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuRGBA'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var tcuRGBA = framework.common.tcuRGBA; +var deMath = framework.delibs.debase.deMath; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * class tcuRGBA.RGBA + * @constructor + * @struct + * @param {goog.NumberArray=} value + */ + tcuRGBA.RGBA = function(value) { + /** @type {goog.NumberArray} */ this.m_value = value || null; + + }; + + /** + * @enum + * In JS, these are not shift values, but positions in a typed array + */ + tcuRGBA.RGBA.Shift = { + RED: 0, + GREEN: 1, + BLUE: 2, + ALPHA: 3 + }; + + /** + * @enum + * Mask used as flags + * Hopefully will not use typed arrays + */ + tcuRGBA.RGBA.Mask = function() { + return { + RED: false, + GREEN: false, + BLUE: false, + ALPHA: false + }; + }; + + /** + * Builds an tcuRGBA.RGBA object from color components + * @param {number} r + * @param {number} g + * @param {number} b + * @param {number} a + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.newRGBAComponents = function(r, g, b, a) { + DE_ASSERT(deMath.deInRange32(r, 0, 255)); + DE_ASSERT(deMath.deInRange32(g, 0, 255)); + DE_ASSERT(deMath.deInRange32(b, 0, 255)); + DE_ASSERT(deMath.deInRange32(a, 0, 255)); + + return new tcuRGBA.RGBA([r, g, b, a]); + }; + + /** + * Builds an tcuRGBA.RGBA object from a number array + * @param {goog.NumberArray} v + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.newRGBAFromArray = function(v) { + return new tcuRGBA.RGBA(v.slice(0, 4)); + }; + + /** + * @param {number} value + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.newRGBAFromValue = function(value) { + var rgba = new tcuRGBA.RGBA(); + var array32 = new Uint32Array([value]); + rgba.m_value = (new Uint8Array(array32.buffer)); + return rgba; + }; + + /** + * @param {Array} v + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.newRGBAFromVec = function (v) { + var r = deMath.clamp(v[0] * 255.0, 0, 255); + var g = deMath.clamp(v[1] * 255.0, 0, 255); + var b = deMath.clamp(v[2] * 255.0, 0, 255); + var a = deMath.clamp(v[3] * 255.0, 0, 255); + + return new tcuRGBA.RGBA([r, g, b, a]); + }; + + /** + * @param {number} v + */ + tcuRGBA.RGBA.prototype.setRed = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.RED] = v; }; + + /** + * @param {number} v + */ + tcuRGBA.RGBA.prototype.setGreen = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.GREEN] = v; }; + + /** + * @param {number} v + */ + tcuRGBA.RGBA.prototype.setBlue = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.BLUE] = v; }; + + /** + * @param {number} v + */ + tcuRGBA.RGBA.prototype.setAlpha = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.ALPHA] = v; }; + + /** + * @return {number} + */ + tcuRGBA.RGBA.prototype.getRed = function() { return this.m_value[tcuRGBA.RGBA.Shift.RED]; }; + + /** + * @return {number} + */ + tcuRGBA.RGBA.prototype.getGreen = function() { return this.m_value[tcuRGBA.RGBA.Shift.GREEN]; }; + + /** + * @return {number} + */ + tcuRGBA.RGBA.prototype.getBlue = function() { return this.m_value[tcuRGBA.RGBA.Shift.BLUE]; }; + + /** + * @return {number} + */ + tcuRGBA.RGBA.prototype.getAlpha = function() { return this.m_value[tcuRGBA.RGBA.Shift.ALPHA]; }; + + /** + * @param {tcuRGBA.RGBA} thr + * @return {boolean} + */ + tcuRGBA.RGBA.prototype.isBelowThreshold = function(thr) { return (this.getRed() <= thr.getRed()) && (this.getGreen() <= thr.getGreen()) && (this.getBlue() <= thr.getBlue()) && (this.getAlpha() <= thr.getAlpha()); }; + + /** + * @param {Uint8Array} bytes + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.RGBA.fromBytes = function(bytes) { return tcuRGBA.newRGBAFromArray(bytes); }; + + /** + * @param {Uint8Array} bytes + */ + tcuRGBA.RGBA.prototype.toBytes = function(bytes) { var result = new Uint8Array(this.m_value); bytes[0] = result[0]; bytes[1] = result[1]; bytes[2] = result[2]; bytes[3] = result[3]; }; + + /** + * @return {Array} + */ + tcuRGBA.RGBA.prototype.toVec = function() { + return [ + this.getRed() / 255.0, + this.getGreen() / 255.0, + this.getBlue() / 255.0, + this.getAlpha() / 255.0 + ]; + }; + + /** + * @return {Array} + */ + tcuRGBA.RGBA.prototype.toIVec = function() { + return [ + this.getRed(), + this.getGreen(), + this.getBlue(), + this.getAlpha() + ]; + }; + + /** + * @param {tcuRGBA.RGBA} v + * @return {boolean} + */ + tcuRGBA.RGBA.prototype.equals = function(v) { + return ( + this.m_value[0] == v.m_value[0] && + this.m_value[1] == v.m_value[1] && + this.m_value[2] == v.m_value[2] && + this.m_value[3] == v.m_value[3] + ); + }; + + /** + * @param {tcuRGBA.RGBA} a + * @param {tcuRGBA.RGBA} b + * @param {tcuRGBA.RGBA} threshold + * @return {boolean} + */ + tcuRGBA.compareThreshold = function(a, b, threshold) { + if (a.equals(b)) return true; // Quick-accept + return tcuRGBA.computeAbsDiff(a, b).isBelowThreshold(threshold); + }; + + /** + * @param {tcuRGBA.RGBA} a + * @param {tcuRGBA.RGBA} b + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.computeAbsDiff = function(a, b) { + return tcuRGBA.newRGBAComponents( + Math.abs(a.getRed() - b.getRed()), + Math.abs(a.getGreen() - b.getGreen()), + Math.abs(a.getBlue() - b.getBlue()), + Math.abs(a.getAlpha() - b.getAlpha()) + ); + }; + + /** + * @param {tcuRGBA.RGBA} a + * @param {number} b + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.multiply = function(a, b) { + return tcuRGBA.newRGBAComponents( + deMath.clamp(a.getRed() * b, 0, 255), + deMath.clamp(a.getGreen() * b, 0, 255), + deMath.clamp(a.getBlue() * b, 0, 255), + deMath.clamp(a.getAlpha() * b, 0, 255)); + }; + + /** + * @param {tcuRGBA.RGBA} a + * @param {tcuRGBA.RGBA} b + * @return {tcuRGBA.RGBA} + */ + tcuRGBA.max = function(a, b) { + return tcuRGBA.newRGBAComponents( + Math.max(a.getRed(), b.getRed()), + Math.max(a.getGreen(), b.getGreen()), + Math.max(a.getBlue(), b.getBlue()), + Math.max(a.getAlpha(), b.getAlpha()) + ); + }; + + tcuRGBA.RGBA.prototype.toString = function() { + return '[' + this.m_value[0] + ',' + this.m_value[1] + ',' + this.m_value[2] + ',' + this.m_value[3] + ']'; + }; + + // Color constants + tcuRGBA.RGBA.red = tcuRGBA.newRGBAComponents(0xFF, 0, 0, 0xFF); + tcuRGBA.RGBA.green = tcuRGBA.newRGBAComponents(0, 0xFF, 0, 0xFF); + tcuRGBA.RGBA.blue = tcuRGBA.newRGBAComponents(0, 0, 0xFF, 0xFF); + tcuRGBA.RGBA.gray = tcuRGBA.newRGBAComponents(0x80, 0x80, 0x80, 0xFF); + tcuRGBA.RGBA.white = tcuRGBA.newRGBAComponents(0xFF, 0xFF, 0xFF, 0xFF); + tcuRGBA.RGBA.black = tcuRGBA.newRGBAComponents(0, 0, 0, 0xFF); + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js new file mode 100644 index 000000000..541f074de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js @@ -0,0 +1,324 @@ +/* +** Copyright (c) 2016 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. +*/ + +/** + * This class defines the individual tests which are skipped because + * of graphics driver bugs which simply can not be worked around in + * WebGL 2.0 implementations. + * + * The intent is that this list be kept as small as possible; and that + * bugs are filed with the respective GPU vendors for entries in this + * list. + * + * Pass the query argument "runSkippedTests" in the URL in order to + * force the skipped tests to be run. So, for example: + * + * http://localhost:8080/sdk/tests/deqp/functional/gles3/transformfeedback.html?filter=transform_feedback.basic_types.separate.points&runSkippedTests + */ +'use strict'; +goog.provide('framework.common.tcuSkipList'); + +goog.scope(function() { + + var tcuSkipList = framework.common.tcuSkipList; + + var _skipEntries = {}; + var _wildcardSkipEntries = {}; + var _reason = ""; + + function _setReason(reason) { + _reason = reason; + } + + function _skip(testName) { + if(testName.indexOf("*") >= 0){ + testName = testName.split("*")[0]; + _wildcardSkipEntries[testName] = _reason; + }else{ + _skipEntries[testName] = _reason; + } + } + + var runSkippedTests = false; + var queryVars = window.location.search.substring(1).split('&'); + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'runSkippedTests') { + // Assume that presence of this query arg implies to run + // the skipped tests; the value is ignored. + runSkippedTests = true; + break; + } + } + + if (!runSkippedTests) { + // Example usage: + // + // _setReason("Bugs in FooVendor 30.03 driver"); + // _skip("transform_feedback.basic_types.separate.points.lowp_mat2"); + + // Please see https://android.googlesource.com/platform/external/deqp/+/7c5323116bb164d64bfecb68e8da1af634317b24 + _setReason("Native dEQP also fails on these tests and suppresses them"); + _skip("texture_functions.textureoffset.sampler3d_fixed_fragment"); + _skip("texture_functions.textureoffset.isampler3d_fragment"); + _skip("texture_functions.textureoffset.usampler3d_fragment"); + _skip("texture_functions.textureprojoffset.sampler3d_fixed_fragment"); + _skip("texture_functions.textureprojoffset.isampler3d_fragment"); + _skip("texture_functions.textureprojoffset.usampler3d_fragment"); + // Please see https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/src/gles3-hw-issues.txt + _skip("texture_functions.textureprojlod.isampler3d_vertex"); + _skip("texture_functions.textureprojlod.usampler3d_vertex"); + // Please see https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/src/gles3-test-issues.txt + _skip("texture_functions.textureprojlodoffset.usampler3d_vertex"); + _skip("texture_functions.textureoffset.sampler3d_float_fragment"); + _skip("texture_functions.textureprojoffset.sampler3d_float_fragment"); + // Please see https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/src/gles3-driver-issues.txt + _skip("texture_functions.textureprojlodoffset.isampler3d_vertex"); + _skip("texture_functions.texturegrad.samplercubeshadow*"); + + // https://android.googlesource.com/platform/external/deqp/+/0c1f83aee4709eef7ef2a3edd384f9c192f476fd/android/cts/master/src/gles3-hw-issues.txt#801 + _setReason("Tricky blit rects can result in imperfect copies on some HW."); + _skip("blit.rect.nearest_consistency_mag"); + _skip("blit.rect.nearest_consistency_mag_reverse_dst_x"); + _skip("blit.rect.nearest_consistency_mag_reverse_src_dst_x"); + _skip("blit.rect.nearest_consistency_mag_reverse_src_x"); + _skip("blit.rect.nearest_consistency_mag_reverse_src_y"); + _skip("blit.rect.nearest_consistency_min"); + _skip("blit.rect.nearest_consistency_min_reverse_dst_x"); + _skip("blit.rect.nearest_consistency_min_reverse_src_dst_x"); + _skip("blit.rect.nearest_consistency_min_reverse_src_x"); + _skip("blit.rect.nearest_consistency_out_of_bounds_mag"); + _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_dst_x"); + _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_dst_x"); + _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_x"); + _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_y"); + _skip("blit.rect.nearest_consistency_out_of_bounds_min"); + _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_dst_x"); + _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_dst_x"); + _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_x"); + _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_y"); + + _setReason("Tricky blit rects can result in imperfect copies on Mac Intel driver."); + // crbug.com/658724 + // deqp/functional/gles3/framebufferblit/rect_03.html + _skip("blit.rect.nearest_consistency_mag_reverse_src_dst_y"); + // deqp/functional/gles3/framebufferblit/rect_04.html + _skip("blit.rect.nearest_consistency_min_reverse_src_dst_y"); + + // https://android.googlesource.com/platform/external/deqp/+/0c1f83aee4709eef7ef2a3edd384f9c192f476fd/android/cts/master/src/gles3-driver-issues.txt#381 + _setReason("Tricky blit rects can result in imperfect copies on some drivers."); + _skip("blit.rect.out_of_bounds_linear"); + _skip("blit.rect.out_of_bounds_reverse_src_x_linear"); + _skip("blit.rect.out_of_bounds_reverse_src_y_linear"); + _skip("blit.rect.out_of_bounds_reverse_dst_x_linear"); + _skip("blit.rect.out_of_bounds_reverse_dst_y_linear"); + _skip("blit.rect.out_of_bounds_reverse_src_dst_x_linear"); + _skip("blit.rect.out_of_bounds_reverse_src_dst_y_linear"); + + // https://android.googlesource.com/platform/external/deqp/+/0c1f83aee4709eef7ef2a3edd384f9c192f476fd/android/cts/master/src/gles3-driver-issues.txt#368 + _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_dst_y"); + _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_dst_y"); + _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_dst_y"); + _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_dst_y"); + + _setReason("Mac OSX drivers handle R11F_G11F_B10F format incorrectly"); + // https://github.com/KhronosGroup/WebGL/issues/1832 + // deqp/functional/gles3/fragmentoutput/basic.float.html + _skip("fragment_outputs.basic.float.r11f_g11f_b10f_mediump*"); + _skip("fragment_outputs.basic.float.r11f_g11f_b10f_highp*"); + // deqp/functional/gles3/fragmentoutput/array.float.html + _skip("fragment_outputs.array.float.r11f_g11f_b10f_mediump*"); + _skip("fragment_outputs.array.float.r11f_g11f_b10f_highp*"); + // deqp/functional/gles3/fragmentoutput/random_00.html + _skip("fragment_outputs.random.57"); + // deqp/functional/gles3/fragmentoutput/random_02.html + _skip("fragment_outputs.random.11"); + // deqp/functional/gles3/fborender/resize_01.html + _skip("render.resize.rbo_r11f_g11f_b10f"); + // deqp/functional/gles3/fborender/recreate_color_02.html + _skip("render.recreate_color.rbo_r11f_g11f_b10f_depth_stencil_rbo_depth24_stencil8"); + // deqp/functional/gles3/fbocolorbuffer/clear.html + _skip("color.clear.r11f_g11f_b10f"); + // deqp/functional/gles3/fbomultisample.2_samples.html + _skip("msaa.2_samples.r11f_g11f_b10f"); + // deqp/functional/gles3/fbomultisample.4_samples.html + _skip("msaa.4_samples.r11f_g11f_b10f"); + // deqp/functional/gles3/fbomultisample.8_samples.html + _skip("msaa.8_samples.r11f_g11f_b10f"); + + _setReason("Missing shadow sampler functions in D3D11"); + // https://github.com/KhronosGroup/WebGL/issues/1870 + // deqp/functional/gles3/shadertexturefunction/texture.html + _skip("texture_functions.texture.sampler2darrayshadow_vertex"); + // deqp/functional/gles3/shadertexturefunction/texturelod.html + _skip("texture_functions.texturelod.sampler2dshadow_vertex"); + _skip("texture_functions.texturelod.sampler2dshadow_fragment"); + // deqp/functional/gles3/shadertexturefunction/texturelodoffset.html + _skip("texture_functions.texturelodoffset.sampler2dshadow_vertex"); + _skip("texture_functions.texturelodoffset.sampler2dshadow_fragment"); + // deqp/functional/gles3/shadertexturefunction/textureprojlod.html + _skip("texture_functions.textureprojlod.sampler2dshadow_vertex"); + _skip("texture_functions.textureprojlod.sampler2dshadow_fragment"); + // deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html + _skip("texture_functions.textureprojlodoffset.sampler2dshadow_vertex"); + _skip("texture_functions.textureprojlodoffset.sampler2dshadow_fragment"); + // deqp/functional/gles3/shadertexturefunction/texturegrad.html + _skip("texture_functions.texturegrad.sampler2dshadow_vertex"); + _skip("texture_functions.texturegrad.sampler2dshadow_fragment"); + _skip("texture_functions.texturegrad.sampler2darrayshadow_vertex"); + _skip("texture_functions.texturegrad.sampler2darrayshadow_fragment"); + // deqp/functional/gles3/shadertexturefunction/texturegradoffset.html + _skip("texture_functions.texturegradoffset.sampler2dshadow_vertex"); + _skip("texture_functions.texturegradoffset.sampler2dshadow_fragment"); + _skip("texture_functions.texturegradoffset.sampler2darrayshadow_vertex"); + _skip("texture_functions.texturegradoffset.sampler2darrayshadow_fragment"); + // deqp/functional/gles3/shadertexturefunction/textureprojgrad.html + _skip("texture_functions.textureprojgrad.sampler2dshadow_vertex"); + _skip("texture_functions.textureprojgrad.sampler2dshadow_fragment"); + // deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html + _skip("texture_functions.textureprojgradoffset.sampler2dshadow_vertex"); + _skip("texture_functions.textureprojgradoffset.sampler2dshadow_fragment"); + + _setReason("MacOSX drivers share namespaces where they should not"); + // https://github.com/KhronosGroup/WebGL/issues/1890 + // deqp/data/gles3/shaders/scoping.html + _skip("scoping.valid.local_int_variable_hides_struct_type_vertex"); + _skip("scoping.valid.local_int_variable_hides_struct_type_fragment"); + _skip("scoping.valid.local_struct_variable_hides_struct_type_vertex"); + _skip("scoping.valid.local_struct_variable_hides_struct_type_fragment"); + _skip("scoping.valid.function_parameter_hides_struct_type_vertex"); + _skip("scoping.valid.function_parameter_hides_struct_type_fragment"); + + _setReason("NVidia Linux drivers does not clamp gl_FragDepth to [0.0, 1.0]"); + // Standalone Test case: + // https://github.com/Kangz/GLDriverBugs/blob/master/frag_depth_clamp_32f_depth/Main.cpp + // deqp/functional/gles3/fbodepthbuffer.html + _skip("depth.depth_write_clamp.depth_component32f"); + _skip("depth.depth_write_clamp.depth32f_stencil8"); + _skip("depth.depth_test_clamp.depth_component32f"); + _skip("depth.depth_test_clamp.depth32f_stencil8"); + + _setReason("NVidia Linux driver bug in nested uniform block location assignment"); + // crbug.com/621178 + // deqp/functional/gles3/uniformapi/random.html + _skip("uniform_api.random.64"); + + _setReason("Mac AMD / Linux AMD / older mesa handles clipping of wide points incorrectly"); + // crbug.com/642822 + // deqp/functional/gles3/clipping.html + _skip("clipping.wide_points_full_viewport"); + _skip("clipping.wide_points_partial_viewport"); + + + _setReason("Mac AMD drivers handle instanced rendering incorrectly under certain situation"); + // crbug.com/645298 + // deqp/functional/gles3/instancedrendering.html + _skip("instanced_rendering.draw_arrays_instanced.attribute_divisor.4_instances"); + _skip("instanced_rendering.draw_arrays_instanced.attribute_divisor.20_instances"); + _skip("instanced_rendering.draw_arrays_instanced.mixed.4_instances"); + _skip("instanced_rendering.draw_arrays_instanced.mixed.20_instances"); + _skip("instanced_rendering.draw_elements_instanced.attribute_divisor.4_instances"); + _skip("instanced_rendering.draw_elements_instanced.attribute_divisor.20_instances"); + _skip("instanced_rendering.draw_elements_instanced.mixed.4_instances"); + _skip("instanced_rendering.draw_elements_instanced.mixed.20_instances"); + + _setReason("Mac AMD drivers readPixels from RGB buffer into PIXEL_PACK_BUFFER got alpha values wrong"); + // crbug.com/646182 + // deqp/functional/gles3/pixelbufferobject.html + _skip("pixel_buffer_object.renderbuffer.rgb8_triangles"); + _skip("pixel_buffer_object.renderbuffer.rgb8_clears"); + + _setReason("Some Windows AMD D3D11 drivers have issues with blit and depth/stencil formats."); + // crbug.com/638323 + // deqp/functional/gles3/framebufferblit/depth_stencil.html + // Also see conformance2/rendering/blitframebuffer-stencil-only.html for 2.0.1 test. + _skip("blit.depth_stencil.depth24_stencil8_scale"); + _skip("blit.depth_stencil.depth24_stencil8_stencil_only"); + + _setReason("Transform feedback does not pass any tests on Mac AMD."); + // crbug.com/526748 + // Apple Radar: 28126946 + _skip("transform_feedback.*"); + + _setReason("Texture minification filtering is buggy for LINEAR mode on Mac Intel."); + // crbug.com/656478 + // Apple Radar: 28902129 + _skip("filtering.2d_combinations.linear_nearest_*"); + _skip("filtering.cube_combinations.linear_nearest_*"); + _skip("filtering.2d_array_combinations.linear_nearest_clamp_repeat"); + _skip("filtering.2d_array_combinations.linear_nearest_clamp_mirror"); + _skip("filtering.2d_array_combinations.linear_nearest_repeat_*"); + _skip("filtering.2d_array_combinations.linear_nearest_mirror_*"); + _skip("filtering.3d_combinations.linear_nearest_clamp_clamp_repeat"); + _skip("filtering.3d_combinations.linear_nearest_clamp_clamp_mirror"); + _skip("filtering.3d_combinations.linear_nearest_clamp_repeat_*"); + _skip("filtering.3d_combinations.linear_nearest_clamp_mirror_*"); + _skip("filtering.3d_combinations.linear_nearest_repeat_*"); + _skip("filtering.3d_combinations.linear_nearest_mirror_*"); + + _setReason("Setting of GL_READ_BUFFER and GL_DRAW_BUFFERs affects framebuffer completeness on Mac Intel."); + // crbug.com/630800 + // Apple Radar: 28236629 + _skip("completeness.attachment_combinations.none_rbo_none_none"); + _skip("completeness.attachment_combinations.none_tex_none_none"); + + _setReason("multisample constancy_alpha_to_coverage tests fail on Mac Intel."); + // crbug.com/663184 + _skip("multisample.fbo_4_samples.constancy_alpha_to_coverage"); + _skip("multisample.fbo_8_samples.constancy_alpha_to_coverage"); + _skip("multisample.fbo_max_samples.constancy_alpha_to_coverage"); + } // if (!runSkippedTests) + + /* + * Gets the skip status of the given test. Returns an + * object with the properties "skip", a boolean, and "reason", a + * string. + */ + tcuSkipList.getSkipStatus = function(testName) { + var skipEntry = _skipEntries[testName]; + if (skipEntry === undefined) { + return this._getWildcardSkipStatus(testName); + } else { + return { 'skip': true, 'reason': skipEntry }; + } + } + + /* + * Gets the skip status of the given tests like testpath* + * object with the properties "skip", a boolean, and "reason", a + * string. + */ + tcuSkipList._getWildcardSkipStatus = function(testName) { + var skipEntry; + for (var key in _wildcardSkipEntries) { + if (testName.indexOf(key) >=0 ) { + skipEntry = _wildcardSkipEntries[key]; + if (skipEntry != undefined) { + return { 'skip': true, 'reason': skipEntry }; + } + } + } + return { 'skip': false, 'reason': '' }; + } + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js new file mode 100644 index 000000000..d70056733 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js @@ -0,0 +1,42 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuStringTemplate'); + +goog.scope(function() { + +var tcuStringTemplate = framework.common.tcuStringTemplate; + +tcuStringTemplate.escapeRegExp = function(string) { + return string.replace(/([.*+?^=!:$ {}()|\[\]\/\\])/g, '\\$1'); +}; + +tcuStringTemplate.specialize = function(str, params) { + var dst = str; + for (var key in params) { + var value = params[key]; + var re = new RegExp(tcuStringTemplate.escapeRegExp('\$\{' + key + '\}'), 'g'); + dst = dst.replace(re, value); + } + return dst; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js new file mode 100644 index 000000000..47d3634aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js @@ -0,0 +1,184 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuSurface'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + +var tcuSurface = framework.common.tcuSurface; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var gluTextureUtil = framework.opengl.gluTextureUtil; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +/** + * \brief RGBA8888 surface + * + * tcuSurface.Surface provides basic pixel storage functionality. Only single format + * (RGBA8888) is supported. + * + * PixelBufferAccess (see tcuTexture.h) provides much more flexible API + * for handling various pixel formats. This is mainly a convinience class. + * @constructor + * @param {number=} width + * @param {number=} height + */ +tcuSurface.Surface = function(width, height) { + width = width || 0; + height = height || 0; + this.setSize(width, height); +}; + +/** + * @param {number} width + * @param {number} height + */ +tcuSurface.Surface.prototype.setSize = function(width, height) { + this.m_width = width; + this.m_height = height; + if (width * height > 0) { + this.m_data = new ArrayBuffer(4 * width * height); + this.m_pixels = new Uint8Array(this.m_data); + } else { + this.m_data = null; + this.m_pixels = null; + } +}; + +/** + * @return {number} + */ +tcuSurface.Surface.prototype.getWidth = function() { return this.m_width; }; + +/** + * @return {number} + */ +tcuSurface.Surface.prototype.getHeight = function() { return this.m_height; }; + +/** + * @param {number} x + * @param {number} y + * @param {Array} color Vec4 color + */ +tcuSurface.Surface.prototype.setPixel = function(x, y, color) { + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + + var offset = 4 * (x + y * this.m_width); + for (var i = 0; i < 4; i++) + this.m_pixels[offset + i] = color[i]; +}; + +/** + * @param {number} x + * @param {number} y + * @return {Array} + */ +tcuSurface.Surface.prototype.getPixel = function(x, y) { + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + + var color = []; + color.length = 4; + + var offset = 4 * (x + y * this.m_width); + for (var i = 0; i < 4; i++) + color[i] = this.m_pixels[offset + i]; + + return color; +}; + +/** + * @param {number} x + * @param {number} y + * @return {number} + */ +tcuSurface.Surface.prototype.getPixelUintRGB8 = function(x, y) { + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + + var offset = 4 * (x + y * this.m_width); + return (this.m_pixels[offset] << 16) + + (this.m_pixels[offset + 1] << 8) + + this.m_pixels[offset + 2]; +}; + +/** + * Read the viewport contents into this surface + * @param {*=} ctx WebGL or ref context + * @param {(Array|{x: number, y: number, width: number, height: number})=} view + */ +tcuSurface.Surface.prototype.readViewport = function(ctx, view) { + ctx = ctx || gl; + var v = view || /** @type {Array} */ (ctx.getParameter(gl.VIEWPORT)); + /** @type {number} */ var x; + /** @type {number} */ var y; + /** @type {number} */ var width; + /** @type {number} */ var height; + if (v instanceof Array || ArrayBuffer.isView(v)) { + x = v[0]; + y = v[1]; + width = v[2]; + height = v[3]; + } else { + x = v.x; + y = v.y; + width = v.width; + height = v.height; + } + if (width != this.m_width || height != this.m_height) + this.setSize(width, height); + ctx.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, this.m_pixels); +}; + +/** + * @return {Uint8Array} + */ +tcuSurface.Surface.prototype.getPixels = function() { return this.m_pixels || null; }; + +/** + * @return {tcuTexture.PixelBufferAccess} Pixel Buffer Access object + */ +tcuSurface.Surface.prototype.getAccess = function() { + return new tcuTexture.PixelBufferAccess({ + format: new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), + width: this.m_width, + height: this.m_height, + data: this.m_data + }); + +}; + +tcuSurface.Surface.prototype.getSubAccess = function(x, y, width, height) { + /* TODO: Implement. the deqp getSubAccess() looks broken. It will probably fail if + * x != 0 or width != m_width + */ + throw new Error('Unimplemented'); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js new file mode 100644 index 000000000..d4322de4d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js @@ -0,0 +1,484 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * This class allows one to create a hierarchy of tests and iterate over them. + * It replaces TestCase and TestCaseGroup classes. + */ +'use strict'; +goog.provide('framework.common.tcuTestCase'); +goog.require('framework.common.tcuSkipList'); + +goog.scope(function() { + + var tcuTestCase = framework.common.tcuTestCase; + var tcuSkipList = framework.common.tcuSkipList; + + /** + * Reads the filter parameter from the URL to filter tests. + * @return {?string } + */ + tcuTestCase.getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } + return null; + }; + + /** + * Indicates the state of an iteration operation. + * @enum {number} + */ + tcuTestCase.IterateResult = { + STOP: 0, + CONTINUE: 1 + }; + + /**************************************** + * Runner + ***************************************/ + + /** + * A simple state machine. + * The purpose of this this object is to break + * long tests into small chunks that won't cause a timeout + * @constructor + */ + tcuTestCase.Runner = function() { + /** @type {tcuTestCase.DeqpTest} */ this.currentTest = null; + /** @type {tcuTestCase.DeqpTest} */ this.nextTest = null; + /** @type {tcuTestCase.DeqpTest} */ this.testCases = null; + /** @type {?string } */ this.filter = tcuTestCase.getFilter(); + }; + + /** + * @param {tcuTestCase.DeqpTest} root The root test of the test tree. + */ + tcuTestCase.Runner.prototype.setRoot = function(root) { + this.currentTest = null; + this.testCases = root; + }; + + tcuTestCase.Runner.prototype.setRange = function(range) { + this.range = range; + }; + + /** + * Searches the test tree for the next executable test + * @return {?tcuTestCase.DeqpTest } + */ + tcuTestCase.Runner.prototype.next = function() { + + // First time? Use root test + if (!this.currentTest) { + this.currentTest = this.testCases; + + // Root is executable? Use it + if (this.currentTest.isExecutable()) + return this.currentTest; + } + + // Should we proceed with the next test? + if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP) { + // Look for next executable test + do { + if (this.range) + this.currentTest = this.currentTest.nextInRange(this.filter, this.range); + else + this.currentTest = this.currentTest.next(this.filter); + } while (this.currentTest && !this.currentTest.isExecutable()); + } + + return this.currentTest; + }; + + /** + * Schedule the callback to be run ASAP + * @param {function()} callback Callback to schedule + */ + tcuTestCase.Runner.prototype.runCallback = function(callback) { + setTimeout(function() { + callback(); + }.bind(this), 0); + }; + + /** + * Call this function at the end of the test + */ + tcuTestCase.Runner.prototype.terminate = function() { + finishTest(); + }; + + tcuTestCase.runner = new tcuTestCase.Runner(); + + /** @type {tcuTestCase.IterateResult} */ tcuTestCase.lastResult = tcuTestCase.IterateResult.STOP; + + /*************************************** + * DeqpTest + ***************************************/ + + /** + * Assigns name, description and specification to test + * @constructor + * @param {?string} name + * @param {?string} description + * @param {Object=} spec + */ + tcuTestCase.DeqpTest = function(name, description, spec) { + this.name = name || ''; + this.description = description || ''; + this.spec = spec; + this.currentTestNdx = 0; + this.parentTest = null; + this.childrenTests = []; + this.executeAlways = false; + }; + + /** + * Abstract init function(each particular test will implement it, or not) + */ + tcuTestCase.DeqpTest.prototype.init = function() {}; + + /** + * Abstract deinit function(each particular test will implement it, or not) + */ + tcuTestCase.DeqpTest.prototype.deinit = function() {}; + + /** + * Abstract iterate function(each particular test will implement it, or not) + * @return {tcuTestCase.IterateResult} + */ + tcuTestCase.DeqpTest.prototype.iterate = function() { return tcuTestCase.IterateResult.STOP; }; + + /** + * Checks if the test is executable + * @return {boolean} + */ + tcuTestCase.DeqpTest.prototype.isExecutable = function() { + return this.childrenTests.length == 0 || this.executeAlways; + }; + + /** + * Checks if the test is a leaf + */ + tcuTestCase.DeqpTest.prototype.isLeaf = function() { + return this.childrenTests.length == 0; + }; + + /** + * Marks the test as always executable + */ + tcuTestCase.DeqpTest.prototype.makeExecutable = function() { + this.executeAlways = true; + }; + + /** + * Adds a child test to the test's children + * @param {tcuTestCase.DeqpTest} test + */ + tcuTestCase.DeqpTest.prototype.addChild = function(test) { + test.parentTest = this; + this.childrenTests.push(test); + }; + + /** + * Sets the whole children tests array + * @param {Array} tests + */ + tcuTestCase.DeqpTest.prototype.setChildren = function(tests) { + for (var test in tests) + tests[test].parentTest = this; + this.childrenTests = tests; + }; + + /** + * Returns the next test in the hierarchy of tests + * + * @param {?string } pattern Optional pattern to search for + * @return {tcuTestCase.DeqpTest} + */ + tcuTestCase.DeqpTest.prototype.next = function(pattern) { + return this._nextHonoringSkipList(pattern); + }; + + /** + * Returns the next test in the hierarchy of tests, honoring the + * skip list, and reporting skipped tests. + * + * @param {?string } pattern Optional pattern to search for + * @return {tcuTestCase.DeqpTest} + */ + tcuTestCase.DeqpTest.prototype._nextHonoringSkipList = function(pattern) { + var tryAgain = false; + var test = null; + do { + tryAgain = false; + test = this._nextIgnoringSkipList(pattern); + if (test != null) { + // See whether the skip list vetoes the execution of + // this test. + var fullTestName = test.fullName(); + var skipDisposition = tcuSkipList.getSkipStatus(fullTestName); + if (skipDisposition.skip) { + tryAgain = true; + setCurrentTestName(fullTestName); + checkMessage(false, 'Skipping test due to tcuSkipList: ' + fullTestName); + } + } + } while (tryAgain); + return test; + }; + + + /** + * Returns the next test in the hierarchy of tests, ignoring the + * skip list. + * + * @param {?string } pattern Optional pattern to search for + * @return {tcuTestCase.DeqpTest} + */ + tcuTestCase.DeqpTest.prototype._nextIgnoringSkipList = function(pattern) { + if (pattern) + return this._findIgnoringSkipList(pattern); + + var test = null; + + //Look for the next child + if (this.currentTestNdx < this.childrenTests.length) { + test = this.childrenTests[this.currentTestNdx]; + this.currentTestNdx++; + } + + // If no more children, get the next brother + if (test == null && this.parentTest != null) { + test = this.parentTest._nextIgnoringSkipList(null); + } + + return test; + }; + + /** + * Returns the next test in the hierarchy of tests + * whose 1st level is in the given range + * + * @param {?string } pattern Optional pattern to search for + * @param {Array} range + * @return {tcuTestCase.DeqpTest} + */ + tcuTestCase.DeqpTest.prototype.nextInRange = function(pattern, range) { + while (true) { + var test = this._nextHonoringSkipList(pattern); + if (!test) + return null; + var topLevelId = tcuTestCase.runner.testCases.currentTestNdx - 1; + if (topLevelId >= range[0] && topLevelId < range[1]) + return test; + } + }; + + /** + * Returns the full name of the test + * + * @return {string} Full test name. + */ + tcuTestCase.DeqpTest.prototype.fullName = function() { + if (this.parentTest) { + var parentName = this.parentTest.fullName(); + if (parentName) + return parentName + '.' + this.name; + } + return this.name; + }; + + /** + * Returns the description of the test + * + * @return {string} Test description. + */ + tcuTestCase.DeqpTest.prototype.getDescription = function() { + return this.description; + }; + + /** + * Find a test with a matching name. Fast-forwards to a test whose + * full name matches the given pattern. + * + * @param {string} pattern Regular expression to search for + * @return {?tcuTestCase.DeqpTest } Found test or null. + */ + tcuTestCase.DeqpTest.prototype.find = function(pattern) { + return this._findHonoringSkipList(pattern); + }; + + /** + * Find a test with a matching name. Fast-forwards to a test whose + * full name matches the given pattern, honoring the skip list, and + * reporting skipped tests. + * + * @param {string} pattern Regular expression to search for + * @return {?tcuTestCase.DeqpTest } Found test or null. + */ + tcuTestCase.DeqpTest.prototype._findHonoringSkipList = function(pattern) { + var tryAgain = false; + var test = null; + do { + tryAgain = false; + test = this._findIgnoringSkipList(pattern); + if (test != null) { + // See whether the skip list vetoes the execution of + // this test. + var fullTestName = test.fullName(); + var skipDisposition = tcuSkipList.getSkipStatus(fullTestName); + if (skipDisposition.skip) { + tryAgain = true; + checkMessage(false, 'Skipping test due to tcuSkipList: ' + fullTestName); + } + } + } while (tryAgain); + return test; + }; + + /** + * Find a test with a matching name. Fast-forwards to a test whose + * full name matches the given pattern. + * + * @param {string} pattern Regular expression to search for + * @return {?tcuTestCase.DeqpTest } Found test or null. + */ + tcuTestCase.DeqpTest.prototype._findIgnoringSkipList = function(pattern) { + var test = this; + while (true) { + test = test._nextIgnoringSkipList(null); + if (!test) + break; + if (test.fullName().match(pattern) || test.executeAlways) + break; + } + return test; + }; + + /** + * Reset the iterator. + */ + tcuTestCase.DeqpTest.prototype.reset = function() { + this.currentTestNdx = 0; + + for (var i = 0; i < this.childrenTests.length; i++) + this.childrenTests[i].reset(); + }; + + /** + * Defines a new test + * + * @param {?string} name Short test name + * @param {?string} description Description of the test + * @param {Object=} spec Test specification + * + * @return {tcuTestCase.DeqpTest} The new test + */ + tcuTestCase.newTest = function(name, description, spec) { + var test = new tcuTestCase.DeqpTest(name, description, spec); + + return test; + }; + + /** + * Defines a new executable test so it gets run even if it's not a leaf + * + * @param {string} name Short test name + * @param {string} description Description of the test + * @param {Object=} spec Test specification + * + * @return {tcuTestCase.DeqpTest} The new test + */ + tcuTestCase.newExecutableTest = function(name, description, spec) { + var test = tcuTestCase.newTest(name, description, spec); + test.makeExecutable(); + + return test; + }; + + /** + * Run through the test cases giving time to system operation. + */ + tcuTestCase.runTestCases = function() { + var state = tcuTestCase.runner; + + if (state.next()) { + try { + // If proceeding with the next test, prepare it. + var fullTestName = state.currentTest.fullName(); + var inited = true; + if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP) { + // Update current test name + setCurrentTestName(fullTestName); + bufferedLogToConsole('Init testcase: ' + fullTestName); //Show also in console so we can see which test crashed the browser's tab + + // Initialize particular test + inited = state.currentTest.init(); + inited = inited === undefined ? true : inited; + + //If it's a leaf test, notify of it's execution. + if (state.currentTest.isLeaf() && inited) + debug('

Start testcase: ' + fullTestName); + } + + if (inited) { + // Run the test, save the result. + tcuTestCase.lastResult = state.currentTest.iterate(); + } else { + // Skip uninitialized test. + tcuTestCase.lastResult = tcuTestCase.IterateResult.STOP; + } + + // Cleanup + if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP) + state.currentTest.deinit(); + } + catch (err) { + // If the exception was not thrown by a test check, log it, but don't throw it again + if (!(err instanceof TestFailedException)) { + //Stop execution of current test. + tcuTestCase.lastResult = tcuTestCase.IterateResult.STOP; + try { + // Cleanup + if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP) + state.currentTest.deinit(); + } catch (cerr) { + bufferedLogToConsole('Error while cleaning up test: ' + cerr); + } + var msg = err; + if (err.message) + msg = err.message; + testFailedOptions(msg, false); + } + bufferedLogToConsole(err); + } + + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } else + tcuTestCase.runner.terminate(); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js new file mode 100644 index 000000000..254963ae6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js @@ -0,0 +1,1356 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuTexCompareVerifier'); +goog.require('framework.common.tcuTexVerifierUtil'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var tcuTexCompareVerifier = framework.common.tcuTexCompareVerifier; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuTexVerifierUtil = framework.common.tcuTexVerifierUtil; + +/** + * \brief Texture compare (shadow) lookup precision parameters. + * @constructor + * @struct + * @param {Array=} coordBits + * @param {Array=} uvwBits + * @param {number=} pcfBits + * @param {number=} referenceBits + * @param {number=} resultBits + */ +tcuTexCompareVerifier.TexComparePrecision = function(coordBits, uvwBits, pcfBits, referenceBits, resultBits) { + this.coordBits = coordBits === undefined ? [22, 22, 22] : coordBits; + this.uvwBits = uvwBits === undefined ? [22, 22, 22] : uvwBits; + this.pcfBits = pcfBits === undefined ? 16 : pcfBits; + this.referenceBits = referenceBits === undefined ? 16 : referenceBits; + this.resultBits = resultBits === undefined ? 16 : resultBits; +}; + +/** + * @constructor + * @struct + */ +tcuTexCompareVerifier.CmpResultSet = function() { + this.isTrue = false; + this.isFalse = false; +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {number} cmpValue_ + * @param {number} cmpReference_ + * @param {number} referenceBits + * @param {boolean} isFixedPoint + * @return {tcuTexCompareVerifier.CmpResultSet} + */ +tcuTexCompareVerifier.execCompare = function(compareMode, + cmpValue_, + cmpReference_, + referenceBits, + isFixedPoint) { + var clampValues = isFixedPoint; // if comparing against a floating point texture, ref (and value) is not clamped + var cmpValue = (clampValues) ? (deMath.clamp(cmpValue_, 0, 1)) : (cmpValue_); + var cmpReference = (clampValues) ? (deMath.clamp(cmpReference_, 0, 1)) : (cmpReference_); + var err = tcuTexVerifierUtil.computeFixedPointError(referenceBits); + var res = new tcuTexCompareVerifier.CmpResultSet(); + + switch (compareMode) { + case tcuTexture.CompareMode.COMPAREMODE_LESS: + res.isTrue = cmpReference - err < cmpValue; + res.isFalse = cmpReference + err >= cmpValue; + break; + + case tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL: + res.isTrue = cmpReference - err <= cmpValue; + res.isFalse = cmpReference + err > cmpValue; + break; + + case tcuTexture.CompareMode.COMPAREMODE_GREATER: + res.isTrue = cmpReference + err > cmpValue; + res.isFalse = cmpReference - err <= cmpValue; + break; + + case tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL: + res.isTrue = cmpReference + err >= cmpValue; + res.isFalse = cmpReference - err < cmpValue; + break; + + case tcuTexture.CompareMode.COMPAREMODE_EQUAL: + res.isTrue = deMath.deInRange32(cmpValue, cmpReference - err, cmpReference + err); + res.isFalse = err != 0 || cmpValue != cmpReference; + break; + + case tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL: + res.isTrue = err != 0 || cmpValue != cmpReference; + res.isFalse = deMath.deInRange32(cmpValue, cmpReference - err, cmpReference + err); + break; + + case tcuTexture.CompareMode.COMPAREMODE_ALWAYS: + res.isTrue = true; + break; + + case tcuTexture.CompareMode.COMPAREMODE_NEVER: + res.isFalse = true; + break; + + default: + throw new Error('Invalid compare mode:' + compareMode); + } + + assertMsgOptions(res.isTrue || res.isFalse, 'Both tests failed!', false, true); + return res; +}; + +/** + * @param {tcuTexture.TextureFormat} format + * @return {boolean} + */ +tcuTexCompareVerifier.isFixedPointDepthTextureFormat = function(format) { + var channelClass = tcuTexture.getTextureChannelClass(format.type); + + if (format.order == tcuTexture.ChannelOrder.D) { + // depth internal formats cannot be non-normalized integers + return channelClass != tcuTexture.TextureChannelClass.FLOATING_POINT; + } else if (format.order == tcuTexture.ChannelOrder.DS) { + // combined formats have no single channel class, detect format manually + switch (format.type) { + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return false; + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return true; + + default: + throw new Error('Invalid texture format: ' + format); + } + } + + return false; +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} depths + * @param {Array} fBounds + * @param {number} cmpReference + * @param {number} result + * @param {boolean} isFixedPointDepth + * @return {boolean} + */ +tcuTexCompareVerifier.isLinearCompareValid = function(compareMode, prec, depths, fBounds, cmpReference, result, isFixedPointDepth) { + assertMsgOptions(fBounds[0] >= 0 && fBounds[0] <= fBounds[1] && fBounds[1] <= 1, 'Invalid fBounds', false, true); + + var d0 = depths[0]; + var d1 = depths[1]; + + var cmp0 = tcuTexCompareVerifier.execCompare(compareMode, d0, cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp1 = tcuTexCompareVerifier.execCompare(compareMode, d1, cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp = [cmp0, cmp1]; + + var isTrue = getMask(cmp, function(x) {return x.isTrue;}); + var isFalse = getMask(cmp, function(x) {return x.isFalse;}); + + var f0 = fBounds[0]; + var f1 = fBounds[1]; + + var pcfErr = tcuTexVerifierUtil.computeFixedPointError(prec.pcfBits); + var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits); + var totalErr = pcfErr + resErr; + + for (var comb = 0; comb < 4; comb++) { + if (((comb & isTrue) | (~comb & isFalse )) != 3) + continue; + + var cmp0True = ((comb >> 0) & 1) != 0; + var cmp1True = ((comb >> 1) & 1) != 0; + + var ref0 = cmp0True ? 1 : 0; + var ref1 = cmp1True ? 1 : 0; + + var v0 = ref0 * (1 - f0) + ref1 * f0; + var v1 = ref0 * (1 - f1) + ref1 * f1; + var minV = Math.min(v0, v1); + var maxV = Math.max(v0, v1); + var minR = minV - totalErr; + var maxR = maxV + totalErr; + + if (deMath.deInRange32(result, minR, maxR)) + return true; + } + return false; +}; + +/** + * @param {number} val + * @param {number} offset + * @return {Array} + */ +tcuTexCompareVerifier.extractBVec4 = function(val, offset) { + return [ + ((val >> (offset + 0)) & 1) != 0, + ((val >> (offset + 1)) & 1) != 0, + ((val >> (offset + 2)) & 1) != 0, + ((val >> (offset + 3)) & 1) != 0]; +}; + +/** + * Values are in order (0,0), (1,0), (0,1), (1,1) + * @param {Array} values + * @param {number} x + * @param {number} y + * @return {number} + */ +tcuTexCompareVerifier.bilinearInterpolate = function(values, x, y) { + var v00 = values[0]; + var v10 = values[1]; + var v01 = values[2]; + var v11 = values[3]; + var res = v00 * (1 - x) * (1 - y) + v10 * x * (1 - y) + v01 * (1 - x) * y + v11 * x * y; + return res; +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} depths vec4 + * @param {number} cmpReference + * @param {number} result + * @param {boolean} isFixedPointDepth + * @return {boolean} + */ +tcuTexCompareVerifier.isBilinearAnyCompareValid = function(compareMode, + prec, + depths, + cmpReference, + result, + isFixedPointDepth) { + assertMsgOptions(prec.pcfBits === 0, 'PCF bits must be 0', false, true); + + var d0 = depths[0]; + var d1 = depths[1]; + var d2 = depths[2]; + var d3 = depths[3]; + + var cmp0 = tcuTexCompareVerifier.execCompare(compareMode, d0, cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp1 = tcuTexCompareVerifier.execCompare(compareMode, d1, cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp2 = tcuTexCompareVerifier.execCompare(compareMode, d2, cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp3 = tcuTexCompareVerifier.execCompare(compareMode, d3, cmpReference, prec.referenceBits, isFixedPointDepth); + + var canBeTrue = cmp0.isTrue || cmp1.isTrue || cmp2.isTrue || cmp3.isTrue; + var canBeFalse = cmp0.isFalse || cmp1.isFalse || cmp2.isFalse || cmp3.isFalse; + + var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits); + + var minBound = canBeFalse ? 0 : 1; + var maxBound = canBeTrue ? 1 : 0; + + return deMath.deInRange32(result, minBound - resErr, maxBound + resErr); +}; + +/** + * @param {Array} arr + * @param {function(tcuTexCompareVerifier.CmpResultSet): boolean} getValue + * @return {number} + */ +var getMask = function(arr, getValue) { + var mask = 0; + for (var i = 0; i < arr.length; i++) { + var val = getValue(arr[i]); + if (val) + mask |= 1 << i; + } + return mask; +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} depths vec4 + * @param {Array} xBounds vec2 + * @param {Array} yBounds vec2 + * @param {number} cmpReference + * @param {number} result + * @param {boolean} isFixedPointDepth + * @return {boolean} + */ +tcuTexCompareVerifier.isBilinearPCFCompareValid = function(compareMode, + prec, + depths, + xBounds, + yBounds, + cmpReference, + result, + isFixedPointDepth) { + assertMsgOptions(0.0 <= xBounds[0] && xBounds[0] <= xBounds[1] && xBounds[1] <= 1.0, 'x coordinate out of bounds', false, true); + assertMsgOptions(0.0 <= yBounds[0] && yBounds[0] <= yBounds[1] && yBounds[1] <= 1.0, 'y coordinate out of bounds', false, true); + assertMsgOptions(prec.pcfBits > 0, 'PCF bits must be > 0', false, true); + + var d0 = depths[0]; + var d1 = depths[1]; + var d2 = depths[2]; + var d3 = depths[3]; + + /** @type {Array} */ var cmp = []; + cmp[0] = tcuTexCompareVerifier.execCompare(compareMode, d0, cmpReference, prec.referenceBits, isFixedPointDepth); + cmp[1] = tcuTexCompareVerifier.execCompare(compareMode, d1, cmpReference, prec.referenceBits, isFixedPointDepth); + cmp[2] = tcuTexCompareVerifier.execCompare(compareMode, d2, cmpReference, prec.referenceBits, isFixedPointDepth); + cmp[3] = tcuTexCompareVerifier.execCompare(compareMode, d3, cmpReference, prec.referenceBits, isFixedPointDepth); + + var isTrue = getMask(cmp, function(x) {return x.isTrue}); + var isFalse = getMask(cmp, function(x) {return x.isFalse}); + + // Interpolation parameters + var x0 = xBounds[0]; + var x1 = xBounds[1]; + var y0 = yBounds[0]; + var y1 = yBounds[1]; + + // Error parameters + var pcfErr = tcuTexVerifierUtil.computeFixedPointError(prec.pcfBits); + var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits); + var totalErr = pcfErr + resErr; + + // Iterate over all valid combinations. + // \note It is not enough to compute minmax over all possible result sets, as ranges may + // not necessarily overlap, i.e. there are gaps between valid ranges. + for (var comb = 0; comb < (1 << 4); comb++) { + // Filter out invalid combinations: + // 1) True bit is set in comb but not in isTrue => sample can not be true + // 2) True bit is NOT set in comb and not in isFalse => sample can not be false + if (((comb & isTrue) | (~comb & isFalse)) != (1 << 4) - 1) + continue; + + var cmpTrue = tcuTexCompareVerifier.extractBVec4(comb, 0); + var refVal = tcuTextureUtil.select([1, 1, 1, 1], [0, 0, 0, 0], cmpTrue); + + var v0 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x0, y0); + var v1 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x1, y0); + var v2 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x0, y1); + var v3 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x1, y1); + var minV = Math.min(v0, v1, v2, v3); + var maxV = Math.max(v0, v1, v2, v3); + var minR = minV - totalErr; + var maxR = maxV + totalErr; + + if (deMath.deInRange32(result, minR, maxR)) + return true; + } + + return false; +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} depths vec4 + * @param {Array} xBounds vec2 + * @param {Array} yBounds vec2 + * @param {number} cmpReference + * @param {number} result + * @param {boolean} isFixedPointDepth + * @return {boolean} + */ +tcuTexCompareVerifier.isBilinearCompareValid = function(compareMode, + prec, + depths, + xBounds, + yBounds, + cmpReference, + result, + isFixedPointDepth) { + if (prec.pcfBits > 0) + return tcuTexCompareVerifier.isBilinearPCFCompareValid(compareMode, prec, depths, xBounds, yBounds, cmpReference, result, isFixedPointDepth); + else + return tcuTexCompareVerifier.isBilinearAnyCompareValid(compareMode, prec, depths, cmpReference, result, isFixedPointDepth); +}; +/** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {number} coordZ + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isLinearCompareResultValid = function(level, + sampler, + prec, + coord, + coordZ, + cmpReference, + result) { + var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level.getFormat()); + var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]); + var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinate bounds for (x0,y0) - without wrap mode + var minI = Math.floor(uBounds[0] - 0.5); + var maxI = Math.floor(uBounds[1] - 0.5); + var minJ = Math.floor(vBounds[0] - 0.5); + var maxJ = Math.floor(vBounds[1] - 0.5); + + var w = level.getWidth(); + var h = level.getHeight(); + + // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode. + + for (var j = minJ; j <= maxJ; j++) { + for (var i = minI; i <= maxI; i++) { + // Wrapped coordinates + var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w); + var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w); + var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j, h); + var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j + 1, h); + + // Bounds for filtering factors + var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1); + var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1); + var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1); + var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1); + + var depths = [ + level.getPixDepth(x0, y0, coordZ), + level.getPixDepth(x1, y0, coordZ), + level.getPixDepth(x0, y1, coordZ), + level.getPixDepth(x1, y1, coordZ) + ]; + + if (tcuTexCompareVerifier.isBilinearCompareValid(sampler.compare, prec, depths, [minA, maxA], [minB, maxB], cmpReference, result, isFixedPointDepth)) + return true; + } + } + + return false; +}; + +/** + * @param {tcuTexCompareVerifier.CmpResultSet} resultSet + * @param {number} result + * @param {number} resultBits + */ +tcuTexCompareVerifier.isResultInSet = function(resultSet, result, resultBits) { + var err = tcuTexVerifierUtil.computeFixedPointError(resultBits); + var minR = result - err; + var maxR = result + err; + + return (resultSet.isTrue && deMath.deInRange32(1, minR, maxR)) || + (resultSet.isFalse && deMath.deInRange32(0, minR, maxR)); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {number} coordZ + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isNearestCompareResultValid = function(level, + sampler, + prec, + coord, + coordZ, + cmpReference, + result) { + var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level.getFormat()); + var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]); + var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinates - without wrap mode + var minI = Math.floor(uBounds[0]); + var maxI = Math.floor(uBounds[1]); + var minJ = Math.floor(vBounds[0]); + var maxJ = Math.floor(vBounds[1]); + + for (var j = minJ; j <= maxJ; j++) { + for (var i = minI; i <= maxI; i++) { + var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth()); + var y = tcuTexVerifierUtil.wrap(sampler.wrapT, j, level.getHeight()); + var depth = level.getPixDepth(x, y, coordZ); + var resSet = tcuTexCompareVerifier.execCompare(sampler.compare, depth, cmpReference, prec.referenceBits, isFixedPointDepth); + + if (tcuTexCompareVerifier.isResultInSet(resSet, result, prec.resultBits)) + return true; + } + } + + return false; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filterMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {number} coordZ + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isLevelCompareResultValid = function(level, + sampler, + filterMode, + prec, + coord, + coordZ, + cmpReference, + result) { + if (filterMode == tcuTexture.FilterMode.LINEAR) + return tcuTexCompareVerifier.isLinearCompareResultValid(level, sampler, prec, coord, coordZ, cmpReference, result); + else + return tcuTexCompareVerifier.isNearestCompareResultValid(level, sampler, prec, coord, coordZ, cmpReference, result); +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} depths0 vec4 + * @param {Array} depths1 vec4 + * @param {number} cmpReference + * @param {number} result + * @param {boolean} isFixedPointDepth + * @return {boolean} + */ +tcuTexCompareVerifier.isTrilinearAnyCompareValid = function(compareMode, + prec, + depths0, + depths1, + cmpReference, + result, + isFixedPointDepth) { + assertMsgOptions(prec.pcfBits === 0, 'PCF bits must be 0', false, true); + + var cmp00 = tcuTexCompareVerifier.execCompare(compareMode, depths0[0], cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp01 = tcuTexCompareVerifier.execCompare(compareMode, depths0[1], cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp02 = tcuTexCompareVerifier.execCompare(compareMode, depths0[2], cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp03 = tcuTexCompareVerifier.execCompare(compareMode, depths0[3], cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp10 = tcuTexCompareVerifier.execCompare(compareMode, depths1[0], cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp11 = tcuTexCompareVerifier.execCompare(compareMode, depths1[1], cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp12 = tcuTexCompareVerifier.execCompare(compareMode, depths1[2], cmpReference, prec.referenceBits, isFixedPointDepth); + var cmp13 = tcuTexCompareVerifier.execCompare(compareMode, depths1[3], cmpReference, prec.referenceBits, isFixedPointDepth); + + var canBeTrue = cmp00.isTrue || + cmp01.isTrue || + cmp02.isTrue || + cmp03.isTrue || + cmp10.isTrue || + cmp11.isTrue || + cmp12.isTrue || + cmp13.isTrue; + var canBeFalse = cmp00.isFalse || + cmp01.isFalse || + cmp02.isFalse || + cmp03.isFalse || + cmp10.isFalse || + cmp11.isFalse || + cmp12.isFalse || + cmp13.isFalse; + + var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits); + + var minBound = canBeFalse ? 0 : 1; + var maxBound = canBeTrue ? 1 : 0; + + return deMath.deInRange32(result, minBound - resErr, maxBound + resErr); +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} depths0 vec4 + * @param {Array} depths1 vec4 + * @param {Array} xBounds0 + * @param {Array} yBounds0 + * @param {Array} xBounds1 + * @param {Array} yBounds1 + * @param {Array} fBounds + * @param {number} cmpReference + * @param {number} result + * @param {boolean} isFixedPointDepth + * @return {boolean} + */ +tcuTexCompareVerifier.isTrilinearPCFCompareValid = function(compareMode, + prec, + depths0, + depths1, + xBounds0, + yBounds0, + xBounds1, + yBounds1, + fBounds, + cmpReference, + result, + isFixedPointDepth) { + assertMsgOptions(0.0 <= xBounds0[0] && xBounds0[0] <= xBounds0[1] && xBounds0[1] <= 1.0, 'x0 coordinate out of bounds', false, true); + assertMsgOptions(0.0 <= yBounds0[0] && yBounds0[0] <= yBounds0[1] && yBounds0[1] <= 1.0, 'y0 coordinate out of bounds', false, true); + assertMsgOptions(0.0 <= xBounds1[0] && xBounds1[0] <= xBounds1[1] && xBounds1[1] <= 1.0, 'x1 coordinate out of bounds', false, true); + assertMsgOptions(0.0 <= yBounds1[0] && yBounds1[0] <= yBounds1[1] && yBounds1[1] <= 1.0, 'y1 coordinate out of bounds', false, true); + assertMsgOptions(0.0 <= fBounds[0] && fBounds[0] <= fBounds[1] && fBounds[1] <= 1.0, 'linear factor out of bounds', false, true); + assertMsgOptions(prec.pcfBits > 0, 'PCF bits must be > 0', false, true); + + /** @type {Array} */ var cmp = []; + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[0], cmpReference, prec.referenceBits, isFixedPointDepth)); + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[1], cmpReference, prec.referenceBits, isFixedPointDepth)); + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[2], cmpReference, prec.referenceBits, isFixedPointDepth)); + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[3], cmpReference, prec.referenceBits, isFixedPointDepth)); + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[0], cmpReference, prec.referenceBits, isFixedPointDepth)); + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[1], cmpReference, prec.referenceBits, isFixedPointDepth)); + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[2], cmpReference, prec.referenceBits, isFixedPointDepth)); + cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[3], cmpReference, prec.referenceBits, isFixedPointDepth)); + + var isTrue = getMask(cmp, function(x) {return x.isTrue}); + var isFalse = getMask(cmp, function(x) {return x.isFalse}); + + // Error parameters + var pcfErr = tcuTexVerifierUtil.computeFixedPointError(prec.pcfBits); + var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits); + var totalErr = pcfErr + resErr; + + // Iterate over all valid combinations. + for (var comb = 0; comb < (1 << 8); comb++) { + // Filter out invalid combinations. + if (((comb & isTrue) | (~comb & isFalse)) != (1 << 8) - 1) + continue; + + var cmpTrue0 = tcuTexCompareVerifier.extractBVec4(comb, 0); + var cmpTrue1 = tcuTexCompareVerifier.extractBVec4(comb, 4); + var refVal0 = tcuTextureUtil.select([1, 1, 1, 1], [0, 0, 0, 0], cmpTrue0); + var refVal1 = tcuTextureUtil.select([1, 1, 1, 1], [0, 0, 0, 0], cmpTrue1); + + // Bilinear interpolation within levels. + var v00 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[0], yBounds0[0]); + var v01 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[1], yBounds0[0]); + var v02 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[0], yBounds0[1]); + var v03 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[1], yBounds0[1]); + var minV0 = Math.min(v00, v01, v02, v03); + var maxV0 = Math.max(v00, v01, v02, v03); + + var v10 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[0], yBounds1[0]); + var v11 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[1], yBounds1[0]); + var v12 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[0], yBounds1[1]); + var v13 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[1], yBounds1[1]); + var minV1 = Math.min(v10, v11, v12, v13); + var maxV1 = Math.max(v10, v11, v12, v13); + + // Compute min-max bounds by filtering between minimum bounds and maximum bounds between levels. + // HW can end up choosing pretty much any of samples between levels, and thus interpolating + // between minimums should yield lower bound for range, and same for upper bound. + // \todo [2013-07-17 pyry] This seems separable? Can this be optimized? At least ranges could be pre-computed and later combined. + var minF0 = minV0 * (1 - fBounds[0]) + minV1 * fBounds[0]; + var minF1 = minV0 * (1 - fBounds[1]) + minV1 * fBounds[1]; + var maxF0 = maxV0 * (1 - fBounds[0]) + maxV1 * fBounds[0]; + var maxF1 = maxV0 * (1 - fBounds[1]) + maxV1 * fBounds[1]; + + var minF = Math.min(minF0, minF1); + var maxF = Math.max(maxF0, maxF1); + + var minR = minF - totalErr; + var maxR = maxF + totalErr; + + if (deMath.deInRange32(result, minR, maxR)) + return true; + } + + return false; + +}; + +/** + * @param {tcuTexture.CompareMode} compareMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} depths0 vec4 + * @param {Array} depths1 vec4 + * @param {Array} xBounds0 + * @param {Array} yBounds0 + * @param {Array} xBounds1 + * @param {Array} yBounds1 + * @param {Array} fBounds + * @param {number} cmpReference + * @param {number} result + * @param {boolean} isFixedPointDepth + * @return {boolean} + */ +tcuTexCompareVerifier.isTrilinearCompareValid = function(compareMode, + prec, + depths0, + depths1, + xBounds0, + yBounds0, + xBounds1, + yBounds1, + fBounds, + cmpReference, + result, + isFixedPointDepth) { + if (prec.pcfBits > 0) + return tcuTexCompareVerifier.isTrilinearPCFCompareValid(compareMode, prec, depths0, depths1, xBounds0, yBounds0, xBounds1, yBounds1, fBounds, cmpReference, result, isFixedPointDepth); + else + return tcuTexCompareVerifier.isTrilinearAnyCompareValid(compareMode, prec, depths0, depths1, cmpReference, result, isFixedPointDepth); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {number} coordZ + * @param {Array} fBounds vec2 + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isLinearMipmapLinearCompareResultValid = function(level0, + level1, + sampler, + prec, + coord, + coordZ, + fBounds, + cmpReference, + result) { + var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level0.getFormat()); + + // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent. + // Right now this allows pairing any two valid bilinear quads. + + var w0 = level0.getWidth(); + var w1 = level1.getWidth(); + var h0 = level0.getHeight(); + var h1 = level1.getHeight(); + + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]); + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]); + var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]); + var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinates - without wrap mode + var minI0 = Math.floor(uBounds0[0] - 0.5); + var maxI0 = Math.floor(uBounds0[1] - 0.5); + var minI1 = Math.floor(uBounds1[0] - 0.5); + var maxI1 = Math.floor(uBounds1[1] - 0.5); + var minJ0 = Math.floor(vBounds0[0] - 0.5); + var maxJ0 = Math.floor(vBounds0[1] - 0.5); + var minJ1 = Math.floor(vBounds1[0] - 0.5); + var maxJ1 = Math.floor(vBounds1[1] - 0.5); + + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1); + var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1); + var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1); + var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1); + var depths0 = []; + + var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0); + var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0 + 1, w0); + var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0); + var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0 + 1, h0); + + depths0[0] = level0.getPixDepth(x0, y0, coordZ); + depths0[1] = level0.getPixDepth(x1, y0, coordZ); + depths0[2] = level0.getPixDepth(x0, y1, coordZ); + depths0[3] = level0.getPixDepth(x1, y1, coordZ); + + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1); + var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1); + var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1); + var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1); + var depths1 = []; + + x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1); + x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1 + 1, w1); + y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1); + y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1 + 1, h1); + + depths1[0] = level1.getPixDepth(x0, y0, coordZ); + depths1[1] = level1.getPixDepth(x1, y0, coordZ); + depths1[2] = level1.getPixDepth(x0, y1, coordZ); + depths1[3] = level1.getPixDepth(x1, y1, coordZ); + + if (tcuTexCompareVerifier.isTrilinearCompareValid(sampler.compare, prec, depths0, depths1, + [minA0, maxA0], [minB0, maxB0], + [minA1, maxA1], [minB1, maxB1], + fBounds, cmpReference, result, isFixedPointDepth)) + return true; + } + } + } + } + + return false; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {number} coordZ + * @param {Array} fBounds vec2 + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isNearestMipmapLinearCompareResultValid = function(level0, + level1, + sampler, + prec, + coord, + coordZ, + fBounds, + cmpReference, + result) { + var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level0.getFormat()); + + var w0 = level0.getWidth(); + var w1 = level1.getWidth(); + var h0 = level0.getHeight(); + var h1 = level1.getHeight(); + + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]); + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]); + var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]); + var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]); + + var minI0 = Math.floor(uBounds0[0]); + var maxI0 = Math.floor(uBounds0[1]); + var minI1 = Math.floor(uBounds1[0]); + var maxI1 = Math.floor(uBounds1[1]); + var minJ0 = Math.floor(vBounds0[0]); + var maxJ0 = Math.floor(vBounds0[1]); + var minJ1 = Math.floor(vBounds1[0]); + var maxJ1 = Math.floor(vBounds1[1]); + + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0); + var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0); + + // Derivated from C++ dEQP function lookupDepth() + // Since x0 and y0 are wrapped, here lookupDepth() returns the same result as getPixDepth() + assertMsgOptions(deMath.deInBounds32(x0, 0, level0.getWidth()) && deMath.deInBounds32(y0, 0, level0.getHeight()) && deMath.deInBounds32(coordZ, 0, level0.getDepth()), 'x0, y0 or coordZ out of bound.', false, true); + var depth0 = level0.getPixDepth(x0, y0, coordZ); + + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1); + var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1); + + // Derivated from C++ dEQP function lookupDepth() + // Since x1 and y1 are wrapped, here lookupDepth() returns the same result as getPixDepth() + assertMsgOptions(deMath.deInBounds32(x1, 0, level1.getWidth()) && deMath.deInBounds32(y1, 0, level1.getHeight()), 'x1 or y1 out of bound.', false, true); + var depth1 = level1.getPixDepth(x1, y1, coordZ); + + if (tcuTexCompareVerifier.isLinearCompareValid(sampler.compare, prec, [depth0, depth1], fBounds, cmpReference, result, isFixedPointDepth)) + return true; + } + } + } + } + + return false; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} levelFilter + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {number} coordZ + * @param {Array} fBounds vec2 + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isMipmapLinearCompareResultValid = function(level0, + level1, + sampler, + levelFilter, + prec, + coord, + coordZ, + fBounds, + cmpReference, + result) { + if (levelFilter == tcuTexture.FilterMode.LINEAR) + return tcuTexCompareVerifier.isLinearMipmapLinearCompareResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, cmpReference, result); + else + return tcuTexCompareVerifier.isNearestMipmapLinearCompareResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, cmpReference, result); +}; + +/** + * @param {tcuTexture.Texture2DView} texture + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {Array} lodBounds vec2 level-of-detail bounds + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isTexCompareResultValid2D = function(texture, sampler, prec, coord, lodBounds, cmpReference, result) { + var minLod = lodBounds[0]; + var maxLod = lodBounds[1]; + var canBeMagnified = minLod <= sampler.lodThreshold; + var canBeMinified = maxLod > sampler.lodThreshold; + + if (canBeMagnified) { + if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, 0, cmpReference, result)) + return true; + } + + if (canBeMinified) { + var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter); + var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter); + var minTexLevel = 0; + var maxTexLevel = texture.getNumLevels() - 1; + + assertMsgOptions(minTexLevel < maxTexLevel, 'Invalid texture levels.', false, true); + + if (isLinearMipmap) { + var minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1); + var maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1); + + assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + var minF = deMath.clamp(minLod - level, 0, 1); + var maxF = deMath.clamp(maxLod - level, 0, 1); + + if (tcuTexCompareVerifier.isMipmapLinearCompareResultValid(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, [minF, maxF], cmpReference, result)) + return true; + } + } else if (isNearestMipmap) { + // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made + // decision to allow floor(lod + 0.5) as well. + var minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel); + var maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel); + + assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, cmpReference, result)) + return true; + } + } else { + if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, 0, cmpReference, result)) + return true; + } + } + + return false; +}; + +/** + * @param {tcuTexture.TextureCubeView} texture + * @param {number} baseLevelNdx + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {Array} fBounds vec2 + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isSeamplessLinearMipmapLinearCompareResultValid = function(texture, + baseLevelNdx, + sampler, + prec, + coords, + fBounds, + cmpReference, + result) { + var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(texture.getLevelFace(baseLevelNdx, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X).getFormat()); + var size0 = texture.getLevelFace(baseLevelNdx, coords.face).getWidth(); + var size1 = texture.getLevelFace(baseLevelNdx + 1, coords.face).getWidth(); + + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.s, prec.coordBits[0], prec.uvwBits[0]); + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.s, prec.coordBits[0], prec.uvwBits[0]); + var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.t, prec.coordBits[1], prec.uvwBits[1]); + var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.t, prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinates - without wrap mode + var minI0 = Math.floor(uBounds0[0] - 0.5); + var maxI0 = Math.floor(uBounds0[1] - 0.5); + var minI1 = Math.floor(uBounds1[0] - 0.5); + var maxI1 = Math.floor(uBounds1[1] - 0.5); + var minJ0 = Math.floor(vBounds0[0] - 0.5); + var maxJ0 = Math.floor(vBounds0[1] - 0.5); + var minJ1 = Math.floor(vBounds1[0] - 0.5); + var maxJ1 = Math.floor(vBounds1[1] - 0.5); + + /** @type {Array} */ var faces0 = []; + /** @type {Array} */ var faces1 = []; + + for (var key in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[key]; + faces0[face] = texture.getLevelFace(baseLevelNdx, face); + faces1[face] = texture.getLevelFace(baseLevelNdx + 1, face); + } + + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1); + var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1); + var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1); + var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1); + var depths0 = []; + + var c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 0]), size0); + var c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 0]), size0); + var c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 1]), size0); + var c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 1]), size0); + + // If any of samples is out of both edges, implementations can do pretty much anything according to spec. + // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color. + if (c00 == null || c01 == null || c10 == null || c11 == null) + return true; + + depths0[0] = faces0[c00.face].getPixDepth(c00.s, c00.t); + depths0[1] = faces0[c10.face].getPixDepth(c10.s, c10.t); + depths0[2] = faces0[c01.face].getPixDepth(c01.s, c01.t); + depths0[3] = faces0[c11.face].getPixDepth(c11.s, c11.t); + + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1); + var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1); + var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1); + var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1); + var depths1 = []; + + c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 0]), size1); + c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 0]), size1); + c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 1]), size1); + c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 1]), size1); + + if (c00 == null || c01 == null || c10 == null || c11 == null) + return true; + + depths1[0] = faces1[c00.face].getPixDepth(c00.s, c00.t); + depths1[1] = faces1[c10.face].getPixDepth(c10.s, c10.t); + depths1[2] = faces1[c01.face].getPixDepth(c01.s, c01.t); + depths1[3] = faces1[c11.face].getPixDepth(c11.s, c11.t); + + if (tcuTexCompareVerifier.isTrilinearCompareValid(sampler.compare, prec, depths0, depths1, + [minA0, maxA0], [minB0, maxB0], + [minA1, maxA1], [minB1, maxB1], + fBounds, cmpReference, result, isFixedPointDepth)) + return true; + } + } + } + } + + return false; +}; + +/** + * @param {tcuTexture.TextureCubeView} texture + * @param {number} levelNdx + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ + +tcuTexCompareVerifier.isSeamlessLinearCompareResultValid = function(texture, + levelNdx, + sampler, + prec, + coords, + cmpReference, + result) { + var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(texture.getLevelFace(levelNdx, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X).getFormat()); + var size = texture.getLevelFace(levelNdx, coords.face).getWidth(); + + var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits[0], prec.uvwBits[0]); + var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinate bounds for (x0,y0) - without wrap mode + var minI = Math.floor(uBounds[0] - 0.5); + var maxI = Math.floor(uBounds[1] - 0.5); + var minJ = Math.floor(vBounds[0] - 0.5); + var maxJ = Math.floor(vBounds[1] - 0.5); + + // Face accesses + /** @type {Array} */ var faces = []; + + for (var key in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[key]; + faces[face] = texture.getLevelFace(levelNdx, face); + } + + for (var j = minJ; j <= maxJ; j++) { + for (var i = minI; i <= maxI; i++) { + var c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 0]), size); + var c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 0]), size); + var c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 1]), size); + var c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 1]), size); + + // If any of samples is out of both edges, implementations can do pretty much anything according to spec. + // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color. + if (!c00 || !c01 || !c10 || !c11) + return true; + + // Bounds for filtering factors + var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1); + var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1); + var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1); + var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1); + + var depths = []; + depths[0] = faces[c00.face].getPixDepth(c00.s, c00.t); + depths[1] = faces[c10.face].getPixDepth(c10.s, c10.t); + depths[2] = faces[c01.face].getPixDepth(c01.s, c01.t); + depths[3] = faces[c11.face].getPixDepth(c11.s, c11.t); + + if (tcuTexCompareVerifier.isBilinearCompareValid(sampler.compare, prec, depths, [minA, maxA], [minB, maxB], cmpReference, result, isFixedPointDepth)) + return true; + } + } + + return false; +}; + +/** + * @param {tcuTexture.TextureCubeView} texture + * @param {number} levelNdx + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filterMode + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isCubeLevelCompareResultValid = function(texture, + levelNdx, + sampler, + filterMode, + prec, + coords, + cmpReference, + result) { + if (filterMode == tcuTexture.FilterMode.LINEAR) { + if (sampler.seamlessCubeMap) + return tcuTexCompareVerifier.isSeamlessLinearCompareResultValid(texture, levelNdx, sampler, prec, coords, cmpReference, result); + else + return tcuTexCompareVerifier.isLinearCompareResultValid(texture.getLevelFace(levelNdx, coords.face), sampler, prec, [coords.s, coords.t], 0, cmpReference, result); + } else + return tcuTexCompareVerifier.isNearestCompareResultValid(texture.getLevelFace(levelNdx, coords.face), sampler, prec, [coords.s, coords.t], 0, cmpReference, result); +}; + +/** + * @param {tcuTexture.TextureCubeView} texture + * @param {number} baseLevelNdx + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} levelFilter + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {Array} fBounds vec2 + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isCubeMipmapLinearCompareResultValid = function(texture, + baseLevelNdx, + sampler, + levelFilter, + prec, + coords, + fBounds, + cmpReference, + result) { + if (levelFilter == tcuTexture.FilterMode.LINEAR) { + if (sampler.seamlessCubeMap) + return tcuTexCompareVerifier.isSeamplessLinearMipmapLinearCompareResultValid(texture, baseLevelNdx, sampler, prec, coords, fBounds, cmpReference, result); + else + return tcuTexCompareVerifier.isLinearMipmapLinearCompareResultValid(texture.getLevelFace(baseLevelNdx, coords.face), + texture.getLevelFace(baseLevelNdx + 1, coords.face), + sampler, prec, [coords.s, coords.t], 0, fBounds, cmpReference, result); + } else + return tcuTexCompareVerifier.isNearestMipmapLinearCompareResultValid(texture.getLevelFace(baseLevelNdx, coords.face), + texture.getLevelFace(baseLevelNdx + 1, coords.face), + sampler, prec, [coords.s, coords.t], 0, fBounds, cmpReference, result); +}; + +/** + * @param {tcuTexture.TextureCubeView} texture + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec2 texture coordinates + * @param {Array} lodBounds vec2 level-of-detail bounds + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isTexCompareResultValidCube = function(texture, sampler, prec, coord, lodBounds, cmpReference, result) { + /** @type {Array} */var possibleFaces = tcuTexVerifierUtil.getPossibleCubeFaces(coord, prec.coordBits); + + if (!possibleFaces) + return true; // Result is undefined. + + for (var tryFaceNdx = 0; tryFaceNdx < possibleFaces.length; tryFaceNdx++) { + var face = possibleFaces[tryFaceNdx]; + var faceCoords = new tcuTexture.CubeFaceCoords(face, tcuTexture.projectToFace(face, coord)); + var minLod = lodBounds[0]; + var maxLod = lodBounds[1]; + var canBeMagnified = minLod <= sampler.lodThreshold; + var canBeMinified = maxLod > sampler.lodThreshold; + + if (canBeMagnified) { + if (tcuTexCompareVerifier.isCubeLevelCompareResultValid(texture, 0, sampler, sampler.magFilter, prec, faceCoords, cmpReference, result)) + return true; + } + + if (canBeMinified) { + var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter); + var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter); + var minTexLevel = 0; + var maxTexLevel = texture.getNumLevels() - 1; + + assertMsgOptions(minTexLevel < maxTexLevel, 'Invalid texture levels.', false, true); + + if (isLinearMipmap) { + var minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1); + var maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1); + + assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + var minF = deMath.clamp(minLod - level, 0, 1); + var maxF = deMath.clamp(maxLod - level, 0, 1); + + if (tcuTexCompareVerifier.isCubeMipmapLinearCompareResultValid(texture, level, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, [minF, maxF], cmpReference, result)) + return true; + } + } else if (isNearestMipmap) { + // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made + // decision to allow floor(lod + 0.5) as well. + var minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel); + var maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel); + + assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + if (tcuTexCompareVerifier.isCubeLevelCompareResultValid(texture, level, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, cmpReference, result)) + return true; + } + } else { + if (tcuTexCompareVerifier.isCubeLevelCompareResultValid(texture, 0, sampler, sampler.minFilter, prec, faceCoords, cmpReference, result)) + return true; + } + } + } + + return false; +}; + +/** + * @param {tcuTexture.Texture2DArrayView} texture + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexCompareVerifier.TexComparePrecision} prec + * @param {Array} coord vec3 texture coordinates + * @param {Array} lodBounds vec2 level-of-detail bounds + * @param {number} cmpReference + * @param {number} result + * @return {boolean} + */ +tcuTexCompareVerifier.isTexCompareResultValid2DArray = function(texture, sampler, prec, coord, lodBounds, cmpReference, result) { + var depthErr = tcuTexVerifierUtil.computeFloatingPointError(coord[2], prec.coordBits[2]) + tcuTexVerifierUtil.computeFixedPointError(prec.uvwBits[2]); + var minZ = coord[2] - depthErr; + var maxZ = coord[2] + depthErr; + var minLayer = deMath.clamp(Math.floor(minZ + 0.5), 0, texture.getNumLayers() - 1); + var maxLayer = deMath.clamp(Math.floor(maxZ + 0.5), 0, texture.getNumLayers() - 1); + + for (var layer = minLayer; layer <= maxLayer; layer++) { + var minLod = lodBounds[0]; + var maxLod = lodBounds[1]; + var canBeMagnified = minLod <= sampler.lodThreshold; + var canBeMinified = maxLod > sampler.lodThreshold; + + if (canBeMagnified) { + if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, deMath.swizzle(coord, [0, 1]), layer, cmpReference, result)) + return true; + } + + if (canBeMinified) { + var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter); + var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter); + var minTexLevel = 0; + var maxTexLevel = texture.getNumLevels() - 1; + + assertMsgOptions(minTexLevel < maxTexLevel, 'Invalid texture levels.', false, true); + + if (isLinearMipmap) { + var minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1); + var maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1); + + assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + var minF = deMath.clamp(minLod - level, 0, 1); + var maxF = deMath.clamp(maxLod - level, 0, 1); + + if (tcuTexCompareVerifier.isMipmapLinearCompareResultValid(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, deMath.swizzle(coord, [0, 1]), layer, [minF, maxF], cmpReference, result)) + return true; + } + } else if (isNearestMipmap) { + // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made + // decision to allow floor(lod + 0.5) as well. + var minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel); + var maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel); + + assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, deMath.swizzle(coord, [0, 1]), layer, cmpReference, result)) + return true; + } + } else { + if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, deMath.swizzle(coord, [0, 1]), layer, cmpReference, result)) + return true; + } + } + } + + return false; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js new file mode 100644 index 000000000..6b471998a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js @@ -0,0 +1,2225 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuTexLookupVerifier'); +goog.require('framework.common.tcuTexVerifierUtil'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + + var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var tcuTexVerifierUtil = framework.common.tcuTexVerifierUtil; + var deMath = framework.delibs.debase.deMath; + + /** @typedef {(tcuTexLookupVerifier.LookupPrecision|{tcuTexLookupVerifier.LookupPrecision})} */ + tcuTexLookupVerifier.PrecType; + + /** + * Generic lookup precision parameters + * @constructor + * @struct + * @param {Array=} coordBits + * @param {Array=} uvwBits + * @param {Array=} colorThreshold + * @param {Array=} colorMask + */ + tcuTexLookupVerifier.LookupPrecision = function(coordBits, uvwBits, colorThreshold, colorMask) { + /** @type {Array} */ this.coordBits = coordBits || [22, 22, 22]; + /** @type {Array} */ this.uvwBits = uvwBits || [16, 16, 16]; + /** @type {Array} */ this.colorThreshold = colorThreshold || [0, 0, 0, 0]; + /** @type {Array} */ this.colorMask = colorMask || [true, true, true, true]; + }; + + /** + * Lod computation precision parameters + * @constructor + * @struct + * @param {number=} derivateBits + * @param {number=} lodBits + */ + tcuTexLookupVerifier.LodPrecision = function(derivateBits, lodBits) { + /** @type {number} */ this.derivateBits = derivateBits === undefined ? 22 : derivateBits; + /** @type {number} */ this.lodBits = lodBits === undefined ? 16 : lodBits; + }; + + /** + * @enum {number} + */ + tcuTexLookupVerifier.TexLookupScaleMode = { + MINIFY: 0, + MAGNIFY: 1 + }; + + // Generic utilities + + /** + * @param {tcuTexture.Sampler} sampler + * @return {boolean} + */ + tcuTexLookupVerifier.isSamplerSupported = function(sampler) { + return sampler.compare == tcuTexture.CompareMode.COMPAREMODE_NONE && + tcuTexVerifierUtil.isWrapModeSupported(sampler.wrapS) && + tcuTexVerifierUtil.isWrapModeSupported(sampler.wrapT) && + tcuTexVerifierUtil.isWrapModeSupported(sampler.wrapR); + }; + + // Color read & compare utilities + + /** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {number} x + * @param {number} y + * @param {number} z + * @return {boolean} + */ + tcuTexLookupVerifier.coordsInBounds = function(access, x, y, z) { + return deMath.deInBounds32(x, 0, access.getWidth()) && deMath.deInBounds32(y, 0, access.getHeight()) && deMath.deInBounds32(z, 0, access.getDepth()); + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @return {boolean} + */ + tcuTexLookupVerifier.isSRGB = function(format) { + return format.order == tcuTexture.ChannelOrder.sRGB || format.order == tcuTexture.ChannelOrder.sRGBA; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {number} i + * @param {number} j + * @param {number} k + * @return {Array} + */ + tcuTexLookupVerifier.lookupScalar = function(access, sampler, i, j, k) { + if (tcuTexLookupVerifier.coordsInBounds(access, i, j, k)) + return access.getPixel(i, j, k); + else + return deMath.toIVec(sampler.borderColor); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {number} i + * @param {number} j + * @param {number} k + * @return {Array} + */ + tcuTexLookupVerifier.lookupFloat = function(access, sampler, i, j, k) { + // Specialization for float lookups: sRGB conversion is performed as specified in format. + if (tcuTexLookupVerifier.coordsInBounds(access, i, j, k)) { + /** @type {Array} */ var p = access.getPixel(i, j, k); + return tcuTexLookupVerifier.isSRGB(access.getFormat()) ? tcuTextureUtil.sRGBToLinear(p) : p; + } else + return sampler.borderColor; + }; + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} ref + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isColorValid = function(prec, ref, result) { + return deMath.boolAll( + deMath.logicalOrBool( + deMath.lessThanEqual(deMath.absDiff(ref, result), prec.colorThreshold), + deMath.logicalNotBool(prec.colorMask))); + }; + + /** + * @constructor + * @struct + * @param {Array=} p00 + * @param {Array=} p01 + * @param {Array=} p10 + * @param {Array=} p11 + */ + tcuTexLookupVerifier.ColorQuad = function(p00, p01, p10, p11) { + /** @type {Array} */ this.p00 = p00 || null; //!< (0, 0) + /** @type {Array} */ this.p01 = p01 || null; //!< (1, 0) + /** @type {Array} */ this.p10 = p10 || null; //!< (0, 1) + /** @type {Array} */ this.p11 = p11 || null; //!< (1, 1) + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {number} x0 + * @param {number} x1 + * @param {number} y0 + * @param {number} y1 + * @param {number} z + * @return {tcuTexLookupVerifier.ColorQuad} + */ + tcuTexLookupVerifier.lookupQuad = function(level, sampler, x0, x1, y0, y1, z) { + var p00 = tcuTexLookupVerifier.lookupFloat(level, sampler, x0, y0, z); + var p10 = tcuTexLookupVerifier.lookupFloat(level, sampler, x1, y0, z); + var p01 = tcuTexLookupVerifier.lookupFloat(level, sampler, x0, y1, z); + var p11 = tcuTexLookupVerifier.lookupFloat(level, sampler, x1, y1, z); + return new tcuTexLookupVerifier.ColorQuad(p00, p01, p10, p11); + }; + + /** + * @constructor + * @struct + * @param {Array=} p0 + * @param {Array=} p1 + */ + tcuTexLookupVerifier.ColorLine = function(p0, p1) { + /** @type {Array} */ this.p0 = p0 || null; //!< 0 + /** @type {Array} */ this.p1 = p1 || null; //!< 1 + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {number} x0 + * @param {number} x1 + * @param {number} y + * @return {tcuTexLookupVerifier.ColorLine} + */ + tcuTexLookupVerifier.lookupLine = function(level, sampler, x0, x1, y) { + return new tcuTexLookupVerifier.ColorLine( + tcuTexLookupVerifier.lookupFloat(level, sampler, x0, y, 0), + tcuTexLookupVerifier.lookupFloat(level, sampler, x1, y, 0) + ); + }; + + /** + * @param {Array} vec + * @return {number} + */ + tcuTexLookupVerifier.minComp = function(vec) { + /** @type {number} */ var minVal = vec[0]; + for (var ndx = 1; ndx < vec.length; ndx++) + minVal = Math.min(minVal, vec[ndx]); + return minVal; + }; + + /** + * @param {Array} vec + * @return {number} + */ + tcuTexLookupVerifier.maxComp = function(vec) { + /** @type {number} */ var maxVal = vec[0]; + for (var ndx = 1; ndx < vec.length; ndx++) + maxVal = Math.max(maxVal, vec[ndx]); + return maxVal; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorLine} line + * @return {number} + */ + tcuTexLookupVerifier.computeBilinearSearchStepFromFloatLine = function(prec, line) { + assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true); + + /** @type {number} */ var maxSteps = 1 << 16; + /** @type {Array} */ var d = deMath.absDiff(line.p1, line.p0); + /** @type {Array} */ var stepCount = deMath.divide([d, d, d, d], prec.colorThreshold); + /** @type {Array} */ + var minStep = deMath.divide([1, 1, 1, 1], deMath.add(stepCount, [1, 1, 1, 1])); + /** @type {number} */ var step = Math.max(tcuTexLookupVerifier.minComp(minStep), 1 / maxSteps); + + return step; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad + * @return {number} + */ + tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad = function(prec, quad) { + assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true); + + /** @type {number} */ var maxSteps = 1 << 16; + /** @type {Array} */ var d0 = deMath.absDiff(quad.p10, quad.p00); + /** @type {Array} */ var d1 = deMath.absDiff(quad.p01, quad.p00); + /** @type {Array} */ var d2 = deMath.absDiff(quad.p11, quad.p10); + /** @type {Array} */ var d3 = deMath.absDiff(quad.p11, quad.p01); + /** @type {Array} */ var maxD = deMath.max(d0, deMath.max(d1, deMath.max(d2, d3))); + /** @type {Array} */ var stepCount = deMath.divide(maxD, prec.colorThreshold); + /** @type {Array} */ var minStep = deMath.divide([1, 1, 1, 1], deMath.add(stepCount, [1, 1, 1, 1])); + /** @type {number} */ var step = Math.max(tcuTexLookupVerifier.minComp(minStep), 1 / maxSteps); + + return step; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @return {number} + */ + tcuTexLookupVerifier.computeBilinearSearchStepForUnorm = function(prec) { + assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true); + + /** @type {Array} */ var stepCount = deMath.divide([1, 1, 1, 1], prec.colorThreshold); + /** @type {Array} */ var minStep = deMath.divide([1, 1, 1, 1], (deMath.add(stepCount, [1, 1, 1, 1]))); + /** @type {number} */ var step = tcuTexLookupVerifier.minComp(minStep); + + return step; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @return {number} + */ + tcuTexLookupVerifier.computeBilinearSearchStepForSnorm = function(prec) { + assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true); + + /** @type {Array} */ var stepCount = deMath.divide([2.0, 2.0, 2.0, 2.0], prec.colorThreshold); + /** @type {Array} */ var minStep = deMath.divide([1, 1, 1, 1], deMath.add(stepCount, [1, 1, 1, 1])); + /** @type {number} */ var step = tcuTexLookupVerifier.minComp(minStep); + + return step; + }; + + /** + * @param {tcuTexLookupVerifier.ColorLine} line + * @return {Array} + */ + tcuTexLookupVerifier.minLine = function(line) { + return deMath.min(line.p0, line.p1); + }; + + /** + * @param {tcuTexLookupVerifier.ColorLine} line + * @return {Array} + */ + tcuTexLookupVerifier.maxLine = function(line) { + var max = deMath.max; + return max(line.p0, line.p1); + }; + + /** + * @param {tcuTexLookupVerifier.ColorQuad} quad + * @return {Array} + */ + tcuTexLookupVerifier.minQuad = function(quad) { + var min = deMath.min; + return min(quad.p00, min(quad.p10, min(quad.p01, quad.p11))); + }; + + /** + * @param {tcuTexLookupVerifier.ColorQuad} quad + * @return {Array} + */ + tcuTexLookupVerifier.maxQuad = function(quad) { + var max = deMath.max; + return max(quad.p00, max(quad.p10, max(quad.p01, quad.p11))); + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isInColorBounds_1Quad = function(prec, quad, result) { + var quadMin = tcuTexLookupVerifier.minQuad; + var quadMax = tcuTexLookupVerifier.maxQuad; + /** @type {Array} */ var minVal = deMath.subtract(quadMin(quad), prec.colorThreshold); + /** @type {Array} */ var maxVal = deMath.add(quadMax(quad), prec.colorThreshold); + return deMath.boolAll( + deMath.logicalOrBool( + deMath.logicalAndBool( + deMath.greaterThanEqual(result, minVal), + deMath.lessThanEqual(result, maxVal)), + deMath.logicalNotBool(prec.colorMask))); + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad0 + * @param {tcuTexLookupVerifier.ColorQuad} quad1 + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isInColorBounds_2Quad = function(prec, quad0, quad1, result) { + var min = deMath.min; + var max = deMath.max; + var quadMin = tcuTexLookupVerifier.minQuad; + var quadMax = tcuTexLookupVerifier.maxQuad; + /** @type {Array} */ var minVal = deMath.subtract(min(quadMin(quad0), quadMin(quad1)), prec.colorThreshold); + /** @type {Array} */ var maxVal = deMath.add(max(quadMax(quad0), quadMax(quad1)), prec.colorThreshold); + return deMath.boolAll( + deMath.logicalOrBool( + deMath.logicalAndBool( + deMath.greaterThanEqual(result, minVal), + deMath.lessThanEqual(result, maxVal)), + deMath.logicalNotBool(prec.colorMask))); + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorLine} line0 + * @param {tcuTexLookupVerifier.ColorLine} line1 + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isInColorBounds_2Line = function(prec, line0, line1, result) { + var min = deMath.min; + var max = deMath.max; + var lineMin = tcuTexLookupVerifier.minLine; + var lineMax = tcuTexLookupVerifier.maxLine; + /** @type {Array} */ var minVal = deMath.subtract(min(lineMin(line0), lineMin(line1)), prec.colorThreshold); + /** @type {Array} */ var maxVal = deMath.add(max(lineMax(line0), lineMax(line1)), prec.colorThreshold); + return deMath.boolAll( + deMath.logicalOrBool( + deMath.logicalAndBool( + deMath.greaterThanEqual(result, minVal), + deMath.lessThanEqual(result, maxVal)), + deMath.logicalNotBool(prec.colorMask))); + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad00 + * @param {tcuTexLookupVerifier.ColorQuad} quad01 + * @param {tcuTexLookupVerifier.ColorQuad} quad10 + * @param {tcuTexLookupVerifier.ColorQuad} quad11 + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isInColorBounds_4Quad = function(prec, quad00, quad01, quad10, quad11, result) { + var min = deMath.min; + var max = deMath.max; + var quadMin = tcuTexLookupVerifier.minQuad; + var quadMax = tcuTexLookupVerifier.maxQuad; + /** @type {Array} */ var minVal = deMath.subtract(min(quadMin(quad00), min(quadMin(quad01), min(quadMin(quad10), quadMin(quad11)))), prec.colorThreshold); + /** @type {Array} */ var maxVal = deMath.add(max(quadMax(quad00), max(quadMax(quad01), max(quadMax(quad10), quadMax(quad11)))), prec.colorThreshold); + return deMath.boolAll( + deMath.logicalOrBool( + deMath.logicalAndBool( + deMath.greaterThanEqual(result, minVal), + deMath.lessThanEqual(result, maxVal)), + deMath.logicalNotBool(prec.colorMask))); + }; + + // Range search utilities + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} c0 + * @param {Array} c1 + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLinearRangeValid = function(prec, c0, c1, fBounds, result) { + // This is basically line segment - AABB test. Valid interpolation line is checked + // against result AABB constructed by applying threshold. + + /** @type {Array} */ var rMin = deMath.subtract(result, prec.colorThreshold); + /** @type {Array} */ var rMax = deMath.add(result, prec.colorThreshold); + + // Algorithm: For each component check whether segment endpoints are inside, or intersect with slab. + // If all intersect or are inside, line segment intersects the whole 4D AABB. + for (var compNdx = 0; compNdx < 4; compNdx++) { + if (!prec.colorMask[compNdx]) + continue; + + /** @type {number} */ var i0 = c0[compNdx] * (1 - fBounds[0]) + c1[compNdx] * fBounds[0]; + /** @type {number} */ var i1 = c0[compNdx] * (1 - fBounds[1]) + c1[compNdx] * fBounds[1]; + if ((i0 > rMax[compNdx] && i1 > rMax[compNdx]) || + (i0 < rMin[compNdx] && i1 < rMin[compNdx])) { + return false; + } + } + + return true; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad + * @param {Array} xBounds + * @param {Array} yBounds + * @param {number} searchStep + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isBilinearRangeValid = function(prec, quad, xBounds, yBounds, searchStep, result) { + assertMsgOptions(xBounds[0] <= xBounds[1], 'Out of bounds: X direction.', false, true); + assertMsgOptions(yBounds[0] <= yBounds[1], 'Out of bounds: Y direction.', false, true); + + if (!tcuTexLookupVerifier.isInColorBounds_1Quad(prec, quad, result)) + return false; + + for (var x = xBounds[0]; x < xBounds[1] + searchStep; x += searchStep) { + /** @type {number} */ var a = Math.min(x, xBounds[1]); + /** @type {Array} */ var c0 = deMath.add(deMath.scale(quad.p00, (1 - a)), deMath.scale(quad.p10, a)); + /** @type {Array} */ var c1 = deMath.add(deMath.scale(quad.p01, (1 - a)), deMath.scale(quad.p11, a)); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, yBounds, result)) + return true; + } + + return false; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad0 + * @param {tcuTexLookupVerifier.ColorQuad} quad1 + * @param {Array} xBounds + * @param {Array} yBounds + * @param {Array} zBounds + * @param {number} searchStep + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isTrilinearRangeValid = function(prec, quad0, quad1, xBounds, yBounds, zBounds, searchStep, result) { + assertMsgOptions(xBounds[0] <= xBounds[1], 'Out of bounds: X direction.', false, true); + assertMsgOptions(yBounds[0] <= yBounds[1], 'Out of bounds: Y direction.', false, true); + assertMsgOptions(zBounds[0] <= zBounds[1], 'Out of bounds: Z direction.', false, true); + + if (!tcuTexLookupVerifier.isInColorBounds_2Quad(prec, quad0, quad1, result)) + return false; + + for (var x = xBounds[0]; x < xBounds[1] + searchStep; x += searchStep) { + for (var y = yBounds[0]; y < yBounds[1] + searchStep; y += searchStep) { + /** @type {number} */ var a = Math.min(x, xBounds[1]); + /** @type {number} */ var b = Math.min(y, yBounds[1]); + /** @type {Array} */ + var c0 = deMath.add( + deMath.add( + deMath.add( + deMath.scale(quad0.p00, (1 - a) * (1 - b)), + deMath.scale(quad0.p10, a * (1 - b))), + deMath.scale(quad0.p01, (1 - a) * b)), + deMath.scale(quad0.p11, a * b)); + /** @type {Array} */ + var c1 = deMath.add( + deMath.add( + deMath.add( + deMath.scale(quad1.p00, (1 - a) * (1 - b)), + deMath.scale(quad1.p10, a * (1 - b))), + deMath.scale(quad1.p01, (1 - a) * b)), + deMath.scale(quad1.p11, a * b)); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, zBounds, result)) + return true; + } + } + + return false; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad0 + * @param {tcuTexLookupVerifier.ColorQuad} quad1 + * @param {Array} xBounds0 + * @param {Array} yBounds0 + * @param {Array} xBounds1 + * @param {Array} yBounds1 + * @param {Array} zBounds + * @param {number} searchStep + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.is2DTrilinearFilterResultValid = function(prec, quad0, quad1, xBounds0, yBounds0, xBounds1, yBounds1, zBounds, searchStep, result) { + assertMsgOptions(xBounds0[0] <= xBounds0[1], 'Out of bounds: X direction.', false, true); + assertMsgOptions(yBounds0[0] <= yBounds0[1], 'Out of bounds: Y direction.', false, true); + assertMsgOptions(xBounds1[0] <= xBounds1[1], 'Out of bounds: X direction.', false, true); + assertMsgOptions(yBounds1[0] <= yBounds1[1], 'Out of bounds: Y direction.', false, true); + + if (!tcuTexLookupVerifier.isInColorBounds_2Quad(prec, quad0, quad1, result)) + return false; + + for (var x0 = xBounds0[0]; x0 < xBounds0[1] + searchStep; x0 += searchStep) { + for (var y0 = yBounds0[0]; y0 < yBounds0[1] + searchStep; y0 += searchStep) { + /** @type {number} */ var a0 = Math.min(x0, xBounds0[1]); + /** @type {number} */ var b0 = Math.min(y0, yBounds0[1]); + /** @type {Array} */ + var c0 = deMath.add( + deMath.add( + deMath.add( + deMath.scale(quad0.p00, (1 - a0) * (1 - b0)), + deMath.scale(quad0.p10, a0 * (1 - b0))), + deMath.scale(quad0.p01, (1 - a0) * b0)), + deMath.scale(quad0.p11, a0 * b0)); + + for (var x1 = xBounds1[0]; x1 <= xBounds1[1]; x1 += searchStep) { + for (var y1 = yBounds1[0]; y1 <= yBounds1[1]; y1 += searchStep) { + /** @type {number} */ var a1 = Math.min(x1, xBounds1[1]); + /** @type {number} */ var b1 = Math.min(y1, yBounds1[1]); + /** @type {Array} */ + var c1 = deMath.add( + deMath.add( + deMath.add( + deMath.scale(quad1.p00, (1 - a1) * (1 - b1)), + deMath.scale(quad1.p10, a1 * (1 - b1))), + deMath.scale(quad1.p01, (1 - a1) * b1)), + deMath.scale(quad1.p11, a1 * b1)); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, zBounds, result)) + return true; + } + } + } + } + + return false; + }; + + /** + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexLookupVerifier.ColorQuad} quad00 + * @param {tcuTexLookupVerifier.ColorQuad} quad01 + * @param {tcuTexLookupVerifier.ColorQuad} quad10 + * @param {tcuTexLookupVerifier.ColorQuad} quad11 + * @param {Array} xBounds0 + * @param {Array} yBounds0 + * @param {Array} zBounds0 + * @param {Array} xBounds1 + * @param {Array} yBounds1 + * @param {Array} zBounds1 + * @param {Array} wBounds + * @param {number} searchStep + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.is3DTrilinearFilterResultValid = function(prec, quad00, quad01, quad10, quad11, xBounds0, yBounds0, zBounds0, xBounds1, yBounds1, zBounds1, wBounds, searchStep, result) { + assertMsgOptions(xBounds0[0] <= xBounds0[1], 'Out of bounds: X direction.', false, true); + assertMsgOptions(yBounds0[0] <= yBounds0[1], 'Out of bounds: Y direction.', false, true); + assertMsgOptions(zBounds0[0] <= zBounds0[1], 'Out of bounds: Z direction.', false, true); + assertMsgOptions(xBounds1[0] <= xBounds1[1], 'Out of bounds: X direction.', false, true); + assertMsgOptions(yBounds1[0] <= yBounds1[1], 'Out of bounds: Y direction.', false, true); + assertMsgOptions(zBounds1[0] <= zBounds1[1], 'Out of bounds: Z direction.', false, true); + + if (!tcuTexLookupVerifier.isInColorBounds_4Quad(prec, quad00, quad01, quad10, quad11, result)) + return false; + + function biInterp(result, p00, p01, p10, p11, s00, s01, s10, s11) { + for (var ii = 0; ii < 4; ++ii) { + result[ii] = p00[ii] * s00 + p10[ii] * s10 + p01[ii] * s01 + p11[ii] * s11; + } + } + + function interp(result, p0, p1, s) { + for (var ii = 0; ii < 4; ++ii) { + result[ii] = p0[ii] * (1 - s) + p1[ii] * s; + } + } + + /** @type {Array} */ var c00 = [0, 0, 0, 0]; + /** @type {Array} */ var c01 = [0, 0, 0, 0]; + /** @type {Array} */ var c10 = [0, 0, 0, 0]; + /** @type {Array} */ var c11 = [0, 0, 0, 0]; + /** @type {Array} */ var cz0 = [0, 0, 0, 0]; + /** @type {Array} */ var cz1 = [0, 0, 0, 0]; + + for (var x0 = xBounds0[0]; x0 < xBounds0[1] + searchStep; x0 += searchStep) { + for (var y0 = yBounds0[0]; y0 < yBounds0[1] + searchStep; y0 += searchStep) { + /** @type {number} */ var a0 = Math.min(x0, xBounds0[1]); + /** @type {number} */ var b0 = Math.min(y0, yBounds0[1]); + + /** @type {number} */ var s00 = (1 - a0) * (1 - b0); + /** @type {number} */ var s01 = (1 - a0) * b0; + /** @type {number} */ var s10 = a0 * (1 - b0); + /** @type {number} */ var s11 = a0 * b0; + + biInterp(c00, quad00.p00, quad00.p01, quad00.p10, quad00.p11, s00, s01, s10, s11); + biInterp(c01, quad01.p00, quad01.p01, quad01.p10, quad01.p11, s00, s01, s10, s11); + + for (var z0 = zBounds0[0]; z0 < zBounds0[1] + searchStep; z0 += searchStep) { + /** @type {number} */ var c0 = Math.min(z0, zBounds0[1]); + interp(cz0, c00, c01, c0); + + for (var x1 = xBounds1[0]; x1 < xBounds1[1] + searchStep; x1 += searchStep) { + for (var y1 = yBounds1[0]; y1 < yBounds1[1] + searchStep; y1 += searchStep) { + /** @type {number} */ var a1 = Math.min(x1, xBounds1[1]); + /** @type {number} */ var b1 = Math.min(y1, yBounds1[1]); + + /** @type {number} */ var t00 = (1 - a1) * (1 - b1); + /** @type {number} */ var t01 = (1 - a1) * b1; + /** @type {number} */ var t10 = a1 * (1 - b1); + /** @type {number} */ var t11 = a1 * b1; + + biInterp(c10, quad10.p00, quad10.p01, quad10.p10, quad10.p11, t00, t01, t10, t11); + biInterp(c11, quad11.p00, quad11.p01, quad11.p10, quad11.p11, t00, t01, t10, t11); + + for (var z1 = zBounds1[0]; z1 < zBounds1[1] + searchStep; z1 += searchStep) { + /** @type {number} */ var c1 = Math.min(z1, zBounds1[1]); + interp(cz1, c10, c11, c1); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, cz0, cz1, wBounds, result)) + return true; + } + } + } + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {number} coordX + * @param {number} coordY + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isNearestSampleResultValid_CoordXYAsNumber = function(level, sampler, prec, coordX, coordY, result) { + assertMsgOptions(level.getDepth() == 1, 'Depth must be 1.', false, true); + + /** @type {Array} */ + var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits[0], prec.uvwBits[0]); + + /** @type {number} */ var minI = Math.floor(uBounds[0]); + /** @type {number} */ var maxI = Math.floor(uBounds[1]); + + for (var i = minI; i <= maxI; i++) { + /** @type {number} */ var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth()); + /** @type {Array} */ var color; + if (tcuTexLookupVerifier.isSRGB(level.getFormat())) { + color = tcuTexLookupVerifier.lookupFloat(level, sampler, x, coordY, 0); + } else { + color = tcuTexLookupVerifier.lookupScalar(level, sampler, x, coordY, 0); + } + + if (tcuTexLookupVerifier.isColorValid(prec, color, result)) + return true; + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord vec2 + * @param {number} coordZ int + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt = function(level, sampler, prec, coord, coordZ, result) { + /** @type {Array} */ + var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI = Math.floor(uBounds[0]); + /** @type {number} */ var maxI = Math.floor(uBounds[1]); + /** @type {number} */ var minJ = Math.floor(vBounds[0]); + /** @type {number} */ var maxJ = Math.floor(vBounds[1]); + + // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode. + + for (var j = minJ; j <= maxJ; j++) + for (var i = minI; i <= maxI; i++) { + /** @type {number} */ var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth()); + /** @type {number} */ var y = tcuTexVerifierUtil.wrap(sampler.wrapT, j, level.getHeight()); + /** @type {Array} */ var color; + if (tcuTexLookupVerifier.isSRGB(level.getFormat())) { + color = tcuTexLookupVerifier.lookupFloat(level, sampler, x, y, coordZ); + } else { + color = tcuTexLookupVerifier.lookupScalar(level, sampler, x, y, coordZ); + } + + if (tcuTexLookupVerifier.isColorValid(prec, color, result)) + return true; + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord vec3 + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec3 = function(level, sampler, prec, coord, result) { + /** @type {Array} */ + var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var wBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getDepth(), coord[2], prec.coordBits[2], prec.uvwBits[2]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI = Math.floor(uBounds[0]); + /** @type {number} */ var maxI = Math.floor(uBounds[1]); + /** @type {number} */ var minJ = Math.floor(vBounds[0]); + /** @type {number} */ var maxJ = Math.floor(vBounds[1]); + /** @type {number} */ var minK = Math.floor(wBounds[0]); + /** @type {number} */ var maxK = Math.floor(wBounds[1]); + + // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode. + + for (var k = minK; k <= maxK; k++) { + for (var j = minJ; j <= maxJ; j++) { + for (var i = minI; i <= maxI; i++) { + /** @type {number} */ var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth()); + /** @type {number} */ var y = tcuTexVerifierUtil.wrap(sampler.wrapT, j, level.getHeight()); + /** @type {number} */ var z = tcuTexVerifierUtil.wrap(sampler.wrapR, k, level.getDepth()); + /** @type {Array} */ var color; + if (tcuTexLookupVerifier.isSRGB(level.getFormat())) { + color = tcuTexLookupVerifier.lookupFloat(level, sampler, x, y, z); + } else { + color = tcuTexLookupVerifier.lookupScalar(level, sampler, x, y, z); + } + + if (tcuTexLookupVerifier.isColorValid(prec, color, result)) + return true; + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {number} coordX + * @param {number} coordY + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLinearSampleResultValid_CoordXYAsNumber = function(level, sampler, prec, coordX, coordY, result) { + /** @type {Array} */ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits[0], prec.uvwBits[0]); + + /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5); + /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5); + + /** @type {number} */ var w = level.getWidth(); + + for (var i = minI; i <= maxI; i++) { + // Wrapped coordinates + /** @type {number} */ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w); + /** @type {number} */ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w); + + // Bounds for filtering factors + /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1); + /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1); + + /** @type {Array} */ var colorA = tcuTexLookupVerifier.lookupFloat(level, sampler, x0, coordY, 0); + /** @type {Array} */ var colorB = tcuTexLookupVerifier.lookupFloat(level, sampler, x1, coordY, 0); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, colorA, colorB, [minA, maxA], result)) + return true; + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord vec2 + * @param {number} coordZ int + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec2AndInt = function(level, sampler, prec, coord, coordZ, result) { + /** @type {Array} */ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinate bounds for (x0,y0) - without wrap mode + /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5); + /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5); + /** @type {number} */ var minJ = Math.floor(vBounds[0] - 0.5); + /** @type {number} */ var maxJ = Math.floor(vBounds[1] - 0.5); + + /** @type {number} */ var w = level.getWidth(); + /** @type {number} */ var h = level.getHeight(); + + /** @type {tcuTexture.TextureChannelClass} */ + var texClass = tcuTexture.getTextureChannelClass(level.getFormat().type); + + /** @type {number} */ + var searchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) : + (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) : + 0; // Step is computed for floating-point quads based on texel values. + + // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode. + + for (var j = minJ; j <= maxJ; j++) + for (var i = minI; i <= maxI; i++) { + // Wrapped coordinates + /** @type {number} */ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w); + /** @type {number} */ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w); + /** @type {number} */ var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j, h); + /** @type {number} */ var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j + 1, h); + + // Bounds for filtering factors + /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1); + /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1); + /** @type {number} */ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1); + /** @type {number} */ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1); + + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad = tcuTexLookupVerifier.lookupQuad(level, sampler, x0, x1, y0, y1, coordZ); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad); + + if (tcuTexLookupVerifier.isBilinearRangeValid(prec, quad, [minA, maxA], [minB, maxB], searchStep, result)) + return true; + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord vec3 + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec3 = function(level, sampler, prec, coord, result) { + /** @type {Array} */ + var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var wBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, level.getDepth(), coord[2], prec.coordBits[2], prec.uvwBits[2]); + + // Integer coordinate bounds for (x0,y0) - without wrap mode + /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5); + /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5); + /** @type {number} */ var minJ = Math.floor(vBounds[0] - 0.5); + /** @type {number} */ var maxJ = Math.floor(vBounds[1] - 0.5); + /** @type {number} */ var minK = Math.floor(wBounds[0] - 0.5); + /** @type {number} */ var maxK = Math.floor(wBounds[1] - 0.5); + + /** @type {number} */ var w = level.getWidth(); + /** @type {number} */ var h = level.getHeight(); + /** @type {number} */ var d = level.getDepth(); + + /** @type {tcuTexture.TextureChannelClass} */ + var texClass = tcuTexture.getTextureChannelClass(level.getFormat().type); + /** @type {number} */ + var searchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) : + (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) : + 0; // Step is computed for floating-point quads based on texel values. + + // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode. + + for (var k = minK; k <= maxK; k++) { + for (var j = minJ; j <= maxJ; j++) { + for (var i = minI; i <= maxI; i++) { + // Wrapped coordinates + /** @type {number} */ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w); + /** @type {number} */ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w); + /** @type {number} */ var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j, h); + /** @type {number} */ var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j + 1, h); + /** @type {number} */ var z0 = tcuTexVerifierUtil.wrap(sampler.wrapR, k, d); + /** @type {number} */ var z1 = tcuTexVerifierUtil.wrap(sampler.wrapR, k + 1, d); + + // Bounds for filtering factors + /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1); + /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1); + /** @type {number} */ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1); + /** @type {number} */ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1); + /** @type {number} */ var minC = deMath.clamp((wBounds[0] - 0.5) - k, 0, 1); + /** @type {number} */ var maxC = deMath.clamp((wBounds[1] - 0.5) - k, 0, 1); + + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad0 = tcuTexLookupVerifier.lookupQuad(level, sampler, x0, x1, y0, y1, z0); + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad1 = tcuTexLookupVerifier.lookupQuad(level, sampler, x0, x1, y0, y1, z1); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep = Math.min(tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad0), tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad1)); + + if (tcuTexLookupVerifier.isTrilinearRangeValid(prec, quad0, quad1, [minA, maxA], [minB, maxB], [minC, maxC], searchStep, result)) + return true; + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {number} coord + * @param {number} coordY + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordXYAsNumber = function(level0, level1, sampler, prec, coord, coordY, fBounds, result) { + /** @type {number} */ var w0 = level0.getWidth(); + /** @type {number} */ var w1 = level1.getWidth(); + + /** @type {Array} */ + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w0, coord, prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w1, coord, prec.coordBits[0], prec.uvwBits[0]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI0 = Math.floor(uBounds0[0]); + /** @type {number} */ var maxI0 = Math.floor(uBounds0[1]); + /** @type {number} */ var minI1 = Math.floor(uBounds1[0]); + /** @type {number} */ var maxI1 = Math.floor(uBounds1[1]); + + for (var i0 = minI0; i0 <= maxI0; i0++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + /** @type {Array} */ + var c0 = tcuTexLookupVerifier.lookupFloat(level0, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0), coordY, 0); + /** @type {Array} */ + var c1 = tcuTexLookupVerifier.lookupFloat(level1, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1), coordY, 0); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, fBounds, result)) + return true; + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {number} coordZ + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec2AndInt = function(level0, level1, sampler, prec, coord, coordZ, fBounds, result) { + /** @type {number} */ var w0 = level0.getWidth(); + /** @type {number} */ var w1 = level1.getWidth(); + /** @type {number} */ var h0 = level0.getHeight(); + /** @type {number} */ var h1 = level1.getHeight(); + + /** @type {Array} */ + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI0 = Math.floor(uBounds0[0]); + /** @type {number} */ var maxI0 = Math.floor(uBounds0[1]); + /** @type {number} */ var minI1 = Math.floor(uBounds1[0]); + /** @type {number} */ var maxI1 = Math.floor(uBounds1[1]); + /** @type {number} */ var minJ0 = Math.floor(vBounds0[0]); + /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1]); + /** @type {number} */ var minJ1 = Math.floor(vBounds1[0]); + /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1]); + + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + /** @type {Array} */ var c0 = tcuTexLookupVerifier.lookupFloat(level0, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0), tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0), coordZ); + /** @type {Array} */ var c1 = tcuTexLookupVerifier.lookupFloat(level1, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1), tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1), coordZ); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, fBounds, result)) + return true; + } + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec3 = function(level0, level1, sampler, prec, coord, fBounds, result) { + /** @type {number} */ var w0 = level0.getWidth(); + /** @type {number} */ var w1 = level1.getWidth(); + /** @type {number} */ var h0 = level0.getHeight(); + /** @type {number} */ var h1 = level1.getHeight(); + /** @type {number} */ var d0 = level0.getDepth(); + /** @type {number} */ var d1 = level1.getDepth(); + + /** @type {Array} */ + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var wBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, d0, coord[2], prec.coordBits[2], prec.uvwBits[2]); + /** @type {Array} */ + var wBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, d1, coord[2], prec.coordBits[2], prec.uvwBits[2]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI0 = Math.floor(uBounds0[0]); + /** @type {number} */ var maxI0 = Math.floor(uBounds0[1]); + /** @type {number} */ var minI1 = Math.floor(uBounds1[0]); + /** @type {number} */ var maxI1 = Math.floor(uBounds1[1]); + /** @type {number} */ var minJ0 = Math.floor(vBounds0[0]); + /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1]); + /** @type {number} */ var minJ1 = Math.floor(vBounds1[0]); + /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1]); + /** @type {number} */ var minK0 = Math.floor(wBounds0[0]); + /** @type {number} */ var maxK0 = Math.floor(wBounds0[1]); + /** @type {number} */ var minK1 = Math.floor(wBounds1[0]); + /** @type {number} */ var maxK1 = Math.floor(wBounds1[1]); + + for (var k0 = minK0; k0 <= maxK0; k0++) { + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + for (var k1 = minK1; k1 <= maxK1; k1++) { + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + /** @type {Array} */ var c0 = tcuTexLookupVerifier.lookupFloat(level0, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0), tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0), tcuTexVerifierUtil.wrap(sampler.wrapR, k0, d0)); + /** @type {Array} */ var c1 = tcuTexLookupVerifier.lookupFloat(level1, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1), tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1), tcuTexVerifierUtil.wrap(sampler.wrapR, k1, d1)); + + if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, fBounds, result)) + return true; + } + } + } + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {number} coordZ + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec2AndInt = function(level0, level1, sampler, prec, coord, coordZ, fBounds, result) { + // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent. + // Right now this allows pairing any two valid bilinear quads. + + /** @type {number} */ var w0 = level0.getWidth(); + /** @type {number} */ var w1 = level1.getWidth(); + /** @type {number} */ var h0 = level0.getHeight(); + /** @type {number} */ var h1 = level1.getHeight(); + + /** @type {Array} */ + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI0 = Math.floor(uBounds0[0] - 0.5); + /** @type {number} */ var maxI0 = Math.floor(uBounds0[1] - 0.5); + /** @type {number} */ var minI1 = Math.floor(uBounds1[0] - 0.5); + /** @type {number} */ var maxI1 = Math.floor(uBounds1[1] - 0.5); + /** @type {number} */ var minJ0 = Math.floor(vBounds0[0] - 0.5); + /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1] - 0.5); + /** @type {number} */ var minJ1 = Math.floor(vBounds1[0] - 0.5); + /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1] - 0.5); + + /** @type {tcuTexture.TextureChannelClass} */ + var texClass = tcuTexture.getTextureChannelClass(level0.getFormat().type); + /** @type {number} */ var cSearchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) : + (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) : + 0; // Step is computed for floating-point quads based on texel values. + + /** @type {number} */ var x0; + /** @type {number} */ var x1; + /** @type {number} */ var y0; + /** @type {number} */ var y1; + + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + /** @type {number} */ var searchStep0; + + x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0); + x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0 + 1, w0); + y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0); + y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0 + 1, h0); + + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad0 = tcuTexLookupVerifier.lookupQuad(level0, sampler, x0, x1, y0, y1, coordZ); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep0 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad0); + else + searchStep0 = cSearchStep; + + /** @type {number} */ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1); + /** @type {number} */ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1); + /** @type {number} */ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1); + /** @type {number} */ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1); + + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + /** @type {number} */ var searchStep1; + + x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1); + x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1 + 1, w1); + y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1); + y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1 + 1, h1); + + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad1 = tcuTexLookupVerifier.lookupQuad(level1, sampler, x0, x1, y0, y1, coordZ); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep1 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad1); + else + searchStep1 = cSearchStep; + + /** @type {number} */ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1); + /** @type {number} */ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1); + /** @type {number} */ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1); + /** @type {number} */ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1); + + if (tcuTexLookupVerifier.is2DTrilinearFilterResultValid(prec, quad0, quad1, [minA0, maxA0], [minB0, maxB0], [minA1, maxA1], [minB1, maxB1], + fBounds, Math.min(searchStep0, searchStep1), result)) + return true; + } + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec3 = function(level0, level1, sampler, prec, coord, fBounds, result) { + // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent. + // Right now this allows pairing any two valid bilinear quads. + + /** @type {number} */ var w0 = level0.getWidth(); + /** @type {number} */ var w1 = level1.getWidth(); + /** @type {number} */ var h0 = level0.getHeight(); + /** @type {number} */ var h1 = level1.getHeight(); + /** @type {number} */ var d0 = level0.getDepth(); + /** @type {number} */ var d1 = level1.getDepth(); + + /** @type {Array} */ + var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ + var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ + var wBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, d0, coord[2], prec.coordBits[2], prec.uvwBits[2]); + /** @type {Array} */ + var wBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds( + sampler.normalizedCoords, d1, coord[2], prec.coordBits[2], prec.uvwBits[2]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI0 = Math.floor(uBounds0[0] - 0.5); + /** @type {number} */ var maxI0 = Math.floor(uBounds0[1] - 0.5); + /** @type {number} */ var minI1 = Math.floor(uBounds1[0] - 0.5); + /** @type {number} */ var maxI1 = Math.floor(uBounds1[1] - 0.5); + /** @type {number} */ var minJ0 = Math.floor(vBounds0[0] - 0.5); + /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1] - 0.5); + /** @type {number} */ var minJ1 = Math.floor(vBounds1[0] - 0.5); + /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1] - 0.5); + /** @type {number} */ var minK0 = Math.floor(wBounds0[0] - 0.5); + /** @type {number} */ var maxK0 = Math.floor(wBounds0[1] - 0.5); + /** @type {number} */ var minK1 = Math.floor(wBounds1[0] - 0.5); + /** @type {number} */ var maxK1 = Math.floor(wBounds1[1] - 0.5); + + /** @type {tcuTexture.TextureChannelClass} */ + var texClass = tcuTexture.getTextureChannelClass(level0.getFormat().type); + /** @type {number} */ var cSearchStep = texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) : + texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) : + 0; // Step is computed for floating-point quads based on texel values. + + /** @type {number} */ var x0; + /** @type {number} */ var x1; + /** @type {number} */ var y0; + /** @type {number} */ var y1; + /** @type {number} */ var z0; + /** @type {number} */ var z1; + + for (var k0 = minK0; k0 <= maxK0; k0++) { + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + /** @type {number} */ var searchStep0; + + x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0); + x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0 + 1, w0); + y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0); + y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0 + 1, h0); + z0 = tcuTexVerifierUtil.wrap(sampler.wrapR, k0, d0); + z1 = tcuTexVerifierUtil.wrap(sampler.wrapR, k0 + 1, d0); + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad00 = tcuTexLookupVerifier.lookupQuad(level0, sampler, x0, x1, y0, y1, z0); + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad01 = tcuTexLookupVerifier.lookupQuad(level0, sampler, x0, x1, y0, y1, z1); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep0 = Math.min(tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad00), tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad01)); + else + searchStep0 = cSearchStep; + + /** @type {number} */ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1); + /** @type {number} */ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1); + /** @type {number} */ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1); + /** @type {number} */ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1); + /** @type {number} */ var minC0 = deMath.clamp((wBounds0[0] - 0.5) - k0, 0, 1); + /** @type {number} */ var maxC0 = deMath.clamp((wBounds0[1] - 0.5) - k0, 0, 1); + + for (var k1 = minK1; k1 <= maxK1; k1++) { + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + + /** @type {number} */ var searchStep1; + + x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1); + x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1 + 1, w1); + y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1); + y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1 + 1, h1); + z0 = tcuTexVerifierUtil.wrap(sampler.wrapR, k1, d1); + z1 = tcuTexVerifierUtil.wrap(sampler.wrapR, k1 + 1, d1); + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad10 = tcuTexLookupVerifier.lookupQuad(level1, sampler, x0, x1, y0, y1, z0); + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad11 = tcuTexLookupVerifier.lookupQuad(level1, sampler, x0, x1, y0, y1, z1); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep1 = Math.min(tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad10), tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad11)); + else + searchStep1 = cSearchStep; + + /** @type {number} */ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1); + /** @type {number} */ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1); + /** @type {number} */ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1); + /** @type {number} */ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1); + /** @type {number} */ var minC1 = deMath.clamp((wBounds1[0] - 0.5) - k1, 0, 1); + /** @type {number} */ var maxC1 = deMath.clamp((wBounds1[1] - 0.5) - k1, 0, 1); + + if (tcuTexLookupVerifier.is3DTrilinearFilterResultValid( + prec, quad00, quad01, quad10, quad11, + [minA0, maxA0], [minB0, maxB0], [minC0, maxC0], + [minA1, maxA1], [minB1, maxB1], [minC1, maxC1], + fBounds, Math.min(searchStep0, searchStep1), result)) + return true; + } + } + } + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filterMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {number} coordX + * @param {number} coordY + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLevelSampleResultValid_CoordXYAsNumber = function(level, sampler, filterMode, prec, coordX, coordY, result) { + if (filterMode == tcuTexture.FilterMode.LINEAR) + return tcuTexLookupVerifier.isLinearSampleResultValid_CoordXYAsNumber(level, sampler, prec, coordX, coordY, result); + else + return tcuTexLookupVerifier.isNearestSampleResultValid_CoordXYAsNumber(level, sampler, prec, coordX, coordY, result); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filterMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {number} coordZ + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt = function(level, sampler, filterMode, prec, coord, coordZ, result) { + if (filterMode == tcuTexture.FilterMode.LINEAR) + return tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec2AndInt(level, sampler, prec, coord, coordZ, result); + else + return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt(level, sampler, prec, coord, coordZ, result); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filterMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3 = function(level, sampler, filterMode, prec, coord, result) { + if (filterMode == tcuTexture.FilterMode.LINEAR) + return tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec3(level, sampler, prec, coord, result); + else + return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec3(level, sampler, prec, coord, result); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} levelFilter + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {number} coordZ + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec2AndInt = function(level0, level1, sampler, levelFilter, prec, coord, coordZ, fBounds, result) { + if (levelFilter == tcuTexture.FilterMode.LINEAR) + return tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec2AndInt(level0, level1, sampler, prec, coord, coordZ, fBounds, result); + else + return tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec2AndInt(level0, level1, sampler, prec, coord, coordZ, fBounds, result); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} level0 + * @param {tcuTexture.ConstPixelBufferAccess} level1 + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} levelFilter + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec3 = function(level0, level1, sampler, levelFilter, prec, coord, fBounds, result) { + if (levelFilter == tcuTexture.FilterMode.LINEAR) + return tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec3(level0, level1, sampler, prec, coord, fBounds, result); + else + return tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec3(level0, level1, sampler, prec, coord, fBounds, result); + }; + + /** + * @param {tcuTexture.Texture2DView} texture + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} lodBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLookupResultValid_Texture2DView = function(texture, sampler, prec, coord, lodBounds, result) { + /** @type {number} */ var minLod = lodBounds[0]; + /** @type {number} */ var maxLod = lodBounds[1]; + /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold; + /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold; + + assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true); + + /** @type {number} */ var minLevel; + /** @type {number} */ var maxLevel; + + if (canBeMagnified) + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, 0, result)) + return true; + + if (canBeMinified) { + /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter); + /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter); + /** @type {number} */ var minTexLevel = 0; + /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1; + + assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true); + + if (isLinearMipmap && minTexLevel < maxTexLevel) { + minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1); + maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + /** @type {number} */ var minF = deMath.clamp(minLod - level, 0, 1); + /** @type {number} */ var maxF = deMath.clamp(maxLod - level, 0, 1); + + if (tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, [minF, maxF], result)) + return true; + } + } else if (isNearestMipmap) { + // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made + // decision to allow floor(lod + 0.5) as well. + minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel); + maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, result)) + return true; + } + } else { + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, 0, result)) + return true; + } + } + + return false; + }; + + /** + * @param {tcuTexture.TextureCubeView} texture + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} lodBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLookupResultValid_TextureCubeView = function(texture, sampler, prec, coord, lodBounds, result) { + /** @type {number} */ var numPossibleFaces = 0; + + assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true); + + /** @type {Array} */ var possibleFaces = tcuTexVerifierUtil.getPossibleCubeFaces(coord, prec.coordBits); + + /** @type {number} */ var minLevel; + /** @type {number} */ var maxLevel; + + if (!possibleFaces) + return true; // Result is undefined. + + for (var tryFaceNdx = 0; tryFaceNdx < possibleFaces.length; tryFaceNdx++) { + /** @type {tcuTexture.CubeFaceCoords} */ + var faceCoords = new tcuTexture.CubeFaceCoords(possibleFaces[tryFaceNdx], tcuTexture.projectToFace(possibleFaces[tryFaceNdx], coord)); + /** @type {number} */ var minLod = lodBounds[0]; + /** @type {number} */ var maxLod = lodBounds[1]; + /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold; + /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold; + + /** @type {Array} */ var faces = []; + if (canBeMagnified) { + tcuTexLookupVerifier.getCubeLevelFaces(texture, 0, faces); + + if (tcuTexLookupVerifier.isCubeLevelSampleResultValid(faces, sampler, sampler.magFilter, prec, faceCoords, result)) + return true; + } + + if (canBeMinified) { + /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter); + /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter); + /** @type {number} */ var minTexLevel = 0; + /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1; + + assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true); + + if (isLinearMipmap && minTexLevel < maxTexLevel) { + minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1); + maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var levelNdx = minLevel; levelNdx <= maxLevel; levelNdx++) { + /** @type {number} */ var minF = deMath.clamp(minLod - levelNdx, 0, 1); + /** @type {number} */ var maxF = deMath.clamp(maxLod - levelNdx, 0, 1); + + /** @type {Array} */ var faces0 = []; + /** @type {Array} */ var faces1 = []; + + tcuTexLookupVerifier.getCubeLevelFaces(texture, levelNdx, faces0); + tcuTexLookupVerifier.getCubeLevelFaces(texture, levelNdx + 1, faces1); + + if (tcuTexLookupVerifier.isCubeMipmapLinearSampleResultValid(faces0, faces1, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, [minF, maxF], result)) + return true; + } + } else if (isNearestMipmap) { + // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made + // decision to allow floor(lod + 0.5) as well. + minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel); + maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var levelNdx = minLevel; levelNdx <= maxLevel; levelNdx++) { + tcuTexLookupVerifier.getCubeLevelFaces(texture, levelNdx, faces); + + if (tcuTexLookupVerifier.isCubeLevelSampleResultValid(faces, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, result)) + return true; + } + } else { + tcuTexLookupVerifier.getCubeLevelFaces(texture, 0, faces); + + if (tcuTexLookupVerifier.isCubeLevelSampleResultValid(faces, sampler, sampler.minFilter, prec, faceCoords, result)) + return true; + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.Texture2DArrayView} texture + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} lodBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLookupResultValid_Texture2DArrayView = function(texture, sampler, prec, coord, lodBounds, result) { + /** @type {Array} */ var layerRange = tcuTexLookupVerifier.computeLayerRange(texture.getNumLayers(), prec.coordBits[2], coord[2]); + /** @type {Array} */ var coordXY = deMath.swizzle(coord, [0, 1]); + /** @type {number} */ var minLod = lodBounds[0]; + /** @type {number} */ var maxLod = lodBounds[1]; + /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold; + /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold; + + assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true); + /** @type {number} */ var minLevel; + /** @type {number} */ var maxLevel; + + for (var layer = layerRange[0]; layer <= layerRange[1]; layer++) { + if (canBeMagnified) { + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.magFilter, prec, coordXY, layer, result)) + return true; + } + + if (canBeMinified) { + /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter); + /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter); + /** @type {number} */ var minTexLevel = 0; + /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1; + + assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true); + + if (isLinearMipmap && minTexLevel < maxTexLevel) { + minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1); + maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + /** @type {number} */ var minF = deMath.clamp(minLod - level, 0, 1); + /** @type {number} */ var maxF = deMath.clamp(maxLod - level, 0, 1); + + if (tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coordXY, layer, [minF, maxF], result)) + return true; + } + } else if (isNearestMipmap) { + // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made + // decision to allow floor(lod + 0.5) as well. + minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel); + maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coordXY, layer, result)) + return true; + } + } else { + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.minFilter, prec, coordXY, layer, result)) + return true; + } + } + } + + return false; + }; + + /** + * @param {tcuTexture.Texture3DView} texture + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} lodBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLookupResultValid = function(texture, sampler, prec, coord, lodBounds, result) { + /** @type {number} */ var minLod = lodBounds[0]; + /** @type {number} */ var maxLod = lodBounds[1]; + /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold; + /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold; + + assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true); + + /** @type {number} */ var minLevel; + /** @type {number} */ var maxLevel; + + if (canBeMagnified) + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, result)) + return true; + + if (canBeMinified) { + /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter); + /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter); + /** @type {number} */ var minTexLevel = 0; + /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1; + + assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true); + + if (isLinearMipmap && minTexLevel < maxTexLevel) { + minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1); + maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + /** @type {number} */ var minF = deMath.clamp(minLod - level, 0, 1); + /** @type {number} */ var maxF = deMath.clamp(maxLod - level, 0, 1); + + if (tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec3(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, [minF, maxF], result)) + return true; + } + } else if (isNearestMipmap) { + // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made + // decision to allow floor(lod + 0.5) as well. + minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel); + maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel); + + assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true); + + for (var level = minLevel; level <= maxLevel; level++) { + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, result)) + return true; + } + } else { + if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, result)) + return true; + } + } + + return false; + }; + + /** + * @param {Array} faces (&faces)[CUBEFACE_LAST] + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isSeamlessLinearSampleResultValid = function(faces, sampler, prec, coords, result) { + /** @type {number} */ var size = faces[coords.face].getWidth(); + + /** @type {Array} */ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinate bounds for (x0,y0) - without wrap mode + /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5); + /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5); + /** @type {number} */ var minJ = Math.floor(vBounds[0] - 0.5); + /** @type {number} */ var maxJ = Math.floor(vBounds[1] - 0.5); + + /** @type {tcuTexture.TextureChannelClass} */ var texClass = tcuTexture.getTextureChannelClass(faces[coords.face].getFormat().type); + /** @type {number} */ var searchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) : + (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) : + 0; // Step is computed for floating-point quads based on texel values. + + for (var j = minJ; j <= maxJ; j++) { + for (var i = minI; i <= maxI; i++) { + /** @type {tcuTexture.CubeFaceCoords} */ var c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 0]), size); + /** @type {tcuTexture.CubeFaceCoords} */ var c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 0]), size); + /** @type {tcuTexture.CubeFaceCoords} */ var c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 1]), size); + /** @type {tcuTexture.CubeFaceCoords} */ var c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 1]), size); + + // If any of samples is out of both edges, implementations can do pretty much anything according to spec. + // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color. + if (c00 == null || c01 == null || c10 == null || c11 == null || + c00.face == null || c01.face == null || c10.face == null || c11.face == null) + return true; + + // Bounds for filtering factors + /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1); + /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1); + /** @type {number} */ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1); + /** @type {number} */ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1); + + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad = new tcuTexLookupVerifier.ColorQuad([], [], [], []); + quad.p00 = tcuTexLookupVerifier.lookupFloat(faces[c00.face], sampler, c00.s, c00.t, 0); + quad.p10 = tcuTexLookupVerifier.lookupFloat(faces[c10.face], sampler, c10.s, c10.t, 0); + quad.p01 = tcuTexLookupVerifier.lookupFloat(faces[c01.face], sampler, c01.s, c01.t, 0); + quad.p11 = tcuTexLookupVerifier.lookupFloat(faces[c11.face], sampler, c11.s, c11.t, 0); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad); + + if (tcuTexLookupVerifier.isBilinearRangeValid(prec, quad, [minA, maxA], [minB, maxB], searchStep, result)) + return true; + } + } + + return false; + }; + + /** + * @param {Array} faces0 (&faces0)[CUBEFACE_LAST] + * @param {Array} faces1 (&faces1)[CUBEFACE_LAST] + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isSeamplessLinearMipmapLinearSampleResultValid = function(faces0, faces1, sampler, prec, coords, fBounds, result) { + // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent. + // Right now this allows pairing any two valid bilinear quads. + /** @type {number} */ var size0 = faces0[coords.face].getWidth(); + /** @type {number} */ var size1 = faces1[coords.face].getWidth(); + + /** @type {Array} */ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.s, prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.s, prec.coordBits[0], prec.uvwBits[0]); + /** @type {Array} */ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.t, prec.coordBits[1], prec.uvwBits[1]); + /** @type {Array} */ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.t, prec.coordBits[1], prec.uvwBits[1]); + + // Integer coordinates - without wrap mode + /** @type {number} */ var minI0 = Math.floor(uBounds0[0] - 0.5); + /** @type {number} */ var maxI0 = Math.floor(uBounds0[1] - 0.5); + /** @type {number} */ var minI1 = Math.floor(uBounds1[0] - 0.5); + /** @type {number} */ var maxI1 = Math.floor(uBounds1[1] - 0.5); + /** @type {number} */ var minJ0 = Math.floor(vBounds0[0] - 0.5); + /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1] - 0.5); + /** @type {number} */ var minJ1 = Math.floor(vBounds1[0] - 0.5); + /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1] - 0.5); + + /** @type {tcuTexture.TextureChannelClass} */ var texClass = tcuTexture.getTextureChannelClass(faces0[coords.face].getFormat().type); + /** @type {number} */ var cSearchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) : + (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) : + 0; // Step is computed for floating-point quads based on texel values. + + /** @type {tcuTexture.CubeFaceCoords} */ var c00; + /** @type {tcuTexture.CubeFaceCoords} */ var c10; + /** @type {tcuTexture.CubeFaceCoords} */ var c01; + /** @type {tcuTexture.CubeFaceCoords} */ var c11; + + for (var j0 = minJ0; j0 <= maxJ0; j0++) { + for (var i0 = minI0; i0 <= maxI0; i0++) { + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad0 = new tcuTexLookupVerifier.ColorQuad([], [], [], []); + /** @type {number} */ var searchStep0; + + c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 0]), size0); + c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 0]), size0); + c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 1]), size0); + c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 1]), size0); + + // If any of samples is out of both edges, implementations can do pretty much anything according to spec. + // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color. + if (c00 == null || c01 == null || c10 == null || c11 == null || + c00.face == null || c01.face == null || c10.face == null || c11.face == null) + return true; + + quad0.p00 = tcuTexLookupVerifier.lookupFloat(faces0[c00.face], sampler, c00.s, c00.t, 0); + quad0.p10 = tcuTexLookupVerifier.lookupFloat(faces0[c10.face], sampler, c10.s, c10.t, 0); + quad0.p01 = tcuTexLookupVerifier.lookupFloat(faces0[c01.face], sampler, c01.s, c01.t, 0); + quad0.p11 = tcuTexLookupVerifier.lookupFloat(faces0[c11.face], sampler, c11.s, c11.t, 0); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep0 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad0); + else + searchStep0 = cSearchStep; + + /** @type {number} */ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1); + /** @type {number} */ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1); + /** @type {number} */ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1); + /** @type {number} */ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1); + + for (var j1 = minJ1; j1 <= maxJ1; j1++) { + for (var i1 = minI1; i1 <= maxI1; i1++) { + /** @type {tcuTexLookupVerifier.ColorQuad} */ + var quad1 = new tcuTexLookupVerifier.ColorQuad([], [], [], []); + /** @type {number} */ var searchStep1; + + c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 0]), size1); + c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 0]), size1); + c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 1]), size1); + c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 1]), size1); + + if (c00 == null || c01 == null || c10 == null || c11 == null || + c00.face == null || c01.face == null || c10.face == null || c11.face == null) + return true; + + quad1.p00 = tcuTexLookupVerifier.lookupFloat(faces1[c00.face], sampler, c00.s, c00.t, 0); + quad1.p10 = tcuTexLookupVerifier.lookupFloat(faces1[c10.face], sampler, c10.s, c10.t, 0); + quad1.p01 = tcuTexLookupVerifier.lookupFloat(faces1[c01.face], sampler, c01.s, c01.t, 0); + quad1.p11 = tcuTexLookupVerifier.lookupFloat(faces1[c11.face], sampler, c11.s, c11.t, 0); + + if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + searchStep1 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad1); + else + searchStep1 = cSearchStep; + + /** @type {number} */ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1); + /** @type {number} */ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1); + /** @type {number} */ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1); + /** @type {number} */ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1); + + if (tcuTexLookupVerifier.is2DTrilinearFilterResultValid(prec, quad0, quad1, [minA0, maxA0], [minB0, maxB0], [minA1, maxA1], [minB1, maxB1], + fBounds, Math.min(searchStep0, searchStep1), result)) + return true; + } + } + } + } + + return false; + }; + + /** + * @param {Array} level (&level)[CUBEFACE_LAST] + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filterMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isCubeLevelSampleResultValid = function(level, sampler, filterMode, prec, coords, result) { + if (filterMode == tcuTexture.FilterMode.LINEAR) { + if (sampler.seamlessCubeMap) + return tcuTexLookupVerifier.isSeamlessLinearSampleResultValid(level, sampler, prec, coords, result); + else + return tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec2AndInt(level[coords.face], sampler, prec, [coords.s, coords.t], 0, result); + } else + return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt(level[coords.face], sampler, prec, [coords.s, coords.t], 0, result); + }; + + /** + * @param {Array} faces0 (&faces0)[CUBEFACE_LAST] + * @param {Array} faces1 (&faces1)[CUBEFACE_LAST] + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} levelFilter + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {tcuTexture.CubeFaceCoords} coords + * @param {Array} fBounds + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isCubeMipmapLinearSampleResultValid = function(faces0, faces1, sampler, levelFilter, prec, coords, fBounds, result) { + if (levelFilter == tcuTexture.FilterMode.LINEAR) { + if (sampler.seamlessCubeMap) + return tcuTexLookupVerifier.isSeamplessLinearMipmapLinearSampleResultValid(faces0, faces1, sampler, prec, coords, fBounds, result); + else + return tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec2AndInt(faces0[coords.face], faces1[coords.face], sampler, prec, [coords.s, coords.t], 0, fBounds, result); + } else + return tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec2AndInt(faces0[coords.face], faces1[coords.face], sampler, prec, [coords.s, coords.t], 0, fBounds, result); + }; + + /** + * @param {tcuTexture.TextureCubeView} texture + * @param {number} levelNdx + * @param {Array} out (&out)[CUBEFACE_LAST] + */ + tcuTexLookupVerifier.getCubeLevelFaces = function(texture, levelNdx, out) { + for (var faceNdx = 0; faceNdx < 6; faceNdx++) + out[faceNdx] = texture.getLevelFace(levelNdx, /** @type {tcuTexture.CubeFace} */ (faceNdx)); + }; + + /** + * @param {number} numLayers + * @param {number} numCoordBits + * @param {number} layerCoord + * @return {Array} + */ + tcuTexLookupVerifier.computeLayerRange = function(numLayers, numCoordBits, layerCoord) { + /** @type {number} */ var err = tcuTexVerifierUtil.computeFloatingPointError(layerCoord, numCoordBits); + /** @type {number} */ var minL = Math.floor(layerCoord - err + 0.5); // Round down + /** @type {number} */ var maxL = Math.ceil(layerCoord + err + 0.5) - 1; // Round up + + assertMsgOptions(minL <= maxL, 'minL > maxL', false, true); + + return [deMath.clamp(minL, 0, numLayers - 1), deMath.clamp(maxL, 0, numLayers - 1)]; + }; + + /** + * @param {Array} bits + * @return {Array} + */ + tcuTexLookupVerifier.computeFixedPointThreshold = function(bits) { + return tcuTexVerifierUtil.computeFixedPointError_Vector(bits); + }; + + /** + * @param {Array} bits + * @param {Array} value + * @return {Array} + */ + tcuTexLookupVerifier.computeFloatingPointThreshold = function(bits, value) { + return tcuTexVerifierUtil.computeFloatingPointError_Vector(value, bits); + }; + + /** + * @param {number} dudx + * @param {number} dvdx + * @param {number} dwdx + * @param {number} dudy + * @param {number} dvdy + * @param {number} dwdy + * @param {tcuTexLookupVerifier.LodPrecision} prec + * @return {Array} + */ + tcuTexLookupVerifier.computeLodBoundsFromDerivates = function(dudx, dvdx, dwdx, dudy, dvdy, dwdy, prec) { + /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy)); + /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy)); + /** @type {number} */ var mw = Math.max(Math.abs(dwdx), Math.abs(dwdy)); + /** @type {number} */ var minDBound = Math.max(Math.max(mu, mv), mw); + /** @type {number} */ var maxDBound = mu + mv + mw; + /** @type {number} */ var minDErr = tcuTexVerifierUtil.computeFloatingPointError(minDBound, prec.derivateBits); + /** @type {number} */ var maxDErr = tcuTexVerifierUtil.computeFloatingPointError(maxDBound, prec.derivateBits); + /** @type {number} */ var minLod = Math.log2(minDBound - minDErr); + /** @type {number} */ var maxLod = Math.log2(maxDBound + maxDErr); + /** @type {number} */ var lodErr = tcuTexVerifierUtil.computeFixedPointError(prec.lodBits); + + assertMsgOptions(minLod <= maxLod, 'Error: minLod > maxLod', false, true); + return [minLod - lodErr, maxLod + lodErr]; + }; + + /** + * @param {number} dudx + * @param {number} dvdx + * @param {number} dudy + * @param {number} dvdy + * @param {tcuTexLookupVerifier.LodPrecision} prec + * @return {Array} + */ + tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV = function(dudx, dvdx, dudy, dvdy, prec) { + return tcuTexLookupVerifier.computeLodBoundsFromDerivates(dudx, dvdx, 0, dudy, dvdy, 0, prec); + }; + + /** + * @param {number} dudx + * @param {number} dudy + * @param {tcuTexLookupVerifier.LodPrecision} prec + * @return {Array} + */ + tcuTexLookupVerifier.computeLodBoundsFromDerivatesU = function(dudx, dudy, prec) { + return tcuTexLookupVerifier.computeLodBoundsFromDerivates(dudx, 0, 0, dudy, 0, 0, prec); + }; + + /** + * @param {Array} coord + * @param {Array} coordDx + * @param {Array} coordDy + * @param {number} faceSize + * @param {tcuTexLookupVerifier.LodPrecision} prec + * @return {Array} + */ + tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates = function(coord, coordDx, coordDy, faceSize, prec) { + /** @type {boolean} */ var allowBrokenEdgeDerivate = false; + /** @type {tcuTexture.CubeFace} */ var face = tcuTexture.selectCubeFace(coord); + /** @type {number} */ var maNdx = 0; + /** @type {number} */ var sNdx = 0; + /** @type {number} */ var tNdx = 0; + + // \note Derivate signs don't matter when computing lod + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: maNdx = 0; sNdx = 2; tNdx = 1; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: maNdx = 1; sNdx = 0; tNdx = 2; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: maNdx = 2; sNdx = 0; tNdx = 1; break; + default: + throw new Error('Invalid CubeFace.'); + } + + /** @type {number} */ var sc = coord[sNdx]; + /** @type {number} */ var tc = coord[tNdx]; + /** @type {number} */ var ma = Math.abs(coord[maNdx]); + /** @type {number} */ var scdx = coordDx[sNdx]; + /** @type {number} */ var tcdx = coordDx[tNdx]; + /** @type {number} */ var madx = Math.abs(coordDx[maNdx]); + /** @type {number} */ var scdy = coordDy[sNdx]; + /** @type {number} */ var tcdy = coordDy[tNdx]; + /** @type {number} */ var mady = Math.abs(coordDy[maNdx]); + /** @type {number} */ var dudx = faceSize * 0.5 * (scdx * ma - sc * madx) / (ma * ma); + /** @type {number} */ var dvdx = faceSize * 0.5 * (tcdx * ma - tc * madx) / (ma * ma); + /** @type {number} */ var dudy = faceSize * 0.5 * (scdy * ma - sc * mady) / (ma * ma); + /** @type {number} */ var dvdy = faceSize * 0.5 * (tcdy * ma - tc * mady) / (ma * ma); + /** @type {Array} */ var bounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(dudx, dvdx, dudy, dvdy, prec); + + // Implementations may compute derivate from projected (s, t) resulting in incorrect values at edges. + if (allowBrokenEdgeDerivate) { + /** @type {Array} */ var dxErr = tcuTexVerifierUtil.computeFloatingPointError_Vector(coordDx, [prec.derivateBits, prec.derivateBits, prec.derivateBits]); + /** @type {Array} */ var dyErr = tcuTexVerifierUtil.computeFloatingPointError_Vector(coordDy, [prec.derivateBits, prec.derivateBits, prec.derivateBits]); + /** @type {Array} */ var xoffs = deMath.add(deMath.abs(coordDx), dxErr); + /** @type {Array} */ var yoffs = deMath.add(deMath.abs(coordDy), dyErr); + + if (tcuTexture.selectCubeFace(deMath.add(coord, xoffs)) != face || + tcuTexture.selectCubeFace(deMath.subtract(coord, xoffs)) != face || + tcuTexture.selectCubeFace(deMath.add(coord, yoffs)) != face || + tcuTexture.selectCubeFace(deMath.subtract(coord, yoffs)) != face) { + return [bounds[0], 1000]; + } + } + + return bounds; + }; + + /** + * @param {Array} lodBounds + * @param {Array} lodMinMax + * @param {tcuTexLookupVerifier.LodPrecision} prec + * @return {Array} + */ + tcuTexLookupVerifier.clampLodBounds = function(lodBounds, lodMinMax, prec) { + /** @type {number} */ var lodErr = tcuTexVerifierUtil.computeFixedPointError(prec.lodBits); + /** @type {number} */ var a = lodMinMax[0]; + /** @type {number} */ var b = lodMinMax[1]; + return [deMath.clamp(lodBounds[0], a - lodErr, b - lodErr), deMath.clamp(lodBounds[1], a + lodErr, b + lodErr)]; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {number} coordZ + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLevel2DLookupResultValid = function(access, sampler, scaleMode, prec, coord, coordZ, result) { + /** @type {tcuTexture.FilterMode} */ + var filterMode = (scaleMode == tcuTexLookupVerifier.TexLookupScaleMode.MAGNIFY) ? sampler.magFilter : sampler.minFilter; + return tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(access, sampler, filterMode, prec, coord, coordZ, result); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {number} coordZ + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLevel2DLookupResultValid_Int = function(access, sampler, scaleMode, prec, coord, coordZ, result) { + assertMsgOptions(sampler.minFilter == tcuTexture.FilterMode.NEAREST && sampler.magFilter == tcuTexture.FilterMode.NEAREST, 'minFilter and magFilter must be NEAREST', false, true); + return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt(access, sampler, prec, coord, coordZ, result); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLevel3DLookupResultValid = function(access, sampler, scaleMode, prec, coord, result) { + /** @type {tcuTexture.FilterMode} */ + var filterMode = (scaleMode == tcuTexLookupVerifier.TexLookupScaleMode.MAGNIFY) ? sampler.magFilter : sampler.minFilter; + return tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(access, sampler, filterMode, prec, coord, result); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode + * @param {tcuTexLookupVerifier.LookupPrecision} prec + * @param {Array} coord + * @param {Array} result + * @return {boolean} + */ + tcuTexLookupVerifier.isLevel3DLookupResultValid_Int = function(access, sampler, scaleMode, prec, coord, result) { + assertMsgOptions(sampler.minFilter == tcuTexture.FilterMode.NEAREST && sampler.magFilter == tcuTexture.FilterMode.NEAREST, 'minFilter and magFilter must be NEAREST', false, true); + return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec3(access, sampler, prec, coord, result); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js new file mode 100644 index 000000000..4c88f4460 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js @@ -0,0 +1,265 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuTexVerifierUtil'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deUtil'); + +goog.scope(function() { + + var tcuTexVerifierUtil = framework.common.tcuTexVerifierUtil; + var deMath = framework.delibs.debase.deMath; + var deUtil = framework.delibs.debase.deUtil; + var tcuFloat = framework.common.tcuFloat; + var tcuTexture = framework.common.tcuTexture; + + /** + * @param {number} value + * @param {number} numAccurateBits + * @return {number} + */ + tcuTexVerifierUtil.computeFloatingPointError = function(value, numAccurateBits) { + /** @type {number} */ var numGarbageBits = 23 - numAccurateBits; + /** @type {number} */ var mask = (1 << numGarbageBits) - 1; + /** @type {number} */ var exp = tcuFloat.newFloat32(value).exponent(); + + /** @type {tcuFloat.deFloat} */ var v1 = new tcuFloat.deFloat(); + /** @type {tcuFloat.deFloat} */ var v2 = new tcuFloat.deFloat(); + return v1.construct(1, exp, 1 << 23 | mask).getValue() - v2.construct(1, exp, 1 << 23).getValue(); + }; + + /** + * @param {number} numAccurateBits + * @return {number} + */ + tcuTexVerifierUtil.computeFixedPointError = function(numAccurateBits) { + return tcuTexVerifierUtil.computeFloatingPointError(1.0, numAccurateBits); + }; + + /** + * @param {Array} numAccurateBits + * @return {Array} + */ + tcuTexVerifierUtil.computeFixedPointError_Vector = function(numAccurateBits) { + /** @type {Array} */ var res = []; + for (var ndx = 0; ndx < numAccurateBits.length; ndx++) + res[ndx] = tcuTexVerifierUtil.computeFixedPointError(numAccurateBits[ndx]); + return res; + }; + + /** + * @param {Array} value + * @param {Array} numAccurateBits + * @return {Array} + */ + tcuTexVerifierUtil.computeFloatingPointError_Vector = function(value, numAccurateBits) { + assertMsgOptions(value.length === numAccurateBits.length, '', false, true); + /** @type {Array} */ var res = []; + for (var ndx = 0; ndx < value.length; ndx++) + res[ndx] = tcuTexVerifierUtil.computeFloatingPointError(value[ndx], numAccurateBits[ndx]); + return res; + }; + + // Sampler introspection + + /** + * @param {tcuTexture.FilterMode} mode + * @return {boolean} + */ + tcuTexVerifierUtil.isNearestMipmapFilter = function(mode) { + return mode == tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST; + }; + + /** + * @param {tcuTexture.FilterMode} mode + * @return {boolean} + */ + tcuTexVerifierUtil.isLinearMipmapFilter = function(mode) { + return mode == tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR; + }; + + /** + * @param {tcuTexture.FilterMode} mode + * @return {boolean} + */ + tcuTexVerifierUtil.isMipmapFilter = function(mode) { + return tcuTexVerifierUtil.isNearestMipmapFilter(mode) || tcuTexVerifierUtil.isLinearMipmapFilter(mode); + }; + + /** + * @param {tcuTexture.FilterMode} mode + * @return {boolean} + */ + tcuTexVerifierUtil.isLinearFilter = function(mode) { + return mode == tcuTexture.FilterMode.LINEAR || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR; + }; + + /** + * @param {tcuTexture.FilterMode} mode + * @return {boolean} + */ + tcuTexVerifierUtil.isNearestFilter = function(mode) { + return !tcuTexVerifierUtil.isLinearFilter(mode); + }; + + /** + * @param {tcuTexture.FilterMode} mode + * @return {tcuTexture.FilterMode} + */ + tcuTexVerifierUtil.getLevelFilter = function(mode) { + return tcuTexVerifierUtil.isLinearFilter(mode) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + }; + + /** + * @param {tcuTexture.WrapMode} mode + * @return {boolean} + */ + tcuTexVerifierUtil.isWrapModeSupported = function(mode) { + return mode != tcuTexture.WrapMode.MIRRORED_REPEAT_CL && mode != tcuTexture.WrapMode.REPEAT_CL; + }; + + /** + * + * @param {boolean} normalizedCoords + * @param {number} dim + * @param {number} coord + * @param {number} coordBits + * @param {number} uvBits + * @return {Array} + */ + tcuTexVerifierUtil.computeNonNormalizedCoordBounds = function(normalizedCoords, dim, coord, coordBits, uvBits) { + /** @type {number} */ var coordErr = tcuTexVerifierUtil.computeFloatingPointError(coord, coordBits); + /** @type {number} */ var minN = coord - coordErr; + /** @type {number} */ var maxN = coord + coordErr; + /** @type {number} */ var minA = normalizedCoords ? minN * dim : minN; + /** @type {number} */ var maxA = normalizedCoords ? maxN * dim : maxN; + /** @type {number} */ var minC = minA - tcuTexVerifierUtil.computeFixedPointError(uvBits); + /** @type {number} */ var maxC = maxA + tcuTexVerifierUtil.computeFixedPointError(uvBits); + assertMsgOptions(minC <= maxC, '', false, true); + return [minC, maxC]; + }; + + /** + * @param {Array} coord + * @param {Array} bits + * @return {?Array} + */ + tcuTexVerifierUtil.getPossibleCubeFaces = function(coord, bits) { + + /** @type {Array} */ var faces = []; + + /** @type {number} */ var x = coord[0]; + /** @type {number} */ var y = coord[1]; + /** @type {number} */ var z = coord[2]; + /** @type {number} */ var ax = Math.abs(x); + /** @type {number} */ var ay = Math.abs(y); + /** @type {number} */ var az = Math.abs(z); + /** @type {number} */ var ex = tcuTexVerifierUtil.computeFloatingPointError(x, bits[0]); + /** @type {number} */ var ey = tcuTexVerifierUtil.computeFloatingPointError(y, bits[1]); + /** @type {number} */ var ez = tcuTexVerifierUtil.computeFloatingPointError(z, bits[2]); + /** @type {number} */ var numFaces = 0; + + if (ay + ey < ax - ex && az + ez < ax - ex) { + if (x >= ex) faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X); + if (x <= ex) faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X); + } else if (ax + ex < ay - ey && az + ez < ay - ey) { + if (y >= ey) faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y); + if (y <= ey) faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y); + } else if (ax + ex < az - ez && ay + ey < az - ez) { + if (z >= ez) faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z); + if (z <= ez) faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z); + } else { + // One or more components are equal (or within error bounds). Allow all faces where major axis is not zero. + if (ax > ex) { + faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X); + faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X); + } + + if (ay > ey) { + faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y); + faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y); + } + + if (az > ez) { + faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z); + faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z); + } + } + + return faces.length == 0 ? null : faces; + }; + + /** + * @param {tcuTexture.Sampler} sampler + * @return {tcuTexture.Sampler} + */ + tcuTexVerifierUtil.getUnnormalizedCoordSampler = function(sampler) { + var copy = /** @type {tcuTexture.Sampler} */ (deUtil.clone(sampler)); + copy.normalizedCoords = false; + return copy; + }; + + /** + * @param {number} a + * @param {number} b + * @return {number} + */ + tcuTexVerifierUtil.imod = function(a, b) { + return deMath.imod(a, b); + }; + + /** + * @param {number} a + * @return {number} + */ + tcuTexVerifierUtil.mirror = function(a) { + return deMath.mirror(a); + }; + + /** + * @param {tcuTexture.WrapMode} mode + * @param {number} c + * @param {number} size + * @return {number} + */ + tcuTexVerifierUtil.wrap = function(mode, c, size) { + switch (mode) { + // \note CL and GL modes are handled identically here, as verification process accounts for + // accuracy differences caused by different methods (wrapping vs. denormalizing first). + case tcuTexture.WrapMode.CLAMP_TO_EDGE: + return deMath.clamp(c, 0, size - 1); + + case tcuTexture.WrapMode.REPEAT_GL: + case tcuTexture.WrapMode.REPEAT_CL: + return deMath.imod(c, size); + + case tcuTexture.WrapMode.MIRRORED_REPEAT_GL: + case tcuTexture.WrapMode.MIRRORED_REPEAT_CL: + return (size - 1) - deMath.mirror(deMath.imod(c, 2 * size) - size); + + default: + throw new Error('Wrap mode not supported.'); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js new file mode 100644 index 000000000..8a3a2ed1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js @@ -0,0 +1,3636 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuTexture'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); + +goog.scope(function() { + +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var tcuFloat = framework.common.tcuFloat; +var deString = framework.delibs.debase.deString; +var deUtil = framework.delibs.debase.deUtil; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +/** + * Texture tcuTexture.channel order + * @enum + */ +tcuTexture.ChannelOrder = { + R: 0, + A: 1, + I: 2, + L: 3, + LA: 4, + RG: 5, + RA: 6, + RGB: 7, + RGBA: 8, + ARGB: 9, + BGRA: 10, + + sRGB: 11, + sRGBA: 12, + + D: 13, + S: 14, + DS: 15 +}; + +/** + * Texture tcuTexture.channel type + * @enum + */ +tcuTexture.ChannelType = { + SNORM_INT8: 0, + SNORM_INT16: 1, + SNORM_INT32: 2, + UNORM_INT8: 3, + UNORM_INT16: 4, + UNORM_INT32: 5, + UNORM_SHORT_565: 6, + UNORM_SHORT_555: 7, + UNORM_SHORT_4444: 8, + UNORM_SHORT_5551: 9, + UNORM_INT_101010: 10, + UNORM_INT_1010102_REV: 11, + UNSIGNED_INT_1010102_REV: 12, + UNSIGNED_INT_11F_11F_10F_REV: 13, + UNSIGNED_INT_999_E5_REV: 14, + UNSIGNED_INT_24_8: 15, + SIGNED_INT8: 16, + SIGNED_INT16: 17, + SIGNED_INT32: 18, + UNSIGNED_INT8: 19, + UNSIGNED_INT16: 20, + UNSIGNED_INT32: 21, + HALF_FLOAT: 22, + FLOAT: 23, + FLOAT_UNSIGNED_INT_24_8_REV: 24 +}; + +/** + * Enums for tcuTexture.TextureChannelClass + * @enum {number} + */ +tcuTexture.TextureChannelClass = { + + SIGNED_FIXED_POINT: 0, + UNSIGNED_FIXED_POINT: 1, + SIGNED_INTEGER: 2, + UNSIGNED_INTEGER: 3, + FLOATING_POINT: 4 +}; + +/** + * @param {?tcuTexture.ChannelType} channelType + * @return {tcuTexture.TextureChannelClass} + */ +tcuTexture.getTextureChannelClass = function(channelType) { + + switch (channelType) { + case tcuTexture.ChannelType.SNORM_INT8: return tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT; + case tcuTexture.ChannelType.SNORM_INT16: return tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_INT8: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_INT16: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_SHORT_565: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_SHORT_555: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_SHORT_4444: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_SHORT_5551: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_INT_101010: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return tcuTexture.TextureChannelClass.FLOATING_POINT; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return tcuTexture.TextureChannelClass.FLOATING_POINT; + case tcuTexture.ChannelType.SIGNED_INT8: return tcuTexture.TextureChannelClass.SIGNED_INTEGER; + case tcuTexture.ChannelType.SIGNED_INT16: return tcuTexture.TextureChannelClass.SIGNED_INTEGER; + case tcuTexture.ChannelType.SIGNED_INT32: return tcuTexture.TextureChannelClass.SIGNED_INTEGER; + case tcuTexture.ChannelType.UNSIGNED_INT8: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER; + case tcuTexture.ChannelType.UNSIGNED_INT16: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER; + case tcuTexture.ChannelType.UNSIGNED_INT32: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER; + case tcuTexture.ChannelType.HALF_FLOAT: return tcuTexture.TextureChannelClass.FLOATING_POINT; + case tcuTexture.ChannelType.FLOAT: return tcuTexture.TextureChannelClass.FLOATING_POINT; + default: return /** @type {tcuTexture.TextureChannelClass} */ (Object.keys(tcuTexture.ChannelType).length); + } +}; + +/** + * @param {tcuTexture.TextureFormat} format + */ +tcuTexture.isFixedPointDepthTextureFormat = function(format) { + var channelClass = tcuTexture.getTextureChannelClass(format.type); + + if (format.order == tcuTexture.ChannelOrder.D) { + // depth internal formats cannot be non-normalized integers + return channelClass != tcuTexture.TextureChannelClass.FLOATING_POINT; + } else if (format.order == tcuTexture.ChannelOrder.DS) { + // combined formats have no single channel class, detect format manually + switch (format.type) { + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return false; + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return true; + + default: + // unknown format + DE_ASSERT(false); + return true; + } + } + return false; +}; + +/** + * @param {Array} color + * @param {tcuTexture.CompareMode} compare + * @param {number} chanNdx + * @param {number} ref_ + * @param {boolean} isFixedPoint + */ +tcuTexture.execCompare = function(color, compare, chanNdx, ref_, isFixedPoint) { + var clampValues = isFixedPoint; + var cmp = clampValues ? deMath.clamp(color[chanNdx], 0.0, 1.0) : color[chanNdx]; + var ref = clampValues ? deMath.clamp(ref_, 0.0, 1.0) : ref_; + var res = false; + + switch (compare) { + case tcuTexture.CompareMode.COMPAREMODE_LESS: res = ref < cmp; break; + case tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL: res = ref <= cmp; break; + case tcuTexture.CompareMode.COMPAREMODE_GREATER: res = ref > cmp; break; + case tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL: res = ref >= cmp; break; + case tcuTexture.CompareMode.COMPAREMODE_EQUAL: res = ref == cmp; break; + case tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL: res = ref != cmp; break; + case tcuTexture.CompareMode.COMPAREMODE_ALWAYS: res = true; break; + case tcuTexture.CompareMode.COMPAREMODE_NEVER: res = false; break; + default: + DE_ASSERT(false); + } + + return res ? 1.0 : 0.0; +}; + +/** + * @param {Array} levels + * @param {number} numLevels + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number} lod + * @param {Array} offset + */ +tcuTexture.sampleLevelArray2DCompare = function(levels, numLevels, sampler, ref, s, t, lod, offset) { + var magnified = lod <= sampler.lodThreshold; + var filterMode = magnified ? sampler.magFilter : sampler.minFilter; + + switch (filterMode) { + case tcuTexture.FilterMode.NEAREST: return levels[0].sample2DCompare(sampler, filterMode, ref, s, t, offset); + case tcuTexture.FilterMode.LINEAR: return levels[0].sample2DCompare(sampler, filterMode, ref, s, t, offset); + + case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST: + case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: { + var maxLevel = numLevels - 1; + var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel); + var levelFilter = filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + + return levels[level].sample2DCompare(sampler, levelFilter, ref, s, t, offset); + } + + case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR: + case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: { + var maxLevel = numLevels - 1; + var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel); + var level1 = Math.min(maxLevel, level0 + 1); + var levelFilter = filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + var f = deMath.deFloatFrac(lod); + var t0 = levels[level0].sample2DCompare(sampler, levelFilter, ref, s, t, offset); + var t1 = levels[level1].sample2DCompare(sampler, levelFilter, ref, s, t, offset); + + return t0 * (1.0 - f) + t1 * f; + } + + default: + DE_ASSERT(false); + return 0.0; + } +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {number} u + * @param {number} v + * @param {Array} offset + * @param {boolean} isFixedPointDepthFormat + * @return {number} + */ +tcuTexture.sampleLinear2DCompare = function(access, sampler, ref, u, v, offset, isFixedPointDepthFormat) { + var w = access.getWidth(); + var h = access.getHeight(); + + var x0 = Math.floor(u - 0.5) + offset[0]; + var x1 = x0 + 1; + var y0 = Math.floor(v - 0.5) + offset[1]; + var y1 = y0 + 1; + + var i0 = tcuTexture.wrap(sampler.wrapS, x0, w); + var i1 = tcuTexture.wrap(sampler.wrapS, x1, w); + var j0 = tcuTexture.wrap(sampler.wrapT, y0, h); + var j1 = tcuTexture.wrap(sampler.wrapT, y1, h); + + var a = deMath.deFloatFrac(u - 0.5); + var b = deMath.deFloatFrac(v - 0.5); + + var i0UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i0, 0, w); + var i1UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i1, 0, w); + var j0UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j0, 0, h); + var j1UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j1, 0, h); + + // Border color for out-of-range coordinates if using CLAMP_TO_BORDER, otherwise execute lookups. + var p00Clr = (i0UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, offset[2]); + var p10Clr = (i1UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, offset[2]); + var p01Clr = (i0UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, offset[2]); + var p11Clr = (i1UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, offset[2]); + + // Execute comparisons. + var p00 = tcuTexture.execCompare(p00Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat); + var p10 = tcuTexture.execCompare(p10Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat); + var p01 = tcuTexture.execCompare(p01Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat); + var p11 = tcuTexture.execCompare(p11Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat); + + // Interpolate. + return (p00 * (1.0 - a) * (1.0 - b)) + + (p10 * (a) * (1.0 - b)) + + (p01 * (1.0 - a) * (b)) + + (p11 * (a) * (b)); +}; + +/** + * Construct texture format + * @param {?tcuTexture.ChannelOrder} order + * @param {?tcuTexture.ChannelType} type + * + * @constructor + */ +tcuTexture.TextureFormat = function(order, type) { + this.order = order; + this.type = type; +}; + +/** + * Compare two formats + * @param {tcuTexture.TextureFormat} format Format to compare with + * @return {boolean} + */ +tcuTexture.TextureFormat.prototype.isEqual = function(format) { + return this.order === format.order && this.type === format.type; +}; + +tcuTexture.TextureFormat.prototype.toString = function() { + return 'TextureFormat(' + deString.enumToString(tcuTexture.ChannelOrder, this.order) + ', ' + + deString.enumToString(tcuTexture.ChannelType, this.type) + ')'; +}; + +/** + * Is format sRGB? + * @return {boolean} + */ +tcuTexture.TextureFormat.prototype.isSRGB = function() { + return this.order === tcuTexture.ChannelOrder.sRGB || this.order === tcuTexture.ChannelOrder.sRGBA; +}; + +tcuTexture.TextureFormat.prototype.getNumStencilBits = function() { + switch (this.order) { + case tcuTexture.ChannelOrder.S: + switch (this.type) { + case tcuTexture.ChannelType.UNSIGNED_INT8: return 8; + case tcuTexture.ChannelType.UNSIGNED_INT16: return 16; + case tcuTexture.ChannelType.UNSIGNED_INT32: return 32; + default: + throw new Error('Wrong type: ' + this.type); + } + + case tcuTexture.ChannelOrder.DS: + switch (this.type) { + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return 8; + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return 8; + default: + throw new Error('Wrong type: ' + this.type); + } + + default: + throw new Error('Wrong order: ' + this.order); + } +}; + +/** + * Get TypedArray type that can be used to access texture. + * @param {?tcuTexture.ChannelType} type + * @return TypedArray that supports the tcuTexture.channel type. + */ +tcuTexture.getTypedArray = function(type) { + switch (type) { + case tcuTexture.ChannelType.SNORM_INT8: return Int8Array; + case tcuTexture.ChannelType.SNORM_INT16: return Int16Array; + case tcuTexture.ChannelType.SNORM_INT32: return Int32Array; + case tcuTexture.ChannelType.UNORM_INT8: return Uint8Array; + case tcuTexture.ChannelType.UNORM_INT16: return Uint16Array; + case tcuTexture.ChannelType.UNORM_INT32: return Uint32Array; + case tcuTexture.ChannelType.UNORM_SHORT_565: return Uint16Array; + case tcuTexture.ChannelType.UNORM_SHORT_555: return Uint16Array; + case tcuTexture.ChannelType.UNORM_SHORT_4444: return Uint16Array; + case tcuTexture.ChannelType.UNORM_SHORT_5551: return Uint16Array; + case tcuTexture.ChannelType.UNORM_INT_101010: return Uint32Array; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return Uint32Array; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return Uint32Array; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return Uint32Array; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return Uint32Array; + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return Uint32Array; + case tcuTexture.ChannelType.FLOAT: return Float32Array; + case tcuTexture.ChannelType.SIGNED_INT8: return Int8Array; + case tcuTexture.ChannelType.SIGNED_INT16: return Int16Array; + case tcuTexture.ChannelType.SIGNED_INT32: return Int32Array; + case tcuTexture.ChannelType.UNSIGNED_INT8: return Uint8Array; + case tcuTexture.ChannelType.UNSIGNED_INT16: return Uint16Array; + case tcuTexture.ChannelType.UNSIGNED_INT32: return Uint32Array; + case tcuTexture.ChannelType.HALF_FLOAT: return Uint16Array; + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return Float32Array; /* this type is a special case */ + } + + throw new Error('Unrecognized type ' + type); +}; + +/** + * @return {number} pixel size in bytes + */ +tcuTexture.TextureFormat.prototype.getPixelSize = function() { + if (this.type == null || this.order == null) { + // Invalid/empty format. + return 0; + } else if (this.type == tcuTexture.ChannelType.UNORM_SHORT_565 || + this.type == tcuTexture.ChannelType.UNORM_SHORT_555 || + this.type == tcuTexture.ChannelType.UNORM_SHORT_4444 || + this.type == tcuTexture.ChannelType.UNORM_SHORT_5551) { + DE_ASSERT(this.order == tcuTexture.ChannelOrder.RGB || this.order == tcuTexture.ChannelOrder.RGBA); + return 2; + } else if (this.type == tcuTexture.ChannelType.UNORM_INT_101010 || + this.type == tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV || + this.type == tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV) { + DE_ASSERT(this.order == tcuTexture.ChannelOrder.RGB); + return 4; + } else if (this.type == tcuTexture.ChannelType.UNORM_INT_1010102_REV || + this.type == tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV) { + DE_ASSERT(this.order == tcuTexture.ChannelOrder.RGBA); + return 4; + } else if (this.type == tcuTexture.ChannelType.UNSIGNED_INT_24_8) { + DE_ASSERT(this.order == tcuTexture.ChannelOrder.D || this.order == tcuTexture.ChannelOrder.DS); + return 4; + } else if (this.type == tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV) { + DE_ASSERT(this.order == tcuTexture.ChannelOrder.DS); + return 8; + } else { + var numChannels; + var channelSize; + + switch (this.order) { + case tcuTexture.ChannelOrder.R: numChannels = 1; break; + case tcuTexture.ChannelOrder.A: numChannels = 1; break; + case tcuTexture.ChannelOrder.I: numChannels = 1; break; + case tcuTexture.ChannelOrder.L: numChannels = 1; break; + case tcuTexture.ChannelOrder.LA: numChannels = 2; break; + case tcuTexture.ChannelOrder.RG: numChannels = 2; break; + case tcuTexture.ChannelOrder.RA: numChannels = 2; break; + case tcuTexture.ChannelOrder.RGB: numChannels = 3; break; + case tcuTexture.ChannelOrder.RGBA: numChannels = 4; break; + case tcuTexture.ChannelOrder.ARGB: numChannels = 4; break; + case tcuTexture.ChannelOrder.BGRA: numChannels = 4; break; + case tcuTexture.ChannelOrder.sRGB: numChannels = 3; break; + case tcuTexture.ChannelOrder.sRGBA: numChannels = 4; break; + case tcuTexture.ChannelOrder.D: numChannels = 1; break; + case tcuTexture.ChannelOrder.S: numChannels = 1; break; + case tcuTexture.ChannelOrder.DS: numChannels = 2; break; + default: DE_ASSERT(false); + } + + switch (this.type) { + case tcuTexture.ChannelType.SNORM_INT8: channelSize = 1; break; + case tcuTexture.ChannelType.SNORM_INT16: channelSize = 2; break; + case tcuTexture.ChannelType.SNORM_INT32: channelSize = 4; break; + case tcuTexture.ChannelType.UNORM_INT8: channelSize = 1; break; + case tcuTexture.ChannelType.UNORM_INT16: channelSize = 2; break; + case tcuTexture.ChannelType.UNORM_INT32: channelSize = 4; break; + case tcuTexture.ChannelType.SIGNED_INT8: channelSize = 1; break; + case tcuTexture.ChannelType.SIGNED_INT16: channelSize = 2; break; + case tcuTexture.ChannelType.SIGNED_INT32: channelSize = 4; break; + case tcuTexture.ChannelType.UNSIGNED_INT8: channelSize = 1; break; + case tcuTexture.ChannelType.UNSIGNED_INT16: channelSize = 2; break; + case tcuTexture.ChannelType.UNSIGNED_INT32: channelSize = 4; break; + case tcuTexture.ChannelType.HALF_FLOAT: channelSize = 2; break; + case tcuTexture.ChannelType.FLOAT: channelSize = 4; break; + default: DE_ASSERT(false); + } + + return numChannels * channelSize; + } +}; + +/** + * @enum + */ +tcuTexture.CubeFace = { + CUBEFACE_NEGATIVE_X: 0, + CUBEFACE_POSITIVE_X: 1, + CUBEFACE_NEGATIVE_Y: 2, + CUBEFACE_POSITIVE_Y: 3, + CUBEFACE_NEGATIVE_Z: 4, + CUBEFACE_POSITIVE_Z: 5 +}; + +/** + * Renamed from ArrayBuffer due to name clash + * Wraps ArrayBuffer. + * @constructor + * @param {number=} numElements + */ +tcuTexture.DeqpArrayBuffer = function(numElements) { + if (numElements) + this.m_ptr = new ArrayBuffer(numElements); +}; + +/** + * Set array size + * @param {number} numElements Size in bytes + */ +tcuTexture.DeqpArrayBuffer.prototype.setStorage = function(numElements) { + this.m_ptr = new ArrayBuffer(numElements); +}; + +/** + * @return {number} Buffer size + */ +tcuTexture.DeqpArrayBuffer.prototype.size = function() { + if (this.m_ptr) + return this.m_ptr.byteLength; + + return 0; +}; + +/** + * Is the buffer empty (zero size)? + * @return {boolean} + */ +tcuTexture.DeqpArrayBuffer.prototype.empty = function() { + if (!this.m_ptr) + return true; + return this.size() == 0; +}; + +/** + * @enum + * The values are negative to avoid conflict with channels 0 - 3 + */ +tcuTexture.channel = { + ZERO: -1, + ONE: -2 +}; + +/** + * @param {tcuTexture.ChannelOrder} order + * @return {Array} + */ +tcuTexture.getChannelReadMap = function(order) { + switch (order) { + /*static const Channel INV[] = { tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ONE }; */ + + case tcuTexture.ChannelOrder.R: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ONE]; + case tcuTexture.ChannelOrder.A: return [tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 0]; + case tcuTexture.ChannelOrder.I: return [0, 0, 0, 0]; + case tcuTexture.ChannelOrder.L: return [0, 0, 0, tcuTexture.channel.ONE]; + case tcuTexture.ChannelOrder.LA: return [0, 0, 0, 1]; + case tcuTexture.ChannelOrder.RG: return [0, 1, tcuTexture.channel.ZERO, tcuTexture.channel.ONE]; + case tcuTexture.ChannelOrder.RA: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 1]; + case tcuTexture.ChannelOrder.RGB: return [0, 1, 2, tcuTexture.channel.ONE]; + case tcuTexture.ChannelOrder.RGBA: return [0, 1, 2, 3]; + case tcuTexture.ChannelOrder.BGRA: return [2, 1, 0, 3]; + case tcuTexture.ChannelOrder.ARGB: return [1, 2, 3, 0]; + case tcuTexture.ChannelOrder.sRGB: return [0, 1, 2, tcuTexture.channel.ONE]; + case tcuTexture.ChannelOrder.sRGBA: return [0, 1, 2, 3]; + case tcuTexture.ChannelOrder.D: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ONE]; + case tcuTexture.ChannelOrder.S: return [tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 0]; + case tcuTexture.ChannelOrder.DS: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 1]; + } + + throw new Error('Unrecognized order ' + order); +}; + +/** + * @param {tcuTexture.ChannelOrder} order + * @return {Array} + */ +tcuTexture.getChannelWriteMap = function(order) { + switch (order) { + case tcuTexture.ChannelOrder.R: return [0]; + case tcuTexture.ChannelOrder.A: return [3]; + case tcuTexture.ChannelOrder.I: return [0]; + case tcuTexture.ChannelOrder.L: return [0]; + case tcuTexture.ChannelOrder.LA: return [0, 3]; + case tcuTexture.ChannelOrder.RG: return [0, 1]; + case tcuTexture.ChannelOrder.RA: return [0, 3]; + case tcuTexture.ChannelOrder.RGB: return [0, 1, 2]; + case tcuTexture.ChannelOrder.RGBA: return [0, 1, 2, 3]; + case tcuTexture.ChannelOrder.ARGB: return [3, 0, 1, 2]; + case tcuTexture.ChannelOrder.BGRA: return [2, 1, 0, 3]; + case tcuTexture.ChannelOrder.sRGB: return [0, 1, 2]; + case tcuTexture.ChannelOrder.sRGBA: return [0, 1, 2, 3]; + case tcuTexture.ChannelOrder.D: return [0]; + case tcuTexture.ChannelOrder.S: return [3]; + case tcuTexture.ChannelOrder.DS: return [0, 3]; + } + throw new Error('Unrecognized order ' + order); +}; + +/** + * @param {tcuTexture.ChannelType} type + * @return {number} + */ +tcuTexture.getChannelSize = function(type) { + switch (type) { + case tcuTexture.ChannelType.SNORM_INT8: return 1; + case tcuTexture.ChannelType.SNORM_INT16: return 2; + case tcuTexture.ChannelType.SNORM_INT32: return 4; + case tcuTexture.ChannelType.UNORM_INT8: return 1; + case tcuTexture.ChannelType.UNORM_INT16: return 2; + case tcuTexture.ChannelType.UNORM_INT32: return 4; + case tcuTexture.ChannelType.SIGNED_INT8: return 1; + case tcuTexture.ChannelType.SIGNED_INT16: return 2; + case tcuTexture.ChannelType.SIGNED_INT32: return 4; + case tcuTexture.ChannelType.UNSIGNED_INT8: return 1; + case tcuTexture.ChannelType.UNSIGNED_INT16: return 2; + case tcuTexture.ChannelType.UNSIGNED_INT32: return 4; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return 4; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return 4; + case tcuTexture.ChannelType.HALF_FLOAT: return 2; + case tcuTexture.ChannelType.FLOAT: return 4; + + } + throw new Error('Unrecognized type ' + deString.enumToString(tcuTexture.ChannelType, type)); +}; + +/** + * @param {number} src Source value + * @param {number} bits Source value size in bits + * @return {number} Normalized value + */ +tcuTexture.channelToNormFloat = function(src, bits) { + var maxVal = (1 << bits) - 1; + return src / maxVal; +}; + +/** + * @param {number} value Source value + * @param {tcuTexture.ChannelType} type + * @return {number} Source value converted to float + */ +tcuTexture.channelToFloat = function(value, type) { + switch (type) { + case tcuTexture.ChannelType.SNORM_INT8: return Math.max(-1, value / 127); + case tcuTexture.ChannelType.SNORM_INT16: return Math.max(-1, value / 32767); + case tcuTexture.ChannelType.SNORM_INT32: return Math.max(-1, value / 2147483647); + case tcuTexture.ChannelType.UNORM_INT8: return value / 255; + case tcuTexture.ChannelType.UNORM_INT16: return value / 65535; + case tcuTexture.ChannelType.UNORM_INT32: return value / 4294967295; + case tcuTexture.ChannelType.SIGNED_INT8: return value; + case tcuTexture.ChannelType.SIGNED_INT16: return value; + case tcuTexture.ChannelType.SIGNED_INT32: return value; + case tcuTexture.ChannelType.UNSIGNED_INT8: return value; + case tcuTexture.ChannelType.UNSIGNED_INT16: return value; + case tcuTexture.ChannelType.UNSIGNED_INT32: return value; + case tcuTexture.ChannelType.HALF_FLOAT: return tcuFloat.halfFloatToNumber(value); + case tcuTexture.ChannelType.FLOAT: return value; + } + throw new Error('Unrecognized tcuTexture.channel type ' + type); +}; + +/** + * @param {number} value Source value + * @param {tcuTexture.ChannelType} type + * @return {number} Source value converted to int + */ +tcuTexture.channelToInt = function(value, type) { + switch (type) { + case tcuTexture.ChannelType.HALF_FLOAT: return Math.round(tcuFloat.halfFloatToNumber(value)); + case tcuTexture.ChannelType.FLOAT: return Math.round(value); + default: + return value; + } +}; + +/** + * @param {tcuTexture.ChannelOrder} order + * @return {number} + */ +tcuTexture.getNumUsedChannels = function(order) { + switch (order) { + case tcuTexture.ChannelOrder.R: return 1; + case tcuTexture.ChannelOrder.A: return 1; + case tcuTexture.ChannelOrder.I: return 1; + case tcuTexture.ChannelOrder.L: return 1; + case tcuTexture.ChannelOrder.LA: return 2; + case tcuTexture.ChannelOrder.RG: return 2; + case tcuTexture.ChannelOrder.RA: return 2; + case tcuTexture.ChannelOrder.RGB: return 3; + case tcuTexture.ChannelOrder.RGBA: return 4; + case tcuTexture.ChannelOrder.ARGB: return 4; + case tcuTexture.ChannelOrder.BGRA: return 4; + case tcuTexture.ChannelOrder.sRGB: return 3; + case tcuTexture.ChannelOrder.sRGBA: return 4; + case tcuTexture.ChannelOrder.D: return 1; + case tcuTexture.ChannelOrder.S: return 1; + case tcuTexture.ChannelOrder.DS: return 2; + } + throw new Error('Unrecognized tcuTexture.channel order ' + order); +}; + +/** + * @enum + */ +tcuTexture.WrapMode = { + CLAMP_TO_EDGE: 0, //! Clamp to edge + CLAMP_TO_BORDER: 1, //! Use border color at edge + REPEAT_GL: 2, //! Repeat with OpenGL semantics + REPEAT_CL: 3, //! Repeat with OpenCL semantics + MIRRORED_REPEAT_GL: 4, //! Mirrored repeat with OpenGL semantics + MIRRORED_REPEAT_CL: 5 //! Mirrored repeat with OpenCL semantics +}; + +/** + * @enum + */ +tcuTexture.FilterMode = { + NEAREST: 0, + LINEAR: 1, + + NEAREST_MIPMAP_NEAREST: 2, + NEAREST_MIPMAP_LINEAR: 3, + LINEAR_MIPMAP_NEAREST: 4, + LINEAR_MIPMAP_LINEAR: 5 +}; + +/** + * @enum + */ +tcuTexture.CompareMode = { + COMPAREMODE_NONE: 0, + COMPAREMODE_LESS: 1, + COMPAREMODE_LESS_OR_EQUAL: 2, + COMPAREMODE_GREATER: 3, + COMPAREMODE_GREATER_OR_EQUAL: 4, + COMPAREMODE_EQUAL: 5, + COMPAREMODE_NOT_EQUAL: 6, + COMPAREMODE_ALWAYS: 7, + COMPAREMODE_NEVER: 8 +}; + +/** + * @constructor + * @param {!tcuTexture.WrapMode} wrapS + * @param {!tcuTexture.WrapMode} wrapT + * @param {!tcuTexture.WrapMode} wrapR + * @param {!tcuTexture.FilterMode} minFilter + * @param {!tcuTexture.FilterMode} magFilter + * @param {number=} lodThreshold + * @param {boolean=} normalizedCoords + * @param {tcuTexture.CompareMode=} compare + * @param {number=} compareChannel + * @param {Array=} borderColor + * @param {boolean=} seamlessCubeMap + */ +tcuTexture.Sampler = function(wrapS, wrapT, wrapR, minFilter, magFilter, lodThreshold, normalizedCoords, compare, compareChannel, borderColor, seamlessCubeMap) { + /** @type {!tcuTexture.WrapMode} */ this.wrapS = wrapS; + /** @type {!tcuTexture.WrapMode} */ this.wrapT = wrapT; + /** @type {!tcuTexture.WrapMode} */ this.wrapR = wrapR; + /** @type {!tcuTexture.FilterMode} */ this.minFilter = minFilter; + /** @type {!tcuTexture.FilterMode} */ this.magFilter = magFilter; + this.lodThreshold = lodThreshold || 0; + this.normalizedCoords = normalizedCoords === undefined ? true : normalizedCoords; + /** @type {tcuTexture.CompareMode} */ this.compare = compare || tcuTexture.CompareMode.COMPAREMODE_NONE; + this.compareChannel = compareChannel || 0; + this.borderColor = borderColor || [0, 0, 0, 0]; + this.seamlessCubeMap = seamlessCubeMap || false; +}; + +/** + * Special unnormalization for REPEAT_CL and MIRRORED_REPEAT_CL tcuTexture.wrap modes; otherwise ordinary unnormalization. + * @param {tcuTexture.WrapMode} mode + * @param {number} c Value to tcuTexture.unnormalize + * @param {number} size Unnormalized type size (integer) + * @return {number} + */ +tcuTexture.unnormalize = function(mode, c, size) { + switch (mode) { + case tcuTexture.WrapMode.CLAMP_TO_EDGE: + case tcuTexture.WrapMode.CLAMP_TO_BORDER: + case tcuTexture.WrapMode.REPEAT_GL: + case tcuTexture.WrapMode.MIRRORED_REPEAT_GL: // Fall-through (ordinary case). + return size * c; + + case tcuTexture.WrapMode.REPEAT_CL: + return size * (c - Math.floor(c)); + + case tcuTexture.WrapMode.MIRRORED_REPEAT_CL: + return size * Math.abs(c - 2 * deMath.rint(0.5 * c)); + } + throw new Error('Unrecognized tcuTexture.wrap mode ' + mode); +}; + +/** + * @param {tcuTexture.WrapMode} mode + * @param {number} c Source value (integer) + * @param {number} size Type size (integer) + * @return {number} + */ +tcuTexture.wrap = function(mode, c, size) { + switch (mode) { + case tcuTexture.WrapMode.CLAMP_TO_BORDER: + return deMath.clamp(c, -1, size); + + case tcuTexture.WrapMode.CLAMP_TO_EDGE: + return deMath.clamp(c, 0, size - 1); + + case tcuTexture.WrapMode.REPEAT_GL: + return deMath.imod(c, size); + + case tcuTexture.WrapMode.REPEAT_CL: + return deMath.imod(c, size); + + case tcuTexture.WrapMode.MIRRORED_REPEAT_GL: + return (size - 1) - deMath.mirror(deMath.imod(c, 2 * size) - size); + + case tcuTexture.WrapMode.MIRRORED_REPEAT_CL: + return deMath.clamp(c, 0, size - 1); // \note Actual mirroring done already in unnormalization function. + } + throw new Error('Unrecognized tcuTexture.wrap mode ' + mode); +}; + +/** + * @param {number} cs + * @return {number} + */ +tcuTexture.sRGBChannelToLinear = function(cs) { + if (cs <= 0.04045) + return cs / 12.92; + else + return Math.pow((cs + 0.055) / 1.055, 2.4); +}; + +/** + * Convert sRGB to linear colorspace + * @param {Array} cs Vec4 + * @return {Array} Vec4 + */ +tcuTexture.sRGBToLinear = function(cs) { + return [ + tcuTexture.sRGBChannelToLinear(cs[0]), + tcuTexture.sRGBChannelToLinear(cs[1]), + tcuTexture.sRGBChannelToLinear(cs[2]), + cs[3] + ]; +}; + +/** + * Texel tcuTexture.lookup with color conversion. + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {number} i + * @param {number} j + * @param {number} k + * @return {Array} Vec4 pixel color + */ +tcuTexture.lookup = function(access, i, j, k) { + var p = access.getPixel(i, j, k); + return access.getFormat().isSRGB() ? tcuTexture.sRGBToLinear(p) : p; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {number} u + * @param {number} v + * @param {(number|Array)} depthOrOffset depth (int) or offset (ivec3) + * @return {Array} Vec4 pixel color + */ +tcuTexture.sampleLinear2D = function(access, sampler, u, v, depthOrOffset) { + /** @type {number} */ var xOffset = 0; + /** @type {number} */ var yOffset = 0; + /** @type {number} */ var value; + if (Array.isArray(depthOrOffset)) { + xOffset = depthOrOffset[0]; + yOffset = depthOrOffset[1]; + value = depthOrOffset[2]; + } else { + value = /** @type {number} */ (depthOrOffset); + } + + /** + * @param {Array} p00 + * @param {Array} p10 + * @param {Array} p01 + * @param {Array} p11 + * @param {number} a + * @param {number} b + */ + var interpolateQuad = function(p00, p10, p01, p11, a, b) { + var s00 = (1 - a) * (1 - b); + var s10 = a * (1 - b); + var s01 = (1 - a) * b; + var s11 = a * b; + + return [ + (p00[0] * s00) + (p10[0] * s10) + (p01[0] * s01) + (p11[0] * s11), + (p00[1] * s00) + (p10[1] * s10) + (p01[1] * s01) + (p11[1] * s11), + (p00[2] * s00) + (p10[2] * s10) + (p01[2] * s01) + (p11[2] * s11), + (p00[3] * s00) + (p10[3] * s10) + (p01[3] * s01) + (p11[3] * s11) + ]; + }; + + var w = access.getWidth(); + var h = access.getHeight(); + + var x0 = Math.floor(u - 0.5) + xOffset; + var x1 = x0 + 1; + var y0 = Math.floor(v - 0.5) + yOffset; + var y1 = y0 + 1; + + var i0 = tcuTexture.wrap(sampler.wrapS, x0, w); + var i1 = tcuTexture.wrap(sampler.wrapS, x1, w); + var j0 = tcuTexture.wrap(sampler.wrapT, y0, h); + var j1 = tcuTexture.wrap(sampler.wrapT, y1, h); + + var a = deMath.deFloatFrac(u - 0.5); + var b = deMath.deFloatFrac(v - 0.5); + + var i0UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i0, 0, w); + var i1UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i1, 0, w); + var j0UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j0, 0, h); + var j1UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j1, 0, h); + + // Border color for out-of-range coordinates if using CLAMP_TO_BORDER, otherwise execute lookups. + var p00 = (i0UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, value); + var p10 = (i1UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, value); + var p01 = (i0UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, value); + var p11 = (i1UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, value); + + // Interpolate. + return interpolateQuad(p00, p10, p01, p11, a, b); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {number} u + * @param {number} v + * @param {number} w + * @param {Array=} offset + * @return {Array} Vec4 pixel color + */ +tcuTexture.sampleLinear3D = function(access, sampler, u, v, w, offset) { + /** + * @param {Array} p000 + * @param {Array} p100 + * @param {Array} p010 + * @param {Array} p110 + * @param {Array} p001 + * @param {Array} p101 + * @param {Array} p011 + * @param {Array} p111 + * @param {number} a + * @param {number} b + * @param {number} c + */ + var interpolateCube = function(p000, p100, p010, p110, p001, p101, p011, p111, a, b, c) { + var s000 = (1 - a) * (1 - b) * (1 - c); + var s100 = a * (1 - b) * (1 - c); + var s010 = (1 - a) * b * (1 - c); + var s110 = a * b * (1 - c); + var s001 = (1 - a) * (1 - b) * c; + var s101 = a * (1 - b) * c; + var s011 = (1 - a) * b * c; + var s111 = a * b * c; + + return [ + (p000[0] * s000) + (p100[0] * s100) + (p010[0] * s010) + (p110[0] * s110) + (p001[0] * s001) + (p101[0] * s101) + (p011[0] * s011) + (p111[0] * s111), + (p000[1] * s000) + (p100[1] * s100) + (p010[1] * s010) + (p110[1] * s110) + (p001[1] * s001) + (p101[1] * s101) + (p011[1] * s011) + (p111[1] * s111), + (p000[2] * s000) + (p100[2] * s100) + (p010[2] * s010) + (p110[2] * s110) + (p001[2] * s001) + (p101[2] * s101) + (p011[2] * s011) + (p111[2] * s111), + (p000[3] * s000) + (p100[3] * s100) + (p010[3] * s010) + (p110[3] * s110) + (p001[3] * s001) + (p101[3] * s101) + (p011[3] * s011) + (p111[3] * s111) + ]; + }; + + var width = access.getWidth(); + var height = access.getHeight(); + var depth = access.getDepth(); + + /** @type {number} */ var xOffset = 0; + /** @type {number} */ var yOffset = 0; + /** @type {number} */ var zOffset = 0; + + if (offset !== undefined && offset.length === 3) { + xOffset = offset[0]; + yOffset = offset[1]; + zOffset = offset[2]; + } + + var x0 = Math.floor(u - 0.5) + xOffset; + var x1 = x0 + 1; + var y0 = Math.floor(v - 0.5) + yOffset; + var y1 = y0 + 1; + var z0 = Math.floor(w - 0.5) + zOffset; + var z1 = z0 + 1; + + var i0 = tcuTexture.wrap(sampler.wrapS, x0, width); + var i1 = tcuTexture.wrap(sampler.wrapS, x1, width); + var j0 = tcuTexture.wrap(sampler.wrapT, y0, height); + var j1 = tcuTexture.wrap(sampler.wrapT, y1, height); + var k0 = tcuTexture.wrap(sampler.wrapR, z0, depth); + var k1 = tcuTexture.wrap(sampler.wrapR, z1, depth); + + var a = deMath.deFloatFrac(u - 0.5); + var b = deMath.deFloatFrac(v - 0.5); + var c = deMath.deFloatFrac(w - 0.5); + + var i0UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i0, 0, width); + var i1UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i1, 0, width); + var j0UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j0, 0, height); + var j1UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j1, 0, height); + var k0UseBorder = sampler.wrapR == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(k0, 0, depth); + var k1UseBorder = sampler.wrapR == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(k1, 0, depth); + + // Border color for out-of-range coordinates if using CLAMP_TO_BORDER, otherwise execute lookups. + var p000 = (i0UseBorder || j0UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, k0); + var p100 = (i1UseBorder || j0UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, k0); + var p010 = (i0UseBorder || j1UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, k0); + var p110 = (i1UseBorder || j1UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, k0); + var p001 = (i0UseBorder || j0UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, k1); + var p101 = (i1UseBorder || j0UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, k1); + var p011 = (i0UseBorder || j1UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, k1); + var p111 = (i1UseBorder || j1UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, k1); + + // Interpolate. + return interpolateCube(p000, p100, p010, p110, p001, p101, p011, p111, a, b, c); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {number} u + * @param {number} v + * @param {(number|Array)} depthOrOffset depth (integer) or offset (ivec3) + * @return {Array} Vec4 pixel color + */ +tcuTexture.sampleNearest2D = function(access, sampler, u, v, depthOrOffset) { + /** @type {number} */ var xOffset = 0; + /** @type {number} */ var yOffset = 0; + /** @type {number} */ var value; + if (Array.isArray(depthOrOffset)) { + xOffset = depthOrOffset[0]; + yOffset = depthOrOffset[1]; + value = depthOrOffset[2]; + } else { + value = /** @type {number} */ (depthOrOffset); + } + + var width = access.getWidth(); + var height = access.getHeight(); + + var x = Math.floor(u) + xOffset; + var y = Math.floor(v) + yOffset; + + // Check for CLAMP_TO_BORDER. + if ((sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(x, 0, width)) || + (sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(y, 0, height))) + return sampler.borderColor; + + var i = tcuTexture.wrap(sampler.wrapS, x, width); + var j = tcuTexture.wrap(sampler.wrapT, y, height); + + return tcuTexture.lookup(access, i, j, value); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @param {tcuTexture.Sampler} sampler + * @param {number} u + * @param {number} v + * @param {number} w + * @param {Array=} offset + * @return {Array} Vec4 pixel color + */ +tcuTexture.sampleNearest3D = function(access, sampler, u, v, w, offset) { + var width = access.getWidth(); + var height = access.getHeight(); + var depth = access.getDepth(); + /** @type {number} */ var xOffset = 0; + /** @type {number} */ var yOffset = 0; + /** @type {number} */ var zOffset = 0; + + if (offset !== undefined && offset.length === 3) { + xOffset = offset[0]; + yOffset = offset[1]; + zOffset = offset[2]; + } + + var x = Math.floor(u) + xOffset; + var y = Math.floor(v) + yOffset; + var z = Math.floor(w) + zOffset; + + // Check for CLAMP_TO_BORDER. + if ((sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(x, 0, width)) || + (sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(y, 0, height)) || + (sampler.wrapR == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(z, 0, depth))) + return sampler.borderColor; + + var i = tcuTexture.wrap(sampler.wrapS, x, width); + var j = tcuTexture.wrap(sampler.wrapT, y, height); + var k = tcuTexture.wrap(sampler.wrapR, z, depth); + + return tcuTexture.lookup(access, i, j, k); +}; + +/** + * @param {Array} color Vec4 color + * @return {number} The color in packed 32 bit format + */ +tcuTexture.packRGB999E5 = function(color) { + /** @const */ var mBits = 9; + /** @const */ var eBits = 5; + /** @const */ var eBias = 15; + /** @const */ var eMax = (1 << eBits) - 1; + /** @const */ var maxVal = (((1 << mBits) - 1) * (1 << (eMax - eBias))) / (1 << mBits); + + var rc = deMath.clamp(color[0], 0, maxVal); + var gc = deMath.clamp(color[1], 0, maxVal); + var bc = deMath.clamp(color[2], 0, maxVal); + var maxc = Math.max(rc, gc, bc); + var expp = Math.max(-eBias - 1, Math.floor(Math.log2(maxc))) + 1 + eBias; + var e = Math.pow(2, expp - eBias - mBits); + var maxs = Math.floor(maxc / e + 0.5); + + var exps = maxs == (1 << mBits) ? expp + 1 : expp; + var rs = deMath.clamp(Math.floor(rc / e + 0.5), 0, (1 << 9) - 1); + var gs = deMath.clamp(Math.floor(gc / e + 0.5), 0, (1 << 9) - 1); + var bs = deMath.clamp(Math.floor(bc / e + 0.5), 0, (1 << 9) - 1); + + DE_ASSERT((exps & ~((1 << 5) - 1)) == 0); + DE_ASSERT((rs & ~((1 << 9) - 1)) == 0); + DE_ASSERT((gs & ~((1 << 9) - 1)) == 0); + DE_ASSERT((bs & ~((1 << 9) - 1)) == 0); + + return rs | (gs << 9) | (bs << 18) | (exps << 27); +}; + +/** + * @param {number} color Color in packed 32 bit format + * @return {Array} The color in unpacked format + */ +tcuTexture.unpackRGB999E5 = function(color) { + var mBits = 9; + var eBias = 15; + + var exp = (color >> 27) & ((1 << 5) - 1); + var bs = (color >> 18) & ((1 << 9) - 1); + var gs = (color >> 9) & ((1 << 9) - 1); + var rs = color & ((1 << 9) - 1); + + var e = Math.pow(2, (exp - eBias - mBits)); + var r = rs * e; + var g = gs * e; + var b = bs * e; + + return [r, g, b, 1]; +}; + +/** + * \brief Read-only pixel data access + * + * tcuTexture.ConstPixelBufferAccess encapsulates pixel data pointer along with + * format and layout information. It can be used for read-only access + * to arbitrary pixel buffers. + * + * Access objects are like iterators or pointers. They can be passed around + * as values and are valid as long as the storage doesn't change. + * @constructor + */ +tcuTexture.ConstPixelBufferAccess = function(descriptor) { + if (descriptor) { + this.m_offset = descriptor.offset || 0; + this.m_format = descriptor.format || new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT); + this.m_width = descriptor.width; + this.m_height = descriptor.height; + if (descriptor.depth) + this.m_depth = descriptor.depth; + else + this.m_depth = 1; + this.m_data = descriptor.data; + if (descriptor.rowPitch) + this.m_rowPitch = descriptor.rowPitch; + else + this.m_rowPitch = this.m_width * this.m_format.getPixelSize(); + + if (descriptor.slicePitch) + this.m_slicePitch = descriptor.slicePitch; + else + this.m_slicePitch = this.m_rowPitch * this.m_height; + + if (this.m_format.isEqual(new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8))) + this.m_rgba8View = new tcuTexture.RGBA8View(this); + else if (this.m_format.isEqual(new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8))) + this.m_rgb8View = new tcuTexture.RGBA8View(this); + + } + + this.m_dataPtrType = null; + this.m_dataPtr = null; +}; + +tcuTexture.ConstPixelBufferAccess.prototype.toString = function() { + var str = 'BufferAccess(format: ' + this.m_format + + ', width: ' + this.m_width + + ', height: ' + this.m_height; + if (this.m_depth > 1) + str += ', depth: ' + this.m_depth; + if (this.m_rowPitch != this.m_width * this.m_format.getPixelSize()) + str += ', row pitch: ' + this.m_rowPitch; + if (this.m_slicePitch != this.m_rowPitch * this.m_height) + str += ', slice pitch: ' + this.m_slicePitch; + if (this.m_offset > 0) + str += ', offset: ' + this.m_offset; + str += ')'; + return str; +}; + +/** @return {number} */ +tcuTexture.ConstPixelBufferAccess.prototype.getDataSize = function() { return this.m_depth * this.m_slicePitch; }; +tcuTexture.ConstPixelBufferAccess.prototype.isEmpty = function() { return this.m_width == 0 || this.m_height == 0 || this.m_depth == 0; }; +/** @return {goog.TypedArray} */ +tcuTexture.ConstPixelBufferAccess.prototype.getDataPtr = function() { + if (this.m_dataPtrType != this.m_format.type) { + this.m_dataPtrType = this.m_format.type; + var arrayType = tcuTexture.getTypedArray(this.m_format.type); + this.m_dataPtr = new arrayType(this.m_data, this.m_offset); + } + return this.m_dataPtr; +}; +/** @return {ArrayBuffer} */ +tcuTexture.ConstPixelBufferAccess.prototype.getBuffer = function() { + return this.m_data; +}; +/** @return {number} */ +tcuTexture.ConstPixelBufferAccess.prototype.getRowPitch = function() { return this.m_rowPitch; }; +/** @return {number} */ +tcuTexture.ConstPixelBufferAccess.prototype.getWidth = function() { return this.m_width; }; +/** @return {number} */ +tcuTexture.ConstPixelBufferAccess.prototype.getHeight = function() { return this.m_height; }; +/** @return {number} */ +tcuTexture.ConstPixelBufferAccess.prototype.getDepth = function() { return this.m_depth; }; +/** @return {number} */ +tcuTexture.ConstPixelBufferAccess.prototype.getSlicePitch = function() { return this.m_slicePitch; }; +/** @return {tcuTexture.TextureFormat} */ +tcuTexture.ConstPixelBufferAccess.prototype.getFormat = function() { return this.m_format; }; + +/** + * @param {number} x + * @param {number} y + * @param {number=} z + * @return {number} stencil value + */ +tcuTexture.ConstPixelBufferAccess.prototype.getPixStencil = function(x, y, z) { + z = z || 0; + + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + x = Math.round(x); + y = Math.round(y); + z = Math.round(z); + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + case tcuTexture.ChannelOrder.S: return (pixelPtr[pixelPtrOffset] >> 8) & 0xff; + case tcuTexture.ChannelOrder.DS: return pixelPtr[pixelPtrOffset] & 0xff; + + default: + DE_ASSERT(false); + return 0; + } + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS); + var u32array = new Uint32Array(this.m_data, offset + this.m_offset + 4, 1); + return u32array[0] & 0xff; + + default: { + if (this.m_format.order == tcuTexture.ChannelOrder.S) + return tcuTexture.channelToInt(pixelPtr[pixelPtrOffset], this.m_format.type); + else { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS); + var stencilChannelIndex = 3; + return tcuTexture.channelToInt(pixelPtr[stencilChannelIndex + pixelPtrOffset], this.m_format.type); + } + } + } +}; + +/** + * @param {number} x + * @param {number} y + * @param {number=} z + * @return {number} + */ +tcuTexture.ConstPixelBufferAccess.prototype.getPixDepth = function(x, y, z) { + if (z == null) + z = 0; + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + x = Math.round(x); + y = Math.round(y); + z = Math.round(z); + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + + var ub = function(pixel, offset, count) { + return (pixel >> offset) & ((1 << count) - 1); + }; + var nb = function(pixel, offset, count) { + return tcuTexture.channelToNormFloat(ub(pixel, offset, count), count); + }; + + // Packed formats. + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + case tcuTexture.ChannelOrder.D: // fall-through + case tcuTexture.ChannelOrder.DS: + return nb(pixelPtr[pixelPtrOffset], 8, 24); + default: + throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order); + } + break; + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS); + return pixelPtr[pixelPtrOffset]; + break; + } + + default: { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.D || this.m_format.order == tcuTexture.ChannelOrder.DS); + return tcuTexture.channelToFloat(pixelPtr[pixelPtrOffset], this.m_format.type); + } + } +}; + +/** + * @param {number} x + * @param {number} y + * @param {number=} z + * @return {Array} Pixel value as Vec4 + */ +tcuTexture.ConstPixelBufferAccess.prototype.getPixel = function(x, y, z) { + z = z || 0; + + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + return this._getPixelInternal(Math.round(x), Math.round(y), Math.round(z)); +}; + +// NOTE: getPixel has been broken into getPixel, _getPixelInternal, and _getPixelPacked +// because having them combined previously was causing V8 depots +tcuTexture.ConstPixelBufferAccess.prototype._getPixelInternal = function(x, y, z) { + // Quick paths + if (z == 0) { + if (this.m_rgba8View) { + var color = this.m_rgba8View.read(x, y, 4); + color[0] /= 255; + color[1] /= 255; + color[2] /= 255; + color[3] /= 255; + return color; + } else if (this.m_rgb8View) { + var color = this.m_rgb8View.read(x, y, 3); + color[0] /= 255; + color[1] /= 255; + color[2] /= 255; + color[3] = 1; + return color; + } + } + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + + return this._getPixelPacked(pixelPtr, pixelPtrOffset); +}; + +tcuTexture.ConstPixelBufferAccess.prototype._getPixelPacked = (function() { + + var ub = function(pixel, offset, count) { + return (pixel >> offset) & ((1 << count) - 1); + }; + var nb = function(pixel, offset, count) { + var maxVal = (1 << count) - 1; + return ((pixel >> offset) & ((1 << count) - 1)) / maxVal; + }; + var f11 = tcuFloat.float11ToNumber; + var f10 = tcuFloat.float10ToNumber; + + return function tcuTexture_ConstPixelBufferAccess_getPixelPacked(pixelPtr, pixelPtrOffset) { + var pixel = pixelPtr[pixelPtrOffset]; + + // Packed formats. + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNORM_SHORT_565: return [nb(pixel, 11, 5), nb(pixel, 5, 6), nb(pixel, 0, 5), 1]; + case tcuTexture.ChannelType.UNORM_SHORT_555: return [nb(pixel, 10, 5), nb(pixel, 5, 5), nb(pixel, 0, 5), 1]; + case tcuTexture.ChannelType.UNORM_SHORT_4444: return [nb(pixel, 12, 4), nb(pixel, 8, 4), nb(pixel, 4, 4), nb(pixel, 0, 4)]; + case tcuTexture.ChannelType.UNORM_SHORT_5551: return [nb(pixel, 11, 5), nb(pixel, 6, 5), nb(pixel, 1, 5), nb(pixel, 0, 1)]; + case tcuTexture.ChannelType.UNORM_INT_101010: return [nb(pixel, 22, 10), nb(pixel, 12, 10), nb(pixel, 2, 10), 1]; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return [nb(pixel, 0, 10), nb(pixel, 10, 10), nb(pixel, 20, 10), nb(pixel, 30, 2)]; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return [ub(pixel, 0, 10), ub(pixel, 10, 10), ub(pixel, 20, 10), ub(pixel, 30, 2)]; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return tcuTexture.unpackRGB999E5(pixel); + + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + // \note Stencil is always ignored. + case tcuTexture.ChannelOrder.D: return [nb(pixel, 8, 24), 0, 0, 1]; + case tcuTexture.ChannelOrder.DS: return [nb(pixel, 8, 24), 0, 0, 1 /* (float)ub(0, 8) */]; + default: + DE_ASSERT(false); + } + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS); + // \note Stencil is ignored. + return [pixel, 0, 0, 1]; + } + + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: { + return [f11(ub(pixel, 0, 11)), f11(ub(pixel, 11, 11)), f10(ub(pixel, 22, 10)), 1]; + } + + default: + break; + } + + // Generic path. + var result = [0, 0, 0, 0]; + var channelMap = tcuTexture.getChannelReadMap(this.m_format.order); + var channelSize = tcuTexture.getChannelSize(this.m_format.type); + + for (var c = 0; c < 4; c++) { + var map = channelMap[c]; + if (map == tcuTexture.channel.ZERO) + result[c] = 0; + else if (map == tcuTexture.channel.ONE) + result[c] = 1; + else + result[c] = tcuTexture.channelToFloat(pixelPtr[map + pixelPtrOffset], this.m_format.type); + } + + return result; + }; +})(); + +/** + * @param {number} x + * @param {number} y + * @param {number=} z + * @return {Array} Pixel value as Vec4 + */ +tcuTexture.ConstPixelBufferAccess.prototype.getPixelInt = function(x, y, z) { + z = z || 0; + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + x = Math.round(x); + y = Math.round(y); + z = Math.round(z); + + // Quick paths + if (z == 0) { + if (this.m_rgba8View) + return this.m_rgba8View.read(x, y, 4); + else if (this.m_rgb8View) + return this.m_rgb8View.read(x, y, 3); + } + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + var pixel = pixelPtr[pixelPtrOffset]; + + var ub = function(pixel, offset, count) { + return (pixel >> offset) & ((1 << count) - 1); + }; + + // Packed formats. + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNORM_SHORT_565: return [ub(pixel, 11, 5), ub(pixel, 5, 6), ub(pixel, 0, 5), 1]; + case tcuTexture.ChannelType.UNORM_SHORT_555: return [ub(pixel, 10, 5), ub(pixel, 5, 5), ub(pixel, 0, 5), 1]; + case tcuTexture.ChannelType.UNORM_SHORT_4444: return [ub(pixel, 12, 4), ub(pixel, 8, 4), ub(pixel, 4, 4), ub(pixel, 0, 4)]; + case tcuTexture.ChannelType.UNORM_SHORT_5551: return [ub(pixel, 11, 5), ub(pixel, 6, 5), ub(pixel, 1, 5), ub(pixel, 0, 1)]; + case tcuTexture.ChannelType.UNORM_INT_101010: return [ub(pixel, 22, 10), ub(pixel, 12, 10), ub(pixel, 2, 10), 1]; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return [ub(pixel, 0, 10), ub(pixel, 10, 10), ub(pixel, 20, 10), ub(pixel, 30, 2)]; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return [ub(pixel, 0, 10), ub(pixel, 10, 10), ub(pixel, 20, 10), ub(pixel, 30, 2)]; + + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + case tcuTexture.ChannelOrder.D: return [ub(pixel, 8, 24), 0, 0, 1]; + case tcuTexture.ChannelOrder.S: return [0, 0, 0, ub(pixel, 8, 24)]; + case tcuTexture.ChannelOrder.DS: return [ub(pixel, 8, 24), 0, 0, ub(pixel, 0, 8)]; + default: + DE_ASSERT(false); + } + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS); + var u32array = new Uint32Array(this.m_data, this.m_offset + offset + 4, 1); + return [pixel, 0, 0, ub(u32array[0], 0, 8)]; + } + + default: + break; + } + + // Generic path. + var result = []; + result.length = 4; + var channelMap = tcuTexture.getChannelReadMap(this.m_format.order); + var channelSize = tcuTexture.getChannelSize(this.m_format.type); + + for (var c = 0; c < 4; c++) { + var map = channelMap[c]; + if (map == tcuTexture.channel.ZERO) + result[c] = 0; + else if (map == tcuTexture.channel.ONE) + result[c] = 1; + else + result[c] = tcuTexture.channelToInt(pixelPtr[map + pixelPtrOffset], this.m_format.type); + } + + return result; +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {?tcuTexture.FilterMode} filter + * @param {number} s + * @param {number} t + * @param {number} depth (integer) + * @return {Array} Sample color + */ +tcuTexture.ConstPixelBufferAccess.prototype.sample2D = function(sampler, filter, s, t, depth) { + DE_ASSERT(deMath.deInBounds32(depth, 0, this.m_depth)); + + // Non-normalized coordinates. + var u = s; + var v = t; + + if (sampler.normalizedCoords) { + u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width); + v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height); + } + + switch (filter) { + case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest2D(this, sampler, u, v, depth); + case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear2D(this, sampler, u, v, depth); + default: + throw new Error('Invalid filter:' + filter); + } + throw new Error('Unimplemented'); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {?tcuTexture.FilterMode} filter + * @param {number} s + * @param {number} t + * @param {Array} offset + * @return {Array} Sample color + */ +tcuTexture.ConstPixelBufferAccess.prototype.sample2DOffset = function(sampler, filter, s, t, offset) { + DE_ASSERT(deMath.deInBounds32(offset[2], 0, this.m_depth)); + + // Non-normalized coordinates. + var u = s; + var v = t; + + if (sampler.normalizedCoords) { + u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width); + v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height); + } + + switch (filter) { + case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest2D(this, sampler, u, v, offset); + case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear2D(this, sampler, u, v, offset); + default: + throw new Error('Invalid filter:' + filter); + } +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {?tcuTexture.FilterMode} filter + * @param {number} s + * @param {number} t + * @param {number} r + * @param {Array} offset + * @return {Array} Sample color + */ +tcuTexture.ConstPixelBufferAccess.prototype.sample3DOffset = function(sampler, filter, s, t, r, offset) { + // Non-normalized coordinates. + /** @type {number} */ var u = s; + /** @type {number} */ var v = t; + /** @type {number} */ var w = r; + + if (sampler.normalizedCoords) { + u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width); + v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height); + w = tcuTexture.unnormalize(sampler.wrapR, r, this.m_depth); + } + + switch (filter) { + case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest3D(this, sampler, u, v, w, offset); + case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear3D(this, sampler, u, v, w, offset); + default: + throw new Error('Invalid filter:' + filter); + } +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filter + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {Array} offset + * @return {number} + */ +tcuTexture.ConstPixelBufferAccess.prototype.sample2DCompare = function(sampler, filter, ref, s, t, offset) { + DE_ASSERT(deMath.deInBounds32(offset[2], 0, this.m_depth)); + + // Format information for comparison function + var isFixedPointDepth = tcuTexture.isFixedPointDepthTextureFormat(this.m_format); + + // Non-normalized coordinates. + var u = s; + var v = t; + + if (sampler.normalizedCoords) { + u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width); + v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height); + } + + switch (filter) { + case tcuTexture.FilterMode.NEAREST: return tcuTexture.execCompare(tcuTexture.sampleNearest2D(this, sampler, u, v, offset), sampler.compare, sampler.compareChannel, ref, isFixedPointDepth); + case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear2DCompare(this, sampler, ref, u, v, offset, isFixedPointDepth); + default: + DE_ASSERT(false); + return 0.0; + } +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {tcuTexture.FilterMode} filter + * @param {number} s + * @param {number} t + * @param {number} r + * @return {Array} Sample color + */ +tcuTexture.ConstPixelBufferAccess.prototype.sample3D = function(sampler, filter, s, t, r) { + // Non-normalized coordinates. + var u = s; + var v = t; + var w = r; + + if (sampler.normalizedCoords) { + u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width); + v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height); + w = tcuTexture.unnormalize(sampler.wrapR, r, this.m_depth); + } + + switch (filter) { + case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest3D(this, sampler, u, v, w); + case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear3D(this, sampler, u, v, w); + default: + throw new Error('Invalid filter:' + filter); + } + throw new Error('Unimplemented'); +}; + + /* TODO: do we need any of these? */ { + // template + // Vector getPixelT (int x, int y, int z = 0) const; + + // Vec4 sample3D (const tcuTexture.Sampler& sampler, tcuTexture.tcuTexture.Sampler.tcuTexture.FilterMode filter, float s, float t, float r) const; + + // Vec4 sample2DOffset (const tcuTexture.Sampler& sampler, tcuTexture.Sampler::tcuTexture.FilterMode filter, float s, float t, const IVec3& offset) const; + // Vec4 sample3DOffset (const tcuTexture.Sampler& sampler, tcuTexture.Sampler::tcuTexture.FilterMode filter, float s, float t, float r, const IVec3& offset) const; + + // float sample2DCompare (const tcuTexture.Sampler& sampler, tcuTexture.Sampler::tcuTexture.FilterMode filter, float ref, float s, float t, const IVec3& offset) const; + }; + +/** Common type limits + * + */ +tcuTexture.deTypes = { + deInt8: {min: -(1 << 7), max: (1 << 7) - 1}, + deInt16: {min: -(1 << 15), max: (1 << 15) - 1}, + deInt32: {min: -2147483648, max: 2147483647}, + deUint8: {min: 0, max: (1 << 8) - 1}, + deUint16: {min: 0, max: (1 << 16) - 1}, + deUint32: {min: 0, max: 4294967295} +}; + +/** + * Round to even and saturate + * @param {{max: number, min: number}} deType from tcuTexture.deTypes + * @param {number} value + * @return {number} + */ +tcuTexture.convertSatRte = function(deType, value) { + var minVal = deType.min; + var maxVal = deType.max; + var floor = Math.floor(value); + var frac = value - floor; + if (frac == 0.5) { + if (floor % 2 != 0) + floor += 1; + } else if (frac > 0.5) { + floor += 1; + } + + return Math.max(minVal, Math.min(maxVal, floor)); +}; + +/** + * Saturate value to type range + * @param { {max: number, min: number}} deType from tcuTexture.deTypes + * @param {number} src + * @return {number} + */ +tcuTexture.convertSat = function(deType, src) { + var minVal = deType.min; + var maxVal = deType.max; + if (src < minVal) + return minVal; + else if (src > maxVal) + return maxVal; + else + return src; +}; + +/** + * @param {number} src Input integer value + * @param {tcuTexture.ChannelType} type + * @return {number} + */ +tcuTexture.intToChannel = function(src, type) { + var dst; + switch (type) { + case tcuTexture.ChannelType.SNORM_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt8, src); break; + case tcuTexture.ChannelType.SNORM_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt16, src); break; + case tcuTexture.ChannelType.UNORM_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint8, src); break; + case tcuTexture.ChannelType.UNORM_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint16, src); break; + case tcuTexture.ChannelType.SIGNED_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt8, src); break; + case tcuTexture.ChannelType.SIGNED_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt16, src); break; + case tcuTexture.ChannelType.SIGNED_INT32: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt32, src); break; + case tcuTexture.ChannelType.UNSIGNED_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint8, src); break; + case tcuTexture.ChannelType.UNSIGNED_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint16, src); break; + case tcuTexture.ChannelType.UNSIGNED_INT32: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint32, src); break; + case tcuTexture.ChannelType.HALF_FLOAT: dst = tcuFloat.numberToHalfFloat(src); break; + case tcuTexture.ChannelType.FLOAT: dst = src; break; + default: + throw new Error('Unrecognized tcuTexture.channel type: ' + type); + } + return dst; +}; + +/** + * @param {number} src + * @param {number} bits + * @return {number} + */ +tcuTexture.normFloatToChannel = function(src, bits) { + var maxVal = (1 << bits) - 1; + var intVal = tcuTexture.convertSatRte(tcuTexture.deTypes.deUint32, src * maxVal); + return Math.min(maxVal, intVal); +}; + +/** + * @param {number} src + * @param {number} bits + * @return {number} + */ +tcuTexture.uintToChannel = function(src, bits) { + var maxVal = (1 << bits) - 1; + return Math.min(maxVal, src); +}; + +/** + * @param {number} src + * @param {tcuTexture.ChannelType} type + * @return {number} Converted src color value + */ +tcuTexture.floatToChannel = function(src, type) { + switch (type) { + case tcuTexture.ChannelType.SNORM_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt8, src * 127); + case tcuTexture.ChannelType.SNORM_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt16, src * 32767); + case tcuTexture.ChannelType.SNORM_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt32, src * 2147483647); + case tcuTexture.ChannelType.UNORM_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint8, src * 255); + case tcuTexture.ChannelType.UNORM_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint16, src * 65535); + case tcuTexture.ChannelType.UNORM_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint32, src * 4294967295); + case tcuTexture.ChannelType.SIGNED_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt8, src); + case tcuTexture.ChannelType.SIGNED_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt16, src); + case tcuTexture.ChannelType.SIGNED_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt32, src); + case tcuTexture.ChannelType.UNSIGNED_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint8, src); + case tcuTexture.ChannelType.UNSIGNED_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint16, src); + case tcuTexture.ChannelType.UNSIGNED_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint32, src); + case tcuTexture.ChannelType.HALF_FLOAT: return tcuFloat.numberToHalfFloat(src); + case tcuTexture.ChannelType.FLOAT: return src; + } + throw new Error('Unrecognized type ' + type); +}; + +/** + * \brief Read-write pixel data access + * + * This class extends read-only access object by providing write functionality. + * + * \note tcuTexture.PixelBufferAccess may not have any data members nor add any + * virtual functions. It must be possible to reinterpret_cast<> + * tcuTexture.PixelBufferAccess to tcuTexture.ConstPixelBufferAccess. + * @constructor + * @extends {tcuTexture.ConstPixelBufferAccess} + * + */ +tcuTexture.PixelBufferAccess = function(descriptor) { + tcuTexture.ConstPixelBufferAccess.call(this, descriptor); +}; + +tcuTexture.PixelBufferAccess.prototype = Object.create(tcuTexture.ConstPixelBufferAccess.prototype); +tcuTexture.PixelBufferAccess.prototype.constructor = tcuTexture.PixelBufferAccess; + +/** + * @param {Array} color Vec4 color to set + * @param {number} x + * @param {number} y + * @param {number=} z + */ +tcuTexture.PixelBufferAccess.prototype.setPixel = function(color, x, y, z) { + z = z || 0; + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + this._setPixelInternal(color, Math.round(x), Math.round(y), Math.round(z)); +}; + +// NOTE: setPixel has been broken into setPixel, _setPixelInternal, and _setPixelPacked +// because having them combined previously was causing V8 depots +tcuTexture.PixelBufferAccess.prototype._setPixelInternal = function(color, x, y, z) { + // Quick paths + if (z == 0) { + if (this.m_rgba8View) { + color = deMath.toIVec(color); + this.m_rgba8View.write(x, y, color, 4); + return; + } else if (this.m_rgb8View) { + color = deMath.toIVec(color); + this.m_rgb8View.write(x, y, color, 3); + return; + } + } + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + + return this._setPixelPacked(color, pixelPtr, pixelPtrOffset); +}; + +tcuTexture.PixelBufferAccess.prototype._setPixelPacked = (function () { + var pn = function(val, offs, bits) { + return tcuTexture.normFloatToChannel(val, bits) << offs; + }; + + var pu = function(val, offs, bits) { + return tcuTexture.uintToChannel(val, bits) << offs; + }; + + return function tcuTexture_PixelBufferAccess_setPixelPacked(color, pixelPtr, pixelPtrOffset) { + // Packed formats. + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNORM_SHORT_565: pixelPtr[pixelPtrOffset] = pn(color[0], 11, 5) | pn(color[1], 5, 6) | pn(color[2], 0, 5); break; + case tcuTexture.ChannelType.UNORM_SHORT_555: pixelPtr[pixelPtrOffset] = pn(color[0], 10, 5) | pn(color[1], 5, 5) | pn(color[2], 0, 5); break; + case tcuTexture.ChannelType.UNORM_SHORT_4444: pixelPtr[pixelPtrOffset] = pn(color[0], 12, 4) | pn(color[1], 8, 4) | pn(color[2], 4, 4) | pn(color[3], 0, 4); break; + case tcuTexture.ChannelType.UNORM_SHORT_5551: pixelPtr[pixelPtrOffset] = pn(color[0], 11, 5) | pn(color[1], 6, 5) | pn(color[2], 1, 5) | pn(color[3], 0, 1); break; + case tcuTexture.ChannelType.UNORM_INT_101010: pixelPtr[pixelPtrOffset] = pn(color[0], 22, 10) | pn(color[1], 12, 10) | pn(color[2], 2, 10); break; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pn(color[0], 0, 10) | pn(color[1], 10, 10) | pn(color[2], 20, 10) | pn(color[3], 30, 2); break; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pu(color[0], 0, 10) | pu(color[1], 10, 10) | pu(color[2], 20, 10) | pu(color[3], 30, 2); break; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: pixelPtr[pixelPtrOffset] = tcuTexture.packRGB999E5(color); break; + + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + // \note Stencil is always ignored. + case tcuTexture.ChannelOrder.D: pixelPtr[pixelPtrOffset] = pn(color[0], 8, 24); break; + case tcuTexture.ChannelOrder.S: pixelPtr[pixelPtrOffset] = pn(color[3], 8, 24); break; + case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pn(color[0], 8, 24) | pu(color[3], 0, 8); break; + default: + throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order); + } + break; + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: { + pixelPtr[pixelPtrOffset] = color[0]; + var u32array = new Uint32Array(this.m_data, (pixelPtrOffset * pixelPtr.BYTES_PER_ELEMENT) + this.m_offset + 4, 1); + u32array[0] = pu(color[3], 0, 8); + break; + } + + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: { + var f11 = function(value) { + return tcuFloat.numberToFloat11(value); + }; + var f10 = function(value) { + return tcuFloat.numberToFloat10(value); + }; + + pixelPtr[pixelPtrOffset] = f11(color[0]) | (f11(color[1]) << 11) | (f10(color[2]) << 22); + break; + } + case tcuTexture.ChannelType.FLOAT: + if (this.m_format.order == tcuTexture.ChannelOrder.D) { + pixelPtr[pixelPtrOffset] = color[0]; + break; + } + // else fall-through to default case! + + default: { + // Generic path. + var numChannels = tcuTexture.getNumUsedChannels(this.m_format.order); + var map = tcuTexture.getChannelWriteMap(this.m_format.order); + + for (var c = 0; c < numChannels; c++) + pixelPtr[c + pixelPtrOffset] = tcuTexture.floatToChannel(color[map[c]], this.m_format.type); + } + } + }; +})(); + +/** + * @param {Array} color Vec4 color to set (unnormalized) + * @param {number} x + * @param {number} y + * @param {number=} z + */ +tcuTexture.PixelBufferAccess.prototype.setPixelInt = function(color, x, y, z) { + z = z || 0; + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + x = Math.round(x); + y = Math.round(y); + z = Math.round(z); + + // Quick paths + if (z == 0) { + if (this.m_rgba8View) { + this.m_rgba8View.write(x, y, color, 4); + return; + } else if (this.m_rgb8View) { + this.m_rgb8View.write(x, y, color, 3); + return; + } + } + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + + var pu = function(val, offs, bits) { + return tcuTexture.uintToChannel(val, bits) << offs; + }; + + // Packed formats. + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNORM_SHORT_565: pixelPtr[pixelPtrOffset] = pu(color[0], 11, 5) | pu(color[1], 5, 6) | pu(color[2], 0, 5); break; + case tcuTexture.ChannelType.UNORM_SHORT_555: pixelPtr[pixelPtrOffset] = pu(color[0], 10, 5) | pu(color[1], 5, 5) | pu(color[2], 0, 5); break; + case tcuTexture.ChannelType.UNORM_SHORT_4444: pixelPtr[pixelPtrOffset] = pu(color[0], 12, 4) | pu(color[1], 8, 4) | pu(color[2], 4, 4) | pu(color[3], 0, 4); break; + case tcuTexture.ChannelType.UNORM_SHORT_5551: pixelPtr[pixelPtrOffset] = pu(color[0], 11, 5) | pu(color[1], 6, 5) | pu(color[2], 1, 5) | pu(color[3], 0, 1); break; + case tcuTexture.ChannelType.UNORM_INT_101010: pixelPtr[pixelPtrOffset] = pu(color[0], 22, 10) | pu(color[1], 12, 10) | pu(color[2], 2, 10); break; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pu(color[0], 0, 10) | pu(color[1], 10, 10) | pu(color[2], 20, 10) | pu(color[3], 30, 2); break; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pu(color[0], 0, 10) | pu(color[1], 10, 10) | pu(color[2], 20, 10) | pu(color[3], 30, 2); break; + + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + // \note Stencil is always ignored. + case tcuTexture.ChannelOrder.D: pixelPtr[pixelPtrOffset] = pu(color[0], 8, 24); break; + case tcuTexture.ChannelOrder.S: pixelPtr[pixelPtrOffset] = pu(color[3], 8, 24); break; + case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pu(color[0], 8, 24) | pu(color[3], 0, 8); break; + default: + throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order); + } + break; + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: { + pixelPtr[pixelPtrOffset] = color[0]; + var u32array = new Uint32Array(this.m_data, offset + this.m_offset + 4, 1); + u32array[pixelPtrOffset] = pu(color[3], 0, 8); + break; + } + + default: { + // Generic path. + var numChannels = tcuTexture.getNumUsedChannels(this.m_format.order); + var map = tcuTexture.getChannelWriteMap(this.m_format.order); + + for (var c = 0; c < numChannels; c++) + pixelPtr[c + pixelPtrOffset] = tcuTexture.intToChannel(color[map[c]], this.m_format.type); + } + } +}; + +/** + * @param {Array=} color Vec4 color to set, optional. + * @param {Array=} x Range in x axis, optional. + * @param {Array=} y Range in y axis, optional. + * @param {Array=} z Range in z axis, optional. + */ +tcuTexture.PixelBufferAccess.prototype.clear = function(color, x, y, z) { + var c = color || [0, 0, 0, 0]; + var arrayType = tcuTexture.getTypedArray(this.m_format.type); + var range_x = x || [0, this.m_width]; + var range_y = y || [0, this.m_height]; + var range_z = z || [0, this.m_depth]; + var pixelSize = this.m_format.getPixelSize(); + var numElements = pixelSize / arrayType.BYTES_PER_ELEMENT; + var width = range_x[1] - range_x[0]; + var height = range_y[1] - range_y[0]; + var depth = range_z[1] - range_z[0]; + if (x === undefined && y === undefined && z === undefined && + c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0) { + var pixelPtr = new arrayType(this.m_data, this.m_offset); + pixelPtr.fill(0); + return; + } + + //copy first pixel over other pixels in the row + var fillRow = function(pixelPtr, numElements, width) { + for (var i = 1; i < width; i++) + for (var c = 0; c < numElements; c++) + pixelPtr[i * numElements + c] = pixelPtr[c]; + }; + // copy first row to other rows in all planes + var fillPlanes = function(buffer, arrayType, src, offset, rowStride, planeStride, width, height, depth) { + for (var j = 0; j < depth; j++) + for (var i = (j == 0 ? 1 : 0); i < height; i++) { + var dst = new arrayType(buffer, offset + i * rowStride + j * planeStride, width); + dst.set(src); + } + }; + + this.setPixel(c, range_x[0], range_y[0], range_z[0]); + + var offset = range_z[0] * this.m_slicePitch + range_y[0] * this.m_rowPitch + range_x[0] * pixelSize; + var pixelPtr = new arrayType(this.m_data, offset + this.m_offset, width * numElements); + + fillRow(pixelPtr, numElements, width); + fillPlanes(this.m_data, arrayType, pixelPtr, offset + this.m_offset, this.m_rowPitch, this.m_slicePitch, width * numElements, height, depth); +}; + +/** + * @param {number} depth to set + * @param {number} x + * @param {number} y + * @param {number=} z + */ +tcuTexture.PixelBufferAccess.prototype.setPixDepth = function(depth, x, y, z) { + if (z == null) + z = 0; + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + x = Math.round(x); + y = Math.round(y); + z = Math.round(z); + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + + var pn = function(val, offs, bits) { + return tcuTexture.normFloatToChannel(val, bits) << offs; + }; + + // Packed formats. + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + case tcuTexture.ChannelOrder.D: pixelPtr[pixelPtrOffset] = pn(depth, 8, 24); break; + case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pn(depth, 8, 24) | (pixelPtr[pixelPtrOffset] & 0xFF); break; + default: + throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order); + } + break; + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS); + pixelPtr[pixelPtrOffset] = depth; + break; + } + + default: { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.D || this.m_format.order == tcuTexture.ChannelOrder.DS); + pixelPtr[pixelPtrOffset] = tcuTexture.floatToChannel(depth, this.m_format.type); + } + } +}; + +/** + * @param {number} stencil to set + * @param {number} x + * @param {number} y + * @param {number=} z + */ +tcuTexture.PixelBufferAccess.prototype.setPixStencil = function(stencil, x, y, z) { + if (z == null) + z = 0; + DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width)); + DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height)); + DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth)); + + // Make sure that the position is 'integer' + x = Math.round(x); + y = Math.round(y); + z = Math.round(z); + + var pixelSize = this.m_format.getPixelSize(); + var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize; + var pixelPtr = this.getDataPtr(); + var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT; + + var pu = function(val, offs, bits) { + return tcuTexture.uintToChannel(val, bits) << offs; + }; + + // Packed formats. + switch (this.m_format.type) { + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + switch (this.m_format.order) { + case tcuTexture.ChannelOrder.S: pixelPtr[pixelPtrOffset] = pu(stencil, 8, 24); break; + case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pu(stencil, 0, 8) | (pixelPtr[pixelPtrOffset] & 0xFFFFFF00); break; + default: + throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order); + } + break; + + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: { + var u32array = new Uint32Array(this.m_data, this.m_offset + offset + 4, 1); + u32array[0] = pu(stencil, 0, 8); + break; + } + + default: { + if (this.m_format.order == tcuTexture.ChannelOrder.S) + pixelPtr[pixelPtrOffset] = tcuTexture.floatToChannel(stencil, this.m_format.type); + else { + DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS); + pixelPtr[3 + pixelPtrOffset] = tcuTexture.floatToChannel(stencil, this.m_format.type); + } + } + } +}; + +/** + * newFromTextureLevel + * @param {tcuTexture.TextureLevel} level + * @return {tcuTexture.PixelBufferAccess} + */ +tcuTexture.PixelBufferAccess.newFromTextureLevel = function(level) { + var descriptor = new Object(); + descriptor.format = level.getFormat(); + descriptor.width = level.getWidth(); + descriptor.height = level.getHeight(); + descriptor.depth = level.m_depth; + descriptor.data = level.m_data.m_ptr; + + return new tcuTexture.PixelBufferAccess(descriptor); +}; + +/** + * newFromTextureFormat + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} rowPitch + * @param {number} slicePitch + * @param {ArrayBuffer} data + */ +tcuTexture.PixelBufferAccess.newFromTextureFormat = function(format, width, height, depth, rowPitch, slicePitch, data) { + var descriptor = new Object(); + descriptor.format = format; + descriptor.width = width; + descriptor.height = height; + descriptor.depth = depth; + descriptor.rowPitch = rowPitch; + descriptor.slicePitch = slicePitch; + descriptor.data = data; + + return new tcuTexture.PixelBufferAccess(descriptor); +}; + +/* TODO: Port */ +// { +// public: +// tcuTexture.PixelBufferAccess (void) {} +// tcuTexture.PixelBufferAccess (const tcuTexture.TextureFormat& format, int width, int height, int depth, void* data); + +// void* getDataPtr (void) const { return m_data; } + +// void setPixels (const void* buf, int bufSize) const; +// void setPixel (const tcu::Vec4& color, int x, int y, int z = 0) const; +// void setPixel (const tcu::IVec4& color, int x, int y, int z = 0) const; +// void setPixel (const tcu::UVec4& color, int x, int y, int z = 0) const { setPixel(color.cast(), x, y, z); } + +// void setPixDepth (float depth, int x, int y, int z = 0) const; +// void setPixStencil (int stencil, int x, int y, int z = 0) const; +// }; + +/** + * @constructor + * @param {tcuTexture.TextureFormat} format + * @param {number} numLevels + */ +tcuTexture.TextureLevelPyramid = function(format, numLevels) { + /* tcuTexture.TextureFormat */this.m_format = format; + /* LevelData */ this.m_data = []; + for (var i = 0; i < numLevels; i++) + this.m_data.push(new tcuTexture.DeqpArrayBuffer()); + /* {Array} */ this.m_access = []; + this.m_access.length = numLevels; +}; + +/** @return {boolean} */ +tcuTexture.TextureLevelPyramid.prototype.isLevelEmpty = function(levelNdx) { return this.m_data[levelNdx].empty(); }; +/** @return {tcuTexture.TextureFormat} */ +tcuTexture.TextureLevelPyramid.prototype.getFormat = function() { return this.m_format; }; +/** @return {number} */ +tcuTexture.TextureLevelPyramid.prototype.getNumLevels = function() { return this.m_access.length; }; +/** @return {tcuTexture.PixelBufferAccess} */ +tcuTexture.TextureLevelPyramid.prototype.getLevel = function(ndx) { return this.m_access[ndx]; }; +/** @return {Array} */ +tcuTexture.TextureLevelPyramid.prototype.getLevels = function() { return this.m_access; }; + +/** + * @param {number} levelNdx + * @param {number} width + * @param {number} height + * @param {number} depth + */ +tcuTexture.TextureLevelPyramid.prototype.allocLevel = function(levelNdx, width, height, depth) { + var size = this.m_format.getPixelSize() * width * height * depth; + + DE_ASSERT(this.isLevelEmpty(levelNdx)); + + this.m_data[levelNdx].setStorage(size); + this.m_access[levelNdx] = new tcuTexture.PixelBufferAccess({ + format: this.m_format, + width: width, + height: height, + depth: depth, + data: this.m_data[levelNdx].m_ptr + }); +}; + +tcuTexture.TextureLevelPyramid.prototype.clearLevel = function(levelNdx) { + /* TODO: Implement */ + throw new Error('Not implemented'); +}; + +/** + * @param {Array} levels + * @param {number} numLevels + * @param {tcuTexture.Sampler} sampler + * @param {number} s + * @param {number} t + * @param {number} depth (integer) + * @param {number=} lod + * @return {Array} Vec4 pixel color + */ +tcuTexture.sampleLevelArray2D = function(levels, numLevels, sampler, s, t, depth, lod) { + // z-offset in 2D textures is layer selector + return tcuTexture.sampleLevelArray2DOffset(levels, numLevels, sampler, [s, t], lod, [0, 0, depth]); +}; + +/** + * @param {Array} levels + * @param {number} numLevels + * @param {tcuTexture.Sampler} sampler + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @return {Array} Vec4 pixel color + */ +tcuTexture.sampleLevelArray3D = function(levels, numLevels, sampler, s, t, r, lod) { + return tcuTexture.sampleLevelArray3DOffset(levels, numLevels, sampler, s, t, r, lod, [0, 0, 0]); +}; + +/** + * @constructor + * @param {tcuTexture.CubeFace} face + * @param {Array} coords + */ +tcuTexture.CubeFaceCoords = function(face, coords) { + this.face = face; + this.s = coords[0]; + this.t = coords[1]; +}; + +/** + * \brief 2D Texture View + * @constructor + * @param {number} numLevels + * @param {?Array} levels + */ +tcuTexture.Texture2DView = function(numLevels, levels) { + this.m_numLevels = numLevels; + this.m_levels = levels; +}; + +/** @return {number} */ +tcuTexture.Texture2DView.prototype.getNumLevels = function() { return this.m_numLevels; }; +/** @return {number} */ +tcuTexture.Texture2DView.prototype.getWidth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getWidth() : 0; }; +/** @return {number} */ +tcuTexture.Texture2DView.prototype.getHeight = function() { return this.m_numLevels > 0 ? this.m_levels[0].getHeight() : 0; }; +/** + * @param {number} ndx + * @return {tcuTexture.ConstPixelBufferAccess} + */ +tcuTexture.Texture2DView.prototype.getLevel = function(ndx) { DE_ASSERT(deMath.deInBounds32(ndx, 0, this.m_numLevels)); return this.m_levels[ndx]; }; +/** @return {Array} */ +tcuTexture.Texture2DView.prototype.getLevels = function() { return this.m_levels; }; + +/** + * @param {number} baseLevel + * @param {number} maxLevel + * return {tcuTexture.Texture2DView} + */ +tcuTexture.Texture2DView.prototype.getSubView = function(baseLevel, maxLevel) { + var clampedBase = deMath.clamp(baseLevel, 0, this.m_numLevels - 1); + var clampedMax = deMath.clamp(maxLevel, clampedBase, this.m_numLevels - 1); + var numLevels = clampedMax - clampedBase + 1; + return new tcuTexture.Texture2DView(numLevels, this.m_levels.slice(clampedBase, numLevels)); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number=} lod + * @return {Array} Pixel color + */ +tcuTexture.Texture2DView.prototype.sample = function(sampler, texCoord, lod) { + return tcuTexture.sampleLevelArray2D(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], 0 /* depth */, lod); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number} lod + * @param {Array} offset + * @return {Array} Pixel color + */ +tcuTexture.Texture2DView.prototype.sampleOffset = function(sampler, texCoord, lod, offset) { + return tcuTexture.sampleLevelArray2DOffset(this.m_levels, this.m_numLevels, sampler, texCoord, lod, [offset[0], offset[1], 0]); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {Array} texCoord + * @param {number} lod + * @return {number} + */ +tcuTexture.Texture2DView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) { + return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [0, 0, 0]); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {Array} texCoord + * @param {number} lod + * @param {Array} offset + * @return {number} + */ +tcuTexture.Texture2DView.prototype.sampleCompareOffset = function(sampler, ref, texCoord, lod, offset) { + return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [offset[0], offset[1], 0]); +}; + + /* TODO: Port + Vec4 sample (const tcuTexture.Sampler& sampler, float s, float t, float lod) const; + Vec4 sampleOffset (const tcuTexture.Sampler& sampler, float s, float t, float lod, const IVec2& offset) const; + float sampleCompare (const tcuTexture.Sampler& sampler, float ref, float s, float t, float lod) const; + float sampleCompareOffset (const tcuTexture.Sampler& sampler, float ref, float s, float t, float lod, const IVec2& offset) const; + + Vec4 gatherOffsets (const tcuTexture.Sampler& sampler, float s, float t, int componentNdx, const IVec2 (&offsets)[4]) const; + Vec4 gatherOffsetsCompare(const tcuTexture.Sampler& sampler, float ref, float s, float t, const IVec2 (&offsets)[4]) const; + */ + +/** + * @constructor + * @param {number} numLevels + * @param {Array} levels + */ +tcuTexture.Texture2DArrayView = function(numLevels, levels) { + this.m_numLevels = numLevels; + this.m_levels = levels; +}; + +/** @return {number} */ +tcuTexture.Texture2DArrayView.prototype.getNumLevels = function() { return this.m_numLevels; }; +/** @return {number} */ +tcuTexture.Texture2DArrayView.prototype.getWidth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getWidth() : 0; }; +/** @return {number} */ +tcuTexture.Texture2DArrayView.prototype.getHeight = function() { return this.m_numLevels > 0 ? this.m_levels[0].getHeight() : 0; }; +/** @return {number} */ +tcuTexture.Texture2DArrayView.prototype.getNumLayers = function() { return this.m_numLevels > 0 ? this.m_levels[0].getDepth() : 0; }; +/** + * @param {number} ndx + * @return {tcuTexture.ConstPixelBufferAccess} + */ +tcuTexture.Texture2DArrayView.prototype.getLevel = function(ndx) { DE_ASSERT(deMath.deInBounds32(ndx, 0, this.m_numLevels)); return this.m_levels[ndx]; }; +/** @return {Array} */ +tcuTexture.Texture2DArrayView.prototype.getLevels = function() { return this.m_levels; }; + +/** + * @param {number} r + * @return {number} layer corresponding to requested sampling 'r' coordinate + */ +tcuTexture.Texture2DArrayView.prototype.selectLayer = function(r) { + DE_ASSERT(this.m_numLevels > 0 && this.m_levels); + return deMath.clamp(Math.round(r), 0, this.m_levels[0].getDepth() - 1); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number=} lod + * @return {Array} Pixel color + */ +tcuTexture.Texture2DArrayView.prototype.sample = function(sampler, texCoord, lod) { + lod = lod || 0; + return tcuTexture.sampleLevelArray2D(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], this.selectLayer(texCoord[2]), lod); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number} lod + * @param {Array} offset + * @return {Array} + */ +tcuTexture.Texture2DArrayView.prototype.sampleOffset = function(sampler, texCoord, lod, offset) { + return tcuTexture.sampleLevelArray2DOffset(this.m_levels, this.m_numLevels, sampler, texCoord, lod, [offset[0], offset[1], this.selectLayer(texCoord[2])]); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {Array} texCoord + * @param {number} lod + * @param {Array} offset + * @return {number} + */ +tcuTexture.Texture2DArrayView.prototype.sampleCompareOffset = function(sampler, ref, texCoord, lod, offset) { + return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [offset[0], offset[1], this.selectLayer(texCoord[2])]); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {Array} texCoord + * @param {number} lod + * @return {number} + */ +tcuTexture.Texture2DArrayView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) { + return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [0, 0, this.selectLayer(texCoord[2])]); +}; + +/** + * @param {Array} levels + * @param {number} numLevels + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number} lod + * @param {Array} offset + * @return {Array} + */ +tcuTexture.sampleLevelArray2DOffset = function(levels, numLevels, sampler, texCoord, lod, offset) { + /** @type {boolean} */ var magnified = lod <= sampler.lodThreshold; + /** @type {tcuTexture.FilterMode} */ var filterMode = magnified ? sampler.magFilter : sampler.minFilter; + /** @type {number} */ var maxLevel; + /** @type {tcuTexture.FilterMode} */ var levelFilter; + switch (filterMode) { + case tcuTexture.FilterMode.NEAREST: return levels[0].sample2DOffset(sampler, filterMode, texCoord[0], texCoord[1], offset); + case tcuTexture.FilterMode.LINEAR: return levels[0].sample2DOffset(sampler, filterMode, texCoord[0], texCoord[1], offset); + + case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST: + case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: + maxLevel = numLevels - 1; + /** @type {number} */ var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel); + levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + + return levels[level].sample2DOffset(sampler, levelFilter, texCoord[0], texCoord[1], offset); + + case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR: + case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: + maxLevel = numLevels - 1; + /** @type {number} */ var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel); + /** @type {number} */ var level1 = Math.min(maxLevel, level0 + 1); + levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + /** @type {number} */ var f = deMath.deFloatFrac(lod); + /** @type {Array} */ var t0 = levels[level0].sample2DOffset(sampler, levelFilter, texCoord[0], texCoord[1], offset); + /** @type {Array} */ var t1 = levels[level1].sample2DOffset(sampler, levelFilter, texCoord[0], texCoord[1], offset); + + return deMath.add(deMath.scale(t0, (1.0 - f)), deMath.scale(t1, f)); + + default: + return [0.0, 0.0, 0.0, 0.0]; + } +}; + +/** + * @constructor + * @param {number} numLevels + * @param {Array} levels + */ +tcuTexture.Texture3DView = function(numLevels, levels) { + this.m_numLevels = numLevels; + this.m_levels = levels; +}; + +/** @return {number} */ +tcuTexture.Texture3DView.prototype.getNumLevels = function() { return this.m_numLevels; }; +/** @return {number} */ +tcuTexture.Texture3DView.prototype.getWidth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getWidth() : 0; }; +/** @return {number} */ +tcuTexture.Texture3DView.prototype.getHeight = function() { return this.m_numLevels > 0 ? this.m_levels[0].getHeight() : 0; }; +/** @return {number} */ +tcuTexture.Texture3DView.prototype.getDepth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getDepth() : 0; }; +/** + * @param {number} ndx + * @return {tcuTexture.ConstPixelBufferAccess} + */ +tcuTexture.Texture3DView.prototype.getLevel = function(ndx) { DE_ASSERT(deMath.deInBounds32(ndx, 0, this.m_numLevels)); return this.m_levels[ndx]; }; +/** @return {Array} */ +tcuTexture.Texture3DView.prototype.getLevels = function() { return this.m_levels; }; + +/** + * @param {number} baseLevel + * @param {number} maxLevel + * return {tcuTexture.Texture3DView} + */ +tcuTexture.Texture3DView.prototype.getSubView = function(baseLevel, maxLevel) { + var clampedBase = deMath.clamp(baseLevel, 0, this.m_numLevels - 1); + var clampedMax = deMath.clamp(maxLevel, clampedBase, this.m_numLevels - 1); + var numLevels = clampedMax - clampedBase + 1; + return new tcuTexture.Texture3DView(numLevels, this.m_levels.slice(clampedBase, numLevels)); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number=} lod + * @return {Array} Pixel color + */ +tcuTexture.Texture3DView.prototype.sample = function(sampler, texCoord, lod) { + lod = lod || 0; + return tcuTexture.sampleLevelArray3D(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], texCoord[2], lod); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {Array} texCoord + * @param {number} lod + * @return {number} + */ +tcuTexture.Texture3DView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) { + throw new Error('Unimplemented'); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number} lod + * @param {Array} offset + * @return {Array} + */ +tcuTexture.Texture3DView.prototype.sampleOffset = function(sampler, texCoord, lod, offset) { + return tcuTexture.sampleLevelArray3DOffset(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], texCoord[2], lod, offset); +}; + +/* TODO: All view classes are very similar. They should have a common base class */ + +/** + * @param {Array} levels + * @param {number} numLevels + * @param {tcuTexture.Sampler} sampler + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @param {Array} offset + * @return {Array} + */ +tcuTexture.sampleLevelArray3DOffset = function(levels, numLevels, sampler, s, t, r, lod, offset) { + /** @type {boolean} */ var magnified = lod <= sampler.lodThreshold; + /** @type {tcuTexture.FilterMode} */ var filterMode = magnified ? sampler.magFilter : sampler.minFilter; + /** @type {number} */ var maxLevel; + /** @type {tcuTexture.FilterMode} */ var levelFilter; + switch (filterMode) { + case tcuTexture.FilterMode.NEAREST: return levels[0].sample3DOffset(sampler, filterMode, s, t, r, offset); + case tcuTexture.FilterMode.LINEAR: return levels[0].sample3DOffset(sampler, filterMode, s, t, r, offset); + + case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST: + case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: + maxLevel = numLevels - 1; + /** @type {number} */ var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel); + levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + + return levels[level].sample3DOffset(sampler, levelFilter, s, t, r, offset); + + case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR: + case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: + maxLevel = numLevels - 1; + /** @type {number} */ var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel); + /** @type {number} */ var level1 = Math.min(maxLevel, level0 + 1); + levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + /** @type {number} */ var f = deMath.deFloatFrac(lod); + /** @type {Array} */ var t0 = levels[level0].sample3DOffset(sampler, levelFilter, s, t, r, offset); + /** @type {Array} */ var t1 = levels[level1].sample3DOffset(sampler, levelFilter, s, t, r, offset); + + return deMath.add(deMath.scale(t0, (1.0 - f)), deMath.scale(t1, f)); + + default: + throw new Error('Filter mode not supported'); + } +}; + +/** + * @param {number} width + * @param {number=} height + * @param {number=} depth + * @return {number} Number of pyramid levels + */ +tcuTexture.computeMipPyramidLevels = function(width, height, depth) { + if (depth !== undefined) + return Math.floor(Math.log2(Math.max(width, Math.max(height, depth)))) + 1; + else if (height !== undefined) + return Math.floor(Math.log2(Math.max(width, height))) + 1; + else + return Math.floor(Math.log2(width)) + 1; +}; + +/** + * @param {number} baseLevelSize + * @param {number} levelNdx + */ +tcuTexture.getMipPyramidLevelSize = function(baseLevelSize, levelNdx) { + return Math.max(baseLevelSize >> levelNdx, 1); +}; + +/** + * @param {Array} faceAccesses + * @param {tcuTexture.CubeFace} baseFace + * @param {number} u + * @param {number} v + * @param {number} depth + * @return {Array>} + */ +tcuTexture.getCubeLinearSamples = function(faceAccesses, baseFace, u, v, depth) { + DE_ASSERT(faceAccesses[0].getWidth() == faceAccesses[0].getHeight()); + /** @type {Array>} */ var dst = []; + var size = faceAccesses[0].getWidth(); + var x0 = Math.floor(u - 0.5); + var x1 = x0 + 1; + var y0 = Math.floor(v - 0.5); + var y1 = y0 + 1; + var baseSampleCoords = + [ + [x0, y0], + [x1, y0], + [x0, y1], + [x1, y1] + ]; + /** @type {Array>} */ var sampleColors = []; + /** @type {Array} */ var hasBothCoordsOutOfBounds = []; //!< Whether correctCubeFace() returns CUBEFACE_LAST, i.e. both u and v are out of bounds. + + // Find correct faces and coordinates for out-of-bounds sample coordinates. + + for (var i = 0; i < 4; i++) { + /** @type {tcuTexture.CubeFaceCoords} */ var coords = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(baseFace, baseSampleCoords[i]), size); + hasBothCoordsOutOfBounds[i] = coords == null; + if (!hasBothCoordsOutOfBounds[i]) + sampleColors[i] = tcuTexture.lookup(faceAccesses[coords.face], coords.s, coords.t, depth); + } + + // If a sample was out of bounds in both u and v, we get its color from the average of the three other samples. + // \note This averaging behavior is not required by the GLES3 spec (though it is recommended). GLES3 spec only + // requires that if the three other samples all have the same color, then the doubly-out-of-bounds sample + // must have this color as well. + + var bothOutOfBoundsNdx = -1; + for (var i = 0; i < 4; i++) { + if (hasBothCoordsOutOfBounds[i]) { + DE_ASSERT(bothOutOfBoundsNdx < 0); // Only one sample can be out of bounds in both u and v. + bothOutOfBoundsNdx = i; + } + } + if (bothOutOfBoundsNdx != -1) { + sampleColors[bothOutOfBoundsNdx] = [0, 0, 0, 0]; + for (var i = 0; i < 4; i++) + if (i != bothOutOfBoundsNdx) + sampleColors[bothOutOfBoundsNdx] = deMath.add(sampleColors[bothOutOfBoundsNdx], sampleColors[i]); + + sampleColors[bothOutOfBoundsNdx] = deMath.scale(sampleColors[bothOutOfBoundsNdx], (1.0 / 3.0)); + } + + for (var i = 0; i < sampleColors.length; i++) + dst[i] = sampleColors[i]; + + return dst; +}; + +// \todo [2014-02-19 pyry] Optimize faceAccesses +/** + * @param {Array} faceAccesses + * @param {tcuTexture.CubeFace} baseFace + * @param {tcuTexture.Sampler} sampler + * @param {number} s + * @param {number} t + * @param {number} depth + * @return {Array} + */ +tcuTexture.sampleCubeSeamlessLinear = function(faceAccesses, baseFace, sampler, s, t, depth) { + DE_ASSERT(faceAccesses[0].getWidth() == faceAccesses[0].getHeight()); + + var size = faceAccesses[0].getWidth(); + // Non-normalized coordinates. + var u = s; + var v = t; + + if (sampler.normalizedCoords) { + u = tcuTexture.unnormalize(sampler.wrapS, s, size); + v = tcuTexture.unnormalize(sampler.wrapT, t, size); + } + + // Get sample colors. + + /** @type {Array>} */ var sampleColors = tcuTexture.getCubeLinearSamples(faceAccesses, baseFace, u, v, depth); + + // Interpolate. + + var a = deMath.deFloatFrac(u - 0.5); + var b = deMath.deFloatFrac(v - 0.5); + + return deMath.add((deMath.scale(deMath.scale(sampleColors[0], (1.0 - a)), (1.0 - b))), + deMath.add((deMath.scale(deMath.scale(sampleColors[1], (a)), (1.0 - b))), + deMath.add((deMath.scale(deMath.scale(sampleColors[2], (1.0 - a)), (b))), + (deMath.scale(deMath.scale(sampleColors[3], (a)), (b)))))); +}; + +/** + * @param {Array>} faces + * @param {number} numLevels + * @param {tcuTexture.CubeFace} face + * @param {tcuTexture.Sampler} sampler + * @param {number} s + * @param {number} t + * @param {number} depth + * @param {number=} lod + * @return {Array} + */ +tcuTexture.sampleLevelArrayCubeSeamless = function(faces, numLevels, face, sampler, s, t, depth, lod) { + lod = lod || 0; + var magnified = lod <= sampler.lodThreshold; + /** @type {tcuTexture.FilterMode} */ var filterMode = magnified ? sampler.magFilter : sampler.minFilter; + /** @type {Array} */ var faceAccesses = []; + /** @type {tcuTexture.FilterMode}*/ var levelFilter; + + switch (filterMode) { + case tcuTexture.FilterMode.NEAREST: + return tcuTexture.sampleCubeSeamlessNearest(faces[face][0], sampler, s, t, depth); + + case tcuTexture.FilterMode.LINEAR: { + faceAccesses = []; + for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) + faceAccesses[i] = faces[i][0]; + + return tcuTexture.sampleCubeSeamlessLinear(faceAccesses, face, sampler, s, t, depth); + } + + case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST: + case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: { + var maxLevel = numLevels - 1; + var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel); + levelFilter = (filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + + if (levelFilter == tcuTexture.FilterMode.NEAREST) + return tcuTexture.sampleCubeSeamlessNearest(faces[face][level], sampler, s, t, depth); + else { + DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR); + + faceAccesses = []; + for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) + faceAccesses[i] = faces[i][level]; + + return tcuTexture.sampleCubeSeamlessLinear(faceAccesses, face, sampler, s, t, depth); + } + } + + case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR: + case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: { + var maxLevel = numLevels - 1; + var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel); + var level1 = Math.min(maxLevel, level0 + 1); + levelFilter = (filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + var f = deMath.deFloatFrac(lod); + var t0 = []; + var t1 = []; + + if (levelFilter == tcuTexture.FilterMode.NEAREST) { + t0 = tcuTexture.sampleCubeSeamlessNearest(faces[face][level0], sampler, s, t, depth); + t1 = tcuTexture.sampleCubeSeamlessNearest(faces[face][level1], sampler, s, t, depth); + } else { + DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR); + + /** @type {Array}*/ var faceAccesses0 = []; + /** @type {Array}*/ var faceAccesses1 = []; + for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) { + faceAccesses0[i] = faces[i][level0]; + faceAccesses1[i] = faces[i][level1]; + } + + t0 = tcuTexture.sampleCubeSeamlessLinear(faceAccesses0, face, sampler, s, t, depth); + t1 = tcuTexture.sampleCubeSeamlessLinear(faceAccesses1, face, sampler, s, t, depth); + } + + return deMath.add(deMath.scale(t0, (1.0 - f)), deMath.scale(t1, f)); + } + + default: + throw new Error('Unsupported filter mode'); + } +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} faceAccess + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number=} depth + * @return {number} + */ +tcuTexture.sampleCubeSeamlessNearestCompare = function(faceAccess, sampler, ref, s, t, depth) { + depth = depth ? depth : 0; + /** @type {tcuTexture.Sampler} */ var clampingSampler = deUtil.clone(sampler); + clampingSampler.wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE; + clampingSampler.wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE; + return faceAccess.sample2DCompare(clampingSampler, tcuTexture.FilterMode.NEAREST, ref, s, t, [0, 0, depth]); +}; + +/** + * @param {Array} faceAccesses + * @param {tcuTexture.CubeFace} baseFace + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {number} s + * @param {number} t + * @return {number} + */ +tcuTexture.sampleCubeSeamlessLinearCompare = function(faceAccesses, baseFace, sampler, ref, s, t) { + DE_ASSERT(faceAccesses[0].getWidth() == faceAccesses[0].getHeight()); + + var size = faceAccesses[0].getWidth(); + // Non-normalized coordinates. + var u = s; + var v = t; + + if (sampler.normalizedCoords) { + u = tcuTexture.unnormalize(sampler.wrapS, s, size); + v = tcuTexture.unnormalize(sampler.wrapT, t, size); + } + + var x0 = Math.floor(u - 0.5); + var x1 = x0 + 1; + var y0 = Math.floor(v - 0.5); + var y1 = y0 + 1; + var baseSampleCoords = [ + [x0, y0], + [x1, y0], + [x0, y1], + [x1, y1] + ]; + var sampleRes = []; + var hasBothCoordsOutOfBounds = []; //!< Whether correctCubeFace() returns CUBEFACE_LAST, i.e. both u and v are out of bounds. + + // Find correct faces and coordinates for out-of-bounds sample coordinates. + + for (var i = 0; i < 4; i++) { + /** @type {tcuTexture.CubeFaceCoords} */ var coords = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(baseFace, baseSampleCoords[i]), size); + hasBothCoordsOutOfBounds[i] = coords == null; + + if (!hasBothCoordsOutOfBounds[i]) { + var isFixedPointDepth = tcuTexture.isFixedPointDepthTextureFormat(faceAccesses[coords.face].getFormat()); + + sampleRes[i] = tcuTexture.execCompare(faceAccesses[coords.face].getPixel(coords.s, coords.t), sampler.compare, sampler.compareChannel, ref, isFixedPointDepth); + } + } + + // If a sample was out of bounds in both u and v, we get its color from the average of the three other samples. + // \note This averaging behavior is not required by the GLES3 spec (though it is recommended). GLES3 spec only + // requires that if the three other samples all have the same color, then the doubly-out-of-bounds sample + // must have this color as well. + + var bothOutOfBoundsNdx = -1; + for (var i = 0; i < 4; i++) { + if (hasBothCoordsOutOfBounds[i]) { + DE_ASSERT(bothOutOfBoundsNdx < 0); // Only one sample can be out of bounds in both u and v. + bothOutOfBoundsNdx = i; + } + } + if (bothOutOfBoundsNdx != -1) { + sampleRes[bothOutOfBoundsNdx] = 0.0; + for (var i = 0; i < 4; i++) + if (i != bothOutOfBoundsNdx) + sampleRes[bothOutOfBoundsNdx] += sampleRes[i]; + + sampleRes[bothOutOfBoundsNdx] = sampleRes[bothOutOfBoundsNdx] * (1.0 / 3.0); + } + + // Interpolate. + + var a = deMath.deFloatFrac(u - 0.5); + var b = deMath.deFloatFrac(v - 0.5); + + return (sampleRes[0] * (1.0 - a) * (1.0 - b)) + + (sampleRes[1] * (a) * (1.0 - b)) + + (sampleRes[2] * (1.0 - a) * (b)) + + (sampleRes[3] * (a) * (b)); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} faceAccess + * @param {tcuTexture.Sampler} sampler + * @param {number} s + * @param {number} t + * @param {number} depth + * @return {Array} + */ +tcuTexture.sampleCubeSeamlessNearest = function(faceAccess, sampler, s, t, depth) { + /** @type {tcuTexture.Sampler} */ var clampingSampler = sampler; + clampingSampler.wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE; + clampingSampler.wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE; + return faceAccess.sample2D(clampingSampler, tcuTexture.FilterMode.NEAREST, s, t, depth); +}; + +/** + * @param {Array} coords Vec3 cube coordinates + * @return {tcuTexture.CubeFaceCoords} + */ +tcuTexture.getCubeFaceCoords = function(coords) { + var face = tcuTexture.selectCubeFace(coords); + return new tcuTexture.CubeFaceCoords(face, tcuTexture.projectToFace(face, coords)); +}; + +/** + * @param {Array>} faces + * @param {number} numLevels + * @param {tcuTexture.CubeFace} face + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number} lod + * @return {number} + */ +tcuTexture.sampleLevelArrayCubeSeamlessCompare = function(faces, numLevels, face, sampler, ref, s, t, lod) { + var magnified = lod <= sampler.lodThreshold; + /** @type {tcuTexture.FilterMode}*/ var filterMode = magnified ? sampler.magFilter : sampler.minFilter; + /** @type {Array} */ var faceAccesses = []; + /** @type {tcuTexture.FilterMode} */ var levelFilter; + + switch (filterMode) { + case tcuTexture.FilterMode.NEAREST: + return tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][0], sampler, ref, s, t); + + case tcuTexture.FilterMode.LINEAR: { + faceAccesses = []; + for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) + faceAccesses[i] = faces[i][0]; + + return tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses, face, sampler, ref, s, t); + } + + case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST: + case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: { + var maxLevel = numLevels - 1; + var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel); + levelFilter = filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + + if (levelFilter == tcuTexture.FilterMode.NEAREST) + return tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][level], sampler, ref, s, t); + else { + DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR); + + faceAccesses = []; + for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) + faceAccesses[i] = faces[i][level]; + + return tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses, face, sampler, ref, s, t); + } + } + + case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR: + case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: { + var maxLevel = numLevels - 1; + var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel); + var level1 = Math.min(maxLevel, level0 + 1); + levelFilter = (filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + var f = deMath.deFloatFrac(lod); + var t0; + var t1; + + if (levelFilter == tcuTexture.FilterMode.NEAREST) { + t0 = tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][level0], sampler, ref, s, t); + t1 = tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][level1], sampler, ref, s, t); + } else { + DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR); + + /** @type {Array} */ var faceAccesses0 = []; + /** @type {Array} */ var faceAccesses1 = []; + for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) { + faceAccesses0[i] = faces[i][level0]; + faceAccesses1[i] = faces[i][level1]; + } + + t0 = tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses0, face, sampler, ref, s, t); + t1 = tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses1, face, sampler, ref, s, t); + } + + return t0 * (1.0 - f) + t1 * f; + } + + default: + throw new Error('Unsupported filter mode'); + } +}; + +/** + * @constructor + * @extends {tcuTexture.TextureLevelPyramid} + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + */ +tcuTexture.Texture2D = function(format, width, height) { + tcuTexture.TextureLevelPyramid.call(this, format, tcuTexture.computeMipPyramidLevels(width, height)); + this.m_width = width; + this.m_height = height; + this.m_view = new tcuTexture.Texture2DView(this.getNumLevels(), this.getLevels()); +}; + +tcuTexture.Texture2D.prototype = Object.create(tcuTexture.TextureLevelPyramid.prototype); +tcuTexture.Texture2D.prototype.constructor = tcuTexture.Texture2D; + +tcuTexture.Texture2D.prototype.getWidth = function() { return this.m_width; }; +tcuTexture.Texture2D.prototype.getHeight = function() { return this.m_height; }; +/** @return {tcuTexture.Texture2DView} */ +tcuTexture.Texture2D.prototype.getView = function() { return this.m_view; }; + +/** + * @param {number} baseLevel + * @param {number} maxLevel + * @return {tcuTexture.Texture2DView} + */ +tcuTexture.Texture2D.prototype.getSubView = function(baseLevel, maxLevel) { return this.m_view.getSubView(baseLevel, maxLevel); }; + +/** + * @param {number} levelNdx + */ +tcuTexture.Texture2D.prototype.allocLevel = function(levelNdx) { + DE_ASSERT(deMath.deInBounds32(levelNdx, 0, this.getNumLevels())); + + var width = tcuTexture.getMipPyramidLevelSize(this.m_width, levelNdx); + var height = tcuTexture.getMipPyramidLevelSize(this.m_height, levelNdx); + + tcuTexture.TextureLevelPyramid.prototype.allocLevel.call(this, levelNdx, width, height, 1); +}; + +/** + * @constructor + * @extends {tcuTexture.TextureLevelPyramid} + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} numLayers + */ +tcuTexture.Texture2DArray = function(format, width, height, numLayers) { + tcuTexture.TextureLevelPyramid.call(this, format, tcuTexture.computeMipPyramidLevels(width, height)); + this.m_width = width; + this.m_height = height; + this.m_numLayers = numLayers; + this.m_view = new tcuTexture.Texture2DArrayView(this.getNumLevels(), this.getLevels()); +}; + +tcuTexture.Texture2DArray.prototype = Object.create(tcuTexture.TextureLevelPyramid.prototype); +tcuTexture.Texture2DArray.prototype.constructor = tcuTexture.Texture2DArray; +/** @return {tcuTexture.Texture2DArrayView} */ +tcuTexture.Texture2DArray.prototype.getView = function() { return this.m_view; }; + +/** @return {number} */ +tcuTexture.Texture2DArray.prototype.getWidth = function() { return this.m_width; }; + +/** @return {number} */ +tcuTexture.Texture2DArray.prototype.getHeight = function() { return this.m_height; }; + +/** + * @param {number} levelNdx + */ +tcuTexture.Texture2DArray.prototype.allocLevel = function(levelNdx) { + DE_ASSERT(deMath.deInBounds32(levelNdx, 0, this.getNumLevels())); + + var width = tcuTexture.getMipPyramidLevelSize(this.m_width, levelNdx); + var height = tcuTexture.getMipPyramidLevelSize(this.m_height, levelNdx); + + tcuTexture.TextureLevelPyramid.prototype.allocLevel.call(this, levelNdx, width, height, this.m_numLayers); +}; + +/** + * @constructor + * @extends {tcuTexture.TextureLevelPyramid} + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} depth + */ +tcuTexture.Texture3D = function(format, width, height, depth) { + tcuTexture.TextureLevelPyramid.call(this, format, tcuTexture.computeMipPyramidLevels(width, height, depth)); + this.m_width = width; + this.m_height = height; + this.m_depth = depth; + this.m_view = new tcuTexture.Texture3DView(this.getNumLevels(), this.getLevels()); +}; + +tcuTexture.Texture3D.prototype = Object.create(tcuTexture.TextureLevelPyramid.prototype); +tcuTexture.Texture3D.prototype.constructor = tcuTexture.Texture3D; + +tcuTexture.Texture3D.prototype.getWidth = function() { return this.m_width; }; +tcuTexture.Texture3D.prototype.getHeight = function() { return this.m_height; }; +tcuTexture.Texture3D.prototype.getDepth = function() { return this.m_depth; }; +tcuTexture.Texture3D.prototype.getView = function() { return this.m_view; }; +/** + * @param {number} baseLevel + * @param {number} maxLevel + * @return {tcuTexture.Texture3DView} + */ +tcuTexture.Texture3D.prototype.getSubView = function(baseLevel, maxLevel) { return this.m_view.getSubView(baseLevel, maxLevel); }; + +/** + * @param {number} levelNdx + */ +tcuTexture.Texture3D.prototype.allocLevel = function(levelNdx) { + DE_ASSERT(deMath.deInBounds32(levelNdx, 0, this.getNumLevels())); + + var width = tcuTexture.getMipPyramidLevelSize(this.m_width, levelNdx); + var height = tcuTexture.getMipPyramidLevelSize(this.m_height, levelNdx); + var depth = tcuTexture.getMipPyramidLevelSize(this.m_depth, levelNdx); + + tcuTexture.TextureLevelPyramid.prototype.allocLevel.call(this, levelNdx, width, height, depth); +}; + +/** + * @constructor + * @param {number} numLevels + * @param {Array>} levels + */ +tcuTexture.TextureCubeView = function(numLevels, levels) { + this.m_numLevels = numLevels; + this.m_levels = levels; +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number=} lod + * @return {Array} Pixel color + */ +tcuTexture.TextureCubeView.prototype.sample = function(sampler, texCoord, lod) { + DE_ASSERT(sampler.compare == tcuTexture.CompareMode.COMPAREMODE_NONE); + + // Computes (face, s, t). + var coords = tcuTexture.getCubeFaceCoords(texCoord); + if (sampler.seamlessCubeMap) + return tcuTexture.sampleLevelArrayCubeSeamless(this.m_levels, this.m_numLevels, coords.face, sampler, coords.s, coords.t, 0 /* depth */, lod); + else + return tcuTexture.sampleLevelArray2D(this.m_levels[coords.face], this.m_numLevels, sampler, coords.s, coords.t, 0 /* depth */, lod); +}; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {number} ref + * @param {Array} texCoord + * @param {number} lod + * @return {number} + */ +tcuTexture.TextureCubeView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) { + DE_ASSERT(sampler.compare != tcuTexture.CompareMode.COMPAREMODE_NONE); + + // Computes (face, s, t). + var coords = tcuTexture.getCubeFaceCoords(texCoord); + if (sampler.seamlessCubeMap) + return tcuTexture.sampleLevelArrayCubeSeamlessCompare(this.m_levels, this.m_numLevels, coords.face, sampler, ref, coords.s, coords.t, lod); + else + return tcuTexture.sampleLevelArray2DCompare(this.m_levels[coords.face], this.m_numLevels, sampler, ref, coords.s, coords.t, lod, [0, 0, 0]); +}; + +/** + * @param {tcuTexture.CubeFace} face + * @return {Array} + */ +tcuTexture.TextureCubeView.prototype.getFaceLevels = function(face) { return this.m_levels[face]; }; +/** @return {number} */ +tcuTexture.TextureCubeView.prototype.getSize = function() { return this.m_numLevels > 0 ? this.m_levels[0][0].getWidth() : 0; }; + +/** @return {number} */ +tcuTexture.TextureCubeView.prototype.getNumLevels = function() { return this.m_numLevels; }; + +/** + * @param {number} ndx + * @param {tcuTexture.CubeFace} face + * @return {tcuTexture.ConstPixelBufferAccess} + */ +tcuTexture.TextureCubeView.prototype.getLevelFace = function(ndx, face) { + assertMsgOptions(0 <= ndx && ndx < this.m_numLevels, '', false, true); + return this.m_levels[face][ndx]; +}; + +/** + * @param {number} baseLevel + * @param {number} maxLevel + * @return {tcuTexture.TextureCubeView} + */ +tcuTexture.TextureCubeView.prototype.getSubView = function(baseLevel, maxLevel) { + var clampedBase = deMath.clamp(baseLevel, 0, this.m_numLevels - 1); + var clampedMax = deMath.clamp(maxLevel, clampedBase, this.m_numLevels - 1); + var numLevels = clampedMax - clampedBase + 1; + var levels = []; + for (var face in tcuTexture.CubeFace) + levels.push(this.getFaceLevels(tcuTexture.CubeFace[face]).slice(clampedBase, numLevels)); + + return new tcuTexture.TextureCubeView(numLevels, levels); +}; + +/** + * @constructor + * @param {tcuTexture.TextureFormat} format + * @param {number} size + */ +tcuTexture.TextureCube = function(format, size) { + this.m_format = format; + this.m_size = size; + this.m_data = []; + this.m_data.length = Object.keys(tcuTexture.CubeFace).length; + this.m_access = []; + this.m_access.length = Object.keys(tcuTexture.CubeFace).length; + + var numLevels = tcuTexture.computeMipPyramidLevels(this.m_size); + var levels = []; + levels.length = Object.keys(tcuTexture.CubeFace).length; + + for (var face in tcuTexture.CubeFace) { + this.m_data[tcuTexture.CubeFace[face]] = []; + for (var i = 0; i < numLevels; i++) + this.m_data[tcuTexture.CubeFace[face]].push(new tcuTexture.DeqpArrayBuffer()); + this.m_access[tcuTexture.CubeFace[face]] = []; + this.m_access[tcuTexture.CubeFace[face]].length = numLevels; + levels[tcuTexture.CubeFace[face]] = this.m_access[tcuTexture.CubeFace[face]]; + } + + this.m_view = new tcuTexture.TextureCubeView(numLevels, levels); +}; + +/** @return {tcuTexture.TextureFormat} */ +tcuTexture.TextureCube.prototype.getFormat = function() { return this.m_format; }; +/** @return {number} */ +tcuTexture.TextureCube.prototype.getSize = function() { return this.m_size; }; +/** @return {tcuTexture.TextureCubeView} */ +tcuTexture.TextureCube.prototype.getView = function() { return this.m_view; }; +/** + * @param {number} ndx Level index + * @param {tcuTexture.CubeFace} face + * @return {tcuTexture.PixelBufferAccess} + */ +tcuTexture.TextureCube.prototype.getLevelFace = function(ndx, face) { return this.m_access[face][ndx]; }; +/** @return {number} */ +tcuTexture.TextureCube.prototype.getNumLevels = function() { return this.m_access[0].length; }; + +/** + * @param {tcuTexture.Sampler} sampler + * @param {Array} texCoord + * @param {number} lod + * @return {Array} Pixel color + */ +tcuTexture.TextureCube.prototype.sample = function(sampler, texCoord, lod) { + return this.m_view.sample(sampler, texCoord, lod); +}; + +/** + * @param {number} baseLevel + * @param {number} maxLevel + * @return {tcuTexture.TextureCubeView} + */ +tcuTexture.TextureCube.prototype.getSubView = function(baseLevel, maxLevel) { return this.m_view.getSubView(baseLevel, maxLevel); }; + +/** + * @param {tcuTexture.CubeFace} face + * @param {number} levelNdx + * @return {boolean} + */ +tcuTexture.TextureCube.prototype.isLevelEmpty = function(face, levelNdx) { + return this.m_data[face][levelNdx].empty(); +}; + +/** + * @param {tcuTexture.CubeFace} face + * @param {number} levelNdx + */ +tcuTexture.TextureCube.prototype.allocLevel = function(face, levelNdx) { + /** @const */ var size = tcuTexture.getMipPyramidLevelSize(this.m_size, levelNdx); + /** @const*/ var dataSize = this.m_format.getPixelSize() * size * size; + DE_ASSERT(this.isLevelEmpty(face, levelNdx)); + + this.m_data[face][levelNdx].setStorage(dataSize); + this.m_access[face][levelNdx] = new tcuTexture.PixelBufferAccess({ + format: this.m_format, + width: size, + height: size, + depth: 1, + data: this.m_data[face][levelNdx].m_ptr + }); +}; + +/** + * @param {Array} coords Cube coordinates + * @return {tcuTexture.CubeFace} + */ +tcuTexture.selectCubeFace = function(coords) { + var x = coords[0]; + var y = coords[1]; + var z = coords[2]; + var ax = Math.abs(x); + var ay = Math.abs(y); + var az = Math.abs(z); + + if (ay < ax && az < ax) + return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; + else if (ax < ay && az < ay) + return y >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y; + else if (ax < az && ay < az) + return z >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z; + else { + // Some of the components are equal. Use tie-breaking rule. + if (ax == ay) { + if (ax < az) + return z >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z; + else + return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; + } else if (ax == az) { + if (az < ay) + return y >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y; + else + return z >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z; + } else if (ay == az) { + if (ay < ax) + return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; + else + return y >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y; + } else + return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; + } +}; + +/** + * @param {tcuTexture.CubeFace} face + * @param {Array} coord Cube coordinates (Vec3) + * @return {Array} face coordinates (Vec2) + */ +tcuTexture.projectToFace = function(face, coord) { + var rx = coord[0]; + var ry = coord[1]; + var rz = coord[2]; + var sc = 0; + var tc = 0; + var ma = 0; + + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: sc = +rz; tc = -ry; ma = -rx; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: sc = -rz; tc = -ry; ma = +rx; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: sc = +rx; tc = -rz; ma = -ry; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: sc = +rx; tc = +rz; ma = +ry; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: sc = -rx; tc = -ry; ma = -rz; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: sc = +rx; tc = -ry; ma = +rz; break; + default: + throw new Error('Unrecognized face ' + face); + } + + // Compute s, t + var s = ((sc / ma) + 1) / 2; + var t = ((tc / ma) + 1) / 2; + + return [s, t]; +}; + +/** + * @constructor + * @param {tcuTexture.TextureFormat} format + * @param {number=} width + * @param {number=} height + * @param {number=} depth + */ +tcuTexture.TextureLevel = function(format, width, height, depth) { + this.m_format = format; + this.m_width = width || 0; + this.m_height = height || 0; + this.m_depth = depth === undefined ? 1 : depth; + this.m_data = new tcuTexture.DeqpArrayBuffer(); + this.setSize(this.m_width, this.m_height, this.m_depth); +}; + +tcuTexture.TextureLevel.prototype.constructor = tcuTexture.TextureLevel; + +/** + * @param {tcuTexture.TextureFormat} format + * @param {number=} width + * @param {number=} height + * @param {number=} depth + */ +tcuTexture.TextureLevel.prototype.setStorage = function(format, width, height, depth) { + this.m_format = format; + this.setSize(width, height, depth); +}; + +/** + * @param {number=} width + * @param {number=} height + * @param {number=} depth + */ +tcuTexture.TextureLevel.prototype.setSize = function(width, height, depth) { + var pixelSize = this.m_format.getPixelSize(); + + this.m_width = width || 0; + this.m_height = height || 0; + this.m_depth = depth === undefined ? 1 : depth; + + this.m_data.setStorage(this.m_width * this.m_height * this.m_depth * pixelSize); +}; + +/** + * @return {tcuTexture.PixelBufferAccess} + */ +tcuTexture.TextureLevel.prototype.getAccess = function() { + return new tcuTexture.PixelBufferAccess({ + format: this.m_format, + width: this.m_width, + height: this.m_height, + depth: this.m_depth, + data: this.m_data.m_ptr + }); + +}; + +/** + * @return {number} + */ +tcuTexture.TextureLevel.prototype.getWidth = function() { + return this.m_width; +}; + +/** + * @return {number} + */ +tcuTexture.TextureLevel.prototype.getHeight = function() { + return this.m_height; +}; + +/** + * @return {number} + */ +tcuTexture.TextureLevel.prototype.getDepth = function() { + return this.m_depth; +}; + +/** + * @return {?tcuTexture.TextureFormat} + */ +tcuTexture.TextureLevel.prototype.getFormat = function() { + return this.m_format; +}; + +/** + * Checks if origCoords.coords is in bounds defined by size; if not, return a CubeFaceCoords with face set to the appropriate neighboring face and coords transformed accordingly. + * \note If both x and y in origCoords.coords are out of bounds, this returns with face CUBEFACE_LAST, signifying that there is no unique neighboring face. + * @param {tcuTexture.CubeFaceCoords} origCoords + * @param {number} size + * @return {tcuTexture.CubeFaceCoords} + */ +tcuTexture.remapCubeEdgeCoords = function(origCoords, size) { + var uInBounds = deMath.deInBounds32(origCoords.s, 0, size); + var vInBounds = deMath.deInBounds32(origCoords.t, 0, size); + + if (uInBounds && vInBounds) + return origCoords; + + if (!uInBounds && !vInBounds) + return null; + + var coords = [ + tcuTexture.wrap(tcuTexture.WrapMode.CLAMP_TO_BORDER, origCoords.s, size), + tcuTexture.wrap(tcuTexture.WrapMode.CLAMP_TO_BORDER, origCoords.t, size)]; + var canonizedCoords = []; + + // Map the uv coordinates to canonized 3d coordinates. + + switch (origCoords.face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: canonizedCoords = [0, size - 1 - coords[1], coords[0]]; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: canonizedCoords = [size - 1, size - 1 - coords[1], size - 1 - coords[0]]; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: canonizedCoords = [coords[0], 0, size - 1 - coords[1]]; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: canonizedCoords = [coords[0], size - 1, coords[1]]; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: canonizedCoords = [size - 1 - coords[0], size - 1 - coords[1], 0]; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: canonizedCoords = [coords[0], size - 1 - coords[1], size - 1]; break; + default: throw new Error('Invalid cube face:' + origCoords.face); + } + + // Find an appropriate face to re-map the coordinates to. + + if (canonizedCoords[0] == -1) + return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X, [canonizedCoords[2], size - 1 - canonizedCoords[1]]); + + if (canonizedCoords[0] == size) + return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X, [size - 1 - canonizedCoords[2], size - 1 - canonizedCoords[1]]); + + if (canonizedCoords[1] == -1) + return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y, [canonizedCoords[0], size - 1 - canonizedCoords[2]]); + + if (canonizedCoords[1] == size) + return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y, [canonizedCoords[0], canonizedCoords[2]]); + + if (canonizedCoords[2] == -1) + return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z, [size - 1 - canonizedCoords[0], size - 1 - canonizedCoords[1]]); + + if (canonizedCoords[2] == size) + return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z, [canonizedCoords[0], size - 1 - canonizedCoords[1]]); + + throw new Error('Cannot remap cube coordinates'); +}; + +/** + * @constructor + * @param {tcuTexture.ConstPixelBufferAccess} src + */ +tcuTexture.RGBA8View = function(src) { + this.src = src; + this.data = new Uint8Array(src.getBuffer(), src.m_offset); + this.stride = src.getRowPitch(); + this.width = src.getWidth(); + this.height = src.getHeight(); + this.pixelSize = src.getFormat().getPixelSize(); +}; + +/** + * @return {tcuTexture.TextureFormat} + */ +tcuTexture.RGBA8View.prototype.getFormat = function() { return this.src.getFormat(); }; + +/** + * Read a pixel + * @param {number} x + * @param {number} y + * @param {number=} numChannels + * @return {Array} + */ +tcuTexture.RGBA8View.prototype.read = function(x, y, numChannels) { + numChannels = numChannels || 4; + var offset = y * this.stride + x * this.pixelSize; + /* Always return a vec4 */ + var result = [0, 0, 0, 255]; + for (var i = 0; i < numChannels; i++) + result[i] = this.data[offset + i]; + return result; +}; + +/** + * Read a pixel into a Uint32 + * @param {number} x + * @param {number} y + * @return {number} + */ +tcuTexture.RGBA8View.prototype.readUintRGBA8 = function(x, y) { + var offset = y * this.stride + x * this.pixelSize; + return ((this.data[offset] & 0xff) << 24) + + ((this.data[offset + 1] & 0xff) << 16) + + ((this.data[offset + 2] & 0xff) << 8) + + (this.data[offset + 3] & 0xff); +}; + +/** + * Write a pixel + * @param {number} x + * @param {number} y + * @param {Array} value + * @param {number=} numChannels + */ +tcuTexture.RGBA8View.prototype.write = function(x, y, value, numChannels) { + numChannels = numChannels || 4; + var offset = y * this.stride + x * this.pixelSize; + for (var i = 0; i < numChannels; i++) + this.data[offset + i] = value[i]; +}; + +tcuTexture.RGBA8View.prototype.getWidth = function() { return this.width; }; + +tcuTexture.RGBA8View.prototype.getHeight = function() { return this.height; }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js new file mode 100644 index 000000000..40450ab38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js @@ -0,0 +1,725 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a tcuTextureUtil.copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.common.tcuTextureUtil'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); + +goog.scope(function() { + +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var deRandom = framework.delibs.debase.deRandom; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +/** + * @param {number} t + * @param {number} minVal + * @param {number} maxVal + * @return {number} + */ +tcuTextureUtil.linearInterpolate = function(t, minVal, maxVal) { + return minVal + (maxVal - minVal) * t; +}; + +/** tcuTextureUtil.linearChannelToSRGB + * @param {number} cl + * @return {number} + */ +tcuTextureUtil.linearChannelToSRGB = function(cl) { + if (cl <= 0.0) + return 0.0; + else if (cl < 0.0031308) + return 12.92 * cl; + else if (cl < 1.0) + return 1.055 * Math.pow(cl, 0.41666) - 0.055; + else + return 1.0; +}; + +/** + * Convert sRGB to linear colorspace + * @param {Array} cs + * @return {Array} + */ +tcuTextureUtil.sRGBToLinear = function(cs) { + return [tcuTextureUtil.sRGBChannelToLinear(cs[0]), + tcuTextureUtil.sRGBChannelToLinear(cs[1]), + tcuTextureUtil.sRGBChannelToLinear(cs[2]), + cs[3]]; +}; + +/** + * @param {number} cs + * @return {number} + */ + tcuTextureUtil.sRGBChannelToLinear = function(cs) { + if (cs <= 0.04045) + return cs / 12.92; + else + return Math.pow((cs + 0.055) / 1.055, 2.4); +}; + +/** tcuTextureUtil.linearToSRGB + * @param {Array} cl + * @return {Array} + */ +tcuTextureUtil.linearToSRGB = function(cl) { + return [tcuTextureUtil.linearChannelToSRGB(cl[0]), + tcuTextureUtil.linearChannelToSRGB(cl[1]), + tcuTextureUtil.linearChannelToSRGB(cl[2]), + cl[3] + ]; +}; + +/** + * tcuTextureUtil.getSubregion + * @param {tcuTexture.PixelBufferAccess} access + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} width + * @param {number} height + * @param {number} depth + * @return {tcuTexture.PixelBufferAccess} + */ +tcuTextureUtil.getSubregion = function(access, x, y, z, width, height, depth) { + + DE_ASSERT(deMath.deInBounds32(x, 0, access.getWidth()) && deMath.deInRange32(x + width, x, access.getWidth())); + DE_ASSERT(deMath.deInBounds32(y, 0, access.getHeight()) && deMath.deInRange32(y + height, y, access.getHeight())); + DE_ASSERT(deMath.deInBounds32(z, 0, access.getDepth()) && deMath.deInRange32(z + depth, z, access.getDepth())); + + return new tcuTexture.PixelBufferAccess({ + format: access.getFormat(), + width: width, + height: height, + depth: depth, + rowPitch: access.getRowPitch(), + slicePitch: access.getSlicePitch(), + offset: access.m_offset + access.getFormat().getPixelSize() * x + access.getRowPitch() * y + access.getSlicePitch() * z, + data: access.getBuffer() + }); +}; + +/** + * @param {tcuTexture.PixelBufferAccess} access + * @param {Array} minVal + * @param {Array} maxVal + */ +tcuTextureUtil.fillWithComponentGradients1D = function(access, minVal, maxVal) { + DE_ASSERT(access.getHeight() == 1); + for (var x = 0; x < access.getWidth(); x++) { + var s = (x + 0.5) / access.getWidth(); + + var r = tcuTextureUtil.linearInterpolate(s, minVal[0], maxVal[0]); + var g = tcuTextureUtil.linearInterpolate(s, minVal[1], maxVal[1]); + var b = tcuTextureUtil.linearInterpolate(s, minVal[2], maxVal[2]); + var a = tcuTextureUtil.linearInterpolate(s, minVal[3], maxVal[3]); + + access.setPixel([r, g, b, a], x, 0); + } +}; + +/** + * @param {tcuTexture.PixelBufferAccess} access + * @param {Array} minVal + * @param {Array} maxVal + */ +tcuTextureUtil.fillWithComponentGradients2D = function(access, minVal, maxVal) { + for (var y = 0; y < access.getHeight(); y++) { + var t = (y + 0.5) / access.getHeight(); + for (var x = 0; x < access.getWidth(); x++) { + var s = (x + 0.5) / access.getWidth(); + + var r = tcuTextureUtil.linearInterpolate((s + t) * 0.5, minVal[0], maxVal[0]); + var g = tcuTextureUtil.linearInterpolate((s + (1 - t)) * 0.5, minVal[1], maxVal[1]); + var b = tcuTextureUtil.linearInterpolate(((1 - s) + t) * 0.5, minVal[2], maxVal[2]); + var a = tcuTextureUtil.linearInterpolate(((1 - s) + (1 - t)) * 0.5, minVal[3], maxVal[3]); + + access.setPixel([r, g, b, a], x, y); + } + } +}; + +/** + * @param {tcuTexture.PixelBufferAccess} dst + * @param {Array} minVal + * @param {Array} maxVal + */ +tcuTextureUtil.fillWithComponentGradients3D = function(dst, minVal, maxVal) { + for (var z = 0; z < dst.getDepth(); z++) { + var p = (z + 0.5) / dst.getDepth(); + var b = tcuTextureUtil.linearInterpolate(p, minVal[2], maxVal[2]); + for (var y = 0; y < dst.getHeight(); y++) { + var t = (y + 0.5) / dst.getHeight(); + var g = tcuTextureUtil.linearInterpolate(t, minVal[1], maxVal[1]); + for (var x = 0; x < dst.getWidth(); x++) { + var s = (x + 0.5) / dst.getWidth(); + var r = tcuTextureUtil.linearInterpolate(s, minVal[0], maxVal[0]); + var a = tcuTextureUtil.linearInterpolate(1 - (s + t + p) / 3, minVal[3], maxVal[3]); + dst.setPixel([r, g, b, a], x, y, z); + } + } + } +}; + +/** + * @param {tcuTexture.PixelBufferAccess} access + * @param {Array} minVal + * @param {Array} maxVal + */ +tcuTextureUtil.fillWithComponentGradients = function(access, minVal, maxVal) { + if (access.getHeight() == 1 && access.getDepth() == 1) + tcuTextureUtil.fillWithComponentGradients1D(access, minVal, maxVal); + else if (access.getDepth() == 1) + tcuTextureUtil.fillWithComponentGradients2D(access, minVal, maxVal); + else + tcuTextureUtil.fillWithComponentGradients3D(access, minVal, maxVal); +}; + +/** + * @param {tcuTexture.PixelBufferAccess} dst + */ +tcuTextureUtil.fillWithRGBAQuads = function(dst) { + checkMessage(dst.getDepth() == 1, 'Depth must be 1'); + var width = dst.getWidth(); + var height = dst.getHeight(); + var left = width / 2; + var top = height / 2; + + tcuTextureUtil.getSubregion(dst, 0, 0, 0, left, top, 1).clear([1.0, 0.0, 0.0, 1.0]); + tcuTextureUtil.getSubregion(dst, left, 0, 0, width - left, top, 1).clear([0.0, 1.0, 0.0, 1.0]); + tcuTextureUtil.getSubregion(dst, 0, top, 0, left, height - top, 1).clear([0.0, 0.0, 1.0, 0.0]); + tcuTextureUtil.getSubregion(dst, left, top, 0, width - left, height - top, 1).clear([0.5, 0.5, 0.5, 1.0]); +}; + +// \todo [2012-11-13 pyry] There is much better metaballs code in CL SIR value generators. +/** + * @param {tcuTexture.PixelBufferAccess} dst + * @param {number} numBalls + * @param {number} seed + */ +tcuTextureUtil.fillWithMetaballs = function(dst, numBalls, seed) { + checkMessage(dst.getDepth() == 1, 'Depth must be 1'); + var points = []; + var rnd = new deRandom.Random(seed); + + for (var i = 0; i < numBalls; i++) { + var x = rnd.getFloat(); + var y = rnd.getFloat(); + points[i] = [x, y]; + } + + for (var y = 0; y < dst.getHeight(); y++) + for (var x = 0; x < dst.getWidth(); x++) { + var p = [x / dst.getWidth(), y / dst.getHeight()]; + + var sum = 0.0; + for (var pointNdx = 0; pointNdx < points.length; pointNdx++) { + var d = deMath.subtract(p, points[pointNdx]); + var f = 0.01 / (d[0] * d[0] + d[1] * d[1]); + + sum += f; + } + + dst.setPixel([sum, sum, sum, sum], x, y); + } +}; + +/** + * Create tcuTextureUtil.TextureFormatInfo. + * @constructor + * @param {Array} valueMin + * @param {Array} valueMax + * @param {Array} lookupScale + * @param {Array} lookupBias + */ +tcuTextureUtil.TextureFormatInfo = function(valueMin, valueMax, lookupScale, lookupBias) { + /** @type {Array} */ this.valueMin = valueMin; + /** @type {Array} */ this.valueMax = valueMax; + /** @type {Array} */ this.lookupScale = lookupScale; + /** @type {Array} */ this.lookupBias = lookupBias; +}; + +/** + * @param {?tcuTexture.ChannelType} channelType + * @return {Array} + */ +tcuTextureUtil.getChannelValueRange = function(channelType) { + var cMin = 0; + var cMax = 0; + + switch (channelType) { + // Signed normalized formats. + case tcuTexture.ChannelType.SNORM_INT8: + case tcuTexture.ChannelType.SNORM_INT16: cMin = -1; cMax = 1; break; + + // Unsigned normalized formats. + case tcuTexture.ChannelType.UNORM_INT8: + case tcuTexture.ChannelType.UNORM_INT16: + case tcuTexture.ChannelType.UNORM_SHORT_565: + case tcuTexture.ChannelType.UNORM_SHORT_4444: + case tcuTexture.ChannelType.UNORM_INT_101010: + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: cMin = 0; cMax = 1; break; + + // Misc formats. + case tcuTexture.ChannelType.SIGNED_INT8: cMin = -128; cMax = 127; break; + case tcuTexture.ChannelType.SIGNED_INT16: cMin = -32768; cMax = 32767; break; + case tcuTexture.ChannelType.SIGNED_INT32: cMin = -2147483648; cMax = 2147483647; break; + case tcuTexture.ChannelType.UNSIGNED_INT8: cMin = 0; cMax = 255; break; + case tcuTexture.ChannelType.UNSIGNED_INT16: cMin = 0; cMax = 65535; break; + case tcuTexture.ChannelType.UNSIGNED_INT32: cMin = 0; cMax = 4294967295; break; + case tcuTexture.ChannelType.HALF_FLOAT: cMin = -1e3; cMax = 1e3; break; + case tcuTexture.ChannelType.FLOAT: cMin = -1e5; cMax = 1e5; break; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: cMin = 0; cMax = 1e4; break; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: cMin = 0; cMax = 1e5; break; + + default: + DE_ASSERT(false); + } + + return [cMin, cMax]; +}; + +/** + * Creates an array by choosing between 'a' and 'b' based on 'cond' array. + * @param {Array | number} a + * @param {Array | number} b + * @param {Array} cond Condtions + * @return {Array} + */ +tcuTextureUtil.select = function(a, b, cond) { + + /*DE_ASSERT(!(a.length && !b.length) + || !(!a.length && b.length) + || !((a.length && b.length) && ((a.length != b.length) || (b.length != cond.length) || (a.length != cond.length))));*/ + + if (a.length && !b.length) throw new Error('second input parameter is not a vector'); + if (!a.length && b.length) throw new Error('first input parameter is not a vector'); + if ((a.length && b.length) && ((a.length != b.length) || (b.length != cond.length) || (a.length != cond.length))) throw new Error('different size vectors'); + + var dst = []; + for (var i = 0; i < cond.length; i++) + if (cond[i]) { + if (a.length) dst.push(a[i]); + else dst.push(a); + } else { + if (b.length) dst.push(b[i]); + else dst.push(b); + } + return dst; +}; + +/** + * Get standard parameters for testing texture format + * + * Returns tcuTextureUtil.TextureFormatInfo that describes good parameters for exercising + * given TextureFormat. Parameters include value ranges per channel and + * suitable lookup scaling and bias in order to reduce result back to + * 0..1 range. + * + * @param {tcuTexture.TextureFormat} format + * @return {tcuTextureUtil.TextureFormatInfo} + */ +tcuTextureUtil.getTextureFormatInfo = function(format) { + // Special cases. + if (format.isEqual(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV))) + return new tcuTextureUtil.TextureFormatInfo([0, 0, 0, 0], + [1023, 1023, 1023, 3], + [1 / 1023, 1 / 1023, 1 / 1023, 1 / 3], + [0, 0, 0, 0]); + else if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) + return new tcuTextureUtil.TextureFormatInfo([0, 0, 0, 0], + [1, 1, 1, 0], + [1, 1, 1, 1], + [0, 0, 0, 0]); // Depth / stencil formats. + else if (format.isEqual(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551))) + return new tcuTextureUtil.TextureFormatInfo([0, 0, 0, 0.5], + [1, 1, 1, 1.5], + [1, 1, 1, 1], + [0, 0, 0, 0]); + + var cRange = tcuTextureUtil.getChannelValueRange(format.type); + var chnMask = null; + + switch (format.order) { + case tcuTexture.ChannelOrder.R: chnMask = [true, false, false, false]; break; + case tcuTexture.ChannelOrder.A: chnMask = [false, false, false, true]; break; + case tcuTexture.ChannelOrder.L: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.LA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.RG: chnMask = [true, true, false, false]; break; + case tcuTexture.ChannelOrder.RGB: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.RGBA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.sRGB: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.sRGBA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.D: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.DS: chnMask = [true, true, true, true]; break; + default: + DE_ASSERT(false); + } + + var scale = 1 / (cRange[1] - cRange[0]); + var bias = -cRange[0] * scale; + + return new tcuTextureUtil.TextureFormatInfo(tcuTextureUtil.select(cRange[0], 0, chnMask), + tcuTextureUtil.select(cRange[1], 0, chnMask), + tcuTextureUtil.select(scale, 1, chnMask), + tcuTextureUtil.select(bias, 0, chnMask)); +}; + +/** tcuTextureUtil.getChannelBitDepth + * @param {?tcuTexture.ChannelType} channelType + * @return {Array} + */ +tcuTextureUtil.getChannelBitDepth = function(channelType) { + + switch (channelType) { + case tcuTexture.ChannelType.SNORM_INT8: return [8, 8, 8, 8]; + case tcuTexture.ChannelType.SNORM_INT16: return [16, 16, 16, 16]; + case tcuTexture.ChannelType.SNORM_INT32: return [32, 32, 32, 32]; + case tcuTexture.ChannelType.UNORM_INT8: return [8, 8, 8, 8]; + case tcuTexture.ChannelType.UNORM_INT16: return [16, 16, 16, 16]; + case tcuTexture.ChannelType.UNORM_INT32: return [32, 32, 32, 32]; + case tcuTexture.ChannelType.UNORM_SHORT_565: return [5, 6, 5, 0]; + case tcuTexture.ChannelType.UNORM_SHORT_4444: return [4, 4, 4, 4]; + case tcuTexture.ChannelType.UNORM_SHORT_555: return [5, 5, 5, 0]; + case tcuTexture.ChannelType.UNORM_SHORT_5551: return [5, 5, 5, 1]; + case tcuTexture.ChannelType.UNORM_INT_101010: return [10, 10, 10, 0]; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return [10, 10, 10, 2]; + case tcuTexture.ChannelType.SIGNED_INT8: return [8, 8, 8, 8]; + case tcuTexture.ChannelType.SIGNED_INT16: return [16, 16, 16, 16]; + case tcuTexture.ChannelType.SIGNED_INT32: return [32, 32, 32, 32]; + case tcuTexture.ChannelType.UNSIGNED_INT8: return [8, 8, 8, 8]; + case tcuTexture.ChannelType.UNSIGNED_INT16: return [16, 16, 16, 16]; + case tcuTexture.ChannelType.UNSIGNED_INT32: return [32, 32, 32, 32]; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return [10, 10, 10, 2]; + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return [24, 0, 0, 8]; + case tcuTexture.ChannelType.HALF_FLOAT: return [16, 16, 16, 16]; + case tcuTexture.ChannelType.FLOAT: return [32, 32, 32, 32]; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return [11, 11, 10, 0]; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return [9, 9, 9, 0]; + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return [32, 0, 0, 8]; + default: + DE_ASSERT(false); + return [0, 0, 0, 0]; + } +}; + +/** tcuTextureUtil.getTextureFormatBitDepth + * @param {tcuTexture.TextureFormat} format + * @return {Array} + */ +tcuTextureUtil.getTextureFormatBitDepth = function(format) { + + /** @type {Array} */ var chnBits = tcuTextureUtil.getChannelBitDepth(format.type); // IVec4 + /** @type {Array} */ var chnMask = [false, false, false, false]; // BVec4 + /** @type {Array} */ var chnSwz = [0, 1, 2, 3]; // IVec4 + + switch (format.order) { + case tcuTexture.ChannelOrder.R: chnMask = [true, false, false, false]; break; + case tcuTexture.ChannelOrder.A: chnMask = [false, false, false, true]; break; + case tcuTexture.ChannelOrder.RA: chnMask = [true, false, false, true]; break; + case tcuTexture.ChannelOrder.L: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.I: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.LA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.RG: chnMask = [true, true, false, false]; break; + case tcuTexture.ChannelOrder.RGB: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.RGBA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.BGRA: chnMask = [true, true, true, true]; chnSwz = [2, 1, 0, 3]; break; + case tcuTexture.ChannelOrder.ARGB: chnMask = [true, true, true, true]; chnSwz = [1, 2, 3, 0]; break; + case tcuTexture.ChannelOrder.sRGB: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.sRGBA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.D: chnMask = [true, false, false, false]; break; + case tcuTexture.ChannelOrder.DS: chnMask = [true, false, false, true]; break; + case tcuTexture.ChannelOrder.S: chnMask = [false, false, false, true]; break; + default: + DE_ASSERT(false); + } + + return tcuTextureUtil.select(deMath.swizzle(chnBits, [chnSwz[0], chnSwz[1], chnSwz[2], chnSwz[3]]), [0, 0, 0, 0], chnMask); + +}; + +/** tcuTextureUtil.fillWithGrid + * @const @param {tcuTexture.PixelBufferAccess} access + * @param {number} cellSize + * @param {Array} colorA + * @param {Array} colorB + */ +tcuTextureUtil.fillWithGrid = function(access, cellSize, colorA, colorB) { + if (access.getHeight() == 1 && access.getDepth() == 1) + tcuTextureUtil.fillWithGrid1D(access, cellSize, colorA, colorB); + else if (access.getDepth() == 1) + tcuTextureUtil.fillWithGrid2D(access, cellSize, colorA, colorB); + else + tcuTextureUtil.fillWithGrid3D(access, cellSize, colorA, colorB); +}; + +/** tcuTextureUtil.fillWithGrid1D + * @const @param {tcuTexture.PixelBufferAccess} access + * @param {number} cellSize + * @param {Array} colorA + * @param {Array} colorB + */ +tcuTextureUtil.fillWithGrid1D = function(access, cellSize, colorA, colorB) { + for (var x = 0; x < access.getWidth(); x++) { + var mx = Math.floor(x / cellSize) % 2; + + if (mx) + access.setPixel(colorB, x, 0); + else + access.setPixel(colorA, x, 0); + } +}; + +/** tcuTextureUtil.fillWithGrid2D + * @const @param {tcuTexture.PixelBufferAccess} access + * @param {number} cellSize + * @param {Array} colorA + * @param {Array} colorB + */ +tcuTextureUtil.fillWithGrid2D = function(access, cellSize, colorA, colorB) { + for (var y = 0; y < access.getHeight(); y++) + for (var x = 0; x < access.getWidth(); x++) { + var mx = Math.floor(x / cellSize) % 2; + var my = Math.floor(y / cellSize) % 2; + + if (mx ^ my) + access.setPixel(colorB, x, y); + else + access.setPixel(colorA, x, y); + } +}; + +/** tcuTextureUtil.fillWithGrid3D + * @const @param {tcuTexture.PixelBufferAccess} access + * @param {number} cellSize + * @param {Array} colorA + * @param {Array} colorB + */ +tcuTextureUtil.fillWithGrid3D = function(access, cellSize, colorA, colorB) { + for (var z = 0; z < access.getDepth(); z++) + for (var y = 0; y < access.getHeight(); y++) + for (var x = 0; x < access.getWidth(); x++) { + var mx = Math.floor(x / cellSize) % 2; + var my = Math.floor(y / cellSize) % 2; + var mz = Math.floor(z / cellSize) % 2; + + if (mx ^ my ^ mz) + access.setPixel(colorB, x, y, z); + else + access.setPixel(colorA, x, y, z); + } +}; + +/** + * @const @param {tcuTexture.TextureFormat} format + * @return {Array} + */ +tcuTextureUtil.getTextureFormatMantissaBitDepth = function(format) { + /** @type {Array} */ var chnBits = tcuTextureUtil.getChannelMantissaBitDepth(format.type); + /** @type {Array} */ var chnMask = [false, false, false, false]; + /** @type {Array} */ var chnSwz = [0, 1, 2, 3]; + + switch (format.order) { + case tcuTexture.ChannelOrder.R: chnMask = [true, false, false, false]; break; + case tcuTexture.ChannelOrder.A: chnMask = [false, false, false, true]; break; + case tcuTexture.ChannelOrder.RA: chnMask = [true, false, false, true]; break; + case tcuTexture.ChannelOrder.L: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.I: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.LA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.RG: chnMask = [true, true, false, false]; break; + case tcuTexture.ChannelOrder.RGB: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.RGBA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.BGRA: chnMask = [true, true, true, true]; chnSwz = [2, 1, 0, 3]; break; + case tcuTexture.ChannelOrder.ARGB: chnMask = [true, true, true, true]; chnSwz = [1, 2, 3, 0]; break; + case tcuTexture.ChannelOrder.sRGB: chnMask = [true, true, true, false]; break; + case tcuTexture.ChannelOrder.sRGBA: chnMask = [true, true, true, true]; break; + case tcuTexture.ChannelOrder.D: chnMask = [true, false, false, false]; break; + case tcuTexture.ChannelOrder.DS: chnMask = [true, false, false, true]; break; + case tcuTexture.ChannelOrder.S: chnMask = [false, false, false, true]; break; + default: + DE_ASSERT(false); + } + return tcuTextureUtil.select(deMath.swizzle(chnBits, [chnSwz[0], chnSwz[1], chnSwz[2], chnSwz[3]]), [0, 0, 0, 0], chnMask); +}; + +/** + * @param {?tcuTexture.ChannelType} channelType + * @return {Array} + */ +tcuTextureUtil.getChannelMantissaBitDepth = function(channelType) { + switch (channelType) { + case tcuTexture.ChannelType.SNORM_INT8: + case tcuTexture.ChannelType.SNORM_INT16: + case tcuTexture.ChannelType.SNORM_INT32: + case tcuTexture.ChannelType.UNORM_INT8: + case tcuTexture.ChannelType.UNORM_INT16: + case tcuTexture.ChannelType.UNORM_INT32: + case tcuTexture.ChannelType.UNORM_SHORT_565: + case tcuTexture.ChannelType.UNORM_SHORT_4444: + case tcuTexture.ChannelType.UNORM_SHORT_555: + case tcuTexture.ChannelType.UNORM_SHORT_5551: + case tcuTexture.ChannelType.UNORM_INT_101010: + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: + case tcuTexture.ChannelType.SIGNED_INT8: + case tcuTexture.ChannelType.SIGNED_INT16: + case tcuTexture.ChannelType.SIGNED_INT32: + case tcuTexture.ChannelType.UNSIGNED_INT8: + case tcuTexture.ChannelType.UNSIGNED_INT16: + case tcuTexture.ChannelType.UNSIGNED_INT32: + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: + return tcuTextureUtil.getChannelBitDepth(channelType); + case tcuTexture.ChannelType.HALF_FLOAT: return [10, 10, 10, 10]; + case tcuTexture.ChannelType.FLOAT: return [23, 23, 23, 23]; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return [6, 6, 5, 0]; + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return [23, 0, 0, 8]; + default: + throw new Error('Invalid channelType: ' + channelType); + } +}; + +/** + * @param {tcuTexture.PixelBufferAccess} dst + * @param {tcuTexture.ConstPixelBufferAccess} src + */ +tcuTextureUtil.copy = function(dst, src) { + var width = dst.getWidth(); + var height = dst.getHeight(); + var depth = dst.getDepth(); + + DE_ASSERT(src.getWidth() == width && src.getHeight() == height && src.getDepth() == depth); + + if (src.getFormat().isEqual(dst.getFormat())) { + var srcData = src.getDataPtr(); + var dstData = dst.getDataPtr(); + + if (srcData.length == dstData.length) { + dstData.set(srcData); + return; + } + } + var srcClass = tcuTexture.getTextureChannelClass(src.getFormat().type); + var dstClass = tcuTexture.getTextureChannelClass(dst.getFormat().type); + var srcIsInt = srcClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER || srcClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER; + var dstIsInt = dstClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER || dstClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER; + + if (srcIsInt && dstIsInt) { + for (var z = 0; z < depth; z++) + for (var y = 0; y < height; y++) + for (var x = 0; x < width; x++) + dst.setPixelInt(src.getPixelInt(x, y, z), x, y, z); + } else { + for (var z = 0; z < depth; z++) + for (var y = 0; y < height; y++) + for (var x = 0; x < width; x++) + dst.setPixel(src.getPixel(x, y, z), x, y, z); + } +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} access + */ +tcuTextureUtil.estimatePixelValueRange = function(access) { + var format = access.getFormat(); + + switch (format.type) { + case tcuTexture.ChannelType.UNORM_INT8: + case tcuTexture.ChannelType.UNORM_INT16: + // Normalized unsigned formats. + return [ + [0, 0, 0, 0], + [1, 1, 1, 1] + ]; + + case tcuTexture.ChannelType.SNORM_INT8: + case tcuTexture.ChannelType.SNORM_INT16: + // Normalized signed formats. + return [ + [-1, -1, -1, -1], + [1, 1, 1, 1] + ]; + + default: + // \note Samples every 4/8th pixel. + var minVal = [Infinity, Infinity, Infinity, Infinity]; + var maxVal = [-Infinity, -Infinity, -Infinity, -Infinity]; + + for (var z = 0; z < access.getDepth(); z += 2) { + for (var y = 0; y < access.getHeight(); y += 2) { + for (var x = 0; x < access.getWidth(); x += 2) { + var p = access.getPixel(x, y, z); + + minVal[0] = Math.min(minVal[0], p[0]); + minVal[1] = Math.min(minVal[1], p[1]); + minVal[2] = Math.min(minVal[2], p[2]); + minVal[3] = Math.min(minVal[3], p[3]); + + maxVal[0] = Math.max(maxVal[0], p[0]); + maxVal[1] = Math.max(maxVal[1], p[1]); + maxVal[2] = Math.max(maxVal[2], p[2]); + maxVal[3] = Math.max(maxVal[3], p[3]); + } + } + } + return [minVal, maxVal]; + } +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} access + * @return {{scale: Array, bias: Array}} + */ +tcuTextureUtil.computePixelScaleBias = function(access) { + var limits = tcuTextureUtil.estimatePixelValueRange(access); + var minVal = limits[0]; + var maxVal = limits[1]; + + var scale = [1, 1, 1, 1]; + var bias = [0, 0, 0, 0]; + + var eps = 0.0001; + + for (var c = 0; c < 4; c++) { + if (maxVal[c] - minVal[c] < eps) { + scale[c] = (maxVal[c] < eps) ? 1 : (1 / maxVal[c]); + bias[c] = (c == 3) ? (1 - maxVal[c] * scale[c]) : (0 - minVal[c] * scale[c]); + } else { + scale[c] = 1 / (maxVal[c] - minVal[c]); + bias[c] = 0 - minVal[c] * scale[c]; + } + } + + return { + scale: scale, + bias: bias + }; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js new file mode 100644 index 000000000..7551d6c1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js @@ -0,0 +1,1061 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.delibs.debase.deMath'); + +/** @typedef { (Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array) } */ +goog.TypedArray; + +/** @typedef { (Array|Array|goog.TypedArray) } */ +goog.NumberArray; + +goog.scope(function() { + +var deMath = framework.delibs.debase.deMath; + +/** @const */ deMath.INT32_SIZE = 4; + +deMath.deInRange32 = function(a, mn, mx) { + return (a >= mn) && (a <= mx); +}; + +deMath.deInBounds32 = function(a, mn, mx) { + return (a >= mn) && (a < mx); +}; + +/** + * @param {number} a + * @return {number} + */ +deMath.deFloatFrac = function(a) { return a - Math.floor(a); }; + +/** + * Transform a 64-bit float number into a 32-bit float number. + * Native dEQP uses 32-bit numbers, so sometimes 64-bit floating numbers in JS should be transformed into 32-bit ones to ensure the correctness of the result. + * @param {number} a + * @return {number} + */ +deMath.toFloat32 = (function() { + var FLOAT32ARRAY1 = new Float32Array(1); + return function(a) { + FLOAT32ARRAY1[0] = a; + return FLOAT32ARRAY1[0]; + }; +})(); + +/** @const */ deMath.INV_LOG_2_FLOAT32 = deMath.toFloat32(1.44269504089); /** 1.0 / log_e(2.0) */ + +/** + * Check if a value is a power-of-two. + * @param {number} a Input value. + * @return {boolean} return True if input is a power-of-two value, false otherwise. + * (Also returns true for zero). + */ +deMath.deIsPowerOfTwo32 = function(a) { + return ((a & (a - 1)) == 0); +}; + +/** + * Align an integer to given power-of-two size. + * @param {number} val The number to align. + * @param {number} align The size to align to. + * @return {number} The aligned value + */ +deMath.deAlign32 = function(val, align) { + if (!deMath.deIsPowerOfTwo32(align)) + throw new Error('Not a power of 2: ' + align); + return ((val + align - 1) & ~(align - 1)) & 0xFFFFFFFF; //0xFFFFFFFF make sure it returns a 32 bit calculation in 64 bit browsers. +}; + +/** + * Compute the bit population count of an integer. + * @param {number} a + * @return {number} The number of one bits in + */ +deMath.dePop32 = function(a) { + /** @type {number} */ var mask0 = 0x55555555; /* 1-bit values. */ + /** @type {number} */ var mask1 = 0x33333333; /* 2-bit values. */ + /** @type {number} */ var mask2 = 0x0f0f0f0f; /* 4-bit values. */ + /** @type {number} */ var mask3 = 0x00ff00ff; /* 8-bit values. */ + /** @type {number} */ var mask4 = 0x0000ffff; /* 16-bit values. */ + /** @type {number} */ var t = a & 0xFFFFFFFF; /* Crop to 32-bit value */ + t = (t & mask0) + ((t >> 1) & mask0); + t = (t & mask1) + ((t >> 2) & mask1); + t = (t & mask2) + ((t >> 4) & mask2); + t = (t & mask3) + ((t >> 8) & mask3); + t = (t & mask4) + (t >> 16); + return t; +}; + +deMath.clamp = function(val, minParm, maxParm) { + return Math.min(Math.max(val, minParm), maxParm); +}; + +/** + * @param {Array} values + * @param {number} minParm + * @param {number} maxParm + * @return {Array} + */ +deMath.clampVector = function(values, minParm, maxParm) { + var result = []; + for (var i = 0; i < values.length; i++) + result.push(deMath.clamp(values[i], minParm, maxParm)); + return result; +}; + +deMath.imod = function(a, b) { + var m = a % b; + return m < 0 ? m + b : m; +}; + +deMath.mirror = function(a) { + return a >= 0 ? a : -(1 + a); +}; + +/** + * @param {goog.NumberArray} a Source array + * @param {goog.NumberArray} indices + * @return {Array} Swizzled array + */ +deMath.swizzle = function(a, indices) { + if (!indices.length) + throw new Error('Argument must be an array'); + var dst = []; + for (var i = 0; i < indices.length; i++) + dst.push(a[indices[i]]); + return dst; +}; + +/** + * Shift left elements of array a by elements of array b + * dst[n] a[n] << b[n] + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} Result array + */ +deMath.arrayShiftLeft = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] << b[i]); + return dst; +}; + +/** + * Multiply two vectors, element by element + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} Result array + */ + +deMath.multiply = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] * b[i]); + return dst; +}; + +/** + * Divide two vectors, element by element + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} Result array + * @throws {Error} + */ + +deMath.divide = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) { + if (b[i] === 0) + throw new Error('Division by 0'); + dst.push(a[i] / b[i]); + } + return dst; +}; + +/** + * Divide vector by a scalar + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} Result array + */ +deMath.divideScale = function(a, b) { + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] / b); + return dst; +}; + +/** + * @param {number} a + * @param {number} b + * @return {number} + */ +deMath.mod = function(a, b) { + return a - b * Math.floor(a / b); +}; + +/** + * Modulus vector by a scalar + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} Result array + */ +deMath.modScale = function(a, b) { + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(deMath.mod(a[i], b)); + return dst; +}; + +/** + * Multiply vector by a scalar + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} Result array + */ +deMath.scale = function(a, b) { + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] * b); + return dst; +}; + +/** + * Add vector and scalar, element by element + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} Result array + */ +deMath.addScalar = function(a, b) { + if (!Array.isArray(a)) + throw new Error('First argument must be an array.'); + if (typeof b !== 'number') + throw new Error('Second argument must be a number.'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] + b); + return dst; +}; + +/** + * Add two vectors, element by element + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} Result array + */ +deMath.add = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] + b[i]); + return dst; +}; + +/** + * Subtract two vectors, element by element + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} Result array + */ + +deMath.subtract = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] - b[i]); + return dst; +}; + +/** + * Subtract vector and scalar, element by element + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} Result array + */ +deMath.subScalar = function(a, b) { + if (!Array.isArray(a)) + throw new Error('First argument must be an array.'); + if (typeof b !== 'number') + throw new Error('Second argument must be a number.'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] - b); + return dst; +}; + +/** + * Calculate absolute difference between two vectors + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} abs(diff(a - b)) + */ +deMath.absDiff = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(Math.abs(a[i] - b[i])); + return dst; +}; + +/** + * Calculate absolute value of a vector + * @param {goog.NumberArray} a + * @return {Array} abs(a) + */ +deMath.abs = function(a) { + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(Math.abs(a[i])); + return dst; +}; + +/** + * Is a <= b (element by element)? + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} Result array of booleans + */ +deMath.lessThanEqual = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i] <= b[i]); + return dst; +}; + +/** + * Is a === b (element by element)? + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {boolean} Result + */ +deMath.equal = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + for (var i = 0; i < a.length; i++) { + if (a[i] !== b[i]) + return false; + } + return true; +}; + +/** + * Are all values in the array true? + * @param {Array} a + * @return {boolean} + */ +deMath.boolAll = function(a) { + for (var i = 0; i < a.length; i++) + if (a[i] == false) + return false; + return true; +}; + +/** + * deMath.assign(a, b) element by element + * @param {goog.NumberArray} a + * @return {Array} + */ +deMath.assign = function(a) { + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(a[i]); + return dst; +}; + +/** + * deMath.max(a, b) element by element + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} + */ +deMath.max = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(Math.max(a[i], b[i])); + return dst; +}; + +/** + * deMath.min(a, b) element by element + * @param {goog.NumberArray} a + * @param {goog.NumberArray} b + * @return {Array} + */ +deMath.min = function(a, b) { + if (a.length != b.length) + throw new Error('Arrays must have the same size'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(Math.min(a[i], b[i])); + return dst; +}; + +// Nearest-even rounding in case of tie (fractional part 0.5), otherwise ordinary rounding. +deMath.rint = function(a) { + var floorVal = Math.floor(a); + var fracVal = a - floorVal; + + if (fracVal != 0.5) + return Math.round(a); // Ordinary case. + + var roundUp = (floorVal % 2) != 0; + + return floorVal + (roundUp ? 1 : 0); +}; + +/** + * wrap the number, so that it fits in the range [minValue, maxValue] + * @param {number} v + * @param {number} minValue + * @param {number} maxValue + * @return {number} + */ +deMath.wrap = function(v, minValue, maxValue) { + var range = maxValue - minValue + 1; + + if (v < minValue) { + v += range * (Math.floor((minValue - v) / range) + 1); + } + return minValue + Math.floor((v - minValue) % range); +}; + +/** + * Round number to int by dropping fractional part + * it is equivalent of GLSL int() constructor + * @param {number} a + * @return {number} + */ +deMath.intCast = function(a) { + var v; + if (a >= 0) + v = Math.floor(a); + else + v = Math.ceil(a); + return deMath.wrap(v, -0x80000000, 0x7FFFFFFF); +}; + +/** + * Round number to uint by dropping fractional part + * it is equivalent of GLSL uint() constructor + * @param {number} a + * @return {number} + */ +deMath.uintCast = function(a) { + var v; + if (a >= 0) + v = Math.floor(a); + else + v = Math.ceil(a); + return deMath.wrap(v, 0, 0xFFFFFFFF); +}; + +/** + * @param {number} a + * @return {number} + */ +deMath.logToFloor = function(a) { + assertMsgOptions(a > 0, 'Value is less or equal than zero', false, true); + return 31 - deMath.clz32(a); +}; + +/** + * Find intersection of two rectangles + * @param {goog.NumberArray} a Array [x, y, width, height] + * @param {goog.NumberArray} b Array [x, y, width, height] + * @return {Array} + */ +deMath.intersect = function(a, b) { + if (a.length != 4) + throw new Error('Array "a" must have length 4 but has length: ' + a.length); + if (b.length != 4) + throw new Error('Array "b" must have length 4 but has length: ' + b.length); + var x0 = Math.max(a[0], b[0]); + var y0 = Math.max(a[1], b[1]); + var x1 = Math.min(a[0] + a[2], b[0] + b[2]); + var y1 = Math.min(a[1] + a[3], b[1] + b[3]); + var w = Math.max(0, x1 - x0); + var h = Math.max(0, y1 - y0); + + return [x0, y0, w, h]; +}; + +/** deMath.deMathHash + * @param {number} a + * @return {number} + */ +deMath.deMathHash = function(a) { + var key = a; + key = (key ^ 61) ^ (key >> 16); + key = key + (key << 3); + key = key ^ (key >> 4); + key = key * 0x27d4eb2d; /* prime/odd constant */ + key = key ^ (key >> 15); + return key; +}; + +/** + * Converts a byte array to a number + * @param {Uint8Array} array + * @return {number} + */ +deMath.arrayToNumber = function(array) { + /** @type {number} */ var result = 0; + + for (var ndx = 0; ndx < array.length; ndx++) { + result += array[ndx] * Math.pow(256, ndx); + } + + return result; +}; + +/** + * Fills a byte array with a number + * @param {Uint8Array} array Output array (already resized) + * @param {number} number + */ +deMath.numberToArray = function(array, number) { + for (var byteNdx = 0; byteNdx < array.length; byteNdx++) { + /** @type {number} */ var acumzndx = !byteNdx ? number : Math.floor(number / Math.pow(256, byteNdx)); + array[byteNdx] = acumzndx & 0xFF; + } +}; + +/** + * Obtains the bit fragment from a number + * @param {number} x + * @param {number} firstNdx + * @param {number} lastNdx + * @return {number} + */ +deMath.getBitRange = function(x, firstNdx, lastNdx) { + var shifted = deMath.shiftRight(x, firstNdx); + var bitSize = lastNdx - firstNdx; + var mask; + if (bitSize < 32) + mask = (1 << bitSize) - 1; + else + mask = Math.pow(2, bitSize) - 1; + var masked = deMath.binaryAnd(shifted, mask); + return masked; +}; + +/** + * Split a large signed number into low and high 32bit dwords. + * @param {number} x + * @return {Array} + */ +deMath.split32 = function(x) { + var ret = []; + ret[1] = Math.floor(x / 0x100000000); + ret[0] = x - ret[1] * 0x100000000; + return ret; +}; + +/** + * Split a signed number's low 32bit dwords into low and high 16bit dwords. + * @param {number} x + * @return {Array} + */ +deMath.split16 = function(x) { + var ret = []; + x = x & 0xffffffff; + ret[1] = Math.floor(x / 0x10000); + ret[0] = x - ret[1] * 0x10000; + return ret; +}; + +/** + * Recontruct a number from high and low 32 bit dwords + * @param {Array} x + * @return {number} + */ +deMath.join32 = function(x) { + var v0 = x[0] >= 0 ? x[0] : 0x100000000 + x[0]; + var v1 = x[1]; + var val = v1 * 0x100000000 + v0; + return val; +}; + +//Bit operations with the help of arrays + +/** + * @enum + */ +deMath.BinaryOp = { + AND: 0, + OR: 1, + XOR: 2 +}; + +/** + * Performs a normal (native) binary operation + * @param {number} valueA First operand + * @param {number} valueB Second operand + * @param {deMath.BinaryOp} operation The desired operation to perform + * @return {number} + */ +deMath.doNativeBinaryOp = function(valueA, valueB, operation) { + switch (operation) { + case deMath.BinaryOp.AND: + return valueA & valueB; + case deMath.BinaryOp.OR: + return valueA | valueB; + case deMath.BinaryOp.XOR: + return valueA ^ valueB; + default: + throw new Error('Unknown operation: ' + operation); + } +}; + +/** + * Performs a binary operation between two operands + * with the help of arrays to avoid losing the internal binary representation. + * @param {number} valueA First operand + * @param {number} valueB Second operand + * @param {deMath.BinaryOp} binaryOpParm The desired operation to perform + * @return {number} + */ +deMath.binaryOp = function(valueA, valueB, binaryOpParm) { + //quick path if values fit in signed 32 bit range + if (deMath.deInRange32(valueA, -0x80000000, 0x7FFFFFFF) && deMath.deInRange32(valueB, -0x80000000, 0x7FFFFFFF)) + return deMath.doNativeBinaryOp(valueA, valueB, binaryOpParm); + + var x = deMath.split32(valueA); + var y = deMath.split32(valueB); + var z = []; + for (var i = 0; i < 2; i++) + z[i] = deMath.doNativeBinaryOp(x[i], y[i], binaryOpParm); + var ret = deMath.join32(z); + return ret; +}; + +/** + * @param {number} a + * @param {number} b + * @return {number} + */ +deMath.binaryAnd = function(a, b) { + return deMath.binaryOp(a, b, deMath.BinaryOp.AND); +}; + +/** + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} + */ +deMath.binaryAndVecScalar = function(a, b) { + if (!Array.isArray(a)) + throw new Error('First argument must be an array.'); + if (typeof b !== 'number') + throw new Error('Second argument must be a number.'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(deMath.binaryOp(a[i], b, deMath.BinaryOp.AND)); + return dst; +}; + +/** + * @param {number} a + * @param {number} b + * @return {number} + */ +deMath.binaryOr = function(a, b) { + return deMath.binaryOp(a, b, deMath.BinaryOp.OR); +}; + +/** + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} + */ +deMath.binaryOrVecScalar = function(a, b) { + if (!Array.isArray(a)) + throw new Error('First argument must be an array.'); + if (typeof b !== 'number') + throw new Error('Second argument must be a number.'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(deMath.binaryOp(a[i], b, deMath.BinaryOp.OR)); + return dst; +}; + +/** + * @param {number} a + * @param {number} b + * @return {number} + */ +deMath.binaryXor = function(a, b) { + return deMath.binaryOp(a, b, deMath.BinaryOp.XOR); +}; + +/** + * @param {goog.NumberArray} a + * @param {number} b + * @return {Array} + */ +deMath.binaryXorVecScalar = function(a, b) { + if (!Array.isArray(a)) + throw new Error('First argument must be an array.'); + if (typeof b !== 'number') + throw new Error('Second argument must be a number.'); + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(deMath.binaryOp(a[i], b, deMath.BinaryOp.XOR)); + return dst; +}; + +/** + * Performs a binary NOT operation on an operand + * @param {number} value Operand + * @return {number} + */ +deMath.binaryNot = function(value) { + //quick path if value fits in signed 32 bit range + if (deMath.deInRange32(value, -0x80000000, 0x7FFFFFFF)) + return ~value; + + var x = deMath.split32(value); + x[0] = ~x[0]; + x[1] = ~x[1]; + var ret = deMath.join32(x); + return ret; +}; + +/** + * Shifts the given value 'steps' bits to the left. Replaces << operator + * This function should be used if the expected value will be wider than 32-bits. + * @param {number} value + * @param {number} steps + * @return {number} + */ +deMath.shiftLeft = function(value, steps) { + //quick path + if (steps < 31) { + var v = value * (1 << steps); + if (deMath.deInRange32(v, -0x80000000, 0x7FFFFFFF)) + return v; + } + + if (steps == 0) + return value; + else if (steps < 32) { + var mask = (1 << 32 - steps) - 1; + var x = deMath.split32(value); + var highBits = x[0] & (~mask); + var y = highBits >> (32 - steps); + if (highBits < 0) { + var m = (1 << steps) - 1; + y &= m; + } + var result = []; + result[0] = x[0] << steps; + result[1] = x[1] << steps; + result[1] |= y; + + return deMath.join32(result); + } else { + var x = deMath.split32(value); + var result = []; + result[0] = 0; + result[1] = x[0] << steps - 32; + return deMath.join32(result); + } +}; + +/** + * @param {Array} a + * @param {number} b + */ +deMath.shiftLeftVecScalar = function(a, b) { + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(deMath.shiftLeft(a[i], b)); + return dst; +}; + +/** + * Shifts the given value 'steps' bits to the right. Replaces >> operator + * This function should be used if the value is wider than 32-bits + * @param {number} value + * @param {number} steps + * @return {number} + */ +deMath.shiftRight = function(value, steps) { + //quick path + if (deMath.deInRange32(value, -0x80000000, 0x7FFFFFFF) && steps < 32) + return value >> steps; + + if (steps == 0) + return value; + else if (steps < 32) { + if (steps == 0) + return value; + var mask = (1 << steps) - 1; + var x = deMath.split32(value); + var lowBits = x[1] & mask; + var result = []; + var m = (1 << 32 - steps) - 1; + result[0] = (x[0] >> steps) & m; + result[1] = x[1] >> steps; + result[0] |= lowBits << 32 - steps; + return deMath.join32(result); + } else { + var x = deMath.split32(value); + var result = []; + result[0] = x[1] >> steps - 32; + result[1] = value < 0 ? -1 : 0; + return deMath.join32(result); + } +}; + +/** + * @param {Array} a + * @param {number} b + */ +deMath.shiftRightVecScalar = function(a, b) { + var dst = []; + for (var i = 0; i < a.length; i++) + dst.push(deMath.shiftRight(a[i], b)); + return dst; +}; + +/** deMath.logicalAndBool over two arrays of booleans + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +deMath.logicalAndBool = function(a, b) { + if (!Array.isArray(a)) + throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a); + if (!Array.isArray(b)) + throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b); + if (a.length != b.length) + throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')'); + + /** @type {Array} */ var result = []; + for (var i = 0; i < a.length; i++) { + if (a[i] & b[i]) + result.push(true); + else + result.push(false); + } + return result; +}; + +/** deMath.logicalOrBool over two arrays of booleans + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +deMath.logicalOrBool = function(a, b) { + if (!Array.isArray(a)) + throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a); + if (!Array.isArray(b)) + throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b); + if (a.length != b.length) + throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')'); + + /** @type {Array} */ var result = []; + for (var i = 0; i < a.length; i++) { + if (a[i] | b[i]) + result.push(true); + else + result.push(false); + } + return result; +}; + +/** deMath.logicalNotBool over an array of booleans + * @param {Array} a + * @return {Array} + */ +deMath.logicalNotBool = function(a) { + if (!Array.isArray(a)) + throw new Error('The passed value is not an array: (' + typeof(a) + ')' + a); + + /** @type {Array} */ var result = []; + for (var i = 0; i < a.length; i++) + result.push(!a[i]); + return result; +}; + +/** deMath.greaterThan over two arrays of booleans + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +deMath.greaterThan = function(a, b) { + if (!Array.isArray(a)) + throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a); + if (!Array.isArray(b)) + throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b); + if (a.length != b.length) + throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')'); + + /** @type {Array} */ var result = []; + for (var i = 0; i < a.length; i++) + result.push(a[i] > b[i]); + return result; +}; + +/** deMath.greaterThan over two arrays of booleans + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +deMath.greaterThanEqual = function(a, b) { + if (!Array.isArray(a)) + throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a); + if (!Array.isArray(b)) + throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b); + if (a.length != b.length) + throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')'); + + /** @type {Array} */ var result = []; + for (var i = 0; i < a.length; i++) + result.push(a[i] >= b[i]); + return result; +}; + +/** + * Array of float to array of int (0, 255) + * @param {Array} a + * @return {Array} + */ + +deMath.toIVec = function(a) { + /** @type {Array} */ var res = []; + for (var i = 0; i < a.length; i++) + res.push(deMath.clamp(Math.floor(a[i] * 255), 0, 255)); + return res; +}; + +/** + * @param {number} a + * @return {number} + */ + deMath.clz32 = function(a) { + /** @type {number} */ var maxValue = 2147483648; // max 32 bit number + /** @type {number} */ var leadingZeros = 0; + while (a < maxValue) { + maxValue = maxValue >>> 1; + leadingZeros++; + } + return leadingZeros; +}; + +/** + * @param {number} a + * @param {number} exponent + * @return {number} + */ +deMath.deLdExp = function(a, exponent) { + return deMath.ldexp(a, exponent); +}; + +/** + * @param {number} a + * @param {number} exponent + * @return {number} + */ +deMath.deFloatLdExp = function(a, exponent) { + return deMath.ldexp(a, exponent); +}; + +/** + * @param {number} value + * @return {Array} + */ +deMath.frexp = (function() { + var data = new DataView(new ArrayBuffer(8)); + + return function(value) { + if (value === 0) return [value, 0]; + data.setFloat64(0, value); + var bits = (data.getUint32(0) >>> 20) & 0x7FF; + if (bits === 0) { + data.setFloat64(0, value * Math.pow(2, 64)); + bits = ((data.getUint32(0) >>> 20) & 0x7FF) - 64; + } + var exponent = bits - 1022, + mantissa = deMath.ldexp(value, -exponent); + return [mantissa, exponent]; + } +})(); + +/** + * @param {number} mantissa + * @param {number} exponent + * @return {number} + */ +deMath.ldexp = function(mantissa, exponent) { + return exponent > 1023 ? // avoid multiplying by infinity + mantissa * Math.pow(2, 1023) * Math.pow(2, exponent - 1023) : + exponent < -1074 ? // avoid multiplying by zero + mantissa * Math.pow(2, -1074) * Math.pow(2, exponent + 1074) : + mantissa * Math.pow(2, exponent); +}; + +/** + * @param {number} a + * @return {number} + */ +deMath.deCbrt = function(a) { + return deMath.deSign(a) * Math.pow(Math.abs(a), 1.0 / 3.0); +}; + +/** + * @param {number} x + * @return {number} + */ +deMath.deSign = function(x) { + return isNaN(x) ? x : ((x > 0.0) - (x < 0.0)); +}; + +deMath.deFractExp = function(x) { + var result = { + significand: x, + exponent: 0 + }; + + if (isFinite(x)) { + var r = deMath.frexp(x); + result.exponent = r[1] - 1; + result.significand = r[0] * 2; + } + return result; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js new file mode 100644 index 000000000..2246a2e9d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js @@ -0,0 +1,260 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * This class allows one to create a random integer, floating point number or boolean (TODO, deRandom.choose random items from a list and deRandom.shuffle an array) + */ +'use strict'; +goog.provide('framework.delibs.debase.deRandom'); + +goog.scope(function() { + +var deRandom = framework.delibs.debase.deRandom; + +/** + * Array of pseudo random numbers based on seed + * @constructor + * @struct + */ +deRandom.deRandom = function() { + /** @type {number} */ this.x = 0; + /** @type {number} */ this.y = 0; + /** @type {number} */ this.z = 0; + /** @type {number} */ this.w = 0; +}; + +/** + * deRandom.Random number generator init + * @param {deRandom.deRandom} rnd Array to store random numbers + * @param {number} seed Number for seed + */ +deRandom.deRandom_init = function(rnd, seed) { + rnd.x = (-seed ^ 123456789); + rnd.y = (362436069 * seed); + rnd.z = (521288629 ^ (seed >> 7)); + rnd.w = (88675123 ^ (seed << 3)); +}; + +/** + * Function to get random int + * @param {deRandom.deRandom} rnd Initialised array of random numbers + * @param {Array=} opts Min and max for range + * @return {number} deRandom.Random int + */ +deRandom.deRandom_getInt = function(rnd, opts) { + if (opts != undefined && opts[0] != undefined && opts[1] != undefined) { + if (opts[0] == 0x80000000 && opts[1] == 0x7fffffff) { + return deRandom.deRandom_getInt(rnd); + } else { + return opts[0] + (deRandom.deRandom_getInt(rnd) % (opts[1] - opts[0] + 1)); + } + } + var w = rnd.w; + var t; + + t = rnd.x ^ (rnd.x << 11); + rnd.x = rnd.y; + rnd.y = rnd.z; + rnd.z = w; + rnd.w = w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); + return w; +}; + +/** + * Function to get random float + * @param {deRandom.deRandom} rnd Initialised array of random numbers + * @param {Array=} opts Min and max for range + * @return {number} deRandom.Random float + */ +deRandom.deRandom_getFloat = function(rnd, opts) { + if (opts != undefined && opts[0] != undefined && opts[1] != undefined) { + if (opts[0] <= opts[1]) { + return opts[0] + (opts[1] - opts[0]) * deRandom.deRandom_getFloat(rnd); + } + } else { + return (deRandom.deRandom_getInt(rnd) & 0xFFFFFFF) / (0xFFFFFFF + 1); + } + throw new Error('Invalid arguments'); +}; + +/** + * Function to get random boolean + * @param {deRandom.deRandom} rnd Initialised array of random numbers + * @return {boolean} deRandom.Random boolean + */ +deRandom.deRandom_getBool = function(rnd) { + var val; + val = deRandom.deRandom_getInt(rnd); + return ((val & 0xFFFFFF) < 0x800000); +}; + +/** + * Function to get a common base seed + * @return {number} constant + */ +deRandom.getBaseSeed = function() { + return 42; +}; + +/** + * TODO Function to deRandom.choose random items from a list + * @template T + * @param {deRandom.deRandom} rnd Initialised array of random numbers + * @param {Array} elements Array segment already defined + * @param {Array=} resultOut Array where to store the elements in. If undefined, default to array of (num) elements. + * @param {number=} num Number of items to store in resultOut. If undefined, default to 1. + * @return {Array} Even though result is stored in resultOut, return it here as well. + */ +deRandom.choose = function(rnd, elements, resultOut, num) { + var items = num || 1; + var temp = elements.slice(); + if (!resultOut) + resultOut = []; + + while (items-- > 0) { + var index = deRandom.deRandom_getInt(rnd, [0, temp.length - 1]); + resultOut.push(temp[index]); + temp.splice(index, 1); + } + return resultOut; +}; + +/** + * TODO Function to deRandom.choose weighted random items from a list + * @param {deRandom.deRandom} rnd Initialised randomizer + * @param {Array} array Array to choose items from + * @param {Array} weights Weights array + * @return {number} Result output + */ +deRandom.chooseWeighted = function(rnd, array, weights) { + // Compute weight sum + /** @type {number} */ var weightSum = 0.0; + /** @type {number} */ var ndx; + for (ndx = 0; ndx < array.length; ndx++) + weightSum += weights[ndx]; + + // Random point in 0..weightSum + /** @type {number} */ var p = deRandom.deRandom_getFloat(rnd, [0.0, weightSum]); + + // Find item in range + /** @type {number} */ var lastNonZero = array.length; + /** @type {number} */ var curWeight = 0.0; + for (ndx = 0; ndx != array.length; ndx++) { + /** @type {number} */ var w = weights[ndx]; + + curWeight += w; + + if (p < curWeight) + return array[ndx]; + else if (w > 0.0) + lastNonZero = ndx; + } + + assertMsgOptions(lastNonZero != array.length, 'Index went out of bounds', false, true); + return array[lastNonZero]; +}; + +/** + * TODO Function to deRandom.shuffle an array + * @param {deRandom.deRandom} rnd Initialised array of random numbers + * @param {Array} elements Array to deRandom.shuffle + * @return {Array} Shuffled array + */ +deRandom.shuffle = function(rnd, elements) { + var index = elements.length; + + while (index > 0) { + var random = deRandom.deRandom_getInt(rnd, [0, index - 1]); + index -= 1; + var elem = elements[index]; + elements[index] = elements[random]; + elements[random] = elem; + } + return elements; +}; + +/** + * This function is used to create the deRandom.Random object and + * initialise the random number with a seed. + * It contains functions for generating random numbers in a variety of formats + * @constructor + * @param {number} seed Number to use as a seed + */ +deRandom.Random = function(seed) { + /** + * Instance of array of pseudo random numbers based on seeds + */ + this.m_rnd = new deRandom.deRandom(); + + //initialise the random numbers based on seed + deRandom.deRandom_init(this.m_rnd, seed); +}; + +/** + * Function to get random boolean + * @return {boolean} deRandom.Random boolean + */ +deRandom.Random.prototype.getBool = function() { return deRandom.deRandom_getBool(this.m_rnd) == true; }; +/** + * Function to get random float + * @param {number=} min Min for range + * @param {number=} max Max for range + * @return {number} deRandom.Random float + */ +deRandom.Random.prototype.getFloat = function(min, max) { return deRandom.deRandom_getFloat(this.m_rnd, [min, max]) }; +/** + * Function to get random int + * @param {number=} min Min for range + * @param {number=} max Max for range + * @return {number} deRandom.Random int + */ +deRandom.Random.prototype.getInt = function(min, max) {return deRandom.deRandom_getInt(this.m_rnd, [min, max])}; +/** + * TODO Function to deRandom.choose random items from a list + * @template T + * @param {Array} elements Array segment already defined + * @param {Array=} resultOut Array where to store the elements in. If undefined, default to array of (num) elements. + * @param {number=} num Number of items to store in resultOut. If undefined, default to 1. + * @return {Array} Even though result is stored in resultOut, return it here as well. + */ +deRandom.Random.prototype.choose = function(elements, resultOut, num) {return deRandom.choose(this.m_rnd, elements, resultOut, num)}; +/** + * choose weighted random items from a list + * @param {Array} array Array to choose items from + * @param {Array} weights Weights array + * @return {number} Result output + */ +deRandom.Random.prototype.chooseWeighted = function(array, weights) {return deRandom.chooseWeighted(this.m_rnd, array, weights)}; +/** + * TODO Function to deRandom.shuffle an array + * @param {Array} elements Array to deRandom.shuffle + * @return {Array} Shuffled array + */ +deRandom.Random.prototype.shuffle = function(elements) {return deRandom.shuffle(this.m_rnd, elements)}; + +/** + * Function to get a common base seed + * @return {number} constant + */ +deRandom.Random.prototype.getBaseSeed = function() { + return deRandom.getBaseSeed(); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js new file mode 100644 index 000000000..fc84a7232 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js @@ -0,0 +1,111 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * This class allows one to create a random integer, floating point number or boolean (TODO, choose random items from a list and shuffle an array) + */ +'use strict'; +goog.provide('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var deString = framework.delibs.debase.deString; +var deMath = framework.delibs.debase.deMath; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * Compute hash from string. + * @param {?string} str String to compute hash value for. + * @return {number} Computed hash value. + */ + deString.deStringHash = function(str) { + /* \note [pyry] This hash is used in DT_GNU_HASH and is proven + to be robust for symbol hashing. */ + /* \see http://sources.redhat.com/ml/binutils/2006-06/msg00418.html */ + /** @type {number} */ var hash = 5381; + /** @type {number} */ var c; + + DE_ASSERT(str != undefined); + if (str !== null) { + var i = 0; + while (i < str.length) { //(c = (unsigned int)*str++) != 0) + c = str.charCodeAt(i); //trunc to 8-bit + hash = (hash << 5) + hash + c; + i++; + } + } + return hash; + }; + + /** + * Checks if a JS string is either empty or undefined + * @param {string} str + * @return {boolean} + */ + deString.deIsStringEmpty = function(str) { + if (str === undefined || str.length == 0) + return true; + return false; + }; + + /** + * @private + * @param {Object} enumType + * @param {?} value + * @return {string} + */ + deString.getString = function(enumType, value) { + for (var p in enumType) + if (enumType[p] == value) + return p; + + if (typeof value === 'undefined') + return 'undefined'; + + if (!value) + return 'null'; + + return value.toString(10); + }; + + /** + * @param {Object} enumType + * @param {?} value + * @return {string} + */ + deString.enumToString = function(enumType, value) { + if (typeof deString.enumToString[enumType] === 'undefined') + deString.enumToString[enumType] = {}; + + var table = deString.enumToString[enumType]; + if (typeof table[value] === 'undefined') { + var v = deString.getString(enumType, value); + table[value] = v; + } + + return table[value]; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js new file mode 100644 index 000000000..56a90b6ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js @@ -0,0 +1,90 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.delibs.debase.deUtil'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + + var deUtil = framework.delibs.debase.deUtil; + var deMath = framework.delibs.debase.deMath; + + //! Get an element of an array with a specified size. + /** + * @param {Array} array + * @param {number} offset + * @return {*} + */ + deUtil.getArrayElement = function(array, offset) { + assertMsgOptions(deMath.deInBounds32(offset, 0, array.length), 'Array element out of bounds', false, true); + return array[offset]; + }; + + /** + * clone - If you need to pass/assign an object by value, call this + * @param {*} obj + * @return {*} + */ + deUtil.clone = function(obj) { + if (obj == null || typeof(obj) != 'object') + return obj; + + var temp = {}; + if (ArrayBuffer.isView(obj)) { + temp = new obj.constructor(obj); + } else if (obj instanceof Array) { + temp = new Array(obj.length); + for (var akey in obj) + temp[akey] = deUtil.clone(obj[akey]); + } else if (obj instanceof ArrayBuffer) { + temp = new ArrayBuffer(obj.byteLength); + var dst = new Uint8Array(temp); + var src = new Uint8Array(obj); + dst.set(src); + } else { + temp = Object.create(obj.constructor.prototype); + temp.constructor = obj.constructor; + for (var key in obj) + temp[key] = deUtil.clone(obj[key]); + } + return temp; + }; + + /** + * Add a push_unique function to Array. Will insert only if there is no equal element. + * @template T + * @param {Array} array Any array + * @param {T} object Any object + */ + deUtil.dePushUniqueToArray = function(array, object) { + //Simplest implementation + for (var i = 0; i < array.length; i++) { + if (object.equals !== undefined) + if (object.equals(array[i])) + return undefined; + else if (object === array[i]) + return undefined; + } + + array.push(object); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js new file mode 100644 index 000000000..baa05a970 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js @@ -0,0 +1,510 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); + +goog.scope(function() { + +var gluDrawUtil = framework.opengl.gluDrawUtil; +var gluShaderProgram = framework.opengl.gluShaderProgram; + +/** + * Description of a vertex array binding + * @constructor + * @param {number} type GL gluDrawUtil.Type of data + * @param {(number|undefined)} location Binding location + * @param {number} components Number of components per vertex + * @param {number} elements Number of elements in the array + * @param {Array} data Source data + * @param {number=} stride + * @param {number=} offset + */ +gluDrawUtil.VertexArrayBinding = function(type, location, components, elements, data, stride, offset) { + this.type = type; + this.location = location === undefined ? -1 : location; + this.components = components; + this.elements = elements; + this.data = data; + /** @type {?string} */ this.name = null; + this.stride = stride || 0; + this.offset = offset || 0; +}; + +/** + * Description of a vertex array binding + * @param {gluDrawUtil.BindingPoint} binding + * @param {gluDrawUtil.VertexArrayPointer} pointer + * @param {number=} dataType GL Data Type + * @return {gluDrawUtil.VertexArrayBinding} + */ +gluDrawUtil.vabFromBindingPointAndArrayPointer = function(binding, pointer, dataType) { + var type = dataType === undefined ? gl.FLOAT : dataType; + var location = binding.location; + var components = pointer.numComponents; + var elements = pointer.numElements; + var data = pointer.data; + var vaBinding = new gluDrawUtil.VertexArrayBinding(type, location, components, elements, data); + vaBinding.componentType = pointer.componentType; + vaBinding.name = binding.name; + vaBinding.convert = pointer.convert; + vaBinding.stride = pointer.stride; + return vaBinding; +}; + +/** + * ! Lower named bindings to locations and eliminate bindings that are not used by program. + * @param {WebGL2RenderingContext} gl WebGL context + * @param {WebGLProgram} program + * @param {Array} inputArray - Array with the named binding locations + * @param {Array=} outputArray - Array with the lowered locations + * @return {Array} outputArray + */ +gluDrawUtil.namedBindingsToProgramLocations = function(gl, program, inputArray, outputArray) { + outputArray = outputArray || []; + + for (var i = 0; i < inputArray.length; i++) { + var cur = inputArray[i]; + if (cur.name) { + //assert(binding.location >= 0); + var location = gl.getAttribLocation(program, cur.name); + if (location >= 0) { + if (cur.location >= 0) + location += cur.location; + // Add binding.location as an offset to accomodate matrices. + outputArray.push(new gluDrawUtil.VertexArrayBinding(cur.type, location, cur.components, cur.elements, cur.data, cur.stride, cur.offset)); + } + } else { + outputArray.push(cur); + } + } + + return outputArray; +}; + +/** + * Creates vertex buffer, binds it and draws elements + * @param {WebGL2RenderingContext} gl WebGL context + * @param {WebGLProgram} program ID, vertexProgramID + * @param {Array} vertexArrays + * @param {gluDrawUtil.PrimitiveList} primitives to gluDrawUtil.draw + * @param { {beforeDrawCall:function(), afterDrawCall:function()}=} callback + */ +gluDrawUtil.draw = function(gl, program, vertexArrays, primitives, callback) { + /** TODO: finish implementation */ + /** @type {Array} */ var objects = []; + + // Lower bindings to locations + vertexArrays = gluDrawUtil.namedBindingsToProgramLocations(gl, program, vertexArrays); + + for (var i = 0; i < vertexArrays.length; i++) { + /** @type {WebGLBuffer} */ var buffer = gluDrawUtil.vertexBuffer(gl, vertexArrays[i]); + objects.push(buffer); + } + + if (primitives.indices) { + /** @type {WebGLBuffer} */ var elemBuffer = gluDrawUtil.indexBuffer(gl, primitives); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elemBuffer); + + if (callback) + callback.beforeDrawCall(); + + gluDrawUtil.drawIndexed(gl, primitives, 0); + + if (callback) + callback.afterDrawCall(); + + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + } else { + if (callback) + callback.beforeDrawCall(); + + gl.drawArrays(gluDrawUtil.getPrimitiveGLType(gl, primitives.type), 0, primitives.numElements); + + if (callback) + callback.afterDrawCall(); + } + + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'drawArrays', false, true); + for (var i = 0; i < vertexArrays.length; i++) { + gl.disableVertexAttribArray(vertexArrays[i].location); + } + gl.bindBuffer(gl.ARRAY_BUFFER, null); +}; + +/** + * Creates vertex buffer, binds it and draws elements + * @param {WebGL2RenderingContext} gl WebGL context + * @param {gluDrawUtil.PrimitiveList} primitives Primitives to gluDrawUtil.draw + * @param {number} offset + */ +gluDrawUtil.drawIndexed = function(gl, primitives, offset) { +/** @type {number} */ var mode = gluDrawUtil.getPrimitiveGLType(gl, primitives.type); + /** TODO: C++ implementation supports different index types, we use only int16. + Could it cause any issues? + + deUint32 indexGLType = getIndexGLType(primitives.indexType); + */ + + gl.drawElements(mode, primitives.indices.length, gl.UNSIGNED_SHORT, offset); +}; + +/** + * Enums for primitive types + * @enum + */ +gluDrawUtil.primitiveType = { + TRIANGLES: 0, + TRIANGLE_STRIP: 1, + TRIANGLE_FAN: 2, + + LINES: 3, + LINE_STRIP: 4, + LINE_LOOP: 5, + + POINTS: 6, + + PATCHES: 7 +}; + +/** + * get GL type from primitive type + * @param {WebGL2RenderingContext} gl WebGL context + * @param {gluDrawUtil.primitiveType} type gluDrawUtil.primitiveType + * @return {number} GL primitive type + */ +gluDrawUtil.getPrimitiveGLType = function(gl, type) { + switch (type) { + case gluDrawUtil.primitiveType.TRIANGLES: return gl.TRIANGLES; + case gluDrawUtil.primitiveType.TRIANGLE_STRIP: return gl.TRIANGLE_STRIP; + case gluDrawUtil.primitiveType.TRIANGLE_FAN: return gl.TRIANGLE_FAN; + case gluDrawUtil.primitiveType.LINES: return gl.LINES; + case gluDrawUtil.primitiveType.LINE_STRIP: return gl.LINE_STRIP; + case gluDrawUtil.primitiveType.LINE_LOOP: return gl.LINE_LOOP; + case gluDrawUtil.primitiveType.POINTS: return gl.POINTS; +// case gluDrawUtil.primitiveType.PATCHES: return gl.PATCHES; + default: + throw new Error('Unknown primitive type ' + type); + } +}; + +/** + * Calls gluDrawUtil.newPrimitiveListFromIndices() to create primitive list for Points + * @param {number} numElements + */ +gluDrawUtil.pointsFromElements = function(numElements) { + return new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.POINTS, numElements); +}; + +/** + * Calls gluDrawUtil.newPrimitiveListFromIndices() to create primitive list for Triangles + * @param {Array} indices + */ +gluDrawUtil.triangles = function(indices) { + return gluDrawUtil.newPrimitiveListFromIndices(gluDrawUtil.primitiveType.TRIANGLES, indices); +}; + +/** + * Calls gluDrawUtil.newPrimitiveListFromIndices() to create primitive list for Patches + * @param {Array} indices + */ +gluDrawUtil.patches = function(indices) { + return gluDrawUtil.newPrimitiveListFromIndices(gluDrawUtil.primitiveType.PATCHES, indices); +}; + +/** + * Creates primitive list for Triangles or Patches, depending on type + * @param {gluDrawUtil.primitiveType} type gluDrawUtil.primitiveType + * @param {number} numElements + * @constructor + */ +gluDrawUtil.PrimitiveList = function(type, numElements) { + this.type = type; + this.indices = 0; + this.numElements = numElements; +}; + +/** + * @param {gluDrawUtil.primitiveType} type + * @param {Array} indices + * @return {gluDrawUtil.PrimitiveList} + */ +gluDrawUtil.newPrimitiveListFromIndices = function(type, indices) { + /** @type {gluDrawUtil.PrimitiveList} */ var primitiveList = new gluDrawUtil.PrimitiveList(type, 0); + primitiveList.indices = indices; + return primitiveList; +}; + +/** + * Create Element Array Buffer + * @param {WebGL2RenderingContext} gl WebGL context + * @param {gluDrawUtil.PrimitiveList} primitives to construct the buffer from + * @return {WebGLBuffer} indexObject buffer with elements + */ +gluDrawUtil.indexBuffer = function(gl, primitives) { + /** @type {WebGLBuffer} */ var indexObject = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bindBuffer', false, true); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(primitives.indices), gl.STATIC_DRAW); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bufferData', false, true); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + return indexObject; +}; + +/** + * Create Array Buffer + * @param {WebGL2RenderingContext} gl WebGL context + * @param {gluDrawUtil.VertexArrayBinding} vertexArray primitives, Array buffer descriptor + * @return {WebGLBuffer} buffer of vertices + */ +gluDrawUtil.vertexBuffer = function(gl, vertexArray) { + /** @type {goog.TypedArray} */ var typedArray; + switch (vertexArray.type) { + case gl.BYTE: typedArray = new Int8Array(vertexArray.data); break; + case gl.UNSIGNED_BYTE: typedArray = new Uint8Array(vertexArray.data); break; + case gl.SHORT: typedArray = new Int16Array(vertexArray.data); break; + case gl.UNSIGNED_SHORT: typedArray = new Uint16Array(vertexArray.data); break; + case gl.INT: typedArray = new Int32Array(vertexArray.data); break; + case gl.UNSIGNED_INT: typedArray = new Uint32Array(vertexArray.data); break; + default: typedArray = new Float32Array(vertexArray.data); break; + } + + /** @type {WebGLBuffer} */ var buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bindBuffer', false, true); + gl.bufferData(gl.ARRAY_BUFFER, typedArray, gl.STATIC_DRAW); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bufferData', false, true); + gl.enableVertexAttribArray(vertexArray.location); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'enableVertexAttribArray', false, true); + if (vertexArray.type === gl.FLOAT) { + gl.vertexAttribPointer(vertexArray.location, vertexArray.components, vertexArray.type, false, vertexArray.stride, vertexArray.offset); + } else { + gl.vertexAttribIPointer(vertexArray.location, vertexArray.components, vertexArray.type, vertexArray.stride, vertexArray.offset); + } + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'vertexAttribPointer', false, true); + return buffer; +}; + +/** + * @param {Array} rgba + * @constructor + */ +gluDrawUtil.Pixel = function(rgba) { + this.rgba = rgba; +}; + +gluDrawUtil.Pixel.prototype.getRed = function() { + return this.rgba[0]; +}; +gluDrawUtil.Pixel.prototype.getGreen = function() { + return this.rgba[1]; +}; +gluDrawUtil.Pixel.prototype.getBlue = function() { + return this.rgba[2]; +}; +gluDrawUtil.Pixel.prototype.getAlpha = function() { + return this.rgba[3]; +}; +gluDrawUtil.Pixel.prototype.equals = function(otherPixel) { + return this.rgba[0] == otherPixel.rgba[0] && + this.rgba[1] == otherPixel.rgba[1] && + this.rgba[2] == otherPixel.rgba[2] && + this.rgba[3] == otherPixel.rgba[3]; +}; + +/** + * @constructor + */ +gluDrawUtil.Surface = function() { +}; + +gluDrawUtil.Surface.prototype.readSurface = function(gl, x, y, width, height) { + this.buffer = new Uint8Array(width * height * 4); + gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, this.buffer); + this.x = x; + this.y = y; + this.width = width; + this.height = height; + return this.buffer; +}; + +gluDrawUtil.Surface.prototype.getPixel = function(x, y) { + /** @type {number} */ var base = (x + y * this.width) * 4; + /** @type {Array} */ + var rgba = [ + this.buffer[base], + this.buffer[base + 1], + this.buffer[base + 2], + this.buffer[base + 3] + ]; + return new gluDrawUtil.Pixel(rgba); +}; + +gluDrawUtil.Surface.prototype.getPixelUintRGB8 = function(x, y) { + /** @type {number} */ var base = (x + y * this.width) * 4; + /** @type {number} */ + return (this.buffer[base] << 16) + + (this.buffer[base + 1] << 8) + + this.buffer[base + 2]; +}; + +/** + * @enum + */ +gluDrawUtil.VertexComponentType = { + // Standard types: all conversion types apply. + VTX_COMP_UNSIGNED_INT8: 0, + VTX_COMP_UNSIGNED_INT16: 1, + VTX_COMP_UNSIGNED_INT32: 2, + VTX_COMP_SIGNED_INT8: 3, + VTX_COMP_SIGNED_INT16: 4, + VTX_COMP_SIGNED_INT32: 5, + + // Special types: only CONVERT_NONE is allowed. + VTX_COMP_FIXED: 6, + VTX_COMP_HALF_FLOAT: 7, + VTX_COMP_FLOAT: 8 +}; + +/** + * @enum + */ +gluDrawUtil.VertexComponentConversion = { + VTX_COMP_CONVERT_NONE: 0, //!< No conversion: integer types, or floating-point values. + VTX_COMP_CONVERT_NORMALIZE_TO_FLOAT: 1, //!< Normalize integers to range [0,1] or [-1,1] depending on type. + VTX_COMP_CONVERT_CAST_TO_FLOAT: 2 //!< Convert to floating-point directly. +}; + +/** + * gluDrawUtil.VertexArrayPointer + * @constructor + * @param {gluDrawUtil.VertexComponentType} componentType_ + * @param {gluDrawUtil.VertexComponentConversion} convert_ + * @param {number} numComponents_ + * @param {number} numElements_ + * @param {number} stride_ + * @const @param {Array} data_ + */ +gluDrawUtil.VertexArrayPointer = function(componentType_, convert_, numComponents_, numElements_, stride_, data_) { + this.componentType = componentType_; + this.convert = convert_; + this.numComponents = numComponents_; + this.numElements = numElements_; + this.stride = stride_; + this.data = data_; +}; + +/** + * gluDrawUtil.BindingPoint + * @constructor + * @param {string} name + * @param {number} location + * @param {number=} offset + */ +gluDrawUtil.BindingPoint = function(name, location, offset) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.location = location; + /** @type {number} */ this.offset = offset || 0; +}; + +/** + * bindingPointFromLocation + * @param {number} location + * return {gluDrawUtil.BindingPoint} + */ +gluDrawUtil.bindingPointFromLocation = function(location) { + return new gluDrawUtil.BindingPoint('', location); +}; + +/** + * bindingPointFromName + * @param {string} name + * @param {number=} location + * return {gluDrawUtil.BindingPoint} + */ +gluDrawUtil.bindingPointFromName = function(name, location) { + location = location === undefined ? -1 : location; + return new gluDrawUtil.BindingPoint(name, location); +}; + +/** + * @param {string} name + * @param {number} numComponents + * @param {number} numElements + * @param {number} stride + * @param {Array} data + * @return {gluDrawUtil.VertexArrayBinding} + */ +gluDrawUtil.newInt32VertexArrayBinding = function(name, numComponents, numElements, stride, data) { + var bindingPoint = gluDrawUtil.bindingPointFromName(name); + var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_SIGNED_INT32, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, numComponents, numElements, stride, data); + return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer, gl.INT); +}; + +/** + * @param {string} name + * @param {number} numComponents + * @param {number} numElements + * @param {number} stride + * @param {Array} data + * @return {gluDrawUtil.VertexArrayBinding} + */ +gluDrawUtil.newUint32VertexArrayBinding = function(name, numComponents, numElements, stride, data) { + var bindingPoint = gluDrawUtil.bindingPointFromName(name); + var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_UNSIGNED_INT32, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, numComponents, numElements, stride, data); + return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer, gl.UNSIGNED_INT); +}; + +/** + * @param {string} name + * @param {number} numComponents + * @param {number} numElements + * @param {number} stride + * @param {Array} data + * @return {gluDrawUtil.VertexArrayBinding} + */ +gluDrawUtil.newFloatVertexArrayBinding = function(name, numComponents, numElements, stride, data) { + var bindingPoint = gluDrawUtil.bindingPointFromName(name); + var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, numComponents, numElements, stride, data); + return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer); +}; + +/** + * @param {string} name + * @param {number} column + * @param {number} rows + * @param {number} numElements + * @param {number} stride + * @param {Array} data + * @return {gluDrawUtil.VertexArrayBinding} + */ +gluDrawUtil.newFloatColumnVertexArrayBinding = function(name, column, rows, numElements, stride, data) { + var bindingPoint = gluDrawUtil.bindingPointFromName(name); + bindingPoint.location = column; + var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, rows, numElements, stride, data); + return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js new file mode 100644 index 000000000..38f8a28f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js @@ -0,0 +1,117 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; + +goog.provide('framework.opengl.gluObjectWrapper'); + +goog.scope(function() { + var gluObjectWrapper = framework.opengl.gluObjectWrapper; + + /** + * @typedef {function(this:WebGLRenderingContextBase): WebGLObject} + */ + gluObjectWrapper.funcGenT; + + /** + * @typedef {function(this:WebGLRenderingContextBase, WebGLObject)} + */ + gluObjectWrapper.funcDelT; + + /** + * @typedef {{name: string, funcGen: !gluObjectWrapper.funcGenT, funcDel: !gluObjectWrapper.funcDelT}} + */ + gluObjectWrapper.traitsT; + + /** + * Returns an object containing a configuration for an ObjectWrapper + * @param {string} name + * @param {gluObjectWrapper.funcGenT} funcGen + * @param {gluObjectWrapper.funcDelT} funcDel + * @return {gluObjectWrapper.traitsT} + */ + gluObjectWrapper.traits = function(name, funcGen, funcDel) { + return { + name: name, + funcGen: funcGen, + funcDel: funcDel + }; + }; + + /** + * @constructor + * @param {WebGLRenderingContextBase} gl + * @param {gluObjectWrapper.traitsT} traits + */ + gluObjectWrapper.ObjectWrapper = function(gl, traits) { + /** + * @protected + * @type {WebGLRenderingContextBase} + */ + this.m_gl = gl; + + /** + * @protected + * @type {gluObjectWrapper.traitsT} + */ + this.m_traits = traits; + + /** + * @protected + * @type {WebGLObject} + */ + this.m_object = this.m_traits.funcGen.call(gl); + + }; + + /** + * Destorys the WebGLObject associated with this object. + */ + gluObjectWrapper.ObjectWrapper.prototype.clear = function() { + this.m_traits.funcDel.call(this.m_gl, this.m_object); + }; + + /** + * Returns the WebGLObject associated with this object. + * @return {WebGLObject} + */ + gluObjectWrapper.ObjectWrapper.prototype.get = function() { + return this.m_object; + }; + + /** + * @constructor + * @extends {gluObjectWrapper.ObjectWrapper} + * @param {WebGLRenderingContextBase} gl + */ + gluObjectWrapper.Framebuffer = function(gl) { + gluObjectWrapper.ObjectWrapper.call(this, gl, gluObjectWrapper.traits( + 'framebuffer', + /** @type {gluObjectWrapper.funcGenT} */(gl.createFramebuffer), + /** @type {gluObjectWrapper.funcDelT} */(gl.deleteFramebuffer) + )); + }; + gluObjectWrapper.Framebuffer.prototype = Object.create(gluObjectWrapper.ObjectWrapper.prototype); + gluObjectWrapper.Framebuffer.prototype.constructor = gluObjectWrapper.Framebuffer; + + /** + * @return {WebGLFramebuffer} + */ + gluObjectWrapper.Framebuffer.prototype.get; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js new file mode 100644 index 000000000..04b81a2a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js @@ -0,0 +1,55 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluPixelTransfer'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + +var gluPixelTransfer = framework.opengl.gluPixelTransfer; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var gluTextureUtil = framework.opengl.gluTextureUtil; + +gluPixelTransfer.getTransferAlignment = function(format) { + var pixelSize = format.getPixelSize(); + if (deMath.deIsPowerOfTwo32(pixelSize)) + return Math.min(pixelSize, 8); + else + return 1; +}; + +gluPixelTransfer.readPixels = function(ctx, x, y, format, dst) { + var width = dst.getWidth(); + var height = dst.getHeight(); + var arrayType = tcuTexture.getTypedArray(format.type); + var transferFormat = gluTextureUtil.getTransferFormat(format); + ctx.pixelStorei(ctx.PACK_ALIGNMENT, gluPixelTransfer.getTransferAlignment(format)); + var resultPixel = dst.getAccess().getDataPtr(); + resultPixel = new arrayType(dst.getAccess().getBuffer()); + ctx.readPixels(x, y, width, height, transferFormat.format, transferFormat.dataType, resultPixel); +}; + +/* TODO: implement other functions in C++ file */ + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js new file mode 100644 index 000000000..0c340ee38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js @@ -0,0 +1,488 @@ +/*------------------------------------------------------------------------- + * drawElements Quality gluShaderProgram.Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluShaderProgram'); + +goog.scope(function() { + +var gluShaderProgram = framework.opengl.gluShaderProgram; + +/** + * gluShaderProgram.Shader type enum + * @enum {number} + */ +gluShaderProgram.shaderType = { + VERTEX: 0, + FRAGMENT: 1 +}; + +/** + * gluShaderProgram.Shader type enum name + * @param {gluShaderProgram.shaderType} shaderType + * @return {string} + */ +gluShaderProgram.getShaderTypeName = function(shaderType) { + var s_names = + [ + 'vertex', + 'fragment' + ]; + + return s_names[shaderType]; +}; + +/** + * Get GL shader type from gluShaderProgram.shaderType + * @param {WebGL2RenderingContext} gl WebGL context + * @param {gluShaderProgram.shaderType} type gluShaderProgram.Shader Type + * @return {number} GL shader type + */ +gluShaderProgram.getGLShaderType = function(gl, type) { + var _glShaderType; + switch (type) { + case gluShaderProgram.shaderType.VERTEX: _glShaderType = gl.VERTEX_SHADER; break; + case gluShaderProgram.shaderType.FRAGMENT: _glShaderType = gl.FRAGMENT_SHADER; break; + default: + throw new Error('Unknown shader type ' + type); + } + return _glShaderType; +}; + +/** + * Declares shader information + * @constructor + * @param {gluShaderProgram.shaderType} type + * @param {string=} source + */ +gluShaderProgram.ShaderInfo = function(type, source) { + this.type = type; /** gluShaderProgram.Shader type. */ + this.source = source; /** gluShaderProgram.Shader source. */ + this.infoLog; /** Compile info log. */ + this.compileOk = false; /** Did compilation succeed? */ + this.compileTimeUs = 0; /** Compile time in microseconds (us). */ +}; + +/** + * Generates vertex shader info from source + * @param {string} source + * @return {gluShaderProgram.ShaderInfo} vertex shader info + */ +gluShaderProgram.genVertexSource = function(source) { +/** @type {gluShaderProgram.ShaderInfo} */ var shader = new gluShaderProgram.ShaderInfo(gluShaderProgram.shaderType.VERTEX, source); + return shader; +}; + +/** + * Generates fragment shader info from source + * @param {string} source + * @return {gluShaderProgram.ShaderInfo} fragment shader info + */ +gluShaderProgram.genFragmentSource = function(source) { +/** @type {gluShaderProgram.ShaderInfo} */ var shader = new gluShaderProgram.ShaderInfo(gluShaderProgram.shaderType.FRAGMENT, source); + return shader; +}; + +/** + * Generates shader from WebGL context and type + * @constructor + * @param {WebGL2RenderingContext} gl WebGL context + * @param {gluShaderProgram.shaderType} type gluShaderProgram.Shader Type + */ +gluShaderProgram.Shader = function(gl, type) { + this.gl = gl; + this.info = new gluShaderProgram.ShaderInfo(type); /** Client-side clone of state for debug / perf reasons. */ + this.shader = gl.createShader(gluShaderProgram.getGLShaderType(gl, type)); + assertMsgOptions(gl.getError() == gl.NO_ERROR, 'gl.createShader()', false, true); + + this.setSources = function(source) { + this.gl.shaderSource(this.shader, source); + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'glshaderSource()', false, true); + this.info.source = source; + }; + + this.getCompileStatus = function() { + return this.info.compileOk; + }; + + this.compile = function() { + this.info.compileOk = false; + this.info.compileTimeUs = 0; + this.info.infoLog = ''; + + /** @type {Date} */ var compileStart = new Date(); + this.gl.compileShader(this.shader); + /** @type {Date} */ var compileEnd = new Date(); + this.info.compileTimeUs = 1000 * (compileEnd.getTime() - compileStart.getTime()); + + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.compileShader()', false, true); + + var compileStatus = this.gl.getShaderParameter(this.shader, this.gl.COMPILE_STATUS); + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'glGetShaderParameter()', false, true); + + this.info.compileOk = compileStatus; + this.info.infoLog = this.gl.getShaderInfoLog(this.shader); + }; + + this.getShader = function() { + return this.shader; + }; + + this.destroy = function() { + this.gl.deleteShader(this.shader); + }; + +}; +/** + * Creates gluShaderProgram.ProgramInfo + * @constructor + */ +gluShaderProgram.ProgramInfo = function() { + /** @type {string} */ this.infoLog = ''; /** Link info log. */ + /** @type {boolean} */ this.linkOk = false; /** Did link succeed? */ + /** @type {number} */ this.linkTimeUs = 0; /** Link time in microseconds (us). */ +}; + +/** + * Creates program. + * Inner methods: attach shaders, bind attributes location, link program and transform Feedback Varyings + * @constructor + * @param {WebGL2RenderingContext} gl WebGL context + * @param {WebGLProgram=} programID + */ +gluShaderProgram.Program = function(gl, programID) { + this.gl = gl; + this.program = programID || null; + this.info = new gluShaderProgram.ProgramInfo(); + + if (!programID) { + this.program = gl.createProgram(); + assertMsgOptions(gl.getError() == gl.NO_ERROR, 'gl.createProgram()', false, true); + } +}; + +/** + * @return {WebGLProgram} + */ +gluShaderProgram.Program.prototype.getProgram = function() { return this.program; }; + +/** + * @return {gluShaderProgram.ProgramInfo} + */ +gluShaderProgram.Program.prototype.getInfo = function() { return this.info; }; + +/** + * @param {WebGLShader} shader + */ +gluShaderProgram.Program.prototype.attachShader = function(shader) { + this.gl.attachShader(this.program, shader); + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.attachShader()', false, true); +}; + +/** + * @param {WebGLShader} shader + */ +gluShaderProgram.Program.prototype.detachShader = function(shader) { + this.gl.detachShader(this.program, shader); + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.detachShader()', false, true); +}; + +/** + * @param {number} location + * @param {string} name + */ +gluShaderProgram.Program.prototype.bindAttribLocation = function(location, name) { + this.gl.bindAttribLocation(this.program, location, name); + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.bindAttribLocation()', false, true); +}; + +gluShaderProgram.Program.prototype.link = function() { + this.info.linkOk = false; + this.info.linkTimeUs = 0; + this.info.infoLog = ''; + + /** @type {Date} */ var linkStart = new Date(); + this.gl.linkProgram(this.program); + /** @type {Date} */ var linkEnd = new Date(); + this.info.linkTimeUs = 1000 * (linkEnd.getTime() - linkStart.getTime()); + + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.linkProgram()', false, true); + + var linkStatus = this.gl.getProgramParameter(this.program, this.gl.LINK_STATUS); + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.getProgramParameter()', false, true); + this.info.linkOk = linkStatus; + this.info.infoLog = this.gl.getProgramInfoLog(this.program); + if (!this.info.linkOk) + bufferedLogToConsole("program linking: " + this.info.infoLog); +}; + +/** + * return {boolean} + */ +gluShaderProgram.Program.prototype.getLinkStatus = function() { + return this.info.linkOk; +}; + +/** + * @param {Array} varyings + * @param {number} bufferMode + */ +gluShaderProgram.Program.prototype.transformFeedbackVaryings = function(varyings, bufferMode) { + this.gl.transformFeedbackVaryings(this.program, varyings, bufferMode); + assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.transformFeedbackVaryings()', false, true); +}; + +/** + * Assigns gl WebGL context and programSources. Declares array of shaders and new program() + * @constructor + * @param {WebGL2RenderingContext} gl WebGL context + * @param {gluShaderProgram.ProgramSources} programSources + */ +gluShaderProgram.ShaderProgram = function(gl, programSources) { + this.gl = gl; + this.programSources = programSources; + this.shaders = []; + this.program = new gluShaderProgram.Program(gl); + + /** @type {boolean} */ this.shadersOK = true; + + for (var i = 0; i < programSources.sources.length; i++) { + /** @type {gluShaderProgram.Shader} */ var shader = new gluShaderProgram.Shader(gl, programSources.sources[i].type); + shader.setSources(programSources.sources[i].source); + shader.compile(); + this.shaders.push(shader); + this.shadersOK = this.shadersOK && shader.getCompileStatus(); + if (!shader.getCompileStatus()) { + bufferedLogToConsole('gluShaderProgram.Shader:\n' + programSources.sources[i].source); + bufferedLogToConsole('Compile status: ' + shader.getCompileStatus()); + bufferedLogToConsole('Shader infoLog: ' + shader.info.infoLog); + } + } + + if (this.shadersOK) { + for (var i = 0; i < this.shaders.length; i++) + this.program.attachShader(this.shaders[i].getShader()); + + for (var attrib in programSources.attribLocationBindings) + this.program.bindAttribLocation(programSources.attribLocationBindings[attrib], attrib); + + if (programSources.transformFeedbackBufferMode) + if (programSources.transformFeedbackBufferMode === gl.NONE) + assertMsgOptions(programSources.transformFeedbackVaryings.length === 0, 'Transform feedback sanity check', false, true); + else + this.program.transformFeedbackVaryings(programSources.transformFeedbackVaryings, programSources.transformFeedbackBufferMode); + + /* TODO: GLES 3.1: set separable flag */ + + this.program.link(); + + } +}; + +/** + * return {WebGLProgram} + */ +gluShaderProgram.ShaderProgram.prototype.getProgram = function() { + return this.program.program; + }; + +/** + * @return {gluShaderProgram.ProgramInfo} + */ +gluShaderProgram.ShaderProgram.prototype.getProgramInfo = function() { + return this.program.info; +}; + +gluShaderProgram.ShaderProgram.prototype.isOk = function() { + return this.shadersOK && this.program.getLinkStatus(); +}; + +gluShaderProgram.containerTypes = { + ATTRIB_LOCATION_BINDING: 0, + TRANSFORM_FEEDBACK_MODE: 1, + TRANSFORM_FEEDBACK_VARYING: 2, + TRANSFORM_FEEDBACK_VARYINGS: 3, + SHADER_SOURCE: 4, + PROGRAM_SEPARABLE: 5, + PROGRAM_SOURCES: 6, + + CONTAINER_TYPE_LAST: 7, + ATTACHABLE_BEGIN: 0, // ATTRIB_LOCATION_BINDING + ATTACHABLE_END: 5 + 1 // PROGRAM_SEPARABLE + 1 +}; + +/** + * @constructor + */ +gluShaderProgram.AttribLocationBinding = function(name, location) { + this.name = name; + this.location = location; + + this.getContainerType = function() { + return gluShaderProgram.containerTypes.ATTRIB_LOCATION_BINDING; + }; +}; + +/** + * @constructor + */ +gluShaderProgram.TransformFeedbackMode = function(mode) { + this.mode = mode; + + this.getContainerType = function() { + return gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_MODE; + }; +}; + +/** + * @constructor + * @param {string} name + */ +gluShaderProgram.TransformFeedbackVarying = function(name) { + /** @type {string} */ this.name = name; + + this.getContainerType = function() { + return gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYING; + }; +}; + +/** + * @constructor + * @param {Array} array + */ +gluShaderProgram.TransformFeedbackVaryings = function(array) { + /** @type {Array} */ this.array = array; + + this.getContainerType = function() { + return gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYINGS; + }; +}; + +/** + * @constructor + */ +gluShaderProgram.ProgramSeparable = function(separable) { + this.separable = separable; + + this.getContainerType = function() { + return gluShaderProgram.containerTypes.PROGRAM_SEPARABLE; + }; +}; + +/** + * @constructor + */ +gluShaderProgram.VertexSource = function(str) { + this.shaderType = gluShaderProgram.shaderType.VERTEX; + this.source = str; + + this.getContainerType = function() { + return gluShaderProgram.containerTypes.SHADER_SOURCE; + }; +}; + +/** + * @constructor + */ +gluShaderProgram.FragmentSource = function(str) { + this.shaderType = gluShaderProgram.shaderType.FRAGMENT; + this.source = str; + + this.getContainerType = function() { + return gluShaderProgram.containerTypes.SHADER_SOURCE; + }; +}; + +/** + * Create gluShaderProgram.ProgramSources. + * @constructor + */ +gluShaderProgram.ProgramSources = function() { + /** @type {Array} */ this.sources = []; + this.attribLocationBindings = []; + /** @type {Array} */ this.transformFeedbackVaryings = []; + this.transformFeedbackBufferMode = 0; + this.separable = false; +}; + +gluShaderProgram.ProgramSources.prototype.getContainerType = function() { + return gluShaderProgram.containerTypes.PROGRAM_SOURCES; +}; + +gluShaderProgram.ProgramSources.prototype.add = function(item) { + var type = undefined; + if (typeof(item.getContainerType) == 'function') { + type = item.getContainerType(); + if ( + typeof(type) != 'number' || + type < gluShaderProgram.containerTypes.ATTACHABLE_BEGIN || + type >= gluShaderProgram.containerTypes.ATTACHABLE_END + ) { + type = undefined; + } + } + + switch (type) { + case gluShaderProgram.containerTypes.ATTRIB_LOCATION_BINDING: + this.attribLocationBindings.push(item); + break; + + case gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_MODE: + this.transformFeedbackBufferMode = item.mode; + break; + + case gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYING: + this.transformFeedbackVaryings.push(item.name); + break; + + case gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYINGS: + this.transformFeedbackVaryings = this.transformFeedbackVaryings.concat(item.array); + break; + + case gluShaderProgram.containerTypes.SHADER_SOURCE: + this.sources.push(new gluShaderProgram.ShaderInfo(item.shaderType, item.source)); + break; + + case gluShaderProgram.containerTypes.PROGRAM_SEPARABLE: + this.separable = item.separable; + break; + + default: + throw new Error('Type \"' + type + '\" cannot be added to gluShaderProgram.ProgramSources.'); + break; + } + + return this; +}; + +/** + * //! Helper for constructing vertex-fragment source pair. + * @param {string} vertexSrc + * @param {string} fragmentSrc + * @return {gluShaderProgram.ProgramSources} + */ +gluShaderProgram.makeVtxFragSources = function(vertexSrc, fragmentSrc) { + /** @type  {gluShaderProgram.ProgramSources} */ var sources = new gluShaderProgram.ProgramSources(); + sources.sources.push(gluShaderProgram.genVertexSource(vertexSrc)); + sources.sources.push(gluShaderProgram.genFragmentSource(fragmentSrc)); + return sources; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js new file mode 100644 index 000000000..1604dbc61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js @@ -0,0 +1,795 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluShaderUtil'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var gluShaderUtil = framework.opengl.gluShaderUtil; +var deMath = framework.delibs.debase.deMath; + +/** + * ShadingLanguageVersion + * @enum + */ +gluShaderUtil.GLSLVersion = { + V100_ES: 0, //!< GLSL ES 1.0 + V300_ES: 1 //!< GLSL ES 3.0 +}; + +/** + * gluShaderUtil.glslVersionUsesInOutQualifiers + * @param {gluShaderUtil.GLSLVersion} version + * @return {boolean} + */ +gluShaderUtil.glslVersionUsesInOutQualifiers = function(version) { + return version == gluShaderUtil.GLSLVersion.V300_ES; +}; + +/** + * gluShaderUtil.isGLSLVersionSupported + * @param {WebGL2RenderingContext|WebGLRenderingContextBase} ctx + * @param {gluShaderUtil.GLSLVersion} version + * @return {boolean} + */ +gluShaderUtil.isGLSLVersionSupported = function(ctx, version) { + return version <= gluShaderUtil.getGLSLVersion(ctx); +}; + +/** + * gluShaderUtil.getGLSLVersion - Returns a gluShaderUtil.GLSLVersion based on a given webgl context. + * @param {WebGL2RenderingContext|WebGLRenderingContextBase} gl + * @return {gluShaderUtil.GLSLVersion} + */ +gluShaderUtil.getGLSLVersion = function(gl) { + var glslversion = gl.getParameter(gl.SHADING_LANGUAGE_VERSION); + + // TODO: Versions are not yet well implemented... Firefox returns GLSL ES 1.0 in some cases, + // and Chromium returns GLSL ES 2.0 in some cases. Returning the right version for + // testing. + // return gluShaderUtil.GLSLVersion.V300_ES; + + if (glslversion.indexOf('WebGL GLSL ES 1.0') != -1) return gluShaderUtil.GLSLVersion.V100_ES; + if (glslversion.indexOf('WebGL GLSL ES 3.0') != -1) return gluShaderUtil.GLSLVersion.V300_ES; + + throw new Error('Invalid WebGL version'); +}; + +/** + * gluShaderUtil.getGLSLVersionDeclaration - Returns a string declaration for the glsl version in a shader. + * @param {gluShaderUtil.GLSLVersion} version + * @return {string} + */ +gluShaderUtil.getGLSLVersionDeclaration = function(version) { + /** @type {Array} */ var s_decl = + [ + '#version 100', + '#version 300 es' + ]; + + if (version > s_decl.length - 1) + throw new Error('Unsupported GLSL version.'); + + return s_decl[version]; +}; + +/** + * gluShaderUtil.getGLSLVersionString - Returns the same thing as + * getGLSLVersionDeclaration() but without the substring '#version' + * @param {gluShaderUtil.GLSLVersion} version + * @return {string} + */ +gluShaderUtil.getGLSLVersionString = function(version) { + /** @type {Array} */ var s_decl = + [ + '100', + '300 es' + ]; + + if (version > s_decl.length - 1) + throw new Error('Unsupported GLSL version.'); + + return s_decl[version]; +}; + +/** + * @enum + */ +gluShaderUtil.precision = { + PRECISION_LOWP: 0, + PRECISION_MEDIUMP: 1, + PRECISION_HIGHP: 2 +}; + +gluShaderUtil.getPrecisionName = function(prec) { + var s_names = [ + 'lowp', + 'mediump', + 'highp' + ]; + + return s_names[prec]; +}; + +/** + * The Type constants + * @enum {number} + */ +gluShaderUtil.DataType = { + INVALID: 0, + + FLOAT: 1, + FLOAT_VEC2: 2, + FLOAT_VEC3: 3, + FLOAT_VEC4: 4, + FLOAT_MAT2: 5, + FLOAT_MAT2X3: 6, + FLOAT_MAT2X4: 7, + FLOAT_MAT3X2: 8, + FLOAT_MAT3: 9, + FLOAT_MAT3X4: 10, + FLOAT_MAT4X2: 11, + FLOAT_MAT4X3: 12, + FLOAT_MAT4: 13, + + INT: 14, + INT_VEC2: 15, + INT_VEC3: 16, + INT_VEC4: 17, + + UINT: 18, + UINT_VEC2: 19, + UINT_VEC3: 20, + UINT_VEC4: 21, + + BOOL: 22, + BOOL_VEC2: 23, + BOOL_VEC3: 24, + BOOL_VEC4: 25, + + SAMPLER_2D: 26, + SAMPLER_CUBE: 27, + SAMPLER_2D_ARRAY: 28, + SAMPLER_3D: 29, + + SAMPLER_2D_SHADOW: 30, + SAMPLER_CUBE_SHADOW: 31, + SAMPLER_2D_ARRAY_SHADOW: 32, + + INT_SAMPLER_2D: 33, + INT_SAMPLER_CUBE: 34, + INT_SAMPLER_2D_ARRAY: 35, + INT_SAMPLER_3D: 36, + + UINT_SAMPLER_2D: 37, + UINT_SAMPLER_CUBE: 38, + UINT_SAMPLER_2D_ARRAY: 39, + UINT_SAMPLER_3D: 40 +}; + +/** + * Returns type of float scalars + * @param {gluShaderUtil.DataType} dataType + * @return {string} type of float scalar + */ +gluShaderUtil.getDataTypeFloatScalars = function(dataType) { + + switch (dataType) { + case gluShaderUtil.DataType.FLOAT: return 'float'; + case gluShaderUtil.DataType.FLOAT_VEC2: return 'vec2'; + case gluShaderUtil.DataType.FLOAT_VEC3: return 'vec3'; + case gluShaderUtil.DataType.FLOAT_VEC4: return 'vec4'; + case gluShaderUtil.DataType.FLOAT_MAT2: return 'mat2'; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'mat2x3'; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'mat2x4'; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'mat3x2'; + case gluShaderUtil.DataType.FLOAT_MAT3: return 'mat3'; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'mat3x4'; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'mat4x2'; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'mat4x3'; + case gluShaderUtil.DataType.FLOAT_MAT4: return 'mat4'; + case gluShaderUtil.DataType.INT: return 'float'; + case gluShaderUtil.DataType.INT_VEC2: return 'vec2'; + case gluShaderUtil.DataType.INT_VEC3: return 'vec3'; + case gluShaderUtil.DataType.INT_VEC4: return 'vec4'; + case gluShaderUtil.DataType.UINT: return 'float'; + case gluShaderUtil.DataType.UINT_VEC2: return 'vec2'; + case gluShaderUtil.DataType.UINT_VEC3: return 'vec3'; + case gluShaderUtil.DataType.UINT_VEC4: return 'vec4'; + case gluShaderUtil.DataType.BOOL: return 'float'; + case gluShaderUtil.DataType.BOOL_VEC2: return 'vec2'; + case gluShaderUtil.DataType.BOOL_VEC3: return 'vec3'; + case gluShaderUtil.DataType.BOOL_VEC4: return 'vec4'; + } + throw Error('Unrecognized dataType ' + dataType); +}; + +/** + * gluShaderUtil.getDataTypeVector + * @param {gluShaderUtil.DataType} scalarType + * @param {number} size + * @return {gluShaderUtil.DataType} + */ +gluShaderUtil.getDataTypeVector = function(scalarType, size) { + var floats = [gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4]; + var ints = [gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4]; + var uints = [gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4]; + var bools = [gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL_VEC2, + gluShaderUtil.DataType.BOOL_VEC3, + gluShaderUtil.DataType.BOOL_VEC4]; + + switch (scalarType) { + case gluShaderUtil.DataType.FLOAT: return floats[size - 1]; + case gluShaderUtil.DataType.INT: return ints[size - 1]; + case gluShaderUtil.DataType.UINT: return uints[size - 1]; + case gluShaderUtil.DataType.BOOL: return bools[size - 1]; + default: + throw new Error('Scalar type is not a vectoe:' + scalarType); + } +}; + +/** + * gluShaderUtil.getDataTypeFloatVec + * @param {number} vecSize + * @return {gluShaderUtil.DataType} + */ +gluShaderUtil.getDataTypeFloatVec = function(vecSize) { + return gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, vecSize); +}; + +/** + * gluShaderUtil.isDataTypeBoolOrBVec + * @param {gluShaderUtil.DataType} dataType + * @return {boolean} + */ +gluShaderUtil.isDataTypeBoolOrBVec = function(dataType) { + return (dataType >= gluShaderUtil.DataType.BOOL) && (dataType <= gluShaderUtil.DataType.BOOL_VEC4); +}; + +/** + * Returns type of scalar + * @param {gluShaderUtil.DataType} dataType shader + * @return {string} type of scalar type + */ +gluShaderUtil.getDataTypeScalarType = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT: return 'float'; + case gluShaderUtil.DataType.FLOAT_VEC2: return 'float'; + case gluShaderUtil.DataType.FLOAT_VEC3: return 'float'; + case gluShaderUtil.DataType.FLOAT_VEC4: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT2: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT3: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'float'; + case gluShaderUtil.DataType.FLOAT_MAT4: return 'float'; + case gluShaderUtil.DataType.INT: return 'int'; + case gluShaderUtil.DataType.INT_VEC2: return 'int'; + case gluShaderUtil.DataType.INT_VEC3: return 'int'; + case gluShaderUtil.DataType.INT_VEC4: return 'int'; + case gluShaderUtil.DataType.UINT: return 'uint'; + case gluShaderUtil.DataType.UINT_VEC2: return 'uint'; + case gluShaderUtil.DataType.UINT_VEC3: return 'uint'; + case gluShaderUtil.DataType.UINT_VEC4: return 'uint'; + case gluShaderUtil.DataType.BOOL: return 'bool'; + case gluShaderUtil.DataType.BOOL_VEC2: return 'bool'; + case gluShaderUtil.DataType.BOOL_VEC3: return 'bool'; + case gluShaderUtil.DataType.BOOL_VEC4: return 'bool'; + case gluShaderUtil.DataType.SAMPLER_2D: return 'sampler2D'; + case gluShaderUtil.DataType.SAMPLER_CUBE: return 'samplerCube'; + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: return 'sampler2DArray'; + case gluShaderUtil.DataType.SAMPLER_3D: return 'sampler3D'; + case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: return 'sampler2DShadow'; + case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: return 'samplerCubeShadow'; + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: return 'sampler2DArrayShadow'; + case gluShaderUtil.DataType.INT_SAMPLER_2D: return 'isampler2D'; + case gluShaderUtil.DataType.INT_SAMPLER_CUBE: return 'isamplerCube'; + case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: return 'isampler2DArray'; + case gluShaderUtil.DataType.INT_SAMPLER_3D: return 'isampler3D'; + case gluShaderUtil.DataType.UINT_SAMPLER_2D: return 'usampler2D'; + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: return 'usamplerCube'; + case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: return 'usampler2DArray'; + case gluShaderUtil.DataType.UINT_SAMPLER_3D: return 'usampler3D'; + } + throw new Error('Unrecognized datatype:' + dataType); +}; + +/** + * Returns type of scalar + * @param {?gluShaderUtil.DataType} dataType shader + * @return {gluShaderUtil.DataType} type of scalar type + */ +gluShaderUtil.getDataTypeScalarTypeAsDataType = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_VEC2: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_VEC3: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_VEC4: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT2: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT3: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.FLOAT_MAT4: return gluShaderUtil.DataType.FLOAT; + case gluShaderUtil.DataType.INT: return gluShaderUtil.DataType.INT; + case gluShaderUtil.DataType.INT_VEC2: return gluShaderUtil.DataType.INT; + case gluShaderUtil.DataType.INT_VEC3: return gluShaderUtil.DataType.INT; + case gluShaderUtil.DataType.INT_VEC4: return gluShaderUtil.DataType.INT; + case gluShaderUtil.DataType.UINT: return gluShaderUtil.DataType.UINT; + case gluShaderUtil.DataType.UINT_VEC2: return gluShaderUtil.DataType.UINT; + case gluShaderUtil.DataType.UINT_VEC3: return gluShaderUtil.DataType.UINT; + case gluShaderUtil.DataType.UINT_VEC4: return gluShaderUtil.DataType.UINT; + case gluShaderUtil.DataType.BOOL: return gluShaderUtil.DataType.BOOL; + case gluShaderUtil.DataType.BOOL_VEC2: return gluShaderUtil.DataType.BOOL; + case gluShaderUtil.DataType.BOOL_VEC3: return gluShaderUtil.DataType.BOOL; + case gluShaderUtil.DataType.BOOL_VEC4: return gluShaderUtil.DataType.BOOL; + case gluShaderUtil.DataType.SAMPLER_2D: + case gluShaderUtil.DataType.SAMPLER_CUBE: + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.SAMPLER_3D: + case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: + case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: + case gluShaderUtil.DataType.INT_SAMPLER_2D: + case gluShaderUtil.DataType.INT_SAMPLER_CUBE: + case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.INT_SAMPLER_3D: + case gluShaderUtil.DataType.UINT_SAMPLER_2D: + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: + case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.UINT_SAMPLER_3D: + return dataType; + } + throw Error('Unrecognized dataType ' + dataType); +}; + +/** + * Checks if dataType is integer or vectors of integers + * @param {gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType integer or integer vector + */ +gluShaderUtil.isDataTypeIntOrIVec = function(dataType) { + /** @type {boolean} */ var retVal = false; + switch (dataType) { + case gluShaderUtil.DataType.INT: + case gluShaderUtil.DataType.INT_VEC2: + case gluShaderUtil.DataType.INT_VEC3: + case gluShaderUtil.DataType.INT_VEC4: + retVal = true; + } + + return retVal; +}; + +/** + * Checks if dataType is unsigned integer or vectors of unsigned integers + * @param {gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType unsigned integer or unsigned integer vector + */ +gluShaderUtil.isDataTypeUintOrUVec = function(dataType) { + /** @type {boolean} */ var retVal = false; + switch (dataType) { + case gluShaderUtil.DataType.UINT: + case gluShaderUtil.DataType.UINT_VEC2: + case gluShaderUtil.DataType.UINT_VEC3: + case gluShaderUtil.DataType.UINT_VEC4: + retVal = true; + } + + return retVal; +}; + +/** +* Returns type of scalar size +* @param {gluShaderUtil.DataType} dataType shader +* @return {number} with size of the type of scalar +*/ +gluShaderUtil.getDataTypeScalarSize = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT: return 1; + case gluShaderUtil.DataType.FLOAT_VEC2: return 2; + case gluShaderUtil.DataType.FLOAT_VEC3: return 3; + case gluShaderUtil.DataType.FLOAT_VEC4: return 4; + case gluShaderUtil.DataType.FLOAT_MAT2: return 4; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return 6; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return 8; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return 6; + case gluShaderUtil.DataType.FLOAT_MAT3: return 9; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return 12; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return 8; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return 12; + case gluShaderUtil.DataType.FLOAT_MAT4: return 16; + case gluShaderUtil.DataType.INT: return 1; + case gluShaderUtil.DataType.INT_VEC2: return 2; + case gluShaderUtil.DataType.INT_VEC3: return 3; + case gluShaderUtil.DataType.INT_VEC4: return 4; + case gluShaderUtil.DataType.UINT: return 1; + case gluShaderUtil.DataType.UINT_VEC2: return 2; + case gluShaderUtil.DataType.UINT_VEC3: return 3; + case gluShaderUtil.DataType.UINT_VEC4: return 4; + case gluShaderUtil.DataType.BOOL: return 1; + case gluShaderUtil.DataType.BOOL_VEC2: return 2; + case gluShaderUtil.DataType.BOOL_VEC3: return 3; + case gluShaderUtil.DataType.BOOL_VEC4: return 4; + case gluShaderUtil.DataType.SAMPLER_2D: return 1; + case gluShaderUtil.DataType.SAMPLER_CUBE: return 1; + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: return 1; + case gluShaderUtil.DataType.SAMPLER_3D: return 1; + case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: return 1; + case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: return 1; + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: return 1; + case gluShaderUtil.DataType.INT_SAMPLER_2D: return 1; + case gluShaderUtil.DataType.INT_SAMPLER_CUBE: return 1; + case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: return 1; + case gluShaderUtil.DataType.INT_SAMPLER_3D: return 1; + case gluShaderUtil.DataType.UINT_SAMPLER_2D: return 1; + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: return 1; + case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: return 1; + case gluShaderUtil.DataType.UINT_SAMPLER_3D: return 1; + } + throw Error('Unrecognized dataType ' + dataType); +}; + +/** + * Checks if dataType is float or vector + * @param {?gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType float or vector + */ +gluShaderUtil.isDataTypeFloatOrVec = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT: + case gluShaderUtil.DataType.FLOAT_VEC2: + case gluShaderUtil.DataType.FLOAT_VEC3: + case gluShaderUtil.DataType.FLOAT_VEC4: + return true; + } + return false; +}; + +/** + * Checks if dataType is a matrix + * @param {gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType matrix or not + */ +gluShaderUtil.isDataTypeMatrix = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT_MAT2: + case gluShaderUtil.DataType.FLOAT_MAT2X3: + case gluShaderUtil.DataType.FLOAT_MAT2X4: + case gluShaderUtil.DataType.FLOAT_MAT3X2: + case gluShaderUtil.DataType.FLOAT_MAT3: + case gluShaderUtil.DataType.FLOAT_MAT3X4: + case gluShaderUtil.DataType.FLOAT_MAT4X2: + case gluShaderUtil.DataType.FLOAT_MAT4X3: + case gluShaderUtil.DataType.FLOAT_MAT4: + return true; + } + return false; +}; + +/** + * Checks if dataType is a vector + * @param {gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType vector or not + */ +gluShaderUtil.isDataTypeScalar = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT: + case gluShaderUtil.DataType.INT: + case gluShaderUtil.DataType.UINT: + case gluShaderUtil.DataType.BOOL: + return true; + } + return false; +}; + +/** + * Checks if dataType is a vector + * @param {gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType vector or not + */ +gluShaderUtil.isDataTypeVector = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT_VEC2: + case gluShaderUtil.DataType.FLOAT_VEC3: + case gluShaderUtil.DataType.FLOAT_VEC4: + case gluShaderUtil.DataType.INT_VEC2: + case gluShaderUtil.DataType.INT_VEC3: + case gluShaderUtil.DataType.INT_VEC4: + case gluShaderUtil.DataType.UINT_VEC2: + case gluShaderUtil.DataType.UINT_VEC3: + case gluShaderUtil.DataType.UINT_VEC4: + case gluShaderUtil.DataType.BOOL_VEC2: + case gluShaderUtil.DataType.BOOL_VEC3: + case gluShaderUtil.DataType.BOOL_VEC4: + return true; + } + return false; +}; + +/** + * Checks if dataType is a vector or a scalar type + * @param {gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType vector or scalar or not + */ +gluShaderUtil.isDataTypeScalarOrVector = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT: + case gluShaderUtil.DataType.FLOAT_VEC2: + case gluShaderUtil.DataType.FLOAT_VEC3: + case gluShaderUtil.DataType.FLOAT_VEC4: + case gluShaderUtil.DataType.INT: + case gluShaderUtil.DataType.INT_VEC2: + case gluShaderUtil.DataType.INT_VEC3: + case gluShaderUtil.DataType.INT_VEC4: + case gluShaderUtil.DataType.UINT: + case gluShaderUtil.DataType.UINT_VEC2: + case gluShaderUtil.DataType.UINT_VEC3: + case gluShaderUtil.DataType.UINT_VEC4: + case gluShaderUtil.DataType.BOOL: + case gluShaderUtil.DataType.BOOL_VEC2: + case gluShaderUtil.DataType.BOOL_VEC3: + case gluShaderUtil.DataType.BOOL_VEC4: + return true; + } + return false; +}; + +/** + * Checks if dataType is a sampler + * @param {gluShaderUtil.DataType} dataType shader + * @return {boolean} Is dataType vector or scalar or not + */ +gluShaderUtil.isDataTypeSampler = function(dataType) { + return (dataType >= gluShaderUtil.DataType.SAMPLER_2D) && (dataType <= gluShaderUtil.DataType.UINT_SAMPLER_3D); +}; + +/** + * Returns a gluShaderUtil.DataType based on given rows and columns + * @param {number} numCols + * @param {number} numRows + * @return {gluShaderUtil.DataType} + */ +gluShaderUtil.getDataTypeMatrix = function(numCols, numRows) { + if (!(deMath.deInRange32(numCols, 2, 4) && deMath.deInRange32(numRows, 2, 4))) + throw new Error('Out of bounds: (' + numCols + ',' + numRows + ')'); + + var size = numCols.toString() + 'x' + numRows.toString(); + var datatypes = { + '2x2': gluShaderUtil.DataType.FLOAT_MAT2, + '2x3': gluShaderUtil.DataType.FLOAT_MAT2X3, + '2x4': gluShaderUtil.DataType.FLOAT_MAT2X4, + '3x2': gluShaderUtil.DataType.FLOAT_MAT3X2, + '3x3': gluShaderUtil.DataType.FLOAT_MAT3, + '3x4': gluShaderUtil.DataType.FLOAT_MAT3X4, + '4x2': gluShaderUtil.DataType.FLOAT_MAT4X2, + '4x3': gluShaderUtil.DataType.FLOAT_MAT4X3, + '4x4': gluShaderUtil.DataType.FLOAT_MAT4 + }; + return datatypes[size]; +}; + +/** +* Returns number of rows of a gluShaderUtil.DataType Matrix +* @param {gluShaderUtil.DataType} dataType shader +* @return {number} with number of rows depending on gluShaderUtil.DataType Matrix +*/ +gluShaderUtil.getDataTypeMatrixNumRows = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT_MAT2: return 2; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return 3; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return 4; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return 2; + case gluShaderUtil.DataType.FLOAT_MAT3: return 3; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return 4; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return 2; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return 3; + case gluShaderUtil.DataType.FLOAT_MAT4: return 4; + } + throw Error('Unrecognized dataType ' + dataType); +}; + +/** +* Returns number of columns of a gluShaderUtil.DataType Matrix +* @param {gluShaderUtil.DataType} dataType shader +* @return {number} with number of columns depending on gluShaderUtil.DataType Matrix +*/ +gluShaderUtil.getDataTypeMatrixNumColumns = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT_MAT2: return 2; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return 2; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return 2; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return 3; + case gluShaderUtil.DataType.FLOAT_MAT3: return 3; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return 3; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return 4; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return 4; + case gluShaderUtil.DataType.FLOAT_MAT4: return 4; + } + throw Error('Unrecognized dataType ' + dataType); +}; + +/** + * @param {gluShaderUtil.DataType} dataType + * @return {number} + */ +gluShaderUtil.getDataTypeNumLocations = function(dataType) { + if (gluShaderUtil.isDataTypeScalarOrVector(dataType)) + return 1; + else if (gluShaderUtil.isDataTypeMatrix(dataType)) + return gluShaderUtil.getDataTypeMatrixNumColumns(dataType); + throw Error('Unrecognized dataType ' + dataType); +}; + +/** + * @param {gluShaderUtil.DataType} dataType + * @return {number} + */ +gluShaderUtil.getDataTypeNumComponents = function(dataType) { + if (gluShaderUtil.isDataTypeScalarOrVector(dataType)) + return gluShaderUtil.getDataTypeScalarSize(dataType); + else if (gluShaderUtil.isDataTypeMatrix(dataType)) + return gluShaderUtil.getDataTypeMatrixNumRows(dataType); + + throw Error('Unrecognized dataType ' + dataType); +}; + +/** + * Returns name of the dataType + * @param {?gluShaderUtil.DataType} dataType shader + * @return {string} dataType name + */ +gluShaderUtil.getDataTypeName = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.INVALID: return 'invalid'; + + case gluShaderUtil.DataType.FLOAT: return 'float'; + case gluShaderUtil.DataType.FLOAT_VEC2: return 'vec2'; + case gluShaderUtil.DataType.FLOAT_VEC3: return 'vec3'; + case gluShaderUtil.DataType.FLOAT_VEC4: return 'vec4'; + case gluShaderUtil.DataType.FLOAT_MAT2: return 'mat2'; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'mat2x3'; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'mat2x4'; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'mat3x2'; + case gluShaderUtil.DataType.FLOAT_MAT3: return 'mat3'; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'mat3x4'; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'mat4x2'; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'mat4x3'; + case gluShaderUtil.DataType.FLOAT_MAT4: return 'mat4'; + + case gluShaderUtil.DataType.INT: return 'int'; + case gluShaderUtil.DataType.INT_VEC2: return 'ivec2'; + case gluShaderUtil.DataType.INT_VEC3: return 'ivec3'; + case gluShaderUtil.DataType.INT_VEC4: return 'ivec4'; + + case gluShaderUtil.DataType.UINT: return 'uint'; + case gluShaderUtil.DataType.UINT_VEC2: return 'uvec2'; + case gluShaderUtil.DataType.UINT_VEC3: return 'uvec3'; + case gluShaderUtil.DataType.UINT_VEC4: return 'uvec4'; + + case gluShaderUtil.DataType.BOOL: return 'bool'; + case gluShaderUtil.DataType.BOOL_VEC2: return 'bvec2'; + case gluShaderUtil.DataType.BOOL_VEC3: return 'bvec3'; + case gluShaderUtil.DataType.BOOL_VEC4: return 'bvec4'; + + case gluShaderUtil.DataType.SAMPLER_2D: return 'sampler2D'; + case gluShaderUtil.DataType.SAMPLER_CUBE: return 'samplerCube'; + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: return 'sampler2DArray'; + case gluShaderUtil.DataType.SAMPLER_3D: return 'sampler3D'; + + case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: return 'sampler2DShadow'; + case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: return 'samplerCubeShadow'; + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: return 'sampler2DArrayShadow'; + + case gluShaderUtil.DataType.INT_SAMPLER_2D: return 'isampler2D'; + case gluShaderUtil.DataType.INT_SAMPLER_CUBE: return 'isamplerCube'; + case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: return 'isampler2DArray'; + case gluShaderUtil.DataType.INT_SAMPLER_3D: return 'isampler3D'; + + case gluShaderUtil.DataType.UINT_SAMPLER_2D: return 'usampler2D'; + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: return 'usamplerCube'; + case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: return 'usampler2DArray'; + case gluShaderUtil.DataType.UINT_SAMPLER_3D: return 'usampler3D'; + } + throw Error('Unrecognized dataType ' + dataType); +}; + +/** + * Returns the gluShaderUtil.DataType from the GL type + * @param {number} glType + * @return {gluShaderUtil.DataType} + */ +gluShaderUtil.getDataTypeFromGLType = function(glType) { + switch (glType) { + case gl.FLOAT: return gluShaderUtil.DataType.FLOAT; + case gl.FLOAT_VEC2: return gluShaderUtil.DataType.FLOAT_VEC2; + case gl.FLOAT_VEC3: return gluShaderUtil.DataType.FLOAT_VEC3; + case gl.FLOAT_VEC4: return gluShaderUtil.DataType.FLOAT_VEC4; + + case gl.FLOAT_MAT2: return gluShaderUtil.DataType.FLOAT_MAT2; + case gl.FLOAT_MAT2x3: return gluShaderUtil.DataType.FLOAT_MAT2X3; + case gl.FLOAT_MAT2x4: return gluShaderUtil.DataType.FLOAT_MAT2X4; + + case gl.FLOAT_MAT3x2: return gluShaderUtil.DataType.FLOAT_MAT3X2; + case gl.FLOAT_MAT3: return gluShaderUtil.DataType.FLOAT_MAT3; + case gl.FLOAT_MAT3x4: return gluShaderUtil.DataType.FLOAT_MAT3X4; + + case gl.FLOAT_MAT4x2: return gluShaderUtil.DataType.FLOAT_MAT4X2; + case gl.FLOAT_MAT4x3: return gluShaderUtil.DataType.FLOAT_MAT4X3; + case gl.FLOAT_MAT4: return gluShaderUtil.DataType.FLOAT_MAT4; + + case gl.INT: return gluShaderUtil.DataType.INT; + case gl.INT_VEC2: return gluShaderUtil.DataType.INT_VEC2; + case gl.INT_VEC3: return gluShaderUtil.DataType.INT_VEC3; + case gl.INT_VEC4: return gluShaderUtil.DataType.INT_VEC4; + + case gl.UNSIGNED_INT: return gluShaderUtil.DataType.UINT; + case gl.UNSIGNED_INT_VEC2: return gluShaderUtil.DataType.UINT_VEC2; + case gl.UNSIGNED_INT_VEC3: return gluShaderUtil.DataType.UINT_VEC3; + case gl.UNSIGNED_INT_VEC4: return gluShaderUtil.DataType.UINT_VEC4; + + case gl.BOOL: return gluShaderUtil.DataType.BOOL; + case gl.BOOL_VEC2: return gluShaderUtil.DataType.BOOL_VEC2; + case gl.BOOL_VEC3: return gluShaderUtil.DataType.BOOL_VEC3; + case gl.BOOL_VEC4: return gluShaderUtil.DataType.BOOL_VEC4; + + case gl.SAMPLER_2D: return gluShaderUtil.DataType.SAMPLER_2D; + case gl.SAMPLER_CUBE: return gluShaderUtil.DataType.SAMPLER_CUBE; + case gl.SAMPLER_2D_ARRAY: return gluShaderUtil.DataType.SAMPLER_2D_ARRAY; + case gl.SAMPLER_3D: return gluShaderUtil.DataType.SAMPLER_3D; + + case gl.SAMPLER_2D_SHADOW: return gluShaderUtil.DataType.SAMPLER_2D_SHADOW; + case gl.SAMPLER_CUBE_SHADOW: return gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW; + case gl.SAMPLER_2D_ARRAY_SHADOW: return gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW; + + case gl.INT_SAMPLER_2D: return gluShaderUtil.DataType.INT_SAMPLER_2D; + case gl.INT_SAMPLER_CUBE: return gluShaderUtil.DataType.INT_SAMPLER_CUBE; + case gl.INT_SAMPLER_2D_ARRAY: return gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY; + case gl.INT_SAMPLER_3D: return gluShaderUtil.DataType.INT_SAMPLER_3D; + + case gl.UNSIGNED_INT_SAMPLER_2D: return gluShaderUtil.DataType.UINT_SAMPLER_2D; + case gl.UNSIGNED_INT_SAMPLER_CUBE: return gluShaderUtil.DataType.UINT_SAMPLER_CUBE; + case gl.UNSIGNED_INT_SAMPLER_2D_ARRAY: return gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY; + case gl.UNSIGNED_INT_SAMPLER_3D: return gluShaderUtil.DataType.UINT_SAMPLER_3D; + + default: + throw new Error('Unrecognized GL type:' + glType); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js new file mode 100644 index 000000000..b554db047 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js @@ -0,0 +1,166 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluStrUtil'); + +goog.scope(function() { + +var gluStrUtil = framework.opengl.gluStrUtil; + +gluStrUtil.getPixelFormatName = function(value) { + switch (value) { + case gl.LUMINANCE: return 'gl.LUMINANCE'; + case gl.LUMINANCE_ALPHA: return 'gl.LUMINANCE_ALPHA'; + case gl.ALPHA: return 'gl.ALPHA'; + case gl.RGB: return 'gl.RGB'; + case gl.RGBA: return 'gl.RGBA'; + case gl.RGBA4: return 'gl.RGBA4'; + case gl.RGB5_A1: return 'gl.RGB5_A1'; + case gl.RGB565: return 'gl.RGB565'; + case gl.DEPTH_COMPONENT16: return 'gl.DEPTH_COMPONENT16'; + case gl.STENCIL_INDEX8: return 'gl.STENCIL_INDEX8'; + case gl.RG: return 'gl.RG'; + case gl.RED: return 'gl.RED'; + case gl.RGBA_INTEGER: return 'gl.RGBA_INTEGER'; + case gl.RGB_INTEGER: return 'gl.RGB_INTEGER'; + case gl.RG_INTEGER: return 'gl.RG_INTEGER'; + case gl.RED_INTEGER: return 'gl.RED_INTEGER'; + case gl.DEPTH_COMPONENT: return 'gl.DEPTH_COMPONENT'; + case gl.DEPTH_STENCIL: return 'gl.DEPTH_STENCIL'; + case gl.RGBA32F: return 'gl.RGBA32F'; + case gl.RGBA32I: return 'gl.RGBA32I'; + case gl.RGBA32UI: return 'gl.RGBA32UI'; + // case gl.RGBA16: return 'gl.RGBA16'; + // case gl.RGBA16_SNORM: return 'gl.RGBA16_SNORM'; + case gl.RGBA16F: return 'gl.RGBA16F'; + case gl.RGBA16I: return 'gl.RGBA16I'; + case gl.RGBA16UI: return 'gl.RGBA16UI'; + case gl.RGBA8: return 'gl.RGBA8'; + case gl.RGBA8I: return 'gl.RGBA8I'; + case gl.RGBA8UI: return 'gl.RGBA8UI'; + case gl.SRGB8_ALPHA8: return 'gl.SRGB8_ALPHA8'; + case gl.RGB10_A2: return 'gl.RGB10_A2'; + case gl.RGB10_A2UI: return 'gl.RGB10_A2UI'; + case gl.RGBA8_SNORM: return 'gl.RGBA8_SNORM'; + case gl.RGB8: return 'gl.RGB8'; + case gl.R11F_G11F_B10F: return 'gl.R11F_G11F_B10F'; + case gl.RGB32F: return 'gl.RGB32F'; + case gl.RGB32I: return 'gl.RGB32I'; + case gl.RGB32UI: return 'gl.RGB32UI'; + // case gl.RGB16: return 'gl.RGB16'; + // case gl.RGB16_SNORM: return 'gl.RGB16_SNORM'; + case gl.RGB16F: return 'gl.RGB16F'; + case gl.RGB16I: return 'gl.RGB16I'; + case gl.RGB16UI: return 'gl.RGB16UI'; + case gl.RGB8_SNORM: return 'gl.RGB8_SNORM'; + case gl.RGB8I: return 'gl.RGB8I'; + case gl.RGB8UI: return 'gl.RGB8UI'; + case gl.SRGB8: return 'gl.SRGB8'; + case gl.RGB9_E5: return 'gl.RGB9_E5'; + case gl.RG32F: return 'gl.RG32F'; + case gl.RG32I: return 'gl.RG32I'; + case gl.RG32UI: return 'gl.RG32UI'; + // case gl.RG16: return 'gl.RG16'; + // case gl.RG16_SNORM: return 'gl.RG16_SNORM'; + case gl.RG16F: return 'gl.RG16F'; + case gl.RG16I: return 'gl.RG16I'; + case gl.RG16UI: return 'gl.RG16UI'; + case gl.RG8: return 'gl.RG8'; + case gl.RG8I: return 'gl.RG8I'; + case gl.RG8UI: return 'gl.RG8UI'; + case gl.RG8_SNORM: return 'gl.RG8_SNORM'; + case gl.R32F: return 'gl.R32F'; + case gl.R32I: return 'gl.R32I'; + case gl.R32UI: return 'gl.R32UI'; + // case gl.R16: return 'gl.R16'; + // case gl.R16_SNORM: return 'gl.R16_SNORM'; + case gl.R16F: return 'gl.R16F'; + case gl.R16I: return 'gl.R16I'; + case gl.R16UI: return 'gl.R16UI'; + case gl.R8: return 'gl.R8'; + case gl.R8I: return 'gl.R8I'; + case gl.R8UI: return 'gl.R8UI'; + case gl.R8_SNORM: return 'gl.R8_SNORM'; + case gl.DEPTH_COMPONENT32F: return 'gl.DEPTH_COMPONENT32F'; + case gl.DEPTH_COMPONENT24: return 'gl.DEPTH_COMPONENT24'; + case gl.DEPTH32F_STENCIL8: return 'gl.DEPTH32F_STENCIL8'; + case gl.DEPTH24_STENCIL8: return 'gl.DEPTH24_STENCIL8'; + // case gl.RGB10: return 'gl.RGB10'; + // case gl.DEPTH_COMPONENT32: return 'gl.DEPTH_COMPONENT32'; + case gl.SRGB: return 'gl.SRGB'; + // case gl.SRGB_ALPHA: return 'gl.SRGB_ALPHA'; + default: return ''; + } +}; + +gluStrUtil.getTypeName = function(value) { + switch (value) { + case gl.BYTE: return 'gl.BYTE'; + case gl.UNSIGNED_BYTE: return 'gl.UNSIGNED_BYTE'; + case gl.SHORT: return 'gl.SHORT'; + case gl.UNSIGNED_SHORT: return 'gl.UNSIGNED_SHORT'; + case gl.INT: return 'gl.INT'; + case gl.UNSIGNED_INT: return 'gl.UNSIGNED_INT'; + case gl.FLOAT: return 'gl.FLOAT'; + // case gl.FIXED: return 'gl.FIXED'; + case gl.UNSIGNED_SHORT_5_6_5: return 'gl.UNSIGNED_SHORT_5_6_5'; + case gl.UNSIGNED_SHORT_4_4_4_4: return 'gl.UNSIGNED_SHORT_4_4_4_4'; + case gl.UNSIGNED_SHORT_5_5_5_1: return 'gl.UNSIGNED_SHORT_5_5_5_1'; + case gl.HALF_FLOAT: return 'gl.HALF_FLOAT'; + case gl.INT_2_10_10_10_REV: return 'gl.INT_2_10_10_10_REV'; + case gl.UNSIGNED_INT_2_10_10_10_REV: return 'gl.UNSIGNED_INT_2_10_10_10_REV'; + case gl.UNSIGNED_INT_10F_11F_11F_REV: return 'gl.UNSIGNED_INT_10F_11F_11F_REV'; + case gl.UNSIGNED_INT_5_9_9_9_REV: return 'gl.UNSIGNED_INT_5_9_9_9_REV'; + case gl.UNSIGNED_INT_24_8: return 'gl.UNSIGNED_INT_24_8'; + case gl.FLOAT_32_UNSIGNED_INT_24_8_REV: return 'gl.FLOAT_32_UNSIGNED_INT_24_8_REV'; + case gl.SIGNED_NORMALIZED: return 'gl.SIGNED_NORMALIZED'; + case gl.UNSIGNED_NORMALIZED: return 'gl.UNSIGNED_NORMALIZED'; + // case gl.HALF_FLOAT_OES: return 'gl.HALF_FLOAT_OES'; + default: return ''; + } +}; + +gluStrUtil.getErrorName = function(value) { + switch (value) { + case gl.NO_ERROR: return 'gl.NO_ERROR'; + case gl.INVALID_ENUM: return 'gl.INVALID_ENUM'; + case gl.INVALID_VALUE: return 'gl.INVALID_VALUE'; + case gl.INVALID_OPERATION: return 'gl.INVALID_OPERATION'; + case gl.OUT_OF_MEMORY: return 'gl.OUT_OF_MEMORY'; + // case gl.INVALID_FRAMEBUFFER_OPERATION: return 'gl.INVALID_FRAMEBUFFER_OPERATION'; + default: return ''; + } +}; + +gluStrUtil.getFramebufferStatusName = function(value) { + switch (value) { + case gl.FRAMEBUFFER_COMPLETE: return 'gl.FRAMEBUFFER_COMPLETE'; + case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: return 'gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT'; + case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: return 'gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT'; + case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: return 'gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS'; + case gl.FRAMEBUFFER_UNSUPPORTED: return 'gl.FRAMEBUFFER_UNSUPPORTED'; + case gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: return 'gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE'; + // case: gl.FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS: return 'gl.FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS'; + default: return ''; + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js new file mode 100644 index 000000000..fcc33588e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js @@ -0,0 +1,380 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluTexture'); +goog.require('framework.common.tcuCompressedTexture'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + +var gluTexture = framework.opengl.gluTexture; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var tcuCompressedTexture = framework.common.tcuCompressedTexture; +var deMath = framework.delibs.debase.deMath; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +/** @enum {number} */ +gluTexture.Type = { + TYPE_NONE: 0, + TYPE_2D: 1, + TYPE_CUBE_MAP: 2, + TYPE_2D_ARRAY: 3, + TYPE_3D: 4 +}; + +/** + * @constructor + */ +gluTexture.Texture2D = function(gl, format, isCompressed, refTexture) { + this.gl = gl; + this.m_glTexture = gl.createTexture(); + this.m_isCompressed = isCompressed; + this.m_format = format; // Internal format + this.m_refTexture = refTexture; + this.m_type = gluTexture.Type.TYPE_2D; +}; + +gluTexture.Texture2D.prototype.getType = function() { + return this.m_type; +}; + +gluTexture.Texture2D.prototype.getRefTexture = function() { + return this.m_refTexture; +}; + +gluTexture.Texture2D.prototype.getGLTexture = function() { + return this.m_glTexture; +}; + +gluTexture.texture2DFromFormat = function(gl, format, dataType, width, height) { + var tex = new gluTexture.Texture2D(gl, format, false, new tcuTexture.Texture2D(gluTextureUtil.mapGLTransferFormat(format, dataType), width, height)); + return tex; +}; + +gluTexture.texture2DFromInternalFormat = function(gl, internalFormat, width, height) { + var tex = new gluTexture.Texture2D(gl, internalFormat, false, new tcuTexture.Texture2D(gluTextureUtil.mapGLInternalFormat(internalFormat), width, height)); + return tex; +}; + +/** + * @param {number} numLevels + * @param {Array} levels + * @return {gluTexture.Texture2D} + */ +gluTexture.texture2DFromCompressedTexture = function(gl, numLevels, levels) { + var level = levels[0]; + var format = gluTextureUtil.getGLFormat(level.getFormat()); + var refTex = new tcuTexture.Texture2D(level.getUncompressedFormat(), level.getWidth(), level.getHeight()); + /** @type {gluTexture.Texture2D} */ var tex2d = new gluTexture.Texture2D(gl, format, true, refTex); + + tex2d.loadCompressed(numLevels, levels); + + return tex2d; +}; +/** + * @param {number} numLevels + * @param {Array} levels + */ +gluTexture.Texture2D.prototype.loadCompressed = function(numLevels, levels) { + /** @type {number} */ var compressedFormat = gluTextureUtil.getGLFormat(levels[0].getFormat()); + + assertMsgOptions(this.m_glTexture, 'm_glTexture not defined', false, true); + gl.bindTexture(gl.TEXTURE_2D, this.m_glTexture); + + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + /** @type {tcuCompressedTexture.CompressedTexture} */ var level = levels[levelNdx]; + + // Decompress to reference texture. + this.m_refTexture.allocLevel(levelNdx); + /** @type {tcuTexture.PixelBufferAccess} */ var refLevelAccess = this.m_refTexture.getLevel(levelNdx); + assertMsgOptions(level.getWidth() == refLevelAccess.getWidth() && level.getHeight() == refLevelAccess.getHeight(), 'level and reference sizes not equal', false, true); + level.decompress(refLevelAccess); + + // Upload to GL texture in compressed form. + gl.compressedTexImage2D(gl.TEXTURE_2D, levelNdx, compressedFormat, + level.getWidth(), level.getHeight(), 0, level.getData()); + } +}; + +gluTexture.computePixelStore = function(/*const tcu::TextureFormat&*/ format) { + var pixelSize = format.getPixelSize(); + if (deMath.deIsPowerOfTwo32(pixelSize)) + return Math.min(pixelSize, 8); + else + return 1; +}; + +gluTexture.cubeFaceToGLFace = function(/*tcu::CubeFace*/ face) { + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: return gl.TEXTURE_CUBE_MAP_NEGATIVE_X; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: return gl.TEXTURE_CUBE_MAP_POSITIVE_X; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: return gl.TEXTURE_CUBE_MAP_NEGATIVE_Y; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: return gl.TEXTURE_CUBE_MAP_POSITIVE_Y; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: return gl.TEXTURE_CUBE_MAP_NEGATIVE_Z; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: return gl.TEXTURE_CUBE_MAP_POSITIVE_Z; + } + throw new Error('Unrecognized face: ' + face); +}; + +gluTexture.Texture2D.prototype.upload = function() { + DE_ASSERT(!this.m_isCompressed); + + if (this.m_glTexture == null) + testFailedOptions('Failed to create GL texture', true); + + gl.bindTexture(gl.TEXTURE_2D, this.m_glTexture); + gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat())); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Setting pixel store failed', false, true); + + var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat()); + + for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) { + if (this.m_refTexture.isLevelEmpty(levelNdx)) + continue; // Don't upload. + + var access = this.m_refTexture.getLevel(levelNdx); + DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth()); + var data = access.getDataPtr(); + gl.texImage2D(gl.TEXTURE_2D, levelNdx, this.m_format, access.getWidth(), access.getHeight(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr()); + } + + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); +}; + +/** + * @constructor + * @extends {gluTexture.Texture2D} + */ +gluTexture.TextureCube = function(gl, format, isCompressed, refTexture) { + gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture); + this.m_type = gluTexture.Type.TYPE_CUBE_MAP; +}; + +gluTexture.TextureCube.prototype = Object.create(gluTexture.Texture2D.prototype); +gluTexture.TextureCube.prototype.constructor = gluTexture.TextureCube; + +gluTexture.TextureCube.prototype.upload = function() { + DE_ASSERT(!this.m_isCompressed); + + if (this.m_glTexture == null) + testFailedOptions('Failed to create GL texture', true); + + gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_glTexture); + gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat())); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Setting pixel store failed', false, true); + + var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat()); + + for (var face in tcuTexture.CubeFace) { + for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) { + if (this.m_refTexture.isLevelEmpty(tcuTexture.CubeFace[face], levelNdx)) + continue; // Don't upload. + + /*tcu::ConstPixelBufferAccess*/ var access = this.m_refTexture.getLevelFace(levelNdx, tcuTexture.CubeFace[face]); + DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth()); + gl.texImage2D(gluTexture.cubeFaceToGLFace(tcuTexture.CubeFace[face]), levelNdx, this.m_format, access.getWidth(), access.getHeight(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr()); + } + } + + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); +}; + +gluTexture.cubeFromFormat = function(gl, format, dataType, size) { + var tex = new gluTexture.TextureCube(gl, format, false, new tcuTexture.TextureCube(gluTextureUtil.mapGLTransferFormat(format, dataType), size)); + return tex; +}; + +gluTexture.cubeFromInternalFormat = function(gl, internalFormat, size) { + var tex = new gluTexture.TextureCube(gl, internalFormat, false, new tcuTexture.TextureCube(gluTextureUtil.mapGLInternalFormat(internalFormat), size)); + return tex; +}; + +/** + * @constructor + * @extends {gluTexture.Texture2D} + */ +gluTexture.Texture2DArray = function(gl, format, isCompressed, refTexture) { + gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture); + this.m_type = gluTexture.Type.TYPE_2D_ARRAY; +}; + +gluTexture.Texture2DArray.prototype = Object.create(gluTexture.Texture2D.prototype); +gluTexture.Texture2DArray.prototype.constructor = gluTexture.Texture2DArray; + +gluTexture.Texture2DArray.prototype.upload = function() { + if (!gl.texImage3D) + throw new Error('gl.TexImage3D() is not supported'); + + gl.bindTexture(gl.TEXTURE_2D_ARRAY, this.m_glTexture); + gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat())); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); + + var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat()); + + for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) { + if (this.m_refTexture.isLevelEmpty(levelNdx)) + continue; // Don't upload. + + /*tcu::ConstPixelBufferAccess*/ var access = this.m_refTexture.getLevel(levelNdx); + DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth()); + DE_ASSERT(access.getSlicePitch() == access.getFormat().getPixelSize() * access.getWidth() * access.getHeight()); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, levelNdx, this.m_format, access.getWidth(), access.getHeight(), access.getDepth(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr()); + } + + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); +}; + +gluTexture.texture2DArrayFromFormat = function(gl, format, dataType, width, height, numLayers) { + var tex = new gluTexture.Texture2DArray(gl, format, false, new tcuTexture.Texture2DArray(gluTextureUtil.mapGLTransferFormat(format, dataType), width, height, numLayers)); + return tex; +}; + +gluTexture.texture2DArrayFromInternalFormat = function(gl, internalFormat, width, height, numLayers) { + var tex = new gluTexture.Texture2DArray(gl, internalFormat, false, new tcuTexture.Texture2DArray(gluTextureUtil.mapGLInternalFormat(internalFormat), width, height, numLayers)); + return tex; +}; + +/** + * @constructor + * @extends {gluTexture.Texture2D} + */ +gluTexture.Texture3D = function(gl, format, isCompressed, refTexture) { + gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture); + this.m_type = gluTexture.Type.TYPE_3D; +}; + +gluTexture.Texture3D.prototype = Object.create(gluTexture.Texture2D.prototype); +gluTexture.Texture3D.prototype.constructor = gluTexture.Texture3D; + +gluTexture.Texture3D.prototype.upload = function() { + if (!gl.texImage3D) + throw new Error('gl.TexImage3D() is not supported'); + + gl.bindTexture(gl.TEXTURE_3D, this.m_glTexture); + gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat())); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); + + var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat()); + + for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) { + if (this.m_refTexture.isLevelEmpty(levelNdx)) + continue; // Don't upload. + + /*tcu::ConstPixelBufferAccess*/ var access = this.m_refTexture.getLevel(levelNdx); + DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth()); + DE_ASSERT(access.getSlicePitch() == access.getFormat().getPixelSize() * access.getWidth() * access.getHeight()); + gl.texImage3D(gl.TEXTURE_3D, levelNdx, this.m_format, access.getWidth(), access.getHeight(), access.getDepth(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr()); + } + + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); +}; + +gluTexture.texture3DFromFormat = function(gl, format, dataType, width, height, depth) { + var tex = new gluTexture.Texture3D(gl, format, false, new tcuTexture.Texture3D(gluTextureUtil.mapGLTransferFormat(format, dataType), width, height, depth)); + return tex; +}; + +gluTexture.texture3DFromInternalFormat = function(gl, internalFormat, width, height, depth) { + var tex = new gluTexture.Texture3D(gl, internalFormat, false, new tcuTexture.Texture3D(gluTextureUtil.mapGLInternalFormat(internalFormat), width, height, depth)); + return tex; +}; + +/** + * @constructor + * @extends {gluTexture.Texture2D} + */ +gluTexture.Compressed2D = function(gl, format, isCompressed, refTexture) { + gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture); +}; + +gluTexture.Compressed2D.prototype = Object.create(gluTexture.Texture2D.prototype); +gluTexture.Compressed2D.prototype.constructor = gluTexture.Compressed2D; + +gluTexture.Compressed2D.prototype.uploadLevel = function(level, source) { + DE_ASSERT(this.m_isCompressed); + + if (this.m_glTexture == null) + testFailedOptions('Failed to create GL texture', true); + + gl.bindTexture(gl.TEXTURE_2D, this.m_glTexture); + + gl.compressedTexImage2D(gl.TEXTURE_2D, level, this.m_format, source.m_width, source.m_height, 0 /* border */, source.m_data); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); +}; + +/** + * @constructor + * @extends {gluTexture.Texture2D} + */ +gluTexture.CompressedCube = function(gl, format, isCompressed, refTexture) { + gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture); +}; + +gluTexture.CompressedCube.prototype = Object.create(gluTexture.Texture2D.prototype); +gluTexture.CompressedCube.prototype.constructor = gluTexture.CompressedCube; + +gluTexture.CompressedCube.prototype.uploadLevel = function(level, source) { + DE_ASSERT(this.m_isCompressed); + + if (this.m_glTexture == null) + testFailedOptions('Failed to create GL texture', true); + + gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_glTexture); + + for (var face in tcuTexture.CubeFace) { + + // Upload to GL texture in compressed form. + gl.compressedTexImage2D(gluTexture.cubeFaceToGLFace(tcuTexture.CubeFace[face]), 0, this.m_format, + source.m_width, source.m_height, 0 /* border */, source.m_data); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true); + } + +}; + +gluTexture.compressed2DFromInternalFormat = function(gl, format, width, height, compressed) { + var tex = new gluTexture.Compressed2D(gl, gluTextureUtil.getGLFormat(format), true, new tcuTexture.Texture2D(compressed.getUncompressedFormat(), width, height)); + tex.m_refTexture.allocLevel(0); + compressed.decompress(tex.m_refTexture.getLevel(0)); + tex.uploadLevel(0, compressed); + return tex; +}; + +gluTexture.compressedCubeFromInternalFormat = function(gl, format, size, compressed) { + var tex = new gluTexture.CompressedCube(gl, gluTextureUtil.getGLFormat(format), true, new tcuTexture.TextureCube(compressed.getUncompressedFormat(), size)); + for (var face in tcuTexture.CubeFace) { + tex.m_refTexture.allocLevel(tcuTexture.CubeFace[face], 0); + + /*tcu::ConstPixelBufferAccess*/ var access = tex.m_refTexture.getLevelFace(0, tcuTexture.CubeFace[face]); + DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth()); + compressed.decompress(access); + } + tex.uploadLevel(0, compressed); + return tex; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js new file mode 100644 index 000000000..06f3f5289 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js @@ -0,0 +1,1025 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/*--------------------------------------------------------------------*//*! + * \brief Map tcuTexture.TextureFormat to GL pixel transfer format. + * + * Maps generic texture format description to GL pixel transfer format. + * If no mapping is found, throws tcu::InternalError. + * + * \param texFormat Generic texture format. + * \return GL pixel transfer format. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('framework.opengl.gluTextureUtil'); +goog.require('framework.common.tcuCompressedTexture'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { + +var gluTextureUtil = framework.opengl.gluTextureUtil; +var deString = framework.delibs.debase.deString; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuCompressedTexture = framework.common.tcuCompressedTexture; +var gluShaderUtil = framework.opengl.gluShaderUtil; + +/** + * @param {number} format + * @param {number} dataType + * @constructor + */ +gluTextureUtil.TransferFormat = function(format, dataType) { + this.format = format; //!< Pixel format. + this.dataType = dataType; //!< Data type. +}; + +/** + * Map tcuTexture.TextureFormat to GL pixel transfer format. + * + * Maps generic texture format description to GL pixel transfer format. + * If no mapping is found, throws tcu::InternalError. + * + * @param {tcuTexture.TextureFormat} texFormat Generic texture format. + * @return {gluTextureUtil.TransferFormat} GL pixel transfer format. + * @throws {Error} + */ +gluTextureUtil.getTransferFormat = function(/* tcuTexture.TextureFormat */ texFormat) { + var format = gl.NONE; + var type = gl.NONE; + /*boolean*/ var isInt = false; + + switch (texFormat.type) { + case tcuTexture.ChannelType.SIGNED_INT8: + case tcuTexture.ChannelType.SIGNED_INT16: + case tcuTexture.ChannelType.SIGNED_INT32: + case tcuTexture.ChannelType.UNSIGNED_INT8: + case tcuTexture.ChannelType.UNSIGNED_INT16: + case tcuTexture.ChannelType.UNSIGNED_INT32: + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: + isInt = true; + break; + + default: + isInt = false; + break; + } + + switch (texFormat.order) { + case tcuTexture.ChannelOrder.A: format = gl.ALPHA; break; + case tcuTexture.ChannelOrder.L: format = gl.LUMINANCE; break; + case tcuTexture.ChannelOrder.LA: format = gl.LUMINANCE_ALPHA; break; + case tcuTexture.ChannelOrder.R: format = isInt ? gl.RED_INTEGER : gl.RED; break; + case tcuTexture.ChannelOrder.RG: format = isInt ? gl.RG_INTEGER : gl.RG; break; + case tcuTexture.ChannelOrder.RGB: format = isInt ? gl.RGB_INTEGER : gl.RGB; break; + case tcuTexture.ChannelOrder.RGBA: format = isInt ? gl.RGBA_INTEGER : gl.RGBA; break; + case tcuTexture.ChannelOrder.sRGB: format = gl.RGB; break; + case tcuTexture.ChannelOrder.sRGBA: format = gl.RGBA; break; + case tcuTexture.ChannelOrder.D: format = gl.DEPTH_COMPONENT; break; + case tcuTexture.ChannelOrder.DS: format = gl.DEPTH_STENCIL; break; + case tcuTexture.ChannelOrder.S: format = gl.STENCIL_INDEX; break; + + default: + throw new Error('Unknown ChannelOrder ' + texFormat.order); + } + + switch (texFormat.type) { + case tcuTexture.ChannelType.SNORM_INT8: type = gl.BYTE; break; + case tcuTexture.ChannelType.SNORM_INT16: type = gl.SHORT; break; + case tcuTexture.ChannelType.UNORM_INT8: type = gl.UNSIGNED_BYTE; break; + case tcuTexture.ChannelType.UNORM_INT16: type = gl.UNSIGNED_SHORT; break; + case tcuTexture.ChannelType.UNORM_SHORT_565: type = gl.UNSIGNED_SHORT_5_6_5; break; + case tcuTexture.ChannelType.UNORM_SHORT_4444: type = gl.UNSIGNED_SHORT_4_4_4_4; break; + case tcuTexture.ChannelType.UNORM_SHORT_5551: type = gl.UNSIGNED_SHORT_5_5_5_1; break; + case tcuTexture.ChannelType.SIGNED_INT8: type = gl.BYTE; break; + case tcuTexture.ChannelType.SIGNED_INT16: type = gl.SHORT; break; + case tcuTexture.ChannelType.SIGNED_INT32: type = gl.INT; break; + case tcuTexture.ChannelType.UNSIGNED_INT8: type = gl.UNSIGNED_BYTE; break; + case tcuTexture.ChannelType.UNSIGNED_INT16: type = gl.UNSIGNED_SHORT; break; + case tcuTexture.ChannelType.UNSIGNED_INT32: type = gl.UNSIGNED_INT; break; + case tcuTexture.ChannelType.FLOAT: type = gl.FLOAT; break; + case tcuTexture.ChannelType.UNORM_INT_101010: type = gl.UNSIGNED_INT_2_10_10_10_REV; break; + case tcuTexture.ChannelType.UNORM_INT_1010102_REV: type = gl.UNSIGNED_INT_2_10_10_10_REV; break; + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: type = gl.UNSIGNED_INT_2_10_10_10_REV; break; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: type = gl.UNSIGNED_INT_10F_11F_11F_REV; break; + case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: type = gl.UNSIGNED_INT_5_9_9_9_REV; break; + case tcuTexture.ChannelType.HALF_FLOAT: type = gl.HALF_FLOAT; break; + case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; break; + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: type = texFormat.order == tcuTexture.ChannelOrder.D ? + gl.UNSIGNED_INT : gl.UNSIGNED_INT_24_8; break; + + default: + throw new Error("Can't map texture format to GL transfer format " + texFormat.type); + } + + return new gluTextureUtil.TransferFormat(format, type); +}; + +/** + * Map tcuTexture.TextureFormat to GL internal sized format. + * + * Maps generic texture format description to GL internal format. + * If no mapping is found, throws Error. + * + * @param {tcuTexture.TextureFormat} texFormat Generic texture format. + * @return {number} GL texture format. + * @throws {Error} + */ +gluTextureUtil.getInternalFormat = function(texFormat) { + + var stringify = function(order, type) { + return '' + order + ' ' + type; + }; + + switch (stringify(texFormat.order, texFormat.type)) { + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551): return gl.RGB5_A1; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_4444): return gl.RGBA4; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_SHORT_565): return gl.RGB565; + case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT16): return gl.DEPTH_COMPONENT16; + case stringify(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.STENCIL_INDEX8; + + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT): return gl.RGBA32F; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT32): return gl.RGBA32I; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.RGBA32UI; + // TODO: Check which ones are valid in WebGL 2 - case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT16): return gl.RGBA16; + //case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT16): return gl.RGBA16_SNORM; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.HALF_FLOAT): return gl.RGBA16F; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT16): return gl.RGBA16I; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.RGBA16UI; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8): return gl.RGBA8; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT8): return gl.RGBA8I; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.RGBA8UI; + case stringify(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8): return gl.SRGB8_ALPHA8; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT_1010102_REV): return gl.RGB10_A2; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV): return gl.RGB10_A2UI; + case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT8): return gl.RGBA8_SNORM; + + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8): return gl.RGB8; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV): return gl.R11F_G11F_B10F; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.FLOAT): return gl.RGB32F; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT32): return gl.RGB32I; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.RGB32UI; + //case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT16): return gl.RGB16; + //case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT16): return gl.RGB16_SNORM; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.HALF_FLOAT): return gl.RGB16F; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT16): return gl.RGB16I; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.RGB16UI; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT8): return gl.RGB8_SNORM; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT8): return gl.RGB8I; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.RGB8UI; + case stringify(tcuTexture.ChannelOrder.sRGB, tcuTexture.ChannelType.UNORM_INT8): return gl.SRGB8; + case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV): return gl.RGB9_E5; + //case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT_1010102_REV): return gl.RGB10; + + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.FLOAT): return gl.RG32F; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT32): return gl.RG32I; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.RG32UI; + //case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT16): return gl.RG16; + //case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT16): return gl.RG16_SNORM; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.HALF_FLOAT): return gl.RG16F; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT16): return gl.RG16I; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.RG16UI; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT8): return gl.RG8; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT8): return gl.RG8I; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.RG8UI; + case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT8): return gl.RG8_SNORM; + + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.FLOAT): return gl.R32F; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT32): return gl.R32I; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.R32UI; + //case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT16): return gl.R16; + //case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT16): return gl.R16_SNORM; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.HALF_FLOAT): return gl.R16F; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT16): return gl.R16I; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.R16UI; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT8): return gl.R8; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT8): return gl.R8I; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.R8UI; + case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT8): return gl.R8_SNORM; + + case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.FLOAT): return gl.DEPTH_COMPONENT32F; + case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT_24_8): return gl.DEPTH_COMPONENT24; + //case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.DEPTH_COMPONENT32; + case stringify(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV): return gl.DEPTH32F_STENCIL8; + case stringify(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.UNSIGNED_INT_24_8): return gl.DEPTH24_STENCIL8; + + default: + throw new Error("Can't map texture format to GL internal format"); + } +}; + +/** + * Enable WEBGL_compressed_texture_etc support if available, by merging it + * into the WebGL2RenderingContext. + * + * This function may be called many times. + * + * @return {boolean} True if enabled. + */ +gluTextureUtil.enableCompressedTextureETC = (function() { + var enabled = undefined; + return function() { + if (enabled === undefined) { + enabled = false; + + var WEBGL_compressed_texture_etc = gl.getExtension("WEBGL_compressed_texture_etc"); + if (WEBGL_compressed_texture_etc) { + // Extend gl with enums from WEBGL_compressed_texture_etc + // (if it doesn't already have the etc texture formats). + var proto = Object.getPrototypeOf(WEBGL_compressed_texture_etc); + for (var prop in proto) { + if (proto.hasOwnProperty(prop)) { + gl[prop] = proto[prop]; + } + } + enabled = true; + } + } + return enabled; + }; +})(); + +/** + * Map generic compressed format to GL compressed format enum. + * + * Maps generic compressed format to GL compressed format enum value. + * If no mapping is found, throws Error. + + * @param {tcuCompressedTexture.Format} format Generic compressed format. + * @return {number} GL compressed texture format. + * @throws {Error} + */ +gluTextureUtil.getGLFormat = function(/* tcuCompressedTexture.Format */ format) { + switch (format) { + // TODO: check which are available in WebGL 2 - case tcuCompressedTexture.Format.ETC1_RGB8: return gl.ETC1_RGB8_OES; + case tcuCompressedTexture.Format.EAC_R11: return gl.COMPRESSED_R11_EAC; + case tcuCompressedTexture.Format.EAC_SIGNED_R11: return gl.COMPRESSED_SIGNED_R11_EAC; + case tcuCompressedTexture.Format.EAC_RG11: return gl.COMPRESSED_RG11_EAC; + case tcuCompressedTexture.Format.EAC_SIGNED_RG11: return gl.COMPRESSED_SIGNED_RG11_EAC; + case tcuCompressedTexture.Format.ETC2_RGB8: return gl.COMPRESSED_RGB8_ETC2; + case tcuCompressedTexture.Format.ETC2_SRGB8: return gl.COMPRESSED_SRGB8_ETC2; + case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: return gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: return gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2; + case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: return gl.COMPRESSED_RGBA8_ETC2_EAC; + case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + + /*case tcuCompressedTexture.Format.ASTC_4x4_RGBA: return gl.COMPRESSED_RGBA_ASTC_4x4_KHR; + case tcuCompressedTexture.Format.ASTC_5x4_RGBA: return gl.COMPRESSED_RGBA_ASTC_5x4_KHR; + case tcuCompressedTexture.Format.ASTC_5x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_5x5_KHR; + case tcuCompressedTexture.Format.ASTC_6x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_6x5_KHR; + case tcuCompressedTexture.Format.ASTC_6x6_RGBA: return gl.COMPRESSED_RGBA_ASTC_6x6_KHR; + case tcuCompressedTexture.Format.ASTC_8x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_8x5_KHR; + case tcuCompressedTexture.Format.ASTC_8x6_RGBA: return gl.COMPRESSED_RGBA_ASTC_8x6_KHR; + case tcuCompressedTexture.Format.ASTC_8x8_RGBA: return gl.COMPRESSED_RGBA_ASTC_8x8_KHR; + case tcuCompressedTexture.Format.ASTC_10x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x5_KHR; + case tcuCompressedTexture.Format.ASTC_10x6_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x6_KHR; + case tcuCompressedTexture.Format.ASTC_10x8_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x8_KHR; + case tcuCompressedTexture.Format.ASTC_10x10_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x10_KHR; + case tcuCompressedTexture.Format.ASTC_12x10_RGBA: return gl.COMPRESSED_RGBA_ASTC_12x10_KHR; + case tcuCompressedTexture.Format.ASTC_12x12_RGBA: return gl.COMPRESSED_RGBA_ASTC_12x12_KHR; + case tcuCompressedTexture.Format.ASTC_4x4_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; + case tcuCompressedTexture.Format.ASTC_5x4_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR; + case tcuCompressedTexture.Format.ASTC_5x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR; + case tcuCompressedTexture.Format.ASTC_6x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR; + case tcuCompressedTexture.Format.ASTC_6x6_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR; + case tcuCompressedTexture.Format.ASTC_8x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR; + case tcuCompressedTexture.Format.ASTC_8x6_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR; + case tcuCompressedTexture.Format.ASTC_8x8_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR; + case tcuCompressedTexture.Format.ASTC_10x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR; + case tcuCompressedTexture.Format.ASTC_10x6_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR; + case tcuCompressedTexture.Format.ASTC_10x8_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR; + case tcuCompressedTexture.Format.ASTC_10x10_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR; + case tcuCompressedTexture.Format.ASTC_12x10_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR; + case tcuCompressedTexture.Format.ASTC_12x12_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;*/ + + default: + throw new Error("Can't map compressed format to GL format"); + } +}; + +/** + * @param {number} dataType + * @param {boolean} normalized + * @return {tcuTexture.ChannelType} + * @throws {Error} + */ +gluTextureUtil.mapGLChannelType = function(/* deMath.deUint32 */ dataType, /*boolean*/ normalized) { + // \note Normalized bit is ignored where it doesn't apply. + + switch (dataType) { + case gl.UNSIGNED_BYTE: return normalized ? tcuTexture.ChannelType.UNORM_INT8 : tcuTexture.ChannelType.UNSIGNED_INT8; + case gl.BYTE: return normalized ? tcuTexture.ChannelType.SNORM_INT8 : tcuTexture.ChannelType.SIGNED_INT8; + case gl.UNSIGNED_SHORT: return normalized ? tcuTexture.ChannelType.UNORM_INT16 : tcuTexture.ChannelType.UNSIGNED_INT16; + case gl.SHORT: return normalized ? tcuTexture.ChannelType.SNORM_INT16 : tcuTexture.ChannelType.SIGNED_INT16; + case gl.UNSIGNED_INT: return normalized ? tcuTexture.ChannelType.UNORM_INT32 : tcuTexture.ChannelType.UNSIGNED_INT32; + case gl.INT: return normalized ? tcuTexture.ChannelType.SNORM_INT32 : tcuTexture.ChannelType.SIGNED_INT32; + case gl.FLOAT: return tcuTexture.ChannelType.FLOAT; + case gl.UNSIGNED_SHORT_4_4_4_4: return tcuTexture.ChannelType.UNORM_SHORT_4444; + case gl.UNSIGNED_SHORT_5_5_5_1: return tcuTexture.ChannelType.UNORM_SHORT_5551; + case gl.UNSIGNED_SHORT_5_6_5: return tcuTexture.ChannelType.UNORM_SHORT_565; + case gl.HALF_FLOAT: return tcuTexture.ChannelType.HALF_FLOAT; + case gl.UNSIGNED_INT_2_10_10_10_REV: return normalized ? tcuTexture.ChannelType.UNORM_INT_1010102_REV : tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV; + case gl.UNSIGNED_INT_10F_11F_11F_REV: return tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV; + case gl.UNSIGNED_INT_24_8: return tcuTexture.ChannelType.UNSIGNED_INT_24_8; + case gl.FLOAT_32_UNSIGNED_INT_24_8_REV: return tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV; + case gl.UNSIGNED_INT_5_9_9_9_REV: return tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV; + + default: + throw new Error('Unsupported dataType ' + dataType); + } +}; + +/** + * @param {number} format Generic compressed format. + * @param {number} dataType + * @return {tcuTexture.TextureFormat} GL texture format. + * @throws {Error} + */ +gluTextureUtil.mapGLTransferFormat = function(format, dataType) { + switch (format) { + case gl.ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.A, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.LUMINANCE: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.L, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.LUMINANCE_ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.LA, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.RGB: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.RGBA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, gluTextureUtil.mapGLChannelType(dataType, true)); + //case gl.BGRA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.BGRA, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.RG: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.RED: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.RGBA_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, gluTextureUtil.mapGLChannelType(dataType, false)); + case gl.RGB_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, gluTextureUtil.mapGLChannelType(dataType, false)); + case gl.RG_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, gluTextureUtil.mapGLChannelType(dataType, false)); + case gl.RED_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, gluTextureUtil.mapGLChannelType(dataType, false)); + + case gl.DEPTH_COMPONENT: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, gluTextureUtil.mapGLChannelType(dataType, true)); + case gl.DEPTH_STENCIL: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.DS, gluTextureUtil.mapGLChannelType(dataType, true)); + + default: + throw new Error("Can't map GL pixel format (" + deString.enumToString(gl, format) + ', ' + deString.enumToString(gl, dataType) + ') to texture format'); + } +}; + + /** + * Map GL internal texture format to tcuTexture.TextureFormat. + * + * If no mapping is found, throws Error. + * @param {number} internalFormat + * @return {tcuTexture.TextureFormat} GL texture format. + * @throws {Error} + */ +gluTextureUtil.mapGLInternalFormat = function(/*deMath.deUint32*/ internalFormat) { + if (internalFormat === undefined) + throw new Error('internalformat is undefined'); + + switch (internalFormat) { + case gl.RGB5_A1: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551); + case gl.RGBA4: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_4444); + case gl.RGB565: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_SHORT_565); + case gl.DEPTH_COMPONENT16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT16); + case gl.STENCIL_INDEX8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT8); + + case gl.RGBA32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT); + case gl.RGBA32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT32); + case gl.RGBA32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32); + //TODO: Check which are available in WebGL 2 case gl.RGBA16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT16); + //case gl.RGBA16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT16); + case gl.RGBA16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.HALF_FLOAT); + case gl.RGBA16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT16); + case gl.RGBA16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT16); + case gl.RGBA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + case gl.RGBA8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT8); + case gl.RGBA8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT8); + case gl.SRGB8_ALPHA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8); + case gl.RGB10_A2: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT_1010102_REV); + case gl.RGB10_A2UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV); + case gl.RGBA8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT8); + + case gl.RGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8); + case gl.R11F_G11F_B10F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV); + case gl.RGB32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.FLOAT); + case gl.RGB32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT32); + case gl.RGB32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT32); + //case gl.RGB16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT16); + //case gl.RGB16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT16); + case gl.RGB16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.HALF_FLOAT); + case gl.RGB16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT16); + case gl.RGB16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT16); + case gl.RGB8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT8); + case gl.RGB8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT8); + case gl.RGB8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT8); + case gl.SRGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGB, tcuTexture.ChannelType.UNORM_INT8); + case gl.RGB9_E5: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV); + //case gl.RGB10: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT_1010102_REV); + + case gl.RG32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.FLOAT); + case gl.RG32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT32); + case gl.RG32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT32); + //case gl.RG16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT16); + //case gl.RG16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT16); + case gl.RG16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.HALF_FLOAT); + case gl.RG16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT16); + case gl.RG16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT16); + case gl.RG8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT8); + case gl.RG8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT8); + case gl.RG8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT8); + case gl.RG8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT8); + + case gl.R32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.FLOAT); + case gl.R32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT32); + case gl.R32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT32); + //case gl.R16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT16); + //case gl.R16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT16); + case gl.R16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.HALF_FLOAT); + case gl.R16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT16); + case gl.R16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT16); + case gl.R8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT8); + case gl.R8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT8); + case gl.R8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT8); + case gl.R8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT8); + + case gl.DEPTH_COMPONENT32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.FLOAT); + case gl.DEPTH_COMPONENT24: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT_24_8); + //case gl.DEPTH_COMPONENT32: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT32); + case gl.DEPTH32F_STENCIL8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV); + case gl.DEPTH24_STENCIL8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.UNSIGNED_INT_24_8); + + default: + throw new Error("Can't map GL sized internal format (" + internalFormat.toString(16) + ') to texture format'); + } +}; + +/** + * @param {number} format + * @return {boolean} + */ +gluTextureUtil.isGLInternalColorFormatFilterable = function(format) { + switch (format) { + case gl.R8: + case gl.R8_SNORM: + case gl.RG8: + case gl.RG8_SNORM: + case gl.RGB8: + case gl.RGB8_SNORM: + case gl.RGB565: + case gl.RGBA4: + case gl.RGB5_A1: + case gl.RGBA8: + case gl.RGBA8_SNORM: + case gl.RGB10_A2: + case gl.SRGB8: + case gl.SRGB8_ALPHA8: + case gl.R16F: + case gl.RG16F: + case gl.RGB16F: + case gl.RGBA16F: + case gl.R11F_G11F_B10F: + case gl.RGB9_E5: + return true; + + case gl.RGB10_A2UI: + case gl.R32F: + case gl.RG32F: + case gl.RGB32F: + case gl.RGBA32F: + case gl.R8I: + case gl.R8UI: + case gl.R16I: + case gl.R16UI: + case gl.R32I: + case gl.R32UI: + case gl.RG8I: + case gl.RG8UI: + case gl.RG16I: + case gl.RG16UI: + case gl.RG32I: + case gl.RG32UI: + case gl.RGB8I: + case gl.RGB8UI: + case gl.RGB16I: + case gl.RGB16UI: + case gl.RGB32I: + case gl.RGB32UI: + case gl.RGBA8I: + case gl.RGBA8UI: + case gl.RGBA16I: + case gl.RGBA16UI: + case gl.RGBA32I: + case gl.RGBA32UI: + return false; + + default: + throw new Error('Unrecognized format ' + format); + } +}; + +/** + * @param {number} wrapMode + * @return {tcuTexture.WrapMode} + */ +gluTextureUtil.mapGLWrapMode = function(wrapMode) { + switch (wrapMode) { + case gl.CLAMP_TO_EDGE: return tcuTexture.WrapMode.CLAMP_TO_EDGE; + case gl.REPEAT: return tcuTexture.WrapMode.REPEAT_GL; + case gl.MIRRORED_REPEAT: return tcuTexture.WrapMode.MIRRORED_REPEAT_GL; + default: + throw new Error("Can't map GL wrap mode " + deString.enumToString(gl, wrapMode)); + } +}; + +/** + * @param {number} filterMode + * @return {tcuTexture.FilterMode} + * @throws {Error} + */ +gluTextureUtil.mapGLFilterMode = function(filterMode) { + switch (filterMode) { + case gl.NEAREST: return tcuTexture.FilterMode.NEAREST; + case gl.LINEAR: return tcuTexture.FilterMode.LINEAR; + case gl.NEAREST_MIPMAP_NEAREST: return tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST; + case gl.NEAREST_MIPMAP_LINEAR: return tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR; + case gl.LINEAR_MIPMAP_NEAREST: return tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST; + case gl.LINEAR_MIPMAP_LINEAR: return tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR; + default: + throw new Error("Can't map GL filter mode" + filterMode); + } +}; + +/* TODO: Port the code below */ +// /*--------------------------------------------------------------------*//*! +// * \brief Map GL sampler parameters to tcu::Sampler. +// * +// * If no mapping is found, throws tcu::InternalError. +// * +// * \param wrapS S-component wrap mode +// * \param minFilter Minification filter mode +// * \param magFilter Magnification filter mode +// * \return Sampler description. +// *//*--------------------------------------------------------------------*/ +// /*tcu::Sampler mapGLSamplerWrapS (deUint32 wrapS, deUint32 minFilter, deUint32 magFilter) +// { +// return mapGLSampler(wrapS, wrapS, wrapS, minFilter, magFilter); +// } +// */ + +/** + * Map GL sampler parameters to tcu::Sampler. + * + * If no mapping is found, throws tcu::InternalError. + * + * @param {number} wrapS S-component wrap mode + * @param {number} wrapT T-component wrap mode + * @param {number} minFilter Minification filter mode + * @param {number} magFilter Magnification filter mode + * @return {tcuTexture.Sampler} + */ +gluTextureUtil.mapGLSamplerWrapST = function(wrapS, wrapT, minFilter, magFilter) { + return gluTextureUtil.mapGLSampler(wrapS, wrapT, wrapS, minFilter, magFilter); +}; + +/** + * Map GL sampler parameters to tcu::Sampler. + * + * If no mapping is found, throws tcu::InternalError. + * @param {number} wrapS S-component wrap mode + * @param {number} wrapT T-component wrap mode + * @param {number} wrapR R-component wrap mode + * @param {number} minFilter Minification filter mode + * @param {number} magFilter Magnification filter mode + * @return {tcuTexture.Sampler} + */ +gluTextureUtil.mapGLSampler = function(wrapS, wrapT, wrapR, minFilter, magFilter) { + return new tcuTexture.Sampler( + gluTextureUtil.mapGLWrapMode(wrapS), + gluTextureUtil.mapGLWrapMode(wrapT), + gluTextureUtil.mapGLWrapMode(wrapR), + gluTextureUtil.mapGLFilterMode(minFilter), + gluTextureUtil.mapGLFilterMode(magFilter), + 0.0, + true, + tcuTexture.CompareMode.COMPAREMODE_NONE, + 0, + [0.0, 0.0, 0.0, 0.0]); +}; + +// /*--------------------------------------------------------------------*//*! +// * \brief Map GL compare function to tcu::Sampler::CompareMode. +// * +// * If no mapping is found, throws tcu::InternalError. +// * +// * \param mode GL compare mode +// * \return Compare mode +// *//*--------------------------------------------------------------------*/ +/** + * @param {number} mode + */ +gluTextureUtil.mapGLCompareFunc = function(mode) { + switch (mode) { + case gl.LESS: return tcuTexture.CompareMode.COMPAREMODE_LESS; + case gl.LEQUAL: return tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL; + case gl.GREATER: return tcuTexture.CompareMode.COMPAREMODE_GREATER; + case gl.GEQUAL: return tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL; + case gl.EQUAL: return tcuTexture.CompareMode.COMPAREMODE_EQUAL; + case gl.NOTEQUAL: return tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL; + case gl.ALWAYS: return tcuTexture.CompareMode.COMPAREMODE_ALWAYS; + case gl.NEVER: return tcuTexture.CompareMode.COMPAREMODE_NEVER; + default: + throw new Error("Can't map GL compare mode " + mode); + } +}; + +/** + * Get GL wrap mode. + * + * If no mapping is found, throws tcu::InternalError. + * + * @param {tcuTexture.WrapMode} wrapMode + * @return {number} GL wrap mode + */ +gluTextureUtil.getGLWrapMode = function(wrapMode) { + switch (wrapMode) { + case tcuTexture.WrapMode.CLAMP_TO_EDGE: return gl.CLAMP_TO_EDGE; + case tcuTexture.WrapMode.REPEAT_GL: return gl.REPEAT; + case tcuTexture.WrapMode.MIRRORED_REPEAT_GL: return gl.MIRRORED_REPEAT; + default: + throw new Error("Can't map wrap mode"); + } +}; + +/** + * Get GL filter mode. + * + * If no mapping is found, throws tcu::InternalError. + * + * @param {tcuTexture.FilterMode} filterMode Filter mode + * @return {number} GL filter mode + */ +gluTextureUtil.getGLFilterMode = function(filterMode) { + switch (filterMode) { + case tcuTexture.FilterMode.NEAREST: return gl.NEAREST; + case tcuTexture.FilterMode.LINEAR: return gl.LINEAR; + case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST: return gl.NEAREST_MIPMAP_NEAREST; + case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR: return gl.NEAREST_MIPMAP_LINEAR; + case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: return gl.LINEAR_MIPMAP_NEAREST; + case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: return gl.LINEAR_MIPMAP_LINEAR; + default: + throw new Error("Can't map filter mode"); + } +}; + +/** + * Get GL compare mode. + * + * If no mapping is found, throws tcu::InternalError. + * + * @param {tcuTexture.CompareMode} compareMode Compare mode + * @return {number} GL compare mode + */ +gluTextureUtil.getGLCompareFunc = function(compareMode) { + switch (compareMode) { + case tcuTexture.CompareMode.COMPAREMODE_NONE: return gl.NONE; + case tcuTexture.CompareMode.COMPAREMODE_LESS: return gl.LESS; + case tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL: return gl.LEQUAL; + case tcuTexture.CompareMode.COMPAREMODE_GREATER: return gl.GREATER; + case tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL: return gl.GEQUAL; + case tcuTexture.CompareMode.COMPAREMODE_EQUAL: return gl.EQUAL; + case tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL: return gl.NOTEQUAL; + case tcuTexture.CompareMode.COMPAREMODE_ALWAYS: return gl.ALWAYS; + case tcuTexture.CompareMode.COMPAREMODE_NEVER: return gl.NEVER; + default: + throw new Error("Can't map compare mode"); + } +}; + +/** + * Get GL cube face. + * + * If no mapping is found, throws tcu::InternalError. + * + * @param {tcuTexture.CubeFace} face Cube face + * @return {number} GL cube face + */ +gluTextureUtil.getGLCubeFace = function(face) { + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: + return gl.TEXTURE_CUBE_MAP_NEGATIVE_X; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: + return gl.TEXTURE_CUBE_MAP_POSITIVE_X; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: + return gl.TEXTURE_CUBE_MAP_NEGATIVE_Y; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: + return gl.TEXTURE_CUBE_MAP_POSITIVE_Y; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: + return gl.TEXTURE_CUBE_MAP_NEGATIVE_Z; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: + return gl.TEXTURE_CUBE_MAP_POSITIVE_Z; + default: + throw Error("Can't map cube face"); + } +}; + +// /*--------------------------------------------------------------------*//*! +// * \brief Get GLSL sampler type for texture format. +// * +// * If no mapping is found, glu::TYPE_LAST is returned. +// * +// * \param format Texture format +// * \return GLSL 1D sampler type for format +// *//*--------------------------------------------------------------------*/ +// DataType getSampler1DType (tcu::TextureFormat format) +// { +// using tcu::TextureFormat; + +// if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) +// return TYPE_SAMPLER_1D; + +// if (format.order == tcuTexture.ChannelOrder.S) +// return TYPE_LAST; + +// switch (tcu::getTextureChannelClass(format.type)) +// { +// case tcu::TEXTURECHANNELCLASS_FLOATING_POINT: +// case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT: +// case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT: +// return glu::TYPE_SAMPLER_1D; + +// case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER: +// return glu::TYPE_INT_SAMPLER_1D; + +// case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER: +// return glu::TYPE_UINT_SAMPLER_1D; + +// default: +// return glu::TYPE_LAST; +// } +// } + +/** + * Get GLSL sampler type for texture format. + * If no mapping is found, glu::TYPE_LAST is returned. + * + * @param {tcuTexture.TextureFormat} format + * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format + */ +gluTextureUtil.getSampler2DType = function(format) { + if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) + return gluShaderUtil.DataType.SAMPLER_2D; + + if (format.order == tcuTexture.ChannelOrder.S) + return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length); + + switch (tcuTexture.getTextureChannelClass(format.type)) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + return gluShaderUtil.DataType.SAMPLER_2D; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + return gluShaderUtil.DataType.INT_SAMPLER_2D; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + return gluShaderUtil.DataType.UINT_SAMPLER_2D; + + default: + return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length); + } +}; + +/** + * + * @param {tcuTexture.TextureFormat} format + * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format + */ +gluTextureUtil.getSampler3DType = function(format) { + if (format.order === tcuTexture.ChannelOrder.D || format.order === tcuTexture.ChannelOrder.DS) + return gluShaderUtil.DataType.SAMPLER_3D; + + if (format.order === tcuTexture.ChannelOrder.S) + return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length); // shouldn't we throw an error instead? + + switch (tcuTexture.getTextureChannelClass(format.type)) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + return gluShaderUtil.DataType.SAMPLER_3D; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + return gluShaderUtil.DataType.INT_SAMPLER_3D; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + return gluShaderUtil.DataType.UINT_SAMPLER_3D; + + default: + return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length); + } +}; + +/** + * \brief Get GLSL sampler type for texture format. + * + * @param {tcuTexture.TextureFormat} format + * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format + */ +gluTextureUtil.getSamplerCubeType = function(format) { + if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) + return gluShaderUtil.DataType.SAMPLER_CUBE; + + if (format.order == tcuTexture.ChannelOrder.S) + throw new Error('No cube sampler'); + + switch (tcuTexture.getTextureChannelClass(format.type)) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + return gluShaderUtil.DataType.SAMPLER_CUBE; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + return gluShaderUtil.DataType.INT_SAMPLER_CUBE; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + return gluShaderUtil.DataType.UINT_SAMPLER_CUBE; + + default: + throw new Error('No cube sampler'); + } +}; + +/** + * \brief Get GLSL sampler type for texture format. + * + * If no mapping is found, glu::TYPE_LAST is returned. + * + * @param {tcuTexture.TextureFormat} format + * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format + */ +gluTextureUtil.getSampler2DArrayType = function(format) { + + if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) + return gluShaderUtil.DataType.SAMPLER_2D_ARRAY; + + if (format.order == tcuTexture.ChannelOrder.S) + throw new Error('No 2d array sampler'); + + switch (tcuTexture.getTextureChannelClass(format.type)) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + return gluShaderUtil.DataType.SAMPLER_2D_ARRAY; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + return gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + return gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY; + + default: + throw new Error('No 2d array sampler'); + } +}; + +/** + * \brief Get GLSL sampler type for texture format. + * + * If no mapping is found, glu::TYPE_LAST is returned. + * + * @param {tcuTexture.TextureFormat} format + * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format + */ +gluTextureUtil.getSampler3D = function(format) { + if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) + return gluShaderUtil.DataType.SAMPLER_3D; + + if (format.order == tcuTexture.ChannelOrder.S) + throw new Error('No 3d sampler'); + + switch (tcuTexture.getTextureChannelClass(format.type)) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + return gluShaderUtil.DataType.SAMPLER_3D; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + return gluShaderUtil.DataType.INT_SAMPLER_3D; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + return gluShaderUtil.DataType.UINT_SAMPLER_3D; + + default: + throw new Error('No 3d sampler'); + } +}; + +gluTextureUtil.RenderableType = { + RENDERABLE_COLOR: (1<<0), + RENDERABLE_DEPTH: (1<<1), + RENDERABLE_STENCIL: (1<<2) +}; + +/** + * \brief Get renderable bits. + * \note Works currently only on ES3 context. + * + * @param {number} internalFormat + * @return {gluTextureUtil.RenderableType} + */ +gluTextureUtil.getRenderableBitsES3 = function(internalFormat) +{ + switch (internalFormat) + { + // Color-renderable formats + case gl.RGBA32I: + case gl.RGBA32UI: + case gl.RGBA16I: + case gl.RGBA16UI: + case gl.RGBA8: + case gl.RGBA8I: + case gl.RGBA8UI: + case gl.SRGB8_ALPHA8: + case gl.RGB10_A2: + case gl.RGB10_A2UI: + case gl.RGBA4: + case gl.RGB5_A1: + case gl.RGB8: + case gl.RGB565: + case gl.RG32I: + case gl.RG32UI: + case gl.RG16I: + case gl.RG16UI: + case gl.RG8: + case gl.RG8I: + case gl.RG8UI: + case gl.R32I: + case gl.R32UI: + case gl.R16I: + case gl.R16UI: + case gl.R8: + case gl.R8I: + case gl.R8UI: + return gluTextureUtil.RenderableType.RENDERABLE_COLOR; + + // EXT_color_buffer_float + case gl.RGBA32F: + case gl.R11F_G11F_B10F: + case gl.RG32F: + case gl.R32F: + case gl.RGBA16F: + case gl.RG16F: + case gl.R16F: + if (gl.getExtension("EXT_color_buffer_float")) + return gluTextureUtil.RenderableType.RENDERABLE_COLOR; + else + return 0; + + // Depth formats + case gl.DEPTH_COMPONENT32F: + case gl.DEPTH_COMPONENT24: + case gl.DEPTH_COMPONENT16: + return gluTextureUtil.RenderableType.RENDERABLE_DEPTH; + + // Depth+stencil formats + case gl.DEPTH32F_STENCIL8: + case gl.DEPTH24_STENCIL8: + return gluTextureUtil.RenderableType.RENDERABLE_DEPTH | gluTextureUtil.RenderableType.RENDERABLE_STENCIL; + + // Stencil formats + case gl.STENCIL_INDEX8: + return gluTextureUtil.RenderableType.RENDERABLE_STENCIL; + + default: + return 0; + } +} + +/** + * \brief Check if sized internal format is color-renderable. + * \note Works currently only on ES3 context. + * + * @param {number} sizedFormat + * @return {boolean} + */ +gluTextureUtil.isSizedFormatColorRenderable = function(sizedFormat) +{ + var renderable = 0; + renderable = gluTextureUtil.getRenderableBitsES3(sizedFormat); + return (renderable & gluTextureUtil.RenderableType.RENDERABLE_COLOR) != 0; +} + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js new file mode 100644 index 000000000..a05f1c1e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js @@ -0,0 +1,814 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluVarType'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { + + var gluVarType = framework.opengl.gluVarType; + var gluShaderUtil = framework.opengl.gluShaderUtil; + + /** + * gluVarType.VarType types enum + * @enum {number} + */ + gluVarType.Type = { + TYPE_BASIC: 0, + TYPE_ARRAY: 1, + TYPE_STRUCT: 2 + }; + + /** + * gluVarType.TypeArray struct + * @param {gluVarType.VarType} elementType + * @param {number} arraySize + * @constructor + */ + gluVarType.TypeArray = function(elementType, arraySize) { + /** @type {gluVarType.VarType} */ this.elementType = gluVarType.newClone(elementType); + /** @type {number} */ this.size = arraySize; + }; + + /** + * gluVarType.VarType class + * @constructor + */ + gluVarType.VarType = function() { + /** + * @type {gluShaderUtil.precision} + * @private + */ + this.m_flags; + + /** + * @type {number} + * @private + */ + this.m_type = -1; + + /** + * m_data used to be a 'Data' union in C++. Using a var is enough here. + * it will contain any necessary value. + * case TYPE_BASIC: number + * case TYPE_ARRAY: gluVarType.TypeArray + * case TYPE_STRUCT: gluVarType.StructType + * @private + * @type {(number|gluVarType.TypeArray|gluVarType.StructType)} + */ + this.m_data = null; + }; + + gluVarType.VarType.UNSIZED_ARRAY = -1; + + /** + * Creates a basic type gluVarType.VarType. Use this after the constructor call. + * @param {number} basicType + * @param {gluShaderUtil.precision} flags + * @return {gluVarType.VarType} The currently modified object + */ + gluVarType.VarType.prototype.VarTypeBasic = function(basicType, flags) { + this.m_type = gluVarType.Type.TYPE_BASIC; + this.m_flags = flags; + this.m_data = basicType; + + return this; + }; + + /** + * Creates a basic type gluVarType.VarType with type boolean and undefined precision. + * @param {number} basicType + * @return {gluVarType.VarType} The currently modified object + */ + gluVarType.VarType.prototype.VarTypeBoolean = function(basicType) { + this.m_type = gluVarType.Type.TYPE_BASIC; + this.m_data = basicType; + + return this; + }; + + /** + * Creates an array type gluVarType.VarType. Use this after the constructor call. + * @param {gluVarType.VarType} elementType + * @param {number} arraySize + * @return {gluVarType.VarType} The currently modified object + */ + gluVarType.VarType.prototype.VarTypeArray = function(elementType, arraySize) { + this.m_type = gluVarType.Type.TYPE_ARRAY; + if (!(arraySize >= 0 || arraySize == gluVarType.VarType.UNSIZED_ARRAY)) + throw new Error('Illegal array size: ' + arraySize); + this.m_data = new gluVarType.TypeArray(elementType, arraySize); + + return this; + }; + + /** + * Creates a struct type gluVarType.VarType. Use this after the constructor call. + * @param {gluVarType.StructType} structPtr + * @return {gluVarType.VarType} The currently modified object + */ + gluVarType.VarType.prototype.VarTypeStruct = function(structPtr) { + this.m_type = gluVarType.Type.TYPE_STRUCT; + this.m_data = structPtr; + + return this; + }; + + /** + * Creates a gluVarType.VarType, the same type as the passed in object. + * Use this after the constructor call. + * @param {gluVarType.VarType} object + * @return {gluVarType.VarType} The currently modified object + */ + gluVarType.VarType.prototype.VarTypeClone = function(object) { + + this.m_type = object.m_type; + + switch (this.m_type) { + case gluVarType.Type.TYPE_BASIC: + this.m_flags = object.m_flags; + this.m_data = object.m_data; + break; + case gluVarType.Type.TYPE_BASIC: + this.m_data = new gluVarType.TypeArray(object.m_data.elementType, object.m_data.size); + break; + case gluVarType.Type.TYPE_STRUCT: + this.m_data = object.m_data; + break; + default: + throw new Error('unknown type: ' + this.m_type); + } + + return this; + }; + + /** isBasicType + * @return {boolean} true if the gluVarType.VarType represents a basic type. + */ + gluVarType.VarType.prototype.isBasicType = function() { + return this.m_type == gluVarType.Type.TYPE_BASIC; + }; + + /** isArrayType + * @return {boolean} true if the gluVarType.VarType represents an array. + */ + gluVarType.VarType.prototype.isArrayType = function() { + return this.m_type == gluVarType.Type.TYPE_ARRAY; + }; + + /** isStructType + * @return {boolean} true if the gluVarType.VarType represents a struct. + */ + gluVarType.VarType.prototype.isStructType = function() { + return this.m_type == gluVarType.Type.TYPE_STRUCT; + }; + + /** getFlags + * @return {number} returns the flags of the gluVarType.VarType. + */ + gluVarType.VarType.prototype.getFlags = function() { + return this.m_flags; + }; + + /** getBasicType + * @return {gluShaderUtil.DataType} returns the basic data type of the gluVarType.VarType. + */ + gluVarType.VarType.prototype.getBasicType = function() { + if (!this.isBasicType()) + throw new Error('VarType is not a basic type.'); + return /** @type {gluShaderUtil.DataType} */ (this.m_data); + }; + + /** getPrecision + * @return {gluShaderUtil.precision} returns the precision flag. + */ + gluVarType.VarType.prototype.getPrecision = function() { + if (!this.isBasicType()) + throw new Error('VarType is not a basic type.'); + return this.m_flags; + }; + + /** getElementType + * @return {gluVarType.VarType} returns the gluVarType.VarType of the element in case of an Array. + */ + gluVarType.VarType.prototype.getElementType = function() { + if (!this.isArrayType()) + throw new Error('VarType is not an array type.'); + return this.m_data.elementType; + }; + + /** getArraySize + * (not to be confused with a javascript array) + * @return {number} returns the size of the array in case it is an array. + */ + gluVarType.VarType.prototype.getArraySize = function() { + if (!this.isArrayType()) + throw new Error('VarType is not an array type.'); + return this.m_data.size; + }; + + /** getStruct + * @return {gluVarType.StructType} returns the structure when it is a gluVarType.StructType. + */ + gluVarType.VarType.prototype.getStruct = function() { + if (!this.isStructType()) + throw new Error('VarType is not a struct type.'); + return /** @type {gluVarType.StructType} */ (this.m_data); + }; + + /** + * getScalarSize + * @return {number} size of the scalar + */ + gluVarType.VarType.prototype.getScalarSize = function() { + switch (this.m_type) { + case gluVarType.Type.TYPE_BASIC: { + return gluShaderUtil.getDataTypeScalarSize(/** @type {gluShaderUtil.DataType} */(this.getBasicType())); + } + + // TODO: check implementation below: return m_data.array.elementType->getScalarSize()*m_data.array.size; + case gluVarType.Type.TYPE_ARRAY: { + var m_data = /** @type {gluVarType.TypeArray} */(this.m_data); + return m_data.elementType.getScalarSize() * m_data.size; + } + + case gluVarType.Type.TYPE_STRUCT: { + var size = 0; + + var struct = /** @type {gluVarType.StructType} */ (this.m_data); + + // TODO: check loop conditions below + // for (gluVarType.StructType::ConstIterator iter = m_data.structPtr->begin(); iter != m_data.structPtr->end(); iter++) + for (var iter = 0; struct.m_members[iter] < struct.getSize(); iter++) + size += struct.getMember(iter).m_type.getScalarSize(); + return size; + } + + default: + // throw new Error('Unexpected type.'); + return 0; + } + }; + + /** + * is + * @return {boolean} returns true if the current object is equivalent to other. + */ + gluVarType.VarType.prototype.is = function(other) { + if (this.m_type != other.m_type) + return false; + + switch (this.m_type) { + case gluVarType.Type.TYPE_BASIC: + return this.m_data == other.m_data && + this.m_flags == other.m_flags; + + case gluVarType.Type.TYPE_ARRAY: + return this.m_data.elementType == other.m_data.elementType && + this.m_data.size == other.m_data.size; + + case gluVarType.Type.TYPE_STRUCT: + return this.m_data === other.m_data; + + default: + // throw new Error('Unexpected type.'); + return false; + } + }; + + /** + * isnt + * @return {boolean} returns true if the current object is not equivalent to other. + */ + gluVarType.VarType.prototype.isnt = function(other) { + return !(this.is(other)); + }; + + /** + * Creates a basic type gluVarType.VarType. + * @param {gluShaderUtil.DataType} basicType + * @param {framework.opengl.gluShaderUtil.precision=} flags + * @return {gluVarType.VarType} + */ + gluVarType.newTypeBasic = function(basicType, flags) { + if (!gluShaderUtil.isDataTypeBoolOrBVec(basicType)) + return new gluVarType.VarType().VarTypeBasic(basicType, /** @type {framework.opengl.gluShaderUtil.precision}*/ (flags)); + else + return new gluVarType.VarType().VarTypeBoolean(basicType); + }; + + /** + * Creates an array type gluVarType.VarType. + * @param {gluVarType.VarType} elementType + * @param {number} arraySize + * @return {gluVarType.VarType} + */ + gluVarType.newTypeArray = function(elementType, arraySize) { + return new gluVarType.VarType().VarTypeArray(elementType, arraySize); + }; + + /** + * Creates a struct type gluVarType.VarType. + * @param {gluVarType.StructType} structPtr + * @return {gluVarType.VarType} + */ + gluVarType.newTypeStruct = function(structPtr) { + return new gluVarType.VarType().VarTypeStruct(structPtr); + }; + + /** + * Creates a struct type gluVarType.VarType. + * @param {gluVarType.VarType} object + * @return {gluVarType.VarType} + */ + gluVarType.newClone = function(object) { + return new gluVarType.VarType().VarTypeClone(object); + }; + + /** + * gluVarType.StructMember class + * @constructor + */ + gluVarType.StructMember = function() { + /** @type {string} */ this.m_name; + /** @type {gluVarType.VarType} */ this.m_type; + /** @type {number} */ // this.m_flags = 0; // only in glsUniformBlockCase + }; + + /** + * Creates a gluVarType.StructMember. Use this after the constructor call. + * @param {string} name + * @param {gluVarType.VarType} type + * @return {gluVarType.StructMember} The currently modified object + */ + gluVarType.StructMember.prototype.Constructor = function(name, type) { + this.m_type = type; + this.m_name = name; + + return this; + }; + + /** getName + * @return {string} name of the gluVarType.StructMember object. + */ + gluVarType.StructMember.prototype.getName = function() { + return this.m_name; + }; + + /** getType + * @return {gluVarType.VarType} type of the gluVarType.StructMember object. + */ + gluVarType.StructMember.prototype.getType = function() { + return this.m_type; + }; + + /** + * Creates a gluVarType.StructMember. + * @param {string} name + * @param {gluVarType.VarType} type + * @return {gluVarType.StructMember} + */ + gluVarType.newStructMember = function(name, type) { + return new gluVarType.StructMember().Constructor(name, type); + }; + + /** + * gluVarType.StructType class + * @constructor + */ + gluVarType.StructType = function() { + /** @type {string} */ this.m_typeName = ''; + /** @type {Array} */ this.m_members = []; + }; + + /** + * Creates a gluVarType.StructType. Use this after the constructor call. + * @param {string} name + * @return {gluVarType.StructType} The currently modified object + */ + gluVarType.StructType.prototype.Constructor = function(name) { + /** @type {string}*/ this.m_typeName = this.setTypeName(name); + return this; + }; + + /** hasTypeName + * Checks if the gluVarType.StructType m_typeName is defined + * @return {boolean} + */ + gluVarType.StructType.prototype.hasTypeName = function() { + return (this.m_typeName !== 'undefined'); + }; + + /** setTypeName + * @param {string} name + * @return {string} returns gluVarType.StructType.m_typeName + */ + gluVarType.StructType.prototype.setTypeName = function(name) { + return this.m_typeName = name; + }; + + /** getTypeName + * @return {string} + */ + gluVarType.StructType.prototype.getTypeName = function() { + return this.m_typeName; + }; + + /** getNumMembers + * @return {number} + */ + gluVarType.StructType.prototype.getNumMembers = function() { + return this.m_members.length; + }; + + /** getMember + * @param {number} memberNdx The index of the member to retrieve. + * @return {gluVarType.StructMember} + */ + gluVarType.StructType.prototype.getMember = function(memberNdx) { + if (memberNdx >= 0 && memberNdx < this.m_members.length) + return this.m_members[memberNdx]; + else { + throw new Error('Invalid member index for StructTypes members'); + } + }; + + /** getSize + * @return {number} The size of the m_members array. + */ + gluVarType.StructType.prototype.getSize = function() { + return this.m_members.length; + }; + + /** addMember + * @param {string} name + * @param {gluVarType.VarType} type + */ + gluVarType.StructType.prototype.addMember = function(name, type) { + var member = gluVarType.newStructMember(name, type); + this.m_members.push(member); + }; + + /** + * Creates a gluVarType.StructType. + * @param {string} name + * @return {gluVarType.StructType} + */ + gluVarType.newStructType = function(name) { + return new gluVarType.StructType().Constructor(name); + }; + + /** + * @param {number} level + * @return {string} + */ + gluVarType.indent = function(level) { + /** @type {string} */ var str = ''; + for (var i = 0; i < level; i++) + str += '\t'; + return str; + }; + + /** + * @param {gluVarType.VarType} varType + * @param {string} name + * @param {number=} level + * @return {string} + */ + gluVarType.declareVariable = function(varType, name, level) { + /** @type {string} */ var str = ''; + /** @type {gluVarType.VarType} */ var type = varType; + /** @type {gluVarType.VarType} */ var curType = type; + /** @type {Array} */ var arraySizes = []; + + // Handle arrays. + while (curType.isArrayType()) { + arraySizes.push(curType.getArraySize()); + curType = curType.getElementType(); + } + + if (curType.isBasicType()) { + if (curType.getPrecision() !== undefined) + str += gluShaderUtil.getPrecisionName(curType.getPrecision()) + ' '; + str += gluShaderUtil.getDataTypeName(/** @type {gluShaderUtil.DataType} */(curType.getBasicType())); + } else if (curType.isStructType()) { + /** @type {gluVarType.StructType} */ var structPtr = curType.getStruct(); + + if (structPtr.hasTypeName()) + str += structPtr.getTypeName(); + else + str += gluVarType.declareStructType(structPtr, level); // Generate inline declaration. + } else + throw new Error('Unexpected Array typed VarType.'); + + str += ' ' + name; + + // Print array sizes. + for (var size = 0; size < arraySizes.length; size++) { //std::vector::const_iterator sizeIter = arraySizes.begin(); sizeIter != arraySizes.end(); sizeIter++) { + /** @type {number} */ var arrSize = arraySizes[size]; + if (arrSize == gluVarType.VarType.UNSIZED_ARRAY) + str += '[]'; + else + str += '[' + arrSize + ']'; + } + + return str; + }; + + /** + * @param {gluVarType.StructType} structType + * @param {number=} level + * @return {string} + */ + gluVarType.declareStructType = function(structType, level) { + /** @type {string} */ var str = 'struct'; + level = level || 0; + + // gluVarType.Type name is optional. + if (structType.hasTypeName()) + str += ' ' + structType.getTypeName(); + + str += '\n' + gluVarType.indent(level) + ' {\n'; + + for (var memberNdx = 0; memberNdx < structType.getSize(); memberNdx++) { //gluVarType.StructType::ConstIterator memberIter = decl.structPtr->begin(); memberIter != decl.structPtr->end(); memberIter++) { + /** @type {gluVarType.StructMember} */ var memberIter = structType.getMember(memberNdx); + str += gluVarType.indent(level + 1); + str += gluVarType.declareVariable(memberIter.getType(), memberIter.getName(), level + 1) + ';\n'; + } + + str += gluVarType.indent(level) + '}'; + + return str; + }; + + /** + * @param {*} T + * @param {number=} size + * @param {gluShaderUtil.precision=} precision + * @return {gluVarType.VarType} + */ + gluVarType.getVarTypeOf = function(T, size, precision) { + size = size || 1; + precision = precision || gluShaderUtil.precision.PRECISION_LOWP; + switch (size) { + case 4: return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, precision); + case 3: return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC3, precision); + case 2: return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision); + } + switch (T) { + case 'float' : return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT, precision); + case 'vec4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, precision); + case 'vec3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC3, precision); + case 'vec2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision); + case 'mat2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2, precision); + case 'mat2x3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2X3, precision); + case 'mat2x4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2X4, precision); + case 'mat3x2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3X2, precision); + case 'mat3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, precision); + case 'mat3x4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3X4, precision); + case 'mat4x2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT4X2, precision); + case 'mat4x3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT4X3, precision); + case 'mat4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT4, precision); + } + throw new Error('Invalid input type ' + T + ' or size ' + size); + }; + + /** + * @enum + */ + gluVarType.Storage = { + STORAGE_IN: 0, + STORAGE_OUT: 1, + STORAGE_CONST: 2, + STORAGE_UNIFORM: 3, + STORAGE_BUFFER: 4 + }; + + /** + * @param {gluVarType.Storage} storage + * @return {string} + */ + gluVarType.getStorageName = function(storage) { + switch (storage) { + case gluVarType.Storage.STORAGE_IN: return 'in'; + case gluVarType.Storage.STORAGE_OUT: return 'out'; + case gluVarType.Storage.STORAGE_CONST: return 'const'; + case gluVarType.Storage.STORAGE_UNIFORM: return 'uniform'; + case gluVarType.Storage.STORAGE_BUFFER: return 'buffer'; + default: + throw new Error('Unknown storage: ' + storage); + } + }; + + /** + * @enum + */ + gluVarType.Interpolation = { + INTERPOLATION_SMOOTH: 0, + INTERPOLATION_FLAT: 1, + INTERPOLATION_CENTROID: 2 + }; + + /** + * @param {gluVarType.Interpolation} interpolation + * @return {string} + */ + gluVarType.getInterpolationName = function(interpolation) { + switch (interpolation) { + case gluVarType.Interpolation.INTERPOLATION_SMOOTH: return 'smooth'; + case gluVarType.Interpolation.INTERPOLATION_FLAT: return 'flat'; + case gluVarType.Interpolation.INTERPOLATION_CENTROID: return 'centrod'; + default: + throw new Error('Unknown interpolation: ' + interpolation); + } + }; + + /** + * @enum + */ + gluVarType.FormatLayout = { + FORMATLAYOUT_RGBA32F: 0, + FORMATLAYOUT_RGBA16F: 1, + FORMATLAYOUT_R32F: 2, + FORMATLAYOUT_RGBA8: 3, + FORMATLAYOUT_RGBA8_SNORM: 4, + + FORMATLAYOUT_RGBA32I: 5, + FORMATLAYOUT_RGBA16I: 6, + FORMATLAYOUT_RGBA8I: 7, + FORMATLAYOUT_R32I: 8, + + FORMATLAYOUT_RGBA32UI: 9, + FORMATLAYOUT_RGBA16UI: 10, + FORMATLAYOUT_RGBA8UI: 11, + FORMATLAYOUT_R32UI: 12 + }; + + /** + * @param {gluVarType.FormatLayout} layout + * @return {string} + */ + gluVarType.getFormatLayoutName = function(layout) { + switch (layout) { + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA32F: return 'rgba32f'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA16F: return 'rgba16f'; + case gluVarType.FormatLayout.FORMATLAYOUT_R32F: return 'r32f'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8: return 'rgba8'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8_SNORM: return 'rgba8_snorm'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA32I: return 'rgba32i'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA16I: return 'rgba16i'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8I: return 'rgba8i'; + case gluVarType.FormatLayout.FORMATLAYOUT_R32I: return 'r32i'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA32UI: return 'rgba32ui'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA16UI: return 'rgba16ui'; + case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8UI: return 'rgba8ui'; + case gluVarType.FormatLayout.FORMATLAYOUT_R32UI: return 'r32ui'; + default: + throw new Error('Unknown layout: ' + layout); + } + }; + + /** + * @enum + */ + gluVarType.MatrixOrder = { + MATRIXORDER_COLUMN_MAJOR: 0, + MATRIXORDER_ROW_MAJOR: 1 + }; + + /** + * @param {gluVarType.MatrixOrder} qualifier + * @return {string} + */ + gluVarType.getMatrixOrderName = function(qualifier) { + switch (qualifier) { + case gluVarType.MatrixOrder.MATRIXORDER_COLUMN_MAJOR: return 'column_major'; + case gluVarType.MatrixOrder.MATRIXORDER_ROW_MAJOR: return 'row_major'; + default: + throw new Error('Unknown qualifier: ' + qualifier); + } + }; + + gluVarType.MemoryAccessQualifier = { + MEMORYACCESSQUALIFIER_COHERENT_BIT: 0x01, + MEMORYACCESSQUALIFIER_VOLATILE_BIT: 0x02, + MEMORYACCESSQUALIFIER_RESTRICT_BIT: 0x04, + MEMORYACCESSQUALIFIER_READONLY_BIT: 0x08, + MEMORYACCESSQUALIFIER_WRITEONLY_BIT: 0x10 + }; + gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_MASK = (gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_WRITEONLY_BIT << 1) - 1; + + /** + * @param {number} qualifier + * @return {string} + */ + gluVarType.getMemoryAccessQualifierName = function(qualifier) { + switch (qualifier) { + case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_COHERENT_BIT: return 'coherent'; + case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_VOLATILE_BIT: return 'volatile'; + case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_RESTRICT_BIT: return 'restrict'; + case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_READONLY_BIT: return 'readonly'; + case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_WRITEONLY_BIT: return 'writeonly'; + default: + throw new Error('Unknown qualifier: ' + qualifier); + } + }; + + /** + * @constructor + * @param {number=} location + * @param {number=} binding + * @param {number=} offset + * @param {gluVarType.FormatLayout=} format + * @param {gluVarType.MatrixOrder=} matrixOrder + */ + gluVarType.Layout = function(location, binding, offset, format, matrixOrder) { + this.location = location; + this.binding = binding; + this.offset = offset; + this.format = format; + this.matrixOrder = matrixOrder; + }; + + gluVarType.Layout.prototype.toString = function() { + var strings = []; + var str = ''; + if (typeof this.location !== 'undefined') + strings.push('location=' + this.location); + if (typeof this.binding !== 'undefined') + strings.push('binding=' + this.binding); + if (typeof this.offset !== 'undefined') + strings.push('offset=' + this.offset); + if (typeof this.format !== 'undefined') + strings.push(gluVarType.getFormatLayoutName(this.format)); + if (typeof this.matrixOrder !== 'undefined') + strings.push(gluVarType.getMatrixOrderName(this.matrixOrder)); + + if (strings.length > 0) { + str += 'layout(' + strings[0]; + + for (var i = 1; i < strings.length; i++) + str += ', ' + strings[i]; + str += ')'; + } + + return str; + }; + + /** + * @constructor + * @param {gluVarType.VarType} varType + * @param {string} name + * @param {gluVarType.Storage=} storage + * @param {gluVarType.Interpolation=} interpolation + * @param {gluVarType.Layout=} layout + * @param {number=} memoryAccessQualifierBits + */ + gluVarType.VariableDeclaration = function(varType, name, storage, interpolation, layout, memoryAccessQualifierBits) { + this.varType = varType; + this.name = name; + this.storage = storage; + this.interpolation = interpolation; + this.layout = layout; + this.memoryAccessQualifierBits = memoryAccessQualifierBits || 0; + }; + + gluVarType.VariableDeclaration.prototype.toString = function() { + var str = ''; + if (typeof this.layout !== 'undefined') + str += this.layout.toString() + ' '; + + for (var bitNdx = 0; (1 << bitNdx) & gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_MASK; ++bitNdx) + if (this.memoryAccessQualifierBits & (1 << bitNdx)) + str += gluVarType.getMemoryAccessQualifierName((1 << bitNdx)) + ' '; + + if (typeof this.interpolation !== 'undefined') + str += gluVarType.getInterpolationName(this.interpolation) + ' '; + + if (typeof this.storage !== 'undefined') + str += gluVarType.getStorageName(this.storage) + ' '; + + str += gluVarType.declareVariable(this.varType, this.name); + + return str; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js new file mode 100644 index 000000000..30e198a60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js @@ -0,0 +1,693 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.gluVarTypeUtil'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluVarType'); + +goog.scope(function() { + + var gluVarTypeUtil = framework.opengl.gluVarTypeUtil; + var gluVarType = framework.opengl.gluVarType; + var gluShaderUtil = framework.opengl.gluShaderUtil; + + gluVarTypeUtil.isNum = function(c) { return /^[0-9]$/.test(c); }; + gluVarTypeUtil.isAlpha = function(c) { return /^[a-zA-Z]$/.test(c); }; + gluVarTypeUtil.isIdentifierChar = function(c) { return /^[a-zA-Z0-9_]$/.test(c); }; + gluVarTypeUtil.array_op_equivalent = function(arr1, arr2) { + if (arr1.length != arr2.length) return false; + for (var i = 0; i < arr1.length; ++i) { + if (arr1[i].isnt(arr2[1])) return false; + } + return true; + }; + + /** + * gluVarTypeUtil.VarTokenizer class. + * @param {string} str + * @constructor + */ + gluVarTypeUtil.VarTokenizer = function(str) { + + /** @private */ + this.m_str = str; + /** @private */ + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.length; + /** @private */ + this.m_tokenStart = 0; + /** @private */ + this.m_tokenLen = 0; + + this.advance(); + + }; + gluVarTypeUtil.VarTokenizer.s_Token = { + IDENTIFIER: 0, + LEFT_BRACKET: 1, + RIGHT_BRACKET: 2, + PERIOD: 3, + NUMBER: 4, + END: 5 + }; + gluVarTypeUtil.VarTokenizer.s_Token.length = Object.keys(gluVarTypeUtil.VarTokenizer.s_Token).length; + + gluVarTypeUtil.VarTokenizer.prototype.getToken = function() { + return this.m_token; + }; + gluVarTypeUtil.VarTokenizer.prototype.getIdentifier = function() { + return this.m_str.substr(this.m_tokenStart, this.m_tokenLen); + }; + gluVarTypeUtil.VarTokenizer.prototype.getNumber = function() { + return parseInt(this.getIdentifier(), 10); + }; + gluVarTypeUtil.VarTokenizer.prototype.getCurrentTokenStartLocation = function() { + return this.m_tokenStart; + }; + gluVarTypeUtil.VarTokenizer.prototype.getCurrentTokenEndLocation = function() { + return this.m_tokenStart + this.m_tokenLen; + }; + + gluVarTypeUtil.VarTokenizer.prototype.advance = function() { + + if (this.m_token == gluVarTypeUtil.VarTokenizer.s_Token.END) { + throw new Error('No more tokens.'); + } + + this.m_tokenStart += this.m_tokenLen; + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.length; + this.m_tokenLen = 1; + + if (this.m_tokenStart >= this.m_str.length) { + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.END; + + } else if (this.m_str[this.m_tokenStart] == '[') { + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.LEFT_BRACKET; + + } else if (this.m_str[this.m_tokenStart] == ']') { + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.RIGHT_BRACKET; + + } else if (this.m_str[this.m_tokenStart] == '.') { + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.PERIOD; + + } else if (gluVarTypeUtil.isNum(this.m_str[this.m_tokenStart])) { + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.NUMBER; + while (gluVarTypeUtil.isNum(this.m_str[this.m_tokenStart + this.m_tokenLen])) { + this.m_tokenLen += 1; + } + + } else if (gluVarTypeUtil.isIdentifierChar(this.m_str[this.m_tokenStart])) { + this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER; + while (gluVarTypeUtil.isIdentifierChar(this.m_str[this.m_tokenStart + this.m_tokenLen])) { + this.m_tokenLen += 1; + } + + } else { + throw new Error('Unexpected character'); + } + + }; + + /** + * VarType subtype path utilities class. + * @param {gluVarTypeUtil.VarTypeComponent.s_Type} type + * @param {number} index + * @constructor + */ + gluVarTypeUtil.VarTypeComponent = function(type, index) { + /** @type {gluVarTypeUtil.VarTypeComponent.s_Type} */ this.type = type; + this.index = index || 0; + }; + + gluVarTypeUtil.VarTypeComponent.prototype.is = function(other) { + return this.type == other.type && this.index == other.index; + }; + gluVarTypeUtil.VarTypeComponent.prototype.isnt = function(other) { + return this.type != other.type || this.index != other.index; + }; + + /** + * @enum + */ + gluVarTypeUtil.VarTypeComponent.s_Type = { + STRUCT_MEMBER: 0, + ARRAY_ELEMENT: 1, + MATRIX_COLUMN: 2, + VECTOR_COMPONENT: 3 + }; + + /** + * Type path formatter. + * @param {gluVarType.VarType} type_ + * @param {Array} path_ + * @constructor + */ + gluVarTypeUtil.TypeAccessFormat = function(type_, path_) { + this.type = type_; + this.path = path_; + }; + + gluVarTypeUtil.TypeAccessFormat.prototype.toString = function() { + var curType = this.type; + var str = ''; + + for (var i = 0; i < this.path.length; i++) { + var iter = this.path[i]; + switch (iter.type) { + case gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT: + curType = curType.getElementType(); // Update current type. + // Fall-through. + + case gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN: + case gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT: + str += '[' + iter.index + ']'; + break; + + case gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER: { + var member = curType.getStruct().getMember(i); + str += '.' + member.getName(); + curType = member.getType(); + break; + } + + default: + throw new Error('Unrecognized type:' + iter.type); + } + } + + return str; + }; + + /** gluVarTypeUtil.SubTypeAccess + * @param {gluVarType.VarType} type + * @constructor + */ + gluVarTypeUtil.SubTypeAccess = function(type) { + + this.m_type = null; // VarType + this.m_path = []; // TypeComponentVector + + }; + + /** @private */ + gluVarTypeUtil.SubTypeAccess.prototype.helper = function(type, ndx) { + this.m_path.push(new gluVarTypeUtil.VarTypeComponent(type, ndx)); + if (!this.isValid()) { + throw new Error; + } + return this; + }; + + gluVarTypeUtil.SubTypeAccess.prototype.member = function(ndx) { + return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER, ndx); + }; + gluVarTypeUtil.SubTypeAccess.prototype.element = function(ndx) { + return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT, ndx); + }; + gluVarTypeUtil.SubTypeAccess.prototype.column = function(ndx) { + return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN, ndx); + }; + gluVarTypeUtil.SubTypeAccess.prototype.component = function(ndx) { + return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT, ndx); + }; + gluVarTypeUtil.SubTypeAccess.prototype.parent = function() { + if (!this.m_path.length) { + throw new Error; + } + this.m_path.pop(); + return this; + }; + + gluVarTypeUtil.SubTypeAccess.prototype.isValid = function() { + return gluVarTypeUtil.isValidTypePath(this.m_type, this.m_path); + }; + gluVarTypeUtil.SubTypeAccess.prototype.getType = function() { + return gluVarTypeUtil.getVarType(this.m_type, this.m_path); + }; + gluVarTypeUtil.SubTypeAccess.prototype.getPath = function() { + return this.m_path; + }; + gluVarTypeUtil.SubTypeAccess.prototype.empty = function() { + return !this.m_path.length; + }; + gluVarTypeUtil.SubTypeAccess.prototype.is = function(other) { + return ( + gluVarTypeUtil.array_op_equivalent(this.m_path, other.m_path) && + this.m_type.is(other.m_type) + ); + }; + gluVarTypeUtil.SubTypeAccess.prototype.isnt = function(other) { + return ( + !gluVarTypeUtil.array_op_equivalent(this.m_path, other.m_path) || + this.m_type.isnt(other.m_type) + ); + }; + + /** + * Subtype iterator parent class. + * basic usage for all child classes: + * for (var i = new gluVarTypeUtil.BasicTypeIterator(type) ; !i.end() ; i.next()) { + * var j = i.getType(); + * } + * @constructor + */ + gluVarTypeUtil.SubTypeIterator = function(type) { + + /** @private */ + this.m_type = null; // const VarType* + /** @private */ + this.m_path = []; // TypeComponentVector + + if (type) { + this.m_type = type; + this.findNext(); + } + + }; + + gluVarTypeUtil.SubTypeIterator.prototype.isExpanded = function(type) { + throw new Error('This function must be overriden in child class'); + }; + + /** removeTraversed + * @private + */ + gluVarTypeUtil.SubTypeIterator.prototype.removeTraversed = function() { + + while (this.m_path.length) { + var curComp = this.m_path[this.m_path.length - 1]; // gluVarTypeUtil.VarTypeComponent& + var parentType = gluVarTypeUtil.getVarType(this.m_type, this.m_path, 0, this.m_path.length - 1); // VarType + + if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN) { + if (!gluShaderUtil.isDataTypeMatrix(parentType.getBasicType())) { + throw new Error('Isn\'t a matrix.'); + } + if (curComp.index + 1 < gluShaderUtil.getDataTypeMatrixNumColumns(parentType.getBasicType())) { + break; + } + + } else if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT) { + if (!gluShaderUtil.isDataTypeVector(parentType.getBasicType())) { + throw new Error('Isn\'t a vector.'); + } + if (curComp.index + 1 < gluShaderUtil.getDataTypeScalarSize(parentType.getBasicType())) { + break; + } + + } else if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT) { + if (!parentType.isArrayType()) { + throw new Error('Isn\'t an array.'); + } + if (curComp.index + 1 < parentType.getArraySize()) { + break; + } + + } else if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER) { + if (!parentType.isStructType()) { + throw new Error('Isn\'t a struct.'); + } + if (curComp.index + 1 < parentType.getStruct().getNumMembers()) { + break; + } + + } + + this.m_path.pop(); + } + }; + gluVarTypeUtil.SubTypeIterator.prototype.findNext = function() { + + if (this.m_path.length > 0) { + // Increment child counter in current level. + var curComp = this.m_path[this.m_path.length - 1]; // gluVarTypeUtil.VarTypeComponent& + curComp.index += 1; + } + + for (;;) { + + var curType = gluVarTypeUtil.getVarType(this.m_type, this.m_path); // VarType + + if (this.isExpanded(curType)) + break; + + // Recurse into child type. + if (curType.isBasicType()) { + var basicType = curType.getBasicType(); // DataType + + if (gluShaderUtil.isDataTypeMatrix(basicType)) { + this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN, 0)); + + } else if (gluShaderUtil.isDataTypeVector(basicType)) { + this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT, 0)); + + } else { + throw new Error('Cant expand scalars - isExpanded() is buggy.'); + } + + } else if (curType.isArrayType()) { + this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT, 0)); + + } else if (curType.isStructType()) { + this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER, 0)); + + } else { + throw new Error(); + } + } + + }; + gluVarTypeUtil.SubTypeIterator.prototype.end = function() { + return (this.m_type == null); + }; + /** next + * equivelant to operator++(), doesnt return. + */ + gluVarTypeUtil.SubTypeIterator.prototype.next = function() { + if (this.m_path.length > 0) { + // Remove traversed nodes. + this.removeTraversed(); + + if (this.m_path.length > 0) + this.findNext(); + else + this.m_type = null; // Unset type to signal end. + } else { + if (!this.isExpanded(gluVarTypeUtil.getVarType(this.m_type, this.m_path))) { + throw new Error('First type was already expanded.'); + } + this.m_type = null; + } + }; + gluVarTypeUtil.SubTypeIterator.prototype.getType = function() { + return gluVarTypeUtil.getVarType(this.m_type, this.m_path); + }; + gluVarTypeUtil.SubTypeIterator.prototype.getPath = function() { + return this.m_path; + }; + + gluVarTypeUtil.SubTypeIterator.prototype.toString = function() { + var x = new gluVarTypeUtil.TypeAccessFormat(this.m_type, this.m_path); + return x.toString(); + }; + + /** gluVarTypeUtil.BasicTypeIterator + * @param {gluVarType.VarType} type + * @constructor + * @extends {gluVarTypeUtil.SubTypeIterator} + */ + gluVarTypeUtil.BasicTypeIterator = function(type) { + gluVarTypeUtil.SubTypeIterator.call(this, type); + }; + gluVarTypeUtil.BasicTypeIterator.prototype = Object.create(gluVarTypeUtil.SubTypeIterator.prototype); + gluVarTypeUtil.BasicTypeIterator.prototype.constructor = gluVarTypeUtil.BasicTypeIterator; + + gluVarTypeUtil.BasicTypeIterator.prototype.isExpanded = function(type) { + return type.isBasicType(); + }; + + /** gluVarTypeUtil.VectorTypeIterator + * @param {gluVarType.VarType} type + * @constructor + * @extends {gluVarTypeUtil.SubTypeIterator} + */ + gluVarTypeUtil.VectorTypeIterator = function(type) { + gluVarTypeUtil.SubTypeIterator.call(this, type); + }; + gluVarTypeUtil.VectorTypeIterator.prototype = Object.create(gluVarTypeUtil.SubTypeIterator.prototype); + gluVarTypeUtil.VectorTypeIterator.prototype.constructor = gluVarTypeUtil.VectorTypeIterator; + + gluVarTypeUtil.VectorTypeIterator.prototype.isExpanded = function(type) { + return type.isBasicType() && gluShaderUtil.isDataTypeScalarOrVector(type.getBasicType()); + }; + + /** gluVarTypeUtil.ScalarTypeIterator + * @param {gluVarType.VarType} type + * @constructor + * @extends {gluVarTypeUtil.SubTypeIterator} + */ + gluVarTypeUtil.ScalarTypeIterator = function(type) { + gluVarTypeUtil.SubTypeIterator.call(this, type); + }; + gluVarTypeUtil.ScalarTypeIterator.prototype = Object.create(gluVarTypeUtil.SubTypeIterator.prototype); + gluVarTypeUtil.ScalarTypeIterator.prototype.constructor = gluVarTypeUtil.ScalarTypeIterator; + + gluVarTypeUtil.ScalarTypeIterator.prototype.isExpanded = function(type) { + return type.isBasicType() && gluShaderUtil.isDataTypeScalar(type.getBasicType()); + }; + + gluVarTypeUtil.inBounds = (function(x, a, b) { return a <= x && x < b; }); + + /** gluVarTypeUtil.isValidTypePath + * @param {gluVarType.VarType} type + * @param {Array} array + * @param {number=} begin + * @param {number=} end + * @return {boolean} + */ + gluVarTypeUtil.isValidTypePath = function(type, array, begin, end) { + + if (typeof(begin) == 'undefined') {begin = 0;} + if (typeof(end) == 'undefined') {begin = array.length;} + + var curType = type; // const VarType* + var pathIter = begin; // Iterator + + // Process struct member and array element parts of path. + while (pathIter != end) { + var element = array[pathIter]; + + if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER) { + + if (!curType.isStructType() || !gluVarTypeUtil.inBounds(element.index, 0, curType.getStruct().getNumMembers())) { + return false; + } + + curType = curType.getStruct().getMember(element.index).getType(); + + } else if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT) { + if ( + !curType.isArrayType() || + ( + curType.getArraySize() != gluVarType.VarType.UNSIZED_ARRAY && + !gluVarTypeUtil.inBounds(element.index, 0, curType.getArraySize()) + ) + ) { + return false; + } + + curType = curType.getElementType(); + } else { + break; + } + + ++pathIter; + } + + if (pathIter != end) { + if (!( + array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN || + array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT + )) { + throw new Error('Not a matrix or a vector'); + } + + // Current type should be basic type. + if (!curType.isBasicType()) { + return false; + } + + var basicType = curType.getBasicType(); // DataType + + if (array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN) { + if (!gluShaderUtil.isDataTypeMatrix(basicType)) { + return false; + } + + basicType = gluShaderUtil.getDataTypeFloatVec(gluShaderUtil.getDataTypeMatrixNumRows(basicType)); + ++pathIter; + } + + if (pathIter != end && array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT) { + if (!gluShaderUtil.isDataTypeVector(basicType)) + return false; + + basicType = gluShaderUtil.getDataTypeScalarType(basicType); + ++pathIter; + } + } + + return pathIter == end; + }; + + /** gluVarTypeUtil.getVarType + * @param {gluVarType.VarType} type + * @param {Array} array + * @param {number=} start + * @param {number=} end + * @return {gluVarType.VarType} + */ + gluVarTypeUtil.getVarType = function(type, array, start, end) { + + if (typeof(start) == 'undefined') start = 0; + if (typeof(end) == 'undefined') end = array.length; + + if (!gluVarTypeUtil.isValidTypePath(type, array, start, end)) { + throw new Error('Type is invalid'); + } + + var curType = type; // const VarType* + var element = null; // Iterator + var pathIter = 0; + + // Process struct member and array element parts of path. + for (pathIter = start; pathIter != end; ++pathIter) { + element = array[pathIter]; + + if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER) { + curType = curType.getStruct().getMember(element.index).getType(); + + } else if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT) { + curType = curType.getElementType(); + + } else { + break; + + } + } + + if (pathIter != end) { + + var basicType = curType.getBasicType(); // DataType + var precision = curType.getPrecision(); // Precision + + if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN) { + basicType = gluShaderUtil.getDataTypeFloatVec(gluShaderUtil.getDataTypeMatrixNumRows(basicType)); + element = array[++pathIter]; + } + + if (pathIter != end && element.type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT) { + basicType = gluShaderUtil.getDataTypeScalarTypeAsDataType(basicType); + element = array[++pathIter]; + } + + if (pathIter != end) { + throw new Error(); + } + return gluVarType.newTypeBasic(basicType, precision); + } else { + /* TODO: Original code created an object copy. We are returning reference to the same object */ + return curType; + } + }; + + gluVarTypeUtil.parseVariableName = function(nameWithPath) { + var tokenizer = new gluVarTypeUtil.VarTokenizer(nameWithPath); + if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER) { + throw new Error('Not an identifier.'); + } + return tokenizer.getIdentifier(); + }; + + // returns an array (TypeComponentVector& path) + // params: const char*, const VarType& + gluVarTypeUtil.parseTypePath = function(nameWithPath, type) { + + var tokenizer = new gluVarTypeUtil.VarTokenizer(nameWithPath); + + if (tokenizer.getToken() == gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER) { + tokenizer.advance(); + } + + var path = []; + + while (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.END) { + + var curType = gluVarTypeUtil.getVarType(type, path); + + if (tokenizer.getToken() == gluVarTypeUtil.VarTokenizer.s_Token.PERIOD) { + + tokenizer.advance(); + if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER) { + throw new Error(); + } + if (!curType.isStructType()) { + throw new Error('Invalid field selector'); + } + + // Find member. + var memberName = tokenizer.getIdentifier(); + var ndx = 0; + for (; ndx < curType.getStruct().getSize(); ++ndx) { + + if (memberName == curType.getStruct().getMember(ndx).getName()) { + break; + } + + } + if (ndx >= curType.getStruct().getSize()) { + throw new Error('Member not found in type: ' + memberName); + } + + path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER, ndx)); + tokenizer.advance(); + + } else if (tokenizer.getToken() == gluVarTypeUtil.VarTokenizer.s_Token.LEFT_BRACKET) { + + tokenizer.advance(); + if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.NUMBER) { + throw new Error(); + } + + var ndx = tokenizer.getNumber(); + + if (curType.isArrayType()) { + if (!gluVarTypeUtil.inBounds(ndx, 0, curType.getArraySize())) throw new Error; + path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT, ndx)); + + } else if (curType.isBasicType() && gluShaderUtil.isDataTypeMatrix(curType.getBasicType())) { + if (!gluVarTypeUtil.inBounds(ndx, 0, gluShaderUtil.getDataTypeMatrixNumColumns(curType.getBasicType()))) throw new Error; + path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN, ndx)); + + } else if (curType.isBasicType() && gluShaderUtil.isDataTypeVector(curType.getBasicType())) { + if (!gluVarTypeUtil.inBounds(ndx, 0, gluShaderUtil.getDataTypeScalarSize(curType.getBasicType()))) throw new Error; + path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT, ndx)); + + } else { + //TCU_FAIL + throw new Error('Invalid subscript'); + } + + tokenizer.advance(); + if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.RIGHT_BRACKET) { + throw new Error('Expected token RIGHT_BRACKET'); + } + tokenizer.advance(); + + } else { + // TCU_FAIL + throw new Error('Unexpected token'); + } + } + + return path; + + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt new file mode 100644 index 000000000..7db3d9d5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt @@ -0,0 +1 @@ +referencecontext.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html new file mode 100644 index 000000000..f3ba0ed26 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html @@ -0,0 +1,32 @@ + + + + +Reference context test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js new file mode 100644 index 000000000..13f75e8f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js @@ -0,0 +1,231 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrDefs'); +goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess'); +goog.require('framework.referencerenderer.rrRenderState'); +goog.require('framework.referencerenderer.rrRenderer'); +goog.require('framework.referencerenderer.rrVertexAttrib'); + +goog.scope(function() { + + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var tcuTexture = framework.common.tcuTexture; + var deUtil = framework.delibs.debase.deUtil; + var deMath = framework.delibs.debase.deMath; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var rrDefs = framework.referencerenderer.rrDefs; + var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess; + var rrRenderer = framework.referencerenderer.rrRenderer; + var rrRenderState = framework.referencerenderer.rrRenderState; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * sglrGLContext.GLContext wraps the standard WebGL context to be able to be used interchangeably with the ReferenceContext + * @constructor + * @extends {WebGL2RenderingContext} + * @param {?WebGL2RenderingContext} context + * @param {Array=} viewport + */ + sglrGLContext.GLContext = function(context, viewport) { + DE_ASSERT(context); + + var functionwrapper = function(context, fname) { + return function() { + return context[fname].apply(context, arguments); + }; + }; + + var wrap = {}; + for (var i in context) { + try { + if (typeof context[i] == 'function') { + wrap[i] = functionwrapper(context, i); + } else { + wrap[i] = context[i]; + } + } catch (e) { + throw new Error('GLContext: Error accessing ' + i); + } + } + if (viewport) + context.viewport(viewport[0], viewport[1], viewport[2], viewport[3]); + + /** + * createProgram + * @override + * @param {sglrShaderProgram.ShaderProgram=} shader + * @return {!WebGLProgram} + */ + this.createProgram = function(shader) { + var program = new gluShaderProgram.ShaderProgram( + context, + gluShaderProgram.makeVtxFragSources( + shader.m_vertSrc, + shader.m_fragSrc + ) + ); + + if (!program.isOk()) { + bufferedLogToConsole(program.toString()); + testFailedOptions('Compile failed', true); + } + return program.getProgram(); + }; + wrap['createProgram'] = this.createProgram; + + /** + * Draws quads from vertex arrays + * @param {number} primitive Primitive type + * @param {number} first First vertex to begin drawing with + * @param {number} count Number of vertices + */ + var drawQuads = function(primitive, first, count) { + context.drawArrays(primitive, first, count); + }; + wrap['drawQuads'] = drawQuads; + + /** + * @return {number} + */ + var getWidth = function() { + if(viewport) + return viewport[2]; + else + return context.drawingBufferWidth; + }; + wrap['getWidth'] = getWidth; + + /** + * @return {number} + */ + var getHeight = function() { + if(viewport) + return viewport[3]; + else + return context.drawingBufferHeight; + }; + wrap['getHeight'] = getHeight; + + /** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} format + * @param {number} dataType + * @param {ArrayBuffer|ArrayBufferView} data + */ + var readPixels = function(x, y, width, height, format, dataType, data) { + /** @type {?ArrayBufferView} */ var dataArr; + if (!ArrayBuffer.isView(data)) { + var type = gluTextureUtil.mapGLChannelType(dataType, true); + var dataArrType = tcuTexture.getTypedArray(type); + dataArr = new dataArrType(data); + } else { + dataArr = /** @type {?ArrayBufferView} */ (data); + } + + context.readPixels(x, y, width, height, format, dataType, dataArr); + }; + wrap['readPixels'] = readPixels; + + /** + * @param {number} target + * @param {number} level + * @param {number} internalFormat + * @param {number} width + * @param {number} height + */ + var texImage2DDelegate = function(target, level, internalFormat, width, height) { + var format; + var dataType; + + switch(internalFormat) + { + case gl.ALPHA: + case gl.LUMINANCE: + case gl.LUMINANCE_ALPHA: + case gl.RGB: + case gl.RGBA: + format = internalFormat; + dataType = gl.UNSIGNED_BYTE; + break; + default: + { + var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(internalFormat)); + format = transferFmt.format; + dataType = transferFmt.dataType; + break; + } + } + context.texImage2D(target, level, internalFormat, width, height, 0, format, dataType, null); + }; + wrap['texImage2DDelegate'] = texImage2DDelegate; + + return wrap; + }; + + /** + * createProgram - This had to be added here as dummy to remove a warning when the only context used is GLContext (no reference context) + * @override + * @param {sglrShaderProgram.ShaderProgram=} shader + * @return {!WebGLProgram} + */ + sglrGLContext.GLContext.prototype.createProgram = function(shader) {return this.createProgram();}; + + /** + * @param ctx GL-like context + * @param {string} name + * @return {boolean} + */ + sglrGLContext.isExtensionSupported = function(ctx, name) { + var extns = ctx.getSupportedExtensions(); + var found = false; + if (extns) { + var index = extns.indexOf(name); + if (index != -1) + found = true; + } + return found; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js new file mode 100644 index 000000000..523dbe607 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js @@ -0,0 +1,4986 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuMatrixUtil'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.simplereference.sglrReferenceUtils'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrDefs'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess'); +goog.require('framework.referencerenderer.rrRenderState'); +goog.require('framework.referencerenderer.rrRenderer'); +goog.require('framework.referencerenderer.rrVertexAttrib'); + +goog.scope(function() { + + var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; + var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess; + var tcuTexture = framework.common.tcuTexture; + var deMath = framework.delibs.debase.deMath; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var rrRenderer = framework.referencerenderer.rrRenderer; + var rrDefs = framework.referencerenderer.rrDefs; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrRenderState = framework.referencerenderer.rrRenderState; + var sglrReferenceUtils = framework.opengl.simplereference.sglrReferenceUtils; + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var tcuMatrix = framework.common.tcuMatrix; + var tcuMatrixUtil = framework.common.tcuMatrixUtil; + + sglrReferenceContext.rrMPBA = rrMultisamplePixelBufferAccess; + + //TODO: Implement automatic error checking in sglrReferenceContext, optional on creation. + + /** @typedef {WebGLRenderbuffer|WebGLTexture|sglrReferenceContext.Renderbuffer|sglrReferenceContext.TextureContainer} */ sglrReferenceContext.AnyRenderbuffer; + + /** @typedef {WebGLFramebuffer|sglrReferenceContext.Framebuffer} */ sglrReferenceContext.AnyFramebuffer; + + /** + * @param {number} error + * @param {number} message + * @throws {Error} + */ + sglrReferenceContext.GLU_EXPECT_NO_ERROR = function(error, message) { + if (error !== gl.NONE) { + bufferedLogToConsole('Assertion failed message:' + message); + } + }; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + // /* TODO: remove */ + // /** @type {WebGL2RenderingContext} */ var gl; + + sglrReferenceContext.MAX_TEXTURE_SIZE_LOG2 = 14; + sglrReferenceContext.MAX_TEXTURE_SIZE = 1 << sglrReferenceContext.MAX_TEXTURE_SIZE_LOG2; + + /** + * @param {number} width + * @param {number} height + * @return {number} + */ + sglrReferenceContext.getNumMipLevels2D = function(width, height) { + return Math.floor(Math.log2(Math.max(width, height)) + 1); + }; + + /** + * @param {number} width + * @param {number} height + * @param {number} depth + * @return {number} + */ + sglrReferenceContext.getNumMipLevels3D = function(width, height, depth) { + return Math.floor(Math.log2(Math.max(width, height, depth)) + 1); + }; + + /** + * @param {number} baseLevelSize + * @param {number} levelNdx + * @return {number} + */ + sglrReferenceContext.getMipLevelSize = function(baseLevelSize, levelNdx) { + return Math.max(baseLevelSize >> levelNdx, 1); + }; + + sglrReferenceContext.mapGLCubeFace = function(face) { + switch (face) { + case gl.TEXTURE_CUBE_MAP_NEGATIVE_X: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; + case gl.TEXTURE_CUBE_MAP_POSITIVE_X: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_X; + case gl.TEXTURE_CUBE_MAP_NEGATIVE_Y: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y; + case gl.TEXTURE_CUBE_MAP_POSITIVE_Y: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y; + case gl.TEXTURE_CUBE_MAP_NEGATIVE_Z: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z; + case gl.TEXTURE_CUBE_MAP_POSITIVE_Z: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z; + default: throw new Error('Invalid cube face: ' + face); + } + }; + + /** + * @param {tcuTexture.FilterMode} mode + * @return {boolean} + */ + sglrReferenceContext.isMipmapFilter = function(/*const tcu::Sampler::FilterMode*/ mode) { + return mode != tcuTexture.FilterMode.NEAREST && mode != tcuTexture.FilterMode.LINEAR; + }; + + sglrReferenceContext.getNumMipLevels1D = function(size) { + return Math.floor(Math.log2(size)) + 1; + }; + + /** + * @param {?sglrReferenceContext.TextureType} type + * @return {sglrReferenceContext.TexTarget} + */ + sglrReferenceContext.texLayeredTypeToTarget = function(type) { + switch (type) { + case sglrReferenceContext.TextureType.TYPE_2D_ARRAY: return sglrReferenceContext.TexTarget.TEXTARGET_2D_ARRAY; + case sglrReferenceContext.TextureType.TYPE_3D: return sglrReferenceContext.TexTarget.TEXTARGET_3D; + case sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_ARRAY; + default: throw new Error('Invalid texture type: ' + type); + } + }; + + /** + * @param {rrDefs.IndexType} indexType + * @return {number} + * @throws {Error} + */ + sglrReferenceContext.getFixedRestartIndex = function(indexType) { + switch (indexType) { + case rrDefs.IndexType.INDEXTYPE_UINT8: return 0xFF; + case rrDefs.IndexType.INDEXTYPE_UINT16: return 0xFFFF; + case rrDefs.IndexType.INDEXTYPE_UINT32: return 0xFFFFFFFF; + default: + throw new Error('Unrecognized index type: ' + indexType); + } + }; + + /** + * @constructor + * @param {sglrShaderProgram.ShaderProgram} program + */ + sglrReferenceContext.ShaderProgramObjectContainer = function(program) { + this.m_program = program; + /** @type {boolean} */ this.m_deleteFlag = false; + }; + + /** + * @param {WebGL2RenderingContext} gl + * @constructor + */ + sglrReferenceContext.ReferenceContextLimits = function(gl) { + /** @type {number} */ this.maxTextureImageUnits = 16; + /** @type {number} */ this.maxTexture2DSize = 2048; + /** @type {number} */ this.maxTextureCubeSize = 2048; + /** @type {number} */ this.maxTexture2DArrayLayers = 256; + /** @type {number} */ this.maxTexture3DSize = 256; + /** @type {number} */ this.maxRenderbufferSize = 2048; + /** @type {number} */ this.maxVertexAttribs = 16; + + if (gl) { + this.maxTextureImageUnits = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)); + this.maxTexture2DSize = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)); + this.maxTextureCubeSize = /** @type {number} */ (gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)); + this.maxRenderbufferSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)); + this.maxVertexAttribs = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + this.maxTexture2DArrayLayers = /** @type {number} */ (gl.getParameter(gl.MAX_ARRAY_TEXTURE_LAYERS)); + this.maxTexture3DSize = /** @type {number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)); + + // Limit texture sizes to supported values + this.maxTexture2DSize = Math.min(this.maxTexture2DSize, sglrReferenceContext.MAX_TEXTURE_SIZE); + this.maxTextureCubeSize = Math.min(this.maxTextureCubeSize, sglrReferenceContext.MAX_TEXTURE_SIZE); + this.maxTexture3DSize = Math.min(this.maxTexture3DSize, sglrReferenceContext.MAX_TEXTURE_SIZE); + + sglrReferenceContext.GLU_EXPECT_NO_ERROR(gl.getError(), gl.NO_ERROR); + } + + /* TODO: Port + // \todo [pyry] Figure out following things: + // + supported fbo configurations + // ... + + // \todo [2013-08-01 pyry] Do we want to make these conditional based on renderCtx? + addExtension("gl.EXT_color_buffer_half_float"); + addExtension("gl.WEBGL_color_buffer_float"); + */ + }; + + /** + * @enum + */ + sglrReferenceContext.TextureType = { + TYPE_2D: 0, + TYPE_CUBE_MAP: 1, + TYPE_2D_ARRAY: 2, + TYPE_3D: 3, + TYPE_CUBE_MAP_ARRAY: 4 + }; + + /** + * @constructor + * @implements {rrDefs.Sampler} + * @param {sglrReferenceContext.TextureType} type + */ + sglrReferenceContext.Texture = function(type) { + // NamedObject.call(this, name); + /** @type {sglrReferenceContext.TextureType} */ this.m_type = type; + /** @type {boolean} */ this.m_immutable = false; + /** @type {number} */ this.m_baseLevel = 0; + /** @type {number} */ this.m_maxLevel = 1000; + /** @type {tcuTexture.Sampler} */ this.m_sampler = new tcuTexture.Sampler( + tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR, + tcuTexture.FilterMode.LINEAR, + 0, + true, + tcuTexture.CompareMode.COMPAREMODE_NONE, + 0, + [0, 0, 0, 0], + true); + }; + + /** + * @param {Array} pos + * @param {number=} lod + * @throws {Error} + */ + sglrReferenceContext.Texture.prototype.sample = function(pos, lod) {throw new Error('Intentionally empty. Call method from child class instead'); }; + + /** + * @param {Array>} packetTexcoords + * @param {number} lodBias + * @throws {Error} + */ + sglrReferenceContext.Texture.prototype.sample4 = function(packetTexcoords, lodBias) {throw new Error('Intentionally empty. Call method from child class instead'); }; + + // sglrReferenceContext.Texture.prototype = Object.create(NamedObject.prototype); + // sglrReferenceContext.Texture.prototype.constructor = sglrReferenceContext.Texture; + + /** + * @return {number} + */ + sglrReferenceContext.Texture.prototype.getType = function() { return this.m_type; }; + + /** + * @return {number} + */ + sglrReferenceContext.Texture.prototype.getBaseLevel = function() { return this.m_baseLevel; }; + + /** + * @return {number} + */ + sglrReferenceContext.Texture.prototype.getMaxLevel = function() { return this.m_maxLevel; }; + + /** + * @return {boolean} + */ + sglrReferenceContext.Texture.prototype.isImmutable = function() { return this.m_immutable; }; + + /** + * @param {number} baseLevel + */ + sglrReferenceContext.Texture.prototype.setBaseLevel = function(baseLevel) { this.m_baseLevel = baseLevel; }; + + /** + * @param {number} maxLevel + */ + sglrReferenceContext.Texture.prototype.setMaxLevel = function(maxLevel) { this.m_maxLevel = maxLevel; }; + + /** + */ + sglrReferenceContext.Texture.prototype.setImmutable = function() { this.m_immutable = true; }; + + /** + * @return {tcuTexture.Sampler} + */ + sglrReferenceContext.Texture.prototype.getSampler = function() { return this.m_sampler; }; + + /** + * @constructor + */ + sglrReferenceContext.TextureLevelArray = function() { + /** @type {Array} */ this.m_data = []; + /** @type {Array} */ this.m_access = []; + }; + + /** + * @param {number} level + * @return {boolean} + */ + sglrReferenceContext.TextureLevelArray.prototype.hasLevel = function(level) { return this.m_data[level] != null; }; + + /** + * @param {number} level + * @return {tcuTexture.PixelBufferAccess} + * @throws {Error} + */ + sglrReferenceContext.TextureLevelArray.prototype.getLevel = function(level) { + if (!this.hasLevel(level)) + throw new Error('Level: ' + level + ' is not defined.'); + + return this.m_access[level]; + }; + + /** + * @return {Array} + */ + sglrReferenceContext.TextureLevelArray.prototype.getLevels = function() { return this.m_access; }; + + /** + * @param {number} level + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} depth + */ + sglrReferenceContext.TextureLevelArray.prototype.allocLevel = function(level, format, width, height, depth) { + /** @type {number} */ var dataSize = format.getPixelSize() * width * height * depth; + if (this.hasLevel(level)) + this.clearLevel(level); + + this.m_data[level] = new ArrayBuffer(dataSize); + this.m_access[level] = new tcuTexture.PixelBufferAccess({ + format: format, + width: width, + height: height, + depth: depth, + data: this.m_data[level]}); + }; + + /** + * @param {number} level + */ + sglrReferenceContext.TextureLevelArray.prototype.clearLevel = function(level) { + delete this.m_data[level]; + delete this.m_access[level]; + }; + + /** + */ + sglrReferenceContext.TextureLevelArray.prototype.clear = function() { + for (var key in this.m_data) + delete this.m_data[key]; + + for (var key in this.m_access) + delete this.m_access[key]; + }; + + /** + * @constructor + * @extends {sglrReferenceContext.Texture} + */ + sglrReferenceContext.Texture2D = function() { + sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_2D); + /** @type {tcuTexture.Texture2DView} */ this.m_view = new tcuTexture.Texture2DView(0, null); + /** @type {sglrReferenceContext.TextureLevelArray} */ this.m_levels = new sglrReferenceContext.TextureLevelArray(); + }; + + /** + */ + sglrReferenceContext.Texture2D.prototype = Object.create(sglrReferenceContext.Texture.prototype); + sglrReferenceContext.Texture2D.prototype.constructor = sglrReferenceContext.Texture2D; + + sglrReferenceContext.Texture2D.prototype.clearLevels = function() { this.m_levels.clear(); }; + + /** + * @param {number} level + * @return {boolean} + */ + sglrReferenceContext.Texture2D.prototype.hasLevel = function(level) { return this.m_levels.hasLevel(level); }; + + /** + * @param {number} level + * @return {tcuTexture.PixelBufferAccess} + */ + sglrReferenceContext.Texture2D.prototype.getLevel = function(level) { return this.m_levels.getLevel(level); }; + + /** + * @param {number} level + * @param {?tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.Texture2D.prototype.allocLevel = function(level, format, width, height) { this.m_levels.allocLevel(level, format, width, height, 1); }; + + /** + * @return {boolean} + */ + sglrReferenceContext.Texture2D.prototype.isComplete = function() { + /** @type {number} */ var baseLevel = this.getBaseLevel(); + + if (this.hasLevel(baseLevel)) { + /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.getLevel(baseLevel); + /** @type {boolean} */ var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + + if (mipmap) { + /** @type {tcuTexture.TextureFormat} */ var format = level0.getFormat(); + /** @type {number} */ var w = level0.getWidth(); + /** @type {number} */ var h = level0.getHeight(); + /** @type {number} */ var numLevels = Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(w, h)); + + for (var levelNdx = 1; levelNdx < numLevels; levelNdx++) { + if (this.hasLevel(baseLevel + levelNdx)) { + /** @type {tcuTexture.PixelBufferAccess} */ var level = this.getLevel(baseLevel + levelNdx); + /** @type {number} */ var expectedW = sglrReferenceContext.getMipLevelSize(w, levelNdx); + /** @type {number} */ var expectedH = sglrReferenceContext.getMipLevelSize(h, levelNdx); + + if (level.getWidth() != expectedW || + level.getHeight() != expectedH || + !level.getFormat().isEqual(format)) + return false; + } else + return false; + } + } + + return true; + } else + return false; + }; + + /** + */ + sglrReferenceContext.Texture2D.prototype.updateView = function() { + /** @type {number} */ var baseLevel = this.getBaseLevel(); + + if (this.hasLevel(baseLevel) && !this.getLevel(baseLevel).isEmpty()) { + // Update number of levels in mipmap pyramid. + /** @type {number} */ var width = this.getLevel(baseLevel).getWidth(); + /** @type {number} */ var height = this.getLevel(baseLevel).getHeight(); + /** @type {boolean} */ var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + /** @type {number} */ var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1; + + this.m_view = new tcuTexture.Texture2DView(numLevels, this.m_levels.getLevels().slice(baseLevel)); + } else + this.m_view = new tcuTexture.Texture2DView(0, null); + }; + + /** + * @param {Array} pos + * @param {number=} lod + * @return {Array} + */ + sglrReferenceContext.Texture2D.prototype.sample = function(pos, lod) { + return this.m_view.sample(this.getSampler(), pos, lod); + }; + + /** + * @param {Array>} packetTexcoords 4 vec2 coordinates + * @param {number} lodBias_ + * @return {Array>} 4 vec4 samples + */ + sglrReferenceContext.Texture2D.prototype.sample4 = function(packetTexcoords, lodBias_) { + /** @type {number} */ var lodBias = lodBias_ || 0; + /** @type {number} */ var texWidth = this.m_view.getWidth(); + /** @type {number} */ var texHeight = this.m_view.getHeight(); + /** @type {Array>}*/ var output = []; + + /** @type {Array}*/ var dFdx0 = deMath.subtract(packetTexcoords[1], packetTexcoords[0]); + /** @type {Array}*/ var dFdx1 = deMath.subtract(packetTexcoords[3], packetTexcoords[2]); + /** @type {Array}*/ var dFdy0 = deMath.subtract(packetTexcoords[2], packetTexcoords[0]); + /** @type {Array}*/ var dFdy1 = deMath.subtract(packetTexcoords[3], packetTexcoords[1]); + + for (var fragNdx = 0; fragNdx < 4; ++fragNdx) { + /** @type {Array}*/var dFdx = (fragNdx & 2) ? dFdx1 : dFdx0; + /** @type {Array}*/var dFdy = (fragNdx & 1) ? dFdy1 : dFdy0; + + /** @type {number} */ var mu = Math.max(Math.abs(dFdx[0]), Math.abs(dFdy[0])); + /** @type {number} */ var mv = Math.max(Math.abs(dFdx[1]), Math.abs(dFdy[1])); + /** @type {number} */ var p = Math.max(mu * texWidth, mv * texHeight); + + /** @type {number} */ var lod = Math.log2(p) + lodBias; + + output.push(this.sample([packetTexcoords[fragNdx][0], packetTexcoords[fragNdx][1]], lod)); + } + + return output; + }; + + /** + * @constructor + * @extends {sglrReferenceContext.Texture} + */ + sglrReferenceContext.TextureCube = function() { + sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_CUBE_MAP); + /** @type {tcuTexture.TextureCubeView} */ this.m_view = new tcuTexture.TextureCubeView(0, null); + /** @type {Array} */ this.m_levels = []; + for (var face in tcuTexture.CubeFace) + this.m_levels[tcuTexture.CubeFace[face]] = new sglrReferenceContext.TextureLevelArray(); + }; + + /** + */ + sglrReferenceContext.TextureCube.prototype = Object.create(sglrReferenceContext.Texture.prototype); + sglrReferenceContext.TextureCube.prototype.constructor = sglrReferenceContext.Texture2D; + + sglrReferenceContext.TextureCube.prototype.clearLevels = function() { + for (var face in tcuTexture.CubeFace) + this.m_levels[tcuTexture.CubeFace[face]].clear(); + }; + + /** + * @param {number} level + * @param {tcuTexture.CubeFace} face + * @return {boolean} + */ + sglrReferenceContext.TextureCube.prototype.hasFace = function(level, face) { return this.m_levels[face].hasLevel(level); }; + + /** + * @param {number} level + * @param {tcuTexture.CubeFace} face + * @return {tcuTexture.PixelBufferAccess} + */ + sglrReferenceContext.TextureCube.prototype.getFace = function(level, face) { return this.m_levels[face].getLevel(level); }; + + /** + * @param {number} level + * @param {tcuTexture.CubeFace} face + * @param {?tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.TextureCube.prototype.allocLevel = function(level, face, format, width, height) { + this.m_levels[face].allocLevel(level, format, width, height, 1); + }; + + sglrReferenceContext.TextureCube.prototype.isComplete = function() { + var baseLevel = this.getBaseLevel(); + + if (this.hasFace(baseLevel, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X)) { + var level = this.getFace(baseLevel, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X); + var width = level.getWidth(); + var height = level.getHeight(); + var format = level.getFormat(); + var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + var numLevels = mipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1; + + if (width != height) + return false; // Non-square is not supported. + + // \note Level 0 is always checked for consistency + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + var levelW = sglrReferenceContext.getMipLevelSize(width, levelNdx); + var levelH = sglrReferenceContext.getMipLevelSize(height, levelNdx); + + for (var face in tcuTexture.CubeFace) { + if (this.hasFace(baseLevel + levelNdx, tcuTexture.CubeFace[face])) { + level = this.getFace(baseLevel + levelNdx, tcuTexture.CubeFace[face]); + + if (level.getWidth() != levelW || + level.getHeight() != levelH || + !level.getFormat().isEqual(format)) + return false; + } else + return false; + } + } + + return true; + } else + return false; + }; + + sglrReferenceContext.TextureCube.prototype.updateView = function() { + + var baseLevel = this.getBaseLevel(); + var faces = []; + + if (this.isComplete()) { + var size = this.getFace(baseLevel, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X).getWidth(); + var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels1D(size)) : 1; + + for (var face in tcuTexture.CubeFace) + faces[tcuTexture.CubeFace[face]] = this.m_levels[tcuTexture.CubeFace[face]].getLevels().slice(baseLevel); + + this.m_view = new tcuTexture.TextureCubeView(numLevels, faces); + } else + this.m_view = new tcuTexture.TextureCubeView(0, null); + }; + + /** + * @param {Array} pos + * @param {number=} lod + * @return {Array} + */ + sglrReferenceContext.TextureCube.prototype.sample = function(pos, lod) { return this.m_view.sample(this.getSampler(), pos, lod) }; + + /** + * @constructor + * @extends {sglrReferenceContext.Texture} + */ + sglrReferenceContext.Texture2DArray = function() { + sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_2D_ARRAY); + /** @type {tcuTexture.Texture2DArrayView} */ this.m_view = new tcuTexture.Texture2DArrayView(0, null); + /** @type {sglrReferenceContext.TextureLevelArray} */ this.m_levels = new sglrReferenceContext.TextureLevelArray(); + }; + + /** + */ + sglrReferenceContext.Texture2DArray.prototype = Object.create(sglrReferenceContext.Texture.prototype); + sglrReferenceContext.Texture2DArray.prototype.constructor = sglrReferenceContext.Texture2DArray; + + sglrReferenceContext.Texture2DArray.prototype.clearLevels = function() { this.m_levels.clear(); }; + + /** + * @param {number} level + * @return {boolean} + */ + sglrReferenceContext.Texture2DArray.prototype.hasLevel = function(level) { return this.m_levels.hasLevel(level); }; + + /** + * @param {number} level + * @return {tcuTexture.PixelBufferAccess} + */ + sglrReferenceContext.Texture2DArray.prototype.getLevel = function(level) { return this.m_levels.getLevel(level); }; + + /** + * @param {number} level + * @param {?tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} numLayers + */ + sglrReferenceContext.Texture2DArray.prototype.allocLevel = function(level, format, width, height, numLayers) { + this.m_levels.allocLevel(level, format, width, height, numLayers); + }; + + /** + * @return {boolean} + */ + sglrReferenceContext.Texture2DArray.prototype.isComplete = function() { + /** @type {number} */ var baseLevel = this.getBaseLevel(); + + if (this.hasLevel(baseLevel)) { + /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.getLevel(baseLevel); + /** @type {boolean} */ var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + + if (mipmap) { + /** @type {tcuTexture.TextureFormat} */ var format = level0.getFormat(); + /** @type {number} */ var w = level0.getWidth(); + /** @type {number} */ var h = level0.getHeight(); + /** @type {number} */ var numLayers = level0.getDepth(); + /** @type {number} */ var numLevels = Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(w, h)); + + for (var levelNdx = 1; levelNdx < numLevels; levelNdx++) { + if (this.hasLevel(baseLevel + levelNdx)) { + /** @type {tcuTexture.PixelBufferAccess} */ var level = this.getLevel(baseLevel + levelNdx); + /** @type {number} */ var expectedW = sglrReferenceContext.getMipLevelSize(w, levelNdx); + /** @type {number} */ var expectedH = sglrReferenceContext.getMipLevelSize(h, levelNdx); + + if (level.getWidth() != expectedW || + level.getHeight() != expectedH || + level.getDepth() != numLayers || + !level.getFormat().isEqual(format)) + return false; + } else + return false; + } + } + + return true; + } else + return false; + }; + + /** + */ + sglrReferenceContext.Texture2DArray.prototype.updateView = function() { + /** @type {number} */ var baseLevel = this.getBaseLevel(); + + if (this.hasLevel(baseLevel) && !this.getLevel(baseLevel).isEmpty()) { + // Update number of levels in mipmap pyramid. + /** @type {number} */ var width = this.getLevel(baseLevel).getWidth(); + /** @type {number} */ var height = this.getLevel(baseLevel).getHeight(); + /** @type {boolean} */ var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + /** @type {number} */ var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1; + + this.m_view = new tcuTexture.Texture2DArrayView(numLevels, this.m_levels.getLevels().slice(baseLevel)); + } else + this.m_view = new tcuTexture.Texture2DArrayView(0, null); + }; + + /** + * @param {Array} pos + * @param {number=} lod + * @return {Array} + */ + sglrReferenceContext.Texture2DArray.prototype.sample = function(pos, lod) { + return this.m_view.sample(this.getSampler(), pos, lod); + }; + + /** + * @constructor + * @extends {sglrReferenceContext.Texture} + */ + sglrReferenceContext.Texture3D = function() { + sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_2D_ARRAY); + /** @type {tcuTexture.Texture3DView} */ this.m_view = new tcuTexture.Texture3DView(0, null); + /** @type {sglrReferenceContext.TextureLevelArray} */ this.m_levels = new sglrReferenceContext.TextureLevelArray(); + }; + + /** + */ + sglrReferenceContext.Texture3D.prototype = Object.create(sglrReferenceContext.Texture.prototype); + sglrReferenceContext.Texture3D.prototype.constructor = sglrReferenceContext.Texture3D; + + sglrReferenceContext.Texture3D.prototype.clearLevels = function() { this.m_levels.clear(); }; + + /** + * @param {number} level + * @return {boolean} + */ + sglrReferenceContext.Texture3D.prototype.hasLevel = function(level) { return this.m_levels.hasLevel(level); }; + + /** + * @param {number} level + * @return {tcuTexture.PixelBufferAccess} + */ + sglrReferenceContext.Texture3D.prototype.getLevel = function(level) { return this.m_levels.getLevel(level); }; + + /** + * @param {number} level + * @param {?tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} depth + */ + sglrReferenceContext.Texture3D.prototype.allocLevel = function(level, format, width, height, depth) { + this.m_levels.allocLevel(level, format, width, height, depth); + }; + + /** + * @return {boolean} + */ + sglrReferenceContext.Texture3D.prototype.isComplete = function() { + /** @type {number} */ var baseLevel = this.getBaseLevel(); + + if (this.hasLevel(baseLevel)) { + /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.getLevel(baseLevel); + /** @type {boolean} */ var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + + if (mipmap) { + /** @type {tcuTexture.TextureFormat} */ var format = level0.getFormat(); + /** @type {number} */ var w = level0.getWidth(); + /** @type {number} */ var h = level0.getHeight(); + /** @type {number} */ var d = level0.getDepth(); + /** @type {number} */ var numLevels = Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels3D(w, h, d)); + + for (var levelNdx = 1; levelNdx < numLevels; levelNdx++) { + if (this.hasLevel(baseLevel + levelNdx)) { + /** @type {tcuTexture.PixelBufferAccess} */ var level = this.getLevel(baseLevel + levelNdx); + /** @type {number} */ var expectedW = sglrReferenceContext.getMipLevelSize(w, levelNdx); + /** @type {number} */ var expectedH = sglrReferenceContext.getMipLevelSize(h, levelNdx); + /** @type {number} */ var expectedD = sglrReferenceContext.getMipLevelSize(d, levelNdx); + + if (level.getWidth() != expectedW || + level.getHeight() != expectedH || + level.getDepth() != expectedD || + !level.getFormat().isEqual(format)) + return false; + } else + return false; + } + } + + return true; + } else + return false; + }; + + /** + */ + sglrReferenceContext.Texture3D.prototype.updateView = function() { + /** @type {number} */ var baseLevel = this.getBaseLevel(); + + if (this.hasLevel(baseLevel) && !this.getLevel(baseLevel).isEmpty()) { + // Update number of levels in mipmap pyramid. + /** @type {number} */ var width = this.getLevel(baseLevel).getWidth(); + /** @type {number} */ var height = this.getLevel(baseLevel).getHeight(); + /** @type {boolean} */ var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter); + /** @type {number} */ var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1; + + this.m_view = new tcuTexture.Texture3DView(numLevels, this.m_levels.getLevels().slice(baseLevel)); + } else + this.m_view = new tcuTexture.Texture3DView(0, null); + }; + + /** + * @param {Array} pos + * @param {number=} lod + * @return {Array} + */ + sglrReferenceContext.Texture3D.prototype.sample = function(pos, lod) { return this.m_view.sample(this.getSampler(), pos, lod) }; + + /** + * A container object for storing one of texture types; + * @constructor + */ + sglrReferenceContext.TextureContainer = function() { + /** @type {sglrReferenceContext.Texture2D | sglrReferenceContext.TextureCube|sglrReferenceContext.Texture2DArray|sglrReferenceContext.Texture3D} */ + this.texture = null; + /** @type {?sglrReferenceContext.TextureType} */ this.textureType = null; + }; + + /** + * @return {?sglrReferenceContext.TextureType} + */ + sglrReferenceContext.TextureContainer.prototype.getType = function() { return this.textureType; }; + + /** + * @param {number} target + * @throws {Error} + */ + sglrReferenceContext.TextureContainer.prototype.init = function(target) { + switch (target) { + case gl.TEXTURE_2D: + this.texture = new sglrReferenceContext.Texture2D(); + this.textureType = sglrReferenceContext.TextureType.TYPE_2D; + break; + case gl.TEXTURE_CUBE_MAP: + this.texture = new sglrReferenceContext.TextureCube(); + this.textureType = sglrReferenceContext.TextureType.TYPE_CUBE_MAP; + break; + case gl.TEXTURE_2D_ARRAY: + this.texture = new sglrReferenceContext.Texture2DArray(); + this.textureType = sglrReferenceContext.TextureType.TYPE_2D_ARRAY; + break; + case gl.TEXTURE_3D: + this.texture = new sglrReferenceContext.Texture3D(); + this.textureType = sglrReferenceContext.TextureType.TYPE_3D; + break; + /* TODO: Implement other types */ + // case gl.TEXTURE_CUBE_MAP_ARRAY: + // this.textureType = sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY; + // break; + default: throw new Error('Unrecognized target: ' + target); + } + }; + + /** + * @enum + */ + sglrReferenceContext.AttachmentPoint = { + ATTACHMENTPOINT_COLOR0: 0, + ATTACHMENTPOINT_DEPTH: 1, + ATTACHMENTPOINT_STENCIL: 2 + }; + + /** + * @param {number} attachment + * @return {sglrReferenceContext.AttachmentPoint} + * @throws {Error} + */ + sglrReferenceContext.mapGLAttachmentPoint = function(attachment) { + switch (attachment) { + case gl.COLOR_ATTACHMENT0: return sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0; + case gl.DEPTH_ATTACHMENT: return sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH; + case gl.STENCIL_ATTACHMENT: return sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL; + default: throw new Error('Wrong attachment point:' + attachment); + } + }; + + /** + * @enum + */ + sglrReferenceContext.AttachmentType = { + ATTACHMENTTYPE_RENDERBUFFER: 0, + ATTACHMENTTYPE_TEXTURE: 1 + }; + + /** + * @enum + */ + sglrReferenceContext.TexTarget = { + TEXTARGET_2D: 0, + TEXTARGET_CUBE_MAP_POSITIVE_X: 1, + TEXTARGET_CUBE_MAP_POSITIVE_Y: 2, + TEXTARGET_CUBE_MAP_POSITIVE_Z: 3, + TEXTARGET_CUBE_MAP_NEGATIVE_X: 4, + TEXTARGET_CUBE_MAP_NEGATIVE_Y: 5, + TEXTARGET_CUBE_MAP_NEGATIVE_Z: 6, + TEXTARGET_2D_ARRAY: 7, + TEXTARGET_3D: 8, + TEXTARGET_CUBE_MAP_ARRAY: 9 + }; + + /** + * @param {?sglrReferenceContext.TexTarget} target + * @return {tcuTexture.CubeFace} + */ + sglrReferenceContext.texTargetToFace = function(target) { + switch (target) { + case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_X: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; + case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_X; + case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Y: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y; + case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Y: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y; + case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z; + case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Z: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z; + default: throw new Error('Invalid target ' + target); + } + }; + + /** + * @param {sglrReferenceContext.TexTarget} target + * @return {sglrReferenceContext.TexTarget} + * @throws {Error} + */ + sglrReferenceContext.mapGLFboTexTarget = function(target) { + switch (target) { + case gl.TEXTURE_2D: return sglrReferenceContext.TexTarget.TEXTARGET_2D; + case gl.TEXTURE_CUBE_MAP_POSITIVE_X: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X; + case gl.TEXTURE_CUBE_MAP_POSITIVE_Y: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Y; + case gl.TEXTURE_CUBE_MAP_POSITIVE_Z: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Z; + case gl.TEXTURE_CUBE_MAP_NEGATIVE_X: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_X; + case gl.TEXTURE_CUBE_MAP_NEGATIVE_Y: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Y; + case gl.TEXTURE_CUBE_MAP_NEGATIVE_Z: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z; + default: throw new Error('Wrong texture target:' + target); + } + }; + + /** + * @constructor + */ + sglrReferenceContext.Attachment = function() { + /** @type {?sglrReferenceContext.AttachmentType} */ this.type = null; + /** @type {sglrReferenceContext.TextureContainer|sglrReferenceContext.Renderbuffer} */ this.object = null; // TODO: fix reserved word + /** @type {?sglrReferenceContext.TexTarget} */ this.texTarget = null; + /** @type {number} */ this.level = 0; + /** @type {number} */ this.layer = 0; + }; + + /** + * @constructor + */ + sglrReferenceContext.Framebuffer = function() { + /** @type {Array} */ this.m_attachments = []; + for (var key in sglrReferenceContext.AttachmentPoint) + this.m_attachments[sglrReferenceContext.AttachmentPoint[key]] = new sglrReferenceContext.Attachment(); + }; + + /** + * @param {sglrReferenceContext.AttachmentPoint} point + * @return {sglrReferenceContext.Attachment} + */ + sglrReferenceContext.Framebuffer.prototype.getAttachment = function(point) { return this.m_attachments[point]; }; + + /** + * @param {sglrReferenceContext.AttachmentPoint} point + * @param {sglrReferenceContext.Attachment} attachment + */ + sglrReferenceContext.Framebuffer.prototype.setAttachment = function(point, attachment) { this.m_attachments[point] = attachment; }; + + // /** + // * @enum + // */ + // var Format = { + // FORMAT_DEPTH_COMPONENT16: 0, + // FORMAT_RGBA4: 1, + // FORMAT_RGB5_A1: 2, + // FORMAT_RGB565: 3, + // FORMAT_STENCIL_INDEX8: 4 + // }; + + /** + * @constructor + */ + sglrReferenceContext.Renderbuffer = function() { + /** @type {tcuTexture.TextureLevel} */ this.m_data; + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.Renderbuffer.prototype.setStorage = function(format, width, height) { + this.m_data = new tcuTexture.TextureLevel(format, width, height); + }; + + /** + * @return {number} + */ + sglrReferenceContext.Renderbuffer.prototype.getWidth = function() { return this.m_data.getWidth(); }; + + /** + * @return {number} + */ + sglrReferenceContext.Renderbuffer.prototype.getHeight = function() { return this.m_data.getHeight(); }; + + /** + * @return {?tcuTexture.TextureFormat} + */ + sglrReferenceContext.Renderbuffer.prototype.getFormat = function() { return this.m_data.getFormat(); }; + + /** + * @return {tcuTexture.PixelBufferAccess} + */ + sglrReferenceContext.Renderbuffer.prototype.getAccess = function() { return this.m_data.getAccess(); }; + + /** + * @constructor + * @param {number} maxVertexAttribs + */ + sglrReferenceContext.VertexArray = function(maxVertexAttribs) { + /** @type {sglrReferenceContext.DataBuffer} */ this.m_elementArrayBufferBinding = null; + + /** @type {Array} */this.m_arrays = []; + for (var i = 0; i < maxVertexAttribs; i++) + this.m_arrays.push(new sglrReferenceContext.VertexArray.VertexAttribArray()); + }; + + /** @constructor */ + sglrReferenceContext.VertexArray.VertexAttribArray = function() { + this.enabled = false; + this.size = 4; + this.stride = 0; + this.type = gl.FLOAT; + + this.normalized = false; + this.integer = false; + this.divisor = 0; + this.offset = 0; + this.bufferBinding = null; + }; + + /** + * @constructor + */ + sglrReferenceContext.DataBuffer = function() { + /** @type {?ArrayBuffer} */ this.m_data = null; + }; + + /** + * @param {number} size + */ + sglrReferenceContext.DataBuffer.prototype.setStorage = function(size) {this.m_data = new ArrayBuffer(size); }; + + /** + * @return {number} + */ + sglrReferenceContext.DataBuffer.prototype.getSize = function() { + /** @type {number} */ var size = 0; + if (this.m_data) + size = this.m_data.byteLength; + return size; + }; + + /** + * @return {?ArrayBuffer} + */ + sglrReferenceContext.DataBuffer.prototype.getData = function() { return this.m_data; }; + + /** + * @param {ArrayBuffer|goog.NumberArray} data + */ + sglrReferenceContext.DataBuffer.prototype.setData = function(data) { + /** @type {ArrayBuffer} */ var buffer; + /** @type {number} */ var offset = 0; + /** @type {number} */ var byteLength = data.byteLength; + if (data instanceof ArrayBuffer) + buffer = data; + else { + buffer = data.buffer; + offset = data.byteOffset; + } + + if (!buffer) + throw new Error('Invalid buffer'); + + this.m_data = buffer.slice(offset, offset + byteLength); + }; + + /** + * @param {number} offset + * @param {goog.NumberArray} data + */ + sglrReferenceContext.DataBuffer.prototype.setSubData = function(offset, data) { + /** @type {ArrayBuffer} */ var buffer; + /** @type {number} */ var srcOffset = 0; + /** @type {number} */ var byteLength = data.byteLength; + if (data instanceof ArrayBuffer) + buffer = data; + else { + buffer = data.buffer; + srcOffset = data.byteOffset; + } + + if (!buffer) + throw new Error('Invalid buffer'); + + /** @type {goog.NumberArray} */ var src = new Uint8Array(buffer, srcOffset, byteLength); + /** @type {goog.NumberArray} */ var dst = new Uint8Array(this.m_data, offset, byteLength); + dst.set(src); + }; + + // /** + // * @constructor + // */ + // var ObjectManager = function() { + // this.m_objects = {}; + // }; + + // ObjectManager.prototype.insert = function(obj) { + // var name = obj.getName(); + // if (!name) + // throw new Error("Cannot insert unnamed object"); + // this.m_objects[name] = obj; + // }; + + // ObjectManager.prototype.find = function(name) { return this.m_objects[name]; }; + + // ObjectManager.prototype.acquireReference = function(obj) { + // if (this.find(obj.getName()) !== obj) + // throw new Error("Object is not in the object manager"); + // obj.incRefCount(); + // }; + + // ObjectManager.prototype.releaseReference = function(obj) { + // if (this.find(obj.getName()) !== obj) + // throw new Error("Object is not in the object manager"); + + // obj.decRefCount(); + + // if (obj.getRefCount() == 0) + // delete this.m_objects[obj.getName()]; + // }; + + // ObjectManager.prototype.getAll = function() { return this.m_objects; }; + + /** + * @constructor + */ + sglrReferenceContext.TextureUnit = function() { + /** @type {?sglrReferenceContext.TextureContainer} */ this.tex2DBinding = null; + /** @type {?sglrReferenceContext.TextureContainer} */ this.texCubeBinding = null; + /** @type {?sglrReferenceContext.TextureContainer} */ this.tex2DArrayBinding = null; + /** @type {?sglrReferenceContext.TextureContainer} */ this.tex3DBinding = null; + /** @type {?sglrReferenceContext.TextureContainer} */ this.texCubeArrayBinding = null; + }; + + /** + * @constructor + */ + sglrReferenceContext.StencilState = function() { + /** @type {number} */ this.func = gl.ALWAYS; + /** @type {number} */ this.ref = 0; + /** @type {number} */ this.opMask = ~0; + /** @type {number} */ this.opStencilFail = gl.KEEP; + /** @type {number} */ this.opDepthFail = gl.KEEP; + /** @type {number} */ this.opDepthPass = gl.KEEP; + /** @type {number} */ this.writeMask = ~0; + }; + + /** + * @param {tcuPixelFormat.PixelFormat} pixelFmt + * @return {tcuTexture.TextureFormat} + * @throws {Error} + */ + sglrReferenceContext.toTextureFormat = function(pixelFmt) { + if (pixelFmt.equals(8, 8, 8, 8)) + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + else if (pixelFmt.equals(8, 8, 8, 0)) + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8); + else if (pixelFmt.equals(4, 4, 4, 4)) + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_4444); + else if (pixelFmt.equals(5, 5, 5, 1)) + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551); + else if (pixelFmt.equals(5, 6, 5, 0)) + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_SHORT_565); + + throw new Error('Could not map pixel format:' + pixelFmt); + }; + + /** + * @param {number} depthBits + * @return {tcuTexture.TextureFormat} + * @throws {Error} + */ + sglrReferenceContext.getDepthFormat = function(depthBits) { + switch (depthBits) { + case 8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT8); + case 16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT16); + case 24: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT_24_8); + case 32: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.FLOAT); + default: + throw new Error("Can't map depth buffer format, bits: " + depthBits); + } + }; + + /** + * @param {number} stencilBits + * @return {tcuTexture.TextureFormat} + * @throws {Error} + */ + sglrReferenceContext.getStencilFormat = function(stencilBits) { + switch (stencilBits) { + case 8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT8); + case 16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT16); + case 24: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT_24_8); + case 32: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT32); + default: + throw new Error("Can't map stencil buffer format, bits: " + stencilBits); + } + }; + + /** + * @constructor + * @param {tcuPixelFormat.PixelFormat} colorBits + * @param {number} depthBits + * @param {number} stencilBits + * @param {number} width + * @param {number} height + * @param {number=} samples_ + */ + sglrReferenceContext.ReferenceContextBuffers = function(colorBits, depthBits, stencilBits, width, height, samples_) { + if (samples_ === undefined) + samples_ = 1; + + /** @type {number} */ var samples = samples_; + /** @type {tcuTexture.TextureLevel} */ this.m_colorbuffer = new tcuTexture.TextureLevel(sglrReferenceContext.toTextureFormat(colorBits), samples, width, height); + + if (depthBits > 0) + /** @type {tcuTexture.TextureLevel} */ this.m_depthbuffer = new tcuTexture.TextureLevel(sglrReferenceContext.getDepthFormat(depthBits), samples, width, height); + + if (stencilBits > 0) + /** @type {tcuTexture.TextureLevel} */ this.m_stencilbuffer = new tcuTexture.TextureLevel(sglrReferenceContext.getStencilFormat(stencilBits), samples, width, height); + }; + + /** + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContextBuffers.prototype.getColorbuffer = function() { return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(this.m_colorbuffer.getAccess()); }; + + /** + * @return {?rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContextBuffers.prototype.getDepthbuffer = function() { return this.m_depthbuffer !== undefined ? rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(this.m_depthbuffer.getAccess()) : null; }; + + /** + * @return {?rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContextBuffers.prototype.getStencilbuffer = function() { return this.m_stencilbuffer !== undefined ? rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(this.m_stencilbuffer.getAccess()) : null; }; + + /** + * @param {sglrReferenceContext.ReferenceContextLimits} limits + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} colorbuffer + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} depthbuffer + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} stencilbuffer + * @constructor + */ + sglrReferenceContext.ReferenceContext = function(limits, colorbuffer, depthbuffer, stencilbuffer) { + /** @type {sglrReferenceContext.ReferenceContextLimits} */ this.m_limits = limits; + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ this.m_defaultColorbuffer = colorbuffer; + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ this.m_defaultDepthbuffer = depthbuffer; + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ this.m_defaultStencilbuffer = stencilbuffer; + /** @type {Array} */ this.m_viewport = [0, 0, colorbuffer.raw().getHeight(), colorbuffer.raw().getDepth()]; + /** @type {Array} */ this.m_textureUnits = []; + for (var i = 0; i < this.m_limits.maxTextureImageUnits; i++) + this.m_textureUnits.push(new sglrReferenceContext.TextureUnit()); + /** @type {number} */ this.m_activeTexture = 0; + /** @type {number} */ this.m_lastError = gl.NO_ERROR; + // this.m_textures = new ObjectManager(); + /** @type {number} */ this.m_pixelUnpackRowLength = 0; + /** @type {number} */ this.m_pixelUnpackSkipRows = 0; + /** @type {number} */ this.m_pixelUnpackSkipPixels = 0; + /** @type {number} */ this.m_pixelUnpackImageHeight = 0; + /** @type {number} */ this.m_pixelUnpackSkipImages = 0; + /** @type {number} */ this.m_pixelUnpackAlignment = 4; + /** @type {number} */ this.m_pixelPackAlignment = 4; + /** @type {Array} */ this.m_clearColor = [0, 0, 0, 0]; + /** @type {number} */ this.m_clearDepth = 1; + /** @type {number} */ this.m_clearStencil = 0; + /** @type {Array} */ this.m_scissorBox = this.m_viewport; + /** @type {boolean} */ this.m_blendEnabled = false; + /** @type {boolean} */ this.m_scissorEnabled = false; + /** @type {boolean} */ this.m_depthTestEnabled = false; + /** @type {boolean} */ this.m_stencilTestEnabled = false; + /** @type {boolean} */ this.m_polygonOffsetFillEnabled = false; + /** @type {boolean} */ this.m_primitiveRestartFixedIndex = true; //always on + /** @type {boolean} */ this.m_primitiveRestartSettableIndex = true; //always on + /** @type {Array} */ this.m_stencil = []; + for (var type in rrDefs.FaceType) + this.m_stencil[rrDefs.FaceType[type]] = new sglrReferenceContext.StencilState(); + /** @type {number} */ this.m_depthFunc = gl.LESS; + /** @type {number} */ this.m_depthRangeNear = 0; + /** @type {number} */ this.m_depthRangeFar = 1; + /** @type {number} */ this.m_polygonOffsetFactor = 0; + /** @type {number} */ this.m_polygonOffsetUnits = 0; + /** @type {number} */ this.m_blendModeRGB = gl.FUNC_ADD; + /** @type {number} */ this.m_blendModeAlpha = gl.FUNC_ADD; + /** @type {number} */ this.m_blendFactorSrcRGB = gl.ONE; + /** @type {number} */ this.m_blendFactorDstRGB = gl.ZERO; + /** @type {number} */ this.m_blendFactorSrcAlpha = gl.ONE; + /** @type {number} */ this.m_blendFactorDstAlpha = gl.ZERO; + /** @type {Array} */ this.m_blendColor = [0, 0, 0, 0]; + /** @type {boolean} */ this.m_sRGBUpdateEnabled = true; + /** @type {Array} */ this.m_colorMask = [true, true, true, true]; + /** @type {boolean} */ this.m_depthMask = true; + /** @type {sglrReferenceContext.VertexArray} */ this.m_defaultVAO = new sglrReferenceContext.VertexArray(this.m_limits.maxVertexAttribs); + /** @type {sglrReferenceContext.VertexArray} */ this.m_vertexArrayBinding = this.m_defaultVAO; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_arrayBufferBinding = null; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_copyReadBufferBinding = null; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_copyWriteBufferBinding = null; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_drawIndirectBufferBinding = null; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_pixelPackBufferBinding = null; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_pixelUnpackBufferBinding = null; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_transformFeedbackBufferBinding = null; + /** @type {sglrReferenceContext.DataBuffer} */ this.m_uniformBufferBinding = null; + /** @type {sglrReferenceContext.Framebuffer} */ this.m_readFramebufferBinding = null; + /** @type {sglrReferenceContext.Framebuffer} */ this.m_drawFramebufferBinding = null; + /** @type {sglrReferenceContext.Renderbuffer} */ this.m_renderbufferBinding = null; + /** @type {sglrShaderProgram.ShaderProgram} */ this.m_currentProgram = null; + /** @type {Array} */ this.m_currentAttribs = []; + for (var i = 0; i < this.m_limits.maxVertexAttribs; i++) + this.m_currentAttribs.push(new rrGenericVector.GenericVec4()); + /** @type {number} */ this.m_lineWidth = 1; + + /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTex2D = new sglrReferenceContext.TextureContainer(); + this.m_emptyTex2D.init(gl.TEXTURE_2D); + this.m_emptyTex2D.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex2D.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex2D.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST; + this.m_emptyTex2D.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST; + this.m_emptyTex2D.texture.allocLevel(0, new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1); + this.m_emptyTex2D.texture.getLevel(0).setPixel([0, 0, 0, 1], 0, 0); + this.m_emptyTex2D.texture.updateView(); + + /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTexCube = new sglrReferenceContext.TextureContainer(); + this.m_emptyTexCube.init(gl.TEXTURE_CUBE_MAP); + this.m_emptyTexCube.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTexCube.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTexCube.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST; + this.m_emptyTexCube.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST; + + for (var face in tcuTexture.CubeFace) { + this.m_emptyTexCube.texture.allocLevel(0, tcuTexture.CubeFace[face], + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1); + this.m_emptyTexCube.texture.getFace(0, tcuTexture.CubeFace[face]).setPixel([0, 0, 0, 1], 0, 0); + } + this.m_emptyTexCube.texture.updateView(); + + /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTex2DArray = new sglrReferenceContext.TextureContainer(); + this.m_emptyTex2DArray.init(gl.TEXTURE_2D_ARRAY); + this.m_emptyTex2DArray.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex2DArray.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex2DArray.texture.getSampler().wrapR = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex2DArray.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST; + this.m_emptyTex2DArray.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST; + this.m_emptyTex2DArray.texture.allocLevel(0, new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1); + this.m_emptyTex2DArray.texture.getLevel(0).setPixel([0, 0, 0, 1], 0, 0); + this.m_emptyTex2DArray.texture.updateView(); + + /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTex3D = new sglrReferenceContext.TextureContainer(); + this.m_emptyTex3D.init(gl.TEXTURE_3D); + this.m_emptyTex3D.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex3D.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex3D.texture.getSampler().wrapR = tcuTexture.WrapMode.CLAMP_TO_EDGE; + this.m_emptyTex3D.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST; + this.m_emptyTex3D.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST; + this.m_emptyTex3D.texture.allocLevel(0, new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1); + this.m_emptyTex3D.texture.getLevel(0).setPixel([0, 0, 0, 1], 0, 0); + this.m_emptyTex3D.texture.updateView(); + + /** @type {sglrReferenceContext.TextureType} */ this.m_type; + + /** @type {boolean} */ this.m_immutable; + + /** @type {tcuTexture.Sampler} */ this.m_sampler; + /** @type {number} */ this.m_baseLevel; + /** @type {number} */ this.m_maxLevel; + }; + + /** + * @return {number} + */ + sglrReferenceContext.ReferenceContext.prototype.getWidth = function() { return this.m_defaultColorbuffer.raw().getHeight(); }; + + /** + * @return {number} + */ + sglrReferenceContext.ReferenceContext.prototype.getHeight = function() { return this.m_defaultColorbuffer.raw().getDepth(); }; + + /** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.ReferenceContext.prototype.viewport = function(x, y, width, height) { this.m_viewport = [x, y, width, height]; }; + + /** + * @param {number} texture + */ + sglrReferenceContext.ReferenceContext.prototype.activeTexture = function(texture) { + if (deMath.deInBounds32(texture, gl.TEXTURE0, gl.TEXTURE0 + this.m_textureUnits.length)) + this.m_activeTexture = texture - gl.TEXTURE0; + else + this.setError(gl.INVALID_ENUM); + }; + + /** + * @param {number} error + */ + sglrReferenceContext.ReferenceContext.prototype.setError = function(error) { + if (this.m_lastError == gl.NO_ERROR) + this.m_lastError = error; + }; + + /** + * @return {number} error + */ + sglrReferenceContext.ReferenceContext.prototype.getError = function() { + /** @type {number} */ var err = this.m_lastError; + this.m_lastError = gl.NO_ERROR; + return err; + }; + + /** + * @param {boolean} condition + * @param {number} error + */ + sglrReferenceContext.ReferenceContext.prototype.conditionalSetError = function(condition, error) { + if (condition) + this.setError(error); + return condition; + }; + + /** + * @param {number} target + * @param {sglrReferenceContext.TextureContainer} texture + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.bindTexture = function(target, texture) { + /** @type {number} */ var unitNdx = this.m_activeTexture; + + if (this.conditionalSetError((target != gl.TEXTURE_2D && + target != gl.TEXTURE_CUBE_MAP && + target != gl.TEXTURE_2D_ARRAY && + target != gl.TEXTURE_3D), // && + // target != gl.TEXTURE_CUBE_MAP_ARRAY), + gl.INVALID_ENUM)) + return; + + if (!texture) { + // Clear binding. + switch (target) { + case gl.TEXTURE_2D: this.setTex2DBinding(unitNdx, null); break; + case gl.TEXTURE_CUBE_MAP: this.setTexCubeBinding(unitNdx, null); break; + case gl.TEXTURE_2D_ARRAY: this.setTex2DArrayBinding(unitNdx, null); break; + case gl.TEXTURE_3D: this.setTex3DBinding(unitNdx, null); break; + default: + throw new Error('Unrecognized target: ' + target); + } + } else { + if (texture.textureType == null) { + texture.init(target); + } else { + // Validate type. + /** @type {sglrReferenceContext.TextureType} */ var expectedType; + switch (target) { + case gl.TEXTURE_2D: expectedType = sglrReferenceContext.TextureType.TYPE_2D; break; + case gl.TEXTURE_CUBE_MAP: expectedType = sglrReferenceContext.TextureType.TYPE_CUBE_MAP; break; + case gl.TEXTURE_2D_ARRAY: expectedType = sglrReferenceContext.TextureType.TYPE_2D_ARRAY; break; + case gl.TEXTURE_3D: expectedType = sglrReferenceContext.TextureType.TYPE_3D; break; + default: throw new Error('Unrecognized target: ' + target); + } + if (this.conditionalSetError((texture.textureType != expectedType), gl.INVALID_OPERATION)) + return; + } + switch (target) { + case gl.TEXTURE_2D: this.setTex2DBinding(unitNdx, texture); break; + case gl.TEXTURE_CUBE_MAP: this.setTexCubeBinding(unitNdx, texture); break; + case gl.TEXTURE_2D_ARRAY: this.setTex2DArrayBinding(unitNdx, texture); break; + case gl.TEXTURE_3D: this.setTex3DBinding(unitNdx, texture); break; + default: + throw new Error('Unrecognized target: ' + target); + } + } + }; + + /** + * @param {number} unitNdx + * @param {?sglrReferenceContext.TextureContainer} texture + */ + sglrReferenceContext.ReferenceContext.prototype.setTexCubeBinding = function(unitNdx, texture) { + if (this.m_textureUnits[unitNdx].texCubeBinding) { + this.m_textureUnits[unitNdx].texCubeBinding = null; + } + + if (texture) { + this.m_textureUnits[unitNdx].texCubeBinding = texture; + } + }; + + /** + * @param {number} unitNdx + * @param {?sglrReferenceContext.TextureContainer} texture + */ + sglrReferenceContext.ReferenceContext.prototype.setTex2DBinding = function(unitNdx, texture) { + if (this.m_textureUnits[unitNdx].tex2DBinding) { + // this.m_textures.releaseReference(this.m_textureUnits[unitNdx].tex2DBinding); + this.m_textureUnits[unitNdx].tex2DBinding = null; + } + + if (texture) { + // this.m_textures.acquireReference(texture); + this.m_textureUnits[unitNdx].tex2DBinding = texture; + } + }; + + /** + * @param {number} unitNdx + * @param {?sglrReferenceContext.TextureContainer} texture + */ + sglrReferenceContext.ReferenceContext.prototype.setTex2DArrayBinding = function(unitNdx, texture) { + if (this.m_textureUnits[unitNdx].tex2DArrayBinding) { + // this.m_textures.releaseReference(this.m_textureUnits[unitNdx].tex2DArrayBinding); + this.m_textureUnits[unitNdx].tex2DArrayBinding = null; + } + + if (texture) { + // this.m_textures.acquireReference(texture); + this.m_textureUnits[unitNdx].tex2DArrayBinding = texture; + } + }; + + /** + * @param {number} unitNdx + * @param {?sglrReferenceContext.TextureContainer} texture + */ + sglrReferenceContext.ReferenceContext.prototype.setTex3DBinding = function(unitNdx, texture) { + if (this.m_textureUnits[unitNdx].tex3DBinding) { + // this.m_textures.releaseReference(this.m_textureUnits[unitNdx].tex3DBinding); + this.m_textureUnits[unitNdx].tex3DBinding = null; + } + + if (texture) { + // this.m_textures.acquireReference(texture); + this.m_textureUnits[unitNdx].tex3DBinding = texture; + } + }; + + /** + * @return {sglrReferenceContext.TextureContainer} + */ + sglrReferenceContext.ReferenceContext.prototype.createTexture = function() { return new sglrReferenceContext.TextureContainer(); }; + + /** + * @param {sglrReferenceContext.Texture} texture + */ + sglrReferenceContext.ReferenceContext.prototype.deleteTexture = function(texture) { /*empty*/ }; + + /** + * @param {number} target + * @param {framework.opengl.simplereference.sglrReferenceContext.Framebuffer} fbo + */ + sglrReferenceContext.ReferenceContext.prototype.bindFramebuffer = function(target, fbo) { + if (this.conditionalSetError((target != gl.FRAMEBUFFER && + target != gl.DRAW_FRAMEBUFFER && + target != gl.READ_FRAMEBUFFER), gl.INVALID_ENUM)) + return; + for (var ndx = 0; ndx < 2; ndx++) { + /** @type {number} */ var bindingTarget = ndx ? gl.DRAW_FRAMEBUFFER : gl.READ_FRAMEBUFFER; + + if (target != gl.FRAMEBUFFER && target != bindingTarget) + continue; // Doesn't match this target. + + if (ndx) + this.m_drawFramebufferBinding = fbo; + else + this.m_readFramebufferBinding = fbo; + } + }; + + /** + * @return {sglrReferenceContext.Framebuffer} + */ + sglrReferenceContext.ReferenceContext.prototype.createFramebuffer = function() { return new sglrReferenceContext.Framebuffer(); }; + + /** + * @param {sglrReferenceContext.Framebuffer} fbo + */ + sglrReferenceContext.ReferenceContext.prototype.deleteFramebuffer = function(fbo) { /*empty*/ }; + + /** + * @param {number} target + * @param {sglrReferenceContext.Renderbuffer} rbo + */ + sglrReferenceContext.ReferenceContext.prototype.bindRenderbuffer = function(target, rbo) { + if (this.conditionalSetError(target != gl.RENDERBUFFER, gl.INVALID_ENUM)) + return; + + this.m_renderbufferBinding = rbo; + }; + + /** + * @return {sglrReferenceContext.Renderbuffer} + */ + sglrReferenceContext.ReferenceContext.prototype.createRenderbuffer = function() { return new sglrReferenceContext.Renderbuffer(); }; + + /** + * @param {sglrReferenceContext.Renderbuffer} rbo + */ + sglrReferenceContext.ReferenceContext.prototype.deleteRenderbuffer = function(rbo) { /*empty*/ }; + + /** + * @param {number} pname + * @param {number} param + */ + sglrReferenceContext.ReferenceContext.prototype.pixelStorei = function(pname, param) { + switch (pname) { + case gl.UNPACK_ALIGNMENT: + if (this.conditionalSetError((param != 1 && param != 2 && param != 4 && param != 8), gl.INVALID_VALUE)) return; + this.m_pixelUnpackAlignment = param; + break; + + case gl.PACK_ALIGNMENT: + if (this.conditionalSetError((param != 1 && param != 2 && param != 4 && param != 8), gl.INVALID_VALUE)) return; + this.m_pixelPackAlignment = param; + break; + + case gl.UNPACK_ROW_LENGTH: + if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return; + this.m_pixelUnpackRowLength = param; + break; + + case gl.UNPACK_SKIP_ROWS: + if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return; + this.m_pixelUnpackSkipRows = param; + break; + + case gl.UNPACK_SKIP_PIXELS: + if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return; + this.m_pixelUnpackSkipPixels = param; + break; + + case gl.UNPACK_IMAGE_HEIGHT: + if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return; + this.m_pixelUnpackImageHeight = param; + break; + + case gl.UNPACK_SKIP_IMAGES: + if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return; + this.m_pixelUnpackSkipImages = param; + break; + + default: + this.setError(gl.INVALID_ENUM); + } + }; + + /** + * @param {number} red + * @param {number} green + * @param {number} blue + * @param {number} alpha + */ + sglrReferenceContext.ReferenceContext.prototype.clearColor = function(red, green, blue, alpha) { + this.m_clearColor = [deMath.clamp(red, 0, 1), + deMath.clamp(green, 0, 1), + deMath.clamp(blue, 0, 1), + deMath.clamp(alpha, 0, 1)]; + }; + + /** + * @param {number} depth + */ + sglrReferenceContext.ReferenceContext.prototype.clearDepthf = function(depth) { + this.m_clearDepth = deMath.clamp(depth, 0, 1); + }; + + /** + * @param {number} stencil + */ + sglrReferenceContext.ReferenceContext.prototype.clearStencil = function(stencil) { + this.m_clearStencil = stencil; + }; + + /** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.ReferenceContext.prototype.scissor = function(x, y, width, height) { + if (this.conditionalSetError(width < 0 || height < 0, gl.INVALID_VALUE)) + return; + this.m_scissorBox = [x, y, width, height]; + }; + + /** + * @param {number} cap + */ + sglrReferenceContext.ReferenceContext.prototype.enable = function(cap) { + switch (cap) { + case gl.BLEND: this.m_blendEnabled = true; break; + case gl.SCISSOR_TEST: this.m_scissorEnabled = true; break; + case gl.DEPTH_TEST: this.m_depthTestEnabled = true; break; + case gl.STENCIL_TEST: this.m_stencilTestEnabled = true; break; + case gl.POLYGON_OFFSET_FILL: this.m_polygonOffsetFillEnabled = true; break; + + case gl.DITHER: + // Not implemented - just ignored. + break; + + default: + this.setError(gl.INVALID_ENUM); + break; + } + }; + + /** + * @param {number} cap + */ + sglrReferenceContext.ReferenceContext.prototype.disable = function(cap) { + switch (cap) { + case gl.BLEND: this.m_blendEnabled = false; break; + case gl.SCISSOR_TEST: this.m_scissorEnabled = false; break; + case gl.DEPTH_TEST: this.m_depthTestEnabled = false; break; + case gl.STENCIL_TEST: this.m_stencilTestEnabled = false; break; + case gl.POLYGON_OFFSET_FILL: this.m_polygonOffsetFillEnabled = false; break; + + case gl.DITHER: + // Not implemented - just ignored. + break; + + default: + this.setError(gl.INVALID_ENUM); + break; + } + }; + + /** + * @param {number} func + * @param {number} ref + * @param {number} mask + */ + sglrReferenceContext.ReferenceContext.prototype.stencilFunc = function(func, ref, mask) { + this.stencilFuncSeparate(gl.FRONT_AND_BACK, func, ref, mask); + }; + + /** + * @param {number} face + * @param {number} func + * @param {number} ref + * @param {number} mask + */ + sglrReferenceContext.ReferenceContext.prototype.stencilFuncSeparate = function(face, func, ref, mask) { + /** @type {boolean} */ var setFront = face == gl.FRONT || face == gl.FRONT_AND_BACK; + /** @type {boolean} */ var setBack = face == gl.BACK || face == gl.FRONT_AND_BACK; + + if (this.conditionalSetError(!sglrReferenceContext.isValidCompareFunc(func), gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(!setFront && !setBack, gl.INVALID_ENUM)) + return; + + for (var key in rrDefs.FaceType) { + /** @type {number} */ var type = rrDefs.FaceType[key]; + if ((type == rrDefs.FaceType.FACETYPE_FRONT && setFront) || + (type == rrDefs.FaceType.FACETYPE_BACK && setBack)) { + this.m_stencil[type].func = func; + this.m_stencil[type].ref = ref; + this.m_stencil[type].opMask = mask; + } + } + }; + + /** + * @param {number} func + * @return {boolean} + */ + sglrReferenceContext.isValidCompareFunc = function(func) { + switch (func) { + case gl.NEVER: + case gl.LESS: + case gl.LEQUAL: + case gl.GREATER: + case gl.GEQUAL: + case gl.EQUAL: + case gl.NOTEQUAL: + case gl.ALWAYS: + return true; + + default: + return false; + } + }; + + /** + * @param {number} op + * @return {boolean} + */ + sglrReferenceContext.isValidStencilOp = function(op) { + switch (op) { + case gl.KEEP: + case gl.ZERO: + case gl.REPLACE: + case gl.INCR: + case gl.INCR_WRAP: + case gl.DECR: + case gl.DECR_WRAP: + case gl.INVERT: + return true; + + default: + return false; + } + }; + + /** + * @param {number} sfail + * @param {number} dpfail + * @param {number} dppass + */ + sglrReferenceContext.ReferenceContext.prototype.stencilOp = function(sfail, dpfail, dppass) { + this.stencilOpSeparate(gl.FRONT_AND_BACK, sfail, dpfail, dppass); + }; + + /** + * @param {number} face + * @param {number} sfail + * @param {number} dpfail + * @param {number} dppass + */ + sglrReferenceContext.ReferenceContext.prototype.stencilOpSeparate = function(face, sfail, dpfail, dppass) { + /** @type {boolean} */ var setFront = face == gl.FRONT || face == gl.FRONT_AND_BACK; + /** @type {boolean} */ var setBack = face == gl.BACK || face == gl.FRONT_AND_BACK; + + if (this.conditionalSetError((!sglrReferenceContext.isValidStencilOp(sfail) || + !sglrReferenceContext.isValidStencilOp(dpfail) || + !sglrReferenceContext.isValidStencilOp(dppass)), + gl.INVALID_ENUM)) + return; + + if (this.conditionalSetError(!setFront && !setBack, gl.INVALID_ENUM)) + return; + + for (var key in rrDefs.FaceType) { + /** @type {number} */ var type = rrDefs.FaceType[key]; + if ((type == rrDefs.FaceType.FACETYPE_FRONT && setFront) || + (type == rrDefs.FaceType.FACETYPE_BACK && setBack)) { + this.m_stencil[type].opStencilFail = sfail; + this.m_stencil[type].opDepthFail = dpfail; + this.m_stencil[type].opDepthPass = dppass; + } + } + }; + + /** + * @param {number} func + */ + sglrReferenceContext.ReferenceContext.prototype.depthFunc = function(func) { + if (this.conditionalSetError(!sglrReferenceContext.isValidCompareFunc(func), gl.INVALID_ENUM)) + return; + this.m_depthFunc = func; + }; + + /** + * @param {number} n + * @param {number} f + */ + sglrReferenceContext.ReferenceContext.prototype.depthRange = function(n, f) { + this.m_depthRangeNear = deMath.clamp(n, 0, 1); + this.m_depthRangeFar = deMath.clamp(f, 0, 1); + }; + + /** + * @param {number} factor + * @param {number} units + */ + sglrReferenceContext.ReferenceContext.prototype.polygonOffset = function(factor, units) { + this.m_polygonOffsetFactor = factor; + this.m_polygonOffsetUnits = units; + }; + + /** + * @param {number} mode + * @return {boolean} + */ + sglrReferenceContext.isValidBlendEquation = function(mode) { + return mode == gl.FUNC_ADD || + mode == gl.FUNC_SUBTRACT || + mode == gl.FUNC_REVERSE_SUBTRACT || + mode == gl.MIN || + mode == gl.MAX; + }; + + /** + * @param {number} factor + * @return {boolean} + */ + sglrReferenceContext.isValidBlendFactor = function(factor) { + switch (factor) { + case gl.ZERO: + case gl.ONE: + case gl.SRC_COLOR: + case gl.ONE_MINUS_SRC_COLOR: + case gl.DST_COLOR: + case gl.ONE_MINUS_DST_COLOR: + case gl.SRC_ALPHA: + case gl.ONE_MINUS_SRC_ALPHA: + case gl.DST_ALPHA: + case gl.ONE_MINUS_DST_ALPHA: + case gl.CONSTANT_COLOR: + case gl.ONE_MINUS_CONSTANT_COLOR: + case gl.CONSTANT_ALPHA: + case gl.ONE_MINUS_CONSTANT_ALPHA: + case gl.SRC_ALPHA_SATURATE: + return true; + + default: + return false; + } + }; + + /** + * @param {number} mode + */ + sglrReferenceContext.ReferenceContext.prototype.blendEquation = function(mode) { + if (this.conditionalSetError(!sglrReferenceContext.isValidBlendEquation(mode), gl.INVALID_ENUM)) + return; + this.m_blendModeRGB = mode; + this.m_blendModeAlpha = mode; + }; + + /** + * @param {number} modeRGB + * @param {number} modeAlpha + */ + sglrReferenceContext.ReferenceContext.prototype.blendEquationSeparate = function(modeRGB, modeAlpha) { + if (this.conditionalSetError(!sglrReferenceContext.isValidBlendEquation(modeRGB) || + !sglrReferenceContext.isValidBlendEquation(modeAlpha), + gl.INVALID_ENUM)) + return; + + this.m_blendModeRGB = modeRGB; + this.m_blendModeAlpha = modeAlpha; + }; + + /** + * @param {number} src + * @param {number} dst + */ + sglrReferenceContext.ReferenceContext.prototype.blendFunc = function(src, dst) { + if (this.conditionalSetError(!sglrReferenceContext.isValidBlendFactor(src) || + !sglrReferenceContext.isValidBlendFactor(dst), + gl.INVALID_ENUM)) + return; + + this.m_blendFactorSrcRGB = src; + this.m_blendFactorSrcAlpha = src; + this.m_blendFactorDstRGB = dst; + this.m_blendFactorDstAlpha = dst; + }; + + /** + * @param {number} srcRGB + * @param {number} dstRGB + * @param {number} srcAlpha + * @param {number} dstAlpha + */ + sglrReferenceContext.ReferenceContext.prototype.blendFuncSeparate = function(srcRGB, dstRGB, srcAlpha, dstAlpha) { + if (this.conditionalSetError(!sglrReferenceContext.isValidBlendFactor(srcRGB) || + !sglrReferenceContext.isValidBlendFactor(dstRGB) || + !sglrReferenceContext.isValidBlendFactor(srcAlpha) || + !sglrReferenceContext.isValidBlendFactor(dstAlpha), + gl.INVALID_ENUM)) + return; + + this.m_blendFactorSrcRGB = srcRGB; + this.m_blendFactorSrcAlpha = srcAlpha; + this.m_blendFactorDstRGB = dstRGB; + this.m_blendFactorDstAlpha = dstAlpha; + }; + + /** + * @param {number} red + * @param {number} green + * @param {number} blue + * @param {number} alpha + */ + sglrReferenceContext.ReferenceContext.prototype.blendColor = function(red, green, blue, alpha) { + this.m_blendColor = [deMath.clamp(red, 0, 1), + deMath.clamp(green, 0, 1), + deMath.clamp(blue, 0, 1), + deMath.clamp(alpha, 0, 1)]; + }; + + /** + * @param {boolean} r + * @param {boolean} g + * @param {boolean} b + * @param {boolean} a + */ + sglrReferenceContext.ReferenceContext.prototype.colorMask = function(r, g, b, a) { + this.m_colorMask = [r, g, b, a]; + }; + + /** + * @param {boolean} mask + */ + sglrReferenceContext.ReferenceContext.prototype.depthMask = function(mask) { + this.m_depthMask = mask; + }; + + /** + * @param {number} mask + */ + sglrReferenceContext.ReferenceContext.prototype.stencilMask = function(mask) { + this.stencilMaskSeparate(gl.FRONT_AND_BACK, mask); + }; + + /** + * @param {number} face + * @param {number} mask + */ + sglrReferenceContext.ReferenceContext.prototype.stencilMaskSeparate = function(face, mask) { + /** @type {boolean} */ var setFront = face == gl.FRONT || face == gl.FRONT_AND_BACK; + /** @type {boolean} */ var setBack = face == gl.BACK || face == gl.FRONT_AND_BACK; + + if (this.conditionalSetError(!setFront && !setBack, gl.INVALID_ENUM)) + return; + + if (setFront) this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask = mask; + if (setBack) this.m_stencil[rrDefs.FaceType.FACETYPE_BACK].writeMask = mask; + }; + + /** + * @param {sglrReferenceContext.VertexArray} array + */ + sglrReferenceContext.ReferenceContext.prototype.bindVertexArray = function(array) { + if (array) + this.m_vertexArrayBinding = array; + else + this.m_vertexArrayBinding = this.m_defaultVAO; + }; + + /** + * @return {sglrReferenceContext.VertexArray} + */ + sglrReferenceContext.ReferenceContext.prototype.createVertexArray = function() { return new sglrReferenceContext.VertexArray(this.m_limits.maxVertexAttribs); }; + + /** + * @param {number} array + */ + sglrReferenceContext.ReferenceContext.prototype.deleteVertexArray = function(array) {}; + + /** + * @param {number} index + * @param {number} rawSize + * @param {number} type + * @param {boolean} normalized + * @param {number} stride + * @param {number} offset + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttribPointer = function(index, rawSize, type, normalized, stride, offset) { + /** @type {boolean} */ var allowBGRA = false; + /** @type {number} */ var effectiveSize = rawSize; + + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(effectiveSize <= 0 || effectiveSize > 4, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(type != gl.BYTE && type != gl.UNSIGNED_BYTE && + type != gl.SHORT && type != gl.UNSIGNED_SHORT && + type != gl.INT && type != gl.UNSIGNED_INT && + type != gl.FLOAT && type != gl.HALF_FLOAT && + type != gl.INT_2_10_10_10_REV && type != gl.UNSIGNED_INT_2_10_10_10_REV, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(normalized != true && normalized != false, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(stride < 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError((type == gl.INT_2_10_10_10_REV || type == gl.UNSIGNED_INT_2_10_10_10_REV) && effectiveSize != 4, gl.INVALID_OPERATION)) + return; + if (this.conditionalSetError(this.m_vertexArrayBinding != null && this.m_arrayBufferBinding == null && offset != 0, gl.INVALID_OPERATION)) + return; + + /** @type {?(sglrReferenceContext.VertexArray.VertexAttribArray)} */ var array_ = this.m_vertexArrayBinding.m_arrays[index]; // TODO: fix type + + array_.size = rawSize; + array_.stride = stride; + array_.type = type; + array_.normalized = normalized; + array_.integer = false; + array_.offset = offset; + + array_.bufferBinding = this.m_arrayBufferBinding; + }; + + /** + * @param {number} index + * @param {number} size + * @param {number} type + * @param {number} stride + * @param {number} offset + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttribIPointer = function(index, size, type, stride, offset) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(size <= 0 || size > 4, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(type != gl.BYTE && type != gl.UNSIGNED_BYTE && + type != gl.SHORT && type != gl.UNSIGNED_SHORT && + type != gl.INT && type != gl.UNSIGNED_INT, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(stride < 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(this.m_vertexArrayBinding != null && this.m_arrayBufferBinding == null && offset != 0, gl.INVALID_OPERATION)) + return; + + /** @type {?(sglrReferenceContext.VertexArray.VertexAttribArray)} */ var array_ = this.m_vertexArrayBinding.m_arrays[index]; // TODO: fix type + + array_.size = size; + array_.stride = stride; + array_.type = type; + array_.normalized = false; + array_.integer = true; + array_.offset = offset; + + array_.bufferBinding = this.m_arrayBufferBinding; + }; + + /** + * @param {number} index + */ + sglrReferenceContext.ReferenceContext.prototype.enableVertexAttribArray = function(index) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_vertexArrayBinding.m_arrays[index].enabled = true; + }; + + /** + * @param {number} index + */ + sglrReferenceContext.ReferenceContext.prototype.disableVertexAttribArray = function(index) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_vertexArrayBinding.m_arrays[index].enabled = false; + }; + + /** + * @param {number} index + * @param {number} divisor + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttribDivisor = function(index, divisor) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_vertexArrayBinding.m_arrays[index].divisor = divisor; + }; + + /** + * @param {number} index + * @param {number} x + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttrib1f = function(index, x) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, 0, 0, 1); + }; + + /** + * @param {number} index + * @param {number} x + * @param {number} y + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttrib2f = function(index, x, y) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, 0, 1); + }; + + /** + * @param {number} index + * @param {number} x + * @param {number} y + * @param {number} z + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttrib3f = function(index, x, y, z) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, 1); + }; + + /** + * @param {number} index + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttrib4f = function(index, x, y, z, w) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, w); + }; + + /** + * @param {number} index + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttribI4i = function(index, x, y, z, w) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, w); + }; + + /** + * @param {number} index + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ + sglrReferenceContext.ReferenceContext.prototype.vertexAttribI4ui = function(index, x, y, z, w) { + if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE)) + return; + + this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, w); + }; + + /** + * @param {sglrShaderProgram.ShaderProgram} program + * @param {string} name + * @return {number} + */ + sglrReferenceContext.ReferenceContext.prototype.getAttribLocation = function(program, name) { + if (this.conditionalSetError(!(program), gl.INVALID_OPERATION)) + return -1; + + for (var i = 0; i < program.m_attributeNames.length; i++) + if (program.m_attributeNames[i] === name) + return i; + + return -1; + }; + + /** + * @param {number} pname + */ + sglrReferenceContext.ReferenceContext.prototype.getParameter = function(pname) { + switch (pname) { + case (gl.VIEWPORT): return new Int32Array(this.m_viewport); + case (gl.SCISSOR_BOX): return new Int32Array(this.m_scissorBox); + default: + throw new Error('Unimplemented'); + } + }; + + /** + * @param {number} location + * @param {gluShaderUtil.DataType} type + * @param {Array} value + */ + sglrReferenceContext.ReferenceContext.prototype.uniformValue = function(location, type, value) { + if (this.conditionalSetError(!this.m_currentProgram, gl.INVALID_OPERATION)) + return; + + if (location === null) + return; + + /** @type {sglrShaderProgram.Uniform} */ var uniform = this.m_currentProgram.m_uniforms[location]; + + if (this.conditionalSetError(!uniform, gl.INVALID_OPERATION)) + return; + + if (gluShaderUtil.isDataTypeSampler(uniform.type)) { + if (this.conditionalSetError(type != gluShaderUtil.DataType.INT, gl.INVALID_OPERATION)) + return; + } else if (this.conditionalSetError(uniform.type != type, gl.INVALID_OPERATION)) + return; + /* TODO: Do we need to copy objects? */ + uniform.value = value; + }; + + /** + * @param {number} location + * @param {number} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform1f = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT, [x]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform1fv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT, x); + }; + + /** + * @param {number} location + * @param {number} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform1i = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.INT, [x]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform1iv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.INT, x); + }; + + /** + * @param {number} location + * @param {number} x + * @param {number} y + */ + sglrReferenceContext.ReferenceContext.prototype.uniform2f = function(location, x, y) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC2, [x, y]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform2fv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC2, x); + }; + + /** + * @param {number} location + * @param {number} x + * @param {number} y + */ + sglrReferenceContext.ReferenceContext.prototype.uniform2i = function(location, x, y) { + return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC2, [x, y]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform2iv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC2, x); + }; + + /** + * @param {number} location + * @param {number} x + * @param {number} y + * @param {number} z + */ + sglrReferenceContext.ReferenceContext.prototype.uniform3f = function(location, x, y, z) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC3, [x, y, z]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform3fv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC3, x); + }; + + /** + * @param {number} location + * @param {number} x + * @param {number} y + * @param {number} z + */ + sglrReferenceContext.ReferenceContext.prototype.uniform3i = function(location, x, y, z) { + return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC3, [x, y, z]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform3iv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC3, x); + }; + + /** + * @param {number} location + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ + sglrReferenceContext.ReferenceContext.prototype.uniform4f = function(location, x, y, z, w) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC4, [x, y, z, w]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform4fv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC4, x); + }; + + /** + * @param {number} location + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ + sglrReferenceContext.ReferenceContext.prototype.uniform4i = function(location, x, y, z, w) { + return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC4, [x, y, z, w]); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniform4iv = function(location, x) { + return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC4, x); + }; + + /** + * @return {Array} + */ + sglrReferenceContext.ReferenceContext.prototype.getSupportedExtensions = function() { + var extensions = gl.getSupportedExtensions(); //TODO: Let's just return gl's supported extensions for now + return extensions; + }; + + /** + * @param {string} name + * @return {*} + */ + sglrReferenceContext.ReferenceContext.prototype.getExtension = function(name) { + return gl.getExtension(name); //TODO: Let's just return gl's supported extensions for now + }; + + /** transpose matrix 'x' of 'size' columns and rows + * @param {number} size + * @param {Array} x + * @return {Array} + */ + sglrReferenceContext.trans = function(size, x) { + /** @type {Array} */ var result = []; + for (var row = 0; row < size; ++row) + for (var col = 0; col < size; ++col) + result[row * size + col] = x[col * size + row]; + + return result; + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniformMatrix2fv = function(location, transpose, x) { + /* change from column-major to internal row-major if transpose if FALSE */ + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_MAT2, !transpose ? sglrReferenceContext.trans(2, x) : x); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniformMatrix3fv = function(location, transpose, x) { + /* change from column-major to internal row-major if transpose if FALSE */ + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_MAT3, !transpose ? sglrReferenceContext.trans(3, x) : x); + }; + + /** + * @param {number} location + * @param {Array} x + */ + sglrReferenceContext.ReferenceContext.prototype.uniformMatrix4fv = function(location, transpose, x) { + /* change from column-major to internal row-major if transpose if FALSE */ + return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_MAT4, !transpose ? sglrReferenceContext.trans(4, x) : x); + }; + + /** + * @param {sglrShaderProgram.ShaderProgram} program + * @param {string} name + * @return {number} + */ + sglrReferenceContext.ReferenceContext.prototype.getUniformLocation = function(program, name) { + if (this.conditionalSetError(!program, gl.INVALID_OPERATION)) + return -1; + + for (var i = 0; i < program.m_uniforms.length; i++) + if (program.m_uniforms[i].name === name) + return i; + + return -1; + }; + + /** + * @param {number} w + */ + sglrReferenceContext.ReferenceContext.prototype.lineWidth = function(w) { + if (this.conditionalSetError(w < 0, gl.INVALID_VALUE)) + return; + this.m_lineWidth = w; + }; + + /** + * @param {number} target + * @return {boolean} + */ + sglrReferenceContext.isValidBufferTarget = function(target) { + switch (target) { + case gl.ARRAY_BUFFER: + case gl.COPY_READ_BUFFER: + case gl.COPY_WRITE_BUFFER: + case gl.ELEMENT_ARRAY_BUFFER: + case gl.PIXEL_PACK_BUFFER: + case gl.PIXEL_UNPACK_BUFFER: + case gl.TRANSFORM_FEEDBACK_BUFFER: + case gl.UNIFORM_BUFFER: + return true; + + default: + return false; + } + }; + + /** + * @param {number} target + * @param {sglrReferenceContext.DataBuffer} buffer + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.setBufferBinding = function(target, buffer) { + switch (target) { + case gl.ARRAY_BUFFER: this.m_arrayBufferBinding = buffer; break; + case gl.COPY_READ_BUFFER: this.m_copyReadBufferBinding = buffer; break; + case gl.COPY_WRITE_BUFFER: this.m_copyWriteBufferBinding = buffer; break; + case gl.ELEMENT_ARRAY_BUFFER: this.m_vertexArrayBinding.m_elementArrayBufferBinding = buffer; break; + case gl.PIXEL_PACK_BUFFER: this.m_pixelPackBufferBinding = buffer; break; + case gl.PIXEL_UNPACK_BUFFER: this.m_pixelUnpackBufferBinding = buffer; break; + case gl.TRANSFORM_FEEDBACK_BUFFER: this.m_transformFeedbackBufferBinding = buffer; break; + case gl.UNIFORM_BUFFER: this.m_uniformBufferBinding = buffer; break; + default: + throw new Error('Unrecognized target: ' + target); + } + }; + + /** + * @param {number} target + * @return {sglrReferenceContext.DataBuffer} + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.getBufferBinding = function(target) { + switch (target) { + case gl.ARRAY_BUFFER: return this.m_arrayBufferBinding; + case gl.COPY_READ_BUFFER: return this.m_copyReadBufferBinding; + case gl.COPY_WRITE_BUFFER: return this.m_copyWriteBufferBinding; + case gl.ELEMENT_ARRAY_BUFFER: return this.m_vertexArrayBinding.m_elementArrayBufferBinding; + case gl.PIXEL_PACK_BUFFER: return this.m_pixelPackBufferBinding; + case gl.PIXEL_UNPACK_BUFFER: return this.m_pixelUnpackBufferBinding; + case gl.TRANSFORM_FEEDBACK_BUFFER: return this.m_transformFeedbackBufferBinding; + case gl.UNIFORM_BUFFER: return this.m_uniformBufferBinding; + default: + throw new Error('Unrecognized target: ' + target); + } + }; + + /** + * @param {number} target + * @param {sglrReferenceContext.DataBuffer} buffer + */ + sglrReferenceContext.ReferenceContext.prototype.bindBuffer = function(target, buffer) { + if (this.conditionalSetError(!sglrReferenceContext.isValidBufferTarget(target), gl.INVALID_ENUM)) + return; + + this.setBufferBinding(target, buffer); + }; + + /** + * @return {sglrReferenceContext.DataBuffer} + */ + sglrReferenceContext.ReferenceContext.prototype.createBuffer = function() { return new sglrReferenceContext.DataBuffer(); }; + + /** + * @param {number} buffer + */ + sglrReferenceContext.ReferenceContext.prototype.deleteBuffer = function(buffer) {}; + + /** + * @param {number} target + * @param {number|goog.NumberArray} input + * @param {number} usage + */ + sglrReferenceContext.ReferenceContext.prototype.bufferData = function(target, input, usage) { + if (this.conditionalSetError(!sglrReferenceContext.isValidBufferTarget(target), gl.INVALID_ENUM)) + return; + /** @type {sglrReferenceContext.DataBuffer} */ var buffer = this.getBufferBinding(target); + if (this.conditionalSetError(!buffer, gl.INVALID_OPERATION)) + return; + + if (typeof input == 'number') { + if (this.conditionalSetError(input < 0, gl.INVALID_VALUE)) + return; + buffer.setStorage(input); + } else { + buffer.setData(input); + } + }; + + /** + * @param {number} target + * @param {number} offset + * @param {goog.NumberArray} data + */ + sglrReferenceContext.ReferenceContext.prototype.bufferSubData = function(target, offset, data) { + if (this.conditionalSetError(!sglrReferenceContext.isValidBufferTarget(target), gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(offset < 0, gl.INVALID_VALUE)) + return; + /** @type {sglrReferenceContext.DataBuffer} */ var buffer = this.getBufferBinding(target); + if (this.conditionalSetError(!buffer, gl.INVALID_OPERATION)) + return; + + if (this.conditionalSetError(offset + data.byteLength > buffer.getSize(), gl.INVALID_VALUE)) + return; + buffer.setSubData(offset, data); + }; + + /** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} format + * @param {number} type + * @param {goog.NumberArray} pixels + */ + sglrReferenceContext.ReferenceContext.prototype.readPixels = function(x, y, width, height, format, type, pixels) { + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src = this.getReadColorbuffer(); + + // Map transfer format. + /** @type {tcuTexture.TextureFormat} */ var transferFmt = gluTextureUtil.mapGLTransferFormat(format, type); + + // Clamp input values + /** @type {number} */ var copyX = deMath.clamp(x, 0, src.raw().getHeight()); + /** @type {number} */ var copyY = deMath.clamp(y, 0, src.raw().getDepth()); + /** @type {number} */ var copyWidth = deMath.clamp(width, 0, src.raw().getHeight() - x); + /** @type {number} */ var copyHeight = deMath.clamp(height, 0, src.raw().getDepth() - y); + + /** @type {?ArrayBuffer} */ var data; + /** @type {number} */ var offset; + if (this.m_pixelPackBufferBinding) { + if (this.conditionalSetError(typeof pixels !== 'number', gl.INVALID_VALUE)) + return; + data = this.m_pixelPackBufferBinding.getData(); + offset = pixels.byteOffset; + } else { + if (pixels instanceof ArrayBuffer) { + data = pixels; + offset = 0; + } else { + data = pixels.buffer; + offset = pixels.byteOffset; + } + } + + /** @type {tcuTexture.PixelBufferAccess} */ + var dst = new tcuTexture.PixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + depth: 1, + rowPitch: deMath.deAlign32(width * transferFmt.getPixelSize(), this.m_pixelPackAlignment), + slicePitch: 0, + data: data, + offset: offset}); + + src = src.getSubregion([copyX, copyY, copyWidth, copyHeight]); + src.resolveMultisampleColorBuffer(tcuTextureUtil.getSubregion(dst, 0, 0, 0, copyWidth, copyHeight, 1)); + }; + + /** + * @return {number} + */ + sglrReferenceContext.ReferenceContext.prototype.getType = function() { + return this.m_type; + }; + + /** + * @return {tcuTexture.PixelBufferAccess} + */ + sglrReferenceContext.nullAccess = function() { + return new tcuTexture.PixelBufferAccess({ + width: 0, + height: 0}); + }; + + /** + * @param {sglrReferenceContext.Framebuffer} framebuffer + * @param {sglrReferenceContext.AttachmentPoint} point + * @return {tcuTexture.PixelBufferAccess} + */ + sglrReferenceContext.ReferenceContext.prototype.getFboAttachment = function(framebuffer, point) { + /** @type {sglrReferenceContext.Attachment} */ var attachment = framebuffer.getAttachment(point); + + switch (attachment.type) { + case sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE: { + var container = /** @type {sglrReferenceContext.TextureContainer} */ (attachment.object); + /** @type {?sglrReferenceContext.TextureType} */ var type = container.getType(); + var texture = container.texture; + + if (type == sglrReferenceContext.TextureType.TYPE_2D) + return texture.getLevel(attachment.level); + else if (type == sglrReferenceContext.TextureType.TYPE_CUBE_MAP) + return texture.getFace(attachment.level, sglrReferenceContext.texTargetToFace(attachment.texTarget)); + else if (type == sglrReferenceContext.TextureType.TYPE_2D_ARRAY || + type == sglrReferenceContext.TextureType.TYPE_3D || + type == sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY) { + /** @type {tcuTexture.PixelBufferAccess} */ var level = texture.getLevel(attachment.level); + + return new tcuTexture.PixelBufferAccess({ + format: level.getFormat(), + width: level.getWidth(), + height: level.getHeight(), + depth: 1, + rowPitch: level.getRowPitch(), + slicePitch: 0, + data: level.getBuffer(), + offset: level.getSlicePitch() * attachment.layer}); + } else + return sglrReferenceContext.nullAccess(); + } + + case sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_RENDERBUFFER: { + var rbo = /** @type {sglrReferenceContext.Renderbuffer} */ (attachment.object); + return rbo.getAccess(); + } + + default: + return sglrReferenceContext.nullAccess(); + } + }; + + /** + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContext.prototype.getReadColorbuffer = function() { + if (this.m_readFramebufferBinding) + return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_readFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0)); + else + return this.m_defaultColorbuffer; + }; + + // sglrReferenceContext.ReferenceContext.prototype.drawArrays = function(mode, first, count) { + // this.drawArraysInstanced(mode, first, count, 1); + // }; + + /** + * @param {number} target + * @return {number} + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.checkFramebufferStatus = function(target) { + if (this.conditionalSetError(target != gl.FRAMEBUFFER && + target != gl.DRAW_FRAMEBUFFER && + target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM)) + return 0; + + // Select binding point. + /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding; + + // Default framebuffer is always complete. + if (!framebufferBinding) + return gl.FRAMEBUFFER_COMPLETE; + + /** @type {number} */ var width = -1; + /** @type {number} */ var height = -1; + /** @type {boolean} */ var hasAttachment = false; + /** @type {boolean} */ var attachmentComplete = true; + /** @type {boolean} */ var dimensionsOk = true; + + for (var key in sglrReferenceContext.AttachmentPoint) { + /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.AttachmentPoint[key]; + /** @type {sglrReferenceContext.Attachment} */ var attachment = framebufferBinding.getAttachment(point); + /** @type {number} */ var attachmentWidth = 0; + /** @type {number} */ var attachmentHeight = 0; + /** @type {tcuTexture.TextureFormat} */ var attachmentFormat; + + if (attachment.type == sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE) { + var container = /** @type {sglrReferenceContext.TextureContainer} */ (attachment.object); + /** @type {tcuTexture.ConstPixelBufferAccess} */ var level; + + if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_2D) { + DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_2D); + /** @type {sglrReferenceContext.Texture2D} */ var tex2D = /** @type {sglrReferenceContext.Texture2D} */ (container.texture); + + if (tex2D.hasLevel(attachment.level)) + level = tex2D.getLevel(attachment.level); + // TODO: implement CUBE_MAP, 2D_ARRAY, 3D, CUBE_MAP_ARRAY + } else if (deMath.deInRange32(attachment.texTarget, sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X, + sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z)) { + DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_CUBE_MAP); + + var texCube = /** @type {sglrReferenceContext.TextureCube} */ (container.texture); + var face = sglrReferenceContext.texTargetToFace(attachment.texTarget); + + if (texCube.hasFace(attachment.level, face)) + level = texCube.getFace(attachment.level, face); + } else if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_2D_ARRAY) { + DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_2D_ARRAY); + var tex2DArr = /** @type {sglrReferenceContext.Texture2DArray} */ (container.texture); + + if (tex2DArr.hasLevel(attachment.level)) + level = tex2DArr.getLevel(attachment.level); // \note Slice doesn't matter here. + } else if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_3D) { + DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_3D); + var tex3D = /** @type {sglrReferenceContext.Texture3D} */ (container.texture); + + if (tex3D.hasLevel(attachment.level)) + level = tex3D.getLevel(attachment.level); // \note Slice doesn't matter here. + // } else if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_ARRAY) { + // DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY); + // var texCubeArr = container.texture; + // + // if (texCubeArr.hasLevel(attachment.level)) + // level = texCubeArr.getLevel(attachment.level); // \note Slice doesn't matter here. + } else + throw new Error('sglrReferenceContext.Framebuffer attached to a texture but no valid target specified.'); + + attachmentWidth = level.getWidth(); + attachmentHeight = level.getHeight(); + attachmentFormat = level.getFormat(); + } else if (attachment.type == sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_RENDERBUFFER) { + var renderbuffer = attachment.object; + + attachmentWidth = renderbuffer.getWidth(); + attachmentHeight = renderbuffer.getHeight(); + attachmentFormat = renderbuffer.getFormat(); + } else + continue; // Skip rest of checks. + + if (!hasAttachment && attachmentWidth > 0 && attachmentHeight > 0) { + width = attachmentWidth; + height = attachmentHeight; + hasAttachment = true; + } else if (attachmentWidth != width || attachmentHeight != height) + dimensionsOk = false; + + // Validate attachment point compatibility. + switch (attachmentFormat.order) { + case tcuTexture.ChannelOrder.R: + case tcuTexture.ChannelOrder.RG: + case tcuTexture.ChannelOrder.RGB: + case tcuTexture.ChannelOrder.RGBA: + case tcuTexture.ChannelOrder.sRGB: + case tcuTexture.ChannelOrder.sRGBA: + if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0) + attachmentComplete = false; + break; + + case tcuTexture.ChannelOrder.D: + if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH) + attachmentComplete = false; + break; + + case tcuTexture.ChannelOrder.S: + if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL) + attachmentComplete = false; + break; + + case tcuTexture.ChannelOrder.DS: + if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH && + point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL) + attachmentComplete = false; + break; + + default: + throw new Error('Unsupported attachment channel order:' + attachmentFormat.order); + } + } + + if (!attachmentComplete) + return gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT; + else if (!hasAttachment) + return gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; + else if (!dimensionsOk) + return gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS; + else + return gl.FRAMEBUFFER_COMPLETE; + }; + + /** + * @param {number} mode + * @return {boolean} + */ + sglrReferenceContext.ReferenceContext.prototype.predrawErrorChecks = function(mode) { + if (this.conditionalSetError(mode != gl.POINTS && + mode != gl.LINE_STRIP && mode != gl.LINE_LOOP && mode != gl.LINES && + mode != gl.TRIANGLE_STRIP && mode != gl.TRIANGLE_FAN && mode != gl.TRIANGLES, + gl.INVALID_ENUM)) + return false; + + // \todo [jarkko] Uncomment following code when the buffer mapping support is added + //for (size_t ndx = 0; ndx < vao.m_arrays.length; ++ndx) + // if (vao.m_arrays[ndx].enabled && vao.m_arrays[ndx].bufferBinding && vao.m_arrays[ndx].bufferBinding->isMapped) + // RC_ERROR_RET(gl.INVALID_OPERATION, RC_RET_VOID); + + if (this.conditionalSetError(this.checkFramebufferStatus(gl.DRAW_FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE, gl.INVALID_FRAMEBUFFER_OPERATION)) + return false; + + return true; + }; + + /** + * Draws quads from vertex arrays + * @param {number} mode GL primitive type to draw with. + * @param {number} first First vertex to begin drawing with + * @param {number} count How many vertices to draw (not counting vertices before first) + * @param {number} instanceCount + */ + sglrReferenceContext.ReferenceContext.prototype.drawArraysInstanced = function(mode, first, count, instanceCount) { + if (this.conditionalSetError(first < 0 || count < 0 || instanceCount < 0, gl.INVALID_VALUE)) + return; + + if (!this.predrawErrorChecks(mode)) + return; + + // All is ok + this.drawQuads(mode, first, count, instanceCount); + }; + + /** + * @param {number} mode GL primitive type to draw with. + * @param {number} start + * @param {number} end + * @param {number} count How many vertices to draw (not counting vertices before first) + * @param {number} type Data type + * @param {number} offset + */ + sglrReferenceContext.ReferenceContext.prototype.drawRangeElements = function(mode, start, end, count, type, offset) { + if (this.conditionalSetError(end < start, gl.INVALID_VALUE)) + return; + + this.drawElements(mode, count, type, offset); + }; + + /** + * @param {number} mode GL primitive type to draw with. + * @param {number} count How many vertices to draw (not counting vertices before first) + * @param {number} type Data type + * @param {number} offset + */ + sglrReferenceContext.ReferenceContext.prototype.drawElements = function(mode, count, type, offset) { + this.drawElementsInstanced(mode, count, type, offset, 1); + }; + + /** + * @param {number} mode GL primitive type to draw with. + * @param {number} count How many vertices to draw (not counting vertices before first) + * @param {number} type Data type + * @param {number} offset + * @param {number} instanceCount + */ + sglrReferenceContext.ReferenceContext.prototype.drawElementsInstanced = function(mode, count, type, offset, instanceCount) { + this.drawElementsInstancedBaseVertex(mode, count, type, offset, instanceCount, 0); + }; + + /** + * @param {number} mode GL primitive type to draw with. + * @param {number} count How many vertices to draw (not counting vertices before first) + * @param {number} type Data type + * @param {number} offset + * @param {number} instanceCount + * @param {number} baseVertex + */ + sglrReferenceContext.ReferenceContext.prototype.drawElementsInstancedBaseVertex = function(mode, count, type, offset, instanceCount, baseVertex) { + var vao = this.m_vertexArrayBinding; + + if (this.conditionalSetError(type != gl.UNSIGNED_BYTE && + type != gl.UNSIGNED_SHORT && + type != gl.UNSIGNED_INT, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(count < 0 || instanceCount < 0, gl.INVALID_VALUE)) + return; + + if (!this.predrawErrorChecks(mode)) + return; + + if (this.conditionalSetError(count > 0 && !vao.m_elementArrayBufferBinding, gl.INVALID_OPERATION)) + return; + // All is ok + var data = vao.m_elementArrayBufferBinding.getData(); + var indices = new rrRenderer.DrawIndices(data, sglrReferenceUtils.mapGLIndexType(type), offset, baseVertex); + + this.drawQuads(mode, indices, count, instanceCount); + }; + + /** + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} access + * @return {Array} + */ + sglrReferenceContext.getBufferRect = function(access) { return [0, 0, access.raw().getHeight(), access.raw().getDepth()]; }; + + /** + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContext.prototype.getDrawColorbuffer = function() { + if (this.m_drawFramebufferBinding) + return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_drawFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0)); + return this.m_defaultColorbuffer; + }; + + /** + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContext.prototype.getDrawDepthbuffer = function() { + if (this.m_drawFramebufferBinding) + return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_drawFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH)); + return this.m_defaultDepthbuffer; + }; + + /** + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContext.prototype.getDrawStencilbuffer = function() { + if (this.m_drawFramebufferBinding) + return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_drawFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL)); + return this.m_defaultStencilbuffer; + }; + + /** + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContext.prototype.getReadDepthbuffer = function() { + if (this.m_readFramebufferBinding) + return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_readFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH)); + return this.m_defaultDepthbuffer; + }; + + /** + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ + sglrReferenceContext.ReferenceContext.prototype.getReadStencilbuffer = function() { + if (this.m_readFramebufferBinding) + return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_readFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL)); + return this.m_defaultStencilbuffer; + }; + + /** + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} access + * @param {number} s + * @param {number} x + * @param {number} y + * @param {number} depth + */ + sglrReferenceContext.writeDepthOnly = function(access, s, x, y, depth) { access.raw().setPixDepth(depth, s, x, y); }; + + /** + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} access + * @param {number} s + * @param {number} x + * @param {number} y + * @param {number} stencil + * @param {number} writeMask + */ + sglrReferenceContext.writeStencilOnly = function(access, s, x, y, stencil, writeMask) { + /** @type {number} */ var oldVal = access.raw().getPixelInt(s, x, y)[3]; + access.raw().setPixStencil((oldVal & ~writeMask) | (stencil & writeMask), s, x, y); + }; + + /** + * @param {number} bits + * @param {number} s + * @return {number} + */ + sglrReferenceContext.maskStencil = function(bits, s) { return s & ((1 << bits) - 1); }; + + /** + * @param {number} buffers + */ + sglrReferenceContext.ReferenceContext.prototype.clear = function(buffers) { + if (this.conditionalSetError((buffers & ~(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) != 0, gl.INVALID_VALUE)) + return; + + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf0 = this.getDrawColorbuffer(); + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var depthBuf = this.getDrawDepthbuffer(); + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var stencilBuf = this.getDrawStencilbuffer(); + /** @type {boolean} */ var hasColor0 = /** @type {!boolean} */ (colorBuf0 && !colorBuf0.isEmpty()); + /** @type {boolean} */ var hasDepth = /** @type {!boolean} */ (depthBuf && !depthBuf.isEmpty()); + /** @type {boolean} */ var hasStencil = /** @type {!boolean} */ (stencilBuf && !stencilBuf.isEmpty()); + /** @type {Array} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff]; + + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access; + /** @type {boolean} */ var isSharedDepthStencil; + + if (hasColor0 && (buffers & gl.COLOR_BUFFER_BIT) != 0) { + /** @type {Array} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf0)); + access = colorBuf0.getSubregion(colorArea); + /** @type {boolean} */ var isSRGB = colorBuf0.raw().getFormat().isSRGB(); + /** @type {Array} */ var c = (isSRGB && this.m_sRGBUpdateEnabled) ? tcuTextureUtil.linearToSRGB(this.m_clearColor) : this.m_clearColor; + /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3]; + /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3]; + + if (!maskUsed) + access.clear(c); + else if (!maskZero) { + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + access.raw().setPixel(tcuTextureUtil.select(c, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y); + } + // else all channels masked out + } + + if (hasDepth && (buffers & gl.DEPTH_BUFFER_BIT) != 0 && this.m_depthMask) { + /** @type {Array} */ var depthArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(depthBuf)); + access = depthBuf.getSubregion(depthArea); + isSharedDepthStencil = depthBuf.raw().getFormat().order != tcuTexture.ChannelOrder.D; + + if (isSharedDepthStencil) { + // Slow path where stencil is masked out in write. + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + sglrReferenceContext.writeDepthOnly(access, s, x, y, this.m_clearDepth); + } else + access.clear([this.m_clearDepth, 0, 0, 0]); + } + + if (hasStencil && (buffers & gl.STENCIL_BUFFER_BIT) != 0) { + /** @type {Array} */ var stencilArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(stencilBuf)); + access = stencilBuf.getSubregion(stencilArea); + /** @type {number} */ var stencilBits = stencilBuf.raw().getFormat().getNumStencilBits(); + /** @type {number} */ var stencil = sglrReferenceContext.maskStencil(stencilBits, this.m_clearStencil); + isSharedDepthStencil = stencilBuf.raw().getFormat().order != tcuTexture.ChannelOrder.S; + + if (isSharedDepthStencil || ((this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask & ((1 << stencilBits) - 1)) != ((1 << stencilBits) - 1))) { + // Slow path where depth or stencil is masked out in write. + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + sglrReferenceContext.writeStencilOnly(access, s, x, y, stencil, this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask); + } else + access.clear([0, 0, 0, stencil]); + } + }; + + /** + * @param {number} buffer + * @param {number} drawbuffer + * @param {Array} value + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.clearBufferiv = function(buffer, drawbuffer, value) { + if (this.conditionalSetError(buffer != gl.COLOR && buffer != gl.STENCIL, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(drawbuffer != 0, gl.INVALID_VALUE)) + return; + + /** @type {Array} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff]; + + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access; + + if (buffer == gl.COLOR) { + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf = this.getDrawColorbuffer(); + /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3]; + /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3]; + + if (!colorBuf.isEmpty() && !maskZero) { + /** @type {Array} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf)); + access = colorBuf.getSubregion(colorArea); + + if (!maskUsed) + access.clear(value); + else { + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + access.raw().setPixel(tcuTextureUtil.select(value, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y); + } + } + } else { + if (buffer !== gl.STENCIL) + throw new Error('Unexpected buffer type: ' + buffer); + + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var stencilBuf = this.getDrawStencilbuffer(); + + if (!stencilBuf.isEmpty() && this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask != 0) { + /** @type {Array} */ var area = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(stencilBuf)); + access = stencilBuf.getSubregion(area); + /** @type {number} */ var stencil = value[0]; + + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + sglrReferenceContext.writeStencilOnly(access, s, x, y, stencil, this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask); + } + } + }; + + /** + * @param {number} buffer + * @param {number} drawbuffer + * @param {Array} value + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.clearBufferfv = function(buffer, drawbuffer, value) { + if (this.conditionalSetError(buffer != gl.COLOR && buffer != gl.DEPTH, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(drawbuffer != 0, gl.INVALID_VALUE)) + return; + + /** @type {Array} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff]; + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access; + if (buffer == gl.COLOR) { + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf = this.getDrawColorbuffer(); + /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3]; + /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3]; + + if (!colorBuf.isEmpty() && !maskZero) { + /** @type {Array} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf)); + access = colorBuf.getSubregion(colorArea); + var color = value; + + if (this.m_sRGBUpdateEnabled && access.raw().getFormat().isSRGB()) + color = tcuTextureUtil.linearToSRGB(color); + + if (!maskUsed) + access.clear(color); + else { + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + access.raw().setPixel(tcuTextureUtil.select(color, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y); + } + } + } else { + if (buffer !== gl.DEPTH) + throw new Error('Unexpected buffer type: ' + buffer); + + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var depthBuf = this.getDrawDepthbuffer(); + + if (!depthBuf.isEmpty() && this.m_depthMask) { + /** @type {Array} */ var area = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(depthBuf)); + access = depthBuf.getSubregion(area); + /** @type {number} */ var depth = value[0]; + + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + sglrReferenceContext.writeDepthOnly(access, s, x, y, depth); + } + } + }; + + /** + * @param {number} buffer + * @param {number} drawbuffer + * @param {Array} value + */ + sglrReferenceContext.ReferenceContext.prototype.clearBufferuiv = function(buffer, drawbuffer, value) { + if (this.conditionalSetError(buffer != gl.COLOR, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(drawbuffer != 0, gl.INVALID_VALUE)) + return; + + /** @type {Array} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff]; + + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf = this.getDrawColorbuffer(); + /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3]; + /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3]; + + if (!colorBuf.isEmpty() && !maskZero) { + /** @type {Array} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf)); + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access = colorBuf.getSubregion(colorArea); + + if (!maskUsed) + access.clear(value); + else { + for (var y = 0; y < access.raw().getDepth(); y++) + for (var x = 0; x < access.raw().getHeight(); x++) + for (var s = 0; s < access.getNumSamples(); s++) + access.raw().setPixel(tcuTextureUtil.select(value, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y); + } + } + }; + + /** + * @param {number} buffer + * @param {number} drawbuffer + * @param {number} depth + * @param {number} stencil + */ + sglrReferenceContext.ReferenceContext.prototype.clearBufferfi = function(buffer, drawbuffer, depth, stencil) { + if (this.conditionalSetError(buffer != gl.DEPTH_STENCIL, gl.INVALID_ENUM)) + return; + this.clearBufferfv(gl.DEPTH, drawbuffer, [depth]); + this.clearBufferiv(gl.STENCIL, drawbuffer, [stencil]); + }; + + /** + * @param {number} target + * @param {number} attachment + * @param {sglrReferenceContext.TexTarget} textarget + * @param {sglrReferenceContext.TextureContainer} texture + * @param {number} level + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.framebufferTexture2D = function(target, attachment, textarget, texture, level) { + if (attachment == gl.DEPTH_STENCIL_ATTACHMENT) { + // Attach to both depth and stencil. + this.framebufferTexture2D(target, gl.DEPTH_ATTACHMENT, textarget, texture, level); + this.framebufferTexture2D(target, gl.STENCIL_ATTACHMENT, textarget, texture, level); + } else { + /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.mapGLAttachmentPoint(attachment); + /** @type {sglrReferenceContext.TexTarget} */ var fboTexTarget = sglrReferenceContext.mapGLFboTexTarget(textarget); + + if (this.conditionalSetError(target != gl.FRAMEBUFFER && + target != gl.DRAW_FRAMEBUFFER && + target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(point == undefined, gl.INVALID_ENUM)) + return; + + // Select binding point. + /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding; + if (this.conditionalSetError(!framebufferBinding, gl.INVALID_OPERATION)) + return; + + if (texture) { + if (this.conditionalSetError(level != 0, gl.INVALID_VALUE)) + return; + + if (texture.getType() == sglrReferenceContext.TextureType.TYPE_2D) { + if (this.conditionalSetError(fboTexTarget != sglrReferenceContext.TexTarget.TEXTARGET_2D, gl.INVALID_OPERATION)) + return; + } else { + if (!texture.getType() == sglrReferenceContext.TextureType.TYPE_CUBE_MAP) + throw new Error('Unsupported texture type'); + if (this.conditionalSetError(!deMath.deInRange32(fboTexTarget, sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X, sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z), gl.INVALID_OPERATION)) + return; + } + } + + /** @type {sglrReferenceContext.Attachment} */ var fboAttachment = new sglrReferenceContext.Attachment(); + + if (texture) { + fboAttachment.type = sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE; + fboAttachment.object = texture; + fboAttachment.texTarget = fboTexTarget; + fboAttachment.level = level; + } + framebufferBinding.setAttachment(point, fboAttachment); + } + }; + + /** + * @param {number} target + * @param {number} attachment + * @param {sglrReferenceContext.TextureContainer} texture + * @param {number} level + * @param {number} layer + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.framebufferTextureLayer = function(target, attachment, texture, level, layer) { + if (attachment == gl.DEPTH_STENCIL_ATTACHMENT) { + // Attach to both depth and stencil. + this.framebufferTextureLayer(target, gl.DEPTH_ATTACHMENT, texture, level, layer); + this.framebufferTextureLayer(target, gl.STENCIL_ATTACHMENT, texture, level, layer); + } else { + /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.mapGLAttachmentPoint(attachment); + + if (this.conditionalSetError(target != gl.FRAMEBUFFER && + target != gl.DRAW_FRAMEBUFFER && + target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(point === undefined, gl.INVALID_ENUM)) + return; + + // Select binding point. + /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding; + if (this.conditionalSetError(!framebufferBinding, gl.INVALID_OPERATION)) + return; + + if (texture) { + if (this.conditionalSetError(level != 0, gl.INVALID_VALUE)) + return; + + if (this.conditionalSetError(texture.getType() != sglrReferenceContext.TextureType.TYPE_2D_ARRAY && + texture.getType() != sglrReferenceContext.TextureType.TYPE_3D && + texture.getType() != sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY, gl.INVALID_OPERATION)) + return; + + if (texture.getType() == sglrReferenceContext.TextureType.TYPE_2D_ARRAY || texture.getType() == sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY) { + if (this.conditionalSetError((layer < 0) || (layer >= gl.MAX_ARRAY_TEXTURE_LAYERS), gl.INVALID_VALUE)) + return; + if (this.conditionalSetError((level < 0) || (level > Math.floor(Math.log2(gl.MAX_TEXTURE_SIZE))), gl.INVALID_VALUE)) + return; + } else if (texture.getType() == sglrReferenceContext.TextureType.TYPE_3D) { + if (this.conditionalSetError((layer < 0) || (layer >= gl.MAX_3D_TEXTURE_SIZE), gl.INVALID_VALUE)) + return; + if (this.conditionalSetError((level < 0) || (level > Math.floor(Math.log2(gl.MAX_3D_TEXTURE_SIZE))), gl.INVALID_VALUE)) + return; + } + } + + /** @type {sglrReferenceContext.Attachment} */ var fboAttachment = new sglrReferenceContext.Attachment(); + + if (texture) { + fboAttachment.type = sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE; + fboAttachment.object = texture; + fboAttachment.texTarget = sglrReferenceContext.texLayeredTypeToTarget(texture.getType()); + fboAttachment.level = level; + fboAttachment.layer = layer; + } + framebufferBinding.setAttachment(point, fboAttachment); + + } + }; + + /** + * @param {number} target + * @param {number} attachment + * @param {number} renderbuffertarget + * @param {sglrReferenceContext.Renderbuffer} renderbuffer + */ + sglrReferenceContext.ReferenceContext.prototype.framebufferRenderbuffer = function(target, attachment, renderbuffertarget, renderbuffer) { + if (attachment == gl.DEPTH_STENCIL_ATTACHMENT) { + // Attach both to depth and stencil. + this.framebufferRenderbuffer(target, gl.DEPTH_ATTACHMENT, renderbuffertarget, renderbuffer); + this.framebufferRenderbuffer(target, gl.STENCIL_ATTACHMENT, renderbuffertarget, renderbuffer); + } else { + /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.mapGLAttachmentPoint(attachment); + + if (this.conditionalSetError(target != gl.FRAMEBUFFER && + target != gl.DRAW_FRAMEBUFFER && + target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(point == undefined, gl.INVALID_ENUM)) + return; + + // Select binding point. + /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding; + if (this.conditionalSetError(!framebufferBinding, gl.INVALID_OPERATION)) + return; + + if (renderbuffer) { + if (this.conditionalSetError(renderbuffertarget != gl.RENDERBUFFER, gl.INVALID_ENUM)) + return; + } + + /** @type {sglrReferenceContext.Attachment} */ var fboAttachment = new sglrReferenceContext.Attachment(); + + if (renderbuffer) { + fboAttachment.type = sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_RENDERBUFFER; + fboAttachment.object = renderbuffer; + } + framebufferBinding.setAttachment(point, fboAttachment); + } + }; + + /** + * @param {number} target + * @param {number} internalformat + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.ReferenceContext.prototype.renderbufferStorage = function(target, internalformat, width, height) { + /** @type {tcuTexture.TextureFormat} */ var format = gluTextureUtil.mapGLInternalFormat(internalformat); + + if (this.conditionalSetError(target != gl.RENDERBUFFER, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError(!this.m_renderbufferBinding, gl.INVALID_OPERATION)) + return; + if (this.conditionalSetError(!deMath.deInRange32(width, 0, this.m_limits.maxRenderbufferSize) || + !deMath.deInRange32(height, 0, this.m_limits.maxRenderbufferSize), + gl.INVALID_OPERATION)) + return; + if (this.conditionalSetError(!format, gl.INVALID_ENUM)) + return; + + this.m_renderbufferBinding.setStorage(format, width, height); + }; + + /** + * @param {number} target + * @param {number} samples + * @param {number} internalformat + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.ReferenceContext.prototype.renderbufferStorageMultisample = function(target, samples, internalformat, width, height) { + this.renderbufferStorage(target, internalformat, width, height); + }; + + /** + * @param {rrRenderer.PrimitiveType} derivedType + * @return {rrRenderer.PrimitiveType} + * @throws {Error} + */ + sglrReferenceContext.getPrimitiveBaseType = function(derivedType) { + switch (derivedType) { + case rrRenderer.PrimitiveType.TRIANGLES: + case rrRenderer.PrimitiveType.TRIANGLE_STRIP: + case rrRenderer.PrimitiveType.TRIANGLE_FAN: + return rrRenderer.PrimitiveType.TRIANGLES; + + case rrRenderer.PrimitiveType.LINES: + case rrRenderer.PrimitiveType.LINE_STRIP: + case rrRenderer.PrimitiveType.LINE_LOOP: + return rrRenderer.PrimitiveType.LINES; + + case rrRenderer.PrimitiveType.POINTS: + return rrRenderer.PrimitiveType.POINTS; + + default: + throw new Error('Unrecognized primitive type:' + derivedType); + } + }; + + /** + * createProgram + * @param {sglrShaderProgram.ShaderProgram} program + * @return {sglrShaderProgram.ShaderProgram} + */ + sglrReferenceContext.ReferenceContext.prototype.createProgram = function(program) { + return program; + }; + + /** + * deleteProgram + * @param {sglrShaderProgram.ShaderProgram} program + */ + sglrReferenceContext.ReferenceContext.prototype.deleteProgram = function(program) {}; + + /** + * @param {sglrShaderProgram.ShaderProgram} program + */ + sglrReferenceContext.ReferenceContext.prototype.useProgram = function(program) { + this.m_currentProgram = program; + }; + + /** + * Draws quads from vertex arrays + * @param {number} primitive GL primitive type to draw with. + * @param {number} first First vertex to begin drawing with + * @param {number} count How many vertices to draw (not counting vertices before first) + */ + sglrReferenceContext.ReferenceContext.prototype.drawArrays = function(primitive, first, count) { + this.drawQuads(primitive, first, count, 1); + }; + + /** + * Draws quads from vertex arrays + * @param {number} primitive GL primitive type to draw with. + * @param {(number|rrRenderer.DrawIndices)} first First vertex to begin drawing with + * @param {number} count Number of vertices + * @param {number=} instances Number of instances + */ + sglrReferenceContext.ReferenceContext.prototype.drawQuads = function(primitive, first, count, instances) { + // undefined results + if (!this.m_currentProgram) + return; + + if (typeof instances === 'undefined') + instances = 1; + + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf0 = this.getDrawColorbuffer(); + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var depthBuf = this.getDrawDepthbuffer(); + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var stencilBuf = this.getDrawStencilbuffer(); + /** @type {boolean} */ var hasStencil = /** @type {!boolean} */ (stencilBuf && !stencilBuf.isEmpty()); + /** @type {number} */ var stencilBits = (hasStencil) ? stencilBuf.raw().getFormat().getNumStencilBits() : 0; + + /** @type {rrRenderer.RenderTarget} */ var renderTarget = new rrRenderer.RenderTarget(colorBuf0, + depthBuf, + stencilBuf); + /** @type {sglrShaderProgram.ShaderProgram} */ var program = this.m_currentProgram; + + /*new rrRenderer.Program( + * this.m_currentProgram.getVertexShader(), + * this.m_currentProgram.getFragmentShader());*/ + + /** @type {rrRenderState.ViewportState} */ var viewportState = new rrRenderState.ViewportState(colorBuf0); + /** @type {rrRenderState.RenderState} */ var state = new rrRenderState.RenderState(viewportState); + + /** @type {Array} */ var vertexAttribs = []; + + // Gen state + /** @type {rrRenderer.PrimitiveType} */ var baseType = rrRenderer.PrimitiveType.TRIANGLES; + /** @type {boolean} */ var polygonOffsetEnabled = + (baseType == rrRenderer.PrimitiveType.TRIANGLES) ? + (this.m_polygonOffsetFillEnabled) : + (false); + + //state.cullMode = m_cullMode + + state.fragOps.scissorTestEnabled = this.m_scissorEnabled; + state.fragOps.scissorRectangle = new rrRenderState.WindowRectangle(this.m_scissorBox); + + state.fragOps.numStencilBits = stencilBits; + state.fragOps.stencilTestEnabled = this.m_stencilTestEnabled; + + for (var key in rrDefs.FaceType) { + /** @type {number} */ var faceType = rrDefs.FaceType[key]; + state.fragOps.stencilStates[faceType].compMask = this.m_stencil[faceType].opMask; + state.fragOps.stencilStates[faceType].writeMask = this.m_stencil[faceType].writeMask; + state.fragOps.stencilStates[faceType].ref = this.m_stencil[faceType].ref; + state.fragOps.stencilStates[faceType].func = sglrReferenceUtils.mapGLTestFunc(this.m_stencil[faceType].func); + state.fragOps.stencilStates[faceType].sFail = sglrReferenceUtils.mapGLStencilOp(this.m_stencil[faceType].opStencilFail); + state.fragOps.stencilStates[faceType].dpFail = sglrReferenceUtils.mapGLStencilOp(this.m_stencil[faceType].opDepthFail); + state.fragOps.stencilStates[faceType].dpPass = sglrReferenceUtils.mapGLStencilOp(this.m_stencil[faceType].opDepthPass); + } + + state.fragOps.depthTestEnabled = this.m_depthTestEnabled; + state.fragOps.depthFunc = sglrReferenceUtils.mapGLTestFunc(this.m_depthFunc); + state.fragOps.depthMask = this.m_depthMask; + + state.fragOps.blendMode = this.m_blendEnabled ? rrRenderState.BlendMode.STANDARD : rrRenderState.BlendMode.NONE; + state.fragOps.blendRGBState.equation = sglrReferenceUtils.mapGLBlendEquation(this.m_blendModeRGB); + state.fragOps.blendRGBState.srcFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorSrcRGB); + state.fragOps.blendRGBState.dstFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorDstRGB); + state.fragOps.blendAState.equation = sglrReferenceUtils.mapGLBlendEquation(this.m_blendModeAlpha); + state.fragOps.blendAState.srcFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorSrcAlpha); + state.fragOps.blendAState.dstFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorDstAlpha); + state.fragOps.blendColor = this.m_blendColor; + + state.fragOps.colorMask = this.m_colorMask; + + state.viewport.rect = new rrRenderState.WindowRectangle(this.m_viewport); + state.viewport.zn = this.m_depthRangeNear; + state.viewport.zf = this.m_depthRangeFar; + + //state.point.pointSize = this.m_pointSize; + state.line.lineWidth = this.m_lineWidth; + + state.fragOps.polygonOffsetEnabled = polygonOffsetEnabled; + state.fragOps.polygonOffsetFactor = this.m_polygonOffsetFactor; + state.fragOps.polygonOffsetUnits = this.m_polygonOffsetUnits; + + state.provokingVertexConvention = (this.m_provokingFirstVertexConvention) ? (rrDefs.ProvokingVertex.PROVOKINGVERTEX_FIRST) : (rrDefs.ProvokingVertex.PROVOKINGVERTEX_LAST); + + // gen attributes + /** @type {sglrReferenceContext.VertexArray} */ var vao = this.m_vertexArrayBinding; + for (var ndx = 0; ndx < vao.m_arrays.length; ++ndx) { + vertexAttribs[ndx] = new rrVertexAttrib.VertexAttrib(); + if (!vao.m_arrays[ndx].enabled) { + vertexAttribs[ndx].type = rrVertexAttrib.VertexAttribType.DONT_CARE; // reading with wrong type is allowed, but results are undefined + vertexAttribs[ndx].generic = this.m_currentAttribs[ndx]; + } else { + vertexAttribs[ndx].type = (vao.m_arrays[ndx].integer) ? + (sglrReferenceUtils.mapGLPureIntegerVertexAttributeType(vao.m_arrays[ndx].type)) : + (sglrReferenceUtils.mapGLFloatVertexAttributeType(vao.m_arrays[ndx].type, vao.m_arrays[ndx].normalized, vao.m_arrays[ndx].size)); + vertexAttribs[ndx].size = sglrReferenceUtils.mapGLSize(vao.m_arrays[ndx].size); + vertexAttribs[ndx].stride = vao.m_arrays[ndx].stride; + vertexAttribs[ndx].instanceDivisor = vao.m_arrays[ndx].divisor; + vertexAttribs[ndx].pointer = vao.m_arrays[ndx].bufferBinding.getData(); + vertexAttribs[ndx].offset = vao.m_arrays[ndx].offset; + vertexAttribs[ndx].componentCount = vao.m_arrays[ndx].size; + } + } + + // Set shader samplers + for (var uniformNdx = 0; uniformNdx < this.m_currentProgram.m_uniforms.length; ++uniformNdx) { + /** @type {number} */ var texNdx = this.m_currentProgram.m_uniforms[uniformNdx].value[0]; + + switch (this.m_currentProgram.m_uniforms[uniformNdx].type) { + case gluShaderUtil.DataType.SAMPLER_2D: + case gluShaderUtil.DataType.UINT_SAMPLER_2D: + case gluShaderUtil.DataType.INT_SAMPLER_2D: { + /** @type {sglrReferenceContext.Texture2D} */ var tex; + + if (texNdx >= 0 && texNdx < this.m_textureUnits.length) + tex = /** @type {sglrReferenceContext.Texture2D} */ (this.m_textureUnits[texNdx].tex2DBinding.texture); + + if (tex && tex.isComplete()) { + tex.updateView(); + this.m_currentProgram.m_uniforms[uniformNdx].sampler = tex; + } else + this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTex2D.texture; + + break; + } + case gluShaderUtil.DataType.SAMPLER_CUBE: + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: + case gluShaderUtil.DataType.INT_SAMPLER_CUBE: { + /** @type {sglrReferenceContext.TextureCube} */ var texCube; + + if (texNdx >= 0 && texNdx < this.m_textureUnits.length) + texCube = /** @type {sglrReferenceContext.TextureCube} */ (this.m_textureUnits[texNdx].texCubeBinding.texture); + + if (texCube && texCube.isComplete()) { + texCube.updateView(); + this.m_currentProgram.m_uniforms[uniformNdx].sampler = texCube; + } else + this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTexCube.texture; + + break; + } + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: { + /** @type {sglrReferenceContext.Texture2DArray} */ var tex2DArray; + + if (texNdx >= 0 && texNdx < this.m_textureUnits.length) + tex2DArray = /** @type {sglrReferenceContext.Texture2DArray} */ (this.m_textureUnits[texNdx].tex2DArrayBinding.texture); + + if (tex2DArray && tex2DArray.isComplete()) { + tex2DArray.updateView(); + this.m_currentProgram.m_uniforms[uniformNdx].sampler = tex2DArray; + } else + this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTex2DArray.texture; + + break; + } + case gluShaderUtil.DataType.SAMPLER_3D: + case gluShaderUtil.DataType.UINT_SAMPLER_3D: + case gluShaderUtil.DataType.INT_SAMPLER_3D: { + /** @type {sglrReferenceContext.Texture3D} */ var tex3D; + + if (texNdx >= 0 && texNdx < this.m_textureUnits.length) + tex3D = /** @type {sglrReferenceContext.Texture3D} */ (this.m_textureUnits[texNdx].tex3DBinding.texture); + + if (tex3D && tex3D.isComplete()) { + tex3D.updateView(); + this.m_currentProgram.m_uniforms[uniformNdx].sampler = tex3D; + } else + this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTex3D.texture; + + break; + } + /* TODO: Port + case gluShaderUtil.DataType.SAMPLER_CUBE_ARRAY: + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE_ARRAY: + case gluShaderUtil.DataType.INT_SAMPLER_CUBE_ARRAY:{ + rc::TextureCubeArray* tex = DE_NULL; + + if (texNdx >= 0 && (size_t)texNdx < m_textureUnits.length) + tex = (this.m_textureUnits[texNdx].texCubeArrayBinding) ? (this.m_textureUnits[texNdx].texCubeArrayBinding) : (&this.m_textureUnits[texNdx].defaultCubeArrayTex); + + if (tex && tex.isComplete()) { + tex.updateView(); + this.m_currentProgram.m_uniforms[uniformNdx].sampler.texCubeArray = tex; + } else + this.m_currentProgram.m_uniforms[uniformNdx].sampler.texCubeArray = &this.m_emptyTexCubeArray; + + break; + } + */ + default: + // nothing + break; + } + } + + var primitiveType = sglrReferenceUtils.mapGLPrimitiveType(primitive); + + var renderFunction = rrRenderer.drawTriangles; + if (primitiveType == rrRenderer.PrimitiveType.LINES || + primitiveType == rrRenderer.PrimitiveType.LINE_STRIP || + primitiveType == rrRenderer.PrimitiveType.LINE_LOOP) + renderFunction = rrRenderer.drawLines; + else if (primitiveType == rrRenderer.PrimitiveType.POINTS) + renderFunction = rrRenderer.drawPoints; + + for (var instanceID = 0; instanceID < instances; instanceID++) + renderFunction(state, renderTarget, program, vertexAttribs, primitiveType, first, count, instanceID); + }; + + /** + * @param {Array} rect + * @return {boolean} + */ + sglrReferenceContext.isEmpty = function(rect) { return rect[2] == 0 || rect[3] == 0; }; + + /** + * @param {number} mask + * @param {Array} srcRect + * @param {Array} dstRect + * @param {boolean} flipX + * @param {boolean} flipY + * @throws {Error} + */ + sglrReferenceContext.ReferenceContext.prototype.blitResolveMultisampleFramebuffer = function(mask, srcRect, dstRect, flipX, flipY) { + throw new Error('Unimplemented'); + }; + + /** + * @param {number} srcX0 + * @param {number} srcY0 + * @param {number} srcX1 + * @param {number} srcY1 + * @param {number} dstX0 + * @param {number} dstY0 + * @param {number} dstX1 + * @param {number} dstY1 + * @param {number} mask + * @param {number} filter + */ + sglrReferenceContext.ReferenceContext.prototype.blitFramebuffer = function(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) { + // p0 in inclusive, p1 exclusive. + // Negative width/height means swap. + /** @type {boolean} */ var swapSrcX = srcX1 < srcX0; + /** @type {boolean} */ var swapSrcY = srcY1 < srcY0; + /** @type {boolean} */ var swapDstX = dstX1 < dstX0; + /** @type {boolean} */ var swapDstY = dstY1 < dstY0; + /** @type {number} */ var srcW = Math.abs(srcX1 - srcX0); + /** @type {number} */ var srcH = Math.abs(srcY1 - srcY0); + /** @type {number} */ var dstW = Math.abs(dstX1 - dstX0); + /** @type {number} */ var dstH = Math.abs(dstY1 - dstY0); + /** @type {boolean} */ var scale = srcW != dstW || srcH != dstH; + /** @type {number} */ var srcOriginX = swapSrcX ? srcX1 : srcX0; + /** @type {number} */ var srcOriginY = swapSrcY ? srcY1 : srcY0; + /** @type {number} */ var dstOriginX = swapDstX ? dstX1 : dstX0; + /** @type {number} */ var dstOriginY = swapDstY ? dstY1 : dstY0; + /** @type {Array} */ var srcRect = [srcOriginX, srcOriginY, srcW, srcH]; + /** @type {Array} */ var dstRect = [dstOriginX, dstOriginY, dstW, dstH]; + + if (this.conditionalSetError(filter != gl.NEAREST && filter != gl.LINEAR, gl.INVALID_ENUM)) + return; + if (this.conditionalSetError((mask & (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) != 0 && filter != gl.NEAREST, gl.INVALID_OPERATION)) + return; + + // Validate that both targets are complete. + if (this.conditionalSetError(this.checkFramebufferStatus(gl.DRAW_FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE || + this.checkFramebufferStatus(gl.READ_FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE, gl.INVALID_OPERATION)) + return; + + // Check samples count is valid + if (this.conditionalSetError(this.getDrawColorbuffer().getNumSamples() != 1, gl.INVALID_OPERATION)) + return; + + // Check size restrictions of multisampled case + if (this.getReadColorbuffer().getNumSamples() != 1) { + // Src and Dst rect dimensions must be the same + if (this.conditionalSetError(srcW != dstW || srcH != dstH, gl.INVALID_OPERATION)) + return; + + // sglrReferenceContext.Framebuffer formats must match + if (mask & gl.COLOR_BUFFER_BIT) + if (this.conditionalSetError(this.getReadColorbuffer().raw().getFormat() != this.getDrawColorbuffer().raw().getFormat(), gl.INVALID_OPERATION)) + return; + if (mask & gl.DEPTH_BUFFER_BIT) + if (this.conditionalSetError(this.getReadDepthbuffer().raw().getFormat() != this.getDrawDepthbuffer().raw().getFormat(), gl.INVALID_OPERATION)) + return; + if (mask & gl.STENCIL_BUFFER_BIT) + if (this.conditionalSetError(this.getReadStencilbuffer().raw().getFormat() != this.getDrawStencilbuffer().raw().getFormat(), gl.INVALID_OPERATION)) + return; + } + + // Compute actual source rect. + srcRect = (mask & gl.COLOR_BUFFER_BIT) ? deMath.intersect(srcRect, sglrReferenceContext.getBufferRect(this.getReadColorbuffer())) : srcRect; + srcRect = (mask & gl.DEPTH_BUFFER_BIT) ? deMath.intersect(srcRect, sglrReferenceContext.getBufferRect(this.getReadDepthbuffer())) : srcRect; + srcRect = (mask & gl.STENCIL_BUFFER_BIT) ? deMath.intersect(srcRect, sglrReferenceContext.getBufferRect(this.getReadStencilbuffer())) : srcRect; + + // Compute destination rect. + dstRect = (mask & gl.COLOR_BUFFER_BIT) ? deMath.intersect(dstRect, sglrReferenceContext.getBufferRect(this.getDrawColorbuffer())) : dstRect; + dstRect = (mask & gl.DEPTH_BUFFER_BIT) ? deMath.intersect(dstRect, sglrReferenceContext.getBufferRect(this.getDrawDepthbuffer())) : dstRect; + dstRect = (mask & gl.STENCIL_BUFFER_BIT) ? deMath.intersect(dstRect, sglrReferenceContext.getBufferRect(this.getDrawStencilbuffer())) : dstRect; + dstRect = this.m_scissorEnabled ? deMath.intersect(dstRect, this.m_scissorBox) : dstRect; + + if (sglrReferenceContext.isEmpty(srcRect) || sglrReferenceContext.isEmpty(dstRect)) + return; // Don't attempt copy. + + // Multisampled read buffer is a special case + if (this.getReadColorbuffer().getNumSamples() != 1) { + /** @type {boolean} */ var swapX = swapSrcX ^ swapDstX ? true : false; + /** @type {boolean} */ var swapY = swapSrcY ^ swapDstY ? true : false; + var error = this.blitResolveMultisampleFramebuffer(mask, srcRect, dstRect, swapX, swapY); + + if (error != gl.NO_ERROR) + this.setError(error); + + return; + } + + // \note Multisample pixel buffers can now be accessed like non-multisampled because multisample read buffer case is already handled. => sample count must be 1 + + // Coordinate transformation: + // Dst offset space -> dst rectangle space -> src rectangle space -> src offset space. + /** @type {tcuMatrix.Matrix} */ var matrix = tcuMatrixUtil.translationMatrix([srcX0 - srcRect[0], srcY0 - srcRect[1]]); + matrix = tcuMatrix.multiply(matrix, tcuMatrix.matrixFromVector(3, 3, [(srcX1 - srcX0) / (dstX1 - dstX0), (srcY1 - srcY0) / (dstY1 - dstY0), 1])); + matrix = tcuMatrix.multiply(matrix, tcuMatrixUtil.translationMatrix([dstRect[0] - dstX0, dstRect[1] - dstY0])); + + /** + * @param {number} x + * @param {number} y + * @return {number} + */ + var transform = function(x, y) { return matrix.get(x, y); }; + + /** @type {number} */ var dX; + /** @type {number} */ var dY; + /** @type {number} */ var sX; + /** @type {number} */ var sY; + /** @type {tcuTexture.PixelBufferAccess|rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src; + /** @type {tcuTexture.PixelBufferAccess|rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var dst; + + if (mask & gl.COLOR_BUFFER_BIT) { + src = tcuTextureUtil.getSubregion(this.getReadColorbuffer().toSinglesampleAccess(), srcRect[0], srcRect[1], 0, srcRect[2], srcRect[3], 1); + dst = tcuTextureUtil.getSubregion(this.getDrawColorbuffer().toSinglesampleAccess(), dstRect[0], dstRect[1], 0, dstRect[2], dstRect[3], 1); + /** @type {tcuTexture.TextureChannelClass} */ var dstClass = tcuTexture.getTextureChannelClass(dst.getFormat().type); + /** @type {boolean} */ var dstIsFloat = dstClass == tcuTexture.TextureChannelClass.FLOATING_POINT || + dstClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT || + dstClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT; + /** @type {tcuTexture.FilterMode} */ var sFilter = (scale && filter == gl.LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST; + /** @type {tcuTexture.Sampler} */ var sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + sFilter, sFilter, 0.0 /* lod threshold */, false /* non-normalized coords */); + /** @type {boolean} */ var srcIsSRGB = src.getFormat().order == tcuTexture.ChannelOrder.sRGB || src.getFormat().order == tcuTexture.ChannelOrder.sRGBA; + /** @type {boolean} */ var dstIsSRGB = dst.getFormat().order == tcuTexture.ChannelOrder.sRGB || dst.getFormat().order == tcuTexture.ChannelOrder.sRGBA; + /** @type {boolean} */ var convertSRGB = this.m_sRGBUpdateEnabled; + + // \note We don't check for unsupported conversions, unlike spec requires. + + for (var yo = 0; yo < dstRect[3]; yo++) { + for (var xo = 0; xo < dstRect[2]; xo++) { + dX = xo + 0.5; + dY = yo + 0.5; + + // \note Only affine part is used. + sX = transform(0, 0) * dX + transform(0, 1) * dY + transform(0, 2); + sY = transform(1, 0) * dX + transform(1, 1) * dY + transform(1, 2); + + // do not copy pixels outside the modified source region (modified by buffer intersection) + if (sX < 0.0 || sX >= srcRect[2] || + sY < 0.0 || sY >= srcRect[3]) + continue; + + if (dstIsFloat || srcIsSRGB || filter == tcuTexture.FilterMode.LINEAR) { + /** @type {Array} */ var p = src.sample2D(sampler, sampler.minFilter, sX, sY, 0); + dst.setPixel((dstIsSRGB && convertSRGB) ? tcuTextureUtil.linearToSRGB(p) : p, xo, yo); + } else + dst.setPixelInt(src.getPixelInt(Math.floor(sX), Math.floor(sY)), xo, yo); + } + } + } + + if ((mask & gl.DEPTH_BUFFER_BIT) && this.m_depthMask) { + src = this.getReadDepthbuffer().getSubregion(srcRect); + dst = this.getDrawDepthbuffer().getSubregion(dstRect); + + for (var yo = 0; yo < dstRect[3]; yo++) { + for (var xo = 0; xo < dstRect[2]; xo++) { + var sampleNdx = 0; // multisample read buffer case is already handled + + dX = xo + 0.5; + dY = yo + 0.5; + sX = transform(0, 0) * dX + transform(0, 1) * dY + transform(0, 2); + sY = transform(1, 0) * dX + transform(1, 1) * dY + transform(1, 2); + + sglrReferenceContext.writeDepthOnly(dst, sampleNdx, xo, yo, src.raw().getPixel(sampleNdx, Math.floor(sX), Math.floor(sY))[0]); + } + } + } + + if (mask & gl.STENCIL_BUFFER_BIT) { + src = this.getReadStencilbuffer().getSubregion(srcRect); + dst = this.getDrawStencilbuffer().getSubregion(dstRect); + + for (var yo = 0; yo < dstRect[3]; yo++) { + for (var xo = 0; xo < dstRect[2]; xo++) { + var sampleNdx = 0; // multisample read buffer case is already handled + + dX = xo + 0.5; + dY = yo + 0.5; + sX = transform(0, 0) * dX + transform(0, 1) * dY + transform(0, 2); + sY = transform(1, 0) * dX + transform(1, 1) * dY + transform(1, 2); + + sglrReferenceContext.writeStencilOnly(dst, sampleNdx, xo, yo, src.raw().getPixelInt(sampleNdx, Math.floor(sX), Math.floor(sY))[3], this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask); + } + } + } + }; + + /** + * @param {number} internalFormat + * @return {tcuTexture.TextureFormat} + */ + sglrReferenceContext.mapInternalFormat = function(internalFormat) { + switch (internalFormat) { + case gl.ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.A, tcuTexture.ChannelType.UNORM_INT8); + case gl.LUMINANCE: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.L, tcuTexture.ChannelType.UNORM_INT8); + case gl.LUMINANCE_ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.LA, tcuTexture.ChannelType.UNORM_INT8); + case gl.RGB: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8); + case gl.RGBA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + + default: + return gluTextureUtil.mapGLInternalFormat(internalFormat); + } + }; + + /** + * @param {tcuTexture.PixelBufferAccess} dst + * @param {tcuTexture.ConstPixelBufferAccess} src + */ + sglrReferenceContext.depthValueFloatClampCopy = function(dst, src) { + /** @type {number} */ var width = dst.getWidth(); + /** @type {number} */ var height = dst.getHeight(); + /** @type {number} */ var depth = dst.getDepth(); + + DE_ASSERT(src.getWidth() == width && src.getHeight() == height && src.getDepth() == depth); + + // clamping copy + for (var z = 0; z < depth; z++) + for (var y = 0; y < height; y++) + for (var x = 0; x < width; x++) { + /** @type {Array} */ var data = src.getPixel(x, y, z); + dst.setPixel([deMath.clamp(data[0], 0.0, 1.0), data[1], data[2], data[3]], x, y, z); + } + }; + + /** + * @param {number} target + * @param {number} level + * @param {number} internalFormat + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.ReferenceContext.prototype.texImage2DDelegate = function (target, level, internalFormat, width, height) { + var format; + var dataType; + + switch (internalFormat) + { + case gl.ALPHA: + case gl.LUMINANCE: + case gl.LUMINANCE_ALPHA: + case gl.RGB: + case gl.RGBA: + format = internalFormat; + dataType = GL.UNSIGNED_BYTE; + break; + default: + { + var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(internalFormat)); + format = transferFmt.format; + dataType = transferFmt.dataType; + break; + } + } + this.texImage2D(target, level, internalFormat, width, height, 0, format, dataType, null); + }; + + /** + * @param {number} target + * @param {number} level + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} border + * @param {number} format + * @param {number} type + * @param {number} pixels + */ + sglrReferenceContext.ReferenceContext.prototype.texImage2D = function(target, level, internalFormat, width, height, border, format, type, pixels) { + this.texImage3D(target, level, internalFormat, width, height, 1, border, format, type, pixels); + }; + + sglrReferenceContext.ReferenceContext.prototype.texImage3D = function(target, level, internalFormat, width, height, depth, border, format, type, pixels) { + /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture]; + /** @type {ArrayBuffer} */ var data = null; + /** @type {number} */ var offset = 0; + /** @type {tcuTexture.PixelBufferAccess} */ var dst; + /** @type {tcuTexture.ConstPixelBufferAccess} */ var src; + if (this.m_pixelUnpackBufferBinding) { + if (this.conditionalSetError(typeof pixels !== 'number', gl.INVALID_VALUE)) + return; + data = this.m_pixelUnpackBufferBinding.getData(); + offset = pixels; + } else if (pixels) { + if (pixels instanceof ArrayBuffer) { + data = pixels; + offset = 0; + } else { + data = pixels.buffer; + offset = pixels.byteOffset; + } + } + /** @type {boolean} */ var isDstFloatDepthFormat = (internalFormat == gl.DEPTH_COMPONENT32F || internalFormat == gl.DEPTH32F_STENCIL8); // depth components are limited to [0,1] range + + if (this.conditionalSetError(border != 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(width < 0 || height < 0 || depth < 0 || level < 0, gl.INVALID_VALUE)) + return; + + // Map storage format. + /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat); + if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM)) + return; + + // Map transfer format. + /** @type {tcuTexture.TextureFormat} */ var transferFmt = gluTextureUtil.mapGLTransferFormat(format, type); + if (this.conditionalSetError(!transferFmt, gl.INVALID_ENUM)) + return; + + if (target == gl.TEXTURE_2D) { + // Validate size and level. + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize || depth != 1, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.log2(this.m_limits.maxTexture2DSize), gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture2D} */ + var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture); + + if (texture.isImmutable()) { + if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_OPERATION)) + return; + + //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level)); + dst = texture.getLevel(level); + + if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) || + width != dst.getWidth() || + height != dst.getHeight(), gl.INVALID_OPERATION)) + return; + } else + texture.allocLevel(level, storageFmt, width, height); + + if (data) { + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + rowPitch: rowPitch, + data: data, + offset: offset + skip}); + + //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level)); + dst = texture.getLevel(level); + + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(dst, src); + else + tcuTextureUtil.copy(dst, src); + } else { + // No data supplied, clear to black. + + //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level)); + dst = texture.getLevel(level); + dst.clear([0.0, 0.0, 0.0, 1.0]); + } + } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_X || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) { + // Validate size and level. + if (this.conditionalSetError(width != height || width > this.m_limits.maxTextureCubeSize || depth != 1, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTextureCubeSize)), gl.INVALID_VALUE)) + return; + + var textureCube = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture); + + var face = sglrReferenceContext.mapGLCubeFace(target); + + if (textureCube.isImmutable()) { + if (this.conditionalSetError(!textureCube.hasFace(level, face), gl.INVALID_OPERATION)) + return; + + dst = textureCube.getFace(level, face); + + if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) || + width != dst.getWidth() || + height != dst.getHeight(), gl.INVALID_OPERATION)) + return; + } else + textureCube.allocLevel(level, face, storageFmt, width, height); + + if (data) { + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + rowPitch: rowPitch, + data: data, + offset: offset + skip}); + + dst = textureCube.getFace(level, face); + + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(dst, src); + else + tcuTextureUtil.copy(dst, src); + } else { + // No data supplied, clear to black. + dst = textureCube.getFace(level, face); + dst.clear([0.0, 0.0, 0.0, 1.0]); + } + } else if (target == gl.TEXTURE_2D_ARRAY) { + // Validate size and level. + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || + height > this.m_limits.maxTexture2DSize || + depth > this.m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture2DSize)), gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture2DArray} */ + var texture2DArray = /** @type {sglrReferenceContext.Texture2DArray} */ (unit.tex2DArrayBinding.texture); + + if (texture2DArray.isImmutable()) { + if (this.conditionalSetError(!texture2DArray.hasLevel(level), gl.INVALID_OPERATION)) + return; + + dst = texture2DArray.getLevel(level); + if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) || + width != dst.getWidth() || + height != dst.getHeight() || + depth != dst.getDepth(), gl.INVALID_OPERATION)) + return; + } else + texture2DArray.allocLevel(level, storageFmt, width, height, depth); + + if (data) { + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var slicePitch = imageHeight * rowPitch; + var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch + + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + depth: depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: offset + skip}); + + dst = texture2DArray.getLevel(level); + + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(dst, src); + else + tcuTextureUtil.copy(dst, src); + } else { + // No data supplied, clear to black. + dst = texture2DArray.getLevel(level); + dst.clear([0.0, 0.0, 0.0, 1.0]); + } + } else if (target == gl.TEXTURE_3D) { + // Validate size and level. + if (this.conditionalSetError(width > this.m_limits.maxTexture3DSize || + height > this.m_limits.maxTexture3DSize || + depth > this.m_limits.maxTexture3DSize, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture3DSize)), gl.INVALID_VALUE)) + return; + + var texture3D = /** @type {sglrReferenceContext.Texture3D} */ (unit.tex3DBinding.texture); + + if (texture3D.isImmutable()) { + if (this.conditionalSetError(!texture3D.hasLevel(level), gl.INVALID_OPERATION)) + return; + + dst = texture3D.getLevel(level); + if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) || + width != dst.getWidth() || + height != dst.getHeight() || + depth != dst.getDepth(), gl.INVALID_OPERATION)) + return; + } else + texture3D.allocLevel(level, storageFmt, width, height, depth); + + if (data) { + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var slicePitch = imageHeight * rowPitch; + var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch + + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + depth: depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: offset + skip}); + + dst = texture3D.getLevel(level); + + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(dst, src); + else + tcuTextureUtil.copy(dst, src); + + } else { + // No data supplied, clear to black. + dst = texture3D.getLevel(level); + dst.clear([0.0, 0.0, 0.0, 1.0]); + } + } + // else if (target == gl.TEXTURE_CUBE_MAP_ARRAY) + // { + // // Validate size and level. + // RC_IF_ERROR(width != height || + // width > m_limits.maxTexture2DSize || + // depth % 6 != 0 || + // depth > m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE, RC_RET_VOID); + // RC_IF_ERROR(level > deLog2Floor32(m_limits.maxTexture2DSize), gl.INVALID_VALUE, RC_RET_VOID); + + // TextureCubeArray* texture = unit.texCubeArrayBinding ? unit.texCubeArrayBinding : &unit.defaultCubeArrayTex; + + // if (texture->isImmutable()) + // { + // RC_IF_ERROR(!texture->hasLevel(level), gl.INVALID_OPERATION, RC_RET_VOID); + + // ConstPixelBufferAccess dst(texture->getLevel(level)); + // RC_IF_ERROR(storageFmt != dst.getFormat() || + // width != dst.getWidth() || + // height != dst.getHeight() || + // depth != dst.getDepth(), gl.INVALID_OPERATION, RC_RET_VOID); + // } + // else + // texture->allocLevel(level, storageFmt, width, height, depth); + + // if (unpackPtr) + // { + // ConstPixelBufferAccess src = getUnpack3DAccess(transferFmt, width, height, depth, unpackPtr); + // PixelBufferAccess dst (texture->getLevel(level)); + + // if (isDstFloatDepthFormat) + // sglrReferenceContext.depthValueFloatClampCopy(dst, src); + // else + // tcu::copy(dst, src); + // } + // else + // { + // // No data supplied, clear to black. + // PixelBufferAccess dst = texture->getLevel(level); + // tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f)); + // } + // } /**/ + else + this.setError(gl.INVALID_ENUM); + }; + + sglrReferenceContext.ReferenceContext.prototype.texSubImage2D = function(target, level, xoffset, yoffset, width, height, format, type, pixels) { + this.texSubImage3D(target, level, xoffset, yoffset, 0, width, height, 1, format, type, pixels); + }; + + sglrReferenceContext.ReferenceContext.prototype.texSubImage3D = function(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) { + /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture]; + /** @type {ArrayBuffer} */ var data = null; + /** @type {number} */ var offset = 0; + /** @type {tcuTexture.PixelBufferAccess} */ var dst; + /** @type {tcuTexture.PixelBufferAccess} */ var sub; + /** @type {tcuTexture.ConstPixelBufferAccess} */ var src; + /** @type {boolean} */ var isDstFloatDepthFormat; + if (this.m_pixelUnpackBufferBinding) { + if (this.conditionalSetError(typeof pixels !== 'number', gl.INVALID_VALUE)) + return; + data = this.m_pixelUnpackBufferBinding.getData(); + offset = pixels; + } else if (pixels) { + if (pixels instanceof ArrayBuffer) { + data = pixels; + offset = 0; + } else { + data = pixels.buffer; + offset = pixels.byteOffset; + } + } + + if (this.conditionalSetError(xoffset < 0 || yoffset < 0 || zoffset < 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(width < 0 || height < 0 || depth < 0 || level < 0, gl.INVALID_VALUE)) + return; + + // Map transfer format. + /** @type {tcuTexture.TextureFormat} */ var transferFmt = gluTextureUtil.mapGLTransferFormat(format, type); + if (this.conditionalSetError(!transferFmt, gl.INVALID_ENUM)) + return; + + if (target == gl.TEXTURE_2D) { + // Validate size and level. + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize || depth != 1, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.log2(this.m_limits.maxTexture2DSize), gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture2D} */ + var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture); + + if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_OPERATION)) + return; + + //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level)); + dst = texture.getLevel(level); + + if (this.conditionalSetError(xoffset + width > dst.getWidth() || + yoffset + height > dst.getHeight() || + zoffset + depth > dst.getDepth(), + gl.INVALID_VALUE)) + return; + + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + rowPitch: rowPitch, + data: data, + offset: offset + skip}); + + sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth); + isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range + + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(sub, src); + else + tcuTextureUtil.copy(sub, src); + } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_X || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) { + var textureCube = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture); + + var face = sglrReferenceContext.mapGLCubeFace(target); + + if (this.conditionalSetError(!textureCube.hasFace(level, face), gl.INVALID_OPERATION)) + return; + + dst = textureCube.getFace(level, face); + + if (this.conditionalSetError(xoffset + width > dst.getWidth() || + yoffset + height > dst.getHeight() || + zoffset + depth > dst.getDepth(), + gl.INVALID_VALUE)) + return; + + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + rowPitch: rowPitch, + slicePitach: slicePitch, + data: data, + offset: offset + skip}); + + sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth); + isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range + + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(sub, src); + else + tcuTextureUtil.copy(sub, src); + } else if (target == gl.TEXTURE_2D_ARRAY) { + // Validate size and level. + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || + height > this.m_limits.maxTexture2DSize || + depth > this.m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture2DSize)), gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture2DArray} */ + var texture2DArray = /** @type {sglrReferenceContext.Texture2DArray} */ (unit.tex2DArrayBinding.texture); + + if (this.conditionalSetError(!texture2DArray.hasLevel(level), gl.INVALID_OPERATION)) + return; + + dst = texture2DArray.getLevel(level); + if (this.conditionalSetError(xoffset + width > dst.getWidth() || + yoffset + height > dst.getHeight() || + zoffset + depth > dst.getDepth(), + gl.INVALID_VALUE)) + return; + + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var slicePitch = imageHeight * rowPitch; + var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch + + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + depth: depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: offset + skip}); + + sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth); + isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range + + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(sub, src); + else + tcuTextureUtil.copy(sub, src); + } else if (target == gl.TEXTURE_3D) { + // Validate size and level. + if (this.conditionalSetError(width > this.m_limits.maxTexture3DSize || + height > this.m_limits.maxTexture3DSize || + depth > this.m_limits.maxTexture3DSize, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture3DSize)), gl.INVALID_VALUE)) + return; + + var texture3D = /** @type {sglrReferenceContext.Texture3D} */ (unit.tex3DBinding.texture); + + if (this.conditionalSetError(!texture3D.hasLevel(level), gl.INVALID_OPERATION)) + return; + + dst = texture3D.getLevel(level); + if (this.conditionalSetError(xoffset + width > dst.getWidth() || + yoffset + height > dst.getHeight() || + zoffset + depth > dst.getDepth(), + gl.INVALID_VALUE)) + return; + + var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width; + var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height; + var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment); + var slicePitch = imageHeight * rowPitch; + var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch + + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize(); + src = new tcuTexture.ConstPixelBufferAccess({ + format: transferFmt, + width: width, + height: height, + depth: depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: offset + skip}); + + sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth); + + isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range + if (isDstFloatDepthFormat) + sglrReferenceContext.depthValueFloatClampCopy(sub, src); + else + tcuTextureUtil.copy(sub, src); + } else + this.setError(gl.INVALID_ENUM); + }; + + /** + * @param {number} target + * @param {number} level + * @param {number} internalFormat + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} border + */ + sglrReferenceContext.ReferenceContext.prototype.copyTexImage2D = function(target, level, internalFormat, x, y, width, height, border) { + /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture]; + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src = this.getReadColorbuffer(); + + if (this.conditionalSetError(border != 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(width < 0 || height < 0 || level < 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(src.isEmpty(), gl.INVALID_OPERATION)) + return; + + // Map storage format. + /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat); + if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM)) + return; + + if (target == gl.TEXTURE_2D) { + // Validate size and level. + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture2DSize)), gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture2D} */ + var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture); + + if (texture.isImmutable()) { + if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_OPERATION)) + return; + + /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getLevel(level); + if (this.conditionalSetError(storageFmt != dst.getFormat() || width != dst.getWidth() || height != dst.getHeight(), gl.INVALID_OPERATION)) + return; + } else { + texture.allocLevel(level, storageFmt, width, height); + } + + // Copy from current framebuffer. + /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getLevel(level); + for (var yo = 0; yo < height; yo++) { + for (var xo = 0; xo < width; xo++) { + if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth())) + continue; // Undefined pixel. + + dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo, yo); + } + } + } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_X || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) { + // Validate size and level. + if (this.conditionalSetError(width != height || width > this.m_limits.maxTextureCubeSize, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTextureCubeSize)), gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.TextureCube} */ + var texture = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture); + var face = sglrReferenceContext.mapGLCubeFace(target); + + if (texture.isImmutable()) { + if (this.conditionalSetError(!texture.hasFace(level, face), gl.INVALID_OPERATION)) + return; + + /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getFace(level, face); + if (this.conditionalSetError(storageFmt != dst.getFormat() || width != dst.getWidth() || height != dst.getHeight(), gl.INVALID_OPERATION)) + return; + } else { + texture.allocLevel(level, face, storageFmt, width, height); + } + + // Copy from current framebuffer. + /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getFace(level, face); + for (var yo = 0; yo < height; yo++) { + for (var xo = 0; xo < width; xo++) { + if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth())) + continue; // Undefined pixel. + + dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo, yo); + } + } + } else { + this.setError(gl.INVALID_ENUM); + } + } + + /** + * @param {number} target + * @param {number} level + * @param {number} xoffset + * @param {number} yoffset + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ + sglrReferenceContext.ReferenceContext.prototype.copyTexSubImage2D = function(target, level, xoffset, yoffset, x, y, width, height) { + /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture]; + /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src = this.getReadColorbuffer(); + + if (this.conditionalSetError(xoffset < 0 || yoffset < 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(width < 0 || height < 0 || level < 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(src.isEmpty(), gl.INVALID_OPERATION)) + return; + + if (target == gl.TEXTURE_2D) { + /** @type {sglrReferenceContext.Texture2D} */ + var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture); + + if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_VALUE)) + return; + + /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getLevel(level); + + if (this.conditionalSetError(xoffset + width > dst.getWidth() || yoffset + height > dst.getHeight(), gl.INVALID_VALUE)) + return; + + for (var yo = 0; yo < height; yo++) { + for (var xo = 0; xo < width; xo++) { + if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth())) + continue; + + dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo+xoffset, yo+yoffset); + } + } + } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_X || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y || + target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z || + target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) { + /** @type {sglrReferenceContext.TextureCube} */ + var texture = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture); + var face = sglrReferenceContext.mapGLCubeFace(target); + + if (this.conditionalSetError(!texture.hasFace(level, face), gl.INVALID_VALUE)) + return; + + /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getFace(level, face); + + if (this.conditionalSetError(xoffset + width > dst.getWidth() || yoffset + height > dst.getHeight(), gl.INVALID_VALUE)) + return; + + for (var yo = 0; yo < height; yo++) { + for (var xo = 0; xo < width; xo++) { + if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth())) + continue; + + dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo+xoffset, yo+yoffset); + } + } + } else { + this.setError(gl.INVALID_ENUM); + } + } + + sglrReferenceContext.ReferenceContext.prototype.texStorage3D = function(target, levels, internalFormat, width, height, depth) { + /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture]; + + if (this.conditionalSetError(width <= 0 || height <= 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(levels < 1 || levels > Math.floor(Math.log2(Math.max(width, height))) + 1, gl.INVALID_VALUE)) + return; + + // Map storage format. + /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat); + if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM)) + return; + + if (target == gl.TEXTURE_2D_ARRAY) { + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || + height > this.m_limits.maxTexture2DSize || + depth >= this.m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture2DArray} */ + var textureArray = /** @type {sglrReferenceContext.Texture2DArray} */ (unit.tex2DArrayBinding.texture); + if (this.conditionalSetError(textureArray.isImmutable(), gl.INVALID_OPERATION)) + return; + + textureArray.clearLevels(); + textureArray.setImmutable(); + + for (var level = 0; level < levels; level++) { + var levelW = Math.max(1, width >> level); + var levelH = Math.max(1, height >> level); + + textureArray.allocLevel(level, storageFmt, levelW, levelH, depth); + } + } else if (target == gl.TEXTURE_3D) { + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || + height > this.m_limits.maxTexture2DSize || + depth >= this.m_limits.maxTexture3DSize, gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture3D} */ + var texture3D = /** @type {sglrReferenceContext.Texture3D} */ (unit.tex3DBinding.texture); + if (this.conditionalSetError(texture3D.isImmutable(), gl.INVALID_OPERATION)) + return; + + texture3D.clearLevels(); + texture3D.setImmutable(); + + for (var level = 0; level < levels; level++) { + var levelW = Math.max(1, width >> level); + var levelH = Math.max(1, height >> level); + var levelD = Math.max(1, depth >> level); + + texture3D.allocLevel(level, storageFmt, levelW, levelH, levelD); + } + } else + this.setError(gl.INVALID_ENUM); + }; + + sglrReferenceContext.ReferenceContext.prototype.texStorage2D = function(target, levels, internalFormat, width, height) { + /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture]; + + if (this.conditionalSetError(width <= 0 || height <= 0, gl.INVALID_VALUE)) + return; + if (this.conditionalSetError(levels < 1 || levels > Math.floor(Math.log2(Math.max(width, height))) + 1, gl.INVALID_VALUE)) + return; + + // Map storage format. + /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat); + if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM)) + return; + + if (target == gl.TEXTURE_2D) { + if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize, gl.INVALID_VALUE)) + return; + + /** @type {sglrReferenceContext.Texture2D} */ + var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture); + if (this.conditionalSetError(texture.isImmutable(), gl.INVALID_OPERATION)) + return; + + texture.clearLevels(); + texture.setImmutable(); + + for (var level = 0; level < levels; level++) { + var levelW = Math.max(1, width >> level); + var levelH = Math.max(1, height >> level); + + texture.allocLevel(level, storageFmt, levelW, levelH); + } + } else if (target == gl.TEXTURE_CUBE_MAP) { + if (this.conditionalSetError(width != height || width > this.m_limits.maxTextureCubeSize, gl.INVALID_VALUE)) + return; + var textureCube = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture); + if (this.conditionalSetError(textureCube.isImmutable(), gl.INVALID_OPERATION)) + return; + + textureCube.clearLevels(); + textureCube.setImmutable(); + + for (var level = 0; level < levels; level++) { + var levelW = Math.max(1, width >> level); + var levelH = Math.max(1, height >> level); + + for (var face in tcuTexture.CubeFace) + textureCube.allocLevel(level, tcuTexture.CubeFace[face], storageFmt, levelW, levelH); + } + } else + this.setError(gl.INVALID_ENUM); + }; + + /** + * @param {number} value + * @return {?tcuTexture.WrapMode} + */ + sglrReferenceContext.mapGLWrapMode = function(value) { + switch (value) { + case gl.CLAMP_TO_EDGE: return tcuTexture.WrapMode.CLAMP_TO_EDGE; + case gl.REPEAT: return tcuTexture.WrapMode.REPEAT_GL; + case gl.MIRRORED_REPEAT: return tcuTexture.WrapMode.MIRRORED_REPEAT_GL; + } + return null; + }; + + /** + * @param {number} value + * @return {?tcuTexture.FilterMode} + */ + sglrReferenceContext.mapGLFilterMode = function(value) { + switch (value) { + case gl.NEAREST: return tcuTexture.FilterMode.NEAREST; + case gl.LINEAR: return tcuTexture.FilterMode.LINEAR; + case gl.NEAREST_MIPMAP_NEAREST: return tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST; + case gl.NEAREST_MIPMAP_LINEAR: return tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR; + case gl.LINEAR_MIPMAP_NEAREST: return tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST; + case gl.LINEAR_MIPMAP_LINEAR: return tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR; + } + return null; + }; + + /** + * @param {number} target + * @param {number} pname + * @param {number} value + */ + sglrReferenceContext.ReferenceContext.prototype.texParameteri = function(target, pname, value) { + /** @type {sglrReferenceContext.TextureUnit} */ var unit = this.m_textureUnits[this.m_activeTexture]; + /** @type {sglrReferenceContext.TextureContainer} */ var container = null; + + switch (target) { + case gl.TEXTURE_2D: container = unit.tex2DBinding; break; + case gl.TEXTURE_CUBE_MAP: container = unit.texCubeBinding; break; + case gl.TEXTURE_2D_ARRAY: container = unit.tex2DArrayBinding; break; + case gl.TEXTURE_3D: container = unit.tex3DBinding; break; + + default: this.setError(gl.INVALID_ENUM); + } + + if (!container) + return; + + /** @type {sglrReferenceContext.Texture} */ + var texture = container.texture; + + switch (pname) { + case gl.TEXTURE_WRAP_S: { + /** @type {?tcuTexture.WrapMode} */ var wrapS = sglrReferenceContext.mapGLWrapMode(value); + if (this.conditionalSetError(null == wrapS, gl.INVALID_VALUE)) + return; + texture.getSampler().wrapS = /** @type {tcuTexture.WrapMode} */ (wrapS); + break; + } + + case gl.TEXTURE_WRAP_T: { + /** @type {?tcuTexture.WrapMode} */ var wrapT = sglrReferenceContext.mapGLWrapMode(value); + if (this.conditionalSetError(null == wrapT, gl.INVALID_VALUE)) + return; + texture.getSampler().wrapT = /** @type {tcuTexture.WrapMode} */ (wrapT); + break; + } + + case gl.TEXTURE_WRAP_R: { + /** @type {?tcuTexture.WrapMode} */ var wrapR = sglrReferenceContext.mapGLWrapMode(value); + if (this.conditionalSetError(null == wrapR, gl.INVALID_VALUE)) + return; + texture.getSampler().wrapR = /** @type {tcuTexture.WrapMode} */ (wrapR); + break; + } + + case gl.TEXTURE_MIN_FILTER: { + /** @type {?tcuTexture.FilterMode} */ var minMode = sglrReferenceContext.mapGLFilterMode(value); + if (this.conditionalSetError(null == minMode, gl.INVALID_VALUE)) + return; + texture.getSampler().minFilter = /** @type {tcuTexture.FilterMode} */ (minMode); + break; + } + + case gl.TEXTURE_MAG_FILTER: { + /** @type {?tcuTexture.FilterMode} */ var magMode = sglrReferenceContext.mapGLFilterMode(value); + if (this.conditionalSetError(null == magMode, gl.INVALID_VALUE)) + return; + texture.getSampler().magFilter = /** @type {tcuTexture.FilterMode} */ (magMode); + break; + } + + case gl.TEXTURE_MAX_LEVEL: { + if (this.conditionalSetError(value < 0, gl.INVALID_VALUE)) + return; + texture.setMaxLevel(value); + break; + } + + default: + this.setError(gl.INVALID_ENUM); + return; + } + }; + + sglrReferenceContext.ReferenceContext.prototype.invalidateFramebuffer = function(target, attachments) {}; + sglrReferenceContext.ReferenceContext.prototype.invalidateSubFramebuffer = function(target, attachments, x, y, width, height) {}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js new file mode 100644 index 000000000..cc8abf596 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js @@ -0,0 +1,834 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('framework.opengl.simplereference.sglrReferenceContextTest'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); + +goog.scope(function() { + var sglrReferenceContextTest = framework.opengl.simplereference.sglrReferenceContextTest; + var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; + var tcuTestCase = framework.common.tcuTestCase; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var tcuSurface = framework.common.tcuSurface; + var tcuLogImage = framework.common.tcuLogImage; + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrShadingContext = framework.referencerenderer.rrShadingContext; + var rrVertexPacket = framework.referencerenderer.rrVertexPacket; + var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; + var tcuRGBA = framework.common.tcuRGBA; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + sglrReferenceContextTest.ClearContext = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + }; + + sglrReferenceContextTest.ClearContext.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + sglrReferenceContextTest.ClearContext.prototype.constructor = sglrReferenceContextTest.ClearContext; + + sglrReferenceContextTest.ClearContext.prototype.init = function() {}; + + sglrReferenceContextTest.ClearContext.prototype.iterate = function() { + + var width = 200; + var height = 188; + var samples = 1; + var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples); + var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer()); + ctx.clearColor(1, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + var pixels = new tcuSurface.Surface(width, height); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + var numFailedPixels = 0; + var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]); + for (var x = 0; x < width; x++) + for (var y = 0; y < height; y++) { + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y)); + if (!pixel.equals(redPixel)) + numFailedPixels += 1; + } + + var access = pixels.getAccess(); + + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + ctx.scissor(width / 4, height / 4, width / 2, height / 2); + ctx.enable(gl.SCISSOR_TEST); + ctx.clearColor(0, 1, 1, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + numFailedPixels = 0; + var greenBluePixel = new gluDrawUtil.Pixel([0, 255, 255, 255]); + for (var x = 0; x < width; x++) + for (var y = 0; y < height; y++) { + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y)); + if ((x >= width / 4 && x < width - width / 4) && (y >= height / 4 && y < height - height / 4)) { + if (!pixel.equals(greenBluePixel)) + numFailedPixels += 1; + } else + if (!pixel.equals(redPixel)) + numFailedPixels += 1; + } + + access = pixels.getAccess(); + + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + sglrReferenceContextTest.Framebuffer = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + }; + + sglrReferenceContextTest.Framebuffer.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + sglrReferenceContextTest.Framebuffer.prototype.constructor = sglrReferenceContextTest.Framebuffer; + + sglrReferenceContextTest.Framebuffer.prototype.init = function() {}; + + sglrReferenceContextTest.Framebuffer.prototype.iterate = function() { + var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + var width = 200; + var height = 188; + var samples = 1; + var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples); + var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer()); + ctx.clearColor(0, 0, 1, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + var fbo = ctx.createFramebuffer(); + var rbo = ctx.createRenderbuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.bindRenderbuffer(gl.RENDERBUFFER, rbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, width, height); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo); + bufferedLogToConsole('Framebuffer status: ' + (ctx.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE)); + ctx.clearColor(1, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + var pixels = new tcuSurface.Surface(width, height); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + var numFailedPixels = 0; + var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]); + for (var x = 0; x < width; x++) + for (var y = 0; y < height; y++) { + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y)); + if (!pixel.equals(redPixel)) + numFailedPixels += 1; + } + var access = pixels.getAccess(); + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + ctx.scissor(width / 4, height / 4, width / 2, height / 2); + ctx.enable(gl.SCISSOR_TEST); + ctx.clearColor(0, 1, 1, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + numFailedPixels = 0; + var greenBluePixel = new gluDrawUtil.Pixel([0, 255, 255, 255]); + for (var x = 0; x < width; x++) + for (var y = 0; y < height; y++) { + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y)); + if ((x >= width / 4 && x < width - width / 4) && (y >= height / 4 && y < height - height / 4)) { + if (!pixel.equals(greenBluePixel)) + numFailedPixels += 1; + } else + if (!pixel.equals(redPixel)) + numFailedPixels += 1; + } + + access = pixels.getAccess(); + + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]); + for (var x = 0; x < width; x++) + for (var y = 0; y < height; y++) { + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y)); + if (!pixel.equals(bluePixel)) + numFailedPixels += 1; + } + access = pixels.getAccess(); + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + sglrReferenceContextTest.Shader = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + }; + + sglrReferenceContextTest.Shader.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + sglrReferenceContextTest.Shader.prototype.constructor = sglrReferenceContextTest.Shader; + + sglrReferenceContextTest.Shader.prototype.init = function() {}; + + sglrReferenceContextTest.Shader.prototype.iterate = function() { + var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + var width = 200; + var height = 188; + var samples = 1; + var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples); + var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer()); + ctx.clearColor(0, 0, 1, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + var vertices = [ + -0.5, 0.5, + 0.5, 0.5, + -0.5, -0.5, + 0.5, 0.5, + 0.5, -0.5, + -0.5, -0.5 + ]; + + var vertices32 = new Float32Array(vertices); + + var squareVerticesBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW); + + var colors = [ + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1 + ]; + + var colors32 = new Float32Array(colors); + + var squareColorsBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW); + + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration(); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexSource(new sglrShaderProgram.VertexSource('')); + + progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource('')); + + /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl); + + //Create program + ctx.createProgram(program); + + //Use program + ctx.useProgram(program); + + var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition'); + var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor'); + ctx.enableVertexAttribArray(vertexPositionAttribute); + ctx.enableVertexAttribArray(vertexColorAttribute); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0); + + ctx.drawQuads(gl.TRIANGLES, 0, 6); + + var pixels = new tcuSurface.Surface(width, height); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + var numFailedPixels = 0; + + var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]); + var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]); + + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(0, 0)); + if (!pixel.equals(bluePixel)) + numFailedPixels += 1; + + pixel = new gluDrawUtil.Pixel(pixels.getPixel(100, 94)); + if (!pixel.equals(redPixel)) + numFailedPixels += 1; + + var access = pixels.getAccess(); + + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + sglrReferenceContextTest.TriangleStrip = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + }; + + sglrReferenceContextTest.TriangleStrip.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + sglrReferenceContextTest.TriangleStrip.prototype.constructor = sglrReferenceContextTest.TriangleStrip; + + sglrReferenceContextTest.TriangleStrip.prototype.init = function() {}; + + sglrReferenceContextTest.TriangleStrip.prototype.iterate = function() { + var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + var width = 200; + var height = 188; + var samples = 1; + var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples); + var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer()); + ctx.clearColor(0, 0, 1, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + var vertices = [ + -0.5, 0.5, + 0.5, 0.5, + -0.5, 0, + 0.5, 0, + -0.5, -0.5, + 0.5, -0.5 + ]; + + var vertices32 = new Float32Array(vertices); + + var squareVerticesBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW); + + var colors = [ + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1 + ]; + + var colors32 = new Float32Array(colors); + + var squareColorsBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW); + + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration(); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexSource(new sglrShaderProgram.VertexSource('')); + + progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource('')); + + /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl); + + //Create program + ctx.createProgram(program); + + //Use program + ctx.useProgram(program); + + var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition'); + var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor'); + ctx.enableVertexAttribArray(vertexPositionAttribute); + ctx.enableVertexAttribArray(vertexColorAttribute); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0); + + ctx.drawQuads(gl.TRIANGLE_STRIP, 0, 6); + + var pixels = new tcuSurface.Surface(width, height); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + var numFailedPixels = 0; + + var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]); + var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]); + + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(0, 0)); + if (!pixel.equals(bluePixel)) + numFailedPixels += 1; + + pixel = new gluDrawUtil.Pixel(pixels.getPixel(100, 94)); + if (!pixel.equals(redPixel)) + numFailedPixels += 1; + + var access = pixels.getAccess(); + + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + sglrReferenceContextTest.TriangleFan = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + }; + + sglrReferenceContextTest.TriangleFan.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + sglrReferenceContextTest.TriangleFan.prototype.constructor = sglrReferenceContextTest.TriangleFan; + + sglrReferenceContextTest.TriangleFan.prototype.init = function() {}; + + sglrReferenceContextTest.TriangleFan.prototype.iterate = function() { + var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + var width = 200; + var height = 188; + var samples = 1; + var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples); + var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer()); + ctx.clearColor(0, 0, 1, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + var vertices = [ + -0.5, 0, + -0.5, 0.5, + 0.5, 0.5, + 0.5, 0, + 0.5, -0.5, + -0.5, -0.5 + ]; + + var vertices32 = new Float32Array(vertices); + + var squareVerticesBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW); + + var colors = [ + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1, + 1, 0, 0, 1 + ]; + + var colors32 = new Float32Array(colors); + + var squareColorsBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW); + + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration(); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexSource(new sglrShaderProgram.VertexSource('')); + + progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource('')); + + /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl); + + //Create program + ctx.createProgram(program); + + //Use program + ctx.useProgram(program); + + var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition'); + var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor'); + ctx.enableVertexAttribArray(vertexPositionAttribute); + ctx.enableVertexAttribArray(vertexColorAttribute); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0); + + ctx.drawQuads(gl.TRIANGLE_FAN, 0, 6); + + var pixels = new tcuSurface.Surface(width, height); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + var numFailedPixels = 0; + + var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]); + var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]); + + var pixel = new gluDrawUtil.Pixel(pixels.getPixel(0, 0)); + if (!pixel.equals(bluePixel)) + numFailedPixels += 1; + + pixel = new gluDrawUtil.Pixel(pixels.getPixel(100, 94)); + if (!pixel.equals(redPixel)) + numFailedPixels += 1; + + var access = pixels.getAccess(); + + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + sglrReferenceContextTest.DrawElements = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + }; + + sglrReferenceContextTest.DrawElements.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + sglrReferenceContextTest.DrawElements.prototype.constructor = sglrReferenceContextTest.DrawElements; + + sglrReferenceContextTest.DrawElements.prototype.init = function() {}; + + sglrReferenceContextTest.DrawElements.prototype.iterate = function() { + var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + var width = 200; + var height = 188; + var samples = 1; + var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples); + var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer()); + ctx.clearColor(0, 0, 1, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + var vertices = [ + -0.5, 0.5, + 0, 0.5, + 0.4, 0.5, + + -0.5, 0.1, + 0, 0.1, + 0.4, 0.1, + + -0.5, -0.7, + 0, -0.7, + 0.4, -0.7 + ]; + + var vertices32 = new Float32Array(vertices); + + var squareVerticesBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW); + + var indices = [ + 0, 1, 3, 1, 3, 4, + 1, 2, 4, 2, 4, 5, + 3, 4, 6, 4, 6, 7, + 4, 5, 7, 5, 7, 8 + ]; + var indicesBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indicesBuffer); + ctx.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW); + + var colors = [ + 1, 0, 0, 1, + 0, 1, 0, 1, + 0, 0, 1, 1, + 1, 1, 1, 1, + 1, 1, 0, 1, + 0, 1, 1, 1, + 1, 0, 1, 1, + 0.5, 0.5, 0.5, 1, + 0, 0, 0, 0 + ]; + + var colors32 = new Float32Array(colors); + + var squareColorsBuffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW); + + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration(); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushVertexSource(new sglrShaderProgram.VertexSource('')); + + progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + + progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource('')); + + /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl); + + //Create program + ctx.createProgram(program); + + //Use program + ctx.useProgram(program); + + var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition'); + var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor'); + ctx.enableVertexAttribArray(vertexPositionAttribute); + ctx.enableVertexAttribArray(vertexColorAttribute); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer); + ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); + + ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer); + ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0); + + ctx.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0); + + var pixels = new tcuSurface.Surface(width, height); + ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr()); + + var numFailedPixels = 0; + + var access = pixels.getAccess(); + + var pixelsTotest = [ + // location, color + [2, 1], [0, 0, 255, 255], + // The red vertex is between 140 and 141 so account for some blending with the white vertex + [50, 140], [255, 5, 5, 255], + [50, 28], [255, 0, 255, 255], + [139, 28], [0, 0, 0, 255], + [50, 102], [255, 255, 255, 255], + [139, 102], [0, 255, 255, 255] + ]; + + var threshold = new tcuRGBA.RGBA([5, 5, 5, 5]); + + for (var i = 0; i < pixelsTotest.length; i += 2) { + var location = pixelsTotest[i]; + var reference = new tcuRGBA.RGBA(pixelsTotest[i + 1]); + var color = access.getPixelInt(location[0], location[1]); + var pixel = new tcuRGBA.RGBA(color); + if (!tcuRGBA.compareThreshold(pixel, reference, threshold)) + numFailedPixels++; + } + + tcuLogImage.logImage('Result', '', access); + + if (numFailedPixels > 0) + testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false); + else + testPassedOptions('Image comparison succeed', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {sglrShaderProgram.ShaderProgramDeclaration} progDecl + */ + sglrReferenceContextTest.ContextShaderProgram = function(progDecl) { + sglrShaderProgram.ShaderProgram.call(this, progDecl); + }; + + sglrReferenceContextTest.ContextShaderProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + sglrReferenceContextTest.ContextShaderProgram.prototype.constructor = sglrReferenceContextTest.ContextShaderProgram; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + sglrReferenceContextTest.ContextShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {number} */ var varyingLocColor = 0; + + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + // Calc output color + /** @type {Array} */ var coord = [1.0, 1.0]; + /** @type {Array} */ var color = [1.0, 1.0, 1.0]; + + for (var attribNdx = 0; attribNdx < this.getVertexShader().getInputs().length; attribNdx++) { + /** @type {number} */ var numComponents = inputs[attribNdx].componentCount; + + var attribValue = rrVertexAttrib.readVertexAttrib(inputs[attribNdx], packet.instanceNdx, packet.vertexNdx, this.getVertexShader().getInputs()[attribNdx].type); + + if (attribNdx == 0) { + coord[0] = attribValue[0]; + coord[1] = attribValue[1]; + } else { + color[0] = attribValue[0] * attribValue[3]; + color[1] = attribValue[1] * attribValue[3]; + color[2] = attribValue[2] * attribValue[3]; + } + } + + // Transform position + packet.position = [coord[0], coord[1], 1.0, 1.0]; + + // Pass color to FS + packet.outputs[varyingLocColor] = [color[0], color[1], color[2], 1.0]; + } + }; + + /** + * @param {Array} packets + * @param {rrShadingContext.FragmentShadingContext} context + */ + sglrReferenceContextTest.ContextShaderProgram.prototype.shadeFragments = function(packets, context) { + var varyingLocColor = 0; + + // Normal shading + for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) + packets[packetNdx].value = rrShadingContext.readTriangleVarying(packets[packetNdx], context, varyingLocColor); + }; + + sglrReferenceContextTest.init = function() { + var state = tcuTestCase.runner; + /** @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases; + + /** @type {tcuTestCase.DeqpTest} */ var referenceContextGroup = tcuTestCase.newTest('reference_context', 'Test reference context'); + + referenceContextGroup.addChild(new sglrReferenceContextTest.ClearContext('clear_context', 'Clear Context Test')); + referenceContextGroup.addChild(new sglrReferenceContextTest.Framebuffer('Framebuffer', 'Framebuffer Test')); + referenceContextGroup.addChild(new sglrReferenceContextTest.Shader('Shaders', 'Drawing using TRIANGLES')); + referenceContextGroup.addChild(new sglrReferenceContextTest.TriangleStrip('TriangleStrip', 'Drawing using TRIANGLE_STRIP')); + referenceContextGroup.addChild(new sglrReferenceContextTest.TriangleFan('TriangleFan', 'Drawing using TRIANGLE_FAN')); + referenceContextGroup.addChild(new sglrReferenceContextTest.DrawElements('DrawElements', 'Drawing using DrawElements and TRIANGLES')); + + testGroup.addChild(referenceContextGroup); + + }; + + sglrReferenceContextTest.run = function(context) { + gl = context; + //Set up Test Root parameters + var testName = 'single_reference_context'; + var testDescription = 'Single Reference Context Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + sglrReferenceContextTest.init(); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js new file mode 100644 index 000000000..3b93dd8f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js @@ -0,0 +1,317 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Reference context utils + *//*--------------------------------------------------------------------*/ + +'use strict'; +goog.provide('framework.opengl.simplereference.sglrReferenceUtils'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.referencerenderer.rrDefs'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrRenderState'); +goog.require('framework.referencerenderer.rrRenderer'); +goog.require('framework.referencerenderer.rrShaders'); +goog.require('framework.referencerenderer.rrVertexAttrib'); + +goog.scope(function() { + + var sglrReferenceUtils = framework.opengl.simplereference.sglrReferenceUtils; + var deMath = framework.delibs.debase.deMath; + var tcuFloat = framework.common.tcuFloat; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrRenderer = framework.referencerenderer.rrRenderer; + var rrDefs = framework.referencerenderer.rrDefs; + var rrShaders = framework.referencerenderer.rrShaders; + var rrRenderState = framework.referencerenderer.rrRenderState; + + /** + * @param {number} type (32-bit, unsigend) + * @return {rrVertexAttrib.VertexAttribType} + * @throws {Error} + */ + sglrReferenceUtils.mapGLPureIntegerVertexAttributeType = function(type) { + switch (type) { + case gl.UNSIGNED_BYTE: return rrVertexAttrib.VertexAttribType.PURE_UINT8; + case gl.UNSIGNED_SHORT: return rrVertexAttrib.VertexAttribType.PURE_UINT16; + case gl.UNSIGNED_INT: return rrVertexAttrib.VertexAttribType.PURE_UINT32; + case gl.BYTE: return rrVertexAttrib.VertexAttribType.PURE_INT8; + case gl.SHORT: return rrVertexAttrib.VertexAttribType.PURE_INT16; + case gl.INT: return rrVertexAttrib.VertexAttribType.PURE_INT32; + default: + throw new Error('Value to do mapping not compatible'); + } + }; + + /** + * @param {number} type (32-bit, unsigend) + * @param {boolean} normalizedInteger + * @param {number} size + * @return {rrVertexAttrib.VertexAttribType} converted value from type to VertexAttribType + * @throws {Error} + */ + sglrReferenceUtils.mapGLFloatVertexAttributeType = function(type, normalizedInteger, size) { + + /** @type {boolean} */ var useClampingNormalization = true; + + switch (type) { + case gl.FLOAT: + return rrVertexAttrib.VertexAttribType.FLOAT; + case gl.HALF_FLOAT: + return rrVertexAttrib.VertexAttribType.HALF; + /* Not supported in WebGL 1/2 case gl.FIXED: + return rrVertexAttrib.VertexAttribType.FIXED; + case gl.DOUBLE: + return rrVertexAttrib.VertexAttribType.DOUBLE; */ + case gl.UNSIGNED_BYTE: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_UINT8; + else + return rrVertexAttrib.VertexAttribType.NONPURE_UNORM8; + + case gl.UNSIGNED_SHORT: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_UINT16; + else + return rrVertexAttrib.VertexAttribType.NONPURE_UNORM16; + + case gl.UNSIGNED_INT: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_UINT32; + else + return rrVertexAttrib.VertexAttribType.NONPURE_UNORM32; + + case gl.UNSIGNED_INT_2_10_10_10_REV: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV; + else + return rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV; + + case gl.BYTE: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_INT8; + else if (useClampingNormalization) + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_CLAMP; + else + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_SCALE; + + case gl.SHORT: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_INT16; + else if (useClampingNormalization) + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_CLAMP; + else + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_SCALE; + + case gl.INT: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_INT32; + else if (useClampingNormalization) + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_CLAMP; + else + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_SCALE; + + case gl.INT_2_10_10_10_REV: + if (!normalizedInteger) + return rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV; + else if (useClampingNormalization) + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP; + else + return rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE; + + default: + throw new Error('Value to do mapping not compatible'); + + } + + }; + + /** + * @param {number} size + * @return {number} + * @throws {Error} + */ + sglrReferenceUtils.mapGLSize = function(size) { + switch (size) { + case 1: return 1; + case 2: return 2; + case 3: return 3; + case 4: return 4; + /* NOT in GL + case gl.BGRA: return 4; + */ + + default: + throw new Error('Value to do mapping not compatible'); + } + }; + + /** + * @param {number} type (32-bit, unsigned) + * @return {rrRenderer.PrimitiveType} + * @throws {Error} + */ + sglrReferenceUtils.mapGLPrimitiveType = function(type) { + switch (type) { + case gl.TRIANGLES: return rrRenderer.PrimitiveType.TRIANGLES; + case gl.TRIANGLE_STRIP: return rrRenderer.PrimitiveType.TRIANGLE_STRIP; + case gl.TRIANGLE_FAN: return rrRenderer.PrimitiveType.TRIANGLE_FAN; + case gl.LINES: return rrRenderer.PrimitiveType.LINES; + case gl.LINE_STRIP: return rrRenderer.PrimitiveType.LINE_STRIP; + case gl.LINE_LOOP: return rrRenderer.PrimitiveType.LINE_LOOP; + case gl.POINTS: return rrRenderer.PrimitiveType.POINTS; + + default: + throw new Error('Value to do mapping not compatible'); + } + }; + + /** + * @param {number} type (32-bit, unsigned) + * @return {rrDefs.IndexType} + * @throws {Error} + */ + sglrReferenceUtils.mapGLIndexType = function(type) { + switch (type) { + case gl.UNSIGNED_BYTE: return rrDefs.IndexType.INDEXTYPE_UINT8; + case gl.UNSIGNED_SHORT: return rrDefs.IndexType.INDEXTYPE_UINT16; + case gl.UNSIGNED_INT: return rrDefs.IndexType.INDEXTYPE_UINT32; + default: + throw new Error('Value to do mapping not compatible'); + } + }; + + /** + * @param {number} func (deUint32) + * @return {rrRenderState.TestFunc} + * @throws {Error} + */ + sglrReferenceUtils.mapGLTestFunc = function(func) { + switch (func) { + case gl.ALWAYS: return rrRenderState.TestFunc.ALWAYS; + case gl.EQUAL: return rrRenderState.TestFunc.EQUAL; + case gl.GEQUAL: return rrRenderState.TestFunc.GEQUAL; + case gl.GREATER: return rrRenderState.TestFunc.GREATER; + case gl.LEQUAL: return rrRenderState.TestFunc.LEQUAL; + case gl.LESS: return rrRenderState.TestFunc.LESS; + case gl.NEVER: return rrRenderState.TestFunc.NEVER; + case gl.NOTEQUAL: return rrRenderState.TestFunc.NOTEQUAL; + default: + throw new Error('Value to do mapping not compatible'); + } + }; + + /** + * @param {number} op (deUint32) + * @return {rrRenderState.StencilOp} + * @throws {Error} + */ + sglrReferenceUtils.mapGLStencilOp = function(op) { + switch (op) { + case gl.KEEP: return rrRenderState.StencilOp.KEEP; + case gl.ZERO: return rrRenderState.StencilOp.ZERO; + case gl.REPLACE: return rrRenderState.StencilOp.REPLACE; + case gl.INCR: return rrRenderState.StencilOp.INCR; + case gl.DECR: return rrRenderState.StencilOp.DECR; + case gl.INCR_WRAP: return rrRenderState.StencilOp.INCR_WRAP; + case gl.DECR_WRAP: return rrRenderState.StencilOp.DECR_WRAP; + case gl.INVERT: return rrRenderState.StencilOp.INVERT; + default: + throw new Error('Value to do mapping not compatible'); + } + }; + + /** + * @param {number} equation (deUint32) + * @return {rrRenderState.BlendEquation} + * @throws {Error} + */ + sglrReferenceUtils.mapGLBlendEquation = function(equation) { + switch (equation) { + case gl.FUNC_ADD: return rrRenderState.BlendEquation.ADD; + case gl.FUNC_SUBTRACT: return rrRenderState.BlendEquation.SUBTRACT; + case gl.FUNC_REVERSE_SUBTRACT: return rrRenderState.BlendEquation.REVERSE_SUBTRACT; + case gl.MIN: return rrRenderState.BlendEquation.MIN; + case gl.MAX: return rrRenderState.BlendEquation.MAX; + default: + throw new Error('Value to do mapping not compatible'); + } + }; + + /** + * @param {number} equation (deUint32) + * @return {rrRenderState.BlendEquationAdvanced} + * @throws {Error} + */ + /*sglrReferenceUtils.mapGLBlendEquationAdvanced = function(equation) { + switch (equation) { + case gl.MULTIPLY_KHR: return rrRenderState.BlendEquationAdvanced.MULTIPLY; + case gl.SCREEN_KHR: return rrRenderState.BlendEquationAdvanced.SCREEN; + case gl.OVERLAY_KHR: return rrRenderState.BlendEquationAdvanced.OVERLAY; + case gl.DARKEN_KHR: return rrRenderState.BlendEquationAdvanced.DARKEN; + case gl.LIGHTEN_KHR: return rrRenderState.BlendEquationAdvanced.LIGHTEN; + case gl.COLORDODGE_KHR: return rrRenderState.BlendEquationAdvanced.COLORDODGE; + case gl.COLORBURN_KHR: return rrRenderState.BlendEquationAdvanced.COLORBURN; + case gl.HARDLIGHT_KHR: return rrRenderState.BlendEquationAdvanced.HARDLIGHT; + case gl.SOFTLIGHT_KHR: return rrRenderState.BlendEquationAdvanced.SOFTLIGHT; + case gl.DIFFERENCE_KHR: return rrRenderState.BlendEquationAdvanced.DIFFERENCE; + case gl.EXCLUSION_KHR: return rrRenderState.BlendEquationAdvanced.EXCLUSION; + case gl.HSL_HUE_KHR: return rrRenderState.BlendEquationAdvanced.HSL_HUE; + case gl.HSL_SATURATION_KHR: return rrRenderState.BlendEquationAdvanced.HSL_SATURATION; + case gl.HSL_COLOR_KHR: return rrRenderState.BlendEquationAdvanced.HSL_COLOR; + case gl.HSL_LUMINOSITY_KHR: return rrRenderState.BlendEquationAdvanced.HSL_LUMINOSITY; + default: + throw new Error("Value to do mapping not compatible"); + } + };*/ + + /** + * @param {number} func (deUint32) + * @return {rrRenderState.BlendFunc} + * @throws {Error} + */ + sglrReferenceUtils.mapGLBlendFunc = function(func) { + switch (func) { + case gl.ZERO: return rrRenderState.BlendFunc.ZERO; + case gl.ONE: return rrRenderState.BlendFunc.ONE; + case gl.SRC_COLOR: return rrRenderState.BlendFunc.SRC_COLOR; + case gl.ONE_MINUS_SRC_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_SRC_COLOR; + case gl.DST_COLOR: return rrRenderState.BlendFunc.DST_COLOR; + case gl.ONE_MINUS_DST_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_DST_COLOR; + case gl.SRC_ALPHA: return rrRenderState.BlendFunc.SRC_ALPHA; + case gl.ONE_MINUS_SRC_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_SRC_ALPHA; + case gl.DST_ALPHA: return rrRenderState.BlendFunc.DST_ALPHA; + case gl.ONE_MINUS_DST_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_DST_ALPHA; + case gl.CONSTANT_COLOR: return rrRenderState.BlendFunc.CONSTANT_COLOR; + case gl.ONE_MINUS_CONSTANT_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_COLOR; + case gl.CONSTANT_ALPHA: return rrRenderState.BlendFunc.CONSTANT_ALPHA; + case gl.ONE_MINUS_CONSTANT_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_ALPHA; + case gl.SRC_ALPHA_SATURATE: return rrRenderState.BlendFunc.SRC_ALPHA_SATURATE; + // case gl.SRC1_COLOR: return rrRenderState.BlendFunc.SRC1_COLOR; + // case gl.ONE_MINUS_SRC1_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_SRC1_COLOR; + // case gl.SRC1_ALPHA: return rrRenderState.BlendFunc.SRC1_ALPHA; + // case gl.ONE_MINUS_SRC1_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_SRC1_ALPHA; + default: + throw new Error('Value to do mapping not compatible'); + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js new file mode 100644 index 000000000..f5201a531 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js @@ -0,0 +1,336 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.referencerenderer.rrDefs'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrShaders'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); + +goog.scope(function() { + + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var rrShaders = framework.referencerenderer.rrShaders; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var tcuTexture = framework.common.tcuTexture; + var deMath = framework.delibs.debase.deMath; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var rrDefs = framework.referencerenderer.rrDefs; + var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrVertexPacket = framework.referencerenderer.rrVertexPacket; + var rrShadingContext = framework.referencerenderer.rrShadingContext; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * sglrShaderProgram.VaryingFlags + * @constructor + * @struct + */ + sglrShaderProgram.VaryingFlags = function() { + this.NONE = true; //TODO: is NONE necessary? + this.FLATSHADE = false; + }; + + /** + * sglrShaderProgram.VertexAttribute + * @constructor + * @param {string} name_ + * @param {rrGenericVector.GenericVecType} type_ + */ + sglrShaderProgram.VertexAttribute = function(name_, type_) { + this.name = name_; + this.type = type_; + }; + + /** + * sglrShaderProgram.VertexToFragmentVarying + * @constructor + * @param {rrGenericVector.GenericVecType} type_ + * @param {sglrShaderProgram.VaryingFlags=} flags + */ + sglrShaderProgram.VertexToFragmentVarying = function(type_, flags) { + this.type = type_; + this.flatshade = flags === undefined ? new sglrShaderProgram.VaryingFlags().FLATSHADE : flags.FLATSHADE; + }; + + /** + * sglrShaderProgram.FragmentOutput + * @constructor + * @param {rrGenericVector.GenericVecType} type_ + */ + sglrShaderProgram.FragmentOutput = function(type_) { + /** @type {rrGenericVector.GenericVecType} */ this.type = type_; + }; + + /** + * sglrShaderProgram.Uniform + * @constructor + * @param {string} name_ + * @param {gluShaderUtil.DataType} type_ + */ + sglrShaderProgram.Uniform = function(name_, type_) { + /** @type {string} */ this.name = name_; + /** @type {gluShaderUtil.DataType} */ this.type = type_; + /** @type {Array} */ this.value; + /** @type {?rrDefs.Sampler} */ this.sampler = null; + }; + + /** + * sglrShaderProgram.VertexSource + * @constructor + * @param {string} str + */ + sglrShaderProgram.VertexSource = function(str) { + /** @type {string} */ this.source = str; + }; + + /** + * sglrShaderProgram.FragmentSource + * @constructor + * @param {string} str + */ + sglrShaderProgram.FragmentSource = function(str) { + /** @type {string} */ this.source = str; + }; + + /** + * sglrShaderProgram.ShaderProgramDeclaration + * @constructor + */ + sglrShaderProgram.ShaderProgramDeclaration = function() { + /** @type {Array} */ this.m_vertexAttributes = []; + /** @type {Array} */ this.m_vertexToFragmentVaryings = []; + /** @type {Array} */ this.m_fragmentOutputs = []; + /** @type {Array} */ this.m_uniforms = []; + /** @type {string} */ this.m_vertexSource; + /** @type {string} */ this.m_fragmentSource; + + /** @type {boolean} */ this.m_vertexShaderSet = false; + /** @type {boolean} */ this.m_fragmentShaderSet = false; + }; + + /** + * Add a vertex attribute to the shader program declaration. + * @param {sglrShaderProgram.VertexAttribute} v + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.pushVertexAttribute = function(v) { + this.m_vertexAttributes.push(v); + return this; + }; + + /** + * Add a vertex to fragment varying to the shader program declaration. + * @param {sglrShaderProgram.VertexToFragmentVarying} v + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.pushVertexToFragmentVarying = function(v) { + this.m_vertexToFragmentVaryings.push(v); + return this; + }; + + /** + * Add a fragment output to the shader program declaration. + * @param {sglrShaderProgram.FragmentOutput} v + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.pushFragmentOutput = function(v) { + this.m_fragmentOutputs.push(v); + return this; + }; + + /** + * Add a uniform to the shader program declaration. + * @param {sglrShaderProgram.Uniform} v + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.pushUniform = function(v) { + this.m_uniforms.push(v); + return this; + }; + + /** + * @param {sglrShaderProgram.VertexSource} c + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.pushVertexSource = function(c) { + DE_ASSERT(!this.m_vertexShaderSet); + this.m_vertexSource = c.source; + this.m_vertexShaderSet = true; + return this; + }; + + /** + * @param {sglrShaderProgram.FragmentSource} c + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.pushFragmentSource = function(c) { + DE_ASSERT(!this.m_fragmentSource); + /** @type {sglrShaderProgram.FragmentSource} */ this.m_fragmentSource = c.source; + /** @type {boolean} */ this.m_fragmentShaderSet = true; + return this; + }; + + /** + * @return {boolean} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.valid = function() { + if (!this.m_vertexShaderSet || !this.m_fragmentShaderSet) + return false; + + if (this.m_fragmentOutputs.length == 0) + return false; + + return true; + }; + + /** + * @return {number} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.getVertexInputCount = function() { + return this.m_vertexAttributes.length; + }; + + /** + * @return {number} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.getVertexOutputCount = function() { + return this.m_vertexToFragmentVaryings.length; + }; + + /** + * @return {number} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.getFragmentInputCount = function() { + return this.m_vertexToFragmentVaryings.length; + }; + + /** + * @return {number} + */ + sglrShaderProgram.ShaderProgramDeclaration.prototype.getFragmentOutputCount = function() { + return this.m_fragmentOutputs.length; + }; + + /** + * @constructor + * @param {sglrShaderProgram.ShaderProgramDeclaration} decl + */ + sglrShaderProgram.ShaderProgram = function(decl) { + /** @type {rrShaders.VertexShader} */ this.vertexShader = new rrShaders.VertexShader(decl.getVertexInputCount(), decl.getVertexOutputCount()); + /** @type {rrShaders.FragmentShader} */ this.fragmentShader = new rrShaders.FragmentShader(decl.getFragmentInputCount(), decl.getFragmentOutputCount()); + + /** @type {Array} */ this.m_attributeNames = []; + /** @type {Array} */ this.m_uniforms = []; + /** @type {string} */ this.m_vertSrc = decl.m_vertexSource; + /** @type {string} */ this.m_fragSrc = decl.m_fragmentSource; + + DE_ASSERT(decl.valid()); + + // Set up shader IO + + for (var ndx = 0; ndx < decl.m_vertexAttributes.length; ++ndx) { + this.vertexShader.m_inputs[ndx].type = decl.m_vertexAttributes[ndx].type; + this.m_attributeNames[ndx] = decl.m_vertexAttributes[ndx].name; + } + + for (var ndx = 0; ndx < decl.m_vertexToFragmentVaryings.length; ++ndx) { + this.vertexShader.m_outputs[ndx].type = decl.m_vertexToFragmentVaryings[ndx].type; + this.vertexShader.m_outputs[ndx].flatshade = decl.m_vertexToFragmentVaryings[ndx].flatshade; + + this.fragmentShader.m_inputs[ndx] = this.vertexShader.m_outputs[ndx]; + } + + for (var ndx = 0; ndx < decl.m_fragmentOutputs.length; ++ndx) + this.fragmentShader.m_outputs[ndx].type = decl.m_fragmentOutputs[ndx].type; + + // Set up uniforms + + for (var ndx = 0; ndx < decl.m_uniforms.length; ++ndx) + this.m_uniforms[ndx] = new sglrShaderProgram.Uniform(decl.m_uniforms[ndx].name, decl.m_uniforms[ndx].type); + }; + + /** + * @return {rrShaders.VertexShader} + */ + sglrShaderProgram.ShaderProgram.prototype.getVertexShader = function() { + return this.vertexShader; + }; + + /** + * @return {rrShaders.FragmentShader} + */ + sglrShaderProgram.ShaderProgram.prototype.getFragmentShader = function() { + return this.fragmentShader; + }; + + /** + * @param {string} name + * @return {sglrShaderProgram.Uniform} + * @throws {Error} + */ + sglrShaderProgram.ShaderProgram.prototype.getUniformByName = function(name) { + DE_ASSERT(name); + + for (var ndx = 0; ndx < this.m_uniforms.length; ++ndx) + if (this.m_uniforms[ndx].name == name) + return this.m_uniforms[ndx]; + + throw new Error('Invalid uniform name, uniform not found.'); + }; + + /** + * shadeFragments - abstract function, to be implemented by children classes + * @param {Array} packets + * @param {rrShadingContext.FragmentShadingContext} context + * @throws {Error} + */ + sglrShaderProgram.ShaderProgram.prototype.shadeFragments = function(packets, context) { + throw new Error('This function needs to be overwritten in a child class.'); + }; + + /** + * shadeVertices - abstract function, to be implemented by children classes + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + * @throws {Error} + */ + sglrShaderProgram.ShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) { + throw new Error('This function needs to be overwritten in a child class.'); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js new file mode 100644 index 000000000..c0400465e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js @@ -0,0 +1,72 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrDefs'); + +goog.scope(function() { + +var rrDefs = framework.referencerenderer.rrDefs; + +/** + * @enum + */ +rrDefs.FaceType = { + FACETYPE_FRONT: 0, + FACETYPE_BACK: 1 +}; + +/** + * @enum + */ +rrDefs.IndexType = { + INDEXTYPE_UINT8: 0, + INDEXTYPE_UINT16: 1, + INDEXTYPE_UINT32: 2 +}; + +/** + * @enum + */ +rrDefs.ProvokingVertex = { + PROVOKINGVERTEX_FIRST: 1, + PROVOKINGVERTEX_LAST: 2 // \note valid value, "last vertex", not last of enum +}; + +/** + * @interface + */ +rrDefs.Sampler = function() {}; + +/** + * @param {Array} pos + * @param {number=} lod + * @return {Array} + */ +rrDefs.Sampler.prototype.sample = function(pos, lod) {}; + +/** + * @param {Array>} packetTexcoords 4 coordinates + * @param {number} lodBias + * @return {Array>} 4 vec4 samples + */ +rrDefs.Sampler.prototype.sample4 = function(packetTexcoords, lodBias) {}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js new file mode 100644 index 000000000..a9c2a1f46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js @@ -0,0 +1,583 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.referencerenderer.rrRenderState'); + +goog.scope(function() { + +var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; +var deMath = framework.delibs.debase.deMath; +var rrRenderState = framework.referencerenderer.rrRenderState; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; + +/** Return oldValue with the bits indicated by mask replaced by corresponding bits of newValue. + * @param {number} oldValue + * @param {number} newValue + * @param {number} mask + * @return {number} + */ +rrFragmentOperations.maskedBitReplace = function(oldValue, newValue, mask) { + return (oldValue & ~mask) | (newValue & mask); +}; + +/** + * @param {Array} point + * @param {?} rect + * @return {boolean} + */ +rrFragmentOperations.isInsideRect = function(point, rect) { + return deMath.deInBounds32(point[0], rect.left, rect.left + rect.width) && + deMath.deInBounds32(point[1], rect.bottom, rect.bottom + rect.height); +}; + +/** + * @constructor + * @param {Array} coefficents + * @param {Array} coords + * @param {number} depth + */ +rrFragmentOperations.Fragment = function(coefficents, coords, depth) { + /** @type {Array} */ this.barycentric = coefficents; + /** @type {Array} */ this.pixelCoord = coords; + /** @type {boolean} */ this.isAlive = true; + /** @type {boolean} */ this.stencilPassed = true; + /** @type {boolean} */ this.depthPassed = true; + /** @type {Array} */ this.sampleDepths = [depth]; + /** @type {Array} */ this.clampedBlendSrcColor = []; + /** @type {Array} */ this.clampedBlendSrc1Color = []; + /** @type {Array} */ this.clampedBlendDstColor = []; + /** @type {Array} */ this.blendSrcFactorRGB = []; + /** @type {number} */ this.blendSrcFactorA = NaN; + /** @type {Array} */ this.blendDstFactorRGB = []; + /** @type {number} */ this.blendDstFactorA = NaN; + /** @type {Array} */ this.blendedRGB = []; + /** @type {number} */ this.blendedA = NaN; + /** @type {Array} */ this.signedValue = []; //!< integer targets + /** @type {Array} */ this.unsignedValue = []; //!< unsigned integer targets + /** @type {Array} */ this.value = []; /*TODO: what type should it be? */ + /** @type {Array} */ this.value1 = []; /*TODO: what type should it be? */ +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {rrRenderState.WindowRectangle} scissorRect + */ +rrFragmentOperations.executeScissorTest = function(inputFragments, scissorRect) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + if (!rrFragmentOperations.isInsideRect(frag.pixelCoord, scissorRect)) + frag.isAlive = false; + } + } +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {rrRenderState.StencilState} stencilState + * @param {number} numStencilBits + * @param {tcuTexture.PixelBufferAccess} stencilBuffer + */ +rrFragmentOperations.executeStencilCompare = function(inputFragments, stencilState, numStencilBits, stencilBuffer) { + var clampedStencilRef = deMath.clamp(stencilState.ref, 0, (1 << numStencilBits) - 1); + + /** + * @param {function(number=,number=):boolean} expression + */ + var sample_register_stencil_compare = function(expression) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var fragSampleNdx = 0; + var stencilBufferValue = stencilBuffer.getPixStencil(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + var maskedRef = stencilState.compMask & clampedStencilRef; + var maskedBuf = stencilState.compMask & stencilBufferValue; + frag.stencilPassed = expression(maskedRef, maskedBuf); + } + } + }; + + switch (stencilState.func) { + case rrRenderState.TestFunc.NEVER: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return false;}); break; + case rrRenderState.TestFunc.ALWAYS: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return true;}); break; + case rrRenderState.TestFunc.LESS: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef < maskedBuf;}); break; + case rrRenderState.TestFunc.LEQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef <= maskedBuf;}); break; + case rrRenderState.TestFunc.GREATER: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef > maskedBuf;}); break; + case rrRenderState.TestFunc.GEQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef >= maskedBuf;}); break; + case rrRenderState.TestFunc.EQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef == maskedBuf;}); break; + case rrRenderState.TestFunc.NOTEQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef != maskedBuf;}); break; + default: + throw new Error('Unrecognized stencil test function:' + stencilState.func); + } +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {rrRenderState.StencilState} stencilState + * @param {number} numStencilBits + * @param {tcuTexture.PixelBufferAccess} stencilBuffer + */ +rrFragmentOperations.executeStencilSFail = function(inputFragments, stencilState, numStencilBits, stencilBuffer) { + var clampedStencilRef = deMath.clamp(stencilState.ref, 0, (1 << numStencilBits) - 1); + /** + * @param {function(number,number):number} expression + */ + var sample_register_sfail = function(expression) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive && !frag.stencilPassed) { + var fragSampleNdx = 0; + var stencilBufferValue = stencilBuffer.getPixStencil(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + stencilBuffer.setPixStencil(rrFragmentOperations.maskedBitReplace(stencilBufferValue, expression(stencilBufferValue, numStencilBits), stencilState.writeMask), fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + frag.isAlive = false; + } + } + }; + + switch (stencilState.sFail) { + case rrRenderState.StencilOp.KEEP: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return stencilBufferValue;}); break; + case rrRenderState.StencilOp.ZERO: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return 0;}); break; + case rrRenderState.StencilOp.REPLACE: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return clampedStencilRef;}); break; + case rrRenderState.StencilOp.INCR: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue + 1, 0, (1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.DECR: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue - 1, 0, (1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.INCR_WRAP: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return (stencilBufferValue + 1) & ((1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.DECR_WRAP: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return (stencilBufferValue - 1) & ((1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.INVERT: + sample_register_sfail(function(stencilBufferValue, numStencilBits) { return (~stencilBufferValue) & ((1 << numStencilBits) - 1);}); break; + default: + throw new Error('Unrecognized stencil op:' + stencilState.sFail); + } + +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {rrRenderState.TestFunc} depthFunc + * @param {tcuTexture.PixelBufferAccess} depthBuffer + */ +rrFragmentOperations.executeDepthCompare = function(inputFragments, depthFunc, depthBuffer) { + /** + * @param {function(number=,number=):boolean} expression + */ + var convertToDepthBuffer = false; + + var access; + if (depthBuffer.getFormat().type != tcuTexture.ChannelType.FLOAT && + depthBuffer.getFormat().type != tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV) { + access = new tcuTexture.PixelBufferAccess({ + format: depthBuffer.getFormat(), + width: 1, + height: 1, + depth: 1, + data: new ArrayBuffer(8) + }); + convertToDepthBuffer = true; + } + + var sample_register_depth_compare = function(expression) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var fragSampleNdx = 0; + var depthBufferValue = depthBuffer.getPixDepth(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + var sampleDepthFloat = frag.sampleDepths[fragSampleNdx]; + + var sampleDepth; + if (convertToDepthBuffer) { + /* convert input float to target buffer format for comparison */ + access.setPixDepth(sampleDepthFloat, 0, 0, 0); + sampleDepth = access.getPixDepth(0, 0, 0); + } else { + sampleDepth = deMath.clamp(sampleDepthFloat, 0.0, 1.0); + } + + frag.depthPassed = expression(sampleDepth, depthBufferValue); + } + } + }; + + switch (depthFunc) { + case rrRenderState.TestFunc.NEVER: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return false;}); break; + case rrRenderState.TestFunc.ALWAYS: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return true;}); break; + case rrRenderState.TestFunc.LESS: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth < depthBufferValue;}); break; + case rrRenderState.TestFunc.LEQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth <= depthBufferValue;}); break; + case rrRenderState.TestFunc.GREATER: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth > depthBufferValue;}); break; + case rrRenderState.TestFunc.GEQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth >= depthBufferValue;}); break; + case rrRenderState.TestFunc.EQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth == depthBufferValue;}); break; + case rrRenderState.TestFunc.NOTEQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth != depthBufferValue;}); break; + default: + throw new Error('Unrecognized depth function:' + depthFunc); + } +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {tcuTexture.PixelBufferAccess} depthBuffer + */ +rrFragmentOperations.executeDepthWrite = function(inputFragments, depthBuffer) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive && frag.depthPassed) { + var fragSampleNdx = 0; + var clampedDepth = deMath.clamp(frag.sampleDepths[fragSampleNdx], 0.0, 1.0); + depthBuffer.setPixDepth(clampedDepth, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + } + } +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {rrRenderState.StencilState} stencilState + * @param {number} numStencilBits + * @param {tcuTexture.PixelBufferAccess} stencilBuffer + */ +rrFragmentOperations.executeStencilDpFailAndPass = function(inputFragments, stencilState, numStencilBits, stencilBuffer) { + var clampedStencilRef = deMath.clamp(stencilState.ref, 0, (1 << numStencilBits) - 1); + + /** + * @param {function(boolean):boolean} condition + * @param {function(number,number):number} expression + */ + var sample_register_dpfail_or_dppass = function(condition, expression) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive && condition(frag.depthPassed)) { + var fragSampleNdx = 0; + var stencilBufferValue = stencilBuffer.getPixStencil(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + stencilBuffer.setPixStencil(rrFragmentOperations.maskedBitReplace(stencilBufferValue, expression(stencilBufferValue, numStencilBits), stencilState.writeMask), fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + } + } + }; + + var switch_dpfail_or_dppass = function(op_name, condition) { + switch (stencilState[op_name]) { + case rrRenderState.StencilOp.KEEP: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return stencilBufferValue;}); break; + case rrRenderState.StencilOp.ZERO: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return 0;}); break; + case rrRenderState.StencilOp.REPLACE: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return clampedStencilRef;}); break; + case rrRenderState.StencilOp.INCR: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue + 1, 0, (1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.DECR: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue - 1, 0, (1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.INCR_WRAP: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return (stencilBufferValue + 1) & ((1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.DECR_WRAP: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return (stencilBufferValue - 1) & ((1 << numStencilBits) - 1);}); break; + case rrRenderState.StencilOp.INVERT: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return (~stencilBufferValue) & ((1 << numStencilBits) - 1);}); break; + default: + throw new Error('Unrecognized stencil operation:' + op_name); + } + }; + + var passed = function(depthPassed) { return depthPassed;}; + var failed = function(depthPassed) { return !depthPassed;}; + + switch_dpfail_or_dppass('dpFail', failed); + switch_dpfail_or_dppass('dpPass', passed); +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {Array} blendColor + * @param {rrRenderState.BlendState} blendRGBState + */ +rrFragmentOperations.executeBlendFactorComputeRGB = function(inputFragments, blendColor, blendRGBState) { + /** + * @param {string} factor_name + * @param {function(Array, Array, Array):Array} expression + */ + var sample_register_blend_factor = function(factor_name, expression) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var src = frag.clampedBlendSrcColor; + var src1 = frag.clampedBlendSrc1Color; + var dst = frag.clampedBlendDstColor; + frag[factor_name] = deMath.clampVector(expression(src, src1, dst), 0, 1); + } + } + }; + + var switch_src_or_dst_factor_rgb = function(func_name, factor_name) { + switch (blendRGBState[func_name]) { + case rrRenderState.BlendFunc.ZERO: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [0, 0, 0];}); break; + case rrRenderState.BlendFunc.ONE: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1, 1, 1];}); break; + case rrRenderState.BlendFunc.SRC_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(src, [0, 1, 2]);}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(src, [0, 1, 2]));}); break; + case rrRenderState.BlendFunc.DST_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(dst, [0, 1, 2]);}); break; + case rrRenderState.BlendFunc.ONE_MINUS_DST_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(dst, [0, 1, 2]));}); break; + case rrRenderState.BlendFunc.SRC_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [src[3], src[3], src[3]];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - src[3], 1.0 - src[3], 1.0 - src[3]];}); break; + case rrRenderState.BlendFunc.DST_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [dst[3], dst[3], dst[3]];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_DST_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - dst[3], 1.0 - dst[3], 1.0 - dst[3]];}); break; + case rrRenderState.BlendFunc.CONSTANT_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(blendColor, [0, 1, 2]);}); break; + case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(blendColor, [0, 1, 2]));}); break; + case rrRenderState.BlendFunc.CONSTANT_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [blendColor[3], blendColor[3], blendColor[3]];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - blendColor[3], 1.0 - blendColor[3], 1.0 - blendColor[3]];}); break; + case rrRenderState.BlendFunc.SRC_ALPHA_SATURATE: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [Math.min(src[3], 1.0 - dst[3]), Math.min(src[3], 1.0 - dst[3]), Math.min(src[3], 1.0 - dst[3])];}); break; + case rrRenderState.BlendFunc.SRC1_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(src1, [0, 1, 2]);}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC1_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(src1, [0, 1, 2]));}); break; + case rrRenderState.BlendFunc.SRC1_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [src1[3], src1[3], src1[3]];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC1_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - src1[3], 1.0 - src1[3], 1.0 - src1[3]];}); break; + default: + throw new Error('Unrecognized blend function:' + func_name); + } + }; + + switch_src_or_dst_factor_rgb('srcFunc', 'blendSrcFactorRGB'); + switch_src_or_dst_factor_rgb('dstFunc', 'blendDstFactorRGB'); + +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {Array} blendColor + * @param {rrRenderState.BlendState} blendAState + */ +rrFragmentOperations.executeBlendFactorComputeA = function(inputFragments, blendColor, blendAState) { + /** + * @param {string} factor_name + * @param {function(Array, Array, Array):number} expression + */ + var sample_register_blend_factor = function(factor_name, expression) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var src = frag.clampedBlendSrcColor; + var src1 = frag.clampedBlendSrc1Color; + var dst = frag.clampedBlendDstColor; + frag[factor_name] = deMath.clamp(expression(src, src1, dst), 0, 1); + } + } + }; + + var swictch_src_or_dst_factor_a = function(func_name, factor_name) { + switch (blendAState[func_name]) { + case rrRenderState.BlendFunc.ZERO: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 0.0;}); break; + case rrRenderState.BlendFunc.ONE: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0;}); break; + case rrRenderState.BlendFunc.SRC_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return src[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src[3];}); break; + case rrRenderState.BlendFunc.DST_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return dst[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_DST_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - dst[3];}); break; + case rrRenderState.BlendFunc.SRC_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return src[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src[3];}); break; + case rrRenderState.BlendFunc.DST_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return dst[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_DST_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - dst[3];}); break; + case rrRenderState.BlendFunc.CONSTANT_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return blendColor[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - blendColor[3];}); break; + case rrRenderState.BlendFunc.CONSTANT_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return blendColor[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - blendColor[3];}); break; + case rrRenderState.BlendFunc.SRC_ALPHA_SATURATE: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0;}); break; + case rrRenderState.BlendFunc.SRC1_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return src1[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC1_COLOR: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src1[3];}); break; + case rrRenderState.BlendFunc.SRC1_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return src1[3];}); break; + case rrRenderState.BlendFunc.ONE_MINUS_SRC1_ALPHA: + sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src1[3];}); break; + default: + throw new Error('Unrecognized blend function:' + func_name); + } + }; + + swictch_src_or_dst_factor_a('srcFunc', 'blendSrcFactorA'); + swictch_src_or_dst_factor_a('dstFunc', 'blendDstFactorA'); +}; + +/** + * @param {Array} inputFragments Fragments to write + * @param {rrRenderState.BlendState} blendRGBState + * @param {rrRenderState.BlendState} blendAState + */ +rrFragmentOperations.executeBlend = function(inputFragments, blendRGBState, blendAState) { + var sample_register_blended_color = function(color_name, expression) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var src = frag.clampedBlendSrcColor; + var dst = frag.clampedBlendDstColor; + frag[color_name] = expression(src, dst, frag); + } + } + }; + + switch (blendRGBState.equation) { + case rrRenderState.BlendEquation.ADD: + sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.add(deMath.multiply(deMath.swizzle(src, [0, 1, 2]), frag.blendSrcFactorRGB), deMath.multiply(deMath.swizzle(dst, [0, 1, 2]), frag.blendDstFactorRGB));}); break; + case rrRenderState.BlendEquation.SUBTRACT: + sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.subtract(deMath.multiply(deMath.swizzle(src, [0, 1, 2]), frag.blendSrcFactorRGB), deMath.multiply(deMath.swizzle(dst, [0, 1, 2]), frag.blendDstFactorRGB));}); break; + case rrRenderState.BlendEquation.REVERSE_SUBTRACT: + sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.subtract(deMath.multiply(deMath.swizzle(dst, [0, 1, 2]), frag.blendDstFactorRGB), deMath.multiply(deMath.swizzle(src, [0, 1, 2]), frag.blendSrcFactorRGB));}); break; + case rrRenderState.BlendEquation.MIN: + sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.min(deMath.swizzle(src, [0, 1, 2]), deMath.swizzle(dst, [0, 1, 2]));}); break; + case rrRenderState.BlendEquation.MAX: + sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.max(deMath.swizzle(src, [0, 1, 2]), deMath.swizzle(dst, [0, 1, 2]));}); break; + default: + throw new Error('Unrecognized blend equation:' + blendRGBState.equation); + } + + switch (blendAState.equation) { + case rrRenderState.BlendEquation.ADD: + sample_register_blended_color('blendedA', function(src, dst, frag) { return src[3] * frag.blendSrcFactorA + dst[3] * frag.blendDstFactorA;}); break; + case rrRenderState.BlendEquation.SUBTRACT: + sample_register_blended_color('blendedA', function(src, dst, frag) { return src[3] * frag.blendSrcFactorA - dst[3] * frag.blendDstFactorA;}); break; + case rrRenderState.BlendEquation.REVERSE_SUBTRACT: + sample_register_blended_color('blendedA', function(src, dst, frag) { return dst[3] * frag.blendDstFactorA - src[3] * frag.blendSrcFactorA;}); break; + case rrRenderState.BlendEquation.MIN: + sample_register_blended_color('blendedA', function(src, dst, frag) { return Math.min(src[3], dst[3]);}); break; + case rrRenderState.BlendEquation.MAX: + sample_register_blended_color('blendedA', function(src, dst, frag) { return Math.max(src[3], dst[3]);}); break; + default: + throw new Error('Unrecognized blend equation:' + blendAState.equation); + } +}; + +/** + * @param {Array} inputFragments + * @param {boolean} isSRGB + * @param {tcuTexture.PixelBufferAccess} colorBuffer + */ +rrFragmentOperations.executeColorWrite = function(inputFragments, isSRGB, colorBuffer) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var combinedColor = frag.blendedRGB.slice(); + combinedColor[3] = frag.blendedA; + if (isSRGB) + combinedColor = tcuTextureUtil.linearToSRGB(combinedColor); + + colorBuffer.setPixel(combinedColor, 0, frag.pixelCoord[0], frag.pixelCoord[1]); + } + } +}; + +/** + * @param {Array} inputFragments + * @param {Array} colorMaskFactor + * @param {Array} colorMaskNegationFactor + * @param {boolean} isSRGB + * @param {tcuTexture.PixelBufferAccess} colorBuffer + */ +rrFragmentOperations.executeMaskedColorWrite = function(inputFragments, colorMaskFactor, colorMaskNegationFactor, isSRGB, colorBuffer) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var fragSampleNdx = 0; + var originalColor = colorBuffer.getPixel(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + var newColor = frag.blendedRGB.slice(); + newColor[3] = frag.blendedA; + + if (isSRGB) + newColor = tcuTextureUtil.linearToSRGB(newColor); + + newColor = deMath.add(deMath.multiply(colorMaskFactor, newColor), deMath.multiply(colorMaskNegationFactor, originalColor)); + + colorBuffer.setPixel(newColor, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + } + } +}; + +/** + * @param {Array} inputFragments + * @param {Array} colorMask + * @param {tcuTexture.PixelBufferAccess} colorBuffer + */ +rrFragmentOperations.executeSignedValueWrite = function(inputFragments, colorMask, colorBuffer) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var fragSampleNdx = 0; + var originalValue = colorBuffer.getPixelInt(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + var newValue = tcuTextureUtil.select(frag.signedValue, originalValue, colorMask); + + colorBuffer.setPixelInt(newValue, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + } + } +}; + +/** + * @param {Array} inputFragments + * @param {Array} colorMask + * @param {tcuTexture.PixelBufferAccess} colorBuffer + */ +rrFragmentOperations.executeUnsignedValueWrite = function(inputFragments, colorMask, colorBuffer) { + for (var i = 0; i < inputFragments.length; i++) { + var frag = inputFragments[i]; + if (frag.isAlive) { + var fragSampleNdx = 0; + var originalValue = colorBuffer.getPixelInt(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + var newValue = tcuTextureUtil.select(frag.unsignedValue, originalValue, colorMask); + + colorBuffer.setPixelInt(newValue, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]); + } + } +}; + +/** + * @constructor + */ +rrFragmentOperations.FragmentProcessor = function() { + /* TODO: implement */ +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js new file mode 100644 index 000000000..62a92a422 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js @@ -0,0 +1,54 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrGenericVector'); + +goog.scope(function() { + +var rrGenericVector = framework.referencerenderer.rrGenericVector; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * rrGenericVector.GenericVecType + * @enum + */ + rrGenericVector.GenericVecType = { + FLOAT: 0, + UINT32: 1, + INT32: 2 + }; + + /** + * @constructor + * @param {number=} a + * @param {number=} b + * @param {number=} c + * @param {number=} d + */ + rrGenericVector.GenericVec4 = function(a, b, c, d) { + this.data = [a || 0, b || 0, c || 0, d || 0]; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js new file mode 100644 index 000000000..6de1ca270 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js @@ -0,0 +1,190 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrMultisamplePixelBufferAccess'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var tcuTextureUtil = framework.common.tcuTextureUtil; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +/** + * \brief Read-write pixel data access to multisampled buffers. + * + * Multisampled data access follows the multisampled indexing convention. + * + * Prevents accidental usage of non-multisampled buffer as multisampled + * with PixelBufferAccess. + * @constructor + * @param {tcuTexture.PixelBufferAccess=} rawAccess + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess = function(rawAccess) { + this.m_access = rawAccess || new tcuTexture.PixelBufferAccess({ + width: 0, + height: 0}); +}; + +/** + * @return {tcuTexture.PixelBufferAccess} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.raw = function() { return this.m_access; }; + +/** + * @return {boolean} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.isEmpty = function() { return this.m_access.isEmpty(); }; + +/** + * @return {number} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.getNumSamples = function() { return this.raw().getWidth(); }; + +/** + * @return {tcuTexture.PixelBufferAccess} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.toSinglesampleAccess = function() { + DE_ASSERT(this.getNumSamples() == 1); + + return new tcuTexture.PixelBufferAccess({ + format: this.m_access.getFormat(), + width: this.m_access.getHeight(), + height: this.m_access.getDepth(), + depth: 1, + rowPitch: this.m_access.getSlicePitch(), + slicePitch: this.m_access.getSlicePitch() * this.m_access.getDepth(), + data: this.m_access.m_data, + offset: this.m_access.m_offset}); +}; + +/** + * @param {tcuTexture.PixelBufferAccess} original + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess = function(original) { + return new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess( + new tcuTexture.PixelBufferAccess({ + format: original.getFormat(), + width: 1, + height: original.getWidth(), + depth: original.getHeight(), + rowPitch: original.getFormat().getPixelSize(), + slicePitch: original.getRowPitch(), + data: original.m_data, + offset: original.m_offset})); +}; + +/** + * @param {tcuTexture.PixelBufferAccess} multisampledAccess + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess = function(multisampledAccess) { + return new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess(multisampledAccess); +}; + +/** + * @param {Array} region + * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.getSubregion = function(region) { + var x = region[0]; + var y = region[1]; + var width = region[2]; + var height = region[3]; + + return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(tcuTextureUtil.getSubregion(this.raw(), 0, x, y, this.getNumSamples(), width, height)); +}; + +/** + * @return {Array} [x, y, width, height] + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.getBufferSize = function() { + return [0, 0, this.raw().getHeight(), this.raw().getDepth()]; +}; + +/** + * @param {tcuTexture.PixelBufferAccess} dst + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.resolveMultisampleColorBuffer = function(dst) { + var src = this; + DE_ASSERT(dst.getWidth() == src.raw().getHeight()); + DE_ASSERT(dst.getHeight() == src.raw().getDepth()); + + var numSamples = src.getNumSamples(); + var sum = [0, 0, 0, 0]; + for (var y = 0; y < dst.getHeight(); y++) { + for (var x = 0; x < dst.getWidth(); x++) { + sum[0] = 0; + sum[1] = 0; + sum[2] = 0; + sum[3] = 0; + + for (var s = 0; s < src.raw().getWidth(); s++) { + var pixel = src.raw().getPixel(s, x, y); + sum[0] += pixel[0]; + sum[1] += pixel[1]; + sum[2] += pixel[2]; + sum[3] += pixel[3]; + } + + sum[0] /= numSamples; + sum[1] /= numSamples; + sum[2] /= numSamples; + sum[3] /= numSamples; + + dst.setPixel(sum, x, y); + } + } +}; + +/** + * @param {number} x + * @param {number} y + * @return {Array} + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.resolveMultisamplePixel = function(x, y) { + var sum = [0, 0, 0, 0]; + for (var s = 0; s < this.getNumSamples(); s++) + sum = deMath.add(sum, this.raw().getPixel(s, x, y)); + + for (var i = 0; i < sum.length; i++) + sum[i] = sum[i] / this.getNumSamples(); + + return sum; +}; + +/** + * @param {Array} color + */ +rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.clear = function(color) { + this.raw().clear(color); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js new file mode 100644 index 000000000..cac4dc56a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js @@ -0,0 +1,323 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program Reference Renderer + * ----------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Reference renderer render state. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('framework.referencerenderer.rrRenderState'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.referencerenderer.rrDefs'); +goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess'); + +goog.scope(function() { + +var rrRenderState = framework.referencerenderer.rrRenderState; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess; +var rrDefs = framework.referencerenderer.rrDefs; + +/** + * Enum for rrRenderState.HorizontalFill values. + * @enum {number} + */ +rrRenderState.HorizontalFill = { + LEFT: 0, + RIGHT: 1 +}; + +/** + * Enum for rrRenderState.VerticalFill values. + * @enum {number} + */ +rrRenderState.VerticalFill = { + TOP: 0, + BOTTOM: 1 +}; + +/** + * Enum for rrRenderState.Winding values. + * @enum {number} + */ +rrRenderState.Winding = { + CCW: 0, + CC: 1 +}; + +/** + * Enum for rrRenderState.CullMode values. + * @enum {number} + */ +rrRenderState.CullMode = { + NONE: 0, + BACK: 1, + FRONT: 2 +}; + +/**rrRenderState.Winding : rrRenderState.Winding, + + * @constructor + */ +rrRenderState.RasterizationState = function() { + /** @type {number} */ this.winding = rrRenderState.Winding.CCW; + /** @type {number} */ this.horizontalFill = rrRenderState.HorizontalFill.LEFT; + /** @type {number} */ this.verticalFill = rrRenderState.VerticalFill.BOTTOM; +}; + +/** + * Enum for rrRenderState.TestFunc values. + * @enum {number} + */ +rrRenderState.TestFunc = { + NEVER: 0, + ALWAYS: 1, + LESS: 2, + LEQUAL: 3, + GREATER: 4, + GEQUAL: 5, + EQUAL: 6, + NOTEQUAL: 7 +}; + +/** + * Enum for rrRenderState.StencilOp values. + * @enum {number} + */ +rrRenderState.StencilOp = { + KEEP: 0, + ZERO: 1, + REPLACE: 2, + INCR: 3, //!< Increment with saturation. + DECR: 4, //!< Decrement with saturation. + INCR_WRAP: 5, + DECR_WRAP: 6, + INVERT: 7 +}; + +/** + * Enum for rrRenderState.BlendMode values. + * @enum {number} + */ +rrRenderState.BlendMode = { + NONE: 0, //!< No blending. + STANDARD: 1 //!< Standard blending. +// Advanced blending is not supported +// ADVANCED : 2 //!< Advanced blending mode, as defined in gl.KHR_blend_equation_advanced. +}; + +/** + * Enum for rrRenderState.BlendEquation values. + * @enum {number} + */ +rrRenderState.BlendEquation = { + ADD: 0, + SUBTRACT: 1, + REVERSE_SUBTRACT: 2, + MIN: 3, + MAX: 4 +}; + +// /** +// * Enum for rrRenderState.BlendEquationAdvanced values. +// * @enum {number} +// */ +// rrRenderState.BlendEquationAdvanced = { +// MULTIPLY : 0, +// SCREEN : 1, +// OVERLAY : 2, +// DARKEN : 3, +// LIGHTEN : 4, +// COLORDODGE : 5, +// COLORBURN : 6, +// HARDLIGHT : 7, +// SOFTLIGHT : 8, +// DIFFERENCE : 9, +// EXCLUSION : 10, +// HSL_HUE : 11, +// HSL_SATURATION : 12, +// HSL_COLOR : 13, +// HSL_LUMINOSITY : 14 +// }; + +/** + * Enum for rrRenderState.BlendFunc values. + * @enum {number} + */ +rrRenderState.BlendFunc = { + ZERO: 0, + ONE: 1, + SRC_COLOR: 2, + ONE_MINUS_SRC_COLOR: 3, + DST_COLOR: 4, + ONE_MINUS_DST_COLOR: 5, + SRC_ALPHA: 6, + ONE_MINUS_SRC_ALPHA: 7, + DST_ALPHA: 8, + ONE_MINUS_DST_ALPHA: 9, + CONSTANT_COLOR: 10, + ONE_MINUS_CONSTANT_COLOR: 11, + CONSTANT_ALPHA: 12, + ONE_MINUS_CONSTANT_ALPHA: 13, + SRC_ALPHA_SATURATE: 14, + SRC1_COLOR: 15, + ONE_MINUS_SRC1_COLOR: 16, + SRC1_ALPHA: 17, + ONE_MINUS_SRC1_ALPHA: 18 +}; + +/** + * @constructor + */ +rrRenderState.StencilState = function() { + /** @type {number} */ this.func = rrRenderState.TestFunc.ALWAYS; + /** @type {number} */ this.ref = 0; + /** @type {number} */ this.compMask = ~0; + /** @type {number} */ this.sFail = rrRenderState.StencilOp.KEEP; + /** @type {number} */ this.dpFail = rrRenderState.StencilOp.KEEP; + /** @type {number} */ this.dpPass = rrRenderState.StencilOp.KEEP; + /** @type {number} */ this.writeMask = ~0; +}; + +/** + * @constructor + */ +rrRenderState.BlendState = function() { + /** @type {number} */ this.equation = rrRenderState.BlendEquation.ADD; + /** @type {number} */ this.srcFunc = rrRenderState.BlendFunc.ONE; + /** @type {number} */ this.dstFunc = rrRenderState.BlendFunc.ZERO; +}; + +/** + * @param {(Array|number)} left_ + * @param {number=} bottom_ + * @param {number=} width_ + * @param {number=} height_ + * @constructor + */ +rrRenderState.WindowRectangle = function(left_, bottom_, width_, height_) { + // Is first parameter an array? Use it + if (left_.length && left_.length == 4) { + this.left = left_[0]; + this.bottom = left_[1]; + this.width = left_[2]; + this.height = left_[3]; + } else { + this.left = left_; + this.bottom = bottom_; + this.width = width_; + this.height = height_; + } +}; + +/** + * @constructor + */ +rrRenderState.FragmentOperationState = function() { + /** @type {boolean} */ this.scissorTestEnabled = false; + /** @type {rrRenderState.WindowRectangle} */ this.scissorRectangle = new rrRenderState.WindowRectangle(0, 0, 1, 1); + + /** @type {boolean} */ this.stencilTestEnabled = false; + + /** @type {Array} */ this.stencilStates = []; + for (var type in rrDefs.FaceType) + this.stencilStates[rrDefs.FaceType[type]] = new rrRenderState.StencilState(); + + /** @type {boolean} */ this.depthTestEnabled = false; + /** @type {rrRenderState.TestFunc} */ this.depthFunc = rrRenderState.TestFunc.LESS; + /** @type {boolean} */ this.depthMask = true; + + /** @type {rrRenderState.BlendMode} */ this.blendMode = rrRenderState.BlendMode.NONE; + /** @type {rrRenderState.BlendState} */ this.blendRGBState = new rrRenderState.BlendState(); + /** @type {rrRenderState.BlendState} */ this.blendAState = new rrRenderState.BlendState(); + /** @type {Array} */ this.blendColor = [0.0, 0.0, 0.0, 0.0]; +// /** @type {rrRenderState.BlendEquationAdvanced} */ this.blendEquationAdvanced = null; + + /** @type {boolean} */ this.sRGBEnabled = true; + + /** @type {boolean} */ this.depthClampEnabled = false; + + /** @type {boolean} */ this.polygonOffsetEnabled = false; + /** @type {number} */ this.polygonOffsetFactor = 0.0; + /** @type {number} */ this.polygonOffsetUnits = 0.0; + + /** @type {Array} */ this.colorMask = [true, true, true, true]; + + /** @type {number} */ this.numStencilBits = 8; +}; + +/** + * @constructor + */ +rrRenderState.PointState = function() { + /** @type {number} */ this.pointSize = 1.0; +}; + +/** + * @constructor + */ +rrRenderState.LineState = function() { + /** @type {number} */ this.lineWidth = 1.0; +}; + +/** + * Constructor checks if the parameter has a "raw" member to detect if the instance is + * of type rrRenderState.WindowRectangle or MultisamplePixelBufferAccess. + * @param {rrRenderState.WindowRectangle|rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} rect_ + * @constructor + */ +rrRenderState.ViewportState = function(rect_) { + /** @type {number} */ this.zn = 0.0; + /** @type {number} */ this.zf = 1.0; + /** @type {rrRenderState.WindowRectangle} */ this.rect; + + if (rect_.raw) { + this.rect = new rrRenderState.WindowRectangle(0, 0, rect_.raw().getHeight(), + rect_.raw().getDepth()); + } else { + this.rect = /** @type {rrRenderState.WindowRectangle} */ (rect_); + } +}; + +/** + * @constructor + */ +rrRenderState.RestartState = function() { + /** @type {boolean} */ this.enabled = false; + /** @type {number} */ this.restartIndex = 0xFFFFFFFF; +}; + +/** + * @constructor + * @param {rrRenderState.ViewportState} viewport_ + */ +rrRenderState.RenderState = function(viewport_) { + /** @type {rrRenderState.CullMode} */ this.cullMode = rrRenderState.CullMode.NONE; + /** @type {number} */ this.provokingVertexConvention; + /** @type {rrRenderState.ViewportState} */ this.viewport = viewport_; + + /** @type {rrRenderState.RasterizationState} */ this.rasterization = new rrRenderState.RasterizationState(); + /** @type {rrRenderState.FragmentOperationState} */ this.fragOps = new rrRenderState.FragmentOperationState(); + /** @type {rrRenderState.PointState} */ this.point = new rrRenderState.PointState(); + /** @type {rrRenderState.LineState} */ this.line = new rrRenderState.LineState(); + /** @type {rrRenderState.RestartState} */ this.restart = new rrRenderState.RestartState(); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js new file mode 100644 index 000000000..4d5752b2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js @@ -0,0 +1,1274 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrRenderer'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrDefs'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess'); +goog.require('framework.referencerenderer.rrRenderState'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); + +goog.scope(function() { + +var rrRenderer = framework.referencerenderer.rrRenderer; +var rrVertexPacket = framework.referencerenderer.rrVertexPacket; +var rrDefs = framework.referencerenderer.rrDefs; +var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; +var deMath = framework.delibs.debase.deMath; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var rrRenderState = framework.referencerenderer.rrRenderState; +var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess; +var rrShadingContext = framework.referencerenderer.rrShadingContext; +var rrGenericVector = framework.referencerenderer.rrGenericVector; +var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; +var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; +var deString = framework.delibs.debase.deString; +var deUtil = framework.delibs.debase.deUtil; + +/** + * @enum + */ +rrRenderer.PrimitiveType = { + TRIANGLES: 0, //!< Separate rrRenderer.triangles + TRIANGLE_STRIP: 1, //!< rrRenderer.Triangle strip + TRIANGLE_FAN: 2, //!< rrRenderer.Triangle fan + + LINES: 3, //!< Separate lines + LINE_STRIP: 4, //!< Line strip + LINE_LOOP: 5, //!< Line loop + + POINTS: 6 //!< Points +}; + +// /** +// * @constructor +// * @param {boolean} depthEnabled Is depth buffer enabled +// */ +// rrRenderer.RasterizationInternalBuffers = function(depthEnabled) { +// /*std::vector*/ this.fragmentPackets = []; +// /*std::vector*/ this.shaderOutputs = []; +// /*std::vector*/ this.shadedFragments = []; +// /*float**/ this.fragmentDepthBuffer = depthEnabled ? [] : null; +// }; + +/** + * @constructor + * @param {number=} id + */ +rrRenderer.DrawContext = function(id) { + this.primitiveID = id || 0; + +}; + +/** + * Transform [x, y] to window (pixel) coordinates. + * z and w are unchanged + * @param {rrRenderState.RenderState} state + * @param {rrVertexPacket.VertexPacket} packet + * Wreturn {Array} + */ +rrRenderer.transformGLToWindowCoords = function(state, packet) { + var transformed = [packet.position[0] / packet.position[3], + packet.position[1] / packet.position[3], + packet.position[2], + packet.position[3]]; + var viewport = state.viewport.rect; + var halfW = viewport.width / 2; + var halfH = viewport.height / 2; + var oX = viewport.left + halfW; + var oY = viewport.bottom + halfH; + + return [ + transformed[0] * halfW + oX, + transformed[1] * halfH + oY, + transformed[2], + transformed[3] + ]; +}; + +/** + * @constructor + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} colorMultisampleBuffer + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess=} depthMultisampleBuffer + * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess=} stencilMultisampleBuffer + */ +rrRenderer.RenderTarget = function(colorMultisampleBuffer, depthMultisampleBuffer, stencilMultisampleBuffer) { + this.MAX_COLOR_BUFFERS = 4; + this.colorBuffers = []; + this.colorBuffers[0] = colorMultisampleBuffer; + this.depthBuffer = depthMultisampleBuffer || new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess(); + this.stencilBuffer = stencilMultisampleBuffer || new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess(); + this.numColorBuffers = 1; +}; + +// NOTE: Program object is useless. Let's just use the sglrShaderProgram +// /** +// * @constructor +// * @param {rrShaders.VertexShader} vertexShader_ +// * @param {rrShaders.FragmentShader} fragmentShader_ +// */ +// var Program = function(vertexShader_, fragmentShader_) { +// this.vertexShader = vertexShader_; +// this.fragmentShader = fragmentShader_; +// }; + +/** + * @constructor + * @param {ArrayBuffer} data + * @param {rrDefs.IndexType} type + * @param {number} offset + * @param {number=} baseVertex_ + */ +rrRenderer.DrawIndices = function(data, type, offset, baseVertex_) { + /** @type {ArrayBuffer} */ this.data = data; + /** @type {number} */ this.baseVertex = baseVertex_ || 0; + /** @type {rrDefs.IndexType} */ this.indexType = type; + /** @type {goog.NumberArray} */ this.access = null; + switch (type) { + case rrDefs.IndexType.INDEXTYPE_UINT8: this.access = new Uint8Array(data).subarray(offset); break; + case rrDefs.IndexType.INDEXTYPE_UINT16: this.access = new Uint16Array(data).subarray(offset / 2); break; + case rrDefs.IndexType.INDEXTYPE_UINT32: this.access = new Uint32Array(data).subarray(offset / 4); break; + default: throw new Error('Invalid type: ' + type); + } +}; + +/** + * @return {number} + */ +rrRenderer.DrawIndices.prototype.readIndexArray = function(index) { return this.access[index]; }; + +/** + * @constructor + * @param {rrRenderer.PrimitiveType} primitiveType + * @param {number} numElements + * @param {(number|rrRenderer.DrawIndices)} indices + */ +rrRenderer.PrimitiveList = function(primitiveType, numElements, indices) { + /** @type {rrRenderer.PrimitiveType} */ this.m_primitiveType = primitiveType; + /** @type {number} */ this.m_numElements = numElements; + if (typeof indices == 'number') { + // !< primitive list for drawArrays-like call + this.m_indices = null; + this.m_indexType = null; + this.m_baseVertex = indices; + } else { + // !< primitive list for drawElements-like call + this.m_indices = indices; + this.m_indexType = indices.indexType; + this.m_baseVertex = indices.baseVertex; + } + this.m_iterator = 0; +}; + +/** + * @param {number} elementNdx + * @return {number} + */ +rrRenderer.PrimitiveList.prototype.getIndex = function(elementNdx) { + if (this.m_indices) { + var index = this.m_baseVertex + this.m_indices.readIndexArray(elementNdx); + if (index < 0) + throw new Error('Index must not be negative'); + + return index; + } else + return this.m_baseVertex + elementNdx; +}; + +/** + * @param {number} elementNdx + * @param {number} restartIndex + * @return {boolean} + */ +rrRenderer.PrimitiveList.prototype.isRestartIndex = function(elementNdx, restartIndex) { + // implicit index or explicit index (without base vertex) equals restart + if (this.m_indices) + return this.m_indices.readIndexArray(elementNdx) == restartIndex; + else + return elementNdx == restartIndex; +}; + +/** + * @return {number} + */ +rrRenderer.PrimitiveList.prototype.getNumElements = function() {return this.m_numElements;}; + +/** + * @return {rrRenderer.PrimitiveType} + */ +rrRenderer.PrimitiveList.prototype.getPrimitiveType = function() {return this.m_primitiveType;}; + +/** + * @return {?rrDefs.IndexType} + */ +rrRenderer.PrimitiveList.prototype.getIndexType = function() {return this.m_indexType;}; + +/** + * Generate a primitive from indices + * @param {boolean=} reset Restart generating primitives. Default false + * @return {Array} + */ +rrRenderer.PrimitiveList.prototype.getNextPrimitive = function(reset) { + if (reset) + this.m_iterator = 0; + var result = []; + var i = this.m_iterator; + switch (this.m_primitiveType) { + case rrRenderer.PrimitiveType.TRIANGLES: + if (this.m_iterator + 3 <= this.m_numElements) { + result = [i, i + 1, i + 2]; + this.m_iterator += 3; + } + break; + case rrRenderer.PrimitiveType.TRIANGLE_STRIP: + if (this.m_iterator + 3 <= this.m_numElements) { + result = [i, i + 1, i + 2]; + this.m_iterator += 1; + } + break; + case rrRenderer.PrimitiveType.TRIANGLE_FAN: + if (this.m_iterator + 3 <= this.m_numElements) { + result = [0, i + 1, i + 2]; + this.m_iterator += 1; + } + break; + case rrRenderer.PrimitiveType.LINES: + if (this.m_iterator + 2 <= this.m_numElements) { + result = [i, i + 1]; + this.m_iterator += 2; + } + break; + case rrRenderer.PrimitiveType.LINE_STRIP: + if (this.m_iterator + 2 <= this.m_numElements) { + result = [i, i + 1]; + this.m_iterator += 1; + } + break; + case rrRenderer.PrimitiveType.LINE_LOOP: + if (this.m_iterator == this.m_numElements) + break; + if (this.m_iterator + 2 <= this.m_numElements) + result = [i, i + 1]; + else + result = [i, 0]; + this.m_iterator += 1; + break; + case rrRenderer.PrimitiveType.POINTS: + if (this.m_iterator == this.m_numElements) + break; + else + result = [i]; + this.m_iterator += 1; + break; + default: + throw new Error('Unsupported primitive type: ' + deString.enumToString(rrRenderer.PrimitiveType, this.m_primitiveType)); + } + + return result; +}; + +/** + * @param {rrRenderState.RenderState} state + * @param {rrRenderer.RenderTarget} renderTarget + * @param {Array} fragments Fragments to write +*/ +rrRenderer.writeFragments = function(state, renderTarget, fragments) { + /* TODO: Add blending, depth, stencil ... */ + var colorbuffer = renderTarget.colorBuffers[0].raw(); + for (var i = 0; i < fragments.length; i++) { + var fragment = fragments[i]; + colorbuffer.setPixel(fragment.value, 0, fragment.pixelCoord[0], fragment.pixelCoord[1]); + } + +}; + +/** + * @param {rrRenderState.RenderState} renderState + * @param {rrRenderer.RenderTarget} renderTarget + * @param {Array} fragments Fragments to write +*/ +rrRenderer.writeFragments2 = function(renderState, renderTarget, fragments) { + /* +void FragmentProcessor::render (const rr::MultisamplePixelBufferAccess& msColorBuffer, + const rr::MultisamplePixelBufferAccess& msDepthBuffer, + const rr::MultisamplePixelBufferAccess& msStencilBuffer, + const Fragment* fragments, + int numFragments, + FaceType fragmentFacing, + const FragmentOperationState& state) +*/ + + /** @const */ var fragmentFacing = rrDefs.FaceType.FACETYPE_FRONT; + var colorBuffer = renderTarget.colorBuffers[0].raw(); + var depthBuffer = renderTarget.depthBuffer.raw(); + var stencilBuffer = renderTarget.stencilBuffer.raw(); + var state = renderState.fragOps; + + var hasDepth = depthBuffer.getWidth() > 0 && depthBuffer.getHeight() > 0 && depthBuffer.getDepth() > 0; + var hasStencil = stencilBuffer.getWidth() > 0 && stencilBuffer.getHeight() > 0 && stencilBuffer.getDepth() > 0; + var doDepthTest = hasDepth && state.depthTestEnabled; + var doStencilTest = hasStencil && state.stencilTestEnabled; + + var colorbufferClass = tcuTexture.getTextureChannelClass(colorBuffer.getFormat().type); + var fragmentDataType = rrGenericVector.GenericVecType.FLOAT; + switch (colorbufferClass) { + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + fragmentDataType = rrGenericVector.GenericVecType.INT32; + break; + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + fragmentDataType = rrGenericVector.GenericVecType.UINT32; + break; + } + + if (!((!hasDepth || colorBuffer.getWidth() == depthBuffer.getWidth()) && (!hasStencil || colorBuffer.getWidth() == stencilBuffer.getWidth()))) + throw new Error('Attachment must have the same width'); + if (!((!hasDepth || colorBuffer.getHeight() == depthBuffer.getHeight()) && (!hasStencil || colorBuffer.getHeight() == stencilBuffer.getHeight()))) + throw new Error('Attachment must have the same height'); + if (!((!hasDepth || colorBuffer.getDepth() == depthBuffer.getDepth()) && (!hasStencil || colorBuffer.getDepth() == stencilBuffer.getDepth()))) + throw new Error('Attachment must have the same depth'); + + var stencilState = state.stencilStates[fragmentFacing]; + var colorMaskFactor = [state.colorMask[0] ? 1 : 0, state.colorMask[1] ? 1 : 0, state.colorMask[2] ? 1 : 0, state.colorMask[3] ? 1 : 0]; + var colorMaskNegationFactor = [state.colorMask[0] ? false : true, state.colorMask[1] ? false : true, state.colorMask[2] ? false : true, state.colorMask[3] ? false : true]; + var sRGBTarget = state.sRGBEnabled && colorBuffer.getFormat().isSRGB(); + + // Scissor test. + + if (state.scissorTestEnabled) + rrFragmentOperations.executeScissorTest(fragments, state.scissorRectangle); + + // Stencil test. + + if (doStencilTest) { + rrFragmentOperations.executeStencilCompare(fragments, stencilState, state.numStencilBits, stencilBuffer); + rrFragmentOperations.executeStencilSFail(fragments, stencilState, state.numStencilBits, stencilBuffer); + } + + // Depth test. + // \note Current value of isAlive is needed for dpPass and dpFail, so it's only updated after them and not right after depth test. + + if (doDepthTest) { + rrFragmentOperations.executeDepthCompare(fragments, state.depthFunc, depthBuffer); + + if (state.depthMask) + rrFragmentOperations.executeDepthWrite(fragments, depthBuffer); + } + + // Do dpFail and dpPass stencil writes. + + if (doStencilTest) + rrFragmentOperations.executeStencilDpFailAndPass(fragments, stencilState, state.numStencilBits, stencilBuffer); + + // Kill the samples that failed depth test. + + if (doDepthTest) { + for (var i = 0; i < fragments.length; i++) + fragments[i].isAlive = fragments[i].isAlive && fragments[i].depthPassed; + } + + // Paint fragments to target + + switch (fragmentDataType) { + case rrGenericVector.GenericVecType.FLOAT: + // Blend calculation - only if using blend. + if (state.blendMode == rrRenderState.BlendMode.STANDARD) { + // Put dst color to register, doing srgb-to-linear conversion if needed. + for (var i = 0; i < fragments.length; i++) { + var frag = fragments[i]; + if (frag.isAlive) { + var dstColor = colorBuffer.getPixel(0, frag.pixelCoord[0], frag.pixelCoord[1]); + + /* TODO: Check frag.value and frag.value1 types */ + frag.clampedBlendSrcColor = deMath.clampVector(frag.value, 0, 1); + frag.clampedBlendSrc1Color = deMath.clampVector(frag.value1, 0, 1); + frag.clampedBlendDstColor = deMath.clampVector(sRGBTarget ? tcuTexture.sRGBToLinear(dstColor) : dstColor, 0, 1); + } + } + + // Calculate blend factors to register. + rrFragmentOperations.executeBlendFactorComputeRGB(fragments, state.blendColor, state.blendRGBState); + rrFragmentOperations.executeBlendFactorComputeA(fragments, state.blendColor, state.blendAState); + + // Compute blended color. + rrFragmentOperations.executeBlend(fragments, state.blendRGBState, state.blendAState); + } else { + // Not using blend - just put values to register as-is. + + for (var i = 0; i < fragments.length; i++) { + var frag = fragments[i]; + if (frag.isAlive) { + frag.blendedRGB = deMath.swizzle(frag.value, [0, 1, 2]); + frag.blendedA = frag.value[3]; + } + } + } + + // Finally, write the colors to the color buffer. + + if (state.colorMask[0] && state.colorMask[1] && state.colorMask[2] && state.colorMask[3]) { + /* TODO: Add quick path */ + // if (colorBuffer.getFormat().isEqual(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8))) + // executeRGBA8ColorWrite(fragments, colorBuffer); + // else + rrFragmentOperations.executeColorWrite(fragments, sRGBTarget, colorBuffer); + } else if (state.colorMask[0] || state.colorMask[1] || state.colorMask[2] || state.colorMask[3]) + rrFragmentOperations.executeMaskedColorWrite(fragments, colorMaskFactor, colorMaskNegationFactor, sRGBTarget, colorBuffer); + break; + + case rrGenericVector.GenericVecType.INT32: + // Write fragments + for (var i = 0; i < fragments.length; i++) { + var frag = fragments[i]; + if (frag.isAlive) { + frag.signedValue = frag.value; + } + } + + if (state.colorMask[0] || state.colorMask[1] || state.colorMask[2] || state.colorMask[3]) + rrFragmentOperations.executeSignedValueWrite(fragments, state.colorMask, colorBuffer); + break; + + case rrGenericVector.GenericVecType.UINT32: + // Write fragments + for (var i = 0; i < fragments.length; i++) { + var frag = fragments[i]; + if (frag.isAlive) { + frag.unsignedValue = frag.value; + } + } + + if (state.colorMask[0] || state.colorMask[1] || state.colorMask[2] || state.colorMask[3]) + rrFragmentOperations.executeUnsignedValueWrite(fragments, state.colorMask, colorBuffer); + break; + + default: + throw new Error('Unrecognized fragment data type:' + fragmentDataType); + } +}; + +/** + * Determines the index of the corresponding vertex according to top/right conditions. + * @param {boolean} isTop + * @param {boolean} isRight + * @return {number} + */ +rrRenderer.getIndexOfCorner = function(isTop, isRight, vertexPackets) { + var x = null; + var y = null; + + var xcriteria = isRight ? Math.max : Math.min; + var ycriteria = isTop ? Math.max : Math.min; + + // Determine corner values + for (var i = 0; i < vertexPackets.length; i++) { + x = x != null ? xcriteria(vertexPackets[i].position[0], x) : vertexPackets[i].position[0]; + y = y != null ? ycriteria(vertexPackets[i].position[1], y) : vertexPackets[i].position[1]; + } + + // Search for matching vertex + for (var v = 0; v < vertexPackets.length; v++) + if (vertexPackets[v].position[0] == x && + vertexPackets[v].position[1] == y) + return v; + + throw new Error('Corner not found'); +}; + +/** + * Check that point is in the clipping volume + * @param {number} x + * @param {number} y + * @param {number} z + * @param {rrRenderState.WindowRectangle} rect + * @return {boolean} + */ +rrRenderer.clipTest = function(x, y, z, rect) { + x = Math.round(x); + y = Math.round(y); + if (!deMath.deInBounds32(x, rect.left, rect.left + rect.width)) + return false; + if (!deMath.deInBounds32(y, rect.bottom, rect.bottom + rect.height)) + return false; + if (z < 0 || z > 1) + return false; + return true; +}; + +// Rasterizer configuration +rrRenderer.RASTERIZER_SUBPIXEL_BITS = 8; +rrRenderer.RASTERIZER_MAX_SAMPLES_PER_FRAGMENT = 16; + +// Referenced from rrRasterizer.hpp + +/** + * Get coverage bit value + * @param {number} numSamples + * @param {number} x + * @param {number} y + * @param {number} sampleNdx + * @return {number} + */ +rrRenderer.getCoverageBit = function(numSamples, x, y, sampleNdx) { + var maxSamples = 16; + assertMsgOptions(maxSamples >= rrRenderer.RASTERIZER_MAX_SAMPLES_PER_FRAGMENT, 'maxSamples should not greater than ' + rrRenderer.RASTERIZER_MAX_SAMPLES_PER_FRAGMENT, false, true); + assertMsgOptions(deMath.deInRange32(numSamples, 1, maxSamples) && deMath.deInBounds32(x, 0, 2) && deMath.deInBounds32(y, 0, 2), 'numSamples, x or y not in bound', false, true); + return 1 << ((x * 2 + y) * numSamples + sampleNdx); +}; + +/** + * Get all sample bits for fragment + * @param {number} numSamples + * @param {number} x + * @param {number} y + * @return {number} + */ +rrRenderer.getCoverageFragmentSampleBits = function(numSamples, x, y) { + assertMsgOptions(deMath.deInBounds32(x, 0, 2) && deMath.deInBounds32(y, 0, 2), 'x or y is not in bound 0 to 2', false, true); + var fragMask = (1 << numSamples) - 1; + return fragMask << (x * 2 + y) * numSamples; +}; + +/** + * Set coverage bit in coverage mask + * @param {number} mask + * @param {number} numSamples + * @param {number} x + * @param {number} y + * @param {number} sampleNdx + * @param {number} val + * @return {number} + */ +rrRenderer.setCoverageValue = function(mask, numSamples, x, y, sampleNdx, val) { + var bit = rrRenderer.getCoverageBit(numSamples, x, y, sampleNdx); + return val ? (mask | bit) : (mask & ~bit); +}; + +/** + * Test if any sample for fragment is live + * @param {number} mask + * @param {number} numSamples + * @param {number} x + * @param {number} y + * @return {number} + */ +rrRenderer.getCoverageAnyFragmentSampleLive = function(mask, numSamples, x, y) { + return (mask & rrRenderer.getCoverageFragmentSampleBits(numSamples, x, y)) != 0; +}; + +// Referenced from rrRasterizer.cpp + +/** + * Pixel coord to sub pixel coord + * @param {number} v + * @return {number} + */ +rrRenderer.toSubpixelCoord = function(v) { + return Math.trunc(v * (1 << rrRenderer.RASTERIZER_SUBPIXEL_BITS) + (v < 0 ? -0.5 : 0.5)); +}; + +/** + * Floor sub pixel coord to pixel coord + * @param {number} coord + * @param {boolean} fillEdge + * @return {number} + */ +rrRenderer.floorSubpixelToPixelCoord = function(coord, fillEdge) { + if (coord >= 0) + return Math.trunc((coord - (fillEdge ? 1 : 0)) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS); + else + return Math.trunc((coord - ((1 << rrRenderer.RASTERIZER_SUBPIXEL_BITS) - (fillEdge ? 0 : 1))) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS); +}; + +/** + * Ceil sub pixel coord to pixel coord + * @param {number} coord + * @param {boolean} fillEdge + * @return {number} + */ +rrRenderer.ceilSubpixelToPixelCoord = function(coord, fillEdge) { + if (coord >= 0) + return Math.trunc((coord + (1 << rrRenderer.RASTERIZER_SUBPIXEL_BITS) - (fillEdge ? 0 : 1)) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS); + else + return Math.trunc((coord + (fillEdge ? 1 : 0)) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS); +}; + +/** + * \brief Edge function - referenced from struct EdgeFunction in rrRasterizer.hpp + * + * Edge function can be evaluated for point P (in a fixed-point coordinates + * with RASTERIZER_SUBPIXEL_BITS fractional part) by computing + * D = a * Px + b * Py + c + * + * D will be fixed-point value where lower (RASTERIZER_SUBPIXEL_BITS * 2) bits + * will be fractional part. + * + * Member function evaluateEdge, reverseEdge and isInsideCCW are referenced from rrRasterizer.cpp. + * + * @param {number} a + * @param {number} b + * @param {number} c + * @param {boolean} inclusive + */ +rrRenderer.edgeFunction = function(a, b, c, inclusive) { + this.a = a; + this.b = b; + this.c = c; + this.inclusive = inclusive; // True if edge is inclusive according to fill rules +}; + +/** + * Evaluate point (x,y) + * @param {number} x + * @param {number} y + * @return {number} + */ +rrRenderer.edgeFunction.prototype.evaluateEdge = function(x, y) { + return this.a * x + this.b * y + this.c; +}; + +/** + * Reverse edge (e.g. from CCW to CW) + */ +rrRenderer.edgeFunction.prototype.reverseEdge = function () { + this.a = -this.a; + this.b = -this.b; + this.c = -this.c; + this.inclusive = !this.inclusive; +}; + +/** + * Determine if a point with value edgeVal is inside the CCW region of the edge + * @param {number} edgeVal + * @return {boolean} + */ +rrRenderer.edgeFunction.prototype.isInsideCCW = function(edgeVal) { + return this.inclusive ? edgeVal >= 0 : edgeVal > 0; +}; + +/** + * Init an edge function in counter-clockwise (CCW) orientation + * @param {number} horizontalFill + * @param {number} verticalFill + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @return {rrRenderer.edgeFunction} + */ +rrRenderer.initEdgeCCW = function(horizontalFill, verticalFill, x0, y0, x1, y1) { + var xd = x1 - x0; + var yd = y1 - y0; + var inclusive = false; + + if (yd == 0) + inclusive = verticalFill == rrRenderState.VerticalFill.BOTTOM ? xd >= 0 : xd <= 0; + else + inclusive = horizontalFill == rrRenderState.HorizontalFill.LEFT ? yd <= 0 : yd >=0; + + return new rrRenderer.edgeFunction(y0 - y1, x1 - x0, x0 * y1 - y0 * x1, inclusive); +}; + +/** + * \brief Triangle rasterizer - referenced from class TriangleRasterizer in rrRasterizer.hpp + * + * Triangle rasterizer implements following features: + * - Rasterization using fixed-point coordinates + * - 1-sample rasterization (the value of numSamples always equals 1 in sglrReferenceContext) + * - Depth interpolation + * - Perspective-correct barycentric computation for interpolation + * - Visible face determination + * - Clipping - native dEQP does clipping before rasterization; see function drawBasicPrimitives + * in rrRenderer.cpp for more details + * + * It does not (and will not) implement following: + * - Triangle setup + * - Degenerate elimination + * - Coordinate transformation (inputs are in screen-space) + * - Culling - logic can be implemented outside by querying visible face + * - Scissoring - (this can be done by controlling viewport rectangle) + * - Any per-fragment operations + * + * @param {rrRenderState.RenderState} state + */ +rrRenderer.triangleRasterizer = function(state) { + this.m_viewport = state.viewport; + this.m_winding = state.rasterization.winding; + this.m_horizontalFill = state.rasterization.horizontalFill; + this.m_verticalFill = state.rasterization.verticalFill; +}; + +/** + * Initialize triangle rasterization + * @param {vec} v0 Screen-space coordinates (x, y, z) and 1/w for vertex 0 + * @param {vec} v1 Screen-space coordinates (x, y, z) and 1/w for vertex 1 + * @param {vec} v2 Screen-space coordinates (x, y, z) and 1/w for vertex 2 + */ +rrRenderer.triangleRasterizer.prototype.init = function(v0, v1, v2) { + this.m_v0 = v0; + this.m_v1 = v1; + this.m_v2 = v2; + + // Positions in fixed-point coordinates + var x0 = rrRenderer.toSubpixelCoord(v0[0]); + var y0 = rrRenderer.toSubpixelCoord(v0[1]); + var x1 = rrRenderer.toSubpixelCoord(v1[0]); + var y1 = rrRenderer.toSubpixelCoord(v1[1]); + var x2 = rrRenderer.toSubpixelCoord(v2[0]); + var y2 = rrRenderer.toSubpixelCoord(v2[1]); + + // Initialize edge functions + if (this.m_winding == rrRenderState.Winding.CCW) { + this.m_edge01 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x0, y0, x1, y1); + this.m_edge12 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x1, y1, x2, y2); + this.m_edge20 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x2, y2, x0, y0); + } else { + // Reverse edges + this.m_edge01 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x1, y1, x0, y0); + this.m_edge12 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x2, y2, x1, y1); + this.m_edge20 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x0, y0, x2, y2); + } + + // Determine face + var s = this.m_edge01.evaluateEdge(x2, y2); + var positiveArea = (this.m_winding == rrRenderState.Winding.CCW ) ? s > 0 : s < 0; + this.m_face = positiveArea ? rrDefs.FaceType.FACETYPE_FRONT : rrDefs.FaceType.FACETYPE_BACK; + if (!positiveArea) { + // Reverse edges so that we can use CCW area tests & interpolation + this.m_edge01.reverseEdge(); + this.m_edge12.reverseEdge(); + this.m_edge20.reverseEdge(); + } + + // Bounding box + var minX = Math.min(x0, x1, x2); + var maxX = Math.max(x0, x1, x2); + var minY = Math.min(y0, y1, y2); + var maxY = Math.max(y0, y1, y2); + + this.m_bboxMin = []; + this.m_bboxMax = []; + this.m_bboxMin[0] = rrRenderer.floorSubpixelToPixelCoord(minX, this.m_horizontalFill == rrRenderState.HorizontalFill.LEFT); + this.m_bboxMin[1] = rrRenderer.floorSubpixelToPixelCoord(minY, this.m_verticalFill == rrRenderState.VerticalFill.BOTTOM); + this.m_bboxMax[0] = rrRenderer.ceilSubpixelToPixelCoord(maxX, this.m_horizontalFill == rrRenderState.HorizontalFill.RIGHT); + this.m_bboxMax[1] = rrRenderer.ceilSubpixelToPixelCoord(maxY, this.m_verticalFill == rrRenderState.VerticalFill.TOP); + + // Clamp to viewport + var wX0 = this.m_viewport.rect.left; + var wY0 = this.m_viewport.rect.bottom; + var wX1 = wX0 + this.m_viewport.rect.width - 1; + var wY1 = wY0 + this.m_viewport.rect.height - 1; + + this.m_bboxMin[0] = deMath.clamp(this.m_bboxMin[0], wX0, wX1); + this.m_bboxMin[1] = deMath.clamp(this.m_bboxMin[1], wY0, wY1); + this.m_bboxMax[0] = deMath.clamp(this.m_bboxMax[0], wX0, wX1); + this.m_bboxMax[1] = deMath.clamp(this.m_bboxMax[1], wY0, wY1); + + this.m_curPos = [this.m_bboxMin[0], this.m_bboxMin[1]]; +}; + +rrRenderer.triangleRasterizer.prototype.rasterize = function() { + var fragmentPackets = []; + var halfPixel = 1 << (rrRenderer.RASTERIZER_SUBPIXEL_BITS - 1); + + // For depth interpolation; given barycentrics A, B, C = (1 - A -B) + // We can reformulate the usual z = z0 * A + z1 * B + z2 * C into more + // stable equation z = A * (z0 - z2) + B * (z1 - z2) + z2 + var za = this.m_v0[2] - this.m_v2[2]; + var zb = this.m_v1[2] - this.m_v2[2]; + var zc = this.m_v2[2]; + + var zn = this.m_viewport.zn; + var zf = this.m_viewport.zf; + var depthScale = (zf - zn) / 2; + var depthBias = (zf + zn) / 2; + + while (this.m_curPos[1] <= this.m_bboxMax[1]) { + var x0 = this.m_curPos[0]; + var y0 = this.m_curPos[1]; + + // Subpixel coords of (x0, y0), (x0 + 1, y0), (x0, y0 + 1), (x0 + 1, y0 + 1) + var sx0 = rrRenderer.toSubpixelCoord(x0) + halfPixel; + var sx1 = rrRenderer.toSubpixelCoord(x0 + 1) + halfPixel; + var sy0 = rrRenderer.toSubpixelCoord(y0) + halfPixel; + var sy1 = rrRenderer.toSubpixelCoord(y0 + 1) + halfPixel; + + var sx = [sx0, sx1, sx0, sx1]; + var sy = [sy0, sy0, sy1, sy1]; + + // Viewport test + var outX1 = x0 + 1 == this.m_viewport.rect.left + this.m_viewport.rect.width; + var outY1 = y0 + 1 == this.m_viewport.rect.bottom + this.m_viewport.rect.height; + + // Coverage + var coverage = 0; + + // Evaluate edge values + var e01 = []; + var e12 = []; + var e20 = []; + for (var i = 0; i < 4; i++) { + e01.push(this.m_edge01.evaluateEdge(sx[i], sy[i])); + e12.push(this.m_edge12.evaluateEdge(sx[i], sy[i])); + e20.push(this.m_edge20.evaluateEdge(sx[i], sy[i])); + } + + // Compute coverage mask + coverage = rrRenderer.setCoverageValue(coverage, 1, 0, 0, 0, this.m_edge01.isInsideCCW(e01[0]) && this.m_edge12.isInsideCCW(e12[0]) && this.m_edge20.isInsideCCW(e20[0])); + coverage = rrRenderer.setCoverageValue(coverage, 1, 1, 0, 0, !outX1 && this.m_edge01.isInsideCCW(e01[1]) && this.m_edge12.isInsideCCW(e12[1]) && this.m_edge20.isInsideCCW(e20[1])); + coverage = rrRenderer.setCoverageValue(coverage, 1, 0, 1, 0, !outY1 && this.m_edge01.isInsideCCW(e01[2]) && this.m_edge12.isInsideCCW(e12[2]) && this.m_edge20.isInsideCCW(e20[2])); + coverage = rrRenderer.setCoverageValue(coverage, 1, 1, 1, 0, !outX1 && !outY1 && this.m_edge01.isInsideCCW(e01[3]) && this.m_edge12.isInsideCCW(e12[3]) && this.m_edge20.isInsideCCW(e20[3])); + + // Advance to next location + this.m_curPos[0] += 2; + if (this.m_curPos[0] > this.m_bboxMax[0]) { + this.m_curPos[0] = this.m_bboxMin[0]; + this.m_curPos[1] += 2; + } + + if (coverage == 0) + continue; // Discard + + // Compute depth and barycentric coordinates + var edgeSum = deMath.add(deMath.add(e01, e12), e20); + var z0 = deMath.divide(e12, edgeSum); + var z1 = deMath.divide(e20, edgeSum); + + var b0 = deMath.multiply(e12, [this.m_v0[3], this.m_v0[3], this.m_v0[3], this.m_v0[3]]); + var b1 = deMath.multiply(e20, [this.m_v1[3], this.m_v1[3], this.m_v1[3], this.m_v1[3]]); + var b2 = deMath.multiply(e01, [this.m_v2[3], this.m_v2[3], this.m_v2[3], this.m_v2[3]]); + var bSum = deMath.add(deMath.add(b0, b1), b2); + var barycentric0 = deMath.divide(b0, bSum); + var barycentric1 = deMath.divide(b1, bSum); + var barycentric2 = deMath.subtract(deMath.subtract([1, 1, 1, 1], barycentric0), barycentric1); + + // In native dEQP, after rasterization, the pixel (x0, y0) actually represents four pixels: + // (x0, y0), (x0 + 1, y0), (x0, y0 + 1) and (x0 + 1, y0 + 1). + // The barycentrics and depths of these four pixels are to be computed after rasterization: + // barycentrics are computed in function shadeFragments in es3fFboTestUtil.cpp; + // depths are computed in function writeFragmentPackets in rrRenderer.cpp. + + // In js, pixels are processed one after another, so their depths and barycentrics should be computed immediately. + + // Determine if (x0, y0), (x0 + 1, y0), (x0, y0 + 1), (x0 + 1, y0 + 1) can be rendered + for (var fragNdx = 0; fragNdx < 4; fragNdx++) { + var xo = fragNdx % 2; + var yo = Math.trunc(fragNdx / 2); + var x = x0 + xo; + var y = y0 + yo; + + // The value of numSamples always equals 1 in sglrReferenceContext. + if(rrRenderer.getCoverageAnyFragmentSampleLive(coverage, 1, xo, yo)) { + // Barycentric coordinates - referenced from function readTriangleVarying in rrShadingContext.hpp + var b = [barycentric0[fragNdx], barycentric1[fragNdx], barycentric2[fragNdx]]; + + // Depth - referenced from writeFragmentPackets in rrRenderer.cpp + var depth = z0[fragNdx] * za + z1[fragNdx] * zb + zc; + depth = depth * depthScale + depthBias; + + // Clip test + // Native dEQP does clipping test before rasterization. + if (!rrRenderer.clipTest(x, y, depth, this.m_viewport.rect)) + continue; + + fragmentPackets.push(new rrFragmentOperations.Fragment(b, [x, y], depth)); + } + } + } + return fragmentPackets; +}; + +/** + * @param {rrRenderState.RenderState} state + * @param {rrRenderer.RenderTarget} renderTarget + * @param {sglrShaderProgram.ShaderProgram} program + * @param {Array} vertexAttribs + * @param {rrRenderer.PrimitiveType} primitive + * @param {(number|rrRenderer.DrawIndices)} first Index of first quad vertex + * @param {number} count Number of indices + * @param {number} instanceID + */ +rrRenderer.drawTriangles = function(state, renderTarget, program, vertexAttribs, primitive, first, count, instanceID) { + + /** + * @param {Array} vertices + * @param {Array} indices + * @return {Array} + */ + var selectVertices = function(vertices, indices) { + var result = []; + for (var i = 0; i < indices.length; i++) + result.push(vertices[indices[i]]); + return result; + }; + + // Referenced from native dEQP Renderer::drawInstanced() in rrRenderer.cpp + + var primitives = new rrRenderer.PrimitiveList(primitive, count, first); + // Do not draw if nothing to draw + if (primitives.getNumElements() == 0) + return; + + // Prepare transformation + var numVaryings = program.vertexShader.getOutputs().length; + var vpalloc = new rrVertexPacket.VertexPacketAllocator(numVaryings); + var vertexPackets = vpalloc.allocArray(primitives.getNumElements()); + var drawContext = new rrRenderer.DrawContext(); + drawContext.primitiveID = 0; + + var numberOfVertices = primitives.getNumElements(); + var numVertexPackets = 0; + for (var elementNdx = 0; elementNdx < numberOfVertices; ++elementNdx) { + + // input + vertexPackets[numVertexPackets].instanceNdx = instanceID; + vertexPackets[numVertexPackets].vertexNdx = primitives.getIndex(elementNdx); + + // output + vertexPackets[numVertexPackets].pointSize = state.point.pointSize; // default value from the current state + vertexPackets[numVertexPackets].position = [0, 0, 0, 0]; // no undefined values + + ++numVertexPackets; + + } + program.shadeVertices(vertexAttribs, vertexPackets, numVertexPackets); + + // Referenced from native dEQP Renderer::rasterizePrimitive() for triangle rasterization in rrRenderer.cpp + + // In native dEQP, only maxFragmentPackets packets are processed per rasterize-shade-write loop; + // in js all packets are processed in one loop. + + var rasterizer = new rrRenderer.triangleRasterizer(state); + + for (var prim = primitives.getNextPrimitive(true); prim.length > 0; prim = primitives.getNextPrimitive()) { + var vertices = selectVertices(vertexPackets, prim); + + var v0 = rrRenderer.transformGLToWindowCoords(state, vertices[0]); + var v1 = rrRenderer.transformGLToWindowCoords(state, vertices[1]); + var v2 = rrRenderer.transformGLToWindowCoords(state, vertices[2]); + + rasterizer.init(v0, v1, v2); + + // Culling + if ((state.cullMode == rrRenderState.CullMode.FRONT && rasterizer.m_face == rrDefs.FaceType.FACETYPE_FRONT) || + (state.cullMode == rrRenderState.CullMode.BACK && rasterizer.m_face == rrDefs.FaceType.FACETYPE_BACK)) + return; + + /* TODO: Add Polygon Offset and Depth Clamp */ + + // Compute a conservative integer bounding box for the triangle + var minX = Math.floor(Math.min(v0[0], v1[0], v2[0])); + var maxX = Math.ceil(Math.max(v0[0], v1[0], v2[0])); + var minY = Math.floor(Math.min(v0[1], v1[1], v2[1])); + var maxY = Math.ceil(Math.max(v0[1], v1[1], v2[1])); + + // Shading context + var shadingContext = new rrShadingContext.FragmentShadingContext( + vertices[0].outputs, + vertices[1].outputs, + vertices[2].outputs + ); + shadingContext.setSize(maxX - minX, maxY - minY); + + // Rasterize + var fragmentPackets = rasterizer.rasterize(); + + // Shade + program.shadeFragments(fragmentPackets, shadingContext); + + // Handle fragment shader outputs + rrRenderer.writeFragments2(state, renderTarget, fragmentPackets); + } +}; + +/** + * @param {rrRenderState.RenderState} state + * @param {rrRenderer.RenderTarget} renderTarget + * @param {sglrShaderProgram.ShaderProgram} program + * @param {Array} vertexAttribs + * @param {rrRenderer.PrimitiveType} primitive + * @param {(number|rrRenderer.DrawIndices)} first Index of first quad vertex + * @param {number} count Number of indices + * @param {number} instanceID + */ +rrRenderer.drawLines = function(state, renderTarget, program, vertexAttribs, primitive, first, count, instanceID) { + + /** + * @param {Array} vertices + * @param {Array} indices + * @return {Array} + */ + var selectVertices = function(vertices, indices) { + var result = []; + for (var i = 0; i < indices.length; i++) + result.push(vertices[indices[i]]); + return result; + }; + + var lengthSquared = function(a) { + var sqSum = 0; + for (var i = 0; i < a.length; i++) + sqSum += a[i] * a[i]; + return sqSum; + }; + + var dot = function(a, b) { + var res = 0; + for (var i = 0; i < a.length; i++) + res += a[i] * b[i]; + return res; + }; + + var rasterizeLine = function(v0, v1) { + var d = [ + Math.abs(v1[0] - v0[0]), + Math.abs(v1[1] - v0[1])]; + var xstep = v0[0] < v1[0] ? 1 : -1; + var ystep = v0[1] < v1[1] ? 1 : -1; + var x = v0[0]; + var y = v0[1]; + var offset = d[0] - d[1]; + var lenV = [v1[0] - v0[0], v1[1] - v0[1]]; + var lenSq = lengthSquared(lenV); + + var packets = []; + + while (true) { + var t = dot([x - v0[0], y - v0[1]], lenV) / lenSq; + var depth = (1 - t) * v0[2] + t * v1[2]; + var b = [0, 0, 0]; + b[0] = 1 - t; + b[1] = t; + + if (x == v1[0] && y == v1[1]) + break; + + depth = depth * depthScale + depthBias; + packets.push(new rrFragmentOperations.Fragment(b, [x, y], depth)); + + var offset2 = 2 * offset; + if (offset2 > -1 * d[1]) { + x += xstep; + offset -= d[1]; + } + + if (offset2 < d[0]) { + y += ystep; + offset += d[0]; + } + } + return packets; + }; + + var primitives = new rrRenderer.PrimitiveList(primitive, count, first); + // Do not draw if nothing to draw + if (primitives.getNumElements() == 0) + return; + + // Prepare transformation + var numVaryings = program.vertexShader.getOutputs().length; + var vpalloc = new rrVertexPacket.VertexPacketAllocator(numVaryings); + var vertexPackets = vpalloc.allocArray(primitives.getNumElements()); + var drawContext = new rrRenderer.DrawContext(); + drawContext.primitiveID = 0; + + var numberOfVertices = primitives.getNumElements(); + var numVertexPackets = 0; + for (var elementNdx = 0; elementNdx < numberOfVertices; ++elementNdx) { + + // input + vertexPackets[numVertexPackets].instanceNdx = instanceID; + vertexPackets[numVertexPackets].vertexNdx = primitives.getIndex(elementNdx); + + // output + vertexPackets[numVertexPackets].pointSize = state.point.pointSize; // default value from the current state + vertexPackets[numVertexPackets].position = [0, 0, 0, 0]; // no undefined values + + ++numVertexPackets; + + } + program.shadeVertices(vertexAttribs, vertexPackets, numVertexPackets); + + var zn = state.viewport.zn; + var zf = state.viewport.zf; + var depthScale = (zf - zn) / 2; + var depthBias = (zf + zn) / 2; + + // For each quad, we get a group of six vertex packets + for (var prim = primitives.getNextPrimitive(true); prim.length > 0; prim = primitives.getNextPrimitive()) { + var linePackets = selectVertices(vertexPackets, prim); + + var v0 = rrRenderer.transformGLToWindowCoords(state, linePackets[0]); + var v1 = rrRenderer.transformGLToWindowCoords(state, linePackets[1]); + v0[2] = linePackets[0].position[2]; + v1[2] = linePackets[1].position[2]; + + v0[0] = Math.floor(v0[0]); + v0[1] = Math.floor(v0[1]); + v1[0] = Math.floor(v1[0]); + v1[1] = Math.floor(v1[1]); + + var lineWidth = state.line.lineWidth; + + var shadingContext = new rrShadingContext.FragmentShadingContext( + linePackets[0].outputs, + linePackets[1].outputs, + null + ); + var isXmajor = Math.abs(v1[0] - v0[0]) >= Math.abs(v1[1] - v0[1]); + var packets = []; + if (isXmajor) + packets = rasterizeLine([v0[0], v0[1] - (lineWidth - 1) / 2, v0[2]], + [v1[0], v1[1] - (lineWidth - 1) / 2, v1[2]]); + else + packets = rasterizeLine([v0[0] - (lineWidth - 1) / 2, v0[1], v0[2]], + [v1[0] - (lineWidth - 1) / 2, v1[1], v1[2]]); + var numPackets = packets.length; + if (lineWidth > 1) + for (var i = 0; i < numPackets; i++) { + var p = packets[i]; + for (var j = 1; j < lineWidth; j++) { + var p2 = deUtil.clone(p); + if (isXmajor) + p2.pixelCoord[1] += j; + else + p2.pixelCoord[0] += j; + packets.push(p2); + } + } + + var clipped = []; + for (var i = 0; i < packets.length; i++) { + var p = packets[i]; + if (rrRenderer.clipTest(p.pixelCoord[0], p.pixelCoord[1], p.sampleDepths[0], state.viewport.rect)) + clipped.push(p); + } + program.shadeFragments(clipped, shadingContext); + + rrRenderer.writeFragments2(state, renderTarget, clipped); + } +}; + +/** + * @param {rrRenderState.RenderState} state + * @param {rrRenderer.RenderTarget} renderTarget + * @param {sglrShaderProgram.ShaderProgram} program + * @param {Array} vertexAttribs + * @param {rrRenderer.PrimitiveType} primitive + * @param {(number|rrRenderer.DrawIndices)} first Index of first quad vertex + * @param {number} count Number of indices + * @param {number} instanceID + */ +rrRenderer.drawPoints = function(state, renderTarget, program, vertexAttribs, primitive, first, count, instanceID) { + /** + * @param {Array} vertices + * @param {Array} indices + * @return {Array} + */ + var selectVertices = function(vertices, indices) { + var result = []; + for (var i = 0; i < indices.length; i++) + result.push(vertices[indices[i]]); + return result; + }; + + var primitives = new rrRenderer.PrimitiveList(primitive, count, first); + // Do not draw if nothing to draw + if (primitives.getNumElements() == 0) + return; + + // Prepare transformation + var numVaryings = program.vertexShader.getOutputs().length; + var vpalloc = new rrVertexPacket.VertexPacketAllocator(numVaryings); + var vertexPackets = vpalloc.allocArray(primitives.getNumElements()); + var drawContext = new rrRenderer.DrawContext(); + drawContext.primitiveID = 0; + + var numberOfVertices = primitives.getNumElements(); + var numVertexPackets = 0; + for (var elementNdx = 0; elementNdx < numberOfVertices; ++elementNdx) { + + // input + vertexPackets[numVertexPackets].instanceNdx = instanceID; + vertexPackets[numVertexPackets].vertexNdx = primitives.getIndex(elementNdx); + + // output + vertexPackets[numVertexPackets].pointSize = state.point.pointSize; // default value from the current state + vertexPackets[numVertexPackets].position = [0, 0, 0, 0]; // no undefined values + + ++numVertexPackets; + + } + program.shadeVertices(vertexAttribs, vertexPackets, numVertexPackets); + + var zn = state.viewport.zn; + var zf = state.viewport.zf; + var depthScale = (zf - zn) / 2; + var depthBias = (zf + zn) / 2; + + // For each primitive, we draw a point. + for (var prim = primitives.getNextPrimitive(true); prim.length > 0; prim = primitives.getNextPrimitive()) { + var pointPackets = selectVertices(vertexPackets, prim); + + var v0 = rrRenderer.transformGLToWindowCoords(state, pointPackets[0]); + v0[2] = pointPackets[0].position[2]; + var pointSize = pointPackets[0].pointSize; + + var shadingContext = new rrShadingContext.FragmentShadingContext( + pointPackets[0].outputs, + null, + null + ); + var packets = []; + + var x = v0[0]; + var y = v0[1]; + var depth = v0[2]; + var b = [1, 0, 0]; + depth = depth * depthScale + depthBias; + + for (var i = Math.floor(x - pointSize / 2); i < x + pointSize / 2; i++) { + for (var j = Math.floor(y - pointSize / 2); j < y + pointSize / 2; j++) { + var centerX = i + 0.5; + var centerY = j + 0.5; + if (Math.abs(centerX - x) <= pointSize / 2 && + Math.abs(centerY - y) <= pointSize / 2 && + rrRenderer.clipTest(i, j, depth, state.viewport.rect)) + packets.push(new rrFragmentOperations.Fragment(b, [i, j], depth)); + } + } + + program.shadeFragments(packets, shadingContext); + + rrRenderer.writeFragments2(state, renderTarget, packets); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js new file mode 100644 index 000000000..143d9b728 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js @@ -0,0 +1,123 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrShaders'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); + +goog.scope(function() { + +var rrShaders = framework.referencerenderer.rrShaders; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; +var rrGenericVector = framework.referencerenderer.rrGenericVector; +var rrShadingContext = framework.referencerenderer.rrShadingContext; +var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; +var rrVertexPacket = framework.referencerenderer.rrVertexPacket; + + /** + * Vertex shader input information + * @constructor + */ + rrShaders.VertexInputInfo = function() { + /** @type {rrGenericVector.GenericVecType} */ this.type; + }; + + /** + * Shader varying information + * @constructor + */ + rrShaders.VertexVaryingInfo = function() { + /** @type {rrGenericVector.GenericVecType} */ this.type; + /** @type {boolean} */ var flatshade = false; + }; + + /** + * Fragment shader output information + * @constructor + */ + rrShaders.FragmentOutputInfo = function() { + //Sensible defaults + /** @type {rrGenericVector.GenericVecType} */ this.type; + }; + + /** + * Vertex shader interface + * + * Vertex shaders execute shading for set of vertex packets. See VertexPacket + * documentation for more details on shading API. + * @constructor + * @param {number} numInputs + * @param {number} numOutputs + */ + rrShaders.VertexShader = function(numInputs, numOutputs) { + /** @type {Array} */ this.m_inputs = []; + for (var ndx = 0; ndx < numInputs; ndx++) this.m_inputs[ndx] = new rrShaders.VertexInputInfo(); + /** @type {Array} */ this.m_outputs = []; + for (var ndx = 0; ndx < numOutputs; ndx++) this.m_outputs[ndx] = new rrShaders.VertexVaryingInfo(); + }; + + /** + * getInputs + * @return {Array} + */ + rrShaders.VertexShader.prototype.getInputs = function() {return this.m_inputs;}; + + /** + * getOutputs + * @return {Array} + */ + rrShaders.VertexShader.prototype.getOutputs = function() {return this.m_outputs;}; + + /** + * Fragment shader interface + * + * Fragment shader executes shading for list of fragment packets. See + * FragmentPacket documentation for more details on shading API. + * @constructor + * @param {number} numInputs + * @param {number} numOutputs + */ + rrShaders.FragmentShader = function(numInputs, numOutputs) { + /** @type {Array} */ this.m_inputs = []; + for (var ndx = 0; ndx < numInputs; ndx++) this.m_inputs[ndx] = new rrShaders.VertexVaryingInfo(); + /** @type {Array} */ this.m_outputs = []; + for (var ndx = 0; ndx < numOutputs; ndx++) this.m_outputs[ndx] = new rrShaders.FragmentOutputInfo(); + /** @type {*} */ this.m_container; // owner object + }; + + /** + * getInputs + * @return {Array} + */ + rrShaders.FragmentShader.prototype.getInputs = function() {return this.m_inputs;}; + + /** + * getOutputs + * @return {Array} + */ + rrShaders.FragmentShader.prototype.getOutputs = function() {return this.m_outputs;}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js new file mode 100644 index 000000000..38b9d201f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js @@ -0,0 +1,113 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.referencerenderer.rrDefs'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); + +goog.scope(function() { + + var rrShadingContext = framework.referencerenderer.rrShadingContext; + var deMath = framework.delibs.debase.deMath; + var rrDefs = framework.referencerenderer.rrDefs; + var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * Fragment shading context + * + * Contains per-primitive information used in fragment shading + * @constructor + * @param {Array>} varying0 (GenericVec4*) + * @param {Array>} varying1 (GenericVec4*) + * @param {Array>} varying2 (GenericVec4*) + */ + rrShadingContext.FragmentShadingContext = function(varying0, varying1, varying2) { + /** @type {Array>>} */ this.varyings = [varying0, varying1, varying2]; //!< Vertex shader outputs. Pointer will be NULL if there is no such vertex. + this.m_width = 0xFFFFFFFF; + this.m_height = 0xFFFFFFFF; + }; + + /** + * @param {number} width + * @param {number} height + */ + rrShadingContext.FragmentShadingContext.prototype.setSize = function(width, height) { + this.m_width = width; + this.m_height = height; + }; + + rrShadingContext.FragmentShadingContext.prototype.getWidth = function() { + return this.m_width; + }; + + rrShadingContext.FragmentShadingContext.prototype.getHeight = function() { + return this.m_height; + }; + + // Read Varying + + /** + * @param {rrFragmentOperations.Fragment} packet + * @param {rrShadingContext.FragmentShadingContext} context + * @param {number} varyingLoc + * @return {Array} (Vector) + */ + rrShadingContext.readTriangleVarying = function(packet, context, varyingLoc) { + var result = deMath.scale( + context.varyings[0][varyingLoc], + packet.barycentric[0] + ); + + if (context.varyings[1]) + result = deMath.add(result, deMath.scale( + context.varyings[1][varyingLoc], + packet.barycentric[1] + )); + + if (context.varyings[2]) + result = deMath.add(result, deMath.scale( + context.varyings[2][varyingLoc], + packet.barycentric[2] + )); + + return result; + }; + + /** + * @param {rrFragmentOperations.Fragment} packet + * @param {rrShadingContext.FragmentShadingContext} context + * @param {number} varyingLoc + * @return {Array} (Vector) + */ + rrShadingContext.readVarying = function(packet, context, varyingLoc) { + return rrShadingContext.readTriangleVarying(packet, context, varyingLoc); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js new file mode 100644 index 000000000..03a58168f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js @@ -0,0 +1,115 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrUtil'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); + +goog.scope(function() { + + var rrUtil = framework.referencerenderer.rrUtil; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; + + /** + * @param {sglrGLContext.GLContext | WebGL2RenderingContext | sglrReferenceContext.ReferenceContext} ctx + * @param {number|Object} program + * @param {Array} p0 + * @param {Array} p1 + */ + rrUtil.drawQuad = function(ctx, program, p0, p1) { + // Vertex data. + var hz = (p0[2] + p1[2]) * 0.5; + /** @type {Array} */ var position = [ + p0[0], p0[1], p0[2], 1.0, + p0[0], p1[1], hz, 1.0, + p1[0], p0[1], hz, 1.0, + p1[0], p1[1], p1[2], 1.0 + ]; + /** @type {Array} */ var coord = [ + 0.0, 0.0, + 0.0, 1.0, + 1.0, 0.0, + 1.0, 1.0 + ]; + /** @type {Array} */ var indices = [0, 1, 2, 2, 1, 3]; + + var posLoc = ctx.getAttribLocation(program, 'a_position'); + if (posLoc == -1) + throw new Error('a_position attribute is not defined.'); + + var coordLoc = ctx.getAttribLocation(program, 'a_coord'); + var vaoID; + var bufIDs = []; + + vaoID = ctx.createVertexArray(); + ctx.bindVertexArray(vaoID); + + bufIDs[0] = ctx.createBuffer(); + bufIDs[1] = ctx.createBuffer(); + + ctx.useProgram(program); + + if (posLoc >= 0) { + ctx.bindBuffer(gl.ARRAY_BUFFER, bufIDs[0]); + ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(position), gl.STATIC_DRAW); + + ctx.enableVertexAttribArray(posLoc); + ctx.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0); + + ctx.bindBuffer(gl.ARRAY_BUFFER, null); + } + + if (coordLoc >= 0) { + ctx.bindBuffer(gl.ARRAY_BUFFER, bufIDs[1]); + ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(coord), gl.STATIC_DRAW); + + ctx.enableVertexAttribArray(coordLoc); + ctx.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0); + + ctx.bindBuffer(gl.ARRAY_BUFFER, null); + } + + { + var ndxID = ctx.createBuffer(); + + ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ndxID); + ctx.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW); + + ctx.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0); + + ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + ctx.deleteBuffer(ndxID); + } + + ctx.bindVertexArray(null); + ctx.deleteBuffer(bufIDs[0]); + ctx.deleteBuffer(bufIDs[1]); + ctx.deleteVertexArray(vaoID); + + if (posLoc >= 0) + ctx.disableVertexAttribArray(posLoc); + + if (coordLoc >= 0) + ctx.disableVertexAttribArray(coordLoc); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js new file mode 100644 index 000000000..f6095e2cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js @@ -0,0 +1,641 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.referencerenderer.rrGenericVector'); + +goog.scope(function() { + +var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; +var deMath = framework.delibs.debase.deMath; +var tcuFloat = framework.common.tcuFloat; +var rrGenericVector = framework.referencerenderer.rrGenericVector; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * rrVertexAttrib.NormalOrder + * @enum + */ + rrVertexAttrib.NormalOrder = { + T0: 0, + T1: 1, + T2: 2, + T3: 3 + }; + + /** + * rrVertexAttrib.BGRAOrder + * @enum + */ + rrVertexAttrib.BGRAOrder = { + T0: 2, + T1: 1, + T2: 0, + T3: 3 + }; + + /** + * rrVertexAttrib.VertexAttribType enum + * @enum + */ + rrVertexAttrib.VertexAttribType = { + // Can only be rrVertexAttrib.read as floats + FLOAT: 0, + HALF: 1, + FIXED: 2, + DOUBLE: 3, + + // Can only be rrVertexAttrib.read as floats, will be normalized + NONPURE_UNORM8: 4, + NONPURE_UNORM16: 5, + NONPURE_UNORM32: 6, + NONPURE_UNORM_2_10_10_10_REV: 7, //!< Packed format, only size = 4 is allowed + + // Clamped formats, GLES3-style conversion: max{c / (2^(b-1) - 1), -1 } + NONPURE_SNORM8_CLAMP: 8, + NONPURE_SNORM16_CLAMP: 9, + NONPURE_SNORM32_CLAMP: 10, + NONPURE_SNORM_2_10_10_10_REV_CLAMP: 11, //!< Packed format, only size = 4 is allowed + + // Scaled formats, GLES2-style conversion: (2c + 1) / (2^b - 1) + NONPURE_SNORM8_SCALE: 12, + NONPURE_SNORM16_SCALE: 13, + NONPURE_SNORM32_SCALE: 14, + NONPURE_SNORM_2_10_10_10_REV_SCALE: 15, //!< Packed format, only size = 4 is allowed + + // can only be rrVertexAttrib.read as float, will not be normalized + NONPURE_UINT8: 16, + NONPURE_UINT16: 17, + NONPURE_UINT32: 18, + + NONPURE_INT8: 19, + NONPURE_INT16: 20, + NONPURE_INT32: 21, + + NONPURE_UINT_2_10_10_10_REV: 22, //!< Packed format, only size = 4 is allowed + NONPURE_INT_2_10_10_10_REV: 23, //!< Packed format, only size = 4 is allowed + + // can only be rrVertexAttrib.read as integers + PURE_UINT8: 24, + PURE_UINT16: 25, + PURE_UINT32: 26, + + PURE_INT8: 27, + PURE_INT16: 28, + PURE_INT32: 29, + + // reordered formats of gl.ARB_vertex_array_bgra + NONPURE_UNORM8_BGRA: 30, + NONPURE_UNORM_2_10_10_10_REV_BGRA: 31, + NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA: 32, + NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA: 33, + + // can be rrVertexAttrib.read as anything + DONT_CARE: 34 //!< Do not enforce type checking when reading GENERIC attribute. Used for current client side attributes. + }; + + /** + * rrVertexAttrib.VertexAttrib class + * @constructor + */ + rrVertexAttrib.VertexAttrib = function() { + /** @type {rrVertexAttrib.VertexAttribType} */ this.type = rrVertexAttrib.VertexAttribType.FLOAT; + /** @type {number} */ this.size = 0; + /** @type {number} */ this.stride = 0; + /** @type {number} */ this.instanceDivisor = 0; + /** @type {number} */ this.offset = 0; //Added this property to compensate functionality (not in original dEQP). + /** @type {ArrayBuffer} */ this.pointer = null; + /** @type {Array|rrGenericVector.GenericVec4} */ this.generic; //!< Generic attribute, used if pointer is null. + }; + + /** + * @param {rrVertexAttrib.VertexAttribType} type + * @return {number} + */ + rrVertexAttrib.getComponentSize = function(type) { + switch (type) { + case rrVertexAttrib.VertexAttribType.FLOAT: return 4; + case rrVertexAttrib.VertexAttribType.HALF: return 2; + case rrVertexAttrib.VertexAttribType.FIXED: return 4; + case rrVertexAttrib.VertexAttribType.DOUBLE: return 8; //sizeof(double); + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8: return 1; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM16: return 2; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM32: return 4; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV: return 1; //sizeof(deUint32)/4; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_CLAMP: return 1; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_CLAMP: return 2; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_CLAMP: return 4; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP: return 1; //sizeof(deUint32)/4; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_SCALE: return 1; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_SCALE: return 2; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_SCALE: return 4; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE: return 1; //sizeof(deUint32)/4; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT8: return 1; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT16: return 2; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT32: return 4; + case rrVertexAttrib.VertexAttribType.NONPURE_INT8: return 1; + case rrVertexAttrib.VertexAttribType.NONPURE_INT16: return 2; + case rrVertexAttrib.VertexAttribType.NONPURE_INT32: return 4; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV: return 1; //sizeof(deUint32)/4; + case rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV: return 1; //sizeof(deUint32)/4; + case rrVertexAttrib.VertexAttribType.PURE_UINT8: return 1; + case rrVertexAttrib.VertexAttribType.PURE_UINT16: return 2; + case rrVertexAttrib.VertexAttribType.PURE_UINT32: return 4; + case rrVertexAttrib.VertexAttribType.PURE_INT8: return 1; + case rrVertexAttrib.VertexAttribType.PURE_INT16: return 2; + case rrVertexAttrib.VertexAttribType.PURE_INT32: return 4; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8_BGRA: return 1; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV_BGRA: return 1; //sizeof(deUint32)/4; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA: return 1; //sizeof(deUint32)/4; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA: return 1; //sizeof(deUint32)/4; + default: + throw new Error('rrVertexAttrib.getComponentSize - Invalid type'); + } + }; + + /** + * rrVertexAttrib.isValidVertexAttrib function + * @param {rrVertexAttrib.VertexAttrib} vertexAttrib + * @return {boolean} + */ + rrVertexAttrib.isValidVertexAttrib = function(vertexAttrib) { + // Trivial range checks. + if (!deMath.deInBounds32(vertexAttrib.type, 0, Object.keys(rrVertexAttrib.VertexAttribType).length) || + !deMath.deInRange32(vertexAttrib.size, 0, 4) || + vertexAttrib.instanceDivisor < 0) + return false; + + // Generic attributes + if (!vertexAttrib.pointer && vertexAttrib.type != rrVertexAttrib.VertexAttribType.DONT_CARE) + return false; + + // Packed formats + if ((vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV || + vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV || + vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV || + vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP || + vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE || + vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV_BGRA || + vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA || + vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA) && + vertexAttrib.size != 4) + return false; + + return true; + }; + + /** + * rrVertexAttrib.readVertexAttrib function + * @param {rrVertexAttrib.VertexAttrib} vertexAttrib + * @param {number} instanceNdx + * @param {number} vertexNdx + * @param {rrGenericVector.GenericVecType} genericType + * @return {goog.NumberArray} + */ + rrVertexAttrib.readVertexAttrib = function(vertexAttrib, instanceNdx, vertexNdx, genericType) { + DE_ASSERT(rrVertexAttrib.isValidVertexAttrib(vertexAttrib)); + /** @type {goog.NumberArray} */ var dst; + + var arrayType = null; + switch (genericType) { + case rrGenericVector.GenericVecType.INT32: + arrayType = Int32Array; + break; + case rrGenericVector.GenericVecType.UINT32: + arrayType = Uint32Array; + break; + case rrGenericVector.GenericVecType.FLOAT: + arrayType = Float32Array; + break; + } + + if (vertexAttrib.pointer) { + /** @type {number} */ var elementNdx = (vertexAttrib.instanceDivisor != 0) ? (instanceNdx / vertexAttrib.instanceDivisor) : vertexNdx; + /** @type {number} */ var compSize = rrVertexAttrib.getComponentSize(vertexAttrib.type); + /** @type {number} */ var stride = (vertexAttrib.stride != 0) ? (vertexAttrib.stride) : (vertexAttrib.size * compSize); + /** @type {number} */ var byteOffset = vertexAttrib.offset + (elementNdx * stride); + + dst = [0, 0, 0, 1]; // defaults + + if (arrayType != null) { + dst = new arrayType(dst); + } + + rrVertexAttrib.read(dst, vertexAttrib.type, vertexAttrib.size, new Uint8Array(vertexAttrib.pointer, byteOffset)); + } else { + dst = new arrayType(/** @type {Array} */ vertexAttrib.generic.data); + } + + return dst; + }; + + /** + * rrVertexAttrib.readHalf + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + */ + rrVertexAttrib.readHalf = function(dst, size, ptr) { + var arraysize16 = 2; //2 bytes + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize16)); //Small buffer copy (max. 8 bytes) + var aligned = new Uint16Array(ptrclone.buffer); + + //Reinterpret aligned's values into the dst vector. + dst[0] = tcuFloat.newFloat32From16(aligned[0]).getValue(); + if (size >= 2) dst[1] = tcuFloat.newFloat32From16(aligned[1]).getValue(); + if (size >= 3) dst[2] = tcuFloat.newFloat32From16(aligned[2]).getValue(); + if (size >= 4) dst[3] = tcuFloat.newFloat32From16(aligned[3]).getValue(); + }; + + /** + * rrVertexAttrib.readFixed + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + */ + /*rrVertexAttrib.readFixed = function(dst, size, ptr) { + var arraysize32 = 4; //4 bytes + + //Reinterpret ptr as a uint16 array, + //assuming original ptr is 8-bits per element + var aligned = new Int32Array(ptr.buffer).subarray( + ptr.byteOffset / arraysize32, + (ptr.byteOffset + ptr.byteLength) / arraysize32); + + //Reinterpret aligned's values into the dst vector. + dst[0] = aligned[0] / (1 << 16); + if (size >= 2) dst[1] = aligned[1] / (1 << 16); + if (size >= 3) dst[2] = aligned[2] / (1 << 16); + if (size >= 4) dst[3] = aligned[3] / (1 << 16); + };*/ + + /** + * TODO: Check 64 bit numbers are handled ok + * rrVertexAttrib.readDouble + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + */ + /*rrVertexAttrib.readDouble = function(dst, size, ptr) { + var arraysize64 = 8; //8 bytes + + //Reinterpret 'ptr' into 'aligned' as a float64 array, + //assuming original ptr is 8-bits per element. + var aligned = new Float64Array(ptr.buffer).subarray( + ptr.byteOffset / arraysize64, + (ptr.byteOffset + ptr.byteLength) / arraysize64); + + //Reinterpret aligned's values into the dst vector. + dst[0] = aligned[0]; + if (size >= 2) dst[1] = aligned[1]; + if (size >= 3) dst[2] = aligned[2]; + if (size >= 4) dst[3] = aligned[3]; + };*/ + + /** + * extendSign + * @param {number} integerLen + * @param {number} integer_ (deUint32) + * @return {number} (deInt32) + */ + rrVertexAttrib.extendSign = function(integerLen, integer_) { + return new Int32Array([ + deMath.binaryOp( + 0 - + deMath.shiftLeft( + deMath.binaryOp( + integer_, + deMath.shiftLeft( + 1, + (integerLen - 1) + ), + deMath.BinaryOp.AND + ), + 1 + ) , + +integer_, + deMath.BinaryOp.OR + ) + ])[0]; + }; + + /** + * rrVertexAttrib.readUint2101010Rev + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + */ + rrVertexAttrib.readUint2101010Rev = function(dst, size, ptr) { + var arraysize32 = 4; //4 bytes + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes) + var aligned = new Uint32Array(ptrclone.buffer)[0]; + + dst[0] = deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND); + if (size >= 2) dst[1] = deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND); + if (size >= 3) dst[2] = deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND); + if (size >= 4) dst[3] = deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND); + }; + + /** + * rrVertexAttrib.readInt2101010Rev + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + */ + rrVertexAttrib.readInt2101010Rev = function(dst, size, ptr) { + var arraysize32 = 4; //4 bytes + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes) + var aligned = new Uint32Array(ptrclone.buffer)[0]; + + dst[0] = rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)); + if (size >= 2) dst[1] = rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)); + if (size >= 3) dst[2] = rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)); + if (size >= 4) dst[3] = rrVertexAttrib.extendSign(2, deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND)); + }; + + /** + * rrVertexAttrib.readUnorm2101010RevOrder + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + * @param {Object} order + */ + rrVertexAttrib.readUnorm2101010RevOrder = function(dst, size, ptr, order) { + var arraysize32 = 4; //4 bytes + + //Left shift within 32-bit range as 32-bit int. + var range10 = new Uint32Array([deMath.shiftLeft(1, 10) - 1])[0]; + var range2 = new Uint32Array([deMath.shiftLeft(1, 2) - 1])[0]; + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes) + var aligned = new Uint32Array(ptrclone.buffer)[0]; + + dst[order.T0] = deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND) / range10; + if (size >= 2) dst[order.T1] = deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND) / range10; + if (size >= 3) dst[order.T2] = deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND) / range10; + if (size >= 4) dst[order.T3] = deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND) / range2; + }; + + /** + * rrVertexAttrib.readSnorm2101010RevClampOrder + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + * @param {Object} order + */ + rrVertexAttrib.readSnorm2101010RevClampOrder = function(dst, size, ptr, order) { + var arraysize32 = 4; //4 bytes + + //Left shift within 32-bit range as 32-bit int. + var range10 = new Uint32Array([deMath.shiftLeft(1, 10 - 1) - 1])[0]; + var range2 = new Uint32Array([deMath.shiftLeft(1, 2 - 1) - 1])[0]; + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes) + var aligned = new Uint32Array(ptrclone.buffer)[0]; + + dst[order.T0] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND))])[0] / range10); + if (size >= 2) dst[order.T1] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND))])[0] / range10); + if (size >= 3) dst[order.T2] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND))])[0] / range10); + if (size >= 4) dst[order.T3] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(2, deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND))])[0] / range2); + }; + + /** + * rrVertexAttrib.readSnorm2101010RevScaleOrder + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + * @param {Object} order + */ + rrVertexAttrib.readSnorm2101010RevScaleOrder = function(dst, size, ptr, order) { + var arraysize32 = 4; //4 bytes + + //Left shift within 32-bit range as 32-bit int. + var range10 = new Uint32Array([deMath.shiftLeft(1, 10) - 1])[0]; + var range2 = new Uint32Array([deMath.shiftLeft(1, 2) - 1])[0]; + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes) + var aligned = new Uint32Array(ptrclone.buffer)[0]; + + dst[order.T0] = new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range10; + if (size >= 2) dst[order.T1] = new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range10; + if (size >= 3) dst[order.T2] = new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range10; + if (size >= 4) dst[order.T3] = new Float32Array([rrVertexAttrib.extendSign(2, deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range2; + }; + + /** + * rrVertexAttrib.readUnormOrder + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + * @param {Object} order + * @param readAsTypeArray + */ + rrVertexAttrib.readUnormOrder = function(dst, size, ptr, order, readAsTypeArray) { + var arrayelementsize = readAsTypeArray.BYTES_PER_ELEMENT; + + //Left shift within 32-bit range as 32-bit float. + var range = new Float32Array([deMath.shiftLeft(1, arrayelementsize * 8) - 1])[0]; + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arrayelementsize)); //Small buffer copy (max. 16 bytes) + var aligned = new readAsTypeArray(ptrclone.buffer); + + //Reinterpret aligned's values into the dst vector. + dst[order.T0] = aligned[0] / range; + if (size >= 2) dst[order.T1] = aligned[1] / range; + if (size >= 3) dst[order.T2] = aligned[2] / range; + if (size >= 4) dst[order.T3] = aligned[3] / range; + }; + + /** + * rrVertexAttrib.readSnormClamp + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + * @param {function(new:ArrayBufferView,(Array|ArrayBuffer|ArrayBufferView|null|number), number=, number=)} readAsTypeArray + */ + rrVertexAttrib.readSnormClamp = function(dst, size, ptr, readAsTypeArray) { + var arrayelementsize = readAsTypeArray.BYTES_PER_ELEMENT; + + //Left shift within 32-bit range as 32-bit float. + var range = new Float32Array([deMath.shiftLeft(1, arrayelementsize * 8 - 1) - 1])[0]; + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arrayelementsize)); //Small buffer copy (max. 16 bytes) + var aligned = new readAsTypeArray(ptrclone.buffer); + + //Reinterpret aligned's values into the dst vector. + dst[0] = Math.max(-1, aligned[0] / range); + if (size >= 2) dst[1] = Math.max(-1, aligned[1] / range); + if (size >= 3) dst[2] = Math.max(-1, aligned[2] / range); + if (size >= 4) dst[3] = Math.max(-1, aligned[3] / range); + }; + + /** + * rrVertexAttrib.readOrder + * @param {goog.NumberArray} dst + * @param {number} size + * @param {Uint8Array} ptr + * @param {Object} order NormalOrder or BGRAOrder + * @param readAsTypeArray Typed Array type + */ + rrVertexAttrib.readOrder = function(dst, size, ptr, order, readAsTypeArray) { + var arrayelementsize = readAsTypeArray.BYTES_PER_ELEMENT; + + var ptrclone = new Uint8Array(ptr.subarray(0, size * arrayelementsize)); //Small buffer copy (max. 16 bytes) + var aligned = new readAsTypeArray(ptrclone.buffer); + + //Reinterpret aligned's values into the dst vector. + //(automatic in JS typed arrays). + dst[order.T0] = aligned[0]; + if (size >= 2) dst[order.T1] = aligned[1]; + if (size >= 3) dst[order.T2] = aligned[2]; + if (size >= 4) dst[order.T3] = aligned[3]; + }; + + /** + * TODO: Implement readSNormScale. + * @param {goog.NumberArray} dst + * @param {rrVertexAttrib.VertexAttribType} type + * @param {number} size + * @param {Uint8Array} ptr + */ + rrVertexAttrib.read = function(dst, type, size, ptr) { + var order; + + switch (type) { + case rrVertexAttrib.VertexAttribType.FLOAT: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Float32Array); + break; + case rrVertexAttrib.VertexAttribType.HALF: + rrVertexAttrib.readHalf(dst, size, ptr); + break; + /*case rrVertexAttrib.VertexAttribType.FIXED: + rrVertexAttrib.readFixed(dst, size, ptr); + break; + case rrVertexAttrib.VertexAttribType.DOUBLE: + rrVertexAttrib.readDouble(dst, size, ptr); + break;*/ + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8: + rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint8Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM16: + rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint16Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM32: + rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint32Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV: + rrVertexAttrib.readUnorm2101010RevOrder(dst, size, ptr, rrVertexAttrib.NormalOrder); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_CLAMP: //Int8 + rrVertexAttrib.readSnormClamp(dst, size, ptr, Int8Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_CLAMP: //Int16 + rrVertexAttrib.readSnormClamp(dst, size, ptr, Int16Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_CLAMP: //Int32 + rrVertexAttrib.readSnormClamp(dst, size, ptr, Int32Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP: + rrVertexAttrib.readSnorm2101010RevClampOrder(dst, size, ptr, rrVertexAttrib.NormalOrder); + break; + /*case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_SCALE: //Int8 + rrVertexAttrib.readSnormScale(dst, size, ptr, Int8Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_SCALE: //Int16 + rrVertexAttrib.readSnormScale(dst, size, ptr, Int16Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_SCALE: //Int32 + rrVertexAttrib.readSnormScale(dst, size, ptr, Int32Array); + break;*/ + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE: + rrVertexAttrib.readSnorm2101010RevScaleOrder(dst, size, ptr, rrVertexAttrib.NormalOrder); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV: + rrVertexAttrib.readUint2101010Rev(dst, size, ptr); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV: + rrVertexAttrib.readInt2101010Rev(dst, size, ptr); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8_BGRA: + rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder, Uint8Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV_BGRA: + rrVertexAttrib.readUnorm2101010RevOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA: + rrVertexAttrib.readSnorm2101010RevClampOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA: + rrVertexAttrib.readSnorm2101010RevScaleOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT8: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint8Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT16: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint16Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_UINT32: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint32Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_INT8: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int8Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_INT16: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int16Array); + break; + case rrVertexAttrib.VertexAttribType.NONPURE_INT32: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int32Array); + break; + case rrVertexAttrib.VertexAttribType.PURE_UINT8: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint8Array); + break; + case rrVertexAttrib.VertexAttribType.PURE_UINT16: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint16Array); + break; + case rrVertexAttrib.VertexAttribType.PURE_UINT32: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint32Array); + break; + case rrVertexAttrib.VertexAttribType.PURE_INT8: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int8Array); + break; + case rrVertexAttrib.VertexAttribType.PURE_INT16: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int16Array); + break; + case rrVertexAttrib.VertexAttribType.PURE_INT32: + rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int32Array); + break; + + default: + throw new Error('rrVertexAttrib.read - Invalid type'); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js new file mode 100644 index 000000000..ec00e17d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js @@ -0,0 +1,101 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('framework.referencerenderer.rrVertexPacket'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); + +goog.scope(function() { + +var rrVertexPacket = framework.referencerenderer.rrVertexPacket; +var tcuTexture = framework.common.tcuTexture; +var deMath = framework.delibs.debase.deMath; + + /** + * rrVertexPacket.VertexPacket class. (Should only be created by rrVertexPacket.VertexPacketAllocator) + * @constructor + */ + rrVertexPacket.VertexPacket = function() { + /** @type {number} */ this.instanceNdx; + /** @type {number} */ this.vertexNdx; + /** @type {goog.NumberArray} */ this.position; //!< Transformed position - must be written always. + /** @type {number} */ this.pointSize; //!< Point size, required when rendering points. + // /** @type {number} */ this.primitiveID; //!< Geometry shader output (Not used in webGL) + /** @type {Array} */ this.outputs = [[0, 0, 0, 0]]; + }; + + /** + * rrVertexPacket.VertexPacketAllocator class + * @constructor + * @param {number} numberOfVertexOutputs + */ + rrVertexPacket.VertexPacketAllocator = function(numberOfVertexOutputs) { + /** @type {number} */ this.m_numberOfVertexOutputs = numberOfVertexOutputs; + /** @type {Uint8Array} */ this.m_allocations; + /** @type {Array} */ this.m_singleAllocPool = []; + }; + + /** + * @return {number} + */ + rrVertexPacket.VertexPacketAllocator.prototype.getNumVertexOutputs = function() { + return this.m_numberOfVertexOutputs; + }; + + /** + * allocArray + * @param {number} count + * @return {Array} + */ + rrVertexPacket.VertexPacketAllocator.prototype.allocArray = function(count) { + if (!count) + return []; + + /** @type {number} */ var extraVaryings = (this.m_numberOfVertexOutputs == 0) ? (0) : (this.m_numberOfVertexOutputs - 1); + // /** @type {number} TODO: Check what this size is used for */ var packetSize = sizeof(rrVertexPacket.VertexPacket) + extraVaryings * sizeof(GenericVec4); + + /** @type {Array} */ var retVal = []; + // /** @type {Uint8Array} TODO: same as above */ var ptr = new deInt8[packetSize * count]; // throws bad_alloc => ok + + //run ctors + for (var i = 0; i < count; ++i) + retVal.push(new rrVertexPacket.VertexPacket()); + + /** TODO: same as previous - this.m_allocations.push_back(ptr); */ + + return retVal; + }; + + /** + * @return {rrVertexPacket.VertexPacket} + */ + rrVertexPacket.VertexPacketAllocator.prototype.alloc = function() { + /** @type {number} */ var poolSize = 8; + + if (this.m_singleAllocPool.length == 0) + this.m_singleAllocPool = this.allocArray(poolSize); + + /** @type {rrVertexPacket.VertexPacket} */ var packet = this.m_singleAllocPool.pop(); + + return packet; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt new file mode 100644 index 000000000..0210211a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt @@ -0,0 +1,76 @@ +--min-version 2.0.1 builtinprecision/00_test_list.txt +draw/00_test_list.txt +fbocolorbuffer/00_test_list.txt +fboinvalidate/00_test_list.txt +fborender/00_test_list.txt +fragmentoutput/00_test_list.txt +framebufferblit/00_test_list.txt +primitiverestart/00_test_list.txt +shaderindexing/00_test_list.txt +shadermatrix/00_test_list.txt +shaderoperator/00_test_list.txt +shadertexturefunction/00_test_list.txt +texturefiltering/00_test_list.txt +textureformat/00_test_list.txt +textureshadow/00_test_list.txt +texturespecification/00_test_list.txt +texturewrap/00_test_list.txt +transformfeedback/00_test_list.txt +uniformapi/00_test_list.txt +uniformbuffers/00_test_list.txt +vertexarrays/00_test_list.txt +attriblocation.html +booleanstatequery.html +buffercopy.html +bufferobjectquery.html +clipping.html +defaultvertexattribute.html +fbocompleteness.html +fbodepthbuffer.html +fbomultisample.2_samples.html +fbomultisample.4_samples.html +fbomultisample.8_samples.html +fbostatequery.html +fbostencilbuffer.html +floatstatequery.html +fragdepth.html +indexedstatequery.html +instancedrendering.html +integerstatequery.html +internalformatquery.html +lifetime.html +multisample.html +negativebufferapi.html +negativefragmentapi.html +negativeshaderapi.html +negativestateapi.html +negativetextureapi.html +negativevertexarrayapi.html +occlusionquery_strict.html +occlusionquery_conservative.html +pixelbufferobject.html +rasterizerdiscard.html +rbostatequery.html +readpixel.html +samplerobject.html +samplerstatequery.html +shaderapi.html +shaderbuiltinvar.html +shadercommonfunction.html +shaderderivate_dfdx.html +shaderderivate_dfdy.html +shaderderivate_fwidth.html +shaderloop_for.html +shaderloop_while.html +shaderloop_do_while.html +shaderpackingfunction.html +shaderprecision_float.html +shaderprecision_int.html +shaderprecision_uint.html +shaderstatequery.html +shaderstruct.html +shaderswitch.html +stringquery.html +sync.html +texturestatequery.html +vertexarrayobject.html diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html new file mode 100644 index 000000000..5eb12e778 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html @@ -0,0 +1,24 @@ + + + +WebGL Attribute Location Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html new file mode 100644 index 000000000..0423dd44f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Boolean State Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html new file mode 100644 index 000000000..04c1d11bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html @@ -0,0 +1,24 @@ + + + +WebGL Buffer Copy Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html new file mode 100644 index 000000000..b0fa2f358 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html @@ -0,0 +1,24 @@ + + + +WebGL Buffer Object Query Tests Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt new file mode 100644 index 000000000..6ac29a386 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt @@ -0,0 +1,55 @@ +add.html +sub.html +mul.html +div.html +radians.html +degrees.html +sin.html +cos.html +tan.html +asin.html +acos.html +atan.html +atan2.html +sinh.html +cosh.html +tanh.html +asinh.html +acosh.html +atanh.html +pow.html +exp.html +exp2.html +log.html +log2.html +sqrt.html +inversesqrt.html +abs.html +sign.html +floor.html +trunc.html +round.html +roundeven.html +ceil.html +fract.html +mod.html +modf.html +min.html +max.html +mix.html +step.html +smoothstep.html +clamp.html +length.html +distance.html +dot.html +cross.html +normalize.html +faceforward.html +reflect.html +refract.html +matrixcompmult.html +outerproduct.html +transpose.html +determinant.html +inverse.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html new file mode 100644 index 000000000..1c395e94d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html new file mode 100644 index 000000000..3c27d4a35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html new file mode 100644 index 000000000..6931a6026 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html new file mode 100644 index 000000000..581729934 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html new file mode 100644 index 000000000..7b8bd1a83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html new file mode 100644 index 000000000..ee84df94a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html new file mode 100644 index 000000000..00f50c03c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html new file mode 100644 index 000000000..196de0060 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html new file mode 100644 index 000000000..d117666e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py new file mode 100644 index 000000000..cd32b4534 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for builtinprecision* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'add', + 'sub', + 'mul', + 'div', + 'radians', + 'degrees', + 'sin', + 'cos', + 'tan', + 'asin', + 'acos', + 'atan', + 'atan2', + 'sinh', + 'cosh', + 'tanh', + 'asinh', + 'acosh', + 'atanh', + 'pow', + 'exp', + 'exp2', + 'log', + 'log2', + 'sqrt', + 'inversesqrt', + 'abs', + 'sign', + 'floor', + 'trunc', + 'round', + 'roundeven', + 'ceil', + 'fract', + 'mod', + 'modf', + 'min', + 'max', + 'mix', + 'step', + 'smoothstep', + 'clamp', + 'length', + 'distance', + 'dot', + 'cross', + 'normalize', + 'faceforward', + 'reflect', + 'refract', + 'matrixcompmult', + 'outerproduct', + 'transpose', + 'determinant', + 'inverse' +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, index): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'index': index + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html new file mode 100644 index 000000000..e0d592440 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html new file mode 100644 index 000000000..1a820652a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html new file mode 100644 index 000000000..281419e89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html new file mode 100644 index 000000000..ec9c26b63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html new file mode 100644 index 000000000..1cb96eada --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html new file mode 100644 index 000000000..a9ed0f80e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html new file mode 100644 index 000000000..56ad04eb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html new file mode 100644 index 000000000..1f9cfebaf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html new file mode 100644 index 000000000..bc2c5ce72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html new file mode 100644 index 000000000..e06fd395d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html new file mode 100644 index 000000000..11cb6a826 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html new file mode 100644 index 000000000..3f8755cd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html new file mode 100644 index 000000000..ecabe9cdf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html new file mode 100644 index 000000000..1c060f13b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html new file mode 100644 index 000000000..de778f3ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html new file mode 100644 index 000000000..c0b2e5876 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html new file mode 100644 index 000000000..f34ec5569 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html new file mode 100644 index 000000000..949f716c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html new file mode 100644 index 000000000..0528ceef2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html new file mode 100644 index 000000000..6defd59a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html new file mode 100644 index 000000000..28c81e75f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html new file mode 100644 index 000000000..95420abe1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html new file mode 100644 index 000000000..023035142 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html new file mode 100644 index 000000000..183704370 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html new file mode 100644 index 000000000..cbe10773d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html new file mode 100644 index 000000000..a6e3df51a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html new file mode 100644 index 000000000..0473fd8c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html new file mode 100644 index 000000000..82787d7a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html new file mode 100644 index 000000000..83e2b6d81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html new file mode 100644 index 000000000..7793d740d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html new file mode 100644 index 000000000..d808acba1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html new file mode 100644 index 000000000..87ba13d5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html new file mode 100644 index 000000000..68d967d55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html new file mode 100644 index 000000000..0186d6795 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html new file mode 100644 index 000000000..6e1f91eda --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html new file mode 100644 index 000000000..6c4cf28ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html new file mode 100644 index 000000000..ee95d80af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html new file mode 100644 index 000000000..e805a703a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html new file mode 100644 index 000000000..4dd4d7c9b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html new file mode 100644 index 000000000..707519237 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html new file mode 100644 index 000000000..7dd143bb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html new file mode 100644 index 000000000..8e22e94db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html new file mode 100644 index 000000000..a442f83bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html new file mode 100644 index 000000000..04013ed6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html new file mode 100644 index 000000000..48d55febf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html new file mode 100644 index 000000000..209656d9a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html @@ -0,0 +1,32 @@ + + + + + +WebGL Builtin Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html new file mode 100644 index 000000000..ab2b2bd77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html @@ -0,0 +1,24 @@ + + + +WebGL Clipping tests Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html new file mode 100644 index 000000000..8bca99ad7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html @@ -0,0 +1,24 @@ + + + +WebGL Default Vertex Attributes Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt new file mode 100644 index 000000000..ba28d1bb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt @@ -0,0 +1,7 @@ +draw_arrays.html +draw_elements.html +draw_arrays_instanced.html +draw_elements_instanced.html +draw_range_elements.html +instancing.html +random.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html new file mode 100644 index 000000000..ae9655df1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html @@ -0,0 +1,31 @@ + + + + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html new file mode 100644 index 000000000..f8219ee07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html @@ -0,0 +1,31 @@ + + + + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html new file mode 100644 index 000000000..1fb1a5c16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html @@ -0,0 +1,31 @@ + + + + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html new file mode 100644 index 000000000..e4c4b3b98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html @@ -0,0 +1,31 @@ + + + + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html new file mode 100644 index 000000000..df2f7a92b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html @@ -0,0 +1,31 @@ + + + + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py new file mode 100644 index 000000000..c6b6017ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for draw* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'draw_arrays', + 'draw_elements', + 'draw_arrays_instanced', + 'draw_elements_instanced', + 'draw_range_elements', + 'instancing', + 'random', +] + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = _GROUPS[ii] + '.html' + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html new file mode 100644 index 000000000..df8d7910b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html @@ -0,0 +1,31 @@ + + + + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html new file mode 100644 index 000000000..1c6f02f9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html @@ -0,0 +1,31 @@ + + + + + +WebGL Draw Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js new file mode 100644 index 000000000..3238e6c2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js @@ -0,0 +1,161 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fApiCase'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluStrUtil'); + +goog.scope(function() { + + var es3fApiCase = functional.gles3.es3fApiCase; + var gluStrUtil = framework.opengl.gluStrUtil; + var tcuTestCase = framework.common.tcuTestCase; + + // format numbers as they appear in gl.h + var getHexStr = function(num) { + var numstr = num.toString(16); + var prefix = '0x'; + for ( + var padding = (num < 0x10000 ? 4 : 8) - numstr.length; + padding-- > 0; + ) prefix += '0'; + return prefix + numstr; + }; + + /** + * Base class for all the API tests. + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + */ + es3fApiCase.ApiCase = function(name, desc, gl) { + gl = gl || window.gl; + if (this.test === undefined) { + throw new Error('Unimplemented virtual function: es3fApiCase.ApiCase.test'); + } + tcuTestCase.DeqpTest.call(this, name, desc); + + this.m_gl = gl; + this.m_pass = true; + this.m_comment = ''; + + }; + + es3fApiCase.ApiCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fApiCase.ApiCase.prototype.constructor = es3fApiCase.ApiCase; + + /** + * @param {boolean} condition + * @param {string=} message + */ + es3fApiCase.ApiCase.prototype.check = function(condition, message) { + if (this.m_pass && !condition) { + bufferedLogToConsole('Condition is false. Test failed.'); + if (message) + this.m_comment += ' ' + message; + this.m_pass = condition; + } + return condition; + }; + + es3fApiCase.ApiCase.prototype.iterate = function() { + + this.test(); + + if (this.m_pass) + testPassed(this.m_comment); + else + testFailedOptions(this.m_comment, true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @param {Array|number} expected + * @return {boolean} returns true if gl.getError returns an expected error code and false otherwise. + */ + es3fApiCase.ApiCase.prototype.expectError = function(expected) { + if (expected.constructor === Number) + expected = [expected]; + + var err = this.m_gl.getError(); + var conformant = expected.indexOf(err) >= 0; + + if (!conformant) { + + var l = expected.length; + var msg = 'Expected '; + + if (l > 1) + msg += (l == 2 ? 'either ' : 'one of '); + + for (var i = 0; i < l; ++i) msg += ( + (gluStrUtil.getErrorName(expected[i]) || getHexStr(expected[i])) + + (l - i == 2 ? ' or ' : ', ') + ); + + msg += 'but got ' + (gluStrUtil.getErrorName(err) || getHexStr(err)) + '.'; + + this.testFailed(msg); + + } + + return conformant; + }; + + es3fApiCase.ApiCase.prototype.testFailed = function(comment) { + bufferedLogToConsole(comment); + if (this.m_pass) { + this.m_comment = comment; + this.m_pass = false; + } + }; + + es3fApiCase.ApiCase.prototype.expectThrowNoError = function(f) { + try { + f(); + this.testFailed("should have thrown exception"); + } catch (e) { + this.expectError(this.m_gl.NO_ERROR); + } + } + + /** + * Base class for all the API tests. + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} desc + * @param {function(this:es3fApiCase.ApiCaseCallback)} callback + */ + es3fApiCase.ApiCaseCallback = function(name, desc, gl, callback) { + this.test = callback; + es3fApiCase.ApiCase.call(this, name, desc, gl); + }; + es3fApiCase.ApiCaseCallback.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fApiCase.ApiCaseCallback.prototype.constructor = es3fApiCase.ApiCaseCallback; + +/* + es3fApiCase.ApiCase.prototype.expectError // (error) or (error0, error1) + es3fApiCase.ApiCase.prototype.getSupportedExtensions // (number numSupportedValues, number extension, [number] values ) + es3fApiCase.ApiCase.prototype.checkBooleans // (char value, char expected); +//*/ +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js new file mode 100644 index 000000000..93f91eca1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js @@ -0,0 +1,267 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES 3.0 Module + * ------------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Attribute location test + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('functional.gles3.es3fAttribLocationTests'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('modules.shared.glsAttributeLocationTests'); + +goog.scope(function() { + + var es3fAttribLocationTests = functional.gles3.es3fAttribLocationTests; + var glsAttributeLocationTests = modules.shared.glsAttributeLocationTests; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderUtil = framework.opengl.gluShaderUtil; + + es3fAttribLocationTests.createAttributeLocationTests = function() { + + /** @type {Array} */ + var types = [ + new glsAttributeLocationTests.AttribType('float', 1, gl.FLOAT), + new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2), + new glsAttributeLocationTests.AttribType('vec3', 1, gl.FLOAT_VEC3), + new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), + + new glsAttributeLocationTests.AttribType('mat2', 2, gl.FLOAT_MAT2), + new glsAttributeLocationTests.AttribType('mat3', 3, gl.FLOAT_MAT3), + new glsAttributeLocationTests.AttribType('mat4', 4, gl.FLOAT_MAT4), + + new glsAttributeLocationTests.AttribType('int', 1, gl.INT), + new glsAttributeLocationTests.AttribType('ivec2', 1, gl.INT_VEC2), + new glsAttributeLocationTests.AttribType('ivec3', 1, gl.INT_VEC3), + new glsAttributeLocationTests.AttribType('ivec4', 1, gl.INT_VEC4), + + new glsAttributeLocationTests.AttribType('uint', 1, gl.UNSIGNED_INT), + new glsAttributeLocationTests.AttribType('uvec2', 1, gl.UNSIGNED_INT_VEC2), + new glsAttributeLocationTests.AttribType('uvec3', 1, gl.UNSIGNED_INT_VEC3), + new glsAttributeLocationTests.AttribType('uvec4', 1, gl.UNSIGNED_INT_VEC4), + + new glsAttributeLocationTests.AttribType('mat2x2', 2, gl.FLOAT_MAT2), + new glsAttributeLocationTests.AttribType('mat2x3', 2, gl.FLOAT_MAT2x3), + new glsAttributeLocationTests.AttribType('mat2x4', 2, gl.FLOAT_MAT2x4), + + new glsAttributeLocationTests.AttribType('mat3x2', 3, gl.FLOAT_MAT3x2), + new glsAttributeLocationTests.AttribType('mat3x3', 3, gl.FLOAT_MAT3), + new glsAttributeLocationTests.AttribType('mat3x4', 3, gl.FLOAT_MAT3x4), + + new glsAttributeLocationTests.AttribType('mat4x2', 4, gl.FLOAT_MAT4x2), + new glsAttributeLocationTests.AttribType('mat4x3', 4, gl.FLOAT_MAT4x3), + new glsAttributeLocationTests.AttribType('mat4x4', 4, gl.FLOAT_MAT4) + ]; + + /** @type {Array} */ + var es2Types = [ + new glsAttributeLocationTests.AttribType('float', 1, gl.FLOAT), + new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2), + new glsAttributeLocationTests.AttribType('vec3', 1, gl.FLOAT_VEC3), + new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), + + new glsAttributeLocationTests.AttribType('mat2', 2, gl.FLOAT_MAT2), + new glsAttributeLocationTests.AttribType('mat3', 3, gl.FLOAT_MAT3), + new glsAttributeLocationTests.AttribType('mat4', 4, gl.FLOAT_MAT4) + ]; + + /** @type {tcuTestCase.DeqpTest} */ + var root = tcuTestCase.newTest('attribute_location', 'Attribute location tests'); + + /** @type {number} */ var typeNdx; + /** @type {glsAttributeLocationTests.AttribType} */ var type; + + // Basic bind attribute tests + /** @type {tcuTestCase.DeqpTest} */ + var bindAttributeGroup = tcuTestCase.newTest('bind', 'Basic bind attribute location tests.'); + + root.addChild(bindAttributeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + bindAttributeGroup.addChild(new glsAttributeLocationTests.BindAttributeTest(type)); + } + + // Bind max number of attributes + /** @type {tcuTestCase.DeqpTest} */ + var bindMaxAttributeGroup = tcuTestCase.newTest('bind_max_attributes', 'Use bind with maximum number of attributes.'); + + root.addChild(bindMaxAttributeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + bindMaxAttributeGroup.addChild(new glsAttributeLocationTests.BindMaxAttributesTest(type)); + } + + // Test filling holes in attribute location + /** @type {tcuTestCase.DeqpTest} */ + var holeGroup = tcuTestCase.newTest('bind_hole', 'Bind all, but one attribute and leave hole in location space for it.'); + + root.addChild(holeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + + // Bind first location, leave hole size of type and fill rest of locations + holeGroup.addChild(new glsAttributeLocationTests.BindHoleAttributeTest(type)); + } + + // Test binding at different times + /** @type {tcuTestCase.DeqpTest} */ + var bindTimeGroup = tcuTestCase.newTest('bind_time', 'Bind time tests. Test binding at different stages.'); + + root.addChild(bindTimeGroup); + + bindTimeGroup.addChild(new glsAttributeLocationTests.PreAttachBindAttributeTest()); + bindTimeGroup.addChild(new glsAttributeLocationTests.PreLinkBindAttributeTest()); + bindTimeGroup.addChild(new glsAttributeLocationTests.PostLinkBindAttributeTest()); + bindTimeGroup.addChild(new glsAttributeLocationTests.BindRelinkAttributeTest()); + bindTimeGroup.addChild(new glsAttributeLocationTests.BindReattachAttributeTest()); + + // Basic layout location attribute tests + /** @type {tcuTestCase.DeqpTest} */ + var layoutAttributeGroup = tcuTestCase.newTest('layout', 'Basic layout location tests.'); + + root.addChild(layoutAttributeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + layoutAttributeGroup.addChild(new glsAttributeLocationTests.LocationAttributeTest(type)); + } + + // Test max attributes with layout locations + /** @type {tcuTestCase.DeqpTest} */ + var layoutMaxAttributeGroup = tcuTestCase.newTest('layout_max_attributes', 'Maximum attributes used with layout location qualifiers.'); + + root.addChild(layoutMaxAttributeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + layoutMaxAttributeGroup.addChild(new glsAttributeLocationTests.LocationMaxAttributesTest(type)); + } + + // Test filling holes in attribute location + holeGroup = tcuTestCase.newTest('layout_hole', 'Define layout location for all, but one attribute consuming max attribute locations.'); + + root.addChild(holeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + + // Location first location, leave hole size of type and fill rest of locations + holeGroup.addChild(new glsAttributeLocationTests.LocationHoleAttributeTest(type)); + } + + // Basic mixed mixed attribute tests + /** @type {tcuTestCase.DeqpTest} */ + var mixedAttributeGroup = tcuTestCase.newTest('mixed', 'Basic mixed location tests.'); + + root.addChild(mixedAttributeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + mixedAttributeGroup.addChild(new glsAttributeLocationTests.MixedAttributeTest(type)); + } + + /** @type {tcuTestCase.DeqpTest} */ + var mixedMaxAttributeGroup = tcuTestCase.newTest('mixed_max_attributes', 'Maximum attributes used with mixed binding and layout qualifiers.'); + + root.addChild(mixedMaxAttributeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + mixedMaxAttributeGroup.addChild(new glsAttributeLocationTests.MixedMaxAttributesTest(type)); + } + + // Test mixed binding at different times + /** @type {tcuTestCase.DeqpTest} */ + var mixedTimeGroup = tcuTestCase.newTest('mixed_time', 'Bind time tests. Test binding at different stages.'); + + root.addChild(mixedTimeGroup); + + mixedTimeGroup.addChild(new glsAttributeLocationTests.PreAttachMixedAttributeTest()); + mixedTimeGroup.addChild(new glsAttributeLocationTests.PreLinkMixedAttributeTest()); + mixedTimeGroup.addChild(new glsAttributeLocationTests.PostLinkMixedAttributeTest()); + mixedTimeGroup.addChild(new glsAttributeLocationTests.MixedRelinkAttributeTest()); + mixedTimeGroup.addChild(new glsAttributeLocationTests.MixedReattachAttributeTest()); + + holeGroup = tcuTestCase.newTest('mixed_hole', 'Use layout location qualifiers and binding. Leave hole in location space for only free attribute.'); + + root.addChild(holeGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + + holeGroup.addChild(new glsAttributeLocationTests.MixedHoleAttributeTest(type)); + } + + // Test hole in location space that moves when relinking + /** @type {tcuTestCase.DeqpTest} */ + var relinkBindHoleGroup = tcuTestCase.newTest('bind_relink_hole', 'Test relinking with moving hole in attribute location space.'); + + root.addChild(relinkBindHoleGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + + relinkBindHoleGroup.addChild(new glsAttributeLocationTests.BindRelinkHoleAttributeTest(type)); + } + + // Test hole in location space that moves when relinking + /** @type {tcuTestCase.DeqpTest} */ + var relinkMixedHoleGroup = tcuTestCase.newTest('mixed_relink_hole', 'Test relinking with moving hole in attribute location space.'); + + root.addChild(relinkMixedHoleGroup); + + for (typeNdx = 0; typeNdx < types.length; typeNdx++) { + type = types[typeNdx]; + + relinkMixedHoleGroup.addChild(new glsAttributeLocationTests.MixedRelinkHoleAttributeTest(type)); + } + + return root; + }; + + es3fAttribLocationTests.run = function(context) { + gl = context; + //Set up root Test + var state = tcuTestCase.runner; + + var test = es3fAttribLocationTests.createAttributeLocationTests(); + var testName = test.fullName(); + var testDescription = test.getDescription() === undefined ? '' : test.getDescription(); + + state.testName = testName; + state.setRoot(test); + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + test.init(); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + bufferedLogToConsole('Exception: ' + err); + testFailedOptions('Failed to es3fAttribLocationTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js new file mode 100644 index 000000000..173dea094 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js @@ -0,0 +1,372 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fBooleanStateQuery'); +goog.require('framework.common.tcuTestCase'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { +var es3fBooleanStateQuery = functional.gles3.es3fBooleanStateQuery; +var tcuTestCase = framework.common.tcuTestCase; +var glsStateQuery = modules.shared.glsStateQuery; +var es3fApiCase = functional.gles3.es3fApiCase; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {boolean} value + */ +es3fBooleanStateQuery.IsEnabledStateTestCase = function(name, description, targetName, value) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_targetName = targetName; + this.m_initial = value; +}; + +setParentClass(es3fBooleanStateQuery.IsEnabledStateTestCase, es3fApiCase.ApiCase); + +es3fBooleanStateQuery.IsEnabledStateTestCase.prototype.test = function() { + // check inital value + this.m_pass &= glsStateQuery.verify(this.m_targetName, this.m_initial); + + // check toggle + + gl.enable(this.m_targetName); + + this.m_pass &= glsStateQuery.verify(this.m_targetName, true); + + gl.disable(this.m_targetName); + + this.m_pass &= glsStateQuery.verify(this.m_targetName, false); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fBooleanStateQuery.DepthWriteMaskTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fBooleanStateQuery.DepthWriteMaskTestCase, es3fApiCase.ApiCase); + +es3fBooleanStateQuery.DepthWriteMaskTestCase.prototype.test = function() { + this.m_pass &= glsStateQuery.verify(gl.DEPTH_WRITEMASK, true); + + gl.depthMask(false); + this.m_pass &= glsStateQuery.verify(gl.DEPTH_WRITEMASK, false); + + gl.depthMask(true); + this.m_pass &= glsStateQuery.verify(gl.DEPTH_WRITEMASK, true); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fBooleanStateQuery.SampleCoverageInvertTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fBooleanStateQuery.SampleCoverageInvertTestCase, es3fApiCase.ApiCase); + +es3fBooleanStateQuery.SampleCoverageInvertTestCase.prototype.test = function() { + this.m_pass &= glsStateQuery.verify(gl.SAMPLE_COVERAGE_INVERT, false); + + gl.sampleCoverage(1, true); + this.m_pass &= glsStateQuery.verify(gl.SAMPLE_COVERAGE_INVERT, true); + + gl.sampleCoverage(1, false); + this.m_pass &= glsStateQuery.verify(gl.SAMPLE_COVERAGE_INVERT, false); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {boolean} value + */ +es3fBooleanStateQuery.InitialBooleanTestCase = function(name, description, targetName, value) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_targetName = targetName; + this.m_initial = value; +}; + +setParentClass(es3fBooleanStateQuery.InitialBooleanTestCase, es3fApiCase.ApiCase); + +es3fBooleanStateQuery.InitialBooleanTestCase.prototype.test = function() { + // check inital value + this.m_pass &= glsStateQuery.verify(this.m_targetName, this.m_initial); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fBooleanStateQuery.ColorMaskTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fBooleanStateQuery.ColorMaskTestCase, es3fApiCase.ApiCase); + +es3fBooleanStateQuery.ColorMaskTestCase.prototype.test = function() { + this.m_pass &= glsStateQuery.verify(gl.COLOR_WRITEMASK, [true, true, true, true]); + + var testMasks = [ + [true, true, true, true], + [true, true, true, false], + [true, true, false, true], + [true, true, false, false], + [true, false, true, true], + [true, false, true, false], + [true, false, false, true], + [true, false, false, false], + [false, true, true, true], + [false, true, true, false], + [false, true, false, true], + [false, true, false, false], + [false, false, true, true], + [false, false, true, false], + [false, false, false, true], + [false, false, false, false] + ]; + + for (var ndx = 0; ndx < testMasks.length; ndx++) { + var mask = testMasks[ndx]; + gl.colorMask(mask[0], mask[1], mask[2], mask[3]); + this.m_pass &= glsStateQuery.verify(gl.COLOR_WRITEMASK, mask); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fBooleanStateQuery.TransformFeedbackTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {WebGLTransformFeedback} */ this.m_transformfeedback = null; +}; + +setParentClass(es3fBooleanStateQuery.TransformFeedbackTestCase, es3fApiCase.ApiCase); + +es3fBooleanStateQuery.TransformFeedbackTestCase.prototype.testTransformFeedback = function() { + throw new Error('Virtual function.'); +}; + +es3fBooleanStateQuery.TransformFeedbackTestCase.prototype.test = function() { + var transformFeedbackTestVertSource = '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + var transformFeedbackTestFragSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + this.m_transformfeedback = gl.createTransformFeedback(); + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(shaderVert, transformFeedbackTestVertSource); + gl.compileShader(shaderVert); + this.m_pass &= glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true); + + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(shaderFrag, transformFeedbackTestFragSource); + gl.compileShader(shaderFrag); + this.m_pass &= glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true); + + var shaderProg = gl.createProgram(); + gl.attachShader(shaderProg, shaderVert); + gl.attachShader(shaderProg, shaderFrag); + var transform_feedback_outputs = ['gl_Position']; + gl.transformFeedbackVaryings(shaderProg, transform_feedback_outputs, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(shaderProg); + this.m_pass &= glsStateQuery.verifyProgram(shaderProg, gl.LINK_STATUS, true); + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, this.m_transformfeedback); + + var buffer = gl.createBuffer(); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buffer); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 16, gl.DYNAMIC_READ); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buffer); + + gl.useProgram(shaderProg); + + this.testTransformFeedback(); + + gl.useProgram(null); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + gl.deleteTransformFeedback(this.m_transformfeedback); + gl.deleteBuffer(buffer); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(shaderProg); +}; + +/** + * @constructor + * @extends {es3fBooleanStateQuery.TransformFeedbackTestCase} + * @param {string} name + */ +es3fBooleanStateQuery.TransformFeedbackBasicTestCase = function(name) { + es3fBooleanStateQuery.TransformFeedbackTestCase.call(this, name, 'Test TRANSFORM_FEEDBACK_ACTIVE and TRANSFORM_FEEDBACK_PAUSED'); +}; + +setParentClass(es3fBooleanStateQuery.TransformFeedbackBasicTestCase, es3fBooleanStateQuery.TransformFeedbackTestCase); + +es3fBooleanStateQuery.TransformFeedbackBasicTestCase.prototype.testTransformFeedback = function() { + gl.beginTransformFeedback(gl.POINTS); + + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true); + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false); + + gl.pauseTransformFeedback(); + + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true); + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, true); + + gl.resumeTransformFeedback(); + + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true); + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false); + + gl.endTransformFeedback(); + + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, false); + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false); +}; + +/** + * @constructor + * @extends {es3fBooleanStateQuery.TransformFeedbackTestCase} + * @param {string} name + */ +es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase = function(name) { + es3fBooleanStateQuery.TransformFeedbackTestCase.call(this, name, 'EndTransformFeedback performs an implicit ResumeTransformFeedback.'); +}; + +setParentClass(es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase, es3fBooleanStateQuery.TransformFeedbackTestCase); + +es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase.prototype.testTransformFeedback = function() { + gl.beginTransformFeedback(gl.POINTS); + + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true); + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false); + + gl.pauseTransformFeedback(); + + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true); + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, true); + + gl.endTransformFeedback(); + + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, false); + this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false); +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fBooleanStateQuery.BooleanStateQuery = function() { + tcuTestCase.DeqpTest.call(this, 'boolean', 'Boolean State Query tests'); +}; + +es3fBooleanStateQuery.BooleanStateQuery.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fBooleanStateQuery.BooleanStateQuery.prototype.constructor = es3fBooleanStateQuery.BooleanStateQuery; + +es3fBooleanStateQuery.BooleanStateQuery.prototype.init = function() { + var testRoot = this; + var isEnableds = [ + ['rasterizer_discard', 'RASTERIZER_DISCARD', gl.RASTERIZER_DISCARD, false], + ['cull_face', 'CULL_FACE', gl.CULL_FACE, false], + ['polygon_offset_fill', 'POLYGON_OFFSET_FILL', gl.POLYGON_OFFSET_FILL, false], + ['sample_alpha_to_coverage', 'SAMPLE_ALPHA_TO_COVERAGE', gl.SAMPLE_ALPHA_TO_COVERAGE, false], + ['sample_coverage', 'SAMPLE_COVERAGE', gl.SAMPLE_COVERAGE, false], + ['scissor_test', 'SCISSOR_TEST', gl.SCISSOR_TEST, false], + ['stencil_test', 'STENCIL_TEST', gl.STENCIL_TEST, false], + ['depth_test', 'DEPTH_TEST', gl.DEPTH_TEST, false], + ['blend', 'BLEND', gl.BLEND, false], + ['dither', 'DITHER', gl.DITHER, true] + ]; + isEnableds.forEach(function(elem) { + var name = elem[0]; + var description = elem[1]; + var targetName = elem[2]; + var value = elem[3]; + testRoot.addChild(new es3fBooleanStateQuery.IsEnabledStateTestCase(name, description, targetName, value)); + }); + + testRoot.addChild(new es3fBooleanStateQuery.ColorMaskTestCase('color_writemask', 'COLOR_WRITEMASK')); + testRoot.addChild(new es3fBooleanStateQuery.DepthWriteMaskTestCase('depth_writemask', 'DEPTH_WRITEMASK')); + testRoot.addChild(new es3fBooleanStateQuery.SampleCoverageInvertTestCase('sample_coverage_invert', 'SAMPLE_COVERAGE_INVERT')); + testRoot.addChild(new es3fBooleanStateQuery.InitialBooleanTestCase('transform_feedback_active_initial', 'initial TRANSFORM_FEEDBACK_ACTIVE', gl.TRANSFORM_FEEDBACK_ACTIVE, false)); + testRoot.addChild(new es3fBooleanStateQuery.InitialBooleanTestCase('transform_feedback_paused_initial', 'initial TRANSFORM_FEEDBACK_PAUSED', gl.TRANSFORM_FEEDBACK_PAUSED, false)); + testRoot.addChild(new es3fBooleanStateQuery.TransformFeedbackBasicTestCase('transform_feedback')); + testRoot.addChild(new es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase('transform_feedback_implicit_resume')); +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fBooleanStateQuery.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fBooleanStateQuery.BooleanStateQuery()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fBooleanStateQuery.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js new file mode 100644 index 000000000..51186231a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js @@ -0,0 +1,355 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fBufferCopyTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('modules.shared.glsBufferTestUtil'); + +goog.scope(function() { + + var es3fBufferCopyTests = functional.gles3.es3fBufferCopyTests; + var glsBufferTestUtil = modules.shared.glsBufferTestUtil; + var tcuTestCase = framework.common.tcuTestCase; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + + /** @type {WebGL2RenderingContext} */ var gl; + + /** + * @constructor + * @extends {glsBufferTestUtil.BufferCase} + * @param {string} name + * @param {string} desc + * @param {number} srcTarget + * @param {number} srcSize + * @param {number} srcHint + * @param {number} dstTarget + * @param {number} dstSize + * @param {number} dstHint + * @param {number} copySrcOffset + * @param {number} copyDstOffset + * @param {number} copySize + * @param {glsBufferTestUtil.VerifyType} verifyType + */ + es3fBufferCopyTests.BasicBufferCopyCase = function(name, desc, srcTarget, srcSize, srcHint, dstTarget, dstSize, dstHint, copySrcOffset, copyDstOffset, copySize, verifyType) { + glsBufferTestUtil.BufferCase.call(this, name, desc); + + this.m_srcTarget = srcTarget; + this.m_srcSize = srcSize; + this.m_srcHint = srcHint; + this.m_dstTarget = dstTarget; + this.m_dstSize = dstSize; + this.m_dstHint = dstHint; + this.m_copySrcOffset = copySrcOffset; + this.m_copyDstOffset = copyDstOffset; + this.m_copySize = copySize; + this.m_verifyType = verifyType; + + assertMsgOptions(deMath.deInBounds32(this.m_copySrcOffset, 0, this.m_srcSize) && deMath.deInRange32(this.m_copySrcOffset + this.m_copySize, this.m_copySrcOffset, this.m_srcSize), 'Copy parameters are out of buffer\'s range', false, true); + assertMsgOptions(deMath.deInBounds32(this.m_copyDstOffset, 0, this.m_dstSize) && deMath.deInRange32(this.m_copyDstOffset + this.m_copySize, this.m_copyDstOffset, this.m_dstSize), 'Copy parameters are out of buffer\'s range', false, true); + }; + + es3fBufferCopyTests.BasicBufferCopyCase.prototype = Object.create(glsBufferTestUtil.BufferCase.prototype); + es3fBufferCopyTests.BasicBufferCopyCase.prototype.constructor = es3fBufferCopyTests.BasicBufferCopyCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fBufferCopyTests.BasicBufferCopyCase.prototype.iterate = function() { + /** @type {glsBufferTestUtil.BufferVerifier} */ var verifier = new glsBufferTestUtil.BufferVerifier(this.m_verifyType); + var srcRef = new glsBufferTestUtil.ReferenceBuffer(); + var dstRef = new glsBufferTestUtil.ReferenceBuffer(); + var srcBuf = 0; + var dstBuf = 0; + var srcSeed = deMath.binaryOp(deString.deStringHash(this.fullName()), 0xabcd, deMath.BinaryOp.XOR); + var dstSeed = deMath.binaryOp(deString.deStringHash(this.fullName()), 0xef01, deMath.BinaryOp.XOR); + var isOk = true; + + srcRef.setSize(this.m_srcSize); + glsBufferTestUtil.fillWithRandomBytes(srcRef.getPtr(), this.m_srcSize, srcSeed); + + dstRef.setSize(this.m_dstSize); + glsBufferTestUtil.fillWithRandomBytes(dstRef.getPtr(), this.m_dstSize, dstSeed); + + // Create source buffer and fill with data. + srcBuf = this.genBuffer(); + gl.bindBuffer(this.m_srcTarget, srcBuf); + gl.bufferData(this.m_srcTarget, srcRef.getPtr(), this.m_srcHint); + + // Create destination buffer and fill with data. + dstBuf = this.genBuffer(); + gl.bindBuffer(this.m_dstTarget, dstBuf); + gl.bufferData(this.m_dstTarget, dstRef.getPtr(), this.m_dstHint); + + // Verify both buffers before executing copy. + isOk = verifier.verify(srcBuf, srcRef.getPtr(), 0, this.m_srcSize, this.m_srcTarget) && isOk; + isOk = verifier.verify(dstBuf, dstRef.getPtr(), 0, this.m_dstSize, this.m_dstTarget) && isOk; + + // Execute copy. + dstRef.getPtr().set(srcRef.getPtr().subarray(this.m_copySrcOffset, this.m_copySrcOffset + this.m_copySize), this.m_copyDstOffset); + + gl.bindBuffer(this.m_srcTarget, srcBuf); + gl.bindBuffer(this.m_dstTarget, dstBuf); + gl.copyBufferSubData(this.m_srcTarget, this.m_dstTarget, this.m_copySrcOffset, this.m_copyDstOffset, this.m_copySize); + + // Verify both buffers after copy. + isOk = verifier.verify(srcBuf, srcRef.getPtr(), 0, this.m_srcSize, this.m_srcTarget) && isOk; + isOk = verifier.verify(dstBuf, dstRef.getPtr(), 0, this.m_dstSize, this.m_dstTarget) && isOk; + + if (isOk) + testPassed(''); + else + testFailed('Buffer verification failed'); + + return tcuTestCase.IterateResult.STOP; + }; + + // Case B: same buffer, take range as parameter + + /** + * @constructor + * @extends {glsBufferTestUtil.BufferCase} + * @param {string} name + * @param {string} desc + * @param {number} srcTarget + * @param {number} dstTarget + * @param {number} hint + * @param {glsBufferTestUtil.VerifyType} verifyType + */ + es3fBufferCopyTests.SingleBufferCopyCase = function(name, desc, srcTarget, dstTarget, hint, verifyType) { + glsBufferTestUtil.BufferCase.call(this, name, desc); + this.m_srcTarget = srcTarget; + this.m_dstTarget = dstTarget; + this.m_hint = hint; + this.m_verifyType = verifyType; + }; + + es3fBufferCopyTests.SingleBufferCopyCase.prototype = Object.create(glsBufferTestUtil.BufferCase.prototype); + es3fBufferCopyTests.SingleBufferCopyCase.prototype.constructor = es3fBufferCopyTests.SingleBufferCopyCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fBufferCopyTests.SingleBufferCopyCase.prototype.iterate = function() { + var size = 1000; + /** @type {glsBufferTestUtil.BufferVerifier} */ var verifier = new glsBufferTestUtil.BufferVerifier(this.m_verifyType); + var ref = new glsBufferTestUtil.ReferenceBuffer(); + var baseSeed = deString.deStringHash(this.fullName()); + var isOk = true; + + ref.setSize(size); + + // Create buffer. + var buf = this.genBuffer(); + gl.bindBuffer(this.m_srcTarget, buf); + + /** @type {Array<{srcOffset: number, dstOffset: number, copySize: number}>} */ + var copyRanges = [{ + srcOffset: 57, dstOffset: 701, copySize: 101 // Non-adjecent, from low to high. + },{ + srcOffset: 640, dstOffset: 101, copySize: 101 // Non-adjecent, from high to low. + },{ + srcOffset: 0, dstOffset: 500, copySize: 500 // Lower half to upper half. + },{ + srcOffset: 500, dstOffset: 0, copySize: 500 // Upper half to lower half. + }]; + + for (var ndx = 0; ndx < copyRanges.length && isOk; ndx++) { + var srcOffset = copyRanges[ndx].srcOffset; + var dstOffset = copyRanges[ndx].dstOffset; + var copySize = copyRanges[ndx].copySize; + + glsBufferTestUtil.fillWithRandomBytes(ref.getPtr(), size, deMath.binaryOp(baseSeed, deMath.deMathHash(ndx), deMath.BinaryOp.XOR)); + + // Fill with data. + gl.bindBuffer(this.m_srcTarget, buf); + gl.bufferData(this.m_srcTarget, ref.getPtr(), this.m_hint); + + // Execute copy. + ref.getPtr().set(ref.getPtr().subarray(srcOffset, srcOffset + copySize), dstOffset); + + gl.bindBuffer(this.m_dstTarget, buf); + gl.copyBufferSubData(this.m_srcTarget, this.m_dstTarget, srcOffset, dstOffset, copySize); + + // Verify buffer after copy. + isOk = verifier.verify(buf, ref.getPtr(), 0, size, this.m_dstTarget) && isOk; + } + + if (isOk) + testPassed(''); + else + testFailed('Buffer verification failed'); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fBufferCopyTests.BufferCopyTests = function() { + tcuTestCase.DeqpTest.call(this, 'copy', 'Buffer copy tests'); + this.makeExecutable(); + }; + + es3fBufferCopyTests.BufferCopyTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fBufferCopyTests.BufferCopyTests.prototype.constructor = es3fBufferCopyTests.BufferCopyTests; + + es3fBufferCopyTests.BufferCopyTests.prototype.init = function() { + /** @type {glsBufferTestUtil.VerifyType} */ var verify; + + var bufferTargets = [ + gl.ARRAY_BUFFER, + gl.COPY_READ_BUFFER, + gl.COPY_WRITE_BUFFER, + gl.ELEMENT_ARRAY_BUFFER, + gl.PIXEL_PACK_BUFFER, + gl.PIXEL_UNPACK_BUFFER, + gl.TRANSFORM_FEEDBACK_BUFFER, + gl.UNIFORM_BUFFER + ]; + + // .basic + + var basicGroup = new tcuTestCase.DeqpTest('basic', 'Basic buffer copy cases'); + this.addChild(basicGroup); + + for (var srcTargetNdx = 0; srcTargetNdx < bufferTargets.length; srcTargetNdx++) { + for (var dstTargetNdx = 0; dstTargetNdx < bufferTargets.length; dstTargetNdx++) { + if (srcTargetNdx == dstTargetNdx) + continue; + + // In WebGL 2, a copy between an ELEMENT_ARRAY_BUFFER and other data buffer + // (not COPY_WRITE_BUFFER nor COPY_READ_BUFFER nor ELEMENT_ARRAY_BUFFER) + // cannot be made, so let's skip those cases. + if (bufferTargets[srcTargetNdx] == gl.ELEMENT_ARRAY_BUFFER || + bufferTargets[dstTargetNdx] == gl.ELEMENT_ARRAY_BUFFER) + continue; + + var srcTarget = bufferTargets[srcTargetNdx]; + var dstTarget = bufferTargets[dstTargetNdx]; + var size = 1017; + var hint = gl.STATIC_DRAW; + verify = glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY; + var name = glsBufferTestUtil.getBufferTargetName(srcTarget) + '_' + glsBufferTestUtil.getBufferTargetName(dstTarget); + + basicGroup.addChild(new es3fBufferCopyTests.BasicBufferCopyCase(name, '', srcTarget, size, hint, dstTarget, size, hint, 0, 0, size, verify)); + } + } + + // .subrange + + var subrangeGroup = new tcuTestCase.DeqpTest('subrange', 'Buffer subrange copy tests'); + this.addChild(subrangeGroup); + + /** + * @type {Array<{name: string, srcSize: number, dstSize: number, srcOffset: number, dstOffset: number, copySize: number}>} + */ + var cases = [{ + name: 'middle', srcSize: 1000, dstSize: 1000, srcOffset: 250, dstOffset: 250, copySize: 500 + },{ + name: 'small_to_large', srcSize: 100, dstSize: 1000, srcOffset: 0, dstOffset: 409, copySize: 100 + },{ + name: 'large_to_small', srcSize: 1000, dstSize: 100, srcOffset: 409, dstOffset: 0, copySize: 100 + },{ + name: 'low_to_high_1', srcSize: 1000, dstSize: 1000, srcOffset: 0, dstOffset: 500, copySize: 500 + },{ + name: 'low_to_high_2', srcSize: 997, dstSize: 1027, srcOffset: 0, dstOffset: 701, copySize: 111 + },{ + name: 'high_to_low_1', srcSize: 1000, dstSize: 1000, srcOffset: 500, dstOffset: 0, copySize: 500 + },{ + name: 'high_to_low_2', srcSize: 1027, dstSize: 997, srcOffset: 701, dstOffset: 17, copySize: 111 + }]; + + for (var ndx = 0; ndx < cases.length; ndx++) { + var srcTarget = gl.COPY_READ_BUFFER; + var dstTarget = gl.COPY_WRITE_BUFFER; + var hint = gl.STATIC_DRAW; + verify = glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY; + + subrangeGroup.addChild( + new es3fBufferCopyTests.BasicBufferCopyCase( + cases[ndx].name, '', + srcTarget, cases[ndx].srcSize, hint, + dstTarget, cases[ndx].dstSize, hint, + cases[ndx].srcOffset, cases[ndx].dstOffset, cases[ndx].copySize, + verify + ) + ); + } + + // .single_buffer + + var singleBufGroup = new tcuTestCase.DeqpTest('single_buffer', 'Copies within single buffer'); + this.addChild(singleBufGroup); + + for (var srcTargetNdx = 0; srcTargetNdx < bufferTargets.length; srcTargetNdx++) { + for (var dstTargetNdx = 0; dstTargetNdx < bufferTargets.length; dstTargetNdx++) { + if (srcTargetNdx == dstTargetNdx) + continue; + + // In WebGL 2, we can't rebind an ELEMENT_ARRAY_BUFFER or TRANSFORM_FEEDBACK_BUFFER as a + // different type of buffer, so we skip those cases. + if (bufferTargets[srcTargetNdx] == gl.ELEMENT_ARRAY_BUFFER || bufferTargets[srcTargetNdx] == gl.TRANSFORM_FEEDBACK_BUFFER || + bufferTargets[dstTargetNdx] == gl.ELEMENT_ARRAY_BUFFER || bufferTargets[dstTargetNdx] == gl.TRANSFORM_FEEDBACK_BUFFER) + continue; + + var srcTarget = bufferTargets[srcTargetNdx]; + var dstTarget = bufferTargets[dstTargetNdx]; + var hint = gl.STATIC_DRAW; + verify = glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY; + var name = glsBufferTestUtil.getBufferTargetName(srcTarget) + '_' + glsBufferTestUtil.getBufferTargetName(dstTarget); + + singleBufGroup.addChild(new es3fBufferCopyTests.SingleBufferCopyCase(name, '', srcTarget, dstTarget, hint, verify)); + } + } + }; + + /** + * Create and execute the test cases + * @param {WebGL2RenderingContext} context + */ + es3fBufferCopyTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + + state.setRoot(new es3fBufferCopyTests.BufferCopyTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js new file mode 100644 index 000000000..a4384d3ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js @@ -0,0 +1,177 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fBufferObjectQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('functional.gles3.es3fApiCase'); + +goog.scope(function() { +var es3fBufferObjectQueryTests = functional.gles3.es3fBufferObjectQueryTests; +var tcuTestCase = framework.common.tcuTestCase; +var es3fApiCase = functional.gles3.es3fApiCase; +var deRandom = framework.delibs.debase.deRandom; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fBufferObjectQueryTests.BufferCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fBufferObjectQueryTests.BufferCase, es3fApiCase.ApiCase); + +es3fBufferObjectQueryTests.BufferCase.prototype.test = function() { + var bufferTargets = [ + gl.ARRAY_BUFFER, gl.COPY_READ_BUFFER, + gl.TRANSFORM_FEEDBACK_BUFFER, gl.UNIFORM_BUFFER, + + gl.COPY_WRITE_BUFFER, gl.ELEMENT_ARRAY_BUFFER, + gl.PIXEL_PACK_BUFFER, gl.PIXEL_UNPACK_BUFFER + ]; + + // most test need only to be run with a subset of targets + var targets = this.m_testAllTargets ? bufferTargets.length : 4; + + for (var ndx = 0; ndx < targets; ++ndx) { + this.m_bufferTarget = bufferTargets[ndx]; + + var bufferId = gl.createBuffer(); + gl.bindBuffer(this.m_bufferTarget, bufferId); + + this.testBuffer(); + + gl.bindBuffer(this.m_bufferTarget, null); + gl.deleteBuffer(bufferId); + } +}; + +/** + * @constructor + * @extends {es3fBufferObjectQueryTests.BufferCase} + * @param {string} name + * @param {string} description + */ +es3fBufferObjectQueryTests.BufferSizeCase = function(name, description) { + es3fBufferObjectQueryTests.BufferCase.call(this, name, description); + this.m_testAllTargets = true; +}; + +setParentClass(es3fBufferObjectQueryTests.BufferSizeCase, es3fBufferObjectQueryTests.BufferCase); + +es3fBufferObjectQueryTests.BufferSizeCase.prototype.testBuffer = function() { + var rnd = new deRandom.Random(0xabcdef); + + var size = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_SIZE)); + this.check(size == 0, 'Initial size should be 0; got ' + size); + + var numIterations = 16; + for (var i = 0; i < numIterations; ++i) { + var len = rnd.getInt(0, 1024); + gl.bufferData(this.m_bufferTarget, len, gl.STREAM_DRAW); + + size = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_SIZE)); + this.check(size == len, 'Buffer size should be ' + len + ' ; got ' + size); + } +}; + +/** + * @constructor + * @extends {es3fBufferObjectQueryTests.BufferCase} + * @param {string} name + * @param {string} description + */ +es3fBufferObjectQueryTests.BufferUsageCase = function(name, description) { + es3fBufferObjectQueryTests.BufferCase.call(this, name, description); + this.m_testAllTargets = false; +}; + +setParentClass(es3fBufferObjectQueryTests.BufferUsageCase, es3fBufferObjectQueryTests.BufferCase); + +es3fBufferObjectQueryTests.BufferUsageCase.prototype.testBuffer = function() { + var usage = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_USAGE)); + this.check(usage == gl.STATIC_DRAW, 'Initial usage should be STATIC_DRAW; got ' + wtu.glEnumToString(gl, usage)); + + var usages = [ + gl.STREAM_DRAW, gl.STREAM_READ, + gl.STREAM_COPY, gl.STATIC_DRAW, + gl.STATIC_READ, gl.STATIC_COPY, + gl.DYNAMIC_DRAW, gl.DYNAMIC_READ, + gl.DYNAMIC_COPY + ]; + + for (var ndx = 0; ndx < usages.length; ++ndx) { + gl.bufferData(this.m_bufferTarget, 16, usages[ndx]); + + usage = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_USAGE)); + this.check(usage == usages[ndx], 'Buffer usage should be ' + wtu.glEnumToString(gl, usages[ndx]) + ' ; got ' + wtu.glEnumToString(gl, usage)); + } +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fBufferObjectQueryTests.BufferObjectQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'buffer_object', 'Buffer Object Query tests'); +}; + +es3fBufferObjectQueryTests.BufferObjectQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fBufferObjectQueryTests.BufferObjectQueryTests.prototype.constructor = es3fBufferObjectQueryTests.BufferObjectQueryTests; + +es3fBufferObjectQueryTests.BufferObjectQueryTests.prototype.init = function() { + this.addChild(new es3fBufferObjectQueryTests.BufferSizeCase('buffer_size' , 'BUFFER_SIZE')); + this.addChild(new es3fBufferObjectQueryTests.BufferUsageCase('buffer_usage' , 'BUFFER_USAGE')); +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fBufferObjectQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fBufferObjectQueryTests.BufferObjectQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fBufferObjectQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js new file mode 100644 index 000000000..d5786180b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js @@ -0,0 +1,87 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES 3.0 Module + * ------------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Tests for precision and range of GLSL builtins and types. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('functional.gles3.es3fBuiltinPrecisionTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('modules.shared.glsBuiltinPrecisionTests'); + +goog.scope(function() { + + var es3fBuiltinPrecisionTests = functional.gles3.es3fBuiltinPrecisionTests; + var glsBuiltinPrecisionTests = modules.shared.glsBuiltinPrecisionTests; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + + /** + * @param {*} context + * @param {number} caseId test case Id + * @return {tcuTestCase.DeqpTest} + */ + es3fBuiltinPrecisionTests.createBuiltinPrecisionTests = function(context, caseId) { + /** @type {tcuTestCase.DeqpTest} */ + var group = tcuTestCase.newTest('precision', 'Builtin precision tests'); + + /** @type {Array} */ var shaderTypes = []; + var es3Cases = glsBuiltinPrecisionTests.createES3BuiltinCases(caseId); + + shaderTypes.push(gluShaderProgram.shaderType.VERTEX); + shaderTypes.push(gluShaderProgram.shaderType.FRAGMENT); + + glsBuiltinPrecisionTests.addBuiltinPrecisionTests(es3Cases, shaderTypes, group); + return group; + }; + + /** + * Create and execute the test cases + * @param {WebGL2RenderingContext} context + * @param {number} caseId test case Id + */ + es3fBuiltinPrecisionTests.run = function(context, caseId) { + gl = context; + // Set up root Test + var state = tcuTestCase.runner; + + var test = es3fBuiltinPrecisionTests.createBuiltinPrecisionTests(context, caseId); + var testName = test.fullName(); + var testDescription = test.getDescription() === undefined ? '' : test.getDescription(); + + state.testName = testName; + state.setRoot(test); + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + test.init(); + //Run test cases + tcuTestCase.runTestCases(); + } catch (err) { + bufferedLogToConsole('Exception: ' + err); + testFailedOptions('Failed to es3fAttribLocationTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js new file mode 100644 index 000000000..e261cdea6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js @@ -0,0 +1,406 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fClippingTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('functional.gles3.es3fFboTestCase'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { +var es3fClippingTests = functional.gles3.es3fClippingTests; +var tcuImageCompare = framework.common.tcuImageCompare; +var tcuTestCase = framework.common.tcuTestCase; +var es3fFboTestCase = functional.gles3.es3fFboTestCase; +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var rrUtil = framework.referencerenderer.rrUtil; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var deRandom = framework.delibs.debase.deRandom; +var deMath = framework.delibs.debase.deMath; +var tcuRGBA = framework.common.tcuRGBA; + +/** @type {WebGL2RenderingContext} */ var gl; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {Array} viewport + * @param {Array} rangeX + * @param {Array} rangeY + * @param {Array} rangeZ + */ +es3fClippingTests.TriangleCase = function(name, desc, viewport, rangeX, rangeY, rangeZ) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_viewport = viewport; + this.m_rangeX = rangeX; + this.m_rangeY = rangeY; + this.m_rangeZ = rangeZ; +}; + +setParentClass(es3fClippingTests.TriangleCase, es3fFboTestCase.FboTestCase); + +es3fClippingTests.TriangleCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var x = this.m_viewport[0]; + var y = this.m_viewport[1]; + var width = this.m_viewport[2]; + var height = this.m_viewport[3]; + ctx.viewport(x, y, width, height); + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT); + + var shader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + var program = ctx.createProgram(shader); + shader.setGradient(ctx, program, [0, 0, 0, 0], [1, 1, 1, 1]); + + rrUtil.drawQuad(ctx, program, + [this.m_rangeX[0], this.m_rangeY[0], this.m_rangeZ[0]], + [this.m_rangeX[1], this.m_rangeY[1], this.m_rangeZ[1]]); + dst.readViewport(ctx, this.m_viewport); +}; + +/** + * Move the vertex coordinate to pixel center + */ +var center = function(x, width) { + var half = width / 2; + var pos = half + x * half; + // almost to the center to avoid problems when rounding + // the position the pixel edge + pos = Math.round(pos) + 0.49; + return (pos - half) / half; +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {Array} viewport + * @param {number} lineWidth + */ +es3fClippingTests.LinesCase = function(name, desc, viewport, lineWidth) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_viewport = viewport; + this.m_lineWidth = lineWidth; +}; + +setParentClass(es3fClippingTests.LinesCase, es3fFboTestCase.FboTestCase); + +es3fClippingTests.LinesCase.prototype.compare = function(reference, result) { + return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', + reference.getAccess(), + result.getAccess(), + tcuRGBA.newRGBAComponents(3, 3, 3, 3)); +}; + +es3fClippingTests.LinesCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var x = this.m_viewport[0]; + var y = this.m_viewport[1]; + var width = this.m_viewport[2]; + var height = this.m_viewport[3]; + ctx.viewport(x, y, width, height); + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT); + + var shader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + var program = ctx.createProgram(shader); + shader.setGradient(ctx, program, [0, 0, 0, 0], [1, 1, 1, 1]); + + // positions + var posLoc = ctx.getAttribLocation(program, 'a_position'); + if (posLoc == -1) + throw new Error('a_position attribute is not defined.'); + + var buffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, buffer); + + ctx.lineWidth(this.m_lineWidth); + + var y1 = center(-0.5, height); + var y2 = center(-0.2, height); + var y3 = center(0.2, height); + var y4 = center(0.5, height); + var y5 = center(0, height); + var x1 = center(-0.5, width); + var x2 = center(-0.2, width); + var x3 = center(0.2, width); + var x4 = center(0.5, width); + var positions = [ + // horizontal check + // both ends outside viewport + -1 - 1 / width, y1, 0, 1, + 1 + 1 / width, y1, 0, 1, + // one end inside viewport + -1 + 1 / width, y2, 0, 1, + 1 + 1 / width, y2, 0, 1, + + -1 - 1 / width, y3, 0, 1, + 1 - 1 / width, y3, 0, 1, + // both ends inside viewport + + -1 + 1 / width, y4, 0, 1, + 1 - 1 / width, y4, 0, 1, + + //vertical check + // both ends outside viewport + x1, -1 - 1 / height, 0, 1, + x1, 1 + 1 / height, 0, 1, + + // one end inside viewport + x2, -1 + 1 / height, 0, 1, + x2, 1 + 1 / height, 0, 1, + + x3, -1 - 1 / height, 0, 1, + x3, 1 - 1 / height, 0, 1, + //both ends inside viewport + x4, -1 + 1 / height, 0, 1, + x4, 1 - 1 / height, 0, 1, + + //depth check + -1, y5, -1.5, 1, + 1, y5, 1.1, 1 + ]; + var numVertices = positions.length / 4; + + ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); + + ctx.enableVertexAttribArray(posLoc); + ctx.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0); + + //colors + var coordLoc = ctx.getAttribLocation(program, 'a_coord'); + if (coordLoc == -1) + throw new Error('a_coord attribute is not defined.'); + + var buffer2 = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, buffer2); + + var coords = []; + for (var i = 0; i < numVertices / 2; i++) { + coords.push(0, 0, 1, 1); + } + ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(coords), gl.STATIC_DRAW); + + ctx.enableVertexAttribArray(coordLoc); + ctx.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0); + + ctx.drawArrays(gl.LINES, 0, numVertices); + ctx.disableVertexAttribArray(posLoc); + ctx.disableVertexAttribArray(coordLoc); + ctx.bindBuffer(gl.ARRAY_BUFFER, null); + ctx.deleteBuffer(buffer); + ctx.deleteBuffer(buffer2); + dst.readViewport(ctx, this.m_viewport); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {Array} viewport + * @param {number} pointSize + */ +es3fClippingTests.PointsCase = function(name, desc, viewport, pointSize) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_viewport = viewport; + this.m_pointSize = pointSize; +}; + +setParentClass(es3fClippingTests.PointsCase, es3fFboTestCase.FboTestCase); + +es3fClippingTests.PointsCase.prototype.compare = function(reference, result) { + return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', + reference.getAccess(), + result.getAccess(), + tcuRGBA.newRGBAComponents(3, 3, 3, 3)); +}; + +es3fClippingTests.PointsCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var x = this.m_viewport[0]; + var y = this.m_viewport[1]; + var width = this.m_viewport[2]; + var height = this.m_viewport[3]; + ctx.viewport(x, y, width, height); + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT); + + var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4, this.m_pointSize); + var program = ctx.createProgram(shader); + shader.setColor(ctx, program, [0, 1, 0, 1]); + + // positions + var posLoc = ctx.getAttribLocation(program, 'a_position'); + if (posLoc == -1) + throw new Error('a_position attribute is not defined.'); + + var buffer = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, buffer); + + var positions = [ + // clipping in X axis + -1 - 1 / width, -0.5, 0, 1, + -1, 0, 0, 1, + -1 + 1 / width, 0.5, 0, 1, + 1 + 1 / width, -0.5, 0, 1, + 1, 0, 0, 1, + 1 - 1 / width, 0.5, 0, 1, + // clipping in Y axis + -0.5, -1 - 1 / height, 0, 1, + 0, -1, 0, 1, + 0.5, -1 + 1 / height, 0, 1, + -0.5, 1 - 1 / height, 0, 1, + 0, 1, 0, 1, + 0.5, 1 + 1 / height, 0, 1, + // clipping in Z axis + -0.5, -0.5, -1.5, 1, + 0, 0, 0, 1, + 0.5, 0.5, 1.5, 1 + ]; + // move the vertices to pixel centers to avoid off-by-1 differences + for (var i = 0; i < positions.length; i += 4) { + positions[i + 0] = center(positions[i + 0], width); + positions[i + 1] = center(positions[i + 1], height); + } + // positions = [-1 + 3/width + 0.001, 1 + 1/height + 0.001, 0, 1]; + // positions = [-1, -1, 0, 1]; + + var numVertices = positions.length / 4; + + ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); + + ctx.enableVertexAttribArray(posLoc); + ctx.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0); + + ctx.drawArrays(gl.POINTS, 0, numVertices); + ctx.disableVertexAttribArray(posLoc); + ctx.bindBuffer(gl.ARRAY_BUFFER, null); + ctx.deleteBuffer(buffer); + dst.readViewport(ctx, this.m_viewport); +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fClippingTests.ClippingTests = function() { + tcuTestCase.DeqpTest.call(this, 'clipping', 'Clipping tests'); +}; + +es3fClippingTests.ClippingTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fClippingTests.ClippingTests.prototype.constructor = es3fClippingTests.ClippingTests; + +es3fClippingTests.ClippingTests.prototype.init = function() { + var width = gl.drawingBufferWidth; + var height = gl.drawingBufferHeight; + /** @const */ var WIDE_POINT = 5; + /** @const */ var WIDE_LINE = 5; + var viewports = [{ name: 'full_viewport', v: [0, 0, width, height] }, { + name: 'partial_viewport', v: [width * 0.3 , height * 0.2 , width * 0.6, height * 0.5] } + ]; + var pointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE); + var lineWidthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE); + + for (var i = 0; i < viewports.length; i++) { + var v = viewports[i].v.map(Math.floor); + var vName = viewports[i].name; + this.addChild(new es3fClippingTests.LinesCase('narrow_lines_' + vName, 'lines', v, 1)); + if (lineWidthRange[1] >= WIDE_LINE) + this.addChild(new es3fClippingTests.LinesCase('wide_lines_' + vName, 'lines', v, WIDE_LINE)); + this.addChild(new es3fClippingTests.PointsCase('small_points_' + vName, 'points', v, 1)); + if (pointSizeRange[1] >= WIDE_POINT) + this.addChild(new es3fClippingTests.PointsCase('wide_points_' + vName, 'points', v, WIDE_POINT)); + } + + var rangesX = [ + [-1.2, 1.2], + [-1.2, 0.8], + [-0.8, 1.2] + ]; + var rangesY = [ + [-1.2, 1.2], + [-1.2, 0.8], + [-0.8, 1.2] + ]; + var rangesZ = [ + [-1.2, 1.2], + [1.2, -1.2] + ]; + for (var i = 0; i < viewports.length; i++) { + var v = viewports[i].v.map(Math.floor); + var vName = viewports[i].name; + for (var x = 0; x < rangesX.length; x++) + for (var y = 0; y < rangesY.length; y++) + for (var z = 0; z < rangesZ.length; z++) { + var rangeX = rangesX[x]; + var rangeY = rangesY[y]; + var rangeZ = rangesZ[z]; + var name = 'triangles_' + viewports[i].name + '_' + + '(' + rangeX[0] + ',' + rangeY[0] + ',' + rangeZ[0] + ')-' + + '(' + rangeX[1] + ',' + rangeY[1] + ',' + rangeZ[1] + ')'; + this.addChild(new es3fClippingTests.TriangleCase(name, 'triangles', v, + rangeX, + rangeY, + rangeZ)); + } + } +}; + +/** + * Run test + * @param {WebGL2RenderingContext} context + */ +es3fClippingTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fClippingTests.ClippingTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fClippingTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js new file mode 100644 index 000000000..863bc4ded --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js @@ -0,0 +1,546 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fDefaultVertexAttributeTests'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { +var es3fDefaultVertexAttributeTests = functional.gles3.es3fDefaultVertexAttributeTests; +var tcuTestCase = framework.common.tcuTestCase; +var tcuSurface = framework.common.tcuSurface; +var deMath = framework.delibs.debase.deMath; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var tcuLogImage = framework.common.tcuLogImage; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib1f = function() { + this.caseName = 'vertex_attrib_1f'; + this.name = 'VertexAttrib1f'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib1f(index, value[0]); + return [value[0], 0, 0, 1]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib2f = function() { + this.caseName = 'vertex_attrib_2f'; + this.name = 'VertexAttrib2f'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib2f(index, value[0], value[1]); + return [value[0], value[1], 0, 1]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib3f = function() { + this.caseName = 'vertex_attrib_3f'; + this.name = 'VertexAttrib3f'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib3f(index, value[0], value[1], value[2]); + return [value[0], value[1], value[2], 1]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib4f = function() { + this.caseName = 'vertex_attrib_4f'; + this.name = 'VertexAttrib4f'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib4f(index, value[0], value[1], value[2], value[3]); + return [value[0], value[1], value[2], value[3]]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib1fv = function() { + this.caseName = 'vertex_attrib_1fv'; + this.name = 'VertexAttrib1fv'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib1fv(index, value.slice(0, 1)); + return [value[0], 0, 0, 1]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib2fv = function() { + this.caseName = 'vertex_attrib_2fv'; + this.name = 'VertexAttrib2fv'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib2fv(index, value.slice(0, 2)); + return [value[0], value[1], 0, 1]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib3fv = function() { + this.caseName = 'vertex_attrib_3fv'; + this.name = 'VertexAttrib3fv'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib3fv(index, value.slice(0, 3)); + return [value[0], value[1], value[2], 1]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttrib4fv = function() { + this.caseName = 'vertex_attrib_4fv'; + this.name = 'VertexAttrib4fv'; + this.signed = true; + this.load = function(index, value) { + gl.vertexAttrib4fv(index, value.slice(0, 4)); + return [value[0], value[1], value[2], value[3]]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttribI4i = function() { + this.caseName = 'vertex_attrib_4i'; + this.name = 'VertexAttribI4i'; + this.signed = true; + this.load = function(index, value) { + var v = new Int32Array(value); + gl.vertexAttribI4i(index, v[0], v[1], v[2], v[3]); + return [v[0], v[1], v[2], v[3]]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttribI4iv = function() { + this.caseName = 'vertex_attrib_4iv'; + this.name = 'VertexAttribI4iv'; + this.signed = true; + this.load = function(index, value) { + var v = new Int32Array(value); + gl.vertexAttribI4iv(index, v); + return [v[0], v[1], v[2], v[3]]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttribI4ui = function() { + this.caseName = 'vertex_attrib_4ui'; + this.name = 'VertexAttribI4ui'; + this.signed = false; + this.load = function(index, value) { + var v = new Uint32Array(value); + gl.vertexAttribI4ui(index, v[0], v[1], v[2], v[3]); + return [v[0], v[1], v[2], v[3]]; + }; +}; + +/** + * @constructor + */ +es3fDefaultVertexAttributeTests.LoaderVertexAttribI4uiv = function() { + this.caseName = 'vertex_attrib_4uiv'; + this.name = 'VertexAttribI4uiv'; + this.signed = false; + this.load = function(index, value) { + var v = new Uint32Array(value); + gl.vertexAttribI4uiv(index, v); + return [v[0], v[1], v[2], v[3]]; + }; +}; + +/** @const */ var RENDER_SIZE = 32; +/** @const */ var s_valueRange = 10; +/** @const */ var s_passThroughFragmentShaderSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'in mediump vec4 v_color;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor = v_color;\n' + + '}\n'; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fDefaultVertexAttributeTests.AttributeCase = function(loaderType, dataType) { + var loader = new loaderType(); + var name = loader.caseName; + var description = 'Test ' + loader.name; + tcuTestCase.DeqpTest.call(this, name, description); + this.m_funcName = loader.name; + this.m_useNegativeValues = loader.signed; + this.m_dataType = dataType; + this.m_allIterationsPassed = true; + this.m_loader = loader; + this.m_iteration = 0; +}; + +setParentClass(es3fDefaultVertexAttributeTests.AttributeCase, tcuTestCase.DeqpTest); + +es3fDefaultVertexAttributeTests.AttributeCase.prototype.init = function() { + // log test info + + var maxRange = s_valueRange; + var minRange = (this.m_useNegativeValues) ? (-maxRange) : (0.0); + + bufferedLogToConsole( + 'Loading attribute values using ' + this.m_funcName + '\n' + + 'Attribute type: ' + gluShaderUtil.getDataTypeName(this.m_dataType) + '\n' + + 'Attribute value range: [' + minRange + ', ' + maxRange + ']'); + + // gen shader and base quad + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(this.genVertexSource(), s_passThroughFragmentShaderSource)); + if (!this.m_program.isOk()) + testFailedOptions('could not build program', true); + + var fullscreenQuad = [ + 1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + -1.0, -1.0, 0.0, 1.0 + ]; + + this.m_bufID = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_bufID); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(fullscreenQuad), gl.STATIC_DRAW); +}; + +es3fDefaultVertexAttributeTests.AttributeCase.prototype.deinit = function() { + this.m_loader = null; + + gl.useProgram(null); + this.m_program = null; + + if (this.m_bufID) { + gl.deleteBuffer(this.m_bufID); + this.m_bufID = null; + } +}; + +es3fDefaultVertexAttributeTests.AttributeCase.prototype.iterate = function() { + var testValues = [ + [0.0, 0.5, 0.2, 1.0], + [0.1, 0.7, 1.0, 0.6], + [0.4, 0.2, 0.0, 0.5], + [0.5, 0.0, 0.9, 0.1], + [0.6, 0.2, 0.2, 0.9], + [0.9, 1.0, 0.0, 0.0], + [1.0, 0.5, 0.3, 0.8] + ]; + + bufferedLogToConsole('Iteration ' + (this.m_iteration + 1) + '/' + testValues.length); + + var testValue = this.m_useNegativeValues ? + deMath.subScalar(deMath.scale(testValues[this.m_iteration], 2), 1) : + deMath.scale(testValues[this.m_iteration], s_valueRange); + + if (!this.renderWithValue(testValue)) + this.m_allIterationsPassed = false; + + // continue + + if (++this.m_iteration < testValues.length) + return tcuTestCase.IterateResult.CONTINUE; + + if (this.m_allIterationsPassed) + testPassed(); + else + testFailed('Got unexpected values'); + + return tcuTestCase.IterateResult.STOP; +}; + +es3fDefaultVertexAttributeTests.AttributeCase.prototype.genVertexSource = function() { + var vectorSize = (gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeMatrixNumRows(this.m_dataType)) : (gluShaderUtil.isDataTypeVector(this.m_dataType)) ? (gluShaderUtil.getDataTypeScalarSize(this.m_dataType)) : (-1); + var vectorType = gluShaderUtil.getDataTypeName((gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, vectorSize)) : (gluShaderUtil.isDataTypeVector(this.m_dataType)) ? (gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, vectorSize)) : (gluShaderUtil.DataType.FLOAT)); + var components = (gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeMatrixNumRows(this.m_dataType)) : (gluShaderUtil.getDataTypeScalarSize(this.m_dataType)); + + var buf = '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp ' + gluShaderUtil.getDataTypeName(this.m_dataType) + ' a_value;\n' + + 'out highp vec4 v_color;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '\n'; + + buf += ' highp ' + vectorType + ' normalizedValue = ' + ((gluShaderUtil.getDataTypeScalarType(this.m_dataType) == gluShaderUtil.DataType.FLOAT) ? ('') : (vectorType)) + '(a_value' + ((gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? ('[1]') : ('')) + ') / float(' + s_valueRange + ');\n'; + + if (this.m_useNegativeValues) + buf += ' highp ' + vectorType + ' positiveNormalizedValue = (normalizedValue + ' + vectorType + '(1.0)) / 2.0;\n'; + else + buf += ' highp ' + vectorType + ' positiveNormalizedValue = normalizedValue;\n'; + + if (components == 1) + buf += ' v_color = vec4(positiveNormalizedValue, 0.0, 0.0, 1.0);\n'; + else if (components == 2) + buf += ' v_color = vec4(positiveNormalizedValue.xy, 0.0, 1.0);\n'; + else if (components == 3) + buf += ' v_color = vec4(positiveNormalizedValue.xyz, 1.0);\n'; + else if (components == 4) + buf += ' v_color = vec4((positiveNormalizedValue.xy + positiveNormalizedValue.zz) / 2.0, positiveNormalizedValue.w, 1.0);\n'; + else + throw new Error('Wrong component size: ' + components); + + buf += '}\n'; + + return buf; +}; + +es3fDefaultVertexAttributeTests.AttributeCase.prototype.renderWithValue = function(v) { + var positionIndex = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + var valueIndex = gl.getAttribLocation(this.m_program.getProgram(), 'a_value'); + var dest = new tcuSurface.Surface(RENDER_SIZE, RENDER_SIZE); + + gl.clearColor(0.0, 0.0, 0.0, 0.0); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.viewport(0, 0, RENDER_SIZE, RENDER_SIZE); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_bufID); + gl.vertexAttribPointer(positionIndex, 4, gl.FLOAT, false, 0, 0); + gl.enableVertexAttribArray(positionIndex); + + // transfer test value. Load to the second column in the matrix case + var loadedValue = this.m_loader.load((gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (valueIndex + 1) : (valueIndex), v); + + gl.useProgram(this.m_program.getProgram()); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); + gl.useProgram(null); + // The original c++ test does not disable vertex attrib array, which is wrong. + // On most drivers all tests pass because a_position is assigned location 0. + // On MacOSX some tests fail because a_value is assigned location 0 and vertex + // attrib array is left enabled and affects later tests. + gl.disableVertexAttribArray(positionIndex); + dest.readViewport(gl); + + // check whole result is colored correctly + return this.verifyUnicoloredBuffer(dest, this.computeColor(loadedValue)); +}; + +es3fDefaultVertexAttributeTests.AttributeCase.prototype.computeColor = function(value) { + var normalizedValue = deMath.scale(value, 1 / s_valueRange); + var positiveNormalizedValue = this.m_useNegativeValues ? + deMath.scale(deMath.addScalar(normalizedValue, 1), 0.5) : + normalizedValue; + var components = (gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeMatrixNumRows(this.m_dataType)) : (gluShaderUtil.getDataTypeScalarSize(this.m_dataType)); + + if (components == 1) + return [positiveNormalizedValue[0], 0.0, 0.0, 1.0]; + else if (components == 2) + return [positiveNormalizedValue[0], positiveNormalizedValue[1], 0.0, 1.0]; + else if (components == 3) + return [positiveNormalizedValue[0], positiveNormalizedValue[1], positiveNormalizedValue[2], 1.0]; + else if (components == 4) + return [(positiveNormalizedValue[0] + positiveNormalizedValue[2]) / 2.0, (positiveNormalizedValue[1] + positiveNormalizedValue[2]) / 2.0, positiveNormalizedValue[3], 1.0]; + else + throw new Error('Wrong component size: ' + components); +}; + +/** + * @param {tcuSurface.Surface} scene + * @param {Array} refColor + * @return {boolean} + */ +es3fDefaultVertexAttributeTests.AttributeCase.prototype.verifyUnicoloredBuffer = function(scene, refColor) { + var access = scene.getAccess(); + var errorMask = new tcuSurface.Surface(RENDER_SIZE, RENDER_SIZE); + var colorThreshold = [6, 6, 6, 6]; + var error = false; + + errorMask.getAccess().clear([0, 1, 0, 1]); + + bufferedLogToConsole('Verifying rendered image. Expecting color ' + refColor + ', threshold ' + colorThreshold); + + for (var y = 0; y < RENDER_SIZE; ++y) + for (var x = 0; x < RENDER_SIZE; ++x) { + var color = access.getPixel(x, y); + + if (Math.abs(color[0] - refColor[0]) > colorThreshold[0] || + Math.abs(color[1] - refColor[1]) > colorThreshold[1] || + Math.abs(color[2] - refColor[2]) > colorThreshold[2]) { + + // first error + if (!error) + debug('Found invalid pixel(s). Pixel at (' + x + ', ' + y + ') color: ' + color); + + error = true; + errorMask.setPixel(x, y, [1, 0, 0, 1]); + } + } + + if (!error) + bufferedLogToConsole('Rendered image is valid.'); + else { + tcuLogImage.logImage('Result', '', access); + tcuLogImage.logImage('Error mask', '', errorMask.getAccess()); + } + + return !error; +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests = function() { + tcuTestCase.DeqpTest.call(this, 'default_vertex_attrib', 'Test default vertex attributes'); +}; + +es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests.prototype.constructor = es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests; + +es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests.prototype.init = function() { + var tests = this; + var floatTargets = [ + ['float', gluShaderUtil.DataType.FLOAT, false], + ['vec2', gluShaderUtil.DataType.FLOAT_VEC2, true], + ['vec3', gluShaderUtil.DataType.FLOAT_VEC3, true], + ['vec4', gluShaderUtil.DataType.FLOAT_VEC4, false], + ['mat2', gluShaderUtil.DataType.FLOAT_MAT2, true], + ['mat2x3', gluShaderUtil.DataType.FLOAT_MAT2X3, true], + ['mat2x4', gluShaderUtil.DataType.FLOAT_MAT2X4, true], + ['mat3', gluShaderUtil.DataType.FLOAT_MAT3, true], + ['mat3x2', gluShaderUtil.DataType.FLOAT_MAT3X2, true], + ['mat3x4', gluShaderUtil.DataType.FLOAT_MAT3X4, true], + ['mat4', gluShaderUtil.DataType.FLOAT_MAT4, false], + ['mat4x2', gluShaderUtil.DataType.FLOAT_MAT4X2, true], + ['mat4x3', gluShaderUtil.DataType.FLOAT_MAT4X3, true] + ]; + + floatTargets.forEach(function(elem) { + var name = elem[0]; + var dataType = elem[1]; + var reduced = elem[2]; + var group = new tcuTestCase.DeqpTest(name, 'test with ' + name); + tests.addChild(group); + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib1f, dataType)); + if (!reduced) { + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib2f, dataType)); + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib3f, dataType)); + } + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib4f, dataType)); + + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib1fv, dataType)); + if (!reduced) { + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib2fv, dataType)); + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib3fv, dataType)); + } + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib4fv, dataType)); + + }); + + var intTargets = [ + ['int', gluShaderUtil.DataType.INT, false], + ['ivec2', gluShaderUtil.DataType.INT_VEC2, true], + ['ivec3', gluShaderUtil.DataType.INT_VEC3, true], + ['ivec4', gluShaderUtil.DataType.INT_VEC4, false] + ]; + + intTargets.forEach(function(elem) { + var name = elem[0]; + var dataType = elem[1]; + var reduced = elem[2]; + var group = new tcuTestCase.DeqpTest(name, 'test with ' + name); + tests.addChild(group); + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4i, dataType)); + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4iv, dataType)); + }); + + var uintTargets = [ + ['uint', gluShaderUtil.DataType.UINT, false], + ['uvec2', gluShaderUtil.DataType.UINT_VEC2, true], + ['uvec3', gluShaderUtil.DataType.UINT_VEC3, true], + ['uvec4', gluShaderUtil.DataType.UINT_VEC4, false] + ]; + + uintTargets.forEach(function(elem) { + var name = elem[0]; + var dataType = elem[1]; + var reduced = elem[2]; + var group = new tcuTestCase.DeqpTest(name, 'test with ' + name); + tests.addChild(group); + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4ui, dataType)); + group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4uiv, dataType)); + }); + +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fDefaultVertexAttributeTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fDefaultVertexAttributeTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js new file mode 100644 index 000000000..df42ac819 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js @@ -0,0 +1,1155 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fDrawTests'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluVarType'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); +goog.require('modules.shared.glsDrawTests'); + +goog.scope(function() { + + var es3fDrawTests = functional.gles3.es3fDrawTests; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluTexture = framework.opengl.gluTexture; + var gluVarType = framework.opengl.gluVarType; + var tcuLogImage = framework.common.tcuLogImage; + var tcuRGBA = framework.common.tcuRGBA; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + var deUtil = framework.delibs.debase.deUtil; + var glsDrawTests = modules.shared.glsDrawTests; + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var rrShadingContext = framework.referencerenderer.rrShadingContext; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrVertexPacket = framework.referencerenderer.rrVertexPacket; + + /** @type {WebGL2RenderingContext}*/ var gl; + + /** + * @enum + */ + es3fDrawTests.TestIterationType = { + DRAW_COUNT: 0, // !< test with 2, 6, and 26 primitives + INSTANCE_COUNT: 1, // !< test with 2, 4, and 12 instances + INDEX_RANGE: 2 + }; + + /** + * @param {glsDrawTests.DrawTest} test + * @param {glsDrawTests.DrawTestSpec} baseSpec + * @param {?es3fDrawTests.TestIterationType} type + */ + es3fDrawTests.addTestIterations = function(test, baseSpec, type) { + var spec = /** @type {glsDrawTests.DrawTestSpec} */ (deUtil.clone(baseSpec)); + + if (type == es3fDrawTests.TestIterationType.DRAW_COUNT) { + spec.primitiveCount = 1; + test.addIteration(spec, 'draw count = ' + spec.primitiveCount); + + spec.primitiveCount = 5; + test.addIteration(spec, 'draw count = ' + spec.primitiveCount); + + spec.primitiveCount = 25; + test.addIteration(spec, 'draw count = ' + spec.primitiveCount); + } else if (type == es3fDrawTests.TestIterationType.INSTANCE_COUNT) { + spec.instanceCount = 1; + test.addIteration(spec, 'instance count = ' + spec.instanceCount); + + spec.instanceCount = 4; + test.addIteration(spec, 'instance count = ' + spec.instanceCount); + + spec.instanceCount = 11; + test.addIteration(spec, 'instance count = ' + spec.instanceCount); + } else if (type == es3fDrawTests.TestIterationType.INDEX_RANGE) { + spec.indexMin = 0; + spec.indexMax = 23; + test.addIteration(spec, 'index range = [' + spec.indexMin + ', ' + spec.indexMax + ']'); + + spec.indexMin = 23; + spec.indexMax = 40; + test.addIteration(spec, 'index range = [' + spec.indexMin + ', ' + spec.indexMax + ']'); + + // Only makes sense with points + if (spec.primitive == glsDrawTests.DrawTestSpec.Primitive.POINTS) { + spec.indexMin = 5; + spec.indexMax = 5; + test.addIteration(spec, 'index range = [' + spec.indexMin + ', ' + spec.indexMax + ']'); + } + } else + throw new Error('Invalid test iteration type'); + }; + + /** + * @param {glsDrawTests.DrawTestSpec} spec + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} method + */ + es3fDrawTests.genBasicSpec = function(spec, method) { + //spec.apiType = glu::ApiType::es(3,0); + spec.primitive = glsDrawTests.DrawTestSpec.Primitive.TRIANGLES; + spec.primitiveCount = 6; + spec.drawMethod = method; + spec.indexType = null; + spec.indexPointerOffset = 0; + spec.indexStorage = null; + spec.first = 0; + spec.indexMin = 0; + spec.indexMax = 0; + spec.instanceCount = 1; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + + spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[0].componentCount = 4; + spec.attribs[0].offset = 0; + spec.attribs[0].stride = 0; + spec.attribs[0].normalize = false; + spec.attribs[0].instanceDivisor = 0; + spec.attribs[0].useDefaultAttribute = false; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + + spec.attribs[1].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[1].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[1].componentCount = 2; + spec.attribs[1].offset = 0; + spec.attribs[1].stride = 0; + spec.attribs[1].normalize = false; + spec.attribs[1].instanceDivisor = 0; + spec.attribs[1].useDefaultAttribute = false; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} descr + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod + * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive + * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType + * @param {?glsDrawTests.DrawTestSpec.Storage} indexStorage + */ + es3fDrawTests.AttributeGroup = function(name, descr, drawMethod, primitive, indexType, indexStorage) { + tcuTestCase.DeqpTest.call(this, name, descr); + this.m_method = drawMethod; + this.m_primitive = primitive; + this.m_indexType = indexType; + this.m_indexStorage = indexStorage; + this.makeExecutable(); + }; + + es3fDrawTests.AttributeGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.AttributeGroup.prototype.constructor = es3fDrawTests.AttributeGroup; + + es3fDrawTests.AttributeGroup.prototype.init = function() { + // select test type + /** @type {boolean} */ var instanced = this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED || + this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED; + /** @type {boolean} */ var ranged = this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED; + /** @type {es3fDrawTests.TestIterationType} */ var testType = instanced ? es3fDrawTests.TestIterationType.INSTANCE_COUNT : + (ranged ? es3fDrawTests.TestIterationType.INDEX_RANGE : es3fDrawTests.TestIterationType.DRAW_COUNT); + + // Single attribute + /** @type {glsDrawTests.DrawTest} */ var test = new glsDrawTests.DrawTest(null, 'single_attribute', 'Single attribute array.'); + /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec(); + + //spec.apiType = glu::ApiType::es(3,0); + spec.primitive = this.m_primitive; + spec.primitiveCount = 5; + spec.drawMethod = this.m_method; + spec.indexType = this.m_indexType; + spec.indexPointerOffset = 0; + spec.indexStorage = this.m_indexStorage; + spec.first = 0; + spec.indexMin = 0; + spec.indexMax = 0; + spec.instanceCount = 1; + + spec.attribs.length = 0; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[0].componentCount = 2; + spec.attribs[0].offset = 0; + spec.attribs[0].stride = 0; + spec.attribs[0].normalize = false; + spec.attribs[0].instanceDivisor = 0; + spec.attribs[0].useDefaultAttribute = false; + + es3fDrawTests.addTestIterations(test, spec, testType); + + this.addChild(test); + + // Multiple attribute + + test = new glsDrawTests.DrawTest(null, 'multiple_attributes', 'Multiple attribute arrays.'); + spec.primitive = this.m_primitive; + spec.primitiveCount = 5; + spec.drawMethod = this.m_method; + spec.indexType = this.m_indexType; + spec.indexPointerOffset = 0; + spec.indexStorage = this.m_indexStorage; + spec.first = 0; + spec.indexMin = 0; + spec.indexMax = 0; + spec.instanceCount = 1; + + spec.attribs.length = 0; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[0].componentCount = 4; + spec.attribs[0].offset = 0; + spec.attribs[0].stride = 0; + spec.attribs[0].normalize = false; + spec.attribs[0].instanceDivisor = 0; + spec.attribs[0].useDefaultAttribute = false; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + spec.attribs[1].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[1].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[1].componentCount = 2; + spec.attribs[1].offset = 0; + spec.attribs[1].stride = 0; + spec.attribs[1].normalize = false; + spec.attribs[1].instanceDivisor = 0; + spec.attribs[1].useDefaultAttribute = false; + + es3fDrawTests.addTestIterations(test, spec, testType); + + this.addChild(test); + + // Multiple attribute, second one divided + + test = new glsDrawTests.DrawTest(null, 'instanced_attributes', 'Instanced attribute array.'); + + //spec.apiType = glu::ApiType::es(3,0); + spec.primitive = this.m_primitive; + spec.primitiveCount = 5; + spec.drawMethod = this.m_method; + spec.indexType = this.m_indexType; + spec.indexPointerOffset = 0; + spec.indexStorage = this.m_indexStorage; + spec.first = 0; + spec.indexMin = 0; + spec.indexMax = 0; + spec.instanceCount = 1; + + spec.attribs.length = 0; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[0].componentCount = 4; + spec.attribs[0].offset = 0; + spec.attribs[0].stride = 0; + spec.attribs[0].normalize = false; + spec.attribs[0].instanceDivisor = 0; + spec.attribs[0].useDefaultAttribute = false; + + // Add another position component so the instances wont be drawn on each other + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + spec.attribs[1].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[1].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[1].componentCount = 2; + spec.attribs[1].offset = 0; + spec.attribs[1].stride = 0; + spec.attribs[1].normalize = false; + spec.attribs[1].instanceDivisor = 1; + spec.attribs[1].useDefaultAttribute = false; + spec.attribs[1].additionalPositionAttribute = true; + + // Instanced color + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + spec.attribs[2].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[2].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[2].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[2].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[2].componentCount = 3; + spec.attribs[2].offset = 0; + spec.attribs[2].stride = 0; + spec.attribs[2].normalize = false; + spec.attribs[2].instanceDivisor = 1; + spec.attribs[2].useDefaultAttribute = false; + + es3fDrawTests.addTestIterations(test, spec, testType); + + this.addChild(test); + + // Multiple attribute, second one default + test = new glsDrawTests.DrawTest(null, 'default_attribute', 'Attribute specified with glVertexAttrib*.'); + + //spec.apiType = glu::ApiType::es(3,0); + spec.primitive = this.m_primitive; + spec.primitiveCount = 5; + spec.drawMethod = this.m_method; + spec.indexType = this.m_indexType; + spec.indexPointerOffset = 0; + spec.indexStorage = this.m_indexStorage; + spec.first = 0; + spec.indexMin = 0; + spec.indexMax = 17; // \note addTestIterations is not called for the spec, so we must ensure [indexMin, indexMax] is a good range + spec.instanceCount = 1; + + spec.attribs.length = 0; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2; + spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[0].componentCount = 2; + spec.attribs[0].offset = 0; + spec.attribs[0].stride = 0; + spec.attribs[0].normalize = false; + spec.attribs[0].instanceDivisor = 0; + spec.attribs[0].useDefaultAttribute = false; + + /** @type {Array<{input:?glsDrawTests.DrawTestSpec.InputType, output:?glsDrawTests.DrawTestSpec.OutputType, componentCount:number}>} */ var iopairs = [ + {input: glsDrawTests.DrawTestSpec.InputType.FLOAT, output: glsDrawTests.DrawTestSpec.OutputType.VEC2, componentCount: 4}, + {input: glsDrawTests.DrawTestSpec.InputType.FLOAT, output: glsDrawTests.DrawTestSpec.OutputType.VEC4, componentCount: 2}, + {input: glsDrawTests.DrawTestSpec.InputType.INT, output: glsDrawTests.DrawTestSpec.OutputType.IVEC3, componentCount: 4}, + {input: glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT, output: glsDrawTests.DrawTestSpec.OutputType.UVEC2, componentCount: 4} + ]; + + spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec()); + for (var ioNdx = 0; ioNdx < iopairs.length; ++ioNdx) { + /** @type {string} */ var desc = glsDrawTests.DrawTestSpec.inputTypeToString(iopairs[ioNdx].input) + iopairs[ioNdx].componentCount + ' to ' + glsDrawTests.DrawTestSpec.outputTypeToString(iopairs[ioNdx].output); + + spec.attribs[1].inputType = iopairs[ioNdx].input; + spec.attribs[1].outputType = iopairs[ioNdx].output; + spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; + spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW; + spec.attribs[1].componentCount = iopairs[ioNdx].componentCount; + spec.attribs[1].offset = 0; + spec.attribs[1].stride = 0; + spec.attribs[1].normalize = false; + spec.attribs[1].instanceDivisor = 0; + spec.attribs[1].useDefaultAttribute = true; + + test.addIteration(spec, desc); + } + + this.addChild(test); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} descr + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod + */ + es3fDrawTests.IndexGroup = function(name, descr, drawMethod) { + tcuTestCase.DeqpTest.call(this, name, descr); + /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.m_method = drawMethod; + this.makeExecutable(); + }; + + es3fDrawTests.IndexGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.IndexGroup.prototype.constructor = es3fDrawTests.IndexGroup; + + es3fDrawTests.IndexGroup.prototype.init = function() { + /** @type {Array<{storage: ?glsDrawTests.DrawTestSpec.Storage, type: ?glsDrawTests.DrawTestSpec.IndexType, aligned: boolean, offsets: Array}>} */ var tests = [ + {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.BYTE, aligned: true, offsets: [0, 1, -1]}, + {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.SHORT, aligned: true, offsets: [0, 2, -1]}, + {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.INT, aligned: true, offsets: [0, 4, -1]}, + + {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.SHORT, aligned: false, offsets: [1, 3, -1]}, + {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.INT, aligned: false, offsets: [2, 3, -1]} + ]; + + /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec(); + es3fDrawTests.genBasicSpec(spec, this.m_method); + + /** @type {tcuTestCase.DeqpTest} */ var bufferGroup = new tcuTestCase.DeqpTest('buffer', 'buffer'); + /** @type {tcuTestCase.DeqpTest} */ var unalignedBufferGroup = new tcuTestCase.DeqpTest('unaligned_buffer', 'unaligned buffer'); + + this.addChild(bufferGroup); + this.addChild(unalignedBufferGroup); + + for (var testNdx = 0; testNdx < tests.length; ++testNdx) { + /** @type {{storage: ?glsDrawTests.DrawTestSpec.Storage, type: ?glsDrawTests.DrawTestSpec.IndexType, aligned: boolean, offsets: Array}} */ + var indexTest = tests[testNdx]; + /** @type {tcuTestCase.DeqpTest} */ var group = indexTest.aligned ? bufferGroup : unalignedBufferGroup; + + /** @type {string} */ var name = 'index_' + glsDrawTests.DrawTestSpec.indexTypeToString(indexTest.type); + /** @type {string} */ var desc = 'index ' + glsDrawTests.DrawTestSpec.indexTypeToString(indexTest.type) + ' in ' + glsDrawTests.DrawTestSpec.storageToString(indexTest.storage); + /** @type {glsDrawTests.DrawTest} */ var test = new glsDrawTests.DrawTest(null, name, desc); + + spec.indexType = indexTest.type; + spec.indexStorage = indexTest.storage; + + for (var iterationNdx = 0; iterationNdx < indexTest.offsets.length && indexTest.offsets[iterationNdx] != -1; ++iterationNdx) { + /** @type {string} */ var iterationDesc = 'offset ' + indexTest.offsets[iterationNdx]; + spec.indexPointerOffset = indexTest.offsets[iterationNdx]; + test.addIteration(spec, iterationDesc); + } + + if (spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET && + spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE) + group.addChild(test); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} descr + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod + */ + es3fDrawTests.FirstGroup = function(name, descr, drawMethod) { + tcuTestCase.DeqpTest.call(this, name, descr); + /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.m_method = drawMethod; + this.makeExecutable(); + }; + + es3fDrawTests.FirstGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.FirstGroup.prototype.constructor = es3fDrawTests.FirstGroup; + + /** + * init + */ + es3fDrawTests.FirstGroup.prototype.init = function() { + var firsts = + [ + 1, 3, 17 + ]; + + /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec(); + es3fDrawTests.genBasicSpec(spec, this.m_method); + + for (var firstNdx = 0; firstNdx < firsts.length; ++firstNdx) { + var name = 'first_' + firsts[firstNdx]; + var desc = 'first ' + firsts[firstNdx]; + /** @type {glsDrawTests.DrawTest} */ var test = new glsDrawTests.DrawTest(null, name, desc); + + spec.first = firsts[firstNdx]; + + es3fDrawTests.addTestIterations(test, spec, es3fDrawTests.TestIterationType.DRAW_COUNT); + + this.addChild(test); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} descr + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod + */ + es3fDrawTests.MethodGroup = function(name, descr, drawMethod) { + tcuTestCase.DeqpTest.call(this, name, descr); + /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.m_method = drawMethod; + this.makeExecutable(); + }; + + es3fDrawTests.MethodGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.MethodGroup.prototype.constructor = es3fDrawTests.MethodGroup; + + /** + * init + */ + es3fDrawTests.MethodGroup.prototype.init = function() { + var indexed = (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS) || (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED) || (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED); + var hasFirst = (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS) || (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED); + + var primitive = + [ + glsDrawTests.DrawTestSpec.Primitive.POINTS, + glsDrawTests.DrawTestSpec.Primitive.TRIANGLES, + glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN, + glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP, + glsDrawTests.DrawTestSpec.Primitive.LINES, + glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP, + glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP + ]; + + if (hasFirst) { + // First-tests + this.addChild(new es3fDrawTests.FirstGroup('first', 'First tests', this.m_method)); + } + + if (indexed) { + // Index-tests + if (this.m_method != glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED) + this.addChild(new es3fDrawTests.IndexGroup('indices', 'Index tests', this.m_method)); + } + + for (var ndx = 0; ndx < primitive.length; ++ndx) { + var name = glsDrawTests.DrawTestSpec.primitiveToString(primitive[ndx]); + var desc = glsDrawTests.DrawTestSpec.primitiveToString(primitive[ndx]); + + this.addChild(new es3fDrawTests.AttributeGroup(name, desc, this.m_method, primitive[ndx], glsDrawTests.DrawTestSpec.IndexType.SHORT, glsDrawTests.DrawTestSpec.Storage.BUFFER)); + } + }; + + /** + * es3fDrawTests.GridProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + */ + es3fDrawTests.GridProgram = function() { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_offset', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_color', rrGenericVector.GenericVecType.FLOAT)); + + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec4 a_offset;\n' + + 'in highp vec4 a_color;\n' + + 'out mediump vec4 v_color;\n' + + 'void main(void)\n' + + '{\n' + + ' gl_Position = a_position + a_offset;\n' + + ' v_color = a_color;\n' + + '}\n' + )); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource( + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' + + 'in mediump vec4 v_color;\n' + + 'void main(void)\n' + + '{\n' + + ' dEQP_FragColor = v_color;\n' + + '}\n' + )); + + sglrShaderProgram.ShaderProgram.call(this, decl); + }; + + es3fDrawTests.GridProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fDrawTests.GridProgram.prototype.constructor = es3fDrawTests.GridProgram; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fDrawTests.GridProgram.prototype.shadeVertices = function(inputs, packets, numPackets) { + for (var ndx = 0; ndx < numPackets; ++ndx) { + packets[ndx].position = deMath.add( + rrVertexAttrib.readVertexAttrib(inputs[0], packets[ndx].instanceNdx, packets[ndx].vertexNdx, rrGenericVector.GenericVecType.FLOAT), + rrVertexAttrib.readVertexAttrib(inputs[1], packets[ndx].instanceNdx, packets[ndx].vertexNdx, rrGenericVector.GenericVecType.FLOAT) + ); + packets[ndx].outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[2], packets[ndx].instanceNdx, packets[ndx].vertexNdx, rrGenericVector.GenericVecType.FLOAT); + } + }; + + /** + * @param {Array} packets + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fDrawTests.GridProgram.prototype.shadeFragments = function(packets, context) { + for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) + for (var fragNdx = 0; fragNdx < 4; ++fragNdx) + packets[packetNdx].value = rrShadingContext.readTriangleVarying(packets[packetNdx], context, fragNdx); + }; + + /** + * InstancedGridRenderTest + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} gridSide + * @param {boolean} useIndices + */ + es3fDrawTests.InstancedGridRenderTest = function(name, desc, gridSide, useIndices) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_gridSide = gridSide; + this.m_useIndices = useIndices; + }; + + es3fDrawTests.InstancedGridRenderTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.InstancedGridRenderTest.prototype.constructor = es3fDrawTests.InstancedGridRenderTest; + + /** + * iterate + * @return {tcuTestCase.IterateResult} + */ + es3fDrawTests.InstancedGridRenderTest.prototype.iterate = function() { + var renderTargetWidth = Math.min(1024, gl.canvas.width); + var renderTargetHeight = Math.min(1024, gl.canvas.height); + + /** @type {sglrGLContext.GLContext} */ var ctx = new sglrGLContext.GLContext(gl); + /** @type {tcuSurface.Surface} */ var surface = new tcuSurface.Surface(renderTargetWidth, renderTargetHeight); + /** @type {es3fDrawTests.GridProgram} */ var program = new es3fDrawTests.GridProgram(); + + // render + + this.renderTo(ctx, program, surface); + + // verify image + + if (this.verifyImage(surface)) + testPassed(''); + else + testFailed('Incorrect rendering result'); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @param {sglrGLContext.GLContext} ctx + * @param {sglrShaderProgram.ShaderProgram} program + * @param {tcuSurface.Surface} dst + */ + es3fDrawTests.InstancedGridRenderTest.prototype.renderTo = function(ctx, program, dst) { + var green = [0, 1, 0, 1]; + var yellow = [1, 1, 0, 1]; + + /** @type {WebGLBuffer} */ var positionBuf = null; + /** @type {WebGLBuffer} */ var offsetBuf = null; + /** @type {WebGLBuffer} */ var colorBuf = null; + /** @type {WebGLBuffer} */ var indexBuf = null; + /** @type {WebGLProgram} */ var programID = ctx.createProgram(program); + /** @type {number} */ var posLocation = ctx.getAttribLocation(/** @type {WebGLProgram} */ (programID), 'a_position'); + /** @type {number} */ var offsetLocation = ctx.getAttribLocation(/** @type {WebGLProgram} */ (programID), 'a_offset'); + /** @type {number} */ var colorLocation = ctx.getAttribLocation(/** @type {WebGLProgram} */ (programID), 'a_color'); + + var cellW = 2.0 / this.m_gridSide; + var cellH = 2.0 / this.m_gridSide; + var vertexPositions = new Float32Array([ + 0, 0, 0, 1, + cellW, 0, 0, 1, + 0, cellH, 0, 1, + + 0, cellH, 0, 1, + cellW, 0, 0, 1, + cellW, cellH, 0, 1 + ]); + + var indices = new Uint16Array([ + 0, 4, 3, + 2, 1, 5 + ]); + + var offsets = []; + for (var x = 0; x < this.m_gridSide; ++x) + for (var y = 0; y < this.m_gridSide; ++y) { + offsets.push(x * cellW - 1.0); + offsets.push(y * cellW - 1.0); + offsets.push(0, 0); + } + offsets = new Float32Array(offsets); + + var colors = []; + for (var x = 0; x < this.m_gridSide; ++x) + for (var y = 0; y < this.m_gridSide; ++y) { + var colorToPush = ((x + y) % 2 == 0) ? (green) : (yellow); + colors.push(colorToPush[0]); + colors.push(colorToPush[1]); + colors.push(colorToPush[2]); + colors.push(colorToPush[3]); + } + colors = new Float32Array(colors); + + positionBuf = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, positionBuf); + ctx.bufferData(gl.ARRAY_BUFFER, vertexPositions, gl.STATIC_DRAW); + ctx.vertexAttribPointer(posLocation, 4, gl.FLOAT, false, 0, 0); + ctx.vertexAttribDivisor(posLocation, 0); + ctx.enableVertexAttribArray(posLocation); + + offsetBuf = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, offsetBuf); + ctx.bufferData(gl.ARRAY_BUFFER, offsets, gl.STATIC_DRAW); + ctx.vertexAttribPointer(offsetLocation, 4, gl.FLOAT, false, 0, 0); + ctx.vertexAttribDivisor(offsetLocation, 1); + ctx.enableVertexAttribArray(offsetLocation); + + colorBuf = ctx.createBuffer(); + ctx.bindBuffer(gl.ARRAY_BUFFER, colorBuf); + ctx.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); + ctx.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0); + ctx.vertexAttribDivisor(colorLocation, 1); + ctx.enableVertexAttribArray(colorLocation); + + if (this.m_useIndices) { + indexBuf = ctx.createBuffer(); + ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuf); + ctx.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW); + } + + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT); + + ctx.viewport(0, 0, dst.getWidth(), dst.getHeight()); + + ctx.useProgram(programID); + if (this.m_useIndices) + ctx.drawElementsInstanced(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0, this.m_gridSide * this.m_gridSide); + else + ctx.drawArraysInstanced(gl.TRIANGLES, 0, 6, this.m_gridSide * this.m_gridSide); + ctx.useProgram(null); + + if (this.m_useIndices) + ctx.deleteBuffer(indexBuf); + ctx.deleteBuffer(colorBuf); + ctx.deleteBuffer(offsetBuf); + ctx.deleteBuffer(positionBuf); + ctx.deleteProgram(programID); + + ctx.finish(); + dst.readViewport(ctx, [0 , 0, dst.getWidth(), dst.getHeight()]); + }; + + /** + * @param {tcuSurface.Surface} image + * @return {boolean} + */ + es3fDrawTests.InstancedGridRenderTest.prototype.verifyImage = function(image) { + // \note the green/yellow pattern is only for clarity. The test will only verify that all instances were drawn by looking for anything non-green/yellow. + + var green = [0, 255, 0, 255]; + var yellow = [255, 255, 0, 255]; + var colorThreshold = 20; + + /** @type {tcuSurface.Surface} */ var error = new tcuSurface.Surface(image.getWidth(), image.getHeight()); + var isOk = true; + + for (var y = 1; y < image.getHeight() - 1; y++) + for (var x = 1; x < image.getWidth() - 1; x++) { + /** @type {tcuRGBA.RGBA} */ var pixel = new tcuRGBA.RGBA(image.getPixel(x, y)); + var pixelOk = true; + + // Any pixel with !(G ~= 255) is faulty (not a linear combinations of green and yellow) + if (Math.abs(pixel.getGreen() - 255) > colorThreshold) + pixelOk = false; + + // Any pixel with !(B ~= 0) is faulty (not a linear combinations of green and yellow) + if (Math.abs(pixel.getBlue() - 0) > colorThreshold) + pixelOk = false; + + error.setPixel(x, y, pixelOk ? [0, 255, 0, 255] : [255, 0, 0, 255]); + isOk = isOk && pixelOk; + } + + if (!isOk) { + bufferedLogToConsole('Image verification failed.'); + debug('Verfication result'); + tcuLogImage.logImageWithInfo(image.getAccess(), 'Result'); + tcuLogImage.logImageWithInfo(error.getAccess(), 'Error mask'); + } else { + debug('Verfication result'); + } + + return isOk; + }; + + /** + * InstancingGroup + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fDrawTests.InstancingGroup = function(name, descr) { + tcuTestCase.DeqpTest.call(this, name, descr); + this.makeExecutable(); + }; + + es3fDrawTests.InstancingGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.InstancingGroup.prototype.constructor = es3fDrawTests.InstancingGroup; + + /** + * init + */ + es3fDrawTests.InstancingGroup.prototype.init = function() { + var gridWidths = [ + 2, + 5, + 10, + 32, + 100 + ]; + + // drawArrays + for (var ndx = 0; ndx < gridWidths.length; ++ndx) { + var name = 'draw_arrays_instanced_grid_' + gridWidths[ndx] + 'x' + gridWidths[ndx]; + var desc = 'DrawArraysInstanced, Grid size ' + gridWidths[ndx] + 'x' + gridWidths[ndx]; + + this.addChild(new es3fDrawTests.InstancedGridRenderTest(name, desc, gridWidths[ndx], false)); + } + + // drawElements + for (var ndx = 0; ndx < gridWidths.length; ++ndx) { + var name = 'draw_elements_instanced_grid_' + gridWidths[ndx] + 'x' + gridWidths[ndx]; + var desc = 'DrawElementsInstanced, Grid size ' + gridWidths[ndx] + 'x' + gridWidths[ndx]; + + this.addChild(new es3fDrawTests.InstancedGridRenderTest(name, desc, gridWidths[ndx], true)); + } + }; + + /** + * @constructor + * @param {number} size + */ + es3fDrawTests.UniformWeightArray = function(size) { + this.weights = []; + + for (var i = 0; i < size; ++i) + this.weights[i] = 1.0; + }; + + /** + * RandomGroup + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} descr + */ + es3fDrawTests.RandomGroup = function(name, descr) { + tcuTestCase.DeqpTest.call(this, name, descr); + this.makeExecutable(); + }; + + es3fDrawTests.RandomGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.RandomGroup.prototype.constructor = es3fDrawTests.RandomGroup; + + /** + * init + */ + es3fDrawTests.RandomGroup.prototype.init = function() { + /** @type {number} */ var numAttempts = 300; + + /** @type {Array} */ var attribCounts = [1, 2, 5]; + /** @type {Array} */ var attribWeights = [30, 10, 1]; + /** @type {Array} */ var primitiveCounts = [2, 6, 64]; + /** @type {Array} */ var primitiveCountWeights = [20, 10, 1]; + /** @type {Array} */ var indexOffsets = [0, 7, 13]; + /** @type {Array} */ var indexOffsetWeights = [20, 20, 1]; + /** @type {Array} */ var firsts = [0, 6, 12]; + /** @type {Array} */ var firstWeights = [20, 20, 1]; + /** @type {Array} */ var instanceCounts = [1, 2, 16, 17]; + /** @type {Array} */ var instanceWeights = [20, 10, 5, 1]; + /** @type {Array} */ var indexMins = [0, 1, 3, 9]; + /** @type {Array} */ var indexMaxs = [5, 9, 129, 257]; + /** @type {Array} */ var indexWeights = [50, 50, 50, 50]; + /** @type {Array} */ var offsets = [0, 1, 5, 12]; + /** @type {Array} */ var offsetWeights = [50, 10, 10, 10]; + /** @type {Array} */ var strides = [0, 7, 16, 17]; + /** @type {Array} */ var strideWeights = [50, 10, 10, 10]; + /** @type {Array} */ var instanceDivisors = [0, 1, 3, 129]; + /** @type {Array} */ var instanceDivisorWeights = [70, 30, 10, 10]; + + /** @type {Array} */ var primitives = [ + glsDrawTests.DrawTestSpec.Primitive.POINTS, + glsDrawTests.DrawTestSpec.Primitive.TRIANGLES, + glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN, + glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP, + glsDrawTests.DrawTestSpec.Primitive.LINES, + glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP, + glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP + ]; + /** @type {es3fDrawTests.UniformWeightArray} */ var primitiveWeights = new es3fDrawTests.UniformWeightArray(primitives.length); + + /** @type {Array} */ var drawMethods = [ + glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED + ]; + /** @type {es3fDrawTests.UniformWeightArray} */ var drawMethodWeights = new es3fDrawTests.UniformWeightArray(drawMethods.length); + + /** @type {Array} */ var indexTypes = [ + glsDrawTests.DrawTestSpec.IndexType.BYTE, + glsDrawTests.DrawTestSpec.IndexType.SHORT, + glsDrawTests.DrawTestSpec.IndexType.INT + ]; + /** @type {es3fDrawTests.UniformWeightArray} */ var indexTypeWeights = new es3fDrawTests.UniformWeightArray(indexTypes.length); + + /** @type {Array} */ var storages = [ + //glsDrawTests.DrawTestSpec.Storage.USER, + glsDrawTests.DrawTestSpec.Storage.BUFFER + ]; + /** @type {es3fDrawTests.UniformWeightArray} */ var storageWeights = new es3fDrawTests.UniformWeightArray(storages.length); + + /** @type {Array} */ var inputTypes = [ + glsDrawTests.DrawTestSpec.InputType.FLOAT, + //glsDrawTests.DrawTestSpec.InputType.FIXED, + glsDrawTests.DrawTestSpec.InputType.BYTE, + glsDrawTests.DrawTestSpec.InputType.SHORT, + glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE, + glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT, + glsDrawTests.DrawTestSpec.InputType.INT, + glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT, + glsDrawTests.DrawTestSpec.InputType.HALF, + glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10, + glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10 + ]; + /** @type {es3fDrawTests.UniformWeightArray} */ var inputTypeWeights = new es3fDrawTests.UniformWeightArray(inputTypes.length); + + /** @type {Array} */ var outputTypes = [ + glsDrawTests.DrawTestSpec.OutputType.FLOAT, + glsDrawTests.DrawTestSpec.OutputType.VEC2, + glsDrawTests.DrawTestSpec.OutputType.VEC3, + glsDrawTests.DrawTestSpec.OutputType.VEC4, + glsDrawTests.DrawTestSpec.OutputType.INT, + glsDrawTests.DrawTestSpec.OutputType.UINT, + glsDrawTests.DrawTestSpec.OutputType.IVEC2, + glsDrawTests.DrawTestSpec.OutputType.IVEC3, + glsDrawTests.DrawTestSpec.OutputType.IVEC4, + glsDrawTests.DrawTestSpec.OutputType.UVEC2, + glsDrawTests.DrawTestSpec.OutputType.UVEC3, + glsDrawTests.DrawTestSpec.OutputType.UVEC4 + ]; + /** @type {es3fDrawTests.UniformWeightArray} */ var outputTypeWeights = new es3fDrawTests.UniformWeightArray(outputTypes.length); + + /** @type {Array} */ var usages = [ + glsDrawTests.DrawTestSpec.Usage.DYNAMIC_DRAW, + glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW, + glsDrawTests.DrawTestSpec.Usage.STREAM_DRAW, + glsDrawTests.DrawTestSpec.Usage.STREAM_READ, + glsDrawTests.DrawTestSpec.Usage.STREAM_COPY, + glsDrawTests.DrawTestSpec.Usage.STATIC_READ, + glsDrawTests.DrawTestSpec.Usage.STATIC_COPY, + glsDrawTests.DrawTestSpec.Usage.DYNAMIC_READ, + glsDrawTests.DrawTestSpec.Usage.DYNAMIC_COPY + ]; + /** @type {es3fDrawTests.UniformWeightArray} */ var usageWeights = new es3fDrawTests.UniformWeightArray(usages.length); + + /** @type {Array} */ var insertedHashes = []; //'set' structure + /** @type {number} */ var insertedCount = 0; + + for (var ndx = 0; ndx < numAttempts; ++ndx) { + /** @type {deRandom.Random} */ var random = new deRandom.Random(0xc551393 + ndx); // random does not depend on previous cases + + /** @type {number} */ var attributeCount = random.chooseWeighted(attribCounts, attribWeights); + /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec(); + + //spec.apiType = glu::ApiType::es(3,0); + spec.primitive = /** @type {glsDrawTests.DrawTestSpec.Primitive} */ (random.chooseWeighted(primitives, primitiveWeights.weights)); + spec.primitiveCount = random.chooseWeighted(primitiveCounts, primitiveCountWeights); + spec.drawMethod = /** @type {glsDrawTests.DrawTestSpec.DrawMethod} */ (random.chooseWeighted(drawMethods, drawMethodWeights.weights)); + spec.indexType = /** @type {glsDrawTests.DrawTestSpec.IndexType} */ (random.chooseWeighted(indexTypes, indexTypeWeights.weights)); + spec.indexPointerOffset = random.chooseWeighted(indexOffsets, indexOffsetWeights); + spec.indexStorage = /** @type {glsDrawTests.DrawTestSpec.Storage} */ (random.chooseWeighted(storages, storageWeights.weights)); + spec.first = random.chooseWeighted(firsts, firstWeights); + spec.indexMin = random.chooseWeighted(indexMins, indexWeights); + spec.indexMax = random.chooseWeighted(indexMaxs, indexWeights); + spec.instanceCount = random.chooseWeighted(instanceCounts, instanceWeights); + + // check spec is legal + if (!spec.valid()) + continue; + + var hasZeroDivisor = false; + for (var attrNdx = 0; attrNdx < attributeCount;) { + /** @type {boolean} */ var valid; + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = new glsDrawTests.DrawTestSpec.AttributeSpec(); + + attribSpec.inputType = /** @type {glsDrawTests.DrawTestSpec.InputType} */ (random.chooseWeighted(inputTypes, inputTypeWeights.weights)); + attribSpec.outputType = /** @type {glsDrawTests.DrawTestSpec.OutputType} */ (random.chooseWeighted(outputTypes, outputTypeWeights.weights)); + attribSpec.storage = /** @type {glsDrawTests.DrawTestSpec.Storage} */ (random.chooseWeighted(storages, storageWeights.weights)); + attribSpec.usage = /** @type {glsDrawTests.DrawTestSpec.Usage} */ (random.chooseWeighted(usages, usageWeights.weights)); + attribSpec.componentCount = random.getInt(1, 4); + attribSpec.offset = random.chooseWeighted(offsets, offsetWeights); + attribSpec.stride = random.chooseWeighted(strides, strideWeights); + attribSpec.normalize = random.getBool(); + attribSpec.instanceDivisor = random.chooseWeighted(instanceDivisors, instanceDivisorWeights); + attribSpec.useDefaultAttribute = random.getBool(); + + // check spec is legal + valid = attribSpec.valid(/*spec.apiType*/); + + // we do not want interleaved elements. (Might result in some weird floating point values) + if (attribSpec.stride && attribSpec.componentCount * glsDrawTests.DrawTestSpec.inputTypeSize(attribSpec.inputType) > attribSpec.stride) + valid = false; + + // try again if not valid + if (valid) { + spec.attribs.push(attribSpec); + ++attrNdx; + if (attribSpec.instanceDivisor == 0) + hasZeroDivisor = true; + } + } + + // Do not collapse all vertex positions to a single positions + if (spec.primitive != glsDrawTests.DrawTestSpec.Primitive.POINTS) { + spec.attribs[0].instanceDivisor = 0; + hasZeroDivisor = true; + } + + // There should be at least one enabled vertex attribute array that has a divisor of zero in WebGL. + // This limitation is added to keep compatible with D3D. It differs from the feature in gles. + // See the section in WebGL spec: https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.6 + if (hasZeroDivisor == false) + continue; + + // Is render result meaningful? + // Only one vertex + if (spec.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED && spec.indexMin == spec.indexMax && spec.primitive != glsDrawTests.DrawTestSpec.Primitive.POINTS) + continue; + if (spec.attribs[0].useDefaultAttribute && spec.primitive != glsDrawTests.DrawTestSpec.Primitive.POINTS) + continue; + + // Triangle only on one axis + if (spec.primitive == glsDrawTests.DrawTestSpec.Primitive.TRIANGLES || spec.primitive == glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN || spec.primitive == glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP) { + if (spec.attribs[0].componentCount == 1) + continue; + if (spec.attribs[0].outputType == glsDrawTests.DrawTestSpec.OutputType.FLOAT || spec.attribs[0].outputType == glsDrawTests.DrawTestSpec.OutputType.INT || spec.attribs[0].outputType == glsDrawTests.DrawTestSpec.OutputType.UINT) + continue; + if (spec.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED && (spec.indexMax - spec.indexMin) < 2) + continue; + } + + // Add case + /** @type {number} */ var hash = spec.hash(); + for (var attrNdx = 0; attrNdx < attributeCount; ++attrNdx) + hash = deMath.binaryOp(deMath.shiftLeft(hash, 2), spec.attribs[attrNdx].hash(), deMath.BinaryOp.XOR); + + if (insertedHashes.indexOf(hash) == -1) { + // Only properly aligned + if (spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET && + spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE) { + this.addChild(new glsDrawTests.DrawTest(spec, insertedCount + '', spec.getDesc())); + } + deUtil.dePushUniqueToArray(insertedHashes, hash); + + ++insertedCount; + } + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fDrawTests.DrawTest = function() { + tcuTestCase.DeqpTest.call(this, 'draw', 'Drawing tests'); + this.makeExecutable(); + }; + + es3fDrawTests.DrawTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fDrawTests.DrawTest.prototype.constructor = es3fDrawTests.DrawTest; + + /** + * init + */ + es3fDrawTests.DrawTest.prototype.init = function() { + // Basic + /** @type {Array} */ var basicMethods = [ + glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED, + glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED + ]; + + for (var ndx = 0; ndx < basicMethods.length; ++ndx) { + var name = glsDrawTests.DrawTestSpec.drawMethodToString(basicMethods[ndx]); + var desc = glsDrawTests.DrawTestSpec.drawMethodToString(basicMethods[ndx]); + + this.addChild(new es3fDrawTests.MethodGroup(name, desc, basicMethods[ndx])); + } + + // extreme instancing + + this.addChild(new es3fDrawTests.InstancingGroup('instancing', 'draw tests with a large instance count.')); + + // Random + + this.addChild(new es3fDrawTests.RandomGroup('random', 'random draw commands.')); + }; + + /** + * Create and execute the test cases + * @param {WebGL2RenderingContext} context + */ + es3fDrawTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + + var rootTest = new es3fDrawTests.DrawTest(); + state.setRoot(rootTest); + + //Set up name and description of this test series. + setCurrentTestName(rootTest.fullName()); + description(rootTest.getDescription()); + + try { + if (range) { + state.setRange(range); + } + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to run draw tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js new file mode 100644 index 000000000..2f7545a97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js @@ -0,0 +1,1041 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboColorbufferTests'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('functional.gles3.es3fFboTestCase'); +goog.require('functional.gles3.es3fFboTestUtil'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { +var es3fFboColorbufferTests = functional.gles3.es3fFboColorbufferTests; +var es3fFboTestCase = functional.gles3.es3fFboTestCase; +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var tcuTestCase = framework.common.tcuTestCase; +var tcuSurface = framework.common.tcuSurface; +var tcuTexture = framework.common.tcuTexture; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuRGBA = framework.common.tcuRGBA; +var deRandom = framework.delibs.debase.deRandom; +var tcuImageCompare = framework.common.tcuImageCompare; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var rrUtil = framework.referencerenderer.rrUtil; +var deMath = framework.delibs.debase.deMath; +var gluShaderUtil = framework.opengl.gluShaderUtil; + +/** @type {WebGL2RenderingContext} */ var gl; + +/** @const*/ var MIN_THRESHOLD = new tcuRGBA.RGBA([12, 12, 12, 12]); + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @param {deRandom.Random} rnd + * @param {Array} minVal + * @param {Array} maxVal + * @return {Array} + */ +es3fFboColorbufferTests.randomVector = function(rnd, minVal, maxVal) { + var res = []; + for (var ndx = 0; ndx < minVal.length; ndx++) + res[ndx] = rnd.getFloat(minVal[ndx], maxVal[ndx]); + return res; +}; + +/** + * @param {deRandom.Random} rnd + * @return {Array} + */ +es3fFboColorbufferTests.generateRandomColor = function(rnd) { + var retVal = []; + + for (var i = 0; i < 3; ++i) + retVal[i] = rnd.getFloat(); + retVal[3] = 1; + + return retVal; +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} format + */ +es3fFboColorbufferTests.FboColorbufferCase = function(name, desc, format) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_format = format; +}; + +setParentClass(es3fFboColorbufferTests.FboColorbufferCase, es3fFboTestCase.FboTestCase); + +/** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @return {boolean} + */ +es3fFboColorbufferTests.FboColorbufferCase.prototype.compare = function(reference, result) { + /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_format), MIN_THRESHOLD); + + bufferedLogToConsole('Comparing images, threshold: ' + threshold); + + return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold); + }; + +/** + * Deinit. Clear some GL state variables + */ +es3fFboColorbufferTests.FboColorbufferCase.prototype.deinit = function() { + // Texture state + { + // Only TEXTURE0 and TEXTURE1 are used in this test + var numTexUnits = 2; + + for (var ndx = 0; ndx < numTexUnits; ndx++) { + gl.activeTexture(gl.TEXTURE0 + ndx); + + // Reset 2D texture + gl.bindTexture(gl.TEXTURE_2D, null); + + // Reset cube map texture + gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); + + // Reset 2D array texture + gl.bindTexture(gl.TEXTURE_2D_ARRAY, null); + + // Reset 3D texture + gl.bindTexture(gl.TEXTURE_3D, null); + } + + gl.activeTexture(gl.TEXTURE0); + } + + // Pixel operations + { + gl.disable(gl.SCISSOR_TEST); + gl.disable(gl.BLEND); + } + + // Framebuffer control + { + gl.clearColor(0.0, 0.0, 0.0, 0.0); + } + }; + +/** + * @constructor + * @extends {es3fFboColorbufferTests.FboColorbufferCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} width + * @param {number} height + */ +es3fFboColorbufferTests.FboColorClearCase = function(name, desc, format, width, height) { + es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, format); + this.m_width = width; + this.m_height = height; +}; + +setParentClass(es3fFboColorbufferTests.FboColorClearCase, es3fFboColorbufferTests.FboColorbufferCase); + +es3fFboColorbufferTests.FboColorClearCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + +es3fFboColorbufferTests.FboColorClearCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var fboFormat = gluTextureUtil.mapGLInternalFormat(this.m_format); + var fmtClass = tcuTexture.getTextureChannelClass(fboFormat.type); + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(fboFormat); + var rnd = new deRandom.Random(17); + var numClears = 16; + + var fbo = ctx.createFramebuffer(); + var rbo = ctx.createRenderbuffer(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, rbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_width, this.m_height); + this.checkError(); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, this.m_width, this.m_height); + + // Initialize to transparent black. + switch (fmtClass) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + ctx.clearBufferfv(gl.COLOR, 0, new Float32Array(4)); + break; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + ctx.clearBufferuiv(gl.COLOR, 0, new Uint32Array(4)); + break; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + ctx.clearBufferiv(gl.COLOR, 0, new Int32Array(4)); + break; + + default: + throw new Error('Invalid channelclass ' + fmtClass); + } + + // Do random scissored clears. + ctx.enable(gl.SCISSOR_TEST); + for (var ndx = 0; ndx < numClears; ndx++) { + var x = rnd.getInt(0, this.m_width - 1); + var y = rnd.getInt(0, this.m_height - 1); + var w = rnd.getInt(1, this.m_width - x); + var h = rnd.getInt(1, this.m_height - y); + var color = es3fFboColorbufferTests.randomVector(rnd, fmtInfo.valueMin, fmtInfo.valueMax); + + ctx.scissor(x, y, w, h); + + switch (fmtClass) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + ctx.clearBufferfv(gl.COLOR, 0, color); + break; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + ctx.clearBufferuiv(gl.COLOR, 0, color); + break; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + ctx.clearBufferiv(gl.COLOR, 0, color); + break; + + default: + throw new Error('Invalid channelclass ' + fmtClass); + } + } + + // Read results from renderbuffer. + this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height, fboFormat, fmtInfo.lookupScale, fmtInfo.lookupBias); + this.checkError(); + }; + +/** + * @constructor + * @extends {es3fFboColorbufferTests.FboColorbufferCase} + * @param {string} name + * @param {string} desc + * @param {number} tex0Fmt + * @param {Array} tex0Size + * @param {number} tex1Fmt + * @param {Array} tex1Size + */ +es3fFboColorbufferTests.FboColorMultiTex2DCase = function(name, desc, tex0Fmt, tex0Size, tex1Fmt, tex1Size) { + es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, tex0Fmt); + this.m_tex0Fmt = tex0Fmt; + this.m_tex0Size = tex0Size; + this.m_tex1Fmt = tex1Fmt; + this.m_tex1Size = tex1Size; +}; + +setParentClass(es3fFboColorbufferTests.FboColorMultiTex2DCase, es3fFboColorbufferTests.FboColorbufferCase); + +es3fFboColorbufferTests.FboColorMultiTex2DCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_tex0Fmt); + this.checkFormatSupport(this.m_tex1Fmt); + return true; // No exception thrown + }; + +es3fFboColorbufferTests.FboColorMultiTex2DCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var texFmt0 = gluTextureUtil.mapGLInternalFormat(this.m_tex0Fmt); + var texFmt1 = gluTextureUtil.mapGLInternalFormat(this.m_tex1Fmt); + var fmtInfo0 = tcuTextureUtil.getTextureFormatInfo(texFmt0); + var fmtInfo1 = tcuTextureUtil.getTextureFormatInfo(texFmt1); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFbo0Shader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt0), + deMath.subtract(fmtInfo0.valueMax, fmtInfo0.valueMin), + fmtInfo0.valueMin); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFbo1Shader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt1), + deMath.subtract(fmtInfo1.valueMax, fmtInfo1.valueMin), + fmtInfo1.valueMin); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var multiTexShader = new es3fFboTestUtil.Texture2DShader( + [gluTextureUtil.getSampler2DType(texFmt0), gluTextureUtil.getSampler2DType(texFmt1)], + gluShaderUtil.DataType.FLOAT_VEC4); + + var texToFbo0ShaderID = ctx.createProgram(texToFbo0Shader); + var texToFbo1ShaderID = ctx.createProgram(texToFbo1Shader); + var multiTexShaderID = ctx.createProgram(multiTexShader); + + // Setup shaders + multiTexShader.setTexScaleBias(0, deMath.scale(fmtInfo0.lookupScale, 0.5), deMath.scale(fmtInfo0.lookupBias, 0.5)); + multiTexShader.setTexScaleBias(1, deMath.scale(fmtInfo1.lookupScale, 0.5), deMath.scale(fmtInfo1.lookupBias, 0.5)); + texToFbo0Shader.setUniforms(ctx, texToFbo0ShaderID); + texToFbo1Shader.setUniforms(ctx, texToFbo1ShaderID); + multiTexShader.setUniforms(ctx, multiTexShaderID); + + var fbo0 = ctx.createFramebuffer(); + var fbo1 = ctx.createFramebuffer(); + var tex0 = ctx.createTexture(); + var tex1 = ctx.createTexture(); + + for (var ndx = 0; ndx < 2; ndx++) { + var transferFmt = gluTextureUtil.getTransferFormat(ndx ? texFmt1 : texFmt0); + var format = ndx ? this.m_tex1Fmt : this.m_tex0Fmt; + var isFilterable = gluTextureUtil.isGLInternalColorFormatFilterable(format); + var size = ndx ? this.m_tex1Size : this.m_tex0Size; + var fbo = ndx ? fbo1 : fbo0; + var tex = ndx ? tex1 : tex0; + + ctx.bindTexture(gl.TEXTURE_2D, tex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, size[0], size[1], 0, transferFmt.format, transferFmt.dataType, null); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + } + + // Render textures to both framebuffers. + for (var ndx = 0; ndx < 2; ndx++) { + var format = gl.RGBA; + var dataType = gl.UNSIGNED_BYTE; + var texW = 128; + var texH = 128; + var tmpTex; + var fbo = ndx ? fbo1 : fbo0; + var viewport = ndx ? this.m_tex1Size : this.m_tex0Size; + var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + if (ndx == 0) + tcuTextureUtil.fillWithComponentGradients(data.getAccess(), [0, 0, 0, 0], [1, 1, 1, 1]); + else + tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]); + + tmpTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, tmpTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.viewport(0, 0, viewport[0], viewport[1]); + rrUtil.drawQuad(ctx, ndx ? texToFbo1ShaderID : texToFbo0ShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + } + + // Render to framebuffer. + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight()); + ctx.activeTexture(gl.TEXTURE0); + ctx.bindTexture(gl.TEXTURE_2D, tex0); + ctx.activeTexture(gl.TEXTURE1); + ctx.bindTexture(gl.TEXTURE_2D, tex1); + rrUtil.drawQuad(ctx, multiTexShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + + this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight()); + }; + +/** + * @constructor + * @extends {es3fFboColorbufferTests.FboColorbufferCase} + * @param {string} name + * @param {string} desc + * @param {number} texFmt + * @param {Array} texSize + */ +es3fFboColorbufferTests.FboColorTexCubeCase = function(name, desc, texFmt, texSize) { + es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, texFmt); + this.m_texSize = texSize; +}; + +setParentClass(es3fFboColorbufferTests.FboColorTexCubeCase, es3fFboColorbufferTests.FboColorbufferCase); + +es3fFboColorbufferTests.FboColorTexCubeCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + +es3fFboColorbufferTests.FboColorTexCubeCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format); + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + + var cubeGLFaces = [ + gl.TEXTURE_CUBE_MAP_POSITIVE_X, + gl.TEXTURE_CUBE_MAP_POSITIVE_Y, + gl.TEXTURE_CUBE_MAP_POSITIVE_Z, + gl.TEXTURE_CUBE_MAP_NEGATIVE_X, + gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, + gl.TEXTURE_CUBE_MAP_NEGATIVE_Z + ]; + + var cubeTexFaces = [ + tcuTexture.CubeFace.CUBEFACE_POSITIVE_X, + tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y, + tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z, + tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X, + tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y, + tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z + ]; + + var rnd = new deRandom.Random(21); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFboShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt), + deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin), + fmtInfo.valueMin); + + /** @type {es3fFboTestUtil.TextureCubeShader} */ + var cubeTexShader = new es3fFboTestUtil.TextureCubeShader( + gluTextureUtil.getSamplerCubeType(texFmt), + gluShaderUtil.DataType.FLOAT_VEC4); + + var texToFboShaderID = ctx.createProgram(texToFboShader); + var cubeTexShaderID = ctx.createProgram(cubeTexShader); + + // Setup shaders + texToFboShader.setUniforms(ctx, texToFboShaderID); + cubeTexShader.setTexScaleBias(fmtInfo.lookupScale, fmtInfo.lookupBias); + + // Framebuffers. + var fbos = []; + var tex; + + var transferFmt = gluTextureUtil.getTransferFormat(texFmt); + var isFilterable = gluTextureUtil.isGLInternalColorFormatFilterable(this.m_format); + var size = this.m_texSize; + + tex = ctx.createTexture(); + + ctx.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST); + + // Generate an image and FBO for each cube face + for (var ndx = 0; ndx < cubeGLFaces.length; ndx++) + ctx.texImage2D(cubeGLFaces[ndx], 0, this.m_format, size[0], size[1], 0, transferFmt.format, transferFmt.dataType, null); + this.checkError(); + + for (var ndx = 0; ndx < cubeGLFaces.length; ndx++) { + var layerFbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, layerFbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, cubeGLFaces[ndx], tex, 0); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + fbos.push(layerFbo); + } + + // Render test images to random cube faces + var order = []; + + for (var n = 0; n < fbos.length; n++) + order.push(n); + rnd.shuffle(order); + + for (var ndx = 0; ndx < 4; ndx++) { + var face = order[ndx]; + var format = gl.RGBA; + var dataType = gl.UNSIGNED_BYTE; + var texW = 128; + var texH = 128; + var tmpTex; + var fbo = fbos[face]; + var viewport = this.m_texSize; + var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), 8, es3fFboColorbufferTests.generateRandomColor(rnd), [0, 0, 0, 0]); + + tmpTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, tmpTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.viewport(0, 0, viewport[0], viewport[1]); + rrUtil.drawQuad(ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + this.checkError(); + + // Render to framebuffer + var p0 = [(ndx % 2) - 1.0, Math.floor(ndx / 2) - 1.0, 0.0]; + var p1 = deMath.add(p0, [1.0, 1.0, 0.0]); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight()); + + ctx.activeTexture(gl.TEXTURE0); + ctx.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + + cubeTexShader.setFace(cubeTexFaces[face]); + cubeTexShader.setUniforms(ctx, cubeTexShaderID); + + rrUtil.drawQuad(ctx, cubeTexShaderID, p0, p1); + this.checkError(); + } + + this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight()); + }; + +/** + * @constructor + * @extends {es3fFboColorbufferTests.FboColorbufferCase} + * @param {string} name + * @param {string} desc + * @param {number} texFmt + * @param {Array} texSize + */ +es3fFboColorbufferTests.FboColorTex2DArrayCase = function(name, desc, texFmt, texSize) { + es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, texFmt); + this.m_texSize = texSize; +}; + +setParentClass(es3fFboColorbufferTests.FboColorTex2DArrayCase, es3fFboColorbufferTests.FboColorbufferCase); + +es3fFboColorbufferTests.FboColorTex2DArrayCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + + es3fFboColorbufferTests.FboColorTex2DArrayCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format); + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + var rnd = new deRandom.Random(100); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFboShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt), + deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin), + fmtInfo.valueMin); + + /** @type {es3fFboTestUtil.Texture2DArrayShader} */ + var arrayTexShader = new es3fFboTestUtil.Texture2DArrayShader( + gluTextureUtil.getSampler2DArrayType(texFmt), + gluShaderUtil.DataType.FLOAT_VEC4); + + var texToFboShaderID = ctx.createProgram(texToFboShader); + var arrayTexShaderID = ctx.createProgram(arrayTexShader); + + // Setup textures + texToFboShader.setUniforms(ctx, texToFboShaderID); + arrayTexShader.setTexScaleBias(fmtInfo.lookupScale, fmtInfo.lookupBias); + + // Framebuffers. + var fbos = []; + var tex; + + var transferFmt = gluTextureUtil.getTransferFormat(texFmt); + var isFilterable = gluTextureUtil.isGLInternalColorFormatFilterable(this.m_format); + var size = this.m_texSize; + + tex = ctx.createTexture(); + + ctx.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST); + ctx.texImage3D(gl.TEXTURE_2D_ARRAY, 0, this.m_format, size[0], size[1], size[2], 0, transferFmt.format, transferFmt.dataType, null); + + // Generate an FBO for each layer + for (var ndx = 0; ndx < this.m_texSize[2]; ndx++) { + var layerFbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, layerFbo); + ctx.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex, 0, ndx); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + fbos.push(layerFbo); + } + + // Render test images to random texture layers + var order = []; + + for (var n = 0; n < fbos.length; n++) + order.push(n); + rnd.shuffle(order); + + for (var ndx = 0; ndx < 4; ndx++) { + var layer = order[ndx]; + var format = gl.RGBA; + var dataType = gl.UNSIGNED_BYTE; + var texW = 128; + var texH = 128; + var fbo = fbos[layer]; + var viewport = this.m_texSize; + var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), 8, es3fFboColorbufferTests.generateRandomColor(rnd), [0, 0, 0, 0]); + + var tmpTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, tmpTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.viewport(0, 0, viewport[0], viewport[1]); + rrUtil.drawQuad(ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + this.checkError(); + + // Render to framebuffer + var p0 = [(ndx % 2) - 1.0, Math.floor(ndx / 2) - 1.0, 0.0]; + var p1 = deMath.add(p0, [1.0, 1.0, 0.0]); + debug('Layer:' + layer + ' rectangle: ' + p0 + ' ' + p1); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight()); + + ctx.activeTexture(gl.TEXTURE0); + ctx.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + + arrayTexShader.setLayer(layer); + arrayTexShader.setUniforms(ctx, arrayTexShaderID); + + rrUtil.drawQuad(ctx, arrayTexShaderID, p0, p1); + this.checkError(); + } + + this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight()); + }; + +/** + * @constructor + * @extends {es3fFboColorbufferTests.FboColorbufferCase} + * @param {string} name + * @param {string} desc + * @param {number} texFmt + * @param {Array} texSize + */ +es3fFboColorbufferTests.FboColorTex3DCase = function(name, desc, texFmt, texSize) { + es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, texFmt); + this.m_texSize = texSize; +}; + +setParentClass(es3fFboColorbufferTests.FboColorTex3DCase, es3fFboColorbufferTests.FboColorbufferCase); + +es3fFboColorbufferTests.FboColorTex3DCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + + es3fFboColorbufferTests.FboColorTex3DCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format); + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + var rnd = new deRandom.Random(100); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFboShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt), + deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin), + fmtInfo.valueMin); + + /** @type {es3fFboTestUtil.Texture3DShader} */ + var tdTexShader = new es3fFboTestUtil.Texture3DShader( + gluTextureUtil.getSampler3D(texFmt), + gluShaderUtil.DataType.FLOAT_VEC4); + + var texToFboShaderID = ctx.createProgram(texToFboShader); + var tdTexShaderID = ctx.createProgram(tdTexShader); + + // Setup textures + texToFboShader.setUniforms(ctx, texToFboShaderID); + tdTexShader.setTexScaleBias(fmtInfo.lookupScale, fmtInfo.lookupBias); + + // Framebuffers. + var fbos = []; + var tex;{ + var transferFmt = gluTextureUtil.getTransferFormat(texFmt); + var size = this.m_texSize; + + tex = ctx.createTexture(); + + ctx.bindTexture(gl.TEXTURE_3D, tex); + ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + ctx.texImage3D(gl.TEXTURE_3D, 0, this.m_format, size[0], size[1], size[2], 0, transferFmt.format, transferFmt.dataType, null); + + // Generate an FBO for each layer + for (var ndx = 0; ndx < this.m_texSize[2]; ndx++) { + var layerFbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, layerFbo); + ctx.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex, 0, ndx); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + fbos.push(layerFbo); + } + } + + // Render test images to random texture layers + var order = []; + + for (var n = 0; n < fbos.length; n++) + order.push(n); + rnd.shuffle(order); + + for (var ndx = 0; ndx < 4; ndx++) { + var layer = order[ndx]; + var format = gl.RGBA; + var dataType = gl.UNSIGNED_BYTE; + var texW = 128; + var texH = 128; + var fbo = fbos[layer]; + var viewport = this.m_texSize; + var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), 8, es3fFboColorbufferTests.generateRandomColor(rnd), [0, 0, 0, 0]); + + var tmpTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, tmpTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.viewport(0, 0, viewport[0], viewport[1]); + rrUtil.drawQuad(ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + this.checkError(); + + // Render to framebuffer + var p0 = [(ndx % 2) - 1.0, Math.floor(ndx / 2) - 1.0, 0.0]; + var p1 = deMath.add(p0, [1.0, 1.0, 0.0]); + debug('Layer:' + layer + ' rectangle: ' + p0 + ' ' + p1); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight()); + + ctx.activeTexture(gl.TEXTURE0); + ctx.bindTexture(gl.TEXTURE_3D, tex); + + tdTexShader.setDepth(layer / (this.m_texSize[2] - 1)); + tdTexShader.setUniforms(ctx, tdTexShaderID); + + rrUtil.drawQuad(ctx, tdTexShaderID, p0, p1); + this.checkError(); + } + + this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight()); +}; + +/** + * @constructor + * @extends {es3fFboColorbufferTests.FboColorbufferCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {Array} size + * @param {number} funcRGB + * @param {number} funcAlpha + * @param {number} srcRGB + * @param {number} dstRGB + * @param {number} srcAlpha + * @param {number} dstAlpha + */ +es3fFboColorbufferTests.FboBlendCase = function(name, desc, format, size, funcRGB, funcAlpha, srcRGB, dstRGB, srcAlpha, dstAlpha) { + es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, format); + this.m_size = size; + this.m_funcRGB = funcRGB; + this.m_funcAlpha = funcAlpha; + this.m_srcRGB = srcRGB; + this.m_dstRGB = dstRGB; + this.m_srcAlpha = srcAlpha; + this.m_dstAlpha = dstAlpha +}; + +setParentClass(es3fFboColorbufferTests.FboBlendCase, es3fFboColorbufferTests.FboColorbufferCase); + +es3fFboColorbufferTests.FboBlendCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + } + + es3fFboColorbufferTests.FboBlendCase.prototype.render = function(dst) { + // \note Assumes floating-point or fixed-point format. + var ctx = this.getCurrentContext(); + var fboFmt = gluTextureUtil.mapGLInternalFormat(this.m_format); + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(fboFmt); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4); + + /** @type {es3fFboTestUtil.GradientShader} */ + var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + + var texShaderID = ctx.createProgram(texShader); + var gradShaderID = ctx.createProgram(gradShader); + + // Setup shaders + texShader.setUniforms (ctx, texShaderID); + gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]); + + var fbo = ctx.createFramebuffer(); + var rbo = ctx.createRenderbuffer(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, rbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_size[0], this.m_size[1]); + this.checkError(); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, this.m_size[0], this.m_size[1]); + + // Fill framebuffer with grid pattern. + var format = gl.RGBA; + var dataType = gl.UNSIGNED_BYTE; + var texW = 128; + var texH = 128; + var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]); + + var gridTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, gridTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + rrUtil.drawQuad(ctx, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + this.checkError(); + + // Setup blend. + ctx.enable(gl.BLEND); + ctx.blendEquationSeparate(this.m_funcRGB, this.m_funcAlpha); + ctx.blendFuncSeparate(this.m_srcRGB, this.m_dstRGB, this.m_srcAlpha, this.m_dstAlpha); + + // Render gradient with blend. + rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + + es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.m_size[0], this.m_size[1], fboFmt, [1, 1, 1, 1], [0, 0, 0, 0]); + }; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fFboColorbufferTests.FboColorbufferTests = function() { + tcuTestCase.DeqpTest.call(this, 'color', 'Colorbuffer tests'); +}; + +setParentClass(es3fFboColorbufferTests.FboColorbufferTests, tcuTestCase.DeqpTest); + +es3fFboColorbufferTests.FboColorbufferTests.prototype.init = function() { + var colorFormats = [ + // RGBA formats + gl.RGBA32I, + gl.RGBA32UI, + gl.RGBA16I, + gl.RGBA16UI, + gl.RGBA8, + gl.RGBA8I, + gl.RGBA8UI, + gl.SRGB8_ALPHA8, + gl.RGB10_A2, + gl.RGB10_A2UI, + gl.RGBA4, + gl.RGB5_A1, + + // RGB formats + gl.RGB8, + gl.RGB565, + + // RG formats + gl.RG32I, + gl.RG32UI, + gl.RG16I, + gl.RG16UI, + gl.RG8, + gl.RG8I, + gl.RG8UI, + + // R formats + gl.R32I, + gl.R32UI, + gl.R16I, + gl.R16UI, + gl.R8, + gl.R8I, + gl.R8UI, + + // gl.EXT_color_buffer_float + gl.RGBA32F, + gl.RGBA16F, + gl.R11F_G11F_B10F, + gl.RG32F, + gl.RG16F, + gl.R32F, + gl.R16F, + + // gl.EXT_color_buffer_half_float is not exposed in WebGL 2.0. + // gl.RGB16F + ]; + + // .clear + var clearGroup = tcuTestCase.newTest("clear", "Color clears"); + this.addChild(clearGroup); + + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + clearGroup.addChild(new es3fFboColorbufferTests.FboColorClearCase( + es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], 129, 117)); + } + + var numGroups = 6; + + // .tex2d + var tex2DGroup = []; + for (var ii = 0; ii < numGroups; ++ii) { + tex2DGroup[ii] = tcuTestCase.newTest("tex2d", "Texture 2D tests"); + this.addChild(tex2DGroup[ii]); + } + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + tex2DGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorMultiTex2DCase( + es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], [129, 117], colorFormats[ndx], [99, 128])); + } + + // .texcube + var texCubeGroup = []; + for (var ii = 0; ii < numGroups; ++ii) { + texCubeGroup[ii] = tcuTestCase.newTest("texcube", "Texture cube map tests"); + this.addChild(texCubeGroup[ii]); + } + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + texCubeGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorTexCubeCase( + es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], [128, 128])); + } + + // .tex2darray + var tex2DArrayGroup = []; + for (var ii = 0; ii < numGroups; ++ii) { + tex2DArrayGroup[ii] = tcuTestCase.newTest("tex2darray", "Texture 2D array tests"); + this.addChild(tex2DArrayGroup[ii]); + } + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + tex2DArrayGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorTex2DArrayCase( + es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], [128, 128, 5])); + } + + // .tex3d + var tex3DGroup = []; + for (var ii = 0; ii < numGroups; ++ii) { + tex3DGroup[ii] = tcuTestCase.newTest("tex3d", "Texture 3D tests"); + this.addChild(tex3DGroup[ii]); + } + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + tex3DGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorTex3DCase( + es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], [128, 128, 5])); + } + + // .blend + var blendGroup = tcuTestCase.newTest("blend", "Blending tests"); + this.addChild(blendGroup); + + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + var format = colorFormats[ndx]; + var texFmt = gluTextureUtil.mapGLInternalFormat(format); + var fmtClass = tcuTexture.getTextureChannelClass(texFmt.type); + var fmtName = es3fFboTestUtil.getFormatName(format); + + if (texFmt.type == tcuTexture.ChannelType.FLOAT || + fmtClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER || + fmtClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER) + continue; // Blending is not supported. + + blendGroup.addChild(new es3fFboColorbufferTests.FboBlendCase(fmtName + "_src_over", "", format, + [127, 111], gl.FUNC_ADD, gl.FUNC_ADD, gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE)); + } +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fFboColorbufferTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fFboColorbufferTests.FboColorbufferTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFboColorbufferTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js new file mode 100644 index 000000000..1ae68fc8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js @@ -0,0 +1,567 @@ + +// FboCompletenessTests +'use strict'; +goog.provide('functional.gles3.es3fFboCompletenessTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('modules.shared.glsFboCompletenessTests'); +goog.require('modules.shared.glsFboUtil'); + +goog.scope(function() { + + var es3fFboCompletenessTests = functional.gles3.es3fFboCompletenessTests; + var glsFboUtil = modules.shared.glsFboUtil; + var glsFboCompletenessTests = modules.shared.glsFboCompletenessTests; + var tcuTestCase = framework.common.tcuTestCase; + + es3fFboCompletenessTests.initGlDependents = function(gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + /** + * @type {Array} + */ + es3fFboCompletenessTests.s_es3ColorRenderables = [ + // GLES3, 4.4.4: "An internal format is color-renderable if it is one of + // the formats from table 3.12 noted as color-renderable..." + gl.R8, gl.RG8, gl.RGB8, gl.RGB565, gl.RGBA4, gl.RGB5_A1, gl.RGBA8, + gl.RGB10_A2, gl.RGB10_A2UI, gl.SRGB8_ALPHA8, + gl.R8I, gl.R8UI, gl.R16I, gl.R16UI, gl.R32I, gl.R32UI, + gl.RG8I, gl.RG8UI, gl.RG16I, gl.RG16UI, gl.RG32I, gl.RG32UI, + gl.RGBA81, gl.RGBA8UI, gl.RGB16I, gl.RGBA16UI, gl.RGBA32I, gl.RGBA32UI + ]; + + /** + * @type {Array} + */ + es3fFboCompletenessTests.s_es3UnsizedColorRenderables = [ + // "...or if it is unsized format RGBA or RGB." + // See Table 3.3 in GLES3. + glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_BYTE), + glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4), + glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_SHORT_5_5_5_1), + glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_BYTE), + glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_SHORT_5_6_5) + ]; + + /** + * @type {Array} + */ + es3fFboCompletenessTests.s_es3DepthRenderables = [ + // GLES3, 4.4.4: "An internal format is depth-renderable if it is one of + // the formats from table 3.13." + gl.DEPTH_COMPONENT16, gl.DEPTH_COMPONENT24, gl.DEPTH_COMPONENT32F, + gl.DEPTH24_STENCIL8, gl.DEPTH32F_STENCIL8 + ]; + + /** + * @type {Array} + */ + es3fFboCompletenessTests.s_es3StencilRboRenderables = [ + // GLES3, 4.4.4: "An internal format is stencil-renderable if it is + // STENCIL_INDEX8..." + gl.STENCIL_INDEX8 + ]; + + /** + * @type {Array} + */ + es3fFboCompletenessTests.s_es3StencilRenderables = [ + // "...or one of the formats from table 3.13 whose base internal format is + // DEPTH_STENCIL." + gl.DEPTH24_STENCIL8, gl.DEPTH32F_STENCIL8 + ]; + + /** + * @type {Array} + */ + es3fFboCompletenessTests.s_es3TextureFloatFormats = [ + gl.RGBA32F, gl.RGBA16F, gl.R11F_G11F_B10F, + gl.RG32F, gl.RG16F, gl.R32F, gl.R16F, + gl.RGBA16F, gl.RGB16F, gl.RG16F, gl.R16F + ]; + + /** + * @type {Array} + */ + es3fFboCompletenessTests.s_es3Formats = [ + [ + ( + glsFboUtil.FormatFlags.REQUIRED_RENDERABLE | + glsFboUtil.FormatFlags.COLOR_RENDERABLE | + glsFboUtil.FormatFlags.TEXTURE_VALID + ), + glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3UnsizedColorRenderables) + ], + [ + ( + glsFboUtil.FormatFlags.REQUIRED_RENDERABLE | + glsFboUtil.FormatFlags.COLOR_RENDERABLE | + glsFboUtil.FormatFlags.RENDERBUFFER_VALID | + glsFboUtil.FormatFlags.TEXTURE_VALID + ), + glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3ColorRenderables) + ], [ + ( + glsFboUtil.FormatFlags.REQUIRED_RENDERABLE | + glsFboUtil.FormatFlags.DEPTH_RENDERABLE | + glsFboUtil.FormatFlags.RENDERBUFFER_VALID | + glsFboUtil.FormatFlags.TEXTURE_VALID + ), + glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3DepthRenderables) + ], [ + ( + glsFboUtil.FormatFlags.REQUIRED_RENDERABLE | + glsFboUtil.FormatFlags.STENCIL_RENDERABLE | + glsFboUtil.FormatFlags.RENDERBUFFER_VALID + ), + glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3StencilRboRenderables) + ], [ + ( + glsFboUtil.FormatFlags.REQUIRED_RENDERABLE | + glsFboUtil.FormatFlags.STENCIL_RENDERABLE | + glsFboUtil.FormatFlags.RENDERBUFFER_VALID | + glsFboUtil.FormatFlags.TEXTURE_VALID + ), + glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3StencilRenderables) + ], + + // These are not color-renderable in vanilla ES3, but we need to mark them + // as valid for textures, since EXT_color_buffer_(half_)float brings in + // color-renderability and only renderbuffer-validity. + [ + glsFboUtil.FormatFlags.TEXTURE_VALID, + glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3TextureFloatFormats) + ] + ]; + + // gl.EXT_color_buffer_float + es3fFboCompletenessTests.s_extColorBufferFloatFormats = [ + gl.RGBA32F, gl.RGBA16F, gl.R11F_G11F_B10F, gl.RG32F, gl.RG16F, gl.R32F, gl.R16F + ]; + + // gl.OES_texture_stencil8 + es3fFboCompletenessTests.s_extOESTextureStencil8 = [ + gl.STENCIL_INDEX8 + ]; + + es3fFboCompletenessTests.s_es3ExtFormats = [{ + extensions: 'gl.EXT_color_buffer_float', + flags: glsFboUtil.FormatFlags.REQUIRED_RENDERABLE | + glsFboUtil.FormatFlags.COLOR_RENDERABLE | + glsFboUtil.FormatFlags.RENDERBUFFER_VALID, + formats: new glsFboUtil.Range(es3fFboCompletenessTests.s_extColorBufferFloatFormats) + }, { + extensions: 'gl.OES_texture_stencil8', + flags: glsFboUtil.FormatFlags.REQUIRED_RENDERABLE | + glsFboUtil.FormatFlags.STENCIL_RENDERABLE | + glsFboUtil.FormatFlags.TEXTURE_VALID, + formats: new glsFboUtil.Range(es3fFboCompletenessTests.s_extOESTextureStencil8) + } + ]; + + glsFboCompletenessTests.initGlDependents(gl); + }; + + /** + * @constructor + * @extends {glsFboUtil.Checker} + */ + es3fFboCompletenessTests.ES3Checker = function() { + glsFboUtil.Checker.call(this, gl); + /** @type {number} */ this.m_numSamples = -1; // GLsizei + /** @type {number} */ this.m_depthStencilImage = 0; // GLuint + /** @type {number} */ this.m_depthStencilType = gl.NONE; + }; + es3fFboCompletenessTests.ES3Checker.prototype = Object.create(glsFboUtil.Checker.prototype); + es3fFboCompletenessTests.ES3Checker.prototype.constructor = es3fFboCompletenessTests.ES3Checker; + + es3fFboCompletenessTests.ES3Checker.prototype.check = function(attPoint, att, image) { + + var imgSamples = glsFboUtil.imageNumSamples(image); + + if (this.m_numSamples == -1) { + this.m_numSamples = imgSamples; + } else { + // GLES3: "The value of RENDERBUFFER_SAMPLES is the same for all attached + // renderbuffers and, if the attached images are a mix of renderbuffers + // and textures, the value of RENDERBUFFER_SAMPLES is zero." + // + // On creating a renderbuffer: "If _samples_ is zero, then + // RENDERBUFFER_SAMPLES is set to zero. Otherwise [...] the resulting + // value for RENDERBUFFER_SAMPLES is guaranteed to be greater than or + // equal to _samples_ and no more than the next larger sample count + // supported by the implementation." + + // Either all attachments are zero-sample renderbuffers and/or + // textures, or none of them are. + this.addFBOStatus( + (this.m_numSamples == 0) == (imgSamples == 0), + gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE + ); + + // If the attachments requested a different number of samples, the + // implementation is allowed to report this as incomplete. However, it + // is also possible that despite the different requests, the + // implementation allocated the same number of samples to both. Hence + // reporting the framebuffer as complete is also legal. + this.addPotentialFBOStatus( + this.m_numSamples == imgSamples, + gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE + ); + } + + // "Depth and stencil attachments, if present, are the same image." + if (attPoint == gl.DEPTH_ATTACHMENT || attPoint == gl.STENCIL_ATTACHMENT) { + if (this.m_depthStencilImage == 0) { + this.m_depthStencilImage = att.imageName; + this.m_depthStencilType = glsFboUtil.attachmentType(att); + + } else { + this.addFBOStatus( + this.m_depthStencilImage == att.imageName && this.m_depthStencilType == glsFboUtil.attachmentType(att), + gl.FRAMEBUFFER_UNSUPPORTED + ); + } + } + + }; + + /** + * @typedef {{textureKind: number, numLayers: number, attachmentLayer: number}} + */ + es3fFboCompletenessTests.numLayersParamsT; + + /** + * @param {number} textureKind + * @param {number} numLayers + * @param {number} attachmentLayer + * @return {es3fFboCompletenessTests.numLayersParamsT} + */ + es3fFboCompletenessTests.numLayersParams = function(textureKind, numLayers, attachmentLayer) { + if (typeof(attachmentLayer) == 'undefined') { + textureKind = 0; + numLayers = 0; + attachmentLayer = 0; + } + return { + textureKind: textureKind, //< gl.TEXTURE_3D or gl.TEXTURE_2D_ARRAY + numLayers: numLayers, //< Number of layers in texture + attachmentLayer: attachmentLayer //< Layer referenced by attachment + }; + }; + + /** + * es3fFboCompletenessTests.numLayersParams.getName + * @param {es3fFboCompletenessTests.numLayersParamsT} params + * @return {string} + */ + es3fFboCompletenessTests.numLayersParams.getName = function(params) { + return ( + (params.textureKind == gl.TEXTURE_3D ? '3d' : '2darr') + '_' + + params.numLayers + '_' + + params.attachmentLayer + ); + }; + /** + * es3fFboCompletenessTests.numLayersParams.getDescription + * @param {es3fFboCompletenessTests.numLayersParamsT} params + * @return {string} + */ + es3fFboCompletenessTests.numLayersParams.getDescription = function(params) { + return ( + (params.textureKind == gl.TEXTURE_3D ? '3D Texture' : '2D Array Texture') + ', ' + + params.numLayers + ' layers, ' + + 'attached layer ' + params.attachmentLayer + '.' + ); + }; + + // string, string, glsFboCompleteness::context, params. + /** + * @constructor + * @extends {glsFboCompletenessTests.TestBase} + * @param {string} name + * @param {string} desc + * @param {glsFboCompletenessTests.Context} ctx + * @param {es3fFboCompletenessTests.numLayersParamsT} params + */ + es3fFboCompletenessTests.NumLayersTest = function(name, desc, ctx, params) { + glsFboCompletenessTests.TestBase.call(this, name, desc, params); + this.m_ctx = ctx; + }; + + es3fFboCompletenessTests.NumLayersTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype); + es3fFboCompletenessTests.NumLayersTest.prototype.constructor = es3fFboCompletenessTests.NumLayersTest; + + es3fFboCompletenessTests.NumLayersTest.prototype.build = function(builder, gl) { + + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + var target = gl.COLOR_ATTACHMENT0; + var texCfg = builder.makeConfig( + function(kind) { + switch (kind) { + case gl.TEXTURE_3D: return glsFboUtil.Texture3D; + case gl.TEXTURE_2D_ARRAY: return glsFboUtil.Texture2DArray; + default: throw new Error('Impossible case'); + } + }(this.m_params.textureKind) + ); + + texCfg.internalFormat = this.getDefaultFormat(target, gl.TEXTURE, gl); + texCfg.width = 64; + texCfg.height = 64; + texCfg.numLayers = this.m_params.numLayers; + var tex = builder.glCreateTexture(texCfg); + + var att = builder.makeConfig(glsFboUtil.TextureLayerAttachment); + att.layer = this.m_params.attachmentLayer; + att.imageName = tex; + + builder.glAttach(target, att); + + // return tcuTestCase.IterateResult.STOP; + }; +//es3fFboCompletenessTests.NumLayersTest.prototype.isExecutable = function() { +// return false; +//}; + + /** + * @enum + */ + es3fFboCompletenessTests.e_samples = { + NONE: -2, + TEXTURE: -1 + }; + + /** + * @typedef {{numSamples: Array}} + */ + es3fFboCompletenessTests.numSamplesParamsT; + + /** + * @param {number} colour + * @param {number} depth + * @param {number} stencil + * @return {es3fFboCompletenessTests.numSamplesParamsT} + */ + es3fFboCompletenessTests.numSamplesParams = function(colour, depth, stencil) { + var ret = { + numSamples: new Array(3) + }; + if (colour !== undefined) { + ret.numSamples[0] = colour; + if (depth !== undefined) { + ret.numSamples[1] = depth; + if (stencil !== undefined) { + ret.numSamples[2] = stencil; + } + } + } + return ret; + }; + + /** + * @param {es3fFboCompletenessTests.numSamplesParamsT} params + * @return {string} + */ + es3fFboCompletenessTests.numSamplesParams.getName = function(params) { + var out = ''; + + var first = true; + for (var i = 0; i < 3; ++i) { + if (first) + first = false; + else + out += '_'; + + switch (params.numSamples[i]) { + case es3fFboCompletenessTests.e_samples.NONE: out += 'none'; break; + case es3fFboCompletenessTests.e_samples.TEXTURE: out += 'tex'; break; + default: out += 'rbo'; break; + } + } + return out; + }; + /** + * @param {es3fFboCompletenessTests.numSamplesParamsT} params + * @return {string} + */ + es3fFboCompletenessTests.numSamplesParams.getDescription = function(params) { + var out = ''; + var names = ['color', 'depth', 'stencil']; + var first = true; + + for (var i = 0; i < 3; ++i) { + if (first) + first = false; + else + out += ', '; + + if (params.numSamples[i] == es3fFboCompletenessTests.e_samples.TEXTURE) { + out += 'texture ' + names[i] + ' attachment'; + } else { + out += params.numSamples[i] + '-sample renderbuffer ' + names[i] + ' attachment'; + } + } + return out; + }; + + /** + * @constructor + * @extends {glsFboCompletenessTests.TestBase} + * @param {string} name + * @param {string} desc + * @param {glsFboCompletenessTests.Context} ctx + * @param {es3fFboCompletenessTests.numSamplesParamsT} params + */ + es3fFboCompletenessTests.NumSamplesTest = function(name, desc, ctx, params) { + glsFboCompletenessTests.TestBase.call(this, name, desc, params); + this.m_ctx = ctx; + }; + es3fFboCompletenessTests.NumSamplesTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype); + es3fFboCompletenessTests.NumSamplesTest.prototype.constructor = es3fFboCompletenessTests.NumSamplesTest; + + es3fFboCompletenessTests.NumSamplesTest.prototype.build = function(builder, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + var s_targets = [ + gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1, gl.DEPTH_ATTACHMENT + ]; + // Non-integer formats for each attachment type. + // \todo [2013-12-17 lauri] Add fixed/floating/integer metadata for formats so + // we can pick one smartly or maybe try several. + var s_formats = [ + gl.RGBA8, gl.RGB565, gl.DEPTH_COMPONENT24 + ]; + + var l = s_targets.length; + if (this.m_params.numSamples.length != l) + throw new Error('Wrong number of params.'); + + for (var i = 0; i < l; ++i) { + var target = s_targets[i]; + var fmt = new glsFboUtil.ImageFormat(s_formats[i], gl.NONE); + + var ns = this.m_params.numSamples[i]; + if (ns == es3fFboCompletenessTests.e_samples.NONE) + continue; + if (ns == es3fFboCompletenessTests.e_samples.TEXTURE) { + this.attachTargetToNew(target, gl.TEXTURE, fmt, 64, 64, builder, gl); + } else { + var rboCfg = builder.makeConfig(glsFboUtil.Renderbuffer); + rboCfg.internalFormat = fmt; + rboCfg.width = rboCfg.height = 64; + rboCfg.numSamples = ns; + + var rbo = builder.glCreateRbo(rboCfg); + // Implementations do not necessarily support sample sizes greater than 1. + if (builder.getError() == gl.INVALID_OPERATION) { + throw new Error('Unsupported number of samples.'); + } + var att = builder.makeConfig(glsFboUtil.RenderbufferAttachment); + att.imageName = rbo; + builder.glAttach(target, att); + } + } + + return true; + }; + + es3fFboCompletenessTests.init = function() { + + //(testCtx, renderCtx, factory) { + var fboCtx = new glsFboCompletenessTests.Context(null, gl, function() { + return new es3fFboCompletenessTests.ES3Checker(); + }); + + fboCtx.addFormats(glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3Formats)); + + /** @const @type {tcuTestCase.DeqpTest} */ + var testGroup = tcuTestCase.runner.testCases; + + testGroup.addChild(fboCtx.createRenderableTests(gl)); + testGroup.addChild(fboCtx.createAttachmentTests(gl)); + testGroup.addChild(fboCtx.createSizeTests(gl)); + + /** @type {tcuTestCase.DeqpTest} */ + var layerTests = tcuTestCase.newTest('layer', 'Tests for layer attachments'); + + /** @static */ + var s_layersParams = [ + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 1, 0), + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 1, 3), + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 4, 3), + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 4, 15), + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 1, 0), + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 1, 15), + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 4, 15), + es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 64, 15) + ]; + + for (var i = 0; i < s_layersParams.length; ++i) { + var name = 'name'; + var desc = 'desc'; + layerTests.addChild(new es3fFboCompletenessTests.NumLayersTest( + es3fFboCompletenessTests.numLayersParams.getName(s_layersParams[i]), + es3fFboCompletenessTests.numLayersParams.getDescription(s_layersParams[i]), + fboCtx, s_layersParams[i] + )); + } + testGroup.addChild(layerTests); + + /** @type {tcuTestCase.DeqpTest} */ + var sampleTests = tcuTestCase.newTest('sample', 'Tests for multisample attachments'); + // some short hand + var samples = es3fFboCompletenessTests.e_samples; + // sample tests + /** @static */ + var s_samplesParams = [ + es3fFboCompletenessTests.numSamplesParams(0, samples.NONE, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(1, samples.NONE, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(2, samples.NONE, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(0, samples.TEXTURE, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(1, samples.TEXTURE, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(2, samples.TEXTURE, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(2, 1, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(2, 2, samples.NONE), + es3fFboCompletenessTests.numSamplesParams(0, 0, samples.TEXTURE), + es3fFboCompletenessTests.numSamplesParams(1, 2, 0), + es3fFboCompletenessTests.numSamplesParams(2, 2, 0), + es3fFboCompletenessTests.numSamplesParams(1, 1, 1), + es3fFboCompletenessTests.numSamplesParams(1, 2, 4) + ]; + + for (var i = 0; i < s_samplesParams.length; ++i) { + var name = 'name'; + var desc = 'desc'; + sampleTests.addChild(new es3fFboCompletenessTests.NumSamplesTest( + es3fFboCompletenessTests.numSamplesParams.getName(s_samplesParams[i]), + es3fFboCompletenessTests.numSamplesParams.getDescription(s_samplesParams[i]), + fboCtx, s_samplesParams[i] + )); + } + testGroup.addChild(sampleTests); + + }; + + es3fFboCompletenessTests.run = function() { + var testName = 'completeness'; + var testDescription = 'Completeness tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fFboCompletenessTests.init(); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js new file mode 100644 index 000000000..c662a3764 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js @@ -0,0 +1,385 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboDepthbufferTests'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('functional.gles3.es3fFboTestCase'); +goog.require('functional.gles3.es3fFboTestUtil'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { +var es3fFboDepthbufferTests = functional.gles3.es3fFboDepthbufferTests; +var es3fFboTestCase = functional.gles3.es3fFboTestCase; +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var tcuTestCase = framework.common.tcuTestCase; +var tcuSurface = framework.common.tcuSurface; +var tcuTexture = framework.common.tcuTexture; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuRGBA = framework.common.tcuRGBA; +var deRandom = framework.delibs.debase.deRandom; +var tcuImageCompare = framework.common.tcuImageCompare; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var rrUtil = framework.referencerenderer.rrUtil; +var deMath = framework.delibs.debase.deMath; +var gluShaderUtil = framework.opengl.gluShaderUtil; + +/** @type {WebGL2RenderingContext} */ var gl; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} width + * @param {number} height + */ +es3fFboDepthbufferTests.BasicFboDepthCase = function(name, desc, format, width, height) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_format = format; + this.m_width = width; + this.m_height = height; +}; + +setParentClass(es3fFboDepthbufferTests.BasicFboDepthCase, es3fFboTestCase.FboTestCase); + +es3fFboDepthbufferTests.BasicFboDepthCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + +es3fFboDepthbufferTests.BasicFboDepthCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFormat = gl.RGBA8; + /** @type {es3fFboTestUtil.GradientShader} */ + var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4); + var texShaderID = ctx.createProgram(texShader); + var gradShaderID = ctx.createProgram(gradShader); + var clearDepth = 1; + + // Setup shaders + gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]); + texShader.setUniforms(ctx, texShaderID); + + // Setup FBO + + var fbo = ctx.createFramebuffer(); + var colorRbo = ctx.createRenderbuffer(); + var depthRbo = ctx.createRenderbuffer(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_width, this.m_height); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_width, this.m_height); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthRbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, this.m_width, this.m_height); + + // Clear depth to 1 + ctx.clearBufferfv(gl.DEPTH, 0, [clearDepth]); + + // Render gradient with depth = [-1..1] + ctx.enable(gl.DEPTH_TEST); + rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + // Render grid pattern with depth = 0 + var format = gl.RGBA; + var dataType = gl.UNSIGNED_BYTE; + var texW = 128; + var texH = 128; + var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]); + + var gridTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, gridTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + rrUtil.drawQuad(ctx, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + this.checkError(); + + // Read results. + this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height, + gluTextureUtil.mapGLInternalFormat(colorFormat), + [1, 1, 1, 1], [0, 0, 0, 0]); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} width + * @param {number} height + */ +es3fFboDepthbufferTests.DepthWriteClampCase = function(name, desc, format, width, height) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_format = format; + this.m_width = width; + this.m_height = height; +}; + +setParentClass(es3fFboDepthbufferTests.DepthWriteClampCase, es3fFboTestCase.FboTestCase); + +es3fFboDepthbufferTests.DepthWriteClampCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + +es3fFboDepthbufferTests.DepthWriteClampCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFormat = gl.RGBA8; + var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(this.m_format)); + /** @type {es3fFboTestUtil.DepthGradientShader} */ + var gradShader = new es3fFboTestUtil.DepthGradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + + var gradShaderID = ctx.createProgram(gradShader); + var clearDepth = 1; + var red = [1, 0, 0, 1]; + var green = [0, 1, 0, 1]; + + // Setup FBO + + var fbo = ctx.createFramebuffer(); + var colorRbo = ctx.createRenderbuffer(); + var depthTexture = ctx.createTexture(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_width, this.m_height); + + ctx.bindTexture(gl.TEXTURE_2D, depthTexture); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, this.m_width, this.m_height, 0, transferFmt.format, transferFmt.dataType, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture, 0); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, this.m_width, this.m_height); + + // Clear depth to 1 + ctx.clearBufferfv(gl.DEPTH, 0, [clearDepth]); + + // Render gradient with depth = [-1..1] + ctx.enable(gl.DEPTH_TEST); + ctx.depthFunc(gl.ALWAYS); + gradShader.setUniforms(ctx, gradShaderID, -1, 2, green); + rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + ctx.depthMask(false); + + // Test if any fragment has greater depth than 1; there should be none + ctx.depthFunc(gl.LESS); // (1 < depth) ? + gradShader.setUniforms(ctx, gradShaderID, 1, 1, red); + rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + // Test if any fragment has smaller depth than 0; there should be none + ctx.depthFunc(gl.GREATER); // (0 > depth) ? + gradShader.setUniforms(ctx, gradShaderID, 0, 0, red); + rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + // Read results. + this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height, + gluTextureUtil.mapGLInternalFormat(colorFormat), + [1, 1, 1, 1], [0, 0, 0, 0]); + + ctx.depthMask(true); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} width + * @param {number} height + */ +es3fFboDepthbufferTests.DepthTestClampCase = function(name, desc, format, width, height) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_format = format; + this.m_width = width; + this.m_height = height; +}; + +setParentClass(es3fFboDepthbufferTests.DepthTestClampCase, es3fFboTestCase.FboTestCase); + +es3fFboDepthbufferTests.DepthTestClampCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + +es3fFboDepthbufferTests.DepthTestClampCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFormat = gl.RGBA8; + var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(this.m_format)); + /** @type {es3fFboTestUtil.DepthGradientShader} */ + var gradShader = new es3fFboTestUtil.DepthGradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + + var gradShaderID = ctx.createProgram(gradShader); + var clearDepth = 1; + var yellow = [1, 1, 0, 1]; + var green = [0, 1, 0, 1]; + + // Setup FBO + + var fbo = ctx.createFramebuffer(); + var colorRbo = ctx.createRenderbuffer(); + var depthTexture = ctx.createTexture(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_width, this.m_height); + + ctx.bindTexture(gl.TEXTURE_2D, depthTexture); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, this.m_width, this.m_height, 0, transferFmt.format, transferFmt.dataType, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture, 0); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, this.m_width, this.m_height); + + // Clear depth to 1 + ctx.clearBufferfv(gl.DEPTH, 0, [clearDepth]); + + // Test values used in depth test are clamped + + // Render green quad, depth gradient = [-1..2] + ctx.enable(gl.DEPTH_TEST); + ctx.depthFunc(gl.ALWAYS); + + gradShader.setUniforms(ctx, gradShaderID, -1, 2, green); + rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + // Render yellow quad, depth gradient = [-0.5..3]. Gradients have equal values only outside [0, 1] range due to clamping + ctx.depthFunc(gl.EQUAL); + + gradShader.setUniforms(ctx, gradShaderID, -0.5, 3, yellow); + rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + // Read results. + this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height, + gluTextureUtil.mapGLInternalFormat(colorFormat), + [1, 1, 1, 1], [0, 0, 0, 0]); +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fFboDepthbufferTests.FboDepthbufferTests = function() { + tcuTestCase.DeqpTest.call(this, 'depth', 'depth tests'); +}; + +setParentClass(es3fFboDepthbufferTests.FboDepthbufferTests, tcuTestCase.DeqpTest); + +es3fFboDepthbufferTests.FboDepthbufferTests.prototype.init = function() { + var depthFormats = [ + gl.DEPTH_COMPONENT32F, + gl.DEPTH_COMPONENT24, + gl.DEPTH_COMPONENT16, + gl.DEPTH32F_STENCIL8, + gl.DEPTH24_STENCIL8 + ]; + + // .basic + var basicGroup = tcuTestCase.newTest('basic', 'Basic depth tests'); + this.addChild(basicGroup); + + for (var ndx = 0; ndx < depthFormats.length; ndx++) + basicGroup.addChild(new es3fFboDepthbufferTests.BasicFboDepthCase(es3fFboTestUtil.getFormatName(depthFormats[ndx]), '', depthFormats[ndx], 119, 127)); + + // .depth_write_clamp + var depthClampGroup = tcuTestCase.newTest('depth_write_clamp', 'Depth write clamping tests'); + this.addChild(depthClampGroup); + + for (var ndx = 0; ndx < depthFormats.length; ndx++) + depthClampGroup.addChild(new es3fFboDepthbufferTests.DepthWriteClampCase(es3fFboTestUtil.getFormatName(depthFormats[ndx]), '', depthFormats[ndx], 119, 127)); + + // .depth_test_clamp + var depthTestGroup = tcuTestCase.newTest('depth_test_clamp', 'Depth test value clamping tests'); + this.addChild(depthTestGroup); + + for (var ndx = 0; ndx < depthFormats.length; ndx++) + depthTestGroup.addChild(new es3fFboDepthbufferTests.DepthTestClampCase(es3fFboTestUtil.getFormatName(depthFormats[ndx]), '', depthFormats[ndx], 119, 127)); + +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fFboDepthbufferTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fFboDepthbufferTests.FboDepthbufferTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFboDepthbufferTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js new file mode 100644 index 000000000..3a90ccecc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js @@ -0,0 +1,1471 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboInvalidateTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('functional.gles3.es3fFboTestCase'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { +var es3fFboInvalidateTests = functional.gles3.es3fFboInvalidateTests; +var tcuTestCase = framework.common.tcuTestCase; +var es3fFboTestCase = functional.gles3.es3fFboTestCase; +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var rrUtil = framework.referencerenderer.rrUtil; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var deMath = framework.delibs.debase.deMath; +var tcuRGBA = framework.common.tcuRGBA; +var tcuImageCompare = framework.common.tcuImageCompare; + +/** @type {WebGL2RenderingContext} */ var gl; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +var getDefaultFBDiscardAttachments = function(discardBufferBits) { + var attachments = []; + + if (discardBufferBits & gl.COLOR_BUFFER_BIT) + attachments.push(gl.COLOR); + + if (discardBufferBits & gl.DEPTH_BUFFER_BIT) + attachments.push(gl.DEPTH); + + if (discardBufferBits & gl.STENCIL_BUFFER_BIT) + attachments.push(gl.STENCIL); + + return attachments; +}; + +var getFBODiscardAttachments = function(discardBufferBits) { + var attachments = []; + + if (discardBufferBits & gl.COLOR_BUFFER_BIT) + attachments.push(gl.COLOR_ATTACHMENT0); + + // \note DEPTH_STENCIL_ATTACHMENT is allowed when discarding FBO, but not with default FB + if ((discardBufferBits & (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) == (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) + attachments.push(gl.DEPTH_STENCIL_ATTACHMENT); + else if (discardBufferBits & gl.DEPTH_BUFFER_BIT) + attachments.push(gl.DEPTH_ATTACHMENT); + else if (discardBufferBits & gl.STENCIL_BUFFER_BIT) + attachments.push(gl.STENCIL_ATTACHMENT); + + return attachments; +}; + +var getCompatibleColorFormat = function() { + var redBits = gl.getParameter(gl.RED_BITS); + var greenBits = gl.getParameter(gl.GREEN_BITS); + var blueBits = gl.getParameter(gl.BLUE_BITS); + var alphaBits = gl.getParameter(gl.ALPHA_BITS); + switch ('' + redBits + greenBits + blueBits + alphaBits) { + case '8888' : return gl.RGBA8; + case '8880' : return gl.RGB8; + default: + throw new Error('Unexpected bit depth'); + } +}; + +var getCompatibleDepthStencilFormat = function() { + var depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)); + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + var hasDepth = depthBits > 0; + var hasStencil = stencilBits > 0; + + if (!hasDepth || !hasStencil || (stencilBits != 8)) + return gl.NONE; + + if (depthBits == 32) + return gl.DEPTH32F_STENCIL8; + else if (depthBits == 24) + return gl.DEPTH24_STENCIL8; + else + return gl.NONE; +}; + +var hasAttachment = function(attachments, attachment) { + return attachments.indexOf(attachment) >= 0; +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} buffers + * @param {number=} target + */ +es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase = function(name, desc, buffers, target) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_buffers = buffers; + this.m_fboTarget = target || gl.FRAMEBUFFER; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var attachments = getDefaultFBDiscardAttachments(this.m_buffers); + + var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var program = ctx.createProgram(shader); + shader.setColor(ctx, program, [1, 0, 0, 1]); + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]); + ctx.invalidateFramebuffer(this.m_fboTarget, attachments); + + if ((this.m_buffers & gl.COLOR_BUFFER_BIT) != 0) { + // Color was not preserved - fill with green. + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + + shader.setColor(ctx, program, [0, 1, 0, 1]); + rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + } + + if ((this.m_buffers & gl.DEPTH_BUFFER_BIT) != 0) { + // Depth was not preserved. + ctx.depthFunc(gl.ALWAYS); + } + + if ((this.m_buffers & gl.STENCIL_BUFFER_BIT) == 0) { + // Stencil was preserved. + ctx.stencilFunc(gl.EQUAL, 1, 0xff); + } + + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + + shader.setColor(ctx, program, [0, 0, 1, 1]); + rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]); + dst.readViewport(ctx); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} buffers + */ +es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase = function(name, desc, buffers) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_buffers = buffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var attachments = getDefaultFBDiscardAttachments(this.m_buffers); + + var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var program = ctx.createProgram(shader); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4); + + /** @type {es3fFboTestUtil.GradientShader} */ + var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + + var texShaderID = ctx.createProgram(texShader); + var gradShaderID = ctx.createProgram(gradShader); + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + // Create fbo. + var fbo = ctx.createFramebuffer(); + var tex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, tex); + ctx.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, this.getWidth(), this.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + ctx.bindTexture(gl.TEXTURE_2D, null); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + shader.setColor(ctx, program, [1, 0, 0, 1]); + rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]); + + ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments); + + // Switch to fbo and render gradient into it. + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]); + rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]); + // Restore default fbo. + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + + if ((this.m_buffers & gl.COLOR_BUFFER_BIT) != 0) { + // Color was not preserved - fill with green. + shader.setColor(ctx, program, [0, 1, 0, 1]); + rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]); + } + + if ((this.m_buffers & gl.DEPTH_BUFFER_BIT) != 0) { + // Depth was not preserved. + ctx.depthFunc(gl.ALWAYS); + } + + if ((this.m_buffers & gl.STENCIL_BUFFER_BIT) == 0) { + // Stencil was preserved. + ctx.stencilFunc(gl.EQUAL, 1, 0xff); + } + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + ctx.bindTexture(gl.TEXTURE_2D, tex); + + texShader.setUniforms(ctx, texShaderID); + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + + dst.readViewport(ctx); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} buffers + * @param {number=} target + */ +es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase = function(name, desc, buffers, target) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_buffers = buffers; + this.m_fboTarget = target || gl.FRAMEBUFFER; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var invalidateX = this.getWidth() / 4; + var invalidateY = this.getHeight() / 4; + var invalidateW = this.getWidth() / 2; + var invalidateH = this.getHeight() / 2; + var attachments = getDefaultFBDiscardAttachments(this.m_buffers); + + var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var program = ctx.createProgram(shader); + shader.setColor(ctx, program, [1, 0, 0, 1]); + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]); + ctx.invalidateSubFramebuffer(this.m_fboTarget, attachments, invalidateX, invalidateY, invalidateW, invalidateH); + + // Clear invalidated buffers. + ctx.clearColor(0, 1, 0, 1); + ctx.clearStencil(1); + ctx.scissor(invalidateX, invalidateY, invalidateW, invalidateH); + ctx.enable(gl.SCISSOR_TEST); + ctx.clear(this.m_buffers); + ctx.disable(gl.SCISSOR_TEST); + + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + + shader.setColor(ctx, program, [0, 0, 1, 1]); + rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]); + dst.readViewport(ctx); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} buffers + */ +es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase = function(name, desc, buffers) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_buffers = buffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var attachments = getDefaultFBDiscardAttachments(this.m_buffers); + var invalidateX = this.getWidth() / 4; + var invalidateY = this.getHeight() / 4; + var invalidateW = this.getWidth() / 2; + var invalidateH = this.getHeight() / 2; + + var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var program = ctx.createProgram(shader); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4); + + /** @type {es3fFboTestUtil.GradientShader} */ + var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + + var texShaderID = ctx.createProgram(texShader); + var gradShaderID = ctx.createProgram(gradShader); + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + // Create fbo. + var fbo = ctx.createFramebuffer(); + var tex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, tex); + ctx.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, this.getWidth(), this.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + ctx.bindTexture(gl.TEXTURE_2D, null); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + shader.setColor(ctx, program, [1, 0, 0, 1]); + rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]); + + ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH); + + // Switch to fbo and render gradient into it. + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]); + rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]); + // Restore default fbo. + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + + if ((this.m_buffers & gl.COLOR_BUFFER_BIT) != 0) { + // Color was not preserved - fill with green. + shader.setColor(ctx, program, [0, 1, 0, 1]); + rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]); + } + + // Clear invalidated buffers. + ctx.clearColor(0, 1, 0, 1); + ctx.clearStencil(1); + ctx.scissor(invalidateX, invalidateY, invalidateW, invalidateH); + ctx.enable(gl.SCISSOR_TEST); + ctx.clear(this.m_buffers); + ctx.disable(gl.SCISSOR_TEST); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + ctx.bindTexture(gl.TEXTURE_2D, tex); + + texShader.setUniforms(ctx, texShaderID); + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + + dst.readViewport(ctx); + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + ctx.disable(gl.BLEND); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} colorFmt + * @param {number} depthStencilFmt + * @param {number} invalidateBuffers + */ +es3fFboInvalidateTests.InvalidateFboRenderCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_colorFmt = colorFmt; + this.m_depthStencilFmt = depthStencilFmt; + this.m_invalidateBuffers = invalidateBuffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateFboRenderCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateFboRenderCase.prototype.preCheck = function() { + if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt); + if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt); + return true; // No exception thrown +}; + +es3fFboInvalidateTests.InvalidateFboRenderCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt); + var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null); + var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt); + var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var cBias = colorFmtInfo.valueMin; + var cScale = deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin); + var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var attachments = getFBODiscardAttachments(this.m_invalidateBuffers); + var flatShaderID = ctx.createProgram(flatShader); + + // Create fbo. + var colorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_colorFmt, this.getWidth(), this.getHeight()); + + if (this.m_depthStencilFmt != gl.NONE) { + var depthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_depthStencilFmt, this.getWidth(), this.getHeight()); + } + + var fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + + if (depth) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + if (stencil) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([1, 0, 0, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, -1], [1, 1, 1]); + + ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments); + + if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) { + // Color was not preserved - fill with green. + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 1, 0, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + } + + if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) { + // Depth was not preserved. + ctx.depthFunc(gl.ALWAYS); + } + + if ((this.m_invalidateBuffers & gl.STENCIL_BUFFER_BIT) == 0) { + // Stencil was preserved. + ctx.stencilFunc(gl.EQUAL, 1, 0xff); + } + + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 0, 1, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]); + + es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.getWidth(), this.getHeight(), colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} colorFmt + * @param {number} depthStencilFmt + * @param {number} invalidateBuffers + */ +es3fFboInvalidateTests.InvalidateFboUnbindReadCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_colorFmt = colorFmt; + this.m_depthStencilFmt = depthStencilFmt; + this.m_invalidateBuffers = invalidateBuffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateFboUnbindReadCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateFboUnbindReadCase.prototype.preCheck = function() { + if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt); + if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt); + return true; // No exception thrown +}; + +es3fFboInvalidateTests.InvalidateFboUnbindReadCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt); + var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null); + var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt); + var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var attachments = getFBODiscardAttachments(this.m_invalidateBuffers); + // Create fbo. + var transferFmt = gluTextureUtil.getTransferFormat(colorFmt); + var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + var gradShaderID = ctx.createProgram(gradShader); + + var colorTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, colorTex); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_colorFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + + if (this.m_depthStencilFmt != gl.NONE) { + transferFmt = gluTextureUtil.getTransferFormat(depthStencilFmt); + + var depthStencilTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_depthStencilFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + } + + var fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTex, 0); + + if (depth) + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0); + + if (stencil) + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0); + + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + gradShader.setGradient(ctx, gradShaderID, colorFmtInfo.valueMin, colorFmtInfo.valueMax); + rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, -1], [1, 1, 1]); + + ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + + if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) { + // Render color. + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluTextureUtil.getSampler2DType(colorFmt)], gluShaderUtil.DataType.FLOAT_VEC4); + var texShaderID = ctx.createProgram(texShader); + + texShader.setTexScaleBias(0, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias); + texShader.setUniforms(ctx, texShaderID); + + ctx.bindTexture(gl.TEXTURE_2D, colorTex); + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + } else { + // Render depth. + texShader = new es3fFboTestUtil.Texture2DShader( + [gluTextureUtil.getSampler2DType(depthStencilFmt)], gluShaderUtil.DataType.FLOAT_VEC4); + texShaderID = ctx.createProgram(texShader); + + texShader.setUniforms(ctx, texShaderID); + + ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex); + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + } + + dst.readViewport(ctx); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} numSamples + * @param {number} invalidateBuffers + */ +es3fFboInvalidateTests.InvalidateFboUnbindBlitCase = function(name, desc, numSamples, invalidateBuffers) { +// \note Use fullscreen viewport when multisampling - we can't allow GLES3Context do its +// behing-the-scenes viewport position randomization, because with glBlitFramebuffer, +// source and destination rectangles must match when multisampling. + es3fFboTestCase.FboTestCase.call(this, name, desc, numSamples > 0); + this.m_numSamples = numSamples; + this.m_colorFmt = getCompatibleColorFormat(); + this.m_depthStencilFmt = getCompatibleDepthStencilFormat(); + this.m_invalidateBuffers = invalidateBuffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateFboUnbindBlitCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateFboUnbindBlitCase.prototype.preCheck = function() { + if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt); + if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt); + return true; // No exception thrown +}; + +es3fFboInvalidateTests.InvalidateFboUnbindBlitCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var quadSizePixels = [this.m_numSamples == 0 ? this.getWidth() : Math.min(128, this.getWidth()), + this.m_numSamples == 0 ? this.getHeight() : Math.min(128, this.getHeight())]; + var quadNDCLeftBottomXY = [-1, -1]; + var quadNDCSize = [2 * quadSizePixels[0] / this.getWidth(), 2 * quadSizePixels[1] / this.getHeight()]; + var quadNDCRightTopXY = deMath.add(quadNDCLeftBottomXY, quadNDCSize); + var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null); + var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var attachments = getFBODiscardAttachments(this.m_invalidateBuffers); + var flatShaderID = ctx.createProgram(flatShader); + + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + // Create fbo. + var colorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_colorFmt, quadSizePixels[0], quadSizePixels[1]); + + if (this.m_depthStencilFmt != gl.NONE) { + var depthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_depthStencilFmt, quadSizePixels[0], quadSizePixels[1]); + } + + var fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + + if (depth) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + if (stencil) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + flatShader.setColor(ctx, flatShaderID, [1, 0, 0, 1]); + rrUtil.drawQuad(ctx, flatShaderID, + [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], -1], + [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 1]); + + ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments); + + // Set default framebuffer as draw framebuffer and blit preserved buffers. + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null); + ctx.blitFramebuffer(0, 0, quadSizePixels[0], quadSizePixels[1], + 0, 0, quadSizePixels[0], quadSizePixels[1], + (gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT) & ~this.m_invalidateBuffers, gl.NEAREST); + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, null); + + if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) { + // Color was not preserved - fill with green. + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + + flatShader.setColor(ctx, flatShaderID, [0, 1, 0, 1]); + rrUtil.drawQuad(ctx, flatShaderID, + [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0], + [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + } + + if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) { + // Depth was not preserved. + ctx.depthFunc(gl.ALWAYS); + } + + if ((this.m_invalidateBuffers & gl.STENCIL_BUFFER_BIT) == 0) { + // Stencil was preserved. + ctx.stencilFunc(gl.EQUAL, 1, 0xff); + } + + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + + flatShader.setColor(ctx, flatShaderID, [0, 0, 1, 1]); + rrUtil.drawQuad(ctx, flatShaderID, + [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0], + [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]); + + dst.readViewport(ctx, [0, 0, quadSizePixels[0], quadSizePixels[1]]); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} colorFmt + * @param {number} depthStencilFmt + * @param {number} invalidateBuffers + */ +es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_colorFmt = colorFmt; + this.m_depthStencilFmt = depthStencilFmt; + this.m_invalidateBuffers = invalidateBuffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase.prototype.preCheck = function() { + if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt); + if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt); + return true; // No exception thrown +}; + +es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase.prototype.compare = function(reference, result) { + var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_colorFmt), new tcuRGBA.RGBA([12, 12, 12, 12])); + return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold); +}; + +es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt); + var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null); + var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt); + var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var attachments = getFBODiscardAttachments(this.m_invalidateBuffers); + // Create fbo. + var transferFmt = gluTextureUtil.getTransferFormat(colorFmt); + var gradShader = new es3fFboTestUtil.GradientShader(es3fFboTestUtil.getFragmentOutputType(colorFmt)); + var gradShaderID = ctx.createProgram(gradShader); + var invalidateX = 0; + var invalidateY = 0; + var invalidateW = this.getWidth() / 2; + var invalidateH = this.getHeight(); + var readX = invalidateW; + var readY = 0; + var readW = this.getWidth() / 2; + var readH = this.getHeight(); + + var colorTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, colorTex); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_colorFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + + if (this.m_depthStencilFmt != gl.NONE) { + transferFmt = gluTextureUtil.getTransferFormat(depthStencilFmt); + + var depthStencilTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_depthStencilFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + } + + var fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTex, 0); + + if (depth) + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0); + + if (stencil) + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0); + + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + this.clearColorBuffer(colorFmt, [0.0, 0.0, 0.0, 1.0]); + ctx.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + gradShader.setGradient(ctx, gradShaderID, colorFmtInfo.valueMin, colorFmtInfo.valueMax); + rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, -1], [1, 1, 1]); + + ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + + ctx.clearColor(0.25, 0.5, 0.75, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + // Limit read area using scissor. + ctx.scissor(readX, readY, readW, readH); + ctx.enable(gl.SCISSOR_TEST); + + if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) { + // Render color. + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluTextureUtil.getSampler2DType(colorFmt)], gluShaderUtil.DataType.FLOAT_VEC4); + var texShaderID = ctx.createProgram(texShader); + + texShader.setTexScaleBias(0, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias); + texShader.setUniforms(ctx, texShaderID); + + ctx.bindTexture(gl.TEXTURE_2D, colorTex); + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + } else { + // Render depth. + texShader = new es3fFboTestUtil.Texture2DShader( + [gluTextureUtil.getSampler2DType(depthStencilFmt)], gluShaderUtil.DataType.FLOAT_VEC4); + texShaderID = ctx.createProgram(texShader); + + texShader.setUniforms(ctx, texShaderID); + + ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex); + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + } + + dst.readViewport(ctx); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} colorFmt + * @param {number} depthStencilFmt + * @param {number} invalidateBuffers + */ +es3fFboInvalidateTests.InvalidateSubFboRenderCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_colorFmt = colorFmt; + this.m_depthStencilFmt = depthStencilFmt; + this.m_invalidateBuffers = invalidateBuffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateSubFboRenderCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateSubFboRenderCase.prototype.preCheck = function() { + if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt); + if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt); + return true; // No exception thrown +}; + +es3fFboInvalidateTests.InvalidateSubFboRenderCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt); + var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null); + var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt); + var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var cBias = colorFmtInfo.valueMin; + var cScale = deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin); + var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var attachments = getFBODiscardAttachments(this.m_invalidateBuffers); + var flatShaderID = ctx.createProgram(flatShader); + var invalidateX = this.getWidth() / 4; + var invalidateY = this.getHeight() / 4; + var invalidateW = this.getWidth() / 2; + var invalidateH = this.getHeight() / 2; + + // Create fbo. + var colorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_colorFmt, this.getWidth(), this.getHeight()); + + if (this.m_depthStencilFmt != gl.NONE) { + var depthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_depthStencilFmt, this.getWidth(), this.getHeight()); + } + + var fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + + if (depth) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + if (stencil) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.clearBufferfv(gl.COLOR, 0, deMath.add(deMath.multiply([0, 0, 0, 1], cScale), cBias)); + ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1, 0); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([1, 0, 0, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, -1], [1, 1, 1]); + + ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH); + + // Clear invalidated buffers. + ctx.scissor(invalidateX, invalidateY, invalidateW, invalidateH); + ctx.enable(gl.SCISSOR_TEST); + + if (this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) + ctx.clearBufferfv(gl.COLOR, 0, deMath.add(deMath.multiply([0, 1, 0, 1], cScale), cBias)); + + ctx.clear(this.m_invalidateBuffers & ~gl.COLOR_BUFFER_BIT); + ctx.disable(gl.SCISSOR_TEST); + + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 0, 1, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]); + + es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.getWidth(), this.getHeight(), colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} numSamples + * @param {number} invalidateBuffers + */ +es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase = function(name, desc, numSamples, invalidateBuffers) { +// \note Use fullscreen viewport when multisampling - we can't allow GLES3Context do its +// behing-the-scenes viewport position randomization, because with glBlitFramebuffer, +// source and destination rectangles must match when multisampling. + es3fFboTestCase.FboTestCase.call(this, name, desc, numSamples > 0); + this.m_numSamples = numSamples; + this.m_colorFmt = getCompatibleColorFormat(); + this.m_depthStencilFmt = getCompatibleDepthStencilFormat(); + this.m_invalidateBuffers = invalidateBuffers; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase.prototype.preCheck = function() { + if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt); + if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt); + return true; // No exception thrown +}; + +es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var quadSizePixels = [this.m_numSamples == 0 ? this.getWidth() : Math.min(128, this.getWidth()), + this.m_numSamples == 0 ? this.getHeight() : Math.min(128, this.getHeight())]; + var quadNDCLeftBottomXY = [-1, -1]; + var quadNDCSize = [2 * quadSizePixels[0] / this.getWidth(), 2 * quadSizePixels[1] / this.getHeight()]; + var quadNDCRightTopXY = deMath.add(quadNDCLeftBottomXY, quadNDCSize); + var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null); + var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var attachments = getFBODiscardAttachments(this.m_invalidateBuffers); + var flatShaderID = ctx.createProgram(flatShader); + var invalidateX = 0; + var invalidateY = 0; + var invalidateW = quadSizePixels[0] / 2; + var invalidateH = quadSizePixels[1]; + var blitX0 = invalidateW; + var blitY0 = 0; + var blitX1 = blitX0 + quadSizePixels[0] / 2; + var blitY1 = blitY0 + quadSizePixels[1]; + + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + // Create fbo. + var colorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_colorFmt, quadSizePixels[0], quadSizePixels[1]); + + if (this.m_depthStencilFmt != gl.NONE) { + var depthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_depthStencilFmt, quadSizePixels[0], quadSizePixels[1]); + } + + var fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + + if (depth) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + if (stencil) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + flatShader.setColor(ctx, flatShaderID, [1, 0, 0, 1]); + rrUtil.drawQuad(ctx, flatShaderID, + [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], -1], + [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 1]); + + ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH); + + // Set default framebuffer as draw framebuffer and blit preserved buffers. + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null); + ctx.blitFramebuffer(blitX0, blitY0, blitX1, blitY1, blitX0, blitY0, blitX1, blitY1, + (gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT) & ~this.m_invalidateBuffers, gl.NEAREST); + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, null); + + if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) { + // Color was not preserved - fill with green. + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + + flatShader.setColor(ctx, flatShaderID, [0, 1, 0, 1]); + rrUtil.drawQuad(ctx, flatShaderID, + [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0], + [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + } + + if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) { + // Depth was not preserved. + ctx.depthFunc(gl.ALWAYS); + } + + if ((this.m_invalidateBuffers & gl.STENCIL_BUFFER_BIT) == 0) { + // Stencil was preserved. + ctx.stencilFunc(gl.EQUAL, 1, 0xff); + } + + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + + flatShader.setColor(ctx, flatShaderID, [0, 0, 1, 1]); + rrUtil.drawQuad(ctx, flatShaderID, + [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0], + [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]); + + dst.readViewport(ctx, [0, 0, quadSizePixels[0], quadSizePixels[1]]); +}; + +/** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} boundTarget + * @param {number} invalidateTarget + * @param {Array} invalidateAttachments + */ +es3fFboInvalidateTests.InvalidateFboTargetCase = function(name, desc, boundTarget, invalidateTarget, invalidateAttachments) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + this.m_boundTarget = boundTarget; + this.m_invalidateTarget = invalidateTarget; + this.m_invalidateAttachments = invalidateAttachments; +}; + +setParentClass(es3fFboInvalidateTests.InvalidateFboTargetCase, es3fFboTestCase.FboTestCase); + +es3fFboInvalidateTests.InvalidateFboTargetCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + var colorFormat = gl.RGBA8; + var depthStencilFormat = gl.DEPTH24_STENCIL8; + var colorFmt = gluTextureUtil.mapGLInternalFormat(colorFormat); + var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt); + var cBias = colorFmtInfo.valueMin; + var cScale = deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin); + var isDiscarded = (this.m_boundTarget == gl.FRAMEBUFFER) || + (this.m_invalidateTarget == gl.FRAMEBUFFER && this.m_boundTarget == gl.DRAW_FRAMEBUFFER) || + (this.m_invalidateTarget == this.m_boundTarget); + var isColorDiscarded = isDiscarded && hasAttachment(this.m_invalidateAttachments, gl.COLOR_ATTACHMENT0); + var isDepthDiscarded = isDiscarded && (hasAttachment(this.m_invalidateAttachments, gl.DEPTH_ATTACHMENT) || hasAttachment(this.m_invalidateAttachments, gl.DEPTH_STENCIL_ATTACHMENT)); + var isStencilDiscarded = isDiscarded && (hasAttachment(this.m_invalidateAttachments, gl.STENCIL_ATTACHMENT) || hasAttachment(this.m_invalidateAttachments, gl.DEPTH_STENCIL_ATTACHMENT)); + + var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var flatShaderID = ctx.createProgram(flatShader); + + // Create fbo. + var colorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.getWidth(), this.getHeight()); + + var depthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, depthStencilFormat, this.getWidth(), this.getHeight()); + + var fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.clearColor(0, 0, 0, 1); + ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([1, 0, 0, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, -1], [1, 1, 1]); + + // Bound FBO to test target and default to other + if (this.m_boundTarget != gl.FRAMEBUFFER) { + // Dummy fbo is used as complemeting target (read when discarding draw for example). + // \note Framework takes care of deleting objects at the end of test case. + var dummyTarget = this.m_boundTarget == gl.DRAW_FRAMEBUFFER ? gl.READ_FRAMEBUFFER : gl.DRAW_FRAMEBUFFER; + + var dummyColorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, dummyColorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 64, 64); + var dummyFbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(dummyTarget, dummyFbo); + ctx.framebufferRenderbuffer(dummyTarget, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dummyColorRbo); + + ctx.bindFramebuffer(this.m_boundTarget, fbo); + } + + ctx.invalidateFramebuffer(this.m_invalidateTarget, this.m_invalidateAttachments); + + if (this.m_boundTarget != gl.FRAMEBUFFER) + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + if (isColorDiscarded) { + // Color was not preserved - fill with green. + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 1, 0, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]); + + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + } + + if (isDepthDiscarded) { + // Depth was not preserved. + ctx.depthFunc(gl.ALWAYS); + } + + if (!isStencilDiscarded) { + // Stencil was preserved. + ctx.stencilFunc(gl.EQUAL, 1, 0xff); + } + + ctx.enable(gl.BLEND); + ctx.blendFunc(gl.ONE, gl.ONE); + ctx.blendEquation(gl.FUNC_ADD); + + flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 0, 1, 1], cScale), cBias)); + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]); + + es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.getWidth(), this.getHeight(), colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias); +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fFboInvalidateTests.FboInvalidateTests = function() { + tcuTestCase.DeqpTest.call(this, 'invalidate', 'Framebuffer invalidate tests'); +}; + +es3fFboInvalidateTests.FboInvalidateTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fFboInvalidateTests.FboInvalidateTests.prototype.constructor = es3fFboInvalidateTests.FboInvalidateTests; + +es3fFboInvalidateTests.FboInvalidateTests.prototype.init = function() { + var defaultFbGroup = new tcuTestCase.DeqpTest('default', 'Default framebuffer invalidate tests'); + this.addChild(defaultFbGroup); + + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_none', 'Invalidating no framebuffers (ref)', 0)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_color', 'Rendering after invalidating colorbuffer', gl.COLOR_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_depth', 'Rendering after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_stencil', 'Rendering after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_depth_stencil', 'Rendering after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_all', 'Rendering after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_color', 'Binding fbo after invalidating colorbuffer', gl.COLOR_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_depth', 'Binding fbo after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_stencil', 'Binding fbo after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_depth_stencil', 'Binding fbo after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_all', 'Binding fbo after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_color', 'Rendering after invalidating colorbuffer', gl.COLOR_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_depth', 'Rendering after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_stencil', 'Rendering after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_depth_stencil', 'Rendering after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_all', 'Rendering after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_color', 'Binding fbo after invalidating colorbuffer', gl.COLOR_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_depth', 'Binding fbo after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_stencil', 'Binding fbo after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_depth_stencil', 'Binding fbo after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_all', 'Binding fbo after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('draw_framebuffer_color', 'Invalidating gl.COLOR in gl.DRAW_FRAMEBUFFER', gl.COLOR_BUFFER_BIT, gl.DRAW_FRAMEBUFFER)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('draw_framebuffer_all', 'Invalidating all in gl.DRAW_FRAMEBUFFER', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.DRAW_FRAMEBUFFER)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('read_framebuffer_color', 'Invalidating gl.COLOR in gl.READ_FRAMEBUFFER', gl.COLOR_BUFFER_BIT, gl.READ_FRAMEBUFFER)); + defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('read_framebuffer_all', 'Invalidating all in gl.READ_FRAMEBUFFER', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.READ_FRAMEBUFFER)); + + // invalidate.whole. + var wholeFboGroup = new tcuTestCase.DeqpTest('whole', 'Invalidating whole framebuffer object'); + this.addChild(wholeFboGroup); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_none', '', gl.RGBA8, gl.DEPTH24_STENCIL8, 0)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_all', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_color_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + + if (getCompatibleDepthStencilFormat() !== gl.NONE) { + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_color', '', 0, gl.COLOR_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_depth', '', 0, gl.DEPTH_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_stencil', '', 0, gl.STENCIL_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_depth_stencil', '', 0, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_color', '', 4, gl.COLOR_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_depth', '', 4, gl.DEPTH_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_stencil', '', 4, gl.STENCIL_BUFFER_BIT)); + wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_depth_stencil', '', 4, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + } + + // invalidate.sub. + var subFboGroup = new tcuTestCase.DeqpTest('sub', 'Invalidating subsection of framebuffer object'); + this.addChild(subFboGroup); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_none', '', gl.RGBA8, gl.DEPTH24_STENCIL8, 0)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_all', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_color_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + + if (getCompatibleDepthStencilFormat() !== gl.NONE) { + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_color', '', 0, gl.COLOR_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_depth', '', 0, gl.DEPTH_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_stencil', '', 0, gl.STENCIL_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_depth_stencil', '', 0, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_color', '', 4, gl.COLOR_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_depth', '', 4, gl.DEPTH_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_stencil', '', 4, gl.STENCIL_BUFFER_BIT)); + subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_depth_stencil', '', 4, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + } + // invalidate.format. + var numFormatSubGroups = 3; + var formatGroup = []; + for (var ii = 0; ii < numFormatSubGroups; ++ii) { + formatGroup[ii] = new tcuTestCase.DeqpTest('format', 'Invalidating framebuffers with selected formats'); + this.addChild(formatGroup[ii]); + } + // Color buffer formats. + var colorFormats = [ + // RGBA formats + gl.RGBA32I, + gl.RGBA32UI, + gl.RGBA16I, + gl.RGBA16UI, + gl.RGBA8, + gl.RGBA8I, + gl.RGBA8UI, + gl.SRGB8_ALPHA8, + gl.RGB10_A2, + gl.RGB10_A2UI, + gl.RGBA4, + gl.RGB5_A1, + + // RGB formats + gl.RGB8, + gl.RGB565, + + // RG formats + gl.RG32I, + gl.RG32UI, + gl.RG16I, + gl.RG16UI, + gl.RG8, + gl.RG8I, + gl.RG8UI, + + // R formats + gl.R32I, + gl.R32UI, + gl.R16I, + gl.R16UI, + gl.R8, + gl.R8I, + gl.R8UI, + + // gl.EXT_color_buffer_float + gl.RGBA32F, + gl.RGBA16F, + gl.R11F_G11F_B10F, + gl.RG32F, + gl.RG16F, + gl.R32F, + gl.R16F + ]; + + // Depth/stencilbuffer formats. + var depthStencilFormats = [ + gl.DEPTH_COMPONENT32F, + gl.DEPTH_COMPONENT24, + gl.DEPTH_COMPONENT16, + gl.DEPTH32F_STENCIL8, + gl.DEPTH24_STENCIL8, + gl.STENCIL_INDEX8 + ]; + + // Colorbuffer tests use invalidate, unbind, read test. + for (var ndx = 0; ndx < colorFormats.length; ndx++) + formatGroup[ndx % numFormatSubGroups].addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase(es3fFboTestUtil.getFormatName(colorFormats[ndx]), '', colorFormats[ndx], gl.NONE, gl.COLOR_BUFFER_BIT)); + + // Depth/stencilbuffer tests use invalidate, render test. + for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) + formatGroup[ndx % numFormatSubGroups].addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase(es3fFboTestUtil.getFormatName(depthStencilFormats[ndx]), '', gl.RGBA8, depthStencilFormats[ndx], gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)); + + // invalidate.target + var targetGroup = new tcuTestCase.DeqpTest('target', 'Invalidate target'); + this.addChild(targetGroup); + + var s_targetCases = [ + ['framebuffer_framebuffer', gl.FRAMEBUFFER, gl.FRAMEBUFFER], + ['framebuffer_read_framebuffer', gl.FRAMEBUFFER, gl.READ_FRAMEBUFFER], + ['framebuffer_draw_framebuffer', gl.FRAMEBUFFER, gl.DRAW_FRAMEBUFFER], + ['read_framebuffer_framebuffer', gl.READ_FRAMEBUFFER, gl.FRAMEBUFFER], + ['read_framebuffer_read_framebuffer', gl.READ_FRAMEBUFFER, gl.READ_FRAMEBUFFER], + ['read_framebuffer_draw_framebuffer', gl.READ_FRAMEBUFFER, gl.DRAW_FRAMEBUFFER], + ['draw_framebuffer_framebuffer', gl.DRAW_FRAMEBUFFER, gl.FRAMEBUFFER], + ['draw_framebuffer_read_framebuffer', gl.DRAW_FRAMEBUFFER, gl.READ_FRAMEBUFFER], + ['draw_framebuffer_draw_framebuffer', gl.DRAW_FRAMEBUFFER, gl.DRAW_FRAMEBUFFER] + ]; + + var colorAttachment = [gl.COLOR_ATTACHMENT0]; + var depthStencilAttachment = [gl.DEPTH_STENCIL_ATTACHMENT]; + var allAttachments = [gl.COLOR_ATTACHMENT0, gl.DEPTH_ATTACHMENT, gl.STENCIL_ATTACHMENT]; + + for (var caseNdx = 0; caseNdx < s_targetCases.length; caseNdx++) { + var baseName = s_targetCases[caseNdx][0]; + var invalidateT = s_targetCases[caseNdx][1]; + var boundT = s_targetCases[caseNdx][1]; + + targetGroup.addChild(new es3fFboInvalidateTests.InvalidateFboTargetCase(baseName + '_color', '', boundT, invalidateT, colorAttachment)); + targetGroup.addChild(new es3fFboInvalidateTests.InvalidateFboTargetCase(baseName + '_depth_stencil', '', boundT, invalidateT, depthStencilAttachment)); + targetGroup.addChild(new es3fFboInvalidateTests.InvalidateFboTargetCase(baseName + '_all', '', boundT, invalidateT, allAttachments)); + } + +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fFboInvalidateTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fFboInvalidateTests.FboInvalidateTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFboInvalidateTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js new file mode 100644 index 000000000..261da0073 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js @@ -0,0 +1,377 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboMultisampleTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('functional.gles3.es3fFboTestCase'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { + +var es3fFboMultisampleTests = functional.gles3.es3fFboMultisampleTests; +var es3fFboTestCase = functional.gles3.es3fFboTestCase; +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var tcuTestCase = framework.common.tcuTestCase; +var tcuSurface = framework.common.tcuSurface; +var tcuRGBA = framework.common.tcuRGBA; +var tcuImageCompare = framework.common.tcuImageCompare; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var deRandom = framework.delibs.debase.deRandom; +var deMath = framework.delibs.debase.deMath; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var rrUtil = framework.referencerenderer.rrUtil; + +/** @type {WebGL2RenderingContext} */ var gl; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + + /** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} colorFormat + * @param {number} depthStencilFormat + * @param {Array} size + * @param {number} numSamples + */ + es3fFboMultisampleTests.BasicFboMultisampleCase = function(name, desc, colorFormat, depthStencilFormat, size, numSamples) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + /** @type {number} */ this.m_colorFormat = colorFormat; + /** @type {number} */ this.m_depthStencilFormat = depthStencilFormat; + /** @type {Array} */ this.m_size = size; + /** @type {number} */ this.m_numSamples = numSamples; + }; + + es3fFboMultisampleTests.BasicFboMultisampleCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype); + es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.constructor = es3fFboMultisampleTests.BasicFboMultisampleCase; + + es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_colorFormat); + if (!this.checkSampleCount(this.m_colorFormat, this.m_numSamples)) + return false; + + if (this.m_depthStencilFormat != gl.NONE) { + this.checkFormatSupport(this.m_depthStencilFormat); + if (!this.checkSampleCount(this.m_depthStencilFormat, this.m_numSamples)) + return false; + } + return true; // No exception thrown + }; + + /** + * @param {tcuSurface.Surface} dst + */ + es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + /** @type {tcuTexture.TextureFormat} */ var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFormat); + /** @type {tcuTexture.TextureFormat} */ var depthStencilFmt = this.m_depthStencilFormat != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFormat) : new tcuTexture.TextureFormat(null, null); + /** @type {tcuTextureUtil.TextureFormatInfo} */ var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt); + /** @type {boolean} */ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + /** @type {boolean} */ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS; + /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(es3fFboTestUtil.getFragmentOutputType(colorFmt)); + /** @type {es3fFboTestUtil.FlatColorShader} */ var flatShader = new es3fFboTestUtil.FlatColorShader(es3fFboTestUtil.getFragmentOutputType(colorFmt)); + var gradShaderID = this.getCurrentContext().createProgram(gradShader); + var flatShaderID = this.getCurrentContext().createProgram(flatShader); + var msaaFbo = null; + var resolveFbo = null; + var msaaColorRbo = null; + var resolveColorRbo = null; + var msaaDepthStencilRbo = null; + var resolveDepthStencilRbo = null; + + // Create framebuffers. + msaaColorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, msaaColorRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_colorFormat, this.m_size[0], this.m_size[1]); + + if (depth || stencil) { + msaaDepthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, msaaDepthStencilRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_depthStencilFormat, this.m_size[0], this.m_size[1]); + } + + msaaFbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, msaaFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, msaaColorRbo); + if (depth) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, msaaDepthStencilRbo); + if (stencil) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, msaaDepthStencilRbo); + + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + resolveColorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, resolveColorRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, this.m_colorFormat, this.m_size[0], this.m_size[1]); + + if (depth || stencil) { + resolveDepthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, resolveDepthStencilRbo); + ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, this.m_depthStencilFormat, this.m_size[0], this.m_size[1]); + } + + resolveFbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, resolveFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, resolveColorRbo); + if (depth) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, resolveDepthStencilRbo); + if (stencil) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, resolveDepthStencilRbo); + + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, msaaFbo); + ctx.viewport(0, 0, this.m_size[0], this.m_size[1]); + + // Clear depth and stencil buffers. + ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0); + + // Fill MSAA fbo with gradient, depth = [-1..1] + ctx.enable(gl.DEPTH_TEST); + gradShader.setGradient(this.getCurrentContext(), gradShaderID, colorFmtInfo.valueMin, colorFmtInfo.valueMax); + + rrUtil.drawQuad(this.getCurrentContext(), gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + // Render random-colored quads. + /** @const {number} */ var numQuads = 8; + + // The choice of random seed affects the correctness of the tests, + // because there are some boundary conditions which aren't handled + // correctly even in the C++ dEQP tests. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(7); + + ctx.depthFunc(gl.ALWAYS); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilFunc(gl.ALWAYS, 0, 0xff); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + + for (var ndx = 0; ndx < numQuads; ndx++) { + /** @type {number} */ var r = rnd.getFloat(); + /** @type {number} */ var g = rnd.getFloat(); + /** @type {number} */ var b = rnd.getFloat(); + /** @type {number} */ var a = rnd.getFloat(); + /** @type {number} */ var x0 = rnd.getFloat(-1.0, 1.0); + /** @type {number} */ var y0 = rnd.getFloat(-1.0, 1.0); + /** @type {number} */ var z0 = rnd.getFloat(-1.0, 1.0); + /** @type {number} */ var x1 = rnd.getFloat(-1.0, 1.0); + /** @type {number} */ var y1 = rnd.getFloat(-1.0, 1.0); + /** @type {number} */ var z1 = rnd.getFloat(-1.0, 1.0); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, deMath.add(deMath.multiply([r, g, b, a], deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin)), colorFmtInfo.valueMin)); + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [x0, y0, z0], [x1, y1, z1]); + } + + ctx.disable(gl.DEPTH_TEST); + ctx.disable(gl.STENCIL_TEST); + this.checkError(); + + // Resolve using glBlitFramebuffer(). + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, resolveFbo); + ctx.blitFramebuffer(0, 0, this.m_size[0], this.m_size[1], 0, 0, this.m_size[0], this.m_size[1], gl.COLOR_BUFFER_BIT | (depth ? gl.DEPTH_BUFFER_BIT : 0) | (stencil ? gl.STENCIL_BUFFER_BIT : 0), gl.NEAREST); + + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, resolveFbo); + + /** @type {number} */ var numSteps; + /** @type {number} */ var step; + /** @type {number} */ var d; + /** @type {number} */ var c; + /** @type {number} */ var s; + if (depth) { + // Visualize depth. + numSteps = 8; + step = 2.0 / numSteps; + ctx.enable(gl.DEPTH_TEST); + ctx.depthFunc(gl.LESS); + ctx.depthMask(false); + ctx.colorMask(false, false, true, false); + + for (var ndx = 0; ndx < numSteps; ndx++) { + d = -1.0 + step * ndx; + c = ndx / (numSteps - 1); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, deMath.add(deMath.multiply([0.0, 0.0, c, 1.0], deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin)), colorFmtInfo.valueMin)); + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, d], [1.0, 1.0, d]); + } + + ctx.disable(gl.DEPTH_TEST); + } + + if (stencil) { + // Visualize stencil. + numSteps = 4; + step = 1; + + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + ctx.colorMask(false, true, false, false); + + for (var ndx = 0; ndx < numSteps; ndx++) { + s = step * ndx; + c = ndx / (numSteps - 1); + + ctx.stencilFunc(gl.EQUAL, s, 0xff); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, deMath.add(deMath.multiply([0.0, c, 0.0, 1.0], deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin)), colorFmtInfo.valueMin)); + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + } + + ctx.disable(gl.STENCIL_TEST); + } + + this.readPixelsUsingFormat(dst, 0, 0, this.m_size[0], this.m_size[1], colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias); + }; + + /** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @return {boolean} + */ + es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.colorCompare = function(reference, result) { + /** @const {tcuRGBA.RGBA} */ var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_colorFormat), tcuRGBA.newRGBAComponents(12, 12, 12, 12)); + return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold, tcuImageCompare.CompareLogMode.RESULT); + }; + + /** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @return {boolean} + */ + es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.compare = function(reference, result) { + if (this.m_depthStencilFormat != gl.NONE) + return es3fFboTestCase.FboTestCase.prototype.compare(reference, result); // FboTestCase.compare + else + return this.colorCompare(reference, result); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fFboMultisampleTests.FboMultisampleTests = function() { + tcuTestCase.DeqpTest.call(this, 'msaa', 'Multisample FBO tests'); + }; + + es3fFboMultisampleTests.FboMultisampleTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFboMultisampleTests.FboMultisampleTests.prototype.constructor = es3fFboMultisampleTests.FboMultisampleTests; + + es3fFboMultisampleTests.FboMultisampleTests.prototype.init = function() { + /** @const {Array} */ var colorFormats = [ + // RGBA formats + gl.RGBA8, + gl.SRGB8_ALPHA8, + gl.RGB10_A2, + gl.RGBA4, + gl.RGB5_A1, + + // RGB formats + gl.RGB8, + gl.RGB565, + + // RG formats + gl.RG8, + + // R formats + gl.R8, + + // gl.EXT_color_buffer_float + // Multi-sample floating-point color buffers can be optional supported, see https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/ + gl.RGBA32F, + gl.RGBA16F, + gl.R11F_G11F_B10F, + gl.RG32F, + gl.RG16F, + gl.R32F, + gl.R16F + ]; + + /** @const {Array} */ var depthStencilFormats = [ + gl.DEPTH_COMPONENT32F, + gl.DEPTH_COMPONENT24, + gl.DEPTH_COMPONENT16, + gl.DEPTH32F_STENCIL8, + gl.DEPTH24_STENCIL8, + gl.STENCIL_INDEX8 + ]; + + /** @const {Array} */ var sampleCounts = [2, 4, 8]; + + for (var sampleCntNdx in sampleCounts) { + /** @type {number} */ var samples = sampleCounts[sampleCntNdx]; + /** @type {tcuTestCase.DeqpTest} */ + var sampleCountGroup = tcuTestCase.newTest(samples + '_samples', ''); + this.addChild(sampleCountGroup); + + // Color formats. + for (var fmtNdx in colorFormats) + sampleCountGroup.addChild(new es3fFboMultisampleTests.BasicFboMultisampleCase(es3fFboTestUtil.getFormatName(colorFormats[fmtNdx]), '', colorFormats[fmtNdx], gl.NONE, [119, 131], samples)); + + // Depth/stencil formats. + for (var fmtNdx in depthStencilFormats) + sampleCountGroup.addChild(new es3fFboMultisampleTests.BasicFboMultisampleCase(es3fFboTestUtil.getFormatName(depthStencilFormats[fmtNdx]), '', gl.RGBA8, depthStencilFormats[fmtNdx], [119, 131], samples)); + } + }; + + es3fFboMultisampleTests.run = function(context, range) { + gl = context; + //Set up root Test + var state = tcuTestCase.runner; + + var test = new es3fFboMultisampleTests.FboMultisampleTests(); + var testName = test.fullName(); + var testDescription = test.getDescription(); + + state.testName = testName; + state.setRoot(test); + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + test.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFboMultisampleTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js new file mode 100644 index 000000000..78229de44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js @@ -0,0 +1,2389 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboRenderTest'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { + + var es3fFboRenderTest = functional.gles3.es3fFboRenderTest; + var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuLogImage = framework.common.tcuLogImage; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuRGBA = framework.common.tcuRGBA; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + var deUtil = framework.delibs.debase.deUtil; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var sglrReferenceContext = + framework.opengl.simplereference.sglrReferenceContext; + var rrUtil = framework.referencerenderer.rrUtil; + + /** @type {WebGL2RenderingContext} */ var gl; + + /** + * @constructor + * @param {number=} buffers_ + * @param {number=} colorType_ + * @param {number=} colorFormat_ + * @param {number=} depthStencilType_ + * @param {number=} depthStencilFormat_ + * @param {number=} width_ + * @param {number=} height_ + * @param {number=} samples_ + */ + es3fFboRenderTest.FboConfig = function( + buffers_, colorType_, colorFormat_, depthStencilType_, + depthStencilFormat_, width_, height_, samples_ + ) { + // Buffer bit mask (gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|...) + this.buffers = buffers_ ? buffers_ : 0; + // gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP, gl.RENDERBUFFER + this.colorType = colorType_ ? colorType_ : gl.NONE; + // Internal format for color buffer texture or renderbuffer + this.colorFormat = colorFormat_ ? colorFormat_ : gl.NONE; + this.depthStencilType = depthStencilType_? + depthStencilType_ : gl.NONE; + this.depthStencilFormat = depthStencilFormat_ ? + depthStencilFormat_ : gl.NONE; + this.width = width_ ? width_ : 0; + this.height = height_ ? height_ : 0; + this.samples = samples_? samples_ : 0; + }; + + /** + * @param {number} type + * @return {string} + */ + es3fFboRenderTest.getTypeName = function(type) { + switch (type) { + case gl.TEXTURE_2D: return 'tex2d'; + case gl.RENDERBUFFER: return 'rbo'; + default: + testFailed('Unknown type'); + } + return 'Should not get to this point'; + }; + + /** + * @return {string} + */ + es3fFboRenderTest.FboConfig.prototype.getName = function() { + var name = ''; + + assertMsgOptions((this.buffers & gl.COLOR_BUFFER_BIT) != 0, + 'Color buffer is not specified', false, true); + + name += es3fFboRenderTest.getTypeName(this.colorType) + '_' + + es3fFboTestUtil.getFormatName(this.colorFormat); + + if (this.buffers & gl.DEPTH_BUFFER_BIT) + name += '_depth'; + if (this.buffers & gl.STENCIL_BUFFER_BIT) + name += '_stencil'; + + if (this.buffers & (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) + name += '_' + es3fFboRenderTest.getTypeName(this.depthStencilType) + + '_' + es3fFboTestUtil.getFormatName(this.depthStencilFormat); + + return name; + }; + + /** + * @param {number} format + * @return {Array} + */ + es3fFboRenderTest.getEnablingExtensions = function(format) { + /** @type {Array} */ var out = []; + + switch (format) { + case gl.RGB16F: + assertMsgOptions(false, "Not part of the tested formats", false, true); + break; + + case gl.RGBA16F: + case gl.RG16F: + case gl.R16F: + case gl.RGBA32F: + case gl.RGB32F: + case gl.R11F_G11F_B10F: + case gl.RG32F: + case gl.R32F: + out.push('EXT_color_buffer_float'); + + default: + break; + } + + return out; + }; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {string} name + * @return {*} + */ + es3fFboRenderTest.isExtensionSupported = function(context, name) { + return context.getExtension(name); + }; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {Array} requiredExts + * @return {boolean} + */ + es3fFboRenderTest.isAnyExtensionSupported = function( + context, requiredExts) { + + if (!requiredExts || requiredExts.length == 0) + return true; + + for (var extNdx = 0; extNdx < requiredExts.length; extNdx++) { + var extension = requiredExts[extNdx]; + + if (es3fFboRenderTest.isExtensionSupported(context, extension)) + return true; + } + + return false; + }; + + /** + * @param {Array} list + * @param {string} sep + * @return {string} + */ + es3fFboRenderTest.join = function(list, sep) { + var out = ''; + + for (var elemNdx = 0; elemNdx < list.length; elemNdx++) { + if (elemNdx != 0) + out += sep; + out += list[elemNdx]; + } + + return out; + }; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {number} sizedFormat + */ + es3fFboRenderTest.checkColorFormatSupport = function(context, sizedFormat) { + /** @type {Array} */ var requiredExts = + es3fFboRenderTest.getEnablingExtensions(sizedFormat); + + if (!es3fFboRenderTest.isAnyExtensionSupported(context, requiredExts)) { + var errMsg = 'Format not supported, requires ' + ( + (requiredExts.length == 1) ? requiredExts[0] : + ' one of the following: ' + + requiredExts.join(', ') + ); + checkMessage(false, errMsg); + + throw new TestFailedException(errMsg); + } + }; + + /** + * @constructor + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {es3fFboRenderTest.FboConfig} config + * @param {number} width + * @param {number} height + * @param {sglrReferenceContext.AnyFramebuffer=} fbo + * @param {sglrReferenceContext.AnyRenderbuffer=} colorBufferName + * @param {sglrReferenceContext.AnyRenderbuffer=} depthStencilBufferName + */ + es3fFboRenderTest.Framebuffer = function( + context, config, width, height, fbo, + colorBufferName, depthStencilBufferName) { + + this.m_config = config; + this.m_context = context; + this.m_framebuffer = fbo ? fbo : null; + this.m_colorBuffer = colorBufferName ? colorBufferName : null; + this.m_depthStencilBuffer = depthStencilBufferName ? + depthStencilBufferName : null; + + // Verify that color format is supported + es3fFboRenderTest.checkColorFormatSupport(context, config.colorFormat); + + if (!this.m_framebuffer) + this.m_framebuffer = context.createFramebuffer(); + context.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + + if (this.m_config.buffers & (gl.COLOR_BUFFER_BIT)) { + switch (this.m_config.colorType) { + case gl.TEXTURE_2D: + this.m_colorBuffer = this.createTex2D( + /** @type {WebGLTexture} */ (colorBufferName), + this.m_config.colorFormat, width, height + ); + + context.framebufferTexture2D( + gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, this.m_colorBuffer, 0 + ); + + break; + + case gl.RENDERBUFFER: + this.m_colorBuffer = this.createRbo( + /** @type {WebGLRenderbuffer} */ (colorBufferName), + this.m_config.colorFormat, width, height + ); + + context.framebufferRenderbuffer( + gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.RENDERBUFFER, this.m_colorBuffer + ); + + break; + + default: + testFailed('Unsupported type'); + } + } + + if (this.m_config.buffers & + (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) { + + switch (this.m_config.depthStencilType) { + case gl.TEXTURE_2D: + this.m_depthStencilBuffer = this.createTex2D( + /** @type {WebGLTexture} */ + (depthStencilBufferName), + this.m_config.depthStencilFormat, width, height + ); + break; + case gl.RENDERBUFFER: + this.m_depthStencilBuffer = this.createRbo( + /** @type {WebGLRenderbuffer} */ + (depthStencilBufferName), + this.m_config.depthStencilFormat, width, height + ); + break; + + default: + testFailed('Unsupported type'); + } + } + + for (var ndx = 0; ndx < 2; ndx++) { + var bit = ndx ? gl.STENCIL_BUFFER_BIT : gl.DEPTH_BUFFER_BIT; + var point = ndx ? gl.STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT; + + if ((this.m_config.buffers & bit) == 0) + continue; /* Not used. */ + + switch (this.m_config.depthStencilType) { + case gl.TEXTURE_2D: + context.framebufferTexture2D( + gl.FRAMEBUFFER, point, gl.TEXTURE_2D, + this.m_depthStencilBuffer, 0 + ); + break; + case gl.RENDERBUFFER: + context.framebufferRenderbuffer( + gl.FRAMEBUFFER, point, + gl.RENDERBUFFER, this.m_depthStencilBuffer + ); + break; + default: + throw new Error('Invalid depth stencil type'); + } + } + + context.bindFramebuffer(gl.FRAMEBUFFER, null); + }; + + /** + * @return {es3fFboRenderTest.FboConfig} + */ + es3fFboRenderTest.Framebuffer.prototype.getConfig = function() { + return this.m_config; + }; + + /** + * @return {?sglrReferenceContext.AnyFramebuffer} + */ + es3fFboRenderTest.Framebuffer.prototype.getFramebuffer = function() { + return this.m_framebuffer; + }; + + /** + * @return {?sglrReferenceContext.AnyRenderbuffer} + */ + es3fFboRenderTest.Framebuffer.prototype.getColorBuffer = function() { + return this.m_colorBuffer; + }; + + /** + * @return {?sglrReferenceContext.AnyRenderbuffer} + */ + es3fFboRenderTest.Framebuffer.prototype.getDepthStencilBuffer = function() { + return this.m_depthStencilBuffer; + }; + + /** + * deinit + */ + es3fFboRenderTest.Framebuffer.prototype.deinit = function() { + this.m_context.deleteFramebuffer( + /** @type {WebGLFramebuffer} */ (this.m_framebuffer) + ); + this.destroyBuffer(this.m_colorBuffer, this.m_config.colorType); + this.destroyBuffer( + this.m_depthStencilBuffer, this.m_config.depthStencilType + ); + }; + + /** + * checkCompleteness + */ + es3fFboRenderTest.Framebuffer.prototype.checkCompleteness = function() { + this.m_context.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + var status = this.m_context.checkFramebufferStatus(gl.FRAMEBUFFER); + this.m_context.bindFramebuffer(gl.FRAMEBUFFER, null); + if (status != gl.FRAMEBUFFER_COMPLETE) + throw new es3fFboTestUtil.FboIncompleteException(status); + }; + + /** + * @param {?WebGLTexture|sglrReferenceContext.TextureContainer} name + * @param {number} format + * @param {number} width + * @param {number} height + * @return {?WebGLTexture|sglrReferenceContext.TextureContainer} + */ + es3fFboRenderTest.Framebuffer.prototype.createTex2D = function( + name, format, width, height) { + + if (!name) + name = this.m_context.createTexture(); + + this.m_context.bindTexture(gl.TEXTURE_2D, name); + this.m_context.texImage2DDelegate( + gl.TEXTURE_2D, 0, format, width, height + ); + + if (!deMath.deIsPowerOfTwo32(width) || + !deMath.deIsPowerOfTwo32(height)) { + + // Set wrap mode to clamp for NPOT FBOs + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE + ); + } + + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST + ); + + return name; + }; + + /** + * @param {?WebGLRenderbuffer|sglrReferenceContext.Renderbuffer} name + * @param {number} format + * @param {number} width + * @param {number} height + * @return {?WebGLRenderbuffer|sglrReferenceContext.Renderbuffer} + */ + es3fFboRenderTest.Framebuffer.prototype.createRbo = function( + name, format, width, height) { + + if (!name) + name = this.m_context.createRenderbuffer(); + + this.m_context.bindRenderbuffer(gl.RENDERBUFFER, name); + this.m_context.renderbufferStorage( + gl.RENDERBUFFER, format, width, height + ); + + return name; + }; + + /** + * @param {?sglrReferenceContext.AnyRenderbuffer} name + * @param {number} type + */ + es3fFboRenderTest.Framebuffer.prototype.destroyBuffer = function( + name, type) { + + if (type == gl.TEXTURE_2D || type == gl.TEXTURE_CUBE_MAP) + this.m_context.deleteTexture(/** @type {?WebGLTexture} */ (name)); + else if (type == gl.RENDERBUFFER) + this.m_context.deleteRenderbuffer( + /** @type {?WebGLRenderbuffer} */ (name) + ); + else + assertMsgOptions( + type == gl.NONE, 'Invalid buffer type', false, true + ); + }; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {WebGLTexture|sglrReferenceContext.TextureContainer} name + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + */ + es3fFboRenderTest.createMetaballsTex2D = function( + context, name, format, dataType, width, height) { + + /** @type {tcuTexture.TextureFormat} */ var texFormat = + gluTextureUtil.mapGLTransferFormat(format, dataType); + /** @type {tcuTexture.TextureLevel} */ var level = + new tcuTexture.TextureLevel(texFormat, width, height); + + tcuTextureUtil.fillWithMetaballs( + level.getAccess(), 5, /*name ^*/ width ^ height + ); + + context.bindTexture(gl.TEXTURE_2D, name); + context.texImage2D( + gl.TEXTURE_2D, 0, format, width, height, 0, format, + dataType, level.getAccess().getDataPtr() + ); + context.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + }; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {WebGLTexture|sglrReferenceContext.TextureContainer} name + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + */ + es3fFboRenderTest.createQuadsTex2D = function( + context, name, format, dataType, width, height) { + + /** @type {tcuTexture.TextureFormat} */ + var texFormat = gluTextureUtil.mapGLTransferFormat(format, dataType); + /** @type {tcuTexture.TextureLevel} */ + var level = new tcuTexture.TextureLevel(texFormat, width, height); + + tcuTextureUtil.fillWithRGBAQuads(level.getAccess()); + + context.bindTexture(gl.TEXTURE_2D, name); + context.texImage2D( + gl.TEXTURE_2D, 0, format, width, height, 0, + format, dataType, level.getAccess().getDataPtr() + ); + context.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {es3fFboRenderTest.FboConfig} config + */ + es3fFboRenderTest.FboRenderCase = function(name, description, config) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_config = config; + }; + + es3fFboRenderTest.FboRenderCase.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + + es3fFboRenderTest.FboRenderCase.prototype.constructor = + es3fFboRenderTest.FboRenderCase; + + /** + * Must be overridden + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * fboContext + * @param {tcuSurface.Surface} dst + */ + es3fFboRenderTest.FboRenderCase.prototype.render = function( + fboContext, dst) { + throw new Error('Must override'); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fFboRenderTest.FboRenderCase.prototype.iterate = function() { + var clearColor = [0.125, 0.25, 0.5, 1.0]; + /** @type {?string} */ var failReason = ""; + + // Position & size for context + var rnd = new deRandom.deRandom(); + deRandom.deRandom_init(rnd, deString.deStringHash(this.fullName())); + + var width = Math.min(gl.canvas.width, 128); + var height = Math.min(gl.canvas.height, 128); + var xMax = gl.canvas.width - width + 1; + var yMax = gl.canvas.height - height + 1; + var x = Math.abs(deRandom.deRandom_getInt(rnd)) % xMax; + var y = Math.abs(deRandom.deRandom_getInt(rnd)) % yMax; + + /** @type {tcuSurface.Surface} */ + var gles3Frame = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ + var refFrame = new tcuSurface.Surface(width, height); + + /** @type {number} */ var gles3Error = 0; + /** @type {number} */ var refError = 0; + + // Render using GLES3 + /** + * @type {sglrGLContext.GLContext| + * sglrReferenceContext.ReferenceContext} + */ + var context; + + try { + context = new sglrGLContext.GLContext(gl, [x, y, width, height]); + + context.clearColor( + clearColor[0], clearColor[1], clearColor[2], clearColor[3] + ); + + context.clear( + gl.COLOR_BUFFER_BIT | + gl.DEPTH_BUFFER_BIT | + gl.STENCIL_BUFFER_BIT + ); + + this.render(context, gles3Frame); // Call actual render func + gles3Error = context.getError(); + } + catch (e) { + if (e instanceof es3fFboTestUtil.FboIncompleteException) { + e.message = WebGLTestUtils.glEnumToString(gl, e.getReason()); + if(e.getReason() == gl.FRAMEBUFFER_UNSUPPORTED) { + // Mark test case as unsupported + bufferedLogToConsole(e + ': ' + e.message); + testFailed('Not supported'); + return tcuTestCase.IterateResult.STOP; + } + } + + // Propagate error + throw e; + } + + // Render reference image + + /** @type {sglrReferenceContext.ReferenceContextBuffers} */ + var buffers = new sglrReferenceContext.ReferenceContextBuffers( + new tcuPixelFormat.PixelFormat( + 8, 8, 8, + gl.getParameter(gl.ALPHA_BITS) ? 8 : 0 + ), + /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)), + /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)), + width, + height + ); + context = new sglrReferenceContext.ReferenceContext( + new sglrReferenceContext.ReferenceContextLimits(gl), + buffers.getColorbuffer(), + buffers.getDepthbuffer(), + buffers.getStencilbuffer() + ); + + context.clearColor( + clearColor[0], clearColor[1], clearColor[2], clearColor[3] + ); + + context.clear( + gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT + ); + + this.render(context, refFrame); + refError = context.getError(); + + // Compare error codes + var errorCodesOk = (gles3Error == refError); + + if (!errorCodesOk) { + bufferedLogToConsole ( + 'Error code mismatch: got ' + + WebGLTestUtils.glEnumToString(gl, gles3Error) + ', expected ' + + WebGLTestUtils.glEnumToString(gl, refError) + ); + failReason = 'Got unexpected error'; + } + + // Compare images + var imagesOk = this.compare(refFrame, gles3Frame); + + if (!imagesOk && !failReason) + failReason = 'Image comparison failed'; + + // Store test result + var isOk = errorCodesOk && imagesOk; + assertMsgOptions(isOk, failReason, true, true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @return {boolean} + */ + es3fFboRenderTest.FboRenderCase.prototype.compare = function( + reference, result) { + + var threshold = new tcuRGBA.RGBA( + /* TODO: tcu::max(getFormatThreshold(this.m_config.colorFormat),*/ + [12, 12, 12, 12] + ); + + return tcuImageCompare.bilinearCompare( + 'ComparisonResult', 'Image comparison result', + reference.getAccess(), result.getAccess(), + threshold, tcuImageCompare.CompareLogMode.RESULT + ); + }; + + /** + * deinit + */ + es3fFboRenderTest.FboRenderCase.prototype.deinit = function() { + gl.clearColor(0.0, 0.0, 0.0, 0.0); + gl.clearDepth(1.0); + gl.clearStencil(0); + + gl.disable(gl.STENCIL_TEST); + gl.disable(gl.DEPTH_TEST); + gl.disable(gl.BLEND); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + }; + + // FboCases + + /** + * @constructor + * @extends {es3fFboRenderTest.FboRenderCase} + * @param {es3fFboRenderTest.FboConfig} config + */ + es3fFboRenderTest.StencilClearsTest = function(config) { + es3fFboRenderTest.FboRenderCase.call( + this, config.getName(), 'Stencil clears', config + ); + }; + + es3fFboRenderTest.StencilClearsTest.prototype = + Object.create(es3fFboRenderTest.FboRenderCase.prototype); + + es3fFboRenderTest.StencilClearsTest.prototype.constructor = + es3fFboRenderTest.StencilClearsTest; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {tcuSurface.Surface} dst + */ + es3fFboRenderTest.StencilClearsTest.prototype.render = function( + context, dst) { + + /** @type {tcuTexture.TextureFormat} */ + var colorFormat = gluTextureUtil.mapGLInternalFormat( + this.m_config.colorFormat + ); + + /** @type {gluShaderUtil.DataType} */ + var fboSamplerType = /** @type {gluShaderUtil.DataType} */ ( + gluTextureUtil.getSampler2DType(colorFormat) + ); + + /** @type {gluShaderUtil.DataType} */ + var fboOutputType = es3fFboTestUtil.getFragmentOutputType(colorFormat); + + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fboRangeInfo = tcuTextureUtil.getTextureFormatInfo(colorFormat); + + var fboOutScale = deMath.subtract( + fboRangeInfo.valueMax, fboRangeInfo.valueMin + ); + + var fboOutBias = fboRangeInfo.valueMin; + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFboShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], fboOutputType + ); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texFromFboShader = new es3fFboTestUtil.Texture2DShader( + [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4); + + /** @type {number} */ var texToFboShaderID = + context.createProgram(texToFboShader); + + /** @type {number} */ var texFromFboShaderID = + context.createProgram(texFromFboShader); + + /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */ + var metaballsTex = context.createTexture(); + + /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */ + var quadsTex = context.createTexture(); + + /** @type {number} */ var width = 128; + /** @type {number} */ var height = 128; + + texToFboShader.setOutScaleBias(fboOutScale, fboOutBias); + texFromFboShader.setTexScaleBias( + 0, fboRangeInfo.lookupScale, fboRangeInfo.lookupBias + ); + + es3fFboRenderTest.createQuadsTex2D( + context, quadsTex, gl.RGBA, gl.UNSIGNED_BYTE, width, height + ); + + es3fFboRenderTest.createMetaballsTex2D( + context, metaballsTex, gl.RGBA, gl.UNSIGNED_BYTE, width, height + ); + + /** @type {es3fFboRenderTest.Framebuffer} */ + var fbo = new es3fFboRenderTest.Framebuffer( + context, this.m_config, width, height + ); + fbo.checkCompleteness(); + + // Bind framebuffer and clear + context.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer()); + context.viewport(0, 0, width, height); + context.clearColor(0.0, 0.0, 0.0, 1.0); + context.clear( + gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT + ); + + // Do stencil clears + context.enable(gl.SCISSOR_TEST); + context.scissor(10, 16, 32, 120); + context.clearStencil(1); + context.clear(gl.STENCIL_BUFFER_BIT); + context.scissor(16, 32, 100, 64); + context.clearStencil(2); + context.clear(gl.STENCIL_BUFFER_BIT); + context.disable(gl.SCISSOR_TEST); + + // Draw 2 textures with stecil tests + context.enable(gl.STENCIL_TEST); + + context.bindTexture(gl.TEXTURE_2D, quadsTex); + context.stencilFunc(gl.EQUAL, 1, 0xff); + + texToFboShader.setUniforms(context, texToFboShaderID); + rrUtil.drawQuad( + context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + context.bindTexture(gl.TEXTURE_2D, metaballsTex); + context.stencilFunc(gl.EQUAL, 2, 0xff); + + texToFboShader.setUniforms(context, texToFboShaderID); + rrUtil.drawQuad( + context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + context.disable(gl.STENCIL_TEST); + + if (fbo.getConfig().colorType == gl.TEXTURE_2D) { + context.bindFramebuffer(gl.FRAMEBUFFER, null); + context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer()); + context.viewport(0, 0, context.getWidth(), context.getHeight()); + + texFromFboShader.setUniforms(context, texFromFboShaderID); + rrUtil.drawQuad( + context, texFromFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + dst.readViewport( + context, [0, 0, context.getWidth(), context.getHeight()] + ); + } else + es3fFboTestUtil.readPixels( + context, dst, 0, 0, width, height, colorFormat, + fboRangeInfo.lookupScale, fboRangeInfo.lookupBias + ); + }; + + /** + * @constructor + * @extends {es3fFboRenderTest.FboRenderCase} + * @param {es3fFboRenderTest.FboConfig} config + */ + es3fFboRenderTest.SharedColorbufferTest = function(config) { + es3fFboRenderTest.FboRenderCase.call( + this, config.getName(), 'Shared colorbuffer', config + ); + }; + + es3fFboRenderTest.SharedColorbufferTest.prototype = + Object.create(es3fFboRenderTest.FboRenderCase.prototype); + + es3fFboRenderTest.SharedColorbufferTest.prototype.constructor = + es3fFboRenderTest.SharedColorbufferTest; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {tcuSurface.Surface} dst + */ + es3fFboRenderTest.SharedColorbufferTest.prototype.render = function( + context, dst) { + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], + gluShaderUtil.DataType.FLOAT_VEC4 + ); + + /** @type {es3fFboTestUtil.FlatColorShader} */ + var flatShader = new es3fFboTestUtil.FlatColorShader( + gluShaderUtil.DataType.FLOAT_VEC4 + ); + + /** @type {number} */ + var texShaderID = context.createProgram(texShader); + /** @type {number} */ + var flatShaderID = context.createProgram(flatShader); + + /** @type {number} */ var width = 128; + /** @type {number} */ var height = 128; + + /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */ + var quadsTex = context.createTexture(); + + /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */ + var metaballsTex = context.createTexture(); + + /** @type {boolean} */ var stencil = + (this.m_config.buffers & gl.STENCIL_BUFFER_BIT) != 0; + + context.disable(gl.DITHER); + + // Textures + es3fFboRenderTest.createQuadsTex2D( + context, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64 + ); + es3fFboRenderTest.createMetaballsTex2D( + context, metaballsTex, gl.RGBA, gl.UNSIGNED_BYTE, 64, 64 + ); + + context.viewport(0, 0, width, height); + + // Fbo A + /** @type {es3fFboRenderTest.Framebuffer} */ + var fboA = new es3fFboRenderTest.Framebuffer( + context, this.m_config, width, height + ); + fboA.checkCompleteness(); + + // Fbo B - don't create colorbuffer + + /** @type {es3fFboRenderTest.FboConfig} */ + var cfg = /** @type {es3fFboRenderTest.FboConfig} */ + (deUtil.clone(this.m_config)); + + cfg.buffers = deMath.binaryOp( + cfg.buffers, + deMath.binaryNot(gl.COLOR_BUFFER_BIT), + deMath.BinaryOp.AND + ); + cfg.colorType = gl.NONE; + cfg.colorFormat = gl.NONE; + + /** @type {es3fFboRenderTest.Framebuffer} */ + var fboB = new es3fFboRenderTest.Framebuffer( + context, cfg, width, height + ); + + // Attach color buffer from fbo A + context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer()); + switch (this.m_config.colorType) { + case gl.TEXTURE_2D: + context.framebufferTexture2D( + gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, fboA.getColorBuffer(), 0 + ); + break; + + case gl.RENDERBUFFER: + context.framebufferRenderbuffer( + gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.RENDERBUFFER, fboA.getColorBuffer() + ); + break; + + default: + throw new Error('Invalid color type'); + } + + // Clear depth and stencil in fbo B + context.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + // Render quads to fbo 1, with depth 0.0 + context.bindFramebuffer(gl.FRAMEBUFFER, fboA.getFramebuffer()); + context.bindTexture(gl.TEXTURE_2D, quadsTex); + context.clearColor(0.0, 0.0, 0.0, 1.0); + context.clear( + gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT + ); + + if (stencil) { + // Stencil to 1 in fbo A + context.clearStencil(1); + context.clear(gl.STENCIL_BUFFER_BIT); + } + + texShader.setUniforms(context, texShaderID); + + context.enable(gl.DEPTH_TEST); + rrUtil.drawQuad( + context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + context.disable(gl.DEPTH_TEST); + + // Blend metaballs to fbo 2 + context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer()); + context.bindTexture(gl.TEXTURE_2D, metaballsTex); + context.enable(gl.BLEND); + context.blendFuncSeparate( + gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE + ); + rrUtil.drawQuad( + context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + // Render small quad that is only visible if depth buffer + // is not shared with fbo A - or there is no depth bits + context.bindTexture(gl.TEXTURE_2D, quadsTex); + context.enable(gl.DEPTH_TEST); + rrUtil.drawQuad(context, texShaderID, [0.5, 0.5, 0.5], [1.0, 1.0, 0.5]); + context.disable(gl.DEPTH_TEST); + + if (stencil) { + flatShader.setColor(context, flatShaderID, [0.0, 1.0, 0.0, 1.0]); + + // Clear subset of stencil buffer to 1 + context.enable(gl.SCISSOR_TEST); + context.scissor(10, 10, 12, 25); + context.clearStencil(1); + context.clear(gl.STENCIL_BUFFER_BIT); + context.disable(gl.SCISSOR_TEST); + + // Render quad with stencil mask == 1 + context.enable(gl.STENCIL_TEST); + context.stencilFunc(gl.EQUAL, 1, 0xff); + rrUtil.drawQuad( + context, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + context.disable(gl.STENCIL_TEST); + } + + // Get results + if (fboA.getConfig().colorType == gl.TEXTURE_2D) { + texShader.setUniforms(context, texShaderID); + + context.bindFramebuffer(gl.FRAMEBUFFER, null); + context.bindTexture(gl.TEXTURE_2D, fboA.getColorBuffer()); + context.viewport(0, 0, context.getWidth(), context.getHeight()); + rrUtil.drawQuad( + context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + dst.readViewport( + context, [0, 0, context.getWidth(), context.getHeight()] + ); + } else + es3fFboTestUtil.readPixels( + context, dst, 0, 0, width, height, + gluTextureUtil.mapGLInternalFormat( + fboA.getConfig().colorFormat + ), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0] + ); + }; + + /** + * @constructor + * @extends {es3fFboRenderTest.FboRenderCase} + * @param {es3fFboRenderTest.FboConfig} config + */ + es3fFboRenderTest.SharedColorbufferClearsTest = function(config) { + es3fFboRenderTest.FboRenderCase.call( + this, config.getName(), 'Shared colorbuffer clears', config + ); + }; + + es3fFboRenderTest.SharedColorbufferClearsTest.prototype = + Object.create(es3fFboRenderTest.FboRenderCase.prototype); + + es3fFboRenderTest.SharedColorbufferClearsTest.prototype.constructor = + es3fFboRenderTest.SharedColorbufferClearsTest; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {tcuSurface.Surface} dst + */ + es3fFboRenderTest.SharedColorbufferClearsTest.prototype.render = function( + context, dst) { + + /** @type {tcuTexture.TextureFormat} */ + var colorFormat = gluTextureUtil.mapGLInternalFormat( + this.m_config.colorFormat + ); + + /** @type {gluShaderUtil.DataType} */ + var fboSamplerType = gluTextureUtil.getSampler2DType(colorFormat); + + var width = 128; + var height = 128; + var colorbuffer = this.m_config.colorType == gl.TEXTURE_2D? + context.createTexture() : + context.createRenderbuffer(); + + // Check for format support. + es3fFboRenderTest.checkColorFormatSupport( + context, this.m_config.colorFormat + ); + + // Single colorbuffer + if (this.m_config.colorType == gl.TEXTURE_2D) { + context.bindTexture(gl.TEXTURE_2D, colorbuffer); + context.texImage2DDelegate( + gl.TEXTURE_2D, 0, this.m_config.colorFormat, width, height + ); + context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST + ); + context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST + ); + } else { + assertMsgOptions( + this.m_config.colorType == gl.RENDERBUFFER, + 'Not a render buffer type', false, true + ); + context.bindRenderbuffer(gl.RENDERBUFFER, colorbuffer); + context.renderbufferStorage( + gl.RENDERBUFFER, this.m_config.colorFormat, width, height + ); + } + + // Multiple framebuffers sharing the colorbuffer + var fbo = [ + context.createFramebuffer(), + context.createFramebuffer(), + context.createFramebuffer() + ]; + + for (var fboi = 0; fboi < fbo.length; fboi++) { + context.bindFramebuffer(gl.FRAMEBUFFER, fbo[fboi]); + + if (this.m_config.colorType == gl.TEXTURE_2D) + context.framebufferTexture2D( + gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, colorbuffer, 0 + ); + else + context.framebufferRenderbuffer( + gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.RENDERBUFFER, colorbuffer + ); + } + + context.bindFramebuffer(gl.FRAMEBUFFER, fbo[0]); + + // Check completeness + + var status = context.checkFramebufferStatus(gl.FRAMEBUFFER); + if (status != gl.FRAMEBUFFER_COMPLETE) + throw new es3fFboTestUtil.FboIncompleteException(status); + + // Render to them + context.viewport(0, 0, width, height); + context.clearColor(0.0, 0.0, 1.0, 1.0); + context.clear(gl.COLOR_BUFFER_BIT); + + context.enable(gl.SCISSOR_TEST); + + context.bindFramebuffer(gl.FRAMEBUFFER, fbo[1]); + context.clearColor(0.6, 0.0, 0.0, 1.0); + context.scissor(10, 10, 64, 64); + context.clear(gl.COLOR_BUFFER_BIT); + context.clearColor(0.0, 0.6, 0.0, 1.0); + context.scissor(60, 60, 40, 20); + context.clear(gl.COLOR_BUFFER_BIT); + + context.bindFramebuffer(gl.FRAMEBUFFER, fbo[2]); + context.clearColor(0.0, 0.0, 0.6, 1.0); + context.scissor(20, 20, 100, 10); + context.clear(gl.COLOR_BUFFER_BIT); + + context.bindFramebuffer(gl.FRAMEBUFFER, fbo[0]); + context.clearColor(0.6, 0.0, 0.6, 1.0); + context.scissor(20, 20, 5, 100); + context.clear(gl.COLOR_BUFFER_BIT); + + context.disable(gl.SCISSOR_TEST); + + if (this.m_config.colorType == gl.TEXTURE_2D) { + /** @type {es3fFboTestUtil.Texture2DShader} */ + var shader = new es3fFboTestUtil.Texture2DShader( + [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderID = context.createProgram(shader); + + shader.setUniforms(context, shaderID); + + context.bindFramebuffer(gl.FRAMEBUFFER, null); + context.viewport(0, 0, context.getWidth(), context.getHeight()); + rrUtil.drawQuad( + context, shaderID, [-0.9, -0.9, 0.0], [0.9, 0.9, 0.0] + ); + dst.readViewport( + context, [0, 0, context.getWidth(), context.getHeight()] + ); + } else + es3fFboTestUtil.readPixels( + context, dst, 0, 0, width, height, colorFormat, + [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0] + ); + + //delete FBOs + for (fboi = 0; fboi < fbo.length; fboi++) + context.deleteFramebuffer(fbo[fboi]); + + //delete Texture/Renderbuffer + if (this.m_config.colorType == gl.TEXTURE_2D) + context.deleteTexture(colorbuffer); + else + context.deleteRenderbuffer(colorbuffer); + }; + + /** + * @constructor + * @extends {es3fFboRenderTest.FboRenderCase} + * @param {es3fFboRenderTest.FboConfig} config + */ + es3fFboRenderTest.SharedDepthStencilTest = function(config) { + es3fFboRenderTest.FboRenderCase.call( + this, config.getName(), 'Shared depth/stencilbuffer', config + ); + }; + + es3fFboRenderTest.SharedDepthStencilTest.prototype = + Object.create(es3fFboRenderTest.FboRenderCase.prototype); + + es3fFboRenderTest.SharedDepthStencilTest.prototype.constructor = + es3fFboRenderTest.SharedDepthStencilTest; + + /** + * @param {es3fFboRenderTest.FboConfig} config + * @return {boolean} + */ + es3fFboRenderTest.SharedDepthStencilTest.prototype.isConfigSupported = + function(config) { + return deMath.binaryOp( + config.buffers, + deMath.binaryOp( + gl.DEPTH_BUFFER_BIT, gl.STENCIL_BUFFER_BIT, deMath.BinaryOp.OR + ), deMath.BinaryOp.AND + ) != 0; + }; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {tcuSurface.Surface} dst + */ + es3fFboRenderTest.SharedDepthStencilTest.prototype.render = function( + context, dst) { + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], + gluShaderUtil.DataType.FLOAT_VEC4 + ); + + /** @type {es3fFboTestUtil.FlatColorShader} */ + var flatShader = new es3fFboTestUtil.FlatColorShader( + gluShaderUtil.DataType.FLOAT_VEC4 + ); + + var texShaderID = context.createProgram(texShader); + var flatShaderID = context.createProgram(flatShader); + var width = 128; + var height = 128; + // bool depth = (this.m_config.buffers & gl.DEPTH_BUFFER_BIT) != 0; + /**@type {boolean} */ var stencil = + (this.m_config.buffers & gl.STENCIL_BUFFER_BIT) != 0; + + // Textures + var metaballsTex = context.createTexture(); + var quadsTex = context.createTexture(); + es3fFboRenderTest.createMetaballsTex2D( + context, metaballsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64 + ); + es3fFboRenderTest.createQuadsTex2D( + context, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64 + ); + + context.viewport(0, 0, width, height); + + // Fbo A + /** @type {es3fFboRenderTest.Framebuffer} */ + var fboA = new es3fFboRenderTest.Framebuffer( + context, this.m_config, width, height + ); + + fboA.checkCompleteness(); + + // Fbo B + /** @type {es3fFboRenderTest.FboConfig} */ + var cfg = /** @type {es3fFboRenderTest.FboConfig} */ + (deUtil.clone(this.m_config)); + + cfg.buffers = deMath.binaryOp( + cfg.buffers, + deMath.binaryNot(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT), + deMath.BinaryOp.AND + ); + cfg.depthStencilType = gl.NONE; + cfg.depthStencilFormat = gl.NONE; + + /** @type {es3fFboRenderTest.Framebuffer} */ + var fboB = new es3fFboRenderTest.Framebuffer( + context, cfg, width, height + ); + + // Bind depth/stencil buffers from fbo A to fbo B + context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer()); + for (var ndx = 0; ndx < 2; ndx++) { + var bit = ndx ? gl.STENCIL_BUFFER_BIT : gl.DEPTH_BUFFER_BIT; + var point = ndx ? gl.STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT; + + if ( + deMath.binaryOp( + this.m_config.buffers, bit, deMath.BinaryOp.AND + ) == 0 + ) + continue; + + switch (this.m_config.depthStencilType) { + case gl.TEXTURE_2D: + context.framebufferTexture2D( + gl.FRAMEBUFFER, point, gl.TEXTURE_2D, + fboA.getDepthStencilBuffer(), 0 + ); + break; + case gl.RENDERBUFFER: + context.framebufferRenderbuffer( + gl.FRAMEBUFFER, point, gl.RENDERBUFFER, + fboA.getDepthStencilBuffer() + ); + break; + default: + testFailed('Not implemented'); + } + } + + // Setup uniforms + texShader.setUniforms(context, texShaderID); + + // Clear color to red and stencil to 1 in fbo B. + context.clearColor(1.0, 0.0, 0.0, 1.0); + context.clearStencil(1); + context.clear( + gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT + ); + + context.enable(gl.DEPTH_TEST); + + // Render quad to fbo A + context.bindFramebuffer(gl.FRAMEBUFFER, fboA.getFramebuffer()); + context.bindTexture(gl.TEXTURE_2D, quadsTex); + rrUtil.drawQuad( + context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + if (stencil) { + // Clear subset of stencil buffer to 0 in fbo A + context.enable(gl.SCISSOR_TEST); + context.scissor(10, 10, 12, 25); + context.clearStencil(0); + context.clear(gl.STENCIL_BUFFER_BIT); + context.disable(gl.SCISSOR_TEST); + } + + // Render metaballs to fbo B + context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer()); + context.bindTexture(gl.TEXTURE_2D, metaballsTex); + rrUtil.drawQuad( + context, texShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0] + ); + + context.disable(gl.DEPTH_TEST); + + if (stencil) { + // Render quad with stencil mask == 0 + context.enable(gl.STENCIL_TEST); + context.stencilFunc(gl.EQUAL, 0, 0xff); + context.useProgram(flatShaderID); + flatShader.setColor(context, flatShaderID, [0.0, 1.0, 0.0, 1.0]); + rrUtil.drawQuad( + context, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + context.disable(gl.STENCIL_TEST); + } + + if (this.m_config.colorType == gl.TEXTURE_2D) { + // Render both to screen + context.bindFramebuffer(gl.FRAMEBUFFER, null); + context.viewport(0, 0, context.getWidth(), context.getHeight()); + context.bindTexture(gl.TEXTURE_2D, fboA.getColorBuffer()); + rrUtil.drawQuad( + context, texShaderID, [-1.0, -1.0, 0.0], [0.0, 1.0, 0.0] + ); + context.bindTexture(gl.TEXTURE_2D, fboB.getColorBuffer()); + rrUtil.drawQuad( + context, texShaderID, [0.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + dst.readViewport( + context, [0, 0, context.getWidth(), context.getHeight()] + ); + } else { + // Read results from fbo B + es3fFboTestUtil.readPixels( + context, dst, 0, 0, width, height, + gluTextureUtil.mapGLInternalFormat(this.m_config.colorFormat), + [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0] + ); + } + }; + + /** + * @constructor + * @extends {es3fFboRenderTest.FboRenderCase} + * @param {es3fFboRenderTest.FboConfig} config + */ + es3fFboRenderTest.ResizeTest = function(config) { + es3fFboRenderTest.FboRenderCase.call( + this, config.getName(), 'Resize framebuffer', config + ); + }; + + es3fFboRenderTest.ResizeTest.prototype = + Object.create(es3fFboRenderTest.FboRenderCase.prototype); + + es3fFboRenderTest.ResizeTest.prototype.constructor = + es3fFboRenderTest.ResizeTest; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * context + * @param {tcuSurface.Surface} dst + */ + es3fFboRenderTest.ResizeTest.prototype.render = function(context, dst) { + /** @type {tcuTexture.TextureFormat} */ + var colorFormat = gluTextureUtil.mapGLInternalFormat( + this.m_config.colorFormat + ); + /** @type {gluShaderUtil.DataType} */ + var fboSamplerType = gluTextureUtil.getSampler2DType(colorFormat); + /** @type {gluShaderUtil.DataType} */ + var fboOutputType = es3fFboTestUtil.getFragmentOutputType(colorFormat); + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fboRangeInfo = tcuTextureUtil.getTextureFormatInfo(colorFormat); + var fboOutScale = deMath.subtract( + fboRangeInfo.valueMax, fboRangeInfo.valueMin + ); + var fboOutBias = fboRangeInfo.valueMin; + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFboShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], fboOutputType + ); + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texFromFboShader = new es3fFboTestUtil.Texture2DShader( + [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4 + ); + + /** @type {es3fFboTestUtil.FlatColorShader} */ + var flatShader = new es3fFboTestUtil.FlatColorShader(fboOutputType); + /** @type {WebGLProgram} */ + var texToFboShaderID = context.createProgram(texToFboShader); + /** @type {WebGLProgram} */ + var texFromFboShaderID = context.createProgram(texFromFboShader); + /** @type {WebGLProgram} */ + var flatShaderID = context.createProgram(flatShader); + + var quadsTex = context.createTexture(); + var metaballsTex = context.createTexture(); + + var depth = deMath.binaryOp( + this.m_config.buffers, gl.DEPTH_BUFFER_BIT, deMath.BinaryOp.AND + ) != 0; + var stencil = deMath.binaryOp( + this.m_config.buffers, gl.STENCIL_BUFFER_BIT, deMath.BinaryOp.AND + ) != 0; + + var initialWidth = 128; + var initialHeight = 128; + var newWidth = 64; + var newHeight = 32; + + texToFboShader.setOutScaleBias(fboOutScale, fboOutBias); + texFromFboShader.setTexScaleBias( + 0, fboRangeInfo.lookupScale, fboRangeInfo.lookupBias + ); + + es3fFboRenderTest.createQuadsTex2D( + context, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64 + ); + es3fFboRenderTest.createMetaballsTex2D( + context, metaballsTex, gl.RGB, gl.UNSIGNED_BYTE, 32, 32 + ); + + /** @type {es3fFboRenderTest.Framebuffer} */ + var fbo = new es3fFboRenderTest.Framebuffer( + context, this.m_config, initialWidth, initialHeight + ); + fbo.checkCompleteness(); + + // Setup shaders + texToFboShader.setUniforms(context, texToFboShaderID); + texFromFboShader.setUniforms(context, texFromFboShaderID); + flatShader.setColor( + context, flatShaderID, deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], fboOutScale), fboOutBias + ) + ); + + // Render quads + context.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer()); + context.viewport(0, 0, initialWidth, initialHeight); + es3fFboTestUtil.clearColorBuffer( + context, colorFormat, [0.0, 0.0, 0.0, 1.0] + ); + context.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + context.bindTexture(gl.TEXTURE_2D, quadsTex); + rrUtil.drawQuad( + context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + if (fbo.getConfig().colorType == gl.TEXTURE_2D) { + // Render fbo to screen + context.bindFramebuffer(gl.FRAMEBUFFER, null); + context.viewport(0, 0, context.getWidth(), context.getHeight()); + context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer()); + rrUtil.drawQuad( + context, texFromFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + // Restore binding + context.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer()); + } + + // Resize buffers + switch (fbo.getConfig().colorType) { + case gl.TEXTURE_2D: + context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer()); + context.texImage2DDelegate( + gl.TEXTURE_2D, 0, fbo.getConfig().colorFormat, + newWidth, newHeight + ); + break; + + case gl.RENDERBUFFER: + context.bindRenderbuffer(gl.RENDERBUFFER, fbo.getColorBuffer()); + context.renderbufferStorage( + gl.RENDERBUFFER, fbo.getConfig().colorFormat, + newWidth, newHeight + ); + break; + + default: + throw new Error('Color type unsupported'); + } + + if (depth || stencil) { + switch (fbo.getConfig().depthStencilType) { + case gl.TEXTURE_2D: + context.bindTexture( + gl.TEXTURE_2D, fbo.getDepthStencilBuffer() + ); + context.texImage2DDelegate( + gl.TEXTURE_2D, 0, fbo.getConfig().depthStencilFormat, + newWidth, newHeight + ); + break; + + case gl.RENDERBUFFER: + context.bindRenderbuffer( + gl.RENDERBUFFER, fbo.getDepthStencilBuffer() + ); + context.renderbufferStorage( + gl.RENDERBUFFER, fbo.getConfig().depthStencilFormat, + newWidth, newHeight + ); + break; + + default: + throw new Error('Depth / stencil type unsupported'); + } + } + + // Render to resized fbo + context.viewport(0, 0, newWidth, newHeight); + es3fFboTestUtil.clearColorBuffer( + context, colorFormat, [1.0, 0.0, 0.0, 1.0] + ); + context.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + context.enable(gl.DEPTH_TEST); + + context.bindTexture(gl.TEXTURE_2D, metaballsTex); + rrUtil.drawQuad( + context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + context.bindTexture(gl.TEXTURE_2D, quadsTex); + rrUtil.drawQuad( + context, texToFboShaderID, [0.0, 0.0, -1.0], [1.0, 1.0, 1.0] + ); + + context.disable(gl.DEPTH_TEST); + + if (stencil) { + context.enable(gl.SCISSOR_TEST); + context.clearStencil(1); + context.scissor(10, 10, 5, 15); + context.clear(gl.STENCIL_BUFFER_BIT); + context.disable(gl.SCISSOR_TEST); + + context.enable(gl.STENCIL_TEST); + context.stencilFunc(gl.EQUAL, 1, 0xff); + rrUtil.drawQuad( + context, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + context.disable(gl.STENCIL_TEST); + } + + if (this.m_config.colorType == gl.TEXTURE_2D) { + context.bindFramebuffer(gl.FRAMEBUFFER, null); + context.viewport(0, 0, context.getWidth(), context.getHeight()); + context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer()); + rrUtil.drawQuad( + context, texFromFboShaderID, [-0.5, -0.5, 0.0], [0.5, 0.5, 0.0] + ); + dst.readViewport( + context, [0, 0, context.getWidth(), context.getHeight()] + ); + } else + es3fFboTestUtil.readPixels( + context, dst, 0, 0, newWidth, newHeight, colorFormat, + fboRangeInfo.lookupScale, fboRangeInfo.lookupBias + ); + }; + + /** + * @constructor + * @extends {es3fFboRenderTest.FboRenderCase} + * @param {es3fFboRenderTest.FboConfig} config + * @param {number} buffers + * @param {boolean} rebind + */ + es3fFboRenderTest.RecreateBuffersTest = function(config, buffers, rebind) { + es3fFboRenderTest.FboRenderCase.call( + this, config.getName() + + (rebind ? '' : '_no_rebind'), + 'Recreate buffers', config + ); + this.m_buffers = buffers; + this.m_rebind = rebind; + }; + + es3fFboRenderTest.RecreateBuffersTest.prototype = + Object.create(es3fFboRenderTest.FboRenderCase.prototype); + + es3fFboRenderTest.RecreateBuffersTest.prototype.construtor = + es3fFboRenderTest.RecreateBuffersTest; + + /** + * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext} + * ctx + * @param {tcuSurface.Surface} dst + */ + es3fFboRenderTest.RecreateBuffersTest.prototype.render = function( + ctx, dst) { + + /** @type {tcuTexture.TextureFormat} */ + var colorFormat = gluTextureUtil.mapGLInternalFormat( + this.m_config.colorFormat + ); + /** @type {gluShaderUtil.DataType} */ + var fboSamplerType = gluTextureUtil.getSampler2DType(colorFormat); + /** @type {gluShaderUtil.DataType} */ + var fboOutputType = es3fFboTestUtil.getFragmentOutputType(colorFormat); + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fboRangeInfo = tcuTextureUtil.getTextureFormatInfo(colorFormat); + var fboOutScale = deMath.subtract( + fboRangeInfo.valueMax, fboRangeInfo.valueMin + ); + var fboOutBias = fboRangeInfo.valueMin; + + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texToFboShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], fboOutputType + ); + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texFromFboShader = new es3fFboTestUtil.Texture2DShader( + [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4 + ); + + /** @type {es3fFboTestUtil.FlatColorShader} */ + var flatShader = new es3fFboTestUtil.FlatColorShader(fboOutputType); + /** @type {number} */ + var texToFboShaderID = ctx.createProgram(texToFboShader); + /** @type {number} */ + var texFromFboShaderID = ctx.createProgram(texFromFboShader); + /** @type {number} */ + var flatShaderID = ctx.createProgram(flatShader); + + var width = 128; + var height = 128; + var metaballsTex = ctx.createTexture(); + var quadsTex = ctx.createTexture(); + var stencil = deMath.binaryOp( + this.m_config.buffers, gl.STENCIL_BUFFER_BIT, deMath.BinaryOp.AND + ) != 0; + + es3fFboRenderTest.createQuadsTex2D( + ctx, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64 + ); + es3fFboRenderTest.createMetaballsTex2D( + ctx, metaballsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64 + ); + + /** @type {es3fFboRenderTest.Framebuffer} */ + var fbo = new es3fFboRenderTest.Framebuffer( + ctx, this.m_config, width, height + ); + fbo.checkCompleteness(); + + // Setup shaders + texToFboShader.setOutScaleBias(fboOutScale, fboOutBias); + texFromFboShader.setTexScaleBias( + 0, fboRangeInfo.lookupScale, fboRangeInfo.lookupBias + ); + texToFboShader.setUniforms(ctx, texToFboShaderID); + texFromFboShader.setUniforms(ctx, texFromFboShaderID); + flatShader.setColor( + ctx, flatShaderID, deMath.add( + deMath.multiply([0.0, 0.0, 1.0, 1.0], fboOutScale + ), fboOutBias) + ); + + // Draw scene + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer()); + ctx.viewport(0, 0, width, height); + es3fFboTestUtil.clearColorBuffer( + ctx, colorFormat, [1.0, 0.0, 0.0, 1.0] + ); + ctx.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + ctx.enable(gl.DEPTH_TEST); + + ctx.bindTexture(gl.TEXTURE_2D, quadsTex); + rrUtil.drawQuad( + ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + ctx.disable(gl.DEPTH_TEST); + + if (stencil) { + ctx.enable(gl.SCISSOR_TEST); + ctx.scissor( + Math.floor(width / 4), Math.floor(height / 4), + Math.floor(width / 2), Math.floor(height / 2) + ); + ctx.clearStencil(1); + ctx.clear(gl.STENCIL_BUFFER_BIT); + ctx.disable(gl.SCISSOR_TEST); + } + + // Recreate buffers + if (!this.m_rebind) + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + + assertMsgOptions( + deMath.binaryOp( + this.m_buffers, deMath.binaryOp( + gl.DEPTH_BUFFER_BIT, + gl.STENCIL_BUFFER_BIT, + deMath.BinaryOp.OR + ), deMath.BinaryOp.AND + ) == 0 || deMath.binaryOp( + this.m_buffers, deMath.binaryOp( + gl.DEPTH_BUFFER_BIT, + gl.STENCIL_BUFFER_BIT, + deMath.BinaryOp.OR + ), deMath.BinaryOp.AND + ) == deMath.binaryOp( + this.m_config.buffers, deMath.binaryOp( + gl.DEPTH_BUFFER_BIT, + gl.STENCIL_BUFFER_BIT, + deMath.BinaryOp.OR + ), deMath.BinaryOp.AND + ), 'Depth/stencil buffers are not disabled or not ' + + 'equal to the config\'s depth/stencil buffer state', + false, true + ); + + // Recreate. + for (var ndx = 0; ndx < 2; ndx++) { + var bit = ndx == 0 ? gl.COLOR_BUFFER_BIT : + (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + var type = ndx == 0 ? fbo.getConfig().colorType : + fbo.getConfig().depthStencilType; + var format = ndx == 0 ? fbo.getConfig().colorFormat : + fbo.getConfig().depthStencilFormat; + var buf = ndx == 0 ? fbo.getColorBuffer() : + fbo.getDepthStencilBuffer(); + + if (deMath.binaryOp(this.m_buffers, bit, deMath.BinaryOp.AND) == 0) + continue; + + switch (type) { + case gl.TEXTURE_2D: + ctx.deleteTexture(/** @type {WebGLTexture} */ (buf)); + buf = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, buf); + ctx.texImage2DDelegate( + gl.TEXTURE_2D, 0, format, width, height + ); + ctx.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST + ); + ctx.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST + ); + break; + + case gl.RENDERBUFFER: + ctx.deleteRenderbuffer( + /** @type {WebGLRenderbuffer} */ (buf) + ); + buf = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, buf); + ctx.renderbufferStorage( + gl.RENDERBUFFER, format, width, height + ); + break; + + default: + throw new Error('Unsupported buffer type'); + } + + if (ndx == 0) { + fbo.m_colorBuffer = buf; + } else { + fbo.m_depthStencilBuffer = buf; + } + } + + // Rebind. + if (this.m_rebind) { + for (var ndx = 0; ndx < 3; ndx++) { + var bit = ndx == 0 ? gl.COLOR_BUFFER_BIT : + ndx == 1 ? gl.DEPTH_BUFFER_BIT : + ndx == 2 ? gl.STENCIL_BUFFER_BIT : 0; + var point = ndx == 0 ? gl.COLOR_ATTACHMENT0 : + ndx == 1 ? gl.DEPTH_ATTACHMENT : + ndx == 2 ? gl.STENCIL_ATTACHMENT : 0; + var type = ndx == 0 ? fbo.getConfig().colorType : + fbo.getConfig().depthStencilType; + var buf = ndx == 0 ? fbo.getColorBuffer() : + fbo.getDepthStencilBuffer(); + + if (deMath.binaryOp( + this.m_buffers, bit, deMath.BinaryOp.AND) == 0) + continue; + + switch (type) { + case gl.TEXTURE_2D: + ctx.framebufferTexture2D( + gl.FRAMEBUFFER, point, gl.TEXTURE_2D, buf, 0 + ); + break; + + case gl.RENDERBUFFER: + ctx.framebufferRenderbuffer( + gl.FRAMEBUFFER, point, gl.RENDERBUFFER, buf + ); + break; + + default: + throw new Error('Invalid buffer type'); + } + } + } + + if (!this.m_rebind) + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer()); + + ctx.clearStencil(0); + + // \note Clear only buffers that were re-created + ctx.clear( + deMath.binaryOp( + this.m_buffers, + deMath.binaryOp( + gl.DEPTH_BUFFER_BIT, + gl.STENCIL_BUFFER_BIT, + deMath.BinaryOp.OR + ), deMath.BinaryOp.AND + ) + ); + + if (deMath.binaryOp( + this.m_buffers, gl.COLOR_BUFFER_BIT, deMath.BinaryOp.AND)) { + // Clearing of integer buffers is undefined + // so do clearing by rendering flat color. + rrUtil.drawQuad( + ctx, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + } + + ctx.enable(gl.DEPTH_TEST); + + if (stencil) { + // \note Stencil test enabled only if we have stencil buffer + ctx.enable(gl.STENCIL_TEST); + ctx.stencilFunc(gl.EQUAL, 0, 0xff); + } + ctx.bindTexture(gl.TEXTURE_2D, metaballsTex); + rrUtil.drawQuad( + ctx, texToFboShaderID, [-1.0, -1.0, 1.0], [1.0, 1.0, -1.0] + ); + if (stencil) + ctx.disable(gl.STENCIL_TEST); + + ctx.disable(gl.DEPTH_TEST); + + if (fbo.getConfig().colorType == gl.TEXTURE_2D) { + // Unbind fbo + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + + // Draw to screen + ctx.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer()); + ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight()); + rrUtil.drawQuad( + ctx, texFromFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + // Read from screen + dst.readViewport(ctx, [0, 0, ctx.getWidth(), ctx.getHeight()]); + } else { + // Read from fbo + es3fFboTestUtil.readPixels( + ctx, dst, 0, 0, width, height, colorFormat, + fboRangeInfo.lookupScale, fboRangeInfo.lookupBias + ); + } + }; + + // FboGroups + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fFboRenderTest.FboRenderTestGroup = function() { + tcuTestCase.DeqpTest.call(this, 'render', 'Rendering Tests'); + }; + + es3fFboRenderTest.FboRenderTestGroup.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + + es3fFboRenderTest.FboRenderTestGroup.prototype.constructor = + es3fFboRenderTest.FboRenderTestGroup; + + /** + * @enum {number} + */ + var FormatType = { + FLOAT: 0, + INT: 1, + UINT: 2 + }; + + // Required by specification. + /** + * @typedef {{format: number, type: FormatType}} + */ + var ColorFormatStruct; + + /** + * @typedef {{format: number, depth: boolean, stencil: boolean}} + */ + var DepthStencilFormatStruct; + + /** + * init + */ + es3fFboRenderTest.FboRenderTestGroup.prototype.init = function() { + var objectTypes = [ + gl.TEXTURE_2D, + gl.RENDERBUFFER + ]; + + /** @type {Array} */ var colorFormats = [{ + format: gl.RGBA32F, type: FormatType.FLOAT + },{ + format: gl.RGBA32I, type: FormatType.INT + },{ + format: gl.RGBA32UI, type: FormatType.UINT + },{ + format: gl.RGBA16F, type: FormatType.FLOAT + },{ + format: gl.RGBA16I, type: FormatType.INT + },{ + format: gl.RGBA16UI, type: FormatType.UINT + },/*{ + // RGB16F isn't made color-renderable through WebGL's EXT_color_buffer_float + format: gl.RGB16F, type: FormatType.FLOAT + },*/{ + format: gl.RGBA8I, type: FormatType.INT + },{ + format: gl.RGBA8UI, type: FormatType.UINT + },{ + format: gl.RGB10_A2UI, type: FormatType.UINT + },{ + format: gl.R11F_G11F_B10F, type: FormatType.FLOAT + },{ + format: gl.RG32F, type: FormatType.FLOAT + },{ + format: gl.RG32I, type: FormatType.INT + },{ + format: gl.RG32UI, type: FormatType.UINT + },{ + format: gl.RG16F, type: FormatType.FLOAT + },{ + format: gl.RG16I, type: FormatType.INT + },{ + format: gl.RG16UI, type: FormatType.UINT + },{ + format: gl.RG8, type: FormatType.FLOAT + },{ + format: gl.RG8I, type: FormatType.INT + },{ + format: gl.RG8UI, type: FormatType.UINT + },{ + format: gl.R32F, type: FormatType.FLOAT + },{ + format: gl.R32I, type: FormatType.INT + },{ + format: gl.R32UI, type: FormatType.UINT + },{ + format: gl.R16F, type: FormatType.FLOAT + },{ + format: gl.R16I, type: FormatType.INT + },{ + format: gl.R16UI, type: FormatType.UINT + },{ + format: gl.R8, type: FormatType.FLOAT + },{ + format: gl.R8I, type: FormatType.INT + },{ + format: gl.R8UI, type: FormatType.UINT + }]; + + /** @type {Array} */ + var depthStencilFormats = [{ + format: gl.DEPTH_COMPONENT32F, depth: true, stencil: false + },{ + format: gl.DEPTH_COMPONENT24, depth: true, stencil: false + },{ + format: gl.DEPTH_COMPONENT16, depth: true, stencil: false + },{ + format: gl.DEPTH32F_STENCIL8, depth: true, stencil: true + },{ + format: gl.DEPTH24_STENCIL8, depth: true, stencil: true + },{ + format: gl.STENCIL_INDEX8, depth: false, stencil: true + }]; + + /** @type {es3fFboRenderTest.FboConfig} */ var config; + var colorType; + var stencilType; + var colorFmt; + var depth; + var stencil; + var depthStencilType; + var depthStencilFormat; + + // .stencil_clear + /** @type {tcuTestCase.DeqpTest} */ + var stencilClearGroup = new tcuTestCase.DeqpTest( + 'stencil_clear', 'Stencil buffer clears' + ); + + this.addChild(stencilClearGroup); + + for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) { + colorType = gl.TEXTURE_2D; + stencilType = gl.RENDERBUFFER; + colorFmt = gl.RGBA8; + + if (!depthStencilFormats[fmtNdx].stencil) + continue; + + config = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, + colorType, colorFmt, stencilType, + depthStencilFormats[fmtNdx].format + ); + stencilClearGroup.addChild( + new es3fFboRenderTest.StencilClearsTest(config) + ); + } + + // .shared_colorbuffer_clear + /** @type {tcuTestCase.DeqpTest} */ + var sharedColorbufferClearGroup = new tcuTestCase.DeqpTest( + 'shared_colorbuffer_clear', 'Shader colorbuffer clears' + ); + + this.addChild(sharedColorbufferClearGroup); + + for (var colorFmtNdx = 0; + colorFmtNdx < colorFormats.length; + colorFmtNdx++) { + + // Clearing of integer buffers is undefined. + if (colorFormats[colorFmtNdx].type == FormatType.INT || + colorFormats[colorFmtNdx].type == FormatType.UINT) + continue; + + for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) { + config = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT, objectTypes[typeNdx], + colorFormats[colorFmtNdx].format, gl.NONE, gl.NONE + ); + sharedColorbufferClearGroup.addChild( + new es3fFboRenderTest.SharedColorbufferClearsTest(config) + ); + } + } + + // .shared_colorbuffer + /** @type {Array} */ var sharedColorbufferGroup = []; + var numSharedColorbufferGroups = 3; + for (var ii = 0; ii < numSharedColorbufferGroups; ++ii) { + sharedColorbufferGroup[ii] = new tcuTestCase.DeqpTest( + 'shared_colorbuffer', 'Shared colorbuffer tests' + ); + this.addChild(sharedColorbufferGroup[ii]); + } + + for (var colorFmtNdx = 0; colorFmtNdx < colorFormats.length; colorFmtNdx++) { + + depthStencilType = gl.RENDERBUFFER; + depthStencilFormat = gl.DEPTH24_STENCIL8; + + // Blending with integer buffers and fp32 targets is not supported. + if (colorFormats[colorFmtNdx].type == FormatType.INT || + colorFormats[colorFmtNdx].type == FormatType.UINT || + colorFormats[colorFmtNdx].format == gl.RGBA32F || + colorFormats[colorFmtNdx].format == gl.RGB32F || + colorFormats[colorFmtNdx].format == gl.RG32F || + colorFormats[colorFmtNdx].format == gl.R32F) + continue; + + for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) { + /** @type {es3fFboRenderTest.FboConfig} */ + var colorOnlyConfig = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT, objectTypes[typeNdx], + colorFormats[colorFmtNdx].format, gl.NONE, gl.NONE + ); + /** @type {es3fFboRenderTest.FboConfig} */ + var colorDepthConfig = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT, + objectTypes[typeNdx], colorFormats[colorFmtNdx].format, + depthStencilType, depthStencilFormat + ); + /** @type {es3fFboRenderTest.FboConfig} */ + var colorDepthStencilConfig = + new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT | + gl.DEPTH_BUFFER_BIT | + gl.STENCIL_BUFFER_BIT, + objectTypes[typeNdx], colorFormats[colorFmtNdx].format, + depthStencilType, depthStencilFormat + ); + + sharedColorbufferGroup[0].addChild( + new es3fFboRenderTest.SharedColorbufferTest(colorOnlyConfig) + ); + + sharedColorbufferGroup[1].addChild( + new es3fFboRenderTest.SharedColorbufferTest( + colorDepthConfig + ) + ); + + sharedColorbufferGroup[2].addChild( + new es3fFboRenderTest.SharedColorbufferTest( + colorDepthStencilConfig + ) + ); + } + } + + // .shared_depth_stencil + /** @type {tcuTestCase.DeqpTest} */ + var sharedDepthStencilGroup = new tcuTestCase.DeqpTest( + 'shared_depth_stencil', 'Shared depth and stencil buffers' + ); + + this.addChild(sharedDepthStencilGroup); + + for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) { + colorType = gl.TEXTURE_2D; + colorFmt = gl.RGBA8; + depth = depthStencilFormats[fmtNdx].depth; + stencil = depthStencilFormats[fmtNdx].stencil; + + if (!depth) + continue; // Not verified. + + // Depth and stencil: both rbo and textures + for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) { + config = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT | + (depth ? gl.DEPTH_BUFFER_BIT : 0) | + (stencil ? gl.STENCIL_BUFFER_BIT : 0), + colorType, colorFmt, objectTypes[typeNdx], + depthStencilFormats[fmtNdx].format + ); + + sharedDepthStencilGroup.addChild( + new es3fFboRenderTest.SharedDepthStencilTest(config) + ); + } + } + + // .resize + /** @type {Array} */ var resizeGroup = []; + var numResizeGroups = 4; + for (var ii = 0; ii < numResizeGroups; ++ii) { + resizeGroup[ii] = new tcuTestCase.DeqpTest('resize', 'FBO resize tests'); + this.addChild(resizeGroup[ii]); + } + + for (var colorFmtNdx = 0; colorFmtNdx < colorFormats.length; colorFmtNdx++) { + + var colorFormat = colorFormats[colorFmtNdx].format; + + // Color-only. + for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) { + config = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT, objectTypes[typeNdx], + colorFormat, gl.NONE, gl.NONE + ); + resizeGroup[colorFmtNdx % numResizeGroups].addChild(new es3fFboRenderTest.ResizeTest(config)); + } + + // For selected color formats tests depth & stencil variants. + if (colorFormat == gl.RGBA8 || colorFormat == gl.RGBA16F) { + for (var depthStencilFmtNdx = 0; depthStencilFmtNdx < depthStencilFormats.length; depthStencilFmtNdx++) { + + colorType = gl.TEXTURE_2D; + depth = depthStencilFormats[depthStencilFmtNdx].depth; + stencil = depthStencilFormats[depthStencilFmtNdx].stencil; + + // Depth and stencil: both rbo and textures + for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) { + + if (!depth && objectTypes[typeNdx] != gl.RENDERBUFFER) + continue; // Not supported. + + config = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT | + (depth ? gl.DEPTH_BUFFER_BIT : 0) | + (stencil ? gl.STENCIL_BUFFER_BIT : 0), + colorType, colorFormat, objectTypes[typeNdx], + depthStencilFormats[depthStencilFmtNdx].format + ); + + resizeGroup[colorFmtNdx % numResizeGroups].addChild( + new es3fFboRenderTest.ResizeTest(config) + ); + } + } + } + } + + // .recreate_color + /** @type {Array} */ var recreateColorGroup = []; + var numRecreateColorGroups = 7; + for (var ii = 0; ii < numRecreateColorGroups; ++ii) { + recreateColorGroup[ii] = new tcuTestCase.DeqpTest('recreate_color', 'Recreate colorbuffer tests'); + this.addChild(recreateColorGroup[ii]); + } + + for (var colorFmtNdx = 0; colorFmtNdx < colorFormats.length; colorFmtNdx++) { + + colorFormat = colorFormats[colorFmtNdx].format; + depthStencilFormat = gl.DEPTH24_STENCIL8; + depthStencilType = gl.RENDERBUFFER; + + // Color-only. + for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) { + config = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT | + gl.DEPTH_BUFFER_BIT | + gl.STENCIL_BUFFER_BIT, + objectTypes[typeNdx], colorFormat, + depthStencilType, depthStencilFormat + ); + + recreateColorGroup[colorFmtNdx % numRecreateColorGroups].addChild( + new es3fFboRenderTest.RecreateBuffersTest( + config, gl.COLOR_BUFFER_BIT, true /* rebind */ + ) + ); + } + } + + // .recreate_depth_stencil + /** @type {tcuTestCase.DeqpTest} */ + var recreateDepthStencilGroup = new tcuTestCase.DeqpTest( + 'recreate_depth_stencil', 'Recreate depth and stencil buffers' + ); + + this.addChild(recreateDepthStencilGroup); + + for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) { + colorType = gl.TEXTURE_2D; + colorFmt = gl.RGBA8; + depth = depthStencilFormats[fmtNdx].depth; + stencil = depthStencilFormats[fmtNdx].stencil; + + // Depth and stencil: both rbo and textures + for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) { + if (!depth && objectTypes[typeNdx] != gl.RENDERBUFFER) + continue; + + config = new es3fFboRenderTest.FboConfig( + gl.COLOR_BUFFER_BIT | + (depth ? gl.DEPTH_BUFFER_BIT : 0) | + (stencil ? gl.STENCIL_BUFFER_BIT : 0), + colorType, colorFmt, objectTypes[typeNdx], + depthStencilFormats[fmtNdx].format + ); + + recreateDepthStencilGroup.addChild( + new es3fFboRenderTest.RecreateBuffersTest( + config, + (depth ? gl.DEPTH_BUFFER_BIT : 0) | + (stencil ? gl.STENCIL_BUFFER_BIT : 0), + true /* rebind */ + ) + ); + } + } + }; + + /** + * Create and execute the test cases + * @param {WebGL2RenderingContext} context + */ + es3fFboRenderTest.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + + state.setRoot(new es3fFboRenderTest.FboRenderTestGroup()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to run tests', false); + tcuTestCase.runner.terminate(); + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js new file mode 100644 index 000000000..4795790ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js @@ -0,0 +1,796 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboStateQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { +var es3fFboStateQueryTests = functional.gles3.es3fFboStateQueryTests; +var tcuTestCase = framework.common.tcuTestCase; +var glsStateQuery = modules.shared.glsStateQuery; +var es3fApiCase = functional.gles3.es3fApiCase; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +// WebGL bit depths +es3fFboStateQueryTests.colorBits = [8, 8, 8, 8]; +es3fFboStateQueryTests.depthBits = 0; +es3fFboStateQueryTests.stencilBits = 0; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} framebufferTarget + */ +es3fFboStateQueryTests.DefaultFramebufferCase = function(name, description, framebufferTarget) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_framebufferTarget = framebufferTarget; +}; + +setParentClass(es3fFboStateQueryTests.DefaultFramebufferCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.DefaultFramebufferCase.prototype.test = function() { + var hasColorBuffer = es3fFboStateQueryTests.colorBits[0] > 0 || + es3fFboStateQueryTests.colorBits[1] > 0 || + es3fFboStateQueryTests.colorBits[2] > 0 || + es3fFboStateQueryTests.colorBits[3] > 0; + var attachments = [ + gl.BACK, + gl.DEPTH, + gl.STENCIL + ]; + var attachmentExists = [ + hasColorBuffer, + es3fFboStateQueryTests.depthBits > 0, + es3fFboStateQueryTests.stencilBits > 0 + ]; + + for (var ndx = 0; ndx < attachments.length; ++ndx) { + var objType = gl.getFramebufferAttachmentParameter(this.m_framebufferTarget, attachments[ndx], gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); + if (attachmentExists[ndx]) { + this.check(objType === gl.FRAMEBUFFER_DEFAULT); + } else { + // \note [jarkko] FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE "identifes the type of object which contains the attached image". However, it + // is unclear if an object of type FRAMEBUFFER_DEFAULT can contain a null image (or a 0-bits-per-pixel image). Accept both + // FRAMEBUFFER_DEFAULT and NONE as valid results in these cases. + this.check(objType === gl.FRAMEBUFFER_DEFAULT || objType === gl.NONE); + } + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentObjectCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentObjectCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentObjectCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + + // initial + this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, gl.NONE)); + this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, null)); + + // texture + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, textureID); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 128, 128, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, 0); + + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, gl.TEXTURE)); + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, textureID)); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + + // rb + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB8, 128, 128); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, gl.RENDERBUFFER)); + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, renderbufferID)); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); + + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentTextureLevelCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentTextureLevelCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentTextureLevelCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + for (var mipmapLevel = 0; mipmapLevel < 7; ++mipmapLevel) { + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, textureID); + gl.texStorage2D(gl.TEXTURE_2D, 7, gl.RGB8, 128, 128); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, mipmapLevel); + + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, mipmapLevel)); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); + } + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, textureID); + + gl.texStorage2D(gl.TEXTURE_CUBE_MAP, 1, gl.RGB8, 128, 128); + + 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 ndx = 0; ndx < faces.length; ++ndx) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, faces[ndx], textureID, 0); + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, faces[ndx])); + } + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentTextureLayerCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentTextureLayerCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentTextureLayerCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + // tex3d + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_3D, textureID); + gl.texStorage3D(gl.TEXTURE_3D, 1, gl.RGBA8, 16, 16, 16); + + for (var layer = 0; layer < 16; ++layer) { + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, textureID, 0, layer); + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER, layer)); + } + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); + // tex2d array + textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, textureID); + gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, 16, 16, 16); + + for (var layer = 0; layer < 16; ++layer) { + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, textureID, 0, layer); + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER, layer)); + } + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentTextureColorCodingCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentTextureColorCodingCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentTextureColorCodingCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + // rgb8 color + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB8, 128, 128); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR)); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); + + // srgb8_alpha8 color + renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.SRGB8_ALPHA8, 128, 128); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.SRGB)); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); + + // depth + renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 128, 128); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR)); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentTextureComponentTypeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentTextureComponentTypeCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentTextureComponentTypeCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + // color-renderable required texture formats + var requiredColorformats = [ + [gl.R8, gl.UNSIGNED_NORMALIZED], + [gl.RG8, gl.UNSIGNED_NORMALIZED], + [gl.RGB8, gl.UNSIGNED_NORMALIZED], + [gl.RGB565, gl.UNSIGNED_NORMALIZED], + [gl.RGBA4, gl.UNSIGNED_NORMALIZED], + [gl.RGB5_A1, gl.UNSIGNED_NORMALIZED], + [gl.RGBA8, gl.UNSIGNED_NORMALIZED], + [gl.RGB10_A2, gl.UNSIGNED_NORMALIZED], + [gl.RGB10_A2UI, gl.UNSIGNED_INT], + [gl.SRGB8_ALPHA8, gl.UNSIGNED_NORMALIZED], + [gl.R8I, gl.INT], + [gl.R8UI, gl.UNSIGNED_INT], + [gl.R16I, gl.INT], + [gl.R16UI, gl.UNSIGNED_INT], + [gl.R32I, gl.INT], + [gl.R32UI, gl.UNSIGNED_INT], + [gl.RG8I, gl.INT], + [gl.RG8UI, gl.UNSIGNED_INT], + [gl.RG16I, gl.INT], + [gl.RG16UI, gl.UNSIGNED_INT], + [gl.RG32I, gl.INT], + [gl.RG32UI, gl.UNSIGNED_INT], + [gl.RGBA8I, gl.INT], + [gl.RGBA8UI, gl.UNSIGNED_INT], + [gl.RGBA16I, gl.INT], + [gl.RGBA16UI, gl.UNSIGNED_INT], + [gl.RGBA32I, gl.INT], + [gl.RGBA32UI, gl.UNSIGNED_INT] + ]; + + for (var ndx = 0; ndx < requiredColorformats.length; ++ndx) { + var colorFormat = requiredColorformats[ndx][0]; + var componentType = requiredColorformats[ndx][1]; + + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, textureID); + gl.texStorage2D(gl.TEXTURE_2D, 1, colorFormat, 128, 128); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, 0); + + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, componentType)); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); + } + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentSizeInitialCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentSizeInitialCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentSizeInitialCase.prototype.attachmentExists = function(attachment) { + var objType = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); + return objType !== gl.NONE; +}; + +/** + * @this {es3fApiCase.ApiCase} + */ +var checkAttachmentComponentSizeAtLeast = function(target, attachment, r, g, b, a, d, s) { + var referenceSizes = [r, g, b, a, d, s]; + var paramNames = [ + gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE, gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE + ]; + + for (var ndx = 0; ndx < referenceSizes.length; ++ndx) { + if (referenceSizes[ndx] == -1) + continue; + + var value = /** @type {number} */ (gl.getFramebufferAttachmentParameter(target, attachment, paramNames[ndx])); + + this.check(value >= referenceSizes[ndx], 'Expected greater or equal to ' + referenceSizes[ndx] + ' got ' + value); + } +}; + +/** + * @this {es3fApiCase.ApiCase} + */ +var checkAttachmentComponentSizeExactly = function(target, attachment, r, g, b, a, d, s) { + var referenceSizes = [r, g, b, a, d, s]; + var paramNames = [ + gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE, gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE + ]; + + for (var ndx = 0; ndx < referenceSizes.length; ++ndx) { + if (referenceSizes[ndx] == -1) + continue; + + var value = gl.getFramebufferAttachmentParameter(target, attachment, paramNames[ndx]); + + this.check(value == referenceSizes[ndx], 'Expected equal to ' + referenceSizes[ndx] + ' got ' + value); + } +}; + +es3fFboStateQueryTests.AttachmentSizeInitialCase.prototype.test = function() { + // check default + if (this.attachmentExists(gl.BACK)) { + checkAttachmentComponentSizeAtLeast.bind(this, + gl.FRAMEBUFFER, + gl.BACK, + es3fFboStateQueryTests.colorBits[0], + es3fFboStateQueryTests.colorBits[1], + es3fFboStateQueryTests.colorBits[2], + es3fFboStateQueryTests.colorBits[3], + -1, + -1); + } + + if (this.attachmentExists(gl.DEPTH)) { + checkAttachmentComponentSizeAtLeast.bind(this, + gl.FRAMEBUFFER, + gl.DEPTH, + -1, + -1, + -1, + -1, + es3fFboStateQueryTests.depthBits, + -1); + } + + if (this.attachmentExists(gl.STENCIL)) { + checkAttachmentComponentSizeAtLeast.bind(this, + gl.FRAMEBUFFER, + gl.STENCIL, + -1, + -1, + -1, + -1, + -1, + es3fFboStateQueryTests.stencilBits); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentSizeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentSizeCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.AttachmentSizeCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + // check some color targets + + var colorAttachments = [ + //format, red, green, blue, alpha + [gl.RGBA8, 8, 8, 8, 8], + [gl.RGB565, 5, 6, 5, 0], + [gl.RGBA4, 4, 4, 4, 4], + [gl.RGB5_A1, 5, 5, 5, 1], + [gl.RGBA8I, 8, 8, 8, 8], + [gl.RG32UI, 32, 32, 0, 0] + ]; + for (var ndx = 0; ndx < colorAttachments.length; ++ndx) + this.testColorAttachment(colorAttachments[ndx][0], gl.COLOR_ATTACHMENT0, colorAttachments[ndx][1], colorAttachments[ndx][2], colorAttachments[ndx][3], colorAttachments[ndx][4]); + + // check some depth targets + + var depthAttachments = [ + // format, attachment, depth, stencil + [gl.DEPTH_COMPONENT16, gl.DEPTH_ATTACHMENT, 16, 0], + [gl.DEPTH_COMPONENT24, gl.DEPTH_ATTACHMENT, 24, 0], + [gl.DEPTH_COMPONENT32F, gl.DEPTH_ATTACHMENT, 32, 0], + [gl.DEPTH24_STENCIL8, gl.DEPTH_STENCIL_ATTACHMENT, 24, 8], + [gl.DEPTH32F_STENCIL8, gl.DEPTH_STENCIL_ATTACHMENT, 32, 8] + ]; + for (var ndx = 0; ndx < depthAttachments.length; ++ndx) + this.testDepthAttachment(depthAttachments[ndx][0], depthAttachments[ndx][1], depthAttachments[ndx][2], depthAttachments[ndx][3]); + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fFboStateQueryTests.AttachmentSizeCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentSizeRboCase = function(name, description) { + es3fFboStateQueryTests.AttachmentSizeCase.call(this, name, description); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentSizeRboCase, es3fFboStateQueryTests.AttachmentSizeCase); + +es3fFboStateQueryTests.AttachmentSizeRboCase.prototype.testColorAttachment = function(internalFormat, attachment, r, g, b, a) { + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + gl.renderbufferStorage(gl.RENDERBUFFER, internalFormat, 128, 128); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, renderbufferID); + + checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, r, g, b, a, -1, -1); + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, 0, 0); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); +}; + +es3fFboStateQueryTests.AttachmentSizeRboCase.prototype.testDepthAttachment = function(internalFormat, attachment, depth, stencil) { + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + gl.renderbufferStorage(gl.RENDERBUFFER, internalFormat, 128, 128); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, renderbufferID); + + checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, depth, stencil); + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, 0, 0, 0, 0, -1, -1); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); +}; + +/** + * @constructor + * @extends {es3fFboStateQueryTests.AttachmentSizeCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.AttachmentSizeTextureCase = function(name, description) { + es3fFboStateQueryTests.AttachmentSizeCase.call(this, name, description); +}; + +setParentClass(es3fFboStateQueryTests.AttachmentSizeTextureCase, es3fFboStateQueryTests.AttachmentSizeCase); + +es3fFboStateQueryTests.AttachmentSizeTextureCase.prototype.testColorAttachment = function(internalFormat, attachment, r, g, b, a) { + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, textureID); + gl.texStorage2D(gl.TEXTURE_2D, 1, internalFormat, 128, 128); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, textureID, 0); + + checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, r, g, b, a, -1, -1); + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, 0, 0); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); +}; + +es3fFboStateQueryTests.AttachmentSizeTextureCase.prototype.testDepthAttachment = function(internalFormat, attachment, depth, stencil) { + // don't test stencil formats with textures + if (attachment == gl.DEPTH_STENCIL_ATTACHMENT) + return; + + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, textureID); + gl.texStorage2D(gl.TEXTURE_2D, 1, internalFormat, 128, 128); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, textureID, 0); + + checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, depth, stencil); + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, 0, 0, 0, 0, -1, -1); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + // color + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR)); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); + + // depth + renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR)); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase.prototype.test = function() { + var framebufferID = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID); + // check color target + this.testColorAttachment(); + + // check depth target + this.testDepthAttachment(); + gl.deleteFramebuffer(framebufferID); +}; + +/** + * @constructor + * @extends {es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase = function(name, description) { + es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase.call(this, name, description); +}; + +setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase, es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase); + +es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase.prototype.testColorAttachment = function() { + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID); + + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0, 0, 0, 0, 0, 0); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); +}; + +es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase.prototype.testDepthAttachment = function() { + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbufferID); + + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, 0, 0, 0, 0, 0, 0); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(renderbufferID); +}; + +/** + * @constructor + * @extends {es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase = function(name, description) { + es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase.call(this, name, description); +}; + +setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase, es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase); + +es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase.prototype.testColorAttachment = function() { + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, textureID); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, 0); + + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0, 0, 0, 0, 0, 0); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); +}; + +es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase.prototype.testDepthAttachment = function() { + var textureID = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, textureID); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, textureID, 0); + + checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, 0, 0, 0, 0, 0, 0); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, null, 0); + gl.deleteTexture(textureID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase, es3fApiCase.ApiCase); + +es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase.prototype.test = function() { +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fFboStateQueryTests.FboStateQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'fbo', 'Fbo State Query tests'); +}; + +es3fFboStateQueryTests.FboStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fFboStateQueryTests.FboStateQueryTests.prototype.constructor = es3fFboStateQueryTests.FboStateQueryTests; + +es3fFboStateQueryTests.FboStateQueryTests.prototype.init = function() { + var red = /** @type {number} */ (gl.getParameter(gl.RED_BITS)); + var green = /** @type {number} */ (gl.getParameter(gl.GREEN_BITS)); + var blue = /** @type {number} */ (gl.getParameter(gl.BLUE_BITS)); + var alpha = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS)); + es3fFboStateQueryTests.colorBits = [red, green, blue, alpha]; + es3fFboStateQueryTests.depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)); + es3fFboStateQueryTests.stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + this.addChild(new es3fFboStateQueryTests.DefaultFramebufferCase('draw_framebuffer_default_framebuffer', 'default framebuffer', gl.DRAW_FRAMEBUFFER)); + this.addChild(new es3fFboStateQueryTests.DefaultFramebufferCase('read_framebuffer_default_framebuffer', 'default framebuffer', gl.READ_FRAMEBUFFER)); + this.addChild(new es3fFboStateQueryTests.AttachmentObjectCase('framebuffer_attachment_object', 'FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE and FRAMEBUFFER_ATTACHMENT_OBJECT_NAME')); + this.addChild(new es3fFboStateQueryTests.AttachmentTextureLevelCase('framebuffer_attachment_texture_level', 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL')); + this.addChild(new es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase('framebuffer_attachment_texture_cube_map_face', 'FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE')); + this.addChild(new es3fFboStateQueryTests.AttachmentTextureLayerCase('framebuffer_attachment_texture_layer', 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER')); + this.addChild(new es3fFboStateQueryTests.AttachmentTextureColorCodingCase('framebuffer_attachment_color_encoding', 'FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING')); + this.addChild(new es3fFboStateQueryTests.AttachmentTextureComponentTypeCase('framebuffer_attachment_component_type', 'FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE')); + this.addChild(new es3fFboStateQueryTests.AttachmentSizeInitialCase('framebuffer_attachment_x_size_initial', 'FRAMEBUFFER_ATTACHMENT_x_SIZE')); + this.addChild(new es3fFboStateQueryTests.AttachmentSizeRboCase('framebuffer_attachment_x_size_rbo', 'FRAMEBUFFER_ATTACHMENT_x_SIZE')); + this.addChild(new es3fFboStateQueryTests.AttachmentSizeTextureCase('framebuffer_attachment_x_size_texture', 'FRAMEBUFFER_ATTACHMENT_x_SIZE')); + this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase('framebuffer_unspecified_attachment_color_encoding', 'FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING')); + this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase('framebuffer_unspecified_attachment_component_type', 'FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE')); + this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase('framebuffer_unspecified_attachment_x_size_rbo', 'FRAMEBUFFER_ATTACHMENT_x_SIZE')); + this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase('framebuffer_unspecified_attachment_x_size_texture', 'FRAMEBUFFER_ATTACHMENT_x_SIZE')); +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fFboStateQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fFboStateQueryTests.FboStateQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFboStateQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js new file mode 100644 index 000000000..4cebe7e4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js @@ -0,0 +1,325 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fFboStencilbufferTests'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('functional.gles3.es3fFboTestCase'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { + + var es3fFboStencilbufferTests = functional.gles3.es3fFboStencilbufferTests; + var es3fFboTestCase = functional.gles3.es3fFboTestCase; + var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var rrUtil = framework.referencerenderer.rrUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + + /** @type {WebGL2RenderingContext} */ var gl; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {Array} size + * @param {boolean} useDepth + */ + es3fFboStencilbufferTests.BasicFboStencilCase = function(name, desc, format, size, useDepth) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + /** @type {number} */ this.m_format = format; + /** @type {Array} */ this.m_size = size; + /** @type {boolean} */ this.m_useDepth = useDepth; + }; + + es3fFboStencilbufferTests.BasicFboStencilCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype); + es3fFboStencilbufferTests.BasicFboStencilCase.prototype.constructor = es3fFboStencilbufferTests.BasicFboStencilCase; + + es3fFboStencilbufferTests.BasicFboStencilCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + + /** + * @param {tcuSurface.Surface} dst + */ + es3fFboStencilbufferTests.BasicFboStencilCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + /** @const {number} */ var colorFormat = gl.RGBA8; + + /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + /** @type {es3fFboTestUtil.FlatColorShader} */ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var flatShaderID = this.getCurrentContext().createProgram(flatShader); + var gradShaderID = this.getCurrentContext().createProgram(gradShader); + + var fbo = 0; + var colorRbo = 0; + var depthStencilRbo = 0; + + // Colorbuffer. + colorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_size[0], this.m_size[1]); + + // Stencil (and depth) buffer. + depthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_size[0], this.m_size[1]); + + // Framebuffer. + fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + if (this.m_useDepth) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, this.m_size[0], this.m_size[1]); + + // Clear framebuffer. + ctx.clearBufferfv(gl.COLOR, 0, [0.0, 0.0, 0.0, 0.0]); + ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0); + + // Render intersecting quads - increment stencil on depth pass + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilFunc(gl.ALWAYS, 0, 0xff); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [1.0, 0.0, 0.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + + gradShader.setGradient(this.getCurrentContext(), gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + ctx.disable(gl.DEPTH_TEST); + + // Draw quad with stencil test (stencil == 1 or 2 depending on depth) - decrement on stencil failure + ctx.stencilFunc(gl.EQUAL, this.m_useDepth ? 2 : 1, 0xff); + ctx.stencilOp(gl.DECR, gl.KEEP, gl.KEEP); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 1.0, 0.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-0.5, -0.5, 0.0], [0.5, 0.5, 0.0]); + + // Draw quad with stencil test where stencil > 1 or 2 depending on depth buffer + ctx.stencilFunc(gl.GREATER, this.m_useDepth ? 1 : 2, 0xff); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 0.0, 1.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + + this.readPixelsUsingFormat(dst, 0, 0, this.m_size[0], this.m_size[1], gluTextureUtil.mapGLInternalFormat(colorFormat), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]); + }; + + /** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} attachDepth + */ + es3fFboStencilbufferTests.DepthStencilAttachCase = function(name, desc, attachDepth, attachStencil) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + /** @type {number} */ this.m_attachDepth = attachDepth; + /** @type {number} */ this.m_attachStencil = attachStencil; + DE_ASSERT(this.m_attachDepth == gl.DEPTH_ATTACHMENT || this.m_attachDepth == gl.DEPTH_STENCIL_ATTACHMENT || this.m_attachDepth == gl.NONE); + DE_ASSERT(this.m_attachStencil == gl.STENCIL_ATTACHMENT || this.m_attachStencil == gl.NONE); + DE_ASSERT(this.m_attachDepth != gl.DEPTH_STENCIL || this.m_attachStencil == gl.NONE); + }; + + es3fFboStencilbufferTests.DepthStencilAttachCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype); + es3fFboStencilbufferTests.DepthStencilAttachCase.prototype.constructor = es3fFboStencilbufferTests.DepthStencilAttachCase; + + /** + * @param {tcuSurface.Surface} dst + */ + es3fFboStencilbufferTests.DepthStencilAttachCase.prototype.render = function(dst) { + + var ctx = this.getCurrentContext(); + /** @const {number} */ var colorFormat = gl.RGBA8; + /** @const {number} */ var depthStencilFormat = gl.DEPTH24_STENCIL8; + /** @const {number} */ var width = 128; + /** @const {number} */ var height = 128; + /** @const {boolean} */ var hasDepth = this.m_attachDepth == gl.DEPTH_STENCIL || this.m_attachDepth == gl.DEPTH_ATTACHMENT; + // /** @const {boolean} */ var hasStencil = this.m_attachDepth == gl.DEPTH_STENCIL || this.m_attachStencil == gl.DEPTH_STENCIL_ATTACHMENT); // commented out in original code + + /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + /** @type {es3fFboTestUtil.FlatColorShader} */ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + var flatShaderID = this.getCurrentContext().createProgram(flatShader); + var gradShaderID = this.getCurrentContext().createProgram(gradShader); + + var fbo = 0; + var colorRbo = 0; + var depthStencilRbo = 0; + + // Colorbuffer. + colorRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, width, height); + + // Depth-stencil buffer. + depthStencilRbo = ctx.createRenderbuffer(); + ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, depthStencilFormat, width, height); + + // Framebuffer. + fbo = ctx.createFramebuffer(); + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo); + + if (this.m_attachDepth != gl.NONE) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, this.m_attachDepth, gl.RENDERBUFFER, depthStencilRbo); + if (this.m_attachStencil != gl.NONE) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, this.m_attachStencil, gl.RENDERBUFFER, depthStencilRbo); + + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, width, height); + + // Clear framebuffer. + ctx.clearBufferfv(gl.COLOR, 0, [0.0, 0.0, 0.0, 0.0]); + ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0); + + // Render intersecting quads - increment stencil on depth pass + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilFunc(gl.ALWAYS, 0, 0xff); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [1.0, 0.0, 0.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + + gradShader.setGradient(this.getCurrentContext(), gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]); + + ctx.disable(gl.DEPTH_TEST); + + // Draw quad with stencil test (stencil == 1 or 2 depending on depth) - decrement on stencil failure + ctx.stencilFunc(gl.EQUAL, hasDepth ? 2 : 1, 0xff); + ctx.stencilOp(gl.DECR, gl.KEEP, gl.KEEP); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 1.0, 0.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-0.5, -0.5, 0.0], [0.5, 0.5, 0.0]); + + // Draw quad with stencil test where stencil > 1 or 2 depending on depth buffer + ctx.stencilFunc(gl.GREATER, hasDepth ? 1 : 2, 0xff); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 0.0, 1.0, 1.0]); + + rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]); + + this.readPixelsUsingFormat(dst, 0, 0, width, height, gluTextureUtil.mapGLInternalFormat(colorFormat), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fFboStencilbufferTests.FboStencilTests = function() { + tcuTestCase.DeqpTest.call(this, 'stencil', 'FBO Stencilbuffer tests'); + }; + + es3fFboStencilbufferTests.FboStencilTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFboStencilbufferTests.FboStencilTests.prototype.constructor = es3fFboStencilbufferTests.FboStencilTests; + + es3fFboStencilbufferTests.FboStencilTests.prototype.init = function() { + /** @const {Array} */ var stencilFormats = [ + gl.DEPTH32F_STENCIL8, + gl.DEPTH24_STENCIL8, + gl.STENCIL_INDEX8 + ]; + + // .basic + /** @type {tcuTestCase.DeqpTest} */ + var basicGroup = tcuTestCase.newTest('basic', 'Basic stencil tests'); + this.addChild(basicGroup); + + for (var fmtNdx = 0; fmtNdx < stencilFormats.length; fmtNdx++) { + /** @type {number} */ var format = stencilFormats[fmtNdx]; + /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(format); + + basicGroup.addChild(new es3fFboStencilbufferTests.BasicFboStencilCase(es3fFboTestUtil.getFormatName(format), '', format, [111, 132], false)); + + if (texFmt.order == tcuTexture.ChannelOrder.DS) + basicGroup.addChild(new es3fFboStencilbufferTests.BasicFboStencilCase(es3fFboTestUtil.getFormatName(format) + '_depth', '', format, [111, 132], true)); + } + + // .attach + /** @type {tcuTestCase.DeqpTest} */ + var attachGroup = tcuTestCase.newTest('attach', 'Attaching depth stencil'); + this.addChild(attachGroup); + + attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('depth_only', 'Only depth part of depth-stencil RBO attached', gl.DEPTH_ATTACHMENT, gl.NONE)); + attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('stencil_only', 'Only stencil part of depth-stencil RBO attached', gl.NONE, gl.STENCIL_ATTACHMENT)); + attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('depth_stencil_separate', 'Depth and stencil attached separately', gl.DEPTH_ATTACHMENT, gl.STENCIL_ATTACHMENT)); + attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('depth_stencil_attachment', 'Depth and stencil attached with DEPTH_STENCIL_ATTACHMENT', gl.DEPTH_STENCIL_ATTACHMENT, gl.NONE)); + }; + + es3fFboStencilbufferTests.run = function(context) { + gl = context; + //Set up root Test + var state = tcuTestCase.runner; + + var test = new es3fFboStencilbufferTests.FboStencilTests(); + var testName = test.fullName(); + var testDescription = test.getDescription(); + + state.testName = testName; + state.setRoot(test); + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + test.init(); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFboStencilbufferTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js new file mode 100644 index 000000000..cdaa7d352 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js @@ -0,0 +1,483 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboTestCase'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.referencerenderer.rrRenderer'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { + +var es3fFboTestCase = functional.gles3.es3fFboTestCase; +var tcuTestCase = framework.common.tcuTestCase; +var deMath = framework.delibs.debase.deMath; +var tcuSurface = framework.common.tcuSurface; +var tcuTexture = framework.common.tcuTexture; +var rrRenderer = framework.referencerenderer.rrRenderer; +var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; +var tcuPixelFormat = framework.common.tcuPixelFormat; +var tcuImageCompare = framework.common.tcuImageCompare; +var deString = framework.delibs.debase.deString; +var sglrGLContext = framework.opengl.simplereference.sglrGLContext; +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var deRandom = framework.delibs.debase.deRandom; + +/** @typedef {(sglrGLContext.GLContext | WebGL2RenderingContext | sglrReferenceContext.ReferenceContext)} */ +es3fFboTestCase.Context; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + + /** + * es3fFboTestCase.FboTestCase class, inherits from TestCase and sglrContextWrapper + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {boolean=} useScreenSizedViewport + */ + es3fFboTestCase.FboTestCase = function(name, description, useScreenSizedViewport /*= false */) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {number} */ this.m_viewportWidth = useScreenSizedViewport === undefined ? gl.drawingBufferWidth : 128; + /** @type {number} */ this.m_viewportHeight = useScreenSizedViewport === undefined ? gl.drawingBufferHeight : 128; + /** @type {es3fFboTestCase.Context} */ this.m_curCtx = null; + }; + + es3fFboTestCase.FboTestCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFboTestCase.FboTestCase.prototype.constructor = es3fFboTestCase.FboTestCase; + + es3fFboTestCase.FboTestCase.prototype.getWidth = function() { + return Math.min(gl.drawingBufferWidth, this.m_viewportWidth); + }; + + es3fFboTestCase.FboTestCase.prototype.getHeight = function() { + return Math.min(gl.drawingBufferHeight, this.m_viewportHeight); + }; + + /** + * Sets the current context (inherited from sglrContextWrapper) + * @param {es3fFboTestCase.Context} context + */ + es3fFboTestCase.FboTestCase.prototype.setContext = function(context) { + this.m_curCtx = context; + }; + + /** + * Gets the current context (inherited from sglrContextWrapper) + * @return {es3fFboTestCase.Context} + */ + es3fFboTestCase.FboTestCase.prototype.getCurrentContext = function() { + return this.m_curCtx; + }; + + /** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + */ + es3fFboTestCase.FboTestCase.prototype.compare = function(reference, result) { + return tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), 0.05, tcuImageCompare.CompareLogMode.RESULT); + }; + + /** + * @param {number} sizedFormat + */ + es3fFboTestCase.FboTestCase.prototype.checkFormatSupport = function(sizedFormat) { + /** @const @type {boolean} */ var isCoreFormat = es3fFboTestCase.isRequiredFormat(sizedFormat); + /** @const @type {Array} */ var requiredExts = (!isCoreFormat) ? es3fFboTestCase.getEnablingExtensions(sizedFormat) : []; + + // Check that we don't try to use invalid formats. + DE_ASSERT(isCoreFormat || requiredExts); + if (requiredExts.length > 0 && !es3fFboTestCase.isAnyExtensionSupported(gl, requiredExts)) { + var msg = 'SKIP: Format ' + WebGLTestUtils.glEnumToString(gl, sizedFormat) + ' not supported'; + debug(msg); + throw new TestFailedException(msg); + } + }; + + /** + * @param {number} sizedFormat deUint32 + * @param {number} numSamples + */ + es3fFboTestCase.FboTestCase.prototype.checkSampleCount = function(sizedFormat, numSamples) { + /** @const @type {number} */ var minSampleCount = es3fFboTestCase.getMinimumSampleCount(sizedFormat); + + if (numSamples > minSampleCount) { + // Exceeds spec-mandated minimum - need to check. + /** @const @type {goog.NumberArray} */ var supportedSampleCounts = es3fFboTestCase.querySampleCounts(sizedFormat); + var supported = Array.prototype.slice.call(supportedSampleCounts); + if (supported.indexOf(numSamples) == -1) { + if (minSampleCount == 0 || numSamples > gl.getParameter(gl.MAX_SAMPLES)) { + checkMessage(false, "Sample count not supported, but it is allowed."); + return false; + } else { + throw new Error('Sample count not supported'); + } + } + return true; + } + return true; + }; + + /** + * @param {tcuSurface.Surface} dst + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {tcuTexture.TextureFormat} format + * @param {Array} scale Vec4 + * @param {Array} bias Vec4 + */ + es3fFboTestCase.FboTestCase.prototype.readPixelsUsingFormat = function(dst, x, y, width, height, format, scale, bias) { + dst.setSize(width, height); + es3fFboTestUtil.readPixels(this.getCurrentContext(), dst, x, y, width, height, format, scale, bias); + }; + + /** + * @param {tcuSurface.Surface} dst + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ + es3fFboTestCase.FboTestCase.prototype.readPixels = function(dst, x, y, width, height) { + dst.readViewport(this.getCurrentContext(), [x, y, width, height]); + }; + + /** + * @param {number} target + */ + es3fFboTestCase.FboTestCase.prototype.checkFramebufferStatus = function(target) { + /** @type {number} */ var status = this.getCurrentContext().checkFramebufferStatus(target); + if (status != gl.FRAMEBUFFER_COMPLETE) + throw new Error('Framebuffer Status: ' + WebGLTestUtils.glEnumToString(gl, status)); + }; + + es3fFboTestCase.FboTestCase.prototype.checkError = function() { + /** @type {number} */ var err = this.getCurrentContext().getError(); + if (err != gl.NO_ERROR) + throw new Error('glError: ' + WebGLTestUtils.glEnumToString(gl, err)); + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @param {Array=} value Vec4 + */ + es3fFboTestCase.FboTestCase.prototype.clearColorBuffer = function(format, value) { + if (value === undefined) value = [0.0, 0.0, 0.0, 0.0]; + es3fFboTestUtil.clearColorBuffer(this.getCurrentContext(), format, value); + }; + + es3fFboTestCase.FboTestCase.prototype.iterate = function() { + // Viewport. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name)); + /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, this.m_viewportWidth); + /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, this.m_viewportHeight); + /** @type {number} */ var x = rnd.getInt(0, gl.drawingBufferWidth - width); + /** @type {number} */ var y = rnd.getInt(0, gl.drawingBufferHeight - height); + + // Surface format and storage is choosen by render(). + /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ var result = new tcuSurface.Surface(width, height); + + // Call preCheck() that can throw exception if some requirement is not met. + if (this.preCheck && !this.preCheck()) + return tcuTestCase.IterateResult.STOP; + + // Render using GLES3. + try { + /** @type {sglrGLContext.GLContext} */ var context = new sglrGLContext.GLContext( + gl, + [x, y, width, height]); + + this.setContext(context); + this.render(result); + + // Check error. + /** @type {number} */ var err = context.getError(); + if (err != gl.NO_ERROR) + throw new Error('glError: ' + context); + + this.setContext(null); + } catch (e) { + if (e instanceof es3fFboTestUtil.FboIncompleteException) + if (e.getReason() == gl.FRAMEBUFFER_UNSUPPORTED) { + // log << e; + // m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, 'Not supported'); + assertMsgOptions(false, 'Not supported', true, false); + return tcuTestCase.IterateResult.STOP; + } + throw e; + } + + // Render reference. + var alphaBits = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS)); + /** @type {sglrReferenceContext.ReferenceContextBuffers} */ + var buffers = new sglrReferenceContext.ReferenceContextBuffers(new tcuPixelFormat.PixelFormat( + 8, + 8, + 8, + alphaBits > 0 ? 8 : 0), + /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)), + /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)), + width, + height); + /** @type {sglrReferenceContext.ReferenceContext} */ + var refContext = new sglrReferenceContext.ReferenceContext(new sglrReferenceContext.ReferenceContextLimits(gl), + buffers.getColorbuffer(), + buffers.getDepthbuffer(), + buffers.getStencilbuffer()); + refContext.getError(); + this.setContext(refContext); + this.render(reference); + this.setContext(null); + + /** @type {boolean} */ var isOk = this.compare(reference, result); + + assertMsgOptions(isOk, '', true, false); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * Deinit. Clear some GL state variables + */ + es3fFboTestCase.FboTestCase.prototype.deinit = function () { + // Pixel operations + { + gl.disable(gl.SCISSOR_TEST); + + gl.disable(gl.STENCIL_TEST); + gl.stencilFunc(gl.ALWAYS, 0, 0xffff); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + + gl.disable(gl.DEPTH_TEST); + gl.depthFunc(gl.LESS); + + gl.disable(gl.BLEND); + gl.blendFunc(gl.ONE, gl.ZERO); + gl.blendEquation(gl.FUNC_ADD); + gl.blendColor(0.0, 0.0, 0.0, 0.0); + + gl.enable(gl.DITHER); + } + + // Framebuffer control + { + gl.colorMask(true, true, true, true); + gl.depthMask(true); + gl.stencilMask(0xffff); + + gl.clearColor(0.0, 0.0, 0.0, 0.0); + gl.clearDepth(1.0); + gl.clearStencil(0.0); + // Do not call clear() here because it might generate an INVALID_OPERATION if + // some color buffers are of integer formats due to WebGL2 specific constraint. + // The tests do not rely on clear() here. + } + }; + + /** + * @param {number} format + * @return {boolean} + */ + es3fFboTestCase.isRequiredFormat = function(format) { + switch (format) { + // Color-renderable formats + case gl.RGBA32I: + case gl.RGBA32UI: + case gl.RGBA16I: + case gl.RGBA16UI: + case gl.RGBA8: + case gl.RGBA8I: + case gl.RGBA8UI: + case gl.SRGB8_ALPHA8: + case gl.RGB10_A2: + case gl.RGB10_A2UI: + case gl.RGBA4: + case gl.RGB5_A1: + case gl.RGB8: + case gl.RGB565: + case gl.RG32I: + case gl.RG32UI: + case gl.RG16I: + case gl.RG16UI: + case gl.RG8: + case gl.RG8I: + case gl.RG8UI: + case gl.R32I: + case gl.R32UI: + case gl.R16I: + case gl.R16UI: + case gl.R8: + case gl.R8I: + case gl.R8UI: + return true; + + // Depth formats + case gl.DEPTH_COMPONENT32F: + case gl.DEPTH_COMPONENT24: + case gl.DEPTH_COMPONENT16: + return true; + + // Depth+stencil formats + case gl.DEPTH32F_STENCIL8: + case gl.DEPTH24_STENCIL8: + return true; + + // Stencil formats + case gl.STENCIL_INDEX8: + return true; + + default: + return false; + } + }; + + /** + * @param {number} format deUint32 + * @return {Array} + */ + es3fFboTestCase.getEnablingExtensions = function(format) { + /** @return {Array} */ var out = []; + + DE_ASSERT(!es3fFboTestCase.isRequiredFormat(format)); + + switch (format) { + case gl.RGBA16F: + case gl.RG16F: + case gl.R16F: + case gl.RGBA32F: + case gl.RGB32F: + case gl.R11F_G11F_B10F: + case gl.RG32F: + case gl.R32F: + out.push('EXT_color_buffer_float'); + break; + case gl.RGB16F: + // EXT_color_buffer_half_float is not exposed in WebGL 2.0. + break; + default: + break; + } + + return out; + }; + + /** + * @param {es3fFboTestCase.Context} context + * @param {Array} requiredExts + * @return {boolean} + */ + es3fFboTestCase.isAnyExtensionSupported = function(context, requiredExts) { + for (var iter in requiredExts) { + /** @const @type {string} */ var extension = requiredExts[iter]; + + if (sglrGLContext.isExtensionSupported(gl, extension)) { + // enable the extension + gl.getExtension(extension); + return true; + } + } + + return false; + }; + +/** + * @param {number} format GL format + * @return {number} + */ +es3fFboTestCase.getMinimumSampleCount = function(format) { + switch (format) { + // Core formats + case gl.RGBA32I: + case gl.RGBA32UI: + case gl.RGBA16I: + case gl.RGBA16UI: + case gl.RGBA8: + case gl.RGBA8I: + case gl.RGBA8UI: + case gl.SRGB8_ALPHA8: + case gl.RGB10_A2: + case gl.RGB10_A2UI: + case gl.RGBA4: + case gl.RGB5_A1: + case gl.RGB8: + case gl.RGB565: + case gl.RG32I: + case gl.RG32UI: + case gl.RG16I: + case gl.RG16UI: + case gl.RG8: + case gl.RG8I: + case gl.RG8UI: + case gl.R32I: + case gl.R32UI: + case gl.R16I: + case gl.R16UI: + case gl.R8: + case gl.R8I: + case gl.R8UI: + case gl.DEPTH_COMPONENT32F: + case gl.DEPTH_COMPONENT24: + case gl.DEPTH_COMPONENT16: + case gl.DEPTH32F_STENCIL8: + case gl.DEPTH24_STENCIL8: + case gl.STENCIL_INDEX8: + return 4; + + // gl.EXT_color_buffer_float + case gl.R11F_G11F_B10F: + case gl.RG16F: + case gl.R16F: + return 4; + + case gl.RGBA32F: + case gl.RGBA16F: + case gl.RG32F: + case gl.R32F: + return 0; + + // gl.EXT_color_buffer_half_float + case gl.RGB16F: + return 0; + + default: + throw new Error('Unknown format:' + format); + } +}; + +es3fFboTestCase.querySampleCounts = function(format) { + return gl.getInternalformatParameter(gl.RENDERBUFFER, format, gl.SAMPLES); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js new file mode 100644 index 000000000..ed152a43e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js @@ -0,0 +1,1324 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFboTestUtil'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); + +goog.scope(function() { + +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuRGBA = framework.common.tcuRGBA; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var deMath = framework.delibs.debase.deMath; +var rrShadingContext = framework.referencerenderer.rrShadingContext; +var rrVertexPacket = framework.referencerenderer.rrVertexPacket; +var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var sglrGLContext = framework.opengl.simplereference.sglrGLContext; +var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; +var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; +var rrGenericVector = framework.referencerenderer.rrGenericVector; +var tcuMatrix = framework.common.tcuMatrix; +var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; +var tcuSurface = framework.common.tcuSurface; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +/** + * Defines the exception type for a test failure. + * @constructor + * @param {number} reason The error code. + */ +es3fFboTestUtil.FboIncompleteException = function(reason) { + this.reason = reason; + this.name = 'es3fFboTestUtil.FboIncompleteException'; +}; + +/** @typedef { (WebGL2RenderingContext|sglrReferenceContext.ReferenceContext)} */ +es3fFboTestUtil.Context; + +es3fFboTestUtil.FboIncompleteException.prototype.getReason = function() {return this.reason; }; + + /** + * @param {gluShaderUtil.DataType} type + * @return {rrGenericVector.GenericVecType} + */ + es3fFboTestUtil.mapDataTypeToGenericVecType = function(type) { + switch (type) { + case gluShaderUtil.DataType.FLOAT_VEC4: return rrGenericVector.GenericVecType.FLOAT; + case gluShaderUtil.DataType.INT_VEC4: return rrGenericVector.GenericVecType.INT32; + case gluShaderUtil.DataType.UINT_VEC4: return rrGenericVector.GenericVecType.UINT32; + default: + throw new Error('Unrecognized type: ' + type); + } + }; + + /** + * @param {Array} input + * @param {{max: number, min: number}} type min, max information + * @return {Array} + */ + es3fFboTestUtil.castVectorSaturate = function(input, type) { + return [ + (input[0] + 0.5 >= type.max) ? (type.max) : ((input[0] - 0.5 <= type.min) ? (type.min) : Math.round(input[0])), + (input[1] + 0.5 >= type.max) ? (type.max) : ((input[1] - 0.5 <= type.min) ? (type.min) : Math.round(input[1])), + (input[2] + 0.5 >= type.max) ? (type.max) : ((input[2] - 0.5 <= type.min) ? (type.min) : Math.round(input[2])), + (input[3] + 0.5 >= type.max) ? (type.max) : ((input[3] - 0.5 <= type.min) ? (type.min) : Math.round(input[3])) + ]; + }; + + /** + * es3fFboTestUtil.FlatColorShader inherits from sglrShaderProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {gluShaderUtil.DataType} outputType + * @param {number=} pointSize + */ + es3fFboTestUtil.FlatColorShader = function(outputType, pointSize) { + pointSize = pointSize || 1; + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ + var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType; + + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType))); + decl.pushUniform(new sglrShaderProgram.Uniform('u_color', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' gl_PointSize = ' + pointSize + '.0;\n' + + '}\n')); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource( + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(u_color);\n' + + '}\n')); + sglrShaderProgram.ShaderProgram.call(this, decl); + this.m_pointSize = pointSize; + }; + + es3fFboTestUtil.FlatColorShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fFboTestUtil.FlatColorShader.prototype.constructor = es3fFboTestUtil.FlatColorShader; + + /** + * @param {(WebGL2RenderingContext|sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext)} context + * @param program GL program object + * @param {Array} color + */ + es3fFboTestUtil.FlatColorShader.prototype.setColor = function(context, program, color) { + /** @type {number} */ var location = context.getUniformLocation(program, 'u_color'); + + context.useProgram(program); + context.uniform4fv(location, color); + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fFboTestUtil.FlatColorShader.prototype.shadeVertices = function(inputs, packets, numPackets) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + packet.pointSize = this.m_pointSize; + } + }; + + /** + * @param {Array} packet + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fFboTestUtil.FlatColorShader.prototype.shadeFragments = function(packet, context) { + var numPackets = packet.length; + /** @const {Array} */ var color = this.m_uniforms[0].value; + /** @const {Array} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32); + /** @const {Array} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32); + + if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) + packet[packetNdx].value = color; + } else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) + packet[packetNdx].value = icolor; + } else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) + packet[packetNdx].value = uicolor; + } else + throw new Error('Invalid output type: ' + this.m_outputType); + }; + + /** + * es3fFboTestUtil.GradientShader inherits from sglrShaderProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {gluShaderUtil.DataType} outputType + */ + es3fFboTestUtil.GradientShader = function(outputType) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ + var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType; + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType))); + decl.pushUniform(new sglrShaderProgram.Uniform('u_gradientMin', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_gradientMax', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec4 a_coord;\n' + + 'out highp vec4 v_coord;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = a_coord;\n' + + '}\n')); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource( + '#version 300 es\n' + + 'in highp vec4 v_coord;\n' + + 'uniform highp vec4 u_gradientMin;\n' + + 'uniform highp vec4 u_gradientMax;\n' + + 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' highp float x = v_coord.x;\n' + + ' highp float y = v_coord.y;\n' + + ' highp float f0 = (x + y) * 0.5;\n' + + ' highp float f1 = 0.5 + (x - y) * 0.5;\n' + + ' highp vec4 fv = vec4(f0, f1, 1.0f-f0, 1.0f-f1);\n' + + ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(u_gradientMin + (u_gradientMax-u_gradientMin)*fv);\n' + + '}\n')); + sglrShaderProgram.ShaderProgram.call(this, decl); + }; + + es3fFboTestUtil.GradientShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fFboTestUtil.GradientShader.prototype.constructor = es3fFboTestUtil.GradientShader; + + /** + * @param {es3fFboTestUtil.Context} ctx GL-like context + * @param program GL program + * @param {Array} gradientMin + * @param {Array} gradientMax + */ + es3fFboTestUtil.GradientShader.prototype.setGradient = function(ctx, program, gradientMin, gradientMax) { + ctx.useProgram(program); + ctx.uniform4fv(ctx.getUniformLocation(program, 'u_gradientMin'), gradientMin); + ctx.uniform4fv(ctx.getUniformLocation(program, 'u_gradientMax'), gradientMax); + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fFboTestUtil.GradientShader.prototype.shadeVertices = function(inputs, packets, numPackets) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + } + }; + + /** + * @param {Array} packet + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fFboTestUtil.GradientShader.prototype.shadeFragments = function(packet, context) { + var numPackets = packet.length; + /** @const {Array} */ var gradientMin = this.m_uniforms[0].value; + /** @const {Array} */ var gradientMax = this.m_uniforms[1].value; + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @const {Array} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0); + /** @const {number} */ var x = coord[0]; + /** @const {number} */ var y = coord[1]; + /** @const {number} */ var f0 = (x + y) * 0.5; + /** @const {number} */ var f1 = 0.5 + (x - y) * 0.5; + /** @const {Array} */ var fv = [f0, f1, 1.0 - f0, 1.0 - f1]; + + /** @const {Array} */ var color = deMath.add(gradientMin, deMath.multiply(deMath.subtract(gradientMax, gradientMin), fv)); + /** @const {Array} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32); + /** @const {Array} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32); + + if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) + packet[packetNdx].value = color; + else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) + packet[packetNdx].value = icolor; + else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) + packet[packetNdx].value = uicolor; + else + throw new Error('Invalid output type: ' + this.m_outputType); + } + }; + + /** + * @param {Array} samplerTypes + * @param {gluShaderUtil.DataType} outputType + * @return {string} + */ + es3fFboTestUtil.genTexFragmentShader = function(samplerTypes, outputType) { + /** @type {string} */ var precision = 'highp'; + /** @type {string} */ var src = ''; + + src = '#version 300 es\n' + + 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color0;\n' + + 'in highp vec2 v_coord;\n'; + + for (var samplerNdx = 0; samplerNdx < samplerTypes.length; samplerNdx++) { + src += 'uniform ' + precision + ' ' + gluShaderUtil.getDataTypeName(samplerTypes[samplerNdx]) + ' u_sampler' + samplerNdx + ';\n' + + 'uniform ' + precision + ' vec4 u_texScale' + samplerNdx + ';\n' + + 'uniform ' + precision + ' vec4 u_texBias' + samplerNdx + ';\n'; + } + + // Output scale & bias + src += 'uniform ' + precision + ' vec4 u_outScale0;\n' + + 'uniform ' + precision + ' vec4 u_outBias0;\n'; + + src += '\n' + + 'void main (void)\n' + + '{\n' + + ' ' + precision + ' vec4 out0 = vec4(0.0);\n'; + + // Texture input fetch and combine. + for (var inNdx = 0; inNdx < samplerTypes.length; inNdx++) + src += '\tout0 += vec4(' + + 'texture(u_sampler' + inNdx + ', v_coord)) * u_texScale' + inNdx + ' + u_texBias' + inNdx + ';\n'; + + // Write output. + src += ' o_color0 = ' + gluShaderUtil.getDataTypeName(outputType) + '(out0 * u_outScale0 + u_outBias0);\n' + + '}\n'; + + return src; + }; + + /** + * @param {Array} samplerTypes + * @param {gluShaderUtil.DataType} outputType + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + es3fFboTestUtil.genTexture2DShaderDecl = function(samplerTypes, outputType) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ + var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType))); + + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec2 a_coord;\n' + + 'out highp vec2 v_coord;\n' + + 'void main(void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = a_coord;\n' + + '}\n')); + + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(es3fFboTestUtil.genTexFragmentShader(samplerTypes, outputType))); + + decl.pushUniform(new sglrShaderProgram.Uniform('u_outScale0', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_outBias0', gluShaderUtil.DataType.FLOAT_VEC4)); + + for (var ndx = 0; ndx < samplerTypes.length; ++ndx) { + decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler' + ndx, samplerTypes[ndx])); + decl.pushUniform(new sglrShaderProgram.Uniform('u_texScale' + ndx, gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_texBias' + ndx, gluShaderUtil.DataType.FLOAT_VEC4)); + } + + return decl; + }; + + /** + * For use in es3fFboTestUtil.Texture2DShader + * @constructor + */ + es3fFboTestUtil.Input = function() { + /** @type {number} */ this.unitNdx; + /** @type {Array} */ this.scale; + /** @type {Array} */ this.bias; + }; + + /** + * es3fFboTestUtil.Texture2DShader inherits from sglrShaderProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {Array} samplerTypes + * @param {gluShaderUtil.DataType} outputType + * @param {Array=} outScale - default [1.0, 1.0, 1.0, 1.0] + * @param {Array=} outBias - default [0.0, 0.0, 0.0, 0.0] + */ + es3fFboTestUtil.Texture2DShader = function(samplerTypes, outputType, outScale, outBias) { + if (outScale === undefined) outScale = [1.0, 1.0, 1.0, 1.0]; + if (outBias === undefined) outBias = [0.0, 0.0, 0.0, 0.0]; + sglrShaderProgram.ShaderProgram.call(this, es3fFboTestUtil.genTexture2DShaderDecl(samplerTypes, outputType)); + /** @type {Array} */ this.m_inputs = []; + /** @type {Array} */ this.m_outScale = outScale; + /** @type {Array} */ this.m_outBias = outBias; + /** @const {gluShaderUtil.DataType} */ this.m_outputType = outputType; + for (var ndx = 0; ndx < samplerTypes.length; ndx++) { + var input = new es3fFboTestUtil.Input(); + input.unitNdx = ndx; + input.scale = [1.0, 1.0, 1.0, 1.0]; + input.bias = [0.0, 0.0, 0.0, 0.0]; + this.m_inputs[ndx] = input; + } + }; + + es3fFboTestUtil.Texture2DShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fFboTestUtil.Texture2DShader.prototype.constructor = es3fFboTestUtil.Texture2DShader; + + /** + * @param {number} inputNdx + * @param {number} unitNdx + */ + es3fFboTestUtil.Texture2DShader.prototype.setUnit = function(inputNdx, unitNdx) { + this.m_inputs[inputNdx].unitNdx = unitNdx; + }; + + /** + * @param {number} inputNdx + * @param {Array} scale + * @param {Array} bias + */ + es3fFboTestUtil.Texture2DShader.prototype.setTexScaleBias = function(inputNdx, scale, bias) { + this.m_inputs[inputNdx].scale = scale; + this.m_inputs[inputNdx].bias = bias; + }; + + /** + * @param {Array} scale + * @param {Array} bias + */ + es3fFboTestUtil.Texture2DShader.prototype.setOutScaleBias = function(scale, bias) { + this.m_outScale = scale; + this.m_outBias = bias; + }; + + /** + * @param context GL-like context + * @param program + */ + es3fFboTestUtil.Texture2DShader.prototype.setUniforms = function(context, program) { + context.useProgram(program); + + for (var texNdx = 0; texNdx < this.m_inputs.length; texNdx++) { + /** @type {string} */ var samplerName = 'u_sampler' + texNdx; + /** @type {string} */ var scaleName = 'u_texScale' + texNdx; + /** @type {string} */ var biasName = 'u_texBias' + texNdx; + + context.uniform1i(context.getUniformLocation(program, samplerName), this.m_inputs[texNdx].unitNdx); + context.uniform4fv(context.getUniformLocation(program, scaleName), this.m_inputs[texNdx].scale); + context.uniform4fv(context.getUniformLocation(program, biasName), this.m_inputs[texNdx].bias); + } + + context.uniform4fv(context.getUniformLocation(program, 'u_outScale0'), this.m_outScale); + context.uniform4fv(context.getUniformLocation(program, 'u_outBias0'), this.m_outBias); + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fFboTestUtil.Texture2DShader.prototype.shadeVertices = function(inputs, packets, numPackets) { + // TODO: implement rrVertexAttrib.readVertexAttribFloat + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + } + }; + + /** + * @param {Array} packet + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fFboTestUtil.Texture2DShader.prototype.shadeFragments = function(packet, context) { + var numPackets = packet.length; + /** @type {Array} */ var outScale = this.m_uniforms[0].value; + /** @type {Array} */ var outBias = this.m_uniforms[1].value; + var texCoords = []; + var colors = []; + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + // setup tex coords + /** @const {Array} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0); + texCoords = [coord[0], coord[1]]; + + // clear result + colors = [0.0, 0.0, 0.0, 0.0]; + + // sample each texture + for (var ndx = 0; ndx < this.m_inputs.length; ndx++) { + var tex = this.m_uniforms[2 + ndx * 3].sampler; + var ratioX = tex.m_view.getWidth() / context.getWidth(); + var ratioY = tex.m_view.getHeight() / context.getHeight(); + var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY))); + + /** @const {Array} */ var scale = this.m_uniforms[2 + ndx * 3 + 1].value; + /** @const {Array} */ var bias = this.m_uniforms[2 + ndx * 3 + 2].value; + + var tmpColors = tex.sample(texCoords, lod); + + colors = deMath.add(colors, deMath.add(deMath.multiply(tmpColors, scale), bias)); + } + + // write out + /** @const {Array} */ var color = deMath.add(deMath.multiply(colors, outScale), outBias); + /** @const {Array} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32); + /** @const {Array} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32); + + if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) + packet[packetNdx].value = color; + else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) + packet[packetNdx].value = icolor; + else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) + packet[packetNdx].value = uicolor; + } + }; + + /** + * es3fFboTestUtil.TextureCubeShader inherits from sglrShaderProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {gluShaderUtil.DataType} samplerType + * @param {gluShaderUtil.DataType} outputType + */ + es3fFboTestUtil.TextureCubeShader = function(samplerType, outputType) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ + var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType))); + decl.pushUniform(new sglrShaderProgram.Uniform('u_coordMat', gluShaderUtil.DataType.FLOAT_MAT3)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler0', samplerType)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_scale', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_bias', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in mediump vec2 a_coord;\n' + + 'uniform mat3 u_coordMat;\n' + + 'out mediump vec3 v_coord;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = u_coordMat * vec3(a_coord, 1.0);\n' + + '}\n')); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource( + '#version 300 es\n' + + 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler0;\n' + + 'uniform highp vec4 u_scale;\n' + + 'uniform highp vec4 u_bias;\n' + + 'in mediump vec3 v_coord;\n' + + 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(vec4(texture(u_sampler0, v_coord)) * u_scale + u_bias);\n' + + '}\n')); + sglrShaderProgram.ShaderProgram.call(this, decl); + /** @type {Array} */ this.m_texScale = [1.0, 1.0, 1.0, 1.0]; + /** @type {Array} */ this.m_texBias = [0.0, 0.0, 0.0, 0.0]; + /** @type {tcuMatrix.Mat3} */ this.m_coordMat; + /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType; + }; + + es3fFboTestUtil.TextureCubeShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fFboTestUtil.TextureCubeShader.prototype.constructor = es3fFboTestUtil.TextureCubeShader; + + /** + * @param {tcuTexture.CubeFace} face + */ + es3fFboTestUtil.TextureCubeShader.prototype.setFace = function(face) { + /** @const {Array>} */ var s_cubeTransforms = [ + // Face -X: (x, y, 1) -> (-1, -(2*y-1), +(2*x-1)) + [0, 0, -1, + 0, -2, 1, + 2, 0, -1], + // Face +X: (x, y, 1) -> (+1, -(2*y-1), -(2*x-1)) + [0, 0, 1, + 0, -2, 1, + -2, 0, 1], + // Face -Y: (x, y, 1) -> (+(2*x-1), -1, -(2*y-1)) + [2, 0, -1, + 0, 0, -1, + 0, -2, 1], + // Face +Y: (x, y, 1) -> (+(2*x-1), +1, +(2*y-1)) + [2, 0, -1, + 0, 0, 1, + 0, 2, -1], + // Face -Z: (x, y, 1) -> (-(2*x-1), -(2*y-1), -1) + [-2, 0, 1, + 0, -2, 1, + 0, 0, -1], + // Face +Z: (x, y, 1) -> (+(2*x-1), -(2*y-1), +1) + [2, 0, -1, + 0, -2, 1, + 0, 0, 1]]; + this.m_coordMat = /** @type {tcuMatrix.Mat3} */ (tcuMatrix.matrixFromArray(3, 3, s_cubeTransforms[face])); + }; + + /** + * @param {Array} scale + * @param {Array} bias + */ + es3fFboTestUtil.TextureCubeShader.prototype.setTexScaleBias = function(scale, bias) { + this.m_texScale = scale; + this.m_texBias = bias; + }; + + /** + * @param ctx GL-like context + * @param program + */ + es3fFboTestUtil.TextureCubeShader.prototype.setUniforms = function(ctx, program) { + ctx.useProgram(program); + + ctx.uniform1i(ctx.getUniformLocation(program, 'u_sampler0'), 0); + ctx.uniformMatrix3fv(ctx.getUniformLocation(program, 'u_coordMat'), false, this.m_coordMat.getColumnMajorData()); + ctx.uniform4fv(ctx.getUniformLocation(program, 'u_scale'), this.m_texScale); + ctx.uniform4fv(ctx.getUniformLocation(program, 'u_bias'), this.m_texBias); + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fFboTestUtil.TextureCubeShader.prototype.shadeVertices = function(inputs, packets, numPackets) { + /** @type {tcuMatrix.Matrix} */ var texCoordMat = tcuMatrix.matrixFromArray(3, 3, this.m_uniforms[0].value); + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + var x = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT)[0]; + var y = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT)[1]; + /** @type {Array} */ var a_coord = [x, y]; + /** @type {Array} */ var v_coord = tcuMatrix.multiplyMatVec(texCoordMat, [a_coord[0], a_coord[1], 1.0]); + + packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + packet.outputs[0] = [v_coord[0], v_coord[1], v_coord[2], 0.0]; + } + }; + + /** + * @param {Array} packet + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fFboTestUtil.TextureCubeShader.prototype.shadeFragments = function(packet, context) { + var numPackets = packet.length; + /** @const {Array} */ var texScale = this.m_uniforms[2].value; + /** @const {Array} */ var texBias = this.m_uniforms[3].value; + + var texCoords = []; + var colors = []; + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + var tex = this.m_uniforms[1].sampler; + var ratioX = tex.m_view.getSize() / context.getWidth(); + var ratioY = tex.m_view.getSize() / context.getHeight(); + var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY))); + + var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0); + texCoords = [coord[0], coord[1], coord[2]]; + + colors = tex.sample(texCoords, lod); + + var color = deMath.add(deMath.multiply(colors, texScale), texBias); + var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32); + var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32); + + if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) + packet[packetNdx].value = color; + else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) + packet[packetNdx].value = icolor; + else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) + packet[packetNdx].value = uicolor; + } + }; + + /** + * es3fFboTestUtil.Texture2DArrayShader inherits from sglrShaderProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {gluShaderUtil.DataType} samplerType + * @param {gluShaderUtil.DataType} outputType + */ + es3fFboTestUtil.Texture2DArrayShader = function(samplerType, outputType) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ + var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType))); + decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler0', samplerType)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_scale', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_bias', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_layer', gluShaderUtil.DataType.INT)); + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec2 a_coord;\n' + + 'out highp vec2 v_coord;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = a_coord;\n' + + '}\n')); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource( + '#version 300 es\n' + + 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler0;\n' + + 'uniform highp vec4 u_scale;\n' + + 'uniform highp vec4 u_bias;\n' + + 'uniform highp int u_layer;\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(vec4(texture(u_sampler0, vec3(v_coord, u_layer))) * u_scale + u_bias);\n' + + '}\n')); + sglrShaderProgram.ShaderProgram.call(this, decl); + /** @type {Array} */ this.m_texScale = [1.0, 1.0, 1.0, 1.0]; + /** @type {Array} */ this.m_texBias = [0.0, 0.0, 0.0, 0.0]; + /** @type {number} */ this.m_layer = 0; + /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType; + }; + + es3fFboTestUtil.Texture2DArrayShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fFboTestUtil.Texture2DArrayShader.prototype.constructor = es3fFboTestUtil.Texture2DArrayShader; + + /** + * @param {number} layer + */ + es3fFboTestUtil.Texture2DArrayShader.prototype.setLayer = function(layer) { + this.m_layer = layer; + }; + /** + * @param {Array} scale + * @param {Array} bias + */ + es3fFboTestUtil.Texture2DArrayShader.prototype.setTexScaleBias = function(scale, bias) { + this.m_texScale = scale; + this.m_texBias = bias; + }; + /** + * @param {es3fFboTestUtil.Context} ctx GL-like context + * @param program + */ + es3fFboTestUtil.Texture2DArrayShader.prototype.setUniforms = function(ctx, program) { + ctx.useProgram(program); + + ctx.uniform1i(ctx.getUniformLocation(program, 'u_sampler0'), 0); + ctx.uniform1i(ctx.getUniformLocation(program, 'u_layer'), this.m_layer); + ctx.uniform4fv(ctx.getUniformLocation(program, 'u_scale'), this.m_texScale); + ctx.uniform4fv(ctx.getUniformLocation(program, 'u_bias'), this.m_texBias); + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fFboTestUtil.Texture2DArrayShader.prototype.shadeVertices = function(inputs, packets, numPackets) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + } + }; + + /** + * @param {Array} packet + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fFboTestUtil.Texture2DArrayShader.prototype.shadeFragments = function(packet, context) { + var numPackets = packet.length; + /** @const {Array} */ var texScale = this.m_uniforms[1].value; + /** @const {Array} */ var texBias = this.m_uniforms[2].value; + /** @const {number} */ var layer = this.m_uniforms[3].value[0]; + + var texCoords = []; + var colors = []; + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + var tex = this.m_uniforms[0].sampler; + var ratioX = tex.m_view.getWidth() / context.getWidth(); + var ratioY = tex.m_view.getHeight() / context.getHeight(); + var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY))); + + /** @const {Array} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0); + texCoords = [coord[0], coord[1], layer]; + + colors = tex.sample(texCoords, lod); + + /** @const {Array} */ var color = deMath.add(deMath.multiply(colors, texScale), texBias); + /** @const {Array} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32); + /** @const {Array} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32); + + if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) + packet[packetNdx].value = color; + else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) + packet[packetNdx].value = icolor; + else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) + packet[packetNdx].value = uicolor; + } + }; + + /** + * es3fFboTestUtil.Texture3DShader inherits from sglrShaderProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {gluShaderUtil.DataType} samplerType + * @param {gluShaderUtil.DataType} outputType + */ + es3fFboTestUtil.Texture3DShader = function(samplerType, outputType) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ + var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType))); + decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler0', samplerType)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_scale', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_bias', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_depth', gluShaderUtil.DataType.FLOAT)); + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec2 a_coord;\n' + + 'out highp vec2 v_coord;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = a_coord;\n' + + '}\n')); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource( + '#version 300 es\n' + + 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler0;\n' + + 'uniform highp vec4 u_scale;\n' + + 'uniform highp vec4 u_bias;\n' + + 'uniform highp float u_depth;\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(vec4(texture(u_sampler0, vec3(v_coord, u_depth))) * u_scale + u_bias);\n' + + '}\n')); + sglrShaderProgram.ShaderProgram.call(this, decl); + /** @type {Array} */ this.m_texScale = [1.0, 1.0, 1.0, 1.0]; + /** @type {Array} */ this.m_texBias = [0.0, 0.0, 0.0, 0.0]; + /** @type {number} */ this.m_depth = 0.0; + /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType; + }; + + es3fFboTestUtil.Texture3DShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fFboTestUtil.Texture3DShader.prototype.constructor = es3fFboTestUtil.Texture3DShader; + + /** + * @param {number} depth + */ + es3fFboTestUtil.Texture3DShader.prototype.setDepth = function(depth) { + this.m_depth = depth; + }; + + /** + * @param {Array} scale + * @param {Array} bias + */ + es3fFboTestUtil.Texture3DShader.prototype.setTexScaleBias = function(scale, bias) { + this.m_texScale = scale; + this.m_texBias = bias; + }; + + /** + * @param context GL-like context + * @param program + */ + es3fFboTestUtil.Texture3DShader.prototype.setUniforms = function(context, program) { + context.useProgram(program); + context.uniform1i(context.getUniformLocation(program, 'u_sampler0'), 0); + context.uniform1f(context.getUniformLocation(program, 'u_depth'), this.m_depth); + context.uniform4fv(context.getUniformLocation(program, 'u_scale'), this.m_texScale); + context.uniform4fv(context.getUniformLocation(program, 'u_bias'), this.m_texBias); + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fFboTestUtil.Texture3DShader.prototype.shadeVertices = function(inputs, packets, numPackets) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + } + }; + + /** + * @param {Array} packet + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fFboTestUtil.Texture3DShader.prototype.shadeFragments = function(packet, context) { + var numPackets = packet.length; + /** @const {Array} */ var texScale = this.m_uniforms[1].value; + /** @const {Array} */ var texBias = this.m_uniforms[2].value; + /** @const {number} */ var depth = this.m_uniforms[3].value[0]; + + var texCoords = []; + var colors = []; + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + var tex = this.m_uniforms[0].sampler; + var ratioX = tex.m_view.getWidth() / context.getWidth(); + var ratioY = tex.m_view.getHeight() / context.getHeight(); + // TODO: what to do with Z coordinate? + var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY))); + + var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0); + texCoords = [coord[0], coord[1], depth]; + + colors = tex.sample(texCoords, lod); + + /** @const {Array} */ var color = deMath.add(deMath.multiply(colors, texScale), texBias); + /** @const {Array} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32); + /** @const {Array} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32); + + if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) + packet[packetNdx].value = color; + else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) + packet[packetNdx].value = icolor; + else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) + packet[packetNdx].value = uicolor; + } + }; + + /** + * es3fFboTestUtil.DepthGradientShader inherits from sglrShaderProgram + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {gluShaderUtil.DataType} outputType + */ + es3fFboTestUtil.DepthGradientShader = function(outputType) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ + var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT)); + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType))); + decl.pushUniform(new sglrShaderProgram.Uniform('u_maxGradient', gluShaderUtil.DataType.FLOAT)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_minGradient', gluShaderUtil.DataType.FLOAT)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_color', gluShaderUtil.DataType.FLOAT_VEC4)); + decl.pushVertexSource(new sglrShaderProgram.VertexSource( + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec4 a_coord;\n' + + 'out highp vec4 v_coord;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = a_coord;\n' + + '}\n')); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource( + '#version 300 es\n' + + 'in highp vec4 v_coord;\n' + + 'uniform highp float u_minGradient;\n' + + 'uniform highp float u_maxGradient;\n' + + 'uniform highp vec4 u_color;\n' + + 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' highp float x = v_coord.x;\n' + + ' highp float y = v_coord.y;\n' + + ' highp float f0 = (x + y) * 0.5;\n' + + ' gl_FragDepth = u_minGradient + (u_maxGradient-u_minGradient)*f0;\n' + + ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(u_color);\n' + + '}\n')); + this.m_outputType = outputType; + sglrShaderProgram.ShaderProgram.call(this, decl); + /** @const {sglrShaderProgram.Uniform} */ this.u_minGradient = this.getUniformByName('u_minGradient'); + /** @const {sglrShaderProgram.Uniform} */ this.u_maxGradient = this.getUniformByName('u_maxGradient'); + /** @const {sglrShaderProgram.Uniform} */ this.u_color = this.getUniformByName('u_color'); + }; + + es3fFboTestUtil.DepthGradientShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fFboTestUtil.DepthGradientShader.prototype.constructor = es3fFboTestUtil.DepthGradientShader; + + /** + * @param ctx GL-like context + * @param program + * @param {number} gradientMin + * @param {number} gradientMax + * @param {Array} color + */ + es3fFboTestUtil.DepthGradientShader.prototype.setUniforms = function(ctx, program, gradientMin, gradientMax, color) { + ctx.useProgram(program); + ctx.uniform1fv(ctx.getUniformLocation(program, 'u_minGradient'), [gradientMin]); + ctx.uniform1fv(ctx.getUniformLocation(program, 'u_maxGradient'), [gradientMax]); + ctx.uniform4fv(ctx.getUniformLocation(program, 'u_color'), color); + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + es3fFboTestUtil.DepthGradientShader.prototype.shadeVertices = function(inputs, packets, numPackets) { + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + } + }; + + /** + * @param {Array} packet + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fFboTestUtil.DepthGradientShader.prototype.shadeFragments = function(packet, context) { + var numPackets = packet.length; + /** @const {number} */ var gradientMin = this.u_minGradient.value[0]; + /** @const {number} */ var gradientMax = this.u_maxGradient.value[0]; + /** @type {Array} */ var color = this.u_color.value; + /** @type {Array} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32); + /** @type {Array} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32); + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {Array} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0); + /** @const {number} */ var x = coord[0]; + /** @const {number} */ var y = coord[1]; + /** @const {number} */ var f0 = (x + y) * 0.5; + + packet[packetNdx].sampleDepths[0] = gradientMin + (gradientMax - gradientMin) * f0; + + if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) + packet[packetNdx].value = color; + else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) + packet[packetNdx].value = icolor; + else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) + packet[packetNdx].value = uicolor; + } + }; + + es3fFboTestUtil.getFormatName = function(format) { + switch (format) { + case gl.RGB565: return 'rgb565'; + case gl.RGB5_A1: return 'rgb5_a1'; + case gl.RGBA4: return 'rgba4'; + case gl.DEPTH_COMPONENT16: return 'depth_component16'; + case gl.STENCIL_INDEX8: return 'stencil_index8'; + case gl.RGBA32F: return 'rgba32f'; + case gl.RGBA32I: return 'rgba32i'; + case gl.RGBA32UI: return 'rgba32ui'; + case gl.RGBA16F: return 'rgba16f'; + case gl.RGBA16I: return 'rgba16i'; + case gl.RGBA16UI: return 'rgba16ui'; + case gl.RGBA8: return 'rgba8'; + case gl.RGBA8I: return 'rgba8i'; + case gl.RGBA8UI: return 'rgba8ui'; + case gl.SRGB8_ALPHA8: return 'srgb8_alpha8'; + case gl.RGB10_A2: return 'rgb10_a2'; + case gl.RGB10_A2UI: return 'rgb10_a2ui'; + case gl.RGBA8_SNORM: return 'rgba8_snorm'; + case gl.RGB8: return 'rgb8'; + case gl.R11F_G11F_B10F: return 'r11f_g11f_b10f'; + case gl.RGB32F: return 'rgb32f'; + case gl.RGB32I: return 'rgb32i'; + case gl.RGB32UI: return 'rgb32ui'; + case gl.RGB16F: return 'rgb16f'; + case gl.RGB16I: return 'rgb16i'; + case gl.RGB16UI: return 'rgb16ui'; + case gl.RGB8_SNORM: return 'rgb8_snorm'; + case gl.RGB8I: return 'rgb8i'; + case gl.RGB8UI: return 'rgb8ui'; + case gl.SRGB8: return 'srgb8'; + case gl.RGB9_E5: return 'rgb9_e5'; + case gl.RG32F: return 'rg32f'; + case gl.RG32I: return 'rg32i'; + case gl.RG32UI: return 'rg32ui'; + case gl.RG16F: return 'rg16f'; + case gl.RG16I: return 'rg16i'; + case gl.RG16UI: return 'rg16ui'; + case gl.RG8: return 'rg8'; + case gl.RG8I: return 'rg8i'; + case gl.RG8UI: return 'rg8ui'; + case gl.RG8_SNORM: return 'rg8_snorm'; + case gl.R32F: return 'r32f'; + case gl.R32I: return 'r32i'; + case gl.R32UI: return 'r32ui'; + case gl.R16F: return 'r16f'; + case gl.R16I: return 'r16i'; + case gl.R16UI: return 'r16ui'; + case gl.R8: return 'r8'; + case gl.R8I: return 'r8i'; + case gl.R8UI: return 'r8ui'; + case gl.R8_SNORM: return 'r8_snorm'; + case gl.DEPTH_COMPONENT32F: return 'depth_component32f'; + case gl.DEPTH_COMPONENT24: return 'depth_component24'; + case gl.DEPTH32F_STENCIL8: return 'depth32f_stencil8'; + case gl.DEPTH24_STENCIL8: return 'depth24_stencil8'; + + default: + throw new Error('Unknown format in getFromatName()'); + } + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @return {gluShaderUtil.DataType} + */ + es3fFboTestUtil.getFragmentOutputType = function(format) { + switch (tcuTexture.getTextureChannelClass(format.type)) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + return gluShaderUtil.DataType.FLOAT_VEC4; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + return gluShaderUtil.DataType.UINT_VEC4; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + return gluShaderUtil.DataType.INT_VEC4; + + default: + throw new Error('Unknown format'); + } + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @return {tcuTexture.TextureFormat} + */ + es3fFboTestUtil.getFramebufferReadFormat = function(format) { + switch (tcuTexture.getTextureChannelClass(format.type)) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT); + + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32); + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT32); + + default: + throw new Error('Unknown format in es3fFboTestUtil.getFramebufferReadFormat()'); + } + }; + + /** + * @param {es3fFboTestUtil.Context} ctx GL-like context + * @param {tcuTexture.TextureFormat} format + * @param {Array} value + */ + es3fFboTestUtil.clearColorBuffer = function(ctx, format, value) { + /** @const @type {tcuTexture.TextureChannelClass} */ + var fmtClass = tcuTexture.getTextureChannelClass(format.type); + + switch (fmtClass) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + ctx.clearBufferfv(gl.COLOR, 0, value); + break; + + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + ctx.clearBufferuiv(gl.COLOR, 0, value); + break; + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + ctx.clearBufferiv(gl.COLOR, 0, value); + break; + + default: + throw new Error('Invalid channel class: ' + fmtClass); + } + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @return {tcuRGBA.RGBA} + */ + es3fFboTestUtil.getThresholdFromTextureFormat = function(format) { + /** @const @type {Array} */ var bits = tcuTextureUtil.getTextureFormatMantissaBitDepth(format); + return tcuRGBA.newRGBAComponents( + es3fFboTestUtil.calculateU8ConversionError(bits[0]), + es3fFboTestUtil.calculateU8ConversionError(bits[1]), + es3fFboTestUtil.calculateU8ConversionError(bits[2]), + es3fFboTestUtil.calculateU8ConversionError(bits[3]) + ); + }; + + /** + * @param {number} glFormat + * @return {tcuRGBA.RGBA} + */ + es3fFboTestUtil.getFormatThreshold = function(glFormat) { + /** @const @type {tcuTexture.TextureFormat} */ var format = gluTextureUtil.mapGLInternalFormat(glFormat); + return es3fFboTestUtil.getThresholdFromTextureFormat(format); + }; + + /** + * @param {number} srcBits + * @return {number} + */ + es3fFboTestUtil.getToSRGB8ConversionError = function(srcBits) { + // \note These are pre-computed based on simulation results. + /** @const @type {Array} */ var errors = [ + 1, // 0 bits - rounding + 255, // 1 bits + 157, // 2 bits + 106, // 3 bits + 74, // 4 bits + 51, // 5 bits + 34, // 6 bits + 22, // 7 bits + 13, // 8 bits + 7, // 9 bits + 4, // 10 bits + 3, // 11 bits + 2 // 12 bits + // 1 from this on + ]; + + DE_ASSERT(srcBits >= 0); + if (srcBits < errors.length) + return errors[srcBits]; + else + return 1; + }; + + /** + * @param {tcuTexture.TextureFormat} src + * @param {tcuTexture.TextureFormat} dst + * @return {tcuRGBA.RGBA} + */ + es3fFboTestUtil.getToSRGBConversionThreshold = function(src, dst) { + // Only SRGB8 and SRGB8_ALPHA8 formats are supported. + DE_ASSERT(dst.type == tcuTexture.ChannelType.UNORM_INT8); + DE_ASSERT(dst.order == tcuTexture.ChannelOrder.sRGB || dst.order == tcuTexture.ChannelOrder.sRGBA); + + /** @const @type {Array} */ var bits = tcuTextureUtil.getTextureFormatMantissaBitDepth(src); + /** @const @type {boolean} */ var dstHasAlpha = dst.order == tcuTexture.ChannelOrder.sRGBA; + + return tcuRGBA.newRGBAComponents( + es3fFboTestUtil.getToSRGB8ConversionError(bits[0]), + es3fFboTestUtil.getToSRGB8ConversionError(bits[1]), + es3fFboTestUtil.getToSRGB8ConversionError(bits[2]), + dstHasAlpha ? es3fFboTestUtil.calculateU8ConversionError(bits[3]) : 0); + }; + + /** + * es3fFboTestUtil.readPixels() + * @param {(WebGL2RenderingContext|sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext)} ctx + * @param {tcuSurface.Surface} dst + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {tcuTexture.TextureFormat} format + * @param {Array} scale + * @param {Array} bias + */ + es3fFboTestUtil.readPixels = function(ctx, dst, x, y, width, height, format, scale, bias) { + /** @type {tcuTexture.TextureFormat} */ var readFormat = es3fFboTestUtil.getFramebufferReadFormat(format); + /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(readFormat); + /** @type {number} */ var alignment = 4; // \note gl.PACK_ALIGNMENT = 4 is assumed. + /** @type {number} */ var rowSize = deMath.deAlign32(readFormat.getPixelSize() * width, alignment); + var typedArrayType = tcuTexture.getTypedArray(readFormat.type); + var data = new typedArrayType(rowSize * height); + ctx.readPixels(x, y, width, height, transferFmt.format, transferFmt.dataType, data); + + // Convert to surface. + var cpbaDescriptor = { + format: readFormat, + width: width, + height: height, + depth: 1, + rowPitch: rowSize, + slicePitch: 0, + data: data.buffer + }; + + /** @type {tcuTexture.ConstPixelBufferAccess} */ + var src = new tcuTexture.ConstPixelBufferAccess(cpbaDescriptor); + + dst.setSize(width, height); + /** @type {tcuTexture.PixelBufferAccess} */ var dstAccess = dst.getAccess(); + + for (var yo = 0; yo < height; yo++) + for (var xo = 0; xo < width; xo++) + dstAccess.setPixel(deMath.add(deMath.multiply(src.getPixel(xo, yo), scale), bias), xo, yo); + }; + + /** + * @param {number} srcBits + * @return {number} + */ + es3fFboTestUtil.calculateU8ConversionError = function(srcBits) { + if (srcBits > 0) { + /** @const @type {number} */ var clampedBits = deMath.clamp(srcBits, 0, 8); + /** @const @type {number} */ var srcMaxValue = Math.max((1 << clampedBits) - 1, 1); + /** @const @type {number} */ var error = Math.floor(Math.ceil(255.0 * 2.0 / srcMaxValue)); + + return deMath.clamp(error, 0, 255); + } else + return 1; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js new file mode 100644 index 000000000..6b5431061 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js @@ -0,0 +1,431 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFloatStateQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { + var es3fFloatStateQueryTests = functional.gles3.es3fFloatStateQueryTests; + var tcuTestCase = framework.common.tcuTestCase; + var deRandom = framework.delibs.debase.deRandom; + var deMath = framework.delibs.debase.deMath; + var es3fApiCase = functional.gles3.es3fApiCase; + var glsStateQuery = modules.shared.glsStateQuery; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.DepthRangeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.DepthRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.DepthRangeCase.prototype.constructor = es3fFloatStateQueryTests.DepthRangeCase; + + es3fFloatStateQueryTests.DepthRangeCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(gl.DEPTH_RANGE, new Float32Array([0.0, 1.0]))); + + /** @type {Array} */ var fixedTests = [ + new Float32Array([0.5, 1.0]), + new Float32Array([0.0, 0.5]), + new Float32Array([0.0, 0.0]), + new Float32Array([1.0, 1.0]) + ]; + + for (var ndx = 0; ndx < fixedTests.length; ++ndx) { + gl.depthRange(fixedTests[ndx][0], fixedTests[ndx][1]); + this.check(glsStateQuery.verify(gl.DEPTH_RANGE, fixedTests[ndx])); + } + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + // [dag] sorting to keep zNear < zFar + /** @type {Array} */ var values = [rnd.getFloat(0, 1), rnd.getFloat(0, 1)].sort(); + /** @type {Float32Array} */ var depth = new Float32Array(values); + gl.depthRange(depth[0], depth[1]); + this.check(glsStateQuery.verify(gl.DEPTH_RANGE, depth)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.LineWidthCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.LineWidthCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.LineWidthCase.prototype.constructor = es3fFloatStateQueryTests.LineWidthCase; + + es3fFloatStateQueryTests.LineWidthCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(gl.LINE_WIDTH, 1.0)); + + /** @type {Float32Array} */ var range = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)); + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var reference = rnd.getFloat(range[0], range[1]); + + gl.lineWidth(reference); + this.check(glsStateQuery.verify(gl.LINE_WIDTH, reference)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.PolygonOffsetFactorCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype.constructor = es3fFloatStateQueryTests.PolygonOffsetFactorCase; + + es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, 0.0)); + + /** @type {Array} */ var fixedTests = [0.0, 0.5, -0.5, 1.5]; + + for (var ndx = 0; ndx < fixedTests.length; ++ndx) { + gl.polygonOffset(fixedTests[ndx], 0); + this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, fixedTests[ndx])); + } + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var reference = rnd.getFloat(-64000, 64000); + + gl.polygonOffset(reference, 0); + this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, reference)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.PolygonOffsetUnitsCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype.constructor = es3fFloatStateQueryTests.PolygonOffsetUnitsCase; + + es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, 0.0)); + + /** @type {Array} */ var fixedTests = [0.0, 0.5, -0.5, 1.5]; + + for (var ndx = 0; ndx < fixedTests.length; ++ndx) { + gl.polygonOffset(0, fixedTests[ndx]); + this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, fixedTests[ndx])); + } + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var reference = rnd.getFloat(-64000, 64000); + + gl.polygonOffset(0, reference); + this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, reference)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.SampleCoverageCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.SampleCoverageCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.SampleCoverageCase.prototype.constructor = es3fFloatStateQueryTests.SampleCoverageCase; + + es3fFloatStateQueryTests.SampleCoverageCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, 1.0)); + + /** @type {Array} */ var fixedTests = [0.0, 0.5, 0.45, 0.55]; + + for (var ndx = 0; ndx < fixedTests.length; ++ndx) { + gl.sampleCoverage(fixedTests[ndx], false); + this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, fixedTests[ndx])); + } + + /** @type {Array} */ var clampTests = [-1.0, -1.5, 1.45, 3.55]; + + for (var ndx = 0; ndx < clampTests.length; ++ndx) { + gl.sampleCoverage(clampTests[ndx], false); + this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, deMath.clamp(clampTests[ndx], 0.0, 1.0))); + } + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var reference = rnd.getFloat(0, 1); + /** @type {boolean} */ var invert = rnd.getBool() ? true : false; + + gl.sampleCoverage(reference, invert); + this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, reference)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.BlendColorCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.BlendColorCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.BlendColorCase.prototype.constructor = es3fFloatStateQueryTests.BlendColorCase; + + es3fFloatStateQueryTests.BlendColorCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(gl.BLEND_COLOR, new Float32Array([0, 0, 0, 0]))); + + /** @type {Array} */ var fixedTests = [ + new Float32Array([0.5, 1.0, 0.5, 1.0]), + new Float32Array([0.0, 0.5, 0.0, 0.5]), + new Float32Array([0.0, 0.0, 0.0, 0.0]), + new Float32Array([1.0, 1.0, 1.0, 1.0]) + ]; + for (var ndx = 0; ndx < fixedTests.length; ++ndx) { + gl.blendColor(fixedTests[ndx][0], fixedTests[ndx][1], fixedTests[ndx][2], fixedTests[ndx][3]); + this.check(glsStateQuery.verify(gl.BLEND_COLOR, fixedTests[ndx])); + } + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var r = rnd.getFloat(0, 1); + /** @type {number} */ var g = rnd.getFloat(0, 1); + /** @type {number} */ var b = rnd.getFloat(0, 1); + /** @type {number} */ var a = rnd.getFloat(0, 1); + + gl.blendColor(r, g, b, a); + this.check(glsStateQuery.verify(gl.BLEND_COLOR, new Float32Array([r, g, b, a]))); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.ColorClearCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.ColorClearCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.ColorClearCase.prototype.constructor = es3fFloatStateQueryTests.ColorClearCase; + + es3fFloatStateQueryTests.ColorClearCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + // [dag] In the C++ dEQP code, initial color clear value check is temorarily removed. (until the framework does not alter it) + this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, new Float32Array([0, 0, 0, 0]))); + + /** @type {Array} */ var fixedTests = [ + new Float32Array([0.5, 1.0, 0.5, 1.0]), + new Float32Array([0.0, 0.5, 0.0, 0.5]), + new Float32Array([0.0, 0.0, 0.0, 0.0]), + new Float32Array([1.0, 1.0, 1.0, 1.0]) + ]; + for (var ndx = 0; ndx < fixedTests.length; ++ndx) { + gl.clearColor(fixedTests[ndx][0], fixedTests[ndx][1], fixedTests[ndx][2], fixedTests[ndx][3]); + this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, fixedTests[ndx])); + } + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var r = rnd.getFloat(0, 1); + /** @type {number} */ var g = rnd.getFloat(0, 1); + /** @type {number} */ var b = rnd.getFloat(0, 1); + /** @type {number} */ var a = rnd.getFloat(0, 1); + + gl.clearColor(r, g, b, a); + this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, new Float32Array([r, g, b, a]))); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.DepthClearCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.DepthClearCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.DepthClearCase.prototype.constructor = es3fFloatStateQueryTests.DepthClearCase; + + es3fFloatStateQueryTests.DepthClearCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(gl.DEPTH_CLEAR_VALUE, 1)); + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var ref = rnd.getFloat(0, 1); + + gl.clearDepth(ref); + this.check(glsStateQuery.verify(gl.DEPTH_CLEAR_VALUE, ref)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.MaxTextureLODBiasCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype.constructor = es3fFloatStateQueryTests.MaxTextureLODBiasCase; + + es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype.test = function() { + this.check(glsStateQuery.verifyGreaterOrEqual(gl.MAX_TEXTURE_LOD_BIAS, 2.0)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.AliasedPointSizeRangeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype.constructor = es3fFloatStateQueryTests.AliasedPointSizeRangeCase; + + es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype.test = function() { + var pointSizeRange = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)); + /** @type {Float32Array} */ var reference = new Float32Array([1, 1]); + this.check(pointSizeRange[0] <= reference[0] && pointSizeRange[1] >= reference[1]); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fFloatStateQueryTests.AliasedLineWidthRangeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype.constructor = es3fFloatStateQueryTests.AliasedLineWidthRangeCase; + + es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype.test = function() { + var lineWidthRange = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)); + /** @type {Float32Array} */ var reference = new Float32Array([1, 1]); + this.check(lineWidthRange[0] <= reference[0] && lineWidthRange[1] >= reference[1]); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fFloatStateQueryTests.FloatStateQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'floats', 'Float Values'); + }; + + es3fFloatStateQueryTests.FloatStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFloatStateQueryTests.FloatStateQueryTests.prototype.constructor = es3fFloatStateQueryTests.FloatStateQueryTests; + + es3fFloatStateQueryTests.FloatStateQueryTests.prototype.init = function() { + this.addChild(new es3fFloatStateQueryTests.DepthRangeCase('depth_range', 'DEPTH_RANGE')); + this.addChild(new es3fFloatStateQueryTests.LineWidthCase('line_width', 'LINE_WIDTH')); + this.addChild(new es3fFloatStateQueryTests.PolygonOffsetFactorCase('polygon_offset_factor', 'POLYGON_OFFSET_FACTOR')); + this.addChild(new es3fFloatStateQueryTests.PolygonOffsetUnitsCase('polygon_offset_units', 'POLYGON_OFFSET_UNITS')); + this.addChild(new es3fFloatStateQueryTests.SampleCoverageCase('sample_coverage_value', 'SAMPLE_COVERAGE_VALUE')); + this.addChild(new es3fFloatStateQueryTests.BlendColorCase('blend_color', 'BLEND_COLOR')); + this.addChild(new es3fFloatStateQueryTests.ColorClearCase('color_clear_value', 'COLOR_CLEAR_VALUE')); + this.addChild(new es3fFloatStateQueryTests.DepthClearCase('depth_clear_value', 'DEPTH_CLEAR_VALUE')); + this.addChild(new es3fFloatStateQueryTests.MaxTextureLODBiasCase('max_texture_lod_bias', 'MAX_TEXTURE_LOD_BIAS')); + this.addChild(new es3fFloatStateQueryTests.AliasedPointSizeRangeCase('aliased_point_size_range', 'ALIASED_POINT_SIZE_RANGE')); + this.addChild(new es3fFloatStateQueryTests.AliasedLineWidthRangeCase('aliased_line_width_range', 'ALIASED_LINE_WIDTH_RANGE')); + + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fFloatStateQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fFloatStateQueryTests.FloatStateQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFloatStateQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js new file mode 100644 index 000000000..8a892a092 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js @@ -0,0 +1,593 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFragDepthTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('modules.shared.glsShaderRenderCase'); + +goog.scope(function() { + var es3fFragDepthTests = functional.gles3.es3fFragDepthTests; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuRGBA = framework.common.tcuRGBA; + var tcuSurface = framework.common.tcuSurface; + var tcuTestCase = framework.common.tcuTestCase; + /** @typedef {function(Array):number} */ es3fFragDepthTests.EvalFragDepthFunc; + + /** @const {string} */ es3fFragDepthTests.s_vertexShaderSrc = '' + + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec2 a_coord;\n' + + 'out highp vec2 v_coord;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = a_coord;\n' + + '}\n'; + + /** @const {string} */ es3fFragDepthTests.s_defaultFragmentShaderSrc = '' + + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + '}\n'; + + /** + * @param {number} func + * @param {*} a + * @param {*} b + * @return {boolean} + */ + es3fFragDepthTests.compare = function(func, a, b) { + switch (func) { + case gl.NEVER: return false; + case gl.ALWAYS: return true; + case gl.LESS: return a < b; + case gl.LEQUAL: return a <= b; + case gl.EQUAL: return a === b; + case gl.NOTEQUAL: return a !== b; + case gl.GEQUAL: return a >= b; + case gl.GREATER: return a > b; + } + bufferedLogToConsole('Compare function not supported.'); + return false; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {string} fragSrc + * @param {?es3fFragDepthTests.EvalFragDepthFunc} evalFunc + * @param {number} compareFunc + */ + es3fFragDepthTests.FragDepthCompareCase = function(name, desc, fragSrc, evalFunc, compareFunc) { + tcuTestCase.DeqpTest.call(this, name, desc); + /** @type {string} */ this.m_fragSrc = fragSrc; + /** @type {?es3fFragDepthTests.EvalFragDepthFunc} */ this.m_evalFunc = evalFunc; + /** @type {number} */ this.m_compareFunc = compareFunc; + }; + + es3fFragDepthTests.FragDepthCompareCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFragDepthTests.FragDepthCompareCase.prototype.constructor = es3fFragDepthTests.FragDepthCompareCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fFragDepthTests.FragDepthCompareCase.prototype.iterate = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name)); + /** @type {number} */ var viewportW = Math.min(128, gl.drawingBufferWidth); + /** @type {number} */ var viewportH = Math.min(128, gl.drawingBufferHeight); + /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - viewportW); + /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - viewportH); + /** @type {tcuSurface.Surface} */ var renderedFrame = new tcuSurface.Surface(viewportW, viewportH); + /** @type {tcuSurface.Surface} */ var referenceFrame = new tcuSurface.Surface(viewportW, viewportH); + /** @type {number} */ var constDepth = 0.1; + var depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)); + + /** @type {number} */ var xf; + /** @type {number} */ var d; + /** @type {boolean} */ var dpass; + + if (depthBits == 0) + throw new Error('Depth buffer is required'); + + gl.depthMask(true); + gl.viewport(viewportX, viewportY, viewportW, viewportH); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + gl.enable(gl.DEPTH_TEST); + + /** @type {Array} */ var quadIndices = [0, 1, 2, 2, 1, 3]; + + // Fill viewport with 2 quads - one with constant depth and another with d = [-1..1] + /** @type {gluShaderProgram.ShaderProgram} */ + var basicQuadProgram = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, es3fFragDepthTests.s_defaultFragmentShaderSrc)); + + if (!basicQuadProgram.isOk()) { + bufferedLogToConsole(basicQuadProgram.getProgramInfo().infoLog); + throw new Error('Compile failed'); + } + + /** @type {Array} */ var constDepthCoord = [ + -1.0, -1.0, constDepth, 1.0, + -1.0, 1.0, constDepth, 1.0, + 0.0, -1.0, constDepth, 1.0, + 0.0, 1.0, constDepth, 1.0 + ]; + + /** @type {Array} */ var varyingDepthCoord = [ + 0.0, -1.0, 1.0, 1.0, + 0.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, -1.0, 1.0 + ]; + + gl.useProgram(basicQuadProgram.getProgram()); + gl.uniform4f(gl.getUniformLocation(basicQuadProgram.getProgram(), 'u_color'), 0.0, 0.0, 1.0, 1.0); + gl.depthFunc(gl.ALWAYS); + + /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, constDepthCoord); + gluDrawUtil.draw(gl, basicQuadProgram.getProgram(), [posBinding], gluDrawUtil.triangles(quadIndices)); + + posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, varyingDepthCoord); + gluDrawUtil.draw(gl, basicQuadProgram.getProgram(), [posBinding], gluDrawUtil.triangles(quadIndices)); + + // Render with depth test. + /** @type {gluShaderProgram.ShaderProgram} */ + var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, this.m_fragSrc)); + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) + throw new Error('Compile failed'); + + /** @type {Array} */ var coord = [ + 0.0, 0.0, + 0.0, 1.0, + 1.0, 0.0, + 1.0, 1.0 + ]; + + /** @type {Array} */ var position = [ + -1.0, -1.0, 1.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, -1.0, 1.0 + ]; + + gl.useProgram(program.getProgram()); + gl.depthFunc(this.m_compareFunc); + gl.uniform4f(gl.getUniformLocation(program.getProgram(), 'u_color'), 0.0, 1.0, 0.0, 1.0); + + // Setup default helper uniforms. + glsShaderRenderCase.setupDefaultUniforms(program.getProgram()); + + /** @type {Array} */ var vertexArrays = [ + gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, position), + gluDrawUtil.newFloatVertexArrayBinding('a_coord', 2, 4, 0, coord) + ]; + + gluDrawUtil.draw(gl, program.getProgram(), vertexArrays, gluDrawUtil.triangles(quadIndices)); + + renderedFrame.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]); + + // Render reference. + for (var y = 0; y < referenceFrame.getHeight(); y++) { + /** @type {number} */ var yf = (y + 0.5) / referenceFrame.getHeight(); + /** @type {number} */ var half = deMath.clamp(Math.floor(referenceFrame.getWidth() * 0.5 + 0.5), 0, referenceFrame.getWidth()); + + // Fill left half - comparison to constant 0.5 + for (var x = 0; x < half; x++) { + xf = (x + 0.5) / referenceFrame.getWidth(); + d = this.m_evalFunc([xf, yf]); + dpass = es3fFragDepthTests.compare(this.m_compareFunc, d, constDepth * 0.5 + 0.5); + + referenceFrame.setPixel(x, y, dpass ? tcuRGBA.RGBA.green.toIVec() : tcuRGBA.RGBA.blue.toIVec()); + } + + // Fill right half - comparison to interpolated depth + for (var x = half; x < referenceFrame.getWidth(); x++) { + xf = (x + 0.5) / referenceFrame.getWidth(); + /** @type {number} */ var xh = (x - half + 0.5) / (referenceFrame.getWidth() - half); + /** @type {number} */ var rd = 1.0 - (xh + yf) * 0.5; + d = this.m_evalFunc([xf, yf]); + dpass = es3fFragDepthTests.compare(this.m_compareFunc, d, rd); + + referenceFrame.setPixel(x, y, dpass ? tcuRGBA.RGBA.green.toIVec() : tcuRGBA.RGBA.blue.toIVec()); + } + } + + /** @type {boolean} */ var isOk = tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', referenceFrame.getAccess(), renderedFrame.getAccess(), 0.05); + + if (!isOk) + testFailedOptions('Fail', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {string} fragSrc + * @param {es3fFragDepthTests.EvalFragDepthFunc} evalFunc + */ + es3fFragDepthTests.FragDepthWriteCase = function(name, desc, fragSrc, evalFunc) { + tcuTestCase.DeqpTest.call(this, name, desc); + /** @type {string} */ this.m_fragSrc = fragSrc; + /** @type {es3fFragDepthTests.EvalFragDepthFunc} */ this.m_evalFunc = evalFunc; + }; + + es3fFragDepthTests.FragDepthWriteCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFragDepthTests.FragDepthWriteCase.prototype.constructor = es3fFragDepthTests.FragDepthWriteCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fFragDepthTests.FragDepthWriteCase.prototype.iterate = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name)); + /** @type {number} */ var viewportW = Math.min(128, gl.drawingBufferWidth); + /** @type {number} */ var viewportH = Math.min(128, gl.drawingBufferHeight); + /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - viewportW); + /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - viewportH); + /** @type {tcuSurface.Surface} */ var renderedFrame = new tcuSurface.Surface(viewportW, viewportH); + /** @type {tcuSurface.Surface} */ var referenceFrame = new tcuSurface.Surface(viewportW, viewportH); + /** @type {number} */ var numDepthSteps = 16; + /** @type {number} */ var depthStep = 1.0 / (numDepthSteps - 1); + var depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)); + + if (depthBits === 0) + throw new Error('Depth buffer is required'); + + gl.depthMask(true); + gl.viewport(viewportX, viewportY, viewportW, viewportH); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + gl.enable(gl.DEPTH_TEST); + gl.depthFunc(gl.LESS); + + /** @type {Array} */ var quadIndices = [0, 1, 2, 2, 1, 3]; + + // Render with given shader. + /** @type {gluShaderProgram.ShaderProgram} */ + var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, this.m_fragSrc)); + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) + throw new Error('Compile failed'); + + /** @type {Array} */ var coord = [ + 0.0, 0.0, + 0.0, 1.0, + 1.0, 0.0, + 1.0, 1.0 + ]; + + /** @type {Array} */ var position = [ + -1.0, -1.0, +1.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, -1.0, 1.0 + ]; + + gl.useProgram(program.getProgram()); + gl.uniform4f(gl.getUniformLocation(program.getProgram(), 'u_color'), 0.0, 1.0, 0.0, 1.0); + + // Setup default helper uniforms. + glsShaderRenderCase.setupDefaultUniforms(program.getProgram()); + + /** @type {Array} */ var vertexArrays = [ + gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, position), + gluDrawUtil.newFloatVertexArrayBinding('a_coord', 2, 4, 0, coord) + ]; + gluDrawUtil.draw(gl, program.getProgram(), vertexArrays, gluDrawUtil.triangles(quadIndices)); + + // Visualize by rendering full-screen quads with increasing depth and color. + program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, es3fFragDepthTests.s_defaultFragmentShaderSrc)); + + if (!program.isOk()) { + bufferedLogToConsole(program.getProgramInfo().infoLog); + throw new Error('Compile failed'); + } + + /** @type {WebGLUniformLocation} */ var colorLoc = gl.getUniformLocation(program.getProgram(), 'u_color'); + + gl.useProgram(program.getProgram()); + gl.depthMask(false); + + for (var stepNdx = 0; stepNdx < numDepthSteps; stepNdx++) { + /** @type {number} */ var f = stepNdx * depthStep; + /** @type {number} */ var depth = f * 2.0 - 1.0; + /** @type {Array} */ var color = [f, f, f, 1.0]; + + position = [ + -1.0, -1.0, depth, 1.0, + -1.0, 1.0, depth, 1.0, + 1.0, -1.0, depth, 1.0, + 1.0, 1.0, depth, 1.0 + ]; + + /** @type {gluDrawUtil.VertexArrayBinding} */ + var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, position); + + gl.uniform4fv(colorLoc, color); + gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(quadIndices)); + } + + renderedFrame.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]); + + // Render reference. + for (var y = 0; y < referenceFrame.getHeight(); y++) + for (var x = 0; x < referenceFrame.getWidth(); x++) { + /** @type {number} */ var xf = (x + 0.5) / referenceFrame.getWidth(); + /** @type {number} */ var yf = (y + 0.5) / referenceFrame.getHeight(); + /** @type {number} */ var d = this.m_evalFunc([xf, yf]); + /** @type {number} */ var step = Math.floor(d / depthStep); + /** @type {number} */ var col = deMath.clamp(Math.floor(step * depthStep * 255.0), 0, 255); + + referenceFrame.setPixel(x, y, [col, col, col, 0xff]); + } + + /** @type {boolean} */ var isOk = tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', referenceFrame.getAccess(), renderedFrame.getAccess(), 0.05); + + if (!isOk) + testFailedOptions('Fail', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fFragDepthTests.FragDepthTests = function() { + tcuTestCase.DeqpTest.call(this, 'fragdepth', 'gl_FragDepth tests'); + }; + + es3fFragDepthTests.FragDepthTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFragDepthTests.FragDepthTests.prototype.constructor = es3fFragDepthTests.FragDepthTests; + + /** + * @param {Array} coord + * @return {number} + */ + es3fFragDepthTests.evalConstDepth = function(coord) { + return 0.5; + }; + + /** + * @param {Array} coord + * @return {number} + */ + es3fFragDepthTests.evalDynamicDepth = function(coord) { + return (coord[0] + coord[1]) * 0.5; + }; + + /** + * @param {Array} coord + * @return {number} + */ + es3fFragDepthTests.evalNoWrite = function(coord) { + return 1.0 - (coord[0] + coord[1]) * 0.5; + }; + + /** + * @param {Array} coord + * @return {number} + */ + es3fFragDepthTests.evalDynamicConditionalDepth = function(coord) { + /** @type {number} */ var d = (coord[0] + coord[1]) * 0.5; + if (coord[1] < 0.5) + return d; + else + return 1.0 - d; + }; + + es3fFragDepthTests.FragDepthTests.prototype.init = function() { + /** + * @struct + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fFragDepthTests.EvalFragDepthFunc} evalFunc + * @param {string} fragSrc + */ + var Case = function(name, desc, evalFunc, fragSrc) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.desc = desc; + /** @type {es3fFragDepthTests.EvalFragDepthFunc} */ this.evalFunc = evalFunc; + /** @type {string} */ this.fragSrc = fragSrc; + }; + + /** @type {Array} */ var cases = [ + new Case('no_write', 'No gl_FragDepth write', es3fFragDepthTests.evalNoWrite, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + '}\n' + ), + new Case('const', 'Const depth write', es3fFragDepthTests.evalConstDepth, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' gl_FragDepth = 0.5;\n' + + '}\n' + ), + new Case('uniform', 'Uniform depth write', es3fFragDepthTests.evalConstDepth, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'uniform highp float uf_half;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' gl_FragDepth = uf_half;\n' + + '}\n' + ), + new Case('dynamic', 'Dynamic depth write', es3fFragDepthTests.evalDynamicDepth, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' gl_FragDepth = (v_coord.x+v_coord.y)*0.5;\n' + + '}\n' + ), + new Case('fragcoord_z', 'gl_FragDepth write from gl_FragCoord.z', es3fFragDepthTests.evalNoWrite, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' gl_FragDepth = gl_FragCoord.z;\n' + + '}\n' + ), + new Case('uniform_conditional_write', 'Uniform conditional write', es3fFragDepthTests.evalDynamicDepth, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'uniform bool ub_true;\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' if (ub_true)\n' + + ' gl_FragDepth = (v_coord.x+v_coord.y)*0.5;\n' + + '}\n' + ), + new Case('dynamic_conditional_write', 'Uniform conditional write', es3fFragDepthTests.evalDynamicConditionalDepth, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'uniform bool ub_true;\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' mediump float d = (v_coord.x+v_coord.y)*0.5f;\n' + + ' if (v_coord.y < 0.5)\n' + + ' gl_FragDepth = d;\n' + + ' else\n' + + ' gl_FragDepth = 1.0 - d;\n' + + '}\n' + ), + new Case('uniform_loop_write', 'Uniform loop write', es3fFragDepthTests.evalConstDepth, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'uniform int ui_two;\n' + + 'uniform highp float uf_fourth;\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' gl_FragDepth = 0.0;\n' + + ' for (int i = 0; i < ui_two; i++)\n' + + ' gl_FragDepth += uf_fourth;\n' + + '}\n' + ), + new Case('write_in_function', 'Uniform loop write', es3fFragDepthTests.evalDynamicDepth, + '#version 300 es\n' + + 'uniform highp vec4 u_color;\n' + + 'uniform highp float uf_half;\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void myfunc (highp vec2 coord)\n' + + '{\n' + + ' gl_FragDepth = (coord.x+coord.y)*0.5;\n' + + '}\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = u_color;\n' + + ' myfunc(v_coord);\n' + + '}\n' + ) + ]; + + var testGroup = tcuTestCase.runner.testCases; + + // .write + /** @type {tcuTestCase.DeqpTest} */ var writeGroup = tcuTestCase.newTest('write', 'gl_FragDepth write tests'); + testGroup.addChild(writeGroup); + for (var ndx = 0; ndx < cases.length; ndx++) + writeGroup.addChild(new es3fFragDepthTests.FragDepthWriteCase(cases[ndx].name, cases[ndx].desc, cases[ndx].fragSrc, cases[ndx].evalFunc)); + + // .compare + /** @type {tcuTestCase.DeqpTest} */ var compareGroup = tcuTestCase.newTest('compare', 'gl_FragDepth used with depth comparison'); + testGroup.addChild(compareGroup); + for (var ndx = 0; ndx < cases.length; ndx++) + compareGroup.addChild(new es3fFragDepthTests.FragDepthCompareCase(cases[ndx].name, cases[ndx].desc, cases[ndx].fragSrc, cases[ndx].evalFunc, gl.LESS)); + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fFragDepthTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fFragDepthTests.FragDepthTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fFragDepthTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js new file mode 100644 index 000000000..b27eee7a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js @@ -0,0 +1,1398 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fFragmentOutputTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { + +var es3fFragmentOutputTests = functional.gles3.es3fFragmentOutputTests; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var deRandom = framework.delibs.debase.deRandom; +var tcuTestCase = framework.common.tcuTestCase; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var deMath = framework.delibs.debase.deMath; +var tcuImageCompare = framework.common.tcuImageCompare; + + /** @type {WebGL2RenderingContext} */ var gl; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * es3fFragmentOutputTests.BufferSpec. Constructs the es3fFragmentOutputTests.BufferSpec object + * @constructor + * @param {WebGLRenderingContextBase.GLenum} format_ + * @param {number} width_ + * @param {number} height_ + * @param {number} samples_ + */ + es3fFragmentOutputTests.BufferSpec = function(format_, width_, height_, samples_) { + this.format = format_; + this.width = width_; + this.height = height_; + this.samples = samples_; + }; + + /** + * es3fFragmentOutputTests.FragmentOutput. Constructs the es3fFragmentOutputTests.FragmentOutput object + * @constructor + * @param {gluShaderUtil.DataType} type_ + * @param {gluShaderUtil.precision} precision_ + * @param {number} location_ + * @param {number=} arrayLength_ + */ + es3fFragmentOutputTests.FragmentOutput = function(type_, precision_, location_, arrayLength_) { + this.type = type_; + this.precision = precision_; + this.location = location_; + this.arrayLength = arrayLength_ || 0; + }; + + /** + * es3fFragmentOutputTests.FragmentOutputCase. Constructs the es3fFragmentOutputTests.FragmentOutputCase object + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {Array} fboSpec + * @param {Array} outputs + * @return {Object} The currently modified object + */ + es3fFragmentOutputTests.FragmentOutputCase = function(name, description, fboSpec, outputs) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {Array} */ this.m_fboSpec = fboSpec; + /** @type {Array} */ this.m_outputs = outputs; + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {WebGLFramebuffer} */ this.m_framebuffer = null; + + /** @type {WebGLRenderbuffer} */ this.m_renderbuffer = null; + }; + + es3fFragmentOutputTests.FragmentOutputCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFragmentOutputTests.FragmentOutputCase.prototype.constructor = es3fFragmentOutputTests.FragmentOutputCase; + + /** + * es3fFragmentOutputTests.createProgram. Returns a ShaderProgram object + * @param {Array} outputs + * @return {gluShaderProgram.ShaderProgram} program + */ + es3fFragmentOutputTests.createProgram = function(outputs) { + + var vtx = ''; + var frag = ''; + + vtx = '#version 300 es\n' + 'in highp vec4 a_position;\n'; + frag = '#version 300 es\n'; + + /** @type {es3fFragmentOutputTests.FragmentOutput} */ var output = null; + /** @type {boolean} */ var isArray = false; + // Input-output declarations. + for (var outNdx = 0; outNdx < outputs.length; outNdx++) { + output = outputs[outNdx]; + isArray = output.arrayLength > 0; + /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(output.type); + /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(output.precision); + /** @type {boolean} */ var isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type); + /** @type {string} */ var interp = isFloat ? 'smooth' : 'flat'; + + if (isArray) { + for (var elemNdx = 0; elemNdx < output.arrayLength; elemNdx++) { + vtx += 'in ' + precName + ' ' + typeName + ' in' + outNdx + '_' + elemNdx + ';\n' + + interp + ' out ' + precName + ' ' + typeName + ' var' + outNdx + '_' + elemNdx + ';\n'; + frag += interp + ' in ' + precName + ' ' + typeName + ' var' + outNdx + '_' + elemNdx + ';\n'; + } + frag += 'layout(location = ' + output.location + ') out ' + precName + ' ' + typeName + ' out' + outNdx + '[' + output.arrayLength + '];\n'; + } else { + vtx += 'in ' + precName + ' ' + typeName + ' in' + outNdx + ';\n' + + interp + ' out ' + precName + ' ' + typeName + ' var' + outNdx + ';\n'; + frag += interp + ' in ' + precName + ' ' + typeName + ' var' + outNdx + ';\n' + + 'layout(location = ' + output.location + ') out ' + precName + ' ' + typeName + ' out' + outNdx + ';\n'; + } + } + + vtx += '\nvoid main()\n{\n'; + frag += '\nvoid main()\n{\n'; + + vtx += ' gl_Position = a_position;\n'; + + // Copy body + for (var outNdx = 0; outNdx < outputs.length; outNdx++) { + output = outputs[outNdx]; + isArray = output.arrayLength > 0; + + if (isArray) { + for (var elemNdx = 0; elemNdx < output.arrayLength; elemNdx++) { + vtx += '\tvar' + outNdx + '_' + elemNdx + ' = in' + outNdx + '_' + elemNdx + ';\n'; + frag += '\tout' + outNdx + '[' + elemNdx + '] = var' + outNdx + '_' + elemNdx + ';\n'; + } + } else { + vtx += '\tvar' + outNdx + ' = in' + outNdx + ';\n'; + frag += '\tout' + outNdx + ' = var' + outNdx + ';\n'; + } + } + + vtx += '}\n'; + frag += '}\n'; + + /** @type {gluShaderProgram.ShaderProgram} */ + var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, frag)); + return program; + }; + + es3fFragmentOutputTests.FragmentOutputCase.prototype.init = function() { + // Check that all attachments are supported + for (var iter = 0; iter < this.m_fboSpec.length; ++iter) { + if (!gluTextureUtil.isSizedFormatColorRenderable(this.m_fboSpec[iter].format)) + throw new Error('Unsupported attachment format'); + } + + DE_ASSERT(!this.m_program); + this.m_program = es3fFragmentOutputTests.createProgram(this.m_outputs); + + // log << *m_program; + if (!this.m_program.isOk()) + throw new Error('Compile failed. Program no created'); + + /* + // Print render target info to log. + log << TestLog::Section("Framebuffer", "Framebuffer configuration"); + + for (int ndx = 0; ndx < (int)m_fboSpec.size(); ndx++) + log << TestLog::Message << "COLOR_ATTACHMENT" << ndx << ": " + << glu::getPixelFormatStr(m_fboSpec[ndx].format) << ", " + << m_fboSpec[ndx].width << "x" << m_fboSpec[ndx].height << ", " + << m_fboSpec[ndx].samples << " samples" + << TestLog::EndMessage; + + log << TestLog::EndSection;*/ + + // Create framebuffer. + this.m_framebuffer = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + + for (var bufNdx = 0; bufNdx < /* m_renderbuffers.size() */ this.m_fboSpec.length; bufNdx++) { + this.m_renderbuffer = gl.createRenderbuffer(); + /** @type {es3fFragmentOutputTests.BufferSpec} */ var bufSpec = this.m_fboSpec[bufNdx]; + /** @type {number} */ var attachment = gl.COLOR_ATTACHMENT0 + bufNdx; + + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer); + + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, bufSpec.samples, bufSpec.format, bufSpec.width, bufSpec.height); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, this.m_renderbuffer); + } + /** @type {number} */ var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + + if (fboStatus == gl.FRAMEBUFFER_UNSUPPORTED) + throw new Error('Framebuffer not supported'); + else if (fboStatus != gl.FRAMEBUFFER_COMPLETE) + throw new Error('Incomplete framebuffer'); + // throw tcu::TestError((string("Incomplete framebuffer: ") + glu::getFramebufferStatusStr(fboStatus), "", __FILE__, __LINE__); + + // gl.bindRenderbuffer(gl.RENDERBUFFER, null); // TODO: maybe needed? + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + }; + + es3fFragmentOutputTests.FragmentOutputCase.prototype.deinit = function() { + // TODO: implement? + }; + + /** + * es3fFragmentOutputTests.getMinSize. + * @param {Array} fboSpec + * @return {Array} minSize + */ + es3fFragmentOutputTests.getMinSize = function(fboSpec) { + /** @type {Array} */ var minSize = [0x7fffffff, 0x7fffffff]; + for (var i = 0; i < fboSpec.length; i++) { + minSize[0] = Math.min(minSize[0], fboSpec[i].width); + minSize[1] = Math.min(minSize[1], fboSpec[i].height); + } + return minSize; + }; + + /** + * es3fFragmentOutputTests.getNumInputVectors. Returns the length of the array of all the outputs (es3fFragmentOutputTests.FragmentOutput object) + * @param {Array} outputs + * @return {number} numVecs + */ + es3fFragmentOutputTests.getNumInputVectors = function(outputs) { + /** @type {number} */ var numVecs = 0; + for (var i = 0; i < outputs.length; i++) + numVecs += (outputs[i].arrayLength > 0 ? outputs[i].arrayLength : 1); + return numVecs; + }; + + /** + * es3fFragmentOutputTests.getFloatRange + * @param {gluShaderUtil.precision} precision + * @return {Array} Vec2 + */ + es3fFragmentOutputTests.getFloatRange = function(precision) { + /** @type {Array>} */ + var ranges = // Vec2 + [ + [-2.0, 2.0], + [-16000.0, 16000.0], + [-1e35, 1e35] + ]; + // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(ranges) == glu::PRECISION_LAST); + // DE_ASSERT(de::inBounds(precision, 0, DE_LENGTH_OF_ARRAY(ranges))); + return ranges[precision]; + }; + + /** + * es3fFragmentOutputTests.getIntRange + * @param {gluShaderUtil.precision} precision + * @return {Array} IVec2 + */ + es3fFragmentOutputTests.getIntRange = function(precision) { + /** @type {Array>} */ + var ranges = // IVec2 + [ + [-(1 << 7), (1 << 7) - 1], + [-(1 << 15), (1 << 15) - 1], + [-0x80000000, 0x7fffffff] + ]; + // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(ranges) == glu::PRECISION_LAST); + // DE_ASSERT(de::inBounds(precision, 0, DE_LENGTH_OF_ARRAY(ranges))); + return ranges[precision]; + }; + + /** + * es3fFragmentOutputTests.getUintRange + * @param {gluShaderUtil.precision} precision + * @return {Array} UVec2 + */ + es3fFragmentOutputTests.getUintRange = function(precision) { + /** @type {Array>} */ + var ranges = // UVec2 + [ + [0, (1 << 8) - 1], + [0, (1 << 16) - 1], + [0, 0xffffffff] + ]; + // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(ranges) == glu::PRECISION_LAST); + // DE_ASSERT(de::inBounds(precision, 0, DE_LENGTH_OF_ARRAY(ranges))); + return ranges[precision]; + + }; + + /** + * es3fFragmentOutputTests.readVec4 + * @param {Array} ptr + * @param {number} index + * @param {number} numComponents + * @return {Array} Vec4 + */ + es3fFragmentOutputTests.readVec4 = function(ptr, index, numComponents) { + DE_ASSERT(numComponents >= 1); + return [ + ptr[index + 0], + numComponents >= 2 ? ptr[index + 1] : 0.0, + numComponents >= 3 ? ptr[index + 2] : 0.0, + numComponents >= 4 ? ptr[index + 3] : 0.0 + ]; + }; + + /** + * es3fFragmentOutputTests.readIVec4 + * @param {Array} ptr + * @param {number} numComponents + * @return {Array} IVec4 + */ + es3fFragmentOutputTests.readIVec4 = function(ptr, index, numComponents) { + DE_ASSERT(numComponents >= 1); + return [ + ptr[index + 0], + numComponents >= 2 ? ptr[index + 1] : 0, + numComponents >= 3 ? ptr[index + 2] : 0, + numComponents >= 4 ? ptr[index + 3] : 0 + ]; + }; + + /** + * es3fFragmentOutputTests.renderFloatReference + * @param {tcuTexture.PixelBufferAccess} dst + * @param {number} gridWidth + * @param {number} gridHeight + * @param {number} numComponents + * @param {Array} vertices + */ + es3fFragmentOutputTests.renderFloatReference = function(dst, gridWidth, gridHeight, numComponents, vertices) { + + /** @type {boolean} */ var isSRGB = dst.getFormat().order == tcuTexture.ChannelOrder.sRGB || dst.getFormat().order == tcuTexture.ChannelOrder.sRGBA; + /** @type {number} */ var cellW = dst.getWidth() / (gridWidth - 1); + /** @type {number} */ var cellH = dst.getHeight() / (gridHeight - 1); + + for (var y = 0; y < dst.getHeight(); y++) { + for (var x = 0; x < dst.getWidth(); x++) { + /** @type {number} */ var cellX = deMath.clamp(Math.floor(x / cellW), 0, gridWidth - 2); + /** @type {number} */ var cellY = deMath.clamp(Math.floor(y / cellH), 0, gridHeight - 2); + /** @type {number} */ var xf = (x - cellX * cellW + 0.5) / cellW; + /** @type {number} */ var yf = (y - cellY * cellH + 0.5) / cellH; + + /** @type {Array} */ var v00 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 0) * gridWidth + cellX + 0) * numComponents, numComponents); // Vec4 + /** @type {Array} */ var v01 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 1) * gridWidth + cellX + 0) * numComponents, numComponents); // Vec4 + /** @type {Array} */ var v10 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 0) * gridWidth + cellX + 1) * numComponents, numComponents); // Vec4 + /** @type {Array} */ var v11 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 1) * gridWidth + cellX + 1) * numComponents, numComponents); // Vec4 + + /** @type {boolean} */ var tri = xf + yf >= 1.0; + /** @type {Array} */ var v0 = tri ? v11 : v00; // Vec4& + /** @type {Array} */ var v1 = tri ? v01 : v10; // Vec4& + /** @type {Array} */ var v2 = tri ? v10 : v01; // Vec4& + /** @type {number} */ var s = tri ? 1.0 - xf : xf; + /** @type {number} */ var t = tri ? 1.0 - yf : yf; + /** @type {Array} */ var color = deMath.add(v0, deMath.add(deMath.multiply((deMath.subtract(v1, v0)), [s, s, s, s]), deMath.multiply((deMath.subtract(v2, v0)), [t, t, t, t]))); // Vec4 + + dst.setPixel(isSRGB ? tcuTextureUtil.linearToSRGB(color) : color, x, y); + } + } + }; + + /** + * es3fFragmentOutputTests.renderIntReference + * @param {tcuTexture.PixelBufferAccess} dst + * @param {number} gridWidth + * @param {number} gridHeight + * @param {number} numComponents + * @param {Array} vertices + */ + es3fFragmentOutputTests.renderIntReference = function(dst, gridWidth, gridHeight, numComponents, vertices) { + + /** @type {number} */ var cellW = dst.getWidth() / (gridWidth - 1); + /** @type {number} */ var cellH = dst.getHeight() / (gridHeight - 1); + + for (var y = 0; y < dst.getHeight(); y++) { + for (var x = 0; x < dst.getWidth(); x++) { + /** @type {number} */ var cellX = deMath.clamp(Math.floor(x / cellW), 0, gridWidth - 2); + /** @type {number} */ var cellY = deMath.clamp(Math.floor(y / cellH), 0, gridHeight - 2); + /** @type {Array} */ var c = es3fFragmentOutputTests.readIVec4(vertices, (cellY * gridWidth + cellX + 1) * numComponents, numComponents); // IVec4 + + dst.setPixelInt(c, x, y); + } + } + }; + + /** + * es3fFragmentOutputTests.s_swizzles + * @return {Array>} + */ + es3fFragmentOutputTests.s_swizzles = function() { + var mat_swizzles = [ + [0, 1, 2, 3], + [1, 2, 3, 0], + [2, 3, 0, 1], + [3, 0, 1, 2], + [3, 2, 1, 0], + [2, 1, 0, 3], + [1, 0, 3, 2], + [0, 3, 2, 1] + ]; + + return mat_swizzles; + }; + + /** + * es3fFragmentOutputTests.swizzleVec. Returns an Array from a position contained in the Array es3fFragmentOutputTests.s_swizzles [] + * @param {Array} vec + * @param {number} swzNdx + * @return {Array} Swizzled array + */ + es3fFragmentOutputTests.swizzleVec = function(vec, swzNdx) { + /** @type {Array} */ var swz = es3fFragmentOutputTests.s_swizzles()[swzNdx % es3fFragmentOutputTests.s_swizzles().length]; + + return deMath.swizzle(vec, swz); + }; + + /** + * es3fFragmentOutputTests.AttachmentData struct class + * @constructor + * @return {Object} + */ + es3fFragmentOutputTests.AttachmentData = function() { + return { + /** @type {tcuTexture.TextureFormat} */ format: null, //!< Actual format of attachment. + /** @type {tcuTexture.TextureFormat} */ referenceFormat: null, //!< Used for reference rendering. + /** @type {tcuTexture.TextureFormat} */ readFormat: null, + /** @type {number} */ numWrittenChannels: 0, + /** @type {gluShaderUtil.precision} */ outPrecision: gluShaderUtil.precision.PRECISION_LOWP, + /** @type {ArrayBuffer} */ renderedData: null, + /** @type {ArrayBuffer} */ referenceData: null + }; + }; + + es3fFragmentOutputTests.FragmentOutputCase.prototype.iterate = function() { + // Compute grid size & index list. + /** @type {number} */ var minCellSize = 8; + /** @type {Array} */ var minBufSize = es3fFragmentOutputTests.getMinSize(this.m_fboSpec); // IVec2 + /** @type {number} */ var gridWidth = deMath.clamp(Math.floor(minBufSize[0] / minCellSize), 1, 255) + 1; + /** @type {number} */ var gridHeight = deMath.clamp(Math.floor(minBufSize[1] / minCellSize), 1, 255) + 1; + /** @type {number} */ var numVertices = gridWidth * gridHeight; + /** @type {number} */ var numQuads = (gridWidth - 1) * (gridHeight - 1); + /** @type {number} */ var numIndices = numQuads * 6; + + /** @type {number} */ var numInputVecs = es3fFragmentOutputTests.getNumInputVectors(this.m_outputs); + /** @type {Array>} */ var inputs = []; // originally vector + + for (var inputNdx = 0; inputNdx < numInputVecs; inputNdx++) + inputs[inputNdx] = []; // inputs.length = numInputVecs; + + /** @type {Array} */ var positions = []; // originally vector + /** @type {Array} */ var indices = []; // originally vector + + /** @type {number} */ var readAlignment = 4; + /** @type {number} */ var viewportW = minBufSize[0]; + /** @type {number} */ var viewportH = minBufSize[1]; + /** @type {number} */ var numAttachments = this.m_fboSpec.length; + + /** @type {Array} */ var drawBuffers = []; // originally vector + /** @type {Array} */ var attachments = []; + /** @type {number} */ var attachmentW; + /** @type {number} */ var attachmentH; + + // Initialize attachment data. + for (var ndx = 0; ndx < numAttachments; ndx++) { + /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_fboSpec[ndx].format); + /** @type {tcuTexture.TextureChannelClass} */ var chnClass = tcuTexture.getTextureChannelClass(texFmt.type); + /** @type {boolean} */ var isFixedPoint = (chnClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT || + chnClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT); + + // \note Fixed-point formats use float reference to enable more accurate result verification. + /** @type {tcuTexture.TextureFormat} */ var refFmt = isFixedPoint ? new tcuTexture.TextureFormat(texFmt.order, tcuTexture.ChannelType.FLOAT) : texFmt; + /** @type {tcuTexture.TextureFormat} */ var readFmt = es3fFboTestUtil.getFramebufferReadFormat(texFmt); + attachmentW = this.m_fboSpec[ndx].width; + attachmentH = this.m_fboSpec[ndx].height; + + drawBuffers[ndx] = gl.COLOR_ATTACHMENT0 + ndx; + attachments[ndx] = new es3fFragmentOutputTests.AttachmentData(); + attachments[ndx].format = texFmt; + attachments[ndx].readFormat = readFmt; + attachments[ndx].referenceFormat = refFmt; + attachments[ndx].renderedData = new ArrayBuffer(readFmt.getPixelSize() * attachmentW * attachmentH); + attachments[ndx].referenceData = new ArrayBuffer(refFmt.getPixelSize() * attachmentW * attachmentH); + } + + // Initialize indices. + for (var quadNdx = 0; quadNdx < numQuads; quadNdx++) { + /** @type {number} */ var quadY = Math.floor(quadNdx / (gridWidth - 1)); + /** @type {number} */ var quadX = quadNdx - quadY * (gridWidth - 1); + + indices[quadNdx * 6 + 0] = quadX + quadY * gridWidth; + indices[quadNdx * 6 + 1] = quadX + (quadY + 1) * gridWidth; + indices[quadNdx * 6 + 2] = quadX + quadY * gridWidth + 1; + indices[quadNdx * 6 + 3] = indices[quadNdx * 6 + 1]; + indices[quadNdx * 6 + 4] = quadX + (quadY + 1) * gridWidth + 1; + indices[quadNdx * 6 + 5] = indices[quadNdx * 6 + 2]; + } + + /** @type {number} */ var xf = 0; + /** @type {number} */ var yf = 0; + for (var y = 0; y < gridHeight; y++) { + for (var x = 0; x < gridWidth; x++) { + xf = x / (gridWidth - 1); + yf = y / (gridHeight - 1); + + positions[(y * gridWidth + x) * 4 + 0] = 2.0 * xf - 1.0; + positions[(y * gridWidth + x) * 4 + 1] = 2.0 * yf - 1.0; + positions[(y * gridWidth + x) * 4 + 2] = 0.0; + positions[(y * gridWidth + x) * 4 + 3] = 1.0; + } + } + /** @type {es3fFragmentOutputTests.FragmentOutput} */ var output; + /** @type {boolean} */ var isArray; + /** @type {boolean} */ var isFloat; + /** @type {boolean} */ var isInt; + /** @type {boolean} */ var isUint; + /** @type {number} */ var numVecs; + /** @type {number} */ var numScalars; + + var curInVec = 0; + for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) { + output = this.m_outputs[outputNdx]; + isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type); + isInt = gluShaderUtil.isDataTypeIntOrIVec(output.type); + isUint = gluShaderUtil.isDataTypeUintOrUVec(output.type); + numVecs = output.arrayLength > 0 ? output.arrayLength : 1; + numScalars = gluShaderUtil.getDataTypeScalarSize(output.type); + + for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) { + inputs[curInVec].length = numVertices * numScalars; + + // Record how many outputs are written in attachment. + DE_ASSERT(output.location + vecNdx < attachments.length); + attachments[output.location + vecNdx].numWrittenChannels = numScalars; + attachments[output.location + vecNdx].outPrecision = output.precision; + + /** @type {Array} */ var range = null; + /** @type {Array} */ var minVal = null; + /** @type {Array} */ var maxVal = null; + /** @type {Array} */ var fmtBits = null; + /** @type {Array} */ var fmtMaxVal = []; + /** @type {Array} */ var rangeDiv = null; + /** @type {Array} */ var step = []; + /** @type {number} */ var ix = 0; + /** @type {number} */ var iy = 0; + /** @type {Array} */ var c = null; + /** @type {number} */ var pos = 0; + if (isFloat) { + range = es3fFragmentOutputTests.getFloatRange(output.precision); // Vec2 + minVal = [range[0], range[0], range[0], range[0]]; // Vec4 + maxVal = [range[1], range[1], range[1], range[1]]; // Vec4 + + if (deMath.deInBounds32(output.location + vecNdx, 0, attachments.length)) { + // \note Floating-point precision conversion is not well-defined. For that reason we must + // limit value range to intersection of both data type and render target value ranges. + /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(attachments[output.location + vecNdx].format); + minVal = deMath.max(minVal, fmtInfo.valueMin); + maxVal = deMath.min(maxVal, fmtInfo.valueMax); + } + + bufferedLogToConsole('out ' + curInVec + ' value range: ' + minVal + ' -> ' + maxVal); + + for (var y = 0; y < gridHeight; y++) { + for (var x = 0; x < gridWidth; x++) { + xf = x / (gridWidth - 1); + yf = y / (gridHeight - 1); + /** @type {number} */ var f0 = (xf + yf) * 0.5; + /** @type {number} */ var f1 = 0.5 + (xf - yf) * 0.5; + + /** @type {Array} */ var f = es3fFragmentOutputTests.swizzleVec([f0, f1, 1.0 - f0, 1.0 - f1], curInVec); // Vec4 + c = deMath.add(minVal, deMath.multiply(deMath.subtract(maxVal, minVal), f)); // Vec4 + + pos = (y * gridWidth + x) * numScalars; + + for (var ndx = 0; ndx < numScalars; ndx++) + inputs[curInVec][pos + ndx] = c[ndx]; + } + } + } else if (isInt) { + range = es3fFragmentOutputTests.getIntRange(output.precision); // IVec2 + minVal = [range[0], range[0], range[0], range[0]]; // IVec4 + maxVal = [range[1], range[1], range[1], range[1]]; // IVec4 + + if (deMath.deInBounds32(output.location + vecNdx, 0, attachments.length)) { + // Limit to range of output format as conversion mode is not specified. + fmtBits = tcuTextureUtil.getTextureFormatBitDepth(attachments[output.location + vecNdx].format); // IVec4 + /** @type {Array} */ var isZero = deMath.lessThanEqual(fmtBits, [0, 0, 0, 0]); // BVec4, array of booleans, size = 4 + + /** @type {Array} */ var fmtMinVal = []; // IVec4 + + for (var i = 0; i < 4; i++) { + + // const IVec4 fmtMinVal = (-(tcu::Vector(1) << (fmtBits - 1 ).cast())).asInt(); + fmtMinVal[i] = -1 * Math.pow(2, fmtBits[i] - 1); // TODO: check implementation, original above + // const IVec4 fmtMaxVal = ((tcu::Vector(1) << (fmtBits - 1 ).cast()) - deInt64(1)).asInt(); + fmtMaxVal[i] = Math.pow(2, fmtBits[i] - 1) - 1; // TODO: check implementation, original above + } + + minVal = tcuTextureUtil.select(minVal, deMath.max(minVal, fmtMinVal), isZero); + maxVal = tcuTextureUtil.select(maxVal, deMath.min(maxVal, fmtMaxVal), isZero); + } + + bufferedLogToConsole('out ' + curInVec + ' value range: ' + minVal + ' -> ' + maxVal); + + rangeDiv = es3fFragmentOutputTests.swizzleVec([gridWidth - 1, gridHeight - 1, gridWidth - 1, gridHeight - 1], curInVec); // IVec4 + for (var i = 0; i < 4; i++) { + // const IVec4 step = ((maxVal.cast() - minVal.cast()) / (rangeDiv.cast())).asInt(); + step[i] = Math.floor((maxVal[i] - minVal[i]) / rangeDiv[i]); // TODO: check with the above line of code + } + + for (var y = 0; y < gridHeight; y++) { + for (var x = 0; x < gridWidth; x++) { + ix = gridWidth - x - 1; + iy = gridHeight - y - 1; + c = deMath.add(minVal, deMath.multiply(step, es3fFragmentOutputTests.swizzleVec([x, y, ix, iy], curInVec))); // IVec4 + + pos = (y * gridWidth + x) * numScalars; + + for (var ndx = 0; ndx < numScalars; ndx++) + inputs[curInVec][pos + ndx] = c[ndx]; + } + } + } else if (isUint) { + range = es3fFragmentOutputTests.getUintRange(output.precision); // UVec2 + maxVal = [range[1], range[1], range[1], range[1]]; // UVec4 + + if (deMath.deInBounds32(output.location + vecNdx, 0, attachments.length)) { + // Limit to range of output format as conversion mode is not specified. + fmtBits = tcuTextureUtil.getTextureFormatBitDepth(attachments[output.location + vecNdx].format); // IVec4 + + for (var i = 0; i < 4; i++) { + fmtMaxVal[i] = Math.pow(2, fmtBits[i]) - 1; + } + + maxVal = deMath.min(maxVal, fmtMaxVal); + } + + bufferedLogToConsole('out ' + curInVec + ' value range: ' + minVal + ' -> ' + maxVal); + + rangeDiv = es3fFragmentOutputTests.swizzleVec([gridWidth - 1, gridHeight - 1, gridWidth - 1, gridHeight - 1], curInVec); // IVec4 + + for (var stepPos = 0; stepPos < maxVal.length; stepPos++) { + step[stepPos] = Math.floor(maxVal[stepPos] / rangeDiv[stepPos]); + } + + DE_ASSERT(range[0] == 0); + + for (var y = 0; y < gridHeight; y++) { + for (var x = 0; x < gridWidth; x++) { + ix = gridWidth - x - 1; + iy = gridHeight - y - 1; + c = deMath.multiply(step, es3fFragmentOutputTests.swizzleVec([x, y, ix, iy], curInVec)); // UVec4 + pos = (y * gridWidth + x) * numScalars; + + DE_ASSERT(deMath.boolAll(deMath.lessThanEqual(c, maxVal))); // TODO: sometimes crashes here, condition not asserted + + for (var ndx = 0; ndx < numScalars; ndx++) + inputs[curInVec][pos + ndx] = c[ndx]; + } + } + } else + DE_ASSERT(false); + + curInVec += 1; + } + } + + // Render using gl. + gl.useProgram(this.m_program.getProgram()); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + gl.viewport(0, 0, viewportW, viewportH); + gl.drawBuffers(drawBuffers); + gl.disable(gl.DITHER); // Dithering causes issues with unorm formats. Those issues could be worked around in threshold, but it makes validation less accurate. + + /** @type {WebGLBuffer} */ var buffer = null; + /** @type {string} */ var name; + curInVec = 0; + for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) { + output = this.m_outputs[outputNdx]; + isArray = output.arrayLength > 0; + isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type); + isInt = gluShaderUtil.isDataTypeIntOrIVec(output.type); + isUint = gluShaderUtil.isDataTypeUintOrUVec(output.type); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(output.type); + /** @type {number} */ var glScalarType = isFloat ? /* gluShaderUtil.DataType.FLOAT */ gl.FLOAT : + isInt ? /* gluShaderUtil.DataType.INT */ gl.INT : + isUint ? /* gluShaderUtil.DataType.UINT */ gl.UNSIGNED_INT : /* gluShaderUtil.DataType.INVALID */ gl.NONE; + numVecs = isArray ? output.arrayLength : 1; + + for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) { + name = 'in' + outputNdx + (isArray ? '_' + vecNdx : ''); + /** @type {number} */ var loc = gl.getAttribLocation(this.m_program.getProgram(), name); + + if (loc >= 0) { + buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + + gl.enableVertexAttribArray(loc); + if (isFloat) { + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(inputs[curInVec]), gl.STATIC_DRAW); + // KHRONOS WebGL 1.0 specification: + // void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); + gl.vertexAttribPointer(loc, scalarSize, glScalarType, false, 0, 0); // offset = 0 + } else { + gl.bufferData(gl.ARRAY_BUFFER, new Int32Array(inputs[curInVec]), gl.STATIC_DRAW); + // KHRONOS WebGL 2.0 specification: + // void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset) + gl.vertexAttribIPointer(loc, scalarSize, glScalarType, 0, 0); // offset = 0 + } + } else + bufferedLogToConsole('Warning: No location for attribute "' + name + '" found.'); + + curInVec += 1; + } + } + + /** @type {number} */ var posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + // TCU_CHECK(posLoc >= 0); + buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); + + gl.enableVertexAttribArray(posLoc); + gl.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0); // offset = 0 + + /** @type {WebGLBuffer} */ var indexObject = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW); + + gl.drawElements(gl.TRIANGLES, numIndices, gl.UNSIGNED_SHORT, 0); // offset = 0 + + // Render reference images. + + var curInNdx = 0; + for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) { + output = this.m_outputs[outputNdx]; + isArray = output.arrayLength > 0; + isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type); + isInt = gluShaderUtil.isDataTypeIntOrIVec(output.type); + isUint = gluShaderUtil.isDataTypeUintOrUVec(output.type); + scalarSize = gluShaderUtil.getDataTypeScalarSize(output.type); + numVecs = isArray ? output.arrayLength : 1; + + for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) { + /** @type {number} */ var location = output.location + vecNdx; + /** @type {Array} */ var inputData = inputs[curInNdx]; + + DE_ASSERT(deMath.deInBounds32(location, 0, this.m_fboSpec.length)); + + /** @type {number} */ var bufW = this.m_fboSpec[location].width; + /** @type {number} */ var bufH = this.m_fboSpec[location].height; + /** @type {Object} */ var descriptor = { + format: attachments[location].referenceFormat, + width: bufW, + height: bufH, + depth: 1, + data: attachments[location].referenceData // ArrayBuffer + }; + /** @type {tcuTexture.PixelBufferAccess} */ var buf = new tcuTexture.PixelBufferAccess(descriptor); + /** @type {tcuTexture.PixelBufferAccess} */ var viewportBuf = tcuTextureUtil.getSubregion(buf, 0, 0, 0, viewportW, viewportH, 1); + + if (isInt || isUint) + es3fFragmentOutputTests.renderIntReference(viewportBuf, gridWidth, gridHeight, scalarSize, inputData); + else if (isFloat) + es3fFragmentOutputTests.renderFloatReference(viewportBuf, gridWidth, gridHeight, scalarSize, inputData); + else + DE_ASSERT(false); + + curInNdx += 1; + } + } + + // Compare all images. + /** @type {boolean} */ var allLevelsOk = true; + for (var attachNdx = 0; attachNdx < numAttachments; attachNdx++) { + attachmentW = this.m_fboSpec[attachNdx].width; + attachmentH = this.m_fboSpec[attachNdx].height; + /** @type {number} */ var numValidChannels = attachments[attachNdx].numWrittenChannels; + /** @type {Array} */ var cmpMask = [numValidChannels >= 1, numValidChannels >= 2, numValidChannels >= 3, numValidChannels >= 4]; + /** @type {gluShaderUtil.precision} */ var outPrecision = attachments[attachNdx].outPrecision; + /** @type {tcuTexture.TextureFormat} */ var format = attachments[attachNdx].format; + /** @type {Object} */ + var renderedDescriptor = { + format: attachments[attachNdx].readFormat, + width: attachmentW, + height: attachmentH, + depth: 1, + rowPitch: deMath.deAlign32(attachments[attachNdx].readFormat.getPixelSize() * attachmentW, readAlignment), + slicePitch: 0, + data: attachments[attachNdx].renderedData // ArrayBuffer + }; + /** @type {tcuTexture.PixelBufferAccess} */ var rendered = new tcuTexture.PixelBufferAccess(renderedDescriptor); + /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(attachments[attachNdx].readFormat); + gl.readBuffer(gl.COLOR_ATTACHMENT0 + attachNdx); + gl.readPixels(0, 0, attachmentW, attachmentH, transferFmt.format, transferFmt.dataType, rendered.getDataPtr()); + + /** @type {Object} */ + var referenceDescriptor = { + format: attachments[attachNdx].referenceFormat, + width: attachmentW, + height: attachmentH, + depth: 1, + data: attachments[attachNdx].referenceData // ArrayBuffer + }; + /** @type {tcuTexture.ConstPixelBufferAccess} */ var reference = new tcuTexture.ConstPixelBufferAccess(referenceDescriptor); + /** @type {tcuTexture.TextureChannelClass} */ var texClass = tcuTexture.getTextureChannelClass(format.type); + /** @type {boolean} */ var isOk = true; + name = 'Attachment ' + attachNdx; + /** @type {string} */ var desc = 'Color attachment ' + attachNdx; + /** @type {Array} */ var threshold; + + bufferedLogToConsole('Attachment ' + attachNdx + ': ' + numValidChannels + ' channels have defined values and used for comparison'); + + switch (texClass) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: { + /** @type {Array} */ var formatThreshold = []; // UVec4 //!< Threshold computed based on format. + formatThreshold.length = 4; + /** @type {number} */ var precThreshold = 0; // deUint32 //!< Threshold computed based on output type precision + /** @type {Array} */ var finalThreshold = []; // UVec4 + finalThreshold.length = 4; + + switch (format.type) { + case tcuTexture.ChannelType.FLOAT: + formatThreshold = [4, 4, 4, 4]; // UVec4 + break; + case tcuTexture.ChannelType.HALF_FLOAT: + formatThreshold = [(1 << 13) + 4, (1 << 13) + 4, (1 << 13) + 4, (1 << 13) + 4]; // UVec4 + break; + case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: + formatThreshold = [(1 << 17) + 4, (1 << 17) + 4, (1 << 18) + 4, 4]; // UVec4 + break; + default: + DE_ASSERT(false); + break; + } + + switch (outPrecision) { + case gluShaderUtil.precision.PRECISION_LOWP: + precThreshold = (1 << 21); + break; + case gluShaderUtil.precision.PRECISION_MEDIUMP: + precThreshold = (1 << 13); + break; + case gluShaderUtil.precision.PRECISION_HIGHP: + precThreshold = 0; + break; + default: + DE_ASSERT(false); + } + + finalThreshold = tcuTextureUtil.select( + deMath.max(formatThreshold, [precThreshold, precThreshold, precThreshold, precThreshold]), + [0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff], // C++ version: UVec4(~0u) bitwise not, all bits in the integer will be flipped + cmpMask); + + isOk = tcuImageCompare.floatUlpThresholdCompare(name, desc, reference, rendered, finalThreshold /*, tcu::COMPARE_LOG_RESULT*/); + break; + } + + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: { + // \note glReadPixels() allows only 8 bits to be read. This means that RGB10_A2 will loose some + // bits in the process and it must be taken into account when computing threshold. + /** @type {Array} */ var bits = deMath.min([8, 8, 8, 8], tcuTextureUtil.getTextureFormatBitDepth(format)); // IVec4 + + /** @type {Array} */ var baseThreshold = []; // Vec4 + baseThreshold.length = 4; + for (var inc = 0; inc < baseThreshold.length; inc++) { + // TODO: check the operation below: baseThreshold = 1.0f / ((IVec4(1) << bits)-1).asFloat(); + baseThreshold[inc] = 1.0 / ((1 << bits[inc]) - 1); + } + + threshold = tcuTextureUtil.select(baseThreshold, [2.0, 2.0, 2.0, 2.0], cmpMask); // Vec4 + + isOk = tcuImageCompare.floatThresholdCompare(name, desc, reference, rendered, threshold/*, tcu::COMPARE_LOG_RESULT*/); + break; + } + + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: { + // The C++ dEQP code uses ~0u but ~0 is -1 in Javascript + var UINT_MAX = Math.pow(2.0, 32.0) - 1; + threshold = tcuTextureUtil.select( + [0, 0, 0, 0], + [UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX], + cmpMask + ); // UVec4 + isOk = tcuImageCompare.intThresholdCompare(name, desc, reference, rendered, threshold/*, tcu::COMPARE_LOG_RESULT*/); + break; + } + + default: + testFailedOptions('Unsupported comparison', true); + break; + } + + if (!isOk) + allLevelsOk = false; + } + + if (numAttachments > 1) { + if (allLevelsOk) + testPassed('Image comparison passed for ' + numAttachments + ' attachments'); + else + testFailed('Image comparison failed for some of ' + numAttachments + ' attachments'); + } else { + if (allLevelsOk) + testPassed('Image comparison passed'); + else + testFailed('Image comparison failed'); + } + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * es3fFragmentOutputTests.createRandomCase. Constructs the es3fFragmentOutputTests.createRandomCase, child class of es3fFragmentOutputTests.FragmentOutputCase + * @constructor + * @param {number} minRenderTargets + * @param {number} maxRenderTargets + * @param {number} seed + * @return {es3fFragmentOutputTests.FragmentOutputCase} The currently modified object + */ + es3fFragmentOutputTests.createRandomCase = function(minRenderTargets, maxRenderTargets, seed, colorBufferFloatSupported) { + + /** @type {Array} */ + var outputTypes = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4, + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4, + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4 + ]; + + /** @type {Array} */ + var precisions = [ + gluShaderUtil.precision.PRECISION_LOWP, + gluShaderUtil.precision.PRECISION_MEDIUMP, + gluShaderUtil.precision.PRECISION_HIGHP + ]; + + /** @type {Array} */ + var floatFormats = [ + gl.RGBA32F, + gl.RGBA16F, + gl.R11F_G11F_B10F, + gl.RG32F, + gl.RG16F, + gl.R32F, + gl.R16F, + gl.RGBA8, + gl.SRGB8_ALPHA8, + gl.RGB10_A2, + gl.RGBA4, + gl.RGB5_A1, + gl.RGB8, + gl.RGB565, + gl.RG8, + gl.R8 + ]; + + /** @type {Array} */ + var colorBufferFloatFormats = [ + gl.RGBA32F, + gl.RGBA16F, + gl.R11F_G11F_B10F, + gl.RG32F, + gl.RG16F, + gl.R32F, + gl.R16F + ]; + + + /** @type {Array} */ + var intFormats = [ + gl.RGBA32I, + gl.RGBA16I, + gl.RGBA8I, + gl.RG32I, + gl.RG16I, + gl.RG8I, + gl.R32I, + gl.R16I, + gl.R8I + ]; + + /** @type {Array} */ + var uintFormats = [ + gl.RGBA32UI, + gl.RGBA16UI, + gl.RGBA8UI, + gl.RGB10_A2UI, + gl.RG32UI, + gl.RG16UI, + gl.RG8UI, + gl.R32UI, + gl.R16UI, + gl.R8UI + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(seed); + /** @type {Array} */ var outputs = []; + /** @type {Array} */ var targets = []; + /** @type {Array} */ var outTypes = []; + + /** @type {number} */ var numTargets = rnd.getInt(minRenderTargets, maxRenderTargets); + /** @type {number} */ var width = 128; // \todo [2012-04-10 pyry] Separate randomized sizes per target? + /** @type {number} */ var height = 64; + /** @type {number} */ var samples = 0; + + // Compute outputs. + /** @type {number} */ var curLoc = 0; + while (curLoc < numTargets) { + /** @type {boolean} */ var useArray = rnd.getFloat() < 0.3; + /** @type {number} */ var maxArrayLen = numTargets - curLoc; + /** @type {number} */ var arrayLen = useArray ? rnd.getInt(1, maxArrayLen) : 0; + /** @type {Array} */ var basicTypeArray = rnd.choose(outputTypes, undefined, 1); + /** @type {gluShaderUtil.DataType} */ var basicType = basicTypeArray[0]; + /** @type {Array} */ var precisionArray = rnd.choose(precisions, undefined, 1); + /** @type {gluShaderUtil.precision} */ var precision = precisionArray[0]; + /** @type {number} */ var numLocations = useArray ? arrayLen : 1; + + outputs.push(new es3fFragmentOutputTests.FragmentOutput(basicType, precision, curLoc, arrayLen)); + + for (var ndx = 0; ndx < numLocations; ndx++) + outTypes.push(basicType); + + curLoc += numLocations; + } + DE_ASSERT(curLoc == numTargets); + DE_ASSERT(outTypes.length == numTargets); + + // Compute buffers. + while (targets.length < numTargets) { + /** @type {gluShaderUtil.DataType} */ var outType = outTypes[targets.length]; + /** @type {boolean} */ var isFloat = gluShaderUtil.isDataTypeFloatOrVec(outType); + /** @type {boolean} */ var isInt = gluShaderUtil.isDataTypeIntOrIVec(outType); + /** @type {boolean} */ var isUint = gluShaderUtil.isDataTypeUintOrUVec(outType); + /** @type {Array} */ var formatArray = []; + /** @type {number} */ var format = 0; + + if (isFloat) { + formatArray = rnd.choose(floatFormats, undefined, 1); + format = formatArray[0]; + if (colorBufferFloatFormats.indexOf(format) >= 0 && !colorBufferFloatSupported) + return null; + } else if (isInt) { + formatArray = rnd.choose(intFormats, undefined, 1); + format = formatArray[0]; + } else if (isUint) { + formatArray = rnd.choose(uintFormats, undefined, 1); + format = formatArray[0]; + } else + DE_ASSERT(false); + + targets.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + } + + return new es3fFragmentOutputTests.FragmentOutputCase(seed.toString(), '', targets, outputs); + + }; + + es3fFragmentOutputTests.init = function(gl) { + var state = tcuTestCase.runner; + state.testCases = tcuTestCase.newTest('fragment_outputs', 'Top level'); + /** @const @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases; + + /** @type {Array} */ + var requiredFloatFormats = [ + gl.RGBA32F, + gl.RGBA16F, + gl.R11F_G11F_B10F, + gl.RG32F, + gl.RG16F, + gl.R32F, + gl.R16F + ]; + + /** @type {Array} */ + var requiredFixedFormats = [ + gl.RGBA8, + gl.SRGB8_ALPHA8, + gl.RGB10_A2, + gl.RGBA4, + gl.RGB5_A1, + gl.RGB8, + gl.RGB565, + gl.RG8, + gl.R8 + ]; + + /** @type {Array} */ + var requiredIntFormats = [ + gl.RGBA32I, + gl.RGBA16I, + gl.RGBA8I, + gl.RG32I, + gl.RG16I, + gl.RG8I, + gl.R32I, + gl.R16I, + gl.R8I + ]; + + /** @type {Array} */ + var requiredUintFormats = [ + gl.RGBA32UI, + gl.RGBA16UI, + gl.RGBA8UI, + gl.RGB10_A2UI, + gl.RG32UI, + gl.RG16UI, + gl.RG8UI, + gl.R32UI, + gl.R16UI, + gl.R8UI + ]; + + /** @type {Array} */ + var precisions = [ + + gluShaderUtil.precision.PRECISION_LOWP, + gluShaderUtil.precision.PRECISION_MEDIUMP, + gluShaderUtil.precision.PRECISION_HIGHP + + ]; + + // .basic. + + /** @const @type {number} */ var width = 64; + /** @const @type {number} */ var height = 64; + /** @const @type {number} */ var samples = 0; + /** @type {Array} */ var fboSpec = null; + /** @type {gluShaderUtil.precision} */ var prec; + /** @type {string} */ var precName; + + // .float + if (gl.getExtension('EXT_color_buffer_float')) { + /** @type {tcuTestCase.DeqpTest} */ var floatGroup = tcuTestCase.newTest('basic.float', 'Floating-point output tests'); + testGroup.addChild(floatGroup); + + for (var fmtNdx = 0; fmtNdx < requiredFloatFormats.length; fmtNdx++) { + var format = requiredFloatFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + // NOTE: Eliminated original OutputVec and toVec(), as it only returned an element of the outputs array in OutputVec + floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0)])); + floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0)])); + floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0)])); + floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0)])); + } + } + } + + // .fixed + /** @type {tcuTestCase.DeqpTest} */ var fixedGroup = tcuTestCase.newTest('basic.fixed', 'Fixed-point output tests'); + testGroup.addChild(fixedGroup); + for (var fmtNdx = 0; fmtNdx < requiredFixedFormats.length; fmtNdx++) { + var format = requiredFixedFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0)])); + fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0)])); + fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0)])); + fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0)])); + } + } + + // .int + /** @type {tcuTestCase.DeqpTest} */ var intGroup = tcuTestCase.newTest('basic.int', 'Integer output tests'); + testGroup.addChild(intGroup); + for (var fmtNdx = 0; fmtNdx < requiredIntFormats.length; fmtNdx++) { + var format = requiredIntFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_int', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT, prec, 0)])); + intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC2, prec, 0)])); + intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC3, prec, 0)])); + intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC4, prec, 0)])); + } + } + + // .uint + /** @type {tcuTestCase.DeqpTest} */ var uintGroup = tcuTestCase.newTest('basic.uint', 'Usigned integer output tests'); + testGroup.addChild(uintGroup); + for (var fmtNdx = 0; fmtNdx < requiredUintFormats.length; fmtNdx++) { + var format = requiredUintFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uint', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT, prec, 0)])); + uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC2, prec, 0)])); + uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC3, prec, 0)])); + uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC4, prec, 0)])); + + } + } + + // .array + + /** @type {number} */ var numTargets = 3; + + // .float + if (gl.getExtension('EXT_color_buffer_float')) { + /** @type {tcuTestCase.DeqpTest} */ var arrayFloatGroup = tcuTestCase.newTest('array.float', 'Floating-point output tests'); + testGroup.addChild(arrayFloatGroup); + for (var fmtNdx = 0; fmtNdx < requiredFloatFormats.length; fmtNdx++) { + var format = requiredFloatFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + for (var ndx = 0; ndx < numTargets; ndx++) + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0, numTargets)])); + arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0, numTargets)])); + arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0, numTargets)])); + arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0, numTargets)])); + } + } + } + + // .fixed + /** @type {tcuTestCase.DeqpTest} */ var arrayFixedGroup = tcuTestCase.newTest('array.fixed', 'Fixed-point output tests'); + testGroup.addChild(arrayFixedGroup); + for (var fmtNdx = 0; fmtNdx < requiredFixedFormats.length; fmtNdx++) { + var format = requiredFixedFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + for (var ndx = 0; ndx < numTargets; ndx++) + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0, numTargets)])); + arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0, numTargets)])); + arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0, numTargets)])); + arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0, numTargets)])); + } + } + + // .int + /** @type {tcuTestCase.DeqpTest} */ var arrayIntGroup = tcuTestCase.newTest('array.int', 'Integer output tests'); + testGroup.addChild(arrayIntGroup); + for (var fmtNdx = 0; fmtNdx < requiredIntFormats.length; fmtNdx++) { + var format = requiredIntFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + for (var ndx = 0; ndx < numTargets; ndx++) + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_int', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT, prec, 0, numTargets)])); + arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC2, prec, 0, numTargets)])); + arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC3, prec, 0, numTargets)])); + arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC4, prec, 0, numTargets)])); + } + } + + // .uint + /** @type {tcuTestCase.DeqpTest} */ var arrayUintGroup = tcuTestCase.newTest('array.uint', 'Usigned integer output tests'); + testGroup.addChild(arrayUintGroup); + for (var fmtNdx = 0; fmtNdx < requiredUintFormats.length; fmtNdx++) { + var format = requiredUintFormats[fmtNdx]; + var fmtName = es3fFboTestUtil.getFormatName(format); + fboSpec = []; + + for (var ndx = 0; ndx < numTargets; ndx++) + fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples)); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + prec = precisions[precNdx]; + precName = gluShaderUtil.getPrecisionName(prec); + + arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uint', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT, prec, 0, numTargets)])); + arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC2, prec, 0, numTargets)])); + arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC3, prec, 0, numTargets)])); + arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC4, prec, 0, numTargets)])); + } + } + + // .random + + /** @type {Array} */ var randomGroup = []; + var numRandomGroups = 3; + for (var ii = 0; ii < numRandomGroups; ++ii) { + randomGroup[ii] = tcuTestCase.newTest('random', 'Random fragment output cases'); + testGroup.addChild(randomGroup[ii]); + } + + /** @type {boolean} */ var colorBufferFloatSupported = (gl.getExtension('EXT_color_buffer_float') != null); + for (var seed = 0; seed < 100; seed++) { + var test = es3fFragmentOutputTests.createRandomCase(2, 4, seed, colorBufferFloatSupported); + if (test !== null) { + randomGroup[seed % numRandomGroups].addChild(test); + } + } + + }; + + /** + * Create and execute the test cases + */ + es3fFragmentOutputTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var testName = 'fragment_output'; + var testDescription = 'Fragment Output Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + es3fFragmentOutputTests.init(gl); + if (range) + state.setRange(range); + tcuTestCase.runTestCases(); + } catch (err) { + testFailedOptions('Failed to es3fFragmentOutputTests.run tests', false); + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js new file mode 100644 index 000000000..ffc6a0c68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js @@ -0,0 +1,1261 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fFramebufferBlitTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('functional.gles3.es3fFboTestCase'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { + + var es3fFramebufferBlitTests = functional.gles3.es3fFramebufferBlitTests; + var es3fFboTestCase = functional.gles3.es3fFboTestCase; + var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuRGBA = framework.common.tcuRGBA; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var deMath = framework.delibs.debase.deMath; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var rrUtil = framework.referencerenderer.rrUtil; + var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** @type {WebGL2RenderingContext} */ var gl; + /** + * es3fFramebufferBlitTests.BlitRectCase class, inherits from FboTestCase + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} filter deUint32 + * @param {Array} srcSize + * @param {Array} srcRect + * @param {Array} dstSize + * @param {Array} dstRect + * @param {number=} cellSize + */ + es3fFramebufferBlitTests.BlitRectCase = function(name, desc, filter, srcSize, srcRect, dstSize, dstRect, cellSize) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + /** @const {number} */ this.m_filter = filter; + /** @const {Array} */ this.m_srcSize = srcSize; + /** @const {Array} */ this.m_srcRect = srcRect; + /** @const {Array} */ this.m_dstSize = dstSize; + /** @const {Array} */ this.m_dstRect = dstRect; + /** @const {number} */ this.m_cellSize = cellSize === undefined ? 8 : cellSize; + /** @const {Array} */ this.m_gridCellColorA = [0.2, 0.7, 0.1, 1.0]; + /** @const {Array} */ this.m_gridCellColorB = [0.7, 0.1, 0.5, 0.8]; + }; + + es3fFramebufferBlitTests.BlitRectCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype); + es3fFramebufferBlitTests.BlitRectCase.prototype.constructor = es3fFramebufferBlitTests.BlitRectCase; + + /** + * @param {tcuSurface.Surface} dst + */ + es3fFramebufferBlitTests.BlitRectCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + /** @type {number} */ var colorFormat = gl.RGBA8; + + /** @type {es3fFboTestUtil.GradientShader} */ + var gradShader = new es3fFboTestUtil.GradientShader( + gluShaderUtil.DataType.FLOAT_VEC4); + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], + gluShaderUtil.DataType.FLOAT_VEC4); + + var gradShaderID = ctx.createProgram(gradShader); + var texShaderID = ctx.createProgram(texShader); + + var srcFbo; + var dstFbo; + var srcRbo; + var dstRbo; + + // Setup shaders + gradShader.setGradient(ctx, gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + texShader.setUniforms(ctx, texShaderID); + + // Create framebuffers. + + /** @type {Array} */ var size; + + // source framebuffers + srcFbo = ctx.createFramebuffer(); + srcRbo = ctx.createRenderbuffer(); + size = this.m_srcSize; + + ctx.bindRenderbuffer(gl.RENDERBUFFER, srcRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, size[0], size[1]); + ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, srcRbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + // destination framebuffers + dstFbo = ctx.createFramebuffer(); + dstRbo = ctx.createRenderbuffer(); + size = this.m_dstSize; + + ctx.bindRenderbuffer(gl.RENDERBUFFER, dstRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, size[0], size[1]); + ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dstRbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + // Fill destination with gradient. + ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo); + ctx.viewport(0, 0, this.m_dstSize[0], this.m_dstSize[1]); + + rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]); + + // Fill source with grid pattern. + /** @const {number} */ var format = gl.RGBA; + /** @const {number} */ var dataType = gl.UNSIGNED_BYTE; + /** @const {number} */ var texW = this.m_srcSize[0]; + /** @const {number} */ var texH = this.m_srcSize[1]; + var gridTex; + /** @type {tcuTexture.TextureLevel} */ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), this.m_cellSize, this.m_gridCellColorA, this.m_gridCellColorB); + + gridTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, gridTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo); + ctx.viewport(0, 0, this.m_srcSize[0], this.m_srcSize[1]); + + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + + // Perform copy. + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, srcFbo); + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, dstFbo); + ctx.blitFramebuffer(this.m_srcRect[0], this.m_srcRect[1], this.m_srcRect[2], this.m_srcRect[3], + this.m_dstRect[0], this.m_dstRect[1], this.m_dstRect[2], this.m_dstRect[3], + gl.COLOR_BUFFER_BIT, this.m_filter); + + // Read back results. + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, dstFbo); + + this.readPixelsUsingFormat(dst, 0, 0, this.m_dstSize[0], this.m_dstSize[1], + gluTextureUtil.mapGLInternalFormat(colorFormat), + [1.0, 1.0, 1.0, 1.0], + [0.0, 0.0, 0.0, 0.0]); + }; + + /** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @return {boolean} + */ + es3fFramebufferBlitTests.BlitRectCase.prototype.compare = function(reference, result) { + // Use pixel-threshold compare for rect cases since 1px off will mean failure. + var threshold = [7, 7, 7, 7]; + return tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', reference, result, threshold); + }; + + /** + * es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase class + * @constructor + * @extends {es3fFramebufferBlitTests.BlitRectCase} + * @param {string} name + * @param {string} desc + * @param {Array} srcSize + * @param {Array} srcRect + * @param {Array} dstSize + * @param {Array} dstRect + */ + es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase = function(name, desc, srcSize, srcRect, dstSize, dstRect) { + es3fFramebufferBlitTests.BlitRectCase.call(this, name, desc, gl.NEAREST, srcSize, srcRect, dstSize, dstRect, 1); + }; + + es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase.prototype = Object.create(es3fFramebufferBlitTests.BlitRectCase.prototype); + es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase.prototype.constructor = es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase; + + /** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @return {boolean} + */ + es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase.prototype.compare = function(reference, result) { + assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight(), + 'Reference and result images have different dimensions', false, true); + + // Image origin must be visible (for baseColor) + DE_ASSERT(Math.min(this.m_dstRect[0], this.m_dstRect[2]) >= 0); + DE_ASSERT(Math.min(this.m_dstRect[1], this.m_dstRect[3]) >= 0); + /** @const {tcuRGBA.RGBA} */ var cellColorA = tcuRGBA.newRGBAFromVec(this.m_gridCellColorA); + /** @const {tcuRGBA.RGBA} */ var cellColorB = tcuRGBA.newRGBAFromVec(this.m_gridCellColorB); + // TODO: implement + // const tcu::RGBA threshold = this.m_context.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7); + /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(7, 7, 7, 7); + /** @const {Array} */ //IVec4.xyzw + var destinationArea = [ + deMath.clamp(Math.min(this.m_dstRect[0], this.m_dstRect[2]), 0, result.getWidth()), + deMath.clamp(Math.min(this.m_dstRect[1], this.m_dstRect[3]), 0, result.getHeight()), + deMath.clamp(Math.max(this.m_dstRect[0], this.m_dstRect[2]), 0, result.getWidth()), + deMath.clamp(Math.max(this.m_dstRect[1], this.m_dstRect[3]), 0, result.getHeight())]; + + /** @const {tcuRGBA.RGBA} */ var baseColor = new tcuRGBA.RGBA(result.getPixel(destinationArea[0], destinationArea[1])); + + /** @const {boolean} */ var signConfig = tcuRGBA.compareThreshold(baseColor, cellColorA, threshold); + + /** @type {boolean} */ var error = false; + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + /** @type {Array} */ var horisontalSign = []; + /** @type {Array} */ var verticalSign = []; + + errorMask.getAccess().clear([0.0, 1.0, 0.0, 1.0]); + + // Checking only area in our destination rect + + // m_testCtx.getLog() + // << tcu::TestLog::Message + // << 'Verifying consistency of NEAREST filtering. Verifying rect ' << m_dstRect << '.\n' + // << 'Rounding direction of the NEAREST filter at the horisontal texel edge (x = n + 0.5) should not depend on the y-coordinate.\n' + // << 'Rounding direction of the NEAREST filter at the vertical texel edge (y = n + 0.5) should not depend on the x-coordinate.\n' + // << 'Blitting a grid (with uniform sized cells) should result in a grid (with non-uniform sized cells).' + // << tcu::TestLog::EndMessage; + + // Verify that destination only contains valid colors + + /** @type {tcuRGBA.RGBA} */ var color; + + for (var dy = 0; dy < destinationArea[3] - destinationArea[1]; ++dy) { + for (var dx = 0; dx < destinationArea[2] - destinationArea[0]; ++dx) { + color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0] + dx, destinationArea[1] + dy)); + + /** @const {boolean} */ + var isValidColor = + tcuRGBA.compareThreshold(color, cellColorA, threshold) || + tcuRGBA.compareThreshold(color, cellColorB, threshold); + + if (!isValidColor) { + errorMask.setPixel(destinationArea[0] + dx, destinationArea[1] + dy, tcuRGBA.RGBA.red.toVec()); + error = true; + } + } + } + + if (error) { + // m_testCtx.getLog() + // << tcu::TestLog::Message + // << 'Image verification failed, destination rect contains unexpected values. ' + // << 'Expected either ' << cellColorA << ' or ' << cellColorB << '.' + // << tcu::TestLog::EndMessage + // << tcu::TestLog::ImageSet('Result', 'Image verification result') + // << tcu::TestLog::Image('Result', 'Result', result) + // << tcu::TestLog::Image('ErrorMask', 'Error mask', errorMask) + // << tcu::TestLog::EndImageSet; + return false; + } + + // Detect result edges by reading the first row and first column of the blitted area. + // Blitting a grid should result in a grid-like image. ('sign changes' should be consistent) + + for (var dx = 0; dx < destinationArea[2] - destinationArea[0]; ++dx) { + color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0] + dx, destinationArea[1])); + if (tcuRGBA.compareThreshold(color, cellColorA, threshold)) + horisontalSign[dx] = true; + else if (tcuRGBA.compareThreshold(color, cellColorB, threshold)) + horisontalSign[dx] = false; + else + DE_ASSERT(false); + } + for (var dy = 0; dy < destinationArea[3] - destinationArea[1]; ++dy) { + color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0], destinationArea[1] + dy)); + + if (tcuRGBA.compareThreshold(color, cellColorA, threshold)) + verticalSign[dy] = true; + else if (tcuRGBA.compareThreshold(color, cellColorB, threshold)) + verticalSign[dy] = false; + else + DE_ASSERT(false); + } + + // Verify grid-like image + + for (var dy = 0; dy < destinationArea[3] - destinationArea[1]; ++dy) { + for (var dx = 0; dx < destinationArea[2] - destinationArea[0]; ++dx) { + color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0] + dx, destinationArea[1] + dy)); + /** @const {boolean} */ var resultSign = tcuRGBA.compareThreshold(cellColorA, color, threshold); + /** @const {boolean} */ var correctSign = (horisontalSign[dx] == verticalSign[dy]) == signConfig; + + if (resultSign != correctSign) { + errorMask.setPixel(destinationArea[0] + dx, destinationArea[1] + dy, tcuRGBA.RGBA.red.toVec()); + error = true; + } + } + } + // Report result + + // if (error) + // { + // m_testCtx.getLog() + // << tcu::TestLog::Message + // << 'Image verification failed, nearest filter is not consistent.' + // << tcu::TestLog::EndMessage + // << tcu::TestLog::ImageSet('Result', 'Image verification result') + // << tcu::TestLog::Image('Result', 'Result', result) + // << tcu::TestLog::Image('ErrorMask', 'Error mask', errorMask) + // << tcu::TestLog::EndImageSet; + // } + // else + // { + // m_testCtx.getLog() + // << tcu::TestLog::Message + // << 'Image verification passed.' + // << tcu::TestLog::EndMessage + // << tcu::TestLog::ImageSet('Result', 'Image verification result') + // << tcu::TestLog::Image('Result', 'Result', result) + // << tcu::TestLog::EndImageSet; + // } + + return !error; + }; + + /** + * es3fFramebufferBlitTests.FramebufferBlitTests class, inherits from TestCase + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fFramebufferBlitTests.FramebufferBlitTests = function() { + tcuTestCase.DeqpTest.call(this, 'blit', 'Framebuffer blit tests'); + }; + + es3fFramebufferBlitTests.FramebufferBlitTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fFramebufferBlitTests.FramebufferBlitTests.prototype.constructor = es3fFramebufferBlitTests.FramebufferBlitTests; + + es3fFramebufferBlitTests.FramebufferBlitTests.prototype.init = function() { + /** @const {Array} */ var colorFormats = [ + // RGBA formats + gl.RGBA32I, + gl.RGBA32UI, + gl.RGBA16I, + gl.RGBA16UI, + gl.RGBA8, + gl.RGBA8I, + gl.RGBA8UI, + gl.SRGB8_ALPHA8, + gl.RGB10_A2, + gl.RGB10_A2UI, + gl.RGBA4, + gl.RGB5_A1, + + // RGB formats + gl.RGB8, + gl.RGB565, + + // RG formats + gl.RG32I, + gl.RG32UI, + gl.RG16I, + gl.RG16UI, + gl.RG8, + gl.RG8I, + gl.RG8UI, + + // R formats + gl.R32I, + gl.R32UI, + gl.R16I, + gl.R16UI, + gl.R8, + gl.R8I, + gl.R8UI, + + // gl.EXT_color_buffer_float + gl.RGBA32F, + gl.RGBA16F, + gl.R11F_G11F_B10F, + gl.RG32F, + gl.RG16F, + gl.R32F, + gl.R16F + ]; + + /** @const {Array} */ var depthStencilFormats = [ + gl.DEPTH_COMPONENT32F, + gl.DEPTH_COMPONENT24, + gl.DEPTH_COMPONENT16, + gl.DEPTH32F_STENCIL8, + gl.DEPTH24_STENCIL8, + gl.STENCIL_INDEX8 + ]; + + // .rect + /** @constructor + * @param {string} name + * @param {Array} srcRect + * @param {Array} dstRect + */ + var CopyRect = function(name, srcRect, dstRect) { + /** @const {string} */ this.name = name; + /** @type {Array} */ this.srcRect = srcRect; + /** @type {Array} */ this.dstRect = dstRect; + }; + + /** @const {Array} */ var copyRects = [ + new CopyRect('basic', [10, 20, 65, 100], [45, 5, 100, 85]), + new CopyRect('scale', [10, 20, 65, 100], [25, 30, 125, 94]), + new CopyRect('out_of_bounds', [-10, -15, 100, 63], [50, 30, 136, 144]) + ]; + + /** @const {Array} */ var filterConsistencyRects = [ + + new CopyRect('mag', [20, 10, 74, 88], [10, 10, 91, 101]), + new CopyRect('min', [10, 20, 78, 100], [20, 20, 71, 80]), + new CopyRect('out_of_bounds_mag', [21, 10, 73, 82], [11, 43, 141, 151]), + new CopyRect('out_of_bounds_min', [11, 21, 77, 97], [80, 82, 135, 139]) + ]; + + /** @constructor + * @param {?string} name + * @param {Array} srcSwizzle + * @param {Array} dstSwizzle + */ + var Swizzle = function(name, srcSwizzle, dstSwizzle) { + /** @const {?string} */ this.name = name; + /** @type {Array} */ this.srcSwizzle = srcSwizzle; + /** @type {Array} */ this.dstSwizzle = dstSwizzle; + }; + + /** @const {Array} */ var swizzles = [ + new Swizzle(null, [0, 1, 2, 3], [0, 1, 2, 3]), + new Swizzle('reverse_src_x', [2, 1, 0, 3], [0, 1, 2, 3]), + new Swizzle('reverse_src_y', [0, 3, 2, 1], [0, 1, 2, 3]), + new Swizzle('reverse_dst_x', [0, 1, 2, 3], [2, 1, 0, 3]), + new Swizzle('reverse_dst_y', [0, 1, 2, 3], [0, 3, 2, 1]), + new Swizzle('reverse_src_dst_x', [2, 1, 0, 3], [2, 1, 0, 3]), + new Swizzle('reverse_src_dst_y', [0, 3, 2, 1], [0, 3, 2, 1]) + ]; + + /** @const {Array} */ var srcSize = [127, 119]; + /** @const {Array} */ var dstSize = [132, 128]; + + // Blit rectangle tests. + for (var rectNdx = 0; rectNdx < copyRects.length; rectNdx++) { + /** @type {tcuTestCase.DeqpTest} */ var rectGroup = tcuTestCase.newTest('rect', 'Blit rectangle tests'); + this.addChild(rectGroup); + + for (var swzNdx = 0; swzNdx < swizzles.length; swzNdx++) { + /** @type {string} */ var name = copyRects[rectNdx].name + (swizzles[swzNdx].name ? ('_' + swizzles[swzNdx].name) : ''); + /** @type {Array} */ var srcSwz = swizzles[swzNdx].srcSwizzle; + /** @type {Array} */ var dstSwz = swizzles[swzNdx].dstSwizzle; + /** @type {Array} */ var srcRect = deMath.swizzle(copyRects[rectNdx].srcRect, srcSwz); + /** @type {Array} */ var dstRect = deMath.swizzle(copyRects[rectNdx].dstRect, dstSwz); + + rectGroup.addChild(new es3fFramebufferBlitTests.BlitRectCase((name + '_nearest'), '', gl.NEAREST, srcSize, srcRect, dstSize, dstRect)); + rectGroup.addChild(new es3fFramebufferBlitTests.BlitRectCase((name + '_linear'), '', gl.LINEAR, srcSize, srcRect, dstSize, dstRect)); + } + } + + // Nearest filter tests + for (var rectNdx = 0; rectNdx < filterConsistencyRects.length; rectNdx++) { + /** @type {tcuTestCase.DeqpTest} */ var rectGroup = tcuTestCase.newTest('rect', 'Blit rectangle tests'); + this.addChild(rectGroup); + for (var swzNdx = 0; swzNdx < swizzles.length; swzNdx++) { + var name = 'nearest_consistency_' + filterConsistencyRects[rectNdx].name + (swizzles[swzNdx].name ? ('_' + swizzles[swzNdx].name) : ''); + var srcSwz = swizzles[swzNdx].srcSwizzle; + var dstSwz = swizzles[swzNdx].dstSwizzle; + var srcRect = deMath.swizzle(filterConsistencyRects[rectNdx].srcRect, srcSwz); + var dstRect = deMath.swizzle(filterConsistencyRects[rectNdx].dstRect, dstSwz); + + rectGroup.addChild(new es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase(name, 'Test consistency of the nearest filter', srcSize, srcRect, dstSize, dstRect)); + } + } + + // .conversion + for (var srcFmtNdx = 0; srcFmtNdx < colorFormats.length; srcFmtNdx++) { + /** @type {tcuTestCase.DeqpTest} */ var conversionGroup = tcuTestCase.newTest('conversion', 'Color conversion tests'); + this.addChild(conversionGroup); + for (var dstFmtNdx = 0; dstFmtNdx < colorFormats.length; dstFmtNdx++) { + /** @type {number} */ var srcFormat = colorFormats[srcFmtNdx]; + /** @type {tcuTexture.TextureFormat} */ var srcTexFmt = gluTextureUtil.mapGLInternalFormat(srcFormat); + /** @type {tcuTexture.TextureChannelClass} */ var srcType = tcuTexture.getTextureChannelClass(srcTexFmt.type); + /** @type {number} */ var dstFormat = colorFormats[dstFmtNdx]; + /** @type {tcuTexture.TextureFormat} */ var dstTexFmt = gluTextureUtil.mapGLInternalFormat(dstFormat); + /** @type {tcuTexture.TextureChannelClass} */ var dstType = tcuTexture.getTextureChannelClass(dstTexFmt.type); + + if (((srcType == tcuTexture.TextureChannelClass.FLOATING_POINT || srcType == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) != + (dstType == tcuTexture.TextureChannelClass.FLOATING_POINT || dstType == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT)) || + ((srcType == tcuTexture.TextureChannelClass.SIGNED_INTEGER) != (dstType == tcuTexture.TextureChannelClass.SIGNED_INTEGER)) || + ((srcType == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER) != (dstType == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER))) + continue; // Conversion not supported. + + var name = es3fFboTestUtil.getFormatName(srcFormat) + '_to_' + es3fFboTestUtil.getFormatName(dstFormat); + + conversionGroup.addChild(new es3fFramebufferBlitTests.BlitColorConversionCase(name, '', srcFormat, dstFormat, [127, 113])); + } + } + + // .depth_stencil + /** @type {tcuTestCase.DeqpTest} */ var depthStencilGroup = tcuTestCase.newTest('depth_stencil', 'Depth and stencil blits'); + this.addChild(depthStencilGroup); + + for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) { + /** @type {number} */ var format = depthStencilFormats[fmtNdx]; + /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(format); + /** @type {string} */ var fmtName = es3fFboTestUtil.getFormatName(format); + /** @type {boolean} */ var depth = texFmt.order == tcuTexture.ChannelOrder.D || texFmt.order == tcuTexture.ChannelOrder.DS; + /** @type {boolean} */ var stencil = texFmt.order == tcuTexture.ChannelOrder.S || texFmt.order == tcuTexture.ChannelOrder.DS; + /** @type {number} */ var buffers = (depth ? gl.DEPTH_BUFFER_BIT : 0) | (stencil ? gl.STENCIL_BUFFER_BIT : 0); + + depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_basic'), '', format, buffers, [128, 128], [0, 0, 128, 128], buffers, [128, 128], [0, 0, 128, 128], buffers)); + depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_scale'), '', format, buffers, [127, 119], [10, 30, 100, 70], buffers, [111, 130], [20, 5, 80, 130], buffers)); + + if (depth && stencil) { + depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_depth_only'), '', format, buffers, [128, 128], [0, 0, 128, 128], buffers, [128, 128], [0, 0, 128, 128], gl.DEPTH_BUFFER_BIT)); + depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_stencil_only'), '', format, buffers, [128, 128], [0, 0, 128, 128], buffers, [128, 128], [0, 0, 128, 128], gl.STENCIL_BUFFER_BIT)); + } + } + + // .default_framebuffer + /** + * @constructor + * @param {string} name + * @param {es3fFramebufferBlitTests.BlitArea} area + */ + var Area = function(name, area) { + /** @type {string} name */ this.name = name; + /** @type {es3fFramebufferBlitTests.BlitArea} area */ this.area = area; + }; + + /** @type {Array} */ var areas = [ + new Area('scale', es3fFramebufferBlitTests.BlitArea.AREA_SCALE), + new Area('out_of_bounds', es3fFramebufferBlitTests.BlitArea.AREA_OUT_OF_BOUNDS) + ]; + + var numDefaultFbSubGroups = 7; + /** @type {Array} */ var defaultFbGroup = []; + for (var ii = 0; ii < numDefaultFbSubGroups; ++ii) { + defaultFbGroup[ii] = tcuTestCase.newTest('default_framebuffer', 'Blits with default framebuffer'); + this.addChild(defaultFbGroup[ii]); + } + for (var fmtNdx = 0; fmtNdx < colorFormats.length; fmtNdx++) { + var format = colorFormats[fmtNdx]; + var texFmt = gluTextureUtil.mapGLInternalFormat(format); + var fmtClass = tcuTexture.getTextureChannelClass(texFmt.type); + var filter = gluTextureUtil.isGLInternalColorFormatFilterable(format) ? gl.LINEAR : gl.NEAREST; + var filterable = gluTextureUtil.isGLInternalColorFormatFilterable(format); + + if (fmtClass != tcuTexture.TextureChannelClass.FLOATING_POINT && + fmtClass != tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT && + fmtClass != tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) + continue; // Conversion not supported. + + defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.BlitDefaultFramebufferCase(es3fFboTestUtil.getFormatName(format), '', format, filter)); + + for (var areaNdx = 0; areaNdx < areas.length; areaNdx++) { + var name = areas[areaNdx].name; + var addLinear = filterable; + var addNearest = !addLinear || (areas[areaNdx].area != es3fFramebufferBlitTests.BlitArea.AREA_OUT_OF_BOUNDS); // No need to check out-of-bounds with different filtering + + if (addNearest) { + + defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_nearest_' + name + '_blit_from_default'), '', format, gl.NEAREST, es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET, areas[areaNdx].area)); + defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_nearest_' + name + '_blit_to_default'), '', format, gl.NEAREST, es3fFramebufferBlitTests.BlitDirection.BLIT_TO_DEFAULT_FROM_TARGET, areas[areaNdx].area)); + } + + if (addLinear) { + defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_linear_' + name + '_blit_from_default'), '', format, gl.LINEAR, es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET, areas[areaNdx].area)); + defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_linear_' + name + '_blit_to_default'), '', format, gl.LINEAR, es3fFramebufferBlitTests.BlitDirection.BLIT_TO_DEFAULT_FROM_TARGET, areas[areaNdx].area)); + } + } + } + }; + + /** + * @param {?tcuTexture.ChannelOrder} order + * @return {Array} + */ + es3fFramebufferBlitTests.getChannelMask = function(order) { + switch (order) { + case tcuTexture.ChannelOrder.R: return [true, false, false, false]; + case tcuTexture.ChannelOrder.RG: return [true, true, false, false]; + case tcuTexture.ChannelOrder.RGB: return [true, true, true, false]; + case tcuTexture.ChannelOrder.RGBA: return [true, true, true, true]; + case tcuTexture.ChannelOrder.sRGB: return [true, true, true, false]; + case tcuTexture.ChannelOrder.sRGBA: return [true, true, true, true]; + default: + DE_ASSERT(false); + return [false, false, false, false]; + } + }; + + /** + * es3fFramebufferBlitTests.BlitColorConversionCase class, inherits from FboTestCase + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} srcFormat + * @param {number} dstFormat + * @param {Array} size + */ + es3fFramebufferBlitTests.BlitColorConversionCase = function(name, desc, srcFormat, dstFormat, size) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + /** @type {number} */ this.m_srcFormat = srcFormat; + /** @type {number} */ this.m_dstFormat = dstFormat; + /** @type {Array} */ this.m_size = size; + }; + + es3fFramebufferBlitTests.BlitColorConversionCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype); + es3fFramebufferBlitTests.BlitColorConversionCase.prototype.constructor = es3fFramebufferBlitTests.BlitColorConversionCase; + + es3fFramebufferBlitTests.BlitColorConversionCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_srcFormat); + this.checkFormatSupport(this.m_dstFormat); + return true; // No exception thrown + }; + + /** + * @param {tcuSurface.Surface} dst + */ + es3fFramebufferBlitTests.BlitColorConversionCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + /** @type {tcuTexture.TextureFormat} */ var srcFormat = gluTextureUtil.mapGLInternalFormat(this.m_srcFormat); + /** @type {tcuTexture.TextureFormat} */ var dstFormat = gluTextureUtil.mapGLInternalFormat(this.m_dstFormat); + + /** @type {gluShaderUtil.DataType} */ var srcOutputType = es3fFboTestUtil.getFragmentOutputType(srcFormat); + /** @type {gluShaderUtil.DataType} */ var dstOutputType = es3fFboTestUtil.getFragmentOutputType(dstFormat); + + // Compute ranges \note Doesn't handle case where src or dest is not subset of the another! + /** @type {tcuTextureUtil.TextureFormatInfo} */ var srcFmtRangeInfo = tcuTextureUtil.getTextureFormatInfo(srcFormat); + /** @type {tcuTextureUtil.TextureFormatInfo} */ var dstFmtRangeInfo = tcuTextureUtil.getTextureFormatInfo(dstFormat); + + /** @type {Array} */ var copyMask = deMath.logicalAndBool(es3fFramebufferBlitTests.getChannelMask(srcFormat.order), es3fFramebufferBlitTests.getChannelMask(dstFormat.order)); + /** @type {Array} */ var srcIsGreater = deMath.greaterThan(deMath.subtract(srcFmtRangeInfo.valueMax, srcFmtRangeInfo.valueMin), deMath.subtract(dstFmtRangeInfo.valueMax, dstFmtRangeInfo.valueMin)); + + /** @type {tcuTextureUtil.TextureFormatInfo} */ var srcRangeInfo = new tcuTextureUtil.TextureFormatInfo( + tcuTextureUtil.select(dstFmtRangeInfo.valueMin, srcFmtRangeInfo.valueMin, deMath.logicalAndBool(copyMask, srcIsGreater)), + tcuTextureUtil.select(dstFmtRangeInfo.valueMax, srcFmtRangeInfo.valueMax, deMath.logicalAndBool(copyMask, srcIsGreater)), + tcuTextureUtil.select(dstFmtRangeInfo.lookupScale, srcFmtRangeInfo.lookupScale, deMath.logicalAndBool(copyMask, srcIsGreater)), + tcuTextureUtil.select(dstFmtRangeInfo.lookupBias, srcFmtRangeInfo.lookupBias, deMath.logicalAndBool(copyMask, srcIsGreater))); + /** @type {tcuTextureUtil.TextureFormatInfo} */ var dstRangeInfo = new tcuTextureUtil.TextureFormatInfo( + tcuTextureUtil.select(dstFmtRangeInfo.valueMin, srcFmtRangeInfo.valueMin, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater)), + tcuTextureUtil.select(dstFmtRangeInfo.valueMax, srcFmtRangeInfo.valueMax, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater)), + tcuTextureUtil.select(dstFmtRangeInfo.lookupScale, srcFmtRangeInfo.lookupScale, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater)), + tcuTextureUtil.select(dstFmtRangeInfo.lookupBias, srcFmtRangeInfo.lookupBias, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater))); + + // Shaders. + /** @type {es3fFboTestUtil.GradientShader} */ + var gradientToSrcShader = new es3fFboTestUtil.GradientShader(srcOutputType); + /** @type {es3fFboTestUtil.GradientShader} */ + var gradientToDstShader = new es3fFboTestUtil.GradientShader(dstOutputType); + + var gradShaderSrcID = ctx.createProgram(gradientToSrcShader); + var gradShaderDstID = ctx.createProgram(gradientToDstShader); + + var srcFbo; + var dstFbo; + var srcRbo; + var dstRbo; + + // Create framebuffers. + // Source framebuffers + srcFbo = ctx.createFramebuffer(); + srcRbo = ctx.createRenderbuffer(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, srcRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_srcFormat, this.m_size[0], this.m_size[1]); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, srcRbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + // Destination framebuffers + dstFbo = ctx.createFramebuffer(); + dstRbo = ctx.createRenderbuffer(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, dstRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_dstFormat, this.m_size[0], this.m_size[1]); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dstRbo); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + ctx.viewport(0, 0, this.m_size[0], this.m_size[1]); + + // Render gradients. + for (var ndx = 0; ndx < 2; ndx++) { + ctx.bindFramebuffer(gl.FRAMEBUFFER, ndx ? dstFbo : srcFbo); + if (ndx) { + gradientToDstShader.setGradient(ctx, gradShaderDstID, dstRangeInfo.valueMax, dstRangeInfo.valueMin); + rrUtil.drawQuad(ctx, gradShaderDstID, [-1, -1, 0], [1, 1, 0]); + } else { + gradientToSrcShader.setGradient(ctx, gradShaderSrcID, srcRangeInfo.valueMin, srcRangeInfo.valueMax); + rrUtil.drawQuad(ctx, gradShaderSrcID, [-1, -1, 0], [1, 1, 0]); + } + } + + // Execute copy. + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, srcFbo); + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, dstFbo); + ctx.blitFramebuffer(0, 0, this.m_size[0], this.m_size[1], 0, 0, this.m_size[0], this.m_size[1], gl.COLOR_BUFFER_BIT, gl.NEAREST); + this.checkError(); + + // Read results. + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, dstFbo); + this.readPixelsUsingFormat(dst, 0, 0, this.m_size[0], this.m_size[1], dstFormat, dstRangeInfo.lookupScale, dstRangeInfo.lookupBias); + + }; + + /** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + */ + es3fFramebufferBlitTests.BlitColorConversionCase.prototype.compare = function(reference, result) { + /** @const {tcuTexture.TextureFormat} */ var srcFormat = gluTextureUtil.mapGLInternalFormat(this.m_srcFormat); + /** @const {tcuTexture.TextureFormat} */ var dstFormat = gluTextureUtil.mapGLInternalFormat(this.m_dstFormat); + /** @const {boolean} */ var srcIsSRGB = (srcFormat.order == tcuTexture.ChannelOrder.sRGBA); + /** @const {boolean} */ var dstIsSRGB = (dstFormat.order == tcuTexture.ChannelOrder.sRGBA); + /** @type {tcuRGBA.RGBA} */ var threshold = new tcuRGBA.RGBA(); + + if (dstIsSRGB) + threshold = es3fFboTestUtil.getToSRGBConversionThreshold(srcFormat, dstFormat); + else { + /** @type {tcuRGBA.RGBA} */ var srcMaxDiff = es3fFboTestUtil.getThresholdFromTextureFormat(srcFormat); + /** @type {tcuRGBA.RGBA} */ var dstMaxDiff = es3fFboTestUtil.getThresholdFromTextureFormat(dstFormat); + if (srcIsSRGB) + srcMaxDiff = tcuRGBA.multiply(srcMaxDiff, 2); + + threshold = tcuRGBA.max(srcMaxDiff, dstMaxDiff); + } + + // m_testCtx.getLog() << tcu::TestLog::Message << 'threshold = ' << threshold << tcu::TestLog::EndMessage; + return tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', reference, result, threshold.toIVec()); + }; + + /** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} format deUint32 + * @param {number} srcBuffers deUint32 + * @param {Array} srcSize IVec2 + * @param {Array} srcRect IVec4 + * @param {number} dstBuffers deUint32 + * @param {Array} dstSize IVec2 + * @param {Array} dstRect IVec4 + * @param {number} copyBuffers deUint32 + */ + es3fFramebufferBlitTests.BlitDepthStencilCase = function(name, desc, format, srcBuffers, srcSize, srcRect, dstBuffers, dstSize, dstRect, copyBuffers) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + /** @type {number} */ this.m_format = format; + /** @type {number} */ this.m_srcBuffers = srcBuffers; + /** @type {Array} */ this.m_srcSize = srcSize; + /** @type {Array} */ this.m_srcRect = srcRect; + /** @type {number} */ this.m_dstBuffers = dstBuffers; + /** @type {Array} */ this.m_dstSize = dstSize; + /** @type {Array} */ this.m_dstRect = dstRect; + /** @type {number} */ this.m_copyBuffers = copyBuffers; + }; + + es3fFramebufferBlitTests.BlitDepthStencilCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype); + es3fFramebufferBlitTests.BlitDepthStencilCase.prototype.constructor = es3fFramebufferBlitTests.BlitDepthStencilCase; + + /** + * @protected + */ + es3fFramebufferBlitTests.BlitDepthStencilCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + + /** + * @protected + * @param {tcuSurface.Surface} dst + */ + es3fFramebufferBlitTests.BlitDepthStencilCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + /** @const {number} */ var colorFormat = gl.RGBA8; + var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D] , + gluShaderUtil.DataType.FLOAT_VEC4); + var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4); + + var flatShaderID = ctx.createProgram(flatShader); + var texShaderID = ctx.createProgram(texShader); + var gradShaderID = ctx.createProgram(gradShader); + + var srcFbo; + var dstFbo; + var srcColorRbo; + var dstColorRbo; + var srcDepthStencilRbo; + var dstDepthStencilRbo; + + // setup shaders + gradShader.setGradient(ctx, gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + texShader.setUniforms(ctx, texShaderID); + + // Create framebuffers + // Source framebuffers + srcFbo = ctx.createFramebuffer(); + srcColorRbo = ctx.createRenderbuffer(); + srcDepthStencilRbo = ctx.createRenderbuffer(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, srcColorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_srcSize[0], this.m_srcSize[1]); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, srcDepthStencilRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_srcSize[0], this.m_srcSize[1]); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, srcColorRbo); + + if (this.m_srcBuffers & gl.DEPTH_BUFFER_BIT) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, srcDepthStencilRbo); + if (this.m_srcBuffers & gl.STENCIL_BUFFER_BIT) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, srcDepthStencilRbo); + + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + // Clear depth to 1 and stencil to 0. + ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0); + + // Destination framebuffers + dstFbo = ctx.createFramebuffer(); + dstColorRbo = ctx.createRenderbuffer(); + dstDepthStencilRbo = ctx.createRenderbuffer(); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, dstColorRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_dstSize[0], this.m_dstSize[1]); + + ctx.bindRenderbuffer(gl.RENDERBUFFER, dstDepthStencilRbo); + ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_dstSize[0], this.m_dstSize[1]); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo); + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dstColorRbo); + + if (this.m_dstBuffers & gl.DEPTH_BUFFER_BIT) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, dstDepthStencilRbo); + if (this.m_dstBuffers & gl.STENCIL_BUFFER_BIT) + ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, dstDepthStencilRbo); + + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + // Clear depth to 1 and stencil to 0. + ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0); + + // Fill source with gradient, depth = [-1..1], stencil = 7 + ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo); + ctx.viewport(0, 0, this.m_srcSize[0], this.m_srcSize[1]); + ctx.enable(gl.DEPTH_TEST); + ctx.enable(gl.STENCIL_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + ctx.stencilFunc(gl.ALWAYS, 7, 0xff); + + rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, -1], [1, 1, 1]); + + // Fill destination with grid pattern, depth = 0 and stencil = 1 + /** @const {number} */ var format = gl.RGBA; + /** @const {number} */ var dataType = gl.UNSIGNED_BYTE; + /** @const {number} */ var texW = this.m_srcSize[0]; + /** @const {number} */ var texH = this.m_srcSize[1]; + /** @type {WebGLTexture|sglrReferenceContext.TextureContainer} */ var gridTex = null; + /** @type {tcuTexture.TextureLevel} */ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]); + + gridTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, gridTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr()); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo); + ctx.viewport(0, 0, this.m_dstSize[0], this.m_dstSize[1]); + ctx.stencilFunc(gl.ALWAYS, 1, 0xff); + + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + + // Perform copy. + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, srcFbo); + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, dstFbo); + ctx.blitFramebuffer(this.m_srcRect[0], this.m_srcRect[1], this.m_srcRect[2], this.m_srcRect[3], this.m_dstRect[0], this.m_dstRect[1], this.m_dstRect[2], this.m_dstRect[3], this.m_copyBuffers, gl.NEAREST); + + // Render blue color where depth < 0, decrement on depth failure. + ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo); + ctx.viewport(0, 0, this.m_dstSize[0], this.m_dstSize[1]); + ctx.stencilOp(gl.KEEP, gl.DECR, gl.KEEP); + ctx.stencilFunc(gl.ALWAYS, 0, 0xff); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 0.0, 1.0, 1.0]); + + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]); + + if (this.m_dstBuffers & gl.STENCIL_BUFFER_BIT) { + // Render green color where stencil == 6. + ctx.disable(gl.DEPTH_TEST); + ctx.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + ctx.stencilFunc(gl.EQUAL, 6, 0xff); + + flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 1.0, 0.0, 1.0]); + + rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]); + + } + this.readPixelsUsingFormat(dst, 0, 0, this.m_dstSize[0], this.m_dstSize[1], gluTextureUtil.mapGLInternalFormat(colorFormat), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]); + + }; + + /** + * @constructor + * @extends {es3fFboTestCase.FboTestCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} filter + */ + es3fFramebufferBlitTests.BlitDefaultFramebufferCase = function(name, desc, format, filter) { + es3fFboTestCase.FboTestCase.call(this, name, desc); + /** @const {number} */ this.m_format = format; + /** @const {number} */ this.m_filter = filter; + }; + + es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype); + es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.constructor = es3fFramebufferBlitTests.BlitDefaultFramebufferCase; + + /** + * @protected + */ + es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.preCheck = function() { + this.checkFormatSupport(this.m_format); + return true; // No exception thrown + }; + + /** + * @protected + * @param {tcuSurface.Surface} dst + */ + es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.render = function(dst) { + var ctx = this.getCurrentContext(); + /** @type {tcuTexture.TextureFormat} */ var colorFormat = gluTextureUtil.mapGLInternalFormat(this.m_format); + /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(colorFormat); + + /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4); + /** @type {es3fFboTestUtil.Texture2DShader} */ var texShader = new es3fFboTestUtil.Texture2DShader([gluTextureUtil.getSampler2DType(colorFormat)], gluShaderUtil.DataType.FLOAT_VEC4); + + var gradShaderID = ctx.createProgram(gradShader); + var texShaderID = ctx.createProgram(texShader); + var fbo; + var tex; + /** @const {number} */ var texW = 128; + /** @const {number} */ var texH = 128; + + // Setup shaders + gradShader.setGradient(ctx, gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + texShader.setUniforms(ctx, texShaderID); + + // FBO + fbo = ctx.createFramebuffer(); + tex = ctx.createTexture(); + + ctx.bindTexture(gl.TEXTURE_2D, tex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_filter); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_filter); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, texW, texH, 0, transferFmt.format, transferFmt.dataType, null); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + // Render gradient to screen. + ctx.bindFramebuffer(gl.FRAMEBUFFER, null); + + rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]); + + // Blit gradient from screen to fbo. + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, fbo); + ctx.blitFramebuffer(0, 0, ctx.getWidth(), ctx.getHeight(), 0, 0, texW, texH, gl.COLOR_BUFFER_BIT, this.m_filter); + + // Fill left half of viewport with quad that uses texture. + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null); + ctx.clearBufferfv(gl.COLOR, 0, [1.0, 0.0, 0.0, 1.0]); + + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + + // Blit fbo to right half. + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo); + ctx.blitFramebuffer(0, 0, texW, texH, Math.floor(ctx.getWidth() / 2), 0, ctx.getWidth(), ctx.getHeight(), gl.COLOR_BUFFER_BIT, this.m_filter); + + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, null); + this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight()); + + }; + + /** + * @protected + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + */ + es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.compare = function(reference, result) { + /** @const {tcuRGBA.RGBA} */ + var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_format), tcuRGBA.newRGBAComponents(12, 12, 12, 12)); + + //m_testCtx.getLog() << TestLog::Message << 'Comparing images, threshold: ' << threshold << TestLog::EndMessage; + + return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold); + }; + + /** @enum */ + es3fFramebufferBlitTests.BlitDirection = { + BLIT_DEFAULT_TO_TARGET: 0, + BLIT_TO_DEFAULT_FROM_TARGET: 1 + }; + + /** @enum */ + es3fFramebufferBlitTests.BlitArea = { + AREA_SCALE: 0, + AREA_OUT_OF_BOUNDS: 1 + }; + + /** + * @constructor + * @extends {es3fFramebufferBlitTests.BlitDefaultFramebufferCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} filter + * @param {es3fFramebufferBlitTests.BlitDirection} dir + * @param {es3fFramebufferBlitTests.BlitArea} area + */ + es3fFramebufferBlitTests.DefaultFramebufferBlitCase = function(name, desc, format, filter, dir, area) { + es3fFramebufferBlitTests.BlitDefaultFramebufferCase.call(this, name, desc, format, filter); + /** @const {es3fFramebufferBlitTests.BlitDirection} */ this.m_blitDir = dir; + /** @const {es3fFramebufferBlitTests.BlitArea} */ this.m_blitArea = area; + /** @type {Array} */ this.m_srcRect = [-1, -1, -1, -1]; + /** @type {Array} */ this.m_dstRect = [-1, -1, -1, -1]; + /** @type {Array} */ this.m_interestingArea = [-1, -1, -1, -1]; + }; + + es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype = Object.create(es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype); + es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype.constructor = es3fFramebufferBlitTests.DefaultFramebufferBlitCase; + + es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype.init = function() { + // requirements + /** @const {number} */ var minViewportSize = 128; + if (gl.drawingBufferWidth < minViewportSize || + gl.drawingBufferHeight < minViewportSize) + throw new Error('Viewport size ' + minViewportSize + 'x' + minViewportSize + ' required'); + + // prevent viewport randoming + this.m_viewportWidth = gl.drawingBufferWidth; + this.m_viewportHeight = gl.drawingBufferHeight; + + // set proper areas + if (this.m_blitArea == es3fFramebufferBlitTests.BlitArea.AREA_SCALE) { + this.m_srcRect = [10, 20, 65, 100]; + this.m_dstRect = [25, 30, 125, 94]; + this.m_interestingArea = [0, 0, 128, 128]; + } else if (this.m_blitArea == es3fFramebufferBlitTests.BlitArea.AREA_OUT_OF_BOUNDS) { + /** @const {Array} */ + var ubound = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? + ([128, 128]) : + ([gl.drawingBufferWidth, gl.drawingBufferHeight]); + + this.m_srcRect = [-10, -15, 100, 63]; + this.m_dstRect = deMath.add(deMath.swizzle(ubound, [0, 1, 0, 1]), [-75, -99, 8, 16]); + this.m_interestingArea = [ubound[0] - 128, ubound[1] - 128, ubound[0], ubound[1]]; + } + }; + + /** + * @param {tcuSurface.Surface} dst + */ + es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype.render = function(dst) { + /** @type {es3fFboTestCase.Context} */ + var ctx = this.getCurrentContext(); + // TOOD: implement + /** @type {tcuTexture.TextureFormat} */ var colorFormat = gluTextureUtil.mapGLInternalFormat(this.m_format); + /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(colorFormat); + /** @const {tcuTexture.TextureChannelClass} */ + var targetClass = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? + (tcuTexture.getTextureChannelClass(colorFormat.type)) : + (tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT); + + var fbo; + var fboTex; + /** @const {number} */ var fboTexW = 128; + /** @const {number} */ var fboTexH = 128; + /** @const {number} */ var sourceWidth = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (ctx.getWidth()) : (fboTexW); + /** @const {number} */ var sourceHeight = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (ctx.getHeight()) : (fboTexH); + /** @const {number} */ var gridRenderWidth = Math.min(256, sourceWidth); + /** @const {number} */ var gridRenderHeight = Math.min(256, sourceHeight); + + var targetFbo; + var sourceFbo; + + // FBO + fbo = ctx.createFramebuffer(); + fboTex = ctx.createTexture(); + + ctx.bindTexture(gl.TEXTURE_2D, fboTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_filter); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_filter); + ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, fboTexW, fboTexH, 0, transferFmt.format, transferFmt.dataType, null); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo); + ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fboTex, 0); + this.checkError(); + this.checkFramebufferStatus(gl.FRAMEBUFFER); + + targetFbo = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (fbo) : (null); + sourceFbo = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (null) : (fbo); + + // Render grid to source framebuffer + /** @type {es3fFboTestUtil.Texture2DShader} */ + var texShader = new es3fFboTestUtil.Texture2DShader( + [gluShaderUtil.DataType.SAMPLER_2D], + gluShaderUtil.DataType.FLOAT_VEC4); + var texShaderID = this.getCurrentContext().createProgram(texShader); + /** @const {number} */ var internalFormat = gl.RGBA8; + /** @const {number} */ var format = gl.RGBA; + /** @const {number} */ var dataType = gl.UNSIGNED_BYTE; + /** @const {number} */ var gridTexW = 128; + /** @const {number} */ var gridTexH = 128; + /** @type {WebGLTexture|framework.opengl.simplereference.sglrReferenceContext.TextureContainer|null} */ + var gridTex = null; + /** @type {tcuTexture.TextureLevel} */ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), gridTexW, gridTexH, 1); + + tcuTextureUtil.fillWithGrid(data.getAccess(), 9, [0.9, 0.5, 0.1, 0.9], [0.2, 0.8, 0.2, 0.7]); + + gridTex = ctx.createTexture(); + ctx.bindTexture(gl.TEXTURE_2D, gridTex); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + ctx.texImage2D(gl.TEXTURE_2D, 0, internalFormat, gridTexW, gridTexH, 0, format, dataType, data.getAccess().getDataPtr()); + + ctx.bindFramebuffer(gl.FRAMEBUFFER, sourceFbo); + ctx.viewport(0, 0, gridRenderWidth, gridRenderHeight); + ctx.clearBufferfv(gl.COLOR, 0, [1.0, 0.0, 0.0, 1.0]); + + texShader.setUniforms(this.getCurrentContext(), texShaderID); + + rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]); + + ctx.useProgram(null); + + // Blit source framebuffer to destination + + ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, sourceFbo); + ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, targetFbo); + this.checkError(); + + if (targetClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT || + targetClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT || + targetClass == tcuTexture.TextureChannelClass.FLOATING_POINT) + ctx.clearBufferfv(gl.COLOR, 0, [1.0, 1.0, 0.0, 1.0]); + else if (targetClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER) + ctx.clearBufferiv(gl.COLOR, 0, [0, 0, 0, 0]); + else if (targetClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER) + ctx.clearBufferuiv(gl.COLOR, 0, [0, 0, 0, 0]); + else + DE_ASSERT(false); + + ctx.blitFramebuffer(this.m_srcRect[0], this.m_srcRect[1], this.m_srcRect[2], this.m_srcRect[3], this.m_dstRect[0], this.m_dstRect[1], this.m_dstRect[2], this.m_dstRect[3], gl.COLOR_BUFFER_BIT, this.m_filter); + this.checkError(); + + // Read target + + ctx.bindFramebuffer(gl.FRAMEBUFFER, targetFbo); + + if (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_TO_DEFAULT_FROM_TARGET) + this.readPixels(dst, this.m_interestingArea[0], this.m_interestingArea[1], this.m_interestingArea[2] - this.m_interestingArea[0], this.m_interestingArea[3] - this.m_interestingArea[1]); + else + this.readPixelsUsingFormat(dst, this.m_interestingArea[0], this.m_interestingArea[1], this.m_interestingArea[2] - this.m_interestingArea[0], this.m_interestingArea[3] - this.m_interestingArea[1], colorFormat, [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]); + + this.checkError(); + }; + + es3fFramebufferBlitTests.run = function(context, range) { + gl = context; + //Set up root Test + var state = tcuTestCase.runner; + + var test = new es3fFramebufferBlitTests.FramebufferBlitTests(); + var testName = test.fullName(); + var testDescription = test.getDescription() || ''; + + state.testName = testName; + state.setRoot(test); + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + test.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + bufferedLogToConsole(err); + testFailedOptions('Failed to es3fFramebufferBlitTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js new file mode 100644 index 000000000..a18f6708b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js @@ -0,0 +1,409 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fIndexedStateQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('functional.gles3.es3fApiCase'); + +goog.scope(function() { + var es3fIndexedStateQueryTests = functional.gles3.es3fIndexedStateQueryTests; + var tcuTestCase = framework.common.tcuTestCase; + var es3fApiCase = functional.gles3.es3fApiCase; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIndexedStateQueryTests.TransformFeedbackCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIndexedStateQueryTests.TransformFeedbackCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIndexedStateQueryTests.TransformFeedbackCase.prototype.constructor = es3fIndexedStateQueryTests.TransformFeedbackCase; + + es3fIndexedStateQueryTests.TransformFeedbackCase.prototype.testTransformFeedback = function() { + throw new Error('This method should be overriden.'); + }; + + es3fIndexedStateQueryTests.TransformFeedbackCase.prototype.test = function() { + /** @type {string} */ var transformFeedbackTestVertSource = '' + + '#version 300 es\n' + + 'out highp vec4 anotherOutput;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + ' anotherOutput = vec4(0.0);\n' + + '}\n'; + /** @type {string} */ var transformFeedbackTestFragSource = '' + + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER); + /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, transformFeedbackTestVertSource); + gl.shaderSource(shaderFrag, transformFeedbackTestFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + /** @type {WebGLProgram} */ var shaderProg = gl.createProgram(); + gl.attachShader(shaderProg, shaderVert); + gl.attachShader(shaderProg, shaderFrag); + + /** @type {Array} */ var transformFeedbackOutputs = ['gl_Position', 'anotherOutput']; + + gl.transformFeedbackVaryings(shaderProg, transformFeedbackOutputs, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(shaderProg); + + /** @type {WebGLTransformFeedback} */ var transformFeedbackId = gl.createTransformFeedback(); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedbackId); + + this.testTransformFeedback(); + + // cleanup + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + + gl.deleteTransformFeedback(transformFeedbackId); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(shaderProg); + }; + + /** + * @constructor + * @extends {es3fIndexedStateQueryTests.TransformFeedbackCase} + * @param {string} name + * @param {string} description + */ + es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase = function(name, description) { + es3fIndexedStateQueryTests.TransformFeedbackCase.call(this, name, description); + }; + + es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase.prototype = Object.create(es3fIndexedStateQueryTests.TransformFeedbackCase.prototype); + es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase.prototype.constructor = es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase; + + es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase.prototype.testTransformFeedback = function() { + /** @type {number} */ var feedbackPositionIndex = 0; + /** @type {number} */ var feedbackOutputIndex = 1; + /** @type {Array} */ var feedbackIndex = [feedbackPositionIndex, feedbackOutputIndex]; + + // bind buffers + + /** @type {Array} */ var feedbackBuffers = []; + for (var ndx = 0; ndx < 2; ndx++) + feedbackBuffers[ndx] = gl.createBuffer(); + + for (var ndx = 0; ndx < feedbackBuffers.length; ndx++) { + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBuffers[ndx]); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackIndex[ndx], feedbackBuffers[ndx]); + } + + // test TRANSFORM_FEEDBACK_BUFFER_BINDING + for (var ndx = 0; ndx < feedbackBuffers.length; ndx++) { + var boundBuffer = /** @type {WebGLBuffer} */ (gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, ndx)); + this.check(boundBuffer === feedbackBuffers[ndx], 'buffers do not match'); + } + + // cleanup + for (var ndx = 0; ndx < feedbackBuffers.length; ndx++) + gl.deleteBuffer(feedbackBuffers[ndx]); + }; + + /** + * @constructor + * @extends {es3fIndexedStateQueryTests.TransformFeedbackCase} + * @param {string} name + * @param {string} description + */ + es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase = function(name, description) { + es3fIndexedStateQueryTests.TransformFeedbackCase.call(this, name, description); + }; + + es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase.prototype = Object.create(es3fIndexedStateQueryTests.TransformFeedbackCase.prototype); + es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase.prototype.constructor = es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase; + + es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase.prototype.testTransformFeedback = function() { + /** @type {number} */ var feedbackPositionIndex = 0; + /** @type {number} */ var feedbackOutputIndex = 1; + + /** @type {number} */ var rangeBufferOffset = 4; + /** @type {number} */ var rangeBufferSize = 8; + + // bind buffers + + /** @type {Array} */ var feedbackBuffers = []; + for (var ndx = 0; ndx < 2; ndx++) + feedbackBuffers[ndx] = gl.createBuffer(); + + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBuffers[0]); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackPositionIndex, feedbackBuffers[0]); + + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBuffers[1]); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ); + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackOutputIndex, feedbackBuffers[1], rangeBufferOffset, rangeBufferSize); + + /** @type {Array<{index: number, pname: number, value: number}>} */ var requirements = [ + {index: feedbackPositionIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_START, value: 0}, + {index: feedbackPositionIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_SIZE, value: 0}, + {index: feedbackOutputIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_START, value: rangeBufferOffset}, + {index: feedbackOutputIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_SIZE, value: rangeBufferSize} + ]; + + for (var ndx = 0; ndx < requirements.length; ndx++) { + var state = /** @type {number} */ (gl.getIndexedParameter(requirements[ndx].pname, requirements[ndx].index)); + this.check(state === requirements[ndx].value, 'got ' + state + '; expected ' + requirements[ndx].value); + } + + // cleanup + for (var ndx = 0; ndx < feedbackBuffers.length; ndx++) + gl.deleteBuffer(feedbackBuffers[ndx]); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIndexedStateQueryTests.UniformBufferCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {?WebGLProgram} */ this.m_program = null; + }; + + es3fIndexedStateQueryTests.UniformBufferCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIndexedStateQueryTests.UniformBufferCase.prototype.constructor = es3fIndexedStateQueryTests.UniformBufferCase; + + es3fIndexedStateQueryTests.UniformBufferCase.prototype.testUniformBuffers = function() { + throw new Error('This method should be overriden.'); + }; + + es3fIndexedStateQueryTests.UniformBufferCase.prototype.test = function() { + + /** @type {string} */ var testVertSource = '' + + '#version 300 es\n' + + 'uniform highp vec4 input1;\n' + + 'uniform highp vec4 input2;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = input1 + input2;\n' + + '}\n'; + /** @type {string} */ var testFragSource = '' + + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER); + /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + this.m_program = gl.createProgram(); + gl.attachShader(this.m_program, shaderVert); + gl.attachShader(this.m_program, shaderFrag); + gl.linkProgram(this.m_program); + gl.useProgram(this.m_program); + + this.testUniformBuffers(); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(this.m_program); + }; + + /** + * @constructor + * @extends {es3fIndexedStateQueryTests.UniformBufferCase} + * @param {string} name + * @param {string} description + */ + es3fIndexedStateQueryTests.UniformBufferBindingCase = function(name, description) { + es3fIndexedStateQueryTests.UniformBufferCase.call(this, name, description); + /** @type {?WebGLProgram} */ this.m_program = null; + }; + + es3fIndexedStateQueryTests.UniformBufferBindingCase.prototype = Object.create(es3fIndexedStateQueryTests.UniformBufferCase.prototype); + es3fIndexedStateQueryTests.UniformBufferBindingCase.prototype.constructor = es3fIndexedStateQueryTests.UniformBufferBindingCase; + + es3fIndexedStateQueryTests.UniformBufferBindingCase.prototype.testUniformBuffers = function() { + /** @type {Array} */ var uniformNames = ['input1', 'input2']; + + /** @type {Array} */ var uniformIndices = gl.getUniformIndices(this.m_program, uniformNames); + + /** @type {Array} */ var buffers = []; + for (var ndx = 0; ndx < 2; ndx++) + buffers[ndx] = gl.createBuffer(); + + for (var ndx = 0; ndx < buffers.length; ++ndx) { + gl.bindBuffer(gl.UNIFORM_BUFFER, buffers[ndx]); + gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(32), gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.UNIFORM_BUFFER, uniformIndices[ndx], buffers[ndx]); + } + + /** @type {Array} */ var boundBuffer = []; + for (var ndx = 0; ndx < buffers.length; ndx++) { + boundBuffer[ndx] = /** @type {WebGLBuffer} */ (gl.getIndexedParameter(gl.UNIFORM_BUFFER_BINDING, uniformIndices[ndx])); + this.check(boundBuffer[ndx] === buffers[ndx], 'buffers do not match'); + } + + for (var ndx = 0; ndx < buffers.length; ndx++) + gl.deleteBuffer(buffers[ndx]); + }; + + /** + * @constructor + * @extends {es3fIndexedStateQueryTests.UniformBufferCase} + * @param {string} name + * @param {string} description + */ + es3fIndexedStateQueryTests.UniformBufferBufferCase = function(name, description) { + es3fIndexedStateQueryTests.UniformBufferCase.call(this, name, description); + /** @type {?WebGLProgram} */ this.m_program = null; + }; + + es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype = Object.create(es3fIndexedStateQueryTests.UniformBufferCase.prototype); + es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype.constructor = es3fIndexedStateQueryTests.UniformBufferBufferCase; + + es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype.testUniformBuffers = function() { + /** @type {Array} */ var uniformNames = ['input1', 'input2']; + + /** @type {Array} */ var uniformIndices = gl.getUniformIndices(this.m_program, uniformNames); + + /** @type {number} */ var alignment = this.getAlignment(); + if (alignment === -1) // cannot continue without this + return; + + bufferedLogToConsole('Alignment is ' + alignment); + + /** @type {number} */ var rangeBufferOffset = alignment; + /** @type {number} */ var rangeBufferSize = alignment * 2; + /** @type {number} */ var rangeBufferTotalSize = rangeBufferOffset + rangeBufferSize + 8; // + 8 has no special meaning, just to make it != with the size of the range + + /** @type {Array} */ var buffers = []; + for (var ndx = 0; ndx < 2; ndx++) + buffers[ndx] = gl.createBuffer(); + + gl.bindBuffer(gl.UNIFORM_BUFFER, buffers[0]); + gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(32), gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.UNIFORM_BUFFER, uniformIndices[0], buffers[0]); + + gl.bindBuffer(gl.UNIFORM_BUFFER, buffers[1]); + gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(32), gl.DYNAMIC_DRAW); + gl.bindBufferRange(gl.UNIFORM_BUFFER, uniformIndices[1], buffers[1], rangeBufferOffset, rangeBufferSize); + + // test UNIFORM_BUFFER_START and UNIFORM_BUFFER_SIZE + + /** @type {Array<{index: number, pname: number, value: number}>} */ var requirements = [ + {index: uniformIndices[0], pname: gl.UNIFORM_BUFFER_START, value: 0}, + {index: uniformIndices[0], pname: gl.UNIFORM_BUFFER_SIZE, value: 0}, + {index: uniformIndices[1], pname: gl.UNIFORM_BUFFER_START, value: rangeBufferOffset}, + {index: uniformIndices[1], pname: gl.UNIFORM_BUFFER_SIZE, value: rangeBufferSize} + ]; + + for (var ndx = 0; ndx < requirements.length; ndx++) { + var state = /** @type {number} */ (gl.getIndexedParameter(requirements[ndx].pname, requirements[ndx].index)); + + this.check(state === requirements[ndx].value, 'got ' + state + '; expected ' + requirements[ndx].value); + } + + for (var ndx = 0; ndx < buffers.length; ndx++) + gl.deleteBuffer(buffers[ndx]); + + }; + + /** + * @return {number} + */ + es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype.getAlignment = function() { + var state = /** @type {number} */ (gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT)); + + if (state <= 256) + return state; + + bufferedLogToConsole('ERROR: UNIFORM_BUFFER_OFFSET_ALIGNMENT has a maximum value of 256.'); + testFailedOptions('invalid UNIFORM_BUFFER_OFFSET_ALIGNMENT value', false); + + return -1; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fIndexedStateQueryTests.IndexedStateQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'indexed', 'Indexed Integer Values'); + }; + + es3fIndexedStateQueryTests.IndexedStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fIndexedStateQueryTests.IndexedStateQueryTests.prototype.constructor = es3fIndexedStateQueryTests.IndexedStateQueryTests; + + es3fIndexedStateQueryTests.IndexedStateQueryTests.prototype.init = function() { + // transform feedback + this.addChild(new es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase('transform_feedback_buffer_binding', 'TRANSFORM_FEEDBACK_BUFFER_BINDING')); + this.addChild(new es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase('transform_feedback_buffer_start_size', 'TRANSFORM_FEEDBACK_BUFFER_START and TRANSFORM_FEEDBACK_BUFFER_SIZE')); + + // uniform buffers + this.addChild(new es3fIndexedStateQueryTests.UniformBufferBindingCase('uniform_buffer_binding', 'UNIFORM_BUFFER_BINDING')); + this.addChild(new es3fIndexedStateQueryTests.UniformBufferBufferCase('uniform_buffer_start_size', 'UNIFORM_BUFFER_START and UNIFORM_BUFFER_SIZE')); + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fIndexedStateQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fIndexedStateQueryTests.IndexedStateQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fIndexedStateQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js new file mode 100644 index 000000000..adc7e857c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js @@ -0,0 +1,711 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fInstancedRenderingTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + +var es3fInstancedRenderingTests = functional.gles3.es3fInstancedRenderingTests; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuTestCase = framework.common.tcuTestCase; +var tcuSurface = framework.common.tcuSurface; +var deString = framework.delibs.debase.deString; +var deRandom = framework.delibs.debase.deRandom; +var tcuImageCompare = framework.common.tcuImageCompare; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var deMath = framework.delibs.debase.deMath; + + /** @type {?WebGL2RenderingContext} */ var gl; + + /** @const @type {number} */ es3fInstancedRenderingTests.MAX_RENDER_WIDTH = 128; + /** @const @type {number} */ es3fInstancedRenderingTests.MAX_RENDER_HEIGHT = 128; + + /** @const @type {number} */ es3fInstancedRenderingTests.QUAD_GRID_SIZE = 127; + + // Attribute divisors for the attributes defining the color's RGB components. + /** @const @type {number} */es3fInstancedRenderingTests.ATTRIB_DIVISOR_R = 3; + /** @const @type {number} */es3fInstancedRenderingTests.ATTRIB_DIVISOR_G = 2; + /** @const @type {number} */es3fInstancedRenderingTests.ATTRIB_DIVISOR_B = 1; + + /** @const @type {number} */es3fInstancedRenderingTests.OFFSET_COMPONENTS = 3; // \note Affects whether a float or a vecN is used in shader, but only first component is non-zero. + + // Scale and bias values when converting float to integer, when attribute is of integer type. + /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_INT_SCALE = 100.0; + /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_INT_BIAS = -50.0; + /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_UINT_SCALE = 100.0; + /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_UINT_BIAS = 0.0; + + var DE_ASSERT = function(expression) { + if (!expression) throw new Error('Assert failed'); + }; + + es3fInstancedRenderingTests.TCU_FAIL = function(message) { + throw new Error(message); + }; + + // es3fInstancedRenderingTests.InstancedRenderingCase + + /** + * es3fInstancedRenderingTests.DrawFunction + * @enum {number} + */ + es3fInstancedRenderingTests.DrawFunction = { + FUNCTION_DRAW_ARRAYS_INSTANCED: 0, + FUNCTION_DRAW_ELEMENTS_INSTANCED: 1 + }; + + /** + * es3fInstancedRenderingTests.InstancingType + * @enum {number} + */ + es3fInstancedRenderingTests.InstancingType = { + TYPE_INSTANCE_ID: 0, + TYPE_ATTRIB_DIVISOR: 1, + TYPE_MIXED: 2 + }; + + /** + * es3fInstancedRenderingTests.InstancedRenderingCase class, inherits from TestCase class + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {es3fInstancedRenderingTests.DrawFunction} drawFunction + * @param {es3fInstancedRenderingTests.InstancingType} instancingType + * @param {gluShaderUtil.DataType} rgbAttrType + * @param {number} numInstances + */ + es3fInstancedRenderingTests.InstancedRenderingCase = function(name, description, drawFunction, instancingType, rgbAttrType, numInstances) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {es3fInstancedRenderingTests.DrawFunction} */ this.m_function = drawFunction; + /** @type {es3fInstancedRenderingTests.InstancingType} */ this.m_instancingType = instancingType; + /** @type {gluShaderUtil.DataType} */ this.m_rgbAttrType = rgbAttrType; + /** @type {number} */ this.m_numInstances = numInstances; + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {Array} */ this.m_gridVertexPositions = []; + /** @type {Array} */ this.m_gridIndices = []; + /** @type {Array} */ this.m_instanceOffsets = []; + /** @type {Array} */ this.m_instanceColorR = []; + /** @type {Array} */ this.m_instanceColorG = []; + /** @type {Array} */ this.m_instanceColorB = []; + }; + + es3fInstancedRenderingTests.InstancedRenderingCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.constructor = es3fInstancedRenderingTests.InstancedRenderingCase; + + /** + * Helper function that does biasing and scaling when converting float to integer. + * @param {Array} vec + * @param {number} val + */ + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.pushVarCompAttrib = function(vec, val) { + var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(this.m_rgbAttrType); + var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType); + var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType); + var isMatCase = gluShaderUtil.isDataTypeMatrix(this.m_rgbAttrType); + if (isFloatCase || isMatCase) + vec.push(val); + else if (isIntCase) + vec.push(val * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS); + else if (isUintCase) + vec.push(val * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS); + else + throw new Error('Invalid attribute type.'); + }; + + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.init = function() { + // Clear errors from previous tests + gl.getError(); + + /** @type {boolean} */ var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(this.m_rgbAttrType); + /** @type {boolean} */ var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType); + /** @type {boolean} */ var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType); + /** @type {boolean} */ var isMatCase = gluShaderUtil.isDataTypeMatrix(this.m_rgbAttrType); + /** @type {number} */ var typeSize = gluShaderUtil.getDataTypeScalarSize(this.m_rgbAttrType); + /** @type {boolean} */ var isScalarCase = typeSize == 1; + /** @type {string} */ var swizzleFirst = isScalarCase ? '' : '.x'; + /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(this.m_rgbAttrType); + + /** @type {string} */ var floatIntScaleStr = '(' + es3fInstancedRenderingTests.FLOAT_INT_SCALE.toFixed(3) + ')'; + /** @type {string} */ var floatIntBiasStr = '(' + es3fInstancedRenderingTests.FLOAT_INT_BIAS.toFixed(3) + ')'; + /** @type {string} */ var floatUintScaleStr = '(' + es3fInstancedRenderingTests.FLOAT_UINT_SCALE.toFixed(3) + ')'; + /** @type {string} */ var floatUintBiasStr = '(' + es3fInstancedRenderingTests.FLOAT_UINT_BIAS.toFixed(3) + ')'; + + DE_ASSERT(isFloatCase || isIntCase || isUintCase || isMatCase); + + // Generate shader. + // \note For case TYPE_MIXED, vertex position offset and color red component get their values from instance id, while green and blue get their values from instanced attributes. + + /** @type {string} */ var numInstancesStr = this.m_numInstances.toString() + '.0'; + + /** @type {string} */ var instanceAttribs = ''; + /** @type {string} */ var posExpression = ''; + /** @type {string} */ var colorRExpression = ''; + /** @type {string} */ var colorGExpression = ''; + /** @type {string} */ var colorBExpression = ''; + + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) { + posExpression = 'a_position + vec4(float(gl_InstanceID) * 2.0 / ' + numInstancesStr + ', 0.0, 0.0, 0.0)'; + colorRExpression = 'float(gl_InstanceID)/' + numInstancesStr; + + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID) { + colorGExpression = 'float(gl_InstanceID)*2.0/' + numInstancesStr; + colorBExpression = '1.0 - float(gl_InstanceID)/' + numInstancesStr; + } + } + + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) { + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR) { + posExpression = 'a_position + vec4(a_instanceOffset'; + + DE_ASSERT(es3fInstancedRenderingTests.OFFSET_COMPONENTS >= 1 && es3fInstancedRenderingTests.OFFSET_COMPONENTS <= 4); + + for (var i = 0; i < 4 - es3fInstancedRenderingTests.OFFSET_COMPONENTS; i++) + posExpression += ', 0.0'; + posExpression += ')'; + + if (isFloatCase) + colorRExpression = 'a_instanceR' + swizzleFirst; + else if (isIntCase) + colorRExpression = '(float(a_instanceR' + swizzleFirst + ') - ' + floatIntBiasStr + ') / ' + floatIntScaleStr; + else if (isUintCase) + colorRExpression = '(float(a_instanceR' + swizzleFirst + ') - ' + floatUintBiasStr + ') / ' + floatUintScaleStr; + else if (isMatCase) + colorRExpression = 'a_instanceR[0][0]'; + else + DE_ASSERT(false); + + instanceAttribs += 'in highp ' + (es3fInstancedRenderingTests.OFFSET_COMPONENTS == 1 ? 'float' : 'vec' + es3fInstancedRenderingTests.OFFSET_COMPONENTS.toString()) + ' a_instanceOffset;\n'; + instanceAttribs += 'in mediump ' + typeName + ' a_instanceR;\n'; + } + + if (isFloatCase) { + colorGExpression = 'a_instanceG' + swizzleFirst; + colorBExpression = 'a_instanceB' + swizzleFirst; + } else if (isIntCase) { + colorGExpression = '(float(a_instanceG' + swizzleFirst + ') - ' + floatIntBiasStr + ') / ' + floatIntScaleStr; + colorBExpression = '(float(a_instanceB' + swizzleFirst + ') - ' + floatIntBiasStr + ') / ' + floatIntScaleStr; + } else if (isUintCase) { + colorGExpression = '(float(a_instanceG' + swizzleFirst + ') - ' + floatUintBiasStr + ') / ' + floatUintScaleStr; + colorBExpression = '(float(a_instanceB' + swizzleFirst + ') - ' + floatUintBiasStr + ') / ' + floatUintScaleStr; + } else if (isMatCase) { + colorGExpression = 'a_instanceG[0][0]'; + colorBExpression = 'a_instanceB[0][0]'; + } else + DE_ASSERT(false); + + instanceAttribs += 'in mediump ' + typeName + ' a_instanceG;\n'; + instanceAttribs += 'in mediump ' + typeName + ' a_instanceB;\n'; + } + + DE_ASSERT(!(posExpression.length == 0)); + DE_ASSERT(!(colorRExpression.length == 0)); + DE_ASSERT(!(colorGExpression.length == 0)); + DE_ASSERT(!(colorBExpression.length == 0)); + + /** @type {string} */ var vertShaderSourceStr = + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + instanceAttribs + + 'out mediump vec4 v_color;\n' + + '\n' + + 'void main()\n' + + ' {\n' + + ' gl_Position = ' + posExpression + ';\n' + + ' v_color.r = ' + colorRExpression + ';\n' + + ' v_color.g = ' + colorGExpression + ';\n' + + ' v_color.b = ' + colorBExpression + ';\n' + + ' v_color.a = 1.0;\n' + + '}\n'; + + /** @type {string} */ var fragShaderSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'in mediump vec4 v_color;\n' + + '\n' + + 'void main()\n' + + ' {\n' + + ' o_color = v_color;\n' + + '}\n'; + + // Create shader program and log it. + + DE_ASSERT(!this.m_program); + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSourceStr, fragShaderSource)); + + //tcu::TestLog& log = this.m_testCtx.getLog(); + //log << *m_program; + // TODO: bufferedLogToConsole? + //bufferedLogToConsole(this.m_program); + + assertMsgOptions(this.m_program.isOk(), 'Failed to compile shader', false, true); + + // Vertex shader attributes. + + if (this.m_function == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED) { + // Vertex positions. Positions form a vertical bar of width /. + + for (var y = 0; y < es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1; y++) + for (var x = 0; x < es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1; x++) { + /** @type {number} */ var fx = -1.0 + x / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0 / this.m_numInstances; + /** @type {number} */ var fy = -1.0 + y / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0; + + this.m_gridVertexPositions.push(fx); + this.m_gridVertexPositions.push(fy); + } + + // Indices. + + for (var y = 0; y < es3fInstancedRenderingTests.QUAD_GRID_SIZE; y++) + for (var x = 0; x < es3fInstancedRenderingTests.QUAD_GRID_SIZE; x++) { + /** @type {number} */ var ndx00 = y * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x; + /** @type {number} */ var ndx10 = y * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x + 1; + /** @type {number} */ var ndx01 = (y + 1) * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x; + /** @type {number} */ var ndx11 = (y + 1) * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x + 1; + + // Lower-left triangle of a quad. + this.m_gridIndices.push(ndx00); + this.m_gridIndices.push(ndx10); + this.m_gridIndices.push(ndx01); + + // Upper-right triangle of a quad. + this.m_gridIndices.push(ndx11); + this.m_gridIndices.push(ndx01); + this.m_gridIndices.push(ndx10); + } + } else { + DE_ASSERT(this.m_function == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED); + + // Vertex positions. Positions form a vertical bar of width /. + + for (var y = 0; y < es3fInstancedRenderingTests.QUAD_GRID_SIZE; y++) + for (var x = 0; x < es3fInstancedRenderingTests.QUAD_GRID_SIZE; x++) { + /** @type {number} */ var fx0 = -1.0 + (x + 0) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0 / this.m_numInstances; + /** @type {number} */ var fx1 = -1.0 + (x + 1) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0 / this.m_numInstances; + /** @type {number} */ var fy0 = -1.0 + (y + 0) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0; + /** @type {number} */ var fy1 = -1.0 + (y + 1) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0; + + // Vertices of a quad's lower-left triangle: (fx0, fy0), (fx1, fy0) and (fx0, fy1) + this.m_gridVertexPositions.push(fx0); + this.m_gridVertexPositions.push(fy0); + this.m_gridVertexPositions.push(fx1); + this.m_gridVertexPositions.push(fy0); + this.m_gridVertexPositions.push(fx0); + this.m_gridVertexPositions.push(fy1); + + // Vertices of a quad's upper-right triangle: (fx1, fy1), (fx0, fy1) and (fx1, fy0) + this.m_gridVertexPositions.push(fx1); + this.m_gridVertexPositions.push(fy1); + this.m_gridVertexPositions.push(fx0); + this.m_gridVertexPositions.push(fy1); + this.m_gridVertexPositions.push(fx1); + this.m_gridVertexPositions.push(fy0); + } + } + + // Instanced attributes: position offset and color RGB components. + + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) { + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR) { + // Offsets are such that the vertical bars are drawn next to each other. + for (var i = 0; i < this.m_numInstances; i++) { + this.m_instanceOffsets.push(i * 2.0 / this.m_numInstances); + + DE_ASSERT(es3fInstancedRenderingTests.OFFSET_COMPONENTS >= 1 && es3fInstancedRenderingTests.OFFSET_COMPONENTS <= 4); + + for (var j = 0; j < es3fInstancedRenderingTests.OFFSET_COMPONENTS - 1; j++) + this.m_instanceOffsets.push(0.0); + } + + /** @type {number} */ var rInstances = Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_R) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_R == 0 ? 0 : 1); + for (var i = 0; i < rInstances; i++) { + this.pushVarCompAttrib(this.m_instanceColorR, i / rInstances); + + for (var j = 0; j < typeSize - 1; j++) + this.pushVarCompAttrib(this.m_instanceColorR, 0.0); + } + } + + /** @type {number} */ var gInstances = Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_G) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_G == 0 ? 0 : 1); + for (var i = 0; i < gInstances; i++) { + this.pushVarCompAttrib(this.m_instanceColorG, i * 2.0 / gInstances); + + for (var j = 0; j < typeSize - 1; j++) + this.pushVarCompAttrib(this.m_instanceColorG, 0.0); + } + + /** @type {number} */ var bInstances = Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_B) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_B == 0 ? 0 : 1); + for (var i = 0; i < bInstances; i++) { + this.pushVarCompAttrib(this.m_instanceColorB, 1.0 - i / bInstances); + + for (var j = 0; j < typeSize - 1; j++) + this.pushVarCompAttrib(this.m_instanceColorB, 0.0); + } + } + }; + + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.deinit = function() { + var numVertexAttribArrays = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + for (var idx = 0; idx < numVertexAttribArrays; idx++) { + gl.disableVertexAttribArray(idx); + gl.vertexAttribDivisor(idx, 0); + } + }; + + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.iterate = function() { + /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, es3fInstancedRenderingTests.MAX_RENDER_WIDTH); + /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, es3fInstancedRenderingTests.MAX_RENDER_HEIGHT); + + /** @type {number} */ var xOffsetMax = gl.drawingBufferWidth - width; + /** @type {number} */ var yOffsetMax = gl.drawingBufferHeight - height; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name)); + + /** @type {number} */ var xOffset = rnd.getInt(0, xOffsetMax); + /** @type {number} */ var yOffset = rnd.getInt(0, yOffsetMax); + + /** @type {tcuSurface.Surface} */ var referenceImg = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ var resultImg = new tcuSurface.Surface(width, height); + + // Draw result. + + gl.viewport(xOffset, yOffset, width, height); + gl.clear(gl.COLOR_BUFFER_BIT); + + this.setupAndRender(); + + var resImg = resultImg.getAccess(); + var resImgTransferFormat = gluTextureUtil.getTransferFormat(resImg.getFormat()); + + gl.readPixels(xOffset, yOffset, resImg.m_width, resImg.m_height, resImgTransferFormat.format, resImgTransferFormat.dataType, resultImg.m_pixels); + + // Compute reference. + this.computeReference(referenceImg); + + // Compare. + + // Passing referenceImg.getAccess() and resultImg.getAccess() instead of referenceImg and resultImg + /** @type {boolean} */ var testOk = tcuImageCompare.fuzzyCompare('ComparisonResult', 'Image comparison result', referenceImg.getAccess(), resultImg.getAccess(), 0.05 /*, gluShaderUtil.COMPARE_LOG_RESULT*/); + + assertMsgOptions(testOk, '', true, false); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @param {Array} attrPtr + * @param {number} location + * @param {number} divisor + */ + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.setupVarAttribPointer = function(attrPtr, location, divisor) { + /** @type {boolean} */ var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(this.m_rgbAttrType); + /** @type {boolean} */ var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType); + /** @type {boolean} */ var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType); + /** @type {boolean} */ var isMatCase = gluShaderUtil.isDataTypeMatrix(this.m_rgbAttrType); + /** @type {number} */ var typeSize = gluShaderUtil.getDataTypeScalarSize(this.m_rgbAttrType); + /** @type {number} */ var numSlots = isMatCase ? gluShaderUtil.getDataTypeMatrixNumColumns(this.m_rgbAttrType) : 1; // Matrix uses as many attribute slots as it has columns. + + for (var slotNdx = 0; slotNdx < numSlots; slotNdx++) { + /** @type {number} */ var curLoc = location + slotNdx; + + gl.enableVertexAttribArray(curLoc); + gl.vertexAttribDivisor(curLoc, divisor); + var curLocGlBuffer = gl.createBuffer(); + if (isFloatCase) { + var bufferCurLoc = new Float32Array(attrPtr); + gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer); + gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW); + + gl.vertexAttribPointer(curLoc, typeSize, gl.FLOAT, false, 0, 0); + } else if (isIntCase) { + var bufferCurLoc = new Int32Array(attrPtr); + gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer); + gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW); + + gl.vertexAttribIPointer(curLoc, typeSize, gl.INT, 0, 0); + } else if (isUintCase) { + var bufferCurLoc = new Uint32Array(attrPtr); + gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer); + gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW); + + gl.vertexAttribIPointer(curLoc, typeSize, gl.UNSIGNED_INT, 0, 0); + } else if (isMatCase) { + /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(this.m_rgbAttrType); + /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(this.m_rgbAttrType); + + var bufferCurLoc = new Float32Array(attrPtr); + gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer); + gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW); + + gl.vertexAttribPointer(curLoc, numRows, gl.FLOAT, false, numCols * numRows * 4, 0); + } else + DE_ASSERT(false); + } + }; + + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.setupAndRender = function() { + /** @type {WebGLProgram} */ var program = this.m_program.getProgram(); + + gl.useProgram(program); + // Setup attributes. + + // Position attribute is non-instanced. + /** @type {number} */ var positionLoc = gl.getAttribLocation(program, 'a_position'); + gl.enableVertexAttribArray(positionLoc); + var positionBuffer = gl.createBuffer(); + var bufferGridVertexPosition = new Float32Array(this.m_gridVertexPositions); + gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer); + gl.bufferData(gl.ARRAY_BUFFER, bufferGridVertexPosition, gl.STATIC_DRAW); + gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0); + + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) { + if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR) { + // Position offset attribute is instanced with separate offset for every instance. + /** @type {number} */ var offsetLoc = gl.getAttribLocation(program, 'a_instanceOffset'); + gl.enableVertexAttribArray(offsetLoc); + gl.vertexAttribDivisor(offsetLoc, 1); + + var offsetLocGlBuffer = gl.createBuffer(); + var bufferOffsetLoc = new Float32Array(this.m_instanceOffsets); + gl.bindBuffer(gl.ARRAY_BUFFER, offsetLocGlBuffer); + gl.bufferData(gl.ARRAY_BUFFER, bufferOffsetLoc, gl.STATIC_DRAW); + + gl.vertexAttribPointer(offsetLoc, es3fInstancedRenderingTests.OFFSET_COMPONENTS, gl.FLOAT, false, 0, 0); + + /** @type {number} */ var rLoc = gl.getAttribLocation(program, 'a_instanceR'); + this.setupVarAttribPointer(this.m_instanceColorR, rLoc, es3fInstancedRenderingTests.ATTRIB_DIVISOR_R); + } + + /** @type {number} */ var gLoc = gl.getAttribLocation(program, 'a_instanceG'); + this.setupVarAttribPointer(this.m_instanceColorG, gLoc, es3fInstancedRenderingTests.ATTRIB_DIVISOR_G); + + /** @type {number} */ var bLoc = gl.getAttribLocation(program, 'a_instanceB'); + this.setupVarAttribPointer(this.m_instanceColorB, bLoc, es3fInstancedRenderingTests.ATTRIB_DIVISOR_B); + } + + // Draw using appropriate function. + + if (this.m_function == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED) { + /** @type {number} */ var numPositionComponents = 2; + gl.drawArraysInstanced(gl.TRIANGLES, 0, Math.floor(this.m_gridVertexPositions.length / numPositionComponents), this.m_numInstances); + } else { + var gridIndicesGLBuffer = gl.createBuffer(); + var bufferGridIndices = new Uint16Array(this.m_gridIndices); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gridIndicesGLBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, bufferGridIndices, gl.STATIC_DRAW); + + gl.drawElementsInstanced(gl.TRIANGLES, this.m_gridIndices.length, gl.UNSIGNED_SHORT, 0, this.m_numInstances); + } + gl.useProgram(null); + }; + + /** + * @param {tcuSurface.Surface} dst + */ + es3fInstancedRenderingTests.InstancedRenderingCase.prototype.computeReference = function(dst) { + /** @type {number} */ var wid = dst.getWidth(); + /** @type {number} */ var hei = dst.getHeight(); + + // Draw a rectangle (vertical bar) for each instance. + + for (var instanceNdx = 0; instanceNdx < this.m_numInstances; instanceNdx++) { + /** @type {number} */ var xStart = Math.floor(instanceNdx * wid / this.m_numInstances); + /** @type {number} */ var xEnd = Math.floor((instanceNdx + 1) * wid / this.m_numInstances); + + // Emulate attribute divisors if that is the case. + + /** @type {number} */ var clrNdxR = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? Math.floor(instanceNdx / es3fInstancedRenderingTests.ATTRIB_DIVISOR_R) : instanceNdx; + /** @type {number} */ var clrNdxG = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(instanceNdx / es3fInstancedRenderingTests.ATTRIB_DIVISOR_G) : instanceNdx; + /** @type {number} */ var clrNdxB = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(instanceNdx / es3fInstancedRenderingTests.ATTRIB_DIVISOR_B) : instanceNdx; + + /** @type {number} */ var rInstances = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_R) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_R == 0 ? 0 : 1) : this.m_numInstances; + /** @type {number} */ var gInstances = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_G) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_G == 0 ? 0 : 1) : this.m_numInstances; + /** @type {number} */ var bInstances = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_B) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_B == 0 ? 0 : 1) : this.m_numInstances; + + // Calculate colors. + + /** @type {number} */ var r = clrNdxR / rInstances; + /** @type {number} */ var g = clrNdxG * 2.0 / gInstances; + /** @type {number} */ var b = 1.0 - clrNdxB / bInstances; + + // Convert to integer and back if shader inputs are integers. + + if (gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType)) { + /** @type {number} */var intR = (r * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS); + /** @type {number} */var intG = (g * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS); + /** @type {number} */var intB = (b * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS); + r = (intR - es3fInstancedRenderingTests.FLOAT_INT_BIAS) / es3fInstancedRenderingTests.FLOAT_INT_SCALE; + g = (intG - es3fInstancedRenderingTests.FLOAT_INT_BIAS) / es3fInstancedRenderingTests.FLOAT_INT_SCALE; + b = (intB - es3fInstancedRenderingTests.FLOAT_INT_BIAS) / es3fInstancedRenderingTests.FLOAT_INT_SCALE; + } else if (gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType)) { + /** @type {number} */var uintR = (r * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS); + /** @type {number} */var uintG = (g * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS); + /** @type {number} */var uintB = (b * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS); + r = (uintR - es3fInstancedRenderingTests.FLOAT_UINT_BIAS) / es3fInstancedRenderingTests.FLOAT_UINT_SCALE; + g = (uintG - es3fInstancedRenderingTests.FLOAT_UINT_BIAS) / es3fInstancedRenderingTests.FLOAT_UINT_SCALE; + b = (uintB - es3fInstancedRenderingTests.FLOAT_UINT_BIAS) / es3fInstancedRenderingTests.FLOAT_UINT_SCALE; + } + + // Convert from float to unorm8. + var color = deMath.add(deMath.scale([r, g, b, 1.0], 255), [0.5, 0.5, 0.5, 0.5]); + color = deMath.clampVector(color, 0, 255); + + // Draw rectangle. + for (var y = 0; y < hei; y++) + for (var x = xStart; x < xEnd; x++) + dst.setPixel(x, y, color); + } + }; + + es3fInstancedRenderingTests.init = function() { + var testGroup = tcuTestCase.runner.testCases; + /** @type {Array} */ var instanceCounts = [1, 2, 4, 20]; + + for (var _function in es3fInstancedRenderingTests.DrawFunction) { + /** @type {?string} */ var functionName = + es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED ? 'draw_arrays_instanced' : + es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED ? 'draw_elements_instanced' : + null; + + /** @type {?string} */ var functionDesc = + es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED ? 'Use glDrawArraysInstanced()' : + es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED ? 'Use glDrawElementsInstanced()' : + null; + + DE_ASSERT(functionName != null); + DE_ASSERT(functionDesc != null); + + /** @type {tcuTestCase.DeqpTest} */ var functionGroup = tcuTestCase.newTest(functionName, functionDesc); + testGroup.addChild(functionGroup); + + for (var instancingType in es3fInstancedRenderingTests.InstancingType) { + /** @type {?string} */ var instancingTypeName = + es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID ? 'instance_id' : + es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? 'attribute_divisor' : + es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? 'mixed' : + null; + + /** @type {?string} */ var instancingTypeDesc = + es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID ? 'Use gl_InstanceID for instancing' : + es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? 'Use vertex attribute divisors for instancing' : + es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? 'Use both gl_InstanceID and vertex attribute divisors for instancing' : + null; + + DE_ASSERT(instancingTypeName != null); + DE_ASSERT(instancingTypeDesc != null); + + /** @type {tcuTestCase.DeqpTest} */ + var instancingTypeGroup = tcuTestCase.newTest(instancingTypeName, instancingTypeDesc); + + functionGroup.addChild(instancingTypeGroup); + + for (var countNdx in instanceCounts) { + /** @type {string} */ var countName = instanceCounts[countNdx].toString() + '_instances'; + instancingTypeGroup.addChild(new es3fInstancedRenderingTests.InstancedRenderingCase(countName, + '', + es3fInstancedRenderingTests.DrawFunction[_function], + es3fInstancedRenderingTests.InstancingType[instancingType], + gluShaderUtil.DataType.FLOAT, + instanceCounts[countNdx])); + } + } + } + + /** @type {Array} */ var s_testTypes = + [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4, + gluShaderUtil.DataType.FLOAT_MAT2, + gluShaderUtil.DataType.FLOAT_MAT2X3, + gluShaderUtil.DataType.FLOAT_MAT2X4, + gluShaderUtil.DataType.FLOAT_MAT3X2, + gluShaderUtil.DataType.FLOAT_MAT3, + gluShaderUtil.DataType.FLOAT_MAT3X4, + gluShaderUtil.DataType.FLOAT_MAT4X2, + gluShaderUtil.DataType.FLOAT_MAT4X3, + gluShaderUtil.DataType.FLOAT_MAT4, + + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4, + + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4 + ]; + + /** @type {number} */ var typeTestNumInstances = 4; + + /** @type {tcuTestCase.DeqpTest} */ var typesGroup = tcuTestCase.newTest('types', 'Tests for instanced attributes of particular data types'); + + testGroup.addChild(typesGroup); + + for (var typeNdx in s_testTypes) { + /** @type {gluShaderUtil.DataType} */ var type = s_testTypes[typeNdx]; + typesGroup.addChild(new es3fInstancedRenderingTests.InstancedRenderingCase(gluShaderUtil.getDataTypeName(type), '', + es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED, + es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR, + type, + typeTestNumInstances)); + } + }; + + es3fInstancedRenderingTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var testName = 'instanced_rendering'; + var testDescription = 'Instanced Rendering Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.setRoot(tcuTestCase.newTest(testName, testDescription, null)); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fInstancedRenderingTests.init(); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fInstancedRenderingTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js new file mode 100644 index 000000000..ec5048e4f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js @@ -0,0 +1,2049 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fIntegerStateQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { + var es3fIntegerStateQueryTests = functional.gles3.es3fIntegerStateQueryTests; + var tcuTestCase = framework.common.tcuTestCase; + var deRandom = framework.delibs.debase.deRandom; + var es3fApiCase = functional.gles3.es3fApiCase; + var glsStateQuery = modules.shared.glsStateQuery; + + /** @type {string} */ var transformFeedbackTestVertSource = '' + + '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + + /** @type {string} */ var transformFeedbackTestFragSource = '' + + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + /** @type {string} */ var testVertSource = '' + + '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + + /** @type {string} */ var testFragSource = '' + + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.TransformFeedbackTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {WebGLTransformFeedback} */ this.m_transformfeedback; + }; + + es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype.constructor = es3fIntegerStateQueryTests.TransformFeedbackTestCase; + + es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype.testTransformFeedback = function() { + throw new Error('This method should be implemented by child classes.'); + }; + + es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype.test = function() { + this.beforeTransformFeedbackTest(); // [dag] added this as there is no other way this method would be called. + + this.m_transformfeedback = gl.createTransformFeedback(); + + /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(shaderVert, transformFeedbackTestVertSource); + gl.compileShader(shaderVert); + + var compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderVert, gl.COMPILE_STATUS)); + glsStateQuery.compare(compileStatus, true); + + /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(shaderFrag, transformFeedbackTestFragSource); + gl.compileShader(shaderFrag); + + compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderFrag, gl.COMPILE_STATUS)); + glsStateQuery.compare(compileStatus, true); + + /** @type {WebGLProgram} */ var shaderProg = gl.createProgram(); + gl.attachShader(shaderProg, shaderVert); + gl.attachShader(shaderProg, shaderFrag); + /** @type {Array} */ var transform_feedback_outputs = ['gl_Position']; + gl.transformFeedbackVaryings(shaderProg, transform_feedback_outputs, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(shaderProg); + + var linkStatus = /** @type {boolean} */ (gl.getProgramParameter(shaderProg, gl.LINK_STATUS)); + glsStateQuery.compare(linkStatus, true); + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, this.m_transformfeedback); + + + /** @type {WebGLBuffer} */ var feedbackBufferId = gl.createBuffer(); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBufferId); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, feedbackBufferId); + + gl.useProgram(shaderProg); + + this.testTransformFeedback(); + + gl.useProgram(null); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + gl.deleteTransformFeedback(this.m_transformfeedback); + gl.deleteBuffer(feedbackBufferId); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(shaderProg); + + this.afterTransformFeedbackTest(); // [dag] added this as there is no other way this method would be called. + }; + + /** + * @constructor + * @extends {es3fIntegerStateQueryTests.TransformFeedbackTestCase} + * @param {string} name + */ + es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase = function(name) { + es3fIntegerStateQueryTests.TransformFeedbackTestCase.call(this, name, 'GL_TRANSFORM_FEEDBACK_BINDING'); + }; + + es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype = Object.create(es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype); + es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase; + + + es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.beforeTransformFeedbackTest = function() { + this.check(glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_BINDING, null), 'beforeTransformFeedbackTest'); + }; + + es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.testTransformFeedback = function() { + this.check(glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_BINDING, this.m_transformfeedback), 'testTransformFeedback'); + }; + + es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.afterTransformFeedbackTest = function() { + this.check(glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_BINDING, null), 'afterTransformFeedbackTest'); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {number} minValue + */ + es3fIntegerStateQueryTests.ConstantMinimumValueTestCase = function(name, description, targetName, minValue) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_targetName = targetName; + /** @type {number} */ this.m_minValue = minValue; + }; + + es3fIntegerStateQueryTests.ConstantMinimumValueTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ConstantMinimumValueTestCase.prototype.constructor = es3fIntegerStateQueryTests.ConstantMinimumValueTestCase; + + es3fIntegerStateQueryTests.ConstantMinimumValueTestCase.prototype.test = function() { + this.check(glsStateQuery.verifyGreaterOrEqual(this.m_targetName, this.m_minValue), 'Fail'); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {number} minValue + */ + es3fIntegerStateQueryTests.ConstantMaximumValueTestCase = function(name, description, targetName, minValue) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_targetName = targetName; + /** @type {number} */ this.m_minValue = minValue; + }; + + es3fIntegerStateQueryTests.ConstantMaximumValueTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ConstantMaximumValueTestCase.prototype.constructor = es3fIntegerStateQueryTests.ConstantMaximumValueTestCase; + + es3fIntegerStateQueryTests.ConstantMaximumValueTestCase.prototype.test = function() { + this.check(glsStateQuery.verifyLessOrEqual(this.m_targetName, this.m_minValue), 'Fail'); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.SampleBuffersTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.SampleBuffersTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.SampleBuffersTestCase.prototype.constructor = es3fIntegerStateQueryTests.SampleBuffersTestCase; + + es3fIntegerStateQueryTests.SampleBuffersTestCase.prototype.test = function() { + /** @type {number} */ var expectedSampleBuffers = (/** @type {number} */ (gl.getParameter(gl.SAMPLES)) > 1) ? 1 : 0; + + bufferedLogToConsole('Sample count is ' + expectedSampleBuffers + ', expecting GL_SAMPLE_BUFFERS to be ' + expectedSampleBuffers); + + this.check(glsStateQuery.verify(gl.SAMPLE_BUFFERS, expectedSampleBuffers)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.SamplesTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.SamplesTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.SamplesTestCase.prototype.constructor = es3fIntegerStateQueryTests.SamplesTestCase; + + es3fIntegerStateQueryTests.SamplesTestCase.prototype.test = function() { + var numSamples = /** @type {number} */ (gl.getParameter(gl.SAMPLES)); + // MSAA? + if (numSamples > 1) { + bufferedLogToConsole('Sample count is ' + numSamples); + + this.check(glsStateQuery.verify(gl.SAMPLES, numSamples)); + } else { + /** @type {Array} */ var validSamples = [0, 1]; + + bufferedLogToConsole('Expecting GL_SAMPLES to be 0 or 1'); + + this.check(glsStateQuery.verifyAnyOf(gl.SAMPLES, validSamples)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} targetName + */ + es3fIntegerStateQueryTests.HintTestCase = function(name, description, targetName) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_targetName = targetName; + }; + + es3fIntegerStateQueryTests.HintTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.HintTestCase.prototype.constructor = es3fIntegerStateQueryTests.HintTestCase; + + es3fIntegerStateQueryTests.HintTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_targetName, gl.DONT_CARE)); + + gl.hint(this.m_targetName, gl.NICEST); + this.check(glsStateQuery.verify(this.m_targetName, gl.NICEST)); + + gl.hint(this.m_targetName, gl.FASTEST); + this.check(glsStateQuery.verify(this.m_targetName, gl.FASTEST)); + + gl.hint(this.m_targetName, gl.DONT_CARE); + this.check(glsStateQuery.verify(this.m_targetName, gl.DONT_CARE)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.DepthFuncTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.DepthFuncTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.DepthFuncTestCase.prototype.constructor = es3fIntegerStateQueryTests.DepthFuncTestCase; + + es3fIntegerStateQueryTests.DepthFuncTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.DEPTH_FUNC, gl.LESS)); + + /** @type {Array} */ var depthFunctions = [gl.NEVER, gl.ALWAYS, gl.LESS, gl.LEQUAL, gl.EQUAL, gl.GREATER, gl.GEQUAL, gl.NOTEQUAL]; + for (var ndx = 0; ndx < depthFunctions.length; ndx++) { + gl.depthFunc(depthFunctions[ndx]); + + this.check(glsStateQuery.verify(gl.DEPTH_FUNC, depthFunctions[ndx])); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.CullFaceTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.CullFaceTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.CullFaceTestCase.prototype.constructor = es3fIntegerStateQueryTests.CullFaceTestCase; + + es3fIntegerStateQueryTests.CullFaceTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.CULL_FACE_MODE, gl.BACK)); + + /** @type {Array} */ var cullFaces = [gl.FRONT, gl.BACK, gl.FRONT_AND_BACK]; + for (var ndx = 0; ndx < cullFaces.length; ndx++) { + gl.cullFace(cullFaces[ndx]); + + this.check(glsStateQuery.verify(gl.CULL_FACE_MODE, cullFaces[ndx])); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.FrontFaceTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.FrontFaceTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.FrontFaceTestCase.prototype.constructor = es3fIntegerStateQueryTests.FrontFaceTestCase; + + es3fIntegerStateQueryTests.FrontFaceTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.FRONT_FACE, gl.CCW)); + + /** @type {Array} */ var frontFaces = [gl.CW, gl.CCW]; + for (var ndx = 0; ndx < frontFaces.length; ndx++) { + gl.frontFace(frontFaces[ndx]); + + this.check(glsStateQuery.verify(gl.FRONT_FACE, frontFaces[ndx])); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.ViewPortTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.ViewPortTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ViewPortTestCase.prototype.constructor = es3fIntegerStateQueryTests.ViewPortTestCase; + + es3fIntegerStateQueryTests.ViewPortTestCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + var maxViewportDimensions = /** @type {Array} */ (gl.getParameter(gl.MAX_VIEWPORT_DIMS)); + + // verify initial value of first two values + this.check(glsStateQuery.verify(gl.VIEWPORT, new Int32Array([0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight]))); + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var x = rnd.getInt(-64000, 64000); + /** @type {number} */ var y = rnd.getInt(-64000, 64000); + /** @type {number} */ var width = rnd.getInt(0, maxViewportDimensions[0]); + /** @type {number} */ var height = rnd.getInt(0, maxViewportDimensions[1]); + + gl.viewport(x, y, width, height); + this.check(glsStateQuery.verify(gl.VIEWPORT, new Int32Array([x, y, width, height]))); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.ScissorBoxTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.ScissorBoxTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ScissorBoxTestCase.prototype.constructor = es3fIntegerStateQueryTests.ScissorBoxTestCase; + + es3fIntegerStateQueryTests.ScissorBoxTestCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + // verify initial value of first two values + this.check(glsStateQuery.verifyMask(gl.SCISSOR_BOX, [0, 0, 0, 0], [true, true, false, false])); + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var left = rnd.getInt(-64000, 64000); + /** @type {number} */ var bottom = rnd.getInt(-64000, 64000); + /** @type {number} */ var width = rnd.getInt(0, 64000); + /** @type {number} */ var height = rnd.getInt(0, 64000); + + gl.scissor(left, bottom, width, height); + this.check(glsStateQuery.verify(gl.SCISSOR_BOX, new Int32Array([left, bottom, width, height]))); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.MaxViewportDimsTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.MaxViewportDimsTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.MaxViewportDimsTestCase.prototype.constructor = es3fIntegerStateQueryTests.MaxViewportDimsTestCase; + + es3fIntegerStateQueryTests.MaxViewportDimsTestCase.prototype.test = function() { + this.check(glsStateQuery.verifyGreaterOrEqual(gl.MAX_VIEWPORT_DIMS, [gl.drawingBufferWidth, gl.drawingBufferHeight])); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + */ + es3fIntegerStateQueryTests.StencilRefTestCase = function(name, description, testTargetName) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + }; + + es3fIntegerStateQueryTests.StencilRefTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilRefTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilRefTestCase; + + es3fIntegerStateQueryTests.StencilRefTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_testTargetName, 0)); + + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) { + /** @type {number} */ var ref = 1 << stencilBit; + + gl.stencilFunc(gl.ALWAYS, ref, 0); // mask should not affect the REF + + this.check(glsStateQuery.verify(this.m_testTargetName, ref)); + + gl.stencilFunc(gl.ALWAYS, ref, ref); + + this.check(glsStateQuery.verify(this.m_testTargetName, ref)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} stencilFuncTargetFace + */ + es3fIntegerStateQueryTests.StencilRefSeparateTestCase = function(name, description, testTargetName, stencilFuncTargetFace) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + /** @type {number} */ this.m_stencilFuncTargetFace = stencilFuncTargetFace; + }; + + es3fIntegerStateQueryTests.StencilRefSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilRefSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilRefSeparateTestCase; + + es3fIntegerStateQueryTests.StencilRefSeparateTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_testTargetName, 0)); + + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) { + /** @type {number} */ var ref = 1 << stencilBit; + + gl.stencilFuncSeparate(this.m_stencilFuncTargetFace, gl.ALWAYS, ref, 0); + + this.check(glsStateQuery.verify(this.m_testTargetName, ref)); + + gl.stencilFuncSeparate(this.m_stencilFuncTargetFace, gl.ALWAYS, ref, ref); + + this.check(glsStateQuery.verify(this.m_testTargetName, ref)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} stencilOpName + */ + es3fIntegerStateQueryTests.StencilOpTestCase = function(name, description, stencilOpName) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_stencilOpName = stencilOpName; + }; + + es3fIntegerStateQueryTests.StencilOpTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilOpTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilOpTestCase; + + es3fIntegerStateQueryTests.StencilOpTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_stencilOpName, gl.KEEP)); + + /** @type {Array} */ var stencilOpValues = [gl.KEEP, gl.ZERO, gl.REPLACE, gl.INCR, gl.DECR, gl.INVERT, gl.INCR_WRAP, gl.DECR_WRAP]; + for (var ndx = 0; ndx < stencilOpValues.length; ++ndx) { + this.setStencilOp(stencilOpValues[ndx]); + + this.check(glsStateQuery.verify(this.m_stencilOpName, stencilOpValues[ndx])); + } + }; + + es3fIntegerStateQueryTests.StencilOpTestCase.prototype.deinit = function() { + // [dag] need to reset everything once the test is done, otherwise related tests fail + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + }; + + /** + * @param {number} stencilOpValue + */ + es3fIntegerStateQueryTests.StencilOpTestCase.prototype.setStencilOp = function(stencilOpValue) { + switch (this.m_stencilOpName) { + case gl.STENCIL_FAIL: + case gl.STENCIL_BACK_FAIL: + gl.stencilOp(stencilOpValue, gl.KEEP, gl.KEEP); + break; + + case gl.STENCIL_PASS_DEPTH_FAIL: + case gl.STENCIL_BACK_PASS_DEPTH_FAIL: + gl.stencilOp(gl.KEEP, stencilOpValue, gl.KEEP); + break; + + case gl.STENCIL_PASS_DEPTH_PASS: + case gl.STENCIL_BACK_PASS_DEPTH_PASS: + gl.stencilOp(gl.KEEP, gl.KEEP, stencilOpValue); + break; + + default: + throw new Error('should not happen'); + } + }; + + /** + * @constructor + * @extends {es3fIntegerStateQueryTests.StencilOpTestCase} + * @param {string} name + * @param {string} description + * @param {number} stencilOpName + * @param {number} stencilOpFace + */ + es3fIntegerStateQueryTests.StencilOpSeparateTestCase = function(name, description, stencilOpName, stencilOpFace) { + es3fIntegerStateQueryTests.StencilOpTestCase.call(this, name, description, stencilOpName); + /** @type {number} */ this.m_stencilOpName = stencilOpName; + /** @type {number} */ this.m_stencilOpFace = stencilOpFace; + }; + + es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype = Object.create(es3fIntegerStateQueryTests.StencilOpTestCase.prototype); + es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilOpSeparateTestCase; + + es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype.test = function() {}; + + /** + * @param {number} stencilOpValue + */ + es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype.setStencilOp = function(stencilOpValue) { + switch (this.m_stencilOpName) { + case gl.STENCIL_FAIL: + case gl.STENCIL_BACK_FAIL: + gl.stencilOpSeparate(this.m_stencilOpFace, stencilOpValue, gl.KEEP, gl.KEEP); + break; + + case gl.STENCIL_PASS_DEPTH_FAIL: + case gl.STENCIL_BACK_PASS_DEPTH_FAIL: + gl.stencilOpSeparate(this.m_stencilOpFace, gl.KEEP, stencilOpValue, gl.KEEP); + break; + + case gl.STENCIL_PASS_DEPTH_PASS: + case gl.STENCIL_BACK_PASS_DEPTH_PASS: + gl.stencilOpSeparate(this.m_stencilOpFace, gl.KEEP, gl.KEEP, stencilOpValue); + break; + + default: + throw new Error('should not happen'); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.StencilFuncTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.StencilFuncTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilFuncTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilFuncTestCase; + + es3fIntegerStateQueryTests.StencilFuncTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.STENCIL_FUNC, gl.ALWAYS)); + + /** @type {Array} */ var stencilfuncValues = [gl.NEVER, gl.ALWAYS, gl.LESS, gl.LEQUAL, gl.EQUAL, gl.GEQUAL, gl.GREATER, gl.NOTEQUAL]; + + for (var ndx = 0; ndx < stencilfuncValues.length; ++ndx) { + gl.stencilFunc(stencilfuncValues[ndx], 0, 0); + + this.check(glsStateQuery.verify(gl.STENCIL_FUNC, stencilfuncValues[ndx])); + + this.check(glsStateQuery.verify(gl.STENCIL_BACK_FUNC, stencilfuncValues[ndx])); + } + }; + + es3fIntegerStateQueryTests.StencilFuncTestCase.prototype.deinit = function() { + // [dag] reset stencilFunc to ALWAYS + gl.stencilFunc(gl.ALWAYS, 0, 0); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} stencilFuncName + * @param {number} stencilFuncFace + */ + es3fIntegerStateQueryTests.StencilFuncSeparateTestCase = function(name, description, stencilFuncName, stencilFuncFace) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_stencilFuncName = stencilFuncName; + /** @type {number} */ this.m_stencilFuncFace = stencilFuncFace; + }; + + es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilFuncSeparateTestCase; + + es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_stencilFuncName, gl.ALWAYS)); + + /** @type {Array} */ var stencilfuncValues = [gl.NEVER, gl.ALWAYS, gl.LESS, gl.LEQUAL, gl.EQUAL, gl.GEQUAL, gl.GREATER, gl.NOTEQUAL]; + + for (var ndx = 0; ndx < stencilfuncValues.length; ++ndx) { + gl.stencilFuncSeparate(this.m_stencilFuncFace, stencilfuncValues[ndx], 0, 0); + + this.check(glsStateQuery.verify(this.m_stencilFuncName, stencilfuncValues[ndx])); + } + }; + + es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype.deinit = function() { + // [dag] reset the stencil func + gl.stencilFuncSeparate(this.m_stencilFuncFace, gl.ALWAYS, 0, 0); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + */ + es3fIntegerStateQueryTests.StencilMaskTestCase = function(name, description, testTargetName) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + }; + + es3fIntegerStateQueryTests.StencilMaskTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilMaskTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilMaskTestCase; + + es3fIntegerStateQueryTests.StencilMaskTestCase.prototype.test = function() { + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + this.check(glsStateQuery.verify(this.m_testTargetName, stencilBits)); + + for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) { + /** @type {number} */ var mask = 1 << stencilBit; + + gl.stencilFunc(gl.ALWAYS, 0, mask); + + this.check(glsStateQuery.verify(this.m_testTargetName, mask)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} stencilFuncTargetFace + */ + es3fIntegerStateQueryTests.StencilMaskSeparateTestCase = function(name, description, testTargetName, stencilFuncTargetFace) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + /** @type {number} */ this.m_stencilFuncTargetFace = stencilFuncTargetFace; + }; + + es3fIntegerStateQueryTests.StencilMaskSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilMaskSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilMaskSeparateTestCase; + + es3fIntegerStateQueryTests.StencilMaskSeparateTestCase.prototype.test = function() { + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + this.check(glsStateQuery.verify(this.m_testTargetName, stencilBits)); + + for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) { + /** @type {number} */ var mask = 1 << stencilBit; + + gl.stencilFuncSeparate(this.m_stencilFuncTargetFace, gl.ALWAYS, 0, mask); + + this.check(glsStateQuery.verify(this.m_testTargetName, mask)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + */ + es3fIntegerStateQueryTests.StencilWriteMaskTestCase = function(name, description, testTargetName) { + /** @type {number} */ this.m_testTargetName = testTargetName; + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.StencilWriteMaskTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilWriteMaskTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilWriteMaskTestCase; + + es3fIntegerStateQueryTests.StencilWriteMaskTestCase.prototype.test = function() { + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) { + /** @type {number} */ var mask = 1 << stencilBit; + + gl.stencilMask(mask); + + this.check(glsStateQuery.verify(this.m_testTargetName, mask)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} stencilTargetFace + */ + es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase = function(name, description, testTargetName, stencilTargetFace) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + /** @type {number} */ this.m_stencilTargetFace = stencilTargetFace; + }; + + es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase; + + es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase.prototype.test = function() { + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) { + /** @type {number} */ var mask = 1 << stencilBit; + + gl.stencilMaskSeparate(this.m_stencilTargetFace, mask); + + this.check(glsStateQuery.verify(this.m_testTargetName, mask)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} initialValue + */ + es3fIntegerStateQueryTests.PixelStoreTestCase = function(name, description, testTargetName, initialValue) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + /** @type {number} */ this.m_initialValue = initialValue; + }; + + es3fIntegerStateQueryTests.PixelStoreTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.PixelStoreTestCase.prototype.constructor = es3fIntegerStateQueryTests.PixelStoreTestCase; + + es3fIntegerStateQueryTests.PixelStoreTestCase.prototype.test = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verify(this.m_testTargetName, this.m_initialValue)); + + /** @type {number} */ var numIterations = 120; + for (var i = 0; i < numIterations; ++i) { + /** @type {number} */ var referenceValue = rnd.getInt(0, 64000); + + gl.pixelStorei(this.m_testTargetName, referenceValue); + + this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + */ + es3fIntegerStateQueryTests.PixelStoreAlignTestCase = function(name, description, testTargetName) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + }; + + es3fIntegerStateQueryTests.PixelStoreAlignTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.PixelStoreAlignTestCase.prototype.constructor = es3fIntegerStateQueryTests.PixelStoreAlignTestCase; + + es3fIntegerStateQueryTests.PixelStoreAlignTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_testTargetName, 4)); + + /** @type {Array} */ var alignments = [1, 2, 4, 8]; + + for (var ndx = 0; ndx < alignments.length; ++ndx) { + /** @type {number} */ var referenceValue = alignments[ndx]; + + gl.pixelStorei(this.m_testTargetName, referenceValue); + + this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} initialValue + */ + es3fIntegerStateQueryTests.BlendFuncTestCase = function(name, description, testTargetName) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + }; + + es3fIntegerStateQueryTests.BlendFuncTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendFuncTestCase; + + es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.test = function() { + /** @type {Array} */ var blendFuncValues = [ + gl.ZERO, gl.ONE, gl.SRC_COLOR, gl.ONE_MINUS_SRC_COLOR, gl.DST_COLOR, gl.ONE_MINUS_DST_COLOR, + gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.DST_ALPHA, gl.ONE_MINUS_DST_ALPHA, gl.CONSTANT_COLOR, + gl.ONE_MINUS_CONSTANT_COLOR, gl.CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_ALPHA, + gl.SRC_ALPHA_SATURATE + ]; + + for (var ndx = 0; ndx < blendFuncValues.length; ++ndx) { + /** @type {number} */ var referenceValue = blendFuncValues[ndx]; + + this.setBlendFunc(referenceValue); + + this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue)); + }}; + + /** + * @param {number} func + */ + es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.setBlendFunc = function(func) { + switch (this.m_testTargetName) { + case gl.BLEND_SRC_RGB: + case gl.BLEND_SRC_ALPHA: + gl.blendFunc(func, gl.ZERO); + break; + + case gl.BLEND_DST_RGB: + case gl.BLEND_DST_ALPHA: + gl.blendFunc(gl.ZERO, func); + break; + + default: + throw new Error('should not happen'); + } + }; + + es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.deinit = function() { + gl.blendFunc(gl.ONE, gl.ZERO); + }; + + /** + * @constructor + * @extends {es3fIntegerStateQueryTests.BlendFuncTestCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} initialValue + */ + es3fIntegerStateQueryTests.BlendFuncSeparateTestCase = function(name, description, testTargetName) { + es3fIntegerStateQueryTests.BlendFuncTestCase.call(this, name, description, testTargetName); + /** @type {number} */ this.m_testTargetName = testTargetName; + }; + + es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype = Object.create(es3fIntegerStateQueryTests.BlendFuncTestCase.prototype); + es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendFuncSeparateTestCase; + + /** + * @param {number} func + */ + es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype.setBlendFunc = function(func) { + switch (this.m_testTargetName) { + case gl.BLEND_SRC_RGB: + gl.blendFuncSeparate(func, gl.ZERO, gl.ZERO, gl.ZERO); + break; + + case gl.BLEND_DST_RGB: + gl.blendFuncSeparate(gl.ZERO, func, gl.ZERO, gl.ZERO); + break; + + case gl.BLEND_SRC_ALPHA: + gl.blendFuncSeparate(gl.ZERO, gl.ZERO, func, gl.ZERO); + break; + + case gl.BLEND_DST_ALPHA: + gl.blendFuncSeparate(gl.ZERO, gl.ZERO, gl.ZERO, func); + break; + + default: + throw new Error('should not happen'); + } + }; + + es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype.deinit = function() { + gl.blendFuncSeparate(gl.ONE, gl.ZERO, gl.ONE, gl.ZERO); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} initialValue + */ + es3fIntegerStateQueryTests.BlendEquationTestCase = function(name, description, testTargetName, initialValue) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + /** @type {number} */ this.m_initialValue = initialValue; + }; + + es3fIntegerStateQueryTests.BlendEquationTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendEquationTestCase; + + es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_testTargetName, this.m_initialValue)); + + /** @type {Array} */ var blendFuncValues = [gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MIN, gl.MAX]; + + for (var ndx = 0; ndx < blendFuncValues.length; ++ndx) { + /** @type {number} */ var referenceValue = blendFuncValues[ndx]; + + this.setBlendEquation(referenceValue); + + this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue)); + } + }; + + /** + * @param {number} equation + */ + es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.setBlendEquation = function(equation) { + gl.blendEquation(equation); + }; + + es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.deinit = function() { + gl.blendEquation(this.m_initialValue); + }; + + /** + * @constructor + * @extends {es3fIntegerStateQueryTests.BlendEquationTestCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} initialValue + */ + es3fIntegerStateQueryTests.BlendEquationSeparateTestCase = function(name, description, testTargetName, initialValue) { + es3fIntegerStateQueryTests.BlendEquationTestCase.call(this, name, description, testTargetName, initialValue); + /** @type {number} */ this.m_testTargetName = testTargetName; + /** @type {number} */ this.m_initialValue = initialValue; + }; + + es3fIntegerStateQueryTests.BlendEquationSeparateTestCase.prototype = Object.create(es3fIntegerStateQueryTests.BlendEquationTestCase.prototype); + es3fIntegerStateQueryTests.BlendEquationSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendEquationSeparateTestCase; + + /** + * @param {number} equation + */ + es3fIntegerStateQueryTests.BlendEquationSeparateTestCase.prototype.setBlendEquation = function(equation) { + switch (this.m_testTargetName) { + case gl.BLEND_EQUATION_RGB: + gl.blendEquationSeparate(equation, gl.FUNC_ADD); + break; + + case gl.BLEND_EQUATION_ALPHA: + gl.blendEquationSeparate(gl.FUNC_ADD, equation); + break; + + default: + throw new Error('should not happen'); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testTargetName + * @param {number} minValue + */ + es3fIntegerStateQueryTests.ImplementationArrayTestCase = function(name, description, testTargetName, minValue) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testTargetName = testTargetName; + /** @type {number} */ this.m_minValue = minValue; + }; + + es3fIntegerStateQueryTests.ImplementationArrayTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ImplementationArrayTestCase.prototype.constructor = es3fIntegerStateQueryTests.ImplementationArrayTestCase; + + es3fIntegerStateQueryTests.ImplementationArrayTestCase.prototype.test = function() { + if (!framework.opengl.gluTextureUtil.enableCompressedTextureETC()) { + debug('Skipping ETC2 texture format tests: no support for WEBGL_compressed_texture_etc'); + return; + } + + var queryResult = /** @type {Array} */ (gl.getParameter(this.m_testTargetName)); + this.check(glsStateQuery.compare(queryResult.length, this.m_minValue)); + + /** @type {Array} */ var textureFormats = [ + gl.COMPRESSED_R11_EAC, gl.COMPRESSED_SIGNED_R11_EAC, gl.COMPRESSED_RG11_EAC, gl.COMPRESSED_SIGNED_RG11_EAC, gl.COMPRESSED_RGB8_ETC2, gl.COMPRESSED_SRGB8_ETC2, + gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, gl.COMPRESSED_RGBA8_ETC2_EAC, gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC + ]; + + for (var ndx = 0; ndx < textureFormats.length; ndx++) { + /** @type {number} */ var format = textureFormats[ndx]; + /** @type {boolean} */ var isInArray = queryResult.indexOf(format) !== -1; + this.check(glsStateQuery.compare(isInArray, true)); + } + + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.CurrentProgramBindingTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.CurrentProgramBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.CurrentProgramBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.CurrentProgramBindingTestCase; + + es3fIntegerStateQueryTests.CurrentProgramBindingTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, null)); + + /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(shaderVert, testVertSource); + gl.compileShader(shaderVert); + var compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderVert, gl.COMPILE_STATUS)); + this.check(glsStateQuery.compare(compileStatus, true)); + + /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(shaderFrag, testFragSource); + gl.compileShader(shaderFrag); + compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderFrag, gl.COMPILE_STATUS)); + this.check(glsStateQuery.compare(compileStatus, true)); + + /** @type {WebGLProgram} */ var shaderProg = gl.createProgram(); + gl.attachShader(shaderProg, shaderVert); + gl.attachShader(shaderProg, shaderFrag); + gl.linkProgram(shaderProg); + var linkStatus = /** @type {boolean} */ (gl.getProgramParameter(shaderProg, gl.LINK_STATUS)); + this.check(glsStateQuery.compare(linkStatus, true)); + + gl.useProgram(shaderProg); + + this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, shaderProg)); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(shaderProg); + + this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, shaderProg)); + + gl.useProgram(null); + this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, null)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.VertexArrayBindingTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.VertexArrayBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.VertexArrayBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.VertexArrayBindingTestCase; + + es3fIntegerStateQueryTests.VertexArrayBindingTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.VERTEX_ARRAY_BINDING, null)); + + /** @type {WebGLVertexArrayObject} */ var vertexArrayObject = gl.createVertexArray(); + + gl.bindVertexArray(vertexArrayObject); + this.check(glsStateQuery.verify(gl.VERTEX_ARRAY_BINDING, vertexArrayObject)); + + gl.deleteVertexArray(vertexArrayObject); + this.check(glsStateQuery.verify(gl.VERTEX_ARRAY_BINDING, null)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} bufferBindingName + * @param {number} bufferType + */ + es3fIntegerStateQueryTests.BufferBindingTestCase = function(name, description, bufferBindingName, bufferType) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_bufferBindingName = bufferBindingName; + /** @type {number} */ this.m_bufferType = bufferType; + }; + + es3fIntegerStateQueryTests.BufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.BufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.BufferBindingTestCase; + + es3fIntegerStateQueryTests.BufferBindingTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_bufferBindingName, null)); + + /** @type {WebGLBuffer} */ var bufferObject = gl.createBuffer(); + + gl.bindBuffer(this.m_bufferType, bufferObject); + this.check(glsStateQuery.verify(this.m_bufferBindingName, bufferObject)); + + gl.deleteBuffer(bufferObject); + this.check(glsStateQuery.verify(this.m_bufferBindingName, null)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + */ + es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase = function(name) { + es3fApiCase.ApiCase.call(this, name, 'GL_ELEMENT_ARRAY_BUFFER_BINDING', gl); + }; + + es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase; + + es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase.prototype.test = function() { + // Test with default VAO + bufferedLogToConsole('DefaultVAO: Test with default VAO'); + + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null)); + + /** @type {WebGLBuffer} */ var bufferObject = gl.createBuffer(); + + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferObject); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, bufferObject)); + + gl.deleteBuffer(bufferObject); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null)); + + // Test with multiple VAOs + bufferedLogToConsole('WithVAO: Test with VAO'); + + /** @type {Array} */ var vaos = []; + /** @type {Array} */ var buffers = []; + + for (var ndx = 0; ndx < 2; ndx++) { + vaos[ndx] = gl.createVertexArray(); + buffers[ndx] = gl.createBuffer(); + } + + // initial + gl.bindVertexArray(vaos[0]); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null)); + + // after setting + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers[0]); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[0])); + + // initial of vao 2 + gl.bindVertexArray(vaos[1]); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null)); + + // after setting to 2 + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers[1]); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[1])); + + // vao 1 still has buffer 1 bound? + gl.bindVertexArray(vaos[0]); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[0])); + + // deleting clears from bound vaos ... + for (var ndx = 0; ndx < 2; ndx++) + gl.deleteBuffer(buffers[ndx]); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null)); + + // ... but does not from non-bound vaos? + gl.bindVertexArray(vaos[1]); + this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[1])); + + for (var ndx = 0; ndx < 2; ndx++) + gl.deleteVertexArray(vaos[ndx]); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.StencilClearValueTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.StencilClearValueTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.StencilClearValueTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilClearValueTestCase; + + es3fIntegerStateQueryTests.StencilClearValueTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.STENCIL_CLEAR_VALUE, 0)); + + var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)); + + for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) { + /** @type {number} */ var ref = 1 << stencilBit; + + gl.clearStencil(ref); // mask should not affect the REF + + this.check(glsStateQuery.verify(gl.STENCIL_CLEAR_VALUE, ref)); + } + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.ActiveTextureTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype.constructor = es3fIntegerStateQueryTests.ActiveTextureTestCase; + + es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.ACTIVE_TEXTURE, gl.TEXTURE0)); + + var textureUnits = /** @type {number} */ (gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)); + + for (var ndx = 0; ndx < textureUnits; ++ndx) { + gl.activeTexture(gl.TEXTURE0 + ndx); + + this.check(glsStateQuery.verify(gl.ACTIVE_TEXTURE, gl.TEXTURE0 + ndx)); + } + }; + + es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype.deinit = function() { + // [dag] reset the state of the context + gl.activeTexture(gl.TEXTURE0); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.RenderbufferBindingTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.RenderbufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.RenderbufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.RenderbufferBindingTestCase; + + es3fIntegerStateQueryTests.RenderbufferBindingTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.RENDERBUFFER_BINDING, null)); + + /** @type {WebGLRenderbuffer} */ var renderBuffer = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, renderBuffer); + + this.check(glsStateQuery.verify(gl.RENDERBUFFER_BINDING, renderBuffer)); + + gl.deleteRenderbuffer(renderBuffer); + this.check(glsStateQuery.verify(gl.RENDERBUFFER_BINDING, null)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.SamplerObjectBindingTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.SamplerObjectBindingTestCase; + + es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, null)); + + bufferedLogToConsole('SingleUnit: Single unit'); + /** @type {WebGLSampler} */ var sampler = gl.createSampler(); + + gl.bindSampler(0, sampler); + + this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, sampler)); + + gl.deleteSampler(sampler); + this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, null)); + + bufferedLogToConsole('MultipleUnits: Multiple units'); + + /** @type {WebGLSampler} */ var samplerA = gl.createSampler(); + /** @type {WebGLSampler} */ var samplerB = gl.createSampler(); + + gl.bindSampler(1, samplerA); + gl.bindSampler(2, samplerB); + + this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, null)); + + gl.activeTexture(gl.TEXTURE1); + this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, samplerA)); + + gl.activeTexture(gl.TEXTURE2); + this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, samplerB)); + + gl.deleteSampler(samplerB); + gl.deleteSampler(samplerA); + }; + + es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype.deinit = function() { + gl.activeTexture(gl.TEXTURE0); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} testBindingName + * @param {number} textureType + */ + es3fIntegerStateQueryTests.TextureBindingTestCase = function(name, description, testBindingName, textureType) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_testBindingName = testBindingName; + /** @type {number} */ this.m_textureType = textureType; + }; + + es3fIntegerStateQueryTests.TextureBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.TextureBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.TextureBindingTestCase; + + es3fIntegerStateQueryTests.TextureBindingTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(this.m_testBindingName, null)); + + /** @type {WebGLTexture} */ var texture = gl.createTexture(); + + gl.bindTexture(this.m_textureType, texture); + this.check(glsStateQuery.verify(this.m_testBindingName, texture)); + + gl.deleteTexture(texture); + + this.check(glsStateQuery.verify(this.m_testBindingName, null)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.FrameBufferBindingTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.FrameBufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.FrameBufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.FrameBufferBindingTestCase; + + es3fIntegerStateQueryTests.FrameBufferBindingTestCase.prototype.test = function() { + this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, null)); + + /** @type {WebGLFramebuffer} */ var framebufferId = gl.createFramebuffer(); + + gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferId); + + this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, framebufferId)); + this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, framebufferId)); + this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, framebufferId)); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, null)); + + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, framebufferId); + + this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, framebufferId)); + + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebufferId); + + this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, framebufferId)); + this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, framebufferId)); + this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, framebufferId)); + + gl.deleteFramebuffer(framebufferId); + + this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null)); + this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, null)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.ImplementationColorReadTestCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.ImplementationColorReadTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ImplementationColorReadTestCase.prototype.constructor = es3fIntegerStateQueryTests.ImplementationColorReadTestCase; + + es3fIntegerStateQueryTests.ImplementationColorReadTestCase.prototype.test = function() { + /** @type {Array} */ var defaultColorTypes = [ + gl.UNSIGNED_BYTE, gl.BYTE, gl.UNSIGNED_SHORT, gl.SHORT, + gl.UNSIGNED_INT, gl.INT, gl.HALF_FLOAT, gl.FLOAT, gl.UNSIGNED_SHORT_5_6_5, + gl.UNSIGNED_SHORT_4_4_4_4, gl.UNSIGNED_SHORT_5_5_5_1, + gl.UNSIGNED_INT_2_10_10_10_REV, gl.UNSIGNED_INT_10F_11F_11F_REV + ]; + + /** @type {Array} */ var defaultColorFormats = [ + gl.RGBA, gl.RGBA_INTEGER, gl.RGB, gl.RGB_INTEGER, + gl.RG, gl.RG_INTEGER, gl.RED, gl.RED_INTEGER + ]; + + /** @type {Array} */ var validColorTypes = []; + /** @type {Array} */ var validColorFormats = []; + + // Defined by the spec + + for (var ndx = 0; ndx < defaultColorTypes.length; ++ndx) + validColorTypes.push(defaultColorTypes[ndx]); + for (var ndx = 0; ndx < defaultColorFormats.length; ++ndx) + validColorFormats.push(defaultColorFormats[ndx]); + + // Extensions + + // if (this.m_context.getContextInfo().isExtensionSupported("gl.EXT_texture_format_BGRA8888") || + // this.m_context.getContextInfo().isExtensionSupported("gl.APPLE_texture_format_BGRA8888")) + // validColorFormats.push(gl.BGRA); + // + // if (this.m_context.getContextInfo().isExtensionSupported("gl.EXT_read_format_bgra")) { + // validColorFormats.push(gl.BGRA); + // validColorTypes.push(gl.UNSIGNED_SHORT_4_4_4_4_REV); + // validColorTypes.push(gl.UNSIGNED_SHORT_1_5_5_5_REV); + // } + // + // if (this.m_context.getContextInfo().isExtensionSupported("gl.IMG_read_format")) { + // validColorFormats.push(gl.BGRA); + // validColorTypes.push(gl.UNSIGNED_SHORT_4_4_4_4_REV); + // } + // + // if (this.m_context.getContextInfo().isExtensionSupported("gl.NV_sRGB_formats")) { + // validColorFormats.push(gl.SLUMINANCE_NV); + // validColorFormats.push(gl.SLUMINANCE_ALPHA_NV); + // } + // + // if (this.m_context.getContextInfo().isExtensionSupported("gl.NV_bgr")) { + // validColorFormats.push(gl.BGR_NV); + // } + + this.check(glsStateQuery.verifyAnyOf(gl.IMPLEMENTATION_COLOR_READ_TYPE, validColorTypes)); + this.check(glsStateQuery.verifyAnyOf(gl.IMPLEMENTATION_COLOR_READ_FORMAT, validColorFormats)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.ReadBufferCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.ReadBufferCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ReadBufferCase.prototype.constructor = es3fIntegerStateQueryTests.ReadBufferCase; + + es3fIntegerStateQueryTests.ReadBufferCase.prototype.test = function() { + /** @type {Array} */ var validInitialValues = [gl.BACK, gl.NONE]; + this.check(glsStateQuery.verifyAnyOf(gl.READ_BUFFER, validInitialValues)); + + gl.readBuffer(gl.NONE); + this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.NONE)); + + gl.readBuffer(gl.BACK); + this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.BACK)); + + // test gl.READ_BUFFER with framebuffers + + /** @type {WebGLFramebuffer} */ var framebufferId = gl.createFramebuffer(); + + /** @type {WebGLRenderbuffer} */ var renderbuffer_id = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer_id); + + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 128, 128); + + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, framebufferId); + + gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer_id); + + this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.COLOR_ATTACHMENT0)); + + gl.deleteFramebuffer(framebufferId); + gl.deleteRenderbuffer(renderbuffer_id); + + this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.BACK)); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ + es3fIntegerStateQueryTests.DrawBufferCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + }; + + es3fIntegerStateQueryTests.DrawBufferCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.DrawBufferCase.prototype.constructor = es3fIntegerStateQueryTests.DrawBufferCase; + + es3fIntegerStateQueryTests.DrawBufferCase.prototype.test = function() { + /** @type {Array} */ var validInitialValues = [gl.BACK, gl.NONE]; + this.check(glsStateQuery.verifyAnyOf(gl.DRAW_BUFFER0, validInitialValues)); + + /** @type {number} */ var bufs = gl.NONE; + gl.drawBuffers([bufs]); + this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.NONE)); + + bufs = gl.BACK; + gl.drawBuffers([bufs]); + this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.BACK)); + + // test gl.DRAW_BUFFER with framebuffers + + /** @type {WebGLFramebuffer} */ var framebufferId = gl.createFramebuffer(); + + /** @type {Array} */ var renderbuffer_ids = []; + + for (var ndx = 0; ndx < 2; ndx++) + renderbuffer_ids[ndx] = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer_ids[0]); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 128, 128); + + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer_ids[1]); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 128, 128); + + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebufferId); + + gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer_ids[0]); + gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT1, gl.RENDERBUFFER, renderbuffer_ids[1]); + + // only the initial state the draw buffer for fragment color zero is defined + this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.COLOR_ATTACHMENT0)); + + /** @type {Array} */ var bufTargets = [gl.NONE, gl.COLOR_ATTACHMENT1]; + gl.drawBuffers(bufTargets); + this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.NONE)); + this.check(glsStateQuery.verify(gl.DRAW_BUFFER1, gl.COLOR_ATTACHMENT1)); + + gl.deleteFramebuffer(framebufferId); + gl.deleteRenderbuffer(renderbuffer_ids[0]); + gl.deleteRenderbuffer(renderbuffer_ids[1]); + + this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.BACK)); + }; + + // Integer64 + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {number} minValue + */ + es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase = function(name, description, targetName, minValue) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_targetName = targetName; + /** @type {number} */ this.m_minValue = minValue; + }; + + es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase.prototype.constructor = es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase; + + es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase.prototype.test = function() { + this.check(glsStateQuery.verifyGreaterOrEqual(this.m_targetName, this.m_minValue), 'Fail'); + }; + + /** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {number} targetMaxUniformBlocksName + * @param {number} targetMaxUniformComponentsName + */ + es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase = function(name, description, targetName, targetMaxUniformBlocksName, targetMaxUniformComponentsName) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {number} */ this.m_targetName = targetName; + /** @type {number} */ this.m_targetMaxUniformBlocksName = targetMaxUniformBlocksName; + /** @type {number} */ this.m_targetMaxUniformComponentsName = targetMaxUniformComponentsName; + }; + + es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase.prototype = Object.create(es3fApiCase.ApiCase.prototype); + es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase.prototype.constructor = es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase; + + es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase.prototype.test = function() { + var uniformBlockSize = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BLOCK_SIZE)); + var maxUniformBlocks = /** @type {number} */ (gl.getParameter(this.m_targetMaxUniformBlocksName)); + var maxUniformComponents = /** @type {number} */ (gl.getParameter(this.m_targetMaxUniformComponentsName)); + + // MAX_stage_UNIFORM_BLOCKS * MAX_UNIFORM_BLOCK_SIZE / 4 + MAX_stage_UNIFORM_COMPONENTS + /** @type {number} */ var minCombinedUniformComponents = maxUniformBlocks * uniformBlockSize / 4 + maxUniformComponents; + + this.check(glsStateQuery.verifyGreaterOrEqual(this.m_targetName, minCombinedUniformComponents)); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fIntegerStateQueryTests.IntegerStateQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'integers', 'Integer Values'); + }; + + es3fIntegerStateQueryTests.IntegerStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fIntegerStateQueryTests.IntegerStateQueryTests.prototype.constructor = es3fIntegerStateQueryTests.IntegerStateQueryTests; + + es3fIntegerStateQueryTests.IntegerStateQueryTests.prototype.init = function() { + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {number} value + */ + var LimitedStateInteger = function(name, description, targetName, value) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.targetName = targetName; + /** @type {number} */ this.value = value; + }; + + /** @type {Array} */ var implementationMinLimits = [ + new LimitedStateInteger('subpixel_bits', 'SUBPIXEL_BITS has minimum value of 4', gl.SUBPIXEL_BITS, 4), + new LimitedStateInteger('max_3d_texture_size', 'MAX_3D_TEXTURE_SIZE has minimum value of 256', gl.MAX_3D_TEXTURE_SIZE, 256), + new LimitedStateInteger('max_texture_size', 'MAX_TEXTURE_SIZE has minimum value of 2048', gl.MAX_TEXTURE_SIZE, 2048), + new LimitedStateInteger('max_array_texture_layers', 'MAX_ARRAY_TEXTURE_LAYERS has minimum value of 256', gl.MAX_ARRAY_TEXTURE_LAYERS, 256), + new LimitedStateInteger('max_cube_map_texture_size', 'MAX_CUBE_MAP_TEXTURE_SIZE has minimum value of 2048', gl.MAX_CUBE_MAP_TEXTURE_SIZE, 2048), + new LimitedStateInteger('max_renderbuffer_size', 'MAX_RENDERBUFFER_SIZE has minimum value of 2048', gl.MAX_RENDERBUFFER_SIZE, 2048), + new LimitedStateInteger('max_draw_buffers', 'MAX_DRAW_BUFFERS has minimum value of 4', gl.MAX_DRAW_BUFFERS, 4), + new LimitedStateInteger('max_color_attachments', 'MAX_COLOR_ATTACHMENTS has minimum value of 4', gl.MAX_COLOR_ATTACHMENTS, 4), + new LimitedStateInteger('max_elements_indices', 'MAX_ELEMENTS_INDICES has minimum value of 0', gl.MAX_ELEMENTS_INDICES, 0), + new LimitedStateInteger('max_elements_vertices', 'MAX_ELEMENTS_VERTICES has minimum value of 0', gl.MAX_ELEMENTS_VERTICES, 0), + new LimitedStateInteger('max_vertex_attribs', 'MAX_VERTEX_ATTRIBS has minimum value of 16', gl.MAX_VERTEX_ATTRIBS, 16), + new LimitedStateInteger('max_vertex_uniform_components', 'MAX_VERTEX_UNIFORM_COMPONENTS has minimum value of 1024', gl.MAX_VERTEX_UNIFORM_COMPONENTS, 1024), + new LimitedStateInteger('max_vertex_uniform_vectors', 'MAX_VERTEX_UNIFORM_VECTORS has minimum value of 256', gl.MAX_VERTEX_UNIFORM_VECTORS, 256), + new LimitedStateInteger('max_vertex_uniform_blocks', 'MAX_VERTEX_UNIFORM_BLOCKS has minimum value of 12', gl.MAX_VERTEX_UNIFORM_BLOCKS, 12), + new LimitedStateInteger('max_vertex_output_components', 'MAX_VERTEX_OUTPUT_COMPONENTS has minimum value of 64', gl.MAX_VERTEX_OUTPUT_COMPONENTS, 64), + new LimitedStateInteger('max_vertex_texture_image_units', 'MAX_VERTEX_TEXTURE_IMAGE_UNITS has minimum value of 16', gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS, 16), + new LimitedStateInteger('max_fragment_uniform_components', 'MAX_FRAGMENT_UNIFORM_COMPONENTS has minimum value of 896', gl.MAX_FRAGMENT_UNIFORM_COMPONENTS, 896), + new LimitedStateInteger('max_fragment_uniform_vectors', 'MAX_FRAGMENT_UNIFORM_VECTORS has minimum value of 224', gl.MAX_FRAGMENT_UNIFORM_VECTORS, 224), + new LimitedStateInteger('max_fragment_uniform_blocks', 'MAX_FRAGMENT_UNIFORM_BLOCKS has minimum value of 12', gl.MAX_FRAGMENT_UNIFORM_BLOCKS, 12), + new LimitedStateInteger('max_fragment_input_components', 'MAX_FRAGMENT_INPUT_COMPONENTS has minimum value of 60', gl.MAX_FRAGMENT_INPUT_COMPONENTS, 60), + new LimitedStateInteger('max_texture_image_units', 'MAX_TEXTURE_IMAGE_UNITS has minimum value of 16', gl.MAX_TEXTURE_IMAGE_UNITS, 16), + new LimitedStateInteger('max_program_texel_offset', 'MAX_PROGRAM_TEXEL_OFFSET has minimum value of 7', gl.MAX_PROGRAM_TEXEL_OFFSET, 7), + new LimitedStateInteger('max_uniform_buffer_bindings', 'MAX_UNIFORM_BUFFER_BINDINGS has minimum value of 24', gl.MAX_UNIFORM_BUFFER_BINDINGS, 24), + new LimitedStateInteger('max_combined_uniform_blocks', 'MAX_COMBINED_UNIFORM_BLOCKS has minimum value of 24', gl.MAX_COMBINED_UNIFORM_BLOCKS, 24), + new LimitedStateInteger('max_varying_components', 'MAX_VARYING_COMPONENTS has minimum value of 60', gl.MAX_VARYING_COMPONENTS, 60), + new LimitedStateInteger('max_varying_vectors', 'MAX_VARYING_VECTORS has minimum value of 15', gl.MAX_VARYING_VECTORS, 15), + new LimitedStateInteger('max_combined_texture_image_units', 'MAX_COMBINED_TEXTURE_IMAGE_UNITS has minimum value of 32', gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS, 32), + new LimitedStateInteger('max_transform_feedback_interleaved_components', 'MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS has minimum value of 64', gl.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, 64), + new LimitedStateInteger('max_transform_feedback_separate_attribs', 'MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS has minimum value of 4', gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, 4), + new LimitedStateInteger('max_transform_feedback_separate_components', 'MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS has minimum value of 4', gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, 4), + new LimitedStateInteger('max_samples', 'MAX_SAMPLES has minimum value of 4', gl.MAX_SAMPLES, 4), + new LimitedStateInteger('red_bits', 'RED_BITS has minimum value of 0', gl.RED_BITS, 0), + new LimitedStateInteger('green_bits', 'GREEN_BITS has minimum value of 0', gl.GREEN_BITS, 0), + new LimitedStateInteger('blue_bits', 'BLUE_BITS has minimum value of 0', gl.BLUE_BITS, 0), + new LimitedStateInteger('alpha_bits', 'ALPHA_BITS has minimum value of 0', gl.ALPHA_BITS, 0), + new LimitedStateInteger('depth_bits', 'DEPTH_BITS has minimum value of 0', gl.DEPTH_BITS, 0), + new LimitedStateInteger('stencil_bits', 'STENCIL_BITS has minimum value of 0', gl.STENCIL_BITS, 0) + ]; + + /** @type {Array} */ var implementationMaxLimits = [ + new LimitedStateInteger('min_program_texel_offset', 'MIN_PROGRAM_TEXEL_OFFSET has maximum value of -8', gl.MIN_PROGRAM_TEXEL_OFFSET, -8), + new LimitedStateInteger('uniform_buffer_offset_alignment', 'UNIFORM_BUFFER_OFFSET_ALIGNMENT has minimum value of 1', gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT, 256) + ]; + + var testCtx = this; + + for (var testNdx = 0; testNdx < implementationMinLimits.length; testNdx++) + testCtx.addChild(new es3fIntegerStateQueryTests.ConstantMinimumValueTestCase(implementationMinLimits[testNdx].name, implementationMinLimits[testNdx].description, implementationMinLimits[testNdx].targetName, implementationMinLimits[testNdx].value)); + + for (var testNdx = 0; testNdx < implementationMaxLimits.length; testNdx++) + testCtx.addChild(new es3fIntegerStateQueryTests.ConstantMaximumValueTestCase(implementationMaxLimits[testNdx].name, implementationMaxLimits[testNdx].description, implementationMaxLimits[testNdx].targetName, implementationMaxLimits[testNdx].value)); + + testCtx.addChild(new es3fIntegerStateQueryTests.SampleBuffersTestCase('sample_buffers', 'SAMPLE_BUFFERS')); + testCtx.addChild(new es3fIntegerStateQueryTests.SamplesTestCase('samples' , 'SAMPLES')); + testCtx.addChild(new es3fIntegerStateQueryTests.HintTestCase('generate_mipmap_hint', 'GENERATE_MIPMAP_HINT', gl.GENERATE_MIPMAP_HINT)); + testCtx.addChild(new es3fIntegerStateQueryTests.HintTestCase('fragment_shader_derivative_hint', 'FRAGMENT_SHADER_DERIVATIVE_HINT', gl.FRAGMENT_SHADER_DERIVATIVE_HINT)); + testCtx.addChild(new es3fIntegerStateQueryTests.DepthFuncTestCase('depth_func', 'DEPTH_FUNC')); + testCtx.addChild(new es3fIntegerStateQueryTests.CullFaceTestCase('cull_face_mode', 'CULL_FACE_MODE')); + testCtx.addChild(new es3fIntegerStateQueryTests.FrontFaceTestCase('front_face_mode', 'FRONT_FACE')); + testCtx.addChild(new es3fIntegerStateQueryTests.ViewPortTestCase('viewport', 'VIEWPORT')); + testCtx.addChild(new es3fIntegerStateQueryTests.ScissorBoxTestCase('scissor_box', 'SCISSOR_BOX')); + testCtx.addChild(new es3fIntegerStateQueryTests.MaxViewportDimsTestCase('max_viewport_dims', 'MAX_VIEWPORT_DIMS')); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefTestCase('stencil_ref', 'STENCIL_REF', gl.STENCIL_REF)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefTestCase('stencil_back_ref', 'STENCIL_BACK_REF', gl.STENCIL_BACK_REF)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_ref_separate', 'STENCIL_REF (separate)', gl.STENCIL_REF, gl.FRONT)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_ref_separate_both', 'STENCIL_REF (separate)', gl.STENCIL_REF, gl.FRONT_AND_BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_back_ref_separate', 'STENCIL_BACK_REF (separate)', gl.STENCIL_BACK_REF, gl.BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_back_ref_separate_both', 'STENCIL_BACK_REF (separate)', gl.STENCIL_BACK_REF, gl.FRONT_AND_BACK)); + + /** + * @struct + * @constructor + * @param {string} name + * @param {string} frontDescription + * @param {number} frontTarget + * @param {string} backDescription + * @param {number} backTarget + */ + var NamedStencilOp = function(name, frontDescription, frontTarget, backDescription, backTarget) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.frontDescription = frontDescription; + /** @type {number} */ this.frontTarget = frontTarget; + /** @type {string} */ this.backDescription = backDescription; + /** @type {number} */ this.backTarget = backTarget; + }; + + /** @type {Array} */ var stencilOps = [ + new NamedStencilOp('fail', 'STENCIL_FAIL', gl.STENCIL_FAIL, 'STENCIL_BACK_FAIL', gl.STENCIL_BACK_FAIL), + new NamedStencilOp('depth_fail', 'STENCIL_PASS_DEPTH_FAIL', gl.STENCIL_PASS_DEPTH_FAIL, 'STENCIL_BACK_PASS_DEPTH_FAIL', gl.STENCIL_BACK_PASS_DEPTH_FAIL), + new NamedStencilOp('depth_pass', 'STENCIL_PASS_DEPTH_PASS', gl.STENCIL_PASS_DEPTH_PASS, 'STENCIL_BACK_PASS_DEPTH_PASS', gl.STENCIL_BACK_PASS_DEPTH_PASS) + ]; + + for (var testNdx = 0; testNdx < stencilOps.length; testNdx++) { + testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpTestCase('stencil_' + stencilOps[testNdx].name, stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpTestCase('stencil_back_' + stencilOps[testNdx].name, stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget)); + + testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_' + stencilOps[testNdx].name + '_separate_both', stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget, gl.FRONT_AND_BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_back_' + stencilOps[testNdx].name + '_separate_both', stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget, gl.FRONT_AND_BACK)); + + testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_' + stencilOps[testNdx].name + '_separate', stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget, gl.FRONT)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_back_' + stencilOps[testNdx].name + '_separate', stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget, gl.BACK)); + } + + testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncTestCase('stencil_func', 'STENCIL_FUNC')); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_func_separate', 'STENCIL_FUNC (separate)', gl.STENCIL_FUNC, gl.FRONT)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_func_separate_both', 'STENCIL_FUNC (separate)', gl.STENCIL_FUNC, gl.FRONT_AND_BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_back_func_separate', 'STENCIL_FUNC (separate)', gl.STENCIL_BACK_FUNC, gl.BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_back_func_separate_both', 'STENCIL_FUNC (separate)', gl.STENCIL_BACK_FUNC, gl.FRONT_AND_BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskTestCase('stencil_value_mask', 'STENCIL_VALUE_MASK', gl.STENCIL_VALUE_MASK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskTestCase('stencil_back_value_mask', 'STENCIL_BACK_VALUE_MASK', gl.STENCIL_BACK_VALUE_MASK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_value_mask_separate', 'STENCIL_VALUE_MASK (separate)', gl.STENCIL_VALUE_MASK, gl.FRONT)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_value_mask_separate_both', 'STENCIL_VALUE_MASK (separate)', gl.STENCIL_VALUE_MASK, gl.FRONT_AND_BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_back_value_mask_separate', 'STENCIL_BACK_VALUE_MASK (separate)', gl.STENCIL_BACK_VALUE_MASK, gl.BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_back_value_mask_separate_both', 'STENCIL_BACK_VALUE_MASK (separate)', gl.STENCIL_BACK_VALUE_MASK, gl.FRONT_AND_BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskTestCase('stencil_writemask', 'STENCIL_WRITEMASK', gl.STENCIL_WRITEMASK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskTestCase('stencil_back_writemask', 'STENCIL_BACK_WRITEMASK', gl.STENCIL_BACK_WRITEMASK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_writemask_separate', 'STENCIL_WRITEMASK (separate)', gl.STENCIL_WRITEMASK, gl.FRONT)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_writemask_separate_both', 'STENCIL_WRITEMASK (separate)', gl.STENCIL_WRITEMASK, gl.FRONT_AND_BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_back_writemask_separate', 'STENCIL_BACK_WRITEMASK (separate)', gl.STENCIL_BACK_WRITEMASK, gl.BACK)); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_back_writemask_separate_both', 'STENCIL_BACK_WRITEMASK (separate)', gl.STENCIL_BACK_WRITEMASK, gl.FRONT_AND_BACK)); + + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} target + * @param {number} initialValue + */ + var PixelStoreState = function(name, description, target, initialValue) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.target = target; + /** @type {number} */ this.initialValue = initialValue; + }; + + /** @type {Array} */ var pixelStoreStates = [ + new PixelStoreState('unpack_image_height', 'UNPACK_IMAGE_HEIGHT', gl.UNPACK_IMAGE_HEIGHT, 0), + new PixelStoreState('unpack_skip_images', 'UNPACK_SKIP_IMAGES', gl.UNPACK_SKIP_IMAGES, 0), + new PixelStoreState('unpack_row_length', 'UNPACK_ROW_LENGTH', gl.UNPACK_ROW_LENGTH, 0), + new PixelStoreState('unpack_skip_rows', 'UNPACK_SKIP_ROWS', gl.UNPACK_SKIP_ROWS, 0), + new PixelStoreState('unpack_skip_pixels', 'UNPACK_SKIP_PIXELS', gl.UNPACK_SKIP_PIXELS, 0), + new PixelStoreState('pack_row_length', 'PACK_ROW_LENGTH', gl.PACK_ROW_LENGTH, 0), + new PixelStoreState('pack_skip_rows', 'PACK_SKIP_ROWS', gl.PACK_SKIP_ROWS, 0), + new PixelStoreState('pack_skip_pixels', 'PACK_SKIP_PIXELS', gl.PACK_SKIP_PIXELS, 0) + ]; + + for (var testNdx = 0; testNdx < pixelStoreStates.length; testNdx++) + testCtx.addChild(new es3fIntegerStateQueryTests.PixelStoreTestCase(pixelStoreStates[testNdx].name, pixelStoreStates[testNdx].description, pixelStoreStates[testNdx].target, pixelStoreStates[testNdx].initialValue)); + + testCtx.addChild(new es3fIntegerStateQueryTests.PixelStoreAlignTestCase('unpack_alignment', 'UNPACK_ALIGNMENT', gl.UNPACK_ALIGNMENT)); + testCtx.addChild(new es3fIntegerStateQueryTests.PixelStoreAlignTestCase('pack_alignment', 'PACK_ALIGNMENT', gl.PACK_ALIGNMENT)); + + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} target + * @param {number} initialValue + */ + var BlendColorState = function(name, description, target, initialValue) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.target = target; + /** @type {number} */ this.initialValue = initialValue; + }; + + /** @type {Array} */ var blendColorStates = [ + new BlendColorState('blend_src_rgb', 'BLEND_SRC_RGB', gl.BLEND_SRC_RGB), + new BlendColorState('blend_src_alpha', 'BLEND_SRC_ALPHA', gl.BLEND_SRC_ALPHA), + new BlendColorState('blend_dst_rgb', 'BLEND_DST_RGB', gl.BLEND_DST_RGB), + new BlendColorState('blend_dst_alpha', 'BLEND_DST_ALPHA', gl.BLEND_DST_ALPHA) + ]; + + for (var testNdx = 0; testNdx < blendColorStates.length; testNdx++) { + testCtx.addChild(new es3fIntegerStateQueryTests.BlendFuncTestCase(blendColorStates[testNdx].name, blendColorStates[testNdx].description, blendColorStates[testNdx].target)); + testCtx.addChild(new es3fIntegerStateQueryTests.BlendFuncSeparateTestCase(blendColorStates[testNdx].name + '_separate', blendColorStates[testNdx].description, blendColorStates[testNdx].target)); + } + + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} target + * @param {number} initialValue + */ + var BlendEquationState = function(name, description, target, initialValue) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.target = target; + /** @type {number} */ this.initialValue = initialValue; + }; + + /** @type {Array} */ var blendEquationStates = [ + new BlendEquationState('blend_equation_rgb', 'BLEND_EQUATION_RGB', gl.BLEND_EQUATION_RGB, gl.FUNC_ADD), + new BlendEquationState('blend_equation_alpha', 'BLEND_EQUATION_ALPHA', gl.BLEND_EQUATION_ALPHA, gl.FUNC_ADD) + ]; + + for (var testNdx = 0; testNdx < blendEquationStates.length; testNdx++) { + testCtx.addChild(new es3fIntegerStateQueryTests.BlendEquationTestCase(blendEquationStates[testNdx].name, blendEquationStates[testNdx].description, blendEquationStates[testNdx].target, blendEquationStates[testNdx].initialValue)); + testCtx.addChild(new es3fIntegerStateQueryTests.BlendEquationSeparateTestCase(blendEquationStates[testNdx].name + '_separate', blendEquationStates[testNdx].description, blendEquationStates[testNdx].target, blendEquationStates[testNdx].initialValue)); + } + + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} target + * @param {number} minValue + */ + var ImplementationArrayReturningState = function(name, description, target, minValue) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.target = target; + /** @type {number} */ this.minValue = minValue; + }; + + /** @type {ImplementationArrayReturningState} */ var implementationArrayReturningStates = new ImplementationArrayReturningState('compressed_texture_formats', 'COMPRESSED_TEXTURE_FORMATS', gl.COMPRESSED_TEXTURE_FORMATS, 10); + + testCtx.addChild(new es3fIntegerStateQueryTests.ImplementationArrayTestCase(implementationArrayReturningStates.name, implementationArrayReturningStates.description, implementationArrayReturningStates.target, implementationArrayReturningStates.minValue)); + + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} target + * @param {number} type + */ + var BufferBindingState = function(name, description, target, type) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.target = target; + /** @type {number} */ this.type = type; + }; + + /** @type {Array} */ var bufferBindingStates = [ + new BufferBindingState('array_buffer_binding', 'ARRAY_BUFFER_BINDING', gl.ARRAY_BUFFER_BINDING, gl.ARRAY_BUFFER), + new BufferBindingState('uniform_buffer_binding', 'UNIFORM_BUFFER_BINDING', gl.UNIFORM_BUFFER_BINDING, gl.UNIFORM_BUFFER), + new BufferBindingState('pixel_pack_buffer_binding', 'PIXEL_PACK_BUFFER_BINDING', gl.PIXEL_PACK_BUFFER_BINDING, gl.PIXEL_PACK_BUFFER), + new BufferBindingState('pixel_unpack_buffer_binding', 'PIXEL_UNPACK_BUFFER_BINDING', gl.PIXEL_UNPACK_BUFFER_BINDING, gl.PIXEL_UNPACK_BUFFER), + new BufferBindingState('transform_feedback_buffer_binding', 'TRANSFORM_FEEDBACK_BUFFER_BINDING', gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, gl.TRANSFORM_FEEDBACK_BUFFER), + new BufferBindingState('copy_read_buffer_binding', 'COPY_READ_BUFFER_BINDING', gl.COPY_READ_BUFFER_BINDING, gl.COPY_READ_BUFFER), + new BufferBindingState('copy_write_buffer_binding', 'COPY_WRITE_BUFFER_BINDING', gl.COPY_WRITE_BUFFER_BINDING, gl.COPY_WRITE_BUFFER) + ]; + + for (var testNdx = 0; testNdx < bufferBindingStates.length; testNdx++) + testCtx.addChild(new es3fIntegerStateQueryTests.BufferBindingTestCase(bufferBindingStates[testNdx].name, bufferBindingStates[testNdx].description, bufferBindingStates[testNdx].target, bufferBindingStates[testNdx].type)); + + testCtx.addChild(new es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase('element_array_buffer_binding')); + testCtx.addChild(new es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase('transform_feedback_binding')); + testCtx.addChild(new es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase('transform_feedback_binding')); + testCtx.addChild(new es3fIntegerStateQueryTests.CurrentProgramBindingTestCase('current_program_binding', 'CURRENT_PROGRAM')); + testCtx.addChild(new es3fIntegerStateQueryTests.VertexArrayBindingTestCase('vertex_array_binding', 'VERTEX_ARRAY_BINDING')); + testCtx.addChild(new es3fIntegerStateQueryTests.StencilClearValueTestCase('stencil_clear_value', 'STENCIL_CLEAR_VALUE')); + testCtx.addChild(new es3fIntegerStateQueryTests.ActiveTextureTestCase('active_texture', 'ACTIVE_TEXTURE')); + testCtx.addChild(new es3fIntegerStateQueryTests.RenderbufferBindingTestCase('renderbuffer_binding', 'RENDERBUFFER_BINDING')); + testCtx.addChild(new es3fIntegerStateQueryTests.SamplerObjectBindingTestCase('sampler_binding', 'SAMPLER_BINDING')); + + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} target + * @param {number} type + */ + var TextureBinding = function(name, description, target, type) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.target = target; + /** @type {number} */ this.type = type; + }; + + /** @type {Array} */ var textureBindings = [ + new TextureBinding('texture_binding_2d', 'TEXTURE_BINDING_2D', gl.TEXTURE_BINDING_2D, gl.TEXTURE_2D), + new TextureBinding('texture_binding_3d', 'TEXTURE_BINDING_3D', gl.TEXTURE_BINDING_3D, gl.TEXTURE_3D), + new TextureBinding('texture_binding_2d_array', 'TEXTURE_BINDING_2D_ARRAY', gl.TEXTURE_BINDING_2D_ARRAY, gl.TEXTURE_2D_ARRAY), + new TextureBinding('texture_binding_cube_map', 'TEXTURE_BINDING_CUBE_MAP', gl.TEXTURE_BINDING_CUBE_MAP, gl.TEXTURE_CUBE_MAP) + ]; + + for (var testNdx = 0; testNdx < textureBindings.length; testNdx++) + testCtx.addChild(new es3fIntegerStateQueryTests.TextureBindingTestCase(textureBindings[testNdx].name, textureBindings[testNdx].description, textureBindings[testNdx].target, textureBindings[testNdx].type)); + + testCtx.addChild(new es3fIntegerStateQueryTests.FrameBufferBindingTestCase('framebuffer_binding', 'DRAW_FRAMEBUFFER_BINDING and READ_FRAMEBUFFER_BINDING')); + testCtx.addChild(new es3fIntegerStateQueryTests.ImplementationColorReadTestCase('implementation_color_read', 'IMPLEMENTATION_COLOR_READ_TYPE and IMPLEMENTATION_COLOR_READ_FORMAT')); + testCtx.addChild(new es3fIntegerStateQueryTests.ReadBufferCase('read_buffer', 'READ_BUFFER')); + testCtx.addChild(new es3fIntegerStateQueryTests.DrawBufferCase('draw_buffer', 'DRAW_BUFFER')); + + + // Integer64 + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {number} targetName + * @param {number} minValue + */ + var LimitedStateInteger64 = function(name, description, targetName, minValue) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {number} */ this.targetName = targetName; + /** @type {number} */ this.minValue = minValue; + + }; + + /** @type {Array} */ var implementationLimits = [ + new LimitedStateInteger64('max_element_index', 'MAX_ELEMENT_INDEX', gl.MAX_ELEMENT_INDEX, 0x00FFFFFF), + new LimitedStateInteger64('max_server_wait_timeout', 'MAX_SERVER_WAIT_TIMEOUT', gl.MAX_SERVER_WAIT_TIMEOUT, 0), + new LimitedStateInteger64('max_uniform_block_size', 'MAX_UNIFORM_BLOCK_SIZE', gl.MAX_UNIFORM_BLOCK_SIZE, 16384) + ]; + + for (var testNdx = 0; testNdx < implementationLimits.length; testNdx++) + this.addChild(new es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase(implementationLimits[testNdx].name, implementationLimits[testNdx].description, implementationLimits[testNdx].targetName, implementationLimits[testNdx].minValue)); + + this.addChild(new es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase('max_combined_vertex_uniform_components', 'MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS', gl.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, gl.MAX_VERTEX_UNIFORM_BLOCKS, gl.MAX_VERTEX_UNIFORM_COMPONENTS)); + this.addChild(new es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase('max_combined_fragment_uniform_components', 'MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS', gl.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, gl.MAX_FRAGMENT_UNIFORM_BLOCKS, gl.MAX_FRAGMENT_UNIFORM_COMPONENTS)); + + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fIntegerStateQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fIntegerStateQueryTests.IntegerStateQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fIntegerStateQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js new file mode 100644 index 000000000..8eb1b0e2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js @@ -0,0 +1,173 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fInternalFormatQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { +var es3fInternalFormatQueryTests = functional.gles3.es3fInternalFormatQueryTests; +var tcuTestCase = framework.common.tcuTestCase; +var glsStateQuery = modules.shared.glsStateQuery; +var es3fApiCase = functional.gles3.es3fApiCase; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} internalFormat + * @param {boolean} isIntegerInternalFormat + */ +es3fInternalFormatQueryTests.SamplesCase = function(name, description, internalFormat, isIntegerInternalFormat) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_internalFormat = internalFormat; + this.m_isIntegerInternalFormat = isIntegerInternalFormat; +}; + +setParentClass(es3fInternalFormatQueryTests.SamplesCase, es3fApiCase.ApiCase); + +es3fInternalFormatQueryTests.SamplesCase.prototype.test = function() { + var samples = gl.getInternalformatParameter(gl.RENDERBUFFER, this.m_internalFormat, gl.SAMPLES); + + this.check(!this.m_isIntegerInternalFormat || samples.length == 0, 'integer internal format should have 0 samples, got ' + samples.length); + + if (samples.length == 0) + return; + + var prevSampleCount = 0; + var sampleCount = 0; + for (var ndx = 0; ndx < samples.length; ++ndx, prevSampleCount = sampleCount) { + sampleCount = samples[ndx]; + + // sample count must be > 0 + this.check(sampleCount > 0, 'Expected sample count to be at least one; got ' + sampleCount); + + // samples must be ordered descending + this.check(ndx == 0 || sampleCount < prevSampleCount, 'Expected sample count to be ordered in descending order; got ' + prevSampleCount + ' at index ' + (ndx - 1) + ', and ' + sampleCount + ' at index ' + ndx); + } + + // the maximum value in SAMPLES is guaranteed to be at least the value of MAX_SAMPLES + var maxSamples = /** @type {number} */ (gl.getParameter(gl.MAX_SAMPLES)); + var maximumFormatSampleCount = samples[0]; + this.check(maximumFormatSampleCount >= maxSamples, 'Expected maximum value in SAMPLES (' + maximumFormatSampleCount + ') to be at least the value of MAX_SAMPLES (' + maxSamples + ')'); +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fInternalFormatQueryTests.InternalFormatQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'internal_format', 'Internal Format Query tests'); +}; + +es3fInternalFormatQueryTests.InternalFormatQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fInternalFormatQueryTests.InternalFormatQueryTests.prototype.constructor = es3fInternalFormatQueryTests.InternalFormatQueryTests; + +es3fInternalFormatQueryTests.InternalFormatQueryTests.prototype.init = function() { + var internalFormats = [ + //name, format, is_integer + // color renderable and unsized + // \note These unsized formats seem to allowed by the spec, but they are not useful in any way. (You can't create a renderbuffer with such internalFormat) + ['rgba', gl.RGBA, false], + ['rgb', gl.RGB, false], + + // color renderable + ['r8', gl.R8, false], + ['rg8', gl.RG8, false], + ['rgb8', gl.RGB8, false], + ['rgb565', gl.RGB565, false], + ['rgba4', gl.RGBA4, false], + ['rgb5_a1', gl.RGB5_A1, false], + ['rgba8', gl.RGBA8, false], + ['rgb10_a2', gl.RGB10_A2, false], + ['rgb10_a2ui', gl.RGB10_A2UI, true], + ['srgb8_alpha8', gl.SRGB8_ALPHA8, false], + ['r8i', gl.R8I, true], + ['r8ui', gl.R8UI, true], + ['r16i', gl.R16I, true], + ['r16ui', gl.R16UI, true], + ['r32i', gl.R32I, true], + ['r32ui', gl.R32UI, true], + ['rg8i', gl.RG8I, true], + ['rg8ui', gl.RG8UI, true], + ['rg16i', gl.RG16I, true], + ['rg16ui', gl.RG16UI, true], + ['rg32i', gl.RG32I, true], + ['rg32ui', gl.RG32UI, true], + ['rgba8i', gl.RGBA8I, true], + ['rgba8ui', gl.RGBA8UI, true], + ['rgba16i', gl.RGBA16I, true], + ['rgba16ui', gl.RGBA16UI, true], + ['rgba32i', gl.RGBA32I, true], + ['rgba32ui', gl.RGBA32UI, true], + + // depth renderable + ['depth_component16', gl.DEPTH_COMPONENT16, false], + ['depth_component24', gl.DEPTH_COMPONENT24, false], + ['depth_component32f', gl.DEPTH_COMPONENT32F, false], + ['depth24_stencil8', gl.DEPTH24_STENCIL8, false], + ['depth32f_stencil8', gl.DEPTH32F_STENCIL8, false], + + // stencil renderable + ['stencil_index8', gl.STENCIL_INDEX8, false] + // DEPTH24_STENCIL8, duplicate + // DEPTH32F_STENCIL8 duplicate + ]; + + for (var ndx = 0; ndx < internalFormats.length; ++ndx) { + var internalFormat = internalFormats[ndx]; + + this.addChild(new es3fInternalFormatQueryTests.SamplesCase(internalFormat[0] + '_samples', 'SAMPLES and NUM_SAMPLE_COUNTS', internalFormat[1], internalFormat[2])); + } +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fInternalFormatQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fInternalFormatQueryTests.InternalFormatQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fInternalFormatQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js new file mode 100644 index 000000000..4bccc25cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js @@ -0,0 +1,476 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fLifetimeTests'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('modules.shared.glsLifetimeTests'); +goog.require('modules.shared.glsTextureTestUtil'); + +goog.scope(function() { +var es3fLifetimeTests = functional.gles3.es3fLifetimeTests; +var glsLifetimeTests = modules.shared.glsLifetimeTests; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var deRandom = framework.delibs.debase.deRandom; +var tcuSurface = framework.common.tcuSurface; +var glsTextureTestUtil = modules.shared.glsTextureTestUtil; +var tcuTestCase = framework.common.tcuTestCase; + +/** @const */ var VIEWPORT_SIZE = 128; +/** @const */ var NUM_COMPONENTS = 4; +/** @const */ var NUM_VERTICES = 3; + +/** @type {WebGL2RenderingContext} */ var gl; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {gluShaderProgram.ShaderProgram} + */ +es3fLifetimeTests.ScaleProgram = function() { + gluShaderProgram.ShaderProgram.call(this, gl, this.getSources()); + assertMsgOptions(this.isOk(), 'Program creation failed', false, true); + this.m_scaleLoc = gl.getUniformLocation(this.getProgram(), 'scale'); + this.m_posLoc = gl.getAttribLocation(this.getProgram(), 'pos'); +}; + +setParentClass(es3fLifetimeTests.ScaleProgram, gluShaderProgram.ShaderProgram); + +/** + * @param {WebGLVertexArrayObject} vao + * @param {number} scale + * @param {boolean} tf + * @param {tcuSurface.Surface} dst + */ +es3fLifetimeTests.ScaleProgram.prototype.draw = function(vao, scale, tf, dst) { + es3fLifetimeTests.ScaleProgram.seed = es3fLifetimeTests.ScaleProgram.seed || 0; + ++es3fLifetimeTests.ScaleProgram.seed; + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_SIZE, VIEWPORT_SIZE, es3fLifetimeTests.ScaleProgram.seed); + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + gl.clearColor(0, 0, 0, 1); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + + gl.bindVertexArray(vao); + gl.enableVertexAttribArray(this.m_posLoc); + gl.useProgram(this.getProgram()); + + gl.uniform1f(this.m_scaleLoc, scale); + + if (tf) + gl.beginTransformFeedback(gl.TRIANGLES); + gl.drawArrays(gl.TRIANGLES, 0, 3); + if (tf) + gl.endTransformFeedback(); + + if (dst) + glsLifetimeTests.readRectangle(viewport, dst); + + gl.bindVertexArray(null); + +}; + +/** + * @param {WebGLBuffer} buffer + * @param {WebGLVertexArrayObject} vao + */ +es3fLifetimeTests.ScaleProgram.prototype.setPos = function(buffer, vao) { + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl.bindVertexArray(vao); + if (buffer) { + gl.vertexAttribPointer(this.m_posLoc, NUM_COMPONENTS, gl.FLOAT, false, 0, 0); + } else { + var name = gl.getVertexAttrib(this.m_posLoc, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING); + gl.deleteBuffer(name); + } + gl.bindVertexArray(null); + gl.bindBuffer(gl.ARRAY_BUFFER, null); +}; + +/** + * @private + */ +es3fLifetimeTests.ScaleProgram.prototype.getSources = function() { +/** @const */ var s_vertexShaderSrc = + '#version 100\n' + + 'attribute vec4 pos;\n' + + 'uniform float scale;\n' + + 'void main ()\n' + + '{\n' + + ' gl_Position = vec4(scale * pos.xy, pos.zw);\n' + + '}'; + +/** @const */ var s_fragmentShaderSrc = + '#version 100\n' + + 'void main ()\n' + + '{\n' + + ' gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);\n' + + '}'; + var sources = new gluShaderProgram.ProgramSources(); + sources.add(new gluShaderProgram.VertexSource(s_vertexShaderSrc)); + sources.add(new gluShaderProgram.FragmentSource(s_fragmentShaderSrc)); + sources.add(new gluShaderProgram.TransformFeedbackMode(gl.INTERLEAVED_ATTRIBS)); + sources.add(new gluShaderProgram.TransformFeedbackVarying('gl_Position')); + return sources; +}; + +/** + * @constructor + * @extends {glsLifetimeTests.SimpleBinder} + */ +es3fLifetimeTests.VertexArrayBinder = function() { + glsLifetimeTests.SimpleBinder.call(this, null, gl.NONE, gl.VERTEX_ARRAY_BINDING); +}; + +setParentClass(es3fLifetimeTests.VertexArrayBinder, glsLifetimeTests.SimpleBinder); + +es3fLifetimeTests.VertexArrayBinder.prototype.bind = function(obj) { + var vao = /** @type {WebGLVertexArrayObject} */ (obj); + gl.bindVertexArray(vao); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.Binder} + */ +es3fLifetimeTests.SamplerBinder = function() { + glsLifetimeTests.Binder.call(this); +}; + +setParentClass(es3fLifetimeTests.SamplerBinder, glsLifetimeTests.Binder); + +es3fLifetimeTests.SamplerBinder.prototype.bind = function(obj) { + var sampler = /** @type {WebGLSampler} */ (obj); + gl.bindSampler(0, sampler); +}; +es3fLifetimeTests.SamplerBinder.prototype.getBinding = function() { return /** @type {WebGLSampler} */ (gl.getParameter(gl.SAMPLER_BINDING)); }; + +/** + * @constructor + * @extends {glsLifetimeTests.Binder} + */ +es3fLifetimeTests.QueryBinder = function() { + glsLifetimeTests.Binder.call(this); +}; + +setParentClass(es3fLifetimeTests.QueryBinder, glsLifetimeTests.Binder); + +es3fLifetimeTests.QueryBinder.prototype.bind = function(obj) { + var query = /** @type {WebGLQuery} */ (obj); + if (query) + gl.beginQuery(gl.ANY_SAMPLES_PASSED, query); + else + gl.endQuery(gl.ANY_SAMPLES_PASSED); +}; + +es3fLifetimeTests.QueryBinder.prototype.getBinding = function() { return null; }; + +/** + * @constructor + * @extends {glsLifetimeTests.Attacher} + * @param {glsLifetimeTests.Type} elementType + * @param {glsLifetimeTests.Type} varrType + * @param {es3fLifetimeTests.ScaleProgram} program + */ +es3fLifetimeTests.BufferVAOAttacher = function(elementType, varrType, program) { + glsLifetimeTests.Attacher.call(this, elementType, varrType); + this.m_program = program; +}; + +setParentClass(es3fLifetimeTests.BufferVAOAttacher, glsLifetimeTests.Attacher); + +/** + * @return {es3fLifetimeTests.ScaleProgram} + */ +es3fLifetimeTests.BufferVAOAttacher.prototype.getProgram = function() { return this.m_program; }; + +/** + * @param {number} seed + * @param {number} usage + * @param {WebGLBuffer} buffer + */ +es3fLifetimeTests.initBuffer = function(seed, usage, buffer) { + /** @const */ var s_varrData = [ + -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.bindBuffer(gl.ARRAY_BUFFER, buffer); + if (seed == 0) + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(s_varrData), usage); + else { + var rnd = new deRandom.Random(seed); + var data = []; + + for (var ndx = 0; ndx < NUM_VERTICES; ndx++) { + data.push(2 * (rnd.getFloat() - 0.5)); + data.push(2 * (rnd.getFloat() - 0.5)); + data.push(0); + data.push(1); + } + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), usage); + } + gl.bindBuffer(gl.ARRAY_BUFFER, null); +}; + +es3fLifetimeTests.BufferVAOAttacher.prototype.initAttachment = function(seed, obj) { + var buffer = /** @type {WebGLBuffer} */ (obj); + es3fLifetimeTests.initBuffer(seed, gl.STATIC_DRAW, buffer); + bufferedLogToConsole('Initialized buffer ' + buffer + ' from seed ' + seed); +}; + +es3fLifetimeTests.BufferVAOAttacher.prototype.attach = function(element, target) { + var buffer = /** @type {WebGLBuffer} */ (element); + var vao = /** @type {WebGLVertexArrayObject} */ (target); + + this.m_program.setPos(buffer, vao); + bufferedLogToConsole('Set the `pos` attribute in VAO ' + vao + ' to buffer ' + buffer); +}; + +es3fLifetimeTests.BufferVAOAttacher.prototype.detach = function(element, target) { + var vao = /** @type {WebGLVertexArrayObject} */ (target); + this.attach(null, vao); +}; + +es3fLifetimeTests.BufferVAOAttacher.prototype.getAttachment = function(target) { + var vao = /** @type {WebGLVertexArrayObject} */ (target); + gl.bindVertexArray(vao); + var name = gl.getVertexAttrib(this.m_posLoc, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING); + gl.bindVertexArray(null); + return name; +}; + +/** + * @constructor + * @extends {glsLifetimeTests.InputAttacher} + * @param {es3fLifetimeTests.BufferVAOAttacher} attacher + */ +es3fLifetimeTests.BufferVAOInputAttacher = function(attacher) { + glsLifetimeTests.InputAttacher.call(this, attacher); + this.m_program = attacher.getProgram(); +}; + +setParentClass(es3fLifetimeTests.BufferVAOInputAttacher, glsLifetimeTests.InputAttacher); + +es3fLifetimeTests.BufferVAOInputAttacher.prototype.drawContainer = function(obj, dst) { + var vao = /** @type {WebGLVertexArrayObject} */ (obj); + this.m_program.draw(vao, 1.0, false, dst); + bufferedLogToConsole('Drew an output image with VAO ' + vao); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.Attacher} + * @param {glsLifetimeTests.Type} elementType + * @param {glsLifetimeTests.Type} tfType +*/ +es3fLifetimeTests.BufferTfAttacher = function(elementType, tfType) { + glsLifetimeTests.Attacher.call(this, elementType, tfType); +}; + +setParentClass(es3fLifetimeTests.BufferTfAttacher, glsLifetimeTests.Attacher); + +es3fLifetimeTests.BufferTfAttacher.prototype.initAttachment = function(seed, obj) { + var buffer = /** @type {WebGLBuffer} */ (obj); + es3fLifetimeTests.initBuffer(seed, gl.DYNAMIC_READ, buffer); + bufferedLogToConsole('Initialized buffer ' + buffer + ' from seed ' + seed); +}; + +es3fLifetimeTests.BufferTfAttacher.prototype.attach = function(element, target) { + var buffer = /** @type {WebGLBuffer} */ (element); + var tf = /** @type {WebGLTransformFeedback} */ (target); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buffer); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); +}; + +es3fLifetimeTests.BufferTfAttacher.prototype.detach = function(element, target) { + var buffer = /** @type {WebGLBuffer} */ (element); + var tf = /** @type {WebGLTransformFeedback} */ (target); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, null); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + +}; + +es3fLifetimeTests.BufferTfAttacher.prototype.getAttachment = function(target) { + var tf = /** @type {WebGLTransformFeedback} */ (target); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); + var name = gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, 0); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + return name; +}; + +/** + * @constructor + * @extends {glsLifetimeTests.OutputAttacher} + */ +es3fLifetimeTests.BufferTfOutputAttacher = function(attacher, program) { + glsLifetimeTests.OutputAttacher.call(this, attacher); + this.m_program = program; +}; + +setParentClass(es3fLifetimeTests.BufferTfOutputAttacher, glsLifetimeTests.OutputAttacher); + +es3fLifetimeTests.BufferTfOutputAttacher.prototype.setupContainer = function(seed, obj) { + var tf = /** @type {WebGLTransformFeedback} */ (obj); + var posBuf = gl.createBuffer(); + var vao = gl.createVertexArray(); + + es3fLifetimeTests.initBuffer(seed, gl.STATIC_DRAW, posBuf); + this.m_program.setPos(posBuf, vao); + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); + this.m_program.draw(vao, -1.0, true, null); + bufferedLogToConsole('Drew an image with seed ' + seed + ' with transform feedback to ' + tf); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + gl.deleteVertexArray(vao); + gl.deleteBuffer(posBuf); +}; + +es3fLifetimeTests.BufferTfOutputAttacher.prototype.drawAttachment = function(buffer, dst) { + var vao = gl.createVertexArray(); + + this.m_program.setPos(buffer, vao); + this.m_program.draw(vao, 1.0, false, dst); + bufferedLogToConsole('Drew output image with vertices from buffer ' + buffer); + gl.deleteVertexArray(vao); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.ES2Types} + */ +es3fLifetimeTests.ES3Types = function() { + glsLifetimeTests.ES2Types.call(this); + this.m_program = new es3fLifetimeTests.ScaleProgram(); + this.m_queryBind = new es3fLifetimeTests.QueryBinder(); + this.m_queryType = new glsLifetimeTests.SimpleType('query', gl.createQuery, gl.deleteQuery, gl.isQuery, this.m_queryBind); + this.m_tfBind = new glsLifetimeTests.SimpleBinder(gl.bindTransformFeedback, gl.TRANSFORM_FEEDBACK, + gl.TRANSFORM_FEEDBACK_BINDING); + this.m_tfType = new glsLifetimeTests.SimpleType('transform_feedback', gl.createTransformFeedback, gl.deleteTransformFeedback, gl.isTransformFeedback, this.m_tfBind); + this.m_varrBind = new es3fLifetimeTests.VertexArrayBinder(); + this.m_varrType = new glsLifetimeTests.SimpleType('vertex_array', gl.createVertexArray, gl.deleteVertexArray, gl.isVertexArray, this.m_varrBind); + this.m_samplerBind = new es3fLifetimeTests.SamplerBinder(); + this.m_samplerType = new glsLifetimeTests.SimpleType('sampler', gl.createSampler, gl.deleteSampler, gl.isSampler, this.m_samplerBind, true); + this.m_bufVarrAtt = new es3fLifetimeTests.BufferVAOAttacher(this.m_bufferType, this.m_varrType, this.m_program); + this.m_bufVarrInAtt = new es3fLifetimeTests.BufferVAOInputAttacher(this.m_bufVarrAtt); + this.m_bufTfAtt = new es3fLifetimeTests.BufferTfAttacher(this.m_bufferType, this.m_tfType); + this.m_bufTfOutAtt = new es3fLifetimeTests.BufferTfOutputAttacher(this.m_bufTfAtt, this.m_program); + + this.m_types.push(this.m_queryType, this.m_tfType, this.m_varrType, this.m_samplerType); + this.m_attachers.push(this.m_bufVarrAtt, this.m_bufTfAtt); + this.m_inAttachers.push(this.m_bufVarrInAtt); + this.m_outAttachers.push(this.m_bufTfOutAtt); +}; + +setParentClass(es3fLifetimeTests.ES3Types, glsLifetimeTests.ES2Types); + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fLifetimeTests.TfDeleteActiveTest = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); +}; + +setParentClass(es3fLifetimeTests.TfDeleteActiveTest, tcuTestCase.DeqpTest); + +es3fLifetimeTests.TfDeleteActiveTest.prototype.iterate = function() { +/** @const */ var s_xfbVertexSource = + '#version 300 es\n' + + 'void main ()\n' + + '{\n' + + ' gl_Position = vec4(float(gl_VertexID) / 2.0, float(gl_VertexID % 2) / 2.0, 0.0, 1.0);\n' + + '}\n'; + +/** @const */ var s_xfbFragmentSource = + '#version 300 es\n' + + 'layout(location=0) out mediump vec4 dEQP_FragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' dEQP_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n' + + '}\n'; + var buf = gl.createBuffer(); + + var sources = new gluShaderProgram.ProgramSources(); + sources.add(new gluShaderProgram.VertexSource(s_xfbVertexSource)); + sources.add(new gluShaderProgram.FragmentSource(s_xfbFragmentSource)); + sources.add(new gluShaderProgram.TransformFeedbackMode(gl.SEPARATE_ATTRIBS)); + sources.add(new gluShaderProgram.TransformFeedbackVarying('gl_Position')); + var program = new gluShaderProgram.ShaderProgram(gl, sources); + if (!program.isOk()) { + bufferedLogToConsole(program.getProgramInfo().infoLog); + testFailedOptions('failed to build program', true); + } + gl.useProgram(program.getProgram()); + + var tf = gl.createTransformFeedback(); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 48, gl.STATIC_DRAW); + + gl.beginTransformFeedback(gl.TRIANGLES); + var errCode = gl.NONE; + gl.deleteTransformFeedback(tf); + errCode = gl.getError(); + assertMsgOptions(errCode == gl.INVALID_OPERATION, + 'Deleting active transform feedback must produce INVALID_OPERATION', false, true); + gl.endTransformFeedback(); + gl.deleteTransformFeedback(tf); + testPassed(); + return tcuTestCase.IterateResult.STOP; +}; + +es3fLifetimeTests.genTestCases = function() { + var state = tcuTestCase.runner; + state.setRoot(tcuTestCase.newTest('lifetime', 'Top level')); + + var types = new es3fLifetimeTests.ES3Types(); + glsLifetimeTests.addTestCases(state.testCases, types); + /* TODO: Add TfDeleteActiveTest test */ + var deleteActiveGroup = tcuTestCase.newTest('delete_active', 'Delete active object'); + state.testCases.addChild(deleteActiveGroup); + deleteActiveGroup.addChild( + new es3fLifetimeTests.TfDeleteActiveTest('transform_feedback', 'Transform Feedback')); +}; + +/** + * Create and execute the test cases + */ +es3fLifetimeTests.run = function(context) { + gl = context; + try { + es3fLifetimeTests.genTestCases(); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js new file mode 100644 index 000000000..1babbd35d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js @@ -0,0 +1,1741 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fMultisampleTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluStrUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTexture'); +goog.require('modules.shared.glsTextureTestUtil'); + +goog.scope(function() { + /** @type {?WebGL2RenderingContext} */ var gl; + var es3fMultisampleTests = functional.gles3.es3fMultisampleTests; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var tcuRGBA = framework.common.tcuRGBA; + var tcuSurface = framework.common.tcuSurface; + var tcuTestCase = framework.common.tcuTestCase; + var tcuTexture = framework.common.tcuTexture; + var gluStrUtil = framework.opengl.gluStrUtil; + var glsTextureTestUtil = modules.shared.glsTextureTestUtil; + var tcuImageCompare = framework.common.tcuImageCompare; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var tcuLogImage = framework.common.tcuLogImage; + + /** + * @constructor + * @struct + * @param {Array} p0_ + * @param {Array} p1_ + * @param {Array} p2_ + * @param {Array} p3_ + */ + es3fMultisampleTests.QuadCorners = function(p0_, p1_, p2_, p3_) { + /** @type {Array} */ this.p0 = p0_; + /** @type {Array} */ this.p1 = p1_; + /** @type {Array} */ this.p2 = p2_; + /** @type {Array} */ this.p3 = p3_; + }; + + /** + * @param {number} defaultCount + * @return {number} + */ + es3fMultisampleTests.getIterationCount = function(defaultCount) { + // The C++ test takes an argument from the command line. + // Leaving this function in case we want to be able to take an argument from the URL + return defaultCount; + }; + + /** + * @param {Array} point + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} p3 + * @return {boolean} + */ + es3fMultisampleTests.isInsideQuad = function(point, p0, p1, p2, p3) { + /** @type {number} */ var dot0 = (point[0] - p0[0]) * (p1[1] - p0[1]) + (point[1] - p0[1]) * (p0[0] - p1[0]); + /** @type {number} */ var dot1 = (point[0] - p1[0]) * (p2[1] - p1[1]) + (point[1] - p1[1]) * (p1[0] - p2[0]); + /** @type {number} */ var dot2 = (point[0] - p2[0]) * (p3[1] - p2[1]) + (point[1] - p2[1]) * (p2[0] - p3[0]); + /** @type {number} */ var dot3 = (point[0] - p3[0]) * (p0[1] - p3[1]) + (point[1] - p3[1]) * (p3[0] - p0[0]); + + return (dot0 > 0) == (dot1 > 0) && (dot1 > 0) == (dot2 > 0) && (dot2 > 0) == (dot3 > 0); + }; + + /** + * Check if a region in an image is unicolored. + * + * Checks if the pixels in img inside the convex quadilateral defined by + * p0, p1, p2 and p3 are all (approximately) of the same color. + * + * @param {tcuSurface.Surface} img + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} p3 + * @return {boolean} + */ + es3fMultisampleTests.isPixelRegionUnicolored = function(img, p0, p1, p2, p3) { + /** @type {number} */ var xMin = deMath.clamp(Math.min(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1); + /** @type {number} */ var yMin = deMath.clamp(Math.min(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1); + /** @type {number} */ var xMax = deMath.clamp(Math.max(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1); + /** @type {number} */ var yMax = deMath.clamp(Math.max(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1); + /** @type {boolean} */ var insideEncountered = false; //!< Whether we have already seen at least one pixel inside the region. + /** @type {tcuRGBA.RGBA} */ var insideColor; //!< Color of the first pixel inside the region. + /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(3, 3, 3, 3); + for (var y = yMin; y <= yMax; y++) + for (var x = xMin; x <= xMax; x++) + if (es3fMultisampleTests.isInsideQuad([x, y], p0, p1, p2, p3)) { + /** @type {tcuRGBA.RGBA} */ var pixColor = new tcuRGBA.RGBA(img.getPixel(x, y)); + + if (insideEncountered) + if (!tcuRGBA.compareThreshold(pixColor, insideColor, threshold)) // Pixel color differs from already-detected color inside same region - region not unicolored. + return false; + else { + insideEncountered = true; + insideColor = pixColor; + } + } + return true; + }; + + /** + * [drawUnicolorTestErrors description] + * @param {tcuSurface.Surface} img + * @param {tcuTexture.PixelBufferAccess} errorImg + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} p3 + * @return {boolean} + */ + es3fMultisampleTests.drawUnicolorTestErrors = function(img, errorImg, p0, p1, p2, p3) { + /** @type {number} */ var xMin = deMath.clamp(Math.min(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1); + /** @type {number} */ var yMin = deMath.clamp(Math.min(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1); + /** @type {number} */ var xMax = deMath.clamp(Math.max(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1); + /** @type {number} */ var yMax = deMath.clamp(Math.max(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1); + /** @type {tcuRGBA.RGBA} */ var refColor = new tcuRGBA.RGBA(img.getPixel(Math.floor((xMin + xMax) / 2), Math.floor((yMin + yMax) / 2))); + /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(3, 3, 3, 3); + for (var y = yMin; y <= yMax; y++) + for (var x = xMin; x <= xMax; x++) + if (es3fMultisampleTests.isInsideQuad([x, y], p0, p1, p2, p3)) { + if (!tcuRGBA.compareThreshold(new tcuRGBA.RGBA(img.getPixel(x, y)), refColor, threshold)) { + img.setPixel(x, y, tcuRGBA.RGBA.red.toVec()); // TODO: this might also be toIVec() + errorImg.setPixel([1.0, 0.0, 0.0, 1.0], x, y); + } + } + return true; + }; + + /** + * @constructor + * @struct + * @param {number=} numSamples_ + * @param {boolean=} useDepth_ + * @param {boolean=} useStencil_ + */ + es3fMultisampleTests.FboParams = function(numSamples_, useDepth_, useStencil_) { + /** @type {boolean} */ var useFbo_ = true; + if (numSamples_ === undefined && useDepth_ === undefined && useStencil_ === undefined) + useFbo_ = false; + /** @type {boolean} */ this.useFbo = useFbo_; + /** @type {number} */ this.numSamples = numSamples_ === undefined ? -1 : numSamples_; + /** @type {boolean} */ this.useDepth = useDepth_ === undefined ? false : useDepth_; + /** @type {boolean} */ this.useStencil = useStencil_ === undefined ? false : useStencil_; + + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} desiredViewportSize + * @param {es3fMultisampleTests.FboParams} fboParams + */ + es3fMultisampleTests.MultisampleCase = function(name, desc, desiredViewportSize, fboParams) { + tcuTestCase.DeqpTest.call(this, name, desc); + /** @type {number} */ this.m_numSamples = 0; + /** @type {number} */ this.m_viewportSize = 0; + /** @type {number} */ this.m_desiredViewportSize = desiredViewportSize; + /** @type {es3fMultisampleTests.FboParams} */ this.m_fboParams = fboParams; + /** @type {WebGLRenderbuffer} */ this.m_msColorRbo = null; + /** @type {WebGLRenderbuffer} */ this.m_msDepthStencilRbo = null; + /** @type {WebGLRenderbuffer} */ this.m_resolveColorRbo = null; + /** @type {WebGLFramebuffer} */ this.m_msFbo = null; + /** @type {WebGLFramebuffer} */ this.m_resolveFbo = null; + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {number} */ this.m_attrPositionLoc = -1; + /** @type {number} */ this.m_attrColorLoc = -1; + /** @type {number} */ this.m_renderWidth = fboParams.useFbo ? 2 * desiredViewportSize : gl.drawingBufferWidth; + /** @type {number} */ this.m_renderHeight = fboParams.useFbo ? 2 * desiredViewportSize : gl.drawingBufferHeight; + /** @type {number} */ this.m_viewportX = 0; + /** @type {number} */ this.m_viewportY = 0; + /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name)); + if (this.m_fboParams.useFbo) + assertMsgOptions(this.m_fboParams.numSamples >= 0, 'fboParams.numSamples < 0', false, true); + }; + + es3fMultisampleTests.MultisampleCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.MultisampleCase.prototype.constructor = es3fMultisampleTests.MultisampleCase; + + /* Rest states */ + es3fMultisampleTests.MultisampleCase.prototype.deinit = function() { + gl.colorMask(true, true, true, true); + gl.depthMask(true); + + gl.clearColor(0.0, 0.0, 0.0, 0.0); + gl.clearDepth(1.0); + gl.clearStencil(0); + + gl.disable(gl.STENCIL_TEST); + gl.disable(gl.DEPTH_TEST); + gl.disable(gl.BLEND) + gl.disable(gl.SAMPLE_COVERAGE); + gl.disable(gl.SAMPLE_ALPHA_TO_COVERAGE); + + if (this.m_program) { + gl.deleteProgram(this.m_program.getProgram()); + this.m_program = null; + } + if (this.m_msColorRbo) { + gl.deleteRenderbuffer(this.m_msColorRbo); + this.m_msColorRbo = null; + } + if (this.m_msDepthStencilRbo) { + gl.deleteRenderbuffer(this.m_msDepthStencilRbo); + this.m_msDepthStencilRbo = null; + } + if (this.m_resolveColorRbo) { + gl.deleteRenderbuffer(this.m_resolveColorRbo); + this.m_resolveColorRbo = null; + } + + if (this.m_msFbo) { + gl.deleteFramebuffer(this.m_msFbo); + this.m_msFbo = null; + } + if (this.m_resolveFbo) { + gl.deleteFramebuffer(this.m_resolveFbo); + this.m_resolveFbo = null; + } + + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + } + + /** + * @protected + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} c0 + * @param {Array} c1 + * @param {Array} c2 + */ + es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec3cAsVec4 = function(p0, p1, p2, c0, c1, c2) { + /** @type {Array} */ var vertexPositions = [ + p0[0], p0[1], p0[2], 1.0, + p1[0], p1[1], p1[2], 1.0, + p2[0], p2[1], p2[2], 1.0 + ]; + /** @type {Array} */ var vertexColors = [ + c0[0], c0[1], c0[2], c0[3], + c1[0], c1[1], c1[2], c1[3], + c2[0], c2[1], c2[2], c2[3] + ]; + + var posGLBuffer = gl.createBuffer(); + /** @type {ArrayBufferView} */ var posBuffer = new Float32Array(vertexPositions); + gl.bindBuffer(gl.ARRAY_BUFFER, posGLBuffer); + gl.bufferData(gl.ARRAY_BUFFER, posBuffer, gl.STATIC_DRAW); + + gl.enableVertexAttribArray(this.m_attrPositionLoc); + gl.vertexAttribPointer(this.m_attrPositionLoc, 4, gl.FLOAT, false, 0, 0); + + var colGLBuffer = gl.createBuffer(); + /** @type {ArrayBufferView} */ var colBuffer = new Float32Array(vertexColors); + gl.bindBuffer(gl.ARRAY_BUFFER, colGLBuffer); + gl.bufferData(gl.ARRAY_BUFFER, colBuffer, gl.STATIC_DRAW); + + gl.enableVertexAttribArray(this.m_attrColorLoc); + gl.vertexAttribPointer(this.m_attrColorLoc, 4, gl.FLOAT, false, 0, 0); + + gl.useProgram(this.m_program.getProgram()); + gl.drawArrays(gl.TRIANGLES, 0, 3); + + gl.bindBuffer(gl.ARRAY_BUFFER, null); + gl.deleteBuffer(colGLBuffer); + gl.deleteBuffer(posGLBuffer); + }; + + /** + * @protected + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} color + */ + es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec3WithColor = function(p0, p1, p2, color) { + this.renderTriangle_pAsVec3cAsVec4(p0, p1, p2, color, color, color); + }; + + /** + * @protected + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} c0 + * @param {Array} c1 + * @param {Array} c2 + */ + es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec2 = function(p0, p1, p2, c0, c1, c2) { + this.renderTriangle_pAsVec3cAsVec4( + [p0[0], p0[1], 0.0], + [p1[0], p1[1], 0.0], + [p2[0], p2[1], 0.0], + c0, c1, c2); + }; + + /** + * @protected + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} color + */ + es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec2WithColor = function(p0, p1, p2, color) { + this.renderTriangle_pAsVec2(p0, p1, p2, color, color, color); + }; + + /** + * @protected + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} p3 + * @param {Array} c0 + * @param {Array} c1 + * @param {Array} c2 + * @param {Array} c3 + */ + es3fMultisampleTests.MultisampleCase.prototype.renderQuad = function(p0, p1, p2, p3, c0, c1, c2, c3) { + this.renderTriangle_pAsVec2(p0, p1, p2, c0, c1, c2); + this.renderTriangle_pAsVec2(p2, p1, p3, c2, c1, c3); + }; + + /** + * @protected + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} p3 + * @param {Array} color + */ + es3fMultisampleTests.MultisampleCase.prototype.renderQuad_WithColor = function(p0, p1, p2, p3, color) { + this.renderQuad(p0, p1, p2, p3, color, color, color, color); + }; + + /** + * @protected + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} color + */ + es3fMultisampleTests.MultisampleCase.prototype.renderLine = function(p0, p1, color) { + /** @type {Array} */ var vertexPositions = [ + p0[0], p0[1], 0.0, 1.0, + p1[0], p1[1], 0.0, 1.0 + ]; + /** @type {Array} */ var vertexColors = [ + color[0], color[1], color[2], color[3], + color[0], color[1], color[2], color[3] + ]; + + var posGLBuffer = gl.createBuffer(); + /** @type {ArrayBufferView} */ var posBuffer = new Float32Array(vertexPositions); + gl.bindBuffer(gl.ARRAY_BUFFER, posGLBuffer); + gl.bufferData(gl.ARRAY_BUFFER, posBuffer, gl.STATIC_DRAW); + + gl.enableVertexAttribArray(this.m_attrPositionLoc); + gl.vertexAttribPointer(this.m_attrPositionLoc, 4, gl.FLOAT, false, 0, 0); + + var colGLBuffer = gl.createBuffer(); + /** @type {ArrayBufferView} */ var colBuffer = new Float32Array(vertexColors); + gl.bindBuffer(gl.ARRAY_BUFFER, colGLBuffer); + gl.bufferData(gl.ARRAY_BUFFER, colBuffer, gl.STATIC_DRAW); + + gl.enableVertexAttribArray(this.m_attrColorLoc); + gl.vertexAttribPointer(this.m_attrColorLoc, 4, gl.FLOAT, false, 0, 0); + + gl.useProgram(this.m_program.getProgram()); + gl.drawArrays(gl.LINES, 0, 2); + + gl.bindBuffer(gl.ARRAY_BUFFER, null); + gl.deleteBuffer(colGLBuffer); + gl.deleteBuffer(posGLBuffer); + }; + + /** + * @protected + */ + es3fMultisampleTests.MultisampleCase.prototype.randomizeViewport = function() { + this.m_viewportX = this.m_rnd.getInt(0, this.m_renderWidth - this.m_viewportSize); + this.m_viewportY = this.m_rnd.getInt(0, this.m_renderHeight - this.m_viewportSize); + + gl.viewport(this.m_viewportX, this.m_viewportY, this.m_viewportSize, this.m_viewportSize); + }; + + /** + * @protected + * @return {tcuSurface.Surface} + */ + es3fMultisampleTests.MultisampleCase.prototype.readImage = function() { + /** @type {tcuSurface.Surface} */ + var dst = new tcuSurface.Surface(this.m_viewportSize, this.m_viewportSize); + /** @type {number} */ var pixelSize = dst.getAccess().getFormat().getPixelSize(); + /** @type {number} */ var param = deMath.deIsPowerOfTwo32(pixelSize) ? Math.min(pixelSize, 8) : 1; + /** @type {gluTextureUtil.TransferFormat} */ var format = gluTextureUtil.getTransferFormat(dst.getAccess().getFormat()); + /** @type {number} */ var width = dst.getAccess().getWidth(); + /** @type {number} */ var height = dst.getAccess().getHeight(); + if (this.m_fboParams.useFbo) { + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this.m_resolveFbo); + gl.blitFramebuffer(0, 0, this.m_renderWidth, this.m_renderHeight, 0, 0, this.m_renderWidth, this.m_renderHeight, gl.COLOR_BUFFER_BIT, gl.NEAREST); + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this.m_resolveFbo); + + gl.pixelStorei(gl.PACK_ALIGNMENT, param); + gl.readPixels(this.m_viewportX, this.m_viewportY, width, height, format.format, format.dataType, dst.getAccess().getDataPtr()); + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_msFbo); + } + else { + gl.pixelStorei(gl.PACK_ALIGNMENT, param); + gl.readPixels(this.m_viewportX, this.m_viewportY, width, height, format.format, format.dataType, dst.getAccess().getDataPtr()); + } + return dst; + }; + + es3fMultisampleTests.MultisampleCase.prototype.init = function() { + /** @type {string} */ var vertShaderSource = '' + + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in mediump vec4 a_color;\n' + + 'out mediump vec4 v_color;\n' + + 'void main()\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_color = a_color;\n' + + '}\n'; + + /** @type {string} */ var fragShaderSource = '' + + '#version 300 es\n' + + 'in mediump vec4 v_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main()\n' + + '{\n' + + ' o_color = v_color;\n' + + '}\n'; + + var numSamples = /** @type {number} */ (gl.getParameter(gl.SAMPLES)); + if (!this.m_fboParams.useFbo && numSamples <= 1) { + var msg = 'No multisample buffers'; + checkMessage(false, msg); + return false; + } + + if (this.m_fboParams.useFbo) { + if (this.m_fboParams.numSamples > 0) + this.m_numSamples = this.m_fboParams.numSamples; + else { + bufferedLogToConsole('Querying maximum number of samples for ' + gluStrUtil.getPixelFormatName(gl.RGBA8) + ' with gl.getInternalformatParameter()'); + var supportedSampleCountArray = /** @type {Int32Array} */ (gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES)); + if (supportedSampleCountArray.length == 0) { + var msg = 'No supported sample counts'; + checkMessage(false, msg); + return false; + } + this.m_numSamples = supportedSampleCountArray[0]; + } + + bufferedLogToConsole('Using FBO of size (' + this.m_renderWidth + ', ' + this.m_renderHeight + ') with ' + this.m_numSamples + ' samples'); + } + else { + // Query and log number of samples per pixel. + this.m_numSamples = numSamples; + bufferedLogToConsole('gl.SAMPLES =' + this.m_numSamples); + } + + // Prepare program. + + assertMsgOptions(!this.m_program, 'Program loaded when it should not be.', false, true); + + this.m_program = new gluShaderProgram.ShaderProgram( + gl, + gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource)); + + if (!this.m_program.isOk()) + throw new Error('Failed to compile program'); + + this.m_attrPositionLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + this.m_attrColorLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_color'); + + if (this.m_attrPositionLoc < 0 || this.m_attrColorLoc < 0) { + this.m_program = null; + throw new Error('Invalid attribute locations'); + } + + if (this.m_fboParams.useFbo) { + // Setup ms color RBO. + this.m_msColorRbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_msColorRbo); + + // If glRenderbufferStorageMultisample() fails, check if it's because of a too high sample count. + // \note We don't do the check until now because some implementations can't handle the gl.SAMPLES query with glGetInternalformativ(), + // and we don't want that to be the cause of test case failure. + try { + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, gl.RGBA8, this.m_renderWidth, this.m_renderHeight); + } + catch (e) { + /** @type {Int32Array} */ var supportedSampleCountArray = /** @type {Int32Array} */ (gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES)); + var maxSampleCount = supportedSampleCountArray[0]; + if (maxSampleCount < this.m_numSamples) + throw new Error('Maximum sample count returned by gl.getInternalformatParameter() for ' + gluStrUtil.getPixelFormatName(gl.RGBA8) + ' is only ' + maxSampleCount); + else + throw new Error('Unspecified error.'); + } + + if (this.m_fboParams.useDepth || this.m_fboParams.useStencil) { + // Setup ms depth & stencil RBO. + this.m_msDepthStencilRbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_msDepthStencilRbo); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, gl.DEPTH24_STENCIL8, this.m_renderWidth, this.m_renderHeight); + } + + // Setup ms FBO. + this.m_msFbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_msFbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_msColorRbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.m_msDepthStencilRbo); + + // Setup resolve color RBO. + this.m_resolveColorRbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_resolveColorRbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, this.m_renderWidth, this.m_renderHeight); + + // Setup resolve FBO. + this.m_resolveFbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_resolveFbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_resolveColorRbo); + + // Use ms FBO. + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_msFbo); + } + + // Get suitable viewport size. + + this.m_viewportSize = Math.min(this.m_desiredViewportSize, this.m_renderWidth, this.m_renderHeight); + this.randomizeViewport(); + return true; + }; + + /** + * Base class for cases testing the value of sample count. + * + * Draws a test pattern (defined by renderPattern() of an inheriting class) + * and counts the number of distinct colors in the resulting image. That + * number should be at least the value of sample count plus one. This is + * repeated with increased values of m_currentIteration until this correct + * number of colors is detected or m_currentIteration reaches + * m_maxNumIterations. + * + * @extends {es3fMultisampleTests.MultisampleCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fMultisampleTests.FboParams} fboParams + */ + es3fMultisampleTests.NumSamplesCase = function(name, desc, fboParams) { + es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, fboParams); + /** @type {number} */ var DEFAULT_MAX_NUM_ITERATIONS = 16; + /** @type {number} */ this.m_currentIteration = 0; + /** @type {number} */ this.m_maxNumIterations = es3fMultisampleTests.getIterationCount(DEFAULT_MAX_NUM_ITERATIONS); + /** @type {Array} */ this.m_detectedColors = []; + }; + + es3fMultisampleTests.NumSamplesCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.NumSamplesCase.prototype.constructor = es3fMultisampleTests.NumSamplesCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fMultisampleTests.NumSamplesCase.prototype.iterate = function() { + this.randomizeViewport(); + + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + this.renderPattern(); + + // Read and log rendered image. + + /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage(); + tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess()); + + // Detect new, previously unseen colors from image. + + /** @type {number} */ var requiredNumDistinctColors = this.m_numSamples + 1; + + for (var y = 0; y < renderedImg.getHeight() && this.m_detectedColors.length < requiredNumDistinctColors; y++) + for (var x = 0; x < renderedImg.getWidth() && this.m_detectedColors.length < requiredNumDistinctColors; x++) { + /** @type {tcuRGBA.RGBA} */ var color = new tcuRGBA.RGBA(renderedImg.getPixel(x, y)); + + /** @type {number} */ var i; + for (i = 0; i < this.m_detectedColors.length; i++) { + if (tcuRGBA.compareThreshold(color, this.m_detectedColors[i], tcuRGBA.newRGBAComponents(3, 3, 3, 3))) + break; + } + + if (i === this.m_detectedColors.length) + this.m_detectedColors.push(color); // Color not previously detected. + } + + // Log results. + + bufferedLogToConsole('Number of distinct colors detected so far: ' + (this.m_detectedColors.length >= requiredNumDistinctColors ? 'at least ' : '') + this.m_detectedColors.length); + + + if (this.m_detectedColors.length < requiredNumDistinctColors) { + // Haven't detected enough different colors yet. + + this.m_currentIteration++; + + if (this.m_currentIteration >= this.m_maxNumIterations) { + testFailedOptions('Failure: Number of distinct colors detected is lower than sample count+1', false); + return tcuTestCase.IterateResult.STOP; + } + else { + bufferedLogToConsole('The number of distinct colors detected is lower than sample count+1 - trying again with a slightly altered pattern'); + return tcuTestCase.IterateResult.CONTINUE; + } + } + else { + testPassedOptions('Success: The number of distinct colors detected is at least sample count+1', true); + return tcuTestCase.IterateResult.STOP; + } + }; + + /** + * @extends {es3fMultisampleTests.NumSamplesCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {number=} numFboSamples + */ + es3fMultisampleTests.PolygonNumSamplesCase = function(name, desc, numFboSamples) { + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams(); + es3fMultisampleTests.NumSamplesCase.call(this, name, desc, params); + }; + + es3fMultisampleTests.PolygonNumSamplesCase.prototype = Object.create(es3fMultisampleTests.NumSamplesCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.PolygonNumSamplesCase.prototype.constructor = es3fMultisampleTests.PolygonNumSamplesCase; + + es3fMultisampleTests.PolygonNumSamplesCase.prototype.renderPattern = function() { + // The test pattern consists of several triangles with edges at different angles. + + /** @type {number} */ var numTriangles = 25; + for (var i = 0; i < numTriangles; i++) { + /** @type {number} */ var angle0 = 2.0 * Math.PI * i / numTriangles + 0.001 * this.m_currentIteration; + /** @type {number} */ var angle1 = 2.0 * Math.PI * (i + 0.5) / numTriangles + 0.001 * this.m_currentIteration; + + this.renderTriangle_pAsVec2WithColor( + [0.0, 0.0], + [Math.cos(angle0) * 0.95, Math.sin(angle0) * 0.95], + [Math.cos(angle1) * 0.95, Math.sin(angle1) * 0.95], + [1.0, 1.0, 1.0, 1.0]); + } + }; + + /** + * @extends {es3fMultisampleTests.NumSamplesCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {number=} numFboSamples + */ + es3fMultisampleTests.LineNumSamplesCase = function(name, desc, numFboSamples) { + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams(); + es3fMultisampleTests.NumSamplesCase.call(this, name, desc, params); + }; + + es3fMultisampleTests.LineNumSamplesCase.prototype = Object.create(es3fMultisampleTests.NumSamplesCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.LineNumSamplesCase.prototype.constructor = es3fMultisampleTests.LineNumSamplesCase; + + es3fMultisampleTests.LineNumSamplesCase.prototype.renderPattern = function() { + // The test pattern consists of several lines at different angles. + + // We scale the number of lines based on the viewport size. This is because a gl line's thickness is + // constant in pixel units, i.e. they get relatively thicker as viewport size decreases. Thus we must + // decrease the number of lines in order to decrease the extent of overlap among the lines in the + // center of the pattern. + /** @type {number} */ var numLines = Math.floor(100.0 * Math.sqrt(this.m_viewportSize / 256.0)); + + for (var i = 0; i < numLines; i++) { + /** @type {number} */ var angle = 2.0 * Math.PI * i / numLines + 0.001 * this.m_currentIteration; + this.renderLine([0.0, 0.0], [Math.cos(angle) * 0.95, Math.sin(angle) * 0.95], [1.0, 1.0, 1.0, 1.0]); + } + }; + + /** + * Case testing behaviour of common edges when multisampling. + * + * Draws a number of test patterns, each with a number of quads, each made + * of two triangles, rotated at different angles. The inner edge inside the + * quad (i.e. the common edge of the two triangles) still should not be + * visible, despite multisampling - i.e. the two triangles forming the quad + * should never get any common coverage bits in any pixel. + * + * @extends {es3fMultisampleTests.MultisampleCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fMultisampleTests.CommonEdgeCase.CaseType} caseType + * @param {number} numFboSamples + */ + es3fMultisampleTests.CommonEdgeCase = function(name, desc, caseType, numFboSamples) { + /** @type {number} */ var cases = caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS ? 128 : 32; + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams(); + + es3fMultisampleTests.MultisampleCase.call(this, name, desc, cases, params); + /** @type {number} */ var DEFAULT_SMALL_QUADS_ITERATIONS = 16; + /** @type {number} */ var DEFAULT_BIGGER_THAN_VIEWPORT_QUAD_ITERATIONS = 64; // 8*8 + /** @type {es3fMultisampleTests.CommonEdgeCase.CaseType} */ this.m_caseType = caseType; + /** @type {number} */ this.m_currentIteration = 0; + /** @type {number} */ + this.m_numIterations = caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS ? es3fMultisampleTests.getIterationCount(DEFAULT_SMALL_QUADS_ITERATIONS) : + caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.BIGGER_THAN_VIEWPORT_QUAD ? es3fMultisampleTests.getIterationCount(DEFAULT_BIGGER_THAN_VIEWPORT_QUAD_ITERATIONS) : + 8; + }; + + es3fMultisampleTests.CommonEdgeCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.CommonEdgeCase.prototype.constructor = es3fMultisampleTests.CommonEdgeCase; + + /** + * @enum {number} + */ + es3fMultisampleTests.CommonEdgeCase.CaseType = { + SMALL_QUADS: 0, //!< Draw several small quads per iteration. + BIGGER_THAN_VIEWPORT_QUAD: 1, //!< Draw one bigger-than-viewport quad per iteration. + FIT_VIEWPORT_QUAD: 2 //!< Draw one exactly viewport-sized, axis aligned quad per iteration. + }; + + es3fMultisampleTests.CommonEdgeCase.prototype.init = function() { + var inited = es3fMultisampleTests.MultisampleCase.prototype.init.call(this); + if (!inited) { + return false; + } + + if (this.m_caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS) { + // Check for a big enough viewport. With too small viewports the test case can't analyze the resulting image well enough. + + /** @type {number} */ var minViewportSize = 32; + + if (this.m_viewportSize < minViewportSize) + throw new Error('Render target width or height too low (is ' + this.m_viewportSize + ', should be at least ' + minViewportSize + ')'); + } + + gl.enable(gl.BLEND); + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE); + bufferedLogToConsole('Additive blending enabled in order to detect (erroneously) overlapping samples'); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fMultisampleTests.CommonEdgeCase.prototype.iterate = function() { + /** @type {tcuSurface.Surface} */ var errorImg = new tcuSurface.Surface(this.m_viewportSize, this.m_viewportSize); + + this.randomizeViewport(); + + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + // Draw test pattern. Test patterns consist of quads formed with two triangles. + // After drawing the pattern, we check that the interior pixels of each quad are + // all the same color - this is meant to verify that there are no artifacts on the inner edge. + + /** @type {Array} */ var unicoloredRegions = []; + + /** @type {Array>} */ var corners; + /** @type {number} */ var angleCos; + /** @type {number} */ var angleSin; + /** @type {number} */ var angle; + /** @type {number} */ var quadDiagLen; + /** @type {number} */ var unicolorRegionScale; + /** @type {number} */ var quadBaseAngleNdx + /** @type {number} */ var quadSubAngleNdx; + + if (this.m_caseType == es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS) { + // Draw several quads, rotated at different angles. + + quadDiagLen = 2.0 / 3.0 * 0.9; // \note Fit 3 quads in both x and y directions. + + + // \note First and second iteration get exact 0 (and 90, 180, 270) and 45 (and 135, 225, 315) angle quads, as they are kind of a special case. + + if (this.m_currentIteration === 0) { + angleCos = 1.0; + angleSin = 0.0; + } + else if (this.m_currentIteration === 1) { + angleCos = Math.SQRT1_2; + angleSin = Math.SQRT1_2; + } + else { + angle = 0.5 * Math.PI * (this.m_currentIteration - 1) / (this.m_numIterations - 1); + angleCos = Math.cos(angle); + angleSin = Math.sin(angle); + } + + corners = [ + deMath.scale([angleCos, angleSin], 0.5 * quadDiagLen), + deMath.scale([-angleSin, angleCos], 0.5 * quadDiagLen), + deMath.scale([-angleCos, -angleSin], 0.5 * quadDiagLen), + deMath.scale([angleSin, -angleCos], 0.5 * quadDiagLen) + ]; + + // Draw 8 quads. + // First four are rotated at angles angle+0, angle+90, angle+180 and angle+270. + // Last four are rotated the same angles as the first four, but the ordering of the last triangle's vertices is reversed. + + for (var quadNdx = 0; quadNdx < 8; quadNdx++) { + /** @type {Array} */ + var center = deMath.addScalar( + deMath.scale([quadNdx % 3, quadNdx / 3], (2.0 - quadDiagLen)/ 2.0), + (-0.5 * (2.0 - quadDiagLen))); + + this.renderTriangle_pAsVec2WithColor( + deMath.add(corners[(0 + quadNdx) % 4], center), + deMath.add(corners[(1 + quadNdx) % 4], center), + deMath.add(corners[(2 + quadNdx) % 4], center), + [0.5, 0.5, 0.5, 1.0]); + + if (quadNdx >= 4) { + this.renderTriangle_pAsVec2WithColor( + deMath.add(corners[(3 + quadNdx) % 4], center), + deMath.add(corners[(2 + quadNdx) % 4], center), + deMath.add(corners[(0 + quadNdx) % 4], center), + [0.5, 0.5, 0.5, 1.0]); + } + else { + this.renderTriangle_pAsVec2WithColor( + deMath.add(corners[(0 + quadNdx) % 4], center), + deMath.add(corners[(2 + quadNdx) % 4], center), + deMath.add(corners[(3 + quadNdx) % 4], center), + [0.5, 0.5, 0.5, 1.0]); + } + + // The size of the 'interior' of a quad is assumed to be approximately unicolorRegionScale*. + // By 'interior' we here mean the region of non-boundary pixels of the rendered quad for which we can safely assume + // that it has all coverage bits set to 1, for every pixel. + unicolorRegionScale = 1.0 - 6.0 * 2.0 / this.m_viewportSize / quadDiagLen; + unicoloredRegions.push( + new es3fMultisampleTests.QuadCorners( + deMath.add(center, deMath.scale(corners[0], unicolorRegionScale)), + deMath.add(center, deMath.scale(corners[1], unicolorRegionScale)), + deMath.add(center, deMath.scale(corners[2], unicolorRegionScale)), + deMath.add(center, deMath.scale(corners[3], unicolorRegionScale)))); + } + } + else if (this.m_caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.BIGGER_THAN_VIEWPORT_QUAD) { + // Draw a bigger-than-viewport quad, rotated at an angle depending on m_currentIteration. + + quadBaseAngleNdx = Math.floor(this.m_currentIteration / 8); + quadSubAngleNdx = this.m_currentIteration % 8; + + if (quadBaseAngleNdx === 0) { + angleCos = 1.0; + angleSin = 0.0; + } + else if (quadBaseAngleNdx === 1) { + angleCos = Math.SQRT1_2; + angleSin = Math.SQRT1_2; + } + else { + angle = 0.5 * Math.PI * (this.m_currentIteration - 1) / (this.m_numIterations - 1); + angleCos = Math.cos(angle); + angleSin = Math.sin(angle); + } + + quadDiagLen = 2.5 / Math.max(angleCos, angleSin); + + corners = [ + deMath.scale([angleCos, angleSin], 0.5 * quadDiagLen), + deMath.scale([-angleSin, angleCos], 0.5 * quadDiagLen), + deMath.scale([-angleCos, -angleSin], 0.5 * quadDiagLen), + deMath.scale([angleSin, -angleCos], 0.5 * quadDiagLen) + ]; + + this.renderTriangle_pAsVec2WithColor( + corners[(0 + quadSubAngleNdx) % 4], + corners[(1 + quadSubAngleNdx) % 4], + corners[(2 + quadSubAngleNdx) % 4], + [0.5, 0.5, 0.5, 1.0]); + + if (quadSubAngleNdx >= 4) { + this.renderTriangle_pAsVec2WithColor( + corners[(3 + quadSubAngleNdx) % 4], + corners[(2 + quadSubAngleNdx) % 4], + corners[(0 + quadSubAngleNdx) % 4], + [0.5, 0.5, 0.5, 1.0]); + } + else { + this.renderTriangle_pAsVec2WithColor( + corners[(0 + quadSubAngleNdx) % 4], + corners[(2 + quadSubAngleNdx) % 4], + corners[(3 + quadSubAngleNdx) % 4], + [0.5, 0.5, 0.5, 1.0]); + } + + unicolorRegionScale = 1.0 - 6.0 * 2.0 / this.m_viewportSize / quadDiagLen; + unicoloredRegions.push( + new es3fMultisampleTests.QuadCorners( + deMath.scale(corners[0], unicolorRegionScale), + deMath.scale(corners[1], unicolorRegionScale), + deMath.scale(corners[2], unicolorRegionScale), + deMath.scale(corners[3], unicolorRegionScale))); + } + else if (this.m_caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.FIT_VIEWPORT_QUAD) { + // Draw an exactly viewport-sized quad, rotated by multiples of 90 degrees angle depending on m_currentIteration. + + quadSubAngleNdx = this.m_currentIteration % 8; + + corners = [ + [1.0, 1.0], + [-1.0, 1.0], + [-1.0, -1.0], + [1.0, -1.0] + ]; + + this.renderTriangle_pAsVec2WithColor( + corners[(0 + quadSubAngleNdx) % 4], + corners[(1 + quadSubAngleNdx) % 4], + corners[(2 + quadSubAngleNdx) % 4], + [0.5, 0.5, 0.5, 1.0]); + + if (quadSubAngleNdx >= 4) { + this.renderTriangle_pAsVec2WithColor( + corners[(3 + quadSubAngleNdx) % 4], + corners[(2 + quadSubAngleNdx) % 4], + corners[(0 + quadSubAngleNdx) % 4], + [0.5, 0.5, 0.5, 1.0]); + } + else { + this.renderTriangle_pAsVec2WithColor( + corners[(0 + quadSubAngleNdx) % 4], + corners[(2 + quadSubAngleNdx) % 4], + corners[(3 + quadSubAngleNdx) % 4], + [0.5, 0.5, 0.5, 1.0]); + } + + unicoloredRegions.push(new es3fMultisampleTests.QuadCorners(corners[0], corners[1], corners[2], corners[3])); + } + else + throw new Error('CaseType not supported.'); + + // Read pixels and check unicolored regions. + + /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage(); + + errorImg.getAccess().clear([0.0, 1.0, 0.0, 1.0]); + tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess()); + + /** @type {boolean} */ var errorsDetected = false; + for (var i = 0; i < unicoloredRegions.length; i++) { + /** @type {es3fMultisampleTests.QuadCorners} */ var region = unicoloredRegions[i]; + /** @type {Array} */ var p0Win = deMath.scale(deMath.addScalar(region.p0, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5); + /** @type {Array} */ var p1Win = deMath.scale(deMath.addScalar(region.p1, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5); + /** @type {Array} */ var p2Win = deMath.scale(deMath.addScalar(region.p2, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5); + /** @type {Array} */ var p3Win = deMath.scale(deMath.addScalar(region.p3, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5); + /** @type {boolean} */ var errorsInCurrentRegion = !es3fMultisampleTests.isPixelRegionUnicolored(renderedImg, p0Win, p1Win, p2Win, p3Win); + + if (errorsInCurrentRegion) + es3fMultisampleTests.drawUnicolorTestErrors(renderedImg, errorImg.getAccess(), p0Win, p1Win, p2Win, p3Win); + + errorsDetected = errorsDetected || errorsInCurrentRegion; + } + + this.m_currentIteration++; + + if (errorsDetected) { + bufferedLogToConsole('Failure: Not all quad interiors seem unicolored - common-edge artifacts?'); + bufferedLogToConsole('Erroneous pixels are drawn red in the following image'); + tcuLogImage.logImage('RenderedImageWithErrors', 'Rendered image with errors marked', renderedImg.getAccess()); + tcuLogImage.logImage('ErrorsOnly', 'Image with error pixels only', errorImg.getAccess()); + testFailedOptions('Failed: iteration ' + (this.m_currentIteration - 1), false); + return tcuTestCase.IterateResult.STOP; + } + else if (this.m_currentIteration < this.m_numIterations) { + bufferedLogToConsole('Quads seem OK - moving on to next pattern'); + return tcuTestCase.IterateResult.CONTINUE; + } + else { + bufferedLogToConsole('Success: All quad interiors seem unicolored (no common-edge artifacts)'); + testPassedOptions('Passed: iteration ' + (this.m_currentIteration - 1), true); + return tcuTestCase.IterateResult.STOP; + } + }; + + /** + * Test that depth values are per-sample. + * + * Draws intersecting, differently-colored polygons and checks that there + * are at least sample count+1 distinct colors present, due to some of the + * samples at the intersection line belonging to one and some to another + * polygon. + * + * @extends {es3fMultisampleTests.NumSamplesCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {number=} numFboSamples + */ + es3fMultisampleTests.SampleDepthCase = function(name, desc, numFboSamples) { + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, true, false) : new es3fMultisampleTests.FboParams(); + es3fMultisampleTests.NumSamplesCase.call(this, name, desc, params); + }; + + es3fMultisampleTests.SampleDepthCase.prototype = Object.create(es3fMultisampleTests.NumSamplesCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.SampleDepthCase.prototype.constructor = es3fMultisampleTests.SampleDepthCase; + + es3fMultisampleTests.SampleDepthCase.prototype.init = function() { + var inited = es3fMultisampleTests.MultisampleCase.prototype.init.call(this); + if (!inited) { + return false; + } + + gl.enable(gl.DEPTH_TEST); + gl.depthFunc(gl.LESS); + + bufferedLogToConsole('Depth test enabled, depth func is gl.LESS'); + bufferedLogToConsole('Drawing several bigger-than-viewport black or white polygons intersecting each other'); + }; + + es3fMultisampleTests.SampleDepthCase.prototype.renderPattern = function() { + gl.clearColor(0.0, 0.0, 0.0, 0.0); + gl.clearDepth(1.0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + + /** @type {number} */ var numPolygons = 50; + + for (var i = 0; i < numPolygons; i++) { + /** @type {Array} */ var color = i % 2 == 0 ? [1.0, 1.0, 1.0, 1.0] : [0.0, 0.0, 0.0, 1.0]; + /** @type {number} */ var angle = 2.0 * Math.PI * i / numPolygons + 0.001 * this.m_currentIteration; + /** @type {Array} */ var pt0 = [3.0 * Math.cos(angle + 2.0 * Math.PI * 0.0 / 3.0), 3.0 * Math.sin(angle + 2.0 * Math.PI * 0.0 / 3.0), 1.0]; + /** @type {Array} */ var pt1 = [3.0 * Math.cos(angle + 2.0 * Math.PI * 1.0 / 3.0), 3.0 * Math.sin(angle + 2.0 * Math.PI * 1.0 / 3.0), 0.0]; + /** @type {Array} */ var pt2 = [3.0 * Math.cos(angle + 2.0 * Math.PI * 2.0 / 3.0), 3.0 * Math.sin(angle + 2.0 * Math.PI * 2.0 / 3.0), 0.0]; + + this.renderTriangle_pAsVec3WithColor(pt0, pt1, pt2, color); + } + }; + + /** + * Test that stencil buffer values are per-sample. + * + * Draws a unicolored pattern and marks drawn samples in stencil buffer; + * then clears and draws a viewport-size quad with that color and with + * proper stencil test such that the resulting image should be exactly the + * same as after the pattern was first drawn. + * + * @extends {es3fMultisampleTests.MultisampleCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {number=} numFboSamples + */ + es3fMultisampleTests.SampleStencilCase = function(name, desc, numFboSamples) { + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, true) : new es3fMultisampleTests.FboParams(); + es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, params); + }; + + es3fMultisampleTests.SampleStencilCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.SampleStencilCase.prototype.constructor = es3fMultisampleTests.SampleStencilCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fMultisampleTests.SampleStencilCase.prototype.iterate = function() { + this.randomizeViewport(); + + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.clearStencil(0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + gl.enable(gl.STENCIL_TEST); + gl.stencilFunc(gl.ALWAYS, 1, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + + bufferedLogToConsole('Drawing a pattern with gl.stencilFunc(gl.ALWAYS, 1, 1) and gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE)'); + + /** @type {number} */ var numTriangles = 25; + for (var i = 0; i < numTriangles; i++) { + /** @type {number} */ var angle0 = 2.0 * Math.PI * i / numTriangles; + /** @type {number} */ var angle1 = 2.0 * Math.PI * (i + 0.5) / numTriangles; + + this.renderTriangle_pAsVec2WithColor( + [0.0, 0.0], + [Math.cos(angle0) * 0.95, Math.sin(angle0) * 0.95], + [Math.cos(angle1) * 0.95, Math.sin(angle1) * 0.95], + [1.0, 1.0, 1.0, 1.0]); + } + + /** @type {tcuSurface.Surface} */ var renderedImgFirst = this.readImage(); + tcuLogImage.logImage('RenderedImgFirst', 'First image rendered', renderedImgFirst.getAccess()); + bufferedLogToConsole('Clearing color buffer to black'); + + gl.clear(gl.COLOR_BUFFER_BIT); + gl.stencilFunc(gl.EQUAL, 1, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + + bufferedLogToConsole('Checking that color buffer was actually cleared to black'); + + /** @type {tcuSurface.Surface} */ var clearedImg = this.readImage(); + + for (var y = 0; y < clearedImg.getHeight(); y++) + for (var x = 0; x < clearedImg.getWidth(); x++) { + /** @type {tcuRGBA.RGBA} */ var clr = new tcuRGBA.RGBA(clearedImg.getPixel(x, y)); + if (!clr.equals(tcuRGBA.RGBA.black)) { + bufferedLogToConsole('Failure: first non-black pixel, color ' + clr.toString() + ', detected at coordinates (' + x + ', ' + y + ')'); + tcuLogImage.logImage('ClearedImg', 'Image after clearing, erroneously non-black', clearedImg.getAccess()); + testFailedOptions('Failed', false); + return tcuTestCase.IterateResult.STOP; + } + } + + bufferedLogToConsole('Drawing a viewport-sized quad with gl.stencilFunc(gl.EQUAL, 1, 1) and gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP) - should result in same image as the first'); + + this.renderQuad_WithColor( + [-1.0, -1.0], + [1.0, -1.0], + [-1.0, 1.0], + [1.0, 1.0], + [1.0, 1.0, 1.0, 1.0]); + + /** @type {tcuSurface.Surface} */ var renderedImgSecond = this.readImage(); + tcuLogImage.logImage('RenderedImgSecond', 'Second image rendered', renderedImgSecond.getAccess()); + /** @type {boolean} */ + var passed = tcuImageCompare.pixelThresholdCompare( + 'ImageCompare', + 'Image comparison', + renderedImgFirst, + renderedImgSecond, + [0,0,0,0]); + + if (passed) { + bufferedLogToConsole('Success: The two images rendered are identical'); + testPassedOptions('Passed', true); + } + else + testFailedOptions('Failed', false); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * Tests coverage mask generation proportionality property. + * + * Tests that the number of coverage bits in a coverage mask created by + * gl.SAMPLE_ALPHA_TO_COVERAGE or gl.SAMPLE_COVERAGE is, on average, + * proportional to the alpha or coverage value, respectively. Draws + * multiple frames, each time increasing the alpha or coverage value used, + * and checks that the average color is changing appropriately. + * + * @extends {es3fMultisampleTests.MultisampleCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fMultisampleTests.MaskProportionalityCase.CaseType} type + * @param {number=} numFboSamples + */ + es3fMultisampleTests.MaskProportionalityCase = function(name, desc, type, numFboSamples) { + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams(); + es3fMultisampleTests.MultisampleCase.call(this, name, desc, 32, params); + /** @type {es3fMultisampleTests.MaskProportionalityCase.CaseType} */ this.m_type = type; + /** @type {number} */ this.m_numIterations; + /** @type {number} */ this.m_currentIteration = 0; + /** @type {number} */ this.m_previousIterationColorSum = -1; + }; + + es3fMultisampleTests.MaskProportionalityCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.MaskProportionalityCase.prototype.constructor = es3fMultisampleTests.MaskProportionalityCase; + + /** + * @enum {number} + */ + es3fMultisampleTests.MaskProportionalityCase.CaseType = { + ALPHA_TO_COVERAGE: 0, + SAMPLE_COVERAGE: 1, + SAMPLE_COVERAGE_INVERTED: 2 + }; + + es3fMultisampleTests.MaskProportionalityCase.prototype.init = function() { + var inited = es3fMultisampleTests.MultisampleCase.prototype.init.call(this); + if (!inited) { + return false; + } + + if (this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE) { + gl.enable(gl.SAMPLE_ALPHA_TO_COVERAGE); + bufferedLogToConsole('gl.SAMPLE_ALPHA_TO_COVERAGE is enabled'); + } + else { + assertMsgOptions( + this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE || + this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED, + 'CaseType should be SAMPLE_COVERAGE or SAMPLE_COVERAGE_INVERTED', false, true); + + gl.enable(gl.SAMPLE_COVERAGE); + bufferedLogToConsole('gl.SAMPLE_COVERAGE is enabled'); + } + + this.m_numIterations = Math.max(2, es3fMultisampleTests.getIterationCount(this.m_numSamples * 5)); + + this.randomizeViewport(); // \note Using the same viewport for every iteration since coverage mask may depend on window-relative pixel coordinate. + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fMultisampleTests.MaskProportionalityCase.prototype.iterate = function() { + bufferedLogToConsole('Clearing color to black'); + gl.colorMask(true, true, true, true); + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + if (this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE) { + gl.colorMask(true, true, true, false); + bufferedLogToConsole('Using color mask TRUE, TRUE, TRUE, FALSE'); + } + + // Draw quad. + + /** @type {Array} */ var pt0 = [-1.0, -1.0]; + /** @type {Array} */ var pt1 = [1.0, -1.0]; + /** @type {Array} */ var pt2 = [-1.0, 1.0]; + /** @type {Array} */ var pt3 = [1.0, 1.0]; + /** @type {Array} */ var quadColor = [1.0, 0.0, 0.0, 1.0]; + /** @type {number} */ var alphaOrCoverageValue = this.m_currentIteration / (this.m_numIterations-1); + + if (this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE) { + bufferedLogToConsole('Drawing a red quad using alpha value ' + alphaOrCoverageValue); + quadColor[3] = alphaOrCoverageValue; + } + else { + assertMsgOptions( + this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE || + this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED, + 'CaseType should be SAMPLE_COVERAGE or SAMPLE_COVERAGE_INVERTED', false, true); + + /** @type {boolean} */ var isInverted = (this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED); + /** @type {number} */ var coverageValue = isInverted ? 1.0 - alphaOrCoverageValue : alphaOrCoverageValue; + bufferedLogToConsole('Drawing a red quad using sample coverage value ' + coverageValue + (isInverted ? ' (inverted)' : '')); + gl.sampleCoverage(coverageValue, isInverted ? true : false); + } + + this.renderQuad_WithColor(pt0, pt1, pt2, pt3, quadColor); + + // Read and log image. + /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage(); + /** @type {number} */ var numPixels = renderedImg.getWidth() * renderedImg.getHeight(); + + tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess()); + // Compute average red component in rendered image. + + /** @type {number} */ var sumRed = 0; + + for (var y = 0; y < renderedImg.getHeight(); y++) + for (var x = 0; x < renderedImg.getWidth(); x++) + sumRed += new tcuRGBA.RGBA(renderedImg.getPixel(x, y)).getRed(); + + bufferedLogToConsole('Average red color component: ' + (sumRed / 255.0 / numPixels)); + + // Check if average color has decreased from previous frame's color. + + if (sumRed < this.m_previousIterationColorSum) { + bufferedLogToConsole('Failure: Current average red color component is lower than previous'); + testFailedOptions('Failed', false); + return tcuTestCase.IterateResult.STOP; + } + + // Check if coverage mask is not all-zeros if alpha or coverage value is 0 (or 1, if inverted). + + if (this.m_currentIteration == 0 && sumRed != 0) + { + bufferedLogToConsole('Failure: Image should be completely black'); + testFailedOptions('Failed', false); + return tcuTestCase.IterateResult.STOP; + } + + if (this.m_currentIteration == this.m_numIterations-1 && sumRed != 0xff*numPixels) + { + bufferedLogToConsole('Failure: Image should be completely red'); + + testFailedOptions('Failed', false); + return tcuTestCase.IterateResult.STOP; + } + + this.m_previousIterationColorSum = sumRed; + + this.m_currentIteration++; + + if (this.m_currentIteration >= this.m_numIterations) + { + bufferedLogToConsole('Success: Number of coverage mask bits set appears to be, on average, proportional to ' + + (this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE ? 'alpha' : + this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE ? 'sample coverage value' : + 'inverted sample coverage value')); + + testPassedOptions('Passed', true); + return tcuTestCase.IterateResult.STOP; + } + else + return tcuTestCase.IterateResult.CONTINUE; + }; + + /** + * Tests coverage mask generation constancy property. + * + * Tests that the coverage mask created by gl.SAMPLE_ALPHA_TO_COVERAGE or + * gl.SAMPLE_COVERAGE is constant at given pixel coordinates, with a given + * alpha component or coverage value, respectively. Draws two quads, with + * the second one fully overlapping the first one such that at any given + * pixel, both quads have the same alpha or coverage value. This way, if + * the constancy property is fulfilled, only the second quad should be + * visible. + * @extends {es3fMultisampleTests.MultisampleCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fMultisampleTests.MaskConstancyCase.CaseType} type + * @param {number=} numFboSamples + */ + es3fMultisampleTests.MaskConstancyCase = function(name, desc, type, numFboSamples) { + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams(); + es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, params); + var CaseType = es3fMultisampleTests.MaskConstancyCase.CaseType; + /** @type {boolean} */ this.m_isAlphaToCoverageCase = (type === CaseType.ALPHA_TO_COVERAGE || type === CaseType.BOTH || type === CaseType.BOTH_INVERTED); + /** @type {boolean} */ this.m_isSampleCoverageCase = (type === CaseType.SAMPLE_COVERAGE || type === CaseType.SAMPLE_COVERAGE_INVERTED || type === CaseType.BOTH || type === CaseType.BOTH_INVERTED); + /** @type {boolean} */ this.m_isInvertedSampleCoverageCase = (type === CaseType.SAMPLE_COVERAGE_INVERTED || type === CaseType.BOTH_INVERTED); + }; + + es3fMultisampleTests.MaskConstancyCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.MaskConstancyCase.prototype.constructor = es3fMultisampleTests.MaskConstancyCase; + + /** + * @enum {number} + */ + es3fMultisampleTests.MaskConstancyCase.CaseType = { + ALPHA_TO_COVERAGE: 0, //!< Use only alpha-to-coverage. + SAMPLE_COVERAGE: 1, //!< Use only sample coverage. + SAMPLE_COVERAGE_INVERTED: 2, //!< Use only inverted sample coverage. + BOTH: 3, //!< Use both alpha-to-coverage and sample coverage. + BOTH_INVERTED: 4 //!< Use both alpha-to-coverage and inverted sample coverage. + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fMultisampleTests.MaskConstancyCase.prototype.iterate = function() { + this.randomizeViewport(); + + bufferedLogToConsole('Clearing color to black'); + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + if (this.m_isAlphaToCoverageCase) { + gl.enable(gl.SAMPLE_ALPHA_TO_COVERAGE); + gl.colorMask(true, true, true, false); + bufferedLogToConsole('gl.SAMPLE_ALPHA_TO_COVERAGE is enabled'); + bufferedLogToConsole('Color mask is TRUE, TRUE, TRUE, FALSE'); + } + + if (this.m_isSampleCoverageCase) { + gl.enable(gl.SAMPLE_COVERAGE); + bufferedLogToConsole('gl.SAMPLE_COVERAGE is enabled'); + } + + bufferedLogToConsole('Drawing several green quads, each fully overlapped by a red quad with the same ' + + (this.m_isAlphaToCoverageCase ? 'alpha' : '') + + (this.m_isAlphaToCoverageCase && this.m_isSampleCoverageCase ? ' and ' : '') + + (this.m_isInvertedSampleCoverageCase ? 'inverted ' : '') + + (this.m_isSampleCoverageCase ? 'sample coverage' : '') + + ' values'); + + /** @type {number} */ var numQuadRowsCols = this.m_numSamples * 4; + + for (var row = 0; row < numQuadRowsCols; row++) { + for (var col = 0; col < numQuadRowsCols; col++) { + /** @type {number} */ var x0 = (col + 0) / numQuadRowsCols * 2.0 - 1.0; + /** @type {number} */ var x1 = (col + 1) / numQuadRowsCols * 2.0 - 1.0; + /** @type {number} */ var y0 = (row + 0) / numQuadRowsCols * 2.0 - 1.0; + /** @type {number} */ var y1 = (row + 1) / numQuadRowsCols * 2.0 - 1.0; + /** @type {Array} */ var baseGreen = [0.0, 1.0, 0.0, 0.0]; + /** @type {Array} */ var baseRed = [1.0, 0.0, 0.0, 0.0]; + /** @type {Array} */ var alpha0 = [0.0, 0.0, 0.0, this.m_isAlphaToCoverageCase ? col / (numQuadRowsCols - 1) : 1.0]; + /** @type {Array} */ var alpha1 = [0.0, 0.0, 0.0, this.m_isAlphaToCoverageCase ? row / (numQuadRowsCols - 1) : 1.0]; + + if (this.m_isSampleCoverageCase) { + /** @type {number} */ var value = (row*numQuadRowsCols + col) / (numQuadRowsCols*numQuadRowsCols - 1); + gl.sampleCoverage(this.m_isInvertedSampleCoverageCase ? 1.0 - value : value, this.m_isInvertedSampleCoverageCase ? true : false); + } + + this.renderQuad([x0, y0], [x1, y0], [x0, y1], [x1, y1], + deMath.add(baseGreen, alpha0), deMath.add(baseGreen, alpha1), + deMath.add(baseGreen, alpha0), deMath.add(baseGreen, alpha1)); + this.renderQuad([x0, y0], [x1, y0], [x0, y1], [x1, y1], + deMath.add(baseRed, alpha0), deMath.add(baseRed, alpha1), + deMath.add(baseRed, alpha0), deMath.add(baseRed, alpha1)); + } + } + + /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage(); + + tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess()); + for (var y = 0; y < renderedImg.getHeight(); y++) + for (var x = 0; x < renderedImg.getWidth(); x++) { + if (new tcuRGBA.RGBA(renderedImg.getPixel(x, y)).getGreen() > 0) { + bufferedLogToConsole('Failure: Non-zero green color component detected - should have been completely overwritten by red quad'); + testFailedOptions('Failed', false); + return tcuTestCase.IterateResult.STOP; + } + } + + bufferedLogToConsole('Success: Coverage mask appears to be constant at a given pixel coordinate with a given ' + + (this.m_isAlphaToCoverageCase ? 'alpha' : '') + + (this.m_isAlphaToCoverageCase && this.m_isSampleCoverageCase ? ' and ' : '') + + (this.m_isSampleCoverageCase ? 'coverage value' : '')); + + testPassedOptions('Passed', true); + + return tcuTestCase.IterateResult.STOP; + } + + + /** + * Tests coverage mask inversion validity. + * + * Tests that the coverage masks obtained by glSampleCoverage(..., true) + * and glSampleCoverage(..., false) are indeed each others' inverses. + * This is done by drawing a pattern, with varying coverage values, + * overlapped by a pattern that has inverted masks and is otherwise + * identical. The resulting image is compared to one obtained by drawing + * the same pattern but with all-ones coverage masks. + * @extends {es3fMultisampleTests.MultisampleCase} + * @constructor + * @param {string} name + * @param {string} desc + * @param {number=} numFboSamples + */ + es3fMultisampleTests.CoverageMaskInvertCase = function(name, desc, numFboSamples) { + numFboSamples = numFboSamples === undefined ? 0 : numFboSamples; + /** @type {es3fMultisampleTests.FboParams} */ + var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams(); + es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, params); + }; + + es3fMultisampleTests.CoverageMaskInvertCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype); + + /** Copy the constructor */ + es3fMultisampleTests.CoverageMaskInvertCase.prototype.constructor = es3fMultisampleTests.CoverageMaskInvertCase; + + /** + * @param {boolean} invertSampleCoverage + */ + es3fMultisampleTests.CoverageMaskInvertCase.prototype.drawPattern = function(invertSampleCoverage) { + /** @type {number} */ var numTriangles = 25; + for (var i = 0; i < numTriangles; i++) { + gl.sampleCoverage(i / (numTriangles - 1), invertSampleCoverage ? true : false); + + /** @type {number} */ var angle0 = 2.0 * Math.PI * i / numTriangles; + /** @type {number} */ var angle1 = 2.0 * Math.PI * (i + 0.5) / numTriangles; + + this.renderTriangle_pAsVec2WithColor( + [0.0, 0.0], + [Math.cos(angle0) * 0.95, Math.sin(angle0) * 0.95], + [Math.cos(angle1) * 0.95, Math.sin(angle1) * 0.95], + [0.4 + i / numTriangles * 0.6, + 0.5 + i / numTriangles * 0.3, + 0.6 - i / numTriangles * 0.5, + 0.7 - i / numTriangles * 0.7]); + } + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fMultisampleTests.CoverageMaskInvertCase.prototype.iterate = function() { + this.randomizeViewport(); + + gl.enable(gl.BLEND); + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE); + bufferedLogToConsole('Additive blending enabled in order to detect (erroneously) overlapping samples'); + + bufferedLogToConsole('Clearing color to all-zeros'); + gl.clearColor(0.0, 0.0, 0.0, 0.0); + gl.clear(gl.COLOR_BUFFER_BIT); + bufferedLogToConsole('Drawing the pattern with gl.SAMPLE_COVERAGE disabled'); + this.drawPattern(false); + /** @type {tcuSurface.Surface} */ var renderedImgNoSampleCoverage = this.readImage(); + + tcuLogImage.logImage('RenderedImageNoSampleCoverage', 'Rendered image with gl.SAMPLE_COVERAGE disabled', renderedImgNoSampleCoverage.getAccess()); + bufferedLogToConsole('Clearing color to all-zeros'); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.enable(gl.SAMPLE_COVERAGE); + bufferedLogToConsole('Drawing the pattern with gl.SAMPLE_COVERAGE enabled, using non-inverted masks'); + this.drawPattern(false); + bufferedLogToConsole('Drawing the pattern with gl.SAMPLE_COVERAGE enabled, using same sample coverage values but inverted masks'); + this.drawPattern(true); + /** @type {tcuSurface.Surface} */ var renderedImgSampleCoverage = this.readImage(); + + tcuLogImage.logImage('RenderedImageSampleCoverage', 'Rendered image with gl.SAMPLE_COVERAGE enabled', renderedImgSampleCoverage.getAccess()); + /** @type {boolean} */ var passed = tcuImageCompare.pixelThresholdCompare( + 'CoverageVsNoCoverage', + 'Comparison of same pattern with gl.SAMPLE_COVERAGE disabled and enabled', + renderedImgNoSampleCoverage, + renderedImgSampleCoverage, + [0, 0, 0, 0]); + + if (passed) { + bufferedLogToConsole('Success: The two images rendered are identical'); + testPassedOptions('Passed', true); + } + else { + testFailedOptions('Failed', false); + } + + return tcuTestCase.IterateResult.STOP; + }; + + es3fMultisampleTests.init = function() { + var testGroup = tcuTestCase.runner.testCases; + /** + * @enum {number} + */ + var CaseType = { + DEFAULT_FRAMEBUFFER: 0, + FBO_4_SAMPLES: 1, + FBO_8_SAMPLES: 2, + FBO_MAX_SAMPLES: 3 + }; + + for (var caseTypeI in CaseType) { + /** @type {CaseType} */ var caseType = CaseType[caseTypeI]; + /** @type {number} */ + var numFboSamples = caseType === CaseType.DEFAULT_FRAMEBUFFER ? -1 : + caseType === CaseType.FBO_4_SAMPLES ? 4 : + caseType === CaseType.FBO_8_SAMPLES ? 8 : + caseType === CaseType.FBO_MAX_SAMPLES ? 0 : + -2; + + /** @type {?string} */ + var name = caseType === CaseType.DEFAULT_FRAMEBUFFER ? 'default_framebuffer' : + caseType === CaseType.FBO_4_SAMPLES ? 'fbo_4_samples' : + caseType === CaseType.FBO_8_SAMPLES ? 'fbo_8_samples' : + caseType === CaseType.FBO_MAX_SAMPLES ? 'fbo_max_samples' : + null; + /** @type {?string} */ + var desc = caseType === CaseType.DEFAULT_FRAMEBUFFER ? 'Render into default framebuffer' : + caseType === CaseType.FBO_4_SAMPLES ? 'Render into a framebuffer object with 4 samples' : + caseType === CaseType.FBO_8_SAMPLES ? 'Render into a framebuffer object with 8 samples' : + caseType === CaseType.FBO_MAX_SAMPLES ? 'Render into a framebuffer object with the maximum number of samples' : + null; + + /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(name, desc); + + assertMsgOptions(group.name != null, 'Error: No Test Name', false, true); + assertMsgOptions(group.description != null, 'Error: No Test Description', false, true); + assertMsgOptions(numFboSamples >= -1, 'Assert Failed: numFboSamples >= -1', false, true); + testGroup.addChild(group); + + group.addChild(new es3fMultisampleTests.PolygonNumSamplesCase( + 'num_samples_polygon', + 'Test sanity of the sample count, with polygons', + numFboSamples)); + + group.addChild(new es3fMultisampleTests.LineNumSamplesCase( + 'num_samples_line', + 'Test sanity of the sample count, with lines', + numFboSamples)); + + group.addChild(new es3fMultisampleTests.CommonEdgeCase( + 'common_edge_small_quads', + 'Test polygons\'s common edges with small quads', + es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS, + numFboSamples)); + + group.addChild(new es3fMultisampleTests.CommonEdgeCase( + 'common_edge_big_quad', + 'Test polygon\'s common edges with bigger-than-viewport quads', + es3fMultisampleTests.CommonEdgeCase.CaseType.BIGGER_THAN_VIEWPORT_QUAD, + numFboSamples)); + + group.addChild(new es3fMultisampleTests.CommonEdgeCase( + 'common_edge_viewport_quad', + 'Test polygons\' common edges with exactly viewport-sized quads', + es3fMultisampleTests.CommonEdgeCase.CaseType.FIT_VIEWPORT_QUAD, + numFboSamples)); + + group.addChild(new es3fMultisampleTests.SampleDepthCase( + 'depth', + 'Test that depth values are per-sample', + numFboSamples)); + + group.addChild(new es3fMultisampleTests.SampleStencilCase( + 'stencil', + 'Test that stencil values are per-sample', + numFboSamples)); + + group.addChild(new es3fMultisampleTests.CoverageMaskInvertCase( + 'sample_coverage_invert', + 'Test that non-inverted and inverted sample coverage masks are each other\'s negations', + numFboSamples)); + + + group.addChild(new es3fMultisampleTests.MaskProportionalityCase( + 'proportionality_alpha_to_coverage', + 'Test the proportionality property of GL_SAMPLE_ALPHA_TO_COVERAGE', + es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE, + numFboSamples)); + group.addChild(new es3fMultisampleTests.MaskProportionalityCase( + 'proportionality_sample_coverage', + 'Test the proportionality property of GL_SAMPLE_COVERAGE', + es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE, + numFboSamples)); + group.addChild(new es3fMultisampleTests.MaskProportionalityCase( + 'proportionality_sample_coverage_inverted', + 'Test the proportionality property of inverted-mask GL_SAMPLE_COVERAGE', + es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED, + numFboSamples)); + + group.addChild(new es3fMultisampleTests.MaskConstancyCase( + 'constancy_alpha_to_coverage', + 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_ALPHA_TO_COVERAGE', + es3fMultisampleTests.MaskConstancyCase.CaseType.ALPHA_TO_COVERAGE, + numFboSamples)); + group.addChild(new es3fMultisampleTests.MaskConstancyCase( + 'constancy_sample_coverage', + 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_COVERAGE', + es3fMultisampleTests.MaskConstancyCase.CaseType.SAMPLE_COVERAGE, + numFboSamples)); + group.addChild(new es3fMultisampleTests.MaskConstancyCase( + 'constancy_sample_coverage_inverted', + 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using inverted-mask GL_SAMPLE_COVERAGE', + es3fMultisampleTests.MaskConstancyCase.CaseType.SAMPLE_COVERAGE_INVERTED, + numFboSamples)); + group.addChild(new es3fMultisampleTests.MaskConstancyCase( + 'constancy_both', + 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_ALPHA_TO_COVERAGE and GL_SAMPLE_COVERAGE', + es3fMultisampleTests.MaskConstancyCase.CaseType.BOTH, + numFboSamples)); + group.addChild(new es3fMultisampleTests.MaskConstancyCase( + 'constancy_both_inverted', + 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_ALPHA_TO_COVERAGE and inverted-mask GL_SAMPLE_COVERAGE', + es3fMultisampleTests.MaskConstancyCase.CaseType.BOTH_INVERTED, + numFboSamples)); + } + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fMultisampleTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var testName = 'multisample'; + var testDescription = 'Multisample Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.setRoot(tcuTestCase.newTest(testName, testDescription, null)); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fMultisampleTests.init(); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fMultisampleTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js new file mode 100644 index 000000000..2a8910eb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js @@ -0,0 +1,1104 @@ +'use strict'; +goog.provide('functional.gles3.es3fNegativeBufferApiTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluStrUtil'); +goog.require('functional.gles3.es3fApiCase'); + +goog.scope(function() { + + var es3fNegativeBufferApiTests = functional.gles3.es3fNegativeBufferApiTests; + var es3fApiCase = functional.gles3.es3fApiCase; + var gluStrUtil = framework.opengl.gluStrUtil; + var tcuTestCase = framework.common.tcuTestCase; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeBufferApiTests.init = function(gl) { + + var testGroup = tcuTestCase.runner.testCases; + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'bind_buffer', 'Invalid gl.bindBuffer() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the allowable values.'); + gl.bindBuffer(-1, null); + this.expectError(gl.INVALID_ENUM); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'buffer_data', 'Invalid gl.bufferData() usage', gl, + function() { + var buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER.'); + gl.bufferData(-1, 0, gl.STREAM_DRAW); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if usage is not gl.STREAM_DRAW, gl.STATIC_DRAW, or gl.DYNAMIC_DRAW.'); + gl.bufferData(gl.ARRAY_BUFFER, 0, -1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if size is negative.'); + gl.bufferData(gl.ARRAY_BUFFER, -1, gl.STREAM_DRAW); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.'); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + gl.bufferData(gl.ARRAY_BUFFER, 0, gl.STREAM_DRAW); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteBuffer(buffer); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'buffer_sub_data', 'Invalid gl.bufferSubData() usage', gl, + function() { + var buffer = gl.createBuffer(); + var data = new ArrayBuffer(5); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl.bufferData(gl.ARRAY_BUFFER, 10, gl.STREAM_DRAW); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER.'); + gl.bufferSubData(-1, 1, data); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.'); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + gl.bufferSubData(gl.ARRAY_BUFFER, 0, data); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteBuffer(buffer); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'buffer_sub_data_size_offset', 'Invalid gl.bufferSubData() usage', gl, + function() { + var buffer = gl.createBuffer(); + var data = new ArrayBuffer(5); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl.bufferData(gl.ARRAY_BUFFER, 10, gl.STREAM_DRAW); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if offset is negative'); + gl.bufferSubData(gl.ARRAY_BUFFER, -1, data); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if the data would be written past the end of the buffer.'); + gl.bufferSubData(gl.ARRAY_BUFFER, 7, data); + this.expectError(gl.INVALID_VALUE); + gl.bufferSubData(gl.ARRAY_BUFFER, 15, data); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('An exception is thrown if data is null.'); + this.expectThrowNoError(function() { + gl.bufferSubData(gl.ARRAY_BUFFER, 0, null); + }); + + gl.deleteBuffer(buffer); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'clear', 'Invalid gl.clear() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if any bit other than the three defined bits is set in mask.'); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + this.expectError(gl.NO_ERROR); + gl.clear(0x0200); + this.expectError(gl.INVALID_VALUE); + gl.clear(0x1000); + this.expectError(gl.INVALID_VALUE); + gl.clear(0x0010); + this.expectError(gl.INVALID_VALUE); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'read_pixels', 'Invalid gl.readPixels() usage', gl, + function() { + var buffer = new ArrayBuffer(8); + var ubyteData = new Uint8Array(buffer); + var ushortData = new Uint16Array(buffer); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of format and type is unsupported.'); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, ushortData); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the ArrayBuffer type does not match the type parameter.'); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ushortData); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if either width or height is negative.'); + gl.readPixels(0, 0, -1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData); + this.expectError(gl.INVALID_VALUE); + gl.readPixels(0, 0, 1, -1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData); + this.expectError(gl.INVALID_VALUE); + gl.readPixels(0, 0, -1, -1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'read_pixels_format_mismatch', 'Invalid glReadPixels() usage', gl, + function() { + var buffer = new ArrayBuffer(8); + var ubyteData = new Uint8Array(buffer); + var ushortData = new Uint16Array(buffer); + + bufferedLogToConsole('Unsupported combinations of format and type will generate a gl.INVALID_OPERATION error.'); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_SHORT_5_6_5, ushortData); + this.expectError(gl.INVALID_OPERATION); + gl.readPixels(0, 0, 1, 1, gl.ALPHA, gl.UNSIGNED_SHORT_5_6_5, ushortData); + this.expectError(gl.INVALID_OPERATION); + gl.readPixels(0, 0, 1, 1, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, ushortData); + this.expectError(gl.INVALID_OPERATION); + gl.readPixels(0, 0, 1, 1, gl.ALPHA, gl.UNSIGNED_SHORT_4_4_4_4, ushortData); + this.expectError(gl.INVALID_OPERATION); + gl.readPixels(0, 0, 1, 1, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, ushortData); + this.expectError(gl.INVALID_OPERATION); + gl.readPixels(0, 0, 1, 1, gl.ALPHA, gl.UNSIGNED_SHORT_5_5_5_1, ushortData); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.RGBA/gl.UNSIGNED_BYTE is always accepted and the other acceptable pair can be discovered by querying gl.IMPLEMENTATION_COLOR_READ_FORMAT and gl.IMPLEMENTATION_COLOR_READ_TYPE.'); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData); + this.expectError(gl.NO_ERROR); + var readFormat = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT)); + var readType = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE)); + gl.readPixels(0, 0, 1, 1, readFormat, readType, ubyteData); + this.expectError(gl.NO_ERROR); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'read_pixels_fbo_format_mismatch', 'Invalid gl.readPixels() usage', gl, + function() { + var ubyteData = new Uint8Array(4); + var floatData = new Float32Array(4); + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if currently bound framebuffer format is incompatible with format and type.'); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, floatData); + this.expectError(gl.INVALID_OPERATION); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, floatData); + this.expectError(gl.INVALID_OPERATION); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, floatData); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.READ_FRAMEBUFFER_BINDING is non-zero, the read framebuffer is complete, and the value of gl.SAMPLE_BUFFERS for the read framebuffer is greater than zero.'); + + var rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, 32, 32); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo); + + var binding = /** @type {WebGLFramebuffer} */ (gl.getParameter(gl.READ_FRAMEBUFFER_BINDING)); + bufferedLogToConsole('gl.READ_FRAMEBUFFER_BINDING: ' + binding); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + var sampleBuffers = /** @type {number} */ (gl.getParameter(gl.SAMPLE_BUFFERS)); + bufferedLogToConsole('gl.SAMPLE_BUFFERS: ' + sampleBuffers); + this.expectError(gl.NO_ERROR); + + if (binding == null || sampleBuffers <= 0) { + this.testFailed('expected gl.READ_FRAMEBUFFER_BINDING to be non-zero and gl.SAMPLE_BUFFERS to be greater than zero'); + } else { + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData); + this.expectError(gl.INVALID_OPERATION); + } + + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(rbo); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + gl.bindTexture(gl.TEXTURE_2D, null); + gl.deleteTexture(texture); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'bind_buffer_range', 'Invalid glBindBufferRange() usage', gl, + function() { + var bufEmpty = new ArrayBuffer(16); + + var bufUniform = gl.createBuffer(); + gl.bindBuffer(gl.UNIFORM_BUFFER, bufUniform); + gl.bufferData(gl.UNIFORM_BUFFER, bufEmpty, gl.STREAM_DRAW); + + var bufTF = gl.createBuffer(); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, bufTF); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, bufEmpty, gl.STREAM_DRAW); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TRANSFORM_FEEDBACK_BUFFER or gl.UNIFORM_BUFFER.'); + gl.bindBufferRange(gl.ARRAY_BUFFER, 0, bufUniform, 0, 4); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.TRANSFORM_FEEDBACK_BUFFER and index is greater than or equal to gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.'); + var maxTFSize = /** @type {number} */ (gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)); + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF, 0, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.UNIFORM_BUFFER and index is greater than or equal to gl.MAX_UNIFORM_BUFFER_BINDINGS.'); + var maxUSize = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS)); + gl.bindBufferRange(gl.UNIFORM_BUFFER, maxUSize, bufUniform, 0, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if size is less than or equal to zero.'); + gl.bindBufferRange(gl.UNIFORM_BUFFER, 0, bufUniform, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.bindBufferRange(gl.UNIFORM_BUFFER, 0, bufUniform, 0, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.TRANSFORM_FEEDBACK_BUFFER and size or offset are not multiples of 4.'); + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 4, 5); + this.expectError(gl.INVALID_VALUE); + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 4); + this.expectError(gl.INVALID_VALUE); + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 7); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.UNIFORM_BUFFER and offset is not a multiple of gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT.'); + var alignment = /** @type {number} */ (gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT)); + gl.bindBufferRange(gl.UNIFORM_BUFFER, 0, bufUniform, alignment + 1, 4); + this.expectError(gl.INVALID_VALUE); + + gl.deleteBuffer(bufUniform); + gl.deleteBuffer(bufTF); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'bind_buffer_base', 'Invalid glBindBufferBase() usage', gl, + function() { + var bufEmpty = new ArrayBuffer(16); + + var bufUniform = gl.createBuffer(); + gl.bindBuffer(gl.UNIFORM_BUFFER, bufUniform); + gl.bufferData(gl.UNIFORM_BUFFER, bufEmpty, gl.STREAM_DRAW); + + var bufTF = gl.createBuffer(); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, bufTF); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, bufEmpty, gl.STREAM_DRAW); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TRANSFORM_FEEDBACK_BUFFER or gl.UNIFORM_BUFFER.'); + gl.bindBufferBase(-1, 0, bufUniform); + this.expectError(gl.INVALID_ENUM); + gl.bindBufferBase(gl.ARRAY_BUFFER, 0, bufUniform); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.UNIFORM_BUFFER and index is greater than or equal to gl.MAX_UNIFORM_BUFFER_BINDINGS.'); + var maxUSize = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS)); + gl.bindBufferBase(gl.UNIFORM_BUFFER, maxUSize, bufUniform); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.TRANSFORM_FEEDBACK_BUFFER andindex is greater than or equal to gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.'); + var maxTFSize = /** @type {number} */ (gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF); + this.expectError(gl.INVALID_VALUE); + + gl.deleteBuffer(bufUniform); + gl.deleteBuffer(bufTF); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'clear_bufferiv', 'Invalid gl.clearBufferiv() usage', gl, + function() { + var data = new Int32Array(32 * 32); + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null); + + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.'); + gl.clearBufferiv(-1, 0, data); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferiv(gl.FRAMEBUFFER, 0, data); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.COLOR, gl.FRONT, gl.BACK, gl.LEFT, gl.RIGHT, or gl.FRONT_AND_BACK and drawBuffer is greater than or equal to gl.MAX_DRAW_BUFFERS.'); + var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS)); + gl.clearBufferiv(gl.COLOR, maxDrawBuffers, data); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is gl.DEPTH or gl.DEPTH_STENCIL.'); + gl.clearBufferiv(gl.DEPTH, 1, data); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferiv(gl.DEPTH_STENCIL, 1, data); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.STENCIL and drawBuffer is not zero.'); + gl.clearBufferiv(gl.STENCIL, 1, data); + this.expectError(gl.INVALID_VALUE); + + gl.deleteFramebuffer(fbo); + gl.deleteTexture(texture); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'clear_bufferuiv', 'Invalid gl.clearBufferuiv() usage', gl, + function() { + var data = new Uint32Array(32 * 32); + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null); + + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.'); + gl.clearBufferuiv(-1, 0, data); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferuiv(gl.FRAMEBUFFER, 0, data); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.COLOR, gl.FRONT, gl.BACK, gl.LEFT, gl.RIGHT, or gl.FRONT_AND_BACK and drawBuffer is greater than or equal to gl.MAX_DRAW_BUFFERS.'); + var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS)); + gl.clearBufferuiv(gl.COLOR, maxDrawBuffers, data); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is gl.DEPTH, gl.STENCIL or gl.DEPTH_STENCIL.'); + gl.clearBufferuiv(gl.DEPTH, 1, data); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferuiv(gl.STENCIL, 1, data); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferuiv(gl.DEPTH_STENCIL, 1, data); + this.expectError(gl.INVALID_ENUM); + + gl.deleteFramebuffer(fbo); + gl.deleteTexture(texture); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'clear_bufferfv', 'Invalid gl.clearBufferfv() usage', gl, + function() { + var data = new Float32Array(32 * 32); + + var texture = gl.createTexture(); + // Float type texture isn't color-renderable without EXT_color_buffer_float extension. + if (gl.getExtension('EXT_color_buffer_float')) { + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, 32, 32, 0, gl.RGBA, gl.FLOAT, null); + + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.'); + gl.clearBufferfv(-1, 0, data); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferfv(gl.FRAMEBUFFER, 0, data); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.COLOR, gl.FRONT, gl.BACK, gl.LEFT, gl.RIGHT, or gl.FRONT_AND_BACK and drawBuffer is greater than or equal to gl.MAX_DRAW_BUFFERS.'); + var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS)); + gl.clearBufferfv(gl.COLOR, maxDrawBuffers, data); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is gl.STENCIL or gl.DEPTH_STENCIL.'); + gl.clearBufferfv(gl.STENCIL, 1, data); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferfv(gl.DEPTH_STENCIL, 1, data); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.DEPTH and drawBuffer is not zero.'); + gl.clearBufferfv(gl.DEPTH, 1, data); + this.expectError(gl.INVALID_VALUE); + } + + gl.deleteFramebuffer(fbo); + gl.deleteTexture(texture); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'clear_bufferfi', 'Invalid gl.clearBufferfi() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.'); + gl.clearBufferfi(-1, 0, 1.0, 1); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferfi(gl.FRAMEBUFFER, 0, 1.0, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not gl.DEPTH_STENCIL.'); + gl.clearBufferfi(gl.DEPTH, 0, 1.0, 1); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferfi(gl.STENCIL, 0, 1.0, 1); + this.expectError(gl.INVALID_ENUM); + gl.clearBufferfi(gl.COLOR, 0, 1.0, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.DEPTH_STENCIL and drawBuffer is not zero.'); + gl.clearBufferfi(gl.DEPTH_STENCIL, 1, 1.0, 1); + this.expectError(gl.INVALID_VALUE); + + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'copy_buffer_sub_data', 'Invalid gl.copyBufferSubData() usage', gl, + function() { + var buf = { + r: gl.createBuffer(), + w: gl.createBuffer() + }; + + gl.bindBuffer(gl.COPY_READ_BUFFER, buf.r); + gl.bufferData(gl.COPY_READ_BUFFER, 32, gl.DYNAMIC_COPY); + gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.w); + gl.bufferData(gl.COPY_WRITE_BUFFER, 32, gl.DYNAMIC_COPY); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if any of readoffset, writeoffset or size is negative.'); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, -4); + this.expectError(gl.INVALID_VALUE); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, -1, 0, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, -1, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if readoffset + size exceeds the size of the buffer object bound to readtarget.'); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 36); + this.expectError(gl.INVALID_VALUE); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 24, 0, 16); + this.expectError(gl.INVALID_VALUE); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 36, 0, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if writeoffset + size exceeds the size of the buffer object bound to writetarget.'); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 36); + this.expectError(gl.INVALID_VALUE); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 24, 16); + this.expectError(gl.INVALID_VALUE); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 36, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if the same buffer object is bound to both readtarget and writetarget and the ranges [readoffset, readoffset + size) and [writeoffset, writeoffset + size) overlap.'); + gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.r); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 16, 4); + this.expectError(gl.NO_ERROR); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 16, 18); + this.expectError(gl.INVALID_VALUE); + gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.w); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if null is bound to readtarget or writetarget.'); + gl.bindBuffer(gl.COPY_READ_BUFFER, null); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 16); + this.expectError(gl.INVALID_OPERATION); + gl.bindBuffer(gl.COPY_READ_BUFFER, buf.r); + + gl.bindBuffer(gl.COPY_WRITE_BUFFER, null); + gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 16); + this.expectError(gl.INVALID_OPERATION); + gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.w); + + gl.deleteBuffer(buf.w); + gl.deleteBuffer(buf.r); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'draw_buffers', 'Invalid glDrawBuffers() usage', gl, + function() { + var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS)); + var values = [ + gl.NONE, + gl.BACK, + gl.COLOR_ATTACHMENT0, + gl.DEPTH_ATTACHMENT + ]; + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if one of the values in bufs is not an accepted value.'); + gl.drawBuffers(values.slice(2, 4)); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the GL is bound to the default framebuffer and the number of queried buffers is not 1.'); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.drawBuffers(values.slice(0, 2)); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the GL is bound to the default framebuffer and the value in bufs is one of the gl.COLOR_ATTACHMENTn tokens.'); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.drawBuffers(values.slice(2, 3)); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the GL is bound to a framebuffer object and the ith buffer listed in bufs is anything other than gl.NONE or gl.COLOR_ATTACHMENTSi.'); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.drawBuffers(values.slice(1, 2)); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + gl.deleteFramebuffer(fbo); + } + )); + + // Framebuffer Objects + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'bind_framebuffer', 'Invalid glBindFramebuffer() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER.'); + gl.bindFramebuffer(-1, null); + this.expectError(gl.INVALID_ENUM); + gl.bindFramebuffer(gl.RENDERBUFFER, null); + this.expectError(gl.INVALID_ENUM); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'bind_renderbuffer', 'Invalid glBindRenderbuffer() usage', gl, + function() { + bufferedLogToConsole('glINVALID_ENUM is generated if target is not gl.RENDERBUFFER.'); + gl.bindRenderbuffer(-1, null); + this.expectError(gl.INVALID_ENUM); + gl.bindRenderbuffer(gl.FRAMEBUFFER, null); + this.expectError(gl.INVALID_ENUM); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'check_framebuffer_status', 'Invalid glCheckFramebufferStatus() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER.'); + gl.checkFramebufferStatus(-1); + this.expectError(gl.INVALID_ENUM); + gl.checkFramebufferStatus(gl.RENDERBUFFER); + this.expectError(gl.INVALID_ENUM); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'framebuffer_renderbuffer', 'Invalid glFramebufferRenderbuffer() usage', gl, + function() { + var rbo = gl.createRenderbuffer(); + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.'); + gl.framebufferRenderbuffer(-1, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if renderbuffertarget is not gl.RENDERBUFFER.'); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, -1, rbo); + this.expectError(gl.INVALID_ENUM); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if zero is bound to target.'); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteRenderbuffer(rbo); + gl.deleteFramebuffer(fbo); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'framebuffer_texture2d', 'Invalid glFramebufferTexture2D() usage', gl, + function() { + + var fbo = gl.createFramebuffer(); + var tex2D = gl.createTexture(); + var texCube = gl.createTexture(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.bindTexture(gl.TEXTURE_2D, tex2D); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.'); + gl.framebufferTexture2D(-1, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if textarget is not an accepted texture target.'); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, -1, tex2D, 0); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0 or larger than log_2 of maximum texture size.'); + var maxTexSize = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)); + var maxCubeTexSize = /** @type {number} */ (gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)); + var maxSizePlane = Math.floor(Math.log2(maxTexSize)) + 1; + var maxSizeCube = Math.floor(Math.log2(maxCubeTexSize)) + 1; + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex2D, -1); + this.expectError(gl.INVALID_VALUE); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex2D, maxSizePlane); + this.expectError(gl.INVALID_VALUE); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X, texCube, maxSizeCube); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if textarget and texture are not compatible.'); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X, tex2D, 0); + this.expectError(gl.INVALID_OPERATION); + gl.deleteTexture(tex2D); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texCube, 0); + this.expectError(gl.INVALID_OPERATION); + gl.deleteTexture(texCube); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if zero is bound to target.'); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteFramebuffer(fbo); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'renderbuffer_storage', 'Invalid glRenderbufferStorage() usage', gl, + function() { + var rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.'); + gl.renderbufferStorage(-1, gl.RGBA4, 1, 1); + this.expectError(gl.INVALID_ENUM); + gl.renderbufferStorage(gl.FRAMEBUFFER, gl.RGBA4, 1, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not a color-renderable, depth-renderable, or stencil-renderable format.'); + gl.renderbufferStorage(gl.RENDERBUFFER, -1, 1, 1); + this.expectError(gl.INVALID_ENUM); + + // EXT_color_buffer_half_float disables error + if (gl.getExtension('EXT_color_buffer_half_float') === null) { + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB16F, 1, 1); + this.expectError(gl.INVALID_ENUM); + } + + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8_SNORM, 1, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than zero.'); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, -1, 1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 1, -1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, -1, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_RENDERBUFFER_SIZE.'); + var maxSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 1, maxSize + 1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, maxSize + 1, 1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, maxSize + 1, maxSize + 1); + this.expectError(gl.INVALID_VALUE); + gl.deleteRenderbuffer(rbo); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'blit_framebuffer', 'Invalid glBlitFramebuffer() usage', gl, + function() { + + /** @type {Array} */ + var texture = [ + gl.createTexture(), gl.createTexture() + ]; + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + + /** @type {Array} */ + var rbo = [ + gl.createRenderbuffer(), gl.createRenderbuffer() + ]; + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[0]); + + /** @type {Array} */ + var fbo = [ + gl.createFramebuffer(), gl.createFramebuffer() + ]; + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo[0]); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, 32, 32); + gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0); + gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[0]); + gl.checkFramebufferStatus(gl.READ_FRAMEBUFFER); + gl.bindTexture(gl.TEXTURE_2D, texture[1]); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[1]); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, fbo[1]); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, 32, 32); + gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[1], 0); + gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[1]); + gl.checkFramebufferStatus(gl.DRAW_FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if mask contains any of the gl.DEPTH_BUFFER_BIT or gl.STENCIL_BUFFER_BIT and filter is not gl.NEAREST.'); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.LINEAR); + this.expectError(gl.INVALID_OPERATION); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT, gl.LINEAR); + this.expectError(gl.INVALID_OPERATION); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.LINEAR); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if mask contains gl.COLOR_BUFFER_BIT and read buffer format is incompatible with draw buffer format.'); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null); + gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0); + bufferedLogToConsole('// Read buffer: gl.RGBA32UI, draw buffer: gl.RGBA'); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null); + gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0); + bufferedLogToConsole('// Read buffer: gl.RGBA32I, draw buffer: gl.RGBA'); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0); + gl.bindTexture(gl.TEXTURE_2D, texture[1]); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null); + gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[1], 0); + bufferedLogToConsole('// Read buffer: gl.RGBA8, draw buffer: gl.RGBA32I'); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if filter is gl.LINEAR and the read buffer contains integer data.'); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null); + gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0); + gl.bindTexture(gl.TEXTURE_2D, texture[1]); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null); + gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[1], 0); + bufferedLogToConsole('// Read buffer: gl.RGBA32UI, filter: gl.LINEAR'); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.LINEAR); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if mask contains gl.DEPTH_BUFFER_BIT or gl.STENCIL_BUFFER_BIT and the source and destination depth and stencil formats do not match.'); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[0]); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH32F_STENCIL8, 32, 32); + gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[0]); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.DEPTH_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.STENCIL_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo[1]); + gl.deleteFramebuffer(fbo[0]); + gl.deleteTexture(texture[1]); + gl.deleteTexture(texture[0]); + gl.deleteRenderbuffer(rbo[1]); + gl.deleteRenderbuffer(rbo[0]); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'blit_framebuffer_multisample', 'Invalid glBlitFramebuffer() usage', gl, + function() { + + /** @type {Array} */ + var rbo = [ + gl.createRenderbuffer(), gl.createRenderbuffer() + ]; + /** @type {Array} */ + var fbo = [ + gl.createFramebuffer(), gl.createFramebuffer() + ]; + + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[0]); + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo[0]); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, 32, 32); + gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[0]); + gl.checkFramebufferStatus(gl.READ_FRAMEBUFFER); + + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[1]); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, fbo[1]); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the value of gl.SAMPLE_BUFFERS for the draw buffer is greater than zero.'); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, 32, 32); + gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[1]); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.SAMPLE_BUFFERS for the read buffer is greater than zero and the formats of draw and read buffers are not identical.'); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 32, 32); + gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[1]); + gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.SAMPLE_BUFFERS for the read buffer is greater than zero and the source and destination rectangles are not defined with the same (X0, Y0) and (X1, Y1) bounds.'); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 32, 32); + gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[1]); + gl.blitFramebuffer(0, 0, 16, 16, 2, 2, 18, 18, gl.COLOR_BUFFER_BIT, gl.NEAREST); + this.expectError(gl.INVALID_OPERATION); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteRenderbuffer(rbo[0]); + gl.deleteRenderbuffer(rbo[1]); + gl.deleteFramebuffer(fbo[0]); + gl.deleteFramebuffer(fbo[1]); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'framebuffer_texture_layer', 'Invalid glFramebufferTextureLayer() usage', gl, + function() { + + var fbo = gl.createFramebuffer(); + var tex3D = gl.createTexture(); + var tex2DArray = gl.createTexture(); + var tex2D = gl.createTexture(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + gl.bindTexture(gl.TEXTURE_3D, tex3D); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, tex2DArray); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture(gl.TEXTURE_2D, tex2D); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.'); + gl.framebufferTextureLayer(-1, gl.COLOR_ATTACHMENT0, tex3D, 0, 1); + this.expectError(gl.INVALID_ENUM); + gl.framebufferTextureLayer(gl.RENDERBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if attachment is not one of the accepted tokens.'); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, -1, tex3D, 0, 1); + this.expectError(gl.INVALID_ENUM); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.BACK, tex3D, 0, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if texture is non-zero and not the name of a 3D texture or 2D array texture.'); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex2D, 0, 0); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if texture is not zero and layer is negative.'); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if texture is not zero and layer is greater than gl.MAX_3D_TEXTURE_SIZE-1 for a 3D texture.'); + var max3DTexSize = /** @type {number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, max3DTexSize); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if texture is not zero and layer is greater than gl.MAX_ARRAY_TEXTURE_LAYERS-1 for a 2D array texture.'); + var maxArrayTexLayers = /** @type {number} */ (gl.getParameter(gl.MAX_ARRAY_TEXTURE_LAYERS)); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex2DArray, 0, maxArrayTexLayers); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if zero is bound to target.'); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, 1); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(tex3D); + gl.deleteTexture(tex2DArray); + gl.deleteTexture(tex2D); + gl.deleteFramebuffer(fbo); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'invalidate_framebuffer', 'Invalid gl.invalidateFramebuffer() usage', gl, + function() { + var maxColorAttachments = /** @type {number} */ (gl.getParameter(gl.MAX_COLOR_ATTACHMENTS)); + var attachments = [ + gl.COLOR_ATTACHMENT0 + ]; + + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER, gl.READ_FRAMEBUFFER or gl.DRAW_FRAMEBUFFER.'); + gl.invalidateFramebuffer(-1, attachments); + this.expectError(gl.INVALID_ENUM); + gl.invalidateFramebuffer(gl.BACK, attachments); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if attachments contains gl.COLOR_ATTACHMENTm and m is greater than or equal to the value of gl.MAX_COLOR_ATTACHMENTS.'); + gl.invalidateFramebuffer(gl.FRAMEBUFFER, [gl.COLOR_ATTACHMENT0 + maxColorAttachments]); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + gl.deleteFramebuffer(fbo); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'invalidate_sub_framebuffer', 'Invalid gl.invalidateSubFramebuffer() usage', gl, + function() { + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + var maxColorAttachments = /** @type {number} */ (gl.getParameter(gl.MAX_COLOR_ATTACHMENTS)); + var att0 = [gl.COLOR_ATTACHMENT0]; + var attm = [gl.COLOR_ATTACHMENT0 + maxColorAttachments]; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER, gl.READ_FRAMEBUFFER or gl.DRAW_FRAMEBUFFER.'); + gl.invalidateSubFramebuffer(-1, att0, 0, 0, 16, 16); + this.expectError(gl.INVALID_ENUM); + gl.invalidateSubFramebuffer(gl.BACK, att0, 0, 0, 16, 16); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if attachments contains gl.COLOR_ATTACHMENTm and m is greater than or equal to the value of gl.MAX_COLOR_ATTACHMENTS.'); + gl.invalidateSubFramebuffer(gl.FRAMEBUFFER, attm, 0, 0, 16, 16); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteFramebuffer(fbo); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'renderbuffer_storage_multisample', 'Invalid glRenderbufferStorageMultisample() usage', gl, + function() { + + var rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + /** @type {Int32Array} */ var samplesSupportedRGBA4 = /** @type {Int32Array} */ gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA4, gl.SAMPLES); + // supported samples are written in descending numeric order, so the first one is the max samples + var maxSamplesSupportedRGBA4 = samplesSupportedRGBA4[0]; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.'); + gl.renderbufferStorageMultisample(-1, 2, gl.RGBA4, 1, 1); + this.expectError(gl.INVALID_ENUM); + gl.renderbufferStorageMultisample(gl.FRAMEBUFFER, 2, gl.RGBA4, 1, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if samples is greater than the maximum number of samples supported for internalformat.'); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, maxSamplesSupportedRGBA4 + 1, gl.RGBA4, 1, 1); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not a color-renderable, depth-renderable, or stencil-renderable format.'); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, -1, 1, 1); + this.expectError(gl.INVALID_ENUM); + + // EXT_color_buffer_half_float disables error + if (gl.getExtension('EXT_color_buffer_half_float') === null) { + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGB16F, 1, 1); + this.expectError(gl.INVALID_ENUM); + } + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA8_SNORM, 1, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than zero.'); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA4, -1, 1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA4, 1, -1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA4, -1, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_RENDERBUFFER_SIZE.'); + var maxSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA4, 1, maxSize + 1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA4, maxSize + 1, 1); + this.expectError(gl.INVALID_VALUE); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA4, maxSize + 1, maxSize + 1); + this.expectError(gl.INVALID_VALUE); + + gl.deleteRenderbuffer(rbo); + } + )); + + }; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeBufferApiTests.run = function(gl) { + var testName = 'negativeBufferApi'; + var testDescription = 'Negative Buffer API tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fNegativeBufferApiTests.init(gl); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js new file mode 100644 index 000000000..c3675d436 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js @@ -0,0 +1,339 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES 3.0 Module + * ------------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Negative Fragment Pipe API tests. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('functional.gles3.es3fNegativeFragmentApiTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('functional.gles3.es3fApiCase'); + +goog.scope(function() { + + var es3fNegativeFragmentApiTests = functional.gles3.es3fNegativeFragmentApiTests; + var es3fApiCase = functional.gles3.es3fApiCase; + var tcuTestCase = framework.common.tcuTestCase; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeFragmentApiTests.init = function(gl) { + + var testGroup = tcuTestCase.runner.testCases; + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('scissor', 'Invalid gl.scissor() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if either width or height is negative.'); + gl.scissor(0, 0, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.scissor(0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.scissor(0, 0, -1, -1); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('depth_func', 'Invalid gl.depthFunc() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if func is not an accepted value.'); + gl.depthFunc(-1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('viewport', 'Invalid gl.viewport() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if either width or height is negative.'); + gl.viewport(0, 0, -1, 1); + this.expectError(gl.INVALID_VALUE); + gl.viewport(0, 0, 1, -1); + this.expectError(gl.INVALID_VALUE); + gl.viewport(0, 0, -1, -1); + this.expectError(gl.INVALID_VALUE); + + })); + + // Stencil functions + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_func', 'Invalid gl.stencilFunc() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if func is not one of the eight accepted values.'); + gl.stencilFunc(-1, 0, 1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_func_separate', 'Invalid gl.stencilFuncSeparate() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if face is not gl.FRONT, gl.BACK, or gl.FRONT_AND_BACK.'); + gl.stencilFuncSeparate(-1, gl.NEVER, 0, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if func is not one of the eight accepted values.'); + gl.stencilFuncSeparate(gl.FRONT, -1, 0, 1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_op', 'Invalid gl.stencilOp() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the defined symbolic constant values.'); + gl.stencilOp(-1, gl.ZERO, gl.REPLACE); + this.expectError(gl.INVALID_ENUM); + gl.stencilOp(gl.KEEP, -1, gl.REPLACE); + this.expectError(gl.INVALID_ENUM); + gl.stencilOp(gl.KEEP, gl.ZERO, -1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_op_separate', 'Invalid gl.stencilOpSeparate() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if face is any value other than gl.FRONT, gl.BACK, or gl.FRONT_AND_BACK.'); + gl.stencilOpSeparate(-1, gl.KEEP, gl.ZERO, gl.REPLACE); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values.'); + gl.stencilOpSeparate(gl.FRONT, -1, gl.ZERO, gl.REPLACE); + this.expectError(gl.INVALID_ENUM); + gl.stencilOpSeparate(gl.FRONT, gl.KEEP, -1, gl.REPLACE); + this.expectError(gl.INVALID_ENUM); + gl.stencilOpSeparate(gl.FRONT, gl.KEEP, gl.ZERO, -1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_mask_separate', 'Invalid gl.stencilMaskSeparate() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if face is not gl.FRONT, gl.BACK, or gl.FRONT_AND_BACK.'); + gl.stencilMaskSeparate(-1, 0); + this.expectError(gl.INVALID_ENUM); + + })); + + // Blend functions + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_equation', 'Invalid gl.blendEquation() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MAX or gl.MIN.'); + gl.blendEquation(-1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_equation_separate', 'Invalid gl.blendEquationSeparate() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if modeRGB is not gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MAX or gl.MIN.'); + gl.blendEquationSeparate(-1, gl.FUNC_ADD); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if modeAlpha is not gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MAX or gl.MIN.'); + gl.blendEquationSeparate(gl.FUNC_ADD, -1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_func', 'Invalid gl.blendFunc() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.'); + gl.blendFunc(-1, gl.ONE); + this.expectError(gl.INVALID_ENUM); + gl.blendFunc(gl.ONE, -1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_func_separate', 'Invalid gl.blendFuncSeparate() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.'); + gl.blendFuncSeparate(-1, gl.ONE, gl.SRC_COLOR, gl.ONE_MINUS_SRC_COLOR); + this.expectError(gl.INVALID_ENUM); + gl.blendFuncSeparate(gl.ZERO, -1, gl.SRC_COLOR, gl.ONE_MINUS_SRC_COLOR); + this.expectError(gl.INVALID_ENUM); + gl.blendFuncSeparate(gl.ZERO, gl.ONE, -1, gl.ONE_MINUS_SRC_COLOR); + this.expectError(gl.INVALID_ENUM); + gl.blendFuncSeparate(gl.ZERO, gl.ONE, gl.SRC_COLOR, -1); + this.expectError(gl.INVALID_ENUM); + + })); + + // Rasterization API functions + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('cull_face', 'Invalid gl.cullFace() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.cullFace(-1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('front_face', 'Invalid gl.frontFace() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.frontFace(-1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('line_width', 'Invalid gl.lineWidth() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if width is less than or equal to 0.'); + gl.lineWidth(0); + this.expectError(gl.INVALID_VALUE); + gl.lineWidth(-1); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('begin_query', 'Invalid gl.beginQuery() usage', gl, function() { + /** @type{Array} */ var ids = []; + ids[0] = gl.createQuery(); + ids[1] = gl.createQuery(); + ids[2] = gl.createQuery(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.'); + gl.beginQuery(-1, ids[0]); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.beginQuery is executed while a query object of the same target is already active.'); + gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[0]); + this.expectError(gl.NO_ERROR); + gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[1]); + this.expectError(gl.INVALID_OPERATION); + // \note gl.ANY_SAMPLES_PASSED and gl.ANY_SAMPLES_PASSED_CONSERVATIVE alias to the same target for the purposes of this error. + gl.beginQuery(gl.ANY_SAMPLES_PASSED_CONSERVATIVE, ids[1]); + this.expectError(gl.INVALID_OPERATION); + gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[1]); + this.expectError(gl.NO_ERROR); + gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[2]); + this.expectError(gl.INVALID_OPERATION); + gl.endQuery(gl.ANY_SAMPLES_PASSED); + gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('An exception is thrown if the name is null.'); + this.expectThrowNoError(function() { + gl.beginQuery(gl.ANY_SAMPLES_PASSED, null); + }); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the name has since been deleted with gl.deleteQuery.'); + gl.deleteQuery(ids[2]); + this.expectError(gl.NO_ERROR); + gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[2]); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if id is the name of an already active query object.'); + gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[0]); + this.expectError(gl.NO_ERROR); + gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if id refers to an existing query object whose type does not does not match target.'); + gl.endQuery(gl.ANY_SAMPLES_PASSED); + this.expectError(gl.NO_ERROR); + gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteQuery(ids[0]); + gl.deleteQuery(ids[1]); + gl.deleteQuery(ids[2]); + this.expectError(gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('end_query', 'Invalid gl.endQuery() usage', gl, function() { + /** @type{WebGLQuery} */ var id; + id = gl.createQuery(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.'); + gl.endQuery(-1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.endQuery is executed when a query object of the same target is not active.'); + gl.endQuery(gl.ANY_SAMPLES_PASSED); + this.expectError(gl.INVALID_OPERATION); + gl.beginQuery(gl.ANY_SAMPLES_PASSED, id); + this.expectError(gl.NO_ERROR); + gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); + this.expectError(gl.INVALID_OPERATION); + gl.endQuery(gl.ANY_SAMPLES_PASSED); + this.expectError(gl.NO_ERROR); + + gl.deleteQuery(id); + this.expectError(gl.NO_ERROR); + })); + + // Sync objects + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('fence_sync', 'Invalid gl.fenceSync() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if condition is not gl.SYNC_GPU_COMMANDS_COMPLETE.'); + gl.fenceSync(-1, 0); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if flags is not zero.'); + gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0x0010); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('wait_sync', 'Invalid gl.waitSync() usage', gl, function() { + /** @type{WebGLSync} */ var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); + + bufferedLogToConsole('An exception is thrown if sync is null.'); + this.expectThrowNoError(function() { + gl.waitSync(null, 0, gl.TIMEOUT_IGNORED); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if flags is not zero.'); + gl.waitSync(sync, 0x0010, gl.TIMEOUT_IGNORED); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if timeout is not gl.TIMEOUT_IGNORED.'); + gl.waitSync(sync, 0, 0); + this.expectError(gl.INVALID_VALUE); + + gl.deleteSync(sync); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('client_wait_sync', 'Invalid gl.clientWaitSync() usage', gl, function() { + /** @type{WebGLSync} */ var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); + + bufferedLogToConsole('An exception is thrown if sync is null.'); + this.expectThrowNoError(function() { + gl.clientWaitSync (null, 0, 0); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if flags contains any unsupported flag.'); + gl.clientWaitSync(sync, 0x00000004, 0); + this.expectError(gl.INVALID_VALUE); + + gl.deleteSync(sync); + })); + + }; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeFragmentApiTests.run = function(gl) { + var testName = 'negativeFragmentApi'; + var testDescription = 'Negative Fragment API tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fNegativeFragmentApiTests.init(gl); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js new file mode 100644 index 000000000..6e48dab60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js @@ -0,0 +1,1195 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fNegativeShaderApiTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('functional.gles3.es3fApiCase'); + +goog.scope(function() { + + var es3fNegativeShaderApiTests = functional.gles3.es3fNegativeShaderApiTests; + var es3fApiCase = functional.gles3.es3fApiCase; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + + /** + * @type {string} + * @const + */ + var vertexShaderSource = '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + + /** + * @type {string} + * @const + */ + var fragmentShaderSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + /** + * @type {string} + * @const + */ + var uniformTestVertSource = '#version 300 es\n' + + 'uniform mediump vec4 vec4_v;\n' + + 'uniform mediump mat4 mat4_v;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = mat4_v * vec4_v;\n' + + '}\n'; + + /** + * @type {string} + * @const + */ + var uniformTestFragSource = '#version 300 es\n' + + 'uniform mediump ivec4 ivec4_f;\n' + + 'uniform mediump uvec4 uvec4_f;\n' + + 'uniform sampler2D sampler_f;\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor.xy = (vec4(uvec4_f) + vec4(ivec4_f)).xy;\n' + + ' fragColor.zw = texture(sampler_f, vec2(0.0, 0.0)).zw;\n' + + '}\n'; + + /** + * @type {string} + * @const + */ + var uniformBlockVertSource = '#version 300 es\n' + + 'layout(std140) uniform Block { lowp float var; };\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(var);\n' + + '}\n'; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeShaderApiTests.init = function(gl) { + var testGroup = tcuTestCase.runner.testCases; + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'create_shader', 'Invalid gl.createShader() usage', gl, + function() { + bufferedLogToConsole('INVALID_ENUM is generated if shaderType is not an accepted value.'); + gl.createShader(-1); + this.expectError(gl.INVALID_ENUM); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('attach_shader', 'Invalid gl.attachShader() usage', gl, + function() { + /** @type {WebGLShader} */ var shader1 = gl.createShader(gl.VERTEX_SHADER); + /** @type {WebGLShader} */ var shader2 = gl.createShader(gl.VERTEX_SHADER); + /** @type {WebGLProgram} */ var program = gl.createProgram(); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if shader is already attached to program.'); + gl.attachShader(program, shader1); + this.expectError(gl.NO_ERROR); + gl.attachShader(program, shader1); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if a shader of the same type as shader is already attached to program.'); + gl.attachShader(program, shader2); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteProgram(program); + gl.deleteShader(shader1); + gl.deleteShader(shader2); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('detach_shader', 'Invalid gl.detachShader() usage', gl, + function() { + /** @type {WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type {WebGLProgram} */ var program = gl.createProgram(); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if shader is not attached to program.'); + gl.detachShader(program, shader); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteProgram(program); + gl.deleteShader(shader); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('link_program', 'Invalid gl.linkProgram() usage', gl, + function() { + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if program is the currently active program object and transform feedback mode is active.'); + + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {WebGLBuffer} */ var buf; + /** @type {WebGLTransformFeedback} */ var tfID; + /** @type {Array} */ var tfVarying = ['gl_Position']; + + tfID = gl.createTransformFeedback(); + buf = gl.createBuffer(); + + gl.useProgram(program.getProgram()); + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(program.getProgram()); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback(gl.TRIANGLES); + + this.expectError(gl.NO_ERROR); + + gl.linkProgram(program.getProgram()); + this.expectError(gl.INVALID_OPERATION); + + gl.endTransformFeedback(); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(buf); + this.expectError(gl.NO_ERROR); + + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('use_program', 'Invalid gl.useProgram() usage', gl, + function() { + + /** @type {WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback mode is active and not paused.'); + /** @type {gluShaderProgram.ShaderProgram} */ var program1 = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {gluShaderProgram.ShaderProgram} */ var program2 = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {WebGLBuffer} */ var buf; + /** @type {WebGLTransformFeedback} */ var tfID; + /** @type {Array} */ var tfVarying = ['gl_Position']; + + tfID = gl.createTransformFeedback(); + buf = gl.createBuffer(); + + gl.useProgram(program1.getProgram()); + gl.transformFeedbackVaryings(program1.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(program1.getProgram()); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback(gl.TRIANGLES); + this.expectError(gl.NO_ERROR); + + gl.useProgram(program2.getProgram()); + this.expectError(gl.INVALID_OPERATION); + + gl.pauseTransformFeedback(); + gl.useProgram(program2.getProgram()); + this.expectError(gl.NO_ERROR); + + gl.endTransformFeedback(); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(buf); + this.expectError(gl.NO_ERROR); + + gl.useProgram(null); + gl.deleteShader(shader); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('bind_sampler', 'Invalid gl.bindSampler() usage', gl, + function() { + /** @type {number} */ var maxTexImageUnits; + /** @type {WebGLSampler} */ var sampler; + /** @type {WebGLSampler} */ var buf; + maxTexImageUnits = /** @type {number} */ (gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)); + sampler = gl.createSampler(); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if unit is greater than or equal to the value of gl.MAX_COMBIED_TEXTURE_IMAGE_UNITS.'); + gl.bindSampler(maxTexImageUnits, sampler); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if sampler has been deleted by a call to glDeleteSamplers.'); + gl.deleteSampler(sampler); + gl.bindSampler(1, sampler); + this.expectError(gl.INVALID_OPERATION); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_sampler_parameteriv', 'Invalid gl.getSamplerParameter() usage', gl, + function() { + /** @type {number} */ var params; + /** @type {WebGLSampler} */ var sampler; + sampler = gl.createSampler(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + params = /** @type {number} */ (gl.getSamplerParameter(sampler, -1)); + this.expectError(gl.INVALID_ENUM); + + gl.deleteSampler(sampler); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_sampler_parameterfv', 'Invalid gl.getSamplerParameter() usage', gl, + function() { + /** @type {number} */ var params; + /** @type {WebGLSampler} */ var sampler; + sampler = gl.createSampler(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + params = /** @type {number} */ (gl.getSamplerParameter(sampler, -1)); + this.expectError(gl.INVALID_ENUM); + + gl.deleteSampler(sampler); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('sampler_parameteri', 'Invalid gl.samplerParameteri() usage', gl, + function() { + /** @type {WebGLSampler} */ var sampler; + sampler = gl.createSampler(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not.'); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, -1); + this.expectError(gl.INVALID_ENUM); + + gl.deleteSampler(sampler); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'sampler_parameteriv', 'Invalid gl.samplerParameteri() usage', gl, + function() { + /** @type {number} */ var params; + /** @type {WebGLSampler} */ var sampler; + sampler = gl.createSampler(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not.'); + params = -1; + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, params); + this.expectError(gl.INVALID_ENUM); + + gl.deleteSampler(sampler); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'sampler_parameterf', 'Invalid glSamplerParameterf() usage', gl, + function() { + /** @type {WebGLSampler} */ var sampler; + sampler = gl.createSampler(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not.'); + gl.samplerParameterf(sampler, gl.TEXTURE_WRAP_S, -1.0); + this.expectError(gl.INVALID_ENUM); + + gl.deleteSampler(sampler); + } + )); + + // Shader data commands + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'get_attrib_location', 'Invalid gl.getAttribLocation() usage', gl, + function() { + /** @type {WebGLProgram} */ var programEmpty = gl.createProgram(); + /** @type {WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been successfully linked.'); + gl.bindAttribLocation(programEmpty, 0, 'test'); + gl.getAttribLocation(programEmpty, 'test'); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + gl.deleteShader(shader); + gl.deleteProgram(programEmpty); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'get_uniform_location', 'Invalid gl.getUniformLocation() usage', gl, + function() { + /** @type {WebGLProgram} */ var programEmpty = gl.createProgram(); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been successfully linked.'); + gl.getUniformLocation(programEmpty, 'test'); + this.expectError(gl.INVALID_OPERATION); + gl.deleteProgram(programEmpty); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback( + 'bind_attrib_location', 'Invalid gl.bindAttribLocation() usage', gl, + function() { + /** @type {WebGLProgram} */ var program = gl.createProgram(); + var maxIndex = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + gl.bindAttribLocation(program, maxIndex, 'test'); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if name starts with the reserved prefix \'gl.\'.'); + gl.bindAttribLocation(program, maxIndex-1, 'gl_test'); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteProgram(program); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniform_block_binding', 'Invalid gl.uniformBlockBinding() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformBlockVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + + /** @type {number} */ var maxUniformBufferBindings; + /** @type {number} */ var numActiveUniforms = -1; + /** @type {number} */ var numActiveBlocks = -1; + maxUniformBufferBindings = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS)); + numActiveUniforms = /** @type {number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORMS)); + numActiveBlocks = /** @type {number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS)); + bufferedLogToConsole('// gl.MAX_UNIFORM_BUFFER_BINDINGS = ' + maxUniformBufferBindings); + bufferedLogToConsole('// gl.ACTIVE_UNIFORMS = ' + numActiveUniforms); + bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockIndex is not an active uniform block index of program.'); + gl.uniformBlockBinding(program.getProgram(), -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.uniformBlockBinding(program.getProgram(), 5, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockBinding is greater than or equal to the value of gl.MAX_UNIFORM_BUFFER_BINDINGS.'); + gl.uniformBlockBinding(program.getProgram(), maxUniformBufferBindings, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.uniformBlockBinding(null, 0, 0); + }); + } + )); + + // glUniform*f + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformf_incompatible_type', 'Invalid glUniform{1234}f() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4 + /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4 + /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4 + /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D + this.expectError(gl.NO_ERROR); + + if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null) { + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + } + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.'); + gl.useProgram(program.getProgram()); + gl.uniform1f(vec4_v, 0.0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2f(vec4_v, 0.0, 0.0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3f(vec4_v, 0.0, 0.0, 0.0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4f(vec4_v, 0.0, 0.0, 0.0, 0.0); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}f is used to load a uniform variable of type int, ivec2, ivec3, ivec4, unsigned int, uvec2, uvec3, uvec4.'); + gl.useProgram(program.getProgram()); + gl.uniform4f(ivec4_f, 0.0, 0.0, 0.0, 0.0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4f(uvec4_f, 0.0, 0.0, 0.0, 0.0); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.'); + gl.useProgram(program.getProgram()); + gl.uniform1f(sampler_f, 0.0); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformfv_incompatible_type', 'Invalid glUniform{1234}fv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4 + /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4 + /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4 + /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D + this.expectError(gl.NO_ERROR); + + if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Float32Array} */ var data = new Float32Array(4); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.'); + gl.useProgram(program.getProgram()); + gl.uniform1fv(vec4_v, new Float32Array(1)); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2fv(vec4_v, new Float32Array(2)); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3fv(vec4_v, new Float32Array(3)); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4fv(vec4_v, new Float32Array(4)); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}fv is used to load a uniform variable of type /** @type {number} */ var , ivec2, ivec3, ivec4, unsigned /** @type {number} */ var , uvec2, uvec3, uvec4.'); + gl.useProgram(program.getProgram()); + gl.uniform4fv(ivec4_f, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4fv(uvec4_f, data); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.'); + gl.useProgram(program.getProgram()); + gl.uniform1fv(sampler_f, new Float32Array(1)); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformfv_invalid_count', 'Invalid glUniform{1234}fv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4 + this.expectError(gl.NO_ERROR); + + if (vec4_v == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Float32Array} */ var data = new Float32Array(12); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.'); + gl.useProgram(program.getProgram()); + gl.uniform1fv(vec4_v, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2fv(vec4_v, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3fv(vec4_v, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4fv(vec4_v, data); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformi_incompatible_type', 'Invalid glUniform{1234}i() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4 + /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4 + /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4 + /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D + this.expectError(gl.NO_ERROR); + + if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.'); + gl.useProgram(program.getProgram()); + gl.uniform1i(ivec4_f, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2i(ivec4_f, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3i(ivec4_f, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4i(ivec4_f, 0, 0, 0, 0); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type unsigned /** @type {number} */ var , uvec2, uvec3, uvec4, or an array of these.'); + gl.useProgram(program.getProgram()); + gl.uniform1i(uvec4_f, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2i(uvec4_f, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3i(uvec4_f, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4i(uvec4_f, 0, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.'); + gl.useProgram(program.getProgram()); + gl.uniform1i(vec4_v, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2i(vec4_v, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3i(vec4_v, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4i(vec4_v, 0, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformiv_incompatible_type', 'Invalid glUniform{1234}iv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4 + /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4 + /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4 + /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D + this.expectError(gl.NO_ERROR); + + if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Int32Array} */ var data1 = new Int32Array(1); + /** @type {Int32Array} */ var data2 = new Int32Array(2); + /** @type {Int32Array} */ var data3 = new Int32Array(3); + /** @type {Int32Array} */ var data4 = new Int32Array(4); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.'); + gl.useProgram(program.getProgram()); + gl.uniform1iv(ivec4_f, data1); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2iv(ivec4_f, data2); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3iv(ivec4_f, data3); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4iv(ivec4_f, data4); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}iv is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.'); + gl.useProgram(program.getProgram()); + gl.uniform1iv(vec4_v, data1); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2iv(vec4_v, data2); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3iv(vec4_v, data3); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4iv(vec4_v, data4); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}iv is used to load a uniform variable of type unsigned /** @type {number} */ var , uvec2, uvec3 or uvec4.'); + gl.useProgram(program.getProgram()); + gl.uniform1iv(uvec4_f, data1); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2iv(uvec4_f, data2); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3iv(uvec4_f, data3); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4iv(uvec4_f, data4); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformiv_invalid_count', 'Invalid glUniform{1234}iv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4 + this.expectError(gl.NO_ERROR); + + if (ivec4_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Int32Array} */ var data = new Int32Array(12); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.'); + gl.useProgram(program.getProgram()); + gl.uniform1iv(ivec4_f, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2iv(ivec4_f, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3iv(ivec4_f, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4iv(ivec4_f, data); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformui_incompatible_type', 'Invalid glUniform{1234}ui() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4 + /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4 + /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4 + /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D + this.expectError(gl.NO_ERROR); + + if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.'); + gl.useProgram(program.getProgram()); + gl.uniform1ui(uvec4_f, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2ui(uvec4_f, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3ui(uvec4_f, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4ui(uvec4_f, 0, 0, 0, 0); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type /** @type {number} */ var , ivec2, ivec3, ivec4, or an array of these.'); + gl.useProgram(program.getProgram()); + gl.uniform1ui(ivec4_f, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2ui(ivec4_f, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3ui(ivec4_f, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4ui(ivec4_f, 0, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.'); + gl.useProgram(program.getProgram()); + gl.uniform1ui(vec4_v, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2ui(vec4_v, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3ui(vec4_v, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4ui(vec4_v, 0, 0, 0, 0); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.'); + gl.useProgram(program.getProgram()); + gl.uniform1ui(sampler_f, 0); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformuiv_incompatible_type', 'Invalid glUniform{1234}uiv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4 + /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4 + /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4 + /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D + this.expectError(gl.NO_ERROR); + + if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Uint32Array} */ var data1 = new Uint32Array(1); + /** @type {Uint32Array} */ var data2 = new Uint32Array(2); + /** @type {Uint32Array} */ var data3 = new Uint32Array(3); + /** @type {Uint32Array} */ var data4 = new Uint32Array(4); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.'); + gl.useProgram(program.getProgram()); + gl.uniform1uiv(uvec4_f, data1); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2uiv(uvec4_f, data2); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3uiv(uvec4_f, data3); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4uiv(uvec4_f, data4); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}uiv is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.'); + gl.useProgram(program.getProgram()); + gl.uniform1uiv(vec4_v, data1); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2uiv(vec4_v, data2); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3uiv(vec4_v, data3); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4uiv(vec4_v, data4); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}uiv is used to load a uniform variable of type /** @type {number} */ var , ivec2, ivec3 or ivec4.'); + gl.useProgram(program.getProgram()); + gl.uniform1uiv(ivec4_f, data1); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2uiv(ivec4_f, data2); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3uiv(ivec4_f, data3); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4uiv(ivec4_f, data4); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.'); + gl.useProgram(program.getProgram()); + gl.uniform1uiv(sampler_f, data1); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformuiv_invalid_count', 'Invalid glUniform{1234}uiv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4 + this.expectError(gl.NO_ERROR); + + if (uvec4_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Uint32Array} */ var data = new Uint32Array(12); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.'); + gl.useProgram(program.getProgram()); + gl.uniform1uiv(uvec4_f, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform2uiv(uvec4_f, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform3uiv(uvec4_f, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniform4uiv(uvec4_f, data); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniform_matrixfv_incompatible_type', 'Invalid glUniformMatrix{234}fv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var mat4_v = gl.getUniformLocation(program.getProgram(), 'mat4_v'); // mat4 + /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D + this.expectError(gl.NO_ERROR); + + if (mat4_v == null || sampler_f == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Float32Array} */ var data4 = new Float32Array(4); + /** @type {Float32Array} */ var data9 = new Float32Array(9); + /** @type {Float32Array} */ var data16 = new Float32Array(16); + /** @type {Float32Array} */ var data6 = new Float32Array(6); + /** @type {Float32Array} */ var data8 = new Float32Array(8); + /** @type {Float32Array} */ var data12 = new Float32Array(12); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.'); + gl.useProgram(program.getProgram()); + gl.uniformMatrix2fv(mat4_v, false, data4); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3fv(mat4_v, false, data9); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4fv(mat4_v, false, data16); + this.expectError(gl.NO_ERROR); + + gl.uniformMatrix2x3fv(mat4_v, false, data6); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3x2fv(mat4_v, false, data6); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix2x4fv(mat4_v, false, data8); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4x2fv(mat4_v, false, data8); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3x4fv(mat4_v, false, data12); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4x3fv(mat4_v, false, data12); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.'); + gl.useProgram(program.getProgram()); + gl.uniformMatrix2fv(sampler_f, false, data4); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3fv(sampler_f, false, data9); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4fv(sampler_f, false, data16); + this.expectError(gl.INVALID_OPERATION); + + gl.uniformMatrix2x3fv(sampler_f, false, data6); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3x2fv(sampler_f, false, data6); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix2x4fv(sampler_f, false, data8); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4x2fv(sampler_f, false, data8); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3x4fv(sampler_f, false, data12); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4x3fv(sampler_f, false, data12); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniform_matrixfv_invalid_count', 'Invalid glUniformMatrix{234}fv() usage', gl, + function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + + gl.useProgram(program.getProgram()); + /** @type {WebGLUniformLocation} */ var mat4_v = gl.getUniformLocation(program.getProgram(), 'mat4_v'); // mat4 + this.expectError(gl.NO_ERROR); + + if (mat4_v == null) + assertMsgOptions(false, 'Failed to retrieve uniform location', false, true); + + /** @type {Float32Array} */ var data = new Float32Array(144); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.'); + gl.useProgram(program.getProgram()); + gl.uniformMatrix2fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + + gl.uniformMatrix2x3fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3x2fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix2x4fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4x2fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix3x4fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + gl.uniformMatrix4x3fv(mat4_v, false, data); + this.expectError(gl.INVALID_OPERATION); + + gl.useProgram(null); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('bind_transform_feedback', 'Invalid gl.bindTransformFeedback() usage', gl, + function() { + /** @type {Array} */ var tfID = []; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {WebGLBuffer} */ var buf; + /** @type {Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID[0] = gl.createTransformFeedback(); + tfID[1] = gl.createTransformFeedback(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TRANSFORM_FEEDBACK.'); + gl.bindTransformFeedback(-1, tfID[0]); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the transform feedback operation is active on the currently bound transform feedback object, and is not paused.'); + gl.useProgram(program.getProgram()); + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(program.getProgram()); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback(gl.TRIANGLES); + this.expectError(gl.NO_ERROR); + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[1]); + this.expectError(gl.INVALID_OPERATION); + + gl.endTransformFeedback(); + this.expectError(gl.NO_ERROR); + + gl.useProgram(null); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID[0]); + gl.deleteTransformFeedback(tfID[1]); + this.expectError(gl.NO_ERROR); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('begin_transform_feedback', 'Invalid gl.beginTransformFeedback() usage', gl, + function() { + /** @type {Array} */ var tfID = []; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {WebGLBuffer} */ var buf; + /** @type {Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID[0] = gl.createTransformFeedback(); + tfID[1] = gl.createTransformFeedback(); + + gl.useProgram(program.getProgram()); + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(program.getProgram()); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if primitiveMode is not one of gl.POINTS, gl.LINES, or gl.TRIANGLES.'); + gl.beginTransformFeedback(-1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is already active.'); + gl.beginTransformFeedback(gl.TRIANGLES); + this.expectError(gl.NO_ERROR); + gl.beginTransformFeedback(gl.POINTS); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if any binding point used in transform feedback mode does not have a buffer object bound.'); + /** @type{WebGLBuffer} */ var dummyBuf = gl.createBuffer() + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, dummyBuf); + gl.beginTransformFeedback(gl.TRIANGLES); + this.expectError(gl.INVALID_OPERATION); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if no binding points would be used because no program object is active.'); + gl.useProgram(null); + gl.beginTransformFeedback(gl.TRIANGLES); + this.expectError(gl.INVALID_OPERATION); + gl.useProgram(program.getProgram()); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if no binding points would be used because the active program object has specified no varying variables to record.'); + gl.transformFeedbackVaryings(program.getProgram(), [], gl.INTERLEAVED_ATTRIBS); + gl.beginTransformFeedback(gl.TRIANGLES); + this.expectError(gl.INVALID_OPERATION); + + gl.endTransformFeedback(); + gl.deleteBuffer(buf); + gl.deleteBuffer(dummyBuf); + gl.deleteTransformFeedback(tfID[0]); + gl.deleteTransformFeedback(tfID[1]); + this.expectError(gl.NO_ERROR); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('pause_transform_feedback', 'Invalid gl.pauseTransformFeedback() usage', gl, + function() { + /** @type {Array} */ var tfID = []; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {WebGLBuffer} */ var buf; + /** @type {Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID[0] = gl.createTransformFeedback(); + tfID[1] = gl.createTransformFeedback(); + + gl.useProgram(program.getProgram()); + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(program.getProgram()); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the currently bound transform feedback object is not active or is paused.'); + gl.pauseTransformFeedback(); + this.expectError(gl.INVALID_OPERATION); + gl.beginTransformFeedback(gl.TRIANGLES); + gl.pauseTransformFeedback(); + this.expectError(gl.NO_ERROR); + gl.pauseTransformFeedback(); + this.expectError(gl.INVALID_OPERATION); + + gl.endTransformFeedback(); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID[0]); + gl.deleteTransformFeedback(tfID[1]); + this.expectError(gl.NO_ERROR); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('resume_transform_feedback', 'Invalid gl.resumeTransformFeedback() usage', gl, + function() { + /** @type {Array} */ var tfID = []; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {WebGLBuffer} */ var buf; + /** @type {Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID[0] = gl.createTransformFeedback(); + tfID[1] = gl.createTransformFeedback(); + + gl.useProgram(program.getProgram()); + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(program.getProgram()); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the currently bound transform feedback object is not active or is not paused.'); + gl.resumeTransformFeedback(); + this.expectError(gl.INVALID_OPERATION); + gl.beginTransformFeedback(gl.TRIANGLES); + gl.resumeTransformFeedback(); + this.expectError(gl.INVALID_OPERATION); + gl.pauseTransformFeedback(); + gl.resumeTransformFeedback(); + this.expectError(gl.NO_ERROR); + + gl.endTransformFeedback(); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID[0]); + gl.deleteTransformFeedback(tfID[1]); + this.expectError(gl.NO_ERROR); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('end_transform_feedback', 'Invalid gl.endTransformFeedback() usage', gl, + function() { + /** @type {WebGLTransformFeedback} */ var tfID; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {WebGLBuffer} */ var buf; + /** @type {Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID = gl.createTransformFeedback(); + + gl.useProgram(program.getProgram()); + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(program.getProgram()); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is not active.'); + gl.endTransformFeedback(); + this.expectError(gl.INVALID_OPERATION); + gl.beginTransformFeedback(gl.TRIANGLES); + gl.endTransformFeedback(); + this.expectError(gl.NO_ERROR); + + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID); + this.expectError(gl.NO_ERROR); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_transform_feedback_varying', 'Invalid glGetTransformFeedbackVarying() usage', gl, + function() { + /** @type {WebGLTransformFeedback} */ var tfID; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {gluShaderProgram.ShaderProgram} */ var programInvalid = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, '')); + /** @type {Array} */ var tfVarying = ['gl_Position']; + /** @type {number} */ var maxTransformFeedbackVaryings = 0; + + /** @type {number} */ var length; + /** @type {number} */ var size; + /** @type {number} */ var type; + /** @type {WebGLActiveInfo} */ var name; + + tfID = gl.createTransformFeedback(); + + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + this.expectError(gl.NO_ERROR); + gl.linkProgram(program.getProgram()); + this.expectError(gl.NO_ERROR); + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getTransformFeedbackVarying(null, 0); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater or equal to the value of gl.TRANSFORM_FEEDBACK_VARYINGS.'); + maxTransformFeedbackVaryings = /** @type {number} */ (gl.getProgramParameter(program.getProgram(), gl.TRANSFORM_FEEDBACK_VARYINGS)); + name = gl.getTransformFeedbackVarying(program.getProgram(), maxTransformFeedbackVaryings); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION or gl.INVALID_VALUE is generated program has not been linked.'); + name = gl.getTransformFeedbackVarying(programInvalid.getProgram(), 0); + this.expectError([gl.INVALID_OPERATION, gl.INVALID_VALUE]); + + gl.deleteTransformFeedback(tfID); + this.expectError(gl.NO_ERROR); + } + )); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('transform_feedback_varyings', 'Invalid gl.transformFeedbackVaryings() usage', gl, + function() { + /** @type {WebGLTransformFeedback} */ var tfID; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + /** @type {Array} */ var tfVarying = ['gl_Position']; + /** @type {number} */ var maxTransformFeedbackSeparateAttribs = 0; + + tfID = gl.createTransformFeedback(); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.transformFeedbackVaryings(null, tfVarying, gl.INTERLEAVED_ATTRIBS); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if bufferMode is gl.SEPARATE_ATTRIBS and count is greater than gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.'); + maxTransformFeedbackSeparateAttribs = /** @type {number} */ (gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)); + for (var count = 0; count < maxTransformFeedbackSeparateAttribs; ++count) { + tfVarying = tfVarying.concat(['gl_Position']); + } + gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.SEPARATE_ATTRIBS); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTransformFeedback(tfID); + this.expectError(gl.NO_ERROR); + } + )); + }; + + /** + * Run test + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeShaderApiTests.run = function(gl) { + //Set up Test Root parameters + var testName = 'negative_shader_api'; + var testDescription = 'Negative Shader Api Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fNegativeShaderApiTests.init(gl); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js new file mode 100644 index 000000000..40d6384ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js @@ -0,0 +1,927 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES 3.0 Module + * ------------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Negative GL State API tests. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('functional.gles3.es3fNegativeStateApiTests'); + +goog.require('framework.common.tcuTestCase'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('framework.opengl.gluShaderProgram'); + +goog.scope(function() { + + var es3fNegativeStateApiTests = functional.gles3.es3fNegativeStateApiTests; + var es3fApiCase = functional.gles3.es3fApiCase; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + + /** + * @type {string} + * @const + */ + var uniformTestVertSource = '#version 300 es\n' + + 'uniform mediump vec4 vUnif_vec4;\n' + + 'in mediump vec4 attr;\n' + + 'layout(std140) uniform Block { mediump vec4 blockVar; };\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vUnif_vec4 + blockVar + attr;\n' + + '}\n'; + + /** + * @type {string} + * @const + */ + var uniformTestFragSource = '#version 300 es\n' + + 'uniform mediump ivec4 fUnif_ivec4;\n' + + 'uniform mediump uvec4 fUnif_uvec4;\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(vec4(fUnif_ivec4) + vec4(fUnif_uvec4));\n' + + '}\n'; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeStateApiTests.init = function(gl) { + + var testGroup = tcuTestCase.runner.testCases; + + // Enabling & disabling states + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('enable', 'Invalid gl.enable() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if cap is not one of the allowed values.'); + gl.enable(-1); + this.expectError(gl.INVALID_ENUM); + + })); + testGroup.addChild(new es3fApiCase.ApiCaseCallback('disable', 'Invalid gl.disable() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if cap is not one of the allowed values.'); + gl.disable(-1); + this.expectError(gl.INVALID_ENUM); + + })); + + // Simple state queries + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_parameter', 'Invalid gl.getParameter() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the allowed values.'); + /** @type{boolean} */ var params = false; + //glGetBooleanv(-1, params); + params = /** @type{boolean} */ (gl.getParameter(-1)); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_indexed_parameter', 'Invalid gl.getIndexedParameter() usage', gl, function() { + /** @type{number} */ var data = -1; + /** @type{number} */ var maxUniformBufferBindings; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if name is not an accepted value.'); + data = /** @type{number} */ (gl.getIndexedParameter(-1, 0)); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.'); + maxUniformBufferBindings = /** @type{number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS)); + this.expectError(gl.NO_ERROR); + data = /** @type{number} */ (gl.getIndexedParameter(gl.UNIFORM_BUFFER_BINDING, maxUniformBufferBindings)); + this.expectError(gl.INVALID_VALUE); + + })); + + // Enumerated state queries: Shaders + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_attached_shaders', 'Invalid gl.getAttachedShaders() usage', gl, function() { + /** @type{WebGLShader} */ var shaderObject = gl.createShader(gl.VERTEX_SHADER); + /** @type{WebGLProgram} */ var program = gl.createProgram(); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getAttachedShaders(null); + }); + + gl.deleteShader(shaderObject); + gl.deleteProgram(program); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_parameter', 'Invalid gl.getShaderParameter() usage', gl, function() { + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{WebGLProgram} */ var program = gl.createProgram(); + /** @type{number} */ var param = -1; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + param = /** @type{number} */ (gl.getShaderParameter(shader, -1)); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('An exception is thrown if shader is null.'); + this.expectThrowNoError(function() { + gl.getShaderParameter(null, gl.SHADER_TYPE); + }); + + gl.deleteShader(shader); + gl.deleteProgram(program); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_info_log', 'Invalid gl.getShaderInfoLog() usage', gl, function() { + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{WebGLProgram} */ var program = gl.createProgram(); + + bufferedLogToConsole('An exception is thrown if shader is null.'); + this.expectThrowNoError(function() { + gl.getShaderInfoLog(null); + }); + + gl.deleteShader(shader); + gl.deleteProgram(program); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_precision_format', 'Invalid gl.getShaderPrecisionFormat() usage', gl, function() { + /** @type{WebGLShaderPrecisionFormat } */ var precision; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if shaderType or precisionType is not an accepted value.'); + precision = gl.getShaderPrecisionFormat (-1, gl.MEDIUM_FLOAT); + this.expectError(gl.INVALID_ENUM); + precision = gl.getShaderPrecisionFormat (gl.VERTEX_SHADER, -1); + this.expectError(gl.INVALID_ENUM); + precision = gl.getShaderPrecisionFormat (-1, -1); + this.expectError(gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_source', 'Invalid gl.getShaderSource() usage', gl, function() { + /** @type{WebGLProgram} */ var program = gl.createProgram(); + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + + bufferedLogToConsole('An exception is thrown if shader is null.'); + this.expectThrowNoError(function() { + gl.getShaderSource(null); + }); + + gl.deleteProgram(program); + gl.deleteShader(shader); + })); + + // Enumerated state queries: Programs + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_program_parameter', 'Invalid gl.getProgramParameter() usage', gl, function() { + /** @type{WebGLProgram} */ var program = gl.createProgram(); + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{boolean} */ var params; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + params = /** @type{boolean} */ (gl.getProgramParameter(program, -1)); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getProgramParameter(null, gl.LINK_STATUS); + }); + + gl.deleteProgram(program); + gl.deleteShader(shader); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_program_info_log', 'Invalid gl.getProgramInfoLog() usage', gl, function() { + /** @type{WebGLProgram} */ var program = gl.createProgram(); + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getProgramInfoLog (null); + }); + + gl.deleteProgram(program); + gl.deleteShader(shader); + })); + + // Enumerated state queries: Shader variables + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_tex_parameter', 'Invalid gl.getTexParameter() usage', gl, function() { + /** @type{WebGLTexture} */ var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not an accepted value.'); + gl.getTexParameter (-1, gl.TEXTURE_MAG_FILTER); + this.expectError(gl.INVALID_ENUM); + gl.getTexParameter (gl.TEXTURE_2D, -1); + this.expectError(gl.INVALID_ENUM); + gl.getTexParameter (-1, -1); + this.expectError(gl.INVALID_ENUM); + + gl.deleteTexture(texture); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_uniform', 'Invalid gl.getUniform() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + gl.useProgram(program.getProgram()); + + /** @type{WebGLUniformLocation} */ var unif = gl.getUniformLocation(program.getProgram(), 'vUnif_vec4'); // vec4 + assertMsgOptions(unif != null, 'Failed to retrieve uniform location', false, true); + + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{WebGLProgram} */ var programEmpty = gl.createProgram(); + /** @type{*} */ var params; + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getUniform (null, unif); + }); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been successfully linked.'); + params = gl.getUniform (programEmpty, unif); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('An exception is thrown if location is null.'); + this.expectThrowNoError(function() { + gl.getUniform (program.getProgram(), null); + }); + + gl.deleteShader(shader); + gl.deleteProgram(programEmpty); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniform', 'Invalid gl.getActiveUniform() usage', gl, function() { + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + /** @type{number} */ var numActiveUniforms = -1; + + numActiveUniforms = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORMS)); + bufferedLogToConsole('// gl.ACTIVE_UNIFORMS = ' + numActiveUniforms + ' (expected 4).'); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getActiveUniform(null, 0); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to the number of active uniform variables in program.'); + gl.useProgram(program.getProgram()); + gl.getActiveUniform(program.getProgram(), numActiveUniforms); + this.expectError(gl.INVALID_VALUE); + + gl.useProgram(null); + gl.deleteShader(shader); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniforms', 'Invalid gl.getActiveUniforms() usage', gl, function() { + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + /** @type{Array} */ var dummyUniformIndex = [1]; + /** @type{Array} */ var dummyParamDst; + /** @type{number} */ var numActiveUniforms = -1; + + gl.useProgram(program.getProgram()); + + numActiveUniforms = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORMS)); + bufferedLogToConsole('// gl.ACTIVE_UNIFORMS = ' + numActiveUniforms + ' (expected 4).'); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getActiveUniforms(null, dummyUniformIndex, gl.UNIFORM_TYPE); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if any value in uniformIndices is greater than or equal to the value of gl.ACTIVE_UNIFORMS for program.'); + /** @type{Array} */ var invalidUniformIndices; + /** @type{Array} */ var dummyParamsDst; + for (var excess = 0; excess <= 2; excess++) { + invalidUniformIndices = [1, numActiveUniforms - 1 + excess, 1]; + dummyParamsDst = gl.getActiveUniforms(program.getProgram(), invalidUniformIndices, gl.UNIFORM_TYPE); + this.expectError(excess == 0 ? gl.NO_ERROR : gl.INVALID_VALUE); + } + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted token.'); + dummyParamDst = gl.getActiveUniforms(program.getProgram(), dummyUniformIndex, -1); + this.expectError(gl.INVALID_ENUM); + + gl.useProgram(null); + gl.deleteShader(shader); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniform_block_parameter', 'Invalid gl.getActiveUniformBlockParameter() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + /** @type{*} */ var params; + /** @type{number} */ var numActiveBlocks = -1; + + numActiveBlocks = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS)); + bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks + ' (expected 1).'); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of gl.ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.'); + gl.useProgram(program.getProgram()); + this.expectError(gl.NO_ERROR); + params = gl.getActiveUniformBlockParameter(program.getProgram(), numActiveBlocks, gl.UNIFORM_BLOCK_BINDING); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the accepted tokens.'); + params = gl.getActiveUniformBlockParameter(program.getProgram(), 0, -1); + this.expectError(gl.INVALID_ENUM); + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniform_block_name', 'Invalid gl.getActiveUniformBlockName() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + /** @type{number} */ var length = -1; + /** @type{number} */ var numActiveBlocks = -1; + /** @type{string} */ var uniformBlockName; + + numActiveBlocks = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS)); + bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks + ' (expected 1).'); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of gl.ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.'); + gl.useProgram(program.getProgram()); + this.expectError(gl.NO_ERROR); + uniformBlockName = gl.getActiveUniformBlockName(program.getProgram(), numActiveBlocks); + this.expectError(gl.INVALID_VALUE); + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_attrib', 'Invalid gl.getActiveAttrib() usage', gl, function() { + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + /** @type{number} */ var numActiveAttributes = -1; + + /** @type{WebGLActiveInfo} */ var activeInfo; + /** @type{number} */ var size = -1; + /** @type{number} */ var type = -1; + /** @type{string} */ var name; + + numActiveAttributes = /** @type{number} */(gl.getProgramParameter(program.getProgram(), gl.ACTIVE_ATTRIBUTES)); + bufferedLogToConsole('// gl.ACTIVE_ATTRIBUTES = ' + numActiveAttributes + ' (expected 1).'); + + gl.useProgram(program.getProgram()); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getActiveAttrib(null, 0); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.ACTIVE_ATTRIBUTES.'); + activeInfo = gl.getActiveAttrib(program.getProgram(), numActiveAttributes); + this.expectError(gl.INVALID_VALUE); + + gl.useProgram(null); + gl.deleteShader(shader); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_uniform_indices', 'Invalid gl.getUniformIndices() usage', gl, function() { + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); + gl.useProgram(program.getProgram()); + /** @type{number} */ var numActiveBlocks = -1; + /** @type{Array} */ var uniformName = ['Block.blockVar']; + /** @type{Array} */ var uniformIndices = [-1]; + + numActiveBlocks = /** @type{number} */(gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS)); + bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('An exception is thrown if program is null.'); + this.expectThrowNoError(function() { + gl.getUniformIndices(null, uniformName); + }); + + gl.useProgram(null); + gl.deleteShader(shader); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_vertex_attrib', 'Invalid gl.getVertexAttrib() usage', gl, function() { + /** @type{*} */ var params; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + params = gl.getVertexAttrib(0, -1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + /** @type{number} */ var maxVertexAttribs; + maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + params = gl.getVertexAttrib(maxVertexAttribs, gl.VERTEX_ATTRIB_ARRAY_ENABLED); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_vertex_attrib_offset', 'Invalid gl.getVertexAttribOffset() usage', gl, function() { + /** @type{number} */ var ptr; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + ptr = gl.getVertexAttribOffset(0, -1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + /** @type{number} */ var maxVertexAttribs; + maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + ptr = gl.getVertexAttribOffset(maxVertexAttribs, gl.VERTEX_ATTRIB_ARRAY_POINTER); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_frag_data_location', 'Invalid gl.getFragDataLocation() usage', gl, function() { + /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER); + /** @type{WebGLProgram} */ var program = gl.createProgram(); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been linked.'); + gl.getFragDataLocation(program, 'gl_FragColor'); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteProgram(program); + gl.deleteShader(shader); + })); + + // Enumerated state queries: Buffers + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_buffer_parameter', 'Invalid gl.getBufferParameter() usage', gl, function() { + /** @type{number} */ var params = -1; + /** @type{WebGLBuffer} */ var buf; + buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target or value is not an accepted value.'); + params = /** @type{number} */ (gl.getBufferParameter(-1, gl.BUFFER_SIZE)); + this.expectError(gl.INVALID_ENUM); + params = /** @type{number} */ (gl.getBufferParameter(gl.ARRAY_BUFFER, -1)); + this.expectError(gl.INVALID_ENUM); + params = /** @type{number} */ (gl.getBufferParameter(-1, -1)); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.'); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + params = /** @type{number} */ (gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE)); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteBuffer(buf); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_framebuffer_attachment_parameter', 'Invalid gl.getFramebufferAttachmentParameter() usage', gl, function() { + /** @type{*} */ var params; + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{Array} */ var rbo = []; + + fbo = gl.createFramebuffer(); + rbo[0] = gl.createRenderbuffer(); + rbo[1] = gl.createRenderbuffer(); + + gl.bindFramebuffer (gl.FRAMEBUFFER, fbo); + gl.bindRenderbuffer (gl.RENDERBUFFER, rbo[0]); + gl.renderbufferStorage (gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 16, 16); + gl.framebufferRenderbuffer (gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, rbo[0]); + gl.bindRenderbuffer (gl.RENDERBUFFER, rbo[1]); + gl.renderbufferStorage (gl.RENDERBUFFER, gl.STENCIL_INDEX8, 16, 16); + gl.framebufferRenderbuffer (gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[1]); + gl.checkFramebufferStatus (gl.FRAMEBUFFER); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.'); + gl.getFramebufferAttachmentParameter(-1, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); // TYPE is gl.RENDERBUFFER + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not valid for the value of gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.'); + gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL); // TYPE is gl.RENDERBUFFER + this.expectError(gl.INVALID_ENUM); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // TYPE is gl.FRAMEBUFFER_DEFAULT + this.expectError(gl.INVALID_ENUM); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if attachment is gl.DEPTH_STENCIL_ATTACHMENT and different objects are bound to the depth and stencil attachment points of target.'); + gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the value of gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is gl.NONE and pname is not gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.'); + gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // TYPE is gl.NONE + this.expectError(gl.NO_ERROR); + gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE); // TYPE is gl.NONE + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION or gl.INVALID_ENUM is generated if attachment is not one of the accepted values for the current binding of target.'); + gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // A FBO is bound so gl.BACK is invalid + this.expectError([gl.INVALID_OPERATION, gl.INVALID_ENUM]); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // Default framebuffer is bound so gl.COLOR_ATTACHMENT0 is invalid + this.expectError([gl.INVALID_OPERATION, gl.INVALID_ENUM]); + + gl.deleteFramebuffer(fbo); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_renderbuffer_parameter', 'Invalid gl.getRenderbufferParameter() usage', gl, function() { + /** @type{number} */ var params = -1; + /** @type{WebGLRenderbuffer} */ var rbo; + rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.'); + gl.getRenderbufferParameter(-1, gl.RENDERBUFFER_WIDTH); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the accepted tokens.'); + gl.getRenderbufferParameter(gl.RENDERBUFFER, -1); + this.expectError(gl.INVALID_ENUM); + + gl.deleteRenderbuffer(rbo); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_internalformat_parameter', 'Invalid gl.getInternalformatParameter() usage', gl, function() { + /** @type{WebGLRenderbuffer} */ var rbo = gl.createRenderbuffer(); + /** @type{WebGLFramebuffer} */ var fbo = gl.createFramebuffer(); + /** @type{WebGLTexture} */ var tex = gl.createTexture(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.bindTexture(gl.TEXTURE_2D, tex); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not gl.SAMPLES or gl.NUM_SAMPLE_COUNTS.'); + gl.getInternalformatParameter (gl.RENDERBUFFER, gl.RGBA8, -1); + this.expectError (gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not color-, depth-, or stencil-renderable.'); + gl.getInternalformatParameter (gl.RENDERBUFFER, gl.RG8_SNORM, gl.NUM_SAMPLE_COUNTS); + this.expectError (gl.INVALID_ENUM); + gl.getInternalformatParameter (gl.RENDERBUFFER, gl.COMPRESSED_RGB8_ETC2, gl.NUM_SAMPLE_COUNTS); + this.expectError (gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.'); + gl.getInternalformatParameter (-1, gl.RGBA8, gl.NUM_SAMPLE_COUNTS); + this.expectError (gl.INVALID_ENUM); + gl.getInternalformatParameter (gl.FRAMEBUFFER, gl.RGBA8, gl.NUM_SAMPLE_COUNTS); + this.expectError (gl.INVALID_ENUM); + gl.getInternalformatParameter (gl.TEXTURE_2D, gl.RGBA8, gl.NUM_SAMPLE_COUNTS); + this.expectError (gl.INVALID_ENUM); + + gl.deleteRenderbuffer(rbo); + gl.deleteFramebuffer(fbo); + gl.deleteTexture(tex); + + })); + + // Query object queries + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_query', 'Invalid gl.getQuery() usage', gl, function() { + /** @type{number} */ var params = -1; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not an accepted value.'); + gl.getQuery (gl.ANY_SAMPLES_PASSED, -1); + this.expectError (gl.INVALID_ENUM); + gl.getQuery (-1, gl.CURRENT_QUERY); + this.expectError (gl.INVALID_ENUM); + gl.getQuery (-1, -1); + this.expectError (gl.INVALID_ENUM); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_query_parameter', 'Invalid gl.getQueryParameter() usage', gl, function() { + + /** @type{WebGLQuery} */ var id; + id = gl.createQuery(); + + bufferedLogToConsole('An exception is thrown if the query object is null.'); + this.expectThrowNoError(function() { + gl.getQueryParameter (null, gl.QUERY_RESULT_AVAILABLE); + }); + + bufferedLogToConsole('// Note: ' + id + ' is not a query object yet, since it hasn\'t been used by gl.beginQuery'); + gl.getQueryParameter (id, gl.QUERY_RESULT_AVAILABLE); + this.expectError (gl.INVALID_OPERATION); + + gl.beginQuery (gl.ANY_SAMPLES_PASSED, id); + gl.endQuery (gl.ANY_SAMPLES_PASSED); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + gl.getQueryParameter (id, -1); + this.expectError (gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if id is the name of a currently active query object.'); + gl.beginQuery (gl.ANY_SAMPLES_PASSED, id); + this.expectError (gl.NO_ERROR); + gl.getQueryParameter (id, gl.QUERY_RESULT_AVAILABLE); + this.expectError (gl.INVALID_OPERATION); + gl.endQuery (gl.ANY_SAMPLES_PASSED); + this.expectError (gl.NO_ERROR); + + gl.deleteQuery(id); + })); + + // Sync object queries + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_sync_parameter', 'Invalid gl.getSyncParameter() usage', gl, function() { + /** @type{WebGLSync} */ var sync; + + bufferedLogToConsole('An exception is thrown if sync is null.'); + this.expectThrowNoError(function() { + gl.getSyncParameter (null, gl.OBJECT_TYPE); + }); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the accepted tokens.'); + sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); + this.expectError (gl.NO_ERROR); + gl.getSyncParameter (sync, -1); + this.expectError (gl.INVALID_ENUM); + + })); + + // Enumerated boolean state queries + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_enabled', 'Invalid gl.isEnabled() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if cap is not an accepted value.'); + gl.isEnabled(-1); + this.expectError(gl.INVALID_ENUM); + gl.isEnabled(gl.TRIANGLES); + this.expectError(gl.INVALID_ENUM); + + })); + + // Named Object Usage + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_buffer', 'Invalid gl.isBuffer() usage', gl, function() { + /** @type{WebGLBuffer} */ var buffer; + /** @type{boolean} */ var isBuffer; + + bufferedLogToConsole('A name returned by glGenBuffers, but not yet associated with a buffer object by calling glBindBuffer, is not the name of a buffer object.'); + isBuffer = gl.isBuffer(buffer); + assertMsgOptions(!isBuffer, 'Got invalid boolean value', false, true); + + buffer = gl.createBuffer(); + isBuffer = gl.isBuffer(buffer); + assertMsgOptions(!isBuffer, 'Got invalid boolean value', false, true); + + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + isBuffer = gl.isBuffer(buffer); + assertMsgOptions(isBuffer, 'Got invalid boolean value', false, true); + + gl.bindBuffer(gl.ARRAY_BUFFER, null); + gl.deleteBuffer(buffer); + isBuffer = gl.isBuffer(buffer); + assertMsgOptions(!isBuffer, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_framebuffer', 'Invalid gl.isFramebuffer() usage', gl, function() { + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{boolean} */ var isFbo; + + bufferedLogToConsole('A name returned by glGenFramebuffers, but not yet bound through a call to gl.bindFramebuffer is not the name of a framebuffer object.'); + isFbo = gl.isFramebuffer(fbo); + assertMsgOptions(!isFbo, 'Got invalid boolean value', false, true); + + fbo = gl.createFramebuffer(); + isFbo = gl.isFramebuffer(fbo); + assertMsgOptions(!isFbo, 'Got invalid boolean value', false, true); + + gl.bindFramebuffer (gl.FRAMEBUFFER, fbo); + isFbo = gl.isFramebuffer(fbo); + assertMsgOptions(isFbo, 'Got invalid boolean value', false, true); + + gl.bindFramebuffer (gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + isFbo = gl.isFramebuffer(fbo); + assertMsgOptions(!isFbo, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_program', 'Invalid gl.isProgram() usage', gl, function() { + /** @type{WebGLProgram} */ var program; + /** @type{boolean} */ var isProgram; + + bufferedLogToConsole('A name created with gl.createProgram, and not yet deleted with glDeleteProgram is a name of a program object.'); + isProgram = gl.isProgram(program); + assertMsgOptions(!isProgram, 'Got invalid boolean value', false, true); + + program = gl.createProgram(); + isProgram = gl.isProgram(program); + assertMsgOptions(isProgram, 'Got invalid boolean value', false, true); + + gl.deleteProgram(program); + isProgram = gl.isProgram(program); + assertMsgOptions(!isProgram, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_renderbuffer', 'Invalid gl.isRenderbuffer() usage', gl, function() { + /** @type{WebGLRenderbuffer} */ var rbo; + /** @type{boolean} */ var isRbo; + + bufferedLogToConsole('A name returned by glGenRenderbuffers, but not yet bound through a call to gl.bindRenderbuffer or gl.framebufferRenderbuffer is not the name of a renderbuffer object.'); + isRbo = gl.isRenderbuffer(rbo); + assertMsgOptions(!isRbo, 'Got invalid boolean value', false, true); + + rbo = gl.createRenderbuffer(); + isRbo = gl.isRenderbuffer(rbo); + assertMsgOptions(!isRbo, 'Got invalid boolean value', false, true); + + gl.bindRenderbuffer (gl.RENDERBUFFER, rbo); + isRbo = gl.isRenderbuffer(rbo); + assertMsgOptions(isRbo, 'Got invalid boolean value', false, true); + + gl.bindRenderbuffer (gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(rbo); + isRbo = gl.isRenderbuffer(rbo); + assertMsgOptions(!isRbo, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_shader', 'Invalid gl.isShader() usage', gl, function() { + /** @type{WebGLShader} */ var shader; + /** @type{boolean} */ var isShader; + + bufferedLogToConsole('A name created with glCreateShader, and not yet deleted with glDeleteShader is a name of a shader object.'); + isShader = gl.isProgram(shader); + assertMsgOptions(!isShader, 'Got invalid boolean value', false, true); + + shader = gl.createShader(gl.VERTEX_SHADER); + isShader = gl.isShader(shader); + assertMsgOptions(isShader, 'Got invalid boolean value', false, true); + + gl.deleteShader (shader); + isShader = gl.isShader(shader); + assertMsgOptions(!isShader, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_texture', 'Invalid gl.isTexture() usage', gl, function() { + /** @type{WebGLTexture} */ var texture; + /** @type{boolean} */ var isTexture; + + bufferedLogToConsole('A name returned by glGenTextures, but not yet bound through a call to glBindTexture is not the name of a texture.'); + isTexture = gl.isTexture(texture); + assertMsgOptions(!isTexture, 'Got invalid boolean value', false, true); + + texture = gl.createTexture(); + isTexture = gl.isTexture(texture); + assertMsgOptions(!isTexture, 'Got invalid boolean value', false, true); + + gl.bindTexture (gl.TEXTURE_2D, texture); + isTexture = gl.isTexture(texture); + assertMsgOptions(isTexture, 'Got invalid boolean value', false, true); + + gl.bindTexture (gl.TEXTURE_2D, null); + gl.deleteTexture(texture); + isTexture = gl.isTexture(texture); + assertMsgOptions(!isTexture, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_query', 'Invalid gl.isQuery() usage', gl, function() { + /** @type{WebGLQuery} */ var query; + /** @type{boolean} */ var isQuery; + + bufferedLogToConsole('A name returned by glGenQueries, but not yet associated with a query object by calling gl.beginQuery, is not the name of a query object.'); + isQuery = gl.isQuery(query); + assertMsgOptions(!isQuery, 'Got invalid boolean value', false, true); + + query = gl.createQuery(); + isQuery = gl.isQuery(query); + assertMsgOptions(!isQuery, 'Got invalid boolean value', false, true); + + gl.beginQuery (gl.ANY_SAMPLES_PASSED, query); + isQuery = gl.isQuery(query); + assertMsgOptions(isQuery, 'Got invalid boolean value', false, true); + + gl.endQuery (gl.ANY_SAMPLES_PASSED); + gl.deleteQuery (query); + isQuery = gl.isQuery(query); + assertMsgOptions(!isQuery, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_sampler', 'Invalid gl.isSampler() usage', gl, function() { + /** @type{WebGLSampler} */ var sampler; + /** @type{boolean} */ var isSampler; + + bufferedLogToConsole('A name returned by glGenSamplers is the name of a sampler object.'); + isSampler = gl.isSampler(sampler); + assertMsgOptions(!isSampler, 'Got invalid boolean value', false, true); + + sampler = gl.createSampler(); + isSampler = gl.isSampler(sampler); + assertMsgOptions(isSampler, 'Got invalid boolean value', false, true); + + gl.bindSampler(0, sampler); + isSampler = gl.isSampler(sampler); + assertMsgOptions(isSampler, 'Got invalid boolean value', false, true); + + gl.deleteSampler(sampler); + isSampler = gl.isSampler(sampler); + assertMsgOptions(!isSampler, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_sync', 'Invalid gl.isSync() usage', gl, function() { + /** @type{WebGLSync} */ var sync; + /** @type{boolean} */ var isSync; + + bufferedLogToConsole('A name returned by gl.fenceSync is the name of a sync object.'); + isSync = gl.isSync(sync); + assertMsgOptions(!isSync, 'Got invalid boolean value', false, true); + + sync = gl.fenceSync (gl.SYNC_GPU_COMMANDS_COMPLETE, 0); + isSync = gl.isSync(sync); + assertMsgOptions(isSync, 'Got invalid boolean value', false, true); + + gl.deleteSync (sync); + isSync = gl.isSync(sync); + assertMsgOptions(!isSync, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_transform_feedback', 'Invalid gl.isTransformFeedback() usage', gl, function() { + /** @type{WebGLTransformFeedback} */ var tf; + /** @type{boolean} */ var isTF; + + bufferedLogToConsole('A name returned by glGenTransformFeedbacks, but not yet bound using glBindTransformFeedback, is not the name of a transform feedback object.'); + isTF = gl.isTransformFeedback(tf); + assertMsgOptions(!isTF, 'Got invalid boolean value', false, true); + + tf = gl.createTransformFeedback(); + isTF = gl.isTransformFeedback(tf); + assertMsgOptions(!isTF, 'Got invalid boolean value', false, true); + + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tf); + isTF = gl.isTransformFeedback(tf); + assertMsgOptions(isTF, 'Got invalid boolean value', false, true); + + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, null); + gl.deleteTransformFeedback (tf); + isTF = gl.isTransformFeedback(tf); + assertMsgOptions(!isTF, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_vertex_array', 'Invalid gl.isVertexArray() usage', gl, function() { + /** @type{WebGLVertexArrayObject} */ var vao; + /** @type{boolean} */ var isVao; + + bufferedLogToConsole('A name returned by glGenVertexArrays, but not yet bound using glBindVertexArray, is not the name of a vertex array object.'); + isVao = gl.isVertexArray(vao); + assertMsgOptions(!isVao, 'Got invalid boolean value', false, true); + + vao = gl.createVertexArray(); + isVao = gl.isVertexArray(vao); + assertMsgOptions(!isVao, 'Got invalid boolean value', false, true); + + gl.bindVertexArray (vao); + isVao = gl.isVertexArray(vao); + assertMsgOptions(isVao, 'Got invalid boolean value', false, true); + + gl.bindVertexArray (null); + gl.deleteVertexArray (vao); + isVao = gl.isVertexArray(vao); + assertMsgOptions(!isVao, 'Got invalid boolean value', false, true); + + this.expectError (gl.NO_ERROR); + })); + }; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeStateApiTests.run = function(gl) { + var testName = 'state'; + var testDescription = 'Negative GL State API Cases'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fNegativeStateApiTests.init(gl); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js new file mode 100644 index 000000000..1d1bc2f89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js @@ -0,0 +1,3002 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES 3.0 Module + * ------------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Negative Texture API tests. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('functional.gles3.es3fNegativeTextureApiTests'); + +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + + var es3fNegativeTextureApiTests = functional.gles3.es3fNegativeTextureApiTests; + var tcuTexture = framework.common.tcuTexture; + var es3fApiCase = functional.gles3.es3fApiCase; + var tcuTestCase = framework.common.tcuTestCase; + var gluTexture = framework.opengl.gluTexture; + var gluTextureUtil = framework.opengl.gluTextureUtil; + + function etc2Unsupported() { + debug("Skipping test: no support for WEBGL_compressed_texture_etc"); + } + + + /** + * @param {number} width + * @param {number} height + * @return {number} + */ + es3fNegativeTextureApiTests.etc2DataSize = function(width, height) { + return Math.ceil(width / 4) * Math.ceil(height / 4) * 8; + }; + + /** + * @param {number} width + * @param {number} height + * @return {number} + */ + es3fNegativeTextureApiTests.etc2EacDataSize = function(width, height) { + return 2 * es3fNegativeTextureApiTests.etc2DataSize(width, height); + }; + + /** + * @param {function(number)} func + */ + es3fNegativeTextureApiTests.forCubeFaces = function(func) { + var faceGLVar; + for (var faceIterTcu in tcuTexture.CubeFace) { + faceGLVar = gluTexture.cubeFaceToGLFace(tcuTexture.CubeFace[faceIterTcu]); + func(faceGLVar); + } + }; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeTextureApiTests.init = function(gl) { + + var haveCompressedTextureETC = gluTextureUtil.enableCompressedTextureETC(); + + var testGroup = tcuTestCase.runner.testCases; + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('activetexture', 'Invalid gl.ActiveTexture() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if texture is not one of gl.TEXTUREi, where i ranges from 0 to (gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1).'); + gl.activeTexture(-1); + this.expectError(gl.INVALID_ENUM); + var numMaxTextureUnits = /** @type {number} */(gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)); + gl.activeTexture(gl.TEXTURE0 + numMaxTextureUnits); + this.expectError(gl.INVALID_ENUM); + + })); + + // gl.bindTexture + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('bindTexture', 'Invalid gl.bindTexture() usage', gl, + function() { + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the allowable values.'); + gl.bindTexture(0, texture[0]); + this.expectError(gl.INVALID_ENUM); + gl.bindTexture(gl.FRAMEBUFFER, texture[0]); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if texture was previously created with a target that doesn\'t match that of target.'); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + this.expectError(gl.NO_ERROR); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[0]); + this.expectError(gl.INVALID_OPERATION); + gl.bindTexture(gl.TEXTURE_3D, texture[0]); + this.expectError(gl.INVALID_OPERATION); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, texture[0]); + this.expectError(gl.INVALID_OPERATION); + + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + this.expectError(gl.NO_ERROR); + gl.bindTexture(gl.TEXTURE_2D, texture[1]); + this.expectError(gl.INVALID_OPERATION); + gl.bindTexture(gl.TEXTURE_3D, texture[1]); + this.expectError(gl.INVALID_OPERATION); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, texture[1]); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + // gl.compressedTexImage2D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_target', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0); + gl.compressedTexImage2D(0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_format', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not a supported format returned in gl.COMPRESSED_TEXTURE_FORMATS.'); + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, 0, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, 0, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, 0, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, 0, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, 0, 0, 0, 0, uint8); + this.expectError(gl.INVALID_ENUM); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_neg_level', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0); + gl.compressedTexImage2D(gl.TEXTURE_2D, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_max_level', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE) for a 2d texture target.'); + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)); + + /** @type {number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.compressedTexImage2D(gl.TEXTURE_2D, log2MaxTextureSize, gl.COMPRESSED_RGB8_ETC2, 16, 16, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE) for a cubemap target.'); + /** @type {number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1; + + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_neg_width_height', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.'); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_max_width_height', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + var maxTextureSize = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1; + var maxCubemapSize = /** @type {number} */ (gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) + 1; + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_TEXTURE_SIZE.'); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxTextureSize, 1))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxTextureSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(1, maxTextureSize))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, maxTextureSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxTextureSize, maxTextureSize))); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, 1))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(1, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, 1))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(1, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, 1))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(1, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, 1))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(1, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, 1))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(1, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, 1))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(1, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, maxCubemapSize, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(maxCubemapSize, maxCubemapSize))); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_border', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.'); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_size', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + + /** @type {WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.'); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, new Uint8Array(1)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(4 * 4 * 8)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGB8_ETC2, 16, 16, 0, new Uint8Array(4 * 4 * 16)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_SIGNED_R11_EAC, 16, 16, 0, new Uint8Array(4 * 4 * 16)); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture); + + + })); + + // gl.copyTexImage2D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_invalid_target', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.copyTexImage2D(0, 0, gl.RGB, 0, 0, 64, 64, 0); + this.expectError(gl.INVALID_ENUM); + + + gl.deleteTexture(texture); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_invalid_format', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_ENUM or gl.INVALID_VALUE is generated if internalformat is not an accepted format.'); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 64, 64, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, 0, 16, 16, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, 0, 0, 0, 16, 16, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, 0, 0, 0, 16, 16, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, 0, 0, 0, 16, 16, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, 0, 0, 0, 16, 16, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, 0, 0, 0, 16, 16, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_inequal_width_height_cube', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is one of the six cube map 2D image targets and the width and height parameters are not equal.'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 16, 17, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 16, 17, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 16, 17, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 16, 17, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 16, 17, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 16, 17, 0); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_neg_level', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.copyTexImage2D(gl.TEXTURE_2D, -1, gl.RGB, 0, 0, 64, 64, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, -1, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, -1, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, -1, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, -1, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, -1, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, -1, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_max_level', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + /** @type {number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.copyTexImage2D(gl.TEXTURE_2D, log2MaxTextureSize, gl.RGB, 0, 0, 64, 64, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).'); + /** @type {number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1; + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_neg_width_height', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.'); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, -1, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 1, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, -1, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, -1, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 1, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, -1, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, -1, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 1, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, -1, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, -1, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 1, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, -1, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, -1, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 1, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, -1, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, -1, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 1, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, -1, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, -1, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 1, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, -1, -1, 0); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_max_width_height', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + var maxTextureSize = /** @type {number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1; + var maxCubemapSize = /** @type {number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) + 1; + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_TEXTURE_SIZE.'); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, maxTextureSize, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 1, maxTextureSize, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, maxTextureSize, maxTextureSize, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_invalid_border', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.'); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 0, 0, 1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 0, 0, 1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 0, 0, 1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 0, 0, 1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 0, 0, 1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 0, 0, 1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 0, 0, 1); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_incomplete_framebuffer', 'Invalid gl.copyTexImage2D() usage', gl, + function() { + + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + /** @type {WebGLFramebuffer} */ var fbo; + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGBA8, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGBA8, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGBA8, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGBA8, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGBA8, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGBA8, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + // gl.copyTexSubImage2D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_invalid_target', 'Invalid gl.copyTexSubImage2D() usage', gl, + function() { + + /** @type {WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.copyTexSubImage2D(0, 0, 0, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_ENUM); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_neg_level', 'Invalid gl.copyTexSubImage2D() usage', gl, + function() { + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.texImage2D(faceGL, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.copyTexSubImage2D(gl.TEXTURE_2D, -1, 0, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + var local = this; + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.copyTexSubImage2D(faceGL, -1, 0, 0, 0, 0, 4, 4); + local.expectError(gl.INVALID_VALUE); + }); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_max_level', 'Invalid gl.copyTexSubImage2D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.texImage2D(faceGL, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + }); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE) for 2D texture targets.'); + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.copyTexSubImage2D(gl.TEXTURE_2D, log2MaxTextureSize, 0, 0, 0, 0, 4, 4); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_SIZE) for cubemap targets.'); + /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1; + var local = this; + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.copyTexSubImage2D(faceGL, log2MaxCubemapSize, 0, 0, 0, 0, 4, 4); + local.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + }); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_neg_offset', 'Invalid gl.copyTexSubImage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset < 0 or yoffset < 0.'); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, -1, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, -1, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, -1, -1, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_invalid_offset', 'Invalid gl.copyTexSubImage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width or yoffset + height > texture_height.'); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 14, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 14, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 14, 14, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_neg_width_height', 'Invalid gl.copyTexSubImage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.'); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, -1, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 0, -1); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, -1, -1); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_incomplete_framebuffer', 'Invalid gl.copyTexSubImage2D() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + /** @type{Array} */ var texture = []; + /** @type{WebGLFramebuffer} */ var fbo; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.NO_ERROR); + + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, 0, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, 0, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, 0, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, 0, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, 0, 0, 0, 0, 0, 0); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + // glDeleteTextures + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('deletetextures', 'glDeleteTextures() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + + bufferedLogToConsole('gl.NO_ERROR is generated if texture is null.'); + gl.deleteTexture(null); + this.expectError(gl.NO_ERROR); + + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.deleteTexture(null); + this.expectError(gl.NO_ERROR); + + gl.deleteTexture(texture); + })); + + // gl.generateMipmap + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('generatemipmap', 'Invalid gl.generateMipmap() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{Array} */ var texture = []; + /** @type{WebGLFramebuffer} */ var fbo; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TEXTURE_2D or gl.TEXTURE_CUBE_MAP.'); + gl.generateMipmap(0); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('INVALID_OPERATION is generated if the texture bound to target is not cube complete.'); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[0]); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.REPEAT); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + this.expectError(gl.INVALID_OPERATION); + + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[0]); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the zero level array is stored in a compressed internal format.'); + gl.bindTexture(gl.TEXTURE_2D, texture[1]); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, new Uint8Array(0)); + gl.generateMipmap(gl.TEXTURE_2D); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the level base array was not specified with an unsized internal format or a sized internal format that is both color-renderable and texture-filterable.'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB8_SNORM, 0, 0, 0, gl.RGB, gl.BYTE, null); + gl.generateMipmap(gl.TEXTURE_2D); + this.expectError(gl.INVALID_OPERATION); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.R8I, 0, 0, 0, gl.RED_INTEGER, gl.BYTE, null); + gl.generateMipmap(gl.TEXTURE_2D); + this.expectError(gl.INVALID_OPERATION); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, 0, 0, 0, gl.RGBA, gl.FLOAT, null); + gl.generateMipmap(gl.TEXTURE_2D); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + // gl.pixelStorei + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('pixelstorei', 'Invalid gl.pixelStorei() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.'); + gl.pixelStorei(0,1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if a negative row length, pixel skip, or row skip value is specified, or if alignment is specified as other than 1, 2, 4, or 8.'); + gl.pixelStorei(gl.PACK_ROW_LENGTH, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.PACK_SKIP_ROWS, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.PACK_SKIP_PIXELS, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.UNPACK_ROW_LENGTH, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, -1); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.PACK_ALIGNMENT, 0); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.UNPACK_ALIGNMENT, 0); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.PACK_ALIGNMENT, 16); + this.expectError(gl.INVALID_VALUE); + gl.pixelStorei(gl.UNPACK_ALIGNMENT, 16); + this.expectError(gl.INVALID_VALUE); + + })); + + // gl.texImage2D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d', 'Invalid gl.texImage2D() usage', gl, + function() { + + + /** @type {WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.texImage2D(0, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, 0, null); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, 0, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if internalFormat is not one of the accepted resolution and format symbolic constants.'); + gl.texImage2D(gl.TEXTURE_2D, 0, 0, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat, format and type is invalid.'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB5_A1, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB10_A2, 1, 1, 0, gl.RGB, gl.UNSIGNED_INT_2_10_10_10_REV, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 1, 1, 0, gl.RGBA_INTEGER, gl.INT, null); + this.expectError(gl.INVALID_OPERATION); + + + gl.deleteTexture(texture); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_inequal_width_height_cube', 'Invalid gl.texImage2D() usage', gl, + function() { + + /** @type {WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if target is one of the six cube map 2D image targets and the width and height parameters are not equal.'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_neg_level', 'Invalid gl.texImage2D() usage', gl, + function() { + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.texImage2D(gl.TEXTURE_2D, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_max_level', 'Invalid gl.texImage2D() usage', gl, + function() { + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.texImage2D(gl.TEXTURE_2D, log2MaxTextureSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1; + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_neg_width_height', 'Invalid gl.texImage2D() usage', gl, + function() { + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.'); + + bufferedLogToConsole('gl.TEXTURE_2D target'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_max_width_height', 'Invalid gl.texImage2D() usage', gl, + function() { + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + var maxTextureSize = /** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1; + var maxCubemapSize = /** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) + 1; + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_TEXTURE_SIZE.'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, maxTextureSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, maxTextureSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, maxTextureSize, maxTextureSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_CUBE_MAP_TEXTURE_SIZE.'); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target'); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_invalid_border', 'Invalid gl.texImage2D() usage', gl, + function() { + + /** @type {Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + + + bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, -1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + // gl.texSubImage2D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d', 'Invalid gl.texSubImage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(64); + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.texSubImage2D(0, 0, 0, 0, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.'); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 4, 4, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.'); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, 0, uint8); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat of the previously specified texture array, format and type is not valid.'); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGBA, gl.UNSIGNED_SHORT_5_6_5, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGBA_INTEGER, gl.UNSIGNED_INT, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.FLOAT, uint8); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_neg_level', 'Invalid gl.texSubImage2D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.texImage2D(faceGL, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + }); + this.expectError(gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.texSubImage2D(gl.TEXTURE_2D, -1, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + var local = this; + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.texSubImage2D(faceGL, -1, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8); + local.expectError(gl.INVALID_VALUE); + }); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_max_level', 'Invalid gl.texSubImage2D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture[0]); + gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + gl.bindTexture (gl.TEXTURE_CUBE_MAP, texture[1]); + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.texImage2D(faceGL, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + }); + + this.expectError (gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.texSubImage2D(gl.TEXTURE_2D, log2MaxTextureSize, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1; + var local = this; + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.texSubImage2D(faceGL, log2MaxCubemapSize, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8); + local.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + }); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_neg_offset', 'Invalid gl.texSubImage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset or yoffset are negative.'); + gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, -1, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, -1, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_invalid_offset', 'Invalid gl.texSubImage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(64); + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width or yoffset + height > texture_height.'); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 30, 0, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 30, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 30, 30, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_neg_width_height', 'Invalid gl.texSubImage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.'); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -1, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + // gl.texParameteri + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texparameteri', 'Invalid gl.texParameteri() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.'); + gl.texParameteri(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameteri(gl.TEXTURE_2D, 0, gl.LINEAR); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameteri(0, 0, gl.LINEAR); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.'); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.'); + gl.texParameteri(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + this.expectError(gl.INVALID_ENUM); + gl.texParameteri(gl.TEXTURE_2D, 0, gl.LINEAR); + this.expectError(gl.INVALID_ENUM); + gl.texParameteri(0, 0, gl.LINEAR); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.'); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0); + this.expectError(gl.INVALID_ENUM); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT); + this.expectError(gl.INVALID_ENUM); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0); + this.expectError(gl.INVALID_ENUM); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST); + this.expectError(gl.INVALID_ENUM); + + gl.deleteTexture(texture); + })); + + // gl.texParameterf + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texparameterf', 'Invalid gl.texParameterf() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.'); + gl.texParameterf(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameterf(gl.TEXTURE_2D, 0, gl.LINEAR); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameterf(0, 0, gl.LINEAR); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.'); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST); + this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]); + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.'); + gl.texParameterf(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + this.expectError(gl.INVALID_ENUM); + gl.texParameterf(gl.TEXTURE_2D, 0, gl.LINEAR); + this.expectError(gl.INVALID_ENUM); + gl.texParameterf(0, 0, gl.LINEAR); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.'); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0); + this.expectError(gl.INVALID_ENUM); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT); + this.expectError(gl.INVALID_ENUM); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0); + this.expectError(gl.INVALID_ENUM); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST); + this.expectError(gl.INVALID_ENUM); + + gl.deleteTexture(texture); + })); + + // gl.compressedTexSubImage2D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d', 'Invalid gl.compressedTexSubImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.compressedTexSubImage2D(0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGB8_ETC2, new Uint8Array(0)); + this.expectError(gl.INVALID_ENUM); + + gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if format does not match the internal format of the texture image being modified.'); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.COMPRESSED_RGB8_ETC2, new Uint8Array(0)); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if width is not a multiple of four, and width + xoffset is not equal to the width of the texture level.'); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 4, 0, 10, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(10, 4))); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if height is not a multiple of four, and height + yoffset is not equal to the height of the texture level.'); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 4, 4, 10, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 10))); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if xoffset or yoffset is not a multiple of four.'); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 1, 4, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError(gl.INVALID_OPERATION); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 1, 0, 4, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError(gl.INVALID_OPERATION); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 1, 1, 4, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_neg_level', 'Invalid gl.compressedTexSubImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18))); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.compressedTexImage2D(faceGL, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18))); + }); + + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, -1, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + var local = this; + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.compressedTexSubImage2D(faceGL, -1, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + local.expectError(gl.INVALID_VALUE); + }); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_max_level', 'Invalid gl.compressedTexSubImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture[0]); + gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18))); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]); + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.compressedTexImage2D(faceGL, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18))); + }); + + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.compressedTexSubImage2D(gl.TEXTURE_2D, log2MaxTextureSize, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1; + var local = this; + es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) { + gl.compressedTexSubImage2D(faceGL, log2MaxCubemapSize, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + local.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + }); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_neg_offset', 'Invalid gl.compressedTexSubImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 8, 8, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 8))); + + // \note Both gl.INVALID_VALUE and gl.INVALID_OPERATION are valid here since implementation may + // first check if offsets are valid for certain format and only after that check that they + // are not negative. + bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset or yoffset are negative.'); + + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, -4, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, -4, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, -4, -4, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_invalid_offset', 'Invalid gl.compressedTexSubImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture); + gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset + width > texture_width or yoffset + height > texture_height.'); + + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 12, 0, 8, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 4))); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 12, 4, 8, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 8))); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 12, 12, 8, 8, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 8))); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_neg_width_height', 'Invalid gl.compressedTexSubImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture); + gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if width or height is less than 0.'); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -4, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -4, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_invalid_size', 'Invalid gl.compressedTexImage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture); + gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.'); + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(1)); + this.expectError(gl.INVALID_VALUE); + + gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 16, 16, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(4*4*16-1)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + // gl.texImage3D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d', 'Invalid gl.texImage3D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture[0]); + gl.bindTexture (gl.TEXTURE_3D, texture[1]); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.texImage3D(0, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_ENUM); + gl.texImage3D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.'); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, 0, null); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.'); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, 0, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if internalFormat is not one of the accepted resolution and format symbolic constants.'); + gl.texImage3D(gl.TEXTURE_3D, 0, 0, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if target is gl.TEXTURE_3D and format is gl.DEPTH_COMPONENT, or gl.DEPTH_STENCIL.'); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat, format and type is invalid.'); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB5_A1, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB10_A2, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_INT_2_10_10_10_REV, null); + this.expectError(gl.INVALID_OPERATION); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA32UI, 1, 1, 1, 0, gl.RGBA_INTEGER, gl.INT, null); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_neg_level', 'Invalid gl.texImage3D() usage', gl, + function() { + // NOTE: this method hangs the browser if the textures are binded. + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.texImage3D(gl.TEXTURE_3D, -1, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, -1, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_max_level', 'Invalid gl.texImage3D() usage', gl, + function() { + + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_3D_TEXTURE_SIZE).'); + /** @type{number} */ var log2Max3DTextureSize = Math.floor(Math.log2(/** @type{number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)))) + 1; + gl.texImage3D(gl.TEXTURE_3D, log2Max3DTextureSize, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.texImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_neg_width_height_depth', 'Invalid gl.texImage3D() usage', gl, + function() { + + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.'); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, -1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, -1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, -1, -1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, -1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, -1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, 1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, -1, -1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_max_width_height_depth', 'Invalid gl.texImage3D() usage', gl, + function() { + + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + + var max3DTextureSize = /** @type{number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)) + 1; + var maxTextureSize = /** @type{number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1; + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is greater than gl.MAX_3D_TEXTURE_SIZE.'); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, max3DTextureSize, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, max3DTextureSize, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, max3DTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, max3DTextureSize, max3DTextureSize, max3DTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is greater than gl.MAX_TEXTURE_SIZE.'); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, maxTextureSize, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, maxTextureSize, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, 1, maxTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, maxTextureSize, maxTextureSize, maxTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_invalid_border', 'Invalid gl.texImage3D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0 or 1.'); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB, 1, 1, 1, -1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB, 1, 1, 1, 2, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGB, 1, 1, 1, -1, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGB, 1, 1, 1, 2, gl.RGB, gl.UNSIGNED_BYTE, null); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + // gl.texSubImage3D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d', 'Invalid gl.texSubImage3D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError (gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(256); + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.texSubImage3D(0, 0, 0, 0, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_ENUM); + gl.texSubImage3D(gl.TEXTURE_2D, 0, 0, 0, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 4, 4, 4, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, 0, uint8); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat of the previously specified texture array, format and type is not valid.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGBA_INTEGER, gl.UNSIGNED_INT, uint8); + this.expectError(gl.INVALID_OPERATION); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.FLOAT, uint8); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_neg_level', 'Invalid gl.texSubImage3D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError (gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.texSubImage3D(gl.TEXTURE_3D, -1, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, -1, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_max_level', 'Invalid gl.texSubImage3D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError (gl.NO_ERROR); + + /** @type{number} */ var log2Max3DTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)))) + 1; + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_3D_TEXTURE_SIZE).'); + gl.texSubImage3D(gl.TEXTURE_3D, log2Max3DTextureSize, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_neg_offset', 'Invalid gl.texSubImage3D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError (gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset, yoffset or zoffset are negative.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, -1, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, -1, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_3D, 0, -1, -1, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -1, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, -1, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -1, -1, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_invalid_offset', 'Invalid gl.texSubImage3D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError (gl.NO_ERROR); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(256); + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 2, 0, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if yoffset + height > texture_height.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 2, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if zoffset + depth > texture_depth.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 2, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_neg_width_height', 'Invalid gl.texSubImage3D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4); + bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is less than 0.'); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, -1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, -1, -1, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d', 'Invalid gl.copyTexSubImage3D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.copyTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 4, 0); + this.expectError(gl.INVALID_ENUM); + + gl.deleteTexture(texture); + })); + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_neg_level', 'Invalid gl.copyTexSubImage3D() usage', gl, + function() { + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, -1, 0, 0, 0, 0, 0, 4, 0); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage3D(gl.TEXTURE_2D_ARRAY, -1, 0, 0, 0, 0, 0, 4, 0); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_max_level', 'Invalid gl.copyTexSubImage3D() usage', gl, + function() { + /** @type{number} */ var log2Max3DTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)))) + 1; + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + + /** @type{Array} */ var texture = []; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture[0]); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_3D_TEXTURE_SIZE).'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, log2Max3DTextureSize, 0, 0, 0, 0, 0, 4, 0); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + gl.copyTexSubImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, 0, 0, 0, 0, 0, 4, 0); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_neg_offset', 'Invalid gl.copyTexSubImage3D() usage', gl, + function() { + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset, yoffset or zoffset is negative.'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, -1, 0, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, -1, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, -1, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, -1, -1, -1, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_invalid_offset', 'Invalid gl.copyTexSubImage3D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width.'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 1, 0, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if yoffset + height > texture_height.'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 1, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if zoffset + 1 > texture_depth.'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 4, 0, 0, 4, 4); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_neg_width_height', 'Invalid gl.copyTexSubImage3D() usage', gl, + function() { + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width < 0.'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, -4, 4); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if height < 0.'); + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, 4, -4); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_incomplete_framebuffer', 'Invalid gl.copyTexSubImage3D() usage', gl, + function() { + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + /** @type{Array} */ var texture = []; + /** @type{WebGLFramebuffer} */ var fbo; + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_3D, texture[0]); + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, texture[1]); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + this.expectError(gl.NO_ERROR); + + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.READ_FRAMEBUFFER); + this.expectError(gl.NO_ERROR); + + gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.copyTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, 4, 4); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + // gl.compressedTexImage3D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d', 'Invalid gl.compressedTexImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{Array} */ var texture = []; + + // We have to create and bind textures to each target for the test because default textures are not supported by WebGL. + texture[0] = gl.createTexture(); + texture[1] = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_CUBE_MAP, texture[0]); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + gl.compressedTexImage3D(0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage3D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not one of the specific compressed internal formats.'); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_ENUM); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA8, 0, 0, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_ENUM); + + gl.deleteTexture(texture[0]); + gl.deleteTexture(texture[1]); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_neg_level', 'Invalid gl.compressedTexImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_max_level', 'Invalid gl.compressedTexImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_neg_width_height_depth', 'Invalid gl.compressedTexImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is less than 0.'); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, -1, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_max_width_height_depth', 'Invalid gl.compressedTexImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + + var maxTextureSize = /** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1; + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is greater than gl.MAX_TEXTURE_SIZE.'); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, 0, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, maxTextureSize, 0, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, maxTextureSize, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, maxTextureSize, maxTextureSize, 0, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_invalid_border', 'Invalid gl.compressedTexImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.'); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, -1, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 1, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_invalid_size', 'Invalid gl.compressedTexImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{ WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.'); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(1)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(4*4*8)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGB8_ETC2, 16, 16, 1, 0, new Uint8Array(4*4*16)); + this.expectError(gl.INVALID_VALUE); + gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_SIGNED_R11_EAC, 16, 16, 1, 0, new Uint8Array(4*4*16)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + + })); + + // gl.compressedTexSubImage3D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d', 'Invalid gl.compressedTexSubImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.'); + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.compressedTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError(gl.INVALID_ENUM); + + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if format does not match the internal format of the texture image being modified.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGB8_ETC2, new Uint8Array(0)); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if internalformat is an ETC2/EAC format and target is not gl.TEXTURE_2D_ARRAY.'); + gl.compressedTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 18, 18, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18))); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if width is not a multiple of four, and width + xoffset is not equal to the width of the texture level.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 4, 0, 0, 10, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(10, 4))); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if height is not a multiple of four, and height + yoffset is not equal to the height of the texture level.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 4, 0, 4, 10, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 10))); + this.expectError(gl.INVALID_OPERATION); + + bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if xoffset or yoffset is not a multiple of four.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 1, 0, 0, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError(gl.INVALID_OPERATION); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 1, 0, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError(gl.INVALID_OPERATION); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 1, 1, 0, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_neg_level', 'Invalid gl.compressedTexSubImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, -1, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_max_level', 'Invalid gl.compressedTexSubImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).'); + /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1; + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_neg_offset', 'Invalid gl.compressedTexSubImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset, yoffset or zoffset are negative.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -4, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, -4, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, -4, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -4, -4, -4, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_invalid_offset', 'Invalid gl.compressedTexSubImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 4, 4, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset + width > texture_width or yoffset + height > texture_height.'); + + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 12, 0, 0, 8, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 4))); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 12, 0, 4, 8, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 8))); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 12, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4))); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 12, 12, 12, 8, 8, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 8))); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_neg_width_height_depth', 'Invalid gl.compressedTexSubImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16))); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if width, height or depth are negative.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, -4, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, -4, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, -4, -4, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_invalid_size', 'Invalid gl.compressedTexSubImage3D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture); + gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(4*4*16)); + this.expectError (gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.'); + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 16, 16, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0)); + this.expectError(gl.INVALID_VALUE); + + gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 16, 16, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(4*4*16-1)); + this.expectError(gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + // gl.texStorage2D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage2d', 'Invalid gl.texStorage2D() usage', gl, + function() { + if (!haveCompressedTextureETC) { etc2Unsupported(); return; } + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture); + + bufferedLogToConsole('gl.INVALID_ENUM or gl.INVALID_VALUE is generated if internalformat is not a valid sized internal format.'); + gl.texStorage2D (gl.TEXTURE_2D, 1, 0, 16, 16); + this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA_INTEGER, 16, 16); + this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted target enumerants.'); + gl.texStorage2D (0, 1, gl.RGBA8, 16, 16); + this.expectError (gl.INVALID_ENUM); + gl.texStorage2D (gl.TEXTURE_3D, 1, gl.RGBA8, 16, 16); + this.expectError (gl.INVALID_ENUM); + gl.texStorage2D (gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, 16, 16); + this.expectError (gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height are less than 1.'); + gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 0, 16); + this.expectError (gl.INVALID_VALUE); + gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 0); + this.expectError (gl.INVALID_VALUE); + gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 0, 0); + this.expectError (gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage2d_invalid_binding', 'Invalid gl.texStorage2D() usage', gl, + function() { + gl.bindTexture (gl.TEXTURE_2D, null); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if there is no texture object curently bound to target.'); + gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 16); + this.expectError (gl.INVALID_OPERATION); + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the texture object currently bound to target already has gl.TEXTURE_IMMUTABLE_FORMAT set to true.'); + /** @type{number} */ var immutable; + immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_FORMAT)); + bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false')); + gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 16); + this.expectError (gl.NO_ERROR); + immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_FORMAT)); + bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false')); + gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 16); + this.expectError (gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage2d_invalid_levels', 'Invalid gl.texStorage2D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_2D, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if levels is less than 1.'); + gl.texStorage2D (gl.TEXTURE_2D, 0, gl.RGBA8, 16, 16); + this.expectError (gl.INVALID_VALUE); + gl.texStorage2D (gl.TEXTURE_2D, 0, gl.RGBA8, 0, 0); + this.expectError (gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if levels is greater than floor(log_2(max(width, height))) + 1'); + /** @type{number} */ var log2MaxSize = Math.floor(Math.log2(Math.max(16, 4))) + 1 + 1; + gl.texStorage2D (gl.TEXTURE_2D, log2MaxSize, gl.RGBA8, 16, 4); + this.expectError (gl.INVALID_OPERATION); + gl.texStorage2D (gl.TEXTURE_2D, log2MaxSize, gl.RGBA8, 4, 16); + this.expectError (gl.INVALID_OPERATION); + gl.texStorage2D (gl.TEXTURE_2D, log2MaxSize, gl.RGBA8, 16, 16); + this.expectError (gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + + // gl.texStorage3D + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage3d', 'Invalid gl.texStorage3D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + + bufferedLogToConsole('gl.INVALID_ENUM or gl.INVALID_VALUE is generated if internalformat is not a valid sized internal format.'); + gl.texStorage3D (gl.TEXTURE_3D, 1, 0, 4, 4, 4); + this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA_INTEGER, 4, 4, 4); + this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted target enumerants.'); + gl.texStorage3D (0, 1, gl.RGBA8, 4, 4, 4); + this.expectError (gl.INVALID_ENUM); + gl.texStorage3D (gl.TEXTURE_CUBE_MAP, 1, gl.RGBA8, 4, 4, 4); + this.expectError (gl.INVALID_ENUM); + gl.texStorage3D (gl.TEXTURE_2D, 1, gl.RGBA8, 4, 4, 4); + this.expectError (gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth are less than 1.'); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 0, 4, 4); + this.expectError (gl.INVALID_VALUE); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 0, 4); + this.expectError (gl.INVALID_VALUE); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 0); + this.expectError (gl.INVALID_VALUE); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 0, 0, 0); + this.expectError (gl.INVALID_VALUE); + + gl.deleteTexture(texture); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage3d_invalid_binding', 'Invalid gl.texStorage3D() usage', gl, + function() { + gl.bindTexture (gl.TEXTURE_3D, null); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if there is no texture object curently bound to target.'); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 4); + this.expectError (gl.INVALID_OPERATION); + + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if the texture object currently bound to target already has gl.TEXTURE_IMMUTABLE_FORMAT set to true.'); + /** @type{number} */ var immutable; + immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_3D, gl.TEXTURE_IMMUTABLE_FORMAT)); + bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false')); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 4); + this.expectError (gl.NO_ERROR); + immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_3D, gl.TEXTURE_IMMUTABLE_FORMAT)); + bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false')); + gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 4); + this.expectError (gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + + // NOTE: the test doesn't cause glError using the parameters defined in the original test of C code + testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage3d_invalid_levels', 'Invalid gl.texStorage3D() usage', gl, + function() { + /** @type{WebGLTexture} */ var texture; + texture = gl.createTexture(); + gl.bindTexture (gl.TEXTURE_3D, texture); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if levels is less than 1.'); + gl.texStorage3D (gl.TEXTURE_3D, 0, gl.RGBA8, 4, 4, 4); + this.expectError (gl.INVALID_VALUE); + gl.texStorage3D (gl.TEXTURE_3D, 0, gl.RGBA8, 0, 0, 0); + this.expectError (gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if levels is greater than floor(log_2(max(width, height, depth))) + 1'); + /** @type{number} */ var log2MaxSize = Math.floor(Math.log2(8)) + 1 + 1; + gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 8, 2, 2); + this.expectError (gl.INVALID_OPERATION); + gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 2, 8, 2); + this.expectError (gl.INVALID_OPERATION); + gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 2, 2, 8); + this.expectError (gl.INVALID_OPERATION); + gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 8, 8, 8); + this.expectError (gl.INVALID_OPERATION); + + gl.deleteTexture(texture); + })); + }; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeTextureApiTests.run = function(gl) { + var testName = 'negativeTextureApi'; + var testDescription = 'Negative Texture API tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fNegativeTextureApiTests.init(gl); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js new file mode 100644 index 000000000..3ed3347cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js @@ -0,0 +1,910 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES 3.0 Module + * ------------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Negative Vertex Array API tests. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('functional.gles3.es3fNegativeVertexArrayApiTests'); + +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.simplereference.sglrGLContext'); + +goog.scope(function() { + + var es3fNegativeVertexArrayApiTests = functional.gles3.es3fNegativeVertexArrayApiTests; + var tcuTexture = framework.common.tcuTexture; + var es3fApiCase = functional.gles3.es3fApiCase; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + + /** + * @type {string} + * @const + */ + var vertexShaderSource = '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + + /** + * @type {string} + * @const + */ + var fragmentShaderSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeVertexArrayApiTests.init = function(gl) { + + var testGroup = tcuTestCase.runner.testCases; + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribf', 'Invalid glVertexAttrib{1234}f() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + gl.vertexAttrib1f(maxVertexAttribs, 0.0); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttrib2f(maxVertexAttribs, 0.0, 0.0); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttrib3f(maxVertexAttribs, 0.0, 0.0, 0.0); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttrib4f(maxVertexAttribs, 0.0, 0.0, 0.0, 0.0); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribfv', 'Invalid glVertexAttrib{1234}fv() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + /** @type{Array} */ var v = [0.0]; + gl.vertexAttrib1fv(maxVertexAttribs, v); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttrib2fv(maxVertexAttribs, v); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttrib3fv(maxVertexAttribs, v); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttrib4fv(maxVertexAttribs, v); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribi4', 'Invalid glVertexAttribI4{i|ui}f() usage', gl, function() { + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + /** @type{number} */ var valInt = 0; + /** @type{number} */ var valUint = 0; + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + gl.vertexAttribI4i(maxVertexAttribs, valInt, valInt, valInt, valInt); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttribI4ui(maxVertexAttribs, valUint, valUint, valUint, valUint); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribi4v', 'Invalid glVertexAttribI4{i|ui}fv() usage', gl, function() { + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + /** @type{Array} */ var valInt = [0]; + /** @type{Array} */ var valUint = [0]; + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + gl.vertexAttribI4iv(maxVertexAttribs, valInt); + this.expectError(gl.INVALID_VALUE); + gl.vertexAttribI4uiv(maxVertexAttribs, valUint); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attrib_pointer', 'Invalid gl.vertexAttribPointer() usage', gl, function() { + /** @type{WebGLBuffer} */ var buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not an accepted value.'); + gl.vertexAttribPointer(0, 1, 0, true, 0, 0); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + gl.vertexAttribPointer(maxVertexAttribs, 1, gl.BYTE, true, 0, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if size is not 1, 2, 3, or 4.'); + gl.vertexAttribPointer(0, 0, gl.BYTE, true, 0, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if stride is negative.'); + gl.vertexAttribPointer(0, 1, gl.BYTE, true, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if type is gl.INT_2_10_10_10_REV or gl.UNSIGNED_INT_2_10_10_10_REV and size is not 4.'); + gl.vertexAttribPointer(0, 2, gl.INT_2_10_10_10_REV, true, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.vertexAttribPointer(0, 2, gl.UNSIGNED_INT_2_10_10_10_REV, true, 0, 0); + this.expectError(gl.INVALID_OPERATION); + gl.vertexAttribPointer(0, 4, gl.INT_2_10_10_10_REV, true, 0, 0); + this.expectError(gl.NO_ERROR); + gl.vertexAttribPointer(0, 4, gl.UNSIGNED_INT_2_10_10_10_REV, true, 0, 0); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated a non-zero vertex array object is bound, zero is bound to the gl.ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.'); + /** @type{WebGLVertexArrayObject} */ var vao; + /** @type{number} */ var offset = 1; + vao = gl.createVertexArray(); + gl.bindVertexArray(vao); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + this.expectError(gl.NO_ERROR); + + gl.vertexAttribPointer(0, 1, gl.BYTE, true, 0, offset); + this.expectError(gl.INVALID_OPERATION); + + gl.bindVertexArray(null); + gl.deleteVertexArray(vao); + this.expectError(gl.NO_ERROR); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attrib_i_pointer', 'Invalid gl.vertexAttribIPointer() usage', gl, function() { + /** @type{WebGLBuffer} */ var buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not an accepted value.'); + gl.vertexAttribIPointer(0, 1, 0, 0, 0); + this.expectError(gl.INVALID_ENUM); + gl.vertexAttribIPointer(0, 4, gl.INT_2_10_10_10_REV, 0, 0); + this.expectError(gl.INVALID_ENUM); + gl.vertexAttribIPointer(0, 4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, 0); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + gl.vertexAttribIPointer(maxVertexAttribs, 1, gl.BYTE, 0, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if size is not 1, 2, 3, or 4.'); + gl.vertexAttribIPointer(0, 0, gl.BYTE, 0, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if stride is negative.'); + gl.vertexAttribIPointer(0, 1, gl.BYTE, -1, 0); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated a non-zero vertex array object is bound, zero is bound to the gl.ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.'); + /** @type{WebGLVertexArrayObject} */ var vao; + /** @type{number} */ var offset = 1; + vao = gl.createVertexArray(); + gl.bindVertexArray(vao); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + this.expectError(gl.NO_ERROR); + + gl.vertexAttribIPointer(0, 1, gl.BYTE, 0, offset); + this.expectError(gl.INVALID_OPERATION); + + gl.bindVertexArray(null); + gl.deleteVertexArray(vao); + this.expectError(gl.NO_ERROR); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('enable_vertex_attrib_array', 'Invalid gl.enableVertexAttribArray() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + gl.enableVertexAttribArray(maxVertexAttribs); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('disable_vertex_attrib_array', 'Invalid gl.disableVertexAttribArray() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + gl.disableVertexAttribArray(maxVertexAttribs); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attrib_divisor', 'Invalid gl.vertexAttribDivisor() usage', gl, function() { + bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.'); + var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + gl.vertexAttribDivisor(maxVertexAttribs, 0); + this.expectError(gl.INVALID_VALUE); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays', 'Invalid gl.drawArrays() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawArrays(-1, 0, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.'); + gl.drawArrays(gl.POINTS, 0, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawArrays(gl.POINTS, 0, 1); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_invalid_program', 'Invalid gl.drawArrays() usage', gl, function() { + gl.useProgram(null); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is used.'); + gl.drawArrays(gl.POINTS, 0, 1); + this.expectError(gl.INVALID_OPERATION); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_incomplete_primitive', 'Invalid gl.drawArrays() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawArrays(-1, 0, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.'); + gl.drawArrays(gl.TRIANGLES, 0, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawArrays(gl.TRIANGLES, 0, 1); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements', 'Invalid gl.drawElements() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{WebGLBuffer} */ var buf; + /** @type{WebGLTransformFeedback} */ var tfID; + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawElements(-1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.'); + gl.drawElements(gl.POINTS, 1, -1, vertices); + this.expectError(gl.INVALID_ENUM); + gl.drawElements(gl.POINTS, 1, gl.FLOAT, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.'); + gl.drawElements(gl.POINTS, -1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawElements(gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) { // gl.EXT_geometry_shader removes error + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.'); + /** @type{Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID = gl.createTransformFeedback(); + + gl.useProgram (program.getProgram()); + gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram (program.getProgram()); + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback (gl.POINTS); + this.expectError (gl.NO_ERROR); + + gl.drawElements (gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.INVALID_OPERATION); + + gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW); + + gl.pauseTransformFeedback(); + gl.drawElements (gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.NO_ERROR); + + gl.endTransformFeedback (); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(bufElements); + this.expectError (gl.NO_ERROR); + + } + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_invalid_program', 'Invalid gl.drawElements() usage', gl, function() { + gl.useProgram(null); + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) was set.'); + gl.drawElements(gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteBuffer(bufElements); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_incomplete_primitive', 'Invalid gl.drawElements() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{WebGLBuffer} */ var buf; + /** @type{WebGLTransformFeedback} */ var tfID; + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawElements(-1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.'); + gl.drawElements(gl.TRIANGLES, 1, -1, vertices); + this.expectError(gl.INVALID_ENUM); + gl.drawElements(gl.TRIANGLES, 1, gl.FLOAT, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.'); + gl.drawElements(gl.TRIANGLES, -1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.'); + /** @type{Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID = gl.createTransformFeedback(); + + gl.useProgram (program.getProgram()); + gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram (program.getProgram()); + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback (gl.TRIANGLES); + this.expectError (gl.NO_ERROR); + + gl.drawElements (gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.INVALID_OPERATION); + + gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW); + + gl.pauseTransformFeedback(); + gl.drawElements (gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.NO_ERROR); + + gl.endTransformFeedback (); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(bufElements); + this.expectError (gl.NO_ERROR); + + } + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_instanced', 'Invalid gl.drawArraysInstanced() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + + /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, bufElements); + + gl.vertexAttribDivisor(0, 1); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawArraysInstanced(-1, 0, 1, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.'); + gl.drawArraysInstanced(gl.POINTS, 0, -1, 1); + this.expectError(gl.INVALID_VALUE); + gl.drawArraysInstanced(gl.POINTS, 0, 1, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawArraysInstanced(gl.POINTS, 0, 1, 1); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + gl.deleteBuffer(bufElements); + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_instanced_invalid_program', 'Invalid gl.drawArraysInstanced() usage', gl, function() { + gl.useProgram(null); + + /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, bufElements); + + gl.vertexAttribDivisor(0, 1); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is set.'); + gl.drawArraysInstanced(gl.POINTS, 0, 1, 1); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteBuffer(bufElements); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_instanced_incomplete_primitive', 'Invalid gl.drawArraysInstanced() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + + /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, bufElements); + + gl.vertexAttribDivisor(0, 1); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawArraysInstanced(-1, 0, 1, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.'); + gl.drawArraysInstanced(gl.TRIANGLES, 0, -1, 1); + this.expectError(gl.INVALID_VALUE); + gl.drawArraysInstanced(gl.TRIANGLES, 0, 1, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawArraysInstanced(gl.TRIANGLES, 0, 1, 1); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + gl.deleteBuffer(bufElements); + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_instanced', 'Invalid gl.drawElementsInstanced() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{WebGLBuffer} */ var buf; + /** @type{WebGLTransformFeedback} */ var tfID; + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + gl.vertexAttribDivisor(0, 1); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawElementsInstanced(-1, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.'); + gl.drawElementsInstanced(gl.POINTS, 1, -1, vertices, 1); + this.expectError(gl.INVALID_ENUM); + gl.drawElementsInstanced(gl.POINTS, 1, gl.FLOAT, vertices, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.'); + gl.drawElementsInstanced(gl.POINTS, -1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError(gl.INVALID_VALUE); + gl.drawElementsInstanced(gl.POINTS, 11, gl.UNSIGNED_BYTE, vertices, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawElementsInstanced(gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.'); + /** @type{Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID = gl.createTransformFeedback(); + + gl.useProgram (program.getProgram()); + gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram (program.getProgram()); + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback (gl.POINTS); + this.expectError (gl.NO_ERROR); + + gl.drawElementsInstanced (gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError (gl.INVALID_OPERATION); + + gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW); + + gl.pauseTransformFeedback(); + // WebGL has different limitation on divisor of zero from C++ code. + // In the WebGL 2.0 API, instanced drawing needs at leas one enabled attribute with divisor zero. + gl.drawElementsInstanced (gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError (gl.INVALID_OPERATION); + + gl.endTransformFeedback (); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(bufElements); + this.expectError (gl.NO_ERROR); + + } + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_instanced_invalid_program', 'Invalid gl.drawElementsInstanced() usage', gl, function() { + gl.useProgram(null); + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements; + bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + gl.vertexAttribDivisor(0, 1); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is set.'); + gl.drawElementsInstanced(gl.POINTS, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteBuffer(bufElements); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_instanced_incomplete_primitive', 'Invalid gl.drawElementsInstanced() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{WebGLBuffer} */ var buf; + /** @type{WebGLTransformFeedback} */ var tfID; + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements; + bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + gl.vertexAttribDivisor(0, 1); + this.expectError(gl.NO_ERROR); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawElementsInstanced(-1, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.'); + gl.drawElementsInstanced(gl.TRIANGLES, 1, -1, vertices, 1); + this.expectError(gl.INVALID_ENUM); + gl.drawElementsInstanced(gl.TRIANGLES, 1, gl.FLOAT, vertices, 1); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.'); + gl.drawElementsInstanced(gl.TRIANGLES, -1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError(gl.INVALID_VALUE); + gl.drawElementsInstanced(gl.TRIANGLES, 11, gl.UNSIGNED_BYTE, vertices, -1); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawElementsInstanced(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.'); + /** @type{Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID = gl.createTransformFeedback(); + + gl.useProgram (program.getProgram()); + gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram (program.getProgram()); + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback (gl.TRIANGLES); + this.expectError (gl.NO_ERROR); + + gl.drawElementsInstanced (gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError (gl.INVALID_OPERATION); + + gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW); + + gl.pauseTransformFeedback(); + // WebGL has different limitation on divisor of zero from C++ code. + // In the WebGL 2.0 API, instanced drawing needs at leas one enabled attribute with divisor zero. + gl.drawElementsInstanced (gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, vertices, 1); + this.expectError (gl.INVALID_OPERATION); + + gl.endTransformFeedback (); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(bufElements); + this.expectError (gl.NO_ERROR); + + } + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_range_elements', 'Invalid gl.drawRangeElements() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{WebGLBuffer} */ var buf; + /** @type{WebGLTransformFeedback} */ var tfID; + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements; + bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawRangeElements(-1, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.'); + gl.drawRangeElements(gl.POINTS, 0, 1, 1, -1, vertices); + this.expectError(gl.INVALID_ENUM); + gl.drawRangeElements(gl.POINTS, 0, 1, 1, gl.FLOAT, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.'); + gl.drawRangeElements(gl.POINTS, 0, 1, -1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if end < start.'); + gl.drawRangeElements(gl.POINTS, 1, 0, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawRangeElements(gl.POINTS, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.'); + /** @type{Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID = gl.createTransformFeedback(); + + gl.useProgram (program.getProgram()); + gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram (program.getProgram()); + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback (gl.POINTS); + this.expectError (gl.NO_ERROR); + + gl.drawRangeElements (gl.POINTS, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.INVALID_OPERATION); + + gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW); + + gl.pauseTransformFeedback(); + gl.drawRangeElements (gl.POINTS, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.NO_ERROR); + + gl.endTransformFeedback (); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(bufElements); + this.expectError (gl.NO_ERROR); + + } + + gl.useProgram(null); + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_range_elements_invalid_program', 'Invalid gl.drawRangeElements() usage', gl, function() { + gl.useProgram(null); + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements; + bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW); + + bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is set.'); + gl.drawRangeElements(gl.POINTS, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_OPERATION); + + gl.deleteBuffer(bufElements); + + })); + + testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_range_elements_incomplete_primitive', 'Invalid gl.drawRangeElements() usage', gl, function() { + /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + gl.useProgram(program.getProgram()); + /** @type{WebGLFramebuffer} */ var fbo; + /** @type{WebGLBuffer} */ var buf; + /** @type{WebGLTransformFeedback} */ var tfID; + /** @type{number} */ var vertices = 0; + + /** @type{WebGLBuffer} */ var bufElements; + bufElements = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.'); + gl.drawRangeElements(-1, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.'); + gl.drawRangeElements(gl.TRIANGLES, 0, 1, 1, -1, vertices); + this.expectError(gl.INVALID_ENUM); + gl.drawRangeElements(gl.TRIANGLES, 0, 1, 1, gl.FLOAT, vertices); + this.expectError(gl.INVALID_ENUM); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.'); + gl.drawRangeElements(gl.TRIANGLES, 0, 1, -1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_VALUE is generated if end < start.'); + gl.drawRangeElements(gl.TRIANGLES, 1, 0, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_VALUE); + + bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.'); + fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.checkFramebufferStatus(gl.FRAMEBUFFER); + gl.drawRangeElements(gl.TRIANGLES, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + + if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error + bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.'); + /** @type{Array} */ var tfVarying = ['gl_Position']; + + buf = gl.createBuffer(); + tfID = gl.createTransformFeedback(); + + gl.useProgram (program.getProgram()); + gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram (program.getProgram()); + gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID); + gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf); + gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW); + gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + gl.beginTransformFeedback (gl.TRIANGLES); + this.expectError (gl.NO_ERROR); + + gl.drawRangeElements (gl.TRIANGLES, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.INVALID_OPERATION); + + gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW); + + gl.pauseTransformFeedback(); + gl.drawRangeElements (gl.TRIANGLES, 0, 1, 1, gl.UNSIGNED_BYTE, vertices); + this.expectError (gl.NO_ERROR); + + gl.endTransformFeedback (); + gl.deleteBuffer(buf); + gl.deleteTransformFeedback(tfID); + gl.deleteBuffer(bufElements); + this.expectError (gl.NO_ERROR); + + } + + gl.useProgram(null); + })); + }; + + /** + * @param {WebGL2RenderingContext} gl + */ + es3fNegativeVertexArrayApiTests.run = function(gl) { + var testName = 'vertex_array'; + var testDescription = 'Negative Vertex Array API Cases'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fNegativeVertexArrayApiTests.init(gl); + tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js new file mode 100644 index 000000000..8549d657b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js @@ -0,0 +1,511 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fOcclusionQueryTests'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); + +goog.scope(function() { +var es3fOcclusionQueryTests = functional.gles3.es3fOcclusionQueryTests; +var tcuTestCase = framework.common.tcuTestCase; +var tcuLogImage = framework.common.tcuLogImage; +var tcuSurface = framework.common.tcuSurface; +var deRandom = framework.delibs.debase.deRandom; +var deString = framework.delibs.debase.deString; +var gluShaderProgram = framework.opengl.gluShaderProgram; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** @const */ var DEPTH_WRITE_COLOR = [0, 0, 1, 1]; +/** @const */ var DEPTH_CLEAR_COLOR = [0, 0.5, 0.8, 1]; +/** @const */ var STENCIL_WRITE_COLOR = [0, 1, 0, 1]; +/** @const */ var STENCIL_CLEAR_COLOR = [0, 0.8, 0.5, 1]; +/** @const */ var TARGET_COLOR = [1, 0, 0, 1]; +/** @const */ var ELEMENTS_PER_VERTEX = 4; +/** @const */ var NUM_CASE_ITERATIONS = 10; + +// Constants to tweak visible/invisible case probability balance. + +/** @const */ var DEPTH_CLEAR_OFFSET = 100; +/** @const */ var STENCIL_CLEAR_OFFSET = 100; +/** @const */ var SCISSOR_OFFSET = 100; +/** @const */ var SCISSOR_MINSIZE = 250; + +/** @const */ var OCCLUDER_SCISSOR = (1 << 0); +/** @const */ var OCCLUDER_DEPTH_WRITE = (1 << 1); +/** @const */ var OCCLUDER_DEPTH_CLEAR = (1 << 2); +/** @const */ var OCCLUDER_STENCIL_WRITE = (1 << 3); +/** @const */ var OCCLUDER_STENCIL_CLEAR = (1 << 4); + +/** + * @enum + */ +es3fOcclusionQueryTests.State = { + DRAW: 0, + VERIFY: 1, + FINISH: 2 +}; + +/* Maximum time to wait for query result (in seconds) */ +/** @const */ var MAX_VERIFY_WAIT = 5; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fOcclusionQueryTests.OcclusionQueryCase = function(name, description, numOccluderDraws, numOccludersPerDraw, occluderSize, numTargetDraws, numTargetsPerDraw, targetSize, queryMode, occluderTypes) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_numOccluderDraws = numOccluderDraws; + this.m_numOccludersPerDraw = numOccludersPerDraw; + this.m_occluderSize = occluderSize; + this.m_numTargetDraws = numTargetDraws; + this.m_numTargetsPerDraw = numTargetsPerDraw; + this.m_targetSize = targetSize; + this.m_queryMode = queryMode; + this.m_occluderTypes = occluderTypes; + this.m_program = null; + this.m_iterNdx = 0; + this.m_rnd = new deRandom.Random(deString.deStringHash(name)); + this.m_state = es3fOcclusionQueryTests.State.DRAW; + /** @type {WebGLQuery} */ this.m_query; +}; + +setParentClass(es3fOcclusionQueryTests.OcclusionQueryCase, tcuTestCase.DeqpTest); + +es3fOcclusionQueryTests.OcclusionQueryCase.prototype.generateVertices = function(width, height, primitiveCount, verticesPerPrimitive, rnd, primitiveSize, minZ, maxZ) { + var dst = []; + var w = width / 2; + var h = height / 2; + var s = primitiveSize / 2; + + var vertexCount = verticesPerPrimitive * primitiveCount; + + // First loop gets a random point inside unit square + for (var i = 0; i < vertexCount; i += 3) { + var rndX = rnd.getFloat(-w, w); + var rndY = rnd.getFloat(-h, h); + + // Second loop gets 3 random points within given distance s from (rndX, rndY) + for (var j = 0; j < verticesPerPrimitive; j++) { + var offset = (i + j) * ELEMENTS_PER_VERTEX; + dst[offset] = rndX + rnd.getFloat(-s, s); // x + dst[offset + 1] = rndY + rnd.getFloat(-s, s); // y + dst[offset + 2] = rnd.getFloat(minZ, maxZ); // z + dst[offset + 3] = 1; // w + } + } + return dst; +}; + +es3fOcclusionQueryTests.OcclusionQueryCase.prototype.init = function() { + var vertShaderSource = + '#version 300 es\n' + + 'layout(location = 0) in mediump vec4 a_position;\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '}\n'; + + var fragShaderSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' + + 'uniform mediump vec4 u_color;\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' mediump float depth_gradient = gl_FragCoord.z;\n' + + ' mediump float bias = 0.1;\n' + + ' dEQP_FragColor = vec4(u_color.xyz * (depth_gradient + bias), 1);\n' + + '}\n'; + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource)); + + if (!this.m_program.isOk()) + testFailedOptions('Failed to compile program', true); + + this.m_buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_buffer); + gl.vertexAttribPointer(0, ELEMENTS_PER_VERTEX, gl.FLOAT, false, 0, 0); +}; + +es3fOcclusionQueryTests.OcclusionQueryCase.prototype.draw = function() { + var colorUnif = gl.getUniformLocation(this.m_program.getProgram(), 'u_color'); + + var targetW = gl.drawingBufferWidth; + var targetH = gl.drawingBufferHeight; + + bufferedLogToConsole('Case iteration ' + (this.m_iterNdx + 1) + ' / ' + NUM_CASE_ITERATIONS); + bufferedLogToConsole('Parameters:\n' + + '- ' + this.m_numOccluderDraws + ' occluder draws, ' + this.m_numOccludersPerDraw + ' primitive writes per draw,\n' + + '- ' + this.m_numTargetDraws + ' target draws, ' + this.m_numTargetsPerDraw + ' targets per draw\n'); + + gl.clearColor(0, 0, 0, 1); + gl.clearDepth(1); + gl.clearStencil(0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + gl.useProgram(this.m_program.getProgram()); + gl.enableVertexAttribArray(0); + + // Draw occluders + + var occOptions = []; + if (this.m_occluderTypes & OCCLUDER_DEPTH_WRITE) occOptions.push(OCCLUDER_DEPTH_WRITE); + if (this.m_occluderTypes & OCCLUDER_DEPTH_CLEAR) occOptions.push(OCCLUDER_DEPTH_CLEAR); + if (this.m_occluderTypes & OCCLUDER_STENCIL_WRITE) occOptions.push(OCCLUDER_STENCIL_WRITE); + if (this.m_occluderTypes & OCCLUDER_STENCIL_CLEAR) occOptions.push(OCCLUDER_STENCIL_CLEAR); + + for (var i = 0; i < this.m_numOccluderDraws; i++) { + if (occOptions.length == 0) + break; + + var type = occOptions[this.m_rnd.getInt(0, occOptions.length - 1)]; // Choosing a random occluder type from available options + + switch (type) { + case OCCLUDER_DEPTH_WRITE: + bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Depth write'); + + var occluderVertices = this.generateVertices(2, 2, this.m_numOccludersPerDraw, 3, this.m_rnd, this.m_occluderSize, 0, 0.6); // Generate vertices for occluding primitives + + gl.enable(gl.DEPTH_TEST); + gl.uniform4f(colorUnif, DEPTH_WRITE_COLOR[0], DEPTH_WRITE_COLOR[1], DEPTH_WRITE_COLOR[2], DEPTH_WRITE_COLOR[3]); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(occluderVertices), gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 3 * this.m_numOccludersPerDraw); + gl.disable(gl.DEPTH_TEST); + + break; + + case OCCLUDER_DEPTH_CLEAR: { + var scissorBoxX = this.m_rnd.getInt(-DEPTH_CLEAR_OFFSET, targetW); + var scissorBoxY = this.m_rnd.getInt(-DEPTH_CLEAR_OFFSET, targetH); + var scissorBoxW = this.m_rnd.getInt(DEPTH_CLEAR_OFFSET, targetW + DEPTH_CLEAR_OFFSET); + var scissorBoxH = this.m_rnd.getInt(DEPTH_CLEAR_OFFSET, targetH + DEPTH_CLEAR_OFFSET); + + bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Depth clear'); + bufferedLogToConsole('Depth-clearing box drawn at ' + + '(' + scissorBoxX + ', ' + scissorBoxY + ')' + + ', width = ' + scissorBoxW + ', height = ' + scissorBoxH + '.'); + + gl.enable(gl.SCISSOR_TEST); + gl.scissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH); + gl.clearDepth(0); + gl.clearColor(DEPTH_CLEAR_COLOR[0], DEPTH_CLEAR_COLOR[1], DEPTH_CLEAR_COLOR[2], DEPTH_CLEAR_COLOR[3]); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + gl.disable(gl.SCISSOR_TEST); + + break; + } + + case OCCLUDER_STENCIL_WRITE: + bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Stencil write'); + + occluderVertices = this.generateVertices(2, 2, this.m_numOccludersPerDraw, 3, this.m_rnd, this.m_occluderSize, 0, 0.6); + + gl.stencilFunc(gl.ALWAYS, 1, 0xFF); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + + gl.enable(gl.STENCIL_TEST); + gl.uniform4f(colorUnif, STENCIL_WRITE_COLOR[0], STENCIL_WRITE_COLOR[1], STENCIL_WRITE_COLOR[2], STENCIL_WRITE_COLOR[3]); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(occluderVertices), gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 3 * this.m_numOccludersPerDraw); + gl.disable(gl.STENCIL_TEST); + + break; + + case OCCLUDER_STENCIL_CLEAR: { + var scissorBoxX = this.m_rnd.getInt(-STENCIL_CLEAR_OFFSET, targetW); + var scissorBoxY = this.m_rnd.getInt(-STENCIL_CLEAR_OFFSET, targetH); + var scissorBoxW = this.m_rnd.getInt(STENCIL_CLEAR_OFFSET, targetW + STENCIL_CLEAR_OFFSET); + var scissorBoxH = this.m_rnd.getInt(STENCIL_CLEAR_OFFSET, targetH + STENCIL_CLEAR_OFFSET); + + bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Stencil clear'); + bufferedLogToConsole('Stencil-clearing box drawn at ' + + '(' + scissorBoxX + ', ' + scissorBoxY + ')' + + ', width = ' + scissorBoxW + ', height = ' + scissorBoxH + '.'); + + gl.enable(gl.SCISSOR_TEST); + gl.scissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH); + gl.clearStencil(1); + gl.clearColor(STENCIL_CLEAR_COLOR[0], STENCIL_CLEAR_COLOR[1], STENCIL_CLEAR_COLOR[2], STENCIL_CLEAR_COLOR[3]); + gl.clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + gl.disable(gl.SCISSOR_TEST); + + break; + } + + default: + throw new Error('Invalid occluder type: ' + type); + } + } + + if (this.m_occluderTypes & OCCLUDER_SCISSOR) { + var scissorBoxX = this.m_rnd.getInt(-SCISSOR_OFFSET, targetW - SCISSOR_OFFSET); + var scissorBoxY = this.m_rnd.getInt(-SCISSOR_OFFSET, targetH - SCISSOR_OFFSET); + var scissorBoxW = this.m_rnd.getInt(SCISSOR_MINSIZE, targetW + SCISSOR_OFFSET); + var scissorBoxH = this.m_rnd.getInt(SCISSOR_MINSIZE, targetH + SCISSOR_OFFSET); + + bufferedLogToConsole('Scissor box drawn at ' + + '(' + scissorBoxX + ', ' + scissorBoxY + ')' + + ', width = ' + scissorBoxW + ', height = ' + scissorBoxH + '.'); + + gl.enable(gl.SCISSOR_TEST); + gl.scissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH); + } + + this.m_query = gl.createQuery(); + gl.beginQuery(this.m_queryMode, this.m_query); + + // Draw target primitives + + gl.enable(gl.DEPTH_TEST); + gl.enable(gl.STENCIL_TEST); + gl.stencilFunc(gl.EQUAL, 0, 0xFF); + + for (var i = 0; i < this.m_numTargetDraws; i++) { + var targetVertices = this.generateVertices(2, 2, this.m_numTargetsPerDraw, 3, this.m_rnd, this.m_targetSize, 0.4, 1); // Generate vertices for target primitives + + if (targetVertices.length > 0) { + gl.uniform4f(colorUnif, TARGET_COLOR[0], TARGET_COLOR[1], TARGET_COLOR[2], TARGET_COLOR[3]); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(targetVertices), gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 3 * this.m_numTargetsPerDraw); + } + } + + gl.endQuery(this.m_queryMode); + gl.disable(gl.SCISSOR_TEST); + gl.disable(gl.STENCIL_TEST); + gl.disable(gl.DEPTH_TEST); + this.m_state = es3fOcclusionQueryTests.State.VERIFY; +}; + +es3fOcclusionQueryTests.OcclusionQueryCase.prototype.verify = function() { + // Check that query result is available. + var resultAvailable = /** @type {boolean} */ (gl.getQueryParameter(this.m_query, gl.QUERY_RESULT_AVAILABLE)); + if (!resultAvailable) { + if (!this.m_verifyStart) + this.m_verifyStart = new Date(); + else { + var current = new Date(); + var elapsedTime = 0.001 * (current.getTime() - this.m_verifyStart.getTime()); + if (elapsedTime > MAX_VERIFY_WAIT) { + testFailed('Query result not available after ' + elapsedTime + ' seconds.'); + this.m_state = es3fOcclusionQueryTests.State.FINISH; + } + } + return; + } + + // Read query result. + var result = /** @type {number} */ (gl.getQueryParameter(this.m_query, gl.QUERY_RESULT)); + var queryResult = (result > 0); + + gl.deleteQuery(this.m_query); + + // Read pixel data + + var pixels = new tcuSurface.Surface(); + pixels.readViewport(gl); + var colorReadResult = false; + var width = pixels.getWidth(); + var height = pixels.getHeight(); + + for (var y = 0; y < height; y++) { + for (var x = 0; x < width; x++) { + if (pixels.getPixel(x, y)[0] != 0) { + colorReadResult = true; + break; + } + } + if (colorReadResult) break; + } + + var message = 'Occlusion query result: Target ' + (queryResult ? 'visible' : 'invisible') + '. ' + + 'Framebuffer read result: Target ' + (colorReadResult ? 'visible' : 'invisible'); + + var testOk = false; + if (this.m_queryMode == gl.ANY_SAMPLES_PASSED_CONSERVATIVE) { + if (queryResult || colorReadResult) + testOk = queryResult; // Allow conservative occlusion query to return false positives. + else + testOk = queryResult == colorReadResult; + } else + testOk = (queryResult == colorReadResult); + + if (!testOk) { + tcuLogImage.logImage('Result image', 'Result image', pixels.getAccess()); + testFailed(message); + this.m_state = es3fOcclusionQueryTests.State.FINISH; + return; + } + + bufferedLogToConsole(message); + bufferedLogToConsole('Case passed!'); + + if (++this.m_iterNdx < NUM_CASE_ITERATIONS) { + this.m_state = es3fOcclusionQueryTests.State.DRAW + } else { + this.m_state = es3fOcclusionQueryTests.State.FINISH; + testPassed(); + } +}; + + +es3fOcclusionQueryTests.OcclusionQueryCase.prototype.iterate = function() { + switch(this.m_state) { + case es3fOcclusionQueryTests.State.DRAW: + this.draw(); + break; + case es3fOcclusionQueryTests.State.VERIFY: + this.verify(); + break; + case es3fOcclusionQueryTests.State.FINISH: + return tcuTestCase.IterateResult.STOP; + default: + throw new Error('Invalid state: ' + this.m_state); + } + + return tcuTestCase.IterateResult.CONTINUE; +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fOcclusionQueryTests.OcclusionQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'occlusion_query', 'Occlusion Query Tests'); +}; + +es3fOcclusionQueryTests.OcclusionQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fOcclusionQueryTests.OcclusionQueryTests.prototype.constructor = es3fOcclusionQueryTests.OcclusionQueryTests; + +es3fOcclusionQueryTests.OcclusionQueryTests.prototype.init = function() { + // Strict occlusion query cases + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor', 'scissor', 1, 10, 1.6, 1, 1, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write', 'depth_write', 8, 10, 1.6, 1, 7, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear', 'depth_clear', 5, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('stencil_write', 'stencil_write', 8, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('stencil_clear', 'stencil_clear', 5, 10, 2.0, 1, 3, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write', 'scissor_depth_write', 5, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear', 'scissor_depth_clear', 7, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_stencil_write', 'scissor_stencil_write', 4, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_stencil_clear', 'scissor_stencil_clear', 4, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear', 'depth_write_depth_clear', 7, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_stencil_write', 'depth_write_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_stencil_clear', 'depth_write_stencil_clear', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear_stencil_write', 'depth_clear_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear_stencil_clear', 'depth_clear_stencil_clear', 12, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('stencil_write_stencil_clear', 'stencil_write_stencil_clear', 5, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_depth_clear', 'scissor_depth_write_depth_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_stencil_write', 'scissor_depth_write_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_stencil_clear', 'scissor_depth_write_stencil_clear', 6, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear_stencil_write', 'scissor_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear_stencil_clear', 'scissor_depth_clear_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_stencil_write_stencil_clear', 'scissor_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear_stencil_write', 'depth_write_depth_clear_stencil_write', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear_stencil_clear', 'depth_write_depth_clear_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_stencil_write_stencil_clear', 'depth_write_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear_stencil_write_stencil_clear', 'depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_depth_clear_stencil_write', 'scissor_depth_write_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_depth_clear_stencil_clear', 'scissor_depth_write_depth_clear_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_stencil_write_stencil_clear', 'scissor_depth_write_stencil_write_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear_stencil_write_stencil_clear', 'scissor_depth_clear_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear_stencil_write_stencil_clear', 'depth_write_depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('all_occluders', 'all_occluders', 7, 10, 1.6, 3, 5, 0.6, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + + // Conservative occlusion query cases + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor', 'conservative_scissor', 1, 10, 1.6, 1, 1, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write', 'conservative_depth_write', 8, 10, 1.6, 1, 7, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear', 'conservative_depth_clear', 5, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_stencil_write', 'conservative_stencil_write', 8, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_stencil_clear', 'conservative_stencil_clear', 5, 10, 2.0, 1, 3, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write', 'conservative_scissor_depth_write', 5, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear', 'conservative_scissor_depth_clear', 7, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_stencil_write', 'conservative_scissor_stencil_write', 4, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_stencil_clear', 'conservative_scissor_stencil_clear', 4, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear', 'conservative_depth_write_depth_clear', 7, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_stencil_write', 'conservative_depth_write_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_stencil_clear', 'conservative_depth_write_stencil_clear', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear_stencil_write', 'conservative_depth_clear_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear_stencil_clear', 'conservative_depth_clear_stencil_clear', 12, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_stencil_write_stencil_clear', 'conservative_stencil_write_stencil_clear', 5, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_depth_clear', 'conservative_scissor_depth_write_depth_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_stencil_write', 'conservative_scissor_depth_write_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_stencil_clear', 'conservative_scissor_depth_write_stencil_clear', 6, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear_stencil_write', 'conservative_scissor_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear_stencil_clear', 'conservative_scissor_depth_clear_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_stencil_write_stencil_clear', 'conservative_scissor_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear_stencil_write', 'conservative_depth_write_depth_clear_stencil_write', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear_stencil_clear', 'conservative_depth_write_depth_clear_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_stencil_write_stencil_clear', 'conservative_depth_write_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear_stencil_write_stencil_clear', 'conservative_depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_depth_clear_stencil_write', 'conservative_scissor_depth_write_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_depth_clear_stencil_clear', 'conservative_scissor_depth_write_depth_clear_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_stencil_write_stencil_clear', 'conservative_scissor_depth_write_stencil_write_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear_stencil_write_stencil_clear', 'conservative_scissor_depth_clear_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear_stencil_write_stencil_clear', 'conservative_depth_write_depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + + this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_all_occluders', 'conservative_all_occluders', 7, 10, 1.6, 3, 5, 0.6, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR)); + +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fOcclusionQueryTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fOcclusionQueryTests.OcclusionQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fOcclusionQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js new file mode 100644 index 000000000..43f001e11 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js @@ -0,0 +1,577 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fPixelBufferObjectTest'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + +var es3fPixelBufferObjectTest = functional.gles3.es3fPixelBufferObjectTest; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuTestCase = framework.common.tcuTestCase; +var deRandom = framework.delibs.debase.deRandom; +var deString = framework.delibs.debase.deString; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuImageCompare = framework.common.tcuImageCompare; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + es3fPixelBufferObjectTest.DE_STATIC_ASSERT = function(expression) { + if (!expression) throw new Error('Assert failed'); + }; + + /** @enum */ + es3fPixelBufferObjectTest.FramebufferType = { + FRAMEBUFFERTYPE_NATIVE: 0, + FRAMEBUFFERTYPE_RENDERBUFFER: 1 + }; + + /** + * @constructor + * @struct + */ + es3fPixelBufferObjectTest.TestSpec = function() { // This is originaly a struct + this.name = ''; + this.description = ''; + this.useColorClear = false; + this.renderTriangles = false; + /** @type {es3fPixelBufferObjectTest.FramebufferType} */ this.framebufferType; + /** @type {number} */ this.renderbufferFormat; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {es3fPixelBufferObjectTest.TestSpec} spec + */ + es3fPixelBufferObjectTest.ReadPixelsTest = function(spec) { + tcuTestCase.DeqpTest.call(this, spec.name, spec.description); + this.m_random = new deRandom.Random(deString.deStringHash(spec.name)); + this.m_program = null; + this.m_framebuffeType = spec.framebufferType; + this.m_renderbufferFormat = spec.renderbufferFormat; + this.m_texChannelClass = undefined; + this.m_useColorClears = spec.useColorClear; + this.m_renderTriangles = spec.renderTriangles; + this.m_colorScale = 1.0; + + if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE) { + this.m_colorScale = 1.0; + } else if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) { + this.m_texChannelClass = tcuTexture.getTextureChannelClass(gluTextureUtil.mapGLInternalFormat(spec.renderbufferFormat).type); + switch (this.m_texChannelClass) { + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + this.m_colorScale = 1.0; + break; + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + this.m_colorScale = 100.0; + break; + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + this.m_colorScale = 100.0; + break; + case tcuTexture.TextureChannelClass.FLOATING_POINT: + this.m_colorScale = 100.0; + break; + default: + DE_ASSERT(false); + } + } else { + DE_ASSERT(false); + } + }; + + es3fPixelBufferObjectTest.ReadPixelsTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fPixelBufferObjectTest.ReadPixelsTest.prototype.constructor = es3fPixelBufferObjectTest.ReadPixelsTest; + + es3fPixelBufferObjectTest.ReadPixelsTest.prototype.init = function() { + var outtype = ''; + + if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE) + outtype = 'vec4'; + else if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) { + switch (this.m_texChannelClass) { + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + outtype = 'vec4'; + break; + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + outtype = 'ivec4'; + break; + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + outtype = 'uvec4'; + break; + case tcuTexture.TextureChannelClass.FLOATING_POINT: + outtype = 'vec4'; + break; + default: + DE_ASSERT(false); + } + } else + DE_ASSERT(false); + + /** @type {string} */ var vertexShaderSource = + '#version 300 es\n' + + 'in mediump vec3 a_position;\n' + + 'in mediump vec4 a_color;\n' + + 'uniform mediump float u_colorScale;\n' + + 'out mediump vec4 v_color;\n' + + 'void main(void)\n' + + ' {\n' + + '\tgl_Position = vec4(a_position, 1.0);\n' + + '\tv_color = u_colorScale * a_color;\n' + + '}'; + + /** @type {string} */ var fragmentShaderSource = + '#version 300 es\n' + + 'in mediump vec4 v_color;\n' + + 'layout (location = 0) out mediump ' + + outtype + + ' o_color;\n' + + 'void main(void)\n' + + ' {\n' + + '\to_color = ' + + outtype + + '(v_color);\n' + + '}'; + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource)); + + if (!this.m_program.isOk()) + throw new Error('Compile failed. Program not created'); + + }; + + /** + * @param {Array} a + * @param {Array} b + * @param {Array} c + */ + es3fPixelBufferObjectTest.ReadPixelsTest.prototype.renderTriangle = function(a, b, c) { + + var positions = new Float32Array(36); + + positions[0] = a[0]; + positions[1] = a[1]; + positions[2] = a[2]; + + positions[3] = b[0]; + positions[4] = b[1]; + positions[5] = b[2]; + + positions[6] = c[0]; + positions[7] = c[1]; + positions[8] = c[2]; + + var colors = new Float32Array([ + 1.0, 0.0, 0.0, 1.0, + 0.0, 1.0, 0.0, 1.0, + 0.0, 0.0, 1.0, 1.0]); + + gl.useProgram(this.m_program.getProgram()); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'useProgram failed ', false, true); + + /** @type {WebGLUniformLocation} */ var colorScaleLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_colorScale'); + assertMsgOptions(colorScaleLoc != -1, 'Could not find u_colorScale ', false, true); + + gl.uniform1f(colorScaleLoc, this.m_colorScale); + + /** @type {number} */ var coordLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + assertMsgOptions(coordLoc != -1, 'Could not find a_position ', false, true); + + /** @type {number} */ var colorLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_color'); + assertMsgOptions(colorLoc != -1, 'Could not find a_color ', false, true); + + gl.enableVertexAttribArray(colorLoc); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'enableVertexAttribArray failed ', false, true); + gl.enableVertexAttribArray(coordLoc); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'enableVertexAttribArray failed ', false, true); + + var pos = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, pos); + gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW); + gl.vertexAttribPointer(coordLoc, 3, gl.FLOAT, false, 0, 0); + + var c = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, c); + gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); + gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0); + + gl.drawArrays(gl.TRIANGLES, 0, 3); + + gl.disableVertexAttribArray(colorLoc); + gl.disableVertexAttribArray(coordLoc); + }; + + /** + * @param {number} r + * @param {number} g + * @param {number} b + * @param {number} a + */ + + es3fPixelBufferObjectTest.ReadPixelsTest.prototype.clearColor = function(r, g, b, a) { + if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE) { + gl.clearColor(r, g, b, a); + gl.clear(gl.COLOR_BUFFER_BIT); + } else if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) { + switch (this.m_texChannelClass) { + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + gl.clearColor(r, g, b, a); + gl.clear(gl.COLOR_BUFFER_BIT); + break; + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + gl.clearBufferiv(gl.COLOR, 0, new Int32Array([r, g, b, a])); + break; + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + gl.clearBufferuiv(gl.COLOR, 0, new Uint32Array([r, g, b, a])); + break; + case tcuTexture.TextureChannelClass.FLOATING_POINT: + gl.clearBufferfv(gl.COLOR, 0, new Float32Array([r, g, b, a])); + break; + default: + DE_ASSERT(false); + } + } else + DE_ASSERT(false); + + }; + + es3fPixelBufferObjectTest.ReadPixelsTest.prototype.iterate = function() { + var width = gl.drawingBufferWidth; + var height = gl.drawingBufferHeight; + + var framebuffer = null; + var renderbuffer = null; + + switch (this.m_framebuffeType) { + case es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE: + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + break; + case es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER: + framebuffer = gl.createFramebuffer(); + renderbuffer = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, this.m_renderbufferFormat, width, height); + + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer); + break; + } + + this.clearColor(this.m_colorScale * 0.4, this.m_colorScale * 1.0, this.m_colorScale * 0.5, this.m_colorScale * 1.0); + + if (this.m_useColorClears) { + /** @type {number} */ var maxClearCount = 10; + /** @type {number} */ var minClearCount = 6; + /** @type {number} */ var minClearSize = 15; + + /** @type {number} */ var clearCount = this.m_random.getInt(minClearCount, maxClearCount); + + for (var clearNdx = 0; clearNdx < clearCount; clearNdx++) { + /** @type {number} */ var clearX = this.m_random.getInt(0, width - minClearSize); + /** @type {number} */ var clearY = this.m_random.getInt(0, height - minClearSize); + + /** @type {number} */ var clearWidth = this.m_random.getInt(minClearSize, width - clearX); + /** @type {number} */ var clearHeight = this.m_random.getInt(minClearSize, height - clearY); + + /** @type {number} */ var clearRed = this.m_colorScale * this.m_random.getFloat(); + /** @type {number} */ var clearGreen = this.m_colorScale * this.m_random.getFloat(); + /** @type {number} */ var clearBlue = this.m_colorScale * this.m_random.getFloat(); + /** @type {number} */ var clearAlpha = this.m_colorScale * (0.5 + 0.5 * this.m_random.getFloat()); + + gl.enable(gl.SCISSOR_TEST); + gl.scissor(clearX, clearY, clearWidth, clearHeight); + + this.clearColor(clearRed, clearGreen, clearBlue, clearAlpha); + } + + gl.disable(gl.SCISSOR_TEST); + + } + + if (this.m_renderTriangles) { + /** @type {number} */ var minTriangleCount = 4; + /** @type {number} */ var maxTriangleCount = 10; + + /** @type {number} */ var triangleCount = this.m_random.getInt(minTriangleCount, maxTriangleCount); + + for (var triangleNdx = 0; triangleNdx < triangleCount; triangleNdx++) { + /** @type {number} */ var x1 = 2.0 * this.m_random.getFloat() - 1.0; + /** @type {number} */ var y1 = 2.0 * this.m_random.getFloat() - 1.0; + /** @type {number} */ var z1 = 2.0 * this.m_random.getFloat() - 1.0; + + /** @type {number} */ var x2 = 2.0 * this.m_random.getFloat() - 1.0; + /** @type {number} */ var y2 = 2.0 * this.m_random.getFloat() - 1.0; + /** @type {number} */ var z2 = 2.0 * this.m_random.getFloat() - 1.0; + + /** @type {number} */ var x3 = 2.0 * this.m_random.getFloat() - 1.0; + /** @type {number} */ var y3 = 2.0 * this.m_random.getFloat() - 1.0; + /** @type {number} */ var z3 = 2.0 * this.m_random.getFloat() - 1.0; + + this.renderTriangle([x1, y1, z1], [x2, y2, z2], [x3, y3, z3]); + } + } + + /** @type {tcuTexture.TextureFormat} */ var readFormat; + /** @type {number} */ var readPixelsFormat; + /** @type {number} */ var readPixelsType; + /** @type {boolean} */ var floatCompare; + + if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE) { + readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.UNSIGNED_BYTE); + readPixelsFormat = gl.RGBA; + readPixelsType = gl.UNSIGNED_BYTE; + floatCompare = false; + } else if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) { + switch (this.m_texChannelClass) { + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.UNSIGNED_BYTE); + readPixelsFormat = gl.RGBA; + readPixelsType = gl.UNSIGNED_BYTE; + floatCompare = true; + break; + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA_INTEGER, gl.INT); + readPixelsFormat = gl.RGBA_INTEGER; + readPixelsType = gl.INT; + floatCompare = false; + break; + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA_INTEGER, gl.UNSIGNED_INT); + readPixelsFormat = gl.RGBA_INTEGER; + readPixelsType = gl.UNSIGNED_INT; + floatCompare = false; + break; + case tcuTexture.TextureChannelClass.FLOATING_POINT: + readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.FLOAT); + readPixelsFormat = gl.RGBA; + readPixelsType = gl.FLOAT; + floatCompare = true; + break; + default: + DE_ASSERT(false); + // Silence warning + readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.FLOAT); + readPixelsFormat = gl.RGBA; + readPixelsType = gl.FLOAT; + floatCompare = true; + } + } else { + // Silence warnings + readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.FLOAT); + readPixelsFormat = gl.RGBA; + readPixelsType = gl.FLOAT; + floatCompare = true; + DE_ASSERT(false); + } + + var readReference = new tcuTexture.Texture2D(readFormat, width, height); + readReference.allocLevel(0); + + var pixelBuffer = gl.createBuffer(); + + gl.bindBuffer(gl.PIXEL_PACK_BUFFER, pixelBuffer); + gl.bufferData(gl.PIXEL_PACK_BUFFER, readReference.getLevel(0).getDataSize(), gl.STREAM_READ); + gl.readPixels(0, 0, width, height, readPixelsFormat, readPixelsType, 0); + + var bufferData = new Uint8Array(readReference.getLevel(0).getDataSize()); + + gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, bufferData); + + var readResult = new tcuTexture.ConstPixelBufferAccess({ + width: width, + height: height, + format: readFormat, + data: bufferData.buffer}); + + gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null); + + gl.readPixels(0, 0, width, height, readPixelsFormat, readPixelsType, readReference.getLevel(0).getDataPtr()); + + if (framebuffer) + gl.deleteFramebuffer(framebuffer); + + if (renderbuffer) + gl.deleteRenderbuffer(renderbuffer); + + var isOk = false; + + if (floatCompare) { + // The result of rgb10_a2 from Intel GPU would have slight difference with the one from CPU, so some tolerance is added here. + // Detailed discussion in Mesa upstream can be found at https://bugs.freedesktop.org/show_bug.cgi?id=89314. + var threshold; + if (this.m_renderbufferFormat == gl.RGB10_A2) + threshold = [0.004, 0.004, 0.004, 0.0]; + else + threshold = [0.0, 0.0, 0.0, 0.0]; + isOk = tcuImageCompare.floatThresholdCompare('Result comparison', 'Result of read pixels to memory compared with result of read pixels to buffer', readReference.getLevel(0), readResult, threshold); + } + else + isOk = tcuImageCompare.intThresholdCompare('Result comparison', 'Result of read pixels to memory compared with result of read pixels to buffer', readReference.getLevel(0), readResult, [0, 0, 0, 0]); + + gl.deleteBuffer(pixelBuffer); + + assertMsgOptions(isOk, this.getDescription(), true, true); + + return tcuTestCase.IterateResult.STOP; + }; + + es3fPixelBufferObjectTest.init = function() { + var state = tcuTestCase.runner; + /** @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases; + + /** @type {tcuTestCase.DeqpTest} */ var nativeFramebufferGroup = tcuTestCase.newTest('native', 'Tests with reading from native framebuffer'); + + var nativeFramebufferTests = [{ + name: 'clears', + description: 'Simple read pixels test with color clears', + useColorClear: true, + renderTriangles: false, + framebufferType: es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE, + renderbufferFormat: gl.NONE + }, { + name: 'triangles', + description: 'Simple read pixels test rendering triangles', + useColorClear: false, + renderTriangles: true, + framebufferType: es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE, + renderbufferFormat: gl.NONE + } + ]; + + for (var testNdx = 0; testNdx < nativeFramebufferTests.length; testNdx++) + nativeFramebufferGroup.addChild(new es3fPixelBufferObjectTest.ReadPixelsTest(nativeFramebufferTests[testNdx])); + + testGroup.addChild(nativeFramebufferGroup); + + /** @type {tcuTestCase.DeqpTest} */ var renderbufferGroup = tcuTestCase.newTest('renderbuffer', 'Tests with reading from renderbuffer'); + + var renderbufferFormats = [ + gl.RGBA8, + gl.RGBA8I, + gl.RGBA8UI, + gl.RGBA16I, + gl.RGBA16UI, + gl.RGBA32I, + gl.RGBA32UI, + + gl.SRGB8_ALPHA8, + gl.RGB10_A2, + gl.RGB10_A2UI, + gl.RGBA4, + gl.RGB5_A1, + + gl.RGB8, + gl.RGB565, + + gl.RG8, + gl.RG8I, + gl.RG8UI, + gl.RG16I, + gl.RG16UI, + gl.RG32I, + gl.RG32UI + ]; + + var renderbufferFormatsStr = [ + 'rgba8', + 'rgba8i', + 'rgba8ui', + 'rgba16i', + 'rgba16ui', + 'rgba32i', + 'rgba32ui', + + 'srgb8_alpha8', + 'rgb10_a2', + 'rgb10_a2ui', + 'rgba4', + 'rgb5_a1', + + 'rgb8', + 'rgb565', + + 'rg8', + 'rg8i', + 'rg8ui', + 'rg16i', + 'rg16ui', + 'rg32i', + 'rg32ui' + ]; + es3fPixelBufferObjectTest.DE_STATIC_ASSERT(renderbufferFormatsStr.length == renderbufferFormats.length); + + for (var formatNdx = 0; formatNdx < renderbufferFormats.length; formatNdx++) { + for (var trianglesClears = 0; trianglesClears < 2; trianglesClears++) { + var nameDescription = renderbufferFormatsStr[formatNdx] + '_' + (trianglesClears == 0 ? 'triangles' : 'clears'); + var testSpec = new es3fPixelBufferObjectTest.TestSpec(); + testSpec.name = nameDescription; + testSpec.description = nameDescription; + testSpec.useColorClear = trianglesClears == 1; + testSpec.renderTriangles = trianglesClears == 0; + testSpec.framebufferType = es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER; + testSpec.renderbufferFormat = renderbufferFormats[formatNdx]; + + renderbufferGroup.addChild(new es3fPixelBufferObjectTest.ReadPixelsTest(testSpec)); + } + } + + testGroup.addChild(renderbufferGroup); + }; + + es3fPixelBufferObjectTest.run = function(context) { + gl = context; + //Set up Test Root parameters + var testName = 'pixel_buffer_object'; + var testDescription = 'Pixel Buffer Object Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fPixelBufferObjectTest.init(); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js new file mode 100644 index 000000000..85973665a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js @@ -0,0 +1,704 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fPrimitiveRestartTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + +var es3fPrimitiveRestartTests = functional.gles3.es3fPrimitiveRestartTests; +var tcuTestCase = framework.common.tcuTestCase; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuSurface = framework.common.tcuSurface; +var deMath = framework.delibs.debase.deMath; +var deRandom = framework.delibs.debase.deRandom; +var deString = framework.delibs.debase.deString; +var tcuImageCompare = framework.common.tcuImageCompare; +var gluTextureUtil = framework.opengl.gluTextureUtil; + + /** @type {WebGL2RenderingContext} */ var gl; + /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_RENDER_WIDTH = 256; + /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_RENDER_HEIGHT = 256; + + /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_UNSIGNED_BYTE = 255; + /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_UNSIGNED_SHORT = 65535; + /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_UNSIGNED_INT = 4294967295; + + /** @const @type {number} */ es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE = es3fPrimitiveRestartTests.MAX_UNSIGNED_BYTE; + /** @const @type {number} */ es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT = es3fPrimitiveRestartTests.MAX_UNSIGNED_SHORT; + /** @const @type {number} */ es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT = es3fPrimitiveRestartTests.MAX_UNSIGNED_INT; + + var DE_ASSERT = function(expression) { + if (!expression) throw new Error('Assert failed'); + }; + + /** + * @enum + */ + es3fPrimitiveRestartTests.PrimitiveType = { + PRIMITIVE_POINTS: 0, + PRIMITIVE_LINE_STRIP: 1, + PRIMITIVE_LINE_LOOP: 2, + PRIMITIVE_LINES: 3, + PRIMITIVE_TRIANGLE_STRIP: 4, + PRIMITIVE_TRIANGLE_FAN: 5, + PRIMITIVE_TRIANGLES: 6 + }; + + /** + * @enum + */ + es3fPrimitiveRestartTests.IndexType = { + INDEX_UNSIGNED_BYTE: 0, + INDEX_UNSIGNED_SHORT: 1, + INDEX_UNSIGNED_INT: 2 + }; + + /** + * @enum + */ + es3fPrimitiveRestartTests.DrawFunction = { + FUNCTION_DRAW_ELEMENTS: 0, + FUNCTION_DRAW_ELEMENTS_INSTANCED: 1, + FUNCTION_DRAW_RANGE_ELEMENTS: 2 + }; + + /** + * es3fPrimitiveRestartTests.PrimitiveRestartCase class, inherits from TestCase class + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {?string} name + * @param {string} description + * @param {es3fPrimitiveRestartTests.PrimitiveType} primType + * @param {es3fPrimitiveRestartTests.IndexType} indexType + * @param {es3fPrimitiveRestartTests.DrawFunction} _function + * @param {boolean} beginWithRestart + * @param {boolean} endWithRestart + * @param {boolean} duplicateRestarts + */ + es3fPrimitiveRestartTests.PrimitiveRestartCase = function(name, description, primType, indexType, _function, beginWithRestart, endWithRestart, duplicateRestarts) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {es3fPrimitiveRestartTests.PrimitiveType} */ this.m_primType = primType; + /** @type {es3fPrimitiveRestartTests.IndexType} */ this.m_indexType = indexType; + /** @type {es3fPrimitiveRestartTests.DrawFunction} */ this.m_function = _function; + /** @type {boolean} */ this.m_beginWithRestart = beginWithRestart; // Whether there will be restart indices at the beginning of the index array. + /** @type {boolean} */ this.m_endWithRestart = endWithRestart; // Whether there will be restart indices at the end of the index array. + /** @type {boolean} */ this.m_duplicateRestarts = duplicateRestarts; // Whether two consecutive restarts are used instead of one. + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + + // \note Only one of the following index vectors is used (according to m_indexType). + /** @type {Array} */ this.m_indicesUB = []; //deUint8 + /** @type {Array} */ this.m_indicesUS = []; //deUint16 + /** @type {Array} */ this.m_indicesUI = []; //deUint32 + + /** @type {Array} */ this.m_positions = []; + }; + + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.constructor = es3fPrimitiveRestartTests.PrimitiveRestartCase; + + /** + * Draw with the appropriate GLES3 draw function. + * @param {number} startNdx + * @param {number} count + */ + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.draw = function(startNdx, count) { + /** @type {number} */ var primTypeGL; + + switch (this.m_primType) { + case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_POINTS: + primTypeGL = gl.POINTS; + break; + case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_STRIP: + primTypeGL = gl.LINE_STRIP; + break; + case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_LOOP: + primTypeGL = gl.LINE_LOOP; + break; + case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINES: + primTypeGL = gl.LINES; + break; + case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_STRIP: + primTypeGL = gl.TRIANGLE_STRIP; + break; + case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_FAN: + primTypeGL = gl.TRIANGLE_FAN; + break; + case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLES: + primTypeGL = gl.TRIANGLES; + break; + default: + DE_ASSERT(false); + primTypeGL = 0; + } + + /** @type {number} */ var indexTypeGL; + + switch (this.m_indexType) { + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE: + indexTypeGL = gl.UNSIGNED_BYTE; + break; + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT: + indexTypeGL = gl.UNSIGNED_SHORT; + break; + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT: + indexTypeGL = gl.UNSIGNED_INT; + break; + default: + DE_ASSERT(false); + indexTypeGL = 0; + } + + /** @type {number} */ var restartIndex = this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE : + this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT : + this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT : + 0; + + DE_ASSERT(restartIndex != 0); + + var indexGLBuffer = gl.createBuffer(); + var bufferIndex = this.getIndexPtr(startNdx); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexGLBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, bufferIndex, gl.STATIC_DRAW); + + if (this.m_function == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS) { + gl.drawElements(primTypeGL, count, indexTypeGL, 0); + } else if (this.m_function == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED) { + gl.drawElementsInstanced(primTypeGL, count, indexTypeGL, 0, 1); + } else { + DE_ASSERT(this.m_function == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_RANGE_ELEMENTS); + + // Find the largest non-restart index in the index array (for glDrawRangeElements() end parameter). + + /** @type {number} */ var max = 0; + + /** @type {number} */ var numIndices = this.getNumIndices(); + for (var i = 0; i < numIndices; i++) { + /** @type {number} */ var index = this.getIndex(i); + if (index != restartIndex && index > max) + max = index; + } + //TODO: drawRangeElements -> check getIndexPtr usage + gl.drawRangeElements(primTypeGL, 0, max, count, indexTypeGL, 0); + } + }; + + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.renderWithRestart = function() { + // Primitive Restart is always on in WebGL2 + //gl.enable(gl.PRIMITIVE_RESTART_FIXED_INDEX); + + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + this.draw(0, this.getNumIndices()); + }; + + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.renderWithoutRestart = function() { + /** @type {number} */ var restartIndex = this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE : + this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT : + this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT : + 0; + + DE_ASSERT(restartIndex != 0); + // Primitive Restart is always on in WebGL2 + //gl.disable(gl.PRIMITIVE_RESTART_FIXED_INDEX); + + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + // Draw, emulating primitive restart. + + /** @type {number} */ var numIndices = this.getNumIndices(); + + DE_ASSERT(numIndices >= 0); + + /** @type {number} */ var indexArrayStartNdx = 0; // Keep track of the draw start index - first index after a primitive restart, or initially the first index altogether. + + for (var indexArrayNdx = 0; indexArrayNdx <= numIndices; indexArrayNdx++) { // \note Goes one "too far" in order to detect end of array as well. + if (indexArrayNdx >= numIndices || this.getIndex(indexArrayNdx) == restartIndex) {// \note Handle end of array the same way as a restart index encounter. + if (indexArrayStartNdx < numIndices) { + // Draw from index indexArrayStartNdx to index indexArrayNdx-1 . + + this.draw(indexArrayStartNdx, indexArrayNdx - indexArrayStartNdx); + } + + indexArrayStartNdx = indexArrayNdx + 1; // Next draw starts just after this restart index. + } + } + }; + + /** + * @param {number} index + */ + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.addIndex = function(index) { + if (this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE) { + DE_ASSERT(deMath.deInRange32(index, 0, es3fPrimitiveRestartTests.MAX_UNSIGNED_BYTE)); + this.m_indicesUB.push(index); // deUint8 + } else if (this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT) { + DE_ASSERT(deMath.deInRange32(index, 0, es3fPrimitiveRestartTests.MAX_UNSIGNED_SHORT)); + this.m_indicesUS.push(index); // deUint16 + } else if (this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT) { + DE_ASSERT(deMath.deInRange32(index, 0, es3fPrimitiveRestartTests.MAX_UNSIGNED_INT)); + this.m_indicesUI.push(index); // // deUint32 + } else + DE_ASSERT(false); + }; + + /** + * @param {number} indexNdx + * @return {number} + */ + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.getIndex = function(indexNdx) { + switch (this.m_indexType) { + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE: + return this.m_indicesUB[indexNdx]; //deUint32 + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT: + return this.m_indicesUS[indexNdx]; //deUint32 + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT: + return this.m_indicesUI[indexNdx]; + default: + DE_ASSERT(false); + return 0; + } + }; + + /** + * @return {number} + */ + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.getNumIndices = function() { + switch (this.m_indexType) { + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE: + return this.m_indicesUB.length; + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT: + return this.m_indicesUS.length; + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT: + return this.m_indicesUI.length; + default: + DE_ASSERT(false); + return 0; + } + }; + + /** + * Pointer to the index value at index indexNdx. + * @param {number} indexNdx + * @return {Uint8Array|Uint16Array|Uint32Array} + */ + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.getIndexPtr = function(indexNdx) { + //TODO: implement + switch (this.m_indexType) { + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE: + return new Uint8Array(this.m_indicesUB).subarray(indexNdx); + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT: + return new Uint16Array(this.m_indicesUS).subarray(indexNdx); + case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT: + return new Uint32Array(this.m_indicesUI).subarray(indexNdx); + default: + DE_ASSERT(false); + return null; + } + }; + + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.init = function() { + // Clear errors from previous tests + gl.getError(); + + // Create shader program. + + /** @type {string} */ var vertShaderSource = + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + '\n' + + 'void main()\n' + + ' {\n' + + ' gl_Position = a_position;\n' + + '}\n'; + + /** @type {string} */ var fragShaderSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + '\n' + + 'void main()\n' + + ' {\n' + + ' o_color = vec4(1.0f);\n' + + '}\n'; + + DE_ASSERT(!this.m_program); + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource)); + + if (!this.m_program.isOk()) { + //m_testCtx.getLog() << *this.m_program; + testFailedOptions('Failed to compile shader', true); + } + + /** @type {number} */ var restartIndex = this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE : + this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT : + this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT : + 0; + + DE_ASSERT(restartIndex != 0); + + DE_ASSERT(this.getNumIndices() == 0); + + // If testing a case with restart at beginning, add it there. + if (this.m_beginWithRestart) { + this.addIndex(restartIndex); + if (this.m_duplicateRestarts) + this.addIndex(restartIndex); + } + + // Generate vertex positions and indices depending on primitive type. + // \note At this point, restarts shall not be added to the start or the end of the index vector. Those are special cases, and are done above and after the following if-else chain, respectively. + /** @type {number} */ var curIndex; + /** @type {number} */ var numRows; + /** @type {number} */ var numCols; + /** @type {number} */ var fx; + /** @type {number} */ var fy; + /** @type {number} */ var centerY; + /** @type {number} */ var centerX; + /** @type {number} */ var numVertices; + /** @type {number} */ var numArcVertices; + /** @type {number} */ var numStrips; + + if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_POINTS) { + // Generate rows with different numbers of points. + + curIndex = 0; + numRows = 20; + + for (var row = 0; row < numRows; row++) { + for (var col = 0; col < row + 1; col++) { + fx = -1.0 + 2.0 * (col + 0.5) / numRows; + fy = -1.0 + 2.0 * (row + 0.5) / numRows; + + this.m_positions.push(fx); + this.m_positions.push(fy); + + this.addIndex(curIndex++); + } + + if (row < numRows - 1) { // Add a restart after all but last row. + this.addIndex(restartIndex); + if (this.m_duplicateRestarts) + this.addIndex(restartIndex); + } + } + } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_STRIP || this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_LOOP || this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINES) { + // Generate a numRows x numCols arrangement of line polygons of different vertex counts. + + curIndex = 0; + numRows = 4; + numCols = 4; + + for (var row = 0; row < numRows; row++) { + centerY = -1.0 + 2.0 * (row + 0.5) / numRows; + + for (var col = 0; col < numCols; col++) { + centerX = -1.0 + 2.0 * (col + 0.5) / numCols; + numVertices = row * numCols + col + 1; + + for (var i = 0; i < numVertices; i++) { + fx = centerX + 0.9 * Math.cos(i * 2.0 * Math.PI / numVertices) / numCols; + fy = centerY + 0.9 * Math.sin(i * 2.0 * Math.PI / numVertices) / numRows; + + this.m_positions.push(fx); + this.m_positions.push(fy); + + this.addIndex(curIndex++); + } + + if (col < numCols - 1 || row < numRows - 1) {// Add a restart after all but last polygon. + this.addIndex(restartIndex); + if (this.m_duplicateRestarts) + this.addIndex(restartIndex); + } + } + } + } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_STRIP) { + // Generate a number of horizontal triangle strips of different lengths. + + curIndex = 0; + numStrips = 20; + + for (var stripNdx = 0; stripNdx < numStrips; stripNdx++) { + numVertices = stripNdx + 1; + + for (var i = 0; i < numVertices; i++) { + fx = -0.9 + 1.8 * (i / 2 * 2) / numStrips; + fy = -0.9 + 1.8 * (stripNdx + (i % 2 == 0 ? 0.0 : 0.8)) / numStrips; + + this.m_positions.push(fx); + this.m_positions.push(fy); + + this.addIndex(curIndex++); + } + + if (stripNdx < numStrips - 1) { // Add a restart after all but last strip. + this.addIndex(restartIndex); + if (this.m_duplicateRestarts) + this.addIndex(restartIndex); + } + } + } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_FAN) { + // Generate a numRows x numCols arrangement of triangle fan polygons of different vertex counts. + + curIndex = 0; + numRows = 4; + numCols = 4; + + for (var row = 0; row < numRows; row++) { + centerY = -1.0 + 2.0 * (row + 0.5) / numRows; + + for (var col = 0; col < numCols; col++) { + centerX = -1.0 + 2.0 * (col + 0.5) / numCols; + numArcVertices = row * numCols + col; + + this.m_positions.push(centerX); + this.m_positions.push(centerY); + + this.addIndex(curIndex++); + + for (var i = 0; i < numArcVertices; i++) { + fx = centerX + 0.9 * Math.cos(i * 2.0 * Math.PI / numArcVertices) / numCols; + fy = centerY + 0.9 * Math.sin(i * 2.0 * Math.PI / numArcVertices) / numRows; + + this.m_positions.push(fx); + this.m_positions.push(fy); + + this.addIndex(curIndex++); + } + + if (col < numCols - 1 || row < numRows - 1) { // Add a restart after all but last polygon. + this.addIndex(restartIndex); + if (this.m_duplicateRestarts) + this.addIndex(restartIndex); + } + } + } + } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLES) { + // Generate a number of rows with (potentially incomplete) triangles. + + curIndex = 0; + numRows = 3 * 7; + + for (var rowNdx = 0; rowNdx < numRows; rowNdx++) { + numVertices = rowNdx + 1; + + for (var i = 0; i < numVertices; i++) { + fx = -0.9 + 1.8 * ((i / 3) + (i % 3 == 2 ? 0.8 : 0.0)) * 3 / numRows; + fy = -0.9 + 1.8 * (rowNdx + (i % 3 == 0 ? 0.0 : 0.8)) / numRows; + + this.m_positions.push(fx); + this.m_positions.push(fy); + + this.addIndex(curIndex++); + } + + if (rowNdx < numRows - 1) { // Add a restart after all but last row. + this.addIndex(restartIndex); + if (this.m_duplicateRestarts) + this.addIndex(restartIndex); + } + } + } else + DE_ASSERT(false); + + // If testing a case with restart at end, add it there. + if (this.m_endWithRestart) { + this.addIndex(restartIndex); + if (this.m_duplicateRestarts) + this.addIndex(restartIndex); + } + + // Special case assertions. + + /** @type {number} */ var numIndices = this.getNumIndices(); + + DE_ASSERT(numIndices > 0); + DE_ASSERT(this.m_beginWithRestart || this.getIndex(0) != restartIndex); // We don't want restarts at beginning unless the case is a special case. + DE_ASSERT(this.m_endWithRestart || this.getIndex(numIndices - 1) != restartIndex); // We don't want restarts at end unless the case is a special case. + + if (!this.m_duplicateRestarts) + for (var i = 1; i < numIndices; i++) + DE_ASSERT(this.getIndex(i) != restartIndex || this.getIndex(i - 1) != restartIndex); // We don't want duplicate restarts unless the case is a special case. + + }; + + es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.iterate = function() { + /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, es3fPrimitiveRestartTests.MAX_RENDER_WIDTH); + /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, es3fPrimitiveRestartTests.MAX_RENDER_HEIGHT); + + /** @type {number} */ var xOffsetMax = gl.drawingBufferWidth - width; + /** @type {number} */ var yOffsetMax = gl.drawingBufferHeight - height; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name)); + + /** @type {number} */ var xOffset = rnd.getInt(0, xOffsetMax); + /** @type {number} */ var yOffset = rnd.getInt(0, yOffsetMax); + /** @type {tcuSurface.Surface} */ var referenceImg = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ var resultImg = new tcuSurface.Surface(width, height); + + gl.viewport(xOffset, yOffset, width, height); + gl.clearColor(0.0, 0.0, 0.0, 1.0); + + var program = this.m_program.getProgram(); + gl.useProgram(program); + + // Setup position attribute. + + /** @type {number} */ var loc = gl.getAttribLocation(program, 'a_position'); + gl.enableVertexAttribArray(loc); + + var locGlBuffer = gl.createBuffer(); + var bufferLoc = new Float32Array(this.m_positions); + gl.bindBuffer(gl.ARRAY_BUFFER, locGlBuffer); + gl.bufferData(gl.ARRAY_BUFFER, bufferLoc, gl.STATIC_DRAW); + gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0); + + // Render result. + this.renderWithRestart(); + var resImg = resultImg.getAccess(); + var resImgTransferFormat = gluTextureUtil.getTransferFormat(resImg.getFormat()); + gl.readPixels(xOffset, yOffset, resImg.m_width, resImg.m_height, resImgTransferFormat.format, resImgTransferFormat.dataType, resultImg.m_pixels); + + // Render reference (same scene as the real deal, but emulate primitive restart without actually using it). + this.renderWithoutRestart(); + + var refImg = referenceImg.getAccess(); + var refImgTransferFormat = gluTextureUtil.getTransferFormat(refImg.getFormat()); + + gl.readPixels(xOffset, yOffset, refImg.m_width, refImg.m_height, refImgTransferFormat.format, refImgTransferFormat.dataType, referenceImg.m_pixels); + + // Compare. + /** @type {boolean} */ var testOk = tcuImageCompare.pixelThresholdCompare('ComparisonResult', 'Image comparison result', referenceImg, resultImg, [0, 0, 0, 0]); + + assertMsgOptions(testOk, '', true, false); + gl.useProgram(null); + + return tcuTestCase.IterateResult.STOP; + }; + + es3fPrimitiveRestartTests.init = function() { + var testGroup = tcuTestCase.runner.testCases; + for (var isRestartBeginCaseI = 0; isRestartBeginCaseI <= 1; isRestartBeginCaseI++) { + for (var isRestartEndCaseI = 0; isRestartEndCaseI <= 1; isRestartEndCaseI++) { + for (var isDuplicateRestartCaseI = 0; isDuplicateRestartCaseI <= 1; isDuplicateRestartCaseI++) { + /** @type {boolean} */ var isRestartBeginCase = isRestartBeginCaseI != 0; + /** @type {boolean} */ var isRestartEndCase = isRestartEndCaseI != 0; + /** @type {boolean} */ var isDuplicateRestartCase = isDuplicateRestartCaseI != 0; + + /** @type {string} */ var specialCaseGroupName = ''; + + if (isRestartBeginCase) specialCaseGroupName = 'begin_restart'; + if (isRestartEndCase) specialCaseGroupName += (deString.deIsStringEmpty(specialCaseGroupName) ? '' : '_') + 'end_restart'; + if (isDuplicateRestartCase) specialCaseGroupName += (deString.deIsStringEmpty(specialCaseGroupName) ? '' : '_') + 'duplicate_restarts'; + + if (deString.deIsStringEmpty(specialCaseGroupName)) + specialCaseGroupName = 'basic'; + + /** @type {tcuTestCase.DeqpTest} */ var specialCaseGroup = tcuTestCase.newTest(specialCaseGroupName, ''); + testGroup.addChild(specialCaseGroup); + + for (var primType in es3fPrimitiveRestartTests.PrimitiveType) { + /** @type {string} */ var primTypeName = es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_POINTS ? 'points' : + es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_STRIP ? 'line_strip' : + es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_LOOP ? 'line_loop' : + es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINES ? 'lines' : + es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_STRIP ? 'triangle_strip' : + es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_FAN ? 'triangle_fan' : + es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLES ? 'triangles' : + ''; + + DE_ASSERT(primTypeName != null); + + /** @type {tcuTestCase.DeqpTest} */ var primTypeGroup = tcuTestCase.newTest(primTypeName, ''); + specialCaseGroup.addChild(primTypeGroup); + + for (var indexType in es3fPrimitiveRestartTests.IndexType) { + /** @type {string} */ var indexTypeName = es3fPrimitiveRestartTests.IndexType[indexType] == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? 'unsigned_byte' : + es3fPrimitiveRestartTests.IndexType[indexType] == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? 'unsigned_short' : + es3fPrimitiveRestartTests.IndexType[indexType] == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? 'unsigned_int' : + ''; + + DE_ASSERT(indexTypeName != null); + + /** @type {tcuTestCase.DeqpTest} */ var indexTypeGroup = tcuTestCase.newTest(indexTypeName, ''); + primTypeGroup.addChild(indexTypeGroup); + + for (var _function in es3fPrimitiveRestartTests.DrawFunction) { + /** @type {?string} */ var functionName = es3fPrimitiveRestartTests.DrawFunction[_function] == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS ? 'draw_elements' : + es3fPrimitiveRestartTests.DrawFunction[_function] == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED ? 'draw_elements_instanced' : + es3fPrimitiveRestartTests.DrawFunction[_function] == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_RANGE_ELEMENTS ? 'draw_range_elements' : + null; + + DE_ASSERT(functionName != null); + + indexTypeGroup.addChild(new es3fPrimitiveRestartTests.PrimitiveRestartCase(functionName, + '', + es3fPrimitiveRestartTests.PrimitiveType[primType], + es3fPrimitiveRestartTests.IndexType[indexType], + es3fPrimitiveRestartTests.DrawFunction[_function], + isRestartBeginCase, + isRestartEndCase, + isDuplicateRestartCase)); + } + } + } + } + } + } + }; + + es3fPrimitiveRestartTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var testName = 'primitive_restart'; + var testDescription = 'Primitive Restart Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.setRoot(tcuTestCase.newTest(testName, testDescription, null)); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fPrimitiveRestartTests.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fPrimitiveRestartTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js new file mode 100644 index 000000000..ce7464856 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js @@ -0,0 +1,485 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES 3.0 Module + * ------------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Rasterizer discard tests. + *//*--------------------------------------------------------------------*/ + +goog.provide('functional.gles3.es3fRasterizerDiscardTests'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); + +goog.scope(function() { +var es3fRasterizerDiscardTests = functional.gles3.es3fRasterizerDiscardTests; +var deString = framework.delibs.debase.deString; +var tcuTestCase = framework.common.tcuTestCase; +var deRandom = framework.delibs.debase.deRandom; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuSurface = framework.common.tcuSurface; +var gluDrawUtil = framework.opengl.gluDrawUtil; +var tcuLogImage = framework.common.tcuLogImage; + +/** @const */ var NUM_CASE_ITERATIONS = 1; +/** @const */ var FAIL_COLOR_RED = [1, 0, 0.0, 1]; +/** @const */ var PASS_COLOR_BLUE = [0, 0, 0.5, 1]; +/** @const */ var BLACK_COLOR = [0, 0, 0.0, 1]; +/** @const */ var FAIL_DEPTH = 0; +/** @const */ var FAIL_STENCIL = 1; +/** @const */ var UNIT_SQUARE = [ + 1, 1, 0.05, 1, + 1, -1, 0.05, 1, + -1, 1, 0.05, 1, + -1, -1, 0.05, 1 +]; + +/** @type {WebGL2RenderingContext} */ var gl; + +/** + * @enum + */ +es3fRasterizerDiscardTests.CaseType = { + WRITE_DEPTH: 0, + WRITE_STENCIL: 1, + CLEAR_COLOR: 2, + CLEAR_DEPTH: 3, + CLEAR_STENCIL: 4 +}; + +/** + * @enum {{useFBO: boolean, useScissor: boolean}} + */ +es3fRasterizerDiscardTests.CaseOptions = { + FBO: {useFBO: true, useScissor: false}, + SCISSOR: {useFBO: false, useScissor: true} +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {number} numPrimitives + * @param {es3fRasterizerDiscardTests.CaseType} caseType + * @param {?es3fRasterizerDiscardTests.CaseOptions} caseOptions + * @param {gluDrawUtil.primitiveType=} drawMode + */ +es3fRasterizerDiscardTests.RasterizerDiscardCase = function(name, description, numPrimitives, caseType, caseOptions, drawMode) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_numPrimitives = numPrimitives; + this.m_caseType = caseType; + this.m_caseOptions = caseOptions || {useFBO: false, useScissor: false}; + this.m_drawMode = drawMode || gluDrawUtil.primitiveType.TRIANGLES; + this.m_program = null; + this.m_fbo = null; + this.m_colorBuf = null; + this.m_depthStencilBuf = null; + this.m_iterNdx = 0; + this.m_rnd = new deRandom.Random(deString.deStringHash(name)); +}; + +es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.constructor = es3fRasterizerDiscardTests.RasterizerDiscardCase; + +/** + * @param {number} numPrimitives + * @param {deRandom.Random} rnd + * @param {gluDrawUtil.primitiveType} drawMode + * @return {Array} + */ +es3fRasterizerDiscardTests.generateVertices = function(numPrimitives, rnd, drawMode) { + var dst = []; + var numVertices; + + switch (drawMode) { + case gl.POINTS: numVertices = numPrimitives; break; + case gl.LINES: numVertices = 2 * numPrimitives; break; + case gl.LINE_STRIP: numVertices = numPrimitives + 1; break; + case gl.LINE_LOOP: numVertices = numPrimitives + 2; break; + case gl.TRIANGLES: numVertices = 3 * numPrimitives; break; + case gl.TRIANGLE_STRIP: numVertices = numPrimitives + 2; break; + case gl.TRIANGLE_FAN: numVertices = numPrimitives + 2; break; + default: + throw new Error('Invalid drawMode: ' + drawMode); + } + + for (var i = 0; i < numVertices; i++) { + dst[i * 4] = rnd.getFloat(-1.0, 1.0); // x + dst[i * 4 + 1] = rnd.getFloat(-1.0, 1.0); // y + dst[i * 4 + 2] = rnd.getFloat(0.1, 0.9); // z + dst[i * 4 + 3] = 1.0; // w + } + + return dst; +}; + +es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.setupFramebufferObject = function() { + var width = gl.drawingBufferWidth; + var height = gl.drawingBufferHeight; + + // Create framebuffer object + + this.m_fbo = gl.createFramebuffer(); + this.m_colorBuf = gl.createTexture(); + this.m_depthStencilBuf = gl.createRenderbuffer(); + + // Create color texture + + gl.bindTexture(gl.TEXTURE_2D, this.m_colorBuf); + 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_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + // Create depth and stencil buffers + + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_depthStencilBuf); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, width, height); + + // Attach texture and buffers to FBO + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_fbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.m_colorBuf, 0); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, this.m_depthStencilBuf); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.m_depthStencilBuf); + + var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + + if (fboStatus == gl.FRAMEBUFFER_UNSUPPORTED) + throw new Error('Framebuffer unsupported'); + else if (fboStatus != gl.FRAMEBUFFER_COMPLETE) + throw new Error('Failed to create framebuffer object: ' + deString.enumToString(gl, fboStatus)); +}; + +es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.deleteFramebufferObject = function() { + gl.deleteTexture(this.m_colorBuf); + gl.deleteRenderbuffer(this.m_depthStencilBuf); + gl.deleteFramebuffer(this.m_fbo); +}; + +es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.init = function() { + var vertShaderSource = + '#version 300 es\n' + + 'layout(location = 0) in mediump vec4 a_position;\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '}\n'; + + var fragShaderSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' + + 'uniform mediump vec4 u_color;\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' mediump float depth_gradient = gl_FragCoord.z;\n' + + ' mediump float bias = 0.1;\n' + + ' dEQP_FragColor = vec4(u_color.xyz * (depth_gradient + bias), 1.0);\n' + + '}\n'; + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource)); + + if (!this.m_program.isOk()) { + bufferedLogToConsole(this.m_program); + testFailedOptions('Failed to compile shader program', true); + } +}; + +es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.deinit = function() { + this.deleteFramebufferObject(); + this.m_program = null; +}; + +es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.iterate = function() { + var program = this.m_program.getProgram(); + var colorUnif = gl.getUniformLocation(program, 'u_color'); + var failColorFound = false; + var passColorFound = false; + var vertices; + + bufferedLogToConsole('Case iteration ' + (this.m_iterNdx + 1) + ' / ' + NUM_CASE_ITERATIONS); + + // Create and bind FBO if needed + + if (this.m_caseOptions.useFBO) { + this.setupFramebufferObject(); + } + + if (this.m_caseOptions.useScissor) { + gl.enable(gl.SCISSOR_TEST); + gl.scissor(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); + bufferedLogToConsole('Scissor test enabled: glScissor(0, 0, ' + gl.drawingBufferWidth + ', ' + gl.drawingBufferHeight + ')'); + } + + gl.useProgram(this.m_program.getProgram()); + + gl.enable(gl.DEPTH_TEST); + gl.depthRange(0, 1); + gl.depthFunc(gl.LEQUAL); + + gl.enable(gl.STENCIL_TEST); + gl.stencilFunc(gl.NOTEQUAL, 1, 0xFF); + gl.stencilOp(gl.REPLACE, gl.KEEP, gl.KEEP); + + gl.clearColor(PASS_COLOR_BLUE[0], PASS_COLOR_BLUE[1], PASS_COLOR_BLUE[2], PASS_COLOR_BLUE[3]); + gl.clearDepth(1); + gl.clearStencil(0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + // Generate vertices + vertices = es3fRasterizerDiscardTests.generateVertices(this.m_numPrimitives, this.m_rnd, this.m_drawMode); + var posLoc = gl.getAttribLocation(program, 'a_position'); + var vertexArrays = []; + vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, vertices.length / 4, vertices)); + // Clear color to black for depth and stencil clear cases + + if (this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH || this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL) { + gl.clearColor(BLACK_COLOR[0], BLACK_COLOR[1], BLACK_COLOR[2], BLACK_COLOR[3]); + gl.clear(gl.COLOR_BUFFER_BIT); + } + + // Set fail values for color, depth and stencil + + gl.uniform4fv(colorUnif, FAIL_COLOR_RED); + gl.clearColor(FAIL_COLOR_RED[0], FAIL_COLOR_RED[1], FAIL_COLOR_RED[2], FAIL_COLOR_RED[3]); + gl.clearDepth(FAIL_DEPTH); + gl.clearStencil(FAIL_STENCIL); + + // Enable rasterizer discard + + gl.enable(gl.RASTERIZER_DISCARD); + bufferedLogToConsole('Rasterizer discard enabled'); + + // Do to-be-discarded primitive draws and buffer clears + + switch (this.m_caseType) { + case es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH: + gluDrawUtil.draw(gl, program, vertexArrays, new gluDrawUtil.PrimitiveList(this.m_drawMode, vertices.length / 4)); + break; + case es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL: + gluDrawUtil.draw(gl, program, vertexArrays, new gluDrawUtil.PrimitiveList(this.m_drawMode, vertices.length / 4)); + break; + case es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR: + if (this.m_caseOptions.useFBO) + gl.clearBufferfv(gl.COLOR, 0, FAIL_COLOR_RED); + else + gl.clear(gl.COLOR_BUFFER_BIT); + break; + case es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH: + if (this.m_caseOptions.useFBO) + gl.clearBufferfv(gl.DEPTH, 0, [FAIL_DEPTH]); + else + gl.clear(gl.DEPTH_BUFFER_BIT); + break; + case es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL: + if (this.m_caseOptions.useFBO) + gl.clearBufferiv(gl.STENCIL, 0, [FAIL_STENCIL]); + else + gl.clear(gl.STENCIL_BUFFER_BIT); + break; + default: + throw new Error('Invalid case type ' + this.m_caseType); + } + + // Disable rasterizer discard + + gl.disable(gl.RASTERIZER_DISCARD); + bufferedLogToConsole('Rasterizer discard disabled'); + + if (this.m_caseType == es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL) { + if (this.m_caseOptions.useFBO || gl.getContextAttributes().stencil) { + // Draw a full-screen square that colors all pixels red if they have stencil value 1. + var square = [new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, UNIT_SQUARE.length / 4, UNIT_SQUARE)]; + + gl.stencilFunc(gl.EQUAL, 1, 0xFF); + gluDrawUtil.draw(gl, program, square, + new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLE_STRIP, UNIT_SQUARE.length / 4)); + } + // \note If no stencil buffers are present and test is rendering to default framebuffer, test will always pass. + } else if (this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH || this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL) { + // Draw pass-indicating primitives for depth and stencil clear cases + + gl.uniform4fv(colorUnif, PASS_COLOR_BLUE); + gluDrawUtil.draw(gl, program, vertexArrays, new gluDrawUtil.PrimitiveList(this.m_drawMode, vertices.length / 4)); + } + + gl.finish(); + gl.disable(gl.STENCIL_TEST); + gl.disable(gl.DEPTH_TEST); + gl.disable(gl.SCISSOR_TEST); + + // Read and check pixel data + + var pixels = new tcuSurface.Surface(); + pixels.readViewport(gl); + + var width = pixels.getWidth(); + var height = pixels.getHeight(); + + for (var y = 0; y < height; y++) { + for (var x = 0; x < width; x++) { + var pixel = pixels.getPixel(x, y); + if (pixel[2] != 0) + passColorFound = true; + + if (pixel[0] != 0) { + failColorFound = true; + break; + } + } + if (failColorFound) break; + } + + // Delete FBO if created + + if (this.m_caseOptions.useFBO) + this.deleteFramebufferObject(); + + // Evaluate test result + + var testOk = passColorFound && !failColorFound; + + if (!testOk) { + tcuLogImage.logImage('Result image', '', pixels.getAccess()); + testFailed('Primitive or buffer clear was not discarded.'); + return tcuTestCase.IterateResult.STOP; + } + bufferedLogToConsole('Primitive or buffer clear was discarded correctly.'); + + if (++this.m_iterNdx < NUM_CASE_ITERATIONS) + return tcuTestCase.IterateResult.CONTINUE; + + testPassed(); + return tcuTestCase.IterateResult.STOP; +}; + +es3fRasterizerDiscardTests.init = function() { + var state = tcuTestCase.runner; + var testGroup = state.testCases; + + var basic = tcuTestCase.newTest('basic', 'Rasterizer discard test for default framebuffer'); + var scissor = tcuTestCase.newTest('scissor', 'Rasterizer discard test for default framebuffer with scissor test enabled'); + var fbo = tcuTestCase.newTest('fbo', 'Rasterizer discard test for framebuffer object'); + + testGroup.addChild(basic); + testGroup.addChild(scissor); + testGroup.addChild(fbo); + + // Default framebuffer cases + + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.POINTS)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.LINES)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.LINE_STRIP)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.LINE_LOOP)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.TRIANGLES)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.TRIANGLE_STRIP)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.TRIANGLE_FAN)); + + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.POINTS)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.LINES)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.LINE_STRIP)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.LINE_LOOP)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.TRIANGLES)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.TRIANGLE_STRIP)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.TRIANGLE_FAN)); + + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_color', 'clear_color', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR, null)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_depth', 'clear_depth', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH, null)); + basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_stencil', 'clear_stencil', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL, null)); + + // Default framebuffer cases with scissor test enabled + + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.POINTS)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINES)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_STRIP)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_LOOP)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLES)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_STRIP)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_FAN)); + + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.POINTS)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINES)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_STRIP)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_LOOP)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLES)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_STRIP)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_FAN)); + + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_color', 'clear_color', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR, es3fRasterizerDiscardTests.CaseOptions.SCISSOR)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_depth', 'clear_depth', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR)); + scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_stencil', 'clear_stencil', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR)); + + // FBO cases + + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.POINTS)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINES)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_STRIP)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_LOOP)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLES)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_STRIP)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_FAN)); + + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.POINTS)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINES)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_STRIP)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_LOOP)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLES)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_STRIP)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_FAN)); + + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_color', 'clear_color', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR, es3fRasterizerDiscardTests.CaseOptions.FBO)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_depth', 'clear_depth', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO)); + fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_stencil', 'clear_stencil', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO)); +}; + +/** + * Create and execute the test cases + */ +es3fRasterizerDiscardTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var testName = 'rasterizer_discard'; + var testDescription = 'Rasterizer Discard Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + es3fRasterizerDiscardTests.init(); + tcuTestCase.runTestCases(); + } catch (err) { + testFailedOptions('Failed to run tests', false); + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js new file mode 100644 index 000000000..990310299 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js @@ -0,0 +1,308 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fRboStateQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { +var es3fRboStateQueryTests = functional.gles3.es3fRboStateQueryTests; +var tcuTestCase = framework.common.tcuTestCase; +var glsStateQuery = modules.shared.glsStateQuery; +var es3fApiCase = functional.gles3.es3fApiCase; +var deRandom = framework.delibs.debase.deRandom; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @this {es3fApiCase.ApiCase} + */ +var checkRenderbufferComponentSize = function(r, g, b, a, d, s) { + var referenceSizes = [r, g, b, a, d, s]; + var paramNames = [ + gl.RENDERBUFFER_RED_SIZE, + gl.RENDERBUFFER_GREEN_SIZE, + gl.RENDERBUFFER_BLUE_SIZE, + gl.RENDERBUFFER_ALPHA_SIZE, + gl.RENDERBUFFER_DEPTH_SIZE, + gl.RENDERBUFFER_STENCIL_SIZE + ]; + + for (var ndx = 0; ndx < referenceSizes.length; ++ndx) { + if (referenceSizes[ndx] == -1) + continue; + var value = /** @type {number} */ (gl.getRenderbufferParameter(gl.RENDERBUFFER, paramNames[ndx])); + + this.check(value >= referenceSizes[ndx], 'Expected greater or equal to ' + referenceSizes[ndx] + ' got ' + value); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fRboStateQueryTests.RboSizeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fRboStateQueryTests.RboSizeCase, es3fApiCase.ApiCase); + +es3fRboStateQueryTests.RboSizeCase.prototype.test = function() { + var rnd = new deRandom.Random(0xabcdef); + + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_WIDTH, 0)); + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_HEIGHT, 0)); + + var numIterations = 60; + for (var i = 0; i < numIterations; ++i) { + var w = rnd.getInt(0, 128); + var h = rnd.getInt(0, 128); + + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB8, w, h); + + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_WIDTH, w)); + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_HEIGHT, h)); + } + gl.deleteRenderbuffer(renderbufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fRboStateQueryTests.RboInternalFormatCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fRboStateQueryTests.RboInternalFormatCase, es3fApiCase.ApiCase); + +es3fRboStateQueryTests.RboInternalFormatCase.prototype.test = function() { + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_INTERNAL_FORMAT, gl.RGBA4)); + + var requiredColorformats = [ + gl.R8, gl.RG8, gl.RGB8, gl.RGB565, gl.RGBA4, gl.RGB5_A1, gl.RGBA8, gl.RGB10_A2, + gl.RGB10_A2UI, gl.SRGB8_ALPHA8, gl.R8I, gl.R8UI, gl.R16I, gl.R16UI, gl.R32I, gl.R32UI, + gl.RG8I, gl.RG8UI, gl.RG16I, gl.RG16UI, gl.RG32I, gl.RG32UI, gl.RGBA8I, gl.RGBA8UI, + gl.RGBA16I, gl.RGBA16UI, gl.RGBA32I, gl.RGBA32UI + ]; + + for (var ndx = 0; ndx < requiredColorformats.length; ++ndx) { + gl.renderbufferStorage(gl.RENDERBUFFER, requiredColorformats[ndx], 128, 128); + + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_INTERNAL_FORMAT, requiredColorformats[ndx])); + } + gl.deleteRenderbuffer(renderbufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fRboStateQueryTests.RboComponentSizeColorCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fRboStateQueryTests.RboComponentSizeColorCase, es3fApiCase.ApiCase); + +es3fRboStateQueryTests.RboComponentSizeColorCase.prototype.test = function() { + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + checkRenderbufferComponentSize.bind(this, 0, 0, 0, 0, 0, 0); + + var requiredColorFormats = [ + // format, r, g, b, a + [gl.R8, 8, 0, 0, 0], + [gl.RG8, 8, 8, 0, 0], + [gl.RGB8, 8, 8, 8, 0], + [gl.RGB565, 5, 6, 5, 0], + [gl.RGBA4, 4, 4, 4, 4], + [gl.RGB5_A1, 5, 5, 5, 1], + [gl.RGBA8, 8, 8, 8, 8], + [gl.RGB10_A2, 10, 10, 10, 2], + [gl.RGB10_A2UI, 10, 10, 10, 2], + [gl.SRGB8_ALPHA8, 8, 8, 8, 8], + [gl.R8I, 8, 0, 0, 0], + [gl.R8UI, 8, 0, 0, 0], + [gl.R16I, 16, 0, 0, 0], + [gl.R16UI, 16, 0, 0, 0], + [gl.R32I, 32, 0, 0, 0], + [gl.R32UI, 32, 0, 0, 0], + [gl.RG8I, 8, 8, 0, 0], + [gl.RG8UI, 8, 8, 0, 0], + [gl.RG16I, 16, 16, 0, 0], + [gl.RG16UI, 16, 16, 0, 0], + [gl.RG32I, 32, 32, 0, 0], + [gl.RG32UI, 32, 32, 0, 0], + [gl.RGBA8I, 8, 8, 8, 8], + [gl.RGBA8UI, 8, 8, 8, 8], + [gl.RGBA16I, 16, 16, 16, 16], + [gl.RGBA16UI, 16, 16, 16, 16], + [gl.RGBA32I, 32, 32, 32, 32], + [gl.RGBA32UI, 32, 32, 32, 32] + ]; + + for (var ndx = 0; ndx < requiredColorFormats.length; ++ndx) { + gl.renderbufferStorage(gl.RENDERBUFFER, requiredColorFormats[ndx][0], 128, 128); + + checkRenderbufferComponentSize.bind(this, requiredColorFormats[ndx][1], requiredColorFormats[ndx][2], requiredColorFormats[ndx][3], requiredColorFormats[ndx][4], -1, -1); + } + gl.deleteRenderbuffer(renderbufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fRboStateQueryTests.RboComponentSizeDepthCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fRboStateQueryTests.RboComponentSizeDepthCase, es3fApiCase.ApiCase); + +es3fRboStateQueryTests.RboComponentSizeDepthCase.prototype.test = function() { + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + var requiredDepthFormats = [ + // format, depth, stencil + [gl.DEPTH_COMPONENT16, 16, 0], + [gl.DEPTH_COMPONENT24, 24, 0], + [gl.DEPTH_COMPONENT32F, 32, 0], + [gl.DEPTH24_STENCIL8, 24, 8], + [gl.DEPTH32F_STENCIL8, 32, 8] + ]; + + for (var ndx = 0; ndx < requiredDepthFormats.length; ++ndx) { + gl.renderbufferStorage(gl.RENDERBUFFER, requiredDepthFormats[ndx][0], 128, 128); + + checkRenderbufferComponentSize.bind(this, -1, -1, -1, -1, requiredDepthFormats[ndx][1], requiredDepthFormats[ndx][2]); + } + + // STENCIL_INDEX8 is required, in that case sBits >= 8 + gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, 128, 128); + + var value = /** @type {number} */ (gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE)); + this.check(value >= 8, 'Expected greater or equal to 8; got ' + value); + + gl.deleteRenderbuffer(renderbufferID); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fRboStateQueryTests.RboSamplesCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fRboStateQueryTests.RboSamplesCase, es3fApiCase.ApiCase); + +es3fRboStateQueryTests.RboSamplesCase.prototype.test = function() { + var rnd = new deRandom.Random(0xabcdef); + + var renderbufferID = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID); + + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_SAMPLES, 0)); + + var max_samples = /** @type {number} */ (gl.getParameter(gl.MAX_SAMPLES)); + + // 0 samples is a special case + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, gl.RGBA8, 128, 128); + + this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_SAMPLES, 0)); + + // test [1, n] samples + for (var samples = 1; samples <= max_samples; ++samples) { + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.RGBA8, 128, 128); + var value = /** @type {number} */ (gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_SAMPLES)); + this.check(value >= samples, 'Expected greater or equal to ' + samples + ' got ' + value); + } + + gl.deleteRenderbuffer(renderbufferID); +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fRboStateQueryTests.RboStateQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'rbo', 'Rbo State Query tests'); +}; + +es3fRboStateQueryTests.RboStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fRboStateQueryTests.RboStateQueryTests.prototype.constructor = es3fRboStateQueryTests.RboStateQueryTests; + +es3fRboStateQueryTests.RboStateQueryTests.prototype.init = function() { + this.addChild(new es3fRboStateQueryTests.RboSizeCase('renderbuffer_size', 'RENDERBUFFER_WIDTH and RENDERBUFFER_HEIGHT')); + this.addChild(new es3fRboStateQueryTests.RboInternalFormatCase('renderbuffer_internal_format', 'RENDERBUFFER_INTERNAL_FORMAT')); + this.addChild(new es3fRboStateQueryTests.RboComponentSizeColorCase('renderbuffer_component_size_color', 'RENDERBUFFER_x_SIZE')); + this.addChild(new es3fRboStateQueryTests.RboComponentSizeDepthCase('renderbuffer_component_size_depth', 'RENDERBUFFER_x_SIZE')); + this.addChild(new es3fRboStateQueryTests.RboSamplesCase('renderbuffer_samples', 'RENDERBUFFER_SAMPLES')); +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fRboStateQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fRboStateQueryTests.RboStateQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fRboStateQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js new file mode 100644 index 000000000..7996c9196 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js @@ -0,0 +1,517 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fReadPixelTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + var es3fReadPixelTests = functional.gles3.es3fReadPixelTests; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuRGBA = framework.common.tcuRGBA; + var tcuTestCase = framework.common.tcuTestCase; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var gluShaderProgram = framework.opengl.gluShaderProgram; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {boolean} chooseFormat + * @param {number} alignment + * @param {number} rowLength + * @param {number} skipRows + * @param {number} skipPixels + * @param {number=} format + * @param {number=} type + */ + es3fReadPixelTests.ReadPixelsTest = function(name, description, chooseFormat, alignment, rowLength, skipRows, skipPixels, format, type) { + tcuTestCase.DeqpTest.call(this, name, description); + + /** @type {number} */ this.m_seed = deString.deStringHash(name); + /** @type {boolean} */ this.m_chooseFormat = chooseFormat; + /** @type {number} */ this.m_alignment = alignment; + /** @type {number} */ this.m_rowLength = rowLength; + /** @type {number} */ this.m_skipRows = skipRows; + /** @type {number} */ this.m_skipPixels = skipPixels; + /** @type {number} */ this.m_format = format !== undefined ? format : gl.RGBA; + /** @type {number} */ this.m_type = type !== undefined ? type : gl.UNSIGNED_BYTE; + + /** @const {number} */ this.m_width = 13; + /** @const {number} */ this.m_height = 13; + }; + + es3fReadPixelTests.ReadPixelsTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fReadPixelTests.ReadPixelsTest.prototype.constructor = es3fReadPixelTests.ReadPixelsTest; + + /** + * @param {tcuTexture.Texture2D} reference + */ + es3fReadPixelTests.ReadPixelsTest.prototype.render = function(reference) { + var refType = /** @type {tcuTexture.ChannelType} */ (reference.getFormat().type); + /** @type {number} */ var width = reference.getWidth(); + /** @type {number} */ var height = reference.getHeight(); + /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0); + + // Create program + /** @type {string} */ var vertexSource = '#version 300 es\n' + + 'in mediump vec2 i_coord;\n' + + 'void main (void)\n' + + '{\n' + + '\tgl_Position = vec4(i_coord, 0.0, 1.0);\n' + + '}\n'; + + /** @type {string} */ var fragmentSource = '#version 300 es\n'; + + if (refType === tcuTexture.ChannelType.SIGNED_INT32) + fragmentSource += 'layout(location = 0) out mediump ivec4 o_color;\n'; + else if (refType === tcuTexture.ChannelType.UNSIGNED_INT32) + fragmentSource += 'layout(location = 0) out mediump uvec4 o_color;\n'; + else + fragmentSource += 'layout(location = 0) out mediump vec4 o_color;\n'; + + fragmentSource += 'void main (void)\n' + + '{\n'; + + if (refType === tcuTexture.ChannelType.UNSIGNED_INT32) + fragmentSource += '\to_color = uvec4(0, 0, 0, 1000);\n'; + else if (refType === tcuTexture.ChannelType.SIGNED_INT32) + fragmentSource += '\to_color = ivec4(0, 0, 0, 1000);\n'; + else + fragmentSource += '\to_color = vec4(0.0, 0.0, 0.0, 1.0);\n'; + + fragmentSource += '}\n'; + + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexSource, fragmentSource)); + + assertMsgOptions(program.isOk(), 'Program failed', false, true); + + gl.useProgram(program.getProgram()); + + // Render + /** @type {Array} */ var coords = [ + -0.5, -0.5, + 0.5, -0.5, + 0.5, 0.5, + + 0.5, 0.5, + -0.5, 0.5, + -0.5, -0.5 + ]; + /** @type {number} */ var coordLoc; + + coordLoc = gl.getAttribLocation(program.getProgram(), 'i_coord'); + + gl.enableVertexAttribArray(coordLoc); + + /** @type {WebGLBuffer} */ var coordsGLBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, coordsGLBuffer); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(coords), gl.STATIC_DRAW); + gl.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0); + + gl.drawArrays(gl.TRIANGLES, 0, 6); + gl.disableVertexAttribArray(coordLoc); + + // Render reference + + /** @type {number} */ var coordX1 = Math.floor((-0.5 * width / 2.0) + width / 2.0); + /** @type {number} */ var coordY1 = Math.floor((-0.5 * height / 2.0) + height / 2.0); + /** @type {number} */ var coordX2 = Math.floor((0.5 * width / 2.0) + width / 2.0); + /** @type {number} */ var coordY2 = Math.floor((0.5 * height / 2.0) + height / 2.0); + + for (var x = 0; x < width; x++) { + if (x < coordX1 || x > coordX2) + continue; + + for (var y = 0; y < height; y++) { + if (y >= coordY1 && y <= coordY2) { + if (refType === tcuTexture.ChannelType.SIGNED_INT32) + level0.setPixelInt([0, 0, 0, 1000], x, y); + else if (refType === tcuTexture.ChannelType.UNSIGNED_INT32) + level0.setPixelInt([0, 0, 0, 1000], x, y); + else + level0.setPixel([0.0, 0.0, 0.0, 1.0], x, y); + } + } + } + }; + + /** + * @return {{format: tcuTexture.TextureFormat, pixelSize: number, align: boolean}} + */ + es3fReadPixelTests.ReadPixelsTest.prototype.getFormatInfo = function() { + if (this.m_chooseFormat) { + this.m_format = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT)); + this.m_type = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE)); + } + + /** @type {tcuTexture.TextureFormat} */ var fmt = gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_type); + /** @type {boolean} */ var align_; + switch (this.m_type) { + case gl.BYTE: + case gl.UNSIGNED_BYTE: + case gl.SHORT: + case gl.UNSIGNED_SHORT: + case gl.INT: + case gl.UNSIGNED_INT: + case gl.FLOAT: + case gl.HALF_FLOAT: + align_ = true; + break; + + case gl.UNSIGNED_SHORT_5_6_5: + case gl.UNSIGNED_SHORT_4_4_4_4: + case gl.UNSIGNED_SHORT_5_5_5_1: + case gl.UNSIGNED_INT_2_10_10_10_REV: + case gl.UNSIGNED_INT_10F_11F_11F_REV: + case gl.UNSIGNED_INT_24_8: + case gl.FLOAT_32_UNSIGNED_INT_24_8_REV: + case gl.UNSIGNED_INT_5_9_9_9_REV: + align_ = false; + break; + + default: + throw new Error('Unsupported format'); + } + + /** @type {number} */ var pxSize = fmt.getPixelSize(); + + return {format: fmt, pixelSize: pxSize, align: align_}; + }; + + /** + * @param {tcuTexture.Texture2D} reference + * @param {boolean} align + * @param {number} pixelSize + * @return {goog.TypedArray} + */ + es3fReadPixelTests.ReadPixelsTest.prototype.clearColor = function(reference, align, pixelSize) { + /** @type {number} */ var width = reference.getWidth(); + /** @type {number} */ var height = reference.getHeight(); + /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0); + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(this.m_seed); + /** @type {WebGLFramebuffer} */ var framebuffer; + /** @type {WebGLRenderbuffer} */ var renderbuffer; + /** @type {number} */ var red; + /** @type {number} */ var green; + /** @type {number} */ var blue; + /** @type {number} */ var alpha; + /** @type {Array} */ var color; + + if (this.m_format === gl.RGBA_INTEGER) { + if (this.m_type === gl.UNSIGNED_INT) { + renderbuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA32UI, this.m_width, this.m_height); + } else if (this.m_type === gl.INT) { + renderbuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA32I, this.m_width, this.m_height); + } else + throw new Error('Type not supported'); + + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); + framebuffer = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer); + } else if (this.m_format === gl.RGBA || /*this.m_format === gl.BGRA ||*/ this.m_format === gl.RGB) { + // Empty + } else + throw new Error('Format not supported'); + + gl.viewport(0, 0, width, height); + + // Clear color + if (this.m_format === gl.RGBA || this.m_format === gl.RGB) { + red = rnd.getFloat(); + green = rnd.getFloat(); + blue = rnd.getFloat(); + alpha = rnd.getFloat(); + + color = [red, green, blue, alpha]; + // Clear target + gl.clearColor(red, green, blue, alpha); + bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')'); + + gl.clearBufferfv(gl.COLOR, 0, color); + + // Clear reference + level0.clear(color); + } else if (this.m_format === gl.RGBA_INTEGER) { + if (this.m_type === gl.INT) { + red = Math.abs(rnd.getInt()); + green = Math.abs(rnd.getInt()); + blue = Math.abs(rnd.getInt()); + alpha = Math.abs(rnd.getInt()); + + color = [red, green, blue, alpha]; + bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')'); + + gl.clearBufferiv(gl.COLOR, 0, color); + + // Clear reference + level0.clear([red, green, blue, alpha]); + } else if (this.m_type === gl.UNSIGNED_INT) { + red = Math.abs(rnd.getInt()); + green = Math.abs(rnd.getInt()); + blue = Math.abs(rnd.getInt()); + alpha = Math.abs(rnd.getInt()); + + color = [red, green, blue, alpha]; + bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')'); + + gl.clearBufferuiv(gl.COLOR, 0, color); + + // Clear reference + level0.clear(color); + } else + throw new Error('Type not supported.'); + } else + throw new Error('Format not supported.'); + + this.render(reference); + + /** @type {number} */ var rowWidth = (this.m_rowLength === 0 ? this.m_width : this.m_rowLength) + this.m_skipPixels; + /** @type {number} */ var rowPitch = (align ? this.m_alignment * Math.ceil(pixelSize * rowWidth / this.m_alignment) : rowWidth * pixelSize); + + var arrayType = tcuTexture.getTypedArray(reference.getFormat().type); + /** @type {goog.TypedArray} */ var pixelData = new arrayType(rowPitch * (this.m_height + this.m_skipRows)); + gl.readPixels(0, 0, this.m_width, this.m_height, this.m_format, this.m_type, pixelData); + + if (framebuffer) + gl.deleteFramebuffer(framebuffer); + + if (renderbuffer) + gl.deleteRenderbuffer(renderbuffer); + + return pixelData; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fReadPixelTests.ReadPixelsTest.prototype.iterate = function() { + /** @type {tcuTexture.TextureFormat} */ var format = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + /** @type {number} */ var pixelSize; + /** @type {boolean} */ var align; + + /** @type {{format: tcuTexture.TextureFormat, pixelSize: number, align: boolean}} */ var formatInfo = this.getFormatInfo(); + format = formatInfo.format; + align = formatInfo.align; + pixelSize = formatInfo.pixelSize; + + bufferedLogToConsole('Format: ' + this.m_format + ', Type: ' + this.m_type); + + /** @type {tcuTexture.Texture2D} */ var reference = new tcuTexture.Texture2D(format, this.m_width, this.m_height); + reference.allocLevel(0); + /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0); + + this.m_alignment = /** @type {number} */ (gl.getParameter(gl.PACK_ALIGNMENT)); + bufferedLogToConsole('gl.PACK_ALIGNMENT: ' + this.m_alignment); + + this.m_rowLength = /** @type {number} */ (gl.getParameter(gl.PACK_ROW_LENGTH)); + bufferedLogToConsole('gl.PACK_ROW_LENGTH: ' + this.m_rowLength); + + this.m_skipRows = /** @type {number} */ (gl.getParameter(gl.PACK_SKIP_ROWS)); + bufferedLogToConsole('gl.PACK_SKIP_ROWS: ' + this.m_skipRows); + + this.m_skipPixels = /** @type {number} */ (gl.getParameter(gl.PACK_SKIP_PIXELS)); + bufferedLogToConsole('gl.PACK_SKIP_PIXELS: ' + this.m_skipPixels); + + gl.viewport(0, 0, this.m_width, this.m_height); + + /** @type {goog.TypedArray} */ var pixelData = this.clearColor(reference, align, pixelSize); + + /** @type {number} */ var rowWidth = (this.m_rowLength === 0 ? this.m_width : this.m_rowLength); + /** @type {number} */ var rowPitch = (align ? this.m_alignment * Math.ceil(pixelSize * rowWidth / this.m_alignment) : rowWidth * pixelSize); + /** @type {Array} */ var formatBitDepths = []; + /** @type {number} */ var redThreshold; + /** @type {number} */ var greenThreshold; + /** @type {number} */ var blueThreshold; + /** @type {number} */ var alphaThreshold; + var redBits = /** @type {number} */ (gl.getParameter(gl.RED_BITS)); + var blueBits = /** @type {number} */ (gl.getParameter(gl.BLUE_BITS)); + var greenBits = /** @type {number} */ (gl.getParameter(gl.GREEN_BITS)); + var alphaBits = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS)); + /** @type {(tcuRGBA.RGBA|Array)} */ var threshold; + /** @type {tcuTexture.PixelBufferAccess} */ var result; + // \note gl.RGBA_INTEGER uses always renderbuffers that are never multisampled. Otherwise default framebuffer is used. + if (this.m_format !== gl.RGBA_INTEGER && /** @type {number} */ (gl.getParameter(gl.SAMPLES)) > 1) { + formatBitDepths = tcuTextureUtil.getTextureFormatBitDepth(format); + redThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(redBits, formatBitDepths[0])))); + greenThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(greenBits, formatBitDepths[1])))); + blueThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(blueBits, formatBitDepths[2])))); + alphaThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(alphaBits, formatBitDepths[3])))); + + result = tcuTexture.PixelBufferAccess.newFromTextureFormat(format, this.m_width, this.m_height, 1, rowPitch, 0, pixelData.buffer); + threshold = new tcuRGBA.RGBA([redThreshold, greenThreshold, blueThreshold, alphaThreshold]); + if (tcuImageCompare.bilinearCompare('Result', 'Result', level0, result, threshold)) + testPassedOptions('Pass', true); + else + testFailedOptions('Fail', false); + } else { + formatBitDepths = tcuTextureUtil.getTextureFormatBitDepth(format); + redThreshold = 2.0 / (1 << Math.min(redBits, formatBitDepths[0])); + greenThreshold = 2.0 / (1 << Math.min(greenBits, formatBitDepths[1])); + blueThreshold = 2.0 / (1 << Math.min(blueBits, formatBitDepths[2])); + alphaThreshold = 2.0 / (1 << Math.min(alphaBits, formatBitDepths[3])); + + // Compare + result = new tcuTexture.PixelBufferAccess({ + format: format, + width: this.m_width, + height: this.m_height, + rowPitch: rowPitch, + data: pixelData.buffer, + offset: pixelSize * this.m_skipPixels + this.m_skipRows * rowPitch + }); + + threshold = [redThreshold, greenThreshold, blueThreshold, alphaThreshold]; + if (tcuImageCompare.floatThresholdCompare('Result', 'Result', level0, result, threshold)) + testPassedOptions('Pass', true); + else + testFailedOptions('Fail', false); + } + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fReadPixelTests.ReadPixelTests = function() { + tcuTestCase.DeqpTest.call(this, 'read_pixels', 'ReadPixel tests'); + }; + + es3fReadPixelTests.ReadPixelTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fReadPixelTests.ReadPixelTests.prototype.constructor = es3fReadPixelTests.ReadPixelTests; + + es3fReadPixelTests.ReadPixelTests.prototype.init = function() { + /** @type {tcuTestCase.DeqpTest} */ var groupAlignment = tcuTestCase.newTest('alignment', 'Read pixels pack alignment parameter tests'); + + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_1', '', false, 1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_2', '', false, 2, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_4', '', false, 4, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_8', '', false, 8, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_1', '', false, 1, 0, 0, 0, gl.RGBA_INTEGER, gl.INT)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_2', '', false, 2, 0, 0, 0, gl.RGBA_INTEGER, gl.INT)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_4', '', false, 4, 0, 0, 0, gl.RGBA_INTEGER, gl.INT)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_8', '', false, 8, 0, 0, 0, gl.RGBA_INTEGER, gl.INT)); + + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_1', '', false, 1, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_2', '', false, 2, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_4', '', false, 4, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_8', '', false, 8, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_1', '', true, 1, 0, 0, 0)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_2', '', true, 2, 0, 0, 0)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_4', '', true, 4, 0, 0, 0)); + groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_8', '', true, 8, 0, 0, 0)); + + this.addChild(groupAlignment); + + /** @type {tcuTestCase.DeqpTest} */ var groupRowLength = tcuTestCase.newTest('rowlength', 'Read pixels rowlength test'); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_17', '', false, 4, 17, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_19', '', false, 4, 19, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_23', '', false, 4, 23, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_29', '', false, 4, 29, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_17', '', false, 4, 17, 0, 0, gl.RGBA_INTEGER, gl.INT)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_19', '', false, 4, 19, 0, 0, gl.RGBA_INTEGER, gl.INT)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_23', '', false, 4, 23, 0, 0, gl.RGBA_INTEGER, gl.INT)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_29', '', false, 4, 29, 0, 0, gl.RGBA_INTEGER, gl.INT)); + + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_17', '', false, 4, 17, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_19', '', false, 4, 19, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_23', '', false, 4, 23, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_29', '', false, 4, 29, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_17', '', true, 4, 17, 0, 0)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_19', '', true, 4, 19, 0, 0)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_23', '', true, 4, 23, 0, 0)); + groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_29', '', true, 4, 29, 0, 0)); + + this.addChild(groupRowLength); + + /** @type {tcuTestCase.DeqpTest} */ var groupSkip = tcuTestCase.newTest('skip', 'Read pixels skip pixels and rows test'); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_0_3', '', false, 4, 17, 0, 3, gl.RGBA, gl.UNSIGNED_BYTE)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_0', '', false, 4, 17, 3, 0, gl.RGBA, gl.UNSIGNED_BYTE)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_3', '', false, 4, 17, 3, 3, gl.RGBA, gl.UNSIGNED_BYTE)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_5', '', false, 4, 17, 3, 5, gl.RGBA, gl.UNSIGNED_BYTE)); + + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_0_3', '', false, 4, 17, 0, 3, gl.RGBA_INTEGER, gl.INT)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_0', '', false, 4, 17, 3, 0, gl.RGBA_INTEGER, gl.INT)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_3', '', false, 4, 17, 3, 3, gl.RGBA_INTEGER, gl.INT)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_5', '', false, 4, 17, 3, 5, gl.RGBA_INTEGER, gl.INT)); + + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_0_3', '', false, 4, 17, 0, 3, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_0', '', false, 4, 17, 3, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_3', '', false, 4, 17, 3, 3, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_5', '', false, 4, 17, 3, 5, gl.RGBA_INTEGER, gl.UNSIGNED_INT)); + + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_0_3', '', true, 4, 17, 0, 3)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_0', '', true, 4, 17, 3, 0)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_3', '', true, 4, 17, 3, 3)); + groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_5', '', true, 4, 17, 3, 5)); + + this.addChild(groupSkip); + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fReadPixelTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fReadPixelTests.ReadPixelTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fReadPixelTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js new file mode 100644 index 000000000..271a2186a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js @@ -0,0 +1,313 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fSamplerObjectTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('modules.shared.glsSamplerObjectTest'); + +goog.scope(function() { + +var es3fSamplerObjectTests = functional.gles3.es3fSamplerObjectTests; +var tcuTestCase = framework.common.tcuTestCase; +var glsSamplerObjectTest = modules.shared.glsSamplerObjectTest; + + /** @type {WebGL2RenderingContext} */ var gl; + + // TODO: implement glsSamplerObjectTest and validate constructors + es3fSamplerObjectTests.init = function() { + var testGroup = tcuTestCase.runner.testCases; + /** @type {Array} */ var simpleTestCases = [ + new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0) + ) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var simpleTexture2D = tcuTestCase.newTest('single_tex_2d', 'Simple 2D texture with sampler'); + + for (var testNdx = 0; testNdx < simpleTestCases.length; testNdx++) + simpleTexture2D.addChild(new glsSamplerObjectTest.TextureSamplerTest(simpleTestCases[testNdx])); + + testGroup.addChild(simpleTexture2D); + + /** @type {Array} */ var multiTestCases = [ + new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_2D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0) + ) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var multiTexture2D = tcuTestCase.newTest('multi_tex_2d', 'Multiple texture units 2D texture with sampler'); + + for (var testNdx = 0; testNdx < multiTestCases.length; testNdx++) + multiTexture2D.addChild(new glsSamplerObjectTest.MultiTextureSamplerTest(multiTestCases[testNdx])); + + testGroup.addChild(multiTexture2D); + + /** @type {Array} */ var simpleTestCases3D = [ + new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0) + ) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var simpleTexture3D = tcuTestCase.newTest('single_tex_3d', 'Simple 3D texture with sampler'); + + for (var testNdx = 0; testNdx < simpleTestCases3D.length; testNdx++) + simpleTexture3D.addChild(new glsSamplerObjectTest.TextureSamplerTest(simpleTestCases3D[testNdx])); + + testGroup.addChild(simpleTexture3D); + + /** @type {Array} */ var multiTestCases3D = [ + new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_3D, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0) + ) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var multiTexture3D = tcuTestCase.newTest('multi_tex_3d', 'Multiple texture units 3D texture with sampler'); + + for (var testNdx = 0; testNdx < multiTestCases3D.length; testNdx++) + multiTexture3D.addChild(new glsSamplerObjectTest.MultiTextureSamplerTest(multiTestCases3D[testNdx])); + + testGroup.addChild(multiTexture3D); + + /** @type {Array} */ var simpleTestCasesCube = [ + new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0) + ) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var simpleTextureCube = tcuTestCase.newTest('single_cubemap', 'Simple cubemap texture with sampler'); + + for (var testNdx = 0; testNdx < simpleTestCasesCube.length; testNdx++) + simpleTextureCube.addChild(new glsSamplerObjectTest.TextureSamplerTest(simpleTestCasesCube[testNdx])); + + testGroup.addChild(simpleTextureCube); + + /** @type {Array} */ var multiTestCasesCube = [ + new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0) + ), + new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0) + ), + new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_CUBE_MAP, + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0), + new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0) + ) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var multiTextureCube = tcuTestCase.newTest('multi_cubemap', 'Multiple texture units cubemap textures with sampler'); + + for (var testNdx = 0; testNdx < multiTestCasesCube.length; testNdx++) + multiTextureCube.addChild(new glsSamplerObjectTest.MultiTextureSamplerTest(multiTestCasesCube[testNdx])); + + testGroup.addChild(multiTextureCube); + }; + + es3fSamplerObjectTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var testName = 'sampler_object'; + var testDescription = 'Sampler Object Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.setRoot(tcuTestCase.newTest(testName, testDescription, null)); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fSamplerObjectTests.init(); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fSamplerObjectTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js new file mode 100644 index 000000000..22cfde12a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js @@ -0,0 +1,205 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fSamplerStateQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { +var es3fSamplerStateQueryTests = functional.gles3.es3fSamplerStateQueryTests; +var tcuTestCase = framework.common.tcuTestCase; +var glsStateQuery = modules.shared.glsStateQuery; +var es3fApiCase = functional.gles3.es3fApiCase; +var deRandom = framework.delibs.debase.deRandom; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fSamplerStateQueryTests.SamplerCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {WebGLSampler} */ this.m_sampler; +}; + +setParentClass(es3fSamplerStateQueryTests.SamplerCase, es3fApiCase.ApiCase); + +es3fSamplerStateQueryTests.SamplerCase.prototype.testSampler = function() { + throw new Error('Virtual function. Please override.'); +}; + +es3fSamplerStateQueryTests.SamplerCase.prototype.test = function() { + this.m_sampler = gl.createSampler(); + + this.testSampler(); + + gl.deleteSampler(this.m_sampler); +}; + +/** + * @constructor + * @extends {es3fSamplerStateQueryTests.SamplerCase} + * @param {string} name + * @param {string} description + * @param {number} valueName + * @param {number} initialValue + * @param {Array} valueRange + */ +es3fSamplerStateQueryTests.SamplerModeCase = function(name, description, valueName, initialValue, valueRange) { + es3fSamplerStateQueryTests.SamplerCase.call(this, name, description); + this.m_valueName = valueName; + this.m_initialValue = initialValue; + this.m_valueRange = valueRange; +}; + +setParentClass(es3fSamplerStateQueryTests.SamplerModeCase, es3fSamplerStateQueryTests.SamplerCase); + +es3fSamplerStateQueryTests.SamplerModeCase.prototype.testSampler = function() { + this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_valueName, this.m_initialValue)); + + for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) { + gl.samplerParameteri(this.m_sampler, this.m_valueName, this.m_valueRange[ndx]); + + this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_valueName, this.m_valueRange[ndx])); + } + + //check unit conversions with float + + for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) { + gl.samplerParameterf(this.m_sampler, this.m_valueName, this.m_valueRange[ndx]); + + this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_valueName, this.m_valueRange[ndx])); + } +}; + +/** + * @constructor + * @extends {es3fSamplerStateQueryTests.SamplerCase} + * @param {string} name + * @param {string} description + * @param {number} lodTarget + * @param {number} initialValue + */ +es3fSamplerStateQueryTests.SamplerLODCase = function(name, description, lodTarget, initialValue) { + es3fSamplerStateQueryTests.SamplerCase.call(this, name, description); + this.m_lodTarget = lodTarget; + this.m_initialValue = initialValue; +}; + +setParentClass(es3fSamplerStateQueryTests.SamplerLODCase, es3fSamplerStateQueryTests.SamplerCase); + +es3fSamplerStateQueryTests.SamplerLODCase.prototype.testSampler = function() { + var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_lodTarget, this.m_initialValue)); + var numIterations = 60; + for (var ndx = 0; ndx < numIterations; ++ndx) { + var ref = rnd.getFloat(-64000, 64000); + + gl.samplerParameterf(this.m_sampler, this.m_lodTarget, ref); + + this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_lodTarget, ref)); + } + + // check unit conversions with int + + for (var ndx = 0; ndx < numIterations; ++ndx) { + var ref = rnd.getInt(-64000, 64000); + + gl.samplerParameteri(this.m_sampler, this.m_lodTarget, ref); + + this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_lodTarget, ref)); + } +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fSamplerStateQueryTests.SamplerStateQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'sampler', 'Sampler State Query tests'); +}; + +es3fSamplerStateQueryTests.SamplerStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fSamplerStateQueryTests.SamplerStateQueryTests.prototype.constructor = es3fSamplerStateQueryTests.SamplerStateQueryTests; + +es3fSamplerStateQueryTests.SamplerStateQueryTests.prototype.init = function() { + var wrapValues = [gl.CLAMP_TO_EDGE, gl.REPEAT, gl.MIRRORED_REPEAT]; + this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_wrap_s' , 'TEXTURE_WRAP_S', + gl.TEXTURE_WRAP_S, gl.REPEAT, wrapValues)); + this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_wrap_t' , 'TEXTURE_WRAP_T', + gl.TEXTURE_WRAP_T, gl.REPEAT, wrapValues)); + this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_wrap_r' , 'TEXTURE_WRAP_R', + gl.TEXTURE_WRAP_R, gl.REPEAT, wrapValues)); + + var magValues = [gl.NEAREST, gl.LINEAR]; + this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_mag_filter' , 'TEXTURE_MAG_FILTER', + gl.TEXTURE_MAG_FILTER, gl.LINEAR, magValues)); + + var minValues = [gl.NEAREST, gl.LINEAR, gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_LINEAR]; + this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_min_filter' , 'TEXTURE_MIN_FILTER', + gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR, minValues)); + + this.addChild(new es3fSamplerStateQueryTests.SamplerLODCase('sampler_texture_min_lod' , 'TEXTURE_MIN_LOD', gl.TEXTURE_MIN_LOD, -1000)); + this.addChild(new es3fSamplerStateQueryTests.SamplerLODCase('sampler_texture_max_lod' , 'TEXTURE_MAX_LOD', gl.TEXTURE_MAX_LOD, 1000)); + + var modes = [gl.COMPARE_REF_TO_TEXTURE, gl.NONE]; + this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_compare_mode' , 'TEXTURE_COMPARE_MODE', + gl.TEXTURE_COMPARE_MODE, gl.NONE, modes)); + + var compareFuncs = [gl.LEQUAL, gl.GEQUAL, gl.LESS, gl.GREATER, gl.EQUAL, gl.NOTEQUAL, gl.ALWAYS, gl.NEVER]; + this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_compare_func' , 'TEXTURE_COMPARE_FUNC', + gl.TEXTURE_COMPARE_FUNC, gl.LEQUAL, compareFuncs)); +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fSamplerStateQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fSamplerStateQueryTests.SamplerStateQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fSamplerStateQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js new file mode 100644 index 000000000..2768f0325 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js @@ -0,0 +1,650 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderApiTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('functional.gles3.es3fApiCase'); + +goog.scope(function() { +var es3fShaderApiTests = functional.gles3.es3fShaderApiTests; +var tcuTestCase = framework.common.tcuTestCase; +var es3fApiCase = functional.gles3.es3fApiCase; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var deRandom = framework.delibs.debase.deRandom; +var deString = framework.delibs.debase.deString; + +/** @type {WebGL2RenderingContext} */ var gl; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +var getSimpleShaderSource = function(shaderType) { + var simpleVertexShaderSource = + '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + + var simpleFragmentShaderSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' o_fragColor = vec4(0.0);\n' + + '}\n'; + + switch (shaderType) { + case gluShaderProgram.shaderType.VERTEX: + return simpleVertexShaderSource; + case gluShaderProgram.shaderType.FRAGMENT: + return simpleFragmentShaderSource; + default: + throw new Error('Invalid shader type'); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.CreateShaderCase = function(name, description, shaderType) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_shaderType = shaderType; +}; + +setParentClass(es3fShaderApiTests.CreateShaderCase, es3fApiCase.ApiCase); + +es3fShaderApiTests.CreateShaderCase.prototype.test = function() { + var shaderObject = gl.createShader(gluShaderProgram.getGLShaderType(gl, this.m_shaderType)); + this.check(shaderObject != null); + gl.deleteShader(shaderObject); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.CompileShaderCase = function(name, description, shaderType) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_shaderType = shaderType; +}; + +setParentClass(es3fShaderApiTests.CompileShaderCase, es3fApiCase.ApiCase); + +es3fShaderApiTests.CompileShaderCase.prototype.checkCompileStatus = function(shader) { + var status = /** @type {boolean} */ (gl.getShaderParameter(shader, gl.COMPILE_STATUS)); + return status; +}; + +es3fShaderApiTests.CompileShaderCase.prototype.test = function() { + var shaderObject = gl.createShader(gluShaderProgram.getGLShaderType(gl, this.m_shaderType)); + var shaderSource = getSimpleShaderSource(this.m_shaderType); + + this.check(shaderObject != null); + + gl.shaderSource(shaderObject, shaderSource); + gl.compileShader(shaderObject); + + this.check(this.checkCompileStatus(shaderObject)); + + gl.deleteShader(shaderObject); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ShaderSourceReplaceCase = function(name, description, shaderType) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_shaderType = shaderType; +}; + +setParentClass(es3fShaderApiTests.ShaderSourceReplaceCase, es3fApiCase.ApiCase); + +es3fShaderApiTests.ShaderSourceReplaceCase.prototype.generateFirstSource = function() { + return getSimpleShaderSource(this.m_shaderType); +}; + +es3fShaderApiTests.ShaderSourceReplaceCase.prototype.generateSecondSource = function() { + var source = '#version 300 es\n' + + 'precision mediump float;\n'; + + if (this.m_shaderType == gluShaderProgram.shaderType.FRAGMENT) + source += 'layout(location = 0) out mediump vec4 o_fragColor;\n'; + + source += 'void main()\n'+ + '{\n'+ + ' float variable = 1.0f;\n'; + + if (this.m_shaderType == gluShaderProgram.shaderType.VERTEX) source += ' gl_Position = vec4(variable);\n'; + else if (this.m_shaderType == gluShaderProgram.shaderType.FRAGMENT) source += ' o_fragColor = vec4(variable);\n'; + + source += '}\n'; + + return source; +}; + +es3fShaderApiTests.ShaderSourceReplaceCase.prototype.test = function() { + var shaderObject = gl.createShader(gluShaderProgram.getGLShaderType(gl, this.m_shaderType)); + var firstSource = this.generateFirstSource(); + var secondSource = this.generateSecondSource(); + + this.check(shaderObject != null); + + gl.shaderSource(shaderObject, firstSource); + this.check(firstSource == gl.getShaderSource(shaderObject)); + + gl.shaderSource(shaderObject, secondSource); + this.check(secondSource == gl.getShaderSource(shaderObject)); + + gl.deleteShader(shaderObject); +}; + +/** + * @constructor + */ +es3fShaderApiTests.SourceGenerator = function() {}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + * @return {string} + */ +es3fShaderApiTests.SourceGenerator.prototype.next = function(shaderType) { + throw new Error('Virtual function. Please override'); +}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + * @return {boolean} + */ +es3fShaderApiTests.SourceGenerator.prototype.finished = function(shaderType) { + throw new Error('Virtual function. Please override'); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.SourceGenerator} + */ +es3fShaderApiTests.ConstantShaderGenerator = function(rnd) { + es3fShaderApiTests.SourceGenerator.call(this); + this.m_rnd = rnd; +}; + +setParentClass(es3fShaderApiTests.ConstantShaderGenerator, es3fShaderApiTests.SourceGenerator); + +es3fShaderApiTests.SourceGenerator.prototype.next = function(shaderType) { + var value = this.m_rnd.getFloat(0.0, 1.0); + var outputName = (shaderType == gluShaderProgram.shaderType.VERTEX) ? 'gl_Position' : 'o_fragColor'; + + var out = '#version 300 es\n'; + + if (shaderType == gluShaderProgram.shaderType.FRAGMENT) + out += 'layout(location = 0) out mediump vec4 o_fragColor;\n'; + + out += 'void main (void)\n'; + out += '{\n'; + out += ' ' + outputName + ' = vec4(' + value + ');\n'; + out += '}\n'; + + return out; +}; + +es3fShaderApiTests.SourceGenerator.prototype.finished = function(shaderType) { + return false; +}; + +// Shader allocation utility + +/** + * @constructor + * @param {es3fShaderApiTests.SourceGenerator} generator + */ +es3fShaderApiTests.ShaderAllocator = function(generator) { + this.m_srcGen = generator; + this.m_shaders = {}; +}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ShaderAllocator.prototype.createShader = function(shaderType) { + var shader = new gluShaderProgram.Shader(gl, shaderType); + this.m_shaders[shaderType] = shader; + this.setSource(shaderType); + return shader; +}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ShaderAllocator.prototype.deleteShader = function(shaderType) { + this.m_shaders[shaderType].destroy(); + this.m_shaders[shaderType] = null; +}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ShaderAllocator.prototype.setSource = function(shaderType) { + var source = this.m_srcGen.next(shaderType); + this.m_shaders[shaderType].setSources(source); +}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ShaderAllocator.prototype.get = function(shaderType) { + return this.m_shaders[shaderType]; +}; + +// Base class for simple program API tests + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderApiTests.SimpleProgramCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_vertShader = null; + this.m_fragShader = null; + this.m_program = null; +}; + +setParentClass(es3fShaderApiTests.SimpleProgramCase, es3fApiCase.ApiCase); + +es3fShaderApiTests.SimpleProgramCase.prototype.compileShaders = function() { + var vertSource = getSimpleShaderSource(gluShaderProgram.shaderType.VERTEX); + var fragSource = getSimpleShaderSource(gluShaderProgram.shaderType.FRAGMENT); + + var vertShader = gl.createShader(gl.VERTEX_SHADER); + var fragShader = gl.createShader(gl.FRAGMENT_SHADER); + + this.check(vertShader != null); + this.check(fragShader != null); + + gl.shaderSource(vertShader, vertSource); + gl.compileShader(vertShader); + + gl.shaderSource(fragShader, fragSource); + gl.compileShader(fragShader); + + this.m_vertShader = vertShader; + this.m_fragShader = fragShader; +}; + +es3fShaderApiTests.SimpleProgramCase.prototype.linkProgram = function() { + var program = gl.createProgram(); + + this.check(program != null); + + gl.attachShader(program, this.m_vertShader); + gl.attachShader(program, this.m_fragShader); + + gl.linkProgram(program); + + this.m_program = program; +}; + +es3fShaderApiTests.SimpleProgramCase.prototype.cleanup = function() { + gl.deleteShader(this.m_vertShader); + gl.deleteShader(this.m_fragShader); + gl.deleteProgram(this.m_program); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.SimpleProgramCase} + * @param {string} name + * @param {string} description + */ +es3fShaderApiTests.DeleteShaderCase = function(name, description) { + es3fShaderApiTests.SimpleProgramCase.call(this, name, description); +}; + +setParentClass(es3fShaderApiTests.DeleteShaderCase, es3fShaderApiTests.SimpleProgramCase); + +es3fShaderApiTests.DeleteShaderCase.prototype.checkDeleteStatus = function(shader) { + var status = /** @type {boolean} */ (gl.getShaderParameter(shader, gl.DELETE_STATUS)); + return status; +}; + +es3fShaderApiTests.DeleteShaderCase.prototype.deleteShaders = function() { + gl.deleteShader(this.m_vertShader); + gl.deleteShader(this.m_fragShader); +}; + +es3fShaderApiTests.DeleteShaderCase.prototype.test = function() { + this.compileShaders(); + this.linkProgram(); + + this.deleteShaders(); + + this.check(this.checkDeleteStatus(this.m_vertShader) && this.checkDeleteStatus(this.m_fragShader)); + + gl.deleteProgram(this.m_program); + + this.check(!(gl.isShader(this.m_vertShader) || gl.isShader(this.m_fragShader))); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.SimpleProgramCase} + * @param {string} name + * @param {string} description + */ +es3fShaderApiTests.LinkVertexFragmentCase = function(name, description) { + es3fShaderApiTests.SimpleProgramCase.call(this, name, description); +}; + +setParentClass(es3fShaderApiTests.LinkVertexFragmentCase, es3fShaderApiTests.SimpleProgramCase); + +es3fShaderApiTests.LinkVertexFragmentCase.prototype.checkLinkStatus = function(program) { + var status = /** @type {boolean} */ (gl.getProgramParameter(program, gl.LINK_STATUS)); + return status; +}; + +es3fShaderApiTests.LinkVertexFragmentCase.prototype.test = function() { + this.compileShaders(); + this.linkProgram(); + + this.check(this.checkLinkStatus(this.m_program), 'Fail, expected LINK_STATUS to be TRUE.'); + + this.cleanup(); +}; + +// Base class for program state persistence cases + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ProgramStateCase = function(name, description, shaderType) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_shaderType = shaderType; + this.m_rnd = new deRandom.Random(deString.deStringHash(name) ^ 0x713de0ca); +}; + +setParentClass(es3fShaderApiTests.ProgramStateCase, es3fApiCase.ApiCase); + +/** + * @param {gluShaderProgram.Program} program + * @param {es3fShaderApiTests.ShaderAllocator} shaders + */ +es3fShaderApiTests.ProgramStateCase.prototype.buildProgram = function(program, shaders) { + var vertShader = shaders.createShader(gluShaderProgram.shaderType.VERTEX); + var fragShader = shaders.createShader(gluShaderProgram.shaderType.FRAGMENT); + + vertShader.compile(); + fragShader.compile(); + + program.attachShader(vertShader.getShader()); + program.attachShader(fragShader.getShader()); + program.link(); +}; + +/** + * @param {gluShaderProgram.Program} program + * @param {gluShaderProgram.ProgramInfo} reference + */ +es3fShaderApiTests.ProgramStateCase.prototype.verify = function(program, reference) { + var programInfo = program.getInfo(); + this.check(programInfo.linkOk, 'Fail, link status may only change as a result of linking'); + + this.check(programInfo.linkTimeUs == reference.linkTimeUs, 'Fail, reported link time changed.'); + + this.check(programInfo.infoLog == reference.infoLog, 'Fail, program infolog changed.'); +}; + +es3fShaderApiTests.ProgramStateCase.prototype.test = function() { + var sourceGen = new es3fShaderApiTests.ConstantShaderGenerator(this.m_rnd); + + var shaders = new es3fShaderApiTests.ShaderAllocator(sourceGen); + var program = new gluShaderProgram.Program(gl); + + this.buildProgram(program, shaders); + + if (program.getLinkStatus()) { + var programInfo = program.getInfo(); + + this.executeForProgram(program, shaders); + + this.verify(program, programInfo); + + } else{ + this.check(false, "Fail, couldn't link program."); + } + +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.ProgramStateCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ProgramStateDetachShaderCase = function(name, description, shaderType) { + es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType); +}; + +setParentClass(es3fShaderApiTests.ProgramStateDetachShaderCase, es3fShaderApiTests.ProgramStateCase); + +es3fShaderApiTests.ProgramStateDetachShaderCase.prototype.executeForProgram = function(program, shaders) { + var caseShader = shaders.get(this.m_shaderType); + program.detachShader(caseShader.getShader()); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.ProgramStateCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ProgramStateReattachShaderCase = function(name, description, shaderType) { + es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType); +}; + +setParentClass(es3fShaderApiTests.ProgramStateReattachShaderCase, es3fShaderApiTests.ProgramStateCase); + +es3fShaderApiTests.ProgramStateReattachShaderCase.prototype.executeForProgram = function(program, shaders) { + var caseShader = shaders.get(this.m_shaderType); + program.detachShader(caseShader.getShader()); + program.attachShader(caseShader.getShader()); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.ProgramStateCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ProgramStateDeleteShaderCase = function(name, description, shaderType) { + es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType); +}; + +setParentClass(es3fShaderApiTests.ProgramStateDeleteShaderCase, es3fShaderApiTests.ProgramStateCase); + +es3fShaderApiTests.ProgramStateDeleteShaderCase.prototype.executeForProgram = function(program, shaders) { + var caseShader = shaders.get(this.m_shaderType); + program.detachShader(caseShader.getShader()); + shaders.deleteShader(this.m_shaderType); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.ProgramStateCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ProgramStateReplaceShaderCase = function(name, description, shaderType) { + es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType); +}; + +setParentClass(es3fShaderApiTests.ProgramStateReplaceShaderCase, es3fShaderApiTests.ProgramStateCase); + +es3fShaderApiTests.ProgramStateReplaceShaderCase.prototype.executeForProgram = function(program, shaders) { + var caseShader = shaders.get(this.m_shaderType); + program.detachShader(caseShader.getShader()); + shaders.deleteShader(this.m_shaderType); + program.attachShader(shaders.createShader(this.m_shaderType).getShader()); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.ProgramStateCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ProgramStateRecompileShaderCase = function(name, description, shaderType) { + es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType); +}; + +setParentClass(es3fShaderApiTests.ProgramStateRecompileShaderCase, es3fShaderApiTests.ProgramStateCase); + +es3fShaderApiTests.ProgramStateRecompileShaderCase.prototype.executeForProgram = function(program, shaders) { + var caseShader = shaders.get(this.m_shaderType); + caseShader.compile(); +}; + +/** + * @constructor + * @extends {es3fShaderApiTests.ProgramStateCase} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ +es3fShaderApiTests.ProgramStateReplaceSourceCase = function(name, description, shaderType) { + es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType); +}; + +setParentClass(es3fShaderApiTests.ProgramStateReplaceSourceCase, es3fShaderApiTests.ProgramStateCase); + +es3fShaderApiTests.ProgramStateReplaceSourceCase.prototype.executeForProgram = function(program, shaders) { + var caseShader = shaders.get(this.m_shaderType); + shaders.setSource(this.m_shaderType); + caseShader.compile(); +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fShaderApiTests.ShaderApiTests = function() { + tcuTestCase.DeqpTest.call(this, 'shader_api', 'Shader API Cases'); +}; + +es3fShaderApiTests.ShaderApiTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fShaderApiTests.ShaderApiTests.prototype.constructor = es3fShaderApiTests.ShaderApiTests; + +es3fShaderApiTests.ShaderApiTests.prototype.init = function() { + // create and delete shaders + var createDeleteGroup = new tcuTestCase.DeqpTest('create_delete', 'glCreateShader() tests'); + this.addChild(createDeleteGroup); + + createDeleteGroup.addChild(new es3fShaderApiTests.CreateShaderCase('create_vertex_shader', 'Create vertex shader object', gluShaderProgram.shaderType.VERTEX)); + createDeleteGroup.addChild(new es3fShaderApiTests.CreateShaderCase('create_fragment_shader', 'Create fragment shader object', gluShaderProgram.shaderType.FRAGMENT)); + + createDeleteGroup.addChild(new es3fShaderApiTests.DeleteShaderCase('delete_vertex_fragment', 'Delete vertex shader and fragment shader')); + + // compile and link + var compileLinkGroup = new tcuTestCase.DeqpTest('compile_link', 'Compile and link tests'); + this.addChild(compileLinkGroup); + + compileLinkGroup.addChild(new es3fShaderApiTests.CompileShaderCase('compile_vertex_shader', 'Compile vertex shader', gluShaderProgram.shaderType.VERTEX)); + compileLinkGroup.addChild(new es3fShaderApiTests.CompileShaderCase('compile_fragment_shader', 'Compile fragment shader', gluShaderProgram.shaderType.FRAGMENT)); + + compileLinkGroup.addChild(new es3fShaderApiTests.LinkVertexFragmentCase('link_vertex_fragment', 'Link vertex and fragment shaders')); + + // shader source + var shaderSourceGroup = new tcuTestCase.DeqpTest('shader_source', 'glShaderSource() tests'); + this.addChild(shaderSourceGroup); + shaderSourceGroup.addChild(new es3fShaderApiTests.ShaderSourceReplaceCase('replace_source_vertex', 'Replace source code of vertex shader', gluShaderProgram.shaderType.VERTEX)); + shaderSourceGroup.addChild(new es3fShaderApiTests.ShaderSourceReplaceCase('replace_source_fragment', 'Replace source code of fragment shader', gluShaderProgram.shaderType.FRAGMENT)); + + // link status and infolog + var linkStatusGroup = new tcuTestCase.DeqpTest('program_state', 'Program state persistence tests'); + this.addChild(linkStatusGroup); + + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDetachShaderCase('detach_shader_vertex', 'detach vertex shader', gluShaderProgram.shaderType.VERTEX)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReattachShaderCase('reattach_shader_vertex', 'reattach vertex shader', gluShaderProgram.shaderType.VERTEX)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDeleteShaderCase('delete_shader_vertex', 'delete vertex shader', gluShaderProgram.shaderType.VERTEX)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceShaderCase('replace_shader_vertex', 'replace vertex shader object', gluShaderProgram.shaderType.VERTEX)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateRecompileShaderCase('recompile_shader_vertex', 'recompile vertex shader', gluShaderProgram.shaderType.VERTEX)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceSourceCase('replace_source_vertex', 'replace vertex shader source', gluShaderProgram.shaderType.VERTEX)); + + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDetachShaderCase('detach_shader_fragment', 'detach fragment shader', gluShaderProgram.shaderType.FRAGMENT)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReattachShaderCase('reattach_shader_fragment', 'reattach fragment shader', gluShaderProgram.shaderType.FRAGMENT)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDeleteShaderCase('delete_shader_fragment', 'delete fragment shader', gluShaderProgram.shaderType.FRAGMENT)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceShaderCase('replace_shader_fragment', 'replace fragment shader object', gluShaderProgram.shaderType.FRAGMENT)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateRecompileShaderCase('recompile_shader_fragment', 'recompile fragment shader', gluShaderProgram.shaderType.FRAGMENT)); + linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceSourceCase('replace_source_fragment', 'replace fragment shader source', gluShaderProgram.shaderType.FRAGMENT)); + +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fShaderApiTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderApiTests.ShaderApiTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderApiTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js new file mode 100644 index 000000000..c696c6c12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js @@ -0,0 +1,1109 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderBuiltinVarTests'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluVarType'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess'); +goog.require('framework.referencerenderer.rrRenderer'); +goog.require('framework.referencerenderer.rrRenderState'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); +goog.require('modules.shared.glsShaderRenderCase'); +goog.require('modules.shared.glsShaderExecUtil'); + +goog.scope(function() { + var es3fShaderBuiltinVarTests = functional.gles3.es3fShaderBuiltinVarTests; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + var glsShaderExecUtil = modules.shared.glsShaderExecUtil; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluVarType = framework.opengl.gluVarType; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var tcuLogImage = framework.common.tcuLogImage; + var tcuTestCase = framework.common.tcuTestCase; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuRGBA = framework.common.tcuRGBA; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; + var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess; + var rrRenderer = framework.referencerenderer.rrRenderer; + var rrRenderState = framework.referencerenderer.rrRenderState; + var rrShadingContext = framework.referencerenderer.rrShadingContext; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrVertexPacket = framework.referencerenderer.rrVertexPacket; + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; + + /** @typedef {function():number} */ es3fShaderBuiltinVarTests.GetConstantValueFunc; + + /** + * @param {number} pname + * @return {number} getParameter returns values of any kind + */ + es3fShaderBuiltinVarTests.getInteger = function(pname) { + return /** @type {number} */ (gl.getParameter(pname)); + }; + + /** + * @param {number} pname + * @return {number} forcing number + */ + es3fShaderBuiltinVarTests.getVectorsFromComps = function(pname) { + var value = /** @type {number} */ (gl.getParameter(pname)); + assertMsgOptions(value%4 === 0, 'Expected value to be divisible by 4.', false, true); + return value / 4; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {string} varName + * @param {es3fShaderBuiltinVarTests.GetConstantValueFunc} getValue + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase = function(name, desc, varName, getValue, shaderType) { + tcuTestCase.DeqpTest.call(this, name, desc); + /** @type {string} */ this.m_varName = varName; + /** @type {es3fShaderBuiltinVarTests.GetConstantValueFunc} */ this.m_getValue = getValue; + /** @type {gluShaderProgram.shaderType} */ this.m_shaderType = shaderType; + }; + + es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.constructor = es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase; + + es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.deinit = function() { + // an attempt to cleanup the GL state when the test fails + bufferedLogToConsole('ShaderBuildInConstantCase.deinit()'); + gl.useProgram(null); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + }; + + /** + * @param {gluShaderProgram.shaderType} shaderType + * @param {string} varName + * @return {glsShaderExecUtil.ShaderExecutor} + */ + es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.createGetConstantExecutor = function(shaderType, varName) { + /** @type {glsShaderExecUtil.ShaderSpec} */ var shaderSpec = new glsShaderExecUtil.ShaderSpec(); + shaderSpec.version = gluShaderUtil.GLSLVersion.V300_ES; + shaderSpec.source = 'result = ' + varName + ';\n'; + shaderSpec.outputs.push(new glsShaderExecUtil.Symbol('result', + gluVarType.newTypeBasic(gluShaderUtil.DataType.INT, gluShaderUtil.precision.PRECISION_HIGHP))); + return glsShaderExecUtil.createExecutor(shaderType, shaderSpec); + + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.iterate = function() { + /** @type {glsShaderExecUtil.ShaderExecutor} */ + var shaderExecutor = this.createGetConstantExecutor(this.m_shaderType, this.m_varName); + /** @type {number} */ var reference = this.m_getValue(); + /** @type {goog.NumberArray} */ var shaderExecutorResult; + /** @type {number} */ var result; + + if (!shaderExecutor.isOk()) + assertMsgOptions(false, 'Compile failed', false, true); + + shaderExecutor.useProgram(); + + shaderExecutorResult = shaderExecutor.execute(1, null); + result = new Int32Array(shaderExecutorResult[0].buffer)[0]; + + bufferedLogToConsole(this.m_varName + ' = ' + result); + + if (result != reference) { + bufferedLogToConsole('ERROR: Expected ' + this.m_varName + ' = ' + reference + '\n' + + 'Test shader:' + shaderExecutor.m_program.getProgramInfo().infoLog); + testFailedOptions('Invalid builtin constant value', false); + } else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @struct + * @constructor + * @param {number=} near + * @param {number=} far + */ + es3fShaderBuiltinVarTests.DepthRangeParams = function(near, far) { + /** @type {number} */ this.zNear = near === undefined ? 0.0 : near; + /** @type {number} */ this.zFar = far === undefined ? 1.0 : far; + }; + + /** + * @constructor + * @extends {glsShaderRenderCase.ShaderEvaluator} + * @param {es3fShaderBuiltinVarTests.DepthRangeParams} params + */ + es3fShaderBuiltinVarTests.DepthRangeEvaluator = function(params) { + /** @type {es3fShaderBuiltinVarTests.DepthRangeParams} */ this.m_params = params; + }; + + es3fShaderBuiltinVarTests.DepthRangeEvaluator.prototype = Object.create(glsShaderRenderCase.ShaderEvaluator.prototype); + es3fShaderBuiltinVarTests.DepthRangeEvaluator.prototype.constructor = es3fShaderBuiltinVarTests.DepthRangeEvaluator; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + */ + es3fShaderBuiltinVarTests.DepthRangeEvaluator.prototype.evaluate = function(c) { + /** @type {number} */ var zNear = deMath.clamp(this.m_params.zNear, 0.0, 1.0); + /** @type {number} */ var zFar = deMath.clamp(this.m_params.zFar, 0.0, 1.0); + /** @type {number} */ var diff = zFar - zNear; + c.color[0] = zNear; + c.color[1] = zFar; + c.color[2] = diff * 0.5 + 0.5; + }; + + /** + * @constructor + * @extends {glsShaderRenderCase.ShaderRenderCase} + * @param {string} name + * @param {string} desc + * @param {boolean} isVertexCase + */ + es3fShaderBuiltinVarTests.ShaderDepthRangeTest = function(name, desc, isVertexCase) { + glsShaderRenderCase.ShaderRenderCase.call(this, name, desc, isVertexCase); + /** @type {es3fShaderBuiltinVarTests.DepthRangeParams} */ this.m_depthRange = new es3fShaderBuiltinVarTests.DepthRangeParams(); + /** @type {es3fShaderBuiltinVarTests.DepthRangeEvaluator} */ this.m_evaluator = new es3fShaderBuiltinVarTests.DepthRangeEvaluator(this.m_depthRange); + /** @type {number} */ this.m_iterNdx = 0; + }; + + es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype); + es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype.constructor = es3fShaderBuiltinVarTests.ShaderDepthRangeTest; + + es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype.init = function() { + /** @type {string} */ var defaultVertSrc = '' + + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '}\n'; + /** @type {string} */ var defaultFragSrc = '' + + '#version 300 es\n' + + 'in mediump vec4 v_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = v_color;\n' + + '}\n'; + + // Construct shader. + /** @type {string} */ var src = '#version 300 es\n'; + if (this.m_isVertexCase) + src += 'in highp vec4 a_position;\n' + + 'out mediump vec4 v_color;\n'; + else + src += 'layout(location = 0) out mediump vec4 o_color;\n'; + + src += 'void main (void)\n{\n' + + '\t' + (this.m_isVertexCase ? 'v_color' : 'o_color') + ' = vec4(gl_DepthRange.near, gl_DepthRange.far, gl_DepthRange.diff*0.5 + 0.5, 1.0);\n'; + + if (this.m_isVertexCase) + src += '\tgl_Position = a_position;\n'; + + src += '}\n'; + + this.m_vertShaderSource = this.m_isVertexCase ? src : defaultVertSrc; + this.m_fragShaderSource = this.m_isVertexCase ? defaultFragSrc : src; + + this.postinit(); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype.iterate = function() { + /** @type {Array} */ var cases = [ + new es3fShaderBuiltinVarTests.DepthRangeParams(0.0, 1.0) + ]; + + this.m_depthRange = cases[this.m_iterNdx]; + bufferedLogToConsole('gl.depthRange(' + this.m_depthRange.zNear + ', ' + this.m_depthRange.zFar + ')'); + gl.depthRange(this.m_depthRange.zNear, this.m_depthRange.zFar); + + this.postiterate(); + this.m_iterNdx += 1; + + if (this.m_iterNdx == cases.length) + return tcuTestCase.IterateResult.STOP; + else + return tcuTestCase.IterateResult.CONTINUE; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderBuiltinVarTests.FragCoordXYZCase = function() { + tcuTestCase.DeqpTest.call(this, 'fragcoord_xyz', 'gl_FragCoord.xyz Test'); + }; + + es3fShaderBuiltinVarTests.FragCoordXYZCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderBuiltinVarTests.FragCoordXYZCase.prototype.constructor = es3fShaderBuiltinVarTests.FragCoordXYZCase; + + es3fShaderBuiltinVarTests.FragCoordXYZCase.prototype.iterate = function() { + /** @type {number} */ var width = gl.drawingBufferWidth; + /** @type {number} */ var height = gl.drawingBufferHeight; + /** @type {Array} */ var threshold = deMath.add([1, 1, 1, 1], tcuPixelFormat.PixelFormatFromContext(gl).getColorThreshold()); + /** @type {Array} */ var scale = [1. / width, 1. / height, 1.0]; + + /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height); + + /** @type {string} */ var vtxSource = '' + + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '}\n'; + /** @type {string} */ var fragSource = '' + + '#version 300 es\n' + + 'uniform highp vec3 u_scale;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = vec4(gl_FragCoord.xyz*u_scale, 1.0);\n' + + '}\n'; + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource)); + + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) + throw new Error('Compile failed'); + + // Draw with GL. + /** @type {Array} */ var positions = [ + -1.0, 1.0, -1.0, 1.0, + -1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 1.0, 1.0 + ]; + /** @type {Array} */ var indices = [0, 1, 2, 2, 1, 3]; + + /** @type {WebGLUniformLocation} */ var scaleLoc = gl.getUniformLocation(program.getProgram(), 'u_scale'); + /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions); + + gl.useProgram(program.getProgram()); + gl.uniform3fv(scaleLoc, scale); + + gl.viewport(0, 0, width, height); + gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indices)); + + testImg.readViewport(gl, [0, 0, width, height]); + + // Draw reference + for (var y = 0; y < refImg.getHeight(); y++) { + for (var x = 0; x < refImg.getWidth(); x++) { + /** @type {number} */ var xf = (x + .5) / refImg.getWidth(); + /** @type {number} */ var yf = (refImg.getHeight() - y - 1 + .5) / refImg.getHeight(); + /** @type {number} */ var z = (xf + yf) / 2.0; + /** @type {Array} */ var fragCoord = [x + .5, y + .5, z]; + /** @type {Array} */ var scaledFC = deMath.multiply(fragCoord, scale); + /** @type {Array} */ + var color = [ + deMath.clamp(Math.floor(scaledFC[0] * 255 + 0.5), 0, 255), + deMath.clamp(Math.floor(scaledFC[1] * 255 + 0.5), 0, 255), + deMath.clamp(Math.floor(scaledFC[2] * 255 + 0.5), 0, 255), + 255]; + refImg.setPixel(x, y, color); + } + } + + // Compare + /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', refImg, testImg, threshold); + + if (!isOk) + testFailedOptions('Image comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @param {Array} s + * @param {Array} w + * @param {number} nx + * @param {number} ny + * @return {number} + */ + es3fShaderBuiltinVarTests.projectedTriInterpolate = function(s, w, nx, ny) { + return (s[0] * (1.0 - nx - ny)/w[0] + s[1] * ny / w[1] + s[2] * nx / w[2]) / ((1.0 - nx - ny) / w[0] + ny / w[1] + nx / w[2]); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderBuiltinVarTests.FragCoordWCase = function() { + tcuTestCase.DeqpTest.call(this, 'fragcoord_w', 'gl_FragCoord.w Test'); + }; + + es3fShaderBuiltinVarTests.FragCoordWCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderBuiltinVarTests.FragCoordWCase.prototype.constructor = es3fShaderBuiltinVarTests.FragCoordWCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderBuiltinVarTests.FragCoordWCase.prototype.iterate = function() { + /** @type {number} */ var width = gl.drawingBufferWidth; + /** @type {number} */ var height = gl.drawingBufferHeight; + /** @type {Array} */ var threshold = deMath.add([1, 1, 1, 1], tcuPixelFormat.PixelFormatFromContext(gl).getColorThreshold()); + + /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height); + + /** @type {Array} */ var w = [1.7, 2.0, 1.2, 1.0]; + + /** @type {string} */ var vtxSource = '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '}\n'; + + /** @type {string} */ var fragSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = vec4(0.0, 1.0/gl_FragCoord.w - 1.0, 0.0, 1.0);\n' + + '}\n'; + + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource)); + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) + throw new Error('Compile failed'); + + // Draw with GL. + /** @type {Array} */ var positions = [ + -w[0], w[0], 0.0, w[0], + -w[1], -w[1], 0.0, w[1], + w[2], w[2], 0.0, w[2], + w[3], -w[3], 0.0, w[3] + ]; + /** @type {Array} */ var indices = [0, 1, 2, 2, 1, 3]; + + /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions); + gl.useProgram(program.getProgram()); + + gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indices)); + testImg.readViewport(gl, [0, 0, width, height]); + + // Draw reference + for (var y = 0; y < refImg.getHeight(); y++) { + for (var x = 0; x < refImg.getWidth(); x++) { + /** @type {number} */ var xf = (x + 0.5) / refImg.getWidth(); + /** @type {number} */ var yf = (refImg.getHeight() - y - 1 + 0.5) / refImg.getHeight(); + /** @type {number} */ var oow = ((xf + yf) < 1.0) ? + es3fShaderBuiltinVarTests.projectedTriInterpolate([w[0], w[1], w[2]], [w[0], w[1], w[2]], xf, yf) : + es3fShaderBuiltinVarTests.projectedTriInterpolate([w[3], w[2], w[1]], [w[3], w[2], w[1]], 1.0 - xf, 1.0 - yf); + /** @type {Array} */ + var color = [ + 0, + deMath.clamp(Math.floor((oow - 1.0) * 255 + 0.5), 0, 255), + 0, + 255]; + refImg.setPixel(x, y, color); + } + } + + // Compare + /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', refImg, testImg, threshold); + + if (!isOk) { + testFailedOptions('Image comparison failed', false); + } else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderBuiltinVarTests.PointCoordCase = function() { + tcuTestCase.DeqpTest.call(this, 'pointcoord', 'gl_PointCoord Test'); + }; + + es3fShaderBuiltinVarTests.PointCoordCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderBuiltinVarTests.PointCoordCase.prototype.constructor = es3fShaderBuiltinVarTests.PointCoordCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderBuiltinVarTests.PointCoordCase.prototype.iterate = function() { + /** @type {number} */ var width = Math.min(256, gl.drawingBufferWidth); + /** @type {number} */ var height = Math.min(256, gl.drawingBufferHeight); + /** @type {number} */ var threshold = 0.02; + + /** @type {number} */ var numPoints = 8; + + /** @type {Array} */ var coords = []; + /** @type {Array} */ var pointSizeRange = [0.0, 0.0]; + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0x145fa); + /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height); + + pointSizeRange = /** @type {Array} */ (gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)); + + if (pointSizeRange[0] <= 0.0 || pointSizeRange[1] <= 0.0 || pointSizeRange[1] < pointSizeRange[0]) + throw new Error('Invalid gl.ALIASED_POINT_SIZE_RANGE'); + + // Compute coordinates. + for (var i = 0; i < numPoints; i++) + coords.push([ + rnd.getFloat(-0.9, 0.9), + rnd.getFloat(-0.9, 0.9), + rnd.getFloat(pointSizeRange[0], pointSizeRange[1]) + ]); + + /** @type {string} */ var vtxSource = '#version 300 es\n' + + 'in highp vec3 a_positionSize;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(a_positionSize.xy, 0.0, 1.0);\n' + + ' gl_PointSize = a_positionSize.z;\n' + + '}\n'; + + /** @type {string} */ var fragSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = vec4(gl_PointCoord, 0.0, 1.0);\n' + + '}\n'; + + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource)); + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) + throw new Error('Compile failed'); + + // Draw with GL. + var newCoords = [].concat.apply([], coords); + + // /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_positionSize', 3, coords.length, 0, coords); + /** @type {gluDrawUtil.VertexArrayBinding} */ + var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_positionSize', 3, coords.length, 12, newCoords); + /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - width); + /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - height); + + gl.viewport(viewportX, viewportY, width, height); + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.useProgram(program.getProgram()); + + gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.pointsFromElements(coords.length)); + testImg.readViewport(gl, [viewportX, viewportY, width, height]); + + // Draw reference + refImg.getAccess().clear([0.0, 0.0, 0.0, 1.0]); + for (var i = 0; i < coords.length; i++) { + /** @type {number} */ var x0 = Math.round(width * (coords[i][0] * 0.5 + 0.5) - coords[i][2] * 0.5); + /** @type {number} */ var y0 = Math.round(height* (coords[i][1] * 0.5 + 0.5) - coords[i][2] * 0.5); + /** @type {number} */ var x1 = Math.round(width * (coords[i][0] * 0.5 + 0.5) + coords[i][2] * 0.5); + /** @type {number} */ var y1 = Math.round(height * (coords[i][1] * 0.5 + 0.5) + coords[i][2] * 0.5); + /** @type {number} */ var w = x1 - x0; + /** @type {number} */ var h = y1 - y0; + + for (var yo = 0; yo < h; yo++) { + for (var xo = 0; xo < w; xo++) { + /** @type {number} */ var xf = (xo + 0.5) / w; + /** @type {number} */ var yf = ((h - yo - 1) + 0.5) / h; + /** @type {number} */ var dx = x0 + xo; + /** @type {number} */ var dy = y0 + yo; + /** @type {Array} */ + var color = [ + deMath.clamp(Math.floor(xf * 255 + 0.5), 0, 255), + deMath.clamp(Math.floor(yf * 255 + 0.5), 0, 255), + 0, + 255]; + if (deMath.deInBounds32(dx, 0, refImg.getWidth()) && deMath.deInBounds32(dy, 0, refImg.getHeight())) + refImg.setPixel(dx, dy, color); + } + } + } + + // Compare + /** @type {boolean} */ var isOk = tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', refImg.getAccess(), testImg.getAccess(), threshold); + + if (!isOk) { + testFailedOptions('Image comparison failed', false); + } else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderBuiltinVarTests.FrontFacingCase = function() { + tcuTestCase.DeqpTest.call(this, 'frontfacing', 'gl_FrontFacing Test'); + }; + + es3fShaderBuiltinVarTests.FrontFacingCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderBuiltinVarTests.FrontFacingCase.prototype.constructor = es3fShaderBuiltinVarTests.FrontFacingCase; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderBuiltinVarTests.FrontFacingCase.prototype.iterate = function() { + // Test case renders two adjecent quads, where left is has front-facing + // triagles and right back-facing. Color is selected based on gl_FrontFacing + // value. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0x89f2c); + /** @type {number} */ var width = Math.min(64, gl.drawingBufferWidth); + /** @type {number} */ var height = Math.min(64, gl.drawingBufferHeight); + /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - width); + /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - height); + /** @type {Array} */ var threshold = deMath.add([1, 1, 1, 1], tcuPixelFormat.PixelFormatFromContext(gl).getColorThreshold()); + + /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height); + /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height); + + /** @type {string} */ var vtxSource = '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '}\n'; + + /** @type {string} */ var fragSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' if (gl_FrontFacing)\n' + + ' o_color = vec4(0.0, 1.0, 0.0, 1.0);\n' + + ' else\n' + + ' o_color = vec4(0.0, 0.0, 1.0, 1.0);\n' + + '}\n'; + + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource)); + + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) + throw new Error('Compile failed'); + + // Draw with GL. + /** @type {Array} */ var positions = [ + -1.0, 1.0, 0.0, 1.0, + -1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0 + ]; + + /** @type {Array} */ var indicesCCW = [0, 1, 2, 2, 1, 3]; + /** @type {Array} */ var indicesCW = [2, 1, 0, 3, 1, 2]; + + /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions); + + gl.useProgram(program.getProgram()); + + gl.viewport(viewportX, viewportY, Math.floor(width / 2), height); + + gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indicesCCW)); + + gl.viewport(viewportX + Math.floor(width / 2), viewportY, width - Math.floor(width / 2), height); + gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indicesCW)); + testImg.readViewport(gl, [viewportX, viewportY, width, height]); + // Draw reference + for (var y = 0; y < refImg.getHeight(); y++) { + for (var x = 0; x < Math.floor(refImg.getWidth() / 2); x++) + refImg.setPixel(x, y, tcuRGBA.RGBA.green.toIVec()); + + for (var x = Math.floor(refImg.getWidth() / 2); x < refImg.getWidth(); x++) + refImg.setPixel(x, y, tcuRGBA.RGBA.blue.toIVec()); + } + + // Compare + /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', refImg, testImg, threshold); + + if (!isOk) { + testFailedOptions('Image comparison failed', false); + } else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderBuiltinVarTests.VertexIDCase = function() { + tcuTestCase.DeqpTest.call(this, 'vertex_id', 'gl_VertexID Test'); + /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {WebGLBuffer} */ this.m_positionBuffer = null; + /** @type {WebGLBuffer} */ this.m_elementBuffer = null; + /** @type {number} */ this.m_viewportW = 0; + /** @type {number} */ this.m_viewportH = 0; + /** @type {number} */ this.m_iterNdx = 0; + /** @type {Array>} */ this.m_positions = []; + /** @type {Array>} */ this.m_colors = []; + }; + + es3fShaderBuiltinVarTests.VertexIDCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderBuiltinVarTests.VertexIDCase.prototype.constructor = es3fShaderBuiltinVarTests.VertexIDCase; + + es3fShaderBuiltinVarTests.VertexIDCase.MAX_VERTICES = 24; //!< 8 triangles, totals 24 vertices + + es3fShaderBuiltinVarTests.VertexIDCase.prototype.init = function() { + /** @type {number} */ var width = gl.drawingBufferWidth; + /** @type {number} */ var height = gl.drawingBufferHeight; + + /** @type {number} */ var quadWidth = 32; + /** @type {number} */ var quadHeight = 32; + + if (width < quadWidth) + throw new Error('Too small render target'); + + /** @type {number} */ var maxQuadsX = Math.floor(width / quadWidth); + /** @type {number} */ var numVertices = es3fShaderBuiltinVarTests.VertexIDCase.MAX_VERTICES; + + /** @type {number} */ var numQuads = Math.floor(numVertices / 6) + (numVertices % 6 != 0 ? 1 : 0); + /** @type {number} */ var viewportW = Math.min(numQuads, maxQuadsX)*quadWidth; + /** @type {number} */ var viewportH = (Math.floor(numQuads/maxQuadsX) + (numQuads % maxQuadsX != 0 ? 1 : 0)) * quadHeight; + + if (viewportH > height) + throw new Error('Too small render target'); + + assertMsgOptions(viewportW <= width && viewportH <= height, 'Unexpected viewport dimensions.', false, true); + + assertMsgOptions(!this.m_program, 'Program should not be defined at this point.', false, true); + + /** @type {string} */ var vtxSource = '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'out mediump vec4 v_color;\n' + + 'uniform highp vec4 u_colors[24];\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_color = u_colors[gl_VertexID];\n' + + '}\n'; + + /** @type {string} */ var fragSource = '#version 300 es\n' + + 'in mediump vec4 v_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = v_color;\n' + + '}\n'; + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource)); + bufferedLogToConsole(this.m_program.getProgramInfo().infoLog); + + if (!this.m_program.isOk()) { + this.m_program = null; + throw new Error('Compile failed'); + } + + this.m_positionBuffer = gl.createBuffer(); + this.m_elementBuffer = gl.createBuffer(); + + // Set colors (in dynamic memory to save static data space). + this.m_colors[0] = [0.0, 0.0, 0.0, 1.0]; + this.m_colors[1] = [0.5, 1.0, 0.5, 1.0]; + this.m_colors[2] = [0.0, 0.5, 1.0, 1.0]; + this.m_colors[3] = [0.0, 1.0, 0.0, 1.0]; + this.m_colors[4] = [0.0, 1.0, 1.0, 1.0]; + this.m_colors[5] = [0.5, 0.0, 0.0, 1.0]; + this.m_colors[6] = [0.5, 0.0, 1.0, 1.0]; + this.m_colors[7] = [0.5, 0.0, 0.5, 1.0]; + this.m_colors[8] = [1.0, 0.0, 0.0, 1.0]; + this.m_colors[9] = [0.5, 1.0, 0.0, 1.0]; + this.m_colors[10] = [0.0, 0.5, 0.0, 1.0]; + this.m_colors[11] = [0.5, 1.0, 1.0, 1.0]; + this.m_colors[12] = [0.0, 0.0, 1.0, 1.0]; + this.m_colors[13] = [1.0, 0.0, 0.5, 1.0]; + this.m_colors[14] = [0.0, 0.5, 0.5, 1.0]; + this.m_colors[15] = [1.0, 1.0, 0.5, 1.0]; + this.m_colors[16] = [1.0, 0.0, 1.0, 1.0]; + this.m_colors[17] = [1.0, 0.5, 0.0, 1.0]; + this.m_colors[18] = [0.0, 1.0, 0.5, 1.0]; + this.m_colors[19] = [1.0, 0.5, 1.0, 1.0]; + this.m_colors[20] = [1.0, 1.0, 0.0, 1.0]; + this.m_colors[21] = [1.0, 0.5, 0.5, 1.0]; + this.m_colors[22] = [0.0, 0.0, 0.5, 1.0]; + this.m_colors[23] = [1.0, 1.0, 1.0, 1.0]; + + // Compute positions. + assertMsgOptions(numVertices % 3 == 0, 'Number of vertices should be multiple of 3.', false, true); + + for (var vtxNdx = 0; vtxNdx < numVertices; vtxNdx += 3) { + /** @type {number} */ var h = 2.0 * quadHeight / viewportH; + /** @type {number} */ var w = 2.0 * quadWidth / viewportW; + + /** @type {number} */ var triNdx = Math.floor(vtxNdx / 3); + /** @type {number} */ var quadNdx = Math.floor(triNdx / 2); + /** @type {number} */ var quadY = Math.floor(quadNdx / maxQuadsX); + /** @type {number} */ var quadX = quadNdx % maxQuadsX; + + /** @type {number} */ var x0 = -1.0 + quadX * w; + /** @type {number} */ var y0 = -1.0 + quadY * h; + + if (triNdx % 2 === 0) { + this.m_positions[vtxNdx + 0] = [x0, y0, 0.0, 1.0]; + this.m_positions[vtxNdx + 1] = [x0+w, y0+h, 0.0, 1.0]; + this.m_positions[vtxNdx + 2] = [x0, y0+h, 0.0, 1.0]; + } else { + this.m_positions[vtxNdx + 0] = [x0 + w, y0 + h, 0.0, 1.0]; + this.m_positions[vtxNdx + 1] = [x0, y0, 0.0, 1.0]; + this.m_positions[vtxNdx + 2] = [x0+w, y0, 0.0, 1.0]; + } + } + + this.m_viewportW = viewportW; + this.m_viewportH = viewportH; + this.m_iterNdx = 0; + + }; + + es3fShaderBuiltinVarTests.VertexIDCase.prototype.deinit = function() { + this.m_program = null; + + if (this.m_positionBuffer) { + gl.deleteBuffer(this.m_positionBuffer); + this.m_positionBuffer = null; + } + + if (this.m_elementBuffer) { + gl.deleteBuffer(this.m_elementBuffer); + this.m_elementBuffer = null; + } + + this.m_positions = []; + this.m_colors = []; + }; + + /** + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + */ + es3fShaderBuiltinVarTests.VertexIDReferenceShader = function() { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var declaration = new sglrShaderProgram.ShaderProgramDeclaration(); + declaration.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('', rrGenericVector.GenericVecType.FLOAT)); + declaration.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('', rrGenericVector.GenericVecType.FLOAT)); + declaration.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT, new sglrShaderProgram.VaryingFlags())); + declaration.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + declaration.pushVertexSource(new sglrShaderProgram.VertexSource('')); // ShaderProgram fails if we don't push a source, even though GLSL source is not used + declaration.pushFragmentSource(new sglrShaderProgram.FragmentSource('')); + sglrShaderProgram.ShaderProgram.call(this, declaration); + }; + + es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype.constructor = es3fShaderBuiltinVarTests.VertexIDReferenceShader; + + /** @const {number} */ es3fShaderBuiltinVarTests.VertexIDReferenceShader.VARYINGLOC_COLOR = 0; + + /** + * @param {Array} inputs + * @param {Array} packets + */ + es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype.shadeVertices = function(inputs, packets) { + for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) { + /** @type {number} */ var positionAttrLoc = 0; + /** @type {number} */ var colorAttrLoc = 1; + + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + // Transform to position + packet.position = rrVertexAttrib.readVertexAttrib(inputs[positionAttrLoc], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + + // Pass color to FS + packet.outputs[es3fShaderBuiltinVarTests.VertexIDReferenceShader.VARYINGLOC_COLOR] = rrVertexAttrib.readVertexAttrib(inputs[colorAttrLoc], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT); + } + }; + + /** + * @param {Array} packets + * @param {rrShadingContext.FragmentShadingContext} context + */ + es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype.shadeFragments = function(packets, context) { + for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) { + /** @type {rrFragmentOperations.Fragment} */ var packet = packets[packetNdx]; + packet.value = rrShadingContext.readVarying(packet, context, es3fShaderBuiltinVarTests.VertexIDReferenceShader.VARYINGLOC_COLOR); + } + }; + + /** + * @param {tcuTexture.PixelBufferAccess} dst + * @param {Array} indices + * @param {goog.NumberArray} positions + * @param {goog.NumberArray} colors + */ + es3fShaderBuiltinVarTests.VertexIDCase.prototype.renderReference = function(dst, indices, positions, colors) { + /** @type {rrRenderState.RenderState} */ + var referenceState = new rrRenderState.RenderState( + new rrRenderState.ViewportState(rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(dst)) + ); + + /** @type {rrRenderer.RenderTarget} */ + var referenceTarget = new rrRenderer.RenderTarget( + rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(dst) + ); + + /** @type {es3fShaderBuiltinVarTests.VertexIDReferenceShader} */ + var referenceShaderProgram = new es3fShaderBuiltinVarTests.VertexIDReferenceShader(); + + /** @type {Array} */ var attribs = []; + attribs[0] = new rrVertexAttrib.VertexAttrib(); + attribs[0].type = rrVertexAttrib.VertexAttribType.FLOAT; + attribs[0].size = 4; + attribs[0].stride = 0; + attribs[0].instanceDivisor = 0; + attribs[0].pointer = positions.buffer; + + attribs[1] = new rrVertexAttrib.VertexAttrib(); + attribs[1].type = rrVertexAttrib.VertexAttribType.FLOAT; + attribs[1].size = 4; + attribs[1].stride = 0; + attribs[1].instanceDivisor = 0; + attribs[1].pointer = colors.buffer; + rrRenderer.drawTriangles(referenceState, referenceTarget, referenceShaderProgram, + attribs, rrRenderer.PrimitiveType.TRIANGLES, 0, indices.length, /*instanceID = */ 0); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderBuiltinVarTests.VertexIDCase.prototype.iterate = function() { + /** @type {number} */ var width = gl.drawingBufferWidth; + /** @type {number} */ var height = gl.drawingBufferHeight; + /** @type {number} */ var viewportW = this.m_viewportW; + /** @type {number} */ var viewportH = this.m_viewportH; + + /** @type {number} */ var threshold = 0.02; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xcf23ab1 ^ deString.deStringHash(this.m_iterNdx.toString())); + /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(viewportW, viewportH); + /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(viewportW, viewportH); + + /** @type {number} */ var viewportX = rnd.getInt(0, width - viewportW); + /** @type {number} */ var viewportY = rnd.getInt(0, height - viewportH); + + /** @type {number} */ var posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + /** @type {WebGLUniformLocation} */ var colorsLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_colors[0]'); + /** @type {Array} */ var clearColor = [0.0, 0.0, 0.0, 1.0]; + /** @type {Array} */ var indices = []; + /** @type {Array>} */ var mappedPos = []; + /** @type {goog.NumberArray} */ var flatColorArray; + /** @type {goog.NumberArray} */ var flatPosArray; + // Setup common state. + gl.viewport(viewportX, viewportY, viewportW, viewportH); + gl.useProgram(this.m_program.getProgram()); + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuffer); + gl.enableVertexAttribArray(posLoc); + gl.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0); + gl.uniform4fv(colorsLoc, [].concat.apply([], this.m_colors)); + + // Clear render target to black. + gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); + gl.clear(gl.COLOR_BUFFER_BIT); + + refImg.getAccess().clear(clearColor); + + if (this.m_iterNdx === 0) { + bufferedLogToConsole('Iter0: glDrawArrays()'); + + flatPosArray = new Float32Array([].concat.apply([], this.m_positions)); + flatColorArray = new Float32Array([].concat.apply([], this.m_colors)); + gl.bufferData(gl.ARRAY_BUFFER, flatPosArray.buffer, gl.DYNAMIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, Math.floor(flatPosArray.length / 4)); + + //glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, testImg.getAccess()); + testImg.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]); + // Reference indices + for (var ndx = 0; ndx < this.m_positions.length; ndx++) + indices.push(ndx); + + this.renderReference(refImg.getAccess(), indices, flatPosArray, flatColorArray); + } else if (this.m_iterNdx === 1) { + bufferedLogToConsole('Iter1: glDrawElements(), indices in buffer'); + + // Compute initial indices and suffle + for (var ndx = 0; ndx < this.m_positions.length; ndx++) + indices.push(ndx); + // deRandom.shuffle(rnd, indices); + // \note [2015-08-05 dag] The original test shuffles the indices array but the reference renderer cannot handle triangles with sides not parallel to the axes. + + // Use indices to re-map positions. + for (var ndx = 0; ndx < indices.length; ndx++) + mappedPos[indices[ndx]] = this.m_positions[ndx]; + + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.m_elementBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, (new Uint16Array(indices)).buffer, gl.DYNAMIC_DRAW); + + flatPosArray = new Float32Array([].concat.apply([], mappedPos)); + flatColorArray = new Float32Array([].concat.apply([], this.m_colors)); + gl.bufferData(gl.ARRAY_BUFFER, flatPosArray.buffer, gl.DYNAMIC_DRAW); + gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0); + + //glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, testImg.getAccess()); + testImg.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]); + refImg.getAccess().clear(clearColor); + this.renderReference(refImg.getAccess(), indices, flatPosArray, flatColorArray); + } else + throw new Error('Iteration count exceeded.'); + + if (!tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', refImg.getAccess(), testImg.getAccess(), threshold)) + testFailedOptions('Image comparison failed', false); + else + testPassedOptions('Pass', true); + + this.m_iterNdx += 1; + return (this.m_iterNdx < 2) ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderBuiltinVarTests.ShaderBuiltinVarTests = function() { + tcuTestCase.DeqpTest.call(this, 'builtin_variable', 'Built-in Variable Tests'); + }; + + es3fShaderBuiltinVarTests.ShaderBuiltinVarTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderBuiltinVarTests.ShaderBuiltinVarTests.prototype.constructor = es3fShaderBuiltinVarTests.ShaderBuiltinVarTests; + + es3fShaderBuiltinVarTests.ShaderBuiltinVarTests.prototype.init = function() { + var testGroup = tcuTestCase.runner.testCases; + // Builtin constants. + /** + * @struct + * @constructor + * @param {string} caseName + * @param {string} varName + * @param {es3fShaderBuiltinVarTests.GetConstantValueFunc} getValue + */ + var BuiltinConstant = function(caseName, varName, getValue) { + /** @type {string} */ this.caseName = caseName; + /** @type {string} */ this.varName = varName; + /** @type {es3fShaderBuiltinVarTests.GetConstantValueFunc} */ this.getValue = getValue; + + }; + + /** @type {Array} */ var builtinConstants = [ + // GLES 2. + + new BuiltinConstant('max_vertex_attribs', 'gl_MaxVertexAttribs', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_VERTEX_ATTRIBS); }), + new BuiltinConstant('max_vertex_uniform_vectors', 'gl_MaxVertexUniformVectors', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_VERTEX_UNIFORM_VECTORS); }), + new BuiltinConstant('max_fragment_uniform_vectors', 'gl_MaxFragmentUniformVectors', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_FRAGMENT_UNIFORM_VECTORS); }), + new BuiltinConstant('max_texture_image_units', 'gl_MaxTextureImageUnits', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_TEXTURE_IMAGE_UNITS); }), + new BuiltinConstant('max_vertex_texture_image_units', 'gl_MaxVertexTextureImageUnits', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS); }), + new BuiltinConstant('max_combined_texture_image_units', 'gl_MaxCombinedTextureImageUnits', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); }), + new BuiltinConstant('max_draw_buffers', 'gl_MaxDrawBuffers', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_DRAW_BUFFERS); }), + + // GLES 3. + + new BuiltinConstant('max_vertex_output_vectors', 'gl_MaxVertexOutputVectors', function() { return es3fShaderBuiltinVarTests.getVectorsFromComps(gl.MAX_VERTEX_OUTPUT_COMPONENTS); }), + new BuiltinConstant('max_fragment_input_vectors', 'gl_MaxFragmentInputVectors', function() { return es3fShaderBuiltinVarTests.getVectorsFromComps(gl.MAX_FRAGMENT_INPUT_COMPONENTS); }), + new BuiltinConstant('min_program_texel_offset', 'gl_MinProgramTexelOffset', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MIN_PROGRAM_TEXEL_OFFSET); }), + new BuiltinConstant('max_program_texel_offset', 'gl_MaxProgramTexelOffset', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_PROGRAM_TEXEL_OFFSET); }) + ]; + + for (var ndx = 0; ndx < builtinConstants.length; ndx++) { + /** @type {string} */ var caseName = builtinConstants[ndx].caseName; + /** @type {string} */ var varName = builtinConstants[ndx].varName; + /** @type {es3fShaderBuiltinVarTests.GetConstantValueFunc} */ var getValue = builtinConstants[ndx].getValue; + + testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase(caseName + '_vertex', varName, varName, getValue, gluShaderProgram.shaderType.VERTEX)); + testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase(caseName + '_fragment', varName, varName, getValue, gluShaderProgram.shaderType.FRAGMENT)); + } + + testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderDepthRangeTest('depth_range_vertex', 'gl_DepthRange', true)); + testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderDepthRangeTest('depth_range_fragment', 'gl_DepthRange', false)); + + // Vertex shader builtin variables. + testGroup.addChild(new es3fShaderBuiltinVarTests.VertexIDCase()); + // \todo [2013-03-20 pyry] gl_InstanceID -- tested in instancing tests quite thoroughly. + + // Fragment shader builtin variables. + testGroup.addChild(new es3fShaderBuiltinVarTests.FragCoordXYZCase()); + testGroup.addChild(new es3fShaderBuiltinVarTests.FragCoordWCase()); + testGroup.addChild(new es3fShaderBuiltinVarTests.PointCoordCase()); + testGroup.addChild(new es3fShaderBuiltinVarTests.FrontFacingCase()); + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderBuiltinVarTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderBuiltinVarTests.ShaderBuiltinVarTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderBuiltinVarTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js new file mode 100644 index 000000000..ddf1edc34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js @@ -0,0 +1,1913 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderCommonFunctionTests'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluVarType'); +goog.require('modules.shared.glsShaderExecUtil'); +goog.scope(function() { + var es3fShaderCommonFunctionTests = functional.gles3.es3fShaderCommonFunctionTests; + var tcuFloat = framework.common.tcuFloat; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluVarType = framework.opengl.gluVarType; + var deRandom = framework.delibs.debase.deRandom; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var glsShaderExecUtil = modules.shared.glsShaderExecUtil; + + /** @typedef {function(new: es3fShaderCommonFunctionTests.CommonFunctionCase, gluShaderUtil.DataType, gluShaderUtil.precision, gluShaderProgram.shaderType)} */ es3fShaderCommonFunctionTests.TestClass; + + /** + * @enum + */ + es3fShaderCommonFunctionTests.Types = { + FLOAT: 0, + INT: 1, + UINT: 2 + }; + + /** + * @param {Array} values + */ + es3fShaderCommonFunctionTests.vecToFloat16 = function(values) { + for (var ndx = 0; ndx < values.length; ndx++) + values[ndx] = tcuFloat.newFloat16(values[ndx]).getValue(); + }; + + /** + * @param {es3fShaderCommonFunctionTests.Types} type + * @param {deRandom.Random} rnd + * @param {number} minValue + * @param {number} maxValue + * @return {number} + */ + es3fShaderCommonFunctionTests.randomScalar = function(type, rnd, minValue, maxValue) { + switch (type) { + case es3fShaderCommonFunctionTests.Types.FLOAT: return rnd.getFloat(minValue, maxValue); + case es3fShaderCommonFunctionTests.Types.INT: return rnd.getInt(minValue, maxValue); + case es3fShaderCommonFunctionTests.Types.UINT: return Math.abs(rnd.getInt(minValue, maxValue)); + default: throw new Error('Only FLOAT, INT, and UINT are supported.'); + } + }; + + /** + * @param {es3fShaderCommonFunctionTests.Types} type + * @param {Array} size + * @param {deRandom.Random} rnd + * @param {Array} minValue + * @param {Array} maxValue + * @return {Array} + */ + es3fShaderCommonFunctionTests.randomVector = function(type, size, rnd, minValue, maxValue) { + /** @type {Array} */ var res = []; + for (var ndx = 0; ndx < size; ndx++) + res.push(es3fShaderCommonFunctionTests.randomScalar(type, rnd, minValue[ndx], maxValue[ndx])); + return res; + }; + + /** + * @param {es3fShaderCommonFunctionTests.Types} type + * @param {Array} size + * @param {deRandom.Random} rnd + * @param {Array} minValue + * @param {Array} maxValue + * @param {number} numValues + * @param {number=} offset + * @return {Array>} + */ + es3fShaderCommonFunctionTests.fillRandomVectors = function(type, size, rnd, minValue, maxValue, numValues, offset) { + offset = offset === undefined ? 0 : offset; + /** @type {Array>} */ var access; + for (var ndx = 0; ndx < numValues; ndx++) + access[offset + ndx] = es3fShaderCommonFunctionTests.randomVector(type, size, rnd, minValue, maxValue); + return access; + }; + + /** + * @param {es3fShaderCommonFunctionTests.Types} type + * @param {deRandom.Random} rnd + * @param {number} minValue + * @param {number} maxValue + * @param {number} numValues + * @param {number=} offset + * @return {Array} + */ + es3fShaderCommonFunctionTests.fillRandomScalars = function(type, rnd, minValue, maxValue, numValues, offset) { + offset = offset === undefined ? 0 : offset; + /** @type {Array} */ var access = []; + for (var ndx = 0; ndx < numValues; ndx++) + access[offset + ndx] = es3fShaderCommonFunctionTests.randomScalar(type, rnd, minValue, maxValue); + return access; + }; + + /** + * @param {number} input + * @param {number} output + * @return {number} + */ + es3fShaderCommonFunctionTests.numBitsLostInOp = function(input, output) { + /** @type {number} */ var inExp = tcuFloat.newFloat32(input).exponent(); + /** @type {number} */ var outExp = tcuFloat.newFloat32(output).exponent(); + return Math.max(0, inExp - outExp); // Lost due to mantissa shift. + }; + + /** + * @param {number} a + * @param {number} b + * @return {number} + */ + es3fShaderCommonFunctionTests.getUlpDiff = function(a, b) { + /** @type {number} */ var aBits = tcuFloat.newFloat32(a).bits(); + /** @type {number} */ var bBits = tcuFloat.newFloat32(b).bits(); + return aBits > bBits ? aBits - bBits : bBits - aBits; + }; + + /** + * @param {number} a + * @param {number} b + * @return {number} + */ + es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign = function(a, b) { + if (tcuFloat.newFloat32(a).isZero()) + return es3fShaderCommonFunctionTests.getUlpDiff(new tcuFloat.deFloat().construct(tcuFloat.newFloat32(b).sign(), 0, 0).getValue(), b); + else if (tcuFloat.newFloat32(b).isZero()) + return es3fShaderCommonFunctionTests.getUlpDiff(a, new tcuFloat.deFloat().construct(tcuFloat.newFloat32(a).sign(), 0, 0).getValue()); + else + return es3fShaderCommonFunctionTests.getUlpDiff(a, b); + }; + + /** + * @param {gluShaderUtil.precision} precision + * @return {boolean} + */ + es3fShaderCommonFunctionTests.supportsSignedZero = function(precision) { + // \note GLSL ES 3.0 doesn't really require support for -0, but we require it for highp + // as it is very widely supported. + return precision == gluShaderUtil.precision.PRECISION_HIGHP; + }; + + /** + * @param {number} value + * @param {number} ulpDiff + * @return {number} + */ + es3fShaderCommonFunctionTests.getEpsFromMaxUlpDiff = function(value, ulpDiff) { + /** @type {number} */ var exp = tcuFloat.newFloat32(value).exponent(); + return new tcuFloat.deFloat().construct(+1, exp, (1 << 23) | ulpDiff).getValue() - new tcuFloat.deFloat().construct(+1, exp, 1 << 23).getValue(); + }; + + /** + * @param {number} numAccurateBits + * @return {number} + */ + es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits = function(numAccurateBits) { + /** @type {number} */ var numGarbageBits = 23 - numAccurateBits; + /** @type {number} */ var mask = (1 << numGarbageBits) - 1; + + return mask; + }; + + /** + * @param {number} value + * @param {number} numAccurateBits + * @return {number} + */ + es3fShaderCommonFunctionTests.getEpsFromBits = function(value, numAccurateBits) { + return es3fShaderCommonFunctionTests.getEpsFromMaxUlpDiff(value, es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(numAccurateBits)); + }; + + /** + * @param {gluShaderUtil.precision} precision + * @return {number} + */ + es3fShaderCommonFunctionTests.getMinMantissaBits = function(precision) { + /** @type {Array} */ var bits = [ + 7, // lowp + 10, // mediump + 23 // highp + ]; + + assertMsgOptions(deMath.deInBounds32(precision, 0, bits.length), 'Unexpected precision option.', false, true); + return bits[precision]; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.CommonFunctionCase = function(name, description, shaderType) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {gluShaderProgram.shaderType} */ this.m_shaderType = shaderType; + /** @type {number} */ this.m_numValues = 100; + /** @type {glsShaderExecUtil.ShaderExecutor} */ this.m_executor = null; + /** @type {glsShaderExecUtil.ShaderSpec} */ this.m_spec = new glsShaderExecUtil.ShaderSpec(); + this.m_spec.version = gluShaderUtil.GLSLVersion.V300_ES; + /** @type {string} */ this.m_failMsg; //!< Comparison failure help message. + }; + + es3fShaderCommonFunctionTests.CommonFunctionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.constructor = es3fShaderCommonFunctionTests.CommonFunctionCase; + + es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.init = function() { + assertMsgOptions(!this.m_executor, 'Shader executor should be null at this point', false, true); + this.m_executor = glsShaderExecUtil.createExecutor(this.m_shaderType, this.m_spec); + if (!this.m_executor.isOk()) + throw new Error('Compile failed'); + }; + + es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.deinit = function() { + this.m_executor = null; + }; + + /** + * @param {Array} symbols + * @return {Array} + */ + es3fShaderCommonFunctionTests.getScalarSizes = function(symbols) { + /** @type {Array} */ var sizes = []; + for (var ndx = 0; ndx < symbols.length; ++ndx) + sizes.push(symbols[ndx].varType.getScalarSize()); + return sizes; + }; + + /** + * @param {Array} symbols + * @return {number} + */ + es3fShaderCommonFunctionTests.computeTotalScalarSize = function(symbols) { + /** @type {number} */ var totalSize = 0; + for (var sym in symbols) + totalSize += symbols[sym].varType.getScalarSize(); + return totalSize; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.iterate = function() { + /** @type {number} */ var numInputScalars = es3fShaderCommonFunctionTests.computeTotalScalarSize(this.m_spec.inputs); + /** @type {number} */ var numOutputScalars = es3fShaderCommonFunctionTests.computeTotalScalarSize(this.m_spec.outputs); + /** @type {Array} */ var inputData = []; + /** @type {Array} */ var outputData = []; + /** @type {gluShaderUtil.DataType} */ var inputType = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.DataType} */ var outputType = this.m_spec.outputs[0].varType.getBasicType(); + /** @type {Array>} */ var inputValues; + /** @type {ArrayBuffer} */ var outputValues; + inputValues = this.getInputValues(this.m_numValues); + + for (var inNdx = 0; inNdx < inputValues.length; inNdx++) { + var data = inputType >= gluShaderUtil.DataType.FLOAT && inputType <= gluShaderUtil.DataType.FLOAT_VEC4 ? new Float32Array(inputValues[inNdx]) : + inputType >= gluShaderUtil.DataType.INT && inputType <= gluShaderUtil.DataType.INT_VEC4 ? new Int32Array(inputValues[inNdx]) : + inputType >= gluShaderUtil.DataType.UINT && inputType <= gluShaderUtil.DataType.UINT_VEC4 ? new Uint32Array(inputValues[inNdx]) : + null; + inputData.push(data); + } + + // Execute shader. + this.m_executor.useProgram(); + outputValues = this.m_executor.execute(this.m_numValues, inputData); + for (var outNdx = 0; outNdx < outputValues.length; outNdx++) { + var data = outputType >= gluShaderUtil.DataType.FLOAT && outputType <= gluShaderUtil.DataType.FLOAT_VEC4 ? new Float32Array(outputValues[outNdx].buffer) : + outputType >= gluShaderUtil.DataType.INT && outputType <= gluShaderUtil.DataType.INT_VEC4 ? new Int32Array(outputValues[outNdx].buffer) : + outputType >= gluShaderUtil.DataType.UINT && outputType <= gluShaderUtil.DataType.UINT_VEC4 ? new Uint32Array(outputValues[outNdx].buffer) : + outputType >= gluShaderUtil.DataType.BOOL && outputType <= gluShaderUtil.DataType.BOOL_VEC4 ? new Int32Array(outputValues[outNdx].buffer) : + null; + outputData.push(data); + } + + // TODO: verify proper TypedArray for BOOL types; defaulting to Int32Array in the mean time (outputValues returns 400 bytes, we need 100 elements) + // Compare results. + /** @type {Array} */ var inScalarSizes = es3fShaderCommonFunctionTests.getScalarSizes(this.m_spec.inputs); + /** @type {Array} */ var outScalarSizes = es3fShaderCommonFunctionTests.getScalarSizes(this.m_spec.outputs); + /** @type {Array<*>} */ var curInputPtr = []; + /** @type {Array<*>} */ var curOutputPtr = []; + /** @type {number} */ var numFailed = 0; + + for (var inNdx = 0; inNdx < inputData.length; inNdx++) { + curInputPtr[inNdx] = []; + for (var valNdx = 0; valNdx < inputData[inNdx].length; valNdx += inScalarSizes[inNdx]) + curInputPtr[inNdx].push(inputData[inNdx].slice(valNdx, valNdx + inScalarSizes[inNdx])); + } + + for (var outNdx = 0; outNdx < outputData.length; outNdx++) { + curOutputPtr[outNdx] = []; + for (var valNdx = 0; valNdx < outputData[outNdx].length; valNdx += outScalarSizes[outNdx]) + curOutputPtr[outNdx].push(outputData[outNdx].slice(valNdx, valNdx + outScalarSizes[outNdx])); + } + + for (var valNdx = 0; valNdx < this.m_numValues; valNdx++) { + var curInputValues = []; + var curOutputValues = []; + for (var inNdx = 0; inNdx < inputData.length; inNdx++) { + curInputValues.push(curInputPtr[inNdx][valNdx]); + } + for (var outNdx = 0; outNdx < outputData.length; outNdx++) { + curOutputValues.push(curOutputPtr[outNdx][valNdx]); + } + if (!this.compare(curInputValues, curOutputValues)) { + // \todo [2013-08-08 pyry] We probably want to log reference value as well? + + bufferedLogToConsole('ERROR: comparison failed for value ' + valNdx + ':\n ' + this.m_failMsg); + bufferedLogToConsole(' inputs:'); + bufferedLogToConsole(' ' + this.m_spec.inputs[0].name + ' = ' + this.m_spec.inputs[0].varType.toString() + ' ' + curInputPtr[valNdx]); + bufferedLogToConsole(' outputs:'); + bufferedLogToConsole(' ' + this.m_spec.outputs[0].name + ' = ' + this.m_spec.outputs[0].varType.toString() + ' ' + curOutputPtr[valNdx]); + + this.m_failMsg = ''; + numFailed += 1; + } + } + + bufferedLogToConsole((this.m_numValues - numFailed) + ' / ' + this.m_numValues + ' values passed'); + + /** @type {boolean} */ var isOk = numFailed === 0; + + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @param {gluShaderUtil.precision} precision + * @return {string} + */ + es3fShaderCommonFunctionTests.getPrecisionPostfix = function(precision) { + /** @type {Array} */ var s_postfix = [ + '_lowp', + '_mediump', + '_highp' + ]; + assertMsgOptions(0 <= precision && precision < s_postfix.length, 'Error: Out of range', false, true); + return s_postfix[precision]; + }; + + /** + * @param {gluShaderProgram.shaderType} shaderType + * @return {string} + */ + es3fShaderCommonFunctionTests.getShaderTypePostfix = function(shaderType) { + /** @type {Array} */ var s_postfix = [ + '_vertex', + '_fragment' + ]; + assertMsgOptions(0 <= shaderType && shaderType < s_postfix.length, 'Error Out of range', false, true); + return s_postfix[shaderType]; + }; + + /** + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + * @return {string} + */ + es3fShaderCommonFunctionTests.getCommonFuncCaseName = function(baseType, precision, shaderType) { + return gluShaderUtil.getDataTypeName(baseType) + + es3fShaderCommonFunctionTests.getPrecisionPostfix(precision) + + es3fShaderCommonFunctionTests.getShaderTypePostfix(shaderType); + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.AbsCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'abs', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = abs(in0);'; + }; + + es3fShaderCommonFunctionTests.AbsCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.AbsCase.prototype.constructor = es3fShaderCommonFunctionTests.AbsCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.AbsCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var floatRanges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {Array>} */ var intRanges = [ + [-(1 << 7) + 1, (1 << 7) - 1], + [-(1 << 15) + 1, (1 << 15) - 1], + [-0x80000000 + 1, 0x7fffffff] + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x235fac); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {Array>} */ var values = []; + values[0] = []; + + if (gluShaderUtil.isDataTypeFloatOrVec(type)) + values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, floatRanges[precision][0], floatRanges[precision][1], numValues * scalarSize); + else + values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.INT, rnd, intRanges[precision][0], intRanges[precision][1], numValues * scalarSize); + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.AbsCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref0; + + if (gluShaderUtil.isDataTypeFloatOrVec(type)) { + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var maxUlpDiff = (1 << (23 - mantissaBits)) - 1; + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref0 = Math.abs(in0); + /** @type {number} */ var ulpDiff0 = es3fShaderCommonFunctionTests.getUlpDiff(out0, ref0); + + if (ulpDiff0 > maxUlpDiff) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0 /*HexFloat(ref0)*/ + ' with ULP threshold ' + maxUlpDiff + ', got ULP diff ' + ulpDiff0; + return false; + } + } + } else + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref0 = Math.abs(in0); + + if (out0 != ref0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0; + return false; + } + } + + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.SignCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'sign', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = sign(in0);'; + }; + + es3fShaderCommonFunctionTests.SignCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.SignCase.prototype.constructor = es3fShaderCommonFunctionTests.SignCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.SignCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var floatRanges = [ + [-2.0, 2.0], // lowp + [-1e4, 1e4], // mediump + [-1e8, 1e8] // highp + ]; + + /** @type {Array>} */ var intRanges = [ + [-(1 << 7), (1 << 7) - 1], + [-(1 << 15), (1 << 15) - 1], + [0x80000000, 0x7fffffff] + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x324); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {Array>} */ var values = []; + values[0] = []; + + if (gluShaderUtil.isDataTypeFloatOrVec(type)) { + // Special cases. + // [dag] The special cases are 1, -1, and 0 + var specialCases = [1.0, -1.0, 0.0]; + for (var caseNdx = 0; caseNdx < specialCases.length; caseNdx++) + for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) { + values[0].push(specialCases[caseNdx]); + } + values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, floatRanges[precision][0], floatRanges[precision][1], (numValues - 3) * scalarSize)); + } else { + var specialCases = [1, -1, 0]; + for (var caseNdx = 0; caseNdx < specialCases.length; caseNdx++) + for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) { + values[0].push(specialCases[caseNdx]); + } + values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.INT, rnd, intRanges[precision][0], intRanges[precision][1], (numValues - 3) * scalarSize)); + } + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.SignCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref0; + + if (gluShaderUtil.isDataTypeFloatOrVec(type)) { + // Both highp and mediump should be able to represent -1, 0, and +1 exactly + /** @type {number} */ var maxUlpDiff = precision === gluShaderUtil.precision.PRECISION_LOWP ? + es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(es3fShaderCommonFunctionTests.getMinMantissaBits(precision)) : + 0; + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref0 = in0 < 0.0 ? -1.0 : + in0 > 0.0 ? 1.0 : 0.0; + /** @type {number} */ var ulpDiff0 = es3fShaderCommonFunctionTests.getUlpDiff(out0, ref0); + + if (ulpDiff0 > maxUlpDiff) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0 /*HexFloat(ref0)*/ + ' with ULP threshold ' + maxUlpDiff + ', got ULP diff ' + ulpDiff0; + return false; + } + } + } else { + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref0 = in0 < 0 ? -1 : + in0 > 0 ? 1 : 0; + + if (out0 != ref0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0; + return false; + } + } + } + + return true; + }; + + /** + * @param {number} v + * @return {number} + */ + es3fShaderCommonFunctionTests.roundEven = function(v) { + /** @type {number} */ var q = deMath.deFloatFrac(v); + /** @type {number} */ var truncated = Math.trunc(v - q); + /** @type {number} */ var rounded = (q > 0.5) ? (truncated + 1) : // Rounded up + (q == 0.5 && (truncated % 2 != 0)) ? (truncated + 1) : // Round to nearest even at 0.5 + truncated; // Rounded down + return rounded; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.RoundEvenCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'roundEven', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = roundEven(in0);'; + }; + + es3fShaderCommonFunctionTests.RoundEvenCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.RoundEvenCase.prototype.constructor = es3fShaderCommonFunctionTests.RoundEvenCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.RoundEvenCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var numSpecialCases = 0; + /** @type {Array>} */ var values = []; + values[0] = []; + // Special cases. + if (precision !== gluShaderUtil.precision.PRECISION_LOWP) { + assertMsgOptions(numValues >= 20, 'numValues should be greater or equal than 20', false, true); + for (var ndx = 0; ndx < 20; ndx++) { + /** @type {number} */ var v = deMath.clamp(ndx - 10.5, ranges[precision][0], ranges[precision][1]); + for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) { + values[0].push(v); + } + numSpecialCases += 1; + } + } + + // Random cases. + values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - numSpecialCases) * scalarSize)); + + // If precision is mediump, make sure values can be represented in fp16 exactly + if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP) + es3fShaderCommonFunctionTests.vecToFloat16(values[0]); + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.RoundEvenCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var in0; + /** @type {number} */ var out0; + + if (precision == gluShaderUtil.precision.PRECISION_HIGHP || precision == gluShaderUtil.precision.PRECISION_MEDIUMP) { + // Require exact rounding result. + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + /** @type {number} */ var ref = es3fShaderCommonFunctionTests.roundEven(in0); + + /** @type {number} */ var ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref); + + if (ulpDiff > 0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff; + return false; + } + } + } else { + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value. + /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + /** @type {number} */ var minRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 - eps)); + /** @type {number} */ var maxRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 + eps)); + /** @type {boolean} */ var anyOk = false; + + for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) { + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal); + + if (ulpDiff <= maxUlpDiff) { + anyOk = true; + break; + } + } + + if (!anyOk) { + this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff; + return false; + } + } + } + + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.ModfCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'modf', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out1', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = modf(in0, out1);'; + }; + + es3fShaderCommonFunctionTests.ModfCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.ModfCase.prototype.constructor = es3fShaderCommonFunctionTests.ModfCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.ModfCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {Array>} */ var values = []; + values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize); + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.ModfCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var out1; + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + out1 = outputs[1][compNdx]; + + /** @type {number} */ var refOut1 = Math.floor(in0); + /** @type {number} */ var refOut0 = in0 - refOut1; + + /** @type {number} */ var bitsLost = precision != gluShaderUtil.precision.PRECISION_HIGHP ? es3fShaderCommonFunctionTests.numBitsLostInOp(in0, refOut0) : 0; + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(Math.max(mantissaBits - bitsLost, 0)); + + /** @type {number} */ var resSum = out0 + out1; + + /** @type {number} */ var ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(resSum, in0) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(resSum, in0); + + if (ulpDiff > maxUlpDiff) { + this.m_failMsg += 'Expected [' + compNdx + '] = (' + refOut0 + ') + (' + refOut1 + ') = ' + in0 + ' with ULP threshold ' + + maxUlpDiff + ', got ULP diff ' + ulpDiff; + return false; + } + } + + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.IsnanCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'isnan', shaderType); + assertMsgOptions(gluShaderUtil.isDataTypeFloatOrVec(baseType), 'Assert error.', false, true); + + /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType); + /** @type {gluShaderUtil.DataType} */ var boolType = vecSize > 1 ? + gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.BOOL, vecSize) : + gluShaderUtil.DataType.BOOL; + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(boolType))); + this.m_spec.source = 'out0 = isnan(in0);'; + }; + + es3fShaderCommonFunctionTests.IsnanCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.IsnanCase.prototype.constructor = es3fShaderCommonFunctionTests.IsnanCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.IsnanCase.prototype.getInputValues = function(numValues) { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xc2a39f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var mantissaMask = (~es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits)) & ((1 << 23) - 1); + /** @type {Array>} */ var values = []; + values[0] = []; + + for (var valNdx = 0; valNdx < numValues * scalarSize; valNdx++) { + /** @type {boolean} */ var isNan = rnd.getFloat() > 0.3; + /** @type {boolean} */ var isInf = !isNan && rnd.getFloat() > 0.4; + /** @type {number} */ var mantissa = !isInf ? ((1 << 22) | (Math.abs(rnd.getInt()) & mantissaMask)) : 0; + /** @type {number} */ var exp = !isNan && !isInf ? (Math.abs(rnd.getInt()) & 0x7f) : 0xff; + /** @type {number} */ var sign = Math.abs(rnd.getInt()) & 0x1; + /** @type {number} */ var value = (sign << 31) | (exp << 23) | mantissa; + + // Convert int to float. + var view = new DataView(new ArrayBuffer(4)); + view.setInt32(0, value, true); + value = view.getFloat32(0, true); + + assertMsgOptions(tcuFloat.newFloat32(value).isInf() === isInf && tcuFloat.newFloat32(value).isNaN() === isNan, 'Assert error.', false, true); + + values[0].push(value); + } + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.IsnanCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref; + + if (precision === gluShaderUtil.precision.PRECISION_HIGHP) { + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref = tcuFloat.newFloat32(in0).isNaN() ? 1 : 0; + + if (out0 !== ref) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref; + return false; + } + } + } else { + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + out0 = outputs[0][compNdx]; + + if (out0 !== 0 && out0 !== 1) { + this.m_failMsg += 'Expected [' + compNdx + '] = 0 / 1'; + return false; + } + } + } + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.IsinfCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'isinf', shaderType); + assertMsgOptions(gluShaderUtil.isDataTypeFloatOrVec(baseType), 'Assert error.', false, true); + + /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType); + /** @type {gluShaderUtil.DataType} */ var boolType = vecSize > 1 ? + gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.BOOL, vecSize) : + gluShaderUtil.DataType.BOOL; + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(boolType))); + this.m_spec.source = 'out0 = isinf(in0);'; + }; + + es3fShaderCommonFunctionTests.IsinfCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.IsinfCase.prototype.constructor = es3fShaderCommonFunctionTests.IsinfCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.IsinfCase.prototype.getInputValues = function(numValues) { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xc2a39f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var mantissaMask = (~es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits)) & ((1 << 23) - 1); + /** @type {Array>} */ var values = []; + values[0] = []; + + for (var valNdx = 0; valNdx < numValues * scalarSize; valNdx++) { + /** @type {boolean} */ var isInf = rnd.getFloat() > 0.3; + /** @type {boolean} */ var isNan = !isInf && rnd.getFloat() > 0.4; + /** @type {number} */ var mantissa = !isInf ? ((1 << 22) | (Math.abs(rnd.getInt()) & mantissaMask)) : 0; + /** @type {number} */ var exp = !isNan && !isInf ? (Math.abs(rnd.getInt()) & 0x7f) : 0xff; + /** @type {number} */ var sign = Math.abs(rnd.getInt()) & 0x1; + /** @type {number} */ var value = (sign << 31) | (exp << 23) | mantissa; + + // Convert int to float. + var view = new DataView(new ArrayBuffer(4)); + view.setInt32(0, value, true); + value = view.getFloat32(0, true); + + assertMsgOptions(tcuFloat.newFloat32(value).isInf() === isInf && tcuFloat.newFloat32(value).isNaN() === isNan, 'Assert error.', false, true); + + values[0].push(value); + } + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.IsinfCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref; + + if (precision === gluShaderUtil.precision.PRECISION_HIGHP) { + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref = tcuFloat.newFloat32(in0).isInf() ? 1 : 0; + + if (out0 !== ref) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref; + return false; + } + } + } else { + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + out0 = outputs[0][compNdx]; + + if (out0 !== 0 && out0 !== 1) { + this.m_failMsg += 'Expected [' + compNdx + '] = 0 / 1'; + return false; + } + } + } + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + * @param {boolean} outIsSigned + */ + es3fShaderCommonFunctionTests.FloatBitsToUintIntCase = function(baseType, precision, shaderType, outIsSigned) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + outIsSigned ? 'floatBitsToInt' : 'floatBitsToUint', shaderType); + + /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType); + /** @type {gluShaderUtil.DataType} */ var intType = outIsSigned ? + (vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT) : + (vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize) : gluShaderUtil.DataType.UINT); + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(intType, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.source = outIsSigned ? 'out0 = floatBitsToInt(in0);' : 'out0 = floatBitsToUint(in0);'; + }; + + es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype.constructor = es3fShaderCommonFunctionTests.FloatBitsToUintIntCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype.getInputValues = function(numValues) { + + /** @type {Array} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x2790a); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {Array>} */ var values = []; + + values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize); + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var refOut0; + /** @type {number} */ var ulpDiff; + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + + // Convert int to uint because ref out is in uint format. + var view = new DataView(new ArrayBuffer(4)); + view.setInt32(0, out0, true); + out0 = view.getUint32(0, true); + + refOut0 = tcuFloat.newFloat32(in0).bits(); + ulpDiff = Math.abs(out0 - refOut0); + if (ulpDiff > maxUlpDiff) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + refOut0 + ' with threshold ' + + maxUlpDiff + ', got diff ' + ulpDiff; + return false; + } + } + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.FloatBitsToUintIntCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.FloatBitsToIntCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.call(this, baseType, precision, shaderType, true); + }; + + es3fShaderCommonFunctionTests.FloatBitsToIntCase.prototype = Object.create(es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype); + es3fShaderCommonFunctionTests.FloatBitsToIntCase.prototype.constructor = es3fShaderCommonFunctionTests.FloatBitsToIntCase; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.FloatBitsToUintIntCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.FloatBitsToUintCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.call(this, baseType, precision, shaderType, false); + }; + + es3fShaderCommonFunctionTests.FloatBitsToUintCase.prototype = Object.create(es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype); + es3fShaderCommonFunctionTests.FloatBitsToUintCase.prototype.constructor = es3fShaderCommonFunctionTests.FloatBitsToUintCase; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.BitsToFloatCase = function(baseType, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, gluShaderUtil.precision.PRECISION_HIGHP, shaderType), + gluShaderUtil.isDataTypeIntOrIVec(baseType) ? 'intBitsToFloat' : 'uintBitsToFloat', shaderType); + /** @type {boolean} */ var inIsSigned = gluShaderUtil.isDataTypeIntOrIVec(baseType); + /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType); + /** @type {gluShaderUtil.DataType} */ var floatType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT; + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(floatType, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.source = inIsSigned ? 'out0 = intBitsToFloat(in0);' : 'out0 = uintBitsToFloat(in0);'; + }; + + es3fShaderCommonFunctionTests.BitsToFloatCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.BitsToFloatCase.prototype.constructor = es3fShaderCommonFunctionTests.BitsToFloatCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.BitsToFloatCase.prototype.getInputValues = function(numValues) { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xbbb225); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {Array} */ var range = [-1e8, 1e8]; + /** @type {Array>} */ var values = []; + + values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, range[0], range[1], numValues * scalarSize); + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.BitsToFloatCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var maxUlpDiff = 0; + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ulpDiff; + /** @type {number} */ var refOut0; + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + + // Convert int to float + var view = new DataView(new ArrayBuffer(4)); + view.setInt32(0, in0, true); + in0 = view.getFloat32(0, true); + + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiff(in0, out0); + if (ulpDiff > maxUlpDiff) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + in0 + ' with ULP threshold ' + + maxUlpDiff + ', got ULP diff ' + ulpDiff; + return false; + } + } + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.FloorCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'floor', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = floor(in0);'; + }; + + es3fShaderCommonFunctionTests.FloorCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.FloorCase.prototype.constructor = es3fShaderCommonFunctionTests.FloorCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.FloorCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {Array>} */ var values = []; + // Random cases. + values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize); + + // If precision is mediump, make sure values can be represented in fp16 exactly + if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP) + es3fShaderCommonFunctionTests.vecToFloat16(values[0]); + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.FloorCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref; + /** @type {number} */ var ulpDiff; + + if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) { + // Require exact result. + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref = Math.floor(in0); + + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiff(out0, ref); + + if (ulpDiff > 0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff; + return false; + } + } + } else { + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value. + /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + /** @type {number} */ var minRes = Math.floor(in0 - eps); + /** @type {number} */ var maxRes = Math.floor(in0 + eps); + /** @type {boolean} */ var anyOk = false; + + for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) { + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiff(out0, roundedVal); + + if (ulpDiff <= maxUlpDiff) { + anyOk = true; + break; + } + } + + if (!anyOk) { + this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff; + return false; + } + } + } + + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.TruncCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'trunc', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = trunc(in0);'; + }; + + es3fShaderCommonFunctionTests.TruncCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.TruncCase.prototype.constructor = es3fShaderCommonFunctionTests.TruncCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.TruncCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {Array} */ var specialCases = [0.0, -0.0, -0.9, 0.9, 1.0, -1.0]; + /** @type {Array>} */ var values = []; + values[0] = []; + + // Special cases + for (var caseNdx = 0; caseNdx < specialCases.length; caseNdx++) + for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) + values[0].push(specialCases[caseNdx]); + + // Random cases. + values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - specialCases.length) * scalarSize)); + + // If precision is mediump, make sure values can be represented in fp16 exactly + if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP) + es3fShaderCommonFunctionTests.vecToFloat16(values[0]); + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.TruncCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref; + /** @type {number} */ var ulpDiff; + + if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) { + // Require exact result. + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + /** @type {boolean} */ var isNeg = tcuFloat.newFloat32(in0).sign() < 0; + ref = isNeg ? (-Math.floor(-in0)) : Math.floor(in0); + + // \note: trunc() function definition is a bit broad on negative zeros. Ignore result sign if zero. + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref); + + if (ulpDiff > 0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff; + return false; + } + } + } else { + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value. + /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + /** @type {number} */ var minRes = Math.trunc(in0 - eps); + /** @type {number} */ var maxRes = Math.trunc(in0 + eps); + /** @type {boolean} */ var anyOk = false; + + for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) { + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal); + + if (ulpDiff <= maxUlpDiff) { + anyOk = true; + break; + } + } + + if (!anyOk) { + this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff; + return false; + } + } + } + + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.RoundCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'round', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = round(in0);'; + }; + + es3fShaderCommonFunctionTests.RoundCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.RoundCase.prototype.constructor = es3fShaderCommonFunctionTests.RoundCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.RoundCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var numSpecialCases = 0; + + /** @type {Array>} */ var values = []; + values[0] = [] + + // Special cases. + if (precision === gluShaderUtil.precision.PRECISION_LOWP) { + assertMsgOptions(numValues >= 10, 'Sample too small.', false, true); + for (var ndx = 0; ndx < 10; ndx++) { + /** @type {number} */ var v = deMath.clamp(ndx - 5.5, ranges[precision][0], ranges[precision][1]); + for (var iter = 1; iter <= scalarSize; iter++) + values[0].push(v); + numSpecialCases += 1; + } + } + + // Random cases. + values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - numSpecialCases) * scalarSize)); + + // If precision is mediump, make sure values can be represented in fp16 exactly + if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP) + es3fShaderCommonFunctionTests.vecToFloat16(values[0]); + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.RoundCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ulpDiff; + + if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) { + // Require exact result. + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + + if ((in0 - Math.floor(in0)) === 0.5) { + /** @type {number} */ var ref0 = Math.floor(in0); + /** @type {number} */ var ref1 = Math.ceil(in0); + /** @type {number} */ var ulpDiff0 = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref0) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref0); + /** @type {number} */ var ulpDiff1 = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref1) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref1); + if (ulpDiff0 > 0 && ulpDiff1 > 0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0 + ' or ' + ref1 + ', got ULP diff ' + Math.min(ulpDiff0, ulpDiff1); + return false; + } + } else { + // Require exact result + /** @type {number} */ var ref = es3fShaderCommonFunctionTests.roundEven(in0); + ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref); + + if (ulpDiff > 0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff; + return false; + } + } + } + } else { + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value. + /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + /** @type {number} */ var minRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 - eps)); + /** @type {number} */ var maxRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 + eps)); + /** @type {boolean} */ var anyOk = false; + + for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) { + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal); + + if (ulpDiff <= maxUlpDiff) { + anyOk = true; + break; + } + } + + if (!anyOk) { + this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff; + return false; + } + } + } + + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.CeilCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'ceil', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = ceil(in0);'; + }; + + es3fShaderCommonFunctionTests.CeilCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.CeilCase.prototype.constructor = es3fShaderCommonFunctionTests.CeilCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.CeilCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {Array>} */ var values = []; + + // Random cases. + values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize); + + // If precision is mediump, make sure values can be represented in fp16 exactly + if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP) + es3fShaderCommonFunctionTests.vecToFloat16(values[0]); + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.CeilCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref; + /** @type {number} */ var ulpDiff; + + if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) { + // Require exact result. + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref = Math.ceil(in0); + ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref); + + if (ulpDiff > 0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff; + return false; + } + } + } else { + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value. + /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + /** @type {number} */ var minRes = Math.ceil(in0 - eps); + /** @type {number} */ var maxRes = Math.ceil(in0 + eps); + /** @type {boolean} */ var anyOk = false; + + for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) { + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal); + + if (ulpDiff <= maxUlpDiff) { + anyOk = true; + break; + } + } + + if (!anyOk & deMath.deInRange32(0, minRes, maxRes)) { + ulpDiff = Math.abs(Math.floor(tcuFloat.newFloat32(out0).bits()) - 0x80000000); + anyOk = ulpDiff <= maxUlpDiff; + } + + if (!anyOk) { + this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff; + return false; + } + } + } + + return true; + }; + + /** + * @constructor + * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase} + * @param {gluShaderUtil.DataType} baseType + * @param {gluShaderUtil.precision} precision + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderCommonFunctionTests.FractCase = function(baseType, precision, shaderType) { + es3fShaderCommonFunctionTests.CommonFunctionCase.call(this, + es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType), + 'fract', shaderType); + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision))); + this.m_spec.source = 'out0 = fract(in0);'; + }; + + es3fShaderCommonFunctionTests.FractCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype); + es3fShaderCommonFunctionTests.FractCase.prototype.constructor = es3fShaderCommonFunctionTests.FractCase; + + /** + * @param {number} numValues + * @return {*} + */ + es3fShaderCommonFunctionTests.FractCase.prototype.getInputValues = function(numValues) { + /** @type {Array>} */ var ranges = [ + [-2.0, 2.0], // lowp + [-1e3, 1e3], // mediump + [-1e7, 1e7] // highp + ]; + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f); + + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ var numSpecialCases = 0; + + /** @type {Array>} */ var values = []; + values[0] = []; + + // Special cases. + if (precision !== gluShaderUtil.precision.PRECISION_LOWP) { + assertMsgOptions(numValues >= 10, 'Sample too small.', false, true); + for (var ndx = 0; ndx < 10; ndx++) { + /** @type {number} */ var v = deMath.clamp(ndx - 5.5, ranges[precision][0], ranges[precision][1]); + for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) { + values[0].push(v); + } + numSpecialCases += 1; + } + } + + // Random cases. + values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - numSpecialCases) * scalarSize)); + + // If precision is mediump, make sure values can be represented in fp16 exactly + if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP) + es3fShaderCommonFunctionTests.vecToFloat16(values[0]) + + return values; + }; + + /** + * @param {*} inputs + * @param {*} outputs + * @return {boolean} + */ + es3fShaderCommonFunctionTests.FractCase.prototype.compare = function(inputs, outputs) { + /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType(); + /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision(); + /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {number} */ var in0; + /** @type {number} */ var out0; + /** @type {number} */ var ref; + /** @type {number} */ var ulpDiff; + + if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) { + // Require exact result. + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + ref = in0 - Math.floor(in0); + ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref); + + if (ulpDiff > 0) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff; + return false; + } + } + } else { + /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision); + /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds + + for (var compNdx = 0; compNdx < scalarSize; compNdx++) { + in0 = inputs[0][compNdx]; + out0 = outputs[0][compNdx]; + + if (Math.floor(in0 - eps) == Math.floor(in0 + eps)) { + ref = in0 - Math.floor(in0); + /** @type {number} */ var bitsLost = es3fShaderCommonFunctionTests.numBitsLostInOp(in0, ref); + /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(Math.max(0, mantissaBits - bitsLost)); // ULP diff for rounded integer value. + ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref); + if (ulpDiff > maxUlpDiff) { + this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ' with ULP threshold ' + maxUlpDiff + ', got diff ' + ulpDiff; + return false; + } + } else { + if (out0 >= 1.0) { + this.m_failMsg += 'Expected [' + compNdx + '] < 1.0'; + return false; + } + } + } + } + + return true; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderCommonFunctionTests.ShaderCommonFunctionTests = function() { + tcuTestCase.DeqpTest.call(this, 'common', 'Common function tests'); + }; + + es3fShaderCommonFunctionTests.ShaderCommonFunctionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderCommonFunctionTests.ShaderCommonFunctionTests.prototype.constructor = es3fShaderCommonFunctionTests.ShaderCommonFunctionTests; + + /** + * @param {tcuTestCase.DeqpTest} parent + * @param {es3fShaderCommonFunctionTests.TestClass} testClass + * @param {string} functionName + * @param {boolean} floatTypes + * @param {boolean} intTypes + * @param {boolean} uintTypes + */ + es3fShaderCommonFunctionTests.addFunctionCases = function(parent, testClass, functionName, floatTypes, intTypes, uintTypes) { + /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(functionName, functionName); + parent.addChild(group); + + /** @type {Array} */ var scalarTypes = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.UINT + ]; + + for (var scalarTypeNdx = 0; scalarTypeNdx < scalarTypes.length; scalarTypeNdx++) { + /** @type {gluShaderUtil.DataType} */ var scalarType = scalarTypes[scalarTypeNdx]; + + if ((!floatTypes && scalarType == gluShaderUtil.DataType.FLOAT) || + (!intTypes && scalarType == gluShaderUtil.DataType.INT) || + (!uintTypes && scalarType == gluShaderUtil.DataType.UINT)) + continue; + + for (var vecSize = 1; vecSize <= 4; vecSize++) + for (var prec = gluShaderUtil.precision.PRECISION_LOWP; prec <= gluShaderUtil.precision.PRECISION_HIGHP; prec++) + for (var shaderType = gluShaderProgram.shaderType.VERTEX; shaderType <= gluShaderProgram.shaderType.FRAGMENT; shaderType++) + group.addChild(new testClass(/** @type {gluShaderUtil.DataType} */ (scalarType + vecSize - 1), prec, shaderType)); + } + }; + + es3fShaderCommonFunctionTests.ShaderCommonFunctionTests.prototype.init = function() { + var testGroup = tcuTestCase.runner.testCases; + + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.AbsCase, 'abs', true, true, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.SignCase, 'sign', true, true, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FloorCase, 'floor', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.TruncCase, 'trunc', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.RoundCase, 'round', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.RoundEvenCase, 'roundeven', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.CeilCase, 'ceil', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FractCase, 'fract', true, false, false); + // mod + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.ModfCase, 'modf', true, false, false); + // min, max, clamp, mix, step, smoothstep + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.IsnanCase, 'isnan', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.IsinfCase, 'isinf', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FloatBitsToIntCase, 'floatbitstoint', true, false, false); + es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FloatBitsToUintCase, 'floatbitstouint', true, false, false); + + // (u)intBitsToFloat() + /** @type {tcuTestCase.DeqpTest} */ var intGroup = tcuTestCase.newTest('intbitstofloat', 'intBitsToFloat() Tests'); + /** @type {tcuTestCase.DeqpTest} */ var uintGroup = tcuTestCase.newTest('uintbitstofloat', 'uintBitsToFloat() Tests'); + + testGroup.addChild(intGroup); + testGroup.addChild(uintGroup); + + /** @type {Array} */ var shaderTypes = [ + gluShaderProgram.shaderType.VERTEX, + gluShaderProgram.shaderType.FRAGMENT + ]; + + for (var vecSize = 1; vecSize < 4; vecSize++) { + /** @type {gluShaderUtil.DataType} */ var intType = vecSize > 1 ? + gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : + gluShaderUtil.DataType.INT; + + /** @type {gluShaderUtil.DataType} */ var uintType = vecSize > 1 ? + gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize) : + gluShaderUtil.DataType.UINT; + + for (var shaderType in shaderTypes) { + intGroup.addChild(new es3fShaderCommonFunctionTests.BitsToFloatCase(intType, shaderTypes[shaderType])); + uintGroup.addChild(new es3fShaderCommonFunctionTests.BitsToFloatCase(uintType, shaderTypes[shaderType])); + } + } + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderCommonFunctionTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderCommonFunctionTests.ShaderCommonFunctionTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderCommonFunctionTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js new file mode 100644 index 000000000..9c859c296 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js @@ -0,0 +1,1696 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderDerivateTests'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluPixelTransfer'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.common.tcuInterval'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuStringTemplate'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.common.tcuTestCase'); +goog.require('modules.shared.glsShaderRenderCase'); + +goog.scope(function() { + var es3fShaderDerivateTests = functional.gles3.es3fShaderDerivateTests; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluPixelTransfer = framework.opengl.gluPixelTransfer; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluTexture = framework.opengl.gluTexture; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var tcuInterval = framework.common.tcuInterval; + var tcuFloat = framework.common.tcuFloat; + var tcuLogImage = framework.common.tcuLogImage; + var tcuMatrix = framework.common.tcuMatrix; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuRGBA = framework.common.tcuRGBA; + var tcuStringTemplate = framework.common.tcuStringTemplate; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var tcuTestCase = framework.common.tcuTestCase; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + + /** @const {number} */ es3fShaderDerivateTests.VIEWPORT_WIDTH = 167; + /** @const {number} */ es3fShaderDerivateTests.VIEWPORT_HEIGHT = 103; + /** @const {number} */ es3fShaderDerivateTests.FBO_WIDTH = 99; + /** @const {number} */ es3fShaderDerivateTests.FBO_HEIGHT = 133; + /** @const {number} */ es3fShaderDerivateTests.MAX_FAILED_MESSAGES = 10; + /** @const {number} */ es3fShaderDerivateTests.INTERPOLATION_LOST_BITS = 3; // number mantissa of bits allowed to be lost in varying interpolation + /** + * @enum {number} + */ + es3fShaderDerivateTests.DerivateFunc = { + DFDX: 0, + DFDY: 1, + FWIDTH: 2 + }; + + /** + * @enum {number} + */ + es3fShaderDerivateTests.SurfaceType = { + DEFAULT_FRAMEBUFFER: 0, + UNORM_FBO: 1, + FLOAT_FBO: 2 // \note Uses RGBA32UI fbo actually, since FP rendertargets are not in core spec. + }; + + /** + * @enum {number} + */ + es3fShaderDerivateTests.VerificationLogging = { + LOG_ALL: 0, + LOG_NOTHING: 1 + }; + + /** + * @param {es3fShaderDerivateTests.DerivateFunc} func + * @return {string} + */ + es3fShaderDerivateTests.getDerivateFuncName = function(func) { + switch (func) { + case es3fShaderDerivateTests.DerivateFunc.DFDX: return 'dFdx'; + case es3fShaderDerivateTests.DerivateFunc.DFDY: return 'dFdy'; + case es3fShaderDerivateTests.DerivateFunc.FWIDTH: return 'fwidth'; + default: throw new Error('Derivate Func not supported.'); + } + }; + + /** + * @param {es3fShaderDerivateTests.DerivateFunc} func + * @return {string} + */ + es3fShaderDerivateTests.getDerivateFuncCaseName = function(func) { + switch (func) { + case es3fShaderDerivateTests.DerivateFunc.DFDX: return 'dfdx'; + case es3fShaderDerivateTests.DerivateFunc.DFDY: return 'dfdy'; + case es3fShaderDerivateTests.DerivateFunc.FWIDTH: return 'fwidth'; + default: throw new Error('Derivate Func not supported.'); + } + }; + + /** + * @param {?gluShaderUtil.DataType} type + * @return {Array} + */ + es3fShaderDerivateTests.getDerivateMask = function(type) { + switch (type) { + case gluShaderUtil.DataType.FLOAT: return [true, false, false, false]; + case gluShaderUtil.DataType.FLOAT_VEC2: return [true, true, false, false]; + case gluShaderUtil.DataType.FLOAT_VEC3: return [true, true, true, false]; + case gluShaderUtil.DataType.FLOAT_VEC4: return [true, true, true, true]; + default: throw new Error('Data Type not supported.'); + } + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} surface + * @param {Array} derivScale + * @param {Array} derivBias + * @param {number} x + * @param {number} y + * @return {Array} + */ + es3fShaderDerivateTests.readDerivate = function(surface, derivScale, derivBias, x, y) { + return deMath.divide(deMath.subtract(surface.getPixel(x, y), derivBias), derivScale); + }; + + /** + * @param {Array} v + * @return {Array} + */ + es3fShaderDerivateTests.getCompExpBits = function(v) { + return [tcuFloat.newFloat32(v[0]).exponentBits(), + tcuFloat.newFloat32(v[1]).exponentBits(), + tcuFloat.newFloat32(v[2]).exponentBits(), + tcuFloat.newFloat32(v[3]).exponentBits()]; + }; + + /** + * @param {number} value + * @param {number} numAccurateBits + * @return {number} + */ + es3fShaderDerivateTests.computeFloatingPointError = function(value, numAccurateBits) { + /** @type {number} */ var numGarbageBits = 23 - numAccurateBits; + /** @type {number} */ var mask = (1 << numGarbageBits) - 1 ; + /** @type {number} */ var exp = tcuFloat.newFloat32(value).exponent(); + + return (new tcuFloat.deFloat()).construct(1, exp, (1 << 23) | mask).getValue() - (new tcuFloat.deFloat()).construct(1, exp, 1 << 23).getValue(); + }; + + /** + * @param {?gluShaderUtil.precision} precision + * @return {number} + */ + es3fShaderDerivateTests.getNumMantissaBits = function(precision) { + switch (precision) { + case gluShaderUtil.precision.PRECISION_HIGHP: return 23; + case gluShaderUtil.precision.PRECISION_MEDIUMP: return 10; + case gluShaderUtil.precision.PRECISION_LOWP: return 6; + default: + throw new Error('Precision not supported: ' + precision); + } + }; + + /** + * @param {?gluShaderUtil.precision} precision + * @return {number} + */ + es3fShaderDerivateTests.getMinExponent = function(precision) { + switch (precision) { + case gluShaderUtil.precision.PRECISION_HIGHP: return -126; + case gluShaderUtil.precision.PRECISION_MEDIUMP: return -14; + case gluShaderUtil.precision.PRECISION_LOWP: return -8; + default: + throw new Error('Precision not supported: ' + precision); + } + }; + + /** + * @param {number} exp + * @param {number} numMantissaBits + * @return {number} + */ + es3fShaderDerivateTests.getSingleULPForExponent = function(exp, numMantissaBits) { + if (numMantissaBits > 0) { + assertMsgOptions(numMantissaBits <= 23, 'numMantissaBits must be less or equal than 23.', false, true); + + /** @type {number} */ var ulpBitNdx = 23 - numMantissaBits; + + return (new tcuFloat.deFloat()).construct(1, exp, (1 << 23) | (1 << ulpBitNdx)).getValue() - (new tcuFloat.deFloat()).construct(1, exp, 1 << 23).getValue(); + } else { + assertMsgOptions(numMantissaBits === 0, 'numMantissaBits must equal to 0.', false, true); + return (new tcuFloat.deFloat()).construct(1, exp, (1 << 23)).getValue() + } + }; + + /** + * @param {number} value + * @param {number} numMantissaBits + * @return {number} + */ + es3fShaderDerivateTests.getSingleULPForValue = function(value, numMantissaBits) { + /** @type {number} */ var exp = (new tcuFloat.deFloat().deFloatNumber(value)).exponent(); + return es3fShaderDerivateTests.getSingleULPForExponent(exp, numMantissaBits); + }; + + /** + * @param {number} value + * @param {number} minExponent + * @param {number} numAccurateBits + * @return {number} + */ + es3fShaderDerivateTests.convertFloorFlushToZero = function(value, minExponent, numAccurateBits) { + if (value === 0.0) { + return 0.0; + } else { + /** @type {tcuFloat.deFloat} */ var inputFloat = new tcuFloat.deFloat().deFloatNumber(value); + /** @type {number} */ var numTruncatedBits = 23 - numAccurateBits; + /** @type {number} */ var truncMask = (1 << numTruncatedBits) - 1; + + if (value > 0.0) { + if (value > 0.0 && (new tcuFloat.deFloat().deFloatNumber(value)).exponent() < minExponent) { + // flush to zero if possible + return 0.0; + } else { + // just mask away non-representable bits + return (new tcuFloat.deFloat()).construct(1, inputFloat.exponent(), inputFloat.mantissa() & ~truncMask).getValue(); + } + } else { + if (inputFloat.mantissa() & truncMask) { + // decrement one ulp if truncated bits are non-zero (i.e. if value is not representable) + return (new tcuFloat.deFloat()).construct(-1, inputFloat.exponent(), inputFloat.mantissa() & ~truncMask).getValue() - es3fShaderDerivateTests.getSingleULPForExponent(inputFloat.exponent(), numAccurateBits); + } else { + // value is representable, no need to do anything + return value; + } + } + } + }; + + /** + * @param {number} value + * @param {number} minExponent + * @param {number} numAccurateBits + * @return {number} + */ + es3fShaderDerivateTests.convertCeilFlushToZero = function(value, minExponent, numAccurateBits) { + return -es3fShaderDerivateTests.convertFloorFlushToZero(-value, minExponent, numAccurateBits); + }; + + /** + * @param {number} value + * @param {number} numUlps + * @param {number} numMantissaBits + * @return {number} + */ + es3fShaderDerivateTests.addErrorUlp = function(value, numUlps, numMantissaBits) { + return value + numUlps * es3fShaderDerivateTests.getSingleULPForValue(value, numMantissaBits); + }; + + /** + * @param {?gluShaderUtil.precision} precision + * @param {Array} valueMin + * @param {Array} valueMax + * @param {Array} expectedDerivate + * @return {Array} + */ + es3fShaderDerivateTests.getDerivateThreshold = function(precision, valueMin, valueMax, expectedDerivate) { + /** @type {number} */ var baseBits = es3fShaderDerivateTests.getNumMantissaBits(precision); + /** @type {Array} */ var derivExp = es3fShaderDerivateTests.getCompExpBits(expectedDerivate); + /** @type {Array} */ var maxValueExp = deMath.max(es3fShaderDerivateTests.getCompExpBits(valueMin), es3fShaderDerivateTests.getCompExpBits(valueMax)); + /** @type {Array} */ var numBitsLost = deMath.subtract(maxValueExp, deMath.min(maxValueExp, derivExp)); + /** @type {Array} */ + var numAccurateBits = deMath.max( + deMath.addScalar( + deMath.subtract( + [baseBits, baseBits, baseBits, baseBits], + numBitsLost), + -es3fShaderDerivateTests.INTERPOLATION_LOST_BITS), + [0, 0, 0, 0]); + + return [es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[0], numAccurateBits[0]), + es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[1], numAccurateBits[1]), + es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[2], numAccurateBits[2]), + es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[3], numAccurateBits[3])]; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {?gluShaderUtil.DataType} dataType + * @param {Array} reference + * @param {Array} threshold + * @param {Array} scale + * @param {Array} bias + * @param {es3fShaderDerivateTests.VerificationLogging=} logPolicy + * @return {boolean} + */ + es3fShaderDerivateTests.verifyConstantDerivate = function(result, errorMask, dataType, reference, threshold, scale, bias, logPolicy) { + logPolicy = logPolicy === undefined ? es3fShaderDerivateTests.VerificationLogging.LOG_ALL : logPolicy; + /** @type {Array} */ var mask = deMath.logicalNotBool(es3fShaderDerivateTests.getDerivateMask(dataType)); + /** @type {number} */ var numFailedPixels = 0; + + if (logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL) + bufferedLogToConsole('Expecting ' + reference + ' with threshold ' + threshold); + + for (var y = 0; y < result.getHeight(); y++) { + for (var x = 0; x < result.getWidth(); x++) { + /** @type {Array} */ var resDerivate = es3fShaderDerivateTests.readDerivate(result, scale, bias, x, y); + /** @type {boolean} */ + var isOk = deMath.boolAll( + deMath.logicalOrBool( + deMath.lessThanEqual( + deMath.abs(deMath.subtract(reference, resDerivate)), + threshold), + mask)); + + if (!isOk) { + if (numFailedPixels < es3fShaderDerivateTests.MAX_FAILED_MESSAGES && logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL) + bufferedLogToConsole('FAIL: got ' + resDerivate + ', diff = ' + deMath.abs(deMath.subtract(reference, resDerivate)) + ', at x = ' + x + ', y = ' + y); + numFailedPixels += 1; + errorMask.setPixel(tcuRGBA.RGBA.red.toVec(), x, y); + } + } + } + + if (numFailedPixels >= es3fShaderDerivateTests.MAX_FAILED_MESSAGES && logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL) + bufferedLogToConsole('...'); + + if (numFailedPixels > 0 && logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL) + bufferedLogToConsole('FAIL: found ' + numFailedPixels + ' failed pixels'); + + return numFailedPixels === 0; + }; + + /** + * .-----. + * | s_x | + * M x | s_y | + * | 1.0 | + * '-----' + * @struct + * @constructor + */ + es3fShaderDerivateTests.Linear2DFunctionEvaluator = function() { + /** @type {tcuMatrix.Matrix} */ this.matrix = new tcuMatrix.Matrix(4, 3); + }; + + es3fShaderDerivateTests.Linear2DFunctionEvaluator.prototype.evaluateAt = function(screenX, screenY) { + /** @type {Array} */ var position = [screenX, screenY, 1.0]; + return tcuMatrix.multiplyMatVec(this.matrix, position); + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {?gluShaderUtil.DataType} dataType + * @param {?gluShaderUtil.precision} precision + * @param {Array} derivScale + * @param {Array} derivBias + * @param {Array} surfaceThreshold + * @param {es3fShaderDerivateTests.DerivateFunc} derivateFunc + * @param {es3fShaderDerivateTests.Linear2DFunctionEvaluator} func + * @return {boolean} + */ + es3fShaderDerivateTests.reverifyConstantDerivateWithFlushRelaxations = function(result, errorMask, dataType, precision, derivScale, derivBias, surfaceThreshold, derivateFunc, func) { + assertMsgOptions(result.getWidth() === errorMask.getWidth(), 'Dimensions of result and errorMask inconsistent.', false, true); + assertMsgOptions(result.getHeight() === errorMask.getHeight(), 'Dimensions of result and errorMask inconsistent.', false, true); + assertMsgOptions(derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX || derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDY, 'Derivate Function should be DFDX or DFDY.', false, true); + + /** @type {Array} */ var red = [255, 0, 0, 255]; + /** @type {Array} */ var green = [0, 255, 0, 255]; + /** @type {number} */ var divisionErrorUlps = 2.5; + + /** @type {number} */ var numComponents = gluShaderUtil.getDataTypeScalarTypeAsDataType(dataType); + /** @type {number} */ var numBits = es3fShaderDerivateTests.getNumMantissaBits(precision); + /** @type {number} */ var minExponent = es3fShaderDerivateTests.getMinExponent(precision); + + /** @type {number} */ var numVaryingSampleBits = numBits - es3fShaderDerivateTests.INTERPOLATION_LOST_BITS; + /** @type {number} */ var numFailedPixels = 0; + + errorMask.clear(green); + + // search for failed pixels + for (var y = 0; y < result.getHeight(); ++y) + for (var x = 0; x < result.getWidth(); ++x) { + // flushToZero?(f2z?(functionValueCurrent) - f2z?(functionValueBefore)) + // flushToZero? ( ------------------------------------------------------------------------ +- 2.5 ULP ) + // dx + + /** @type {Array} */ var resultDerivative = es3fShaderDerivateTests.readDerivate(result, derivScale, derivBias, x, y); + + // sample at the front of the back pixel and the back of the front pixel to cover the whole area of + // legal sample positions. In general case this is NOT OK, but we know that the target funtion is + // (mostly*) linear which allows us to take the sample points at arbitrary points. This gets us the + // maximum difference possible in exponents which are used in error bound calculations. + // * non-linearity may happen around zero or with very high function values due to subnorms not + // behaving well. + /** @type {Array} */ var functionValueForward = (derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX) ? + (func.evaluateAt(x + 2.0, y + 0.5)) : + (func.evaluateAt(x + 0.5, y + 2.0)); + /** @type {Array} */ var functionValueBackward = (derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX) ? + (func.evaluateAt(x - 1.0, y + 0.5)) : + (func.evaluateAt(x + 0.5, y - 1.0)); + + /** @type {boolean} */ var anyComponentFailed = false; + + // check components separately + for (var c = 0; c < numComponents; ++c) { + // interpolation value range + /** @type {tcuInterval.Interval} */ var forwardComponent = tcuInterval.withIntervals( + new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero( + es3fShaderDerivateTests.addErrorUlp(functionValueForward[c], -0.5, numVaryingSampleBits), minExponent, numBits)), + new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero( + es3fShaderDerivateTests.addErrorUlp(functionValueForward[c], +0.5, numVaryingSampleBits), minExponent, numBits)) + ); + + /** @type {tcuInterval.Interval} */ var backwardComponent = tcuInterval.withIntervals( + new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero( + es3fShaderDerivateTests.addErrorUlp(functionValueBackward[c], -0.5, numVaryingSampleBits), minExponent, numBits)), + new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero( + es3fShaderDerivateTests.addErrorUlp(functionValueBackward[c], +0.5, numVaryingSampleBits), minExponent, numBits)) + ); + + /** @type {number} */ + var maxValueExp = Math.max( + (new tcuFloat.deFloat().deFloatNumber(forwardComponent.lo())).exponent(), + (new tcuFloat.deFloat().deFloatNumber(forwardComponent.hi())).exponent(), + (new tcuFloat.deFloat().deFloatNumber(backwardComponent.lo())).exponent(), + (new tcuFloat.deFloat().deFloatNumber(backwardComponent.hi())).exponent()); + + // subtraction in nominator will likely cause a cancellation of the most + // significant bits. Apply error bounds. + /** @type {tcuInterval.Interval} */ var nominator = tcuInterval.Interval.operatorSub(forwardComponent, backwardComponent); + /** @type {number} */ var nominatorLoExp = (new tcuFloat.deFloat().deFloatNumber(nominator.lo())).exponent(); + /** @type {number} */ var nominatorHiExp = (new tcuFloat.deFloat().deFloatNumber(nominator.hi())).exponent(); + /** @type {number} */ var nominatorLoBitsLost = maxValueExp - nominatorLoExp; + /** @type {number} */ var nominatorHiBitsLost = maxValueExp - nominatorHiExp; + /** @type {number} */ var nominatorLoBits = Math.max(0, numBits - nominatorLoBitsLost); + /** @type {number} */ var nominatorHiBits = Math.max(0, numBits - nominatorHiBitsLost); + + /** @type {tcuInterval.Interval} */ var nominatorRange = tcuInterval.withIntervals( + new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero(nominator.lo(), minExponent, nominatorLoBits)), + new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero(nominator.hi(), minExponent, nominatorHiBits))); + // + /** @type {tcuInterval.Interval} */ var divisionRange = tcuInterval.Interval.operatorDiv(nominatorRange, new tcuInterval.Interval(3.0)); // legal sample area is anywhere within this and neighboring pixels (i.e. size = 3) + /** @type {tcuInterval.Interval} */ var divisionResultRange = tcuInterval.withIntervals( + new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero(es3fShaderDerivateTests.addErrorUlp(divisionRange.lo(), -divisionErrorUlps, numBits), minExponent, numBits)), + new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero(es3fShaderDerivateTests.addErrorUlp(divisionRange.hi(), divisionErrorUlps, numBits), minExponent, numBits))); + /** @type {tcuInterval.Interval} */ var finalResultRange = tcuInterval.withIntervals( + new tcuInterval.Interval(divisionResultRange.lo() - surfaceThreshold[c]), + new tcuInterval.Interval(divisionResultRange.hi() + surfaceThreshold[c])); + + if (resultDerivative[c] >= finalResultRange.lo() && resultDerivative[c] <= finalResultRange.hi()) { + // value ok + } else { + if (numFailedPixels < es3fShaderDerivateTests.MAX_FAILED_MESSAGES) + bufferedLogToConsole('Error in pixel at ' + x + ', ' + y + ' with component ' + c + ' (channel ' + ('rgba'[c]) + ')\n' + + '\tGot pixel value ' + result.getPixelInt(x, y) + '\n' + + '\t\tdFd' + ((derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX) ? 'x' : 'y') + ' ~= ' + resultDerivative[c] + '\n' + + '\t\tdifference to a valid range: ' + + ((resultDerivative[c] < finalResultRange.lo()) ? '-' : '+') + + ((resultDerivative[c] < finalResultRange.lo()) ? (finalResultRange.lo() - resultDerivative[c]) : (resultDerivative[c] - finalResultRange.hi())) + + '\n' + + '\tDerivative value range:\n' + + '\t\tMin: ' + finalResultRange.lo() + '\n' + + '\t\tMax: ' + finalResultRange.hi() + '\n'); + + ++numFailedPixels; + anyComponentFailed = true; + } + } + + if (anyComponentFailed) + errorMask.setPixel(red, x, y); + } + + if (numFailedPixels >= es3fShaderDerivateTests.MAX_FAILED_MESSAGES) + bufferedLogToConsole('...'); + + if (numFailedPixels > 0) + bufferedLogToConsole('FAIL: found ' + numFailedPixels + ' failed pixels'); + + return numFailedPixels === 0; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + es3fShaderDerivateTests.TriangleDerivateCase = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {?gluShaderUtil.DataType} */ this.m_dataType = null; + /** @type {?gluShaderUtil.precision} */ this.m_precision = null; + + /** @type {?gluShaderUtil.DataType} */ this.m_coordDataType = null; + /** @type {?gluShaderUtil.precision} */ this.m_coordPrecision = null; + + /** @type {string} */ this.m_fragmentSrc; + + /** @type {Array} */ this.m_coordMin = []; + /** @type {Array} */ this.m_coordMax = []; + /** @type {Array} */ this.m_derivScale = []; + /** @type {Array} */ this.m_derivBias = []; + + /** @type {es3fShaderDerivateTests.SurfaceType} */ this.m_surfaceType = es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER; + /** @type {number} */ this.m_numSamples = 0; + /** @type {number} */ this.m_hint = gl.DONT_CARE; + + assertMsgOptions(this.m_surfaceType !== es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER || this.m_numSamples === 0, 'Did not expect surfaceType = DEFAULT_FRAMEBUFFER or numSamples = 0', false, true); + }; + + es3fShaderDerivateTests.TriangleDerivateCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderDerivateTests.TriangleDerivateCase.prototype.constructor = es3fShaderDerivateTests.TriangleDerivateCase; + + es3fShaderDerivateTests.TriangleDerivateCase.prototype.deinit = function() {}; + + /** @param {WebGLProgram} program */ + es3fShaderDerivateTests.TriangleDerivateCase.prototype.setupRenderState = function(program) {}; + + /** + * @param {?gluShaderUtil.DataType} coordType + * @param {?gluShaderUtil.precision} precision + * @return {string} + */ + es3fShaderDerivateTests.genVertexSource = function(coordType, precision) { + assertMsgOptions(gluShaderUtil.isDataTypeFloatOrVec(coordType), 'Coord Type not supported', false, true); + + /** @type {string} */ var vertexTmpl = '' + + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in ${PRECISION} ${DATATYPE} a_coord;\n' + + 'out ${PRECISION} ${DATATYPE} v_coord;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + ' v_coord = a_coord;\n' + + '}\n'; + + /** @type {Object} */ var vertexParams = {}; + + vertexParams['PRECISION'] = gluShaderUtil.getPrecisionName(precision); + vertexParams['DATATYPE'] = gluShaderUtil.getDataTypeName(coordType); + + return tcuStringTemplate.specialize(vertexTmpl, vertexParams); + }; + + /** + * @return {Array} + */ + es3fShaderDerivateTests.TriangleDerivateCase.prototype.getViewportSize = function() { + if (this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER) { + /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, es3fShaderDerivateTests.VIEWPORT_WIDTH); + /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, es3fShaderDerivateTests.VIEWPORT_HEIGHT); + return [width, height]; + } else + return [es3fShaderDerivateTests.FBO_WIDTH, es3fShaderDerivateTests.FBO_HEIGHT]; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderDerivateTests.TriangleDerivateCase.prototype.iterate = function() { + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fShaderDerivateTests.genVertexSource(this.m_coordDataType, this.m_coordPrecision), this.m_fragmentSrc)); + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xbbc24); + /** @type {boolean} */ var useFbo = this.m_surfaceType != es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER; + /** @type {number} */ var fboFormat = this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO ? gl.RGBA32UI : gl.RGBA8; + /** @type {Array} */ var viewportSize = this.getViewportSize(); + /** @type {number} */ var viewportX = useFbo ? 0 : rnd.getInt(0, gl.drawingBufferWidth - viewportSize[0]); + /** @type {number} */ var viewportY = useFbo ? 0 : rnd.getInt(0, gl.drawingBufferHeight - viewportSize[1]); + /** @type {?WebGLFramebuffer} */ var fbo = null; + /** @type {?WebGLRenderbuffer} */ var rbo = null; + /** @type {tcuTexture.TextureLevel} */ var result = null; + + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) + assertMsgOptions(false, 'Compile failed', false, true); + + if (useFbo) { + bufferedLogToConsole('Rendering to FBO, format = ' + wtu.glEnumToString(gl, fboFormat) + ', samples = ' + this.m_numSamples); + + fbo = gl.createFramebuffer(); + rbo = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, fboFormat, viewportSize[0], viewportSize[1]); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo); + } else { + /** @type {tcuPixelFormat.PixelFormat} */ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + + bufferedLogToConsole('Rendering to default framebuffer\n' + + '\tColor depth: R=' + pixelFormat.redBits + ', G=' + pixelFormat.greenBits + ', B=' + pixelFormat.blueBits + ', A=' + pixelFormat.alphaBits); + } + + bufferedLogToConsole('in: ' + this.m_coordMin + ' ' + this.m_coordMax + '\n' + + 'v_coord.x = in.x * x\n' + + 'v_coord.y = in.y * y\n' + + 'v_coord.z = in.z * (x+y)/2\n' + + 'v_coord.w = in.w * (1 - (x+y)/2)\n' + + '\n' + + 'u_scale: ' + this.m_derivScale + ', u_bias: ' + this.m_derivBias + ' (displayed values have scale/bias removed)' + + 'Viewport: ' + viewportSize[0] + 'x' + viewportSize[1] + + 'gl.FRAGMENT_SHADER_DERIVATE_HINT: ' + wtu.glEnumToString(gl, this.m_hint)); + // Draw + /** @type {Array} */ var positions = [ + -1.0, -1.0, 0.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0 + ]; + + /** @type {Array} */ var coords =[ + this.m_coordMin[0], this.m_coordMin[1], this.m_coordMin[2], this.m_coordMax[3], + this.m_coordMin[0], this.m_coordMax[1], (this.m_coordMin[2] + this.m_coordMax[2]) * 0.5, (this.m_coordMin[3]+this.m_coordMax[3]) * 0.5, + this.m_coordMax[0], this.m_coordMin[1], (this.m_coordMin[2] + this.m_coordMax[2]) * 0.5, (this.m_coordMin[3]+this.m_coordMax[3]) * 0.5, + this.m_coordMax[0], this.m_coordMax[1], this.m_coordMax[2], this.m_coordMin[3] + ]; + + /** @type {Array} */ var vertexArrays = [ + gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions), + gluDrawUtil.newFloatVertexArrayBinding('a_coord', 4, 4, 0, coords) + ]; + + /** @type {Array} */ var indices = [0, 2, 1, 2, 3, 1]; + + gl.clearColor(0.125, 0.25, 0.5, 1.0); + // We can't really call clear() on gl.COLOR_BUFFER_BIT here as in c++ deqp. + // The fbo format might be of integer type and WebGL2 requires an INVALID_OPERATION to be generated. + var formatObj = gluTextureUtil.mapGLInternalFormat(fboFormat); + var fmtClass = tcuTexture.getTextureChannelClass(formatObj.type); + switch (fmtClass) { + case tcuTexture.TextureChannelClass.FLOATING_POINT: + case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT: + case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + break; + case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: + gl.clearBufferuiv(gl.COLOR, 0, new Uint32Array([31, 63, 127, 255])); + gl.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + break; + case tcuTexture.TextureChannelClass.SIGNED_INTEGER: + gl.clearBufferiv(gl.COLOR, 0, new Int32Array([31, 63, 127, 255])); + gl.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + break; + default: + throw new Error('Invalid channelclass ' + fmtClass); + } + gl.disable(gl.DITHER); + + gl.useProgram(program.getProgram()); + + /** @type {WebGLUniformLocation} */ var scaleLoc = gl.getUniformLocation(program.getProgram(), 'u_scale'); + /** @type {WebGLUniformLocation} */ var biasLoc = gl.getUniformLocation(program.getProgram(), 'u_bias'); + + switch (this.m_dataType) { + case gluShaderUtil.DataType.FLOAT: + gl.uniform1f(scaleLoc, this.m_derivScale[0]); + gl.uniform1f(biasLoc, this.m_derivBias[0]); + break; + + case gluShaderUtil.DataType.FLOAT_VEC2: + gl.uniform2fv(scaleLoc, this.m_derivScale.slice(0,2)); + gl.uniform2fv(biasLoc, this.m_derivBias.slice(0,2)); + break; + + case gluShaderUtil.DataType.FLOAT_VEC3: + gl.uniform3fv(scaleLoc, this.m_derivScale.slice(0,3)); + gl.uniform3fv(biasLoc, this.m_derivBias.slice(0,3)); + break; + + case gluShaderUtil.DataType.FLOAT_VEC4: + gl.uniform4fv(scaleLoc, this.m_derivScale); + gl.uniform4fv(biasLoc, this.m_derivBias); + break; + + default: + throw new Error('Data Type not supported: ' + this.m_dataType); + } + + glsShaderRenderCase.setupDefaultUniforms(program.getProgram()); + this.setupRenderState(program.getProgram()); + + gl.hint(gl.FRAGMENT_SHADER_DERIVATIVE_HINT, this.m_hint); + + gl.viewport(viewportX, viewportY, viewportSize[0], viewportSize[1]); + gluDrawUtil.draw(gl, program.getProgram(), vertexArrays, gluDrawUtil.triangles(indices)); + + // Read back results + + /** @type {boolean} */ var isMSAA = useFbo && this.m_numSamples > 0; + /** @type {?WebGLFramebuffer} */ var resFbo = null; + /** @type {?WebGLRenderbuffer} */ var resRbo = null; + + // Resolve if necessary + if (isMSAA) { + resFbo = gl.createFramebuffer(); + resRbo = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, resRbo); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, fboFormat, viewportSize[0], viewportSize[1]); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, resFbo); + gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, resRbo); + + gl.blitFramebuffer(0, 0, viewportSize[0], viewportSize[1], 0, 0, viewportSize[0], viewportSize[1], gl.COLOR_BUFFER_BIT, gl.NEAREST); + + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, resFbo); + } + switch (this.m_surfaceType) { + case es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER: + case es3fShaderDerivateTests.SurfaceType.UNORM_FBO: + var dataFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8); + result = new tcuTexture.TextureLevel(dataFormat, viewportSize[0], viewportSize[1]); + gluPixelTransfer.readPixels(gl, viewportX, viewportY, dataFormat, result); + break; + + case es3fShaderDerivateTests.SurfaceType.FLOAT_FBO: + var dataFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT); + var transferFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32); + result = new tcuTexture.TextureLevel(dataFormat, viewportSize[0], viewportSize[1]); + gluPixelTransfer.readPixels(gl, viewportX, viewportY, transferFormat, result); + break; + + default: + throw new Error('Surface Type not supported: ' + this.m_surfaceType); + } + + // Verify + /** @type {tcuSurface.Surface} */ + var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + + errorMask.getAccess().clear(tcuRGBA.RGBA.green.toVec()); + + /** @type {boolean} */ var isOk = this.verify(result.getAccess(), errorMask.getAccess()); + + if (!isOk) { + tcuLogImage.logImage('Rendered', 'Rendered image', result.getAccess()); + tcuLogImage.logImage('ErrorMask', 'Error mask', errorMask.getAccess()); + testFailedOptions('Fail', false); + } else + testPassedOptions('Pass', true); + + // Cleaning up buffers + gl.deleteFramebuffer(fbo); + gl.deleteRenderbuffer(rbo); + gl.deleteFramebuffer(resFbo); + gl.deleteRenderbuffer(resRbo); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @return {Array} + */ + es3fShaderDerivateTests.TriangleDerivateCase.prototype.getSurfaceThreshold = function() { + switch (this.m_surfaceType) { + case es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER: + /** @type {tcuPixelFormat.PixelFormat} */ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + /** @type {Array} */ var channelBits = [pixelFormat.redBits, pixelFormat.greenBits, pixelFormat.blueBits, pixelFormat.alphaBits]; + /** @type {Array} */ var intThreshold = deMath.arrayShiftLeft([1, 1, 1, 1], deMath.subtract([8, 8, 8, 8], channelBits)); + /** @type {Array} */ var normThreshold = deMath.scale(intThreshold, 1.0/255.0); + + return normThreshold; + + case es3fShaderDerivateTests.SurfaceType.UNORM_FBO: return deMath.scale([1, 1, 1, 1], 1.0/255.0); + case es3fShaderDerivateTests.SurfaceType.FLOAT_FBO: return [0.0, 0.0, 0.0, 0.0]; + default: + assertMsgOptions(false, 'Surface Type not supported. Falling back to default retun value [0.0, 0.0, 0.0, 0.0]', false, false); + return [0.0, 0.0, 0.0, 0.0]; + } + }; + + /** + * @constructor + * @extends {es3fShaderDerivateTests.TriangleDerivateCase} + * @param {string} name + * @param {string} description + * @param {es3fShaderDerivateTests.DerivateFunc} func + * @param {gluShaderUtil.DataType} type + */ + es3fShaderDerivateTests.ConstantDerivateCase = function(name, description, func, type) { + es3fShaderDerivateTests.TriangleDerivateCase.call(this, name, description); + /** @type {es3fShaderDerivateTests.DerivateFunc} */ this.m_func = func; + this.m_dataType = type; + this.m_precision = gluShaderUtil.precision.PRECISION_HIGHP; + this.m_coordDataType = this.m_dataType; + this.m_coordPrecision = this.m_precision; + }; + + es3fShaderDerivateTests.ConstantDerivateCase.prototype = Object.create(es3fShaderDerivateTests.TriangleDerivateCase.prototype); + es3fShaderDerivateTests.ConstantDerivateCase.prototype.constructor = es3fShaderDerivateTests.ConstantDerivateCase; + + es3fShaderDerivateTests.ConstantDerivateCase.prototype.init = function() { + /** @type {string} */ var fragmentTmpl = '' + + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res = ${FUNC}(${VALUE}) * u_scale + u_bias;\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'; + + /** @type {Object} */ var fragmentParams = {}; + fragmentParams['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_precision); + fragmentParams['DATATYPE'] = gluShaderUtil.getDataTypeName(this.m_dataType); + fragmentParams['FUNC'] = es3fShaderDerivateTests.getDerivateFuncName(this.m_func); + fragmentParams['VALUE'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'vec4(1.0, 7.2, -1e5, 0.0)' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec3(1e2, 8.0, 0.01)' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec2(-0.0, 2.7)' : + '7.7'; + fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'res' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec4(res, 1.0)' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec4(res, 0.0, 1.0)' : + 'vec4(res, 0.0, 0.0, 1.0)'; + + this.m_fragmentSrc = tcuStringTemplate.specialize(fragmentTmpl, fragmentParams); + + this.m_derivScale = [1e3, 1e3, 1e3, 1e3]; + this.m_derivBias = [0.5, 0.5, 0.5, 0.5]; + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.PixelBufferAccess} errorMask + * @return {boolean} + */ + es3fShaderDerivateTests.ConstantDerivateCase.prototype.verify = function(result, errorMask) { + /** @type {Array} */ var reference = [0.0, 0.0, 0.0, 0.0]; // Derivate of constant argument should always be 0 + /** @type {Array} */ var threshold = deMath.divide(this.getSurfaceThreshold(), deMath.abs(this.m_derivScale)); + return es3fShaderDerivateTests.verifyConstantDerivate(result, errorMask, this.m_dataType, + reference, threshold, this.m_derivScale, this.m_derivBias); + }; + + /** + * @constructor + * @extends {es3fShaderDerivateTests.TriangleDerivateCase} + * @param {string} name + * @param {string} description + * @param {es3fShaderDerivateTests.DerivateFunc} func + * @param {gluShaderUtil.DataType} type + * @param {gluShaderUtil.precision} precision + * @param {number} hint + * @param {es3fShaderDerivateTests.SurfaceType} surfaceType + * @param {number} numSamples + * @param {string} fragmentSrcTmpl + */ + es3fShaderDerivateTests.LinearDerivateCase = function(name, description, func, type, precision, hint, surfaceType, numSamples, fragmentSrcTmpl) { + es3fShaderDerivateTests.TriangleDerivateCase.call(this, name, description); + /** @type {es3fShaderDerivateTests.DerivateFunc} */ this.m_func = func; + /** @type {string} */ this.m_fragmentTmpl = fragmentSrcTmpl; + this.m_dataType = type; + this.m_precision = precision; + this.m_coordDataType = this.m_dataType; + this.m_coordPrecision = this.m_precision; + this.m_hint = hint; + this.m_surfaceType = surfaceType; + this.m_numSamples = numSamples; + }; + + es3fShaderDerivateTests.LinearDerivateCase.prototype = Object.create(es3fShaderDerivateTests.TriangleDerivateCase.prototype); + es3fShaderDerivateTests.LinearDerivateCase.prototype.constructor = es3fShaderDerivateTests.LinearDerivateCase; + + es3fShaderDerivateTests.LinearDerivateCase.prototype.init = function() { + /** @type {Array} */ var viewportSize = this.getViewportSize(); + /** @type {number} */ var w = viewportSize[0]; + /** @type {number} */ var h = viewportSize[1]; + /** @type {boolean} */ var packToInt = this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO; + + /** @type {Object} */ var fragmentParams = {}; + fragmentParams['OUTPUT_TYPE'] = gluShaderUtil.getDataTypeName(packToInt ? gluShaderUtil.DataType.UINT_VEC4 : gluShaderUtil.DataType.FLOAT_VEC4); + fragmentParams['OUTPUT_PREC'] = gluShaderUtil.getPrecisionName(packToInt ? gluShaderUtil.precision.PRECISION_HIGHP : this.m_precision); + fragmentParams['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_precision); + fragmentParams['DATATYPE'] = gluShaderUtil.getDataTypeName(this.m_dataType); + fragmentParams['FUNC'] = es3fShaderDerivateTests.getDerivateFuncName(this.m_func); + + if (packToInt) { + fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'floatBitsToUint(res)' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'floatBitsToUint(vec4(res, 1.0))' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'floatBitsToUint(vec4(res, 0.0, 1.0))' : + 'floatBitsToUint(vec4(res, 0.0, 0.0, 1.0))'; + } else { + fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'res' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec4(res, 1.0)' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec4(res, 0.0, 1.0)' : + 'vec4(res, 0.0, 0.0, 1.0)'; + } + + this.m_fragmentSrc = tcuStringTemplate.specialize(this.m_fragmentTmpl, fragmentParams); + + switch (this.m_precision) { + case gluShaderUtil.precision.PRECISION_HIGHP: + this.m_coordMin = [-97., 0.2, 71., 74.]; + this.m_coordMax = [-13.2, -77., 44., 76.]; + break; + + case gluShaderUtil.precision.PRECISION_MEDIUMP: + this.m_coordMin = [-37.0, 47., -7., 0.0]; + this.m_coordMax = [-1.0, 12., 7., 19.]; + break; + + case gluShaderUtil.precision.PRECISION_LOWP: + this.m_coordMin = [0.0, -1.0, 0.0, 1.0]; + this.m_coordMax = [1.0, 1.0, -1.0, -1.0]; + break; + + default: + throw new Error('Precision not supported: ' + this.m_precision); + } + + if (this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO) { + // No scale or bias used for accuracy. + this.m_derivScale = [1.0, 1.0, 1.0, 1.0]; + this.m_derivBias = [0.0, 0.0, 0.0, 0.0]; + } else { + // Compute scale - bias that normalizes to 0..1 range. + /** @type {Array} */ var dx = deMath.divide(deMath.subtract(this.m_coordMax, this.m_coordMin), [w, w, w * 0.5, -w * 0.5]); + /** @type {Array} */ var dy = deMath.divide(deMath.subtract(this.m_coordMax, this.m_coordMin), [h, h, h * 0.5, -h * 0.5]); + + switch (this.m_func) { + case es3fShaderDerivateTests.DerivateFunc.DFDX: + this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dx); + break; + + case es3fShaderDerivateTests.DerivateFunc.DFDY: + this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dy); + break; + + case es3fShaderDerivateTests.DerivateFunc.FWIDTH: + this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], deMath.add(deMath.abs(dx), deMath.abs(dy))); + break; + + default: + throw new Error('Derivate Function not supported: ' + this.m_func); + } + + this.m_derivBias = [0.0, 0.0, 0.0, 0.0]; + } + }; + + /** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.PixelBufferAccess} errorMask + * @return {boolean} + */ + es3fShaderDerivateTests.LinearDerivateCase.prototype.verify = function(result, errorMask) { + /** @type {Array} */ var xScale = [1.0, 0.0, 0.5, -0.5]; + /** @type {Array} */ var yScale = [0.0, 1.0, 0.5, -0.5]; + /** @type {Array} */ var surfaceThreshold = deMath.divide(this.getSurfaceThreshold(), deMath.abs(this.m_derivScale)); + + /** @type {number} */ var w; + /** @type {number} */ var h; + /** @type {Array} */ var reference; + /** @type {Array} */ var threshold; + + if (this.m_func === es3fShaderDerivateTests.DerivateFunc.DFDX || this.m_func === es3fShaderDerivateTests.DerivateFunc.DFDY) { + /** @type {boolean} */ var isX = this.m_func === es3fShaderDerivateTests.DerivateFunc.DFDX; + /** @type {number} */ var div = isX ? result.getWidth() : result.getHeight(); + /** @type {Array} */ var scale = isX ? xScale : yScale; + reference = deMath.multiply(deMath.scale(deMath.subtract(this.m_coordMax, this.m_coordMin), 1/div), scale); + /** @type {Array} */ var opThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_coordMin, scale), deMath.multiply(this.m_coordMax, scale), reference); + threshold = deMath.max(surfaceThreshold, opThreshold); + bufferedLogToConsole('Verifying result image.\n' + + '\tValid derivative is ' + reference + ' with threshold ' + threshold); + + // short circuit if result is strictly within the normal value error bounds. + // This improves performance significantly. + if (es3fShaderDerivateTests.verifyConstantDerivate(result, errorMask, + this.m_dataType, reference, threshold, this.m_derivScale, + this.m_derivBias, es3fShaderDerivateTests.VerificationLogging.LOG_NOTHING)) { + bufferedLogToConsole('No incorrect derivatives found, result valid.'); + return true; + } + + // some pixels exceed error bounds calculated for normal values. Verify that these + // potentially invalid pixels are in fact valid due to (for example) subnorm flushing. + + bufferedLogToConsole('Initial verification failed, verifying image by calculating accurate error bounds for each result pixel.\n' + + '\tVerifying each result derivative is within its range of legal result values.'); + + /** @type {Array} */ var viewportSize = this.getViewportSize(); + /** @type {Array} */ var valueRamp = deMath.subtract(this.m_coordMax, this.m_coordMin); + /** @type {es3fShaderDerivateTests.Linear2DFunctionEvaluator} */ var function_ = new es3fShaderDerivateTests.Linear2DFunctionEvaluator(); + w = viewportSize[0]; + h = viewportSize[1]; + + function_.matrix.setRow(0, [valueRamp[0] / w, 0.0, this.m_coordMin[0]]); + function_.matrix.setRow(1, [0.0, valueRamp[1] / h, this.m_coordMin[1]]); + function_.matrix.setRow(2, deMath.scale([valueRamp[2] / w, valueRamp[2] / h, this.m_coordMin[2] + this.m_coordMin[2]], 1 / 2.0)); + function_.matrix.setRow(3, deMath.scale([-valueRamp[3] / w, -valueRamp[3] / h, this.m_coordMax[3] + this.m_coordMax[3]], 1 / 2.0)); + + return es3fShaderDerivateTests.reverifyConstantDerivateWithFlushRelaxations( + result, errorMask, this.m_dataType, this.m_precision, this.m_derivScale, + this.m_derivBias, surfaceThreshold, this.m_func, function_); + } else { + assertMsgOptions(this.m_func === es3fShaderDerivateTests.DerivateFunc.FWIDTH, 'Expected DerivateFunc.FWIDTH', false, true); + w = result.getWidth(); + h = result.getHeight(); + + /** @type {Array} */ var dx = deMath.multiply(deMath.scale(deMath.subtract(this.m_coordMax, this.m_coordMin), 1 / w), xScale); + /** @type {Array} */ var dy = deMath.multiply(deMath.scale(deMath.subtract(this.m_coordMax, this.m_coordMin), 1 / h), yScale); + reference = deMath.add(deMath.abs(dx), deMath.abs(dy)); + /** @type {Array} */ var dxThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_coordMin, xScale), deMath.multiply(this.m_coordMax, xScale), dx); + /** @type {Array} */ var dyThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_coordMin, yScale), deMath.multiply(this.m_coordMax, yScale), dy); + threshold = deMath.max(surfaceThreshold, deMath.max(dxThreshold, dyThreshold)); + + return es3fShaderDerivateTests.verifyConstantDerivate(result, errorMask, this.m_dataType, + reference, threshold, this.m_derivScale, this.m_derivBias); + } + }; + + /** + * @constructor + * @extends {es3fShaderDerivateTests.TriangleDerivateCase} + * @param {string} name + * @param {string} description + * @param {es3fShaderDerivateTests.DerivateFunc} func + * @param {gluShaderUtil.DataType} type + * @param {gluShaderUtil.precision} precision + * @param {number} hint + * @param {es3fShaderDerivateTests.SurfaceType} surfaceType + * @param {number} numSamples + */ + es3fShaderDerivateTests.TextureDerivateCase = function(name, description, func, type, precision, hint, surfaceType, numSamples) { + es3fShaderDerivateTests.TriangleDerivateCase.call(this, name, description); + /** @type {es3fShaderDerivateTests.DerivateFunc} */ this.m_func = func; + /** @type {gluTexture.Texture2D} */ this.m_texture = null; + /** @type {Array} */ this.m_texValueMin = []; + /** @type {Array} */ this.m_texValueMax = []; + this.m_dataType = type; + this.m_precision = precision; + this.m_coordDataType = gluShaderUtil.DataType.FLOAT_VEC2; + this.m_coordPrecision = gluShaderUtil.precision.PRECISION_HIGHP; + this.m_hint = hint; + this.m_surfaceType = surfaceType; + this.m_numSamples = numSamples; + }; + + es3fShaderDerivateTests.TextureDerivateCase.prototype = Object.create(es3fShaderDerivateTests.TriangleDerivateCase.prototype); + es3fShaderDerivateTests.TextureDerivateCase.prototype.constructor = es3fShaderDerivateTests.TextureDerivateCase; + + es3fShaderDerivateTests.TextureDerivateCase.prototype.deinit = function() { + this.m_texture = null; + }; + + es3fShaderDerivateTests.TextureDerivateCase.prototype.init = function() { + // Generate shader + /** @type {string} */ var fragmentTmpl = '' + + '#version 300 es\n' + + 'in highp vec2 v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} sampler2D u_sampler;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} vec4 tex = texture(u_sampler, v_coord);\n' + + ' ${PRECISION} ${DATATYPE} res = ${FUNC}(tex${SWIZZLE}) * u_scale + u_bias;\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'; + + /** @type {boolean} */ var packToInt = this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO; + /** @type {Object} */ var fragmentParams = {}; + /** @type {Array} */ var viewportSize; + fragmentParams['OUTPUT_TYPE'] = gluShaderUtil.getDataTypeName(packToInt ? gluShaderUtil.DataType.UINT_VEC4 : gluShaderUtil.DataType.FLOAT_VEC4); + fragmentParams['OUTPUT_PREC'] = gluShaderUtil.getPrecisionName(packToInt ? gluShaderUtil.precision.PRECISION_HIGHP : this.m_precision); + fragmentParams['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_precision); + fragmentParams['DATATYPE'] = gluShaderUtil.getDataTypeName(this.m_dataType); + fragmentParams['FUNC'] = es3fShaderDerivateTests.getDerivateFuncName(this.m_func); + fragmentParams['SWIZZLE'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? '' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? '.xyz' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? '.xy' : + '.x'; + + if (packToInt) { + fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'floatBitsToUint(res)' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'floatBitsToUint(vec4(res, 1.0))' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'floatBitsToUint(vec4(res, 0.0, 1.0))' : + 'floatBitsToUint(vec4(res, 0.0, 0.0, 1.0))'; + } else { + fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'res' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec4(res, 1.0)' : + this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec4(res, 0.0, 1.0)' : + 'vec4(res, 0.0, 0.0, 1.0)'; + } + + this.m_fragmentSrc = tcuStringTemplate.specialize(fragmentTmpl, fragmentParams); + + // Texture size matches viewport and nearest sampling is used. Thus texture sampling + // is equal to just interpolating the texture value range. + + // Determine value range for texture. + + switch (this.m_precision) { + case gluShaderUtil.precision.PRECISION_HIGHP: + this.m_texValueMin = [-97., 0.2, 71., 74.]; + this.m_texValueMax = [-13.2, -77., 44., 76.]; + break; + + case gluShaderUtil.precision.PRECISION_MEDIUMP: + this.m_texValueMin = [-37.0, 47., -7., 0.0]; + this.m_texValueMax = [-1.0, 12., 7., 19.]; + break; + + case gluShaderUtil.precision.PRECISION_LOWP: + this.m_texValueMin = [0.0, -1.0, 0.0, 1.0]; + this.m_texValueMax = [1.0, 1.0, -1.0, -1.0]; + break; + + default: + throw new Error(false, 'Precision not supported:' + this.m_precision); + } + + // Lowp and mediump cases use RGBA16F format, while highp uses RGBA32F. + viewportSize = this.getViewportSize(); + assertMsgOptions(!this.m_texture, 'Texture not null', false, true); + this.m_texture = gluTexture.texture2DFromInternalFormat(gl, this.m_precision === gluShaderUtil.precision.PRECISION_HIGHP ? gl.RGBA32F : gl.RGBA16F, viewportSize[0], viewportSize[1]); + this.m_texture.getRefTexture().allocLevel(0); + + // Texture coordinates + this.m_coordMin = [0.0, 0.0, 0.0, 0.0]; + this.m_coordMax = [1.0, 1.0, 1.0, 1.0]; + + // Fill with gradients. + /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.m_texture.getRefTexture().getLevel(0); + for (var y = 0; y < level0.getHeight(); y++) { + for (var x = 0; x < level0.getWidth(); x++) { + /** @type {number} */ var xf = (x + 0.5) / level0.getWidth(); + /** @type {number} */ var yf = (y + 0.5) / level0.getHeight(); + /** @type {Array} */ var s = [xf, yf, (xf + yf) / 2.0, 1.0 - (xf + yf) / 2.0]; + + level0.setPixel(deMath.add(this.m_texValueMin, deMath.multiply(deMath.subtract(this.m_texValueMax, this.m_texValueMin), s)), x, y); + } + } + + this.m_texture.upload(); + + if (this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO) { + // No scale or bias used for accuracy. + this.m_derivScale = [1.0, 1.0, 1.0, 1.0]; + this.m_derivBias = [0.0, 0.0, 0.0, 0.0]; + } else { + // Compute scale - bias that normalizes to 0..1 range. + viewportSize = this.getViewportSize(); + /** @type {number} */ var w = viewportSize[0]; + /** @type {number} */ var h = viewportSize[1]; + /** @type {Array} */ var dx = deMath.divide(deMath.subtract(this.m_texValueMax, this.m_texValueMin), [w, w, w * 0.5, -w * 0.5]); + /** @type {Array} */ var dy = deMath.divide(deMath.subtract(this.m_texValueMax, this.m_texValueMin), [h, h, h * 0.5, -h * 0.5]); + + switch (this.m_func) { + case es3fShaderDerivateTests.DerivateFunc.DFDX: + this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dx); + break; + + case es3fShaderDerivateTests.DerivateFunc.DFDY: + this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dy); + break; + + case es3fShaderDerivateTests.DerivateFunc.FWIDTH: + this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], deMath.add(deMath.abs(dx), deMath.abs(dy))); + break; + + default: + throw new Error('Derivate Function not supported: ' + this.m_func); + } + + this.m_derivBias = [0.0, 0.0, 0.0, 0.0]; + } + }; + + /** + * @param {WebGLProgram} program + */ + es3fShaderDerivateTests.TextureDerivateCase.prototype.setupRenderState = function(program) { + /** @type {number} */ var texUnit = 1; + + gl.activeTexture(gl.TEXTURE0 + texUnit); + gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture()); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_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); + + gl.uniform1i(gl.getUniformLocation(program, 'u_sampler'), texUnit); + }; + + /** + * @param {tcuTexture.PixelBufferAccess} result + * @param {tcuTexture.PixelBufferAccess} errorMask + * @return {boolean} + */ + es3fShaderDerivateTests.TextureDerivateCase.prototype.verify = function(result, errorMask) { + // \note Edges are ignored in comparison + if (result.getWidth() < 2 || result.getHeight() < 2) + throw new Error('Too small viewport'); + + /** @type {tcuTexture.PixelBufferAccess} */ var compareArea = tcuTextureUtil.getSubregion(result, 1, 1, 0, result.getWidth() - 2, result.getHeight() - 2, 1); + /** @type {tcuTexture.PixelBufferAccess} */ var maskArea = tcuTextureUtil.getSubregion(errorMask, 1, 1, 0, errorMask.getWidth() - 2, errorMask.getHeight() - 2, 1); + /** @type {Array} */ var xScale = [1.0, 0.0, 0.5, -0.5]; + /** @type {Array} */ var yScale = [0.0, 1.0, 0.5, -0.5]; + /** @type {number} */ var w = result.getWidth(); + /** @type {number} */ var h = result.getHeight(); + + /** @type {Array} */ var surfaceThreshold = deMath.divide(this.getSurfaceThreshold(), deMath.abs(this.m_derivScale)); + /** @type {Array} */ var reference; + /** @type {Array} */ var threshold; + if (this.m_func == es3fShaderDerivateTests.DerivateFunc.DFDX || this.m_func == es3fShaderDerivateTests.DerivateFunc.DFDY) { + /** @type {boolean} */ var isX = this.m_func == es3fShaderDerivateTests.DerivateFunc.DFDX; + /** @type {number} */ var div = isX ? w : h; + /** @type {Array} */ var scale = isX ? xScale : yScale; + reference = deMath.multiply(deMath.scale(deMath.subtract(this.m_texValueMax, this.m_texValueMin), 1 / div), scale); + /** @type {Array} */ var opThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_texValueMin, scale), deMath.multiply(this.m_texValueMax, scale), reference); + threshold = deMath.max(surfaceThreshold, opThreshold); + + bufferedLogToConsole('Verifying result image.\n'+ + '\tValid derivative is ' + reference + ' with threshold ' + threshold); + + // short circuit if result is strictly within the normal value error bounds. + // This improves performance significantly. + if (es3fShaderDerivateTests.verifyConstantDerivate(compareArea, maskArea, this.m_dataType, + reference, threshold, this.m_derivScale, this.m_derivBias, + es3fShaderDerivateTests.VerificationLogging.LOG_NOTHING)) { + bufferedLogToConsole('No incorrect derivatives found, result valid.'); + return true; + } + // some pixels exceed error bounds calculated for normal values. Verify that these + // potentially invalid pixels are in fact valid due to (for example) subnorm flushing. + + bufferedLogToConsole('Initial verification failed, verifying image by calculating accurate error bounds for each result pixel.\n' + + '\tVerifying each result derivative is within its range of legal result values.'); + + /** @type {Array} */ var valueRamp = deMath.subtract(this.m_texValueMax, this.m_texValueMin); + /** @type {es3fShaderDerivateTests.Linear2DFunctionEvaluator} */ var function_ = new es3fShaderDerivateTests.Linear2DFunctionEvaluator(); + + function_.matrix.setRow(0, [valueRamp[0] / w, 0.0, this.m_texValueMin[0]]); + function_.matrix.setRow(1, [0.0, valueRamp[1] / h, this.m_texValueMin[1]]); + function_.matrix.setRow(2, deMath.scale([valueRamp[2] / w, valueRamp[2] / h, this.m_texValueMin[2] + this.m_texValueMin[2]], 1 / 2.0)); + function_.matrix.setRow(3, deMath.scale([-valueRamp[3] / w, -valueRamp[3] / h, this.m_texValueMax[3] + this.m_texValueMax[3]], 1 / 2.0)); + + return es3fShaderDerivateTests.reverifyConstantDerivateWithFlushRelaxations(compareArea, maskArea, this.m_dataType, this.m_precision, + this.m_derivScale, this.m_derivBias, surfaceThreshold, this.m_func, function_); + } else { + assertMsgOptions(this.m_func == es3fShaderDerivateTests.DerivateFunc.FWIDTH, 'Expected Derivate Function FWIDTH', false, true); + /** @type {Array} */ var dx = deMath.multiply(deMath.scale(deMath.subtract(this.m_texValueMax, this.m_texValueMin), 1 / w), xScale); + /** @type {Array} */ var dy = deMath.multiply(deMath.scale(deMath.subtract(this.m_texValueMax, this.m_texValueMin), 1 / h), yScale); + reference = deMath.add(deMath.abs(dx), deMath.abs(dy)); + /** @type {Array} */ var dxThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_texValueMin, xScale), deMath.multiply(this.m_texValueMax, xScale), dx); + /** @type {Array} */ var dyThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_texValueMin, yScale), deMath.multiply(this.m_texValueMax, yScale), dy); + threshold = deMath.max(surfaceThreshold, deMath.max(dxThreshold, dyThreshold)); + + return es3fShaderDerivateTests.verifyConstantDerivate(compareArea, maskArea, this.m_dataType, + reference, threshold, this.m_derivScale, this.m_derivBias); + }; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderDerivateTests.ShaderDerivateTests = function() { + tcuTestCase.DeqpTest.call(this, 'derivate', 'Derivate Function Tests'); + }; + + es3fShaderDerivateTests.ShaderDerivateTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderDerivateTests.ShaderDerivateTests.prototype.constructor = es3fShaderDerivateTests.ShaderDerivateTests + + /** + * @struct + * @constructor + * @param {string} name + * @param {es3fShaderDerivateTests.DerivateFunc} func + * @param {gluShaderUtil.DataType} dataType_ + * @param {gluShaderUtil.precision} precision_ + */ + es3fShaderDerivateTests.FunctionSpec = function(name, func, dataType_, precision_) { + this.name = name; + this.function_ = func; + this.dataType = dataType_; + this.precision = precision_; + }; + + es3fShaderDerivateTests.ShaderDerivateTests.prototype.init = function() { + var testGroup = tcuTestCase.runner.testCases; + /** + * @struct + * @constructor + * @param {string} name + * @param {string} description + * @param {string} source + */ + var LinearDerivateCase = function(name, description, source) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.description = description; + /** @type {string} */ this.source = source; + }; + + /** @type {Array} */ + var s_linearDerivateCases = [ + new LinearDerivateCase( + 'linear', + 'Basic derivate of linearly interpolated argument', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res = ${FUNC}(v_coord) * u_scale + u_bias;\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'), + new LinearDerivateCase( + 'in_function', + 'Derivate of linear function argument', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + '\n' + + '${PRECISION} ${DATATYPE} computeRes (${PRECISION} ${DATATYPE} value)\n' + + '{\n' + + ' return ${FUNC}(v_coord) * u_scale + u_bias;\n' + + '}\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res = computeRes(v_coord);\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'), + new LinearDerivateCase( + 'static_if', + 'Derivate of linearly interpolated value in static if', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res;\n' + + ' if (false)\n' + + ' res = ${FUNC}(-v_coord) * u_scale + u_bias;\n' + + ' else\n' + + ' res = ${FUNC}(v_coord) * u_scale + u_bias;\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'), + new LinearDerivateCase( + 'static_loop', + 'Derivate of linearly interpolated value in static loop', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res = ${DATATYPE}(0.0);\n' + + ' for (int i = 0; i < 2; i++)\n' + + ' res += ${FUNC}(v_coord * float(i));\n' + + ' res = res * u_scale + u_bias;\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'), + new LinearDerivateCase( + 'static_switch', + 'Derivate of linearly interpolated value in static switch', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res;\n' + + ' switch (1)\n' + + ' {\n' + + ' case 0: res = ${FUNC}(-v_coord) * u_scale + u_bias; break;\n' + + ' case 1: res = ${FUNC}(v_coord) * u_scale + u_bias; break;\n' + + ' }\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'), + new LinearDerivateCase( + 'uniform_if', + 'Derivate of linearly interpolated value in uniform if', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'uniform bool ub_true;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res;\n' + + ' if (ub_true)\n' + + ' res = ${FUNC}(v_coord) * u_scale + u_bias;\n' + + ' else\n' + + ' res = ${FUNC}(-v_coord) * u_scale + u_bias;\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'), + new LinearDerivateCase( + 'uniform_loop', + 'Derivate of linearly interpolated value in uniform loop', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'uniform int ui_two;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res = ${DATATYPE}(0.0);\n' + + ' for (int i = 0; i < ui_two; i++)\n' + + ' res += ${FUNC}(v_coord * float(i));\n' + + ' res = res * u_scale + u_bias;\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n'), + new LinearDerivateCase( + 'uniform_switch', + 'Derivate of linearly interpolated value in uniform switch', + '#version 300 es\n' + + 'in ${PRECISION} ${DATATYPE} v_coord;\n' + + 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' + + 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' + + 'uniform int ui_one;\n' + + 'void main (void)\n' + + '{\n' + + ' ${PRECISION} ${DATATYPE} res;\n' + + ' switch (ui_one)\n' + + ' {\n' + + ' case 0: res = ${FUNC}(-v_coord) * u_scale + u_bias; break;\n' + + ' case 1: res = ${FUNC}(v_coord) * u_scale + u_bias; break;\n' + + ' }\n' + + ' o_color = ${CAST_TO_OUTPUT};\n' + + '}\n') + ]; + + /** + * @struct + * @constructor + * @param {string} name + * @param {es3fShaderDerivateTests.SurfaceType} surfaceType + * @param {number} numSamples + */ + var FboConfig = function(name, surfaceType, numSamples) { + /** @type {string} */ this.name = name; + /** @type {es3fShaderDerivateTests.SurfaceType} */ this.surfaceType = surfaceType; + /** @type {number} */ this.numSamples = numSamples; + }; + + /** @type {Array} */ var s_fboConfigs = [ + new FboConfig('fbo', es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER, 0), + new FboConfig('fbo_msaa2', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 2), + new FboConfig('fbo_msaa4', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 4), + new FboConfig('fbo_float', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0) + ]; + + /** + * @struct + * @constructor + * @param {string} name + * @param {number} hint + */ + var Hint = function(name, hint) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.hint = hint; + }; + + /** @type {Array} */ var s_hints = [ + new Hint('fastest', gl.FASTEST), + new Hint('nicest', gl.NICEST) + ]; + + /** + * @struct + * @constructor + * @param {string} name + * @param {es3fShaderDerivateTests.SurfaceType} surfaceType + * @param {number} numSamples + */ + var HintFboConfig = function(name, surfaceType, numSamples) { + /** @type {string} */ this.name = name; + /** @type {es3fShaderDerivateTests.SurfaceType} */ this.surfaceType = surfaceType; + /** @type {number} */ this.numSamples = numSamples; + }; + + /** @type {Array} */ var s_hintFboConfigs = [ + new HintFboConfig('default', es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER, 0), + new HintFboConfig('fbo_msaa4', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 4), + new HintFboConfig('fbo_float', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0) + ]; + + /** + * @struct + * @constructor + * @param {string} name + * @param {es3fShaderDerivateTests.SurfaceType} surfaceType + * @param {number} numSamples + * @param {number} hint + */ + var TextureConfig = function(name, surfaceType, numSamples, hint) { + /** @type {string} */ this.name = name; + /** @type {es3fShaderDerivateTests.SurfaceType} */ this.surfaceType = surfaceType; + /** @type {number} */ this.numSamples = numSamples; + /** @type {number} */ this.hint = hint; + }; + + /** @type {Array} */ var s_textureConfigs = [ + new TextureConfig('basic', es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER, 0, gl.DONT_CARE), + new TextureConfig('msaa4', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 4, gl.DONT_CARE), + new TextureConfig('float_fastest', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0, gl.FASTEST), + new TextureConfig('float_nicest', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0, gl.NICEST) + ]; + + /** @type {gluShaderUtil.DataType} */ var dataType; + /** @type {string} */ var source; + /** @type {gluShaderUtil.precision} */ var precision; + /** @type {es3fShaderDerivateTests.SurfaceType} */ var surfaceType; + /** @type {number} */ var numSamples; + /** @type {number} */ var hint; + /** @type {string} */ var caseName; + /** @type {tcuTestCase.DeqpTest} */ var fboGroup; + + // .dfdx, .dfdy, .fwidth + for (var funcNdx in es3fShaderDerivateTests.DerivateFunc) { + /** @type {es3fShaderDerivateTests.DerivateFunc} */ var function_ = es3fShaderDerivateTests.DerivateFunc[funcNdx]; + /** @type {tcuTestCase.DeqpTest} */ var functionGroup = tcuTestCase.newTest(es3fShaderDerivateTests.getDerivateFuncCaseName(function_), es3fShaderDerivateTests.getDerivateFuncName(function_)); + testGroup.addChild(functionGroup); + + // .constant - no precision variants, checks that derivate of constant arguments is 0 + /** @type {tcuTestCase.DeqpTest} */ var constantGroup = tcuTestCase.newTest('constant', 'Derivate of constant argument'); + functionGroup.addChild(constantGroup); + + for (var vecSize = 1; vecSize <= 4; vecSize++) { + dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT; + constantGroup.addChild(new es3fShaderDerivateTests.ConstantDerivateCase(gluShaderUtil.getDataTypeName(dataType), '', function_, dataType)); + } + + // Cases based on LinearDerivateCase + for (var caseNdx = 0; caseNdx < s_linearDerivateCases.length; caseNdx++) { + /** @type {tcuTestCase.DeqpTest} */ var linearCaseGroup = tcuTestCase.newTest(s_linearDerivateCases[caseNdx].name, s_linearDerivateCases[caseNdx].description); + source = s_linearDerivateCases[caseNdx].source; + functionGroup.addChild(linearCaseGroup); + + for (var vecSize = 1; vecSize <= 4; vecSize++) + for (var precNdx in gluShaderUtil.precision) { + dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT; + precision = gluShaderUtil.precision[precNdx]; + surfaceType = es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER; + numSamples = 0; + hint = gl.DONT_CARE; + + if (caseNdx !== 0 && precision === gluShaderUtil.precision.PRECISION_LOWP) + continue; // Skip as lowp doesn't actually produce any bits when rendered to default FB. + + caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision); + + linearCaseGroup.addChild(new es3fShaderDerivateTests.LinearDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples, source)); + } + } + + // Fbo cases + for (var caseNdx = 0; caseNdx < s_fboConfigs.length; caseNdx++) { + fboGroup = tcuTestCase.newTest(s_fboConfigs[caseNdx].name, 'Derivate usage when rendering into FBO'); + source = s_linearDerivateCases[0].source; // use source from .linear group + surfaceType = s_fboConfigs[caseNdx].surfaceType; + numSamples = s_fboConfigs[caseNdx].numSamples; + functionGroup.addChild(fboGroup); + + for (var vecSize = 1; vecSize <= 4; vecSize++) + for (var precNdx in gluShaderUtil.precision) { + dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT; + precision = gluShaderUtil.precision[precNdx]; + hint = gl.DONT_CARE; + + if (surfaceType !== es3fShaderDerivateTests.SurfaceType.FLOAT_FBO && precision === gluShaderUtil.precision.PRECISION_LOWP) + continue; // Skip as lowp doesn't actually produce any bits when rendered to U8 RT. + + caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision); + + fboGroup.addChild(new es3fShaderDerivateTests.LinearDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples, source)); + } + } + + // .fastest, .nicest + for (var hintCaseNdx = 0; hintCaseNdx < s_hints.length; hintCaseNdx++) { + /** @type {tcuTestCase.DeqpTest} */ var hintGroup = tcuTestCase.newTest(s_hints[hintCaseNdx].name, 'Shader derivate hints'); + source = s_linearDerivateCases[0].source; // use source from .linear group + hint = s_hints[hintCaseNdx].hint; + functionGroup.addChild(hintGroup); + + for (var fboCaseNdx = 0; fboCaseNdx < s_hintFboConfigs.length; fboCaseNdx++) { + fboGroup = tcuTestCase.newTest(s_hintFboConfigs[fboCaseNdx].name, ''); + surfaceType = s_hintFboConfigs[fboCaseNdx].surfaceType; + numSamples = s_hintFboConfigs[fboCaseNdx].numSamples; + hintGroup.addChild(fboGroup); + + for (var vecSize = 1; vecSize <= 4; vecSize++) + for (var precNdx in gluShaderUtil.precision) { + dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT; + precision = gluShaderUtil.precision[precNdx]; + + if (surfaceType !== es3fShaderDerivateTests.SurfaceType.FLOAT_FBO && precision === gluShaderUtil.precision.PRECISION_LOWP) + continue; // Skip as lowp doesn't actually produce any bits when rendered to U8 RT. + + caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision); + + fboGroup.addChild(new es3fShaderDerivateTests.LinearDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples, source)); + } + } + } + + // .texture + /** @type {tcuTestCase.DeqpTest} */ var textureGroup = tcuTestCase.newTest('texture', 'Derivate of texture lookup result'); + functionGroup.addChild(textureGroup); + + for (var texCaseNdx = 0; texCaseNdx < s_textureConfigs.length; texCaseNdx++) { + /** @type {tcuTestCase.DeqpTest} */ var caseGroup = tcuTestCase.newTest(s_textureConfigs[texCaseNdx].name, ''); + surfaceType = s_textureConfigs[texCaseNdx].surfaceType; + numSamples = s_textureConfigs[texCaseNdx].numSamples; + hint = s_textureConfigs[texCaseNdx].hint; + textureGroup.addChild(caseGroup); + + for (var vecSize = 1; vecSize <= 4; vecSize++) + for (var precNdx in gluShaderUtil.precision) { + dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT; + precision = gluShaderUtil.precision[precNdx]; + + if (surfaceType !== es3fShaderDerivateTests.SurfaceType.FLOAT_FBO && precision === gluShaderUtil.precision.PRECISION_LOWP) + continue; // Skip as lowp doesn't actually produce any bits when rendered to U8 RT. + + caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision); + + caseGroup.addChild(new es3fShaderDerivateTests.TextureDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples)); + } + } + } + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderDerivateTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderDerivateTests.ShaderDerivateTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderDerivateTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js new file mode 100644 index 000000000..c08db9075 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js @@ -0,0 +1,1278 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderIndexingTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuStringTemplate'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluTexture'); +goog.require('modules.shared.glsShaderRenderCase'); + +goog.scope(function() { + /** @type {?WebGL2RenderingContext} */ var gl; + var es3fShaderIndexingTests = functional.gles3.es3fShaderIndexingTests; + var deMath = framework.delibs.debase.deMath; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluTexture = framework.opengl.gluTexture; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var tcuTestCase = framework.common.tcuTestCase; + var tcuStringTemplate = framework.common.tcuStringTemplate; + /** + * @enum {number} + */ + es3fShaderIndexingTests.IndexAccessType = { + STATIC: 0, + DYNAMIC: 1, + STATIC_LOOP: 2, + DYNAMIC_LOOP: 3 + }; + + /** + * @param {es3fShaderIndexingTests.IndexAccessType} accessType + * @return {string} + */ + es3fShaderIndexingTests.getIndexAccessTypeName = function(accessType) { + /** @type {Array} */ var s_names = [ + 'static', + 'dynamic', + 'static_loop', + 'dynamic_loop' + ]; + return s_names[accessType]; + }; + + /** + * @enum {number} + */ + es3fShaderIndexingTests.VectorAccessType = { + DIRECT: 0, + COMPONENT: 1, + SUBSCRIPT_STATIC: 2, + SUBSCRIPT_DYNAMIC: 3, + SUBSCRIPT_STATIC_LOOP: 4, + SUBSCRIPT_DYNAMIC_LOOP: 5 + }; + + /** + * @param {es3fShaderIndexingTests.VectorAccessType} accessType + * @return {string} + */ + es3fShaderIndexingTests.getVectorAccessTypeName = function(accessType) { + /** @type {Array} */ var s_names = [ + 'direct', + 'component', + 'static_subscript', + 'dynamic_subscript', + 'static_loop_subscript', + 'dynamic_loop_subscript' + ]; + assertMsgOptions(deMath.deInBounds32(accessType, 0, s_names.length), 'Index out of bounds', false, true); + return s_names[accessType]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayCoordsFloat = function(c) { + c.color[0] = 1.875 * c.coords[0]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayCoordsVec2 = function(c) { + var swizzled = deMath.swizzle(c.coords, [0, 1]); + c.color[0] = 1.875 * swizzled[0]; + c.color[1] = 1.875 * swizzled[1]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayCoordsVec3 = function(c) { + var swizzled = deMath.swizzle(c.coords, [0, 1, 2]); + c.color[0] = 1.875 * swizzled[0]; + c.color[1] = 1.875 * swizzled[1]; + c.color[2] = 1.875 * swizzled[2]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayCoordsVec4 = function(c) { + c.color = deMath.scale(c.coords, 1.875); + }; + + /** + * @param {gluShaderUtil.DataType} dataType + * @return {function(glsShaderRenderCase.ShaderEvalContext)} + */ + es3fShaderIndexingTests.getArrayCoordsEvalFunc = function(dataType) { + if (dataType === gluShaderUtil.DataType.FLOAT) return es3fShaderIndexingTests.evalArrayCoordsFloat; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC2) return es3fShaderIndexingTests.evalArrayCoordsVec2; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC3) return es3fShaderIndexingTests.evalArrayCoordsVec3; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC4) return es3fShaderIndexingTests.evalArrayCoordsVec4; + else throw new Error('Invalid data type.'); + }; + + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayUniformFloat = function(c) { + c.color[0] = 1.875 * c.constCoords[0]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayUniformVec2 = function(c) { + var swizzled = deMath.swizzle(c.constCoords, [0, 1]); + c.color[0] = 1.875 * swizzled[0]; + c.color[1] = 1.875 * swizzled[1]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayUniformVec3 = function(c) { + var swizzled = deMath.swizzle(c.constCoords, [0, 1, 2]); + c.color[0] = 1.875 * swizzled[0]; + c.color[1] = 1.875 * swizzled[1]; + c.color[2] = 1.875 * swizzled[2]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalArrayUniformVec4 = function(c) { + c.color = deMath.scale(c.constCoords, 1.875); + }; + + /** + * @param {gluShaderUtil.DataType} dataType + * @return {function(glsShaderRenderCase.ShaderEvalContext)} + */ + es3fShaderIndexingTests.getArrayUniformEvalFunc = function(dataType) { + if (dataType === gluShaderUtil.DataType.FLOAT) return es3fShaderIndexingTests.evalArrayUniformFloat; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC2) return es3fShaderIndexingTests.evalArrayUniformVec2; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC3) return es3fShaderIndexingTests.evalArrayUniformVec3; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC4) return es3fShaderIndexingTests.evalArrayUniformVec4; + else throw new Error('Invalid data type.'); + }; + + /** + * @constructor + * @extends {glsShaderRenderCase.ShaderRenderCase} + * @param {string} name + * @param {string} description + * @param {boolean} isVertexCase + * @param {gluShaderUtil.DataType} varType + * @param {function(glsShaderRenderCase.ShaderEvalContext)} evalFunc + * @param {string} vertShaderSource + * @param {string} fragShaderSource + */ + es3fShaderIndexingTests.ShaderIndexingCase = function(name, description, isVertexCase, varType, evalFunc, vertShaderSource, fragShaderSource) { + glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc); + /** @type {gluShaderUtil.DataType} */ this.m_varType = varType; + /** @type {string} */ this.m_vertShaderSource = vertShaderSource; + /** @type {string} */ this.m_fragShaderSource = fragShaderSource; + }; + + es3fShaderIndexingTests.ShaderIndexingCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype); + es3fShaderIndexingTests.ShaderIndexingCase.prototype.constructor = es3fShaderIndexingTests.ShaderIndexingCase; + + /** + * @param {?WebGLProgram} programID + * @param {Array} constCoords + */ + es3fShaderIndexingTests.ShaderIndexingCase.prototype.setupUniforms = function(programID, constCoords) { + /** @type {(Array|Float32Array)} */ var arr = []; + /** @type {Array} */ var array1d = []; + /** @type {?WebGLUniformLocation} */ var arrLoc = gl.getUniformLocation(programID, 'u_arr'); + if (arrLoc != null) { + if (this.m_varType === gluShaderUtil.DataType.FLOAT) { + arr[0] = constCoords[0]; + arr[1] = constCoords[0] * 0.5; + arr[2] = constCoords[0] * 0.25; + arr[3] = constCoords[0] * 0.125; + gl.uniform1fv(arrLoc, arr); + } + else if (this.m_varType === gluShaderUtil.DataType.FLOAT_VEC2) { + arr[0] = deMath.swizzle(constCoords, [0, 1]); + arr[1] = deMath.scale(deMath.swizzle(constCoords, [0, 1]), 0.5); + arr[2] = deMath.scale(deMath.swizzle(constCoords, [0, 1]), 0.25); + arr[3] = deMath.scale(deMath.swizzle(constCoords, [0, 1]), 0.125); + for (var i = 0; i < arr.length; i++) + array1d = array1d.concat(arr[i]); + gl.uniform2fv(arrLoc, array1d); + } + else if (this.m_varType === gluShaderUtil.DataType.FLOAT_VEC3) { + arr[0] = deMath.swizzle(constCoords, [0, 1, 2]); + arr[1] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2]), 0.5); + arr[2] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2]), 0.25); + arr[3] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2]), 0.125); + for (var i = 0; i < arr.length; i++) + array1d = array1d.concat(arr[i]); + gl.uniform3fv(arrLoc, array1d); + } + else if (this.m_varType === gluShaderUtil.DataType.FLOAT_VEC4) { + arr[0] = deMath.swizzle(constCoords, [0,1,2,3]); + arr[1] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2, 3]), 0.5); + arr[2] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2, 3]), 0.25); + arr[3] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2, 3]), 0.125); + for (var i = 0; i < arr.length; i++) + array1d = array1d.concat(arr[i]); + gl.uniform4fv(arrLoc, array1d); + } + else + throw new Error('u_arr should not have location assigned in this test case'); + } + }; + + /** + * @param {string} caseName + * @param {string} description + * @param {gluShaderUtil.DataType} varType + * @param {es3fShaderIndexingTests.IndexAccessType} vertAccess + * @param {es3fShaderIndexingTests.IndexAccessType} fragAccess + * @return {es3fShaderIndexingTests.ShaderIndexingCase} + */ + es3fShaderIndexingTests.createVaryingArrayCase = function(caseName, description, varType, vertAccess, fragAccess) { + /** @type {string} */ var vtx = ''; + vtx += '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec4 a_coords;\n'; + + if (vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) + vtx += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n'; + else if (vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP) + vtx += 'uniform mediump int ui_four;\n'; + + vtx += 'out ${PRECISION} ${VAR_TYPE} var[${ARRAY_LEN}];\n' + + '\n' + + 'void main()\n' + + '{\n' + + ' gl_Position = a_position;\n'; + + if (vertAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) { + vtx += ' var[0] = ${VAR_TYPE}(a_coords);\n' + + ' var[1] = ${VAR_TYPE}(a_coords) * 0.5;\n' + + ' var[2] = ${VAR_TYPE}(a_coords) * 0.25;\n' + + ' var[3] = ${VAR_TYPE}(a_coords) * 0.125;\n'; + } + else if (vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + vtx += ' var[ui_zero] = ${VAR_TYPE}(a_coords);\n' + + ' var[ui_one] = ${VAR_TYPE}(a_coords) * 0.5;\n' + + ' var[ui_two] = ${VAR_TYPE}(a_coords) * 0.25;\n' + + ' var[ui_three] = ${VAR_TYPE}(a_coords) * 0.125;\n'; + } + else if (vertAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) { + vtx += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n' + + ' for (int i = 0; i < 4; i++)\n' + + ' {\n' + + ' var[i] = ${VAR_TYPE}(coords);\n' + + ' coords = coords * 0.5;\n' + + ' }\n'; + } + else { + assertMsgOptions(vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'Not Dynamic_Loop', false, true); + vtx += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n' + + ' for (int i = 0; i < ui_four; i++)\n' + + ' {\n' + + ' var[i] = ${VAR_TYPE}(coords);\n' + + ' coords = coords * 0.5;\n' + + ' }\n'; + } + vtx += '}\n'; + + /** @type {string} */ var frag = ''; + frag += '#version 300 es\n' + + 'precision mediump int;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) + frag += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n'; + else if (fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP) + frag += 'uniform int ui_four;\n'; + + frag += 'in ${PRECISION} ${VAR_TYPE} var[${ARRAY_LEN}];\n' + + '\n' + + 'void main()\n' + + '{\n' + + ' ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n'; + + if (fragAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) { + frag += ' res += var[0];\n' + + ' res += var[1];\n' + + ' res += var[2];\n' + + ' res += var[3];\n'; + } + else if (fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + frag += ' res += var[ui_zero];\n' + + ' res += var[ui_one];\n' + + ' res += var[ui_two];\n' + + ' res += var[ui_three];\n'; + } + else if (fragAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) { + frag += ' for (int i = 0; i < 4; i++)\n' + + ' res += var[i];\n'; + } + else { + assertMsgOptions(fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'Not Dynamic_Loop', false, true); + frag += ' for (int i = 0; i < ui_four; i++)\n' + + ' res += var[i];\n'; + } + frag += ' o_color = vec4(res${PADDING});\n' + + '}\n'; + + // Fill in shader templates. + /** @type {Object} */ var params = {}; + params['VAR_TYPE'] = gluShaderUtil.getDataTypeName(varType); + params['ARRAY_LEN'] = '4'; + params['PRECISION'] = 'mediump'; + + if (varType === gluShaderUtil.DataType.FLOAT) + params['PADDING'] = ', 0.0, 0.0, 1.0'; + else if (varType === gluShaderUtil.DataType.FLOAT_VEC2) + params['PADDING'] = ', 0.0, 1.0'; + else if (varType === gluShaderUtil.DataType.FLOAT_VEC3) + params['PADDING'] = ', 1.0'; + else + params['PADDING'] = ''; + + /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params); + /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params); + + /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */ + var evalFunc = es3fShaderIndexingTests.getArrayCoordsEvalFunc(varType); + return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, true, varType, evalFunc, vertexShaderSource, fragmentShaderSource); + }; + + /** + * @param {string} caseName + * @param {string} description + * @param {boolean} isVertexCase + * @param {gluShaderUtil.DataType} varType + * @param {es3fShaderIndexingTests.IndexAccessType} readAccess + * @return {es3fShaderIndexingTests.ShaderIndexingCase} + */ + es3fShaderIndexingTests.createUniformArrayCase = function(caseName, description, isVertexCase, varType, readAccess) { + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vtx += '#version 300 es\n'; + frag += '#version 300 es\n'; + + vtx += 'in highp vec4 a_position;\n'; + vtx += 'in highp vec4 a_coords;\n'; + frag += 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (isVertexCase) { + vtx += 'out mediump vec4 v_color;\n'; + frag += 'in mediump vec4 v_color;\n'; + } + else { + vtx += 'out mediump vec4 v_coords;\n'; + frag += 'in mediump vec4 v_coords;\n'; + } + + if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) + op += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n'; + else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP) + op += 'uniform mediump int ui_four;\n'; + + op += 'uniform ${PRECISION} ${VAR_TYPE} u_arr[${ARRAY_LEN}];\n'; + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + vtx += '\n'; + vtx += 'void main()\n'; + vtx += '{\n'; + vtx += ' gl_Position = a_position;\n'; + + frag += '\n'; + frag += 'void main()\n'; + frag += '{\n'; + + // Read array. + op += ' ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n'; + if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) { + op += ' res += u_arr[0];\n'; + op += ' res += u_arr[1];\n'; + op += ' res += u_arr[2];\n'; + op += ' res += u_arr[3];\n'; + } + else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + op += ' res += u_arr[ui_zero];\n'; + op += ' res += u_arr[ui_one];\n'; + op += ' res += u_arr[ui_two];\n'; + op += ' res += u_arr[ui_three];\n'; + } + else if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) { + op += ' for (int i = 0; i < 4; i++)\n'; + op += ' res += u_arr[i];\n'; + } + else { + assertMsgOptions(readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'readAccess not supported.', false, true); + op += ' for (int i = 0; i < ui_four; i++)\n'; + op += ' res += u_arr[i];\n'; + } + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + if (isVertexCase) { + vtx += ' v_color = vec4(res${PADDING});\n'; + frag += ' o_color = v_color;\n'; + } + else { + vtx += ' v_coords = a_coords;\n'; + frag += ' o_color = vec4(res${PADDING});\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + // Fill in shader templates. + /** @type {Object} */ var params = {}; + params['VAR_TYPE'] = gluShaderUtil.getDataTypeName(varType); + params['ARRAY_LEN'] = '4'; + params['PRECISION'] = 'mediump'; + + if (varType === gluShaderUtil.DataType.FLOAT) + params['PADDING'] = ', 0.0, 0.0, 1.0'; + else if (varType === gluShaderUtil.DataType.FLOAT_VEC2) + params['PADDING'] = ', 0.0, 1.0'; + else if (varType === gluShaderUtil.DataType.FLOAT_VEC3) + params['PADDING'] = ', 1.0'; + else + params['PADDING'] = ''; + + + /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params); + /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params); + + /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */ + var evalFunc = es3fShaderIndexingTests.getArrayUniformEvalFunc(varType); + return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource); + }; + + /** + * @param {string} caseName + * @param {string} description + * @param {boolean} isVertexCase + * @param {gluShaderUtil.DataType} varType + * @param {es3fShaderIndexingTests.IndexAccessType} writeAccess + * @param {es3fShaderIndexingTests.IndexAccessType} readAccess + * @return {es3fShaderIndexingTests.ShaderIndexingCase} + */ + es3fShaderIndexingTests.createTmpArrayCase = function(caseName, description, isVertexCase, varType, writeAccess, readAccess) { + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vtx += '#version 300 es\n'; + frag += '#version 300 es\n'; + + vtx += 'in highp vec4 a_position;\n' + + 'in highp vec4 a_coords;\n'; + frag += 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (isVertexCase) { + vtx += 'out mediump vec4 v_color;\n'; + frag += 'in mediump vec4 v_color;\n'; + } + else { + vtx += 'out mediump vec4 v_coords;\n'; + frag += 'in mediump vec4 v_coords;\n'; + } + + if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) + op += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n'; + + if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP) + op += 'uniform mediump int ui_four;\n'; + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + vtx += '\n' + + 'void main()\n' + + '{\n' + + ' gl_Position = a_position;\n'; + + frag += '\n' + + 'void main()\n' + + '{\n'; + + // Write array. + if (isVertexCase) + op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n'; + else + op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(v_coords);\n'; + + op += ' ${PRECISION} ${VAR_TYPE} arr[${ARRAY_LEN}];\n'; + if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) { + op += ' arr[0] = ${VAR_TYPE}(coords);\n' + + ' arr[1] = ${VAR_TYPE}(coords) * 0.5;\n' + + ' arr[2] = ${VAR_TYPE}(coords) * 0.25;\n' + + ' arr[3] = ${VAR_TYPE}(coords) * 0.125;\n'; + } + else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + op += ' arr[ui_zero] = ${VAR_TYPE}(coords);\n' + + ' arr[ui_one] = ${VAR_TYPE}(coords) * 0.5;\n' + + ' arr[ui_two] = ${VAR_TYPE}(coords) * 0.25;\n' + + ' arr[ui_three] = ${VAR_TYPE}(coords) * 0.125;\n'; + } + else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) { + op += ' for (int i = 0; i < 4; i++)\n' + + ' {\n' + + ' arr[i] = ${VAR_TYPE}(coords);\n' + + ' coords = coords * 0.5;\n' + + ' }\n'; + } + else { + assertMsgOptions(writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'writeAccess not supported', false, true); + op += ' for (int i = 0; i < ui_four; i++)\n' + + ' {\n' + + ' arr[i] = ${VAR_TYPE}(coords);\n' + + ' coords = coords * 0.5;\n' + + ' }\n'; + } + + // Read array. + op += ' ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n'; + if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) { + op += ' res += arr[0];\n' + + ' res += arr[1];\n' + + ' res += arr[2];\n' + + ' res += arr[3];\n'; + } + else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + op += ' res += arr[ui_zero];\n' + + ' res += arr[ui_one];\n' + + ' res += arr[ui_two];\n' + + ' res += arr[ui_three];\n'; + } + else if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) { + op += ' for (int i = 0; i < 4; i++)\n' + + ' res += arr[i];\n'; + } + else { + assertMsgOptions(readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'readAccess not supported.', false, true); + op += ' for (int i = 0; i < ui_four; i++)\n' + + ' res += arr[i];\n'; + } + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + if (isVertexCase) { + vtx += ' v_color = vec4(res${PADDING});\n'; + frag += ' o_color = v_color;\n'; + } + else { + vtx += ' v_coords = a_coords;\n'; + frag += ' o_color = vec4(res${PADDING});\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + // Fill in shader templates. + /** @type {Object} */ var params = {}; + params["VAR_TYPE"] = gluShaderUtil.getDataTypeName(varType); + params["ARRAY_LEN"] = "4"; + params["PRECISION"] = "mediump"; + + if (varType === gluShaderUtil.DataType.FLOAT) + params['PADDING'] = ', 0.0, 0.0, 1.0'; + else if (varType === gluShaderUtil.DataType.FLOAT_VEC2) + params['PADDING'] = ', 0.0, 1.0'; + else if (varType === gluShaderUtil.DataType.FLOAT_VEC3) + params['PADDING'] = ', 1.0'; + else + params['PADDING'] = ''; + + /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params); + /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params); + + /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */ + var evalFunc = es3fShaderIndexingTests.getArrayCoordsEvalFunc(varType); + return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource); + }; + + // VECTOR SUBSCRIPT. + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptVec2 = function(c) { + c.color[0] = c.coords[0] + 0.5 * c.coords[1]; + c.color[1] = c.coords[0] + 0.5 * c.coords[1]; + c.color[2] = c.coords[0] + 0.5 * c.coords[1]; + }; + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptVec3 = function(c) { + c.color[0] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2]; + c.color[1] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2]; + c.color[2] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2]; + }; + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptVec4 = function(c) { + c.color[0] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2] + 0.125 * c.coords[3]; + c.color[1] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2] + 0.125 * c.coords[3]; + c.color[2] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2] + 0.125 * c.coords[3]; + }; + + /** + * @param {gluShaderUtil.DataType} dataType + * @return {function(glsShaderRenderCase.ShaderEvalContext)} + */ + es3fShaderIndexingTests.getVectorSubscriptEvalFunc = function(dataType) { + if (dataType === gluShaderUtil.DataType.FLOAT_VEC2) return es3fShaderIndexingTests.evalSubscriptVec2; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC3) return es3fShaderIndexingTests.evalSubscriptVec3; + else if (dataType === gluShaderUtil.DataType.FLOAT_VEC4) return es3fShaderIndexingTests.evalSubscriptVec4; + else throw new Error('Invalid data type.'); + }; + + /** + * @param {string} caseName + * @param {string} description + * @param {boolean} isVertexCase + * @param {gluShaderUtil.DataType} varType + * @param {es3fShaderIndexingTests.VectorAccessType} writeAccess + * @param {es3fShaderIndexingTests.VectorAccessType} readAccess + * @return {es3fShaderIndexingTests.ShaderIndexingCase} + */ + es3fShaderIndexingTests.createVectorSubscriptCase = function(caseName, description, isVertexCase, varType, writeAccess, readAccess) { + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = '' ; + + /** @type {number} */ var vecLen = gluShaderUtil.getDataTypeScalarSize(varType); + /** @type {string} */ var vecLenName = glsShaderRenderCase.getIntUniformName(vecLen); + + vtx += '#version 300 es\n'; + frag += '#version 300 es\n'; + + vtx += 'in highp vec4 a_position;\n' + + 'in highp vec4 a_coords;\n'; + frag += 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (isVertexCase) { + vtx += 'out mediump vec3 v_color;\n'; + frag += 'in mediump vec3 v_color;\n'; + } + else { + vtx += 'out mediump vec4 v_coords;\n'; + frag += 'in mediump vec4 v_coords;\n'; + } + + if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC || + readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC){ + op += 'uniform mediump int ui_zero'; + if (vecLen >= 2) op += ', ui_one'; + if (vecLen >= 3) op += ', ui_two'; + if (vecLen >= 4) op += ', ui_three'; + op += ';\n'; + } + + if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP || + readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP) + op += 'uniform mediump int ' + vecLenName + ';\n'; + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + vtx += '\n' + + 'void main()\n' + + '{\n' + + ' gl_Position = a_position;\n'; + + frag += '\n' + + 'void main()\n' + + '{\n'; + + // Write vector. + if (isVertexCase) + op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n'; + else + op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(v_coords);\n'; + + op += ' ${PRECISION} ${VAR_TYPE} tmp;\n'; + if (writeAccess === es3fShaderIndexingTests.VectorAccessType.DIRECT) + op += ' tmp = coords.${SWIZZLE} * vec4(1.0, 0.5, 0.25, 0.125).${SWIZZLE};\n'; + else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.COMPONENT) { + op += ' tmp.x = coords.x;\n'; + if (vecLen >= 2) op += ' tmp.y = coords.y * 0.5;\n'; + if (vecLen >= 3) op += ' tmp.z = coords.z * 0.25;\n'; + if (vecLen >= 4) op += ' tmp.w = coords.w * 0.125;\n'; + } + else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC) { + op += ' tmp[0] = coords.x;\n'; + if (vecLen >= 2) op += ' tmp[1] = coords.y * 0.5;\n'; + if (vecLen >= 3) op += ' tmp[2] = coords.z * 0.25;\n'; + if (vecLen >= 4) op += ' tmp[3] = coords.w * 0.125;\n'; + } + else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC) { + op += ' tmp[ui_zero] = coords.x;\n'; + if (vecLen >= 2) op += ' tmp[ui_one] = coords.y * 0.5;\n'; + if (vecLen >= 3) op += ' tmp[ui_two] = coords.z * 0.25;\n'; + if (vecLen >= 4) op += ' tmp[ui_three] = coords.w * 0.125;\n'; + } + else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC_LOOP) { + op += ' for (int i = 0; i < ' + vecLen + '; i++)\n'; + op += ' {\n'; + op += ' tmp[i] = coords.x;\n'; + op += ' coords = coords.${ROT_SWIZZLE} * 0.5;\n'; + op += ' }\n'; + } + else { + assertMsgOptions(writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP, 'writeAccess not supported.', false, true); + op += ' for (int i = 0; i < ' + vecLenName + '; i++)\n'; + op += ' {\n'; + op += ' tmp[i] = coords.x;\n'; + op += ' coords = coords.${ROT_SWIZZLE} * 0.5;\n'; + op += ' }\n'; + } + + // Read vector. + op += ' ${PRECISION} float res = 0.0;\n'; + if (readAccess === es3fShaderIndexingTests.VectorAccessType.DIRECT) + op += ' res = dot(tmp, ${VAR_TYPE}(1.0));\n'; + else if (readAccess === es3fShaderIndexingTests.VectorAccessType.COMPONENT) { + op += ' res += tmp.x;\n'; + if (vecLen >= 2) op += ' res += tmp.y;\n'; + if (vecLen >= 3) op += ' res += tmp.z;\n'; + if (vecLen >= 4) op += ' res += tmp.w;\n'; + } + else if (readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC) { + op += ' res += tmp[0];\n'; + if (vecLen >= 2) op += ' res += tmp[1];\n'; + if (vecLen >= 3) op += ' res += tmp[2];\n'; + if (vecLen >= 4) op += ' res += tmp[3];\n'; + } + else if (readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC) { + op += ' res += tmp[ui_zero];\n'; + if (vecLen >= 2) op += ' res += tmp[ui_one];\n'; + if (vecLen >= 3) op += ' res += tmp[ui_two];\n'; + if (vecLen >= 4) op += ' res += tmp[ui_three];\n'; + } + else if (readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC_LOOP) { + op += ' for (int i = 0; i < ' + vecLen + '; i++)\n'; + op += ' res += tmp[i];\n'; + } + else { + assertMsgOptions(readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP, 'readAccess not supported', false, true); + op += ' for (int i = 0; i < ' + vecLenName + '; i++)\n'; + op += ' res += tmp[i];\n'; + } + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + if (isVertexCase) { + vtx += ' v_color = vec3(res);\n'; + frag += ' o_color = vec4(v_color.rgb, 1.0);\n'; + } + else { + vtx += ' v_coords = a_coords;\n'; + frag += ' o_color = vec4(vec3(res), 1.0);\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + // Fill in shader templates. + /** @type {Array} */ var s_swizzles = ['', 'x', 'xy', 'xyz', 'xyzw']; + /** @type {Array} */ var s_rotSwizzles = ['', 'x', 'yx', 'yzx', 'yzwx']; + + /** @type {Object} */ var params = {}; + params["VAR_TYPE"] = gluShaderUtil.getDataTypeName(varType); + params["PRECISION"] = "mediump"; + params["SWIZZLE"] = s_swizzles[vecLen]; + params["ROT_SWIZZLE"] = s_rotSwizzles[vecLen]; + + /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params); + /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params); + + /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */ + var evalFunc = es3fShaderIndexingTests.getVectorSubscriptEvalFunc(varType); + return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource); + }; + + // MATRIX SUBSCRIPT. + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat2 = function(c) { + var swizzle01 = deMath.swizzle(c.coords, [0, 1]); + var swizzle12 = deMath.swizzle(c.coords, [1, 2]); + c.color[0] = swizzle01[0] + 0.5 * swizzle12[0]; + c.color[1] = swizzle01[1] + 0.5 * swizzle12[1]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat2x3 = function(c) { + var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]); + var swizzle123 = deMath.swizzle(c.coords, [1, 2, 3]); + c.color[0] = swizzle012[0] + 0.5 * swizzle123[0]; + c.color[1] = swizzle012[1] + 0.5 * swizzle123[1]; + c.color[2] = swizzle012[2] + 0.5 * swizzle123[2]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat2x4 = function(c) { + c.color = deMath.add( + deMath.swizzle(c.coords, [0,1,2,3]), + deMath.scale(deMath.swizzle(c.coords, [1,2,3,0]), 0.5)); + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat3x2 = function(c) { + var swizzle01 = deMath.swizzle(c.coords, [0, 1]); + var swizzle12 = deMath.swizzle(c.coords, [1, 2]); + var swizzle23 = deMath.swizzle(c.coords, [2, 3]); + c.color[0] = swizzle01[0] + 0.5 * swizzle12[0] + 0.25 * swizzle23[0]; + c.color[1] = swizzle01[1] + 0.5 * swizzle12[1] + 0.25 * swizzle23[1]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat3 = function(c) { + var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]); + var swizzle123 = deMath.swizzle(c.coords, [1, 2, 3]); + var swizzle230 = deMath.swizzle(c.coords, [2, 3, 0]); + c.color[0] = swizzle012[0] + 0.5 * swizzle123[0] + 0.25 * swizzle230[0]; + c.color[1] = swizzle012[1] + 0.5 * swizzle123[1] + 0.25 * swizzle230[1]; + c.color[2] = swizzle012[2] + 0.5 * swizzle123[2] + 0.25 * swizzle230[2]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat3x4 = function(c) { + var swizzle0123 = deMath.swizzle(c.coords, [0, 1, 2, 3]); + var swizzle1230 = deMath.swizzle(c.coords, [1, 2, 3, 0]); + var swizzle2301 = deMath.swizzle(c.coords, [2, 3, 0, 1]); + c.color = deMath.add( + swizzle0123, + deMath.add( + deMath.scale(swizzle1230, 0.5), + deMath.scale(swizzle2301, 0.25))); + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat4x2 = function(c) { + var swizzle01 = deMath.swizzle(c.coords, [0, 1]); + var swizzle12 = deMath.swizzle(c.coords, [1, 2]); + var swizzle23 = deMath.swizzle(c.coords, [2, 3]); + var swizzle30 = deMath.swizzle(c.coords, [3, 0]); + c.color[0] = swizzle01[0] + 0.5 * swizzle12[0] + 0.25 * swizzle23[0] + 0.125 * swizzle30[0]; + c.color[1] = swizzle01[1] + 0.5 * swizzle12[1] + 0.25 * swizzle23[1] + 0.125 * swizzle30[1]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat4x3 = function(c) { + var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]); + var swizzle123 = deMath.swizzle(c.coords, [1, 2, 3]); + var swizzle230 = deMath.swizzle(c.coords, [2, 3, 0]); + var swizzle301 = deMath.swizzle(c.coords, [3, 0, 1]); + c.color[0] = swizzle012[0] + 0.5 * swizzle123[0] + 0.25 * swizzle230[0] + 0.125 * swizzle301[0]; + c.color[1] = swizzle012[1] + 0.5 * swizzle123[1] + 0.25 * swizzle230[1] + 0.125 * swizzle301[1]; + c.color[2] = swizzle012[2] + 0.5 * swizzle123[2] + 0.25 * swizzle230[2] + 0.125 * swizzle301[2]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + es3fShaderIndexingTests.evalSubscriptMat4 = function(c) { + var swizzle1230 = deMath.swizzle(c.coords, [1, 2, 3, 0]); + var swizzle2301 = deMath.swizzle(c.coords, [2, 3, 0, 1]); + var swizzle3012 = deMath.swizzle(c.coords, [3, 0, 1, 2]); + c.color = deMath.add( + c.coords, + deMath.add( + deMath.scale(swizzle1230, 0.5), + deMath.add( + deMath.scale(swizzle2301, 0.25), + deMath.scale(swizzle3012, 0.125)))); + }; + + /** + * @param {gluShaderUtil.DataType} dataType + * @return {function(glsShaderRenderCase.ShaderEvalContext)} + */ + es3fShaderIndexingTests.getMatrixSubscriptEvalFunc = function(dataType) { + switch (dataType) { + case gluShaderUtil.DataType.FLOAT_MAT2: return es3fShaderIndexingTests.evalSubscriptMat2; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return es3fShaderIndexingTests.evalSubscriptMat2x3; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return es3fShaderIndexingTests.evalSubscriptMat2x4; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return es3fShaderIndexingTests.evalSubscriptMat3x2; + case gluShaderUtil.DataType.FLOAT_MAT3: return es3fShaderIndexingTests.evalSubscriptMat3; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return es3fShaderIndexingTests.evalSubscriptMat3x4; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return es3fShaderIndexingTests.evalSubscriptMat4x2; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return es3fShaderIndexingTests.evalSubscriptMat4x3; + case gluShaderUtil.DataType.FLOAT_MAT4: return es3fShaderIndexingTests.evalSubscriptMat4; + default: + throw new Error('Invalid data type.'); + } + }; + + /** + * @param {string} caseName + * @param {string} description + * @param {boolean} isVertexCase + * @param {gluShaderUtil.DataType} varType + * @param {es3fShaderIndexingTests.IndexAccessType} writeAccess + * @param {es3fShaderIndexingTests.IndexAccessType} readAccess + * @return {es3fShaderIndexingTests.ShaderIndexingCase} + */ + es3fShaderIndexingTests.createMatrixSubscriptCase = function(caseName, description, isVertexCase, varType, writeAccess, readAccess) { + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(varType); + /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(varType); + /** @type {string} */ var matSizeName = glsShaderRenderCase.getIntUniformName(numCols); + /** @type {gluShaderUtil.DataType} */ var vecType = gluShaderUtil.getDataTypeFloatVec(numRows); + + vtx += '#version 300 es\n'; + frag += '#version 300 es\n'; + + vtx += 'in highp vec4 a_position;\n' + + 'in highp vec4 a_coords;\n'; + frag += 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (isVertexCase) { + vtx += 'out mediump vec4 v_color;\n'; + frag += 'in mediump vec4 v_color;\n'; + } + else { + vtx += 'out mediump vec4 v_coords;\n'; + frag += 'in mediump vec4 v_coords;\n'; + } + + if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + op += 'uniform mediump int ui_zero'; + if (numCols >= 2) op += ', ui_one'; + if (numCols >= 3) op += ', ui_two'; + if (numCols >= 4) op += ', ui_three'; + op += ';\n'; + } + + if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP) + op += 'uniform mediump int ' + matSizeName + ';\n'; + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + vtx += '\n' + + 'void main()\n' + + '{\n' + + ' gl_Position = a_position;\n'; + + frag += '\n' + + 'void main()\n' + + '{\n'; + + // Write matrix. + if (isVertexCase) + op += ' ${PRECISION} vec4 coords = a_coords;\n'; + else + op += ' ${PRECISION} vec4 coords = v_coords;\n'; + + op += ' ${PRECISION} ${MAT_TYPE} tmp;\n'; + if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) { + op += ' tmp[0] = ${VEC_TYPE}(coords);\n'; + if (numCols >= 2) op += ' tmp[1] = ${VEC_TYPE}(coords.yzwx) * 0.5;\n'; + if (numCols >= 3) op += ' tmp[2] = ${VEC_TYPE}(coords.zwxy) * 0.25;\n'; + if (numCols >= 4) op += ' tmp[3] = ${VEC_TYPE}(coords.wxyz) * 0.125;\n'; + } + else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + op += ' tmp[ui_zero] = ${VEC_TYPE}(coords);\n'; + if (numCols >= 2) op += ' tmp[ui_one] = ${VEC_TYPE}(coords.yzwx) * 0.5;\n'; + if (numCols >= 3) op += ' tmp[ui_two] = ${VEC_TYPE}(coords.zwxy) * 0.25;\n'; + if (numCols >= 4) op += ' tmp[ui_three] = ${VEC_TYPE}(coords.wxyz) * 0.125;\n'; + } + else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) { + op += ' for (int i = 0; i < ' + numCols + '; i++)\n'; + op += ' {\n'; + op += ' tmp[i] = ${VEC_TYPE}(coords);\n'; + op += ' coords = coords.yzwx * 0.5;\n'; + op += ' }\n'; + } + else { + assertMsgOptions(writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'writeAccess not supported', false, true); + op += ' for (int i = 0; i < ' + matSizeName + '; i++)\n'; + op += ' {\n'; + op += ' tmp[i] = ${VEC_TYPE}(coords);\n'; + op += ' coords = coords.yzwx * 0.5;\n'; + op += ' }\n'; + } + + // Read matrix. + op += ' ${PRECISION} ${VEC_TYPE} res = ${VEC_TYPE}(0.0);\n'; + if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) { + op += ' res += tmp[0];\n'; + if (numCols >= 2) op += ' res += tmp[1];\n'; + if (numCols >= 3) op += ' res += tmp[2];\n'; + if (numCols >= 4) op += ' res += tmp[3];\n'; + } + else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) { + op += ' res += tmp[ui_zero];\n'; + if (numCols >= 2) op += ' res += tmp[ui_one];\n'; + if (numCols >= 3) op += ' res += tmp[ui_two];\n'; + if (numCols >= 4) op += ' res += tmp[ui_three];\n'; + } + else if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) { + op += ' for (int i = 0; i < ' + numCols + '; i++)\n'; + op += ' res += tmp[i];\n'; + } + else { + assertMsgOptions(readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'readAccess not supported', false, true); + op += ' for (int i = 0; i < ' + matSizeName + '; i++)\n'; + op += ' res += tmp[i];\n'; + } + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + if (isVertexCase) { + vtx += ' v_color = vec4(res${PADDING});\n'; + frag += ' o_color = v_color;\n'; + } + else { + vtx += ' v_coords = a_coords;\n'; + frag += ' o_color = vec4(res${PADDING});\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + // Fill in shader templates. + + /** @type {Object} */ var params = {}; + params['MAT_TYPE'] = gluShaderUtil.getDataTypeName(varType); + params['VEC_TYPE'] = gluShaderUtil.getDataTypeName(vecType); + params['PRECISION'] = "mediump"; + + + if (numRows === 2) + params['PADDING'] = ', 0.0, 1.0'; + else if (numRows === 3) + params['PADDING'] = ', 1.0'; + else + params['PADDING'] = ''; + + /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params); + /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params); + + /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */ + var evalFunc = es3fShaderIndexingTests.getMatrixSubscriptEvalFunc(varType); + return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderIndexingTests.ShaderIndexingTests = function() { + tcuTestCase.DeqpTest.call(this, 'indexing', 'Indexing Tests'); + }; + + es3fShaderIndexingTests.ShaderIndexingTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderIndexingTests.ShaderIndexingTests.prototype.constructor = es3fShaderIndexingTests.ShaderIndexingTests; + + es3fShaderIndexingTests.ShaderIndexingTests.prototype.init = function() { + var testGroup = tcuTestCase.runner.testCases; + /** @type {Array} */ var s_shaderTypes = [ + gluShaderProgram.shaderType.VERTEX, + gluShaderProgram.shaderType.FRAGMENT + ]; + /** @type {Array} */ var s_floatAndVecTypes = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4 + ]; + /** @type {string} */ var name; + /** @type {string} */ var desc; + /** @type {string} */ var shaderTypeName; + /** @type {boolean} */ var isVertexCase; + /** @type {gluShaderProgram.shaderType} */ var shaderType; + /** @type {string} */ var writeAccessName; + /** @type {string} */ var readAccessName; + // Varying array access cases. + /** @type {tcuTestCase.DeqpTest} */ var varyingGroup = tcuTestCase.newTest('varying_array', 'Varying array access tests.'); + testGroup.addChild(varyingGroup); + /** @type {gluShaderUtil.DataType} */ var varType; + for (var typeNdx = 0; typeNdx < s_floatAndVecTypes.length; typeNdx++) { + varType = s_floatAndVecTypes[typeNdx]; + for (var vertAccessStr in es3fShaderIndexingTests.IndexAccessType) { + for (var fragAccessStr in es3fShaderIndexingTests.IndexAccessType) { + var vertAccess = es3fShaderIndexingTests.IndexAccessType[vertAccessStr]; + var fragAccess = es3fShaderIndexingTests.IndexAccessType[fragAccessStr]; + /** @type {string} */ var vertAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(vertAccess); + /** @type {string} */ var fragAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(fragAccess); + name = gluShaderUtil.getDataTypeName(varType) + '_' + vertAccessName + '_write_' + fragAccessName + '_read'; + desc = 'Varying array with ' + vertAccessName + ' write in vertex shader and ' + fragAccessName + ' read in fragment shader.'; + varyingGroup.addChild(es3fShaderIndexingTests.createVaryingArrayCase(name, desc, varType, vertAccess, fragAccess)); + } + } + } + + // Uniform array access cases. + /** @type {tcuTestCase.DeqpTest} */ var uniformGroup = tcuTestCase.newTest("uniform_array", "Uniform array access tests."); + testGroup.addChild(uniformGroup); + + for (var typeNdx = 0; typeNdx < s_floatAndVecTypes.length; typeNdx++) { + varType = s_floatAndVecTypes[typeNdx]; + for (var readAccessStr in es3fShaderIndexingTests.IndexAccessType) { + var readAccess = es3fShaderIndexingTests.IndexAccessType[readAccessStr]; + readAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(readAccess); + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + shaderType = s_shaderTypes[shaderTypeNdx]; + shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + name = gluShaderUtil.getDataTypeName(varType) + "_" + readAccessName + "_read_" + shaderTypeName; + desc = "Uniform array with " + readAccessName + " read in " + shaderTypeName + " shader."; + isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX; + uniformGroup.addChild(es3fShaderIndexingTests.createUniformArrayCase(name, desc, isVertexCase, varType, readAccess)); + } + } + } + + // Temporary array access cases. + /** @type {tcuTestCase.DeqpTest} */ var tmpGroup = tcuTestCase.newTest("tmp_array", "Temporary array access tests."); + testGroup.addChild(tmpGroup); + + for (var typeNdx = 0; typeNdx < s_floatAndVecTypes.length; typeNdx++) { + varType = s_floatAndVecTypes[typeNdx]; + for (var writeAccess in es3fShaderIndexingTests.IndexAccessType) { + for (var readAccess in es3fShaderIndexingTests.IndexAccessType) { + writeAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[writeAccess]); + readAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[readAccess]); + + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + shaderType = s_shaderTypes[shaderTypeNdx]; + shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + name = gluShaderUtil.getDataTypeName(varType) + "_" + writeAccessName + "_write_" + readAccessName + "_read_" + shaderTypeName; + desc = "Temporary array with " + writeAccessName + " write and " + readAccessName + " read in " + shaderTypeName + " shader."; + isVertexCase = (shaderType === gluShaderProgram.shaderType.VERTEX); + tmpGroup.addChild(es3fShaderIndexingTests.createTmpArrayCase(name, desc, isVertexCase, varType, es3fShaderIndexingTests.IndexAccessType[writeAccess], es3fShaderIndexingTests.IndexAccessType[readAccess])); + } + } + } + } + + // Vector indexing with subscripts. + + /** @type {Array} */ var s_vectorTypes = [ + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4 + ]; + + for (var typeNdx = 0; typeNdx < s_vectorTypes.length; typeNdx++) { + /** @type {tcuTestCase.DeqpTest} */ var vecGroup = tcuTestCase.newTest("vector_subscript", "Vector subscript indexing."); + testGroup.addChild(vecGroup); + + varType = s_vectorTypes[typeNdx]; + for (var writeAccess in es3fShaderIndexingTests.VectorAccessType) { + for (var readAccess in es3fShaderIndexingTests.VectorAccessType) { + writeAccessName = es3fShaderIndexingTests.getVectorAccessTypeName(es3fShaderIndexingTests.VectorAccessType[writeAccess]); + readAccessName = es3fShaderIndexingTests.getVectorAccessTypeName(es3fShaderIndexingTests.VectorAccessType[readAccess]); + + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + shaderType = s_shaderTypes[shaderTypeNdx]; + shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + name = gluShaderUtil.getDataTypeName(varType) + "_" + writeAccessName + "_write_" + readAccessName + "_read_" + shaderTypeName; + desc = "Vector subscript access with " + writeAccessName + " write and " + readAccessName + " read in " + shaderTypeName + " shader."; + isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX; + vecGroup.addChild(es3fShaderIndexingTests.createVectorSubscriptCase(name, desc, isVertexCase, varType, es3fShaderIndexingTests.VectorAccessType[writeAccess], es3fShaderIndexingTests.VectorAccessType[readAccess])); + } + } + } + } + + // Matrix indexing with subscripts. + /** @type {Array} */ var matGroup = [ + tcuTestCase.newTest("matrix_subscript", "Matrix subscript indexing."), + tcuTestCase.newTest("matrix_subscript", "Matrix subscript indexing."), + tcuTestCase.newTest("matrix_subscript", "Matrix subscript indexing."), + ]; + for (var ii = 0; ii < matGroup.length; ++ii) { + testGroup.addChild(matGroup[ii]); + } + + /** @type {Array} */ var s_matrixTypes = [ + gluShaderUtil.DataType.FLOAT_MAT2, + gluShaderUtil.DataType.FLOAT_MAT2X3, + gluShaderUtil.DataType.FLOAT_MAT2X4, + gluShaderUtil.DataType.FLOAT_MAT3X2, + gluShaderUtil.DataType.FLOAT_MAT3, + gluShaderUtil.DataType.FLOAT_MAT3X4, + gluShaderUtil.DataType.FLOAT_MAT4X2, + gluShaderUtil.DataType.FLOAT_MAT4X3, + gluShaderUtil.DataType.FLOAT_MAT4 + ]; + + for (var typeNdx = 0; typeNdx < s_matrixTypes.length; typeNdx++) { + varType = s_matrixTypes[typeNdx]; + for (var writeAccess in es3fShaderIndexingTests.IndexAccessType) { + for (var readAccess in es3fShaderIndexingTests.IndexAccessType) { + writeAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[writeAccess]); + readAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[readAccess]); + + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + shaderType = s_shaderTypes[shaderTypeNdx]; + shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + name = gluShaderUtil.getDataTypeName(varType) + "_" + writeAccessName + "_write_" + readAccessName + "_read_" + shaderTypeName; + desc = "Vector subscript access with " + writeAccessName + " write and " + readAccessName + " read in " + shaderTypeName + " shader."; + isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX; + matGroup[typeNdx % matGroup.length].addChild(es3fShaderIndexingTests.createMatrixSubscriptCase( + name, desc, isVertexCase, varType, es3fShaderIndexingTests.IndexAccessType[writeAccess], es3fShaderIndexingTests.IndexAccessType[readAccess])); + } + } + } + } + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderIndexingTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderIndexingTests.ShaderIndexingTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderIndexingTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js new file mode 100644 index 000000000..822b121bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js @@ -0,0 +1,1251 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderLoopTests'); +goog.require('framework.common.tcuStringTemplate'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('modules.shared.glsShaderRenderCase'); + +goog.scope(function() { +var es3fShaderLoopTests = functional.gles3.es3fShaderLoopTests; +var tcuTestCase = framework.common.tcuTestCase; +var deMath = framework.delibs.debase.deMath; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var glsShaderRenderCase = modules.shared.glsShaderRenderCase; +var tcuStringTemplate = framework.common.tcuStringTemplate; +// Repeated with for, while, do-while. Examples given as 'for' loops. +// Repeated for const, uniform, dynamic loops. + +/** + * @enum {number} + */ +es3fShaderLoopTests.LoopCase = { + LOOPCASE_EMPTY_BODY: 0, // for (...) { } + LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST: 1, // for (...) { break; ; } + LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST: 2, // for (...) { ; break; } + LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK: 3, // for (...) { ; if (cond) break; } + LOOPCASE_SINGLE_STATEMENT: 4, // for (...) statement; + LOOPCASE_COMPOUND_STATEMENT: 5, // for (...) { statement; statement; } + LOOPCASE_SEQUENCE_STATEMENT: 6, // for (...) statement, statement; + LOOPCASE_NO_ITERATIONS: 7, // for (i=0; i<0; i++) ... + LOOPCASE_SINGLE_ITERATION: 8, // for (i=0; i<1; i++) ... + LOOPCASE_SELECT_ITERATION_COUNT: 9, // for (i=0; i; continue; } + LOOPCASE_ONLY_CONTINUE: 12, // for (...) { continue; } + LOOPCASE_DOUBLE_CONTINUE: 13, // for (...) { if (cond) continue; ; continue; } + LOOPCASE_CONDITIONAL_BREAK: 14, // for (...) { if (cond) break; } + LOOPCASE_UNCONDITIONAL_BREAK: 15, // for (...) { ; break; } + LOOPCASE_PRE_INCREMENT: 16, // for (...; ++i) { ; } + LOOPCASE_POST_INCREMENT: 17, // for (...; i++) { ; } + LOOPCASE_MIXED_BREAK_CONTINUE: 18, + LOOPCASE_VECTOR_COUNTER: 19, // for (ivec3 ndx = ...; ndx.x < ndx.y; ndx.x += ndx.z) { ... } + LOOPCASE_101_ITERATIONS: 20, // loop for 101 iterations + LOOPCASE_SEQUENCE: 21, // two loops in sequence + LOOPCASE_NESTED: 22, // two nested loops + LOOPCASE_NESTED_SEQUENCE: 23, // two loops in sequence nested inside a third + LOOPCASE_NESTED_TRICKY_DATAFLOW_1: 24, // nested loops with tricky data flow + LOOPCASE_NESTED_TRICKY_DATAFLOW_2: 25 // nested loops with tricky data flow +}; + +/** + * @param {es3fShaderLoopTests.LoopCase} loopCase + * @return {string} + */ +es3fShaderLoopTests.getLoopCaseName = function(loopCase) { + /** @type {Array} */ var s_names = [ + 'empty_body', + 'infinite_with_unconditional_break_first', + 'infinite_with_unconditional_break_last', + 'infinite_with_conditional_break', + 'single_statement', + 'compound_statement', + 'sequence_statement', + 'no_iterations', + 'single_iteration', + 'select_iteration_count', + 'conditional_continue', + 'unconditional_continue', + 'only_continue', + 'double_continue', + 'conditional_break', + 'unconditional_break', + 'pre_increment', + 'post_increment', + 'mixed_break_continue', + 'vector_counter', + '101_iterations', + 'sequence', + 'nested', + 'nested_sequence', + 'nested_tricky_dataflow_1', + 'nested_tricky_dataflow_2' + ]; + // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_names) == es3fShaderLoopTests.LoopCase.LOOPCASE_LAST); + // DE_ASSERT(deInBounds32((int)loopCase, 0, LOOPCASE_LAST)); + return s_names[loopCase]; +}; + +// Complex loop cases. + +/*enum LoopBody +{ + LOOPBODY_READ_UNIFORM = 0, + LOOPBODY_READ_UNIFORM_ARRAY, + LOOPBODY_READ_ +};*/ + +/** + * @enum {number} + */ +es3fShaderLoopTests.LoopType = { + LOOPTYPE_FOR: 0, + LOOPTYPE_WHILE: 1, + LOOPTYPE_DO_WHILE: 2 +}; + +/** + * @param {es3fShaderLoopTests.LoopType} loopType + * @return {string} + */ +es3fShaderLoopTests.getLoopTypeName = function(loopType) { + /** @type {Array} */ var s_names = [ + 'for', + 'while', + 'do_while' + ]; + + // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_names) === es3fShaderLoopTests.LoopType.LOOPTYPE_LAST); + // DE_ASSERT(deInBounds32((int)loopType, 0, LOOPTYPE_LAST)); + return s_names[loopType]; +}; + +/** + * @enum {number} + */ +es3fShaderLoopTests.LoopCountType = { + LOOPCOUNT_CONSTANT: 0, + LOOPCOUNT_UNIFORM: 1, + LOOPCOUNT_DYNAMIC: 2 +}; + +/** + * @param {es3fShaderLoopTests.LoopCountType} countType + * @return {string} + */ +es3fShaderLoopTests.getLoopCountTypeName = function(countType) { + /** @type {Array} */ var s_names = [ + 'constant', + 'uniform', + 'dynamic' + ]; + + // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_names) == es3fShaderLoopTests.LoopCountType.LOOPCOUNT_LAST); + // DE_ASSERT(deInBounds32((int)countType, 0, es3fShaderLoopTests.LoopCountType.LOOPCOUNT_LAST)); + return s_names[countType]; +}; + +/** + * @param {glsShaderRenderCase.ShaderEvalContext} c + */ +es3fShaderLoopTests.evalLoop0Iters = function(c) { + var swizzled = deMath.swizzle(c.coords, [0, 1, 2]); + c.color[0] = swizzled[0]; + c.color[1] = swizzled[1]; + c.color[2] = swizzled[2]; +}; + +/** + * @param {glsShaderRenderCase.ShaderEvalContext} c + */ +es3fShaderLoopTests.evalLoop1Iters = function(c) { + var swizzled = deMath.swizzle(c.coords, [1, 2, 3]); + c.color[0] = swizzled[0]; + c.color[1] = swizzled[1]; + c.color[2] = swizzled[2]; +}; + +/** + * @param {glsShaderRenderCase.ShaderEvalContext} c + */ +es3fShaderLoopTests.evalLoop2Iters = function(c) { + var swizzled = deMath.swizzle(c.coords, [2, 3, 0]); + c.color[0] = swizzled[0]; + c.color[1] = swizzled[1]; + c.color[2] = swizzled[2]; +}; + +/** + * @param {glsShaderRenderCase.ShaderEvalContext} c + */ +es3fShaderLoopTests.evalLoop3Iters = function(c) { + var swizzled = deMath.swizzle(c.coords, [3, 0, 1]); + c.color[0] = swizzled[0]; + c.color[1] = swizzled[1]; + c.color[2] = swizzled[2]; +}; + +/** + * @param {number} numIters + * @return {glsShaderRenderCase.ShaderEvalFunc} + */ +es3fShaderLoopTests.getLoopEvalFunc = function(numIters) { + switch (numIters % 4) { + case 0: return es3fShaderLoopTests.evalLoop0Iters; + case 1: return es3fShaderLoopTests.evalLoop1Iters; + case 2: return es3fShaderLoopTests.evalLoop2Iters; + case 3: return es3fShaderLoopTests.evalLoop3Iters; + } + + throw new Error('Invalid loop iteration count.'); +}; + +// ShaderLoopCase + +/** + * @constructor + * @extends {glsShaderRenderCase.ShaderRenderCase} + * @param {string} name + * @param {string} description + * @param {boolean} isVertexCase + * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc + * @param {string} vertShaderSource + * @param {string} fragShaderSource + */ +es3fShaderLoopTests.ShaderLoopCase = function(name, description, isVertexCase, evalFunc, vertShaderSource, fragShaderSource) { + glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc); + /** @type {string} */ this.m_vertShaderSource = vertShaderSource; + /** @type {string} */ this.m_fragShaderSource = fragShaderSource; +}; + +es3fShaderLoopTests.ShaderLoopCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype); +es3fShaderLoopTests.ShaderLoopCase.prototype.constructor = es3fShaderLoopTests.ShaderLoopCase; + +// Test case creation. + +/** + * @param {string} caseName + * @param {string} description + * @param {boolean} isVertexCase + * @param {es3fShaderLoopTests.LoopType} loopType + * @param {es3fShaderLoopTests.LoopCountType} loopCountType + * @param {gluShaderUtil.precision} loopCountPrecision + * @param {gluShaderUtil.DataType} loopCountDataType + * @return {es3fShaderLoopTests.ShaderLoopCase} + */ +es3fShaderLoopTests.createGenericLoopCase = function(caseName, description, isVertexCase, loopType, loopCountType, loopCountPrecision, loopCountDataType) { + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vtx += '#version 300 es\n'; + frag += '#version 300 es\n'; + + vtx += 'in highp vec4 a_position;\n'; + vtx += 'in highp vec4 a_coords;\n'; + frag += 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + vtx += 'in mediump float a_one;\n'; + + if (isVertexCase) { + vtx += 'out mediump vec3 v_color;\n'; + frag += 'in mediump vec3 v_color;\n'; + } + else { + vtx += 'out mediump vec4 v_coords;\n'; + frag += 'in mediump vec4 v_coords;\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) { + vtx += 'out mediump float v_one;\n'; + frag += 'in mediump float v_one;\n'; + } + } + + // \todo [petri] Pass numLoopIters from outside? + /** @type {number} */ var numLoopIters = 3; + /** @type {boolean} */ var isIntCounter = gluShaderUtil.isDataTypeIntOrIVec(loopCountDataType); + + if (isIntCounter) { + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM || loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + op += 'uniform ${COUNTER_PRECISION} int ' + glsShaderRenderCase.getIntUniformName(numLoopIters) + ';\n'; + } + else { + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM || loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + op += 'uniform ${COUNTER_PRECISION} float ' + glsShaderRenderCase.getFloatFractionUniformName(numLoopIters) + ';\n'; + + if (numLoopIters != 1) + op += 'uniform ${COUNTER_PRECISION} float uf_one;\n'; + } + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + vtx += "\n" + + "void main()\n" + + "{\n" + + " gl_Position = a_position;\n"; + + frag += "\n" + + "void main()\n" + + "{\n"; + + if (isVertexCase) + vtx += ' ${PRECISION} vec4 coords = a_coords;\n'; + else + frag += ' ${PRECISION} vec4 coords = v_coords;\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) { + if (isIntCounter) { + if (isVertexCase) + vtx += ' ${COUNTER_PRECISION} int one = int(a_one + 0.5);\n'; + else + frag += ' ${COUNTER_PRECISION} int one = int(v_one + 0.5);\n'; + } + else { + if (isVertexCase) + vtx += ' ${COUNTER_PRECISION} float one = a_one;\n'; + else + frag += ' ${COUNTER_PRECISION} float one = v_one;\n'; + } + } + + // Read array. + op += ' ${PRECISION} vec4 res = coords;\n'; + + // Loop iteration count. + /** @type {string} */ var iterMaxStr; + + if (isIntCounter) { + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) + iterMaxStr = numLoopIters.toString(); + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) + iterMaxStr = glsShaderRenderCase.getIntUniformName(numLoopIters); + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + iterMaxStr = glsShaderRenderCase.getIntUniformName(numLoopIters) + '*one'; + else + throw new Error('Loop Count Type not supported: ' + loopCountType); + } + else { + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) + iterMaxStr = '1.0'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) + iterMaxStr = 'uf_one'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + iterMaxStr = 'uf_one*one'; + else + throw new Error('Loop Count Type not supported: ' + loopCountType); + } + + // Loop operations. + /** @type {string} */ var initValue = isIntCounter ? '0' : '0.05'; + /** @type {string} */ var loopCountDeclStr = '' + gluShaderUtil.getPrecisionName(loopCountPrecision) + ' ' + gluShaderUtil.getDataTypeName(loopCountDataType) + ' ndx = ' + initValue; + /** @type {string} */ var loopCmpStr = 'ndx < ' + iterMaxStr; + /** @type {string} */ var incrementStr; + + if (isIntCounter) + incrementStr = 'ndx++'; + else { + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) + incrementStr = 'ndx += ' + (1.0 / numLoopIters); + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) + incrementStr = 'ndx += ' + glsShaderRenderCase.getFloatFractionUniformName(numLoopIters); + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + incrementStr = 'ndx += ' + glsShaderRenderCase.getFloatFractionUniformName(numLoopIters) + '*one'; + else + throw new Error('Loop Count Type not supported: ' + loopCountType); + } + + // Loop body. + /** @type {string} */ var loopBody = ' res = res.yzwx;\n';; + + if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_FOR) { + op += ' for (' + loopCountDeclStr + '; ' + loopCmpStr + '; ' + incrementStr + ')\n' + + ' {\n' + + loopBody + + ' }\n'; + } + else if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_WHILE) { + op += '\t' + loopCountDeclStr + ';\n' + + ' while (' + loopCmpStr + ')\n' + + ' {\n' + + loopBody + + '\t\t' + incrementStr + ';\n' + + ' }\n'; + } + else if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_DO_WHILE) + { + op += '\t' + loopCountDeclStr + ';\n' + + ' do\n' + + ' {\n' + + loopBody + + '\t\t' + incrementStr + ';\n' + + ' } while (' + loopCmpStr + ');\n'; + } + else + throw new Error('Loop Type not supported: ' + loopType); + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + if (isVertexCase) { + vtx += ' v_color = res.rgb;\n'; + frag += ' o_color = vec4(v_color.rgb, 1.0);\n'; + } + else { + vtx += ' v_coords = a_coords;\n'; + frag += ' o_color = vec4(res.rgb, 1.0);\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + vtx += ' v_one = a_one;\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + // Fill in shader templates. + /** @type {Object} */ var params = {}; + params['LOOP_VAR_TYPE'] = gluShaderUtil.getDataTypeName(loopCountDataType); + params['PRECISION'] = 'mediump'; + params['COUNTER_PRECISION'] = gluShaderUtil.getPrecisionName(loopCountPrecision); + + /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params); + /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params); + + // Create the case. + /** @type {glsShaderRenderCase.ShaderEvalFunc} */ + var evalFunc = es3fShaderLoopTests.getLoopEvalFunc(numLoopIters); + return new es3fShaderLoopTests.ShaderLoopCase(caseName, description, isVertexCase, evalFunc, vertexShaderSource, fragmentShaderSource); +}; + +// \todo [petri] Generalize to float as well? + +/** + * @param {string} caseName + * @param {string} description + * @param {boolean} isVertexCase + * @param {es3fShaderLoopTests.LoopCase} loopCase + * @param {es3fShaderLoopTests.LoopType} loopType + * @param {es3fShaderLoopTests.LoopCountType} loopCountType + * @return {es3fShaderLoopTests.ShaderLoopCase} + */ +es3fShaderLoopTests.createSpecialLoopCase = function(caseName, description, isVertexCase, loopCase, loopType, loopCountType) { + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vtx += '#version 300 es\n'; + frag += '#version 300 es\n'; + + vtx += 'in highp vec4 a_position;\n'; + vtx += 'in highp vec4 a_coords;\n'; + frag += 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + vtx += 'in mediump float a_one;\n'; + + // Attribute and varyings. + if (isVertexCase) { + vtx += 'out mediump vec3 v_color;\n'; + frag += 'in mediump vec3 v_color;\n'; + } + else { + vtx += 'out mediump vec4 v_coords;\n'; + frag += 'in mediump vec4 v_coords;\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) { + vtx += 'out mediump float v_one;\n'; + frag += 'in mediump float v_one;\n'; + } + } + + if (loopCase === es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT) + op += 'uniform bool ub_true;\n'; + + op += 'uniform ${COUNTER_PRECISION} int ui_zero, ui_one, ui_two, ui_three, ui_four, ui_five, ui_six;\n'; + if (loopCase === es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS) + op += 'uniform ${COUNTER_PRECISION} int ui_oneHundredOne;\n'; + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + /** @type {number} */ var iterCount = 3; // value to use in loop + /** @type {number} */ var numIters = 3; // actual number of iterations + + vtx += '\n' + + 'void main()\n' + + '{\n' + + ' gl_Position = a_position;\n'; + + frag += '\n' + + 'void main()\n' + + '{\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) { + if (isVertexCase) + vtx += ' ${COUNTER_PRECISION} int one = int(a_one + 0.5);\n'; + else + frag += ' ${COUNTER_PRECISION} int one = int(v_one + 0.5);\n'; + } + + if (isVertexCase) + vtx += ' ${PRECISION} vec4 coords = a_coords;\n'; + else + frag += ' ${PRECISION} vec4 coords = v_coords;\n'; + + // Read array. + op += ' ${PRECISION} vec4 res = coords;\n'; + + // Handle all loop types. + /** @type {string} */ var counterPrecisionStr = 'mediump'; + /** @type {string} */ var forLoopStr = ''; + /** @type {string} */ var whileLoopStr = ''; + /** @type {string} */ var doWhileLoopPreStr = ''; + /** @type {string} */ var doWhileLoopPostStr = ''; + + if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_FOR) { + switch (loopCase) { + case es3fShaderLoopTests.LoopCase.LOOPCASE_EMPTY_BODY: + numIters = 0; + op += ' ${FOR_LOOP} {}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST: + numIters = 0; + op += ' for (;;) { break; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST: + numIters = 1; + op += ' for (;;) { res = res.yzwx; break; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK: + numIters = 2; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' for (;;) { res = res.yzwx; if (i == ${ONE}) break; i++; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_STATEMENT: + op += ' ${FOR_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_COMPOUND_STATEMENT: + iterCount = 2; + numIters = 2 * iterCount; + op += ' ${FOR_LOOP} { res = res.yzwx; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE_STATEMENT: + iterCount = 2; + numIters = 2 * iterCount; + op += ' ${FOR_LOOP} res = res.yzwx, res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS: + iterCount = 0; + numIters = 0; + op += ' ${FOR_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_ITERATION: + iterCount = 1; + numIters = 1; + op += ' ${FOR_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT: + op += ' for (int i = 0; i < (ub_true ? ${ITER_COUNT} : 0); i++) res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_CONTINUE: + numIters = iterCount - 1; + op += ' ${FOR_LOOP} { if (i == ${TWO}) continue; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_CONTINUE: + op += ' ${FOR_LOOP} { res = res.yzwx; continue; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_ONLY_CONTINUE: + numIters = 0; + op += ' ${FOR_LOOP} { continue; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_DOUBLE_CONTINUE: + numIters = iterCount - 1; + op += ' ${FOR_LOOP} { if (i == ${TWO}) continue; res = res.yzwx; continue; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_BREAK: + numIters = 2; + op += ' ${FOR_LOOP} { if (i == ${TWO}) break; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_BREAK: + numIters = 1; + op += ' ${FOR_LOOP} { res = res.yzwx; break; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_PRE_INCREMENT: + op += ' for (int i = 0; i < ${ITER_COUNT}; ++i) { res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_POST_INCREMENT: + op += ' ${FOR_LOOP} { res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_MIXED_BREAK_CONTINUE: + numIters = 2; + iterCount = 5; + op += ' ${FOR_LOOP} { if (i == 0) continue; else if (i == 3) break; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_VECTOR_COUNTER: + op += ' for (${COUNTER_PRECISION} ivec4 i = ivec4(0, 1, ${ITER_COUNT}, 0); i.x < i.z; i.x += i.y) { res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS: + numIters = iterCount = 101; + op += ' ${FOR_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE: + iterCount = 5; + numIters = 5; + op += ' ${COUNTER_PRECISION} int i;\n' + + ' for (i = 0; i < ${TWO}; i++) { res = res.yzwx; }\n' + + ' for (; i < ${ITER_COUNT}; i++) { res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED: + numIters = 2 * iterCount; + op += ' for (${COUNTER_PRECISION} int i = 0; i < ${TWO}; i++)\n' + + ' {\n' + + ' for (${COUNTER_PRECISION} int j = 0; j < ${ITER_COUNT}; j++)\n' + + ' res = res.yzwx;\n' + + ' }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_SEQUENCE: + numIters = 3 * iterCount; + op += ' for (${COUNTER_PRECISION} int i = 0; i < ${ITER_COUNT}; i++)\n' + + ' {\n' + + ' for (${COUNTER_PRECISION} int j = 0; j < ${TWO}; j++)\n' + + ' res = res.yzwx;\n' + + ' for (${COUNTER_PRECISION} int j = 0; j < ${ONE}; j++)\n' + + ' res = res.yzwx;\n' + + ' }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_1: + numIters = 2; + op += ' ${FOR_LOOP}\n' + + ' {\n' + + ' res = coords; // ignore outer loop effect \n' + + ' for (${COUNTER_PRECISION} int j = 0; j < ${TWO}; j++)\n' + + ' res = res.yzwx;\n' + + ' }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_2: + numIters = iterCount; + op += ' ${FOR_LOOP}\n' + + ' {\n' + + ' res = coords.wxyz;\n' + + ' for (${COUNTER_PRECISION} int j = 0; j < ${TWO}; j++)\n' + + ' res = res.yzwx;\n' + + ' coords = res;\n' + + ' }\n'; + break; + + default: + throw new Error('Case not supported: ' + loopCase); + } + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) + forLoopStr = 'for (' + counterPrecisionStr + ' int i = 0; i < ' + iterCount + '; i++)'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) + forLoopStr = 'for (' + counterPrecisionStr + ' int i = 0; i < ' + glsShaderRenderCase.getIntUniformName(iterCount) + '; i++)'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + forLoopStr = 'for (' + counterPrecisionStr + ' int i = 0; i < one*' + glsShaderRenderCase.getIntUniformName(iterCount) + '; i++)'; + else + throw new Error('Loop Count Type not supported: ' + loopCountType); + } + else if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_WHILE) { + switch (loopCase) { + case es3fShaderLoopTests.LoopCase.LOOPCASE_EMPTY_BODY: + numIters = 0; + op += ' ${WHILE_LOOP} {}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST: + numIters = 0; + op += ' while (true) { break; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST: + numIters = 1; + op += ' while (true) { res = res.yzwx; break; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK: + numIters = 2; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' while (true) { res = res.yzwx; if (i == ${ONE}) break; i++; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_STATEMENT: + op += ' ${WHILE_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_COMPOUND_STATEMENT: + iterCount = 2; + numIters = 2 * iterCount; + op += ' ${WHILE_LOOP} { res = res.yzwx; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE_STATEMENT: + iterCount = 2; + numIters = 2 * iterCount; + op += ' ${WHILE_LOOP} res = res.yzwx, res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS: + iterCount = 0; + numIters = 0; + op += ' ${WHILE_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_ITERATION: + iterCount = 1; + numIters = 1; + op += ' ${WHILE_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT: + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' while (i < (ub_true ? ${ITER_COUNT} : 0)) { res = res.yzwx; i++; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_CONTINUE: + numIters = iterCount - 1; + op += ' ${WHILE_LOOP} { if (i == ${TWO}) continue; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_CONTINUE: + op += ' ${WHILE_LOOP} { res = res.yzwx; continue; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_ONLY_CONTINUE: + numIters = 0; + op += ' ${WHILE_LOOP} { continue; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_DOUBLE_CONTINUE: + numIters = iterCount - 1; + op += ' ${WHILE_LOOP} { if (i == ${ONE}) continue; res = res.yzwx; continue; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_BREAK: + numIters = 2; + op += ' ${WHILE_LOOP} { if (i == ${THREE}) break; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_BREAK: + numIters = 1; + op += ' ${WHILE_LOOP} { res = res.yzwx; break; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_PRE_INCREMENT: + numIters = iterCount - 1; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' while (++i < ${ITER_COUNT}) { res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_POST_INCREMENT: + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' while (i++ < ${ITER_COUNT}) { res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_MIXED_BREAK_CONTINUE: + numIters = 2; + iterCount = 5; + op += ' ${WHILE_LOOP} { if (i == 0) continue; else if (i == 3) break; res = res.yzwx; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_VECTOR_COUNTER: + op += ' ${COUNTER_PRECISION} ivec4 i = ivec4(0, 1, ${ITER_COUNT}, 0);\n' + + ' while (i.x < i.z) { res = res.yzwx; i.x += i.y; }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS: + numIters = iterCount = 101; + op += ' ${WHILE_LOOP} res = res.yzwx;\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE: + iterCount = 6; + numIters = iterCount - 1; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' while (i++ < ${TWO}) { res = res.yzwx; }\n' + + ' while (i++ < ${ITER_COUNT}) { res = res.yzwx; }\n'; // \note skips one iteration + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED: + numIters = 2 * iterCount; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' while (i++ < ${TWO})\n' + + ' {\n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' while (j++ < ${ITER_COUNT})\n' + + ' res = res.yzwx;\n' + + ' }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_SEQUENCE: + numIters = 2 * iterCount; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' while (i++ < ${ITER_COUNT})\n' + + ' {\n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' while (j++ < ${ONE})\n' + + ' res = res.yzwx;\n' + + ' while (j++ < ${THREE})\n' + // \note skips one iteration + ' res = res.yzwx;\n' + + ' }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_1: + numIters = 2; + op += ' ${WHILE_LOOP}\n' + + ' {\n' + + ' res = coords; // ignore outer loop effect \n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' while (j++ < ${TWO})\n' + + ' res = res.yzwx;\n' + + ' }\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_2: + numIters = iterCount; + op += ' ${WHILE_LOOP}\n' + + ' {\n' + + ' res = coords.wxyz;\n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' while (j++ < ${TWO})\n' + + ' res = res.yzwx;\n' + + ' coords = res;\n' + + ' }\n'; + break; + + default: + throw new Error('Loop Case not supported: ' + loopCase); + } + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) + whileLoopStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + ' while(i++ < ' + iterCount + ')'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) + whileLoopStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + ' while(i++ < ' + glsShaderRenderCase.getIntUniformName(iterCount) + ')'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + whileLoopStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + ' while(i++ < one*' + glsShaderRenderCase.getIntUniformName(iterCount) + ')'; + else + throw new Error('Loop Count Type not supported: ' + loopCountType); + } + else { + assertMsgOptions(loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_DO_WHILE, 'Expected LOOPTYPE_DO_WHILE', false, true); + + switch (loopCase) { + case es3fShaderLoopTests.LoopCase.LOOPCASE_EMPTY_BODY: + numIters = 0; + op += ' ${DO_WHILE_PRE} {} ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST: + numIters = 0; + op += ' do { break; res = res.yzwx; } while (true);\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST: + numIters = 1; + op += ' do { res = res.yzwx; break; } while (true);\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK: + numIters = 2; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' do { res = res.yzwx; if (i == ${ONE}) break; i++; } while (true);\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_STATEMENT: + op += ' ${DO_WHILE_PRE} res = res.yzwx; ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_COMPOUND_STATEMENT: + iterCount = 2; + numIters = 2 * iterCount; + op += ' ${DO_WHILE_PRE} { res = res.yzwx; res = res.yzwx; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE_STATEMENT: + iterCount = 2; + numIters = 2 * iterCount; + op += ' ${DO_WHILE_PRE} res = res.yzwx, res = res.yzwx; ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS: + //assertMsgOptions(false, 'LOOPCASE_NO_ITERATIONS', false, false); + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_ITERATION: + iterCount = 1; + numIters = 1; + op += ' ${DO_WHILE_PRE} res = res.yzwx; ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT: + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' do { res = res.yzwx; } while (++i < (ub_true ? ${ITER_COUNT} : 0));\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_CONTINUE: + numIters = iterCount - 1; + op += ' ${DO_WHILE_PRE} { if (i == ${TWO}) continue; res = res.yzwx; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_CONTINUE: + op += ' ${DO_WHILE_PRE} { res = res.yzwx; continue; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_ONLY_CONTINUE: + numIters = 0; + op += ' ${DO_WHILE_PRE} { continue; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_DOUBLE_CONTINUE: + numIters = iterCount - 1; + op += ' ${DO_WHILE_PRE} { if (i == ${TWO}) continue; res = res.yzwx; continue; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_BREAK: + numIters = 2; + op += ' ${DO_WHILE_PRE} { res = res.yzwx; if (i == ${ONE}) break; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_BREAK: + numIters = 1; + op += ' ${DO_WHILE_PRE} { res = res.yzwx; break; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_PRE_INCREMENT: + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' do { res = res.yzwx; } while (++i < ${ITER_COUNT});\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_POST_INCREMENT: + numIters = iterCount + 1; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' do { res = res.yzwx; } while (i++ < ${ITER_COUNT});\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_MIXED_BREAK_CONTINUE: + numIters = 2; + iterCount = 5; + op += ' ${DO_WHILE_PRE} { if (i == 0) continue; else if (i == 3) break; res = res.yzwx; } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_VECTOR_COUNTER: + op += ' ${COUNTER_PRECISION} ivec4 i = ivec4(0, 1, ${ITER_COUNT}, 0);\n' + + ' do { res = res.yzwx; } while ((i.x += i.y) < i.z);\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS: + numIters = iterCount = 101; + op += ' ${DO_WHILE_PRE} res = res.yzwx; ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE: + iterCount = 5; + numIters = 5; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' do { res = res.yzwx; } while (++i < ${TWO});\n' + + ' do { res = res.yzwx; } while (++i < ${ITER_COUNT});\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED: + numIters = 2 * iterCount; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' do\n' + + ' {\n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' do\n' + + ' res = res.yzwx;\n' + + ' while (++j < ${ITER_COUNT});\n' + + ' } while (++i < ${TWO});\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_SEQUENCE: + numIters = 3 * iterCount; + op += ' ${COUNTER_PRECISION} int i = 0;\n' + + ' do\n' + + ' {\n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' do\n' + + ' res = res.yzwx;\n' + + ' while (++j < ${TWO});\n' + + ' do\n' + + ' res = res.yzwx;\n' + + ' while (++j < ${THREE});\n' + + ' } while (++i < ${ITER_COUNT});\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_1: + numIters = 2; + op += ' ${DO_WHILE_PRE}\n' + + ' {\n' + + ' res = coords; // ignore outer loop effect \n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' do\n' + + ' res = res.yzwx;\n' + + ' while (++j < ${TWO});\n' + + ' } ${DO_WHILE_POST}\n'; + break; + + case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_2: + numIters = iterCount; + op += ' ${DO_WHILE_PRE}\n' + + ' {\n' + + ' res = coords.wxyz;\n' + + ' ${COUNTER_PRECISION} int j = 0;\n' + + ' while (j++ < ${TWO})\n' + + ' res = res.yzwx;\n' + + ' coords = res;\n' + + ' } ${DO_WHILE_POST}\n'; + break; + + default: + throw new Error('Loop Case not supported: ' + loopCase); + } + + doWhileLoopPreStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + '\tdo '; + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) + doWhileLoopPostStr = ' while (++i < ' + iterCount + ');\n'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) + doWhileLoopPostStr = ' while (++i < ' + glsShaderRenderCase.getIntUniformName(iterCount) + ');\n'; + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + doWhileLoopPostStr = ' while (++i < one*' + glsShaderRenderCase.getIntUniformName(iterCount) + ');\n'; + else + throw new Error('Loop Count Type not supported: ' + loopCountType); + } + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + // Shader footers. + if (isVertexCase) { + vtx += ' v_color = res.rgb;\n'; + frag += ' o_color = vec4(v_color.rgb, 1.0);\n'; + } + else { + vtx += ' v_coords = a_coords;\n'; + frag += ' o_color = vec4(res.rgb, 1.0);\n'; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) + vtx += ' v_one = a_one;\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + // Constants. + /** @type {string} */ var oneStr = ''; + /** @type {string} */ var twoStr = ''; + /** @type {string} */ var threeStr = ''; + /** @type {string} */ var iterCountStr = ''; + + if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) { + oneStr = '1'; + twoStr = '2'; + threeStr = '3'; + iterCountStr = iterCount.toString(); + } + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) { + oneStr = 'ui_one'; + twoStr = 'ui_two'; + threeStr = 'ui_three'; + iterCountStr = glsShaderRenderCase.getIntUniformName(iterCount); + } + else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) { + oneStr = 'one*ui_one'; + twoStr = 'one*ui_two'; + threeStr = 'one*ui_three'; + iterCountStr = 'one*' + glsShaderRenderCase.getIntUniformName(iterCount); + } + else throw new Error('Loop Count Type not supported: ' + loopCountType); + + // Fill in shader templates. + /** @type {Object} */ var params = {}; + params["PRECISION"] = "mediump"; + params["ITER_COUNT"] = iterCountStr; + params["COUNTER_PRECISION"] = counterPrecisionStr; + params["FOR_LOOP"] = forLoopStr; + params["WHILE_LOOP"] = whileLoopStr; + params["DO_WHILE_PRE"] = doWhileLoopPreStr; + params["DO_WHILE_POST"] = doWhileLoopPostStr; + params["ONE"] = oneStr; + params["TWO"] = twoStr; + params["THREE"] = threeStr; + + /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params); + /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params); + + // Create the case. + /** @type {glsShaderRenderCase.ShaderEvalFunc} */ + var evalFunc = es3fShaderLoopTests.getLoopEvalFunc(numIters); + return new es3fShaderLoopTests.ShaderLoopCase(caseName, description, isVertexCase, evalFunc, vertexShaderSource, fragmentShaderSource); +}; + +// ShaderLoopTests. + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fShaderLoopTests.ShaderLoopTests = function() { + tcuTestCase.DeqpTest.call(this, 'loops', 'Loop Tests'); +}; + +es3fShaderLoopTests.ShaderLoopTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fShaderLoopTests.ShaderLoopTests.prototype.constructor = es3fShaderLoopTests.ShaderLoopTests; + +es3fShaderLoopTests.ShaderLoopTests.prototype.init = function() { + var testGroup = tcuTestCase.runner.testCases; + // Loop cases. + + /** @type {Array} */ var s_shaderTypes = [ + gluShaderProgram.shaderType.VERTEX, + gluShaderProgram.shaderType.FRAGMENT + ]; + + /** @type {Array} */ var s_countDataType = [ + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.FLOAT + ]; + + /** @type {gluShaderProgram.shaderType} */ var shaderType; + /** @type {string} */ var shaderTypeName; + /** @type {boolean} */ var isVertexCase; + /** @type {string} */ var name; + /** @type {string} */ var desc; + + for (var loopType in es3fShaderLoopTests.LoopType) { + /** @type {string} */ var loopTypeName = es3fShaderLoopTests.getLoopTypeName(es3fShaderLoopTests.LoopType[loopType]); + /** @type {tcuTestCase.DeqpTest} */ var loopTypeGroup = tcuTestCase.newTest(loopTypeName, 'Loop tests with ' + loopTypeName + ' loop type'); + testGroup.addChild(loopTypeGroup); + + for (var loopCountType in es3fShaderLoopTests.LoopCountType) { + /** @type {string} */ var loopCountName = es3fShaderLoopTests.getLoopCountTypeName(es3fShaderLoopTests.LoopCountType[loopCountType]); + + /** @type {string} */ var groupName = loopCountName + '_iterations'; + /** @type {string} */ var groupDesc = 'Loop tests with ' + loopCountName + ' loop counter.'; + + /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(groupName, groupDesc); + loopTypeGroup.addChild(group); + + // Generic cases. + + for (var precision in gluShaderUtil.precision) { + /** @type {string} */ var precisionName = gluShaderUtil.getPrecisionName(gluShaderUtil.precision[precision]); + + for (var dataTypeNdx = 0; dataTypeNdx < s_countDataType.length; dataTypeNdx++) { + /** @type {gluShaderUtil.DataType} */ var loopDataType = s_countDataType[dataTypeNdx]; + /** @type {string} */ var dataTypeName = gluShaderUtil.getDataTypeName(loopDataType); + + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + shaderType = s_shaderTypes[shaderTypeNdx]; + shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + isVertexCase = (shaderType == gluShaderProgram.shaderType.VERTEX); + + + name = 'basic_' + precisionName + '_' + dataTypeName + '_' + shaderTypeName; + desc = loopTypeName + ' loop with ' + precisionName + dataTypeName + ' ' + loopCountName + ' iteration count in ' + shaderTypeName + ' shader.'; + group.addChild(es3fShaderLoopTests.createGenericLoopCase(name, desc, isVertexCase, es3fShaderLoopTests.LoopType[loopType], es3fShaderLoopTests.LoopCountType[loopCountType], gluShaderUtil.precision[precision], loopDataType)); + } + } + } + + // Special cases. + + for (var loopCase in es3fShaderLoopTests.LoopCase) { + /** @type {string} */ var loopCaseName = es3fShaderLoopTests.getLoopCaseName(es3fShaderLoopTests.LoopCase[loopCase]); + + // no-iterations not possible with do-while. + if ((es3fShaderLoopTests.LoopCase[loopCase] == es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS) && (es3fShaderLoopTests.LoopType[loopType] == es3fShaderLoopTests.LoopType.LOOPTYPE_DO_WHILE)) + continue; + + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + shaderType = s_shaderTypes[shaderTypeNdx]; + shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + isVertexCase = (shaderType == gluShaderProgram.shaderType.VERTEX); + + name = loopCaseName + '_' + shaderTypeName; + desc = loopCaseName + ' loop with ' + loopTypeName + ' iteration count in ' + shaderTypeName + ' shader.'; + group.addChild(es3fShaderLoopTests.createSpecialLoopCase(name, desc, isVertexCase, es3fShaderLoopTests.LoopCase[loopCase], es3fShaderLoopTests.LoopType[loopType], es3fShaderLoopTests.LoopCountType[loopCountType])); + } + } + } + } +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fShaderLoopTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderLoopTests.ShaderLoopTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderLoopTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js new file mode 100644 index 000000000..5af21863f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js @@ -0,0 +1,1852 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fShaderMatrixTest'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('modules.shared.glsShaderRenderCase'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.common.tcuTestCase'); + +goog.scope(function() { + + var es3fShaderMatrixTest= functional.gles3.es3fShaderMatrixTest; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + var tcuMatrix = framework.common.tcuMatrix; + var deMath = framework.delibs.debase.deMath; + var tcuTestCase = framework.common.tcuTestCase; + + + /** @const {Array}*/ var s_constInFloat = [0.5, -0.2]; + /** @const {Array>}*/ var s_constInVec2 = [[1.2, 0.5], [0.5, 1.0]]; + /** @const {Array>}*/ var s_constInVec3 = [[1.1, 0.1, 0.5], [-0.2, 0.5, 0.8]]; + /** @const {Array>}*/ var s_constInVec4 = [[1.4, 0.2, -0.5, 0.7], [0.2, -1.0, 0.5, 0.8]]; + + /** @typedef {function(glsShaderRenderCase.ShaderEvalContext)} */ es3fShaderMatrixTest.MatrixShaderEvalFunc; + + /** @const {Array>}*/ var s_constInMat2x2 = [ + [-0.1, 1.0, -0.2, 0.0], + [0.8, 0.1, 0.5, -0.9] + ]; + /** @const {Array>}*/ var s_constInMat3x2 = [ + [0.8, -0.3, 0.3, 1.0, 1.2, -1.2], + [1.2, -1.0, 0.5, -0.8, 1.1, 0.3] + ]; + + /** @const {Array>}*/ var s_constInMat4x2 = [ + [-0.2, 0.5, 0.0, -1.0, 1.2, -0.5, 0.3, -0.9], + [1.0, 0.1, -1.1, 0.6, 0.8, -1.2, -1.1, 0.7] + ]; + + /** @const {Array>}*/ var s_constInMat2x3 = [ + [-0.6, -0.1, -0.7, -1.2, -0.2, 0.0], + [1.1, 0.6, 0.8, 1.0, 0.7, 0.1] + ]; + + /** @const {Array>}*/ var s_constInMat3x3 = [ + [-0.2, 1.1, 1.2, -1.0, 1.2, 0.5, 0.7, -0.2, 1.0], + [-0.1, -0.1, 0.1, -0.1, -0.2, 1.0, -0.5, 0.1, -0.4] + ]; + + /** @const {Array>}*/ var s_constInMat4x3 = [ + [-0.9, 0.0, 0.6, 0.2, 0.9, -0.1, -0.3, -0.7, -0.1, 0.1, 1.0, 0.0], + [0.5, 0.7, 0.7, 1.2, 1.1, 0.1, 1.0, -1.0, -0.2, -0.2, -0.3, -0.5] + ]; + + /** @const {Array>}*/ var s_constInMat2x4 = [ + [-0.6, -1.1, -0.6, -0.6, -0.2, -0.6, -0.1, -0.1], + [-1.2, -1.0, 0.7, -1.0, 0.7, 0.7, -0.4, -0.3] + ]; + + /** @const {Array>}*/ var s_constInMat3x4 = [ + [0.6, -0.4, 1.2, 0.9, 0.8, 0.4, 1.1, 0.3, 0.5, -0.2, 0.0, 1.1], + [-0.8, 1.2, -0.2, -1.1, -0.9, -0.5, -1.2, 1.0, 1.2, 0.1, -0.7, -0.5] + ]; + + /** @const {Array>}*/ var s_constInMat4x4 = [ + [0.3, 0.9, -0.2, 1.0, -0.4, -0.6, 0.6, -1.0, -0.9, -0.1, 0.3, -0.2, -0.3, -0.9, 1.0, 0.1], + [0.4, -0.7, -0.8, 0.7, -0.4, -0.8, 0.6, -0.3, 0.7, -1.0, 0.1, -0.3, 0.2, 0.6, 0.4, -1.0] + ]; + + // Operation info + + /** + * @enum + */ + es3fShaderMatrixTest.OperationType = { + OPERATIONTYPE_BINARY_OPERATOR: 0, + OPERATIONTYPE_BINARY_FUNCTION: 1, + OPERATIONTYPE_UNARY_PREFIX_OPERATOR: 2, + OPERATIONTYPE_UNARY_POSTFIX_OPERATOR: 3, + OPERATIONTYPE_UNARY_FUNCTION: 4, + OPERATIONTYPE_ASSIGNMENT: 5 + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {string} + */ + es3fShaderMatrixTest.getOperationName = function(op) { + switch (op) { + case es3fShaderMatrixTest.MatrixOp.OP_ADD: return '+'; + case es3fShaderMatrixTest.MatrixOp.OP_SUB: return '-'; + case es3fShaderMatrixTest.MatrixOp.OP_MUL: return '*'; + case es3fShaderMatrixTest.MatrixOp.OP_DIV: return '/'; + case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL: return 'matrixCompMult'; + case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT: return 'outerProduct'; + case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE: return 'transpose'; + case es3fShaderMatrixTest.MatrixOp.OP_INVERSE: return 'inverse'; + case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT: return 'determinant'; + case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS: return '+'; + case es3fShaderMatrixTest.MatrixOp.OP_NEGATION: return '-'; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT: return '++'; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT: return '--'; + case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT: return '++'; + case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT: return '--'; + case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO: return '+='; + case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM: return '-='; + case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO: return '*='; + case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO: return '/='; + default: + throw new Error('Error invalid Matrix Operation'); + } + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {es3fShaderMatrixTest.OperationType} + */ + es3fShaderMatrixTest.getOperationType = function (op) { + switch (op) + { + case es3fShaderMatrixTest.MatrixOp.OP_ADD: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_SUB: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_MUL: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_DIV: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION; + case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION; + case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION; + case es3fShaderMatrixTest.MatrixOp.OP_INVERSE: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION; + case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION; + case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_NEGATION: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR; + case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT; + case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT; + case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT; + case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT; + default: + throw new Error('Error invalid Matrix Operation'); + } + }; + + /** + * @enum + */ + es3fShaderMatrixTest.MatrixType = { + TESTMATRIXTYPE_DEFAULT: 0, + TESTMATRIXTYPE_NEGATED: 1, + TESTMATRIXTYPE_INCREMENTED: 2, + TESTMATRIXTYPE_DECREMENTED: 3, + TESTMATRIXTYPE_NEGATED_INCREMENTED: 4, + TESTMATRIXTYPE_INCREMENTED_LESS: 5 + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {es3fShaderMatrixTest.MatrixType} + */ + es3fShaderMatrixTest.getOperationTestMatrixType = function (op) { + switch(op) { + case es3fShaderMatrixTest.MatrixOp.OP_ADD: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_SUB: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_MUL: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_DIV: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_INVERSE: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DECREMENTED; + case es3fShaderMatrixTest.MatrixOp.OP_NEGATION: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED_INCREMENTED; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED; + case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED; + case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT; + case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED_LESS; + case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED; + case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DECREMENTED; + default: + throw new Error('Error invalid Matrix Operation'); + } + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationBinary = function (op) { + return es3fShaderMatrixTest.getOperationType(op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR || + es3fShaderMatrixTest.getOperationType(op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION || + es3fShaderMatrixTest.getOperationType(op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationMatrixScalar = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_ADD || + op == es3fShaderMatrixTest.MatrixOp.OP_SUB || + op == es3fShaderMatrixTest.MatrixOp.OP_MUL || + op == es3fShaderMatrixTest.MatrixOp.OP_DIV; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationMatrixVector = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_MUL; + }; + + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationArithmeticMatrixMatrix = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_MUL; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationComponentwiseMatrixMatrix = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_ADD || + op == es3fShaderMatrixTest.MatrixOp.OP_SUB || + op == es3fShaderMatrixTest.MatrixOp.OP_MUL || + op == es3fShaderMatrixTest.MatrixOp.OP_DIV || + op == es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationVectorVector = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationUnaryAnyMatrix = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE || + op == es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS || + op == es3fShaderMatrixTest.MatrixOp.OP_NEGATION || + op == es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT || + op == es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT || + op == es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT || + op == es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationUnarySymmetricMatrix = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_INVERSE || + op == es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationValueModifying = function (op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT || + op == es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT || + op == es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT || + op == es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationAssignment = function(op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO || + op == es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM || + op == es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO || + op == es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationAssignmentAnyMatrix = function(op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO || + op == es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM || + op == es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO; + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {boolean} + */ + es3fShaderMatrixTest.isOperationAssignmentSymmetricMatrix = function(op) { + return op == es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO; + }; + + // Operation nature + + /** + * @enum + */ + es3fShaderMatrixTest.OperationNature = { + OPERATIONNATURE_PURE: 0, + OPERATIONNATURE_MUTATING: 1, + OPERATIONNATURE_ASSIGNMENT: 2 + }; + + /** + * @param {es3fShaderMatrixTest.MatrixOp} op + * @return {es3fShaderMatrixTest.OperationNature} + */ + es3fShaderMatrixTest.getOperationNature = function (op) { + if (es3fShaderMatrixTest.isOperationAssignment(op)) + return es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_ASSIGNMENT; + if (es3fShaderMatrixTest.isOperationValueModifying(op)) + return es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_MUTATING; + return es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_PURE; + }; + + // Input value loader. + /** + * @param {es3fShaderMatrixTest.InputType} inputType + * @param {gluShaderUtil.DataType} typeFormat + * @param {glsShaderRenderCase.ShaderEvalContext} evalCtx + * @param {number} inputNdx + * @return {Array|tcuMatrix.Matrix|number} + */ + es3fShaderMatrixTest.getInputValue = function (inputType, typeFormat, evalCtx, inputNdx) { + if (inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_CONST) { + switch (typeFormat) { + case gluShaderUtil.DataType.FLOAT: + return s_constInFloat[inputNdx]; + case gluShaderUtil.DataType.FLOAT_VEC2: + return s_constInVec2[inputNdx]; + case gluShaderUtil.DataType.FLOAT_VEC3: + return s_constInVec3[inputNdx]; + case gluShaderUtil.DataType.FLOAT_VEC4: + return s_constInVec4[inputNdx]; + case gluShaderUtil.DataType.FLOAT_MAT2: + return tcuMatrix.matrixFromDataArray(2, 2, s_constInMat2x2[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT2X3: + return tcuMatrix.matrixFromDataArray(3, 2, s_constInMat2x3[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT2X4: + return tcuMatrix.matrixFromDataArray(4, 2, s_constInMat2x4[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT3X2: + return tcuMatrix.matrixFromDataArray(2, 3, s_constInMat3x2[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT3: + return tcuMatrix.matrixFromDataArray(3, 3, s_constInMat3x3[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT3X4: + return tcuMatrix.matrixFromDataArray(4, 3, s_constInMat3x4[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT4X2: + return tcuMatrix.matrixFromDataArray(2, 4, s_constInMat4x2[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT4X3: + return tcuMatrix.matrixFromDataArray(3, 4, s_constInMat4x3[inputNdx]); + case gluShaderUtil.DataType.FLOAT_MAT4: + return tcuMatrix.matrixFromDataArray(4, 4, s_constInMat4x4[inputNdx]); + } + } else if (inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) { + switch (typeFormat) { + case gluShaderUtil.DataType.FLOAT: + return evalCtx.coords[0]; + case gluShaderUtil.DataType.FLOAT_VEC2: + return deMath.swizzle(evalCtx.coords, [0, 1]); + case gluShaderUtil.DataType.FLOAT_VEC3: + return deMath.swizzle(evalCtx.coords, [0, 1, 2]); + case gluShaderUtil.DataType.FLOAT_VEC4: + return deMath.swizzle(evalCtx.coords, [0, 1, 2, 3]); + case gluShaderUtil.DataType.FLOAT_MAT2: + var m = new tcuMatrix.Matrix(2, 2); + m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1])); + m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1])); + return m; + case gluShaderUtil.DataType.FLOAT_MAT2X3: + var m = new tcuMatrix.Matrix(3, 2); + m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2])); + m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2])); + return m; + case gluShaderUtil.DataType.FLOAT_MAT2X4: + var m = new tcuMatrix.Matrix(4, 2); + m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2, 3])); + m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2, 3])); + return m; + case gluShaderUtil.DataType.FLOAT_MAT3X2: + var m = new tcuMatrix.Matrix(2, 3); + m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1])); + m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1])); + m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1])); + return m; + case gluShaderUtil.DataType.FLOAT_MAT3: + var m = new tcuMatrix.Matrix(3, 3); + m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2])); + m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2])); + m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1, 2])); + return m; + case gluShaderUtil.DataType.FLOAT_MAT3X4: + var m = new tcuMatrix.Matrix(4, 3); + m.setCol(0, evalCtx.in_[0]); + m.setCol(1, evalCtx.in_[1]); + m.setCol(2, evalCtx.in_[2]); + return m; + case gluShaderUtil.DataType.FLOAT_MAT4X2: + var m = new tcuMatrix.Matrix(2, 4); + m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1])); + m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1])); + m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1])); + m.setCol(3, deMath.swizzle(evalCtx.in_[3], [0, 1])); + return m; + case gluShaderUtil.DataType.FLOAT_MAT4X3: + var m = new tcuMatrix.Matrix(3, 4); + m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2])); + m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2])); + m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1, 2])); + m.setCol(3, deMath.swizzle(evalCtx.in_[3], [0, 1, 2])); + return m; + case gluShaderUtil.DataType.FLOAT_MAT4: + var m = new tcuMatrix.Matrix(4, 4); + m.setCol(0, evalCtx.in_[0]); + m.setCol(1, evalCtx.in_[1]); + m.setCol(2, evalCtx.in_[2]); + m.setCol(3, evalCtx.in_[3]); + return m; + } + } + throw new Error('Invalid input type'); + }; + + /** + * @param {Array} value + * @return {Array} + */ + es3fShaderMatrixTest.reduceVecToVec3 = function (value) { + if (value.length == 3) { + return value; + } else if (value.length == 2) { + return deMath.swizzle(value, [0, 1, 0]) + } else { + return [value[0], value[1], value[2] + value[3]]; + } + }; + + /** + * @param {tcuMatrix.Matrix} value + * @return {Array} + */ + es3fShaderMatrixTest.reduceMatToVec3 = function (value) { + if (value.cols == 2) { + if (value.rows == 2) { + // mat2 + return [value.get(0, 0), value.get(0, 1), value.get(1, 0) + value.get(1, 1)]; + } else if (value.rows == 3){ + //mat2x3 + return deMath.add(value.getColumn(0), value.getColumn(1)); + } else { + //mat2x4 + return deMath.add(deMath.swizzle(value.getColumn(0), [0, 1, 2]), deMath.swizzle(value.getColumn(1), [1, 2, 3])); + } + } else if (value.cols == 3) { + if (value.rows == 2) { + return [value.get(0, 0) + value.get(1, 0), value.get(0, 1) + value.get(1, 1), value.get(0, 2) + value.get(1, 2)]; + } else if (value.rows == 3) { + return deMath.add(deMath.add(value.getColumn(0), value.getColumn(1)), value.getColumn(2)); + } else { + return deMath.add(deMath.add(deMath.swizzle(value.getColumn(0), [0, 1, 2]), deMath.swizzle(value.getColumn(1), [1, 2, 3])), deMath.swizzle(value.getColumn(2), [2, 3, 0])) + } + } else { + if (value.rows == 2) { + return [value.get(0, 0) + value.get(1, 0) + value.get(0, 3), value.get(0, 1) + value.get(1, 1) + value.get(1, 3), value.get(0, 2) + value.get(1, 2)]; + } else if (value.rows == 3) { + return deMath.add(deMath.add(deMath.add(value.getColumn(0), value.getColumn(1)), value.getColumn(2)), value.getColumn(3)); + } else { + return deMath.add(deMath.add(deMath.add(deMath.swizzle(value.getColumn(0), [0, 1, 2]), deMath.swizzle(value.getColumn(1), [1, 2, 3])), deMath.swizzle(value.getColumn(2), [2, 3, 0])), deMath.swizzle(value.getColumn(3), [3, 0, 1])); + } + } + }; + + /** + * @param {Array|tcuMatrix.Matrix|number} value + * @return {Array} + */ + es3fShaderMatrixTest.reduceToVec3 = function (value) { + if (value instanceof tcuMatrix.Matrix) + return es3fShaderMatrixTest.reduceMatToVec3(value); + else if (value instanceof Array) + return es3fShaderMatrixTest.reduceVecToVec3(value); + else + throw new Error('Impossible case'); + }; + + es3fShaderMatrixTest.add = function (a, b) { + if (a instanceof tcuMatrix.Matrix) { + if (b instanceof tcuMatrix.Matrix) + return tcuMatrix.add(a, b); + else if (b instanceof Array) + throw new Error('Unimplemented'); + else + return tcuMatrix.addMatScal(a, b); + } + else { + if (b instanceof tcuMatrix.Matrix) + throw new Error('Unimplemented'); + else + return deMath.add(a, b); + } + }; + + es3fShaderMatrixTest.subtract = function (a, b) { + if (a instanceof tcuMatrix.Matrix) { + if (b instanceof tcuMatrix.Matrix) + return tcuMatrix.subtract(a, b); + else if (b instanceof Array) + throw new Error('Unimplemented'); + else + return tcuMatrix.subtractMatScal(a, b); + } + else { + if (b instanceof tcuMatrix.Matrix) + throw new Error('Unimplemented'); + else + return deMath.subtract(a, b); + } + }; + + es3fShaderMatrixTest.multiply = function (a, b) { + if (a instanceof tcuMatrix.Matrix) { + if (b instanceof tcuMatrix.Matrix) + return tcuMatrix.multiply(a, b); + else if (b instanceof Array) + return tcuMatrix.multiplyMatVec(a, b); + else + return tcuMatrix.multiplyMatScal(a, b); + } else { + if (b instanceof tcuMatrix.Matrix) + return tcuMatrix.multiplyVecMat(a, b); + else + return deMath.multiply(a, b); + } + }; + + es3fShaderMatrixTest.divide = function (a, b) { + if (a instanceof tcuMatrix.Matrix) { + if (b instanceof tcuMatrix.Matrix) + return tcuMatrix.divide(a, b); + else if (b instanceof Array) + throw new Error('Unimplemented'); + else + return tcuMatrix.divideMatScal(a, b); + } + else { + if (b instanceof tcuMatrix.Matrix) + throw new Error('Unimplemented'); + else + return deMath.divide(a, b); + } + }; + + + /** + * @param {tcuMatrix.Matrix} a + * @param {tcuMatrix.Matrix} b + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.matrixCompMult = function (a, b) { + /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(a.rows, a.cols); + + for (var r = 0; r < a.rows; ++r) { + for (var c = 0; c < a.cols; ++c) { + retVal.set(r, c, a.get(r, c) * b.get(r, c)); + } + } + return retVal; + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.transpose = function (mat) { + /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.cols, mat.rows); + + for (var r = 0; r < mat.rows; ++r) { + for (var c = 0; c < mat.cols; ++c) { + retVal.set(c, r, mat.get(r, c)); + } + } + + return retVal; + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {number} + */ + es3fShaderMatrixTest.determinantMat2 = function (mat) { + return mat.get(0, 0) * mat.get(1, 1) - mat.get(1, 0) * mat.get(0,1); + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {number} + */ + es3fShaderMatrixTest.determinantMat3 = function (mat) { + return + mat.get(0, 0) * mat.get(1, 1) * mat.get(2, 2) + + mat.get(0, 1) * mat.get(1, 2) * mat.get(2, 0) + + mat.get(0, 2) * mat.get(1, 0) * mat.get(2, 1) + - mat.get(0, 0) * mat.get(1, 2) * mat.get(2, 1) + - mat.get(0, 1) * mat.get(1, 0) * mat.get(2, 2) + - mat.get(0, 2) * mat.get(1, 1) * mat.get(2, 0); + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {number} + */ + es3fShaderMatrixTest.determinantMat4 = function (mat) { + /** @type {Array>} */ var minorMatrices = [ + [ + mat.get(1, 1), mat.get(2, 1), mat.get(3, 1), + mat.get(1, 2), mat.get(2, 2), mat.get(3, 2), + mat.get(1, 3), mat.get(2, 3), mat.get(3, 3) + ], + [ + mat.get(1, 0), mat.get(2, 0), mat.get(3, 0), + mat.get(1, 2), mat.get(2, 2), mat.get(3, 2), + mat.get(1, 3), mat.get(2, 3), mat.get(3, 3) + ], + [ + mat.get(1, 0), mat.get(2, 0), mat.get(3, 0), + mat.get(1, 1), mat.get(2, 1), mat.get(3, 1), + mat.get(1, 3), mat.get(2, 3), mat.get(3, 3) + ], + [ + mat.get(1, 0), mat.get(2, 0), mat.get(3, 0), + mat.get(1, 1), mat.get(2, 1), mat.get(3, 1), + mat.get(1, 2), mat.get(2, 2), mat.get(3, 2) + ] + ]; + + return + mat.get(0, 0) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[0])) + - mat.get(0, 1) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[1])) + + mat.get(0, 2) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[2])) + - mat.get(0, 3) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[3])); + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {number} + */ + es3fShaderMatrixTest.determinant = function (mat) { + if (mat.rows == 2) { + return es3fShaderMatrixTest.determinantMat2(mat); + } else if (mat.rows == 3) { + return es3fShaderMatrixTest.determinantMat3(mat); + } else { + return es3fShaderMatrixTest.determinantMat4(mat); + } + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.inverseMat2 = function (mat) { + /** @type {number} */ var det = es3fShaderMatrixTest.determinant(mat); + /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Mat2(); + + if (det == 0.0) { + throw new Error('Wrong determinant') + } + + retVal.set(0, 0, mat.get(1, 1) / det); + retVal.set(0, 1, -mat.get(0, 1) / det); + retVal.set(1, 0, -mat.get(1, 0) / det); + retVal.set(1, 1, mat.get(0, 0) / det); + + return retVal; + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.inverseMat3 = function (mat) { + if (es3fShaderMatrixTest.determinant(mat) == 0.0) { + throw new Error('Wrong determinant') + } + + /** @type {Array} */ var areaA = [mat.get(0, 0), mat.get(0, 1), mat.get(1, 0), mat.get(1,1)]; + /** @type {Array} */ var areaB = [mat.get(0, 2), mat.get(1, 2)]; + /** @type {Array} */ var areaC = [mat.get(2, 0), mat.get(2, 1)]; + /** @type {Array} */ var areaD = [mat.get(2,2)]; + + /** @type {tcuMatrix.Matrix} */ var invA = es3fShaderMatrixTest.inverse(tcuMatrix.matrixFromDataArray(2, 2, areaA)); + /** @type {tcuMatrix.Matrix} */ var matB = tcuMatrix.matrixFromDataArray(2, 1, areaB); + /** @type {tcuMatrix.Matrix} */ var matC = tcuMatrix.matrixFromDataArray(1, 2, areaC); + /** @type {tcuMatrix.Matrix} */ var matD = tcuMatrix.matrixFromDataArray(1, 1, areaD); + + /** @type {tcuMatrix.Matrix} */ var tmp = tcuMatrix.subtract(matD, tcuMatrix.multiply(matC, tcuMatrix.multiply(invA, matB))); + /** @type {number} */ var schurComplement = 1.0 / tmp.get(0, 0); + /** @type {tcuMatrix.Matrix} */ var zeroMat = new tcuMatrix.Matrix(2, 2, 0); + + /** @type {tcuMatrix.Matrix} */ var blockA = tcuMatrix.add(invA, tcuMatrix.multiply(tcuMatrix.multiply(invA, tcuMatrix.multiply(tcuMatrix.multiplyMatScal(matB, schurComplement), matC)), invA)); + /** @type {tcuMatrix.Matrix} */ var blockB = tcuMatrix.multiplyMatScal(tcuMatrix.multiply(tcuMatrix.subtract(zeroMat, invA), matB), schurComplement); + /** @type {tcuMatrix.Matrix} */ var blockC = tcuMatrix.multiply(matC, tcuMatrix.multiplyMatScal(invA, - schurComplement)); + /** @type {number} */ var blockD = schurComplement; + + /** @type {Array} */ var result = [ + blockA.get(0, 0), blockA.get(0, 1), blockB.get(0, 0), + blockA.get(1, 0), blockA.get(1, 1), blockB.get(1, 0), + blockC.get(0, 0), blockC.get(0, 1), blockD + ]; + + return tcuMatrix.matrixFromDataArray(3, 3, result); + } + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.inverseMat4 = function (mat) { + // Blockwise inversion + if (es3fShaderMatrixTest.determinant(mat) == 0.0) { + throw new Error('Wrong determinant') + } + + /** @type {Array} */ var areaA = [ + mat.get(0, 0), mat.get(0, 1), + mat.get(1, 0), mat.get(1, 1) + ]; + /** @type {Array} */ var areaB = [ + mat.get(0, 2), mat.get(0, 3), + mat.get(1, 2), mat.get(1, 3) + ]; + /** @type {Array} */ var areaC = [ + mat.get(2, 0), mat.get(2, 1), + mat.get(3, 0), mat.get(3, 1) + ]; + /** @type {Array} */ var areaD = [ + mat.get(2, 2), mat.get(2, 3), + mat.get(3, 2), mat.get(3, 3) + ]; + + /** @type {tcuMatrix.Matrix} */ var invA = es3fShaderMatrixTest.inverse(tcuMatrix.matrixFromDataArray(2, 2, areaA)); + /** @type {tcuMatrix.Matrix} */ var matB = tcuMatrix.matrixFromDataArray(2, 2, areaB); + /** @type {tcuMatrix.Matrix} */ var matC = tcuMatrix.matrixFromDataArray(2, 2, areaC); + /** @type {tcuMatrix.Matrix} */ var matD = tcuMatrix.matrixFromDataArray(2, 2, areaD); + + /** @type {tcuMatrix.Matrix} */ var schurComplement = es3fShaderMatrixTest.inverse(tcuMatrix.subtract(matD, (tcuMatrix.multiply(matC, tcuMatrix.multiply(invA, matB))))); + /** @type {tcuMatrix.Matrix} */ var zeroMat = new tcuMatrix.Matrix(2, 2, 0); + + /** @type {tcuMatrix.Matrix} */ var blockA = tcuMatrix.add(invA, tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.multiply(invA, matB), schurComplement), matC), invA)); + /** @type {tcuMatrix.Matrix} */ var blockB = tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.subtract(zeroMat, invA), matB), schurComplement); + /** @type {tcuMatrix.Matrix} */ var blockC = tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.subtract(zeroMat, schurComplement),matC), invA); + /** @type {tcuMatrix.Matrix} */ var blockD = schurComplement; + + /** @type {Array} */ var result = [ + blockA.get(0, 0), blockA.get(0, 1), blockB.get(0, 0), blockB.get(0, 1), + blockA.get(1, 0), blockA.get(1, 1), blockB.get(1, 0), blockB.get(1, 1), + blockC.get(0, 0), blockC.get(0, 1), blockD.get(0, 0), blockD.get(0, 1), + blockC.get(1, 0), blockC.get(1, 1), blockD.get(1, 0), blockD.get(1, 1) + ]; + + return tcuMatrix.matrixFromDataArray(4, 4, result); + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.inverse = function (mat) { + if (mat.cols == 2) { + return es3fShaderMatrixTest.inverseMat2(mat) + } else if (mat.cols == 3) { + return es3fShaderMatrixTest.inverseMat3(mat) + } else { + return es3fShaderMatrixTest.inverseMat4(mat) + } + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.negate = function (mat) { + /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.rows, mat.cols); + + for (var r = 0; r < mat.rows; ++r) + for (var c = 0; c < mat.cols; ++c) + retVal.set(r,c, -mat.get(r, c)); + + return retVal; + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.increment = function (mat) { + /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.rows, mat.cols); + + for (var r = 0; r < mat.rows; ++r) + for (var c = 0; c < mat.cols; ++c) + retVal.set(r,c, mat.get(r, c) + 1.0); + + return retVal; + }; + + /** + * @param {tcuMatrix.Matrix} mat + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.decrement = function (mat) { + /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.rows, mat.cols); + + for (var r = 0; r < mat.rows; ++r) + for (var c = 0; c < mat.cols; ++c) + retVal.set(r,c, mat.get(r, c) - 1.0); + + return retVal; + }; + + /** + * @param {Array} a + * @param {Array} b + * @return {tcuMatrix.Matrix} + */ + es3fShaderMatrixTest.outerProduct = function (a, b) { + /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(b.length, a.length); + + for (var r = 0; r < b.length; ++r) { + for (var c = 0; c < a.length; ++c) { + retVal.set(r, c, a[c] * b[r]); + } + } + + return es3fShaderMatrixTest.transpose(retVal); + }; + + /** + * @enum + */ + es3fShaderMatrixTest.InputType = { + INPUTTYPE_CONST: 0, + INPUTTYPE_UNIFORM: 1, + INPUTTYPE_DYNAMIC: 2 + }; + + /** + * @enum + */ + es3fShaderMatrixTest.MatrixOp = { + OP_ADD: 0, + OP_SUB: 1, + OP_MUL: 2, + OP_DIV: 3, + OP_COMP_MUL: 4, + OP_OUTER_PRODUCT: 5, + OP_TRANSPOSE: 6, + OP_INVERSE: 7, + OP_DETERMINANT: 8, + OP_UNARY_PLUS: 9, + OP_NEGATION: 10, + OP_PRE_INCREMENT: 11, + OP_PRE_DECREMENT: 12, + OP_POST_INCREMENT: 13, + OP_POST_DECREMENT: 14, + OP_ADD_INTO: 15, + OP_SUBTRACT_FROM: 16, + OP_MULTIPLY_INTO: 17, + OP_DIVIDE_INTO: 18, + OP_LAST: 19 + }; + + /** + * @constructor + * @param {es3fShaderMatrixTest.InputType=} inputType_ + * @param {gluShaderUtil.DataType=} dataType_ + * @param {gluShaderUtil.precision=} precision_ + * @struct + */ + es3fShaderMatrixTest.ShaderInput = function (inputType_, dataType_, precision_){ + this.inputType = inputType_ || es3fShaderMatrixTest.InputType.INPUTTYPE_CONST; + this.dataType = dataType_ || gluShaderUtil.DataType.INVALID; + this.precision = precision_ || gluShaderUtil.precision.PRECISION_LOWP; + }; + + /** + * @param {es3fShaderMatrixTest.ShaderInput} in0 + * @param {es3fShaderMatrixTest.ShaderInput} in1 + * @param {es3fShaderMatrixTest.MatrixOp} op + */ + es3fShaderMatrixTest.getEvalFunc = function (in0, in1, op) { + var setColor = function(evalCtx, src) { + for (var i = 0; i < 3; i++) + evalCtx.color[i] = src[i]; + }; + switch(op){ + case es3fShaderMatrixTest.MatrixOp.OP_ADD: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.add(in0_, in1_))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_SUB: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.subtract(in0_, in1_))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_MUL: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.multiply(in0_, in1_))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_DIV: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.divide(in0_, in1_))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.matrixCompMult(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.outerProduct(/** @type {Array} */(in0_), /** @type {Array} */(in1_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.transpose(/** @type {tcuMatrix.Matrix} */(in0_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_INVERSE: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.inverse(/** @type {tcuMatrix.Matrix} */(in0_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + var det = es3fShaderMatrixTest.determinant(/** @type {tcuMatrix.Matrix} */(in0_)); + setColor(evalCtx, [det, det, det]); + }; + case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(/** @type {tcuMatrix.Matrix} */(in0_))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_NEGATION: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.negate(/** @type {tcuMatrix.Matrix} */(in0_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + var val0 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.increment(/** @type {tcuMatrix.Matrix} */(in0_))); + var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.increment(/** @type {tcuMatrix.Matrix} */(in0_))); + setColor(evalCtx, deMath.add(val0, val1)); + }; + case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + var val0 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.decrement(/** @type {tcuMatrix.Matrix} */(in0_))); + var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.decrement(/** @type {tcuMatrix.Matrix} */(in0_))); + setColor(evalCtx, deMath.add(val0, val1)); + }; + case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + var val0 = es3fShaderMatrixTest.reduceToVec3((in0_)); + var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.increment(/** @type {tcuMatrix.Matrix} */(in0_))); + setColor(evalCtx, deMath.add(val0, val1)); + }; + case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + + var val0 = es3fShaderMatrixTest.reduceToVec3((in0_)); + var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.decrement(/** @type {tcuMatrix.Matrix} */(in0_))); + setColor(evalCtx, deMath.add(val0, val1)); + }; + case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in0.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.add(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in0.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.subtract(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in0.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.multiply(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_)))); + }; + case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO: + return function (evalCtx) { + var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0); + var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? + es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1) + : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1); + + setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.divide(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_)))); + }; + } + }; + + /** + * @constructor + * @param {es3fShaderMatrixTest.MatrixShaderEvalFunc} evalFunc + * @param {es3fShaderMatrixTest.InputType} inType0 + * @param {es3fShaderMatrixTest.InputType} inType1 + * @extends {glsShaderRenderCase.ShaderEvaluator} + */ + es3fShaderMatrixTest.MatrixShaderEvaluator = function(evalFunc, inType0, inType1) { + glsShaderRenderCase.ShaderEvaluator.call(this); + this.m_matEvalFunc = evalFunc; + this.m_inType0 = inType0; + this.m_inType1 = inType1; + }; + + es3fShaderMatrixTest.MatrixShaderEvaluator.prototype = Object.create(glsShaderRenderCase.ShaderEvaluator); + es3fShaderMatrixTest.MatrixShaderEvaluator.prototype.constructor = es3fShaderMatrixTest.MatrixShaderEvaluator; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} evalCtx + */ + es3fShaderMatrixTest.MatrixShaderEvaluator.prototype.evaluate = function (evalCtx) { + this.m_matEvalFunc(evalCtx); + } + + /** + * @param {Array} v + * @param {number} size + */ + es3fShaderMatrixTest.writeVectorConstructor = function (v, size) { + var str = 'vec' + size + ''; + for (var ndx = 0; ndx < size; ndx++) { + if (ndx != 0) + str += ', '; + str += v[ndx].toString; + } + str += ')'; + return str; + } + + /** + * @param {tcuMatrix.Matrix} m + */ + es3fShaderMatrixTest.writeMatrixConstructor = function (m) { + var str = ''; + if (m.rows == m.cols) + str += 'mat' + m.cols; + else + str += 'mat' + m.cols + 'x' + m.rows; + + str += '('; + for (var colNdx = 0; colNdx < m.cols; colNdx++) { + for (var rowNdx = 0; rowNdx < m.rows; rowNdx++) { + if (rowNdx > 0 || colNdx > 0) + str += ', '; + str += m.get(rowNdx, colNdx).toString(); + } + } + str += ')'; + return str; + }; + + /** + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fShaderMatrixTest.ShaderInput} in0 + * @param {es3fShaderMatrixTest.ShaderInput} in1 + * @param {es3fShaderMatrixTest.MatrixOp} op + * @param {boolean} isVertexCase + * @extends {glsShaderRenderCase.ShaderRenderCase} + */ + es3fShaderMatrixTest.ShaderMatrixCase = function(name, desc, in0, in1, op, isVertexCase) { + var evalFunc = es3fShaderMatrixTest.getEvalFunc(in0, in1, op); + glsShaderRenderCase.ShaderRenderCase.call(this, name, desc, isVertexCase, evalFunc); + this.m_in0 = in0; + this.m_in1 = in1; + this.m_op = op; + this.m_evaluator = new es3fShaderMatrixTest.MatrixShaderEvaluator(evalFunc, in0.inputType, in1.inputType); + }; + + es3fShaderMatrixTest.ShaderMatrixCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype); + es3fShaderMatrixTest.ShaderMatrixCase.prototype.constructor = es3fShaderMatrixTest.ShaderMatrixCase; + + + es3fShaderMatrixTest.ShaderMatrixCase.prototype.init = function () { + var shaderSources = [ '', '' ]; + var vtx = 0; + var frag = 1; + var op = this.m_isVertexCase ? vtx : frag; + + /** @type {boolean} */ var isInDynMat0 = gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) && this.m_in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC; + /** @type {boolean} */ var isInDynMat1 = gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType) && this.m_in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC; + /** @type {Array} */ var inValues = []; + /** @type {gluShaderUtil.DataType} */ var resultType; + /** @type {gluShaderUtil.precision} */ var resultPrec = this.m_in0.precision; + /** @type {Array} */ var passVars = []; + /** @type {number} */ var numInputs = (es3fShaderMatrixTest.isOperationBinary(this.m_op)) ? (2) : (1); + + /** @type {string} */ var operationValue0 = ''; + /** @type {string} */ var operationValue1 = ''; + + if (isInDynMat0 && isInDynMat1) { + throw new Error ('Only single dynamic matrix input is allowed.'); + } + + if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_MUL && gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) && gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType)) { + resultType = gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeMatrixNumColumns(this.m_in1.dataType), gluShaderUtil.getDataTypeMatrixNumRows(this.m_in0.dataType)); + } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT) { + resultType = gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeScalarSize(this.m_in1.dataType), gluShaderUtil.getDataTypeScalarSize(this.m_in0.dataType)); + } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE) { + resultType = gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeMatrixNumRows(this.m_in0.dataType), gluShaderUtil.getDataTypeMatrixNumColumns(this.m_in0.dataType)); + } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_INVERSE) { + resultType = this.m_in0.dataType; + } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT) { + resultType = gluShaderUtil.DataType.FLOAT; + } else if (es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR || + es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR) { + resultType = this.m_in0.dataType; + } else if (gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) && gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType)) { + if (this.m_in0.dataType !== this.m_in1.dataType) { + throw new Error ('Incompatible data types'); + } + resultType = this.m_in0.dataType; + } else if (gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) || gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType)) { + /** @type {number} */ var matNdx = gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) ? 0 : 1; + /** @type {gluShaderUtil.DataType} */ var matrixType = matNdx == 0 ? this.m_in0.dataType : this.m_in1.dataType; + /** @type {gluShaderUtil.DataType} */ var otherType = matNdx == 0 ? this.m_in1.dataType : this.m_in0.dataType; + + if (otherType == gluShaderUtil.DataType.FLOAT) + resultType = matrixType; + else { + if (!gluShaderUtil.isDataTypeVector(otherType)) { + throw new Error ('Is not data type vector'); + } + resultType = gluShaderUtil.getDataTypeFloatVec(matNdx == 0 ? gluShaderUtil.getDataTypeMatrixNumRows(matrixType) : gluShaderUtil.getDataTypeMatrixNumColumns(matrixType)); + } + } else { + throw new Error ('Error'); + } + + shaderSources[vtx] += '#version 300 es\n'; + shaderSources[frag] += '#version 300 es\n'; + + shaderSources[vtx] += 'in highp vec4 a_position;\n'; + shaderSources[frag] += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + if (this.m_isVertexCase) { + shaderSources[vtx] += 'out mediump vec4 v_color;\n'; + shaderSources[frag] += 'in mediump vec4 v_color;\n'; + } + + // Input declarations. + for (var inNdx = 0; inNdx < numInputs; inNdx++) { + /** @type {es3fShaderMatrixTest.ShaderInput} */ var ind = inNdx > 0 ? this.m_in1 : this.m_in0; + /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(ind.precision); + /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(ind.dataType); + /** @type {number} */ var inValueNdx = inNdx > 0 ? 1 : 0; + + if (ind.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) { + shaderSources[vtx] += 'in ' + precName + ' ' + typeName + ' a_'; + + if (gluShaderUtil.isDataTypeMatrix(ind.dataType)) { + // a_matN, v_matN + shaderSources[vtx] += typeName + ';\n'; + if (!this.m_isVertexCase) { + shaderSources[vtx] += 'out ' + precName + ' ' + typeName + ' v_' + typeName + ';\n'; + shaderSources[frag] += 'in ' + precName + ' ' + typeName + ' v_' + typeName + ';\n'; + passVars.push(typeName); + } + + inValues[inValueNdx] = (this.m_isVertexCase ? 'a_' : 'v_') + gluShaderUtil.getDataTypeName(ind.dataType); + } else { + // a_coords, v_coords + shaderSources[vtx] += 'coords;\n'; + if (!this.m_isVertexCase) { + shaderSources[vtx] += 'out ' + precName + ' ' + typeName + ' v_coords;\n'; + shaderSources[frag] += 'in ' + precName + ' ' + typeName + ' v_coords;\n'; + passVars.push('coords'); + } + + inValues[inValueNdx] = this.m_isVertexCase ? 'a_coords' : 'v_coords'; + } + } else if (ind.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM) { + shaderSources[op] += 'uniform ' + precName + ' ' + typeName + ' u_in' + inNdx + ';\n'; + inValues[inValueNdx] = 'u_in' + inNdx.toString(); + } else if (ind.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_CONST) { + shaderSources[op] += 'const ' + precName + ' ' + typeName + ' in' + inNdx + ' = '; + + // Generate declaration. + switch (ind.dataType) { + case gluShaderUtil.DataType.FLOAT: + shaderSources[op] += s_constInFloat[inNdx].toString(); + break; + case gluShaderUtil.DataType.FLOAT_VEC2: + shaderSources[op] += es3fShaderMatrixTest.writeVectorConstructor( s_constInVec2[inNdx], 2); + break; + case gluShaderUtil.DataType.FLOAT_VEC3: + shaderSources[op] += es3fShaderMatrixTest.writeVectorConstructor( s_constInVec3[inNdx], 3); + break; + case gluShaderUtil.DataType.FLOAT_VEC4: + shaderSources[op] += es3fShaderMatrixTest.writeVectorConstructor( s_constInVec4[inNdx], 4); + break; + case gluShaderUtil.DataType.FLOAT_MAT2: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(2, 2, s_constInMat2x2[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT2X3: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(3, 2, s_constInMat2x3[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT2X4: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(4, 2, s_constInMat2x4[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT3X2: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(2, 3, s_constInMat3x2[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT3: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(3, 3, s_constInMat3x3[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT3X4: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(4, 3, s_constInMat3x4[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT4X2: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(2, 4, s_constInMat4x2[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT4X3: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(3, 4, s_constInMat4x3[inNdx])); + break; + case gluShaderUtil.DataType.FLOAT_MAT4: + shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(4, 4, s_constInMat4x4[inNdx])); + break; + + default: + throw new Error('Data type error'); + } + + shaderSources[op] += ';\n'; + + inValues[inValueNdx] = 'in' + inNdx.toString(); + } + } + + shaderSources[vtx] += '\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n'; + shaderSources[frag] += '\n' + + 'void main (void)\n' + + '{\n'; + + if (this.m_isVertexCase) + shaderSources[frag] += ' dEQP_FragColor = v_color;\n'; + else { + for (var i = 0; i != passVars.length; i++) + shaderSources[vtx] += ' v_' + passVars[i] + ' = ' + 'a_' + passVars[i] + ';\n'; + } + + // Operation. + + switch (es3fShaderMatrixTest.getOperationNature(this.m_op)) { + case es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_PURE: + if (es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT) + throw new Error('Wrong operation type'); + + operationValue0 = inValues[0]; + operationValue1 = inValues[1]; + break; + + case es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_MUTATING: + if (es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT) + throw new Error('Wrong operation type'); + + shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' ' + gluShaderUtil.getDataTypeName(resultType) + ' tmpValue = ' + inValues[0] + ';\n'; + + operationValue0 = 'tmpValue'; + operationValue1 = inValues[1]; + break; + + case es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_ASSIGNMENT: + if (es3fShaderMatrixTest.getOperationType(this.m_op) != es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT) + throw new Error('Wrong operation type'); + + operationValue0 = inValues[0]; + operationValue1 = inValues[1]; + break; + + default: + throw new Error('Wrong operation nature'); + } + + switch (es3fShaderMatrixTest.getOperationType(this.m_op)) { + case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR: + shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' ' + + gluShaderUtil.getDataTypeName(resultType) + + ' res = ' + operationValue0 + ' ' + + es3fShaderMatrixTest.getOperationName(this.m_op) + ' ' + + operationValue1 + ';\n'; + break; + case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR: + shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' ' + + gluShaderUtil.getDataTypeName(resultType) + + ' res = ' + es3fShaderMatrixTest.getOperationName(this.m_op) + + operationValue0 + ';\n'; + break; + case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR: + shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' ' + + gluShaderUtil.getDataTypeName(resultType) + + ' res = ' + operationValue0 + + es3fShaderMatrixTest.getOperationName(this.m_op) + ';\n'; + break; + case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION: + shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + + ' ' + gluShaderUtil.getDataTypeName(resultType) + + ' res = ' + es3fShaderMatrixTest.getOperationName(this.m_op) + + '(' + operationValue0 + + ', ' + operationValue1 + ');\n'; + break; + case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION: + shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + + ' ' + gluShaderUtil.getDataTypeName(resultType) + + ' res = ' + es3fShaderMatrixTest.getOperationName(this.m_op) + + '(' + operationValue0 + ');\n'; + break; + case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT: + shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + + ' ' + gluShaderUtil.getDataTypeName(resultType) + + ' res = ' + operationValue0 + ';\n'; + shaderSources[op] += ' res ' + es3fShaderMatrixTest.getOperationName(this.m_op) + + ' ' + operationValue1 + ';\n'; + break; + default: + throw new Error('Wrong operation type'); + } + + // Reduction to vec3 (rgb). Check the used value too if it was modified + shaderSources[op] += ' ' + (this.m_isVertexCase ? 'v_color' : 'dEQP_FragColor') + ' = '; + + if (es3fShaderMatrixTest.isOperationValueModifying(this.m_op)) + shaderSources[op] += 'vec4(' + this.genGLSLMatToVec3Reduction(resultType, 'res') + + ', 1.0) + vec4(' + this.genGLSLMatToVec3Reduction(resultType, 'tmpValue') + + ', 0.0);\n'; + else + shaderSources[op] += 'vec4(' + this.genGLSLMatToVec3Reduction(resultType, 'res') + + ', 1.0);\n'; + + shaderSources[vtx] += '}\n'; + shaderSources[frag] += '}\n'; + + this.m_vertShaderSource = shaderSources[vtx]; + this.m_fragShaderSource = shaderSources[frag]; + + // \todo [2012-02-14 pyry] Compute better values for matrix tests. + for (var attribNdx = 0; attribNdx < 4; attribNdx++) { + this.m_userAttribTransforms[attribNdx] = new tcuMatrix.Matrix(4, 4, 0); + this.m_userAttribTransforms[attribNdx].set(0, 3, 0.2);// !< prevent matrix*vec from going into zero (assuming vec.w != 0) + this.m_userAttribTransforms[attribNdx].set(1, 3, 0.1);// !< + this.m_userAttribTransforms[attribNdx].set(2, 3, 0.4 + 0.15 * attribNdx);// !< + this.m_userAttribTransforms[attribNdx].set(3, 3, 0.7);// !< + this.m_userAttribTransforms[attribNdx].set((0 + attribNdx) % 4, 0, 1.0); + this.m_userAttribTransforms[attribNdx].set((1 + attribNdx) % 4, 1, 1.0); + this.m_userAttribTransforms[attribNdx].set((2 + attribNdx) % 4, 2, 1.0); + this.m_userAttribTransforms[attribNdx].set((3 + attribNdx) % 4, 3, 1.0); + } + + // prevent bad reference cases such as black result images by fine-tuning used matrices + if (es3fShaderMatrixTest.getOperationTestMatrixType(this.m_op) != es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT) { + for (var attribNdx = 0; attribNdx < 4; attribNdx++) { + for (var row = 0; row < 4; row++) + for (var col = 0; col < 4; col++) { + switch (es3fShaderMatrixTest.getOperationTestMatrixType(this.m_op)) { + case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED: + this.m_userAttribTransforms[attribNdx].set(row, col, -this.m_userAttribTransforms[attribNdx].get(row, col)); + break; + case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED: + this.m_userAttribTransforms[attribNdx].set(row, col, this.m_userAttribTransforms[attribNdx].get(row, col) + 0.3); + break; + case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DECREMENTED: + this.m_userAttribTransforms[attribNdx].set(row, col, this.m_userAttribTransforms[attribNdx].get(row, col) - 0.3); + break; + case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED_INCREMENTED: + this.m_userAttribTransforms[attribNdx].set(row, col, -(this.m_userAttribTransforms[attribNdx].get(row, col) + 0.3)); + break; + case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED_LESS: + this.m_userAttribTransforms[attribNdx].set(row, col, this.m_userAttribTransforms[attribNdx].get(row, col) - 0.1); + break; + default: + throw new Error('Wrong Matrix type'); + } + } + } + } + + glsShaderRenderCase.ShaderRenderCase.prototype.init.call(this); + }; + + + es3fShaderMatrixTest.ShaderMatrixCase.prototype.setupUniforms = function(programId, constCoords) { + for (var inNdx = 0; inNdx < 2; inNdx++) + { + var input = inNdx > 0 ? this.m_in1 : this.m_in0; + + if (input.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM) + { + var loc = gl.getUniformLocation(programId, "u_in" + inNdx); + + if (!loc) + continue; + + switch (input.dataType) + { + case gluShaderUtil.DataType.FLOAT: gl.uniform1f(loc, s_constInFloat[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_VEC2: gl.uniform2fv(loc, s_constInVec2[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_VEC3: gl.uniform3fv(loc, s_constInVec3[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_VEC4: gl.uniform4fv(loc, s_constInVec4[inNdx]); break; + // \note GLES3 supports transpose in matrix upload. + case gluShaderUtil.DataType.FLOAT_MAT2: gl.uniformMatrix2fv (loc, true, s_constInMat2x2[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT2X3: gl.uniformMatrix2x3fv(loc, true, s_constInMat2x3[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT2X4: gl.uniformMatrix2x4fv(loc, true, s_constInMat2x4[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT3X2: gl.uniformMatrix3x2fv(loc, true, s_constInMat3x2[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT3: gl.uniformMatrix3fv (loc, true, s_constInMat3x3[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT3X4: gl.uniformMatrix3x4fv(loc, true, s_constInMat3x4[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT4X2: gl.uniformMatrix4x2fv(loc, true, s_constInMat4x2[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT4X3: gl.uniformMatrix4x3fv(loc, true, s_constInMat4x3[inNdx]); break; + case gluShaderUtil.DataType.FLOAT_MAT4: gl.uniformMatrix4fv (loc, true, s_constInMat4x4[inNdx]); break; + default: + throw new Error('Invalid datatype' + input.dataType); + } + } + } + }; + + + + /** + * @param {gluShaderUtil.DataType} matType + * @param {string} varName + * @return {string} + */ + es3fShaderMatrixTest.ShaderMatrixCase.prototype.genGLSLMatToVec3Reduction = function (matType, varName) { + /** @type {string} */ var op = ''; + + switch (matType) { + case gluShaderUtil.DataType.FLOAT: + op += varName + ', ' + + varName + ', ' + + varName + ''; + break; + case gluShaderUtil.DataType.FLOAT_VEC2: + op += varName + '.x, ' + + varName + '.y, ' + + varName + '.x'; + break; + case gluShaderUtil.DataType.FLOAT_VEC3: + op += varName + ''; + break; + case gluShaderUtil.DataType.FLOAT_VEC4: + op += varName + '.x, ' + + varName + '.y, ' + + varName + '.z+' + + varName + '.w'; + break; + case gluShaderUtil.DataType.FLOAT_MAT2: + op += varName + '[0][0], ' + + varName + '[1][0], ' + + varName + '[0][1]+' + + varName + '[1][1]'; + break; + case gluShaderUtil.DataType.FLOAT_MAT2X3: + op += varName + '[0] + ' + + varName + '[1]'; + break; + case gluShaderUtil.DataType.FLOAT_MAT2X4: + op += varName + '[0].xyz + ' + + varName + '[1].yzw'; + break; + case gluShaderUtil.DataType.FLOAT_MAT3X2: + op += varName + '[0][0]+' + + varName + '[0][1], ' + + varName + '[1][0]+' + + varName + '[1][1], ' + + varName + '[2][0]+' + + varName + '[2][1]'; + break; + case gluShaderUtil.DataType.FLOAT_MAT3: + op += varName + '[0] + ' + + varName + '[1] + ' + + varName + '[2]'; + break; + case gluShaderUtil.DataType.FLOAT_MAT3X4: + op += varName + '[0].xyz + ' + + varName + '[1].yzw + ' + + varName + '[2].zwx'; + break; + case gluShaderUtil.DataType.FLOAT_MAT4X2: + op += varName + '[0][0]+' + + varName + '[0][1]+' + + varName + '[3][0], ' + + varName + '[1][0]+' + + varName + '[1][1]+' + + varName + '[3][1], ' + + varName + '[2][0]+' + + varName + '[2][1]'; + break; + case gluShaderUtil.DataType.FLOAT_MAT4X3: + op += varName + '[0] + ' + + varName + '[1] + ' + + varName + '[2] + ' + + varName + '[3]'; + break; + case gluShaderUtil.DataType.FLOAT_MAT4: + op += varName + '[0].xyz+' + + varName + '[1].yzw+' + + varName + '[2].zwx+' + + varName + '[3].wxy'; + break; + + default: + throw new Error('Wrong data type'); + } + + return op; + } + + /** + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fShaderMatrixTest.MatrixOp} op + * @param {boolean} extendedInputTypeCases + * @param {boolean} createInputTypeGroup + */ + es3fShaderMatrixTest.ops = function (name, desc, op, extendedInputTypeCases, createInputTypeGroup) { + this.name = name; + this.desc = desc; + this.op = op; + this.extendedInputTypeCases = extendedInputTypeCases; + this.createInputTypeGroup = createInputTypeGroup; + }; + + /** + * @constructor + * @param {string} name + * @param {string} desc + * @param {es3fShaderMatrixTest.InputType} type + */ + es3fShaderMatrixTest.InputTypeSpec = function (name, desc, type) { + this.name = name; + this.desc = desc; + this.type = type; + }; + + es3fShaderMatrixTest.init = function () { + var state = tcuTestCase.runner; + + var ops = [ + new es3fShaderMatrixTest.ops('add', 'Matrix addition tests', es3fShaderMatrixTest.MatrixOp.OP_ADD, true, true), + new es3fShaderMatrixTest.ops('sub', 'Matrix subtraction tests', es3fShaderMatrixTest.MatrixOp.OP_SUB, true, true), + new es3fShaderMatrixTest.ops('mul', 'Matrix multiplication tests', es3fShaderMatrixTest.MatrixOp.OP_MUL, true, true), + new es3fShaderMatrixTest.ops('div', 'Matrix division tests', es3fShaderMatrixTest.MatrixOp.OP_DIV, true, true), + new es3fShaderMatrixTest.ops('matrixcompmult', 'Matrix component-wise multiplication tests', es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL, false, true), + new es3fShaderMatrixTest.ops('outerproduct', 'Matrix outerProduct() tests', es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT, false, true), + new es3fShaderMatrixTest.ops('transpose', 'Matrix transpose() tests', es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE, false, true), + new es3fShaderMatrixTest.ops('determinant', 'Matrix determinant() tests', es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT, false, true), + new es3fShaderMatrixTest.ops('inverse', 'Matrix inverse() tests', es3fShaderMatrixTest.MatrixOp.OP_INVERSE, false, true), + new es3fShaderMatrixTest.ops('unary_addition', 'Matrix unary addition tests', es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS, false, false), + new es3fShaderMatrixTest.ops('negation', 'Matrix negation tests', es3fShaderMatrixTest.MatrixOp.OP_NEGATION, false, false), + new es3fShaderMatrixTest.ops('pre_increment', 'Matrix prefix increment tests', es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT, false, false), + new es3fShaderMatrixTest.ops('pre_decrement', 'Matrix prefix decrement tests', es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT, false, false), + new es3fShaderMatrixTest.ops('post_increment', 'Matrix postfix increment tests', es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT, false, false), + new es3fShaderMatrixTest.ops('post_decrement', 'Matrix postfix decrement tests', es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT, false, false), + new es3fShaderMatrixTest.ops('add_assign', 'Matrix add into tests', es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO, false, false), + new es3fShaderMatrixTest.ops('sub_assign', 'Matrix subtract from tests', es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM,false, false), + new es3fShaderMatrixTest.ops('mul_assign', 'Matrix multiply into tests', es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO,false, false), + new es3fShaderMatrixTest.ops('div_assign', 'Matrix divide into tests', es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO,false, false) + ]; + + var extendedInputTypes = [ + new es3fShaderMatrixTest.InputTypeSpec('const', 'Constant matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_CONST), + new es3fShaderMatrixTest.InputTypeSpec('uniform', 'Uniform matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM), + new es3fShaderMatrixTest.InputTypeSpec('dynamic', 'Dynamic matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) + ]; + + var reducedInputTypes = [ + new es3fShaderMatrixTest.InputTypeSpec('dynamic', 'Dynamic matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) + ]; + + /** @type {Array} */ var matrixTypes = [ + gluShaderUtil.DataType.FLOAT_MAT2, + gluShaderUtil.DataType.FLOAT_MAT2X3, + gluShaderUtil.DataType.FLOAT_MAT2X4, + gluShaderUtil.DataType.FLOAT_MAT3X2, + gluShaderUtil.DataType.FLOAT_MAT3, + gluShaderUtil.DataType.FLOAT_MAT3X4, + gluShaderUtil.DataType.FLOAT_MAT4X2, + gluShaderUtil.DataType.FLOAT_MAT4X3, + gluShaderUtil.DataType.FLOAT_MAT4 + ]; + + /** @type {Array} */ var precisions = [ + gluShaderUtil.precision.PRECISION_LOWP, + gluShaderUtil.precision.PRECISION_MEDIUMP, + gluShaderUtil.precision.PRECISION_HIGHP + ]; + + for (var opNdx = 0; opNdx < ops.length; opNdx++) { + var inTypeList = ops[opNdx].extendedInputTypeCases ? extendedInputTypes : reducedInputTypes; + var inTypeListSize = ops[opNdx].extendedInputTypeCases ? extendedInputTypes.length : reducedInputTypes.length; + var op = ops[opNdx].op; + + for (var inTypeNdx = 0; inTypeNdx < inTypeListSize; inTypeNdx++) { + var inputType = inTypeList[inTypeNdx].type; + var group = []; + + if (ops[opNdx].name != 'mul') { + if (ops[opNdx].createInputTypeGroup) { + group[0] = tcuTestCase.newTest(ops[opNdx].name + '.' + inTypeList[inTypeNdx].name, inTypeList[inTypeNdx].desc); + } else { + group[0] = tcuTestCase.newTest(ops[opNdx].name, ops[opNdx].desc); + } + state.testCases.addChild(group[0]); + } else { + for (var ii = 0; ii < precisions.length; ++ii) { + group[ii] = tcuTestCase.newTest(ops[opNdx].name + '.' + inTypeList[inTypeNdx].name, inTypeList[inTypeNdx].desc); + state.testCases.addChild(group[ii]); + } + } + + for (var matTypeNdx = 0; matTypeNdx < matrixTypes.length; matTypeNdx++) { + var matType = matrixTypes[matTypeNdx]; + var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(matType); + var numRows = gluShaderUtil.getDataTypeMatrixNumRows(matType); + var matTypeName = gluShaderUtil.getDataTypeName(matType); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + var inGroup; + if (ops[opNdx].name != 'mul') { + inGroup = group[0]; + } else { + inGroup = group[precNdx]; + } + + var precision = precisions[precNdx]; + var precName = gluShaderUtil.getPrecisionName(precision); + var baseName = precName + '_' + matTypeName + '_'; + var matIn = new es3fShaderMatrixTest.ShaderInput(inputType, matType, precision); + + if (es3fShaderMatrixTest.isOperationMatrixScalar(op)) { + // Matrix-scalar \note For div cases we use uniform input. + var scalarIn = new es3fShaderMatrixTest.ShaderInput(op == es3fShaderMatrixTest.MatrixOp.OP_DIV ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC, gluShaderUtil.DataType.FLOAT, precision); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Matrix-scalar case', matIn, scalarIn, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Matrix-scalar case', matIn, scalarIn, op, false)); + } + + if (es3fShaderMatrixTest.isOperationMatrixVector(op)) { + // Matrix-vector. + var colVecType = gluShaderUtil.getDataTypeFloatVec(numCols); + var colVecIn = new es3fShaderMatrixTest.ShaderInput(op == es3fShaderMatrixTest.MatrixOp.OP_DIV ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC, colVecType, precision); + + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(colVecType) + '_vertex', 'Matrix-vector case', matIn, colVecIn, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(colVecType) + '_fragment', 'Matrix-vector case', matIn, colVecIn, op, false)); + + // Vector-matrix. + var rowVecType = gluShaderUtil.getDataTypeFloatVec(numRows); + var rowVecIn = new es3fShaderMatrixTest.ShaderInput(op == es3fShaderMatrixTest.MatrixOp.OP_DIV ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC, rowVecType, precision); + var vecMatName = precName + '_' + gluShaderUtil.getDataTypeName(rowVecType) + '_' + matTypeName; + + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(vecMatName + '_vertex', 'Vector-matrix case', rowVecIn, matIn, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(vecMatName + '_fragment', 'Vector-matrix case', rowVecIn, matIn, op, false)); + } + + if (es3fShaderMatrixTest.isOperationArithmeticMatrixMatrix(op)) { + // Arithmetic matrix-matrix multiplication. + for (var otherCols = 2; otherCols <= 4; otherCols++) { + var otherMatIn = new es3fShaderMatrixTest.ShaderInput(inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, gluShaderUtil.getDataTypeMatrix(otherCols, numCols), precision); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(otherMatIn.dataType) + '_vertex', 'Matrix-matrix case', matIn, otherMatIn, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(otherMatIn.dataType) + '_fragment', 'Matrix-matrix case', matIn, otherMatIn, op, false)); + } + } else if (es3fShaderMatrixTest.isOperationComponentwiseMatrixMatrix(op)) { + // Component-wise. + var otherMatIn = new es3fShaderMatrixTest.ShaderInput(inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, matType, precision); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + matTypeName + '_vertex', 'Matrix-matrix case', matIn, otherMatIn, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + matTypeName + '_fragment', 'Matrix-matrix case', matIn, otherMatIn, op, false)); + } + + if (es3fShaderMatrixTest.isOperationVectorVector(op)) { + var vec1In = new es3fShaderMatrixTest.ShaderInput(inputType, gluShaderUtil.getDataTypeFloatVec(numRows), precision); + var vec2In = new es3fShaderMatrixTest.ShaderInput((inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, gluShaderUtil.getDataTypeFloatVec(numCols), precision); + + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Vector-vector case', vec1In, vec2In, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Vector-vector case', vec1In, vec2In, op, false)); + } + + if (es3fShaderMatrixTest.isOperationUnaryAnyMatrix(op) || (es3fShaderMatrixTest.isOperationUnarySymmetricMatrix(op) && numCols == numRows)) { + var voidInput = new es3fShaderMatrixTest.ShaderInput(); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Matrix case', matIn, voidInput, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Matrix case', matIn, voidInput, op, false)); + } + + if (es3fShaderMatrixTest.isOperationAssignmentAnyMatrix(op) || (es3fShaderMatrixTest.isOperationAssignmentSymmetricMatrix(op) && numCols == numRows)) { + var otherMatIn = new es3fShaderMatrixTest.ShaderInput(inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, matType, precision); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Matrix assignment case', matIn, otherMatIn, op, true)); + inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Matrix assignment case', matIn, otherMatIn, op, false)); + } + } + } + } + } + } + + es3fShaderMatrixTest.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var testName = 'shader_matrix'; + var testDescription = 'Shader Matrix Test'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fShaderMatrixTest.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js new file mode 100644 index 000000000..24f161ad1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js @@ -0,0 +1,3219 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderOperatorTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.delibs.debase.deMath'); +goog.require('modules.shared.glsShaderRenderCase'); +goog.require('framework.common.tcuMatrix'); + +goog.scope(function() { +var es3fShaderOperatorTests = functional.gles3.es3fShaderOperatorTests; +var tcuTestCase = framework.common.tcuTestCase; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var deMath = framework.delibs.debase.deMath; +var glsShaderRenderCase = modules.shared.glsShaderRenderCase; +var tcuMatrix = framework.common.tcuMatrix; + +/** @const */ es3fShaderOperatorTests.MAX_INPUTS = 3; + +es3fShaderOperatorTests.stringJoin = function(elems, delim) { + var result = ''; + for (var i = 0; i < elems.length; i++) + result += (i > 0 ? delim : '') + elems[i]; + return result; +}; + +es3fShaderOperatorTests.twoValuedVec4 = function(first, second, firstMask) { + var elems = []; + for (var i = 0; i < 4; i++) + elems[i] = firstMask[i] ? first : second; + + return 'vec4(' + es3fShaderOperatorTests.stringJoin(elems, ', ') + ')'; +}; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +var negate = function(x) { + return -x; +}; + +var addOne = function(x) { + return x + 1; +}; + +var subOne = function(x) { + return x - 1; +}; + +/** + * @param {number} a + * @param {number} b + */ +var add = function(a, b) { + return a + b; +}; + +/** + * @param {number} a + * @param {number} b + */ +var sub = function(a, b) { + return a - b; +}; + +/** + * @param {number} a + * @param {number} b + */ +var mul = function(a, b) { + return a * b; +}; + +/** + * @param {number} a + * @param {number} b + */ +var div = function(a, b) { + return a / b; +}; + +/** + * @param {number} a + * @param {number} b + * @return {number} + */ +var lessThan = function(a, b) { + return a < b ? 1 : 0; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var lessThanVec = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = a[i] < b[i]; + return res +}; + +/** + * @param {number} a + * @param {number} b + * @return {number} + */ +var lessThanEqual = function(a, b) { + return a <= b ? 1 : 0; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var lessThanEqualVec = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = a[i] <= b[i]; + return res; +}; + +/** + * @param {number} a + * @param {number} b + */ +var greaterThan = function(a, b) { + return a > b ? 1 : 0; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var greaterThanVec = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = a[i] > b[i]; + return res; +}; + +/** + * @param {number} a + * @param {number} b + */ +var greaterThanEqual = function(a, b) { + return a >= b ? 1 : 0; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var greaterThanEqualVec = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = a[i] >= b[i]; + return res; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {number} + */ +var allEqual = function(a, b) { + return deMath.equal(a, b) ? 1 : 0; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var allEqualVec = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = a[i] == b[i]; + return res; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {number} + */ +var anyNotEqual = function(a, b) { + return !deMath.equal(a, b) ? 1 : 0; +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var anyNotEqualVec = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = a[i] != b[i]; + return res; +}; + +/** + * @param {Array} a + * @return {Array} + */ +var boolNotVec = function(a) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = !a[i]; + return res; +} + +/** + * @param {Array} a + * @return {boolean} + */ +var boolAny = function(a) { + for (var i = 0; i < a.length; i++) + if (a[i] == true) + return true; + return false; +} + +/** + * @param {Array} a + * @return {boolean} + */ +var boolAll = function(a) { + for (var i = 0; i < a.length; i++) + if (a[i] == false) + return false; + return true; +} + +/** + * @param {number} a + * @param {number} b + */ +var logicalAnd = function(a, b) { + return a && b ? 1 : 0; +}; + +/** + * @param {number} a + * @param {number} b + */ +var logicalOr = function(a, b) { + return a || b ? 1 : 0; +}; + +/** + * @param {number} a + * @param {number} b + */ +var logicalXor = function(a, b) { + return a != b ? 1 : 0; +}; + +/** + * @param {number} a + */ +var exp2 = function(a) { + return deFloatExp2(a); +}; + +/** + * @param {number} a + */ +var inverseSqrt = function(a) { + return deFloatRsq(a); +}; + +/** + * @param {Array} a + * @param {number} b + * @return {Array} + */ +var minVecScalar = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = Math.min(a[i], b); + return res; +}; + +/** + * @param {Array} a + * @param {number} b + * @return {Array} + */ +var maxVecScalar = function(a, b) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = Math.max(a[i], b); + return res; +}; + +/** + * @param {number} a + * @param {number} b + * @param {number} c + * @return {number} + */ +var mix = function(a, b, c) { + return a * (1.0 - c) + b * c; +}; +/** + * @param {Array} a + * @param {Array} b + * @param {number} c + * @return {Array} + */ +var mixVecVecScalar = function(a, b, c) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = mix(a[i], b[i], c); + return res; +}; + +/** + * @param {Array} a + * @param {number} b + * @param {number} c + * @return {Array} + */ +var clampVecScalarScalar = function(a, b, c) { + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = deMath.clamp(a[i], b, c); + return res; +}; + +/** + * @param {number} a + * @param {number} b + * @return {number} + */ +var step = function(a, b) { + return b < a ? 0.0 : 1.0; +}; + +/** + * @param {number} a + * @param {Array} b + * @return {Array} + */ +var stepScalarVec = function(a, b) { + var res = []; + for (var i = 0; i < b.length; i++) + res[i] = step(a, b[i]); + return res; +}; + +/** + * @param {number} a + * @param {number} b + * @param {number} c + * @return {number} + */ +var smoothStep = function(a, b, c) { + if (c <= a) return 0.0; + if (c >= b) return 1.0; + var t = deMath.clamp((c - a) / (b - a), 0.0, 1.0); + return t * t * (3.0 - 2.0 * t); +}; + +/** + * @param {number} a + * @param {number} b + * @param {Array} c + * @return {Array} + */ +var smoothStepScalarScalarVec = function(a, b, c) { + var res = []; + for (var i = 0; i < c.length; i++) + res[i] = smoothStep(a, b, c[i]); + return res; +}; + +/** + * @param {number} a + * @return {number} + */ +var roundToEven = function(a) { + var q = deMath.deFloatFrac(a); + var r = a - q; + + if (q > 0.5) + r += 1.0; + else if (q == 0.5 && r % 2 != 0) + r += 1.0; + + return r; +}; + +/** + * @param {number} a + * @return {number} + */ +var fract = function(a) { + return a - Math.floor(a); +}; + +/** + * @param {number} a + * @return {number} + */ +var radians = function(a) { + return deFloatRadians(a); +} + +/** + * @param {number} a + * @return {number} + */ +var degrees = function(a) { + return deFloatDegrees(a); +} + +/** + * @param {number} a + * @param {Array} b + */ +var addScalarVec = function(a, b) { + return deMath.addScalar(b, a); +}; + +/** + * @param {number} a + * @param {Array} b + */ +var subScalarVec = function(a, b) { + var dst = []; + for (var i = 0; i < b.length; i++) + dst.push(a - b[i]); + return dst; +}; + +/** + * @param {number} a + * @param {Array} b + */ +var mulScalarVec = function(a, b) { + var dst = []; + for (var i = 0; i < b.length; i++) + dst.push(a * b[i]); + return dst; +}; + +/** + * @param {number} a + * @param {Array} b + */ +var divScalarVec = function(a, b) { + var dst = []; + for (var i = 0; i < b.length; i++) + dst.push(a / b[i]); + return dst; +}; + +/** + * @param {number} a + * @param {Array} b + */ +var modScalarVec = function(a, b) { + var dst = []; + for (var i = 0; i < b.length; i++) + dst.push(a % b[i]); + return dst; +}; + +var bitwiseAndScalarVec = function(a, b) { + var dst = []; + for (var i = 0; i < b.length; i++) + dst.push(deMath.binaryOp(a, b[i], deMath.BinaryOp.AND)); + return dst; +}; + +var bitwiseOrScalarVec = function(a, b) { + var dst = []; + for (var i = 0; i < b.length; i++) + dst.push(deMath.binaryOp(a, b[i], deMath.BinaryOp.OR)); + return dst; +}; + +var bitwiseXorScalarVec = function(a, b) { + var dst = []; + for (var i = 0; i < b.length; i++) + dst.push(deMath.binaryOp(a, b[i], deMath.BinaryOp.XOR)); + return dst; +}; + +/** + * @param {Array} a + * @return {number} + */ +var length = function(a) { + var squareSum = 0; + for (var i = 0; i < a.length; i++) + squareSum += a[i] * a[i]; + return Math.sqrt(squareSum); +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {number} + */ +var distance = function(a, b) { + var res = deMath.subtract(a, b) + return length(res); +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {number} + */ +var dot = function(a, b) { + var res = deMath.multiply(a, b); + var sum = 0; + for (var i = 0; i < res.length; i++) + sum += res[i]; + return sum; +}; + +/** + * @param {Array} a + * @return {Array} + */ +var normalize = function(a) { + var ooLen = 1 / length(a); + var res = []; + for (var i = 0; i < a.length; i++) + res[i] = ooLen * a[i]; + return res; +}; + +/** + * @param {Array} a + * @param {Array} b + * @param {Array} c + * @return {Array} + */ +var faceforward = function(a, b, c) { + return dot(c, b) < 0 ? a : deMath.scale(a, -1); +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var reflect = function(a, b) { + return deMath.subtract(a, deMath.scale(deMath.scale(b, dot(b, a)), 2)); +}; + +/** + * @param {Array} a + * @param {Array} b + * @param {number} c + * @return {Array} + */ +var refract = function(a, b, c) { + var cosAngle = dot(b, a); + var k = 1 - c * c * (1 - cosAngle * cosAngle); + if (k < 0) { + var res = new Array(a.length); + return res.fill(0) + } else + return deMath.subtract(deMath.scale(a, c), deMath.scale(b, c * cosAngle + Math.sqrt(k))); +}; + +/** + * @param {Array} a + * @param {Array} b + * @return {Array} + */ +var cross = function(a, b) { + if (a.length != 3 || b.length != 3) + throw new Error('Arrays must have the size of 3'); + return [ + a[1] * b[2] - b[1] * a[2], + a[2] * b[0] - b[2] * a[0], + a[0] * b[1] - b[0] * a[1]]; +}; + +var nop = function(v) { + return v; +}; + +var selection = function(cond, a, b) { + return cond ? a : b; +}; + +var boolNot = function(a) { + return !a; +}; + +var bitwiseNot = function(a) { + return ~a; +}; + +/** + * @param {number} x + * @return {number} + */ +var deFloatRadians = function(x) { + return x * (Math.PI / 180.0); +}; + +/** + * @param {number} x + * @return {number} + */ +var deFloatDegrees = function(x) { + return x * (180.0 / Math.PI); +}; + +/** + * @param {number} x + * @return {number} + */ +var deFloatExp2 = function(x) { + return Math.exp(x * Math.LN2); +}; + +/** + * @param {number} x + * @return {number} + */ +var deFloatLog2 = function(x) { + return Math.log(x) * Math.LOG2E; +}; + +/** + * @param {number} x + * @return {number} + */ +var deFloatRsq = function(x) { + var s = Math.sqrt(x); + return s == 0.0 ? 0.0 : (1.0 / s); +}; + +/** + * @constructor + * @param {boolean} low + * @param {boolean} medium + * @param {boolean} high + */ +es3fShaderOperatorTests.Precision = function(low, medium, high) { + this.low = low; + this.medium = medium; + this.high = high; +}; + +/** @const */ es3fShaderOperatorTests.Precision.Low = new es3fShaderOperatorTests.Precision(true, false, false); +/** @const */ es3fShaderOperatorTests.Precision.Medium = new es3fShaderOperatorTests.Precision(false, true, false); +/** @const */ es3fShaderOperatorTests.Precision.High = new es3fShaderOperatorTests.Precision(false, false, true); +/** @const */ es3fShaderOperatorTests.Precision.LowMedium = new es3fShaderOperatorTests.Precision(true, true, false); +/** @const */ es3fShaderOperatorTests.Precision.MediumHigh = new es3fShaderOperatorTests.Precision(false, true, true); +/** @const */ es3fShaderOperatorTests.Precision.All = new es3fShaderOperatorTests.Precision(true, true, true); +/** @const */ es3fShaderOperatorTests.Precision.None = new es3fShaderOperatorTests.Precision(false, false, false); + +/** + * @enum + */ +es3fShaderOperatorTests.ValueType = { + NONE: 0, + FLOAT: (1 << 0), // float scalar + FLOAT_VEC: (1 << 1), // float vector + FLOAT_GENTYPE: (1 << 2), // float scalar/vector + VEC3: (1 << 3), // vec3 only + MATRIX: (1 << 4), // matrix + BOOL: (1 << 5), // boolean scalar + BOOL_VEC: (1 << 6), // boolean vector + BOOL_GENTYPE: (1 << 7), // boolean scalar/vector + INT: (1 << 8), // int scalar + INT_VEC: (1 << 9), // int vector + INT_GENTYPE: (1 << 10), // int scalar/vector + UINT: (1 << 11), // uint scalar + UINT_VEC: (1 << 12), // uint vector + UINT_GENTYPE: (1 << 13) // uint scalar/vector +}; + +/** + * @param {es3fShaderOperatorTests.ValueType} type + * @return {boolean} + */ +es3fShaderOperatorTests.isBoolType = function(type) { + return (type & (es3fShaderOperatorTests.ValueType.BOOL | es3fShaderOperatorTests.ValueType.BOOL_VEC | es3fShaderOperatorTests.ValueType.BOOL_GENTYPE)) != 0; +}; + +/** + * @param {es3fShaderOperatorTests.ValueType} type + * @return {boolean} + */ +es3fShaderOperatorTests.isIntType = function(type) { + return (type & (es3fShaderOperatorTests.ValueType.INT | es3fShaderOperatorTests.ValueType.INT_VEC | es3fShaderOperatorTests.ValueType.INT_GENTYPE)) != 0; +}; + +/** + * @param {es3fShaderOperatorTests.ValueType} type + * @return {boolean} + */ +es3fShaderOperatorTests.isUintType = function(type) { + return (type & (es3fShaderOperatorTests.ValueType.UINT | es3fShaderOperatorTests.ValueType.UINT_VEC | es3fShaderOperatorTests.ValueType.UINT_GENTYPE)) != 0; +}; + +/** + * @param {es3fShaderOperatorTests.ValueType} type + * @return {boolean} + */ +es3fShaderOperatorTests.isScalarType = function(type) { + return type == es3fShaderOperatorTests.ValueType.FLOAT || type == es3fShaderOperatorTests.ValueType.BOOL || type == es3fShaderOperatorTests.ValueType.INT || type == es3fShaderOperatorTests.ValueType.UINT; +}; + +/** + * @param {es3fShaderOperatorTests.ValueType} type + * @return {boolean} + */ +es3fShaderOperatorTests.isFloatType = function(type) { + return (type & (es3fShaderOperatorTests.ValueType.FLOAT | es3fShaderOperatorTests.ValueType.FLOAT_VEC | es3fShaderOperatorTests.ValueType.FLOAT_GENTYPE)) != 0; +}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + * @param {gluShaderUtil.precision} uintPrecision + * @return {number} + */ +es3fShaderOperatorTests.getGLSLUintMaxAsFloat = function(shaderType, uintPrecision) { + switch (uintPrecision) { + case gluShaderUtil.precision.PRECISION_LOWP: + var intPrecisionGL = gl.LOW_INT; + break; + case gluShaderUtil.precision.PRECISION_MEDIUMP: + var intPrecisionGL = gl.MEDIUM_INT; + break; + case gluShaderUtil.precision.PRECISION_HIGHP: + var intPrecisionGL = gl.HIGH_INT; + break; + default: + assertMsgOptions(false, 'Invalid shader type', false, false); + var intPrecisionGL = 0; + } + + switch (shaderType) { + case gluShaderProgram.shaderType.VERTEX: + var shaderTypeGL = gl.VERTEX_SHADER; + break; + case gluShaderProgram.shaderType.FRAGMENT: + var shaderTypeGL = gl.FRAGMENT_SHADER; + break; + default: + assertMsgOptions(false, 'Invalid shader type', false, false); + var shaderTypeGL = 0; + } + + /** @type {WebGLShaderPrecisionFormat } */ var sPrecision = gl.getShaderPrecisionFormat(shaderTypeGL, intPrecisionGL); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'glGetShaderPrecisionFormat failed', false, true); + + if (!deMath.deInBounds32(sPrecision.rangeMin, 8, 32)) + throw new Error('Out of range'); + + var numBitsInType = sPrecision.rangeMin + 1; + return Math.pow(2, numBitsInType) - 1; +}; + +/** + * @enum + */ +es3fShaderOperatorTests.OperationType = { + FUNCTION: 0, + OPERATOR: 1, + SIDE_EFFECT_OPERATOR: 2 // Test the side-effect (as opposed to the result) of a side-effect operator. +}; + +/** + * swizzling indices for assigning the tested function output to the correct color channel + */ +es3fShaderOperatorTests.outIndices = []; +es3fShaderOperatorTests.outIndices[1] = [0]; +es3fShaderOperatorTests.outIndices[2] = [1, 2]; +es3fShaderOperatorTests.outIndices[3] = [0, 1, 2]; +es3fShaderOperatorTests.outIndices[4] = [0, 1, 2, 3]; + +var convert = function(input, dataType) { + switch (dataType) { + case gluShaderUtil.DataType.INT: + if (input instanceof Array) { + var ret = []; + for (var i = 0; i < input.length; i++) + ret[i] = deMath.intCast(input[i]); + return ret; + } + return deMath.intCast(input); + case gluShaderUtil.DataType.UINT: + if (input instanceof Array) { + var ret = []; + for (var i = 0; i < input.length; i++) + ret[i] = deMath.uintCast(input[i]); + return ret; + } + return deMath.uintCast(input); + case gluShaderUtil.DataType.BOOL: + if (input instanceof Array) { + var ret = []; + for (var i = 0; i < input.length; i++) + ret[i] = input[i] > 0 ? 1 : 0; + return ret; + } + return input > 0 ? 1 : 0; + + } + return input; +}; + +/** + * Generate unary functions which have the same input and return type + * @param {function(number): number} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.unaryGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) { + var run = function(output, func, input) { + if (input instanceof Array) { + var len = input.length; + var indices = es3fShaderOperatorTests.outIndices[len]; + for (var i = 0; i < input.length; i++) + output[indices[i]] = convert(func(convert(input[i], dataTypeIn)), dataTypeOut); + } else + output[0] = convert(func(convert(input, dataTypeIn)), dataTypeOut); + }; + + var functions = {}; + functions.scalar = function(c) { run(c.color, func, c.in_[0][2]); }; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0])); }; + return functions; +}; + +/** + * Generate unary functions which have the same input and return type + * @param {function(Array): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.unaryArrayFuncs = function(func, dataTypeOut, dataTypeIn) { + var run = function(output, func, input) { + var len = input.length; + var indices = es3fShaderOperatorTests.outIndices[len]; + var value = convert(func(convert(input, dataTypeIn)), dataTypeOut); + for (var i = 0; i < input.length; i++) + output[indices[i]] = value[i]; + }; + + var functions = {}; + functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]]); }; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0])); }; + return functions; +}; + +/** + * Generate unary functions which always have scalar return type + * @param {function(Array): number} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.unaryScalarGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) { + var run = function(output, func, input) { + output[0] = convert(func(convert(input, dataTypeIn)), dataTypeOut); + }; + + var functions = {}; + functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]]); }; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0])); }; + return functions; +}; + +/** + * Generate unary functions which always have bolean return type + * @param {function(Array): boolean} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.unaryBooleanGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) { + var run = function(output, func, input) { + output[0] = convert(func(convert(input, dataTypeIn)), dataTypeOut); + }; + + var functions = {}; + functions.scalar = function(c) { run(c.color, func, [c.in_[0][2] > 0.0]); }; + functions.vec2 = function(c) { run(c.color, func, greaterThanVec(deMath.swizzle(c.in_[0], [3, 1]), [0, 0])); }; + functions.vec3 = function(c) { run(c.color, func, greaterThanVec(deMath.swizzle(c.in_[0], [2, 0, 1]), [0, 0, 0])); }; + functions.vec4 = function(c) { run(c.color, func, greaterThanVec(deMath.swizzle(c.in_[0], [1, 2, 3, 0]), [0, 0, 0, 0])); }; + return functions; +}; + +/** + * Generate binary functions which have the same input and return type + * @param {function(number, number): number} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.binaryGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) { + var run = function(output, func, input1, input2) { + if (input1 instanceof Array) { + var len = input1.length; + var indices = es3fShaderOperatorTests.outIndices[len]; + for (var i = 0; i < input1.length; i++) + output[indices[i]] = convert(func(convert(input1[i], dataTypeIn), convert(input2[i], dataTypeIn)), dataTypeOut); + } else { + var value = convert(func(convert(input1, dataTypeIn), convert(input2, dataTypeIn)), dataTypeOut); + output[0] = value; + } + }; + + var functions = {}; + functions.scalar = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0]); }; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0])); }; + return functions; +}; + +/** + * Generate binary functions which have the same input and return type + * @param {function(number, number, number): number} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.ternaryGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) { + var run = function(output, func, input1, input2, input3) { + if (input1 instanceof Array) { + var len = input1.length; + var indices = es3fShaderOperatorTests.outIndices[len]; + for (var i = 0; i < input1.length; i++) + output[indices[i]] = convert(func(convert(input1[i], dataTypeIn), convert(input2[i], dataTypeIn), convert(input3[i], dataTypeIn)), dataTypeOut); + } else { + var value = convert(func(convert(input1, dataTypeIn), convert(input2, dataTypeIn), convert(input3, dataTypeIn)), dataTypeOut); + output[0] = value; + } + }; + + var functions = {}; + functions.scalar = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], c.in_[2][1]); }; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0]), deMath.swizzle(c.in_[2], [2, 1])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0]), deMath.swizzle(c.in_[2], [3, 1, 2])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0]), deMath.swizzle(c.in_[2], [0, 3, 2, 1])); }; + return functions; +}; + +/** + * Generate binary functions which have the same input and return type + * @param {function(Array, Array): number} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.binaryScalarGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) { + var run = function(output, func, input1, input2) { + var value = convert(func(convert(input1, dataTypeIn), convert(input2, dataTypeIn)), dataTypeOut); + output[0] = value; + }; + + var functions = {}; + functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]], [c.in_[1][0]]); }; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0])); }; + return functions; +}; + +/** + * Generate (cond ? a : b) functions + * @param {gluShaderUtil.DataType} dataType + * Returns an array of functions, indexed by datatype size + */ +es3fShaderOperatorTests.selectionFuncs = function(dataType) { + var run = function(output, input0, input1, input2) { + var value = selection(input0, input1, input2); + value = convert(value, dataType); + if (value instanceof Array) { + var len = value.length; + var indices = es3fShaderOperatorTests.outIndices[len]; + for (var i = 0; i < len; i++) + output[indices[i]] = value[i]; + } else + output[0] = value; + }; + + var functions = []; + functions[1] = function(c) { run(c.color, c.in_[0][2] > 0, c.in_[1][0], c.in_[2][1]); }; + functions[2] = function(c) { run(c.color, c.in_[0][2] > 0, deMath.swizzle(c.in_[1], [1, 0]), deMath.swizzle(c.in_[2], [2, 1])); }; + functions[3] = function(c) { run(c.color, c.in_[0][2] > 0, deMath.swizzle(c.in_[1], [1, 2, 0]), deMath.swizzle(c.in_[2], [3, 1, 2])); }; + functions[4] = function(c) { run(c.color, c.in_[0][2] > 0, deMath.swizzle(c.in_[1], [3, 2, 1, 0]), deMath.swizzle(c.in_[2], [0, 3, 2, 1])); }; + return functions; +}; + +var cp = function(dst, src) { + var len = src.length; + var indices = es3fShaderOperatorTests.outIndices[len]; + for (var i = 0; i < len; i++) + dst[indices[i]] = src[i]; +}; + +/** + * Generate binary functions of form: vec = func(scalar, vec) + * @param {function(number, Array): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.binaryScalarVecFuncs = function(func, dataTypeOut, dataTypeIn) { + /** + * @param {function(number, Array): Array} func + * @param {number} input1 + * @param {Array} input2 + */ + var run = function(output, func, input1, input2) { + var in1 = convert(input1, dataTypeIn); + var in2 = convert(input2, dataTypeIn); + var value = func(in1, in2); + value = convert(value, dataTypeOut); + cp(output, value); + }; + var functions = {}; + functions.vec2 = function(c) { run(c.color, func, c.in_[0][2], deMath.swizzle(c.in_[1], [1, 0])); }; + functions.vec3 = function(c) { run(c.color, func, c.in_[0][2], deMath.swizzle(c.in_[1], [1, 2, 0])); }; + functions.vec4 = function(c) { run(c.color, func, c.in_[0][2], deMath.swizzle(c.in_[1], [3, 2, 1, 0])); }; + return functions; +}; + +/** + * Generate binary functions of form: vec = func(vec, scalar) + * @param {function(Array, number): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.binaryVecScalarFuncs = function(func, dataTypeOut, dataTypeIn) { + /** + * @param {function(Array, number): Array} func + * @param {Array} input1 + * @param {number} input2 + */ + var run = function(output, func, input1, input2) { + var in1 = convert(input1, dataTypeIn); + var in2 = convert(input2, dataTypeIn); + var value = func(in1, in2); + value = convert(value, dataTypeOut); + cp(output, value); + }; + var functions = {}; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), c.in_[1][0]); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), c.in_[1][0]); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), c.in_[1][0]); }; + return functions; +}; + +/** + * Generate binary functions of form: vec = func(vec, vec, scalar) + * @param {function(Array, Array, number): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.ternaryVecVecScalarFuncs = function(func, dataTypeOut, dataTypeIn) { + /** + * @param {function(Array, Array, number): Array} func + * @param {Array} input1 + * @param {Array} input2 + * @param {number} input3 + */ + var run = function(output, func, input1, input2, input3) { + var in1 = convert(input1, dataTypeIn); + var in2 = convert(input2, dataTypeIn); + var in3 = convert(input3, dataTypeIn); + var value = func(in1, in2, in3); + value = convert(value, dataTypeOut); + cp(output, value); + }; + var functions = {}; + functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]], [c.in_[1][0]], c.in_[2][1]); }; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0]), c.in_[2][1]); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0]), c.in_[2][1]); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0]), c.in_[2][1]); }; + return functions; +}; + +/** + * Generate binary functions of form: vec = func(vec, scalar, scalar) + * @param {function(Array, number, number): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.ternaryVecScalarScalarFuncs = function(func, dataTypeOut, dataTypeIn) { + /** + * @param {function(Array, number, number): Array} func + * @param {Array} input1 + * @param {number} input2 + * @param {number} input3 + */ + var run = function(output, func, input1, input2, input3) { + var in1 = convert(input1, dataTypeIn); + var in2 = convert(input2, dataTypeIn); + var in3 = convert(input3, dataTypeIn); + var value = func(in1, in2, in3); + value = convert(value, dataTypeOut); + cp(output, value); + }; + var functions = {}; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), c.in_[1][0], c.in_[2][1]); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), c.in_[1][0], c.in_[2][1]); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), c.in_[1][0], c.in_[2][1]); }; + return functions; +}; + +/** + * Generate binary functions of form: vec = func(scalar, scalar, vec) + * @param {function(number, number, Array): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.ternaryScalarScalarVecFuncs = function(func, dataTypeOut, dataTypeIn) { + /** + * @param {function(number, number, Array): Array} func + * @param {number} input1 + * @param {number} input2 + * @param {Array} input3 + */ + var run = function(output, func, input1, input2, input3) { + var in1 = convert(input1, dataTypeIn); + var in2 = convert(input2, dataTypeIn); + var in3 = convert(input3, dataTypeIn); + var value = func(in1, in2, in3); + value = convert(value, dataTypeOut); + cp(output, value); + }; + var functions = {}; + functions.vec2 = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], deMath.swizzle(c.in_[2], [2, 1])); }; + functions.vec3 = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], deMath.swizzle(c.in_[2], [3, 1, 2])); }; + functions.vec4 = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], deMath.swizzle(c.in_[2], [0, 3, 2, 1])); }; + return functions; +}; + +/** + * Generate binary functions of form: vec = func(vec, vec, vec) + * @param {function(Array, Array, Array): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.ternaryVecVecVecFuncs = function(func, dataTypeOut, dataTypeIn) { + /** + * @param {function(Array, Array, Array): Array} func + * @param {Array} input1 + * @param {Array} input2 + * @param {Array} input3 + */ + var run = function(output, func, input1, input2, input3) { + var in1 = convert(input1, dataTypeIn); + var in2 = convert(input2, dataTypeIn); + var in3 = convert(input3, dataTypeIn); + var value = func(in1, in2, in3); + value = convert(value, dataTypeOut); + cp(output, value); + }; + var functions = {}; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0]), deMath.swizzle(c.in_[2], [2, 1])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0]), deMath.swizzle(c.in_[2], [3, 1, 2])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0]), deMath.swizzle(c.in_[2], [0, 3, 2, 1])); }; + return functions; +}; + +/** + * Generate binary functions of form: vec = func(vec, vec) + * @param {function(Array, Array): Array} func + * @param {gluShaderUtil.DataType=} dataTypeIn + * @param {gluShaderUtil.DataType=} dataTypeOut + */ +es3fShaderOperatorTests.binaryVecVecFuncs = function(func, dataTypeOut, dataTypeIn) { + /** + * @param {function(Array, Array): Array} func + * @param {Array} input1 + * @param {Array} input2 + */ + var run = function(output, func, input1, input2) { + var in1 = convert(input1, dataTypeIn); + var in2 = convert(input2, dataTypeIn); + var value = func(in1, in2); + value = convert(value, dataTypeOut); + cp(output, value); + }; + var functions = {}; + functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0])); }; + functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0])); }; + functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0])); }; + return functions; +}; + +/** + * @constructor + * @param {es3fShaderOperatorTests.ValueType} valueType + * @param {es3fShaderOperatorTests.FloatScalar} rangeMin + * @param {es3fShaderOperatorTests.FloatScalar} rangeMax + */ +es3fShaderOperatorTests.Value = function(valueType, rangeMin, rangeMax) { + this.valueType = valueType; + this.rangeMin = rangeMin; + this.rangeMax = rangeMax; +}; + +/** + * @enum + */ +es3fShaderOperatorTests.Symbol = { + SYMBOL_LOWP_UINT_MAX: 0, + SYMBOL_MEDIUMP_UINT_MAX: 1, + + SYMBOL_LOWP_UINT_MAX_RECIPROCAL: 2, + SYMBOL_MEDIUMP_UINT_MAX_RECIPROCAL: 3, + + SYMBOL_ONE_MINUS_UINT32MAX_DIV_LOWP_UINT_MAX: 4, + SYMBOL_ONE_MINUS_UINT32MAX_DIV_MEDIUMP_UINT_MAX: 5 + +}; + +/** + * @constructor + * @param {number|es3fShaderOperatorTests.Symbol} value + * @param {boolean=} isSymbol + */ +es3fShaderOperatorTests.FloatScalar = function(value, isSymbol) { + if (isSymbol) + this.symbol = /** @type {es3fShaderOperatorTests.Symbol} */ (value); + else + this.constant = /** @type {number} */ (value); +}; + +/** + * @param {gluShaderProgram.shaderType} shaderType + * @return {number} + */ +es3fShaderOperatorTests.FloatScalar.prototype.getValue = function(shaderType) { + if (this.constant !== undefined) + return this.constant; + else + switch (this.symbol) { + case es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX: + return es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_LOWP); + case es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX: + return es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_MEDIUMP); + + case es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX_RECIPROCAL: + return 1.0 / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_LOWP); + case es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX_RECIPROCAL: + return 1.0 / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_MEDIUMP); + + case es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_LOWP_UINT_MAX: + return 1.0 - 0xFFFFFFFF / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_LOWP); + case es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_MEDIUMP_UINT_MAX: + return 1.0 - 0xFFFFFFFF / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_MEDIUMP); + + default: + assertMsgOptions(false, 'Invalid shader type', false, false); + return 0.0; + } +}; + +/** + * @constructor + * @param {gluShaderUtil.DataType=} type + * @param {es3fShaderOperatorTests.FloatScalar=} rangeMin + * @param {es3fShaderOperatorTests.FloatScalar=} rangeMax + */ +es3fShaderOperatorTests.ShaderValue = function(type, rangeMin, rangeMax) { + this.type = type || gluShaderUtil.DataType.INVALID; + this.rangeMin = rangeMin || new es3fShaderOperatorTests.FloatScalar(0); + this.rangeMax = rangeMax || new es3fShaderOperatorTests.FloatScalar(0); +}; + +/** + * @constructor + */ +es3fShaderOperatorTests.ShaderDataSpec = function() { + /** @type {es3fShaderOperatorTests.FloatScalar} */ this.resultScale = new es3fShaderOperatorTests.FloatScalar(1); + /** @type {es3fShaderOperatorTests.FloatScalar} */ this.resultBias = new es3fShaderOperatorTests.FloatScalar(0); + /** @type {es3fShaderOperatorTests.FloatScalar} */ this.referenceScale = new es3fShaderOperatorTests.FloatScalar(1); + /** @type {es3fShaderOperatorTests.FloatScalar} */ this.referenceBias = new es3fShaderOperatorTests.FloatScalar(0); + /** @type {es3fShaderOperatorTests.Precision} */ this.precision = es3fShaderOperatorTests.Precision.None; + /** @type {gluShaderUtil.DataType} */ this.output; + /** @type {number} */ this.numInputs = 0; + /** @type {Array}*/ this.inputs = []; + for (var i = 0; i < es3fShaderOperatorTests.MAX_INPUTS; i++) + this.inputs[i] = new es3fShaderOperatorTests.ShaderValue(); +}; + +/** + * @constructor + * @struct + * @param {string} caseName + * @param {string} shaderFuncName + * @param {es3fShaderOperatorTests.ValueType} outValue + * @param {Array} inputs + * @param {es3fShaderOperatorTests.FloatScalar} resultScale + * @param {es3fShaderOperatorTests.FloatScalar} resultBias + * @param {es3fShaderOperatorTests.FloatScalar} referenceScale + * @param {es3fShaderOperatorTests.FloatScalar} referenceBias + * @param {gluShaderUtil.precision} precision + * @param {*} functions + * @param {es3fShaderOperatorTests.OperationType=} type + * @param {boolean=} isUnaryPrefix + */ +es3fShaderOperatorTests.BuiltinFuncInfo = function(caseName, shaderFuncName, outValue, inputs, resultScale, resultBias, referenceScale, referenceBias, precision, functions, type, isUnaryPrefix) { + this.caseName = caseName; + this.shaderFuncName = shaderFuncName; + this.outValue = outValue; + this.inputs = inputs; + this.resultScale = resultScale; + this.resultBias = resultBias; + this.referenceScale = referenceScale; + this.referenceBias = referenceBias; + this.precision = precision; + this.evalFunctions = functions; + this.type = type || es3fShaderOperatorTests.OperationType.FUNCTION; + this.isUnaryPrefix = isUnaryPrefix === undefined ? true : isUnaryPrefix; +}; + +es3fShaderOperatorTests.builtinOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) { + return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName, + shaderFuncName, + outValue, + inputs, + scale, + bias, + scale, + bias, + precision, + functions, + es3fShaderOperatorTests.OperationType.OPERATOR); +}; + +es3fShaderOperatorTests.builtinFunctionInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) { + return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName, + shaderFuncName, + outValue, + inputs, + scale, + bias, + scale, + bias, + precision, + functions, + es3fShaderOperatorTests.OperationType.FUNCTION); +}; + +es3fShaderOperatorTests.builtinSideEffOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) { + return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName, + shaderFuncName, + outValue, + inputs, + scale, + bias, + scale, + bias, + precision, + functions, + es3fShaderOperatorTests.OperationType.SIDE_EFFECT_OPERATOR); +}; + +es3fShaderOperatorTests.builtinOperInfoSeparateRefScaleBias = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions, referenceScale, referenceBias) { + return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName, + shaderFuncName, + outValue, + inputs, + scale, + bias, + referenceScale, + referenceBias, + precision, + functions, + es3fShaderOperatorTests.OperationType.OPERATOR); +}; + +es3fShaderOperatorTests.BuiltinPostSideEffOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) { + return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName, + shaderFuncName, + outValue, + inputs, + scale, + bias, + scale, + bias, + precision, + functions, + es3fShaderOperatorTests.OperationType.SIDE_EFFECT_OPERATOR, + false); +}; +es3fShaderOperatorTests.BuiltinPostOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) { + return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName, + shaderFuncName, + outValue, + inputs, + scale, + bias, + scale, + bias, + precision, + functions, + es3fShaderOperatorTests.OperationType.OPERATOR, + false); +}; + +/** + * @constructor + * @param {string} name + * @param {string} description + */ +es3fShaderOperatorTests.BuiltinFuncGroup = function(name, description) { + this.name = name; + this.description = description; + this.funcInfos = []; +}; + +es3fShaderOperatorTests.BuiltinFuncGroup.prototype.push = function(a) { this.funcInfos.push(a); }; + +var s_inSwizzles = [ + + ['z', 'wy', 'zxy', 'yzwx'], + ['x', 'yx', 'yzx', 'wzyx'], + ['y', 'zy', 'wyz', 'xwzy'] +]; + +var s_outSwizzles = ['x', 'yz', 'xyz', 'xyzw']; + +var s_outSwizzleChannelMasks = [ + [true, false, false, false], + [false, true, true, false], + [true, true, true, false], + [true, true, true, true] +]; + +/** + * @constructor + * @extends {glsShaderRenderCase.ShaderEvaluator} + * @param {gluShaderProgram.shaderType} shaderType + * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc + * @param {es3fShaderOperatorTests.FloatScalar} scale + * @param {es3fShaderOperatorTests.FloatScalar} bias + * @param {number} resultScalarSize + */ +es3fShaderOperatorTests.OperatorShaderEvaluator = function(shaderType, evalFunc, scale, bias, resultScalarSize) { + glsShaderRenderCase.ShaderEvaluator.call(this, evalFunc); + this.m_shaderType = shaderType; + this.m_scale = scale; + this.m_bias = bias; + this.m_resultScalarSize = resultScalarSize; + this.m_areScaleAndBiasEvaluated = false; +}; + +setParentClass(es3fShaderOperatorTests.OperatorShaderEvaluator, glsShaderRenderCase.ShaderEvaluator); + +es3fShaderOperatorTests.OperatorShaderEvaluator.prototype.evaluate = function(ctx) { + this.m_evalFunc(ctx); + + if (!this.m_areScaleAndBiasEvaluated) { + this.m_evaluatedScale = this.m_scale.getValue(this.m_shaderType); + this.m_evaluatedBias = this.m_bias.getValue(this.m_shaderType); + this.m_areScaleAndBiasEvaluated = true; + } + + for (var i = 0; i < 4; i++) + if (s_outSwizzleChannelMasks[this.m_resultScalarSize - 1][i]) + ctx.color[i] = ctx.color[i] * this.m_evaluatedScale + this.m_evaluatedBias; +}; + +/** + * @constructor + * @extends {glsShaderRenderCase.ShaderRenderCase} + * @param {string} caseName + * @param {string} description + * @param {boolean} isVertexCase + * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc + * @param {string} shaderOp + * @param {es3fShaderOperatorTests.ShaderDataSpec} spec + */ +es3fShaderOperatorTests.ShaderOperatorCase = function(caseName, description, isVertexCase, evalFunc, shaderOp, spec) { + glsShaderRenderCase.ShaderRenderCase.call(this, caseName, description, isVertexCase, evalFunc); + this.m_spec = spec; + this.m_shaderOp = shaderOp; + var shaderType = isVertexCase ? gluShaderProgram.shaderType.VERTEX : gluShaderProgram.shaderType.FRAGMENT; + this.m_evaluator = new es3fShaderOperatorTests.OperatorShaderEvaluator(shaderType, + evalFunc, + spec.referenceScale, + spec.referenceBias, + gluShaderUtil.getDataTypeScalarSize(spec.output)); +}; + +setParentClass(es3fShaderOperatorTests.ShaderOperatorCase, glsShaderRenderCase.ShaderRenderCase); + +es3fShaderOperatorTests.ShaderOperatorCase.prototype.setupShaderData = function() { + var shaderType = this.m_isVertexCase ? gluShaderProgram.shaderType.VERTEX : gluShaderProgram.shaderType.FRAGMENT; + var precision = this.m_spec.precision !== undefined ? gluShaderUtil.getPrecisionName(this.m_spec.precision) : null; + var inputPrecision = []; + var sources = []; + sources[0] = ''; //vertex + sources[1] = ''; //fragment + var vtx = 0; + var frag = 1; + var op = this.m_isVertexCase ? vtx : frag; + + sources[vtx] += '#version 300 es\n'; + sources[frag] += '#version 300 es\n'; + + // Compute precision for inputs. + for (var i = 0; i < this.m_spec.numInputs; i++) { + var isBoolVal = gluShaderUtil.isDataTypeBoolOrBVec(this.m_spec.inputs[i].type); + var isIntVal = gluShaderUtil.isDataTypeIntOrIVec(this.m_spec.inputs[i].type); + var isUintVal = gluShaderUtil.isDataTypeUintOrUVec(this.m_spec.inputs[i].type); + // \note Mediump interpolators are used for booleans, and highp for integers. + var prec = isBoolVal ? gluShaderUtil.precision.PRECISION_MEDIUMP : + isIntVal || isUintVal ? gluShaderUtil.precision.PRECISION_HIGHP : + this.m_spec.precision; + inputPrecision[i] = gluShaderUtil.getPrecisionName(prec); + } + + // Attributes. + sources[vtx] += 'in highp vec4 a_position;\n'; + for (var i = 0; i < this.m_spec.numInputs; i++) + sources[vtx] += 'in ' + inputPrecision[i] + ' vec4 a_in' + i + ';\n'; + + // Color output. + sources[frag] += 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (this.m_isVertexCase) { + sources[vtx] += 'out mediump vec4 v_color;\n'; + sources[frag] += 'in mediump vec4 v_color;\n'; + } else{ + for (var i = 0; i < this.m_spec.numInputs; i++) { + sources[vtx] += 'out ' + inputPrecision[i] + ' vec4 v_in' + i + ';\n'; + sources[frag] += 'in ' + inputPrecision[i] + ' vec4 v_in' + i + ';\n'; + } + } + + sources[vtx] += '\n'; + sources[vtx] += 'void main()\n'; + sources[vtx] += '{\n'; + sources[vtx] += ' gl_Position = a_position;\n'; + + sources[frag] += '\n'; + sources[frag] += 'void main()\n'; + sources[frag] += '{\n'; + + // Expression inputs. + var prefix = this.m_isVertexCase ? 'a_' : 'v_'; + for (var i = 0; i < this.m_spec.numInputs; i++) { + var inType = this.m_spec.inputs[i].type; + var inSize = gluShaderUtil.getDataTypeScalarSize(inType); + var isInt = gluShaderUtil.isDataTypeIntOrIVec(inType); + var isUint = gluShaderUtil.isDataTypeUintOrUVec(inType); + var isBool = gluShaderUtil.isDataTypeBoolOrBVec(inType); + var typeName = gluShaderUtil.getDataTypeName(inType); + var swizzle = s_inSwizzles[i][inSize - 1]; + + sources[op] += '\t'; + if (precision && !isBool) sources[op] += precision + ' '; + + sources[op] += typeName + ' in' + i + ' = '; + + if (isBool) { + if (inSize == 1) sources[op] += '('; + else sources[op] += 'greaterThan('; + } else if (isInt || isUint) + sources[op] += typeName + '('; + + sources[op] += prefix + 'in' + i + '.' + swizzle; + + if (isBool) { + if (inSize == 1) sources[op] += ' > 0.0)'; + else sources[op] += ', vec' + inSize + '(0.0))'; + } else if (isInt || isUint) + sources[op] += ')'; + + sources[op] += ';\n'; + } + + // Result variable. + var outTypeName = gluShaderUtil.getDataTypeName(this.m_spec.output); + var isBoolOut = gluShaderUtil.isDataTypeBoolOrBVec(this.m_spec.output); + + sources[op] += '\t'; + if (precision && !isBoolOut) sources[op] += precision + ' '; + sources[op] += outTypeName + ' res = ' + outTypeName + '(0.0);\n\n'; + + + // Expression. + sources[op] += '\t' + this.m_shaderOp + '\n\n'; + + // Convert to color. + var isResFloatVec = gluShaderUtil.isDataTypeFloatOrVec(this.m_spec.output); + var outScalarSize = gluShaderUtil.getDataTypeScalarSize(this.m_spec.output); + + sources[op] += '\thighp vec4 color = vec4(0.0, 0.0, 0.0, 1.0);\n'; + sources[op] += '\tcolor.' + s_outSwizzles[outScalarSize - 1] + ' = '; + + if (!isResFloatVec && outScalarSize == 1) + sources[op] += 'float(res)'; + else if (!isResFloatVec) + sources[op] += 'vec' + outScalarSize + '(res)'; + else + sources[op] += 'res'; + + sources[op] += ';\n'; + + // Scale & bias. + var resultScale = this.m_spec.resultScale.getValue(shaderType); + var resultBias = this.m_spec.resultBias.getValue(shaderType); + if ((resultScale != 1.0) || (resultBias != 0.0)) { + sources[op] += '\tcolor = color'; + if (resultScale != 1.0) sources[op] += ' * ' + es3fShaderOperatorTests.twoValuedVec4(resultScale.toString(10), '1.0', s_outSwizzleChannelMasks[outScalarSize - 1]); + if (resultBias != 0.0) sources[op] += ' + ' + es3fShaderOperatorTests.twoValuedVec4(resultBias.toString(10), '0.0', s_outSwizzleChannelMasks[outScalarSize - 1]); + sources[op] += ';\n'; + } + + // .. + if (this.m_isVertexCase) { + sources[vtx] += ' v_color = color;\n'; + sources[frag] += ' o_color = v_color;\n'; + } else{ + for (var i = 0; i < this.m_spec.numInputs; i++) + sources[vtx] += ' v_in' + i + ' = a_in' + i + ';\n'; + sources[frag] += ' o_color = color;\n'; + } + + sources[vtx] += '}\n'; + sources[frag] += '}\n'; + + this.m_vertShaderSource = sources[vtx]; + this.m_fragShaderSource = sources[frag]; + + // Setup the user attributes. + this.m_userAttribTransforms = []; + for (var inputNdx = 0; inputNdx < this.m_spec.numInputs; inputNdx++) { + var v = this.m_spec.inputs[inputNdx]; + + var rangeMin = v.rangeMin.getValue(shaderType); + var rangeMax = v.rangeMax.getValue(shaderType); + var scale = rangeMax - rangeMin; + var minBias = rangeMin; + var maxBias = rangeMax; + var attribMatrix = new tcuMatrix.Matrix(4, 4); + + for (var rowNdx = 0; rowNdx < 4; rowNdx++) { + var row; + + switch ((rowNdx + inputNdx) % 4) { + case 0: row = [scale, 0.0, 0.0, minBias]; break; + case 1: row = [0.0, scale, 0.0, minBias]; break; + case 2: row = [-scale, 0.0, 0.0, maxBias]; break; + case 3: row = [0.0, -scale, 0.0, maxBias]; break; + default: throw new Error('Invalid row index'); + } + + attribMatrix.setRow(rowNdx, row); + } + + this.m_userAttribTransforms[inputNdx] = attribMatrix; + } + +}; + +// Reference functions for specific sequence operations for the sequence operator tests. +/** + * Reference for expression "in0, in2 + in1, in1 + in0" + * @param {Array} in0 Vec4 + * @param {Array} in1 Vec4 + * @param {Array} in2 Vec4 + * @return {Array} Vec4 + */ +es3fShaderOperatorTests.sequenceNoSideEffCase0 = function(in0, in1, in2) { + return deMath.add(in1, in0); +}; + +/** + * Reference for expression "in0, in2 + in1, in1 + in0" + * @param {number} in0 float + * @param {number} in1 deUint32 + * @param {number} in2 float + * @return {number} deUint32 + */ +es3fShaderOperatorTests.sequenceNoSideEffCase1 = function(in0, in1, in2) { + in1 = convert(in1, gluShaderUtil.DataType.UINT); + return convert(in1 + in1, gluShaderUtil.DataType.UINT); +}; + +/** + * Reference for expression "in0 && in1, in0, ivec2(vec2(in0) + in2)" + * @param {boolean} in0 + * @param {boolean} in1 + * @param {Array} in2 Vec2 + * @return {Array} IVec2 + */ +es3fShaderOperatorTests.sequenceNoSideEffCase2 = function(in0, in1, in2) { + in0 = convert(in0, gluShaderUtil.DataType.BOOL); + return convert([in0 + in2[0], in0 + in2[1]], gluShaderUtil.DataType.INT); +}; + +/** + * Reference for expression "in0 + vec4(in1), in2, in1" + * @param {Array} in0 Vec4 + * @param {Array} in1 IVec4 + * @param {Array} in2 BVec4 + * @return {Array} IVec4 + */ +es3fShaderOperatorTests.sequenceNoSideEffCase3 = function(in0, in1, in2) { + return convert(in1, gluShaderUtil.DataType.INT); +}; + +/** + * Reference for expression "in0++, in1 = in0 + in2, in2 = in1" + * @param {Array} in0 Vec4 + * @param {Array} in1 Vec4 + * @param {Array} in2 Vec4 + * @return {Array} Vec4 + */ +es3fShaderOperatorTests.sequenceSideEffCase0 = function(in0, in1, in2) { + return deMath.add(deMath.add(in0, [1.0, 1.0, 1.0, 1.0]), in2); +}; + +/** + * Reference for expression "in1++, in0 = float(in1), in1 = uint(in0 + in2)" + * @param {number} in0 float + * @param {number} in1 deUint32 + * @param {number} in2 float + * @return {number} deUint32 + */ +es3fShaderOperatorTests.sequenceSideEffCase1 = function(in0, in1, in2) { + in1 = convert(in1, gluShaderUtil.DataType.UINT); + return convert(in1 + 1.0 + in2, gluShaderUtil.DataType.UINT); +}; + +/** + * Reference for expression "in1 = in0, in2++, in2 = in2 + vec2(in1), ivec2(in2)" + * @param {boolean} in0 + * @param {boolean} in1 + * @param {Array} in2 Vec2 + * @return {Array} IVec2 + */ +es3fShaderOperatorTests.sequenceSideEffCase2 = function(in0, in1, in2) { + in0 = convert(in0, gluShaderUtil.DataType.BOOL); + return convert(deMath.add(deMath.add(in2, [1.0, 1.0]), [in0, in0]), gluShaderUtil.DataType.INT); +}; + +/** + * Reference for expression "in0 = in0 + vec4(in2), in1 = in1 + ivec4(in0), in1++" + * @param {Array} in0 Vec4 + * @param {Array} in1 IVec4 + * @param {Array} in2 BVec4 + * @return {Array} IVec4 + */ +es3fShaderOperatorTests.sequenceSideEffCase3 = function(in0, in1, in2) { + in1 = convert(in1, gluShaderUtil.DataType.INT); + in2 = convert(in2, gluShaderUtil.DataType.BOOL); + in0 = deMath.add(in0, in2); + in1 = deMath.add(in1, convert(in0, gluShaderUtil.DataType.INT)); + return in1; +}; + +// ShaderEvalFunc-type wrappers for the above functions. + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceNoSideEffCase0 = function(ctx) { + ctx.color = es3fShaderOperatorTests.sequenceNoSideEffCase0( + deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]), + deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]), + deMath.swizzle(ctx.in_[2], [0, 3, 2, 1]) + ); +}; + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceNoSideEffCase1 = function(ctx) { + ctx.color[0] = es3fShaderOperatorTests.sequenceNoSideEffCase1( + ctx.in_[0][2], + ctx.in_[1][0], + ctx.in_[2][1] + ); +}; + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceNoSideEffCase2 = function(ctx) { + /** @type {Array} */ var result = es3fShaderOperatorTests.sequenceNoSideEffCase2( + ctx.in_[0][2] > 0.0, + ctx.in_[1][0] > 0.0, + deMath.swizzle(ctx.in_[2], [2, 1]) + ); + ctx.color[1] = result[0]; + ctx.color[2] = result[1]; +}; + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceNoSideEffCase3 = function(ctx) { + ctx.color = es3fShaderOperatorTests.sequenceNoSideEffCase3( + deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]), + deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]), + deMath.greaterThan(deMath.swizzle(ctx.in_[2], [0, 3, 2, 1]), [0.0, 0.0, 0.0, 0.0]) + ); +}; + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceSideEffCase0 = function(ctx) { + ctx.color = es3fShaderOperatorTests.sequenceSideEffCase0( + deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]), + deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]), + deMath.swizzle(ctx.in_[2], [0, 3, 2, 1]) + ); +}; + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceSideEffCase1 = function(ctx) { + ctx.color[0] = es3fShaderOperatorTests.sequenceSideEffCase1( + ctx.in_[0][2], + ctx.in_[1][0], + ctx.in_[2][1] + ); +}; + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceSideEffCase2 = function(ctx) { + /** @type {Array} */ var result = es3fShaderOperatorTests.sequenceSideEffCase2( + ctx.in_[0][2] > 0.0, + ctx.in_[1][0] > 0.0, + deMath.swizzle(ctx.in_[2], [2, 1]) + ); + ctx.color[1] = result[0]; + ctx.color[2] = result[1]; +}; + +/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */ +es3fShaderOperatorTests.evalSequenceSideEffCase3 = function(ctx) { + ctx.color = es3fShaderOperatorTests.sequenceSideEffCase3( + deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]), + deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]), + deMath.greaterThan(deMath.swizzle(ctx.in_[2], [0, 3, 2, 1]), [0.0, 0.0, 0.0, 0.0]) + ); +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fShaderOperatorTests.ShaderOperatorTests = function() { + tcuTestCase.DeqpTest.call(this, 'shaderop', 'Shader operators tests'); +}; + +setParentClass(es3fShaderOperatorTests.ShaderOperatorTests, tcuTestCase.DeqpTest); + +es3fShaderOperatorTests.ShaderOperatorTests.prototype.init = function() { + var op = es3fShaderOperatorTests.builtinOperInfo; + var side = es3fShaderOperatorTests.builtinSideEffOperInfo; + var separate = es3fShaderOperatorTests.builtinOperInfoSeparateRefScaleBias; + var postSide = es3fShaderOperatorTests.BuiltinPostSideEffOperInfo; + var postOp = es3fShaderOperatorTests.BuiltinPostOperInfo; + var all = es3fShaderOperatorTests.Precision.All; + var highp = es3fShaderOperatorTests.Precision.High; + var mediump = es3fShaderOperatorTests.Precision.Medium; + var mediumhighp = es3fShaderOperatorTests.Precision.MediumHigh; + var lowp = es3fShaderOperatorTests.Precision.Low; + var na = es3fShaderOperatorTests.Precision.None; + var GT = es3fShaderOperatorTests.ValueType.FLOAT_GENTYPE; + var UGT = es3fShaderOperatorTests.ValueType.UINT_GENTYPE; + var IGT = es3fShaderOperatorTests.ValueType.INT_GENTYPE; + var BGT = es3fShaderOperatorTests.ValueType.BOOL_GENTYPE; + var F = es3fShaderOperatorTests.ValueType.FLOAT; + var I = es3fShaderOperatorTests.ValueType.INT; + var U = es3fShaderOperatorTests.ValueType.UINT; + var BV = es3fShaderOperatorTests.ValueType.BOOL_VEC; + var FV = es3fShaderOperatorTests.ValueType.FLOAT_VEC; + var IV = es3fShaderOperatorTests.ValueType.INT_VEC; + var UV = es3fShaderOperatorTests.ValueType.UINT_VEC; + var B = es3fShaderOperatorTests.ValueType.BOOL; + var V3 = es3fShaderOperatorTests.ValueType.VEC3; + var lUMax = es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX; + var mUMax = es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX; + var lUMaxR = es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX_RECIPROCAL; + var mUMaxR = es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX_RECIPROCAL; + var f = function(value) { + return new es3fShaderOperatorTests.FloatScalar(value); + }; + var s = function(value) { + return new es3fShaderOperatorTests.FloatScalar(value, true); + }; + var v = function(type, a, b) { + return new es3fShaderOperatorTests.Value(type, f(a), f(b)); + }; + var v2 = function(type, a, b) { + return new es3fShaderOperatorTests.Value(type, f(a), s(b)); + }; + var funcInfoGroups = []; + var unary = new es3fShaderOperatorTests.BuiltinFuncGroup('unary_operator', 'Unary operator tests'); + funcInfoGroups.push(unary); + + unary.push(op('plus', '+', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop))); + unary.push(op('plus', '+', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(op('plus', '+', UGT, [v(UGT, 0.0, 2e2)], f(5e-3), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(op('minus', '-', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(negate))); + unary.push(op('minus', '-', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(separate('minus', '-', UGT, [v2(UGT, 0.0, lUMax)], s(lUMaxR), f(0.0), lowp, + es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT), s(lUMaxR), + s(es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_LOWP_UINT_MAX))); + unary.push(separate('minus', '-', UGT, [v2(UGT, 0.0, mUMax)], s(mUMaxR), f(0.0), mediump, + es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT), s(mUMaxR), + s(es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_MEDIUMP_UINT_MAX))); + unary.push(op('minus', '-', UGT, [v(UGT, 0.0, 4e9)], f(2e-10), f(0.0), highp, + es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(op('not', '!', B, [v(B, -1.0, 1.0)], f(1.0), f(0.0), na,{'scalar': es3fShaderOperatorTests.unaryGenTypeFuncs(boolNot, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL).scalar})); + unary.push(op('bitwise_not', '~', IGT, [v(IGT, -1e5, 1e5)], f(5e-5), f(0.5), highp, + es3fShaderOperatorTests.unaryGenTypeFuncs(bitwiseNot, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(op('bitwise_not', '~', UGT, [v(UGT, 0.0, 2e9)], f(2e-10), f(0.0), highp, + es3fShaderOperatorTests.unaryGenTypeFuncs(bitwiseNot, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + // Pre/post incr/decr side effect cases. + unary = new es3fShaderOperatorTests.BuiltinFuncGroup('unary_operator', 'Unary operator tests'); + funcInfoGroups.push(unary); + + unary.push(side('pre_increment_effect', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne))); + unary.push(side('pre_increment_effect', '++', IGT, [v(IGT, -6.0, 4.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(side('pre_increment_effect', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(side('pre_decrement_effect', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(1.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne))); + unary.push(side('pre_decrement_effect', '--', IGT, [v(IGT, -4.0, 6.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(side('pre_decrement_effect', '--', UGT, [v(UGT, 0.0, 10.0)], f(0.1), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(postSide('post_increment_result', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne))); + unary.push(postSide('post_increment_result', '++', IGT, [v(IGT, -6.0, 4.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(postSide('post_increment_result', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(postSide('post_decrement_result', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(1.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne))); + unary.push(postSide('post_decrement_result', '--', IGT, [v(IGT, -4.0, 6.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(postSide('post_decrement_result', '--', UGT, [v(UGT, 1.0, 10.0)], f(0.1), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + // Pre/post incr/decr result cases. + unary = new es3fShaderOperatorTests.BuiltinFuncGroup('unary_operator', 'Unary operator tests'); + funcInfoGroups.push(unary); + + unary.push(op('pre_increment_result', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne))); + unary.push(op('pre_increment_result', '++', IGT, [v(IGT, -6.0, 4.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(op('pre_increment_result', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(op('pre_dencrement_result', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(1.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne))); + unary.push(op('pre_decrement_result', '--', IGT, [v(IGT, -4.0, 6.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(op('pre_decrement_result', '--', UGT, [v(UGT, 0.0, 10.0)], f(0.1), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(postOp('post_increment_result', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop))); + unary.push(postOp('post_increment_result', '++', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(postOp('post_increment_result', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + unary.push(postOp('post_decrement_result', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop))); + unary.push(postOp('post_decrement_result', '--', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + unary.push(postOp('post_decrement_result', '--', UGT, [v(UGT, 1.0, 10.0)], f(0.1), f(0.0), all, + es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + var binary; + + // Normal binary operations and their corresponding assignment operations have lots in common; generate both in the following loop. + // 0: normal op test, 1: assignment op side-effect test, 2: assignment op result test + for (var binaryOperatorType = 0; binaryOperatorType <= 2; binaryOperatorType++) { + var isNormalOp = binaryOperatorType == 0; + var isAssignEff = binaryOperatorType == 1; + var isAssignRes = binaryOperatorType == 2; + + var addName = isNormalOp ? 'add' : isAssignEff ? 'add_assign_effect' : 'add_assign_result'; + var subName = isNormalOp ? 'sub' : isAssignEff ? 'sub_assign_effect' : 'sub_assign_result'; + var mulName = isNormalOp ? 'mul' : isAssignEff ? 'mul_assign_effect' : 'mul_assign_result'; + var divName = isNormalOp ? 'div' : isAssignEff ? 'div_assign_effect' : 'div_assign_result'; + var modName = isNormalOp ? 'mod' : isAssignEff ? 'mod_assign_effect' : 'mod_assign_result'; + var andName = isNormalOp ? 'bitwise_and' : isAssignEff ? 'bitwise_and_assign_effect' : 'bitwise_and_assign_result'; + var orName = isNormalOp ? 'bitwise_or' : isAssignEff ? 'bitwise_or_assign_effect' : 'bitwise_or_assign_result'; + var xorName = isNormalOp ? 'bitwise_xor' : isAssignEff ? 'bitwise_xor_assign_effect' : 'bitwise_xor_assign_result'; + var leftShiftName = isNormalOp ? 'left_shift' : isAssignEff ? 'left_shift_assign_effect' : 'left_shift_assign_result'; + var rightShiftName = isNormalOp ? 'right_shift' : isAssignEff ? 'right_shift_assign_effect' : 'right_shift_assign_result'; + var addOp = isNormalOp ? '+' : '+='; + var subOp = isNormalOp ? '-' : '-='; + var mulOp = isNormalOp ? '*' : '*='; + var divOp = isNormalOp ? '/' : '/='; + var modOp = isNormalOp ? '%' : '%='; + var andOp = isNormalOp ? '&' : '&='; + var orOp = isNormalOp ? '|' : '|='; + var xorOp = isNormalOp ? '^' : '^='; + var leftShiftOp = isNormalOp ? '<<' : '<<='; + var rightShiftOp = isNormalOp ? '>>' : '>>='; + + op = isAssignEff ? es3fShaderOperatorTests.builtinSideEffOperInfo : es3fShaderOperatorTests.builtinOperInfo; + + binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests'); + funcInfoGroups.push(binary); + + // The add operator. + + binary.push(op(addName, addOp, GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(add))); + binary.push(op(addName, addOp, IGT, [v(IGT, -4.0, 6.0), v(IGT, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(addName, addOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(addName, addOp, UGT, [v(UGT, 0.0, 1e2), v(UGT, 0.0, 1e2)], f(5e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(addName, addOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + binary.push(op(addName, addOp, FV, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar))); + binary.push(op(addName, addOp, IV, [v(IV, -4.0, 6.0), v(I, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(addName, addOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(addName, addOp, UV, [v(UV, 0.0, 1e2), v(U, 0.0, 1e2)], f(5e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(addName, addOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(addName, addOp, FV, [v(F, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec))); + binary.push(op(addName, addOp, IV, [v(I, -4.0, 6.0), v(IV, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(addName, addOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(addName, addOp, UV, [v(U, 0.0, 1e2), v(UV, 0.0, 1e2)], f(5e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(addName, addOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + // The subtract operator. + + binary.push(op(subName, subOp, GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(sub))); + binary.push(op(subName, subOp, IGT, [v(IGT, -4.0, 6.0), v(IGT, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(subName, subOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(subName, subOp, UGT, [v(UGT, 1e2, 2e2), v(UGT, 0.0, 1e2)], f(5e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(subName, subOp, UGT, [v(UGT, .5e9, 3.7e9), v(UGT, 0.0, 3.9e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(subName, subOp, FV, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar))); + binary.push(op(subName, subOp, IV, [v(IV, -4.0, 6.0), v(I, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(subName, subOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(subName, subOp, UV, [v(UV, 1e2, 2e2), v(U, 0.0, 1e2)], f(5e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(subName, subOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(subName, subOp, FV, [v(F, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec))); + binary.push(op(subName, subOp, IV, [v(I, -4.0, 6.0), v(IV, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(subName, subOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(subName, subOp, UV, [v(U, 1e2, 2e2), v(UV, 0.0, 1e2)], f(5e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(subName, subOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests'); + funcInfoGroups.push(binary); + + // The multiply operator. + + binary.push(op(mulName, mulOp, GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(mul))); + binary.push(op(mulName, mulOp, IGT, [v(IGT, -4.0, 6.0), v(IGT, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(mulName, mulOp, IGT, [v(IGT, -3e5, 3e5), v(IGT, -3e4, 3e4)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(mulName, mulOp, UGT, [v(UGT, 0.0, 16.0), v(UGT, 0.0, 16.0)], f(4e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(mulName, mulOp, UGT, [v(UGT, 0.0, 6e5), v(UGT, 0.0, 6e4)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(mulName, mulOp, FV, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale))); + binary.push(op(mulName, mulOp, IV, [v(IV, -4.0, 6.0), v(I, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(mulName, mulOp, IV, [v(IV, -3e5, 3e5), v(I, -3e4, 3e4)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(mulName, mulOp, UV, [v(UV, 0.0, 16.0), v(U, 0.0, 16.0)], f(4e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(mulName, mulOp, UV, [v(UV, 0.0, 6e5), v(U, 0.0, 6e4)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(mulName, mulOp, FV, [v(F, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec))); + binary.push(op(mulName, mulOp, IV, [v(I, -4.0, 6.0), v(IV, -6.0, 5.0)], f(0.1), f(0.5), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(mulName, mulOp, IV, [v(I, -3e5, 3e5), v(IV, -3e4, 3e4)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(mulName, mulOp, UV, [v(U, 0.0, 16.0), v(UV, 0.0, 16.0)], f(4e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(mulName, mulOp, UV, [v(U, 0.0, 6e5), v(UV, 0.0, 6e4)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + // The divide operator. + + binary.push(op(divName, divOp, GT, [v(GT, -1.0, 1.0), v(GT, -2.0, -0.5)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(div))); + binary.push(op(divName, divOp, IGT, [v(IGT, 24.0, 24.0), v(IGT, -4.0, -1.0)], f(0.04), f(1.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(divName, divOp, IGT, [v(IGT, 40320.0, 40320.0), v(IGT, -8.0, -1.0)], f(1e-5), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(divName, divOp, UGT, [v(UGT, 0.0, 24.0), v(UGT, 1.0, 4.0)], f(0.04), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(divName, divOp, UGT, [v(UGT, 0.0, 40320.0), v(UGT, 1.0, 8.0)], f(1e-5), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(divName, divOp, FV, [v(FV, -1.0, 1.0), v(F, -2.0, -0.5)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale))); + binary.push(op(divName, divOp, IV, [v(IV, 24.0, 24.0), v(I, -4.0, -1.0)], f(0.04), f(1.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(divName, divOp, IV, [v(IV, 40320.0, 40320.0), v(I, -8.0, -1.0)], f(1e-5), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(divName, divOp, UV, [v(UV, 0.0, 24.0), v(U, 1.0, 4.0)], f(0.04), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(divName, divOp, UV, [v(UV, 0.0, 40320.0), v(U, 1.0, 8.0)], f(1e-5), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(divName, divOp, FV, [v(F, -1.0, 1.0), v(FV, -2.0, -0.5)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec))); + binary.push(op(divName, divOp, IV, [v(I, 24.0, 24.0), v(IV, -4.0, -1.0)], f(0.04), f(1.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(divName, divOp, IV, [v(I, 40320.0, 40320.0), v(IV, -8.0, -1.0)], f(1e-5), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(divName, divOp, UV, [v(U, 0.0, 24.0), v(UV, 1.0, 4.0)], f(0.04), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(divName, divOp, UV, [v(U, 0.0, 40320.0), v(UV, 1.0, 8.0)], f(1e-5), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests'); + funcInfoGroups.push(binary); + + // The modulus operator. + + binary.push(op(modName, modOp, IGT, [v(IGT, 0.0, 6.0), v(IGT, 1.1, 6.1)], f(0.25), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(modName, modOp, IGT, [v(IGT, 0.0, 14.0), v(IGT, 1.1, 11.1)], f(0.1), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(modName, modOp, UGT, [v(UGT, 0.0, 6.0), v(UGT, 1.1, 6.1)], f(0.25), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(modName, modOp, UGT, [v(UGT, 0.0, 24.0), v(UGT, 1.1, 11.1)], f(0.1), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(modName, modOp, IV, [v(IV, 0.0, 6.0), v(I, 1.1, 6.1)], f(0.25), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(modName, modOp, IV, [v(IV, 0.0, 6.0), v(I, 1.1, 11.1)], f(0.1), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(modName, modOp, UV, [v(UV, 0.0, 6.0), v(U, 1.1, 6.1)], f(0.25), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(modName, modOp, UV, [v(UV, 0.0, 24.0), v(U, 1.1, 11.1)], f(0.1), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(modName, modOp, IV, [v(I, 0.0, 6.0), v(IV, 1.1, 6.1)], f(0.25), f(0.5), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(modName, modOp, IV, [v(I, 0.0, 6.0), v(IV, 1.1, 11.1)], f(0.1), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(modName, modOp, UV, [v(U, 0.0, 6.0), v(UV, 1.1, 6.1)], f(0.25), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(modName, modOp, UV, [v(U, 0.0, 24.0), v(UV, 1.1, 11.1)], f(0.1), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + // The bitwise and operator. + + binary.push(op(andName, andOp, IGT, [v(IGT, -16.0, 16.0), v(IGT, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(andName, andOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(andName, andOp, UGT, [v(UGT, 0.0, 32.0), v(UGT, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(andName, andOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(andName, andOp, IV, [v(IV, -16.0, 16.0), v(I, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(andName, andOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(andName, andOp, UV, [v(UV, 0.0, 32.0), v(U, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(andName, andOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(andName, andOp, IV, [v(I, -16.0, 16.0), v(IV, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(andName, andOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(andName, andOp, UV, [v(U, 0.0, 32.0), v(UV, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(andName, andOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests'); + funcInfoGroups.push(binary); + + // The bitwise or operator. + + binary.push(op(orName, orOp, IGT, [v(IGT, -16.0, 16.0), v(IGT, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(orName, orOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(orName, orOp, UGT, [v(UGT, 0.0, 32.0), v(UGT, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(orName, orOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(orName, orOp, IV, [v(IV, -16.0, 16.0), v(I, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(orName, orOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(orName, orOp, UV, [v(UV, 0.0, 32.0), v(U, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(orName, orOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(orName, orOp, IV, [v(I, -16.0, 16.0), v(IV, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(orName, orOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(orName, orOp, UV, [v(U, 0.0, 32.0), v(UV, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(orName, orOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + // The bitwise xor operator. + + binary.push(op(xorName, xorOp, IGT, [v(IGT, -16.0, 16.0), v(IGT, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(xorName, xorOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(xorName, xorOp, UGT, [v(UGT, 0.0, 32.0), v(UGT, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(xorName, xorOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(xorName, xorOp, IV, [v(IV, -16.0, 16.0), v(I, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(xorName, xorOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(xorName, xorOp, UV, [v(UV, 0.0, 32.0), v(U, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(xorName, xorOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + + if (isNormalOp) { + binary.push(op(xorName, xorOp, IV, [v(I, -16.0, 16.0), v(IV, -16.0, 16.0)], f(0.03), f(0.5), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(xorName, xorOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(xorName, xorOp, UV, [v(U, 0.0, 32.0), v(UV, 0.0, 32.0)], f(0.03), f(0.0), + mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(xorName, xorOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests'); + funcInfoGroups.push(binary); + + // The left shift operator. Second operand (shift amount) can be either int or uint, even for uint and int first operand, respectively. + for (var isSignedAmount = 0; isSignedAmount <= 1; isSignedAmount++) { + var gType = isSignedAmount == 0 ? UGT : IGT; + var sType = isSignedAmount == 0 ? U : I; + binary.push(op(leftShiftName, leftShiftOp, IGT, [v(IGT, -7.0, 7.0), v(gType, 0.0, 4.0)], f(4e-3), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(leftShiftName, leftShiftOp, IGT, [v(IGT, -7.0, 7.0), v(gType, 0.0, 27.0)], f(5e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(leftShiftName, leftShiftOp, UGT, [v(UGT, 0.0, 7.0), v(gType, 0.0, 5.0)], f(4e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(leftShiftName, leftShiftOp, UGT, [v(UGT, 0.0, 7.0), v(gType, 0.0, 28.0)], f(5e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(leftShiftName, leftShiftOp, IV, [v(IV, -7.0, 7.0), v(sType, 0.0, 4.0)], f(4e-3), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(leftShiftName, leftShiftOp, IV, [v(IV, -7.0, 7.0), v(sType, 0.0, 27.0)], f(5e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(leftShiftName, leftShiftOp, UV, [v(UV, 0.0, 7.0), v(sType, 0.0, 5.0)], f(4e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(leftShiftName, leftShiftOp, UV, [v(UV, 0.0, 7.0), v(sType, 0.0, 28.0)], f(5e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + + // The right shift operator. Second operand (shift amount) can be either int or uint, even for uint and int first operand, respectively. + + for (var isSignedAmount = 0; isSignedAmount <= 1; isSignedAmount++) { + gType = isSignedAmount == 0 ? UGT : IGT; + sType = isSignedAmount == 0 ? U : I; + binary.push(op(rightShiftName, rightShiftOp, IGT, [v(IGT, -127.0, 127.0), v(gType, 0.0, 8.0)], f(4e-3), f(0.5), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(rightShiftName, rightShiftOp, IGT, [v(IGT, -2e9, 2e9), v(gType, 0.0, 31.0)], f(5e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(rightShiftName, rightShiftOp, UGT, [v(UGT, 0.0, 255.0), v(gType, 0.0, 8.0)], f(4e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(rightShiftName, rightShiftOp, UGT, [v(UGT, 0.0, 4e9), v(gType, 0.0, 31.0)], f(5e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(rightShiftName, rightShiftOp, IV, [v(IV, -127.0, 127.0), v(sType, 0.0, 8.0)], f(4e-3), f(0.5), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(rightShiftName, rightShiftOp, IV, [v(IV, -2e9, 2e9), v(sType, 0.0, 31.0)], f(5e-10), f(0.5), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op(rightShiftName, rightShiftOp, UV, [v(UV, 0.0, 255.0), v(sType, 0.0, 8.0)], f(4e-3), f(0.0), + mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op(rightShiftName, rightShiftOp, UV, [v(UV, 0.0, 4e9), v(sType, 0.0, 31.0)], f(5e-10), f(0.0), + highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + } + } + + // Rest of binary operators. + // Scalar relational operators. + binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests'); + funcInfoGroups.push(binary); + + binary.push(op('less', '<', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThan).scalar})); + binary.push(op('less', '<', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThan, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT).scalar})); + binary.push(op('less', '<', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThan, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT).scalar})); + binary.push(op('less_or_equal', '<=', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThanEqual).scalar})); + binary.push(op('less_or_equal', '<=', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThanEqual, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT).scalar})); + binary.push(op('less_or_equal', '<=', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThanEqual, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT).scalar})); + binary.push(op('greater', '>', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThan).scalar})); + binary.push(op('greater', '>', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThan, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT).scalar})); + binary.push(op('greater', '>', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThan, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT).scalar})); + binary.push(op('greater_or_equal', '>=', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThanEqual).scalar})); + binary.push(op('greater_or_equal', '>=', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThanEqual, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT).scalar})); + binary.push(op('greater_or_equal', '>=', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0), + all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThanEqual, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT).scalar})); + + binary.push(op('equal', '==', B, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual))); + binary.push(op('equal', '==', B, [v(IGT, -5.5, 4.7), v(IGT, -2.1, 0.1)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op('equal', '==', B, [v(UGT, 0.0, 8.0), v(UGT, 3.5, 4.5)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op('equal', '==', B, [v(BGT, -2.1, 2.1), v(BGT, -1.1, 3.0)], f(1.0), f(0.0), + na, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL))); + binary.push(op('not_equal', '!=', B, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual))); + binary.push(op('not_equal', '!=', B, [v(IGT, -5.5, 4.7), v(IGT, -2.1, 0.1)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + binary.push(op('not_equal', '!=', B, [v(UGT, 0.0, 8.0), v(UGT, 3.5, 4.5)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + binary.push(op('not_equal', '!=', B, [v(BGT, -2.1, 2.1), v(BGT, -1.1, 3.0)], f(1.0), f(0.0), + na, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL))); + + // Logical operators. + binary.push(op('logical_and', '&&', B, [v(B, -1.0, 1.0), v(B, -1.0, 1.0)], f(1.0), f(0.0), + na, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(logicalAnd, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL).scalar})); + binary.push(op('logical_or', '||', B, [v(B, -1.0, 1.0), v(B, -1.0, 1.0)], f(1.0), f(0.0), + na, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(logicalOr, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL).scalar})); + binary.push(op('logical_xor', '^^', B, [v(B, -1.0, 1.0), v(B, -1.0, 1.0)], f(1.0), f(0.0), + na, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(logicalXor, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL).scalar})); + + // 8.1 Angle and Trigonometry Functions. + var trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests."); + funcInfoGroups.push(trig); + op = es3fShaderOperatorTests.builtinFunctionInfo; + trig.push(op("radians", "radians", GT, [v(GT, -1.0, 1.0)], f(25.0), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(radians))); + trig.push(op("degrees", "degrees", GT, [v(GT, -1.0, 1.0)], f(0.04), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(degrees))); + trig.push(op("sin", "sin", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sin))); + trig.push(op("sin", "sin", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5), + lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sin))); + trig.push(op("cos", "cos", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cos))); + trig.push(op("cos", "cos", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5), + lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cos))); + trig.push(op("tan", "tan", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tan))); + trig.push(op("tan", "tan", GT, [v(GT, -1.5, 5.5)], f(0.5), f(0.5), + lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tan))); + + trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests."); + funcInfoGroups.push(trig); + trig.push(op("asin", "asin", GT, [v(GT, -1.0, 1.0)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.asin))); + trig.push(op("acos", "acos", GT, [v(GT, -1.0, 1.0)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.acos))); + trig.push(op("atan", "atan", GT, [v(GT, -4.0, 4.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.atan))); + trig.push(op("atan2", "atan", GT, [v(GT, -4.0, 4.0), v(GT, 0.5, 2.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.atan2))); + + trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests."); + funcInfoGroups.push(trig); + trig.push(op("sinh", "sinh", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sinh))); + trig.push(op("sinh", "sinh", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5), + lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sinh))); + trig.push(op("cosh", "cosh", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cosh))); + trig.push(op("cosh", "cosh", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5), + lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cosh))); + trig.push(op("tanh", "tanh", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tanh))); + trig.push(op("tanh", "tanh", GT, [v(GT, -1.5, 5.5)], f(0.5), f(0.5), + lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tanh))); + + trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests."); + funcInfoGroups.push(trig); + trig.push(op("asinh", "asinh", GT, [v(GT, -1.0, 1.0)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.asinh))); + trig.push(op("acosh", "acosh", GT, [v(GT, 1.0, 2.2)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.acosh))); + // Results are undefined if |x| >= 1, so it diverses from C++ version here. + trig.push(op("atanh", "atanh", GT, [v(GT, -0.99, 0.99)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.atanh))); + + // 8.2 Exponential Functions. + var exps = new es3fShaderOperatorTests.BuiltinFuncGroup("exponential", "Exponential function tests"); + exps.push(op("pow", "pow", GT, [v(GT, 0.1, 8.0), v(GT, -4.0, 2.0)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.pow))); + exps.push(op("exp", "exp", GT, [v(GT, -6.0, 3.0)], f(0.5), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.exp))); + exps.push(op("log", "log", GT, [v(GT, 0.1, 10.0)], f(0.5), f(0.3), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.log))); + exps.push(op("exp2", "exp2", GT, [v(GT, -7.0, 2.0)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(exp2))); + exps.push(op("log2", "log2", GT, [v(GT, 0.1, 10.0)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.log2))); + exps.push(op("sqrt", "sqrt", GT, [v(GT, 0.0, 10.0)], f(0.3), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sqrt))); + exps.push(op("inversesqrt", "inversesqrt", GT, [v(GT, 0.5, 10.0)], f(1.0), f(0.0), + mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(inverseSqrt))); + + funcInfoGroups.push(exps); + + // 8.3 Common Functions. + var comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests."); + comm.push(op("abs", "abs", GT, [v(GT, -2.0, 2.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.abs))); + comm.push(op("sign", "sign", GT, [v(GT, -1.5, 1.5)], f(0.3), f(0.5), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sign))); + comm.push(op("floor", "floor", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.floor))); + comm.push(op("trunc", "trunc", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.trunc))); + comm.push(op("round", "round", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(roundToEven))); + comm.push(op("roundEven", "roundEven", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(roundToEven))); + comm.push(op("ceil", "ceil", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.5), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.ceil))); + comm.push(op("fract", "fract", GT, [v(GT, -1.5, 1.5)], f(0.8), f(0.1), + all, es3fShaderOperatorTests.unaryGenTypeFuncs(fract))); + comm.push(op("mod", "mod", GT, [v(GT, -2.0, 2.0), v(GT, 0.9, 6.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod))); + comm.push(op("mod", "mod", GT, [v(FV, -2.0, 2.0), v(F, 0.9, 6.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale))); + comm.push(op("min", "min", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.min))); + comm.push(op("min", "min", GT, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(minVecScalar))); + comm.push(op("min", "min", IGT, [v(IGT, -4.0, 4.0), v(IGT, -4.0, 4.0)], f(0.125), f(0.5), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.min, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("min", "min", IGT, [v(IV, -4.0, 4.0), v(I, -4.0, 4.0)], f(0.125), f(0.5), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(minVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("min", "min", UGT, [v(UGT, 0.0, 8.0), v(UGT, 0.0, 8.0)], f(0.125), f(0.0), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.min, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("min", "min", UGT, [v(UV, 0.0, 8.0), v(U, 0.0, 8.0)], f(0.125), f(0.0), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(minVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + comm.push(op("max", "max", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.max))); + comm.push(op("max", "max", GT, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(maxVecScalar))); + comm.push(op("max", "max", IGT, [v(IGT, -4.0, 4.0), v(IGT, -4.0, 4.0)], f(0.125), f(0.5), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.max, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("max", "max", IGT, [v(IV, -4.0, 4.0), v(I, -4.0, 4.0)], f(0.125), f(0.5), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(maxVecScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("max", "max", UGT, [v(UGT, 0.0, 8.0), v(UGT, 0.0, 8.0)], f(0.125), f(0.0), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.max, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("max", "max", UGT, [v(UV, 0.0, 8.0), v(U, 0.0, 8.0)], f(0.125), f(0.0), + all, es3fShaderOperatorTests.binaryVecScalarFuncs(maxVecScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + comm.push(op("clamp", "clamp", GT, [v(GT, -1.0, 1.0), v(GT, -0.5, 0.5), v(GT, 0.5, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.ternaryGenTypeFuncs(deMath.clamp))); + comm.push(op("clamp", "clamp", GT, [v(FV, -1.0, 1.0), v(F, -0.5, 0.5), v(F, 0.5, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.ternaryVecScalarScalarFuncs(clampVecScalarScalar))); + comm.push(op("clamp", "clamp", IGT, [v(IGT, -4.0, 4.0), v(IGT, -2.0, 2.0), v(IGT, 2.0, 4.0)], f(0.125), f(0.5), + all, es3fShaderOperatorTests.ternaryGenTypeFuncs(deMath.clamp, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("clamp", "clamp", IGT, [v(IGT, -4.0, 4.0), v(I, -2.0, 2.0), v(I, 2.0, 4.0)], f(0.125), f(0.5), + all, es3fShaderOperatorTests.ternaryVecScalarScalarFuncs(clampVecScalarScalar, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + comm.push(op("clamp", "clamp", UGT, [v(UGT, 0.0, 8.0), v(UGT, 2.0, 6.0), v(UGT, 6.0, 8.0)], f(0.125), f(0.0), + all, es3fShaderOperatorTests.ternaryGenTypeFuncs(deMath.clamp, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + comm.push(op("clamp", "clamp", UGT, [v(UV, 0.0, 8.0), v(U, 2.0, 6.0), v(U, 6.0, 8.0)], f(0.125), f(0.0), + all, es3fShaderOperatorTests.ternaryVecScalarScalarFuncs(clampVecScalarScalar, gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT))); + comm.push(op("mix", "mix", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0), v(GT, 0.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.ternaryGenTypeFuncs(mix))); + comm.push(op("mix", "mix", GT, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0), v(F, 0.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.ternaryVecVecScalarFuncs(mixVecVecScalar))); + comm.push(op("step", "step", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 0.0)], f(0.5), f(0.25), + all, es3fShaderOperatorTests.binaryGenTypeFuncs(step))); + comm.push(op("step", "step", GT, [v(F, -1.0, 1.0), v(FV, -1.0, 0.0)], f(0.5), f(0.25), + all, es3fShaderOperatorTests.binaryScalarVecFuncs(stepScalarVec))); + comm.push(op("smoothstep", "smoothstep", GT, [v(GT, -0.5, 0.0), v(GT, 0.1, 1.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.ternaryGenTypeFuncs(smoothStep))); + comm.push(op("smoothstep", "smoothstep", GT, [v(F, -0.5, 0.0), v(F, 0.1, 1.0), v(FV, -1.0, 1.0)], f(0.5), f(0.5), + all, es3fShaderOperatorTests.ternaryScalarScalarVecFuncs(smoothStepScalarScalarVec))); + + funcInfoGroups.push(comm); + + // 8.4 Geometric Functions. + var geom = new es3fShaderOperatorTests.BuiltinFuncGroup("geometric", "Geometric function tests."); + geom.push(op("length", "length", F, [v(GT, -5.0, 5.0)], f(0.1), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryScalarGenTypeFuncs(length))); + geom.push(op("distance", "distance", F, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0)], f(0.1), f(0.5), + mediumhighp, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(distance))); + geom.push(op("dot", "dot", F, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0)], f(0.1), f(0.5), + mediumhighp, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(dot))); + geom.push(op("cross", "cross", V3, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0)], f(0.1), f(0.5), + mediumhighp, {vec3: es3fShaderOperatorTests.binaryVecVecFuncs(cross).vec3})); + geom.push(op("normalize", "normalize", GT, [v(GT, 0.1, 4.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.unaryArrayFuncs(normalize))); + geom.push(op("faceforward", "faceforward", GT, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.ternaryVecVecVecFuncs(faceforward))); + geom.push(op("reflect", "reflect", GT, [v(GT, -0.8, -0.5), v(GT, 0.5, 0.8)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.binaryVecVecFuncs(reflect))); + geom.push(op("refract", "refract", GT, [v(GT, -0.8, 1.2), v(GT, -1.1, 0.5), v(F, 0.2, 1.5)], f(0.5), f(0.5), + mediumhighp, es3fShaderOperatorTests.ternaryVecVecScalarFuncs(refract))); + + funcInfoGroups.push(geom); + + // 8.6 Vector Relational Functions. + var floatComp = new es3fShaderOperatorTests.BuiltinFuncGroup("float_compare", "Floating point comparison tests."); + floatComp.push(op("lessThan", "lessThan", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanVec))); + floatComp.push(op("lessThanEqual", "lessThanEqual", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanEqualVec))); + floatComp.push(op("greaterThan", "greaterThan", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanVec))); + floatComp.push(op("greaterThanEqual", "greaterThanEqual", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanEqualVec))); + floatComp.push(op("equal", "equal", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(allEqualVec))); + floatComp.push(op("notEqual", "notEqual", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(anyNotEqualVec))); + + funcInfoGroups.push(floatComp); + + var intComp = new es3fShaderOperatorTests.BuiltinFuncGroup("int_compare", "Integer comparison tests."); + intComp.push(op("lessThan", "lessThan", BV, [v(IV, 5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + intComp.push(op("lessThanEqual", "lessThanEqual", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanEqualVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + intComp.push(op("greaterThan", "greaterThan", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + intComp.push(op("greaterThanEqual", "greaterThanEqual", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanEqualVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + intComp.push(op("equal", "equal", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(allEqualVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + intComp.push(op("notEqual", "notEqual", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0), + all, es3fShaderOperatorTests.binaryVecVecFuncs(anyNotEqualVec, gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT))); + + funcInfoGroups.push(intComp); + + var boolComp = new es3fShaderOperatorTests.BuiltinFuncGroup("bool_compare", "Boolean comparison tests."); + var evalBoolEqual = es3fShaderOperatorTests.binaryVecVecFuncs(allEqualVec, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL); + var evalBoolNotEqual = es3fShaderOperatorTests.binaryVecVecFuncs(anyNotEqualVec, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL); + var evalBoolAny = es3fShaderOperatorTests.unaryBooleanGenTypeFuncs(boolAny, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL); + evalBoolAny.scalar = null; + var evalBoolAll = es3fShaderOperatorTests.unaryBooleanGenTypeFuncs(boolAll, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL); + evalBoolAll.scalar = null; + var evalBoolNot = es3fShaderOperatorTests.unaryArrayFuncs(boolNotVec, gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL); + evalBoolNot.scalar = null; + + boolComp.push(op("equal", "equal", BV, [v(BV, -5.2, 4.9), v(BV, -5.0, 5.0)], f(1.0), f(0.0), + na, evalBoolEqual)); + boolComp.push(op("notEqual", "notEqual", BV, [v(BV, -5.2, 4.9), v(BV, -5.0, 5.0)], f(1.0), f(0.0), + na, evalBoolNotEqual)); + boolComp.push(op("any", "any", B, [v(BV, -1.0, 0.3)], f(1.0), f(0.0), + na, evalBoolAny)); + boolComp.push(op("all", "all", B, [v(BV, -0.3, 1.0)], f(1.0), f(0.0), + na, evalBoolAll)); + boolComp.push(op("not", "not", BV, [v(BV, -1.0, 1.0)], f(1.0), f(0.0), + na, evalBoolNot)); + + funcInfoGroups.push(boolComp); + + var s_shaderTypes = [ + gluShaderProgram.shaderType.VERTEX, + gluShaderProgram.shaderType.FRAGMENT + ]; + + var s_floatTypes = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4 + ]; + + var s_intTypes = [ + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4 + ]; + + var s_uintTypes = [ + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4 + ]; + + var s_boolTypes = [ + gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL_VEC2, + gluShaderUtil.DataType.BOOL_VEC3, + gluShaderUtil.DataType.BOOL_VEC4 + ]; + + for (var outerGroupNdx = 0; outerGroupNdx < funcInfoGroups.length; outerGroupNdx++) { + // Create outer group. + var outerGroupInfo = funcInfoGroups[outerGroupNdx]; + var outerGroup = new tcuTestCase.DeqpTest(outerGroupInfo.name, outerGroupInfo.description); + this.addChild(outerGroup); + + // Only create new group if name differs from previous one. + var innerGroup = null; + + for (var funcInfoNdx = 0; funcInfoNdx < outerGroupInfo.funcInfos.length; funcInfoNdx++) { + var funcInfo = outerGroupInfo.funcInfos[funcInfoNdx]; + var shaderFuncName = funcInfo.shaderFuncName; + var isBoolCase = (funcInfo.precision == es3fShaderOperatorTests.Precision.None); + var isBoolOut = es3fShaderOperatorTests.isBoolType(funcInfo.outValue); + var isIntOut = es3fShaderOperatorTests.isIntType(funcInfo.outValue); + var isUintOut = es3fShaderOperatorTests.isUintType(funcInfo.outValue); + var isFloatOut = !isBoolOut && !isIntOut && !isUintOut; + + if (!innerGroup || (innerGroup.name != funcInfo.caseName)) { + var groupDesc = 'Built-in function ' + shaderFuncName + '() tests.'; + innerGroup = new tcuTestCase.DeqpTest(funcInfo.caseName, groupDesc); + outerGroup.addChild(innerGroup); + } + + for (var inScalarSize = 1; inScalarSize <= 4; inScalarSize++) { + var outScalarSize = ((funcInfo.outValue == es3fShaderOperatorTests.ValueType.FLOAT) || (funcInfo.outValue == es3fShaderOperatorTests.ValueType.BOOL)) ? 1 : inScalarSize; // \todo [petri] Int. + var outDataType = isFloatOut ? s_floatTypes[outScalarSize - 1] : + isIntOut ? s_intTypes[outScalarSize - 1] : + isUintOut ? s_uintTypes[outScalarSize - 1] : + isBoolOut ? s_boolTypes[outScalarSize - 1] : + undefined; + + var evalFunc = null; + if (inScalarSize == 1) evalFunc = funcInfo.evalFunctions.scalar; + else if (inScalarSize == 2) evalFunc = funcInfo.evalFunctions.vec2; + else if (inScalarSize == 3) evalFunc = funcInfo.evalFunctions.vec3; + else if (inScalarSize == 4) evalFunc = funcInfo.evalFunctions.vec4; + else throw new Error('Invalid scalar size ' + inScalarSize); + + // Skip if no valid eval func. + // \todo [petri] Better check for V3 only etc. cases? + if (evalFunc == null) + continue; + + var precisions = ['low', 'medium', 'high']; + for (var precId = 0; precId < precisions.length; precId++) { + var precision = precisions[precId]; + if ((funcInfo.precision[precision]) || + (funcInfo.precision == es3fShaderOperatorTests.Precision.None && precision === 'medium')) { // use mediump interpolators for booleans + var precisionPrefix = isBoolCase ? '' : precision + 'p_'; + + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + var shaderType = s_shaderTypes[shaderTypeNdx]; + var shaderSpec = new es3fShaderOperatorTests.ShaderDataSpec(); + var shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + var isVertexCase = shaderType == gluShaderProgram.shaderType.VERTEX; + var isUnaryOp = (funcInfo.inputs.length == 1); + + // \note Data type names will be added to description and name in a following loop. + var desc = 'Built-in function ' + shaderFuncName + '('; + var name = precisionPrefix; + + // Generate shader op. + var shaderOp = 'res = '; + + var precNames = [gluShaderUtil.precision.PRECISION_LOWP, + gluShaderUtil.precision.PRECISION_MEDIUMP, + gluShaderUtil.precision.PRECISION_HIGHP]; + // Setup shader data info. + shaderSpec.numInputs = 0; + shaderSpec.precision = isBoolCase ? undefined : precNames[precId]; + shaderSpec.output = outDataType; + shaderSpec.resultScale = funcInfo.resultScale; + shaderSpec.resultBias = funcInfo.resultBias; + shaderSpec.referenceScale = funcInfo.referenceScale; + shaderSpec.referenceBias = funcInfo.referenceBias; + + if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR) { + if (isUnaryOp && funcInfo.isUnaryPrefix) + shaderOp += shaderFuncName; + } else if (funcInfo.type == es3fShaderOperatorTests.OperationType.FUNCTION) + shaderOp += shaderFuncName + '('; + else // SIDE_EFFECT_OPERATOR + shaderOp += 'in0;\n\t'; + + for (var inputNdx = 0; inputNdx < funcInfo.inputs.length; inputNdx++) { + var prevNdx = inputNdx > 0 ? inputNdx - 1 : funcInfo.inputs.length - 1; + var prevValue = funcInfo.inputs[prevNdx]; + var value = funcInfo.inputs[inputNdx]; + + if (value.valueType == es3fShaderOperatorTests.ValueType.NONE) + continue; // Skip unused input. + + var prevInScalarSize = es3fShaderOperatorTests.isScalarType(prevValue.valueType) ? 1 : inScalarSize; + var prevInDataType = es3fShaderOperatorTests.isFloatType(prevValue.valueType) ? s_floatTypes[prevInScalarSize - 1] : + es3fShaderOperatorTests.isIntType(prevValue.valueType) ? s_intTypes[prevInScalarSize - 1] : + es3fShaderOperatorTests.isUintType(prevValue.valueType) ? s_uintTypes[prevInScalarSize - 1] : + es3fShaderOperatorTests.isBoolType(prevValue.valueType) ? s_boolTypes[prevInScalarSize - 1] : + undefined; + + var curInScalarSize = es3fShaderOperatorTests.isScalarType(value.valueType) ? 1 : inScalarSize; + var curInDataType = es3fShaderOperatorTests.isFloatType(value.valueType) ? s_floatTypes[curInScalarSize - 1] : + es3fShaderOperatorTests.isIntType(value.valueType) ? s_intTypes[curInScalarSize - 1] : + es3fShaderOperatorTests.isUintType(value.valueType) ? s_uintTypes[curInScalarSize - 1] : + es3fShaderOperatorTests.isBoolType(value.valueType) ? s_boolTypes[curInScalarSize - 1] : + undefined; + + // Write input type(s) to case description and name. + + if (inputNdx > 0) + desc += ', '; + + desc += gluShaderUtil.getDataTypeName(curInDataType); + + if (inputNdx == 0 || prevInDataType != curInDataType) // \note Only write input type to case name if different from previous input type (avoid overly long names). + name += gluShaderUtil.getDataTypeName(curInDataType) + '_'; + + // Generate op input source. + + if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR || funcInfo.type == es3fShaderOperatorTests.OperationType.FUNCTION) { + if (inputNdx != 0) { + if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR && !isUnaryOp) + shaderOp += ' ' + shaderFuncName + ' '; + else + shaderOp += ', '; + } + + shaderOp += 'in' + inputNdx.toString(10); + + if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR && isUnaryOp && !funcInfo.isUnaryPrefix) + shaderOp += shaderFuncName; + } else{ + if (inputNdx != 0 || (isUnaryOp && funcInfo.isUnaryPrefix)) + shaderOp += (isUnaryOp ? '' : ' ') + shaderFuncName + (isUnaryOp ? '' : ' '); + + shaderOp += inputNdx == 0 ? 'res' : 'in' + inputNdx.toString(10); // \note in0 has already been assigned to res, so start from in1. + + if (isUnaryOp && !funcInfo.isUnaryPrefix) + shaderOp += shaderFuncName; + } + + // Fill in shader info. + shaderSpec.inputs[shaderSpec.numInputs++] = new es3fShaderOperatorTests.ShaderValue(curInDataType, value.rangeMin, value.rangeMax); + } + + if (funcInfo.type == es3fShaderOperatorTests.OperationType.FUNCTION) + shaderOp += ')'; + + shaderOp += ';'; + + desc += ').'; + name += shaderTypeName; + + // Create the test case. + innerGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, desc, isVertexCase, evalFunc, shaderOp, shaderSpec)); + } + } + } + } + } + } + + // The ?: selection operator. + + var s_selectionInfo = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4, + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4, + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4, + gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL_VEC2, + gluShaderUtil.DataType.BOOL_VEC3, + gluShaderUtil.DataType.BOOL_VEC4 + ]; + + var selectionEvalFuncsFloat = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.FLOAT); + var selectionEvalFuncsInt = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.INT); + var selectionEvalFuncsUint = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.UINT); + var selectionEvalFuncsBool = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.BOOL); + + var selectionGroup = new tcuTestCase.DeqpTest('selection', 'Selection operator tests'); + this.addChild(selectionGroup); + + for (var typeNdx = 0; typeNdx < s_selectionInfo.length; typeNdx++) { + var curType = s_selectionInfo[typeNdx]; + var scalarSize = gluShaderUtil.getDataTypeScalarSize(curType); + var isBoolCase = gluShaderUtil.isDataTypeBoolOrBVec(curType); + var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(curType); + var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(curType); + var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(curType); + var dataTypeStr = gluShaderUtil.getDataTypeName(curType); + + var evalFuncs = selectionEvalFuncsFloat; + if (isBoolCase) + evalFuncs = selectionEvalFuncsBool; + else if (isIntCase) + evalFuncs = selectionEvalFuncsInt; + else if (isUintCase) + evalFuncs = selectionEvalFuncsUint; + + var evalFunc = evalFuncs[scalarSize]; + + for (var prec in gluShaderUtil.precision) { + var precision = gluShaderUtil.precision[prec]; + if (isBoolCase && precision != gluShaderUtil.precision.PRECISION_MEDIUMP) // Use mediump interpolators for booleans. + continue; + + var precisionStr = gluShaderUtil.getPrecisionName(precision); + var precisionPrefix = isBoolCase ? '' : (precisionStr + '_'); + + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + var shaderType = s_shaderTypes[shaderTypeNdx]; + var shaderSpec = new es3fShaderOperatorTests.ShaderDataSpec(); + var shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + var isVertexCase = shaderType == gluShaderProgram.shaderType.VERTEX; + + var name = precisionPrefix + dataTypeStr + '_' + shaderTypeName; + + shaderSpec.numInputs = 3; + shaderSpec.precision = isBoolCase ? undefined : precision; + shaderSpec.output = curType; + shaderSpec.resultScale = isBoolCase ? f(1.0) : isFloatCase ? f(0.5) : isUintCase ? f(0.5) : f(0.1); + shaderSpec.resultBias = isBoolCase ? f(0.0) : isFloatCase ? f(0.5) : isUintCase ? f(0.0) : f(0.5); + shaderSpec.referenceScale = shaderSpec.resultScale; + shaderSpec.referenceBias = shaderSpec.resultBias; + + var rangeMin = isBoolCase ? -1.0 : isFloatCase ? -1.0 : isUintCase ? 0.0 : -5.0; + var rangeMax = isBoolCase ? 1.0 : isFloatCase ? 1.0 : isUintCase ? 2.0 : 5.0; + + shaderSpec.inputs[0] = new es3fShaderOperatorTests.ShaderValue(gluShaderUtil.DataType.BOOL, f(-1.0), f(1.0)); + shaderSpec.inputs[1] = new es3fShaderOperatorTests.ShaderValue(curType, f(rangeMin), f(rangeMax)); + shaderSpec.inputs[2] = new es3fShaderOperatorTests.ShaderValue(curType, f(rangeMin), f(rangeMax)); + + selectionGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, '', isVertexCase, evalFunc, 'res = in0 ? in1 : in2;', shaderSpec)); + } + } + } + + // The sequence operator (comma). + /** @type {tcuTestCase.DeqpTest} */ var sequenceGroup = new tcuTestCase.DeqpTest('sequence', 'sequence'); + this.addChild(sequenceGroup); + + /** @type {tcuTestCase.DeqpTest} */ var sequenceNoSideEffGroup = new tcuTestCase.DeqpTest('no_side_effects', 'Sequence tests without side-effects'); + /** @type {tcuTestCase.DeqpTest} */ var sequenceSideEffGroup = new tcuTestCase.DeqpTest('side_effects', 'Sequence tests with side-effects'); + sequenceGroup.addChild(sequenceNoSideEffGroup); + sequenceGroup.addChild(sequenceSideEffGroup); + + /** + * @struct + * @constructor + * @param {boolean} containsSideEffects + * @param {string} caseName + * @param {string} expressionStr + * @param {number} numInputs + * @param {Array} inputTypes + * @param {gluShaderUtil.DataType} resultType + * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc + */ + var SequenceCase = function(containsSideEffects, caseName, expressionStr, numInputs, inputTypes, resultType, evalFunc) { + /** @type {boolean} */ this.containsSideEffects = containsSideEffects; + /** @type {string} */ this.caseName = caseName; + /** @type {string} */ this.expressionStr = expressionStr; + /** @type {number} */ this.numInputs = numInputs; + /** @type {Array} */ this.inputTypes = inputTypes; + /** @type {gluShaderUtil.DataType} */ this.resultType = resultType; + /** @type {glsShaderRenderCase.ShaderEvalFunc} */ this.evalFunc = evalFunc; + }; + + /** @type {Array} */ var s_sequenceCases = [ + new SequenceCase(false, 'vec4', 'in0, in2 + in1, in1 + in0', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4], gluShaderUtil.DataType.FLOAT_VEC4, es3fShaderOperatorTests.evalSequenceNoSideEffCase0), + new SequenceCase(false, 'float_uint', 'in0 + in2, in1 + in1', 3, [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.UINT, gluShaderUtil.DataType.FLOAT], gluShaderUtil.DataType.UINT, es3fShaderOperatorTests.evalSequenceNoSideEffCase1), + new SequenceCase(false, 'bool_vec2', 'in0 && in1, in0, ivec2(vec2(in0) + in2)', 3, [gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.FLOAT_VEC2], gluShaderUtil.DataType.INT_VEC2, es3fShaderOperatorTests.evalSequenceNoSideEffCase2), + new SequenceCase(false, 'vec4_ivec4_bvec4', 'in0 + vec4(in1), in2, in1', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.INT_VEC4, gluShaderUtil.DataType.BOOL_VEC4], gluShaderUtil.DataType.INT_VEC4, es3fShaderOperatorTests.evalSequenceNoSideEffCase3), + + new SequenceCase(true, 'vec4', 'in0++, in1 = in0 + in2, in2 = in1', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4], gluShaderUtil.DataType.FLOAT_VEC4, es3fShaderOperatorTests.evalSequenceSideEffCase0), + new SequenceCase(true, 'float_uint', 'in1++, in0 = float(in1), in1 = uint(in0 + in2)', 3, [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.UINT, gluShaderUtil.DataType.FLOAT], gluShaderUtil.DataType.UINT, es3fShaderOperatorTests.evalSequenceSideEffCase1), + new SequenceCase(true, 'bool_vec2', 'in1 = in0, in2++, in2 = in2 + vec2(in1), ivec2(in2)', 3, [gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.FLOAT_VEC2], gluShaderUtil.DataType.INT_VEC2, es3fShaderOperatorTests.evalSequenceSideEffCase2), + new SequenceCase(true, 'vec4_ivec4_bvec4', 'in0 = in0 + vec4(in2), in1 = in1 + ivec4(in0), in1++', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.INT_VEC4, gluShaderUtil.DataType.BOOL_VEC4], gluShaderUtil.DataType.INT_VEC4, es3fShaderOperatorTests.evalSequenceSideEffCase3) + ]; + + for (var caseNdx = 0; caseNdx < s_sequenceCases.length; caseNdx++) { + for (var precision in gluShaderUtil.precision) { + for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) { + /** @type {gluShaderProgram.shaderType} */ var shaderType = s_shaderTypes[shaderTypeNdx]; + /** @type {es3fShaderOperatorTests.ShaderDataSpec} */ var shaderSpec = new es3fShaderOperatorTests.ShaderDataSpec(); + /** @type {string} */ var shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType); + /** @type {boolean} */ var isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX; + + /** @type {string} */ var name = gluShaderUtil.getPrecisionName(gluShaderUtil.precision[precision]) + '_' + s_sequenceCases[caseNdx].caseName + '_' + shaderTypeName; + + shaderSpec.numInputs = s_sequenceCases[caseNdx].numInputs; + shaderSpec.precision = gluShaderUtil.precision[precision]; + shaderSpec.output = s_sequenceCases[caseNdx].resultType; + shaderSpec.resultScale = f(0.5); + shaderSpec.resultBias = f(0.0); + shaderSpec.referenceScale = shaderSpec.resultScale; + shaderSpec.referenceBias = shaderSpec.resultBias; + + for (var inputNdx = 0; inputNdx < s_sequenceCases[caseNdx].numInputs; inputNdx++) { + /** @type {gluShaderUtil.DataType} */ var type = s_sequenceCases[caseNdx].inputTypes[inputNdx]; + /** @type {es3fShaderOperatorTests.FloatScalar} */ var rangeMin = gluShaderUtil.isDataTypeFloatOrVec(type) ? + f(-0.5) : gluShaderUtil.isDataTypeIntOrIVec(type) ? + f(-2.0) : gluShaderUtil.isDataTypeUintOrUVec(type) ? + f(0.0) : f(-1.0); + + /** @type {es3fShaderOperatorTests.FloatScalar} */ var rangeMax = gluShaderUtil.isDataTypeFloatOrVec(type) ? + f(0.5) : gluShaderUtil.isDataTypeIntOrIVec(type) ? + f(2.0) : gluShaderUtil.isDataTypeUintOrUVec(type) ? + f(2.0) : f(1.0); + + shaderSpec.inputs[inputNdx] = new es3fShaderOperatorTests.ShaderValue(type, rangeMin, rangeMax); + } + + /** @type {string} */ var expression = 'res = (' + s_sequenceCases[caseNdx].expressionStr + ');'; + + if (s_sequenceCases[caseNdx].containsSideEffects) + sequenceSideEffGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, '', isVertexCase, s_sequenceCases[caseNdx].evalFunc, expression, shaderSpec)); + else + sequenceNoSideEffGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, '', isVertexCase, s_sequenceCases[caseNdx].evalFunc, expression, shaderSpec)); + } + } + } + +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fShaderOperatorTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderOperatorTests.ShaderOperatorTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderOperatorTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js new file mode 100644 index 000000000..3e4233db4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js @@ -0,0 +1,791 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderPackingFunctionTests'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.common.tcuMatrixUtil'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluVarType'); +goog.require('modules.shared.glsShaderExecUtil'); + + + +goog.scope(function() { + var es3fShaderPackingFunctionTests = functional.gles3.es3fShaderPackingFunctionTests; + var tcuFloat = framework.common.tcuFloat; + var tcuTestCase = framework.common.tcuTestCase; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluVarType = framework.opengl.gluVarType; + var glsShaderExecUtil = modules.shared.glsShaderExecUtil; + var tcuMatrixUtil = framework.common.tcuMatrixUtil; + /** + * @param {number} a + * @param {number} b + * @return {number} + */ + es3fShaderPackingFunctionTests.getUlpDiff = function(a, b) { + /** @type {number} */ var aBits = tcuFloat.newFloat32(a).bits(); + /** @type {number} */ var bBits = tcuFloat.newFloat32(b).bits(); + return aBits > bBits ? aBits - bBits : bBits - aBits; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase = function(name, description, shaderType) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {gluShaderProgram.shaderType} */ this.m_shaderType = shaderType; + /** @type {?glsShaderExecUtil.ShaderSpec} */ this.m_spec = new glsShaderExecUtil.ShaderSpec(); + /** @type {?glsShaderExecUtil.ShaderExecutor} */ this.m_executor = null; + }; + + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype.constructor = es3fShaderPackingFunctionTests.ShaderPackingFunctionCase; + + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype.init = function() { + assertMsgOptions(!this.m_executor, 'Error: Executor is not null.', false, true); + this.m_executor = glsShaderExecUtil.createExecutor(this.m_shaderType, this.m_spec); + if (!this.m_executor.isOk()) + throw new Error('Compile failed'); + }; + + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype.deinit = function() { + this.m_executor = null; + }; + + /** + * @param {gluShaderUtil.precision} precision + * @return {string} + */ + es3fShaderPackingFunctionTests.getPrecisionPostfix = function(precision) { + /** @type {Array} */ var s_postfix = [ + '_lowp', + '_mediump', + '_highp' + ]; + assertMsgOptions(0 <= precision && precision < s_postfix.length, 'Error: Out of range', false, true); + return s_postfix[precision]; + }; + + /** + * @param {gluShaderProgram.shaderType} shaderType + * @return {string} + */ + es3fShaderPackingFunctionTests.getShaderTypePostfix = function(shaderType) { + /** @type {Array} */ var s_postfix = [ + '_vertex', + '_fragment' + ]; + assertMsgOptions(0 <= shaderType && shaderType < s_postfix.length, 'Error Out of range', false, true); + return s_postfix[shaderType]; + }; + + /** + * @constructor + * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase} + * @param {gluShaderProgram.shaderType} shaderType + * @param {gluShaderUtil.precision} precision + */ + es3fShaderPackingFunctionTests.PackSnorm2x16Case = function(shaderType, precision) { + /** @const {string} */ var name = 'packsnorm2x16' + + es3fShaderPackingFunctionTests.getPrecisionPostfix(precision) + + es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType); + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'packSnorm2x16', shaderType); + this.m_precision = precision; + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.source = 'out0 = packSnorm2x16(in0);'; + }; + + es3fShaderPackingFunctionTests.PackSnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype); + es3fShaderPackingFunctionTests.PackSnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.PackSnorm2x16Case; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPackingFunctionTests.PackSnorm2x16Case.prototype.iterate = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002); + /** @type {Array>} */ var inputs = []; + /** @type {goog.TypedArray} */ var outputs; // deUint32 + /** @type {goog.TypedArray} */ var shaderExecutorOutput; + /** @type {number} */ var maxDiff = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 1 : // Rounding only. + this.m_precision == gluShaderUtil.precision.PRECISION_MEDIUMP ? 33 : // (2^-10) * (2^15) + 1 + this.m_precision == gluShaderUtil.precision.PRECISION_LOWP ? 129 : 0; // (2^-8) * (2^15) + 1 + /** @type {number} */ var x; + /** @type {number} */ var y; + // Special values to check. + inputs.push([0.0, 0.0]); + inputs.push([-1.0, 1.0]); + inputs.push([0.5, -0.5]); + inputs.push([-1.5, 1.5]); + inputs.push([0.25, -0.75]); + + // Random values, mostly in range. + for (var ndx = 0; ndx < 15; ndx++) { + x = rnd.getFloat() * 2.5 - 1.25; + y = rnd.getFloat() * 2.5 - 1.25; + inputs.push([x, y]); + } + + // Large random values. + for (var ndx = 0; ndx < 80; ndx++) { + x = rnd.getFloat() * 1e6 - 0.5e6; + y = rnd.getFloat() * 1e6 - 0.5e6; + inputs.push([x, y]); + } + + bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values'); + + this.m_executor.useProgram(); + shaderExecutorOutput = this.m_executor.execute(inputs.length, [tcuMatrixUtil.flatten(inputs)])[0]; + + // Convert outputs if we get them as Uint8Array. + // - VertexShaderExecutor.execute() returns either an array of Uint8Array + // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array + outputs = new Uint32Array(shaderExecutorOutput.buffer); + + // Verify + /** @type {number} */ var numValues = inputs.length; + /** @type {number} */ var maxPrints = 10; + /** @type {number} */ var numFailed = 0; + + for (var valNdx = 0; valNdx < numValues; valNdx++) { + /** @type {number} */ var ref0 = (deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][0], -1.0, 1.0) * 32767.0), -(1 << 15), (1 << 15) - 1)) & 0xFFFF; + /** @type {number} */ var ref1 = (deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][1], -1.0, 1.0) * 32767.0), -(1 << 15), (1 << 15) - 1)) & 0xFFFF; + /** @type {number} */ var ref = (ref1 << 16) | ref0; + /** @type {number} */ var res = outputs[valNdx]; + /** @type {number} */ var res0 = (res & 0xffff); + /** @type {number} */ var res1 = deMath.shiftRight(res, 16); + /** @type {number} */ var diff0 = Math.abs(ref0 - res0); + /** @type {number} */ var diff1 = Math.abs(ref1 - res1); + + if (diff0 > maxDiff || diff1 > maxDiff) { + if (numFailed < maxPrints) { + bufferedLogToConsole( + 'ERROR: Mismatch in value ' + valNdx + + ', expected packSnorm2x16(' + inputs[valNdx] + ') = ' + ref + //tcu::toHex(ref) + ', got ' + res + // tcu::toHex(res) + '\n diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff); + } + else if (numFailed == maxPrints) + bufferedLogToConsole('...'); + + numFailed += 1; + } + } + + bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed'); + + /** @type {boolean} */ var isOk = numFailed === 0; + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + + /** + * @constructor + * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase} + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderPackingFunctionTests.UnpackSnorm2x16Case = function(shaderType) { + /** @const {string} */ var name = 'unpacksnorm2x16' + es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType); + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'unpackSnorm2x16', shaderType); + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.source = 'out0 = unpackSnorm2x16(in0);'; + }; + + es3fShaderPackingFunctionTests.UnpackSnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype); + es3fShaderPackingFunctionTests.UnpackSnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.UnpackSnorm2x16Case; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPackingFunctionTests.UnpackSnorm2x16Case.prototype.iterate = function() { + /** @type {number} */ var maxDiff = 1; // Rounding error. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002); + /** @type {Array} */ var inputs = []; + /** @type {goog.TypedArray} */ var shaderExecutorOutput; //vector> + /** @type {goog.TypedArray} */ var outputs; //vector> + + inputs.push(0x00000000); + inputs.push(0x7fff8000); + inputs.push(0x80007fff); + inputs.push(0xffffffff); + inputs.push(0x0001fffe); + + // Random values. + for (var ndx = 0; ndx < 95; ndx++) + inputs.push(rnd.getInt()); + + bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values'); + + this.m_executor.useProgram(); + shaderExecutorOutput = this.m_executor.execute(inputs.length, [inputs])[0]; // This test case only has one output + + // Convert outputs if we get them as Uint8Array. + // - VertexShaderExecutor.execute() returns either an array of Uint8Array + // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array + outputs = new Float32Array(shaderExecutorOutput.buffer); + + // Verify + /** @type {number} */ var numValues = inputs.length; + /** @type {number} */ var maxPrints = 10; + /** @type {number} */ var numFailed = 0; + + for (var valNdx = 0; valNdx < inputs.length; valNdx++) { + /** @type {number} */ var in0 = Math.floor(inputs[valNdx] & 0xffff); + // Convert 16-bit uint to 16-bit int + var view = new DataView(new ArrayBuffer(4)); + view.setUint16(0, in0, true); + in0 = view.getInt16(0, true); + /** @type {number} */ var in1 = Math.floor(deMath.shiftRight(inputs[valNdx], 16)); + // Convert 16-bit uint to 16-bit int + var view = new DataView(new ArrayBuffer(4)); + view.setUint16(0, in1, true); + in1 = view.getInt16(0, true); + /** @type {number} */ var ref0 = deMath.clamp(in0 / 32767., -1.0, 1.0); + /** @type {number} */ var ref1 = deMath.clamp(in1 / 32767., -1.0, 1.0); + /** @type {number} */ var res0 = outputs[2 * valNdx]; + /** @type {number} */ var res1 = outputs[2 * valNdx + 1]; + + /** @type {number} */ var diff0 = es3fShaderPackingFunctionTests.getUlpDiff(ref0, res0); + /** @type {number} */ var diff1 = es3fShaderPackingFunctionTests.getUlpDiff(ref1, res1); + + if (diff0 > maxDiff || diff1 > maxDiff) { + if (numFailed < maxPrints) + bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + ',\n' + + ' expected unpackSnorm2x16(' + inputs[valNdx].toString(16) + ') = ' + + 'vec2(' + ref0.toString(16) + ', ' + ref1.toString(16) + ')' + + ', got vec2(' + res0.toString(16) + ', ' + res1.toString(16) + ')' + + '\n ULP diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff); + else if (numFailed == maxPrints) + bufferedLogToConsole('...'); + + numFailed += 1; + } + } + + bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed'); + + /** @type {boolean} */ var isOk = numFailed === 0; + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase} + * @param {gluShaderProgram.shaderType} shaderType + * @param {gluShaderUtil.precision} precision + */ + es3fShaderPackingFunctionTests.PackUnorm2x16Case = function(shaderType, precision) { + /** @const {string} */ var name = 'packunorm2x16' + + es3fShaderPackingFunctionTests.getPrecisionPostfix(precision) + + es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType); + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'packUnorm2x16', shaderType); + this.m_precision = precision; + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.source = 'out0 = packUnorm2x16(in0);'; + }; + + es3fShaderPackingFunctionTests.PackUnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype); + es3fShaderPackingFunctionTests.PackUnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.PackUnorm2x16Case; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPackingFunctionTests.PackUnorm2x16Case.prototype.iterate = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002); + /** @type {Array>} */ var inputs = []; + /** @type {goog.TypedArray} */ var shaderExecutorOutput; + /** @type {goog.TypedArray} */ var outputs; // deUint32 + /** @type {number} */ var maxDiff = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 1 : // Rounding only. + this.m_precision == gluShaderUtil.precision.PRECISION_MEDIUMP ? 65 : // (2^-10) * (2^16) + 1 + this.m_precision == gluShaderUtil.precision.PRECISION_LOWP ? 257 : 0; // (2^-8) * (2^16) + 1 + /** @type {number} */ var x; + /** @type {number} */ var y; + // Special values to check. + inputs.push([0.0, 0.0]); + inputs.push([0.5, 1.0]); + inputs.push([1.0, 0.5]); + inputs.push([-0.5, 1.5]); + inputs.push([0.25, 0.75]); + + // Random values, mostly in range. + for (var ndx = 0; ndx < 15; ndx++) { + x = rnd.getFloat() * 1.25; + y = rnd.getFloat() * 1.25; + inputs.push([x, y]); + } + + // Large random values. + for (var ndx = 0; ndx < 80; ndx++) { + x = rnd.getFloat() * 1e6 - 1e5; + y = rnd.getFloat() * 1e6 - 1e5; + inputs.push([x, y]); + } + + bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values'); + + this.m_executor.useProgram(); + shaderExecutorOutput = this.m_executor.execute(inputs.length, [tcuMatrixUtil.flatten(inputs)])[0]; + + // Convert outputs if we get them as Uint8Array. + // - VertexShaderExecutor.execute() returns either an array of Uint8Array + // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array + outputs = new Uint32Array(shaderExecutorOutput.buffer); + + // Verify + /** @type {number} */ var numValues = inputs.length; + /** @type {number} */ var maxPrints = 10; + /** @type {number} */ var numFailed = 0; + + for (var valNdx = 0; valNdx < inputs.length; valNdx++) { + /** @type {number} */ var ref0 = deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][0], 0.0, 1.0) * 65535.0), 0, (1 << 16) - 1) & 0xFFFF; + /** @type {number} */ var ref1 = deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][1], 0.0, 1.0) * 65535.0), 0, (1 << 16) - 1) & 0xFFFF; + /** @type {number} */ var ref = (ref1 << 16) | ref0; + /** @type {number} */ var res = outputs[valNdx]; + /** @type {number} */ var res0 = (res & 0xffff); + /** @type {number} */ var res1 = deMath.shiftRight(res, 16); + /** @type {number} */ var diff0 = Math.abs(ref0 - res0); + /** @type {number} */ var diff1 = Math.abs(ref1 - res1); + + if (diff0 > maxDiff || diff1 > maxDiff) { + if (numFailed < maxPrints) + bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + + ', expected packUnorm2x16(' + inputs[valNdx] + ') = ' + ref /*tcu::toHex(ref)*/ + + ', got ' + res /*tcu::toHex(res)*/ + + '\n diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff); + else if (numFailed === maxPrints) + bufferedLogToConsole('...'); + + numFailed += 1; + } + } + + bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed'); + + /** @type {boolean} */ var isOk = numFailed === 0; + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase} + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderPackingFunctionTests.UnpackUnorm2x16Case = function(shaderType) { + /** @const {string} */ var name = 'unpackunorm2x16' + + es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType); + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'unpackUnorm2x16', shaderType); + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.source = 'out0 = unpackUnorm2x16(in0);'; + }; + + es3fShaderPackingFunctionTests.UnpackUnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype); + es3fShaderPackingFunctionTests.UnpackUnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.UnpackUnorm2x16Case; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPackingFunctionTests.UnpackUnorm2x16Case.prototype.iterate = function() { + /** @type {number} */ var maxDiff = 1; // Rounding error. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002); + /** @type {Array} */ var inputs = []; + /** @type {goog.TypedArray} */ var shaderExecutorOutput; + /** @type {goog.TypedArray} */ var outputs; //vector + + inputs.push(0x00000000); + inputs.push(0x7fff8000); + inputs.push(0x80007fff); + inputs.push(0xffffffff); + inputs.push(0x0001fffe); + + // Random values. + for (var ndx = 0; ndx < 95; ndx++) + inputs.push(rnd.getInt()); + + bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values'); + + this.m_executor.useProgram(); + shaderExecutorOutput = this.m_executor.execute(inputs.length, [inputs])[0]; + + // Convert outputs if we get them as Uint8Array. + // - VertexShaderExecutor.execute() returns either an array of Uint8Array + // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array + outputs = new Float32Array(shaderExecutorOutput.buffer); + + // Verify + /** @type {number} */ var numValues = inputs.length; + /** @type {number} */ var maxPrints = 10; + /** @type {number} */ var numFailed = 0; + + for (var valNdx = 0; valNdx < inputs.length; valNdx++) { + /** @type {number} */ var in0 = Math.floor(inputs[valNdx] & 0xffff); + /** @type {number} */ var in1 = Math.floor(deMath.shiftRight(inputs[valNdx], 16)); + /** @type {number} */ var ref0 = in0 / 65535.0; + /** @type {number} */ var ref1 = in1 / 65535.0; + /** @type {number} */ var res0 = outputs[2 * valNdx]; + /** @type {number} */ var res1 = outputs[2 * valNdx + 1]; + + /** @type {number} */ var diff0 = es3fShaderPackingFunctionTests.getUlpDiff(ref0, res0); + /** @type {number} */ var diff1 = es3fShaderPackingFunctionTests.getUlpDiff(ref1, res1); + + if (diff0 > maxDiff || diff1 > maxDiff) { + if (numFailed < maxPrints) + bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + ',\n' + + ' expected unpackUnorm2x16(' + inputs[valNdx].toString(16) + ') = ' + + 'vec2(' + ref0.toString(16) + ', ' + ref1.toString(16) + ')' + + ', got vec2(' + res0.toString(16) + ', ' + res1.toString(16) + ')' + + '\n ULP diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff); + else if (numFailed === maxPrints) + bufferedLogToConsole('...'); + + numFailed += 1; + } + } + + bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed'); + + /** @type {boolean} */ var isOk = numFailed === 0; + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase} + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderPackingFunctionTests.PackHalf2x16Case = function(shaderType) { + /** @const {string} */ var name = 'packhalf2x16' + + es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType); + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'packHalf2x16', shaderType); + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.source = 'out0 = packHalf2x16(in0);'; + }; + + es3fShaderPackingFunctionTests.PackHalf2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype); + es3fShaderPackingFunctionTests.PackHalf2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.PackHalf2x16Case; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPackingFunctionTests.PackHalf2x16Case.prototype.iterate = function() { + /** @type {number} */ var maxDiff = 0; // Values can be represented exactly in mediump. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002); + /** @type {Array>} */ var inputs = []; + /** @type {goog.TypedArray} */ var shaderExecutorOutput; + /** @type {goog.TypedArray} */ var outputs; // deUint32 + + // Special values to check. + inputs.push([0.0, 0.0]); + inputs.push([0.5, 1.0]); + inputs.push([1.0, 0.5]); + inputs.push([-0.5, 1.5]); + inputs.push([0.25, 0.75]); + + // Random values. + /** @type {number} */ var minExp = -14; + /** @type {number} */ var maxExp = 15; + + /** @type {Array} */ var v = []; + for (var ndx = 0; ndx < 95; ndx++) { + for (var c = 0; c < 2; c++) { + /** @type {number} */ var s = rnd.getBool() ? 1 : -1; + /** @type {number} */ var exp = rnd.getInt(minExp, maxExp); + /** @type {number} */ var mantissa = rnd.getInt(0) & ((1 << 23) - 1); + + v[c] = (new tcuFloat.deFloat()).construct(s, exp ? exp : 1 /* avoid denormals */, (1 << 23) | mantissa).getValue(); + } + inputs.push(v); + } + + // Convert input values to fp16 and back to make sure they can be represented exactly in mediump. + for (var inVal in inputs) + inputs[inVal] = [tcuFloat.newFloat16(inputs[inVal][0]).getValue(), tcuFloat.newFloat16(inputs[inVal][1]).getValue()]; + + bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values'); + + this.m_executor.useProgram(); + shaderExecutorOutput = this.m_executor.execute(inputs.length, [tcuMatrixUtil.flatten(inputs)])[0]; + + // Convert outputs if we get them as Uint8Array. + // - VertexShaderExecutor.execute() returns either an array of Uint8Array + // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array + outputs = new Uint32Array(shaderExecutorOutput.buffer); + + // Verify + /** @type {number} */ var numValues = inputs.length; + /** @type {number} */ var maxPrints = 10; + /** @type {number} */ var numFailed = 0; + + for (var valNdx = 0; valNdx < inputs.length; valNdx++) { + /** @type {number} */ var ref0 = tcuFloat.newFloat16(inputs[valNdx][0]).bits(); + /** @type {number} */ var ref1 = tcuFloat.newFloat16(inputs[valNdx][1]).bits(); + /** @type {number} */ var ref = (ref1 << 16) | ref0; + /** @type {number} */ var res = outputs[valNdx]; + /** @type {number} */ var res0 = (res & 0xffff); + /** @type {number} */ var res1 = deMath.shiftRight(res, 16); + /** @type {number} */ var diff0 = Math.abs(ref0 - res0); + /** @type {number} */ var diff1 = Math.abs(ref1 - res1); + + if (diff0 > maxDiff || diff1 > maxDiff) { + if (numFailed < maxPrints) + bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + + ', expected packHalf2x16(' + inputs[valNdx] + ') = ' + ref /*tcu::toHex(ref)*/ + + ', got ' + res /*tcu::toHex(res)*/ + + '\n diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff); + else if (numFailed == maxPrints) + bufferedLogToConsole('...'); + + numFailed += 1; + } + } + + bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed'); + + /** @type {boolean} */ var isOk = numFailed === 0; + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + + }; + + /** + * @constructor + * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase} + * @param {gluShaderProgram.shaderType} shaderType + */ + es3fShaderPackingFunctionTests.UnpackHalf2x16Case = function(shaderType) { + /** @const {string} */ var name = 'unpackhalf2x16' + + es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType); + es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'unpackHalf2x16', shaderType); + + this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP))); + this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_MEDIUMP))); + this.m_spec.source = 'out0 = unpackHalf2x16(in0);'; + }; + + es3fShaderPackingFunctionTests.UnpackHalf2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype); + es3fShaderPackingFunctionTests.UnpackHalf2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.UnpackHalf2x16Case; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPackingFunctionTests.UnpackHalf2x16Case.prototype.iterate = function() { + /** @type {number} */ var maxDiff = 0; // All bits must be accurate. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002); + /** @type {Array} */ var inputs = []; + /** @type {goog.TypedArray} */ var outputs; // vector> + /** @type {goog.TypedArray} */ var shaderExecutorOutput; + + // Special values. + inputs.push((tcuFloat.newFloat16(0.0).bits() << 16) | tcuFloat.newFloat16(1.0).bits()); + inputs.push((tcuFloat.newFloat16(1.0).bits() << 16) | tcuFloat.newFloat16(0.0).bits()); + inputs.push((tcuFloat.newFloat16(-1.0).bits() << 16) | tcuFloat.newFloat16(0.5).bits()); + inputs.push((tcuFloat.newFloat16(0.5).bits() << 16) | tcuFloat.newFloat16(-0.5).bits()); + + // Construct random values. + /** @type {number} */ var minExp = -14; + /** @type {number} */ var maxExp = 15; + /** @type {number} */ var mantBits = 10; + + /** @type {number} */ var inVal = 0; + for (var ndx = 0; ndx < 96; ndx++) { + for (var c = 0; c < 2; c++) { + /** @type {number} */ var s = rnd.getBool() ? 1 : -1; + /** @type {number} */ var exp = rnd.getInt(minExp, maxExp); + /** @type {number} */ var mantissa = rnd.getInt(0) & ((1 << mantBits) - 1); + /** @type {number} */ var value = tcuFloat.newFloat16(0).construct(s, exp ? exp : 1 /* avoid denorm */, (1 << 10) | mantissa).bits(); + + inVal |= value << (16 * c); + } + inputs.push(inVal); + } + + bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values'); + + this.m_executor.useProgram(); + shaderExecutorOutput = this.m_executor.execute(inputs.length, [inputs])[0]; + + // Convert outputs if we get them as Uint8Array. + // - VertexShaderExecutor.execute() returns either an array of Uint8Array + // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array + outputs = new Float32Array(shaderExecutorOutput.buffer); + + // Verify + /** @type {number} */ var numValues = inputs.length + /** @type {number} */ var maxPrints = 10; + /** @type {number} */ var numFailed = 0; + + for (var valNdx = 0; valNdx < inputs.length; valNdx++) { + /** @type {number} */ var in0 = (inputs[valNdx] & 0xffff); + /** @type {number} */ var in1 = deMath.shiftRight(inputs[valNdx], 16); + /** @type {number} */ var ref0 = tcuFloat.halfFloatToNumber(in0); + /** @type {number} */ var ref1 = tcuFloat.halfFloatToNumber(in1); + /** @type {number} */ var res0 = outputs[2 * valNdx]; + /** @type {number} */ var res1 = outputs[2 * valNdx + 1]; + /** @type {number} */ var refBits0 = tcuFloat.newFloat32(ref0).bits(); + /** @type {number} */ var refBits1 = tcuFloat.newFloat32(ref1).bits(); + /** @type {number} */ var resBits0 = tcuFloat.newFloat32(res0).bits(); + /** @type {number} */ var resBits1 = tcuFloat.newFloat32(res1).bits(); + + /** @type {number} */ var diff0 = Math.abs(refBits0 - resBits0); + /** @type {number} */ var diff1 = Math.abs(refBits1 - resBits1); + + if (isNaN(ref0) && isNaN(res0)) + diff0 = 0; + if (isNaN(ref1) && isNaN(res1)) + diff1 = 0; + + if (diff0 > maxDiff || diff1 > maxDiff) { + if (numFailed < maxPrints) + bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + ',\n' + + ' expected unpackHalf2x16(' + inputs[valNdx] /*tcu::toHex(inputs[valNdx])*/ + ') = ' + + 'vec2(' + ref0 + ' / ' + refBits0 /*tcu::toHex(refBits0)*/ + ', ' + ref1 + ' / ' + refBits1 /*tcu::toHex(refBits1)*/ + ')' + + ', got vec2(' + res0 + ' / ' + resBits0 /*tcu::toHex(resBits0)*/ + ', ' + res1 + ' / ' + resBits1 /*tcu::toHex(resBits1)*/ + ')' + + '\n ULP diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff); + else if (numFailed == maxPrints) + bufferedLogToConsole('...'); + + numFailed += 1; + } + } + + bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed'); + + /** @type {boolean} */ var isOk = numFailed === 0; + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderPackingFunctionTests.ShaderPackingFunctionTests = function() { + tcuTestCase.DeqpTest.call(this, 'pack_unpack', 'Floating-point pack and unpack function tests'); + }; + + es3fShaderPackingFunctionTests.ShaderPackingFunctionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderPackingFunctionTests.ShaderPackingFunctionTests.prototype.constructor = es3fShaderPackingFunctionTests.ShaderPackingFunctionTests; + + es3fShaderPackingFunctionTests.ShaderPackingFunctionTests.prototype.init = function() { + var testGroup = tcuTestCase.runner.testCases; + testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_LOWP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_LOWP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_MEDIUMP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_MEDIUMP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_HIGHP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_HIGHP)); + + testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX)); + testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT)); + + testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_LOWP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_LOWP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_MEDIUMP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_MEDIUMP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_HIGHP)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_HIGHP)); + + testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX)); + testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT)); + + testGroup.addChild(new es3fShaderPackingFunctionTests.PackHalf2x16Case(gluShaderProgram.shaderType.VERTEX)); + testGroup.addChild(new es3fShaderPackingFunctionTests.PackHalf2x16Case(gluShaderProgram.shaderType.FRAGMENT)); + + testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackHalf2x16Case(gluShaderProgram.shaderType.VERTEX)); + testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackHalf2x16Case(gluShaderProgram.shaderType.FRAGMENT)); + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderPackingFunctionTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderPackingFunctionTests.ShaderPackingFunctionTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderPackingFunctionTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js new file mode 100644 index 000000000..eef5be85f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js @@ -0,0 +1,941 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderPrecisionTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { + var es3fShaderPrecisionTests = functional.gles3.es3fShaderPrecisionTests; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + var tcuFloat = framework.common.tcuFloat; + var tcuTestCase = framework.common.tcuTestCase; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluShaderProgram = framework.opengl.gluShaderProgram; + + /** @const {number} */ es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH = 32; + /** @const {number} */ es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT = 32; + + es3fShaderPrecisionTests.add = function(a, b) { return a + b; }; + es3fShaderPrecisionTests.sub = function(a, b) { return a - b; }; + es3fShaderPrecisionTests.mul = function(a, b) { return a * b; }; + // a * b = (a1 * 2^16 + a0) * (b1 * 2^16 + b0) = a1 * b1 * 2^32 + (a0 * b1 + a1 * b0) * 2^16 + a0 * b0 + // 32bit integer multiplication may overflow in JavaScript. Only return low 32bit of the result. + es3fShaderPrecisionTests.mul32 = function(a, b) { + var sign = Math.sign(a) * Math.sign(b); + a = Math.abs(a); + b = Math.abs(b); + var a1 = deMath.split16(a)[1]; + var a0 = deMath.split16(a)[0]; + var b1 = deMath.split16(b)[1]; + var b0 = deMath.split16(b)[0]; + return sign * ((a0 * b1 + a1 * b0) * 0x10000 + a0 * b0); + } + es3fShaderPrecisionTests.div = function(a, b) { if (b !== 0) return a / b; else throw new Error('division by zero.')}; + + /** + * @param {gluShaderUtil.precision} precision + * @param {string} evalOp + * @param {boolean} isVertexCase + * @return {gluShaderProgram.ShaderProgram} + */ + es3fShaderPrecisionTests.createFloatPrecisionEvalProgram = function(precision, evalOp, isVertexCase) { + /** @type {gluShaderUtil.DataType} */ var type = gluShaderUtil.DataType.FLOAT; + /** @type {gluShaderUtil.DataType} */ var outType = gluShaderUtil.DataType.UINT; + /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(type); + /** @type {string} */ var outTypeName = gluShaderUtil.getDataTypeName(outType); + /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(precision); + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vtx += '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in ' + precName + ' ' + typeName + ' a_in0;\n' + + 'in ' + precName + ' ' + typeName + ' a_in1;\n'; + frag += '#version 300 es\n' + + 'layout(location = 0) out highp ' + outTypeName + ' o_out;\n'; + + if (isVertexCase) { + vtx += 'flat out ' + precName + ' ' + typeName + ' v_out;\n'; + frag += 'flat in ' + precName + ' ' + typeName + ' v_out;\n'; + } else { + vtx += 'flat out ' + precName + ' ' + typeName + ' v_in0;\n' + + 'flat out ' + precName + ' ' + typeName + ' v_in1;\n'; + frag += 'flat in ' + precName + ' ' + typeName + ' v_in0;\n' + + 'flat in ' + precName + ' ' + typeName + ' v_in1;\n'; + } + + vtx += '\nvoid main (void)\n{\n' + + ' gl_Position = a_position;\n'; + frag += '\nvoid main (void)\n{\n'; + + op += '\t' + precName + ' ' + typeName + ' in0 = ' + (isVertexCase ? 'a_' : 'v_') + 'in0;\n' + + '\t' + precName + ' ' + typeName + ' in1 = ' + (isVertexCase ? 'a_' : 'v_') + 'in1;\n'; + + if (!isVertexCase) + op += '\t' + precName + ' ' + typeName + ' res;\n'; + + op += '\t' + (isVertexCase ? 'v_out' : 'res') + ' = ' + evalOp + ';\n'; + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + if (isVertexCase) { + frag += ' o_out = floatBitsToUint(v_out);\n'; + } else { + vtx += ' v_in0 = a_in0;\n' + + ' v_in1 = a_in1;\n'; + frag += ' o_out = floatBitsToUint(res);\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + return new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, frag)); + }; + + /** + * @param {gluShaderUtil.DataType} type + * @param {gluShaderUtil.precision} precision + * @param {string} evalOp + * @param {boolean} isVertexCase + * @return {gluShaderProgram.ShaderProgram} + */ + es3fShaderPrecisionTests.createIntUintPrecisionEvalProgram = function(type, precision, evalOp, isVertexCase) { + /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(type); + /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(precision); + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vtx += '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in ' + precName + ' ' + typeName + ' a_in0;\n' + + 'in ' + precName + ' ' + typeName + ' a_in1;\n'; + frag += '#version 300 es\n' + + 'layout(location = 0) out ' + precName + ' ' + typeName + ' o_out;\n'; + + if (isVertexCase) { + vtx += 'flat out ' + precName + ' ' + typeName + ' v_out;\n'; + frag += 'flat in ' + precName + ' ' + typeName + ' v_out;\n'; + } else { + vtx += 'flat out ' + precName + ' ' + typeName + ' v_in0;\n' + + 'flat out ' + precName + ' ' + typeName + ' v_in1;\n'; + frag += 'flat in ' + precName + ' ' + typeName + ' v_in0;\n' + + 'flat in ' + precName + ' ' + typeName + ' v_in1;\n'; + } + + vtx += '\nvoid main (void)\n{\n'+ + ' gl_Position = a_position;\n'; + frag += '\nvoid main (void)\n{\n'; + + op += '\t' + precName + ' ' + typeName + ' in0 = ' + (isVertexCase ? 'a_' : 'v_') + 'in0;\n' + + '\t' + precName + ' ' + typeName + ' in1 = ' + (isVertexCase ? 'a_' : 'v_') + 'in1;\n'; + + op += '\t' + (isVertexCase ? 'v_' : 'o_') + 'out = ' + evalOp + ';\n'; + + vtx += isVertexCase ? op : ''; + frag += isVertexCase ? '' : op; + op = ''; + + if (isVertexCase) { + frag += ' o_out = v_out;\n'; + } else { + vtx += ' v_in0 = a_in0;\n' + + ' v_in1 = a_in1;\n'; + } + + vtx += '}\n'; + frag += '}\n'; + + return new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, frag)); + }; + + /** @typedef {function(number, number)} */ es3fShaderPrecisionTests.EvalFunc; + + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {string} op + * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc + * @param {gluShaderUtil.precision} precision + * @param {Array} rangeA + * @param {Array} rangeB + * @param {boolean} isVertexCase + */ + es3fShaderPrecisionTests.ShaderFloatPrecisionCase = function(name, desc, op, evalFunc, precision, rangeA, rangeB, isVertexCase) { + tcuTestCase.DeqpTest.call(this, name, desc); + // Case parameters. + /** @type {string} */ this.m_op = op; + /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.m_evalFunc = evalFunc; + /** @type {gluShaderUtil.precision} */ this.m_precision = precision; + /** @type {Array} */ this.m_rangeA = rangeA; + /** @type {Array} */ this.m_rangeB = rangeB; + /** @type {boolean} */ this.m_isVertexCase = isVertexCase; + + /** @type {number} */ this.m_numTestsPerIter = 32; + /** @type {number} */ this.m_numIters = 4; + /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name)); + + // Iteration state. + /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {?WebGLFramebuffer} */ this.m_framebuffer = null; + /** @type {?WebGLRenderbuffer} */ this.m_renderbuffer = null; + /** @type {number} */ this.m_iterNdx = 0; + /** @type {Array} */ this.m_iterPass = []; + }; + + es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.constructor = es3fShaderPrecisionTests.ShaderFloatPrecisionCase; + + es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.init = function() { + assertMsgOptions(!this.m_program && !this.m_framebuffer && !this.m_renderbuffer, 'Program/Framebuffer/Renderbuffer should be null at this point.', false, true); + + // Create program. + this.m_program = es3fShaderPrecisionTests.createFloatPrecisionEvalProgram(this.m_precision, this.m_op, this.m_isVertexCase); + + if (!this.m_program.isOk()) + assertMsgOptions(false, 'Compile failed', false, true); + + // Create framebuffer. + this.m_framebuffer = gl.createFramebuffer(); + this.m_renderbuffer = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.R32UI, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT); + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_renderbuffer); + + assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + this.m_iterNdx = 0; + }; + + es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.deinit = function() { + if(this.m_framebuffer) + gl.deleteFramebuffer(this.m_framebuffer); + if(this.m_renderbuffer) + gl.deleteRenderbuffer(this.m_renderbuffer); + this.m_program = null; + this.m_framebuffer = null; + this.m_renderbuffer = null; + }; + + /** + * @param {number} in0 + * @param {number} in1 + * @param {number} reference + * @param {number} result + */ + + es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.compare = function(in0, in1, reference, result) { + // Comparison is done using 64-bit reference value to accurately evaluate rounding mode error. + // If 32-bit reference value is used, 2 bits of rounding error must be allowed. + + // For mediump and lowp types the comparison currently allows 3 bits of rounding error: + // two bits from conversions and one from actual operation. + + // \todo [2013-09-30 pyry] Make this more strict: determine if rounding can actually happen. + + /** @type {number} */ var mantissaBits = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 23 : 10; + /** @type {number} */ var numPrecBits = 52 - mantissaBits; + + /** @type {number} */ var in0Exp = tcuFloat.newFloat32(in0).exponent(); + /** @type {number} */ var in1Exp = tcuFloat.newFloat32(in1).exponent(); + /** @type {number} */ var resExp = tcuFloat.newFloat32(result).exponent(); + /** @type {number} */ var numLostBits = Math.max(in0Exp - resExp, in1Exp - resExp, 0); // Lost due to mantissa shift. + + /** @type {number} */ var roundingUlpError = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 1 : 3; + /** @type {number} */ var maskBits = numLostBits + numPrecBits; + + bufferedLogToConsole("Assuming " + mantissaBits + " mantissa bits, " + numLostBits + " bits lost in operation, and " + roundingUlpError + " ULP rounding error.") + + /** @type {number} */ var refBits = tcuFloat.newFloat64(reference).bits(); + /** @type {number} */ var resBits = tcuFloat.newFloat64(result).bits(); + /** @type {number} */ var accurateRefBits = deMath.shiftRight(refBits, maskBits); + /** @type {number} */ var accurateResBits = deMath.shiftRight(resBits, maskBits); + /** @type {number} */ var ulpDiff = Math.abs(accurateRefBits - accurateResBits); + + if (ulpDiff > roundingUlpError) { + bufferedLogToConsole("ERROR: comparison failed! ULP diff (ignoring lost/undefined bits) = " + ulpDiff ); + return false; + } + else + return true; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.iterate = function() { + var testPassed = true; + var testPassedMsg = 'Pass'; + + // Constant data. + /** @type {Array} */ var position =[ + -1.0, -1.0, 0.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0 + ]; + + /** @type {Array} */ var indices = [0, 1, 2, 2, 1, 3]; + /** @type {number} */ var numVertices = 4; + /** @type {Array} */ var in0Arr = [0.0, 0.0, 0.0, 0.0]; + /** @type {Array} */ var in1Arr = [0.0, 0.0, 0.0, 0.0]; + + /** @type {Array} */ var vertexArrays = []; + + // Image read from GL. + /** @type {goog.TypedArray} */ var pixels_uint = new Uint32Array(es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH * es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT * 4); + + // \todo [2012-05-03 pyry] Could be cached. + /** @type {WebGLProgram} */ var prog = this.m_program.getProgram(); + + gl.useProgram(prog); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + + vertexArrays[0] = gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numVertices, 0, position); + + + // Compute values and reference. + for (var testNdx = 0; testNdx < this.m_numTestsPerIter; testNdx++) { + /** @type {number} */ var in0 = this.m_rnd.getFloat(this.m_rangeA[0], this.m_rangeA[1]); + /** @type {number} */ var in1 = this.m_rnd.getFloat(this.m_rangeB[0], this.m_rangeB[1]); + + /** @type {number} */ var refD = this.m_evalFunc(in0, in1); + + bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + ": "+ + "in0 = " + in0 + " / " + tcuFloat.newFloat32(in0).bits() + + ", in1 = " + in1 + " / " + tcuFloat.newFloat32(in1).bits() + + " reference = " + refD + " / " + tcuFloat.newFloat32(refD).bits()); + + in0Arr = [in0, in0, in0, in0]; + in1Arr = [in1, in1, in1, in1]; + vertexArrays[1] = gluDrawUtil.newFloatVertexArrayBinding("a_in0", 1, numVertices, 0, in0Arr); + vertexArrays[2] = gluDrawUtil.newFloatVertexArrayBinding("a_in1", 1, numVertices, 0, in1Arr); + + gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices)); + + gl.readPixels(0, 0, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, + es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT, gl.RGBA_INTEGER, gl.UNSIGNED_INT, pixels_uint); + + var pixels = new Float32Array(pixels_uint.buffer); + bufferedLogToConsole(" result = " + pixels[0] + " / " + tcuFloat.newFloat32(pixels[0]).bits()); + + // Verify results + /** @type {boolean} */ var firstPixelOk = this.compare(in0, in1, refD, pixels[0]); + + if (firstPixelOk) { + // Check that rest of pixels match to first one. + /** @type {number} */ var firstPixelBits = tcuFloat.newFloat32(pixels[0]).bits(); + /** @type {boolean} */ var allPixelsOk = true; + + for (var y = 0; y < es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT; y++) { + for (var x = 0; x < es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH; x++) { + /** @type {number} */ var pixelBits = tcuFloat.newFloat32(pixels[(y * es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH + x) * 4]).bits(); + + if (pixelBits != firstPixelBits) { + bufferedLogToConsole("ERROR: Inconsistent results, got " + pixelBits + " at (" + x + ", " + y + ")") + allPixelsOk = false; + } + } + + if (!allPixelsOk) + break; + } + + if (!allPixelsOk){ + bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + "Inconsistent values in framebuffer"); + testPassed = false; + testPassedMsg = 'Inconsistent values in framebuffer'; + } + } + else{ + bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + "Result comparison failed"); + testPassed = false; + testPassedMsg = 'Result comparison failed' + } + } + + // [dag] Aggregating test results to make the test less verbose. + this.m_iterPass[this.m_iterNdx] = testPassed; + + // [dag] Show test results after the last iteration is done. + if (this.m_iterPass.length === this.m_numIters) { + if (!deMath.boolAll(this.m_iterPass)) + testFailedOptions(testPassedMsg, false); + else + testPassedOptions(testPassedMsg, true); + } + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + this.m_iterNdx += 1; + return (this.m_iterNdx < this.m_numIters) ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {string} op + * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc + * @param {gluShaderUtil.precision} precision + * @param {number} bits + * @param {Array} rangeA + * @param {Array} rangeB + * @param {boolean} isVertexCase + */ + es3fShaderPrecisionTests.ShaderIntPrecisionCase = function(name, desc, op, evalFunc, precision, bits, rangeA, rangeB, isVertexCase) { + tcuTestCase.DeqpTest.call(this, name, desc); + // Case parameters. + /** @type {string} */ this.m_op = op; + /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.m_evalFunc = evalFunc; + /** @type {gluShaderUtil.precision} */ this.m_precision = precision; + /** @type {number} */ this.m_bits = bits; + /** @type {Array} */ this.m_rangeA = rangeA; + /** @type {Array} */ this.m_rangeB = rangeB; + /** @type {boolean} */ this.m_isVertexCase = isVertexCase; + + /** @type {number} */ this.m_numTestsPerIter = 32; + /** @type {number} */ this.m_numIters = 4; + /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name)); + + // Iteration state. + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {WebGLFramebuffer} */ this.m_framebuffer = null; + /** @type {WebGLRenderbuffer} */ this.m_renderbuffer = null; + /** @type {number} */ this.m_iterNdx = 0; + }; + + es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.constructor = es3fShaderPrecisionTests.ShaderIntPrecisionCase; + + es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.init = function() { + assertMsgOptions(!this.m_program && !this.m_framebuffer && !this.m_renderbuffer, 'Program/Framebuffer/Renderbuffer should be null at this point.', false, true); + // Create program. + this.m_program = es3fShaderPrecisionTests.createIntUintPrecisionEvalProgram(gluShaderUtil.DataType.INT, this.m_precision, this.m_op, this.m_isVertexCase); + + if (!this.m_program.isOk()) + assertMsgOptions(false, 'Compile failed', false, true); + + // Create framebuffer. + this.m_framebuffer = gl.createFramebuffer(); + this.m_renderbuffer = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.R32I, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT); + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_renderbuffer); + + assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + this.m_iterNdx = 0; + + bufferedLogToConsole("Number of accurate bits assumed = " + this.m_bits); + }; + + es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.deinit = function() { + if(this.m_framebuffer) + gl.deleteFramebuffer(this.m_framebuffer); + if(this.m_renderbuffer) + gl.deleteRenderbuffer(this.m_renderbuffer); + this.m_program = null; + this.m_framebuffer = null; + this.m_renderbuffer = null; + }; + + /** + * @param {number} value + * @param {number} bits + * @return {number} + */ + + es3fShaderPrecisionTests.extendTo32Bit = function(value, bits) { + return (value & ((1 << (bits - 1)) - 1)) | ((value & (1 << (bits - 1))) << (32 - bits)) >> (32 - bits); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.iterate = function() { + var testPassed = true; + var testPassedMsg = 'Pass'; + // Constant data. + /** @type {Array} */ var position = [ + -1.0, -1.0, 0.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0 + ] + /** @type {Array} */ var indices = [0, 1, 2, 2, 1, 3]; + + /** @type {number} */ var numVertices = 4; + /** @type {Array} */ var in0Arr = [0, 0, 0, 0]; + /** @type {Array} */ var in1Arr = [0, 0, 0, 0]; + + /** @type {number} */ var mask = this.m_bits === 32 ? 0xffffffff : ((1 << this.m_bits) - 1); + /** @type {goog.TypedArray} */ var pixels = new Int32Array(es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH * es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT * 4); + /** @type {Array} */ var vertexArrays = []; + + /** @type {WebGLProgram} */ var prog = this.m_program.getProgram(); + + // \todo [2012-05-03 pyry] A bit hacky. getInt() should work fine with ranges like this. + /** @type {boolean} */ var isMaxRangeA = this.m_rangeA[0] === 0x80000000 && this.m_rangeA[1] === 0x7fffffff; + /** @type {boolean} */ var isMaxRangeB = this.m_rangeB[0] === 0x80000000 && this.m_rangeB[1] === 0x7fffffff; + + gl.useProgram(prog); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + + vertexArrays[0] = gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numVertices, 0, position); + + // Compute values and reference. + for (var testNdx = 0; testNdx < this.m_numTestsPerIter; testNdx++) { + /** @type {number} */ var in0 = this.m_rnd.getInt(this.m_rangeA[0], this.m_rangeA[1]); //es3fShaderPrecisionTests.extendTo32Bit(((isMaxRangeA ? Math.abs(this.m_rnd.getInt()) : this.m_rnd.getInt(this.m_rangeA[0], this.m_rangeA[1])) & mask), this.m_bits); + /** @type {number} */ var in1 = this.m_rnd.getInt(this.m_rangeB[0], this.m_rangeB[1]); //es3fShaderPrecisionTests.extendTo32Bit(((isMaxRangeB ? Math.abs(this.m_rnd.getInt()) : this.m_rnd.getInt(this.m_rangeB[0], this.m_rangeB[1])) & mask), this.m_bits); + /** @type {number} */ var refMasked = this.m_evalFunc(in0, in1) & mask; + /** @type {number} */ var refOut = es3fShaderPrecisionTests.extendTo32Bit(refMasked, this.m_bits); + + bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + ": " + + "in0 = " + in0 + ", in1 = " + in1 + ", ref out = " + refOut + " / " + refMasked); + + in0Arr = [in0, in0, in0, in0]; + in1Arr = [in1, in1, in1, in1]; + + vertexArrays[1] = gluDrawUtil.newInt32VertexArrayBinding("a_in0", 1, numVertices, 0, in0Arr); + vertexArrays[2] = gluDrawUtil.newInt32VertexArrayBinding("a_in1", 1, numVertices, 0, in1Arr); + + gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices)); + + gl.readPixels(0, 0, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, + es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT, + gl.RGBA_INTEGER, gl.INT, pixels); + + // Compare pixels. + for (var y = 0; y < es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT; y++) { + for (var x = 0; x < es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH; x++) { + /** @type {number} */ var cmpOut = pixels[(y * es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH + x) * 4]; + /** @type {number} */ var cmpMasked = cmpOut & mask; + + if (cmpMasked != refMasked) { + bufferedLogToConsole("Comparison failed (at " + x + ", " + y + "): " + + + "got " + cmpOut + " / " + cmpOut); + testPassed = false; + testPassedMsg = 'Comparison failed'; + } + } + } + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + this.m_iterNdx += 1; + if (!testPassed) { + testFailedOptions(testPassedMsg, false); + return tcuTestCase.IterateResult.STOP; + } else if (testPassed && this.m_iterNdx < this.m_numIters) { + return tcuTestCase.IterateResult.CONTINUE; + } else { + testPassedOptions(testPassedMsg, true); + return tcuTestCase.IterateResult.STOP; + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {string} op + * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc + * @param {gluShaderUtil.precision} precision + * @param {number} bits + * @param {Array} rangeA + * @param {Array} rangeB + * @param {boolean} isVertexCase + */ + es3fShaderPrecisionTests.ShaderUintPrecisionCase = function(name, desc, op, evalFunc, precision, bits, rangeA, rangeB, isVertexCase) { + tcuTestCase.DeqpTest.call(this, name, desc); + // Case parameters. + /** @type {string} */ this.m_op = op; + /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.m_evalFunc = evalFunc; + /** @type {gluShaderUtil.precision} */ this.m_precision = precision; + /** @type {number} */ this.m_bits = bits; + /** @type {Array} */ this.m_rangeA = rangeA; + /** @type {Array} */ this.m_rangeB = rangeB; + /** @type {boolean} */ this.m_isVertexCase = isVertexCase; + + /** @type {number} */ this.m_numTestsPerIter = 32; + /** @type {number} */ this.m_numIters = 4; + /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name)); + + // Iteration state. + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {WebGLFramebuffer} */ this.m_framebuffer = null; + /** @type {WebGLRenderbuffer} */ this.m_renderbuffer = null; + /** @type {number} */ this.m_iterNdx = 0; + }; + + es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.constructor = es3fShaderPrecisionTests.ShaderUintPrecisionCase; + + es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.init = function() { + assertMsgOptions(!this.m_program && !this.m_framebuffer && !this.m_renderbuffer, 'Program/Framebuffer/Renderbuffer should be null at this point.', false, true); + // Create program. + this.m_program = es3fShaderPrecisionTests.createIntUintPrecisionEvalProgram(gluShaderUtil.DataType.UINT, this.m_precision, this.m_op, this.m_isVertexCase); + + if (!this.m_program.isOk()) + assertMsgOptions(false, 'Compile failed', false, true); + + // Create framebuffer. + this.m_framebuffer = gl.createFramebuffer(); + this.m_renderbuffer = gl.createRenderbuffer(); + + gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.R32UI, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT); + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_renderbuffer); + + assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + this.m_iterNdx = 0; + + bufferedLogToConsole("Number of accurate bits assumed = " + this.m_bits); + }; + + es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.deinit = function() { + if(this.m_framebuffer) + gl.deleteFramebuffer(this.m_framebuffer); + if(this.m_renderbuffer) + gl.deleteRenderbuffer(this.m_renderbuffer); + this.m_program = null; + this.m_framebuffer = null; + this.m_renderbuffer = null; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.iterate = function() { + var testPassed = true; + var testPassedMsg = 'Pass'; + + // Constant data. + /** @type {Array} */ var position = [ + -1.0, -1.0, 0.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0 + ]; + /** @type {Array} */ var indices = [0, 1, 2, 2, 1, 3]; + + /** @type {number} */ var numVertices = 4; + /** @type {Array} */ var in0Arr = [0, 0, 0, 0]; + /** @type {Array} */ var in1Arr = [0, 0, 0, 0]; + + /** @type {number} */ var mask = this.m_bits === 32 ? 0xffffffff : ((1 << this.m_bits) - 1); + /** @type {goog.TypedArray} */ var pixels = new Uint32Array(es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH * es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT * 4); + /** @type {Array} */ var vertexArrays = []; + + /** @type {WebGLProgram} */ var prog = this.m_program.getProgram(); + + // \todo [2012-05-03 pyry] A bit hacky. + /** @type {boolean} */ var isMaxRangeA = this.m_rangeA[0] === 0 && this.m_rangeA[1] === 0xffffffff; + /** @type {boolean} */ var isMaxRangeB = this.m_rangeB[0] === 0 && this.m_rangeB[1] === 0xffffffff; + + gl.useProgram(prog); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer); + + vertexArrays[0] = gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numVertices, 0, position); + + // Compute values and reference. + for (var testNdx = 0; testNdx < this.m_numTestsPerIter; testNdx++) { + /** @type {number} */ var in0 = (isMaxRangeA ? Math.abs(this.m_rnd.getInt()) : (this.m_rangeA[0] + Math.abs(this.m_rnd.getInt()) % (this.m_rangeA[1] - this.m_rangeA[0] + 1))) & mask; + /** @type {number} */ var in1 = (isMaxRangeB ? Math.abs(this.m_rnd.getInt()) : (this.m_rangeB[0] + Math.abs(this.m_rnd.getInt()) % (this.m_rangeB[1] - this.m_rangeB[0] + 1))) & mask; + /** @type {number} */ var refOut = this.m_evalFunc(in0, in1) & mask; + + bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + ": " + + + "in0 = " + in0 + ", in1 = " + in1 + ", ref out = " + refOut) + + in0Arr = [in0, in0, in0, in0]; + in1Arr = [in1, in1, in1, in1]; + vertexArrays[1] = gluDrawUtil.newUint32VertexArrayBinding("a_in0", 1, numVertices, 0, in0Arr); + vertexArrays[2] = gluDrawUtil.newUint32VertexArrayBinding("a_in1", 1, numVertices, 0, in1Arr); + + gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices)); + + gl.readPixels(0, 0, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, + es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT, gl.RGBA_INTEGER, gl.UNSIGNED_INT, pixels); + + // Compare pixels. + for (var y = 0; y < es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT; y++) { + for (var x = 0; x < es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH; x++) { + /** @type {number} */ var cmpOut = pixels[(y*es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH + x) * 4]; + /** @type {number} */ var cmpMasked = cmpOut & mask; + + if (cmpMasked != refOut) { + bufferedLogToConsole("Comparison failed (at " + x + ", " + y + "): " + "got " + cmpOut) + testPassed = false; + testPassedMsg = 'Comparison failed'; + } + } + } + } + + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + this.m_iterNdx += 1; + if (!testPassed) { + testFailedOptions(testPassedMsg, false); + return tcuTestCase.IterateResult.STOP; + } else if (testPassed && this.m_iterNdx < this.m_numIters) { + return tcuTestCase.IterateResult.CONTINUE; + } else { + testPassedOptions(testPassedMsg, true); + return tcuTestCase.IterateResult.STOP; + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderPrecisionTests.ShaderPrecisionTests = function() { + tcuTestCase.DeqpTest.call(this, 'precision', 'Shader precision requirements validation tests'); + }; + + es3fShaderPrecisionTests.ShaderPrecisionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderPrecisionTests.ShaderPrecisionTests.prototype.constructor = es3fShaderPrecisionTests.ShaderPrecisionTests; + + es3fShaderPrecisionTests.ShaderPrecisionTests.prototype.init = function() { + var testGroup = tcuTestCase.runner.testCases; + // Exp = Emax-2, Mantissa = 0 + // /** @type {number} */ var minF32 = tcuFloat.newFloat32((1 << 31) | (0xfd << 23) | 0x0).getValue(); + // /** @type {number} */ var maxF32 = tcuFloat.newFloat32((0 << 31) | (0xfd << 23) | 0x0).getValue(); + // [dag] Workaround for float32 numbers + /** @type {number} */ var minF32 = new Float32Array(new Uint32Array([1<<31|0xfd<<23|0x0]).buffer)[0]; + /** @type {number} */ var maxF32 = new Float32Array(new Uint32Array([0<<31|0xfd<<23|0x0]).buffer)[0]; + + // /** @type {number} */ var minF16 = tcuFloat.newFloat16(((1 << 15) | (0x1d << 10) | 0x0)).getValue(); + // /** @type {number} */ var maxF16 = tcuFloat.newFloat16(((0 << 15) | (0x1d << 10) | 0x0)).getValue(); + /** @type {number} */ var minF16 = -16384; //-1 << 14; // 1 << 15 | 0x1d | 0x0 == 0b1111010000000000; -1 * (2**(29-15)) * 1 + /** @type {number} */ var maxF16 = 16384; //1 << 14; // 0 << 15 | 0x1d | 0x0 == 0b0111010000000000; +1 * (2**(29-15)) * 1 + + /** @type {Array} */ var fullRange32F = [minF32, maxF32]; + /** @type {Array} */ var fullRange16F = [minF16, maxF16]; + /** @type {Array} */ var fullRange32I = [-2147483648, 2147483647]; // [0x80000000|0, 0x7fffffff|0]; // |0 to force the number as a 32-bit integer + /** @type {Array} */ var fullRange16I = [minF16, maxF16 - 1]; //[-(1 << 15), (1 << 15) - 1]; // Added the negative sign to index 0 + /** @type {Array} */ var fullRange8I = [-128, 127]; //[-(1 << 7), (1 << 7) - 1]; // Added the negative sign to index 0 + /** @type {Array} */ var fullRange32U = [0, 0xffffffff]; + /** @type {Array} */ var fullRange16U = [0, 0xffff]; + /** @type {Array} */ var fullRange8U = [0, 0xff]; + + // \note Right now it is not programmatically verified that the results shouldn't end up being inf/nan but + // actual values used are ok. + + /** + * @constructor + * @struct + * @param {string} name + * @param {string} op + * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc + * @param {gluShaderUtil.precision} precision + * @param {Array} rangeA + * @param {Array} rangeB + */ + var FloatCase = function(name, op, evalFunc, precision, rangeA, rangeB) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.op = op; + /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.evalFunc = evalFunc; + /** @type {gluShaderUtil.precision} */ this.precision = precision; + /** @type {Array} */ this.rangeA = rangeA; + /** @type {Array} */ this.rangeB = rangeB; + }; + + /** @type {Array} */ var floatCases = [ + new FloatCase('highp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_HIGHP, fullRange32F, fullRange32F), + new FloatCase('highp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_HIGHP, fullRange32F, fullRange32F), + new FloatCase('highp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_HIGHP, [-1e5, 1e5], [-1e5, 1e5]), + new FloatCase('highp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_HIGHP, [-1e5, 1e5], [-1e5, 1e5]), + new FloatCase('mediump_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_MEDIUMP, fullRange16F, fullRange16F), + new FloatCase('mediump_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_MEDIUMP, fullRange16F, fullRange16F), + new FloatCase('mediump_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_MEDIUMP, [-1e2, 1e2], [-1e2, 1e2]), + new FloatCase('mediump_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_MEDIUMP, [-1e2, 1e2], [-1e2, 1e2]) + ]; + + /** + * @constructor + * @struct + * @param {string} name + * @param {string} op + * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc + * @param {gluShaderUtil.precision} precision + * @param {number} bits + * @param {Array} rangeA + * @param {Array} rangeB + */ + var IntCase = function(name, op, evalFunc, precision, bits, rangeA, rangeB) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.op = op; + /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.evalFunc = evalFunc; + /** @type {gluShaderUtil.precision} */ this.precision = precision; + /** @type {number} */ this.bits = bits; + /** @type {Array} */ this.rangeA = rangeA; + /** @type {Array} */ this.rangeB = rangeB; + }; + + /** @type {Array} */ var intCases = [ + new IntCase('highp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, fullRange32I), + new IntCase('highp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, fullRange32I), + new IntCase('highp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul32, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, fullRange32I), + new IntCase('highp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, [-10000, -1]), + new IntCase('mediump_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, fullRange16I), + new IntCase('mediump_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, fullRange16I), + new IntCase('mediump_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, fullRange16I), + new IntCase('mediump_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, [1, 1000]), + new IntCase('lowp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, fullRange8I), + new IntCase('lowp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, fullRange8I), + new IntCase('lowp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, fullRange8I), + new IntCase('lowp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, [-50, -1]) + ]; + + /** + * @constructor + * @struct + * @param {string} name + * @param {string} op + * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc + * @param {gluShaderUtil.precision} precision + * @param {number} bits + * @param {Array} rangeA + * @param {Array} rangeB + */ + var UintCase = function(name, op, evalFunc, precision, bits, rangeA, rangeB) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.op = op; + /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.evalFunc = evalFunc; + /** @type {gluShaderUtil.precision} */ this.precision = precision; + /** @type {number} */ this.bits = bits; + /** @type {Array} */ this.rangeA = rangeA; + /** @type {Array} */ this.rangeB = rangeB; + }; + + /** @type {Array} */ var uintCases = [ + new UintCase('highp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, fullRange32U), + new UintCase('highp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, fullRange32U), + new UintCase('highp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul32, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, fullRange32U), + new UintCase('highp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, [1, 10000]), + new UintCase('mediump_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, fullRange16U), + new UintCase('mediump_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, fullRange16U), + new UintCase('mediump_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, fullRange16U), + new UintCase('mediump_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, [1, 1000]), + new UintCase('lowp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, fullRange8U), + new UintCase('lowp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, fullRange8U), + new UintCase('lowp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, fullRange8U), + new UintCase('lowp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, [1, 50]) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var floatGroup = tcuTestCase.newTest('float', 'Floating-point precision tests'); + testGroup.addChild(floatGroup); + for (var ndx = 0; ndx < floatCases.length; ndx++) { + floatGroup.addChild(new es3fShaderPrecisionTests.ShaderFloatPrecisionCase( + floatCases[ndx].name + '_vertex', '', floatCases[ndx].op, floatCases[ndx].evalFunc, + floatCases[ndx].precision, floatCases[ndx].rangeA, floatCases[ndx].rangeB, true)); + floatGroup.addChild(new es3fShaderPrecisionTests.ShaderFloatPrecisionCase( + floatCases[ndx].name + '_fragment', '', floatCases[ndx].op, floatCases[ndx].evalFunc, + floatCases[ndx].precision, floatCases[ndx].rangeA, floatCases[ndx].rangeB, false)); + } + + /** @type {tcuTestCase.DeqpTest} */ var intGroup = tcuTestCase.newTest('int', 'Integer precision tests'); + testGroup.addChild(intGroup); + for (var ndx = 0; ndx < intCases.length; ndx++) { + intGroup.addChild(new es3fShaderPrecisionTests.ShaderIntPrecisionCase( + intCases[ndx].name + '_vertex', '', intCases[ndx].op, intCases[ndx].evalFunc, + intCases[ndx].precision, intCases[ndx].bits, intCases[ndx].rangeA, intCases[ndx].rangeB, true)); + intGroup.addChild(new es3fShaderPrecisionTests.ShaderIntPrecisionCase( + intCases[ndx].name + '_fragment', '', intCases[ndx].op, intCases[ndx].evalFunc, + intCases[ndx].precision, intCases[ndx].bits, intCases[ndx].rangeA, intCases[ndx].rangeB, false)); + } + + /** @type {tcuTestCase.DeqpTest} */ var uintGroup = tcuTestCase.newTest('uint', 'Unsigned integer precision tests'); + testGroup.addChild(uintGroup); + for (var ndx = 0; ndx < uintCases.length; ndx++) { + uintGroup.addChild(new es3fShaderPrecisionTests.ShaderUintPrecisionCase( + uintCases[ndx].name + '_vertex', '', uintCases[ndx].op, uintCases[ndx].evalFunc, + uintCases[ndx].precision, uintCases[ndx].bits, uintCases[ndx].rangeA, uintCases[ndx].rangeB, true)); + uintGroup.addChild(new es3fShaderPrecisionTests.ShaderUintPrecisionCase( + uintCases[ndx].name + '_fragment', '', uintCases[ndx].op, uintCases[ndx].evalFunc, + uintCases[ndx].precision, uintCases[ndx].bits, uintCases[ndx].rangeA, uintCases[ndx].rangeB, false)); + } + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderPrecisionTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderPrecisionTests.ShaderPrecisionTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderPrecisionTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js new file mode 100644 index 000000000..1a2859f24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js @@ -0,0 +1,2205 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderStateQueryTests'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { +var es3fShaderStateQueryTests = functional.gles3.es3fShaderStateQueryTests; +var tcuTestCase = framework.common.tcuTestCase; +var glsStateQuery = modules.shared.glsStateQuery; +var es3fApiCase = functional.gles3.es3fApiCase; +var deRandom = framework.delibs.debase.deRandom; +var tcuMatrix = framework.common.tcuMatrix; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +var commonTestVertSource = '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; +var commonTestFragSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + +var brokenShader = '#version 300 es\n' + + 'broken, this should not compile!\n' + + '\n'; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ShaderTypeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ShaderTypeCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ShaderTypeCase.prototype.test = function() { + var shaderTypes = [gl.VERTEX_SHADER, gl.FRAGMENT_SHADER]; + for (var ndx = 0; ndx < shaderTypes.length; ++ndx) { + var shader = gl.createShader(shaderTypes[ndx]); + var result = glsStateQuery.verifyShader(shader, gl.SHADER_TYPE, shaderTypes[ndx]); + this.check(result, 'Incorrect shader type'); + gl.deleteShader(shader); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ShaderCompileStatusCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ShaderCompileStatusCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ShaderCompileStatusCase.prototype.test = function() { + var result; + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + result = glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, false); + this.check(result, 'Vertex shader compilation status should be false'); + result = glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, false); + this.check(result, 'Fragment shader compilation status should be false'); + + gl.shaderSource(shaderVert, commonTestVertSource); + gl.shaderSource(shaderFrag, commonTestFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + result = glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true); + this.check(result, 'Vertex shader compilation status should be true'); + result = glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true); + this.check(result, 'Fragment shader compilation status should be true'); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ShaderInfoLogCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ShaderInfoLogCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ShaderInfoLogCase.prototype.test = function() { + var shader = gl.createShader(gl.VERTEX_SHADER); + var log = gl.getShaderInfoLog(shader); + this.check(log === ''); + + gl.shaderSource(shader, brokenShader); + gl.compileShader(shader); + + log = gl.getShaderInfoLog(shader); + this.check(log === null || typeof log === 'string'); + + gl.deleteShader(shader); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ShaderSourceCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ShaderSourceCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ShaderSourceCase.prototype.test = function() { + var shader = gl.createShader(gl.VERTEX_SHADER); + this.check(gl.getShaderSource(shader) === ''); + + gl.shaderSource(shader, brokenShader); + this.check(gl.getShaderSource(shader) === brokenShader); + + gl.deleteShader(shader); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.DeleteStatusCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.DeleteStatusCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.DeleteStatusCase.prototype.test = function() { + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, commonTestVertSource); + gl.shaderSource(shaderFrag, commonTestFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true)); + this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true)); + + var shaderProg = gl.createProgram(); + gl.attachShader(shaderProg, shaderVert); + gl.attachShader(shaderProg, shaderFrag); + gl.linkProgram(shaderProg); + + this.check(glsStateQuery.verifyProgram(shaderProg, gl.LINK_STATUS, true)); + + this.check(glsStateQuery.verifyShader(shaderVert, gl.DELETE_STATUS, false)); + this.check(glsStateQuery.verifyShader(shaderFrag, gl.DELETE_STATUS, false)); + this.check(glsStateQuery.verifyProgram(shaderProg, gl.DELETE_STATUS, false)); + + gl.useProgram(shaderProg); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(shaderProg); + + this.check(glsStateQuery.verifyShader(shaderVert, gl.DELETE_STATUS, true)); + this.check(glsStateQuery.verifyShader(shaderFrag, gl.DELETE_STATUS, true)); + this.check(glsStateQuery.verifyProgram(shaderProg, gl.DELETE_STATUS, true)); + + gl.useProgram(null); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.CurrentVertexAttribInitialCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribInitialCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.CurrentVertexAttribInitialCase.prototype.test = function() { + var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + var initial = new Float32Array([0, 0, 0, 1]); + // initial + + for (var index = 0; index < attribute_count; ++index) { + var attrib = gl.getVertexAttrib(index, gl.CURRENT_VERTEX_ATTRIB); + this.check(glsStateQuery.compare(attrib, initial), 'Initial attrib value should be [0, 0, 0, 1]'); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.CurrentVertexAttribFloatCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribFloatCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.CurrentVertexAttribFloatCase.prototype.test = function() { + var rnd = new deRandom.Random(0xabcdef); + + var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + + // test write float/read float + + for (var index = 0; index < attribute_count; ++index) { + var x = rnd.getFloat(-64000, 64000); + var y = rnd.getFloat(-64000, 64000); + var z = rnd.getFloat(-64000, 64000); + var w = rnd.getFloat(-64000, 64000); + + gl.vertexAttrib4f(index, x, y, z, w); + this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w]))); + } + for (var index = 0; index < attribute_count; ++index) { + var x = rnd.getFloat(-64000, 64000); + var y = rnd.getFloat(-64000, 64000); + var z = rnd.getFloat(-64000, 64000); + var w = 1.0; + + gl.vertexAttrib3f(index, x, y, z); + this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w]))); + } + for (var index = 0; index < attribute_count; ++index) { + var x = rnd.getFloat(-64000, 64000); + var y = rnd.getFloat(-64000, 64000); + var z = 0.0; + var w = 1.0; + + gl.vertexAttrib2f(index, x, y); + this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w]))); + } + for (var index = 0; index < attribute_count; ++index) { + var x = rnd.getFloat(-64000, 64000); + var y = 0.0; + var z = 0.0; + var w = 1.0; + + gl.vertexAttrib1f(index, x); + this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w]))); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.CurrentVertexAttribIntCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribIntCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.CurrentVertexAttribIntCase.prototype.test = function() { + var rnd = new deRandom.Random(0xabcdef); + + var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + + // test write float/read float + + for (var index = 0; index < attribute_count; ++index) { + var x = rnd.getInt(-64000, 64000); + var y = rnd.getInt(-64000, 64000); + var z = rnd.getInt(-64000, 64000); + var w = rnd.getInt(-64000, 64000); + + gl.vertexAttribI4i(index, x, y, z, w); + this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Int32Array([x, y, z, w]))); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.CurrentVertexAttribUintCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribUintCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.CurrentVertexAttribUintCase.prototype.test = function() { + var rnd = new deRandom.Random(0xabcdef); + + var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + + // test write float/read float + + for (var index = 0; index < attribute_count; ++index) { + var x = rnd.getInt(0, 64000); + var y = rnd.getInt(0, 64000); + var z = rnd.getInt(0, 64000); + var w = rnd.getInt(0, 64000); + + gl.vertexAttribI4ui(index, x, y, z, w); + this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Uint32Array([x, y, z, w]))); + } +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ProgramInfoLogCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ProgramInfoLogCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ProgramInfoLogCase.prototype.test = function() { + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, brokenShader); + gl.compileShader(shaderVert); + gl.shaderSource(shaderFrag, brokenShader); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + + var log = gl.getProgramInfoLog(program); + this.check(log === null || typeof log === 'string'); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ProgramValidateStatusCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ProgramValidateStatusCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ProgramValidateStatusCase.prototype.test = function() { + // test validate ok + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, commonTestVertSource); + gl.shaderSource(shaderFrag, commonTestFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + + this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true)); + this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true)); + this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, true)); + + gl.validateProgram(program); + this.check(glsStateQuery.verifyProgram(program, gl.VALIDATE_STATUS, true)); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); + + // test with broken shader + shaderVert = gl.createShader(gl.VERTEX_SHADER); + shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, commonTestVertSource); + gl.shaderSource(shaderFrag, brokenShader); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + + this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true)); + this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, false)); + this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, false)); + + gl.validateProgram(program); + this.check(glsStateQuery.verifyProgram(program, gl.VALIDATE_STATUS, false)); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ProgramAttachedShadersCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ProgramAttachedShadersCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ProgramAttachedShadersCase.prototype.test = function() { + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, commonTestVertSource); + gl.shaderSource(shaderFrag, commonTestFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + // check ATTACHED_SHADERS + + var program = gl.createProgram(); + this.check(glsStateQuery.verifyProgram(program, gl.ATTACHED_SHADERS, 0)); + + gl.attachShader(program, shaderVert); + this.check(glsStateQuery.verifyProgram(program, gl.ATTACHED_SHADERS, 1)); + + gl.attachShader(program, shaderFrag); + this.check(glsStateQuery.verifyProgram(program, gl.ATTACHED_SHADERS, 2)); + + // check GetAttachedShaders + var shaders = gl.getAttachedShaders(program); + this.check(glsStateQuery.compare(shaders, [shaderVert, shaderFrag])); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ProgramActiveUniformNameCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ProgramActiveUniformNameCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ProgramActiveUniformNameCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'uniform highp float uniformNameWithLength23;\n' + + 'uniform highp vec2 uniformVec2;\n' + + 'uniform highp mat4 uniformMat4;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0) + vec4(uniformNameWithLength23) + vec4(uniformVec2.x) + vec4(uniformMat4[2][3]);\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + + this.check(glsStateQuery.verifyProgram(program, gl.ACTIVE_UNIFORMS, 3)); + + var uniformNames = [ + 'uniformNameWithLength23', + 'uniformVec2', + 'uniformMat4' + ]; + + var indices = gl.getUniformIndices(program, uniformNames); + + // check names + for (var ndx = 0; ndx < uniformNames.length; ++ndx) { + var index = indices[ndx]; + var uniform = gl.getActiveUniform(program, index); + + this.check(glsStateQuery.compare(uniform.name, uniformNames[ndx])); + } + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); + +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ProgramUniformCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ProgramUniformCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ProgramUniformCase.prototype.test = function() { + var uniformTypes = [ + ['float', '', 'highp', '', 'uniformValue', gl.FLOAT, 1, false], + ['float[2]', '', 'highp', '', 'uniformValue[1]', gl.FLOAT, 2, false], + ['vec2', '', 'highp', '', 'uniformValue.x', gl.FLOAT_VEC2, 1, false], + ['vec3', '', 'highp', '', 'uniformValue.x', gl.FLOAT_VEC3, 1, false], + ['vec4', '', 'highp', '', 'uniformValue.x', gl.FLOAT_VEC4, 1, false], + ['int', '', 'highp', '', 'float(uniformValue)', gl.INT, 1, false], + ['ivec2', '', 'highp', '', 'float(uniformValue.x)', gl.INT_VEC2, 1, false], + ['ivec3', '', 'highp', '', 'float(uniformValue.x)', gl.INT_VEC3, 1, false], + ['ivec4', '', 'highp', '', 'float(uniformValue.x)', gl.INT_VEC4, 1, false], + ['uint', '', 'highp', '', 'float(uniformValue)', gl.UNSIGNED_INT, 1, false], + ['uvec2', '', 'highp', '', 'float(uniformValue.x)', gl.UNSIGNED_INT_VEC2, 1, false], + ['uvec3', '', 'highp', '', 'float(uniformValue.x)', gl.UNSIGNED_INT_VEC3, 1, false], + ['uvec4', '', 'highp', '', 'float(uniformValue.x)', gl.UNSIGNED_INT_VEC4, 1, false], + ['bool', '', '', '', 'float(uniformValue)', gl.BOOL, 1, false], + ['bvec2', '', '', '', 'float(uniformValue.x)', gl.BOOL_VEC2, 1, false], + ['bvec3', '', '', '', 'float(uniformValue.x)', gl.BOOL_VEC3, 1, false], + ['bvec4', '', '', '', 'float(uniformValue.x)', gl.BOOL_VEC4, 1, false], + ['mat2', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT2, 1, false], + ['mat3', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT3, 1, false], + ['mat4', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT4, 1, false], + ['mat2x3', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT2x3, 1, false], + ['mat2x4', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT2x4, 1, false], + ['mat3x2', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT3x2, 1, false], + ['mat3x4', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT3x4, 1, false], + ['mat4x2', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT4x2, 1, false], + ['mat4x3', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT4x3, 1, false], + ['sampler2D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D, 1, false], + ['sampler3D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_3D, 1, false], + ['samplerCube', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_CUBE, 1, false], + ['sampler2DShadow', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D_SHADOW, 1, false], + ['sampler2DArray', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D_ARRAY, 1, false], + ['sampler2DArrayShadow', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D_ARRAY_SHADOW, 1, false], + ['samplerCubeShadow', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_CUBE_SHADOW, 1, false], + ['isampler2D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_2D, 1, false], + ['isampler3D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_3D, 1, false], + ['isamplerCube', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_CUBE, 1, false], + ['isampler2DArray', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_2D_ARRAY, 1, false], + ['usampler2D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_2D, 1, false], + ['usampler3D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_3D, 1, false], + ['usamplerCube', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_CUBE, 1, false], + ['usampler2DArray', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_2D_ARRAY, 1, false] + ]; + + var vertSource = + '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + var program = gl.createProgram(); + + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + + gl.shaderSource(shaderVert, vertSource); + gl.compileShader(shaderVert); + + for (var ndx = 0; ndx < uniformTypes.length; ++ndx) { + var declaration = uniformTypes[ndx][0]; + var postDeclaration = uniformTypes[ndx][1]; + var precision = uniformTypes[ndx][2]; + var layout = uniformTypes[ndx][3]; + var getter = uniformTypes[ndx][4]; + var type = uniformTypes[ndx][5]; + var size = uniformTypes[ndx][6]; + var isRowMajor = uniformTypes[ndx][7]; + bufferedLogToConsole('Verify type of ' + declaration + ' variable' + postDeclaration); + + // gen fragment shader + + var frag = ''; + frag += '#version 300 es\n'; + frag += layout + 'uniform ' + precision + ' ' + declaration + ' uniformValue' + postDeclaration + ';\n'; + frag += 'layout(location = 0) out mediump vec4 fragColor;\n'; + frag += 'void main (void)\n'; + frag += '{\n'; + frag += ' fragColor = vec4(' + getter + ');\n'; + frag += '}\n'; + + gl.shaderSource(shaderFrag, frag); + + // compile & link + + gl.compileShader(shaderFrag); + gl.linkProgram(program); + + // test + if (this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, true), 'Program link fail' + gl.getProgramInfoLog(program))) { + var indices = gl.getUniformIndices(program, ['uniformValue']); + var info_type = gl.getActiveUniforms(program, indices, gl.UNIFORM_TYPE)[0]; + var info_size = gl.getActiveUniforms(program, indices, gl.UNIFORM_SIZE)[0]; + var info_is_row_major = gl.getActiveUniforms(program, indices, gl.UNIFORM_IS_ROW_MAJOR)[0]; + this.check(glsStateQuery.compare(info_size, size)); + this.check(glsStateQuery.compare(info_type, type)); + this.check(glsStateQuery.compare(info_is_row_major, isRowMajor)); + } + } + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'uniform longlongUniformBlockName {highp vec2 vector2;} longlongUniformInstanceName;\n' + + 'uniform shortUniformBlockName {highp vec2 vector2;highp vec4 vector4;} shortUniformInstanceName;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = shortUniformInstanceName.vector4 + vec4(longlongUniformInstanceName.vector2.x) + vec4(shortUniformInstanceName.vector2.x);\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'uniform longlongUniformBlockName {highp vec2 vector2;} longlongUniformInstanceName;\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(longlongUniformInstanceName.vector2.y);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + + this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true)); + this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true)); + this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, true)); + + this.check(glsStateQuery.verifyProgram(program, gl.ACTIVE_UNIFORM_BLOCKS, 2)); + + var longlongUniformBlockIndex = gl.getUniformBlockIndex(program, 'longlongUniformBlockName'); + var shortUniformBlockIndex = gl.getUniformBlockIndex(program, 'shortUniformBlockName'); + + var uniformNames = [ + 'longlongUniformBlockName.vector2', + 'shortUniformBlockName.vector2', + 'shortUniformBlockName.vector4' + ]; + + // test UNIFORM_BLOCK_INDEX + + var uniformIndices = gl.getUniformIndices(program, uniformNames); + + var uniformsBlockIndices = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_BLOCK_INDEX); + this.check(uniformsBlockIndices[0] == longlongUniformBlockIndex && + uniformsBlockIndices[1] == shortUniformBlockIndex && + uniformsBlockIndices[2] == shortUniformBlockIndex, + 'Expected [' + longlongUniformBlockIndex + ", " + shortUniformBlockIndex + ", " + shortUniformBlockIndex + ']; got ' + + uniformsBlockIndices[0] + ", " + uniformsBlockIndices[1] + ", " + uniformsBlockIndices[2] + "]"); + + // test UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER & UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER + + this.check(glsStateQuery.verifyActiveUniformBlock(program, longlongUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, true)); + this.check(glsStateQuery.verifyActiveUniformBlock(program, longlongUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, true)); + this.check(glsStateQuery.verifyActiveUniformBlock(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, true)); + this.check(glsStateQuery.verifyActiveUniformBlock(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, false)); + + // test UNIFORM_BLOCK_ACTIVE_UNIFORMS + + this.check(glsStateQuery.verifyActiveUniformBlock(program, longlongUniformBlockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS, 1)); + this.check(glsStateQuery.verifyActiveUniformBlock(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS, 2)); + + // test UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES + + var shortUniformBlockIndices = gl.getActiveUniformBlockParameter(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES); + this.check(shortUniformBlockIndices.length == 2, 'Expected 2 indices; got ' + shortUniformBlockIndices.length); + + this.check(glsStateQuery.compare(shortUniformBlockIndices, new Uint32Array([uniformIndices[1], uniformIndices[2]])) || + glsStateQuery.compare(shortUniformBlockIndices, new Uint32Array([uniformIndices[2], uniformIndices[1]])), + 'Expected { ' + uniformIndices[1] +', ' + uniformIndices[2] + + '}; got {' + shortUniformBlockIndices[0] + ', ' + shortUniformBlockIndices[1] + '}'); + + // check block names + + var name = gl.getActiveUniformBlockName(program, longlongUniformBlockIndex); + this.check(name == "longlongUniformBlockName", 'Wrong uniform block name, expected longlongUniformBlockName; got ' + name); + name = gl.getActiveUniformBlockName(program, shortUniformBlockIndex) + this.check(name == "shortUniformBlockName", 'Wrong uniform block name, expected shortUniformBlockName; got ' + name); + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.TransformFeedbackCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.TransformFeedbackCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.TransformFeedbackCase.prototype.test = function() { + var transformFeedbackTestVertSource = + '#version 300 es\n' + + 'out highp vec4 tfOutput2withLongName;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + ' tfOutput2withLongName = vec4(0.0);\n' + + '}\n'; + var transformFeedbackTestFragSource = + '#version 300 es\n' + + 'layout(location = 0) out highp vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + var shaderProg = gl.createProgram(); + + this.check(glsStateQuery.verifyProgram(shaderProg, gl.TRANSFORM_FEEDBACK_BUFFER_MODE, gl.INTERLEAVED_ATTRIBS)); + + gl.shaderSource(shaderVert, transformFeedbackTestVertSource); + gl.shaderSource(shaderFrag, transformFeedbackTestFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true)); + this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true)); + + gl.attachShader(shaderProg, shaderVert); + gl.attachShader(shaderProg, shaderFrag); + + // check TRANSFORM_FEEDBACK_BUFFER_MODE + + var transform_feedback_outputs = ['gl_Position', 'tfOutput2withLongName']; + var bufferModes = [gl.SEPARATE_ATTRIBS, gl.INTERLEAVED_ATTRIBS]; + + for (var ndx = 0; ndx < bufferModes.length; ++ndx) { + gl.transformFeedbackVaryings(shaderProg, transform_feedback_outputs, bufferModes[ndx]); + gl.linkProgram(shaderProg); + + this.check(glsStateQuery.verifyProgram(shaderProg, gl.LINK_STATUS, true)); + this.check(glsStateQuery.verifyProgram(shaderProg, gl.TRANSFORM_FEEDBACK_BUFFER_MODE, bufferModes[ndx])); + } + + // check varyings + var varyings = /** @type {number} */ (gl.getProgramParameter(shaderProg, gl.TRANSFORM_FEEDBACK_VARYINGS)); + this.check(varyings === 2); + + for (var index = 0; index < varyings; ++index) { + var info = gl.getTransformFeedbackVarying(shaderProg, index); + this.check(glsStateQuery.compare(info.type, gl.FLOAT_VEC4)); + this.check(glsStateQuery.compare(info.size, 1)); + this.check(glsStateQuery.compare(info.name, transform_feedback_outputs[index])); + } + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(shaderProg); + + // TODO(kbr): this test is failing and leaving an error in the GL + // state, causing later tests to fail. Clear the error state for + // the time being. + while (gl.getError() != gl.NO_ERROR) {} +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.ActiveAttributesCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.ActiveAttributesCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.ActiveAttributesCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'in highp vec2 longInputAttributeName;\n' + + 'in highp vec2 shortName;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = longInputAttributeName.yxxy + shortName.xyxy;\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + + this.check(glsStateQuery.verifyProgram(program, gl.ACTIVE_ATTRIBUTES, 2)); + + var attribNames = [ + 'longInputAttributeName', + 'shortName' + ]; + // check names + for (var attributeNdx = 0; attributeNdx < 2; ++attributeNdx) { + var info = gl.getActiveAttrib(program, attributeNdx); + this.check(glsStateQuery.compare(info.name, attribNames[0]) || glsStateQuery.compare(info.name, attribNames[1])); + } + + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeSizeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeSizeCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeSizeCase.prototype.test = function() { + var pointers = [ + // size test + [4, gl.FLOAT, 0, false, 0], + [3, gl.FLOAT, 0, false, 0], + [2, gl.FLOAT, 0, false, 0], + [1, gl.FLOAT, 0, false, 0], + [4, gl.INT, 0, false, 0], + [3, gl.INT, 0, false, 0], + [2, gl.INT, 0, false, 0], + [1, gl.INT, 0, false, 0] + ]; + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + + // Test with default VAO + + for (var ndx = 0; ndx < pointers.length; ++ndx) { + gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, pointers[ndx][0])); + } + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, 4)); + + // set vao 0 to some value + gl.vertexAttribPointer(0, pointers[0][0], pointers[0][1], pointers[0][3], pointers[0][2], 0); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.vertexAttribPointer(0, pointers[1][0], pointers[1][1], pointers[1][3], pointers[1][2], 0); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, pointers[1][0])); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, pointers[0][0])); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); + gl.deleteBuffer(buf); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeTypeCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeTypeCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeTypeCase.prototype.test = function() { + var pointers = [ + // type test + [1, gl.BYTE, 0, false, 0], + [1, gl.SHORT, 0, false, 0], + [1, gl.INT, 0, false, 0], + [1, gl.FLOAT, 0, false, 0], + [1, gl.HALF_FLOAT, 0, false, 0], + [1, gl.UNSIGNED_BYTE, 0, false, 0], + [1, gl.UNSIGNED_SHORT, 0, false, 0], + [1, gl.UNSIGNED_INT, 0, false, 0], + [4, gl.INT_2_10_10_10_REV, 0, false, 0], + [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, false, 0] + ]; + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + + // Test with default VAO + + for (var ndx = 0; ndx < pointers.length; ++ndx) { + gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, pointers[ndx][1])); + } + + var pointersI = [ + [1, gl.BYTE, 0, false, 0], + [1, gl.SHORT, 0, false, 0], + [1, gl.INT, 0, false, 0], + [1, gl.UNSIGNED_BYTE, 0, false, 0], + [1, gl.UNSIGNED_SHORT, 0, false, 0], + [1, gl.UNSIGNED_INT, 0, false, 0] + ]; + + for (var ndx = 0; ndx < pointersI.length; ++ndx) { + gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, pointersI[ndx][1])); + } + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, gl.FLOAT)); + + // set vao 0 to some value + gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.vertexAttribPointer(0, 1, gl.SHORT, false, 0, 0); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, gl.SHORT)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, gl.FLOAT)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); + gl.deleteBuffer(buf); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeStrideCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeStrideCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeStrideCase.prototype.test = function() { + var pointers = [ + [1, gl.FLOAT, 0, 0, gl.NO_ERROR], + [1, gl.FLOAT, 1, 0, gl.INVALID_OPERATION], + [1, gl.FLOAT, 4, 0, gl.NO_ERROR], + [1, gl.HALF_FLOAT, 0, 0, gl.NO_ERROR], + [1, gl.HALF_FLOAT, 1, 0, gl.INVALID_OPERATION], + [1, gl.HALF_FLOAT, 4, 0, gl.NO_ERROR] + ]; + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + + // Test with default VAO + + for (var ndx = 0; ndx < pointers.length; ++ndx) { + gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], false, pointers[ndx][2], pointers[ndx][3]); + this.expectError(pointers[ndx][4]); + if (pointers[ndx][4] == gl.NO_ERROR) { + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, pointers[ndx][2])); + } + } + + var pointersI = [ + [1, gl.INT, 0, 0, gl.NO_ERROR], + [1, gl.INT, 1, 0, gl.INVALID_OPERATION], + [1, gl.INT, 4, 0, gl.NO_ERROR], + [4, gl.UNSIGNED_BYTE, 0, 0, gl.NO_ERROR], + [4, gl.UNSIGNED_BYTE, 1, 0, gl.NO_ERROR], + [4, gl.UNSIGNED_BYTE, 4, 0, gl.NO_ERROR], + [2, gl.SHORT, 0, 0, gl.NO_ERROR], + [2, gl.SHORT, 1, 0, gl.INVALID_OPERATION], + [2, gl.SHORT, 4, 0, gl.NO_ERROR] + ]; + + for (var ndx = 0; ndx < pointersI.length; ++ndx) { + gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][3]); + this.expectError(pointersI[ndx][4]); + if (pointersI[ndx][4] == gl.NO_ERROR) { + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, pointersI[ndx][2])); + } + } + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, 0)); + + // set vao 0 to some value + gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 4, 0); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.vertexAttribPointer(0, 1, gl.SHORT, false, 8, 0); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, 8)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, 4)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); + gl.deleteBuffer(buf); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeNormalizedCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeNormalizedCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeNormalizedCase.prototype.test = function() { + var pointers = [ + // type test + [1, gl.BYTE, 0, false, 0], + [1, gl.SHORT, 0, false, 0], + [1, gl.INT, 0, false, 0], + [1, gl.FLOAT, 0, false, 0], + [1, gl.HALF_FLOAT, 0, false, 0], + [1, gl.UNSIGNED_BYTE, 0, false, 0], + [1, gl.UNSIGNED_SHORT, 0, false, 0], + [1, gl.UNSIGNED_INT, 0, false, 0], + [4, gl.INT_2_10_10_10_REV, 0, false, 0], + [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, false, 0], + [1, gl.BYTE, 0, true, 0], + [1, gl.SHORT, 0, true, 0], + [1, gl.INT, 0, true, 0], + [1, gl.FLOAT, 0, true, 0], + [1, gl.HALF_FLOAT, 0, true, 0], + [1, gl.UNSIGNED_BYTE, 0, true, 0], + [1, gl.UNSIGNED_SHORT, 0, true, 0], + [1, gl.UNSIGNED_INT, 0, true, 0], + [4, gl.INT_2_10_10_10_REV, 0, true, 0], + [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, true, 0] + ]; + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + + // Test with default VAO + + for (var ndx = 0; ndx < pointers.length; ++ndx) { + gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, pointers[ndx][3])); + } + + var pointersI = [ + [1, gl.BYTE, 0, false, 0], + [1, gl.SHORT, 0, false, 0], + [1, gl.INT, 0, false, 0], + [1, gl.UNSIGNED_BYTE, 0, false, 0], + [1, gl.UNSIGNED_SHORT, 0, false, 0], + [1, gl.UNSIGNED_INT, 0, false, 0] + ]; + + for (var ndx = 0; ndx < pointersI.length; ++ndx) { + gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, false)); + } + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, false)); + + // set vao 0 to some value + gl.vertexAttribPointer(0, 1, gl.INT, true, 0, 0); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.vertexAttribPointer(0, 1, gl.INT, false, 0, 0); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, false)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, true)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); + gl.deleteBuffer(buf); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeIntegerCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeIntegerCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeIntegerCase.prototype.test = function() { + var pointers = [ + // type test + [1, gl.BYTE, 0, false, 0], + [1, gl.SHORT, 0, false, 0], + [1, gl.INT, 0, false, 0], + [1, gl.FLOAT, 0, false, 0], + [1, gl.HALF_FLOAT, 0, false, 0], + [1, gl.UNSIGNED_BYTE, 0, false, 0], + [1, gl.UNSIGNED_SHORT, 0, false, 0], + [1, gl.UNSIGNED_INT, 0, false, 0], + [4, gl.INT_2_10_10_10_REV, 0, false, 0], + [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, false, 0] + ]; + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + + // Test with default VAO + + for (var ndx = 0; ndx < pointers.length; ++ndx) { + gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, false)); + } + + var pointersI = [ + [1, gl.BYTE, 0, false, 0], + [1, gl.SHORT, 0, false, 0], + [1, gl.INT, 0, false, 0], + [1, gl.UNSIGNED_BYTE, 0, false, 0], + [1, gl.UNSIGNED_SHORT, 0, false, 0], + [1, gl.UNSIGNED_INT, 0, false, 0] + ]; + + for (var ndx = 0; ndx < pointersI.length; ++ndx) { + gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, true)); + } + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, false)); + + // set vao 0 to some value + gl.vertexAttribIPointer(0, 1, gl.INT, 0, 0); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, false)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, true)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); + gl.deleteBuffer(buf); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeEnabledCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeEnabledCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeEnabledCase.prototype.test = function() { + // Test with default VAO + + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, false)); + gl.enableVertexAttribArray(0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, true)); + gl.disableVertexAttribArray(0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, false)); + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + // set vao 0 to some value + gl.enableVertexAttribArray(0); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.disableVertexAttribArray(0); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, false)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, true)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeDivisorCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeDivisorCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeDivisorCase.prototype.test = function() { + // Test with default VAO + + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 0)); + gl.vertexAttribDivisor(0, 1); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 1)); + gl.vertexAttribDivisor(0, 5); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 5)); + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + // set vao 0 to some value + gl.vertexAttribDivisor(0, 1); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.vertexAttribDivisor(0, 5); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 5)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 1)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeBufferBindingCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeBufferBindingCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeBufferBindingCase.prototype.test = function() { + // Test with default VAO + + var buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + + gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0); + + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, buffer)); + + gl.deleteBuffer(buffer); + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + var buffer0 = gl.createBuffer(); + var buffer1 = gl.createBuffer(); + + // initial + gl.bindVertexArray(vao0); + // set vao 0 to some value + gl.bindBuffer(gl.ARRAY_BUFFER, buffer0); + gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer1); + gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, buffer1)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, buffer0)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); + gl.deleteBuffer(buffer0); + gl.deleteBuffer(buffer1); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.VertexAttributeOffsetCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.VertexAttributeOffsetCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.VertexAttributeOffsetCase.prototype.test = function() { + var pointers = [ + [1, gl.BYTE, 0, false, 2 * 4], + [1, gl.SHORT, 0, false, 1 * 4], + [1, gl.INT, 0, false, 2 * 4], + [1, gl.FLOAT, 0, false, 0 * 4], + [1, gl.FLOAT, 0, false, 3 * 4], + [1, gl.FLOAT, 0, false, 2 * 4], + [1, gl.HALF_FLOAT, 0, false, 0 * 4], + [4, gl.HALF_FLOAT, 0, false, 1 * 4], + [4, gl.HALF_FLOAT, 0, false, 2 * 4] + ]; + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + + // Test with default VAO + + for (var ndx = 0; ndx < pointers.length; ++ndx) { + gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, pointers[ndx][4])); + } + + // Test with multiple VAOs + var vao0 = gl.createVertexArray(); + var vao1 = gl.createVertexArray(); + + // initial + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, 0)); + + // set vao 0 to some value + gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 8); + + // set vao 1 to some other value + gl.bindVertexArray(vao1); + gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 4); + + // verify vao 1 state + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, 4)); + + // verify vao 0 state + gl.bindVertexArray(vao0); + this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, 8)); + + gl.deleteVertexArray(vao0); + gl.deleteVertexArray(vao1); + gl.deleteBuffer(buf); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.UniformValueFloatCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.UniformValueFloatCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.UniformValueFloatCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'uniform highp float floatUniform;\n' + + 'uniform highp vec2 float2Uniform;\n' + + 'uniform highp vec3 float3Uniform;\n' + + 'uniform highp vec4 float4Uniform;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(floatUniform + float2Uniform.x + float3Uniform.x + float4Uniform.x);\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + gl.useProgram(program); + + var location; + + location = gl.getUniformLocation(program, 'floatUniform'); + gl.uniform1f(location, 1); + this.check(glsStateQuery.verifyUniform(program, location, 1)); + + location = gl.getUniformLocation(program, 'float2Uniform'); + gl.uniform2f(location, 1, 2); + this.check(glsStateQuery.verifyUniform(program, location, new Float32Array([1, 2]))); + + location = gl.getUniformLocation(program, 'float3Uniform'); + gl.uniform3f(location, 1, 2, 3); + this.check(glsStateQuery.verifyUniform(program, location, new Float32Array([1, 2, 3]))); + + location = gl.getUniformLocation(program, 'float4Uniform'); + gl.uniform4f(location, 1, 2, 3, 4); + this.check(glsStateQuery.verifyUniform(program, location, new Float32Array([1, 2, 3, 4]))); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.UniformValueIntCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.UniformValueIntCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.UniformValueIntCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'uniform highp int intUniform;\n' + + 'uniform highp ivec2 int2Uniform;\n' + + 'uniform highp ivec3 int3Uniform;\n' + + 'uniform highp ivec4 int4Uniform;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(float(intUniform + int2Uniform.x + int3Uniform.x + int4Uniform.x));\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + gl.useProgram(program); + + var location; + + location = gl.getUniformLocation(program, 'intUniform'); + gl.uniform1i(location, 1); + this.check(glsStateQuery.verifyUniform(program, location, 1)); + + location = gl.getUniformLocation(program, 'int2Uniform'); + gl.uniform2i(location, 1, 2); + this.check(glsStateQuery.verifyUniform(program, location, new Int32Array([1, 2]))); + + location = gl.getUniformLocation(program, 'int3Uniform'); + gl.uniform3i(location, 1, 2, 3); + this.check(glsStateQuery.verifyUniform(program, location, new Int32Array([1, 2, 3]))); + + location = gl.getUniformLocation(program, 'int4Uniform'); + gl.uniform4i(location, 1, 2, 3, 4); + this.check(glsStateQuery.verifyUniform(program, location, new Int32Array([1, 2, 3, 4]))); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.UniformValueUintCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.UniformValueUintCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.UniformValueUintCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'uniform highp uint uintUniform;\n' + + 'uniform highp uvec2 uint2Uniform;\n' + + 'uniform highp uvec3 uint3Uniform;\n' + + 'uniform highp uvec4 uint4Uniform;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(float(uintUniform + uint2Uniform.x + uint3Uniform.x + uint4Uniform.x));\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + gl.useProgram(program); + + var location; + + location = gl.getUniformLocation(program, 'uintUniform'); + gl.uniform1ui(location, 1); + this.check(glsStateQuery.verifyUniform(program, location, 1)); + + location = gl.getUniformLocation(program, 'uint2Uniform'); + gl.uniform2ui(location, 1, 2); + this.check(glsStateQuery.verifyUniform(program, location, new Uint32Array([1, 2]))); + + location = gl.getUniformLocation(program, 'uint3Uniform'); + gl.uniform3ui(location, 1, 2, 3); + this.check(glsStateQuery.verifyUniform(program, location, new Uint32Array([1, 2, 3]))); + + location = gl.getUniformLocation(program, 'uint4Uniform'); + gl.uniform4ui(location, 1, 2, 3, 4); + this.check(glsStateQuery.verifyUniform(program, location, new Uint32Array([1, 2, 3, 4]))); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.UniformValueBooleanCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.UniformValueBooleanCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.UniformValueBooleanCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'uniform bool boolUniform;\n' + + 'uniform bvec2 bool2Uniform;\n' + + 'uniform bvec3 bool3Uniform;\n' + + 'uniform bvec4 bool4Uniform;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(float(boolUniform) + float(bool2Uniform.x) + float(bool3Uniform.x) + float(bool4Uniform.x));\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + gl.useProgram(program); + + var location; + + location = gl.getUniformLocation(program, 'boolUniform'); + gl.uniform1i(location, 1); + this.check(glsStateQuery.verifyUniform(program, location, true)); + + location = gl.getUniformLocation(program, 'bool2Uniform'); + gl.uniform2i(location, 1, 0); + this.check(glsStateQuery.verifyUniform(program, location, [true, false])); + + location = gl.getUniformLocation(program, 'bool3Uniform'); + gl.uniform3i(location, 1, 0, 1); + this.check(glsStateQuery.verifyUniform(program, location, [true, false, true])); + + location = gl.getUniformLocation(program, 'bool4Uniform'); + gl.uniform4i(location, 1, 0, 1, 0); + this.check(glsStateQuery.verifyUniform(program, location, [true, false, true, false])); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.UniformValueSamplerCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.UniformValueSamplerCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.UniformValueSamplerCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'uniform highp sampler2D uniformSampler;\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(textureSize(uniformSampler, 0).x);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + gl.useProgram(program); + + var location; + + location = gl.getUniformLocation(program, 'uniformSampler'); + gl.uniform1i(location, 1); + this.check(glsStateQuery.verifyUniform(program, location, 1)); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.UniformValueArrayCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.UniformValueArrayCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.UniformValueArrayCase.prototype.test = function() { + var testVertSource = + '#version 300 es\n' + + 'uniform highp float arrayUniform[5];' + + 'uniform highp vec2 array2Uniform[5];' + + 'uniform highp vec3 array3Uniform[5];' + + 'uniform highp vec4 array4Uniform[5];' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = \n' + + ' + vec4(arrayUniform[0] + arrayUniform[1] + arrayUniform[2] + arrayUniform[3] + arrayUniform[4])\n' + + ' + vec4(array2Uniform[0].x + array2Uniform[1].x + array2Uniform[2].x + array2Uniform[3].x + array2Uniform[4].x)\n' + + ' + vec4(array3Uniform[0].x + array3Uniform[1].x + array3Uniform[2].x + array3Uniform[3].x + array3Uniform[4].x)\n' + + ' + vec4(array4Uniform[0].x + array4Uniform[1].x + array4Uniform[2].x + array4Uniform[3].x + array4Uniform[4].x);\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + gl.useProgram(program); + + var location; + + var uniformValue = [ + -1.0, 0.1, 4.0, 800.0, + 13.0, 55.0, 12.0, 91.0, + -55.1, 1.1, 98.0, 19.0, + 41.0, 65.0, 4.0, 12.2, + 95.0, 77.0, 32.0, 48.0 + ]; + + location = gl.getUniformLocation(program, 'arrayUniform'); + gl.uniform1fv(location, new Float32Array(uniformValue.slice(0, 5))); + + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[0]'), uniformValue[0])); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[1]'), uniformValue[1])); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[2]'), uniformValue[2])); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[3]'), uniformValue[3])); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[4]'), uniformValue[4])); + + location = gl.getUniformLocation(program, 'array2Uniform'); + gl.uniform2fv(location, new Float32Array(uniformValue.slice(0, 10))); + + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[0]'), new Float32Array([uniformValue[2 * 0], uniformValue[(2 * 0) + 1]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[1]'), new Float32Array([uniformValue[2 * 1], uniformValue[(2 * 1) + 1]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[2]'), new Float32Array([uniformValue[2 * 2], uniformValue[(2 * 2) + 1]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[3]'), new Float32Array([uniformValue[2 * 3], uniformValue[(2 * 3) + 1]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[4]'), new Float32Array([uniformValue[2 * 4], uniformValue[(2 * 4) + 1]]))); + + location = gl.getUniformLocation(program, 'array3Uniform'); + gl.uniform3fv(location, new Float32Array(uniformValue.slice(0, 15))); + + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[0]'), new Float32Array([uniformValue[3 * 0], uniformValue[(3 * 0) + 1], uniformValue[(3 * 0) + 2]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[1]'), new Float32Array([uniformValue[3 * 1], uniformValue[(3 * 1) + 1], uniformValue[(3 * 1) + 2]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[2]'), new Float32Array([uniformValue[3 * 2], uniformValue[(3 * 2) + 1], uniformValue[(3 * 2) + 2]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[3]'), new Float32Array([uniformValue[3 * 3], uniformValue[(3 * 3) + 1], uniformValue[(3 * 3) + 2]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[4]'), new Float32Array([uniformValue[3 * 4], uniformValue[(3 * 4) + 1], uniformValue[(3 * 4) + 2]]))); + + location = gl.getUniformLocation(program, 'array4Uniform'); + gl.uniform4fv(location, new Float32Array(uniformValue)); + + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[0]'), new Float32Array([uniformValue[4 * 0], uniformValue[(4 * 0) + 1], uniformValue[(4 * 0) + 2], uniformValue[(4 * 0) + 3]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[1]'), new Float32Array([uniformValue[4 * 1], uniformValue[(4 * 1) + 1], uniformValue[(4 * 1) + 2], uniformValue[(4 * 1) + 3]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[2]'), new Float32Array([uniformValue[4 * 2], uniformValue[(4 * 2) + 1], uniformValue[(4 * 2) + 2], uniformValue[(4 * 2) + 3]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[3]'), new Float32Array([uniformValue[4 * 3], uniformValue[(4 * 3) + 1], uniformValue[(4 * 3) + 2], uniformValue[(4 * 3) + 3]]))); + this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[4]'), new Float32Array([uniformValue[4 * 4], uniformValue[(4 * 4) + 1], uniformValue[(4 * 4) + 2], uniformValue[(4 * 4) + 3]]))); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + */ +es3fShaderStateQueryTests.UniformValueMatrixCase = function(name, description) { + es3fApiCase.ApiCase.call(this, name, description, gl); +}; + +setParentClass(es3fShaderStateQueryTests.UniformValueMatrixCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.UniformValueMatrixCase.prototype.test = function() { + var transpose = function(rows, cols, data) { + var matrix = tcuMatrix.matrixFromDataArray(rows, cols, data); + var result = []; + for (var col = 0; col < cols; col++) + result.push(matrix.getColumn(col)); + return new Float32Array([].concat.apply([], result)); + }; + + var testVertSource = + '#version 300 es\n' + + 'uniform highp mat2 mat2Uniform;' + + 'uniform highp mat3 mat3Uniform;' + + 'uniform highp mat4 mat4Uniform;' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(mat2Uniform[0][0] + mat3Uniform[0][0] + mat4Uniform[0][0]);\n' + + '}\n'; + var testFragSource = + '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 fragColor;' + + 'void main (void)\n' + + '{\n' + + ' fragColor = vec4(0.0);\n' + + '}\n'; + + var shaderVert = gl.createShader(gl.VERTEX_SHADER); + var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(shaderVert, testVertSource); + gl.shaderSource(shaderFrag, testFragSource); + + gl.compileShader(shaderVert); + gl.compileShader(shaderFrag); + + var program = gl.createProgram(); + gl.attachShader(program, shaderVert); + gl.attachShader(program, shaderFrag); + gl.linkProgram(program); + gl.useProgram(program); + + var location; + + var matrixValues = [ + -1.0, 0.1, 4.0, 800.0, + 13.0, 55.0, 12.0, 91.0, + -55.1, 1.1, 98.0, 19.0, + 41.0, 65.0, 4.0, 12.0 + ]; + + // the values of the matrix are returned in column major order but they can be given in either order + + location = gl.getUniformLocation(program, 'mat2Uniform'); + var m2 = new Float32Array(matrixValues.slice(0, 2 * 2)); + gl.uniformMatrix2fv(location, false, m2); + this.check(glsStateQuery.verifyUniform(program, location, m2)); + gl.uniformMatrix2fv(location, true, m2); + this.check(glsStateQuery.verifyUniform(program, location, transpose(2, 2, m2))); + + location = gl.getUniformLocation(program, 'mat3Uniform'); + var m3 = new Float32Array(matrixValues.slice(0, 3 * 3)); + gl.uniformMatrix3fv(location, false, m3); + this.check(glsStateQuery.verifyUniform(program, location, m3)); + gl.uniformMatrix3fv(location, true, m3); + this.check(glsStateQuery.verifyUniform(program, location, transpose(3, 3, m3))); + + location = gl.getUniformLocation(program, 'mat4Uniform'); + var m4 = new Float32Array(matrixValues.slice(0, 4 * 4)); + gl.uniformMatrix4fv(location, false, m4); + this.check(glsStateQuery.verifyUniform(program, location, m4)); + gl.uniformMatrix4fv(location, true, m4); + this.check(glsStateQuery.verifyUniform(program, location, transpose(4, 4, m4))); + + gl.useProgram(null); + gl.deleteShader(shaderVert); + gl.deleteShader(shaderFrag); + gl.deleteProgram(program); +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} shaderType + * @param {number} precisionType + */ +es3fShaderStateQueryTests.PrecisionFormatCase = function(name, description, shaderType, precisionType) { + es3fApiCase.ApiCase.call(this, name, description, gl); + this.m_shaderType = shaderType; + this.m_precisionType = precisionType; +}; + +setParentClass(es3fShaderStateQueryTests.PrecisionFormatCase, es3fApiCase.ApiCase); + +es3fShaderStateQueryTests.PrecisionFormatCase.prototype.test = function() { + var requirements = {}; + requirements[gl.LOW_FLOAT] = [0, 0, 8]; + requirements[gl.MEDIUM_FLOAT] = [13, 13, 10]; + requirements[gl.HIGH_FLOAT] = [127, 127, 23]; + requirements[gl.LOW_INT] = [8, 7, 0]; + requirements[gl.MEDIUM_INT] = [15, 14, 0]; + requirements[gl.HIGH_INT] = [31, 30, 0]; + + + var expected = requirements[this.m_precisionType]; + var result = gl.getShaderPrecisionFormat(this.m_shaderType, this.m_precisionType); + + bufferedLogToConsole('Precision:' + + ' range min = ' + result.rangeMin + + ' range max = ' + result.rangeMax + + ' precision = ' + result.precision); + + if (this.m_precisionType == gl.HIGH_FLOAT) { + // highp float must be IEEE 754 single + + this.check(result.rangeMin == expected[0] || + result.rangeMax == expected[1] || + result.precision == expected[2], + 'Invalid precision format, expected:' + + ' range min = ' + expected[0] + + ' range max = ' + expected[1] + + ' precision = ' + expected[2]); + } else{ + this.check(result.rangeMin >= expected[0] || + result.rangeMax >= expected[1] || + result.precision >= expected[2], + 'Invalid precision format, expected:' + + ' range min >= ' + expected[0] + + ' range max >= ' + expected[1] + + ' precision >= ' + expected[2]); + } +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fShaderStateQueryTests.ShaderStateQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'shader', 'Shader State Query tests'); +}; + +es3fShaderStateQueryTests.ShaderStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fShaderStateQueryTests.ShaderStateQueryTests.prototype.constructor = es3fShaderStateQueryTests.ShaderStateQueryTests; + +es3fShaderStateQueryTests.ShaderStateQueryTests.prototype.init = function() { + // shader + this.addChild(new es3fShaderStateQueryTests.ShaderTypeCase('shader_type', 'SHADER_TYPE')); + this.addChild(new es3fShaderStateQueryTests.ShaderCompileStatusCase('shader_compile_status', 'COMPILE_STATUS')); + this.addChild(new es3fShaderStateQueryTests.ShaderInfoLogCase('shader_info_log', 'INFO_LOG')); + this.addChild(new es3fShaderStateQueryTests.ShaderSourceCase('shader_source', 'SHADER_SOURCE')); + + // shader and program + this.addChild(new es3fShaderStateQueryTests.DeleteStatusCase('delete_status', 'DELETE_STATUS')); + + // // vertex-attrib + this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribInitialCase('current_vertex_attrib_initial', 'CURRENT_VERTEX_ATTRIB')); + this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribFloatCase('current_vertex_attrib_float', 'CURRENT_VERTEX_ATTRIB')); + this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribIntCase('current_vertex_attrib_int', 'CURRENT_VERTEX_ATTRIB')); + this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribUintCase('current_vertex_attrib_uint', 'CURRENT_VERTEX_ATTRIB')); + + // // program + this.addChild(new es3fShaderStateQueryTests.ProgramInfoLogCase('program_info_log', 'INFO_LOG')); + this.addChild(new es3fShaderStateQueryTests.ProgramValidateStatusCase('program_validate_status', 'VALIDATE_STATUS')); + this.addChild(new es3fShaderStateQueryTests.ProgramAttachedShadersCase('program_attached_shaders', 'ATTACHED_SHADERS')); + + this.addChild(new es3fShaderStateQueryTests.ProgramActiveUniformNameCase('program_active_uniform_name', 'ACTIVE_UNIFORMS')); + this.addChild(new es3fShaderStateQueryTests.ProgramUniformCase('program_active_uniform_types', 'UNIFORM_TYPE, UNIFORM_SIZE, and UNIFORM_IS_ROW_MAJOR')); + this.addChild(new es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase ("program_active_uniform_blocks", "ACTIVE_UNIFORM_BLOCK_x")); + + // transform feedback + this.addChild(new es3fShaderStateQueryTests.TransformFeedbackCase('transform_feedback', 'TRANSFORM_FEEDBACK_BUFFER_MODE, TRANSFORM_FEEDBACK_VARYINGS, TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH')); + + // attribute related + this.addChild(new es3fShaderStateQueryTests.ActiveAttributesCase('active_attributes', 'ACTIVE_ATTRIBUTES and ACTIVE_ATTRIBUTE_MAX_LENGTH')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeSizeCase('vertex_attrib_size', 'VERTEX_ATTRIB_ARRAY_SIZE')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeTypeCase('vertex_attrib_type', 'VERTEX_ATTRIB_ARRAY_TYPE')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeStrideCase('vertex_attrib_stride', 'VERTEX_ATTRIB_ARRAY_STRIDE')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeNormalizedCase('vertex_attrib_normalized', 'VERTEX_ATTRIB_ARRAY_NORMALIZED')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeIntegerCase('vertex_attrib_integer', 'VERTEX_ATTRIB_ARRAY_INTEGER')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeEnabledCase('vertex_attrib_array_enabled', 'VERTEX_ATTRIB_ARRAY_ENABLED')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeDivisorCase('vertex_attrib_array_divisor', 'VERTEX_ATTRIB_ARRAY_DIVISOR')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeBufferBindingCase('vertex_attrib_array_buffer_binding', 'VERTEX_ATTRIB_ARRAY_BUFFER_BINDING')); + this.addChild(new es3fShaderStateQueryTests.VertexAttributeOffsetCase('vertex_attrib_offset', 'VERTEX_ATTRIB_ARRAY_POINTER')); + + // uniform values + this.addChild(new es3fShaderStateQueryTests.UniformValueFloatCase('uniform_value_float', 'GetUniform*')); + this.addChild(new es3fShaderStateQueryTests.UniformValueIntCase('uniform_value_int', 'GetUniform*')); + this.addChild(new es3fShaderStateQueryTests.UniformValueUintCase('uniform_value_uint', 'GetUniform*')); + this.addChild(new es3fShaderStateQueryTests.UniformValueBooleanCase('uniform_value_boolean', 'GetUniform*')); + this.addChild(new es3fShaderStateQueryTests.UniformValueSamplerCase('uniform_value_sampler', 'GetUniform*')); + this.addChild(new es3fShaderStateQueryTests.UniformValueArrayCase('uniform_value_array', 'GetUniform*')); + this.addChild(new es3fShaderStateQueryTests.UniformValueMatrixCase('uniform_value_matrix', 'GetUniform*')); + + // precision format query + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_lowp_float', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.LOW_FLOAT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_mediump_float', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.MEDIUM_FLOAT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_highp_float', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.HIGH_FLOAT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_lowp_int', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.LOW_INT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_mediump_int', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.MEDIUM_INT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_highp_int', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.HIGH_INT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_lowp_float', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.LOW_FLOAT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_mediump_float', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_highp_float', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.HIGH_FLOAT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_lowp_int', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.LOW_INT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_mediump_int', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.MEDIUM_INT)); + this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_highp_int', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.HIGH_INT)); +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fShaderStateQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderStateQueryTests.ShaderStateQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderStateQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js new file mode 100644 index 000000000..3c23545d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js @@ -0,0 +1,1957 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderStructTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +// goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('modules.shared.glsShaderRenderCase'); +goog.require('framework.common.tcuStringTemplate'); + +goog.scope(function() { + var es3fShaderStructTests = functional.gles3.es3fShaderStructTests; + var tcuTestCase = framework.common.tcuTestCase; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var deMath = framework.delibs.debase.deMath; + // var gluShaderUtil = framework.opengl.gluShaderUtil; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + var gluTexture = framework.opengl.gluTexture; + var tcuStringTemplate = framework.common.tcuStringTemplate; + + /** @typedef {function(WebGLProgram, Array)} */ + es3fShaderStructTests.SetupUniformsFunc; + + /** @const {number} */ es3fShaderStructTests.TEXTURE_BRICK = 0; + + + /** + * @constructor + * @extends {glsShaderRenderCase.ShaderRenderCase} + * @param {string} name + * @param {string} description + * @param {boolean} isVertexCase + * @param {boolean} usesTextures + * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc + * @param {?es3fShaderStructTests.SetupUniformsFunc} setupUniformsFunc + * @param {string} vertShaderSource + * @param {string} fragShaderSource + */ + es3fShaderStructTests.ShaderStructCase = function(name, description, isVertexCase, usesTextures, evalFunc, setupUniformsFunc, vertShaderSource, fragShaderSource) { + glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc); + /** @type {?es3fShaderStructTests.SetupUniformsFunc} */ this.m_setupUniforms = setupUniformsFunc; + /** @type {boolean} */ this.m_usesTexture = usesTextures; + /** @type {gluTexture.Texture2D} */ this.m_brickTexture = null; + /** @type {string} */ this.m_vertShaderSource = vertShaderSource; + /** @type {string} */ this.m_fragShaderSource = fragShaderSource; + }; + + es3fShaderStructTests.ShaderStructCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype); + es3fShaderStructTests.ShaderStructCase.prototype.constructor = es3fShaderStructTests.ShaderStructCase; + + es3fShaderStructTests.ShaderStructCase.prototype.init = function() { + if (this.m_usesTexture) { + this.m_brickTexture = gluTexture.texture2DFromInternalFormat(gl, gl.RGBA8, 256, 256); + var ref = this.m_brickTexture.getRefTexture(); + for (var i = 0 ; i < ref.getNumLevels(); i++) { + ref.allocLevel(i); + tcuTextureUtil.fillWithGrid(ref.getLevel(i), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]); + } + this.m_brickTexture.upload(); + + this.m_textures.push(new glsShaderRenderCase.TextureBinding( + this.m_brickTexture, + new tcuTexture.Sampler( + tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.LINEAR, + tcuTexture.FilterMode.LINEAR))); + + assertMsgOptions(this.m_textures.length === 1, 'Only one texture required', false, true); + } + this.postinit(); + }; + + es3fShaderStructTests.ShaderStructCase.prototype.deinit = function() { + glsShaderRenderCase.ShaderRenderCase.prototype.deinit.call(this); + this.m_brickTexture = null; + }; + + /** + * @param {WebGLProgram} programID + * @param {Array} constCoords + */ + es3fShaderStructTests.ShaderStructCase.prototype.setupUniforms = function(programID, constCoords) { + glsShaderRenderCase.ShaderRenderCase.prototype.setupUniforms.call(this, programID, constCoords); + if (this.m_setupUniforms) + this.m_setupUniforms(programID, constCoords); + }; + + /** + * @param {string} name + * @param {string} description + * @param {boolean} isVertexCase + * @param {boolean} usesTextures + * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc + * @param {?es3fShaderStructTests.SetupUniformsFunc} setupUniforms + * @param {string} shaderSrc + */ + es3fShaderStructTests.ShaderStructCase.createStructCase = function(name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, shaderSrc) { + /** @type {string} */ var defaultVertSrc = + '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in highp vec4 a_coords;\n' + + 'out mediump vec4 v_coords;\n\n' + + 'void main (void)\n' + + '{\n' + + ' v_coords = a_coords;\n' + + ' gl_Position = a_position;\n' + + '}\n'; + /** @type {string} */ var defaultFragSrc = + '#version 300 es\n' + + 'in mediump vec4 v_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = v_color;\n' + + '}\n'; + + // Fill in specialization parameters. + var spParams = {}; + if (isVertexCase) { + spParams["HEADER"] = + "#version 300 es\n" + + "in highp vec4 a_position;\n" + + "in highp vec4 a_coords;\n" + + "out mediump vec4 v_color;"; + spParams["COORDS"] = "a_coords"; + spParams["DST"] = "v_color"; + spParams["ASSIGN_POS"] = "gl_Position = a_position;"; + } + else { + spParams["HEADER"] = + "#version 300 es\n" + + "in mediump vec4 v_coords;\n" + + "layout(location = 0) out mediump vec4 o_color;"; + spParams["COORDS"] = "v_coords"; + spParams["DST"] = "o_color"; + spParams["ASSIGN_POS"] = ""; + } + + if (isVertexCase) + return new es3fShaderStructTests.ShaderStructCase(name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, tcuStringTemplate.specialize(shaderSrc, spParams), defaultFragSrc); + else + return new es3fShaderStructTests.ShaderStructCase(name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, defaultVertSrc, tcuStringTemplate.specialize(shaderSrc, spParams)); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderStructTests.LocalStructTests = function() { + tcuTestCase.DeqpTest.call(this, 'local', 'Local structs'); + this.makeExecutable(); + }; + + es3fShaderStructTests.LocalStructTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderStructTests.LocalStructTests.prototype.constructor = es3fShaderStructTests.LocalStructTests; + + es3fShaderStructTests.LocalStructTests.prototype.init = function() { + var currentCtx = this; + function LocalStructCase(name, description, shaderSource, evalFunction) { + currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_vertex", description, true, false, evalFunction, null, shaderSource)); + currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_fragment", description, false, false, evalFunction, null, shaderSource)); + }; + + LocalStructCase('basic', 'Basic struct usage', + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, vec3(0.0), ui_one);\n' + + ' s.b = ${COORDS}.yzw;\n' + + ' ${DST} = vec4(s.a, s.b.x, s.b.y, s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[2]; + }); + + LocalStructCase('nested', "Nested struct", + '${HEADER}\n' + + "uniform int ui_zero;\n" + + "uniform int ui_one;\n" + + "\n" + + "struct T {\n" + + " int a;\n" + + " mediump vec2 b;\n" + + "};\n" + + "struct S {\n" + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, T(0, vec2(0.0)), ui_one);\n' + + ' s.b = T(ui_zero, ${COORDS}.yz);\n' + + ' ${DST} = vec4(s.a, s.b.b, s.b.a + s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[2]; + }); + + LocalStructCase('array_member', "Struct with array member", + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump float b[3];\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s;\n' + + ' s.a = ${COORDS}.w;\n' + + ' s.c = ui_one;\n' + + ' s.b[0] = ${COORDS}.z;\n' + + ' s.b[1] = ${COORDS}.y;\n' + + ' s.b[2] = ${COORDS}.x;\n' + + ' ${DST} = vec4(s.a, s.b[0], s.b[1], s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[3]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[1]; + }); + + LocalStructCase('array_member_dynamic_index', "Struct with array member, dynamic indexing", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump float b[3];\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s;\n' + + ' s.a = ${COORDS}.w;\n' + + ' s.c = ui_one;\n' + + ' s.b[0] = ${COORDS}.z;\n' + + ' s.b[1] = ${COORDS}.y;\n' + + ' s.b[2] = ${COORDS}.x;\n' + + ' ${DST} = vec4(s.b[ui_one], s.b[ui_zero], s.b[ui_two], s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[1]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[0]; + }); + + LocalStructCase('struct_array', "Struct array", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[3];\n' + + ' s[0] = S(${COORDS}.x, ui_zero);\n' + + ' s[1].a = ${COORDS}.y;\n' + + ' s[1].b = ui_one;\n' + + ' s[2] = S(${COORDS}.z, ui_two);\n' + + ' ${DST} = vec4(s[2].a, s[1].a, s[0].a, s[2].b - s[1].b + s[0].b);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[2]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[0]; + }); + + LocalStructCase('struct_array_dynamic_index', "Struct array with dynamic indexing", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[3];\n' + + ' s[0] = S(${COORDS}.x, ui_zero);\n' + + ' s[1].a = ${COORDS}.y;\n' + + ' s[1].b = ui_one;\n' + + ' s[2] = S(${COORDS}.z, ui_two);\n' + + ' ${DST} = vec4(s[ui_two].a, s[ui_one].a, s[ui_zero].a, s[ui_two].b - s[ui_one].b + s[ui_zero].b);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[2]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[0]; + }); + + LocalStructCase('nested_struct_array', "Nested struct array", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform mediump float uf_two;\n' + + 'uniform mediump float uf_three;\n' + + 'uniform mediump float uf_four;\n' + + 'uniform mediump float uf_half;\n' + + 'uniform mediump float uf_third;\n' + + 'uniform mediump float uf_fourth;\n' + + '\n' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[2];\n' + + '\n' + + ' // S[0]\n' + + ' s[0].a = ${COORDS}.x;\n' + + ' s[0].b[0].a = uf_half;\n' + + ' s[0].b[0].b[0] = ${COORDS}.xy;\n' + + ' s[0].b[0].b[1] = ${COORDS}.zw;\n' + + ' s[0].b[1].a = uf_third;\n' + + ' s[0].b[1].b[0] = ${COORDS}.zw;\n' + + ' s[0].b[1].b[1] = ${COORDS}.xy;\n' + + ' s[0].b[2].a = uf_fourth;\n' + + ' s[0].b[2].b[0] = ${COORDS}.xz;\n' + + ' s[0].b[2].b[1] = ${COORDS}.yw;\n' + + ' s[0].c = ui_zero;\n' + + '\n' + + ' // S[1]\n' + + ' s[1].a = ${COORDS}.w;\n' + + ' s[1].b[0].a = uf_two;\n' + + ' s[1].b[0].b[0] = ${COORDS}.xx;\n' + + ' s[1].b[0].b[1] = ${COORDS}.yy;\n' + + ' s[1].b[1].a = uf_three;\n' + + ' s[1].b[1].b[0] = ${COORDS}.zz;\n' + + ' s[1].b[1].b[1] = ${COORDS}.ww;\n' + + ' s[1].b[2].a = uf_four;\n' + + ' s[1].b[2].b[0] = ${COORDS}.yx;\n' + + ' s[1].b[2].b[1] = ${COORDS}.wz;\n' + + ' s[1].c = ui_one;\n' + + '\n' + + ' mediump float r = (s[0].b[1].b[0].x + s[1].b[2].b[1].y) * s[0].b[0].a; // (z + z) * 0.5\n' + + ' mediump float g = s[1].b[0].b[0].y * s[0].b[2].a * s[1].b[2].a; // x * 0.25 * 4\n' + + ' mediump float b = (s[0].b[2].b[1].y + s[0].b[1].b[0].y + s[1].a) * s[0].b[1].a; // (w + w + w) * 0.333\n' + + ' mediump float a = float(s[0].c) + s[1].b[2].a - s[1].b[1].a; // 0 + 4.0 - 3.0\n' + + ' ${DST} = vec4(r, g, b, a);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[2]; + c.color[1] = c.coords[0]; + c.color[2] = c.coords[3]; + }); + + LocalStructCase('nested_struct_array_dynamic_index', "Nested struct array with dynamic indexing", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform mediump float uf_two;\n' + + 'uniform mediump float uf_three;\n' + + 'uniform mediump float uf_four;\n' + + 'uniform mediump float uf_half;\n' + + 'uniform mediump float uf_third;\n' + + 'uniform mediump float uf_fourth;\n' + + '\n' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[2];\n' + + '\n' + + ' // S[0]\n' + + ' s[0].a = ${COORDS}.x;\n' + + ' s[0].b[0].a = uf_half;\n' + + ' s[0].b[0].b[0] = ${COORDS}.xy;\n' + + ' s[0].b[0].b[1] = ${COORDS}.zw;\n' + + ' s[0].b[1].a = uf_third;\n' + + ' s[0].b[1].b[0] = ${COORDS}.zw;\n' + + ' s[0].b[1].b[1] = ${COORDS}.xy;\n' + + ' s[0].b[2].a = uf_fourth;\n' + + ' s[0].b[2].b[0] = ${COORDS}.xz;\n' + + ' s[0].b[2].b[1] = ${COORDS}.yw;\n' + + ' s[0].c = ui_zero;\n' + + '\n' + + ' // S[1]\n' + + ' s[1].a = ${COORDS}.w;\n' + + ' s[1].b[0].a = uf_two;\n' + + ' s[1].b[0].b[0] = ${COORDS}.xx;\n' + + ' s[1].b[0].b[1] = ${COORDS}.yy;\n' + + ' s[1].b[1].a = uf_three;\n' + + ' s[1].b[1].b[0] = ${COORDS}.zz;\n' + + ' s[1].b[1].b[1] = ${COORDS}.ww;\n' + + ' s[1].b[2].a = uf_four;\n' + + ' s[1].b[2].b[0] = ${COORDS}.yx;\n' + + ' s[1].b[2].b[1] = ${COORDS}.wz;\n' + + ' s[1].c = ui_one;\n' + + '\n' + + ' mediump float r = (s[0].b[ui_one].b[ui_one-1].x + s[ui_one].b[ui_two].b[ui_zero+1].y) * s[0].b[0].a; // (z + z) * 0.5\n' + + ' mediump float g = s[ui_two-1].b[ui_two-2].b[ui_zero].y * s[0].b[ui_two].a * s[ui_one].b[2].a; // x * 0.25 * 4\n' + + ' mediump float b = (s[ui_zero].b[ui_one+1].b[1].y + s[0].b[ui_one*ui_one].b[0].y + s[ui_one].a) * s[0].b[ui_two-ui_one].a; // (w + w + w) * 0.333\n' + + ' mediump float a = float(s[ui_zero].c) + s[ui_one-ui_zero].b[ui_two].a - s[ui_zero+ui_one].b[ui_two-ui_one].a; // 0 + 4.0 - 3.0\n' + + ' ${DST} = vec4(r, g, b, a);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[2]; + c.color[1] = c.coords[0]; + c.color[2] = c.coords[3]; + }); + + LocalStructCase('parameter', "Struct as a function parameter", + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'mediump vec4 myFunc (S s)\n' + + '{\n' + + ' return vec4(s.a, s.b.x, s.b.y, s.c);\n' + + '}\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, vec3(0.0), ui_one);\n' + + ' s.b = ${COORDS}.yzw;\n' + + ' ${DST} = myFunc(s);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[2]; + }); + + LocalStructCase('parameter_nested', "Nested struct as a function parameter", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + '\n' + + 'struct T {\n' + + ' int a;\n' + + ' mediump vec2 b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'mediump vec4 myFunc (S s)\n' + + '{\n' + + ' return vec4(s.a, s.b.b, s.b.a + s.c);\n' + + '}\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, T(0, vec2(0.0)), ui_one);\n' + + ' s.b = T(ui_zero, ${COORDS}.yz);\n' + + ' ${DST} = myFunc(s);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[2]; + }); + + LocalStructCase('return', "Struct as a return value", + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'S myFunc (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, vec3(0.0), ui_one);\n' + + ' s.b = ${COORDS}.yzw;\n' + + ' return s;\n' + + '}\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = myFunc();\n' + + ' ${DST} = vec4(s.a, s.b.x, s.b.y, s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[2]; + }); + + LocalStructCase('return_nested', "Nested struct", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + '\n' + + 'struct T {\n' + + ' int a;\n' + + ' mediump vec2 b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'S myFunc (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, T(0, vec2(0.0)), ui_one);\n' + + ' s.b = T(ui_zero, ${COORDS}.yz);\n' + + ' return s;\n' + + '}\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = myFunc();\n' + + ' ${DST} = vec4(s.a, s.b.b, s.b.a + s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[2]; + }); + + LocalStructCase('conditional_assignment', "Conditional struct assignment", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform mediump float uf_one;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, ${COORDS}.yzw, ui_zero);\n' + + ' if (uf_one > 0.0)\n' + + ' s = S(${COORDS}.w, ${COORDS}.zyx, ui_one);\n' + + ' ${DST} = vec4(s.a, s.b.xy, s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[3]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[1]; + }); + + LocalStructCase('loop_assignment', "Struct assignment in loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, ${COORDS}.yzw, ui_zero);\n' + + ' for (int i = 0; i < 3; i++)\n' + + ' {\n' + + ' if (i == 1)\n' + + ' s = S(${COORDS}.w, ${COORDS}.zyx, ui_one);\n' + + ' }\n' + + ' ${DST} = vec4(s.a, s.b.xy, s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[3]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[1]; + }); + + LocalStructCase('dynamic_loop_assignment', "Struct assignment in loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_three;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, ${COORDS}.yzw, ui_zero);\n' + + ' for (int i = 0; i < ui_three; i++)\n' + + ' {\n' + + ' if (i == ui_one)\n' + + ' s = S(${COORDS}.w, ${COORDS}.zyx, ui_one);\n' + + ' }\n' + + ' ${DST} = vec4(s.a, s.b.xy, s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[3]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[1]; + }); + + LocalStructCase('nested_conditional_assignment', "Conditional assignment of nested struct", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform mediump float uf_one;\n' + + '\n' + + 'struct T {\n' + + ' int a;\n' + + ' mediump vec2 b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, T(ui_one, ${COORDS}.yz), ui_one);\n' + + ' if (uf_one > 0.0)\n' + + ' s.b = T(ui_zero, ${COORDS}.zw);\n' + + ' ${DST} = vec4(s.a, s.b.b, s.c - s.b.a);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[3]; + }); + + LocalStructCase('nested_loop_assignment', "Nested struct assignment in loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform mediump float uf_one;\n' + + '\n' + + 'struct T {\n' + + ' int a;\n' + + ' mediump vec2 b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, T(ui_one, ${COORDS}.yz), ui_one);\n' + + ' for (int i = 0; i < 3; i++)\n' + + ' {\n' + + ' if (i == 1)\n' + + ' s.b = T(ui_zero, ${COORDS}.zw);\n' + + ' }\n' + + ' ${DST} = vec4(s.a, s.b.b, s.c - s.b.a);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[3]; + }); + + LocalStructCase('nested_dynamic_loop_assignment', "Nested struct assignment in dynamic loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_three;\n' + + 'uniform mediump float uf_one;\n' + + '\n' + + 'struct T {\n' + + ' int a;\n' + + ' mediump vec2 b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s = S(${COORDS}.x, T(ui_one, ${COORDS}.yz), ui_one);\n' + + ' for (int i = 0; i < ui_three; i++)\n' + + ' {\n' + + ' if (i == ui_one)\n' + + ' s.b = T(ui_zero, ${COORDS}.zw);\n' + + ' }\n' + + ' ${DST} = vec4(s.a, s.b.b, s.c - s.b.a);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[0]; + c.color[1] = c.coords[2]; + c.color[2] = c.coords[3]; + }); + + LocalStructCase('loop_struct_array', "Struct array usage in loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[3];\n' + + ' s[0] = S(${COORDS}.x, ui_zero);\n' + + ' s[1].a = ${COORDS}.y;\n' + + ' s[1].b = -ui_one;\n' + + ' s[2] = S(${COORDS}.z, ui_two);\n' + + '\n' + + ' mediump float rgb[3];\n' + + ' int alpha = 0;\n' + + ' for (int i = 0; i < 3; i++)\n' + + ' {\n' + + ' rgb[i] = s[2-i].a;\n' + + ' alpha += s[i].b;\n' + + ' }\n' + + ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[2]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[0]; + }); + + LocalStructCase('loop_nested_struct_array', "Nested struct array usage in loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform mediump float uf_two;\n' + + 'uniform mediump float uf_three;\n' + + 'uniform mediump float uf_four;\n' + + 'uniform mediump float uf_half;\n' + + 'uniform mediump float uf_third;\n' + + 'uniform mediump float uf_fourth;\n' + + 'uniform mediump float uf_sixth;\n' + + '\n' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[2];\n' + + '\n' + + ' // S[0]\n' + + ' s[0].a = ${COORDS}.x;\n' + + ' s[0].b[0].a = uf_half;\n' + + ' s[0].b[0].b[0] = ${COORDS}.yx;\n' + + ' s[0].b[0].b[1] = ${COORDS}.zx;\n' + + ' s[0].b[1].a = uf_third;\n' + + ' s[0].b[1].b[0] = ${COORDS}.yy;\n' + + ' s[0].b[1].b[1] = ${COORDS}.wy;\n' + + ' s[0].b[2].a = uf_fourth;\n' + + ' s[0].b[2].b[0] = ${COORDS}.zx;\n' + + ' s[0].b[2].b[1] = ${COORDS}.zy;\n' + + ' s[0].c = ui_zero;\n' + + '\n' + + ' // S[1]\n' + + ' s[1].a = ${COORDS}.w;\n' + + ' s[1].b[0].a = uf_two;\n' + + ' s[1].b[0].b[0] = ${COORDS}.zx;\n' + + ' s[1].b[0].b[1] = ${COORDS}.zy;\n' + + ' s[1].b[1].a = uf_three;\n' + + ' s[1].b[1].b[0] = ${COORDS}.zz;\n' + + ' s[1].b[1].b[1] = ${COORDS}.ww;\n' + + ' s[1].b[2].a = uf_four;\n' + + ' s[1].b[2].b[0] = ${COORDS}.yx;\n' + + ' s[1].b[2].b[1] = ${COORDS}.wz;\n' + + ' s[1].c = ui_one;\n' + + '\n' + + ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' + + ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' + + ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' + + ' mediump float a = 1.0;\n' + + ' for (int i = 0; i < 2; i++)\n' + + ' {\n' + + ' for (int j = 0; j < 3; j++)\n' + + ' {\n' + + ' r += s[0].b[j].b[i].y;\n' + + ' g += s[i].b[j].b[0].x;\n' + + ' b += s[i].b[j].b[1].x;\n' + + ' a *= s[i].b[j].a;\n' + + ' }\n' + + ' }\n' + + ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = (c.coords[0] + c.coords[1]) * 0.5; + c.color[1] = (c.coords[1] + c.coords[2]) * 0.5; + c.color[2] = (c.coords[2] + c.coords[3]) * 0.5; + }); + + LocalStructCase('dynamic_loop_struct_array', "Struct array usage in dynamic loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform int ui_three;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[3];\n' + + ' s[0] = S(${COORDS}.x, ui_zero);\n' + + ' s[1].a = ${COORDS}.y;\n' + + ' s[1].b = -ui_one;\n' + + ' s[2] = S(${COORDS}.z, ui_two);\n' + + '\n' + + ' mediump float rgb[3];\n' + + ' int alpha = 0;\n' + + ' for (int i = 0; i < ui_three; i++)\n' + + ' {\n' + + ' rgb[i] = s[2-i].a;\n' + + ' alpha += s[i].b;\n' + + ' }\n' + + ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = c.coords[2]; + c.color[1] = c.coords[1]; + c.color[2] = c.coords[0]; + }); + + LocalStructCase('dynamic_loop_nested_struct_array', "Nested struct array usage in dynamic loop", + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform int ui_three;\n' + + 'uniform mediump float uf_two;\n' + + 'uniform mediump float uf_three;\n' + + 'uniform mediump float uf_four;\n' + + 'uniform mediump float uf_half;\n' + + 'uniform mediump float uf_third;\n' + + 'uniform mediump float uf_fourth;\n' + + 'uniform mediump float uf_sixth;\n' + + '\n' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S s[2];\n' + + '\n' + + ' // S[0]\n' + + ' s[0].a = ${COORDS}.x;\n' + + ' s[0].b[0].a = uf_half;\n' + + ' s[0].b[0].b[0] = ${COORDS}.yx;\n' + + ' s[0].b[0].b[1] = ${COORDS}.zx;\n' + + ' s[0].b[1].a = uf_third;\n' + + ' s[0].b[1].b[0] = ${COORDS}.yy;\n' + + ' s[0].b[1].b[1] = ${COORDS}.wy;\n' + + ' s[0].b[2].a = uf_fourth;\n' + + ' s[0].b[2].b[0] = ${COORDS}.zx;\n' + + ' s[0].b[2].b[1] = ${COORDS}.zy;\n' + + ' s[0].c = ui_zero;\n' + + '\n' + + ' // S[1]\n' + + ' s[1].a = ${COORDS}.w;\n' + + ' s[1].b[0].a = uf_two;\n' + + ' s[1].b[0].b[0] = ${COORDS}.zx;\n' + + ' s[1].b[0].b[1] = ${COORDS}.zy;\n' + + ' s[1].b[1].a = uf_three;\n' + + ' s[1].b[1].b[0] = ${COORDS}.zz;\n' + + ' s[1].b[1].b[1] = ${COORDS}.ww;\n' + + ' s[1].b[2].a = uf_four;\n' + + ' s[1].b[2].b[0] = ${COORDS}.yx;\n' + + ' s[1].b[2].b[1] = ${COORDS}.wz;\n' + + ' s[1].c = ui_one;\n' + + '\n' + + ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' + + ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' + + ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' + + ' mediump float a = 1.0;\n' + + ' for (int i = 0; i < ui_two; i++)\n' + + ' {\n' + + ' for (int j = 0; j < ui_three; j++)\n' + + ' {\n' + + ' r += s[0].b[j].b[i].y;\n' + + ' g += s[i].b[j].b[0].x;\n' + + ' b += s[i].b[j].b[1].x;\n' + + ' a *= s[i].b[j].a;\n' + + ' }\n' + + ' }\n' + + ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + c.color[0] = (c.coords[0] + c.coords[1]) * 0.5; + c.color[1] = (c.coords[1] + c.coords[2]) * 0.5; + c.color[2] = (c.coords[2] + c.coords[3]) * 0.5; + }); + + LocalStructCase('basic_equal', "Basic struct equality", + '${HEADER}\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S a = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' + + ' S b = S(floor(${COORDS}.x+0.5), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' + + ' S c = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one);\n' + + ' S d = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_two);\n' + + ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' + + ' if (a == b) ${DST}.x = 1.0;\n' + + ' if (a == c) ${DST}.y = 1.0;\n' + + ' if (a == d) ${DST}.z = 1.0;\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + if (Math.floor(c.coords[0]) === Math.floor(c.coords[0] + 0.5)) + c.color[0] = 1.0; + if (Math.floor(c.coords[1]) === Math.floor(c.coords[1] + 0.5)) + c.color[1] = 1.0; + }); + + LocalStructCase('basic_not_equal', "Basic struct equality", + '${HEADER}\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S a = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' + + ' S b = S(floor(${COORDS}.x+0.5), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' + + ' S c = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one);\n' + + ' S d = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_two);\n' + + ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' + + ' if (a != b) ${DST}.x = 1.0;\n' + + ' if (a != c) ${DST}.y = 1.0;\n' + + ' if (a != d) ${DST}.z = 1.0;\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + if (Math.floor(c.coords[0]) != Math.floor(c.coords[0] + 0.5)) + c.color[0] = 1.0; + if (Math.floor(c.coords[1]) != Math.floor(c.coords[1] + 0.5)) + c.color[1] = 1.0; + c.color[2] = 1.0; + }); + + LocalStructCase('nested_equal', "Nested struct struct equality", + '${HEADER}\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct T {\n' + + ' mediump vec3 a;\n' + + ' int b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S a = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' + + ' S b = S(floor(${COORDS}.x+0.5), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' + + ' S c = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one), 1);\n' + + ' S d = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_two), 1);\n' + + ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' + + ' if (a == b) ${DST}.x = 1.0;\n' + + ' if (a == c) ${DST}.y = 1.0;\n' + + ' if (a == d) ${DST}.z = 1.0;\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + if (Math.floor(c.coords[0]) == Math.floor(c.coords[0] + 0.5)) + c.color[0] = 1.0; + if (Math.floor(c.coords[1]) == Math.floor(c.coords[1] + 0.5)) + c.color[1] = 1.0; + }); + + LocalStructCase('nested_not_equal', "Nested struct struct equality", + '${HEADER}\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '\n' + + 'struct T {\n' + + ' mediump vec3 a;\n' + + ' int b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' S a = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' + + ' S b = S(floor(${COORDS}.x+0.5), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' + + ' S c = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one), 1);\n' + + ' S d = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_two), 1);\n' + + ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' + + ' if (a != b) ${DST}.x = 1.0;\n' + + ' if (a != c) ${DST}.y = 1.0;\n' + + ' if (a != d) ${DST}.z = 1.0;\n' + + ' ${ASSIGN_POS}\n' + + '}\n', + function(c) { + if (Math.floor(c.coords[0]) != Math.floor(c.coords[0] + 0.5)) + c.color[0] = 1.0; + if (Math.floor(c.coords[1]) != Math.floor(c.coords[1] + 0.5)) + c.color[1] = 1.0; + c.color[2] = 1.0; + }); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderStructTests.UniformStructTests = function() { + tcuTestCase.DeqpTest.call(this, 'uniform', 'Uniform structs'); + this.makeExecutable(); + }; + + es3fShaderStructTests.UniformStructTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderStructTests.UniformStructTests.prototype.constructor = es3fShaderStructTests.UniformStructTests; + + /** + * @param {WebGLProgram} programID + * @param {string} name + * @param {Array} vec + */ + es3fShaderStructTests.setUniform2fv = function(programID, name, vec) { + /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name); + gl.uniform2fv(loc, vec); + }; + + /** + * @param {WebGLProgram} programID + * @param {string} name + * @param {Array} vec + */ + es3fShaderStructTests.setUniform3fv = function(programID, name, vec) { + /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name); + gl.uniform3fv(loc, vec); + }; + + /** + * @param {WebGLProgram} programID + * @param {string} name + * @param {number} value + */ + es3fShaderStructTests.setUniform1i = function(programID, name, value) { + /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name); + gl.uniform1i(loc, value); + }; + + /** + * @param {WebGLProgram} programID + * @param {string} name + * @param {number} value + */ + es3fShaderStructTests.setUniform1f = function(programID, name, value) { + /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name); + gl.uniform1f(loc, value); + }; + + /** + * @param {WebGLProgram} programID + * @param {string} name + * @param {Array} vec + */ + es3fShaderStructTests.setUniform1fv = function(programID, name, vec) { + /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name); + gl.uniform1fv(loc, vec); + }; + + es3fShaderStructTests.UniformStructTests.prototype.init = function() { + var currentCtx = this; + function UniformStructCase(name, description, textures, shaderSrc, setUniformsFunc, evalFunc) { + currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_vertex", description, true, textures, evalFunc, setUniformsFunc, shaderSrc)); + currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_fragment", description, false, textures, evalFunc, setUniformsFunc, shaderSrc)); + } + + UniformStructCase('basic', "Basic struct usage", false, + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + 'uniform S s;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(s.a, s.b.x, s.b.y, s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[0]); + es3fShaderStructTests.setUniform3fv(programID, "s.b", deMath.swizzle(constCoords, [1, 2, 3])); + es3fShaderStructTests.setUniform1i(programID, "s.c", 1); + }, + function(c) { + c.color[0] = c.constCoords[0]; + c.color[1] = c.constCoords[1]; + c.color[2] = c.constCoords[2]; + }); + + UniformStructCase('nested', "Nested struct", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + '' + + 'struct T {\n' + + ' int a;\n' + + ' mediump vec2 b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + 'uniform S s;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(s.a, s.b.b, s.b.a + s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[0]); + es3fShaderStructTests.setUniform1i(programID, "s.b.a", 0); + es3fShaderStructTests.setUniform2fv(programID, "s.b.b", deMath.swizzle(constCoords, [1,2])); + es3fShaderStructTests.setUniform1i(programID, "s.c", 1); + }, + function(c) { + c.color[0] = c.constCoords[0]; + c.color[1] = c.constCoords[1]; + c.color[2] = c.constCoords[2]; + }); + + UniformStructCase('array_member', "Struct with array member", false, + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump float b[3];\n' + + ' int c;\n' + + '};\n' + + 'uniform S s;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(s.a, s.b[0], s.b[1], s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords){ + es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[3]); + es3fShaderStructTests.setUniform1i(programID, "s.c", 1); + + /** @type {Array} */ var b = []; + b[0] = constCoords[2]; + b[1] = constCoords[1]; + b[2] = constCoords[0]; + es3fShaderStructTests.setUniform1fv(programID, "s.b", b); + }, + function(c) { + c.color[0] = c.constCoords[3]; + c.color[1] = c.constCoords[2]; + c.color[2] = c.constCoords[1]; + }); + + UniformStructCase('array_member_dynamic_index', "Struct with array member, dynamic indexing", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump float b[3];\n' + + ' int c;\n' + + '};\n' + + 'uniform S s;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(s.b[ui_one], s.b[ui_zero], s.b[ui_two], s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[3]); + es3fShaderStructTests.setUniform1i(programID, "s.c", 1); + + /** @type {Array} */ var b = []; + b[0] = constCoords[2]; + b[1] = constCoords[1]; + b[2] = constCoords[0]; + es3fShaderStructTests.setUniform1fv(programID, "s.b", b); + }, + function(c) { + c.color[0] = c.constCoords[1]; + c.color[1] = c.constCoords[2]; + c.color[2] = c.constCoords[0]; + }); + + UniformStructCase('struct_array', "Struct array", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + 'uniform S s[3];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(s[2].a, s[1].a, s[0].a, s[2].b - s[1].b + s[0].b);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0); + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]); + es3fShaderStructTests.setUniform1i(programID, "s[1].b", 1); + es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]); + es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2); + }, + function(c) { + c.color[0] = c.constCoords[2]; + c.color[1] = c.constCoords[1]; + c.color[2] = c.constCoords[0]; + }); + + UniformStructCase('struct_array_dynamic_index', "Struct array with dynamic indexing", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + 'uniform S s[3];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(s[ui_two].a, s[ui_one].a, s[ui_zero].a, s[ui_two].b - s[ui_one].b + s[ui_zero].b);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0); + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]); + es3fShaderStructTests.setUniform1i(programID, "s[1].b", 1); + es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]); + es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2); + }, + function(c) { + c.color[0] = c.constCoords[2]; + c.color[1] = c.constCoords[1]; + c.color[2] = c.constCoords[0]; + }); + + UniformStructCase('nested_struct_array', "Nested struct array", false, + '${HEADER}\n' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + 'uniform S s[2];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' mediump float r = (s[0].b[1].b[0].x + s[1].b[2].b[1].y) * s[0].b[0].a; // (z + z) * 0.5\n' + + ' mediump float g = s[1].b[0].b[0].y * s[0].b[2].a * s[1].b[2].a; // x * 0.25 * 4\n' + + ' mediump float b = (s[0].b[2].b[1].y + s[0].b[1].b[0].y + s[1].a) * s[0].b[1].a; // (w + w + w) * 0.333\n' + + ' mediump float a = float(s[0].c) + s[1].b[2].a - s[1].b[1].a; // 0 + 4.0 - 3.0\n' + + ' ${DST} = vec4(r, g, b, a);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + /** @type {Array} */ var arr = []; + + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + arr = deMath.swizzle(constCoords, [0,1,2,3]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr); + arr = deMath.swizzle(constCoords, [2,3,0,1]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr); + arr = deMath.swizzle(constCoords, [0,2,1,3]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0); + + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]); + arr = deMath.swizzle(constCoords, [0,0,1,1]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr); + arr = deMath.swizzle(constCoords, [2,2,3,3]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr); + arr = deMath.swizzle(constCoords, [1,0,3,2]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1); + }, + function(c) { + c.color[0] = c.constCoords[2]; + c.color[1] = c.constCoords[0]; + c.color[2] = c.constCoords[3]; + }); + + UniformStructCase('nested_struct_array_dynamic_index', "Nested struct array with dynamic indexing", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + 'uniform S s[2];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' mediump float r = (s[0].b[ui_one].b[ui_one-1].x + s[ui_one].b[ui_two].b[ui_zero+1].y) * s[0].b[0].a; // (z + z) * 0.5\n' + + ' mediump float g = s[ui_two-1].b[ui_two-2].b[ui_zero].y * s[0].b[ui_two].a * s[ui_one].b[2].a; // x * 0.25 * 4\n' + + ' mediump float b = (s[ui_zero].b[ui_one+1].b[1].y + s[0].b[ui_one*ui_one].b[0].y + s[ui_one].a) * s[0].b[ui_two-ui_one].a; // (w + w + w) * 0.333\n' + + ' mediump float a = float(s[ui_zero].c) + s[ui_one-ui_zero].b[ui_two].a - s[ui_zero+ui_one].b[ui_two-ui_one].a; // 0 + 4.0 - 3.0\n' + + ' ${DST} = vec4(r, g, b, a);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords){ + /** @type {Array} */ var arr = []; + + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + arr = constCoords; + es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr); + arr = deMath.swizzle(constCoords, [2,3,0,1]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr); + arr = deMath.swizzle(constCoords, [0,2,1,3]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0); + + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]); + arr = deMath.swizzle(constCoords, [0,0,1,1]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr); + arr = deMath.swizzle(constCoords, [2,2,3,3]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr); + arr = deMath.swizzle(constCoords, [1,0,3,2]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1); + }, + function(c) { + c.color[0] = c.constCoords[2]; + c.color[1] = c.constCoords[0]; + c.color[2] = c.constCoords[3]; + }); + + UniformStructCase('loop_struct_array', "Struct array usage in loop", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + 'uniform S s[3];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' mediump float rgb[3];\n' + + ' int alpha = 0;\n' + + ' for (int i = 0; i < 3; i++)\n' + + ' {\n' + + ' rgb[i] = s[2-i].a;\n' + + ' alpha += s[i].b;\n' + + ' }\n' + + ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0); + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]); + es3fShaderStructTests.setUniform1i(programID, "s[1].b", -1); + es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]); + es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2); + }, + function(c) { + c.color[0] = c.constCoords[2]; + c.color[1] = c.constCoords[1]; + c.color[2] = c.constCoords[0]; + }); + + UniformStructCase('loop_nested_struct_array', "Nested struct array usage in loop", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform mediump float uf_two;\n' + + 'uniform mediump float uf_three;\n' + + 'uniform mediump float uf_four;\n' + + 'uniform mediump float uf_half;\n' + + 'uniform mediump float uf_third;\n' + + 'uniform mediump float uf_fourth;\n' + + 'uniform mediump float uf_sixth;\n' + + '' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + 'uniform S s[2];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' + + ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' + + ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' + + ' mediump float a = 1.0;\n' + + ' for (int i = 0; i < 2; i++)\n' + + ' {\n' + + ' for (int j = 0; j < 3; j++)\n' + + ' {\n' + + ' r += s[0].b[j].b[i].y;\n' + + ' g += s[i].b[j].b[0].x;\n' + + ' b += s[i].b[j].b[1].x;\n' + + ' a *= s[i].b[j].a;\n' + + ' }\n' + + ' }\n' + + ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + /** @type {Array} */ var arr = []; + + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + arr = deMath.swizzle(constCoords, [1,0,2,0]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr); + arr = deMath.swizzle(constCoords, [1,1,3,1]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr); + arr = deMath.swizzle(constCoords, [2,1,2,1]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0); + + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]); + arr = deMath.swizzle(constCoords, [2,0,2,1]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr); + arr = deMath.swizzle(constCoords, [2,2,3,3]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr); + arr = deMath.swizzle(constCoords, [1,0,3,2]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1); + }, + function(c) { + c.color[0] = (c.constCoords[0] + c.constCoords[1]) * 0.5; + c.color[1] = (c.constCoords[1] + c.constCoords[2]) * 0.5; + c.color[2] = (c.constCoords[2] + c.constCoords[3]) * 0.5; + }); + + UniformStructCase('dynamic_loop_struct_array', "Struct array usage in dynamic loop", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform int ui_three;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump int b;\n' + + '};\n' + + 'uniform S s[3];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' mediump float rgb[3];\n' + + ' int alpha = 0;\n' + + ' for (int i = 0; i < ui_three; i++)\n' + + ' {\n' + + ' rgb[i] = s[2-i].a;\n' + + ' alpha += s[i].b;\n' + + ' }\n' + + ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0); + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]); + es3fShaderStructTests.setUniform1i(programID, "s[1].b", -1); + es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]); + es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2); + }, + function(c) { + c.color[0] = c.constCoords[2]; + c.color[1] = c.constCoords[1]; + c.color[2] = c.constCoords[0]; + }); + + UniformStructCase('dynamic_loop_nested_struct_array', "Nested struct array usage in dynamic loop", false, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + 'uniform int ui_two;\n' + + 'uniform int ui_three;\n' + + 'uniform mediump float uf_two;\n' + + 'uniform mediump float uf_three;\n' + + 'uniform mediump float uf_four;\n' + + 'uniform mediump float uf_half;\n' + + 'uniform mediump float uf_third;\n' + + 'uniform mediump float uf_fourth;\n' + + 'uniform mediump float uf_sixth;\n' + + '' + + 'struct T {\n' + + ' mediump float a;\n' + + ' mediump vec2 b[2];\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b[3];\n' + + ' int c;\n' + + '};\n' + + 'uniform S s[2];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' + + ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' + + ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' + + ' mediump float a = 1.0;\n' + + ' for (int i = 0; i < ui_two; i++)\n' + + ' {\n' + + ' for (int j = 0; j < ui_three; j++)\n' + + ' {\n' + + ' r += s[0].b[j].b[i].y;\n' + + ' g += s[i].b[j].b[0].x;\n' + + ' b += s[i].b[j].b[1].x;\n' + + ' a *= s[i].b[j].a;\n' + + ' }\n' + + ' }\n' + + ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + /** @type {Array} */ var arr = []; + + es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]); + arr = deMath.swizzle(constCoords, [1,0,2,0]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr); + arr = deMath.swizzle(constCoords, [1,1,3,1]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr); + arr = deMath.swizzle(constCoords, [2,1,2,1]); + es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0); + + es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]); + arr = deMath.swizzle(constCoords, [2,0,2,1]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr); + arr = deMath.swizzle(constCoords, [2,2,3,3]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr); + arr = deMath.swizzle(constCoords, [1,0,3,2]); + es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0); + es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr); + es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1); + }, + function(c) { + c.color[0] = (c.constCoords[0] + c.constCoords[1]) * 0.5; + c.color[1] = (c.constCoords[1] + c.constCoords[2]) * 0.5; + c.color[2] = (c.constCoords[2] + c.constCoords[3]) * 0.5; + }); + + UniformStructCase('sampler', "Sampler in struct", true, + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' sampler2D c;\n' + + '};\n' + + 'uniform S s;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(texture(s.c, ${COORDS}.xy * s.b.xy + s.b.z).rgb, s.a);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s.a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "s.b", [0.25, 0.25, 0.5]); + es3fShaderStructTests.setUniform1i(programID, "s.c", 0); + }, + function(c) { + var tex2d = c.texture2D(es3fShaderStructTests.TEXTURE_BRICK, deMath.addScalar(deMath.scale(deMath.swizzle(c.coords, [0,1]), 0.25), 0.5)) + + c.color[0] = tex2d[0]; + c.color[1] = tex2d[1]; + c.color[2] = tex2d[2]; + }); + + UniformStructCase('sampler_nested', "Sampler in nested struct", true, + '${HEADER}\n' + + 'uniform int ui_zero;\n' + + 'uniform int ui_one;\n' + + '' + + 'struct T {\n' + + ' sampler2D a;\n' + + ' mediump vec2 b;\n' + + '};\n' + + 'struct S {\n' + + ' mediump float a;\n' + + ' T b;\n' + + ' int c;\n' + + '};\n' + + 'uniform S s;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(texture(s.b.a, ${COORDS}.xy * s.b.b + s.a).rgb, s.c);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s.a", 0.5); + es3fShaderStructTests.setUniform1i(programID, "s.b.a", 0); + es3fShaderStructTests.setUniform2fv(programID, "s.b.b", [0.25, 0.25]); + es3fShaderStructTests.setUniform1i(programID, "s.c", 1); + }, + function(c) { + var tex2d = c.texture2D(es3fShaderStructTests.TEXTURE_BRICK, deMath.addScalar(deMath.scale(deMath.swizzle(c.coords, [0,1]), 0.25), 0.5)); + c.color[0] = tex2d[0]; + c.color[1] = tex2d[1]; + c.color[2] = tex2d[2]; + }); + + UniformStructCase('sampler_array', "Sampler in struct array", true, + '${HEADER}\n' + + 'uniform int ui_one;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' sampler2D c;\n' + + '};\n' + + 'uniform S s[2];\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' ${DST} = vec4(texture(s[1].c, ${COORDS}.xy * s[0].b.xy + s[1].b.z).rgb, s[0].a);\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "s[0].a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "s[0].b", [0.25, 0.25, 0.25]); + es3fShaderStructTests.setUniform1i(programID, "s[0].c", 1); + es3fShaderStructTests.setUniform1f(programID, "s[1].a", 0.0); + es3fShaderStructTests.setUniform3fv(programID, "s[1].b", [0.5, 0.5, 0.5]); + es3fShaderStructTests.setUniform1i(programID, "s[1].c", 0); + }, + function(c) { + var tex2d = c.texture2D(es3fShaderStructTests.TEXTURE_BRICK, deMath.addScalar(deMath.scale(deMath.swizzle(c.coords, [0,1]), 0.25), 0.5)); + c.color[0] = tex2d[0]; + c.color[1] = tex2d[1]; + c.color[2] = tex2d[2]; + }); + + UniformStructCase('equal', "Struct equality", false, + '${HEADER}\n' + + 'uniform mediump float uf_one;\n' + + 'uniform int ui_two;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + 'uniform S a;\n' + + 'uniform S b;\n' + + 'uniform S c;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' S d = S(uf_one, vec3(0.0, floor(${COORDS}.y+1.0), 2.0), ui_two);\n' + + ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' + + ' if (a == b) ${DST}.x = 1.0;\n' + + ' if (a == c) ${DST}.y = 1.0;\n' + + ' if (a == d) ${DST}.z = 1.0;\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "a.a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "a.b", [0.0, 1.0, 2.0]); + es3fShaderStructTests.setUniform1i(programID, "a.c", 2); + es3fShaderStructTests.setUniform1f(programID, "b.a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "b.b", [0.0, 1.0, 2.0]); + es3fShaderStructTests.setUniform1i(programID, "b.c", 2); + es3fShaderStructTests.setUniform1f(programID, "c.a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "c.b", [0.0, 1.1, 2.0]); + es3fShaderStructTests.setUniform1i(programID, "c.c", 2); + }, + function(c) { + c.color[0] = 1.0; + c.color[1] = 0.0; + if (Math.floor(c.coords[1] + 1.0) == Math.floor(1.1)) + c.color[2] = 1.0; + }); + + UniformStructCase('not_equal', "Struct equality", false, + '${HEADER}\n' + + 'uniform mediump float uf_one;\n' + + 'uniform int ui_two;\n' + + '' + + 'struct S {\n' + + ' mediump float a;\n' + + ' mediump vec3 b;\n' + + ' int c;\n' + + '};\n' + + 'uniform S a;\n' + + 'uniform S b;\n' + + 'uniform S c;\n' + + '' + + 'void main (void)\n' + + '{\n' + + ' S d = S(uf_one, vec3(0.0, floor(${COORDS}.y+1.0), 2.0), ui_two);\n' + + ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' + + ' if (a != b) ${DST}.x = 1.0;\n' + + ' if (a != c) ${DST}.y = 1.0;\n' + + ' if (a != d) ${DST}.z = 1.0;\n' + + ' ${ASSIGN_POS}\n' + + '}', + function(programID, constCoords) { + es3fShaderStructTests.setUniform1f(programID, "a.a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "a.b", [0.0, 1.0, 2.0]); + es3fShaderStructTests.setUniform1i(programID, "a.c", 2); + es3fShaderStructTests.setUniform1f(programID, "b.a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "b.b", [0.0, 1.0, 2.0]); + es3fShaderStructTests.setUniform1i(programID, "b.c", 2); + es3fShaderStructTests.setUniform1f(programID, "c.a", 1.0); + es3fShaderStructTests.setUniform3fv(programID, "c.b", [0.0, 1.1, 2.0]); + es3fShaderStructTests.setUniform1i(programID, "c.c", 2); + }, + function(c) { + c.color[0] = 0.0; + c.color[1] = 1.0; + if (Math.floor(c.coords[1] + 1.0) != Math.floor(1.1)) + c.color[2] = 1.0; + }); + + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderStructTests.ShaderStructTests = function() { + tcuTestCase.DeqpTest.call(this, 'struct', 'Struct Tests'); + }; + + es3fShaderStructTests.ShaderStructTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderStructTests.ShaderStructTests.prototype.constructor = es3fShaderStructTests.ShaderStructTests; + + es3fShaderStructTests.ShaderStructTests.prototype.init = function() { + this.addChild(new es3fShaderStructTests.LocalStructTests()); + this.addChild(new es3fShaderStructTests.UniformStructTests()); + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderStructTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderStructTests.ShaderStructTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderStructTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js new file mode 100644 index 000000000..27670f9d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js @@ -0,0 +1,492 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderSwitchTests'); +goog.require('framework.common.tcuStringTemplate'); +goog.require('framework.common.tcuTestCase'); +goog.require('modules.shared.glsShaderRenderCase'); + + +goog.scope(function() { + var es3fShaderSwitchTests = functional.gles3.es3fShaderSwitchTests; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + var tcuTestCase = framework.common.tcuTestCase; + var tcuStringTemplate = framework.common.tcuStringTemplate; + + /** + * @constructor + * @extends {glsShaderRenderCase.ShaderRenderCase} + * @param {string} name + * @param {string} description + * @param {boolean} isVertexCase + * @param {string} vtxSource + * @param {string} fragSource + * @param {glsShaderRenderCase.ShaderEvalFunc=} evalFunc + */ + es3fShaderSwitchTests.ShaderSwitchCase = function(name, description, isVertexCase, vtxSource, fragSource, evalFunc) { + glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc); + /** @type {string} */ this.m_vertShaderSource = vtxSource; + /** @type {string} */ this.m_fragShaderSource = fragSource; + }; + + es3fShaderSwitchTests.ShaderSwitchCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype); + es3fShaderSwitchTests.ShaderSwitchCase.prototype.constructor = es3fShaderSwitchTests.ShaderSwitchCase; + + /** + * @enum {number} + */ + es3fShaderSwitchTests.SwitchType = { + STATIC: 0, + UNIFORM: 1, + DYNAMIC: 2 + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} evalCtx */ + es3fShaderSwitchTests.evalSwitchStatic = function(evalCtx) { + evalCtx.color[0] = evalCtx.coords[1]; + evalCtx.color[1] = evalCtx.coords[2]; + evalCtx.color[2] = evalCtx.coords[3]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} evalCtx */ + es3fShaderSwitchTests.evalSwitchUniform = function(evalCtx) { + evalCtx.color[0] = evalCtx.coords[1]; + evalCtx.color[1] = evalCtx.coords[2]; + evalCtx.color[2] = evalCtx.coords[3]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} evalCtx */ + es3fShaderSwitchTests.evalSwitchDynamic = function(evalCtx) { + switch (Math.floor(evalCtx.coords[2]*1.5 + 2.0)) { + case 0: + evalCtx.color[0] = evalCtx.coords[0]; + evalCtx.color[1] = evalCtx.coords[1]; + evalCtx.color[2] = evalCtx.coords[2]; + break; + case 1: + evalCtx.color[0] = evalCtx.coords[3]; + evalCtx.color[1] = evalCtx.coords[2]; + evalCtx.color[2] = evalCtx.coords[1]; + break; + case 2: + evalCtx.color[0] = evalCtx.coords[1]; + evalCtx.color[1] = evalCtx.coords[2]; + evalCtx.color[2] = evalCtx.coords[3]; + break; + case 3: + evalCtx.color[0] = evalCtx.coords[2]; + evalCtx.color[1] = evalCtx.coords[1]; + evalCtx.color[2] = evalCtx.coords[0]; + break; + default: + evalCtx.color[0] = evalCtx.coords[0]; + evalCtx.color[1] = evalCtx.coords[0]; + evalCtx.color[2] = evalCtx.coords[0]; + break; + } + }; + + /** + * @param {string} name + * @param {string} desc + * @param {es3fShaderSwitchTests.SwitchType} type + * @param {boolean} isVertex + * @param {string} switchBody + * @return {es3fShaderSwitchTests.ShaderSwitchCase} + */ + es3fShaderSwitchTests.makeSwitchCase = function(name, desc, type, isVertex, switchBody) { + /** @type {string} */ var vtx = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vtx += "#version 300 es\n" + + "in highp vec4 a_position;\n" + + "in highp vec4 a_coords;\n"; + frag += "#version 300 es\n" + + "layout(location = 0) out mediump vec4 o_color;\n"; + + if (isVertex) { + vtx += "out mediump vec4 v_color;\n"; + frag += "in mediump vec4 v_color;\n"; + } else { + vtx += "out highp vec4 v_coords;\n"; + frag += "in highp vec4 v_coords;\n"; + } + + if (type === es3fShaderSwitchTests.SwitchType.UNIFORM) + op += "uniform highp int ui_two;\n"; + + vtx += isVertex ? op : ''; + frag += isVertex ? '' : op; + op = ''; + + vtx += "\n" + + "void main (void)\n" + + "{\n" + + " gl_Position = a_position;\n"; + frag += "\n" + + "void main (void)\n" + + "{\n"; + + // Setup. + op += " highp vec4 coords = " + (isVertex ? "a_coords" : "v_coords") + ";\n"; + op += " mediump vec3 res = vec3(0.0);\n\n"; + vtx += isVertex ? op : ''; + frag += isVertex ? '' : op; + op = ''; + + // Switch body. + var params = {}; + params["CONDITION"] = type == es3fShaderSwitchTests.SwitchType.STATIC ? "2" : + type == es3fShaderSwitchTests.SwitchType.UNIFORM ? "ui_two" : + type == es3fShaderSwitchTests.SwitchType.DYNAMIC ? "int(floor(coords.z*1.5 + 2.0))" : "???"; + + op += tcuStringTemplate.specialize(switchBody, params); + op += "\n"; + + vtx += isVertex ? op : ''; + frag += isVertex ? '' : op; + op = ''; + + if (isVertex) { + vtx += " v_color = vec4(res, 1.0);\n"; + frag += " o_color = v_color;\n"; + } else { + vtx += " v_coords = a_coords;\n"; + frag += " o_color = vec4(res, 1.0);\n"; + } + + vtx += "}\n"; + frag += "}\n"; + + return new es3fShaderSwitchTests.ShaderSwitchCase(name, desc, isVertex, vtx, frag, + type === es3fShaderSwitchTests.SwitchType.STATIC ? es3fShaderSwitchTests.evalSwitchStatic : + type === es3fShaderSwitchTests.SwitchType.UNIFORM ? es3fShaderSwitchTests.evalSwitchUniform : + type === es3fShaderSwitchTests.SwitchType.DYNAMIC ? es3fShaderSwitchTests.evalSwitchDynamic : undefined); + }; + + /** + * @param {tcuTestCase.DeqpTest} group + * @param {string} name + * @param {string} desc + * @param {string} switchBody + */ + es3fShaderSwitchTests.makeSwitchCases = function(group, name, desc, switchBody) { + /** @type {Array} */ var switchTypeNames = ["static", "uniform", "dynamic"]; + for (var type in es3fShaderSwitchTests.SwitchType) { + group.addChild(es3fShaderSwitchTests.makeSwitchCase(name + "_" + switchTypeNames[es3fShaderSwitchTests.SwitchType[type]] + "_vertex", desc, es3fShaderSwitchTests.SwitchType[type], true, switchBody)); + group.addChild(es3fShaderSwitchTests.makeSwitchCase(name + "_" + switchTypeNames[es3fShaderSwitchTests.SwitchType[type]] + "_fragment", desc, es3fShaderSwitchTests.SwitchType[type], false, switchBody)); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderSwitchTests.ShaderSwitchTests = function() { + tcuTestCase.DeqpTest.call(this, 'switch', 'Switch statement tests'); + }; + + es3fShaderSwitchTests.ShaderSwitchTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderSwitchTests.ShaderSwitchTests.prototype.constructor = es3fShaderSwitchTests.ShaderSwitchTests; + + es3fShaderSwitchTests.ShaderSwitchTests.prototype.init = function() { + // Expected swizzles: + // 0: xyz + // 1: wzy + // 2: yzw + // 3: zyx + es3fShaderSwitchTests.makeSwitchCases(this, "basic", "Basic switch statement usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2: res = coords.yzw; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "const_expr_in_label", "Constant expression in label", + ' const int t = 2;\n' + + ' switch (${CONDITION})\n' + + ' {\n' + + ' case int(0.0): res = coords.xyz; break;\n' + + ' case 2-1: res = coords.wzy; break;\n' + + ' case 3&(1<<1): res = coords.yzw; break;\n' + + ' case t+1: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "default_label", "Default label usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' default: res = coords.yzw;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "default_not_last", "Default label usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' default: res = coords.yzw; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "no_default_label", "No match in switch without default label", + ' res = coords.yzw;\n\n' + + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "fall_through", "Fall-through", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2: coords = coords.yzwx;\n' + + ' case 4: res = vec3(coords); break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "fall_through_default", "Fall-through", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' case 2: coords = coords.yzwx;\n' + + ' default: res = vec3(coords);\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "conditional_fall_through", "Fall-through", + ' highp vec4 tmp = coords;\n' + + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2:\n' + + ' tmp = coords.yzwx;\n' + + ' case 3:\n' + + ' res = vec3(tmp);\n' + + ' if (${CONDITION} != 3)\n' + + ' break;\n' + + ' default: res = tmp.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "conditional_fall_through_2", "Fall-through", + ' highp vec4 tmp = coords;\n' + + ' mediump int c = ${CONDITION};\n' + + ' switch (c)\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2:\n' + + ' c += ${CONDITION};\n' + + ' tmp = coords.yzwx;\n' + + ' case 3:\n' + + ' res = vec3(tmp);\n' + + ' if (c == 4)\n' + + ' break;\n' + + ' default: res = tmp.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "scope", "Basic switch statement usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2:\n' + + ' {\n' + + ' mediump vec3 t = coords.yzw;\n' + + ' res = t;\n' + + ' break;\n' + + ' }\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_if", "Switch in for loop", + ' if (${CONDITION} >= 0)\n' + + ' {\n' + + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2: res = coords.yzw; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_for_loop", "Switch in for loop", + ' for (int i = 0; i <= ${CONDITION}; i++)\n' + + ' {\n' + + ' switch (i)\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2: res = coords.yzw; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_while_loop", "Switch in while loop", + ' int i = 0;\n' + + ' while (i <= ${CONDITION})\n' + + ' {\n' + + ' switch (i)\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2: res = coords.yzw; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n' + + ' i += 1;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_do_while_loop", "Switch in do-while loop", + ' int i = 0;\n' + + ' do\n' + + ' {\n' + + ' switch (i)\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' case 2: res = coords.yzw; break;\n' + + ' case 3: res = coords.zyx; break;\n' + + ' }\n' + + ' i += 1;\n' + + ' } while (i <= ${CONDITION});\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "if_in_switch", "Basic switch statement usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1: res = coords.wzy; break;\n' + + ' default:\n' + + ' if (${CONDITION} == 2)\n' + + ' res = coords.yzw;\n' + + ' else\n' + + ' res = coords.zyx;\n' + + ' break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "for_loop_in_switch", "Basic switch statement usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1:\n' + + ' case 2:\n' + + ' {\n' + + ' highp vec3 t = coords.yzw;\n' + + ' for (int i = 0; i < ${CONDITION}; i++)\n' + + ' t = t.zyx;\n' + + ' res = t;\n' + + ' break;\n' + + ' }\n' + + ' default: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "while_loop_in_switch", "Basic switch statement usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1:\n' + + ' case 2:\n' + + ' {\n' + + ' highp vec3 t = coords.yzw;\n' + + ' int i = 0;\n' + + ' while (i < ${CONDITION})\n' + + ' {\n' + + ' t = t.zyx;\n' + + ' i += 1;\n' + + ' }\n' + + ' res = t;\n' + + ' break;\n' + + ' }\n' + + ' default: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "do_while_loop_in_switch", "Basic switch statement usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1:\n' + + ' case 2:\n' + + ' {\n' + + ' highp vec3 t = coords.yzw;\n' + + ' int i = 0;\n' + + ' do\n' + + ' {\n' + + ' t = t.zyx;\n' + + ' i += 1;\n' + + ' } while (i < ${CONDITION});\n' + + ' res = t;\n' + + ' break;\n' + + ' }\n' + + ' default: res = coords.zyx; break;\n' + + ' }\n'); + + es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_switch", "Basic switch statement usage", + ' switch (${CONDITION})\n' + + ' {\n' + + ' case 0: res = coords.xyz; break;\n' + + ' case 1:\n' + + ' case 2:\n' + + ' switch (${CONDITION} - 1)\n' + + ' {\n' + + ' case 0: res = coords.wzy; break;\n' + + ' case 1: res = coords.yzw; break;\n' + + ' }\n' + + ' break;\n' + + ' default: res = coords.zyx; break;\n' + + '}\n'); + + // Negative cases. + // This is being tested somwhere else: data/gles3/shaders/switch.html + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fShaderSwitchTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderSwitchTests.ShaderSwitchTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderSwitchTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js new file mode 100644 index 000000000..5adcdf528 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js @@ -0,0 +1,2698 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fShaderTextureFunctionTests'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('modules.shared.glsShaderRenderCase'); + +goog.scope(function() { + var es3fShaderTextureFunctionTests = functional.gles3.es3fShaderTextureFunctionTests; + var deMath = framework.delibs.debase.deMath; + var tcuMatrix = framework.common.tcuMatrix; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var gluTexture = framework.opengl.gluTexture; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + + /** + * @enum + */ + es3fShaderTextureFunctionTests.TexFunction = { + TEXTURE: 0, //!< texture(), textureOffset() + TEXTUREPROJ: 1, //!< textureProj(), textureProjOffset() + TEXTUREPROJ3: 2, //!< textureProj(sampler2D, vec3) + TEXTURELOD: 3, // ... + TEXTUREPROJLOD: 4, + TEXTUREPROJLOD3: 5, //!< textureProjLod(sampler2D, vec3) + TEXTUREGRAD: 6, + TEXTUREPROJGRAD: 7, + TEXTUREPROJGRAD3: 8, //!< textureProjGrad(sampler2D, vec3) + TEXELFETCH: 9 + }; + + /** + * @param {gluShaderProgram.shaderType} shaderType + * @param {es3fShaderTextureFunctionTests.TexFunction} function_ + * @return {boolean} + */ + es3fShaderTextureFunctionTests.functionHasAutoLod = function(shaderType, function_) { + return shaderType === gluShaderProgram.shaderType.FRAGMENT && + (function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTURE || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3); + }; + + /** + * @param {es3fShaderTextureFunctionTests.TexFunction} function_ + * @return {boolean} + */ + es3fShaderTextureFunctionTests.functionHasProj = function(function_) { + return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3 || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3 || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3; + }; + + /** + * @param {es3fShaderTextureFunctionTests.TexFunction} function_ + * @return {boolean} + */ + es3fShaderTextureFunctionTests.functionHasGrad = function(function_) { + return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3; + }; + + /** + * @param {es3fShaderTextureFunctionTests.TexFunction} function_ + * @return {boolean} + */ + es3fShaderTextureFunctionTests.functionHasLod = function(function_) { + return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3 || + function_ === es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH; + }; + + /** + * @struct + * @constructor + * @param {es3fShaderTextureFunctionTests.TexFunction} func + * @param {Array} minCoord + * @param {Array} maxCoord + * @param {boolean} useBias + * @param {number} minLodBias + * @param {number} maxLodBias + * @param {Array} minDX For *Grad* functions + * @param {Array} maxDX For *Grad* functions + * @param {Array} minDY For *Grad* functions + * @param {Array} maxDY For *Grad* functions + * @param {boolean} useOffset + * @param {Array} offset + */ + es3fShaderTextureFunctionTests.TextureLookupSpec = function(func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, minDX, maxDX, minDY, maxDY, useOffset, offset) { + /** @type {es3fShaderTextureFunctionTests.TexFunction} */ this.func = func; + /** @type {Array} */ this.minCoord = minCoord; + /** @type {Array} */ this.maxCoord = maxCoord; + // Bias + /** @type {boolean} */ this.useBias = useBias; + // Bias or Lod for *Lod* functions + /** @type {number} */ this.minLodBias = minLodBias; + /** @type {number} */ this.maxLodBias = maxLodBias; + // For *Grad* functions + /** @type {Array} */ this.minDX = minDX; + /** @type {Array} */ this.maxDX = maxDX; + /** @type {Array} */ this.minDY = minDY; + /** @type {Array} */ this.maxDY = maxDY; + /** @type {boolean} */ this.useOffset = useOffset; + /** @type {Array} */ this.offset = offset; + }; + + /** + * @enum + */ + es3fShaderTextureFunctionTests.TextureType = { + TEXTURETYPE_2D: 0, + TEXTURETYPE_CUBE_MAP: 1, + TEXTURETYPE_2D_ARRAY: 2, + TEXTURETYPE_3D: 3 + }; + + /** + * @struct + * @constructor + * @param {?es3fShaderTextureFunctionTests.TextureType} type + * @param {number} format + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} numLevels + * @param {?tcuTexture.Sampler} sampler + */ + es3fShaderTextureFunctionTests.TextureSpec = function(type, format, width, height, depth, numLevels, sampler) { + /** @type {?es3fShaderTextureFunctionTests.TextureType} */ this.type = type; //!< Texture type (2D, cubemap, ...) + /** @type {number} */ this.format = format; //!< Internal format. + /** @type {number} */ this.width = width; + /** @type {number} */ this.height = height; + /** @type {number} */ this.depth = depth; + /** @type {number} */ this.numLevels = numLevels; + /** @type {?tcuTexture.Sampler} */ this.sampler = sampler; + }; + + /** + * @struct + * @constructor + */ + es3fShaderTextureFunctionTests.TexLookupParams = function() { + /** @type {number} */ this.lod = 0; + /** @type {Array} */ this.offset = [0, 0, 0]; + /** @type {Array} */ this.scale = [1.0, 1.0, 1.0, 1.0]; + /** @type {Array} */ this.bias = [0.0, 0.0, 0.0, 0.0]; + }; + + /** + * @enum + */ + es3fShaderTextureFunctionTests.LodMode = { + EXACT: 0, + MIN_BOUND: 1, + MAX_BOUND: 2 + }; + + /** @const {es3fShaderTextureFunctionTests.LodMode} */ es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE = es3fShaderTextureFunctionTests.LodMode.EXACT; + + /** + * @param {number} dudx + * @param {number} dvdx + * @param {number} dudy + * @param {number} dvdy + * @return {number} + */ + es3fShaderTextureFunctionTests.computeLodFromDerivates_UV = function(dudx, dvdx, dudy, dvdy) { + /** @type {es3fShaderTextureFunctionTests.LodMode} */ var mode = es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE; + /** @type {number} */ var p; + + switch (mode) { + case es3fShaderTextureFunctionTests.LodMode.EXACT: + p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx), Math.sqrt(dudy * dudy + dvdy * dvdy)); + break; + + case es3fShaderTextureFunctionTests.LodMode.MIN_BOUND: + case es3fShaderTextureFunctionTests.LodMode.MAX_BOUND: + /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy)); + /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy)); + + p = mode === es3fShaderTextureFunctionTests.LodMode.MIN_BOUND ? Math.max(mu, mv) : mu + mv; + break; + + default: + throw new Error('LOD_MODE not supported.'); + } + + return Math.log2(p); + }; + + /** + * @param {number} dudx + * @param {number} dvdx + * @param {number} dwdx + * @param {number} dudy + * @param {number} dvdy + * @param {number} dwdy + * @return {number} + */ + es3fShaderTextureFunctionTests.computeLodFromDerivates_UVW = function(dudx, dvdx, dwdx, dudy, dvdy, dwdy) { + /** @type {es3fShaderTextureFunctionTests.LodMode} */ var mode = es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE; + /** @type {number} */ var p; + + switch (mode) { + case es3fShaderTextureFunctionTests.LodMode.EXACT: + p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx + dwdx * dwdx), Math.sqrt(dudy * dudy + dvdy * dvdy + dwdy * dwdy)); + break; + + case es3fShaderTextureFunctionTests.LodMode.MIN_BOUND: + case es3fShaderTextureFunctionTests.LodMode.MAX_BOUND: + /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy)); + /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy)); + /** @type {number} */ var mw = Math.max(Math.abs(dwdx), Math.abs(dwdy)); + + p = mode === es3fShaderTextureFunctionTests.LodMode.MIN_BOUND ? Math.max(mu, mv, mw) : (mu + mv + mw); + break; + + default: + throw new Error('LOD_MODE not supported.'); + } + + return Math.log2(p); + }; + + /** + * [dag] Wrapper function for computeLodFromDerivates_UV or computeLodFromDerivates_UVW + * @param {number} dudx + * @param {number} dvdx + * @param {number} dwdxOrdudy + * @param {number} dudyOrdvdy + * @param {number=} dvdy + * @param {number=} dwdy + * @return {number} + */ + es3fShaderTextureFunctionTests.computeLodFromDerivates = function(dudx, dvdx, dwdxOrdudy, dudyOrdvdy, dvdy, dwdy) { + if (arguments.length === 4) + return es3fShaderTextureFunctionTests.computeLodFromDerivates_UV(dudx, dvdx, dwdxOrdudy, dudyOrdvdy); + else + return es3fShaderTextureFunctionTests.computeLodFromDerivates_UVW(dudx, dvdx, dwdxOrdudy, dudyOrdvdy, /** @type {number} */ (dvdy), /** @type {number} */ (dwdy)); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @return {number} + */ + es3fShaderTextureFunctionTests.computeLodFromGrad2D = function(c) { + /** @type {number} */ var w = c.textures[0].tex2D.getWidth(); + /** @type {number} */ var h = c.textures[0].tex2D.getHeight(); + return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[2][0] * w, c.in_[2][1] * h); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @return {number} + */ + es3fShaderTextureFunctionTests.computeLodFromGrad2DArray = function(c) { + /** @type {number} */ var w = c.textures[0].tex2DArray.getWidth(); + /** @type {number} */ var h = c.textures[0].tex2DArray.getHeight(); + return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[2][0] * w, c.in_[2][1] * h); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @return {number} + */ + es3fShaderTextureFunctionTests.computeLodFromGrad3D = function(c) { + /** @type {number} */ var w = c.textures[0].tex3D.getWidth(); + /** @type {number} */ var h = c.textures[0].tex3D.getHeight(); + /** @type {number} */ var d = c.textures[0].tex3D.getDepth(); + return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[1][2] * d, c.in_[2][0] * w, c.in_[2][1] * h, c.in_[2][2] * d); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @return {number} + */ + es3fShaderTextureFunctionTests.computeLodFromGradCube = function(c) { + // \note Major axis is always -Z or +Z + /** @type {number} */ var m = Math.abs(c.in_[0][2]); + /** @type {number} */ var d = c.textures[0].texCube.getSize(); + /** @type {number} */ var s = d / (2.0 * m); + /** @type {number} */ var t = d / (2.0 * m); + return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * s, c.in_[1][1] * t, c.in_[2][0] * s, c.in_[2][1] * t); + }; + + /** @typedef {function(glsShaderRenderCase.ShaderEvalContext, es3fShaderTextureFunctionTests.TexLookupParams)} */ es3fShaderTextureFunctionTests.TexEvalFunc; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} s + * @param {number} t + * @param {number} lod + * @return {Array} + */ + es3fShaderTextureFunctionTests.texture2D = function(c, s, t, lod) { + return c.textures[0].tex2D.getView().sample(c.textures[0].sampler, [s, t], lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @return {Array} + */ + es3fShaderTextureFunctionTests.textureCube = function(c, s, t, r, lod) { + return c.textures[0].texCube.getView().sample(c.textures[0].sampler, [s, t, r], lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @return {Array} + */ + es3fShaderTextureFunctionTests.texture2DArray = function(c, s, t, r, lod) { + return c.textures[0].tex2DArray.getView().sample(c.textures[0].sampler, [s, t, r], lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @return {Array} + */ + es3fShaderTextureFunctionTests.texture3D = function(c, s, t, r, lod) { + return c.textures[0].tex3D.getView().sample(c.textures[0].sampler, [s, t, r], lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number} lod + * @return {number} + */ + es3fShaderTextureFunctionTests.texture2DShadow = function(c, ref, s, t, lod) { + return c.textures[0].tex2D.getView().sampleCompare(c.textures[0].sampler, ref, [s, t], lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @return {number} + */ + es3fShaderTextureFunctionTests.textureCubeShadow = function(c, ref, s, t, r, lod) { + return c.textures[0].texCube.getView().sampleCompare(c.textures[0].sampler, ref, [s, t, r], lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @return {number} + */ + es3fShaderTextureFunctionTests.texture2DArrayShadow = function(c, ref, s, t, r, lod) { + return c.textures[0].tex2DArray.getView().sampleCompare(c.textures[0].sampler, ref, [s, t, r], lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} s + * @param {number} t + * @param {number} lod + * @param {Array} offset + * @return {Array} + */ + es3fShaderTextureFunctionTests.texture2DOffset = function(c, s, t, lod, offset) { + return c.textures[0].tex2D.getView().sampleOffset(c.textures[0].sampler, [s, t], lod, offset); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @param {Array} offset + * @return {Array} + */ + es3fShaderTextureFunctionTests.texture2DArrayOffset = function(c, s, t, r, lod, offset) { + return c.textures[0].tex2DArray.getView().sampleOffset(c.textures[0].sampler, [s, t, r], lod, offset); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @param {Array} offset + * @return {Array} + */ + es3fShaderTextureFunctionTests.texture3DOffset = function(c, s, t, r, lod, offset) { + return c.textures[0].tex3D.getView().sampleOffset(c.textures[0].sampler, [s, t, r], lod, offset); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number} lod + * @param {Array} offset + * @return {number} + */ + es3fShaderTextureFunctionTests.texture2DShadowOffset = function(c, ref, s, t, lod, offset) { + return c.textures[0].tex2D.getView().sampleCompareOffset(c.textures[0].sampler, ref, [s, t], lod, offset); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {number} ref + * @param {number} s + * @param {number} t + * @param {number} r + * @param {number} lod + * @param {Array} offset + * @return {number} + */ + es3fShaderTextureFunctionTests.texture2DArrayShadowOffset = function(c, ref, s, t, r, lod, offset) { + return c.textures[0].tex2DArray.getView().sampleCompareOffset(c.textures[0].sampler, ref, [s, t, r], lod, offset); + }; + + // Eval functions. + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2D = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], p.lod), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTextureCube = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArray = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3D = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTextureCubeBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProj3 = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProj3Bias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod+c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProj = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProj = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProjBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod+c.in_[1][0]), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DLod = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTextureCubeLod = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayLod = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DLod = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0]), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjLod3 = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjLod = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0]), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProjLod = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], c.in_[1][0]), p.scale), p.bias); + }; + + // Offset variants + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod, p.offset), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DOffsetBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DOffsetBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0], p.offset), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DLodOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DLodOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], c.in_[1][0], p.offset), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProj3Offset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod, deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProjOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod, p.offset), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], p.lod+c.in_[1][0], p.offset), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0], deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], c.in_[1][0], p.offset), p.scale), p.bias); + }; + + // Shadow variants + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadow = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod); + }; + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowBias = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0]); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTextureCubeShadow = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.textureCubeShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod); + }; + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTextureCubeShadowBias = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.textureCubeShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod+c.in_[1][0]); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayShadow = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DArrayShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowLod = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], c.in_[1][0]); + }; + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowLodOffset = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], c.in_[1][0], deMath.swizzle(p.offset, [0,1])); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProj = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod); + }; + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProjBias = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0]); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProjLod = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0]); + }; + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProjLodOffset = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[1][0], deMath.swizzle(p.offset, [0,1])); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowOffset = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod, deMath.swizzle(p.offset, [0,1])); + }; + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowOffsetBias = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffset = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod, deMath.swizzle(p.offset, [0,1])); + }; + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffsetBias = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], p.lod+c.in_[1][0], deMath.swizzle(p.offset, [0,1])); + }; + + // Gradient variarts + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DGrad = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTextureCubeGrad = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.textureCube(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGradCube(c)), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayGrad = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArray(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c)), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DGrad = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c)), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowGrad = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTextureCubeShadowGrad = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.textureCubeShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGradCube(c)); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGrad = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DArrayShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c)); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DGradOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DArrayOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DGradOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c), p.offset), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowGradOffset = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGradOffset = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DArrayShadowOffset(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2DArray(c), deMath.swizzle(p.offset, [0,1])); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProjGrad = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DShadowProjGradOffset = function(c, p) { + c.color[0] = es3fShaderTextureFunctionTests.texture2DShadowOffset(c, c.in_[0][2]/c.in_[0][3], c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjGrad3 = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjGrad = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProjGrad = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3D(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c)), p.scale), p.bias); + }; + + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][2], c.in_[0][1]/c.in_[0][2], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c), deMath.swizzle(p.offset, [0,1])), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset = function(c, p) { + c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture3DOffset(c, c.in_[0][0]/c.in_[0][3], c.in_[0][1]/c.in_[0][3], c.in_[0][2]/c.in_[0][3], es3fShaderTextureFunctionTests.computeLodFromGrad3D(c), p.offset), p.scale), p.bias); + }; + + // Texel fetch variants + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexelFetch2D = function(c, p) { + /** @type {number} */ var x = Math.trunc(c.in_[0][0]) + p.offset[0]; + /** @type {number} */ var y = Math.trunc(c.in_[0][1]) + p.offset[1]; + /** @type {number} */ var lod = Math.trunc(c.in_[1][0]); + c.color = deMath.add(deMath.multiply(c.textures[0].tex2D.getLevel(lod).getPixel(x, y), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexelFetch2DArray = function(c, p) { + /** @type {number} */ var x = Math.trunc(c.in_[0][0]) + p.offset[0]; + /** @type {number} */ var y = Math.trunc(c.in_[0][1]) + p.offset[1]; + /** @type {number} */ var l = Math.trunc(c.in_[0][2]); + /** @type {number} */ var lod = Math.trunc(c.in_[1][0]); + c.color = deMath.add(deMath.multiply(c.textures[0].tex2DArray.getLevel(lod).getPixel(x, y, l), p.scale), p.bias); + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} c + * @param {es3fShaderTextureFunctionTests.TexLookupParams} p + */ + es3fShaderTextureFunctionTests.evalTexelFetch3D = function(c, p) { + /** @type {number} */ var x = Math.trunc(c.in_[0][0]) + p.offset[0]; + /** @type {number} */ var y = Math.trunc(c.in_[0][1]) + p.offset[1]; + /** @type {number} */ var z = Math.trunc(c.in_[0][2]) + p.offset[2]; + /** @type {number} */ var lod = Math.trunc(c.in_[1][0]); + c.color = deMath.add(deMath.multiply(c.textures[0].tex3D.getLevel(lod).getPixel(x, y, z), p.scale), p.bias); + }; + + /** + * @constructor + * @extends {glsShaderRenderCase.ShaderEvaluator} + * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc + * @param {es3fShaderTextureFunctionTests.TexLookupParams} lookupParams + */ + es3fShaderTextureFunctionTests.TexLookupEvaluator = function(evalFunc, lookupParams) { + /** @type {es3fShaderTextureFunctionTests.TexEvalFunc} */ this.m_evalFunc = evalFunc; + /** @type {es3fShaderTextureFunctionTests.TexLookupParams} */ this.m_lookupParams = lookupParams; + }; + + es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype = Object.create(glsShaderRenderCase.ShaderEvaluator.prototype); + es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype.constructor = es3fShaderTextureFunctionTests.TexLookupEvaluator; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} ctx + */ + es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype.evaluate = function(ctx) { + this.m_evalFunc(ctx, this.m_lookupParams); + }; + + /** + * @constructor + * @extends {glsShaderRenderCase.ShaderRenderCase} + * @param {string} name + * @param {string} desc + * @param {es3fShaderTextureFunctionTests.TextureLookupSpec} lookup + * @param {es3fShaderTextureFunctionTests.TextureSpec} texture + * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc + * @param {boolean} isVertexCase + */ + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase = function(name, desc, lookup, texture, evalFunc, isVertexCase) { + glsShaderRenderCase.ShaderRenderCase.call(this, name, desc, isVertexCase); + + /** @type {es3fShaderTextureFunctionTests.TextureLookupSpec} */ this.m_lookupSpec = lookup; + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.m_textureSpec = texture; + /** @type {es3fShaderTextureFunctionTests.TexLookupParams} */ this.m_lookupParams = new es3fShaderTextureFunctionTests.TexLookupParams(); + /** @type {es3fShaderTextureFunctionTests.TexLookupEvaluator} */ this.m_evaluator = new es3fShaderTextureFunctionTests.TexLookupEvaluator(evalFunc, this.m_lookupParams); + + /** @type {gluTexture.Texture2D} */ this.m_texture2D = null; + /** @type {gluTexture.TextureCube} */ this.m_textureCube = null; + /** @type {gluTexture.Texture2DArray} */ this.m_texture2DArray = null; + /** @type {gluTexture.Texture3D} */ this.m_texture3D = null; + }; + + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype); + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.constructor = es3fShaderTextureFunctionTests.ShaderTextureFunctionCase; + + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.init = function() { + + // Base coord scale & bias + /** @type {(Array|number)} */ var s = deMath.subtract(this.m_lookupSpec.maxCoord, this.m_lookupSpec.minCoord); + /** @type {(Array|number)} */ var b = this.m_lookupSpec.minCoord; + + /** @type {Array} */ var baseCoordTrans = [ + s[0], 0.0, 0.0, b[0], + 0.0, s[1], 0., b[1], + s[2]/2.0, -s[2]/2.0, 0.0, s[2]/2.0 + b[2], + -s[3]/2.0, s[3]/2.0, 0.0, s[3]/2.0 + b[3] + ]; + this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, baseCoordTrans)); + + /** @type {boolean} */ var hasLodBias = es3fShaderTextureFunctionTests.functionHasLod(this.m_lookupSpec.func) || this.m_lookupSpec.useBias; + /** @type {boolean} */ var isGrad = es3fShaderTextureFunctionTests.functionHasGrad(this.m_lookupSpec.func); + assertMsgOptions(!isGrad || !hasLodBias, 'Assert Error. expected: isGrad || hasLodBias === false', false, true); + + if (hasLodBias) { + s = this.m_lookupSpec.maxLodBias - this.m_lookupSpec.minLodBias; + b = this.m_lookupSpec.minLodBias; + /** @type {Array} */ var lodCoordTrans = [ + s/2.0, s/2.0, 0.0, b, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0 + ]; + + this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, lodCoordTrans)); + } + else if (isGrad) { + /** @type {Array} */ var sx = deMath.subtract(this.m_lookupSpec.maxDX, this.m_lookupSpec.minDX); + /** @type {Array} */ var sy = deMath.subtract(this.m_lookupSpec.maxDY, this.m_lookupSpec.minDY); + /** @type {Array} */ var gradDxTrans = [ + sx[0]/2.0, sx[0]/2.0, 0.0, this.m_lookupSpec.minDX[0], + sx[1]/2.0, sx[1]/2.0, 0.0, this.m_lookupSpec.minDX[1], + sx[2]/2.0, sx[2]/2.0, 0.0, this.m_lookupSpec.minDX[2], + 0.0, 0.0, 0.0, 0.0 + ]; + /** @type {Array} */ var gradDyTrans = [ + -sy[0]/2.0, -sy[0]/2.0, 0.0, this.m_lookupSpec.maxDY[0], + -sy[1]/2.0, -sy[1]/2.0, 0.0, this.m_lookupSpec.maxDY[1], + -sy[2]/2.0, -sy[2]/2.0, 0.0, this.m_lookupSpec.maxDY[2], + 0.0, 0.0, 0.0, 0.0 + ]; + + this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, gradDxTrans)); + this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, gradDyTrans)); + } + + this.initShaderSources(); + this.initTexture(); + + this.postinit(); + + }; + + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.initTexture = function() { + /** @type {Array>} */ var texCubeSwz = [ + [0, 0, 1, 1], + [1, 1, 0, 0], + [0, 1, 0, 1], + [1, 0, 1, 0], + [0, 1, 1, 0], + [1, 0, 0, 1] + ]; + + assertMsgOptions(texCubeSwz.length === 6, 'Cube should have 6 faces.', false, true); + + /** @type {number} */ var levelStep; + /** @type {Array} */ var cScale; + /** @type {Array} */ var cBias; + /** @type {number} */ var baseCellSize; + + /** @type {number} */ var fA; + /** @type {number} */ var fB; + /** @type {Array} */ var colorA; + /** @type {Array} */ var colorB; + + /** @type {number} */ var dudx; + /** @type {number} */ var dvdy; + + /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_textureSpec.format); + /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + /** @type {Array} */ var viewportSize = this.getViewportSize(); + /** @type {boolean} */ var isProj = es3fShaderTextureFunctionTests.functionHasProj(this.m_lookupSpec.func); + /** @type {boolean} */ var isAutoLod = es3fShaderTextureFunctionTests.functionHasAutoLod( + this.m_isVertexCase ? gluShaderProgram.shaderType.VERTEX : gluShaderProgram.shaderType.FRAGMENT, + this.m_lookupSpec.func); // LOD can vary significantly + /** @type {number} */ var proj = isProj ? + 1.0 / this.m_lookupSpec.minCoord[this.m_lookupSpec.func === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3 ? 2 : 3] : + 1.0; + + switch (this.m_textureSpec.type) { + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D: + levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1); + cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin); + cBias = fmtInfo.valueMin; + baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4); + + this.m_texture2D = gluTexture.texture2DFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width, this.m_textureSpec.height); + for (var level = 0; level < this.m_textureSpec.numLevels; level++) { + fA = level * levelStep; + fB = 1.0 - fA; + colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB])); + colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA])); + + this.m_texture2D.getRefTexture().allocLevel(level); + tcuTextureUtil.fillWithGrid(this.m_texture2D.getRefTexture().getLevel(level), Math.max(1, baseCellSize >> level), colorA, colorB); + } + this.m_texture2D.upload(); + + // Compute LOD. + dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0]; + dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1]; + this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy); + + // Append to texture list. + this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture2D, this.m_textureSpec.sampler)); + break; + + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP: + levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1); + cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin); + cBias = fmtInfo.valueMin; + /** @type {Array} */ var cCorner = deMath.add(cBias, deMath.scale(cScale, 0.5)); + baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4); + + assertMsgOptions(this.m_textureSpec.width === this.m_textureSpec.height, 'Expected width === height', false, true); + this.m_textureCube = gluTexture.cubeFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width); + for (var level = 0; level < this.m_textureSpec.numLevels; level++) { + fA = level * levelStep; + fB = 1.0 - fA; + /** @type {Array} */ var f = [fA, fB]; + + for (var face = 0; face < 6; face++) { + /** @type {Array} */ var swzA = texCubeSwz[face]; + /** @type {Array} */ var swzB = deMath.subtract([1, 1, 1, 1], swzA); + colorA = deMath.add(cBias, deMath.multiply(cScale, deMath.swizzle(f, [swzA[0], swzA[1], swzA[2], swzA[3]]))); + colorB = deMath.add(cBias, deMath.multiply(cScale, deMath.swizzle(f, [swzB[0], swzB[1], swzB[2], swzB[3]]))); + + this.m_textureCube.getRefTexture().allocLevel(face, level); + + /** @type {tcuTexture.PixelBufferAccess} */ var access = this.m_textureCube.getRefTexture().getLevelFace(level, face); + /** @type {number} */ var lastPix = access.getWidth() - 1; + + tcuTextureUtil.fillWithGrid(access, Math.max(1, baseCellSize >> level), colorA, colorB); + + // Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering + access.setPixel(cCorner, 0, 0); + access.setPixel(cCorner, 0, lastPix); + access.setPixel(cCorner, lastPix, 0); + access.setPixel(cCorner, lastPix, lastPix); + } + } + this.m_textureCube.upload(); + + // Compute LOD \note Assumes that only single side is accessed and R is constant major axis. + assertMsgOptions(Math.abs(this.m_lookupSpec.minCoord[2] - this.m_lookupSpec.maxCoord[2]) < 0.005, 'Expected abs(minCoord-maxCoord) < 0.005', false, true); + assertMsgOptions(Math.abs(this.m_lookupSpec.minCoord[0]) < Math.abs(this.m_lookupSpec.minCoord[2]) && Math.abs(this.m_lookupSpec.maxCoord[0]) < Math.abs(this.m_lookupSpec.minCoord[2]), 'Assert error: minCoord, maxCoord', false, true); + assertMsgOptions(Math.abs(this.m_lookupSpec.minCoord[1]) < Math.abs(this.m_lookupSpec.minCoord[2]) && Math.abs(this.m_lookupSpec.maxCoord[1]) < Math.abs(this.m_lookupSpec.minCoord[2]), 'Assert error: minCoord, maxCoord', false, true); + + /** @type {tcuTexture.CubeFaceCoords} */ var c00 = tcuTexture.getCubeFaceCoords([this.m_lookupSpec.minCoord[0] * proj, this.m_lookupSpec.minCoord[1] * proj, this.m_lookupSpec.minCoord[2] * proj]); + /** @type {tcuTexture.CubeFaceCoords} */ var c10 = tcuTexture.getCubeFaceCoords([this.m_lookupSpec.maxCoord[0] * proj, this.m_lookupSpec.minCoord[1] * proj, this.m_lookupSpec.minCoord[2] * proj]); + /** @type {tcuTexture.CubeFaceCoords} */ var c01 = tcuTexture.getCubeFaceCoords([this.m_lookupSpec.minCoord[0] * proj, this.m_lookupSpec.maxCoord[1] * proj, this.m_lookupSpec.minCoord[2] * proj]); + dudx = (c10.s - c00.s) * this.m_textureSpec.width / viewportSize[0]; + dvdy = (c01.t - c00.t) * this.m_textureSpec.height / viewportSize[1]; + + this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy); + + this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_textureCube, this.m_textureSpec.sampler)); + break; + + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY: + /** @type {number} */ var layerStep = 1.0 / this.m_textureSpec.depth; + levelStep = isAutoLod ? 0.0 : 1.0 / (Math.max(1, this.m_textureSpec.numLevels - 1) * this.m_textureSpec.depth); + cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin); + cBias = fmtInfo.valueMin; + baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4); + + this.m_texture2DArray = gluTexture.texture2DArrayFromInternalFormat(gl, + this.m_textureSpec.format, + this.m_textureSpec.width, + this.m_textureSpec.height, + this.m_textureSpec.depth); + + for (var level = 0; level < this.m_textureSpec.numLevels; level++) { + this.m_texture2DArray.getRefTexture().allocLevel(level); + /** @type {tcuTexture.PixelBufferAccess} */ var levelAccess = this.m_texture2DArray.getRefTexture().getLevel(level); + + for (var layer = 0; layer < levelAccess.getDepth(); layer++) { + fA = layer * layerStep + level * levelStep; + fB = 1.0 - fA; + colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB])); + colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA])); + + tcuTextureUtil.fillWithGrid(tcuTextureUtil.getSubregion(levelAccess, 0, 0, layer, levelAccess.getWidth(), levelAccess.getHeight(), 1), Math.max(1, baseCellSize >> level), colorA, colorB); + } + } + this.m_texture2DArray.upload(); + + // Compute LOD. + dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0]; + dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1]; + this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy); + + // Append to texture list. + this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture2DArray, this.m_textureSpec.sampler)); + break; + + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D: + levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1); + cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin); + cBias = fmtInfo.valueMin; + baseCellSize = Math.min(this.m_textureSpec.width / 2, this.m_textureSpec.height / 2, this.m_textureSpec.depth / 2); + + this.m_texture3D = gluTexture.texture3DFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width, this.m_textureSpec.height, this.m_textureSpec.depth); + for (var level = 0; level < this.m_textureSpec.numLevels; level++) { + fA = level * levelStep; + fB = 1.0 - fA; + colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB])); + colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA])); + + this.m_texture3D.getRefTexture().allocLevel(level); + tcuTextureUtil.fillWithGrid(this.m_texture3D.getRefTexture().getLevel(level), Math.max(1, baseCellSize >> level), colorA, colorB); + } + this.m_texture3D.upload(); + + // Compute LOD. + dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0]; + dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1]; + /** @type {number} */ var dwdx = (this.m_lookupSpec.maxCoord[2] - this.m_lookupSpec.minCoord[2]) * 0.5 * proj * this.m_textureSpec.depth / viewportSize[0]; + /** @type {number} */ var dwdy = (this.m_lookupSpec.maxCoord[2] - this.m_lookupSpec.minCoord[2]) * 0.5 * proj * this.m_textureSpec.depth / viewportSize[1]; + this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, dwdx, 0.0, dvdy, dwdy); + + // Append to texture list. + this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture3D, this.m_textureSpec.sampler)); + break; + + default: + throw new Error('Texture type not supported.'); + } + + // Set lookup scale & bias + this.m_lookupParams.scale = fmtInfo.lookupScale; + this.m_lookupParams.bias = fmtInfo.lookupBias; + this.m_lookupParams.offset = this.m_lookupSpec.offset; + }; + + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.initShaderSources = function() { + /** @type {es3fShaderTextureFunctionTests.TexFunction} */ var function_ = this.m_lookupSpec.func; + /** @type {boolean} */ var isVtxCase = this.m_isVertexCase; + /** @type {boolean} */ var isProj = es3fShaderTextureFunctionTests.functionHasProj(function_); + /** @type {boolean} */ var isGrad = es3fShaderTextureFunctionTests.functionHasGrad(function_); + /** @type {boolean} */ var isShadow = this.m_textureSpec.sampler.compare !== tcuTexture.CompareMode.COMPAREMODE_NONE; + /** @type {boolean} */ var is2DProj4 = !isShadow && this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D && (function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ || function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD || function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD); + /** @type {boolean} */ var isIntCoord = function_ === es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH; + /** @type {boolean} */ var hasLodBias = es3fShaderTextureFunctionTests.functionHasLod(this.m_lookupSpec.func) || this.m_lookupSpec.useBias; + /** @type {number} */ var texCoordComps = this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D ? 2 : 3; + /** @type {number} */ var extraCoordComps = (isProj ? (is2DProj4 ? 2 : 1) : 0) + (isShadow ? 1 : 0); + /** @type {gluShaderUtil.DataType} */ var coordType = gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, texCoordComps+extraCoordComps); + /** @type {gluShaderUtil.precision} */ var coordPrec = gluShaderUtil.precision.PRECISION_HIGHP; + /** @type {string} */ var coordTypeName = gluShaderUtil.getDataTypeName(coordType); + /** @type {string} */ var coordPrecName = gluShaderUtil.getPrecisionName(coordPrec); + /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_textureSpec.format); + /** @type {?gluShaderUtil.DataType} */ var samplerType = null; + /** @type {gluShaderUtil.DataType} */ var gradType = (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP || this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D) ? gluShaderUtil.DataType.FLOAT_VEC3 : gluShaderUtil.DataType.FLOAT_VEC2; + /** @type {string} */ var gradTypeName = gluShaderUtil.getDataTypeName(gradType); + /** @type {string} */ var baseFuncName = ''; + + assertMsgOptions(!isGrad || !hasLodBias, 'Expected !isGrad || !hasLodBias', false, true); + + switch (this.m_textureSpec.type) { + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D: + samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_2D_SHADOW : gluTextureUtil.getSampler2DType(texFmt); + break; + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP: + samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW : gluTextureUtil.getSamplerCubeType(texFmt); + break; + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY: + samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW : gluTextureUtil.getSampler2DArrayType(texFmt); + break; + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D: + assertMsgOptions(!isShadow, 'Expected !isShadow', false, true); + samplerType = gluTextureUtil.getSampler3DType(texFmt); + break; + default: + throw new Error('Unexpected type.'); + } + + switch (this.m_lookupSpec.func) { + case es3fShaderTextureFunctionTests.TexFunction.TEXTURE: baseFuncName = 'texture'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ: baseFuncName = 'textureProj'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3: baseFuncName = 'textureProj'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD: baseFuncName = 'textureLod'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD: baseFuncName = 'textureProjLod'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3: baseFuncName = 'textureProjLod'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD: baseFuncName = 'textureGrad'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD: baseFuncName = 'textureProjGrad'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3: baseFuncName = 'textureProjGrad'; break; + case es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH: baseFuncName = 'texelFetch'; break; + default: + throw new Error('Unexpected function.'); + } + + /** @type {string} */ var vert = ''; + /** @type {string} */ var frag = ''; + /** @type {string} */ var op = ''; + + vert += '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'in ' + coordPrecName + ' ' + coordTypeName + ' a_in0;\n'; + + if (isGrad) { + vert += 'in ' + coordPrecName + ' ' + gradTypeName + ' a_in1;\n'; + vert += 'in ' + coordPrecName + ' ' + gradTypeName + ' a_in2;\n'; + } + else if (hasLodBias) + vert += 'in ' + coordPrecName + ' float a_in1;\n'; + + frag += '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (isVtxCase) { + vert += 'out mediump vec4 v_color;\n'; + frag += 'in mediump vec4 v_color;\n'; + } + else + { + vert += 'out ' + coordPrecName + ' ' + coordTypeName + ' v_texCoord;\n'; + frag += 'in ' + coordPrecName + ' ' + coordTypeName + ' v_texCoord;\n'; + + if (isGrad) { + vert += 'out ' + coordPrecName + ' ' + gradTypeName + ' v_gradX;\n'; + vert += 'out ' + coordPrecName + ' ' + gradTypeName + ' v_gradY;\n'; + frag += 'in ' + coordPrecName + ' ' + gradTypeName + ' v_gradX;\n'; + frag += 'in ' + coordPrecName + ' ' + gradTypeName + ' v_gradY;\n'; + } + + if (hasLodBias) { + vert += 'out ' + coordPrecName + ' float v_lodBias;\n'; + frag += 'in ' + coordPrecName + ' float v_lodBias;\n'; + } + } + + // Uniforms + op += 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler;\n' + + 'uniform highp vec4 u_scale;\n' + + 'uniform highp vec4 u_bias;\n'; + + vert += isVtxCase ? op : ''; + frag += isVtxCase ? '' : op; + op = ''; + + vert += '\nvoid main()\n{\n' + + '\tgl_Position = a_position;\n'; + frag += '\nvoid main()\n{\n'; + + if (isVtxCase) + vert += '\tv_color = '; + else + frag += '\to_color = '; + + // Op. + /** @type {string} */ var texCoord = isVtxCase ? 'a_in0' : 'v_texCoord'; + /** @type {string} */ var gradX = isVtxCase ? 'a_in1' : 'v_gradX'; + /** @type {string} */ var gradY = isVtxCase ? 'a_in2' : 'v_gradY'; + /** @type {string} */ var lodBias = isVtxCase ? 'a_in1' : 'v_lodBias'; + + op += 'vec4(' + baseFuncName; + if (this.m_lookupSpec.useOffset) + op += 'Offset'; + op += '(u_sampler, '; + + if (isIntCoord) + op += 'ivec' + (texCoordComps+extraCoordComps) + '('; + + op += texCoord; + + if (isIntCoord) + op += ')'; + + if (isGrad) + op += ', ' + gradX + ', ' + gradY; + + if (es3fShaderTextureFunctionTests.functionHasLod(function_)) { + if (isIntCoord) + op += ', int(' + lodBias + ')'; + else + op += ', ' + lodBias; + } + + if (this.m_lookupSpec.useOffset) { + /** @type {number} */ var offsetComps = this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D ? 3 : 2; + + op += ', ivec' + offsetComps + '('; + for (var ndx = 0; ndx < offsetComps; ndx++) { + if (ndx !== 0) + op += ', '; + op += this.m_lookupSpec.offset[ndx]; + } + op += ')'; + } + + if (this.m_lookupSpec.useBias) + op += ', ' + lodBias; + + op += ')'; + + if (isShadow) + op += ', 0.0, 0.0, 1.0)'; + else + op += ')*u_scale + u_bias'; + + op += ';\n'; + + vert += isVtxCase ? op : ''; + frag += isVtxCase ? '' : op; + op = ''; + + if (isVtxCase) + frag += '\to_color = v_color;\n'; + else { + vert += '\tv_texCoord = a_in0;\n'; + + if (isGrad) { + vert += '\tv_gradX = a_in1;\n'; + vert += '\tv_gradY = a_in2;\n'; + } + else if (hasLodBias) + vert += '\tv_lodBias = a_in1;\n'; + } + + vert += '}\n'; + frag += '}\n'; + + this.m_vertShaderSource = vert; + this.m_fragShaderSource = frag; + }; + + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.deinit = function() { + this.m_program = null; + this.m_texture2D = null; + this.m_textureCube = null; + this.m_texture2DArray = null; + this.m_texture3D = null; + }; + + /** + * @param {WebGLProgram} programID + * @param {Array} constCoords + */ + es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.setupUniforms = function(programID, constCoords) { + gl.uniform1i(gl.getUniformLocation(programID, 'u_sampler'), 0); + gl.uniform4fv(gl.getUniformLocation(programID, 'u_scale'), this.m_lookupParams.scale); + gl.uniform4fv(gl.getUniformLocation(programID, 'u_bias'), this.m_lookupParams.bias); + }; + + + /** + * @struct + * @constructor + * @param {Array} textureSize + * @param {number} lod + * @param {number} lodBase + * @param {Array} expectedSize + */ + es3fShaderTextureFunctionTests.TestSize = function(textureSize, lod, lodBase, expectedSize) { + /** @type {Array} */ this.textureSize = textureSize; + /** @type {number} */ this.lod = lod; + /** @type {number} */ this.lodBase = lodBase; + /** @type {Array} */ this.expectedSize = expectedSize; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {string} samplerType + * @param {es3fShaderTextureFunctionTests.TextureSpec} texture + * @param {boolean} isVertexCase + */ + es3fShaderTextureFunctionTests.TextureSizeCase = function(name, desc, samplerType, texture, isVertexCase) { + tcuTestCase.DeqpTest.call(this, name, desc); + /** @type {string} */ this.m_samplerTypeStr = samplerType; + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.m_textureSpec = texture; + /** @type {boolean} */ this.m_isVertexCase = isVertexCase; + /** @type {boolean} */ this.m_has3DSize = texture.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D || texture.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY; + /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {number} */ this.m_iterationCounter = 0; + }; + + es3fShaderTextureFunctionTests.TextureSizeCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.constructor = es3fShaderTextureFunctionTests.TextureSizeCase; + + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.deinit = function() { + this.freeShader(); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.iterate = function() { + /** @type {number} */ var currentIteration = this.m_iterationCounter++; + /** @type {Array} */ var testSizes = [ + new es3fShaderTextureFunctionTests.TestSize([1, 2, 1], 1, 0, [1, 1, 1]), + new es3fShaderTextureFunctionTests.TestSize([1, 2, 1], 0, 0, [1, 2, 1]), + + new es3fShaderTextureFunctionTests.TestSize([1, 3, 2], 0, 0, [1, 3, 2]), + new es3fShaderTextureFunctionTests.TestSize([1, 3, 2], 1, 0, [1, 1, 1]), + + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 0, 0, [100, 31, 18]), + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 1, 0, [50, 15, 9]), + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 2, 0, [25, 7, 4]), + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 3, 0, [12, 3, 2]), + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 4, 0, [6, 1, 1]), + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 5, 0, [3, 1, 1]), + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 6, 0, [1, 1, 1]), + + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 0, 0, [100, 128, 32]), + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 1, 0, [50, 64, 16]), + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 2, 0, [25, 32, 8]), + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 3, 0, [12, 16, 4]), + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 4, 0, [6, 8, 2]), + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 5, 0, [3, 4, 1]), + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 6, 0, [1, 2, 1]), + new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 7, 0, [1, 1, 1]), + + // pow 2 + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 0, 0, [128, 64, 32]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 1, 0, [64, 32, 16]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 2, 0, [32, 16, 8]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 3, 0, [16, 8, 4]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 4, 0, [8, 4, 2]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 5, 0, [4, 2, 1]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 6, 0, [2, 1, 1]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 7, 0, [1, 1, 1]), + + // w === h + new es3fShaderTextureFunctionTests.TestSize([1, 1, 1], 0, 0, [1, 1, 1]), + new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 0, 0, [64, 64, 64]), + new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 1, 0, [32, 32, 32]), + new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 2, 0, [16, 16, 16]), + new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 3, 0, [8, 8, 8]), + new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 4, 0, [4, 4, 4]), + + // with lod base + new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 3, 1, [6, 1, 1]), + new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 3, 1, [8, 4, 2]), + new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 1, 1, [16, 16, 16]) + + ]; + /** @type {number} */ var lastIterationIndex = testSizes.length + 1; + + if (currentIteration === 0) { + return this.initShader() ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP; + } + else if (currentIteration === lastIterationIndex) { + this.freeShader(); + return tcuTestCase.IterateResult.STOP; + } + else { + if (!this.testTextureSize(testSizes[currentIteration - 1])) + testFailedOptions('Fail: Case ' + (currentIteration - 1) + ' Got unexpected texture size', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.CONTINUE; + } + }; + + /** + * @return {boolean} + */ + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.initShader = function() { + /** @type {string} */ var vertSrc = this.genVertexShader(); + /** @type {string} */ var fragSrc = this.genFragmentShader(); + + assertMsgOptions(this.m_program === null, 'Program should be null', false, true); + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertSrc, fragSrc)); + + if (!this.m_program.isOk()) { + testFailedOptions('Fail: Shader failed', false); + return false; + } + + return true; + }; + + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.freeShader = function() { + this.m_program = null; + }; + + /** + * @param {es3fShaderTextureFunctionTests.TestSize} testSize + * @return {boolean} + */ + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.testTextureSize = function(testSize) { + /** @type {Array} */ var triangle = [ // covers entire viewport + -1, -1, 0, 1, // was a 3x4 matrix + 4, -1, 0, 1, + -1, 4, 0, 1 + ]; + + /** @type {number} */ var positionLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + /** @type {WebGLUniformLocation} */ var samplerLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler'); + /** @type {WebGLUniformLocation} */ var sizeLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_texSize'); + /** @type {WebGLUniformLocation} */ var lodLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_lod'); + /** @type {number} */ var textureTarget = this.getGLTextureTarget(); + /** @type {boolean} */ var isSquare = testSize.textureSize[0] === testSize.textureSize[1]; + /** @type {boolean} */ var is2DLodValid = (testSize.textureSize[0] >> (testSize.lod + testSize.lodBase)) !== 0 || (testSize.textureSize[1] >> (testSize.lod + testSize.lodBase)) !== 0; + /** @type {boolean} */ var success = true; + /** @type {number} */ var errorValue; + + // Skip incompatible cases + if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP && !isSquare) + return true; + if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D && !is2DLodValid) + return true; + if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY && !is2DLodValid) + return true; + + // setup rendering + gl.useProgram(this.m_program.getProgram()); + gl.uniform1i(samplerLoc, 0); + gl.clearColor(0.5, 0.5, 0.5, 1.0); + gl.viewport(0, 0, 1, 1); + + /** @type {WebGLBuffer} */ var triangleGlBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, triangleGlBuffer); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangle), gl.STATIC_DRAW); + + gl.vertexAttribPointer(positionLoc, 4, gl.FLOAT, false, 0, 0); + gl.enableVertexAttribArray(positionLoc); + + // setup texture + /** @type {number} */ var maxLevel = testSize.lod + testSize.lodBase; + /** @type {number} */ var levels = maxLevel + 1; + /** @type {?WebGLTexture} */ var texId = null; + + // gen texture + texId = gl.createTexture(); + gl.bindTexture(textureTarget, texId); + gl.texParameteri(textureTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(textureTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(textureTarget, gl.TEXTURE_BASE_LEVEL, testSize.lodBase); + + // set up texture + + switch (this.m_textureSpec.type) { + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D: + // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1] + 'x' + testSize.textureSize[2]); + // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase); + // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1] + 'x' + testSize.expectedSize[2]); + + gl.uniform3iv(sizeLoc, testSize.expectedSize); + gl.uniform1iv(lodLoc, [testSize.lod]); + + gl.texStorage3D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1], testSize.textureSize[2]); + break; + + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D: + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP: + // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1]); + // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase); + // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1]); + + gl.uniform2iv(sizeLoc, testSize.expectedSize.slice(0,2)); + gl.uniform1iv(lodLoc, [testSize.lod]); + + gl.texStorage2D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1]); + break; + + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY: + /** @type {Array} */ var expectedSize = [testSize.expectedSize[0], testSize.expectedSize[1], testSize.textureSize[2]]; + + // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1] + ' with ' + testSize.textureSize[2] + ' layer(s)'); + // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase); + // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1] + ' and ' + testSize.textureSize[2] + ' layer(s)'); + + gl.uniform3iv(sizeLoc, expectedSize); + gl.uniform1iv(lodLoc, [testSize.lod]); + + gl.texStorage3D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1], testSize.textureSize[2]); + break; + + default: + throw new Error('Type not supported'); + } + + // test + /** @type {number} */ var colorTolerance = 0.1; + /** @type {tcuSurface.Surface} */ var sample = new tcuSurface.Surface(1, 1); + /** @type {Array} */ var outputColor; + + gl.clear(gl.COLOR_BUFFER_BIT); + gl.drawArrays(gl.TRIANGLES, 0, 3); + gl.finish(); + + sample.readViewport(gl, [0, 0, 1, 1]); + + outputColor = sample.getAccess().getPixel(0, 0); + + if (outputColor[0] >= 1.0 - colorTolerance && + outputColor[1] >= 1.0 - colorTolerance && + outputColor[2] >= 1.0 - colorTolerance) + bufferedLogToConsole('Passed'); + else { + // failure + bufferedLogToConsole('Failed'); + success = false; + } + + // free + gl.bindTexture(textureTarget, null); + gl.deleteTexture(texId); + + gl.useProgram(null); + + return success; + }; + + /** + * @return {string} + */ + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.genVertexShader = function() { + /** @type {string} */ var vert = ''; + vert += '#version 300 es\n' + + 'in highp vec4 a_position;\n'; + + if (this.m_isVertexCase) { + vert += 'out mediump vec4 v_color;\n' + + 'uniform highp ' + this.m_samplerTypeStr + ' u_sampler;\n' + + 'uniform highp ivec' + (this.m_has3DSize ? 3 : 2) + ' u_texSize;\n' + + 'uniform highp int u_lod;\n'; + } + + vert += 'void main()\n{\n'; + + if (this.m_isVertexCase) + vert += ' v_color = (textureSize(u_sampler, u_lod) == u_texSize ? vec4(1.0, 1.0, 1.0, 1.0) : vec4(0.0, 0.0, 0.0, 1.0));\n'; + + vert += ' gl_Position = a_position;\n' + + '}\n'; + + return vert; + }; + + /** + * @return {string} + */ + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.genFragmentShader = function() { + /** @type {string} */ var frag = ''; + + frag += '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n'; + + if (this.m_isVertexCase) + frag += 'in mediump vec4 v_color;\n'; + + if (!this.m_isVertexCase) { + frag += 'uniform highp ' + this.m_samplerTypeStr + ' u_sampler;\n' + + 'uniform highp ivec' + (this.m_has3DSize ? 3 : 2) + ' u_texSize;\n' + + 'uniform highp int u_lod;\n'; + } + + frag += 'void main()\n{\n'; + + if (!this.m_isVertexCase) + frag += ' o_color = (textureSize(u_sampler, u_lod) == u_texSize ? vec4(1.0, 1.0, 1.0, 1.0) : vec4(0.0, 0.0, 0.0, 1.0));\n'; + else + frag += ' o_color = v_color;\n'; + + frag += '}\n'; + + return frag; + }; + + /** + * @return {number} + */ + es3fShaderTextureFunctionTests.TextureSizeCase.prototype.getGLTextureTarget = function() { + switch (this.m_textureSpec.type) { + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D: + return gl.TEXTURE_2D; + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP: + return gl.TEXTURE_CUBE_MAP; + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY: + return gl.TEXTURE_2D_ARRAY; + case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D: + return gl.TEXTURE_3D; + default: + throw new Error('Texture Type not supported.'); + } + }; + + /** @typedef {Array} */ es3fShaderTextureFunctionTests.TestSpec; + + /** + * @param {string} name + * @param {es3fShaderTextureFunctionTests.TexFunction} func + * @param {Array} minCoord + * @param {Array} maxCoord + * @param {boolean} useBias + * @param {number} minLodBias + * @param {number} maxLodBias + * @param {boolean} useOffset + * @param {Array} offset + * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec + * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc + * @param {es3fShaderTextureFunctionTests.CaseFlags} flags + * @return {es3fShaderTextureFunctionTests.TexFuncCaseSpec} + */ + es3fShaderTextureFunctionTests.getCaseSpec = function(name, func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, useOffset, offset, texSpec, evalFunc, flags) { + return new es3fShaderTextureFunctionTests.TexFuncCaseSpec(name, + new es3fShaderTextureFunctionTests.TextureLookupSpec(func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], useOffset, offset), + texSpec, + evalFunc, + flags); + }; + + /** + * @param {string} name + * @param {es3fShaderTextureFunctionTests.TexFunction} func + * @param {Array} minCoord + * @param {Array} maxCoord + * @param {Array} mindx + * @param {Array} maxdx + * @param {Array} mindy + * @param {Array} maxdy + * @param {boolean} useOffset + * @param {Array} offset + * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec + * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc + * @param {es3fShaderTextureFunctionTests.CaseFlags} flags + * @return {es3fShaderTextureFunctionTests.TexFuncCaseSpec} + */ + es3fShaderTextureFunctionTests.getGradCaseSpec = function(name, func, minCoord, maxCoord, mindx, maxdx, mindy, maxdy, useOffset, offset, texSpec, evalFunc, flags) { + return new es3fShaderTextureFunctionTests.TexFuncCaseSpec(name, + new es3fShaderTextureFunctionTests.TextureLookupSpec(func, minCoord, maxCoord, false, 0.0, 0.0, mindx, maxdx, mindy, maxdy, useOffset, offset), + texSpec, + evalFunc, + flags); + }; + + /** + * @enum {number} + */ + es3fShaderTextureFunctionTests.CaseFlags = { + VERTEX: 1, + FRAGMENT: 2, + BOTH: 3 + }; + + /** + * @struct + * @constructor + * @param {string} name + * @param {es3fShaderTextureFunctionTests.TextureLookupSpec} lookupSpec + * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec + * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc + * @param {number} flags + */ + es3fShaderTextureFunctionTests.TexFuncCaseSpec = function(name, lookupSpec, texSpec, evalFunc, flags) { + /** @type {string} */ this.name = name; + /** @type {es3fShaderTextureFunctionTests.TextureLookupSpec} */ this.lookupSpec = lookupSpec; + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.texSpec = texSpec; + /** @type {es3fShaderTextureFunctionTests.TexEvalFunc} */ this.evalFunc = evalFunc; + /** @type {number} */ this.flags = flags; + }; + + /** + * @param {tcuTestCase.DeqpTest} parent + * @param {string} groupName + * @param {string} groupDesc + * @param {Array} cases + */ + es3fShaderTextureFunctionTests.createCaseGroup = function(parent, groupName, groupDesc, cases) { + /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(groupName, groupDesc); + parent.addChild(group); + + for (var ndx = 0; ndx < cases.length; ndx++) { + /** @type {string} */ var name = cases[ndx].name; + if (cases[ndx].flags & es3fShaderTextureFunctionTests.CaseFlags.VERTEX) + group.addChild(new es3fShaderTextureFunctionTests.ShaderTextureFunctionCase(name + '_vertex', '', cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, true)); + if (cases[ndx].flags & es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + group.addChild(new es3fShaderTextureFunctionTests.ShaderTextureFunctionCase(name + '_fragment', '', cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, false)); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fShaderTextureFunctionTests.ShaderTextureFunctionTests = function() { + tcuTestCase.DeqpTest.call(this, 'texture_functions', 'Texture Access Function Tests'); + }; + + es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype.constructor = es3fShaderTextureFunctionTests.ShaderTextureFunctionTests; + + es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype.init = function() { + // Samplers + /** @type {tcuTexture.Sampler} */ var samplerNearestNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST, + 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE, + 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */); + /** @type {tcuTexture.Sampler} */ var samplerLinearNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.LINEAR, tcuTexture.FilterMode.LINEAR, + 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE, + 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */); + /** @type {tcuTexture.Sampler} */ var samplerNearestMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST, + 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE, + 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */); + /** @type {tcuTexture.Sampler} */ var samplerLinearMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST, tcuTexture.FilterMode.LINEAR, + 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE, + 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */); + + /** @type {tcuTexture.Sampler} */ var samplerShadowNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST, + 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_LESS, + 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */); + /** @type {tcuTexture.Sampler} */ var samplerShadowMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST, + 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_LESS, + 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */); + + /** @type {tcuTexture.Sampler} */ var samplerTexelFetch = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, + tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST, + 0.0 /* LOD threshold */, false /* non-normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE, + 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */); + + // Default textures. + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 9, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 9, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 9, samplerNearestMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 9, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 9, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 9, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 9, samplerTexelFetch); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8, 256, 256, 1, 9, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA16F, 128, 128, 1, 8, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8I, 256, 256, 1, 9, samplerNearestMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.DEPTH_COMPONENT16, 256, 256, 1, 1, samplerShadowNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 8, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 8, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 8, samplerNearestMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 8, samplerNearestMipmap); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.DEPTH_COMPONENT16, 128, 128, 4, 1, samplerShadowNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.DEPTH_COMPONENT16, 128, 128, 4, 8, samplerShadowMipmap); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 8, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 8, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 8, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 8, samplerTexelFetch); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 1, samplerLinearNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 1, samplerNearestNoMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 7, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 7, samplerLinearMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 7, samplerNearestMipmap); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 7, samplerNearestMipmap); + + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 7, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 7, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 7, samplerTexelFetch); + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 7, samplerTexelFetch); + + var testGroup = tcuTestCase.runner.testCases; + // texture() cases + /** @type {Array} */ var textureCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeFixed, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeFloat, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeInt, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeUint, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCube, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], true, -2.0, 2.0, false, [0, 0, 0], texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], true, -2.0, 2.0, false, [0, 0, 0], texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isamplercube_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], true, -2.0, 2.0, false, [0, 0, 0], texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usamplercube_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], true, -2.0, 2.0, false, [0, 0, 0], texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCubeBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayFixed, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayFloat, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayInt, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayUint, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArray, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DInt, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DUint, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3D, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 1.0, false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 1.0, false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadow, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadow, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('samplercubeshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadow, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('samplercubeshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0], false, 0.0, 0.0, false, [0, 0, 0], texCubeMipmapShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadow, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('samplercubeshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0], true, -2.0, 2.0, false, [0, 0, 0], texCubeMipmapShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadowBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadow, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadow, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + + // Not in spec. + // es3fShaderTextureFunctionTests.getCaseSpec('sampler2darrayshadow_bias', (es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], true, -2.0, 2.0, Vec2(0.0), Vec2(0.0), false, [0, 0, 0]), tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowBias, FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'texture', 'texture() Tests', textureCases); + + // textureOffset() cases + // \note _bias variants are not using mipmap thanks to wide allowed range for LOD computation + /** @type {Array} */ var textureOffsetCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, true, [-8, 7, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, true, [7, -8, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, true, [-8, 7, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], true, -2.0, 2.0, true, [7, -8, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DArrayFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DArrayFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DArrayInt, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DArrayUint, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, true, [-8, 7, 0], tex2DArrayFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, true, [7, -8, 0], tex2DArrayFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, true, [-8, 7, 0], tex2DArrayInt, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], true, -2.0, 2.0, true, [7, -8, 0], tex2DArrayUint, es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [-8, 7, 3], tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [7, 3, -8], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [3, -8, 7], tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [-8, 7, 3], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [7, 3, -8], tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [3, -8, 7], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [-8, 7, 3], tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, 0.0, 0.0, true, [7, 3, -8], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 1.0, true, [-8, 7, 3], tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 1.0, true, [7, 3, -8], tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 2.0, true, [3, -8, 7], tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], true, -2.0, 2.0, true, [-8, 7, 3], tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTURE, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], true, -2.0, 2.0, true, [-8, 7, 0], tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureoffset', 'textureOffset() Tests', textureOffsetCases); + + // textureProj() cases + // \note Currently uses constant divider! + /** @type {Array} */ var textureProjCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj3, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj3Bias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 1.0, false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 1.0, false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 2.0, false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 2.0, false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProj, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], false, 0.0, 0.0, false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProj, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], true, -2.0, 2.0, false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureproj', 'textureProj() Tests', textureProjCases); + + // textureProjOffset() cases + // \note Currently uses constant divider! + /** @type {Array} */ var textureProjOffsetCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProj3Offset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, true, [-8, 7, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, true, [7, -8, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, true, [-8, 7, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], true, -2.0, 2.0, true, [7, -8, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [-8, 7, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [-8, 7, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [-8, 7, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [-8, 7, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, true, [-8, 7, 0], tex2DFixed, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, true, [7, -8, 0], tex2DFloat, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, true, [-8, 7, 0], tex2DInt, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], true, -2.0, 2.0, true, [7, -8, 0], tex2DUint, es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [-8, 7, 3], tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [7, 3, -8], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [3, -8, 7], tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [-8, 7, 3], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [7, 3, -8], tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [3, -8, 7], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [-8, 7, 3], tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, 0.0, 0.0, true, [7, 3, -8], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 2.0, true, [-8, 7, 3], tex3DFixed, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_bias_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 2.0, true, [7, 3, -8], tex3DFloat, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 2.0, true, [3, -8, 7], tex3DInt, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], true, -2.0, 2.0, true, [-8, 7, 3], tex3DUint, es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + // NOTE: offset changed from [-8, 7, 0] in native dEQP to [7, -8, 0] per https://github.com/KhronosGroup/WebGL/issues/2033 + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], false, 0.0, 0.0, true, [7, -8, 0], tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], false, 0.0, 0.0, true, [7, -8, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow_bias', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], true, -2.0, 2.0, true, [-8, 7, 0], tex2DShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffsetBias, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojoffset', 'textureOffsetProj() Tests', textureProjOffsetCases); + + // textureLod() cases + /** @type {Array} */ var textureLodCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], false, -1.0, 9.0, false, [0, 0, 0], texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], false, -1.0, 9.0, false, [0, 0, 0], texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], false, -1.0, 9.0, false, [0, 0, 0], texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], false, -1.0, 9.0, false, [0, 0, 0], texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCubeLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, false, [0, 0, 0], tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, false, [0, 0, 0], tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, false, [0, 0, 0], tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, false, [0, 0, 0], tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturelod', 'textureLod() Tests', textureLodCases); + + // textureLodOffset() cases + /** @type {Array} */ var textureLodOffsetCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], false, -1.0, 9.0, true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, true, [-8, 7, 0], tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, true, [7, -8, 0], tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, true, [-8, 7, 0], tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], false, -1.0, 8.0, true, [7, -8, 0], tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, true, [-8, 7, 3], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, true, [7, 3, -8], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, true, [3, -8, 7], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], false, -1.0, 7.0, true, [-8, 7, 3], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturelodoffset', 'textureLodOffset() Tests', textureLodOffsetCases); + + // textureProjLod() cases + /** @type {Array} */ var textureProjLodCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLod3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], false, -1.0, 9.0, false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjLod, es3fShaderTextureFunctionTests.CaseFlags.BOTH) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojlod', 'textureProjLod() Tests', textureProjLodCases); + + // textureProjLodOffset() cases + /** @type {Array} */ var textureProjLodOffsetCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], false, -1.0, 9.0, true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], false, -1.0, 9.0, true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, true, [-8, 7, 3], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, true, [7, 3, -8], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, true, [3, -8, 7], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], false, -1.0, 7.0, true, [-8, 7, 3], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD, [0.2, 0.6, 0.0, 1.5], [-2.25, -3.45, 1.5, 1.5], false, -1.0, 9.0, true, [-8, 7, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjLodOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojlodoffset', 'textureProjLodOffset() Tests', textureProjLodOffsetCases); + + // textureGrad() cases + // \note Only one of dudx, dudy, dvdx, dvdy is non-zero since spec allows approximating p from derivates by various methods. + /** @type {Array} */ var textureGradCases = [ + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('samplercube_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], texCubeMipmapFixed, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('samplercube_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], texCubeMipmapFloat, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], false, [0, 0, 0], texCubeMipmapInt, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usamplercube', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, -1.01, 0.0], [1.0, 1.0, -1.01, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], false, [0, 0, 0], texCubeMipmapUint, es3fShaderTextureFunctionTests.evalTextureCubeGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], false, [0, 0, 0], tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], false, [0, 0, 0], tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2], false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('samplercubeshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.0, -1.0, 1.01, 0.0], [1.0, 1.0, 1.01, 1.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], texCubeMipmapShadow, es3fShaderTextureFunctionTests.evalTextureCubeShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], false, [0, 0, 0], tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], false, [0, 0, 0], tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturegrad', 'textureGrad() Tests', textureGradCases); + + // textureGradOffset() cases + /** @type {Array} */ var textureGradOffsetCases = [ + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 0], tex2DArrayMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [7, -8, 0], tex2DArrayMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], true, [-8, 7, 0], tex2DArrayMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], true, [7, -8, 0], tex2DArrayMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 3], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [7, 3, -8], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [3, -8, 7], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], true, [-8, 7, 3], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], true, [7, 3, -8], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -1.4, 0.1, 0.0], [1.5, 2.3, 2.3, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2], true, [3, -8, 7], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-0.2, -0.4, 0.0, 0.0], [1.5, 2.3, 1.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [7, -8, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], true, [-8, 7, 0], tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2darrayshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD, [-1.2, -0.4, -0.5, 0.0], [1.5, 2.3, 3.5, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], true, [7, -8, 0], tex2DArrayMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturegradoffset', 'textureGradOffset() Tests', textureGradOffsetCases); + + // textureProjGrad() cases + /** @type {Array} */ var textureProjGradCases = [ + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], false, [0, 0, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], false, [0, 0, 0], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2], false, [0, 0, 0], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGrad, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], false, [0, 0, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGrad, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojgrad', 'textureProjGrad() Tests', textureProjGradCases); + + // textureProjGradOffset() cases + /** @type {Array} */ var textureProjGradOffsetCases = [ + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec3_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec3', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3, [-0.3, -0.6, 1.5, 0.0], [2.25, 3.45, 1.5, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2d_vec4_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [7, -8, 0], tex2DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapInt, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler2d_vec4', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [-0.3, -0.6, 0.0, 1.5], [2.25, 3.45, 0.0, 1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], true, [7, -8, 0], tex2DMipmapUint, es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 3], tex3DMipmapFixed, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [7, 3, -8], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.2], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [3, -8, 7], tex3DMipmapFloat, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + es3fShaderTextureFunctionTests.getGradCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [-0.2, 0.0, 0.0], true, [-8, 7, 3], tex3DMipmapInt, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.2, 0.0], true, [7, 3, -8], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.9, 1.05, -0.08, -0.75], [-1.13, -1.7, -1.7, -0.75], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, -0.2], true, [3, -8, 7], tex3DMipmapUint, es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT), + + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], true, [-8, 7, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.VERTEX), + es3fShaderTextureFunctionTests.getGradCaseSpec('sampler2dshadow', es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD, [0.2, 0.6, 0.0, -1.5], [-2.25, -3.45, -1.5, -1.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, -0.2, 0.0], true, [7, -8, 0], tex2DMipmapShadow, es3fShaderTextureFunctionTests.evalTexture2DShadowProjGradOffset, es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojgradoffset', 'textureProjGradOffset() Tests', textureProjGradOffsetCases); + + // texelFetch() cases + // \note Level is constant across quad + /** @type {Array} */ var texelFetchCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [255.9, 255.9, 0.0, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [127.9, 127.9, 0.0, 0.0], false, 1.0, 1.0, false, [0, 0, 0], tex2DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 63.9, 0.0, 0.0], false, 2.0, 2.0, false, [0, 0, 0], tex2DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [15.9, 15.9, 0.0, 0.0], false, 4.0, 4.0, false, [0, 0, 0], tex2DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [127.9, 127.9, 3.9, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex2DArrayTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 63.9, 3.9, 0.0], false, 1.0, 1.0, false, [0, 0, 0], tex2DArrayTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [31.9, 31.9, 3.9, 0.0], false, 2.0, 2.0, false, [0, 0, 0], tex2DArrayTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [15.9, 15.9, 3.9, 0.0], false, 3.0, 3.0, false, [0, 0, 0], tex2DArrayTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 31.9, 31.9, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [31.9, 15.9, 15.9, 0.0], false, 1.0, 1.0, false, [0, 0, 0], tex3DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [15.9, 7.9, 7.9, 0.0], false, 2.0, 2.0, false, [0, 0, 0], tex3DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [0.0, 0.0, 0.0, 0.0], [63.9, 31.9, 31.9, 0.0], false, 0.0, 0.0, false, [0, 0, 0], tex3DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'texelfetch', 'texelFetch() Tests', texelFetchCases); + + // texelFetchOffset() cases + /** @type {Array} */ var texelFetchOffsetCases = [ + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [263.9, 248.9, 0.0, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [120.9, 135.9, 0.0, 0.0], false, 1.0, 1.0, true, [7, -8, 0], tex2DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [71.9, 56.9, 0.0, 0.0], false, 2.0, 2.0, true, [-8, 7, 0], tex2DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [8.9, 23.9, 0.0, 0.0], false, 4.0, 4.0, true, [7, -8, 0], tex2DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [135.9, 120.9, 3.9, 0.0], false, 0.0, 0.0, true, [-8, 7, 0], tex2DArrayTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler2darray_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [56.9, 71.9, 3.9, 0.0], false, 1.0, 1.0, true, [7, -8, 0], tex2DArrayTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, 0.0, 0.0], [39.9, 24.9, 3.9, 0.0], false, 2.0, 2.0, true, [-8, 7, 0], tex2DArrayTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler2darray', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, 8.0, 0.0, 0.0], [8.9, 23.9, 3.9, 0.0], false, 3.0, 3.0, true, [7, -8, 0], tex2DArrayTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch2DArray, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_fixed', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, -3.0, 0.0], [71.9, 24.9, 28.9, 0.0], false, 0.0, 0.0, true, [-8, 7, 3], tex3DTexelFetchFixed, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('sampler3d_float', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-7.0, -3.0, 8.0, 0.0], [24.9, 12.9, 23.9, 0.0], false, 1.0, 1.0, true, [7, 3, -8], tex3DTexelFetchFloat, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('isampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [-3.0, 8.0, -7.0, 0.0], [12.9, 15.9, 0.9, 0.0], false, 2.0, 2.0, true, [3, -8, 7], tex3DTexelFetchInt, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH), + es3fShaderTextureFunctionTests.getCaseSpec('usampler3d', es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH, [8.0, -7.0, -3.0, 0.0], [71.9, 24.9, 28.9, 0.0], false, 0.0, 0.0, true, [-8, 7, 3], tex3DTexelFetchUint, es3fShaderTextureFunctionTests.evalTexelFetch3D, es3fShaderTextureFunctionTests.CaseFlags.BOTH) + ]; + es3fShaderTextureFunctionTests.createCaseGroup(this, 'texelfetchoffset', 'texelFetchOffset() Tests', texelFetchOffsetCases); + + // textureSize() cases + /** + * @struct + * @constructor + * @param {string} name + * @param {string} samplerName + * @param {es3fShaderTextureFunctionTests.TextureSpec} textureSpec + */ + var TextureSizeCaseSpec = function(name, samplerName, textureSpec) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.samplerName = samplerName; + /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.textureSpec = textureSpec; + }; + + /** @type {Array} */ var textureSizeCases = [ + new TextureSizeCaseSpec('sampler2d_fixed', 'sampler2D', tex2DFixed), + new TextureSizeCaseSpec('sampler2d_float', 'sampler2D', tex2DFloat), + new TextureSizeCaseSpec('isampler2d', 'isampler2D', tex2DInt), + new TextureSizeCaseSpec('usampler2d', 'usampler2D', tex2DUint), + new TextureSizeCaseSpec('sampler2dshadow', 'sampler2DShadow', tex2DShadow), + new TextureSizeCaseSpec('sampler3d_fixed', 'sampler3D', tex3DFixed), + new TextureSizeCaseSpec('sampler3d_float', 'sampler3D', tex3DFloat), + new TextureSizeCaseSpec('isampler3d', 'isampler3D', tex3DInt), + new TextureSizeCaseSpec('usampler3d', 'usampler3D', tex3DUint), + new TextureSizeCaseSpec('samplercube_fixed', 'samplerCube', texCubeFixed), + new TextureSizeCaseSpec('samplercube_float', 'samplerCube', texCubeFloat), + new TextureSizeCaseSpec('isamplercube', 'isamplerCube', texCubeInt), + new TextureSizeCaseSpec('usamplercube', 'usamplerCube', texCubeUint), + new TextureSizeCaseSpec('samplercubeshadow', 'samplerCubeShadow', texCubeShadow), + new TextureSizeCaseSpec('sampler2darray_fixed', 'sampler2DArray', tex2DArrayFixed), + new TextureSizeCaseSpec('sampler2darray_float', 'sampler2DArray', tex2DArrayFloat), + new TextureSizeCaseSpec('isampler2darray', 'isampler2DArray', tex2DArrayInt), + new TextureSizeCaseSpec('usampler2darray', 'usampler2DArray', tex2DArrayUint), + new TextureSizeCaseSpec('sampler2darrayshadow', 'sampler2DArrayShadow', tex2DArrayShadow) + ]; + + /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest('texturesize', 'textureSize() Tests'); + testGroup.addChild(group); + + for (var ndx = 0; ndx < textureSizeCases.length; ++ndx) { + group.addChild(new es3fShaderTextureFunctionTests.TextureSizeCase(textureSizeCases[ndx].name + '_vertex', '', textureSizeCases[ndx].samplerName, textureSizeCases[ndx].textureSpec, true)); + group.addChild(new es3fShaderTextureFunctionTests.TextureSizeCase(textureSizeCases[ndx].name + '_fragment', '', textureSizeCases[ndx].samplerName, textureSizeCases[ndx].textureSpec, false)); + } + + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + * @param {Array=} range Test range + */ + es3fShaderTextureFunctionTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fShaderTextureFunctionTests.ShaderTextureFunctionTests()); + if (range) + state.setRange(range); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fShaderTextureFunctionTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js new file mode 100644 index 000000000..8e90ff576 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js @@ -0,0 +1,111 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fStringQueryTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('functional.gles3.es3fApiCase'); + +goog.scope(function() { + var es3fStringQueryTests = functional.gles3.es3fStringQueryTests; + var tcuTestCase = framework.common.tcuTestCase; + var es3fApiCase = functional.gles3.es3fApiCase; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fStringQueryTests.StringQueryTests = function() { + tcuTestCase.DeqpTest.call(this, 'string', 'String Query tests'); + }; + + es3fStringQueryTests.StringQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fStringQueryTests.StringQueryTests.prototype.constructor = es3fStringQueryTests.StringQueryTests; + + es3fStringQueryTests.StringQueryTests.prototype.init = function() { + this.addChild(new es3fApiCase.ApiCaseCallback('renderer', 'RENDERER', gl, function() { + var string = /** @type {string} */ (gl.getParameter(gl.RENDERER)); + this.check(string !== null, + 'Got invalid string: ' + string); + })); + + this.addChild(new es3fApiCase.ApiCaseCallback('vendor', 'VENDOR', gl, function() { + var string = /** @type {string} */ (gl.getParameter(gl.VENDOR)); + this.check(string !== null, + 'Got invalid string: ' + string); + })); + + this.addChild(new es3fApiCase.ApiCaseCallback('version', 'VERSION', gl, function() { + var string = /** @type {string} */ (gl.getParameter(gl.VERSION)); + /** @type {string} */ var referenceString = 'WebGL 2.0'; + + this.check(string !== null && string.indexOf(referenceString) === 0, + 'Got invalid string prefix: ' + string + ' expected: ' + referenceString); + })); + + this.addChild(new es3fApiCase.ApiCaseCallback('shading_language_version', 'SHADING_LANGUAGE_VERSION', gl, function() { + var string = /** @type {string} */ (gl.getParameter(gl.SHADING_LANGUAGE_VERSION)); + /** @type {string} */ var referenceString = 'WebGL GLSL ES 3.00'; + + this.check(string !== null, 'Got invalid string'); + this.check(string.indexOf(referenceString) === 0, 'Got invalid string prefix'); + })); + + this.addChild(new es3fApiCase.ApiCaseCallback('extensions', 'EXTENSIONS', gl, function() { + /** @type {Array} */ var extensions = gl.getSupportedExtensions(); + this.check(extensions !== null, 'Got invalid string'); + + // [dag] check that all extensions from gl.getSupportedExtensions() are found using gl.getExtension() + for (var i in extensions) { + /** @type {Object} */ var extension = gl.getExtension(extensions[i]); + this.check(extension !== null, 'Advertised extension ' + extensions[i] + ' not found'); + } + + // [dag] check that gl.getExtension() returns null for items not in gl.getSupportedExtensions() + this.check(gl.getExtension('Random_String') === null, 'Extension query methods are not consistent.'); + })); + + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fStringQueryTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fStringQueryTests.StringQueryTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fStringQueryTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js new file mode 100644 index 000000000..4b5bebec2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js @@ -0,0 +1,335 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fSyncTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderProgram'); + +goog.scope(function() { + var es3fSyncTests = functional.gles3.es3fSyncTests; + var tcuTestCase = framework.common.tcuTestCase; + var deRandom = framework.delibs.debase.deRandom; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var deString = framework.delibs.debase.deString; + + /** @const {number} */ es3fSyncTests.NUM_CASE_ITERATIONS = 5; + /** @const {number} */ es3fSyncTests.MAX_VERIFY_WAIT = 5; + + /** + * @enum + */ + es3fSyncTests.WaitCommand = { + WAIT_SYNC: 1, + CLIENT_WAIT_SYNC: 2 + }; + + /** @enum + */ + es3fSyncTests.CaseOptions = { + FLUSH_BEFORE_WAIT: 1, + FINISH_BEFORE_WAIT: 2 + }; + + /** @enum + */ + es3fSyncTests.State = { + DRAW: 0, + VERIFY: 1, + FINISH: 2 + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {number} numPrimitives + * @param {number} waitCommand + * @param {number} waitFlags + * @param {number} timeout + * @param {number} options + */ + es3fSyncTests.FenceSyncCase = function(name, description, numPrimitives, waitCommand, waitFlags, timeout, options) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {number} */ this.m_numPrimitives = numPrimitives; + /** @type {number} */ this.m_waitCommand = waitCommand; + /** @type {number} */ this.m_waitFlags = waitFlags; + /** @type {number} */ this.m_timeout = timeout; + /** @type {number} */ this.m_caseOptions = options; + + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {WebGLSync} */ this.m_syncObject = null; + /** @type {number} */ this.m_iterNdx = 0; + /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name)); + /** @type {es3fSyncTests.State} */ this.m_state = es3fSyncTests.State.DRAW; + }; + + es3fSyncTests.FenceSyncCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fSyncTests.FenceSyncCase.prototype.constructor = es3fSyncTests.FenceSyncCase; + + /** + * @param {number} numPrimitives + * @param {deRandom.Random} rnd + * @return {Array} + */ + es3fSyncTests.generateVertices = function(numPrimitives, rnd) { + /** @type {Array} */ var dst = []; + /** @type {number} */ var numVertices = 3 * numPrimitives; + + for (var i = 0; i < numVertices; i++) { + dst.push(rnd.getFloat(-1.0, 1.0)); // x + dst.push(rnd.getFloat(-1.0, 1.0)); // y + dst.push(rnd.getFloat(0.0, 1.0)); // z + dst.push(1.0); // w + } + return dst; + }; + + es3fSyncTests.FenceSyncCase.prototype.init = function() { + /** @type {string} */ var vertShaderSource = '#version 300 es\n' + + 'layout(location = 0) in mediump vec4 a_position;\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = a_position;\n' + + '}\n'; + + /** @type {string} */ var fragShaderSource = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + '\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = vec4(0.25, 0.5, 0.75, 1.0);\n' + + '}\n'; + + assertMsgOptions(!this.m_program, 'Program should be null.', false, true); + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource)); + + if (!this.m_program.isOk()) + throw new Error('Failed to compile shader program'); + }; + + es3fSyncTests.FenceSyncCase.prototype.deinit = function() { + if (this.m_program) + this.m_program = null; + + if (this.m_syncObject) { + gl.deleteSync(this.m_syncObject); + this.m_syncObject = null; + } + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fSyncTests.FenceSyncCase.prototype.draw = function() { + /** @type {Array} */ var vertices = []; + + /** @type {string} */ var header = 'Case iteration ' + (this.m_iterNdx + 1) + ' / ' + es3fSyncTests.NUM_CASE_ITERATIONS; + bufferedLogToConsole(header); + + assertMsgOptions(this.m_program !== null, 'Expected program', false, true); + gl.useProgram(this.m_program.getProgram()); + gl.enable(gl.DEPTH_TEST); + gl.clearColor(0.3, 0.3, 0.3, 1.0); + gl.clearDepth(1.0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + + // Generate vertices + + gl.enableVertexAttribArray(0); + vertices = es3fSyncTests.generateVertices(this.m_numPrimitives, this.m_rnd); + + /** @type {WebGLBuffer} */ var vertexGLBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vertexGLBuffer); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW); + gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0); + + // Draw + + gl.drawArrays(gl.TRIANGLES, 0, vertices.length / 4); + bufferedLogToConsole('Primitives drawn.'); + + // Create sync object + + this.m_syncObject = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); + bufferedLogToConsole('Sync object created'); + + if (this.m_caseOptions & es3fSyncTests.CaseOptions.FLUSH_BEFORE_WAIT) + gl.flush(); + if (this.m_caseOptions & es3fSyncTests.CaseOptions.FINISH_BEFORE_WAIT) + gl.finish(); + this.m_state = es3fSyncTests.State.VERIFY; + }; + + + es3fSyncTests.FenceSyncCase.prototype.verify = function() { + /** @type {number} */ var waitValue = 0; + /** @type {boolean} */ var testOk = true; + + // Wait for sync object + if (this.m_waitCommand & es3fSyncTests.WaitCommand.WAIT_SYNC) { + assertMsgOptions(this.m_timeout === gl.TIMEOUT_IGNORED, 'Expected TIMEOUT_IGNORED', false, true); + assertMsgOptions(this.m_waitFlags === 0, 'Expected waitFlags = 0', false, true); + gl.waitSync(this.m_syncObject, this.m_waitFlags, this.m_timeout); + bufferedLogToConsole('Wait command glWaitSync called with GL_TIMEOUT_IGNORED.'); + } + + if (this.m_waitCommand & es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC) { + waitValue = gl.clientWaitSync(this.m_syncObject, this.m_waitFlags, this.m_timeout); + bufferedLogToConsole('glClientWaitSync return value:'); + switch (waitValue) { + case gl.ALREADY_SIGNALED: + bufferedLogToConsole('gl.ALREADY_SIGNALED'); + break; + case gl.TIMEOUT_EXPIRED: + bufferedLogToConsole('gl.TIMEOUT_EXPIRED'); + break; + case gl.CONDITION_SATISFIED: + bufferedLogToConsole('gl.CONDITION_SATISFIED'); + break; + case gl.WAIT_FAILED: + bufferedLogToConsole('gl.WAIT_FAILED'); + testOk = false; + break; + default: + bufferedLogToConsole('Illegal return value!'); + } + } + + gl.finish(); + + if (this.m_caseOptions & es3fSyncTests.CaseOptions.FINISH_BEFORE_WAIT && waitValue != gl.ALREADY_SIGNALED) { + testOk = false; + bufferedLogToConsole('Expected glClientWaitSync to return gl.ALREADY_SIGNALED.'); + } + + // Delete sync object + + if (this.m_syncObject && testOk) { + gl.deleteSync(this.m_syncObject); + this.m_syncObject = null; + bufferedLogToConsole('Sync object deleted.'); + } + + // Evaluate test result + + bufferedLogToConsole('Test result: ' + (testOk ? 'Passed!' : 'Failed!')); + + if (!testOk) { + if (!this.m_verifyStart) + this.m_verifyStart = new Date(); + else { + var current = new Date(); + var elapsedTime = 0.001 * (current.getTime() - this.m_verifyStart.getTime()); + if (elapsedTime > es3fSyncTests.MAX_VERIFY_WAIT) { + testFailedOptions('Fail', false); + this.m_state = es3fSyncTests.State.FINISH; + if (this.m_syncObject) { + gl.deleteSync(this.m_syncObject); + this.m_syncObject = null; + bufferedLogToConsole('Sync object deleted.'); + } + } + } + } else { + bufferedLogToConsole('Sync objects created and deleted successfully.'); + testPassedOptions('Pass', true); + this.m_state = (++this.m_iterNdx < es3fSyncTests.NUM_CASE_ITERATIONS) ? es3fSyncTests.State.DRAW : es3fSyncTests.State.FINISH; + } + }; + + es3fSyncTests.FenceSyncCase.prototype.iterate = function() { + switch (this.m_state) { + case es3fSyncTests.State.DRAW: + this.draw(); + break; + case es3fSyncTests.State.VERIFY: + this.verify(); + break; + case es3fSyncTests.State.FINISH: + return tcuTestCase.IterateResult.STOP; + default: + throw new Error('Invalid state: ' + this.m_state); + } + + return tcuTestCase.IterateResult.CONTINUE; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fSyncTests.SyncTests = function() { + tcuTestCase.DeqpTest.call(this, 'fence_sync', 'Fence Sync Tests'); + }; + + es3fSyncTests.SyncTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fSyncTests.SyncTests.prototype.constructor = es3fSyncTests.SyncTests; + + es3fSyncTests.SyncTests.prototype.init = function() { + // Fence sync tests. + + this.addChild(new es3fSyncTests.FenceSyncCase('wait_sync_smalldraw', '', 10, es3fSyncTests.WaitCommand.WAIT_SYNC, 0, gl.TIMEOUT_IGNORED, 0)); + this.addChild(new es3fSyncTests.FenceSyncCase('wait_sync_largedraw', '', 100000, es3fSyncTests.WaitCommand.WAIT_SYNC, 0, gl.TIMEOUT_IGNORED, 0)); + + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_smalldraw', '', 10, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, 0)); + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_largedraw', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, 0)); + + // Originally the next two test cases' timeout is 10, but in WebGL2 that could be illegal. + var max = gl.getParameter(gl.MAX_CLIENT_WAIT_TIMEOUT_WEBGL) || 0; + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_timeout_smalldraw', '', 10, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, max, 0)); + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_timeout_largedraw', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, max, 0)); + + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_flush_auto', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, gl.SYNC_FLUSH_COMMANDS_BIT, 0, 0)); + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_flush_manual', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, es3fSyncTests.CaseOptions.FLUSH_BEFORE_WAIT)); + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_noflush', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, 0)); + this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_finish', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, es3fSyncTests.CaseOptions.FINISH_BEFORE_WAIT)); + + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fSyncTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fSyncTests.SyncTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fSyncTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js new file mode 100644 index 000000000..4e5bc8aad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js @@ -0,0 +1,2269 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fTextureFilteringTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexLookupVerifier'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('functional.gles3.es3fFboTestUtil'); +goog.require('modules.shared.glsTextureTestUtil'); + +goog.scope(function() { + + var es3fTextureFilteringTests = functional.gles3.es3fTextureFilteringTests; + var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuLogImage = framework.common.tcuLogImage; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuRGBA = framework.common.tcuRGBA; + var tcuTestCase = framework.common.tcuTestCase; + var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + var gluTexture = framework.opengl.gluTexture; + var glsTextureTestUtil = modules.shared.glsTextureTestUtil; + + /** @type {WebGL2RenderingContext} */ var gl; + + es3fTextureFilteringTests.version = + gluShaderUtil.getGLSLVersionString(gluShaderUtil.GLSLVersion.V300_ES); + + var TEX2D_VIEWPORT_WIDTH = 64; + var TEX2D_VIEWPORT_HEIGHT = 64; + var TEX2D_MIN_VIEWPORT_WIDTH = 64; + var TEX2D_MIN_VIEWPORT_HEIGHT = 64; + + var TEX3D_VIEWPORT_WIDTH = 64; + var TEX3D_VIEWPORT_HEIGHT = 64; + var TEX3D_MIN_VIEWPORT_WIDTH = 64; + var TEX3D_MIN_VIEWPORT_HEIGHT = 64; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fTextureFilteringTests.TextureFilteringTests = function() { + tcuTestCase.DeqpTest.call(this, 'filtering', 'Texture Filtering Tests'); + }; + + es3fTextureFilteringTests.TextureFilteringTests.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + + es3fTextureFilteringTests.TextureFilteringTests.prototype.constructor = + es3fTextureFilteringTests.TextureFilteringTests; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} minFilter + * @param {number} magFilter + * @param {number} wrapS + * @param {number} wrapT + * @param {number} internalFormat + * @param {number} width + * @param {number} height + */ + es3fTextureFilteringTests.Texture2DFilteringCase = function( + name, desc, minFilter, magFilter, wrapS, wrapT, + internalFormat, width, height + ) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_minFilter = minFilter; + this.m_magFilter = magFilter; + this.m_wrapS = wrapS; + this.m_wrapT = wrapT; + this.m_internalFormat = internalFormat; + this.m_width = width; + this.m_height = height; + /** @type {glsTextureTestUtil.TextureRenderer} */ + this.m_renderer = new glsTextureTestUtil.TextureRenderer( + es3fTextureFilteringTests.version, + gluShaderUtil.precision.PRECISION_HIGHP + ); + this.m_caseNdx = 0; + /** @type {Array} */ this.m_textures = []; + this.m_cases = []; + }; + + es3fTextureFilteringTests.Texture2DFilteringCase.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + es3fTextureFilteringTests.Texture2DFilteringCase.prototype.constructor = + es3fTextureFilteringTests.Texture2DFilteringCase; + + /** + * @constructor + * @param {gluTexture.Texture2D} tex_ + * @param {Array} minCoord_ + * @param {Array} maxCoord_ + */ + es3fTextureFilteringTests.Texture2DFilteringCase.FilterCase = function( + tex_, minCoord_, maxCoord_ + ) { + this.texture = tex_; + this.minCoord = minCoord_; + this.maxCoord = maxCoord_; + }; + + /** @typedef {{texNdx: number, lodX: number, + * lodY: number, oX: number, oY: number}} */ + es3fTextureFilteringTests.Cases; + + /** + * init + */ + es3fTextureFilteringTests.Texture2DFilteringCase.prototype.init = + function() { + try { + // Create 2 textures. + for (var ndx = 0; ndx < 2; ndx++) + this.m_textures.push( + gluTexture.texture2DFromInternalFormat( + gl, this.m_internalFormat, + this.m_width, this.m_height + ) + ); + + var mipmaps = true; + var numLevels = mipmaps ? deMath.logToFloor( + Math.max(this.m_width, this.m_height) + ) + 1 : 1; + + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo( + this.m_textures[0].getRefTexture().getFormat() + ); + /** @type {Array} */ var cBias = fmtInfo.valueMin; + /** @type {Array} */ + var cScale = deMath.subtract( + fmtInfo.valueMax, fmtInfo.valueMin + ); + + // Fill first gradient texture. + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + /** @type {Array} */ var gMin = deMath.add( + deMath.multiply([0.0, 0.0, 0.0, 1.0], cScale), cBias + ); + /** @type {Array} */ var gMax = deMath.add( + deMath.multiply([1.0, 1.0, 1.0, 0.0], cScale), cBias + ); + + this.m_textures[0].getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithComponentGradients( + this.m_textures[0].getRefTexture().getLevel(levelNdx), + gMin, gMax + ); + } + + // Fill second with grid texture. + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + /** @type {number} */ var step = 0x00ffffff / numLevels; + /** @type {number} */ var rgb = step * levelNdx; + /** @type {number} */ var colorA = deMath.binaryOp( + 0xff000000, rgb, deMath.BinaryOp.OR + ); + /** @type {number} */ var colorB = deMath.binaryOp( + 0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR + ); + + this.m_textures[1].getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithGrid( + this.m_textures[1].getRefTexture().getLevel(levelNdx), + 4, + deMath.add(deMath.multiply( + tcuRGBA.newRGBAFromValue(colorA).toVec(), cScale), + cBias + ), + deMath.add(deMath.multiply( + tcuRGBA.newRGBAFromValue(colorB).toVec(), cScale), + cBias + ) + ); + } + + // Upload. + for (var i = 0; i < this.m_textures.length; i++) + this.m_textures[i].upload(); + + // Compute cases. + + /** @type {Array} */ + var cases = [{ + texNdx: 0, lodX: 1.6, lodY: 2.9, oX: -1.0, oY: -2.7 + }, { + texNdx: 0, lodX: -2.0, lodY: -1.35, oX: -0.2, oY: 0.7 + }, { + texNdx: 1, lodX: 0.14, lodY: 0.275, oX: -1.5, oY: -1.1 + }, { + texNdx: 1, lodX: -0.92, lodY: -2.64, oX: 0.4, oY: -0.1 + } + ]; + + var viewportW = Math.min( + TEX2D_VIEWPORT_WIDTH, gl.canvas.width + ); + var viewportH = Math.min( + TEX2D_VIEWPORT_HEIGHT, gl.canvas.height + ); + + for (var caseNdx = 0; caseNdx < cases.length; caseNdx++) { + /** @type {number} */ var texNdx = deMath.clamp( + cases[caseNdx].texNdx, 0, this.m_textures.length - 1 + ); + /** @type {number} */ var lodX = cases[caseNdx].lodX; + /** @type {number} */ var lodY = cases[caseNdx].lodY; + /** @type {number} */ var oX = cases[caseNdx].oX; + /** @type {number} */ var oY = cases[caseNdx].oY; + /** @type {number} */ var sX = Math.exp(lodX * Math.log(2)) * viewportW / + this.m_textures[texNdx].getRefTexture().getWidth(); + /** @type {number} */ var sY = Math.exp(lodY * Math.log(2)) * viewportH / + this.m_textures[texNdx].getRefTexture().getHeight(); + + this.m_cases.push( + new + es3fTextureFilteringTests.Texture2DFilteringCase.FilterCase( + this.m_textures[texNdx], [oX, oY], [oX + sX, oY + sY] + ) + ); + } + + this.m_caseNdx = 0; + } + catch (e) { + // Clean up to save memory. + this.deinit(); + throw e; + } + }; + + /** + * deinit + */ + es3fTextureFilteringTests.Texture2DFilteringCase.prototype.deinit = + function() { + while (this.m_textures.length > 0) { + gl.deleteTexture(this.m_textures[0].getGLTexture()); + this.m_textures.splice(0, 1); + } + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fTextureFilteringTests.Texture2DFilteringCase.prototype.iterate = + function() { + /** @type {glsTextureTestUtil.RandomViewport} */ + var viewport = new glsTextureTestUtil.RandomViewport( + gl.canvas, TEX2D_VIEWPORT_WIDTH, + TEX2D_VIEWPORT_HEIGHT, deMath.binaryOp( + deString.deStringHash(this.fullName()), + deMath.deMathHash(this.m_caseNdx), + deMath.BinaryOp.XOR + ) + ); + /** @type {tcuTexture.TextureFormat} */ + var texFmt = this.m_textures[0].getRefTexture().getFormat(); + + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + var curCase = this.m_cases[this.m_caseNdx]; + bufferedLogToConsole('Test ' + this.m_caseNdx); + var refParams = new glsTextureTestUtil.ReferenceParams( + glsTextureTestUtil.textureType.TEXTURETYPE_2D + ); + var rendered = new tcuSurface.Surface(viewport.width, viewport.height); + var texCoord = [0, 0]; + + if (viewport.width < TEX2D_MIN_VIEWPORT_WIDTH || + viewport.height < TEX2D_MIN_VIEWPORT_HEIGHT) + throw new Error('Too small render target'); + + // Setup params for reference. + refParams.sampler = gluTextureUtil.mapGLSamplerWrapST( + this.m_wrapS, this.m_wrapT, this.m_minFilter, this.m_magFilter + ); + refParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt); + refParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + refParams.colorBias = fmtInfo.lookupBias; + refParams.colorScale = fmtInfo.lookupScale; + + // Compute texture coordinates. + bufferedLogToConsole( + 'Texture coordinates: ' + curCase.minCoord + + ' -> ' + curCase.maxCoord + ); + texCoord = glsTextureTestUtil.computeQuadTexCoord2D( + curCase.minCoord, curCase.maxCoord + ); + + gl.bindTexture(gl.TEXTURE_2D, curCase.texture.getGLTexture()); + gl.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_minFilter + ); + gl.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_magFilter + ); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.m_wrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.m_wrapT); + + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + this.m_renderer.renderQuad(0, texCoord, refParams); + rendered.readViewport( + gl, [viewport.x, viewport.y, viewport.width, viewport.height] + ); + + /** @type {boolean} */ var isNearestOnly = + this.m_minFilter == gl.NEAREST && this.m_magFilter == gl.NEAREST; + /** @type {tcuPixelFormat.PixelFormat} */ + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + + //(iVec4) + var colorBits = deMath.max( + deMath.addScalar( + glsTextureTestUtil.getBitsVec(pixelFormat), + // 1 inaccurate bit if nearest only, 2 otherwise + -1 * (isNearestOnly ? 1 : 2) + ), + [0, 0, 0, 0] + ); + + /** @type {tcuTexLookupVerifier.LodPrecision} */ + var lodPrecision = new tcuTexLookupVerifier.LodPrecision(); + /** @type {tcuTexLookupVerifier.LookupPrecision} */ + var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision(); + + lodPrecision.derivateBits = 18; + lodPrecision.lodBits = 6; + lookupPrecision.colorThreshold = deMath.divide( + tcuTexLookupVerifier.computeFixedPointThreshold(colorBits), + refParams.colorScale + ); + lookupPrecision.coordBits = [20, 20, 0]; + lookupPrecision.uvwBits = [7, 7, 0]; + lookupPrecision.colorMask = + glsTextureTestUtil.getCompareMask(pixelFormat); + + var isHighQuality = glsTextureTestUtil.verifyTexture2DResult( + rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat + ); + + if (!isHighQuality) { + // Evaluate against lower precision requirements. + lodPrecision.lodBits = 4; + lookupPrecision.uvwBits = [4, 4, 0]; + + bufferedLogToConsole('Warning: Verification against high ' + + 'precision requirements failed, trying with lower ' + + 'requirements.' + ); + + var isOk = glsTextureTestUtil.verifyTexture2DResult( + rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, refParams, lookupPrecision, lodPrecision, + pixelFormat + ); + + if (!isOk) { + bufferedLogToConsole( + 'ERROR: Verification against low ' + + 'precision requirements failed, failing test case.' + ); + testFailedOptions('Image verification failed', false); + //In JS version, one mistake and you're out + return tcuTestCase.IterateResult.STOP; + } else + checkMessage( + false, + 'Low-quality filtering result in iteration no. ' + + this.m_caseNdx + ); + } + + this.m_caseNdx += 1; + if (this.m_caseNdx < this.m_cases.length) + return tcuTestCase.IterateResult.CONTINUE; + + testPassed('Verified'); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} minFilter + * @param {number} magFilter + * @param {number} wrapS + * @param {number} wrapT + * @param {boolean} onlySampleFaceInterior + * @param {number} internalFormat + * @param {number} width + * @param {number} height + */ + es3fTextureFilteringTests.TextureCubeFilteringCase = function( + name, desc, minFilter, magFilter, wrapS, wrapT, onlySampleFaceInterior, + internalFormat, width, height + ) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_minFilter = minFilter; + this.m_magFilter = magFilter; + this.m_wrapS = wrapS; + this.m_wrapT = wrapT; + /** @type {boolean}*/ + this.m_onlySampleFaceInterior = onlySampleFaceInterior; + this.m_internalFormat = internalFormat; + this.m_width = width; + this.m_height = height; + /** @type {glsTextureTestUtil.TextureRenderer} */ + this.m_renderer = new glsTextureTestUtil.TextureRenderer( + es3fTextureFilteringTests.version, + gluShaderUtil.precision.PRECISION_HIGHP + ); + this.m_caseNdx = 0; + /** @type {Array} */ this.m_textures = []; + /** @type {Array} + */ + this.m_cases = []; + }; + + /** + * @constructor + * @param {gluTexture.TextureCube} tex_ + * @param {Array} bottomLeft_ + * @param {Array} topRight_ + */ + es3fTextureFilteringTests.TextureCubeFilteringCase.FilterCase = function( + tex_, bottomLeft_, topRight_ + ) { + this.texture = tex_; + this.bottomLeft = bottomLeft_; + this.topRight = topRight_; + }; + + es3fTextureFilteringTests.TextureCubeFilteringCase.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + + es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.constructor = + es3fTextureFilteringTests.TextureCubeFilteringCase; + + /** + * init + */ + es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.init = + function() { + try { + assertMsgOptions( + this.m_width == this.m_height, 'Texture has to be squared', + false, true + ); + for (var ndx = 0; ndx < 2; ndx++) + this.m_textures.push(gluTexture.cubeFromInternalFormat( + gl, this.m_internalFormat, this.m_width + )); + + var numLevels = deMath.logToFloor( + Math.max(this.m_width, this.m_height) + ) + 1; + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo( + this.m_textures[0].getRefTexture().getFormat() + ); + /** @type {Array} */ + var cBias = fmtInfo.valueMin; + /** @type {Array} */ + var cScale = deMath.subtract( + fmtInfo.valueMax, fmtInfo.valueMin + ); + + // Fill first with gradient texture. + /** @type {Array>>} + * (array of 4 component vectors) + */ + var gradients = [ + [ // negative x + [0.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0] + ], [ // positive x + [0.5, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0] + ], [ // negative y + [0.0, 0.5, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0] + ], [ // positive y + [0.0, 0.0, 0.5, 1.0], [1.0, 1.0, 1.0, 0.0] + ], [ // negative z + [0.0, 0.0, 0.0, 0.5], [1.0, 1.0, 1.0, 1.0] + ], [ // positive z + [0.5, 0.5, 0.5, 1.0], [1.0, 1.0, 1.0, 0.0] + ] + ]; + for (var face = 0; + face < Object.keys(tcuTexture.CubeFace).length; + face++) { + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + this.m_textures[0].getRefTexture().allocLevel( + face, levelNdx + ); + tcuTextureUtil.fillWithComponentGradients( + this.m_textures[0].getRefTexture().getLevelFace( + levelNdx, face + ), + deMath.add(deMath.multiply( + gradients[face][0], cScale + ), cBias), + deMath.add(deMath.multiply( + gradients[face][1], cScale + ), cBias) + ); + } + } + + // Fill second with grid texture. + for (var face = 0; + face < Object.keys(tcuTexture.CubeFace).length; + face++) { + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + var step = 0x00ffffff / ( + numLevels * Object.keys(tcuTexture.CubeFace).length + ); + var rgb = step * levelNdx * face; + /** @type {number} */ var colorA = deMath.binaryOp( + 0xff000000, rgb, deMath.BinaryOp.OR + ); + /** @type {number} */ var colorB = deMath.binaryOp( + 0xff000000, deMath.binaryNot(rgb), + deMath.BinaryOp.OR + ); + + this.m_textures[1].getRefTexture().allocLevel( + face, levelNdx + ); + tcuTextureUtil.fillWithGrid( + this.m_textures[1].getRefTexture().getLevelFace( + levelNdx, face + ), 4, deMath.add( + deMath.multiply( + tcuRGBA.newRGBAFromValue(colorA).toVec(), + cScale + ), cBias + ), deMath.add( + deMath.multiply( + tcuRGBA.newRGBAFromValue(colorB).toVec(), + cScale + ), cBias + ) + ); + } + } + + // Upload. + for (var i = 0; i < this.m_textures.length; i++) + this.m_textures[i].upload(); + + // Compute cases + /** @type {gluTexture.TextureCube} */ + var tex0 = this.m_textures[0]; + /** @type {gluTexture.TextureCube} */ + var tex1 = this.m_textures.length > 1 ? this.m_textures[1] : tex0; + + if (this.m_onlySampleFaceInterior) { + // minification + this.m_cases.push(new es3fTextureFilteringTests. + TextureCubeFilteringCase.FilterCase( + tex0, [-0.8, -0.8], [0.8, 0.8] + )); + // magnification + this.m_cases.push(new es3fTextureFilteringTests. + TextureCubeFilteringCase.FilterCase( + tex0, [0.5, 0.65], [0.8, 0.8] + )); + // minification + this.m_cases.push(new es3fTextureFilteringTests. + TextureCubeFilteringCase.FilterCase( + tex1, [-0.8, -0.8], [0.8, 0.8] + )); + // magnification + this.m_cases.push(new es3fTextureFilteringTests. + TextureCubeFilteringCase.FilterCase( + tex1, [0.2, 0.2], [0.6, 0.5] + )); + } else { + // minification + if (gl.getParameter(gl.SAMPLES) == 0) + this.m_cases.push( + new es3fTextureFilteringTests.TextureCubeFilteringCase. + FilterCase( + tex0, [-1.25, -1.2], [1.2, 1.25] + ) + ); + // minification - w/ tweak to avoid hitting triangle + // edges with face switchpoint. + else + this.m_cases.push( + new es3fTextureFilteringTests.TextureCubeFilteringCase. + FilterCase( + tex0, [-1.19, -1.3], [1.1, 1.35] + ) + ); + + // magnification + this.m_cases.push( + new es3fTextureFilteringTests.TextureCubeFilteringCase. + FilterCase( + tex0, [0.8, 0.8], [1.25, 1.20] + ) + ); + // minification + this.m_cases.push( + new es3fTextureFilteringTests.TextureCubeFilteringCase. + FilterCase( + tex1, [-1.19, -1.3], [1.1, 1.35] + ) + ); + // magnification + this.m_cases.push( + new es3fTextureFilteringTests.TextureCubeFilteringCase. + FilterCase( + tex1, [-1.2, -1.1], [-0.8, -0.8] + ) + ); + } + + this.m_caseNdx = 0; + } + catch (e) { + // Clean up to save memory. + this.deinit(); + throw e; + } + }; + + /** + * deinit + */ + es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.deinit = + function() { + while (this.m_textures.length > 0) { + gl.deleteTexture(this.m_textures[0].getGLTexture()); + this.m_textures.splice(0, 1); + } + }; + + /** + * @param {tcuTexture.CubeFace} face + * @return {string} + */ + es3fTextureFilteringTests.getFaceDesc = function(face) { + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: return '-X'; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: return '+X'; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: return '-Y'; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: return '+Y'; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: return '-Z'; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: return '+Z'; + default: + throw new Error('Invalid cube face specified'); + } + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.iterate = + function() { + var viewportSize = 28; + /** @type {glsTextureTestUtil.RandomViewport} */ + var viewport = new glsTextureTestUtil.RandomViewport( + gl.canvas, viewportSize, + viewportSize, deMath.binaryOp( + deString.deStringHash(this.fullName()), + deMath.deMathHash(this.m_caseNdx), + deMath.BinaryOp.XOR + ) + ); + bufferedLogToConsole('Test' + this.m_caseNdx); + /** @type {es3fTextureFilteringTests. + * TextureCubeFilteringCase.FilterCase} + */ + var curCase = this.m_cases[this.m_caseNdx]; + /** @type {tcuTexture.TextureFormat} */ + var texFmt = curCase.texture.getRefTexture().getFormat(); + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + /** @type {glsTextureTestUtil.ReferenceParams} */ + var sampleParams = new glsTextureTestUtil.ReferenceParams( + glsTextureTestUtil.textureType.TEXTURETYPE_CUBE + ); + + if (viewport.width < viewportSize || viewport.height < viewportSize) + throw new Error('Too small render target'); + + // Setup texture + gl.bindTexture(gl.TEXTURE_CUBE_MAP, curCase.texture.getGLTexture()); + gl.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, this.m_minFilter + ); + gl.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, this.m_magFilter + ); + gl.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, this.m_wrapS + ); + gl.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, this.m_wrapT + ); + + // Other state + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + // Params for reference computation. + sampleParams.sampler = gluTextureUtil.mapGLSamplerWrapST( + gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, + this.m_minFilter, this.m_magFilter + ); + sampleParams.sampler.seamlessCubeMap = true; + sampleParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt); + sampleParams.colorBias = fmtInfo.lookupBias; + sampleParams.colorScale = fmtInfo.lookupScale; + sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + + bufferedLogToConsole( + 'Coordinates: ' + curCase.bottomLeft + ' -> ' + curCase.topRight + ); + + for (var faceNdx = 0; + faceNdx < Object.keys(tcuTexture.CubeFace).length; + faceNdx++) { + var face = /** @type {tcuTexture.CubeFace} */ (faceNdx); + /** @type {tcuSurface.Surface} */ + var result = new tcuSurface.Surface( + viewport.width, viewport.height + ); + /** @type {Array} */ var texCoord; + + texCoord = glsTextureTestUtil.computeQuadTexCoordCubeFace( + face, curCase.bottomLeft, curCase.topRight + ); + + bufferedLogToConsole( + 'Face ' + es3fTextureFilteringTests.getFaceDesc(face) + ); + + // \todo Log texture coordinates. + + this.m_renderer.renderQuad(0, texCoord, sampleParams); + + result.readViewport( + gl, [viewport.x, viewport.y, viewport.width, viewport.height] + ); + + /** @type {boolean} */ + var isNearestOnly = this.m_minFilter == gl.NEAREST && + this.m_magFilter == gl.NEAREST; + /** @type {tcuPixelFormat.PixelFormat} */ + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + + //(iVec4) + var colorBits = deMath.max( + deMath.addScalar( + glsTextureTestUtil.getBitsVec(pixelFormat), + // 1 inaccurate bit if nearest only, 2 otherwise + -1 * (isNearestOnly ? 1 : 2) + ), + [0, 0, 0, 0] + ); + /** @type {tcuTexLookupVerifier.LodPrecision} */ + var lodPrecision = new tcuTexLookupVerifier.LodPrecision(); + /** @type {tcuTexLookupVerifier.LookupPrecision} */ + var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision(); + + lodPrecision.derivateBits = 10; + lodPrecision.lodBits = 5; + lookupPrecision.colorThreshold = deMath.divide( + tcuTexLookupVerifier.computeFixedPointThreshold(colorBits), + sampleParams.colorScale + ); + lookupPrecision.coordBits = [10, 10, 10]; + lookupPrecision.uvwBits = [6, 6, 0]; + lookupPrecision.colorMask = + glsTextureTestUtil.getCompareMask(pixelFormat); + + var isHighQuality = glsTextureTestUtil.verifyTextureCubeResult( + result.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, lookupPrecision, lodPrecision, + pixelFormat + ); + + + if (!isHighQuality) { + // Evaluate against lower precision requirements. + lodPrecision.lodBits = 2; + lookupPrecision.uvwBits = [3, 3, 0]; + + bufferedLogToConsole('Warning: Verification against high ' + + 'precision requirements failed, trying with lower ' + + 'requirements.'); + + var isOk = glsTextureTestUtil.verifyTextureCubeResult( + result.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, lookupPrecision, lodPrecision, + pixelFormat + ); + + if (!isOk) { + bufferedLogToConsole('ERROR: Verification against low' + + 'precision requirements failed, failing test case.'); + testFailedOptions('Image verification failed', false); + //In JS version, one mistake and you're out + return tcuTestCase.IterateResult.STOP; + } else + checkMessage( + false, + 'Low-quality filtering result in iteration no. ' + + this.m_caseNdx + ); + } + } + + this.m_caseNdx += 1; + if (this.m_caseNdx < this.m_cases.length) + return tcuTestCase.IterateResult.CONTINUE; + + testPassed('Verified'); + return tcuTestCase.IterateResult.STOP; + }; + + // 2D array filtering + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} minFilter + * @param {number} magFilter + * @param {number} wrapS + * @param {number} wrapT + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} numLayers + */ + es3fTextureFilteringTests.Texture2DArrayFilteringCase = function( + name, desc, minFilter, magFilter, wrapS, wrapT, + internalFormat, width, height, numLayers + ) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_minFilter = minFilter; + this.m_magFilter = magFilter; + this.m_wrapS = wrapS; + this.m_wrapT = wrapT; + this.m_internalFormat = internalFormat; + this.m_width = width; + this.m_height = height; + this.m_numLayers = numLayers; + this.m_gradientTex = null; + this.m_gridTex = null; + /** @type {glsTextureTestUtil.TextureRenderer} */ + this.m_renderer = new glsTextureTestUtil.TextureRenderer( + es3fTextureFilteringTests.version, + gluShaderUtil.precision.PRECISION_HIGHP + ); + this.m_textures = []; + this.m_caseNdx = 0; + this.m_cases = []; + }; + + es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + + es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype. + constructor = es3fTextureFilteringTests.Texture2DArrayFilteringCase; + + /** + * @constructor + * @param {gluTexture.Texture2DArray} tex_ + * @param {Array} lod_ + * @param {Array} offset_ + * @param {Array} layerRange_ + */ + es3fTextureFilteringTests.Texture2DArrayFilteringCase.FilterCase = + function( + tex_, lod_, offset_, layerRange_ + ) { + this.texture = tex_; + this.lod = lod_; + this.offset = offset_; + this.layerRange = layerRange_; + }; + + /* + * init + */ + es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype.init = + function() { + try { + /** @type {tcuTexture.TextureFormat} */ + var texFmt = gluTextureUtil.mapGLInternalFormat( + this.m_internalFormat + ); + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + var cScale = deMath.subtract( + fmtInfo.valueMax, fmtInfo.valueMin + ); + var cBias = fmtInfo.valueMin; + var numLevels = deMath.logToFloor( + Math.max(this.m_width, this.m_height) + ) + 1; + + // Create textures. + this.m_gradientTex = gluTexture.texture2DArrayFromInternalFormat( + gl, + this.m_internalFormat, this.m_width, + this.m_height, this.m_numLayers + ); + + this.m_gridTex = gluTexture.texture2DArrayFromInternalFormat( + gl, + this.m_internalFormat, this.m_width, + this.m_height, this.m_numLayers + ); + + var levelSwz = [ + [0, 1, 2, 3], + [2, 1, 3, 0], + [3, 0, 1, 2], + [1, 3, 2, 0] + ]; + + // Fill first gradient texture + // (gradient direction varies between layers). + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + this.m_gradientTex.getRefTexture().allocLevel(levelNdx); + + var levelBuf = + this.m_gradientTex.getRefTexture().getLevel(levelNdx); + + for (var layerNdx = 0; + layerNdx < this.m_numLayers; + layerNdx++) { + var swz = levelSwz[layerNdx % levelSwz.length]; + var gMin = deMath.add(deMath.multiply(deMath.swizzle( + [0.0, 0.0, 0.0, 1.0], [swz[0], swz[1], swz[2], swz[3]] + ), cScale), cBias); + var gMax = deMath.add(deMath.multiply(deMath.swizzle( + [1.0, 1.0, 1.0, 0.0], [swz[0], swz[1], swz[2], swz[3]] + ), cScale), cBias); + + tcuTextureUtil.fillWithComponentGradients2D( + tcuTextureUtil.getSubregion( + levelBuf, 0, 0, layerNdx, levelBuf.getWidth(), + levelBuf.getHeight(), 1 + ), gMin, gMax + ); + } + } + + // Fill second with grid texture (each layer has unique colors). + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + this.m_gridTex.getRefTexture().allocLevel(levelNdx); + + /** @type {tcuTexture.PixelBufferAccess} */ var levelBuf = + this.m_gridTex.getRefTexture().getLevel(levelNdx); + + for ( + var layerNdx = 0; + layerNdx < this.m_numLayers; + layerNdx++) { + var step = 0x00ffffff / (numLevels * this.m_numLayers - 1); + var rgb = step * (levelNdx + layerNdx * numLevels); + /** @type {number} */ var colorA = deMath.binaryOp( + 0xff000000, rgb, deMath.BinaryOp.OR + ); + /** @type {number} */ var colorB = deMath.binaryOp( + 0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR + ); + + tcuTextureUtil.fillWithGrid( + tcuTextureUtil.getSubregion( + levelBuf, 0, 0, layerNdx, levelBuf.getWidth(), + levelBuf.getHeight(), 1 + ), 4, + deMath.add( + deMath.multiply( + tcuRGBA.newRGBAFromValue(colorA).toVec(), + cScale + ), cBias + ), + deMath.add( + deMath.multiply( + tcuRGBA.newRGBAFromValue(colorB).toVec(), + cScale + ), cBias + ) + ); + } + } + + // Upload. + this.m_gradientTex.upload(); + this.m_gridTex.upload(); + + // Test cases + this.m_cases.push( + new es3fTextureFilteringTests. + Texture2DArrayFilteringCase.FilterCase( + this.m_gradientTex, [1.5, 2.8], [-1.0, -2.7], + [-0.5, this.m_numLayers + 0.5] + ) + ); + this.m_cases.push( + new es3fTextureFilteringTests. + Texture2DArrayFilteringCase.FilterCase( + this.m_gridTex, [0.2, 0.175], [-2.0, -3.7], + [-0.5, this.m_numLayers + 0.5] + ) + ); + this.m_cases.push( + new es3fTextureFilteringTests. + Texture2DArrayFilteringCase.FilterCase( + this.m_gridTex, [-0.8, -2.3], [0.2, -0.1], + [this.m_numLayers + 0.5, -0.5] + ) + ); + + // Level rounding - only in single-sample configs as + // multisample configs may produce smooth transition at the middle. + if (gl.getParameter(gl.SAMPLES) == 0) + this.m_cases.push( + new es3fTextureFilteringTests. + Texture2DArrayFilteringCase.FilterCase( + this.m_gradientTex, [-2.0, -1.5], [-0.1, 0.9], + [1.50001, 1.49999] + ) + ); + + this.m_caseNdx = 0; + } + catch (e) { + // Clean up to save memory. + this.deinit(); + throw e; + } + }; + + /** + * deinit + */ + es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype.deinit = + function() { + if (this.m_gradientTex) + gl.deleteTexture(this.m_gradientTex.getGLTexture()); + if (this.m_gridTex) + gl.deleteTexture(this.m_gridTex.getGLTexture()); + + this.m_gradientTex = null; + this.m_gridTex = null; + }; + + /** + * iterate + * @return {tcuTestCase.IterateResult} + */ + es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype.iterate = + function() { + /** @type {glsTextureTestUtil.RandomViewport} */ + var viewport = new glsTextureTestUtil.RandomViewport( + gl.canvas, TEX3D_VIEWPORT_WIDTH, + TEX3D_VIEWPORT_HEIGHT, deMath.binaryOp( + deString.deStringHash(this.fullName()), + deMath.deMathHash(this.m_caseNdx), + deMath.BinaryOp.XOR + ) + ); + + /** @type {es3fTextureFilteringTests.Texture2DArrayFilteringCase. + * FilterCase} */ var curCase = this.m_cases[this.m_caseNdx]; + + /** @type {tcuTexture.TextureFormat} */ + var texFmt = curCase.texture.getRefTexture().getFormat(); + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + + bufferedLogToConsole('Test' + this.m_caseNdx); + + /** @type {glsTextureTestUtil.ReferenceParams} */ + var refParams = new glsTextureTestUtil.ReferenceParams( + glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY + ); + + /** @type {tcuSurface.Surface} */ + var rendered = new tcuSurface.Surface(viewport.width, viewport.height); + + if (viewport.width < TEX3D_MIN_VIEWPORT_WIDTH || + viewport.height < TEX3D_MIN_VIEWPORT_HEIGHT) + throw new Error('Too small render target'); + + // Setup params for reference. + refParams.sampler = gluTextureUtil.mapGLSampler( + this.m_wrapS, this.m_wrapT, this.m_wrapT, + this.m_minFilter, this.m_magFilter + ); + refParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt); + refParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + refParams.colorBias = fmtInfo.lookupBias; + refParams.colorScale = fmtInfo.lookupScale; + + // Compute texture coordinates. + bufferedLogToConsole( + 'Approximate lod per axis = ' + curCase.lod + + ', offset = ' + curCase.offset + ); + + /** @type {number} */ var lodX = curCase.lod[0]; + /** @type {number} */ var lodY = curCase.lod[1]; + /** @type {number} */ var oX = curCase.offset[0]; + /** @type {number} */ var oY = curCase.offset[1]; + /** @type {number} */ var sX = Math.pow(2, lodX) * viewport.width / + this.m_gradientTex.getRefTexture().getWidth(); + /** @type {number} */ var sY = Math.pow(2, lodY) * viewport.height / + this.m_gradientTex.getRefTexture().getHeight(); + /** @type {number} */ var l0 = curCase.layerRange[0]; + /** @type {number} */ var l1 = curCase.layerRange[1]; + + /** @type {Array}*/ + var texCoord = [ + oX, oY, l0, + oX, oY + sY, l0 * 0.5 + l1 * 0.5, + oX + sX, oY, l0 * 0.5 + l1 * 0.5, + oX + sX, oY + sY, l1 + ]; + + gl.bindTexture(gl.TEXTURE_2D_ARRAY, curCase.texture.getGLTexture()); + gl.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, this.m_minFilter + ); + gl.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, this.m_magFilter + ); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, this.m_wrapS); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, this.m_wrapT); + + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + this.m_renderer.renderQuad( + 0, texCoord, + refParams + ); + rendered.readViewport( + gl, [viewport.x, viewport.y, viewport.width, viewport.height] + ); + + /** @type {boolean} */ + var isNearestOnly = this.m_minFilter == gl.NEAREST && + this.m_magFilter == gl.NEAREST; + /** @type {tcuPixelFormat.PixelFormat} */ + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + //(iVec4) + var colorBits = deMath.max( + deMath.addScalar( + glsTextureTestUtil.getBitsVec(pixelFormat), + // 1 inaccurate bit if nearest only, 2 otherwise + -1 * (isNearestOnly ? 1 : 2) + ), + [0, 0, 0, 0] + ); + /** @type {tcuTexLookupVerifier.LodPrecision} */ + var lodPrecision = new tcuTexLookupVerifier.LodPrecision(); + /** @type {tcuTexLookupVerifier.LookupPrecision} */ + var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision(); + + lodPrecision.derivateBits = 18; + lodPrecision.lodBits = 6; + lookupPrecision.colorThreshold = deMath.divide( + tcuTexLookupVerifier.computeFixedPointThreshold(colorBits), + refParams.colorScale + ); + lookupPrecision.coordBits = [20, 20, 20]; + lookupPrecision.uvwBits = [7, 7, 0]; + lookupPrecision.colorMask = + glsTextureTestUtil.getCompareMask(pixelFormat); + + var isHighQuality = glsTextureTestUtil.verifyTexture2DArrayResult( + rendered.getAccess(), curCase.texture.getRefTexture().getView(), + texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat); + + if (!isHighQuality) { + // Evaluate against lower precision requirements. + lodPrecision.lodBits = 3; + lookupPrecision.uvwBits = [3, 3, 0]; + + bufferedLogToConsole( + 'Warning: Verification against high ' + + 'precision requirements failed, ' + + 'trying with lower requirements.' + ); + + var isOk = glsTextureTestUtil.verifyTexture2DArrayResult( + rendered.getAccess(), curCase.texture.getRefTexture().getView(), + texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat + ); + + if (!isOk) { + bufferedLogToConsole( + 'ERROR: Verification against low precision requirements ' + + 'failed, failing test case.' + ); + testFailedOptions('Image verification failed', false); + //In JS version, one mistake and you're out + return tcuTestCase.IterateResult.STOP; + } else + checkMessage( + false, + 'Low-quality filtering result in iteration no. ' + + this.m_caseNdx + ); + } + + this.m_caseNdx += 1; + if (this.m_caseNdx < this.m_cases.length) + return tcuTestCase.IterateResult.CONTINUE; + + testPassed('Verified'); + return tcuTestCase.IterateResult.STOP; + }; + + // 3D filtering + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} minFilter + * @param {number} magFilter + * @param {number} wrapS + * @param {number} wrapT + * @param {number} wrapR + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + */ + es3fTextureFilteringTests.Texture3DFilteringCase = function( + name, desc, minFilter, magFilter, wrapS, wrapT, wrapR, internalFormat, + width, height, depth + ) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_minFilter = minFilter; + this.m_magFilter = magFilter; + this.m_wrapS = wrapS; + this.m_wrapT = wrapT; + this.m_wrapR = wrapR; + this.m_internalFormat = internalFormat; + this.m_width = width; + this.m_height = height; + this.m_depth = depth; + this.m_gradientTex = null; + this.m_gridTex = null; + /** @type {glsTextureTestUtil.TextureRenderer} */ + this.m_renderer = new glsTextureTestUtil.TextureRenderer( + es3fTextureFilteringTests.version, + gluShaderUtil.precision.PRECISION_HIGHP + ); + this.m_caseNdx = 0; + this.m_cases = []; + }; + + es3fTextureFilteringTests.Texture3DFilteringCase.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + + es3fTextureFilteringTests.Texture3DFilteringCase.prototype.constructor = + es3fTextureFilteringTests.Texture3DFilteringCase; + + /** + * @constructor + * @param {gluTexture.Texture3D} tex_ + * @param {Array} lod_ + * @param {Array} offset_ + */ + es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase = function( + tex_, lod_, offset_ + ) { + this.texture = tex_; + this.lod = lod_; + this.offset = offset_; + }; + + /** + * init + */ + es3fTextureFilteringTests.Texture3DFilteringCase.prototype.init = function( + ) { + try { + /** @type {tcuTexture.TextureFormat} */ + var texFmt = + gluTextureUtil.mapGLInternalFormat(this.m_internalFormat); + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + var cScale = deMath.subtract( + fmtInfo.valueMax, fmtInfo.valueMin + ); + var cBias = fmtInfo.valueMin; + var numLevels = deMath.logToFloor( + Math.max(Math.max(this.m_width, this.m_height), this.m_depth) + ) + 1; + + // Create textures. + this.m_gradientTex = gluTexture.texture3DFromInternalFormat( + gl, this.m_internalFormat, + this.m_width, this.m_height, this.m_depth + ); + + this.m_gridTex = gluTexture.texture3DFromInternalFormat( + gl, this.m_internalFormat, + this.m_width, this.m_height, this.m_depth + ); + + // Fill first gradient texture. + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + var gMin = deMath.add( + deMath.multiply([0.0, 0.0, 0.0, 1.0], cScale), cBias + ); + + var gMax = deMath.add( + deMath.multiply([1.0, 1.0, 1.0, 0.0], cScale), cBias + ); + + this.m_gradientTex.getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithComponentGradients( + this.m_gradientTex.getRefTexture().getLevel(levelNdx), + gMin, gMax + ); + } + + // Fill second with grid texture. + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + /** @type {number} */ var step = 0x00ffffff / numLevels; + /** @type {number} */ var rgb = step * levelNdx; + /** @type {number} */ var colorA = deMath.binaryOp( + 0xff000000, rgb, deMath.BinaryOp.OR + ); + /** @type {number} */ var colorB = deMath.binaryOp( + 0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR + ); + + this.m_gridTex.getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithGrid( + this.m_gridTex.getRefTexture().getLevel(levelNdx), 4, + deMath.add( + deMath.multiply( + tcuRGBA.newRGBAFromValue(colorA).toVec(), + cScale + ), + cBias + ), + deMath.add( + deMath.multiply( + tcuRGBA.newRGBAFromValue(colorB).toVec(), + cScale + ), + cBias + ) + ); + } + + // Upload. + this.m_gradientTex.upload(); + this.m_gridTex.upload(); + + // Test cases + this.m_cases.push( + new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase( + this.m_gradientTex, [1.5, 2.8, 1.0], [-1.0, -2.7, -2.275] + ) + ); + this.m_cases.push( + new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase( + this.m_gradientTex, [-2.0, -1.5, -1.8], [-0.1, 0.9, -0.25] + ) + ); + this.m_cases.push( + new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase( + this.m_gridTex, [0.2, 0.175, 0.3], [-2.0, -3.7, -1.825] + ) + ); + this.m_cases.push( + new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase( + this.m_gridTex, [-0.8, -2.3, -2.5], [0.2, -0.1, 1.325] + ) + ); + + this.m_caseNdx = 0; + } + catch (e) { + // Clean up to save memory. + this.deinit(); + throw e; + } + }; + + /** + * deinit + */ + es3fTextureFilteringTests.Texture3DFilteringCase.prototype.deinit = + function() { + if (this.m_gradientTex) + gl.deleteTexture(this.m_gradientTex.getGLTexture()); + if (this.m_gridTex) + gl.deleteTexture(this.m_gridTex.getGLTexture()); + + this.m_gradientTex = null; + this.m_gridTex = null; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fTextureFilteringTests.Texture3DFilteringCase.prototype.iterate = + function() { + /** @type {glsTextureTestUtil.RandomViewport} */ + var viewport = new glsTextureTestUtil.RandomViewport( + gl.canvas, TEX3D_VIEWPORT_WIDTH, + TEX3D_VIEWPORT_HEIGHT, deMath.binaryOp( + deString.deStringHash(this.fullName()), + deMath.deMathHash(this.m_caseNdx), + deMath.BinaryOp.XOR + ) + ); + + /** @type {es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase} + */ var curCase = this.m_cases[this.m_caseNdx]; + + /** @type {tcuTexture.TextureFormat} */ + var texFmt = curCase.texture.getRefTexture().getFormat(); + /** @type {tcuTextureUtil.TextureFormatInfo} */ + var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + + bufferedLogToConsole('Test' + this.m_caseNdx); + /** @type {glsTextureTestUtil.ReferenceParams} */ + var refParams = new glsTextureTestUtil.ReferenceParams( + glsTextureTestUtil.textureType.TEXTURETYPE_3D + ); + + /** @type {tcuSurface.Surface} */ + var rendered = new tcuSurface.Surface(viewport.width, viewport.height); + /** @type {Array}*/ + var texCoord = []; + + if (viewport.width < TEX3D_MIN_VIEWPORT_WIDTH || + viewport.height < TEX3D_MIN_VIEWPORT_HEIGHT) + throw new Error('Too small render target'); + + // Setup params for reference. + refParams.sampler = gluTextureUtil.mapGLSampler( + this.m_wrapS, this.m_wrapT, this.m_wrapR, + this.m_minFilter, this.m_magFilter + ); + + // Setup params for reference. + refParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt); + refParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + refParams.colorBias = fmtInfo.lookupBias; + refParams.colorScale = fmtInfo.lookupScale; + + // Compute texture coordinates. + bufferedLogToConsole('Approximate lod per axis = ' + curCase.lod + + ', offset = ' + curCase.offset); + + /** @type {number} */ var lodX = curCase.lod[0]; + /** @type {number} */ var lodY = curCase.lod[1]; + /** @type {number} */ var lodZ = curCase.lod[2]; + /** @type {number} */ var oX = curCase.offset[0]; + /** @type {number} */ var oY = curCase.offset[1]; + /** @type {number} */ var oZ = curCase.offset[2]; + /** @type {number} */ var sX = Math.pow(2, lodX) * viewport.width / + this.m_gradientTex.getRefTexture().getWidth(); + /** @type {number} */ var sY = Math.pow(2, lodY) * viewport.height / + this.m_gradientTex.getRefTexture().getHeight(); + /** @type {number} */ var sZ = Math.pow(2, lodZ) * + Math.max(viewport.width, viewport.height) / + this.m_gradientTex.getRefTexture().getDepth(); + + texCoord[0] = oX; texCoord[1] = oY; texCoord[2] = oZ; + texCoord[3] = oX; texCoord[4] = oY + sY; texCoord[5] = oZ + sZ * 0.5; + texCoord[6] = oX + sX; texCoord[7] = oY; texCoord[8] = oZ + sZ * 0.5; + texCoord[9] = oX + sX; texCoord[10] = oY + sY; texCoord[11] = oZ + sZ; + + gl.bindTexture(gl.TEXTURE_3D, curCase.texture.getGLTexture()); + gl.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, this.m_minFilter + ); + gl.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, this.m_magFilter + ); + gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, this.m_wrapS); + gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, this.m_wrapT); + gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_R, this.m_wrapR); + + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + this.m_renderer.renderQuad(0, texCoord, refParams); + rendered.readViewport( + gl, [viewport.x, viewport.y, viewport.width, viewport.height] + ); + + var isNearestOnly = this.m_minFilter == gl.NEAREST && + this.m_magFilter == gl.NEAREST; + /** @type {tcuPixelFormat.PixelFormat} */ + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + //(iVec4) + var colorBits = deMath.max( + deMath.addScalar( + glsTextureTestUtil.getBitsVec(pixelFormat), + // 1 inaccurate bit if nearest only, 2 otherwise + -1 * (isNearestOnly ? 1 : 2) + ), + [0, 0, 0, 0] + ); + /** @type {tcuTexLookupVerifier.LodPrecision} */ + var lodPrecision = new tcuTexLookupVerifier.LodPrecision(); + /** @type {tcuTexLookupVerifier.LookupPrecision} */ + var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision(); + + lodPrecision.derivateBits = 18; + lodPrecision.lodBits = 6; + lookupPrecision.colorThreshold = deMath.divide( + tcuTexLookupVerifier.computeFixedPointThreshold(colorBits), + refParams.colorScale + ); + lookupPrecision.coordBits = [20, 20, 20]; + lookupPrecision.uvwBits = [7, 7, 7]; + lookupPrecision.colorMask = + glsTextureTestUtil.getCompareMask(pixelFormat); + + var isHighQuality = glsTextureTestUtil.verifyTexture3DResult( + rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat + ); + + if (!isHighQuality) { + // Evaluate against lower precision requirements. + lodPrecision.lodBits = 4; + lookupPrecision.uvwBits = [4, 4, 4]; + + bufferedLogToConsole( + 'Warning: Verification against high precision ' + + 'requirements failed, trying with lower requirements.' + ); + + var isOk = glsTextureTestUtil.verifyTexture3DResult( + rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat + ); + + if (!isOk) { + bufferedLogToConsole('ERROR: Verification against low ' + + 'precision requirements failed, failing test case.' + ); + testFailedOptions('Image verification failed', false); + //In JS version, one mistake and you're out + return tcuTestCase.IterateResult.STOP; + } else + checkMessage( + false, + 'Low-quality filtering result in iteration no. ' + + this.m_caseNdx + ); + } + + this.m_caseNdx += 1; + if (this.m_caseNdx < this.m_cases.length) + return tcuTestCase.IterateResult.CONTINUE; + + testPassed('Verified'); + return tcuTestCase.IterateResult.STOP; + }; + + /** @typedef {{name: string, mode: number}} */ + es3fTextureFilteringTests.WrapMode; + + /** @typedef {{name: string, mode: number}} */ + es3fTextureFilteringTests.MinFilterMode; + + /** @typedef {{name: string, mode: number}} */ + es3fTextureFilteringTests.MagFilterModes; + + /** @typedef {{width: number, height: number}} */ + es3fTextureFilteringTests.Sizes2D; + + /** @typedef {{width: number, height: number}} */ + es3fTextureFilteringTests.SizesCube; + + /** @typedef {{width: number, height: number, numLayers: number}} */ + es3fTextureFilteringTests.Sizes2DArray; + + /** @typedef {{width: number, height: number, depth: number}} */ + es3fTextureFilteringTests.Sizes3D; + + /** @typedef {{name: string, format: number}} */ + es3fTextureFilteringTests.FilterableFormatsByType; + + /** + * init + */ + es3fTextureFilteringTests.TextureFilteringTests.prototype.init = + function() { + /** @type {Array} */ + var wrapModes = [{ + name: 'clamp', mode: gl.CLAMP_TO_EDGE + }, { + name: 'repeat', mode: gl.REPEAT + }, { + name: 'mirror', mode: gl.MIRRORED_REPEAT + } + ]; + + /** @type {Array} */ + var minFilterModes = [{ + name: 'nearest', mode: gl.NEAREST + }, { + name: 'linear', mode: gl.LINEAR + }, { + name: 'nearest_mipmap_nearest', mode: gl.NEAREST_MIPMAP_NEAREST + }, { + name: 'linear_mipmap_nearest', mode: gl.LINEAR_MIPMAP_NEAREST + }, { + name: 'nearest_mipmap_linear', mode: gl.NEAREST_MIPMAP_LINEAR + }, { + name: 'linear_mipmap_linear', mode: gl.LINEAR_MIPMAP_LINEAR + } + ]; + + /** @type {Array} */ + var magFilterModes = [{ + name: 'nearest', mode: gl.NEAREST + }, { + name: 'linear', mode: gl.LINEAR + } + ]; + + /** @type {Array} */ + var sizes2D = [{ + width: 4, height: 8 + }, { + width: 32, height: 64 + }, { + width: 128, height: 128 + }, { + width: 3, height: 7 + }, { + width: 31, height: 55 + }, { + width: 127, height: 99 + } + ]; + + /** @type {Array} */ + var sizesCube = [{ + width: 8, height: 8 + }, { + width: 64, height: 64 + }, { + width: 128, height: 128 + }, { + width: 7, height: 7 + }, { + width: 63, height: 63 + } + ]; + + /** @type {Array} */ + var sizes2DArray = [{ + width: 4, height: 8, numLayers: 8 + }, { + width: 32, height: 64, numLayers: 16 + }, { + width: 128, height: 32, numLayers: 64 + }, { + width: 3, height: 7, numLayers: 5 + }, { + width: 63, height: 63, numLayers: 63 + } + ]; + + /** @type {Array} */ + var sizes3D = [{ + width: 4, height: 8, depth: 8 + }, { + width: 32, height: 64, depth: 16 + }, { + width: 128, height: 32, depth: 64 + }, { + width: 3, height: 7, depth: 5 + }, { + width: 63, height: 63, depth: 63 + } + ]; + + /** @type {Array} */ + var filterableFormatsByType = [{ + name: 'rgba16f', format: gl.RGBA16F + }, { + name: 'r11f_g11f_b10f', format: gl.R11F_G11F_B10F + }, { + name: 'rgb9_e5', format: gl.RGB9_E5 + }, { + name: 'rgba8', format: gl.RGBA8 + }, { + name: 'rgba8_snorm', format: gl.RGBA8_SNORM + }, { + name: 'rgb565', format: gl.RGB565 + }, { + name: 'rgba4', format: gl.RGBA4 + }, { + name: 'rgb5_a1', format: gl.RGB5_A1 + }, { + name: 'srgb8_alpha8', format: gl.SRGB8_ALPHA8 + }, { + name: 'rgb10_a2', format: gl.RGB10_A2 + } + ]; + + // 2D texture filtering. + + // Formats. + /** @type {tcuTestCase.DeqpTest} */ + var formatsGroup; + for (var fmtNdx = 0; + fmtNdx < filterableFormatsByType.length; + fmtNdx++) { + formatsGroup = new tcuTestCase.DeqpTest( + '2d_formats', '2D Texture Formats'); + this.addChild(formatsGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + /** @type {number} */ + var minFilter = minFilterModes[filterNdx].mode; + /** @type {string} */ + var filterName = minFilterModes[filterNdx].name; + /** @type {number} */ + var format = filterableFormatsByType[fmtNdx].format; + /** @type {string} */ + var formatName = filterableFormatsByType[fmtNdx].name; + var isMipmap = minFilter != gl.NEAREST && + minFilter != gl.LINEAR; + /** @type {number} */ + var magFilter = isMipmap ? gl.LINEAR : minFilter; + /** @type {string} */ + var name = formatName + '_' + filterName; + /** @type {number} */ + var wrapS = gl.REPEAT; + /** @type {number} */ + var wrapT = gl.REPEAT; + /** @type {number} */ var width = 64; + /** @type {number} */ var height = 64; + + formatsGroup.addChild( + new es3fTextureFilteringTests.Texture2DFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + format, width, height + ) + ); + } + } + + // Sizes. + /** @type {tcuTestCase.DeqpTest} */ + var sizesGroup; + for (var sizeNdx = 0; sizeNdx < sizes2D.length; sizeNdx++) { + sizesGroup = new tcuTestCase.DeqpTest( + '2d_sizes', '2D Texture Sizes'); + this.addChild(sizesGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + minFilter = minFilterModes[filterNdx].mode; + filterName = minFilterModes[filterNdx].name; + format = gl.RGBA8; + isMipmap = minFilter != gl.NEAREST && + minFilter != gl.LINEAR; + magFilter = isMipmap ? gl.LINEAR : minFilter; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + width = sizes2D[sizeNdx].width; + height = sizes2D[sizeNdx].height; + name = '' + width + 'x' + height + '_' + filterName; + + sizesGroup.addChild( + new es3fTextureFilteringTests.Texture2DFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + format, width, height + ) + ); + } + } + + // Wrap modes. + /** @type {tcuTestCase.DeqpTest} */ + var combinationsGroup; + for (var minFilterNdx = 0; + minFilterNdx < minFilterModes.length; + minFilterNdx++) { + combinationsGroup = new tcuTestCase.DeqpTest( + '2d_combinations', '2D Filter and wrap mode combinations'); + this.addChild(combinationsGroup); + for (var magFilterNdx = 0; + magFilterNdx < magFilterModes.length; + magFilterNdx++) { + for (var wrapSNdx = 0; + wrapSNdx < wrapModes.length; + wrapSNdx++) { + for (var wrapTNdx = 0; + wrapTNdx < wrapModes.length; + wrapTNdx++) { + minFilter = minFilterModes[minFilterNdx].mode; + magFilter = magFilterModes[magFilterNdx].mode; + format = gl.RGBA8; + wrapS = wrapModes[wrapSNdx].mode; + wrapT = wrapModes[wrapTNdx].mode; + width = 63; + height = 57; + name = minFilterModes[minFilterNdx].name + '_' + + magFilterModes[magFilterNdx].name + '_' + + wrapModes[wrapSNdx].name + '_' + + wrapModes[wrapTNdx].name; + + combinationsGroup.addChild( + new + es3fTextureFilteringTests.Texture2DFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + format, width, height + ) + ); + } + } + } + } + + // Cube map texture filtering. + + // Formats. + for (var fmtNdx = 0; + fmtNdx < filterableFormatsByType.length; + fmtNdx++) { + formatsGroup = new tcuTestCase.DeqpTest( + 'cube_formats', 'Cube Texture Formats'); + this.addChild(formatsGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + minFilter = minFilterModes[filterNdx].mode; + filterName = minFilterModes[filterNdx].name; + format = filterableFormatsByType[fmtNdx].format; + formatName = filterableFormatsByType[fmtNdx].name; + isMipmap = minFilter != gl.NEAREST && + minFilter != gl.LINEAR; + magFilter = isMipmap ? gl.LINEAR : minFilter; + name = formatName + '_' + filterName; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + width = 64; + height = 64; + + formatsGroup.addChild( + new es3fTextureFilteringTests.TextureCubeFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + false /* always sample exterior as well */, + format, width, height + ) + ); + } + } + + // Sizes. + for (var sizeNdx = 0; sizeNdx < sizesCube.length; sizeNdx++) { + sizesGroup = new tcuTestCase.DeqpTest( + 'cube_sizes', 'Cube Texture Sizes'); + this.addChild(sizesGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + minFilter = minFilterModes[filterNdx].mode; + filterName = minFilterModes[filterNdx].name; + var format = gl.RGBA8; + isMipmap = minFilter != gl.NEAREST && + minFilter != gl.LINEAR; + magFilter = isMipmap ? gl.LINEAR : minFilter; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + width = sizesCube[sizeNdx].width; + height = sizesCube[sizeNdx].height; + name = '' + width + 'x' + height + '_' + filterName; + + sizesGroup.addChild( + new es3fTextureFilteringTests.TextureCubeFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + false, format, width, height + ) + ); + } + } + + // Filter/wrap mode combinations. + for (var minFilterNdx = 0; + minFilterNdx < minFilterModes.length; + minFilterNdx++) { + combinationsGroup = new tcuTestCase.DeqpTest( + 'cube_combinations', 'Cube Filter and wrap mode combinations' + ); + this.addChild(combinationsGroup); + for (var magFilterNdx = 0; + magFilterNdx < magFilterModes.length; + magFilterNdx++) { + for (var wrapSNdx = 0; + wrapSNdx < wrapModes.length; + wrapSNdx++) { + for (var wrapTNdx = 0; + wrapTNdx < wrapModes.length; + wrapTNdx++) { + minFilter = minFilterModes[minFilterNdx].mode; + magFilter = magFilterModes[magFilterNdx].mode; + format = gl.RGBA8; + wrapS = wrapModes[wrapSNdx].mode; + wrapT = wrapModes[wrapTNdx].mode; + width = 63; + height = 63; + name = minFilterModes[minFilterNdx].name + '_' + + magFilterModes[magFilterNdx].name + '_' + + wrapModes[wrapSNdx].name + '_' + + wrapModes[wrapTNdx].name; + + combinationsGroup.addChild( + new es3fTextureFilteringTests. + TextureCubeFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + false, format, width, height + ) + ); + } + } + } + } + + // Cases with no visible cube edges. + /** @type {tcuTestCase.DeqpTest} */ + var onlyFaceInteriorGroup = new tcuTestCase.DeqpTest( + 'cube_no_edges_visible', "Don't sample anywhere near a face's edges" + ); + this.addChild(onlyFaceInteriorGroup); + + for (var isLinearI = 0; isLinearI <= 1; isLinearI++) { + var isLinear = isLinearI != 0; + var filter = isLinear ? gl.LINEAR : gl.NEAREST; + + onlyFaceInteriorGroup.addChild( + new es3fTextureFilteringTests.TextureCubeFilteringCase( + isLinear ? 'linear' : 'nearest', '', + filter, filter, gl.REPEAT, gl.REPEAT, + true, gl.RGBA8, 63, 63 + ) + ); + } + + // Formats. + for (var fmtNdx = 0; + fmtNdx < filterableFormatsByType.length; + fmtNdx++) { + formatsGroup = new tcuTestCase.DeqpTest( + '2d_array_formats', '2D Array Texture Formats'); + this.addChild(formatsGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + minFilter = minFilterModes[filterNdx].mode; + filterName = minFilterModes[filterNdx].name; + format = filterableFormatsByType[fmtNdx].format; + var formatName = filterableFormatsByType[fmtNdx].name; + isMipmap = minFilter != gl.NEAREST && + minFilter != gl.LINEAR; + magFilter = isMipmap ? gl.LINEAR : minFilter; + name = formatName + '_' + filterName; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + width = 128; + height = 128; + /** @type {number} */ var numLayers = 8; + + formatsGroup.addChild( + new es3fTextureFilteringTests.Texture2DArrayFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + format, width, height, numLayers + ) + ); + } + } + + // Sizes. + for (var sizeNdx = 0; sizeNdx < sizes2DArray.length; sizeNdx++) { + sizesGroup = new tcuTestCase.DeqpTest( + '2d_array_sizes', '2D Array Texture Sizes'); + this.addChild(sizesGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + minFilter = minFilterModes[filterNdx].mode; + filterName = minFilterModes[filterNdx].name; + format = gl.RGBA8; + isMipmap = minFilter != gl.NEAREST && + minFilter != gl.LINEAR; + magFilter = isMipmap ? gl.LINEAR : minFilter; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + width = sizes2DArray[sizeNdx].width; + height = sizes2DArray[sizeNdx].height; + numLayers = sizes2DArray[sizeNdx].numLayers; + name = '' + width + 'x' + height + 'x' + + numLayers + '_' + filterName; + + sizesGroup.addChild( + new es3fTextureFilteringTests.Texture2DArrayFilteringCase( + name, '', minFilter, magFilter, wrapS, wrapT, + format, width, height, numLayers + ) + ); + } + } + + // Wrap modes. + for (var minFilterNdx = 0; + minFilterNdx < minFilterModes.length; + minFilterNdx++) { + combinationsGroup = new tcuTestCase.DeqpTest( + '2d_array_combinations', + '2D Array Filter and wrap mode combinations'); + this.addChild(combinationsGroup); + for (var magFilterNdx = 0; + magFilterNdx < magFilterModes.length; + magFilterNdx++) { + for (var wrapSNdx = 0; + wrapSNdx < wrapModes.length; + wrapSNdx++) { + for (var wrapTNdx = 0; + wrapTNdx < wrapModes.length; + wrapTNdx++) { + minFilter = minFilterModes[minFilterNdx].mode; + magFilter = magFilterModes[magFilterNdx].mode; + format = gl.RGBA8; + wrapS = wrapModes[wrapSNdx].mode; + wrapT = wrapModes[wrapTNdx].mode; + width = 123; + height = 107; + numLayers = 7; + name = minFilterModes[minFilterNdx].name + '_' + + magFilterModes[magFilterNdx].name + '_' + + wrapModes[wrapSNdx].name + '_' + + wrapModes[wrapTNdx].name; + + combinationsGroup.addChild( + new es3fTextureFilteringTests. + Texture2DArrayFilteringCase( + name, '', minFilter, magFilter, + wrapS, wrapT, format, + width, height, numLayers + ) + ); + } + } + } + } + + // 3D texture filtering. + + // Formats. + /** @type {number} */ var depth = 64; + for (var fmtNdx = 0; + fmtNdx < filterableFormatsByType.length; + fmtNdx++) { + formatsGroup = new tcuTestCase.DeqpTest( + '3d_formats', '3D Texture Formats'); + this.addChild(formatsGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + minFilter = minFilterModes[filterNdx].mode; + filterName = minFilterModes[filterNdx].name; + format = filterableFormatsByType[fmtNdx].format; + formatName = filterableFormatsByType[fmtNdx].name; + isMipmap = minFilter != gl.NEAREST && + minFilter != gl.LINEAR; + magFilter = isMipmap ? gl.LINEAR : minFilter; + name = formatName + '_' + filterName; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + /** @type {number} */ var wrapR = gl.REPEAT; + width = 64; + height = 64; + depth = 64; + + formatsGroup.addChild( + new es3fTextureFilteringTests.Texture3DFilteringCase( + name, '', minFilter, magFilter, + wrapS, wrapT, wrapR, format, + width, height, depth + ) + ); + } + } + + // Sizes. + for (var sizeNdx = 0; sizeNdx < sizes3D.length; sizeNdx++) { + sizesGroup = new tcuTestCase.DeqpTest( + '3d_sizes', '3D Texture Sizes'); + this.addChild(sizesGroup); + for (var filterNdx = 0; + filterNdx < minFilterModes.length; + filterNdx++) { + minFilter = minFilterModes[filterNdx].mode; + filterName = minFilterModes[filterNdx].name; + format = gl.RGBA8; + isMipmap = + minFilter != gl.NEAREST && minFilter != gl.LINEAR; + magFilter = + isMipmap ? gl.LINEAR : minFilter; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + wrapR = gl.REPEAT; + width = sizes3D[sizeNdx].width; + height = sizes3D[sizeNdx].height; + depth = sizes3D[sizeNdx].depth; + name = '' + width + 'x' + height + 'x' + depth + + '_' + filterName; + + sizesGroup.addChild( + new es3fTextureFilteringTests.Texture3DFilteringCase( + name, '', minFilter, magFilter, + wrapS, wrapT, wrapR, format, + width, height, depth + ) + ); + } + } + + // Wrap modes. + for (var minFilterNdx = 0; + minFilterNdx < minFilterModes.length; + minFilterNdx++) { + for (var magFilterNdx = 0; + magFilterNdx < magFilterModes.length; + magFilterNdx++) { + for (var wrapSNdx = 0; + wrapSNdx < wrapModes.length; + wrapSNdx++) { + combinationsGroup = new tcuTestCase.DeqpTest( + '3d_combinations', + '3D Filter and wrap mode combinations'); + this.addChild(combinationsGroup); + for (var wrapTNdx = 0; + wrapTNdx < wrapModes.length; + wrapTNdx++) { + for (var wrapRNdx = 0; + wrapRNdx < wrapModes.length; + wrapRNdx++) { + minFilter = minFilterModes[minFilterNdx].mode; + magFilter = magFilterModes[magFilterNdx].mode; + format = gl.RGBA8; + wrapS = wrapModes[wrapSNdx].mode; + wrapT = wrapModes[wrapTNdx].mode; + wrapR = wrapModes[wrapRNdx].mode; + width = 63; + height = 57; + depth = 67; + name = minFilterModes[minFilterNdx].name + '_' + + magFilterModes[magFilterNdx].name + '_' + + wrapModes[wrapSNdx].name + '_' + + wrapModes[wrapTNdx].name + '_' + + wrapModes[wrapRNdx].name; + + combinationsGroup.addChild( + new + es3fTextureFilteringTests. + Texture3DFilteringCase( + name, '', minFilter, magFilter, + wrapS, wrapT, wrapR, format, + width, height, depth + ) + ); + } + } + } + } + } + }; + + /** + * Create and execute the test cases + * @param {WebGL2RenderingContext} context + * @param {Array=} range Test range + */ + es3fTextureFilteringTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + + state.setRoot(new es3fTextureFilteringTests.TextureFilteringTests()); + if (range) + state.setRange(range); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to run tests', false); + tcuTestCase.runner.terminate(); + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js new file mode 100644 index 000000000..7300225a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js @@ -0,0 +1,1185 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fTextureFormatTests'); +goog.require('framework.common.tcuCompressedTexture'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluStrUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('modules.shared.glsTextureTestUtil'); + +goog.scope(function() { + +var es3fTextureFormatTests = functional.gles3.es3fTextureFormatTests; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var deRandom = framework.delibs.debase.deRandom; +var tcuTestCase = framework.common.tcuTestCase; +var tcuSurface = framework.common.tcuSurface; +var gluTexture = framework.opengl.gluTexture; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var glsTextureTestUtil = modules.shared.glsTextureTestUtil; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var gluStrUtil = framework.opengl.gluStrUtil; +var deMath = framework.delibs.debase.deMath; +var tcuCompressedTexture = framework.common.tcuCompressedTexture; + +/** @type {WebGL2RenderingContext} */ var gl; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +es3fTextureFormatTests.version = '300 es'; + +es3fTextureFormatTests.testDescription = function() { + var test = tcuTestCase.runner.currentTest; + return test.description; +}; + +es3fTextureFormatTests.setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fTextureFormatTests.Texture2DFormatCase = function(descriptor) { + tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description); + this.m_format = descriptor.format; + this.m_dataType = descriptor.dataType; + this.m_width = descriptor.width; + this.m_height = descriptor.height; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP); +}; + +es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Texture2DFormatCase, tcuTestCase.DeqpTest); + +es3fTextureFormatTests.Texture2DFormatCase.prototype.init = function() { + /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format); + /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt); + /* TODO : Port + + std::ostringstream fmtName; + + if (m_dataType) + fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType); + else + fmtName << glu::getPixelFormatStr(m_format); + + log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height + << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient" + << TestLog::EndMessage; + */ + + this.m_texture = this.m_dataType ? + gluTexture.texture2DFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height) : // Implicit internal format. + gluTexture.texture2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height); // Explicit internal format. + + // Fill level 0. + this.m_texture.getRefTexture().allocLevel(0); + tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), spec.valueMin, spec.valueMax); +}; + +es3fTextureFormatTests.Texture2DFormatCase.prototype.deinit = function() { + /* TODO: Implement */ +}; + +es3fTextureFormatTests.Texture2DFormatCase.prototype.iterate = function() { + /* TODO: Implement */ + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/); + + /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* TODO: Implement + // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1); + */ + var threshold = [3, 3, 3, 3]; + var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D); + + /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat()); + /** @const */ var wrapS = gl.CLAMP_TO_EDGE; + /** @const */ var wrapT = gl.CLAMP_TO_EDGE; + /** @const */ var minFilter = gl.NEAREST; + /** @const */ var magFilter = gl.NEAREST; + + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + + renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat()); + renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST); + renderParams.colorScale = spec.lookupScale; + renderParams.colorBias = spec.lookupBias; + + var texCoord = glsTextureTestUtil.computeQuadTexCoord2D([0, 0], [1, 1]); + + // log << TestLog::Message << "Texture parameters:" + // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS) + // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT) + // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter) + // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter) + // << TestLog::EndMessage; + + // Setup base viewport. + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + // Upload texture data to GL. + this.m_texture.upload(); + + // Bind to unit 0. + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture()); + + // Setup nearest neighbor filtering and clamp-to-edge. + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + + // // Draw. + this.m_renderer.renderQuad(0, texCoord, renderParams); + renderedFrame.readViewport(gl, viewport); + + // // Compute reference. + glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/), + this.m_texture.getRefTexture(), texCoord, renderParams); + + // Compare and log. + var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold); + + assertMsgOptions(isOk, es3fTextureFormatTests.testDescription(), true, false); + return tcuTestCase.IterateResult.STOP; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fTextureFormatTests.TextureCubeFormatCase = function(descriptor) { + tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description); + this.m_format = descriptor.format; + this.m_dataType = descriptor.dataType; + this.m_width = descriptor.width; + this.m_height = descriptor.height; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP); + DE_ASSERT(this.m_width == this.m_height); +}; + +es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.TextureCubeFormatCase, tcuTestCase.DeqpTest); + +es3fTextureFormatTests.TextureCubeFormatCase.prototype.init = function() { + /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format); + /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt); + /* TODO : Port + + std::ostringstream fmtName; + + if (m_dataType) + fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType); + else + fmtName << glu::getPixelFormatStr(m_format); + + log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height + << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient" + << TestLog::EndMessage; + */ + + this.m_texture = this.m_dataType ? + gluTexture.cubeFromFormat(gl, this.m_format, this.m_dataType, this.m_width) : // Implicit internal format. + gluTexture.cubeFromInternalFormat(gl, this.m_format, this.m_width); // Explicit internal format. + + // Fill level 0. + for (var face in tcuTexture.CubeFace) { + var gMin = null; + var gMax = null; + + switch (tcuTexture.CubeFace[face]) { + case 0: gMin = deMath.swizzle(spec.valueMin, [0, 1, 2, 3]); gMax = deMath.swizzle(spec.valueMax, [0, 1, 2, 3]); break; + case 1: gMin = deMath.swizzle(spec.valueMin, [2, 1, 0, 3]); gMax = deMath.swizzle(spec.valueMax, [2, 1, 0, 3]); break; + case 2: gMin = deMath.swizzle(spec.valueMin, [1, 2, 0, 3]); gMax = deMath.swizzle(spec.valueMax, [1, 2, 0, 3]); break; + case 3: gMin = deMath.swizzle(spec.valueMax, [0, 1, 2, 3]); gMax = deMath.swizzle(spec.valueMin, [0, 1, 2, 3]); break; + case 4: gMin = deMath.swizzle(spec.valueMax, [2, 1, 0, 3]); gMax = deMath.swizzle(spec.valueMin, [2, 1, 0, 3]); break; + case 5: gMin = deMath.swizzle(spec.valueMax, [1, 2, 0, 3]); gMax = deMath.swizzle(spec.valueMin, [1, 2, 0, 3]); break; + default: + DE_ASSERT(false); + } + + this.m_texture.getRefTexture().allocLevel(tcuTexture.CubeFace[face], 0); + tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevelFace(0, tcuTexture.CubeFace[face]), gMin, gMax); + } + + this.m_texture.upload(); + this.m_curFace = 0; + this.m_isOk = true; +}; + +es3fTextureFormatTests.TextureCubeFormatCase.prototype.testFace = function(face) { + /* TODO: Implement */ + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/); + + /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* TODO: Implement + // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1); + */ + var threshold = [3, 3, 3, 3]; + var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_CUBE); + + /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat()); + /** @const */ var wrapS = gl.CLAMP_TO_EDGE; + /** @const */ var wrapT = gl.CLAMP_TO_EDGE; + /** @const */ var minFilter = gl.NEAREST; + /** @const */ var magFilter = gl.NEAREST; + + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + + renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat()); + renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST); + renderParams.colorScale = spec.lookupScale; + renderParams.colorBias = spec.lookupBias; + + // Log render info on first face. + if (face === tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X) { + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + } + + var texCoord = glsTextureTestUtil.computeQuadTexCoordCube(face); + + // log << TestLog::Message << "Texture parameters:" + // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS) + // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT) + // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter) + // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter) + // << TestLog::EndMessage; + + // Setup base viewport. + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + // Bind to unit 0. + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_texture.getGLTexture()); + + // Setup nearest neighbor filtering and clamp-to-edge. + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, wrapT); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, magFilter); + + // // Draw. + this.m_renderer.renderQuad(0, texCoord, renderParams); + renderedFrame.readViewport(gl, viewport); + + // // Compute reference. + glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/), + this.m_texture.getRefTexture(), texCoord, renderParams); + + // Compare and log. + var skipPixels = null; + if (renderParams.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_INT || + renderParams.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT) { + // Skip top right pixel due to Mac Intel driver bug. + // https://github.com/KhronosGroup/WebGL/issues/1819 + skipPixels = [ + [this.m_width - 1, this.m_height - 1] + ]; + } + var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold, skipPixels); + + assertMsgOptions(isOk, 'Face: ' + this.m_curFace + ' ' + es3fTextureFormatTests.testDescription(), true, false); + return isOk; +}; + +es3fTextureFormatTests.TextureCubeFormatCase.prototype.iterate = function() { + debug('Testing face ' + this.m_curFace); + // Execute test for all faces. + if (!this.testFace(this.m_curFace)) + this.m_isOk = false; + + this.m_curFace += 1; + + if (this.m_curFace < Object.keys(tcuTexture.CubeFace).length) + return tcuTestCase.IterateResult.CONTINUE; + else + return tcuTestCase.IterateResult.STOP; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fTextureFormatTests.Texture2DArrayFormatCase = function(descriptor) { + tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description); + this.m_format = descriptor.format; + this.m_dataType = descriptor.dataType; + this.m_width = descriptor.width; + this.m_height = descriptor.height; + this.m_numLayers = descriptor.numLayers; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP); +}; + +es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Texture2DArrayFormatCase, tcuTestCase.DeqpTest); + +es3fTextureFormatTests.Texture2DArrayFormatCase.prototype.init = function() { + /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format); + /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt); + /* TODO : Port + + std::ostringstream fmtName; + + if (m_dataType) + fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType); + else + fmtName << glu::getPixelFormatStr(m_format); + + log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height + << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient" + << TestLog::EndMessage; + */ + + this.m_texture = this.m_dataType ? + gluTexture.texture2DArrayFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height, this.m_numLayers) : // Implicit internal format. + gluTexture.texture2DArrayFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_numLayers); // Explicit internal format. + + this.m_texture.getRefTexture().allocLevel(0); + tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), spec.valueMin, spec.valueMax); + + this.m_curLayer = 0; + this.m_isOk = true; +}; + +es3fTextureFormatTests.Texture2DArrayFormatCase.prototype.testLayer = function(layerNdx) { + /* TODO: Implement */ + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/); + + /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* TODO: Implement + // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1); + */ + var threshold = [3, 3, 3, 3]; + var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY); + + /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat()); + /** @const */ var wrapS = gl.CLAMP_TO_EDGE; + /** @const */ var wrapT = gl.CLAMP_TO_EDGE; + /** @const */ var minFilter = gl.NEAREST; + /** @const */ var magFilter = gl.NEAREST; + + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + + renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat()); + renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST); + renderParams.colorScale = spec.lookupScale; + renderParams.colorBias = spec.lookupBias; + + var texCoord = glsTextureTestUtil.computeQuadTexCoord2DArray(layerNdx, [0, 0], [1, 1]); + + // log << TestLog::Message << "Texture parameters:" + // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS) + // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT) + // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter) + // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter) + // << TestLog::EndMessage; + + // Setup base viewport. + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + this.m_texture.upload(); + + // Bind to unit 0. + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, this.m_texture.getGLTexture()); + + // Setup nearest neighbor filtering and clamp-to-edge. + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, wrapT); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, magFilter); + + // // Draw. + this.m_renderer.renderQuad(0, texCoord, renderParams); + renderedFrame.readViewport(gl, viewport); + + // // Compute reference. + glsTextureTestUtil.sampleTexture2DArray(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/), + this.m_texture.getRefTexture().getView(), texCoord, renderParams); + + // Compare and log. + var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold); + + assertMsgOptions(isOk, 'Layer: ' + this.m_curLayer + ' ' + es3fTextureFormatTests.testDescription(), true, false); + return isOk; +}; + +es3fTextureFormatTests.Texture2DArrayFormatCase.prototype.iterate = function() { + debug('Testing layer ' + this.m_curLayer); + // Execute test for all layers. + if (!this.testLayer(this.m_curLayer)) + this.m_isOk = false; + + this.m_curLayer += 1; + + if (this.m_curLayer == this.m_numLayers) + return tcuTestCase.IterateResult.STOP; + else + return tcuTestCase.IterateResult.CONTINUE; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fTextureFormatTests.Texture3DFormatCase = function(descriptor) { + tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description); + this.m_format = descriptor.format; + this.m_dataType = descriptor.dataType; + this.m_width = descriptor.width; + this.m_height = descriptor.height; + this.m_depth = descriptor.depth; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP); +}; + +es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Texture3DFormatCase, tcuTestCase.DeqpTest); + +es3fTextureFormatTests.Texture3DFormatCase.prototype.init = function() { + /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format); + /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt); + /* TODO : Port + + std::ostringstream fmtName; + + if (m_dataType) + fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType); + else + fmtName << glu::getPixelFormatStr(m_format); + + log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height + << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient" + << TestLog::EndMessage; + */ + + this.m_texture = this.m_dataType ? + gluTexture.texture3DFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height, this.m_depth) : // Implicit internal format. + gluTexture.texture3DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_depth); // Explicit internal format. + + this.m_texture.getRefTexture().allocLevel(0); + tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), spec.valueMin, spec.valueMax); + + this.m_curSlice = 0; + this.m_isOk = true; +}; + +es3fTextureFormatTests.Texture3DFormatCase.prototype.testSlice = function(sliceNdx) { + /* TODO: Implement */ + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/); + + /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* TODO: Implement + // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1); + */ + var threshold = [3, 3, 3, 3]; + var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_3D); + + /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat()); + var r = (sliceNdx + 0.5) / this.m_depth; + /** @const */ var wrapS = gl.CLAMP_TO_EDGE; + /** @const */ var wrapT = gl.CLAMP_TO_EDGE; + /** @const */ var minFilter = gl.NEAREST; + /** @const */ var magFilter = gl.NEAREST; + + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + + renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat()); + renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST); + renderParams.colorScale = spec.lookupScale; + renderParams.colorBias = spec.lookupBias; + + var texCoord = glsTextureTestUtil.computeQuadTexCoord3D([0, 0, r], [1, 1, r], [0, 1, 2]); + + // log << TestLog::Message << "Texture parameters:" + // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS) + // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT) + // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter) + // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter) + // << TestLog::EndMessage; + + // Setup base viewport. + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + this.m_texture.upload(); + + // Bind to unit 0. + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_3D, this.m_texture.getGLTexture()); + + // Setup nearest neighbor filtering and clamp-to-edge. + gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, wrapT); + gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, magFilter); + + // // Draw. + this.m_renderer.renderQuad(0, texCoord, renderParams); + renderedFrame.readViewport(gl, viewport); + + // // Compute reference. + glsTextureTestUtil.sampleTexture3D(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/), + this.m_texture.getRefTexture(), texCoord, renderParams); + + // Compare and log. + var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold); + + assertMsgOptions(isOk, 'Slice: ' + this.m_curSlice + ' ' + es3fTextureFormatTests.testDescription(), true, false); + return isOk; +}; + +es3fTextureFormatTests.Texture3DFormatCase.prototype.iterate = function() { + debug('Testing slice ' + this.m_curSlice); + // Execute test for all layers. + if (!this.testSlice(this.m_curSlice)) + this.m_isOk = false; + + this.m_curSlice += 1; + + if (this.m_curSlice >= this.m_depth) + return tcuTestCase.IterateResult.STOP; + else + return tcuTestCase.IterateResult.CONTINUE; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fTextureFormatTests.Compressed2DFormatCase = function(descriptor) { + tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description); + this.m_format = descriptor.format; + this.m_dataType = descriptor.dataType; + this.m_width = descriptor.width; + this.m_height = descriptor.height; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP); +}; + +es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Compressed2DFormatCase, tcuTestCase.DeqpTest); + +es3fTextureFormatTests.Compressed2DFormatCase.prototype.init = function() { + var compressed = new tcuCompressedTexture.CompressedTexture(this.m_format, this.m_width, this.m_height); + var rand = new deRandom.Random(0); + for (var i = 0; i < compressed.m_data.length; i++) { + compressed.m_data[i] = rand.getInt(0, 255); + } + this.m_texture = gluTexture.compressed2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, compressed); +}; + +es3fTextureFormatTests.Compressed2DFormatCase.prototype.deinit = function() { + /* TODO: Implement */ +}; + +es3fTextureFormatTests.Compressed2DFormatCase.prototype.iterate = function() { + /* TODO: Implement */ + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/); + + /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* TODO: Implement + // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1); + */ + var threshold = [3, 3, 3, 3]; + var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D); + + /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat()); + /** @const */ var wrapS = gl.CLAMP_TO_EDGE; + /** @const */ var wrapT = gl.CLAMP_TO_EDGE; + /** @const */ var minFilter = gl.NEAREST; + /** @const */ var magFilter = gl.NEAREST; + + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + + renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat()); + renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST); + renderParams.colorScale = spec.lookupScale; + renderParams.colorBias = spec.lookupBias; + + var texCoord = glsTextureTestUtil.computeQuadTexCoord2D([0, 0], [1, 1]); + + // log << TestLog::Message << "Texture parameters:" + // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS) + // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT) + // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter) + // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter) + // << TestLog::EndMessage; + + // Setup base viewport. + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + // Bind to unit 0. + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture()); + + // Setup nearest neighbor filtering and clamp-to-edge. + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + + // // Draw. + this.m_renderer.renderQuad(0, texCoord, renderParams); + renderedFrame.readViewport(gl, viewport); + + // // Compute reference. + glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/), + this.m_texture.getRefTexture(), texCoord, renderParams); + + // Compare and log. + var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold); + + assertMsgOptions(isOk, es3fTextureFormatTests.testDescription(), true, false); + return tcuTestCase.IterateResult.STOP; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fTextureFormatTests.CompressedCubeFormatCase = function(descriptor) { + tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description); + this.m_format = descriptor.format; + this.m_dataType = descriptor.dataType; + this.m_width = descriptor.width; + this.m_height = descriptor.height; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP); + this.m_curFace = 0; + this.m_isOk = true; + DE_ASSERT(this.m_width == this.m_height); +}; + +es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.CompressedCubeFormatCase, tcuTestCase.DeqpTest); + +es3fTextureFormatTests.CompressedCubeFormatCase.prototype.init = function() { + var compressed = new tcuCompressedTexture.CompressedTexture(this.m_format, this.m_width, this.m_height); + var rand = new deRandom.Random(0); + for (var i = 0; i < compressed.m_data.length; i++) { + compressed.m_data[i] = rand.getInt(0, 255); + } + this.m_texture = gluTexture.compressedCubeFromInternalFormat(gl, this.m_format, this.m_width, compressed); +}; + +es3fTextureFormatTests.CompressedCubeFormatCase.prototype.testFace = function(face) { + /* TODO: Implement */ + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/); + + /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /* TODO: Implement + // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1); + */ + // Threshold high enough to cover numerical errors in software decoders on Windows and Mac. Threshold is 17 in native dEQP. + var threshold = [6, 6, 6, 6]; + var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_CUBE); + + /** @const */ var wrapS = gl.CLAMP_TO_EDGE; + /** @const */ var wrapT = gl.CLAMP_TO_EDGE; + /** @const */ var minFilter = gl.NEAREST; + /** @const */ var magFilter = gl.NEAREST; + + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + + renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat()); + renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, + tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST); + + // Log render info on first face. + if (face === tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X) { + renderParams.flags.log_programs = true; + renderParams.flags.log_uniforms = true; + } + + var texCoord = glsTextureTestUtil.computeQuadTexCoordCube(face); + + // log << TestLog::Message << "Texture parameters:" + // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS) + // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT) + // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter) + // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter) + // << TestLog::EndMessage; + + // Setup base viewport. + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + // Bind to unit 0. + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_texture.getGLTexture()); + + // Setup nearest neighbor filtering and clamp-to-edge. + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, wrapT); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, magFilter); + + // // Draw. + this.m_renderer.renderQuad(0, texCoord, renderParams); + renderedFrame.readViewport(gl, viewport); + + // // Compute reference. + glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/), + this.m_texture.getRefTexture(), texCoord, renderParams); + + // Compare and log. + var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold); + + assertMsgOptions(isOk, 'Face: ' + this.m_curFace + ' ' + es3fTextureFormatTests.testDescription(), true, false); + return isOk; +}; + +es3fTextureFormatTests.CompressedCubeFormatCase.prototype.iterate = function() { + debug('Testing face ' + this.m_curFace); + // Execute test for all faces. + if (!this.testFace(this.m_curFace)) + this.m_isOk = false; + + this.m_curFace += 1; + + if (this.m_curFace < Object.keys(tcuTexture.CubeFace).length) + return tcuTestCase.IterateResult.CONTINUE; + else + return tcuTestCase.IterateResult.STOP; +}; + +es3fTextureFormatTests.genTestCases = function() { + var state = tcuTestCase.runner; + state.setRoot(tcuTestCase.newTest('texture_format', 'Top level')); + + var texFormats = [ + ['alpha', gl.ALPHA, gl.UNSIGNED_BYTE], + ['luminance', gl.LUMINANCE, gl.UNSIGNED_BYTE], + ['luminance_alpha', gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE], + ['rgb_unsigned_short_5_6_5', gl.RGB, gl.UNSIGNED_SHORT_5_6_5], + ['rgb_unsigned_byte', gl.RGB, gl.UNSIGNED_BYTE], + ['rgba_unsigned_short_4_4_4_4', gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4], + ['rgba_unsigned_short_5_5_5_1', gl.RGBA, gl.UNSIGNED_SHORT_5_5_5_1], + ['rgba_unsigned_byte', gl.RGBA, gl.UNSIGNED_BYTE] + ]; + + var unsized2DGroup = tcuTestCase.newTest('unsized', 'Unsized formats (2D, Cubemap)'); + state.testCases.addChild(unsized2DGroup); + var unsized2DArrayGroup = tcuTestCase.newTest('unsized', 'Unsized formats (2D Array)'); + state.testCases.addChild(unsized2DArrayGroup); + var unsized3DGroup = tcuTestCase.newTest('unsized', 'Unsized formats (3D)'); + state.testCases.addChild(unsized3DGroup); + + texFormats.forEach(function(elem) { + var format = elem[1]; + var dataType = elem[2]; + var nameBase = elem[0]; + var descriptionBase = gluStrUtil.getPixelFormatName(format) + ', ' + gluStrUtil.getTypeName(dataType); + unsized2DGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({ + name: nameBase + '_2d_pot', + description: descriptionBase + ' gl.TEXTURE_2D', + format: format, + dataType: dataType, + width: 128, + height: 128 + })); + unsized2DGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({ + name: nameBase + '_2d_npot', + description: descriptionBase + ' gl.TEXTURE_2D', + format: format, + dataType: dataType, + width: 63, + height: 112 + })); + unsized2DGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({ + name: nameBase + '_cube_pot', + description: descriptionBase + ' gl.TEXTURE_CUBE_MAP', + format: format, + dataType: dataType, + width: 64, + height: 64 + })); + unsized2DGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({ + name: nameBase + '_cube_npot', + description: descriptionBase + ' gl.TEXTURE_CUBE_MAP', + format: format, + dataType: dataType, + width: 57, + height: 57 + })); + unsized2DArrayGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({ + name: nameBase + '_2d_array_pot', + description: descriptionBase + ' gl.TEXTURE_2D_ARRAY', + format: format, + dataType: dataType, + width: 64, + height: 64, + numLayers: 8 + })); + unsized2DArrayGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({ + name: nameBase + '_2d_array_npot', + description: descriptionBase + ' gl.TEXTURE_2D_ARRAY', + format: format, + dataType: dataType, + width: 63, + height: 57, + numLayers: 7 + })); + unsized3DGroup.addChild(new es3fTextureFormatTests.Texture3DFormatCase({ + name: nameBase + '_3d_pot', + description: descriptionBase + ' gl.TEXTURE_3D', + format: format, + dataType: dataType, + width: 8, + height: 32, + depth: 16 + })); + unsized3DGroup.addChild(new es3fTextureFormatTests.Texture3DFormatCase({ + name: nameBase + '_3d_npot', + description: descriptionBase + ' gl.TEXTURE_3D', + format: format, + dataType: dataType, + width: 11, + height: 31, + depth: 7 + })); + }); + + var sizedColorFormats = [ + ['rgba32f', gl.RGBA32F], + ['rgba32i', gl.RGBA32I], + ['rgba32ui', gl.RGBA32UI], + ['rgba16f', gl.RGBA16F], + ['rgba16i', gl.RGBA16I], + ['rgba16ui', gl.RGBA16UI], + ['rgba8', gl.RGBA8], + ['rgba8i', gl.RGBA8I], + ['rgba8ui', gl.RGBA8UI], + ['srgb8_alpha8', gl.SRGB8_ALPHA8], + ['rgb10_a2', gl.RGB10_A2], + ['rgb10_a2ui', gl.RGB10_A2UI], + ['rgba4', gl.RGBA4], + ['rgb5_a1', gl.RGB5_A1], + ['rgba8_snorm', gl.RGBA8_SNORM], + ['rgb8', gl.RGB8], + ['rgb565', gl.RGB565], + ['r11f_g11f_b10f', gl.R11F_G11F_B10F], + ['rgb32f', gl.RGB32F], + ['rgb32i', gl.RGB32I], + ['rgb32ui', gl.RGB32UI], + ['rgb16f', gl.RGB16F], + ['rgb16i', gl.RGB16I], + ['rgb16ui', gl.RGB16UI], + ['rgb8_snorm', gl.RGB8_SNORM], + ['rgb8i', gl.RGB8I], + ['rgb8ui', gl.RGB8UI], + ['srgb8', gl.SRGB8], + ['rgb9_e5', gl.RGB9_E5], + ['rg32f', gl.RG32F], + ['rg32i', gl.RG32I], + ['rg32ui', gl.RG32UI], + ['rg16f', gl.RG16F], + ['rg16i', gl.RG16I], + ['rg16ui', gl.RG16UI], + ['rg8', gl.RG8], + ['rg8i', gl.RG8I], + ['rg8ui', gl.RG8UI], + ['rg8_snorm', gl.RG8_SNORM], + ['r32f', gl.R32F], + ['r32i', gl.R32I], + ['r32ui', gl.R32UI], + ['r16f', gl.R16F], + ['r16i', gl.R16I], + ['r16ui', gl.R16UI], + ['r8', gl.R8], + ['r8i', gl.R8I], + ['r8ui', gl.R8UI], + ['r8_snorm', gl.R8_SNORM] + ]; + + var splitSizedColorTests = 4; + var sizedColor2DPOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColor2DPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D POT)')); + state.testCases.addChild(sizedColor2DPOTGroup[ii]); + } + var sizedColor2DNPOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColor2DNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D NPOT)')); + state.testCases.addChild(sizedColor2DNPOTGroup[ii]); + } + var sizedColorCubePOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColorCubePOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (Cubemap POT)')); + state.testCases.addChild(sizedColorCubePOTGroup[ii]); + } + var sizedColorCubeNPOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColorCubeNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (Cubemap NPOT)')); + state.testCases.addChild(sizedColorCubeNPOTGroup[ii]); + } + var sizedColor2DArrayPOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColor2DArrayPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D Array POT)')); + state.testCases.addChild(sizedColor2DArrayPOTGroup[ii]); + } + var sizedColor2DArrayNPOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColor2DArrayNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D Array NPOT)')); + state.testCases.addChild(sizedColor2DArrayNPOTGroup[ii]); + } + var sizedColor3DPOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColor3DPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (3D POT)')); + state.testCases.addChild(sizedColor3DPOTGroup[ii]); + } + var sizedColor3DNPOTGroup = []; + for (var ii = 0; ii < splitSizedColorTests; ++ii) { + sizedColor3DNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (3D NPOT)')); + state.testCases.addChild(sizedColor3DNPOTGroup[ii]); + } + + for (var ii = 0; ii < sizedColorFormats.length; ++ii) { + var internalFormat = sizedColorFormats[ii][1]; + var nameBase = sizedColorFormats[ii][0]; + var descriptionBase = gluStrUtil.getPixelFormatName(internalFormat); + sizedColor2DPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DFormatCase({ + name: nameBase + '_pot', + description: descriptionBase + ' gl.TEXTURE_2D', + format: internalFormat, + width: 128, + height: 128 + })); + sizedColor2DNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DFormatCase({ + name: nameBase + '_npot', + description: descriptionBase + ' gl.TEXTURE_2D', + format: internalFormat, + width: 63, + height: 112 + })); + sizedColorCubePOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.TextureCubeFormatCase({ + name: nameBase + '_pot', + description: descriptionBase + ' gl.TEXTURE_CUBE_MAP', + format: internalFormat, + width: 64, + height: 64 + })); + sizedColorCubeNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.TextureCubeFormatCase({ + name: nameBase + '_npot', + description: descriptionBase + ' gl.TEXTURE_CUBE_MAP', + format: internalFormat, + width: 57, + height: 57 + })); + sizedColor2DArrayPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({ + name: nameBase + '_pot', + description: descriptionBase + ' gl.TEXTURE_2D_ARRAY', + format: internalFormat, + width: 64, + height: 64, + numLayers: 8 + + })); + sizedColor2DArrayNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({ + name: nameBase + '_npot', + description: descriptionBase + ' gl.TEXTURE_2D_ARRAY', + format: internalFormat, + width: 63, + height: 57, + numLayers: 7 + })); + sizedColor3DPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture3DFormatCase({ + name: nameBase + '_pot', + description: descriptionBase + ' gl.TEXTURE_3D', + format: internalFormat, + width: 8, + height: 32, + depth: 16 + })); + sizedColor3DNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture3DFormatCase({ + name: nameBase + '_npot', + description: descriptionBase + ' gl.TEXTURE_3D', + format: internalFormat, + width: 11, + height: 31, + depth: 7 + })); + } + + var sizedDepthStencilFormats = [ + // Depth and stencil formats + ['depth_component32f', gl.DEPTH_COMPONENT32F], + ['depth_component24', gl.DEPTH_COMPONENT24], + ['depth_component16', gl.DEPTH_COMPONENT16], + // The following format is restricted in WebGL2. + // ['depth32f_stencil8', gl.DEPTH32F_STENCIL8], + ['depth24_stencil8', gl.DEPTH24_STENCIL8] + ]; + var sizedDepthStencilGroup = tcuTestCase.newTest('sized', 'Sized formats (Depth Stencil)'); + state.testCases.addChild(sizedDepthStencilGroup); + sizedDepthStencilFormats.forEach(function(elem) { + var internalFormat = elem[1]; + var nameBase = elem[0]; + var descriptionBase = gluStrUtil.getPixelFormatName(internalFormat); + sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({ + name: nameBase + '_pot', + description: descriptionBase + ' gl.TEXTURE_2D', + format: internalFormat, + width: 128, + height: 128 + })); + sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({ + name: nameBase + '_npot', + description: descriptionBase + ' gl.TEXTURE_2D', + format: internalFormat, + width: 63, + height: 112 + })); + sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({ + name: nameBase + '_pot', + description: descriptionBase + ' gl.TEXTURE_CUBE_MAP', + format: internalFormat, + width: 64, + height: 64 + })); + sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({ + name: nameBase + '_npot', + description: descriptionBase + ' gl.TEXTURE_CUBE_MAP', + format: internalFormat, + width: 57, + height: 57 + })); + sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({ + name: nameBase + '_pot', + description: descriptionBase + ' gl.TEXTURE_2D_ARRAY', + format: internalFormat, + width: 64, + height: 64, + numLayers: 8 + })); + sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({ + name: nameBase + '_npot', + description: descriptionBase + ' gl.TEXTURE_2D_ARRAY', + format: internalFormat, + width: 63, + height: 57, + numLayers: 7 + })); + }); + + var compressed2DGroup = tcuTestCase.newTest('compressed', 'Compressed formats (2D)'); + state.testCases.addChild(compressed2DGroup); + var compressedCubeGroup = tcuTestCase.newTest('compressed', 'Compressed formats (Cubemap)'); + state.testCases.addChild(compressedCubeGroup); + var etc2Formats = [ + ['gl.COMPRESSED_R11_EAC', 'eac_r11', tcuCompressedTexture.Format.EAC_R11], + ['gl.COMPRESSED_SIGNED_R11_EAC', 'eac_signed_r11', tcuCompressedTexture.Format.EAC_SIGNED_R11], + ['gl.COMPRESSED_RG11_EAC', 'eac_rg11', tcuCompressedTexture.Format.EAC_RG11], + ['gl.COMPRESSED_SIGNED_RG11_EAC', 'eac_signed_rg11', tcuCompressedTexture.Format.EAC_SIGNED_RG11], + ['gl.COMPRESSED_RGB8_ETC2', 'etc2_rgb8', tcuCompressedTexture.Format.ETC2_RGB8], + ['gl.COMPRESSED_SRGB8_ETC2', 'etc2_srgb8', tcuCompressedTexture.Format.ETC2_SRGB8], + ['gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2', 'etc2_rgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1], + ['gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2', 'etc2_srgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1], + ['gl.COMPRESSED_RGBA8_ETC2_EAC', 'etc2_eac_rgba8', tcuCompressedTexture.Format.ETC2_EAC_RGBA8], + ['gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC', 'etc2_eac_srgb8_alpha8', tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8] + ]; + if (!gluTextureUtil.enableCompressedTextureETC()) { + debug('Skipping ETC2/EAC texture format tests: no support for WEBGL_compressed_texture_etc'); + etc2Formats = []; + } + etc2Formats.forEach(function(elem) { + var nameBase = elem[1]; + var descriptionBase = elem[0]; + var format = elem[2]; + compressed2DGroup.addChild(new es3fTextureFormatTests.Compressed2DFormatCase({ + name: nameBase + '_2d_pot', + description: descriptionBase + ', gl.TEXTURE_2D', + format: format, + width: 128, + height: 64 + })); + compressedCubeGroup.addChild(new es3fTextureFormatTests.CompressedCubeFormatCase({ + name: nameBase + '_cube_pot', + description: descriptionBase + ', gl.TEXTURE_CUBE_MAP', + format: format, + width: 64, + height: 64 + })); + compressed2DGroup.addChild(new es3fTextureFormatTests.Compressed2DFormatCase({ + name: nameBase + '_2d_pot', + description: descriptionBase + ', gl.TEXTURE_2D', + format: format, + width: 128, + height: 64 + })); + compressedCubeGroup.addChild(new es3fTextureFormatTests.CompressedCubeFormatCase({ + name: nameBase + '_cube_npot', + description: descriptionBase + ', gl.TEXTURE_CUBE_MAP', + format: format, + width: 51, + height: 51 + })); + }); +}; + +/** + * Create and execute the test cases + */ +es3fTextureFormatTests.run = function(context, range) { + gl = context; + var state = tcuTestCase.runner; + try { + es3fTextureFormatTests.genTestCases(); + if (range) + state.setRange(range); + state.runCallback(tcuTestCase.runTestCases); + } catch (err) { + bufferedLogToConsole(err); + state.terminate(); + } + +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js new file mode 100644 index 000000000..c878228b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js @@ -0,0 +1,898 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('functional.gles3.es3fTextureShadowTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexCompareVerifier'); +goog.require('framework.common.tcuTexLookupVerifier'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess'); +goog.require('modules.shared.glsTextureTestUtil'); + +goog.scope(function() { + +var es3fTextureShadowTests = functional.gles3.es3fTextureShadowTests; +var tcuTestCase = framework.common.tcuTestCase; +var glsTextureTestUtil = modules.shared.glsTextureTestUtil; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var gluTexture = framework.opengl.gluTexture; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var tcuTexture = framework.common.tcuTexture; +var tcuImageCompare = framework.common.tcuImageCompare; +var tcuLogImage = framework.common.tcuLogImage; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuRGBA = framework.common.tcuRGBA; +var deMath = framework.delibs.debase.deMath; +var tcuPixelFormat = framework.common.tcuPixelFormat; +var tcuSurface = framework.common.tcuSurface; +var tcuTexCompareVerifier = framework.common.tcuTexCompareVerifier; +var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier; +var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess; +var deString = framework.delibs.debase.deString; +var deUtil = framework.delibs.debase.deUtil; + + es3fTextureShadowTests.version = '300 es'; + + /** @const */ var VIEWPORT_WIDTH = 64; + /** @const */ var VIEWPORT_HEIGHT = 64; + /** @const */ var MIN_VIEWPORT_WIDTH = 64; + /** @const */ var MIN_VIEWPORT_HEIGHT = 64; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * @param {tcuTexture.TextureFormat} format + * @return {boolean} + */ + es3fTextureShadowTests.isFloatingPointDepthFormat = function(format) { + // Only two depth and depth-stencil formats are floating point + return (format.order == tcuTexture.ChannelOrder.D && format.type == tcuTexture.ChannelType.FLOAT) || (format.order == tcuTexture.ChannelOrder.DS && format.type == tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV); + }; + + /** + * @param {tcuTexture.PixelBufferAccess} access + */ + es3fTextureShadowTests.clampFloatingPointTexture = function(access) { + DE_ASSERT(es3fTextureShadowTests.isFloatingPointDepthFormat(access.getFormat())); + for (var z = 0; z < access.getDepth(); ++z) + for (var y = 0; y < access.getHeight(); ++y) + for (var x = 0; x < access.getWidth(); ++x) + access.setPixDepth(deMath.clamp(access.getPixDepth(x, y, z), 0.0, 1.0), x, y, z); + }; + + /** + * @param {tcuTexture.Texture2D|tcuTexture.Texture2DArray} target + */ + es3fTextureShadowTests.clampFloatingPointTexture2D = function(target) { + for (var level = 0; level < target.getNumLevels(); ++level) + if (!target.isLevelEmpty(level)) + es3fTextureShadowTests.clampFloatingPointTexture(target.getLevel(level)); + }; + + /** + * @param {tcuTexture.TextureCube} target + */ + es3fTextureShadowTests.clampFloatingPointTextureCube = function(target) { + for (var level = 0; level < target.getNumLevels(); ++level) + for (var face = tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; face < Object.keys(tcuTexture.CubeFace).length; face++) + es3fTextureShadowTests.clampFloatingPointTexture(target.getLevelFace(level, face)); + }; + + /** + * @param {?} textureType + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.Texture2D|tcuTexture.Texture2DArray|tcuTexture.TextureCube} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrecision + * @param {tcuPixelFormat.PixelFormat} pixelFormat + */ + es3fTextureShadowTests.verifyTexCompareResult = function(textureType, result, src, texCoord, sampleParams, comparePrec, lodPrecision, pixelFormat) { + var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + var nonShadowThreshold = deMath.swizzle(tcuTexLookupVerifier.computeFixedPointThreshold(deMath.subtract(glsTextureTestUtil.getBitsVec(pixelFormat), [1, 1, 1, 1])), [1, 2, 3]); + var numFailedPixels; + + if (es3fTextureShadowTests.isFloatingPointDepthFormat(src.getFormat())) { + var clampedSource = /*deUtil.clone(*/src/*)*/; + + if (textureType == tcuTexture.Texture2D) { + es3fTextureShadowTests.clampFloatingPointTexture2D(/** @type {tcuTexture.Texture2D} */(clampedSource)); + glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DView} */ (clampedSource.getView()), texCoord, sampleParams); + // sample clamped values + numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2D(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DView} */ (clampedSource.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold); + } else if (textureType == tcuTexture.Texture2DArray) { + es3fTextureShadowTests.clampFloatingPointTexture2D(/** @type {tcuTexture.Texture2DArray} */(clampedSource)); + glsTextureTestUtil.sampleTexture2DArray(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DArrayView} */ (clampedSource.getView()), texCoord, sampleParams); + // sample clamped values + numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2DArray(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DArrayView} */ (clampedSource.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold); + } else if (textureType == tcuTexture.TextureCube) { + es3fTextureShadowTests.clampFloatingPointTextureCube(/** @type {tcuTexture.TextureCube} */(clampedSource)); + glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.TextureCubeView} */ (clampedSource.getView()), texCoord, sampleParams); + // sample clamped values + numFailedPixels = glsTextureTestUtil.computeTextureCompareDiffCube(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.TextureCubeView} */ (clampedSource.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold); + } else + throw new Error('Invalid texture type'); + + } else { + if (textureType == tcuTexture.Texture2D) { + glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DView} */ (src.getView()), texCoord, sampleParams); + // sample raw values (they are guaranteed to be in [0, 1] range as the format cannot represent any other values) + numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2D(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DView} */ (src.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold); + } else if (textureType == tcuTexture.Texture2DArray) { + glsTextureTestUtil.sampleTexture2DArray(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DArrayView} */ (src.getView()), texCoord, sampleParams); + // sample raw values (they are guaranteed to be in [0, 1] range as the format cannot represent any other values) + numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2DArray(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DArrayView} */ (src.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold); + } else if (textureType == tcuTexture.TextureCube) { + glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.TextureCubeView} */ (src.getView()), texCoord, sampleParams); + // sample raw values (they are guaranteed to be in [0, 1] range as the format cannot represent any other values) + numFailedPixels = glsTextureTestUtil.computeTextureCompareDiffCube(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.TextureCubeView} */ (src.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold); + } else + throw new Error('Invalid texture type'); + } + + if (numFailedPixels > 0) + bufferedLogToConsole('ERROR: Result verification failed, got ' + numFailedPixels + ' invalid pixels!'); + + if (numFailedPixels > 0) + tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess()); + else + tcuLogImage.logImageWithInfo(result, 'Result'); + + return numFailedPixels == 0; + + }; + + /** + * @constructor + * @param {string} name + * @param {number} format + * @struct + */ + es3fTextureShadowTests.Format = function(name, format) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.format = format; + }; + + /** + * @constructor + * @param {string} name + * @param {number} minFilter + * @param {number} magFilter + * @struct + */ + es3fTextureShadowTests.Filter = function(name, minFilter, magFilter) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.minFilter = minFilter; + /** @type {number} */ this.magFilter = magFilter; + }; + + /** + * @constructor + * @param {string} name + * @param {number} func + * @struct + */ + es3fTextureShadowTests.CompareFunc = function(name, func) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.func = func; + }; + + /** + * @constructor + * @param {number} texNdx + * @param {number} ref + * @param {number} lodX + * @param {number} lodY + * @param {number} oX + * @param {number} oY + * @struct + */ + es3fTextureShadowTests.TestCase = function(texNdx, ref, lodX, lodY, oX, oY) { + /** @type {number} */ this.texNdx = texNdx; + /** @type {number} */ this.ref = ref; + /** @type {number} */ this.lodX = lodX; + /** @type {number} */ this.lodY = lodY; + /** @type {number} */ this.oX = oX + /** @type {number} */ this.oY = oY; + }; + + /** + * @constructor + * @param {?gluTexture.Texture2D|?gluTexture.TextureCube|?gluTexture.Texture2DArray} tex + * @param {number} ref + * @param {Array} minCoord + * @param {Array} maxCoord + * @struct + */ + es3fTextureShadowTests.FilterCase = function(tex, ref, minCoord, maxCoord) { + /** @type {?gluTexture.Texture2D|?gluTexture.TextureCube|?gluTexture.Texture2DArray} */ this.texture = tex; + /** @type {Array} */ this.minCoord = minCoord; + /** @type {Array} */ this.maxCoord = maxCoord; + /** @type {number} */ this.ref = ref; + }; + + /** + * @constructor + * @param {string} name + * @param {string} desc + * @param {number} minFilter + * @param {number} magFilter + * @param {number} wrapS + * @param {number} wrapT + * @param {number} format + * @param {number} width + * @param {number} height + * @param {number} compareFunc + * @extends {tcuTestCase.DeqpTest} + */ + es3fTextureShadowTests.Texture2DShadowCase = function(name, desc, minFilter, magFilter, wrapS, wrapT, format, width, height, compareFunc) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_minFilter = minFilter; + this.m_magFilter = magFilter; + this.m_wrapS = wrapS; + this.m_wrapT = wrapT; + this.m_format = format; + this.m_width = width; + this.m_height = height; + this.m_compareFunc = compareFunc; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureShadowTests.version, gluShaderUtil.precision.PRECISION_HIGHP); + this.m_caseNdx = 0; + this.m_cases = []; + }; + + es3fTextureShadowTests.Texture2DShadowCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fTextureShadowTests.Texture2DShadowCase.prototype.constructor = es3fTextureShadowTests.Texture2DShadowCase; + + es3fTextureShadowTests.Texture2DShadowCase.prototype.init = function() { + + // Create 2 textures. + this.m_textures = []; + this.m_textures[0] = gluTexture.texture2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height); + this.m_textures[1] = gluTexture.texture2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height); + + var numLevels = this.m_textures[0].getRefTexture().getNumLevels(); + + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + this.m_textures[0].getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithComponentGradients(this.m_textures[0].getRefTexture().getLevel(levelNdx), [-0.5, -0.5, -0.5, 2.0], [1, 1, 1, 0]); + } + + for (levelNdx = 0; levelNdx < numLevels; levelNdx++) { + var step = 0x00ffffff / numLevels; + var rgb = step * levelNdx; + var colorA = 0xff000000 | rgb; + var colorB = 0xff000000 | ~rgb; + + this.m_textures[1].getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithGrid(this.m_textures[1].getRefTexture().getLevel(levelNdx), 4, tcuRGBA.newRGBAFromValue(colorA).toVec(), tcuRGBA.newRGBAFromValue(colorB).toVec()); + } + + for (var i = 0; i < this.m_textures.length; i++) + this.m_textures[i].upload(); + + var refInRangeUpper = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 1.0 : 0.5; + var refInRangeLower = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 0.0 : 0.5; + + var refOutOfBoundsUpper = 1.1; + var refOutOfBoundsLower = -0.1; + + numLevels = this.m_textures[0].getRefTexture().getNumLevels(); + + var cases = []; + cases.push(new es3fTextureShadowTests.TestCase(0, refInRangeUpper, 1.6, 2.9, -1.0, -2.7)); + cases.push(new es3fTextureShadowTests.TestCase(0, refInRangeLower, -2.0, -1.35, -0.2, 0.7)); + cases.push(new es3fTextureShadowTests.TestCase(1, refInRangeUpper, 0.14, 0.275, -1.5, -1.1)); + cases.push(new es3fTextureShadowTests.TestCase(1, refInRangeLower, -0.92, -2.64, 0.4, -0.1)); + cases.push(new es3fTextureShadowTests.TestCase(1, refOutOfBoundsUpper, -0.39, -0.52, 0.65, 0.87)); + cases.push(new es3fTextureShadowTests.TestCase(1, refOutOfBoundsLower, -1.55, 0.65, 0.35, 0.91)); + + var viewportW = Math.min(VIEWPORT_WIDTH, gl.canvas.width); + var viewportH = Math.min(VIEWPORT_HEIGHT, gl.canvas.height); + + for (var caseNdx = 0; caseNdx < cases.length; caseNdx++) { + var texNdx = deMath.clamp(cases[caseNdx].texNdx, 0, this.m_textures.length - 1); + var ref = cases[caseNdx].ref; + var lodX = cases[caseNdx].lodX; + var lodY = cases[caseNdx].lodY; + var oX = cases[caseNdx].oX; + var oY = cases[caseNdx].oY; + var sX = Math.exp(lodX * Math.log(2)) * viewportW / this.m_textures[texNdx].getRefTexture().getWidth(); + var sY = Math.exp(lodY * Math.log(2)) * viewportH / this.m_textures[texNdx].getRefTexture().getHeight(); + + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_textures[texNdx], ref, [oX, oY], [oX + sX, oY + sY])); + } + + this.m_caseNdx = 0; + }; + + es3fTextureShadowTests.Texture2DShadowCase.prototype.iterate = function() { + + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_WIDTH, VIEWPORT_HEIGHT); + var curCase = this.m_cases[this.m_caseNdx]; + var sampleParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D); + var rendered = new tcuSurface.Surface(viewport.width, viewport.height); + var texCoord = []; + + if (viewport.width < MIN_VIEWPORT_WIDTH || viewport.height < MIN_VIEWPORT_HEIGHT) + throw new Error('Too small render target'); + + // Setup params for reference. + sampleParams.sampler = gluTextureUtil.mapGLSampler(this.m_wrapS, this.m_wrapT, gl.CLAMP_TO_EDGE, this.m_minFilter, this.m_magFilter); + sampleParams.sampler.compare = gluTextureUtil.mapGLCompareFunc(this.m_compareFunc); + sampleParams.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW; + sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + sampleParams.ref = curCase.ref; + + bufferedLogToConsole('Compare reference value = ' + sampleParams.ref); + + // Compute texture coordinates. + bufferedLogToConsole('Texture coordinates: ' + curCase.minCoord + ' -> ' + curCase.maxCoord); + + texCoord = glsTextureTestUtil.computeQuadTexCoord2D(curCase.minCoord, curCase.maxCoord); + + gl.bindTexture(gl.TEXTURE_2D, curCase.texture.getGLTexture()); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_magFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.m_wrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.m_wrapT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, this.m_compareFunc); + + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + this.m_renderer.renderQuad(0, texCoord, sampleParams); + rendered.readViewport(gl, viewport); + + + var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + var lodPrecision = new tcuTexLookupVerifier.LodPrecision(18, 6); + var texComparePrecision = new tcuTexCompareVerifier.TexComparePrecision([20, 20, 0], [7, 7, 0], 5, 16, pixelFormat.redBits - 1); + + var isHighQuality = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2D, rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat); + + if (!isHighQuality) { + bufferedLogToConsole('Warning: Verification assuming high-quality PCF filtering failed.'); + + lodPrecision.lodBits = 4; + texComparePrecision.uvwBits = [4, 4, 0]; + texComparePrecision.pcfBits = 0; + + var isOk = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2D, rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat); + + if (!isOk) { + bufferedLogToConsole('ERROR: Verification against low precision requirements failed, failing test case.'); + testFailedOptions('Image verification failed', false); + } else + testPassedOptions('Low-quality result', true); + } else + testPassedOptions('High-quality result', true); + + this.m_caseNdx += 1; + return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @param {string} name + * @param {string} desc + * @param {number} minFilter + * @param {number} magFilter + * @param {number} wrapS + * @param {number} wrapT + * @param {number} format + * @param {number} size + * @param {number} compareFunc + * @extends {tcuTestCase.DeqpTest} + */ + es3fTextureShadowTests.TextureCubeShadowCase = function(name, desc, minFilter, magFilter, wrapS, wrapT, format, size, compareFunc) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_minFilter = minFilter; + this.m_magFilter = magFilter; + this.m_wrapS = wrapS; + this.m_wrapT = wrapT; + this.m_format = format; + this.m_size = size; + this.m_compareFunc = compareFunc; + this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureShadowTests.version, gluShaderUtil.precision.PRECISION_HIGHP); + this.m_caseNdx = 0; + this.m_cases = []; + }; + + es3fTextureShadowTests.TextureCubeShadowCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fTextureShadowTests.TextureCubeShadowCase.prototype.constructor = es3fTextureShadowTests.TextureCubeShadowCase; + + es3fTextureShadowTests.TextureCubeShadowCase.prototype.init = function() { + DE_ASSERT(!this.m_gradientTex && !this.m_gridTex); + + var numLevels = Math.floor(Math.log2(this.m_size)) + 1; + /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format); + /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + /** @type {Array} */ var cBias = fmtInfo.valueMin; + /** @type {Array} */ var cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin); + + // Create textures. + this.m_gradientTex = gluTexture.cubeFromInternalFormat(gl, this.m_format, this.m_size); + this.m_gridTex = gluTexture.cubeFromInternalFormat(gl, this.m_format, this.m_size); + + // Fill first with gradient texture. + var gradients = [[[-1.0, -1.0, -1.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // negative x + [[0.0, -1.0, -1.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // positive x + [[-1.0, 0.0, -1.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // negative y + [[-1.0, -1.0, 0.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // positive y + [[-1.0, -1.0, -1.0, 0.0], [1.0, 1.0, 1.0, 1.0]], // negative z + [[0.0, 0.0, 0.0, 2.0], [1.0, 1.0, 1.0, 0.0]]]; // positive z + + for (var face in tcuTexture.CubeFace) { + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + this.m_gradientTex.getRefTexture().allocLevel(tcuTexture.CubeFace[face], levelNdx); + tcuTextureUtil.fillWithComponentGradients(this.m_gradientTex.getRefTexture().getLevelFace(levelNdx, tcuTexture.CubeFace[face]), deMath.add(deMath.multiply(gradients[tcuTexture.CubeFace[face]][0], cScale), cBias), deMath.add(deMath.multiply(gradients[tcuTexture.CubeFace[face]][1], cScale), cBias)); + } + } + + // Fill second with grid texture. + for (var face in tcuTexture.CubeFace) { + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + var step = 0x00ffffff / (numLevels * Object.keys(tcuTexture.CubeFace).length); + var rgb = step * levelNdx * face; + var colorA = 0xff000000 | rgb; + var colorB = 0xff000000 | ~rgb; + + this.m_gridTex.getRefTexture().allocLevel(tcuTexture.CubeFace[face], levelNdx); + tcuTextureUtil.fillWithGrid(this.m_gridTex.getRefTexture().getLevelFace(levelNdx, tcuTexture.CubeFace[face]), 4, deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorA).toVec(), cScale), cBias), deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorB).toVec(), cScale), cBias)); + } + } + + // Upload. + this.m_gradientTex.upload(); + this.m_gridTex.upload(); + + var refInRangeUpper = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 1.0 : 0.5; + var refInRangeLower = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 0.0 : 0.5; + var refOutOfBoundsUpper = 1.1; + var refOutOfBoundsLower = -0.1; + var singleSample = new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess().getNumSamples() == 0; + //var singleSample = this.m_context.getRenderTarget().getNumSamples() == 0; + + if (singleSample) + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gradientTex, refInRangeUpper, [-1.25, -1.2], [1.2, 1.25])); // minification + else + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gradientTex, refInRangeUpper, [-1.19, -1.3], [1.1, 1.35])); // minification - w/ tuned coordinates to avoid hitting triangle edges + + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gradientTex, refInRangeLower, [0.8, 0.8], [1.25, 1.20])); // magnification + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refInRangeUpper, [-1.19, -1.3], [1.1, 1.35])); // minification + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refInRangeLower, [-1.2, -1.1], [-0.8, -0.8])); // magnification + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refOutOfBoundsUpper, [-0.61, -0.1], [0.9, 1.18])); // reference value clamp, upper + + if (singleSample) + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refOutOfBoundsLower, [-0.75, 1.0], [0.05, 0.75])); // reference value clamp, lower + else + this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refOutOfBoundsLower, [-0.75, 1.0], [0.25, 0.75])); // reference value clamp, lower + + this.m_caseNdx = 0; + }; + + es3fTextureShadowTests.TextureCubeShadowCase.prototype.iterate = function() { + var viewportSize = 28; + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), viewportSize, viewportSize, deString.deStringHash(this.fullName()) ^ deMath.deMathHash(this.m_caseNdx)); + var curCase = this.m_cases[this.m_caseNdx]; + var sampleParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_CUBE); + + if (viewport.width < viewportSize || viewport.height < viewportSize) + throw new Error('Too small render target'); + + // Setup texture + gl.bindTexture(gl.TEXTURE_CUBE_MAP, curCase.texture.getGLTexture()); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, this.m_minFilter); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, this.m_magFilter); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, this.m_wrapS); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, this.m_wrapT); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, this.m_compareFunc); + + // Other state + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + // Params for reference computation. + sampleParams.sampler = gluTextureUtil.mapGLSampler(gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, this.m_minFilter, this.m_magFilter); + sampleParams.sampler.seamlessCubeMap = true; + sampleParams.sampler.compare = gluTextureUtil.mapGLCompareFunc(this.m_compareFunc); + sampleParams.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW; + sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + sampleParams.ref = curCase.ref; + + bufferedLogToConsole( + 'Compare reference value = ' + sampleParams.ref + '\n' + + 'Coordinates: ' + curCase.minCoord + ' -> ' + curCase.maxCoord); + + for (var faceNdx in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[faceNdx]; + var result = new tcuSurface.Surface(viewport.width, viewport.height); + var texCoord = []; + + texCoord = glsTextureTestUtil.computeQuadTexCoordCubeFace(face, curCase.minCoord, curCase.maxCoord); + + this.m_renderer.renderQuad(0, texCoord, sampleParams); + + result.readViewport(gl, viewport); + + var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + /** @type {tcuTexLookupVerifier.LodPrecision} */ var lodPrecision = new tcuTexLookupVerifier.LodPrecision(10, 5); + /** @type {tcuTexCompareVerifier.TexComparePrecision} */ var texComparePrecision = new tcuTexCompareVerifier.TexComparePrecision( + [10, 10, 10], + [6, 6, 0], + 5, + 16, + pixelFormat.redBits - 1 + ); + + var isHighQuality = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.TextureCube, result.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat); + + if (!isHighQuality) { + bufferedLogToConsole('Warning: Verification assuming high-quality PCF filtering failed.'); + + lodPrecision.lodBits = 4; + texComparePrecision.uvwBits = [4, 4, 0]; + texComparePrecision.pcfBits = 0; + + var isOk = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.TextureCube, result.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat); + if (!isOk) { + bufferedLogToConsole('ERROR: Verification against low precision requirements failed, failing test case.'); + testFailedOptions('Image verification failed', false); + } else + testPassedOptions('Low-quality result', true); + } + else + testPassedOptions('High-quality result', true); + } + + this.m_caseNdx += 1; + return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP; + }; + + /** + * Testure2DArrayShadowCase + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} minFilter + * @param {number} magFilter + * @param {number} wrapS + * @param {number} wrapT + * @param {number} format + * @param {number} width + * @param {number} height + * @param {number} numLayers + * @param {number} compareFunc + */ + es3fTextureShadowTests.Texture2DArrayShadowCase = function(name, desc, minFilter, magFilter, wrapS, wrapT, format, width, height, numLayers, compareFunc) { + tcuTestCase.DeqpTest.call(this, name, desc); + /** @type {number} */ this.m_minFilter = minFilter; + /** @type {number} */ this.m_magFilter = magFilter; + /** @type {number} */ this.m_wrapS = wrapS; + /** @type {number} */ this.m_wrapT = wrapT; + /** @type {number} */ this.m_format = format; + /** @type {number} */ this.m_width = width; + /** @type {number} */ this.m_height = height; + /** @type {number} */ this.m_numLayers = numLayers; + /** @type {number} */ this.m_compareFunc = compareFunc; + /** @type {?gluTexture.Texture2DArray} */ this.m_gradientTex = null; + /** @type {?gluTexture.Texture2DArray} */ this.m_gridTex = null; + /** @type {glsTextureTestUtil.TextureRenderer} */ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureShadowTests.version, gluShaderUtil.precision.PRECISION_HIGHP); + /** @type {Array} */ this.m_cases = []; + /** @type {number} */ this.m_caseNdx = 0; + }; + + es3fTextureShadowTests.Texture2DArrayShadowCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fTextureShadowTests.Texture2DArrayShadowCase.prototype.constructor = es3fTextureShadowTests.Texture2DArrayShadowCase; + + /** + * init + */ + es3fTextureShadowTests.Texture2DArrayShadowCase.prototype.init = function() { + /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format); + /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt); + /** @type {Array}*/ var cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin); + /** @type {Array}*/ var cBias = fmtInfo.valueMin; + /** @type {number}*/ var numLevels = deMath.logToFloor(Math.max(this.m_width, this.m_height)) + 1; + + // Create textures. + this.m_gradientTex = gluTexture.texture2DArrayFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_numLayers); + this.m_gridTex = gluTexture.texture2DArrayFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_numLayers); + + // Fill first gradient texture. + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + /** @type {Array}*/ var gMin = deMath.add(deMath.multiply([-0.5, -0.5, -0.5, 2.0], cScale), cBias); + /** @type {Array}*/ var gMax = deMath.add(deMath.multiply([1.0, 1.0, 1.0, 0.0], cScale), cBias); + + this.m_gradientTex.getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithComponentGradients( + /** @type {tcuTexture.PixelBufferAccess} */ (this.m_gradientTex.getRefTexture().getLevel(levelNdx)), gMin, gMax); + } + + // Fill second with grid texture. + for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) { + /** @type {number}*/ var step = Math.floor(0x00ffffff / numLevels); + /** @type {number}*/ var rgb = step * levelNdx; + /** @type {number}*/ var colorA = deMath.binaryOp(0xff000000, rgb, deMath.BinaryOp.OR); + /** @type {number}*/ var colorB = deMath.binaryOp(0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR); + + this.m_gridTex.getRefTexture().allocLevel(levelNdx); + tcuTextureUtil.fillWithGrid( + /** @type {tcuTexture.PixelBufferAccess} */ (this.m_gridTex.getRefTexture().getLevel(levelNdx)), 4, + deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorA).toVec(), cScale), cBias), + deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorB).toVec(), cScale), cBias) + ); + } + + // Upload. + this.m_gradientTex.upload(); + this.m_gridTex.upload(); + + // Compute cases. + /** @type {number} */ var refInRangeUpper = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 1.0 : 0.5; + /** @type {number} */ var refInRangeLower = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 0.0 : 0.5; + /** @type {number} */ var refOutOfBoundsUpper = 1.1; // !< lookup function should clamp values to [0, 1] range + /** @type {number} */ var refOutOfBoundsLower = -0.1; + + /** @type {Array<{texNdx: number, ref: number, lodX: number, lodY: number, oX: number, oY: number}>} */ + var cases = [{ texNdx: 0, ref: refInRangeUpper, lodX: 1.6, lodY: 2.9, oX: -1.0, oY: -2.7 },{ texNdx: 0, ref: refInRangeLower, lodX: -2.0, lodY: -1.35, oX: -0.2, oY: 0.7 },{ texNdx: 1, ref: refInRangeUpper, lodX: 0.14, lodY: 0.275, oX: -1.5, oY: -1.1 },{ texNdx: 1, ref: refInRangeLower, lodX: -0.92, lodY: -2.64, oX: 0.4, oY: -0.1 },{ texNdx: 1, ref: refOutOfBoundsUpper, lodX: -0.49, lodY: -0.22, oX: 0.45, oY: 0.97 },{ texNdx: 1, ref: refOutOfBoundsLower, lodX: -0.85, lodY: 0.75, oX: 0.25, oY: 0.61 } + ]; + + var viewportW = Math.min(VIEWPORT_WIDTH, gl.canvas.width); + var viewportH = Math.min(VIEWPORT_HEIGHT, gl.canvas.height); + + /** @type {number} */ var minLayer = -0.5; + /** @type {number} */ var maxLayer = this.m_numLayers; + + for (var caseNdx = 0; caseNdx < cases.length; caseNdx++) { + var tex = cases[caseNdx].texNdx > 0 ? this.m_gridTex : this.m_gradientTex; + /** @type {number} */ var ref = cases[caseNdx].ref; + /** @type {number} */ var lodX = cases[caseNdx].lodX; + /** @type {number} */ var lodY = cases[caseNdx].lodY; + /** @type {number} */ var oX = cases[caseNdx].oX; + /** @type {number} */ var oY = cases[caseNdx].oY; + /** @type {number} */ var sX = Math.exp(lodX * Math.LN2) * viewportW / tex.getRefTexture().getWidth(); + /** @type {number} */ var sY = Math.exp(lodY * Math.LN2) * viewportH / tex.getRefTexture().getHeight(); + + this.m_cases.push(new es3fTextureShadowTests.FilterCase(tex, ref, [oX, oY, minLayer], [oX + sX, oY + sY, maxLayer])); + } + + this.m_caseNdx = 0; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fTextureShadowTests.Texture2DArrayShadowCase.prototype.iterate = function() { + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_WIDTH, VIEWPORT_HEIGHT, deString.deStringHash(this.fullName()) ^ deMath.deMathHash(this.m_caseNdx)); + var curCase = this.m_cases[this.m_caseNdx]; + var sampleParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY); + var rendered = new tcuSurface.Surface(viewport.width, viewport.height); + var texCoord = []; + + texCoord = [curCase.minCoord[0], curCase.minCoord[1], curCase.minCoord[2], + curCase.minCoord[0], curCase.maxCoord[1], (curCase.minCoord[2] + curCase.maxCoord[2]) / 2.0, + curCase.maxCoord[0], curCase.minCoord[1], (curCase.minCoord[2] + curCase.maxCoord[2]) / 2.0, + curCase.maxCoord[0], curCase.maxCoord[1], curCase.maxCoord[2]]; + + if (viewport.width < MIN_VIEWPORT_WIDTH || viewport.height < MIN_VIEWPORT_HEIGHT) + throw new Error('Too small render target'); + + sampleParams.sampler = gluTextureUtil.mapGLSamplerWrapST(this.m_wrapS, this.m_wrapT, this.m_minFilter, this.m_magFilter); + sampleParams.sampler.compare = gluTextureUtil.mapGLCompareFunc(this.m_compareFunc); + sampleParams.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW; + sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + sampleParams.ref = curCase.ref; + + bufferedLogToConsole( + 'Compare reference value = ' + sampleParams.ref + '\n' + + 'Texture Coordinates: ' + curCase.minCoord + ' -> ' + curCase.maxCoord + ); + + gl.bindTexture(gl.TEXTURE_2D_ARRAY, curCase.texture.getGLTexture()); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, this.m_minFilter); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, this.m_magFilter); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, this.m_wrapS); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, this.m_wrapT); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_COMPARE_FUNC, this.m_compareFunc); + + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + this.m_renderer.renderQuad(0, texCoord, sampleParams); + rendered.readViewport(gl, viewport); + + var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + /** @type {tcuTexLookupVerifier.LodPrecision} */ var lodPrecision = new tcuTexLookupVerifier.LodPrecision(18, 6); + /** @type {tcuTexCompareVerifier.TexComparePrecision} */ var texComparePrecision = new tcuTexCompareVerifier.TexComparePrecision( + [20, 20, 20], + [7, 7, 7], + 5, + 16, + pixelFormat.redBits - 1 + ); + + var isHighQuality = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2DArray, rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat); + + if (!isHighQuality) { + bufferedLogToConsole('Warning: Verification assuming high-quality PCF filtering failed'); + + lodPrecision.lodBits = 4; + texComparePrecision.uvwBits = [4, 4, 4]; + texComparePrecision.pcfBits = 0; + + var isOk = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2DArray, rendered.getAccess(), curCase.texture.getRefTexture(), + texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat); + + if (!isOk) { + bufferedLogToConsole('ERROR: Verification against low precision requirements failed, failing test case.'); + testFailedOptions('Image verification failed', false); + } else + testPassedOptions('Low-quality result', true); + } else + testPassedOptions('High-quality result', true); + + this.m_caseNdx += 1; + return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP; + }; + + es3fTextureShadowTests.init = function() { + /** @type {Array} */ var formats = []; + formats.push(new es3fTextureShadowTests.Format('depth_component16', gl.DEPTH_COMPONENT16)); + formats.push(new es3fTextureShadowTests.Format('depth_component32f', gl.DEPTH_COMPONENT32F)); + formats.push(new es3fTextureShadowTests.Format('depth24_stencil8', gl.DEPTH24_STENCIL8)); + + /** @type {Array} */ var filters = []; + filters.push(new es3fTextureShadowTests.Filter('nearest', gl.NEAREST, gl.NEAREST)); + filters.push(new es3fTextureShadowTests.Filter('linear', gl.LINEAR, gl.LINEAR)); + filters.push(new es3fTextureShadowTests.Filter('nearest_mipmap_nearest', gl.NEAREST_MIPMAP_NEAREST, gl.LINEAR)); + filters.push(new es3fTextureShadowTests.Filter('linear_mipmap_nearest', gl.LINEAR_MIPMAP_NEAREST, gl.LINEAR)); + filters.push(new es3fTextureShadowTests.Filter('nearest_mipmap_linear', gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR)); + filters.push(new es3fTextureShadowTests.Filter('linear_mipmap_linear', gl.LINEAR_MIPMAP_LINEAR, gl.LINEAR)); + + /** @type {Array} */ var compareFuncs = []; + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('less_or_equal', gl.LEQUAL)); + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('greater_or_equal', gl.GEQUAL)); + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('less', gl.LESS)); + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('greater', gl.GREATER)); + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('equal', gl.EQUAL)); + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('not_equal', gl.NOTEQUAL)); + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('always', gl.ALWAYS)); + compareFuncs.push(new es3fTextureShadowTests.CompareFunc('never', gl.NEVER)); + + var state = tcuTestCase.runner; + /** @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases; + + for (var filterNdx = 0; filterNdx < filters.length; filterNdx++) { + for (var compareNdx = 0; compareNdx < compareFuncs.length; compareNdx++) { + var filterGroup = tcuTestCase.newTest( + '2d.' + filters[filterNdx].name, '2D texture shadow lookup tests'); + testGroup.addChild(filterGroup); + + for (var formatNdx = 0; formatNdx < formats.length; formatNdx++) { + /** @type {number} */ var minFilter = filters[filterNdx].minFilter; + /** @type {number} */ var magFilter = filters[filterNdx].magFilter; + /** @type {number} */ var format = formats[formatNdx].format; + /** @type {number} */ var compareFunc = compareFuncs[compareNdx].func; + /** @type {number} */ var wrapS = gl.REPEAT; + /** @type {number} */ var wrapT = gl.REPEAT; + /** @type {number} */ var width = 32; + /** @type {number} */ var height = 64; + /** @type {string} */ var name = compareFuncs[compareNdx].name + '_' + formats[formatNdx].name; + + filterGroup.addChild(new es3fTextureShadowTests.Texture2DShadowCase(name, '', minFilter, magFilter, wrapS, wrapT, format, width, height, compareFunc)); + } + } + } + + for (filterNdx = 0; filterNdx < filters.length; filterNdx++) { + for (compareNdx = 0; compareNdx < compareFuncs.length; compareNdx++) { + filterGroup = tcuTestCase.newTest( + 'cube.' + filters[filterNdx].name, 'Cube map texture shadow lookup tests'); + testGroup.addChild(filterGroup); + + for (formatNdx = 0; formatNdx < formats.length; formatNdx++) { + minFilter = filters[filterNdx].minFilter; + magFilter = filters[filterNdx].magFilter; + format = formats[formatNdx].format; + compareFunc = compareFuncs[compareNdx].func; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + var size = 32; + name = compareFuncs[compareNdx].name + '_' + formats[formatNdx].name; + + filterGroup.addChild(new es3fTextureShadowTests.TextureCubeShadowCase(name, '', minFilter, magFilter, wrapS, wrapT, format, size, compareFunc)); + } + } + } + + for (var filterNdx = 0; filterNdx < filters.length; filterNdx++) { + for (var compareNdx = 0; compareNdx < compareFuncs.length; compareNdx++) { + filterGroup = tcuTestCase.newTest( + '2d_array.' + filters[filterNdx].name, '2D texture array shadow lookup tests'); + testGroup.addChild(filterGroup); + + for (var formatNdx = 0; formatNdx < formats.length; formatNdx++) { + minFilter = filters[filterNdx].minFilter; + magFilter = filters[filterNdx].magFilter; + format = formats[formatNdx].format; + compareFunc = compareFuncs[compareNdx].func; + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + width = 32; + height = 64; + var numLayers = 8; + name = compareFuncs[compareNdx].name + '_' + formats[formatNdx].name; + + filterGroup.addChild(new es3fTextureShadowTests.Texture2DArrayShadowCase(name, '', minFilter, magFilter, wrapS, wrapT, format, width, height, numLayers, compareFunc)); + } + } + } + }; + + es3fTextureShadowTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var testName = 'texture_shadow'; + var testDescription = 'Texture Shadow Test'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fTextureShadowTests.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js new file mode 100644 index 000000000..5ff5edc55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js @@ -0,0 +1,7456 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fTextureSpecificationTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.referencerenderer.rrUtil'); +goog.require('functional.gles3.es3fFboTestUtil'); + +goog.scope(function() { + var es3fTextureSpecificationTests = + functional.gles3.es3fTextureSpecificationTests; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuSurface = framework.common.tcuSurface; + var tcuTestCase = framework.common.tcuTestCase; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var sglrReferenceContext = + framework.opengl.simplereference.sglrReferenceContext; + var rrUtil = framework.referencerenderer.rrUtil; + var es3fFboTestUtil = functional.gles3.es3fFboTestUtil; + var tcuLogImage = framework.common.tcuLogImage; + + /** + * @param {number} internalFormat + * @return {tcuTexture.TextureFormat} + */ + es3fTextureSpecificationTests.mapGLUnsizedInternalFormat = function( + internalFormat + ) { + switch (internalFormat) { + case gl.ALPHA: + return new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.A, + tcuTexture.ChannelType.UNORM_INT8 + ); + case gl.LUMINANCE: + return new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.L, + tcuTexture.ChannelType.UNORM_INT8 + ); + case gl.LUMINANCE_ALPHA: + return new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.LA, + tcuTexture.ChannelType.UNORM_INT8 + ); + case gl.RGB: + return new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGB, + tcuTexture.ChannelType.UNORM_INT8 + ); + case gl.RGBA: + return new tcuTexture.TextureFormat( + tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8 + ); + default: + throw new Error( + 'Can\'t map GL unsized internal format (' + + internalFormat.toString(16) + ') to texture format' + ); + } + }; + + var VIEWPORT_WIDTH = 256; + var VIEWPORT_HEIGHT = 256; + + /** + * @param {number} width + * @param {number} height + * @param {number=} depth + * @return {number} + */ + es3fTextureSpecificationTests.maxLevelCount = function( + width, height, depth + ) { + depth = depth || 0; + return deMath.logToFloor(Math.max(width, Math.max(height, depth))) + 1; + }; + + /** + * @param {deRandom.Random} rnd + * @param {Array} minVal + * @param {Array} maxVal + * @param {number} size + * @return {Array} + */ + es3fTextureSpecificationTests.randomVector = function( + rnd, minVal, maxVal, size + ) { + var res = []; + for (var ndx = 0; ndx < size; ndx++) + res[ndx] = rnd.getFloat(minVal[ndx], maxVal[ndx]); + return res; + }; + + /** + * @param {tcuPixelFormat.PixelFormat} pixelFormat + * @param {tcuTexture.TextureFormat} textureFormat + * @return {Array} (ivec4) + */ + es3fTextureSpecificationTests.getPixelFormatCompareDepth = function( + pixelFormat, textureFormat + ) { + switch (textureFormat.order) { + case tcuTexture.ChannelOrder.L: + case tcuTexture.ChannelOrder.LA: + return [ + pixelFormat.redBits, pixelFormat.redBits, + pixelFormat.redBits, pixelFormat.alphaBits + ]; + default: + return [ + pixelFormat.redBits, pixelFormat.greenBits, + pixelFormat.blueBits, pixelFormat.alphaBits + ]; + } + }; + + /** + * @param {tcuPixelFormat.PixelFormat} pixelFormat + * @param {tcuTexture.TextureFormat} textureFormat + * @return {Array} (uvec4) + */ + es3fTextureSpecificationTests.computeCompareThreshold = function( + pixelFormat, textureFormat + ) { + /** @type {Array} */ + var texFormatBits = tcuTextureUtil.getTextureFormatBitDepth( + textureFormat + ); + /** @type {Array} */ + var pixelFormatBits = + es3fTextureSpecificationTests.getPixelFormatCompareDepth( + pixelFormat, textureFormat + ); + /** @type {Array} */ + var accurateFmtBits = deMath.min(pixelFormatBits, texFormatBits); + /** @type {Array} */ + var compareBits = deMath.addScalar( + tcuTextureUtil.select( + accurateFmtBits, [8, 8, 8, 8], + deMath.greaterThan(accurateFmtBits, [0, 0, 0, 0]) + ), - 1 + ); + + var result = []; + for (var i = 0; i < compareBits.length; i++) + result.push(1 << compareBits[i]); + return result; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * context + */ + es3fTextureSpecificationTests.TextureSpecCase = function(name, desc) { + tcuTestCase.DeqpTest.call(this, name, desc); + /** + * @type { + * ?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext + * } + */ + this.m_context = null; + }; + + es3fTextureSpecificationTests.TextureSpecCase.prototype = Object.create( + tcuTestCase.DeqpTest.prototype + ); + + es3fTextureSpecificationTests.TextureSpecCase.prototype.constructor = + es3fTextureSpecificationTests.TextureSpecCase; + + /** + * deinit + */ + es3fTextureSpecificationTests.TextureSpecCase.prototype.deinit = + function() { + gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4); + gl.pixelStorei(gl.UNPACK_ROW_LENGTH, 0); + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0); + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0); + + gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null); + } + + /** + * createTexture - Needs to be overridden + */ + es3fTextureSpecificationTests.TextureSpecCase.prototype.createTexture = + function() { + throw new Error('Must override'); + }; + + /** + * verifyTexture - Needs to be overridden + * @param {sglrGLContext.GLContext} webgl2Context + * @param {sglrReferenceContext.ReferenceContext} refContext + * @return {boolean} + */ + es3fTextureSpecificationTests.TextureSpecCase.prototype.verifyTexture = + function( + webgl2Context, refContext + ) { + throw new Error('Must override'); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fTextureSpecificationTests.TextureSpecCase.prototype.iterate = function() { + if (gl.canvas.width < VIEWPORT_WIDTH || + gl.canvas.height < VIEWPORT_HEIGHT) + throw new Error('Too small viewport', ''); + + // Context size, and viewport for GLES3 + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var width = Math.min(gl.canvas.width, VIEWPORT_WIDTH); + var height = Math.min(gl.canvas.height, VIEWPORT_HEIGHT); + var x = rnd.getInt(0, gl.canvas.width - width); + var y = rnd.getInt(0, gl.canvas.height - height); + + // Contexts. + /** @type {sglrGLContext.GLContext} */ + var webgl2Context = new sglrGLContext.GLContext( + gl, [x, y, width, height] + ); + + /** @type {sglrReferenceContext.ReferenceContextBuffers} */ + var refBuffers = new sglrReferenceContext.ReferenceContextBuffers( + new tcuPixelFormat.PixelFormat( + 8, 8, 8, gl.getParameter(gl.ALPHA_BITS) ? 8 : 0 + ), 0 /* depth */, 0 /* stencil */, width, height + ); + + /** @type {sglrReferenceContext.ReferenceContext} */ + var refContext = new sglrReferenceContext.ReferenceContext( + new sglrReferenceContext.ReferenceContextLimits(gl), + refBuffers.getColorbuffer(), refBuffers.getDepthbuffer(), + refBuffers.getStencilbuffer() + ); + + // Clear color buffer. + for (var ndx = 0; ndx < 2; ndx++) { + this.m_context = ndx ? refContext : webgl2Context; + // C++ port uses (0.125, 0.25, 0.5, 1.0), but here we use (0, 0, 0, 0) + // in order to optimize the `clear' op in ReferenceContext. + this.m_context.clearColor(0, 0, 0, 0); + this.m_context.clear( + gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | + gl.STENCIL_BUFFER_BIT + ); + } + + // Construct texture using both GLES3 and reference contexts. + for (var ndx = 0; ndx < 2; ndx++) { + this.m_context = ndx ? refContext : webgl2Context; + this.createTexture(); + checkMessage( + this.m_context.getError() == gl.NO_ERROR, + 'Problem creating texture.' + ); + } + + // Verify results. + if (this.verifyTexture(webgl2Context, refContext)) + testPassed(); + else + testFailed('Verification failed'); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @param {tcuSurface.Surface} dst + * @param { + * ?WebGLProgram| + * framework.opengl.simplereference.sglrShaderProgram.ShaderProgram + * } program + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.TextureSpecCase.prototype.renderTex = + function(dst, program, width, height) { + var targetW = this.m_context.getWidth(); + var targetH = this.m_context.getHeight(); + + var w = width / targetW; + var h = height / targetH; + + rrUtil.drawQuad( + this.m_context, program, [-1.0, -1.0, 0.0], + [-1.0 + w * 2.0, -1.0 + h * 2.0, 0.0] + ); + + // Read pixels back. + dst.readViewport(this.m_context, [0, 0, width, height]); + }; + + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureSpecCase} + * @param {string} name + * @param {string} desc + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} numLevels + */ + es3fTextureSpecificationTests.Texture2DSpecCase = function( + name, desc, format, width, height, numLevels + ) { + es3fTextureSpecificationTests.TextureSpecCase.call(this, name, desc); + + this.m_texFormat = format; + this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format); + this.m_width = width; + this.m_height = height; + this.m_numLevels = numLevels; + }; + + es3fTextureSpecificationTests.Texture2DSpecCase.prototype = Object.create( + es3fTextureSpecificationTests.TextureSpecCase.prototype + ); + + es3fTextureSpecificationTests.Texture2DSpecCase.prototype.constructor = + es3fTextureSpecificationTests.Texture2DSpecCase; + + /** + * @param {sglrGLContext.GLContext} webgl2Context + * @param {sglrReferenceContext.ReferenceContext} refContext + */ + es3fTextureSpecificationTests.Texture2DSpecCase.prototype.verifyTexture = + function( + webgl2Context, refContext + ) { + /** @type {es3fFboTestUtil.Texture2DShader} */ + var shader = new es3fFboTestUtil.Texture2DShader( + [gluTextureUtil.getSampler2DType(this.m_texFormat)], + gluShaderUtil.DataType.FLOAT_VEC4 + ); + + var shaderIDgles = webgl2Context.createProgram(shader); + var shaderIDRef = refContext.createProgram(shader); + + shader.setTexScaleBias( + 0, this.m_texFormatInfo.lookupScale, + this.m_texFormatInfo.lookupBias + ); + + // Set state. + for (var ndx = 0; ndx < 2; ndx++) { + var ctx = ndx ? refContext : webgl2Context; + + this.m_context = ctx; + + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_2D, gl.TEXTURE_MAX_LEVEL, this.m_numLevels - 1 + ); + } + + for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) { + var levelW = Math.max(1, this.m_width >> levelNdx); + var levelH = Math.max(1, this.m_height >> levelNdx); + /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(); + /** @type {tcuSurface.Surface} */ var result = new tcuSurface.Surface(); + + for (var ndx = 0; ndx < 2; ndx++) { + /** @type {tcuSurface.Surface} */ + var dst = ndx ? reference : result; + var ctx = ndx ? refContext : webgl2Context; + var shaderID = ndx ? shaderIDRef : shaderIDgles; + + this.m_context = ctx; + shader.setUniforms(ctx, shaderID); + this.renderTex(dst, shaderID, levelW, levelH); + } + + var threshold = + es3fTextureSpecificationTests.computeCompareThreshold( + tcuPixelFormat.PixelFormatFromContext(gl), this.m_texFormat + ); + var levelStr = levelNdx.toString(); + var name = 'Level' + levelStr; + var desc = 'Level ' + levelStr; + var isOk = tcuImageCompare.intThresholdCompare( + name, desc, reference.getAccess(), result.getAccess(), + threshold, levelNdx == 0 ? + tcuImageCompare.CompareLogMode.RESULT : + tcuImageCompare.CompareLogMode.ON_ERROR + ); + + if (!isOk) { + testFailed('Image comparison failed'); + return false; + } else { + // tcuLogImage.logImageWithInfo(result.getAccess(),'Comparison OK on level: ' + levelNdx); + } + } + return true; + }; + + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureSpecCase} + * @param {string} name + * @param {string} desc + * @param {tcuTexture.TextureFormat} format + * @param {number} size + * @param {number} numLevels + */ + es3fTextureSpecificationTests.TextureCubeSpecCase = function( + name, desc, format, size, numLevels + ) { + es3fTextureSpecificationTests.TextureSpecCase.call( + this, name, desc + ); + this.m_texFormat = format; + this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format); + this.m_size = size; + this.m_numLevels = numLevels; + }; + + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype = + Object.create(es3fTextureSpecificationTests.TextureSpecCase.prototype); + + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype.constructor = + es3fTextureSpecificationTests.TextureCubeSpecCase; + + /** + * @param {sglrGLContext.GLContext} webgl2Context + * @param {sglrReferenceContext.ReferenceContext} refContext + */ + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype.verifyTexture = + function( + webgl2Context, refContext + ) { + /** @type {es3fFboTestUtil.TextureCubeShader} */ + var shader = new es3fFboTestUtil.TextureCubeShader( + gluTextureUtil.getSamplerCubeType(this.m_texFormat), + gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderIDgles = webgl2Context.createProgram(shader); + var shaderIDRef = refContext.createProgram(shader); + + shader.setTexScaleBias( + this.m_texFormatInfo.lookupScale, this.m_texFormatInfo.lookupBias + ); + + // Set state. + for (var ndx = 0; ndx < 2; ndx++) { + var ctx = ndx ? refContext : webgl2Context; + + this.m_context = ctx; + + this.m_context.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, + gl.NEAREST_MIPMAP_NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, + gl.NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAX_LEVEL, + this.m_numLevels - 1 + ); + } + + for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) { + var levelSize = Math.max(1, this.m_size >> levelNdx); + var isOk = true; + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + /** @type {tcuSurface.Surface} */ + var reference = new tcuSurface.Surface(); + /** @type {tcuSurface.Surface} */ + var result = new tcuSurface.Surface(); + + if (levelSize <= 2) + continue; // Fuzzy compare doesn't work for images this small. + + shader.setFace(face); + + for (var ndx = 0; ndx < 2; ndx++) { + /** @type {tcuSurface.Surface} */ + var dst = ndx ? reference : result; + ctx = ndx ? refContext : webgl2Context; + var shaderID = ndx ? shaderIDRef : shaderIDgles; + + this.m_context = ctx; + shader.setUniforms(ctx, shaderID); + this.renderTex(dst, shaderID, levelSize, levelSize); + } + + var threshold = 0.02; + var faceStr = face.toString(); + var levelStr = levelNdx.toString(); + var name = 'Level' + levelStr; + var desc = 'Level ' + levelStr + ', face ' + faceStr; + var isFaceOk = tcuImageCompare.fuzzyCompare( + name, desc, reference.getAccess(), result.getAccess(), + threshold, levelNdx == 0 ? + tcuImageCompare.CompareLogMode.RESULT : + tcuImageCompare.CompareLogMode.ON_ERROR + ); + + if (!isFaceOk) { + testFailed('Image comparison failed'); + return false; + } + } + + } + return true; + }; + + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureSpecCase} + * @param {string} name + * @param {string} desc + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} numLayers + * @param {number} numLevels + */ + es3fTextureSpecificationTests.Texture2DArraySpecCase = function( + name, desc, format, width, height, numLayers, numLevels + ) { + es3fTextureSpecificationTests.TextureSpecCase.call( + this, name, desc + ); + this.m_texFormat = format; + this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format); + this.m_width = width; + this.m_height = height; + this.m_numLayers = numLayers; + this.m_numLevels = numLevels; + }; + + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype = + Object.create(es3fTextureSpecificationTests.TextureSpecCase.prototype); + + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype.constructor = + es3fTextureSpecificationTests.Texture2DArraySpecCase; + + /** + * @param {sglrGLContext.GLContext} webgl2Context + * @param {sglrReferenceContext.ReferenceContext} refContext + */ + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype.verifyTexture = + function( + webgl2Context, refContext + ) { + /** @type {es3fFboTestUtil.Texture2DArrayShader} */ + var shader = new es3fFboTestUtil.Texture2DArrayShader( + gluTextureUtil.getSampler2DArrayType(this.m_texFormat), + gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderIDgles = webgl2Context.createProgram(shader); + var shaderIDRef = refContext.createProgram(shader); + + shader.setTexScaleBias( + this.m_texFormatInfo.lookupScale, this.m_texFormatInfo.lookupBias + ); + + // Set state. + for (var ndx = 0; ndx < 2; ndx++) { + var ctx = ndx ? refContext : webgl2Context; + + this.m_context = ctx; + + this.m_context.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, + gl.NEAREST_MIPMAP_NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, + gl.NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_R, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAX_LEVEL, + this.m_numLevels - 1 + ); + } + + for (var layerNdx = 0; layerNdx < this.m_numLayers; layerNdx++) { + var layerOk = true; + + shader.setLayer(layerNdx); + for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) { + var levelW = Math.max(1, this.m_width >> levelNdx); + var levelH = Math.max(1, this.m_height >> levelNdx); + + if (levelW == 1 || levelH == 1) { + // Rendering to texture of size x1 is problematic in referencerenderer + // due to its deviation from c++ code: crbug.com/613206 + continue; + } + /** @type {tcuSurface.Surface} */ + var reference = new tcuSurface.Surface(); + /** @type {tcuSurface.Surface} */ + var result = new tcuSurface.Surface(); + + var isOk = true; + + for (var ndx = 0; ndx < 2; ndx++) { + /** @type {tcuSurface.Surface} */ + var dst = ndx ? reference : result; + ctx = ndx ? refContext : webgl2Context; + var shaderID = ndx ? shaderIDRef : shaderIDgles; + + this.m_context = ctx; + shader.setUniforms(ctx, shaderID); + this.renderTex(dst, shaderID, levelW, levelH); + } + + var threshold = + es3fTextureSpecificationTests.computeCompareThreshold( + tcuPixelFormat.PixelFormatFromContext(gl), this.m_texFormat + ); + var levelStr = levelNdx.toString(); + var layerStr = layerNdx.toString(); + var name = 'Layer' + layerStr + 'Level' + levelStr; + var desc = 'Layer ' + layerStr + ', Level ' + levelStr; + var depthOk = tcuImageCompare.intThresholdCompare( + name, desc, reference.getAccess(), result.getAccess(), + threshold, (levelNdx == 0 && layerNdx == 0) ? + tcuImageCompare.CompareLogMode.RESULT : + tcuImageCompare.CompareLogMode.ON_ERROR + ); + + if (!depthOk) { + testFailed('Image comparison failed'); + return false; + } + } + + } + return true; + }; + + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureSpecCase} + * @param {string} name + * @param {string} desc + * @param {tcuTexture.TextureFormat} format + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} numLevels + */ + es3fTextureSpecificationTests.Texture3DSpecCase = function( + name, desc, format, width, height, depth, numLevels + ) { + es3fTextureSpecificationTests.TextureSpecCase.call( + this, name, desc + ); + this.m_texFormat = format; + this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format); + this.m_width = width; + this.m_height = height; + this.m_depth = depth; + this.m_numLevels = numLevels; + }; + + es3fTextureSpecificationTests.Texture3DSpecCase.prototype = + Object.create(es3fTextureSpecificationTests.TextureSpecCase.prototype); + + es3fTextureSpecificationTests.Texture3DSpecCase.prototype.constructor = + es3fTextureSpecificationTests.Texture3DSpecCase; + + /** + * @param {sglrGLContext.GLContext} webgl2Context + * @param {sglrReferenceContext.ReferenceContext} refContext + */ + es3fTextureSpecificationTests.Texture3DSpecCase.prototype.verifyTexture = + function( + webgl2Context, refContext + ) { + /** @type {es3fFboTestUtil.Texture3DShader} */ + var shader = new es3fFboTestUtil.Texture3DShader( + gluTextureUtil.getSampler3D(this.m_texFormat), + gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderIDgles = webgl2Context.createProgram(shader); + var shaderIDRef = refContext.createProgram(shader); + + shader.setTexScaleBias( + this.m_texFormatInfo.lookupScale, this.m_texFormatInfo.lookupBias + ); + + // Set state. + for (var ndx = 0; ndx < 2; ndx++) { + var ctx = ndx ? refContext : webgl2Context; + + this.m_context = ctx; + + this.m_context.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, + gl.NEAREST_MIPMAP_NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, + gl.NEAREST + ); + this.m_context.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_WRAP_R, + gl.CLAMP_TO_EDGE + ); + this.m_context.texParameteri( + gl.TEXTURE_3D, gl.TEXTURE_MAX_LEVEL, + this.m_numLevels - 1 + ); + } + + for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) { + var levelW = Math.max(1, this.m_width >> levelNdx); + var levelH = Math.max(1, this.m_height >> levelNdx); + var levelD = Math.max(1, this.m_depth >> levelNdx); + var levelOk = true; + + if (levelW == 1 || levelH == 1) { + // Rendering to texture of size x1 is problematic in referencerenderer + // due to its deviation from c++ code: crbug.com/613206 + continue; + } + + for (var depth = 0; depth < levelD; depth++) { + /** @type {tcuSurface.Surface} */ + var reference = new tcuSurface.Surface(); + /** @type {tcuSurface.Surface} */ + var result = new tcuSurface.Surface(); + + shader.setDepth((depth + 0.5) / levelD); + + for (var ndx = 0; ndx < 2; ndx++) { + /** @type {tcuSurface.Surface} */ + var dst = ndx ? reference : result; + ctx = ndx ? refContext : webgl2Context; + var shaderID = ndx ? shaderIDRef : shaderIDgles; + + this.m_context = ctx; + shader.setUniforms(ctx, shaderID); + this.renderTex(dst, shaderID, levelW, levelH); + } + + var threshold = + es3fTextureSpecificationTests.computeCompareThreshold( + tcuPixelFormat.PixelFormatFromContext(gl), this.m_texFormat + ); + var levelStr = levelNdx.toString(); + var sliceStr = depth.toString(); + var name = 'Layer' + levelStr + 'Slice' + sliceStr; + var desc = 'Layer ' + levelStr + ', Slice ' + sliceStr; + var depthOk = tcuImageCompare.intThresholdCompare( + name, desc, reference.getAccess(), result.getAccess(), + threshold, (levelNdx == 0 && depth == 0) ? + tcuImageCompare.CompareLogMode.RESULT : + tcuImageCompare.CompareLogMode.ON_ERROR + ); + + if (!depthOk) { + testFailed('Image comparison failed'); + return false; + } + } + + } + return true; + }; + + // Basic TexImage2D() with 2D texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.BasicTexImage2DCase = function( + name, desc, format, dataType, width, height + ) { + // Unsized internal format. + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), width, height, + es3fTextureSpecificationTests.maxLevelCount( + width, height + ) + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.BasicTexImage2DCase.prototype = Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests.BasicTexImage2DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexImage2DCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @return {es3fTextureSpecificationTests.BasicTexImage2DCase} + */ + es3fTextureSpecificationTests.newBasicTexImage2DCaseInternal = function( + name, desc, internalFormat, width, height + ) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.BasicTexImage2DCase( + name, desc, fmt.format, fmt.dataType, width, height + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests.BasicTexImage2DCase.prototype.createTexture = + function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelW, levelH); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0, + this.m_format, this.m_dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // Basic TexImage2D() with cubemap usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} size + */ + es3fTextureSpecificationTests.BasicTexImageCubeCase = function( + name, desc, format, dataType, size + ) { + // Unsized internal format. + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), size, deMath.logToFloor(size) + 1 + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.BasicTexImageCubeCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicTexImageCubeCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexImageCubeCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @return {es3fTextureSpecificationTests.BasicTexImageCubeCase} + */ + es3fTextureSpecificationTests.newBasicTexImageCubeCaseInternal = function( + name, desc, internalFormat, size + ) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.BasicTexImageCubeCase( + name, desc, fmt.format, fmt.dataType, size + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicTexImageCubeCase.prototype.createTexture = + function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_size, this.m_size + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + levelData.setSize(levelSize, levelSize); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + ndx, this.m_internalFormat, levelSize, levelSize, 0, + this.m_format, this.m_dataType, + levelData.getAccess().getDataPtr() + ); + } + } + }; + + // Basic TexImage3D() with 2D array texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} numLayers + */ + es3fTextureSpecificationTests.BasicTexImage2DArrayCase = function( + name, desc, internalFormat, width, height, numLayers + ) { + es3fTextureSpecificationTests.Texture2DArraySpecCase.call( + this, name, desc, + gluTextureUtil.mapGLInternalFormat(internalFormat), width, height, + numLayers, es3fTextureSpecificationTests.maxLevelCount( + width, height + ) + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicTexImage2DArrayCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicTexImage2DArrayCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexImage2DArrayCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicTexImage2DArrayCase.prototype.createTexture = + function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelW, levelH, this.m_numLayers); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage3D( + gl.TEXTURE_2D_ARRAY, ndx, this.m_internalFormat, levelW, levelH, + this.m_numLayers, 0, transferFmt.format, + transferFmt.dataType, levelData.getAccess().getDataPtr() + ); + } + }; + + // Basic TexImage3D() with 3D texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture3DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + */ + es3fTextureSpecificationTests.BasicTexImage3DCase = function( + name, desc, internalFormat, width, height, depth + ) { + es3fTextureSpecificationTests.Texture3DSpecCase.call( + this, name, desc, + gluTextureUtil.mapGLInternalFormat(internalFormat), width, height, + depth, es3fTextureSpecificationTests.maxLevelCount( + width, height, depth + ) + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicTexImage3DCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture3DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicTexImage3DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexImage3DCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicTexImage3DCase.prototype.createTexture = + function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_3D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var levelD = Math.max(1, this.m_depth >> ndx); + + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelW, levelH, levelD); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage3D( + gl.TEXTURE_3D, ndx, this.m_internalFormat, levelW, levelH, + levelD, 0, transferFmt.format, transferFmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // Randomized 2D texture specification using TexImage2D + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.RandomOrderTexImage2DCase = function( + name, desc, format, dataType, width, height + ) { + // Unsized internal format. + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), width, height, + es3fTextureSpecificationTests.maxLevelCount( + width, height + ) + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.RandomOrderTexImage2DCase.prototype = Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + RandomOrderTexImage2DCase.prototype.constructor = + es3fTextureSpecificationTests.RandomOrderTexImage2DCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @return {es3fTextureSpecificationTests.RandomOrderTexImage2DCase} + */ + es3fTextureSpecificationTests.newRandomOrderTexImage2DCaseInternal = + function(name, desc, internalFormat, width, height) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.RandomOrderTexImage2DCase( + name, desc, fmt.format, fmt.dataType, width, height + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + RandomOrderTexImage2DCase.prototype.createTexture = function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + var levels = []; + for (var i = 0; i < this.m_numLevels; i++) + levels[i] = i; + levels = rnd.shuffle(levels); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelNdx = levels[ndx]; + var levelW = Math.max(1, this.m_width >> levelNdx); + var levelH = Math.max(1, this.m_height >> levelNdx); + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelW, levelH); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + gl.TEXTURE_2D, levelNdx, this.m_internalFormat, levelW, levelH, 0, + this.m_format, this.m_dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // Randomized cubemap texture specification using TexImage2D + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} size + */ + es3fTextureSpecificationTests.RandomOrderTexImageCubeCase = function( + name, desc, format, dataType, size + ) { + // Unsized internal format. + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), size, deMath.logToFloor(size) + 1 + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.RandomOrderTexImageCubeCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + RandomOrderTexImageCubeCase.prototype.constructor = + es3fTextureSpecificationTests.RandomOrderTexImageCubeCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @return {es3fTextureSpecificationTests.RandomOrderTexImageCubeCase} + */ + es3fTextureSpecificationTests.newRandomOrderTexImageCubeCaseInternal = + function(name, desc, internalFormat, size) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.RandomOrderTexImageCubeCase( + name, desc, fmt.format, fmt.dataType, size + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + RandomOrderTexImageCubeCase.prototype.createTexture = + function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_size, this.m_size + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + // Level-face pairs. + var images = []; + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + images[ndx * 6 + face] = {ndx: ndx, face: face}; + } + + images = rnd.shuffle(images); + + for (var ndx = 0; ndx < images.length; ndx++) { + var levelNdx = images[ndx].ndx; + /** @type {framework.common.tcuTexture.CubeFace} */ + var face = images[ndx].face; + var levelSize = Math.max(1, this.m_size >> levelNdx); + + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelSize, levelSize); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + levelNdx, this.m_internalFormat, levelSize, levelSize, 0, + this.m_format, this.m_dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // TexImage2D() unpack alignment case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + * @param {number} numLevels + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexImage2DAlignCase = function( + name, desc, format, dataType, width, height, numLevels, alignment + ) { + // Unsized internal format. + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), width, height, numLevels + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexImage2DAlignCase.prototype = Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage2DAlignCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DAlignCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} numLevels + * @param {number} alignment + * @return {es3fTextureSpecificationTests.TexImage2DAlignCase} + */ + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal = function( + name, desc, internalFormat, width, height, numLevels, alignment + ) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.TexImage2DAlignCase( + name, desc, fmt.format, fmt.dataType, + width, height, numLevels, alignment + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests.TexImage2DAlignCase.prototype.createTexture = + function() { + var tex = null; + /** @type {ArrayBuffer} */ var data; + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var colorA = deMath.add( + deMath.multiply( + [1.0, 0.0, 0.0, 1.0], + deMath.subtract( + this.m_texFormatInfo.valueMax, + this.m_texFormatInfo.valueMin + ) + ), this.m_texFormatInfo.valueMin + ); + var colorB = deMath.add( + deMath.multiply( + [0.0, 1.0, 0.0, 1.0], + deMath.subtract( + this.m_texFormatInfo.valueMax, + this.m_texFormatInfo.valueMin + ) + ), this.m_texFormatInfo.valueMin + ); + + var rowPitch = deMath.deAlign32( + levelW * this.m_texFormat.getPixelSize(), this.m_alignment + ); + var cellSize = Math.max(1, Math.min(levelW >> 2, levelH >> 2)); + data = new ArrayBuffer(rowPitch * levelH); + var access = new tcuTexture.PixelBufferAccess({format: this.m_texFormat, width: levelW, + height: levelH, rowPitch: rowPitch, data: data} + ); + tcuTextureUtil.fillWithGrid(access, cellSize, colorA, colorB + ); + + this.m_context.texImage2D( + gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0, + this.m_format, this.m_dataType, + access.getDataPtr() + ); + } + }; + + // TexImageCube unpack alignment case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} size + * @param {number} numLevels + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexImageCubeAlignCase = function( + name, desc, format, dataType, size, numLevels, alignment + ) { + // Unsized internal format. + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), size, numLevels + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexImageCubeAlignCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImageCubeAlignCase.prototype.constructor = + es3fTextureSpecificationTests.TexImageCubeAlignCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @param {number} numLevels + * @param {number} alignment + * @return {es3fTextureSpecificationTests.TexImageCubeAlignCase} + */ + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal = + function(name, desc, internalFormat, size, numLevels, alignment) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.TexImageCubeAlignCase( + name, desc, fmt.format, fmt.dataType, size, numLevels, alignment + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexImageCubeAlignCase.prototype.createTexture = + function() { + var tex = null; + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + /** @type {ArrayBuffer} */ var data; + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + var cellSize = Math.max(1, levelSize >> 2); + var rowPitch = deMath.deAlign32( + this.m_texFormat.getPixelSize() * levelSize, this.m_alignment + ); + var colorA = deMath.add(deMath.multiply( + [1.0, 0.0, 0.0, 1.0], deMath.subtract( + this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin + )), this.m_texFormatInfo.valueMin + ); + var colorB = deMath.add(deMath.multiply( + [0.0, 1.0, 0.0, 1.0], deMath.subtract( + this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin + )), this.m_texFormatInfo.valueMin + ); + + data = new ArrayBuffer(rowPitch * levelSize); + var access = new tcuTexture.PixelBufferAccess({format: this.m_texFormat, width: levelSize, + height: levelSize, rowPitch: rowPitch, data: data} + ); + tcuTextureUtil.fillWithGrid(access, cellSize, colorA, colorB + ); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + ndx, this.m_internalFormat, levelSize, levelSize, 0, + this.m_format, this.m_dataType, + access.getDataPtr() + ); + } + } + }; + + // TexImage2D() unpack parameters case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} rowLength + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexImage2DParamsCase = function( + name, desc, internalFormat, width, height, rowLength, skipRows, + skipPixels, alignment + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, + gluTextureUtil.mapGLInternalFormat(internalFormat), + width, height, 1 + ); + this.m_internalFormat = internalFormat; + this.m_rowLength = rowLength; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexImage2DParamsCase.prototype = + Object.create(es3fTextureSpecificationTests.Texture2DSpecCase.prototype); + + es3fTextureSpecificationTests.TexImage2DParamsCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DParamsCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests.TexImage2DParamsCase.prototype.createTexture = + function() { + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width; + var rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment); + var height = this.m_height + this.m_skipRows; + var tex = null; + /** @type {ArrayBuffer} */ var data; + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels different to 1', + false, true + ); + + // Fill data with grid. + data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize); + + var cScale = deMath.subtract( + this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin + ); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply( + [1.0, 0.0, 0.0, 1.0], cScale + ), cBias + ); + var colorB = deMath.add( + deMath.multiply( + [0.0, 1.0, 0.0, 1.0], cScale + ), cBias + ); + + var accessWithOffset = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + rowPitch: rowPitch, + data: data, + offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + }); + tcuTextureUtil.fillWithGrid(accessWithOffset, 4, colorA, colorB + ); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + rowPitch: rowPitch, + data: data, + }); + + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.texImage2D( + gl.TEXTURE_2D, 0, this.m_internalFormat, + this.m_width, this.m_height, 0, + transferFmt.format, transferFmt.dataType, access.getDataPtr() + ); + }; + + // TexImage3D() unpack parameters case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture3DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} imageHeight + * @param {number} rowLength + * @param {number} skipImages + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexImage3DParamsCase = function( + name, desc, internalFormat, width, height, depth, imageHeight, + rowLength, skipImages, skipRows, skipPixels, alignment + ) { + es3fTextureSpecificationTests.Texture3DSpecCase.call( + this, name, desc, + gluTextureUtil.mapGLInternalFormat(internalFormat), + width, height, depth, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_imageHeight = imageHeight; + this.m_rowLength = rowLength; + this.m_skipImages = skipImages; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexImage3DParamsCase.prototype = + Object.create(es3fTextureSpecificationTests.Texture3DSpecCase.prototype); + + es3fTextureSpecificationTests.TexImage3DParamsCase.prototype.constructor = + es3fTextureSpecificationTests.Texture3DSpecCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests.TexImage3DParamsCase.prototype.createTexture = + function() { + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width; + var rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment); + var imageHeight = this.m_imageHeight > 0 ? + this.m_imageHeight : this.m_height; + var slicePitch = imageHeight * rowPitch; + + var tex = null; + /** @type {ArrayBuffer} */ var data; + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels different to 1', + false, true + ); + + // Fill data with grid. + data = new ArrayBuffer(slicePitch * (this.m_depth + this.m_skipImages) + + this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize); + + var cScale = deMath.subtract( + this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin + ); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply( + [1.0, 0.0, 0.0, 1.0], cScale + ), cBias + ); + var colorB = deMath.add( + deMath.multiply( + [0.0, 1.0, 0.0, 1.0], cScale + ), cBias + ); + + var accessWithOffset = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: this.m_skipImages * slicePitch + this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + }); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data + }); + tcuTextureUtil.fillWithGrid( + accessWithOffset, 4, colorA, colorB + ); + + this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight); + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_3D, tex); + this.m_context.texImage3D( + gl.TEXTURE_3D, 0, this.m_internalFormat, + this.m_width, this.m_height, this.m_depth, 0, + transferFmt.format, transferFmt.dataType, access.getDataPtr() + ); + }; + + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.BasicTexSubImage2DCase = function( + name, desc, format, dataType, width, height + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), width, height, es3fTextureSpecificationTests.maxLevelCount( + width, height + ) + ); + + this.m_format = format; + this.m_internalFormat = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.BasicTexSubImage2DCase.prototype = + Object.create(es3fTextureSpecificationTests.Texture2DSpecCase.prototype); + + es3fTextureSpecificationTests.BasicTexSubImage2DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexSubImage2DCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @return {es3fTextureSpecificationTests.BasicTexSubImage2DCase} + */ + es3fTextureSpecificationTests.newBasicTexSubImage2DCaseInternal = + function(name, desc, internalFormat, width, height) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.BasicTexSubImage2DCase( + name, desc, fmt.format, fmt.dataType, width, height + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + */ + es3fTextureSpecificationTests. + BasicTexSubImage2DCase.prototype.createTexture = function() { + var tex = null; + var data = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + data.setSize(levelW, levelH); + tcuTextureUtil.fillWithComponentGradients( + data.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0, + this.m_format, this.m_dataType, + data.getAccess().getDataPtr() + ); + } + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + + var w = rnd.getInt(1, levelW); + var h = rnd.getInt(1, levelH); + var x = rnd.getInt(0, levelW - w); + var y = rnd.getInt(0, levelH - h); + + var colorA = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var colorB = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var cellSize = rnd.getInt(2, 16); + + data.setSize(w, h); + tcuTextureUtil.fillWithGrid( + data.getAccess(), cellSize, colorA, colorB + ); + + this.m_context.texSubImage2D( + gl.TEXTURE_2D, ndx, x, y, w, h, this.m_format, this.m_dataType, + data.getAccess().getDataPtr() + ); + } + }; + + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} size + */ + es3fTextureSpecificationTests.BasicTexSubImageCubeCase = function( + name, desc, format, dataType, size + ) { + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), size, deMath.logToFloor(size) + 1 + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.BasicTexSubImageCubeCase.prototype = + Object.create(es3fTextureSpecificationTests.TextureCubeSpecCase.prototype); + + es3fTextureSpecificationTests. + BasicTexSubImageCubeCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexSubImageCubeCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + */ + es3fTextureSpecificationTests.newBasicTexSubImageCubeCaseInternal = + function(name, desc, internalFormat, size) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = + new es3fTextureSpecificationTests.BasicTexSubImageCubeCase( + name, desc, fmt.format, fmt.dataType, + size); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicTexSubImageCubeCase.prototype.createTexture = function() { + var tex = null; + var data = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_size, this.m_size + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + data.setSize(levelSize, levelSize); + + for (var face = /** @type {tcuTexture.CubeFace} */ (0); + face < es3fTextureSpecificationTests.s_cubeMapFaces.length; + face++) { + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + tcuTextureUtil.fillWithComponentGradients( + data.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], ndx, + this.m_internalFormat, levelSize, levelSize, 0, + this.m_format, this.m_dataType, + data.getAccess().getDataPtr() + ); + } + } + + // Re-specify parts of each face and level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + + var w = rnd.getInt(1, levelSize); + var h = rnd.getInt(1, levelSize); + var x = rnd.getInt(0, levelSize - w); + var y = rnd.getInt(0, levelSize - h); + + var colorA = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var colorB = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var cellSize = rnd.getInt(2, 16); + + data.setSize(w, h); + tcuTextureUtil.fillWithGrid( + data.getAccess(), cellSize, colorA, colorB + ); + + this.m_context.texSubImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + ndx, x, y, w, h, this.m_format, + this.m_dataType, data.getAccess().getDataPtr() + ); + } + } + }; + + // TexSubImage2D() unpack parameters case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} subX + * @param {number} subY + * @param {number} subW + * @param {number} subH + * @param {number} rowLength + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexSubImage2DParamsCase = function( + name, desc, internalFormat, width, height, subX, subY, subW, subH, + rowLength, skipRows, skipPixels, alignment + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, + gluTextureUtil.mapGLInternalFormat(internalFormat), + width, height, 1 + ); + this.m_internalFormat = internalFormat; + this.m_subX = subX; + this.m_subY = subY; + this.m_subW = subW; + this.m_subH = subH; + this.m_rowLength = rowLength; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexSubImage2DParamsCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage2DParamsCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage2DParamsCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage2DParamsCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var tex = null; + /** @type {ArrayBuffer} */ var data; + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels different to 1', + false, true + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + + // First fill texture with gradient. + data = new ArrayBuffer( + deMath.deAlign32(this.m_width * pixelSize, 4) * this.m_height + ); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + rowPitch: deMath.deAlign32(this.m_width * pixelSize, 4), + data: data + }); + tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax + ); + this.m_context.texImage2D( + gl.TEXTURE_2D, 0, this.m_internalFormat, this.m_width, + this.m_height, 0, transferFmt.format, transferFmt.dataType, + access.getDataPtr() + ); + + // Fill data with grid. + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW; + var rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment); + var height = this.m_subH + this.m_skipRows; + var cScale = deMath.subtract( + this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin + ); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply( + [1.0, 0.0, 0.0, 1.0], cScale + ), cBias + ); + var colorB = deMath.add( + deMath.multiply( + [0.0, 1.0, 0.0, 1.0], cScale + ), cBias + ); + + data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize); + tcuTextureUtil.fillWithGrid( + new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + rowPitch: rowPitch, + data: data, + offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + }) , + 4, colorA, colorB + ); + + access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + rowPitch: rowPitch, + data: data + }); + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + this.m_context.texSubImage2D( + gl.TEXTURE_2D, 0, this.m_subX, this.m_subY, + this.m_subW, this.m_subH, + transferFmt.format, transferFmt.dataType, + access.getDataPtr() + ); + }; + + // Basic TexSubImage3D() with 3D texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture3DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + */ + es3fTextureSpecificationTests.BasicTexSubImage3DCase = function( + name, desc, internalFormat, width, height, depth + ) { + es3fTextureSpecificationTests.Texture3DSpecCase.call( + this, name, desc, + gluTextureUtil.mapGLInternalFormat(internalFormat), + width, height, depth, es3fTextureSpecificationTests.maxLevelCount( + width, height, depth + ) + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicTexSubImage3DCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture3DSpecCase.prototype + ); + + es3fTextureSpecificationTests.BasicTexSubImage3DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexSubImage3DCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicTexSubImage3DCase.prototype.createTexture = function() { + var tex = null; + var data = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_3D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + // First specify full texture. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var levelD = Math.max(1, this.m_depth >> ndx); + + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + data.setSize(levelW, levelH, levelD); + tcuTextureUtil.fillWithComponentGradients( + data.getAccess(), gMin, gMax + ); + + this.m_context.texImage3D( + gl.TEXTURE_3D, ndx, this.m_internalFormat, levelW, levelH, + levelD, 0, transferFmt.format, transferFmt.dataType, + data.getAccess().getDataPtr() + ); + } + + // Re-specify parts of each level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var levelD = Math.max(1, this.m_depth >> ndx); + + var w = rnd.getInt(1, levelW); + var h = rnd.getInt(1, levelH); + var d = rnd.getInt(1, levelD); + var x = rnd.getInt(0, levelW - w); + var y = rnd.getInt(0, levelH - h); + var z = rnd.getInt(0, levelD - d); + + var colorA = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var colorB = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var cellSize = rnd.getInt(2, 16); + + data.setSize(w, h, d); + tcuTextureUtil.fillWithGrid( + data.getAccess(), cellSize, colorA, colorB + ); + + this.m_context.texSubImage3D( + gl.TEXTURE_3D, ndx, x, y, z, w, h, d, + transferFmt.format, transferFmt.dataType, + data.getAccess().getDataPtr() + ); + } + }; + + // TexSubImage2D() to texture initialized with empty data + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase = function( + name, desc, format, dataType, width, height + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), width, height, es3fTextureSpecificationTests.maxLevelCount( + width, height + ) + ); + + this.m_format = format; + this.m_internalFormat = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase.prototype = + Object.create(es3fTextureSpecificationTests.Texture2DSpecCase.prototype); + + es3fTextureSpecificationTests. + TexSubImage2DEmptyTexCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.newTexSubImage2DEmptyTexCaseInternal = + function(name, desc, internalFormat, width, height) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = + new es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase( + name, desc, fmt.format, fmt.dataType, width, height + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage2DEmptyTexCase.prototype.createTexture = function() { + var tex = null; + var data = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + // First allocate storage for each level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + + this.m_context.texImage2D( + gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0, + this.m_format, this.m_dataType, + null + ); + } + + // Specify pixel data to all levels using glTexSubImage2D() + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + data.setSize(levelW, levelH); + tcuTextureUtil.fillWithComponentGradients( + data.getAccess(), gMin, gMax + ); + + this.m_context.texSubImage2D( + gl.TEXTURE_2D, ndx, 0, 0, levelW, levelH, + this.m_format, this.m_dataType, + data.getAccess().getDataPtr() + ); + } + }; + + // TexSubImage2D() to empty cubemap texture + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} size + */ + es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase = function( + name, desc, format, dataType, size + ) { + // Unsized internal format. + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), size, deMath.logToFloor(size) + 1 + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImageCubeEmptyTexCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @return {es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase} + */ + es3fTextureSpecificationTests.newTexSubImageCubeEmptyTexCaseInternal = + function(name, desc, internalFormat, size) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = + new es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase( + name, desc, fmt.format, fmt.dataType, size + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImageCubeEmptyTexCase.prototype.createTexture = + function() { + var tex = null; + var data = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_size, this.m_size + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + // Specify storage for each level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + ndx, this.m_internalFormat, levelSize, levelSize, 0, + this.m_format, this.m_dataType, + null + ); + } + } + + // Specify data using glTexSubImage2D() + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + data.setSize(levelSize, levelSize); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + tcuTextureUtil.fillWithComponentGradients( + data.getAccess(), gMin, gMax + ); + + this.m_context.texSubImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + ndx, 0, 0, levelSize, levelSize, this.m_format, + this.m_dataType, data.getAccess().getDataPtr() + ); + } + } + }; + + // TexSubImage2D() unpack alignment with 2D texture + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + * @param {number} subX + * @param {number} subY + * @param {number} subW + * @param {number} subH + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexSubImage2DAlignCase = function( + name, desc, format, dataType, width, height, subX, subY, subW, subH, + alignment + ) { + // Unsized internal format. + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), width, height, 1 + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + this.m_subX = subX; + this.m_subY = subY; + this.m_subW = subW; + this.m_subH = subH; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexSubImage2DAlignCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage2DAlignCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage2DAlignCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} subX + * @param {number} subY + * @param {number} subW + * @param {number} subH + * @param {number} alignment + * @return {es3fTextureSpecificationTests.TexSubImage2DAlignCase} + */ + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal = function( + name, desc, internalFormat, width, height, subX, subY, subW, subH, + alignment + ) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = new es3fTextureSpecificationTests.TexSubImage2DAlignCase( + name, desc, fmt.format, fmt.dataType, + width, height, subX, subY, subW, subH, alignment + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage2DAlignCase.prototype.createTexture = function() { + var tex = null; + /** @type {ArrayBuffer} */ var data; + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + + // Specify base level. + data = new ArrayBuffer(this.m_texFormat.getPixelSize() * + this.m_width * this.m_height + ); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + data: data + }); + tcuTextureUtil.fillWithComponentGradients(access, [0, 0, 0, 0], [1, 1, 1, 1]); + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + this.m_context.texImage2D(gl.TEXTURE_2D, 0, this.m_internalFormat, + this.m_width, this.m_height, 0, this.m_format, this.m_dataType, + access.getDataPtr() + ); + + // Re-specify subrectangle. + var rowPitch = deMath.deAlign32( + this.m_texFormat.getPixelSize() * this.m_subW, this.m_alignment + ); + data = new ArrayBuffer(rowPitch * this.m_subH); + access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + rowPitch: rowPitch, + data: data + }); + tcuTextureUtil.fillWithGrid(access, 4, [1, 0, 0, 1], [0, 1, 0, 1] + ); + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + this.m_context.texSubImage2D( + gl.TEXTURE_2D, 0, this.m_subX, this.m_subY, this.m_subW, + this.m_subH, this.m_format, this.m_dataType, access.getDataPtr() + ); + }; + + // TexSubImage2D() unpack alignment with cubemap texture + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} size + * @param {number} subX + * @param {number} subY + * @param {number} subW + * @param {number} subH + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexSubImageCubeAlignCase = function( + name, desc, format, dataType, size, subX, subY, subW, subH, alignment + ) { + // Unsized internal format. + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), size, 1 + ); + + this.m_internalFormat = format; + this.m_format = format; + this.m_dataType = dataType; + this.m_subX = subX; + this.m_subY = subY; + this.m_subW = subW; + this.m_subH = subH; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexSubImageCubeAlignCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImageCubeAlignCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImageCubeAlignCase; + + /** + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @param {number} subX + * @param {number} subY + * @param {number} subW + * @param {number} subH + * @param {number} alignment + * @return {es3fTextureSpecificationTests.TexSubImageCubeAlignCase} + */ + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal = + function( + name, desc, internalFormat, size, + subX, subY, subW, subH, alignment + ) { + // Sized internal format. + var fmt = gluTextureUtil.getTransferFormat( + gluTextureUtil.mapGLInternalFormat(internalFormat) + ); + var testcase = + new es3fTextureSpecificationTests.TexSubImageCubeAlignCase( + name, desc, fmt.format, fmt.dataType, size, + subX, subY, subW, subH, alignment + ); + testcase.m_internalFormat = internalFormat; + return testcase; + }; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImageCubeAlignCase.prototype.createTexture = + function() { + var tex = null; + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + + var data = new ArrayBuffer(this.m_texFormat.getPixelSize() * this.m_size * this.m_size); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_size, + height: this.m_size, + data: data + }); + tcuTextureUtil.fillWithComponentGradients(access, [0, 0, 0, 0], [1, 1, 1, 1] + ); + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + 0, this.m_internalFormat, this.m_size, this.m_size, 0, + this.m_format, this.m_dataType, + access.getDataPtr() + ); + } + + // Re-specify subrectangle. + var rowPitch = deMath.deAlign32( + this.m_texFormat.getPixelSize() * this.m_subW, this.m_alignment + ); + data = new ArrayBuffer(rowPitch * this.m_subH); + access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + rowPitch: rowPitch, + data: data + }); + tcuTextureUtil.fillWithGrid(access, 4, [1, 0, 0, 1], [0, 1, 0, 1] + ); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + this.m_context.texSubImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + 0, this.m_subX, this.m_subY, this.m_subW, this.m_subH, + this.m_format, this.m_dataType, access.getDataPtr() + ); + } + }; + + // TexSubImage3D() unpack parameters case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture3DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} subX , + * @param {number} subY , + * @param {number} subZ , + * @param {number} subW , + * @param {number} subH , + * @param {number} subD , + * @param {number} imageHeight , + * @param {number} rowLength , + * @param {number} skipImages , + * @param {number} skipRows , + * @param {number} skipPixels , + * @param {number} alignment + */ + es3fTextureSpecificationTests.TexSubImage3DParamsCase = function( + name, desc, internalFormat, width, height, depth, + subX, subY, subZ, subW, subH, subD, + imageHeight, rowLength, skipImages, skipRows, skipPixels, alignment + ) { + es3fTextureSpecificationTests.Texture3DSpecCase.call( + this, name, desc, + gluTextureUtil.mapGLInternalFormat(internalFormat), + width, height, depth, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_subX = subX; + this.m_subY = subY; + this.m_subZ = subZ; + this.m_subW = subW; + this.m_subH = subH; + this.m_subD = subD; + this.m_imageHeight = imageHeight; + this.m_rowLength = rowLength; + this.m_skipImages = skipImages; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + }; + + es3fTextureSpecificationTests.TexSubImage3DParamsCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture3DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage3DParamsCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage3DParamsCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage3DParamsCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var tex = null; + var rowPitch = deMath.deAlign32(pixelSize * this.m_width, 4); + var slicePitch = rowPitch * this.m_height; + assertMsgOptions( + this.m_numLevels == 1, 'Numbel of levels different than 1', + false, true + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_3D, tex); + + // Fill with gradient. + + var data = new ArrayBuffer(slicePitch * this.m_depth); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data + }); + tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax); + + this.m_context.texImage3D( + gl.TEXTURE_3D, 0, this.m_internalFormat, this.m_width, + this.m_height, this.m_depth, 0, transferFmt.format, + transferFmt.dataType, access.getDataPtr() + ); + + // Fill data with grid. + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW; + rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment); + var imageHeight = this.m_imageHeight > 0 ? this.m_imageHeight : this.m_subH; + slicePitch = imageHeight * rowPitch; + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + data = new ArrayBuffer(slicePitch * (this.m_depth + this.m_skipImages) + + this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize); + var accessWithOffset = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + depth: this.m_subD, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: this.m_skipImages * slicePitch + this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + }); + access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + depth: this.m_subD, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data + }); + tcuTextureUtil.fillWithGrid(accessWithOffset, 4, colorA, colorB); + + this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight); + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + this.m_context.texSubImage3D( + gl.TEXTURE_3D, 0, this.m_subX, this.m_subY, this.m_subZ, + this.m_subW, this.m_subH, this.m_subD, + transferFmt.format, transferFmt.dataType, access.getDataPtr() + ); + }; + + // Basic CopyTexImage2D() with 2D texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.BasicCopyTexImage2DCase = function( + name, desc, internalFormat, width, height + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + internalFormat, gl.UNSIGNED_BYTE + ), width, height, es3fTextureSpecificationTests.maxLevelCount( + width, height + ) + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicCopyTexImage2DCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicCopyTexImage2DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicCopyTexImage2DCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicCopyTexImage2DCase.prototype.createTexture = function() { + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + var targetHasRGB = pixelFormat.redBits > 0 && + pixelFormat.greenBits > 0 && + pixelFormat.blueBits > 0; + var targetHasAlpha = pixelFormat.alphaBits > 0; + var fmt = es3fTextureSpecificationTests.mapGLUnsizedInternalFormat( + this.m_internalFormat + ); + var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A; + var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA || + fmt.order == tcuTexture.ChannelOrder.LA || + fmt.order == tcuTexture.ChannelOrder.A; + var tex = null; + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + /** @type {es3fFboTestUtil.GradientShader} */ + var shader = new es3fFboTestUtil.GradientShader( + gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderID = this.m_context.createProgram(shader); + + if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha)) + throw new Error( + 'Copying from current framebuffer is not supported' + ); + + // Fill render target with gradient. + shader.setGradient( + this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1] + ); + rrUtil.drawQuad( + this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var x = rnd.getInt(0, this.m_width - levelW); + var y = rnd.getInt(0, this.m_height - levelH); + + this.m_context.copyTexImage2D( + gl.TEXTURE_2D, ndx, this.m_internalFormat, x, y, + levelW, levelH, 0 + ); + } + }; + + // Basic CopyTexImage2D() with cubemap usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + */ + es3fTextureSpecificationTests.BasicCopyTexImageCubeCase = function( + name, desc, internalFormat, size + ) { + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + internalFormat, gl.UNSIGNED_BYTE + ), size, deMath.logToFloor(size) + 1 + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicCopyTexImageCubeCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicCopyTexImageCubeCase.prototype.constructor = + es3fTextureSpecificationTests.BasicCopyTexImageCubeCase; + + es3fTextureSpecificationTests. + BasicCopyTexImageCubeCase.prototype.createTexture = function() { + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + var targetHasRGB = pixelFormat.redBits > 0 && + pixelFormat.greenBits > 0 && + pixelFormat.blueBits > 0; + var targetHasAlpha = pixelFormat.alphaBits > 0; + var fmt = es3fTextureSpecificationTests.mapGLUnsizedInternalFormat( + this.m_internalFormat + ); + var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A; + var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA || + fmt.order == tcuTexture.ChannelOrder.LA || + fmt.order == tcuTexture.ChannelOrder.A; + var tex = null; + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + /** @type {es3fFboTestUtil.GradientShader} */ + var shader = new es3fFboTestUtil.GradientShader( + gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderID = this.m_context.createProgram(shader); + + if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha)) + throw new Error( + 'Copying from current framebuffer is not supported' + ); + + // Fill render target with gradient. + shader.setGradient( + this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1] + ); + rrUtil.drawQuad( + this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + var x = rnd.getInt(0, this.m_size - levelSize); + var y = rnd.getInt(0, this.m_size - levelSize); + + this.m_context.copyTexImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], ndx, + this.m_internalFormat, x, y, levelSize, levelSize, 0 + ); + } + } + }; + + // Basic CopyTexSubImage2D() with 2D texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} width + * @param {number} height + */ + es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase = function( + name, desc, format, dataType, width, height + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), width, height, es3fTextureSpecificationTests.maxLevelCount( + width, height + ) + ); + + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicCopyTexSubImage2DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicCopyTexSubImage2DCase.prototype.createTexture = function() { + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + var targetHasRGB = pixelFormat.redBits > 0 && + pixelFormat.greenBits > 0 && + pixelFormat.blueBits > 0; + var targetHasAlpha = pixelFormat.alphaBits > 0; + var fmt = gluTextureUtil.mapGLTransferFormat( + this.m_format, this.m_dataType + ); + var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A; + var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA || + fmt.order == tcuTexture.ChannelOrder.LA || + fmt.order == tcuTexture.ChannelOrder.A; + var tex = null; + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + /** @type {es3fFboTestUtil.GradientShader} */ + var shader = new es3fFboTestUtil.GradientShader( + gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderID = this.m_context.createProgram(shader); + + if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha)) + throw new Error( + 'Copying from current framebuffer is not supported' + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + // First specify full texture. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + + var colorA = es3fTextureSpecificationTests.randomVector( + rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4 + ); + var colorB = es3fTextureSpecificationTests.randomVector( + rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4 + ); + var cellSize = rnd.getInt(2, 16); + + var data = new tcuTexture.TextureLevel(fmt, levelW, levelH); + tcuTextureUtil.fillWithGrid( + data.getAccess(), cellSize, colorA, colorB + ); + + this.m_context.texImage2D( + gl.TEXTURE_2D, ndx, this.m_format, levelW, levelH, 0, this.m_format, this.m_dataType, data.getAccess().getDataPtr() + ); + } + + // Fill render target with gradient. + shader.setGradient( + this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1] + ); + rrUtil.drawQuad( + this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + // Re-specify parts of each level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + + var w = rnd.getInt(1, levelW); + var h = rnd.getInt(1, levelH); + var xo = rnd.getInt(0, levelW - w); + var yo = rnd.getInt(0, levelH - h); + + var x = rnd.getInt(0, this.m_width - w); + var y = rnd.getInt(0, this.m_height - h); + + this.m_context.copyTexSubImage2D( + gl.TEXTURE_2D, ndx, xo, yo, x, y, w, h + ); + } + }; + + // Basic CopyTexSubImage2D() with cubemap usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} format + * @param {number} dataType + * @param {number} size + */ + es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase = function( + name, desc, format, dataType, size + ) { + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLTransferFormat( + format, dataType + ), size, deMath.logToFloor(size) + 1 + ); + + this.m_format = format; + this.m_dataType = dataType; + }; + + es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicCopyTexSubImageCubeCase.prototype.constructor = + es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase; + + es3fTextureSpecificationTests. + BasicCopyTexSubImageCubeCase.prototype.createTexture = function() { + var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl); + var targetHasRGB = pixelFormat.redBits > 0 && + pixelFormat.greenBits > 0 && + pixelFormat.blueBits > 0; + var targetHasAlpha = pixelFormat.alphaBits > 0; + var fmt = gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType); + var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A; + var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA || + fmt.order == tcuTexture.ChannelOrder.LA || + fmt.order == tcuTexture.ChannelOrder.A; + var tex = null; + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + /** @type {es3fFboTestUtil.GradientShader} */ + var shader = new es3fFboTestUtil.GradientShader( + gluShaderUtil.DataType.FLOAT_VEC4 + ); + var shaderID = this.m_context.createProgram(shader); + + if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha)) + throw new Error( + 'Copying from current framebuffer is not supported' + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + var data = new tcuTexture.TextureLevel(fmt); + + // First specify full texture. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + data.setSize(levelSize, levelSize); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + var colorA = es3fTextureSpecificationTests.randomVector( + rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4 + ); + var colorB = es3fTextureSpecificationTests.randomVector( + rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4 + ); + var cellSize = rnd.getInt(2, 16); + + tcuTextureUtil.fillWithGrid( + data.getAccess(), cellSize, colorA, colorB + ); + + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + ndx, this.m_format, levelSize, levelSize, 0, this.m_format, + this.m_dataType, data.getAccess().getDataPtr() + ); + } + } + + // Fill render target with gradient. + shader.setGradient( + this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1] + ); + rrUtil.drawQuad( + this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0] + ); + + // Re-specify parts of each face and level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + for (var f in es3fTextureSpecificationTests.s_cubeMapFaces) { + var w = rnd.getInt(1, levelSize); + var h = rnd.getInt(1, levelSize); + var xo = rnd.getInt(0, levelSize - w); + var yo = rnd.getInt(0, levelSize - h); + + var x = rnd.getInt(0, this.m_size - w); + var y = rnd.getInt(0, this.m_size - h); + + this.m_context.copyTexSubImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[f], + ndx, xo, yo, x, y, w, h + ); + } + } + }; + + // Basic glTexStorage2D() with 2D texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} numLevels + */ + es3fTextureSpecificationTests.BasicTexStorage2DCase = function( + name, desc, internalFormat, width, height, numLevels + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, numLevels + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicTexStorage2DCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests.BasicTexStorage2DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexStorage2DCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicTexStorage2DCase.prototype.createTexture = function() { + var fmt = gluTextureUtil.mapGLInternalFormat(this.m_internalFormat); + var transferFmt = gluTextureUtil.getTransferFormat(fmt); + var tex = null; + var levelData = new tcuTexture.TextureLevel( + fmt, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.texStorage2D( + gl.TEXTURE_2D, this.m_numLevels, this.m_internalFormat, + this.m_width, this.m_height + ); + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelW, levelH); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texSubImage2D( + gl.TEXTURE_2D, ndx, 0, 0, levelW, levelH, + transferFmt.format, transferFmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // Basic glTexStorage2D() with cubemap usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @param {number} numLevels + */ + es3fTextureSpecificationTests.BasicTexStorageCubeCase = function( + name, desc, internalFormat, size, numLevels + ) { + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), size, numLevels + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicTexStorageCubeCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests.BasicTexStorageCubeCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexStorageCubeCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests.BasicTexStorageCubeCase.prototype.createTexture = function() { + var fmt = gluTextureUtil.mapGLInternalFormat(this.m_internalFormat); + var transferFmt = gluTextureUtil.getTransferFormat(fmt); + var tex = null; + var levelData = new tcuTexture.TextureLevel( + fmt, this.m_size, this.m_size + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.texStorage2D( + gl.TEXTURE_CUBE_MAP, this.m_numLevels, this.m_internalFormat, + this.m_size, this.m_size + ); + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelSize = Math.max(1, this.m_size >> ndx); + + levelData.setSize(levelSize, levelSize); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texSubImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], + ndx, 0, 0, levelSize, levelSize, + transferFmt.format, transferFmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + } + }; + + // Basic glTexStorage3D() with 2D array texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} numLayers + * @param {number} numLevels + */ + es3fTextureSpecificationTests.BasicTexStorage2DArrayCase = function( + name, desc, internalFormat, width, height, numLayers, numLevels + ) { + es3fTextureSpecificationTests.Texture2DArraySpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, numLayers, numLevels + ); + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicTexStorage2DArrayCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicTexStorage2DArrayCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexStorage2DArrayCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests.BasicTexStorage2DArrayCase.prototype.createTexture = function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + this.m_context.texStorage3D( + gl.TEXTURE_2D_ARRAY, this.m_numLevels, this.m_internalFormat, + this.m_width, this.m_height, this.m_numLayers + ); + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelW, levelH, this.m_numLayers); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texSubImage3D( + gl.TEXTURE_2D_ARRAY, ndx, 0, 0, 0, levelW, levelH, + this.m_numLayers, transferFmt.format, transferFmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // Basic TexStorage3D() with 3D texture usage + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture3DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} numLevels + */ + es3fTextureSpecificationTests.BasicTexStorage3DCase = function( + name, desc, internalFormat, width, height, depth, numLevels + ) { + es3fTextureSpecificationTests.Texture3DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, depth, numLevels + ); + + this.m_internalFormat = internalFormat; + }; + + es3fTextureSpecificationTests.BasicTexStorage3DCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture3DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + BasicTexStorage3DCase.prototype.constructor = + es3fTextureSpecificationTests.BasicTexStorage3DCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + BasicTexStorage3DCase.prototype.createTexture = function() { + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_3D, tex); + this.m_context.texStorage3D( + gl.TEXTURE_3D, this.m_numLevels, this.m_internalFormat, + this.m_width, this.m_height, this.m_depth + ); + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var levelD = Math.max(1, this.m_depth >> ndx); + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + levelData.setSize(levelW, levelH, levelD); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texSubImage3D( + gl.TEXTURE_3D, ndx, 0, 0, 0, levelW, levelH, + levelD, transferFmt.format, transferFmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // Pixel buffer object cases. + + // TexImage2D() from pixel buffer object. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} rowLength + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexImage2DBufferCase = function( + name, desc, internalFormat, width, height, rowLength, + skipRows, skipPixels, alignment, offset + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_rowLength = rowLength; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexImage2DBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage2DBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests.TexImage2DBufferCase.prototype.createTexture = + function() { + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_rowLength > 0 ? + this.m_rowLength : + this.m_width + this.m_skipPixels; + var rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var height = this.m_height + this.m_skipRows; + var buf = null; + var tex = null; + var data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize + this.m_offset); + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels different than 1', + false, true + ); + + // Fill data with grid. + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + rowPitch: rowPitch, + data: data, + offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + this.m_offset + }); + tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB); + + // Create buffer and upload. + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW + ); + + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.texImage2D(gl.TEXTURE_2D, 0, this.m_internalFormat, + this.m_width, this.m_height, 0, transferFmt.format, transferFmt.dataType, + this.m_offset + ); + }; + + // TexImage2D() cubemap from pixel buffer object case + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @param {number} rowLength + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexImageCubeBufferCase = function( + name, desc, internalFormat, size, rowLength, skipRows, skipPixels, + alignment, offset + ) { + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), size, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_rowLength = rowLength; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexImageCubeBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImageCubeBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexImageCubeBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexImageCubeBufferCase.prototype.createTexture = function() { + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var tex = null; + var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_rowLength > 0 ? + this.m_rowLength : this.m_size + this.m_skipPixels; + var rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var height = this.m_size + this.m_skipRows; + + var data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize + this.m_offset); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_size, + height: this.m_size, + rowPitch: rowPitch, + data: data, + offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + this.m_offset + }); + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + var buf = null; + + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax); + + // Create buffer and upload. + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW); + + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], 0, + this.m_internalFormat, this.m_size, this.m_size, 0, fmt.format, + fmt.dataType, this.m_offset); + } + }; + + // TexImage3D() 2D array from pixel buffer object. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} imageHeight + * @param {number} rowLength + * @param {number} skipImages + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexImage2DArrayBufferCase = function( + name, desc, internalFormat, width, height, depth, imageHeight, + rowLength, skipImages, skipRows, skipPixels, alignment, offset + ) { + es3fTextureSpecificationTests.Texture2DArraySpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, depth, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_imageHeight = imageHeight; + this.m_rowLength = rowLength; + this.m_skipImages = skipImages; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexImage2DArrayBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage2DArrayBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DArrayBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexImage2DArrayBufferCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width; + var rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var imageHeight = this.m_imageHeight > 0 ? + this.m_imageHeight : this.m_height; + var slicePitch = imageHeight * rowPitch; + var tex = null; + var buf = null; + var data = new ArrayBuffer( + slicePitch * (this.m_numLayers + this.m_skipImages) + + this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + this.m_offset + ); + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + // Fill data with grid. + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_numLayers, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: this.m_skipImages * slicePitch + + this.m_skipRows * rowPitch + + this.m_skipPixels * pixelSize + + this.m_offset + }); + tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB); + + // Create buffer and upload. + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW); + + this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight); + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + this.m_context.texImage3D( + gl.TEXTURE_2D_ARRAY, 0, this.m_internalFormat, this.m_width, + this.m_height, this.m_numLayers, 0, transferFmt.format, + transferFmt.dataType, this.m_offset + ); + }; + + // TexImage3D() from pixel buffer object. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture3DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} imageHeight + * @param {number} rowLength + * @param {number} skipImages + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexImage3DBufferCase = function( + name, desc, internalFormat, width, height, depth, imageHeight, + rowLength, skipImages, skipRows, skipPixels, alignment, offset + ) { + es3fTextureSpecificationTests.Texture3DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, depth, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_imageHeight = imageHeight; + this.m_rowLength = rowLength; + this.m_skipImages = skipImages; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexImage3DBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture3DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage3DBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage3DBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexImage3DBufferCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width; + var rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var imageHeight = this.m_imageHeight > 0 ? + this.m_imageHeight : this.m_height; + var slicePitch = imageHeight * rowPitch; + var tex = null; + var buf = null; + var data = new ArrayBuffer( + slicePitch * (this.m_depth + this.m_skipImages) + + rowPitch * this.m_skipRows + pixelSize * this.m_skipPixels + this.m_offset + ); + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + // Fill data with grid. + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: this.m_skipImages * slicePitch + + this.m_skipRows * rowPitch + + this.m_skipPixels * pixelSize + + this.m_offset + }); + tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB); + + // Create buffer and upload. + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW); + + this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight); + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_3D, tex); + this.m_context.texImage3D( + gl.TEXTURE_3D, 0, this.m_internalFormat, this.m_width, + this.m_height, this.m_depth, 0, transferFmt.format, + transferFmt.dataType, this.m_offset + ); + }; + + // TexSubImage2D() PBO case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} subX + * @param {number} subY + * @param {number} subW + * @param {number} subH + * @param {number} rowLength + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexSubImage2DBufferCase = function( + name, desc, internalFormat, width, height, subX, subY, subW, subH, + rowLength, skipRows, skipPixels, alignment, offset + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, 1 + ); + this.m_internalFormat = internalFormat; + this.m_subX = subX; + this.m_subY = subY; + this.m_subW = subW; + this.m_subH = subH; + this.m_rowLength = rowLength; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexSubImage2DBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage2DBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage2DBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage2DBufferCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + var pixelSize = this.m_texFormat.getPixelSize(); + var tex = null; + var buf = null; + var data = new ArrayBuffer( + deMath.deAlign32(this.m_width * pixelSize, 4) * this.m_height + ); + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + rowPitch: deMath.deAlign32(this.m_width * pixelSize, 4), + data: data + }); + // First fill texture with gradient. + tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax); + this.m_context.texImage2D( + gl.TEXTURE_2D, 0, this.m_internalFormat, + this.m_width, this.m_height, 0, transferFmt.format, + transferFmt.dataType, access.getDataPtr() + ); + + // Fill data with grid. + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW; + var rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var height = this.m_subH + this.m_skipRows; + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + rowPitch: rowPitch, + data: new ArrayBuffer(rowPitch * height + this.m_offset), + offset: this.m_skipRows * rowPitch + + this.m_skipPixels * pixelSize + + this.m_offset + }); + tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB); + + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, access.getBuffer(), gl.STATIC_DRAW); + + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + this.m_context.texSubImage2D( + gl.TEXTURE_2D, 0, this.m_subX, this.m_subY, + this.m_subW, this.m_subH, transferFmt.format, + transferFmt.dataType, this.m_offset + ); + }; + + // TexSubImage2D() cubemap PBO case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} size + * @param {number} subX + * @param {number} subY + * @param {number} subW + * @param {number} subH + * @param {number} rowLength + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexSubImageCubeBufferCase = function( + name, desc, internalFormat, size, subX, subY, subW, subH, rowLength, + skipRows, skipPixels, alignment, offset + ) { + es3fTextureSpecificationTests.TextureCubeSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), size, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_subX = subX; + this.m_subY = subY; + this.m_subW = subW; + this.m_subH = subH; + this.m_rowLength = rowLength; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexSubImageCubeBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.TextureCubeSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImageCubeBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImageCubeBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImageCubeBufferCase.prototype.createTexture = function() { + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + var pixelSize = this.m_texFormat.getPixelSize(); + var tex = null; + var buf = null; + var data = new ArrayBuffer( + deMath.deAlign32(this.m_size * pixelSize, 4) * this.m_size + ); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_size, + height: this.m_size, + rowPitch: deMath.deAlign32(this.m_size * pixelSize, 4), + data: data + }); + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex); + + // Fill faces with different gradients. + + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + var gMin = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + var gMax = es3fTextureSpecificationTests.randomVector( + rnd, this.m_texFormatInfo.valueMin, + this.m_texFormatInfo.valueMax, 4 + ); + + tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax); + + this.m_context.texImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], 0, + this.m_internalFormat, this.m_size, this.m_size, 0, + transferFmt.format, transferFmt.dataType, + access.getDataPtr() + ); + } + + // Fill data with grid. + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW; + var rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var height = this.m_subH + this.m_skipRows; + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize + this.m_offset); + var accessSub = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + rowPitch: rowPitch, + data: data, + offset: this.m_skipRows * rowPitch + + this.m_skipPixels * pixelSize + + this.m_offset + }); + tcuTextureUtil.fillWithGrid(accessSub, 4, colorA, colorB); + + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData( + gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW + ); + + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + + for (var f in tcuTexture.CubeFace) { + var face = tcuTexture.CubeFace[f]; + this.m_context.texSubImage2D( + es3fTextureSpecificationTests.s_cubeMapFaces[face], 0, + this.m_subX, this.m_subY, this.m_subW, this.m_subH, + transferFmt.format, transferFmt.dataType, this.m_offset + ); + } + }; + + // TexSubImage3D() 2D array PBO case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} subX + * @param {number} subY + * @param {number} subZ + * @param {number} subW + * @param {number} subH + * @param {number} subD + * @param {number} imageHeight + * @param {number} rowLength + * @param {number} skipImages + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase = function( + name, desc, internalFormat, width, height, depth, subX, subY, subZ, + subW, subH, subD, imageHeight, rowLength, skipImages, skipRows, + skipPixels, alignment, offset + ) { + es3fTextureSpecificationTests.Texture2DArraySpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, depth, 1 + ); + this.m_internalFormat = internalFormat; + this.m_subX = subX; + this.m_subY = subY; + this.m_subZ = subZ; + this.m_subW = subW; + this.m_subH = subH; + this.m_subD = subD; + this.m_imageHeight = imageHeight; + this.m_rowLength = rowLength; + this.m_skipImages = skipImages; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage2DArrayBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage2DArrayBufferCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + var pixelSize = this.m_texFormat.getPixelSize(); + var tex = null; + var buf = null; + /** @type {ArrayBuffer} */ var data; + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + + // Fill with gradient. + var rowPitch = deMath.deAlign32(pixelSize * this.m_width, 4); + var slicePitch = rowPitch * this.m_height; + + data = new ArrayBuffer(slicePitch * this.m_numLayers); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_numLayers, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data + }); + tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax + ); + + this.m_context.texImage3D(gl.TEXTURE_2D_ARRAY, 0, this.m_internalFormat, this.m_width, this.m_height, + this.m_numLayers, 0, transferFmt.format, transferFmt.dataType, access.getDataPtr()); + + // Fill data with grid. + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW; + rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var height = this.m_subH + this.m_skipRows; + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + var accessSub = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + rowPitch: rowPitch, + data: new ArrayBuffer(rowPitch * height + this.m_offset), + offset: this.m_skipRows * rowPitch + + this.m_skipPixels * pixelSize + + this.m_offset + }); + tcuTextureUtil.fillWithGrid(accessSub, 4, colorA, colorB); + + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData( + gl.PIXEL_UNPACK_BUFFER, accessSub.getBuffer(), gl.STATIC_DRAW + ); + + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + }; + + // TexSubImage3D() PBO case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture3DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} subX + * @param {number} subY + * @param {number} subZ + * @param {number} subW + * @param {number} subH + * @param {number} subD + * @param {number} imageHeight + * @param {number} rowLength + * @param {number} skipImages + * @param {number} skipRows + * @param {number} skipPixels + * @param {number} alignment + * @param {number} offset + */ + es3fTextureSpecificationTests.TexSubImage3DBufferCase = function( + name, desc, internalFormat, width, height, depth, subX, subY, subZ, + subW, subH, subD, imageHeight, rowLength, skipImages, skipRows, + skipPixels, alignment, offset + ) { + es3fTextureSpecificationTests.Texture3DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), width, height, depth, 1 + ); + + this.m_internalFormat = internalFormat; + this.m_subX = subX; + this.m_subY = subY; + this.m_subZ = subZ; + this.m_subW = subW; + this.m_subH = subH; + this.m_subD = subD; + this.m_imageHeight = imageHeight; + this.m_rowLength = rowLength; + this.m_skipImages = skipImages; + this.m_skipRows = skipRows; + this.m_skipPixels = skipPixels; + this.m_alignment = alignment; + this.m_offset = offset; + }; + + es3fTextureSpecificationTests.TexSubImage3DBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture3DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage3DBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage3DBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage3DBufferCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat( + this.m_texFormat + ); + var pixelSize = this.m_texFormat.getPixelSize(); + var tex = null; + var buf = null; + /** @type {ArrayBuffer} */ var data; + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_3D, tex); + + // Fill with gradient. + var rowPitch = deMath.deAlign32(pixelSize * this.m_width, 4); + var slicePitch = rowPitch * this.m_height; + + data = new ArrayBuffer(slicePitch * this.m_depth); + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_depth, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data}); + tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax + ); + + this.m_context.texImage3D( + gl.TEXTURE_3D, 0, this.m_internalFormat, this.m_width, + this.m_height, this.m_depth, 0, transferFmt.format, + transferFmt.dataType, access.getDataPtr() + ); + + // Fill data with grid. + var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW; + rowPitch = deMath.deAlign32( + rowLength * pixelSize, this.m_alignment + ); + var imageHeight = this.m_imageHeight > 0 ? + this.m_imageHeight : this.m_subH; + slicePitch = imageHeight * rowPitch; + var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin); + var cBias = this.m_texFormatInfo.valueMin; + var colorA = deMath.add( + deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias + ); + var colorB = deMath.add( + deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias + ); + + data = new ArrayBuffer(slicePitch * (this.m_subD + this.m_skipImages) + + rowPitch * this.m_skipRows + pixelSize * this.m_skipPixels + this.m_offset); + var accessSub = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_subW, + height: this.m_subH, + depth: this.m_subD, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data, + offset: this.m_skipImages * slicePitch + + this.m_skipRows * rowPitch + + this.m_skipPixels * pixelSize + + this.m_offset + }); + tcuTextureUtil.fillWithGrid(accessSub, 4, colorA, colorB + ); + + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData( + gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW + ); + + this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight); + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment); + this.m_context.texSubImage3D( + gl.TEXTURE_3D, 0, this.m_subX, this.m_subY, this.m_subZ, + this.m_subW, this.m_subH, this.m_subD, transferFmt.format, + transferFmt.dataType, this.m_offset + ); + }; + + // TexImage2D() depth case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} imageWidth + * @param {number} imageHeight + */ + es3fTextureSpecificationTests.TexImage2DDepthCase = function( + name, desc, internalFormat, imageWidth, imageHeight + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), imageWidth, imageHeight, + es3fTextureSpecificationTests.maxLevelCount( + imageWidth, imageHeight + ) + ); + + this.m_internalFormat = internalFormat; + // we are interested in the behavior near [-2, 2], map it to visible range [0, 1] + this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0]; + this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0]; + }; + + es3fTextureSpecificationTests.TexImage2DDepthCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage2DDepthCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DDepthCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests.TexImage2DDepthCase.prototype.createTexture = + function() { + var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = [-1.5, -2.0, 1.7, -1.5]; + var gMax = [2.0, 1.5, -1.0, 2.0]; + + levelData.setSize(levelW, levelH); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0, + fmt.format, fmt.dataType, levelData.getAccess().getDataPtr() + ); + } + }; + + // TexImage3D() depth case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} imageWidth + * @param {number} imageHeight + * @param {number} numLayers + */ + es3fTextureSpecificationTests.TexImage2DArrayDepthCase = function( + name, desc, internalFormat, imageWidth, imageHeight, numLayers + ) { + es3fTextureSpecificationTests.Texture2DArraySpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), imageWidth, imageHeight, numLayers, + es3fTextureSpecificationTests.maxLevelCount( + imageWidth, imageHeight + ) + ); + + this.m_internalFormat = internalFormat; + // we are interested in the behavior near [-2, 2], map it to visible range [0, 1] + this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0]; + this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0]; + }; + + es3fTextureSpecificationTests.TexImage2DArrayDepthCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage2DArrayDepthCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DArrayDepthCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexImage2DArrayDepthCase.prototype.createTexture = function() { + var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = [-1.5, -2.0, 1.7, -1.5]; + var gMax = [2.0, 1.5, -1.0, 2.0]; + + levelData.setSize(levelW, levelH, this.m_numLayers); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage3D( + gl.TEXTURE_2D_ARRAY, ndx, this.m_internalFormat, levelW, levelH, + this.m_numLayers, 0, fmt.format, fmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // TexSubImage2D() depth case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} imageWidth + * @param {number} imageHeight + */ + es3fTextureSpecificationTests.TexSubImage2DDepthCase = function( + name, desc, internalFormat, imageWidth, imageHeight + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), imageWidth, imageHeight, + es3fTextureSpecificationTests.maxLevelCount( + imageWidth, imageHeight + ) + ); + + this.m_internalFormat = internalFormat; + // we are interested in the behavior near [-2, 2], map it to visible range [0, 1] + this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0]; + this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0]; + }; + + es3fTextureSpecificationTests.TexSubImage2DDepthCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage2DDepthCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage2DDepthCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage2DDepthCase.prototype.createTexture = function() { + var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + // First specify full texture. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = [-1.5, -2.0, 1.7, -1.5]; + var gMax = [2.0, 1.5, -1.0, 2.0]; + + levelData.setSize(levelW, levelH); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + + this.m_context.texImage2D( + gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0, + fmt.format, fmt.dataType, levelData.getAccess().getDataPtr() + ); + } + + // Re-specify parts of each level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + + var w = rnd.getInt(1, levelW); + var h = rnd.getInt(1, levelH); + var x = rnd.getInt(0, levelW - w); + var y = rnd.getInt(0, levelH - h); + + var colorA = [2.0, 1.5, -1.0, 2.0]; + var colorB = [-1.5, -2.0, 1.7, -1.5]; + var cellSize = rnd.getInt(2, 16); + + levelData.setSize(w, h); + tcuTextureUtil.fillWithGrid( + levelData.getAccess(), cellSize, colorA, colorB + ); + + this.m_context.texSubImage2D( + gl.TEXTURE_2D, ndx, x, y, w, h, fmt.format, fmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + }; + + // TexSubImage3D() depth case. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} imageWidth + * @param {number} imageHeight + * @param {number} numLayers + */ + es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase = function( + name, desc, internalFormat, imageWidth, imageHeight, numLayers + ) { + es3fTextureSpecificationTests.Texture2DArraySpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), imageWidth, imageHeight, numLayers, + es3fTextureSpecificationTests.maxLevelCount( + imageWidth, imageHeight + ) + ); + + this.m_internalFormat = internalFormat; + // we are interested in the behavior near [-2, 2], map it to visible range [0, 1] + this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0]; + this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0]; + }; + + es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexSubImage2DArrayDepthCase.prototype.constructor = + es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexSubImage2DArrayDepthCase.prototype.createTexture = function() { + var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var rnd = new deRandom.Random(deString.deStringHash(this.fullName())); + var tex = null; + var levelData = new tcuTexture.TextureLevel( + this.m_texFormat, this.m_width, this.m_height + ); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + + // First specify full texture. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + var gMin = [-1.5, -2.0, 1.7, -1.5]; + var gMax = [2.0, 1.5, -1.0, 2.0]; + + levelData.setSize(levelW, levelH, this.m_numLayers); + tcuTextureUtil.fillWithComponentGradients( + levelData.getAccess(), gMin, gMax + ); + this.m_context.texImage3D( + gl.TEXTURE_2D_ARRAY, ndx, this.m_internalFormat, levelW, levelH, + this.m_numLayers, 0, fmt.format, fmt.dataType, + levelData.getAccess().getDataPtr() + ); + } + + // Re-specify parts of each level. + for (var ndx = 0; ndx < this.m_numLevels; ndx++) { + var levelW = Math.max(1, this.m_width >> ndx); + var levelH = Math.max(1, this.m_height >> ndx); + + var w = rnd.getInt(1, levelW); + var h = rnd.getInt(1, levelH); + var d = rnd.getInt(1, this.m_numLayers); + var x = rnd.getInt(0, levelW - w); + var y = rnd.getInt(0, levelH - h); + var z = rnd.getInt(0, this.m_numLayers - d); + + var colorA = [2.0, 1.5, -1.0, 2.0]; + var colorB = [-1.5, -2.0, 1.7, -1.5]; + var cellSize = rnd.getInt(2, 16); + + levelData.setSize(w, h, d); + tcuTextureUtil.fillWithGrid( + levelData.getAccess(), cellSize, colorA, colorB + ); + + this.m_context.texSubImage3D( + gl.TEXTURE_2D_ARRAY, ndx, x, y, z, w, h, d, fmt.format, + fmt.dataType, levelData.getAccess().getDataPtr() + ); + } + }; + + // TexImage2D() depth case with pbo. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DSpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} imageWidth + * @param {number} imageHeight + */ + es3fTextureSpecificationTests.TexImage2DDepthBufferCase = function( + name, desc, internalFormat, imageWidth, imageHeight + ) { + es3fTextureSpecificationTests.Texture2DSpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), imageWidth, imageHeight, 1 + ); + + this.m_internalFormat = internalFormat; + // we are interested in the behavior near [-2, 2], map it to visible range [0, 1] + this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0]; + this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0]; + }; + + es3fTextureSpecificationTests.TexImage2DDepthBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DSpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage2DDepthBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DDepthBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexImage2DDepthBufferCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_width; + var alignment = 4; + var rowPitch = deMath.deAlign32(rowLength * pixelSize, alignment); + var height = this.m_height; + var buf = null; + var tex = null; + var data = new ArrayBuffer(rowPitch * height); + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + // Fill data with gradient + var gMin = [-1.5, -2.0, 1.7, -1.5]; + var gMax = [2.0, 1.5, -1.0, 2.0]; + + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + rowPitch: rowPitch, + data: data + }); + tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax); + + // Create buffer and upload. + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData( + gl.PIXEL_UNPACK_BUFFER, access.getBuffer(), gl.STATIC_DRAW + ); + + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, alignment); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D, tex); + this.m_context.texImage2D( + gl.TEXTURE_2D, 0, this.m_internalFormat, this.m_width, + this.m_height, 0, transferFmt.format, transferFmt.dataType, 0 + ); + this.m_context.deleteBuffer(buf); + }; + + // TexImage3D() depth case with pbo. + /** + * @constructor + * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase} + * @param {string} name + * @param {string} desc + * @param {number} internalFormat + * @param {number} imageWidth + * @param {number} imageHeight + */ + es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase = function( + name, desc, internalFormat, imageWidth, imageHeight, numLayers + ) { + es3fTextureSpecificationTests.Texture2DArraySpecCase.call( + this, name, desc, gluTextureUtil.mapGLInternalFormat( + internalFormat + ), imageWidth, imageHeight, numLayers, 1 + ); + + this.m_internalFormat = internalFormat; + // we are interested in the behavior near [-2, 2], map it to visible range [0, 1] + this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0]; + this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0]; + }; + + es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase.prototype = + Object.create( + es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype + ); + + es3fTextureSpecificationTests. + TexImage2DArrayDepthBufferCase.prototype.constructor = + es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase; + + /** + * createTexture + */ + es3fTextureSpecificationTests. + TexImage2DArrayDepthBufferCase.prototype.createTexture = function() { + var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat); + var pixelSize = this.m_texFormat.getPixelSize(); + var rowLength = this.m_width; + var alignment = 4; + var rowPitch = deMath.deAlign32(rowLength * pixelSize, alignment); + var imageHeight = this.m_height; + var slicePitch = imageHeight * rowPitch; + var tex = null; + var buf = null; + var data = new ArrayBuffer(slicePitch * this.m_numLayers); + + assertMsgOptions( + this.m_numLevels == 1, 'Number of levels is different than 1', + false, true + ); + + // Fill data with gradient + var gMin = [-1.5, -2.0, 1.7, -1.5]; + var gMax = [2.0, 1.5, -1.0, 2.0]; + + var access = new tcuTexture.PixelBufferAccess({ + format: this.m_texFormat, + width: this.m_width, + height: this.m_height, + depth: this.m_numLayers, + rowPitch: rowPitch, + slicePitch: slicePitch, + data: data + }); + tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax); + + buf = this.m_context.createBuffer(); + this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf); + this.m_context.bufferData( + gl.PIXEL_UNPACK_BUFFER, access.getBuffer(), gl.STATIC_DRAW + ); + + this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, rowLength); + this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, rowLength); + this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0); + this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, alignment); + + tex = this.m_context.createTexture(); + this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex); + this.m_context.texImage3D( + gl.TEXTURE_2D_ARRAY, 0, this.m_internalFormat, this.m_width, + this.m_height, this.m_numLayers, 0, transferFmt.format, + transferFmt.dataType, 0 + ); + this.m_context.deleteBuffer(buf); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fTextureSpecificationTests.TextureSpecificationTests = function() { + tcuTestCase.DeqpTest.call( + this, 'specification', 'Texture Specification Tests' + ); + }; + + es3fTextureSpecificationTests.TextureSpecificationTests.prototype = + Object.create(tcuTestCase.DeqpTest.prototype); + es3fTextureSpecificationTests.TextureSpecificationTests.prototype.constructor = + es3fTextureSpecificationTests.TextureSpecificationTests; + + es3fTextureSpecificationTests.TextureSpecificationTests.prototype.init = function() { + /** + * @type {Array} + */ + es3fTextureSpecificationTests.s_cubeMapFaces = [ + gl.TEXTURE_CUBE_MAP_NEGATIVE_X, + gl.TEXTURE_CUBE_MAP_POSITIVE_X, + gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, + gl.TEXTURE_CUBE_MAP_POSITIVE_Y, + gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, + gl.TEXTURE_CUBE_MAP_POSITIVE_Z + ]; + + /** @type {Array<{name: string, format: number, dataType: number}>} */ + var unsizedFormats = [{ + name: 'alpha_unsigned_byte', + format: gl.ALPHA, + dataType: gl.UNSIGNED_BYTE + }, { + name: 'luminance_unsigned_byte', + format: gl.LUMINANCE, + dataType: gl.UNSIGNED_BYTE + }, { + name: 'luminance_alpha_unsigned_byte', + format: gl.LUMINANCE_ALPHA, + dataType: gl.UNSIGNED_BYTE + }, { + name: 'rgb_unsigned_short_5_6_5', + format: gl.RGB, + dataType: gl.UNSIGNED_SHORT_5_6_5 + }, { + name: 'rgb_unsigned_byte', + format: gl.RGB, + dataType: gl.UNSIGNED_BYTE + }, { + name: 'rgba_unsigned_short_4_4_4_4', + format: gl.RGBA, + dataType: gl.UNSIGNED_SHORT_4_4_4_4 + }, { + name: 'rgba_unsigned_short_5_5_5_1', + format: gl.RGBA, + dataType: gl.UNSIGNED_SHORT_5_5_5_1 + }, { + name: 'rgba_unsigned_byte', + format: gl.RGBA, + dataType: gl.UNSIGNED_BYTE + } + ]; + + /** @type {Array<{name: string, internalFormat: number}>} */ + var colorFormats = [{ + name: 'rgba32f', internalFormat: gl.RGBA32F + }, { + name: 'rgba32i', internalFormat: gl.RGBA32I + }, { + name: 'rgba32ui', internalFormat: gl.RGBA32UI + }, { + name: 'rgba16f', internalFormat: gl.RGBA16F + }, { + name: 'rgba16i', internalFormat: gl.RGBA16I + }, { + name: 'rgba16ui', internalFormat: gl.RGBA16UI + }, { + name: 'rgba8', internalFormat: gl.RGBA8 + }, { + name: 'rgba8i', internalFormat: gl.RGBA8I + }, { + name: 'rgba8ui', internalFormat: gl.RGBA8UI + }, { + name: 'srgb8_alpha8', internalFormat: gl.SRGB8_ALPHA8 + }, { + name: 'rgb10_a2', internalFormat: gl.RGB10_A2 + }, { + name: 'rgb10_a2ui', internalFormat: gl.RGB10_A2UI + }, { + name: 'rgba4', internalFormat: gl.RGBA4 + }, { + name: 'rgb5_a1', internalFormat: gl.RGB5_A1 + }, { + name: 'rgba8_snorm', internalFormat: gl.RGBA8_SNORM + }, { + name: 'rgb8', internalFormat: gl.RGB8 + }, { + name: 'rgb565', internalFormat: gl.RGB565 + }, { + name: 'r11f_g11f_b10f', internalFormat: gl.R11F_G11F_B10F + }, { + name: 'rgb32f', internalFormat: gl.RGB32F + }, { + name: 'rgb32i', internalFormat: gl.RGB32I + }, { + name: 'rgb32ui', internalFormat: gl.RGB32UI + }, { + name: 'rgb16f', internalFormat: gl.RGB16F + }, { + name: 'rgb16i', internalFormat: gl.RGB16I + }, { + name: 'rgb16ui', internalFormat: gl.RGB16UI + }, { + name: 'rgb8_snorm', internalFormat: gl.RGB8_SNORM + }, { + name: 'rgb8i', internalFormat: gl.RGB8I + }, { + name: 'rgb8ui', internalFormat: gl.RGB8UI + }, { + name: 'srgb8', internalFormat: gl.SRGB8 + }, { + name: 'rgb9_e5', internalFormat: gl.RGB9_E5 + }, { + name: 'rg32f', internalFormat: gl.RG32F + }, { + name: 'rg32i', internalFormat: gl.RG32I + }, { + name: 'rg32ui', internalFormat: gl.RG32UI + }, { + name: 'rg16f', internalFormat: gl.RG16F + }, { + name: 'rg16i', internalFormat: gl.RG16I + }, { + name: 'rg16ui', internalFormat: gl.RG16UI + }, { + name: 'rg8', internalFormat: gl.RG8 + }, { + name: 'rg8i', internalFormat: gl.RG8I + }, { + name: 'rg8ui', internalFormat: gl.RG8UI + }, { + name: 'rg8_snorm', internalFormat: gl.RG8_SNORM + }, { + name: 'r32f', internalFormat: gl.R32F + }, { + name: 'r32i', internalFormat: gl.R32I + }, { + name: 'r32ui', internalFormat: gl.R32UI + }, { + name: 'r16f', internalFormat: gl.R16F + }, { + name: 'r16i', internalFormat: gl.R16I + }, { + name: 'r16ui', internalFormat: gl.R16UI + }, { + name: 'r8', internalFormat: gl.R8 + }, { + name: 'r8i', internalFormat: gl.R8I + }, { + name: 'r8ui', internalFormat: gl.R8UI + }, { + name: 'r8_snorm', internalFormat: gl.R8_SNORM + } + ]; + + // Depth and stencil formats + /** @type {Array<{name: string, internalFormat: number}>} */ + var depthStencilFormats = [{ + name: 'depth_component32f', + internalFormat: gl.DEPTH_COMPONENT32F + }, { + name: 'depth_component24', + internalFormat: gl.DEPTH_COMPONENT24 + }, { + name: 'depth_component16', + internalFormat: gl.DEPTH_COMPONENT16 + }, { + name: 'depth32f_stencil8', + internalFormat: gl.DEPTH32F_STENCIL8 + }, { + name: 'depth24_stencil8', + internalFormat: gl.DEPTH24_STENCIL8 + } + ]; + + // Basic TexImage2D usage. + var splitBasicTex2D = 2, splitBasicTexCube = 5; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ + var basicTexImageGroup2D = []; + for (var ii = 0; ii < splitBasicTex2D; ++ii) { + basicTexImageGroup2D.push( + new tcuTestCase.DeqpTest('basic_teximage2d', 'Basic glTexImage2D() usage') + ); + this.addChild(basicTexImageGroup2D[ii]); + } + /** @type {Array<{tcuTestCase.DeqpTest}>} */ + var basicTexImageGroupCube = []; + for (var ii = 0; ii < splitBasicTexCube; ++ii) { + basicTexImageGroupCube.push( + new tcuTestCase.DeqpTest('basic_teximage2d', 'Basic glTexImage2D() usage') + ); + this.addChild(basicTexImageGroupCube[ii]); + } + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + /** @type {string} */ + var fmtName = colorFormats[formatNdx].name; + /** @type {number} */ + var format = colorFormats[formatNdx].internalFormat; + /** @type {number} */ + var tex2DWidth = 64; + /** @type {number} */ + var tex2DHeight = 128; + /** @type {number} */ + var texCubeSize = 64; + + basicTexImageGroup2D[formatNdx % splitBasicTex2D].addChild( + es3fTextureSpecificationTests.newBasicTexImage2DCaseInternal( + fmtName + '_2d', '', format, tex2DWidth, tex2DHeight + ) + ); + basicTexImageGroupCube[formatNdx % splitBasicTexCube].addChild( + es3fTextureSpecificationTests.newBasicTexImageCubeCaseInternal( + fmtName + '_cube', '', format, texCubeSize + ) + ); + } + + // Randomized TexImage2D order. + /** @type {tcuTestCase.DeqpTest} */ + var randomTexImageGroup = new tcuTestCase.DeqpTest( + 'random_teximage2d', 'Randomized glTexImage2D() usage' + ); + this.addChild(randomTexImageGroup); + var rnd = new deRandom.Random(9); + + // 2D cases. + for (var ndx = 0; ndx < 10; ndx++) { + var formatNdx = rnd.getInt(0, colorFormats.length - 1); + var width = 1 << rnd.getInt(2, 8); + var height = 1 << rnd.getInt(2, 8); + + randomTexImageGroup.addChild( + es3fTextureSpecificationTests.newRandomOrderTexImage2DCaseInternal( + '2d.' + colorFormats[formatNdx].name, '', + colorFormats[formatNdx].internalFormat, width, height + ) + ); + } + + // Cubemap cases. + randomTexImageGroup = new tcuTestCase.DeqpTest( + 'random_teximage2d', 'Randomized glTexImage2D() usage' + ); + this.addChild(randomTexImageGroup); + + for (var ndx = 0; ndx < 10; ndx++) { + formatNdx = rnd.getInt(0, colorFormats.length - 1); + /** @type {number} */ var size = 1 << rnd.getInt(2, 8); + + randomTexImageGroup.addChild( + es3fTextureSpecificationTests.newRandomOrderTexImageCubeCaseInternal( + 'cube.' + colorFormats[formatNdx].name, '', + colorFormats[formatNdx].internalFormat, size + ) + ); + } + + // TexImage2D unpack alignment. + /** @type {tcuTestCase.DeqpTest} */ + var alignGroup = new tcuTestCase.DeqpTest( + 'teximage2d_align', 'glTexImage2D() unpack alignment tests' + ); + this.addChild(alignGroup); + + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_r8_4_8', '', gl.R8, 4, 8, 4, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_r8_63_1', '', gl.R8, 63, 30, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_r8_63_2', '', gl.R8, 63, 30, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_r8_63_4', '', gl.R8, 63, 30, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_r8_63_8', '', gl.R8, 63, 30, 1, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba4_51_1', '', gl.RGBA4, 51, 30, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba4_51_2', '', gl.RGBA4, 51, 30, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba4_51_4', '', gl.RGBA4, 51, 30, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba4_51_8', '', gl.RGBA4, 51, 30, 1, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgb8_39_1', '', gl.RGB8, 39, 43, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgb8_39_2', '', gl.RGB8, 39, 43, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgb8_39_4', '', gl.RGB8, 39, 43, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgb8_39_8', '', gl.RGB8, 39, 43, 1, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba8_47_1', '', gl.RGBA8, 47, 27, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba8_47_2', '', gl.RGBA8, 47, 27, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba8_47_4', '', gl.RGBA8, 47, 27, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal( + '2d_rgba8_47_8', '', gl.RGBA8, 47, 27, 1, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_r8_4_8', '', gl.R8, 4, 3, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_r8_63_1', '', gl.R8, 63, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_r8_63_2', '', gl.R8, 63, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_r8_63_4', '', gl.R8, 63, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_r8_63_8', '', gl.R8, 63, 1, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba4_51_1', '', gl.RGBA4, 51, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba4_51_2', '', gl.RGBA4, 51, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba4_51_4', '', gl.RGBA4, 51, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba4_51_8', '', gl.RGBA4, 51, 1, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgb8_39_1', '', gl.RGB8, 39, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgb8_39_2', '', gl.RGB8, 39, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgb8_39_4', '', gl.RGB8, 39, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgb8_39_8', '', gl.RGB8, 39, 1, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba8_47_1', '', gl.RGBA8, 47, 1, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba8_47_2', '', gl.RGBA8, 47, 1, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba8_47_4', '', gl.RGBA8, 47, 1, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal( + 'cube_rgba8_47_8', '', gl.RGBA8, 47, 1, 8 + ) + ); + + // glTexImage2D() unpack parameter cases. + /** @type {tcuTestCase.DeqpTest} */ + var paramGroup = new tcuTestCase.DeqpTest( + 'teximage2d_unpack_params', + 'glTexImage2D() pixel transfer mode cases' + ); + this.addChild(paramGroup); + + var cases = [{ + name: 'rgb8_alignment', format: gl.RGB8, width: 31, + height: 30, rowLength: 0, skipRows: 0, skipPixels: 0, + alignment: 2 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 31, + height: 30, rowLength: 50, skipRows: 0, skipPixels: 0, + alignment: 4 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 31, + height: 30, rowLength: 0, skipRows: 3, skipPixels: 0, + alignment: 4 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 31, + height: 30, rowLength: 36, skipRows: 0, skipPixels: 5, + alignment: 4 + }, { + name: 'r8_complex1', format: gl.R8, width: 31, + height: 30, rowLength: 64, skipRows: 1, skipPixels: 3, + alignment: 1 + }, { + name: 'r8_complex2', format: gl.R8, width: 31, + height: 30, rowLength: 64, skipRows: 1, skipPixels: 3, + alignment: 2 + }, { + name: 'r8_complex3', format: gl.R8, width: 31, + height: 30, rowLength: 64, skipRows: 1, skipPixels: 3, + alignment: 4 + }, { + name: 'r8_complex4', format: gl.R8, width: 31, + height: 30, rowLength: 64, skipRows: 1, skipPixels: 3, + alignment: 8 + }, { + name: 'rgba8_complex1', format: gl.RGBA8, width: 56, + height: 61, rowLength: 69, skipRows: 0, skipPixels: 0, + alignment: 8 + }, { + name: 'rgba8_complex2', format: gl.RGBA8, width: 56, + height: 61, rowLength: 69, skipRows: 0, skipPixels: 7, + alignment: 8 + }, { + name: 'rgba8_complex3', format: gl.RGBA8, width: 56, + height: 61, rowLength: 69, skipRows: 3, skipPixels: 0, + alignment: 8 + }, { + name: 'rgba8_complex4', format: gl.RGBA8, width: 56, + height: 61, rowLength: 69, skipRows: 3, skipPixels: 7, + alignment: 8 + }, { + name: 'rgba32f_complex', format: gl.RGBA32F, width: 19, + height: 10, rowLength: 27, skipRows: 1, skipPixels: 7, + alignment: 8 + } + ]; + + for (var ndx = 0; ndx < cases.length; ndx++) + paramGroup.addChild( + new es3fTextureSpecificationTests.TexImage2DParamsCase( + cases[ndx].name, '', cases[ndx].format, cases[ndx].width, + cases[ndx].height, cases[ndx].rowLength, + cases[ndx].skipRows, cases[ndx].skipPixels, + cases[ndx].alignment + ) + ); + + // glTexImage2D() pbo cases. + var splitPboTex2D = 2, splitPboTexCube = 5; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroup2D = []; + for (var ii = 0; ii < splitPboTex2D; ++ii) { + pboGroup2D.push(new tcuTestCase.DeqpTest('teximage2d_pbo', 'glTexImage2D() from PBO')); + this.addChild(pboGroup2D[ii]); + } + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroupCube = []; + for (var ii = 0; ii < splitPboTexCube; ++ii) { + pboGroupCube.push(new tcuTestCase.DeqpTest('teximage2d_pbo', 'glTexImage2D() from PBO')); + this.addChild(pboGroupCube[ii]); + } + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + fmtName = colorFormats[formatNdx].name; + format = colorFormats[formatNdx].internalFormat; + tex2DWidth = 65; + tex2DHeight = 37; + texCubeSize = 64; + + pboGroup2D[formatNdx % splitPboTex2D].addChild( + new es3fTextureSpecificationTests.TexImage2DBufferCase( + fmtName + '_2d', '', format, + tex2DWidth, tex2DHeight, 0, 0, 0, 4, 0 + ) + ); + pboGroupCube[formatNdx % splitPboTexCube].addChild( + new es3fTextureSpecificationTests.TexImageCubeBufferCase( + fmtName + '_cube', '', format, + texCubeSize, 0, 0, 0, 4, 0 + ) + ); + } + + // Parameter cases + var pboGroupParams = new tcuTestCase.DeqpTest( + 'teximage2d_pbo', 'glTexImage2D() from PBO' + ); + this.addChild(pboGroupParams); + /** + * @type {Array<{name: string, format: number, width: number, + * height: number, rowLength: number, skipRows: number, + * skipPixels: number, alignment: number, offset: number}>} + */ + var parameterCases = [{ + name: 'rgb8_offset', format: gl.RGB8, width: 31, + height: 30, rowLength: 0, skipRows: 0, skipPixels: 0, + alignment: 4, offset: 67 + }, { + name: 'rgb8_alignment', format: gl.RGB8, width: 31, + height: 30, rowLength: 0, skipRows: 0, skipPixels: 0, + alignment: 2, offset: 0 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 31, + height: 30, rowLength: 50, skipRows: 0, skipPixels: 0, + alignment: 4, offset: 0 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 31, + height: 30, rowLength: 0, skipRows: 3, skipPixels: 0, + alignment: 4, offset: 0 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 31, + height: 30, rowLength: 36, skipRows: 0, skipPixels: 5, + alignment: 4, offset: 0 + } + ]; + for (var ndx = 0; ndx < parameterCases.length; ndx++) { + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexImage2DBufferCase( + parameterCases[ndx].name + '_2d', '', + parameterCases[ndx].format, parameterCases[ndx].width, + parameterCases[ndx].height, parameterCases[ndx].rowLength, + parameterCases[ndx].skipRows, + parameterCases[ndx].skipPixels, + parameterCases[ndx].alignment, + parameterCases[ndx].offset + ) + ); + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexImageCubeBufferCase( + parameterCases[ndx].name + '_cube', '', + parameterCases[ndx].format, parameterCases[ndx].width, + parameterCases[ndx].rowLength, parameterCases[ndx].skipRows, + parameterCases[ndx].skipPixels, + parameterCases[ndx].alignment, parameterCases[ndx].offset + ) + ); + } + + // glTexImage2D() depth cases. + /** @type {tcuTestCase.DeqpTest} */ + var shadow2dGroup = new tcuTestCase.DeqpTest( + 'teximage2d_depth', + 'glTexImage2D() with depth or depth/stencil format' + ); + this.addChild(shadow2dGroup); + + for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) { + // WebGL 2 specific constraint. + if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8) + continue; + var tex2DWidth = 64; + var tex2DHeight = 128; + + shadow2dGroup.addChild( + new es3fTextureSpecificationTests.TexImage2DDepthCase( + depthStencilFormats[ndx].name, '', + depthStencilFormats[ndx].internalFormat, + tex2DWidth, tex2DHeight + ) + ); + } + + // glTexImage2D() depth cases with pbo. + shadow2dGroup = new tcuTestCase.DeqpTest( + 'teximage2d_depth_pbo', + 'glTexImage2D() with depth or depth/stencil format with pbo' + ); + this.addChild(shadow2dGroup); + + for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) { + tex2DWidth = 64; + tex2DHeight = 128; + + shadow2dGroup.addChild( + new es3fTextureSpecificationTests.TexImage2DDepthBufferCase( + depthStencilFormats[ndx].name, '', + depthStencilFormats[ndx].internalFormat, + tex2DWidth, tex2DHeight + ) + ); + } + + // Basic TexSubImage2D usage. + splitBasicTex2D = 3; + splitBasicTexCube = 5; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ + var basicTexSubImageGroup2D = []; + for (var ii = 0; ii < splitBasicTex2D; ++ii) { + basicTexSubImageGroup2D.push( + new tcuTestCase.DeqpTest('basic_texsubimage2d', 'Basic glTexSubImage2D() usage') + ); + this.addChild(basicTexSubImageGroup2D[ii]); + } + /** @type {Array<{tcuTestCase.DeqpTest}>} */ + var basicTexSubImageGroupCube = []; + for (var ii = 0; ii < splitBasicTexCube; ++ii) { + basicTexSubImageGroupCube.push( + new tcuTestCase.DeqpTest('basic_texsubimage2d', 'Basic glTexSubImage2D() usage') + ); + this.addChild(basicTexSubImageGroupCube[ii]); + } + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + fmtName = colorFormats[formatNdx].name; + format = colorFormats[formatNdx].internalFormat; + tex2DWidth = 64; + tex2DHeight = 128; + texCubeSize = 64; + + basicTexSubImageGroup2D[formatNdx % splitBasicTex2D].addChild( + es3fTextureSpecificationTests.newBasicTexSubImage2DCaseInternal( + fmtName + '_2d', '', format, tex2DWidth, tex2DHeight + ) + ); + basicTexSubImageGroupCube[formatNdx % splitBasicTexCube].addChild( + es3fTextureSpecificationTests.newBasicTexImageCubeCaseInternal( + fmtName + '_cube', '', format, texCubeSize + ) + ); + } + + // TexSubImage2D to empty texture. + /** @type {tcuTestCase.DeqpTest} */ + var texSubImageEmptyTexGroup = new tcuTestCase.DeqpTest( + 'texsubimage2d_empty_tex', + 'glTexSubImage2D() to texture that has storage but no data' + ); + this.addChild(texSubImageEmptyTexGroup); + for (var formatNdx = 0; formatNdx < unsizedFormats.length; formatNdx++) { + fmtName = unsizedFormats[formatNdx].name; + format = unsizedFormats[formatNdx].format; + /** @type {number} */ + var dataType = unsizedFormats[formatNdx].dataType; + tex2DWidth = 64; + tex2DHeight = 32; + texCubeSize = 32; + + texSubImageEmptyTexGroup.addChild( + new es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase( + fmtName + '_2d', '', format, dataType, tex2DWidth, tex2DHeight + ) + ); + texSubImageEmptyTexGroup.addChild( + new es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase( + fmtName + '_cube', '', format, dataType, texCubeSize + ) + ); + } + + // TexSubImage2D alignment cases. + alignGroup = new tcuTestCase.DeqpTest( + 'texsubimage2d_align', 'glTexSubImage2D() unpack alignment tests' + ); + this.addChild(alignGroup); + + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_1_1', '', gl.R8, 64, 64, 13, 17, 1, 6, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_1_2', '', gl.R8, 64, 64, 13, 17, 1, 6, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_1_4', '', gl.R8, 64, 64, 13, 17, 1, 6, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_1_8', '', gl.R8, 64, 64, 13, 17, 1, 6, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_63_1', '', gl.R8, 64, 64, 1, 9, 63, 30, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_63_2', '', gl.R8, 64, 64, 1, 9, 63, 30, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_63_4', '', gl.R8, 64, 64, 1, 9, 63, 30, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_r8_63_8', '', gl.R8, 64, 64, 1, 9, 63, 30, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba4_51_1', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba4_51_2', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba4_51_4', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba4_51_8', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgb8_39_1', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgb8_39_2', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgb8_39_4', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgb8_39_8', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba8_47_1', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba8_47_2', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba8_47_4', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal( + '2d_rgba8_47_8', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 8 + ) + ); + + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_1_1', '', gl.R8, 64, 13, 17, 1, 6, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_1_2', '', gl.R8, 64, 13, 17, 1, 6, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_1_4', '', gl.R8, 64, 13, 17, 1, 6, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_1_8', '', gl.R8, 64, 13, 17, 1, 6, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_63_1', '', gl.R8, 64, 1, 9, 63, 30, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_63_2', '', gl.R8, 64, 1, 9, 63, 30, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_63_4', '', gl.R8, 64, 1, 9, 63, 30, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_r8_63_8', '', gl.R8, 64, 1, 9, 63, 30, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba4_51_1', '', gl.RGBA4, 64, 7, 29, 51, 30, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba4_51_2', '', gl.RGBA4, 64, 7, 29, 51, 30, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba4_51_4', '', gl.RGBA4, 64, 7, 29, 51, 30, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba4_51_8', '', gl.RGBA4, 64, 7, 29, 51, 30, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgb8_39_1', '', gl.RGB8, 64, 11, 8, 39, 43, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgb8_39_2', '', gl.RGB8, 64, 11, 8, 39, 43, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgb8_39_4', '', gl.RGB8, 64, 11, 8, 39, 43, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgb8_39_8', '', gl.RGB8, 64, 11, 8, 39, 43, 8 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba8_47_1', '', gl.RGBA8, 64, 10, 1, 47, 27, 1 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba8_47_2', '', gl.RGBA8, 64, 10, 1, 47, 27, 2 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba8_47_4', '', gl.RGBA8, 64, 10, 1, 47, 27, 4 + ) + ); + alignGroup.addChild( + es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal( + 'cube_rgba8_47_8', '', gl.RGBA8, 64, 10, 1, 47, 27, 8 + ) + ); + + // glTexSubImage2D() pixel transfer mode cases. + paramGroup = new tcuTestCase.DeqpTest( + 'texsubimage2d_unpack_params', + 'glTexSubImage2D() pixel transfer mode cases' + ); + this.addChild(paramGroup); + + cases = [{ + name: 'rgb8_alignment', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 0, skipRows: 0, skipPixels: 0, alignment: 2 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 50, skipRows: 0, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 0, skipRows: 3, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 36, skipRows: 0, skipPixels: 5, alignment: 4 + }, { + name: 'r8_complex1', format: gl.R8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 1 + }, { + name: 'r8_complex2', format: gl.R8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 2 + }, { + name: 'r8_complex3', format: gl.R8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 4 + }, { + name: 'r8_complex4', format: gl.R8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 8 + }, { + name: 'rgba8_complex1', format: gl.RGBA8, width: 92, + height: 84, subX: 13, subY: 19, subW: 56, subH: 61, + rowLength: 69, skipRows: 0, skipPixels: 0, alignment: 8 + }, { + name: 'rgba8_complex2', format: gl.RGBA8, width: 92, + height: 84, subX: 13, subY: 19, subW: 56, subH: 61, + rowLength: 69, skipRows: 0, skipPixels: 7, alignment: 8 + }, { + name: 'rgba8_complex3', format: gl.RGBA8, width: 92, + height: 84, subX: 13, subY: 19, subW: 56, subH: 61, + rowLength: 69, skipRows: 3, skipPixels: 0, alignment: 8 + }, { + name: 'rgba8_complex4', format: gl.RGBA8, width: 92, + height: 84, subX: 13, subY: 19, subW: 56, subH: 61, + rowLength: 69, skipRows: 3, skipPixels: 7, alignment: 8 + }, { + name: 'rgba32f_complex', format: gl.RGBA32F, width: 92, + height: 84, subX: 13, subY: 19, subW: 56, subH: 61, + rowLength: 69, skipRows: 3, skipPixels: 7, alignment: 8 + } + ]; + + for (var ndx = 0; ndx < cases.length; ndx++) + paramGroup.addChild( + new es3fTextureSpecificationTests.TexSubImage2DParamsCase( + cases[ndx].name, '', cases[ndx].format, cases[ndx].width, + cases[ndx].height, cases[ndx].subX, cases[ndx].subY, + cases[ndx].subW, cases[ndx].subH, cases[ndx].rowLength, + cases[ndx].skipRows, cases[ndx].skipPixels, + cases[ndx].alignment + ) + ); + + // glTexSubImage2D() PBO cases. + splitPboTex2D = 2; + splitPboTexCube = 5; + pboGroup2D = []; + for (var ii = 0; ii < splitPboTex2D; ++ii) { + pboGroup2D.push(new tcuTestCase.DeqpTest( + 'texsubimage2d_pbo', + 'glTexSubImage2D() pixel buffer object tests' + )); + this.addChild(pboGroup2D[ii]); + } + pboGroupCube = []; + for (var ii = 0; ii < splitPboTexCube; ++ii) { + pboGroupCube.push(new tcuTestCase.DeqpTest( + 'texsubimage2d_pbo', + 'glTexSubImage2D() pixel buffer object tests' + )); + this.addChild(pboGroupCube[ii]); + } + + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + pboGroup2D[ndx % splitPboTex2D].addChild( + new es3fTextureSpecificationTests.TexSubImage2DBufferCase( + colorFormats[ndx].name + '_2d', '', + colorFormats[ndx].internalFormat, + 54, // Width + 60, // Height + 11, // Sub X + 7, // Sub Y + 31, // Sub W + 30, // Sub H + 0, // Row len + 0, // Skip rows + 0, // Skip pixels + 4, // Alignment + 0 /* offset */ + ) + ); + pboGroupCube[ndx % splitPboTexCube].addChild( + new es3fTextureSpecificationTests.TexSubImageCubeBufferCase( + colorFormats[ndx].name + '_cube', '', + colorFormats[ndx].internalFormat, + 64, // Size + 11, // Sub X + 7, // Sub Y + 31, // Sub W + 30, // Sub H + 0, // Row len + 0, // Skip rows + 0, // Skip pixels + 4, // Alignment + 0 /* offset */ + ) + ); + } + + pboGroupParams = new tcuTestCase.DeqpTest( + 'texsubimage2d_pbo', + 'glTexSubImage2D() pixel buffer object tests' + ); + this.addChild(pboGroupParams); + /** @type {Array<{name: string, format: number, width: number, + * height: number, subX: number, subY: number, + * subW: number, subH: number, rowLength: number, skipRows: number, + * skipPixels: number, alignment: number, offset: number}>} + */ + var paramCases = [{ + name: 'rgb8_offset', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 0, skipRows: 0, skipPixels: 0, + alignment: 4, offset: 67 + }, { + name: 'rgb8_alignment', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 0, skipRows: 0, skipPixels: 0, + alignment: 2, offset: 0 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 50, skipRows: 0, skipPixels: 0, + alignment: 4, offset: 0 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 0, skipRows: 3, skipPixels: 0, + alignment: 4, offset: 0 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 54, + height: 60, subX: 11, subY: 7, subW: 31, subH: 30, + rowLength: 36, skipRows: 0, skipPixels: 5, + alignment: 4, offset: 0 + } + ]; + + for (var ndx = 0; ndx < paramCases.length; ndx++) { + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexSubImage2DBufferCase( + paramCases[ndx].name + '_2d', '', + paramCases[ndx].format, + paramCases[ndx].width, + paramCases[ndx].height, + paramCases[ndx].subX, + paramCases[ndx].subY, + paramCases[ndx].subW, + paramCases[ndx].subH, + paramCases[ndx].rowLength, + paramCases[ndx].skipRows, + paramCases[ndx].skipPixels, + paramCases[ndx].alignment, + paramCases[ndx].offset)); + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexSubImageCubeBufferCase( + paramCases[ndx].name + '_cube', '', + paramCases[ndx].format, + paramCases[ndx].width, + paramCases[ndx].subX, + paramCases[ndx].subY, + paramCases[ndx].subW, + paramCases[ndx].subH, + paramCases[ndx].rowLength, + paramCases[ndx].skipRows, + paramCases[ndx].skipPixels, + paramCases[ndx].alignment, + paramCases[ndx].offset + ) + ); + } + + // glTexSubImage2D() depth cases. + shadow2dGroup = new tcuTestCase.DeqpTest( + 'texsubimage2d_depth', + 'glTexSubImage2D() with depth or depth/stencil format' + ); + this.addChild(shadow2dGroup); + + for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) { + // WebGL 2 specific constraint. + if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8) + continue; + tex2DWidth = 64; + tex2DHeight = 32; + + shadow2dGroup.addChild( + new es3fTextureSpecificationTests.TexSubImage2DDepthCase( + depthStencilFormats[ndx].name, '', + depthStencilFormats[ndx].internalFormat, + tex2DWidth, tex2DHeight + ) + ); + } + + // Basic glCopyTexImage2D() cases + /** @type {tcuTestCase.DeqpTest} */ + var copyTexImageGroup = new tcuTestCase.DeqpTest( + 'basic_copyteximage2d', 'Basic glCopyTexImage2D() usage' + ); + this.addChild(copyTexImageGroup); + + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImage2DCase( + '2d_alpha', '', gl.ALPHA, 128, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImage2DCase( + '2d_luminance', '', gl.LUMINANCE, 128, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImage2DCase( + '2d_luminance_alpha', '', gl.LUMINANCE_ALPHA, 128, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImage2DCase( + '2d_rgb', '', gl.RGB, 128, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImage2DCase( + '2d_rgba', '', gl.RGBA, 128, 64 + ) + ); + + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase( + 'cube_alpha', '', gl.ALPHA, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase( + 'cube_luminance', '', gl.LUMINANCE, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase( + 'cube_luminance_alpha', '', gl.LUMINANCE_ALPHA, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase( + 'cube_rgb', '', gl.RGB, 64 + ) + ); + copyTexImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase( + 'cube_rgba', '', gl.RGBA, 64 + ) + ); + + // Basic glCopyTexSubImage2D() cases + /** @type {tcuTestCase.DeqpTest} */ + var copyTexSubImageGroup = new tcuTestCase.DeqpTest( + 'basic_copytexsubimage2d', 'Basic glCopyTexSubImage2D() usage' + ); + this.addChild(copyTexSubImageGroup); + + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase( + '2d_alpha', '', gl.ALPHA, gl.UNSIGNED_BYTE, 128, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase( + '2d_luminance', '', gl.LUMINANCE, gl.UNSIGNED_BYTE, 128, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase( + '2d_luminance_alpha', '', gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE, 128, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase( + '2d_rgb', '', gl.RGB, gl.UNSIGNED_BYTE, 128, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase( + '2d_rgba', '', gl.RGBA, gl.UNSIGNED_BYTE, 128, 64 + ) + ); + + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase( + 'cube_alpha', '', gl.ALPHA, gl.UNSIGNED_BYTE, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase( + 'cube_luminance', '', gl.LUMINANCE, gl.UNSIGNED_BYTE, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase( + 'cube_luminance_alpha', '', gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase( + 'cube_rgb', '', gl.RGB, gl.UNSIGNED_BYTE, 64 + ) + ); + copyTexSubImageGroup.addChild( + new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase( + 'cube_rgba', '', gl.RGBA, gl.UNSIGNED_BYTE, 64 + ) + ); + + // Basic TexImage3D usage. + var splitBasicTex2DArray = 3, splitBasicTex3D = 5; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ + var basicTexImageGroup2DArray = []; + for (var ii = 0; ii < splitBasicTex2DArray; ++ii) { + basicTexImageGroup2DArray.push( + new tcuTestCase.DeqpTest('basic_teximage3d', 'Basic glTexImage3D() usage') + ); + this.addChild(basicTexImageGroup2DArray[ii]); + } + /** @type {Array<{tcuTestCase.DeqpTest}>} */ + var basicTexImageGroup3D = []; + for (var ii = 0; ii < splitBasicTex3D; ++ii) { + basicTexImageGroup3D.push( + new tcuTestCase.DeqpTest('basic_teximage3d', 'Basic glTexImage3D() usage') + ); + this.addChild(basicTexImageGroup3D[ii]); + } + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + fmtName = colorFormats[formatNdx].name; + format = colorFormats[formatNdx].internalFormat; + /** @type {number} */ var tex2DArrayWidth = 57; + /** @type {number} */ var tex2DArrayHeight = 44; + /** @type {number} */ var tex2DArrayLevels = 5; + /** @type {number} */ var tex3DWidth = 63; + /** @type {number} */ var tex3DHeight = 29; + /** @type {number} */ var tex3DDepth = 11; + + basicTexImageGroup2DArray[formatNdx % splitBasicTex2DArray].addChild( + new es3fTextureSpecificationTests.BasicTexImage2DArrayCase( + fmtName + '_2d_array', '', format, + tex2DArrayWidth, tex2DArrayHeight, tex2DArrayLevels + ) + ); + basicTexImageGroup3D[formatNdx % splitBasicTex3D].addChild( + new es3fTextureSpecificationTests.BasicTexImage3DCase( + fmtName + '_3d', '', format, + tex3DWidth, tex3DHeight, tex3DDepth + ) + ); + } + + // glTexImage3D() unpack params cases. + paramGroup = new tcuTestCase.DeqpTest( + 'teximage3d_unpack_params', 'glTexImage3D() unpack parameters' + ); + this.addChild(paramGroup); + + cases = [{ + name: 'rgb8_image_height', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 26, rowLength: 0, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 27, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_images', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 0, + skipImages: 3, skipRows: 0, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 22, rowLength: 0, + skipImages: 0, skipRows: 3, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 25, + skipImages: 0, skipRows: 0, skipPixels: 2, alignment: 4 + }, { + name: 'r8_complex1', format: gl.R8, width: 13, + height: 17, depth: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 1 + }, { + name: 'r8_complex2', format: gl.R8, width: 13, + height: 17, depth: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 2 + }, { + name: 'r8_complex3', format: gl.R8, width: 13, + height: 17, depth: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 4 + }, { + name: 'r8_complex4', format: gl.R8, width: 13, + height: 17, depth: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 8 + }, { + name: 'rgba8_complex1', format: gl.RGBA8, width: 11, + height: 20, depth: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 8 + }, { + name: 'rgba8_complex2', format: gl.RGBA8, width: 11, + height: 20, depth: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 2, skipPixels: 0, alignment: 8 + }, { + name: 'rgba8_complex3', format: gl.RGBA8, width: 11, + height: 20, depth: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 0, skipPixels: 3, alignment: 8 + }, { + name: 'rgba8_complex4', format: gl.RGBA8, width: 11, + height: 20, depth: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8 + }, { + name: 'rgba32f_complex', format: gl.RGBA32F, width: 11, + height: 20, depth: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8 + } + ]; + + for (var ndx = 0; ndx < cases.length; ndx++) + paramGroup.addChild( + new es3fTextureSpecificationTests.TexImage3DParamsCase( + cases[ndx].name, '', cases[ndx].format, cases[ndx].width, + cases[ndx].height, cases[ndx].depth, cases[ndx].imageHeight, + cases[ndx].rowLength, cases[ndx].skipImages, + cases[ndx].skipRows, cases[ndx].skipPixels, + cases[ndx].alignment + ) + ); + + // glTexImage3D() pbo cases. + var splitTex2DArray = 2, splitTex3D = 2; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroup2DArray = []; + for (var ii = 0; ii < splitTex2DArray; ++ii) { + pboGroup2DArray.push( + new tcuTestCase.DeqpTest('teximage3d_pbo', 'glTexImage3D() from PBO') + ); + this.addChild(pboGroup2DArray[ii]); + } + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroup3D = []; + for (var ii = 0; ii < splitTex3D; ++ii) { + pboGroup3D.push( + new tcuTestCase.DeqpTest('teximage3d_pbo', 'glTexImage3D() from PBO') + ); + this.addChild(pboGroup3D[ii]); + } + + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + fmtName = colorFormats[formatNdx].name; + format = colorFormats[formatNdx].internalFormat; + tex3DWidth = 11; + tex3DHeight = 20; + tex3DDepth = 8; + + pboGroup2DArray[formatNdx % splitTex2DArray].addChild( + new es3fTextureSpecificationTests.TexImage2DArrayBufferCase( + fmtName + '_2d_array', '', format, tex3DWidth, tex3DHeight, + tex3DDepth, 0, 0, 0, 0, 0, 4, 0 + ) + ); + pboGroup3D[formatNdx % splitTex3D].addChild( + new es3fTextureSpecificationTests.TexImage3DBufferCase( + fmtName + '_3d', '', format, tex3DWidth, tex3DHeight, + tex3DDepth, 0, 0, 0, 0, 0, 4, 0 + ) + ); + } + + // Parameter cases + parameterCases = [{ + name: 'rgb8_offset', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 0, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 1, + offset: 67 + }, { + name: 'rgb8_alignment', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 0, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 2, + offset: 0 + }, { + name: 'rgb8_image_height', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 26, rowLength: 0, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4, + offset: 0 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 27, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4, + offset: 0 + }, { + name: 'rgb8_skip_images', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 0, + skipImages: 3, skipRows: 0, skipPixels: 0, alignment: 4, + offset: 0 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 22, rowLength: 0, + skipImages: 0, skipRows: 3, skipPixels: 0, alignment: 4, + offset: 0 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 23, + height: 19, depth: 8, imageHeight: 0, rowLength: 25, + skipImages: 0, skipRows: 0, skipPixels: 2, alignment: 4, + offset: 0 + } + ]; + + pboGroupParams = new tcuTestCase.DeqpTest('teximage3d_pbo', 'glTexImage3D() from PBO'); + this.addChild(pboGroupParams); + for (var ndx = 0; ndx < parameterCases.length; ndx++) { + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexImage2DArrayBufferCase( + parameterCases[ndx].name + '_2d_array', '', + parameterCases[ndx].format, parameterCases[ndx].width, + parameterCases[ndx].height, parameterCases[ndx].depth, + parameterCases[ndx].imageHeight, + parameterCases[ndx].rowLength, + parameterCases[ndx].skipImages, + parameterCases[ndx].skipRows, + parameterCases[ndx].skipPixels, + parameterCases[ndx].alignment, parameterCases[ndx].offset + ) + ); + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexImage3DBufferCase( + parameterCases[ndx].name + '_3d', '', + parameterCases[ndx].format, parameterCases[ndx].width, + parameterCases[ndx].height, parameterCases[ndx].depth, + parameterCases[ndx].imageHeight, + parameterCases[ndx].rowLength, + parameterCases[ndx].skipImages, + parameterCases[ndx].skipRows, + parameterCases[ndx].skipPixels, + parameterCases[ndx].alignment, parameterCases[ndx].offset + ) + ); + } + + // glTexImage3D() depth cases. + /** @type {tcuTestCase.DeqpTest} */ + var shadow3dGroup = new tcuTestCase.DeqpTest( + 'teximage3d_depth', + 'glTexImage3D() with depth or depth/stencil format' + ); + this.addChild(shadow3dGroup); + + for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) { + // WebGL 2 specific constraint. + if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8) + continue; + tex3DWidth = 32; + tex3DHeight = 64; + tex3DDepth = 8; + + shadow3dGroup.addChild( + new es3fTextureSpecificationTests.TexImage2DArrayDepthCase( + depthStencilFormats[ndx].name + '_2d_array', '', + depthStencilFormats[ndx].internalFormat, + tex3DWidth, tex3DHeight, tex3DDepth + ) + ); + } + + // glTexImage3D() depth cases with pbo. + shadow3dGroup = new tcuTestCase.DeqpTest( + 'teximage3d_depth_pbo', + 'glTexImage3D() with depth or depth/stencil format with pbo' + ); + this.addChild(shadow3dGroup); + + for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) { + tex3DWidth = 32; + tex3DHeight = 64; + tex3DDepth = 8; + + shadow3dGroup.addChild( + new es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase( + depthStencilFormats[ndx].name + '_2d_array', '', + depthStencilFormats[ndx].internalFormat, + tex3DWidth, tex3DHeight, tex3DDepth + ) + ); + } + + // Basic TexSubImage3D usage. + splitTex3D = 5; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var basicTexSubImageGroup = []; + for (var ii = 0; ii < splitTex3D; ++ii) { + basicTexSubImageGroup.push( + new tcuTestCase.DeqpTest('basic_texsubimage3d', 'Basic glTexSubImage3D() usage') + ); + this.addChild(basicTexSubImageGroup[ii]); + } + + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + fmtName = colorFormats[formatNdx].name; + format = colorFormats[formatNdx].internalFormat; + tex3DWidth = 32; + tex3DHeight = 64; + tex3DDepth = 8; + + basicTexSubImageGroup[formatNdx % splitTex3D].addChild( + new es3fTextureSpecificationTests.BasicTexSubImage3DCase( + fmtName + '_3d', '', format, + tex3DWidth, tex3DHeight, tex3DDepth + ) + ); + } + + // glTexSubImage3D() unpack params cases. + paramGroup = new tcuTestCase.DeqpTest( + 'texsubimage3d_unpack_params', 'glTexSubImage3D() unpack parameters' + ); + this.addChild(paramGroup); + + /** @type {Array<{name: string, format: number, width: number, + * height: number, depth: number, subX: number, subY: number, + * subZ: number, subW: number, subH: number, subD: number, + * imageHeight: number, rowLength: number, skipImages: number, + * skipRows: number, skipPixels: number, alignment: number}>} + */ + var casesSubImage3D = [{ + name: 'rgb8_image_height', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 26, rowLength: 0, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 0, rowLength: 27, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_images', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 0, rowLength: 0, + skipImages: 3, skipRows: 0, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 22, rowLength: 0, + skipImages: 0, skipRows: 3, skipPixels: 0, alignment: 4 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 0, rowLength: 25, + skipImages: 0, skipRows: 0, skipPixels: 2, alignment: 4 + }, { + name: 'r8_complex1', format: gl.R8, width: 15, + height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13, + subH: 17, subD: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 1 + }, { + name: 'r8_complex2', format: gl.R8, width: 15, + height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13, + subH: 17, subD: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 2 + }, { + name: 'r8_complex3', format: gl.R8, width: 15, + height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13, + subH: 17, subD: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 4 + }, { + name: 'r8_complex4', format: gl.R8, width: 15, + height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13, + subH: 17, subD: 11, imageHeight: 23, rowLength: 15, + skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 8 + }, { + name: 'rgba8_complex1', format: gl.RGBA8, width: 15, + height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11, + subH: 20, subD: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 8 + }, { + name: 'rgba8_complex2', format: gl.RGBA8, width: 15, + height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11, + subH: 20, subD: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 2, skipPixels: 0, alignment: 8 + }, { + name: 'rgba8_complex3', format: gl.RGBA8, width: 15, + height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11, + subH: 20, subD: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 0, skipPixels: 3, alignment: 8 + }, { + name: 'rgba8_complex4', format: gl.RGBA8, width: 15, + height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11, + subH: 20, subD: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8 + }, { + name: 'rgba32f_complex', format: gl.RGBA32F, width: 15, + height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11, + subH: 20, subD: 8, imageHeight: 25, rowLength: 14, + skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8 + } + ]; + + for (var ndx = 0; ndx < casesSubImage3D.length; ndx++) + paramGroup.addChild( + new es3fTextureSpecificationTests.TexSubImage3DParamsCase( + casesSubImage3D[ndx].name, '', casesSubImage3D[ndx].format, + casesSubImage3D[ndx].width, casesSubImage3D[ndx].height, casesSubImage3D[ndx].depth, + casesSubImage3D[ndx].subX, casesSubImage3D[ndx].subY, casesSubImage3D[ndx].subZ, + casesSubImage3D[ndx].subW, casesSubImage3D[ndx].subH, casesSubImage3D[ndx].subD, + casesSubImage3D[ndx].imageHeight, casesSubImage3D[ndx].rowLength, + casesSubImage3D[ndx].skipImages, casesSubImage3D[ndx].skipRows, + casesSubImage3D[ndx].skipPixels, casesSubImage3D[ndx].alignment + ) + ); + + // glTexSubImage3D() PBO cases. + splitTex2DArray = 2; + pboGroup2DArray = []; + for (var ii = 0; ii < splitTex2DArray; ++ii) { + pboGroup2DArray.push( + new tcuTestCase.DeqpTest('texsubimage3d_pbo', 'glTexSubImage3D() pixel buffer object tests') + ); + this.addChild(pboGroup2DArray[ii]); + } + + splitTex3D = 2; + pboGroup3D = []; + for (var ii = 0; ii < splitTex3D; ++ii) { + pboGroup3D.push( + new tcuTestCase.DeqpTest('texsubimage3d_pbo', 'glTexSubImage3D() pixel buffer object tests') + ); + this.addChild(pboGroup3D[ii]); + } + + for (var ndx = 0; ndx < colorFormats.length; ndx++) { + pboGroup2DArray[ndx % splitTex2DArray].addChild( + new es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase( + colorFormats[ndx].name + '_2d_array', '', + colorFormats[ndx].internalFormat, + 26, // Width + 25, // Height + 10, // Depth + 1, // Sub X + 2, // Sub Y + 0, // Sub Z + 23, // Sub W + 19, // Sub H + 8, // Sub D + 0, // Image height + 0, // Row length + 0, // Skip images + 0, // Skip rows + 0, // Skip pixels + 4, // Alignment + 0 // offset + ) + ); + pboGroup3D[ndx % splitTex3D].addChild( + new es3fTextureSpecificationTests.TexSubImage3DBufferCase( + colorFormats[ndx].name + '_3d', '', + colorFormats[ndx].internalFormat, + 26, // Width + 25, // Height + 10, // Depth + 1, // Sub X + 2, // Sub Y + 0, // Sub Z + 23, // Sub W + 19, // Sub H + 8, // Sub D + 0, // Image height + 0, // Row length + 0, // Skip images + 0, // Skip rows + 0, // Skip pixels + 4, // Alignment + 0 // offset + ) + ); + } + + paramCases = [{ + name: 'rgb8_offset', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 0, rowLength: 0, skipImages: 0, + skipRows: 0, skipPixels: 0, alignment: 4, offset: 67 + }, { + name: 'rgb8_image_height', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 26, rowLength: 0, skipImages: 0, + skipRows: 0, skipPixels: 0, alignment: 4, offset: 0 + }, { + name: 'rgb8_row_length', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 0, rowLength: 27, skipImages: 0, + skipRows: 0, skipPixels: 0, alignment: 4, offset: 0 + }, { + name: 'rgb8_skip_images', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 0, rowLength: 0, skipImages: 3, + skipRows: 0, skipPixels: 0, alignment: 4, offset: 0 + }, { + name: 'rgb8_skip_rows', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 22, rowLength: 0, skipImages: 0, + skipRows: 3, skipPixels: 0, alignment: 4, offset: 0 + }, { + name: 'rgb8_skip_pixels', format: gl.RGB8, width: 26, + height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23, + subH: 19, subD: 8, imageHeight: 0, rowLength: 25, skipImages: 0, + skipRows: 0, skipPixels: 2, alignment: 4, offset: 0 + } + ]; + + pboGroupParams = new tcuTestCase.DeqpTest( + 'texsubimage3d_pbo', 'glTexSubImage3D() pixel buffer object tests' + ); + this.addChild(pboGroupParams); + + for (var ndx = 0; ndx < paramCases.length; ndx++) { + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase( + paramCases[ndx].name + '_2d_array', '', + paramCases[ndx].format, paramCases[ndx].width, + paramCases[ndx].height, paramCases[ndx].depth, + paramCases[ndx].subX, paramCases[ndx].subY, + paramCases[ndx].subZ, paramCases[ndx].subW, + paramCases[ndx].subH, paramCases[ndx].subD, + paramCases[ndx].imageHeight, paramCases[ndx].rowLength, + paramCases[ndx].skipImages, paramCases[ndx].skipRows, + paramCases[ndx].skipPixels, paramCases[ndx].alignment, + paramCases[ndx].offset + ) + ); + pboGroupParams.addChild( + new es3fTextureSpecificationTests.TexSubImage3DBufferCase( + paramCases[ndx].name + '_3d', '', + paramCases[ndx].format, paramCases[ndx].width, + paramCases[ndx].height, paramCases[ndx].depth, + paramCases[ndx].subX, paramCases[ndx].subY, + paramCases[ndx].subZ, paramCases[ndx].subW, + paramCases[ndx].subH, paramCases[ndx].subD, + paramCases[ndx].imageHeight, paramCases[ndx].rowLength, + paramCases[ndx].skipImages, paramCases[ndx].skipRows, + paramCases[ndx].skipPixels, paramCases[ndx].alignment, + paramCases[ndx].offset + ) + ); + } + + // glTexSubImage3D() depth cases. + shadow3dGroup = new tcuTestCase.DeqpTest( + 'texsubimage3d_depth', + 'glTexSubImage3D() with depth or depth/stencil format' + ); + this.addChild(shadow3dGroup); + + for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) { + // WebGL 2 specific constraint. + if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8) + continue; + tex2DArrayWidth = 57; + tex2DArrayHeight = 44; + tex2DArrayLevels = 5; + + shadow3dGroup.addChild( + new es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase( + depthStencilFormats[ndx].name + '_2d_array', '', + depthStencilFormats[ndx].internalFormat, tex2DArrayWidth, + tex2DArrayHeight, tex2DArrayLevels + ) + ); + } + + // glTexStorage2D() cases. + + // Color formats + var splitStorage2D = 3, splitStorageCube = 5; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroup2D = []; + for (var ii = 0; ii < splitStorage2D; ++ii) { + colorFormatGroup2D.push( + new tcuTestCase.DeqpTest('texstorage2d.format', 'glTexStorage2D() with all formats') + ); + this.addChild(colorFormatGroup2D[ii]); + } + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroupCube = []; + for (var ii = 0; ii < splitStorageCube; ++ii) { + colorFormatGroupCube.push( + new tcuTestCase.DeqpTest('texstorage2d.format', 'glTexStorage2D() with all formats') + ); + this.addChild(colorFormatGroupCube[ii]); + } + + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + fmtName = colorFormats[formatNdx].name; + /** @type {number} */ var internalFormat = colorFormats[formatNdx].internalFormat; + var tex2DWidth = 117; + var tex2DHeight = 97; + var tex2DLevels = es3fTextureSpecificationTests.maxLevelCount(tex2DWidth, tex2DHeight); + /** @type {number} */ var cubeSize = 57; + /** @type {number} */ + var cubeLevels = es3fTextureSpecificationTests.maxLevelCount( + cubeSize, cubeSize + ); + + colorFormatGroup2D[formatNdx % splitStorage2D].addChild( + new es3fTextureSpecificationTests.BasicTexStorage2DCase( + fmtName + '_2d', '', internalFormat, + tex2DWidth, tex2DHeight, tex2DLevels + ) + ); + colorFormatGroupCube[formatNdx % splitStorageCube].addChild( + new es3fTextureSpecificationTests.BasicTexStorageCubeCase( + fmtName + '_cube', '', internalFormat, cubeSize, cubeLevels + ) + ); + } + + // Depth / stencil formats. + /** @type {tcuTestCase.DeqpTest} */ + var storageGroup = new tcuTestCase.DeqpTest( + 'texstorage2d.format', + 'glTexStorage2D() with all formats' + ); + this.addChild(storageGroup); + + for (var formatNdx = 0; formatNdx < depthStencilFormats.length; formatNdx++) { + fmtName = depthStencilFormats[formatNdx].name; + internalFormat = depthStencilFormats[formatNdx].internalFormat; + // WebGL 2 specific constraint. + if (internalFormat == gl.DEPTH32F_STENCIL8) + continue; + + tex2DWidth = 117; + tex2DHeight = 97; + tex2DLevels = es3fTextureSpecificationTests.maxLevelCount( + tex2DWidth, tex2DHeight + ); + cubeSize = 57; + cubeLevels = es3fTextureSpecificationTests.maxLevelCount( + cubeSize, cubeSize + ); + + storageGroup.addChild( + new es3fTextureSpecificationTests.BasicTexStorage2DCase( + fmtName + '_2d', '', internalFormat, + tex2DWidth, tex2DHeight, tex2DLevels + ) + ); + storageGroup.addChild( + new es3fTextureSpecificationTests.BasicTexStorageCubeCase( + fmtName + '_cube', '', internalFormat, cubeSize, cubeLevels + ) + ); + } + + // Sizes. + storageGroup = new tcuTestCase.DeqpTest( + 'texstorage2d.size', + 'glTexStorage2D() with various sizes' + ); + this.addChild(storageGroup); + + // W H L + /** @type {Array<{width: number, height: number, levels: number}>} */ + var tex2DSizes = [{ + width: 1, height: 1, levels: 1 + }, { + width: 2, height: 2, levels: 2 + }, { + width: 64, height: 32, levels: 7 + }, { + width: 32, height: 64, levels: 4 + }, { + width: 57, height: 63, levels: 1 + }, { + width: 57, height: 63, levels: 2 + }, { + width: 57, height: 63, levels: 6 + } + ]; + + // S L + /** @type {Array<{sizes: number, levels: number}>} */ + var cubeSizes = [{ + sizes: 1, levels: 1 + }, { + sizes: 2, levels: 2 + }, { + sizes: 57, levels: 1 + }, { + sizes: 57, levels: 2 + }, { + sizes: 57, levels: 6 + }, { + sizes: 64, levels: 4 + }, { + sizes: 64, levels: 7 + } + ]; + + for (var ndx = 0; ndx < tex2DSizes.length; ndx++) { + format = gl.RGBA8; + /** @type {number} */ var width = tex2DSizes[ndx].width; + /** @type {number} */ var height = tex2DSizes[ndx].height; + /** @type {number} */ var levels = tex2DSizes[ndx].levels; + /** @type {string} */ + var name = '2d_' + width + 'x' + height + '_' + levels + '_levels'; + + storageGroup.addChild( + new es3fTextureSpecificationTests.BasicTexStorage2DCase( + name, '', format, width, height, levels + ) + ); + } + + for (var ndx = 0; ndx < cubeSizes.length; ndx++) { + format = gl.RGBA8; + size = cubeSizes[ndx].sizes; + levels = cubeSizes[ndx].levels; + name = 'cube_' + size + 'x' + size + '_' + levels + '_levels'; + + storageGroup.addChild( + new es3fTextureSpecificationTests.BasicTexStorageCubeCase( + name, '', format, size, levels + ) + ); + } + + // glTexStorage3D() cases. + + // Color formats. + var splitStorage2DArray = 3, splitStorage3D = 4; + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroup2DArray = []; + for (var ii = 0; ii < splitStorage2DArray; ++ii) { + colorFormatGroup2DArray.push( + new tcuTestCase.DeqpTest('texstorage3d.format', 'glTexStorage3D() with all formats') + ); + this.addChild(colorFormatGroup2DArray[ii]); + } + /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroup3D = []; + for (var ii = 0; ii < splitStorage3D; ++ii) { + colorFormatGroup3D.push( + new tcuTestCase.DeqpTest('texstorage3d.format', 'glTexStorage3D() with all formats') + ); + this.addChild(colorFormatGroup3D[ii]); + } + + // Color formats. + for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) { + fmtName = colorFormats[formatNdx].name; + internalFormat = colorFormats[formatNdx].internalFormat; + tex2DArrayWidth = 57; + tex2DArrayHeight = 13; + var tex2DArrayLayers = 7; + tex2DArrayLevels = es3fTextureSpecificationTests.maxLevelCount( + tex2DArrayWidth, tex2DArrayHeight + ); + tex3DWidth = 59; + tex3DHeight = 37; + tex3DDepth = 11; + var tex3DLevels = es3fTextureSpecificationTests.maxLevelCount( + tex3DWidth, tex3DHeight, tex3DDepth + ); + + colorFormatGroup2DArray[formatNdx % splitStorage2DArray].addChild( + new es3fTextureSpecificationTests.BasicTexStorage2DArrayCase( + fmtName + '_2d_array', '', internalFormat, tex2DArrayWidth, + tex2DArrayHeight, tex2DArrayLayers, tex2DArrayLevels + ) + ); + colorFormatGroup3D[formatNdx % splitStorage3D].addChild( + new es3fTextureSpecificationTests.BasicTexStorage3DCase( + fmtName + '_3d', '', internalFormat, tex3DWidth, + tex3DHeight, tex3DDepth, tex3DLevels + ) + ); + } + + storageGroup = new tcuTestCase.DeqpTest( + 'texstorage3d.format', + 'glTexStorage3D() with all formats' + ); + this.addChild(storageGroup); + + // Depth/stencil formats (only 2D texture array is supported). + for (var formatNdx = 0; + formatNdx < depthStencilFormats.length; + formatNdx++) { + fmtName = depthStencilFormats[formatNdx].name; + internalFormat = depthStencilFormats[formatNdx].internalFormat; + // WebGL 2 specific constraint. + if (internalFormat == gl.DEPTH32F_STENCIL8) + continue; + + tex2DArrayWidth = 57; + tex2DArrayHeight = 13; + tex2DArrayLayers = 7; + tex2DArrayLevels = es3fTextureSpecificationTests.maxLevelCount( + tex2DArrayWidth, tex2DArrayHeight + ); + + storageGroup.addChild( + new es3fTextureSpecificationTests.BasicTexStorage2DArrayCase( + fmtName + '_2d_array', '', internalFormat, tex2DArrayWidth, + tex2DArrayHeight, tex2DArrayLayers, tex2DArrayLevels + ) + ); + } + + // Sizes. + // W H La Le + /** + * @type {Array<{width: number, height: number, + * layers: number, levels: number}>} + */ + var tex2DArraySizes = [{ + width: 1, height: 1, layers: 1, levels: 1 + }, { + width: 2, height: 2, layers: 2, levels: 2 + }, { + width: 64, height: 32, layers: 3, levels: 7 + }, { + width: 32, height: 64, layers: 3, levels: 4 + }, { + width: 57, height: 63, layers: 5, levels: 1 + }, { + width: 57, height: 63, layers: 5, levels: 2 + }, { + width: 57, height: 63, layers: 5, levels: 6 + } + ]; + + // W H D L + /** + * @type {Array<{width: number, height: number, + * depth: number, levels: number}>} + */ + var tex3DSizes = [{ + width: 1, height: 1, depth: 1, levels: 1 + }, { + width: 2, height: 2, depth: 2, levels: 2 + }, { + width: 64, height: 32, depth: 16, levels: 7 + }, { + width: 32, height: 64, depth: 16, levels: 4 + }, { + width: 32, height: 16, depth: 64, levels: 4 + }, { + width: 57, height: 63, depth: 11, levels: 1 + }, { + width: 57, height: 63, depth: 11, levels: 2 + }, { + width: 57, height: 63, depth: 11, levels: 6 + } + ]; + + storageGroup = new tcuTestCase.DeqpTest( + 'texstorage3d.size', 'glTexStorage3D() with various sizes' + ); + this.addChild(storageGroup); + + for (var ndx = 0; ndx < tex2DArraySizes.length; ndx++) { + format = gl.RGBA8; + width = tex2DArraySizes[ndx].width; + height = tex2DArraySizes[ndx].height; + /** @type {number} */ var layers = tex2DArraySizes[ndx].layers; + levels = tex2DArraySizes[ndx].levels; + name = '2d_array_' + width + 'x' + height + 'x' + + layers + '_' + levels + '_levels'; + + storageGroup.addChild( + new es3fTextureSpecificationTests.BasicTexStorage2DArrayCase( + name, '', format, width, height, layers, levels + ) + ); + } + + for (var ndx = 0; ndx < tex3DSizes.length; ndx++) { + format = gl.RGBA8; + width = tex3DSizes[ndx].width; + height = tex3DSizes[ndx].height; + var depth = tex3DSizes[ndx].depth; + levels = tex3DSizes[ndx].levels; + name = '3d_' + width + 'x' + height + 'x' + + depth + '_' + levels + '_levels'; + + storageGroup.addChild( + new es3fTextureSpecificationTests.BasicTexStorage3DCase( + name, '', format, width, height, depth, levels + ) + ); + } + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + * @param {Array=} range Test range + */ + es3fTextureSpecificationTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fTextureSpecificationTests.TextureSpecificationTests()); + if (range) + state.setRange(range); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fTextureSpecificationTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js new file mode 100644 index 000000000..ab1f4d6bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js @@ -0,0 +1,376 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fTextureStateQuery'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('functional.gles3.es3fApiCase'); +goog.require('modules.shared.glsStateQuery'); + +goog.scope(function() { +var es3fTextureStateQuery = functional.gles3.es3fTextureStateQuery; +var tcuTestCase = framework.common.tcuTestCase; +var glsStateQuery = modules.shared.glsStateQuery; +var es3fApiCase = functional.gles3.es3fApiCase; +var deRandom = framework.delibs.debase.deRandom; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** + * @constructor + * @extends {es3fApiCase.ApiCase} + * @param {string} name + * @param {string} description + * @param {number} textureTarget + */ +es3fTextureStateQuery.TextureCase = function(name, description, textureTarget) { + es3fApiCase.ApiCase.call(this, name, description, gl); + /** @type {WebGLTexture} */ this.m_texture; + this.m_textureTarget = textureTarget; +}; + +setParentClass(es3fTextureStateQuery.TextureCase, es3fApiCase.ApiCase); + +es3fTextureStateQuery.TextureCase.prototype.testTexture = function() { + throw new Error('Virtual function. Please override.'); +}; + +es3fTextureStateQuery.TextureCase.prototype.test = function() { + this.m_texture = gl.createTexture(); + gl.bindTexture(this.m_textureTarget, this.m_texture); + + this.testTexture(); + + gl.bindTexture(this.m_textureTarget, null); + gl.deleteTexture(this.m_texture); +}; + +/** + * @constructor + * @extends {es3fTextureStateQuery.TextureCase} + * @param {string} name + * @param {string} description + * @param {number} textureTarget + */ +es3fTextureStateQuery.IsTextureCase = function(name, description, textureTarget) { + es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget); +}; + +setParentClass(es3fTextureStateQuery.IsTextureCase, es3fTextureStateQuery.TextureCase); + +es3fTextureStateQuery.IsTextureCase.prototype.testTexture = function() { + this.check(glsStateQuery.compare(gl.isTexture(this.m_texture), true), 'gl.isTexture() should have returned true'); +}; + +/** + * @constructor + * @extends {es3fTextureStateQuery.TextureCase} + * @param {string} name + * @param {string} description + * @param {number} textureTarget + * @param {number} valueName + * @param {number} initialValue + * @param {Array} valueRange + */ +es3fTextureStateQuery.TextureParamCase = function(name, description, textureTarget, valueName, initialValue, valueRange) { + es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget); + this.m_valueName = valueName; + this.m_initialValue = initialValue; + this.m_valueRange = valueRange; +}; + +setParentClass(es3fTextureStateQuery.TextureParamCase, es3fTextureStateQuery.TextureCase); + +es3fTextureStateQuery.TextureParamCase.prototype.testTexture = function() { + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_valueName, this.m_initialValue)); + + for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) { + gl.texParameteri(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx]); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx])); + } + + //check unit conversions with float + + for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) { + gl.texParameterf(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx]); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx])); + } +}; + +/** + * @constructor + * @extends {es3fTextureStateQuery.TextureCase} + * @param {string} name + * @param {string} description + * @param {number} textureTarget + * @param {number} lodTarget + * @param {number} initialValue + */ +es3fTextureStateQuery.TextureLODCase = function(name, description, textureTarget, lodTarget, initialValue) { + es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget); + this.m_lodTarget = lodTarget; + this.m_initialValue = initialValue; +}; + +setParentClass(es3fTextureStateQuery.TextureLODCase, es3fTextureStateQuery.TextureCase); + +es3fTextureStateQuery.TextureLODCase.prototype.testTexture = function() { + var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_lodTarget, this.m_initialValue)); + + var numIterations = 60; + for (var ndx = 0; ndx < numIterations; ++ndx) { + var ref = rnd.getFloat(-64000, 64000); + + gl.texParameterf(this.m_textureTarget, this.m_lodTarget, ref); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_lodTarget, ref)); + } + + // check unit conversions with int + + for (var ndx = 0; ndx < numIterations; ++ndx) { + var ref = rnd.getInt(-64000, 64000); + + gl.texParameteri(this.m_textureTarget, this.m_lodTarget, ref); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_lodTarget, ref)); + } +}; + +/** + * @constructor + * @extends {es3fTextureStateQuery.TextureCase} + * @param {string} name + * @param {string} description + * @param {number} textureTarget + * @param {number} levelTarget + * @param {number} initialValue + */ +es3fTextureStateQuery.TextureLevelCase = function(name, description, textureTarget, levelTarget, initialValue) { + es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget); + this.m_levelTarget = levelTarget; + this.m_initialValue = initialValue; +}; + +setParentClass(es3fTextureStateQuery.TextureLevelCase, es3fTextureStateQuery.TextureCase); + +es3fTextureStateQuery.TextureLevelCase.prototype.testTexture = function() { + var rnd = new deRandom.Random(0xabcdef); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_levelTarget, this.m_initialValue)); + + var numIterations = 60; + for (var ndx = 0; ndx < numIterations; ++ndx) { + var ref = rnd.getInt(0, 64000); + + gl.texParameteri(this.m_textureTarget, this.m_levelTarget, ref); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_levelTarget, ref)); + } + + // check unit conversions with float + var nonSignificantOffsets = [-0.45, -0.25, 0, 0.45]; // offsets O so that for any integers z in Z, o in O roundToClosestInt(z+o)==z + + for (var ndx = 0; ndx < numIterations; ++ndx) { + var ref = rnd.getInt(0, 64000); + + for (var i = 0; i < nonSignificantOffsets.length; i++) { + gl.texParameterf(this.m_textureTarget, this.m_levelTarget, ref + nonSignificantOffsets[i]); + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_levelTarget, ref)); + } + } +}; + +/** + * @constructor + * @extends {es3fTextureStateQuery.TextureCase} + * @param {string} name + * @param {string} description + * @param {number} textureTarget + */ +es3fTextureStateQuery.TextureImmutableLevelsCase = function(name, description, textureTarget) { + es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget); +}; + +setParentClass(es3fTextureStateQuery.TextureImmutableLevelsCase, es3fTextureStateQuery.TextureCase); + +es3fTextureStateQuery.TextureImmutableLevelsCase.prototype.testTexture = function() { + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_LEVELS, 0)); + for (var level = 1; level <= 8; ++level) { + var textureID = gl.createTexture(); + gl.bindTexture(this.m_textureTarget, textureID); + + if (this.m_textureTarget == gl.TEXTURE_2D_ARRAY || this.m_textureTarget == gl.TEXTURE_3D) + gl.texStorage3D(this.m_textureTarget, level, gl.RGB8, 256, 256, 256); + else + gl.texStorage2D(this.m_textureTarget, level, gl.RGB8, 256, 256); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_LEVELS, level)); + gl.deleteTexture(textureID); + } +}; + +/** + * @constructor + * @extends {es3fTextureStateQuery.TextureCase} + * @param {string} name + * @param {string} description + * @param {number} textureTarget + */ +es3fTextureStateQuery.TextureImmutableFormatCase = function(name, description, textureTarget) { + es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget); +}; + +setParentClass(es3fTextureStateQuery.TextureImmutableFormatCase, es3fTextureStateQuery.TextureCase); + +es3fTextureStateQuery.TextureImmutableFormatCase.prototype.testTexture = function() { + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_LEVELS, 0)); + var testSingleFormat = function(format) { + var textureID = gl.createTexture(); + gl.bindTexture(this.m_textureTarget, textureID); + + if (this.m_textureTarget == gl.TEXTURE_2D_ARRAY || this.m_textureTarget == gl.TEXTURE_3D) + gl.texStorage3D(this.m_textureTarget, 1, format, 32, 32, 32); + else + gl.texStorage2D(this.m_textureTarget, 1, format, 32, 32); + + this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_FORMAT, 1)); + gl.deleteTexture(textureID); + }; + + var formats = [ + gl.RGBA32I, gl.RGBA32UI, gl.RGBA16I, gl.RGBA16UI, gl.RGBA8, gl.RGBA8I, + gl.RGBA8UI, gl.SRGB8_ALPHA8, gl.RGB10_A2, gl.RGB10_A2UI, gl.RGBA4, + gl.RGB5_A1, gl.RGB8, gl.RGB565, gl.RG32I, gl.RG32UI, gl.RG16I, gl.RG16UI, + gl.RG8, gl.RG8I, gl.RG8UI, gl.R32I, gl.R32UI, gl.R16I, gl.R16UI, gl.R8, + gl.R8I, gl.R8UI, + + gl.RGBA32F, gl.RGBA16F, gl.RGBA8_SNORM, gl.RGB32F, + gl.RGB32I, gl.RGB32UI, gl.RGB16F, gl.RGB16I, gl.RGB16UI, gl.RGB8_SNORM, + gl.RGB8I, gl.RGB8UI, gl.SRGB8, gl.R11F_G11F_B10F, gl.RGB9_E5, gl.RG32F, + gl.RG16F, gl.RG8_SNORM, gl.R32F, gl.R16F, gl.R8_SNORM + ]; + + var non3dFormats = [ + gl.DEPTH_COMPONENT32F, gl.DEPTH_COMPONENT24, gl.DEPTH_COMPONENT16, + gl.DEPTH32F_STENCIL8, gl.DEPTH24_STENCIL8 + ]; + + for (var formatNdx = 0; formatNdx < formats.length; ++formatNdx) + testSingleFormat.bind(this, formats[formatNdx]); + + if (this.m_textureTarget != gl.TEXTURE_3D) + for (var formatNdx = 0; formatNdx < non3dFormats.length; ++formatNdx) + testSingleFormat.bind(this, non3dFormats[formatNdx]); +}; + +/** +* @constructor +* @extends {tcuTestCase.DeqpTest} +*/ +es3fTextureStateQuery.TextureStateQuery = function() { + tcuTestCase.DeqpTest.call(this, 'texture', 'Texture State Query tests'); +}; + +es3fTextureStateQuery.TextureStateQuery.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fTextureStateQuery.TextureStateQuery.prototype.constructor = es3fTextureStateQuery.TextureStateQuery; + +es3fTextureStateQuery.TextureStateQuery.prototype.init = function() { + var textureTargets = [ + ['texture_2d', gl.TEXTURE_2D], + ['texture_3d', gl.TEXTURE_3D], + ['texture_2d_array', gl.TEXTURE_2D_ARRAY], + ['texture_cube_map', gl.TEXTURE_CUBE_MAP] + ]; + + var state = this; + var wrapValues = [gl.CLAMP_TO_EDGE, gl.REPEAT, gl.MIRRORED_REPEAT]; + var magValues = [gl.NEAREST, gl.LINEAR]; + var minValues = [gl.NEAREST, gl.LINEAR, gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_LINEAR]; + var modes = [gl.COMPARE_REF_TO_TEXTURE, gl.NONE]; + var compareFuncs = [gl.LEQUAL, gl.GEQUAL, gl.LESS, gl.GREATER, gl.EQUAL, gl.NOTEQUAL, gl.ALWAYS, gl.NEVER]; + textureTargets.forEach(function(elem) { + var name = elem[0]; + var target = elem[1]; + state.addChild(new es3fTextureStateQuery.IsTextureCase(name + '_is_texture', 'IsTexture', target)); + state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_wrap_s' , 'TEXTURE_WRAP_S', + target, gl.TEXTURE_WRAP_S, gl.REPEAT, wrapValues)); + if (target == gl.TEXTURE_2D || + target == gl.TEXTURE_3D || + target == gl.TEXTURE_CUBE_MAP) + state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_wrap_t' , 'TEXTURE_WRAP_T', + target, gl.TEXTURE_WRAP_T, gl.REPEAT, wrapValues)); + + if (target == gl.TEXTURE_3D) + state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_wrap_r' , 'TEXTURE_WRAP_R', + target, gl.TEXTURE_WRAP_R, gl.REPEAT, wrapValues)); + + state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_mag_filter' , 'TEXTURE_MAG_FILTER', + target, gl.TEXTURE_MAG_FILTER, gl.LINEAR, magValues)); + state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_min_filter' , 'TEXTURE_MIN_FILTER', + target, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR, minValues)); + state.addChild(new es3fTextureStateQuery.TextureLODCase(name + '_texture_min_lod' , 'TEXTURE_MIN_LOD', target, gl.TEXTURE_MIN_LOD, -1000)); + state.addChild(new es3fTextureStateQuery.TextureLODCase(name + '_texture_max_lod' , 'TEXTURE_MAX_LOD', target, gl.TEXTURE_MAX_LOD, 1000)); + state.addChild(new es3fTextureStateQuery.TextureLevelCase(name + '_texture_base_level' , 'TEXTURE_BASE_LEVEL', target, gl.TEXTURE_BASE_LEVEL, 0)); + state.addChild(new es3fTextureStateQuery.TextureLevelCase(name + '_texture_max_level' , 'TEXTURE_MAX_LEVEL', target, gl.TEXTURE_MAX_LEVEL, 1000)); + + state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_compare_mode' , 'TEXTURE_COMPARE_MODE', + target, gl.TEXTURE_COMPARE_MODE, gl.NONE, modes)); + state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_compare_func' , 'TEXTURE_COMPARE_FUNC', + target, gl.TEXTURE_COMPARE_FUNC, gl.LEQUAL, compareFuncs)); + + state.addChild(new es3fTextureStateQuery.TextureImmutableLevelsCase(name + '_texture_immutable_levels', 'TEXTURE_IMMUTABLE_LEVELS', target)); + state.addChild(new es3fTextureStateQuery.TextureImmutableFormatCase(name + '_texture_immutable_format', 'TEXTURE_IMMUTABLE_FORMAT', target)); + }); +}; + +/** +* Run test +* @param {WebGL2RenderingContext} context +*/ +es3fTextureStateQuery.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fTextureStateQuery.TextureStateQuery()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fTextureStateQuery.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js new file mode 100644 index 000000000..a6d6e96d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js @@ -0,0 +1,434 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fTextureWrapTests'); +goog.require('framework.common.tcuCompressedTexture'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexLookupVerifier'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('modules.shared.glsTextureTestUtil'); + +goog.scope(function() { + /** @type {?WebGL2RenderingContext} */ var gl; + + var es3fTextureWrapTests = functional.gles3.es3fTextureWrapTests; + var tcuTestCase = framework.common.tcuTestCase; + var gluTexture = framework.opengl.gluTexture; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var glsTextureTestUtil = modules.shared.glsTextureTestUtil; + var tcuCompressedTexture = framework.common.tcuCompressedTexture; + var deRandom = framework.delibs.debase.deRandom; + var deMath = framework.delibs.debase.deMath; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuSurface = framework.common.tcuSurface; + var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier; + var tcuTexture = framework.common.tcuTexture; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var deString = framework.delibs.debase.deString; + + /** + * @enum {number} + */ + var Viewport = { + WIDTH: 256, + HEIGHT: 256 + }; + + /** + * @constructor + * @param {Array=} bl + * @param {Array=} tr + */ + es3fTextureWrapTests.Case = function(bl, tr) { + /** @type {?Array} */ this.bottomLeft = bl || null; + /** @type {?Array} */ this.topRight = tr || null; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {?tcuCompressedTexture.Format} compressedFormat + * @param {number} wrapS + * @param {number} wrapT + * @param {number} minFilter + * @param {number} magFilter + * @param {number} width + * @param {number} height + */ + es3fTextureWrapTests.TextureWrapCase = function(name, description, compressedFormat, wrapS, wrapT, minFilter, magFilter, width, height) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {number} */ this.m_format = gl.NONE; + /** @type {number} */ this.m_dataType = gl.NONE; + /** @type {?tcuCompressedTexture.Format} */ this.m_compressedFormat = compressedFormat; + /** @type {number} */ this.m_wrapS = wrapS; + /** @type {number} */ this.m_wrapT = wrapT; + /** @type {number} */ this.m_minFilter = minFilter; + /** @type {number} */ this.m_magFilter = magFilter; + /** @type {number} */ this.m_width = width; + /** @type {number} */ this.m_height = height; + /** @type {Array} */ this.m_cases = []; + /** @type {number} */ this.m_caseNdx = 0; + /** @type {gluTexture.Texture2D} */ this.m_texture = null; + /** @type {glsTextureTestUtil.TextureRenderer} */ + this.m_renderer = new glsTextureTestUtil.TextureRenderer(gluShaderUtil.getGLSLVersionString(gluShaderUtil.GLSLVersion.V300_ES), gluShaderUtil.precision.PRECISION_MEDIUMP); + }; + + es3fTextureWrapTests.TextureWrapCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + + /** Copy the constructor */ + es3fTextureWrapTests.TextureWrapCase.prototype.constructor = es3fTextureWrapTests.TextureWrapCase; + + /** + * @param {string} name + * @param {string} description + * @param {number} format + * @param {number} dataType + * @param {number} wrapS + * @param {number} wrapT + * @param {number} minFilter + * @param {number} magFilter + * @param {number} width + * @param {number} height + * @return {es3fTextureWrapTests.TextureWrapCase} + */ + es3fTextureWrapTests.textureWrapCaseFromFormat = function(name, description, format, dataType, wrapS, wrapT, minFilter, magFilter, width, height) { + var texWrapCase = new es3fTextureWrapTests.TextureWrapCase(name, description, null, wrapS, wrapT, minFilter, magFilter, width, height); + texWrapCase.m_format = gl.RGBA; + texWrapCase.m_dataType = gl.UNSIGNED_BYTE; + return texWrapCase; + }; + + /** + */ + es3fTextureWrapTests.TextureWrapCase.prototype.init = function() { + if (this.m_compressedFormat !== null) { + // Generate compressed texture. + + assertMsgOptions(this.m_format == gl.NONE && this.m_dataType == gl.NONE, 'init/compressedFormat', false, true); + if (tcuCompressedTexture.isEtcFormat(this.m_compressedFormat)) { + // Create ETC texture. Any content is valid. + + /** @type {tcuCompressedTexture.CompressedTexture}*/ + var compressedTexture = new tcuCompressedTexture.CompressedTexture(this.m_compressedFormat, this.m_width, this.m_height); + /** @type {number} */ var dataSize = compressedTexture.getDataSize(); + /** @type {goog.NumberArray} */ var data = compressedTexture.getData(); + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name)); + + for (var i = 0; i < dataSize; i++) + data[i] = rnd.getFloat() & 0xff; + + this.m_texture = gluTexture.texture2DFromCompressedTexture(gl, 1, [compressedTexture]); + } else + throw new Error('Only ETC2 and EAC are supported.'); + } else{ + this.m_texture = gluTexture.texture2DFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height); + + // Fill level 0. + this.m_texture.getRefTexture().allocLevel(0); + tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), [-0.5, -0.5, -0.5, 2.0], [1.0, 1.0, 1.0, 0.0]); + + this.m_texture.upload(); + } + + // Sub-cases. + + this.m_cases.push(new es3fTextureWrapTests.Case([-1.5, -3.0], [1.5, 2.5])); + this.m_cases.push(new es3fTextureWrapTests.Case([-0.5, 0.75], [0.25, 1.25])); + assertMsgOptions(this.m_caseNdx == 0, 'm_caseNdx != 0', false, true); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fTextureWrapTests.TextureWrapCase.prototype.iterate = function() { + /** @type {glsTextureTestUtil.RandomViewport} */ var viewport = new glsTextureTestUtil.RandomViewport(gl.canvas, Viewport.WIDTH, Viewport.HEIGHT, deString.deStringHash(this.name) + this.m_caseNdx); + /** @type {tcuSurface.Surface} */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /** @type {tcuSurface.Surface} */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height); + /** @type {glsTextureTestUtil.ReferenceParams} */ var refParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D); + /** @type {tcuTexture.TextureFormat} */ var texFormat = this.m_texture.getRefTexture().getFormat(); + /** @type {Array} */ var texCoord; + /** @type {tcuTextureUtil.TextureFormatInfo} */ var texFormatInfo = tcuTextureUtil.getTextureFormatInfo(texFormat); + /** @type {boolean} */ var useDefaultColorScaleAndBias = true; + + // Bind to unit 0. + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture()); + + // Setup filtering and wrap modes. + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.m_wrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.m_wrapT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_magFilter); + + // Parameters for reference images. + refParams.sampler = gluTextureUtil.mapGLSamplerWrapST(this.m_wrapS, this.m_wrapT, this.m_minFilter, this.m_magFilter); + refParams.lodMode = glsTextureTestUtil.lodMode.EXACT; + refParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat()); + refParams.colorScale = useDefaultColorScaleAndBias ? texFormatInfo.lookupScale : [1.0, 1.0, 1.0, 1.0]; + refParams.colorBias = useDefaultColorScaleAndBias ? texFormatInfo.lookupBias : [0, 0, 0, 0]; + + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + texCoord = glsTextureTestUtil.computeQuadTexCoord2D(this.m_cases[this.m_caseNdx].bottomLeft, this.m_cases[this.m_caseNdx].topRight); + this.m_renderer.renderQuad(0, texCoord, refParams); + + // gluPixelTransfer.readPixels(viewport.x, viewport.y, renderedFrame.getAccess()); + /** @type {number} */ var pixelSize = renderedFrame.getAccess().getFormat().getPixelSize(); + /** @type {number} */ var param = deMath.deIsPowerOfTwo32(pixelSize) ? Math.min(pixelSize, 8) : 1; + + gl.pixelStorei(gl.PACK_ALIGNMENT, param); + /** @type {gluTextureUtil.TransferFormat} */ var format = gluTextureUtil.getTransferFormat(renderedFrame.getAccess().getFormat()); + + renderedFrame.readViewport(gl, viewport); + + // const tcu::ScopedLogSection section (log, string("Test") + de::toString(m_caseNdx), string("Test ") + de::toString(m_caseNdx)); + /** @type {boolean} */ var isNearestOnly = this.m_minFilter == gl.NEAREST && this.m_magFilter == gl.NEAREST; + /** @type {boolean} */ var isSRGB = texFormat.order == tcuTexture.ChannelOrder.sRGB || texFormat.order == tcuTexture.ChannelOrder.sRGBA; + /** @type {tcuPixelFormat.PixelFormat} */ var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8); + /** @type {Array} */ var colorBits = deMath.max(deMath.subtract(glsTextureTestUtil.getBitsVec(pixelFormat), (isNearestOnly && !isSRGB ? [1, 1, 1, 1] : [2, 2, 2, 2])), [0, 0, 0, 0]); + /** @type {tcuTexLookupVerifier.LodPrecision} */ var lodPrecision = new tcuTexLookupVerifier.LodPrecision(18, 5); + /** @type {tcuTexLookupVerifier.LookupPrecision} */ + var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision( + [20, 20, 0], + [5, 5, 0], + deMath.divide(tcuTexLookupVerifier.computeFixedPointThreshold(colorBits), refParams.colorScale), + glsTextureTestUtil.getCompareMask(pixelFormat) + ); + + // log << TestLog::Message << "Note: lookup coordinates: bottom-left " << m_cases[m_caseNdx].bottomLeft << ", top-right " << m_cases[m_caseNdx].topRight << TestLog::EndMessage; + + /** @type {boolean} */ var isOk = glsTextureTestUtil.verifyTexture2DResult(renderedFrame.getAccess(), this.m_texture.getRefTexture(), texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat); + + if (!isOk) + testFailedOptions('Case ' + this.m_caseNdx + ': verifyTexture2DResult is false', false); + else + testPassedOptions('Case ' + this.m_caseNdx + ': OK', true); + + this.m_caseNdx++; + + return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP; + }; + + /** + * Initialize test + */ + es3fTextureWrapTests.init = function() { + var testGroup = tcuTestCase.runner.testCases; + /** @type {string} */ var name; + /** + * @constructor + * @struct + * @param {string} name + * @param {number} mode + */ + var WrapMode = function(name, mode) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.mode = mode; + }; + + /** @type {Array} */ var wrapModes = [ + new WrapMode('clamp', gl.CLAMP_TO_EDGE), + new WrapMode('repeat', gl.REPEAT), + new WrapMode('mirror', gl.MIRRORED_REPEAT) + ]; + + /** + * @constructor + * @struct + * @param {string} name + * @param {number} mode + */ + var FilteringMode = function(name, mode) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.mode = mode; + }; + + /** @type {Array} */ var filteringModes = [ + new FilteringMode('nearest', gl.NEAREST), + new FilteringMode('linear', gl.LINEAR) + ]; + + /* Begin RGBA8 Cases */ + /** + * @constructor + * @struct + * @param {string} name + * @param {number} width + * @param {number} height + */ + var Rgba8Size = function(name, width, height) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.width = width; + /** @type {number} */ this.height = height; + }; + + /** @type {Array} */ var rgba8Sizes = [ + new Rgba8Size('pot', 64, 128), + new Rgba8Size('npot', 63, 112) + ]; + + for (var size = 0; size < rgba8Sizes.length; size++) { + /** @type {tcuTestCase.DeqpTest} */ var rgba8Group = tcuTestCase.newTest('rgba8', ''); + testGroup.addChild(rgba8Group); + for (var wrapS = 0; wrapS < wrapModes.length; wrapS++) { + for (var wrapT = 0; wrapT < wrapModes.length; wrapT++) { + for (var filter = 0; filter < filteringModes.length; filter++) { + name = [ + wrapModes[wrapS].name, + wrapModes[wrapT].name, + filteringModes[filter].name, + rgba8Sizes[size].name + ].join('_'); + + rgba8Group.addChild(es3fTextureWrapTests.textureWrapCaseFromFormat( + name, '', + gl.RGBA, gl.UNSIGNED_BYTE, + wrapModes[wrapS].mode, + wrapModes[wrapT].mode, + filteringModes[filter].mode, filteringModes[filter].mode, + rgba8Sizes[size].width, rgba8Sizes[size].height + )); + } + } + } + } + /* End RGBA8 Cases */ + + /* Begin ETC-2 (and EAC) cases */ + /** + * @constructor + * @struct + * @param {string} name + * @param {tcuCompressedTexture.Format} format + */ + var Etc2Format = function(name, format) { + /** @type {string} */ this.name = name; + /** @type {tcuCompressedTexture.Format} */ this.format = format; + }; + + var etc2Formats = [ + new Etc2Format('eac_r11', tcuCompressedTexture.Format.EAC_R11), + new Etc2Format('eac_signed_r11', tcuCompressedTexture.Format.EAC_SIGNED_R11), + new Etc2Format('eac_rg11', tcuCompressedTexture.Format.EAC_RG11), + new Etc2Format('eac_signed_rg11', tcuCompressedTexture.Format.EAC_SIGNED_RG11), + new Etc2Format('etc2_rgb8', tcuCompressedTexture.Format.ETC2_RGB8), + new Etc2Format('etc2_srgb8', tcuCompressedTexture.Format.ETC2_SRGB8), + new Etc2Format('etc2_rgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1), + new Etc2Format('etc2_srgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1), + new Etc2Format('etc2_eac_rgba8', tcuCompressedTexture.Format.ETC2_EAC_RGBA8), + new Etc2Format('etc2_eac_srgb8_alpha8', tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8) + ]; + if (!gluTextureUtil.enableCompressedTextureETC()) { + debug('Skipping ETC2/EAC texture format tests: no support for WEBGL_compressed_texture_etc'); + etc2Formats = []; + } + + /** + * @constructor + * @struct + * @param {string} name + * @param {number} width + * @param {number} height + */ + var Etc2Size = function(name, width, height) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.width = width; + /** @type {number} */ this.height = height; + }; + + /** @type {Array} */ var etc2Sizes = [ + new Etc2Size('pot', 64, 128), + new Etc2Size('npot', 123, 107) + ]; + + for (var formatNdx = 0; formatNdx < etc2Formats.length; formatNdx++) { + for (var size = 0; size < etc2Sizes.length; size++) { + /** @type {tcuTestCase.DeqpTest} */ var formatGroup = tcuTestCase.newTest(etc2Formats[formatNdx].name, ''); + testGroup.addChild(formatGroup); + for (var wrapS = 0; wrapS < wrapModes.length; wrapS++) { + for (var wrapT = 0; wrapT < wrapModes.length; wrapT++) { + for (var filter = 0; filter < filteringModes.length; filter++) { + name = [ + wrapModes[wrapS].name, + wrapModes[wrapT].name, + filteringModes[filter].name, + etc2Sizes[size].name + ].join('_'); + + formatGroup.addChild(new es3fTextureWrapTests.TextureWrapCase( + name, '', + etc2Formats[formatNdx].format, + wrapModes[wrapS].mode, + wrapModes[wrapT].mode, + filteringModes[filter].mode, filteringModes[filter].mode, + etc2Sizes[size].width, etc2Sizes[size].height + )); + } + } + } + } + } + }; + + /** + * Run test + * @param {WebGL2RenderingContext} context + */ + es3fTextureWrapTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var testName = 'texture_wrap'; + var testDescription = 'Texture Wrap Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.setRoot(tcuTestCase.newTest(testName, testDescription, null)); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fTextureWrapTests.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fTextureWrapTests.run tests', false); + state.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js new file mode 100644 index 000000000..5beae6985 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js @@ -0,0 +1,1914 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fTransformFeedbackTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluVarType'); +goog.require('framework.opengl.gluVarTypeUtil'); + +goog.scope(function() { + + var es3fTransformFeedbackTests = functional.gles3.es3fTransformFeedbackTests; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluVarType = framework.opengl.gluVarType; + var gluVarTypeUtil = framework.opengl.gluVarTypeUtil; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var deRandom = framework.delibs.debase.deRandom; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuImageCompare = framework.common.tcuImageCompare; + + /** @type {WebGL2RenderingContext} */ var gl; + + var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; + }; + + /** + * @enum + */ + es3fTransformFeedbackTests.State = { + DRAW: 0, + VERIFY: 1, + FINISH: 2 + }; + + /* Maximum time to wait for query result (in seconds) */ + /** @const */ es3fTransformFeedbackTests.MAX_VERIFY_WAIT = 5; + + /** @const @type {number} */ es3fTransformFeedbackTests.VIEWPORT_WIDTH = 128; + /** @const @type {number} */ es3fTransformFeedbackTests.VIEWPORT_HEIGHT = 128; + /** @const @type {number} */ es3fTransformFeedbackTests.BUFFER_GUARD_MULTIPLIER = 2; + + /** + * Enums for es3fTransformFeedbackTests.interpolation + * @enum {number} + */ + es3fTransformFeedbackTests.interpolation = { + SMOOTH: 0, + FLAT: 1, + CENTROID: 2 + + }; + + /** + * Returns es3fTransformFeedbackTests.interpolation name: smooth, flat or centroid + * @param {number} interpol es3fTransformFeedbackTests.interpolation enum value + * @return {string} + */ + es3fTransformFeedbackTests.getInterpolationName = function(interpol) { + + switch (interpol) { + case es3fTransformFeedbackTests.interpolation.SMOOTH: return 'smooth'; + case es3fTransformFeedbackTests.interpolation.FLAT: return 'flat'; + case es3fTransformFeedbackTests.interpolation.CENTROID: return 'centroid'; + default: + throw new Error('Unrecognized es3fTransformFeedbackTests.interpolation name ' + interpol); + } + + }; + + /** + * @struct + * @param {string} name + * @param {gluVarType.VarType} type + * @param {number} interpolation + * @constructor + */ + es3fTransformFeedbackTests.Varying = function(name, type, interpolation) { + this.name = name; + this.type = type; + this.interpolation = interpolation; + }; + + /** es3fTransformFeedbackTests.findAttributeNameEquals + * Replaces original implementation of "VaryingNameEquals" and "AttributeNameEquals" in the C++ version + * Returns an es3fTransformFeedbackTests.Attribute or es3fTransformFeedbackTests.Varying object which matches its name with the passed string value in the function + * @param {(Array | Array)} array + * @param {string} name + * @return { (es3fTransformFeedbackTests.Attribute | es3fTransformFeedbackTests.Varying | null)} + */ + es3fTransformFeedbackTests.findAttributeNameEquals = function(array, name) { + for (var pos = 0; pos < array.length; pos++) { + if (array[pos].name === name) { + return array[pos]; + } + } + return null; + }; + + /** + * @struct + * @param {string} name + * @param {gluVarType.VarType} type + * @param {number} offset + * @constructor + */ + es3fTransformFeedbackTests.Attribute = function(name, type, offset) { + this.name = name; + this.type = type; + this.offset = offset; + }; + + /** + * Constructs an es3fTransformFeedbackTests.Output object + * @constructor + */ + es3fTransformFeedbackTests.Output = function() { + /** @type {number} */ this.bufferNdx = 0; + /** @type {number} */ this.offset = 0; + /** @type {string} */ this.name; + /** @type {gluVarType.VarType} */ this.type = null; + /** @type {Array} */ this.inputs = []; + }; + + /** + * Constructs an object type es3fTransformFeedbackTests.DrawCall. + * Contains the number of elements as well as whether the Transform Feedback is enabled or not. + * @struct + * @param {number} numElements + * @param {boolean} tfEnabled is Transform Feedback enabled or not + * @constructor + */ + es3fTransformFeedbackTests.DrawCall = function(numElements, tfEnabled) { + this.numElements = numElements; + this.transformFeedbackEnabled = tfEnabled; + }; + + /** + * @constructor + */ + es3fTransformFeedbackTests.ProgramSpec = function() { + + /** @type {Array} */ var m_structs = []; + /** @type {Array} */ var m_varyings = []; + /** @type {Array} */ var m_transformFeedbackVaryings = []; + + this.createStruct = function(name) { + var struct = gluVarType.newStructType(name); + m_structs.push(struct); + return struct; + }; + + this.addVarying = function(name, type, interp) { + m_varyings.push(new es3fTransformFeedbackTests.Varying(name, type, interp)); + }; + + this.addTransformFeedbackVarying = function(name) { + m_transformFeedbackVaryings.push(name); + }; + + this.getStructs = function() { + return m_structs; + }; + this.getVaryings = function() { + return m_varyings; + }; + this.getTransformFeedbackVaryings = function() { + return m_transformFeedbackVaryings; + }; + + this.isPointSizeUsed = function() { + for (var i = 0; i < m_transformFeedbackVaryings.length; ++i) { + if (m_transformFeedbackVaryings[i] == 'gl_PointSize') return true; + } + return false; + }; + + }; + + /** Returns if the program is supported or not + * @param {es3fTransformFeedbackTests.ProgramSpec} spec + * @param {number} tfMode + * @return {boolean} + */ + es3fTransformFeedbackTests.isProgramSupported = function(spec, tfMode) { + var maxVertexAttribs = Number(gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + var maxTfInterleavedComponents = Number(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS)); + var maxTfSeparateAttribs = Number(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)); + var maxTfSeparateComponents = Number(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS)); + + // Check vertex attribs. + /** @type {number} */ var totalVertexAttribs = ( + 1 /* a_position */ + (spec.isPointSizeUsed() ? 1 : 0) + ); + + for (var i = 0; i < spec.getVaryings().length; ++i) { + for (var v_iter = new gluVarTypeUtil.VectorTypeIterator(spec.getVaryings()[i].type); !v_iter.end(); v_iter.next()) { + totalVertexAttribs += 1; + } + } + + if (totalVertexAttribs > maxVertexAttribs) + return false; // Vertex attribute es3fTransformFeedbackTests.count exceeded. + + // check varyings + /** @type {number} */ var totalTfComponents = 0; + /** @type {number} */ var totalTfAttribs = 0; + /** @type {Object.} */ var presetNumComponents = { + gl_Position: 4, + gl_PointSize: 1 + }; + for (var i = 0; i < spec.getTransformFeedbackVaryings().length; ++i) { + var name = spec.getTransformFeedbackVaryings()[i]; + var numComponents = 0; + + if (typeof(presetNumComponents[name]) != 'undefined') { + numComponents = presetNumComponents[name]; + } else { + var varName = gluVarTypeUtil.parseVariableName(name); + // find the varying called varName + /** @type {es3fTransformFeedbackTests.Varying} */ var varying = (function(varyings) { + for (var i = 0; i < varyings.length; ++i) { + if (varyings[i].name == varName) { + return varyings[i]; + } + } + return null; + }(spec.getVaryings())); + + // glu::TypeComponentVector + var varPath = gluVarTypeUtil.parseTypePath(name, varying.type); + numComponents = gluVarTypeUtil.getVarType(varying.type, varPath).getScalarSize(); + } + + if (tfMode == gl.SEPARATE_ATTRIBS && numComponents > maxTfSeparateComponents) + return false; // Per-attribute component es3fTransformFeedbackTests.count exceeded. + + totalTfComponents += numComponents; + totalTfAttribs += 1; + } + + if (tfMode == gl.SEPARATE_ATTRIBS && totalTfAttribs > maxTfSeparateAttribs) + return false; + + if (tfMode == gl.INTERLEAVED_ATTRIBS && totalTfComponents > maxTfInterleavedComponents) + return false; + + return true; + + }; + + /** + * @param {string} varyingName + * @param {Array} path + * @return {string} + */ + es3fTransformFeedbackTests.getAttributeName = function(varyingName, path) { + /** @type {string} */ var str = 'a_' + varyingName.substr(/^v_/.test(varyingName) ? 2 : 0); + + for (var i = 0; i < path.length; ++i) { + /** @type {string} */ var prefix; + + switch (path[i].type) { + case gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER: prefix = '_m'; break; + case gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT: prefix = '_e'; break; + case gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN: prefix = '_c'; break; + case gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT: prefix = '_s'; break; + default: + throw new Error('invalid type in the component path.'); + } + str += prefix + path[i].index; + } + return str; + }; + + /** + * original definition: + * static void es3fTransformFeedbackTests.genShaderSources (const es3fTransformFeedbackTests.ProgramSpec& spec, std::string& vertSource, std::string& fragSource, bool pointSizeRequired) + * in place of the std::string references, this function returns those params in an object + * + * @param {es3fTransformFeedbackTests.ProgramSpec} spec + * @param {boolean} pointSizeRequired + * @return {Object.} + */ + es3fTransformFeedbackTests.genShaderSources = function(spec, pointSizeRequired) { + + var vtx = { str: null }; + var frag = { str: null }; + var addPointSize = spec.isPointSizeUsed(); + + vtx.str = '#version 300 es\n' + + 'in highp vec4 a_position;\n'; + frag.str = '#version 300 es\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'uniform highp vec4 u_scale;\n' + + 'uniform highp vec4 u_bias;\n'; + //vtx.str = 'attribute highp vec4 a_position;\n'; + //frag.str = 'uniform highp vec4 u_scale;\n' + + // 'uniform highp vec4 u_bias;\n'; + + if (addPointSize) { + vtx.str += 'in highp float a_pointSize;\n'; + //vtx.str += 'attribute highp float a_pointSize;\n'; + } + + // Declare attributes. + for (var i = 0; i < spec.getVaryings().length; ++i) { + + /** @type {string} */ var name = spec.getVaryings()[i].name; + /** @type {gluVarType.VarType} */ var type = spec.getVaryings()[i].type; + + for (var vecIter = new gluVarTypeUtil.VectorTypeIterator(type); !vecIter.end(); vecIter.next()) { + + /** @type {gluVarType.VarType} */ + var attribType = gluVarTypeUtil.getVarType(type, vecIter.getPath()); + + /** @type {string} */ + var attribName = es3fTransformFeedbackTests.getAttributeName(name, vecIter.getPath()); + vtx.str += 'in ' + gluVarType.declareVariable(attribType, attribName) + ';\n'; + + } + } + + // Declare varyings. + for (var ndx = 0; ndx < 2; ++ndx) { + var inout = ndx ? 'in' : 'out'; + var shader = ndx ? frag : vtx; + + for (var i = 0; i < spec.getStructs().length; ++i) { + var struct = spec.getStructs()[i]; + if (struct.hasTypeName()) { + shader.str += gluVarType.declareStructType(struct) + ';\n'; + } + } + + /** @type {Array} */ var varyings = spec.getVaryings(); + for (var i = 0; i < varyings.length; ++i) { + var varying = varyings[i]; + shader.str += es3fTransformFeedbackTests.getInterpolationName(varying.interpolation) + + ' ' + inout + ' ' + + gluVarType.declareVariable(varying.type, varying.name) + + ';\n'; + } + } + + vtx.str += '\nvoid main (void)\n {\n' + + '\tgl_Position = a_position;\n'; + frag.str += '\nvoid main (void)\n {\n' + + '\thighp vec4 res = vec4(0.0);\n'; + + if (addPointSize) { + vtx.str += '\tgl_PointSize = a_pointSize;\n'; + } else if (pointSizeRequired) { + vtx.str += '\tgl_PointSize = 1.0;\n'; + } + + for (var i = 0; i < spec.getVaryings().length; ++i) { + var name = spec.getVaryings()[i].name; + var type = spec.getVaryings()[i].type; + + for (var vecIter = new gluVarTypeUtil.VectorTypeIterator(type); !vecIter.end(); vecIter.next()) { + /** @type {gluVarType.VarType} */var subType = gluVarTypeUtil.getVarType(type, vecIter.getPath()); + var attribName = es3fTransformFeedbackTests.getAttributeName(name, vecIter.getPath()); + + if (!( + subType.isBasicType() && + gluShaderUtil.isDataTypeScalarOrVector(subType.getBasicType()) + )) throw new Error('Not a scalar or vector.'); + + // Vertex: assign from attribute. + vtx.str += '\t' + name + vecIter.toString() + ' = ' + attribName + ';\n'; + + // Fragment: add to res variable. + var scalarSize = gluShaderUtil.getDataTypeScalarSize(subType.getBasicType()); + + frag.str += '\tres += '; + if (scalarSize == 1) frag.str += 'vec4(' + name + vecIter.toString() + ')'; + else if (scalarSize == 2) frag.str += 'vec2(' + name + vecIter.toString() + ').xxyy'; + else if (scalarSize == 3) frag.str += 'vec3(' + name + vecIter.toString() + ').xyzx'; + else if (scalarSize == 4) frag.str += 'vec4(' + name + vecIter.toString() + ')'; + + frag.str += ';\n'; + } + } + + frag.str += '\to_color = res * u_scale + u_bias;\n}\n'; + //frag.str += '\tgl_FragColor = res * u_scale + u_bias;\n}\n'; + vtx.str += '}\n'; + + return { + vertSource: vtx.str, + fragSource: frag.str + }; + }; + + /** + * Returns a Shader program + * @param {es3fTransformFeedbackTests.ProgramSpec} spec + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @return {gluShaderProgram.ShaderProgram} + */ + es3fTransformFeedbackTests.createVertexCaptureProgram = function(spec, bufferMode, primitiveType) { + + /** @type {Object.} */ var source = es3fTransformFeedbackTests.genShaderSources(spec, primitiveType === gluDrawUtil.primitiveType.POINTS /* Is point size required? */); + + var programSources = new gluShaderProgram.ProgramSources(); + programSources.add(new gluShaderProgram.VertexSource(source.vertSource)) + .add(new gluShaderProgram.FragmentSource(source.fragSource)) + .add(new gluShaderProgram.TransformFeedbackVaryings(spec.getTransformFeedbackVaryings())) + .add(new gluShaderProgram.TransformFeedbackMode(bufferMode)); + + return new gluShaderProgram.ShaderProgram(gl, programSources); + + }; + + /** + * @param {Array} attributes + * @param {Array} varyings + * @param {boolean} usePointSize + * @return {number} input stride + */ + es3fTransformFeedbackTests.computeInputLayout = function(attributes, varyings, usePointSize) { + + var inputStride = 0; + + // Add position + var dataTypeVec4 = gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.precision.PRECISION_HIGHP); + attributes.push(new es3fTransformFeedbackTests.Attribute('a_position', dataTypeVec4, inputStride)); + inputStride += 4 * 4; /*sizeof(deUint32)*/ + + if (usePointSize) { + var dataTypeFloat = gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT, gluShaderUtil.precision.PRECISION_HIGHP); + attributes.push(new es3fTransformFeedbackTests.Attribute('a_pointSize', dataTypeFloat, inputStride)); + inputStride += 1 * 4; /*sizeof(deUint32)*/ + } + + for (var i = 0; i < varyings.length; i++) { + for (var vecIter = new gluVarTypeUtil.VectorTypeIterator(varyings[i].type); !vecIter.end(); vecIter.next()) { + var type = vecIter.getType(); // originally getType() in getVarType() within gluVARTypeUtil.hpp. + var name = es3fTransformFeedbackTests.getAttributeName(varyings[i].name, vecIter.getPath()); + + attributes.push(new es3fTransformFeedbackTests.Attribute(name, type, inputStride)); + inputStride += gluShaderUtil.getDataTypeScalarSize(type.getBasicType()) * 4; /*sizeof(deUint32)*/ + } + } + + return inputStride; + }; + + /** + * @param {Array} transformFeedbackOutputs + * @param {Array} attributes + * @param {Array} varyings + * @param {Array} transformFeedbackVaryings + * @param {number} bufferMode + */ + es3fTransformFeedbackTests.computeTransformFeedbackOutputs = function(transformFeedbackOutputs, attributes, varyings, transformFeedbackVaryings, bufferMode) { + + /** @type {number} */ var accumulatedSize = 0; + + // transformFeedbackOutputs.resize(transformFeedbackVaryings.size()); + for (var varNdx = 0; varNdx < transformFeedbackVaryings.length; varNdx++) { + /** @type {string} */ var name = transformFeedbackVaryings[varNdx]; + /** @type {number} */ var bufNdx = (bufferMode === gl.SEPARATE_ATTRIBS ? varNdx : 0); + /** @type {number} */ var offset = (bufferMode === gl.SEPARATE_ATTRIBS ? 0 : accumulatedSize); + /** @type {es3fTransformFeedbackTests.Output} */ var output = new es3fTransformFeedbackTests.Output(); + + output.name = name; + output.bufferNdx = bufNdx; + output.offset = offset; + + if (name === 'gl_Position') { + var posIn = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_position'); + output.type = posIn.type; + output.inputs.push(posIn); + } else if (name === 'gl_PointSize') { + var sizeIn = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_pointSize'); + output.type = sizeIn.type; + output.inputs.push(sizeIn); + } else { + var varName = gluVarTypeUtil.parseVariableName(name); + var varying = es3fTransformFeedbackTests.findAttributeNameEquals(varyings, varName); + + var varPath = gluVarTypeUtil.parseTypePath(name, varying.type); + output.type = gluVarTypeUtil.getVarType(varying.type, varPath); + + // Add all vectorized attributes as inputs. + for (var iter = new gluVarTypeUtil.VectorTypeIterator(output.type); !iter.end(); iter.next()) { + var fullpath = varPath.concat(iter.getPath()); + var attribName = es3fTransformFeedbackTests.getAttributeName(varName, fullpath); + var attrib = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, attribName); + output.inputs.push(attrib); + } + } + transformFeedbackOutputs.push(output); + accumulatedSize += output.type.getScalarSize() * 4; /*sizeof(deUint32)*/ + } + }; + + /** + * @param {es3fTransformFeedbackTests.Attribute} attrib + * @param {ArrayBuffer} buffer + * @param {number} stride + * @param {number} numElements + * @param {deRandom.Random} rnd + */ + es3fTransformFeedbackTests.genAttributeData = function(attrib, buffer, stride, numElements, rnd) { + + /** @type {number} */ var elementSize = 4; /*sizeof(deUint32)*/ + /** @type {boolean} */ var isFloat = gluShaderUtil.isDataTypeFloatOrVec(attrib.type.getBasicType()); + /** @type {boolean} */ var isInt = gluShaderUtil.isDataTypeIntOrIVec(attrib.type.getBasicType()); + /** @type {boolean} */ var isUint = gluShaderUtil.isDataTypeUintOrUVec(attrib.type.getBasicType()); + + /** @type {gluShaderUtil.precision} */ var precision = attrib.type.getPrecision(); + + /** @type {number} */ var numComps = gluShaderUtil.getDataTypeScalarSize(attrib.type.getBasicType()); + + for (var elemNdx = 0; elemNdx < numElements; elemNdx++) { + for (var compNdx = 0; compNdx < numComps; compNdx++) { + /** @type {number} */ var offset = attrib.offset + elemNdx * stride + compNdx * elementSize; + if (isFloat) { + var pos = new Float32Array(buffer, offset, 1); + switch (precision) { + case gluShaderUtil.precision.PRECISION_LOWP: pos[0] = 0.25 * rnd.getInt(0, 4); break; + case gluShaderUtil.precision.PRECISION_MEDIUMP: pos[0] = rnd.getFloat(-1e3, 1e3); break; + case gluShaderUtil.precision.PRECISION_HIGHP: pos[0] = rnd.getFloat(-1e5, 1e5); break; + default: throw new Error('Unknown precision: ' + precision); + } + } else if (isInt) { + var pos = new Int32Array(buffer, offset, 1); + switch (precision) { + case gluShaderUtil.precision.PRECISION_LOWP: pos[0] = rnd.getInt(-128, 127); break; + case gluShaderUtil.precision.PRECISION_MEDIUMP: pos[0] = rnd.getInt(-32768, 32767); break; + case gluShaderUtil.precision.PRECISION_HIGHP: pos[0] = rnd.getInt(); break; + default: throw new Error('Unknown precision: ' + precision); + } + } else if (isUint) { + var pos = new Uint32Array(buffer, offset, 1); + switch (precision) { + case gluShaderUtil.precision.PRECISION_LOWP: pos[0] = rnd.getInt(0, 255); break; + case gluShaderUtil.precision.PRECISION_MEDIUMP: pos[0] = rnd.getInt(0, 65535); break; + case gluShaderUtil.precision.PRECISION_HIGHP: pos[0] = Math.abs(rnd.getInt()); break; + default: throw new Error('Unknown precision: ' + precision); + } + } + } + } + }; + + /** + * @param {Array} attributes + * @param {number} numInputs + * @param {number} inputStride + * @param {deRandom.Random} rnd + * @return {ArrayBuffer} + */ + es3fTransformFeedbackTests.genInputData = function(attributes, numInputs, inputStride, rnd) { + var buffer = new ArrayBuffer(numInputs * inputStride); + + var position = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_position'); + if (!position) + throw new Error('Position attribute not found.'); + + for (var ndx = 0; ndx < numInputs; ndx++) { + var pos = new Float32Array(buffer, position.offset + inputStride * ndx, 4); + pos[0] = rnd.getFloat(-1.2, 1.2); + pos[1] = rnd.getFloat(-1.2, 1.2); + pos[2] = rnd.getFloat(-1.2, 1.2); + pos[3] = rnd.getFloat(0.1, 2.0); + } + + var pointSizePos = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_pointSize'); + if (pointSizePos) { + for (var ndx = 0; ndx < numInputs; ndx++) { + var pos = new Float32Array(buffer, pointSizePos.offset + inputStride * ndx, 1); + pos[0] = rnd.getFloat(1, 8); + } + } + + // Random data for rest of components. + for (var i = 0; i < attributes.length; i++) { + if (attributes[i].name != 'a_position' && attributes[i].name != 'a_pointSize') + es3fTransformFeedbackTests.genAttributeData(attributes[i], buffer, inputStride, numInputs, rnd); + } + + return buffer; + }; + + /** + * Returns the number of outputs with the es3fTransformFeedbackTests.count for the Primitives in the Transform Feedback. + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {number} numElements + * @return {number} + */ + es3fTransformFeedbackTests.getTransformFeedbackOutputCount = function(primitiveType, numElements) { + + switch (primitiveType) { + case gluDrawUtil.primitiveType.TRIANGLES: return numElements - numElements % 3; + case gluDrawUtil.primitiveType.TRIANGLE_STRIP: return Math.max(0, numElements - 2) * 3; + case gluDrawUtil.primitiveType.TRIANGLE_FAN: return Math.max(0, numElements - 2) * 3; + case gluDrawUtil.primitiveType.LINES: return numElements - numElements % 2; + case gluDrawUtil.primitiveType.LINE_STRIP: return Math.max(0, numElements - 1) * 2; + case gluDrawUtil.primitiveType.LINE_LOOP: return numElements > 1 ? numElements * 2 : 0; + case gluDrawUtil.primitiveType.POINTS: return numElements; + default: + throw new Error('Unrecognized primitiveType ' + primitiveType); + } + + }; + + /** + * Returns a number with the es3fTransformFeedbackTests.count for the Primitives in the Transform Feedback. + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {number} numElements + * @return {number} + */ + es3fTransformFeedbackTests.getTransformFeedbackPrimitiveCount = function(primitiveType, numElements) { + + switch (primitiveType) { + case gluDrawUtil.primitiveType.TRIANGLES: return Math.floor(numElements / 3); + case gluDrawUtil.primitiveType.TRIANGLE_STRIP: return Math.max(0, numElements - 2); + case gluDrawUtil.primitiveType.TRIANGLE_FAN: return Math.max(0, numElements - 2); + case gluDrawUtil.primitiveType.LINES: return Math.floor(numElements / 2); + case gluDrawUtil.primitiveType.LINE_STRIP: return Math.max(0, numElements - 1); + case gluDrawUtil.primitiveType.LINE_LOOP: return numElements > 1 ? numElements : 0; + case gluDrawUtil.primitiveType.POINTS: return numElements; + default: + throw new Error('Unrecognized primitiveType ' + primitiveType); + } + + }; + + /** + * Returns the type of Primitive Mode: Triangles for all Triangle Primitive's type and same for Line and Points. + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @return {number} primitiveType + */ + es3fTransformFeedbackTests.getTransformFeedbackPrimitiveMode = function(primitiveType) { + + switch (primitiveType) { + case gluDrawUtil.primitiveType.TRIANGLES: + case gluDrawUtil.primitiveType.TRIANGLE_STRIP: + case gluDrawUtil.primitiveType.TRIANGLE_FAN: + return gl.TRIANGLES; + + case gluDrawUtil.primitiveType.LINES: + case gluDrawUtil.primitiveType.LINE_STRIP: + case gluDrawUtil.primitiveType.LINE_LOOP: + return gl.LINES; + + case gluDrawUtil.primitiveType.POINTS: + return gl.POINTS; + + default: + throw new Error('Unrecognized primitiveType ' + primitiveType); + } + + }; + + /** + * Returns the attribute index for a certain primitive type. + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {number} numInputs + * @param {number} outNdx + * @return {number} + */ + es3fTransformFeedbackTests.getAttributeIndex = function(primitiveType, numInputs, outNdx) { + + switch (primitiveType) { + + case gluDrawUtil.primitiveType.TRIANGLES: return outNdx; + case gluDrawUtil.primitiveType.LINES: return outNdx; + case gluDrawUtil.primitiveType.POINTS: return outNdx; + + case gluDrawUtil.primitiveType.TRIANGLE_STRIP: { + /** @type {number} */ var triNdx = outNdx / 3; + /** @type {number} */ var vtxNdx = outNdx % 3; + return (triNdx % 2 != 0 && vtxNdx < 2) ? (triNdx + 1 - vtxNdx) : (triNdx + vtxNdx); + } + + case gluDrawUtil.primitiveType.TRIANGLE_FAN: + return (outNdx % 3 != 0) ? (outNdx / 3 + outNdx % 3) : 0; + + case gluDrawUtil.primitiveType.LINE_STRIP: + return outNdx / 2 + outNdx % 2; + + case gluDrawUtil.primitiveType.LINE_LOOP: { + var inNdx = outNdx / 2 + outNdx % 2; + return inNdx < numInputs ? inNdx : 0; + } + + default: + throw new Error('Unrecognized primitiveType ' + primitiveType); + } + + }; + + /** + * @param {gluDrawUtil.primitiveType} primitiveType type number in gluDrawUtil.primitiveType + * @param {es3fTransformFeedbackTests.Output} output + * @param {number} numInputs + * @param {Object} buffers + * @return {boolean} isOk + */ + es3fTransformFeedbackTests.compareTransformFeedbackOutput = function(primitiveType, output, numInputs, buffers) { + /** @type {boolean} */ var isOk = true; + /** @type {number} */ var outOffset = output.offset; + + for (var attrNdx = 0; attrNdx < output.inputs.length; attrNdx++) { + /** @type {es3fTransformFeedbackTests.Attribute} */ var attribute = output.inputs[attrNdx]; + /** @type {gluShaderUtil.DataType} */ var type = attribute.type.getBasicType(); + /** @type {number} */ var numComponents = gluShaderUtil.getDataTypeScalarSize(type); + + /** @type {gluShaderUtil.precision} */ var precision = attribute.type.getPrecision(); + + /** @type {string} */ var scalarType = gluShaderUtil.getDataTypeScalarType(type); + /** @type {number} */ var numOutputs = es3fTransformFeedbackTests.getTransformFeedbackOutputCount(primitiveType, numInputs); + + for (var outNdx = 0; outNdx < numOutputs; outNdx++) { + /** @type {number} */ var inNdx = es3fTransformFeedbackTests.getAttributeIndex(primitiveType, numInputs, outNdx); + + for (var compNdx = 0; compNdx < numComponents; compNdx++) { + /** @type {boolean} */ var isEqual = false; + + if (scalarType === 'float') { + var outBuffer = new Float32Array(buffers.output.buffer, buffers.output.offset + buffers.output.stride * outNdx + outOffset + compNdx * 4, 1); + var inBuffer = new Float32Array(buffers.input.buffer, buffers.input.offset + buffers.input.stride * inNdx + attribute.offset + compNdx * 4, 1); + var difInOut = inBuffer[0] - outBuffer[0]; + /* TODO: Original code used ULP comparison for highp and mediump precision. This could cause failures. */ + switch (precision) { + case gluShaderUtil.precision.PRECISION_HIGHP: { + isEqual = Math.abs(difInOut) < 0.1; + break; + } + + case gluShaderUtil.precision.PRECISION_MEDIUMP: { + isEqual = Math.abs(difInOut) < 0.1; + break; + } + + case gluShaderUtil.precision.PRECISION_LOWP: { + isEqual = Math.abs(difInOut) < 0.1; + break; + } + default: + throw new Error('Unknown precision: ' + precision); + } + } else { + var outBuffer = new Uint32Array(buffers.output.buffer, buffers.output.offset + buffers.output.stride * outNdx + outOffset + compNdx * 4, 1); + var inBuffer = new Uint32Array(buffers.input.buffer, buffers.input.offset + buffers.input.stride * inNdx + attribute.offset + compNdx * 4, 1); + isEqual = (inBuffer[0] == outBuffer[0]); // Bit-exact match required for integer types. + } + + if (!isEqual) { + bufferedLogToConsole('Mismatch in ' + output.name + ' (' + attribute.name + '), output = ' + outNdx + ', input = ' + inNdx + ', component = ' + compNdx); + isOk = false; + break; + } + } + + if (!isOk) + break; + } + + if (!isOk) + break; + + outOffset += numComponents * 4; /*sizeof(deUint32)*/ + } + + return isOk; + }; + + /** + * Returns (for all the draw calls) the type of Primitive Mode, as it calls "es3fTransformFeedbackTests.getTransformFeedbackPrimitiveCount". + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {Array} array Object. + * @return {number} primCount + */ + es3fTransformFeedbackTests.computeTransformFeedbackPrimitiveCount = function(primitiveType, array) { + + /** @type {number} */ var primCount = 0; + + for (var i = 0; i < array.length; ++ i) { + + if (array[i].transformFeedbackEnabled) + primCount += es3fTransformFeedbackTests.getTransformFeedbackPrimitiveCount(primitiveType, array[i].numElements); + } + + return primCount; + }; + + /** + * @param {number} target + * @param {number} bufferSize + * @param {number} guardSize + */ + es3fTransformFeedbackTests.writeBufferGuard = function(target, bufferSize, guardSize) { + var buffer = new ArrayBuffer(guardSize); + var view = new Uint8Array(buffer); + for (var i = 0; i < guardSize; ++i) view[i] = 0xcd; + gl.bufferSubData(target, bufferSize, buffer); + }; + + /** + * Verifies guard + * @param {ArrayBuffer} buffer + * @param {number} start + * @return {boolean} + */ + es3fTransformFeedbackTests.verifyGuard = function(buffer, start) { + start = start || 0; + var view = new Uint8Array(buffer, start); + for (var i = 0; i < view.length; i++) { + if (view[i] != 0xcd) + return false; + } + return true; + }; + + /** + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @constructor + */ + es3fTransformFeedbackTests.TransformFeedbackCase = function(name, desc, bufferMode, primitiveType) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_bufferMode = bufferMode; + this.m_primitiveType = primitiveType; + this.m_progSpec = new es3fTransformFeedbackTests.ProgramSpec(); + + // Derived from es3fTransformFeedbackTests.ProgramSpec in es3fTransformFeedbackTests.init() + this.m_inputStride = 0; + this.m_attributes = []; // vector + this.m_transformFeedbackOutputs = []; // vector + this.m_bufferStrides = []; // vector + + // GL state. + this.m_program = null; // glu::ShaderProgram + this.m_transformFeedback = null; // glu::TransformFeedback + this.m_outputBuffers = []; // vector + + this.m_iterNdx = 0; // int + this.m_testPassed = true; + // State machine + this.m_state = es3fTransformFeedbackTests.State.DRAW; + this.m_verifyStart = null; + + this.m_frameWithTf = null; + this.m_frameWithoutTf = null; + + this.m_viewportW = 0; + this.m_viewportH = 0; + this.m_viewportX = 0; + this.m_viewportY = 0; + + this.m_primitiveQuery = null; + this.m_outputsOk = true; + + }; + + setParentClass(es3fTransformFeedbackTests.TransformFeedbackCase, tcuTestCase.DeqpTest); + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.createVerificationResult = function(retry, result) { + return { retry: retry, result: result }; + } + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.dumpShaderText = function() { + var dbgext = gl.getExtension('WEBGL_debug_shaders'); + for (var ii = 0; ii < this.m_program.shaders.length; ++ii) { + debug('Shader source ' + ii + ' before translation:') + debug(this.m_program.shaders[ii].info.source); + debug(''); + debug('Shader source ' + ii + ' after translation:'); + debug(dbgext.getTranslatedShaderSource(this.m_program.shaders[ii].shader)); + } + }; + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.init = function() { + this.m_program = es3fTransformFeedbackTests.createVertexCaptureProgram( + this.m_progSpec, + this.m_bufferMode, + this.m_primitiveType + ); + + if (!this.m_program.isOk()) { + // this.dumpShaderText(); + + var linkFail = this.m_program.shadersOK && + !this.m_program.getProgramInfo().linkOk; + + if (linkFail) { + if (!es3fTransformFeedbackTests.isProgramSupported(this.m_progSpec, this.m_bufferMode)) { + var msg = 'Not Supported. Implementation limits exceeded.'; + checkMessage(false, msg); + throw new TestFailedException(msg); + } else if (es3fTransformFeedbackTests.hasArraysInTFVaryings(this.m_progSpec)) { + msg = 'Capturing arrays is not supported (undefined in specification)'; + checkMessage(false, msg); + throw new TestFailedException(msg); + } else { + throw new Error('Link failed: ' + this.m_program.getProgramInfo().infoLog); + } + } else { + throw new Error('Compile failed'); + } + } else { + // debug('Program is ' + + // (gl.getProgramParameter(this.m_program.getProgram(), gl.LINK_STATUS) ? 'linked' : 'not linked')); + // this.dumpShaderText(); + } + +// bufferedLogToConsole('Transform feedback varyings: ' + tcu.formatArray(this.m_progSpec.getTransformFeedbackVaryings())); + bufferedLogToConsole('Transform feedback varyings: ' + this.m_progSpec.getTransformFeedbackVaryings()); + + // Print out transform feedback points reported by GL. + // bufferedLogToConsole('Transform feedback varyings reported by compiler:'); + //logTransformFeedbackVaryings(log, gl, this.m_program.getProgram()); + + // Compute input specification. + this.m_inputStride = es3fTransformFeedbackTests.computeInputLayout(this.m_attributes, this.m_progSpec.getVaryings(), this.m_progSpec.isPointSizeUsed()); + + // Build list of varyings used in transform feedback. + es3fTransformFeedbackTests.computeTransformFeedbackOutputs( + this.m_transformFeedbackOutputs, + this.m_attributes, + this.m_progSpec.getVaryings(), + this.m_progSpec.getTransformFeedbackVaryings(), + this.m_bufferMode + ); + if (!this.m_transformFeedbackOutputs.length) { + throw new Error('transformFeedbackOutputs cannot be empty.'); + } + + if (this.m_bufferMode == gl.SEPARATE_ATTRIBS) { + for (var i = 0; i < this.m_transformFeedbackOutputs.length; ++i) { + this.m_bufferStrides.push(this.m_transformFeedbackOutputs[i].type.getScalarSize() * 4 /*sizeof(deUint32)*/); + } + } else { + var totalSize = 0; + for (var i = 0; i < this.m_transformFeedbackOutputs.length; ++i) { + totalSize += this.m_transformFeedbackOutputs[i].type.getScalarSize() * 4 /*sizeof(deUint32)*/; + } + this.m_bufferStrides.push(totalSize); + } + + this.m_outputBuffers.length = this.m_bufferStrides.length; + for (var i = 0; i < this.m_outputBuffers.length; i++) + this.m_outputBuffers[i] = gl.createBuffer(); + + this.m_transformFeedback = gl.createTransformFeedback(); + + this.m_iterNdx = 0; +// this.m_testCtx.setTestResult(QP_TEST_RESULT_PASS, 'Pass'); + + }; + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.deinit = function() { + for (var i = 0; i < this.m_outputBuffers.length; i++) + gl.deleteBuffer(this.m_outputBuffers[i]); + + // delete this.m_transformFeedback; + this.m_transformFeedback = null; + + // delete this.m_program; + this.m_program = null; + + // Clean up state. + this.m_attributes = []; + this.m_transformFeedbackOutputs = []; + this.m_bufferStrides = []; + this.m_inputStride = 0; + + }; + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.iterate = function() { + var s = es3fTransformFeedbackTests.TransformFeedbackCase.s_iterate; + var numIterations = s.iterations.length; + var seed = deMath.deMathHash(this.m_iterNdx); + switch(this.m_state) { + case es3fTransformFeedbackTests.State.DRAW: + bufferedLogToConsole('Testing ' + + s.testCases[s.iterations[this.m_iterNdx]].length + + ' draw calls, (element es3fTransformFeedbackTests.count, TF state): ' + + s.testCases[s.iterations[this.m_iterNdx]] + ); + this.draw(s.testCases[s.iterations[this.m_iterNdx]], seed); + this.m_state = es3fTransformFeedbackTests.State.VERIFY; + break; + case es3fTransformFeedbackTests.State.VERIFY: + var verifyResult = this.verify(s.testCases[s.iterations[this.m_iterNdx]]); + if (verifyResult.retry) { + break; + } + this.m_testPassed = verifyResult.result; + this.m_iterNdx += 1; + if (this.m_testPassed && this.m_iterNdx < numIterations) { + this.m_state = es3fTransformFeedbackTests.State.DRAW; + break; + } + // Fall through + case es3fTransformFeedbackTests.State.FINISH: + if (!this.m_testPassed) testFailedOptions('Result comparison failed for iteration ' + s.iterations[this.m_iterNdx - 1], false); + else testPassedOptions('Result comparison succeeded', true); + return tcuTestCase.IterateResult.STOP; + } + + return tcuTestCase.IterateResult.CONTINUE; + + }; + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.draw = function(calls, seed) { + var _min = function(x, y) { return x < y ? x : y; }; + + var rnd = new deRandom.Random(seed); + var numInputs = 0; + var numOutputs = 0; + var width = gl.drawingBufferWidth; + var height = gl.drawingBufferHeight; + this.m_viewportW = _min(es3fTransformFeedbackTests.VIEWPORT_WIDTH, width); + this.m_viewportH = _min(es3fTransformFeedbackTests.VIEWPORT_HEIGHT, height); + this.m_viewportX = rnd.getInt(0, width - this.m_viewportW); + this.m_viewportY = rnd.getInt(0, height - this.m_viewportH); + this.m_frameWithTf = new tcuSurface.Surface(this.m_viewportW, this.m_viewportH); // tcu::Surface + this.m_frameWithoutTf = new tcuSurface.Surface(this.m_viewportW, this.m_viewportH); // tcu::Surface + this.m_primitiveQuery = gl.createQuery(); + this.m_outputsOk = true; + + // Compute totals. + for (var i = 0; i < calls.length; ++i) { + var call = calls[i]; + numInputs += call.numElements; + numOutputs += call.transformFeedbackEnabled ? es3fTransformFeedbackTests.getTransformFeedbackOutputCount(this.m_primitiveType, call.numElements) : 0; + } + + // Input data. + var inputData = es3fTransformFeedbackTests.genInputData(this.m_attributes, numInputs, this.m_inputStride, rnd); + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, this.m_transformFeedback); + + // Allocate storage for transform feedback output buffers and bind to targets. + for (var bufNdx = 0; bufNdx < this.m_outputBuffers.length; ++bufNdx) { + var buffer = this.m_outputBuffers[bufNdx]; // deUint32 + var stride = this.m_bufferStrides[bufNdx]; // int + var target = bufNdx; // int + var size = stride * numOutputs; // int + var guardSize = stride * es3fTransformFeedbackTests.BUFFER_GUARD_MULTIPLIER; // int + var usage = gl.DYNAMIC_READ; // const deUint32 + + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buffer); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, size + guardSize, usage); + es3fTransformFeedbackTests.writeBufferGuard(gl.TRANSFORM_FEEDBACK_BUFFER, size, guardSize); + + // \todo [2012-07-30 pyry] glBindBufferRange()? + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, target, buffer); + } + + var attribBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, attribBuffer); + gl.bufferData(gl.ARRAY_BUFFER, inputData, gl.STATIC_DRAW); + + // Setup attributes. + for (var i = 0; i < this.m_attributes.length; ++i) { + var attrib = this.m_attributes[i]; + var loc = gl.getAttribLocation(this.m_program.getProgram(), attrib.name); + /** @type {string} */ + var scalarType = gluShaderUtil.getDataTypeScalarType(attrib.type.getBasicType()); + /** @type {number} */ + var numComponents = gluShaderUtil.getDataTypeScalarSize(attrib.type.getBasicType()); + + if (loc >= 0) { + gl.enableVertexAttribArray(loc); + switch (scalarType) { + case 'float': + gl.vertexAttribPointer(loc, numComponents, gl.FLOAT, false, this.m_inputStride, attrib.offset); break; + case 'int': + gl.vertexAttribIPointer(loc, numComponents, gl.INT, this.m_inputStride, attrib.offset); break; + case 'uint': + gl.vertexAttribIPointer(loc, numComponents, gl.UNSIGNED_INT, this.m_inputStride, attrib.offset); break; + } + } + } + + // Setup viewport. + gl.viewport(this.m_viewportX, this.m_viewportY, this.m_viewportW, this.m_viewportH); + + // Setup program. + gl.useProgram(this.m_program.getProgram()); + + gl.uniform4fv( + gl.getUniformLocation(this.m_program.getProgram(), 'u_scale'), + [0.01, 0.01, 0.01, 0.01] + ); + gl.uniform4fv( + gl.getUniformLocation(this.m_program.getProgram(), 'u_bias'), + [0.5, 0.5, 0.5, 0.5] + ); + + // Enable query. + gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, this.m_primitiveQuery); + + // Draw + var offset = 0; + var tfEnabled = true; + + gl.clear(gl.COLOR_BUFFER_BIT); + + var tfPrimitiveMode = es3fTransformFeedbackTests.getTransformFeedbackPrimitiveMode(this.m_primitiveType); + gl.beginTransformFeedback(tfPrimitiveMode); + + for (var i = 0; i < calls.length; ++i) { + var call = calls[i]; + + // Pause or resume transform feedback if necessary. + if (call.transformFeedbackEnabled != tfEnabled) { + if (call.transformFeedbackEnabled) + gl.resumeTransformFeedback(); + else + gl.pauseTransformFeedback(); + tfEnabled = call.transformFeedbackEnabled; + } + + gl.drawArrays(gluDrawUtil.getPrimitiveGLType(gl, this.m_primitiveType), offset, call.numElements); + offset += call.numElements; + } + + // Resume feedback before finishing it. + if (!tfEnabled) + gl.resumeTransformFeedback(); + + gl.endTransformFeedback(); + + gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); + + // Check and log query status right after submit + var query = this.m_primitiveQuery; + + var available = gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE); + + if (available) { + this.m_testPassed = false; + this.m_state = es3fTransformFeedbackTests.State.FINISH; + testFailedOptions('Transform feedback query result must not be available the same frame as they are issued.', true); + } + + // Compare result buffers. + for (var bufferNdx = 0; bufferNdx < this.m_outputBuffers.length; ++bufferNdx) { + var stride = this.m_bufferStrides[bufferNdx]; // int + var size = stride * numOutputs; // int + var guardSize = stride * es3fTransformFeedbackTests.BUFFER_GUARD_MULTIPLIER; // int + var buffer = new ArrayBuffer(size + guardSize); // const void* + + // Bind buffer for reading. + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, this.m_outputBuffers[bufferNdx]); + + gl.getBufferSubData(gl.TRANSFORM_FEEDBACK_BUFFER, 0, new Uint8Array(buffer)); + + // Verify all output variables that are written to this buffer. + for (var i = 0; i < this.m_transformFeedbackOutputs.length; ++i) { + var out = this.m_transformFeedbackOutputs[i]; + + if (out.bufferNdx != bufferNdx) + continue; + + var inputOffset = 0; + var outputOffset = 0; + + // Process all draw calls and check ones with transform feedback enabled + for (var callNdx = 0; callNdx < calls.length; ++callNdx) { + var call = calls[callNdx]; + + if (call.transformFeedbackEnabled) { + var inputPtr = inputData[0] + inputOffset * this.m_inputStride; // const deUint8* + var outputPtr = outputOffset * stride; // const deUint8* + + if (!es3fTransformFeedbackTests.compareTransformFeedbackOutput(this.m_primitiveType, out, call.numElements, { + input: { + buffer: inputData, + offset: inputOffset * this.m_inputStride, + stride: this.m_inputStride + }, + output: { + buffer: buffer, + offset: outputOffset * stride, + stride: stride + } + })) { + this.m_outputsOk = false; + break; + } + } + + inputOffset += call.numElements; + outputOffset += call.transformFeedbackEnabled ? es3fTransformFeedbackTests.getTransformFeedbackOutputCount(this.m_primitiveType, call.numElements) : 0; + } + } + + // Verify guardband. + if (!es3fTransformFeedbackTests.verifyGuard(buffer, size)) { + bufferedLogToConsole('Error: Transform feedback buffer overrun detected'); + this.m_outputsOk = false; + } + } + }; + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.verify = function(calls) { + // Check status after mapping buffers. + var mustBeReady = this.m_outputBuffers.length > 0; // Mapping buffer forces synchronization. // const bool + var expectedCount = es3fTransformFeedbackTests.computeTransformFeedbackPrimitiveCount(this.m_primitiveType, calls); // const int + var available = /** @type {boolean} */ (gl.getQueryParameter(this.m_primitiveQuery, gl.QUERY_RESULT_AVAILABLE)); + var verify_offset = 0; + var queryOk = true; + if (!available) { + if (!this.m_verifyStart) + this.m_verifyStart = new Date(); + else { + var current = new Date(); + var elapsedTime = 0.001 * (current.getTime() - this.m_verifyStart.getTime()); + if (elapsedTime > es3fTransformFeedbackTests.MAX_VERIFY_WAIT) { + testFailed('Query result not available after ' + elapsedTime + ' seconds.'); + this.m_state = es3fTransformFeedbackTests.State.FINISH; + return this.createVerificationResult(false, false); + } + } + return this.createVerificationResult(true, false); + } + + var numPrimitives = /** @type {number} */ (gl.getQueryParameter(this.m_primitiveQuery, gl.QUERY_RESULT)); + + if (!mustBeReady && available == false) + bufferedLogToConsole('ERROR: gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN result not available after mapping buffers!'); + + bufferedLogToConsole('gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = ' + numPrimitives); + + if (numPrimitives != expectedCount) { + queryOk = false; + bufferedLogToConsole('ERROR: Expected ' + expectedCount + ' primitives!'); + } + + // Clear transform feedback state. + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + for (var bufNdx = 0; bufNdx < this.m_outputBuffers.length; ++bufNdx) { + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, null); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, bufNdx, null); + } + + gl.bindBuffer(gl.ARRAY_BUFFER, null); + + // Read back rendered image. + this.m_frameWithTf.readViewport(gl, [this.m_viewportX, this.m_viewportY, this.m_viewportW, this.m_viewportH]); + + // Render without transform feedback. + + gl.clear(gl.COLOR_BUFFER_BIT); + + for (var i = 0; i < calls.length; ++i) { + var call = calls[i]; + gl.drawArrays(gluDrawUtil.getPrimitiveGLType(gl, this.m_primitiveType), verify_offset, call.numElements); + verify_offset += call.numElements; + } + this.m_frameWithoutTf.readViewport(gl, [this.m_viewportX, this.m_viewportY, this.m_viewportW, this.m_viewportH]); + + // Compare images with and without transform feedback. + var imagesOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', this.m_frameWithoutTf, this.m_frameWithTf, [1, 1, 1, 1], tcuImageCompare.CompareLogMode.ON_ERROR); + + if (imagesOk) + bufferedLogToConsole('Rendering result comparison between TF enabled and TF disabled passed.'); + else + bufferedLogToConsole('ERROR: Rendering result comparison between TF enabled and TF disabled failed!'); + + return this.createVerificationResult(false, this.m_outputsOk && imagesOk && queryOk); + + }; + + es3fTransformFeedbackTests.dc = function(numElements, tfEnabled) { + return new es3fTransformFeedbackTests.DrawCall(numElements, tfEnabled); + }; + + // static data + es3fTransformFeedbackTests.TransformFeedbackCase.s_iterate = { + + testCases: { + elemCount1: [es3fTransformFeedbackTests.dc(1, true)], + elemCount2: [es3fTransformFeedbackTests.dc(2, true)], + elemCount3: [es3fTransformFeedbackTests.dc(3, true)], + elemCount4: [es3fTransformFeedbackTests.dc(4, true)], + elemCount123: [es3fTransformFeedbackTests.dc(123, true)], + basicPause1: [es3fTransformFeedbackTests.dc(64, true), es3fTransformFeedbackTests.dc(64, false), es3fTransformFeedbackTests.dc(64, true)], + basicPause2: [es3fTransformFeedbackTests.dc(13, true), es3fTransformFeedbackTests.dc(5, true), es3fTransformFeedbackTests.dc(17, false), + es3fTransformFeedbackTests.dc(3, true), es3fTransformFeedbackTests.dc(7, false)], + startPaused: [es3fTransformFeedbackTests.dc(123, false), es3fTransformFeedbackTests.dc(123, true)], + random1: [es3fTransformFeedbackTests.dc(65, true), es3fTransformFeedbackTests.dc(135, false), es3fTransformFeedbackTests.dc(74, true), + es3fTransformFeedbackTests.dc(16, false), es3fTransformFeedbackTests.dc(226, false), es3fTransformFeedbackTests.dc(9, true), + es3fTransformFeedbackTests.dc(174, false)], + random2: [es3fTransformFeedbackTests.dc(217, true), es3fTransformFeedbackTests.dc(171, true), es3fTransformFeedbackTests.dc(147, true), + es3fTransformFeedbackTests.dc(152, false), es3fTransformFeedbackTests.dc(55, true)] + }, + iterations: [ + 'elemCount1', 'elemCount2', 'elemCount3', 'elemCount4', 'elemCount123', + 'basicPause1', 'basicPause2', 'startPaused', + 'random1', 'random2' + ] + }; + + es3fTransformFeedbackTests.hasArraysInTFVaryings = function(spec) { + + for (var i = 0; i < spec.getTransformFeedbackVaryings().length; ++i) { + var tfVar = spec.getTransformFeedbackVaryings()[i]; + var varName = gluVarTypeUtil.parseVariableName(tfVar); + + var attr = es3fTransformFeedbackTests.findAttributeNameEquals(spec.getVaryings(), varName); + if (attr && attr.type.isArrayType()) + return true; + } + return false; + + }; + + /** es3fTransformFeedbackTests.PositionCase + * @extends {es3fTransformFeedbackTests.TransformFeedbackCase} + * @param {string} name + * @param {string} desc + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @constructor + */ + es3fTransformFeedbackTests.PositionCase = function(name, desc, bufferMode, primitiveType) { + es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType); + this.m_progSpec.addTransformFeedbackVarying('gl_Position'); + }; + + setParentClass(es3fTransformFeedbackTests.PositionCase, es3fTransformFeedbackTests.TransformFeedbackCase); + + /** es3fTransformFeedbackTests.PointSizeCase + * @extends {es3fTransformFeedbackTests.TransformFeedbackCase} + * @param {string} name + * @param {string} desc + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @constructor + */ + es3fTransformFeedbackTests.PointSizeCase = function(name, desc, bufferMode, primitiveType) { + es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType); + this.m_progSpec.addTransformFeedbackVarying('gl_PointSize'); + + }; + + setParentClass(es3fTransformFeedbackTests.PointSizeCase, es3fTransformFeedbackTests.TransformFeedbackCase); + + /** es3fTransformFeedbackTests.BasicTypeCase + * @extends {es3fTransformFeedbackTests.TransformFeedbackCase} + * @param {string} name + * @param {string} desc + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {gluShaderUtil.DataType} type + * @param {gluShaderUtil.precision} precision + * @param {es3fTransformFeedbackTests.interpolation} interpolation enum number in this javascript + * @constructor + */ + es3fTransformFeedbackTests.BasicTypeCase = function(name, desc, bufferMode, primitiveType, type, precision, interpolation) { + es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType); + + this.m_progSpec.addVarying('v_varA', gluVarType.newTypeBasic(type, precision), interpolation); + this.m_progSpec.addVarying('v_varB', gluVarType.newTypeBasic(type, precision), interpolation); + + this.m_progSpec.addTransformFeedbackVarying('v_varA'); + this.m_progSpec.addTransformFeedbackVarying('v_varB'); + + }; + + setParentClass(es3fTransformFeedbackTests.BasicTypeCase, es3fTransformFeedbackTests.TransformFeedbackCase); + + /** es3fTransformFeedbackTests.BasicArrayCase + * @extends {es3fTransformFeedbackTests.TransformFeedbackCase} + * @param {string} name + * @param {string} desc + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {gluShaderUtil.DataType} type + * @param {gluShaderUtil.precision} precision + * @param {es3fTransformFeedbackTests.interpolation} interpolation enum number in this javascript + * @constructor + */ + es3fTransformFeedbackTests.BasicArrayCase = function(name, desc, bufferMode, primitiveType, type, precision, interpolation) { + es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType); + + if (gluShaderUtil.isDataTypeMatrix(type) || this.m_bufferMode === gl.SEPARATE_ATTRIBS) { + // note For matrix types we need to use reduced array sizes or otherwise we will exceed maximum attribute (16) + // or transform feedback component es3fTransformFeedbackTests.count (64). + // On separate attribs mode maximum component es3fTransformFeedbackTests.count per varying is 4. + this.m_progSpec.addVarying('v_varA', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 1), interpolation); + this.m_progSpec.addVarying('v_varB', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 2), interpolation); + } else { + this.m_progSpec.addVarying('v_varA', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 3), interpolation); + this.m_progSpec.addVarying('v_varB', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 4), interpolation); + } + + this.m_progSpec.addTransformFeedbackVarying('v_varA'); + this.m_progSpec.addTransformFeedbackVarying('v_varB'); + + }; + + setParentClass(es3fTransformFeedbackTests.BasicArrayCase, es3fTransformFeedbackTests.TransformFeedbackCase); + + /** es3fTransformFeedbackTests.ArrayElementCase + * @extends {es3fTransformFeedbackTests.TransformFeedbackCase} + * @param {string} name + * @param {string} desc + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {gluShaderUtil.DataType} type + * @param {gluShaderUtil.precision} precision + * @param {es3fTransformFeedbackTests.interpolation} interpolation enum number in this javascript + * @constructor + */ + es3fTransformFeedbackTests.ArrayElementCase = function(name, desc, bufferMode, primitiveType, type, precision, interpolation) { + + es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType); + + this.m_progSpec.addVarying('v_varA', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 3), interpolation); + this.m_progSpec.addVarying('v_varB', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 4), interpolation); + + this.m_progSpec.addTransformFeedbackVarying('v_varA[1]'); + this.m_progSpec.addTransformFeedbackVarying('v_varB[0]'); + this.m_progSpec.addTransformFeedbackVarying('v_varB[3]'); + + }; + + setParentClass(es3fTransformFeedbackTests.ArrayElementCase, es3fTransformFeedbackTests.TransformFeedbackCase); + + /** es3fTransformFeedbackTests.RandomCase + * @extends {es3fTransformFeedbackTests.TransformFeedbackCase} + * @param {string} name + * @param {string} desc + * @param {number} bufferMode + * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is + * @param {number} seed + * @constructor + */ + es3fTransformFeedbackTests.RandomCase = function(name, desc, bufferMode, primitiveType, seed) { + es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType); + + }; + + setParentClass(es3fTransformFeedbackTests.RandomCase, es3fTransformFeedbackTests.TransformFeedbackCase); + + es3fTransformFeedbackTests.RandomCase.prototype.init = function() { + + /** @type {number} */ + var seed = /*deString.deStringHash(getName()) ^ */ deMath.deMathHash(this.m_iterNdx); + + /** @type {Array} */ + var typeCandidates = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4, + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4, + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4, + + gluShaderUtil.DataType.FLOAT_MAT2, + gluShaderUtil.DataType.FLOAT_MAT2X3, + gluShaderUtil.DataType.FLOAT_MAT2X4, + + gluShaderUtil.DataType.FLOAT_MAT3X2, + gluShaderUtil.DataType.FLOAT_MAT3, + gluShaderUtil.DataType.FLOAT_MAT3X4, + + gluShaderUtil.DataType.FLOAT_MAT4X2, + gluShaderUtil.DataType.FLOAT_MAT4X3, + gluShaderUtil.DataType.FLOAT_MAT4 + ]; + + /** @type {Array} */ + var precisions = [ + gluShaderUtil.precision.PRECISION_LOWP, + gluShaderUtil.precision.PRECISION_MEDIUMP, + gluShaderUtil.precision.PRECISION_HIGHP + ]; + + var interpModes = [{name: 'smooth', interp: es3fTransformFeedbackTests.interpolation.SMOOTH}, {name: 'flat', interp: es3fTransformFeedbackTests.interpolation.FLAT}, {name: 'centroid', interp: es3fTransformFeedbackTests.interpolation.CENTROID} + ]; + + /** @type {number} */ var maxAttributeVectors = 16; + //** @type {number} */ var maxTransformFeedbackComponents = 64; // note It is enough to limit attribute set size. + /** @type {boolean} */ var isSeparateMode = (this.m_bufferMode === gl.SEPARATE_ATTRIBS); + /** @type {number} */ var maxTransformFeedbackVars = isSeparateMode ? 4 : maxAttributeVectors; + /** @type {number} */ var arrayWeight = 0.3; + /** @type {number} */ var positionWeight = 0.7; + /** @type {number} */ var pointSizeWeight = 0.1; + /** @type {number} */ var captureFullArrayWeight = 0.5; + + /** @type {deRandom.Random} */ + var rnd = new deRandom.Random(seed); + /** @type {boolean} */ var usePosition = rnd.getFloat() < positionWeight; + /** @type {boolean} */ var usePointSize = rnd.getFloat() < pointSizeWeight; + /** @type {number} */ var numAttribVectorsToUse = rnd.getInt( + 1, maxAttributeVectors - 1/*position*/ - (usePointSize ? 1 : 0) + ); + + /** @type {number} */ var numAttributeVectors = 0; + /** @type {number} */ var varNdx = 0; + + // Generate varyings. + while (numAttributeVectors < numAttribVectorsToUse) { + /** @type {number} */ + var maxVecs = isSeparateMode ? Math.min(2 /*at most 2*mat2*/, numAttribVectorsToUse - numAttributeVectors) : numAttribVectorsToUse - numAttributeVectors; + /** @type {gluShaderUtil.DataType} */ + var begin = typeCandidates[0]; + /** @type {number} */ + var endCandidates = begin + ( + maxVecs >= 4 ? 21 : ( + maxVecs >= 3 ? 18 : ( + maxVecs >= 2 ? (isSeparateMode ? 13 : 15) : 12 + ) + ) + ); + /** @type {gluShaderUtil.DataType} */ + var end = typeCandidates[endCandidates]; + + /** @type {gluShaderUtil.DataType} */ + var type = rnd.choose(typeCandidates)[0]; + + /** @type {gluShaderUtil.precision} */ + var precision = rnd.choose(precisions)[0]; + + /** @type {es3fTransformFeedbackTests.interpolation} */ + var interp = (type === gluShaderUtil.DataType.FLOAT) ? + rnd.choose(interpModes)[0].interp : + es3fTransformFeedbackTests.interpolation.FLAT; + + /** @type {number} */ + var numVecs = gluShaderUtil.isDataTypeMatrix(type) ? gluShaderUtil.getDataTypeMatrixNumColumns(type) : 1; + /** @type {number} */ + var numComps = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {number} */ + var maxArrayLen = Math.max(1, isSeparateMode ? (4 / numComps) : (maxVecs / numVecs)); + /** @type {boolean} */ + var useArray = rnd.getFloat() < arrayWeight; + /** @type {number} */ + var arrayLen = useArray ? rnd.getInt(1, maxArrayLen) : 1; + /** @type {string} */ + var name = 'v_var' + varNdx; + + if (useArray) + this.m_progSpec.addVarying(name, gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), arrayLen), interp); + else + this.m_progSpec.addVarying(name, gluVarType.newTypeBasic(type, precision), interp); + + numAttributeVectors += arrayLen * numVecs; + varNdx += 1; + } + + // Generate transform feedback candidate set. + /** @type {Array} */ var tfCandidates = []; + + if (usePosition) tfCandidates.push('gl_Position'); + if (usePointSize) tfCandidates.push('gl_PointSize'); + + for (var ndx = 0; ndx < varNdx; ndx++) { + /** @type {es3fTransformFeedbackTests.Varying} */ + var varying = this.m_progSpec.getVaryings()[ndx]; + + if (varying.type.isArrayType()) { + /** @type {boolean} */ + var captureFull = rnd.getFloat() < captureFullArrayWeight; + + if (captureFull) { + tfCandidates.push(varying.name); + } else { + /** @type {number} */ + var numElem = varying.type.getArraySize(); + for (var elemNdx = 0; elemNdx < numElem; elemNdx++) + tfCandidates.push(varying.name + '[' + elemNdx + ']'); + } + } else + tfCandidates.push(varying.name); + } + + // Pick random selection. + var tfVaryings = []; + rnd.choose(tfCandidates, tfVaryings, Math.min(tfCandidates.length, maxTransformFeedbackVars)); + rnd.shuffle(tfVaryings); + for (var i = 0; i < tfVaryings.length; i++) + this.m_progSpec.addTransformFeedbackVarying(tfVaryings[i]); + + es3fTransformFeedbackTests.TransformFeedbackCase.prototype.init.call(this); + + }; + + /** + * Creates the test in order to be executed + **/ + es3fTransformFeedbackTests.init = function() { + + /** @const @type {tcuTestCase.DeqpTest} */ + var testGroup = tcuTestCase.runner.testCases; + + var bufferModes = [{name: 'separate', mode: gl.SEPARATE_ATTRIBS}, {name: 'interleaved', mode: gl.INTERLEAVED_ATTRIBS} + ]; + + var primitiveTypes = [{name: 'points', type: gluDrawUtil.primitiveType.POINTS}, {name: 'lines', type: gluDrawUtil.primitiveType.LINES}, {name: 'triangles', type: gluDrawUtil.primitiveType.TRIANGLES} + ]; + + /** @type {Array} */ + var basicTypes = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4, + gluShaderUtil.DataType.FLOAT_MAT2, + gluShaderUtil.DataType.FLOAT_MAT2X3, + gluShaderUtil.DataType.FLOAT_MAT2X4, + gluShaderUtil.DataType.FLOAT_MAT3X2, + gluShaderUtil.DataType.FLOAT_MAT3, + gluShaderUtil.DataType.FLOAT_MAT3X4, + gluShaderUtil.DataType.FLOAT_MAT4X2, + gluShaderUtil.DataType.FLOAT_MAT4X3, + gluShaderUtil.DataType.FLOAT_MAT4, + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4, + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4 + ]; + + /** @type {Array} */ + var precisions = [ + + gluShaderUtil.precision.PRECISION_LOWP, + gluShaderUtil.precision.PRECISION_MEDIUMP, + gluShaderUtil.precision.PRECISION_HIGHP + + // glsUBC.UniformFlags.PRECISION_LOW, + // glsUBC.UniformFlags.PRECISION_MEDIUM, + // glsUBC.UniformFlags.PRECISION_HIGH + ]; + + var interpModes = [{name: 'smooth', interp: es3fTransformFeedbackTests.interpolation.SMOOTH}, {name: 'flat', interp: es3fTransformFeedbackTests.interpolation.FLAT}, {name: 'centroid', interp: es3fTransformFeedbackTests.interpolation.CENTROID} + ]; + + // .position + /** @type {tcuTestCase.DeqpTest} */ + var positionGroup = tcuTestCase.newTest('position', 'gl_Position capture using transform feedback'); + testGroup.addChild(positionGroup); + + for (var primitiveType = 0; primitiveType < primitiveTypes.length; primitiveType++) { + for (var bufferMode = 0; bufferMode < bufferModes.length; bufferMode++) { + /** @type {string} */ + var name = primitiveTypes[primitiveType].name + '_' + bufferModes[bufferMode].name; + + positionGroup.addChild(new es3fTransformFeedbackTests.PositionCase( + name, + '', + bufferModes[bufferMode].mode, + primitiveTypes[primitiveType].type + )); + } + } + + // .point_size + /** @type {tcuTestCase.DeqpTest} */ var pointSizeGroup = tcuTestCase.newTest('point_size', 'gl_PointSize capture using transform feedback'); + testGroup.addChild(pointSizeGroup); + + for (var primitiveType = 0; primitiveType < primitiveTypes.length; primitiveType++) { + for (var bufferMode = 0; bufferMode < bufferModes.length; bufferMode++) { + var name = primitiveTypes[primitiveType].name + '_' + bufferModes[bufferMode].name; + + pointSizeGroup.addChild(new es3fTransformFeedbackTests.PointSizeCase( + name, + '', + bufferModes[bufferMode].mode, + primitiveTypes[primitiveType].type + )); + } + } + + // .basic_type + for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) { + /** @type {number} */ + var bufferMode = bufferModes[bufferModeNdx].mode; + for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) { + /** @type {tcuTestCase.DeqpTest} */ + var primitiveGroup = tcuTestCase.newTest( + 'basic_types.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name, + 'Basic types in transform feedback'); + /** @type {number} */ + var primitiveType = primitiveTypes[primitiveTypeNdx].type; + testGroup.addChild(primitiveGroup); + + for (var typeNdx = 0; typeNdx < basicTypes.length; typeNdx++) { + /** @type {gluShaderUtil.DataType} */ + var type = basicTypes[typeNdx]; + /** @type {boolean} */ + var isFloat = gluShaderUtil.getDataTypeScalarType(type) == gluShaderUtil.DataType.FLOAT; + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + /** @type {gluShaderUtil.precision} */ + var precision = precisions[precNdx]; + var name = gluShaderUtil.getPrecisionName(precision) + '_' + gluShaderUtil.getDataTypeName(type); + + primitiveGroup.addChild(new es3fTransformFeedbackTests.BasicTypeCase( + name, + '', + bufferMode, + primitiveType, + type, + precision, + isFloat ? es3fTransformFeedbackTests.interpolation.SMOOTH : es3fTransformFeedbackTests.interpolation.FLAT + )); + } + } + } + } + + // .array + for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) { + var bufferMode = bufferModes[bufferModeNdx].mode; + for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) { + var primitiveGroup = tcuTestCase.newTest( + 'array.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name, + 'Capturing whole array in TF'); + /** @type {number} */ + var primitiveType = primitiveTypes[primitiveTypeNdx].type; + testGroup.addChild(primitiveGroup); + + for (var typeNdx = 0; typeNdx < basicTypes.length; typeNdx++) { + var type = basicTypes[typeNdx]; + var isFloat = gluShaderUtil.getDataTypeScalarType(type) == gluShaderUtil.DataType.FLOAT; + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + var precision = precisions[precNdx]; + var name = gluShaderUtil.getPrecisionName(precision) + '_' + gluShaderUtil.getDataTypeName(type); + + primitiveGroup.addChild(new es3fTransformFeedbackTests.BasicArrayCase( + name, + '', + bufferMode, + primitiveType, + type, + precision, + isFloat ? es3fTransformFeedbackTests.interpolation.SMOOTH : es3fTransformFeedbackTests.interpolation.FLAT + )); + } + } + } + } + + // .array_element + for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) { + var bufferMode = bufferModes[bufferModeNdx].mode; + for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) { + var primitiveGroup = tcuTestCase.newTest( + 'array_element.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name, + 'Capturing single array element in TF'); + var primitiveType = primitiveTypes[primitiveTypeNdx].type; + testGroup.addChild(primitiveGroup); + + for (var typeNdx = 0; typeNdx < basicTypes.length; typeNdx++) { + var type = basicTypes[typeNdx]; + var isFloat = gluShaderUtil.getDataTypeScalarType(type) == gluShaderUtil.DataType.FLOAT; + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + var precision = precisions[precNdx]; + var name = gluShaderUtil.getPrecisionName(precision) + '_' + gluShaderUtil.getDataTypeName(type); + + primitiveGroup.addChild(new es3fTransformFeedbackTests.ArrayElementCase( + name, + '', + bufferMode, + primitiveType, + type, + precision, + isFloat ? es3fTransformFeedbackTests.interpolation.SMOOTH : es3fTransformFeedbackTests.interpolation.FLAT + )); + } + } + } + } + + // .interpolation + for (var modeNdx = 0; modeNdx < interpModes.length; modeNdx++) { + var interp = interpModes[modeNdx].interp; + var modeGroup = tcuTestCase.newTest( + 'interpolation.' + interpModes[modeNdx].name, + 'Different interpolation modes in transform feedback varyings'); + testGroup.addChild(modeGroup); + + for (var precNdx = 0; precNdx < precisions.length; precNdx++) { + var precision = precisions[precNdx]; + + for (var primitiveType = 0; primitiveType < primitiveTypes.length; primitiveType++) { + for (var bufferMode = 0; bufferMode < bufferModes.length; bufferMode++) { + var name = ( + gluShaderUtil.getPrecisionName(precision) + + '_vec4_' + primitiveTypes[primitiveType].name + + '_' + bufferModes[bufferMode].name + ); + + modeGroup.addChild(new es3fTransformFeedbackTests.BasicTypeCase( + name, + '', + bufferModes[bufferMode].mode, + primitiveTypes[primitiveType].type, + gluShaderUtil.DataType.FLOAT_VEC4, + precision, + interp + )); + } + } + } + } + + // .random + for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) { + /** @type {number} */ + var bufferMode = bufferModes[bufferModeNdx].mode; + for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) { + var primitiveGroup = tcuTestCase.newTest( + 'random.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name, + 'Randomized transform feedback cases'); + /** @type {number} */ + var primitiveType = primitiveTypes[primitiveTypeNdx].type; + testGroup.addChild(primitiveGroup); + + for (var ndx = 0; ndx < 10; ndx++) { + /** @type {number} */ + var seed = deMath.deMathHash(bufferMode) ^ deMath.deMathHash(primitiveType) ^ deMath.deMathHash(ndx); + + primitiveGroup.addChild(new es3fTransformFeedbackTests.RandomCase( + (ndx + 1).toString(), + '', + bufferMode, + primitiveType, + seed + )); + } + } + } + + }; + + /** + * Create and execute the test cases + */ + es3fTransformFeedbackTests.run = function(context, range) { + gl = context; + var testName = 'transform_feedback'; + var testDescription = 'Transform Feedback Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + try { + es3fTransformFeedbackTests.init(); + if (range) + state.setRange(range); + tcuTestCase.runTestCases(); + } catch (err) { + bufferedLogToConsole(err); + tcuTestCase.runner.terminate(); + } + + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js new file mode 100644 index 000000000..59e50f1fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js @@ -0,0 +1,3203 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fUniformApiTests'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluVarType'); + +goog.scope(function() { + + var es3fUniformApiTests = functional.gles3.es3fUniformApiTests; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluTexture = framework.opengl.gluTexture; + var gluVarType = framework.opengl.gluVarType; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + + /** @type {WebGL2RenderingContext} */ var gl; + + /** @typedef {function(gluShaderUtil.DataType): boolean} */ + es3fUniformApiTests.dataTypePredicate; + + /** @type {number} */ es3fUniformApiTests.MAX_RENDER_WIDTH = 32; + /** @type {number} */ es3fUniformApiTests.MAX_RENDER_HEIGHT = 32; + /** @type {number} */ es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS = 16; + + /** @type {Array} */ es3fUniformApiTests.s_testDataTypes = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4, + gluShaderUtil.DataType.FLOAT_MAT2, + gluShaderUtil.DataType.FLOAT_MAT2X3, + gluShaderUtil.DataType.FLOAT_MAT2X4, + gluShaderUtil.DataType.FLOAT_MAT3X2, + gluShaderUtil.DataType.FLOAT_MAT3, + gluShaderUtil.DataType.FLOAT_MAT3X4, + gluShaderUtil.DataType.FLOAT_MAT4X2, + gluShaderUtil.DataType.FLOAT_MAT4X3, + gluShaderUtil.DataType.FLOAT_MAT4, + + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4, + + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4, + + gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL_VEC2, + gluShaderUtil.DataType.BOOL_VEC3, + gluShaderUtil.DataType.BOOL_VEC4, + + gluShaderUtil.DataType.SAMPLER_2D, + gluShaderUtil.DataType.SAMPLER_CUBE + // \note We don't test all sampler types here. + ]; + + /** + * Returns a substring from the beginning to the last occurence of the + * specified character + * @param {string} str The string in which to search + * @param {string} c A single character + * @return {string} + */ + es3fUniformApiTests.beforeLast = function(str, c) { + return str.substring(0, str.lastIndexOf(c)); + }; + + /** + * es3fUniformApiTests.fillWithColor + * @param {tcuTexture.PixelBufferAccess} access , + * @param {Array} color Array of four color components. + */ + es3fUniformApiTests.fillWithColor = function(access, color) { + for (var z = 0; z < access.getDepth(); z++) + for (var y = 0; y < access.getHeight(); y++) + for (var x = 0; x < access.getWidth(); x++) + access.setPixel(color, x, y, z); + }; + + /** + * @param {gluShaderUtil.DataType} type + * @return {number} + */ + es3fUniformApiTests.getSamplerNumLookupDimensions = function(type) { + switch (type) { + case gluShaderUtil.DataType.SAMPLER_2D: + case gluShaderUtil.DataType.INT_SAMPLER_2D: + case gluShaderUtil.DataType.UINT_SAMPLER_2D: + return 2; + + case gluShaderUtil.DataType.SAMPLER_3D: + case gluShaderUtil.DataType.INT_SAMPLER_3D: + case gluShaderUtil.DataType.UINT_SAMPLER_3D: + case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.SAMPLER_CUBE: + case gluShaderUtil.DataType.INT_SAMPLER_CUBE: + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: + return 3; + + case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: + return 4; + + default: + throw new Error('es3fUniformApiTests.getSamplerNumLookupDimensions - Invalid type'); + } + }; + + /** + * @param {gluShaderUtil.DataType} type + * @return {gluShaderUtil.DataType} + */ + es3fUniformApiTests.getSamplerLookupReturnType = function(type) { + switch (type) { + case gluShaderUtil.DataType.SAMPLER_2D: + case gluShaderUtil.DataType.SAMPLER_CUBE: + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.SAMPLER_3D: + return gluShaderUtil.DataType.FLOAT_VEC4; + + case gluShaderUtil.DataType.UINT_SAMPLER_2D: + case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: + case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.UINT_SAMPLER_3D: + return gluShaderUtil.DataType.UINT_VEC4; + + case gluShaderUtil.DataType.INT_SAMPLER_2D: + case gluShaderUtil.DataType.INT_SAMPLER_CUBE: + case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: + case gluShaderUtil.DataType.INT_SAMPLER_3D: + return gluShaderUtil.DataType.INT_VEC4; + + case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: + case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: + case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: + return gluShaderUtil.DataType.FLOAT; + + default: + throw new Error('es3fUniformApiTests.getSamplerLookupReturnType - Invalid type'); + } + }; + + /** + * @param {gluShaderUtil.DataType} T DataType to compare the type. Used to be a template param + * @param {gluShaderUtil.DataType} t + * @return {boolean} + */ + es3fUniformApiTests.dataTypeEquals = function(T, t) { + return t == T; + }; + + /** + * @param {number} N Row number. Used to be a template parameter + * @param {gluShaderUtil.DataType} t + * @return {boolean} + */ + es3fUniformApiTests.dataTypeIsMatrixWithNRows = function(N, t) { + return gluShaderUtil.isDataTypeMatrix(t) && gluShaderUtil.getDataTypeMatrixNumRows(t) == N; + }; + + /** + * @param {gluVarType.VarType} type + * @param {es3fUniformApiTests.dataTypePredicate} predicate + * @return {boolean} + */ + es3fUniformApiTests.typeContainsMatchingBasicType = function(type, predicate) { + if (type.isBasicType()) + return predicate(type.getBasicType()); + else if (type.isArrayType()) + return es3fUniformApiTests.typeContainsMatchingBasicType(type.getElementType(), predicate); + else { + assertMsgOptions(type.isStructType(), 'es3fUniformApiTests.typeContainsMatchingBasicType - not a struct type', false, true); + /** @type {gluVarType.StructType} */ var structType = type.getStruct(); + for (var i = 0; i < structType.getSize(); i++) + if (es3fUniformApiTests.typeContainsMatchingBasicType(structType.getMember(i).getType(), predicate)) + return true; + return false; + } + }; + + /** + * @param {Array} dst + * @param {gluVarType.VarType} type + */ + es3fUniformApiTests.getDistinctSamplerTypes = function(dst, type) { + if (type.isBasicType()) { + /** @type {gluShaderUtil.DataType} */ var basicType = type.getBasicType(); + if (gluShaderUtil.isDataTypeSampler(basicType) && dst.indexOf(basicType) == -1) + dst.push(basicType); + } else if (type.isArrayType()) + es3fUniformApiTests.getDistinctSamplerTypes(dst, type.getElementType()); + else { + assertMsgOptions(type.isStructType(), 'es3fUniformApiTests.getDistinctSamplerTypes - not a struct type', false, true); + /** @type {gluVarType.StructType} */ var structType = type.getStruct(); + for (var i = 0; i < structType.getSize(); i++) + es3fUniformApiTests.getDistinctSamplerTypes(dst, structType.getMember(i).getType()); + } + }; + + /** + * @param {gluVarType.VarType} type + * @return {number} + */ + es3fUniformApiTests.getNumSamplersInType = function(type) { + if (type.isBasicType()) + return gluShaderUtil.isDataTypeSampler(type.getBasicType()) ? 1 : 0; + else if (type.isArrayType()) + return es3fUniformApiTests.getNumSamplersInType(type.getElementType()) * type.getArraySize(); + else { + assertMsgOptions(type.isStructType(), 'es3fUniformApiTests.getNumSamplersInType - not a struct type', false, true); + /** @type {gluVarType.StructType} */ var structType = type.getStruct(); + /** @type {number} */ var sum = 0; + for (var i = 0; i < structType.getSize(); i++) + sum += es3fUniformApiTests.getNumSamplersInType(structType.getMember(i).getType()); + return sum; + } + }; + + /** @typedef { {type: gluVarType.VarType, ndx: number}} */ + es3fUniformApiTests.VarTypeWithIndex; + + /** + * @param {number} maxDepth + * @param {number} curStructIdx Out parameter, instead returning it in the VarTypeWithIndex structure. + * @param {Array} structTypesDst + * @param {deRandom.Random} rnd + * @return {es3fUniformApiTests.VarTypeWithIndex} + */ + es3fUniformApiTests.generateRandomType = function(maxDepth, curStructIdx, structTypesDst, rnd) { + /** @type {boolean} */ var isStruct = maxDepth > 0 && rnd.getFloat() < 0.2; + /** @type {boolean} */ var isArray = rnd.getFloat() < 0.3; + + if (isStruct) { + /** @type {number} */ var numMembers = rnd.getInt(1, 5); + /** @type {gluVarType.StructType} */ var structType = gluVarType.newStructType('structType' + curStructIdx++); + + for (var i = 0; i < numMembers; i++) { + /** @type {es3fUniformApiTests.VarTypeWithIndex} */ var typeWithIndex = es3fUniformApiTests.generateRandomType(maxDepth - 1, curStructIdx, structTypesDst, rnd); + curStructIdx = typeWithIndex.ndx; + structType.addMember('m' + i, typeWithIndex.type); + } + + structTypesDst.push(structType); + return (isArray ? { + type: gluVarType.newTypeArray(gluVarType.newTypeStruct(structType), rnd.getInt(1, 5)), + ndx: curStructIdx + } + : { + type: gluVarType.newTypeStruct(structType), + ndx: curStructIdx + }); + } else { + /** @type {gluShaderUtil.DataType} */ var basicType = es3fUniformApiTests.s_testDataTypes[rnd.getInt(0, es3fUniformApiTests.s_testDataTypes.length - 1)]; + /** @type {gluShaderUtil.precision} */ var precision; + if (!gluShaderUtil.isDataTypeBoolOrBVec(basicType)) + precision = gluShaderUtil.precision.PRECISION_MEDIUMP; + return (isArray ? { + type: gluVarType.newTypeArray(gluVarType.newTypeBasic(basicType, precision), rnd.getInt(1, 5)), + ndx: curStructIdx + } + : { + type: gluVarType.newTypeBasic(basicType, precision), + ndx: curStructIdx + }); + } + }; + + /** + * es3fUniformApiTests.SamplerV structure + * @constructor + */ + es3fUniformApiTests.SamplerV = function() { + this.samplerV = { + /** @type {number} */ unit: 0, + /** @type {Array} */ fillColor: [] + }; + }; + + /** + * es3fUniformApiTests.VarValue class. may contain different types. + * @constructor + */ + es3fUniformApiTests.VarValue = function() { + /** @type {gluShaderUtil.DataType} */ this.type; + /** @type {Array | es3fUniformApiTests.SamplerV} */ this.val = []; + }; + + /** + * @enum {number} + */ + es3fUniformApiTests.CaseShaderType = { + VERTEX: 0, + FRAGMENT: 1, + BOTH: 2 + }; + + /** + * es3fUniformApiTests.Uniform struct. + * @param {string} name_ + * @param {gluVarType.VarType} type_ + * @constructor + */ + es3fUniformApiTests.Uniform = function(name_, type_) { + /** @type {string} */ this.name = name_; + /** @type {gluVarType.VarType} */ this.type = type_; + }; + + // A set of uniforms, along with related struct types. + /** + * class es3fUniformApiTests.UniformCollection + * @constructor + */ + es3fUniformApiTests.UniformCollection = function() { + /** @type {Array} */ this.m_uniforms = []; + /** @type {Array} */ this.m_structTypes = []; + }; + + /** + * @return {number} + */ + es3fUniformApiTests.UniformCollection.prototype.getNumUniforms = function() {return this.m_uniforms.length;}; + + /** + * @return {number} + */ + es3fUniformApiTests.UniformCollection.prototype.getNumStructTypes = function() {return this.m_structTypes.length;}; + + /** + * @param {number} ndx + * @return {es3fUniformApiTests.Uniform} + */ + es3fUniformApiTests.UniformCollection.prototype.getUniform = function(ndx) {return this.m_uniforms[ndx];}; + + /** + * @param {number} ndx + * @return {gluVarType.StructType} + */ + es3fUniformApiTests.UniformCollection.prototype.getStructType = function(ndx) {return this.m_structTypes[ndx];}; + + /** + * @param {es3fUniformApiTests.Uniform} uniform + */ + es3fUniformApiTests.UniformCollection.prototype.addUniform = function(uniform) {this.m_uniforms.push(uniform);}; + + /** + * @param {gluVarType.StructType} type + */ + es3fUniformApiTests.UniformCollection.prototype.addStructType = function(type) {this.m_structTypes.push(type);}; + + // Add the contents of m_uniforms and m_structTypes to receiver, and remove them from this one. + // \note receiver takes ownership of the struct types. + /** + * @param {es3fUniformApiTests.UniformCollection} receiver + */ + es3fUniformApiTests.UniformCollection.prototype.moveContents = function(receiver) { + for (var i = 0; i < this.m_uniforms.length; i++) + receiver.addUniform(this.m_uniforms[i]); + this.m_uniforms.length = 0; + + for (var i = 0; i < this.m_structTypes.length; i++) + receiver.addStructType(this.m_structTypes[i]); + this.m_structTypes.length = 0; + }; + + /** + * @param {es3fUniformApiTests.dataTypePredicate} predicate + * @return {boolean} + */ + es3fUniformApiTests.UniformCollection.prototype.containsMatchingBasicType = function(predicate) { + for (var i = 0; i < this.m_uniforms.length; i++) + if (es3fUniformApiTests.typeContainsMatchingBasicType(this.m_uniforms[i].type, predicate)) + return true; + return false; + }; + + /** + * @return {Array} + */ + es3fUniformApiTests.UniformCollection.prototype.getSamplerTypes = function() { + /** @type {Array} */ var samplerTypes = []; + for (var i = 0; i < this.m_uniforms.length; i++) + es3fUniformApiTests.getDistinctSamplerTypes(samplerTypes, this.m_uniforms[i].type); + return samplerTypes; + }; + + /** + * @return {boolean} + */ + es3fUniformApiTests.UniformCollection.prototype.containsSeveralSamplerTypes = function() { + return this.getSamplerTypes().length > 1; + }; + + /** + * @return {number} + */ + es3fUniformApiTests.UniformCollection.prototype.getNumSamplers = function() { + var sum = 0; + for (var i = 0; i < this.m_uniforms.length; i++) + sum += es3fUniformApiTests.getNumSamplersInType(this.m_uniforms[i].type); + return sum; + }; + + /** + * @param {gluShaderUtil.DataType} type + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.basic = function(type, nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + /** @type {gluShaderUtil.precision} */ var prec; + if (!gluShaderUtil.isDataTypeBoolOrBVec(type)) + prec = gluShaderUtil.precision.PRECISION_MEDIUMP; + res.m_uniforms.push(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeBasic(type, prec))); + return res; + }; + + /** + * @param {gluShaderUtil.DataType} type + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.basicArray = function(type, nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + /** @type {gluShaderUtil.precision} */ var prec; + if (!gluShaderUtil.isDataTypeBoolOrBVec(type)) + prec = gluShaderUtil.precision.PRECISION_MEDIUMP; + res.m_uniforms.push(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeArray(gluVarType.newTypeBasic(type, prec), 3))); + return res; + }; + + /** + * @param {gluShaderUtil.DataType} type0 + * @param {gluShaderUtil.DataType} type1 + * @param {boolean} containsArrays + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.basicStruct = function(type0, type1, containsArrays, nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + /** @type {gluShaderUtil.precision} */ var prec0; + if (!gluShaderUtil.isDataTypeBoolOrBVec(type0)) + prec0 = gluShaderUtil.precision.PRECISION_MEDIUMP; + /** @type {gluShaderUtil.precision} */ var prec1; + if (!gluShaderUtil.isDataTypeBoolOrBVec(type1)) + prec1 = gluShaderUtil.precision.PRECISION_MEDIUMP; + + /** @type {gluVarType.StructType} */ var structType = gluVarType.newStructType('structType' + nameSuffix); + structType.addMember('m0', gluVarType.newTypeBasic(type0, prec0)); + structType.addMember('m1', gluVarType.newTypeBasic(type1, prec1)); + if (containsArrays) { + structType.addMember('m2', gluVarType.newTypeArray(gluVarType.newTypeBasic(type0, prec0), 3)); + structType.addMember('m3', gluVarType.newTypeArray(gluVarType.newTypeBasic(type1, prec1), 3)); + } + + res.addStructType(structType); + res.addUniform(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeStruct(structType))); + + return res; + }; + + /** + * @param {gluShaderUtil.DataType} type0 + * @param {gluShaderUtil.DataType} type1 + * @param {boolean} containsArrays + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.structInArray = function(type0, type1, containsArrays, nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = es3fUniformApiTests.UniformCollection.basicStruct(type0, type1, containsArrays, nameSuffix); + res.getUniform(0).type = gluVarType.newTypeArray(res.getUniform(0).type, 3); + return res; + }; + + /** + * @param {gluShaderUtil.DataType} type0 + * @param {gluShaderUtil.DataType} type1 + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.nestedArraysStructs = function(type0, type1, nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + /** @type {gluShaderUtil.precision} */ var prec0; + if (!gluShaderUtil.isDataTypeBoolOrBVec(type0)) + prec0 = gluShaderUtil.precision.PRECISION_MEDIUMP; + /** @type {gluShaderUtil.precision} */ var prec1; + if (!gluShaderUtil.isDataTypeBoolOrBVec(type1)) + prec1 = gluShaderUtil.precision.PRECISION_MEDIUMP; + /** @type {gluVarType.StructType} */ var structType = gluVarType.newStructType('structType' + nameSuffix); + /** @type {gluVarType.StructType} */ var subStructType = gluVarType.newStructType('subStructType' + nameSuffix); + /** @type {gluVarType.StructType} */ var subSubStructType = gluVarType.newStructType('subSubStructType' + nameSuffix); + + subSubStructType.addMember('mss0', gluVarType.newTypeBasic(type0, prec0)); + subSubStructType.addMember('mss1', gluVarType.newTypeBasic(type1, prec1)); + + subStructType.addMember('ms0', gluVarType.newTypeBasic(type1, prec1)); + subStructType.addMember('ms1', gluVarType.newTypeArray(gluVarType.newTypeBasic(type0, prec0), 2)); + subStructType.addMember('ms2', gluVarType.newTypeArray(gluVarType.newTypeStruct(subSubStructType), 2)); + + structType.addMember('m0', gluVarType.newTypeBasic(type0, prec0)); + structType.addMember('m1', gluVarType.newTypeStruct(subStructType)); + structType.addMember('m2', gluVarType.newTypeBasic(type1, prec1)); + + res.addStructType(subSubStructType); + res.addStructType(subStructType); + res.addStructType(structType); + + res.addUniform(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeStruct(structType))); + + return res; + }; + + /** + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.multipleBasic = function(nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {Array} */ var types = [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.INT_VEC3, gluShaderUtil.DataType.UINT_VEC4, gluShaderUtil.DataType.FLOAT_MAT3, gluShaderUtil.DataType.BOOL_VEC2]; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + + for (var i = 0; i < types.length; i++) { + /** @type {es3fUniformApiTests.UniformCollection} */ var sub = es3fUniformApiTests.UniformCollection.basic(types[i], '_' + i + nameSuffix); + sub.moveContents(res); + } + + return res; + }; + + /** + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.multipleBasicArray = function(nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {Array} */ var types = [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.INT_VEC3, gluShaderUtil.DataType.BOOL_VEC2]; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + + for (var i = 0; i < types.length; i++) { + /** @type {es3fUniformApiTests.UniformCollection} */ var sub = es3fUniformApiTests.UniformCollection.basicArray(types[i], '_' + i + nameSuffix); + sub.moveContents(res); + } + + return res; + }; + + /** + * @param {string=} nameSuffix + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.multipleNestedArraysStructs = function(nameSuffix) { + if (nameSuffix === undefined) nameSuffix = ''; + /** @type {Array} */ var types0 = [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.INT, gluShaderUtil.DataType.BOOL_VEC4]; + /** @type {Array} */ var types1 = [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.INT_VEC4, gluShaderUtil.DataType.BOOL]; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + + assertMsgOptions(types0.length == types1.length, 'es3fUniformApiTests.UniformCollection.multipleNestedArraysStructs - lengths are not the same', false, true); + + for (var i = 0; i < types0.length; i++) { + /** @type {es3fUniformApiTests.UniformCollection} */ var sub = es3fUniformApiTests.UniformCollection.nestedArraysStructs(types0[i], types1[i], '_' + i + nameSuffix); + sub.moveContents(res); + } + + return res; + }; + + /** + * @param {number} seed + * @return {es3fUniformApiTests.UniformCollection} + */ + es3fUniformApiTests.UniformCollection.random = function(seed) { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(seed); + /** @type {number} */ var numUniforms = rnd.getInt(1, 5); + /** @type {number} */ var structIdx = 0; + /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection(); + + for (var i = 0; i < numUniforms; i++) { + /** @type {Array} */ var structTypes = []; + /** @type {es3fUniformApiTests.Uniform} */ var uniform = new es3fUniformApiTests.Uniform('u_var' + i, new gluVarType.VarType()); + + // \note Discard uniforms that would cause number of samplers to exceed es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS. + do { + var temp = es3fUniformApiTests.generateRandomType(3, structIdx, structTypes, rnd); + structIdx = temp.ndx; + uniform.type = temp.type; + } while (res.getNumSamplers() + es3fUniformApiTests.getNumSamplersInType(uniform.type) > es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS); + + res.addUniform(uniform); + for (var j = 0; j < structTypes.length; j++) + res.addStructType(structTypes[j]); + } + + return res; + }; + + /** + * @param {es3fUniformApiTests.VarValue} sampler + * @return {es3fUniformApiTests.VarValue} + */ + es3fUniformApiTests.getSamplerFillValue = function(sampler) { + assertMsgOptions(gluShaderUtil.isDataTypeSampler(sampler.type), 'es3fUniformApiTests.getSamplerFillValue - not a sampler type', false, true); + + /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue(); + result.type = es3fUniformApiTests.getSamplerLookupReturnType(sampler.type); + + switch (result.type) { + case gluShaderUtil.DataType.FLOAT_VEC4: + for (var i = 0; i < 4; i++) + result.val[i] = sampler.val.samplerV.fillColor[i]; + break; + case gluShaderUtil.DataType.UINT_VEC4: + for (var i = 0; i < 4; i++) + result.val[i] = sampler.val.samplerV.fillColor[i]; + break; + case gluShaderUtil.DataType.INT_VEC4: + for (var i = 0; i < 4; i++) + result.val[i] = sampler.val.samplerV.fillColor[i]; + break; + case gluShaderUtil.DataType.FLOAT: + result.val[0] = sampler.val.samplerV.fillColor[0]; + break; + default: + throw new Error('es3fUniformApiTests.getSamplerFillValue - Invalid type'); + } + + return result; + }; + + /** + * @param {es3fUniformApiTests.VarValue} sampler + * @return {es3fUniformApiTests.VarValue} + */ + es3fUniformApiTests.getSamplerUnitValue = function(sampler) { + assertMsgOptions(gluShaderUtil.isDataTypeSampler(sampler.type), 'es3fUniformApiTests.getSamplerUnitValue - not a sampler type', false, true); + + /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue(); + result.type = gluShaderUtil.DataType.INT; + result.val[0] = sampler.val.samplerV.unit; + + return result; + }; + + /** + * @param {gluShaderUtil.DataType} original + * @return {gluShaderUtil.DataType} + */ + es3fUniformApiTests.getDataTypeTransposedMatrix = function(original) { + return gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeMatrixNumRows(original), gluShaderUtil.getDataTypeMatrixNumColumns(original)); + }; + + /** + * @param {es3fUniformApiTests.VarValue} original + * @return {es3fUniformApiTests.VarValue} + */ + es3fUniformApiTests.getTransposeMatrix = function(original) { + assertMsgOptions(gluShaderUtil.isDataTypeMatrix(original.type), 'es3fUniformApiTests.getTransposeMatrix - not a matrix', false, true); + + /** @type {number} */ var rows = gluShaderUtil.getDataTypeMatrixNumRows(original.type); + /** @type {number} */ var cols = gluShaderUtil.getDataTypeMatrixNumColumns(original.type); + /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue(); + result.type = es3fUniformApiTests.getDataTypeTransposedMatrix(original.type); + + for (var i = 0; i < rows; i++) + for (var j = 0; j < cols; j++) + result.val[i * cols + j] = original.val[j * rows + i]; + + return result; + }; + + /** + * @param {es3fUniformApiTests.VarValue} value + * @return {string} + */ + es3fUniformApiTests.shaderVarValueStr = function(value) { + /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(value.type); + /** @type {string} */ var result = ''; + + if (numElems > 1) + result += gluShaderUtil.getDataTypeName(value.type) + '('; + + for (var i = 0; i < numElems; i++) { + if (i > 0) + result += ', '; + + if (gluShaderUtil.isDataTypeFloatOrVec(value.type) || gluShaderUtil.isDataTypeMatrix(value.type)) + result += value.val[i].toFixed(2); + else if (gluShaderUtil.isDataTypeIntOrIVec((value.type))) + result += value.val[i]; + else if (gluShaderUtil.isDataTypeUintOrUVec((value.type))) + result += value.val[i] + 'u'; + else if (gluShaderUtil.isDataTypeBoolOrBVec((value.type))) + result += value.val[i] ? 'true' : 'false'; + else if (gluShaderUtil.isDataTypeSampler((value.type))) + result += es3fUniformApiTests.shaderVarValueStr(es3fUniformApiTests.getSamplerFillValue(value)); + else + throw new Error('es3fUniformApiTests.shaderVarValueStr - invalid type'); + } + + if (numElems > 1) + result += ')'; + + return result; + }; + + /** + * @param {es3fUniformApiTests.VarValue} value + * @return {string} + */ + es3fUniformApiTests.apiVarValueStr = function(value) { + /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(value.type); + /** @type {string} */ var result = ''; + + if (numElems > 1) + result += '('; + + for (var i = 0; i < numElems; i++) { + if (i > 0) + result += ', '; + + if (gluShaderUtil.isDataTypeFloatOrVec(value.type) || gluShaderUtil.isDataTypeMatrix(value.type)) + result += value.val[i].toFixed(2); + else if (gluShaderUtil.isDataTypeIntOrIVec(value.type) || + gluShaderUtil.isDataTypeUintOrUVec(value.type)) + result += value.val[i]; + else if (gluShaderUtil.isDataTypeBoolOrBVec(value.type)) + result += value.val[i] ? 'true' : 'false'; + else if (gluShaderUtil.isDataTypeSampler(value.type)) + result += value.val.samplerV.unit; + else + throw new Error('es3fUniformApiTests.apiVarValueStr - Invalid type'); + } + + if (numElems > 1) + result += ')'; + + return result; + }; + + // samplerUnit used if type is a sampler type. \note Samplers' unit numbers are not randomized. + /** + * @param {gluShaderUtil.DataType} type + * @param {deRandom.Random} rnd + * @param {number=} samplerUnit + * @return {es3fUniformApiTests.VarValue} + */ + es3fUniformApiTests.generateRandomVarValue = function(type, rnd, samplerUnit) { + if (samplerUnit === undefined) samplerUnit = -1; + /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue(); + result.type = type; + + assertMsgOptions( + (samplerUnit >= 0) == (gluShaderUtil.isDataTypeSampler(type)), + 'es3fUniformApiTests.generateRandomVarValue - sampler units do not match type', false, true + ); + + if (gluShaderUtil.isDataTypeFloatOrVec(type) || gluShaderUtil.isDataTypeMatrix(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = rnd.getFloat(-10.0, 10.0); + } else if (gluShaderUtil.isDataTypeIntOrIVec(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = rnd.getInt(-10, 10); + } else if (gluShaderUtil.isDataTypeUintOrUVec(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = rnd.getInt(0, 10); + } else if (gluShaderUtil.isDataTypeBoolOrBVec(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = rnd.getBool(); + } else if (gluShaderUtil.isDataTypeSampler(type)) { + /** @type {gluShaderUtil.DataType} */ var texResultType = es3fUniformApiTests.getSamplerLookupReturnType(type); + /** @type {gluShaderUtil.DataType} */ var texResultScalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(texResultType); + /** @type {number} */ var texResultNumDims = gluShaderUtil.getDataTypeScalarSize(texResultType); + + result.val = new es3fUniformApiTests.SamplerV(); + result.val.samplerV.unit = samplerUnit; + + for (var i = 0; i < texResultNumDims; i++) { + switch (texResultScalarType) { + case gluShaderUtil.DataType.FLOAT: result.val.samplerV.fillColor[i] = rnd.getFloat(0.0, 1.0); break; + case gluShaderUtil.DataType.INT: result.val.samplerV.fillColor[i] = rnd.getInt(-10, 10); break; + case gluShaderUtil.DataType.UINT: result.val.samplerV.fillColor[i] = rnd.getInt(0, 10); break; + default: + throw new Error('es3fUniformApiTests.generateRandomVarValue - Invalid scalar type'); + } + } + } else + throw new Error('es3fUniformApiTests.generateRandomVarValue - Invalid type'); + + return result; + }; + + /** + * @param {gluShaderUtil.DataType} type + * @return {es3fUniformApiTests.VarValue} + */ + es3fUniformApiTests.generateZeroVarValue = function(type) { + /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(type); + /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue(); + result.type = type; + + if (gluShaderUtil.isDataTypeFloatOrVec(type) || gluShaderUtil.isDataTypeMatrix(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = 0.0; + } else if (gluShaderUtil.isDataTypeIntOrIVec(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = 0; + } else if (gluShaderUtil.isDataTypeUintOrUVec(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = 0; + } else if (gluShaderUtil.isDataTypeBoolOrBVec(type)) { + for (var i = 0; i < numElems; i++) + result.val[i] = false; + } else if (gluShaderUtil.isDataTypeSampler(type)) { + /** @type {gluShaderUtil.DataType} */ var texResultType = es3fUniformApiTests.getSamplerLookupReturnType(type); + /** @type {gluShaderUtil.DataType} */ var texResultScalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(texResultType); + /** @type {number} */ var texResultNumDims = gluShaderUtil.getDataTypeScalarSize(texResultType); + + result.val = new es3fUniformApiTests.SamplerV(); + result.val.samplerV.unit = 0; + + for (var i = 0; i < texResultNumDims; i++) { + switch (texResultScalarType) { + case gluShaderUtil.DataType.FLOAT: result.val.samplerV.fillColor[i] = 0.12 * i; break; + case gluShaderUtil.DataType.INT: result.val.samplerV.fillColor[i] = -2 + i; break; + case gluShaderUtil.DataType.UINT: result.val.samplerV.fillColor[i] = 4 + i; break; + default: + throw new Error('es3fUniformApiTests.generateZeroVarValue - Invalid scalar type'); + } + } + } else + throw new Error('es3fUniformApiTests.generateZeroVarValue - Invalid type'); + + return result; + }; + + /** + * @param {es3fUniformApiTests.VarValue} a + * @param {es3fUniformApiTests.VarValue} b + * @return {boolean} + */ + es3fUniformApiTests.apiVarValueEquals = function(a, b) { + /** @type {number} */ var size = gluShaderUtil.getDataTypeScalarSize(a.type); + /** @type {number} */ var floatThreshold = 0.05; + + assertMsgOptions(a.type == b.type, 'es3fUniformApiTests.apiVarValueEquals - types are different', false, true); + + if (gluShaderUtil.isDataTypeFloatOrVec(a.type) || gluShaderUtil.isDataTypeMatrix(a.type)) { + for (var i = 0; i < size; i++) + if (Math.abs(a.val[i] - b.val[i]) >= floatThreshold) + return false; + } else if (gluShaderUtil.isDataTypeIntOrIVec(a.type)) { + for (var i = 0; i < size; i++) + if (a.val[i] != b.val[i]) + return false; + } else if (gluShaderUtil.isDataTypeUintOrUVec(a.type)) { + for (var i = 0; i < size; i++) + if (a.val[i] != b.val[i]) + return false; + } else if (gluShaderUtil.isDataTypeBoolOrBVec(a.type)) { + for (var i = 0; i < size; i++) + if (a.val[i] != b.val[i]) + return false; + } else if (gluShaderUtil.isDataTypeSampler(a.type)) { + if (a.val.samplerV.unit != b.val.samplerV.unit) + return false; + } else + throw new Error('es3fUniformApiTests.apiVarValueEquals - Invalid type'); + + return true; + }; + + /** + * @param {es3fUniformApiTests.VarValue} boolValue + * @param {gluShaderUtil.DataType} targetScalarType + * @param {deRandom.Random} rnd + * @return {es3fUniformApiTests.VarValue} + */ + es3fUniformApiTests.getRandomBoolRepresentation = function(boolValue, targetScalarType, rnd) { + assertMsgOptions( + gluShaderUtil.isDataTypeBoolOrBVec(boolValue.type), + 'es3fUniformApiTests.getRandomBoolRepresentation - Data type not boolean or boolean vector', + false, + true + ); + + /** @type {number} */ var size = gluShaderUtil.getDataTypeScalarSize(boolValue.type); + /** @type {gluShaderUtil.DataType} */ var targetType = size == 1 ? targetScalarType : gluShaderUtil.getDataTypeVector(targetScalarType, size); + /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue(); + result.type = targetType; + + switch (targetScalarType) { + case gluShaderUtil.DataType.INT: + for (var i = 0; i < size; i++) { + if (boolValue.val[i]) { + result.val[i] = rnd.getInt(-10, 10); + if (result.val[i] == 0) + result.val[i] = 1; + } else + result.val[i] = 0; + } + break; + + case gluShaderUtil.DataType.UINT: + for (var i = 0; i < size; i++) { + if (boolValue.val[i]) + result.val[i] = rnd.getInt(1, 10); + else + result.val[i] = 0; + } + break; + + case gluShaderUtil.DataType.FLOAT: + for (var i = 0; i < size; i++) { + if (boolValue.val[i]) { + result.val[i] = rnd.getFloat(-10.0, 10.0); + if (result.val[i] == 0.0) + result.val[i] = 1.0; + } else + result.val[i] = 0; + } + break; + + default: + throw new Error('es3fUniformApiTests.getRandomBoolRepresentation - Invalid type'); + } + + return result; + }; + + /** + * @param {es3fUniformApiTests.CaseShaderType} type + * @return {?string} + */ + es3fUniformApiTests.getCaseShaderTypeName = function(type) { + switch (type) { + case es3fUniformApiTests.CaseShaderType.VERTEX: return 'vertex'; + case es3fUniformApiTests.CaseShaderType.FRAGMENT: return 'fragment'; + case es3fUniformApiTests.CaseShaderType.BOTH: return 'both'; + default: + throw new Error('es3fUniformApiTests.getCaseShaderTypeName - Invalid shader type'); + } + }; + + /** + * @param {number} seed + * @return {number} + */ + es3fUniformApiTests.randomCaseShaderType = function(seed) { + return (new deRandom.Random(seed)).getInt(0, Object.keys(es3fUniformApiTests.CaseShaderType).length - 1); + }; + + //es3fUniformApiTests.UniformCase definitions + + /** + * es3fUniformApiTests.Feature - Implemented as a function to create an object without unwanted properties. + * @constructor + */ + es3fUniformApiTests.Feature = function() { + // ARRAYUSAGE_ONLY_MIDDLE_INDEX: only middle index of each array is used in shader. If not given, use all indices. + this.ARRAYUSAGE_ONLY_MIDDLE_INDEX = false; + + // UNIFORMFUNC_VALUE: use pass-by-value versions of uniform assignment funcs, e.g. glUniform1f(), where possible. If not given, use pass-by-pointer versions. + this.UNIFORMFUNC_VALUE = false; + + // MATRIXMODE_ROWMAJOR: pass matrices to GL in row major form. If not given, use column major. + this.MATRIXMODE_ROWMAJOR = false; + + // ARRAYASSIGN: how basic-type arrays are assigned with glUniform*(). If none given, assign each element of an array separately. + this.ARRAYASSIGN_FULL = false; //!< Assign all elements of an array with one glUniform*(). + this.ARRAYASSIGN_BLOCKS_OF_TWO = false; //!< Assign two elements per one glUniform*(). + + // UNIFORMUSAGE_EVERY_OTHER: use about half of the uniforms. If not given, use all uniforms (except that some array indices may be omitted according to ARRAYUSAGE). + this.UNIFORMUSAGE_EVERY_OTHER = false; + + // BOOLEANAPITYPE: type used to pass booleans to and from GL api. If none given, use float. + this.BOOLEANAPITYPE_INT = false; + this.BOOLEANAPITYPE_UINT = false; + + // UNIFORMVALUE_ZERO: use zero-valued uniforms. If not given, use random uniform values. + this.UNIFORMVALUE_ZERO = false; + + // ARRAY_FIRST_ELEM_NAME_NO_INDEX: in certain API functions, when referring to the first element of an array, use just the array name without [0] at the end. + this.ARRAY_FIRST_ELEM_NAME_NO_INDEX = false; + }; + + // A basic uniform is a uniform (possibly struct or array member) whose type is a basic type (e.g. float, ivec4, sampler2d). + /** + * @constructor + * @param {string} name_ + * @param {gluShaderUtil.DataType} type_ + * @param {boolean} isUsedInShader_ + * @param {es3fUniformApiTests.VarValue} finalValue_ + * @param {string=} rootName_ + * @param {number=} elemNdx_ + * @param {number=} rootSize_ + */ + es3fUniformApiTests.BasicUniform = function(name_, type_, isUsedInShader_, finalValue_, rootName_, elemNdx_, rootSize_) { + /** @type {string} */ this.name = name_; + /** @type {gluShaderUtil.DataType} */ this.type = type_; + /** @type {boolean} */ this.isUsedInShader = isUsedInShader_; + /** @type {es3fUniformApiTests.VarValue} */ this.finalValue = finalValue_; //!< The value we ultimately want to set for this uniform. + + /** @type {string} */ this.rootName = rootName_ === undefined ? name_ : rootName_; //!< If this is a member of a basic-typed array, rootName is the name of that array with "[0]" appended. Otherwise it equals name. + /** @type {number} */ this.elemNdx = elemNdx_ === undefined ? -1 : elemNdx_; //!< If this is a member of a basic-typed array, elemNdx is the index in that array. Otherwise -1. + /** @type {number} */ this.rootSize = rootSize_ === undefined ? 1 : rootSize_; //!< If this is a member of a basic-typed array, rootSize is the size of that array. Otherwise 1. + }; + + /** + * @param {Array} vec + * @param {string} name + * @return {es3fUniformApiTests.BasicUniform} + */ + es3fUniformApiTests.BasicUniform.findWithName = function(vec, name) { + for (var i = 0; i < vec.length; i++) { + if (vec[i].name == name) + return vec[i]; + } + return null; + }; + + // Reference values for info that is expected to be reported by glGetActiveUniform() or glGetActiveUniforms(). + /** + * @constructor + * @param {string} name_ + * @param {gluShaderUtil.DataType} type_ + * @param {boolean} used + */ + es3fUniformApiTests.BasicUniformReportRef = function(name_, type_, used) { + /** @type {string} */ this.name = name_; + // \note minSize and maxSize are for arrays and can be distinct since implementations are allowed, but not required, to trim the inactive end indices of arrays. + /** @type {number} */ this.minSize = 1; + /** @type {number} */ this.maxSize = 1; + /** @type {gluShaderUtil.DataType} */ this.type = type_; + /** @type {boolean} */ this.isUsedInShader = used; + }; + + /** + * To be used after constructor + * @param {number} minS + * @param {number} maxS + * @return {es3fUniformApiTests.BasicUniformReportRef} + */ + es3fUniformApiTests.BasicUniformReportRef.prototype.constructor_A = function(minS, maxS) { + this.minSize = minS; + this.maxSize = maxS; + + assertMsgOptions( + this.minSize <= this.maxSize, + 'es3fUniformApiTests.BasicUniformReportRef.prototype.constructor_A - min size not smaller or equal than max size', + false, + true + ); + + return this; + }; + + // Info that is actually reported by glGetActiveUniform() or glGetActiveUniforms(). + /** + * @constructor + * @param {string} name_ + * @param {number} nameLength_ + * @param {number} size_ + * @param {gluShaderUtil.DataType} type_ + * @param {number} index_ + */ + es3fUniformApiTests.BasicUniformReportGL = function(name_, nameLength_, size_, type_, index_) { + this.name = name_; + this.nameLength = nameLength_; + this.size = size_; + this.type = type_; + this.index = index_; + }; + + /** + * @param {Array} vec + * @param {string} name + * @return {es3fUniformApiTests.BasicUniformReportGL} + */ + es3fUniformApiTests.BasicUniformReportGL.findWithName = function(vec, name) { + for (var i = 0; i < vec.length; i++) { + if (vec[i].name == name) + return vec[i]; + } + return null; + }; + + /** + * es3fUniformApiTests.UniformCase class, inherits from TestCase class + * @constructor + * @param {string} name + * @param {string} description + * @extends {tcuTestCase.DeqpTest} + */ + es3fUniformApiTests.UniformCase = function(name, description) { // \note Randomizes caseType, uniformCollection and features. + tcuTestCase.DeqpTest.call(this, name, description); + + /** @type {es3fUniformApiTests.Feature} */ this.m_features; + /** @type {es3fUniformApiTests.UniformCollection} (SharedPtr) */ this.m_uniformCollection; + + /** @type {number} */ this.m_caseShaderType = 0; + + /** @type {Array} */ this.m_textures2d = []; + /** @type {Array} */ this.m_texturesCube = []; + /** @type {Array} */ this.m_filledTextureUnits = []; + }; + + es3fUniformApiTests.UniformCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + /** es3fUniformApiTests.UniformCase prototype restore */ + es3fUniformApiTests.UniformCase.prototype.constructor = es3fUniformApiTests.UniformCase; + + /** + * es3fUniformApiTests.UniformCase newC. Creates a es3fUniformApiTests.UniformCase. Use after constructor. + * @param {number} seed + * @return {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformCase.prototype.newC = function(seed) { + this.m_features = this.randomFeatures(seed); + this.m_uniformCollection = es3fUniformApiTests.UniformCollection.random(seed); + this.m_caseShaderType = es3fUniformApiTests.randomCaseShaderType(seed); + + return this; + }; + + /** + * es3fUniformApiTests.UniformCase new_B (static). Creates a es3fUniformApiTests.UniformCase + * @param {string} name + * @param {string} description + * @param {number} seed + * @return {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformCase.new_C = function(name, description, seed) { + var uniformCase = new es3fUniformApiTests.UniformCase(name, description).newC(seed); + + return uniformCase; + }; + + /** + * es3fUniformApiTests.UniformCase new_B. Creates a es3fUniformApiTests.UniformCase. Use after constructor. + * @param {es3fUniformApiTests.CaseShaderType} caseShaderType + * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr) + * @param {es3fUniformApiTests.Feature} features + * @return {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformCase.prototype.newB = function(caseShaderType, uniformCollection, features) { + this.m_caseShaderType = caseShaderType; + this.m_uniformCollection = uniformCollection; + this.m_features = features; + + return this; + }; + + /** + * es3fUniformApiTests.UniformCase new_B (static). Creates a es3fUniformApiTests.UniformCase + * @param {string} name + * @param {string} description + * @param {es3fUniformApiTests.CaseShaderType} caseShaderType + * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr) + * @param {es3fUniformApiTests.Feature} features + * @return {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformCase.new_B = function(name, description, caseShaderType, uniformCollection, features) { + var uniformCase = new es3fUniformApiTests.UniformCase(name, description).newB(caseShaderType, uniformCollection, features); + + return uniformCase; + }; + + /** + * es3fUniformApiTests.UniformCase new_A. Creates a es3fUniformApiTests.UniformCase. Use after constructor. + * @param {es3fUniformApiTests.CaseShaderType} caseShaderType + * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr) + * @return {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformCase.prototype.newA = function(caseShaderType, uniformCollection) { + this.m_caseShaderType = caseShaderType; + this.m_uniformCollection = uniformCollection; + this.m_features = null; + + return this; + }; + + /** + * es3fUniformApiTests.UniformCase new_A (static). Creates a es3fUniformApiTests.UniformCase + * @param {string} name + * @param {string} description + * @param {es3fUniformApiTests.CaseShaderType} caseShaderType + * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr) + * @return {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformCase.new_A = function(name, description, caseShaderType, uniformCollection) { + var uniformCase = new es3fUniformApiTests.UniformCase(name, description).newA(caseShaderType, uniformCollection); + + return uniformCase; + }; + + /** + * @param {number} seed + * @return {es3fUniformApiTests.Feature} + */ + es3fUniformApiTests.UniformCase.prototype.randomFeatures = function(seed) { + /** @type {es3fUniformApiTests.Feature} */ var result = new es3fUniformApiTests.Feature(); + + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(seed); + + result.ARRAYUSAGE_ONLY_MIDDLE_INDEX = rnd.getBool(); + result.UNIFORMFUNC_VALUE = rnd.getBool(); + result.MATRIXMODE_ROWMAJOR = rnd.getBool(); + result.ARRAYASSIGN_FULL = rnd.getBool(); + result.ARRAYASSIGN_BLOCKS_OF_TWO = !result.ARRAYASSIGN_FULL; + result.UNIFORMUSAGE_EVERY_OTHER = rnd.getBool(); + result.BOOLEANAPITYPE_INT = rnd.getBool(); + result.BOOLEANAPITYPE_UINT = !result.BOOLEANAPITYPE_INT; + result.UNIFORMVALUE_ZERO = rnd.getBool(); + + return result; + }; + + /** + * Initialize the es3fUniformApiTests.UniformCase + */ + es3fUniformApiTests.UniformCase.prototype.init = function() { + /** @type {number} */ var numSamplerUniforms = this.m_uniformCollection.getNumSamplers(); + /** @type {number} */ var vertexTexUnitsRequired = this.m_caseShaderType != es3fUniformApiTests.CaseShaderType.FRAGMENT ? numSamplerUniforms : 0; + /** @type {number} */ var fragmentTexUnitsRequired = this.m_caseShaderType != es3fUniformApiTests.CaseShaderType.VERTEX ? numSamplerUniforms : 0; + /** @type {number} */ var combinedTexUnitsRequired = vertexTexUnitsRequired + fragmentTexUnitsRequired; + var vertexTexUnitsSupported = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)); + var fragmentTexUnitsSupported = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)); + var combinedTexUnitsSupported = /** @type {number} */ (gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)); + + assertMsgOptions( + numSamplerUniforms <= es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS, + 'es3fUniformApiTests.UniformCase.prototype.init - sampler uniforms exceed MAX_NUM_SAMPLER_UNIFORMS', + false, + true + ); + + if (vertexTexUnitsRequired > vertexTexUnitsSupported) + testFailedOptions('' + vertexTexUnitsRequired + ' vertex texture units required, ' + vertexTexUnitsSupported + ' supported', true); + if (fragmentTexUnitsRequired > fragmentTexUnitsSupported) + testFailedOptions('' + fragmentTexUnitsRequired + ' fragment texture units required, ' + fragmentTexUnitsSupported + ' supported', true); + if (combinedTexUnitsRequired > combinedTexUnitsSupported) + testFailedOptions('' + combinedTexUnitsRequired + ' combined texture units required, ' + combinedTexUnitsSupported + ' supported', true); + }; + + /** + * @param {Array} basicUniformsDst + * @param {Array} basicUniformReportsDst + * @param {gluVarType.VarType} varType + * @param {string} varName + * @param {boolean} isParentActive + * @param {number} samplerUnitCounter + * @param {deRandom.Random} rnd + * @return {number} Used to be output parameter. Sampler unit count + */ + es3fUniformApiTests.UniformCase.prototype.generateBasicUniforms = function(basicUniformsDst, basicUniformReportsDst, varType, varName, isParentActive, samplerUnitCounter, rnd) { + /** @type {es3fUniformApiTests.VarValue} */ var value; + + if (varType.isBasicType()) { + /** @type {boolean} */ var isActive = isParentActive && (this.m_features.UNIFORMUSAGE_EVERY_OTHER ? basicUniformsDst.length % 2 == 0 : true); + /** @type {gluShaderUtil.DataType} */ var type = varType.getBasicType(); + value = this.m_features.UNIFORMVALUE_ZERO ? es3fUniformApiTests.generateZeroVarValue(type) : + gluShaderUtil.isDataTypeSampler(type) ? es3fUniformApiTests.generateRandomVarValue(type, rnd, samplerUnitCounter++) : + es3fUniformApiTests.generateRandomVarValue(varType.getBasicType(), rnd); + + basicUniformsDst.push(new es3fUniformApiTests.BasicUniform(varName, varType.getBasicType(), isActive, value)); + basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportRef(varName, varType.getBasicType(), isActive)); + } else if (varType.isArrayType()) { + /** @type {number} */ var size = varType.getArraySize(); + /** @type {string} */ var arrayRootName = '' + varName + '[0]'; + /** @type {Array} */ var isElemActive = []; + + for (var elemNdx = 0; elemNdx < varType.getArraySize(); elemNdx++) { + /** @type {string} */ var indexedName = '' + varName + '[' + elemNdx + ']'; + /** @type {boolean} */ var isCurElemActive = isParentActive && + (this.m_features.UNIFORMUSAGE_EVERY_OTHER ? basicUniformsDst.length % 2 == 0 : true) && + (this.m_features.ARRAYUSAGE_ONLY_MIDDLE_INDEX ? elemNdx == Math.floor(size / 2) : true); + + isElemActive.push(isCurElemActive); + + if (varType.getElementType().isBasicType()) { + // \note We don't want separate entries in basicUniformReportsDst for elements of basic-type arrays. + /** @type {gluShaderUtil.DataType} */ var elemBasicType = varType.getElementType().getBasicType(); + value = this.m_features.UNIFORMVALUE_ZERO ? es3fUniformApiTests.generateZeroVarValue(elemBasicType) : + gluShaderUtil.isDataTypeSampler(elemBasicType) ? es3fUniformApiTests.generateRandomVarValue(elemBasicType, rnd, samplerUnitCounter++) : + es3fUniformApiTests.generateRandomVarValue(elemBasicType, rnd); + + basicUniformsDst.push(new es3fUniformApiTests.BasicUniform(indexedName, elemBasicType, isCurElemActive, value, arrayRootName, elemNdx, size)); + } else + samplerUnitCounter = this.generateBasicUniforms(basicUniformsDst, basicUniformReportsDst, varType.getElementType(), indexedName, isCurElemActive, samplerUnitCounter, rnd); + } + + if (varType.getElementType().isBasicType()) { + /** @type {number} */ var minSize; + for (minSize = varType.getArraySize(); minSize > 0 && !isElemActive[minSize - 1]; minSize--) {} + + basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportRef(arrayRootName, varType.getElementType().getBasicType(), isParentActive && minSize > 0).constructor_A(minSize, size)); + } + } else { + assertMsgOptions( + varType.isStructType(), + 'es3fUniformApiTests.UniformCase.prototype.generateBasicUniforms - not a struct type', + false, + true + ); + + /** @type {gluVarType.StructType} */ var structType = varType.getStruct(); + + for (var i = 0; i < structType.getSize(); i++) { + /** @type {gluVarType.StructMember} */ var member = structType.getMember(i); + /** @type {string} */ var memberFullName = '' + varName + '.' + member.getName(); + + samplerUnitCounter = this.generateBasicUniforms(basicUniformsDst, basicUniformReportsDst, member.getType(), memberFullName, isParentActive, samplerUnitCounter, rnd); + } + } + + return samplerUnitCounter; + }; + + /** + * @param {string} dst + * @return {string} + */ + es3fUniformApiTests.UniformCase.prototype.writeUniformDefinitions = function(dst) { + for (var i = 0; i < this.m_uniformCollection.getNumStructTypes(); i++) + dst += gluVarType.declareStructType(this.m_uniformCollection.getStructType(i), 0) + ';\n'; + + for (var i = 0; i < this.m_uniformCollection.getNumUniforms(); i++) + dst += 'uniform ' + gluVarType.declareVariable(this.m_uniformCollection.getUniform(i).type, this.m_uniformCollection.getUniform(i).name, 0) + ';\n'; + + dst += '\n'; + + var compareFuncs = [{ + requiringTypes: [gluShaderUtil.isDataTypeFloatOrVec, gluShaderUtil.isDataTypeMatrix], + definition: 'mediump float compare_float (mediump float a, mediump float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_VEC2, t);}, + function(t) {return es3fUniformApiTests.dataTypeIsMatrixWithNRows(2, t);} + ], + definition: 'mediump float compare_vec2 (mediump vec2 a, mediump vec2 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_VEC3, t);}, + function(t) {return es3fUniformApiTests.dataTypeIsMatrixWithNRows(3, t);} + ], + definition: 'mediump float compare_vec3 (mediump vec3 a, mediump vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_VEC4, t);}, + function(t) {return es3fUniformApiTests.dataTypeIsMatrixWithNRows(4, t);}], + definition: 'mediump float compare_vec4 (mediump vec4 a, mediump vec4 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z)*compare_float(a.w, b.w); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT2, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat2 (mediump mat2 a, mediump mat2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT2X3, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat2x3 (mediump mat2x3 a, mediump mat2x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT2X4, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat2x4 (mediump mat2x4 a, mediump mat2x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT3X2, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat3x2 (mediump mat3x2 a, mediump mat3x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT3, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat3 (mediump mat3 a, mediump mat3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT3X4, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat3x4 (mediump mat3x4 a, mediump mat3x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT4X2, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat4x2 (mediump mat4x2 a, mediump mat4x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2])*compare_vec2(a[3], b[3]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT4X3, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat4x3 (mediump mat4x3 a, mediump mat4x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2])*compare_vec3(a[3], b[3]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT4, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_mat4 (mediump mat4 a, mediump mat4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2])*compare_vec4(a[3], b[3]); }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_int (mediump int a, mediump int b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT_VEC2, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_ivec2 (mediump ivec2 a, mediump ivec2 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT_VEC3, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_ivec3 (mediump ivec3 a, mediump ivec3 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT_VEC4, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_ivec4 (mediump ivec4 a, mediump ivec4 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_uint (mediump uint a, mediump uint b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT_VEC2, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_uvec2 (mediump uvec2 a, mediump uvec2 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT_VEC3, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_uvec3 (mediump uvec3 a, mediump uvec3 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT_VEC4, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_uvec4 (mediump uvec4 a, mediump uvec4 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_bool (bool a, bool b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL_VEC2, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_bvec2 (bvec2 a, bvec2 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL_VEC3, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_bvec3 (bvec3 a, bvec3 b) { return a == b ? 1.0 : 0.0; }' + },{ + requiringTypes: [ + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL_VEC4, t);}, + function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);} + ], + definition: 'mediump float compare_bvec4 (bvec4 a, bvec4 b) { return a == b ? 1.0 : 0.0; }' + } + ]; + + /** @type {Array} */ var samplerTypes = this.m_uniformCollection.getSamplerTypes(); + + for (var compFuncNdx = 0; compFuncNdx < compareFuncs.length; compFuncNdx++) { + /** @type {Array} */ var typeReq = compareFuncs[compFuncNdx].requiringTypes; + /** @type {boolean} */ var containsTypeSampler = false; + + for (var i = 0; i < samplerTypes.length; i++) { + if (gluShaderUtil.isDataTypeSampler(samplerTypes[i])) { + /** @type {gluShaderUtil.DataType} */ var retType = es3fUniformApiTests.getSamplerLookupReturnType(samplerTypes[i]); + if (typeReq[0](retType) || typeReq[1](retType)) { + containsTypeSampler = true; + break; + } + } + } + + if (containsTypeSampler || this.m_uniformCollection.containsMatchingBasicType(typeReq[0]) || this.m_uniformCollection.containsMatchingBasicType(typeReq[1])) + dst += compareFuncs[compFuncNdx].definition + '\n'; + } + + return dst; + }; + + /** + * @param {string} dst + * @param {es3fUniformApiTests.BasicUniform} uniform + * @return {string} Used to write the string in the output parameter + */ + es3fUniformApiTests.UniformCase.prototype.writeUniformCompareExpr = function(dst, uniform) { + if (gluShaderUtil.isDataTypeSampler(uniform.type)) + dst += 'compare_' + gluShaderUtil.getDataTypeName(es3fUniformApiTests.getSamplerLookupReturnType(uniform.type)) + '(texture(' + uniform.name + ', vec' + es3fUniformApiTests.getSamplerNumLookupDimensions(uniform.type) + '(0.0))'; //WebGL2.0 + else + dst += 'compare_' + gluShaderUtil.getDataTypeName(uniform.type) + '(' + uniform.name; + + dst += ', ' + es3fUniformApiTests.shaderVarValueStr(uniform.finalValue) + ')'; + + return dst; + }; + + /** + * @param {string} dst + * @param {Array} basicUniforms + * @param {string} variableName + * @return {string} Used to write the string in the output parameter + */ + es3fUniformApiTests.UniformCase.prototype.writeUniformComparisons = function(dst, basicUniforms, variableName) { + for (var i = 0; i < basicUniforms.length; i++) { + /** @type {es3fUniformApiTests.BasicUniform} */ var unif = basicUniforms[i]; + + if (unif.isUsedInShader) { + dst += '\t' + variableName + ' *= '; + dst = this.writeUniformCompareExpr(dst, basicUniforms[i]); + dst += ';\n'; + } else + dst += '\t// UNUSED: ' + basicUniforms[i].name + '\n'; + } + + return dst; + }; + + /** + * @param {Array} basicUniforms + * @return {string} + */ + es3fUniformApiTests.UniformCase.prototype.generateVertexSource = function(basicUniforms) { + /** @type {boolean} */ var isVertexCase = this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.VERTEX || this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.BOTH; + /** @type {string} */ var result = ''; + + result += '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'out mediump float v_vtxOut;\n' + + '\n'; + + if (isVertexCase) + result = this.writeUniformDefinitions(result); + + result += '\n' + + 'void main (void)\n' + + ' {\n' + + ' gl_Position = a_position;\n' + + ' v_vtxOut = 1.0;\n'; + + if (isVertexCase) + result = this.writeUniformComparisons(result, basicUniforms, 'v_vtxOut'); + + result += '}\n'; + + return result; + }; + + /** + * @param {Array} basicUniforms + * @return {string} + */ + es3fUniformApiTests.UniformCase.prototype.generateFragmentSource = function(basicUniforms) { + /**@type {boolean} */ var isFragmentCase = this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.FRAGMENT || this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.BOTH; + /**@type {string} */ var result = ''; + + result += '#version 300 es\n' + + 'in mediump float v_vtxOut;\n' + + '\n'; + + if (isFragmentCase) + result = this.writeUniformDefinitions(result); + + result += '\n' + + 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' + + '\n' + + 'void main (void)\n' + + ' {\n' + + ' mediump float result = v_vtxOut;\n'; + + if (isFragmentCase) + result = this.writeUniformComparisons(result, basicUniforms, 'result'); + + result += ' dEQP_FragColor = vec4(result, result, result, 1.0);\n' + + '}\n'; + + return result; + }; + + /** + * @param {es3fUniformApiTests.VarValue} value + */ + es3fUniformApiTests.UniformCase.prototype.setupTexture = function(value) { + // \note No handling for samplers other than 2D or cube. + + assertMsgOptions( + es3fUniformApiTests.getSamplerLookupReturnType(value.type) == gluShaderUtil.DataType.FLOAT_VEC4, + 'es3fUniformApiTests.UniformCase.prototype.setupTexture - sampler return type should be vec4f', false, true + ); + + /** @type {number} */ var width = 32; + /** @type {number} */ var height = 32; + /** @type {Array} */ var color = value.val.samplerV.fillColor; + /** @type {tcuTexture.TextureCube} */ var refTexture; + /** @type {gluTexture.TextureCube} */ var texture; + + if (value.type == gluShaderUtil.DataType.SAMPLER_2D) { + texture = gluTexture.texture2DFromFormat(gl, gl.RGBA, gl.UNSIGNED_BYTE, width, height); + refTexture = texture.getRefTexture(); + this.m_textures2d.push(texture); + + refTexture.allocLevel(0); + es3fUniformApiTests.fillWithColor(refTexture.getLevel(0), color); + + gl.activeTexture(gl.TEXTURE0 + value.val.samplerV.unit); + this.m_filledTextureUnits.push(value.val.samplerV.unit); + texture.upload(); + 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_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + } else if (value.type == gluShaderUtil.DataType.SAMPLER_CUBE) { + assertMsgOptions(width == height, 'es3fUniformApiTests.UniformCase.prototype.setupTexture - non square texture', false, true); + + texture = gluTexture.cubeFromFormat(gl, gl.RGBA, gl.UNSIGNED_BYTE, width); + refTexture = texture.getRefTexture(); + this.m_texturesCube.push(texture); + + for (var face in tcuTexture.CubeFace) { + refTexture.allocLevel(tcuTexture.CubeFace[face], 0); + es3fUniformApiTests.fillWithColor(refTexture.getLevelFace(0, tcuTexture.CubeFace[face]), color); + } + + gl.activeTexture(gl.TEXTURE0 + value.val.samplerV.unit); + this.m_filledTextureUnits.push(value.val.samplerV.unit); + texture.upload(); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + } else + throw new Error('es3fUniformApiTests.UniformCase.prototype.setupTexture - Invalid sampler type'); + }; + + /** + * @param {Array} basicUniformReportsDst + * @param {Array} basicUniformReportsRef + * @param {WebGLProgram} programGL + * @return {boolean} + */ + es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne = function(basicUniformReportsDst, basicUniformReportsRef, programGL) { + /** @type {WebGLProgram} */ var numActiveUniforms; + /** @type {boolean} */ var success = true; + + numActiveUniforms = /** @type {WebGLProgram} */ (gl.getProgramParameter(programGL, gl.ACTIVE_UNIFORMS)); + bufferedLogToConsole('// Number of active uniforms reported: ' + numActiveUniforms); + + for (var unifNdx = 0; unifNdx < numActiveUniforms; unifNdx++) { + /** @type {number} (GLint)*/ var reportedSize = -1; + /** @type {number} (GLenum)*/ var reportedTypeGL = gl.NONE; + /** @type {gluShaderUtil.DataType} */ var reportedType; + /** @type {string} */ var reportedNameStr; + /** @type {WebGLActiveInfo} */ var activeInfo; + + activeInfo = gl.getActiveUniform(programGL, unifNdx); + + reportedNameStr = activeInfo.name; + reportedTypeGL = activeInfo.type; + reportedSize = activeInfo.size; + + reportedType = gluShaderUtil.getDataTypeFromGLType(reportedTypeGL); + + checkMessage(reportedType !== undefined, 'Invalid uniform type'); + + bufferedLogToConsole('// Got name = ' + reportedNameStr + ', size = ' + reportedSize + ', type = ' + gluShaderUtil.getDataTypeName(reportedType)); + + // Ignore built-in uniforms. + if (reportedNameStr.indexOf('gl_') == -1) { + /** @type {number} */ var referenceNdx; + for (referenceNdx = 0; referenceNdx < basicUniformReportsRef.length; referenceNdx++) { + if (basicUniformReportsRef[referenceNdx].name == reportedNameStr) + break; + } + + if (referenceNdx >= basicUniformReportsRef.length) { + bufferedLogToConsole('// FAILURE: invalid non-built-in uniform name reported'); + success = false; + } else { + /** @type {es3fUniformApiTests.BasicUniformReportRef} */ var reference = basicUniformReportsRef[referenceNdx]; + + assertMsgOptions( + reference.type !== undefined, + 'es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne - type is undefined', + false, + true + ); + assertMsgOptions( + reference.minSize >= 1 || (reference.minSize == 0 && !reference.isUsedInShader), + 'es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne - uniform min size does not match usage in shader', + false, + true + ); + assertMsgOptions( + reference.minSize <= reference.maxSize, + 'es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne - uniform min size bigger than max size', + false, + true + ); + + if (es3fUniformApiTests.BasicUniformReportGL.findWithName(basicUniformReportsDst, reportedNameStr) !== null) { + bufferedLogToConsole('// FAILURE: same uniform name reported twice'); + success = false; + } + + basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportGL(reportedNameStr, reportedNameStr.length, reportedSize, reportedType, unifNdx)); + + if (reportedType != reference.type) { + bufferedLogToConsole('// FAILURE: wrong type reported, should be ' + gluShaderUtil.getDataTypeName(reference.type)); + success = false; + } + if (reportedSize < reference.minSize || reportedSize > reference.maxSize) { + bufferedLogToConsole('// FAILURE: wrong size reported, should be ' + + (reference.minSize == reference.maxSize ? reference.minSize : 'in the range [' + reference.minSize + ', ' + reference.maxSize + ']')); + + success = false; + } + } + } + } + + for (var i = 0; i < basicUniformReportsRef.length; i++) { + /** @type {es3fUniformApiTests.BasicUniformReportRef} */ var expected = basicUniformReportsRef[i]; + if (expected.isUsedInShader && es3fUniformApiTests.BasicUniformReportGL.findWithName(basicUniformReportsDst, expected.name) === null) { + bufferedLogToConsole('// FAILURE: uniform with name ' + expected.name + ' was not reported by GL'); + success = false; + } + } + + return success; + }; + + /** + * @param {Array} basicUniformReportsDst + * @param {Array} basicUniformReportsRef + * @param {WebGLProgram} programGL + * @return {boolean} + */ + es3fUniformApiTests.UniformCase.prototype.getActiveUniforms = function(basicUniformReportsDst, basicUniformReportsRef, programGL) { + /** @type {Array} */ var queryNames = new Array(basicUniformReportsRef.length); + /** @type {Array} */ var queryNamesC = new Array(basicUniformReportsRef.length); + /** @type {Array} (GLuint) */ var uniformIndices = new Array(basicUniformReportsRef.length); + /** @type {Array} */ var validUniformIndices = []; // This shall have the same contents, and in same order, as uniformIndices, but with gl.INVALID_INDEX entries removed. + /** @type {boolean} */ var success = true; + + for (var i = 0; i < basicUniformReportsRef.length; i++) { + /** @type {string} */ var name = basicUniformReportsRef[i].name; + queryNames[i] = this.m_features.ARRAY_FIRST_ELEM_NAME_NO_INDEX && name[name.length - 1] == ']' ? es3fUniformApiTests.beforeLast(name, '[') : name; + queryNamesC[i] = queryNames[i]; + } + + uniformIndices = gl.getUniformIndices(programGL, queryNamesC); + + for (var i = 0; i < uniformIndices.length; i++) { + if (uniformIndices[i] != gl.INVALID_INDEX) + validUniformIndices.push(uniformIndices[i]); + else { + if (basicUniformReportsRef[i].isUsedInShader) { + bufferedLogToConsole('// FAILURE: uniform with name ' + basicUniformReportsRef[i].name + ' received gl.INVALID_INDEX'); + success = false; + } + } + } + + if (validUniformIndices.length > 0) { + /** @type {Array} */ var uniformNameBuf = new Array(validUniformIndices.length); + /** @type {Array} (GLint) */ var uniformSizeBuf = new Array(validUniformIndices.length); + /** @type {Array} (GLint) */ var uniformTypeBuf = new Array(validUniformIndices.length); + + uniformSizeBuf = gl.getActiveUniforms(programGL, validUniformIndices, gl.UNIFORM_SIZE); + uniformTypeBuf = gl.getActiveUniforms(programGL, validUniformIndices, gl.UNIFORM_TYPE); + + /** @type {number} */ var validNdx = -1; // Keeps the corresponding index to validUniformIndices while unifNdx is the index to uniformIndices. + for (var unifNdx = 0; unifNdx < uniformIndices.length; unifNdx++) { + if (uniformIndices[unifNdx] == gl.INVALID_INDEX) + continue; + + validNdx++; + + /** @type {es3fUniformApiTests.BasicUniformReportRef} */ var reference = basicUniformReportsRef[unifNdx]; + /** @type {number} */ var reportedIndex = validUniformIndices[validNdx]; + /** @type {number} */ var reportedNameLength = reference.name.length; + /** @type {number} */ var reportedSize = uniformSizeBuf[validNdx]; + /** @type {gluShaderUtil.DataType} */ var reportedType = gluShaderUtil.getDataTypeFromGLType(uniformTypeBuf[validNdx]); + /** @type {string} */ var reportedNameStr = reference.name; + + bufferedLogToConsole('// Got name size = ' + reportedSize + + ', type = ' + gluShaderUtil.getDataTypeName(reportedType) + + ' for the uniform at index ' + reportedIndex + ' (' + reference.name + ')'); + + assertMsgOptions( + reference.type !== undefined, + 'es3fUniformApiTests.UniformCase.prototype.getActiveUniforms - type is undefined', + false, + true + ); + assertMsgOptions( + reference.minSize >= 1 || (reference.minSize == 0 && !reference.isUsedInShader), + 'es3fUniformApiTests.UniformCase.prototype.getActiveUniforms - uniform min size does not match usage in shader', + false, + true + ); + assertMsgOptions( + reference.minSize <= reference.maxSize, + 'es3fUniformApiTests.UniformCase.prototype.getActiveUniforms - uniform min size bigger than max size', + false, + true + ); + + if (es3fUniformApiTests.BasicUniformReportGL.findWithName(basicUniformReportsDst, reportedNameStr) !== null) { + bufferedLogToConsole('// FAILURE: same uniform name reported twice'); + success = false; + } + basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportGL(reference.name, reportedNameLength, reportedSize, reportedType, reportedIndex)); + + if (reportedType != reference.type) { + bufferedLogToConsole('// FAILURE: wrong type reported, should be ' + gluShaderUtil.getDataTypeName(reference.type)); + success = false; + } + + if (reportedSize < reference.minSize || reportedSize > reference.maxSize) { + bufferedLogToConsole('// FAILURE: wrong size reported, should be ' + + (reference.minSize == reference.maxSize ? reference.minSize : 'in the range [' + reference.minSize + ', ' + reference.maxSize + ']')); + + success = false; + } + } + } + + return success; + }; + + /** + * @param {Array} uniformResults + * @param {Array} uniformsResults + * @return {boolean} + */ + es3fUniformApiTests.UniformCase.prototype.uniformVsUniformsComparison = function(uniformResults, uniformsResults) { + /** @type {boolean} */ var success = true; + /** @type {es3fUniformApiTests.BasicUniformReportGL} */ var uniformsResult; + + for (var uniformResultNdx = 0; uniformResultNdx < uniformResults.length; uniformResultNdx++) { + /** @type {es3fUniformApiTests.BasicUniformReportGL} */ var uniformResult = uniformResults[uniformResultNdx]; + /** @type {string} */ var uniformName = uniformResult.name; + uniformsResult = es3fUniformApiTests.BasicUniformReportGL.findWithName(uniformsResults, uniformName); + + if (uniformsResult !== null) { + bufferedLogToConsole('// Checking uniform ' + uniformName); + + if (uniformResult.index != uniformsResult.index) { + bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetUniformIndices() gave different indices for uniform ' + uniformName); + success = false; + } + if (uniformResult.nameLength != uniformsResult.nameLength) { + bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetActiveUniforms() gave incompatible name lengths for uniform ' + uniformName); + success = false; + } + if (uniformResult.size != uniformsResult.size) { + bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetActiveUniforms() gave different sizes for uniform ' + uniformName); + success = false; + } + if (uniformResult.type != uniformsResult.type) { + bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetActiveUniforms() gave different types for uniform ' + uniformName); + success = false; + } + } else { + bufferedLogToConsole('// FAILURE: uniform ' + uniformName + ' was reported active by glGetActiveUniform() but not by glGetUniformIndices()'); + success = false; + } + } + + for (var uniformsResultNdx = 0; uniformsResultNdx < uniformsResults.length; uniformsResultNdx++) { + uniformsResult = uniformsResults[uniformsResultNdx]; + /** @type {string} */ var uniformsName = uniformsResult.name; + /** @type {es3fUniformApiTests.BasicUniformReportGL} */ var uniformsResultIt = es3fUniformApiTests.BasicUniformReportGL.findWithName(uniformsResults, uniformsName); + + if (uniformsResultIt === null) { + bufferedLogToConsole('// FAILURE: uniform ' + uniformsName + ' was reported active by glGetUniformIndices() but not by glGetActiveUniform()'); + success = false; + } + } + + return success; + }; + + /** + * @param {Array} valuesDst + * @param {Array} basicUniforms + * @param {WebGLProgram} programGL + * @return {boolean} + */ + es3fUniformApiTests.UniformCase.prototype.getUniforms = function(valuesDst, basicUniforms, programGL) { + /** @type {boolean} */ var success = true; + + for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) { + /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx]; + /** @type {string} */ var queryName = this.m_features.ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? es3fUniformApiTests.beforeLast(uniform.name, '[') : uniform.name; + /** @type {WebGLUniformLocation} */ var location = gl.getUniformLocation(programGL, queryName); + /** @type {number} */ var size = gluShaderUtil.getDataTypeScalarSize(uniform.type); + /** @type {es3fUniformApiTests.VarValue} */ var value = new es3fUniformApiTests.VarValue(); + + if (!location) { + value.type = gluShaderUtil.DataType.INVALID; + valuesDst.push(value); + if (uniform.isUsedInShader) { + bufferedLogToConsole('// FAILURE: ' + uniform.name + ' was used in shader, but has location -1'); + success = false; + } + continue; + } + + value.type = uniform.type; + + var result = /** @type {number} */ (gl.getUniform(programGL, location)); + + if (gluShaderUtil.isDataTypeSampler(uniform.type)) { + value.val = new es3fUniformApiTests.SamplerV(); + value.val.samplerV.unit = result; + } else + value.val = /** @type {Array} */ (result.length === undefined ? [result] : result); + + valuesDst.push(value); + + bufferedLogToConsole('// Got ' + uniform.name + ' value ' + es3fUniformApiTests.apiVarValueStr(value)); + } + + return success; + }; + + /** + * @param {Array} values + * @param {Array} basicUniforms + * @return {boolean} + */ + es3fUniformApiTests.UniformCase.prototype.checkUniformDefaultValues = function(values, basicUniforms) { + /** @type {boolean} */ var success = true; + + assertMsgOptions( + values.length == basicUniforms.length, + 'es3fUniformApiTests.UniformCase.prototype.checkUniformDefaultValues - lengths do not match', + false, + true + ); + + for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) { + /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx]; + /** @type {es3fUniformApiTests.VarValue} */ var unifValue = values[unifNdx]; + /** @type {number} */ var valSize = gluShaderUtil.getDataTypeScalarSize(uniform.type); + + bufferedLogToConsole('// Checking uniform ' + uniform.name); + + if (unifValue.type == gluShaderUtil.DataType.INVALID) // This happens when glGetUniformLocation() returned -1. + continue; + + var CHECK_UNIFORM = function(ZERO) { + do { + for (var i = 0; i < valSize; i++) { + if (unifValue.val[i] != ZERO) { + bufferedLogToConsole('// FAILURE: uniform ' + uniform.name + ' has non-zero initial value'); + success = false; + } + } + } while (false); + }; + + if (gluShaderUtil.isDataTypeFloatOrVec(uniform.type) || gluShaderUtil.isDataTypeMatrix(uniform.type)) + CHECK_UNIFORM(0.0); + else if (gluShaderUtil.isDataTypeIntOrIVec(uniform.type)) + CHECK_UNIFORM(0); + else if (gluShaderUtil.isDataTypeUintOrUVec(uniform.type)) + CHECK_UNIFORM(0); + else if (gluShaderUtil.isDataTypeBoolOrBVec(uniform.type)) + CHECK_UNIFORM(false); + else if (gluShaderUtil.isDataTypeSampler(uniform.type)) { + if (unifValue.val.samplerV.unit != 0) { + bufferedLogToConsole('// FAILURE: uniform ' + uniform.name + ' has non-zero initial value'); + success = false; + } + } else + throw new Error('es3fUniformApiTests.UniformCase.prototype.checkUniformDefaultValues - invalid uniform type'); + } + + return success; + }; + + /** + * @param {Array} basicUniforms + * @param {WebGLProgram} programGL + * @param {deRandom.Random} rnd + */ + es3fUniformApiTests.UniformCase.prototype.assignUniforms = function(basicUniforms, programGL, rnd) { + /** @type {boolean} */ var transpose = false; //No support to transpose uniform matrices in WebGL, must always be false. (this.m_features.MATRIXMODE_ROWMAJOR) != 0; + /** @type {boolean} (GLboolean) */ var transposeGL = transpose; + /** @type {gluShaderUtil.DataType} */ var boolApiType = this.m_features.BOOLEANAPITYPE_INT ? gluShaderUtil.DataType.INT : + this.m_features.BOOLEANAPITYPE_UINT ? gluShaderUtil.DataType.UINT : + gluShaderUtil.DataType.FLOAT; + + for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) { + /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx]; + /** @type {boolean} */ var isArrayMember = uniform.elemNdx >= 0; + /** @type {string} */ var queryName = this.m_features.ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? es3fUniformApiTests.beforeLast(uniform.name, '[') : uniform.name; + /** @type {number} */ var numValuesToAssign = !isArrayMember ? 1 : + this.m_features.ARRAYASSIGN_FULL ? (uniform.elemNdx == 0 ? uniform.rootSize : 0) : + this.m_features.ARRAYASSIGN_BLOCKS_OF_TWO ? (uniform.elemNdx % 2 == 0 ? 2 : 0) : + /* Default: assign array elements separately */ 1; + + assertMsgOptions( + numValuesToAssign >= 0, + 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - number of values to assign not a positive integer', + false, + true + ); + assertMsgOptions( + numValuesToAssign == 1 || isArrayMember, + 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - not an array member and number of values to assign not 1', + false, + true + ); + + if (numValuesToAssign == 0) { + bufferedLogToConsole('// es3fUniformApiTests.Uniform ' + uniform.name + ' is covered by another glUniform*v() call to the same array'); + continue; + } + + /** @type {WebGLUniformLocation} */ var location = gl.getUniformLocation(programGL, queryName); + /** @type {number} */ var typeSize = gluShaderUtil.getDataTypeScalarSize(uniform.type); + /** @type {boolean} */ var assignByValue = this.m_features.UNIFORMFUNC_VALUE && !gluShaderUtil.isDataTypeMatrix(uniform.type) && numValuesToAssign == 1; + /** @type {Array} */ var valuesToAssign = []; + /** @type {Array} */ var buffer; + + for (var i = 0; i < numValuesToAssign; i++) { + /** @type {string} */ var curName = isArrayMember ? es3fUniformApiTests.beforeLast(uniform.rootName, '[') + '[' + (uniform.elemNdx + i) + ']' : uniform.name; + /** @type {es3fUniformApiTests.VarValue} */ var unifValue = new es3fUniformApiTests.VarValue(); + + if (isArrayMember) { + /** @type {es3fUniformApiTests.BasicUniform} */ var elemUnif = es3fUniformApiTests.BasicUniform.findWithName(basicUniforms, curName); + if (elemUnif === null) + continue; + unifValue = elemUnif.finalValue; + } else + unifValue = uniform.finalValue; + + /** @type {es3fUniformApiTests.VarValue} */ var apiValue = gluShaderUtil.isDataTypeBoolOrBVec(unifValue.type) ? es3fUniformApiTests.getRandomBoolRepresentation(unifValue, boolApiType, rnd) : + gluShaderUtil.isDataTypeSampler(unifValue.type) ? es3fUniformApiTests.getSamplerUnitValue(unifValue) : + unifValue; + + valuesToAssign.push(gluShaderUtil.isDataTypeMatrix(apiValue.type) && transpose ? es3fUniformApiTests.getTransposeMatrix(apiValue) : apiValue); + + if (gluShaderUtil.isDataTypeBoolOrBVec(uniform.type)) + bufferedLogToConsole('// Using type ' + gluShaderUtil.getDataTypeName(boolApiType) + ' to set boolean value ' + es3fUniformApiTests.apiVarValueStr(unifValue) + ' for ' + curName); + else if (gluShaderUtil.isDataTypeSampler(uniform.type)) + bufferedLogToConsole('// Texture for the sampler uniform ' + curName + ' will be filled with color ' + es3fUniformApiTests.apiVarValueStr(es3fUniformApiTests.getSamplerFillValue(uniform.finalValue))); + } + + assertMsgOptions( + valuesToAssign.length > 0, + 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - values quantity less than one', + false, + true + ); + + if (gluShaderUtil.isDataTypeFloatOrVec(valuesToAssign[0].type)) { + if (assignByValue) { + switch (typeSize) { + case 1: gl.uniform1f(location, valuesToAssign[0].val[0]); break; + case 2: gl.uniform2f(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1]); break; + case 3: gl.uniform3f(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2]); break; + case 4: gl.uniform4f(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2], valuesToAssign[0].val[3]); break; + default: + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size'); + } + } else { + buffer = new Array(valuesToAssign.length * typeSize); + for (var i = 0; i < buffer.length; i++) + buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize]; + + switch (typeSize) { + case 1: gl.uniform1fv(location, buffer); break; + case 2: gl.uniform2fv(location, buffer); break; + case 3: gl.uniform3fv(location, buffer); break; + case 4: gl.uniform4fv(location, buffer); break; + default: + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size'); + } + } + } else if (gluShaderUtil.isDataTypeMatrix(valuesToAssign[0].type)) { + assertMsgOptions( + !assignByValue, + 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - assigning by value in matrix type', + false, true + ); + + buffer = new Array(valuesToAssign.length * typeSize); + for (var i = 0; i < buffer.length; i++) + buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize]; + + switch (uniform.type) { + case gluShaderUtil.DataType.FLOAT_MAT2: gl.uniformMatrix2fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT3: gl.uniformMatrix3fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT4: gl.uniformMatrix4fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT2X3: gl.uniformMatrix2x3fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT2X4: gl.uniformMatrix2x4fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT3X2: gl.uniformMatrix3x2fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT3X4: gl.uniformMatrix3x4fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT4X2: gl.uniformMatrix4x2fv(location, transposeGL, new Float32Array(buffer)); break; + case gluShaderUtil.DataType.FLOAT_MAT4X3: gl.uniformMatrix4x3fv(location, transposeGL, new Float32Array(buffer)); break; + default: + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid uniform type'); + } + } else if (gluShaderUtil.isDataTypeIntOrIVec(valuesToAssign[0].type)) { + if (assignByValue) { + switch (typeSize) { + case 1: gl.uniform1i(location, valuesToAssign[0].val[0]); break; + case 2: gl.uniform2i(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1]); break; + case 3: gl.uniform3i(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2]); break; + case 4: gl.uniform4i(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2], valuesToAssign[0].val[3]); break; + default: + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size'); + } + } else { + buffer = new Array(valuesToAssign.length * typeSize); + for (var i = 0; i < buffer.length; i++) + buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize]; + + switch (typeSize) { + case 1: gl.uniform1iv(location, buffer); break; + case 2: gl.uniform2iv(location, buffer); break; + case 3: gl.uniform3iv(location, buffer); break; + case 4: gl.uniform4iv(location, buffer); break; + default: + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size'); + } + } + } else if (gluShaderUtil.isDataTypeUintOrUVec(valuesToAssign[0].type)) { + if (assignByValue) { + switch (typeSize) { + case 1: gl.uniform1ui(location, valuesToAssign[0].val[0]); break; + case 2: gl.uniform2ui(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1]); break; + case 3: gl.uniform3ui(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2]); break; + case 4: gl.uniform4ui(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2], valuesToAssign[0].val[3]); break; + default: + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size'); + } + } else { + buffer = new Array(valuesToAssign.length * typeSize); + for (var i = 0; i < buffer.length; i++) + buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize]; + + switch (typeSize) { + case 1: gl.uniform1uiv(location, buffer); break; + case 2: gl.uniform2uiv(location, buffer); break; + case 3: gl.uniform3uiv(location, buffer); break; + case 4: gl.uniform4uiv(location, buffer); break; + default: + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size'); + } + } + } else if (gluShaderUtil.isDataTypeSampler(valuesToAssign[0].type)) { + if (assignByValue) + gl.uniform1i(location, uniform.finalValue.val.samplerV.unit); + else { + var unit = /** @type {Array} */ (uniform.finalValue.val); + gl.uniform1iv(location, unit); + } + } else + throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid uniform type'); + } + }; + + /** + * @param {Array} values + * @param {Array} basicUniforms + * @return {boolean} + */ + es3fUniformApiTests.UniformCase.prototype.compareUniformValues = function(values, basicUniforms) { + /** @type {boolean} */ var success = true; + + for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) { + /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx]; + /** @type {es3fUniformApiTests.VarValue} */ var unifValue = values[unifNdx]; + + bufferedLogToConsole('// Checking uniform ' + uniform.name); + + if (unifValue.type == gluShaderUtil.DataType.INVALID) // This happens when glGetUniformLocation() returned -1. + continue; + + if (!es3fUniformApiTests.apiVarValueEquals(unifValue, uniform.finalValue)) { + bufferedLogToConsole('// FAILURE: value obtained with glGetUniform*() for uniform ' + uniform.name + ' differs from value set with glUniform*()'); + success = false; + } + } + + return success; + }; + + /** @const @type {number} */ es3fUniformApiTests.VIEWPORT_WIDTH = 128; + /** @const @type {number} */ es3fUniformApiTests.VIEWPORT_HEIGHT = 128; + + /** + * @param {Array} basicUniforms + * @param {gluShaderProgram.ShaderProgram} program + * @param {deRandom.Random} rnd + * @return {boolean} + */ + es3fUniformApiTests.UniformCase.prototype.renderTest = function(basicUniforms, program, rnd) { + //const tcu::RenderTarget& renderTarget = m_context.getRenderTarget(); + /** @const */ var viewportW = Math.min(gl.canvas.width, es3fUniformApiTests.VIEWPORT_WIDTH); + /** @const */ var viewportH = Math.min(gl.canvas.height, es3fUniformApiTests.VIEWPORT_HEIGHT); + /** @const */ var viewportX = rnd.getInt(0, gl.canvas.width - viewportW); + /** @const */ var viewportY = rnd.getInt(0, gl.canvas.height - viewportH); + /** @type {tcuSurface.Surface} */ var renderedImg = new tcuSurface.Surface(viewportW, viewportH); + + // Assert that no two samplers of different types have the same texture unit - this is an error in GL. + for (var i = 0; i < basicUniforms.length; i++) { + if (gluShaderUtil.isDataTypeSampler(basicUniforms[i].type)) { + for (var j = 0; j < i; j++) { + if (gluShaderUtil.isDataTypeSampler(basicUniforms[j].type) && basicUniforms[i].type != basicUniforms[j].type) + assertMsgOptions( + basicUniforms[i].finalValue.val.samplerV.unit != basicUniforms[j].finalValue.val.samplerV.unit, + 'es3fUniformApiTests.UniformCase.prototype.renderTest - sampler units have the same texture unit', + false, true + ); + } + } + } + + for (var i = 0; i < basicUniforms.length; i++) { + if (gluShaderUtil.isDataTypeSampler(basicUniforms[i].type) && this.m_filledTextureUnits.indexOf(basicUniforms[i].finalValue.val) == -1) { + bufferedLogToConsole('// Filling texture at unit ' + es3fUniformApiTests.apiVarValueStr(basicUniforms[i].finalValue) + ' with color ' + es3fUniformApiTests.shaderVarValueStr(basicUniforms[i].finalValue)); + this.setupTexture(basicUniforms[i].finalValue); + } + } + + gl.viewport(viewportX, viewportY, viewportW, viewportH); + + /** @type {Float32Array} */ var position = new Float32Array([ + -1.0, -1.0, 0.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0 + ]); + + /** @type {Uint16Array} */ + var indices = new Uint16Array([0, 1, 2, 2, 1, 3]); + + /** @type {number} */ var posLoc = gl.getAttribLocation(program.getProgram(), 'a_position'); + gl.enableVertexAttribArray(posLoc); + + var gl_position_buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, gl_position_buffer); + gl.bufferData(gl.ARRAY_BUFFER, position, gl.STATIC_DRAW); + gl.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0); + + var gl_index_buffer = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl_index_buffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW); + + gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0); + + renderedImg.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]); + + /** @type {number} */ var numFailedPixels = 0; + var whitePixel = new gluDrawUtil.Pixel([255.0, 255.0, 255.0, 255.0]); + for (var y = 0; y < renderedImg.getHeight(); y++) { + for (var x = 0; x < renderedImg.getWidth(); x++) { + var currentPixel = new gluDrawUtil.Pixel(renderedImg.getPixel(x, y)); + if (!whitePixel.equals(currentPixel)) + numFailedPixels += 1; + } + } + + if (numFailedPixels > 0) { + //TODO: log << TestLog::Image("RenderedImage", "Rendered image", renderedImg); + bufferedLogToConsole('FAILURE: image comparison failed, got ' + numFailedPixels + ' non-white pixels'); + return false; + } else { + bufferedLogToConsole('Success: got all-white pixels (all uniforms have correct values)'); + return true; + } + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + es3fUniformApiTests.UniformCase.prototype.iterate = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ deRandom.getBaseSeed()); + /** @type {Array} */ var basicUniforms = []; + /** @type {Array} */ var basicUniformReportsRef = []; + + /** @type {number} */ var samplerUnitCounter = 0; + for (var i = 0; i < this.m_uniformCollection.getNumUniforms(); i++) + samplerUnitCounter = this.generateBasicUniforms(basicUniforms, basicUniformReportsRef, this.m_uniformCollection.getUniform(i).type, this.m_uniformCollection.getUniform(i).name, true, samplerUnitCounter, rnd); + + /** @type {string} */ var vertexSource = this.generateVertexSource(basicUniforms); + /** @type {string} */ var fragmentSource = this.generateFragmentSource(basicUniforms); + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexSource, fragmentSource)); + + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) { + testFailedOptions('Compile failed', false); + return tcuTestCase.IterateResult.STOP; + } + + gl.useProgram(program.getProgram()); + + /** @type {boolean} */ var success = this.test(basicUniforms, basicUniformReportsRef, program, rnd); + assertMsgOptions(success, '', true, false); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @enum {number} + */ + es3fUniformApiTests.CaseType = { + UNIFORM: 0, //!< Check info returned by glGetActiveUniform(). + INDICES_UNIFORMSIV: 1, //!< Check info returned by glGetUniformIndices() + glGetActiveUniforms(). TODO: Check 'IV' part + CONSISTENCY: 2 //!< Query info with both above methods, and check consistency. + }; + + /** + * es3fUniformApiTests.UniformInfoQueryCase class + * @constructor + * @param {string} name + * @param {string} description + * @param {es3fUniformApiTests.CaseShaderType} shaderType + * @param {es3fUniformApiTests.UniformCollection} uniformCollection + * @param {es3fUniformApiTests.CaseType} caseType + * @param {es3fUniformApiTests.Feature} additionalFeatures + * @extends {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformInfoQueryCase = function(name, description, shaderType, uniformCollection, caseType, additionalFeatures) { + es3fUniformApiTests.UniformCase.call(this, name, description); + this.newB(shaderType, uniformCollection, additionalFeatures); + /** @type {es3fUniformApiTests.CaseType} */ this.m_caseType = caseType; + }; + + es3fUniformApiTests.UniformInfoQueryCase.prototype = Object.create(es3fUniformApiTests.UniformCase.prototype); + /** Constructor restore */ + es3fUniformApiTests.UniformInfoQueryCase.prototype.constructor = es3fUniformApiTests.UniformInfoQueryCase; + + /** + * @param {es3fUniformApiTests.CaseType} caseType + * @return {?string} + */ + es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeName = function(caseType) { + switch (caseType) { + case es3fUniformApiTests.CaseType.UNIFORM: return 'active_uniform'; + case es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV: return 'indices_active_uniformsiv'; + case es3fUniformApiTests.CaseType.CONSISTENCY: return 'consistency'; + default: + throw new Error('Invalid type'); + } + }; + + /** + * @param {es3fUniformApiTests.CaseType} caseType + * @return {?string} + */ + es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeDescription = function(caseType) { + switch (caseType) { + case es3fUniformApiTests.CaseType.UNIFORM: return 'Test glGetActiveUniform()'; + case es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV: return 'Test glGetUniformIndices() along with glGetActiveUniforms()'; + case es3fUniformApiTests.CaseType.CONSISTENCY: return 'Check consistency between results from glGetActiveUniform() and glGetUniformIndices() + glGetActiveUniforms()'; + default: + throw new Error('Invalid type'); + } + }; + + // \note Although this is only used in UniformApiTest::es3fUniformApiTests.init, it needs to be defined here as it's used as a template argument. + /** + * @constructor + * @param {?string} name + * @param {es3fUniformApiTests.UniformCollection} uniformCollection_ + */ + es3fUniformApiTests.UniformCollectionCase = function(name, uniformCollection_) { + /** @type {string} */ this.namePrefix = name ? name + '_' : ''; + /** @type {es3fUniformApiTests.UniformCollection} (SharedPtr) */ this.uniformCollection = uniformCollection_; + }; + + /** + * @param {Array} basicUniforms + * @param {Array} basicUniformReportsRef + * @param {gluShaderProgram.ShaderProgram} program + * @param {deRandom.Random} rnd + * @return {boolean} + */ + es3fUniformApiTests.UniformInfoQueryCase.prototype.test = function(basicUniforms, basicUniformReportsRef, program, rnd) { + /** @type {WebGLProgram} */ var programGL = program.getProgram(); + /** @type {Array} */ var basicUniformReportsUniform = []; + /** @type {Array} */ var basicUniformReportsUniforms = []; + /** @type {boolean} */ var success; + + if (this.m_caseType == es3fUniformApiTests.CaseType.UNIFORM || this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY) { + success = false; + + //TODO:: const ScopedLogSection section(log, "InfoGetActiveUniform", "es3fUniformApiTests.Uniform information queries with glGetActiveUniform()"); + success = this.getActiveUniformsOneByOne(basicUniformReportsUniform, basicUniformReportsRef, programGL); + + if (!success) { + if (this.m_caseType == es3fUniformApiTests.CaseType.UNIFORM) + return false; + else { + assertMsgOptions( + this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY, + 'es3fUniformApiTests.UniformInfoQueryCase.prototype.test - case type is not consistency', + false, + true + ); + bufferedLogToConsole('// Note: this is a consistency case, so ignoring above failure(s)'); + } + } + } + + if (this.m_caseType == es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV || this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY) { + success = false; + + //TODO: const ScopedLogSection section(log, "InfoGetActiveUniforms", "es3fUniformApiTests.Uniform information queries with glGetUniformIndices() and glGetActiveUniforms()"); + success = this.getActiveUniforms(basicUniformReportsUniforms, basicUniformReportsRef, programGL); + + if (!success) { + if (this.m_caseType == es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV) + return false; + else { + assertMsgOptions( + this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY, + 'es3fUniformApiTests.UniformInfoQueryCase.prototype.test - case type is not consistency', + false, + true + ); + bufferedLogToConsole('// Note: this is a consistency case, so ignoring above failure(s)'); + } + } + } + + if (this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY) { + success = false; + + //TODO: const ScopedLogSection section(log, "CompareUniformVsUniforms", "Comparison of results from glGetActiveUniform() and glGetActiveUniforms()"); + success = this.uniformVsUniformsComparison(basicUniformReportsUniform, basicUniformReportsUniforms); + + if (!success) + return false; + } + + return true; + }; + + /** + * @enum {number} + */ + es3fUniformApiTests.ValueToCheck = { + INITIAL: 0, //!< Verify the initial values of the uniforms (i.e. check that they're zero). + ASSIGNED: 1 //!< Assign values to uniforms with glUniform*(), and check those. + }; + + /** + * @enum {number} + */ + es3fUniformApiTests.CheckMethod = { + GET_UNIFORM: 0, //!< Check values with glGetUniform*(). + RENDER: 1 //!< Check values by rendering with the value-checking shader. + }; + + /** + * @enum {number} + */ + es3fUniformApiTests.AssignMethod = { + POINTER: 0, + VALUE: 1 + }; + + /** + * es3fUniformApiTests.UniformValueCase test class + * @constructor + * @param {string} name + * @param {string} description + * @param {es3fUniformApiTests.CaseShaderType} shaderType + * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr) + * @param {es3fUniformApiTests.ValueToCheck} valueToCheck + * @param {es3fUniformApiTests.CheckMethod} checkMethod + * @param {?es3fUniformApiTests.AssignMethod} assignMethod + * @param {es3fUniformApiTests.Feature} additionalFeatures + * @extends {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.UniformValueCase = function(name, description, shaderType, uniformCollection, valueToCheck, checkMethod, assignMethod, additionalFeatures) { + es3fUniformApiTests.UniformCase.call(this, name, description); + + additionalFeatures.UNIFORMVALUE_ZERO |= valueToCheck == es3fUniformApiTests.ValueToCheck.INITIAL; + additionalFeatures.UNIFORMFUNC_VALUE |= assignMethod == es3fUniformApiTests.AssignMethod.VALUE; + this.newB(shaderType, uniformCollection, additionalFeatures); + + this.m_valueToCheck = valueToCheck; + this.m_checkMethod = checkMethod; + + assertMsgOptions( + !(assignMethod === undefined && valueToCheck == es3fUniformApiTests.ValueToCheck.ASSIGNED), + 'es3fUniformApiTests.UniformValueCase - assign method is undefined when value to check requires it', + false, + true + ); + }; + + es3fUniformApiTests.UniformValueCase.prototype = Object.create(es3fUniformApiTests.UniformCase.prototype); + /** Constructor restore */ + es3fUniformApiTests.UniformValueCase.prototype.constructor = es3fUniformApiTests.UniformValueCase; + + /** + * @param {es3fUniformApiTests.ValueToCheck} valueToCheck + * @return {?string} + */ + es3fUniformApiTests.UniformValueCase.getValueToCheckName = function(valueToCheck) { + switch (valueToCheck) { + case es3fUniformApiTests.ValueToCheck.INITIAL: return 'initial'; + case es3fUniformApiTests.ValueToCheck.ASSIGNED: return 'assigned'; + default: throw new Error('es3fUniformApiTests.UniformValueCase.getValueToCheckName - Invalid value to check option'); + } + }; + + /** + * @param {es3fUniformApiTests.ValueToCheck} valueToCheck + * @return {?string} + */ + es3fUniformApiTests.UniformValueCase.getValueToCheckDescription = function(valueToCheck) { + switch (valueToCheck) { + case es3fUniformApiTests.ValueToCheck.INITIAL: return 'Check initial uniform values (zeros)'; + case es3fUniformApiTests.ValueToCheck.ASSIGNED: return 'Check assigned uniform values'; + default: throw new Error('es3fUniformApiTests.UniformValueCase.getValueToCheckDescription - Invalid value to check option'); + } + }; + + /** + * @param {es3fUniformApiTests.CheckMethod} checkMethod + * @return {?string} + */ + es3fUniformApiTests.UniformValueCase.getCheckMethodName = function(checkMethod) { + switch (checkMethod) { + case es3fUniformApiTests.CheckMethod.GET_UNIFORM: return 'get_uniform'; + case es3fUniformApiTests.CheckMethod.RENDER: return 'render'; + default: throw new Error('es3fUniformApiTests.UniformValueCase.getCheckMethodName - Invalid check method'); + } + }; + + /** + * @param {es3fUniformApiTests.CheckMethod} checkMethod + * @return {?string} + */ + es3fUniformApiTests.UniformValueCase.getCheckMethodDescription = function(checkMethod) { + switch (checkMethod) { + case es3fUniformApiTests.CheckMethod.GET_UNIFORM: return 'Verify values with glGetUniform*()'; + case es3fUniformApiTests.CheckMethod.RENDER: return 'Verify values by rendering'; + default: throw new Error('es3fUniformApiTests.UniformValueCase.getCheckMethodDescription - Invalid check method'); + } + }; + + /** + * @param {es3fUniformApiTests.AssignMethod} assignMethod + * @return {?string} + */ + es3fUniformApiTests.UniformValueCase.getAssignMethodName = function(assignMethod) { + switch (assignMethod) { + case es3fUniformApiTests.AssignMethod.POINTER: return 'by_pointer'; + case es3fUniformApiTests.AssignMethod.VALUE: return 'by_value'; + default: throw new Error('es3fUniformApiTests.UniformValueCase.getAssignMethodName - Invalid assign method'); + } + }; + + /** + * @param {es3fUniformApiTests.AssignMethod} assignMethod + * @return {?string} + */ + es3fUniformApiTests.UniformValueCase.getAssignMethodDescription = function(assignMethod) { + switch (assignMethod) { + case es3fUniformApiTests.AssignMethod.POINTER: return 'Assign values by-pointer'; + case es3fUniformApiTests.AssignMethod.VALUE: return 'Assign values by-value'; + default: throw new Error('es3fUniformApiTests.UniformValueCase.getAssignMethodDescription - Invalid assign method'); + } + }; + + /** + * es3fUniformApiTests.UniformValueCase test function + * @param {Array} basicUniforms + * @param {Array} basicUniformReportsRef + * @param {gluShaderProgram.ShaderProgram} program + * @param {deRandom.Random} rnd + * @return {boolean} + */ + es3fUniformApiTests.UniformValueCase.prototype.test = function(basicUniforms, basicUniformReportsRef, program, rnd) { + /** @type {WebGLProgram} */ var programGL = program.getProgram(); + + if (this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.ASSIGNED) { + //TODO: const ScopedLogSection section(log, "UniformAssign", "es3fUniformApiTests.Uniform value assignments"); + this.assignUniforms(basicUniforms, programGL, rnd); + } else + assertMsgOptions( + this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.INITIAL, + 'es3fUniformApiTests.UniformValueCase.prototype.test - value to check not initial', + false, true + ); + + /** @type {boolean}*/ var success; + + if (this.m_checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM) { + /** @type {Array} */ var values = []; + + //TODO: const ScopedLogSection section(log, "GetUniforms", "es3fUniformApiTests.Uniform value query"); + success = this.getUniforms(values, basicUniforms, program.getProgram()); + + if (!success) + return false; + + if (this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.ASSIGNED) { + //TODO: const ScopedLogSection section(log, "ValueCheck", "Verify that the reported values match the assigned values"); + success = this.compareUniformValues(values, basicUniforms); + + if (!success) + return false; + } else { + assertMsgOptions( + this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.INITIAL, + 'es3fUniformApiTests.UniformValueCase.prototype.test - value to check not initial', + false, true + ); + + //TODO: const ScopedLogSection section(log, "ValueCheck", "Verify that the uniforms have correct initial values (zeros)"); + success = this.checkUniformDefaultValues(values, basicUniforms); + + if (!success) + return false; + } + } else { + assertMsgOptions( + this.m_checkMethod == es3fUniformApiTests.CheckMethod.RENDER, + 'es3fUniformApiTests.UniformValueCase.prototype.test - check method different than RENDER', + false, true + ); + + //TODO: const ScopedLogSection section(log, "RenderTest", "Render test"); + success = this.renderTest(basicUniforms, program, rnd); + + if (!success) + return false; + } + + return true; + }; + + /** + * es3fUniformApiTests.RandomUniformCase test class + * @constructor + * @param {string} name + * @param {string} description + * @param {number} seed + * @extends {es3fUniformApiTests.UniformCase} + */ + es3fUniformApiTests.RandomUniformCase = function(name, description, seed) { + es3fUniformApiTests.UniformCase.call(this, name, description); + this.newC(seed ^ deRandom.getBaseSeed()); + }; + + es3fUniformApiTests.RandomUniformCase.prototype = Object.create(es3fUniformApiTests.UniformCase.prototype); + /** Constructor restore */ + es3fUniformApiTests.RandomUniformCase.prototype.constructor = es3fUniformApiTests.RandomUniformCase; + + /** + * @param {Array} basicUniforms + * @param {Array} basicUniformReportsRef + * @param {gluShaderProgram.ShaderProgram} program + * @param {deRandom.Random} rnd + * @return {boolean} + */ + es3fUniformApiTests.RandomUniformCase.prototype.test = function(basicUniforms, basicUniformReportsRef, program, rnd) { + // \note Different sampler types may not be bound to same unit when rendering. + /** @type {boolean}*/ var renderingPossible = !this.m_features.UNIFORMVALUE_ZERO || !this.m_uniformCollection.containsSeveralSamplerTypes(); + + /** @type {boolean} */ var performGetActiveUniforms = rnd.getBool(); + /** @type {boolean} */ var performGetActiveUniformsiv = rnd.getBool(); + /** @type {boolean} */ var performUniformVsUniformsivComparison = performGetActiveUniforms && performGetActiveUniformsiv && rnd.getBool(); + /** @type {boolean} */ var performGetUniforms = rnd.getBool(); + /** @type {boolean} */ var performCheckUniformDefaultValues = performGetUniforms && rnd.getBool(); + /** @type {boolean} */ var performAssignUniforms = rnd.getBool(); + /** @type {boolean} */ var performCompareUniformValues = performGetUniforms && performAssignUniforms && rnd.getBool(); + /** @type {boolean} */ var performRenderTest = renderingPossible && performAssignUniforms && rnd.getBool(); + /** @type {WebGLProgram} */ var programGL = program.getProgram(); + + if (!(performGetActiveUniforms || performGetActiveUniformsiv || performUniformVsUniformsivComparison || performGetUniforms || performCheckUniformDefaultValues || performAssignUniforms || performCompareUniformValues || performRenderTest)) + performGetActiveUniforms = true; // Do something at least. + + var PERFORM_AND_CHECK = function(CALL, SECTION_NAME, SECTION_DESCRIPTION) { + //TODO: const ScopedLogSection section(log, (SECTION_NAME), (SECTION_DESCRIPTION)); + /** @type {boolean} */ var success = CALL(); + if (!success) + return false; + }; + + /** @type {Array} */ var reportsUniform = []; + /** @type {Array} */ var reportsUniformsiv = []; + + var current = this; //To use "this" in anonymous function. + + if (performGetActiveUniforms) + PERFORM_AND_CHECK(function() {current.getActiveUniformsOneByOne(reportsUniform, basicUniformReportsRef, programGL);}, 'InfoGetActiveUniform', 'es3fUniformApiTests.Uniform information queries with glGetActiveUniform()'); + + if (performGetActiveUniformsiv) + PERFORM_AND_CHECK(function() {current.getActiveUniforms(reportsUniformsiv, basicUniformReportsRef, programGL);}, 'InfoGetActiveUniformsiv', 'es3fUniformApiTests.Uniform information queries with glGetIndices() and glGetActiveUniformsiv()'); + + if (performUniformVsUniformsivComparison) + PERFORM_AND_CHECK(function() {current.uniformVsUniformsComparison(reportsUniform, reportsUniformsiv);}, 'CompareUniformVsUniformsiv', 'Comparison of results from glGetActiveUniform() and glGetActiveUniformsiv()'); + + /** @type {Array} */ var uniformDefaultValues = []; + + if (performGetUniforms) + PERFORM_AND_CHECK(function() {current.getUniforms(uniformDefaultValues, basicUniforms, programGL);}, 'GetUniformDefaults', 'es3fUniformApiTests.Uniform default value query'); + + if (performCheckUniformDefaultValues) + PERFORM_AND_CHECK(function() {current.checkUniformDefaultValues(uniformDefaultValues, basicUniforms);}, 'DefaultValueCheck', 'Verify that the uniforms have correct initial values (zeros)'); + + /** @type {Array} */ var uniformValues = []; + + if (performAssignUniforms) { + //TODO: const ScopedLogSection section(log, "UniformAssign", "es3fUniformApiTests.Uniform value assignments"); + this.assignUniforms(basicUniforms, programGL, rnd); + } + + if (performCompareUniformValues) { + PERFORM_AND_CHECK(function() {current.getUniforms(uniformValues, basicUniforms, programGL);}, 'GetUniforms', 'es3fUniformApiTests.Uniform value query'); + PERFORM_AND_CHECK(function() {current.compareUniformValues(uniformValues, basicUniforms);}, 'ValueCheck', 'Verify that the reported values match the assigned values'); + } + + if (performRenderTest) + PERFORM_AND_CHECK(function() {current.renderTest(basicUniforms, program, rnd);}, 'RenderTest', 'Render test'); + + return true; + }; + + /** + * Initializes the tests to be performed. + */ + es3fUniformApiTests.init = function() { + var state = tcuTestCase.runner; + var testGroup = state.testCases; + + // Generate sets of UniformCollections that are used by several cases. + /** + * @enum + */ + var UniformCollections = { + BASIC: 0, + BASIC_ARRAY: 1, + BASIC_STRUCT: 2, + STRUCT_IN_ARRAY: 3, + ARRAY_IN_STRUCT: 4, + NESTED_STRUCTS_ARRAYS: 5, + MULTIPLE_BASIC: 6, + MULTIPLE_BASIC_ARRAY: 7, + MULTIPLE_NESTED_STRUCTS_ARRAYS: 8 + }; + + /** + * @constructor + */ + var UniformCollectionGroup = function() { + /** @type {string} */ this.name = ''; + /** @type {Array} */ this.cases = []; + }; + + /** @type {Array} */ var defaultUniformCollections = new Array(Object.keys(UniformCollections).length); + + /** @type {string} */ var name; + + //Initialize + for (var i = 0; i < defaultUniformCollections.length; i++) defaultUniformCollections[i] = new UniformCollectionGroup(); + + defaultUniformCollections[UniformCollections.BASIC].name = 'basic'; + defaultUniformCollections[UniformCollections.BASIC_ARRAY].name = 'basic_array'; + defaultUniformCollections[UniformCollections.BASIC_STRUCT].name = 'basic_struct'; + defaultUniformCollections[UniformCollections.STRUCT_IN_ARRAY].name = 'struct_in_array'; + defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT].name = 'array_in_struct'; + defaultUniformCollections[UniformCollections.NESTED_STRUCTS_ARRAYS].name = 'nested_structs_arrays'; + defaultUniformCollections[UniformCollections.MULTIPLE_BASIC].name = 'multiple_basic'; + defaultUniformCollections[UniformCollections.MULTIPLE_BASIC_ARRAY].name = 'multiple_basic_array'; + defaultUniformCollections[UniformCollections.MULTIPLE_NESTED_STRUCTS_ARRAYS].name = 'multiple_nested_structs_arrays'; + + for (var dataTypeNdx = 0; dataTypeNdx < es3fUniformApiTests.s_testDataTypes.length; dataTypeNdx++) { + /** @type {gluShaderUtil.DataType} */ var dataType = es3fUniformApiTests.s_testDataTypes[dataTypeNdx]; + /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(dataType); + + defaultUniformCollections[UniformCollections.BASIC].cases.push(new es3fUniformApiTests.UniformCollectionCase(typeName, es3fUniformApiTests.UniformCollection.basic(dataType))); + + if (gluShaderUtil.isDataTypeScalar(dataType) || + (gluShaderUtil.isDataTypeVector(dataType) && gluShaderUtil.getDataTypeScalarSize(dataType) == 4) || + dataType == gluShaderUtil.DataType.FLOAT_MAT4 || + dataType == gluShaderUtil.DataType.SAMPLER_2D) + defaultUniformCollections[UniformCollections.BASIC_ARRAY].cases.push(new es3fUniformApiTests.UniformCollectionCase(typeName, es3fUniformApiTests.UniformCollection.basicArray(dataType))); + + if (gluShaderUtil.isDataTypeScalar(dataType) || + dataType == gluShaderUtil.DataType.FLOAT_MAT4 || + dataType == gluShaderUtil.DataType.SAMPLER_2D) { + /** @type {gluShaderUtil.DataType} */ var secondDataType; + if (gluShaderUtil.isDataTypeScalar(dataType)) + secondDataType = gluShaderUtil.getDataTypeVector(dataType, 4); + else if (dataType == gluShaderUtil.DataType.FLOAT_MAT4) + secondDataType = gluShaderUtil.DataType.FLOAT_MAT2; + else if (dataType == gluShaderUtil.DataType.SAMPLER_2D) + secondDataType = gluShaderUtil.DataType.SAMPLER_CUBE; + + assertMsgOptions( + secondDataType !== undefined, + 'es3fUniformApiTests.init - second data type undefined', + false, true + ); + + /** @type {string} */ var secondTypeName = gluShaderUtil.getDataTypeName(secondDataType); + name = typeName + '_' + secondTypeName; + + defaultUniformCollections[UniformCollections.BASIC_STRUCT].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.basicStruct(dataType, secondDataType, false))); + defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.basicStruct(dataType, secondDataType, true))); + defaultUniformCollections[UniformCollections.STRUCT_IN_ARRAY].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.structInArray(dataType, secondDataType, false))); + defaultUniformCollections[UniformCollections.NESTED_STRUCTS_ARRAYS].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.nestedArraysStructs(dataType, secondDataType))); + } + } + defaultUniformCollections[UniformCollections.MULTIPLE_BASIC].cases.push(new es3fUniformApiTests.UniformCollectionCase(null, es3fUniformApiTests.UniformCollection.multipleBasic())); + defaultUniformCollections[UniformCollections.MULTIPLE_BASIC_ARRAY].cases.push(new es3fUniformApiTests.UniformCollectionCase(null, es3fUniformApiTests.UniformCollection.multipleBasicArray())); + defaultUniformCollections[UniformCollections.MULTIPLE_NESTED_STRUCTS_ARRAYS].cases.push(new es3fUniformApiTests.UniformCollectionCase(null, es3fUniformApiTests.UniformCollection.multipleNestedArraysStructs())); + + // Info-query cases (check info returned by e.g. glGetActiveUniforms()). + + // info_query + /** @type {tcuTestCase.DeqpTest} */ + var infoQueryGroup = tcuTestCase.newTest('info_query', 'Test uniform info querying functions'); + testGroup.addChild(infoQueryGroup); + + /** @type {UniformCollectionGroup} */ var collectionGroup; + /** @type {es3fUniformApiTests.UniformCollectionCase} */ var collectionCase; + /** @type {es3fUniformApiTests.UniformCollection} (SharedPtr) */ var uniformCollection; + /** @type {es3fUniformApiTests.Feature} */ var features; + /** @type {tcuTestCase.DeqpTest} */ var collectionTestGroup; + /** @type {string} */ var collName; + /** @type {es3fUniformApiTests.CheckMethod} */ var checkMethod; + /** @type {tcuTestCase.DeqpTest} */ var checkMethodGroup; + /** @type {string} */ var collectionGroupName; + /** @type {boolean} */ var containsBooleans; + /** @type {boolean} */ var varyBoolApiType; + /** @type {number} */ var numBoolVariations; + /** @type {es3fUniformApiTests.Feature} */ var booleanTypeFeat; + /** @type {string} */ var booleanTypeName; + /** @type {tcuTestCase.DeqpTest} */ var unusedUniformsGroup; + + /** @type {Array} */ var shaderTypes = Object.keys(es3fUniformApiTests.CaseShaderType); + + for (var caseTypeI in es3fUniformApiTests.CaseType) { + /** @type {es3fUniformApiTests.CaseType} */ var caseType = es3fUniformApiTests.CaseType[caseTypeI]; + /** @type {tcuTestCase.DeqpTest} */ + var caseTypeGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeName(caseType), es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeDescription(caseType)); + infoQueryGroup.addChild(caseTypeGroup); + + for (var collectionGroupNdx = 0; collectionGroupNdx < Object.keys(UniformCollections).length; collectionGroupNdx++) { + var numArrayFirstElemNameCases = caseType == es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV && collectionGroupNdx == UniformCollections.BASIC_ARRAY ? 2 : 1; + + for (var referToFirstArrayElemWithoutIndexI = 0; referToFirstArrayElemWithoutIndexI < numArrayFirstElemNameCases; referToFirstArrayElemWithoutIndexI++) { + collectionGroup = defaultUniformCollections[collectionGroupNdx]; + collectionGroupName = collectionGroup.name + (referToFirstArrayElemWithoutIndexI == 0 ? '' : '_first_elem_without_brackets'); + collectionTestGroup = tcuTestCase.newTest(collectionGroupName, ''); + caseTypeGroup.addChild(collectionTestGroup); + + for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) { + collectionCase = collectionGroup.cases[collectionNdx]; + + for (var i = 0; i < shaderTypes.length; i++) { + name = collectionCase.namePrefix + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]); + uniformCollection = collectionCase.uniformCollection; + + features = new es3fUniformApiTests.Feature(); + features.ARRAY_FIRST_ELEM_NAME_NO_INDEX = referToFirstArrayElemWithoutIndexI != 0; + + collectionTestGroup.addChild(new es3fUniformApiTests.UniformInfoQueryCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, caseType, features)); + } + } + } + } + + // Info-querying cases when unused uniforms are present. + + unusedUniformsGroup = tcuTestCase.newTest('unused_uniforms', 'Test with unused uniforms'); + caseTypeGroup.addChild(unusedUniformsGroup); + + collectionGroup = defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT]; + + for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) { + collectionCase = collectionGroup.cases[collectionNdx]; + collName = collectionCase.namePrefix; + uniformCollection = collectionCase.uniformCollection; + + for (var i = 0; i < shaderTypes.length; i++) { + name = collName + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]); + + features = new es3fUniformApiTests.Feature(); + features.UNIFORMUSAGE_EVERY_OTHER = true; + features.ARRAYUSAGE_ONLY_MIDDLE_INDEX = true; + + unusedUniformsGroup.addChild(new es3fUniformApiTests.UniformInfoQueryCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, caseType, features)); + } + } + } + + // Cases testing uniform values. + + // Cases checking uniforms' initial values (all must be zeros), with glGetUniform*() or by rendering. + + /** @type {tcuTestCase.DeqpTest} */ var initialValuesGroup = tcuTestCase.newTest( + 'value.' + es3fUniformApiTests.UniformValueCase.getValueToCheckName(es3fUniformApiTests.ValueToCheck.INITIAL), + es3fUniformApiTests.UniformValueCase.getValueToCheckDescription(es3fUniformApiTests.ValueToCheck.INITIAL)); + testGroup.addChild(initialValuesGroup); + + for (var checkMethodI in es3fUniformApiTests.CheckMethod) { + checkMethod = es3fUniformApiTests.CheckMethod[checkMethodI]; + checkMethodGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformValueCase.getCheckMethodName(checkMethod), es3fUniformApiTests.UniformValueCase.getCheckMethodDescription(checkMethod)); + initialValuesGroup.addChild(checkMethodGroup); + + for (var collectionGroupNdx = 0; collectionGroupNdx < Object.keys(UniformCollections).length; collectionGroupNdx++) { + collectionGroup = defaultUniformCollections[collectionGroupNdx]; + collectionTestGroup = tcuTestCase.newTest(collectionGroup.name, ''); + checkMethodGroup.addChild(collectionTestGroup); + + for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) { + collectionCase = collectionGroup.cases[collectionNdx]; + collName = collectionCase.namePrefix; + uniformCollection = collectionCase.uniformCollection; + containsBooleans = uniformCollection.containsMatchingBasicType(gluShaderUtil.isDataTypeBoolOrBVec); + varyBoolApiType = checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM && containsBooleans && + (collectionGroupNdx == UniformCollections.BASIC || collectionGroupNdx == UniformCollections.BASIC_ARRAY); + numBoolVariations = varyBoolApiType ? 3 : 1; + + if (checkMethod == es3fUniformApiTests.CheckMethod.RENDER && uniformCollection.containsSeveralSamplerTypes()) + continue; // \note Samplers' initial API values (i.e. their texture units) are 0, and no two samplers of different types shall have same unit when rendering. + + for (var booleanTypeI = 0; booleanTypeI < numBoolVariations; booleanTypeI++) { + booleanTypeFeat = new es3fUniformApiTests.Feature(); + booleanTypeFeat.BOOLEANAPITYPE_INT = booleanTypeI == 1; + booleanTypeFeat.BOOLEANAPITYPE_UINT = booleanTypeI == 2; + + booleanTypeName = booleanTypeI == 1 ? 'int' : + booleanTypeI == 2 ? 'uint' : + 'float'; + /** @type {string} */ var nameWithApiType = varyBoolApiType ? collName + 'api_' + booleanTypeName + '_' : collName; + + for (var i = 0; i < shaderTypes.length; i++) { + name = nameWithApiType + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]); + collectionTestGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, + es3fUniformApiTests.ValueToCheck.INITIAL, checkMethod, null, booleanTypeFeat)); + } + } + } + } + } + + // Cases that first assign values to each uniform, then check the values with glGetUniform*() or by rendering. + + /** @type {tcuTestCase.DeqpTest} */ var assignedValuesGroup = tcuTestCase.newTest( + 'value.' + es3fUniformApiTests.UniformValueCase.getValueToCheckName(es3fUniformApiTests.ValueToCheck.ASSIGNED), + es3fUniformApiTests.UniformValueCase.getValueToCheckDescription(es3fUniformApiTests.ValueToCheck.ASSIGNED)); + testGroup.addChild(assignedValuesGroup); + + for (var assignMethodI in es3fUniformApiTests.AssignMethod) { + /** @type {es3fUniformApiTests.AssignMethod} */ var assignMethod = es3fUniformApiTests.AssignMethod[assignMethodI]; + /** @type {tcuTestCase.DeqpTest} */ var assignMethodGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformValueCase.getAssignMethodName(assignMethod), es3fUniformApiTests.UniformValueCase.getAssignMethodDescription(assignMethod)); + assignedValuesGroup.addChild(assignMethodGroup); + + for (var checkMethodI in es3fUniformApiTests.CheckMethod) { + checkMethod = es3fUniformApiTests.CheckMethod[checkMethodI]; + checkMethodGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformValueCase.getCheckMethodName(checkMethod), es3fUniformApiTests.UniformValueCase.getCheckMethodDescription(checkMethod)); + assignMethodGroup.addChild(checkMethodGroup); + + for (var collectionGroupNdx = 0; collectionGroupNdx < Object.keys(UniformCollections).length; collectionGroupNdx++) { + /** @type {number} */ var numArrayFirstElemNameCases = checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM && collectionGroupNdx == UniformCollections.BASIC_ARRAY ? 2 : 1; + + for (var referToFirstArrayElemWithoutIndexI = 0; referToFirstArrayElemWithoutIndexI < numArrayFirstElemNameCases; referToFirstArrayElemWithoutIndexI++) { + collectionGroup = defaultUniformCollections[collectionGroupNdx]; + collectionGroupName = collectionGroup.name + (referToFirstArrayElemWithoutIndexI == 0 ? '' : '_first_elem_without_brackets'); + collectionTestGroup = tcuTestCase.newTest(collectionGroupName, ''); + checkMethodGroup.addChild(collectionTestGroup); + + for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) { + collectionCase = collectionGroup.cases[collectionNdx]; + collName = collectionCase.namePrefix; + uniformCollection = collectionCase.uniformCollection; + containsBooleans = uniformCollection.containsMatchingBasicType(gluShaderUtil.isDataTypeBoolOrBVec); + varyBoolApiType = checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM && containsBooleans && + (collectionGroupNdx == UniformCollections.BASIC || collectionGroupNdx == UniformCollections.BASIC_ARRAY); + numBoolVariations = varyBoolApiType ? 3 : 1; + /** @type {boolean} */ var containsMatrices = uniformCollection.containsMatchingBasicType(gluShaderUtil.isDataTypeMatrix); + /** @type {boolean} */ var varyMatrixMode = containsMatrices && + (collectionGroupNdx == UniformCollections.BASIC || collectionGroupNdx == UniformCollections.BASIC_ARRAY); + /** @type {number} */ var numMatVariations = varyMatrixMode ? 2 : 1; + + if (containsMatrices && assignMethod != es3fUniformApiTests.AssignMethod.POINTER) + continue; + + for (var booleanTypeI = 0; booleanTypeI < numBoolVariations; booleanTypeI++) { + booleanTypeFeat = new es3fUniformApiTests.Feature(); + booleanTypeFeat.BOOLEANAPITYPE_INT = booleanTypeI == 1; + booleanTypeFeat.BOOLEANAPITYPE_UINT = booleanTypeI == 2; + + booleanTypeName = booleanTypeI == 1 ? 'int' : + booleanTypeI == 2 ? 'uint' : + 'float'; + /** @type {string} */ var nameWithBoolType = varyBoolApiType ? collName + 'api_' + booleanTypeName + '_' : collName; + + for (var matrixTypeI = 0; matrixTypeI < numMatVariations; matrixTypeI++) { + /** @type {string} */ var nameWithMatrixType = nameWithBoolType + (matrixTypeI == 1 ? 'row_major_' : ''); + + for (var i = 0; i < shaderTypes.length; i++) { + name = nameWithMatrixType + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]); + + booleanTypeFeat.ARRAY_FIRST_ELEM_NAME_NO_INDEX = referToFirstArrayElemWithoutIndexI != 0; + booleanTypeFeat.MATRIXMODE_ROWMAJOR = matrixTypeI == 1; + + collectionTestGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, + es3fUniformApiTests.ValueToCheck.ASSIGNED, checkMethod, assignMethod, booleanTypeFeat)); + } + } + } + } + } + } + } + } + + // Cases assign multiple basic-array elements with one glUniform*v() (i.e. the count parameter is bigger than 1). + + /** @type {es3fUniformApiTests.Feature} */ var arrayAssignFullMode = new es3fUniformApiTests.Feature(); + arrayAssignFullMode.ARRAYASSIGN_FULL = true; + + /** @type {es3fUniformApiTests.Feature} */ var arrayAssignBlocksOfTwo = new es3fUniformApiTests.Feature(); + arrayAssignFullMode.ARRAYASSIGN_BLOCKS_OF_TWO = true; + + var arrayAssignGroups = + [{arrayAssignMode: arrayAssignFullMode, name: 'basic_array_assign_full', description: 'Assign entire basic-type arrays per glUniform*v() call'}, {arrayAssignMode: arrayAssignBlocksOfTwo, name: 'basic_array_assign_partial', description: 'Assign two elements of a basic-type array per glUniform*v() call'} + ]; + + for (var arrayAssignGroupNdx = 0; arrayAssignGroupNdx < arrayAssignGroups.length; arrayAssignGroupNdx++) { + /** @type {es3fUniformApiTests.Feature} */ var arrayAssignMode = arrayAssignGroups[arrayAssignGroupNdx].arrayAssignMode; + /** @type {string} */ var groupName = arrayAssignGroups[arrayAssignGroupNdx].name; + /** @type {string} */ var groupDesc = arrayAssignGroups[arrayAssignGroupNdx].description; + + /** @type {tcuTestCase.DeqpTest} */ var curArrayAssignGroup = tcuTestCase.newTest(groupName, groupDesc); + assignedValuesGroup.addChild(curArrayAssignGroup); + + /** @type {Array} */ var basicArrayCollectionGroups = [UniformCollections.BASIC_ARRAY, UniformCollections.ARRAY_IN_STRUCT, UniformCollections.MULTIPLE_BASIC_ARRAY]; + + for (var collectionGroupNdx = 0; collectionGroupNdx < basicArrayCollectionGroups.length; collectionGroupNdx++) { + collectionGroup = defaultUniformCollections[basicArrayCollectionGroups[collectionGroupNdx]]; + collectionTestGroup = tcuTestCase.newTest(collectionGroup.name, ''); + curArrayAssignGroup.addChild(collectionTestGroup); + + for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) { + collectionCase = collectionGroup.cases[collectionNdx]; + collName = collectionCase.namePrefix; + uniformCollection = collectionCase.uniformCollection; + + for (var i = 0; i < shaderTypes.length; i++) { + name = collName + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]); + collectionTestGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, + es3fUniformApiTests.ValueToCheck.ASSIGNED, es3fUniformApiTests.CheckMethod.GET_UNIFORM, es3fUniformApiTests.AssignMethod.POINTER, + arrayAssignMode)); + } + } + } + } + + // Value checking cases when unused uniforms are present. + + unusedUniformsGroup = tcuTestCase.newTest('unused_uniforms', 'Test with unused uniforms'); + assignedValuesGroup.addChild(unusedUniformsGroup); + + collectionGroup = defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT]; + + for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) { + collectionCase = collectionGroup.cases[collectionNdx]; + collName = collectionCase.namePrefix; + uniformCollection = collectionCase.uniformCollection; + + for (var i = 0; i < shaderTypes.length; i++) { + name = collName + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]); + + features = new es3fUniformApiTests.Feature(); + features.ARRAYUSAGE_ONLY_MIDDLE_INDEX = true; + features.UNIFORMUSAGE_EVERY_OTHER = true; + + unusedUniformsGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, + es3fUniformApiTests.ValueToCheck.ASSIGNED, es3fUniformApiTests.CheckMethod.GET_UNIFORM, es3fUniformApiTests.AssignMethod.POINTER, + features)); + } + } + + // Random cases. + + /** @type {number} */ var numRandomCases = 100; + /** @type {tcuTestCase.DeqpTest} */ var randomGroup = tcuTestCase.newTest('random', 'Random cases'); + testGroup.addChild(randomGroup); + + for (var ndx = 0; ndx < numRandomCases; ndx++) + randomGroup.addChild(new es3fUniformApiTests.RandomUniformCase('' + ndx, '', ndx)); + }; + + /** + * Create and execute the test cases + * @param {WebGL2RenderingContext} context + */ + es3fUniformApiTests.run = function(context, range) { + gl = context; + //Set up Test Root parameters + var testName = 'uniform_api'; + var testDescription = 'es3fUniformApiTests.Uniform API Tests'; + var state = tcuTestCase.runner; + + state.testName = testName; + state.testCases = tcuTestCase.newTest(testName, testDescription, null); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fUniformApiTests.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fUniformApiTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js new file mode 100644 index 000000000..91a90fdc6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js @@ -0,0 +1,748 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fUniformBlockTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('modules.shared.glsRandomUniformBlockCase'); +goog.require('modules.shared.glsUniformBlockCase'); + +goog.scope(function() { + + var es3fUniformBlockTests = functional.gles3.es3fUniformBlockTests; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var glsUniformBlockCase = modules.shared.glsUniformBlockCase; + var glsRandomUniformBlockCase = modules.shared.glsRandomUniformBlockCase; + var tcuTestCase = framework.common.tcuTestCase; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + + /** + * es3fUniformBlockTests.createRandomCaseGroup + * @param {tcuTestCase.DeqpTest} parentGroup + * @param {string} groupName + * @param {string} description + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} features + * @param {number} numCases + * @param {number} baseSeed + */ + es3fUniformBlockTests.createRandomCaseGroup = function(parentGroup, groupName, description, bufferMode, features, numCases, baseSeed) { + /** @type {tcuTestCase.DeqpTest} */ + var group = tcuTestCase.newTest(groupName, description); + parentGroup.addChild(group); + + baseSeed += deRandom.getBaseSeed(); + + for (var ndx = 0; ndx < numCases; ndx++) + group.addChild(new glsRandomUniformBlockCase.RandomUniformBlockCase('' + ndx, '', bufferMode, features, ndx + baseSeed)); + }; + + /** + * es3fUniformBlockTests.BlockBasicTypeCase constructor + * @param {string} name The name of the test + * @param {string} description The description of the test + * @param {glsUniformBlockCase.VarType} type The type of the block + * @param {number} layoutFlags + * @param {number} numInstances + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + es3fUniformBlockTests.BlockBasicTypeCase = function(name, description, type, layoutFlags, numInstances) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK); + /** @type {glsUniformBlockCase.UniformBlock}*/ var block = this.m_interface.allocBlock('Block'); + block.addUniform(new glsUniformBlockCase.Uniform('var', type, 0)); + block.setFlags(layoutFlags); + + if (numInstances > 0) { + block.setArraySize(numInstances); + block.setInstanceName('block'); + } + }; + + es3fUniformBlockTests.BlockBasicTypeCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + es3fUniformBlockTests.BlockBasicTypeCase.prototype.constructor = es3fUniformBlockTests.BlockBasicTypeCase; + + /** + * es3fUniformBlockTests.createBlockBasicTypeCases + * @param {tcuTestCase.DeqpTest} group + * @param {string} name + * @param {glsUniformBlockCase.VarType} type + * @param {number} layoutFlags + * @param {number=} numInstances + */ + es3fUniformBlockTests.createBlockBasicTypeCases = function(group, name, type, layoutFlags, numInstances) { + numInstances = (numInstances === undefined) ? 0 : numInstances; + group.addChild(new es3fUniformBlockTests.BlockBasicTypeCase(name + '_vertex', '', type, layoutFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, numInstances)); + group.addChild(new es3fUniformBlockTests.BlockBasicTypeCase(name + '_fragment', '', type, layoutFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, numInstances)); + + //alert(group.spec[0].m_instance); + if (!(layoutFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED)) + group.addChild(new es3fUniformBlockTests.BlockBasicTypeCase(name + '_both', '', type, layoutFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, numInstances)); + }; + + /** + * es3fUniformBlockTests.BlockSingleStructCase constructor + * @param {string} name The name of the test + * @param {string} description The description of the test + * @param {number} layoutFlags + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} numInstances + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + es3fUniformBlockTests.BlockSingleStructCase = function(name, description, layoutFlags, bufferMode, numInstances) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode); + this.m_layoutFlags = layoutFlags; + this.m_numInstances = numInstances; + }; + + es3fUniformBlockTests.BlockSingleStructCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + es3fUniformBlockTests.BlockSingleStructCase.prototype.constructor = es3fUniformBlockTests.BlockSingleStructCase; + + es3fUniformBlockTests.BlockSingleStructCase.prototype.init = function() { + /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S'); + typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH); // First member is unused. + typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4)); + typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH)); + + /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block'); + block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeStruct(typeS), 0)); + block.setFlags(this.m_layoutFlags); + + if (this.m_numInstances > 0) { + block.setInstanceName('block'); + block.setArraySize(this.m_numInstances); + } + }; + + /** + * es3fUniformBlockTests.BlockSingleStructArrayCase constructor + * @param {string} name The name of the test + * @param {string} description The description of the test + * @param {number} layoutFlags + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} numInstances + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + es3fUniformBlockTests.BlockSingleStructArrayCase = function(name, description, layoutFlags, bufferMode, numInstances) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode); + this.m_layoutFlags = layoutFlags; + this.m_numInstances = numInstances; + }; + + es3fUniformBlockTests.BlockSingleStructArrayCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + es3fUniformBlockTests.BlockSingleStructArrayCase.prototype.constructor = es3fUniformBlockTests.BlockSingleStructArrayCase; + + es3fUniformBlockTests.BlockSingleStructArrayCase.prototype.init = function() { + /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S'); + typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH); // First member is unused. + typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4)); + typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH)); + + /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block'); + block.addUniform(new glsUniformBlockCase.Uniform('u', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_LOW))); + block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeStruct(typeS), 3))); + block.addUniform(new glsUniformBlockCase.Uniform('v', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM))); + block.setFlags(this.m_layoutFlags); + + if (this.m_numInstances > 0) { + block.setInstanceName('block'); + block.setArraySize(this.m_numInstances); + } + }; + + /** + * es3fUniformBlockTests.BlockSingleNestedStructCase constructor + * @param {string} name The name of the test + * @param {string} description The description of the test + * @param {number} layoutFlags + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} numInstances + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + es3fUniformBlockTests.BlockSingleNestedStructCase = function(name, description, layoutFlags, bufferMode, numInstances) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode); + this.m_layoutFlags = layoutFlags; + this.m_numInstances = numInstances; + }; + + es3fUniformBlockTests.BlockSingleNestedStructCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + es3fUniformBlockTests.BlockSingleNestedStructCase.prototype.constructor = es3fUniformBlockTests.BlockSingleNestedStructCase; + + es3fUniformBlockTests.BlockSingleNestedStructCase.prototype.init = function() { + /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S'); + typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH)); + typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4)); + typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH); + + /**@type {glsUniformBlockCase.StructType}*/ var typeT = this.m_interface.allocStruct('T'); + typeT.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM)); + typeT.addMember('b', glsUniformBlockCase.newVarTypeStruct(typeS)); + + /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block'); + block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeStruct(typeS), 0)); + block.addUniform(new glsUniformBlockCase.Uniform('v', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH)); + block.addUniform(new glsUniformBlockCase.Uniform('t', glsUniformBlockCase.newVarTypeStruct(typeT), 0)); + block.addUniform(new glsUniformBlockCase.Uniform('u', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), 0)); + block.setFlags(this.m_layoutFlags); + + if (this.m_numInstances > 0) { + block.setInstanceName('block'); + block.setArraySize(this.m_numInstances); + } + }; + + /** + * es3fUniformBlockTests.BlockSingleNestedStructArrayCase constructor + * @param {string} name The name of the test + * @param {string} description The description of the test + * @param {number} layoutFlags + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} numInstances + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + es3fUniformBlockTests.BlockSingleNestedStructArrayCase = function(name, description, layoutFlags, bufferMode, numInstances) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode); + this.m_layoutFlags = layoutFlags; + this.m_numInstances = numInstances; + }; + + es3fUniformBlockTests.BlockSingleNestedStructArrayCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + es3fUniformBlockTests.BlockSingleNestedStructArrayCase.prototype.constructor = es3fUniformBlockTests.BlockSingleNestedStructArrayCase; + + es3fUniformBlockTests.BlockSingleNestedStructArrayCase.prototype.init = function() { + /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S'); + typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH)); + typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4)); + typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH); + + /**@type {glsUniformBlockCase.StructType}*/ var typeT = this.m_interface.allocStruct('T'); + typeT.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM)); + typeT.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeStruct(typeS), 3)); + + /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block'); + block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeStruct(typeS), 0)); + block.addUniform(new glsUniformBlockCase.Uniform('v', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH)); + block.addUniform(new glsUniformBlockCase.Uniform('t', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeStruct(typeT), 2), 0)); + block.addUniform(new glsUniformBlockCase.Uniform('u', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), 0)); + block.setFlags(this.m_layoutFlags); + + if (this.m_numInstances > 0) { + block.setInstanceName('block'); + block.setArraySize(this.m_numInstances); + } + }; + + /** + * es3fUniformBlockTests.BlockMultiBasicTypesCase constructor + * @param {string} name The name of the test + * @param {string} description The description of the test + * @param {number} flagsA + * @param {number} flagsB + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} numInstances + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + es3fUniformBlockTests.BlockMultiBasicTypesCase = function(name, description, flagsA, flagsB, bufferMode, numInstances) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode); + this.m_flagsA = flagsA; + this.m_flagsB = flagsB; + this.m_numInstances = numInstances; + }; + + es3fUniformBlockTests.BlockMultiBasicTypesCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + es3fUniformBlockTests.BlockMultiBasicTypesCase.prototype.constructor = es3fUniformBlockTests.BlockMultiBasicTypesCase; + + es3fUniformBlockTests.BlockMultiBasicTypesCase.prototype.init = function() { + /** @type {glsUniformBlockCase.UniformBlock} */ var blockA = this.m_interface.allocBlock('BlockA'); + blockA.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH))); + blockA.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH)); + blockA.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM))); + blockA.setInstanceName('blockA'); + blockA.setFlags(this.m_flagsA); + + /** @type {glsUniformBlockCase.UniformBlock} */ var blockB = this.m_interface.allocBlock('BlockB'); + blockB.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM))); + blockB.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_LOW))); + blockB.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH)); + blockB.addUniform(new glsUniformBlockCase.Uniform('d', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL, 0))); + blockB.setInstanceName('blockB'); + blockB.setFlags(this.m_flagsB); + + if (this.m_numInstances > 0) { + blockA.setArraySize(this.m_numInstances); + blockB.setArraySize(this.m_numInstances); + } + }; + + /** + * es3fUniformBlockTests.BlockMultiNestedStructCase constructor + * @param {string} name The name of the test + * @param {string} description The description of the test + * @param {number} flagsA + * @param {number} flagsB + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} numInstances + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + es3fUniformBlockTests.BlockMultiNestedStructCase = function(name, description, flagsA, flagsB, bufferMode, numInstances) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode); + this.m_flagsA = flagsA; + this.m_flagsB = flagsB; + this.m_numInstances = numInstances; + }; + + es3fUniformBlockTests.BlockMultiNestedStructCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + es3fUniformBlockTests.BlockMultiNestedStructCase.prototype.constructor = es3fUniformBlockTests.BlockMultiNestedStructCase; + + es3fUniformBlockTests.BlockMultiNestedStructCase.prototype.init = function() { + /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S'); + typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_LOW)); + typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4)); + typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH)); + + /**@type {glsUniformBlockCase.StructType}*/ var typeT = this.m_interface.allocStruct('T'); + typeT.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), glsUniformBlockCase.UniformFlags.UNUSED_BOTH); + typeT.addMember('b', glsUniformBlockCase.newVarTypeStruct(typeS)); + typeT.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL_VEC4, 0)); + + /** @type {glsUniformBlockCase.UniformBlock} */ var blockA = this.m_interface.allocBlock('BlockA'); + blockA.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH))); + blockA.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeStruct(typeS))); + blockA.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH)); + blockA.setInstanceName('blockA'); + blockA.setFlags(this.m_flagsA); + + /** @type {glsUniformBlockCase.UniformBlock} */ var blockB = this.m_interface.allocBlock('BlockB'); + blockB.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM))); + blockB.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeStruct(typeT))); + blockB.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL_VEC4, 0), glsUniformBlockCase.UniformFlags.UNUSED_BOTH)); + blockB.addUniform(new glsUniformBlockCase.Uniform('d', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL, 0))); + blockB.setInstanceName('blockB'); + blockB.setFlags(this.m_flagsB); + + if (this.m_numInstances > 0) { + blockA.setArraySize(this.m_numInstances); + blockB.setArraySize(this.m_numInstances); + } + }; + + /** + * Creates the test hierarchy to be executed. + **/ + es3fUniformBlockTests.init = function() { + /** @const @type {tcuTestCase.DeqpTest} */ var testGroup = tcuTestCase.runner.testCases; + + /** @type {Array} */ + var basicTypes = [ + gluShaderUtil.DataType.FLOAT, + gluShaderUtil.DataType.FLOAT_VEC2, + gluShaderUtil.DataType.FLOAT_VEC3, + gluShaderUtil.DataType.FLOAT_VEC4, + gluShaderUtil.DataType.INT, + gluShaderUtil.DataType.INT_VEC2, + gluShaderUtil.DataType.INT_VEC3, + gluShaderUtil.DataType.INT_VEC4, + gluShaderUtil.DataType.UINT, + gluShaderUtil.DataType.UINT_VEC2, + gluShaderUtil.DataType.UINT_VEC3, + gluShaderUtil.DataType.UINT_VEC4, + gluShaderUtil.DataType.BOOL, + gluShaderUtil.DataType.BOOL_VEC2, + gluShaderUtil.DataType.BOOL_VEC3, + gluShaderUtil.DataType.BOOL_VEC4, + gluShaderUtil.DataType.FLOAT_MAT2, + gluShaderUtil.DataType.FLOAT_MAT3, + gluShaderUtil.DataType.FLOAT_MAT4, + gluShaderUtil.DataType.FLOAT_MAT2X3, + gluShaderUtil.DataType.FLOAT_MAT2X4, + gluShaderUtil.DataType.FLOAT_MAT3X2, + gluShaderUtil.DataType.FLOAT_MAT3X4, + gluShaderUtil.DataType.FLOAT_MAT4X2, + gluShaderUtil.DataType.FLOAT_MAT4X3 + ]; + + /** @type {Array>} */ + var precisionFlags = [{ name: 'lowp', flags: glsUniformBlockCase.UniformFlags.PRECISION_LOW }, { name: 'mediump', flags: glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM }, { name: 'highp', flags: glsUniformBlockCase.UniformFlags.PRECISION_HIGH } + ]; + + /** @type {Array>} */ + var layoutFlags = [ /* { name: 'shared', flags: glsUniformBlockCase.UniformFlags.LAYOUT_SHARED }, */ + /* { name: 'packed', flags: glsUniformBlockCase.UniformFlags.LAYOUT_PACKED }, */ { name: 'std140', flags: glsUniformBlockCase.UniformFlags.LAYOUT_STD140 } + ]; + + /** @type {Array>} */ + var matrixFlags = [{ name: 'row_major', flags: glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR }, { name: 'column_major', flags: glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR } + ]; + + /** @type {Array>} */ + var bufferModes = [{ name: 'per_block_buffer', mode: glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK }, { name: 'single_buffer', mode: glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE } + ]; + + // ubo.single_basic_type + /** @type {tcuTestCase.DeqpTest} */ + var singleBasicTypeGroup = tcuTestCase.newTest('single_basic_type', 'Single basic variable in single buffer'); + + testGroup.addChild(singleBasicTypeGroup); + + /** @type {tcuTestCase.DeqpTest} */ + var layoutGroup; + /** @type {gluShaderUtil.DataType} */ + var type; + /** @type {string} */ + var typeName; + /** @type {tcuTestCase.DeqpTest} */ + var modeGroup; + /** @type {string} */ + var baseName; + /** @type {number} */ + var baseFlags; + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + + layoutGroup = tcuTestCase.newTest(layoutFlags[layoutFlagNdx].name, '', null); + singleBasicTypeGroup.addChild(layoutGroup); + + for (var basicTypeNdx = 0; basicTypeNdx < basicTypes.length; basicTypeNdx++) { + type = basicTypes[basicTypeNdx]; + typeName = gluShaderUtil.getDataTypeName(type); + + if (gluShaderUtil.isDataTypeBoolOrBVec(type)) + es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, typeName, glsUniformBlockCase.newVarTypeBasic(type, 0), layoutFlags[layoutFlagNdx].flags); + else { + for (var precNdx = 0; precNdx < precisionFlags.length; precNdx++) + es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, precisionFlags[precNdx].name + '_' + typeName, + glsUniformBlockCase.newVarTypeBasic(type, precisionFlags[precNdx].flags), layoutFlags[layoutFlagNdx].flags); + } + + if (gluShaderUtil.isDataTypeMatrix(type)) { + for (var matFlagNdx = 0; matFlagNdx < matrixFlags.length; matFlagNdx++) { + for (var precNdx = 0; precNdx < precisionFlags.length; precNdx++) + es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, matrixFlags[matFlagNdx].name + '_' + precisionFlags[precNdx].name + '_' + typeName, + glsUniformBlockCase.newVarTypeBasic(type, precisionFlags[precNdx].flags), layoutFlags[layoutFlagNdx].flags | matrixFlags[matFlagNdx].flags); + } + } + } + } + bufferedLogToConsole('ubo.single_basic_type: Tests created'); + + // ubo.single_basic_array + /** @type {tcuTestCase.DeqpTest} */ + var singleBasicArrayGroup = tcuTestCase.newTest('single_basic_array', 'Single basic array variable in single buffer'); + testGroup.addChild(singleBasicArrayGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + layoutGroup = tcuTestCase.newTest(layoutFlags[layoutFlagNdx].name, '', null); + singleBasicArrayGroup.addChild(layoutGroup); + + for (var basicTypeNdx = 0; basicTypeNdx < basicTypes.length; basicTypeNdx++) { + type = basicTypes[basicTypeNdx]; + typeName = gluShaderUtil.getDataTypeName(type); + /** @type {number} */ var arraySize = 3; + + es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, typeName, + glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(type, gluShaderUtil.isDataTypeBoolOrBVec(type) ? 0 : glsUniformBlockCase.UniformFlags.PRECISION_HIGH), arraySize), + layoutFlags[layoutFlagNdx].flags); + + if (gluShaderUtil.isDataTypeMatrix(type)) { + for (var matFlagNdx = 0; matFlagNdx < matrixFlags.length; matFlagNdx++) + es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, matrixFlags[matFlagNdx].name + '_' + typeName, + glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(type, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), arraySize), + layoutFlags[layoutFlagNdx].flags | matrixFlags[matFlagNdx].flags); + } + } + } + bufferedLogToConsole('ubo.single_basic_array: Tests created'); + + // ubo.single_struct + /** @type {tcuTestCase.DeqpTest} */ + var singleStructGroup = tcuTestCase.newTest('single_struct', 'Single struct in uniform block'); + testGroup.addChild(singleStructGroup); + + for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) { + modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, ''); + singleStructGroup.addChild(modeGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + for (var isArray = 0; isArray < 2; isArray++) { + baseName = layoutFlags[layoutFlagNdx].name; + baseFlags = layoutFlags[layoutFlagNdx].flags; + + if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0) + continue; // Doesn't make sense to add this variant. + + if (isArray) + baseName += '_instance_array'; + + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED)) + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + } + } + } + bufferedLogToConsole('ubo.single_struct: Tests created'); + + // ubo.single_struct_array + /** @type {tcuTestCase.DeqpTest} */ + var singleStructArrayGroup = tcuTestCase.newTest('single_struct_array', 'Struct array in one uniform block'); + testGroup.addChild(singleStructArrayGroup); + + for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) { + modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, ''); + singleStructArrayGroup.addChild(modeGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + for (var isArray = 0; isArray < 2; isArray++) { + baseName = layoutFlags[layoutFlagNdx].name; + baseFlags = layoutFlags[layoutFlagNdx].flags; + + if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0) + continue; // Doesn't make sense to add this variant. + + if (isArray) + baseName += '_instance_array'; + + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructArrayCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructArrayCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED)) + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructArrayCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + } + } + } + bufferedLogToConsole('ubo.single_struct_array: Tests created'); + + // ubo.single_nested_struct + /** @type {tcuTestCase.DeqpTest} */ + var singleNestedStructGroup = tcuTestCase.newTest('single_nested_struct', 'Nested struct in one uniform block'); + testGroup.addChild(singleNestedStructGroup); + + for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) { + modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, ''); + singleNestedStructGroup.addChild(modeGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + for (var isArray = 0; isArray < 2; isArray++) { + baseName = layoutFlags[layoutFlagNdx].name; + baseFlags = layoutFlags[layoutFlagNdx].flags; + + if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0) + continue; // Doesn't make sense to add this variant. + + if (isArray) + baseName += '_instance_array'; + + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED)) + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + } + } + } + bufferedLogToConsole('ubo.single_nested_struct: Tests created'); + + // ubo.single_nested_struct_array + /** @type {tcuTestCase.DeqpTest} */ + var singleNestedStructArrayGroup = tcuTestCase.newTest('single_nested_struct_array', 'Nested struct array in one uniform block'); + testGroup.addChild(singleNestedStructArrayGroup); + + for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) { + modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, ''); + singleNestedStructArrayGroup.addChild(modeGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + for (var isArray = 0; isArray < 2; isArray++) { + baseName = layoutFlags[layoutFlagNdx].name; + baseFlags = layoutFlags[layoutFlagNdx].flags; + + if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0) + continue; // Doesn't make sense to add this variant. + + if (isArray) + baseName += '_instance_array'; + + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructArrayCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructArrayCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED)) + modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructArrayCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + } + } + } + bufferedLogToConsole('ubo.single_nested_struct_array: Tests created'); + + // ubo.instance_array_basic_type + /** @type {tcuTestCase.DeqpTest} */ + var instanceArrayBasicTypeGroup = tcuTestCase.newTest('instance_array_basic_type', 'Single basic variable in instance array'); + testGroup.addChild(instanceArrayBasicTypeGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + layoutGroup = tcuTestCase.newTest(layoutFlags[layoutFlagNdx].name, ''); + instanceArrayBasicTypeGroup.addChild(layoutGroup); + + for (var basicTypeNdx = 0; basicTypeNdx < basicTypes.length; basicTypeNdx++) { + type = basicTypes[basicTypeNdx]; + typeName = gluShaderUtil.getDataTypeName(type); + /** @type {number} */ var numInstances = 3; + + es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, typeName, + glsUniformBlockCase.newVarTypeBasic(type, gluShaderUtil.isDataTypeBoolOrBVec(type) ? 0 : glsUniformBlockCase.UniformFlags.PRECISION_HIGH), + layoutFlags[layoutFlagNdx].flags, numInstances); + + if (gluShaderUtil.isDataTypeMatrix(type)) { + for (var matFlagNdx = 0; matFlagNdx < matrixFlags.length; matFlagNdx++) + es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, matrixFlags[matFlagNdx].name + '_' + typeName, + glsUniformBlockCase.newVarTypeBasic(type, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), layoutFlags[layoutFlagNdx].flags | matrixFlags[matFlagNdx].flags, + numInstances); + } + } + } + bufferedLogToConsole('ubo.instance_array_basic_type: Tests created'); + + // ubo.multi_basic_types + /** @type {tcuTestCase.DeqpTest} */ + var multiBasicTypesGroup = tcuTestCase.newTest('multi_basic_types', 'Multiple buffers with basic types'); + testGroup.addChild(multiBasicTypesGroup); + + for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) { + modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, ''); + multiBasicTypesGroup.addChild(modeGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + for (var isArray = 0; isArray < 2; isArray++) { + baseName = layoutFlags[layoutFlagNdx].name; + baseFlags = layoutFlags[layoutFlagNdx].flags; + + if (isArray) + baseName += '_instance_array'; + + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED)) + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_mixed', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + } + } + } + bufferedLogToConsole('ubo.multi_basic_types: Tests created'); + + // ubo.multi_nested_struct + /** @type {tcuTestCase.DeqpTest} */ + var multiNestedStructGroup = tcuTestCase.newTest('multi_nested_struct', 'Multiple buffers with basic types'); + testGroup.addChild(multiNestedStructGroup); + + for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) { + modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, ''); + multiNestedStructGroup.addChild(modeGroup); + + for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) { + for (var isArray = 0; isArray < 2; isArray++) { + baseName = layoutFlags[layoutFlagNdx].name; + baseFlags = layoutFlags[layoutFlagNdx].flags; + + if (isArray) + baseName += '_instance_array'; + + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED)) + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + + modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_mixed', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0)); + } + } + } + bufferedLogToConsole('ubo.multi_nested_struct: Tests created'); + + /* ubo.random */ + /** @type {number} */ var allShaders = glsRandomUniformBlockCase.FeatureBits.FEATURE_VERTEX_BLOCKS | glsRandomUniformBlockCase.FeatureBits.FEATURE_FRAGMENT_BLOCKS | glsRandomUniformBlockCase.FeatureBits.FEATURE_SHARED_BLOCKS; + /** @type {number} */ var allLayouts = glsRandomUniformBlockCase.FeatureBits.FEATURE_STD140_LAYOUT; + /** @type {number} */ var allBasicTypes = glsRandomUniformBlockCase.FeatureBits.FEATURE_VECTORS | glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRICES; + /** @type {number} */ var unused = glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_MEMBERS | glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_UNIFORMS; + /** @type {number} */ var matFlags = glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRIX_LAYOUT; + /** @type {number} */ var allFeatures = (~glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS_OF_ARRAYS & 0xFFFF); + + /** @type {tcuTestCase.DeqpTest} */ + var randomGroup = tcuTestCase.newTest('random', 'Random Uniform Block cases'); + testGroup.addChild(randomGroup); + + // Basic types. + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'scalar_types', 'Scalar types only, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused, 25, 0); + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'vector_types', 'Scalar and vector types only, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | glsRandomUniformBlockCase.FeatureBits.FEATURE_VECTORS, 25, 25); + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'basic_types', 'All basic types, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags, 25, 50); + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'basic_arrays', 'Arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS, 25, 50); + + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'basic_instance_arrays', 'Basic instance arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS, 25, 75); + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs', 'Nested structs, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS, 25, 100); + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs_arrays', 'Nested structs, arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS | glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS, 25, 150); + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs_instance_arrays', 'Nested structs, instance arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS | glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS, 25, 125); + es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs_arrays_instance_arrays', 'Nested structs, instance arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS | glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS | glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS, 25, 175); + + // Disabled: WebGL does not support shared or packed uniform buffers. + //es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'all_per_block_buffers', 'All random features, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allFeatures, 50, 200); + //es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'all_shared_buffer', 'All random features, shared buffer', glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE, allFeatures, 50, 250); + bufferedLogToConsole('ubo.random: Tests created'); + }; + + /** + * Create and execute the test cases + */ + es3fUniformBlockTests.run = function(range) { + //Set up Test Root parameters + var testName = 'ubo'; + var testDescription = 'Uniform Block Tests'; + var state = tcuTestCase.runner; + + state.setRoot(tcuTestCase.newTest(testName, testDescription, null)); + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + //Create test cases + es3fUniformBlockTests.init(); + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fUniformBlockTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js new file mode 100644 index 000000000..6ee46995c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js @@ -0,0 +1,875 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fVertexArrayObjectTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluShaderProgram'); + +goog.scope(function() { +var es3fVertexArrayObjectTests = functional.gles3.es3fVertexArrayObjectTests; +var tcuTestCase = framework.common.tcuTestCase; +var deRandom = framework.delibs.debase.deRandom; +var deString = framework.delibs.debase.deString; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuSurface = framework.common.tcuSurface; +var tcuImageCompare = framework.common.tcuImageCompare; +var deUtil = framework.delibs.debase.deUtil; + +/** + * @constructor + */ +es3fVertexArrayObjectTests.Attribute = function() { + this.enabled = false; + this.size = 1; + this.stride = 0; + this.type = gl.FLOAT; + this.integer = false; + this.divisor = 0; + this.offset = 0; + this.normalized = false; + this.bufferNdx = 0; +}; + +/** + * @constructor + * @struct + */ +es3fVertexArrayObjectTests.VertexArrayState = function() { + this.attributes = []; + this.elementArrayBuffer = 0; +}; + +/** + * @constructor + * @struct + */ +es3fVertexArrayObjectTests.BufferSpec = function(count, size, componentCount, stride, offset, type, intRangeMin, intRangeMax, floatRangeMin, floatRangeMax) { + this.count = count; + this.size = size; + this.componentCount = componentCount; + this.stride = stride; + this.offset = offset; + + this.type = type; + + this.intRangeMin = intRangeMin; + this.intRangeMax = intRangeMax; + + this.floatRangeMin = floatRangeMin; + this.floatRangeMax = floatRangeMax; +}; + +/** + * @constructor + */ +es3fVertexArrayObjectTests.Spec = function() { + this.count = -1; + this.instances = -1; + this.useDrawElements = false; + this.indexType = gl.NONE; + this.indexOffset = -1; + this.indexRangeMin = -1; + this.indexRangeMax = -1; + this.indexCount = -1; + this.buffers = []; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {es3fVertexArrayObjectTests.Spec} spec + * @param {string} name + * @param {string} description + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest = function(spec, name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_spec = spec; + this.m_random = new deRandom.Random(deString.deStringHash(name)); + /** @type Array} */ this.m_buffers = []; + // mapping 0 -> null object + this.m_buffers.push(null); +}; + +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.constructor = es3fVertexArrayObjectTests.VertexArrayObjectTest; + +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.init = function() { + this.m_vaoProgram = this.createProgram(this.m_spec.vao); + // m_log << tcu::TestLog::Message << "Program used with Vertex Array Object" << tcu::TestLog::EndMessage; + // m_log << *m_vaoProgram; + this.m_stateProgram = this.createProgram(this.m_spec.state); + // m_log << tcu::TestLog::Message << "Program used with Vertex Array State" << tcu::TestLog::EndMessage; + // m_log << *m_stateProgram; + + if (!this.m_vaoProgram.isOk() || !this.m_stateProgram.isOk()) + testFailedOptions('Failed to compile shaders', true); +}; + +/** + * @param {number} target GL target + * @param {number} index Index of the buffer to bind + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.bindBuffer = function(target, index) { + if (typeof this.m_buffers[index] === 'undefined') { + var data = this.createRandomBufferData(this.m_spec.buffers[index - 1]); + var buffer = gl.createBuffer(); + this.m_buffers[index] = buffer; + + gl.bindBuffer(target, buffer); + gl.bufferData(target, data, gl.DYNAMIC_DRAW); + gl.bindBuffer(target, null); + } + + gl.bindBuffer(target, this.m_buffers[index]); +}; + +/** + * @param {es3fVertexArrayObjectTests.BufferSpec} buffer + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.createRandomBufferData = function(buffer) { + var typedArray; + switch (buffer.type) { + case gl.FLOAT: typedArray = Float32Array; break; + case gl.INT: typedArray = Int32Array; break; + case gl.UNSIGNED_INT: typedArray = Uint32Array; break; + case gl.SHORT: typedArray = Int16Array; break; + case gl.UNSIGNED_SHORT: typedArray = Uint16Array; break; + case gl.BYTE: typedArray = Int8Array; break; + case gl.UNSIGNED_BYTE: typedArray = Uint8Array; break; + default: + throw new Error('Invalid type: ' + buffer.type); + } + + var raw = new ArrayBuffer(buffer.size); + var stride; + + if (buffer.stride != 0) { + stride = buffer.stride; + } else { + switch (buffer.type) { + case gl.FLOAT: stride = buffer.componentCount * 4; break; + case gl.INT: stride = buffer.componentCount * 4; break; + case gl.UNSIGNED_INT: stride = buffer.componentCount * 4; break; + case gl.SHORT: stride = buffer.componentCount * 2; break; + case gl.UNSIGNED_SHORT: stride = buffer.componentCount * 2; break; + case gl.BYTE: stride = buffer.componentCount * 1; break; + case gl.UNSIGNED_BYTE: stride = buffer.componentCount * 1; break; + } + } + + var offset = 0; + + for (var pos = 0; pos < buffer.count; pos++) { + var data = new typedArray(raw, offset, buffer.componentCount); + for (var componentNdx = 0; componentNdx < buffer.componentCount; componentNdx++) { + switch (buffer.type) { + case gl.FLOAT: { + data[componentNdx] = this.m_random.getFloat(buffer.floatRangeMin, buffer.floatRangeMax); + break; + } + default: { + data[componentNdx] = this.m_random.getInt(buffer.intRangeMin, buffer.intRangeMax); + } + } + } + + offset += stride; + } + + return new typedArray(raw); +}; + +/** + * @param {es3fVertexArrayObjectTests.VertexArrayState} state + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.createProgram = function(state) { + var vtx = ''; + var value = ''; + + vtx += '#version 300 es\n'; + + for (var attribNdx = 0; attribNdx < state.attributes.length; attribNdx++) { + if (state.attributes[attribNdx].integer) + vtx += 'layout(location = ' + attribNdx + ') in mediump ivec4 a_attrib' + attribNdx + ';\n'; + else + vtx += 'layout(location = ' + attribNdx + ') in mediump vec4 a_attrib' + attribNdx + ';\n'; + + if (state.attributes[attribNdx].integer) { + var scale = 0.0; + + // TODO: Should it be state.attributes[attribNdx].type? + switch (state.attributes[attribNdx].type) { + case gl.SHORT: scale = (1.0 / ((1 << 14) - 1)); break; + case gl.UNSIGNED_SHORT: scale = (1.0 / ((1 << 15) - 1)); break; + case gl.INT: scale = (1.0 / ((1 << 30) - 1)); break; + case gl.UNSIGNED_INT: scale = (1.0 / ((1 << 31) - 1)); break; + case gl.BYTE: scale = (1.0 / ((1 << 6) - 1)); break; + case gl.UNSIGNED_BYTE: scale = (1.0 / ((1 << 7) - 1)); break; + + default: + throw new Error('Invalid type: ' + state.attributes[0].type); + } + value += (attribNdx != 0 ? ' + ' : '') + scale + ' * vec4(a_attrib' + attribNdx + ')'; + } else if (state.attributes[attribNdx].type != gl.FLOAT && !state.attributes[attribNdx].normalized) { + var scale = 0.0; + + switch (state.attributes[attribNdx].type) { + case gl.SHORT: scale = (0.5 / ((1 << 14) - 1)); break; + case gl.UNSIGNED_SHORT: scale = (0.5 / ((1 << 15) - 1)); break; + case gl.INT: scale = (0.5 / ((1 << 30) - 1)); break; + case gl.UNSIGNED_INT: scale = (0.5 / ((1 << 31) - 1)); break; + case gl.BYTE: scale = (0.5 / ((1 << 6) - 1)); break; + case gl.UNSIGNED_BYTE: scale = (0.5 / ((1 << 7) - 1)); break; + + default: + throw new Error('Invalid type: ' + state.attributes[0].type); + } + value += (attribNdx != 0 ? ' + ' : '') + scale + ' * a_attrib' + attribNdx; + } else + value += (attribNdx != 0 ? ' + ' : '') + 'a_attrib' + attribNdx; + } + + vtx += + 'out mediump vec4 v_value;\n' + + 'void main (void)\n' + + '{\n' + + '\tv_value = ' + value + ';\n'; + + if (state.attributes[0].integer) { + var scale = 0.0; + + switch (state.attributes[0].type) { + case gl.SHORT: scale = (1.0 / ((1 << 14) - 1)); break; + case gl.UNSIGNED_SHORT: scale = (1.0 / ((1 << 15) - 1)); break; + case gl.INT: scale = (1.0 / ((1 << 30) - 1)); break; + case gl.UNSIGNED_INT: scale = (1.0 / ((1 << 31) - 1)); break; + case gl.BYTE: scale = (1.0 / ((1 << 6) - 1)); break; + case gl.UNSIGNED_BYTE: scale = (1.0 / ((1 << 7) - 1)); break; + + default: + throw new Error('Invalid type: ' + state.attributes[0].type); + } + + vtx += + '\tgl_Position = vec4(' + scale + ' * ' + 'vec3(a_attrib0.xyz), 1.0);\n' + + '}'; + } else { + if (state.attributes[0].normalized || state.attributes[0].type == gl.FLOAT) { + vtx += + '\tgl_Position = vec4(a_attrib0.xyz, 1.0);\n' + + '}'; + } else { + var scale = 0.0; + + switch (state.attributes[0].type) { + case gl.SHORT: scale = (1.0 / ((1 << 14) - 1)); break; + case gl.UNSIGNED_SHORT: scale = (1.0 / ((1 << 15) - 1)); break; + case gl.INT: scale = (1.0 / ((1 << 30) - 1)); break; + case gl.UNSIGNED_INT: scale = (1.0 / ((1 << 31) - 1)); break; + case gl.BYTE: scale = (1.0 / ((1 << 6) - 1)); break; + case gl.UNSIGNED_BYTE: scale = (1.0 / ((1 << 7) - 1)); break; + + default: + throw new Error('Invalid type: ' + state.attributes[0].type); + } + + scale *= 0.5; + + vtx += + '\tgl_Position = vec4(' + scale + ' * ' + 'a_attrib0.xyz, 1.0);\n' + + '}'; + } + } + + var fragmentShader = + '#version 300 es\n' + + 'in mediump vec4 v_value;\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + '\tfragColor = vec4(v_value.xyz, 1.0);\n' + + '}'; + + return new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, fragmentShader)); +}; + +/** + * @param {es3fVertexArrayObjectTests.VertexArrayState} state + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.setState = function(state) { + this.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, state.elementArrayBuffer); + + for (var attribNdx = 0; attribNdx < state.attributes.length; attribNdx++) { + this.bindBuffer(gl.ARRAY_BUFFER, state.attributes[attribNdx].bufferNdx); + if (state.attributes[attribNdx].enabled) + gl.enableVertexAttribArray(attribNdx); + else + gl.disableVertexAttribArray(attribNdx); + + if (state.attributes[attribNdx].integer) + gl.vertexAttribIPointer(attribNdx, state.attributes[attribNdx].size, state.attributes[attribNdx].type, state.attributes[attribNdx].stride, state.attributes[attribNdx].offset); + else + gl.vertexAttribPointer(attribNdx, state.attributes[attribNdx].size, state.attributes[attribNdx].type, state.attributes[attribNdx].normalized, state.attributes[attribNdx].stride, state.attributes[attribNdx].offset); + + gl.vertexAttribDivisor(attribNdx, state.attributes[attribNdx].divisor); + } +}; + +/** + * @param {es3fVertexArrayObjectTests.VertexArrayState} state + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.makeDrawCall = function(state) { + gl.clearColor(0.7, 0.7, 0.7, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + var spec = this.m_spec; + + if (spec.useDrawElements) { + if (spec.instances == 0) + gl.drawElements(gl.TRIANGLES, spec.count, spec.indexType, spec.indexOffset); + else + gl.drawElementsInstanced(gl.TRIANGLES, spec.count, spec.indexType, spec.indexOffset, spec.instances); + } else { + if (spec.instances == 0) + gl.drawArrays(gl.TRIANGLES, 0, spec.count); + else + gl.drawArraysInstanced(gl.TRIANGLES, 0, spec.count, spec.instances); + } +}; + +/** + * @param {tcuSurface.Surface} vaoResult + * @param {tcuSurface.Surface} defaultResult + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.render = function(vaoResult, defaultResult) { + var vao = gl.createVertexArray(); + + gl.bindVertexArray(vao); + this.setState(this.m_spec.vao); + gl.bindVertexArray(null); + + this.setState(this.m_spec.state); + + gl.bindVertexArray(vao); + gl.useProgram(this.m_vaoProgram.getProgram()); + this.makeDrawCall(this.m_spec.vao); + vaoResult.readViewport(); + this.setState(this.m_spec.vao); + gl.bindVertexArray(null); + + gl.useProgram(this.m_stateProgram.getProgram()); + this.makeDrawCall(this.m_spec.state); + defaultResult.readViewport(); + + gl.deleteVertexArray(vao); +}; + +/** + * @param {tcuSurface.Surface} vaoRef + * @param {tcuSurface.Surface} defaultRef + */ +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.genReferences = function(vaoRef, defaultRef) { + this.setState(this.m_spec.vao); + gl.useProgram(this.m_vaoProgram.getProgram()); + this.makeDrawCall(this.m_spec.vao); + vaoRef.readViewport(); + + this.setState(this.m_spec.state); + gl.useProgram(this.m_stateProgram.getProgram()); + this.makeDrawCall(this.m_spec.state); + defaultRef.readViewport(); +}; + +es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.iterate = function() { + var vaoReference = new tcuSurface.Surface(); + var stateReference = new tcuSurface.Surface(); + var vaoResult = new tcuSurface.Surface(); + var stateResult = new tcuSurface.Surface(); + + var isOk; + + // logVertexArrayState(m_log, m_spec.vao, "Vertex Array Object State"); + // logVertexArrayState(m_log, m_spec.state, "OpenGL Vertex Array State"); + this.genReferences(stateReference, vaoReference); + this.render(stateResult, vaoResult); + + isOk = tcuImageCompare.pixelThresholdCompare('Results', 'Comparison result from rendering with Vertex Array State', stateReference, stateResult, [0, 0, 0, 0]); + isOk = isOk && tcuImageCompare.pixelThresholdCompare('Results', 'Comparison result from rendering with Vertex Array Object', vaoReference, vaoResult, [0, 0, 0, 0]); + + if (!isOk) + testFailedOptions('Result comparison failed', false); + else + testPassedOptions('Pass', true); + + return tcuTestCase.IterateResult.STOP; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +es3fVertexArrayObjectTests.VertexArrayObjectTests = function() { + tcuTestCase.DeqpTest.call(this, 'vertex_array_objects', 'Vertex array object test cases'); +}; + +es3fVertexArrayObjectTests.VertexArrayObjectTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +es3fVertexArrayObjectTests.VertexArrayObjectTests.prototype.constructor = es3fVertexArrayObjectTests.VertexArrayObjectTests; + +es3fVertexArrayObjectTests.VertexArrayObjectTests.prototype.init = function() { + var floatCoordBuffer48_1 = new es3fVertexArrayObjectTests.BufferSpec(48, 384, 2, 0, 0, gl.FLOAT, 0, 0, -1.0, 1.0); + var floatCoordBuffer48_2 = new es3fVertexArrayObjectTests.BufferSpec(48, 384, 2, 0, 0, gl.FLOAT, 0, 0, -1.0, 1.0); + + var shortCoordBuffer48 = new es3fVertexArrayObjectTests.BufferSpec(48, 192, 2, 0, 0, gl.SHORT, -32768, 32768, 0.0, 0.0); + + var spec; + var state; + // Different buffer + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.FLOAT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = false; + + state.elementArrayBuffer = 0; + + spec.buffers.push(floatCoordBuffer48_1); + spec.buffers.push(floatCoordBuffer48_2); + + spec.useDrawElements = false; + spec.instances = 0; + spec.count = 48; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.state.attributes[0].bufferNdx = 1; + spec.vao.attributes[0].bufferNdx = 2; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_buffer', 'diff_buffer')); + + // Different size + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.FLOAT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = false; + state.attributes[0].bufferNdx = 1; + + state.elementArrayBuffer = 0; + + spec.buffers.push(floatCoordBuffer48_1); + + spec.useDrawElements = false; + spec.instances = 0; + spec.count = 24; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.state.attributes[0].size = 2; + spec.vao.attributes[0].size = 3; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_size', 'diff_size')); + + // Different stride + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.SHORT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = true; + state.attributes[0].bufferNdx = 1; + + state.elementArrayBuffer = 0; + + spec.buffers.push(shortCoordBuffer48); + + spec.useDrawElements = false; + spec.instances = 0; + spec.count = 24; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.vao.attributes[0].stride = 2; + spec.state.attributes[0].stride = 4; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_stride', 'diff_stride')); + + // Different types + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.SHORT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = true; + state.attributes[0].bufferNdx = 1; + + state.elementArrayBuffer = 0; + + spec.buffers.push(shortCoordBuffer48); + + spec.useDrawElements = false; + spec.instances = 0; + spec.count = 24; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.vao.attributes[0].type = gl.SHORT; + spec.state.attributes[0].type = gl.BYTE; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_type', 'diff_type')); + + // Different "integer" + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.BYTE; + state.attributes[0].integer = true; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = false; + state.attributes[0].bufferNdx = 1; + + state.elementArrayBuffer = 0; + + spec.buffers.push(shortCoordBuffer48); + + spec.useDrawElements = false; + spec.count = 24; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.instances = 0; + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.state.attributes[0].integer = false; + spec.vao.attributes[0].integer = true; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_integer', 'diff_integer')); + + // Different divisor + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.SHORT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = true; + state.attributes[0].bufferNdx = 1; + + state.attributes[1].enabled = true; + state.attributes[1].size = 4; + state.attributes[1].stride = 0; + state.attributes[1].type = gl.FLOAT; + state.attributes[1].integer = false; + state.attributes[1].divisor = 0; + state.attributes[1].offset = 0; + state.attributes[1].normalized = false; + state.attributes[1].bufferNdx = 2; + + state.elementArrayBuffer = 0; + + spec.buffers.push(shortCoordBuffer48); + spec.buffers.push(floatCoordBuffer48_1); + + spec.useDrawElements = false; + spec.instances = 10; + spec.count = 12; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.vao.attributes[1].divisor = 3; + spec.state.attributes[1].divisor = 2; + + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_divisor', 'diff_divisor')); + + // Different offset + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.SHORT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = true; + state.attributes[0].bufferNdx = 1; + + state.elementArrayBuffer = 0; + + spec.buffers.push(shortCoordBuffer48); + + spec.useDrawElements = false; + spec.instances = 0; + spec.count = 24; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.vao.attributes[0].offset = 2; + spec.state.attributes[0].offset = 4; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_offset', 'diff_offset')); + + // Different normalize + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.SHORT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = true; + state.attributes[0].bufferNdx = 1; + + state.elementArrayBuffer = 0; + + spec.buffers.push(shortCoordBuffer48); + + spec.useDrawElements = false; + spec.instances = 0; + spec.count = 48; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + + spec.vao.attributes[0].normalized = true; + spec.state.attributes[0].normalized = false; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_normalize', 'diff_normalize')); + + // DrawElements with buffer + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + + state.attributes[0].enabled = true; + state.attributes[0].size = 2; + state.attributes[0].stride = 0; + state.attributes[0].type = gl.FLOAT; + state.attributes[0].integer = false; + state.attributes[0].divisor = 0; + state.attributes[0].offset = 0; + state.attributes[0].normalized = true; + state.attributes[0].bufferNdx = 1; + + state.elementArrayBuffer = 0; + + spec.buffers.push(floatCoordBuffer48_1); + + var indexBuffer = new es3fVertexArrayObjectTests.BufferSpec(24, 192, 1, 0, 0, gl.UNSIGNED_SHORT, 0, 47, 0.0, 0.0); + spec.buffers.push(indexBuffer); + spec.buffers.push(indexBuffer); + + spec.useDrawElements = true; + spec.count = 24; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.instances = 0; + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 48; + spec.indexType = gl.UNSIGNED_SHORT; + spec.indexCount = 24; + + spec.state.elementArrayBuffer = 3; + spec.vao.elementArrayBuffer = 2; + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_indices', 'diff_indices')); + + var attribCount = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + var random = new deRandom.Random(attribCount); + spec = new es3fVertexArrayObjectTests.Spec(); + + state = new es3fVertexArrayObjectTests.VertexArrayState(); + + spec.useDrawElements = false; + spec.instances = 0; + spec.count = 24; + spec.vao = state; + spec.state = deUtil.clone(state); + spec.indexOffset = 0; + spec.indexRangeMin = 0; + spec.indexRangeMax = 0; + spec.indexType = gl.NONE; + spec.indexCount = 0; + spec.vao.elementArrayBuffer = 0; + spec.state.elementArrayBuffer = 0; + + // Use all attributes + for (var attribNdx = 0; attribNdx < attribCount; attribNdx++) { + spec.buffers.push(shortCoordBuffer48); + + spec.state.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + spec.state.attributes[attribNdx].enabled = (random.getInt(0, 4) == 0) ? false : true; + spec.state.attributes[attribNdx].size = random.getInt(2, 4); + spec.state.attributes[attribNdx].stride = 2 * random.getInt(1, 3); + spec.state.attributes[attribNdx].type = gl.SHORT; + spec.state.attributes[attribNdx].integer = random.getBool(); + spec.state.attributes[attribNdx].divisor = random.getInt(0, 1); + spec.state.attributes[attribNdx].offset = 2 * random.getInt(0, 2); + spec.state.attributes[attribNdx].normalized = random.getBool(); + spec.state.attributes[attribNdx].bufferNdx = attribNdx + 1; + + if (attribNdx == 0) { + spec.state.attributes[attribNdx].divisor = 0; + spec.state.attributes[attribNdx].enabled = true; + spec.state.attributes[attribNdx].size = 2; + } + + spec.vao.attributes.push(new es3fVertexArrayObjectTests.Attribute()); + spec.vao.attributes[attribNdx].enabled = (random.getInt(0, 4) == 0) ? false : true; + spec.vao.attributes[attribNdx].size = random.getInt(2, 4); + spec.vao.attributes[attribNdx].stride = 2 * random.getInt(1, 3); + spec.vao.attributes[attribNdx].type = gl.SHORT; + spec.vao.attributes[attribNdx].integer = random.getBool(); + spec.vao.attributes[attribNdx].divisor = random.getInt(0, 1); + spec.vao.attributes[attribNdx].offset = 2 * random.getInt(0, 2); + spec.vao.attributes[attribNdx].normalized = random.getBool(); + spec.vao.attributes[attribNdx].bufferNdx = attribCount - attribNdx; + + if (attribNdx == 0) { + spec.vao.attributes[attribNdx].divisor = 0; + spec.vao.attributes[attribNdx].enabled = true; + spec.vao.attributes[attribNdx].size = 2; + } + + } + this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'all_attributes', 'all_attributes')); + +}; + +/** + * Run test + * @param {WebGL2RenderingContext} context + */ +es3fVertexArrayObjectTests.run = function(context) { + gl = context; + //Set up Test Root parameters + var state = tcuTestCase.runner; + state.setRoot(new es3fVertexArrayObjectTests.VertexArrayObjectTests()); + + //Set up name and description of this test series. + setCurrentTestName(state.testCases.fullName()); + description(state.testCases.getDescription()); + + try { + //Run test cases + tcuTestCase.runTestCases(); + } + catch (err) { + testFailedOptions('Failed to es3fVertexArrayObjectTests.run tests', false); + tcuTestCase.runner.terminate(); + } +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js new file mode 100644 index 000000000..ccfd34331 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js @@ -0,0 +1,1103 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('functional.gles3.es3fVertexArrayTests'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluVarType'); +goog.require('modules.shared.glsVertexArrayTests'); + +goog.scope(function() { + + var es3fVertexArrayTests = functional.gles3.es3fVertexArrayTests; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluTexture = framework.opengl.gluTexture; + var gluVarType = framework.opengl.gluVarType; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var tcuTexture = framework.common.tcuTexture; + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + var deUtil = framework.delibs.debase.deUtil; + var glsVertexArrayTests = modules.shared.glsVertexArrayTests; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * es3fVertexArrayTests.SingleVertexArrayUsageGroup + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsVertexArrayTests.deArray.Usage} usage + */ + es3fVertexArrayTests.SingleVertexArrayUsageGroup = function(usage) { + tcuTestCase.DeqpTest.call( + this, + "single_attribute.usages." + glsVertexArrayTests.deArray.usageTypeToString(usage), + glsVertexArrayTests.deArray.usageTypeToString(usage) + ); + this.makeExecutable(); + this.m_usage = usage; + }; + + es3fVertexArrayTests.SingleVertexArrayUsageGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayUsageGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayUsageGroup; + + /** + * init + */ + es3fVertexArrayTests.SingleVertexArrayUsageGroup.prototype.init = function() { + /** @type {Array} */ var counts = [1, 256]; + /** @type {Array} */ var strides = [0, -1, 17, 32]; // Treat negative value as sizeof input. Same as 0, but done outside of GL. + /** @type {Array} */ var inputTypes = [ + glsVertexArrayTests.deArray.InputType.FLOAT, + /*glsVertexArrayTests.deArray.InputType.FIXED,*/ + glsVertexArrayTests.deArray.InputType.SHORT, + glsVertexArrayTests.deArray.InputType.BYTE + ]; + + for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) { + for (var countNdx = 0; countNdx < counts.length; countNdx++) { + for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) { + /** @type {number} */ var stride = (strides[strideNdx] < 0 ? glsVertexArrayTests.deArray.inputTypeSize(inputTypes[inputTypeNdx]) * 2 : strides[strideNdx]); + /** @type {boolean} */ var aligned = (stride % glsVertexArrayTests.deArray.inputTypeSize(inputTypes[inputTypeNdx])) == 0; + /** @type {string} */ var name = 'stride' + stride + '_' + glsVertexArrayTests.deArray.inputTypeToString(inputTypes[inputTypeNdx]) + '_quads' + counts[countNdx]; + + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + inputTypes[inputTypeNdx], + glsVertexArrayTests.deArray.OutputType.VEC2, + glsVertexArrayTests.deArray.Storage.BUFFER, + this.m_usage, + 2, + 0, + stride, + false, + glsVertexArrayTests.GLValue.getMinValue(inputTypes[inputTypeNdx]), + glsVertexArrayTests.GLValue.getMaxValue(inputTypes[inputTypeNdx]) + ); + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = counts[countNdx]; + spec.first = 0; + spec.arrays.push(arraySpec); + + if (aligned) + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, name + ) + ); + } + } + } + }; + + /** + * es3fVertexArrayTests.SingleVertexArrayStrideGroup + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsVertexArrayTests.deArray.InputType} type + */ + es3fVertexArrayTests.SingleVertexArrayStrideGroup = function(type) { + tcuTestCase.DeqpTest.call(this, glsVertexArrayTests.deArray.inputTypeToString(type), glsVertexArrayTests.deArray.inputTypeToString(type)); + this.makeExecutable(); + this.m_type = type; + }; + + es3fVertexArrayTests.SingleVertexArrayStrideGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayStrideGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayStrideGroup; + + /** + * init + */ + es3fVertexArrayTests.SingleVertexArrayStrideGroup.prototype.init = function() { + /** @type {Array} */ var storages = [ + // User storage not supported in WebGL - glsVertexArrayTests.deArray.Storage.USER, + glsVertexArrayTests.deArray.Storage.BUFFER + ]; + var counts = [1, 256]; + var strides = [/*0,*/ -1, 17, 32]; // Treat negative value as sizeof input. Same as 0, but done outside of GL. + + for (var storageNdx = 0; storageNdx < storages.length; storageNdx++) { + for (var componentCount = 2; componentCount < 5; componentCount++) { + for (var countNdx = 0; countNdx < counts.length; countNdx++) { + for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) { + /** @type {boolean} */ var packed = this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10; + /** @type {number} */ var stride = (strides[strideNdx] < 0) ? ((packed) ? (16) : (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount)) : (strides[strideNdx]); + /** @type {number} */ var alignment = (packed) ? (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount) : (glsVertexArrayTests.deArray.inputTypeSize(this.m_type)); + /** @type {boolean} */ var bufferUnaligned = (storages[storageNdx] == glsVertexArrayTests.deArray.Storage.BUFFER) && (stride % alignment) != 0; + + /** @type {string} */ var name = glsVertexArrayTests.deArray.storageToString(storages[storageNdx]) + '_stride' + stride + '_components' + componentCount + '_quads' + counts[countNdx]; + + if ((this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || + this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) && componentCount != 4) + continue; + + /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + this.m_type, + glsVertexArrayTests.deArray.OutputType.VEC4, + storages[storageNdx], + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + componentCount, + 0, + stride, + false, + glsVertexArrayTests.GLValue.getMinValue(this.m_type), + glsVertexArrayTests.GLValue.getMaxValue(this.m_type) + ); + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = counts[countNdx]; + spec.first = 0; + spec.arrays.push(arraySpec); + + if (!bufferUnaligned) + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, name + ) + ); + } + } + } + } + }; + + /** + * es3fVertexArrayTests.SingleVertexArrayStrideTests + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.SingleVertexArrayStrideTests = function() { + tcuTestCase.DeqpTest.call(this, 'single_attribute.strides', 'Single stride vertex atribute'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.SingleVertexArrayStrideTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayStrideTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayStrideTests; + + es3fVertexArrayTests.SingleVertexArrayStrideTests.prototype.init = function() { + /** @type {Array} */ var inputTypes = [ + glsVertexArrayTests.deArray.InputType.FLOAT, + glsVertexArrayTests.deArray.InputType.SHORT, + glsVertexArrayTests.deArray.InputType.BYTE, + /*glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT, + glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE, + glsVertexArrayTests.deArray.InputType.FIXED,*/ + glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + + for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) + this.addChild( + new es3fVertexArrayTests.SingleVertexArrayStrideGroup( + inputTypes[inputTypeNdx] + ) + ); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsVertexArrayTests.deArray.InputType} type + */ + es3fVertexArrayTests.SingleVertexArrayFirstGroup = function(type) { + tcuTestCase.DeqpTest.call( + this, + glsVertexArrayTests.deArray.inputTypeToString(type), + glsVertexArrayTests.deArray.inputTypeToString(type) + ); + this.makeExecutable(); + + this.m_type = type; + }; + + es3fVertexArrayTests.SingleVertexArrayFirstGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayFirstGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayFirstGroup; + + /** + * init + */ + es3fVertexArrayTests.SingleVertexArrayFirstGroup.prototype.init = function() { + var counts = [5, 256]; + var firsts = [6, 24]; + var offsets = [1, 16, 17]; + var strides = [/*0,*/ -1, 17, 32]; // Tread negative value as sizeof input. Same as 0, but done outside of GL. + + for (var offsetNdx = 0; offsetNdx < offsets.length; offsetNdx++) { + for (var countNdx = 0; countNdx < counts.length; countNdx++) { + for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) { + for (var firstNdx = 0; firstNdx < firsts.length; firstNdx++) { + var packed = this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || + this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10; + var componentCount = packed ? 4 : 2; + var stride = strides[strideNdx] < 0 ? + (packed ? 8 : (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount)) : + (strides[strideNdx]); + var alignment = packed ? + (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount) : + (glsVertexArrayTests.deArray.inputTypeSize(this.m_type)); + var aligned = ((stride % alignment) == 0) && + ((offsets[offsetNdx] % alignment) == 0); + var name = 'first' + firsts[firstNdx] + '_offset' + offsets[offsetNdx] + '_stride' + stride + '_quads' + counts[countNdx]; + + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + this.m_type, + glsVertexArrayTests.deArray.OutputType.VEC2, + glsVertexArrayTests.deArray.Storage.BUFFER, + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + componentCount, + offsets[offsetNdx], + stride, + false, + glsVertexArrayTests.GLValue.getMinValue(this.m_type), + glsVertexArrayTests.GLValue.getMaxValue(this.m_type) + ); + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = counts[countNdx]; + spec.first = firsts[firstNdx]; + spec.arrays.push(arraySpec); + + if (aligned) + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, name + ) + ); + } + } + } + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.SingleVertexArrayFirstTests = function() { + tcuTestCase.DeqpTest.call(this, 'single_attribute.first', 'Single vertex attribute, different first values to drawArrays'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.SingleVertexArrayFirstTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayFirstTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayFirstTests; + + /** + * init + */ + es3fVertexArrayTests.SingleVertexArrayFirstTests.prototype.init = function() { + // Test offset with different input types, component counts and storage, Usage(?) + var inputTypes = [ + glsVertexArrayTests.deArray.InputType.FLOAT, + glsVertexArrayTests.deArray.InputType.BYTE, + glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + + for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) { + this.addChild( + new es3fVertexArrayTests.SingleVertexArrayFirstGroup( + inputTypes[inputTypeNdx] + ) + ); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsVertexArrayTests.deArray.InputType} type + */ + es3fVertexArrayTests.SingleVertexArrayOffsetGroup = function(type) { + tcuTestCase.DeqpTest.call( + this, + glsVertexArrayTests.deArray.inputTypeToString(type), + glsVertexArrayTests.deArray.inputTypeToString(type) + ); + this.makeExecutable(); + this.m_type = type; + }; + + es3fVertexArrayTests.SingleVertexArrayOffsetGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayOffsetGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayOffsetGroup; + + /** + * init + */ + es3fVertexArrayTests.SingleVertexArrayOffsetGroup.prototype.init = function() { + var counts = [1, 256]; + var offsets = [1, 4, 17, 32]; + var strides = [/*0,*/ -1, 17, 32]; // Tread negative value as sizeof input. Same as 0, but done outside of GL. + + for (var offsetNdx = 0; offsetNdx < offsets.length; offsetNdx++) { + for (var countNdx = 0; countNdx < counts.length; countNdx++) { + for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) { + var packed = this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || + this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10; + var componentCount = packed ? 4 : 2; + var stride = ( + strides[strideNdx] < 0 ? + glsVertexArrayTests.deArray.inputTypeSize( + this.m_type + ) * componentCount : + strides[strideNdx] + ); + var alignment = packed ? + glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount : + glsVertexArrayTests.deArray.inputTypeSize(this.m_type); + + var aligned = ((stride % alignment) == 0) && + ((offsets[offsetNdx] % alignment) == 0); + var name = 'offset' + offsets[offsetNdx] + + '_stride' + stride + '_quads' + + counts[countNdx]; + + /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + this.m_type, + glsVertexArrayTests.deArray.OutputType.VEC2, + glsVertexArrayTests.deArray.Storage.BUFFER, + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + componentCount, + offsets[offsetNdx], + stride, + false, + glsVertexArrayTests.GLValue.getMinValue(this.m_type), + glsVertexArrayTests.GLValue.getMaxValue(this.m_type) + ); + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = counts[countNdx]; + spec.first = 0; + spec.arrays.push(arraySpec); + + if (aligned) + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, name + ) + ); + } + } + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.SingleVertexArrayOffsetTests = function() { + tcuTestCase.DeqpTest.call(this, 'single_attribute.offset', 'Single vertex atribute offset element'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.SingleVertexArrayOffsetTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayOffsetTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayOffsetTests; + + /** + * init + */ + es3fVertexArrayTests.SingleVertexArrayOffsetTests.prototype.init = function() { + // Test offset with different input types, component counts and storage, Usage(?) + var inputTypes = [ + glsVertexArrayTests.deArray.InputType.FLOAT, + glsVertexArrayTests.deArray.InputType.BYTE, + glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + + for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) { + this.addChild( + new es3fVertexArrayTests.SingleVertexArrayOffsetGroup( + inputTypes[inputTypeNdx] + ) + ); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsVertexArrayTests.deArray.InputType} type + */ + es3fVertexArrayTests.SingleVertexArrayNormalizeGroup = function(type) { + tcuTestCase.DeqpTest.call( + this, + glsVertexArrayTests.deArray.inputTypeToString(type), + glsVertexArrayTests.deArray.inputTypeToString(type) + ); + this.makeExecutable(); + this.m_type = type; + }; + + es3fVertexArrayTests.SingleVertexArrayNormalizeGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayNormalizeGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayNormalizeGroup; + + /** + * init for SingleVertexArrayNormalizeGroup + */ + es3fVertexArrayTests.SingleVertexArrayNormalizeGroup.prototype.init = function() { + var counts = [1, 256]; + + for (var componentCount = 2; componentCount < 5; componentCount++) { + for (var countNdx = 0; countNdx < counts.length; countNdx++) { + if ( + ( + this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || + this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ) && componentCount != 4 + ) + continue; + + var name = 'components' + componentCount.toString() + '_quads' + counts[countNdx].toString(); + + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + this.m_type, + glsVertexArrayTests.deArray.OutputType.VEC4, + glsVertexArrayTests.deArray.Storage.BUFFER, //No USER Storage support in WebGL2 + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + componentCount, + 0, + 0, + true, + glsVertexArrayTests.GLValue.getMinValue(this.m_type), + glsVertexArrayTests.GLValue.getMaxValue(this.m_type) + ); + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = counts[countNdx]; + spec.first = 0; + spec.arrays.push(arraySpec); + + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, name + ) + ); + } + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.SingleVertexArrayNormalizeTests = function() { + tcuTestCase.DeqpTest.call(this, 'single_attribute.normalize', 'Single normalize vertex atribute'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.SingleVertexArrayNormalizeTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayNormalizeTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayNormalizeTests; + + /** + * init + */ + es3fVertexArrayTests.SingleVertexArrayNormalizeTests.prototype.init = function() { + // Test normalization with different input types, component counts and storage + /** @type {Array} */ var inputTypes = [ + glsVertexArrayTests.deArray.InputType.FLOAT, + glsVertexArrayTests.deArray.InputType.SHORT, + glsVertexArrayTests.deArray.InputType.BYTE, + glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT, + glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE, + //glsVertexArrayTests.deArray.InputType.FIXED, + glsVertexArrayTests.deArray.InputType.UNSIGNED_INT, + glsVertexArrayTests.deArray.InputType.INT, + glsVertexArrayTests.deArray.InputType.HALF, + glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10, + glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + + for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) { + this.addChild( + new es3fVertexArrayTests.SingleVertexArrayNormalizeGroup( + inputTypes[inputTypeNdx] + ) + ); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsVertexArrayTests.deArray.InputType} type + */ + es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup = function(type) { + tcuTestCase.DeqpTest.call( + this, + "single_attribute.output_types." + glsVertexArrayTests.deArray.inputTypeToString(type), + glsVertexArrayTests.deArray.inputTypeToString(type) + ); + this.makeExecutable(); + this.m_type = type; + }; + + es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup; + + es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup.prototype.init = function() { + var outputTypes = [ + glsVertexArrayTests.deArray.OutputType.VEC2, + glsVertexArrayTests.deArray.OutputType.VEC3, + glsVertexArrayTests.deArray.OutputType.VEC4, + glsVertexArrayTests.deArray.OutputType.IVEC2, + glsVertexArrayTests.deArray.OutputType.IVEC3, + glsVertexArrayTests.deArray.OutputType.IVEC4, + glsVertexArrayTests.deArray.OutputType.UVEC2, + glsVertexArrayTests.deArray.OutputType.UVEC3, + glsVertexArrayTests.deArray.OutputType.UVEC4 + ]; + var storages = [glsVertexArrayTests.deArray.Storage.BUFFER]; //No USER storage support in WebGL2 + var counts = [1, 256]; + + for (var outputTypeNdx = 0; outputTypeNdx < outputTypes.length; outputTypeNdx++) { + for (var storageNdx = 0; storageNdx < storages.length; storageNdx++) { + for (var componentCount = 2; componentCount < 5; componentCount++) { + for (var countNdx = 0; countNdx < counts.length; countNdx++) { + var name = 'components' + componentCount + '_' + + glsVertexArrayTests.deArray.outputTypeToString( + outputTypes[outputTypeNdx] + ) + + '_quads' + counts[countNdx]; + + var inputIsSignedInteger = + this.m_type == glsVertexArrayTests.deArray.InputType.INT || + this.m_type == glsVertexArrayTests.deArray.InputType.SHORT || + this.m_type == glsVertexArrayTests.deArray.InputType.BYTE; + + var inputIsUnignedInteger = + this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT || + this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT || + this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE; + + var outputIsSignedInteger = + outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.IVEC2 || + outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.IVEC3 || + outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.IVEC4; + + var outputIsUnsignedInteger = + outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.UVEC2 || + outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.UVEC3 || + outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.UVEC4; + + // If input type is float type and output type is int type skip + if ((this.m_type == glsVertexArrayTests.deArray.InputType.FLOAT || + this.m_type == glsVertexArrayTests.deArray.InputType.HALF) && + (outputTypes[outputTypeNdx] >= glsVertexArrayTests.deArray.OutputType.INT)) + continue; + + if ((this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || + this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) && + (outputTypes[outputTypeNdx] >= glsVertexArrayTests.deArray.OutputType.INT)) + continue; + + if ((this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || + this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) && + componentCount != 4) + continue; + + // Loading signed data as unsigned causes undefined values and vice versa + if (inputIsSignedInteger && outputIsUnsignedInteger) + continue; + if (inputIsUnignedInteger && outputIsSignedInteger) + continue; + + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + this.m_type, + outputTypes[outputTypeNdx], + storages[storageNdx], + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + componentCount, + 0, + 0, + false, + glsVertexArrayTests.GLValue.getMinValue(this.m_type), + glsVertexArrayTests.GLValue.getMaxValue(this.m_type) + ); + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = counts[countNdx]; + spec.first = 0; + spec.arrays.push(arraySpec); + + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, name + ) + ); + } + } + } + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.MultiVertexArrayCountTests = function() { + tcuTestCase.DeqpTest.call(this, 'multiple_attributes.attribute_count', 'Attribute counts'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.MultiVertexArrayCountTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.MultiVertexArrayCountTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayCountTests; + + /** + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @return {string} + */ + es3fVertexArrayTests.MultiVertexArrayCountTests.prototype.getTestName = function(spec) { + var name = ''; + name += spec.arrays.length; + + return name; + }; + + es3fVertexArrayTests.MultiVertexArrayCountTests.prototype.init = function() { + // Test attribute counts + var arrayCounts = [2, 3, 4, 5, 6, 7, 8]; + + for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++) { + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = 256; + spec.first = 0; + + for (var arrayNdx = 0; arrayNdx < arrayCounts[arrayCountNdx]; arrayNdx++) { + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + glsVertexArrayTests.deArray.InputType.FLOAT, + glsVertexArrayTests.deArray.OutputType.VEC2, + glsVertexArrayTests.deArray.Storage.BUFFER, // No USER storage support in WebGL2 + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + 2, + 0, + 0, + false, + glsVertexArrayTests.GLValue.getMinValue(glsVertexArrayTests.deArray.InputType.FLOAT), + glsVertexArrayTests.GLValue.getMaxValue(glsVertexArrayTests.deArray.InputType.FLOAT) + ); + spec.arrays.push(arraySpec); + } + + var name = this.getTestName(spec); + var desc = this.getTestName(spec); + + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, desc + ) + ); + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.MultiVertexArrayStorageTests = function() { + tcuTestCase.DeqpTest.call(this, 'multiple_attributes.storage', 'Attribute storages'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayStorageTests; + + /** + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @return {string} + */ + es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.getTestName = function(spec) { + var name = ''; + name += spec.arrays.length; + + for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++) + name += '_' + glsVertexArrayTests.deArray.storageToString(spec.arrays[arrayNdx].storage); + + return name; + }; + + /** + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @param {number} depth + */ + es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.addStorageCases = function(spec, depth) { + if (depth == 0) { + // Skip trivial case, used elsewhere + var ok = false; + for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++) { + if (spec.arrays[arrayNdx].storage != glsVertexArrayTests.deArray.Storage.USER) { + ok = true; + break; + } + } + + if (!ok) + return; + + var name = this.getTestName(spec); + var desc = this.getTestName(spec); + + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, desc + ) + ); + return; + } + + var storages = [ + //glsVertexArrayTests.deArray.Storage.USER, Not supported in WebGL 2.0 + glsVertexArrayTests.deArray.Storage.BUFFER + ]; + + for (var storageNdx = 0; storageNdx < storages.length; storageNdx++) { + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + glsVertexArrayTests.deArray.InputType.FLOAT, + glsVertexArrayTests.deArray.OutputType.VEC2, + storages[storageNdx], + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + 2, + 0, + 0, + false, + glsVertexArrayTests.GLValue.getMinValue(glsVertexArrayTests.deArray.InputType.FLOAT), + glsVertexArrayTests.GLValue.getMaxValue(glsVertexArrayTests.deArray.InputType.FLOAT) + ); + + var _spec = spec; + _spec.arrays.push(arraySpec); + this.addStorageCases(_spec, depth - 1); + } + }; + + /** + * init + */ + es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.init = function() { + // Test different storages + var arrayCounts = [3]; + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = 256; + spec.first = 0; + + for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++) + this.addStorageCases(spec, arrayCounts[arrayCountNdx]); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.MultiVertexArrayStrideTests = function() { + tcuTestCase.DeqpTest.call(this, 'multiple_attributes.stride', 'Strides'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayStrideTests; + + /** + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @return {string} + */ + es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.getTestName = function(spec) { + var name = ''; + + name += spec.arrays.length; + + for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++) { + name += '_' + + glsVertexArrayTests.deArray.inputTypeToString(spec.arrays[arrayNdx].inputType) + + spec.arrays[arrayNdx].componentCount + '_' + + spec.arrays[arrayNdx].stride; + } + + return name; + }; + + /** + * init + */ + es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.init = function() { + // Test different strides, with multiple arrays, input types?? + var arrayCounts = [3]; + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = 256; + spec.first = 0; + + for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++) + this.addStrideCases(spec, arrayCounts[arrayCountNdx]); + }; + + /** + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @param {number} depth + */ + es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.addStrideCases = function(spec, depth) { + if (depth == 0) { + var name = this.getTestName(spec); + var desc = this.getTestName(spec); + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, desc + ) + ); + return; + } + + var strides = [0, -1, 17, 32]; + var inputType = glsVertexArrayTests.deArray.InputType.FLOAT; + + for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) { + var componentCount = 2; + var stride = strides[strideNdx] >= 0 ? strides[strideNdx] : componentCount * glsVertexArrayTests.deArray.inputTypeSize(glsVertexArrayTests.deArray.InputType.FLOAT); + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + inputType, + glsVertexArrayTests.deArray.OutputType.VEC2, + glsVertexArrayTests.deArray.Storage.BUFFER, //USER storage not supported in WebGL 2.0 + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + componentCount, + 0, + stride, + false, + glsVertexArrayTests.GLValue.getMinValue(glsVertexArrayTests.deArray.InputType.FLOAT), + glsVertexArrayTests.GLValue.getMaxValue(glsVertexArrayTests.deArray.InputType.FLOAT) + ); + + /** @type {boolean} */ var aligned = (stride % glsVertexArrayTests.deArray.inputTypeSize(inputType)) == 0; + if (aligned) { + var _spec = /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec} */ (deUtil.clone(spec)); //To assign spec by value; + _spec.arrays.push(arraySpec); + this.addStrideCases(_spec, depth - 1); + } + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.MultiVertexArrayOutputTests = function() { + tcuTestCase.DeqpTest.call(this, 'multiple_attributes.input_types', 'input types'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayOutputTests; + + /** + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @return {string} + */ + es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.getTestName = function(spec) { + var name = ''; + + name += spec.arrays.length; + + for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++) { + name += '_' + + glsVertexArrayTests.deArray.inputTypeToString(spec.arrays[arrayNdx].inputType) + + spec.arrays[arrayNdx].componentCount + '_' + + glsVertexArrayTests.deArray.outputTypeToString(spec.arrays[arrayNdx].outputType); + } + + return name; + }; + + /** + * init + */ + es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.init = function() { + // Test different input types, with multiple arrays + var arrayCounts = [3]; + + var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec(); + + spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES; + spec.drawCount = 256; + spec.first = 0; + + for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++) + this.addInputTypeCases(spec, arrayCounts[arrayCountNdx]); + }; + + /** + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @param {number} depth + */ + es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.addInputTypeCases = function(spec, depth) { + if (depth == 0) { + var name = this.getTestName(spec); + var desc = this.getTestName(spec); + this.addChild( + new glsVertexArrayTests.MultiVertexArrayTest( + spec, name, desc + ) + ); + return; + } + + var inputTypes = [ + glsVertexArrayTests.deArray.InputType.BYTE, + glsVertexArrayTests.deArray.InputType.SHORT, + glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE, + glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT + ]; + + for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) { + var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec( + inputTypes[inputTypeNdx], + glsVertexArrayTests.deArray.OutputType.VEC2, + glsVertexArrayTests.deArray.Storage.BUFFER, //USER storage not supported in WebGL 2.0 + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + 2, + 0, + 0, + false, + glsVertexArrayTests.GLValue.getMinValue(inputTypes[inputTypeNdx]), + glsVertexArrayTests.GLValue.getMaxValue(inputTypes[inputTypeNdx]) + ); + + var _spec = /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec} */ (deUtil.clone(spec)); + _spec.arrays.push(arraySpec); + this.addInputTypeCases(_spec, depth - 1); + } + }; + + /** + * es3fVertexArrayTests.VertexArrayTestGroup + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + es3fVertexArrayTests.VertexArrayTestGroup = function() { + tcuTestCase.DeqpTest.call(this, 'vertex_arrays', 'Vertex array and array tests'); + this.makeExecutable(); + }; + + es3fVertexArrayTests.VertexArrayTestGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + es3fVertexArrayTests.VertexArrayTestGroup.prototype.constructor = es3fVertexArrayTests.VertexArrayTestGroup; + + /** + * init + */ + es3fVertexArrayTests.VertexArrayTestGroup.prototype.init = function() { + this.addChild(new es3fVertexArrayTests.SingleVertexArrayStrideTests()); + this.addChild(new es3fVertexArrayTests.SingleVertexArrayNormalizeTests()); + + // Test output types with different input types, component counts and storage, Usage?, Precision?, float? + var inputTypes = [ + glsVertexArrayTests.deArray.InputType.FLOAT, + glsVertexArrayTests.deArray.InputType.SHORT, + glsVertexArrayTests.deArray.InputType.BYTE, + glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT, + glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE, + glsVertexArrayTests.deArray.InputType.UNSIGNED_INT, + glsVertexArrayTests.deArray.InputType.INT, + glsVertexArrayTests.deArray.InputType.HALF, + glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10, + glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) { + this.addChild(new es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup(inputTypes[inputTypeNdx])); + } + + /** @type {Array} */ var usages = [ + glsVertexArrayTests.deArray.Usage.STATIC_DRAW, + glsVertexArrayTests.deArray.Usage.STREAM_DRAW, + glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW, + glsVertexArrayTests.deArray.Usage.STATIC_COPY, + glsVertexArrayTests.deArray.Usage.STREAM_COPY, + glsVertexArrayTests.deArray.Usage.DYNAMIC_COPY, + glsVertexArrayTests.deArray.Usage.STATIC_READ, + glsVertexArrayTests.deArray.Usage.STREAM_READ, + glsVertexArrayTests.deArray.Usage.DYNAMIC_READ + ]; + for (var usageNdx = 0; usageNdx < usages.length; usageNdx++) { + this.addChild(new es3fVertexArrayTests.SingleVertexArrayUsageGroup(usages[usageNdx])); + } + + this.addChild(new es3fVertexArrayTests.SingleVertexArrayOffsetTests()); + this.addChild(new es3fVertexArrayTests.SingleVertexArrayFirstTests()); + + this.addChild(new es3fVertexArrayTests.MultiVertexArrayCountTests()); + this.addChild(new es3fVertexArrayTests.MultiVertexArrayStorageTests()); + this.addChild(new es3fVertexArrayTests.MultiVertexArrayStrideTests()); + this.addChild(new es3fVertexArrayTests.MultiVertexArrayOutputTests()); + }; + + /** + * Create and execute the test cases + * @param {WebGL2RenderingContext} context + */ + es3fVertexArrayTests.run = function(context, range) { + gl = context; + //Set up root Test + var state = tcuTestCase.runner; + + var test = new es3fVertexArrayTests.VertexArrayTestGroup(); + var testName = test.fullName(); + var testDescription = test.getDescription(); + state.testCases = test; + state.testName = testName; + + //Set up name and description of this test series. + setCurrentTestName(testName); + description(testDescription); + + try { + if (range) + state.setRange(range); + //Run test cases + tcuTestCase.runTestCases(); + } catch (err) { + testFailedOptions('Failed to es3fVertexArrayTests.run tests', false); + tcuTestCase.runner.terminate(); + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html new file mode 100644 index 000000000..790863602 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html @@ -0,0 +1,32 @@ + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt new file mode 100644 index 000000000..d6d590a07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt @@ -0,0 +1,26 @@ +clear.html +tex2d_00.html +tex2d_01.html +tex2d_02.html +tex2d_03.html +tex2d_04.html +tex2d_05.html +texcube_00.html +texcube_01.html +texcube_02.html +texcube_03.html +texcube_04.html +texcube_05.html +tex2darray_00.html +tex2darray_01.html +tex2darray_02.html +tex2darray_03.html +tex2darray_04.html +tex2darray_05.html +tex3d_00.html +tex3d_01.html +tex3d_02.html +tex3d_03.html +tex3d_04.html +tex3d_05.html +blend.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html new file mode 100644 index 000000000..4826cf0cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html new file mode 100644 index 000000000..f431afb36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py new file mode 100644 index 000000000..5f8aed6bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for fbocolorbuffer* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'clear', + 'tex2d', + 'texcube', + 'tex2darray', + 'tex3d', + 'blend', +] + +_GROUP_TEST_COUNTS = [ + 1, + 6, + 6, + 6, + 6, + 1 +] + +def GenerateFilename(group, count, index): + """Generate test filename.""" + filename = group + assert index >= 0 and index < count + if count > 1: + index_str = str(index) + if index < 10: + index_str = "0" + index_str + filename += "_" + index_str + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + assert len(_GROUPS) == len(_GROUP_TEST_COUNTS) + test_index = 0 + filelist = [] + for ii in range(len(_GROUPS)): + group = _GROUPS[ii] + count = _GROUP_TEST_COUNTS[ii] + for index in range(count): + filename = GenerateFilename(group, count, index) + filelist.append(filename) + WriteTest(filename, test_index, test_index + 1) + test_index += 1 + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d.html new file mode 100644 index 000000000..b9918b2dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html new file mode 100644 index 000000000..b9918b2dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html new file mode 100644 index 000000000..653f89e2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html new file mode 100644 index 000000000..2e955cb8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html new file mode 100644 index 000000000..993108e86 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html new file mode 100644 index 000000000..d7f5b2782 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html new file mode 100644 index 000000000..1d8bdcbaa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray.html new file mode 100644 index 000000000..2e955cb8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html new file mode 100644 index 000000000..5e42f0021 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html new file mode 100644 index 000000000..e01cee3b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html new file mode 100644 index 000000000..2f9dd6061 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html new file mode 100644 index 000000000..0f9b76857 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html new file mode 100644 index 000000000..82ef5b6cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html new file mode 100644 index 000000000..28668bd63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d.html new file mode 100644 index 000000000..993108e86 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html new file mode 100644 index 000000000..98c04df0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html new file mode 100644 index 000000000..adb01c169 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html new file mode 100644 index 000000000..87a7e291e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html new file mode 100644 index 000000000..b7f7f18d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html new file mode 100644 index 000000000..a0a447385 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html new file mode 100644 index 000000000..91ce46cc3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube.html new file mode 100644 index 000000000..653f89e2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html new file mode 100644 index 000000000..0ff04bee2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html new file mode 100644 index 000000000..38512eb0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html new file mode 100644 index 000000000..2cf3fa750 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html new file mode 100644 index 000000000..2e5580085 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html new file mode 100644 index 000000000..9602acaf2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html new file mode 100644 index 000000000..a77a1bd24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Color Buffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html new file mode 100644 index 000000000..40dc05554 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html @@ -0,0 +1,32 @@ + + + +WebGL FBO Completeness Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html new file mode 100644 index 000000000..e74b8285c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html @@ -0,0 +1,32 @@ + + + +WebGL FBO Depthbuffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate.html new file mode 100644 index 000000000..e68b23bb6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate.html @@ -0,0 +1,25 @@ + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt new file mode 100644 index 000000000..189ebc1d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt @@ -0,0 +1,7 @@ +default.html +whole.html +sub.html +format_00.html +format_01.html +format_02.html +target.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html new file mode 100644 index 000000000..ea07a5f6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py new file mode 100644 index 000000000..d1a271d36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for fboinvalidate* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'default', + 'whole', + 'sub', + 'format', + 'target', +] + +_GROUP_TEST_COUNTS = [ + 1, + 1, + 1, + 3, + 1 +] + +def GenerateFilename(group, count, index): + """Generate test filename.""" + filename = group + assert index >= 0 and index < count + if count > 1: + index_str = str(index) + if index < 10: + index_str = "0" + index_str + filename += "_" + index_str + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + assert len(_GROUPS) == len(_GROUP_TEST_COUNTS) + test_index = 0 + filelist = [] + for ii in range(len(_GROUPS)): + group = _GROUPS[ii] + count = _GROUP_TEST_COUNTS[ii] + for index in range(count): + filename = GenerateFilename(group, count, index) + filelist.append(filename) + WriteTest(filename, test_index, test_index + 1) + test_index += 1 + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html new file mode 100644 index 000000000..50a4fad63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html new file mode 100644 index 000000000..2a130faad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html new file mode 100644 index 000000000..7aecfbf1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html new file mode 100644 index 000000000..0a883c0c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html new file mode 100644 index 000000000..e36c335d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html new file mode 100644 index 000000000..2792fa765 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html @@ -0,0 +1,32 @@ + + + + + +WebGL FBO Invalidate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html new file mode 100644 index 000000000..1de885749 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html @@ -0,0 +1,24 @@ + + + +WebGL Fbo Multisample Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html new file mode 100644 index 000000000..5e8d75c69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html @@ -0,0 +1,24 @@ + + + +WebGL Fbo Multisample Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html new file mode 100644 index 000000000..c1fb9e70f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html @@ -0,0 +1,24 @@ + + + +WebGL Fbo Multisample Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.html new file mode 100644 index 000000000..f7713861f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.html @@ -0,0 +1,30 @@ + + + +WebGL Fbo Multisample Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender.html new file mode 100644 index 000000000..1ffd32582 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender.html @@ -0,0 +1,30 @@ + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt new file mode 100644 index 000000000..65e66c894 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt @@ -0,0 +1,18 @@ +stencil_clear.html +shared_colorbuffer_clear.html +shared_colorbuffer_00.html +shared_colorbuffer_01.html +shared_colorbuffer_02.html +shared_depth_stencil.html +resize_00.html +resize_01.html +resize_02.html +resize_03.html +recreate_color_00.html +recreate_color_01.html +recreate_color_02.html +recreate_color_03.html +recreate_color_04.html +recreate_color_05.html +recreate_color_06.html +recreate_depth_stencil.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py new file mode 100644 index 000000000..8b13aa75d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for fborender* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'stencil_clear', + 'shared_colorbuffer_clear', + 'shared_colorbuffer', + 'shared_depth_stencil', + 'resize', + 'recreate_color', + 'recreate_depth_stencil' +] + +_GROUP_TEST_COUNTS = [ + 1, + 1, + 3, + 1, + 4, + 7, + 1 +] + +def GenerateFilename(group, count, index): + """Generate test filename.""" + filename = group + assert index >= 0 and index < count + if count > 1: + index_str = str(index) + if index < 10: + index_str = "0" + index_str + filename += "_" + index_str + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + assert len(_GROUPS) == len(_GROUP_TEST_COUNTS) + test_index = 0 + filelist = [] + for ii in range(len(_GROUPS)): + group = _GROUPS[ii] + count = _GROUP_TEST_COUNTS[ii] + for index in range(count): + filename = GenerateFilename(group, count, index) + filelist.append(filename) + WriteTest(filename, test_index, test_index + 1) + test_index += 1 + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html new file mode 100644 index 000000000..e318ee0e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html new file mode 100644 index 000000000..9fb93d486 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html new file mode 100644 index 000000000..08076ed79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html new file mode 100644 index 000000000..3c72f2bca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html new file mode 100644 index 000000000..1007e8c74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html new file mode 100644 index 000000000..1ec97a591 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html new file mode 100644 index 000000000..51ab8dec9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html new file mode 100644 index 000000000..0e4ca74e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html new file mode 100644 index 000000000..5d9bab23f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html new file mode 100644 index 000000000..94cb09653 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html new file mode 100644 index 000000000..c1f4c1361 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html new file mode 100644 index 000000000..4a6e2c81d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html new file mode 100644 index 000000000..54004f2d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html new file mode 100644 index 000000000..b3ac79efb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html new file mode 100644 index 000000000..2f85029b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html new file mode 100644 index 000000000..69a46744c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html new file mode 100644 index 000000000..ff5c62643 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html new file mode 100644 index 000000000..59c0819fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Render Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html new file mode 100644 index 000000000..95cc36b6a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Fbo State Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html new file mode 100644 index 000000000..251acc57d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html @@ -0,0 +1,24 @@ + + + +WebGL Fbo Stencilbuffer Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html new file mode 100644 index 000000000..1fd326939 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Float State Query Tests Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html new file mode 100644 index 000000000..31ee874ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html @@ -0,0 +1,24 @@ + + + +WebGL Frag Depth Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput.html new file mode 100644 index 000000000..ee33aa7b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput.html @@ -0,0 +1,29 @@ + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt new file mode 100644 index 000000000..8a410f650 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt @@ -0,0 +1,11 @@ +basic.float.html +basic.fixed.html +basic.int.html +basic.uint.html +array.float.html +array.fixed.html +array.int.html +array.uint.html +random_00.html +random_01.html +random_02.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html new file mode 100644 index 000000000..ab4c17aec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html new file mode 100644 index 000000000..474fe78ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html new file mode 100644 index 000000000..f100e804b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html new file mode 100644 index 000000000..fb3e5d96a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html new file mode 100644 index 000000000..e58eda69c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html new file mode 100644 index 000000000..b0fe9a2ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html new file mode 100644 index 000000000..871d8d015 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html new file mode 100644 index 000000000..915aa90d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py new file mode 100644 index 000000000..b2b3dd7e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for fragmentoutput* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'basic.float', + 'basic.fixed', + 'basic.int', + 'basic.uint', + 'array.float', + 'array.fixed', + 'array.int', + 'array.uint', + 'random_00', + 'random_01', + 'random_02' +] + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = _GROUPS[ii] + '.html' + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html new file mode 100644 index 000000000..d592e2f11 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html new file mode 100644 index 000000000..4e62689ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html new file mode 100644 index 000000000..3bcf9c544 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Fragment Output Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit.html new file mode 100644 index 000000000..12b1d5126 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit.html @@ -0,0 +1,31 @@ + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt new file mode 100644 index 000000000..6aeeaf64a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt @@ -0,0 +1,50 @@ +rect_00.html +rect_01.html +rect_02.html +rect_03.html +rect_04.html +rect_05.html +rect_06.html +conversion_00.html +conversion_01.html +conversion_02.html +conversion_03.html +conversion_04.html +conversion_05.html +conversion_06.html +conversion_07.html +conversion_08.html +conversion_09.html +conversion_10.html +conversion_11.html +conversion_12.html +conversion_13.html +conversion_14.html +conversion_15.html +conversion_16.html +conversion_17.html +conversion_18.html +conversion_19.html +conversion_20.html +conversion_21.html +conversion_22.html +conversion_23.html +conversion_24.html +conversion_25.html +conversion_26.html +conversion_27.html +conversion_28.html +conversion_29.html +conversion_30.html +conversion_31.html +conversion_32.html +conversion_33.html +conversion_34.html +depth_stencil.html +default_framebuffer_00.html +default_framebuffer_01.html +default_framebuffer_02.html +default_framebuffer_03.html +default_framebuffer_04.html +default_framebuffer_05.html +default_framebuffer_06.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html new file mode 100644 index 000000000..6124a6569 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html new file mode 100644 index 000000000..d0389725f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html new file mode 100644 index 000000000..cebfd04d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html new file mode 100644 index 000000000..2539865a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html new file mode 100644 index 000000000..d98f9268d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html new file mode 100644 index 000000000..6045c4a87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html new file mode 100644 index 000000000..f851a73d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html new file mode 100644 index 000000000..900c2c156 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html new file mode 100644 index 000000000..f9ea2cce4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html new file mode 100644 index 000000000..f20d4bea6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html new file mode 100644 index 000000000..1f15f08f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html new file mode 100644 index 000000000..9a8a2760c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html new file mode 100644 index 000000000..d4954fb18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html new file mode 100644 index 000000000..a68d778d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html new file mode 100644 index 000000000..5fbc4b1c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html new file mode 100644 index 000000000..0b31db5a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html new file mode 100644 index 000000000..31de2fb37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html new file mode 100644 index 000000000..85939968f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html new file mode 100644 index 000000000..303b1f9d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html new file mode 100644 index 000000000..4ca74e4ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html new file mode 100644 index 000000000..13dfe1137 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html new file mode 100644 index 000000000..717bcbbcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html new file mode 100644 index 000000000..8bf21f9e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html new file mode 100644 index 000000000..7238bdb41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html new file mode 100644 index 000000000..2e7313a66 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html new file mode 100644 index 000000000..053dd4be5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html new file mode 100644 index 000000000..c7f79eca6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html new file mode 100644 index 000000000..f8c41645f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html new file mode 100644 index 000000000..2222bb7f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html new file mode 100644 index 000000000..51d29810c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html new file mode 100644 index 000000000..eae41bfcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html new file mode 100644 index 000000000..55e96090e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html new file mode 100644 index 000000000..2ddd49fce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html new file mode 100644 index 000000000..83a32646a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html new file mode 100644 index 000000000..062cb7f3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html new file mode 100644 index 000000000..749c9bff5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html new file mode 100644 index 000000000..42cf9a647 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html new file mode 100644 index 000000000..3789b97c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html new file mode 100644 index 000000000..f1b0252da --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html new file mode 100644 index 000000000..60562a999 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html new file mode 100644 index 000000000..7bd5c7db5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html new file mode 100644 index 000000000..74645cf2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html new file mode 100644 index 000000000..fb09d67f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py new file mode 100644 index 000000000..82c05801c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for framebufferblit* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'rect', + 'conversion', + 'depth_stencil', + 'default_framebuffer', +] + +_GROUP_TEST_COUNTS = [ + 7, + 35, + 1, + 7 +] + +def GenerateFilename(group, count, index): + """Generate test filename.""" + filename = group + assert index >= 0 and index < count + if count > 1: + index_str = str(index) + if index < 10: + index_str = "0" + index_str + filename += "_" + index_str + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + assert len(_GROUPS) == len(_GROUP_TEST_COUNTS) + test_index = 0 + filelist = [] + for ii in range(len(_GROUPS)): + group = _GROUPS[ii] + count = _GROUP_TEST_COUNTS[ii] + for index in range(count): + filename = GenerateFilename(group, count, index) + filelist.append(filename) + WriteTest(filename, test_index, test_index + 1) + test_index += 1 + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html new file mode 100644 index 000000000..c0076c02e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html new file mode 100644 index 000000000..d2a53cedc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html new file mode 100644 index 000000000..b73eb396d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html new file mode 100644 index 000000000..86971ca0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html new file mode 100644 index 000000000..c9239f32f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html new file mode 100644 index 000000000..b40353a15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html new file mode 100644 index 000000000..8fb90dda4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Framebuffer Blit Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html new file mode 100644 index 000000000..ee57dcb18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Indexed Integer Values Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html new file mode 100644 index 000000000..6de0a016c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html @@ -0,0 +1,24 @@ + + + +WebGL Instanced Rendering Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html new file mode 100644 index 000000000..610ddf988 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Integer Values Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html new file mode 100644 index 000000000..765dede40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html @@ -0,0 +1,24 @@ + + + +WebGL Internalformat query tests Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html new file mode 100644 index 000000000..7cf80807e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html @@ -0,0 +1,34 @@ + + + +WebGL Lifetime Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample.html new file mode 100644 index 000000000..f02db3035 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample.html @@ -0,0 +1,24 @@ + + + +WebGL Multisample Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html new file mode 100644 index 000000000..f75435981 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html @@ -0,0 +1,30 @@ + + + +WebGL Negative Buffer API Tests + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html new file mode 100644 index 000000000..91de0c29c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html @@ -0,0 +1,23 @@ + + + +WebGL Negative Fragment API Tests + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html new file mode 100644 index 000000000..a1d9fc66e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html @@ -0,0 +1,24 @@ + + + +WebGL Negative Shader API Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html new file mode 100644 index 000000000..d54090eaf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html @@ -0,0 +1,23 @@ + + + +WebGL Negative State API Tests + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html new file mode 100644 index 000000000..dd6148003 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html @@ -0,0 +1,30 @@ + + + +WebGL Negative Texture API Tests + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html new file mode 100644 index 000000000..c93514cb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html @@ -0,0 +1,30 @@ + + + +WebGL Negative Vertex Array API Tests + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery.html new file mode 100644 index 000000000..1c7b1e8e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery.html @@ -0,0 +1,26 @@ + + + +WebGL Occlusion Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html new file mode 100644 index 000000000..d05abc128 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html @@ -0,0 +1,26 @@ + + + +WebGL Occlusion Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html new file mode 100644 index 000000000..bc04e961c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html @@ -0,0 +1,26 @@ + + + +WebGL Occlusion Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html new file mode 100644 index 000000000..1d9dd317d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html @@ -0,0 +1,24 @@ + + + +WebGL Pixel Buffer Object Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart.html new file mode 100644 index 000000000..e0d9cdf75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart.html @@ -0,0 +1,24 @@ + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html new file mode 100644 index 000000000..46ea49ed2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt new file mode 100644 index 000000000..6812378af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt @@ -0,0 +1,8 @@ +00.html +01.html +02.html +03.html +04.html +05.html +06.html +07.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html new file mode 100644 index 000000000..59c6331b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html new file mode 100644 index 000000000..5552f5917 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html new file mode 100644 index 000000000..c6b5fb2b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html new file mode 100644 index 000000000..e7354067a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html new file mode 100644 index 000000000..4ed0938d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html new file mode 100644 index 000000000..ed4039877 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html new file mode 100644 index 000000000..bf8b47fb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html @@ -0,0 +1,31 @@ + + + + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py new file mode 100644 index 000000000..9201d3cd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for primitiverestart* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Primitive Restart Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_NUM_TESTS = 8 + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(_NUM_TESTS): + index_str = str(ii) + if ii < 10: + index_str = "0" + index_str + filename = index_str + '.html' + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html new file mode 100644 index 000000000..185a23340 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html @@ -0,0 +1,24 @@ + + + +WebGL Rasterizer Discard Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html new file mode 100644 index 000000000..bd1163205 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Rbo State Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html new file mode 100644 index 000000000..bbe1167f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html @@ -0,0 +1,26 @@ + + + +WebGL ReadPixel Tests Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html new file mode 100644 index 000000000..6f9187657 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html @@ -0,0 +1,24 @@ + + + +WebGL Sampler Object Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html new file mode 100644 index 000000000..c78debef2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Sampler State Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html new file mode 100644 index 000000000..d33e78148 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html @@ -0,0 +1,24 @@ + + + +WebGL Shader API Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html new file mode 100644 index 000000000..f8a7be22e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Built-in Var Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html new file mode 100644 index 000000000..0dbad257f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Common Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate.html new file mode 100644 index 000000000..dc43e08e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Derivate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html new file mode 100644 index 000000000..4c2c679ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Derivate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html new file mode 100644 index 000000000..27a2da3ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Derivate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html new file mode 100644 index 000000000..bb8b90f91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Derivate Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt new file mode 100644 index 000000000..da4d02b37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt @@ -0,0 +1,9 @@ +varying.html +uniform.html +tmp.html +vec2.html +vec3.html +vec4.html +mat_00.html +mat_01.html +mat_02.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html new file mode 100644 index 000000000..2cd7e98fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html new file mode 100644 index 000000000..ee6c322e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html new file mode 100644 index 000000000..debdc57c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py new file mode 100644 index 000000000..f76472348 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for shaderindexing* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'varying', + 'uniform', + 'tmp', + 'vec2', + 'vec3', + 'vec4', + 'mat_00', + 'mat_01', + 'mat_02', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html new file mode 100644 index 000000000..679a8884f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html new file mode 100644 index 000000000..7c86a6f18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html new file mode 100644 index 000000000..eea9c022f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html new file mode 100644 index 000000000..d2c80c1c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html new file mode 100644 index 000000000..aaabf027a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html new file mode 100644 index 000000000..a896e726b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Indexing Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html new file mode 100644 index 000000000..6b5743385 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Loop Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html new file mode 100644 index 000000000..a2c5095c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Loop Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html new file mode 100644 index 000000000..fac36651c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Loop Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt new file mode 100644 index 000000000..dd0bb5a55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt @@ -0,0 +1,33 @@ +add_const.html +add_uniform.html +add_dynamic.html +sub_const.html +sub_uniform.html +sub_dynamic.html +mul_const_lowp.html +mul_const_mediump.html +mul_const_highp.html +mul_uniform_lowp.html +mul_uniform_mediump.html +mul_uniform_highp.html +mul_dynamic_lowp.html +mul_dynamic_mediump.html +mul_dynamic_highp.html +div_const.html +div_uniform.html +div_dynamic.html +matrixcompmult.html +outerproduct.html +transpose.html +determinant.html +inverse.html +unary_addition.html +negation.html +pre_increment.html +pre_decrement.html +post_increment.html +post_decrement.html +add_assign.html +sub_assign.html +mul_assign.html +div_assign.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html new file mode 100644 index 000000000..bb70e4d68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html new file mode 100644 index 000000000..bf15cb29a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html new file mode 100644 index 000000000..3deeb287a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html new file mode 100644 index 000000000..bf459f6c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html new file mode 100644 index 000000000..5b885f832 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html new file mode 100644 index 000000000..2d913df79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html new file mode 100644 index 000000000..a958d7503 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html new file mode 100644 index 000000000..623c9a9bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html new file mode 100644 index 000000000..4c77847c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html new file mode 100644 index 000000000..c14a19e2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html new file mode 100644 index 000000000..eab68d362 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html new file mode 100644 index 000000000..771a1556b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html new file mode 100644 index 000000000..80ff18f77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html new file mode 100644 index 000000000..40559ebf7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html new file mode 100644 index 000000000..21efaef93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html new file mode 100644 index 000000000..e3b57badd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html new file mode 100644 index 000000000..d1d3ce106 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html new file mode 100644 index 000000000..bf95faf77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html new file mode 100644 index 000000000..713d7d21a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html new file mode 100644 index 000000000..8da434cd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html new file mode 100644 index 000000000..91f022cb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html new file mode 100644 index 000000000..da0fdb831 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html new file mode 100644 index 000000000..1e3a5bb56 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html new file mode 100644 index 000000000..8a5f7bd46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html new file mode 100644 index 000000000..a379fdb88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html new file mode 100644 index 000000000..3921fb697 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html new file mode 100644 index 000000000..ac06ee71b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py new file mode 100644 index 000000000..df6d058bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for shadermatrix* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'add_const', + 'add_uniform', + 'add_dynamic', + 'sub_const', + 'sub_uniform', + 'sub_dynamic', + 'mul_const_lowp', + 'mul_const_mediump', + 'mul_const_highp', + 'mul_uniform_lowp', + 'mul_uniform_mediump', + 'mul_uniform_highp', + 'mul_dynamic_lowp', + 'mul_dynamic_mediump', + 'mul_dynamic_highp', + 'div_const', + 'div_uniform', + 'div_dynamic', + 'matrixcompmult', + 'outerproduct', + 'transpose', + 'determinant', + 'inverse', + 'unary_addition', + 'negation', + 'pre_increment', + 'pre_decrement', + 'post_increment', + 'post_decrement', + 'add_assign', + 'sub_assign', + 'mul_assign', + 'div_assign', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html new file mode 100644 index 000000000..79bf1fd34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html new file mode 100644 index 000000000..f574f6126 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html new file mode 100644 index 000000000..4408df474 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html new file mode 100644 index 000000000..5d7c293d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html new file mode 100644 index 000000000..52465410f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html new file mode 100644 index 000000000..1bcb526eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Matrix Test + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt new file mode 100644 index 000000000..47ed2c281 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt @@ -0,0 +1,31 @@ +unary_operator_00.html +unary_operator_01.html +unary_operator_02.html +binary_operator_00.html +binary_operator_01.html +binary_operator_02.html +binary_operator_03.html +binary_operator_04.html +binary_operator_05.html +binary_operator_06.html +binary_operator_07.html +binary_operator_08.html +binary_operator_09.html +binary_operator_10.html +binary_operator_11.html +binary_operator_12.html +binary_operator_13.html +binary_operator_14.html +binary_operator_15.html +angle_and_trigonometry_00.html +angle_and_trigonometry_01.html +angle_and_trigonometry_02.html +angle_and_trigonometry_03.html +exponential.html +common_functions.html +geometric.html +float_compare.html +int_compare.html +bool_compare.html +selection.html +sequence.html diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry.html new file mode 100644 index 000000000..bcc0d964d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html new file mode 100644 index 000000000..04d3c3c26 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html new file mode 100644 index 000000000..a342a007b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html new file mode 100644 index 000000000..a7273c649 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html new file mode 100644 index 000000000..6ca3ef247 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator.html new file mode 100644 index 000000000..3dfee3274 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html new file mode 100644 index 000000000..35fb8043c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html new file mode 100644 index 000000000..3740edea2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html new file mode 100644 index 000000000..1834fec65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html new file mode 100644 index 000000000..d4b3afca3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html new file mode 100644 index 000000000..bcc0d964d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html new file mode 100644 index 000000000..6f5a18932 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html new file mode 100644 index 000000000..f5f2c1d8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html new file mode 100644 index 000000000..eb5933dc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html new file mode 100644 index 000000000..4a5726c56 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html new file mode 100644 index 000000000..c64fd1d6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html new file mode 100644 index 000000000..16bc76864 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html new file mode 100644 index 000000000..98a66ffe9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html new file mode 100644 index 000000000..c463b6ff3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html new file mode 100644 index 000000000..8caa49706 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html new file mode 100644 index 000000000..245db50ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html new file mode 100644 index 000000000..d11b9aae5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html new file mode 100644 index 000000000..bbd4bbc68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_fucntions.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_fucntions.html new file mode 100644 index 000000000..f814bad59 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_fucntions.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions.html new file mode 100644 index 000000000..f814bad59 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html new file mode 100644 index 000000000..849f44f9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html new file mode 100644 index 000000000..2b8100287 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html new file mode 100644 index 000000000..1c2ce0f40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html new file mode 100644 index 000000000..8818deae4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html new file mode 100644 index 000000000..b9ea2cc1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html new file mode 100644 index 000000000..e818da471 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py new file mode 100644 index 000000000..3c92701b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for shaderoperator* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'unary_operator_00', + 'unary_operator_01', + 'unary_operator_02', + 'binary_operator_00', + 'binary_operator_01', + 'binary_operator_02', + 'binary_operator_03', + 'binary_operator_04', + 'binary_operator_05', + 'binary_operator_06', + 'binary_operator_07', + 'binary_operator_08', + 'binary_operator_09', + 'binary_operator_10', + 'binary_operator_11', + 'binary_operator_12', + 'binary_operator_13', + 'binary_operator_14', + 'binary_operator_15', + 'angle_and_trigonometry_00', + 'angle_and_trigonometry_01', + 'angle_and_trigonometry_02', + 'angle_and_trigonometry_03', + 'exponential', + 'common_fucntions', + 'geometric', + 'float_compare', + 'int_compare', + 'bool_compare', + 'selection', + 'sequence', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator.html new file mode 100644 index 000000000..8e80bcd62 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html new file mode 100644 index 000000000..8e80bcd62 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html new file mode 100644 index 000000000..3dfee3274 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html new file mode 100644 index 000000000..1b8c5e5e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html @@ -0,0 +1,33 @@ + + + + + +WebGL Shader Operator Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html new file mode 100644 index 000000000..a07e9b1d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html @@ -0,0 +1,26 @@ + + + +WebGL Shader Packing Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html new file mode 100644 index 000000000..ef7873371 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html new file mode 100644 index 000000000..ec659017c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html new file mode 100644 index 000000000..3097ed7b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Precision Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html new file mode 100644 index 000000000..325bb0bf2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html @@ -0,0 +1,31 @@ + + + +WebGL Shader State Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html new file mode 100644 index 000000000..e510ceb2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Struct Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html new file mode 100644 index 000000000..714f9044d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html @@ -0,0 +1,24 @@ + + + +WebGL Shader Switch Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt new file mode 100644 index 000000000..13a12534d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt @@ -0,0 +1,15 @@ +texture.html +textureoffset.html +textureproj.html +textureprojoffset.html +texturelod.html +texturelodoffset.html +textureprojlod.html +textureprojlodoffset.html +texturegrad.html +texturegradoffset.html +textureprojgrad.html +textureprojgradoffset.html +texelfetch.html +texelfetchoffset.html +texturesize.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py new file mode 100644 index 000000000..4a4b819ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for shadertexturefunction* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'texture', + 'textureoffset', + 'textureproj', + 'textureprojoffset', + 'texturelod', + 'texturelodoffset', + 'textureprojlod', + 'textureprojlodoffset', + 'texturegrad', + 'texturegradoffset', + 'textureprojgrad', + 'textureprojgradoffset', + 'texelfetch', + 'texelfetchoffset', + 'texturesize' +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html new file mode 100644 index 000000000..6787012d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html new file mode 100644 index 000000000..1d2e0de50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html new file mode 100644 index 000000000..f5668b4d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html new file mode 100644 index 000000000..7ef3d9210 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html new file mode 100644 index 000000000..c016084bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html new file mode 100644 index 000000000..928bade49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html new file mode 100644 index 000000000..23792c3d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html new file mode 100644 index 000000000..61b9c6aff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html new file mode 100644 index 000000000..676c7cde0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html new file mode 100644 index 000000000..c68978abb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html new file mode 100644 index 000000000..d2165e4f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html new file mode 100644 index 000000000..fe0fc76b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html new file mode 100644 index 000000000..a8d9760ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html new file mode 100644 index 000000000..3b383a72d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html new file mode 100644 index 000000000..245a285b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html @@ -0,0 +1,31 @@ + + + + + +WebGL Shader Texture Function Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html new file mode 100644 index 000000000..79045db51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html @@ -0,0 +1,24 @@ + + + +WebGL String Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html new file mode 100644 index 000000000..7d4c09f05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html @@ -0,0 +1,32 @@ + + + +WebGL Fence Sync Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt new file mode 100644 index 000000000..b446b8d6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt @@ -0,0 +1,116 @@ +2d_formats_00.html +2d_formats_01.html +2d_formats_02.html +2d_formats_03.html +2d_formats_04.html +2d_formats_05.html +2d_formats_06.html +2d_formats_07.html +2d_formats_08.html +2d_formats_09.html +2d_sizes_00.html +2d_sizes_01.html +2d_sizes_02.html +2d_sizes_03.html +2d_sizes_04.html +2d_sizes_05.html +2d_combinations_00.html +2d_combinations_01.html +2d_combinations_02.html +2d_combinations_03.html +2d_combinations_04.html +2d_combinations_05.html +cube_formats_00.html +cube_formats_01.html +cube_formats_02.html +cube_formats_03.html +cube_formats_04.html +cube_formats_05.html +cube_formats_06.html +cube_formats_07.html +cube_formats_08.html +cube_formats_09.html +cube_sizes_00.html +cube_sizes_01.html +cube_sizes_02.html +cube_sizes_03.html +cube_sizes_04.html +cube_combinations_00.html +cube_combinations_01.html +cube_combinations_02.html +cube_combinations_03.html +cube_combinations_04.html +cube_combinations_05.html +cube_no_edges_visible.html +2d_array_formats_00.html +2d_array_formats_01.html +2d_array_formats_02.html +2d_array_formats_03.html +2d_array_formats_04.html +2d_array_formats_05.html +2d_array_formats_06.html +2d_array_formats_07.html +2d_array_formats_08.html +2d_array_formats_09.html +2d_array_sizes_00.html +2d_array_sizes_01.html +2d_array_sizes_02.html +2d_array_sizes_03.html +2d_array_sizes_04.html +2d_array_combinations_00.html +2d_array_combinations_01.html +2d_array_combinations_02.html +2d_array_combinations_03.html +2d_array_combinations_04.html +2d_array_combinations_05.html +3d_formats_00.html +3d_formats_01.html +3d_formats_02.html +3d_formats_03.html +3d_formats_04.html +3d_formats_05.html +3d_formats_06.html +3d_formats_07.html +3d_formats_08.html +3d_formats_09.html +3d_sizes_00.html +3d_sizes_01.html +3d_sizes_02.html +3d_sizes_03.html +3d_sizes_04.html +3d_combinations_00.html +3d_combinations_01.html +3d_combinations_02.html +3d_combinations_03.html +3d_combinations_04.html +3d_combinations_05.html +3d_combinations_06.html +3d_combinations_07.html +3d_combinations_08.html +3d_combinations_09.html +3d_combinations_10.html +3d_combinations_11.html +3d_combinations_12.html +3d_combinations_13.html +3d_combinations_14.html +3d_combinations_15.html +3d_combinations_16.html +3d_combinations_17.html +3d_combinations_18.html +3d_combinations_19.html +3d_combinations_20.html +3d_combinations_21.html +3d_combinations_22.html +3d_combinations_23.html +3d_combinations_24.html +3d_combinations_25.html +3d_combinations_26.html +3d_combinations_27.html +3d_combinations_28.html +3d_combinations_29.html +3d_combinations_30.html +3d_combinations_31.html +3d_combinations_32.html +3d_combinations_33.html +3d_combinations_34.html +3d_combinations_35.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html new file mode 100644 index 000000000..629813355 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html new file mode 100644 index 000000000..1fd04cdb6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html new file mode 100644 index 000000000..63f3826d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html new file mode 100644 index 000000000..efe23d2a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html new file mode 100644 index 000000000..5fd151fb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html new file mode 100644 index 000000000..d6e8d71d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html new file mode 100644 index 000000000..7c822b2f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html new file mode 100644 index 000000000..adc218a46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html new file mode 100644 index 000000000..afb3b6737 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html new file mode 100644 index 000000000..03acb11a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html new file mode 100644 index 000000000..b16f7e9ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html new file mode 100644 index 000000000..cafc3bd48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html new file mode 100644 index 000000000..ce5e168b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html new file mode 100644 index 000000000..d4b59de12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html new file mode 100644 index 000000000..121f0f74e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html new file mode 100644 index 000000000..f306f70d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html new file mode 100644 index 000000000..ce7c08c57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html new file mode 100644 index 000000000..c83ad21fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html new file mode 100644 index 000000000..5c930d71c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html new file mode 100644 index 000000000..e131614e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html new file mode 100644 index 000000000..651e97d04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html new file mode 100644 index 000000000..b594c81df --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html new file mode 100644 index 000000000..f875ddc12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html new file mode 100644 index 000000000..51150be08 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html new file mode 100644 index 000000000..e22d0d44d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html new file mode 100644 index 000000000..e94ffc04f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html new file mode 100644 index 000000000..429ae6e3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html new file mode 100644 index 000000000..4b58c6f78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html new file mode 100644 index 000000000..ef0d419d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html new file mode 100644 index 000000000..f67031384 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html new file mode 100644 index 000000000..fc10d2db7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html new file mode 100644 index 000000000..95227c1dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html new file mode 100644 index 000000000..0397fbf6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html new file mode 100644 index 000000000..7eb40d143 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html new file mode 100644 index 000000000..a236ac7c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html new file mode 100644 index 000000000..8a29fe723 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html new file mode 100644 index 000000000..4ae822764 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html new file mode 100644 index 000000000..8d2e2d736 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html new file mode 100644 index 000000000..87bc3f9a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html new file mode 100644 index 000000000..b4a9c9010 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html new file mode 100644 index 000000000..3831e58a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html new file mode 100644 index 000000000..77ce5f6b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html new file mode 100644 index 000000000..64f1b65a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html new file mode 100644 index 000000000..e833feff8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html new file mode 100644 index 000000000..141193d5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html new file mode 100644 index 000000000..4913ab35e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html new file mode 100644 index 000000000..b60af0ea2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html new file mode 100644 index 000000000..5e4892249 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html new file mode 100644 index 000000000..d87584684 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html new file mode 100644 index 000000000..b1c2c808c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html new file mode 100644 index 000000000..79a2be951 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html new file mode 100644 index 000000000..c32a25ab7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html new file mode 100644 index 000000000..aa4c3c50d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html new file mode 100644 index 000000000..3872150b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html new file mode 100644 index 000000000..30763a2ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html new file mode 100644 index 000000000..f252f529e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html new file mode 100644 index 000000000..6c3e9b135 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html new file mode 100644 index 000000000..b4cb0d757 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html new file mode 100644 index 000000000..2c4590dd4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html new file mode 100644 index 000000000..c0838fc3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html new file mode 100644 index 000000000..48e924daa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html new file mode 100644 index 000000000..9cd79ceb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html new file mode 100644 index 000000000..e224822c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html new file mode 100644 index 000000000..2c959a811 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html new file mode 100644 index 000000000..78c6f0a3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html new file mode 100644 index 000000000..9980e3a3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html new file mode 100644 index 000000000..08c647aff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html new file mode 100644 index 000000000..fe81630d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html new file mode 100644 index 000000000..aa0cff373 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html new file mode 100644 index 000000000..a3423dcbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html new file mode 100644 index 000000000..071c36672 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html new file mode 100644 index 000000000..07d17edcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html new file mode 100644 index 000000000..cd7f63e14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html new file mode 100644 index 000000000..56988bd04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html new file mode 100644 index 000000000..286ace391 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html new file mode 100644 index 000000000..1ba0ae432 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html new file mode 100644 index 000000000..19cb29fb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html new file mode 100644 index 000000000..5afb12241 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html new file mode 100644 index 000000000..1411f68e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html new file mode 100644 index 000000000..1b41ca237 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html new file mode 100644 index 000000000..c8059f7e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html new file mode 100644 index 000000000..6529aec83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html new file mode 100644 index 000000000..249860cee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html new file mode 100644 index 000000000..0bb0aab1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html new file mode 100644 index 000000000..dba6d0f66 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html new file mode 100644 index 000000000..df06c3c1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html new file mode 100644 index 000000000..827ceba0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html new file mode 100644 index 000000000..695d317ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html new file mode 100644 index 000000000..72e7b4141 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html new file mode 100644 index 000000000..7ff817025 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html new file mode 100644 index 000000000..6263ae941 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html new file mode 100644 index 000000000..17e7a30c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html new file mode 100644 index 000000000..c888db714 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html new file mode 100644 index 000000000..d1f4a5f86 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html new file mode 100644 index 000000000..21e59eea0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html new file mode 100644 index 000000000..9833f0f84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html new file mode 100644 index 000000000..8fc001786 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html new file mode 100644 index 000000000..f80bc00d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html new file mode 100644 index 000000000..2d69ac867 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html new file mode 100644 index 000000000..ea6bbb755 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html new file mode 100644 index 000000000..e228874f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html new file mode 100644 index 000000000..f9c966e68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html new file mode 100644 index 000000000..bf9c256be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html new file mode 100644 index 000000000..d3f78a46c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html new file mode 100644 index 000000000..eb07dea65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html new file mode 100644 index 000000000..d7ccb2c17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html new file mode 100644 index 000000000..1496707ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html new file mode 100644 index 000000000..2683e71ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html new file mode 100644 index 000000000..d69dcfae6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html new file mode 100644 index 000000000..f34e51e8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html new file mode 100644 index 000000000..531df3bb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html new file mode 100644 index 000000000..4e4fe4dfa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html new file mode 100644 index 000000000..a4db3fc04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html new file mode 100644 index 000000000..cf7ac7644 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html new file mode 100644 index 000000000..6b8d94c51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html new file mode 100644 index 000000000..b1260c751 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py new file mode 100644 index 000000000..340d59f88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for texturefilter* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Texture Filtering Tests + + + + + + + + + +
+
+ + + + +""" + +_FILTERABLE_FORMAT_COUNT = 10 +_SIZE_2D_COUNT = 6 +_SIZE_CUBE_COUNT = 5 +_SIZE_2D_ARRAY_COUNT = 5 +_SIZE_3D_COUNT = 5 +_MIN_FILTER_MODE_COUNT = 6 +_MAG_FILTER_MODE_COUNT = 2 +_WRAP_MODE_COUNT = 3 + +_GROUPS = [ + '2d_formats', + '2d_sizes', + '2d_combinations', + 'cube_formats', + 'cube_sizes', + 'cube_combinations', + 'cube_no_edges_visible', + '2d_array_formats', + '2d_array_sizes', + '2d_array_combinations', + '3d_formats', + '3d_sizes', + '3d_combinations' +] + +_GROUP_TEST_COUNTS = [ + _FILTERABLE_FORMAT_COUNT, # 2d_formats + _SIZE_2D_COUNT, # 2d_sizes + _MIN_FILTER_MODE_COUNT, # 2d_combinations + _FILTERABLE_FORMAT_COUNT, # cube_formats + _SIZE_CUBE_COUNT, # cube_sizes + _MIN_FILTER_MODE_COUNT, # cube_combinations + 1, # cube_no_edges_visible + _FILTERABLE_FORMAT_COUNT, # 2d_array_formats + _SIZE_2D_ARRAY_COUNT, # 2d_array_sizes + _MIN_FILTER_MODE_COUNT, # 2d_array_combinations + _FILTERABLE_FORMAT_COUNT, # 3d_formats + _SIZE_3D_COUNT, # 3d_sizes, + _MIN_FILTER_MODE_COUNT * _MAG_FILTER_MODE_COUNT * _WRAP_MODE_COUNT, # 3d_combinations +] + +def GenerateFilename(group, count, index): + """Generate test filename.""" + assert index >= 0 and index < count + filename = group + if count > 1: + index_str = str(index) + if index < 10: + index_str = "0" + index_str + filename += "_" + index_str + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + assert len(_GROUPS) == len(_GROUP_TEST_COUNTS) + test_index = 0 + filelist = [] + for ii in range(len(_GROUPS)): + group = _GROUPS[ii] + count = _GROUP_TEST_COUNTS[ii] + for index in range(count): + filename = GenerateFilename(group, count, index) + filelist.append(filename) + WriteTest(filename, test_index, test_index + 1) + test_index += 1 + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt new file mode 100644 index 000000000..cbd63eb92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt @@ -0,0 +1,38 @@ +unsized_2d.html +unsized_2d_array.html +unsized_3d.html +sized_color_2d_pot_00.html +sized_color_2d_pot_01.html +sized_color_2d_pot_02.html +sized_color_2d_pot_03.html +sized_color_2d_npot_00.html +sized_color_2d_npot_01.html +sized_color_2d_npot_02.html +sized_color_2d_npot_03.html +sized_color_cube_pot_00.html +sized_color_cube_pot_01.html +sized_color_cube_pot_02.html +sized_color_cube_pot_03.html +sized_color_cube_npot_00.html +sized_color_cube_npot_01.html +sized_color_cube_npot_02.html +sized_color_cube_npot_03.html +sized_color_2d_array_pot_00.html +sized_color_2d_array_pot_01.html +sized_color_2d_array_pot_02.html +sized_color_2d_array_pot_03.html +sized_color_2d_array_npot_00.html +sized_color_2d_array_npot_01.html +sized_color_2d_array_npot_02.html +sized_color_2d_array_npot_03.html +sized_color_3d_pot_00.html +sized_color_3d_pot_01.html +sized_color_3d_pot_02.html +sized_color_3d_pot_03.html +sized_color_3d_npot_00.html +sized_color_3d_npot_01.html +sized_color_3d_npot_02.html +sized_color_3d_npot_03.html +sized_depth_stencil.html +compressed_2d.html +compressed_cube.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html new file mode 100644 index 000000000..8f104f0ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html new file mode 100644 index 000000000..39e7f2055 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html new file mode 100644 index 000000000..c0867d87a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html new file mode 100644 index 000000000..8f143eaf7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html new file mode 100644 index 000000000..92a8b2c98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html new file mode 100644 index 000000000..55fea6907 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html new file mode 100644 index 000000000..975fb089b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html new file mode 100644 index 000000000..11267669c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html new file mode 100644 index 000000000..26190a4f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html new file mode 100644 index 000000000..6d4280825 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html new file mode 100644 index 000000000..c0cea16d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html new file mode 100644 index 000000000..ca38325a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html new file mode 100644 index 000000000..04c3e0fbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html new file mode 100644 index 000000000..e63de3ae2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html new file mode 100644 index 000000000..d880ac719 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html new file mode 100644 index 000000000..e65f1f851 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html new file mode 100644 index 000000000..64d4715d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html new file mode 100644 index 000000000..67140d7f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html new file mode 100644 index 000000000..4b1eed3a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html new file mode 100644 index 000000000..9adf66b65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html new file mode 100644 index 000000000..6f6dd722e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html new file mode 100644 index 000000000..8d2f6ed04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html new file mode 100644 index 000000000..c1d3dedd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html new file mode 100644 index 000000000..e33bb5ea9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html new file mode 100644 index 000000000..f28f2589d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html new file mode 100644 index 000000000..a6028c929 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html new file mode 100644 index 000000000..1e6403f3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html new file mode 100644 index 000000000..9b79dd193 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html new file mode 100644 index 000000000..d3bfde633 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html new file mode 100644 index 000000000..7a9f7b361 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html new file mode 100644 index 000000000..9f88f7e57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html new file mode 100644 index 000000000..6f24c6d8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html new file mode 100644 index 000000000..3ce93d65a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html new file mode 100644 index 000000000..fcbf8d649 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html new file mode 100644 index 000000000..bca1fbfbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py new file mode 100644 index 000000000..c769a1400 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for textureformat* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'unsized_2d', + 'unsized_2d_array', + 'unsized_3d', + 'sized_color_2d_pot_00', + 'sized_color_2d_pot_01', + 'sized_color_2d_pot_02', + 'sized_color_2d_pot_03', + 'sized_color_2d_npot_00', + 'sized_color_2d_npot_01', + 'sized_color_2d_npot_02', + 'sized_color_2d_npot_03', + 'sized_color_cube_pot_00', + 'sized_color_cube_pot_01', + 'sized_color_cube_pot_02', + 'sized_color_cube_pot_03', + 'sized_color_cube_npot_00', + 'sized_color_cube_npot_01', + 'sized_color_cube_npot_02', + 'sized_color_cube_npot_03', + 'sized_color_2d_array_pot_00', + 'sized_color_2d_array_pot_01', + 'sized_color_2d_array_pot_02', + 'sized_color_2d_array_pot_03', + 'sized_color_2d_array_npot_00', + 'sized_color_2d_array_npot_01', + 'sized_color_2d_array_npot_02', + 'sized_color_2d_array_npot_03', + 'sized_color_3d_pot_00', + 'sized_color_3d_pot_01', + 'sized_color_3d_pot_02', + 'sized_color_3d_pot_03', + 'sized_color_3d_npot_00', + 'sized_color_3d_npot_01', + 'sized_color_3d_npot_02', + 'sized_color_3d_npot_03', + 'sized_depth_stencil', + 'compressed_2d', + 'compressed_cube', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html new file mode 100644 index 000000000..447e4387f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html new file mode 100644 index 000000000..6eaeb451e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html new file mode 100644 index 000000000..8fe25fde1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt new file mode 100644 index 000000000..48498b565 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt @@ -0,0 +1,144 @@ +2d_nearest_less_or_equal.html +2d_nearest_greater_or_equal.html +2d_nearest_less.html +2d_nearest_greater.html +2d_nearest_equal.html +2d_nearest_not_equal.html +2d_nearest_always.html +2d_nearest_never.html +2d_linear_less_or_equal.html +2d_linear_greater_or_equal.html +2d_linear_less.html +2d_linear_greater.html +2d_linear_equal.html +2d_linear_not_equal.html +2d_linear_always.html +2d_linear_never.html +2d_nearest_mipmap_nearest_less_or_equal.html +2d_nearest_mipmap_nearest_greater_or_equal.html +2d_nearest_mipmap_nearest_less.html +2d_nearest_mipmap_nearest_greater.html +2d_nearest_mipmap_nearest_equal.html +2d_nearest_mipmap_nearest_not_equal.html +2d_nearest_mipmap_nearest_always.html +2d_nearest_mipmap_nearest_never.html +2d_linear_mipmap_nearest_less_or_equal.html +2d_linear_mipmap_nearest_greater_or_equal.html +2d_linear_mipmap_nearest_less.html +2d_linear_mipmap_nearest_greater.html +2d_linear_mipmap_nearest_equal.html +2d_linear_mipmap_nearest_not_equal.html +2d_linear_mipmap_nearest_always.html +2d_linear_mipmap_nearest_never.html +2d_nearest_mipmap_linear_less_or_equal.html +2d_nearest_mipmap_linear_greater_or_equal.html +2d_nearest_mipmap_linear_less.html +2d_nearest_mipmap_linear_greater.html +2d_nearest_mipmap_linear_equal.html +2d_nearest_mipmap_linear_not_equal.html +2d_nearest_mipmap_linear_always.html +2d_nearest_mipmap_linear_never.html +2d_linear_mipmap_linear_less_or_equal.html +2d_linear_mipmap_linear_greater_or_equal.html +2d_linear_mipmap_linear_less.html +2d_linear_mipmap_linear_greater.html +2d_linear_mipmap_linear_equal.html +2d_linear_mipmap_linear_not_equal.html +2d_linear_mipmap_linear_always.html +2d_linear_mipmap_linear_never.html +cube_nearest_less_or_equal.html +cube_nearest_greater_or_equal.html +cube_nearest_less.html +cube_nearest_greater.html +cube_nearest_equal.html +cube_nearest_not_equal.html +cube_nearest_always.html +cube_nearest_never.html +cube_linear_less_or_equal.html +cube_linear_greater_or_equal.html +cube_linear_less.html +cube_linear_greater.html +cube_linear_equal.html +cube_linear_not_equal.html +cube_linear_always.html +cube_linear_never.html +cube_nearest_mipmap_nearest_less_or_equal.html +cube_nearest_mipmap_nearest_greater_or_equal.html +cube_nearest_mipmap_nearest_less.html +cube_nearest_mipmap_nearest_greater.html +cube_nearest_mipmap_nearest_equal.html +cube_nearest_mipmap_nearest_not_equal.html +cube_nearest_mipmap_nearest_always.html +cube_nearest_mipmap_nearest_never.html +cube_linear_mipmap_nearest_less_or_equal.html +cube_linear_mipmap_nearest_greater_or_equal.html +cube_linear_mipmap_nearest_less.html +cube_linear_mipmap_nearest_greater.html +cube_linear_mipmap_nearest_equal.html +cube_linear_mipmap_nearest_not_equal.html +cube_linear_mipmap_nearest_always.html +cube_linear_mipmap_nearest_never.html +cube_nearest_mipmap_linear_less_or_equal.html +cube_nearest_mipmap_linear_greater_or_equal.html +cube_nearest_mipmap_linear_less.html +cube_nearest_mipmap_linear_greater.html +cube_nearest_mipmap_linear_equal.html +cube_nearest_mipmap_linear_not_equal.html +cube_nearest_mipmap_linear_always.html +cube_nearest_mipmap_linear_never.html +cube_linear_mipmap_linear_less_or_equal.html +cube_linear_mipmap_linear_greater_or_equal.html +cube_linear_mipmap_linear_less.html +cube_linear_mipmap_linear_greater.html +cube_linear_mipmap_linear_equal.html +cube_linear_mipmap_linear_not_equal.html +cube_linear_mipmap_linear_always.html +cube_linear_mipmap_linear_never.html +2d_array_nearest_less_or_equal.html +2d_array_nearest_greater_or_equal.html +2d_array_nearest_less.html +2d_array_nearest_greater.html +2d_array_nearest_equal.html +2d_array_nearest_not_equal.html +2d_array_nearest_always.html +2d_array_nearest_never.html +2d_array_linear_less_or_equal.html +2d_array_linear_greater_or_equal.html +2d_array_linear_less.html +2d_array_linear_greater.html +2d_array_linear_equal.html +2d_array_linear_not_equal.html +2d_array_linear_always.html +2d_array_linear_never.html +2d_array_nearest_mipmap_nearest_less_or_equal.html +2d_array_nearest_mipmap_nearest_greater_or_equal.html +2d_array_nearest_mipmap_nearest_less.html +2d_array_nearest_mipmap_nearest_greater.html +2d_array_nearest_mipmap_nearest_equal.html +2d_array_nearest_mipmap_nearest_not_equal.html +2d_array_nearest_mipmap_nearest_always.html +2d_array_nearest_mipmap_nearest_never.html +2d_array_linear_mipmap_nearest_less_or_equal.html +2d_array_linear_mipmap_nearest_greater_or_equal.html +2d_array_linear_mipmap_nearest_less.html +2d_array_linear_mipmap_nearest_greater.html +2d_array_linear_mipmap_nearest_equal.html +2d_array_linear_mipmap_nearest_not_equal.html +2d_array_linear_mipmap_nearest_always.html +2d_array_linear_mipmap_nearest_never.html +2d_array_nearest_mipmap_linear_less_or_equal.html +2d_array_nearest_mipmap_linear_greater_or_equal.html +2d_array_nearest_mipmap_linear_less.html +2d_array_nearest_mipmap_linear_greater.html +2d_array_nearest_mipmap_linear_equal.html +2d_array_nearest_mipmap_linear_not_equal.html +2d_array_nearest_mipmap_linear_always.html +2d_array_nearest_mipmap_linear_never.html +2d_array_linear_mipmap_linear_less_or_equal.html +2d_array_linear_mipmap_linear_greater_or_equal.html +2d_array_linear_mipmap_linear_less.html +2d_array_linear_mipmap_linear_greater.html +2d_array_linear_mipmap_linear_equal.html +2d_array_linear_mipmap_linear_not_equal.html +2d_array_linear_mipmap_linear_always.html +2d_array_linear_mipmap_linear_never.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html new file mode 100644 index 000000000..683a50a80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html new file mode 100644 index 000000000..9031d2180 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html new file mode 100644 index 000000000..9ef3900ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html new file mode 100644 index 000000000..51914257e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html new file mode 100644 index 000000000..924315e72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html new file mode 100644 index 000000000..877f3ae81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html new file mode 100644 index 000000000..0495e7e3b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html new file mode 100644 index 000000000..c40fceded --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html new file mode 100644 index 000000000..b813379c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html new file mode 100644 index 000000000..01b90b131 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html new file mode 100644 index 000000000..ea6d12246 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html new file mode 100644 index 000000000..da5c45dc8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html new file mode 100644 index 000000000..6c7177d4e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html new file mode 100644 index 000000000..ece289868 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html new file mode 100644 index 000000000..d9ce0da35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html new file mode 100644 index 000000000..969dd028e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html new file mode 100644 index 000000000..e6cdc2aba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html new file mode 100644 index 000000000..8f3ab4a2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html new file mode 100644 index 000000000..12cbf4d71 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html new file mode 100644 index 000000000..aa16ca2d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html new file mode 100644 index 000000000..ff8c6b4e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html new file mode 100644 index 000000000..b12597025 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html new file mode 100644 index 000000000..aaf630f95 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html new file mode 100644 index 000000000..b5f37b7a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html new file mode 100644 index 000000000..87e30ba53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html new file mode 100644 index 000000000..0121ae0c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html new file mode 100644 index 000000000..a40770053 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html new file mode 100644 index 000000000..2b838e0da --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html new file mode 100644 index 000000000..b5e56cdc3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html new file mode 100644 index 000000000..3980fcd88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html new file mode 100644 index 000000000..fe782c37a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html new file mode 100644 index 000000000..57838d838 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html new file mode 100644 index 000000000..ac85fd057 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html new file mode 100644 index 000000000..17074cb88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html new file mode 100644 index 000000000..849a0787c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html new file mode 100644 index 000000000..4ed680906 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html new file mode 100644 index 000000000..484b3b7a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html new file mode 100644 index 000000000..7611bba2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html new file mode 100644 index 000000000..e80d611a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html new file mode 100644 index 000000000..0c8af699c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html new file mode 100644 index 000000000..58d3f537f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html new file mode 100644 index 000000000..26a3ca0c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html new file mode 100644 index 000000000..fc9895c7c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html new file mode 100644 index 000000000..82f5381db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html new file mode 100644 index 000000000..2959de11e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html new file mode 100644 index 000000000..d2d2a1657 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html new file mode 100644 index 000000000..970b393e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html new file mode 100644 index 000000000..cc52419bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html new file mode 100644 index 000000000..0c072e4e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html new file mode 100644 index 000000000..1c358069a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html new file mode 100644 index 000000000..65109bfc8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html new file mode 100644 index 000000000..b9065cde4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html new file mode 100644 index 000000000..d4d98b914 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html new file mode 100644 index 000000000..e0d4c1584 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html new file mode 100644 index 000000000..a71e2d2e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html new file mode 100644 index 000000000..03e604163 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html new file mode 100644 index 000000000..e0e163e2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html new file mode 100644 index 000000000..7498d0b29 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html new file mode 100644 index 000000000..8c9c018e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html new file mode 100644 index 000000000..0e23db2ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html new file mode 100644 index 000000000..519746474 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html new file mode 100644 index 000000000..53a9c44a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html new file mode 100644 index 000000000..879a5eec9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html new file mode 100644 index 000000000..6ddfb4a88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html new file mode 100644 index 000000000..89f48e479 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html new file mode 100644 index 000000000..79962393e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html new file mode 100644 index 000000000..f2207075c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html new file mode 100644 index 000000000..a600187eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html new file mode 100644 index 000000000..1d499f8c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html new file mode 100644 index 000000000..522a65e41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html new file mode 100644 index 000000000..b7368c275 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html new file mode 100644 index 000000000..490692b4d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html new file mode 100644 index 000000000..d811685f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html new file mode 100644 index 000000000..f6574fe35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html new file mode 100644 index 000000000..1b6df673a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html new file mode 100644 index 000000000..064388f63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html new file mode 100644 index 000000000..1efa1a01a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html new file mode 100644 index 000000000..10196bf59 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html new file mode 100644 index 000000000..c799aa9ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html new file mode 100644 index 000000000..cd0dd6a1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html new file mode 100644 index 000000000..5bd98c067 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html new file mode 100644 index 000000000..dee22dc3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html new file mode 100644 index 000000000..8b954a55a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html new file mode 100644 index 000000000..b6eb41c0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html new file mode 100644 index 000000000..be55dd6c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html new file mode 100644 index 000000000..996cb8a39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html new file mode 100644 index 000000000..1eef513be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html new file mode 100644 index 000000000..793c544c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html new file mode 100644 index 000000000..426e43125 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html new file mode 100644 index 000000000..4eca9eb32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html new file mode 100644 index 000000000..a4324c244 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html new file mode 100644 index 000000000..b63b14882 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html new file mode 100644 index 000000000..5e74f10bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html new file mode 100644 index 000000000..804b2e3ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html new file mode 100644 index 000000000..de447dac4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html new file mode 100644 index 000000000..fa8977bf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html new file mode 100644 index 000000000..846d6ee7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html new file mode 100644 index 000000000..829e0977f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html new file mode 100644 index 000000000..1035f8642 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html new file mode 100644 index 000000000..e28760581 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html new file mode 100644 index 000000000..cae8affb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html new file mode 100644 index 000000000..c7ad55972 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html new file mode 100644 index 000000000..6bc8a946d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html new file mode 100644 index 000000000..c3cc8ca0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html new file mode 100644 index 000000000..0294b65ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html new file mode 100644 index 000000000..d19866502 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html new file mode 100644 index 000000000..4d3c98cb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html new file mode 100644 index 000000000..2972d989a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html new file mode 100644 index 000000000..7015dec4f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html new file mode 100644 index 000000000..d67b0d5f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html new file mode 100644 index 000000000..a22b92d41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html new file mode 100644 index 000000000..2102e56dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html new file mode 100644 index 000000000..80ed0e3b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html new file mode 100644 index 000000000..e590f76bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html new file mode 100644 index 000000000..63d99bd97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html new file mode 100644 index 000000000..53bdba5ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html new file mode 100644 index 000000000..fffe6fe45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html new file mode 100644 index 000000000..1ddeb39d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html new file mode 100644 index 000000000..b96321fe1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html new file mode 100644 index 000000000..0c663cdaf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html new file mode 100644 index 000000000..de25c5ef0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html new file mode 100644 index 000000000..6a76cb062 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html new file mode 100644 index 000000000..d5fa0b62d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html new file mode 100644 index 000000000..b7e7085da --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html new file mode 100644 index 000000000..47c4b34d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html new file mode 100644 index 000000000..1c9f005c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html new file mode 100644 index 000000000..14af11c51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html new file mode 100644 index 000000000..96c1e1d58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html new file mode 100644 index 000000000..f7e1087a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html new file mode 100644 index 000000000..be1773c2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html new file mode 100644 index 000000000..e4aa08d13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html new file mode 100644 index 000000000..fe6705c20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html new file mode 100644 index 000000000..34bc00816 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html new file mode 100644 index 000000000..8d7a900a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html new file mode 100644 index 000000000..610869e06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html new file mode 100644 index 000000000..59a878d1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html new file mode 100644 index 000000000..dc788bc5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html new file mode 100644 index 000000000..e7e86e9cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html new file mode 100644 index 000000000..cdb64a95e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html new file mode 100644 index 000000000..26b6db723 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html new file mode 100644 index 000000000..8d71e5859 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html new file mode 100644 index 000000000..6e681695f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html new file mode 100644 index 000000000..15d5b531f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html new file mode 100644 index 000000000..3a3a41ddb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py new file mode 100644 index 000000000..78ed69ebe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for textureformat* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Texture Shadow Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_TARGETS = [ + '2d', + 'cube', + '2d_array', +] + +_FILTERS = [ + 'nearest', + 'linear', + 'nearest_mipmap_nearest', + 'linear_mipmap_nearest', + 'nearest_mipmap_linear', + 'linear_mipmap_linear', +] + +_COMPARE_FUNCS = [ + 'less_or_equal', + 'greater_or_equal', + 'less', + 'greater', + 'equal', + 'not_equal', + 'always', + 'never', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + ii = 0 + for iTarget in range(len(_TARGETS)): + for iFilter in range(len(_FILTERS)): + for iFunc in range(len(_COMPARE_FUNCS)): + item = _TARGETS[iTarget] + '_' + _FILTERS[iFilter] + '_' + _COMPARE_FUNCS[iFunc] + filename = GenerateFilename(item) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + ii = ii + 1 + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt new file mode 100644 index 000000000..b3f8275d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt @@ -0,0 +1,90 @@ +basic_teximage2d_2d_00.html +basic_teximage2d_2d_01.html +basic_teximage2d_cube_00.html +basic_teximage2d_cube_01.html +basic_teximage2d_cube_02.html +basic_teximage2d_cube_03.html +basic_teximage2d_cube_04.html +random_teximage2d_2d.html +random_teximage2d_cube.html +teximage2d_align.html +teximage2d_unpack_params.html +teximage2d_pbo_2d_00.html +teximage2d_pbo_2d_01.html +teximage2d_pbo_cube_00.html +teximage2d_pbo_cube_01.html +teximage2d_pbo_cube_02.html +teximage2d_pbo_cube_03.html +teximage2d_pbo_cube_04.html +teximage2d_pbo_params.html +teximage2d_depth.html +teximage2d_depth_pbo.html +basic_texsubimage2d_2d_00.html +basic_texsubimage2d_2d_01.html +basic_texsubimage2d_2d_02.html +basic_texsubimage2d_cube_00.html +basic_texsubimage2d_cube_01.html +basic_texsubimage2d_cube_02.html +basic_texsubimage2d_cube_03.html +basic_texsubimage2d_cube_04.html +texsubimage2d_empty_tex.html +texsubimage2d_align.html +texsubimage2d_unpack_params.html +texsubimage2d_pbo_2d_00.html +texsubimage2d_pbo_2d_01.html +texsubimage2d_pbo_cube_00.html +texsubimage2d_pbo_cube_01.html +texsubimage2d_pbo_cube_02.html +texsubimage2d_pbo_cube_03.html +texsubimage2d_pbo_cube_04.html +texsubimage2d_pbo_params.html +texsubimage2d_depth.html +basic_copyteximage2d.html +basic_copytexsubimage2d.html +basic_teximage3d_2d_array_00.html +basic_teximage3d_2d_array_01.html +basic_teximage3d_2d_array_02.html +basic_teximage3d_3d_00.html +basic_teximage3d_3d_01.html +basic_teximage3d_3d_02.html +basic_teximage3d_3d_03.html +basic_teximage3d_3d_04.html +teximage3d_unpack_params.html +teximage3d_pbo_2d_array_00.html +teximage3d_pbo_2d_array_01.html +teximage3d_pbo_3d_00.html +teximage3d_pbo_3d_01.html +teximage3d_pbo_params.html +teximage3d_depth.html +teximage3d_depth_pbo.html +basic_texsubimage3d_00.html +basic_texsubimage3d_01.html +basic_texsubimage3d_02.html +basic_texsubimage3d_03.html +basic_texsubimage3d_04.html +texsubimage3d_unpack_params.html +texsubimage3d_pbo_2d_array_00.html +texsubimage3d_pbo_2d_array_01.html +texsubimage3d_pbo_3d_00.html +texsubimage3d_pbo_3d_01.html +texsubimage3d_pbo_params.html +texsubimage3d_depth.html +texstorage2d_format_2d_00.html +texstorage2d_format_2d_01.html +texstorage2d_format_2d_02.html +texstorage2d_format_cube_00.html +texstorage2d_format_cube_01.html +texstorage2d_format_cube_02.html +texstorage2d_format_cube_03.html +texstorage2d_format_cube_04.html +texstorage2d_format_depth_stencil.html +texstorage2d_format_size.html +texstorage3d_format_2d_array_00.html +texstorage3d_format_2d_array_01.html +texstorage3d_format_2d_array_02.html +texstorage3d_format_3d_00.html +texstorage3d_format_3d_01.html +texstorage3d_format_3d_02.html +texstorage3d_format_3d_03.html +texstorage3d_format_depth_stencil.html +texstorage3d_format_size.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html new file mode 100644 index 000000000..8ad04f6a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html new file mode 100644 index 000000000..01832d5e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html new file mode 100644 index 000000000..25a3941fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html new file mode 100644 index 000000000..7258bb0f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html new file mode 100644 index 000000000..a0b44fa06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html new file mode 100644 index 000000000..1d59fd011 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html new file mode 100644 index 000000000..01fbabc0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html new file mode 100644 index 000000000..c1f662fb7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html new file mode 100644 index 000000000..1c0cbda64 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html new file mode 100644 index 000000000..04f5f82a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html new file mode 100644 index 000000000..fe6dbec66 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html new file mode 100644 index 000000000..b33f5c0dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html new file mode 100644 index 000000000..330a980b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html new file mode 100644 index 000000000..ebe844999 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html new file mode 100644 index 000000000..941e6d368 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html new file mode 100644 index 000000000..49bd66658 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html new file mode 100644 index 000000000..b35f582c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html new file mode 100644 index 000000000..2c9ab82a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html new file mode 100644 index 000000000..1ce8c4ed6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html new file mode 100644 index 000000000..ab339cc79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html new file mode 100644 index 000000000..5152b5926 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html new file mode 100644 index 000000000..519387bf4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html new file mode 100644 index 000000000..f2d88d309 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html new file mode 100644 index 000000000..e32a550b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html new file mode 100644 index 000000000..263e5da5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html new file mode 100644 index 000000000..c418c167b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html new file mode 100644 index 000000000..f24c56e38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html new file mode 100644 index 000000000..8d761c939 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html new file mode 100644 index 000000000..f04cd395a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html new file mode 100644 index 000000000..036df5fe2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html new file mode 100644 index 000000000..d166152ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html new file mode 100644 index 000000000..b7fcc7714 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html new file mode 100644 index 000000000..bf844178f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html new file mode 100644 index 000000000..6b2e31b76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html new file mode 100644 index 000000000..0ccf52ba1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html new file mode 100644 index 000000000..4df9f6a0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html new file mode 100644 index 000000000..26f503dbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html new file mode 100644 index 000000000..c0b7ce461 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html new file mode 100644 index 000000000..24e3ebb47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html new file mode 100644 index 000000000..76f74ebf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html new file mode 100644 index 000000000..cfc63dcf4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html new file mode 100644 index 000000000..5f26f61bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html new file mode 100644 index 000000000..cb4c7b87a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html new file mode 100644 index 000000000..43fdf383a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html new file mode 100644 index 000000000..a6a6691a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html new file mode 100644 index 000000000..d8ec29d39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html new file mode 100644 index 000000000..2b963af9b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html new file mode 100644 index 000000000..4a3c9e317 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html new file mode 100644 index 000000000..472621dc9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html new file mode 100644 index 000000000..4275a1c0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html new file mode 100644 index 000000000..213bc831d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html new file mode 100644 index 000000000..9bfd6c215 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html new file mode 100644 index 000000000..dfa571683 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html new file mode 100644 index 000000000..d764993f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html new file mode 100644 index 000000000..53077e684 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html new file mode 100644 index 000000000..f8a4c6c8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html new file mode 100644 index 000000000..d56154d30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html new file mode 100644 index 000000000..c575c39d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html new file mode 100644 index 000000000..8b4a76753 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html new file mode 100644 index 000000000..2e9aa1048 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html new file mode 100644 index 000000000..e2454c447 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html new file mode 100644 index 000000000..0d7bb7c00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html new file mode 100644 index 000000000..b7792d85b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html new file mode 100644 index 000000000..de3140514 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html new file mode 100644 index 000000000..831b7ba38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html new file mode 100644 index 000000000..a4bfad50f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html new file mode 100644 index 000000000..1673ca181 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html new file mode 100644 index 000000000..cad658bec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html new file mode 100644 index 000000000..dee4ae0bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html new file mode 100644 index 000000000..2a10ac2a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html new file mode 100644 index 000000000..b681d8307 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html new file mode 100644 index 000000000..990098d19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html new file mode 100644 index 000000000..33194ec15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html new file mode 100644 index 000000000..3da5eed58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html new file mode 100644 index 000000000..94391c252 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html new file mode 100644 index 000000000..906c70917 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html new file mode 100644 index 000000000..c96d0952c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html new file mode 100644 index 000000000..3fd841c5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html new file mode 100644 index 000000000..b62a2a157 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html new file mode 100644 index 000000000..eb6ab351b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html new file mode 100644 index 000000000..717d84018 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html new file mode 100644 index 000000000..b6e1027e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html new file mode 100644 index 000000000..0e341e798 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html new file mode 100644 index 000000000..9635f1e9c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html new file mode 100644 index 000000000..68443fffc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html new file mode 100644 index 000000000..b57819282 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html new file mode 100644 index 000000000..b5adb604a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html new file mode 100644 index 000000000..8bff387e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html new file mode 100644 index 000000000..cb4311db1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html new file mode 100644 index 000000000..3f3f7242f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py new file mode 100644 index 000000000..4693b1fb6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py @@ -0,0 +1,195 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for texturespecification* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'basic_teximage2d_2d_00', + 'basic_teximage2d_2d_01', + 'basic_teximage2d_cube_00', + 'basic_teximage2d_cube_01', + 'basic_teximage2d_cube_02', + 'basic_teximage2d_cube_03', + 'basic_teximage2d_cube_04', + 'random_teximage2d_2d', + 'random_teximage2d_cube', + 'teximage2d_align', + 'teximage2d_unpack_params', + 'teximage2d_pbo_2d_00', + 'teximage2d_pbo_2d_01', + 'teximage2d_pbo_cube_00', + 'teximage2d_pbo_cube_01', + 'teximage2d_pbo_cube_02', + 'teximage2d_pbo_cube_03', + 'teximage2d_pbo_cube_04', + 'teximage2d_pbo_params', + 'teximage2d_depth', + 'teximage2d_depth_pbo', + 'basic_texsubimage2d_2d_00', + 'basic_texsubimage2d_2d_01', + 'basic_texsubimage2d_2d_02', + 'basic_texsubimage2d_cube_00', + 'basic_texsubimage2d_cube_01', + 'basic_texsubimage2d_cube_02', + 'basic_texsubimage2d_cube_03', + 'basic_texsubimage2d_cube_04', + 'texsubimage2d_empty_tex', + 'texsubimage2d_align', + 'texsubimage2d_unpack_params', + 'texsubimage2d_pbo_2d_00', + 'texsubimage2d_pbo_2d_01', + 'texsubimage2d_pbo_cube_00', + 'texsubimage2d_pbo_cube_01', + 'texsubimage2d_pbo_cube_02', + 'texsubimage2d_pbo_cube_03', + 'texsubimage2d_pbo_cube_04', + 'texsubimage2d_pbo_params', + 'texsubimage2d_depth', + 'basic_copyteximage2d', + 'basic_copytexsubimage2d', + 'basic_teximage3d_2d_array_00', + 'basic_teximage3d_2d_array_01', + 'basic_teximage3d_2d_array_02', + 'basic_teximage3d_3d_00', + 'basic_teximage3d_3d_01', + 'basic_teximage3d_3d_02', + 'basic_teximage3d_3d_03', + 'basic_teximage3d_3d_04', + 'teximage3d_unpack_params', + 'teximage3d_pbo_2d_array_00', + 'teximage3d_pbo_2d_array_01', + 'teximage3d_pbo_3d_00', + 'teximage3d_pbo_3d_01', + 'teximage3d_pbo_params', + 'teximage3d_depth', + 'teximage3d_depth_pbo', + 'basic_texsubimage3d_00', + 'basic_texsubimage3d_01', + 'basic_texsubimage3d_02', + 'basic_texsubimage3d_03', + 'basic_texsubimage3d_04', + 'texsubimage3d_unpack_params', + 'texsubimage3d_pbo_2d_array_00', + 'texsubimage3d_pbo_2d_array_01', + 'texsubimage3d_pbo_3d_00', + 'texsubimage3d_pbo_3d_01', + 'texsubimage3d_pbo_params', + 'texsubimage3d_depth', + 'texstorage2d_format_2d_00', + 'texstorage2d_format_2d_01', + 'texstorage2d_format_2d_02', + 'texstorage2d_format_cube_00', + 'texstorage2d_format_cube_01', + 'texstorage2d_format_cube_02', + 'texstorage2d_format_cube_03', + 'texstorage2d_format_cube_04', + 'texstorage2d_format_depth_stencil', + 'texstorage2d_format_size', + 'texstorage3d_format_2d_array_00', + 'texstorage3d_format_2d_array_01', + 'texstorage3d_format_2d_array_02', + 'texstorage3d_format_3d_00', + 'texstorage3d_format_3d_01', + 'texstorage3d_format_3d_02', + 'texstorage3d_format_3d_03', + 'texstorage3d_format_depth_stencil', + 'texstorage3d_format_size', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html new file mode 100644 index 000000000..2b6600bee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html @@ -0,0 +1,24 @@ + + + +WebGL Texture State Query Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html new file mode 100644 index 000000000..fb1985259 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html @@ -0,0 +1,24 @@ + + + +WebGL Texture Wrap Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt new file mode 100644 index 000000000..7e3a90712 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt @@ -0,0 +1,22 @@ +rgba8_pot.html +rgba8_npot.html +eac_r11_pot.html +eac_r11_npot.html +eac_signed_r11_pot.html +eac_signed_r11_npot.html +eac_rg11_pot.html +eac_rg11_npot.html +eac_signed_rg11_pot.html +eac_signed_rg11_npot.html +etc2_rgb8_pot.html +etc2_rgb8_npot.html +etc2_srgb8_pot.html +etc2_srgb8_npot.html +etc2_rgb8_punchthrough_alpha1_pot.html +etc2_rgb8_punchthrough_alpha1_npot.html +etc2_srgb8_punchthrough_alpha1_pot.html +etc2_srgb8_punchthrough_alpha1_npot.html +etc2_eac_rgba8_pot.html +etc2_eac_rgba8_npot.html +etc2_eac_srgb8_alpha8_pot.html +etc2_eac_srgb8_alpha8_npot.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html new file mode 100644 index 000000000..a3cbe500a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html new file mode 100644 index 000000000..6c51aa998 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html new file mode 100644 index 000000000..0a1ae8f92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html new file mode 100644 index 000000000..9d4bf2c3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html new file mode 100644 index 000000000..c7aeca479 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html new file mode 100644 index 000000000..0cb75e22e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html new file mode 100644 index 000000000..6905c7677 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html new file mode 100644 index 000000000..83f3a8b53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html new file mode 100644 index 000000000..c3ab4caa4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html new file mode 100644 index 000000000..86d1dcd03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html new file mode 100644 index 000000000..25c6bebb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html new file mode 100644 index 000000000..8ffef8a6e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html new file mode 100644 index 000000000..c69e8adb3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html new file mode 100644 index 000000000..79cc6398f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html new file mode 100644 index 000000000..09d8c0116 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html new file mode 100644 index 000000000..07b5cf209 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html new file mode 100644 index 000000000..d2cb034cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html new file mode 100644 index 000000000..6f124f048 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html new file mode 100644 index 000000000..e6d38338b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html new file mode 100644 index 000000000..27af094ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html new file mode 100644 index 000000000..c05a40607 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html new file mode 100644 index 000000000..eeb9b4639 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html @@ -0,0 +1,31 @@ + + + + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py new file mode 100644 index 000000000..ebff114f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for textureformat* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Texture Specification Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'rgba8_pot', + 'rgba8_npot', + 'eac_r11_pot', + 'eac_r11_npot', + 'eac_signed_r11_pot', + 'eac_signed_r11_npot', + 'eac_rg11_pot', + 'eac_rg11_npot', + 'eac_signed_rg11_pot', + 'eac_signed_rg11_npot', + 'etc2_rgb8_pot', + 'etc2_rgb8_npot', + 'etc2_srgb8_pot', + 'etc2_srgb8_npot', + 'etc2_rgb8_punchthrough_alpha1_pot', + 'etc2_rgb8_punchthrough_alpha1_npot', + 'etc2_srgb8_punchthrough_alpha1_pot', + 'etc2_srgb8_punchthrough_alpha1_npot', + 'etc2_eac_rgba8_pot', + 'etc2_eac_rgba8_npot', + 'etc2_eac_srgb8_alpha8_pot', + 'etc2_eac_srgb8_alpha8_npot', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt new file mode 100644 index 000000000..79daefed5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt @@ -0,0 +1,29 @@ +position.html +point_size.html +basic_types_separate_points.html +basic_types_separate_lines.html +basic_types_separate_triangles.html +basic_types_interleaved_points.html +basic_types_interleaved_lines.html +basic_types_interleaved_triangles.html +array_separate_points.html +array_separate_lines.html +array_separate_triangles.html +array_interleaved_points.html +array_interleaved_lines.html +array_interleaved_triangles.html +array_element_separate_points.html +array_element_separate_lines.html +array_element_separate_triangles.html +array_element_interleaved_points.html +array_element_interleaved_lines.html +array_element_interleaved_triangles.html +interpolation_smooth.html +interpolation_flat.html +interpolation_centroid.html +random_separate_points.html +random_separate_lines.html +random_separate_triangles.html +random_interleaved_points.html +random_interleaved_lines.html +random_interleaved_triangles.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html new file mode 100644 index 000000000..3bf5e0cb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html new file mode 100644 index 000000000..4adc87543 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html new file mode 100644 index 000000000..5fbdf00bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html new file mode 100644 index 000000000..37667c6b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html new file mode 100644 index 000000000..f92dd2551 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html new file mode 100644 index 000000000..4bf5cf959 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html new file mode 100644 index 000000000..534b088d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html new file mode 100644 index 000000000..fa08538f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html new file mode 100644 index 000000000..5fea527b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html new file mode 100644 index 000000000..092e6e003 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html new file mode 100644 index 000000000..c8a7ad95c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html new file mode 100644 index 000000000..79d4b7450 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html new file mode 100644 index 000000000..66653a97b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html new file mode 100644 index 000000000..ed753da5a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html new file mode 100644 index 000000000..fc1f23912 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html new file mode 100644 index 000000000..191655141 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html new file mode 100644 index 000000000..64be41592 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html new file mode 100644 index 000000000..1d73630fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html new file mode 100644 index 000000000..ebceb16db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html new file mode 100644 index 000000000..5a3529867 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html new file mode 100644 index 000000000..39464ee26 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html new file mode 100644 index 000000000..b6391bff6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html new file mode 100644 index 000000000..6b4dc6f0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html new file mode 100644 index 000000000..7f63bfdcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html new file mode 100644 index 000000000..039029c0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html new file mode 100644 index 000000000..57798a435 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html new file mode 100644 index 000000000..66bfea802 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html new file mode 100644 index 000000000..3cd6f520a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html new file mode 100644 index 000000000..ab221ef05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html @@ -0,0 +1,31 @@ + + + + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py new file mode 100644 index 000000000..7f8ba8117 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for textureformat* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Transform Feedback Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'position', + 'point_size', + 'basic_types_separate_points', + 'basic_types_separate_lines', + 'basic_types_separate_triangles', + 'basic_types_interleaved_points', + 'basic_types_interleaved_lines', + 'basic_types_interleaved_triangles', + 'array_separate_points', + 'array_separate_lines', + 'array_separate_triangles', + 'array_interleaved_points', + 'array_interleaved_lines', + 'array_interleaved_triangles', + 'array_element_separate_points', + 'array_element_separate_lines', + 'array_element_separate_triangles', + 'array_element_interleaved_points', + 'array_element_interleaved_lines', + 'array_element_interleaved_triangles', + 'interpolation_smooth', + 'interpolation_flat', + 'interpolation_centroid', + 'random_separate_points', + 'random_separate_lines', + 'random_separate_triangles', + 'random_interleaved_points', + 'random_interleaved_lines', + 'random_interleaved_triangles' +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for i in xrange(len(_GROUPS)): + groupname = _GROUPS[i] + filename = GenerateFilename(groupname) + filelist.append(filename) + WriteTest(filename, i, i+1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html new file mode 100644 index 000000000..7ab136f5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html @@ -0,0 +1,24 @@ + + + +WebGL Uniform API Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt new file mode 100644 index 000000000..98735207b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt @@ -0,0 +1,4 @@ +info_query.html +value_initial.html +value_assigned.html +random.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html new file mode 100644 index 000000000..cb777e875 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform API Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html new file mode 100644 index 000000000..69a20c6d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform API Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py new file mode 100644 index 000000000..a6975e77d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for uniformapi* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Uniform API Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'info_query', + 'value_initial', + 'value_assigned', + 'random', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html new file mode 100644 index 000000000..9cce796e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform API Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html new file mode 100644 index 000000000..0244c70cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform API Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt new file mode 100644 index 000000000..dd35e8998 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt @@ -0,0 +1,10 @@ +single_basic_type.html +single_basic_array.html +single_struct.html +single_struct_array.html +single_nested_struct.html +single_nested_struct_array.html +instance_array_basic_type.html +multi_basic_types.html +multi_nested_struct.html +random.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html new file mode 100644 index 000000000..8b768722b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html new file mode 100644 index 000000000..205e276ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html new file mode 100644 index 000000000..115256955 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html new file mode 100644 index 000000000..a1d1bf685 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html new file mode 100644 index 000000000..3458c3918 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html new file mode 100644 index 000000000..a0ebbed79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html new file mode 100644 index 000000000..7a33d8731 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html new file mode 100644 index 000000000..006fdf9cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html new file mode 100644 index 000000000..4977f6491 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html new file mode 100644 index 000000000..cb39bbfec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html @@ -0,0 +1,31 @@ + + + + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py new file mode 100644 index 000000000..574d9c360 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for uniformbuffers* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Uniform Block Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'single_basic_type', + 'single_basic_array', + 'single_struct', + 'single_struct_array', + 'single_nested_struct', + 'single_nested_struct_array', + 'instance_array_basic_type', + 'multi_basic_types', + 'multi_nested_struct', + 'random', +] + +def GenerateFilename(group): + """Generate test filename.""" + filename = group + filename += ".html" + return filename + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + for ii in range(len(_GROUPS)): + filename = GenerateFilename(_GROUPS[ii]) + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html new file mode 100644 index 000000000..e6888b059 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html @@ -0,0 +1,24 @@ + + + +WebGL Vertex Array Object Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt new file mode 100644 index 000000000..f06de02f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt @@ -0,0 +1,27 @@ +single_attribute.stride.html +single_attribute.normalize.html +single_attribute.output_type.float.html +single_attribute.output_type.short.html +single_attribute.output_type.byte.html +single_attribute.output_type.unsigned_short.html +single_attribute.output_type.unsigned_byte.html +single_attribute.output_type.unsigned_int.html +single_attribute.output_type.int.html +single_attribute.output_type.half.html +single_attribute.output_type.unsigned_int_2_10_10_10.html +single_attribute.output_type.int_2_10_10_10.html +single_attribute.usage.static_draw.html +single_attribute.usage.stream_draw.html +single_attribute.usage.dynamic_draw.html +single_attribute.usage.static_copy.html +single_attribute.usage.stream_copy.html +single_attribute.usage.dynamic_copy.html +single_attribute.usage.static_read.html +single_attribute.usage.stream_read.html +single_attribute.usage.dynamic_read.html +single_attribute.offset.html +single_attribute.first.html +multiple_attributes.count.html +multiple_attributes.storage.html +multiple_attributes.stride.html +multiple_attributes.output.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html new file mode 100644 index 000000000..be380c95e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html new file mode 100644 index 000000000..37ff4a842 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html new file mode 100644 index 000000000..2dda45800 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html new file mode 100644 index 000000000..8913a2d93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html new file mode 100644 index 000000000..dd2b1a23b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html new file mode 100644 index 000000000..c92890a97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html new file mode 100644 index 000000000..6b9286c1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html new file mode 100644 index 000000000..0babde258 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html new file mode 100644 index 000000000..a4cd67561 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html new file mode 100644 index 000000000..95740244a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html new file mode 100644 index 000000000..ec3f4903c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html new file mode 100644 index 000000000..95eff6d99 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html new file mode 100644 index 000000000..ff6cbffa9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html new file mode 100644 index 000000000..1ef3deb9d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html new file mode 100644 index 000000000..efff6a628 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html new file mode 100644 index 000000000..9b90ae1ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html new file mode 100644 index 000000000..bf56c355a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html new file mode 100644 index 000000000..46bd9e203 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html new file mode 100644 index 000000000..347834c74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html new file mode 100644 index 000000000..dab5982da --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html new file mode 100644 index 000000000..8d868ce6a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html new file mode 100644 index 000000000..0c1c28616 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html new file mode 100644 index 000000000..eb3bb6126 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html new file mode 100644 index 000000000..bfed3a9bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html new file mode 100644 index 000000000..f7c63d107 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html new file mode 100644 index 000000000..238ce5e14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html new file mode 100644 index 000000000..6dd2a736c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html @@ -0,0 +1,31 @@ + + + + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py new file mode 100644 index 000000000..4fa2ce836 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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. + +""" + Generator for vertexarrays* tests. + This file needs to be run in its folder. +""" + +import sys + +_DO_NOT_EDIT_WARNING = """ + +""" + +_HTML_TEMPLATE = """ + + +WebGL Vertex Arrays Conformance Tests + + + + + + + + + +
+
+ + + + +""" + +_GROUPS = [ + 'single_attribute.stride', + 'single_attribute.normalize', + 'single_attribute.output_type.float', + 'single_attribute.output_type.short', + 'single_attribute.output_type.byte', + 'single_attribute.output_type.unsigned_short', + 'single_attribute.output_type.unsigned_byte', + 'single_attribute.output_type.unsigned_int', + 'single_attribute.output_type.int', + 'single_attribute.output_type.half', + 'single_attribute.output_type.unsigned_int_2_10_10_10', + 'single_attribute.output_type.int_2_10_10_10', + 'single_attribute.usage.static_draw', + 'single_attribute.usage.stream_draw', + 'single_attribute.usage.dynamic_draw', + 'single_attribute.usage.static_copy', + 'single_attribute.usage.stream_copy', + 'single_attribute.usage.dynamic_copy', + 'single_attribute.usage.static_read', + 'single_attribute.usage.stream_read', + 'single_attribute.usage.dynamic_read', + 'single_attribute.offset', + 'single_attribute.first', + 'multiple_attributes.count', + 'multiple_attributes.storage', + 'multiple_attributes.stride', + 'multiple_attributes.output', +] + +def WriteTest(filename, start, end): + """Write one test.""" + file = open(filename, "wb") + file.write(_DO_NOT_EDIT_WARNING) + file.write(_HTML_TEMPLATE % { + 'start': start, + 'end': end + }) + file.close + +def GenerateTests(): + """Generate all tests.""" + filelist = [] + ii = 0 + for ii in range(len(_GROUPS)): + filename = _GROUPS[ii] + ".html" + filelist.append(filename) + WriteTest(filename, ii, ii + 1) + return filelist + +def GenerateTestList(filelist): + file = open("00_test_list.txt", "wb") + file.write('\n'.join(filelist)) + file.close + +def main(argv): + """This is the main function.""" + filelist = GenerateTests() + GenerateTestList(filelist) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py b/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py new file mode 100644 index 000000000..47ad28ccc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py @@ -0,0 +1,43 @@ +import os +import re + +# Generate an HTML file for each .test file in the current directory +# + +TEST_LIST_FILE = '00_test_list.txt'; +TEMPLATE = 'template.html'; + +def genHTML(template, test): + contents = re.sub('___TEST_NAME___', "'" + test + "'", template); + filename = test + '.html'; + print "Generating " + filename; + with open(test + '.html', 'w') as f: + f.write(contents); + return filename; + + +def process_test_files(template): + generated = []; + files = os.listdir(os.getcwd()); + for file in files: + found = re.search('(^[^.].*)\.test$', file); + if found: + generated.append(genHTML(template,found.group(1))); + return generated; + +def readTemplate(): + contents = None; + with open(TEMPLATE, 'r') as f: + contents = f.read(); + return contents; + + +template = readTemplate(); +if (template): + test_list = process_test_files(template); + print "Generating " + TEST_LIST_FILE; + with open(TEST_LIST_FILE, 'w') as f: + for item in test_list: + f.write(item + '\n'); +else: + print "Couldn't find template file: " + TEMPLATE; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js new file mode 100644 index 000000000..5ba033ffc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js @@ -0,0 +1,1477 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL (ES) Module + * ----------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Attribute location tests + *//*--------------------------------------------------------------------*/ + +'use strict'; +goog.provide('modules.shared.glsAttributeLocationTests'); +goog.require('framework.common.tcuStringTemplate'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { + + var glsAttributeLocationTests = modules.shared.glsAttributeLocationTests; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var tcuStringTemplate = framework.common.tcuStringTemplate; + + /** + * @param {Array} bindings + * @param {string} attrib + * @return {number} + */ + glsAttributeLocationTests.getBoundLocation = function(bindings, attrib) { + return (bindings[attrib] === undefined ? glsAttributeLocationTests.LocationEnum.UNDEF : bindings[attrib]); + }; + + /** + * @param {Array} attributes + * @param {Array} bindings + * @return {boolean} + */ + glsAttributeLocationTests.hasAttributeAliasing = function(attributes, bindings) { + /** @type {Array} */ var reservedSpaces = []; + + /** @type {number} */ var location; + /** @type {number} */ var size; + + for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) { + location = glsAttributeLocationTests.getBoundLocation(bindings, attributes[attribNdx].getName()); + size = attributes[attribNdx].getType().getLocationSize(); + + if (location != glsAttributeLocationTests.LocationEnum.UNDEF) { + + for (var i = 0; i < size; i++) { + if (reservedSpaces[location + i]) + return true; + reservedSpaces[location + i] = true; + } + } + } + + return false; + }; + + /** + * @return {number} + */ + glsAttributeLocationTests.getMaxAttributeLocations = function() { + /** @type {number} */ var maxAttribs; + maxAttribs = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + return maxAttribs; + }; + + /** + * @param {Array} attributes + * @return {string} + */ + glsAttributeLocationTests.generateAttributeDefinitions = function(attributes) { + /** @type {string} */ var src = ''; + + for (var i = 0; i < attributes.length; i++) { + if (attributes[i].getLayoutLocation() != glsAttributeLocationTests.LocationEnum.UNDEF) + src += ('layout(location = ' + attributes[i].getLayoutLocation() + ') '); + + src += '${VTX_INPUT} mediump '; + src += (attributes[i].getType().getName() + ' '); + src += attributes[i].getName(); + src += (attributes[i].getArraySize() != glsAttributeLocationTests.ArrayEnum.NOT ? + '[' + attributes[i].getArraySize() + ']' : ''); + src += ';\n'; + } + + return src; + }; + + /** + * @param {Array} attributes + * @return {string} + */ + glsAttributeLocationTests.generateConditionUniformDefinitions = function(attributes) { + /** @type {string} */ var src = ''; + /** @type {Array} */ var conditions = []; + + for (var i = 0; i < attributes.length; i++) { + if (attributes[i].getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) && + attributes[i].getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS))) + if (conditions.indexOf(attributes[i].getCondition().getName()) == -1) + conditions.push(attributes[i].getCondition().getName()); + } + + for (var i = 0; i < conditions.length; i++) + src += ('uniform mediump float u_' + conditions[i] + ';\n'); + + return src; + }; + + /** + * @param {glsAttributeLocationTests.Attribute} attrib + * @param {number=} id + * @return {string} + */ + glsAttributeLocationTests.generateToVec4Expression = function(attrib, id) { + /** @type {string} */ var src = ''; + id = id === undefined ? -1 : id; + + /** @type {string} */ + var variableName = (attrib.getName() + (attrib.getArraySize() != glsAttributeLocationTests.ArrayEnum.NOT ? '[' + id + ']' : '')); + + switch (attrib.getType().getGLTypeEnum()) { + case gl.INT_VEC2: + case gl.UNSIGNED_INT_VEC2: + case gl.FLOAT_VEC2: + src += ('vec4(' + variableName + '.xy, ' + variableName + '.yx)'); + break; + + case gl.INT_VEC3: + case gl.UNSIGNED_INT_VEC3: + case gl.FLOAT_VEC3: + src += ('vec4(' + variableName + '.xyz, ' + variableName + '.x)'); + break; + + default: + src += ('vec4(' + variableName + ')'); + break; + } + + return src; + }; + + /** + * @param {Array} attributes + * @return {string} + */ + glsAttributeLocationTests.generateOutputCode = function(attributes) { + /** @type {string} */ var src = ''; + + for (var i = 0; i < attributes.length; i++) { + if (attributes[i].getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER))) { + src += '\tif (0 != 0)\n\t{\n'; + + if (attributes[i].getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT) + src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i]) + ';\n'); + else { + for (var j = 0; j < attributes[i].getArraySize(); i++) + src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i], j) + ';\n'); + } + + src += '\t}\n'; + } else if (attributes[i].getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS))) { + if (attributes[i].getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT) + src += ('\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i]) + ';\n'); + else { + for (var j = 0; j < attributes[i].getArraySize(); j++) + src += ('\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i], j) + ';\n'); + } + } else { + src += ('\tif (u_' + attributes[i].getCondition().getName() + (attributes[i].getCondition().getNegate() ? ' != ' : ' == ') + '0.0)\n'); + src += '\t{\n'; + + if (attributes[i].getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT) + src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i]) + ';\n'); + else { + for (var j = 0; j < attributes[i].getArraySize(); i++) + src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i], j) + ';\n'); + } + + src += '\t}\n'; + } + } + + return src; + }; + + /** + * @param {Array} attributes + * @return {string} + */ + glsAttributeLocationTests.generateVertexShaderTemplate = function(attributes) { + /** @type {string} */ var src = ''; + + src = '${VERSION}\n' + + '${VTX_OUTPUT} mediump vec4 v_color;\n' + + glsAttributeLocationTests.generateAttributeDefinitions(attributes) + + '\n' + + glsAttributeLocationTests.generateConditionUniformDefinitions(attributes) + + '\n' + + 'void main (void)\n' + + '{\n' + + '\tmediump vec4 color = vec4(0.0);\n' + + '\n' + + glsAttributeLocationTests.generateOutputCode(attributes) + + '\n' + + '\tv_color = color;\n' + + '\tgl_Position = color;\n' + + '}\n'; + + return src; + }; + + /** + * @param {Array} attributes + * @param {boolean} attributeAliasing + * @return {string} + */ + glsAttributeLocationTests.createVertexShaderSource = function(attributes, attributeAliasing) { + // \note On GLES only GLSL #version 100 supports aliasing + /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.getGLSLVersion(gl); + glslVersion = attributeAliasing ? gluShaderUtil.GLSLVersion.V100_ES : glslVersion; + /** @type {boolean} */ var usesInOutQualifiers = gluShaderUtil.glslVersionUsesInOutQualifiers(glslVersion); + /** @type {string} */ var vertexShaderTemplate = glsAttributeLocationTests.generateVertexShaderTemplate(attributes); + + /** @type {Array} */ var parameters = []; + + parameters['VERSION'] = gluShaderUtil.getGLSLVersionDeclaration(glslVersion); + parameters['VTX_OUTPUT'] = usesInOutQualifiers ? 'out' : 'varying'; + parameters['VTX_INPUT'] = usesInOutQualifiers ? 'in' : 'attribute'; + parameters['FRAG_INPUT'] = usesInOutQualifiers ? 'in' : 'varying'; + parameters['FRAG_OUTPUT_VAR'] = usesInOutQualifiers ? 'dEQP_FragColor' : 'gl_FragColor'; + parameters['FRAG_OUTPUT_DECLARATION'] = usesInOutQualifiers ? 'layout(location=0) out mediump vec4 dEQP_FragColor;' : ''; + + return tcuStringTemplate.specialize(vertexShaderTemplate, parameters); + }; + + /** + * @param {boolean} attributeAliasing + * @return {string} + */ + glsAttributeLocationTests.createFragmentShaderSource = function(attributeAliasing) { + /** @type {string} */ var fragmentShaderSource = ''; + fragmentShaderSource = '${VERSION}\n' + + '${FRAG_OUTPUT_DECLARATION}\n' + + '${FRAG_INPUT} mediump vec4 v_color;\n' + + 'void main (void)\n' + + '{\n' + + '\t${FRAG_OUTPUT_VAR} = v_color;\n' + + '}\n'; + + // \note On GLES only GLSL #version 100 supports aliasing + /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.getGLSLVersion(gl); + glslVersion = attributeAliasing ? gluShaderUtil.GLSLVersion.V100_ES : glslVersion; + /** @type {boolean} */ var usesInOutQualifiers = gluShaderUtil.glslVersionUsesInOutQualifiers(glslVersion); + + /** @type {Array} */ var parameters = []; + + parameters['VERSION'] = gluShaderUtil.getGLSLVersionDeclaration(glslVersion); + parameters['VTX_OUTPUT'] = usesInOutQualifiers ? 'out' : 'varying'; + parameters['VTX_INPUT'] = usesInOutQualifiers ? 'in' : 'attribute'; + parameters['FRAG_INPUT'] = usesInOutQualifiers ? 'in' : 'varying'; + parameters['FRAG_OUTPUT_VAR'] = usesInOutQualifiers ? 'dEQP_FragColor' : 'gl_FragColor'; + parameters['FRAG_OUTPUT_DECLARATION'] = usesInOutQualifiers ? 'layout(location=0) out mediump vec4 dEQP_FragColor;' : ''; + + return tcuStringTemplate.specialize(fragmentShaderSource, parameters); + }; + + glsAttributeLocationTests.logProgram = function(program) { + var programLinkOk = /** @type {boolean} */ (gl.getProgramParameter(program, gl.LINK_STATUS)); + /**@type{string} */ var programInfoLog = gl.getProgramInfoLog(program); + /**@type{string} */ var log = 'Program Link Info: ' + programInfoLog + + 'Link result: ' + (programLinkOk ? 'Ok' : 'Fail'); + + bufferedLogToConsole(log); + }; + + glsAttributeLocationTests.logAttributes = function(attributes) { + /**@type{string} */ var log; + for (var i = 0; i < attributes.length; i++) { + + log = 'Type: ' + attributes[i].getType().getName() + + ', Name: ' + attributes[i].getName() + + (attributes[i].getLayoutLocation() != glsAttributeLocationTests.LocationEnum.UNDEF ? ', Layout location ' + attributes[i].getLayoutLocation() : ''); + + bufferedLogToConsole(log); + } + }; + + /** + * @param {string} vertexShaderSource + * @param {string} vertexShaderInfoLog + * @param {boolean} vertexCompileOk + * @param {string} fragmentShaderSource + * @param {string} fragmentShaderInfoLog + * @param {boolean} fragmentCompileOk + */ + glsAttributeLocationTests.logShaders = function(vertexShaderSource, vertexShaderInfoLog, vertexCompileOk, fragmentShaderSource, fragmentShaderInfoLog, fragmentCompileOk) { + + /**@type{string} */ var log; + log = '\nVertex Shader Info: ' + + vertexShaderSource + + '\nInfo Log: ' + + vertexShaderInfoLog + + '\nCompilation result: ' + (vertexCompileOk ? 'Ok' : 'Failed') + + + '\nFragment Shader Info: ' + + fragmentShaderSource + + '\nInfo Log: ' + + fragmentShaderInfoLog + + '\nCompilation result: ' + (fragmentCompileOk ? 'Ok' : 'Failed'); + + bufferedLogToConsole(log); + }; + + /** + * @param {WebGLProgram} program + * @param {Array} attributes + * @return {boolean} + */ + glsAttributeLocationTests.checkActiveAttribQuery = function(program, attributes) { + /** @type {number} */ var activeAttribCount = 0; + /** @type {Array} */ var activeAttributes = []; + /** @type {boolean} */ var isOk = true; + /** @type {string} */ var log; + + activeAttribCount = /** @type {number} */ (gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES)); + + /** @type {glsAttributeLocationTests.Attribute} */ var attrib; + /** @type {boolean} */ var isActive; + /** @type {WebGLActiveInfo} */ var activeInfo; + + for (var activeAttribNdx = 0; activeAttribNdx < activeAttribCount; activeAttribNdx++) { + + activeInfo = gl.getActiveAttrib(program, activeAttribNdx); + + log = 'glGetActiveAttrib(program' + + '\nindex= ' + activeAttribNdx + + '\nsize= ' + activeInfo.size + + '\ntype= ' + activeInfo.type + + '\nname= ' + activeInfo.name; + + bufferedLogToConsole(log); + + /** @type {boolean} */ var found = false; + + for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) { + attrib = attributes[attribNdx]; + + if (attrib.getName() == activeInfo.name) { + if (activeInfo.type != attrib.getType().getGLTypeEnum()) { + + log = 'Error: Wrong type ' + attrib.getType().getGLTypeEnum() + + ' expected= ' + activeInfo.type; + bufferedLogToConsole(log); + + isOk = false; + } + + if (attrib.getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT) { + if (activeInfo.size != 1) { + + bufferedLogToConsole('Error: Wrong size ' + activeInfo.size + ' expected 1'); + isOk = false; + } + } else { + if (activeInfo.size != attrib.getArraySize()) { + bufferedLogToConsole('Error: Wrong size ' + activeInfo.size + ' expected ' + attrib.getArraySize()); + + isOk = false; + } + } + + found = true; + break; + } + } + + if (!found) { + log = 'Error: Unknown attribute ' + activeInfo.name + ' returned= by glGetActiveAttrib().'; + bufferedLogToConsole(log); + + isOk = false; + } + + activeAttributes.push(activeInfo.name); + } + + for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) { + attrib = attributes[attribNdx]; + isActive = attrib.getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)); + + if (isActive) { + if (activeAttributes.indexOf(attrib.getName()) == -1) { + + bufferedLogToConsole('Error: Active attribute ' + attrib.getName() + 'wasn\'t returned by glGetActiveAttrib().'); + isOk = false; + } + } else { + if (activeAttributes[attrib.getName()] === undefined) + bufferedLogToConsole('Note: Inactive attribute ' + attrib.getName() + 'was returned by glGetActiveAttrib().'); + } + } + + return isOk; + }; + + /** + * @param {WebGLProgram} program + * @param {Array} attributes + * @param {Array} bindings + * @return {boolean} + */ + glsAttributeLocationTests.checkAttribLocationQuery = function(program, attributes, bindings) { + /** @type {boolean} */ var isOk = true; + /** @type {string} */ var log; + + for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) { + /** @type {glsAttributeLocationTests.Attribute} */ var attrib = attributes[attribNdx]; + /** @type {number} */ var expectedLocation = (attrib.getLayoutLocation() != glsAttributeLocationTests.LocationEnum.UNDEF ? attrib.getLayoutLocation() : glsAttributeLocationTests.getBoundLocation(bindings, attrib.getName())); + var location = /** @type {number} */ (gl.getAttribLocation(program, attrib.getName())); + + if (attrib.getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) && location != -1) + bufferedLogToConsole('Note: Inactive attribute with location.'); + + if (attrib.getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) && expectedLocation != glsAttributeLocationTests.LocationEnum.UNDEF && expectedLocation != location) + bufferedLogToConsole('Error: Invalid attribute location.'); + + isOk = (attrib.getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) || expectedLocation == glsAttributeLocationTests.LocationEnum.UNDEF || expectedLocation == location); + } + + return isOk; + }; + + /** + * @param {WebGLProgram} program + * @param {Array} attributes + * @param {Array} bindings + * @return {boolean} + */ + glsAttributeLocationTests.checkQuery = function(program, attributes, bindings) { + /** @type {boolean} */ var isOk = glsAttributeLocationTests.checkActiveAttribQuery(program, attributes); + + if (!glsAttributeLocationTests.checkAttribLocationQuery(program, attributes, bindings)) + isOk = false; + + return isOk; + }; + + /** + * @param {WebGLProgram} program + * @param {Array} attributes + * @param {boolean} attributeAliasing + * @return {Object} + */ + glsAttributeLocationTests.createAndAttachShaders = function(program, attributes, attributeAliasing) { + /** @type {string} */ var vertexShaderSource = glsAttributeLocationTests.createVertexShaderSource(attributes, attributeAliasing); + /** @type {string} */ var fragmentShaderSource = glsAttributeLocationTests.createFragmentShaderSource(attributeAliasing); + + /** @type {WebGLShader} */ var vertexShader = gl.createShader(gl.VERTEX_SHADER); + /** @type {WebGLShader} */ var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(vertexShader, vertexShaderSource); + gl.shaderSource(fragmentShader, fragmentShaderSource); + + gl.compileShader(vertexShader); + gl.compileShader(fragmentShader); + + gl.attachShader(program, vertexShader); + gl.attachShader(program, fragmentShader); + + var vertexShaderCompileOk = /** @type {boolean} */ (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)); + var fragmentShaderCompileOk = /** @type {boolean} */ (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)); + + // log shaders + glsAttributeLocationTests.logShaders(vertexShaderSource, gl.getShaderInfoLog(vertexShader), + vertexShaderCompileOk, + fragmentShaderSource, gl.getShaderInfoLog(fragmentShader), + fragmentShaderCompileOk); + + assertMsgOptions(vertexShaderCompileOk, 'vertex Shader compile failed', false, true); + assertMsgOptions(fragmentShaderCompileOk, 'fragment Shader compile failed', false, true); + + gl.deleteShader(vertexShader); + gl.deleteShader(fragmentShader); + + return {first: vertexShader, second: fragmentShader}; + + }; + + /** + * @param {WebGLProgram} program + * @param {Array} binds + */ + glsAttributeLocationTests.bindAttributes = function(program, binds) { + for (var i = 0; i < binds.length; i++) { + bufferedLogToConsole('Bind attribute: ' + binds[i].getAttributeName() + ' to ' + binds[i].getLocation()); + gl.bindAttribLocation(program, binds[i].getLocation(), binds[i].getAttributeName()); + } + }; + + /** + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + * @return {string} + */ + glsAttributeLocationTests.generateTestName = function(type, arraySize) { + return type.getName() + (arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? '_array_' + arraySize : ''); + }; + + /** + * @constructor + * @param {string} name + * @param {number} locationSize + * @param {number} typeEnum + */ + glsAttributeLocationTests.AttribType = function(name, locationSize, typeEnum) { + /** @type {string} */ this.m_name = name; + /** @type {number} */ this.m_locationSize = locationSize; + /** @type {number} */ this.m_glTypeEnum = typeEnum; + }; + + /** + * @return {string} + */ + glsAttributeLocationTests.AttribType.prototype.getName = function() { + return this.m_name; + }; + + /** + * @return {number} + */ + glsAttributeLocationTests.AttribType.prototype.getLocationSize = function() { + return this.m_locationSize; + }; + + /** + * @return {number} + */ + glsAttributeLocationTests.AttribType.prototype.getGLTypeEnum = function() { + return this.m_glTypeEnum; + }; + + /** + * @enum {number} + */ + glsAttributeLocationTests.ConstCond = { + ALWAYS: 0, + NEVER: 1 + }; + + /** + * @constructor + * @param {string} name + * @param {boolean=} negate + */ + glsAttributeLocationTests.Cond = function(name, negate) { + /** @type {boolean} */ this.m_negate = negate === undefined ? false : negate; + /** @type {string} */ this.m_name = name; + }; + + /** + * @param {glsAttributeLocationTests.ConstCond} cond + * @return {glsAttributeLocationTests.Cond} + */ + glsAttributeLocationTests.NewCondWithEnum = function(cond) { + var condObj = new glsAttributeLocationTests.Cond('', false); + condObj.m_name = '__always__'; + condObj.m_negate = (cond != glsAttributeLocationTests.ConstCond.NEVER); + + return condObj; + }; + + /** + * @param {glsAttributeLocationTests.Cond} other + * @return {boolean} + */ + glsAttributeLocationTests.Cond.prototype.equals = function(other) { + return (this.m_negate == other.m_negate && this.m_name == other.m_name); + }; + + /** + * @param {glsAttributeLocationTests.Cond} other + * @return {boolean} + */ + glsAttributeLocationTests.Cond.prototype.notEquals = function(other) { + return (!this.equals(other)); + }; + + /** + * @return {string} + */ + glsAttributeLocationTests.Cond.prototype.getName = function() { + return this.m_name; + }; + + /** + * @return {boolean} + */ + glsAttributeLocationTests.Cond.prototype.getNegate = function() { + return this.m_negate; + }; + + /** + * @enum {number} + */ + glsAttributeLocationTests.LocationEnum = { + UNDEF: -1 + }; + + /** + * @enum {number} + */ + glsAttributeLocationTests.ArrayEnum = { + NOT: -1 + }; + + /** + * @constructor + * @param {glsAttributeLocationTests.AttribType} type + * @param {string} name + * @param {number=} layoutLocation + * @param {glsAttributeLocationTests.Cond=} cond + * @param {number=} arraySize + */ + glsAttributeLocationTests.Attribute = function(type, name, layoutLocation, cond, arraySize) { + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + /** @type {string} */ this.m_name = name; + /** @type {number} */ this.m_layoutLocation = layoutLocation === undefined ? glsAttributeLocationTests.LocationEnum.UNDEF : layoutLocation; + /** @type {glsAttributeLocationTests.Cond} */ this.m_cond = cond === undefined ? + glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS) : cond; + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + }; + + /** + * @return {glsAttributeLocationTests.AttribType} + */ + glsAttributeLocationTests.Attribute.prototype.getType = function() { + return this.m_type; + }; + + /** + * @return {string} + */ + glsAttributeLocationTests.Attribute.prototype.getName = function() { + return this.m_name; + }; + + /** + * @return {number} + */ + glsAttributeLocationTests.Attribute.prototype.getLayoutLocation = function() { + return this.m_layoutLocation; + }; + + /** + * @return {glsAttributeLocationTests.Cond} + */ + glsAttributeLocationTests.Attribute.prototype.getCondition = function() { + return this.m_cond; + }; + + /** + * @return {number} + */ + glsAttributeLocationTests.Attribute.prototype.getArraySize = function() { + return this.m_arraySize; + }; + + /** + * @constructor + * @param {string} attribute + * @param {number} location + */ + glsAttributeLocationTests.Bind = function(attribute, location) { + /** @type {string} */ this.m_attribute = attribute; + /** @type {number} */ this.m_location = location; + }; + + /** + * @return {string} + */ + glsAttributeLocationTests.Bind.prototype.getAttributeName = function() { + return this.m_attribute; + }; + + /** + * @return {number} + */ + glsAttributeLocationTests.Bind.prototype.getLocation = function() { + return this.m_location; + }; + + /** + * @param {Array} attributes + * @param {Array} preAttachBind + * @param {Array} preLinkBind + * @param {Array} postLinkBind + * @param {boolean} relink + * @param {boolean=} reattach + * @param {Array=} reattachAttributes + */ + glsAttributeLocationTests.runTest = function(attributes, preAttachBind, preLinkBind, postLinkBind, relink, reattach, reattachAttributes) { + reattach = reattach === undefined ? false : reattach; + reattachAttributes = reattachAttributes === undefined ? [] : reattachAttributes; + + try { + /** @type {boolean} */ var isOk = true; + /** @type {Array} */ var activeBindings = []; + + for (var bindNdx = 0; bindNdx < preAttachBind.length; bindNdx++) + activeBindings[preAttachBind[bindNdx].getAttributeName()] = preAttachBind[bindNdx].getLocation(); + + for (var bindNdx = 0; bindNdx < preLinkBind.length; bindNdx++) + activeBindings[preLinkBind[bindNdx].getAttributeName()] = preLinkBind[bindNdx].getLocation(); + + glsAttributeLocationTests.logAttributes(attributes); + + /** @type {WebGLProgram} */ var program = gl.createProgram(); + + if (!preAttachBind.length == 0) + glsAttributeLocationTests.bindAttributes(program, preAttachBind); + + /** @type {*} */ var shaders = glsAttributeLocationTests.createAndAttachShaders(program, attributes, glsAttributeLocationTests.hasAttributeAliasing(attributes, activeBindings)); + + if (!preLinkBind.length == 0) + glsAttributeLocationTests.bindAttributes(program, preLinkBind); + + gl.linkProgram(program); + + assertMsgOptions(gl.getProgramParameter(program, gl.LINK_STATUS) == true, 'link program failed', false, true); + + glsAttributeLocationTests.logProgram(program); + + if (!glsAttributeLocationTests.checkQuery(program, attributes, activeBindings)) + isOk = false; + + if (!postLinkBind.length == 0) { + glsAttributeLocationTests.bindAttributes(program, postLinkBind); + + if (!glsAttributeLocationTests.checkQuery(program, attributes, activeBindings)) + isOk = false; + } + + if (relink) { + gl.linkProgram(program); + + assertMsgOptions(gl.getProgramParameter(program, gl.LINK_STATUS) == true, 'link program failed', false, true); + + glsAttributeLocationTests.logProgram(program); + + for (var bindNdx = 0; bindNdx < postLinkBind.length; bindNdx++) + activeBindings[postLinkBind[bindNdx].getAttributeName()] = postLinkBind[bindNdx].getLocation(); + + if (!glsAttributeLocationTests.checkQuery(program, attributes, activeBindings)) + isOk = false; + } + + if (reattach) { + gl.detachShader(program, shaders.first); + gl.detachShader(program, shaders.second); + + glsAttributeLocationTests.createAndAttachShaders(program, reattachAttributes, glsAttributeLocationTests.hasAttributeAliasing(reattachAttributes, activeBindings)); + + gl.linkProgram(program); + + assertMsgOptions(gl.getProgramParameter(program, gl.LINK_STATUS) == true, 'link program failed', false, true); + + glsAttributeLocationTests.logProgram(program); + + if (!glsAttributeLocationTests.checkQuery(program, reattachAttributes, activeBindings)) + isOk = false; + } + + gl.deleteProgram(program); + + assertMsgOptions(isOk, '', true, true); + + } catch (e) { + if (program) + gl.deleteProgram(program); + + throw e; + } + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.BindAttributeTest = function(type, arraySize) { + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.BindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.BindAttributeTest.prototype.constructor = glsAttributeLocationTests.BindAttributeTest; + + glsAttributeLocationTests.BindAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_0', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.BindMaxAttributesTest = function(type, arraySize) { + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.BindMaxAttributesTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.BindMaxAttributesTest.prototype.constructor = glsAttributeLocationTests.BindMaxAttributesTest; + + glsAttributeLocationTests.BindMaxAttributesTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + /** @type {number} */ var ndx = 0; + + bufferedLogToConsole('MAX_VERTEX_ATTRIBS: ' + maxAttributes); + + for (var loc = maxAttributes - (arrayElementCount * this.m_type.getLocationSize()); loc >= 0; loc -= (arrayElementCount * this.m_type.getLocationSize())) { + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc)); + ndx++; + } + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.BindHoleAttributeTest = function(type, arraySize) { + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.BindHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.BindHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.BindHoleAttributeTest; + + glsAttributeLocationTests.BindHoleAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0')); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 0)); + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + + /** @type {number} */ var ndx = 2; + for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) { + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx)); + bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc)); + + ndx++; + } + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.PreAttachBindAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'pre_attach', 'pre_attach'); + }; + + glsAttributeLocationTests.PreAttachBindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.PreAttachBindAttributeTest.prototype.constructor = glsAttributeLocationTests.PreAttachBindAttributeTest; + + glsAttributeLocationTests.PreAttachBindAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + /** @type {number} */ var ndx = 0; + + attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0')); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + + glsAttributeLocationTests.runTest(attributes, bindings, noBindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.PreLinkBindAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'pre_link', 'pre_link'); + }; + + glsAttributeLocationTests.PreLinkBindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.PreLinkBindAttributeTest.prototype.constructor = glsAttributeLocationTests.PreLinkBindAttributeTest; + + glsAttributeLocationTests.PreLinkBindAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + /** @type {number} */ var ndx = 0; + + attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0')); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + + glsAttributeLocationTests.runTest(attributes, bindings, noBindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.PostLinkBindAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'post_link', 'post_link'); + }; + + glsAttributeLocationTests.PostLinkBindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.PostLinkBindAttributeTest.prototype.constructor = glsAttributeLocationTests.PostLinkBindAttributeTest; + + glsAttributeLocationTests.PostLinkBindAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0')); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + + glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, bindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.BindReattachAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'reattach', 'reattach'); + }; + + glsAttributeLocationTests.BindReattachAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.BindReattachAttributeTest.prototype.constructor = glsAttributeLocationTests.BindReattachAttributeTest; + + glsAttributeLocationTests.BindReattachAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + /** @type {glsAttributeLocationTests.AttribType} */ var vec2 = new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2); + + /** @type {Array} */ var bindings = []; + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var reattachAttributes = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0')); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 1)); + bindings.push(new glsAttributeLocationTests.Bind('a_1', 1)); + + reattachAttributes.push(new glsAttributeLocationTests.Attribute(vec2, 'a_1')); + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false, true, reattachAttributes); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.LocationAttributeTest = function(type, arraySize) { + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.LocationAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.LocationAttributeTest.prototype.constructor = glsAttributeLocationTests.LocationAttributeTest; + + glsAttributeLocationTests.LocationAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {Array} */ var attributes = []; + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_0', 3, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + + glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.LocationMaxAttributesTest = function(type, arraySize) { + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.LocationMaxAttributesTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.LocationMaxAttributesTest.prototype.constructor = glsAttributeLocationTests.LocationMaxAttributesTest; + + glsAttributeLocationTests.LocationMaxAttributesTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var attributes = []; + /** @type {number} */ var ndx = 0; + + bufferedLogToConsole('MAX_VERTEX_ATTRIBS: ' + maxAttributes); + + for (var loc = maxAttributes - (arrayElementCount * this.m_type.getLocationSize()); loc >= 0; loc -= (arrayElementCount * this.m_type.getLocationSize())) { + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, loc, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + ndx++; + } + + glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.LocationHoleAttributeTest = function(type, arraySize) { + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.LocationHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.LocationHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.LocationHoleAttributeTest; + + glsAttributeLocationTests.LocationHoleAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var attributes = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0', 0)); + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + + /** @type {number} */ var ndx = 2; + for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) { + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc)); + ndx++; + } + + glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, noBindings, false); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.MixedAttributeTest = function(type, arraySize) { + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.MixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.MixedAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedAttributeTest; + + glsAttributeLocationTests.MixedAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + + /** @type {Array} */ var bindings = []; + /** @type {Array} */ var attributes = []; + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_0', 3, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 4)); + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.MixedMaxAttributesTest = function(type, arraySize) { + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.MixedMaxAttributesTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.MixedMaxAttributesTest.prototype.constructor = glsAttributeLocationTests.MixedMaxAttributesTest; + + glsAttributeLocationTests.MixedMaxAttributesTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var bindings = []; + /** @type {Array} */ var attributes = []; + /** @type {number} */ var ndx = 0; + + bufferedLogToConsole('MAX_VERTEX_ATTRIBS: ' + maxAttributes); + + for (var loc = maxAttributes - (arrayElementCount * this.m_type.getLocationSize()); loc >= 0; loc -= (arrayElementCount * this.m_type.getLocationSize())) { + if ((ndx % 2) != 0) + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, loc, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + else { + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc)); + } + ndx++; + } + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.MixedHoleAttributeTest = function(type, arraySize) { + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.MixedHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.MixedHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedHoleAttributeTest; + + glsAttributeLocationTests.MixedHoleAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var bindings = []; + /** @type {Array} */ var attributes = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0')); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 0)); + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + + /** @type {number} */ var ndx = 2; + for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) { + if ((ndx % 2) != 0) + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc)); + else { + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc)); + bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc)); + } + ndx++; + } + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.BindRelinkAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'relink', 'relink'); + }; + + glsAttributeLocationTests.BindRelinkAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.BindRelinkAttributeTest.prototype.constructor = glsAttributeLocationTests.BindRelinkAttributeTest; + + glsAttributeLocationTests.BindRelinkAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var preLinkBindings = []; + /** @type {Array} */ var postLinkBindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0')); + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_1')); + + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 5)); + + postLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 6)); + + glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.BindRelinkHoleAttributeTest = function(type, arraySize) { + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.BindRelinkHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.BindRelinkHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.BindRelinkHoleAttributeTest; + + glsAttributeLocationTests.BindRelinkHoleAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var preLinkBindings = []; + /** @type {Array} */ var postLinkBindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0')); + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 0)); + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + + /** @type {number} */ var ndx = 2; + for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) { + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx)); + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc)); + + ndx++; + } + + postLinkBindings.push(new glsAttributeLocationTests.Bind('a_2', 1)); + + glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsAttributeLocationTests.AttribType} type + * @param {number=} arraySize + */ + glsAttributeLocationTests.MixedRelinkHoleAttributeTest = function(type, arraySize) { + /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type; + /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize; + tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize)); + }; + + glsAttributeLocationTests.MixedRelinkHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.MixedRelinkHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedRelinkHoleAttributeTest; + + glsAttributeLocationTests.MixedRelinkHoleAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations(); + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1); + + /** @type {Array} */ var preLinkBindings = []; + /** @type {Array} */ var postLinkBindings = []; + /** @type {Array} */ var attributes = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0')); + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 0)); + + attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize)); + + /** @type {number} */ var ndx = 2; + for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) { + if ((ndx % 2) != 0) + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc)); + else { + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx)); + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc)); + + } + ndx++; + } + + postLinkBindings.push(new glsAttributeLocationTests.Bind('a_2', 1)); + + glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.PreAttachMixedAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'pre_attach', 'pre_attach'); + }; + + glsAttributeLocationTests.PreAttachMixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.PreAttachMixedAttributeTest.prototype.constructor = glsAttributeLocationTests.PreAttachMixedAttributeTest; + + glsAttributeLocationTests.PreAttachMixedAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0', 1)); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + + glsAttributeLocationTests.runTest(attributes, bindings, noBindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.PreLinkMixedAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'pre_link', 'pre_link'); + }; + + glsAttributeLocationTests.PreLinkMixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.PreLinkMixedAttributeTest.prototype.constructor = glsAttributeLocationTests.PreLinkMixedAttributeTest; + + glsAttributeLocationTests.PreLinkMixedAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0', 1)); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.PostLinkMixedAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'post_link', 'post_link'); + }; + + glsAttributeLocationTests.PostLinkMixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.PostLinkMixedAttributeTest.prototype.constructor = glsAttributeLocationTests.PostLinkMixedAttributeTest; + + glsAttributeLocationTests.PostLinkMixedAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var bindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0', 1)); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + + glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, bindings, false); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.MixedReattachAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'reattach', 'reattach'); + }; + + glsAttributeLocationTests.MixedReattachAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.MixedReattachAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedReattachAttributeTest; + + glsAttributeLocationTests.MixedReattachAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + /** @type {glsAttributeLocationTests.AttribType} */ var vec2 = new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2); + + /** @type {Array} */ var bindings = []; + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var reattachAttributes = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0', 2)); + bindings.push(new glsAttributeLocationTests.Bind('a_0', 1)); + bindings.push(new glsAttributeLocationTests.Bind('a_1', 1)); + + reattachAttributes.push(new glsAttributeLocationTests.Attribute(vec2, 'a_1')); + + glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false, true, reattachAttributes); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ + glsAttributeLocationTests.MixedRelinkAttributeTest = function() { + tcuTestCase.DeqpTest.call(this, 'relink', 'relink'); + }; + + glsAttributeLocationTests.MixedRelinkAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsAttributeLocationTests.MixedRelinkAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedRelinkAttributeTest; + + glsAttributeLocationTests.MixedRelinkAttributeTest.prototype.iterate = function() { + /** @type {Array} */ var noBindings = []; + /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4); + + /** @type {Array} */ var attributes = []; + /** @type {Array} */ var preLinkBindings = []; + /** @type {Array} */ var postLinkBindings = []; + + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0', 1)); + attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_1')); + + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 3)); + preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 5)); + + postLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 6)); + + glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true); + return tcuTestCase.IterateResult.STOP; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js new file mode 100644 index 000000000..446782b4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js @@ -0,0 +1,1068 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsBufferTestUtil'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { + + var glsBufferTestUtil = modules.shared.glsBufferTestUtil; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuRGBA = framework.common.tcuRGBA; + var tcuSurface = framework.common.tcuSurface; + var tcuTestCase = framework.common.tcuTestCase; + var tcuTexture = framework.common.tcuTexture; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var deUtil = framework.delibs.debase.deUtil; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var deString = framework.delibs.debase.deString; + + glsBufferTestUtil.VERIFY_QUAD_SIZE = 8; //!< Quad size in VertexArrayVerifier + glsBufferTestUtil.MAX_LINES_PER_INDEX_ARRAY_DRAW = 128; //!< Maximum number of lines per one draw in IndexArrayVerifier + glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_WIDTH = 128; + glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_HEIGHT = 128; + + // Helper functions. + + /** + * @param {Uint8Array} ptr + * @param {number} numBytes + * @param {number} seed + */ + glsBufferTestUtil.fillWithRandomBytes = function(ptr, numBytes, seed) { + var rnd = new deRandom.Random(seed); + for (var left = numBytes; left > 0; left--) + ptr[left - 1] = rnd.getInt(); + }; + + /** + * @param {Uint8Array} resPtr + * @param {Uint8Array} refPtr + * @param {number} numBytes + * @return {boolean} + */ + glsBufferTestUtil.compareByteArrays = function(resPtr, refPtr, numBytes) { + var isOk = true; + var maxSpanLen = 8; + var maxDiffSpans = 4; + var numDiffSpans = 0; + var diffSpanStart = -1; + var ndx = 0; + + var log = 'Verification result: '; + + for (; ndx < numBytes; ndx++) { + if (resPtr[ndx] != refPtr[ndx]) { + if (diffSpanStart < 0) + diffSpanStart = ndx; + + isOk = false; + } else if (diffSpanStart >= 0) { + if (numDiffSpans < maxDiffSpans) { + var len = ndx - diffSpanStart; + var printLen = Math.min(len, maxSpanLen); + + log += len + ' byte difference at offset ' + diffSpanStart + '\n' + + ' expected ' + refPtr.subarray(diffSpanStart, diffSpanStart + printLen) + + ' got ' + resPtr.subarray(diffSpanStart, diffSpanStart + printLen); + } else + log += '(output too long, truncated)'; + + numDiffSpans += 1; + diffSpanStart = -1; + } + } + + if (diffSpanStart >= 0) { + if (numDiffSpans < maxDiffSpans) { + var len = ndx - diffSpanStart; + var printLen = Math.min(len, maxSpanLen); + + log += len + ' byte difference at offset ' + diffSpanStart + '\n' + + ' expected ' + refPtr.subarray(diffSpanStart, diffSpanStart + printLen) + + ' got ' + resPtr.subarray(diffSpanStart, diffSpanStart + printLen); + } else + log += '(output too long, truncated)'; + } + + log += (isOk ? 'Verification passed.' : 'Verification FAILED!'); + + bufferedLogToConsole(log); + + return isOk; + }; + + /** + * @param {number} target + * @return {string} + */ + glsBufferTestUtil.getBufferTargetName = function(target) { + switch (target) { + case gl.ARRAY_BUFFER: return 'array'; + case gl.COPY_READ_BUFFER: return 'copy_read'; + case gl.COPY_WRITE_BUFFER: return 'copy_write'; + case gl.ELEMENT_ARRAY_BUFFER: return 'element_array'; + case gl.PIXEL_PACK_BUFFER: return 'pixel_pack'; + case gl.PIXEL_UNPACK_BUFFER: return 'pixel_unpack'; + //case gl.TEXTURE_BUFFER: return "texture"; //TODO: Unimplemented in WebGL 2. Remove? + case gl.TRANSFORM_FEEDBACK_BUFFER: return 'transform_feedback'; + case gl.UNIFORM_BUFFER: return 'uniform'; + default: + throw new Error('Invalid buffer target'); + } + }; + + /** + * @param {number} hint + * @return {string} + */ + glsBufferTestUtil.getUsageHintName = function(hint) { + switch (hint) { + case gl.STREAM_DRAW: return 'stream_draw'; + case gl.STREAM_READ: return 'stream_read'; + case gl.STREAM_COPY: return 'stream_copy'; + case gl.STATIC_DRAW: return 'static_draw'; + case gl.STATIC_READ: return 'static_read'; + case gl.STATIC_COPY: return 'static_copy'; + case gl.DYNAMIC_DRAW: return 'dynamic_draw'; + case gl.DYNAMIC_READ: return 'dynamic_read'; + case gl.DYNAMIC_COPY: return 'dynamic_copy'; + default: + throw new Error('Invalid buffer usage hint'); + } + }; + + // Base class for buffer cases. + // BufferCase + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + glsBufferTestUtil.BufferCase = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {Array} */ this.m_allocatedBuffers = []; + }; + + glsBufferTestUtil.BufferCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsBufferTestUtil.BufferCase.prototype.constructor = glsBufferTestUtil.BufferCase; + + /** + * init + */ + glsBufferTestUtil.BufferCase.prototype.init = function() {}; + + /** + * deinit + */ + glsBufferTestUtil.BufferCase.prototype.deinit = function() { + for (var ndx = 0; ndx < this.m_allocatedBuffers.length; ndx++) + this.deleteBuffer(this.m_allocatedBuffers[ndx]); + }; + + /** + * @return {WebGLBuffer} + */ + glsBufferTestUtil.BufferCase.prototype.genBuffer = function() { + var buf = 0; + buf = gl.createBuffer(); + if (buf != 0) { + try { + deUtil.dePushUniqueToArray(this.m_allocatedBuffers, buf); + } + catch (err) { + gl.deleteBuffer(buf); + throw err; + } + } + return buf; + }; + + /** + * @param {WebGLBuffer} buffer + */ + glsBufferTestUtil.BufferCase.prototype.deleteBuffer = function(buffer) { + gl.deleteBuffer(buffer); + this.m_allocatedBuffers.splice(this.m_allocatedBuffers.indexOf(buffer), 1); + }; + + glsBufferTestUtil.BufferCase.prototype.checkError = function() { + /** @type {number} */ var err = gl.getError(); + if (err != gl.NO_ERROR) + throw new TestFailedException('Got ' + WebGLTestUtils.glEnumToString(gl, err)); + }; + + // Reference buffer. + + /** + * @constructor + */ + glsBufferTestUtil.ReferenceBuffer = function() { + /** @type {ArrayBuffer} */ this.m_data; + }; + + /** + * @param {number=} offset + * @return {Uint8Array} + */ + glsBufferTestUtil.ReferenceBuffer.prototype.getPtr = function(offset) { + offset = offset ? offset : 0; return new Uint8Array(this.m_data, offset); + }; + + /** + * @param {number} numBytes + */ + glsBufferTestUtil.ReferenceBuffer.prototype.setSize = function(numBytes) { + this.m_data = new ArrayBuffer(numBytes); + }; + + /** + * @param {number} numBytes + * @param {Uint8Array} bytes + */ + glsBufferTestUtil.ReferenceBuffer.prototype.setData = function(numBytes, bytes) { + this.setSize(numBytes); + var dst = new Uint8Array(this.m_data); + dst.set(bytes.subarray(numBytes)); + }; + + /** + * @param {number} offset + * @param {number} numBytes + * @param {Uint8Array} bytes + */ + glsBufferTestUtil.ReferenceBuffer.prototype.setSubData = function(offset, numBytes, bytes) { + assertMsgOptions(deMath.deInBounds32(offset, 0, this.m_data.byteLength) && deMath.deInRange32(offset + numBytes, offset, this.m_data.byteLength), + 'Parameters not in buffer bounds or range', false, true); + var dst = new Uint8Array(this.m_data, offset); + dst.set(bytes.subarray(offset, offset + numBytes)); + }; + + // Buffer writer system. + + /** + * @enum {number} + */ + glsBufferTestUtil.WriteType = { + BUFFER_SUB_DATA: 0, + BUFFER_WRITE_MAP: 1, + TRANSFORM_FEEDBACK: 2, + PIXEL_PACK: 3 + }; + + /** + * @param {glsBufferTestUtil.WriteType} write + * @return {string} + */ + glsBufferTestUtil.getWriteTypeDescription = function(write) { + /** @type {Array} */ var s_desc = [ + 'gl.bufferSubData()', + 'gl.mapBufferRange()', + 'transform feedback', + 'gl.readPixels() into PBO binding' + ]; + return /** @type {string} */ (deUtil.getArrayElement(s_desc, write)); + }; + + // BufferWriterBase + + /** + * @constructor + */ + glsBufferTestUtil.BufferWriterBase = function() {}; + + /** + * //Meant to be overriden + * @return {number} + */ + glsBufferTestUtil.BufferWriterBase.prototype.getMinSize = function() { throw new Error('Must be overriden'); }; + + /** + * //Meant to be overriden + * @return {number} + */ + glsBufferTestUtil.BufferWriterBase.prototype.getAlignment = function() { throw new Error('Must be overriden'); }; + + /** + * //Meant to be overriden + * @param {WebGLBuffer} buffer + * @param {number} offset + * @param {number} numBytes + * @param {Uint8Array} bytes + */ + glsBufferTestUtil.BufferWriterBase.prototype.writeNoTarget = function(buffer, offset, numBytes, bytes) { throw new Error('Must be overriden'); }; + + /** + * @param {WebGLBuffer} buffer + * @param {number} offset + * @param {number} numBytes + * @param {Uint8Array} bytes + * @param {number} targetHint + */ + glsBufferTestUtil.BufferWriterBase.prototype.write = function(buffer, offset, numBytes, bytes, targetHint) { + this.writeNoTarget(buffer, offset, numBytes, bytes); + }; + + // BufferWriter + + /** + * @constructor + * @param {glsBufferTestUtil.WriteType} writeType + */ + glsBufferTestUtil.BufferWriter = function(writeType) { + /** @type {glsBufferTestUtil.BufferWriterBase} */ this.m_writer = null; + switch (writeType) { + case glsBufferTestUtil.WriteType.BUFFER_SUB_DATA: this.m_writer = new glsBufferTestUtil.BufferSubDataWriter(); break; + default: + testFailed('Unsupported writer'); + } + }; + + /** + * @return {number} + */ + glsBufferTestUtil.BufferWriter.prototype.getMinSize = function() {return this.m_writer.getMinSize();}; + + /** + * @return {number} + */ + glsBufferTestUtil.BufferWriter.prototype.getAlignment = function() {return this.m_writer.getAlignment();}; + + /** + * @param {WebGLBuffer} buffer + * @param {number} offset + * @param {number} numBytes + * @param {Uint8Array} bytes + */ + glsBufferTestUtil.BufferWriter.prototype.writeNoTarget = function(buffer, offset, numBytes, bytes) { + assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true); + assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true); + assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true); + return this.m_writer.writeNoTarget(buffer, offset, numBytes, bytes); + }; + + /** + * @param {WebGLBuffer} buffer + * @param {number} offset + * @param {number} numBytes + * @param {Uint8Array} bytes + * @param {number} targetHint + */ + glsBufferTestUtil.BufferWriter.prototype.write = function(buffer, offset, numBytes, bytes, targetHint) { + assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true); + assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true); + assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true); + return this.m_writer.write(buffer, offset, numBytes, bytes, targetHint); + }; + + // BufferSubDataWriter + + /** + * @constructor + * @extends {glsBufferTestUtil.BufferWriterBase} + */ + glsBufferTestUtil.BufferSubDataWriter = function() { + glsBufferTestUtil.BufferWriterBase.call(this); + }; + + glsBufferTestUtil.BufferSubDataWriter.prototype = Object.create(glsBufferTestUtil.BufferWriterBase.prototype); + glsBufferTestUtil.BufferSubDataWriter.prototype.constructor = glsBufferTestUtil.BufferSubDataWriter; + + /** + * @return {number} + */ + glsBufferTestUtil.BufferSubDataWriter.prototype.getMinSize = function() { return 1; }; + + /** + * @return {number} + */ + glsBufferTestUtil.BufferSubDataWriter.prototype.getAlignment = function() { return 1; }; + + /** + * @param {WebGLBuffer} buffer + * @param {number} offset + * @param {number} numBytes + * @param {Uint8Array} bytes + */ + glsBufferTestUtil.BufferSubDataWriter.prototype.writeNoTarget = function(buffer, offset, numBytes, bytes) { + this.write(buffer, offset, numBytes, bytes, gl.ARRAY_BUFFER); + }; + + /** + * @param {WebGLBuffer} buffer + * @param {number} offset + * @param {number} numBytes + * @param {Uint8Array} bytes + * @param {number} target + */ + glsBufferTestUtil.BufferSubDataWriter.prototype.write = function(buffer, offset, numBytes, bytes, target) { + gl.bindBuffer(target, buffer); + gl.bufferSubData(target, offset, bytes); + gl.bindBuffer(target, null); + }; + + // Buffer verifier system. + + /** + * @enum {number} + */ + glsBufferTestUtil.VerifyType = { + AS_VERTEX_ARRAY: 0, + AS_INDEX_ARRAY: 1, + AS_UNIFORM_BUFFER: 2, + AS_PIXEL_UNPACK_BUFFER: 3, + BUFFER_READ_MAP: 4 + }; + + /** + * @param {glsBufferTestUtil.VerifyType} verify + * @return {string} + */ + glsBufferTestUtil.getVerifyTypeDescription = function(verify) { + /** @type {Array} */ var s_desc = + [ + 'rendering as vertex data', + 'rendering as index data', + 'reading in shader as uniform buffer data', + 'using as PBO and uploading to texture', + 'reading back using glMapBufferRange()' + ]; + + return /** @type {string} */ (deUtil.getArrayElement(s_desc, verify)); + }; + + /** + * @constructor + */ + glsBufferTestUtil.BufferVerifierBase = function() {}; + + /** + * //Meant to be overriden + * @return {number} + */ + glsBufferTestUtil.BufferVerifierBase.prototype.getMinSize = function() { throw new Error('Must be overriden'); }; + + /** + * //Meant to be overriden + * @return {number} + */ + glsBufferTestUtil.BufferVerifierBase.prototype.getAlignment = function() { throw new Error('Must be overriden'); }; + + /** + * @param {WebGLBuffer} buffer + * @param {Uint8Array} reference + * @param {number} offset + * @param {number} numBytes + * @return {boolean} + */ + glsBufferTestUtil.BufferVerifierBase.prototype.verifyNoTarget = function(buffer, reference, offset, numBytes) { + throw new Error('Must be overriden'); + }; + + /** + * //Meant to be overriden + * @param {WebGLBuffer} buffer + * @param {Uint8Array} reference + * @param {number} offset + * @param {number} numBytes + * @param {number} targetHint + * @return {boolean} + */ + glsBufferTestUtil.BufferVerifierBase.prototype.verify = function(buffer, reference, offset, numBytes, targetHint) { + //In WebGL 2, ELEMENT_ARRAY_BUFFER and TRANSFORM_FEEDBACK_BUFFER cannot be rebound to a different + //type of buffer, so, let's copy their data to an ARRAY BUFFER and pass that one instead to be verified. + var wasReadBufferCreated = false; + try { + if (targetHint == gl.ELEMENT_ARRAY_BUFFER || targetHint == gl.TRANSFORM_FEEDBACK_BUFFER) { + var readBuffer = new Uint8Array(offset + numBytes); + gl.getBufferSubData(targetHint, 0, readBuffer); + buffer = gl.createBuffer(); + + wasReadBufferCreated = true; + + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl.bufferData(gl.ARRAY_BUFFER, readBuffer, gl.STATIC_DRAW); + } + + var result = this.verifyNoTarget(buffer, reference, offset, numBytes); + + if (wasReadBufferCreated) + gl.deleteBuffer(buffer); + + return result; + } catch (err) { + if (wasReadBufferCreated) + gl.deleteBuffer(buffer); + throw err; + } + }; + + // BufferVerifier + + /** + * @constructor + * @param {glsBufferTestUtil.VerifyType} verifyType + */ + glsBufferTestUtil.BufferVerifier = function(verifyType) { + /** @type {glsBufferTestUtil.BufferVerifierBase} */ this.m_verifier = null; + switch (verifyType) { + case glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY: this.m_verifier = new glsBufferTestUtil.VertexArrayVerifier(); break; + case glsBufferTestUtil.VerifyType.AS_INDEX_ARRAY: this.m_verifier = new glsBufferTestUtil.IndexArrayVerifier(); break; + default: + testFailed('Unsupported verifier type'); + } + }; + + /** + * @return {number} + */ + glsBufferTestUtil.BufferVerifier.prototype.getMinSize = function() { return this.m_verifier.getMinSize(); }; + + /** + * @return {number} + */ + glsBufferTestUtil.BufferVerifier.prototype.getAlignment = function() { return this.m_verifier.getAlignment(); }; + + /** + * @param {WebGLBuffer} buffer + * @param {Uint8Array} reference + * @param {number} numBytes + * @return {boolean} + */ + glsBufferTestUtil.BufferVerifier.prototype.verifyNoTarget = function(buffer, reference, offset, numBytes) { + assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true); + assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true); + assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true); + return this.m_verifier.verifyNoTarget(buffer, reference, offset, numBytes); + }; + + /** + * @param {WebGLBuffer} buffer + * @param {Uint8Array} reference + * @param {number} offset + * @param {number} numBytes + * @param {number} targetHint + * @return {boolean} + */ + glsBufferTestUtil.BufferVerifier.prototype.verify = function(buffer, reference, offset, numBytes, targetHint) { + assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true); + assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true); + assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true); + return this.m_verifier.verify(buffer, reference, offset, numBytes, targetHint); + }; + + // VertexArrayVerifier + + /** + * @constructor + * @extends {glsBufferTestUtil.BufferVerifierBase} + */ + glsBufferTestUtil.VertexArrayVerifier = function() { + glsBufferTestUtil.BufferVerifierBase.call(this); + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + this.m_posLoc = 0; + this.m_byteVecLoc = 0; + /** @type {WebGLVertexArrayObject} */ this.m_vao = null; + + /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.getGLSLVersion(gl); + + assertMsgOptions(gluShaderUtil.isGLSLVersionSupported(gl, glslVersion), 'Unsupported GLSL version', false, true); + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources( + gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' + + 'in highp vec2 a_position;\n' + + 'in mediump vec3 a_byteVec;\n' + + 'out mediump vec3 v_byteVec;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(a_position, 0.0, 1.0);\n' + + ' v_byteVec = a_byteVec;\n' + + '}\n', + + gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' + + 'in mediump vec3 v_byteVec;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = vec4(v_byteVec, 1.0);\n' + + '}\n' + )); + + if (!this.m_program.isOk()) { + testFailed('Compile failed'); + } + + this.m_posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + this.m_byteVecLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_byteVec'); + + this.m_vao = gl.createVertexArray(); + this.m_positionBuf = gl.createBuffer(); + this.m_indexBuf = gl.createBuffer(); + }; + + glsBufferTestUtil.VertexArrayVerifier.prototype = Object.create(glsBufferTestUtil.BufferVerifierBase.prototype); + glsBufferTestUtil.VertexArrayVerifier.prototype.constructor = glsBufferTestUtil.VertexArrayVerifier; + + /** + * @return {number} + */ + glsBufferTestUtil.VertexArrayVerifier.prototype.getMinSize = function() { return 3 * 4; }; + + /** + * @return {number} + */ + glsBufferTestUtil.VertexArrayVerifier.prototype.getAlignment = function() { return 1; }; + + /** + * deinit + */ + glsBufferTestUtil.VertexArrayVerifier.prototype.deinit = function() { + if (this.m_vao) gl.deleteVertexArray(this.m_vao); + if (this.m_positionBuf) gl.deleteBuffer(this.m_positionBuf); + if (this.m_indexBuf) gl.deleteBuffer(this.m_indexBuf); + }; + + /** + * @param {number} gridSizeX + * @param {number} gridSizeY + * @return {Array} + */ + glsBufferTestUtil.computePositions = function(gridSizeX, gridSizeY) { + var positions = []; + + for (var y = 0; y < gridSizeY; y++) + for (var x = 0; x < gridSizeX; x++) { + /** @type {number} */ var sx0 = (x + 0) / gridSizeX; + /** @type {number} */ var sy0 = (y + 0) / gridSizeY; + /** @type {number} */ var sx1 = (x + 1) / gridSizeX; + /** @type {number} */ var sy1 = (y + 1) / gridSizeY; + /** @type {number} */ var fx0 = 2.0 * sx0 - 1.0; + /** @type {number} */ var fy0 = 2.0 * sy0 - 1.0; + /** @type {number} */ var fx1 = 2.0 * sx1 - 1.0; + /** @type {number} */ var fy1 = 2.0 * sy1 - 1.0; + /** @type {number} */ var baseNdx = (y * gridSizeX + x) * 8; + + positions[baseNdx + 0] = fx0; positions[baseNdx + 1] = fy0; + positions[baseNdx + 2] = fx0; positions[baseNdx + 3] = fy1; + positions[baseNdx + 4] = fx1; positions[baseNdx + 5] = fy0; + positions[baseNdx + 6] = fx1; positions[baseNdx + 7] = fy1; + } + + return positions; + }; + + /** + * @param {number} gridSizeX + * @param {number} gridSizeY + * @return {Uint16Array} + */ + glsBufferTestUtil.computeIndices = function(gridSizeX, gridSizeY) { + var indices = new Uint16Array(3 * 2 * gridSizeX * gridSizeY); + + for (var quadNdx = 0; quadNdx < gridSizeX * gridSizeY; quadNdx++) { + /** @type {number} */ var v00 = quadNdx * 4 + 0; + /** @type {number} */ var v01 = quadNdx * 4 + 1; + /** @type {number} */ var v10 = quadNdx * 4 + 2; + /** @type {number} */ var v11 = quadNdx * 4 + 3; + + assertMsgOptions(v11 < (1 << 16), 'Vertex index value won\'t fit into a 16-bit number', false, true); + + indices[quadNdx * 6 + 0] = v10; + indices[quadNdx * 6 + 1] = v00; + indices[quadNdx * 6 + 2] = v01; + + indices[quadNdx * 6 + 3] = v10; + indices[quadNdx * 6 + 4] = v01; + indices[quadNdx * 6 + 5] = v11; + } + + return indices; + }; + + /** + * @param {Uint8Array} ptr + * @param {number} vtxNdx + * @return {Array} + */ + glsBufferTestUtil.fetchVtxColor = function(ptr, vtxNdx) { + return new tcuRGBA.RGBA([ + ptr[vtxNdx * 3 + 0], + ptr[vtxNdx * 3 + 1], + ptr[vtxNdx * 3 + 2], + 255]).toVec(); + }; + + /** + * @param {tcuSurface.Surface} dst + * @param {number} numQuads + * @param {number} rowLength + * @param {Uint8Array} inPtr + */ + glsBufferTestUtil.renderQuadGridReference = function(dst, numQuads, rowLength, inPtr) { + dst.setSize(rowLength * glsBufferTestUtil.VERIFY_QUAD_SIZE, (Math.floor(numQuads / rowLength) + (numQuads % rowLength != 0 ? 1 : 0)) * glsBufferTestUtil.VERIFY_QUAD_SIZE); + + /** @type {tcuTexture.PixelBufferAccess} */ var dstAccess = dst.getAccess(); + dstAccess.clear([0, 0, 0, 1.0]); + + for (var quadNdx = 0; quadNdx < numQuads; quadNdx++) { + /** @type {number} */ var x0 = (quadNdx % rowLength) * glsBufferTestUtil.VERIFY_QUAD_SIZE; + /** @type {number} */ var y0 = Math.floor(quadNdx / rowLength) * glsBufferTestUtil.VERIFY_QUAD_SIZE; + /** @type {Array} */ var v00 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 0); + /** @type {Array} */ var v10 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 1); + /** @type {Array} */ var v01 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 2); + /** @type {Array} */ var v11 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 3); + + for (var y = 0; y < glsBufferTestUtil.VERIFY_QUAD_SIZE; y++) + for (var x = 0; x < glsBufferTestUtil.VERIFY_QUAD_SIZE; x++) { + /** @type {number} */ var fx = (x + 0.5) / glsBufferTestUtil.VERIFY_QUAD_SIZE; + /** @type {number} */ var fy = (y + 0.5) / glsBufferTestUtil.VERIFY_QUAD_SIZE; + + /** @type {boolean} */ var tri = fx + fy <= 1.0; + /** @type {number} */ var tx = tri ? fx : (1.0 - fx); + /** @type {number} */ var ty = tri ? fy : (1.0 - fy); + /** @type {Array} */ var t0 = tri ? v00 : v11; + /** @type {Array} */ var t1 = tri ? v01 : v10; + /** @type {Array} */ var t2 = tri ? v10 : v01; + /** @type {Array} */ var color = deMath.add( + deMath.add(t0, deMath.scale(deMath.subtract(t1, t0), tx)), + deMath.scale(deMath.subtract(t2, t0), ty) + ); + + dstAccess.setPixel(color, x0 + x, y0 + y); + } + } + }; + + /** + * @param {WebGLBuffer} buffer + * @param {Uint8Array} refPtr + * @param {number} offset + * @param {number} numBytes + * @return {boolean} + */ + glsBufferTestUtil.VertexArrayVerifier.prototype.verifyNoTarget = function(buffer, refPtr, offset, numBytes) { + var numBytesInVtx = 3; + var numBytesInQuad = numBytesInVtx * 4; + var maxQuadsX = Math.min(128, Math.floor(gl.drawingBufferWidth / glsBufferTestUtil.VERIFY_QUAD_SIZE)); + var maxQuadsY = Math.min(128, Math.floor(gl.drawingBufferHeight / glsBufferTestUtil.VERIFY_QUAD_SIZE)); + var maxQuadsPerBatch = maxQuadsX * maxQuadsY; + var numVerified = 0; + var program = this.m_program.getProgram(); + /** @type {tcuRGBA.RGBA} */ var threshold = /*TODO: renderTarget.getPixelFormat().getColorThreshold() + tcu::RGBA(3,3,3,3);*/ new tcuRGBA.RGBA([3, 3, 3, 3]); + var isOk = true; + + /** @type {Array} */ var positions = []; + /** @type {Uint16Array} */var indices; + + /** @type {tcuSurface.Surface} */ var rendered = new tcuSurface.Surface(); + /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(); + + // Can't render full quad with smaller buffers. + assertMsgOptions(numBytes >= numBytesInQuad, 'Number of bytes must be bigger than number of bytes per quad', false, true); + + positions = glsBufferTestUtil.computePositions(maxQuadsX, maxQuadsY); + indices = glsBufferTestUtil.computeIndices(maxQuadsX, maxQuadsY); + + // Reset buffer bindings. + gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null); + + // Setup rendering state. + gl.viewport(0, 0, maxQuadsX * glsBufferTestUtil.VERIFY_QUAD_SIZE, maxQuadsY * glsBufferTestUtil.VERIFY_QUAD_SIZE); + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.useProgram(program); + gl.bindVertexArray(this.m_vao); + + // Upload positions + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); + gl.enableVertexAttribArray(this.m_posLoc); + gl.vertexAttribPointer(this.m_posLoc, 2, gl.FLOAT, false, 0, 0); + + // Upload indices + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.m_indexBuf); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW); + + gl.enableVertexAttribArray(this.m_byteVecLoc); + + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + + while (numVerified < numBytes) { + /** @type {number} */ var numRemaining = numBytes - numVerified; + var isLeftoverBatch = numRemaining < numBytesInQuad; + /** @type {number} */ var numBytesToVerify = isLeftoverBatch ? numBytesInQuad : Math.min(maxQuadsPerBatch * numBytesInQuad, numRemaining - numRemaining % numBytesInQuad); + /** @type {number} */ var curOffset = isLeftoverBatch ? (numBytes - numBytesInQuad) : numVerified; + /** @type {number} */ var numQuads = Math.floor(numBytesToVerify / numBytesInQuad); + /** @type {number} */ var numCols = Math.min(maxQuadsX, numQuads); + /** @type {number} */ var numRows = Math.floor(numQuads / maxQuadsX) + (numQuads % maxQuadsX != 0 ? 1 : 0); + /** @type {string} */ var imageSetDesc = 'Bytes ' + (offset + curOffset) + ' to ' + (offset + curOffset + numBytesToVerify - 1); + + assertMsgOptions(numBytesToVerify > 0 && numBytesToVerify % numBytesInQuad == 0, 'Bytes to verify must be greater than zero and must be a multiple of the bytes per quad', false, true); + assertMsgOptions(deMath.deInBounds32(curOffset, 0, numBytes), 'Offset out of bounds', false, true); + assertMsgOptions(deMath.deInRange32(curOffset + numBytesToVerify, curOffset, numBytes), 'Range of bytes to verify outside of bounds', false, true); + + // Render batch. + gl.clear(gl.COLOR_BUFFER_BIT); + gl.vertexAttribPointer(this.m_byteVecLoc, 3, gl.UNSIGNED_BYTE, true, 0, offset + curOffset); + gl.drawElements(gl.TRIANGLES, numQuads * 6, gl.UNSIGNED_SHORT, 0); + + glsBufferTestUtil.renderQuadGridReference(reference, numQuads, numCols, refPtr.subarray(offset + curOffset)); + + rendered.setSize(numCols * glsBufferTestUtil.VERIFY_QUAD_SIZE, numRows * glsBufferTestUtil.VERIFY_QUAD_SIZE); + rendered.readViewport(gl, [0, 0, numCols * glsBufferTestUtil.VERIFY_QUAD_SIZE, numRows * glsBufferTestUtil.VERIFY_QUAD_SIZE]); + + if (!tcuImageCompare.pixelThresholdCompare('RenderResult', imageSetDesc, reference, rendered, threshold.toIVec(), tcuImageCompare.CompareLogMode.RESULT)) { + isOk = false; + break; + } + + numVerified += isLeftoverBatch ? numRemaining : numBytesToVerify; + } + + gl.bindVertexArray(null); + + return isOk; + }; + + // IndexArrayVerifier + + /** + * @constructor + * @extends {glsBufferTestUtil.BufferVerifierBase} + */ + glsBufferTestUtil.IndexArrayVerifier = function() { + glsBufferTestUtil.BufferVerifierBase.call(this); + + this.m_program = null; + this.m_posLoc = 0; + this.m_colorLoc = 0; + + /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.GLSLVersion.V300_ES; + + assertMsgOptions(gluShaderUtil.isGLSLVersionSupported(gl, glslVersion), 'GLSL version not supported', false, true); + + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources( + gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' + + 'in highp vec2 a_position;\n' + + 'in mediump vec3 a_color;\n' + + 'out mediump vec3 v_color;\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(a_position, 0.0, 1.0);\n' + + ' v_color = a_color;\n' + + '}\n', + + gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' + + 'in mediump vec3 v_color;\n' + + 'layout(location = 0) out mediump vec4 o_color;\n' + + 'void main (void)\n' + + '{\n' + + ' o_color = vec4(v_color, 1.0);\n' + + '}\n')); + + if (!this.m_program.isOk()) { + testFailed('Compile failed'); + } + + this.m_posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position'); + this.m_colorLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_color'); + + this.m_vao = gl.createVertexArray(); + this.m_positionBuf = gl.createBuffer(); + this.m_colorBuf = gl.createBuffer(); + }; + + glsBufferTestUtil.IndexArrayVerifier.prototype = Object.create(glsBufferTestUtil.BufferVerifierBase.prototype); + glsBufferTestUtil.IndexArrayVerifier.prototype.constructor = glsBufferTestUtil.IndexArrayVerifier; + + /** + * deinit + */ + glsBufferTestUtil.IndexArrayVerifier.prototype.deinit = function() { + if (this.m_vao) gl.deleteVertexArray(this.m_vao); + if (this.m_positionBuf) gl.deleteBuffer(this.m_positionBuf); + if (this.m_colorBuf) gl.deleteBuffer(this.m_colorBuf); + }; + + /** + * @return {Array} + */ + glsBufferTestUtil.computeIndexVerifierPositions = function() { + var numPosX = 16; + var numPosY = 16; + + var dst = []; + + for (var y = 0; y < numPosY; y++) { + for (var x = 0; x < numPosX; x++) { + var xf = x / (numPosX - 1); + var yf = y / (numPosY - 1); + + var offset = 2 * (y * numPosX + x); + dst[offset] = 2.0 * xf - 1.0; + dst[offset + 1] = 2.0 * yf - 1.0; + } + } + + return dst; + }; + + /** + * @return {Array} + */ + glsBufferTestUtil.computeIndexVerifierColors = function() { + /** @type {number} */ var numColors = 256; + /** @type {number} */ var minVal = 0.1; + /** @type {number} */ var maxVal = 0.5; + var rnd = new deRandom.Random(0xabc231); + + var dst = []; + + for (var i = 0; i < numColors; ++i) { + dst[3 * i] = rnd.getFloat(minVal, maxVal); + dst[3 * i + 1] = rnd.getFloat(minVal, maxVal); + dst[3 * i + 2] = rnd.getFloat(minVal, maxVal); + } + + return dst; + }; + + /** + * @param {Array} dst + * @param {Array} src + * @param {Uint8Array} indices + * @param {number} numIndices + */ + glsBufferTestUtil.execVertexFetch = function(dst, src, indices, numIndices) { + for (var i = 0; i < numIndices; ++i) + dst[i] = src[indices[i]]; + }; + + /** + * @param {WebGLBuffer} buffer + * @param {Uint8Array} refPtr + * @param {number} offset + * @param {number} numBytes + * @return {boolean} + */ + glsBufferTestUtil.IndexArrayVerifier.prototype.verify = function(buffer, refPtr, offset, numBytes) { + var viewportW = Math.min(glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_WIDTH, gl.drawingBufferWidth); + var viewportH = Math.min(glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_HEIGHT, gl.drawingBufferHeight); + var minBytesPerBatch = 2; + /** @type {tcuRGBA.RGBA} */ var threshold = new tcuRGBA.RGBA([0, 0, 0, 0]); + + var positions = []; + var colors = []; + + var fetchedPos = []; + var fetchedColor = []; + + /** @type {tcuSurface.Surface} */ var indexBufferImg = new tcuSurface.Surface(viewportW, viewportH); + /** @type {tcuSurface.Surface} */ var referenceImg = new tcuSurface.Surface(viewportW, viewportH); + + var numVerified = 0; + var isOk = true; + + positions = glsBufferTestUtil.computeIndexVerifierPositions(); + colors = glsBufferTestUtil.computeIndexVerifierColors(); + + // Reset buffer bindings. + gl.bindVertexArray(this.m_vao); + gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer); + + // Setup rendering state. + gl.viewport(0, 0, viewportW, viewportH); + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.useProgram(this.m_program.getProgram()); + gl.enableVertexAttribArray(this.m_posLoc); + gl.enableVertexAttribArray(this.m_colorLoc); + gl.enable(gl.BLEND); + gl.blendFunc(gl.ONE, gl.ONE); + gl.blendEquation(gl.FUNC_ADD); + + while (numVerified < numBytes) { + var numRemaining = numBytes - numVerified; + var isLeftoverBatch = numRemaining < minBytesPerBatch; + var numBytesToVerify = isLeftoverBatch ? minBytesPerBatch : Math.min(glsBufferTestUtil.MAX_LINES_PER_INDEX_ARRAY_DRAW + 1, numRemaining); + var curOffset = isLeftoverBatch ? (numBytes - minBytesPerBatch) : numVerified; + /** @type {string} */ var imageSetDesc = 'Bytes ' + (offset + curOffset) + ' to ' + (offset + curOffset + numBytesToVerify - 1); + + // Step 1: Render using index buffer. + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STREAM_DRAW); + gl.vertexAttribPointer(this.m_posLoc, 2, gl.FLOAT, false, 0, 0); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_colorBuf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STREAM_DRAW); + gl.vertexAttribPointer(this.m_colorLoc, 3, gl.FLOAT, false, 0, 0); + + gl.drawElements(gl.LINE_STRIP, numBytesToVerify, gl.UNSIGNED_BYTE, offset + curOffset); + indexBufferImg.readViewport(gl); + + // Step 2: Do manual fetch and render without index buffer. + glsBufferTestUtil.execVertexFetch(fetchedPos, positions, refPtr.subarray(offset + curOffset), numBytesToVerify); + glsBufferTestUtil.execVertexFetch(fetchedColor, colors, refPtr.subarray(offset + curOffset), numBytesToVerify); + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(fetchedPos), gl.STREAM_DRAW); + gl.vertexAttribPointer(this.m_posLoc, 2, gl.FLOAT, false, 0, 0); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.m_colorBuf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(fetchedColor), gl.STREAM_DRAW); + gl.vertexAttribPointer(this.m_colorLoc, 3, gl.FLOAT, false, 0, 0); + + gl.drawArrays(gl.LINE_STRIP, 0, numBytesToVerify); + referenceImg.readViewport(gl, [0, 0, viewportW, viewportH]); + + if (!tcuImageCompare.pixelThresholdCompare('RenderResult', imageSetDesc, referenceImg, indexBufferImg, threshold.toIVec(), tcuImageCompare.CompareLogMode.RESULT)) { + isOk = false; + break; + } + + numVerified += isLeftoverBatch ? numRemaining : numBytesToVerify; + } + + gl.bindVertexArray(null); + + return isOk; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js new file mode 100644 index 000000000..4dc3be70f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js @@ -0,0 +1,5415 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsBuiltinPrecisionTests'); +goog.require('framework.common.tcuFloatFormat'); +goog.require('framework.common.tcuInterval'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuMatrixUtil'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluVarType'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('modules.shared.glsBuiltinPrecisionTestsUnitTests'); +goog.require('modules.shared.glsShaderExecUtil'); + +goog.scope(function() { + + var glsBuiltinPrecisionTests = modules.shared.glsBuiltinPrecisionTests; + var tcuTestCase = framework.common.tcuTestCase; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var tcuInterval = framework.common.tcuInterval; + var tcuFloatFormat = framework.common.tcuFloatFormat; + var deRandom = framework.delibs.debase.deRandom; + var glsShaderExecUtil = modules.shared.glsShaderExecUtil; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var deMath = framework.delibs.debase.deMath; + var deUtil = framework.delibs.debase.deUtil; + var gluVarType = framework.opengl.gluVarType; + var tcuMatrix = framework.common.tcuMatrix; + var tcuMatrixUtil = framework.common.tcuMatrixUtil; + var ref = modules.shared.glsBuiltinPrecisionTestsUnitTests.cppreference; + var referenceComparison = modules.shared.glsBuiltinPrecisionTestsUnitTests.referenceComparison; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + + /** @typedef {(tcuInterval.Interval|Array|tcuMatrix.Matrix)} */ + glsBuiltinPrecisionTests.Intervals; + + /** @typedef {(number|Array|tcuMatrix.Matrix)} */ + glsBuiltinPrecisionTests.Value; + + /** @typedef {(string)} */ + glsBuiltinPrecisionTests.Typename; + + //Change to true for WebGL unit testing + var enableUnittests = false; + + /** + * @param {number} value + * @return {boolean} + */ + glsBuiltinPrecisionTests.isFloat = function(value) { + return value % 1 !== 0; + }; + + /** + * @constructor + * @param {string} R + * @param {string=} P0 + * @param {string=} P1 + * @param {string=} P2 + * @param {string=} P3 + */ + glsBuiltinPrecisionTests.Signature = function(R, P0, P1, P2, P3) { + this.Ret = R; + this.Arg0 = P0 === undefined ? 'void' : P0; + this.Arg1 = P1 === undefined ? 'void' : P1; + this.Arg2 = P2 === undefined ? 'void' : P2; + this.Arg3 = P3 === undefined ? 'void' : P3; + }; + + /** @typedef {Array} */ + glsBuiltinPrecisionTests.FuncSet; + + /** + * @constructor + * @template T + * @param {T} A0 + * @param {T} A1 + * @param {T} A2 + * @param {T} A3 + */ + glsBuiltinPrecisionTests.Tuple4 = function(A0, A1, A2, A3) { + this.a = A0; + this.b = A1; + this.c = A2; + this.d = A3; + }; + + /** + * @typedef {!glsBuiltinPrecisionTests.Tuple4} + */ + glsBuiltinPrecisionTests.ParamNames; + + /** + * Returns true for all other types except Void + * @param {string} typename + */ + glsBuiltinPrecisionTests.isTypeValid = function(typename) { + if (typename === 'void') + return false; + return true; + }; + + /** + * Returns true for all other types except Void + * @param {*} In + * @return {number} + */ + glsBuiltinPrecisionTests.numInputs = function(In) { + return (!glsBuiltinPrecisionTests.isTypeValid(In.In0) ? 0 : + !glsBuiltinPrecisionTests.isTypeValid(In.In1) ? 1 : + !glsBuiltinPrecisionTests.isTypeValid(In.In2) ? 2 : + !glsBuiltinPrecisionTests.isTypeValid(In.In3) ? 3 : + 4); + }; + + /** + * Returns true for all other types except Void + * @param {*} Out + * @return {number} + */ + glsBuiltinPrecisionTests.numOutputs = function(Out) { + return (!glsBuiltinPrecisionTests.isTypeValid(Out.Out0) ? 0 : + !glsBuiltinPrecisionTests.isTypeValid(Out.Out1) ? 1 : + 2); + }; + + /** + * @constructor + * @param {glsBuiltinPrecisionTests.Typename=} In0_ + * @param {glsBuiltinPrecisionTests.Typename=} In1_ + * @param {glsBuiltinPrecisionTests.Typename=} In2_ + * @param {glsBuiltinPrecisionTests.Typename=} In3_ + */ + glsBuiltinPrecisionTests.InTypes = function(In0_, In1_, In2_, In3_) { + this.In0 = In0_ === undefined ? 'void' : In0_; + this.In1 = In1_ === undefined ? 'void' : In1_; + this.In2 = In2_ === undefined ? 'void' : In2_; + this.In3 = In3_ === undefined ? 'void' : In3_; + }; + + /** + * @constructor + * @param {glsBuiltinPrecisionTests.Typename=} Out0_ + * @param {glsBuiltinPrecisionTests.Typename=} Out1_ + */ + glsBuiltinPrecisionTests.OutTypes = function(Out0_, Out1_) { + this.Out0 = Out0_ === undefined ? 'void' : Out0_; + this.Out1 = Out1_ === undefined ? 'void' : Out1_; + }; + + /** + * @constructor + */ + glsBuiltinPrecisionTests.Environment = function() { + /** @type {Object} */ this.m_map = {}; + }; + + /** + * @param {glsBuiltinPrecisionTests.Variable} variable + * @param {*} value + */ + glsBuiltinPrecisionTests.Environment.prototype.bind = function(variable, value) { + this.m_map[variable.getName()] = value; + }; + + /** + * @param {*} variable + * @return {glsBuiltinPrecisionTests.Intervals} + */ + glsBuiltinPrecisionTests.Environment.prototype.lookup = function(variable) { + if (variable instanceof glsBuiltinPrecisionTests.Variable) + return this.m_map[variable.getName()]; + + throw new Error('Invalid lookup input: ' + variable); + }; + + /** + * @constructor + * @param {tcuFloatFormat.FloatFormat} format_ + * @param {gluShaderUtil.precision} floatPrecision_ + * @param {glsBuiltinPrecisionTests.Environment} env_ + * @param {number=} callDepth_ + */ + glsBuiltinPrecisionTests.EvalContext = function(format_, floatPrecision_, env_, callDepth_) { + this.format = format_; + this.floatPrecision = floatPrecision_; + this.env = env_; + this.callDepth = callDepth_ === undefined ? 0 : callDepth_; + }; + + /** + * @param {string} typename typename + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {glsBuiltinPrecisionTests.Intervals} value + * @return {glsBuiltinPrecisionTests.Intervals} + */ + glsBuiltinPrecisionTests.convert = function(typename, fmt, value) { + var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename); + + if (value instanceof Array) { + var ret = []; + for (var i = 0; i < value.length; i++) + ret.push(traits.doConvert(fmt, value[i])); + return ret; + } + + if (value instanceof tcuMatrix.Matrix) { + var ret = new tcuMatrix.Matrix(value.rows, value.cols); + for (var i = 0; i < value.rows; i++) + for (var j = 0; j < value.cols; j++) + ret.set(i, j, traits.doConvert(fmt, value.get(i, j))); + return ret; + } + + return traits.doConvert(fmt, value); + }; + + /** + * Returns true if every element of `ival` contains the corresponding element of `value`. + * @param {string} typename typename + * @param {glsBuiltinPrecisionTests.Intervals} ival + * @param {*} value + * @return {boolean} + */ + glsBuiltinPrecisionTests.contains = function(typename, ival, value) { + var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename); + var contains = true; + + if (value instanceof Array) { + for (var i = 0; i < value.length; i++) + contains &= traits.doContains(ival[i], value[i]); + return contains; + } + + if (value instanceof tcuMatrix.Matrix) { + for (var i = 0; i < value.rows; i++) + for (var j = 0; j < value.cols; j++) + contains &= traits.doContains(ival.get(i, j), value.get(i, j)); + return contains; + } + + return traits.doContains(ival, value); + }; + + /** + * @param {string} typename typename + * @param {glsBuiltinPrecisionTests.Intervals} ival0 + * @param {glsBuiltinPrecisionTests.Intervals} ival1 + * @return {glsBuiltinPrecisionTests.Intervals} + */ + glsBuiltinPrecisionTests.union = function(typename, ival0, ival1) { + var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename); + + if (ival0 instanceof Array) { + var ret = []; + for (var i = 0; i < ival0.length; i++) + ret.push(traits.doUnion(ival0[i], ival1[i])); + return ret; + } + + if (ival0 instanceof tcuMatrix.Matrix) { + var ret = new tcuMatrix.Matrix(ival0.rows, ival0.cols); + for (var i = 0; i < ival0.rows; i++) + for (var j = 0; j < ival0.cols; j++) + ret.set(i, j, traits.doUnion(ival0.get(i, j), ival1.get(i, j))); + return ret; + } + + return traits.doUnion(ival0, ival1); + }; + + /** + * @param {string} typename + * @constructor + */ + glsBuiltinPrecisionTests.Traits = function(typename) { + this.typename = typename; + this.rows = 1; + this.cols = 1; + }; + + glsBuiltinPrecisionTests.Traits.prototype.isScalar = function() { + return this.rows == 1 && this.cols == 1; + }; + + glsBuiltinPrecisionTests.Traits.prototype.isVector = function() { + return this.rows > 0 && this.cols == 1; + }; + + glsBuiltinPrecisionTests.Traits.prototype.isMatrix = function() { + return this.rows > 0 && this.cols > 1; + }; + + /** + * @param {string=} typename + */ + glsBuiltinPrecisionTests.Traits.traitsFactory = function(typename) { + switch (typename) { + case 'boolean' : return new glsBuiltinPrecisionTests.TraitsBool(); + case 'float' : case 'vec2' : case 'vec3' : case 'vec4' : + case 'mat2' : case 'mat2x3' : case 'mat2x4' : + case 'mat3x2' : case 'mat3' : case 'mat3x4' : + case 'mat4x2' : case 'mat4x3' : case 'mat4' : + return new glsBuiltinPrecisionTests.TraitsFloat(typename); + case 'int' : return new glsBuiltinPrecisionTests.TraitsInt(); + case 'void' : return new glsBuiltinPrecisionTests.TraitsVoid(); + default: + throw new Error('Invalid typename:' + typename); + } + }; + + glsBuiltinPrecisionTests.round = function(typename, fmt, value) { + var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename); + + if (value instanceof Array) { + var ret = []; + for (var i = 0; i < value.length; i++) + ret.push(traits.doRound(fmt, value[i])); + return ret; + } + + if (value instanceof tcuMatrix.Matrix) { + var ret = new tcuMatrix.Matrix(value.rows, value.cols); + for (var i = 0; i < value.rows; i++) + for (var j = 0; j < value.cols; j++) + ret.set(i, j, traits.doRound(fmt, value.get(i, j))); + return ret; + } + + return traits.doRound(fmt, value); + }; + + /** + * cast the input typed array to correct type + * @param {string} typename + * @param {goog.TypedArray} input + * @return {goog.TypedArray} + */ + glsBuiltinPrecisionTests.cast = function(typename, input) { + var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename); + return traits.doCast(input); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Traits} + */ + glsBuiltinPrecisionTests.TraitsVoid = function() { + glsBuiltinPrecisionTests.Traits.call(this, 'void'); + }; + + setParentClass(glsBuiltinPrecisionTests.TraitsVoid, glsBuiltinPrecisionTests.Traits); + + /** + * @param {*} value + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.TraitsVoid.prototype.doMakeIVal = function(value) { + return new tcuInterval.Interval(); + }; + + /** + * @param {*} value1 + * @param {*} value2 + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.TraitsVoid.prototype.doUnion = function(value1, value2) { + return new tcuInterval.Interval(); + }; + + /** + * @param {*} value + * @return {boolean} + */ + glsBuiltinPrecisionTests.TraitsVoid.prototype.doContains = function(value) { + return true; + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {tcuInterval.Interval} ival + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.TraitsVoid.prototype.doConvert = function(fmt, ival) { + return new tcuInterval.Interval(); + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {*} ival + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.TraitsVoid.prototype.doRound = function(fmt, ival) { + return new tcuInterval.Interval(); + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {*} ival + */ + glsBuiltinPrecisionTests.TraitsVoid.prototype.doPrintIVal = function(fmt, ival) { + return '()'; + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {*} value + */ + glsBuiltinPrecisionTests.TraitsVoid.prototype.doPrintValue = function(fmt, value) { + return '()'; + }; + + glsBuiltinPrecisionTests.dataTypeSize = function(detailedType) { + var size = [1, 1]; + switch (detailedType) { + case 'vec2' : size[0] = 2; break; + case 'vec3' : size[0] = 3; break; + case 'vec4' : size[0] = 4; break; + case 'mat2' : size = [2 , 2]; break; + case 'mat2x3' : size = [3 , 2]; break; + case 'mat2x4' : size = [4 , 2]; break; + + case 'mat3x2' : size = [2 , 3]; break; + case 'mat3' : size = [3 , 3]; break; + case 'mat3x4' : size = [4 , 3]; break; + + case 'mat4x2' : size = [2 , 4]; break; + case 'mat4x3' : size = [3 , 4]; break; + case 'mat4' : size = [4 , 4]; break; + } + return size; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Traits} + * @param {string} typename + * @param {string=} detailedType + */ + glsBuiltinPrecisionTests.ScalarTraits = function(typename, detailedType) { + glsBuiltinPrecisionTests.Traits.call(this, typename); + var size = glsBuiltinPrecisionTests.dataTypeSize(detailedType); + this.rows = size[0]; + this.cols = size[1]; + + /** type{tcuInterval.Interval} */ this.iVal; + }; + + setParentClass(glsBuiltinPrecisionTests.ScalarTraits, glsBuiltinPrecisionTests.Traits); + + glsBuiltinPrecisionTests.ScalarTraits.prototype = Object.create(glsBuiltinPrecisionTests.Traits.prototype); + glsBuiltinPrecisionTests.ScalarTraits.prototype.constructor = glsBuiltinPrecisionTests.ScalarTraits; + + /** + * @param {*} value + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.ScalarTraits.prototype.doMakeIVal = function(value) { + // Thankfully all scalar types have a well-defined conversion to `double`, + // hence Interval can represent their ranges without problems. + return new tcuInterval.Interval(/** @type {number} */ (value)); + }; + + /** + * @param {tcuInterval.Interval} a + * @param {tcuInterval.Interval} b + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.ScalarTraits.prototype.doUnion = function(a, b) { + return a.operatorOrBinary(b); + }; + + /** + * @param {tcuInterval.Interval} a + * @param {number} value + * @return {boolean} + */ + glsBuiltinPrecisionTests.ScalarTraits.prototype.doContains = function(a, value) { + return a.contains(new tcuInterval.Interval(value)); + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {tcuInterval.Interval} ival + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.ScalarTraits.prototype.doConvert = function(fmt, ival) { + return fmt.convert(ival); + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {number} value + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.ScalarTraits.prototype.doRound = function(fmt, value) { + return fmt.roundOut(new tcuInterval.Interval(value), false);//TODO cast to double + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.ScalarTraits} + * @param {string} detailedType + */ + glsBuiltinPrecisionTests.TraitsFloat = function(detailedType) { + glsBuiltinPrecisionTests.ScalarTraits.call(this, 'float', detailedType); + }; + + glsBuiltinPrecisionTests.TraitsFloat.prototype = Object.create(glsBuiltinPrecisionTests.ScalarTraits.prototype); + glsBuiltinPrecisionTests.TraitsFloat.prototype.constructor = glsBuiltinPrecisionTests.TraitsFloat; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {tcuInterval.Interval} ival + */ + glsBuiltinPrecisionTests.TraitsFloat.prototype.doPrintIVal = function(fmt, ival) { + return fmt.intervalToHex(ival); + }; + + /** + * @param {goog.TypedArray} input + * @return {goog.TypedArray} + */ + glsBuiltinPrecisionTests.TraitsFloat.prototype.doCast = function(input) { + return new Float32Array(input.buffer); + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {number} value + */ + glsBuiltinPrecisionTests.TraitsFloat.prototype.doPrintValue = function(fmt, value) { + return fmt.floatToHex(value); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.ScalarTraits} + */ + glsBuiltinPrecisionTests.TraitsBool = function() { + glsBuiltinPrecisionTests.ScalarTraits.call(this, 'boolean'); + }; + + glsBuiltinPrecisionTests.TraitsBool.prototype = Object.create(glsBuiltinPrecisionTests.ScalarTraits.prototype); + glsBuiltinPrecisionTests.TraitsBool.prototype.constructor = glsBuiltinPrecisionTests.TraitsBool; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {tcuInterval.Interval} ival + */ + glsBuiltinPrecisionTests.TraitsBool.prototype.doPrintIVal = function(fmt, ival) { + /** type{string} */ var os = '{'; + var ifalse = new tcuInterval.Interval(0); + var itrue = new tcuInterval.Interval(1); + if (ival.contains(ifalse)) + os += 'false'; + if (ival.contains(ifalse) && ival.contains(itrue)) + os += ', '; + if (ival.contains(itrue)) + os += 'true'; + os += '}'; + return os; + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {boolean} value + */ + glsBuiltinPrecisionTests.TraitsBool.prototype.doPrintValue = function(fmt, value) { + return value ? 'true' : 'false'; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.ScalarTraits} + */ + glsBuiltinPrecisionTests.TraitsInt = function() { + glsBuiltinPrecisionTests.ScalarTraits.call(this, 'int'); + }; + + glsBuiltinPrecisionTests.TraitsInt.prototype = Object.create(glsBuiltinPrecisionTests.ScalarTraits.prototype); + glsBuiltinPrecisionTests.TraitsInt.prototype.constructor = glsBuiltinPrecisionTests.TraitsInt; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {tcuInterval.Interval} ival + */ + glsBuiltinPrecisionTests.TraitsInt.prototype.doPrintIVal = function(fmt, ival) { + return '[' + (ival.lo()) + ', ' + (ival.hi()) + ']'; + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {number} value + */ + glsBuiltinPrecisionTests.TraitsInt.prototype.doPrintValue = function(fmt, value) { + return value.toString(10); + }; + + /** + * @constructor + */ + glsBuiltinPrecisionTests.Statement = function() { + + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + */ + glsBuiltinPrecisionTests.Statement.prototype.execute = function(ctx) { + this.doExecute(ctx); + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Statement.prototype.print = function() { + return this.doPrint(); + }; + + glsBuiltinPrecisionTests.Statement.prototype.toString = function() { + return this.print(); + }; + + /** + * Output the functions that this expression refers to + * @param {glsBuiltinPrecisionTests.FuncSet} dst + * + */ + glsBuiltinPrecisionTests.Statement.prototype.getUsedFuncs = function(dst) { + this.doGetUsedFuncs(dst); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + */ + glsBuiltinPrecisionTests.Statement.prototype.doExecute = function(ctx) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Statement.prototype.doPrint = function() { + throw new Error('Virtual function. Please override.'); + }; + + /** + * Output the functions that this expression refers to + * @param {glsBuiltinPrecisionTests.FuncSet} dst + * + */ + glsBuiltinPrecisionTests.Statement.prototype.doGetUsedFuncs = function(dst) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Statement} + * @param {glsBuiltinPrecisionTests.Variable} variable + * @param {glsBuiltinPrecisionTests.Expr} value + * @param {boolean} isDeclaration + */ + glsBuiltinPrecisionTests.VariableStatement = function(variable, value, isDeclaration) { + this.m_variable = variable; + this.m_value = value; + this.m_isDeclaration = isDeclaration; + + }; + + setParentClass(glsBuiltinPrecisionTests.VariableStatement, glsBuiltinPrecisionTests.Statement); + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + */ + glsBuiltinPrecisionTests.VariableStatement.prototype.doExecute = function(ctx) { + ctx.env.bind(this.m_variable, this.m_value.evaluate(ctx)); + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.VariableStatement.prototype.doPrint = function() { + var v = this.m_variable; + var os = ''; + if (this.m_isDeclaration) + os += gluVarType.declareVariable(gluVarType.getVarTypeOf(v.typename), + v.getName()); + else + os += v.getName(); + + os += ' = ' + this.m_value.printExpr() + ';\n'; + + return os; + }; + + /** + * Output the functions that this expression refers to + * @param {glsBuiltinPrecisionTests.FuncSet} dst + * + */ + glsBuiltinPrecisionTests.VariableStatement.prototype.doGetUsedFuncs = function(dst) { + this.m_value.getUsedFuncs(dst); + }; + + /** + * @param {glsBuiltinPrecisionTests.Variable} variable + * @param {glsBuiltinPrecisionTests.Expr} definiens + * @return {glsBuiltinPrecisionTests.VariableStatement} + */ + glsBuiltinPrecisionTests.variableDeclaration = function(variable, definiens) { + return new glsBuiltinPrecisionTests.VariableStatement(variable, definiens, true); + }; + + /** + * @param {string} typename + * @param {string} name + * @param {glsBuiltinPrecisionTests.ExpandContext} ctx + * @param {glsBuiltinPrecisionTests.Expr} expr + * @return {glsBuiltinPrecisionTests.Variable} + */ + glsBuiltinPrecisionTests.bindExpression = function(typename, name, ctx, expr) { + var variable = ctx.genSym(typename, name); + ctx.addStatement(glsBuiltinPrecisionTests.variableDeclaration(variable, expr)); + return variable; + }; + + /** + * Common base class for all expressions regardless of their type. + * @constructor + */ + glsBuiltinPrecisionTests.ExprBase = function() {}; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.ExprBase.prototype.printExpr = function() { + return this.doPrintExpr(); + }; + + glsBuiltinPrecisionTests.ExprBase.prototype.toString = function() { + return this.printExpr(); + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.ExprBase.prototype.doPrintExpr = function() { + throw new Error('Virtual function. Please override.'); + }; + + /** + * Output the functions that this expression refers to + * @param {glsBuiltinPrecisionTests.FuncSet} dst + * + */ + glsBuiltinPrecisionTests.ExprBase.prototype.getUsedFuncs = function(/*FuncSet&*/ dst) { + this.doGetUsedFuncs(dst); + }; + + /** + * Output the functions that this expression refers to + * @param {glsBuiltinPrecisionTests.FuncSet} dst + * + */ + glsBuiltinPrecisionTests.ExprBase.prototype.doGetUsedFuncs = function(/*FuncSet&*/ dst) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * Type-specific operations for an expression representing type typename. + * @constructor + * @extends {glsBuiltinPrecisionTests.ExprBase} + * @param {glsBuiltinPrecisionTests.Typename} typename + */ + glsBuiltinPrecisionTests.Expr = function(typename) { + glsBuiltinPrecisionTests.ExprBase.call(this); + this.typename = typename; + }; + + setParentClass(glsBuiltinPrecisionTests.Expr, glsBuiltinPrecisionTests.ExprBase); + + /** + * Type-specific operations for an expression representing type typename. + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + */ + glsBuiltinPrecisionTests.Expr.prototype.evaluate = function(ctx) { + return this.doEvaluate(ctx); + }; + + /** + * Type-specific operations for an expression representing type typename. + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + */ + glsBuiltinPrecisionTests.Expr.prototype.doEvaluate = function(ctx) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Expr} + * @param {glsBuiltinPrecisionTests.Typename} typename + * @param {string=} name + */ + glsBuiltinPrecisionTests.Variable = function(typename, name) { + glsBuiltinPrecisionTests.Expr.call(this, typename); + /** @type {string} */ this.m_name = name || ''; + }; + + setParentClass(glsBuiltinPrecisionTests.Variable, glsBuiltinPrecisionTests.Expr); + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Variable.prototype.getName = function() { + return this.m_name; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Variable.prototype.doPrintExpr = function() { + return this.m_name; + }; + + glsBuiltinPrecisionTests.Variable.prototype.toString = function() { + return this.doPrintExpr(); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @return {*} + */ + glsBuiltinPrecisionTests.Variable.prototype.doEvaluate = function(ctx) { + return ctx.env.lookup(this); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Variable} + * @param {*=} t + */ + glsBuiltinPrecisionTests.Void = function(t) { + glsBuiltinPrecisionTests.Variable.call(this, 'void'); + }; + + setParentClass(glsBuiltinPrecisionTests.Void, glsBuiltinPrecisionTests.Variable); + + glsBuiltinPrecisionTests.Void.prototype.doEvaluate = function(ctx) { + return undefined; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Variable} + * @param {number} value + */ + glsBuiltinPrecisionTests.Constant = function(value) { + glsBuiltinPrecisionTests.Variable.call(this, 'float'); + this.m_value = value; + }; + + setParentClass(glsBuiltinPrecisionTests.Constant, glsBuiltinPrecisionTests.Variable); + + glsBuiltinPrecisionTests.Constant.prototype.doEvaluate = function(ctx) { + return new tcuInterval.Interval(this.m_value); + }; + + /** + * @constructor + * @param {*} typename + */ + glsBuiltinPrecisionTests.DefaultSampling = function(typename) { + this.typename = typename; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Expr} + * @param {glsBuiltinPrecisionTests.Variable} vector + * @param {number} index + */ + glsBuiltinPrecisionTests.VectorVariable = function(vector, index) { + glsBuiltinPrecisionTests.Expr.call(this, vector.typename); + this.m_vector = vector; + this.m_index = index; + }; + + setParentClass(glsBuiltinPrecisionTests.VectorVariable, glsBuiltinPrecisionTests.Expr); + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.VectorVariable.prototype.doEvaluate = function(ctx) { + var tmp = this.m_vector.doEvaluate(ctx); + return tmp[this.m_index]; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Expr} + * @param {glsBuiltinPrecisionTests.Variable} matrix + * @param {number} row + * @param {number} col + */ + glsBuiltinPrecisionTests.MatrixVariable = function(matrix, row, col) { + glsBuiltinPrecisionTests.Expr.call(this, matrix.typename); + this.m_matrix = matrix; + this.m_row = row; + this.m_col = col; + }; + + setParentClass(glsBuiltinPrecisionTests.MatrixVariable, glsBuiltinPrecisionTests.Expr); + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.MatrixVariable.prototype.doEvaluate = function(ctx) { + var tmp = this.m_matrix.doEvaluate(ctx); + return tmp.get(this.m_row, this.m_col); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Expr} + * @param {glsBuiltinPrecisionTests.Typename} typename + * @param {glsBuiltinPrecisionTests.Func} func + * @param {glsBuiltinPrecisionTests.Expr=} arg0 + * @param {glsBuiltinPrecisionTests.Expr=} arg1 + * @param {glsBuiltinPrecisionTests.Expr=} arg2 + * @param {glsBuiltinPrecisionTests.Expr=} arg3 + */ + glsBuiltinPrecisionTests.Apply = function(typename, func, arg0, arg1, arg2, arg3) { + glsBuiltinPrecisionTests.Expr.call(this, typename); + this.m_func = func; + /** @type {glsBuiltinPrecisionTests.Tuple4} */ this.m_args; + if (arg0 instanceof glsBuiltinPrecisionTests.Tuple4) + this.m_args = /** @type {glsBuiltinPrecisionTests.Tuple4} */ (arg0); + else { + this.m_args = new glsBuiltinPrecisionTests.Tuple4(arg0 || new glsBuiltinPrecisionTests.Void(), + arg1 || new glsBuiltinPrecisionTests.Void(), + arg2 || new glsBuiltinPrecisionTests.Void(), + arg3 || new glsBuiltinPrecisionTests.Void()); + } + }; + + setParentClass(glsBuiltinPrecisionTests.Apply, glsBuiltinPrecisionTests.Expr); + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Apply.prototype.doPrintExpr = function() { + var args = [this.m_args.a, this.m_args.b, this.m_args.c, this.m_args.d]; + return this.m_func.print(args); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @return {glsBuiltinPrecisionTests.Intervals} + */ + glsBuiltinPrecisionTests.Apply.prototype.doEvaluate = function(ctx) { + var debug = false; + + if (debug) { + glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level = glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level || 0; + var level = glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level; + glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level++; + var name = this.m_func.constructor.toString(); + name = name.replace(/[\s\S]*glsBuiltinPrecisionTests\./m, '').replace(/\.call[\s\S]*/m, ''); + if (this.m_func.getName) + name += ' ' + this.m_func.getName(); + console.log('<' + level + '> Function ' + name); + } + + var a = this.m_args.a.evaluate(ctx); + var b = this.m_args.b.evaluate(ctx); + var c = this.m_args.c.evaluate(ctx); + var d = this.m_args.d.evaluate(ctx); + var retVal = this.m_func.applyFunction(ctx, a, b, c, d); + + if (debug) { + console.log('<' + level + '> a: ' + a); + console.log('<' + level + '> b: ' + b); + console.log('<' + level + '> returning: ' + retVal); + glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level--; + } + return retVal; + }; + + /** + * @param {glsBuiltinPrecisionTests.Func} func + * @param {glsBuiltinPrecisionTests.Expr=} arg0 + * @param {glsBuiltinPrecisionTests.Expr=} arg1 + * @param {glsBuiltinPrecisionTests.Expr=} arg2 + * @param {glsBuiltinPrecisionTests.Expr=} arg3 + */ + var app = function(func, arg0, arg1, arg2, arg3) { + return new glsBuiltinPrecisionTests.Apply('float', func, arg0, arg1, arg2, arg3); + }; + + /** + * @param {glsBuiltinPrecisionTests.FuncSet} dst + */ + glsBuiltinPrecisionTests.Apply.prototype.doGetUsedFuncs = function(dst) { + this.m_func.getUsedFuncs(dst); + this.m_args.a.getUsedFuncs(dst); + this.m_args.b.getUsedFuncs(dst); + this.m_args.c.getUsedFuncs(dst); + this.m_args.d.getUsedFuncs(dst); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Apply} + * @param {glsBuiltinPrecisionTests.Func} func + * @param {glsBuiltinPrecisionTests.Expr=} arg0 + * @param {glsBuiltinPrecisionTests.Expr=} arg1 + * @param {glsBuiltinPrecisionTests.Expr=} arg2 + * @param {glsBuiltinPrecisionTests.Expr=} arg3 + */ + glsBuiltinPrecisionTests.ApplyScalar = function(func, arg0, arg1, arg2, arg3) { + glsBuiltinPrecisionTests.Apply.call(this, 'float', func, arg0, arg1, arg2, arg3); + }; + + setParentClass(glsBuiltinPrecisionTests.ApplyScalar, glsBuiltinPrecisionTests.Apply); + + glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate = function(ctx) { + var debug = false; + + if (debug) { + glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level = glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level || 0; + var level = glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level; + glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level++; + var name = this.m_func.constructor.toString(); + name = name.replace(/[\s\S]*glsBuiltinPrecisionTests\./m, '').replace(/\.call[\s\S]*/m, ''); + if (this.m_func.getName) + name += ' ' + this.m_func.getName(); + console.log('scalar<' + level + '> Function ' + name); + } + + var a = this.m_args.a.evaluate(ctx); + var b = this.m_args.b.evaluate(ctx); + var c = this.m_args.c.evaluate(ctx); + var d = this.m_args.d.evaluate(ctx); + if (a instanceof Array) { + var ret = []; + for (var i = 0; i < a.length; i++) { + var p0 = a instanceof Array ? a[i] : a; + var p1 = b instanceof Array ? b[i] : b; + var p2 = c instanceof Array ? c[i] : c; + var p3 = d instanceof Array ? d[i] : d; + ret.push(this.m_func.applyFunction(ctx, p0, p1, p2, p3)); + } + return ret; + } + + var retVal = this.m_func.applyFunction(ctx, a, b, c, d); + + if (debug) { + console.log('scalar<' + level + '> a: ' + a); + console.log('scalar<' + level + '> b: ' + b); + console.log('scalar<' + level + '> return1: ' + ret); + console.log('scalar<' + level + '> return2: ' + retVal); + glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level--; + } + + return retVal; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Apply} + */ + glsBuiltinPrecisionTests.ApplyVar = function(typename, func, arg0, arg1, arg2, arg3) { + glsBuiltinPrecisionTests.Apply.call(this, typename, func, arg0, arg1, arg2, arg3); + }; + + setParentClass(glsBuiltinPrecisionTests.ApplyVar, glsBuiltinPrecisionTests.Apply); + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @return {glsBuiltinPrecisionTests.Intervals} + */ + glsBuiltinPrecisionTests.ApplyVar.prototype.doEvaluate = function(ctx) { + return this.m_func.applyFunction(ctx, + ctx.env.lookup(this.m_args.a), ctx.env.lookup(this.m_args.b), + ctx.env.lookup(this.m_args.c), ctx.env.lookup(this.m_args.d), + [this.m_args.a.getName(), this.m_args.b.getName(), + this.m_args.c.getName(), this.m_args.d.getName()]); + }; + + /** + * @constructor + */ + glsBuiltinPrecisionTests.FuncBase = function() {}; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.FuncBase.prototype.getName = function() { + return ''; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.FuncBase.prototype.getRequiredExtension = function() { + return ''; + }; + + /** + * @param {Array} args + * @return {string} + */ + glsBuiltinPrecisionTests.FuncBase.prototype.print = function(args) { + return ''; + }; + + /** + * Index of output parameter, or -1 if none of the parameters is output. + * @return {number} + */ + glsBuiltinPrecisionTests.FuncBase.prototype.getOutParamIndex = function() { + return -1; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.FuncBase.prototype.printDefinition = function() { + return this.doPrintDefinition(); + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.FuncBase.prototype.doPrintDefinition = function() { + throw new Error('Virtual function. Please override.'); + }; + + /** + * typedef set FuncSet; + * @param {glsBuiltinPrecisionTests.FuncSet} dst + */ + glsBuiltinPrecisionTests.FuncBase.prototype.getUsedFuncs = function(dst) { + this.doGetUsedFuncs(dst); + }; + + /** + * @param {glsBuiltinPrecisionTests.FuncSet} dst + */ + glsBuiltinPrecisionTests.FuncBase.prototype.doGetUsedFuncs = function(dst) {}; + + /*************************************/ + /** + * \brief Function objects. + * + * Each Func object represents a GLSL function. It can be applied to interval + * arguments, and it returns the an interval that is a conservative + * approximation of the image of the GLSL function over the argument + * intervals. That is, it is given a set of possible arguments and it returns + * the set of possible values. + * + * @constructor + * @extends {glsBuiltinPrecisionTests.FuncBase} + * @param {glsBuiltinPrecisionTests.Signature} Sig_ template + */ + glsBuiltinPrecisionTests.Func = function(Sig_) { + glsBuiltinPrecisionTests.FuncBase.call(this); + this.Sig = Sig_; + this.Ret = this.Sig.Ret; + this.Arg0 = this.Sig.Arg0; + this.Arg1 = this.Sig.Arg1; + this.Arg2 = this.Sig.Arg2; + this.Arg3 = this.Sig.Arg3; + }; + + glsBuiltinPrecisionTests.Func.prototype = Object.create(glsBuiltinPrecisionTests.FuncBase.prototype); + glsBuiltinPrecisionTests.Func.prototype.constructor = glsBuiltinPrecisionTests.Func; + + /** + * @param {Array} args + * @return {string} + */ + glsBuiltinPrecisionTests.Func.prototype.print = function(args) { + return this.doPrint(args); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Intervals=} Iarg0 + * @param {glsBuiltinPrecisionTests.Intervals=} Iarg1 + * @param {glsBuiltinPrecisionTests.Intervals=} Iarg2 + * @param {glsBuiltinPrecisionTests.Intervals=} Iarg3 + * @return {glsBuiltinPrecisionTests.Intervals} + */ + glsBuiltinPrecisionTests.Func.prototype.applyFunction = function(ctx, Iarg0, Iarg1, Iarg2, Iarg3, variablenames) { + return this.applyArgs(ctx, new glsBuiltinPrecisionTests.Tuple4(Iarg0, Iarg1, Iarg2, Iarg3), variablenames); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} args + * @return {glsBuiltinPrecisionTests.Intervals} + */ + glsBuiltinPrecisionTests.Func.prototype.applyArgs = function(ctx, args, variablenames) { + return this.doApply(ctx, args, variablenames); + }; + + /** + * @return {glsBuiltinPrecisionTests.ParamNames} + */ + glsBuiltinPrecisionTests.Func.prototype.getParamNames = function() { + return this.doGetParamNames(); + }; + + /** + * @param {Array} args + * @return {string} + */ + glsBuiltinPrecisionTests.Func.prototype.doPrint = function(args) { + /** type{string} */ var os = this.getName() + '('; + + // TODO: fix the generics + for (var i = 0; i < args.length; i++) + if (glsBuiltinPrecisionTests.isTypeValid(args[i].typename)) { + if (i != 0) + os += ', '; + os += args[i]; + } + + os += ')'; + + return os; + }; + + /** + * @return {glsBuiltinPrecisionTests.ParamNames} args + */ + glsBuiltinPrecisionTests.Func.prototype.doGetParamNames = function() { + /** @type {glsBuiltinPrecisionTests.ParamNames} */ var names = new glsBuiltinPrecisionTests.Tuple4('a', 'b', 'c', 'd'); + return names; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Func} + * @param {glsBuiltinPrecisionTests.Signature} Sig template + * + */ + glsBuiltinPrecisionTests.PrimitiveFunc = function(Sig) { + glsBuiltinPrecisionTests.Func.call(this, Sig); + this.Ret = Sig.Ret; + }; + + glsBuiltinPrecisionTests.PrimitiveFunc.prototype = Object.create(glsBuiltinPrecisionTests.Func.prototype); + glsBuiltinPrecisionTests.PrimitiveFunc.prototype.constructor = glsBuiltinPrecisionTests.PrimitiveFunc; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * @param {string} typename + * + */ + glsBuiltinPrecisionTests.Cond = function(typename) { + var sig = new glsBuiltinPrecisionTests.Signature(typename, 'boolean', typename, typename); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Cond, glsBuiltinPrecisionTests.PrimitiveFunc); + + glsBuiltinPrecisionTests.Cond.prototype.getName = function() { + return '_cond'; + }; + + glsBuiltinPrecisionTests.Cond.prototype.doPrint = function(args) { + var str = '(' + args[0] + ' ? ' + args[1] + ' : ' + args[2] + ')'; + return str; + }; + + glsBuiltinPrecisionTests.Cond.prototype.doApply = function(ctx, iargs) { + var ret; + if (glsBuiltinPrecisionTests.contains(this.Sig.Arg0, iargs.a, 1)) + ret = iargs.b; + if (glsBuiltinPrecisionTests.contains(this.Sig.Arg0, iargs.a, 0)) { + if (ret) + ret = glsBuiltinPrecisionTests.union(this.Sig.Ret, ret, iargs.c); + else + ret = iargs.c; + } + if (ret) + return ret; + return new tcuInterval.Interval(); + }; + + /** + * If multipleInputs is false, GenVec duplicates first input to proper size + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * @param {number} size + * @param {boolean=} multipleInputs + */ + glsBuiltinPrecisionTests.GenVec = function(size, multipleInputs) { + var vecName = glsBuiltinPrecisionTests.sizeToName(size); + var p = [ + size >= 1 ? 'float' : undefined, + size >= 2 ? 'float' : undefined, + size >= 3 ? 'float' : undefined, + size >= 4 ? 'float' : undefined + ]; + var sig = new glsBuiltinPrecisionTests.Signature(vecName, p[0], p[1], p[2], p[3]); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + this.size = size; + this.vecName = vecName; + this.multipleInputs = multipleInputs || false; + }; + + setParentClass(glsBuiltinPrecisionTests.GenVec, glsBuiltinPrecisionTests.PrimitiveFunc); + + glsBuiltinPrecisionTests.GenVec.prototype.getName = function() { + return this.vecName; + }; + + glsBuiltinPrecisionTests.GenVec.prototype.doApply = function(ctx, iargs) { + if (this.size == 1) + return iargs.a; + + var ret = this.multipleInputs ? + [iargs.a, iargs.b, iargs.c, iargs.d] : + [iargs.a, iargs.a, iargs.a, iargs.a]; + + return ret.slice(0, this.size); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.GenMat = function(rows, cols) { + var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols); + var vecName = glsBuiltinPrecisionTests.sizeToName(rows); + var p = [ + cols >= 1 ? vecName : undefined, + cols >= 2 ? vecName : undefined, + cols >= 3 ? vecName : undefined, + cols >= 4 ? vecName : undefined + ]; + var sig = new glsBuiltinPrecisionTests.Signature(name, p[0], p[1], p[2], p[3]); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + this.rows = rows; + this.cols = cols; + this.name = name; + this.vecName = vecName; + }; + + setParentClass(glsBuiltinPrecisionTests.GenMat, glsBuiltinPrecisionTests.PrimitiveFunc); + + glsBuiltinPrecisionTests.GenMat.prototype.getName = function() { + return this.name; + }; + + glsBuiltinPrecisionTests.GenMat.prototype.doApply = function(ctx, iargs) { + var ret = new tcuMatrix.Matrix(this.rows, this.cols); + var inputs = [iargs.a, iargs.b, iargs.c, iargs.d]; + + for (var i = 0; i < this.rows; i++) + for (var j = 0; j < this.cols; j++) + ret.set(i, j, inputs[j][i]); + return ret; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * @param {string} typename + * + */ + glsBuiltinPrecisionTests.CompareOperator = function(typename) { + var sig = new glsBuiltinPrecisionTests.Signature('boolean', typename, typename); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.CompareOperator, glsBuiltinPrecisionTests.PrimitiveFunc); + + glsBuiltinPrecisionTests.CompareOperator.prototype.doPrint = function(args) { + var str = '(' + args[0] + this.getSymbol() + args[1] + ')'; + return str; + }; + + glsBuiltinPrecisionTests.CompareOperator.prototype.doApply = function(ctx, iargs) { + var arg0 = iargs.a; + var arg1 = iargs.b; + + var ret = new tcuInterval.Interval(); + + if (this.canSucceed(arg0, arg1)) + ret = new tcuInterval.Interval(1); + if (this.canFail(arg0, arg1)) + ret.operatorOrAssignBinary(new tcuInterval.Interval(0)); + + return ret; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.CompareOperator.prototype.getSymbol = function() { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @param {tcuInterval.Interval} arg0 + * @param {tcuInterval.Interval} arg1 + * @return {boolean} + */ + glsBuiltinPrecisionTests.CompareOperator.prototype.canSucceed = function(arg0, arg1) { + throw new Error('Virtual function. Please override.'); + }; + /** + * @param {tcuInterval.Interval} arg0 + * @param {tcuInterval.Interval} arg1 + * @return {boolean} + */ + glsBuiltinPrecisionTests.CompareOperator.prototype.canFail = function(arg0, arg1) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CompareOperator} + * @param {string} typename + * + */ + glsBuiltinPrecisionTests.LessThan = function(typename) { + glsBuiltinPrecisionTests.CompareOperator.call(this, typename); + }; + + setParentClass(glsBuiltinPrecisionTests.LessThan, glsBuiltinPrecisionTests.CompareOperator); + + glsBuiltinPrecisionTests.LessThan.prototype.getSymbol = function() { + return '<'; + }; + + glsBuiltinPrecisionTests.LessThan.prototype.canSucceed = function(a, b) { + return (a.lo() < b.hi()); + }; + + glsBuiltinPrecisionTests.LessThan.prototype.canFail = function(a, b) { + return !(a.hi() < b.lo()); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * + */ + glsBuiltinPrecisionTests.FloatFunc1 = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + }; + + glsBuiltinPrecisionTests.FloatFunc1.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype); + glsBuiltinPrecisionTests.FloatFunc1.prototype.constructor = glsBuiltinPrecisionTests.FloatFunc1; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} iargs + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc1.prototype.doApply = function(ctx, iargs) { + var a = /** @type {tcuInterval.Interval} */ (iargs.a); + return this.applyMonotone(ctx, a); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} iarg0 + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc1.prototype.applyMonotone = function(ctx, iarg0) { + /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + + /** + * @param {number=} x + * @param {number=} y + * @return {tcuInterval.Interval} + */ + var body = function(x, y) { + x = x || 0; + return this.applyPoint(ctx, x); + }; + ret = tcuInterval.applyMonotone1(iarg0, body.bind(this)); + + ret.operatorOrAssignBinary(this.innerExtrema(ctx, iarg0)); + + ret.operatorAndAssignBinary(this.getCodomain().operatorOrBinary(new tcuInterval.Interval(NaN))); + + return ctx.format.convert(ret); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} iargs + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc1.prototype.innerExtrema = function(ctx, iargs) { + return new tcuInterval.Interval(); // empty interval, i.e. no extrema + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} arg0 + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc1.prototype.applyPoint = function(ctx, arg0) { + var exact = this.applyExact(arg0); + var prec = this.precision(ctx, exact, arg0); + + var a = new tcuInterval.Interval(exact); + var b = tcuInterval.withNumbers(-prec, prec); + return tcuInterval.Interval.operatorSum(a, b); + }; + + /** + * @param {number} x + * @return {number} + */ + glsBuiltinPrecisionTests.FloatFunc1.prototype.applyExact = function(x) { + throw new Error('Internal error. Cannot apply'); + }; + + /** + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc1.prototype.getCodomain = function() { + return tcuInterval.unbounded(true); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.FloatFunc1.prototype.precision = function(ctx, x, y) { + return 0; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FloatFunc1} + */ + glsBuiltinPrecisionTests.Negate = function() { + glsBuiltinPrecisionTests.FloatFunc1.call(this); + }; + + setParentClass(glsBuiltinPrecisionTests.Negate, glsBuiltinPrecisionTests.FloatFunc1); + + glsBuiltinPrecisionTests.Negate.prototype.getName = function() { + return '_negate'; + }; + + glsBuiltinPrecisionTests.Negate.prototype.doPrint = function(args) { + return '-' + args[0]; + }; + + glsBuiltinPrecisionTests.Negate.prototype.precision = function(ctx, ret, x) { + return 0; + }; + glsBuiltinPrecisionTests.Negate.prototype.applyExact = function(x) { + return -x; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FloatFunc1} + */ + glsBuiltinPrecisionTests.InverseSqrt = function() { + glsBuiltinPrecisionTests.FloatFunc1.call(this); + }; + + setParentClass(glsBuiltinPrecisionTests.InverseSqrt, glsBuiltinPrecisionTests.FloatFunc1); + + glsBuiltinPrecisionTests.InverseSqrt.prototype.getName = function() { + return 'inversesqrt'; + }; + + glsBuiltinPrecisionTests.InverseSqrt.prototype.precision = function(ctx, ret, x) { + if (x <= 0) + return NaN; + return ctx.format.ulp(ret, 2.0); + }; + + glsBuiltinPrecisionTests.InverseSqrt.prototype.applyExact = function(x) { + return 1 / Math.sqrt(x); + }; + + glsBuiltinPrecisionTests.InverseSqrt.prototype.getCodomain = function() { + return tcuInterval.withNumbers(0, Infinity); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FloatFunc1} + */ + glsBuiltinPrecisionTests.Round = function() { + glsBuiltinPrecisionTests.FloatFunc1.call(this); + }; + + setParentClass(glsBuiltinPrecisionTests.Round, glsBuiltinPrecisionTests.FloatFunc1); + + glsBuiltinPrecisionTests.Round.prototype.getName = function() { + return 'round'; + }; + + glsBuiltinPrecisionTests.Round.prototype.precision = function(ctx, ret, x) { + return 0; + }; + + glsBuiltinPrecisionTests.Round.prototype.applyPoint = function(ctx, x) { + var truncated = Math.trunc(x); + var fract = x - truncated; + var ret = new tcuInterval.Interval(); + + // When x is inf or -inf, truncated would be inf or -inf too. Then fract + // would be NaN (inf - inf). While in native c code, it would be 0 (inf) or -0 (-inf). + // This behavior in JS differs from that in native c code. + if (Math.abs(fract) <= 0.5 || isNaN(fract)) + ret.operatorOrAssignBinary(new tcuInterval.Interval(truncated)); + if (Math.abs(fract) >= 0.5) + ret.operatorOrAssignBinary(new tcuInterval.Interval(truncated + deMath.deSign(fract))); + + return ret; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FloatFunc1} + * @param {string} name + * @param {tcuInterval.DoubleFunc1} func + */ + glsBuiltinPrecisionTests.CFloatFunc1 = function(name, func) { + glsBuiltinPrecisionTests.FloatFunc1.call(this); + /** @type {string} */ this.m_name = name; + /** @type {tcuInterval.DoubleFunc1} */this.m_func = func; + }; + + glsBuiltinPrecisionTests.CFloatFunc1.prototype = Object.create(glsBuiltinPrecisionTests.FloatFunc1.prototype); + glsBuiltinPrecisionTests.CFloatFunc1.prototype.constructor = glsBuiltinPrecisionTests.CFloatFunc1; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.CFloatFunc1.prototype.getName = function() { + return this.m_name; + }; + + /** + * @param {number} x + * @return {number} + */ + glsBuiltinPrecisionTests.CFloatFunc1.prototype.applyExact = function(x) { + return this.m_func(x); + }; + + /** + * PrimitiveFunc > + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + */ + glsBuiltinPrecisionTests.FloatFunc2 = function() { + /** @type {glsBuiltinPrecisionTests.Signature} */ var Sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float'); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, Sig); + }; + + glsBuiltinPrecisionTests.FloatFunc2.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype); + glsBuiltinPrecisionTests.FloatFunc2.prototype.constructor = glsBuiltinPrecisionTests.FloatFunc2; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} iargs + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc2.prototype.doApply = function(ctx, iargs) { + var a = /** @type {tcuInterval.Interval} */ (iargs.a); + var b = /** @type {tcuInterval.Interval} */ (iargs.b); + return this.applyMonotone(ctx, a, b); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} xi + * @param {tcuInterval.Interval} yi + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc2.prototype.applyMonotone = function(ctx, xi, yi) { + /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + + /** + * @param {number=} x + * @param {number=} y + * @return {tcuInterval.Interval} + */ + var body = function(x, y) { + x = x || 0; + y = y || 0; + return this.applyPoint(ctx, x, y); + }; + ret = tcuInterval.applyMonotone2(xi, yi, body.bind(this)); + + ret.operatorOrAssignBinary(this.innerExtrema(ctx, xi, yi)); + + ret.operatorAndAssignBinary(this.getCodomain().operatorOrBinary(new tcuInterval.Interval(NaN))); + + return ctx.format.convert(ret); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} xi + * @param {tcuInterval.Interval} yi + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc2.prototype.innerExtrema = function(ctx, xi, yi) { + return new tcuInterval.Interval(); // empty interval, i.e. no extrema + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} x + * @param {number} y + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc2.prototype.applyPoint = function(ctx, x, y) { + /** @type {number} */ var exact = this.applyExact(x, y); + var prec = this.precision(ctx, exact, x, y); + + var a = new tcuInterval.Interval(exact); + var b = tcuInterval.withNumbers(-prec, prec); + return tcuInterval.Interval.operatorSum(a, b); + }; + + /** + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.FloatFunc2.prototype.applyExact = function(x, y) { + throw new Error('Virtual function. Please override'); + }; + + /** + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc2.prototype.getCodomain = function() { + return tcuInterval.unbounded(true); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} ret + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.FloatFunc2.prototype.precision = function(ctx, ret, x, y) { + throw new Error('Virtual function. Please override'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FloatFunc2} + * @param {string} name + * @param {tcuInterval.DoubleFunc2} func + */ + glsBuiltinPrecisionTests.CFloatFunc2 = function(name, func) { + glsBuiltinPrecisionTests.FloatFunc2.call(this); + /** @type {string} */ this.m_name = name; + /** @type {tcuInterval.DoubleFunc2} */ this.m_func = func; + }; + + glsBuiltinPrecisionTests.CFloatFunc2.prototype = Object.create(glsBuiltinPrecisionTests.FloatFunc2.prototype); + glsBuiltinPrecisionTests.CFloatFunc2.prototype.constructor = glsBuiltinPrecisionTests.CFloatFunc2; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.CFloatFunc2.prototype.getName = function() { + return this.m_name; + }; + + /** + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.CFloatFunc2.prototype.applyExact = function(x, y) { + return this.m_func(x, y); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FloatFunc2} + */ + glsBuiltinPrecisionTests.InfixOperator = function() { + glsBuiltinPrecisionTests.FloatFunc2.call(this); + }; + + glsBuiltinPrecisionTests.InfixOperator.prototype = Object.create(glsBuiltinPrecisionTests.FloatFunc2.prototype); + glsBuiltinPrecisionTests.InfixOperator.prototype.constructor = glsBuiltinPrecisionTests.InfixOperator; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.InfixOperator.prototype.getSymbol = function() { + glsBuiltinPrecisionTests.FloatFunc2.call(this); + return ''; + }; + + /** + * @param {Array} args + * @return {string} + */ + glsBuiltinPrecisionTests.InfixOperator.prototype.doPrint = function(args) { + return '(' + args[0] + ' ' + this.getSymbol() + ' ' + args[1] + ')'; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} x + * @param {number} y + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.InfixOperator.prototype.applyPoint = function(ctx, x, y) { + /** @type {number} */ var exact = this.applyExact(x, y); + + // Allow either representable number on both sides of the exact value, + // but require exactly representable values to be preserved. + return ctx.format.roundOut(new tcuInterval.Interval(exact), isFinite(x) && isFinite(y)); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} x + * @param {number} y + * @param {number} z + * @return {number} + */ + glsBuiltinPrecisionTests.InfixOperator.prototype.precision = function(ctx, x, y, z) { + return 0; + }; + + /** + * Signature + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + */ + glsBuiltinPrecisionTests.FloatFunc3 = function() { + /** @type {glsBuiltinPrecisionTests.Signature} */ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float', 'float'); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + }; + + glsBuiltinPrecisionTests.FloatFunc3.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype); + glsBuiltinPrecisionTests.FloatFunc3.prototype.constructor = glsBuiltinPrecisionTests.FloatFunc3; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} iargs + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc3.prototype.doApply = function(ctx, iargs) { + var a = /** @type {tcuInterval.Interval} */ (iargs.a); + var b = /** @type {tcuInterval.Interval} */ (iargs.b); + var c = /** @type {tcuInterval.Interval} */ (iargs.c); + var retVal = this.applyMonotone(ctx, a, b, c); + return retVal; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} xi + * @param {tcuInterval.Interval} yi + * @param {tcuInterval.Interval} zi + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc3.prototype.applyMonotone = function(ctx, xi, yi, zi) { + /** + * @param {number=} x + * @param {number=} y + * @param {number=} z + * @return {tcuInterval.Interval} + */ + var body = function(x, y, z) { + x = x || 0; + y = y || 0; + z = z || 0; + return this.applyPoint(ctx, x, y, z); + }; + var ret = tcuInterval.applyMonotone3(xi, yi, zi, body.bind(this)); + var retVal; + + ret.operatorOrAssignBinary(this.innerExtrema(ctx, xi, yi, zi)); + + ret.operatorAndAssignBinary(this.getCodomain().operatorOrBinary(new tcuInterval.Interval(NaN))); + + retVal = ctx.format.convert(ret); + return retVal; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} xi + * @param {tcuInterval.Interval} yi + * @param {tcuInterval.Interval} zi + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc3.prototype.innerExtrema = function(ctx, xi, yi, zi) { + return new tcuInterval.Interval(); // empty interval, i.e. no extrema + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} x + * @param {number} y + * @param {number} z + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc3.prototype.applyPoint = function(ctx, x, y, z) { + /** @type {number} */ var exact = this.applyExact(x, y, z); + /** @type {number} */ var prec = this.precision(ctx, exact, x, y, z); + + var a = new tcuInterval.Interval(exact); + var b = tcuInterval.withNumbers(-prec, prec); + return tcuInterval.Interval.operatorSum(a, b); + }; + + /** + * @param {number} x + * @param {number} y + * @param {number} z + * @return {number} + */ + glsBuiltinPrecisionTests.FloatFunc3.prototype.applyExact = function(x, y, z) { + throw new Error('Virtual function. Please override'); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {number} result + * @param {number} x + * @param {number} y + * @param {number} z + * @return {number} + */ + glsBuiltinPrecisionTests.FloatFunc3.prototype.precision = function(ctx, result, x, y, z) { + throw new Error('Virtual function. Please override'); + }; + + /** + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.FloatFunc3.prototype.getCodomain = function() { + return tcuInterval.unbounded(true); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FloatFunc3} + */ + glsBuiltinPrecisionTests.Clamp = function() { + glsBuiltinPrecisionTests.FloatFunc3.call(this); + }; + + setParentClass(glsBuiltinPrecisionTests.Clamp, glsBuiltinPrecisionTests.FloatFunc3); + + glsBuiltinPrecisionTests.Clamp.prototype.getName = function() { + return 'clamp'; + }; + + glsBuiltinPrecisionTests.Clamp.prototype.applyExact = function(x, minVal, maxVal) { + var debug = false; + var retVal; + + retVal = deMath.clamp(x, minVal, maxVal); + if (debug) { + console.log('> minVal: ' + minVal); + console.log('> maxVal: ' + maxVal); + console.log('> x: ' + x); + console.log('> ret: ' + retVal); + } + return retVal; + + }; + + glsBuiltinPrecisionTests.Clamp.prototype.precision = function(ctx, result, x, minVal, maxVal) { + var debug = false; + var retVal; + + retVal = minVal > maxVal ? NaN : 0; + + if (debug) { + console.log('precision> minVal: ' + minVal); + console.log('precision> maxVal: ' + maxVal); + console.log('precision> x: ' + x); + console.log('precision> ret: ' + retVal); + } + + return retVal; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.InfixOperator} + */ + glsBuiltinPrecisionTests.Add = function() { + glsBuiltinPrecisionTests.InfixOperator.call(this); + }; + + glsBuiltinPrecisionTests.Add.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype); + glsBuiltinPrecisionTests.Add.prototype.constructor = glsBuiltinPrecisionTests.Add; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Add.prototype.getName = function() { + return 'add'; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Add.prototype.getSymbol = function() { + return '+'; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} iargs + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.Add.prototype.doApply = function(ctx, iargs) { + var a = /** @type {tcuInterval.Interval} */ (iargs.a); + var b = /** @type {tcuInterval.Interval} */ (iargs.b); + // Fast-path for common case + if (iargs.a.isOrdinary() && iargs.b.isOrdinary()) { + /** type{tcuInterval.Interval} */ var ret; + ret = tcuInterval.setIntervalBounds( + function(dummy) { + return iargs.a.lo() + iargs.b.lo(); + }, + function(dummy) { + return iargs.a.hi() + iargs.b.hi(); + }); + return ctx.format.convert(ctx.format.roundOut(ret, true)); + } + return this.applyMonotone(ctx, a, b); + }; + + /** + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.Add.prototype.applyExact = function(x, y) { + return x + y; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.InfixOperator} + */ + glsBuiltinPrecisionTests.Sub = function() { + glsBuiltinPrecisionTests.InfixOperator.call(this); + }; + + glsBuiltinPrecisionTests.Sub.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype); + glsBuiltinPrecisionTests.Sub.prototype.constructor = glsBuiltinPrecisionTests.Sub; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Sub.prototype.getName = function() { + return 'sub'; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Sub.prototype.getSymbol = function() { + return '-'; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} iargs + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.Sub.prototype.doApply = function(ctx, iargs) { + var a = /** @type {tcuInterval.Interval} */ (iargs.a); + var b = /** @type {tcuInterval.Interval} */ (iargs.b); + var retVal; + + // Fast-path for common case + if (iargs.a.isOrdinary() && iargs.b.isOrdinary()) { + /** type{tcuInterval.Interval} */ var ret; + ret = tcuInterval.setIntervalBounds( + function(dummy) { + return iargs.a.lo() - iargs.b.hi(); + }, + function(dummy) { + return iargs.a.hi() - iargs.b.lo(); + }); + return ctx.format.convert(ctx.format.roundOut(ret, true)); + } + retVal = this.applyMonotone(ctx, a, b); + return retVal; + }; + + /** + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.Sub.prototype.applyExact = function(x, y) { + return x - y; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.InfixOperator} + */ + glsBuiltinPrecisionTests.Mul = function() { + glsBuiltinPrecisionTests.InfixOperator.call(this); + }; + + glsBuiltinPrecisionTests.Mul.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype); + glsBuiltinPrecisionTests.Mul.prototype.constructor = glsBuiltinPrecisionTests.Mul; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Mul.prototype.getName = function() { + return 'mul'; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Mul.prototype.getSymbol = function() { + return '*'; + }; + + glsBuiltinPrecisionTests.isNegative = function(n) { + return ((n = +n) || 1 / n) < 0; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} iargs + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.Mul.prototype.doApply = function(ctx, iargs) { + var a = /** @type {tcuInterval.Interval} */ (iargs.a); + var b = /** @type {tcuInterval.Interval} */ (iargs.b); + // Fast-path for common case + if (iargs.a.isOrdinary() && iargs.b.isOrdinary()) { + /** type{tcuInterval.Interval} */ var ret = new tcuInterval.Interval(); + if (glsBuiltinPrecisionTests.isNegative(a.hi())) { + a = a.operatorNegative(); + b = b.operatorNegative(); + } + if (a.lo() >= 0 && b.lo() >= 0) { + ret = tcuInterval.setIntervalBounds( + function(dummy) { + return iargs.a.lo() * iargs.b.lo(); + }, + function(dummy) { + return iargs.a.hi() * iargs.b.hi(); + }); + return ctx.format.convert(ctx.format.roundOut(ret, true)); + } + if (a.lo() >= 0 && b.hi() <= 0) { + ret = tcuInterval.setIntervalBounds( + function(dummy) { + return iargs.a.hi() * iargs.b.lo(); + }, + function(dummy) { + return iargs.a.lo() * iargs.b.hi(); + }); + return ctx.format.convert(ctx.format.roundOut(ret, true)); + } + } + + return this.applyMonotone(ctx, a, b); + }; + + /** + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.Mul.prototype.applyExact = function(x, y) { + return x * y; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} xi + * @param {tcuInterval.Interval} yi + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.Mul.prototype.innerExtrema = function(ctx, xi, yi) { + if (((xi.contains(tcuInterval.NEGATIVE_INFINITY) || xi.contains(tcuInterval.POSITIVE_INFINITY)) && yi.contains(tcuInterval.ZERO)) || + ((yi.contains(tcuInterval.NEGATIVE_INFINITY) || yi.contains(tcuInterval.POSITIVE_INFINITY)) && xi.contains(tcuInterval.ZERO))) + return new tcuInterval.Interval(NaN); + + return new tcuInterval.Interval(); // empty interval, i.e. no extrema + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.InfixOperator} + */ + glsBuiltinPrecisionTests.Div = function() { + glsBuiltinPrecisionTests.InfixOperator.call(this); + }; + + glsBuiltinPrecisionTests.Div.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype); + glsBuiltinPrecisionTests.Div.prototype.constructor = glsBuiltinPrecisionTests.Div; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Div.prototype.getName = function() { + return 'div'; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Div.prototype.getSymbol = function() { + return '/'; + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {tcuInterval.Interval} nom + * @param {tcuInterval.Interval} den + * @return {tcuInterval.Interval} + */ + glsBuiltinPrecisionTests.Div.prototype.innerExtrema = function(ctx, nom, den) { + var ret = new tcuInterval.Interval(); + if (den.contains(tcuInterval.ZERO)) { + if (nom.contains(tcuInterval.ZERO)) + ret.operatorOrAssignBinary(tcuInterval.NAN); + if (nom.lo() < 0 || nom.hi() > 0.0) + ret.operatorOrAssignBinary(tcuInterval.unbounded()); + } + + return ret; + }; + + glsBuiltinPrecisionTests.Div.prototype.precision = function(ctx, ret, nom, den) { + var fmt = ctx.format; + + // \todo [2014-03-05 lauri] Check that the limits in GLSL 3.10 are actually correct. + // For now, we assume that division's precision is 2.5 ULP when the value is within + // [2^MINEXP, 2^MAXEXP-1] + + if (den === 0) + return 0; // Result must be exactly inf + else if (deMath.deInBounds32(Math.abs(den), + deMath.deLdExp(1, fmt.getMinExp()), + deMath.deLdExp(1, fmt.getMaxExp() - 1))) + return fmt.ulp(ret, 2.5); + else + return Infinity; // Can be any number, but must be a number. + }; + + /** + * @param {number} x + * @param {number} y + * @return {number} + */ + glsBuiltinPrecisionTests.Div.prototype.applyExact = function(x, y) { + return x / y; + }; + + glsBuiltinPrecisionTests.Div.prototype.applyPoint = function(ctx, x, y) { + var ret = glsBuiltinPrecisionTests.FloatFunc2.prototype.applyPoint.call(this, ctx, x, y); + if (isFinite(x) && isFinite(y) && y != 0) { + var dst = ctx.format.convert(ret); + if (dst.contains(tcuInterval.NEGATIVE_INFINITY)) { + ret.operatorOrAssignBinary(-ctx.format.getMaxValue()); + } + if (dst.contains(tcuInterval.POSITIVE_INFINITY)) { + ret.operatorOrAssignBinary(+ctx.format.getMaxValue()); + } + } + return ret; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + */ + glsBuiltinPrecisionTests.CompWiseFunc = function(typename, Sig) { + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, Sig); + this.typename = typename; + }; + + setParentClass(glsBuiltinPrecisionTests.CompWiseFunc, glsBuiltinPrecisionTests.PrimitiveFunc); + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.CompWiseFunc.prototype.getName = function() { + return this.doGetScalarFunc().getName(); + }; + + /** + * @param {Array} args + * @return {string} + */ + glsBuiltinPrecisionTests.CompWiseFunc.prototype.doPrint = function(args) { + return this.doGetScalarFunc().print(args); + }; + + /** + * @return {glsBuiltinPrecisionTests.Func} + */ + glsBuiltinPrecisionTests.CompWiseFunc.prototype.doGetScalarFunc = function() { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CompWiseFunc} + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.CompMatFuncBase = function(rows, cols) { + var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols); + glsBuiltinPrecisionTests.CompWiseFunc.call(this, 'float', new glsBuiltinPrecisionTests.Signature(name, name, name)); + this.rows = rows; + this.cols = cols; + }; + + setParentClass(glsBuiltinPrecisionTests.CompMatFuncBase, glsBuiltinPrecisionTests.CompWiseFunc); + + glsBuiltinPrecisionTests.CompMatFuncBase.prototype.doApply = function(ctx, iargs) { + var ret = new tcuMatrix.Matrix(this.rows, this.cols); + var fun = this.doGetScalarFunc(); + + for (var row = 0; row < this.rows; ++row) + for (var col = 0; col < this.cols; ++col) + ret.set(row, col, fun.applyFunction(ctx, + iargs.a.get(row, col), + iargs.b.get(row, col))); + + return ret; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CompMatFuncBase} + * @param {function(new:glsBuiltinPrecisionTests.Func)} F + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.CompMatFunc = function(F, rows, cols) { + glsBuiltinPrecisionTests.CompMatFuncBase.call(this, rows, cols); + this.m_function = F; + }; + + setParentClass(glsBuiltinPrecisionTests.CompMatFunc, glsBuiltinPrecisionTests.CompMatFuncBase); + + /** + * @return {glsBuiltinPrecisionTests.Func} + */ + glsBuiltinPrecisionTests.CompMatFunc.prototype.doGetScalarFunc = function() { + return new this.m_function(); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Mul} + */ + glsBuiltinPrecisionTests.ScalarMatrixCompMult = function() { + glsBuiltinPrecisionTests.Mul.call(this); + }; + + setParentClass(glsBuiltinPrecisionTests.ScalarMatrixCompMult, glsBuiltinPrecisionTests.Mul); + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.ScalarMatrixCompMult.prototype.getName = function() { + return 'matrixCompMult'; + }; + + /** + * @param {Array} args + * @return {string} + */ + glsBuiltinPrecisionTests.ScalarMatrixCompMult.prototype.doPrint = function(args) { + return glsBuiltinPrecisionTests.Func.prototype.doPrint.call(this, args); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CompMatFunc} + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.MatrixCompMult = function(rows, cols) { + glsBuiltinPrecisionTests.CompMatFunc.call(this, glsBuiltinPrecisionTests.ScalarMatrixCompMult, rows, cols); + }; + + setParentClass(glsBuiltinPrecisionTests.MatrixCompMult, glsBuiltinPrecisionTests.CompMatFunc); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.OuterProduct = function(rows, cols) { + var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols); + var sig = new glsBuiltinPrecisionTests.Signature(name, 'vec' + rows, 'vec' + cols); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + this.rows = rows; + this.cols = cols; + }; + + setParentClass(glsBuiltinPrecisionTests.OuterProduct, glsBuiltinPrecisionTests.PrimitiveFunc); + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.OuterProduct.prototype.getName = function() { + return 'outerProduct'; + }; + + glsBuiltinPrecisionTests.OuterProduct.prototype.doApply = function(ctx, iargs) { + var ret = new tcuMatrix.Matrix(this.rows, this.cols); + var mul = new glsBuiltinPrecisionTests.Mul(); + + for (var row = 0; row < this.rows; ++row) { + for (var col = 0; col < this.cols; ++col) + ret.set(row, col, mul.applyFunction(ctx, iargs.a[row], iargs.b[col])); + } + + return ret; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.Transpose = function(rows, cols) { + var nameRet = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols); + var nameParam = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', cols, rows); + var sig = new glsBuiltinPrecisionTests.Signature(nameRet, nameParam); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + this.rows = rows; + this.cols = cols; + }; + + setParentClass(glsBuiltinPrecisionTests.Transpose, glsBuiltinPrecisionTests.PrimitiveFunc); + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.Transpose.prototype.getName = function() { + return 'transpose'; + }; + + glsBuiltinPrecisionTests.Transpose.prototype.doApply = function(ctx, iargs) { + var ret = new tcuMatrix.Matrix(this.rows, this.cols); + + for (var row = 0; row < this.rows; ++row) + for (var col = 0; col < this.cols; ++col) + ret.set(row, col, iargs.a.get(col, row)); + + return ret; + }; + + /** + * @constructor + * @param {*} In + */ + glsBuiltinPrecisionTests.Inputs = function(In) { + // vector in0; + // vector in1; + // vector in2; + // vector in3; + this.in0 = []; + this.in1 = []; + this.in2 = []; + this.in3 = []; + }; + + /** + * @constructor + * @param {number} size + * @param {*} Out + */ + glsBuiltinPrecisionTests.Outputs = function(size, Out) { + // Outputs (size_t size) : out0(size), out1(size) {} + this.out0 = []; + this.out1 = []; + }; + + /** + * @constructor + * @param {*} In + * @param {*} Out + */ + glsBuiltinPrecisionTests.Variables = function(In, Out) { + this.in0 = new glsBuiltinPrecisionTests.Variable(In.In0); + this.in1 = new glsBuiltinPrecisionTests.Variable(In.In1); + this.in2 = new glsBuiltinPrecisionTests.Variable(In.In2); + this.in3 = new glsBuiltinPrecisionTests.Variable(In.In3); + this.out0 = new glsBuiltinPrecisionTests.Variable(Out.Out0); + this.out1 = new glsBuiltinPrecisionTests.Variable(Out.Out1); + }; + + /** + * @constructor + * @param {function(new:glsBuiltinPrecisionTests.Func)} F + * @return {glsBuiltinPrecisionTests.GenFuncs} + */ + glsBuiltinPrecisionTests.makeVectorizedFuncs = function(F) { + return new glsBuiltinPrecisionTests.GenFuncs( + new F(), + new glsBuiltinPrecisionTests.VectorizedFunc(new F(), 2), + new glsBuiltinPrecisionTests.VectorizedFunc(new F(), 3), + new glsBuiltinPrecisionTests.VectorizedFunc(new F(), 4)); + }; + + /** + * @constructor + * @param {glsBuiltinPrecisionTests.Typename} typename + */ + glsBuiltinPrecisionTests.Sampling = function(typename) { + this.typename = typename; + }; + + /** + * @param {glsBuiltinPrecisionTests.Typename} typename + * @param {number=} size + * @return {glsBuiltinPrecisionTests.Sampling} + */ + glsBuiltinPrecisionTests.SamplingFactory = function(typename, size) { + if (size > 1) + return new glsBuiltinPrecisionTests.DefaultSamplingVector(typename, size); + switch (typename) { + case 'vec4' : return new glsBuiltinPrecisionTests.DefaultSamplingVector('float', 4); + case 'vec3' : return new glsBuiltinPrecisionTests.DefaultSamplingVector('float', 3); + case 'vec2' : return new glsBuiltinPrecisionTests.DefaultSamplingVector('float', 2); + case 'boolean' : return new glsBuiltinPrecisionTests.DefaultSamplingBool(typename); + case 'float' : return new glsBuiltinPrecisionTests.DefaultSamplingFloat(typename); + case 'mat2': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 2, 2); + case 'mat2x3': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 3, 2); + case 'mat2x4': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 4, 2); + case 'mat3x2': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 2, 3); + case 'mat3': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 3, 3); + case 'mat3x4': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 4, 3); + case 'mat4x2': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 2, 4); + case 'mat4x3': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 3, 4); + case 'mat4': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 4, 4); + case 'int' : return new glsBuiltinPrecisionTests.DefaultSamplingInt(typename); + } + return new glsBuiltinPrecisionTests.DefaultSamplingVoid(typename); + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {Array<*>} arr + */ + glsBuiltinPrecisionTests.Sampling.prototype.genFixeds = function(fmt, arr) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {gluShaderUtil.precision} precision + * @param {deRandom.Random} random + * @return {*} + */ + glsBuiltinPrecisionTests.Sampling.prototype.genRandom = function(fmt, precision, random) { + return 0; + }; + + /** + * @return {number} + */ + glsBuiltinPrecisionTests.Sampling.prototype.getWeight = function() { + return 0; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Sampling} + * @param {glsBuiltinPrecisionTests.Typename} typename + */ + glsBuiltinPrecisionTests.DefaultSamplingVoid = function(typename) { + glsBuiltinPrecisionTests.Sampling.call(this, typename); + }; + + glsBuiltinPrecisionTests.DefaultSamplingVoid.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype); + glsBuiltinPrecisionTests.DefaultSamplingVoid.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingVoid; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {Array} dst + */ + glsBuiltinPrecisionTests.DefaultSamplingVoid.prototype.genFixeds = function(fmt, dst) { + dst.push(NaN); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Sampling} + * @param {glsBuiltinPrecisionTests.Typename} typename + */ + glsBuiltinPrecisionTests.DefaultSamplingBool = function(typename) { + glsBuiltinPrecisionTests.Sampling.call(this, typename); + }; + + glsBuiltinPrecisionTests.DefaultSamplingBool.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype); + glsBuiltinPrecisionTests.DefaultSamplingBool.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingBool; + + /** + * @param {tcuFloatFormat.FloatFormat} fmt + * @param {Array} dst + */ + glsBuiltinPrecisionTests.DefaultSamplingBool.prototype.genFixeds = function(fmt, dst) { + dst.push(true); + dst.push(false); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Sampling} + * @param {glsBuiltinPrecisionTests.Typename} typename + */ + glsBuiltinPrecisionTests.DefaultSamplingInt = function(typename) { + glsBuiltinPrecisionTests.Sampling.call(this, typename); + }; + + glsBuiltinPrecisionTests.DefaultSamplingInt.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype); + glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingInt; + + glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.genRandom = function(fmt, prec, rnd) { + /** @type {number} */ var exp = rnd.getInt(0, this.getNumBits(prec) - 2); + /** @type {number} */ var sign = rnd.getBool() ? -1 : 1; + + return sign * rnd.getInt(0, 1 << exp); + }; + + glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.genFixeds = function(fmt, dst) { + dst.push(0); + dst.push(-1); + dst.push(1); + }; + + glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.getWeight = function() { + return 1.0; + }; + + /** + * @param {gluShaderUtil.precision} prec + * @return {number} + */ + glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.getNumBits = function(prec) { + switch (prec) { + case gluShaderUtil.precision.PRECISION_LOWP: return 8; + case gluShaderUtil.precision.PRECISION_MEDIUMP: return 16; + case gluShaderUtil.precision.PRECISION_HIGHP: return 32; + default: + throw new Error('Invalid precision: ' + prec); + } + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Sampling} + * @param {glsBuiltinPrecisionTests.Typename} typename + */ + glsBuiltinPrecisionTests.DefaultSamplingFloat = function(typename) { + glsBuiltinPrecisionTests.Sampling.call(this, typename); + }; + + glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype); + glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingFloat; + + glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype.genRandom = function(format, prec, rnd) { + /** type{number} */ var minExp = format.getMinExp(); + /** type{number} */ var maxExp = format.getMaxExp(); + /** type{boolean} */ var haveSubnormal = format.hasSubnormal() != tcuFloatFormat.YesNoMaybe.NO; + + // Choose exponent so that the cumulative distribution is cubic. + // This makes the probability distribution quadratic, with the peak centered on zero. + /** type{number} */ var minRoot = deMath.deCbrt(minExp - 0.5 - (haveSubnormal ? 1.0 : 0.0)); + /** type{number} */ var maxRoot = deMath.deCbrt(maxExp + 0.5); + /** type{number} */ var fractionBits = format.getFractionBits(); + /** type{number} */ var exp = deMath.rint(Math.pow(rnd.getFloat(minRoot, maxRoot), + 3.0)); + /** type{number} */ var base = 0.0; // integral power of two + /** type{number} */ var quantum = 0.0; // smallest representable difference in the binade + /** type{number} */ var significand = 0.0; // Significand. + + // DE_ASSERT(fractionBits < std::numeric_limits::digits); + + // Generate some occasional special numbers + switch (rnd.getInt(0, 64)) { + case 0: return 0; + case 1: return Number.POSITIVE_INFINITY; + case 2: return Number.NEGATIVE_INFINITY; + case 3: return NaN; + default: break; + } + + if (exp >= minExp) { + // Normal number + base = deMath.deFloatLdExp(1.0, exp); + quantum = deMath.deFloatLdExp(1.0, exp - fractionBits); + } else { + // Subnormal + base = 0.0; + quantum = deMath.deFloatLdExp(1.0, minExp - fractionBits); + } + + switch (rnd.getInt(0, 16)) { + // The highest number in this binade, significand is all bits one. + case 0: + significand = base - quantum; + break; + // Significand is one. + case 1: + significand = quantum; + break; + // Significand is zero. + case 2: + significand = 0.0; + break; + // Random (evenly distributed) significand. + default: { + /** type{number} */ var intFraction = rnd.getInt() & ((1 << fractionBits) - 1); + significand = intFraction * quantum; + } + } + + // Produce positive numbers more often than negative. + return (rnd.getInt(0, 3) == 0 ? -1.0 : 1.0) * (base + significand); + }; + + glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype.genFixeds = function(format, dst) { + /** @type {number} */ var minExp = format.getMinExp(); + /** @type {number} */ var maxExp = format.getMaxExp(); + /** @type {number} */ var fractionBits = format.getFractionBits(); + /** @type {number} */ var minQuantum = deMath.deFloatLdExp(1.0, minExp - fractionBits); + /** @type {number} */ var minNormalized = deMath.deFloatLdExp(1.0, minExp); + /** @type {number} */ var maxQuantum = deMath.deFloatLdExp(1.0, maxExp - fractionBits); + + // If unit testing is enabled, include exact numbers + if (enableUnittests) { + dst.push(0.2); + dst.push(0.5); + } + + // NaN + dst.push(NaN); + // Zero + dst.push(0.0); + + for (var sign = -1; sign <= 1; sign += 2) { + // Smallest subnormal + dst.push(sign * minQuantum); + + // Largest subnormal + dst.push(sign * (minNormalized - minQuantum)); + + // Smallest normalized + dst.push(sign * minNormalized); + + // Next smallest normalized + dst.push(sign * (minNormalized + minQuantum)); + + dst.push(sign * 0.5); + dst.push(sign * 1.0); + dst.push(sign * 2.0); + + // Largest number + dst.push(sign * (deMath.deFloatLdExp(1.0, maxExp) + + (deMath.deFloatLdExp(1.0, maxExp) - maxQuantum))); + + dst.push(sign * Number.POSITIVE_INFINITY); + } + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Sampling} + * @param {glsBuiltinPrecisionTests.Typename} typename + * @param {number} size + */ + glsBuiltinPrecisionTests.DefaultSamplingVector = function(typename, size) { + glsBuiltinPrecisionTests.Sampling.call(this, typename); + this.size = size; + }; + + glsBuiltinPrecisionTests.DefaultSamplingVector.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype); + glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingVector; + + glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.genRandom = function(fmt, prec, rnd) { + /** @type {Array<*>} */ var ret = []; + + for (var ndx = 0; ndx < this.size; ++ndx) + ret[ndx] = glsBuiltinPrecisionTests.SamplingFactory(this.typename).genRandom(fmt, prec, rnd); + + return ret; + }; + + glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.genFixeds = function(fmt, dst) { + /** @type {Array<*>} */ var scalars = []; + + glsBuiltinPrecisionTests.SamplingFactory(this.typename).genFixeds(fmt, scalars); + + for (var scalarNdx = 0; scalarNdx < scalars.length; ++scalarNdx) { + var value = []; + for (var i = 0; i < this.size; i++) + value[i] = scalars[scalarNdx]; + dst.push(value); + } + }; + + glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.getWeight = function() { + return Math.pow(glsBuiltinPrecisionTests.SamplingFactory(this.typename).getWeight(), this.size); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Sampling} + * @param {glsBuiltinPrecisionTests.Typename} typename + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.DefaultSamplingMatrix = function(typename, rows, cols) { + glsBuiltinPrecisionTests.Sampling.call(this, typename); + this.rows = rows; + this.cols = cols; + }; + + glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype); + glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingMatrix; + + glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.genRandom = function(fmt, prec, rnd) { + /** @type {tcuMatrix.Matrix} */ var ret = new tcuMatrix.Matrix(this.rows, this.cols); + var sampler = glsBuiltinPrecisionTests.SamplingFactory(this.typename); + + for (var rowNdx = 0; rowNdx < this.rows; ++rowNdx) + for (var colNdx = 0; colNdx < this.cols; ++colNdx) + ret.set(rowNdx, colNdx, sampler.genRandom(fmt, prec, rnd)); + + return ret; + }; + + glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.genFixeds = function(fmt, dst) { + /** @type {Array} */ var scalars = []; + + glsBuiltinPrecisionTests.SamplingFactory(this.typename).genFixeds(fmt, scalars); + + for (var scalarNdx = 0; scalarNdx < scalars.length; ++scalarNdx) + dst.push(new tcuMatrix.Matrix(this.rows, this.cols, scalars[scalarNdx])); + + if (this.cols == this.rows) { + var mat = new tcuMatrix.Matrix(this.rows, this.cols, 0); + var x = 1; + mat.set(0, 0, x); + for (var ndx = 0; ndx < this.cols; ++ndx) { + mat.set(this.cols - 1 - ndx, ndx, x); + x *= 2; + } + dst.push(mat); + } + }; + + glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.getWeight = function() { + return Math.pow(glsBuiltinPrecisionTests.SamplingFactory(this.typename).getWeight(), this.rows * this.cols); + }; + + /** + * @constructor + * @param {number=} size + * @param {glsBuiltinPrecisionTests.InTypes} In + */ + glsBuiltinPrecisionTests.Samplings = function(In, size) { + this.in0 = glsBuiltinPrecisionTests.SamplingFactory(In.In0, size); + this.in1 = glsBuiltinPrecisionTests.SamplingFactory(In.In1, size); + this.in2 = glsBuiltinPrecisionTests.SamplingFactory(In.In2, size); + this.in3 = glsBuiltinPrecisionTests.SamplingFactory(In.In3, size); + }; + + /** + * @param {glsBuiltinPrecisionTests.InTypes} In + * @param {number=} size + * @constructor + * @extends {glsBuiltinPrecisionTests.Samplings} + */ + glsBuiltinPrecisionTests.DefaultSamplings = function(In, size) { + glsBuiltinPrecisionTests.Samplings.call(this, In, size); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsBuiltinPrecisionTests.Context} context + * @param {string} name + * @param {string} extension + */ + glsBuiltinPrecisionTests.PrecisionCase = function(context, name, extension) { + /** @type {string} */ this.m_extension = extension === undefined ? '' : extension; + /** @type {glsBuiltinPrecisionTests.Context} */ this.m_ctx = context; + /** @type {*} */ this.m_status; + /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(1234); // (0xdeadbeefu + context.testContext.getCommandLine().getBaseSeed()) + tcuTestCase.DeqpTest.call(this, name, extension); + }; + + glsBuiltinPrecisionTests.PrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsBuiltinPrecisionTests.PrecisionCase.prototype.constructor = glsBuiltinPrecisionTests.PrecisionCase; + + /** + * @return {tcuFloatFormat.FloatFormat} + */ + glsBuiltinPrecisionTests.PrecisionCase.prototype.getFormat = function() { + return this.m_ctx.floatFormat; + }; + + /** + * Return an output value extracted from flat array + * @param {goog.NumberArray} output + * @param {number} index Index of the element to extract + * @param {*} reference Reference for type informaion + * @return {glsBuiltinPrecisionTests.Value} + */ + glsBuiltinPrecisionTests.getOutput = function(output, index, reference) { + if (reference instanceof Array) { + var ret = []; + var size = reference.length; + for (var i = 0; i < size; i++) + ret[i] = output[size * index + i]; + return ret; + } + if (reference instanceof tcuMatrix.Matrix) { + var ret = new tcuMatrix.Matrix(reference.rows, reference.cols); + var size = reference.rows * reference.cols; + for (var i = 0; i < reference.rows; i++) + for (var j = 0; j < reference.cols; j++) + ret.set(i, j, output[size * index + j * reference.rows + i]); + return ret; + } + + return output[index]; + }; + /** + * @param {glsBuiltinPrecisionTests.Variables} variables Variables + * @param {glsBuiltinPrecisionTests.Inputs} inputs Inputs + * @param {glsBuiltinPrecisionTests.Statement} stmt + */ + glsBuiltinPrecisionTests.PrecisionCase.prototype.testStatement = function(variables, inputs, stmt) { + /** @type {tcuFloatFormat.FloatFormat} */ var fmt = this.getFormat(); + /** @type {number} */ var inCount = glsBuiltinPrecisionTests.numInputs(this.In); + /** @type {number} */ var outCount = glsBuiltinPrecisionTests.numOutputs(this.Out); + /** @type {number} */ var numValues = (inCount > 0) ? inputs.in0.length : 1; + /** @type {tcuFloatFormat.FloatFormat} */ var highpFmt = this.m_ctx.highpFormat; + var outputs = []; + /** @type {number} */ var maxMsgs = 100; + /** @type {number} */ var numErrors = 0; + /** @type {glsShaderExecUtil.ShaderSpec} */ var spec = new glsShaderExecUtil.ShaderSpec(); + /** @type {glsBuiltinPrecisionTests.Environment} */ var env = new glsBuiltinPrecisionTests.Environment(); // Hoisted out of the inner loop for optimization. + + switch (inCount) { + case 4: DE_ASSERT(inputs.in3.length == numValues); + case 3: DE_ASSERT(inputs.in2.length == numValues); + case 2: DE_ASSERT(inputs.in1.length == numValues); + case 1: DE_ASSERT(inputs.in0.length == numValues); + default: break; + } + if (enableUnittests) + numValues = 2; + + // TODO: Fix logging + //Print out the statement and its definitions + // bufferedLogToConsole("Statement: " + stmt); + // var funcInfo = '' + // var funcs = {}; + // stmt.getUsedFuncs(funcs); + // for (var key in funcs) { + // var func = funcs[key]; + // funcInfo += func.printDefinition(); + // }; + // if (funcInfo.length > 0) + // bufferedLogToConsole('Reference definitions:' + funcInfo); + + // Initialize ShaderSpec from precision, variables and statement. + + spec.globalDeclarations = 'precision ' + gluShaderUtil.getPrecisionName(this.m_ctx.precision) + ' float;\n'; + + if (this.m_extension.length > 0) + spec.globalDeclarations += '#extension ' + this.m_extension + ' : require\n'; + + spec.inputs = []; + + switch (inCount) { + case 4: spec.inputs[3] = this.makeSymbol(variables.in3); + case 3: spec.inputs[2] = this.makeSymbol(variables.in2); + case 2: spec.inputs[1] = this.makeSymbol(variables.in1); + case 1: spec.inputs[0] = this.makeSymbol(variables.in0); + default: break; + } + + spec.outputs = []; + + switch (outCount) { + case 2: spec.outputs[1] = this.makeSymbol(variables.out1); + case 1: spec.outputs[0] = this.makeSymbol(variables.out0); + default: break; + } + + spec.source = stmt; + + if (enableUnittests == false) { + // Run the shader with inputs. + /** @type {glsShaderExecUtil.ShaderExecutor} */ + var executor = glsShaderExecUtil.createExecutor(this.m_ctx.shaderType, spec); + /** @type {Array<*>} */ var inputArr = + [ + tcuMatrixUtil.flatten(inputs.in0), tcuMatrixUtil.flatten(inputs.in1), tcuMatrixUtil.flatten(inputs.in2), tcuMatrixUtil.flatten(inputs.in3) + ]; + + // executor.log(log()); + if (!executor.isOk()) + testFailed('Shader compilation failed'); + + executor.useProgram(); + var outputArray = executor.execute(numValues, inputArr); + + switch (outCount) { + case 2: + outputs[1] = glsBuiltinPrecisionTests.cast(this.Out.Out1, outputArray[1]); + case 1: + outputs[0] = glsBuiltinPrecisionTests.cast(this.Out.Out0, outputArray[0]); + default: break; + } + } + + // Initialize environment with dummy values so we don't need to bind in inner loop. + + var in0 = new tcuInterval.Interval(); + var in1 = new tcuInterval.Interval(); + var in2 = new tcuInterval.Interval(); + var in3 = new tcuInterval.Interval(); + var reference0 = new tcuInterval.Interval(); + var reference1 = new tcuInterval.Interval(); + + env.bind(variables.in0, in0); + env.bind(variables.in1, in1); + env.bind(variables.in2, in2); + env.bind(variables.in3, in3); + env.bind(variables.out0, reference0); + env.bind(variables.out1, reference1); + + // For each input tuple, compute output reference interval and compare + // shader output to the reference. + for (var valueNdx = 0; valueNdx < numValues; valueNdx++) { + /** @type {boolean} */ var result = true; + var value0, value1; + var msg = ''; + + var in0_ = glsBuiltinPrecisionTests.convert(this.Arg0, fmt, glsBuiltinPrecisionTests.round(this.Arg0, fmt, inputs.in0[valueNdx])); + var in1_ = glsBuiltinPrecisionTests.convert(this.Arg1, fmt, glsBuiltinPrecisionTests.round(this.Arg1, fmt, inputs.in1[valueNdx])); + var in2_ = glsBuiltinPrecisionTests.convert(this.Arg2, fmt, glsBuiltinPrecisionTests.round(this.Arg2, fmt, inputs.in2[valueNdx])); + var in3_ = glsBuiltinPrecisionTests.convert(this.Arg3, fmt, glsBuiltinPrecisionTests.round(this.Arg3, fmt, inputs.in3[valueNdx])); + + env.bind(variables.in0, in0_); + env.bind(variables.in1, in1_); + env.bind(variables.in2, in2_); + env.bind(variables.in3, in3_); + + stmt.execute(new glsBuiltinPrecisionTests.EvalContext(fmt, this.m_ctx.precision, env)); + + switch (outCount) { + case 2: + reference1 = glsBuiltinPrecisionTests.convert(this.Out.Out1, highpFmt, env.lookup(variables.out1)); + if (enableUnittests) + result = referenceComparison(reference1, valueNdx + outCount - 1, this.m_ctx.floatFormat); + else { + value1 = glsBuiltinPrecisionTests.getOutput(outputs[1], valueNdx, reference1); + if (!glsBuiltinPrecisionTests.contains(this.Out.Out1, reference1, value1)) { + msg = 'Shader output 1 (' + value1 + ') is outside acceptable range: ' + reference1; + result = false; + } + } + case 1: + reference0 = glsBuiltinPrecisionTests.convert(this.Out.Out0, highpFmt, env.lookup(variables.out0)); + if (enableUnittests) + result = referenceComparison(reference0, valueNdx + outCount - 1, this.m_ctx.floatFormat); + else { + value0 = glsBuiltinPrecisionTests.getOutput(outputs[0], valueNdx, reference0); + if (!glsBuiltinPrecisionTests.contains(this.Out.Out0, reference0, value0)) { + msg = 'Shader output 0 (' + value0 + ') is outside acceptable range: ' + reference0; + result = false; + } + } + default: break; + } + + if (!result) + ++numErrors; + + if (!result && numErrors <= maxMsgs) { + /** @type {string} */ var builder = ''; + + builder += (result ? 'Passed' : 'Failed') + '\n' + msg + '\n sample:\n' + valueNdx; + + if (inCount > 0) { + builder += '\t' + variables.in0.getName() + ' = ' + + inputs.in0[valueNdx] + '\n'; + } + + if (inCount > 1) { + builder += '\t' + variables.in1.getName() + ' = ' + + inputs.in1[valueNdx] + '\n'; + } + + if (inCount > 2) { + builder += '\t' + variables.in2.getName() + ' = ' + + inputs.in2[valueNdx] + '\n'; + } + + if (inCount > 3) { + builder += '\t' + variables.in3.getName() + ' = ' + + inputs.in3[valueNdx] + '\n'; + } + + if (enableUnittests == false) { + if (outCount > 0) { + builder += '\t' + variables.out0.getName() + ' = ' + + value0 + '\n' + + '\tExpected range: ' + + reference0 + '\n'; + } + + if (outCount > 1) { + builder += '\t' + variables.out1.getName() + ' = ' + + value1 + '\n' + + '\tExpected range: ' + + reference1 + '\n'; + } + } + bufferedLogToConsole(builder); + } + } + + if (numErrors > maxMsgs) { + bufferedLogToConsole('(Skipped ' + (numErrors - maxMsgs) + ' messages.)'); + } + + if (numErrors == 0) { + testPassed('All ' + numValues + ' inputs passed.'); + } else { + testFailed('' + numErrors + '/' + numValues + ' inputs failed.'); + } + }; + + /** + * @param {glsBuiltinPrecisionTests.Variable} variable Variable + * @return {glsShaderExecUtil.Symbol} + */ + glsBuiltinPrecisionTests.PrecisionCase.prototype.makeSymbol = function(variable) { + var v = variable; + return new glsShaderExecUtil.Symbol(v.getName(), gluVarType.getVarTypeOf(v.typename, this.m_size, this.m_ctx.precision)); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Tuple4} + * @param {*} in0 + * @param {*} in1 + * @param {*} in2 + * @param {*} in3 + */ + glsBuiltinPrecisionTests.InTuple = function(in0, in1, in2, in3) { + glsBuiltinPrecisionTests.Tuple4.call(this, in0, in1, in2, in3); + }; + + glsBuiltinPrecisionTests.InTuple.prototype = Object.create(glsBuiltinPrecisionTests.Tuple4.prototype); + glsBuiltinPrecisionTests.InTuple.prototype.constructor = glsBuiltinPrecisionTests.InTuple; + + /** + * @param {*} In + * @param {glsBuiltinPrecisionTests.Samplings} samplings Samplings + * @param {tcuFloatFormat.FloatFormat} floatFormat + * @param {gluShaderUtil.precision} intPrecision + * @param {number} numSamples + * @param {deRandom.Random} rnd + * @return {glsBuiltinPrecisionTests.Inputs} + */ + glsBuiltinPrecisionTests.generateInputs = function(In, samplings, floatFormat, intPrecision, numSamples, rnd) { + /*Inputs*/ var ret = new glsBuiltinPrecisionTests.Inputs(In); + /*Inputs*/ var fixedInputs = new glsBuiltinPrecisionTests.Inputs(In); + // set, InputLess > > seenInputs; + /** @type {Array} */ + var seenInputs = []; + + samplings.in0.genFixeds(floatFormat, fixedInputs.in0); + samplings.in1.genFixeds(floatFormat, fixedInputs.in1); + samplings.in2.genFixeds(floatFormat, fixedInputs.in2); + samplings.in3.genFixeds(floatFormat, fixedInputs.in3); + + for (var ndx0 = 0; ndx0 < fixedInputs.in0.length; ++ndx0) { + for (var ndx1 = 0; ndx1 < fixedInputs.in1.length; ++ndx1) { + for (var ndx2 = 0; ndx2 < fixedInputs.in2.length; ++ndx2) { + for (var ndx3 = 0; ndx3 < fixedInputs.in3.length; ++ndx3) { + var tuple = new glsBuiltinPrecisionTests.InTuple(fixedInputs.in0[ndx0], + fixedInputs.in1[ndx1], + fixedInputs.in2[ndx2], + fixedInputs.in3[ndx3]); + + seenInputs.push(tuple); + ret.in0.push(tuple.a); + ret.in1.push(tuple.b); + ret.in2.push(tuple.c); + ret.in3.push(tuple.d); + } + } + } + } + + for (var ndx = 0; ndx < numSamples; ++ndx) { + var in0 = samplings.in0.genRandom(floatFormat, intPrecision, rnd); + var in1 = samplings.in1.genRandom(floatFormat, intPrecision, rnd); + var in2 = samplings.in2.genRandom(floatFormat, intPrecision, rnd); + var in3 = samplings.in3.genRandom(floatFormat, intPrecision, rnd); + var tuple = new glsBuiltinPrecisionTests.InTuple(in0, in1, in2, in3); + + // if (de::contains(seenInputs, tuple)) + // continue; + + seenInputs.push(tuple); + ret.in0.push(in0); + ret.in1.push(in1); + ret.in2.push(in2); + ret.in3.push(in3); + } + + return ret; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrecisionCase} + * @param {string} name + * @param {glsBuiltinPrecisionTests.FuncBase} func + */ + glsBuiltinPrecisionTests.FuncCaseBase = function(context, name, func) { + glsBuiltinPrecisionTests.PrecisionCase.call(this, context, name, func.getRequiredExtension()); + }; + + glsBuiltinPrecisionTests.FuncCaseBase.prototype = Object.create(glsBuiltinPrecisionTests.PrecisionCase.prototype); + glsBuiltinPrecisionTests.FuncCaseBase.prototype.constructor = glsBuiltinPrecisionTests.FuncCaseBase; + + glsBuiltinPrecisionTests.FuncCaseBase.prototype.iterate = function() { + + assertMsgOptions(!(this.m_extension !== undefined && this.m_extension.trim() !== '') && + !sglrGLContext.isExtensionSupported(gl, this.m_extension), + 'Unsupported extension: ' + this.m_extension, false, true); + + this.runTest(); + + // m_status.setTestContextResult(m_testCtx); + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FuncCaseBase} + * @param {glsBuiltinPrecisionTests.Context} context + * @param {string} name + * @param {glsBuiltinPrecisionTests.Func} func + */ + glsBuiltinPrecisionTests.InOutFuncCase = function(context, name, func) { + glsBuiltinPrecisionTests.FuncCaseBase.call(this, context, name, func); + this.Sig = func.Sig; + this.m_func = func; + this.Ret = func.Sig.Ret; + this.Arg0 = func.Sig.Arg0; + this.Arg1 = func.Sig.Arg1; + this.Arg2 = func.Sig.Arg2; + this.Arg3 = func.Sig.Arg3; + this.In = new glsBuiltinPrecisionTests.InTypes(this.Arg0, this.Arg2, this.Arg3); + this.Out = new glsBuiltinPrecisionTests.OutTypes(this.Ret, this.Arg1); + this.m_size = this.m_func.m_size; + }; + + glsBuiltinPrecisionTests.InOutFuncCase.prototype = Object.create(glsBuiltinPrecisionTests.FuncCaseBase.prototype); + glsBuiltinPrecisionTests.InOutFuncCase.prototype.constructor = glsBuiltinPrecisionTests.InOutFuncCase; + + /** + * Samplings + * @return {glsBuiltinPrecisionTests.Samplings} + */ + glsBuiltinPrecisionTests.InOutFuncCase.prototype.getSamplings = function() { + return new glsBuiltinPrecisionTests.DefaultSamplings(this.In, this.m_size); + }; + + /** + * @param {glsBuiltinPrecisionTests.Signature} Sig_ + */ + glsBuiltinPrecisionTests.InOutFuncCase.prototype.runTest = function(Sig_) { + /** @type {glsBuiltinPrecisionTests.Inputs} */ var inputs = (glsBuiltinPrecisionTests.generateInputs( + this.In, + this.getSamplings(), + this.m_ctx.floatFormat, + this.m_ctx.precision, + this.m_ctx.numRandoms, + this.m_rnd)); + + var variables = new glsBuiltinPrecisionTests.Variables(this.In, this.Out); + // Variables variables; + // + variables.out0 = new glsBuiltinPrecisionTests.Variable(this.Out.Out0, 'out0'); + variables.out1 = new glsBuiltinPrecisionTests.Variable(this.Arg1, 'out1'); + variables.in0 = new glsBuiltinPrecisionTests.Variable(this.Arg0, 'in0'); + variables.in1 = new glsBuiltinPrecisionTests.Variable(this.Arg2, 'in1'); + variables.in2 = new glsBuiltinPrecisionTests.Variable(this.Arg3, 'in2'); + variables.in3 = new glsBuiltinPrecisionTests.Variable('void', 'in3'); + + var expr = glsBuiltinPrecisionTests.applyVar(this.m_func, + variables.in0, variables.out1, + variables.in1, variables.in2); + var stmt = glsBuiltinPrecisionTests.variableAssignment(variables.out0, expr); + + this.testStatement(variables, inputs, stmt); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FuncCaseBase} + * @param {glsBuiltinPrecisionTests.Context} context + * @param {string} name + * @param {glsBuiltinPrecisionTests.Func} func + */ + glsBuiltinPrecisionTests.FuncCase = function(context, name, func) { + glsBuiltinPrecisionTests.FuncCaseBase.call(this, context, name, func); + this.Sig = func.Sig; + this.m_func = func; + this.Ret = func.Sig.Ret; + this.Arg0 = func.Sig.Arg0; + this.Arg1 = func.Sig.Arg1; + this.Arg2 = func.Sig.Arg2; + this.Arg3 = func.Sig.Arg3; + this.In = new glsBuiltinPrecisionTests.InTypes(this.Arg0, this.Arg1, this.Arg2, this.Arg3); + this.Out = new glsBuiltinPrecisionTests.OutTypes(this.Ret); + this.m_size = this.m_func.m_size; + }; + + glsBuiltinPrecisionTests.FuncCase.prototype = Object.create(glsBuiltinPrecisionTests.FuncCaseBase.prototype); + glsBuiltinPrecisionTests.FuncCase.prototype.constructor = glsBuiltinPrecisionTests.FuncCase; + + /** + * Samplings + * @return {glsBuiltinPrecisionTests.Samplings} + */ + glsBuiltinPrecisionTests.FuncCase.prototype.getSamplings = function() { + return new glsBuiltinPrecisionTests.DefaultSamplings(this.In, this.m_size); + }; + + /** + * @param {glsBuiltinPrecisionTests.Signature} Sig_ + */ + glsBuiltinPrecisionTests.FuncCase.prototype.runTest = function(Sig_) { + /** @type {glsBuiltinPrecisionTests.Inputs} */ var inputs = (glsBuiltinPrecisionTests.generateInputs( + this.In, + this.getSamplings(), + this.m_ctx.floatFormat, + this.m_ctx.precision, + this.m_ctx.numRandoms, + this.m_rnd)); + + var variables = new glsBuiltinPrecisionTests.Variables(this.In, this.Out); + // Variables variables; + // + variables.out0 = new glsBuiltinPrecisionTests.Variable(this.Ret, 'out0'); + variables.out1 = new glsBuiltinPrecisionTests.Variable('void', 'out1'); + variables.in0 = new glsBuiltinPrecisionTests.Variable(this.Arg0, 'in0'); + variables.in1 = new glsBuiltinPrecisionTests.Variable(this.Arg1, 'in1'); + variables.in2 = new glsBuiltinPrecisionTests.Variable(this.Arg2, 'in2'); + variables.in3 = new glsBuiltinPrecisionTests.Variable(this.Arg3, 'in3'); + + var expr = glsBuiltinPrecisionTests.applyVar(this.m_func, + variables.in0, variables.in1, + variables.in2, variables.in3); + var stmt = glsBuiltinPrecisionTests.variableAssignment(variables.out0, expr); + + this.testStatement(variables, inputs, stmt); + }; + + /** + * @param {glsBuiltinPrecisionTests.Func} func + * @param {glsBuiltinPrecisionTests.Variable} arg0 + * @param {glsBuiltinPrecisionTests.Variable} arg1 + * @param {glsBuiltinPrecisionTests.Variable} arg2 + * @param {glsBuiltinPrecisionTests.Variable} arg3 + * @return {glsBuiltinPrecisionTests.ApplyVar} + */ + glsBuiltinPrecisionTests.applyVar = function(func, arg0, arg1, arg2, arg3) { + return new glsBuiltinPrecisionTests.ApplyVar(func.Sig, func, arg0, arg1, arg2, arg3); + }; + + /** + * @param {glsBuiltinPrecisionTests.Variable} variable + * @param {glsBuiltinPrecisionTests.ApplyVar} value + * @param {boolean} isDeclaration + */ + glsBuiltinPrecisionTests.variableStatement = function(variable, value, isDeclaration) { + return new glsBuiltinPrecisionTests.VariableStatement(variable, value, isDeclaration); + }; + + /** + * @param {glsBuiltinPrecisionTests.Variable} variable + * @param {glsBuiltinPrecisionTests.ApplyVar} value + */ + glsBuiltinPrecisionTests.variableAssignment = function(variable, value) { + return glsBuiltinPrecisionTests.variableStatement(variable, value, false); + }; + + /** + * @constructor + */ + glsBuiltinPrecisionTests.CaseFactories = function() {}; + + /** + * @return {Array} + */ + glsBuiltinPrecisionTests.CaseFactories.prototype.getFactories = function() {}; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CaseFactories} + */ + glsBuiltinPrecisionTests.BuiltinFuncs = function() { + /** @type {Array} */ this.m_factories = []; + }; + + glsBuiltinPrecisionTests.BuiltinFuncs.prototype = Object.create(glsBuiltinPrecisionTests.CaseFactories.prototype); + glsBuiltinPrecisionTests.BuiltinFuncs.prototype.constructor = glsBuiltinPrecisionTests.BuiltinFuncs; + + /** + * @return {Array} + */ + glsBuiltinPrecisionTests.BuiltinFuncs.prototype.getFactories = function() { + return this.m_factories.slice(); + }; + + /** + * @param {glsBuiltinPrecisionTests.CaseFactory} fact + */ + glsBuiltinPrecisionTests.BuiltinFuncs.prototype.addFactory = function(fact) { + this.m_factories.push(fact); + }; + + /** + * @param {glsBuiltinPrecisionTests.Context} context + * @param {string} name + * @param {glsBuiltinPrecisionTests.Func} func + * @return {glsBuiltinPrecisionTests.PrecisionCase} + */ + glsBuiltinPrecisionTests.createFuncCase = function(context, name, func) { + switch (func.getOutParamIndex()) { + case -1: + return new glsBuiltinPrecisionTests.FuncCase(context, name, func); + case 1: + return new glsBuiltinPrecisionTests.InOutFuncCase(context, name, func); + default: + throw new Error(!'Impossible'); + } + }; + + /** + * @constructor + */ + glsBuiltinPrecisionTests.CaseFactory = function() {}; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.CaseFactory.prototype.getName = function() { + return ''; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.CaseFactory.prototype.getDesc = function() { + return ''; + }; + + /** + * @param {glsBuiltinPrecisionTests.Context} ctx + */ + glsBuiltinPrecisionTests.CaseFactory.prototype.createCase = function(ctx) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CaseFactory} + * @param {glsBuiltinPrecisionTests.Func} func + */ + glsBuiltinPrecisionTests.SimpleFuncCaseFactory = function(func) { + glsBuiltinPrecisionTests.CaseFactory.call(this); + this.m_func = func; + }; + + setParentClass(glsBuiltinPrecisionTests.SimpleFuncCaseFactory, glsBuiltinPrecisionTests.CaseFactory); + + glsBuiltinPrecisionTests.SimpleFuncCaseFactory.prototype.getName = function() { + return this.m_func.getName().toLowerCase(); + }; + + glsBuiltinPrecisionTests.SimpleFuncCaseFactory.prototype.getDesc = function() { + return "Function '" + this.getName() + "'"; + }; + + glsBuiltinPrecisionTests.SimpleFuncCaseFactory.prototype.createCase = function(ctx) { + return glsBuiltinPrecisionTests.createFuncCase(ctx, ctx.name, this.m_func); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CaseFactory} + */ + glsBuiltinPrecisionTests.FuncCaseFactory = function() { + glsBuiltinPrecisionTests.CaseFactory.call(this); + }; + + setParentClass(glsBuiltinPrecisionTests.FuncCaseFactory, glsBuiltinPrecisionTests.CaseFactory); + + glsBuiltinPrecisionTests.FuncCaseFactory.prototype.getFunc = function() { + throw new Error('Virtual function. Please override.'); + }; + + glsBuiltinPrecisionTests.FuncCaseFactory.prototype.getName = function() { + return this.getFunc().getName().toLowerCase(); + }; + + glsBuiltinPrecisionTests.FuncCaseFactory.prototype.getDesc = function() { + return "Function '" + this.getFunc().getName() + "'"; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FuncCaseFactory} + */ + glsBuiltinPrecisionTests.TemplateFuncCaseFactory = function(genF) { + glsBuiltinPrecisionTests.FuncCaseFactory.call(this); + this.m_genF = genF; + }; + + setParentClass(glsBuiltinPrecisionTests.TemplateFuncCaseFactory, glsBuiltinPrecisionTests.FuncCaseFactory); + + glsBuiltinPrecisionTests.TemplateFuncCaseFactory.prototype.getFunc = function() { + return new this.m_genF(1); + }; + + /** + * @param {glsBuiltinPrecisionTests.Context} ctx + */ + glsBuiltinPrecisionTests.TemplateFuncCaseFactory.prototype.createCase = function(ctx) { + var group = tcuTestCase.newTest(ctx.name, ctx.name); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'scalar', new this.m_genF(1))); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec2', new this.m_genF(2))); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec3', new this.m_genF(3))); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec4', new this.m_genF(4))); + + return group; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FuncCaseFactory} + */ + glsBuiltinPrecisionTests.MatrixFuncCaseFactory = function(genF) { + glsBuiltinPrecisionTests.FuncCaseFactory.call(this); + this.m_genF = genF; + }; + + setParentClass(glsBuiltinPrecisionTests.MatrixFuncCaseFactory, glsBuiltinPrecisionTests.FuncCaseFactory); + + glsBuiltinPrecisionTests.MatrixFuncCaseFactory.prototype.getFunc = function() { + return new this.m_genF(2, 2); + }; + + /** + * @param {glsBuiltinPrecisionTests.Context} ctx + */ + glsBuiltinPrecisionTests.MatrixFuncCaseFactory.prototype.createCase = function(ctx) { + var group = tcuTestCase.newTest(ctx.name, ctx.name); + this.addCase(ctx, group, 2, 2); + this.addCase(ctx, group, 3, 2); + this.addCase(ctx, group, 4, 2); + this.addCase(ctx, group, 2, 3); + this.addCase(ctx, group, 3, 3); + this.addCase(ctx, group, 4, 3); + this.addCase(ctx, group, 2, 4); + this.addCase(ctx, group, 3, 4); + this.addCase(ctx, group, 4, 4); + + return group; + }; + + /** + * @param {glsBuiltinPrecisionTests.Context} ctx + * @param {tcuTestCase.DeqpTest} group + * @param {number} rows + * @param {number} cols + */ + glsBuiltinPrecisionTests.MatrixFuncCaseFactory.prototype.addCase = function(ctx, group, rows, cols) { + var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, name, new this.m_genF(rows, cols))); + }; + + glsBuiltinPrecisionTests.dataTypeNameOfMatrix = function(typename, rows, cols) { + switch (typename) { + case 'float': + if (rows === cols) + return 'mat' + rows; + else + return 'mat' + cols + 'x' + rows; + } + throw new Error('Invalid arguments (' + typename + ', ' + rows + ', ' + cols + ')'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.FuncCaseFactory} + */ + glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory = function(genF) { + glsBuiltinPrecisionTests.FuncCaseFactory.call(this); + this.m_genF = genF; + }; + + setParentClass(glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory, glsBuiltinPrecisionTests.FuncCaseFactory); + + glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory.prototype.getFunc = function() { + return new this.m_genF(2); + }; + + /** + * @param {glsBuiltinPrecisionTests.Context} ctx + */ + glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory.prototype.createCase = function(ctx) { + var group = tcuTestCase.newTest(ctx.name, ctx.name); + + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'mat2', new this.m_genF(2))); + return group; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + * @param {glsBuiltinPrecisionTests.Func} scalarFunc + * @param {number=} size + */ + glsBuiltinPrecisionTests.GenFunc = function(scalarFunc, size) { + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, scalarFunc.Sig); + this.m_func = scalarFunc; + this.m_size = size; + }; + + glsBuiltinPrecisionTests.GenFunc.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype); + glsBuiltinPrecisionTests.GenFunc.prototype.constructor = glsBuiltinPrecisionTests.GenFunc; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.GenFunc.prototype.getName = function() { + return this.m_func.getName(); + }; + + /** + * @return {number} + */ + glsBuiltinPrecisionTests.GenFunc.prototype.getOutParamIndex = function() { + return this.m_func.getOutParamIndex(); + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.GenFunc.prototype.getRequiredExtension = function() { + return this.m_func.getRequiredExtension(); + }; + + /** + * @param {Array} args + */ + glsBuiltinPrecisionTests.GenFunc.prototype.doPrint = function(args) { + return this.m_func.print(args); + }; + + /** + * @param {glsBuiltinPrecisionTests.EvalContext} ctx + * @param {glsBuiltinPrecisionTests.Tuple4} iargs + * @return {*} + */ + glsBuiltinPrecisionTests.GenFunc.prototype.doApply = function(ctx, iargs) { + /** @type {Array<*>} */ var ret = []; + + if (this.m_size > 1) { + for (var ndx = 0; ndx < this.m_size; ++ndx) { + var a = iargs.a === undefined ? undefined : iargs.a[ndx]; + var b = iargs.b === undefined ? undefined : iargs.b[ndx]; + var c = iargs.c === undefined ? undefined : iargs.c[ndx]; + var d = iargs.d === undefined ? undefined : iargs.d[ndx]; + ret[ndx] = this.m_func.applyFunction(ctx, a, b, c, d); + } + } else + ret[0] = this.m_func.applyFunction(ctx, iargs.a, iargs.b, iargs.c, iargs.d); + + return ret; + }; + + /** + * @param {glsBuiltinPrecisionTests.FuncSet} dst + */ + glsBuiltinPrecisionTests.GenFunc.prototype.doGetUsedFuncs = function(dst) { + this.m_func.getUsedFuncs(dst); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.GenFunc} + * @param {glsBuiltinPrecisionTests.Func} func + * @param {number} size + */ + glsBuiltinPrecisionTests.VectorizedFunc = function(func, size) { + glsBuiltinPrecisionTests.GenFunc.call(this, func, size); + }; + + glsBuiltinPrecisionTests.VectorizedFunc.prototype = Object.create(glsBuiltinPrecisionTests.GenFunc.prototype); + glsBuiltinPrecisionTests.VectorizedFunc.prototype.constructor = glsBuiltinPrecisionTests.VectorizedFunc; + + /** + * @constructor + * @param {glsBuiltinPrecisionTests.Func} func_ + * @param {glsBuiltinPrecisionTests.GenFunc} func2_ + * @param {glsBuiltinPrecisionTests.GenFunc} func3_ + * @param {glsBuiltinPrecisionTests.GenFunc} func4_ + */ + glsBuiltinPrecisionTests.GenFuncs = function(func_, func2_, func3_, func4_) { + this.func = func_; + this.func2 = func2_; + this.func3 = func3_; + this.func4 = func4_; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CaseFactory} + * @param {glsBuiltinPrecisionTests.GenFuncs} funcs + * @param {string} name + */ + glsBuiltinPrecisionTests.GenFuncCaseFactory = function(funcs, name) { + glsBuiltinPrecisionTests.CaseFactory.call(this); + this.m_funcs = funcs; + this.m_name = name; + }; + + glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype = Object.create(glsBuiltinPrecisionTests.CaseFactory.prototype); + glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.constructor = glsBuiltinPrecisionTests.GenFuncCaseFactory; + + /** + * @param {glsBuiltinPrecisionTests.Context} ctx + * @return {tcuTestCase.DeqpTest} + */ + glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.createCase = function(ctx) { + /** @type {tcuTestCase.DeqpTest} */ + var group = tcuTestCase.newTest(ctx.name, ctx.name); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'scalar', this.m_funcs.func)); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec2', this.m_funcs.func2)); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec3', this.m_funcs.func3)); + group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec4', this.m_funcs.func4)); + + return group; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.getName = function() { + return this.m_name; + }; + + /** + * @return {string} + */ + glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.getDesc = function() { + return "Function '" + this.m_funcs.func.getName() + "'"; + }; + + /** + * @constructor + * @param {string} name_ + * @param {tcuFloatFormat.FloatFormat} floatFormat_ + * @param {tcuFloatFormat.FloatFormat} highpFormat_ + * @param {gluShaderUtil.precision} precision_ + * @param {gluShaderProgram.shaderType} shaderType_ + * @param {number} numRandoms_ + */ + glsBuiltinPrecisionTests.Context = function(name_, floatFormat_, highpFormat_, precision_, shaderType_, numRandoms_) { + /** @type {string} */ this.name = name_; + /** @type {tcuFloatFormat.FloatFormat} */ this.floatFormat = floatFormat_; + /** @type {tcuFloatFormat.FloatFormat} */ this.highpFormat = highpFormat_; + /** @type {gluShaderUtil.precision} */ this.precision = precision_; + /** @type {gluShaderProgram.shaderType} */ this.shaderType = shaderType_; + /** @type {number} */ this.numRandoms = numRandoms_; + }; + + /** + * @constructor + * @param {tcuFloatFormat.FloatFormat} highp_ + * @param {tcuFloatFormat.FloatFormat} mediump_ + * @param {tcuFloatFormat.FloatFormat} lowp_ + * @param {Array} shaderTypes_ + * @param {number} numRandoms_ + */ + glsBuiltinPrecisionTests.PrecisionTestContext = function(highp_, mediump_, lowp_, shaderTypes_, numRandoms_) { + /** @type {Array} */ this.shaderTypes = shaderTypes_; + /** @type {Array} */ this.formats = []; + this.formats[gluShaderUtil.precision.PRECISION_HIGHP] = highp_; + this.formats[gluShaderUtil.precision.PRECISION_MEDIUMP] = mediump_; + this.formats[gluShaderUtil.precision.PRECISION_LOWP] = lowp_; + /** @type {number} */ this.numRandoms = numRandoms_; + }; + + /** + * \brief Simple incremental counter. + * + * This is used to make sure that different ExpandContexts will not produce + * overlapping temporary names. + * @constructor + * + */ + glsBuiltinPrecisionTests.Counter = function() { + this.m_count = 0; + }; + + glsBuiltinPrecisionTests.Counter.prototype.get = function() { + return this.m_count++; + }; + + /** + * @constructor + */ + glsBuiltinPrecisionTests.ExpandContext = function(counter) { + this.m_counter = counter; + this.m_statements = []; + }; + + /** + * @param {string} typename + * @param {string} baseName + * @return {glsBuiltinPrecisionTests.Variable} + */ + glsBuiltinPrecisionTests.ExpandContext.prototype.genSym = function(typename, baseName) { + return new glsBuiltinPrecisionTests.Variable(typename, baseName + this.m_counter.get()); + }; + + glsBuiltinPrecisionTests.ExpandContext.prototype.addStatement = function(/*const StatementP&*/ stmt) { + this.m_statements.push(stmt); + }; + + glsBuiltinPrecisionTests.ExpandContext.prototype.getStatements = function() { + return this.m_statements; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Func} + * @param {glsBuiltinPrecisionTests.Signature} Sig_ template + */ + glsBuiltinPrecisionTests.DerivedFunc = function(Sig_) { + glsBuiltinPrecisionTests.Func.call(this, Sig_); + }; + + setParentClass(glsBuiltinPrecisionTests.DerivedFunc, glsBuiltinPrecisionTests.Func); + + glsBuiltinPrecisionTests.DerivedFunc.prototype.doPrintDefinition = function() { + var os = ''; + var paramNames = this.getParamNames(); + + this.initialize(); + + os += this.Ret + ' ' + this.getName() + + '('; + if (glsBuiltinPrecisionTests.isTypeValid(this.Arg0)) + os += this.Arg0 + ' ' + paramNames.a; + if (glsBuiltinPrecisionTests.isTypeValid(this.Arg1)) + os += ', ' + this.Arg1 + ' ' + paramNames.b; + if (glsBuiltinPrecisionTests.isTypeValid(this.Arg2)) + os += ', ' + this.Arg2 + ' ' + paramNames.c; + if (glsBuiltinPrecisionTests.isTypeValid(this.Arg3)) + os += ', ' + this.Arg3 + ' ' + paramNames.d; + os += ')\n{\n'; + + for (var ndx = 0; ndx < this.m_body.length; ++ndx) + os += this.m_body[ndx]; + os += 'return ' + this.m_ret + ';\n'; + os += '}\n'; + + return os; + }; + + glsBuiltinPrecisionTests.DerivedFunc.prototype.doApply = function(ctx, args) { + var funEnv = new glsBuiltinPrecisionTests.Environment(); + this.initialize(); + + funEnv.bind(this.m_var0, args.a); + funEnv.bind(this.m_var1, args.b); + funEnv.bind(this.m_var2, args.c); + funEnv.bind(this.m_var3, args.d); + + var funCtx = new glsBuiltinPrecisionTests.EvalContext(ctx.format, ctx.floatPrecision, funEnv, ctx.callDepth); + + for (var ndx = 0; ndx < this.m_body.length; ++ndx) + this.m_body[ndx].execute(funCtx); + + var ret = this.m_ret.evaluate(funCtx); + + // \todo [lauri] Store references instead of values in environment + args.a = funEnv.lookup(this.m_var0); + args.b = funEnv.lookup(this.m_var1); + args.c = funEnv.lookup(this.m_var2); + args.d = funEnv.lookup(this.m_var3); + + return ret; + }; + + glsBuiltinPrecisionTests.DerivedFunc.prototype.initialize = function() { + if (!this.m_ret) { + var paramNames = this.getParamNames(); + var symCounter = new glsBuiltinPrecisionTests.Counter(); + var ctx = new glsBuiltinPrecisionTests.ExpandContext(symCounter); + + this.m_var0 = new glsBuiltinPrecisionTests.Variable(this.Arg0, paramNames.a); + this.m_var1 = new glsBuiltinPrecisionTests.Variable(this.Arg1, paramNames.b); + this.m_var2 = new glsBuiltinPrecisionTests.Variable(this.Arg2, paramNames.c); + this.m_var3 = new glsBuiltinPrecisionTests.Variable(this.Arg3, paramNames.d); + var args = new glsBuiltinPrecisionTests.Tuple4(this.m_var0, + this.m_var1, this.m_var2, this.m_var3); + + this.m_ret = this.doExpand(ctx, args); + this.m_body = ctx.getStatements(); + } + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.Func} + * @param {glsBuiltinPrecisionTests.Signature} Sig_ template + */ + glsBuiltinPrecisionTests.Alternatives = function(Sig_) { + glsBuiltinPrecisionTests.Func.call(this, Sig_); + }; + + setParentClass(glsBuiltinPrecisionTests.Alternatives,glsBuiltinPrecisionTests.Func); + + glsBuiltinPrecisionTests.Alternatives.prototype.getName = function() { + return 'alternatives'; + }; + + glsBuiltinPrecisionTests.Alternatives.prototype.doPrintDefinition = function() {}; + + glsBuiltinPrecisionTests.Alternatives.prototype.doGetUsedFuncs = function(dst) {}; + + glsBuiltinPrecisionTests.Alternatives.prototype.doApply = function(ctx,args) { + return glsBuiltinPrecisionTests.union(this.Sig.Ret,args.a,args.b); + }; + + glsBuiltinPrecisionTests.Alternatives.prototype.doPrint = function(args) { + return '{' + args[0] + '|' + args[1] + '}'; + }; + + glsBuiltinPrecisionTests.sizeToName = function(size) { + switch (size) { + case 4: return 'vec4'; + case 3: return 'vec3'; + case 2: return 'vec2'; + } + return 'float'; + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Dot = function(size) { + var name = glsBuiltinPrecisionTests.sizeToName(size); + var sig = new glsBuiltinPrecisionTests.Signature('float', name, name); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = size; + }; + + setParentClass(glsBuiltinPrecisionTests.Dot, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Dot.prototype.getName = function() { + return 'dot'; + }; + + glsBuiltinPrecisionTests.Dot.prototype.doExpand = function(ctx, args) { + if (this.m_inputSize > 1) { + var val = app(new glsBuiltinPrecisionTests.Mul(), + new glsBuiltinPrecisionTests.VectorVariable(args.a, 0), new glsBuiltinPrecisionTests.VectorVariable(args.b, 0)); + for (var i = 1; i < this.m_inputSize; i++) { + var tmp = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Mul(), + new glsBuiltinPrecisionTests.VectorVariable(args.a, i), new glsBuiltinPrecisionTests.VectorVariable(args.b, i)); + val = app(new glsBuiltinPrecisionTests.Add(), val, tmp); + } + return val; + } else { + // args.a * args.b + var ret = app(new glsBuiltinPrecisionTests.Mul(), args.a, args.b); + return ret; + } + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Length = function(size) { + var name = glsBuiltinPrecisionTests.sizeToName(size); + var sig = new glsBuiltinPrecisionTests.Signature('float', name); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = size; + }; + + setParentClass(glsBuiltinPrecisionTests.Length, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Length.prototype.getName = function() { + return 'length'; + }; + + glsBuiltinPrecisionTests.Length.prototype.doExpand = function(ctx, args) { + //sqrt(dot(args.a, args.a)); + var v0 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), args.a, args.a); + var v1 = app(new glsBuiltinPrecisionTests.Sqrt(), v0); + return v1; + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Distance = function(size) { + var name = glsBuiltinPrecisionTests.sizeToName(size); + var sig = new glsBuiltinPrecisionTests.Signature('float', name, name); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = size; + }; + + setParentClass(glsBuiltinPrecisionTests.Distance, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Distance.prototype.getName = function() { + return 'distance'; + }; + + glsBuiltinPrecisionTests.Distance.prototype.doExpand = function(ctx, args) { + //length(args.a - args.b); + var v0 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), args.a, args.b); + var v1 = app(new glsBuiltinPrecisionTests.Length(this.m_inputSize), v0); + return v1; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Cross = function() { + var sig = new glsBuiltinPrecisionTests.Signature('vec3', 'vec3', 'vec3'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = 3; + }; + + setParentClass(glsBuiltinPrecisionTests.Cross, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Cross.prototype.getName = function() { + return 'cross'; + }; + + glsBuiltinPrecisionTests.Cross.prototype.doExpand = function(ctx, args) { + // vec3(x.a[1] * x.b[2] - x.b[1] * x.a[2], + // x.a[2] * x.b[0] - x.b[2] * x.a[0], + // x.a[0] * x.b[1] - x.b[0] * x.a[1]); + var a = [], b = []; + for (var i = 0; i < this.m_inputSize; i++) { + a[i] = new glsBuiltinPrecisionTests.VectorVariable(args.a, i); + b[i] = new glsBuiltinPrecisionTests.VectorVariable(args.b, i); + } + var v0 = app(new glsBuiltinPrecisionTests.Mul(), a[1], b[2]); + var v1 = app(new glsBuiltinPrecisionTests.Mul(), b[1], a[2]); + var v2 = app(new glsBuiltinPrecisionTests.Sub(), v0, v1); + + var v3 = app(new glsBuiltinPrecisionTests.Mul(), a[2], b[0]); + var v4 = app(new glsBuiltinPrecisionTests.Mul(), b[2], a[0]); + var v5 = app(new glsBuiltinPrecisionTests.Sub(), v3, v4); + + var v6 = app(new glsBuiltinPrecisionTests.Mul(), a[0], b[1]); + var v7 = app(new glsBuiltinPrecisionTests.Mul(), b[0], a[1]); + var v8 = app(new glsBuiltinPrecisionTests.Sub(), v6, v7); + + var v9 = app(new glsBuiltinPrecisionTests.GenVec(this.m_inputSize, true), v2, v5, v8); + return v9; + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Normalize = function(size) { + var name = glsBuiltinPrecisionTests.sizeToName(size); + var sig = new glsBuiltinPrecisionTests.Signature(name, name); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = size; + }; + + setParentClass(glsBuiltinPrecisionTests.Normalize, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Normalize.prototype.getName = function() { + return 'normalize'; + }; + + glsBuiltinPrecisionTests.Normalize.prototype.doExpand = function(ctx, args) { + //args.a / length(args.a); + var v0 = app(new glsBuiltinPrecisionTests.Length(this.m_inputSize), args.a); + var v1 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Div(), args.a, v0); + return v1; + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.FaceForward = function(size) { + var name = glsBuiltinPrecisionTests.sizeToName(size); + var sig = new glsBuiltinPrecisionTests.Signature(name, name, name, name); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = size; + this.typename = name; + }; + + setParentClass(glsBuiltinPrecisionTests.FaceForward, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.FaceForward.prototype.getName = function() { + return 'faceforward'; + }; + + glsBuiltinPrecisionTests.FaceForward.prototype.doExpand = function(ctx, args) { + //cond(dot(args.c, args.b) < constant(0.0f), args.a, -args.a); + var zero = new glsBuiltinPrecisionTests.Constant(0); + var v0 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Negate(), args.a); + var v1 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), args.c, args.b); + var v2 = app(new glsBuiltinPrecisionTests.LessThan('float'), v1, zero); + var v3 = app(new glsBuiltinPrecisionTests.Cond(this.typename), v2, args.a, v0); + return v3; + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Reflect = function(size) { + var name = glsBuiltinPrecisionTests.sizeToName(size); + var sig = new glsBuiltinPrecisionTests.Signature(name, name, name); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = size; + }; + + setParentClass(glsBuiltinPrecisionTests.Reflect, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Reflect.prototype.getName = function() { + return 'reflect'; + }; + + glsBuiltinPrecisionTests.Reflect.prototype.doExpand = function(ctx, args) { + //args.a - (args.b * dot(args.b, args.a) * constant(2.0f)); + var two = new glsBuiltinPrecisionTests.Constant(2); + var v0 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), args.b, args.a); + var v1 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), args.b, v0); + var v2 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), v1, two); + var v3 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), args.a, v2); + return v3; + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Refract = function(size) { + var name = glsBuiltinPrecisionTests.sizeToName(size); + var sig = new glsBuiltinPrecisionTests.Signature(name, name, name, 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + this.m_inputSize = size; + this.typename = name; + }; + + setParentClass(glsBuiltinPrecisionTests.Refract, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Refract.prototype.getName = function() { + return 'refract'; + }; + + glsBuiltinPrecisionTests.Refract.prototype.doExpand = function(ctx, args) { + var i = args.a; + var n = args.b; + var eta = args.c; + var zero = new glsBuiltinPrecisionTests.Constant(0); + var one = new glsBuiltinPrecisionTests.Constant(1); + // dotNI = dot(n, i) + var v0 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), n, i); + var dotNI = glsBuiltinPrecisionTests.bindExpression('float', 'dotNI', ctx, v0); + // k = 1 - eta * eta * (1 - dotNI * dotNI) + var v1 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), dotNI, dotNI); + var v2 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), one, v1); + var v3 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), eta, eta); + var v4 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), v3, v2); + var v5 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), one, v4); + var k = glsBuiltinPrecisionTests.bindExpression('float', 'k', ctx, v5); + + // i * eta - n * (eta * dotNI + sqrt(k)) + var v6 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), eta, dotNI); + var v7 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sqrt(), k); + var v8 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Add(), v6, v7); + var v9 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), n, v8); + var v10 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), i, eta); + var v11 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), v10, v9); + + var v12 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.LessThan('float'), k, zero); + + var zeroVector = app(new glsBuiltinPrecisionTests.GenVec(this.m_inputSize), zero); + var v13 = app(new glsBuiltinPrecisionTests.Cond(this.typename), v12, zeroVector, v11); + return v13; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Radians = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Radians, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Radians.prototype.getName = function() { + return 'radians'; + }; + + glsBuiltinPrecisionTests.Radians.prototype.doExpand = function(ctx, args) { + var val = app(new glsBuiltinPrecisionTests.Div(), + new glsBuiltinPrecisionTests.Constant(Math.PI), + new glsBuiltinPrecisionTests.Constant(180)); + return new glsBuiltinPrecisionTests.Apply('float', + new glsBuiltinPrecisionTests.Mul(), + val, + args.a); + + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Degrees = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Degrees, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Degrees.prototype.getName = function() { + return 'degrees'; + }; + + glsBuiltinPrecisionTests.Degrees.prototype.doExpand = function(ctx, args) { + var val = app(new glsBuiltinPrecisionTests.Div(), + new glsBuiltinPrecisionTests.Constant(180), + new glsBuiltinPrecisionTests.Constant(Math.PI)); + return new glsBuiltinPrecisionTests.Apply('float', + new glsBuiltinPrecisionTests.Mul(), + val, + args.a); + + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Sinh = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Sinh, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Sinh.prototype.getName = function() { + return 'sinh'; + }; + + glsBuiltinPrecisionTests.Sinh.prototype.doExpand = function(ctx, args) { + // (exp(x) - exp(-x)) / constant(2.0f) + var x = args.a; + var v0 = app(new glsBuiltinPrecisionTests.Exp(), x); + var v1 = app(new glsBuiltinPrecisionTests.Negate(), x); + var v2 = app(new glsBuiltinPrecisionTests.Exp(), v1); + var v3 = app(new glsBuiltinPrecisionTests.Sub(), v0, v2); + var v4 = new glsBuiltinPrecisionTests.Constant(2); + var v5 = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Div, v3, v4); + return v5; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Cosh = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Cosh, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Cosh.prototype.getName = function() { + return 'cosh'; + }; + + glsBuiltinPrecisionTests.Cosh.prototype.doExpand = function(ctx, args) { + // (exp(x) + exp(-x)) / constant(2.0f) + var x = args.a; + var v0 = app(new glsBuiltinPrecisionTests.Exp(), x); + var v1 = app(new glsBuiltinPrecisionTests.Negate(), x); + var v2 = app(new glsBuiltinPrecisionTests.Exp(), v1); + var v3 = app(new glsBuiltinPrecisionTests.Add(), v0, v2); + var v4 = new glsBuiltinPrecisionTests.Constant(2); + var v5 = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Div, v3, v4); + return v5; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Tanh = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Tanh, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Tanh.prototype.getName = function() { + return 'tanh'; + }; + + glsBuiltinPrecisionTests.Tanh.prototype.doExpand = function(ctx, args) { + // sinh(x) / cosh(x) + var x = args.a; + var v0 = app(new glsBuiltinPrecisionTests.Sinh(), x); + var v1 = app(new glsBuiltinPrecisionTests.Cosh(), x); + var v2 = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Div, v0, v1); + return v2; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.ASinh = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.ASinh, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.ASinh.prototype.getName = function() { + return 'asinh'; + }; + + glsBuiltinPrecisionTests.ASinh.prototype.doExpand = function(ctx, args) { + // log(x + sqrt(x * x + constant(1.0f))) + var x = args.a; + var v0 = app(new glsBuiltinPrecisionTests.Mul(), x, x); + var v1 = new glsBuiltinPrecisionTests.Constant(1); + var v2 = app(new glsBuiltinPrecisionTests.Add(), v0, v1); + var v3 = app(new glsBuiltinPrecisionTests.Sqrt(), v2); + var v4 = app(new glsBuiltinPrecisionTests.Add(), x, v3); + var v5 = app(new glsBuiltinPrecisionTests.Log(), v4); + return v5; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.ACosh = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.ACosh, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.ACosh.prototype.getName = function() { + return 'acosh'; + }; + + glsBuiltinPrecisionTests.ACosh.prototype.doExpand = function(ctx, args) { + // log(x + sqrt((x + constant(1.0f)) * (x - constant(1.0f)))) + var x = args.a; + var one = new glsBuiltinPrecisionTests.Constant(1); + var v0 = app(new glsBuiltinPrecisionTests.Add(), x, one); + var v1 = app(new glsBuiltinPrecisionTests.Sub(), x, one); + var v2 = app(new glsBuiltinPrecisionTests.Mul(), v0, v1); + var v3 = app(new glsBuiltinPrecisionTests.Sqrt(), v2); + var v4 = app(new glsBuiltinPrecisionTests.Add(), x, v3); + var v5 = app(new glsBuiltinPrecisionTests.Log(), v4); + return v5; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.ATanh = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.ATanh, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.ATanh.prototype.getName = function() { + return 'atanh'; + }; + + glsBuiltinPrecisionTests.ATanh.prototype.doExpand = function(ctx, args) { + // constant(0.5f) * log((constant(1.0f) + x) / (constant(1.0f) - x)) + var x = args.a; + var one = new glsBuiltinPrecisionTests.Constant(1); + var half = new glsBuiltinPrecisionTests.Constant(0.5); + var v0 = app(new glsBuiltinPrecisionTests.Add(), one, x); + var v1 = app(new glsBuiltinPrecisionTests.Sub(), one, x); + var v2 = app(new glsBuiltinPrecisionTests.Div(), v0, v1); + var v3 = app(new glsBuiltinPrecisionTests.Log(), v2); + var v4 = app(new glsBuiltinPrecisionTests.Mul(), half, v3); + return v4; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Sqrt = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Sqrt, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Sqrt.prototype.getName = function() { + return 'sqrt'; + }; + + glsBuiltinPrecisionTests.Sqrt.prototype.doExpand = function(ctx, args) { + // constant(1.0f) / app(x) + var x = args.a; + var one = new glsBuiltinPrecisionTests.Constant(1); + var v0 = app(new glsBuiltinPrecisionTests.InverseSqrt(), x); + var v1 = app(new glsBuiltinPrecisionTests.Div(), one, v0); + return v1; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Fract = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Fract, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Fract.prototype.getName = function() { + return 'fract'; + }; + + glsBuiltinPrecisionTests.Fract.prototype.doExpand = function(ctx, args) { + // x - floor(x) + var x = args.a; + var v0 = app(new glsBuiltinPrecisionTests.Floor(), x); + var v1 = app(new glsBuiltinPrecisionTests.Sub(), x, v0); + return v1; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Mod = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Mod, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Mod.prototype.getName = function() { + return 'mod'; + }; + + glsBuiltinPrecisionTests.Mod.prototype.doExpand = function(ctx, args) { + // x - y * floor(x/y) + var x = args.a; + var y = args.b; + var v0 = app(new glsBuiltinPrecisionTests.Div(), x, y); + var v1 = app(new glsBuiltinPrecisionTests.Floor(), v0); + var v2 = app(new glsBuiltinPrecisionTests.Mul(), y, v1); + var v3 = app(new glsBuiltinPrecisionTests.Sub(), x, v2); + return v3; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PrimitiveFunc} + */ + glsBuiltinPrecisionTests.Modf = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float'); + glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig); + }; + setParentClass(glsBuiltinPrecisionTests.Modf, glsBuiltinPrecisionTests.PrimitiveFunc); + + glsBuiltinPrecisionTests.Modf.prototype.getName = function() { + return 'modf'; + }; + + glsBuiltinPrecisionTests.Modf.prototype.doApply = function(ctx, iargs, variablenames) { + var intPart; + var func1 = function(x) { + intPart = Math.trunc(x); + return x - intPart; + }; + var func2 = function(x) { + return Math.trunc(x); + }; + + var fracIV = tcuInterval.applyMonotone1p(func1, iargs.a); + var wholeIV = tcuInterval.applyMonotone1p(func2, iargs.a); + + if (!iargs.a.isFinite()) { + // Behavior on modf(Inf) not well-defined, allow anything as a fractional part + // See Khronos bug 13907 + fracIV.operatorOrAssignBinary(tcuInterval.NAN); + } + + ctx.env.m_map[variablenames[1]] = wholeIV; + return fracIV; + }; + + glsBuiltinPrecisionTests.Modf.prototype.getOutParamIndex = function() { + return 1; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Mix = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Mix, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Mix.prototype.getName = function() { + return 'mix'; + }; + + glsBuiltinPrecisionTests.Mix.prototype.operation1 = function(ctx, args) { + // (x * (constant(1.0f) - a)) + y * a + var x = args.a; + var y = args.b; + var a = args.c; + var one = new glsBuiltinPrecisionTests.Constant(1); + var v0 = app(new glsBuiltinPrecisionTests.Sub(), one, a); + var v1 = app(new glsBuiltinPrecisionTests.Mul(), x, v0); + var v2 = app(new glsBuiltinPrecisionTests.Mul(), y, a); + var v3 = app(new glsBuiltinPrecisionTests.Add(), v1, v2); + return v3; + }; + + glsBuiltinPrecisionTests.Mix.prototype.operation2 = function(ctx, args) { + // x + (y - x) * a + var x = args.a; + var y = args.b; + var a = args.c; + var v0 = app(new glsBuiltinPrecisionTests.Sub(), y, x); + var v1 = app(new glsBuiltinPrecisionTests.Mul(), a, v0); + var v2 = app(new glsBuiltinPrecisionTests.Add(), x, v1); + return v2; + }; + + glsBuiltinPrecisionTests.Mix.prototype.doExpand = function(ctx, args){ + return app(new glsBuiltinPrecisionTests.Alternatives(this.Sig), this.operation1(ctx, args), this.operation2(ctx, args), new glsBuiltinPrecisionTests.Void(), new glsBuiltinPrecisionTests.Void()); + } + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.SmoothStep = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.SmoothStep, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.SmoothStep.prototype.getName = function() { + return 'smoothstep'; + }; + + glsBuiltinPrecisionTests.SmoothStep.prototype.doExpand = function(ctx, args) { + var edge0 = args.a; + var edge1 = args.b; + var x = args.c; + var zero = new glsBuiltinPrecisionTests.Constant(0); + var one = new glsBuiltinPrecisionTests.Constant(1); + //clamp((x - edge0) / (edge1 - edge0), constant(0.0f), constant(1.0f)); + var v0 = app(new glsBuiltinPrecisionTests.Sub(), x, edge0); + var v1 = app(new glsBuiltinPrecisionTests.Sub(), edge1, edge0); + var v2 = app(new glsBuiltinPrecisionTests.Div(), v0, v1); + var v3 = app(new glsBuiltinPrecisionTests.Clamp(), v2, zero, one); + var t = glsBuiltinPrecisionTests.bindExpression('float', 't', ctx, v3); + //(t * t * (constant(3.0f) - constant(2.0f) * t)) + var two = new glsBuiltinPrecisionTests.Constant(2); + var three = new glsBuiltinPrecisionTests.Constant(3); + var v4 = app(new glsBuiltinPrecisionTests.Mul(), v3, v3); + var v5 = app(new glsBuiltinPrecisionTests.Mul(), two, v3); + var v6 = app(new glsBuiltinPrecisionTests.Sub(), three, v5); + var v7 = app(new glsBuiltinPrecisionTests.Mul(), v4, v6); + return v7; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Pow = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Pow, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Pow.prototype.getName = function() { + return 'pow'; + }; + + glsBuiltinPrecisionTests.Pow.prototype.doExpand = function(ctx, args) { + // exp2(y * log2(x)) + var x = args.a; + var y = args.b; + var v0 = app(new glsBuiltinPrecisionTests.Log2(), x); + var v1 = app(new glsBuiltinPrecisionTests.Mul(), y, v0); + var v2 = app(new glsBuiltinPrecisionTests.Exp2(), v1); + return v2; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc1} + */ + glsBuiltinPrecisionTests.ExpFunc = function(name, func) { + glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func); + }; + + setParentClass(glsBuiltinPrecisionTests.ExpFunc, glsBuiltinPrecisionTests.CFloatFunc1); + + glsBuiltinPrecisionTests.ExpFunc.prototype.getCodomain = function() { + return tcuInterval.withNumbers(0, Infinity); + }; + + glsBuiltinPrecisionTests.ExpFunc.prototype.precision = function(ctx, ret, x) { + switch (ctx.floatPrecision) { + case gluShaderUtil.precision.PRECISION_HIGHP: + return ctx.format.ulp(ret, 3.0 + 2.0 * Math.abs(x)); + case gluShaderUtil.precision.PRECISION_MEDIUMP: + return ctx.format.ulp(ret, 2.0 + 2.0 * Math.abs(x)); + case gluShaderUtil.precision.PRECISION_LOWP: + return ctx.format.ulp(ret, 2.0); + default: + throw new Error(!'Impossible'); + } + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.ExpFunc} + */ + glsBuiltinPrecisionTests.Exp = function() { + glsBuiltinPrecisionTests.ExpFunc.call(this, 'exp', Math.exp); + }; + + setParentClass(glsBuiltinPrecisionTests.Exp, glsBuiltinPrecisionTests.ExpFunc); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.ExpFunc} + */ + glsBuiltinPrecisionTests.Exp2 = function() { + /** + * @param {number} x + * @return {number} + */ + var exp2 = function(x) { + return Math.exp(x * Math.LN2); + }; + glsBuiltinPrecisionTests.ExpFunc.call(this, 'exp2', exp2); + }; + + setParentClass(glsBuiltinPrecisionTests.Exp2, glsBuiltinPrecisionTests.ExpFunc); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc1} + */ + glsBuiltinPrecisionTests.LogFunc = function(name, func) { + glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func); + }; + + setParentClass(glsBuiltinPrecisionTests.LogFunc, glsBuiltinPrecisionTests.CFloatFunc1); + + glsBuiltinPrecisionTests.LogFunc.prototype.precision = function(ctx, ret, x) { + if (x <= 0) + return NaN; + switch (ctx.floatPrecision) { + case gluShaderUtil.precision.PRECISION_HIGHP: + return (0.5 <= x && x <= 2.0) ? deMath.deLdExp(1.0, -21) : ctx.format.ulp(ret, 3.0); + case gluShaderUtil.precision.PRECISION_MEDIUMP: + return (0.5 <= x && x <= 2.0) ? deMath.deLdExp(1.0, -7) : ctx.format.ulp(ret, 2.0); + case gluShaderUtil.precision.PRECISION_LOWP: + return ctx.format.ulp(ret, 2.0); + default: + throw new Error(!'Impossible'); + } + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.LogFunc} + */ + glsBuiltinPrecisionTests.Log = function() { + glsBuiltinPrecisionTests.LogFunc.call(this, 'log', Math.log); + }; + + setParentClass(glsBuiltinPrecisionTests.Log, glsBuiltinPrecisionTests.LogFunc); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.LogFunc} + */ + glsBuiltinPrecisionTests.Log2 = function() { + glsBuiltinPrecisionTests.LogFunc.call(this, 'log2', Math.log2); + }; + + setParentClass(glsBuiltinPrecisionTests.Log2, glsBuiltinPrecisionTests.LogFunc); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc1} + */ + glsBuiltinPrecisionTests.PreciseFunc1 = function(name, func) { + glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func); + }; + + setParentClass(glsBuiltinPrecisionTests.PreciseFunc1, glsBuiltinPrecisionTests.CFloatFunc1); + + glsBuiltinPrecisionTests.PreciseFunc1.prototype.precision = function(ctx, ret, x) { + return 0; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc1} + */ + glsBuiltinPrecisionTests.Abs = function() { + glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'abs', Math.abs); + }; + setParentClass(glsBuiltinPrecisionTests.Abs, glsBuiltinPrecisionTests.PreciseFunc1); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc1} + */ + glsBuiltinPrecisionTests.Sign = function() { + glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'sign', Math.sign); + }; + setParentClass(glsBuiltinPrecisionTests.Sign, glsBuiltinPrecisionTests.PreciseFunc1); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc1} + */ + glsBuiltinPrecisionTests.Floor = function() { + glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'floor', Math.floor); + }; + setParentClass(glsBuiltinPrecisionTests.Floor, glsBuiltinPrecisionTests.PreciseFunc1); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc1} + */ + glsBuiltinPrecisionTests.RoundEven = function() { + glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'roundEven', deMath.rint); + }; + setParentClass(glsBuiltinPrecisionTests.RoundEven, glsBuiltinPrecisionTests.PreciseFunc1); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc1} + */ + glsBuiltinPrecisionTests.Ceil = function() { + glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'ceil', Math.ceil); + }; + setParentClass(glsBuiltinPrecisionTests.Ceil, glsBuiltinPrecisionTests.PreciseFunc1); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc1} + */ + glsBuiltinPrecisionTests.Trunc = function() { + glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'trunc', Math.trunc); + }; + setParentClass(glsBuiltinPrecisionTests.Trunc, glsBuiltinPrecisionTests.PreciseFunc1); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc2} + */ + glsBuiltinPrecisionTests.PreciseFunc2 = function(name, func) { + glsBuiltinPrecisionTests.CFloatFunc2.call(this, name, func); + }; + + setParentClass(glsBuiltinPrecisionTests.PreciseFunc2, glsBuiltinPrecisionTests.CFloatFunc2); + + glsBuiltinPrecisionTests.PreciseFunc2.prototype.precision = function(ctx, ret, x, y) { + return 0; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc2} + */ + glsBuiltinPrecisionTests.Min = function() { + glsBuiltinPrecisionTests.PreciseFunc2.call(this, 'min', Math.min); + }; + setParentClass(glsBuiltinPrecisionTests.Min, glsBuiltinPrecisionTests.PreciseFunc2); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc2} + */ + glsBuiltinPrecisionTests.Max = function() { + glsBuiltinPrecisionTests.PreciseFunc2.call(this, 'max', Math.max); + }; + setParentClass(glsBuiltinPrecisionTests.Max, glsBuiltinPrecisionTests.PreciseFunc2); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.PreciseFunc2} + */ + glsBuiltinPrecisionTests.Step = function() { + /** + * @param {number} edge + * @param {number} x + * return number + */ + var step = function(edge, x) { + return x < edge ? 0.0 : 1.0; + }; + glsBuiltinPrecisionTests.PreciseFunc2.call(this, 'step', step); + }; + setParentClass(glsBuiltinPrecisionTests.Step, glsBuiltinPrecisionTests.PreciseFunc2); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc1} + */ + glsBuiltinPrecisionTests.TrigFunc = function(name, func, loEx, hiEx) { + glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func); + this.m_loExtremum = loEx; + this.m_hiExtremum = hiEx; + }; + + setParentClass(glsBuiltinPrecisionTests.TrigFunc, glsBuiltinPrecisionTests.CFloatFunc1); + + glsBuiltinPrecisionTests.TrigFunc.prototype.innerExtrema = function(ctx, angle) { + var lo = angle.lo(); + var hi = angle.hi(); + var loSlope = this.doGetSlope(lo); + var hiSlope = this.doGetSlope(hi); + + // Detect the high and low values the function can take between the + // interval endpoints. + if (angle.length() >= 2.0 * Math.PI) { + // The interval is longer than a full cycle, so it must get all possible values. + return this.m_hiExtremum.operatorOrBinary(this.m_loExtremum); + } else if (loSlope == 1 && hiSlope == -1) { + // The slope can change from positive to negative only at the maximum value. + return this.m_hiExtremum; + } else if (loSlope == -1 && hiSlope == 1) { + // The slope can change from negative to positive only at the maximum value. + return this.m_loExtremum; + } else if (loSlope == hiSlope && + deMath.deSign(this.applyExact(hi) - this.applyExact(lo)) * loSlope == -1) { + // The slope has changed twice between the endpoints, so both extrema are included. + return this.m_hiExtremum.operatorOrBinary(this.m_loExtremum); + } + + return new tcuInterval.Interval(); + }; + + glsBuiltinPrecisionTests.TrigFunc.prototype.getCodomain = function() { + // Ensure that result is always within [-1, 1], or NaN (for +-inf) + var v = tcuInterval.withIntervals(new tcuInterval.Interval(-1), new tcuInterval.Interval(1)); + return v.operatorOrBinary(tcuInterval.NAN); + }; + + glsBuiltinPrecisionTests.TrigFunc.prototype.precision = function(ctx, ret, arg) { + if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP) { + // Use precision from OpenCL fast relaxed math + if (-Math.PI <= arg && arg <= Math.PI) { + return deMath.deLdExp(1.0, -11); + } else { + // "larger otherwise", let's pick |x| * 2^-12 , which is slightly over + // 2^-11 at x == pi. + return deMath.deLdExp(Math.abs(arg), -12); + } + } else if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_MEDIUMP) { + if (-Math.PI <= arg && arg <= Math.PI) { + // from OpenCL half-float extension specification + return ctx.format.ulp(ret, 2.0); + } else { + // |x| * 2^-10 , slightly larger than 2 ULP at x == pi + return deMath.deLdExp(Math.abs(arg), -10); + } + } else { + // from OpenCL half-float extension specification + return ctx.format.ulp(ret, 2.0); + } + }; + + /** + * @param {number} angle + * @return number + */ + glsBuiltinPrecisionTests.TrigFunc.prototype.doGetSlope = function(angle) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.TrigFunc} + */ + glsBuiltinPrecisionTests.Sin = function() { + glsBuiltinPrecisionTests.TrigFunc.call(this, 'sin', Math.sin, new tcuInterval.Interval(-1), new tcuInterval.Interval(1)); + }; + + setParentClass(glsBuiltinPrecisionTests.Sin, glsBuiltinPrecisionTests.TrigFunc); + + glsBuiltinPrecisionTests.Sin.prototype.doGetSlope = function(angle) { + return deMath.deSign(Math.cos(angle)); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.TrigFunc} + */ + glsBuiltinPrecisionTests.Cos = function() { + glsBuiltinPrecisionTests.TrigFunc.call(this, 'cos', Math.cos, new tcuInterval.Interval(-1), new tcuInterval.Interval(1)); + }; + + setParentClass(glsBuiltinPrecisionTests.Cos, glsBuiltinPrecisionTests.TrigFunc); + + glsBuiltinPrecisionTests.Cos.prototype.doGetSlope = function(angle) { + return -deMath.deSign(Math.sin(angle)); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Tan = function() { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'float'); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Tan, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Tan.prototype.getName = function() { + return 'tan'; + }; + + glsBuiltinPrecisionTests.Tan.prototype.doExpand = function(ctx, args) { + // sin(x) * (constant(1.0f) / cos(x) + var x = args.a; + var sin = app(new glsBuiltinPrecisionTests.Sin(), x); + var cos = app(new glsBuiltinPrecisionTests.Cos(), x); + var expr = app(new glsBuiltinPrecisionTests.Div(), + new glsBuiltinPrecisionTests.Constant(1), + cos); + + expr = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Mul(), + sin, + expr); + return expr; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc1} + */ + glsBuiltinPrecisionTests.ASin = function() { + glsBuiltinPrecisionTests.CFloatFunc1.call(this, 'asin', Math.asin); + }; + + setParentClass(glsBuiltinPrecisionTests.ASin, glsBuiltinPrecisionTests.CFloatFunc1); + + glsBuiltinPrecisionTests.ASin.prototype.precision = function(ctx, ret, x) { + if (!deMath.deInBounds32(x, -1.0, 1.0)) + return NaN; + + if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP) { + // Absolute error of 2^-11 + return deMath.deLdExp(1.0, -11); + } else { + // Absolute error of 2^-8 + return deMath.deLdExp(1.0, -8); + } + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc1} + */ + glsBuiltinPrecisionTests.ArcTrigFunc = function(name, func, precisionULPs, domain, coddomain) { + glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func); + this.m_precision = precisionULPs; + this.m_domain = domain; + this.m_codomain = coddomain; + }; + + setParentClass(glsBuiltinPrecisionTests.ArcTrigFunc, glsBuiltinPrecisionTests.CFloatFunc1); + + glsBuiltinPrecisionTests.ArcTrigFunc.prototype.precision = function(ctx, ret, x) { + if (!this.m_domain.contains(new tcuInterval.Interval(x))) + return NaN; + + if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP) { + // Use OpenCL's precision + return ctx.format.ulp(ret, this.m_precision); + } else { + // Use OpenCL half-float spec + return ctx.format.ulp(ret, 2.0); + } + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.ArcTrigFunc} + */ + glsBuiltinPrecisionTests.ACos = function() { + glsBuiltinPrecisionTests.ArcTrigFunc.call(this, 'acos', Math.acos, 4096.0, + tcuInterval.withNumbers(-1, 1), + tcuInterval.withNumbers(0, Math.PI)); + }; + + setParentClass(glsBuiltinPrecisionTests.ACos, glsBuiltinPrecisionTests.ArcTrigFunc); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.ArcTrigFunc} + */ + glsBuiltinPrecisionTests.ATan = function() { + glsBuiltinPrecisionTests.ArcTrigFunc.call(this, 'atan', Math.atan, 4096.0, + tcuInterval.unbounded(), + tcuInterval.withNumbers(-Math.PI * 0.5, Math.PI * 0.5)); + }; + + setParentClass(glsBuiltinPrecisionTests.ATan, glsBuiltinPrecisionTests.ArcTrigFunc); + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.CFloatFunc2} + */ + glsBuiltinPrecisionTests.ATan2 = function() { + glsBuiltinPrecisionTests.CFloatFunc2.call(this, 'atan', Math.atan2); + }; + + setParentClass(glsBuiltinPrecisionTests.ATan2, glsBuiltinPrecisionTests.CFloatFunc2); + + glsBuiltinPrecisionTests.ATan2.prototype.innerExtrema = function(ctx, xi, yi) { + var ret = new tcuInterval.Interval(); + + if (yi.contains(tcuInterval.ZERO)) { + if (xi.contains(tcuInterval.ZERO)) + ret.operatorOrAssignBinary(tcuInterval.NAN); + if (xi.intersects(tcuInterval.withNumbers(-Infinity, 0))) + ret.operatorOrAssignBinary(tcuInterval.withNumbers(-Math.PI, Math.PI)); + } + + if (ctx.format.hasInf() != tcuFloatFormat.YesNoMaybe.YES && (!yi.isFinite() || !xi.isFinite())) { + // Infinities may not be supported, allow anything, including NaN + ret.operatorOrAssignBinary(tcuInterval.NAN); + } + + return ret; + }; + + glsBuiltinPrecisionTests.ATan2.prototype.precision = function(ctx, ret, x, y) { + if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP) + return ctx.format.ulp(ret, 4096.0); + else + return ctx.format.ulp(ret, 2.0); + }; + + /** + * @constructor + * @param {number} size + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.DeterminantBase = function(size) { + var sig = new glsBuiltinPrecisionTests.Signature('float', 'mat' + size); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.DeterminantBase, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.DeterminantBase.prototype.getName = function() { + return 'determinant'; + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DeterminantBase} + */ + glsBuiltinPrecisionTests.Determinant = function() { + // TODO: Support sizes 3 and 4 + this.size = 2; + glsBuiltinPrecisionTests.DeterminantBase.call(this, this.size); + }; + + setParentClass(glsBuiltinPrecisionTests.Determinant, glsBuiltinPrecisionTests.DeterminantBase); + + glsBuiltinPrecisionTests.Determinant.prototype.doExpand = function(ctx, args) { + // mat[0][0] * mat[1][1] - mat[1][0] * mat[0][1] + var elem0_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 0); + var elem0_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 1); + var elem1_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 0); + var elem1_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 1); + + var val0 = app(new glsBuiltinPrecisionTests.Mul(), elem0_0, elem1_1); + var val1 = app(new glsBuiltinPrecisionTests.Mul(), elem0_1, elem1_0); + return new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Sub(), val0, val1); + }; + + /** + * @constructor + * @extends {glsBuiltinPrecisionTests.DerivedFunc} + */ + glsBuiltinPrecisionTests.Inverse = function() { + this.size = 2; + var name = 'mat' + this.size; + var sig = new glsBuiltinPrecisionTests.Signature(name, name); + glsBuiltinPrecisionTests.DerivedFunc.call(this, sig); + }; + + setParentClass(glsBuiltinPrecisionTests.Inverse, glsBuiltinPrecisionTests.DerivedFunc); + + glsBuiltinPrecisionTests.Inverse.prototype.getName = function() { + return 'inverse'; + }; + + glsBuiltinPrecisionTests.Inverse.prototype.doExpand = function(ctx, args) { + var mat = args.a; + var v0 = app(new glsBuiltinPrecisionTests.Determinant(), mat); + var det = glsBuiltinPrecisionTests.bindExpression('float', 'det', ctx, v0); + + var elem0_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 0); + var elem0_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 1); + var elem1_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 0); + var elem1_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 1); + + var result0_0 = app(new glsBuiltinPrecisionTests.Div(), elem1_1, det); + var result0_1 = app(new glsBuiltinPrecisionTests.Div(), elem0_1, det); + result0_1 = app(new glsBuiltinPrecisionTests.Negate(), result0_1); + var result1_0 = app(new glsBuiltinPrecisionTests.Div(), elem1_0, det); + result1_0 = app(new glsBuiltinPrecisionTests.Negate(), result1_0); + var result1_1 = app(new glsBuiltinPrecisionTests.Div(), elem0_0, det); + + var col0 = app(new glsBuiltinPrecisionTests.GenVec(this.size, true), result0_0, result1_0); + var col1 = app(new glsBuiltinPrecisionTests.GenVec(this.size, true), result0_1, result1_1); + var ret = app(new glsBuiltinPrecisionTests.GenMat(this.size, this.size), col0, col1); + + return ret; + }; + + /** + * @param {glsBuiltinPrecisionTests.PrecisionTestContext} ctx + * @param {glsBuiltinPrecisionTests.CaseFactory} factory + * @return {tcuTestCase.DeqpTest} + */ + glsBuiltinPrecisionTests.createFuncGroup = function(ctx, factory) { + /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(factory.getName(), factory.getDesc()); + + for (var precNdx in gluShaderUtil.precision) { + /** @type {gluShaderUtil.precision} */ var precision = gluShaderUtil.precision[precNdx]; + /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(precision); + /** @type {tcuFloatFormat.FloatFormat} */ var fmt = ctx.formats[precision]; + /** @type {tcuFloatFormat.FloatFormat} */ var highpFmt = ctx.formats[gluShaderUtil.precision.PRECISION_HIGHP]; + + for (var shaderNdx in ctx.shaderTypes) { + /** @type {gluShaderProgram.shaderType} */ var shaderType = ctx.shaderTypes[shaderNdx]; + /** @type {string} */ var shaderName = gluShaderProgram.getShaderTypeName(shaderType); + /** @type {string} */ var name = precName + '_' + shaderName; + /** @type {glsBuiltinPrecisionTests.Context} */ var caseCtx = new glsBuiltinPrecisionTests.Context(name, fmt, highpFmt, + precision, shaderType, ctx.numRandoms); + + group.addChild(factory.createCase(caseCtx)); + } + } + + return group; + }; + + /** + * @param {glsBuiltinPrecisionTests.CaseFactories} cases + * @param {Array} shaderTypes + * @param {tcuTestCase.DeqpTest} dstGroup + */ + glsBuiltinPrecisionTests.addBuiltinPrecisionTests = function(cases, shaderTypes, dstGroup) { + /** @type {tcuFloatFormat.FloatFormat} */ var highp = new tcuFloatFormat.FloatFormat(-126, 127, 23, true, + tcuFloatFormat.YesNoMaybe.MAYBE, // subnormals + tcuFloatFormat.YesNoMaybe.YES, // infinities + tcuFloatFormat.YesNoMaybe.MAYBE); // NaN + // \todo [2014-04-01 lauri] Check these once Khronos bug 11840 is resolved. + /** @type {tcuFloatFormat.FloatFormat} */ var mediump = new tcuFloatFormat.FloatFormat(-13, 13, 9, false); + // A fixed-point format is just a floating point format with a fixed + // exponent and support for subnormals. + /** @type {tcuFloatFormat.FloatFormat} */ var lowp = new tcuFloatFormat.FloatFormat(0, 0, 7, false, tcuFloatFormat.YesNoMaybe.YES); + /** @type {glsBuiltinPrecisionTests.PrecisionTestContext} */ var ctx = new glsBuiltinPrecisionTests.PrecisionTestContext(highp, mediump, lowp, + shaderTypes, 16384); + + for (var ndx = 0; ndx < cases.getFactories().length; ++ndx) + dstGroup.addChild(glsBuiltinPrecisionTests.createFuncGroup(ctx, cases.getFactories()[ndx])); + }; + + /** + * @param {function(new:glsBuiltinPrecisionTests.Func)} F + * @param {glsBuiltinPrecisionTests.CaseFactories} funcs + * @param {string=} name + */ + glsBuiltinPrecisionTests.addScalarFactory = function(F, funcs, name) { + if (name === undefined) + name = (new F()).getName(); + + funcs.addFactory(new glsBuiltinPrecisionTests.GenFuncCaseFactory(glsBuiltinPrecisionTests.makeVectorizedFuncs(F), name)); + }; + + /** + * @param {function(new:glsBuiltinPrecisionTests.Func)} F + */ + glsBuiltinPrecisionTests.createSimpleFuncCaseFactory = function(F) { + return new glsBuiltinPrecisionTests.SimpleFuncCaseFactory(new F()); + }; + + /** + * @param {number} caseId test case Id + * @return {glsBuiltinPrecisionTests.CaseFactories} + */ + glsBuiltinPrecisionTests.createES3BuiltinCases = function(caseId) { + /** @type {glsBuiltinPrecisionTests.CaseFactories} */ var funcs = new glsBuiltinPrecisionTests.BuiltinFuncs(); + + switch (caseId) { + case 0: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Add, funcs); break; + case 1: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sub, funcs); break; + case 2: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Mul, funcs); break; + case 3: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Div, funcs); break; + case 4: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Radians, funcs); break; + case 5: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Degrees, funcs); break; + case 6: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sin, funcs); break; + case 7: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Cos, funcs); break; + case 8: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Tan, funcs); break; + case 9: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ASin, funcs); break; + case 10: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ACos, funcs); break; + case 11: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ATan, funcs); break; + case 12: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ATan2, funcs, 'atan2'); break; + case 13: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sinh, funcs); break; + case 14: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Cosh, funcs); break; + case 15: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Tanh, funcs); break; + case 16: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ASinh, funcs); break; + case 17: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ACosh, funcs); break; + case 18: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ATanh, funcs); break; + case 19: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Pow, funcs); break; + case 20: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Exp, funcs); break; + case 21: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Exp2, funcs); break; + case 22: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Log, funcs); break; + case 23: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Log2, funcs); break; + case 24: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sqrt, funcs); break; + case 25: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.InverseSqrt, funcs); break; + case 26: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Abs, funcs); break; + case 27: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sign, funcs); break; + case 28: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Floor, funcs); break; + case 29: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Trunc, funcs); break; + case 30: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Round, funcs); break; + case 31: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.RoundEven, funcs); break; + case 32: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Ceil, funcs); break; + case 33: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Fract, funcs); break; + case 34: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Mod, funcs); break; + case 35: funcs.addFactory(glsBuiltinPrecisionTests.createSimpleFuncCaseFactory(glsBuiltinPrecisionTests.Modf)); break; + case 36: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Min, funcs); break; + case 37: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Max, funcs); break; + case 38: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Mix, funcs); break; + case 39: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Step, funcs); break; + case 40: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.SmoothStep, funcs); break; + case 41: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Clamp, funcs); break; + case 42: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Length)); break; + case 43: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Distance)); break; + case 44: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Dot)); break; + case 45: funcs.addFactory(glsBuiltinPrecisionTests.createSimpleFuncCaseFactory(glsBuiltinPrecisionTests.Cross)); break; + case 46: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Normalize)); break; + case 47: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.FaceForward)); break; + case 48: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Reflect)); break; + case 49: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Refract)); break; + case 50: funcs.addFactory(new glsBuiltinPrecisionTests.MatrixFuncCaseFactory(glsBuiltinPrecisionTests.MatrixCompMult)); break; + case 51: funcs.addFactory(new glsBuiltinPrecisionTests.MatrixFuncCaseFactory(glsBuiltinPrecisionTests.OuterProduct)); break; + case 52: funcs.addFactory(new glsBuiltinPrecisionTests.MatrixFuncCaseFactory(glsBuiltinPrecisionTests.Transpose)); break; + case 53: funcs.addFactory(new glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory(glsBuiltinPrecisionTests.Determinant)); break; + case 54: funcs.addFactory(new glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory(glsBuiltinPrecisionTests.Inverse)); break; + default: break; + } + + return funcs; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js new file mode 100644 index 000000000..e8df9d28e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js @@ -0,0 +1,2819 @@ +'use strict'; +goog.provide('modules.shared.glsBuiltinPrecisionTestsUnitTests'); +goog.require('framework.common.tcuInterval'); +goog.require('framework.common.tcuMatrix'); + +goog.scope(function() { + + modules.shared.glsBuiltinPrecisionTestsUnitTests.cppreference = []; + var tcuInterval = framework.common.tcuInterval; + var glsBuiltinPrecisionTestsUnitTests = modules.shared.glsBuiltinPrecisionTestsUnitTests; + var tcuMatrix = framework.common.tcuMatrix; + + var ref = modules.shared.glsBuiltinPrecisionTestsUnitTests.cppreference; +ref.push({testName: 'precision.add.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]}); +ref.push({testName: 'precision.add.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]}); +ref.push({testName: 'precision.add.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]}); +ref.push({testName: 'precision.add.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]}); +ref.push({testName: 'precision.add.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.7, 0.7]}); +ref.push({testName: 'precision.add.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7]}); +ref.push({testName: 'precision.add.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]}); +ref.push({testName: 'precision.add.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]}); +ref.push({testName: 'precision.add.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.7, 0.7]}); +ref.push({testName: 'precision.add.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7]}); +ref.push({testName: 'precision.add.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]}); +ref.push({testName: 'precision.add.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.add.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]}); +ref.push({testName: 'precision.sub.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.sub.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]}); +ref.push({testName: 'precision.sub.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.sub.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]}); +ref.push({testName: 'precision.sub.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.3, -0.3]}); +ref.push({testName: 'precision.sub.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3]}); +ref.push({testName: 'precision.sub.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]}); +ref.push({testName: 'precision.sub.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]}); +ref.push({testName: 'precision.sub.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.3, -0.3]}); +ref.push({testName: 'precision.sub.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3]}); +ref.push({testName: 'precision.sub.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]}); +ref.push({testName: 'precision.sub.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.sub.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]}); +ref.push({testName: 'precision.mul.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.mul.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.mul.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.mul.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.mul.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]}); +ref.push({testName: 'precision.mul.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.mul.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.mul.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.mul.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]}); +ref.push({testName: 'precision.mul.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.mul.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.mul.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.mul.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.div.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.div.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]}); +ref.push({testName: 'precision.div.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]}); +ref.push({testName: 'precision.div.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.div.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.div.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.div.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.div.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.div.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.div.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.div.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.div.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.div.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.div.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.div.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.div.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.div.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.div.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.div.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]}); +ref.push({testName: 'precision.radians.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.radians.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]}); +ref.push({testName: 'precision.radians.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]}); +ref.push({testName: 'precision.radians.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.radians.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.radians.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.radians.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.radians.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.radians.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.radians.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.radians.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]}); +ref.push({testName: 'precision.radians.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]}); +ref.push({testName: 'precision.degrees.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.degrees.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]}); +ref.push({testName: 'precision.degrees.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]}); +ref.push({testName: 'precision.degrees.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.degrees.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.degrees.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.degrees.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.degrees.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.degrees.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.degrees.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.degrees.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]}); +ref.push({testName: 'precision.degrees.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]}); +ref.push({testName: 'precision.sin.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]}); +ref.push({testName: 'precision.sin.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]}); +ref.push({testName: 'precision.sin.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]}); +ref.push({testName: 'precision.sin.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]}); +ref.push({testName: 'precision.sin.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.sin.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.sin.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.sin.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.sin.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.sin.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.sin.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.sin.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]}); +ref.push({testName: 'precision.sin.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]}); +ref.push({testName: 'precision.cos.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]}); +ref.push({testName: 'precision.cos.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]}); +ref.push({testName: 'precision.cos.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]}); +ref.push({testName: 'precision.cos.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]}); +ref.push({testName: 'precision.cos.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.cos.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.cos.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.cos.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.cos.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.cos.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.cos.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.cos.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]}); +ref.push({testName: 'precision.cos.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]}); +ref.push({testName: 'precision.tan.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.tan.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]}); +ref.push({testName: 'precision.tan.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]}); +ref.push({testName: 'precision.tan.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.tan.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.tan.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.tan.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.tan.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.tan.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.tan.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.tan.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]}); +ref.push({testName: 'precision.tan.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]}); +ref.push({testName: 'precision.asin.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]}); +ref.push({testName: 'precision.asin.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]}); +ref.push({testName: 'precision.asin.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]}); +ref.push({testName: 'precision.asin.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]}); +ref.push({testName: 'precision.asin.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.asin.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.asin.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.asin.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.asin.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.asin.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.asin.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.asin.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]}); +ref.push({testName: 'precision.asin.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]}); +ref.push({testName: 'precision.acos.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]}); +ref.push({testName: 'precision.acos.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]}); +ref.push({testName: 'precision.acos.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]}); +ref.push({testName: 'precision.acos.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]}); +ref.push({testName: 'precision.acos.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.acos.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.acos.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.acos.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.acos.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.acos.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.acos.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.acos.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]}); +ref.push({testName: 'precision.acos.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]}); +ref.push({testName: 'precision.atan2.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]}); +ref.push({testName: 'precision.atan2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]}); +ref.push({testName: 'precision.atan2.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]}); +ref.push({testName: 'precision.atan2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]}); +ref.push({testName: 'precision.atan2.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan2.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]}); +ref.push({testName: 'precision.atan2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]}); +ref.push({testName: 'precision.atan.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]}); +ref.push({testName: 'precision.atan.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]}); +ref.push({testName: 'precision.atan.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]}); +ref.push({testName: 'precision.atan.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]}); +ref.push({testName: 'precision.atan.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.atan.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.atan.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.atan.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.atan.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.atan.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.atan.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.atan.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]}); +ref.push({testName: 'precision.atan.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]}); +ref.push({testName: 'precision.sinh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sinh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]}); +ref.push({testName: 'precision.sinh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]}); +ref.push({testName: 'precision.sinh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.sinh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.sinh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.sinh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.sinh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.sinh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.sinh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.sinh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]}); +ref.push({testName: 'precision.sinh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]}); +ref.push({testName: 'precision.cosh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.cosh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]}); +ref.push({testName: 'precision.cosh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]}); +ref.push({testName: 'precision.cosh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.cosh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.cosh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.cosh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.cosh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.cosh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.cosh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.cosh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]}); +ref.push({testName: 'precision.cosh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]}); +ref.push({testName: 'precision.tanh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.tanh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]}); +ref.push({testName: 'precision.tanh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]}); +ref.push({testName: 'precision.tanh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.tanh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.tanh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.tanh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.tanh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.tanh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.tanh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.tanh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]}); +ref.push({testName: 'precision.tanh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]}); +ref.push({testName: 'precision.asinh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.asinh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]}); +ref.push({testName: 'precision.asinh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]}); +ref.push({testName: 'precision.asinh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.asinh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.asinh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.asinh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.asinh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.asinh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.asinh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.asinh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]}); +ref.push({testName: 'precision.asinh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]}); +ref.push({testName: 'precision.acosh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.acosh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.atanh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]}); +ref.push({testName: 'precision.atanh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]}); +ref.push({testName: 'precision.atanh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.atanh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.atanh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.atanh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.atanh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.atanh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.atanh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.atanh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]}); +ref.push({testName: 'precision.atanh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]}); +ref.push({testName: 'precision.pow.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]}); +ref.push({testName: 'precision.pow.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]}); +ref.push({testName: 'precision.pow.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]}); +ref.push({testName: 'precision.pow.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]}); +ref.push({testName: 'precision.pow.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.pow.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.pow.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.pow.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.pow.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.pow.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.pow.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.pow.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]}); +ref.push({testName: 'precision.pow.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.exp.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]}); +ref.push({testName: 'precision.exp.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]}); +ref.push({testName: 'precision.exp.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]}); +ref.push({testName: 'precision.exp.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]}); +ref.push({testName: 'precision.exp.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.exp.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.exp.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.exp.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.exp.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.exp.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.exp.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.exp.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]}); +ref.push({testName: 'precision.exp.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]}); +ref.push({testName: 'precision.log.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]}); +ref.push({testName: 'precision.log.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]}); +ref.push({testName: 'precision.log.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]}); +ref.push({testName: 'precision.log.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]}); +ref.push({testName: 'precision.log.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.log.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.log.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.log.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.log.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.log.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.log.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.log.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]}); +ref.push({testName: 'precision.log.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]}); +ref.push({testName: 'precision.exp2.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]}); +ref.push({testName: 'precision.exp2.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.exp2.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]}); +ref.push({testName: 'precision.exp2.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]}); +ref.push({testName: 'precision.exp2.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.exp2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.exp2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.exp2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.exp2.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.exp2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.exp2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.exp2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]}); +ref.push({testName: 'precision.exp2.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.log2.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]}); +ref.push({testName: 'precision.log2.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]}); +ref.push({testName: 'precision.log2.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]}); +ref.push({testName: 'precision.log2.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]}); +ref.push({testName: 'precision.log2.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -1, -1]}); +ref.push({testName: 'precision.log2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1]}); +ref.push({testName: 'precision.log2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1]}); +ref.push({testName: 'precision.log2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1, false, -1, -1]}); +ref.push({testName: 'precision.log2.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -1, -1]}); +ref.push({testName: 'precision.log2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1]}); +ref.push({testName: 'precision.log2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1]}); +ref.push({testName: 'precision.log2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]}); +ref.push({testName: 'precision.log2.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1, false, -1, -1]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]}); +ref.push({testName: 'precision.sqrt.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.sqrt.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.sqrt.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.sqrt.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.sqrt.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.sqrt.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.sqrt.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.sqrt.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.sqrt.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]}); +ref.push({testName: 'precision.sqrt.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]}); +ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]}); +ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]}); +ref.push({testName: 'precision.inversesqrt.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]}); +ref.push({testName: 'precision.abs.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.abs.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.abs.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.abs.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.abs.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.sign.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.sign.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.floor.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.floor.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.trunc.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.round.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.round.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.round.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.round.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.round.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.round.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.round.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.round.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.roundeven.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.ceil.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.ceil.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.fract.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.fract.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.fract.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.fract.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.fract.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.mod.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.mod.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]}); +ref.push({testName: 'precision.mod.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mod.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.mod.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mod.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mod.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]}); +ref.push({testName: 'precision.mod.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.modf.lowp_vertex', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.lowp_vertex', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.modf.lowp_vertex', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.lowp_vertex', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.modf.lowp_fragment', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.lowp_fragment', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.modf.lowp_fragment', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.lowp_fragment', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.modf.mediump_vertex', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.mediump_vertex', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.modf.mediump_vertex', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.mediump_vertex', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.modf.mediump_fragment', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.mediump_fragment', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.modf.mediump_fragment', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.mediump_fragment', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.modf.highp_vertex', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.highp_vertex', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.modf.highp_vertex', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.highp_vertex', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.modf.highp_fragment', input: '0.2, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.highp_fragment', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.modf.highp_fragment', input: '0.5, (), (), ()', reference: [false, 0, 0]}); +ref.push({testName: 'precision.modf.highp_fragment', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.min.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.min.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.min.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.min.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.max.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.max.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.max.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.max.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.clamp.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.clamp.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.clamp.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.clamp.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.clamp.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]}); +ref.push({testName: 'precision.mix.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.mix.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]}); +ref.push({testName: 'precision.mix.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.mix.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.mix.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]}); +ref.push({testName: 'precision.step.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]}); +ref.push({testName: 'precision.step.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.step.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]}); +ref.push({testName: 'precision.smoothstep.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]}); +ref.push({testName: 'precision.length.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.length.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198712, 0.201489]}); +ref.push({testName: 'precision.length.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.497805, 0.50342]}); +ref.push({testName: 'precision.length.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.280921, 0.285045]}); +ref.push({testName: 'precision.length.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.length.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.344072, 0.349095]}); +ref.push({testName: 'precision.length.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.860664, 0.871406]}); +ref.push({testName: 'precision.length.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.397121, 0.403285]}); +ref.push({testName: 'precision.length.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.995609, 1.00684]}); +ref.push({testName: 'precision.length.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198712, 0.201489]}); +ref.push({testName: 'precision.length.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.497805, 0.50342]}); +ref.push({testName: 'precision.length.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.280921, 0.285045]}); +ref.push({testName: 'precision.length.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507]}); +ref.push({testName: 'precision.length.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.344072, 0.349095]}); +ref.push({testName: 'precision.length.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.860664, 0.871406]}); +ref.push({testName: 'precision.length.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.397121, 0.403285]}); +ref.push({testName: 'precision.length.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.995609, 1.00684]}); +ref.push({testName: 'precision.length.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.length.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.length.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.282843, 0.282843]}); +ref.push({testName: 'precision.length.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.length.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.34641, 0.34641]}); +ref.push({testName: 'precision.length.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.866025, 0.866026]}); +ref.push({testName: 'precision.length.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.length.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.length.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.length.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]}); +ref.push({testName: 'precision.length.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.282843, 0.282843]}); +ref.push({testName: 'precision.length.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107]}); +ref.push({testName: 'precision.length.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.34641, 0.34641]}); +ref.push({testName: 'precision.length.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.866025, 0.866026]}); +ref.push({testName: 'precision.length.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.length.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.distance.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.297819, 0.302277]}); +ref.push({testName: 'precision.distance.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.421276, 0.427394]}); +ref.push({testName: 'precision.distance.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.515672, 0.524075]}); +ref.push({testName: 'precision.distance.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.595637, 0.604962]}); +ref.push({testName: 'precision.distance.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.297819, 0.302277]}); +ref.push({testName: 'precision.distance.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.421276, 0.427394]}); +ref.push({testName: 'precision.distance.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.515672, 0.524075]}); +ref.push({testName: 'precision.distance.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.595637, 0.604962]}); +ref.push({testName: 'precision.distance.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.3, 0.3]}); +ref.push({testName: 'precision.distance.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.424264, 0.424264]}); +ref.push({testName: 'precision.distance.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.519615, 0.519615]}); +ref.push({testName: 'precision.distance.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.6, 0.6]}); +ref.push({testName: 'precision.distance.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.3, 0.3]}); +ref.push({testName: 'precision.distance.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.424264, 0.424264]}); +ref.push({testName: 'precision.distance.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.519615, 0.519615]}); +ref.push({testName: 'precision.distance.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]}); +ref.push({testName: 'precision.distance.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.6, 0.6]}); +ref.push({testName: 'precision.dot.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.dot.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.dot.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0625, 0.09375]}); +ref.push({testName: 'precision.dot.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.dot.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.09375, 0.140625]}); +ref.push({testName: 'precision.dot.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.28125, 0.304688]}); +ref.push({testName: 'precision.dot.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.125, 0.1875]}); +ref.push({testName: 'precision.dot.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.375, 0.40625]}); +ref.push({testName: 'precision.dot.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.dot.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.dot.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0625, 0.09375]}); +ref.push({testName: 'precision.dot.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1875, 0.203125]}); +ref.push({testName: 'precision.dot.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.09375, 0.140625]}); +ref.push({testName: 'precision.dot.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.28125, 0.304688]}); +ref.push({testName: 'precision.dot.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.125, 0.1875]}); +ref.push({testName: 'precision.dot.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.375, 0.40625]}); +ref.push({testName: 'precision.dot.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.dot.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.dot.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0799561, 0.0802002]}); +ref.push({testName: 'precision.dot.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.dot.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.119873, 0.120361]}); +ref.push({testName: 'precision.dot.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.299805, 0.300293]}); +ref.push({testName: 'precision.dot.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.159668, 0.160645]}); +ref.push({testName: 'precision.dot.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.399414, 0.400391]}); +ref.push({testName: 'precision.dot.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.dot.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.dot.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0799561, 0.0802002]}); +ref.push({testName: 'precision.dot.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.dot.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.119873, 0.120361]}); +ref.push({testName: 'precision.dot.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.299805, 0.300293]}); +ref.push({testName: 'precision.dot.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.159668, 0.160645]}); +ref.push({testName: 'precision.dot.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.399414, 0.400391]}); +ref.push({testName: 'precision.dot.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]}); +ref.push({testName: 'precision.dot.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]}); +ref.push({testName: 'precision.dot.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.08, 0.08]}); +ref.push({testName: 'precision.dot.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.dot.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.12, 0.12]}); +ref.push({testName: 'precision.dot.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.3, 0.3]}); +ref.push({testName: 'precision.dot.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.16, 0.16]}); +ref.push({testName: 'precision.dot.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.dot.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]}); +ref.push({testName: 'precision.dot.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]}); +ref.push({testName: 'precision.dot.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.08, 0.08]}); +ref.push({testName: 'precision.dot.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2]}); +ref.push({testName: 'precision.dot.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.12, 0.12]}); +ref.push({testName: 'precision.dot.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.3, 0.3]}); +ref.push({testName: 'precision.dot.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.16, 0.16]}); +ref.push({testName: 'precision.dot.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4]}); +ref.push({testName: 'precision.cross.lowp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.015625, 0.015625, false, -0.015625, 0.015625, false, -0.015625, 0.015625]}); +ref.push({testName: 'precision.cross.lowp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.cross.lowp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.015625, 0.015625, false, -0.015625, 0.015625, false, -0.015625, 0.015625]}); +ref.push({testName: 'precision.cross.lowp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]}); +ref.push({testName: 'precision.cross.mediump_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]}); +ref.push({testName: 'precision.cross.mediump_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]}); +ref.push({testName: 'precision.cross.mediump_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]}); +ref.push({testName: 'precision.cross.mediump_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]}); +ref.push({testName: 'precision.cross.highp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009]}); +ref.push({testName: 'precision.cross.highp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.cross.highp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009]}); +ref.push({testName: 'precision.cross.highp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.normalize.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.normalize.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.989926, 1.01235]}); +ref.push({testName: 'precision.normalize.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.990765, 1.00929]}); +ref.push({testName: 'precision.normalize.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.699031, 0.71508, false, 0.699031, 0.71508]}); +ref.push({testName: 'precision.normalize.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.700293, 0.713965, false, 0.700293, 0.713965]}); +ref.push({testName: 'precision.normalize.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.570329, 0.584282, false, 0.570329, 0.584282, false, 0.570329, 0.584282]}); +ref.push({testName: 'precision.normalize.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.571344, 0.583388, false, 0.571344, 0.583388, false, 0.571344, 0.583388]}); +ref.push({testName: 'precision.normalize.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559]}); +ref.push({testName: 'precision.normalize.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646]}); +ref.push({testName: 'precision.normalize.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.989926, 1.01235]}); +ref.push({testName: 'precision.normalize.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.990765, 1.00929]}); +ref.push({testName: 'precision.normalize.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.699031, 0.71508, false, 0.699031, 0.71508]}); +ref.push({testName: 'precision.normalize.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.700293, 0.713965, false, 0.700293, 0.713965]}); +ref.push({testName: 'precision.normalize.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.570329, 0.584282, false, 0.570329, 0.584282, false, 0.570329, 0.584282]}); +ref.push({testName: 'precision.normalize.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.571344, 0.583388, false, 0.571344, 0.583388, false, 0.571344, 0.583388]}); +ref.push({testName: 'precision.normalize.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559]}); +ref.push({testName: 'precision.normalize.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646]}); +ref.push({testName: 'precision.normalize.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.normalize.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.normalize.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]}); +ref.push({testName: 'precision.normalize.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]}); +ref.push({testName: 'precision.normalize.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]}); +ref.push({testName: 'precision.normalize.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]}); +ref.push({testName: 'precision.normalize.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.normalize.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.normalize.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.normalize.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]}); +ref.push({testName: 'precision.normalize.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]}); +ref.push({testName: 'precision.normalize.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]}); +ref.push({testName: 'precision.normalize.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]}); +ref.push({testName: 'precision.normalize.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]}); +ref.push({testName: 'precision.normalize.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.normalize.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]}); +ref.push({testName: 'precision.faceforward.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.faceforward.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.reflect.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.164063, 0.203125]}); +ref.push({testName: 'precision.reflect.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0859375, 0.109375]}); +ref.push({testName: 'precision.reflect.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.148438, 0.1875, false, 0.148438, 0.1875]}); +ref.push({testName: 'precision.reflect.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.015625, false, -0.0078125, 0.015625]}); +ref.push({testName: 'precision.reflect.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.132813, 0.171875, false, 0.132813, 0.171875, false, 0.132813, 0.171875]}); +ref.push({testName: 'precision.reflect.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.117188, -0.078125, false, -0.117188, -0.078125, false, -0.117188, -0.078125]}); +ref.push({testName: 'precision.reflect.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625]}); +ref.push({testName: 'precision.reflect.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875]}); +ref.push({testName: 'precision.reflect.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.164063, 0.203125]}); +ref.push({testName: 'precision.reflect.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0859375, 0.109375]}); +ref.push({testName: 'precision.reflect.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.148438, 0.1875, false, 0.148438, 0.1875]}); +ref.push({testName: 'precision.reflect.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.015625, false, -0.0078125, 0.015625]}); +ref.push({testName: 'precision.reflect.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.132813, 0.171875, false, 0.132813, 0.171875, false, 0.132813, 0.171875]}); +ref.push({testName: 'precision.reflect.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.117188, -0.078125, false, -0.117188, -0.078125, false, -0.117188, -0.078125]}); +ref.push({testName: 'precision.reflect.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625]}); +ref.push({testName: 'precision.reflect.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875]}); +ref.push({testName: 'precision.reflect.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.183838, 0.184326]}); +ref.push({testName: 'precision.reflect.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0998535, 0.10022]}); +ref.push({testName: 'precision.reflect.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.167725, 0.168457, false, 0.167725, 0.168457]}); +ref.push({testName: 'precision.reflect.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.reflect.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.151611, 0.152344, false, 0.151611, 0.152344, false, 0.151611, 0.152344]}); +ref.push({testName: 'precision.reflect.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.100342, -0.0996094, false, -0.100342, -0.0996094, false, -0.100342, -0.0996094]}); +ref.push({testName: 'precision.reflect.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475]}); +ref.push({testName: 'precision.reflect.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219]}); +ref.push({testName: 'precision.reflect.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.183838, 0.184326]}); +ref.push({testName: 'precision.reflect.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0998535, 0.10022]}); +ref.push({testName: 'precision.reflect.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.167725, 0.168457, false, 0.167725, 0.168457]}); +ref.push({testName: 'precision.reflect.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]}); +ref.push({testName: 'precision.reflect.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.151611, 0.152344, false, 0.151611, 0.152344, false, 0.151611, 0.152344]}); +ref.push({testName: 'precision.reflect.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.100342, -0.0996094, false, -0.100342, -0.0996094, false, -0.100342, -0.0996094]}); +ref.push({testName: 'precision.reflect.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475]}); +ref.push({testName: 'precision.reflect.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219]}); +ref.push({testName: 'precision.reflect.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.184, 0.184]}); +ref.push({testName: 'precision.reflect.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]}); +ref.push({testName: 'precision.reflect.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.168, 0.168, false, 0.168, 0.168]}); +ref.push({testName: 'precision.reflect.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.reflect.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.152, 0.152, false, 0.152, 0.152, false, 0.152, 0.152]}); +ref.push({testName: 'precision.reflect.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.1, -0.1, false, -0.1, -0.1, false, -0.1, -0.1]}); +ref.push({testName: 'precision.reflect.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136]}); +ref.push({testName: 'precision.reflect.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.reflect.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.184, 0.184]}); +ref.push({testName: 'precision.reflect.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]}); +ref.push({testName: 'precision.reflect.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.168, 0.168, false, 0.168, 0.168]}); +ref.push({testName: 'precision.reflect.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.reflect.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.152, 0.152, false, 0.152, 0.152, false, 0.152, 0.152]}); +ref.push({testName: 'precision.reflect.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.1, -0.1, false, -0.1, -0.1, false, -0.1, -0.1]}); +ref.push({testName: 'precision.reflect.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136]}); +ref.push({testName: 'precision.reflect.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]}); +ref.push({testName: 'precision.refract.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.refract.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.159424, -0.155762]}); +ref.push({testName: 'precision.refract.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0787354, -0.0756836]}); +ref.push({testName: 'precision.refract.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.161377, -0.157471, false, -0.161377, -0.157471]}); +ref.push({testName: 'precision.refract.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0828857, -0.079834, false, -0.0828857, -0.079834]}); +ref.push({testName: 'precision.refract.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162842, -0.158936, false, -0.162842, -0.158936, false, -0.162842, -0.158936]}); +ref.push({testName: 'precision.refract.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285]}); +ref.push({testName: 'precision.refract.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604]}); +ref.push({testName: 'precision.refract.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789]}); +ref.push({testName: 'precision.refract.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.159424, -0.155762]}); +ref.push({testName: 'precision.refract.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0787354, -0.0756836]}); +ref.push({testName: 'precision.refract.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.161377, -0.157471, false, -0.161377, -0.157471]}); +ref.push({testName: 'precision.refract.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0828857, -0.079834, false, -0.0828857, -0.079834]}); +ref.push({testName: 'precision.refract.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162842, -0.158936, false, -0.162842, -0.158936, false, -0.162842, -0.158936]}); +ref.push({testName: 'precision.refract.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285]}); +ref.push({testName: 'precision.refract.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604]}); +ref.push({testName: 'precision.refract.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789]}); +ref.push({testName: 'precision.refract.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.157566, -0.157566]}); +ref.push({testName: 'precision.refract.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0772513, -0.0772512]}); +ref.push({testName: 'precision.refract.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.159185, -0.159185, false, -0.159185, -0.159185]}); +ref.push({testName: 'precision.refract.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0813898, -0.0813897, false, -0.0813898, -0.0813897]}); +ref.push({testName: 'precision.refract.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.160818, -0.160818, false, -0.160818, -0.160818, false, -0.160818, -0.160818]}); +ref.push({testName: 'precision.refract.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202]}); +ref.push({testName: 'precision.refract.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464]}); +ref.push({testName: 'precision.refract.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425]}); +ref.push({testName: 'precision.refract.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.157566, -0.157566]}); +ref.push({testName: 'precision.refract.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0772513, -0.0772512]}); +ref.push({testName: 'precision.refract.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.159185, -0.159185, false, -0.159185, -0.159185]}); +ref.push({testName: 'precision.refract.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0813898, -0.0813897, false, -0.0813898, -0.0813897]}); +ref.push({testName: 'precision.refract.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.160818, -0.160818, false, -0.160818, -0.160818, false, -0.160818, -0.160818]}); +ref.push({testName: 'precision.refract.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202]}); +ref.push({testName: 'precision.refract.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464]}); +ref.push({testName: 'precision.refract.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]}); +ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]}); +ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]}); +ref.push({testName: 'precision.outerproduct.highp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.transpose.lowp_vertex.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]}); +ref.push({testName: 'precision.transpose.lowp_fragment.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.transpose.mediump_vertex.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]}); +ref.push({testName: 'precision.transpose.mediump_fragment.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]}); +ref.push({testName: 'precision.transpose.highp_vertex.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]}); +ref.push({testName: 'precision.transpose.highp_fragment.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]}); +ref.push({testName: 'precision.determinant.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.determinant.lowp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]}); +ref.push({testName: 'precision.determinant.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.03125, 0.046875]}); +ref.push({testName: 'precision.determinant.lowp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]}); +ref.push({testName: 'precision.determinant.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.determinant.mediump_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]}); +ref.push({testName: 'precision.determinant.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.039978, 0.0401001]}); +ref.push({testName: 'precision.determinant.mediump_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]}); +ref.push({testName: 'precision.determinant.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.04, 0.04]}); +ref.push({testName: 'precision.determinant.highp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]}); +ref.push({testName: 'precision.determinant.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.04, 0.04]}); +ref.push({testName: 'precision.determinant.highp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]}); +ref.push({testName: 'precision.inverse.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.inverse.lowp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.inverse.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.inverse.lowp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]}); +ref.push({testName: 'precision.inverse.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 4.96677, 5.02716, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 4.96677, 5.02716]}); +ref.push({testName: 'precision.inverse.mediump_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 1.99512, 2.00488, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 1.99512, 2.00488]}); +ref.push({testName: 'precision.inverse.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 4.96677, 5.02716, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 4.96677, 5.02716]}); +ref.push({testName: 'precision.inverse.mediump_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 1.99512, 2.00488, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 1.99512, 2.00488]}); +ref.push({testName: 'precision.inverse.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 5, 5, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 5, 5]}); +ref.push({testName: 'precision.inverse.highp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 2, 2, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 2, 2]}); +ref.push({testName: 'precision.inverse.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 5, 5, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 5, 5]}); +ref.push({testName: 'precision.inverse.highp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 2, 2, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 2, 2]}); + + glsBuiltinPrecisionTestsUnitTests.plainArray = function(input) { + var ret = []; + + if (input instanceof tcuInterval.Interval) { + var i = 0; + ret[i] = input.m_hasNaN; + i++; + ret[i] = input.m_lo; + i++; + ret[i] = input.m_hi; + return ret; + } + + if (input instanceof tcuMatrix.Matrix) { + for (var i = 0, l = 0; i < input.cols; i++) + for (var j = 0; j < input.rows; j++, l++) { + ret[l] = input.matrix[i][j].m_hasNaN; + l++; + ret[l] = input.matrix[i][j].m_lo; + l++; + ret[l] = input.matrix[i][j].m_hi; + } + return ret; + } + + if (input instanceof Array) { + var size = input.length; + for (var i = 0, j = 0; j < size; j++, i++) { + ret[i] = input[j].m_hasNaN; + i++; + ret[i] = input[j].m_lo; + i++; + ret[i] = input[j].m_hi; + } + return ret; + } + return ret; + }; + + glsBuiltinPrecisionTestsUnitTests.Compare = function(num1, num2, diff) { + if (isFinite(num1)) + if (Math.abs(Math.abs(num1) - Math.abs(num2)) <= diff) + return true; + else + return false; + else + if (isFinite(num2)) + return false; + else + return true; + }; + + glsBuiltinPrecisionTestsUnitTests.referenceComparison = function(reference, index, precision) { + if (index > 1) + return true; + + var testName = _currentTestName; + var message1 = ''; + var ref1 = glsBuiltinPrecisionTestsUnitTests.plainArray(reference); + var a = ref.length; + var len; + var ref_len = ref1.length; + var cpp_nan; + var ref_nan; + var ref_lo; + var ref_hi; + var cpp_lo; + var cpp_hi; + var str; + var retVal1; + var retVal2; + var varfix = Math.max(0.0001, precision.ulp(0, 2)); + var error = false; + + for (var i = 0; i < a; i++) { + str = ref[i].testName; + + if (testName == str) { + len = ref[i].reference.length; + + if (len != ref_len) + return false; + + for (var j = 0; j < len; j++) { + cpp_nan = ref[i + index].reference[j]; + ref_nan = ref1[j]; + j++; + cpp_lo = ref[i + index].reference[j]; + ref_lo = ref1[j]; + j++; + cpp_hi = ref[i + index].reference[j]; + ref_hi = ref1[j]; + + if (ref_nan == cpp_nan) { + retVal1 = glsBuiltinPrecisionTestsUnitTests.Compare(ref_lo, cpp_lo, varfix); + retVal2 = glsBuiltinPrecisionTestsUnitTests.Compare(ref_hi, ref_hi, varfix); + + if ((retVal1 != true) || (retVal2 != true)) { + message1 = 'Error: ' + varfix; + bufferedLogToConsole(message1); + message1 = 'C++ Reference values: ' + cpp_nan + ', ' + cpp_lo + ', ' + cpp_hi; + bufferedLogToConsole(message1); + message1 = 'JS values: ' + ref_nan + ', ' + ref_lo + ', ' + ref_hi; + bufferedLogToConsole(message1); + error = true; + } + } + } + if (error) + return false; + else + return true; + } + } + return true; + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js new file mode 100644 index 000000000..eb7a4b293 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js @@ -0,0 +1,3452 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsDrawTests'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluStrUtil'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); + +goog.scope(function() { + + var glsDrawTests = modules.shared.glsDrawTests; + var tcuTestCase = framework.common.tcuTestCase; + var tcuRGBA = framework.common.tcuRGBA; + var tcuFloat = framework.common.tcuFloat; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuSurface = framework.common.tcuSurface; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuTextureUtil = framework.common.tcuTextureUtil; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluStrUtil = framework.opengl.gluStrUtil; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var rrShadingContext = framework.referencerenderer.rrShadingContext; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrVertexPacket = framework.referencerenderer.rrVertexPacket; + + /** @const {number} */ glsDrawTests.MAX_RENDER_TARGET_SIZE = 512; + + // Utils + + /** + * @param {glsDrawTests.DrawTestSpec.Target} target + * @return {number} + */ + glsDrawTests.targetToGL = function(target) { + assertMsgOptions(target != null, 'Target is null', false, true); + + var targets = [ + gl.ELEMENT_ARRAY_BUFFER, // TARGET_ELEMENT_ARRAY = 0, + gl.ARRAY_BUFFER // TARGET_ARRAY, + ]; + + return targets[target]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Usage} usage + * @return {number} + */ + glsDrawTests.usageToGL = function(usage) { + assertMsgOptions(usage != null, 'Usage is null', false, true); + + var usages = [ + gl.DYNAMIC_DRAW, // USAGE_DYNAMIC_DRAW = 0, + gl.STATIC_DRAW, // USAGE_STATIC_DRAW, + gl.STREAM_DRAW, // USAGE_STREAM_DRAW, + + gl.STREAM_READ, // USAGE_STREAM_READ, + gl.STREAM_COPY, // USAGE_STREAM_COPY, + + gl.STATIC_READ, // USAGE_STATIC_READ, + gl.STATIC_COPY, // USAGE_STATIC_COPY, + + gl.DYNAMIC_READ, // USAGE_DYNAMIC_READ, + gl.DYNAMIC_COPY // USAGE_DYNAMIC_COPY, + ]; + assertMsgOptions(usages.length == Object.keys(glsDrawTests.DrawTestSpec.Usage).length, + 'Amount of usage gl vlaues is different from amount of usages', false, true); + + return usages[usage]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {number} + */ + glsDrawTests.inputTypeToGL = function(type) { + assertMsgOptions(type != null, 'Input type is null', false, true); + + var types = [ + gl.FLOAT, // INPUTTYPE_FLOAT = 0, + gl.BYTE, // INPUTTYPE_BYTE, + gl.SHORT, // INPUTTYPE_SHORT, + gl.UNSIGNED_BYTE, // INPUTTYPE_UNSIGNED_BYTE, + gl.UNSIGNED_SHORT, // INPUTTYPE_UNSIGNED_SHORT, + + gl.INT, // INPUTTYPE_INT, + gl.UNSIGNED_INT, // INPUTTYPE_UNSIGNED_INT, + gl.HALF_FLOAT, // INPUTTYPE_HALF, + gl.UNSIGNED_INT_2_10_10_10_REV, // INPUTTYPE_UNSIGNED_INT_2_10_10_10, + gl.INT_2_10_10_10_REV // INPUTTYPE_INT_2_10_10_10, + ]; + assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.InputType).length, + 'Amount of gl input types is different from amount of input types', false, true); + + return types[type]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.OutputType} type + * @return {string} + */ + glsDrawTests.outputTypeToGLType = function(type) { + assertMsgOptions(type != null, 'Output type is null', false, true); + + var types = [ + 'float', // OUTPUTTYPE_FLOAT = 0, + 'vec2', // OUTPUTTYPE_VEC2, + 'vec3', // OUTPUTTYPE_VEC3, + 'vec4', // OUTPUTTYPE_VEC4, + + 'int', // OUTPUTTYPE_INT, + 'uint', // OUTPUTTYPE_UINT, + + 'ivec2', // OUTPUTTYPE_IVEC2, + 'ivec3', // OUTPUTTYPE_IVEC3, + 'ivec4', // OUTPUTTYPE_IVEC4, + + 'uvec2', // OUTPUTTYPE_UVEC2, + 'uvec3', // OUTPUTTYPE_UVEC3, + 'uvec4' // OUTPUTTYPE_UVEC4, + ]; + assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.OutputType).length, + 'Amount of output type names is different than amount of output types', false, true); + + return types[type]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive + * @return {number} + */ + glsDrawTests.primitiveToGL = function(primitive) { + var primitives = [ + gl.POINTS, // PRIMITIVE_POINTS = 0, + gl.TRIANGLES, // PRIMITIVE_TRIANGLES, + gl.TRIANGLE_FAN, // PRIMITIVE_TRIANGLE_FAN, + gl.TRIANGLE_STRIP, // PRIMITIVE_TRIANGLE_STRIP, + gl.LINES, // PRIMITIVE_LINES + gl.LINE_STRIP, // PRIMITIVE_LINE_STRIP + gl.LINE_LOOP + ]; + assertMsgOptions(primitives.length == Object.keys(glsDrawTests.DrawTestSpec.Primitive).length, + 'Amount of gl primitive values is different than amount of primitives', false, true); + + return primitives[primitive]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType + * @return {number} + */ + glsDrawTests.indexTypeToGL = function(indexType) { + var indexTypes = [ + gl.UNSIGNED_BYTE, // INDEXTYPE_BYTE = 0, + gl.UNSIGNED_SHORT, // INDEXTYPE_SHORT, + gl.UNSIGNED_INT // INDEXTYPE_INT, + ]; + assertMsgOptions(indexTypes.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length, + 'Amount of gl index types is different than amount of index types', false, true); + + return indexTypes[indexType]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType + * @return {?glsDrawTests.DrawTestSpec.InputType} + */ + glsDrawTests.indexTypeToInputType = function(indexType) { + var inputTypes = [ + glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE, // INDEXTYPE_BYTE = 0, + glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT, // INDEXTYPE_SHORT, + glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT // INDEXTYPE_INT, + ]; + assertMsgOptions(inputTypes.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length, + 'Amount of relevant input types is different than amount of index types', false, true); + + return inputTypes[indexType]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {boolean} + */ + glsDrawTests.inputTypeIsFloatType = function(type) { + if (type == glsDrawTests.DrawTestSpec.InputType.FLOAT) + return true; + if (type == glsDrawTests.DrawTestSpec.InputType.HALF) + return true; + return false; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.OutputType} type + * @return {boolean} + */ + glsDrawTests.outputTypeIsFloatType = function(type) { + if (type == glsDrawTests.DrawTestSpec.OutputType.FLOAT || + type == glsDrawTests.DrawTestSpec.OutputType.VEC2 || + type == glsDrawTests.DrawTestSpec.OutputType.VEC3 || + type == glsDrawTests.DrawTestSpec.OutputType.VEC4) + return true; + + return false; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.OutputType} type + * @return {boolean} + */ + glsDrawTests.outputTypeIsIntType = function(type) { + if (type == glsDrawTests.DrawTestSpec.OutputType.INT || + type == glsDrawTests.DrawTestSpec.OutputType.IVEC2 || + type == glsDrawTests.DrawTestSpec.OutputType.IVEC3 || + type == glsDrawTests.DrawTestSpec.OutputType.IVEC4) + return true; + + return false; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.OutputType} type + * @return {boolean} + */ + glsDrawTests.outputTypeIsUintType = function(type) { + if (type == glsDrawTests.DrawTestSpec.OutputType.UINT || + type == glsDrawTests.DrawTestSpec.OutputType.UVEC2 || + type == glsDrawTests.DrawTestSpec.OutputType.UVEC3 || + type == glsDrawTests.DrawTestSpec.OutputType.UVEC4) + return true; + + return false; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive + * @param {number} primitiveCount + * @return {number} + */ + glsDrawTests.getElementCount = function(primitive, primitiveCount) { + switch (primitive) { + case glsDrawTests.DrawTestSpec.Primitive.POINTS: return primitiveCount; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES: return primitiveCount * 3; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN: return primitiveCount + 2; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP: return primitiveCount + 2; + case glsDrawTests.DrawTestSpec.Primitive.LINES: return primitiveCount * 2; + case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP: return primitiveCount + 1; + case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP: return (primitiveCount == 1) ? (2) : (primitiveCount); + default: + throw new Error('Invalid primitive'); + } + }; + + //MethodInfo + + /** + * @typedef {{indexed: boolean, instanced: boolean, ranged: boolean, first: boolean}} + */ + glsDrawTests.MethodInfo = { + /** @type {boolean} */ indexed: false, + /** @type {boolean} */ instanced: false, + /** @type {boolean} */ ranged: false, + /** @type {boolean} */ first: false + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} method + * @return {glsDrawTests.MethodInfo} + */ + glsDrawTests.getMethodInfo = function(method) { + /** @type {Array} */ var infos = [{ + indexed: false, instanced: false, ranged: false, first: true //!< DRAWMETHOD_DRAWARRAYS, + },{ + indexed: false, instanced: true, ranged: false, first: true //!< DRAWMETHOD_DRAWARRAYS_INSTANCED, + },{ + indexed: true, instanced: false, ranged: false, first: false //!< DRAWMETHOD_DRAWELEMENTS, + },{ + indexed: true, instanced: false, ranged: true, first: false //!< DRAWMETHOD_DRAWELEMENTS_RANGED, + },{ + indexed: true, instanced: true, ranged: false, first: false //!< DRAWMETHOD_DRAWELEMENTS_INSTANCED + } + ]; + + assertMsgOptions(infos.length == Object.keys(glsDrawTests.DrawTestSpec.DrawMethod).length, + 'Number of info names', false, true); + assertMsgOptions(method < infos.length, 'Invalid method', false, true); + return /** @type {glsDrawTests.MethodInfo} */ (infos[method]); + }; + + /** + * @param {glsDrawTests.DrawTestSpec} a + * @param {glsDrawTests.DrawTestSpec} b + * @return {boolean} + */ + glsDrawTests.checkSpecsShaderCompatible = function(a, b) { + // Only the attributes matter + if (a.attribs.length != b.attribs.length) + return false; + + for (var ndx = 0; ndx < a.attribs.length; ++ndx) { + // Only the output type (== shader input type) matters and the usage in the shader. + + if (a.attribs[ndx].additionalPositionAttribute != b.attribs[ndx].additionalPositionAttribute) + return false; + + // component counts need not to match + if (glsDrawTests.outputTypeIsFloatType(a.attribs[ndx].outputType) && glsDrawTests.outputTypeIsFloatType(b.attribs[ndx].outputType)) + continue; + if (glsDrawTests.outputTypeIsIntType(a.attribs[ndx].outputType) && glsDrawTests.outputTypeIsIntType(b.attribs[ndx].outputType)) + continue; + if (glsDrawTests.outputTypeIsUintType(a.attribs[ndx].outputType) && glsDrawTests.outputTypeIsUintType(b.attribs[ndx].outputType)) + continue; + + return false; + } + + return true; + }; + + // generate random vectors in a way that does not depend on argument evaluation order + + /** + * @param {deRandom.Random} random + * @return {Array} + */ + glsDrawTests.generateRandomVec4 = function(random) { + /** @type {Array} */ var retVal = []; + + for (var i = 0; i < 4; ++i) + retVal[i] = random.getFloat(); + + return retVal; + }; + + /** + * @param {deRandom.Random} random + * @return {Array} + */ + glsDrawTests.generateRandomIVec4 = function(random) { + /** @type {Array} */ var retVal = []; + + for (var i = 0; i < 4; ++i) + retVal[i] = random.getInt(); + + return retVal; + }; + + /** + * @param {deRandom.Random} random + * @return {Array} + */ + glsDrawTests.generateRandomUVec4 = function(random) { + /** @type {Array} */ var retVal = []; + + for (var i = 0; i < 4; ++i) + retVal[i] = Math.abs(random.getInt()); + + return retVal; + }; + + //GLValue + + /** + * glsDrawTests.GLValue class + * @constructor + */ + glsDrawTests.GLValue = function() { + /** @type {goog.NumberArray} */ this.m_value = [0]; + /** @type {?glsDrawTests.DrawTestSpec.InputType} */ this.m_type; + }; + + /** + * @param {goog.TypedArray} dst + * @param {glsDrawTests.GLValue} val + */ + glsDrawTests.copyGLValueToArray = function(dst, val) { + /** @type {Uint8Array} */ var dst8 = new Uint8Array(dst.buffer).subarray(dst.byteOffset, dst.byteOffset + dst.byteLength); + /** @type {Uint8Array} */ var val8 = new Uint8Array(val.m_value.buffer); // TODO: Fix encapsulation issue + dst8.set(val8); + }; + + /** + * @param {goog.TypedArray} dst + * @param {goog.TypedArray} src + */ + glsDrawTests.copyArray = function(dst, src) { + /** @type {Uint8Array} */ var dst8 = new Uint8Array(dst.buffer).subarray(dst.byteOffset, dst.byteOffset + dst.byteLength); + /** @type {Uint8Array} */ var src8 = new Uint8Array(src.buffer).subarray(src.byteOffset, src.byteOffset + src.byteLength); + dst8.set(src8); + }; + + /** + * typeToTypedArray function. Determines which type of array will store the value, and stores it. + * @param {number} value + * @param {?glsDrawTests.DrawTestSpec.InputType} type + */ + glsDrawTests.GLValue.typeToTypedArray = function(value, type) { + var array; + + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + array = new Float32Array(1); + break; + + case glsDrawTests.DrawTestSpec.InputType.BYTE: + array = new Int8Array(1); + break; + case glsDrawTests.DrawTestSpec.InputType.SHORT: + array = new Int16Array(1); + break; + + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE: + array = new Uint8Array(1); + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT: + array = new Uint16Array(1); + break; + + case glsDrawTests.DrawTestSpec.InputType.INT: + array = new Int32Array(1); + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: + array = new Uint32Array(1); + break; + case glsDrawTests.DrawTestSpec.InputType.HALF: + array = new Uint16Array(1); + value = glsDrawTests.GLValue.floatToHalf(value); + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10: + array = new Uint32Array(1); + break; + case glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10: + array = new Int32Array(1); + break; + default: + throw new Error('glsDrawTests.GLValue.typeToTypedArray - Invalid InputType'); + } + + array[0] = value; + return array; + }; + + /** + * glsDrawTests.GLValue.create + * @param {number} value + * @param {?glsDrawTests.DrawTestSpec.InputType} type + */ + glsDrawTests.GLValue.create = function(value, type) { + var v = new glsDrawTests.GLValue(); + v.m_value = glsDrawTests.GLValue.typeToTypedArray(value, type); + v.m_type = type; + return v; + }; + + /** + * glsDrawTests.GLValue.halfToFloat + * @param {number} value + * @return {number} + */ + glsDrawTests.GLValue.halfToFloat = function(value) { + return tcuFloat.halfFloatToNumberNoDenorm(value); + }; + + /** + * @param {number} f + * @return {number} + */ + glsDrawTests.GLValue.floatToHalf = function(f) { + // No denorm support. + return tcuFloat.numberToHalfFloatNoDenorm(f); + }; + + /** + * glsDrawTests.GLValue.getMaxValue + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.getMaxValue = function(type) { + var value = 0; + + assertMsgOptions(type >= 0 && type < Object.keys(glsDrawTests.DrawTestSpec.InputType).length, + 'Invalid type for GLValue', false, true); + + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + value = 127; + break; + case glsDrawTests.DrawTestSpec.InputType.BYTE: + value = 127; + break; + case glsDrawTests.DrawTestSpec.InputType.SHORT: + value = 32760; + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE: + value = 255; + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT: + value = 65530; + break; + case glsDrawTests.DrawTestSpec.InputType.INT: + value = 2147483647; + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: + value = 4294967295; + break; + case glsDrawTests.DrawTestSpec.InputType.HALF: + value = 256; + break; + default: //For any other valid type, return 0 + value = 0; + } + + return glsDrawTests.GLValue.create(value, type); + }; + + /** + * glsDrawTests.GLValue.getMinValue + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.getMinValue = function(type) { + var value = 0; + + assertMsgOptions(type >= 0 && type < Object.keys(glsDrawTests.DrawTestSpec.InputType).length, + 'Invalid type for GLValue', false, true); + + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + value = -127; + break; + case glsDrawTests.DrawTestSpec.InputType.BYTE: + value = -127; + break; + case glsDrawTests.DrawTestSpec.InputType.SHORT: + value = -32760; + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE: + value = 0; + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT: + value = 0; + break; + case glsDrawTests.DrawTestSpec.InputType.INT: + value = -2147483647; + break; + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: + value = 0; + break; + case glsDrawTests.DrawTestSpec.InputType.HALF: + value = -256; + break; + default: //For any other valid type, return 0 + value = 0; + } + + return glsDrawTests.GLValue.create(value, type); + }; + + /** + * glsDrawTests.GLValue.getRandom + * @param {deRandom.Random} rnd + * @param {glsDrawTests.GLValue} min + * @param {glsDrawTests.GLValue} max + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.getRandom = function(rnd, min, max) { + assertMsgOptions(min.getType() == max.getType(), 'Min and max types differ', false, true); + + var minv = min.interpret(); + var maxv = max.interpret(); + var type = min.getType(); + var value; + + if (maxv < minv) + return min; + + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + case glsDrawTests.DrawTestSpec.InputType.HALF: { + return glsDrawTests.GLValue.create(minv + rnd.getFloat() * (maxv - minv), type); + break; + } + + case glsDrawTests.DrawTestSpec.InputType.SHORT: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT: + case glsDrawTests.DrawTestSpec.InputType.BYTE: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE: + case glsDrawTests.DrawTestSpec.InputType.INT: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: { + return glsDrawTests.GLValue.create(minv + rnd.getInt() % (maxv - minv), type); + break; + } + + default: + throw new Error('glsDrawTests.GLValue.getRandom - Invalid input type'); + break; + } + }; + + // Minimum difference required between coordinates + + /** + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.minValue = function(type) { + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + case glsDrawTests.DrawTestSpec.InputType.BYTE: + case glsDrawTests.DrawTestSpec.InputType.HALF: + return glsDrawTests.GLValue.create(4, type); + case glsDrawTests.DrawTestSpec.InputType.SHORT: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT: + return glsDrawTests.GLValue.create(4 * 256, type); + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE: + return glsDrawTests.GLValue.create(4 * 2, type); + case glsDrawTests.DrawTestSpec.InputType.INT: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: + return glsDrawTests.GLValue.create(4 * 16777216, type); + + default: + throw new Error('glsDrawTests.GLValue.minValue - Invalid input type'); + } + }; + + /** + * @param {glsDrawTests.GLValue} val + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.abs = function(val) { + var type = val.getType(); + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.SHORT: + return glsDrawTests.GLValue.create(0x7FFF & val.getValue(), type); + case glsDrawTests.DrawTestSpec.InputType.BYTE: + return glsDrawTests.GLValue.create(0x7F & val.getValue(), type); + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: + return val; + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + case glsDrawTests.DrawTestSpec.InputType.HALF: + return glsDrawTests.GLValue.create(Math.abs(val.interpret()), type); + case glsDrawTests.DrawTestSpec.InputType.INT: + return glsDrawTests.GLValue.create(0x7FFFFFFF & val.getValue(), type); + default: + throw new Error('glsDrawTests.GLValue.abs - Invalid input type'); + } + }; + + /** + * @return {?glsDrawTests.DrawTestSpec.InputType} + */ + glsDrawTests.GLValue.prototype.getType = function() { + return this.m_type; + }; + + /** + * glsDrawTests.GLValue.toFloat + * @return {number} + */ + glsDrawTests.GLValue.prototype.toFloat = function() { + return this.interpret(); + }; + + /** + * glsDrawTests.GLValue.getValue + * @return {number} + */ + glsDrawTests.GLValue.prototype.getValue = function() { + return this.m_value[0]; + }; + + /** + * interpret function. Returns the m_value as a quantity so arithmetic operations can be performed on it + * Only some types require this. + * @return {number} + */ + glsDrawTests.GLValue.prototype.interpret = function() { + if (this.m_type == glsDrawTests.DrawTestSpec.InputType.HALF) + return glsDrawTests.GLValue.halfToFloat(this.m_value[0]); + + return this.m_value[0]; + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.add = function(other) { + return glsDrawTests.GLValue.create(this.interpret() + other.interpret(), this.m_type); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.mul = function(other) { + return glsDrawTests.GLValue.create(this.interpret() * other.interpret(), this.m_type); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.div = function(other) { + return glsDrawTests.GLValue.create(this.interpret() / other.interpret(), this.m_type); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.sub = function(other) { + return glsDrawTests.GLValue.create(this.interpret() - other.interpret(), this.m_type); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.addToSelf = function(other) { + this.m_value[0] = this.interpret() + other.interpret(); + return this; + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.subToSelf = function(other) { + this.m_value[0] = this.interpret() - other.interpret(); + return this; + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.mulToSelf = function(other) { + this.m_value[0] = this.interpret() * other.interpret(); + return this; + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {glsDrawTests.GLValue} + */ + glsDrawTests.GLValue.prototype.divToSelf = function(other) { + this.m_value[0] = this.interpret() / other.interpret(); + return this; + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {boolean} + */ + glsDrawTests.GLValue.prototype.equals = function(other) { + return this.m_value[0] == other.getValue(); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {boolean} + */ + glsDrawTests.GLValue.prototype.lessThan = function(other) { + return this.interpret() < other.interpret(); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {boolean} + */ + glsDrawTests.GLValue.prototype.greaterThan = function(other) { + return this.interpret() > other.interpret(); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {boolean} + */ + glsDrawTests.GLValue.prototype.lessOrEqualThan = function(other) { + return this.interpret() <= other.interpret(); + }; + + /** + * @param {glsDrawTests.GLValue} other + * @return {boolean} + */ + glsDrawTests.GLValue.prototype.greaterOrEqualThan = function(other) { + return this.interpret() >= other.interpret(); + }; + + // AttriuteArray + + /** + * AttributeArray + * @constructor + * @param {?glsDrawTests.DrawTestSpec.Storage} storage + * @param {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} context + */ + glsDrawTests.AttributeArray = function(storage, context) { + /** @type {?glsDrawTests.DrawTestSpec.Storage} */ this.m_storage = storage; + /** @type {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} */ this.m_ctx = context; + /** @type {WebGLBuffer|sglrReferenceContext.DataBuffer|null} */ this.m_glBuffer; + + /** @type {number} */ this.m_size = 0; + /** @type {Uint8Array} */ this.m_data; //NOTE: Used in unsupported user storage + /** @type {number} */ this.m_componentCount; + /** @type {boolean} */ this.m_bound = false; + /** @type {glsDrawTests.DrawTestSpec.Target} */ this.m_target = glsDrawTests.DrawTestSpec.Target.ARRAY; + /** @type {?glsDrawTests.DrawTestSpec.InputType} */ this.m_inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT; + /** @type {?glsDrawTests.DrawTestSpec.OutputType} */ this.m_outputType = glsDrawTests.DrawTestSpec.OutputType.VEC4; + /** @type {boolean} */ this.m_normalize = false; + /** @type {number} */ this.m_stride = 0; + /** @type {number} */ this.m_offset = 0; + /** @type {Array} */ this.m_defaultAttrib; + /** @type {number} */ this.m_instanceDivisor = 0; + /** @type {boolean} */ this.m_isPositionAttr = false; + + if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + this.m_glBuffer = this.m_ctx.createBuffer(); + } + }; + + /** @return {number} */ glsDrawTests.AttributeArray.prototype.getComponentCount = function() {return this.m_componentCount;}; + + /** @return {?glsDrawTests.DrawTestSpec.Target} */ glsDrawTests.AttributeArray.prototype.getTarget = function() {return this.m_target;}; + + /** @return {?glsDrawTests.DrawTestSpec.InputType} */ glsDrawTests.AttributeArray.prototype.getInputType = function() {return this.m_inputType;}; + + /** @return {?glsDrawTests.DrawTestSpec.OutputType} */ glsDrawTests.AttributeArray.prototype.getOutputType = function() {return this.m_outputType;}; + + /** @return {?glsDrawTests.DrawTestSpec.Storage} */ glsDrawTests.AttributeArray.prototype.getStorageType = function() {return this.m_storage;}; + + /** @return {boolean} */ glsDrawTests.AttributeArray.prototype.getNormalized = function() {return this.m_normalize;}; + + /** @return {number} */ glsDrawTests.AttributeArray.prototype.getStride = function() {return this.m_stride;}; + + /** @return {boolean} */ glsDrawTests.AttributeArray.prototype.isBound = function() {return this.m_bound;}; + + /** @return {boolean} */ glsDrawTests.AttributeArray.prototype.isPositionAttribute = function() {return this.m_isPositionAttr;}; + + /** + * @param {glsDrawTests.DrawTestSpec.Target} target + * @param {number} size + * @param {goog.TypedArray} ptr + * @param {?glsDrawTests.DrawTestSpec.Usage} usage + */ + glsDrawTests.AttributeArray.prototype.data = function(target, size, ptr, usage) { + this.m_size = size; + this.m_target = target; + + if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsDrawTests.targetToGL(target), this.m_glBuffer); + this.m_ctx.bufferData(glsDrawTests.targetToGL(target), ptr, glsDrawTests.usageToGL(usage)); + } else + throw new Error('Wrong storage type'); + }; + + /** + * @param {glsDrawTests.DrawTestSpec.Target} target + * @param {number} offset + * @param {number} size + * @param {goog.TypedArray} ptr + */ + glsDrawTests.AttributeArray.prototype.subdata = function(target, offset, size, ptr) { + this.m_target = target; + + if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsDrawTests.targetToGL(target), this.m_glBuffer); + + this.m_ctx.bufferSubData(glsDrawTests.targetToGL(target), offset, size, ptr); + } else + throw new Error('Wrong storage type'); + }; + + /** + * @param {boolean} bound + * @param {number} offset + * @param {number} size + * @param {?glsDrawTests.DrawTestSpec.InputType} inputType + * @param {?glsDrawTests.DrawTestSpec.OutputType} outType + * @param {boolean} normalized + * @param {number} stride + * @param {number} instanceDivisor + * @param {Array} defaultAttrib + * @param {boolean} isPositionAttr + */ + glsDrawTests.AttributeArray.prototype.setupArray = function(bound, offset, size, inputType, outType, + normalized, stride, instanceDivisor, defaultAttrib, isPositionAttr) { + this.m_componentCount = size; + this.m_bound = bound; + this.m_inputType = inputType; + this.m_outputType = outType; + this.m_normalize = normalized; + this.m_stride = stride; + this.m_offset = offset; + this.m_defaultAttrib = defaultAttrib; + this.m_instanceDivisor = instanceDivisor; + this.m_isPositionAttr = isPositionAttr; + }; + + /** + * @param {number} loc (32-bit) + */ + glsDrawTests.AttributeArray.prototype.bindAttribute = function(loc) { + if (!this.isBound()) { + /** @type {Array} */ var attr = this.m_defaultAttrib; + switch (this.m_inputType) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: { + switch (this.m_componentCount) { + case 1: this.m_ctx.vertexAttrib1f(loc, attr[0]); break; + case 2: this.m_ctx.vertexAttrib2f(loc, attr[0], attr[1]); break; + case 3: this.m_ctx.vertexAttrib3f(loc, attr[0], attr[1], attr[2]); break; + case 4: this.m_ctx.vertexAttrib4f(loc, attr[0], attr[1], attr[2], attr[3]); break; + default: throw new Error('Invalid component count'); break; + } + break; + } + case glsDrawTests.DrawTestSpec.InputType.INT: { + this.m_ctx.vertexAttribI4i(loc, attr[0], attr[1], attr[2], attr[3]); + break; + } + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: { + this.m_ctx.vertexAttribI4ui(loc, attr[0], attr[1], attr[2], attr[3]); + break; + } + default: + throw new Error('Invalid input type'); + break; + } + } else { + /** @type {Uint8Array} */ var basePtr = null; + + if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsDrawTests.targetToGL(this.m_target), this.m_glBuffer); + + basePtr = null; + } else + throw new Error('Invalid storage type'); + + if (!glsDrawTests.inputTypeIsFloatType(this.m_inputType)) { + // Input is not float type + + if (glsDrawTests.outputTypeIsFloatType(this.m_outputType)) { + var size = this.m_componentCount; + + // Output type is float type + this.m_ctx.vertexAttribPointer(loc, size, glsDrawTests.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_offset); + } else { + // Output type is int type + this.m_ctx.vertexAttribIPointer(loc, this.m_componentCount, glsDrawTests.inputTypeToGL(this.m_inputType), this.m_stride, this.m_offset); + } + } else { + // Input type is float type + + // Output type must be float type + assertMsgOptions(glsDrawTests.outputTypeIsFloatType(this.m_outputType), 'Output type is not float', false, true); + + this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsDrawTests.inputTypeToGL(this.m_inputType), this.m_normalize, + this.m_stride, this.m_offset); + } + + if (this.m_instanceDivisor) + this.m_ctx.vertexAttribDivisor(loc, this.m_instanceDivisor); + } + }; + + /** + * @param {glsDrawTests.DrawTestSpec.Target} target + */ + glsDrawTests.AttributeArray.prototype.bindIndexArray = function(target) { + if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsDrawTests.targetToGL(target), this.m_glBuffer); + } + }; + + // DrawTestShaderProgram + + /** + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {Array} arrays + */ + glsDrawTests.DrawTestShaderProgram = function(arrays) { + sglrShaderProgram.ShaderProgram.call(this, this.createProgramDeclaration(arrays)); + + this.m_componentCount = []; + this.m_isCoord = []; + this.m_attrType = []; + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) { + this.m_componentCount[arrayNdx] = this.getComponentCount(arrays[arrayNdx].getOutputType()); + this.m_isCoord[arrayNdx] = arrays[arrayNdx].isPositionAttribute(); + this.m_attrType[arrayNdx] = this.mapOutputType(arrays[arrayNdx].getOutputType()); + } + }; + + glsDrawTests.DrawTestShaderProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + glsDrawTests.DrawTestShaderProgram.prototype.constructor = glsDrawTests.DrawTestShaderProgram; + + /** + * @param {Array} color + * @param {goog.NumberArray} attribValue + * @param {number} numComponents + * @return {Array} + */ + glsDrawTests.calcShaderColor = function(color, attribValue, numComponents) { + switch (numComponents) { + case 1: + color[0] = deMath.scale(color, attribValue[0])[0]; + break; + + case 2: + color[0] = color[0] * attribValue[0]; + color[1] = color[1] * attribValue[1]; + break; + + case 3: + color[0] = color[0] * attribValue[0]; + color[1] = color[1] * attribValue[1]; + color[2] = color[2] * attribValue[2]; + break; + + case 4: + color[0] = color[0] * attribValue[0] * attribValue[3]; + color[1] = color[1] * attribValue[1] * attribValue[3]; + color[2] = color[2] * attribValue[2] * attribValue[3]; + break; + + default: + throw new Error('Invalid component count'); + } + + return color; + }; + + /** + * @param {Array} coord + * @param {goog.NumberArray} attribValue + * @param {number} numComponents + * @return {Array} + */ + glsDrawTests.calcShaderCoord = function(coord, attribValue, numComponents) { + switch (numComponents) { + case 1: + + coord = deMath.add(coord, [attribValue[0], attribValue[0]]); + coord[0] = coord[0]; + coord[1] = coord[1]; + break; + case 2: + coord = deMath.add(coord, [attribValue[0], attribValue[1]]); + coord[0] = coord[0]; + coord[1] = coord[1]; + break; + case 3: + coord = deMath.add(coord, [attribValue[0] + attribValue[2], attribValue[1]]); + coord[0] = coord[0]; + coord[1] = coord[1]; + coord[2] = coord[2]; + break; + case 4: + coord = deMath.add(coord, [attribValue[0] + attribValue[2], attribValue[1] + attribValue[3]]); + coord[0] = coord[0]; + coord[1] = coord[1]; + coord[2] = coord[2]; + coord[3] = coord[3]; + break; + + default: + throw new Error('Invalid component count'); + } + + return coord; + }; + + /** + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + glsDrawTests.DrawTestShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) { + var u_coordScale = this.getUniformByName('u_coordScale').value; + var u_colorScale = this.getUniformByName('u_colorScale').value; + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + var varyingLocColor = 0; + + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + // Calc output color + /** @type {Array} */ var coord = [0.0, 0.0]; + /** @type {Array} */ var color = [1.0, 1.0, 1.0]; + + for (var attribNdx = 0; attribNdx < this.m_attrType.length; attribNdx++) { + var numComponents = this.m_componentCount[attribNdx]; + /** @type {boolean} */ var isCoord = this.m_isCoord[attribNdx]; + + var attrib = rrVertexAttrib.readVertexAttrib(inputs[attribNdx], packet.instanceNdx, packet.vertexNdx, this.m_attrType[attribNdx]); + + if (isCoord) { + coord = glsDrawTests.calcShaderCoord( + coord, + attrib, + numComponents + ); + } else { + color = glsDrawTests.calcShaderColor( + color, + attrib, + numComponents + ); + } + } + + // Transform position + packet.position = [u_coordScale * coord[0], u_coordScale * coord[1], 1.0, 1.0]; + packet.pointSize = 1.0; + + // Pass color to FS + packet.outputs[varyingLocColor] = deMath.add(deMath.scale([u_colorScale * color[0], u_colorScale * color[1], u_colorScale * color[2], 1.0], 0.5), [0.5, 0.5, 0.5, 0.5]); + } + }; + + /** + * @param {Array} packets + * @param {rrShadingContext.FragmentShadingContext} context + */ + glsDrawTests.DrawTestShaderProgram.prototype.shadeFragments = function(packets, context) { + var varyingLocColor = 0; + + for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) { + /** @type {rrFragmentOperations.Fragment} */ var packet = packets[packetNdx]; + packet.value = rrShadingContext.readVarying(packet, context, varyingLocColor); + } + }; + + /** + * @param {Array} arrays + * @return {string} + */ + glsDrawTests.DrawTestShaderProgram.prototype.genVertexSource = function(arrays) { + /** @type {Array}*/ var params; + var vertexShaderTmpl = ''; + + params = this.generateShaderParams(); + + vertexShaderTmpl += params['VTX_HDR']; + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) { + vertexShaderTmpl += params['VTX_IN'] + ' highp ' + glsDrawTests.outputTypeToGLType(arrays[arrayNdx].getOutputType()) + ' a_' + arrayNdx + ';\n'; + } + + vertexShaderTmpl += + 'uniform highp float u_coordScale;\n' + + 'uniform highp float u_colorScale;\n' + + params['VTX_OUT'] + ' ' + params['COL_PRECISION'] + ' vec4 v_color;\n' + + 'void main(void)\n' + + '{\n' + + '\tgl_PointSize = 1.0;\n' + + '\thighp vec2 coord = vec2(0.0, 0.0);\n' + + '\thighp vec3 color = vec3(1.0, 1.0, 1.0);\n'; + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) { + var isPositionAttr = arrays[arrayNdx].isPositionAttribute(); + + if (isPositionAttr) { + switch (arrays[arrayNdx].getOutputType()) { + case glsDrawTests.DrawTestSpec.OutputType.FLOAT: + case glsDrawTests.DrawTestSpec.OutputType.INT: + case glsDrawTests.DrawTestSpec.OutputType.UINT: + vertexShaderTmpl += + '\tcoord += vec2(float(a_' + arrayNdx + '), float(a_' + arrayNdx + '));\n'; + break; + + case glsDrawTests.DrawTestSpec.OutputType.VEC2: + case glsDrawTests.DrawTestSpec.OutputType.IVEC2: + case glsDrawTests.DrawTestSpec.OutputType.UVEC2: + vertexShaderTmpl += + '\tcoord += vec2(a_' + arrayNdx + '.xy);\n'; + break; + + case glsDrawTests.DrawTestSpec.OutputType.VEC3: + case glsDrawTests.DrawTestSpec.OutputType.IVEC3: + case glsDrawTests.DrawTestSpec.OutputType.UVEC3: + vertexShaderTmpl += + '\tcoord += vec2(a_' + arrayNdx + '.xy);\n' + + '\tcoord.x += float(a_' + arrayNdx + '.z);\n'; + break; + + case glsDrawTests.DrawTestSpec.OutputType.VEC4: + case glsDrawTests.DrawTestSpec.OutputType.IVEC4: + case glsDrawTests.DrawTestSpec.OutputType.UVEC4: + vertexShaderTmpl += + '\tcoord += vec2(a_' + arrayNdx + '.xy);\n' + + '\tcoord += vec2(a_' + arrayNdx + '.zw);\n'; + break; + + default: + throw new Error('Invalid output type'); + break; + } + } else { + switch (arrays[arrayNdx].getOutputType()) { + case glsDrawTests.DrawTestSpec.OutputType.FLOAT: + case glsDrawTests.DrawTestSpec.OutputType.INT: + case glsDrawTests.DrawTestSpec.OutputType.UINT: + vertexShaderTmpl += + '\tcolor = color * float(a_' + arrayNdx + ');\n'; + break; + + case glsDrawTests.DrawTestSpec.OutputType.VEC2: + case glsDrawTests.DrawTestSpec.OutputType.IVEC2: + case glsDrawTests.DrawTestSpec.OutputType.UVEC2: + vertexShaderTmpl += + '\tcolor.rg = color.rg * vec2(a_' + arrayNdx + '.xy);\n'; + break; + + case glsDrawTests.DrawTestSpec.OutputType.VEC3: + case glsDrawTests.DrawTestSpec.OutputType.IVEC3: + case glsDrawTests.DrawTestSpec.OutputType.UVEC3: + vertexShaderTmpl += + '\tcolor = color.rgb * vec3(a_' + arrayNdx + '.xyz);\n'; + break; + + case glsDrawTests.DrawTestSpec.OutputType.VEC4: + case glsDrawTests.DrawTestSpec.OutputType.IVEC4: + case glsDrawTests.DrawTestSpec.OutputType.UVEC4: + vertexShaderTmpl += + '\tcolor = color.rgb * vec3(a_' + arrayNdx + '.xyz) * float(a_' + arrayNdx + '.w);\n'; + break; + + default: + throw new Error('Invalid output type'); + break; + } + } + } + + vertexShaderTmpl += + '\tv_color = vec4(u_colorScale * color, 1.0) * 0.5 + vec4(0.5, 0.5, 0.5, 0.5);\n' + + '\tgl_Position = vec4(u_coordScale * coord, 1.0, 1.0);\n' + + '}\n'; + + return vertexShaderTmpl; + }; + + /** + * @return {string} + */ + glsDrawTests.DrawTestShaderProgram.prototype.genFragmentSource = function() { + /** @type {Array} */ var params; + + params = this.generateShaderParams(); + + var fragmentShaderTmpl = params['FRAG_HDR'] + + params['FRAG_IN'] + ' ' + params['COL_PRECISION'] + ' vec4 v_color;\n' + + 'void main(void)\n' + + '{\n' + + '\t' + params['FRAG_COLOR'] + '= v_color;\n' + + '}\n'; + + return fragmentShaderTmpl; + }; + + /** + * @return {Array} + */ + glsDrawTests.DrawTestShaderProgram.prototype.generateShaderParams = function() { + /** @type {Array} */ var params = []; + if (gluShaderUtil.isGLSLVersionSupported(gl, gluShaderUtil.GLSLVersion.V300_ES)) { + params['VTX_IN'] = 'in'; + params['VTX_OUT'] = 'out'; + params['FRAG_IN'] = 'in'; + params['FRAG_COLOR'] = 'dEQP_FragColor'; + params['VTX_HDR'] = '#version 300 es\n'; + params['FRAG_HDR'] = '#version 300 es\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + params['COL_PRECISION'] = 'mediump'; + } else if (gluShaderUtil.isGLSLVersionSupported(gl, gluShaderUtil.GLSLVersion.V100_ES)) { + params['VTX_IN'] = 'attribute'; + params['VTX_OUT'] = 'varying'; + params['FRAG_IN'] = 'varying'; + params['FRAG_COLOR'] = 'gl_FragColor'; + params['VTX_HDR'] = ''; + params['FRAG_HDR'] = ''; + params['COL_PRECISION'] = 'mediump'; + } else + throw new Error('Invalid GL version'); + + return params; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.OutputType} type + * @return {rrGenericVector.GenericVecType} + */ + glsDrawTests.DrawTestShaderProgram.prototype.mapOutputType = function(type) { + switch (type) { + case glsDrawTests.DrawTestSpec.OutputType.FLOAT: + case glsDrawTests.DrawTestSpec.OutputType.VEC2: + case glsDrawTests.DrawTestSpec.OutputType.VEC3: + case glsDrawTests.DrawTestSpec.OutputType.VEC4: + return rrGenericVector.GenericVecType.FLOAT; + + case glsDrawTests.DrawTestSpec.OutputType.INT: + case glsDrawTests.DrawTestSpec.OutputType.IVEC2: + case glsDrawTests.DrawTestSpec.OutputType.IVEC3: + case glsDrawTests.DrawTestSpec.OutputType.IVEC4: + return rrGenericVector.GenericVecType.INT32; + + case glsDrawTests.DrawTestSpec.OutputType.UINT: + case glsDrawTests.DrawTestSpec.OutputType.UVEC2: + case glsDrawTests.DrawTestSpec.OutputType.UVEC3: + case glsDrawTests.DrawTestSpec.OutputType.UVEC4: + return rrGenericVector.GenericVecType.UINT32; + + default: + throw new Error('Invalid output type'); + } + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.OutputType} type + * @return {number} + */ + glsDrawTests.DrawTestShaderProgram.prototype.getComponentCount = function(type) { + switch (type) { + case glsDrawTests.DrawTestSpec.OutputType.FLOAT: + case glsDrawTests.DrawTestSpec.OutputType.INT: + case glsDrawTests.DrawTestSpec.OutputType.UINT: + return 1; + + case glsDrawTests.DrawTestSpec.OutputType.VEC2: + case glsDrawTests.DrawTestSpec.OutputType.IVEC2: + case glsDrawTests.DrawTestSpec.OutputType.UVEC2: + return 2; + + case glsDrawTests.DrawTestSpec.OutputType.VEC3: + case glsDrawTests.DrawTestSpec.OutputType.IVEC3: + case glsDrawTests.DrawTestSpec.OutputType.UVEC3: + return 3; + + case glsDrawTests.DrawTestSpec.OutputType.VEC4: + case glsDrawTests.DrawTestSpec.OutputType.IVEC4: + case glsDrawTests.DrawTestSpec.OutputType.UVEC4: + return 4; + + default: + throw new Error('Invalid output type'); + } + }; + + /** + * @param {Array} arrays + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + glsDrawTests.DrawTestShaderProgram.prototype.createProgramDeclaration = function(arrays) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_' + arrayNdx, this.mapOutputType(arrays[arrayNdx].getOutputType()))); + + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + + decl.pushVertexSource(new sglrShaderProgram.VertexSource(this.genVertexSource(arrays))); + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(this.genFragmentSource())); + + decl.pushUniform(new sglrShaderProgram.Uniform('u_coordScale', gluShaderUtil.DataType.FLOAT)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_colorScale', gluShaderUtil.DataType.FLOAT)); + + return decl; + }; + + /** + * @typedef {glsDrawTests.RandomArrayGenerator} + */ + glsDrawTests.RandomArrayGenerator = {}; + + /** + * @param {goog.TypedArray} data + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @param {deRandom.Random} rnd + * @param {glsDrawTests.GLValue} min + * @param {glsDrawTests.GLValue} max + */ + glsDrawTests.RandomArrayGenerator.setData = function(data, type, rnd, min, max) { + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + case glsDrawTests.DrawTestSpec.InputType.SHORT: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT: + case glsDrawTests.DrawTestSpec.InputType.BYTE: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE: + case glsDrawTests.DrawTestSpec.InputType.INT: + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: + case glsDrawTests.DrawTestSpec.InputType.HALF: + glsDrawTests.copyGLValueToArray(data, glsDrawTests.GLValue.getRandom(rnd, min, max)); + break; + default: + throw new Error('Invalid input type'); + } + }; + + /** + * createBasicArray + * @param {number} seed + * @param {number} elementCount + * @param {number} componentCount + * @param {number} offset + * @param {number} stride + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @param {number} first + * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive + * @param {?goog.TypedArray} indices + * @param {number} indexSize + * @return {goog.TypedArray} + */ + glsDrawTests.RandomArrayGenerator.createArray = function(seed, elementCount, componentCount, offset, stride, type, first, primitive, indices, indexSize) { + assertMsgOptions(componentCount >= 1 && componentCount <= 4, 'Unacceptable number of components', false, true); + + /** @type {glsDrawTests.GLValue} */ var min = glsDrawTests.GLValue.getMinValue(type); + /** @type {glsDrawTests.GLValue} */ var max = glsDrawTests.GLValue.getMaxValue(type); + + var packed = type == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10 || + type == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10; + /** @type {number} */ var limit10 = (1 << 10); + /** @type {number} */ var limit2 = (1 << 2); + + + /** @type {number} */ var componentSize = glsDrawTests.DrawTestSpec.inputTypeSize(type); + /** @type {number} */ var elementSize = componentSize * componentCount; + /** @type {number} */ var bufferSize = offset + Math.max(elementCount * stride, elementCount * elementSize); + + var data = new ArrayBuffer(bufferSize); + var writePtr = new Uint8Array(data, offset); + + var previousComponentsFloat = [0, 0, 0, 0]; + var rnd = new deRandom.Random(seed); + + for (var vertexNdx = 0; vertexNdx < elementCount; vertexNdx++) { + var components = []; + + for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) { + var getRandomComponent = function() { + // For packed formats we can't use GLValue + if (packed) { + if (componentNdx == 3) { + return rnd.getInt() % limit2; + } else { + return rnd.getInt() % limit10; + } + } else { + return glsDrawTests.GLValue.getRandom(rnd, min, max); + } + }; + + var component = getRandomComponent(); + var componentFloat = (component instanceof glsDrawTests.GLValue) ? component.toFloat() : component; + + // Try to not create vertex near previous + if (vertexNdx != 0 && Math.abs(componentFloat - previousComponentsFloat[componentNdx]) < min.toFloat()) { + // Too close, try again (but only once) + component = getRandomComponent(); + componentFloat = (component instanceof glsDrawTests.GLValue) ? component.toFloat() : component; + } + + components.push(component); + previousComponentsFloat[componentNdx] = componentFloat; + } + + if (packed) { + var packedValue = deMath.binaryOp( + deMath.shiftLeft(/** @type {Array} */ (components)[3], 30), deMath.binaryOp( + deMath.shiftLeft(/** @type {Array} */ (components)[2], 20), deMath.binaryOp( + deMath.shiftLeft(/** @type {Array} */ (components)[1], 10), /** @type {Array} */ (components)[0], deMath.BinaryOp.OR + ), deMath.BinaryOp.OR + ), deMath.BinaryOp.OR + ); + glsDrawTests.copyArray(writePtr, new Uint32Array([packedValue])); + } else { + for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) { + glsDrawTests.copyGLValueToArray(writePtr.subarray(componentNdx * componentSize), components[componentNdx]); + } + } + + writePtr = writePtr.subarray(stride); + } + + return new Uint8Array(data); + }; + + /** + * @param {number} seed + * @param {number} elementCount + * @param {?glsDrawTests.DrawTestSpec.IndexType} type + * @param {number} offset + * @param {number} min + * @param {number} max + * @return {goog.TypedArray} + */ + glsDrawTests.RandomArrayGenerator.generateIndices = function(seed, elementCount, type, offset, min, max) { + return glsDrawTests.RandomArrayGenerator.createIndices(seed, elementCount, offset, min, max, type); + }; + + /** + * @param {number} seed + * @param {number} elementCount + * @param {number} offset + * @param {number} min + * @param {number} max + * @param {?glsDrawTests.DrawTestSpec.IndexType} type + * @return {goog.TypedArray} + */ + glsDrawTests.RandomArrayGenerator.createIndices = function(seed, elementCount, offset, min, max, type) { + /** @type {number}*/ var elementSize = glsDrawTests.DrawTestSpec.indexTypeSize(type); + /** @type {number}*/ var bufferSize = offset + elementCount * elementSize; + + var data = new ArrayBuffer(bufferSize); + var writePtr = new Uint8Array(data).subarray(offset); + + var rnd = new deRandom.Random(seed); + + /* TODO: get limits for given index type --> if (min < 0 || min > std::numeric_limits::max() || + max < 0 || max > std::numeric_limits::max() || + min > max) + DE_ASSERT(!"Invalid range");*/ + + // JS refrast requires shuffled unique keys + var keys = []; + for (var key = 0; key < elementCount; key++) + keys.push(glsDrawTests.GLValue.create(key, glsDrawTests.indexTypeToInputType(type))); + + for (var elementNdx = 0; elementNdx < elementCount; ++elementNdx) { + var randomkey = rnd.getInt(0, keys.length - 1); + var ndx = keys[randomkey]; + + keys.splice(randomkey, 1); + + glsDrawTests.copyArray( + writePtr.subarray(elementSize * elementNdx), + new Uint8Array(ndx.m_value.buffer) + ); + } + + return new Uint8Array(data); + }; + + /** + * @param {number} seed + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {Array} + */ + glsDrawTests.RandomArrayGenerator.generateAttributeValue = function(seed, type) { + var random = new deRandom.Random(seed); + + switch (type) { + case glsDrawTests.DrawTestSpec.InputType.FLOAT: + return glsDrawTests.generateRandomVec4(random); + + case glsDrawTests.DrawTestSpec.InputType.INT: + return glsDrawTests.generateRandomIVec4(random); + + case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: + return glsDrawTests.generateRandomUVec4(random); + + default: + throw new Error('Invalid attribute type'); + } + }; + + // AttributePack + + /** + * @param {sglrReferenceContext.ReferenceContext | sglrGLContext.GLContext} drawContext + * @param {Array} screenSize (2 positive elements in array) + * @param {boolean} useVao + * @param {boolean} logEnabled + * @constructor + */ + glsDrawTests.AttributePack = function(drawContext, screenSize, useVao, logEnabled) { + /** @type {sglrReferenceContext.ReferenceContext | sglrGLContext.GLContext} */ this.m_ctx = drawContext; + + /** @type {Array} */ this.m_arrays = []; + /** @type {sglrShaderProgram.ShaderProgram} */ this.m_program; + /** @type {tcuSurface.Surface} */ this.m_screen = new tcuSurface.Surface(screenSize[0], screenSize[1]); + /** @type {boolean} */ this.m_useVao = useVao; + /** @type {boolean} */ this.m_logEnabled = logEnabled; + /** @type {WebGLProgram | sglrShaderProgram.ShaderProgram | null} */ this.m_programID = null; + /** @type {WebGLVertexArrayObject|sglrReferenceContext.VertexArray|null} */ this.m_vaoID = null; + + if (this.m_useVao) + this.m_vaoID = this.m_ctx.createVertexArray(); + }; + + /** + * @return {tcuSurface.Surface} + */ + glsDrawTests.AttributePack.prototype.getSurface = function() { + return this.m_screen; + }; + + /** + * @param {number} i + * @return {glsDrawTests.AttributeArray} + */ + glsDrawTests.AttributePack.prototype.getArray = function(i) { + return this.m_arrays[i]; + }; + + /** + * @return number + */ + glsDrawTests.AttributePack.prototype.getArrayCount = function() { + return this.m_arrays.length; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Storage} storage + */ + glsDrawTests.AttributePack.prototype.newArray = function(storage) { + this.m_arrays.push(new glsDrawTests.AttributeArray(storage, this.m_ctx)); + }; + + /** + * clearArrays + */ + glsDrawTests.AttributePack.prototype.clearArrays = function() { + this.m_arrays.length = 0; + }; + + /** + * updateProgram + */ + glsDrawTests.AttributePack.prototype.updateProgram = function() { + if (this.m_programID) + this.m_ctx.deleteProgram(this.m_programID); + + this.m_program = new glsDrawTests.DrawTestShaderProgram(this.m_arrays); + this.m_programID = this.m_ctx.createProgram(this.m_program); + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod + * @param {number} firstVertex + * @param {number} vertexCount + * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType + * @param {number} indexOffset + * @param {number} rangeStart + * @param {number} rangeEnd + * @param {number} instanceCount + * @param {number} coordScale + * @param {number} colorScale + * @param {glsDrawTests.AttributeArray} indexArray + */ + glsDrawTests.AttributePack.prototype.render = function(primitive, drawMethod, firstVertex, vertexCount, indexType, + indexOffset, rangeStart, rangeEnd, instanceCount, coordScale, colorScale, indexArray) { + assertMsgOptions(this.m_program != null, 'Program is null', false, true); + assertMsgOptions(this.m_programID != null, 'No context created program', false, true); + + this.m_ctx.viewport(0, 0, this.m_screen.getWidth(), this.m_screen.getHeight()); + this.m_ctx.clearColor(0.0, 0.0, 0.0, 1.0); + this.m_ctx.clear(gl.COLOR_BUFFER_BIT); + + this.m_ctx.useProgram(this.m_programID); + + this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(this.m_programID, 'u_coordScale'), coordScale); + this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(this.m_programID, 'u_colorScale'), colorScale); + + if (this.m_useVao) + this.m_ctx.bindVertexArray(this.m_vaoID); + + if (indexArray) + indexArray.bindIndexArray(glsDrawTests.DrawTestSpec.Target.ELEMENT_ARRAY); + + for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) { + var attribName = ''; + attribName += 'a_' + arrayNdx; + + var loc = this.m_ctx.getAttribLocation(this.m_programID, attribName); + + if (this.m_arrays[arrayNdx].isBound()) + this.m_ctx.enableVertexAttribArray(loc); + + this.m_arrays[arrayNdx].bindAttribute(loc); + } + + if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS) + this.m_ctx.drawArrays(glsDrawTests.primitiveToGL(primitive), firstVertex, vertexCount); + else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED) + this.m_ctx.drawArraysInstanced(glsDrawTests.primitiveToGL(primitive), firstVertex, vertexCount, instanceCount); + else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS) + this.m_ctx.drawElements(glsDrawTests.primitiveToGL(primitive), vertexCount, glsDrawTests.indexTypeToGL(indexType), indexOffset); + else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED) + this.m_ctx.drawRangeElements(glsDrawTests.primitiveToGL(primitive), rangeStart, rangeEnd, vertexCount, glsDrawTests.indexTypeToGL(indexType), indexOffset); + else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED) + this.m_ctx.drawElementsInstanced(glsDrawTests.primitiveToGL(primitive), vertexCount, glsDrawTests.indexTypeToGL(indexType), indexOffset, instanceCount); + else + throw new Error('Invalid draw method'); + + for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) { + if (this.m_arrays[arrayNdx].isBound()) { + var attribName = ''; + attribName += 'a_' + arrayNdx; + + var loc = this.m_ctx.getAttribLocation(this.m_programID, attribName); + + this.m_ctx.disableVertexAttribArray(loc); + } + } + + if (this.m_useVao) + this.m_ctx.bindVertexArray(null); + + this.m_ctx.useProgram(null); + this.m_screen.readViewport(this.m_ctx, [0 , 0, this.m_screen.getWidth(), this.m_screen.getHeight()]); + }; + + // DrawTestSpec + + /** + * @constructor + */ + glsDrawTests.DrawTestSpec = function() { + /** @type {?glsDrawTests.DrawTestSpec.Primitive} */ this.primitive = null; + /** @type {number} */ this.primitiveCount = 0; //!< number of primitives to draw (per instance) + + /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.drawMethod = null; + /** @type {?glsDrawTests.DrawTestSpec.IndexType} */ this.indexType = null; //!< used only if drawMethod = DrawElements* + /** @type {number} */ this.indexPointerOffset = 0; //!< used only if drawMethod = DrawElements* + /** @type {?glsDrawTests.DrawTestSpec.Storage} */ this.indexStorage = null; //!< used only if drawMethod = DrawElements* + /** @type {number} */ this.first = 0; //!< used only if drawMethod = DrawArrays* + /** @type {number} */ this.indexMin = 0; //!< used only if drawMethod = Draw*Ranged + /** @type {number} */ this.indexMax = 0; //!< used only if drawMethod = Draw*Ranged + /** @type {number} */ this.instanceCount = 0; //!< used only if drawMethod = Draw*Instanced or Draw*Indirect + /** @type {number} */ this.indirectOffset = 0; //!< used only if drawMethod = Draw*Indirect + /** @type {number} */ this.baseVertex = 0; //!< used only if drawMethod = DrawElementsIndirect or *BaseVertex + + /** @type {Array} */ this.attribs = []; + }; + + /** + * @param {glsDrawTests.DrawTestSpec.Target} target + * @return {string} + */ + glsDrawTests.DrawTestSpec.targetToString = function(target) { + assertMsgOptions(target != null, 'Target is null', false, true); + + var targets = [ + 'element_array', // TARGET_ELEMENT_ARRAY = 0, + 'array' // TARGET_ARRAY, + ]; + assertMsgOptions(targets.length == Object.keys(glsDrawTests.DrawTestSpec.Target).length, + 'The amount of target names is different than the amount of targets', false, true); + + return targets[target]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {string} + */ + glsDrawTests.DrawTestSpec.inputTypeToString = function(type) { + assertMsgOptions(type != null, 'Type is null', false, true); + + var types = [ + 'float', // INPUTTYPE_FLOAT = 0, + + 'byte', // INPUTTYPE_BYTE, + 'short', // INPUTTYPE_SHORT, + + 'unsigned_byte', // INPUTTYPE_UNSIGNED_BYTE, + 'unsigned_short', // INPUTTYPE_UNSIGNED_SHORT, + + 'int', // INPUTTYPE_INT, + 'unsigned_int', // INPUTTYPE_UNSIGNED_INT, + 'half', // INPUTTYPE_HALF, + 'unsigned_int2_10_10_10', // INPUTTYPE_UNSIGNED_INT_2_10_10_10, + 'int2_10_10_10' // INPUTTYPE_INT_2_10_10_10, + ]; + assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.InputType).length, + 'The amount of type names is different than the amount of types', false, true); + + return types[type]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.OutputType} type + * @return {string} + */ + glsDrawTests.DrawTestSpec.outputTypeToString = function(type) { + assertMsgOptions(type != null, 'Type is null', false, true); + + var types = [ + 'float', // OUTPUTTYPE_FLOAT = 0, + 'vec2', // OUTPUTTYPE_VEC2, + 'vec3', // OUTPUTTYPE_VEC3, + 'vec4', // OUTPUTTYPE_VEC4, + + 'int', // OUTPUTTYPE_INT, + 'uint', // OUTPUTTYPE_UINT, + + 'ivec2', // OUTPUTTYPE_IVEC2, + 'ivec3', // OUTPUTTYPE_IVEC3, + 'ivec4', // OUTPUTTYPE_IVEC4, + + 'uvec2', // OUTPUTTYPE_UVEC2, + 'uvec3', // OUTPUTTYPE_UVEC3, + 'uvec4' // OUTPUTTYPE_UVEC4, + ]; + assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.OutputType).length, + 'The amount of type names is different than the amount of types', false, true); + + return types[type]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Usage} usage + * @return {string} + */ + glsDrawTests.DrawTestSpec.usageTypeToString = function(usage) { + assertMsgOptions(usage != null, 'Usage is null', false, true); + + var usages = [ + 'dynamic_draw', // USAGE_DYNAMIC_DRAW = 0, + 'static_draw', // USAGE_STATIC_DRAW, + 'stream_draw', // USAGE_STREAM_DRAW, + + 'stream_read', // USAGE_STREAM_READ, + 'stream_copy', // USAGE_STREAM_COPY, + + 'static_read', // USAGE_STATIC_READ, + 'static_copy', // USAGE_STATIC_COPY, + + 'dynamic_read', // USAGE_DYNAMIC_READ, + 'dynamic_copy' // USAGE_DYNAMIC_COPY, + ]; + assertMsgOptions(usages.length == Object.keys(glsDrawTests.DrawTestSpec.Usage).length, + 'The amount of usage names is different than the amount of usages', false, true); + + return usages[usage]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Storage} storage + * @return {string} + */ + glsDrawTests.DrawTestSpec.storageToString = function(storage) { + assertMsgOptions(storage != null, 'Storage is null', false, true); + + var storages = [ + 'user_ptr', // STORAGE_USER = 0, + 'buffer' // STORAGE_BUFFER, + ]; + assertMsgOptions(storages.length == Object.keys(glsDrawTests.DrawTestSpec.Storage).length, + 'The amount of storage names is different than the amount of storages', false, true); + + return storages[storage]; + }; + + /** + * @param {glsDrawTests.DrawTestSpec.Primitive} primitive + * @return {string} + */ + glsDrawTests.DrawTestSpec.primitiveToString = function(primitive) { + assertMsgOptions(primitive != null, 'Primitive is null', false, true); + + var primitives = [ + 'points', // PRIMITIVE_POINTS , + 'triangles', // PRIMITIVE_TRIANGLES, + 'triangle_fan', // PRIMITIVE_TRIANGLE_FAN, + 'triangle_strip', // PRIMITIVE_TRIANGLE_STRIP, + 'lines', // PRIMITIVE_LINES + 'line_strip', // PRIMITIVE_LINE_STRIP + 'line_loop' + ]; + assertMsgOptions(primitives.length == Object.keys(glsDrawTests.DrawTestSpec.Primitive).length, + 'The amount of primitive names is different than the amount of primitives', false, true); + + return primitives[primitive]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.IndexType} type + * @return {string} + */ + glsDrawTests.DrawTestSpec.indexTypeToString = function(type) { + assertMsgOptions(type != null, 'Index type is null', false, true); + + var indexTypes = [ + 'byte', // INDEXTYPE_BYTE = 0, + 'short', // INDEXTYPE_SHORT, + 'int' // INDEXTYPE_INT, + ]; + assertMsgOptions(indexTypes.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length, + 'The amount of index type names is different than the amount of index types', false, true); + + return indexTypes[type]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.DrawMethod} method + * @return {string} + */ + glsDrawTests.DrawTestSpec.drawMethodToString = function(method) { + assertMsgOptions(method != null, 'Method is null', false, true); + + var methods = [ + 'draw_arrays', //!< DRAWMETHOD_DRAWARRAYS + 'draw_arrays_instanced', //!< DRAWMETHOD_DRAWARRAYS_INSTANCED + 'draw_elements', //!< DRAWMETHOD_DRAWELEMENTS + 'draw_range_elements', //!< DRAWMETHOD_DRAWELEMENTS_RANGED + 'draw_elements_instanced' //!< DRAWMETHOD_DRAWELEMENTS_INSTANCED + ]; + assertMsgOptions(methods.length == Object.keys(glsDrawTests.DrawTestSpec.DrawMethod).length, + 'The amount of method names is different than the amount of methods', false, true); + + return methods[method]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.InputType} type + * @return {number} + */ + glsDrawTests.DrawTestSpec.inputTypeSize = function(type) { + assertMsgOptions(type != null, 'Input type is null', false, true); + + var size = [ + 4, // INPUTTYPE_FLOAT = 0, + + 1, // INPUTTYPE_BYTE, + 2, // INPUTTYPE_SHORT, + + 1, // INPUTTYPE_UNSIGNED_BYTE, + 2, // INPUTTYPE_UNSIGNED_SHORT, + + 4, // INPUTTYPE_INT, + 4, // INPUTTYPE_UNSIGNED_INT, + 2, // INPUTTYPE_HALF, + 4 / 4, // INPUTTYPE_UNSIGNED_INT_2_10_10_10, + 4 / 4 // INPUTTYPE_INT_2_10_10_10, + ]; + assertMsgOptions(size.length == Object.keys(glsDrawTests.DrawTestSpec.InputType).length, + 'The amount of type names is different than the amount of types', false, true); + + return size[type]; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.IndexType} type + * @return {number} + */ + glsDrawTests.DrawTestSpec.indexTypeSize = function(type) { + assertMsgOptions(type != null, 'Type is null', false, true); + + var size = [ + 1, // INDEXTYPE_BYTE, + 2, // INDEXTYPE_SHORT, + 4 // INDEXTYPE_INT, + ]; + assertMsgOptions(size.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length, + 'The amount of type names is different than the amount of types', false, true); + + return size[type]; + }; + + /** + * @return {string} + */ + glsDrawTests.DrawTestSpec.prototype.getName = function() { + /** @type {glsDrawTests.MethodInfo} */ var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod); + /** @type {boolean} */ var hasFirst = methodInfo.first; + /** @type {boolean} */ var instanced = methodInfo.instanced; + /** @type {boolean} */ var ranged = methodInfo.ranged; + /** @type {boolean} */ var indexed = methodInfo.indexed; + + var name = ''; + + for (var ndx = 0; ndx < this.attribs.length; ++ndx) { + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec}*/ var attrib = this.attribs[ndx]; + + if (this.attribs.length > 1) + name += 'attrib' + ndx + '_'; + + if (ndx == 0 || attrib.additionalPositionAttribute) + name += 'pos_'; + else + name += 'col_'; + + if (attrib.useDefaultAttribute) { + name += 'non_array_' + + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + '_' + + attrib.componentCount + '_' + + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '_'; + } else { + name += glsDrawTests.DrawTestSpec.storageToString(attrib.storage) + '_' + + attrib.offset + '_' + + attrib.stride + '_' + + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)); + if (attrib.inputType != glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 && attrib.inputType != glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10) + name += attrib.componentCount; + name += '_' + + (attrib.normalize ? 'normalized_' : '') + + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '_' + + glsDrawTests.DrawTestSpec.usageTypeToString(attrib.usage) + '_' + + attrib.instanceDivisor + '_'; + } + } + + if (indexed) + name += 'index_' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '_' + + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '_' + + 'offset' + this.indexPointerOffset + '_'; + if (hasFirst) + name += 'first' + this.first + '_'; + if (ranged) + name += 'ranged_' + this.indexMin + '_' + this.indexMax + '_'; + if (instanced) + name += 'instances' + this.instanceCount + '_'; + + switch (this.primitive) { + case glsDrawTests.DrawTestSpec.Primitive.POINTS: + name += 'points_'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES: + name += 'triangles_'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN: + name += 'triangle_fan_'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP: + name += 'triangle_strip_'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINES: + name += 'lines_'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP: + name += 'line_strip_'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP: + name += 'line_loop_'; + break; + default: + throw new Error('Invalid primitive'); + break; + } + + name += this.primitiveCount; + + return name; + }; + + /** + * @return {string} + */ + glsDrawTests.DrawTestSpec.prototype.getDesc = function() { + var desc = ''; + + for (var ndx = 0; ndx < this.attribs.length; ++ndx) { + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attrib = this.attribs[ndx]; + + if (attrib.useDefaultAttribute) { + desc += 'Attribute ' + ndx + ': default, ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position ,') : ('color ,')) + + 'input datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + ', ' + + 'input component count ' + attrib.componentCount + ', ' + + 'used as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + ', '; + } else { + desc += 'Attribute ' + ndx + ': ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position ,') : ('color ,')) + + 'Storage in ' + glsDrawTests.DrawTestSpec.storageToString(attrib.storage) + ', ' + + 'stride ' + attrib.stride + ', ' + + 'input datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + ', ' + + 'input component count ' + attrib.componentCount + ', ' + + (attrib.normalize ? 'normalized, ' : '') + + 'used as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + ', ' + + 'instance divisor ' + attrib.instanceDivisor + ', '; + } + } + + if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS) { + desc += 'drawArrays(), ' + + 'first ' + this.first + ', '; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED) { + desc += 'drawArraysInstanced(), ' + + 'first ' + this.first + ', ' + + 'instance count ' + this.instanceCount + ', '; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS) { + desc += 'drawElements(), ' + + 'index type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + ', ' + + 'index storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + ', ' + + 'index offset ' + this.indexPointerOffset + ', '; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED) { + desc += 'drawElementsRanged(), ' + + 'index type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + ', ' + + 'index storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + ', ' + + 'index offset ' + this.indexPointerOffset + ', ' + + 'range start ' + this.indexMin + ', ' + + 'range end ' + this.indexMax + ', '; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED) { + desc += 'drawElementsInstanced(), ' + + 'index type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + ', ' + + 'index storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + ', ' + + 'index offset ' + this.indexPointerOffset + ', ' + + 'instance count ' + this.instanceCount + ', '; + } else + throw new Error('Invalid draw method'); + + desc += this.primitiveCount; + + switch (this.primitive) { + case glsDrawTests.DrawTestSpec.Primitive.POINTS: + desc += 'points'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES: + desc += 'triangles'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN: + desc += 'triangles (fan)'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP: + desc += 'triangles (strip)'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINES: + desc += 'lines'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP: + desc += 'lines (strip)'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP: + desc += 'lines (loop)'; + break; + default: + throw new Error('Invalid primitive'); + break; + } + + return desc; + }; + + /** + * @return {string} + */ + glsDrawTests.DrawTestSpec.prototype.getMultilineDesc = function() { + var desc = ''; + + for (var ndx = 0; ndx < this.attribs.length; ++ndx) { + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attrib = this.attribs[ndx]; + + if (attrib.useDefaultAttribute) { + desc += 'Attribute ' + ndx + ': default, ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position\n') : ('color\n')) + + '\tinput datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + '\n' + + '\tinput component count ' + attrib.componentCount + '\n' + + '\tused as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '\n'; + } else { + desc += 'Attribute ' + ndx + ': ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position\n') : ('color\n')) + + '\tStorage in ' + glsDrawTests.DrawTestSpec.storageToString(attrib.storage) + '\n' + + '\tstride ' + attrib.stride + '\n' + + '\tinput datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + '\n' + + '\tinput component count ' + attrib.componentCount + '\n' + + (attrib.normalize ? '\tnormalized\n' : '') + + '\tused as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '\n' + + '\tinstance divisor ' + attrib.instanceDivisor + '\n'; + } + } + + if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS) { + desc += 'drawArrays()\n' + + '\tfirst ' + this.first + '\n'; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED) { + desc += 'drawArraysInstanced()\n' + + '\tfirst ' + this.first + '\n' + + '\tinstance count ' + this.instanceCount + '\n'; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS) { + desc += 'drawElements()\n' + + '\tindex type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '\n' + + '\tindex storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '\n' + + '\tindex offset ' + this.indexPointerOffset + '\n'; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED) { + desc += 'drawElementsRanged()\n' + + '\tindex type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '\n' + + '\tindex storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '\n' + + '\tindex offset ' + this.indexPointerOffset + '\n' + + '\trange start ' + this.indexMin + '\n' + + '\trange end ' + this.indexMax + '\n'; + } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED) { + desc += 'drawElementsInstanced()\n' + + '\tindex type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '\n' + + '\tindex storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '\n' + + '\tindex offset ' + this.indexPointerOffset + '\n' + + '\tinstance count ' + this.instanceCount + '\n'; + } else + throw new Error('Invalid draw method'); + + desc += '\t' + this.primitiveCount + ' '; + + switch (this.primitive) { + case glsDrawTests.DrawTestSpec.Primitive.POINTS: + desc += 'points'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES: + desc += 'triangles'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN: + desc += 'triangles (fan)'; + break; + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP: + desc += 'triangles (strip)'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINES: + desc += 'lines'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP: + desc += 'lines (strip)'; + break; + case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP: + desc += 'lines (loop)'; + break; + default: + throw new Error('Invalid primitive'); + break; + } + + desc += '\n'; + + return desc; + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.Target = { + ELEMENT_ARRAY: 0, + ARRAY: 1 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.InputType = { + FLOAT: 0, + + BYTE: 1, + SHORT: 2, + + UNSIGNED_BYTE: 3, + UNSIGNED_SHORT: 4, + + INT: 5, + UNSIGNED_INT: 6, + HALF: 7, + UNSIGNED_INT_2_10_10_10: 8, + INT_2_10_10_10: 9 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.OutputType = { + FLOAT: 0, + VEC2: 1, + VEC3: 2, + VEC4: 3, + + INT: 4, + UINT: 5, + + IVEC2: 6, + IVEC3: 7, + IVEC4: 8, + + UVEC2: 9, + UVEC3: 10, + UVEC4: 11 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.Usage = { + DYNAMIC_DRAW: 0, + STATIC_DRAW: 1, + STREAM_DRAW: 2, + + STREAM_READ: 3, + STREAM_COPY: 4, + + STATIC_READ: 5, + STATIC_COPY: 6, + + DYNAMIC_READ: 7, + DYNAMIC_COPY: 8 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.Storage = { + USER: 0, + BUFFER: 1 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.Primitive = { + POINTS: 0, + TRIANGLES: 1, + TRIANGLE_FAN: 2, + TRIANGLE_STRIP: 3, + LINES: 4, + LINE_STRIP: 5, + LINE_LOOP: 6 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.IndexType = { + BYTE: 0, + SHORT: 1, + INT: 2 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.DrawMethod = { + DRAWARRAYS: 0, + DRAWARRAYS_INSTANCED: 1, + DRAWELEMENTS: 2, + DRAWELEMENTS_RANGED: 3, + DRAWELEMENTS_INSTANCED: 4 + }; + + /** + * @enum {number} + */ + glsDrawTests.DrawTestSpec.CompatibilityTestType = { + NONE: 0, + UNALIGNED_OFFSET: 1, + UNALIGNED_STRIDE: 2 + }; + + /** + * @return {number} + */ + glsDrawTests.DrawTestSpec.prototype.hash = function() { + // Use only drawmode-relevant values in "hashing" as the unrelevant values might not be set (causing non-deterministic behavior). + /** @type {glsDrawTests.MethodInfo} */ var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod); + /** @type {boolean} */ var arrayed = methodInfo.first; + /** @type {boolean} */ var instanced = methodInfo.instanced; + /** @type {boolean} */ var ranged = methodInfo.ranged; + /** @type {boolean} */ var indexed = methodInfo.indexed; + + /** @type {number} */ var indexHash = (!indexed) ? (0) : (this.indexType + 10 * this.indexPointerOffset + 100 * this.indexStorage); + /** @type {number} */ var arrayHash = (!arrayed) ? (0) : (this.first); + /** @type {number} */ var indexRangeHash = (!ranged) ? (0) : (this.indexMin + 10 * this.indexMax); + /** @type {number} */ var instanceHash = (!instanced) ? (0) : (this.instanceCount); + /** @type {number} */ var basicHash = this.primitive + 10 * this.primitiveCount + 100 * this.drawMethod; + + return indexHash + 3 * arrayHash + 5 * indexRangeHash + 7 * instanceHash + 13 * basicHash + 17 * this.attribs.length + 19 * this.primitiveCount; + }; + + /** + * @return {boolean} + */ + glsDrawTests.DrawTestSpec.prototype.valid = function() { + assertMsgOptions(this.primitive != null, 'Primitive is null', false, true); + assertMsgOptions(this.drawMethod != null, 'Draw method is null', false, true); + + var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod); + + if (methodInfo.ranged) { + var maxIndexValue = 0; + if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.BYTE) + maxIndexValue = glsDrawTests.GLValue.getMaxValue(glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE).interpret(); + else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.SHORT) + maxIndexValue = glsDrawTests.GLValue.getMaxValue(glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT).interpret(); + else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.INT) + maxIndexValue = glsDrawTests.GLValue.getMaxValue(glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT).interpret(); + else + throw new Error('Invalid index type'); + + if (this.indexMin > this.indexMax) + return false; + if (this.indexMin < 0 || this.indexMax < 0) + return false; + if (this.indexMin > maxIndexValue || this.indexMax > maxIndexValue) + return false; + } + + if (methodInfo.first && this.first < 0) + return false; + + return true; + }; + + /** + * @return {glsDrawTests.DrawTestSpec.CompatibilityTestType} + */ + glsDrawTests.DrawTestSpec.prototype.isCompatibilityTest = function() { + var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod); + + var bufferAlignmentBad = false; + var strideAlignmentBad = false; + + // Attribute buffer alignment + for (var ndx = 0; ndx < this.attribs.length; ++ndx) + if (!this.attribs[ndx].isBufferAligned()) + bufferAlignmentBad = true; + + // Attribute stride alignment + for (var ndx = 0; ndx < this.attribs.length; ++ndx) + if (!this.attribs[ndx].isBufferStrideAligned()) + strideAlignmentBad = true; + + // Index buffer alignment + if (methodInfo.indexed) { + if (this.indexStorage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + var indexSize = 0; + if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.BYTE) + indexSize = 1; + else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.SHORT) + indexSize = 2; + else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.INT) + indexSize = 4; + else + throw new Error(''); + + if (this.indexPointerOffset % indexSize != 0) + bufferAlignmentBad = true; + } + } + + // \note combination bad alignment & stride is treated as bad offset + if (bufferAlignmentBad) + return glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET; + else if (strideAlignmentBad) + return glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE; + else + return glsDrawTests.DrawTestSpec.CompatibilityTestType.NONE; + }; + + // DrawTestSpec.AttributeSpec + + /** + * @constructor + */ + glsDrawTests.DrawTestSpec.AttributeSpec = function() { + /** @type {?glsDrawTests.DrawTestSpec.InputType} */ this.inputType = null; + /** @type {?glsDrawTests.DrawTestSpec.OutputType} */ this.outputType = null; + /** @type {?glsDrawTests.DrawTestSpec.Storage} */ this.storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; //Always BUFFER in WebGL up to 2 + /** @type {?glsDrawTests.DrawTestSpec.Usage} */ this.usage = null; + /** @type {number} */ this.componentCount = 0; + /** @type {number} */ this.offset = 0; + /** @type {number} */ this.stride = 0; + /** @type {boolean} */ this.normalize = false; + /** @type {number} */ this.instanceDivisor = 0; //!< used only if drawMethod = Draw*Instanced + /** @type {boolean} */ this.useDefaultAttribute = false; + + /** @type {boolean} */ this.additionalPositionAttribute = false; //!< treat this attribute as position attribute. Attribute at index 0 is alway treated as such. False by default + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.InputType} inputType + * @param {?glsDrawTests.DrawTestSpec.OutputType} outputType + * @param {?glsDrawTests.DrawTestSpec.Storage} storage + * @param {?glsDrawTests.DrawTestSpec.Usage} usage + * @param {number} componentCount + * @param {number} offset + * @param {number} stride + * @param {boolean} normalize + * @param {number} instanceDivisor + * @return {glsDrawTests.DrawTestSpec.AttributeSpec} + */ + glsDrawTests.DrawTestSpec.AttributeSpec.createAttributeArray = function(inputType, outputType, storage, usage, componentCount, + offset, stride, normalize, instanceDivisor) { + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var spec; + + spec.inputType = inputType; + spec.outputType = outputType; + spec.storage = storage; + spec.usage = usage; + spec.componentCount = componentCount; + spec.offset = offset; + spec.stride = stride; + spec.normalize = normalize; + spec.instanceDivisor = instanceDivisor; + + spec.useDefaultAttribute = false; + + return spec; + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.InputType} inputType + * @param {?glsDrawTests.DrawTestSpec.OutputType} outputType + * @param {number} componentCount + * @return {glsDrawTests.DrawTestSpec.AttributeSpec} + */ + glsDrawTests.DrawTestSpec.AttributeSpec.createDefaultAttribute = function(inputType, outputType, componentCount) { + assertMsgOptions(inputType == glsDrawTests.DrawTestSpec.InputType.INT || inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT || inputType == glsDrawTests.DrawTestSpec.InputType.FLOAT, 'Invalid input type', false, true); + assertMsgOptions(inputType == glsDrawTests.DrawTestSpec.InputType.FLOAT || componentCount == 4, 'If not float, input type should have 4 components', false, true); + + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var spec; + + spec.inputType = inputType; + spec.outputType = outputType; + spec.storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; //Always BUFFER in WebGL up to 2 + spec.usage = null; + spec.componentCount = componentCount; + spec.offset = 0; + spec.stride = 0; + spec.normalize = false; + spec.instanceDivisor = 0; + + spec.useDefaultAttribute = true; + + return spec; + }; + + /** + * @return {number} + */ + glsDrawTests.DrawTestSpec.AttributeSpec.prototype.hash = function() { + if (this.useDefaultAttribute) { + return 1 * this.inputType + 7 * this.outputType + 13 * this.componentCount; + } else { + return 1 * this.inputType + 2 * this.outputType + 3 * this.storage + 5 * this.usage + 7 * this.componentCount + 11 * this.offset + 13 * this.stride + 17 * (this.normalize ? 0 : 1) + 19 * this.instanceDivisor; + } + }; + + /** + * @return {boolean} + */ + glsDrawTests.DrawTestSpec.AttributeSpec.prototype.valid = function(/*ctxType*/) { + /** @type {boolean} */ var inputTypeFloat = this.inputType == glsDrawTests.DrawTestSpec.InputType.FLOAT || this.inputType == glsDrawTests.DrawTestSpec.InputType.HALF; + /** @type {boolean} */ var inputTypeUnsignedInteger = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE || this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT || this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT || this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10; + /** @type {boolean} */ var inputTypeSignedInteger = this.inputType == glsDrawTests.DrawTestSpec.InputType.BYTE || this.inputType == glsDrawTests.DrawTestSpec.InputType.SHORT || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10; + /** @type {boolean} */ var inputTypePacked = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10; + + /** @type {boolean} */ var outputTypeFloat = this.outputType == glsDrawTests.DrawTestSpec.OutputType.FLOAT || this.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC2 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC3 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC4; + /** @type {boolean} */ var outputTypeSignedInteger = this.outputType == glsDrawTests.DrawTestSpec.OutputType.INT || this.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC2 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC3 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC4; + /** @type {boolean} */ var outputTypeUnsignedInteger = this.outputType == glsDrawTests.DrawTestSpec.OutputType.UINT || this.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC2 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC3 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC4; + + if (this.useDefaultAttribute) { + if (this.inputType != glsDrawTests.DrawTestSpec.InputType.INT && this.inputType != glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT && this.inputType != glsDrawTests.DrawTestSpec.InputType.FLOAT) + return false; + + if (this.inputType != glsDrawTests.DrawTestSpec.InputType.FLOAT && this.componentCount != 4) + return false; + + // no casting allowed (undefined results) + if (this.inputType == glsDrawTests.DrawTestSpec.InputType.INT && !outputTypeSignedInteger) + return false; + if (this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT && !outputTypeUnsignedInteger) + return false; + } + + if (inputTypePacked && this.componentCount != 4) + return false; + + // Invalid conversions: + + // float -> [u]int + if (inputTypeFloat && !outputTypeFloat) + return false; + + // uint -> int (undefined results) + if (inputTypeUnsignedInteger && outputTypeSignedInteger) + return false; + + // int -> uint (undefined results) + if (inputTypeSignedInteger && outputTypeUnsignedInteger) + return false; + + // packed -> non-float (packed formats are converted to floats) + if (inputTypePacked && !outputTypeFloat) + return false; + + // Invalid normalize. Normalize is only valid if output type is float + if (this.normalize && !outputTypeFloat) + return false; + + return true; + }; + + /** + * @return {boolean} + */ + glsDrawTests.DrawTestSpec.AttributeSpec.prototype.isBufferAligned = function() { + var inputTypePacked = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10; + + // Buffer alignment, offset is a multiple of underlying data type size? + if (this.storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + var dataTypeSize = glsDrawTests.DrawTestSpec.inputTypeSize(this.inputType); + if (inputTypePacked) + dataTypeSize = 4; + + if (this.offset % dataTypeSize != 0) + return false; + } + + return true; + }; + + /** + * @return {boolean} + */ + glsDrawTests.DrawTestSpec.AttributeSpec.prototype.isBufferStrideAligned = function() { + var inputTypePacked = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10; + + // Buffer alignment, offset is a multiple of underlying data type size? + if (this.storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) { + var dataTypeSize = glsDrawTests.DrawTestSpec.inputTypeSize(this.inputType); + if (inputTypePacked) + dataTypeSize = 4; + + if (this.stride % dataTypeSize != 0) + return false; + } + + return true; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {glsDrawTests.DrawTestSpec} spec + * @param {string} name + * @param {string} desc + */ + glsDrawTests.DrawTest = function(spec, name, desc) { + tcuTestCase.DeqpTest.call(this, name, desc, spec); + + /** @type {WebGL2RenderingContext} */ this.m_renderCtx = gl; + /** @type {tcuPixelFormat.PixelFormat} */ this.m_pixelformat = new tcuPixelFormat.PixelFormat( + /** @type {number} */ (gl.getParameter(gl.RED_BITS)), /** @type {number} */ (gl.getParameter(gl.GREEN_BITS)), + /** @type {number} */ (gl.getParameter(gl.BLUE_BITS)), /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS)) + ); + + /** @type {sglrReferenceContext.ReferenceContextBuffers} */ this.m_refBuffers = null; + /** @type {sglrReferenceContext.ReferenceContext} */ this.m_refContext = null; + /** @type {sglrGLContext.GLContext} */ this.m_glesContext = null; + + /** @type {glsDrawTests.AttributePack} */ this.m_glArrayPack = null; + /** @type {glsDrawTests.AttributePack} */ this.m_rrArrayPack = null; + + /** @type {number} */ this.m_maxDiffRed = -1; + /** @type {number} */ this.m_maxDiffGreen = -1; + /** @type {number} */ this.m_maxDiffBlue = -1; + + /** @type {Array} */ this.m_specs = []; + /** @type {Array} */this.m_iteration_descriptions = []; + /** @type {number} */ this.m_iteration = 0; + + if (spec) + this.addIteration(spec); + }; + + glsDrawTests.DrawTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsDrawTests.DrawTest.prototype.constructor = glsDrawTests.DrawTest; + + /** + * @param {glsDrawTests.DrawTestSpec} spec + * @param {string=} description + */ + glsDrawTests.DrawTest.prototype.addIteration = function(spec, description) { + // Validate spec + /** @type {boolean} */ var validSpec = spec.valid(); + + if (!validSpec) + return; + + this.m_specs.push(spec); + + if (description) + this.m_iteration_descriptions.push(description); + else + this.m_iteration_descriptions.push(''); + }; + + /** + * init + */ + glsDrawTests.DrawTest.prototype.init = function() { + var renderTargetWidth = Math.min(glsDrawTests.MAX_RENDER_TARGET_SIZE, gl.canvas.width); + var renderTargetHeight = Math.min(glsDrawTests.MAX_RENDER_TARGET_SIZE, gl.canvas.height); + /** @type {sglrReferenceContext.ReferenceContextLimits} */ var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + /** @type {boolean} */ var useVao = true; + + this.m_glesContext = new sglrGLContext.GLContext(gl); + + assertMsgOptions(this.m_specs.length > 0, 'Specs is empty', false, true); + + this.m_refBuffers = new sglrReferenceContext.ReferenceContextBuffers(this.m_pixelformat, 0, 0, renderTargetWidth, renderTargetHeight); + this.m_refContext = new sglrReferenceContext.ReferenceContext(limits, this.m_refBuffers.getColorbuffer(), this.m_refBuffers.getDepthbuffer(), this.m_refBuffers.getStencilbuffer()); + + this.m_glArrayPack = new glsDrawTests.AttributePack(this.m_glesContext, [renderTargetWidth, renderTargetHeight], useVao, true); + this.m_rrArrayPack = new glsDrawTests.AttributePack(this.m_refContext, [renderTargetWidth, renderTargetHeight], useVao, false); + + this.m_maxDiffRed = Math.ceil(256.0 * (15.0 / (1 << this.m_pixelformat.redBits))); + this.m_maxDiffGreen = Math.ceil(256.0 * (15.0 / (1 << this.m_pixelformat.greenBits))); + this.m_maxDiffBlue = Math.ceil(256.0 * (15.0 / (1 << this.m_pixelformat.blueBits))); + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + glsDrawTests.DrawTest.prototype.iterate = function() { + var specNdx = Math.floor(this.m_iteration / 2); + var drawStep = (this.m_iteration % 2) == 0; + var compareStep = (this.m_iteration % 2) == 1; + /** @type {tcuTestCase.IterateResult} */ var iterateResult = (this.m_iteration + 1 == this.m_specs.length * 2) ? (tcuTestCase.IterateResult.STOP) : (tcuTestCase.IterateResult.CONTINUE); + /** @type {glsDrawTests.DrawTestSpec} */ var spec = this.m_specs[specNdx]; + var updateProgram = (this.m_iteration == 0) || (drawStep && !glsDrawTests.checkSpecsShaderCompatible(this.m_specs[specNdx], this.m_specs[specNdx - 1])); // try to use the same shader in all iterations + + if (drawStep && this.m_specs.length != 1) + debug('Iteration ' + specNdx + ' of ' + (this.m_specs.length - 1) + ': ' + this.m_iteration_descriptions[specNdx]); + + this.m_iteration++; + + if (drawStep) { + /** @type {glsDrawTests.MethodInfo} */ var methodInfo = glsDrawTests.getMethodInfo(spec.drawMethod); + /** @type {boolean} */ var indexed = methodInfo.indexed; + /** @type {boolean} */ var instanced = methodInfo.instanced; + /** @type {boolean} */ var ranged = methodInfo.ranged; + /** @type {boolean} */ var hasFirst = methodInfo.first; + + /** @type {number} */ var primitiveElementCount = glsDrawTests.getElementCount(spec.primitive, spec.primitiveCount); // !< elements to be drawn + /** @type {number} */ var indexMin = (ranged) ? (spec.indexMin) : (0); + /** @type {number} */ var firstAddition = (hasFirst) ? (spec.first) : (0); + /** @type {number} */ var elementCount = primitiveElementCount + indexMin + firstAddition; // !< elements in buffer (buffer should have at least primitiveElementCount ACCESSIBLE (index range, first) elements) + /** @type {number} */ var maxElementIndex = primitiveElementCount + indexMin + firstAddition - 1; + /** @type {number} */ var indexMax = Math.max(0, (ranged) ? (deMath.clamp(spec.indexMax, 0, maxElementIndex)) : (maxElementIndex)); + /** @type {number} */ var coordScale = this.getCoordScale(spec); + /** @type {number} */ var colorScale = this.getColorScale(spec); + + /** @type {Array} */ var nullAttribValue = []; + + // Log info + bufferedLogToConsole(spec.getMultilineDesc()); + + // Data + this.m_glArrayPack.clearArrays(); + this.m_rrArrayPack.clearArrays(); + + // indices + /** @type {number} */ var seed; + /** @type {number} */ var indexElementSize; + /** @type {number} */ var indexArraySize; + /** @type {goog.TypedArray} */ var indexArray; + /** @type {goog.TypedArray} */ var indexPointer; + + /** @type {glsDrawTests.AttributeArray}*/ var glArray; + /** @type {glsDrawTests.AttributeArray}*/ var rrArray; + + if (indexed) { + seed = spec.hash(); + indexElementSize = glsDrawTests.DrawTestSpec.indexTypeSize(spec.indexType); + indexArraySize = spec.indexPointerOffset + indexElementSize * elementCount; + indexArray = glsDrawTests.RandomArrayGenerator.generateIndices(seed, elementCount, spec.indexType, spec.indexPointerOffset, indexMin, indexMax); + indexPointer = indexArray.subarray(spec.indexPointerOffset); + + glArray = new glsDrawTests.AttributeArray(spec.indexStorage, this.m_glesContext); + rrArray = new glsDrawTests.AttributeArray(spec.indexStorage, this.m_refContext); + + glArray.data(glsDrawTests.DrawTestSpec.Target.ELEMENT_ARRAY, indexArraySize, indexArray, glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW); + rrArray.data(glsDrawTests.DrawTestSpec.Target.ELEMENT_ARRAY, indexArraySize, indexArray, glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW); + + indexArray = null; + } + + // attributes + for (var attribNdx = 0; attribNdx < spec.attribs.length; attribNdx++) { + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = spec.attribs[attribNdx]; + var isPositionAttr = (attribNdx == 0) || (attribSpec.additionalPositionAttribute); + + if (attribSpec.useDefaultAttribute) { + seed = 10 * attribSpec.hash() + 100 * spec.hash() + attribNdx; + /** @type {Array} */ var attribValue = glsDrawTests.RandomArrayGenerator.generateAttributeValue(seed, attribSpec.inputType); + + // changed USER for BUFFER in JS version + this.m_glArrayPack.newArray(glsDrawTests.DrawTestSpec.Storage.BUFFER); + this.m_rrArrayPack.newArray(glsDrawTests.DrawTestSpec.Storage.BUFFER); + + this.m_glArrayPack.getArray(attribNdx).setupArray(false, 0, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, false, 0, 0, attribValue, isPositionAttr); + this.m_rrArrayPack.getArray(attribNdx).setupArray(false, 0, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, false, 0, 0, attribValue, isPositionAttr); + } else { + seed = attribSpec.hash() + 100 * spec.hash() + attribNdx; + /** @type {number} */ var elementSize = attribSpec.componentCount * glsDrawTests.DrawTestSpec.inputTypeSize(attribSpec.inputType); + /** @type {number} */ var stride = (attribSpec.stride == 0) ? (elementSize) : (attribSpec.stride); + /** @type {number} */ var evaluatedElementCount = (instanced && attribSpec.instanceDivisor > 0) ? (spec.instanceCount / attribSpec.instanceDivisor + 1) : (elementCount); + /** @type {number} */ var referencedElementCount = (ranged) ? (Math.max(evaluatedElementCount, spec.indexMax + 1)) : (evaluatedElementCount); + /** @type {number} */ var bufferSize = attribSpec.offset + stride * (referencedElementCount - 1) + elementSize; + /** @type {goog.TypedArray} */ var data = glsDrawTests.RandomArrayGenerator.createArray( + seed, + referencedElementCount, + attribSpec.componentCount, + attribSpec.offset, + stride, + attribSpec.inputType, + indexed ? 0 : spec.first, + spec.primitive, + indexed ? indexPointer : null, + indexElementSize + ); + + this.m_glArrayPack.newArray(attribSpec.storage); + this.m_rrArrayPack.newArray(attribSpec.storage); + + this.m_glArrayPack.getArray(attribNdx).data(glsDrawTests.DrawTestSpec.Target.ARRAY, bufferSize, data, attribSpec.usage); + this.m_rrArrayPack.getArray(attribNdx).data(glsDrawTests.DrawTestSpec.Target.ARRAY, bufferSize, data, attribSpec.usage); + + this.m_glArrayPack.getArray(attribNdx).setupArray(true, attribSpec.offset, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, attribSpec.normalize, attribSpec.stride, attribSpec.instanceDivisor, nullAttribValue, isPositionAttr); + this.m_rrArrayPack.getArray(attribNdx).setupArray(true, attribSpec.offset, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, attribSpec.normalize, attribSpec.stride, attribSpec.instanceDivisor, nullAttribValue, isPositionAttr); + + data = null; + } + } + + // Shader program + if (updateProgram) { + this.m_glArrayPack.updateProgram(); + this.m_rrArrayPack.updateProgram(); + } + + /** @type {glsDrawTests.DrawTestSpec.CompatibilityTestType} */ var ctype; + + // Draw + try { + // indices + if (indexed) { + this.m_glArrayPack.render(spec.primitive, spec.drawMethod, 0, primitiveElementCount, spec.indexType, spec.indexPointerOffset, spec.indexMin, spec.indexMax, spec.instanceCount, coordScale, colorScale, glArray); + this.m_rrArrayPack.render(spec.primitive, spec.drawMethod, 0, primitiveElementCount, spec.indexType, spec.indexPointerOffset, spec.indexMin, spec.indexMax, spec.instanceCount, coordScale, colorScale, rrArray); + } else { + this.m_glArrayPack.render(spec.primitive, spec.drawMethod, spec.first, primitiveElementCount, null, 0, 0, 0, spec.instanceCount, coordScale, colorScale, null); + this.m_rrArrayPack.render(spec.primitive, spec.drawMethod, spec.first, primitiveElementCount, null, 0, 0, 0, spec.instanceCount, coordScale, colorScale, null); + } + } catch (err) { + if (err instanceof wtu.GLErrorException) { + // GL Errors are ok if the mode is not properly aligned + ctype = spec.isCompatibilityTest(); + + bufferedLogToConsole('Got error: ' + err.message); + + if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET) + checkMessage(false, 'Failed to draw with unaligned buffers.'); + else if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE) + checkMessage(false, 'Failed to draw with unaligned stride.'); + else + throw err; + } + } + } else if (compareStep) { + if (!this.compare(spec.primitive)) { + ctype = spec.isCompatibilityTest(); + + if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET) + checkMessage(false, 'Failed to draw with unaligned buffers.'); + else if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE) + checkMessage(false, 'Failed to draw with unaligned stride.'); + else + testFailedOptions('Image comparison failed.', false); + return iterateResult; + } + } else { + testFailedOptions('Image comparison failed.', false); + return tcuTestCase.IterateResult.STOP; + } + + if (iterateResult == tcuTestCase.IterateResult.STOP) + testPassed(''); + + return iterateResult; + }; + + /** + * @enum {number} PrimitiveClass + */ + glsDrawTests.PrimitiveClass = { + POINT: 0, + LINE: 1, + TRIANGLE: 2 + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Primitive} primitiveType + * @return {glsDrawTests.PrimitiveClass} + */ + glsDrawTests.getDrawPrimitiveClass = function(primitiveType) { + switch (primitiveType) { + case glsDrawTests.DrawTestSpec.Primitive.POINTS: + return glsDrawTests.PrimitiveClass.POINT; + + case glsDrawTests.DrawTestSpec.Primitive.LINES: + case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP: + case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP: + return glsDrawTests.PrimitiveClass.LINE; + + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES: + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN: + case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP: + return glsDrawTests.PrimitiveClass.TRIANGLE; + + default: + throw new Error('Invalid primitive type'); + } + }; + + /** + * @param {number} c1 + * @param {number} c2 + * @param {Array} threshold + * @return {boolean} + */ + glsDrawTests.compareUintRGB8 = function(c1, c2, threshold) { + return (Math.abs(((c1 >> 16) & 0xff) - ((c2 >> 16) & 0xff)) <= threshold[0] && // Red + Math.abs(((c1 >> 8) & 0xff) - ((c2 >> 8) & 0xff)) <= threshold[1] && // Green + Math.abs((c1 & 0xff) - (c2 & 0xff)) <= threshold[2]); // Blue + }; + + /** + * @param {number} c1 + * @param {number} c2 + * @param {number} c3 + * @param {number} renderTargetDifference + * @return {boolean} + */ + glsDrawTests.isEdgeTripletComponent = function(c1, c2, c3, renderTargetDifference) { + /** @type {number} */ var roundingDifference = 2 * renderTargetDifference; // src and dst pixels rounded to different directions + /** @type {number} */ var d1 = c2 - c1; + /** @type {number} */ var d2 = c3 - c2; + /** @type {number} */ var rampDiff = Math.abs(d2 - d1); + + return rampDiff > roundingDifference; + }; + + /** + * @param {tcuRGBA.RGBA} c1 + * @param {tcuRGBA.RGBA} c2 + * @param {tcuRGBA.RGBA} c3 + * @param {Array} renderTargetThreshold + * @return {boolean} + */ + glsDrawTests.isEdgeTriplet = function(c1, c2, c3, renderTargetThreshold) { + // black (background color) and non-black is always an edge + /** @type {boolean} */ var b1 = c1 == 0x000000; + /** @type {boolean} */ var b2 = c2 == 0x000000; + /** @type {boolean} */ var b3 = c3 == 0x000000; + + // both pixels with coverage and pixels without coverage + if ((b1 && b2 && b3) == false && (b1 || b2 || b3) == true) + return true; + // all black + if (b1 && b2 && b3) + return false; + // all with coverage + assertMsgOptions(!b1 && !b2 && !b3, 'All colors with coverage', false, true); + + // Color is always linearly interpolated => component values change nearly linearly + // in any constant direction on triangle hull. (df/dx ~= C). + + // Edge detection (this function) is run against the reference image + // => no dithering to worry about + + return glsDrawTests.isEdgeTripletComponent((c1 >> 16) && 0xff, (c2 >> 16) && 0xff, (c3 >> 16) && 0xff, renderTargetThreshold[0]) || + glsDrawTests.isEdgeTripletComponent((c1 >> 8) && 0xff, (c2 >> 8) && 0xff, (c3 >> 8) && 0xff, renderTargetThreshold[1]) || + glsDrawTests.isEdgeTripletComponent(c1 && 0xff, c2 && 0xff, c3 && 0xff, renderTargetThreshold[2]); + }; + + /** + * @param {number} x + * @param {number} y + * @param {tcuSurface.Surface} ref + * @param {Array} renderTargetThreshold + * @return {boolean} + */ + glsDrawTests.pixelNearEdge = function(x, y, ref, renderTargetThreshold) { + // should not be called for edge pixels + assertMsgOptions(x >= 1 && x <= ref.getWidth() - 2, 'The pixel was on the edge', false, true); + assertMsgOptions(y >= 1 && y <= ref.getHeight() - 2, 'The pixel was on the edge', false, true); + + // horizontal + + /** @type {number} */ var c1; + /** @type {number} */ var c2; + /** @type {number} */ var c3; + + for (var dy = -1; dy < 2; ++dy) { + c1 = ref.getPixelUintRGB8(x - 1, y + dy); + c2 = ref.getPixelUintRGB8(x, y + dy); + c3 = ref.getPixelUintRGB8(x + 1, y + dy); + if (glsDrawTests.isEdgeTriplet(c1, c2, c3, renderTargetThreshold)) + return true; + } + + // vertical + + for (var dx = -1; dx < 2; ++dx) { + c1 = ref.getPixelUintRGB8(x + dx, y - 1); + c2 = ref.getPixelUintRGB8(x + dx, y); + c3 = ref.getPixelUintRGB8(x + dx, y + 1); + if (glsDrawTests.isEdgeTriplet(c1, c2, c3, renderTargetThreshold)) + return true; + } + + return false; + }; + + /** + * @param {number} c + * @return {number} + */ + glsDrawTests.getVisualizationGrayscaleColorUintRGB8 = function(c) { + // make triangle coverage and error pixels obvious by converting coverage to grayscale + if (c == 0x000000) + return 0; + else + return 50 + Math.floor((((c >> 16) & 0xff) + ((c >> 8) & 0xff) + (c & 0xff)) / 8); + }; + + /** + * @param {number} x + * @param {number} y + * @param {tcuSurface.Surface} target + * @return {boolean} + */ + glsDrawTests.pixelNearLineIntersection = function(x, y, target) { + // should not be called for edge pixels + assertMsgOptions(x >= 1 && x <= target.getWidth() - 2, 'Pixel is in the edge', false, true); + assertMsgOptions(y >= 1 && y <= target.getHeight() - 2, 'Pixel is in the edge', false, true); + + var coveredPixels = 0; + + for (var dy = -1; dy < 2; dy++) + for (var dx = -1; dx < 2; dx++) { + var targetCoverage = target.getPixelUintRGB8(x + dx, y + dy); + if (targetCoverage) { + ++coveredPixels; + + // A single thin line cannot have more than 3 covered pixels in a 3x3 area + if (coveredPixels >= 4) + return true; + } + } + + return false; + }; + + // search 3x3 are for matching color + /** + * @param {tcuSurface.Surface} target + * @param {number} x + * @param {number} y + * @param {tcuRGBA.RGBA} color + * @param {Array} compareThreshold + * @return {boolean} + */ + glsDrawTests.pixelNeighborhoodContainsColor = function(target, x, y, color, compareThreshold) { + // should not be called for edge pixels + assertMsgOptions(x >= 1 && x <= target.getWidth() - 2, 'Pixel is in the edge', false, true); + assertMsgOptions(y >= 1 && y <= target.getHeight() - 2, 'Pixel is in the edge', false, true); + + for (var dy = -1; dy < 2; dy++) + for (var dx = -1; dx < 2; dx++) { + if (glsDrawTests.compareUintRGB8(color, target.getPixelUintRGB8(x + dx, y + dy), compareThreshold)) + return true; + } + + return false; + }; + + // search 3x3 are for matching coverage (coverage == (color != background color)) + /** + * @param {tcuSurface.Surface} target + * @param {number} x + * @param {number} y + * @param {boolean} coverage + * @return {boolean} + */ + glsDrawTests.pixelNeighborhoodContainsCoverage = function(target, x, y, coverage) { + // should not be called for edge pixels + assertMsgOptions(x >= 1 && x <= target.getWidth() - 2, 'Pixel is in the edge', false, true); + assertMsgOptions(y >= 1 && y <= target.getHeight() - 2, 'Pixel is in the edge', false, true); + + for (var dy = -1; dy < 2; dy++) + for (var dx = -1; dx < 2; dx++) { + var targetCmpCoverage = target.getPixelUintRGB8(x + dx, y + dy) != 0x000000; // Pixel is not black + if (targetCmpCoverage == coverage) + return true; + } + + return false; + }; + + /** + * @param {string} imageSetName + * @param {string} imageSetDesc + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @param {Array} compareThreshold + * @param {Array} renderTargetThreshold + * @param {number} maxAllowedInvalidPixels + * @return {boolean} + */ + glsDrawTests.edgeRelaxedImageCompare = function(imageSetName, imageSetDesc, reference, result, compareThreshold, renderTargetThreshold, maxAllowedInvalidPixels) { + assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight(), 'Reference and result images have different dimensions', false, true); + + /** @type {Array} */ var green = [0, 255, 0, 255]; + /** @type {Array} */ var errorColor = [255, 0, 0, 255]; + /** @type {number} */ var width = reference.getWidth(); + /** @type {number} */ var height = reference.getHeight(); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height); + /** @type {number} */ var numFailingPixels = 0; + + // clear errormask edges which would otherwise be transparent + + tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, width, 1, 1).clear(green); + tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, height - 1, 0, width, 1, 1).clear(green); + tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, 1, height, 1).clear(green); + tcuTextureUtil.getSubregion(errorMask.getAccess(), width - 1, 0, 0, 1, height, 1).clear(green); + + // skip edge pixels since coverage on edge cannot be verified + + for (var y = 1; y < height - 1; ++y) + for (var x = 1; x < width - 1; ++x) { + /** @type {number} */ var refPixel = reference.getPixelUintRGB8(x, y); + /** @type {number} */ var screenPixel = result.getPixelUintRGB8(x, y); + /** @type {boolean} */ var isOkReferencePixel = glsDrawTests.pixelNeighborhoodContainsColor(result, x, y, refPixel, compareThreshold); // screen image has a matching pixel nearby (~= If something is drawn on reference, it must be drawn to screen too.) + /** @type {boolean} */ var isOkScreenPixel = glsDrawTests.pixelNeighborhoodContainsColor(reference, x, y, screenPixel, compareThreshold); // reference image has a matching pixel nearby (~= If something is drawn on screen, it must be drawn to reference too.) + + if (isOkScreenPixel && isOkReferencePixel) { + // pixel valid, write greenish pixels to make the result image easier to read + /** @type {number} */ var grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel); + errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y); + } else if (!glsDrawTests.pixelNearEdge(x, y, reference, renderTargetThreshold)) { + // non-edge pixel values must be within threshold of the reference values + errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y); + ++numFailingPixels; + } else { + // we are on/near an edge, verify only coverage (coverage == not background colored) + /** @type {boolean} */ var referenceCoverage = refPixel != 0x000000; // Not black + /** @type {boolean} */ var screenCoverage = screenPixel != 0x000000; // Not black + /** @type {boolean} */ var isOkReferenceCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(result, x, y, referenceCoverage); // Check reference pixel against screen pixel + /** @type {boolean} */ var isOkScreenCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(reference, x, y, screenCoverage); // Check screen pixels against reference pixel + + if (isOkScreenCoverage && isOkReferenceCoverage) { + // pixel valid, write greenish pixels to make the result image easier to read + var grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel); + errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y); + } else { + // coverage does not match + errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y); + ++numFailingPixels; + } + } + } + + bufferedLogToConsole( + 'Comparing images:
' + + ' allowed deviation in pixel positions = 1
' + + ' number of allowed invalid pixels = ' + maxAllowedInvalidPixels + '
' + + ' number of invalid pixels = ' + numFailingPixels + ); + + if (numFailingPixels > maxAllowedInvalidPixels) { + debug('Image comparison failed. Color threshold = (' + compareThreshold[0] + ', ' + compareThreshold[1] + ', ' + compareThreshold[2] + ')'); + tcuImageCompare.displayImages(result.getAccess(), reference.getAccess(), errorMask.getAccess()); + + return false; + } else { + return true; + } + }; + + /** + * @param {string} imageSetName + * @param {string} imageSetDesc + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} result + * @param {Array} compareThreshold + * @param {number} maxAllowedInvalidPixels + * @return {boolean} + */ + glsDrawTests.intersectionRelaxedLineImageCompare = function(imageSetName, imageSetDesc, reference, result, compareThreshold, maxAllowedInvalidPixels) { + assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight(), 'Reference and result images have different dimensions', false, true); + + /** @type {Array} */ var green = [0, 255, 0, 255]; + /** @type {Array} */ var errorColor = [255, 0, 0, 255]; + var width = reference.getWidth(); + var height = reference.getHeight(); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height); + /** @type {number} */ var numFailingPixels = 0; + + // clear errormask edges which would otherwise be transparent + + tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, width, 1, 1).clear(green); + tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, height - 1, 0, width, 1, 1).clear(green); + tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, 1, height, 1).clear(green); + tcuTextureUtil.getSubregion(errorMask.getAccess(), width - 1, 0, 0, 1, height, 1).clear(green); + + // skip edge pixels since coverage on edge cannot be verified + + for (var y = 1; y < height - 1; ++y) + for (var x = 1; x < width - 1; ++x) { + /** @type {number} */ var refPixel = reference.getPixelUintRGB8(x, y); + /** @type {number} */ var screenPixel = result.getPixelUintRGB8(x, y); + /** @type {boolean} */ var isOkScreenPixel = glsDrawTests.pixelNeighborhoodContainsColor(reference, x, y, screenPixel, compareThreshold); // reference image has a matching pixel nearby (~= If something is drawn on screen, it must be drawn to reference too.) + /** @type {boolean} */ var isOkReferencePixel = glsDrawTests.pixelNeighborhoodContainsColor(result, x, y, refPixel, compareThreshold); // screen image has a matching pixel nearby (~= If something is drawn on reference, it must be drawn to screen too.) + + /** @type {number} */ var grayscaleValue; + + if (isOkScreenPixel && isOkReferencePixel) { + // pixel valid, write greenish pixels to make the result image easier to read + grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel); + errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y); + } else if (!glsDrawTests.pixelNearLineIntersection(x, y, reference) && + !glsDrawTests.pixelNearLineIntersection(x, y, result)) { + // non-intersection pixel values must be within threshold of the reference values + errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y); + ++numFailingPixels; + } else { + // pixel is near a line intersection + // we are on/near an edge, verify only coverage (coverage == not background colored) + /** @type {boolean} */ var referenceCoverage = refPixel != 0x000000; // Not Black + /** @type {boolean} */ var screenCoverage = screenPixel != 0x000000; // Not Black + /** @type {boolean} */ var isOkScreenCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(reference, x, y, screenCoverage); // Check screen pixels against reference pixel + /** @type {boolean} */ var isOkReferenceCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(result, x, y, referenceCoverage); // Check reference pixel against screen pixel + + if (isOkScreenCoverage && isOkReferenceCoverage) { + // pixel valid, write greenish pixels to make the result image easier to read + grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel); + errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y); + } else { + // coverage does not match + errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y); + ++numFailingPixels; + } + } + } + + bufferedLogToConsole( + 'Comparing images:
' + + ' allowed deviation in pixel positions = 1
' + + ' number of allowed invalid pixels = ' + maxAllowedInvalidPixels + '
' + + ' number of invalid pixels = ' + numFailingPixels + ); + + if (numFailingPixels > maxAllowedInvalidPixels) { + debug('Image comparison failed. Color threshold = (' + compareThreshold[0] + ', ' + compareThreshold[1] + ', ' + compareThreshold[2] + ')'); + tcuImageCompare.displayImages(result.getAccess(), reference.getAccess(), errorMask.getAccess()); + + return false; + } else { + return true; + } + }; + + /** + * @param {?glsDrawTests.DrawTestSpec.Primitive} primitiveType + * @return {boolean} + */ + glsDrawTests.DrawTest.prototype.compare = function(primitiveType) { + /** @type {tcuSurface.Surface} */ var ref = this.m_rrArrayPack.getSurface(); + /** @type {tcuSurface.Surface} */ var screen = this.m_glArrayPack.getSurface(); + + if (/** @type {number} */ (gl.getParameter(gl.SAMPLES)) > 1) { + // \todo [mika] Improve compare when using multisampling + bufferedLogToConsole('Warning: Comparision of result from multisample render targets are not as strict as without multisampling. Might produce false positives!'); + return tcuImageCompare.fuzzyCompare('Compare Results', 'Compare Results', ref.getAccess(), screen.getAccess(), 0.3, tcuImageCompare.CompareLogMode.RESULT); + } else { + /** @type {glsDrawTests.PrimitiveClass} */ var primitiveClass = glsDrawTests.getDrawPrimitiveClass(primitiveType); + + switch (primitiveClass) { + case glsDrawTests.PrimitiveClass.POINT: { + // Point are extremely unlikely to have overlapping regions, don't allow any no extra / missing pixels + /**@type {number} */ var maxAllowedInvalidPixelsWithPoints = 0; + return tcuImageCompare.intThresholdPositionDeviationErrorThresholdCompare( + 'CompareResult', + 'Result of rendering', + ref.getAccess(), + screen.getAccess(), + [this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue, 256], + [1, 1, 0], //!< 3x3 search kernel + true, //!< relax comparison on the image boundary + maxAllowedInvalidPixelsWithPoints //!< error threshold + ); + } + + case glsDrawTests.PrimitiveClass.LINE: { + // Lines can potentially have a large number of overlapping pixels. Pixel comparison may potentially produce + // false negatives in such pixels if for example the pixel in question is overdrawn by another line in the + // reference image but not in the resultin image. Relax comparison near line intersection points (areas) and + // compare only coverage, not color, in such pixels + /**@type {number} */ var maxAllowedInvalidPixelsWithLines = 15; // line are allowed to have a few bad pixels + return glsDrawTests.intersectionRelaxedLineImageCompare( + 'CompareResult', + 'Result of rendering', + ref, + screen, + [this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue], + maxAllowedInvalidPixelsWithLines + ); + } + + case glsDrawTests.PrimitiveClass.TRIANGLE: { + // Triangles are likely to partially or fully overlap. Pixel difference comparison is fragile in pixels + // where there could be potential overlapping since the pixels might be covered by one triangle in the + // reference image and by the other in the result image. Relax comparsion near primitive edges and + // compare only coverage, not color, in such pixels. + /** @type {number} */ var maxAllowedInvalidPixelsWithTriangles = 10; + + /* TODO: Implement + var renderTargetThreshold = //TODO: get color threshold from the pixel format --> m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold().toIVec().xyz(); + */ + + /** @type {Array} */ var renderTargetThreshold = [3, 3, 3, 3]; + + return glsDrawTests.edgeRelaxedImageCompare( + 'CompareResult', + 'Result of rendering', + ref, + screen, + [this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue], + renderTargetThreshold, + maxAllowedInvalidPixelsWithTriangles + ); + } + + default: + throw new Error('Invalid primitive class'); + } + } + }; + + /** + * @param {glsDrawTests.DrawTestSpec} spec + * @return {number} + */ + glsDrawTests.DrawTest.prototype.getCoordScale = function(spec) { + var maxValue = 1.0; + + for (var arrayNdx = 0; arrayNdx < spec.attribs.length; arrayNdx++) { + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = spec.attribs[arrayNdx]; + /** @type {boolean} */ var isPositionAttr = (arrayNdx == 0) || (attribSpec.additionalPositionAttribute); + /** @type {number} */ var attrMaxValue = 0; + + if (!isPositionAttr) + continue; + + if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10) { + if (attribSpec.normalize) + attrMaxValue += 1.0; + else + attrMaxValue += 1024.0; + } else if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10) { + if (attribSpec.normalize) + attrMaxValue += 1.0; + else + attrMaxValue += 512.0; + } else { + var max = glsDrawTests.GLValue.getMaxValue(attribSpec.inputType).getValue(); + + attrMaxValue += (attribSpec.normalize && !glsDrawTests.inputTypeIsFloatType(attribSpec.inputType)) ? (1.0) : (max * 1.1); + } + + if (attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC3 || attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC4 || + attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC3 || attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC4 || + attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC3 || attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC4) + attrMaxValue *= 2; + + maxValue += attrMaxValue; + } + + return 1.0 / maxValue; + }; + + /** + * @param {glsDrawTests.DrawTestSpec} spec + * @return {number} + */ + glsDrawTests.DrawTest.prototype.getColorScale = function(spec) { + var colorScale = 1.0; + + for (var arrayNdx = 1; arrayNdx < spec.attribs.length; arrayNdx++) { + /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = spec.attribs[arrayNdx]; + /** @type {boolean} */ var isPositionAttr = (arrayNdx == 0) || (attribSpec.additionalPositionAttribute); + + if (isPositionAttr) + continue; + + if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10) { + if (!attribSpec.normalize) + colorScale *= 1.0 / 1024.0; + } else if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10) { + if (!attribSpec.normalize) + colorScale *= 1.0 / 512.0; + } else { + var max = glsDrawTests.GLValue.getMaxValue(attribSpec.inputType).toFloat(); + + colorScale *= (attribSpec.normalize && !glsDrawTests.inputTypeIsFloatType(attribSpec.inputType) ? 1.0 : (1.0 / max)); + if (attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC4 || + attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC4 || + attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC4) + colorScale *= (attribSpec.normalize && !glsDrawTests.inputTypeIsFloatType(attribSpec.inputType) ? 1.0 : 1.0 / max); + } + } + + return colorScale; + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js new file mode 100644 index 000000000..c0f59c209 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js @@ -0,0 +1,961 @@ +'use strict'; +goog.provide('modules.shared.glsFboCompletenessTests'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluObjectWrapper'); +goog.require('framework.opengl.gluStrUtil'); +goog.require('modules.shared.glsFboUtil'); + +goog.scope(function() { + + var glsFboCompletenessTests = modules.shared.glsFboCompletenessTests; + var glsFboUtil = modules.shared.glsFboUtil; + var gluObjectWrapper = framework.opengl.gluObjectWrapper; + var gluStrUtil = framework.opengl.gluStrUtil; + var tcuTestCase = framework.common.tcuTestCase; + + /** + * @param {WebGL2RenderingContext} gl + */ + glsFboCompletenessTests.initGlDependents = function(gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + // The following extensions are applicable both to ES2 and ES3. + /** + * OES_depth_texture + * @type {Array} + */ + glsFboCompletenessTests.s_oesDepthTextureFormats = [ + glsFboUtil.formatkey(gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT), + glsFboUtil.formatkey(gl.DEPTH_COMPONENT, gl.UNSIGNED_INT) + ]; + + /** + * OES_packed_depth_stencil + * @type {Array} + */ + glsFboCompletenessTests.s_oesPackedDepthStencilSizedFormats = [ + gl.DEPTH24_STENCIL8 + ]; + + /** + * s_oesPackedDepthStencilTexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_oesPackedDepthStencilTexFormats = [ + glsFboUtil.formatkey(gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8) + ]; + + /** + * OES_required_internalformat + * @type {Array} + */ + glsFboCompletenessTests.s_oesRequiredInternalFormatColorFormats = [ + // Same as ES2 RBO formats, plus RGBA8 (even without OES_rgb8_rgba8) + gl.RGB5_A1, gl.RGBA8, gl.RGBA4, gl.RGB565 + ]; + + /** + * s_oesRequiredInternalFormatDepthFormats + * @type {Array} + */ + glsFboCompletenessTests.s_oesRequiredInternalFormatDepthFormats = [ + gl.DEPTH_COMPONENT16 + ]; + + /** + * EXT_color_buffer_half_float + * @type {Array} + */ + glsFboCompletenessTests.s_extColorBufferHalfFloatFormats = [ + gl.RGBA16F, gl.RGB16F, gl.RG16F, gl.R16F + ]; + + /** + * s_oesDepth24SizedFormats + * @type {Array} + */ + glsFboCompletenessTests.s_oesDepth24SizedFormats = [ + gl.DEPTH_COMPONENT24 + ]; + + /** + * s_oesDepth32SizedFormats + * @type {Array} + */ + glsFboCompletenessTests.s_oesDepth32SizedFormats = [ + gl['DEPTH_COMPONENT32'] + ]; + + /** + * s_oesRgb8Rgba8RboFormats + * @type {Array} + */ + glsFboCompletenessTests.s_oesRgb8Rgba8RboFormats = [ + gl.RGB8, gl.RGBA8 + ]; + + /** + * s_oesRequiredInternalFormatRgb8ColorFormat + * @type {Array} + */ + glsFboCompletenessTests.s_oesRequiredInternalFormatRgb8ColorFormat = [ + gl.RGB8 + ]; + + /** + * s_extTextureType2101010RevFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extTextureType2101010RevFormats = [ + glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_INT_2_10_10_10_REV), + glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_INT_2_10_10_10_REV) + ]; + + /** + * s_oesRequiredInternalFormat10bitColorFormats + * @type {Array} + */ + glsFboCompletenessTests.s_oesRequiredInternalFormat10bitColorFormats = [ + gl.RGB10_A2, gl['RGB10'] + ]; + + /** + * s_extTextureRgRboFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extTextureRgRboFormats = [ + gl.R8, gl.RG8 + ]; + + /** + * s_extTextureRgTexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extTextureRgTexFormats = [ + glsFboUtil.formatkey(gl.RED, gl.UNSIGNED_BYTE), + glsFboUtil.formatkey(gl.RG, gl.UNSIGNED_BYTE) + ]; + + /** + * s_extTextureRgFloatTexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extTextureRgFloatTexFormats = [ + glsFboUtil.formatkey(gl.RED, gl.FLOAT), + glsFboUtil.formatkey(gl.RG, gl.FLOAT) + ]; + + /** + * s_extTextureRgHalfFloatTexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extTextureRgHalfFloatTexFormats = [ + glsFboUtil.formatkey(gl.RED, gl['HALF_FLOAT_OES']), + glsFboUtil.formatkey(gl.RG, gl['HALF_FLOAT_OES']) + ]; + + /** + * s_nvPackedFloatRboFormats + * @type {Array} + */ + glsFboCompletenessTests.s_nvPackedFloatRboFormats = [ + gl.R11F_G11F_B10F + ]; + + /** + * s_nvPackedFloatTexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_nvPackedFloatTexFormats = [ + glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_INT_10F_11F_11F_REV) + ]; + + /** + * s_extSrgbRboFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extSrgbRboFormats = [ + gl.SRGB8_ALPHA8 + ]; + + /** + * s_extSrgbRenderableTexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extSrgbRenderableTexFormats = [ + glsFboUtil.formatkey(gl['SRGB_ALPHA'], gl.UNSIGNED_BYTE) + ]; + + /** + * s_extSrgbNonRenderableTexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_extSrgbNonRenderableTexFormats = [ + glsFboUtil.formatkey(gl.SRGB, gl.UNSIGNED_BYTE), + gl.SRGB8 + ]; + + /** + * s_nvSrgbFormatsRboFormats + * @type {Array} + */ + glsFboCompletenessTests.s_nvSrgbFormatsRboFormats = [ + gl.SRGB8 + ]; + + /** + * s_nvSrgbFormatsTextureFormats + * The extension does not actually require any unsized format + * to be renderable. However, the renderablility of unsized + * SRGB,UBYTE internalformat-type pair is implied. + * @type {Array} + */ + glsFboCompletenessTests.s_nvSrgbFormatsTextureFormats = [ + gl.SRGB8, + glsFboUtil.formatkey(gl.SRGB, gl.UNSIGNED_BYTE) + ]; + + /** + * s_oesRgb8Rgba8TexFormats + * @type {Array} + */ + glsFboCompletenessTests.s_oesRgb8Rgba8TexFormats = [ + glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_BYTE), + glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_BYTE) + ]; + + var fmt = glsFboUtil.FormatFlags; + + /** + * s_esExtFormats + * @type {Array} + */ + glsFboCompletenessTests.s_esExtFormats = [ + new glsFboUtil.FormatExtEntry( + 'OES_depth_texture', + fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepthTextureFormats) + ), + new glsFboUtil.FormatExtEntry( + 'OES_packed_depth_stencil', + fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.STENCIL_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesPackedDepthStencilSizedFormats) + ), + new glsFboUtil.FormatExtEntry( + 'OES_packed_depth_stencil OES_required_internalformat', + fmt.DEPTH_RENDERABLE | fmt.STENCIL_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesPackedDepthStencilTexFormats) + ), + + // \todo [2013-12-10 lauri] Find out if OES_texture_half_float is really a + // requirement on ES3 also. Or is color_buffer_half_float applicatble at + // all on ES3, since there's also EXT_color_buffer_float? + new glsFboUtil.FormatExtEntry( + 'OES_texture_half_float EXT_color_buffer_half_float', + fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extColorBufferHalfFloatFormats) + ), + + // OES_required_internalformat doesn't actually specify that these are renderable, + // since it was written against ES 1.1. + new glsFboUtil.FormatExtEntry( + 'OES_required_internalformat', + // Allow but don't require RGBA8 to be color-renderable if + // OES_rgb8_rgba8 is not present. + fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormatColorFormats) + ), + new glsFboUtil.FormatExtEntry( + 'OES_required_internalformat', + fmt.DEPTH_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormatDepthFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_texture_rg', + fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgRboFormats) + ), + + // These are not specified to be color-renderable, but the wording is + // exactly as ambiguous as the wording in the ES2 spec. + new glsFboUtil.FormatExtEntry( + 'EXT_texture_rg', + fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgTexFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_texture_rg OES_texture_float', + fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgFloatTexFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_texture_rg OES_texture_half_float', + fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgHalfFloatTexFormats) + ), + + // Some Tegra drivers report gl.EXT_packed_float even for ES. Treat it as + // a synonym for the NV_ version. + new glsFboUtil.FormatExtEntry( + 'EXT_packed_float', + fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvPackedFloatTexFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_packed_float EXT_color_buffer_half_float', + fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvPackedFloatRboFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_sRGB', + fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extSrgbRenderableTexFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_sRGB', + fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extSrgbNonRenderableTexFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_sRGB', + fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extSrgbRboFormats) + ), + new glsFboUtil.FormatExtEntry( + 'NV_sRGB_formats', + fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvSrgbFormatsRboFormats) + ), + new glsFboUtil.FormatExtEntry( + 'NV_sRGB_formats', + fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvSrgbFormatsTextureFormats) + ), + + // In Khronos bug 7333 discussion, the consensus is that these texture + // formats, at least, should be color-renderable. Still, that cannot be + // found in any extension specs, so only allow it, not require it. + new glsFboUtil.FormatExtEntry( + 'OES_rgb8_rgba8', + fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRgb8Rgba8TexFormats) + ), + new glsFboUtil.FormatExtEntry( + 'OES_rgb8_rgba8', + fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRgb8Rgba8RboFormats) + ), + new glsFboUtil.FormatExtEntry( + 'OES_rgb8_rgba8 OES_required_internalformat', + fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormatRgb8ColorFormat) + ), + + // The depth-renderability of the depth RBO formats is not explicitly + // spelled out, but all renderbuffer formats are meant to be renderable. + new glsFboUtil.FormatExtEntry( + 'OES_depth24', + fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth24SizedFormats) + ), + new glsFboUtil.FormatExtEntry( + 'OES_depth24 OES_required_internalformat OES_depth_texture', + fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth24SizedFormats) + ), + + new glsFboUtil.FormatExtEntry( + 'OES_depth32', + fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.RENDERBUFFER_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth32SizedFormats) + ), + new glsFboUtil.FormatExtEntry( + 'OES_depth32 OES_required_internalformat OES_depth_texture', + fmt.TEXTURE_VALID, + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth32SizedFormats) + ), + + new glsFboUtil.FormatExtEntry( + 'EXT_texture_type_2_10_10_10_REV', + fmt.TEXTURE_VALID, // explicitly unrenderable + glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureType2101010RevFormats) + ), + new glsFboUtil.FormatExtEntry( + 'EXT_texture_type_2_10_10_10_REV OES_required_internalformat', + fmt.TEXTURE_VALID, // explicitly unrenderable + glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormat10bitColorFormats) + ) + ]; + + }; // initGlDependents ---------------------------------------- + + /** + * @constructor + * @param {null} testCtx + * @param {WebGLRenderingContextBase} renderCtx + * @param {glsFboUtil.CheckerFactory} factory + */ + glsFboCompletenessTests.Context = function(testCtx, renderCtx, factory) { + + this.m_testCtx = testCtx; + this.m_renderCtx = renderCtx; + this.m_ctxFormats = new glsFboUtil.FormatDB(); + this.m_minFormats = new glsFboUtil.FormatDB(); + this.m_maxFormats = new glsFboUtil.FormatDB(); + this.m_verifier = new glsFboUtil.FboVerifier(this.m_ctxFormats, factory); + this.m_haveMultiColorAtts = false; + + // FormatExtEntries + var extRange = glsFboUtil.rangeArray(glsFboCompletenessTests.s_esExtFormats); + this.addExtFormats(extRange); + + }; + + // RenderContext& + glsFboCompletenessTests.Context.prototype.getRenderContext = function() { + return this.m_renderCtx; + }; + + // TestContext& + glsFboCompletenessTests.Context.prototype.getTestContext = function() { + return this.m_testCtx; + }; + + // const FboVerifier& + glsFboCompletenessTests.Context.prototype.getVerifier = function() { + return this.m_verifier; + }; + + // const FormatDB& + glsFboCompletenessTests.Context.prototype.getMinFormats = function() { + return this.m_minFormats; + }; + + // const FormatDB& + glsFboCompletenessTests.Context.prototype.getCtxFormats = function() { + return this.m_ctxFormats; + }; + + // bool + glsFboCompletenessTests.Context.prototype.haveMultiColorAtts = function() { + return this.m_haveMultiColorAtts; + }; + + glsFboCompletenessTests.Context.prototype.setHaveMulticolorAtts = function(have) { + this.m_haveMultiColorAtts = (have == true); + }; + + glsFboCompletenessTests.Context.prototype.addFormats = function(fmtRange) { + glsFboUtil.addFormats(this.m_minFormats, fmtRange); + glsFboUtil.addFormats(this.m_ctxFormats, fmtRange); + glsFboUtil.addFormats(this.m_maxFormats, fmtRange); + }; + glsFboCompletenessTests.Context.prototype.addExtFormats = function(extRange) { + glsFboUtil.addExtFormats(this.m_ctxFormats, extRange, this.m_renderCtx); + glsFboUtil.addExtFormats(this.m_maxFormats, extRange, this.m_renderCtx); + }; + + glsFboCompletenessTests.Context.prototype.createRenderableTests = function(gl) { + + /** @type {tcuTestCase.DeqpTest} */ + var renderableTests = tcuTestCase.newTest('renderable', 'Tests for support of renderable image formats'); + /** @type {tcuTestCase.DeqpTest} */ + var rbRenderableTests = tcuTestCase.newTest('renderbuffer', 'Tests for renderbuffer formats'); + /** @type {tcuTestCase.DeqpTest} */ + var texRenderableTests = tcuTestCase.newTest('texture', 'Tests for texture formats'); + + var attPoints = [ + [gl.DEPTH_ATTACHMENT, 'depth', 'Tests for depth attachments'], + [gl.STENCIL_ATTACHMENT, 'stencil', 'Tests for stencil attachments'], + [gl.COLOR_ATTACHMENT0, 'color0', 'Tests for color attachments'] + ]; + + // At each attachment point, iterate through all the possible formats to + // detect both false positives and false negatives. + var rboFmts = this.m_maxFormats.getFormats(glsFboUtil.FormatFlags.ANY_FORMAT); + var texFmts = this.m_maxFormats.getFormats(glsFboUtil.FormatFlags.ANY_FORMAT); + + for (var i = 0, l_attPoints = attPoints.length; i < l_attPoints; ++i) { + var rbAttTests = tcuTestCase.newTest(attPoints[i][1], attPoints[i][2]); + var texAttTests = tcuTestCase.newTest(attPoints[i][1], attPoints[i][2]); + + for (var j = 0, l_rboFmts = rboFmts.length; j < l_rboFmts; ++j) { + var params = glsFboCompletenessTests.renderableParams( + attPoints[i][0], gl.RENDERBUFFER, rboFmts[j] + ); + rbAttTests.addChild( + new glsFboCompletenessTests.RenderableTest( + glsFboCompletenessTests.renderableParams.getName(params), + glsFboCompletenessTests.renderableParams.getDescription(params), + this, params + ) + ); + } + rbRenderableTests.addChild(rbAttTests); + + for (var j = 0, l_texFmts = texFmts.length; j < l_texFmts; ++j) { + var params = glsFboCompletenessTests.renderableParams( + attPoints[i][0], gl.TEXTURE, texFmts[j] + ); + texAttTests.addChild( + new glsFboCompletenessTests.RenderableTest( + glsFboCompletenessTests.renderableParams.getName(params), + glsFboCompletenessTests.renderableParams.getDescription(params), + this, params + ) + ); + } + texRenderableTests.addChild(texAttTests); + + } + renderableTests.addChild(rbRenderableTests); + renderableTests.addChild(texRenderableTests); + + return renderableTests; + }; + + glsFboCompletenessTests.Context.prototype.createAttachmentTests = function(gl) { + + var attCombTests = tcuTestCase.newTest('attachment_combinations', 'Tests for attachment combinations'); + + var s_bufTypes = [gl.NONE, gl.RENDERBUFFER, gl.TEXTURE]; + var ls_bufTypes = s_bufTypes.length; + + for (var col0 = 0; col0 < ls_bufTypes; ++col0) + for (var coln = 0; coln < ls_bufTypes; ++coln) + for (var dep = 0; dep < ls_bufTypes; ++dep) + for (var stc = 0; stc < ls_bufTypes; ++stc) { + var params = glsFboCompletenessTests.attachmentParams( + s_bufTypes[col0], s_bufTypes[coln], s_bufTypes[dep], s_bufTypes[stc] + ); + attCombTests.addChild(new glsFboCompletenessTests.AttachmentTest( + glsFboCompletenessTests.attachmentParams.getName(params), + glsFboCompletenessTests.attachmentParams.getDescription(params), + this, params + )); + } + return attCombTests; + }; + + glsFboCompletenessTests.Context.prototype.createSizeTests = function(gl) { + + var sizeTests = tcuTestCase.newTest('size', 'Tests for attachment sizes'); + + sizeTests.addChild(new glsFboCompletenessTests.EmptyImageTest( + 'zero', 'Test for zero-sized image attachment', this + )); + + return sizeTests; + + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} desc + * @param {Object} params + */ + glsFboCompletenessTests.TestBase = function(name, desc, params) { + tcuTestCase.DeqpTest.call(this, name, desc); + this.m_params = params; + }; + glsFboCompletenessTests.TestBase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsFboCompletenessTests.TestBase.prototype.constructor = glsFboCompletenessTests.TestBase; + + glsFboCompletenessTests.TestBase.prototype.getContext = function() { + return tcuTestCase.runner; + }; + + // GLenum attPoint, GLenum bufType + /** + * @param {number} attPoint + * @param {number} bufType + * @param {WebGLRenderingContextBase=} gl + */ + glsFboCompletenessTests.TestBase.prototype.getDefaultFormat = function(attPoint, bufType, gl) { + gl = gl || window.gl; + + if (bufType == gl.NONE) { + return glsFboUtil.ImageFormat.none(); + } + + // Prefer a standard format, if there is one, but if not, use a format + // provided by an extension. + var formats = this.m_ctx.getMinFormats().getFormats( + glsFboUtil.formatFlag(attPoint, gl) | glsFboUtil.formatFlag(bufType, gl) + ); + + if (!formats.length) { + formats = this.m_ctx.getCtxFormats().getFormats( + glsFboUtil.formatFlag(attPoint, gl) | glsFboUtil.formatFlag(bufType, gl) + ); + } + if (!formats.length) { + throw new Error('Unsupported attachment kind for attachment point'); + } + + return formats[0]; + + }; + + /** + * @param {number} bufType + * @param {glsFboUtil.ImageFormat} format + * @param {number} width + * @param {number} height + * @param {glsFboUtil.FboBuilder} builder + * @param {WebGLRenderingContextBase=} gl + * @return {glsFboUtil.Image} + */ + glsFboCompletenessTests.makeImage = function(bufType, format, width, height, builder, gl) { + gl = gl || window.gl; + var image = 0; + switch (bufType) { + case gl.NONE: + return null; + break; + case gl.RENDERBUFFER: + image = /** @type {glsFboUtil.Renderbuffer}*/(builder.makeConfig(glsFboUtil.Renderbuffer)); + break; + case gl.TEXTURE: + image = /** @type {glsFboUtil.Texture2D}*/(builder.makeConfig(glsFboUtil.Texture2D)); + break; + default: + throw new Error('Impossible case'); + } + image.internalFormat = format; + image.width = width; + image.height = height; + return image; + }; + + /** + * @param {number} bufType + * @param {glsFboUtil.ImageFormat} format + * @param {number} width + * @param {number} height + * @param {glsFboUtil.FboBuilder} builder + * @param {WebGLRenderingContextBase=} gl + * @return {glsFboUtil.Attachment} + */ + glsFboCompletenessTests.makeAttachment = function(bufType, format, width, height, builder, gl) { + gl = gl || window.gl; + var cfg = glsFboCompletenessTests.makeImage(bufType, format, width, height, builder, gl); + if (cfg == null) return null; + + /** @type {glsFboUtil.Attachment} */ var att = null; + var img = 0; + + var mask = glsFboUtil.Config.s_types.RENDERBUFFER | glsFboUtil.Config.s_types.TEXTURE_2D; + + switch (cfg.type & mask) { + case glsFboUtil.Config.s_types.RENDERBUFFER: + img = builder.glCreateRbo(/** @type {glsFboUtil.Renderbuffer} */(cfg)); + att = /** @type {glsFboUtil.RenderbufferAttachment} */ (builder.makeConfig(glsFboUtil.RenderbufferAttachment)); + break; + case glsFboUtil.Config.s_types.TEXTURE_2D: + img = builder.glCreateTexture(/** @type {glsFboUtil.Texture2D} */(cfg)); + att = /** @type {glsFboUtil.TextureFlatAttachment} */ (builder.makeConfig(glsFboUtil.TextureFlatAttachment)); + att.texTarget = gl.TEXTURE_2D; + break; + default: + throw new Error('Unsupported config.'); + } + att.imageName = img; + return att; + }; + + //GLenum target, GLenum bufType, ImageFormat format, GLsizei width, GLsizei height, FboBuilder& builder, webglctx + /** + * @param {number} target + * @param {number} bufType + * @param {glsFboUtil.ImageFormat} format + * @param {number} width + * @param {number} height + * @param {glsFboUtil.FboBuilder} builder + * @param {WebGL2RenderingContext} gl + */ + glsFboCompletenessTests.TestBase.prototype.attachTargetToNew = function( + target, bufType, format, width, height, builder, gl + ) { + var imgFmt = format; + if (imgFmt.format == gl.NONE) + imgFmt = this.getDefaultFormat(target, bufType, gl); + var att = glsFboCompletenessTests.makeAttachment(bufType, imgFmt, width, height, builder, gl); + builder.glAttach(target, att); + }; + + /** + * @param {number} status + * @param {WebGLRenderingContextBase=} gl + * @return {string} + */ + glsFboCompletenessTests.statusName = function(status, gl) { + gl = gl || window.gl; + + var errorName = gluStrUtil.getErrorName(status); + if (status != gl.NO_ERROR && errorName != '') + return errorName + ' (during FBO initialization)'; + + var fbStatusName = gluStrUtil.getFramebufferStatusName(status); + if (fbStatusName != '') + return fbStatusName; + + return 'unknown value (' + status + ')'; + }; + + glsFboCompletenessTests.TestBase.prototype.iterate = function() { + var gl = window.gl; + + var fbo = new gluObjectWrapper.Framebuffer(gl); + var builder = new glsFboUtil.FboBuilder(fbo.get(), gl.FRAMEBUFFER, gl); + var ret = this.build(builder, gl); + var statuses = this.m_ctx.getVerifier().validStatusCodes(builder, gl); + + var errorCode = builder.getError(); + if (errorCode != gl.NO_ERROR) { + bufferedLogToConsole('Received ' + gluStrUtil.getErrorName(errorCode) + ' (during FBO initialization).'); + if (statuses.isErrorCodeValid(errorCode)) + testPassed(); + else if (statuses.isErrorCodeRequired(gl.NO_ERROR)) + testFailedOptions('Excepted no error but got ' + gluStrUtil.getErrorName(errorCode), true); + else + testFailedOptions('Got wrong error code', true); + } else { + var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + var validStatus = statuses.isFBOStatusValid(fboStatus); + bufferedLogToConsole('Received ' + gluStrUtil.getFramebufferStatusName(fboStatus)); + if (!validStatus) { + if (fboStatus == gl.FRAMEBUFFER_COMPLETE) { + testFailedOptions('Framebuffer checked as complete, expected incomplete', true); + } else if (statuses.isFBOStatusRequired(gl.FRAMEBUFFER_COMPLETE)) { + testFailedOptions('Framebuffer checked as incomplete, expected complete', true); + } else { + // An incomplete status is allowed, but not _this_ incomplete status. + testFailedOptions('Framebuffer checked as incomplete, but with wrong status', true); + } + } else if (fboStatus != gl.FRAMEBUFFER_COMPLETE && statuses.isFBOStatusValid(gl.FRAMEBUFFER_COMPLETE)) { + testPassedOptions('Warning: framebuffer object could have checked as complete but did not.', true); + } else { + // pass + testPassed(); + } + } + builder.deinit(); + + return tcuTestCase.IterateResult.STOP; + }; + + glsFboCompletenessTests.formatName = function(format, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid GL object'); + + var s = gluStrUtil.getPixelFormatName(format.format).substr(3).toLowerCase(); + + if (format.unsizedType != gl.NONE) + s += '_' + gluStrUtil.getTypeName(format.unsizedType).substr(3).toLowerCase(); + + return s; + }; + glsFboCompletenessTests.formatDesc = function(format, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid GL object'); + + var s = gluStrUtil.getPixelFormatName(format.format); + + if (format.unsizedType != gl.NONE) + s += ' with type ' + gluStrUtil.getTypeName(format.unsizedType); + + return s; + }; + + /** + * @typedef {{attPoint: number, bufType: number, format: glsFboUtil.ImageFormat}} + */ + glsFboCompletenessTests.renderableParamsT; + + /** + * @param {number} attPoint + * @param {number} bufType + * @param {glsFboUtil.ImageFormat} format + * @return {glsFboCompletenessTests.renderableParamsT} + */ + glsFboCompletenessTests.renderableParams = function(attPoint, bufType, format) { + var ret = { + attPoint: attPoint, + bufType: bufType, + format: format + }; + return ret; + }; + /** + * @param {glsFboCompletenessTests.renderableParamsT} params + * @param {WebGLRenderingContextBase=} gl + * @return {string} + */ + glsFboCompletenessTests.renderableParams.getName = function(params, gl) { + return glsFboCompletenessTests.formatName(params.format, gl); + }; + /** + * @param {glsFboCompletenessTests.renderableParamsT} params + * @param {WebGLRenderingContextBase=} gl + * @return {string} + */ + glsFboCompletenessTests.renderableParams.getDescription = function(params, gl) { + return glsFboCompletenessTests.formatDesc(params.format, gl); + }; + + /** + * @constructor + * @extends {glsFboCompletenessTests.TestBase} + * @param {string} name + * @param {string} desc + * @param {glsFboCompletenessTests.Context} ctx + * @param {glsFboCompletenessTests.renderableParamsT} params + */ + glsFboCompletenessTests.RenderableTest = function(name, desc, ctx, params) { + glsFboCompletenessTests.TestBase.call(this, name, desc, params); + this.m_ctx = ctx; + }; + glsFboCompletenessTests.RenderableTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype); + glsFboCompletenessTests.RenderableTest.prototype.constructor = glsFboCompletenessTests.RenderableTest; + + glsFboCompletenessTests.RenderableTest.prototype.build = function(builder, gl) { + this.attachTargetToNew(this.m_params.attPoint, this.m_params.bufType, this.m_params.format, 64, 64, builder, gl); + return true; + }; + + glsFboCompletenessTests.attTypeName = function(bufType, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid GL object'); + switch (bufType) { + case gl.NONE: return 'none'; + case gl.RENDERBUFFER: return 'rbo'; + case gl.TEXTURE: return 'tex'; + default: break; + } + throw new Error('Impossible case'); + }; + + /** + * @typedef {{color0Kind: number, colornKind: number, depthKind: number, stencilKind: number}} + */ + glsFboCompletenessTests.attachmentParamsT; + + /** + * @param {number} color0Kind + * @param {number} colornKind + * @param {number} depthKind + * @param {number} stencilKind + * @return {glsFboCompletenessTests.attachmentParamsT} + */ + glsFboCompletenessTests.attachmentParams = function(color0Kind, colornKind, depthKind, stencilKind) { + var ret = { + color0Kind: color0Kind, + colornKind: colornKind, + depthKind: depthKind, + stencilKind: stencilKind + }; + return ret; + }; + /** + * @param {glsFboCompletenessTests.attachmentParamsT} params + * @param {WebGLRenderingContextBase=} gl + * @return {string} + */ + glsFboCompletenessTests.attachmentParams.getName = function(params, gl) { + return (glsFboCompletenessTests.attTypeName(params.color0Kind, gl) + '_' + + glsFboCompletenessTests.attTypeName(params.colornKind, gl) + '_' + + glsFboCompletenessTests.attTypeName(params.depthKind, gl) + '_' + + glsFboCompletenessTests.attTypeName(params.stencilKind, gl)); + }; + /** + * @param {glsFboCompletenessTests.attachmentParamsT} params + * @return {string} + */ + glsFboCompletenessTests.attachmentParams.getDescription = glsFboCompletenessTests.attachmentParams.getName; + + /** + * @constructor + * @extends {glsFboCompletenessTests.TestBase} + * @param {string} name + * @param {string} desc + * @param {glsFboCompletenessTests.Context} ctx + * @param {glsFboCompletenessTests.attachmentParamsT} params + */ + glsFboCompletenessTests.AttachmentTest = function(name, desc, ctx, params) { + glsFboCompletenessTests.TestBase.call(this, name, desc, params); + this.m_ctx = ctx; + }; + glsFboCompletenessTests.AttachmentTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype); + glsFboCompletenessTests.AttachmentTest.prototype.constructor = glsFboCompletenessTests.AttachmentTest; + + glsFboCompletenessTests.AttachmentTest.prototype.makeDepthAndStencil = function(builder, gl) { + + /** @type {glsFboUtil.Attachment} */ + var att = null; + + if (this.m_params.stencilKind == this.m_params.depthKind) { + // If there is a common stencil+depth -format, try to use a common + // image for both attachments. + var flags = glsFboUtil.FormatFlags.DEPTH_RENDERABLE | + glsFboUtil.FormatFlags.STENCIL_RENDERABLE | + glsFboUtil.formatFlag(this.m_params.stencilKind, gl); + + var formats = this.m_ctx.getMinFormats().getFormats(flags); + if (formats.length) { + var format = formats[0]; + att = glsFboCompletenessTests.makeAttachment(this.m_params.depthKind, format, 64, 64, builder, gl); + builder.glAttach(gl.DEPTH_ATTACHMENT, att); + builder.glAttach(gl.STENCIL_ATTACHMENT, att); + return; + } + } + // Either the kinds were separate, or a suitable format was not found. + // Create separate images. + this.attachTargetToNew(gl.STENCIL_ATTACHMENT, this.m_params.stencilKind, + glsFboUtil.ImageFormat.none(), 64, 64, builder, gl); + this.attachTargetToNew(gl.DEPTH_ATTACHMENT, this.m_params.depthKind, + glsFboUtil.ImageFormat.none(), 64, 64, builder, gl); + }; + + glsFboCompletenessTests.AttachmentTest.prototype.build = function(builder, gl) { + + this.attachTargetToNew(gl.COLOR_ATTACHMENT0, this.m_params.color0Kind, + glsFboUtil.ImageFormat.none(), 64, 64, builder, gl); + + if (this.m_params.colornKind != gl.NONE) { + if (this.m_ctx.haveMultiColorAtts()) + throw new Error('Multiple attachments not supported'); + var maxAttachments = gl.getParameter(gl.MAX_COLOR_ATTACHMENTS); + + for (var i = 1; i < maxAttachments; ++i) { + this.attachTargetToNew(gl.COLOR_ATTACHMENT0 + i, this.m_params.colornKind, + glsFboUtil.ImageFormat.none(), 64, 64, builder, gl); + } + } + + this.makeDepthAndStencil(builder, gl); + + return true; + }; + + /** + * @constructor + * @extends {glsFboCompletenessTests.TestBase} + * @param {string} name + * @param {string} desc + * @param {glsFboCompletenessTests.Context} ctx + */ + glsFboCompletenessTests.EmptyImageTest = function(name, desc, ctx) { + glsFboCompletenessTests.TestBase.call(this, name, desc, null); + this.m_ctx = ctx; + }; + glsFboCompletenessTests.EmptyImageTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype); + glsFboCompletenessTests.EmptyImageTest.prototype.constructor = glsFboCompletenessTests.EmptyImageTest; + + glsFboCompletenessTests.EmptyImageTest.prototype.build = function(builder, gl) { + this.attachTargetToNew(gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, + glsFboUtil.ImageFormat.none(), 0, 0, builder, gl); + return true; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js new file mode 100644 index 000000000..86d05891f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js @@ -0,0 +1,1413 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsFboUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.gluStrUtil'); + +goog.scope(function() { + + var glsFboUtil = modules.shared.glsFboUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var gluStrUtil = framework.opengl.gluStrUtil; + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * @constructor + * @template KeyT + * @template ValueT + * @param {function(!KeyT, !KeyT):boolean} comparefnc + */ + glsFboUtil.Map = function(comparefnc) { + /** @type {Array<{first: !KeyT, second: ValueT}>} */ + this.store = []; + this.compare = comparefnc; + this.length = 0; + }; + + /** + * @param {number} num1 + * @param {number} num2 + * @return {boolean} + */ + glsFboUtil.Map.compareNumber = function(num1, num2) { + return num1 < num2; + }; + + /** + * @param {!KeyT} key + * @param {ValueT} value + * @return {{first: !KeyT, second: ValueT}} + */ + glsFboUtil.Map.prototype.pair = function(key, value) { + return { + first: key, + second: value + }; + }; + + /** + * @protected + * @param {!KeyT} key + * @return {number} + */ + glsFboUtil.Map.prototype.findInsertionPoint = function(key) { + var /** @type {number} */i, /** @type {number} */length; + for (i = 0, length = this.store.length; i < length; ++i) { + if (!this.compare(key, this.store[i].first)) break; + } + return i; + }; + + /** + * index should be a value returned from findInsertionPoint. + * returns true if the compare function returns false reflexively + * (i.e. no matter the order in which the keys are passed as arguments). + * @protected + * @param {!KeyT} key + * @param {number} index + * @return {boolean} + */ + glsFboUtil.Map.prototype.foundIndexMatches = function(key, index) { + return ( + this.store[index] !== undefined && + !this.compare(this.store[index].first, key) + ); + }; + + /** + * @param {!KeyT} key + * @return {boolean} + */ + glsFboUtil.Map.prototype.isset = function(key) { + return this.foundIndexMatches(key, this.findInsertionPoint(key)); + }; + + /** + * @param {!KeyT} key + * @param {ValueT} value + */ + glsFboUtil.Map.prototype.set = function(key, value) { + var index = this.findInsertionPoint(key); + if (this.foundIndexMatches(key, index)) { + this.store[index].second = value; + } else { + this.store.splice(index, 0, this.pair(key, value)); + ++this.length; + } + }; + + /** + * @param {!KeyT} key + * @return {?ValueT} + */ + glsFboUtil.Map.prototype.remove = function(key) { + var index = this.findInsertionPoint(key); + /** @type {?ValueT} */ var ret = null; + if (this.foundIndexMatches(key, index)) { + ret = this.store[index].second; + this.store.splice(index, 1); + --this.length; + } + return ret; + }; + + /** + * @param {KeyT} key + * @return {?{first: KeyT, second: ValueT}} + */ + glsFboUtil.Map.prototype.get = function(key) { + var index = this.findInsertionPoint(key); + if (this.foundIndexMatches(key, index)) return this.store[index]; + return null; + }; + + /** + * @param {KeyT} key + * @return {?ValueT} + */ + glsFboUtil.Map.prototype.getValue = function(key) { + var index = this.findInsertionPoint(key); + if (this.foundIndexMatches(key, index)) return this.store[index].second; + return null; + }; + + /** + * @param {!KeyT} key + * @param {ValueT} fallback + * @return {ValueT} + */ + glsFboUtil.Map.prototype.lookupDefault = function(key, fallback) { + var index = this.findInsertionPoint(key); + if (this.foundIndexMatches(key, index)) return this.store[index].second; + return fallback; + }; + + /** + * @param {number} index + * @return {{first: KeyT, second: ValueT}|undefined} + */ + glsFboUtil.Map.prototype.getIndex = function(index) { + return this.store[index]; + }; + + /** + * Use the callback to set the value to be identified by key. + * If a value is already identified by the key, it will be passed to the callback + * @param {!KeyT} key + * @param {function(ValueT=):!ValueT} callback + */ + glsFboUtil.Map.prototype.transform = function(key, callback) { + var index = this.findInsertionPoint(key); + if (this.foundIndexMatches(key, index)) { + this.store[index].second = callback(this.store[index].second); + } else { + this.store.splice(index, 0, this.pair(key, callback())); + ++this.length; + } + }; + + /** + * removed all elements from the Map + */ + glsFboUtil.Map.prototype.clear = function() { + this.store.splice(0, this.length); + this.length = 0; + }; + + /** + * @constructor + */ + glsFboUtil.FormatDB = function() { + this.m_map = /** @type {glsFboUtil.Map} */( + new glsFboUtil.Map(glsFboUtil.ImageFormat.lessthan) + ); + }; + + /** + * @param {glsFboUtil.ImageFormat} format + * @param {number} newFlags + */ + glsFboUtil.FormatDB.prototype.addFormat = function(format, newFlags) { + this.m_map.transform(format, function(flags) { + return flags | newFlags; + }); + }; + + /** + * @param {number} requirements + * @return {Array} + */ + glsFboUtil.FormatDB.prototype.getFormats = function(requirements) { + /** @type {Array} */ var ret = []; + for (var i = 0; i < this.m_map.length; ++i) { + var pair = this.m_map.getIndex(i); + if ((pair.second & requirements) == requirements) + ret.push(pair.first); + } + + return ret; + }; + + /** + * @param {glsFboUtil.ImageFormat} format + * @param {number} fallback + * @return {number} + */ + glsFboUtil.FormatDB.prototype.getFormatInfo = function(format, fallback) { + return this.m_map.lookupDefault(format, fallback); + }; + + /** + * @param {Object} map + * @param {number} key + * @param {number} fallback + * @return {number} + */ + glsFboUtil.lookupDefault = function(map, key, fallback) { + return (map[key] !== undefined) ? map[key] : fallback; + }; + + /** + * @param {Array} array + * @param {number} item + * @return {boolean} + */ + glsFboUtil.contains = function(array, item) { + var l = array.length; + for (var i = 0; i < l; ++i) + if (array[i] == item) return true; + return false; + }; + + /** + * @typedef {Array<(number | glsFboUtil.Range)>} + */ + glsFboUtil.formatT; + + /** + * @param {glsFboUtil.FormatDB} db + * @param {glsFboUtil.Range} stdFmts + */ + glsFboUtil.addFormats = function(db, stdFmts) { + for (var set = stdFmts.reset(); set = stdFmts.current(); stdFmts.next()) { + for (var fmt = set[1].reset(); fmt = set[1].current(); set[1].next()) { + db.addFormat(glsFboUtil.formatKeyInfo(fmt), set[0]); + } + } + }; + + /** + * @param {glsFboUtil.FormatDB} db + * @param {glsFboUtil.Range} extFmts + * @param {WebGLRenderingContextBase=} gl + * @throws {Error} + */ + glsFboUtil.addExtFormats = function(db, extFmts, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + var extensions = gl.getSupportedExtensions(); + + // loop through the range, looking at the extentions. + for (var ext = extFmts.reset(); ext = extFmts.current(); extFmts.next()) { + var tokens = ext.extensions.split(/\s+/); + + var supported = function() { + for (var i = 0, l = tokens.length; i < l; ++i) + if (extensions.indexOf(tokens[i]) === -1) return false; + return true; + }(); + + if (supported) { + for (var format = ext.formats.reset(); format = ext.formats.current(); ext.formats.next()) { + db.addFormat(glsFboUtil.formatKeyInfo(format), ext.flags); + } + } + + } + + }; + + /** + * @param {number} glenum + * @param {WebGLRenderingContextBase=} gl + * @return {number} + * @throws {Error} + */ + glsFboUtil.formatFlag = function(glenum, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + switch (glenum) { + case gl.NONE: + return glsFboUtil.FormatFlags.ANY_FORMAT; + case gl.RENDERBUFFER: + return glsFboUtil.FormatFlags.RENDERBUFFER_VALID; + case gl.TEXTURE: + return glsFboUtil.FormatFlags.TEXTURE_VALID; + case gl.STENCIL_ATTACHMENT: + return glsFboUtil.FormatFlags.STENCIL_RENDERABLE; + case gl.DEPTH_ATTACHMENT: + return glsFboUtil.FormatFlags.DEPTH_RENDERABLE; + default: + if (glenum < gl.COLOR_ATTACHMENT0 || glenum > gl.COLOR_ATTACHMENT15) { + throw new Error('glenum out of range'); + } + } + return glsFboUtil.FormatFlags.COLOR_RENDERABLE; + }; + + /** + * Remove value from array + * @param {Array} array + * @param {number} value + */ + glsFboUtil.remove_from_array = function(array, value) { + var index = 0; + while ((index = array.indexOf(value)) != -1) { + array.splice(index, 1); + } + }; + + /** + * glsFboUtil.FormatExtEntry + * @constructor + * @struct + * @param {string=} extensions + * @param {number=} flags + * @param {glsFboUtil.Range=} formats + */ + glsFboUtil.FormatExtEntry = function(extensions, flags, formats) { + this.extensions = null; + this.flags = null; + this.formats = null; + + if (extensions !== undefined) { + this.extensions = extensions; + if (flags !== undefined) { + this.flags = flags; + if (formats !== undefined) + this.formats = formats; + } + } + + }; + + /** + * glsFboUtil.Range + * @constructor + * @struct + * @template T + * @param {Array} array + * @param {number=} begin + * @param {number=} end + */ + glsFboUtil.Range = function(array, begin, end) { + // @private + this.m_begin = (begin === undefined ? 0 : begin); + // @private + this.m_end = end || array.length; + /** + * @private + * @type {Array} + */ + this.m_array = array; + // @private + this.m_index = this.m_begin; + }; + + /** + * @return {Array} + */ + glsFboUtil.Range.prototype.array = function() { + return this.m_array; + }; + + /** + * @return {number} + */ + glsFboUtil.Range.prototype.begin = function() { + return this.m_begin; + }; + + /** *generated by script* + * @return {number} + */ + glsFboUtil.Range.prototype.end = function() { + return this.m_end; + }; + + /** + * Returns the current pointer index as well as the current object + * @param {number} id + * @return {{first: number, second: T}} + */ + glsFboUtil.Range.prototype.get = function(id) { + return { + first: id, + second: this.m_array[id] + }; + }; + + /** + * Sets the internal pointer to the beginning of the range, and returns the first object. + * @return {T} + */ + glsFboUtil.Range.prototype.reset = function() { + this.m_index = this.m_begin; + return this.current(); + }; + + /** + * returns the current object within the specified range. The internal pointer is unaltered. + * @return {T} + */ + glsFboUtil.Range.prototype.current = function() { + return this.m_index < this.m_end ? this.m_array[this.m_index] : null; + }; + + /** + * Increments the internal pointer + */ + glsFboUtil.Range.prototype.next = function() { + ++this.m_index; + }; + + /** + * glsFboUtil.rangeArray + * replaces the macro GLS_ARRAY_RANGE + * Creates a new Range object from the specified array, spanning the whole array. + * @template T + * @param {Array} array + * @return {glsFboUtil.Range} + */ + glsFboUtil.rangeArray = function(array) { + return new glsFboUtil.Range(array); + }; + + /** + * @constructor + * @struct + * @param {number=} format + * @param {number=} unsizedType + */ + glsFboUtil.ImageFormat = function(format, unsizedType) { + this.format = format || 0; + //! Type if format is unsized, gl.NONE if sized. + this.unsizedType = unsizedType || 0; + + }; + + /** + * @param {!glsFboUtil.ImageFormat} obj1 + * @param {!glsFboUtil.ImageFormat} obj2 + * @return {boolean} + */ + glsFboUtil.ImageFormat.lessthan = function(obj1, obj2) { + return ( + (obj1.format < obj2.format) || + (obj1.format == obj2.format && obj1.unsizedType < obj2.unsizedType) + ); + }; + + /** + * Sets the object's parameters to gl.NONE + */ + glsFboUtil.ImageFormat.prototype.none = function() { + this.format = 0; + this.unsizedType = 0; + }; + + /** + * @return {glsFboUtil.ImageFormat} + */ + glsFboUtil.ImageFormat.none = function() { + var obj = new glsFboUtil.ImageFormat(); + obj.none(); + return obj; + }; + + // where key is a FormatKey, and a FormatKey is a unsigned 32bit int. + + /** + * @param {number} key + * @return {glsFboUtil.ImageFormat} + */ + glsFboUtil.formatKeyInfo = function(key) { + return new glsFboUtil.ImageFormat( + (key & 0x0000ffff), + (key & 0xffff0000) >>> 16 + ); + }; + + /** + * glsFboUtil.Config Class. + * @constructor + */ + glsFboUtil.Config = function() { + this.type = glsFboUtil.Config.s_types.CONFIG; + this.target = glsFboUtil.Config.s_target.NONE; + }; + /** + * @enum {number} + */ + glsFboUtil.Config.s_target = { + NONE: 0, + RENDERBUFFER: 0x8D41, + TEXTURE_2D: 0x0DE1, + TEXTURE_CUBE_MAP: 0x8513, + TEXTURE_3D: 0x806F, + TEXTURE_2D_ARRAY: 0x8C1A, + + FRAMEBUFFER: 0x8D40 + }; + + // the c++ uses dynamic casts to determain if an object inherits from a + // given class. Here, each class' constructor assigns a bit to obj.type. + // look for the bit to see if an object inherits that class. + + /** + * @enum + */ + glsFboUtil.Config.s_types = { + CONFIG: 0x000001, + + IMAGE: 0x000010, + RENDERBUFFER: 0x000020, + TEXTURE: 0x000040, + TEXTURE_FLAT: 0x000080, + TEXTURE_2D: 0x000100, + TEXTURE_CUBE_MAP: 0x000200, + TEXTURE_LAYERED: 0x000400, + TEXTURE_3D: 0x000800, + TEXTURE_2D_ARRAY: 0x001000, + + ATTACHMENT: 0x010000, + ATT_RENDERBUFFER: 0x020000, + ATT_TEXTURE: 0x040000, + ATT_TEXTURE_FLAT: 0x080000, + ATT_TEXTURE_LAYER: 0x100000, + + UNUSED: 0xFFE0E00E + }; + + /** + * glsFboUtil.Image Class. + * @constructor + * @extends {glsFboUtil.Config} + */ + glsFboUtil.Image = function() { + glsFboUtil.Config.call(this); + this.type |= glsFboUtil.Config.s_types.IMAGE; + this.width = 0; + this.height = 0; + this.internalFormat = new glsFboUtil.ImageFormat(); + }; + + /** + * glsFboUtil.Renderbuffer Class. + * @constructor + * @extends {glsFboUtil.Image} + */ + glsFboUtil.Renderbuffer = function() { + glsFboUtil.Image.call(this); + this.type |= glsFboUtil.Config.s_types.RENDERBUFFER; + this.target = glsFboUtil.Config.s_target.RENDERBUFFER; + this.numSamples = 0; + }; + + /** + * glsFboUtil.Texture Class. + * @constructor + * @extends {glsFboUtil.Image} + */ + glsFboUtil.Texture = function() { + glsFboUtil.Image.call(this); + this.type |= glsFboUtil.Config.s_types.TEXTURE; + this.numLevels = 1; + }; + + /** + * glsFboUtil.TextureFlat Class. + * @constructor + * @extends {glsFboUtil.Texture} + */ + glsFboUtil.TextureFlat = function() { + glsFboUtil.Texture.call(this); + this.type |= glsFboUtil.Config.s_types.TEXTURE_FLAT; + }; + + /** + * glsFboUtil.Texture2D Class. + * @constructor + * @extends {glsFboUtil.TextureFlat} + */ + glsFboUtil.Texture2D = function() { + glsFboUtil.TextureFlat.call(this); + this.type |= glsFboUtil.Config.s_types.TEXTURE_2D; + this.target = glsFboUtil.Config.s_target.TEXTURE_2D; + }; + + /** + * glsFboUtil.TextureCubeMap Class. + * @constructor + * @extends {glsFboUtil.TextureFlat} + */ + glsFboUtil.TextureCubeMap = function() { + glsFboUtil.TextureFlat.call(this); + this.type |= glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP; + this.target = glsFboUtil.Config.s_target.TEXTURE_CUBE_MAP; + }; + + /** + * glsFboUtil.TextureLayered Class. + * @constructor + * @extends {glsFboUtil.Texture} + */ + glsFboUtil.TextureLayered = function() { + glsFboUtil.Texture.call(this); + this.type |= glsFboUtil.Config.s_types.TEXTURE_LAYERED; + this.numLayers = 1; + }; + + /** + * glsFboUtil.Texture3D Class. + * @constructor + * @extends {glsFboUtil.TextureLayered} + */ + glsFboUtil.Texture3D = function() { + glsFboUtil.TextureLayered.call(this); + this.type |= glsFboUtil.Config.s_types.TEXTURE_3D; + this.target = glsFboUtil.Config.s_target.TEXTURE_3D; + }; + + /** + * glsFboUtil.Texture2DArray Class. + * @constructor + * @extends {glsFboUtil.TextureLayered} + */ + glsFboUtil.Texture2DArray = function() { + glsFboUtil.TextureLayered.call(this); + this.type |= glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY; + this.target = glsFboUtil.Config.s_target.TEXTURE_2D_ARRAY; + }; + + /** + * glsFboUtil.Attachment Class. + * @constructor + * @extends {glsFboUtil.Config} + */ + glsFboUtil.Attachment = function() { + glsFboUtil.Config.call(this); + + this.type |= glsFboUtil.Config.s_types.ATTACHMENT; + + /** @type {glsFboUtil.Config.s_target} */ + this.target = glsFboUtil.Config.s_target.FRAMEBUFFER; + + /** @type {WebGLObject} */ + this.imageName = null; + }; + + /** + * this function is declared, but has no definition/is unused in the c++ + * @param {number} attPoint + * @param {number} image + * @param {number} vfr + */ + glsFboUtil.Attachment.prototype.isComplete = function(attPoint, image, vfr) { }; + + /** + * glsFboUtil.RenderBufferAttachments Class. + * @constructor + * @extends {glsFboUtil.Attachment} + */ + glsFboUtil.RenderbufferAttachment = function() { + glsFboUtil.Attachment.call(this); + this.type |= glsFboUtil.Config.s_types.ATT_RENDERBUFFER; + this.renderbufferTarget = glsFboUtil.Config.s_target.RENDERBUFFER; + }; + glsFboUtil.RenderbufferAttachment.prototype = Object.create(glsFboUtil.Attachment.prototype); + glsFboUtil.RenderbufferAttachment.prototype.constructor = glsFboUtil.RenderbufferAttachment; + + /** + * glsFboUtil.TextureAttachment Class. + * @constructor + * @extends {glsFboUtil.Attachment} + */ + glsFboUtil.TextureAttachment = function() { + glsFboUtil.Attachment.call(this); + this.type |= glsFboUtil.Config.s_types.ATT_TEXTURE; + this.level = 0; + }; + glsFboUtil.TextureAttachment.prototype = Object.create(glsFboUtil.Attachment.prototype); + glsFboUtil.TextureAttachment.prototype.constructor = glsFboUtil.TextureAttachment; + + /** + * glsFboUtil.TextureFlatAttachment Class. + * @constructor + * @extends {glsFboUtil.TextureAttachment} + */ + glsFboUtil.TextureFlatAttachment = function() { + glsFboUtil.TextureAttachment.call(this); + this.type |= glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT; + this.texTarget = glsFboUtil.Config.s_target.NONE; + }; + glsFboUtil.TextureFlatAttachment.prototype = Object.create(glsFboUtil.TextureAttachment.prototype); + glsFboUtil.TextureFlatAttachment.prototype.constructor = glsFboUtil.TextureFlatAttachment; + + /** + * glsFboUtil.TextureLayerAttachment Class. + * @constructor + * @extends {glsFboUtil.TextureAttachment} + */ + glsFboUtil.TextureLayerAttachment = function() { + glsFboUtil.TextureAttachment.call(this); + this.type |= glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER; + this.layer = 0; + }; + glsFboUtil.TextureLayerAttachment.prototype = Object.create(glsFboUtil.TextureAttachment.prototype); + glsFboUtil.TextureLayerAttachment.prototype.constructor = glsFboUtil.TextureLayerAttachment; + + // these are a collection of helper functions for creating various gl textures. + glsFboUtil.glsup = function() { + + var glInit = function(cfg, gl) { + if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_2D) != 0) { + glInitFlat(cfg, glTarget(cfg, gl), gl); + + } else if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP) != 0) { + for (var i = gl.TEXTURE_CUBE_MAP_NEGATIVE_X; i <= gl.TEXTURE_CUBE_MAP_POSITIVE_Z; ++i) + glInitFlat(cfg, i, gl); + } else if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_3D) != 0) { + glInitLayered(cfg, 2, gl); + + } else if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY) != 0) { + glInitLayered(cfg, 1, gl); + } + }; + + var glInitFlat = function(cfg, target, gl) { + var format = glsFboUtil.transferImageFormat(cfg.internalFormat, gl); + var w = cfg.width; + var h = cfg.height; + for (var level = 0; level < cfg.numLevels; ++level) { + gl.texImage2D( + target, level, cfg.internalFormat.format, + w, h, 0, format.format, format.dataType, null + ); + w = Math.max(1, w / 2); + h = Math.max(1, h / 2); + } + }; + + var glInitLayered = function(cfg, depth_divider, gl) { + var format = glsFboUtil.transferImageFormat(cfg.internalFormat, gl); + var w = cfg.width; + var h = cfg.height; + var depth = cfg.numLayers; + for (var level = 0; level < cfg.numLevels; ++level) { + gl.texImage3D( + glTarget(cfg, gl), level, cfg.internalFormat.format, + w, h, depth, 0, format.format, format.dataType, null + ); + w = Math.max(1, w / 2); + h = Math.max(1, h / 2); + depth = Math.max(1, depth / depth_divider); + } + }; + + var glCreate = function(cfg, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + if (cfg.type & glsFboUtil.Config.s_types.RENDERBUFFER) { + var ret = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, ret); + + if (cfg.numSamples == 0) { + gl.renderbufferStorage( + gl.RENDERBUFFER, + cfg.internalFormat.format, + cfg.width, cfg.height + ); + } else { + gl.renderbufferStorageMultisample( + gl.RENDERBUFFER, + cfg.numSamples, + cfg.internalFormat.format, + cfg.width, cfg.height + ); + } + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + + } else if (cfg.type & glsFboUtil.Config.s_types.TEXTURE) { + var ret = gl.createTexture(); + gl.bindTexture(glTarget(cfg, gl), ret); + glInit(cfg, gl); + gl.bindTexture(glTarget(cfg, gl), null); + + } else { + throw new Error('Impossible image type'); + } + return ret; + }; + + var glTarget = function(cfg, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + var mask = ( + glsFboUtil.Config.s_types.RENDERBUFFER | + glsFboUtil.Config.s_types.TEXTURE_2D | + glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP | + glsFboUtil.Config.s_types.TEXTURE_3D | + glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY + ); + switch (cfg.type & mask) { + case glsFboUtil.Config.s_types.RENDERBUFFER: return gl.RENDERBUFFER; + case glsFboUtil.Config.s_types.TEXTURE_2D: return gl.TEXTURE_2D; + case glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP: return gl.TEXTURE_CUBE_MAP; + case glsFboUtil.Config.s_types.TEXTURE_3D: return gl.TEXTURE_3D; + case glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY: return gl.TEXTURE_2D_ARRAY; + default: break; + } + throw new Error('Impossible image type.'); + }; + + var glDelete = function(cfg, img, gl) { + if (cfg.type & glsFboUtil.Config.s_types.RENDERBUFFER) + gl.deleteRenderbuffer(img); + else if (cfg.type & glsFboUtil.Config.s_types.TEXTURE) + gl.deleteTexture(img); + else + throw new Error('Impossible image type'); + }; + + return { + create: glCreate, + remove: glDelete + }; + + }(); + + /** *generated by script* + * @param {number} img + * @return {number} + */ + glsFboUtil.imageNumSamples = function(img) { + return (img.numSamples != undefined) ? img.numSamples : 0; + }; + + /** *generated by script* + * @param {glsFboUtil.Attachment} att + * @param {number} attPoint + * @param {WebGLRenderingContextBase=} gl + * @throws {Error} + */ + glsFboUtil.attachAttachment = function(att, attPoint, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + var mask = ( + glsFboUtil.Config.s_types.ATT_RENDERBUFFER | + glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT | + glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER + ); + + switch (att.type & mask) { + case glsFboUtil.Config.s_types.ATT_RENDERBUFFER: + gl.framebufferRenderbuffer( + att.target, attPoint, att.renderbufferTarget, /** @type {WebGLRenderbuffer} */(att.imageName) + ); + break; + case glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT: + gl.framebufferTexture2D( + att.target, attPoint, att.texTarget, /** @type {WebGLTexture} */(att.imageName), att.level + ); + break; + case glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER: + gl.framebufferTextureLayer( + att.target, attPoint, /** @type {WebGLTexture} */(att.imageName), att.level, att.layer + ); + break; + default: + throw new Error('Impossible attachment type'); + } + + }; + + /** *generated by script* + * @param {glsFboUtil.Attachment} att + * @param {WebGLRenderingContextBase=} gl + * @return {number} + * @throws {Error} + */ + glsFboUtil.attachmentType = function(att, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + if (att.type & glsFboUtil.Config.s_types.ATT_RENDERBUFFER) { + return gl.RENDERBUFFER; + } + if (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE) { + return gl.TEXTURE; + } + throw new Error('Impossible attachment type.'); + + }; + + /** + * @param {glsFboUtil.Attachment} att + * @return {number} + * @throws {Error} + */ + glsFboUtil.textureLayer = function(att) { + if (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT) return 0; + if (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER) return att.layer; + throw new Error('Impossible attachment type.'); + }; + + /** + * @param {glsFboUtil.Checker} cctx + * @param {glsFboUtil.Attachment} att + * @param {number} attPoint + * @param {glsFboUtil.Image} image + * @param {glsFboUtil.FormatDB} db + * @param {WebGLRenderingContextBase=} gl + * @throws {Error} + */ + glsFboUtil.checkAttachmentCompleteness = function(cctx, att, attPoint, image, db, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + // GLES2 4.4.5 / GLES3 4.4.4, "glsFboUtil.Framebuffer attachment completeness" + if ( + (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE) && + (image.type & glsFboUtil.Config.s_types.TEXTURE_LAYERED) + ) { + // GLES3: "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is + // TEXTURE and the value of FRAMEBUFFER_ATTACHMENT_OBJECT_NAME names a + // three-dimensional texture, then the value of + // FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER must be smaller than the depth + // of the texture. + // + // GLES3: "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is + // TEXTURE and the value of FRAMEBUFFER_ATTACHMENT_OBJECT_NAME names a + // two-dimensional array texture, then the value of + // FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER must be smaller than the + // number of layers in the texture. + cctx.addFBOStatus( + glsFboUtil.textureLayer(att) < image.numLayers, + gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT + ); + } + + // "The width and height of image are non-zero." + cctx.addFBOStatus( + image.width > 0 && image.height > 0, + gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT + ); + + // Check for renderability + var flags = db.getFormatInfo(image.internalFormat, glsFboUtil.FormatFlags.ANY_FORMAT); + + // If the format does not have the proper renderability flag, the + // completeness check _must_ fail. + cctx.addFBOStatus( + (flags & glsFboUtil.formatFlag(attPoint)) != 0, + gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT + ); + + // If the format is only optionally renderable, the completeness check _can_ fail. + cctx.addPotentialFBOStatus( + (flags & glsFboUtil.FormatFlags.REQUIRED_RENDERABLE) != 0, + gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT + ); + + }; + + // replaces GLS_UNSIZED_FORMATKEY + + /** + * All params and return types for this function are 32 bit + * @param {number} format + * @param {number} type + * @return {number} + */ + glsFboUtil.formatkey = function(format, type) { + // The formatkey value should be 32-bit unsigned int. + return ((type << 16) >>> 0 | format) & 0xFFFFFFFF; + }; + + /** + * @enum + */ + glsFboUtil.FormatFlags = { + ANY_FORMAT: 0x00, + COLOR_RENDERABLE: 0x01, + DEPTH_RENDERABLE: 0x02, + STENCIL_RENDERABLE: 0x04, + RENDERBUFFER_VALID: 0x08, + TEXTURE_VALID: 0x10, + REQUIRED_RENDERABLE: 0x20 //< Without this, renderability is allowed, not required. + }; + + /** + * A framebuffer configuration + * @constructor + * @param {WebGLRenderingContextBase=} gl + */ + glsFboUtil.Framebuffer = function(gl) { + this.m_gl = gl || window.gl; + this.fbid = 0; + + var fbidCompare = function(obj1, obj2) { + return obj1._fbid < obj2._fbid; + }; + + this.attachments = /** @type {glsFboUtil.Map} */( + new glsFboUtil.Map(glsFboUtil.Map.compareNumber) + ); + this.textures = /** @type {glsFboUtil.Map} */( + new glsFboUtil.Map(fbidCompare) + ); + this.rbos = /** @type {glsFboUtil.Map} */( + new glsFboUtil.Map(fbidCompare) + ); + }; + + /** + * @param {number} attPoint + * @param {glsFboUtil.Attachment} att + */ + glsFboUtil.Framebuffer.prototype.attach = function(attPoint, att) { + if (!att) { + this.attachments.remove(attPoint); + } else { + this.attachments.set(attPoint, att); + } + }; + + /** + * @param {WebGLTexture} texName + * @param {glsFboUtil.Texture} texCfg + */ + glsFboUtil.Framebuffer.prototype.setTexture = function(texName, texCfg) { + texName._fbid = this.fbid++; + this.textures.set(texName, texCfg); + }; + + /** + * @param {WebGLRenderbuffer} rbName + * @param {glsFboUtil.Renderbuffer} rbCfg + */ + glsFboUtil.Framebuffer.prototype.setRbo = function(rbName, rbCfg) { + rbName._fbid = this.fbid++; + this.rbos.set(rbName, rbCfg); + }; + + /** + * @param {number} type + * @param {WebGLObject} imgName + * @return {glsFboUtil.Image} + * @throws {Error} + */ + glsFboUtil.Framebuffer.prototype.getImage = function(type, imgName) { + switch (type) { + case this.m_gl.TEXTURE: return this.textures.lookupDefault(/** @type {WebGLTexture} */(imgName), null); + case this.m_gl.RENDERBUFFER: return this.rbos.lookupDefault(/** @type {WebGLTexture} */(imgName), null); + default: break; + } + throw new Error('Bad image type.'); + }; + + /** + * @constructor + * @extends {glsFboUtil.Framebuffer} + * @param {WebGLFramebuffer} fbo + * @param {number} target + * @param {WebGLRenderingContextBase=} gl + */ + glsFboUtil.FboBuilder = function(fbo, target, gl) { + glsFboUtil.Framebuffer.call(this, gl); + + this.m_gl = gl || window.gl; + this.m_target = target; + this.m_configs = []; + this.m_error = this.m_gl.NO_ERROR; + + this.m_gl.bindFramebuffer(this.m_target, fbo); + + }; + + glsFboUtil.FboBuilder.prototype = Object.create(glsFboUtil.Framebuffer.prototype); + glsFboUtil.FboBuilder.prototype.constructor = glsFboUtil.FboBuilder; + + glsFboUtil.FboBuilder.prototype.deinit = function() { + + var pair; + for (var i = 0; i < this.textures.length; ++i) { + pair = this.textures.getIndex(i); + glsFboUtil.glsup.remove(pair.second, pair.first, this.m_gl); + } + this.textures.clear(); + + for (var i = 0; i < this.rbos.length; ++i) { + pair = this.rbos.getIndex(i); + glsFboUtil.glsup.remove(pair.second, pair.first, this.m_gl); + } + this.rbos.clear(); + + this.m_gl.bindFramebuffer(this.m_target, null); +/* + for (var i = 0 ; i < this.m_configs.length ; ++i) { + delete this.m_configs[i]; + } +//*/ + }; + + /** + * @param {number} attPoint + * @param {glsFboUtil.Attachment} att + */ + glsFboUtil.FboBuilder.prototype.glAttach = function(attPoint, att) { + if (!att) { + this.m_gl.framebufferRenderbuffer(this.m_target, attPoint, this.m_gl.RENDERBUFFER, null); + } else { + glsFboUtil.attachAttachment(att, attPoint, this.m_gl); + } + this.checkError(); + this.attach(attPoint, att); + }; + + /** + * @param {glsFboUtil.Texture} texCfg + * @return {WebGLTexture} + */ + glsFboUtil.FboBuilder.prototype.glCreateTexture = function(texCfg) { + var texName = glsFboUtil.glsup.create(texCfg, this.m_gl); + this.checkError(); + this.setTexture(texName, texCfg); + return texName; + }; + + /** *generated by script* + * @param {glsFboUtil.Renderbuffer} rbCfg + * @return {WebGLRenderbuffer} + */ + glsFboUtil.FboBuilder.prototype.glCreateRbo = function(rbCfg) { + var rbName = glsFboUtil.glsup.create(rbCfg, this.m_gl); + this.checkError(); + this.setRbo(rbName, rbCfg); + return rbName; + }; + + /** + * @param {function(new:glsFboUtil.Config)} Definition + * @return {glsFboUtil.Config} + */ + glsFboUtil.FboBuilder.prototype.makeConfig = function(Definition) { + var cfg = new Definition(); + this.m_configs.push(cfg); + return cfg; + }; + + /** + */ + glsFboUtil.FboBuilder.prototype.checkError = function() { + var error = this.m_gl.getError(); + if (error != this.m_gl.NO_ERROR && this.m_error == this.m_gl.NO_ERROR) { + this.m_error = error; + } + }; + + /** *generated by script* + * @return {number} + */ + glsFboUtil.FboBuilder.prototype.getError = function() { + return this.m_error; + }; + + glsFboUtil.isFramebufferStatus = function(fboStatus) { + return gluStrUtil.getFramebufferStatusName(fboStatus) != ''; + } + + glsFboUtil.isErrorCode = function(errorCode) { + return gluStrUtil.getErrorName(errorCode) != ''; + } + + /** + * @typedef {funcion(): glsFboUtil.ValidStatusCodes} + */ + glsFboUtil.ValidStatusCodes = function() { + this.m_errorCodes = []; + this.m_errorStatusCodes = []; + this.m_allowComplete = false; + }; + + glsFboUtil.ValidStatusCodes.prototype.isFBOStatusValid = function(fboStatus) { + if (fboStatus == gl.FRAMEBUFFER_COMPLETE) + return this.m_allowComplete; + else { + for(var ndx = 0; ndx < this.m_errorStatusCodes.length; ++ndx) { + if (this.m_errorStatusCodes[ndx] == fboStatus) + return true; + } + return false; + } + }; + + glsFboUtil.ValidStatusCodes.prototype.isFBOStatusRequired = function(fboStatus) { + if (fboStatus == gl.FRAMEBUFFER_COMPLETE) + return this.m_allowComplete && this.m_errorStatusCodes.length == 0; + else + // fboStatus is the only allowed error status and succeeding is forbidden + return !this.m_allowComplete && this.m_errorStatusCodes.length == 1 && this.m_errorStatusCodes[0] == fboStatus; + }; + + glsFboUtil.ValidStatusCodes.prototype.isErrorCodeValid = function(errorCode) { + if (errorCode == gl.NO_ERROR) + return this.m_errorCodes.length == 0; + else { + // rule violation exists? + for (var ndx = 0; ndx < this.m_errorCodes.length; ++ndx) { + if (this.m_errorCodes[ndx] == errorCode) + return true; + } + return false; + } + }; + + glsFboUtil.ValidStatusCodes.prototype.isErrorCodeRequired = function(errorCode) { + if (this.m_errorCodes.length == 0 && errorCode == gl.NO_ERROR) + return true; + else + // only this error code listed + return this.m_errorCodes.length == 1 && merrorCodes[0] == errorCode; + }; + + glsFboUtil.ValidStatusCodes.prototype.addErrorCode = function(error) { + DE_ASSERT(glsFboUtil.isErrorCode(error)); + DE_ASSERT(error != gl.NO_ERROR) + this.m_errorCodes.push(error); + }; + + glsFboUtil.ValidStatusCodes.prototype.addFBOErrorStatus = function(status) { + DE_ASSERT(glsFboUtil.isFramebufferStatus(status)); + DE_ASSERT(status != gl.FRAMEBUFFER_COMPLETE) + this.m_errorStatusCodes.push(status); + }; + + glsFboUtil.ValidStatusCodes.prototype.setAllowComplete = function(b) { + this.m_allowComplete = b; + }; + + /** + * @typedef {function(): glsFboUtil.Checker} + */ + glsFboUtil.CheckerFactory; + + /** + * @constructor + * @param {WebGLRenderingContextBase=} gl + * @throws {Error} + */ + glsFboUtil.Checker = function(gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + this.m_statusCodes = new glsFboUtil.ValidStatusCodes(); + this.m_statusCodes.setAllowComplete(true); + + if (typeof(this.check) != 'function') + throw new Error('Constructor called on virtual class: glsFboUtil.Checker'); + }; + + /** + * @param {boolean} condition + * @param {number} error + */ + glsFboUtil.Checker.prototype.addGLError = function(condition, error) { + if (!condition) { + this.m_statusCodes.addErrorCode(error); + this.m_statusCodes.setAllowComplete(false); + } + }; + + /** + * @param {boolean} condition + * @param {number} error + */ + glsFboUtil.Checker.prototype.addPotentialGLError = function(condition, error) { + if (!condition) { + this.m_statusCodes.addErrorCode(error); + } + }; + + /** + * @param {boolean} condition + * @param {number} status + */ + glsFboUtil.Checker.prototype.addFBOStatus = function(condition, status) { + if (!condition) { + this.m_statusCodes.addFBOErrorStatus(status); + this.m_statusCodes.setAllowComplete(false); + } + }; + + /** + * @param {boolean} condition + * @param {number} status + */ + glsFboUtil.Checker.prototype.addPotentialFBOStatus = function(condition, status) { + if (!condition) { + this.m_statusCodes.addFBOErrorStatus(status); + } + }; + + /** + * @return {Array} + */ + glsFboUtil.Checker.prototype.getStatusCodes = function () { + return this.m_statusCodes; + }; + + /** + * @param {glsFboUtil.ImageFormat} imgFormat + * @param {WebGLRenderingContextBase=} gl + * @return {gluTextureUtil.TransferFormat} + * @throws {Error} + */ + glsFboUtil.transferImageFormat = function(imgFormat, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + if (imgFormat.unsizedType == gl.NONE) + return gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(imgFormat.format)); + else + return new gluTextureUtil.TransferFormat(imgFormat.format, imgFormat.unsizedType); + }; + + // FormatDB, CheckerFactory + + /** + * @constructor + * @param {glsFboUtil.FormatDB} formats + * @param {glsFboUtil.CheckerFactory} factory + */ + glsFboUtil.FboVerifier = function(formats, factory) { + this.m_formats = formats; + this.m_factory = factory; + }; + // config::Framebuffer + glsFboUtil.FboVerifier.prototype.validStatusCodes = function(cfg, gl) { + if (!(gl = gl || window.gl)) throw new Error('Invalid gl object'); + + /** @type {glsFboUtil.Checker} */ + var cctx = this.m_factory(); + + for (var id = 0; id < cfg.textures.length; ++id) { + var flags = this.m_formats.getFormatInfo(cfg.textures.getIndex(id).second.internalFormat, glsFboUtil.FormatFlags.ANY_FORMAT); + var textureIsValid = (flags & glsFboUtil.FormatFlags.TEXTURE_VALID) != 0; + cctx.addGLError(textureIsValid, gl.INVALID_ENUM); + cctx.addGLError(textureIsValid, gl.INVALID_OPERATION); + cctx.addGLError(textureIsValid, gl.INVALID_VALUE); + } + + for (var id = 0; id < cfg.rbos.length; ++id) { + var flags = this.m_formats.getFormatInfo(cfg.rbos.getIndex(id).second.internalFormat, glsFboUtil.FormatFlags.ANY_FORMAT); + var rboIsValid = (flags & glsFboUtil.FormatFlags.RENDERBUFFER_VALID) != 0; + cctx.addGLError(rboIsValid, gl.INVALID_ENUM); + } + + var count = 0; + for (var index = 0; index < cfg.attachments.length; ++index) { + var attPoint = cfg.attachments.getIndex(index).first; + var att = cfg.attachments.getIndex(index).second; + /** @type {glsFboUtil.Image}*/ + var image = cfg.getImage(glsFboUtil.attachmentType(att, gl), att.imageName); + glsFboUtil.checkAttachmentCompleteness(cctx, att, attPoint, image, this.m_formats, gl); + cctx.check(attPoint, att, image); + ++count; + } + + // "There is at least one image attached to the framebuffer." + // TODO: support XXX_framebuffer_no_attachments + cctx.addFBOStatus(count > 0, gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT); + + return cctx.getStatusCodes(); + + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js new file mode 100644 index 000000000..427a3a4fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js @@ -0,0 +1,1118 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +'use strict'; +goog.provide('modules.shared.glsLifetimeTests'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuStringTemplate'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('modules.shared.glsTextureTestUtil'); + +goog.scope(function() { +var glsLifetimeTests = modules.shared.glsLifetimeTests; +var tcuStringTemplate = framework.common.tcuStringTemplate; +var tcuSurface = framework.common.tcuSurface; +var deRandom = framework.delibs.debase.deRandom; +var glsTextureTestUtil = modules.shared.glsTextureTestUtil; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuTestCase = framework.common.tcuTestCase; +var tcuImageCompare = framework.common.tcuImageCompare; + +/** @const */ var VIEWPORT_SIZE = 128; +/** @const */ var FRAMEBUFFER_SIZE = 128; + +var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; +}; + +/** @const */ var s_vertexShaderSrc = + '#version 100\n' + + 'attribute vec2 pos;\n' + + 'void main()\n' + + '{\n' + + ' gl_Position = vec4(pos.xy, 0.0, 1.0);\n' + + '}\n'; + +/** @const */ var s_fragmentShaderSrc = + '#version 100\n' + + 'void main()\n' + + '{\n' + + ' gl_FragColor = vec4(1.0);\n' + + '}\n'; + +/** + * @constructor + * @extends {gluShaderProgram.Shader} + * @param {gluShaderProgram.shaderType} type + * @param {string} src + */ +glsLifetimeTests.CheckedShader = function(type, src) { + gluShaderProgram.Shader.call(this, gl, type); + this.setSources(src); + this.compile(); + assertMsgOptions(this.getCompileStatus() === true, 'Failed to compile shader', false, true); +}; + +setParentClass(glsLifetimeTests.CheckedShader, gluShaderProgram.Shader); + +/** + * @constructor + * @extends {gluShaderProgram.Program} + * @param {WebGLShader} vtxShader + * @param {WebGLShader} fragShader + */ +glsLifetimeTests.CheckedProgram = function(vtxShader, fragShader) { + gluShaderProgram.Program.call(this, gl); + this.attachShader(vtxShader); + this.attachShader(fragShader); + this.link(); + assertMsgOptions(this.info.linkOk === true, 'Failed to link program', false, true); +}; + +setParentClass(glsLifetimeTests.CheckedProgram, gluShaderProgram.Program); + +/** + * @constructor + */ +glsLifetimeTests.Binder = function() { +}; + +/** + * @param {WebGLObject} obj + */ +glsLifetimeTests.Binder.prototype.bind = function(obj) { throw new Error('Virtual function'); }; + +/** + * @return {WebGLObject} + */ +glsLifetimeTests.Binder.prototype.getBinding = function() { throw new Error('Virtual function'); }; + +/** + * @constructor + * @extends {glsLifetimeTests.Binder} + * @param {?function(number, ?)} bindFunc + * @param {number} bindTarget + * @param {number} bindingParam + */ +glsLifetimeTests.SimpleBinder = function(bindFunc, bindTarget, bindingParam) { + glsLifetimeTests.Binder.call(this); + this.m_bindFunc = bindFunc; + this.m_bindTarget = bindTarget; + this.m_bindingParam = bindingParam; +}; + +setParentClass(glsLifetimeTests.SimpleBinder, glsLifetimeTests.Binder); + +glsLifetimeTests.SimpleBinder.prototype.bind = function(obj) { + this.m_bindFunc.call(gl, this.m_bindTarget, obj); +}; + +glsLifetimeTests.SimpleBinder.prototype.getBinding = function() { + return /** @type {WebGLObject} */ (gl.getParameter(this.m_bindingParam)); +}; + +/** + * @constructor + */ +glsLifetimeTests.Type = function() { +}; + +/** + * Create a type + * @return {WebGLObject} + */ +glsLifetimeTests.Type.prototype.gen = function() { throw new Error('Virtual function'); }; + +/** + * Destroy a type + * @param {WebGLObject} obj + */ +glsLifetimeTests.Type.prototype.release = function(obj) { throw new Error('Virtual function'); }; + +/** + * Is object valid + * @param {WebGLObject} obj + */ +glsLifetimeTests.Type.prototype.exists = function(obj) { throw new Error('Virtual function'); }; + +/** + * Is object flagged for deletion + * @param {WebGLObject} obj + */ +glsLifetimeTests.Type.prototype.isDeleteFlagged = function(obj) { return false; }; + +/** + * @return {glsLifetimeTests.Binder} + */ +glsLifetimeTests.Type.prototype.binder = function() { return null; }; + +/** + * @return {string} + */ +glsLifetimeTests.Type.prototype.getName = function() { throw new Error('Virtual function'); }; + +/** + * Is the object unbound automatically when it is deleted? + * @return {boolean} + */ +glsLifetimeTests.Type.prototype.nameLingers = function() { return false; }; + +/** + * Does 'create' creates the object fully? + * If not, the object is created at bound time + * @return {boolean} + */ +glsLifetimeTests.Type.prototype.genCreates = function() { return false; }; + +/** + * @constructor + * @extends {glsLifetimeTests.Type} + * @param {string} name + * @param {function(): WebGLObject} genFunc + * @param {function(?)} deleteFunc + * @param {function(?): boolean} existsFunc + * @param {glsLifetimeTests.Binder} binder + * @param {boolean=} genCreates + */ +glsLifetimeTests.SimpleType = function(name, genFunc, deleteFunc, existsFunc, binder, genCreates) { + glsLifetimeTests.Type.call(this); + this.m_getName = name; + this.m_genFunc = genFunc; + this.m_deleteFunc = deleteFunc; + this.m_existsFunc = existsFunc; + this.m_binder = binder; + this.m_genCreates = genCreates || false; +}; + +setParentClass(glsLifetimeTests.SimpleType, glsLifetimeTests.Type); + +glsLifetimeTests.SimpleType.prototype.gen = function() { return this.m_genFunc.call(gl); }; + +glsLifetimeTests.SimpleType.prototype.release = function(obj) { return this.m_deleteFunc.call(gl, obj); }; + +glsLifetimeTests.SimpleType.prototype.exists = function(obj) { return this.m_existsFunc.call(gl, obj); }; + +glsLifetimeTests.SimpleType.prototype.binder = function() { return this.m_binder; }; + +glsLifetimeTests.SimpleType.prototype.getName = function() { return this.m_getName; }; + +glsLifetimeTests.SimpleType.prototype.genCreates = function() { return this.m_genCreates; }; + +/** + * @constructor + * @extends {glsLifetimeTests.Type} + */ +glsLifetimeTests.ProgramType = function() { + glsLifetimeTests.Type.call(this); +}; + +setParentClass(glsLifetimeTests.ProgramType, glsLifetimeTests.Type); + +glsLifetimeTests.ProgramType.prototype.gen = function() { return gl.createProgram(); }; + +glsLifetimeTests.ProgramType.prototype.release = function(obj) { return gl.deleteProgram(/** @type {WebGLProgram} */ (obj)); }; + +glsLifetimeTests.ProgramType.prototype.exists = function(obj) { return gl.isProgram(/** @type {WebGLProgram} */ (obj)); }; + +glsLifetimeTests.ProgramType.prototype.getName = function() { return 'program'; }; + +glsLifetimeTests.ProgramType.prototype.genCreates = function() { return true; }; + +glsLifetimeTests.ProgramType.prototype.nameLingers = function() { return true; }; + +glsLifetimeTests.ProgramType.prototype.isDeleteFlagged = function(obj) { return gl.getProgramParameter(/** @type {WebGLProgram} */ (obj), gl.DELETE_STATUS); }; + +/** + * @constructor + * @extends {glsLifetimeTests.Type} + */ +glsLifetimeTests.ShaderType = function() { + glsLifetimeTests.Type.call(this); +}; + +setParentClass(glsLifetimeTests.ShaderType, glsLifetimeTests.Type); + +glsLifetimeTests.ShaderType.prototype.gen = function() { return gl.createShader(gl.FRAGMENT_SHADER); }; + +glsLifetimeTests.ShaderType.prototype.release = function(obj) { return gl.deleteShader(/** @type {WebGLShader} */ (obj)); }; + +glsLifetimeTests.ShaderType.prototype.exists = function(obj) { return gl.isShader(/** @type {WebGLShader} */ (obj)); }; + +glsLifetimeTests.ShaderType.prototype.getName = function() { return 'shader'; }; + +glsLifetimeTests.ShaderType.prototype.genCreates = function() { return true; }; + +glsLifetimeTests.ShaderType.prototype.nameLingers = function() { return true; }; + +glsLifetimeTests.ShaderType.prototype.isDeleteFlagged = function(obj) { return gl.getShaderParameter(/** @type {WebGLShader} */ (obj), gl.DELETE_STATUS); }; + +/** + * @constructor + * @param {glsLifetimeTests.Type} elementType + * @param {glsLifetimeTests.Type} containerType + */ +glsLifetimeTests.Attacher = function(elementType, containerType) { + this.m_elementType = elementType; + this.m_containerType = containerType; +}; + +/** + * @param {number} seed + * @param {WebGLObject} obj + */ +glsLifetimeTests.Attacher.prototype.initAttachment = function(seed, obj) { throw new Error('Virtual function'); }; + +/** + * @param {WebGLObject} element + * @param {WebGLObject} target + */ +glsLifetimeTests.Attacher.prototype.attach = function(element, target) { throw new Error('Virtual function'); }; + +/** + * @param {WebGLObject} element + * @param {WebGLObject} target + */ +glsLifetimeTests.Attacher.prototype.detach = function(element, target) { throw new Error('Virtual function'); }; +glsLifetimeTests.Attacher.prototype.canAttachDeleted = function() { return true; }; + +/** + * @return {glsLifetimeTests.Type} + */ +glsLifetimeTests.Attacher.prototype.getElementType = function() { return this.m_elementType; }; + +/** + * @return {glsLifetimeTests.Type} + */ +glsLifetimeTests.Attacher.prototype.getContainerType = function() { return this.m_containerType; }; + +/** + * @constructor + */ +glsLifetimeTests.InputAttacher = function(attacher) { + this.m_attacher = attacher; +}; + +glsLifetimeTests.InputAttacher.prototype.getAttacher = function() { return this.m_attacher; }; + +/** + * @param {WebGLObject} container + * @param {tcuSurface.Surface} dst + */ +glsLifetimeTests.InputAttacher.prototype.drawContainer = function(container, dst) { throw new Error('Virtual function'); }; + +/** + * @constructor + */ +glsLifetimeTests.OutputAttacher = function(attacher) { + this.m_attacher = attacher; +}; + +glsLifetimeTests.OutputAttacher.prototype.getAttacher = function() { return this.m_attacher; }; + +/** + * @param {number} seed + * @param {WebGLObject} container + */ +glsLifetimeTests.OutputAttacher.prototype.setupContainer = function(seed, container) { throw new Error('Virtual function'); }; + +/** + * @param {WebGLObject} attachment + * @param {tcuSurface.Surface} dst + */ +glsLifetimeTests.OutputAttacher.prototype.drawAttachment = function(attachment, dst) { throw new Error('Virtual function'); }; + +/** + * @constructor + */ +glsLifetimeTests.Types = function() { + /** @type {Array} */ this.m_types = []; + /** @type {Array} */ this.m_attachers = []; + /** @type {Array} */ this.m_inAttachers = []; + /** @type {Array} */ this.m_outAttachers = []; +}; + +/** + * @return {glsLifetimeTests.ProgramType} + */ +glsLifetimeTests.Types.prototype.getProgramType = function() { throw new Error('Virtual function'); }; + +glsLifetimeTests.Types.prototype.getTypes = function() { return this.m_types; }; + +glsLifetimeTests.Types.prototype.getAttachers = function() { return this.m_attachers; }; + +glsLifetimeTests.Types.prototype.getInputAttachers = function() { return this.m_inAttachers; }; + +glsLifetimeTests.Types.prototype.getOutputAttachers = function() { return this.m_outAttachers; }; + +/** + * @param {number} seed + * @param {WebGLFramebuffer} fbo + */ +glsLifetimeTests.setupFbo = function(seed, fbo) { + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + if (seed == 0) { + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + } else { + var rnd = new deRandom.Random(seed); + var width = rnd.getInt(0, FRAMEBUFFER_SIZE); + var height = rnd.getInt(0, FRAMEBUFFER_SIZE); + var x = rnd.getInt(0, FRAMEBUFFER_SIZE - width); + var y = rnd.getInt(0, FRAMEBUFFER_SIZE - height); + var r1 = rnd.getFloat(); + var g1 = rnd.getFloat(); + var b1 = rnd.getFloat(); + var a1 = rnd.getFloat(); + var r2 = rnd.getFloat(); + var g2 = rnd.getFloat(); + var b2 = rnd.getFloat(); + var a2 = rnd.getFloat(); + + gl.clearColor(r1, g1, b1, a1); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.scissor(x, y, width, height); + gl.enable(gl.SCISSOR_TEST); + gl.clearColor(r2, g2, b2, a2); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.disable(gl.SCISSOR_TEST); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); +}; + +/** + * @param {{x: number, y:number, width: number, height: number}} rect + * @param {tcuSurface.Surface} dst + */ +glsLifetimeTests.readRectangle = function(rect, dst) { + dst.readViewport(gl, rect); +}; + +/** + * @param {WebGLFramebuffer} fbo + * @param {tcuSurface.Surface} dst + */ +glsLifetimeTests.drawFbo = function(fbo, dst) { + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + dst.readViewport(gl, [0, 0, FRAMEBUFFER_SIZE, FRAMEBUFFER_SIZE]); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.Attacher} + */ +glsLifetimeTests.FboAttacher = function(elementType, containerType) { + glsLifetimeTests.Attacher.call(this, elementType, containerType); +}; + +setParentClass(glsLifetimeTests.FboAttacher, glsLifetimeTests.Attacher); + +glsLifetimeTests.FboAttacher.prototype.initStorage = function() { throw new Error('Virtual function'); }; + +glsLifetimeTests.FboAttacher.prototype.initAttachment = function(seed, element) { + var binder = this.getElementType().binder(); + var fbo = gl.createFramebuffer(); + + binder.bind(element); + this.initStorage(); + binder.bind(null); + + this.attach(element, fbo); + glsLifetimeTests.setupFbo(seed, fbo); + this.detach(element, fbo); + + gl.deleteFramebuffer(fbo); + + bufferedLogToConsole('Drew to ' + this.getElementType().getName() + ' ' + element + ' with seed ' + seed + '.'); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.InputAttacher} + */ +glsLifetimeTests.FboInputAttacher = function(attacher) { + glsLifetimeTests.InputAttacher.call(this, attacher); +}; + +setParentClass(glsLifetimeTests.FboInputAttacher, glsLifetimeTests.InputAttacher); + +glsLifetimeTests.FboInputAttacher.prototype.drawContainer = function(obj, dst) { + var fbo = /** @type {WebGLFramebuffer} */ (obj); + glsLifetimeTests.drawFbo(fbo, dst); + bufferedLogToConsole('Read pixels from framebuffer ' + fbo + ' to output image.'); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.OutputAttacher} + */ +glsLifetimeTests.FboOutputAttacher = function(attacher) { + glsLifetimeTests.OutputAttacher.call(this, attacher); +}; + +setParentClass(glsLifetimeTests.FboOutputAttacher, glsLifetimeTests.OutputAttacher); + +glsLifetimeTests.FboOutputAttacher.prototype.setupContainer = function(seed, fbo) { + glsLifetimeTests.setupFbo(seed, /** @type {WebGLFramebuffer} */ (fbo)); + bufferedLogToConsole('Drew to framebuffer ' + fbo + ' with seed ' + seed + '.'); +}; + +glsLifetimeTests.FboOutputAttacher.prototype.drawAttachment = function(element, dst) { + var fbo = gl.createFramebuffer(); + this.m_attacher.attach(element, fbo); + glsLifetimeTests.drawFbo(fbo, dst); + this.m_attacher.detach(element, fbo); + gl.deleteFramebuffer(fbo); + bufferedLogToConsole('Read pixels from ' + this.m_attacher.getElementType().getName() + ' ' + element + ' to output image.'); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.FboAttacher} + */ +glsLifetimeTests.TextureFboAttacher = function(elementType, containerType) { + glsLifetimeTests.FboAttacher.call(this, elementType, containerType); +}; + +setParentClass(glsLifetimeTests.TextureFboAttacher, glsLifetimeTests.FboAttacher); + +glsLifetimeTests.TextureFboAttacher.prototype.initStorage = function() { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, FRAMEBUFFER_SIZE, FRAMEBUFFER_SIZE, 0, + gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, null); + +}; + +glsLifetimeTests.TextureFboAttacher.prototype.attach = function(element, target) { + var texture = /** @type {WebGLTexture} */ (element); + var fbo = /** @type {WebGLFramebuffer} */ (target); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, texture, 0); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); +}; + +glsLifetimeTests.TextureFboAttacher.prototype.detach = function(texture, target) { + var fbo = /** @type {WebGLFramebuffer} */ (target); + this.attach(null, fbo); +}; + +glsLifetimeTests.getFboAttachment = function(fbo, requiredType) { + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + var type = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); + var name = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, + gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + var ret = type == requiredType ? name : null; + return ret; +}; + +glsLifetimeTests.TextureFboAttacher.prototype.getAttachment = function(fbo) { + return glsLifetimeTests.getFboAttachment(fbo, gl.TEXTURE); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.FboAttacher} + */ +glsLifetimeTests.RboFboAttacher = function(elementType, containerType) { + glsLifetimeTests.FboAttacher.call(this, elementType, containerType); +}; + +setParentClass(glsLifetimeTests.RboFboAttacher, glsLifetimeTests.FboAttacher); + +glsLifetimeTests.RboFboAttacher.prototype.initStorage = function() { + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, FRAMEBUFFER_SIZE, FRAMEBUFFER_SIZE); + +}; + +glsLifetimeTests.RboFboAttacher.prototype.attach = function(element, target) { + var rbo = /** @type {WebGLRenderbuffer} */ (element); + var fbo = /** @type {WebGLFramebuffer} */ (target); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); +}; + +glsLifetimeTests.RboFboAttacher.prototype.detach = function(rbo, target) { + var fbo = /** @type {WebGLFramebuffer} */ (target); + this.attach(null, fbo); +}; + +glsLifetimeTests.RboFboAttacher.prototype.getAttachment = function(fbo) { + return glsLifetimeTests.getFboAttachment(fbo, gl.RENDERBUFFER); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.Attacher} + */ +glsLifetimeTests.ShaderProgramAttacher = function(elementType, containerType) { + glsLifetimeTests.Attacher.call(this, elementType, containerType); +}; + +setParentClass(glsLifetimeTests.ShaderProgramAttacher, glsLifetimeTests.Attacher); + +glsLifetimeTests.ShaderProgramAttacher.prototype.initAttachment = function(seed, obj) { + var shader = /** @type {WebGLShader} */ (obj); + var s_fragmentShaderTemplate = + '#version 100\n' + + 'void main()\n' + + '{\n' + + ' gl_FragColor = vec4(${RED}, ${GREEN}, ${BLUE}, 1.0);\n' + + '}'; + + var rnd = new deRandom.Random(seed); + var params = []; + params['RED'] = rnd.getFloat().toString(10); + params['GREEN'] = rnd.getFloat().toString(10); + params['BLUE'] = rnd.getFloat().toString(10); + + var source = tcuStringTemplate.specialize(s_fragmentShaderTemplate, params); + gl.shaderSource(shader, source); + gl.compileShader(shader); + var compileStatus = gl.getShaderParameter(shader, gl.COMPILE_STATUS); + assertMsgOptions(compileStatus === true, 'Failed to compile shader: ' + source, false, true); +}; + +glsLifetimeTests.ShaderProgramAttacher.prototype.attach = function(element, target) { + var shader = /** @type {WebGLShader} */ (element); + var program = /** @type {WebGLProgram} */ (target); + gl.attachShader(program, shader); +}; + +glsLifetimeTests.ShaderProgramAttacher.prototype.detach = function(element, target) { + var shader = /** @type {WebGLShader} */ (element); + var program = /** @type {WebGLProgram} */ (target); + gl.detachShader(program, shader); +}; + +glsLifetimeTests.ShaderProgramAttacher.prototype.getAttachment = function(program) { + var shaders = gl.getAttachedShaders(program); + for (var i = 0; i < shaders.length; i++) { + var shader = shaders[i]; + var type = gl.getShaderParameter(shader, gl.SHADER_TYPE); + if (type === gl.FRAGMENT_SHADER) + return shader; + } + return null; +}; + +/** + * @constructor + * @extends {glsLifetimeTests.InputAttacher} + */ +glsLifetimeTests.ShaderProgramInputAttacher = function(attacher) { + glsLifetimeTests.InputAttacher.call(this, attacher); +}; + +setParentClass(glsLifetimeTests.ShaderProgramInputAttacher, glsLifetimeTests.InputAttacher); + +glsLifetimeTests.ShaderProgramInputAttacher.prototype.drawContainer = function(container, dst) { + var program = /** @type {WebGLProgram} */ (container); + var s_vertices = [-1.0, 0.0, 1.0, 1.0, 0.0, -1.0]; + glsLifetimeTests.ShaderProgramInputAttacher.seed = glsLifetimeTests.ShaderProgramInputAttacher.seed || 0; + var vtxShader = new glsLifetimeTests.CheckedShader(gluShaderProgram.shaderType.VERTEX, s_vertexShaderSrc); + var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_SIZE, VIEWPORT_SIZE, glsLifetimeTests.ShaderProgramInputAttacher.seed); + + gl.attachShader(program, vtxShader.getShader()); + gl.linkProgram(program); + + var linkStatus = gl.getProgramParameter(program, gl.LINK_STATUS); + assertMsgOptions(linkStatus === true, 'Program link failed', false, true); + + bufferedLogToConsole('Attached a temporary vertex shader and linked program ' + program); + + gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); + + bufferedLogToConsole('Positioned viewport randomly'); + + gl.useProgram(program); + + var posLoc = gl.getAttribLocation(program, 'pos'); + assertMsgOptions(posLoc >= 0, 'Could not find pos attribute', false, true); + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(s_vertices), gl.STATIC_DRAW); + gl.enableVertexAttribArray(posLoc); + gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 0, 0); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + + gl.clearColor(0, 0, 0, 1); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + gl.drawArrays(gl.TRIANGLES, 0, 3); + + gl.disableVertexAttribArray(posLoc); + gl.deleteBuffer(buf); + bufferedLogToConsole('Drew a fixed triangle'); + + gl.useProgram(null); + + glsLifetimeTests.readRectangle(viewport, dst); + bufferedLogToConsole('Copied viewport to output image'); + + gl.detachShader(program, vtxShader.getShader()); + bufferedLogToConsole('Removed temporary vertex shader'); +}; + +/** + * @constructor + * @extends {glsLifetimeTests.Types} + */ +glsLifetimeTests.ES2Types = function() { + glsLifetimeTests.Types.call(this); + this.m_bufferBind = new glsLifetimeTests.SimpleBinder(gl.bindBuffer, gl.ARRAY_BUFFER, gl.ARRAY_BUFFER_BINDING); + this.m_bufferType = new glsLifetimeTests.SimpleType('buffer', gl.createBuffer, gl.deleteBuffer, gl.isBuffer, this.m_bufferBind); + this.m_textureBind = new glsLifetimeTests.SimpleBinder(gl.bindTexture, gl.TEXTURE_2D, gl.TEXTURE_BINDING_2D); + this.m_textureType = new glsLifetimeTests.SimpleType('texture', gl.createTexture, gl.deleteTexture, gl.isTexture, this.m_textureBind); + this.m_rboBind = new glsLifetimeTests.SimpleBinder(gl.bindRenderbuffer, gl.RENDERBUFFER, gl.RENDERBUFFER_BINDING); + this.m_rboType = new glsLifetimeTests.SimpleType('renderbuffer', gl.createRenderbuffer, gl.deleteRenderbuffer, gl.isRenderbuffer, this.m_rboBind); + this.m_fboBind = new glsLifetimeTests.SimpleBinder(gl.bindFramebuffer, gl.FRAMEBUFFER, gl.FRAMEBUFFER_BINDING); + this.m_fboType = new glsLifetimeTests.SimpleType('framebuffer', gl.createFramebuffer, gl.deleteFramebuffer, gl.isFramebuffer, this.m_fboBind); + this.m_shaderType = new glsLifetimeTests.ShaderType(); + this.m_programType = new glsLifetimeTests.ProgramType(); + this.m_texFboAtt = new glsLifetimeTests.TextureFboAttacher(this.m_textureType, this.m_fboType); + this.m_texFboInAtt = new glsLifetimeTests.FboInputAttacher(this.m_texFboAtt); + this.m_texFboOutAtt = new glsLifetimeTests.FboOutputAttacher(this.m_texFboAtt); + this.m_rboFboAtt = new glsLifetimeTests.RboFboAttacher(this.m_rboType, this.m_fboType); + this.m_rboFboInAtt = new glsLifetimeTests.FboInputAttacher(this.m_rboFboAtt); + this.m_rboFboOutAtt = new glsLifetimeTests.FboOutputAttacher(this.m_rboFboAtt); + this.m_shaderAtt = new glsLifetimeTests.ShaderProgramAttacher(this.m_shaderType, this.m_programType); + this.m_shaderInAtt = new glsLifetimeTests.ShaderProgramInputAttacher(this.m_shaderAtt); + + this.m_types.push(this.m_bufferType, this.m_textureType, this.m_rboType, this.m_fboType, this.m_shaderType, this.m_programType); + this.m_attachers.push(this.m_texFboAtt, this.m_rboFboAtt, this.m_shaderAtt); + this.m_inAttachers.push(this.m_texFboInAtt, this.m_rboFboInAtt, this.m_shaderInAtt); + this.m_outAttachers.push(this.m_texFboOutAtt, this.m_rboFboOutAtt); +}; + +setParentClass(glsLifetimeTests.ES2Types, glsLifetimeTests.Types); + +glsLifetimeTests.ES2Types.prototype.getProgramType = function() { return this.m_programType; }; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {glsLifetimeTests.Type} type + * @param {function()} test + */ +glsLifetimeTests.LifeTest = function(name, description, type, test) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_type = type; + this.m_test = test; +}; + +setParentClass(glsLifetimeTests.LifeTest, tcuTestCase.DeqpTest); + +glsLifetimeTests.LifeTest.prototype.iterate = function() { + this.m_test(); + return tcuTestCase.IterateResult.STOP; +}; + +/** + * @this {glsLifetimeTests.LifeTest} + */ +glsLifetimeTests.LifeTest.testGen = function() { + var obj = this.m_type.gen(); + if (this.m_type.genCreates()) + assertMsgOptions(this.m_type.exists(obj), "create* should have created an object, but didn't", false, true); + else + assertMsgOptions(!this.m_type.exists(obj), 'create* should not have created an object, but did', false, true); + this.m_type.release(obj); + testPassed(); +}; + +/** + * @this {glsLifetimeTests.LifeTest} + */ +glsLifetimeTests.LifeTest.testDelete = function() { + var obj = this.m_type.gen(); + this.m_type.release(obj); + assertMsgOptions(!this.m_type.exists(obj), 'Object still exists after deletion', false, true); + testPassed(); +}; + +/** + * @this {glsLifetimeTests.LifeTest} + */ +glsLifetimeTests.LifeTest.testBind = function() { + var obj = this.m_type.gen(); + this.m_type.binder().bind(obj); + var err = gl.getError(); + assertMsgOptions(err == gl.NONE, 'Bind failed', false, true); + assertMsgOptions(this.m_type.exists(obj), 'Object does not exist after binding', false, true); + this.m_type.binder().bind(null); + this.m_type.release(obj); + testPassed(); +}; + +/** + * @this {glsLifetimeTests.LifeTest} + */ +glsLifetimeTests.LifeTest.testDeleteBound = function() { + var obj = this.m_type.gen(); + this.m_type.binder().bind(obj); + this.m_type.release(obj); + if (this.m_type.nameLingers()) { + assertMsgOptions(gl.getError() == gl.NONE, 'Deleting bound object failed', false, true); + assertMsgOptions(this.m_type.binder().getBinding() === obj, 'Deleting bound object did not retain binding', false, true); + assertMsgOptions(this.m_type.exists(obj), 'Deleting bound object made its name invalid', false, true); + assertMsgOptions(this.m_type.isDeleteFlagged(obj), 'Deleting bound object did not flag the object for deletion', false, true); + this.m_type.binder().bind(null); + } else { + assertMsgOptions(gl.getError() == gl.NONE, 'Deleting bound object failed', false, true); + assertMsgOptions(this.m_type.binder().getBinding() === null, 'Deleting bound object did not remove binding', false, true); + assertMsgOptions(!this.m_type.exists(obj), 'Deleting bound object did not make its name invalid', false, true); + } + assertMsgOptions(this.m_type.binder().getBinding() === null, "Unbinding didn't remove binding", false, true); + assertMsgOptions(!this.m_type.exists(obj), 'Name is still valid after deleting and unbinding', false, true); + testPassed(); +}; + +/** + * @this {glsLifetimeTests.LifeTest} + */ +glsLifetimeTests.LifeTest.testDeleteUsed = function() { + var vtxShader = new glsLifetimeTests.CheckedShader(gluShaderProgram.shaderType.VERTEX, s_vertexShaderSrc); + var fragShader = new glsLifetimeTests.CheckedShader(gluShaderProgram.shaderType.FRAGMENT, s_fragmentShaderSrc); + var program = new glsLifetimeTests.CheckedProgram(vtxShader.getShader(), fragShader.getShader()); + var programId = program.getProgram(); + bufferedLogToConsole('Created and linked program ' + programId); + gl.useProgram(programId); + + gl.deleteProgram(programId); + bufferedLogToConsole('Deleted program ' + programId); + assertMsgOptions(gl.isProgram(programId), 'Deleted current program', false, true); + var deleteFlagged = gl.getProgramParameter(programId, gl.DELETE_STATUS); + assertMsgOptions(deleteFlagged == true, 'Program object was not flagged as deleted', false, true); + gl.useProgram(null); + assertMsgOptions(!gl.isProgram(programId), 'Deleted program name still valid after being made non-current', false, true); + testPassed(); +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {glsLifetimeTests.Attacher} attacher + * @param {function()} test + */ +glsLifetimeTests.AttachmentTest = function(name, description, attacher, test) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_attacher = attacher; + this.m_test = test; +}; + +setParentClass(glsLifetimeTests.AttachmentTest, tcuTestCase.DeqpTest); + +glsLifetimeTests.AttachmentTest.prototype.iterate = function() { + this.m_test(); + return tcuTestCase.IterateResult.STOP; +}; + +/** + * @this {glsLifetimeTests.AttachmentTest} + */ +glsLifetimeTests.AttachmentTest.testDeletedNames = function() { + var getAttachment = function(attacher, container) { + var queriedAttachment = attacher.getAttachment(container); + bufferedLogToConsole('Result of query for ' + attacher.getElementType().getName() + + ' attached to ' + attacher.getContainerType().getName() + ' ' + + container + ': ' + queriedAttachment); + return queriedAttachment; + }; + + var elemType = this.m_attacher.getElementType(); + var containerType = this.m_attacher.getContainerType(); + var container = containerType.gen(); + + var element = elemType.gen(); + this.m_attacher.initAttachment(0, element); + this.m_attacher.attach(element, container); + assertMsgOptions(getAttachment(this.m_attacher, container) == element, + 'Attachment not returned by query even before deletion.', false, true); + + elemType.release(element); + // "Such a container or other context may continue using the object, and + // may still contain state identifying its name as being currently bound" + // + // We here interpret "may" to mean that whenever the container has a + // deleted object attached to it, a query will return that object's former + // name. + assertMsgOptions(getAttachment(this.m_attacher, container) == element, + 'Attachment name not returned by query after attachment was deleted.', false, true); + + if (elemType.nameLingers()) + assertMsgOptions(elemType.exists(element), + 'Attached object name no longer valid after deletion.', false, true); + else + assertMsgOptions(!elemType.exists(element), + 'Attached object name still valid after deletion.', false, true); + + this.m_attacher.detach(element, container); + assertMsgOptions(getAttachment(this.m_attacher, container) == null, + 'Attachment name returned by query even after detachment.', false, true); + assertMsgOptions(!elemType.exists(element), + 'Deleted attached object name still usable after detachment.', false, true); + testPassed(); +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {glsLifetimeTests.InputAttacher} attacher + */ +glsLifetimeTests.InputAttachmentTest = function(name, description, attacher) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_inputAttacher = attacher; +}; + +setParentClass(glsLifetimeTests.InputAttachmentTest, tcuTestCase.DeqpTest); + +glsLifetimeTests.InputAttachmentTest.prototype.iterate = function() { + var attacher = this.m_inputAttacher.getAttacher(); + var containerType = attacher.getContainerType(); + var elementType = attacher.getElementType(); + var container = containerType.gen(); + + glsLifetimeTests.InputAttachmentTest.seed = glsLifetimeTests.InputAttachmentTest.seed || 0; + ++glsLifetimeTests.InputAttachmentTest.seed; + var rnd = new deRandom.Random(glsLifetimeTests.InputAttachmentTest.seed); + var refSeed = rnd.getInt(); + var newSeed = rnd.getInt(); + + var refSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with refSeed-seeded attachment + var delSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with deleted refSeed attachment + var newSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with newSeed-seeded attachment + + bufferedLogToConsole('Testing if writing to a newly created object modifies a deleted attachment'); + + bufferedLogToConsole('Writing to an original attachment'); + var element = elementType.gen(); + + attacher.initAttachment(refSeed, element); + attacher.attach(element, container); + this.m_inputAttacher.drawContainer(container, refSurface); + // element gets deleted here + bufferedLogToConsole('Deleting attachment'); + elementType.release(element); + + bufferedLogToConsole('Writing to a new attachment after deleting the original'); + var newElement = elementType.gen(); + + attacher.initAttachment(newSeed, newElement); + + this.m_inputAttacher.drawContainer(container, delSurface); + attacher.detach(element, container); + + attacher.attach(newElement, container); + this.m_inputAttacher.drawContainer(container, newSurface); + attacher.detach(newElement, container); + var surfacesMatch = tcuImageCompare.pixelThresholdCompare( + 'Reading from deleted', + 'Comparison result from reading from a container with a deleted attachment ' + + 'before and after writing to a fresh object.', + refSurface, delSurface, [0, 0, 0, 0]); + + /* TODO: Add logging images */ + // if (!surfacesMatch) + // log() << TestLog::Image("New attachment", + // "Container state after attached to the fresh object", + // newSurface); + + assertMsgOptions(surfacesMatch, + 'Writing to a fresh object modified the container with a deleted attachment.', false, true); + + testPassed(); + return tcuTestCase.IterateResult.STOP; +}; + +/** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {glsLifetimeTests.OutputAttacher} attacher + */ +glsLifetimeTests.OutputAttachmentTest = function(name, description, attacher) { + tcuTestCase.DeqpTest.call(this, name, description); + this.m_outputAttacher = attacher; +}; + +setParentClass(glsLifetimeTests.OutputAttachmentTest, tcuTestCase.DeqpTest); + +glsLifetimeTests.OutputAttachmentTest.prototype.iterate = function() { + var attacher = this.m_outputAttacher.getAttacher(); + var containerType = attacher.getContainerType(); + var elementType = attacher.getElementType(); + var container = containerType.gen(); + glsLifetimeTests.InputAttachmentTest.seed = glsLifetimeTests.InputAttachmentTest.seed || 0; + ++glsLifetimeTests.InputAttachmentTest.seed; + var rnd = new deRandom.Random(glsLifetimeTests.InputAttachmentTest.seed); + var refSeed = rnd.getInt(); + var newSeed = rnd.getInt(); + + var refSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with refSeed-seeded attachment + var delSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with deleted refSeed attachment + var newSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with newSeed-seeded attachment + + bufferedLogToConsole('Testing if writing to a container with a deleted attachment ' + + 'modifies a newly created object'); + + bufferedLogToConsole('Writing to a container with an existing attachment'); + var element = elementType.gen(); + + attacher.initAttachment(0, element); + attacher.attach(element, container); + + // For reference purposes, make note of what refSeed looks like. + this.m_outputAttacher.setupContainer(refSeed, container); + // Since in WebGL, buffer bound to TRANSFORM_FEEDBACK_BUFFER can not be bound to other targets. + // Unfortunately, element will be bound again in drawAttachment() for drawing. + // Detach element from container before drawing, then reattach it after drawing. + attacher.detach(element, container); + this.m_outputAttacher.drawAttachment(element, refSurface); + attacher.attach(element, container); + elementType.release(element); + + bufferedLogToConsole('Writing to a container after deletion of attachment'); + var newElement = elementType.gen(); + bufferedLogToConsole('Creating a new object '); + + bufferedLogToConsole('Recording state of new object before writing to container'); + attacher.initAttachment(newSeed, newElement); + this.m_outputAttacher.drawAttachment(newElement, newSurface); + + bufferedLogToConsole('Writing to container'); + + // Now re-write refSeed to the container. + this.m_outputAttacher.setupContainer(refSeed, container); + // Does it affect the newly created attachment object? + this.m_outputAttacher.drawAttachment(newElement, delSurface); + attacher.detach(element, container); + + var surfacesMatch = tcuImageCompare.pixelThresholdCompare( + 'Writing to deleted', + 'Comparison result from reading from a fresh object before and after ' + + 'writing to a container with a deleted attachment', + newSurface, delSurface, [0, 0, 0, 0]); + + /* TODO: Add logging images */ + // if (!surfacesMatch) + // log() << TestLog::Image( + // "Original attachment", + // "Result of container modification on original attachment before deletion.", + // refSurface); + + assertMsgOptions(surfacesMatch, + 'Writing to container with deleted attachment modified a new object.', false, true); + + testPassed(); + return tcuTestCase.IterateResult.STOP; +}; + +glsLifetimeTests.createLifeTestGroup = function(spec, types) { + var group = tcuTestCase.newTest(spec.name, spec.name); + + for (var i = 0; i < types.length; i++) { + var type = types[i]; + var name = type.getName(); + if (!spec.needBind || type.binder() != null) + group.addChild(new glsLifetimeTests.LifeTest(name, name, type, spec.func)); + } + + return group; +}; + +/** + * @param {tcuTestCase.DeqpTest} group + * @param {glsLifetimeTests.Types} types + */ +glsLifetimeTests.addTestCases = function(group, types) { + var attacherName = function(attacher) { + return attacher.getElementType().getName() + '_' + attacher.getContainerType().getName(); + }; + + var s_lifeTests = [ + /* Create */ { name: 'gen', func: glsLifetimeTests.LifeTest.testGen, needBind: false }, + /* Delete */ { name: 'delete', func: glsLifetimeTests.LifeTest.testDelete, needBind: false }, + /* Bind */ { name: 'bind', func: glsLifetimeTests.LifeTest.testBind, needBind: true }, + /* Delete bound */ { name: 'delete_bound', func: glsLifetimeTests.LifeTest.testDeleteBound, needBind: true } + ]; + + s_lifeTests.forEach(function(spec) { + group.addChild(glsLifetimeTests.createLifeTestGroup(spec, types.getTypes())); + }); + + var delUsedGroup = tcuTestCase.newTest('delete_used', 'Delete current program'); + group.addChild(delUsedGroup); + + delUsedGroup.addChild(new glsLifetimeTests.LifeTest('program', 'program', types.getProgramType(), + glsLifetimeTests.LifeTest.testDeleteUsed)); + + var attGroup = tcuTestCase.newTest('attach', 'Attachment tests'); + group.addChild(attGroup); + + var nameGroup = tcuTestCase.newTest('deleted_name', 'Name of deleted attachment'); + attGroup.addChild(nameGroup); + + var atts = types.getAttachers(); + for (var i = 0; i < atts.length; i++) { + var att = atts[i]; + var name = attacherName(att); + nameGroup.addChild(new glsLifetimeTests.AttachmentTest(name, name, att, + glsLifetimeTests.AttachmentTest.testDeletedNames)); + } + + var inputGroup = tcuTestCase.newTest('deleted_input', 'Input from deleted attachment'); + attGroup.addChild(inputGroup); + + var inAtts = types.getInputAttachers(); + for (var i = 0; i < inAtts.length; i++) { + var att = inAtts[i]; + var name = attacherName(att.getAttacher()); + inputGroup.addChild(new glsLifetimeTests.InputAttachmentTest(name, name, att)); + } + + var outputGroup = tcuTestCase.newTest('deleted_output', 'Output to deleted attachment'); + attGroup.addChild(outputGroup); + + var outAtts = types.getOutputAttachers(); + for (var i = 0; i < outAtts.length; i++) { + var att = outAtts[i]; + var name = attacherName(att.getAttacher()); + outputGroup.addChild(new glsLifetimeTests.OutputAttachmentTest(name, name, att)); + } + +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js new file mode 100644 index 000000000..20b8dcd47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js @@ -0,0 +1,282 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsRandomUniformBlockCase'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('modules.shared.glsUniformBlockCase'); + +goog.scope(function() { + + var glsRandomUniformBlockCase = modules.shared.glsRandomUniformBlockCase; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var glsUniformBlockCase = modules.shared.glsUniformBlockCase; + var tcuTestCase = framework.common.tcuTestCase; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + + glsRandomUniformBlockCase.FeatureBits = { + FEATURE_VECTORS: (1 << 0), + FEATURE_MATRICES: (1 << 1), + FEATURE_ARRAYS: (1 << 2), + FEATURE_STRUCTS: (1 << 3), + FEATURE_NESTED_STRUCTS: (1 << 4), + FEATURE_INSTANCE_ARRAYS: (1 << 5), + FEATURE_VERTEX_BLOCKS: (1 << 6), + FEATURE_FRAGMENT_BLOCKS: (1 << 7), + FEATURE_SHARED_BLOCKS: (1 << 8), + FEATURE_UNUSED_UNIFORMS: (1 << 9), + FEATURE_UNUSED_MEMBERS: (1 << 10), + FEATURE_PACKED_LAYOUT: (1 << 11), + FEATURE_SHARED_LAYOUT: (1 << 12), + FEATURE_STD140_LAYOUT: (1 << 13), + FEATURE_MATRIX_LAYOUT: (1 << 14), //!< Matrix layout flags. + FEATURE_ARRAYS_OF_ARRAYS: (1 << 15) + }; + + /** + * glsRandomUniformBlockCase.RandomUniformBlockCase class + * @param {string} name + * @param {string} description + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @param {number} features + * @param {number} seed + * @constructor + * @extends {glsUniformBlockCase.UniformBlockCase} + */ + glsRandomUniformBlockCase.RandomUniformBlockCase = function(name, description, bufferMode, features, seed) { + glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode); + this.m_features = features; + this.m_maxVertexBlocks = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_VERTEX_BLOCKS) ? 4 : 0); + this.m_maxFragmentBlocks = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_FRAGMENT_BLOCKS) ? 4 : 0); + this.m_maxSharedBlocks = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_SHARED_BLOCKS) ? 4 : 0); + this.m_maxInstances = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS) ? 3 : 0); + this.m_maxArrayLength = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS) ? 8 : 0); + this.m_maxStructDepth = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS) ? 2 : 0); + this.m_maxBlockMembers = 5; + this.m_maxStructMembers = 4; + this.m_seed = seed; + this.m_blockNdx = 1; + this.m_uniformNdx = 1; + this.m_structNdx = 1; + }; + + glsRandomUniformBlockCase.RandomUniformBlockCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype); + glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.constructor = glsRandomUniformBlockCase.RandomUniformBlockCase; + + /** + * generateType + * @param {deRandom.Random} rnd + * @param {number} typeDepth + * @param {boolean} arrayOk + * @return {glsUniformBlockCase.VarType} + */ + glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.generateType = function(rnd, typeDepth, arrayOk) { + /** @type {number} */ var structWeight = 0.1; + /** @type {number} */ var arrayWeight = 0.1; + /** @type {number} */ var flags; + + if (typeDepth < this.m_maxStructDepth && rnd.getFloat() < structWeight) { + /** @type {number} */ var unusedVtxWeight = 0.15; + /** @type {number} */ var unusedFragWeight = 0.15; + /** @type {boolean} */ var unusedOk = (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_MEMBERS) != 0; + /** @type {Array} */ var memberTypes = []; + /** @type {number} */ var numMembers = rnd.getInt(1, this.m_maxStructMembers); + + // Generate members first so nested struct declarations are in correct order. + for (var ndx = 0; ndx < numMembers; ndx++) + memberTypes.push(this.generateType(rnd, typeDepth + 1, true)); + + /** @type {glsUniformBlockCase.StructType} */ var structType = this.m_interface.allocStruct('s' + this.genName('A'.charCodeAt(0), 'Z'.charCodeAt(0), this.m_structNdx)); + this.m_structNdx += 1; + + assertMsgOptions(this.m_blockNdx <= 'Z'.charCodeAt(0) - 'A'.charCodeAt(0), 'generateType', false, true); + for (var ndx = 0; ndx < numMembers; ndx++) { + flags = 0; + + flags |= (unusedOk && rnd.getFloat() < unusedVtxWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_VERTEX : 0; + flags |= (unusedOk && rnd.getFloat() < unusedFragWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT : 0; + + structType.addMember('m' + ('A'.charCodeAt(0) + ndx), memberTypes[ndx], flags); + } + + return glsUniformBlockCase.newVarTypeStruct(structType); + } else if (this.m_maxArrayLength > 0 && arrayOk && rnd.getFloat() < arrayWeight) { + /** @type {boolean} */ var arraysOfArraysOk = (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS_OF_ARRAYS) != 0; + /** @type {number} */ var arrayLength = rnd.getInt(1, this.m_maxArrayLength); + /** @type {glsUniformBlockCase.VarType} */ var elementType = this.generateType(rnd, typeDepth, arraysOfArraysOk); + return glsUniformBlockCase.newVarTypeArray(elementType, arrayLength); + } else { + /** @type {Array} */ var typeCandidates = []; + + typeCandidates.push(gluShaderUtil.DataType.FLOAT); + typeCandidates.push(gluShaderUtil.DataType.INT); + typeCandidates.push(gluShaderUtil.DataType.UINT); + typeCandidates.push(gluShaderUtil.DataType.BOOL); + + if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_VECTORS) { + typeCandidates.push(gluShaderUtil.DataType.FLOAT_VEC2); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_VEC3); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_VEC4); + typeCandidates.push(gluShaderUtil.DataType.INT_VEC2); + typeCandidates.push(gluShaderUtil.DataType.INT_VEC3); + typeCandidates.push(gluShaderUtil.DataType.INT_VEC4); + typeCandidates.push(gluShaderUtil.DataType.UINT_VEC2); + typeCandidates.push(gluShaderUtil.DataType.UINT_VEC3); + typeCandidates.push(gluShaderUtil.DataType.UINT_VEC4); + typeCandidates.push(gluShaderUtil.DataType.BOOL_VEC2); + typeCandidates.push(gluShaderUtil.DataType.BOOL_VEC3); + typeCandidates.push(gluShaderUtil.DataType.BOOL_VEC4); + } + + if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRICES) { + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT2); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT2X3); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT3X2); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT3); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT3X4); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT4X2); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT4X3); + typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT4); + } + + /** @type {gluShaderUtil.DataType} */ var type = (rnd.choose(typeCandidates)[0]); + flags = 0; + + if (!gluShaderUtil.isDataTypeBoolOrBVec(type)) { + // Precision. + /** @type {Array} */ var precisionCandidates = [glsUniformBlockCase.UniformFlags.PRECISION_LOW, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM, glsUniformBlockCase.UniformFlags.PRECISION_HIGH]; + flags |= rnd.choose(precisionCandidates)[0]; + } + + return glsUniformBlockCase.newVarTypeBasic(type, flags); + } + }; + + /** + * genName + * @param {number} first + * @param {number} last + * @param {number} ndx + * @return {string} + */ + glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.genName = function(first, last, ndx) { + /** @type {string} */ var str = ''; + /** @type {number} */ var alphabetLen = last - first + 1; + + while (ndx > alphabetLen) { + str = String.fromCharCode(first + ((ndx - 1) % alphabetLen)) + str; + ndx = Math.floor((ndx - 1) / alphabetLen); + } + + str = String.fromCharCode(first + (ndx % (alphabetLen + 1)) - 1) + str; + + return str; + }; + + /** + * generateUniform + * @param {deRandom.Random} rnd + * @param {glsUniformBlockCase.UniformBlock} block + */ + glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.generateUniform = function(rnd, block) { + /** @type {number} */ var unusedVtxWeight = 0.15; + /** @type {number} */ var unusedFragWeight = 0.15; + /** @type {boolean} */ var unusedOk = (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_UNIFORMS) != 0; + /** @type {number} */ var flags = 0; + /** @type {string} */ var name = this.genName('a'.charCodeAt(0), 'z'.charCodeAt(0), this.m_uniformNdx); + /** @type {glsUniformBlockCase.VarType} */ var type = this.generateType(rnd, 0, true); //TODO: implement this. + + flags |= (unusedOk && rnd.getFloat() < unusedVtxWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_VERTEX : 0; + flags |= (unusedOk && rnd.getFloat() < unusedFragWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT : 0; + + block.addUniform(new glsUniformBlockCase.Uniform(name, type, flags)); + + this.m_uniformNdx += 1; + }; + + /** + * generateBlock + * @param {deRandom.Random} rnd + * @param {number} layoutFlags + */ + glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.generateBlock = function(rnd, layoutFlags) { + assertMsgOptions(this.m_blockNdx <= 'z'.charCodeAt(0) - 'a'.charCodeAt(0), 'generateBlock', false, true); + + /** @type {number} */ var instanceArrayWeight = 0.3; + /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block' + String.fromCharCode('A'.charCodeAt(0) + this.m_blockNdx)); + /** @type {number} */ var numInstances = (this.m_maxInstances > 0 && rnd.getFloat() < instanceArrayWeight) ? rnd.getInt(0, this.m_maxInstances) : 0; + /** @type {number} */ var numUniforms = rnd.getInt(1, this.m_maxBlockMembers); + + if (numInstances > 0) + block.setArraySize(numInstances); + + if (numInstances > 0 || rnd.getBool()) + block.setInstanceName('block' + String.fromCharCode('A'.charCodeAt(0) + this.m_blockNdx)); + + // Layout flag candidates. + /** @type {Array} */ var layoutFlagCandidates = []; + layoutFlagCandidates.push(0); + if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_PACKED_LAYOUT) + layoutFlagCandidates.push(glsUniformBlockCase.UniformFlags.LAYOUT_SHARED); + if ((this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_SHARED_LAYOUT) && ((layoutFlags & glsUniformBlockCase.UniformFlags.DECLARE_BOTH) != glsUniformBlockCase.UniformFlags.DECLARE_BOTH)) + layoutFlagCandidates.push(glsUniformBlockCase.UniformFlags.LAYOUT_PACKED); // \note packed layout can only be used in a single shader stage. + if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_STD140_LAYOUT) + layoutFlagCandidates.push(glsUniformBlockCase.UniformFlags.LAYOUT_STD140); + + layoutFlags |= rnd.choose(layoutFlagCandidates)[0]; //In Javascript, this function returns an array, so taking element 0. + + if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRIX_LAYOUT) { + /** @type {Array}*/ var matrixCandidates = [0, glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR, glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR]; + layoutFlags |= rnd.choose(matrixCandidates)[0]; + } + + block.setFlags(layoutFlags); + + for (var ndx = 0; ndx < numUniforms; ndx++) + this.generateUniform(rnd, block); + + this.m_blockNdx += 1; + }; + + /** + * Initializes the glsRandomUniformBlockCase.RandomUniformBlockCase + */ + glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.init = function() { + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(this.m_seed); + + /** @type {number} */ var numShared = this.m_maxSharedBlocks > 0 ? rnd.getInt(1, this.m_maxSharedBlocks) : 0; + /** @type {number} */ var numVtxBlocks = this.m_maxVertexBlocks - numShared > 0 ? rnd.getInt(1, this.m_maxVertexBlocks - numShared) : 0; + /** @type {number} */ var numFragBlocks = this.m_maxFragmentBlocks - numShared > 0 ? rnd.getInt(1, this.m_maxFragmentBlocks - numShared) : 0; + + for (var ndx = 0; ndx < numShared; ndx++) + this.generateBlock(rnd, glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT); + + for (var ndx = 0; ndx < numVtxBlocks; ndx++) + this.generateBlock(rnd, glsUniformBlockCase.UniformFlags.DECLARE_VERTEX); + + for (var ndx = 0; ndx < numFragBlocks; ndx++) + this.generateBlock(rnd, glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT); + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js new file mode 100644 index 000000000..0d4030bd9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js @@ -0,0 +1,1148 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsSamplerObjectTest'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.common.tcuTextureUtil'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluTextureUtil'); + +goog.scope(function() { + +var glsSamplerObjectTest = modules.shared.glsSamplerObjectTest; +var tcuTestCase = framework.common.tcuTestCase; +var deRandom = framework.delibs.debase.deRandom; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuTexture = framework.common.tcuTexture; +var tcuSurface = framework.common.tcuSurface; +var tcuTextureUtil = framework.common.tcuTextureUtil; +var tcuImageCompare = framework.common.tcuImageCompare; +var gluDrawUtil = framework.opengl.gluDrawUtil; +var gluTextureUtil = framework.opengl.gluTextureUtil; +var deString = framework.delibs.debase.deString; + + var DE_ASSERT = function(expression) { + if (!expression) throw new Error('Assert failed'); + }; + + // glsSamplerObjectTest.TextureSamplerTest + + /** @const @type {number} */ glsSamplerObjectTest.VIEWPORT_WIDTH = 128; + /** @const @type {number} */ glsSamplerObjectTest.VIEWPORT_HEIGHT = 128; + + /** @const @type {number} */ glsSamplerObjectTest.TEXTURE2D_WIDTH = 32; + /** @const @type {number} */ glsSamplerObjectTest.TEXTURE2D_HEIGHT = 32; + + /** @const @type {number} */ glsSamplerObjectTest.TEXTURE3D_WIDTH = 32; + /** @const @type {number} */ glsSamplerObjectTest.TEXTURE3D_HEIGHT = 32; + /** @const @type {number} */ glsSamplerObjectTest.TEXTURE3D_DEPTH = 32; + + /** @const @type {number} */ glsSamplerObjectTest.CUBEMAP_SIZE = 32; + + /** @const @type {Array} */ glsSamplerObjectTest.s_positions = [ + -1.0, -1.0, + 1.0, -1.0, + 1.0, 1.0, + 1.0, 1.0, + -1.0, 1.0, + -1.0, -1.0 + ]; + + /** @const @type {Array} */ glsSamplerObjectTest.s_positions3D = [ + -1.0, -1.0, -1.0, + 1.0, -1.0, 1.0, + 1.0, 1.0, -1.0, + 1.0, 1.0, -1.0, + -1.0, 1.0, 1.0, + -1.0, -1.0, -1.0 + ]; + + /** @const @type {Array} */ glsSamplerObjectTest.s_positionsCube = [ + -1.0, -1.0, -1.0, -0.5, + 1.0, -1.0, 1.0, -0.5, + 1.0, 1.0, 1.0, 0.5, + 1.0, 1.0, 1.0, 0.5, + -1.0, 1.0, -1.0, 0.5, + -1.0, -1.0, -1.0, -0.5 + ]; + + /** + * @struct + * @constructor + */ + glsSamplerObjectTest.SamplingState = function(minFilter, magFilter, wrapT, wrapS, wrapR, minLod, maxLod) { + /** @type {number} */ this.minFilter = minFilter; + /** @type {number} */ this.magFilter = magFilter; + /** @type {number} */ this.wrapT = wrapT; + /** @type {number} */ this.wrapS = wrapS; + /** @type {number} */ this.wrapR = wrapR; + /** @type {number} */ this.minLod = minLod; + /** @type {number} */ this.maxLod = maxLod; + }; + + /** + * @struct + * @param {string} name + * @param {string} desc + * @param {number} target + * @param {glsSamplerObjectTest.SamplingState} state1 + * @param {glsSamplerObjectTest.SamplingState} state2 + * @param {glsSamplerObjectTest.SamplingState=} state3 + * @constructor + */ + glsSamplerObjectTest.TestSpec = function(name, desc, target, state1, state2, state3) { + /** @type {string} */ this.name = name; + /** @type {string} */ this.desc = desc; + /** @type {number} */ this.target = target; + /** @type {glsSamplerObjectTest.SamplingState} */ this.textureState = state1; + /** @type {glsSamplerObjectTest.SamplingState} */ this.textureState2 = state3 !== undefined ? state2 : null; // merging TST and MTST structs + /** @type {glsSamplerObjectTest.SamplingState} */ this.samplerState = state3 !== undefined ? state3 : state2; + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @const @param {glsSamplerObjectTest.TestSpec} spec + */ + glsSamplerObjectTest.TextureSamplerTest = function(spec) { + tcuTestCase.DeqpTest.call(this, spec.name, spec.desc); + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {number} */ this.m_target = spec.target; + /** @type {glsSamplerObjectTest.SamplingState} */ this.m_textureState = spec.textureState; + /** @type {glsSamplerObjectTest.SamplingState} */ this.m_samplerState = spec.samplerState; + /** @type {deRandom.Random} */ this.m_random = new deRandom.Random(deString.deStringHash(spec.name)); + }; + + glsSamplerObjectTest.TextureSamplerTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsSamplerObjectTest.TextureSamplerTest.prototype.constructor = glsSamplerObjectTest.TextureSamplerTest; + + /** + * @private + * @param {tcuSurface.Surface} textureRef + * @param {tcuSurface.Surface} samplerRef + * @param {number} x + * @param {number} y + */ + glsSamplerObjectTest.TextureSamplerTest.prototype.renderReferences = function(textureRef, samplerRef, x, y) { + /** @type {WebGLTexture} */ var texture = glsSamplerObjectTest.TextureSamplerTest.createTexture(this.m_target); + + gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + gl.bindTexture(this.m_target, texture); + + glsSamplerObjectTest.TextureSamplerTest.setTextureState(this.m_target, this.m_textureState); + this.render(); + var texRef = textureRef.getAccess(); + var texRefTransferFormat = gluTextureUtil.getTransferFormat(texRef.getFormat()); + gl.readPixels(x, y, texRef.m_width, texRef.m_height, texRefTransferFormat.format, texRefTransferFormat.dataType, textureRef.m_pixels); + + glsSamplerObjectTest.TextureSamplerTest.setTextureState(this.m_target, this.m_samplerState); + this.render(); + var sampRef = samplerRef.getAccess(); + var sampRefTransferFormat = gluTextureUtil.getTransferFormat(sampRef.getFormat()); + gl.readPixels(x, y, sampRef.m_width, sampRef.m_height, sampRefTransferFormat.format, sampRefTransferFormat.dataType, samplerRef.m_pixels); + + gl.deleteTexture(texture); + }; + + /** + * @private + * @param {tcuSurface.Surface} textureResult + * @param {tcuSurface.Surface} samplerResult + * @param {number} x + * @param {number} y + */ + glsSamplerObjectTest.TextureSamplerTest.prototype.renderResults = function(textureResult, samplerResult, x, y) { + /** @type {WebGLTexture} */ var texture = glsSamplerObjectTest.TextureSamplerTest.createTexture(this.m_target); + + gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + var sampler = gl.createSampler(); + DE_ASSERT(sampler != -1); + + gl.bindSampler(0, sampler); + + // First set sampler state + glsSamplerObjectTest.TextureSamplerTest.setSamplerState(this.m_samplerState, sampler); + + // Set texture state + gl.bindTexture(this.m_target, texture); + + glsSamplerObjectTest.TextureSamplerTest.setTextureState(this.m_target, this.m_textureState); + // Render using sampler + this.render(); + var sampRes = samplerResult.getAccess(); + var sampResTransferFormat = gluTextureUtil.getTransferFormat(sampRes.getFormat()); + gl.readPixels(x, y, sampRes.m_width, sampRes.m_height, sampResTransferFormat.format, sampResTransferFormat.dataType, samplerResult.m_pixels); + + // Render without sampler + gl.bindSampler(0, null); + gl.deleteSampler(sampler); + + this.render(); + var texRes = textureResult.getAccess(); + var texResTransferFormat = gluTextureUtil.getTransferFormat(texRes.getFormat()); + gl.readPixels(x, y, texRes.m_width, texRes.m_height, texResTransferFormat.format, texResTransferFormat.dataType, textureResult.m_pixels); + + gl.deleteSampler(sampler); + gl.deleteTexture(texture); + }; + + /** + * @private + */ + glsSamplerObjectTest.TextureSamplerTest.prototype.render = function() { + /** @type {WebGLUniformLocation} */ var samplerLoc; + /** @type {WebGLUniformLocation} */ var scaleLoc; + + gl.useProgram(this.m_program.getProgram()); + + samplerLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler'); + DE_ASSERT(samplerLoc != null); + + scaleLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_posScale'); + DE_ASSERT(scaleLoc != null); + + gl.clearColor(0.5, 0.5, 0.5, 1.0); + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.uniform1i(samplerLoc, 0); + + gl.uniform1f(scaleLoc, 1.0); + + /** @type {Array} */ var vertexArrays; + switch (this.m_target) { + case gl.TEXTURE_2D: { + vertexArrays = [ + gluDrawUtil.vabFromBindingPointAndArrayPointer( + gluDrawUtil.bindingPointFromName('a_position'), + new gluDrawUtil.VertexArrayPointer( + gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, + 2, + 6, + 0, + glsSamplerObjectTest.s_positions)) + ]; + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + gl.uniform1f(scaleLoc, 0.25); + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + break; + } + + case gl.TEXTURE_3D: { + vertexArrays = [ + gluDrawUtil.vabFromBindingPointAndArrayPointer( + gluDrawUtil.bindingPointFromName('a_position'), + new gluDrawUtil.VertexArrayPointer( + gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, + 3, + 6, + 0, + glsSamplerObjectTest.s_positions3D)) + ]; + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + gl.uniform1f(scaleLoc, 0.25); + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + break; + } + + case gl.TEXTURE_CUBE_MAP: { + vertexArrays = [ + gluDrawUtil.vabFromBindingPointAndArrayPointer( + gluDrawUtil.bindingPointFromName('a_position'), + new gluDrawUtil.VertexArrayPointer( + gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, + 4, + 6, + 0, + glsSamplerObjectTest.s_positionsCube)) + ]; + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + gl.uniform1f(scaleLoc, 0.25); + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + break; + } + + default: + DE_ASSERT(false); + } + }; + + /** + * @private + * @param {number} target + * @param {glsSamplerObjectTest.SamplingState} state + */ + glsSamplerObjectTest.TextureSamplerTest.setTextureState = function(target, state) { + gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, state.minFilter); + gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, state.magFilter); + gl.texParameteri(target, gl.TEXTURE_WRAP_S, state.wrapS); + gl.texParameteri(target, gl.TEXTURE_WRAP_T, state.wrapT); + gl.texParameteri(target, gl.TEXTURE_WRAP_R, state.wrapR); + gl.texParameterf(target, gl.TEXTURE_MAX_LOD, state.maxLod); + gl.texParameterf(target, gl.TEXTURE_MIN_LOD, state.minLod); + }; + + /** + * @private + * @param {glsSamplerObjectTest.SamplingState} state + * @param {WebGLSampler} sampler + */ + glsSamplerObjectTest.TextureSamplerTest.setSamplerState = function(state, sampler) { + gl.samplerParameteri(sampler, gl.TEXTURE_MIN_FILTER, state.minFilter); + gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, state.magFilter); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, state.wrapS); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_T, state.wrapT); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_R, state.wrapR); + gl.samplerParameterf(sampler, gl.TEXTURE_MAX_LOD, state.maxLod); + gl.samplerParameterf(sampler, gl.TEXTURE_MIN_LOD, state.minLod); + }; + + /** + * @private + * @return {WebGLTexture} + */ + glsSamplerObjectTest.TextureSamplerTest.createTexture2D = function() { + /** @type {WebGLTexture} */ var texture = null; + /** @type {tcuTexture.Texture2D} */ var refTexture = new tcuTexture.Texture2D( + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8), + glsSamplerObjectTest.TEXTURE2D_WIDTH, + glsSamplerObjectTest.TEXTURE2D_HEIGHT); + + refTexture.allocLevel(0); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + + texture = gl.createTexture(); + + gl.bindTexture(gl.TEXTURE_2D, texture); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr()); + + gl.generateMipmap(gl.TEXTURE_2D); + + gl.bindTexture(gl.TEXTURE_2D, null); + + return texture; + }; + + /** + * @private + * @return {WebGLTexture} + */ + glsSamplerObjectTest.TextureSamplerTest.createTexture3D = function() { + /** @type {WebGLTexture} */ var texture = null; + /** @type {tcuTexture.Texture3D} */ var refTexture = new tcuTexture.Texture3D( + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8), + glsSamplerObjectTest.TEXTURE3D_WIDTH, + glsSamplerObjectTest.TEXTURE3D_HEIGHT, + glsSamplerObjectTest.TEXTURE3D_DEPTH); + + refTexture.allocLevel(0); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + + texture = gl.createTexture(); + + gl.bindTexture(gl.TEXTURE_3D, texture); + + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), refTexture.getDepth(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr()); + + gl.generateMipmap(gl.TEXTURE_3D); + + gl.bindTexture(gl.TEXTURE_3D, null); + + return texture; + }; + + /** + * @private + * @return {WebGLTexture} + */ + glsSamplerObjectTest.TextureSamplerTest.createTextureCube = function() { + /** @type {WebGLTexture} */ var texture = null; + /** @type {tcuTexture.TextureCube} */ var refTexture = new tcuTexture.TextureCube( + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8), + glsSamplerObjectTest.CUBEMAP_SIZE); + + texture = gl.createTexture(); + + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z, 0); + + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_X), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]); + + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture); + // TODO: check internalFormat / format parameters in texImage2D (were RGBA8 and RGBA respectively) + for (var face in tcuTexture.CubeFace) { + /** @const @type {number} */ var target = gluTextureUtil.getGLCubeFace(tcuTexture.CubeFace[face]); + gl.texImage2D(target, 0, gl.RGBA, refTexture.getSize(), refTexture.getSize(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevelFace(0, tcuTexture.CubeFace[face]).getDataPtr()); + } + + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); + + return texture; + }; + + /** + * @private + * @param {number} target + * @return {WebGLTexture} + */ + glsSamplerObjectTest.TextureSamplerTest.createTexture = function(target) { + /** @type {WebGLTexture} */ var texture; + switch (target) { + case gl.TEXTURE_2D: + texture = glsSamplerObjectTest.TextureSamplerTest.createTexture2D(); + break; + + case gl.TEXTURE_3D: + texture = glsSamplerObjectTest.TextureSamplerTest.createTexture3D(); + break; + + case gl.TEXTURE_CUBE_MAP: + texture = glsSamplerObjectTest.TextureSamplerTest.createTextureCube(); + break; + + default: + throw new Error('Unsupported target: ' + WebGLTestUtils.glEnumToString(gl, target)); + } + + return texture; + }; + + /** + * @private + * @param {number} target + * @return {string} + */ + glsSamplerObjectTest.TextureSamplerTest.selectVertexShader = function(target) { + switch (target) { + case gl.TEXTURE_2D: + return '#version 300 es\n' + + 'in highp vec2 a_position;\n' + + 'uniform highp float u_posScale;\n' + + 'out mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\tv_texCoord = a_position;\n' + + '\tgl_Position = vec4(u_posScale * a_position, 0.0, 1.0);\n' + + '}'; + + case gl.TEXTURE_3D: + return '#version 300 es\n' + + 'in highp vec3 a_position;\n' + + 'uniform highp float u_posScale;\n' + + 'out mediump vec3 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\tv_texCoord = a_position;\n' + + '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' + + '}'; + + case gl.TEXTURE_CUBE_MAP: + return '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'uniform highp float u_posScale;\n' + + 'out mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\tv_texCoord = a_position.zw;\n' + + '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' + + '}'; + + default: + DE_ASSERT(false); + return ''; + } + }; + + /** + * @private + * @param {number} target + * @return {string} + */ + glsSamplerObjectTest.TextureSamplerTest.selectFragmentShader = function(target) { + switch (target) { + case gl.TEXTURE_2D: + return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' + + 'uniform lowp sampler2D u_sampler;\n' + + 'in mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\to_color = texture(u_sampler, v_texCoord);\n' + + '}'; + + case gl.TEXTURE_3D: + return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' + + 'uniform lowp sampler3D u_sampler;\n' + + 'in mediump vec3 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\to_color = texture(u_sampler, v_texCoord);\n' + + '}'; + + case gl.TEXTURE_CUBE_MAP: + return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' + + 'uniform lowp samplerCube u_sampler;\n' + + 'in mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\to_color = texture(u_sampler, vec3(cos(3.14 * v_texCoord.y) * sin(3.14 * v_texCoord.x), sin(3.14 * v_texCoord.y), cos(3.14 * v_texCoord.y) * cos(3.14 * v_texCoord.x)));\n' + + '}'; + + default: + DE_ASSERT(false); + return ''; + } + }; + + glsSamplerObjectTest.TextureSamplerTest.prototype.init = function() { + /** @const @type {string} */ var vertexShaderTemplate = glsSamplerObjectTest.TextureSamplerTest.selectVertexShader(this.m_target); + /** @const @type {string} */ var fragmentShaderTemplate = glsSamplerObjectTest.TextureSamplerTest.selectFragmentShader(this.m_target); + + DE_ASSERT(!this.m_program); + this.m_program = new gluShaderProgram.ShaderProgram(gl, + gluShaderProgram.makeVtxFragSources( + vertexShaderTemplate, + fragmentShaderTemplate)); + + if (!this.m_program.isOk()) { + // tcu::TestLog& log = m_testCtx.getLog(); + // log << *m_program; + throw new Error('Failed to compile shaders'); + } + }; + + glsSamplerObjectTest.TextureSamplerTest.prototype.iterate = function() { + //tcu::TestLog& log = m_testCtx.getLog(); + + /** @type {tcuSurface.Surface} */ var textureRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + /** @type {tcuSurface.Surface} */ var samplerRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + /** @type {tcuSurface.Surface} */ var textureResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + /** @type {tcuSurface.Surface} */ var samplerResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + /** @type {number} */ var x = this.m_random.getInt(0, gl.drawingBufferWidth - glsSamplerObjectTest.VIEWPORT_WIDTH); + /** @type {number} */ var y = this.m_random.getInt(0, gl.drawingBufferHeight - glsSamplerObjectTest.VIEWPORT_HEIGHT); + + this.renderReferences(textureRef, samplerRef, x, y); + this.renderResults(textureResult, samplerResult, x, y); + + /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Sampler render result', 'Result from rendering with sampler', samplerRef, samplerResult, [0, 0, 0, 0]); + + if (!tcuImageCompare.pixelThresholdCompare('Texture render result', 'Result from rendering with texture state', textureRef, textureResult, [0, 0, 0, 0])) + isOk = false; + + assertMsgOptions(isOk, '', true, false); + + return tcuTestCase.IterateResult.STOP; + }; + + // glsSamplerObjectTest.MultiTextureSamplerTest + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @const @param {glsSamplerObjectTest.TestSpec} spec + */ + glsSamplerObjectTest.MultiTextureSamplerTest = function(spec) { + tcuTestCase.DeqpTest.call(this, spec.name, spec.desc); + /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null; + /** @type {number} */ this.m_target = spec.target; + /** @type {glsSamplerObjectTest.SamplingState} */ this.m_textureState1 = spec.textureState; + /** @type {glsSamplerObjectTest.SamplingState} */ this.m_textureState2 = spec.textureState2; + /** @type {glsSamplerObjectTest.SamplingState} */ this.m_samplerState = spec.samplerState; + /** @type {deRandom.Random} */ this.m_random = new deRandom.Random(deString.deStringHash(spec.name)); + }; + + glsSamplerObjectTest.MultiTextureSamplerTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsSamplerObjectTest.MultiTextureSamplerTest.prototype.constructor = glsSamplerObjectTest.MultiTextureSamplerTest; + + glsSamplerObjectTest.MultiTextureSamplerTest.prototype.init = function() { + /** @type {string} */ var vertexShaderTemplate = glsSamplerObjectTest.MultiTextureSamplerTest.selectVertexShader(this.m_target); + /** @type {string} */ var fragmentShaderTemplate = glsSamplerObjectTest.MultiTextureSamplerTest.selectFragmentShader(this.m_target); + + DE_ASSERT(!this.m_program); + this.m_program = new gluShaderProgram.ShaderProgram(gl, + gluShaderProgram.makeVtxFragSources( + vertexShaderTemplate, + fragmentShaderTemplate)); + if (!this.m_program.isOk()) { + // tcu::TestLog& log = m_testCtx.getLog(); + // + // log << *m_program; + throw new Error('Failed to compile shaders'); + } + }; + + glsSamplerObjectTest.MultiTextureSamplerTest.prototype.deinit = function() { + gl.activeTexture(gl.TEXTURE0); + } + + glsSamplerObjectTest.MultiTextureSamplerTest.prototype.iterate = function() { + //tcu::TestLog& log = m_testCtx.getLog(); + + /** @type {tcuSurface.Surface} */ var textureRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + /** @type {tcuSurface.Surface} */ var samplerRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + /** @type {tcuSurface.Surface} */ var textureResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + /** @type {tcuSurface.Surface} */ var samplerResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + /** @type {number} */ var x = this.m_random.getInt(0, gl.drawingBufferWidth - glsSamplerObjectTest.VIEWPORT_WIDTH); + /** @type {number} */ var y = this.m_random.getInt(0, gl.drawingBufferHeight - glsSamplerObjectTest.VIEWPORT_HEIGHT); + + this.renderReferences(textureRef, samplerRef, x, y); + this.renderResults(textureResult, samplerResult, x, y); + + /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Sampler render result', 'Result from rendering with sampler', samplerRef, samplerResult, [0, 0, 0, 0]); + + if (!tcuImageCompare.pixelThresholdCompare('Texture render result', 'Result from rendering with texture state', textureRef, textureResult, [0, 0, 0, 0])) + isOk = false; + + assertMsgOptions(isOk, '', true, false); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @private + * @param {tcuSurface.Surface} textureRef + * @param {tcuSurface.Surface} samplerRef + * @param {number} x + * @param {number} y + */ + glsSamplerObjectTest.MultiTextureSamplerTest.prototype.renderReferences = function(textureRef, samplerRef, x, y) { + /** @type {WebGLTexture} */ var texture1 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 0); + /** @type {WebGLTexture} */ var texture2 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 1); + + gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + // Generate texture rendering reference + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(this.m_target, texture1); + glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_textureState1); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(this.m_target, texture2); + glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_textureState2); + + this.render(); + var texRef = textureRef.getAccess(); + var texRefTransferFormat = gluTextureUtil.getTransferFormat(texRef.getFormat()); + gl.readPixels(x, y, texRef.m_width, texRef.m_height, texRefTransferFormat.format, texRefTransferFormat.dataType, textureRef.m_pixels); + + // Generate sampler rendering reference + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(this.m_target, texture1); + glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_samplerState); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(this.m_target, texture2); + glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_samplerState); + + this.render(); + var sampRef = samplerRef.getAccess(); + var sampRefTransferFormat = gluTextureUtil.getTransferFormat(sampRef.getFormat()); + gl.readPixels(x, y, sampRef.m_width, sampRef.m_height, sampRefTransferFormat.format, sampRefTransferFormat.dataType, samplerRef.m_pixels); + }; + + /** + * @private + * @param {tcuSurface.Surface} textureResult + * @param {tcuSurface.Surface} samplerResult + * @param {number} x + * @param {number} y + */ + glsSamplerObjectTest.MultiTextureSamplerTest.prototype.renderResults = function(textureResult, samplerResult, x, y) { + /** @type {WebGLTexture} */ var texture1 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 0); + /** @type {WebGLTexture} */ var texture2 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 1); + + gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT); + + /** @type {WebGLSampler} */ var sampler = gl.createSampler(); + DE_ASSERT(sampler != -1); + + gl.bindSampler(0, sampler); + gl.bindSampler(1, sampler); + + // First set sampler state + glsSamplerObjectTest.MultiTextureSamplerTest.setSamplerState(this.m_samplerState, sampler); + + // Set texture state + gl.bindTexture(this.m_target, texture1); + glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_textureState1); + + gl.bindTexture(this.m_target, texture2); + glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this. m_target, this.m_textureState2); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(this.m_target, texture1); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(this.m_target, texture2); + + // Render using sampler + this.render(); + var sampRes = samplerResult.getAccess(); + var sampResTransferFormat = gluTextureUtil.getTransferFormat(sampRes.getFormat()); + gl.readPixels(x, y, sampRes.m_width, sampRes.m_height, sampResTransferFormat.format, sampResTransferFormat.dataType, samplerResult.m_pixels); + + gl.bindSampler(0, null); + gl.bindSampler(1, null); + + this.render(); + var texRes = textureResult.getAccess(); + var texResTransferFormat = gluTextureUtil.getTransferFormat(texRes.getFormat()); + gl.readPixels(x, y, texRes.m_width, texRes.m_height, texResTransferFormat.format, texResTransferFormat.dataType, textureResult.m_pixels); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(this.m_target, null); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(this.m_target, null); + + gl.deleteSampler(sampler); + gl.deleteTexture(texture1); + gl.deleteTexture(texture2); + }; + + glsSamplerObjectTest.MultiTextureSamplerTest.prototype.render = function() { + + gl.useProgram(this.m_program.getProgram()); + + /** @type {WebGLUniformLocation} */ var samplerLoc1 = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler1'); + DE_ASSERT(samplerLoc1 != -1); + + /** @type {WebGLUniformLocation} */ var samplerLoc2 = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler2'); + DE_ASSERT(samplerLoc2 != -1); + + /** @type {WebGLUniformLocation} */ var scaleLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_posScale'); + DE_ASSERT(scaleLoc != -1); + + gl.clearColor(0.5, 0.5, 0.5, 1.0); + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.uniform1i(samplerLoc1, 0); + + gl.uniform1i(samplerLoc2, 1); + + gl.uniform1f(scaleLoc, 1.0); + + /** @type {Array} */ var vertexArrays; + switch (this.m_target) { + case gl.TEXTURE_2D: { + vertexArrays = [ + gluDrawUtil.vabFromBindingPointAndArrayPointer( + gluDrawUtil.bindingPointFromName('a_position'), + new gluDrawUtil.VertexArrayPointer( + gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, + 2, + 6, + 0, + glsSamplerObjectTest.s_positions)) + ]; + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + gl.uniform1f(scaleLoc, 0.25); + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + break; + } + + case gl.TEXTURE_3D: { + vertexArrays = [ + gluDrawUtil.vabFromBindingPointAndArrayPointer( + gluDrawUtil.bindingPointFromName('a_position'), + new gluDrawUtil.VertexArrayPointer( + gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, + 3, + 6, + 0, + glsSamplerObjectTest.s_positions3D)) + ]; + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + gl.uniform1f(scaleLoc, 0.25); + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + break; + } + + case gl.TEXTURE_CUBE_MAP: { + vertexArrays = [ + gluDrawUtil.vabFromBindingPointAndArrayPointer( + gluDrawUtil.bindingPointFromName('a_position'), + new gluDrawUtil.VertexArrayPointer( + gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT, + gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, + 4, + 6, + 0, + glsSamplerObjectTest.s_positionsCube)) + ]; + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + gl.uniform1f(scaleLoc, 0.25); + + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6)); + + break; + } + + default: + DE_ASSERT(false); + } + + }; + + /** + * @private + * @param {number} target + * @param {glsSamplerObjectTest.SamplingState} state + */ + glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState = function(target, state) { + gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, state.minFilter); + gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, state.magFilter); + gl.texParameteri(target, gl.TEXTURE_WRAP_S, state.wrapS); + gl.texParameteri(target, gl.TEXTURE_WRAP_T, state.wrapT); + gl.texParameteri(target, gl.TEXTURE_WRAP_R, state.wrapR); + gl.texParameterf(target, gl.TEXTURE_MAX_LOD, state.maxLod); + gl.texParameterf(target, gl.TEXTURE_MIN_LOD, state.minLod); + }; + + /** + * @private + * @param {glsSamplerObjectTest.SamplingState} state + * @param {WebGLSampler} sampler + */ + glsSamplerObjectTest.MultiTextureSamplerTest.setSamplerState = function(state, sampler) { + gl.samplerParameteri(sampler, gl.TEXTURE_MIN_FILTER, state.minFilter); + gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, state.magFilter); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, state.wrapS); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_T, state.wrapT); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_R, state.wrapR); + gl.samplerParameterf(sampler, gl.TEXTURE_MAX_LOD, state.maxLod); + gl.samplerParameterf(sampler, gl.TEXTURE_MIN_LOD, state.minLod); + }; + + /** + * @private + * @param {number} id + * @return {WebGLTexture } + */ + glsSamplerObjectTest.MultiTextureSamplerTest.createTexture2D = function(id) { + /** @type {WebGLTexture} */ var texture = null; + /** @type {tcuTexture.Texture2D} */ var refTexture = new tcuTexture.Texture2D( + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8), + glsSamplerObjectTest.TEXTURE2D_WIDTH, + glsSamplerObjectTest.TEXTURE2D_HEIGHT); + + refTexture.allocLevel(0); + + texture = gl.createTexture(); + + switch (id) { + case 0: + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 0.5, 0.5]); + break; + + case 1: + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 1.0, 1.0]); + break; + + default: + DE_ASSERT(false); + } + + gl.bindTexture(gl.TEXTURE_2D, texture); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr()); + + gl.generateMipmap(gl.TEXTURE_2D); + + gl.bindTexture(gl.TEXTURE_2D, null); + + return texture; + }; + + /** + * @private + * @param {number} id + * @return {WebGLTexture} + */ + glsSamplerObjectTest.MultiTextureSamplerTest.createTexture3D = function(id) { + /** @type {WebGLTexture} */ var texture = null; + /** @type {tcuTexture.Texture3D} */ var refTexture = new tcuTexture.Texture3D( + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8), + glsSamplerObjectTest.TEXTURE3D_WIDTH, + glsSamplerObjectTest.TEXTURE3D_HEIGHT, + glsSamplerObjectTest.TEXTURE3D_DEPTH); + + refTexture.allocLevel(0); + + texture = gl.createTexture(); + + switch (id) { + case 0: + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 0.5, 0.5]); + break; + + case 1: + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 1.0, 1.0]); + break; + + default: + DE_ASSERT(false); + } + + gl.bindTexture(gl.TEXTURE_3D, texture); + // TODO: check internalFormat and format in texImage3D + gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), refTexture.getDepth(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr()); + + gl.generateMipmap(gl.TEXTURE_3D); + + gl.bindTexture(gl.TEXTURE_3D, null); + + return texture; + }; + + /** + * @private + * @param {number} id + * @return {WebGLTexture} + */ + glsSamplerObjectTest.MultiTextureSamplerTest.createTextureCube = function(id) { + /** @type {WebGLTexture} */ var texture = null; + /** @type {tcuTexture.TextureCube} */ var refTexture = new tcuTexture.TextureCube( + new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, + tcuTexture.ChannelType.UNORM_INT8), + glsSamplerObjectTest.CUBEMAP_SIZE); + + texture = gl.createTexture(); + + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y, 0); + refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z, 0); + + switch (id) { + case 0: + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_X), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]); + break; + + case 1: + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_X), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]); + tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]); + break; + + default: + DE_ASSERT(false); + } + + gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture); + + for (var face in tcuTexture.CubeFace) { + /** @const @type {number} */ var target = gluTextureUtil.getGLCubeFace(tcuTexture.CubeFace[face]); + gl.texImage2D(target, 0, gl.RGBA, refTexture.getSize(), refTexture.getSize(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevelFace(0, tcuTexture.CubeFace[face]).getDataPtr()); + } + + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); + + return texture; + }; + + /** + * @private + * @param {number} target + * @param {number} id + * @return {WebGLTexture} + */ + glsSamplerObjectTest.MultiTextureSamplerTest.createTexture = function(target, id) { + /** @type {WebGLTexture} */ var texture; + switch (target) { + case gl.TEXTURE_2D: + texture = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture2D(id); + break; + + case gl.TEXTURE_3D: + texture = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture3D(id); + break; + + case gl.TEXTURE_CUBE_MAP: + texture = glsSamplerObjectTest.MultiTextureSamplerTest.createTextureCube(id); + break; + + default: + DE_ASSERT(false); + } + + return texture; + }; + + /** + * @private + * @param {number} target + * @return {string} + */ + glsSamplerObjectTest.MultiTextureSamplerTest.selectVertexShader = function(target) { + switch (target) { + case gl.TEXTURE_2D: + return '#version 300 es\n' + + 'in highp vec2 a_position;\n' + + 'uniform highp float u_posScale;\n' + + 'out mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\tv_texCoord = a_position;\n' + + '\tgl_Position = vec4(u_posScale * a_position, 0.0, 1.0);\n' + + '}'; + + case gl.TEXTURE_3D: + return '#version 300 es\n' + + 'in highp vec3 a_position;\n' + + 'uniform highp float u_posScale;\n' + + 'out mediump vec3 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\tv_texCoord = a_position;\n' + + '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' + + '}'; + + case gl.TEXTURE_CUBE_MAP: + return '#version 300 es\n' + + 'in highp vec4 a_position;\n' + + 'uniform highp float u_posScale;\n' + + 'out mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\tv_texCoord = a_position.zw;\n' + + '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' + + '}'; + + default: + DE_ASSERT(false); + return ''; + } + }; + + /** + * @private + * @param {number} target + * @return {string} + */ + glsSamplerObjectTest.MultiTextureSamplerTest.selectFragmentShader = function(target) { + switch (target) { + case gl.TEXTURE_2D: + return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' + + 'uniform lowp sampler2D u_sampler1;\n' + + 'uniform lowp sampler2D u_sampler2;\n' + + 'in mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\to_color = vec4(0.75, 0.75, 0.75, 1.0) * (texture(u_sampler1, v_texCoord) + texture(u_sampler2, v_texCoord));\n' + + '}'; + + break; + + case gl.TEXTURE_3D: + return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' + + 'uniform lowp sampler3D u_sampler1;\n' + + 'uniform lowp sampler3D u_sampler2;\n' + + 'in mediump vec3 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\to_color = vec4(0.75, 0.75, 0.75, 1.0) * (texture(u_sampler1, v_texCoord) + texture(u_sampler2, v_texCoord));\n' + + '}'; + + case gl.TEXTURE_CUBE_MAP: + return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' + + 'uniform lowp samplerCube u_sampler1;\n' + + 'uniform lowp samplerCube u_sampler2;\n' + + 'in mediump vec2 v_texCoord;\n' + + 'void main (void)\n' + + ' {\n' + + '\to_color = vec4(0.5, 0.5, 0.5, 1.0) * (texture(u_sampler1, vec3(cos(3.14 * v_texCoord.y) * sin(3.14 * v_texCoord.x), sin(3.14 * v_texCoord.y), cos(3.14 * v_texCoord.y) * cos(3.14 * v_texCoord.x)))' + + '+ texture(u_sampler2, vec3(cos(3.14 * v_texCoord.y) * sin(3.14 * v_texCoord.x), sin(3.14 * v_texCoord.y), cos(3.14 * v_texCoord.y) * cos(3.14 * v_texCoord.x))));\n' + + '}'; + + default: + DE_ASSERT(false); + return ''; + } + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js new file mode 100644 index 000000000..0241dd2de --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js @@ -0,0 +1,735 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL (ES) Module + * ----------------------------------------------- + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *//*! + * \file + * \brief Shader execution utilities. + *//*--------------------------------------------------------------------*/ +'use strict'; +goog.provide('modules.shared.glsShaderExecUtil'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuMatrixUtil'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.gluVarType'); + +goog.scope(function() { + + var glsShaderExecUtil = modules.shared.glsShaderExecUtil; + var gluVarType = framework.opengl.gluVarType; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var gluShaderProgram = framework.opengl.gluShaderProgram; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var tcuTexture = framework.common.tcuTexture; + var tcuMatrix = framework.common.tcuMatrix; + var tcuMatrixUtil = framework.common.tcuMatrixUtil; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + var setParentClass = function(child, parent) { + child.prototype = Object.create(parent.prototype); + child.prototype.constructor = child; + }; + + /** + * @constructor + * @param {string=} name + * @param {gluVarType.VarType=} varType + */ + glsShaderExecUtil.Symbol = function(name, varType) { + name = name === undefined ? '' : name; + /** @type {string} */ this.name = name; + /** @type {gluVarType.VarType} */ this.varType = varType || null; + }; + + //! Complete shader specification. + /** + * @constructor + */ + glsShaderExecUtil.ShaderSpec = function() { + /** @type {gluShaderUtil.GLSLVersion} */ this.version = gluShaderUtil.GLSLVersion.V300_ES; //!< Shader version. + /** @type {Array} */ this.inputs = []; + /** @type {Array} */ this.outputs = []; + /** @type {string} */ this.globalDeclarations = ''; //!< These are placed into global scope. Can contain uniform declarations for example. + /** @type {*} */ this.source; //!< Source snippet to be executed. + }; + + /** + * Base class for shader executor. + * @constructor + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + */ + glsShaderExecUtil.ShaderExecutor = function(shaderSpec) { + /** @type {Array} */ this.m_inputs = shaderSpec.inputs; + /** @type {Array} */ this.m_outputs = shaderSpec.outputs; + }; + + glsShaderExecUtil.ShaderExecutor.prototype.useProgram = function() { + DE_ASSERT(this.isOk); + gl.useProgram(this.getProgram()); + }; + + /** + * @return {boolean} + */ + glsShaderExecUtil.ShaderExecutor.prototype.isOk = function() { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @return {WebGLProgram} + */ + glsShaderExecUtil.ShaderExecutor.prototype.getProgram = function() { + throw new Error('Virtual function. Please override.'); + }; + + /** + * @param {number} numValues + * @param {Array>} inputs + * @return {Array} outputs + */ + glsShaderExecUtil.ShaderExecutor.prototype.execute = function(numValues, inputs) { + throw new Error('Virtual function. Please override.'); + }; + + /** + * Base class for shader executor. + * @param {gluShaderProgram.shaderType} shaderType + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + * @return {glsShaderExecUtil.ShaderExecutor} + */ + glsShaderExecUtil.createExecutor = function(shaderType, shaderSpec) { + switch (shaderType) { + case gluShaderProgram.shaderType.VERTEX: return new glsShaderExecUtil.VertexShaderExecutor(shaderSpec); + case gluShaderProgram.shaderType.FRAGMENT: return new glsShaderExecUtil.FragmentShaderExecutor(shaderSpec); + default: + throw new Error('Unsupported shader type: ' + shaderType); + } + }; + + /** + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + * @return {string} + */ + glsShaderExecUtil.generateVertexShader = function(shaderSpec) { + /** @type {boolean} */ var usesInout = true; + /** @type {string} */ var in_ = usesInout ? 'in' : 'attribute'; + /** @type {string} */ var out = usesInout ? 'out' : 'varying'; + /** @type {string} */ var src = ''; + /** @type {number} */ var vecSize; + /** @type {gluShaderUtil.DataType} */ var intBaseType; + + src += '#version 300 es\n'; + + if (shaderSpec.globalDeclarations.length > 0) + src += (shaderSpec.globalDeclarations + '\n'); + + for (var i = 0; i < shaderSpec.inputs.length; ++i) + src += (in_ + ' ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, shaderSpec.inputs[i].name) + ';\n'); + + for (var i = 0; i < shaderSpec.outputs.length; i++) { + var output = shaderSpec.outputs[i]; + DE_ASSERT(output.varType.isBasicType()); + + if (gluShaderUtil.isDataTypeBoolOrBVec(output.varType.getBasicType())) { + vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType()); + intBaseType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT; + /** @type {gluVarType.VarType} */ var intType = new gluVarType.VarType().VarTypeBasic(intBaseType, gluShaderUtil.precision.PRECISION_HIGHP); + + src += ('flat ' + out + ' ' + gluVarType.declareVariable(intType, 'o_' + output.name) + ';\n'); + } else + src += ('flat ' + out + ' ' + gluVarType.declareVariable(output.varType, output.name) + ';\n'); + } + + src += '\n' + + 'void main (void)\n' + + '{\n' + + ' gl_Position = vec4(0.0);\n' + + ' gl_PointSize = 1.0;\n\n'; + + // Declare necessary output variables (bools). + for (var i = 0; i < shaderSpec.outputs.length; i++) { + if (gluShaderUtil.isDataTypeBoolOrBVec(shaderSpec.outputs[i].varType.getBasicType())) + src += ('\t' + gluVarType.declareVariable(shaderSpec.outputs[i].varType, shaderSpec.outputs[i].name) + ';\n'); + } + + //Operation - indented to correct level. + // TODO: Add indenting + src += shaderSpec.source; + + // Assignments to outputs. + for (var i = 0; i < shaderSpec.outputs.length; i++) { + if (gluShaderUtil.isDataTypeBoolOrBVec(output.varType.getBasicType())) { + vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType()); + intBaseType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT; + + src += ('\to_' + output.name + ' = ' + gluShaderUtil.getDataTypeName(intBaseType) + '(' + output.name + ');\n'); + } + } + + src += '}\n'; + + return src; + }; + + /** + * @return {string} + */ + glsShaderExecUtil.generateEmptyFragmentSource = function() { + /** @type {boolean} */ var customOut = true; + /** @type {string} */ var src; + + src = '#version 300 es\n'; + + // \todo [2013-08-05 pyry] Do we need one dummy output? + + src += 'void main (void)\n{\n'; + if (!customOut) + src += ' gl.FragColor = vec4(0.0);\n'; + src += '}\n'; + + return src; + }; + + /** + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + * @param {string} inputPrefix + * @param {string} outputPrefix + * @return {string} + */ + glsShaderExecUtil.generatePassthroughVertexShader = function(shaderSpec, inputPrefix, outputPrefix) { + // flat qualifier is not present in earlier versions? + // DE_ASSERT(glu::glslVersionUsesInOutQualifiers(shaderSpec.version)); + + /** @type {string} */ var src; + + src = '#version 300 es\n' + + 'in highp vec4 a_position;\n'; + + for (var i = 0; i < shaderSpec.inputs.length; i++) { + src += ('in ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, inputPrefix + shaderSpec.inputs[i].name) + ';\n' + + 'flat out ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, outputPrefix + shaderSpec.inputs[i].name) + ';\n'); + } + + src += '\nvoid main (void)\n{\n' + + ' gl_Position = a_position;\n' + + ' gl_PointSize = 1.0;\n'; + + for (var i = 0; i < shaderSpec.inputs.length; i++) + src += ('\t' + outputPrefix + shaderSpec.inputs[i].name + ' = ' + inputPrefix + shaderSpec.inputs[i].name + ';\n'); + + src += '}\n'; + + return src; + }; + + /** + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + * @param {boolean} useIntOutputs + * @param {*} outLocationMap + * @return {string} + */ + glsShaderExecUtil.generateFragmentShader = function(shaderSpec, useIntOutputs, outLocationMap) { + /** @type {number} */ var vecSize; + /** @type {number} */ var numVecs; + /** @type {gluShaderUtil.DataType} */ var intBasicType; + /** @type {gluShaderUtil.DataType} */ var uintBasicType; + /** @type {gluVarType.VarType} */ var uintType; + /** @type {gluVarType.VarType} */ var intType; + + /** @type {string} */ var src; + src = '#version 300 es\n'; + + if (!shaderSpec.globalDeclarations.length > 0) + src += (shaderSpec.globalDeclarations + '\n'); + + for (var i = 0; i < shaderSpec.inputs.length; i++) + src += ('flat in ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, shaderSpec.inputs[i].name) + ';\n'); + + for (var outNdx = 0; outNdx < shaderSpec.outputs.length; ++outNdx) { + /** @type {glsShaderExecUtil.Symbol} */ var output = shaderSpec.outputs[outNdx]; + /** @type {number} */ var location = outLocationMap[output.name]; + /** @type {string} */ var outVarName = 'o_' + output.name; + /** @type {gluVarType.VariableDeclaration} */ var decl = new gluVarType.VariableDeclaration(output.varType, outVarName, gluVarType.Storage.STORAGE_OUT, undefined, new gluVarType.Layout(location)); + + DE_ASSERT(output.varType.isBasicType()); + + if (useIntOutputs && gluShaderUtil.isDataTypeFloatOrVec(output.varType.getBasicType())) { + vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType()); + uintBasicType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize) : gluShaderUtil.DataType.UINT; + uintType = gluVarType.newTypeBasic(uintBasicType, gluShaderUtil.precision.PRECISION_HIGHP); + + decl.varType = uintType; + src += (decl + ';\n'); + } else if (gluShaderUtil.isDataTypeBoolOrBVec(output.varType.getBasicType())) { + vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType()); + intBasicType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT; + intType = gluVarType.newTypeBasic(intBasicType, gluShaderUtil.precision.PRECISION_HIGHP); + + decl.varType = intType; + src += (decl + ';\n'); + } else if (gluShaderUtil.isDataTypeMatrix(output.varType.getBasicType())) { + vecSize = gluShaderUtil.getDataTypeMatrixNumRows(output.varType.getBasicType()); + numVecs = gluShaderUtil.getDataTypeMatrixNumColumns(output.varType.getBasicType()); + uintBasicType = gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize); + uintType = gluVarType.newTypeBasic(uintBasicType, gluShaderUtil.precision.PRECISION_HIGHP); + + decl.varType = uintType; + for (var vecNdx = 0; vecNdx < numVecs; ++vecNdx) { + decl.name = outVarName + '_' + (vecNdx); + decl.layout.location = location + vecNdx; + src += (decl + ';\n'); + } + } else //src += '';//glu::VariableDeclaration(output.varType, output.name, glu::STORAGE_OUT, glu::INTERPOLATION_LAST, location) << ";\n"; + src += new gluVarType.VariableDeclaration(output.varType, output.name, gluVarType.Storage.STORAGE_OUT, undefined, new gluVarType.Layout(location)) + ';\n'; + } + + src += '\nvoid main (void)\n{\n'; + + for (var i = 0; i < shaderSpec.outputs.length; i++) { + if ((useIntOutputs && gluShaderUtil.isDataTypeFloatOrVec(shaderSpec.outputs[i].varType.getBasicType())) || + gluShaderUtil.isDataTypeBoolOrBVec(shaderSpec.outputs[i].varType.getBasicType()) || + gluShaderUtil.isDataTypeMatrix(shaderSpec.outputs[i].varType.getBasicType())) + src += ('\t' + gluVarType.declareVariable(shaderSpec.outputs[i].varType, shaderSpec.outputs[i].name) + ';\n'); + } + + // Operation - indented to correct level. + // TODO: Add indenting + src += shaderSpec.source; + // { + // std::istringstream opSrc (shaderSpec.source); + // /** @type{number} */ var line; + // + // while (std::getline(opSrc, line)) + // src += ('\t' << line << '\n'); + // } + + for (var i = 0; i < shaderSpec.outputs.length; i++) { + if (useIntOutputs && gluShaderUtil.isDataTypeFloatOrVec(shaderSpec.outputs[i].varType.getBasicType())) + src += (' o_' + shaderSpec.outputs[i].name + ' = floatBitsToUint(' + shaderSpec.outputs[i].name + ');\n'); + else if (gluShaderUtil.isDataTypeMatrix(shaderSpec.outputs[i].varType.getBasicType())) { + numVecs = gluShaderUtil.getDataTypeMatrixNumColumns(shaderSpec.outputs[i].varType.getBasicType()); + + for (var vecNdx = 0; vecNdx < numVecs; ++vecNdx) + if (useIntOutputs) + src += ('\to_' + shaderSpec.outputs[i].name + '_' + vecNdx + ' = floatBitsToUint(' + shaderSpec.outputs[i].name + '[' + vecNdx + ']);\n'); + else + src += ('\to_' + shaderSpec.outputs[i].name + '_' + vecNdx + ' = ' + shaderSpec.outputs[i].name + '[' + vecNdx + '];\n'); + } else if (gluShaderUtil.isDataTypeBoolOrBVec(shaderSpec.outputs[i].varType.getBasicType())) { + vecSize = gluShaderUtil.getDataTypeScalarSize(shaderSpec.outputs[i].varType.getBasicType()); + intBasicType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT; + + src += ('\to_' + shaderSpec.outputs[i].name + ' = ' + gluShaderUtil.getDataTypeName(intBasicType) + '(' + shaderSpec.outputs[i].name + ');\n'); + } + } + + src += '}\n'; + + return src; + }; + + /** + * @param {Array} outputs + * @return {gluShaderProgram.TransformFeedbackVaryings} + */ + glsShaderExecUtil.getTFVaryings = function(outputs) { + var names = []; + for (var i = 0; i < outputs.length; i++) { + if (gluShaderUtil.isDataTypeBoolOrBVec(outputs[i].varType.getBasicType())) { + names.push('o_' + outputs[i].name); + } else { + names.push(outputs[i].name); + } + } + return new gluShaderProgram.TransformFeedbackVaryings(names); + }; + + // VertexProcessorExecutor (base class for vertex and geometry executors) + + /** + * @constructor + * @extends {glsShaderExecUtil.ShaderExecutor} + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + * @param {gluShaderProgram.ProgramSources} sources + */ + glsShaderExecUtil.VertexProcessorExecutor = function(shaderSpec, sources) { + sources.add(glsShaderExecUtil.getTFVaryings(shaderSpec.outputs)); + sources.add(new gluShaderProgram.TransformFeedbackMode(gl.INTERLEAVED_ATTRIBS)); + glsShaderExecUtil.ShaderExecutor.call(this, shaderSpec); + this.m_program = new gluShaderProgram.ShaderProgram(gl, sources); + }; + + setParentClass(glsShaderExecUtil.VertexProcessorExecutor, glsShaderExecUtil.ShaderExecutor); + + /** + * @return {boolean} + */ + glsShaderExecUtil.VertexProcessorExecutor.prototype.isOk = function() { + return this.m_program.isOk(); + }; + + /** + * @return {WebGLProgram} + */ + glsShaderExecUtil.VertexProcessorExecutor.prototype.getProgram = function() { + return this.m_program.getProgram(); + }; + + /** + * @param {Array<*>} arr + * @return {number} + */ + glsShaderExecUtil.computeTotalScalarSize = function(arr) { + /** @type {number} */ var size = 0; + for (var i = 0; i < arr.length; i++) + size += arr[i].varType.getScalarSize(); + return size; + }; + + /** + * @param {Array} ptr + * @param {number} colNdx + * @param {number} size Column size + * @return {Array} + */ + glsShaderExecUtil.getColumn = function(ptr, colNdx, size) { + var begin = colNdx * size; + var end = (colNdx + 1) * size; + return ptr.slice(begin, end); + }; + + glsShaderExecUtil.VertexProcessorExecutor.prototype.execute = function(numValues, inputs) { + /** @type {glsShaderExecUtil.Symbol} */ var symbol; + var outputs = []; + /** @type {boolean} */ var useTFObject = true; + /** @type {Array} */ var vertexArrays = []; + var transformFeedback = gl.createTransformFeedback(); + var outputBuffer = gl.createBuffer(); + + /** @type {number} */ var outputBufferStride = glsShaderExecUtil.computeTotalScalarSize(this.m_outputs) * 4; + + // Setup inputs. + for (var inputNdx = 0; inputNdx < this.m_inputs.length; inputNdx++) { + symbol = this.m_inputs[inputNdx]; + /*const void* */var ptr = inputs[inputNdx]; + /** @type {gluShaderUtil.DataType} */ var basicType = symbol.varType.getBasicType(); + /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(basicType); + + if (gluShaderUtil.isDataTypeFloatOrVec(basicType)) + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding(symbol.name, vecSize, numValues, 0, ptr)); + else if (gluShaderUtil.isDataTypeIntOrIVec(basicType)) + vertexArrays.push(gluDrawUtil.newInt32VertexArrayBinding(symbol.name, vecSize, numValues, 0, ptr)); + else if (gluShaderUtil.isDataTypeUintOrUVec(basicType)) + vertexArrays.push(gluDrawUtil.newUint32VertexArrayBinding(symbol.name, vecSize, numValues, 0, ptr)); + else if (gluShaderUtil.isDataTypeMatrix(basicType)) { + /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(basicType); + /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(basicType); + // A matrix consists of several (column-major) vectors. A buffer is created for + // every vector in gluDrawUtil.draw() below. Data in every buffer will be tightly + // packed. So the stride should be 0. This is different from the code in native + // deqp, which use only one buffer for a matrix, the data is interleaved. + /** @type {number} */ var stride = 0; + + for (var colNdx = 0; colNdx < numCols; ++colNdx) + vertexArrays.push(gluDrawUtil.newFloatColumnVertexArrayBinding(symbol.name, + colNdx, + numRows, + numValues, + stride, + glsShaderExecUtil.getColumn(ptr, colNdx, numRows * numValues))); + } else + DE_ASSERT(false); + } + + // Setup TF outputs. + if (useTFObject) + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, outputBuffer); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, outputBufferStride * numValues, gl.STREAM_READ); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, outputBuffer); + + // Draw with rasterization disabled. + gl.beginTransformFeedback(gl.POINTS); + gl.enable(gl.RASTERIZER_DISCARD); + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, + new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.POINTS, numValues)); + gl.disable(gl.RASTERIZER_DISCARD); + gl.endTransformFeedback(); + + // Read back data. + var result = new ArrayBuffer(outputBufferStride * numValues); + gl.getBufferSubData(gl.TRANSFORM_FEEDBACK_BUFFER, 0, new Uint8Array(result)); + /** @type {number} */ var curOffset = 0; // Offset in buffer in bytes. + + for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) { + symbol = this.m_outputs[outputNdx]; + /** @type {number} */ var scalarSize = symbol.varType.getScalarSize(); + var readPtr = new Uint8Array(result, curOffset); + + if (scalarSize * 4 === outputBufferStride) + outputs[outputNdx] = readPtr; + else { + var dstPtr = new Uint8Array(scalarSize * numValues * 4); + + for (var ndx = 0; ndx < numValues; ndx++) + for (var j = 0; j < scalarSize * 4; j++) { + dstPtr[scalarSize * 4 * ndx + j] = readPtr[ndx * outputBufferStride + j]; + } + outputs[outputNdx] = dstPtr; + } + curOffset += scalarSize * 4; + } + + if (useTFObject) + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, null); + + return outputs; + }; + + // VertexShaderExecutor + + /** + * @constructor + * @extends {glsShaderExecUtil.VertexProcessorExecutor} + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + */ + glsShaderExecUtil.VertexShaderExecutor = function(shaderSpec) { + var sources = gluShaderProgram.makeVtxFragSources(glsShaderExecUtil.generateVertexShader(shaderSpec), + glsShaderExecUtil.generateEmptyFragmentSource()); + glsShaderExecUtil.VertexProcessorExecutor.call(this, shaderSpec, sources); + }; + + setParentClass(glsShaderExecUtil.VertexShaderExecutor, glsShaderExecUtil.VertexProcessorExecutor); + + /** + * @constructor + * @extends {glsShaderExecUtil.ShaderExecutor} + * @param {glsShaderExecUtil.ShaderSpec} shaderSpec + */ + glsShaderExecUtil.FragmentShaderExecutor = function(shaderSpec) { + glsShaderExecUtil.ShaderExecutor.call(this, shaderSpec); + /** @type {Array} */ this.m_outLocationSymbols = []; + this.m_outLocationMap = glsShaderExecUtil.generateLocationMap(this.m_outputs, this.m_outLocationSymbols); + var sources = gluShaderProgram.makeVtxFragSources(glsShaderExecUtil.generatePassthroughVertexShader(shaderSpec, 'a_', ''), + glsShaderExecUtil.generateFragmentShader(shaderSpec, true, this.m_outLocationMap)); + this.m_program = new gluShaderProgram.ShaderProgram(gl, sources); + }; + + setParentClass(glsShaderExecUtil.FragmentShaderExecutor, glsShaderExecUtil.ShaderExecutor); + + /** + * @return {boolean} + */ + glsShaderExecUtil.FragmentShaderExecutor.prototype.isOk = function() { + return this.m_program.isOk(); + }; + + /** + * @return {WebGLProgram} + */ + glsShaderExecUtil.FragmentShaderExecutor.prototype.getProgram = function() { + return this.m_program.getProgram(); + }; + + /** + * @param {gluVarType.VarType} outputType + * @param {boolean} useIntOutputs + * @return {tcuTexture.TextureFormat} + */ + glsShaderExecUtil.getRenderbufferFormatForOutput = function(outputType, useIntOutputs) { + var channelOrderMap = [ + tcuTexture.ChannelOrder.R, + tcuTexture.ChannelOrder.RG, + tcuTexture.ChannelOrder.RGBA, // No RGB variants available. + tcuTexture.ChannelOrder.RGBA + ]; + + var basicType = outputType.getBasicType(); + var numComps = gluShaderUtil.getDataTypeNumComponents(basicType); + var channelType; + + switch (gluShaderUtil.getDataTypeScalarType(basicType)) { + case 'uint': channelType = tcuTexture.ChannelType.UNSIGNED_INT32; break; + case 'int': channelType = tcuTexture.ChannelType.SIGNED_INT32; break; + case 'bool': channelType = tcuTexture.ChannelType.SIGNED_INT32; break; + case 'float': channelType = useIntOutputs ? tcuTexture.ChannelType.UNSIGNED_INT32 : tcuTexture.ChannelType.FLOAT; break; + default: + throw new Error('Invalid output type ' + gluShaderUtil.getDataTypeScalarType(basicType)); + } + + return new tcuTexture.TextureFormat(channelOrderMap[numComps - 1], channelType); + }; + + glsShaderExecUtil.FragmentShaderExecutor.prototype.execute = function(numValues, inputs) { + /** @type {boolean} */ var useIntOutputs = true; + /** @type {glsShaderExecUtil.Symbol} */ var symbol; + var outputs = []; + var maxRenderbufferSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)); + /** @type {number} */ var framebufferW = Math.min(maxRenderbufferSize, numValues); + /** @type {number} */ var framebufferH = Math.ceil(numValues / framebufferW); + + var framebuffer = gl.createFramebuffer(); + var renderbuffers = []; + for (var i = 0; i < this.m_outLocationSymbols.length; i++) + renderbuffers.push(gl.createRenderbuffer()); + + var vertexArrays = []; + var positions = []; + + if (framebufferH > maxRenderbufferSize) + throw new Error('Value count is too high for maximum supported renderbuffer size'); + + // Compute positions - 1px points are used to drive fragment shading. + for (var valNdx = 0; valNdx < numValues; valNdx++) { + /** @type {number} */ var ix = valNdx % framebufferW; + /** @type {number} */ var iy = Math.floor(valNdx / framebufferW); + var fx = -1 + 2 * (ix + 0.5) / framebufferW; + var fy = -1 + 2 * (iy + 0.5) / framebufferH; + + positions[2 * valNdx] = fx; + positions[2 * valNdx + 1] = fy; + } + + // Vertex inputs. + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding('a_position', 2, numValues, 0, positions)); + + for (var inputNdx = 0; inputNdx < this.m_inputs.length; inputNdx++) { + symbol = this.m_inputs[inputNdx]; + var attribName = 'a_' + symbol.name; + var ptr = inputs[inputNdx]; + /** @type {gluShaderUtil.DataType} */ var basicType = symbol.varType.getBasicType(); + /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(basicType); + + if (gluShaderUtil.isDataTypeFloatOrVec(basicType)) + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding(attribName, vecSize, numValues, 0, ptr)); + else if (gluShaderUtil.isDataTypeIntOrIVec(basicType)) + vertexArrays.push(gluDrawUtil.newInt32VertexArrayBinding(attribName, vecSize, numValues, 0, ptr)); + else if (gluShaderUtil.isDataTypeUintOrUVec(basicType)) + vertexArrays.push(gluDrawUtil.newUint32VertexArrayBinding(attribName, vecSize, numValues, 0, ptr)); + else if (gluShaderUtil.isDataTypeMatrix(basicType)) { + var numRows = gluShaderUtil.getDataTypeMatrixNumRows(basicType); + var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(basicType); + // A matrix consists of several (column-major) vectors. A buffer is created for + // every vector in gluDrawUtil.draw() below. Data in every buffer will be tightly + // packed. So the stride should be 0. This is different from the code in native + // deqp, which use only one buffer for a matrix, the data is interleaved. + var stride = 0; + + for (var colNdx = 0; colNdx < numCols; ++colNdx) + vertexArrays.push(gluDrawUtil.newFloatColumnVertexArrayBinding(attribName, + colNdx, + numRows, + numValues, + stride, + glsShaderExecUtil.getColumn(ptr, colNdx, numRows * numValues))); + } else + DE_ASSERT(false); + } + + // Construct framebuffer. + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + + for (var outNdx = 0; outNdx < this.m_outLocationSymbols.length; ++outNdx) { + symbol = this.m_outLocationSymbols[outNdx]; + var renderbuffer = renderbuffers[outNdx]; + var format = gluTextureUtil.getInternalFormat(glsShaderExecUtil.getRenderbufferFormatForOutput(symbol.varType, useIntOutputs)); + + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, format, framebufferW, framebufferH); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + outNdx, gl.RENDERBUFFER, renderbuffer); + } + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true); + + var drawBuffers = []; + for (var ndx = 0; ndx < this.m_outLocationSymbols.length; ndx++) + drawBuffers[ndx] = gl.COLOR_ATTACHMENT0 + ndx; + gl.drawBuffers(drawBuffers); + + // Render + gl.viewport(0, 0, framebufferW, framebufferH); + gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, + new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.POINTS, numValues)); + + // Read back pixels. + + // \todo [2013-08-07 pyry] Some fast-paths could be added here. + + for (var outNdx = 0; outNdx < this.m_outputs.length; ++outNdx) { + symbol = this.m_outputs[outNdx]; + /** @type {number} */ var outSize = symbol.varType.getScalarSize(); + /** @type {number} */ var outVecSize = gluShaderUtil.getDataTypeNumComponents(symbol.varType.getBasicType()); + /** @type {number} */ var outNumLocs = gluShaderUtil.getDataTypeNumLocations(symbol.varType.getBasicType()); + var format = glsShaderExecUtil.getRenderbufferFormatForOutput(symbol.varType, useIntOutputs); + var readFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, format.type); + var transferFormat = gluTextureUtil.getTransferFormat(readFormat); + /** @type {number} */ var outLocation = this.m_outLocationMap[symbol.name]; + var tmpBuf = new tcuTexture.TextureLevel(readFormat, framebufferW, framebufferH); + + for (var locNdx = 0; locNdx < outNumLocs; ++locNdx) { + gl.readBuffer(gl.COLOR_ATTACHMENT0 + outLocation + locNdx); + gl.readPixels(0, 0, framebufferW, framebufferH, transferFormat.format, transferFormat.dataType, tmpBuf.getAccess().getDataPtr()); + + if (outSize == 4 && outNumLocs == 1) { + outputs[outNdx] = new Uint8Array(tmpBuf.getAccess().getBuffer()); + } else { + if (locNdx == 0) + outputs[outNdx] = new Uint32Array(numValues * outVecSize); + var srcPtr = new Uint32Array(tmpBuf.getAccess().getBuffer()); + for (var valNdx = 0; valNdx < numValues; valNdx++) { + var srcOffset = valNdx * 4; + var dstOffset = outSize * valNdx + outVecSize * locNdx; + for (var j = 0; j < outVecSize; j++) + outputs[outNdx][dstOffset + j] = srcPtr[srcOffset + j]; + } + } + } + } + + // \todo [2013-08-07 pyry] Clear draw buffers & viewport? + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + return outputs; + }; + + glsShaderExecUtil.generateLocationMap = function(symbols, locationSymbols) { + var ret = []; + locationSymbols.length = 0; + var location = 0; + + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + var numLocations = gluShaderUtil.getDataTypeNumLocations(symbol.varType.getBasicType()); + ret[symbol.name] = location; + location += numLocations; + + for (var ndx = 0; ndx < numLocations; ++ndx) + locationSymbols.push(symbol); + } + + return ret; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js new file mode 100644 index 000000000..27f86e055 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js @@ -0,0 +1,1114 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsShaderLibrary'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('modules.shared.glsShaderLibraryCase'); + +goog.scope(function() { + +var glsShaderLibrary = modules.shared.glsShaderLibrary; +var tcuTestCase = framework.common.tcuTestCase; +var glsShaderLibraryCase = modules.shared.glsShaderLibraryCase; +var gluShaderUtil = framework.opengl.gluShaderUtil; + + glsShaderLibrary.generateTestCases = function() { + /** @type {glsShaderLibrary.Parser} */ var parser = new glsShaderLibrary.Parser(); + try { + /** @type {Object} */ var state = tcuTestCase.runner; + var tree = parser.parse(state.testFile); + var rootTest = tcuTestCase.newTest(state.testName, 'Top level'); + rootTest.setChildren(tree); + state.setRoot(rootTest); + } + catch (err) { + bufferedLogToConsole(err); + testFailed('Failed to parse shader test case file'); + return false; + } + return true; + }; + + glsShaderLibrary.processTestFile = function() { + if (glsShaderLibrary.generateTestCases()) { + tcuTestCase.runner.runCallback(glsShaderLibraryCase.runTestCases); + } else { + tcuTestCase.runner.terminate(); + } + }; + + glsShaderLibrary.isWhitespace = function(value) { + return /^[ \t\r\n]+$/.test(value); + }; + glsShaderLibrary.isEOL = function(value) { + return /^[\r\n]+$/.test(value); + }; + glsShaderLibrary.isAlpha = function(value) { + return /^[a-zA-Z]$/.test(value); + }; + glsShaderLibrary.isNumeric = function(value) { + return /^[0-9]$/.test(value); + }; + glsShaderLibrary.isCaseNameChar = function(value) { + return /^[a-zA-Z0-9_\-\.]$/.test(value); + }; + + /** + * Removes however many indents there are on the first line from all lines. + * @param {string} str + * @return {string} output + */ + glsShaderLibrary.removeExtraIndentation = function(str) { + return glsShaderLibrary.removeExtraIndentationArray( + str.split(/\r\n|\r|\n/) + ).join('\n'); + }; + + /** + * Returns an array of strings without indentation. + * @param {Array} arr + * @return {Array} output + */ + glsShaderLibrary.removeExtraIndentationArray = function(arr) { + /** @type {Array} */ var output = []; + + if (arr.length) { + + /** @type {number} */ var numIndentChars = 0; + for (var i = 0; i < arr[0].length && glsShaderLibrary.isWhitespace(arr[0].charAt(i)); ++i) { + numIndentChars += arr[0].charAt(i) === '\t' ? 4 : 1; + } + + for (var i = 0; i < arr.length; ++i) { + /** @type {number} */ var removed = 0; + /** @type {number} */ var j; + // Some tests are indented inconsistently, so we have to check for non-whitespace characters here. + for (j = 0; removed < numIndentChars && j < arr[i].length && glsShaderLibrary.isWhitespace(arr[i].charAt(j)); ++j) { + removed += (arr[i].charAt(j) === '\t' ? 4 : 1); + } + + output.push(arr[i].substr(j, arr[i].length - j)); + } + + } + + return output; + }; + + glsShaderLibrary.de_assert = function(condition) { + if (!condition) { + throw Error(); + } + }; + + /** + * @param {string} str + * @param {string} endstr end of string character + * @param {boolean=} trimFront trim leading whitespace + * @return {string} str + * @private + */ + glsShaderLibrary.parseStringLiteralHelper = function(str, endstr, trimFront) { + trimFront = trimFront || false; + + /** @type {number} */ var index_end = 0; + // isolate the string + do { + index_end = str.indexOf(endstr, index_end + 1); + } while (index_end >= 0 && str.charAt(index_end - 1) === '\\'); + + if (index_end <= 0) { + index_end = str.length; + } + + // strip quotes, replace \n and \t with nl and tabs respectively + str = str.substr(endstr.length, index_end - endstr.length); + if (trimFront) + str = str.replace(/^\s*\n/, ''); + var result = ''; + var i = 0; + while (str[i] != undefined) { + if (str[i] == '\\') { + switch (str[i + 1]) { + case undefined: + break; + case 'n': + result += '\n'; + break; + case 't': + result += '\t'; + break; + default: + result += str[i + 1]; + break; + } + i += 2; + } else { + result += str[i]; + i++; + } + } + return result; + + }; + + /** + * glsShaderLibrary.Parser class + * @constructor + */ + glsShaderLibrary.Parser = function() { + + /* data members */ + + /** + * The Token constants + * @enum {number} + */ + var Token = { + TOKEN_INVALID: 0, + TOKEN_EOF: 1, + TOKEN_STRING: 2, + TOKEN_SHADER_SOURCE: 3, + + TOKEN_INT_LITERAL: 4, + TOKEN_FLOAT_LITERAL: 5, + + // identifiers + TOKEN_IDENTIFIER: 6, + TOKEN_TRUE: 7, + TOKEN_FALSE: 8, + TOKEN_DESC: 9, + TOKEN_EXPECT: 10, + TOKEN_GROUP: 11, + TOKEN_CASE: 12, + TOKEN_END: 13, + TOKEN_VALUES: 14, + TOKEN_BOTH: 15, + TOKEN_VERTEX: 26, + TOKEN_FRAGMENT: 17, + TOKEN_UNIFORM: 18, + TOKEN_INPUT: 19, + TOKEN_OUTPUT: 20, + TOKEN_FLOAT: 21, + TOKEN_FLOAT_VEC2: 22, + TOKEN_FLOAT_VEC3: 23, + TOKEN_FLOAT_VEC4: 24, + TOKEN_FLOAT_MAT2: 25, + TOKEN_FLOAT_MAT2X3: 26, + TOKEN_FLOAT_MAT2X4: 27, + TOKEN_FLOAT_MAT3X2: 28, + TOKEN_FLOAT_MAT3: 29, + TOKEN_FLOAT_MAT3X4: 30, + TOKEN_FLOAT_MAT4X2: 31, + TOKEN_FLOAT_MAT4X3: 32, + TOKEN_FLOAT_MAT4: 33, + TOKEN_INT: 34, + TOKEN_INT_VEC2: 35, + TOKEN_INT_VEC3: 36, + TOKEN_INT_VEC4: 37, + TOKEN_UINT: 38, + TOKEN_UINT_VEC2: 39, + TOKEN_UINT_VEC3: 40, + TOKEN_UINT_VEC4: 41, + TOKEN_BOOL: 42, + TOKEN_BOOL_VEC2: 43, + TOKEN_BOOL_VEC3: 44, + TOKEN_BOOL_VEC4: 45, + TOKEN_VERSION: 46, + + // symbols + TOKEN_ASSIGN: 47, + TOKEN_PLUS: 48, + TOKEN_MINUS: 49, + TOKEN_COMMA: 50, + TOKEN_VERTICAL_BAR: 51, + TOKEN_SEMI_COLON: 52, + TOKEN_LEFT_PAREN: 53, + TOKEN_RIGHT_PAREN: 54, + TOKEN_LEFT_BRACKET: 55, + TOKEN_RIGHT_BRACKET: 56, + TOKEN_LEFT_BRACE: 57, + TOKEN_RIGHT_BRACE: 58, + + TOKEN_LAST: 59 + }; + + /** @type {string} */ var m_input = ''; + /** @type {number} */ var m_curPtr = 0; + /** @type {number} */ var m_curToken;// = Token.TOKEN_INVALID; + /** @type {string} */ var m_curTokenStr = ''; + + /* function members */ + this.parse = function(input) { + + // initialise parser + m_input = input; + m_curPtr = 0; + m_curToken = Token.TOKEN_INVALID; + m_curTokenStr = ''; + advanceToken(); + + /** @type {Array} */ var nodeList = []; + + for (;;) { + + if (m_curToken === Token.TOKEN_CASE) { + parseShaderCase(nodeList); + } else if (m_curToken === Token.TOKEN_GROUP) { + parseShaderGroup(nodeList); + } else if (m_curToken === Token.TOKEN_EOF) { + break; + } else { + // throw Error("invalid token encountered at main level: '" + m_curTokenStr + "'"); + testFailed("invalid token encountered at main level: '" + m_curTokenStr + "'"); + tcuTestCase.runner.terminate(); + } + + } + + return nodeList; + + }; + + /** + * ensures that the token exists + * otherwise it returns the corresponding token's name depending on enum number value + * @param {number} id + * @return {string} name + */ + var resolveTokenName = function(id) { + for (var name in Token) { + if (Token[name] === id) return name; + } + return 'TOKEN_UNKNOWN'; + }; + + /** + * Throws an error which contains the passed string + * @param {string} errorStr that contains an error to notify + * @return {string} error + */ + var parseError = function(errorStr) { + // abort + throw 'glsShaderLibrary.Parser error: ' + errorStr + ' near ' + m_input.substr(m_curPtr, m_curPtr + 80); + }; + + /** + * Converts string into float + * @param {string} str + * @return {number} + */ + var parseFloatLiteral = function(str) { + return parseFloat(str); + }; + + /** + * Converts string into integer + * @param {string} str + * @return {number} + */ + var parseIntLiteral = function(str) { + return parseInt(str, 10); + }; + var parseStringLiteral = function(str) { + /** + * @type {string} + * find delimitor + */ var endchar = str.substr(0, 1); + return glsShaderLibrary.parseStringLiteralHelper(str, endchar); + }; + var parseShaderSource = function(str) { + // similar to parse literal, delimitors are two double quotes ("") + return glsShaderLibrary.removeExtraIndentation( + glsShaderLibrary.parseStringLiteralHelper(str, '""', true) + ); + }; + + var advanceTokenWorker = function() { + + // Skip old token + m_curPtr += m_curTokenStr.length; + + // Reset token (for safety). + m_curToken = Token.TOKEN_INVALID; + m_curTokenStr = ''; + + // Eat whitespace & comments while they last. + for (;;) { + + while (glsShaderLibrary.isWhitespace(m_input.charAt(m_curPtr))) ++m_curPtr; + + // check for EOL comment + if (m_input.charAt(m_curPtr) === '#') { + // if m_input is to be an array of lines then this probably wont work very well + while ( + m_curPtr < m_input.length && + !glsShaderLibrary.isEOL(m_input.charAt(m_curPtr)) + ) ++m_curPtr; + } else { + break; + } + + } + + if (m_curPtr >= m_input.length) { + + m_curToken = Token.TOKEN_EOF; + m_curTokenStr = ''; + + } else if (glsShaderLibrary.isAlpha(m_input.charAt(m_curPtr))) { + + /** @type {number} */ var end = m_curPtr + 1; + while (glsShaderLibrary.isCaseNameChar(m_input.charAt(end))) ++end; + + m_curTokenStr = m_input.substr(m_curPtr, end - m_curPtr); + + m_curToken = (function() { + // consider reimplementing with a binary search + switch (m_curTokenStr) { + case 'true': return Token.TOKEN_TRUE; + case 'false': return Token.TOKEN_FALSE; + case 'desc': return Token.TOKEN_DESC; + case 'expect': return Token.TOKEN_EXPECT; + case 'group': return Token.TOKEN_GROUP; + case 'case': return Token.TOKEN_CASE; + case 'end': return Token.TOKEN_END; + case 'values': return Token.TOKEN_VALUES; + case 'both': return Token.TOKEN_BOTH; + case 'vertex': return Token.TOKEN_VERTEX; + case 'fragment': return Token.TOKEN_FRAGMENT; + case 'uniform': return Token.TOKEN_UNIFORM; + case 'input': return Token.TOKEN_INPUT; + case 'output': return Token.TOKEN_OUTPUT; + case 'float': return Token.TOKEN_FLOAT; + case 'vec2': return Token.TOKEN_FLOAT_VEC2; + case 'vec3': return Token.TOKEN_FLOAT_VEC3; + case 'vec4': return Token.TOKEN_FLOAT_VEC4; + case 'mat2': return Token.TOKEN_FLOAT_MAT2; + case 'mat2x3': return Token.TOKEN_FLOAT_MAT2X3; + case 'mat2x4': return Token.TOKEN_FLOAT_MAT2X4; + case 'mat3x2': return Token.TOKEN_FLOAT_MAT3X2; + case 'mat3': return Token.TOKEN_FLOAT_MAT3; + case 'mat3x4': return Token.TOKEN_FLOAT_MAT3X4; + case 'mat4x2': return Token.TOKEN_FLOAT_MAT4X2; + case 'mat4x3': return Token.TOKEN_FLOAT_MAT4X3; + case 'mat4': return Token.TOKEN_FLOAT_MAT4; + case 'int': return Token.TOKEN_INT; + case 'ivec2': return Token.TOKEN_INT_VEC2; + case 'ivec3': return Token.TOKEN_INT_VEC3; + case 'ivec4': return Token.TOKEN_INT_VEC4; + case 'uint': return Token.TOKEN_UINT; + case 'uvec2': return Token.TOKEN_UINT_VEC2; + case 'uvec3': return Token.TOKEN_UINT_VEC3; + case 'uvec4': return Token.TOKEN_UINT_VEC4; + case 'bool': return Token.TOKEN_BOOL; + case 'bvec2': return Token.TOKEN_BOOL_VEC2; + case 'bvec3': return Token.TOKEN_BOOL_VEC3; + case 'bvec4': return Token.TOKEN_BOOL_VEC4; + case 'version': return Token.TOKEN_VERSION; + default: return Token.TOKEN_IDENTIFIER; + } + }()); + + } else if (glsShaderLibrary.isNumeric(m_input.charAt(m_curPtr))) { + + /** @type {number} */ var p = m_curPtr; + while (glsShaderLibrary.isNumeric(m_input.charAt(p))) ++p; + + if (m_input.charAt(p) === '.') { // float + + ++p; + while (glsShaderLibrary.isNumeric(m_input.charAt(p))) ++p; + + if (m_input.charAt(p) === 'e' || m_input.charAt(p) === 'E') { + + ++p; + if (m_input.charAt(p) === '+' || m_input.charAt(p) === '-') ++p; + + glsShaderLibrary.de_assert(p < m_input.length && glsShaderLibrary.isNumeric(m_input.charAt(p))); + while (glsShaderLibrary.isNumeric(m_input.charAt(p))) ++p; + + } + + m_curToken = Token.TOKEN_FLOAT_LITERAL; + m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr); + + } else { + + m_curToken = Token.TOKEN_INT_LITERAL; + m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr); + + } + + } else if (m_input.charAt(m_curPtr) === '"' && m_input.charAt(m_curPtr + 1) === '"') { // shader source + + var p = m_curPtr + 2; + + while (m_input.charAt(p) != '"' || m_input.charAt(p + 1) != '"') { + glsShaderLibrary.de_assert(p < m_input.length); + if (m_input.charAt(p) === '\\') { + glsShaderLibrary.de_assert(p + 1 < m_input.length); + p += 2; + } else { + ++p; + } + } + p += 2; + + m_curToken = Token.TOKEN_SHADER_SOURCE; + m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr); + + } else if (m_input.charAt(m_curPtr) === '"' || m_input.charAt(m_curPtr) === "'") { + + /** @type {string} */ var delimitor = m_input.charAt(m_curPtr); + var p = m_curPtr + 1; + + while (m_input.charAt(p) != delimitor) { + + glsShaderLibrary.de_assert(p < m_input.length); + if (m_input.charAt(p) === '\\') { + glsShaderLibrary.de_assert(p + 1 < m_input.length); + p += 2; + } else { + ++p; + } + + } + ++p; + + m_curToken = Token.TOKEN_STRING; + m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr); + + } else { + + m_curTokenStr = m_input.charAt(m_curPtr); + m_curToken = (function() { + // consider reimplementing with a binary search + switch (m_curTokenStr) { + case '=': return Token.TOKEN_ASSIGN; + case '+': return Token.TOKEN_PLUS; + case '-': return Token.TOKEN_MINUS; + case ',': return Token.TOKEN_COMMA; + case '|': return Token.TOKEN_VERTICAL_BAR; + case ';': return Token.TOKEN_SEMI_COLON; + case '(': return Token.TOKEN_LEFT_PAREN; + case ')': return Token.TOKEN_RIGHT_PAREN; + case '[': return Token.TOKEN_LEFT_BRACKET; + case ']': return Token.TOKEN_RIGHT_BRACKET; + case '{': return Token.TOKEN_LEFT_BRACE; + case '}': return Token.TOKEN_RIGHT_BRACE; + + default: return Token.TOKEN_INVALID; + } + }()); + + } + + }; + + /** + * @return {Object.} + */ + var advanceTokenTester = function(input, current_index) { + m_input = input; + m_curPtr = current_index; + m_curTokenStr = ''; + advanceTokenWorker(); + return { + /** @type {number} */ idType: m_curToken, + /** @type {string} */ name: resolveTokenName(m_curToken), + /** @type {string} */ value: m_curTokenStr + }; + }; + + /** + * @param {Token=} tokenAssumed + */ + var advanceToken = function(tokenAssumed) { + if (typeof(tokenAssumed) !== 'undefined') { + assumeToken(tokenAssumed); + } + advanceTokenWorker(); + }; + var assumeToken = function(token) { + + if (m_curToken != token) { + // parse error + /** @type {string} */ var msg = "unexpected token '" + m_curTokenStr + "', expecting '" + getTokenName(token) + "'"; + throw Error('Parse Error. ' + msg + ' near ' + m_curPtr + ' ...'); + } + }; + var mapDataTypeToken = function(token) { + switch (token) { + case Token.TOKEN_FLOAT: return gluShaderUtil.DataType.FLOAT; + case Token.TOKEN_FLOAT_VEC2: return gluShaderUtil.DataType.FLOAT_VEC2; + case Token.TOKEN_FLOAT_VEC3: return gluShaderUtil.DataType.FLOAT_VEC3; + case Token.TOKEN_FLOAT_VEC4: return gluShaderUtil.DataType.FLOAT_VEC4; + case Token.TOKEN_FLOAT_MAT2: return gluShaderUtil.DataType.FLOAT_MAT2; + case Token.TOKEN_FLOAT_MAT2X3: return gluShaderUtil.DataType.FLOAT_MAT2X3; + case Token.TOKEN_FLOAT_MAT2X4: return gluShaderUtil.DataType.FLOAT_MAT2X4; + case Token.TOKEN_FLOAT_MAT3X2: return gluShaderUtil.DataType.FLOAT_MAT3X2; + case Token.TOKEN_FLOAT_MAT3: return gluShaderUtil.DataType.FLOAT_MAT3; + case Token.TOKEN_FLOAT_MAT3X4: return gluShaderUtil.DataType.FLOAT_MAT3X4; + case Token.TOKEN_FLOAT_MAT4X2: return gluShaderUtil.DataType.FLOAT_MAT4X2; + case Token.TOKEN_FLOAT_MAT4X3: return gluShaderUtil.DataType.FLOAT_MAT4X3; + case Token.TOKEN_FLOAT_MAT4: return gluShaderUtil.DataType.FLOAT_MAT4; + case Token.TOKEN_INT: return gluShaderUtil.DataType.INT; + case Token.TOKEN_INT_VEC2: return gluShaderUtil.DataType.INT_VEC2; + case Token.TOKEN_INT_VEC3: return gluShaderUtil.DataType.INT_VEC3; + case Token.TOKEN_INT_VEC4: return gluShaderUtil.DataType.INT_VEC4; + case Token.TOKEN_UINT: return gluShaderUtil.DataType.UINT; + case Token.TOKEN_UINT_VEC2: return gluShaderUtil.DataType.UINT_VEC2; + case Token.TOKEN_UINT_VEC3: return gluShaderUtil.DataType.UINT_VEC3; + case Token.TOKEN_UINT_VEC4: return gluShaderUtil.DataType.UINT_VEC4; + case Token.TOKEN_BOOL: return gluShaderUtil.DataType.BOOL; + case Token.TOKEN_BOOL_VEC2: return gluShaderUtil.DataType.BOOL_VEC2; + case Token.TOKEN_BOOL_VEC3: return gluShaderUtil.DataType.BOOL_VEC3; + case Token.TOKEN_BOOL_VEC4: return gluShaderUtil.DataType.BOOL_VEC4; + default: return gluShaderUtil.DataType.INVALID; + } + }; + + /** + * Returns the corresponding token's name depending on enum number value + * @param {number} token + * @return {string} + */ + var getTokenName = function(token) { + switch (token) { + case Token.TOKEN_INVALID: return ''; + case Token.TOKEN_EOF: return ''; + case Token.TOKEN_STRING: return ''; + case Token.TOKEN_SHADER_SOURCE: return 'source'; + + case Token.TOKEN_INT_LITERAL: return ''; + case Token.TOKEN_FLOAT_LITERAL: return ''; + + // identifiers + case Token.TOKEN_IDENTIFIER: return ''; + case Token.TOKEN_TRUE: return 'true'; + case Token.TOKEN_FALSE: return 'false'; + case Token.TOKEN_DESC: return 'desc'; + case Token.TOKEN_EXPECT: return 'expect'; + case Token.TOKEN_GROUP: return 'group'; + case Token.TOKEN_CASE: return 'case'; + case Token.TOKEN_END: return 'end'; + case Token.TOKEN_VALUES: return 'values'; + case Token.TOKEN_BOTH: return 'both'; + case Token.TOKEN_VERTEX: return 'vertex'; + case Token.TOKEN_FRAGMENT: return 'fragment'; + case Token.TOKEN_UNIFORM: return 'uniform'; + case Token.TOKEN_INPUT: return 'input'; + case Token.TOKEN_OUTPUT: return 'output'; + case Token.TOKEN_FLOAT: return 'float'; + case Token.TOKEN_FLOAT_VEC2: return 'vec2'; + case Token.TOKEN_FLOAT_VEC3: return 'vec3'; + case Token.TOKEN_FLOAT_VEC4: return 'vec4'; + case Token.TOKEN_FLOAT_MAT2: return 'mat2'; + case Token.TOKEN_FLOAT_MAT2X3: return 'mat2x3'; + case Token.TOKEN_FLOAT_MAT2X4: return 'mat2x4'; + case Token.TOKEN_FLOAT_MAT3X2: return 'mat3x2'; + case Token.TOKEN_FLOAT_MAT3: return 'mat3'; + case Token.TOKEN_FLOAT_MAT3X4: return 'mat3x4'; + case Token.TOKEN_FLOAT_MAT4X2: return 'mat4x2'; + case Token.TOKEN_FLOAT_MAT4X3: return 'mat4x3'; + case Token.TOKEN_FLOAT_MAT4: return 'mat4'; + case Token.TOKEN_INT: return 'int'; + case Token.TOKEN_INT_VEC2: return 'ivec2'; + case Token.TOKEN_INT_VEC3: return 'ivec3'; + case Token.TOKEN_INT_VEC4: return 'ivec4'; + case Token.TOKEN_UINT: return 'uint'; + case Token.TOKEN_UINT_VEC2: return 'uvec2'; + case Token.TOKEN_UINT_VEC3: return 'uvec3'; + case Token.TOKEN_UINT_VEC4: return 'uvec4'; + case Token.TOKEN_BOOL: return 'bool'; + case Token.TOKEN_BOOL_VEC2: return 'bvec2'; + case Token.TOKEN_BOOL_VEC3: return 'bvec3'; + case Token.TOKEN_BOOL_VEC4: return 'bvec4'; + + case Token.TOKEN_ASSIGN: return '='; + case Token.TOKEN_PLUS: return '+'; + case Token.TOKEN_MINUS: return '-'; + case Token.TOKEN_COMMA: return ','; + case Token.TOKEN_VERTICAL_BAR: return '|'; + case Token.TOKEN_SEMI_COLON: return ';'; + case Token.TOKEN_LEFT_PAREN: return '('; + case Token.TOKEN_RIGHT_PAREN: return ')'; + case Token.TOKEN_LEFT_BRACKET: return '['; + case Token.TOKEN_RIGHT_BRACKET: return ']'; + case Token.TOKEN_LEFT_BRACE: return ' {'; + case Token.TOKEN_RIGHT_BRACE: return '}'; + + default: return ''; + } + }; + + /** + * @param {?gluShaderUtil.DataType} expectedDataType + * @param {Object} result + */ + var parseValueElement = function(expectedDataType, result) { + /** @type {?string} */ var scalarType = null; + /** @type {number} */ var scalarSize = 0; + if (expectedDataType) { + scalarType = gluShaderUtil.getDataTypeScalarType(expectedDataType); + scalarSize = gluShaderUtil.getDataTypeScalarSize(expectedDataType); + } + + /** @type {Array} */ var elems = []; + + if (scalarSize > 1) { + glsShaderLibrary.de_assert(mapDataTypeToken(m_curToken) === expectedDataType); + advanceToken(); // data type(float, vec2, etc.) + advanceToken(Token.TOKEN_LEFT_PAREN); + } + + for (var i = 0; i < scalarSize; ++i) { + if (scalarType === 'float') { + + /** @type {number} */ var signMult = 1.0; + if (m_curToken === Token.TOKEN_MINUS) { + signMult = -1.0; + advanceToken(); + } + + assumeToken(Token.TOKEN_FLOAT_LITERAL); + elems.push(signMult * parseFloatLiteral(m_curTokenStr)); + advanceToken(Token.TOKEN_FLOAT_LITERAL); + + } else if (scalarType === 'int' || scalarType === 'uint') { + + var signMult = 1; + if (m_curToken === Token.TOKEN_MINUS) { + signMult = -1; + advanceToken(); + } + + assumeToken(Token.TOKEN_INT_LITERAL); + elems.push(signMult * parseIntLiteral(m_curTokenStr)); + advanceToken(Token.TOKEN_INT_LITERAL); + + } else { + + glsShaderLibrary.de_assert(scalarType === 'bool'); + elems.push(m_curToken === Token.TOKEN_TRUE); + if (m_curToken != Token.TOKEN_TRUE && m_curToken != Token.TOKEN_FALSE) { + throw Error('unexpected token, expecting bool: ' + m_curTokenStr); + } + advanceToken(); // true/false + + } + + if (i != (scalarSize - 1)) { + advanceToken(Token.TOKEN_COMMA); + } + } + + if (scalarSize > 1) { + advanceToken(Token.TOKEN_RIGHT_PAREN); + } + + for (var i = 0; i < elems.length; i++) + result.elements.push(elems[i]); + + }; + + /** + * @param {Object.} valueBlock + */ + var parseValue = function(valueBlock) { + + /** + * @type {Object} + */ + var result = { + /** @type {?gluShaderUtil.DataType} */ dataType: null, + /** @type {?glsShaderLibraryCase.shaderCase} */ storageType: null, + /** @type {?string} */ valueName: null, + /** @type {Array} */ elements: [] + }; + + // parse storage + switch (m_curToken) { + case Token.TOKEN_UNIFORM: + result.storageType = glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM; + break; + case Token.TOKEN_INPUT: + result.storageType = glsShaderLibraryCase.shaderCase.STORAGE_INPUT; + break; + case Token.TOKEN_OUTPUT: + result.storageType = glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT; + break; + default: + throw Error('unexpected token encountered when parsing value classifier'); + break; + } + advanceToken(); + + // parse data type + result.dataType = mapDataTypeToken(m_curToken); + if (result.dataType === gluShaderUtil.DataType.INVALID) { + throw Error('unexpected token when parsing value data type: ' + m_curTokenStr); + } + advanceToken(); + + // parse value name + if (m_curToken === Token.TOKEN_IDENTIFIER) { + result.valueName = m_curTokenStr; + } else if (m_curToken === Token.TOKEN_STRING) { + result.valueName = parseStringLiteral(m_curTokenStr); + } else { + throw Error('unexpected token when parsing value name: ' + m_curTokenStr); + } + advanceToken(); + + // parse assignment operator. + advanceToken(Token.TOKEN_ASSIGN); + + // parse actual value + if (m_curToken === Token.TOKEN_LEFT_BRACKET) { // value list + advanceToken(Token.TOKEN_LEFT_BRACKET); + result.arrayLength = 0; + + for (;;) { + parseValueElement(result.dataType, result); + result.arrayLength += 1; + + if (m_curToken === Token.TOKEN_RIGHT_BRACKET) { + break; + } else if (m_curToken === Token.TOKEN_VERTICAL_BAR) { // pipe? + advanceToken(); + continue; + } else { + throw Error('unexpected token in value element array: ' + m_curTokenStr); + } + } + + advanceToken(Token.TOKEN_RIGHT_BRACKET); + + } else { // arrays, single elements + parseValueElement(result.dataType, result); + result.arrayLength = 1; + } + + advanceToken(Token.TOKEN_SEMI_COLON); + + valueBlock.values.push(result); + + }; + + /** + * @param {Object.} valueBlock + */ + var parseValueBlock = function(valueBlock) { + + advanceToken(Token.TOKEN_VALUES); + advanceToken(Token.TOKEN_LEFT_BRACE); + + for (;;) { + if ( + m_curToken === Token.TOKEN_UNIFORM || + m_curToken === Token.TOKEN_INPUT || + m_curToken === Token.TOKEN_OUTPUT + ) { + parseValue(valueBlock); + } else if (m_curToken === Token.TOKEN_RIGHT_BRACE) { + break; + } else { + throw Error('unexpected( token when parsing a value block: ' + m_curTokenStr); + } + } + + advanceToken(Token.TOKEN_RIGHT_BRACE); + + /** @type {number} */ var arrayLength = 1; + // compute combined array length of value block. + for (var i = 0; i < valueBlock.values.length; ++i) { + if (valueBlock.values[i].arrayLength > 1) { + glsShaderLibrary.de_assert(arrayLength === 1 || arrayLength === valueBlock.values[i].arrayLength); + arrayLength = valueBlock.values[i].arrayLength; + } + } + + valueBlock.arrayLength = arrayLength; + + }; + + /** + * @param {Array} shaderNodeList + */ + var parseShaderCase = function(shaderNodeList) { + + // parse case + advanceToken(Token.TOKEN_CASE); + + /** + * @type {string} + * parse case name + */ + var caseName = m_curTokenStr; + advanceToken(); // \note [pyry] All token types are allowed here. + + /** + * @type {Array} + * setup case + */ + var valueBlockList = []; + + /** TODO: Should the default version be defined elsewhere? */ + /** @type {string} */ var version = '100'; + /** @type {number} */ var expectResult = glsShaderLibraryCase.expectResult.EXPECT_PASS; + /** @type {string} */ var description; + /** @type {string} */ var bothSource = ''; + /** @type {string} */ var vertexSource = ''; + /** @type {string} */ var fragmentSource = ''; + + for (;;) { + + if (m_curToken === Token.TOKEN_END) { + + break; + + } else if (m_curToken === Token.TOKEN_DESC) { + + advanceToken(); + assumeToken(Token.TOKEN_STRING); + + description = parseStringLiteral(m_curTokenStr); + advanceToken(); + + } else if (m_curToken === Token.TOKEN_EXPECT) { + + advanceToken(); + assumeToken(Token.TOKEN_IDENTIFIER); + + expectResult = (function(token) { + switch (token) { + case 'pass': return glsShaderLibraryCase.expectResult.EXPECT_PASS; + case 'compile_fail': return glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL; + case 'link_fail': return glsShaderLibraryCase.expectResult.EXPECT_LINK_FAIL; + case 'compile_or_link_fail': return glsShaderLibraryCase.expectResult.EXPECT_COMPILE_LINK_FAIL; + case 'build_successful': return glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL; + default: + throw Error('invalid expected result value: ' + m_curTokenStr); + } + }(m_curTokenStr)); + + advanceToken(); + + } else if (m_curToken === Token.TOKEN_VALUES) { + + /** @type {Object.} */ var block = glsShaderLibraryCase.genValueBlock(); + parseValueBlock(block); + valueBlockList.push(block); + + } else if ( + m_curToken === Token.TOKEN_BOTH || + m_curToken === Token.TOKEN_VERTEX || + m_curToken === Token.TOKEN_FRAGMENT + ) { + + /** @type {number} */ var token = m_curToken; + advanceToken(); + assumeToken(Token.TOKEN_SHADER_SOURCE); + /** @type {string} */ var source = parseShaderSource(m_curTokenStr); + + advanceToken(); + switch (token) { + case Token.TOKEN_BOTH: bothSource = source; break; + case Token.TOKEN_VERTEX: vertexSource = source; break; + case Token.TOKEN_FRAGMENT: fragmentSource = source; break; + default: glsShaderLibrary.de_assert(false); break; + } + + } else if (m_curToken === Token.TOKEN_VERSION) { + + advanceToken(); + + /** @type {number} */ var versionNum = 0; + /** @type {string} */ var postfix = ''; + + assumeToken(Token.TOKEN_INT_LITERAL); + versionNum = parseIntLiteral(m_curTokenStr); + advanceToken(); + + if (m_curToken === Token.TOKEN_IDENTIFIER) { + postfix = m_curTokenStr; + advanceToken(); + } + + // TODO: need to fix these constants, we dont have glu + if (versionNum === 100 && postfix === 'es') version = '100'; + else if (versionNum === 300 && postfix === 'es') version = '300 es'; + else if (versionNum === 310 && postfix === 'es') version = '310 es'; + else if (versionNum === 130) version = '130'; + else if (versionNum === 140) version = '140'; + else if (versionNum === 150) version = '150'; + else if (versionNum === 330) version = '330'; + else if (versionNum === 400) version = '400'; + else if (versionNum === 410) version = '410'; + else if (versionNum === 420) version = '420'; + else if (versionNum === 430) version = '430'; + else if (versionNum === 440) version = '440'; + else if (versionNum === 450) version = '450'; + else { + throw Error('Unknown GLSL version'); + } + + } else { + throw Error('unexpected token while parsing shader case: ' + m_curTokenStr); + } + + } + + advanceToken(Token.TOKEN_END); // case end + + /** + * no ShaderCase yet? + * @param {?string} vert + * @param {?string} frag + * @param {glsShaderLibraryCase.caseType} type + * @return {Object} + */ + var getShaderSpec = function(vert, frag, type) { + return { + /** @type {glsShaderLibraryCase.expectResult} */ expectResult: expectResult, + /** @type {glsShaderLibraryCase.caseType} */ caseType: type, + /** @type {Array} */ valueBlockList: valueBlockList, + /** @type {string} */ targetVersion: version, + /** @type {?string} */ vertexSource: vert, + /** @type {?string} */ fragmentSource: frag + }; + }; + getShaderSpec.bind(this); + + if (bothSource.length) { + + glsShaderLibrary.de_assert(!vertexSource); + glsShaderLibrary.de_assert(!fragmentSource); + + shaderNodeList.push(tcuTestCase.newTest(caseName + '_vertex', description, getShaderSpec(bothSource, null, + glsShaderLibraryCase.caseType.CASETYPE_VERTEX_ONLY))); + shaderNodeList.push(tcuTestCase.newTest(caseName + '_fragment', description, getShaderSpec(null, bothSource, + glsShaderLibraryCase.caseType.CASETYPE_FRAGMENT_ONLY))); + + } else { + glsShaderLibrary.de_assert(vertexSource); + glsShaderLibrary.de_assert(fragmentSource); + + shaderNodeList.push(tcuTestCase.newTest(caseName, description, getShaderSpec(vertexSource, fragmentSource, + glsShaderLibraryCase.caseType.CASETYPE_COMPLETE))); + } + }; + + /** + * @param {Array} shaderNodeList + */ + var parseShaderGroup = function(shaderNodeList) { + + // parse 'case' + advanceToken(Token.TOKEN_GROUP); + + /** @type {string} + * parse case name + */ var name = m_curTokenStr; + advanceToken(); // \note [pyry] We don't want to check token type here (for instance to allow "uniform") group. + + // Parse description. + assumeToken(Token.TOKEN_STRING); + /** @type {string} */ var description = parseStringLiteral(m_curTokenStr); + advanceToken(Token.TOKEN_STRING); + + /** @type {Array} */ var children = []; + + for (;;) { + + if (m_curToken === Token.TOKEN_END) { + break; + } else if (m_curToken === Token.TOKEN_GROUP) { + parseShaderGroup(children); + } else if (m_curToken === Token.TOKEN_CASE) { + parseShaderCase(children); + } else { + testFailed('unexpected token while parsing shader group: ' + m_curTokenStr); + tcuTestCase.runner.terminate(); + } + + } + + advanceToken(Token.TOKEN_END); // group end + + /** @type {tcuTestCase.DeqpTest} */ var groupNode = tcuTestCase.newTest(name, description, null); + groupNode.setChildren(children); + + shaderNodeList.push(groupNode); + + }; + + // uncomment to expose private functions + (function(obj) { + obj.priv = { + m_curPtr: m_curPtr, + + parseError: parseError, + parseFloatLiteral: parseFloatLiteral, + parseIntLiteral: parseIntLiteral, + parseStringLiteral: parseStringLiteral, + parseShaderSource: parseShaderSource, + advanceTokenTester: advanceTokenTester, + assumeToken: assumeToken, + mapDataTypeToken: mapDataTypeToken, + getTokenName: getTokenName, + + Token: Token, + + parseValueElement: parseValueElement, + parseValue: parseValue, + parseValueBlock: parseValueBlock, + parseShaderCase: parseShaderCase, + parseShaderGroup: parseShaderGroup, + + none: false + }; + }(this)); + //*/ + }; + +/** + * Parse the test file and execute the test cases + * @param {string} testName Name of the test file (without extension) + * @param {string} filter Optional filter. Common substring of the names of the tests that should be glsShaderLibrary.run. + */ +glsShaderLibrary.run = function(testName, filter) { + WebGLTestUtils.loadTextFileAsync(testName + '.test', function(success, content) { + if (success) { + tcuTestCase.runner.testFile = content; + tcuTestCase.runner.testName = testName; + tcuTestCase.runner.runCallback(glsShaderLibrary.processTestFile); + } else { + testFailed('Failed to load test file: ' + testName); + tcuTestCase.runner.terminate(); + } + }); +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js new file mode 100644 index 000000000..fa9666de5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js @@ -0,0 +1,1132 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsShaderLibraryCase'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { + +var glsShaderLibraryCase = modules.shared.glsShaderLibraryCase; +var tcuTestCase = framework.common.tcuTestCase; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var gluDrawUtil = framework.opengl.gluDrawUtil; + + /** @const @type {number} */ glsShaderLibraryCase.VIEWPORT_WIDTH = 128; + /** @const @type {number} */ glsShaderLibraryCase.VIEWPORT_HEIGHT = 128; + +/** + * Shader compilation expected result enum + * @enum {number} + */ +glsShaderLibraryCase.expectResult = { + EXPECT_PASS: 0, + EXPECT_COMPILE_FAIL: 1, + EXPECT_LINK_FAIL: 2, + EXPECT_COMPILE_LINK_FAIL: 3, + EXPECT_VALIDATION_FAIL: 4, + EXPECT_BUILD_SUCCESSFUL: 5 +}; + +/** + * Test case type + * @enum {number} + */ +glsShaderLibraryCase.caseType = { + CASETYPE_COMPLETE: 0, //!< Has all shaders specified separately. + CASETYPE_VERTEX_ONLY: 1, //!< "Both" case, vertex shader sub case. + CASETYPE_FRAGMENT_ONLY: 2 //!< "Both" case, fragment shader sub case. +}; + +/** + * glsShaderLibraryCase.BeforeDrawValidator target type enum + * @enum {number} + */ +glsShaderLibraryCase.targetType = { + PROGRAM: 0, + PIPELINE: 1 +}; + +/** + * Shader case type enum + * @enum {number} + */ +glsShaderLibraryCase.shaderCase = { + STORAGE_INPUT: 0, + STORAGE_OUTPUT: 1, + STORAGE_UNIFORM: 2 +}; + +/** + * Checks if shader uses in/out qualifiers depending on the version + * @param {string} version + * @return {boolean} version + */ +glsShaderLibraryCase.usesShaderInoutQualifiers = function(version) { + switch (version) { + case '100': + case '130': + case '140': + case '150': + return false; + + default: + return true; + } +}; + +/** + * Checks if version supports fragment highp precision + * @param {string} version + * @return {boolean} version ,True when is different from version 100 + */ +glsShaderLibraryCase.supportsFragmentHighp = function(version) { + return version !== '100'; +}; + +/** + * This functions builds a matching vertex shader for a 'both' case, when + * the fragment shader is being tested. + * We need to build attributes and varyings for each 'input'. + * @param { {values:Array}} valueBlock + * @return {string} res + */ +glsShaderLibraryCase.genVertexShader = function(valueBlock) { + /** @type {string} */ var res = ''; + /** @type {Object} */ var state = tcuTestCase.runner; + /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion); + /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute'; + /** @type {string} */ var vtxOut = usesInout ? 'out' : 'varying'; + + res += '#version ' + state.currentTest.spec.targetVersion + '\n'; + res += 'precision highp float;\n'; + res += 'precision highp int;\n'; + res += '\n'; + res += vtxIn + ' highp vec4 dEQP_Position;\n'; + + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + var val = valueBlock.values[ndx]; + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) { + /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType); + res += vtxIn + ' ' + floatType + ' a_' + val.valueName + ';\n'; + + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') + res += vtxOut + ' ' + floatType + ' ' + val.valueName + ';\n'; + else + res += vtxOut + ' ' + floatType + ' v_' + val.valueName + ';\n'; + } + } + res += '\n'; + + // Main function. + // - gl_Position = dEQP_Position; + // - for each input: write attribute directly to varying + res += 'void main()\n'; + res += ' {\n'; + res += '\tgl_Position = dEQP_Position;\n'; + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + var val = valueBlock.values[ndx]; + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) { + /** @type {string} */ var name = val.valueName; + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') + res += '\t' + name + ' = a_' + name + ';\n'; + else + res += '\tv_' + name + ' = a_' + name + ';\n'; + } + } + + res += '}\n'; + return res; +}; + +/** + * @param { {values:Array}} valueBlock + * @param {boolean} useFloatTypes + * @return {string} stream + */ +glsShaderLibraryCase.genCompareFunctions = function(valueBlock, useFloatTypes) { + var cmpTypeFound = {}; + /** @type {string} */ var stream = ''; + + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + /** @type {Array} */ var val = valueBlock.values[ndx]; + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) + cmpTypeFound[gluShaderUtil.getDataTypeName(val.dataType)] = true; + + } + if (useFloatTypes) { + if (cmpTypeFound['bool']) stream += 'bool isOk (float a, bool b) { return ((a > 0.5) == b); }\n'; + if (cmpTypeFound['bvec2']) stream += 'bool isOk (vec2 a, bvec2 b) { return (greaterThan(a, vec2(0.5)) == b); }\n'; + if (cmpTypeFound['bvec3']) stream += 'bool isOk (vec3 a, bvec3 b) { return (greaterThan(a, vec3(0.5)) == b); }\n'; + if (cmpTypeFound['bvec4']) stream += 'bool isOk (vec4 a, bvec4 b) { return (greaterThan(a, vec4(0.5)) == b); }\n'; + if (cmpTypeFound['int']) stream += 'bool isOk (float a, int b) { float atemp = a+0.5; return (float(b) <= atemp && atemp <= float(b+1)); }\n'; + if (cmpTypeFound['ivec2']) stream += 'bool isOk (vec2 a, ivec2 b) { return (ivec2(floor(a + 0.5)) == b); }\n'; + if (cmpTypeFound['ivec3']) stream += 'bool isOk (vec3 a, ivec3 b) { return (ivec3(floor(a + 0.5)) == b); }\n'; + if (cmpTypeFound['ivec4']) stream += 'bool isOk (vec4 a, ivec4 b) { return (ivec4(floor(a + 0.5)) == b); }\n'; + if (cmpTypeFound['uint']) stream += 'bool isOk (float a, uint b) { float atemp = a+0.5; return (float(b) <= atemp && atemp <= float(b+1u)); }\n'; + if (cmpTypeFound['uvec2']) stream += 'bool isOk (vec2 a, uvec2 b) { return (uvec2(floor(a + 0.5)) == b); }\n'; + if (cmpTypeFound['uvec3']) stream += 'bool isOk (vec3 a, uvec3 b) { return (uvec3(floor(a + 0.5)) == b); }\n'; + if (cmpTypeFound['uvec4']) stream += 'bool isOk (vec4 a, uvec4 b) { return (uvec4(floor(a + 0.5)) == b); }\n'; + } else { + if (cmpTypeFound['bool']) stream += 'bool isOk (bool a, bool b) { return (a == b); }\n'; + if (cmpTypeFound['bvec2']) stream += 'bool isOk (bvec2 a, bvec2 b) { return (a == b); }\n'; + if (cmpTypeFound['bvec3']) stream += 'bool isOk (bvec3 a, bvec3 b) { return (a == b); }\n'; + if (cmpTypeFound['bvec4']) stream += 'bool isOk (bvec4 a, bvec4 b) { return (a == b); }\n'; + if (cmpTypeFound['int']) stream += 'bool isOk (int a, int b) { return (a == b); }\n'; + if (cmpTypeFound['ivec2']) stream += 'bool isOk (ivec2 a, ivec2 b) { return (a == b); }\n'; + if (cmpTypeFound['ivec3']) stream += 'bool isOk (ivec3 a, ivec3 b) { return (a == b); }\n'; + if (cmpTypeFound['ivec4']) stream += 'bool isOk (ivec4 a, ivec4 b) { return (a == b); }\n'; + if (cmpTypeFound['uint']) stream += 'bool isOk (uint a, uint b) { return (a == b); }\n'; + if (cmpTypeFound['uvec2']) stream += 'bool isOk (uvec2 a, uvec2 b) { return (a == b); }\n'; + if (cmpTypeFound['uvec3']) stream += 'bool isOk (uvec3 a, uvec3 b) { return (a == b); }\n'; + if (cmpTypeFound['uvec4']) stream += 'bool isOk (uvec4 a, uvec4 b) { return (a == b); }\n'; + } + + if (cmpTypeFound['float']) + stream += 'bool isOk (float a, float b, float eps) { return (abs(a-b) <= (eps*abs(b) + eps)); }\n'; + if (cmpTypeFound['vec2']) + stream += 'bool isOk (vec2 a, vec2 b, float eps) { return all(lessThanEqual(abs(a-b), (eps*abs(b) + eps))); }\n'; + if (cmpTypeFound['vec3']) + stream += 'bool isOk (vec3 a, vec3 b, float eps) { return all(lessThanEqual(abs(a-b), (eps*abs(b) + eps))); }\n'; + if (cmpTypeFound['vec4']) + stream += 'bool isOk (vec4 a, vec4 b, float eps) { return all(lessThanEqual(abs(a-b), (eps*abs(b) + eps))); }\n'; + + if (cmpTypeFound['mat2']) + stream += 'bool isOk (mat2 a, mat2 b, float eps) { vec2 diff = max(abs(a[0]-b[0]), abs(a[1]-b[1])); return all(lessThanEqual(diff, vec2(eps))); }\n'; + if (cmpTypeFound['mat2x3']) + stream += 'bool isOk (mat2x3 a, mat2x3 b, float eps) { vec3 diff = max(abs(a[0]-b[0]), abs(a[1]-b[1])); return all(lessThanEqual(diff, vec3(eps))); }\n'; + if (cmpTypeFound['mat2x4']) + stream += 'bool isOk (mat2x4 a, mat2x4 b, float eps) { vec4 diff = max(abs(a[0]-b[0]), abs(a[1]-b[1])); return all(lessThanEqual(diff, vec4(eps))); }\n'; + if (cmpTypeFound['mat3x2']) + stream += 'bool isOk (mat3x2 a, mat3x2 b, float eps) { vec2 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), abs(a[2]-b[2])); return all(lessThanEqual(diff, vec2(eps))); }\n'; + if (cmpTypeFound['mat3']) + stream += 'bool isOk (mat3 a, mat3 b, float eps) { vec3 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), abs(a[2]-b[2])); return all(lessThanEqual(diff, vec3(eps))); }\n'; + if (cmpTypeFound['mat3x4']) + stream += 'bool isOk (mat3x4 a, mat3x4 b, float eps) { vec4 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), abs(a[2]-b[2])); return all(lessThanEqual(diff, vec4(eps))); }\n'; + if (cmpTypeFound['mat4x2']) + stream += 'bool isOk (mat4x2 a, mat4x2 b, float eps) { vec2 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), max(abs(a[2]-b[2]), abs(a[3]-b[3]))); return all(lessThanEqual(diff, vec2(eps))); }\n'; + if (cmpTypeFound['mat4x3']) + stream += 'bool isOk (mat4x3 a, mat4x3 b, float eps) { vec3 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), max(abs(a[2]-b[2]), abs(a[3]-b[3]))); return all(lessThanEqual(diff, vec3(eps))); }\n'; + if (cmpTypeFound['mat4']) + stream += 'bool isOk (mat4 a, mat4 b, float eps) { vec4 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), max(abs(a[2]-b[2]), abs(a[3]-b[3]))); return all(lessThanEqual(diff, vec4(eps))); }\n'; + + return stream; +}; + +/** + * @param {string} dstVec4Var + * @param { {values:Array}} valueBlock + * @param {string} nonFloatNamePrefix + * @param {?string=} checkVarName + * @return {string} output + */ +glsShaderLibraryCase.genCompareOp = function(dstVec4Var, valueBlock, nonFloatNamePrefix, checkVarName) { + + /** @type {boolean} */ var isFirstOutput = true; + /** @type {string} */ var output = ''; + + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + /** @type {Array} */ var val = valueBlock.values[ndx]; + /** @type {string} */ var valueName = val.valueName; + + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) { + // Check if we're only interested in one variable (then skip if not the right one). + if (checkVarName && (valueName !== checkVarName)) + continue; + + // Prefix. + if (isFirstOutput) { + output += 'bool RES = '; + isFirstOutput = false; + } else + output += 'RES = RES && '; + + // Generate actual comparison. + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') + output += 'isOk(' + valueName + ', ref_' + valueName + ', 0.05);\n'; + else + output += 'isOk(' + nonFloatNamePrefix + valueName + ', ref_' + valueName + ');\n'; + } + // \note Uniforms are already declared in shader. + } + + if (isFirstOutput) + output += dstVec4Var + ' = vec4(1.0);\n'; // \todo [petri] Should we give warning if not expect-failure case? + else + output += dstVec4Var + ' = vec4(RES, RES, RES, 1.0);\n'; + + return output; +}; + +/** + * @param { {values:Array}} valueBlock + * @return {string} shader + */ +glsShaderLibraryCase.genFragmentShader = function(valueBlock) { + /** @type {string} */ var shader = ''; + /** @type {Object} */ var state = tcuTestCase.runner; + /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion); + /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute'; + /** @type {string} */ var vtxOut = usesInout ? 'out' : 'varying'; + /** @type {boolean} */ var customColorOut = usesInout; + /** @type {string} */ var fragIn = usesInout ? 'in' : 'varying'; + /** @type {string} */ var prec = glsShaderLibraryCase.supportsFragmentHighp(state.currentTest.spec.targetVersion) ? 'highp' : 'mediump'; + + shader += '#version ' + state.currentTest.spec.targetVersion + '\n'; + + shader += 'precision ' + prec + ' float;\n'; + shader += 'precision ' + prec + ' int;\n'; + shader += '\n'; + + if (customColorOut) { + shader += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + shader += '\n'; + } + + shader += glsShaderLibraryCase.genCompareFunctions(valueBlock, true); + shader += '\n'; + + // Declarations (varying, reference for each output). + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + /** @type {Array} */ var val = valueBlock.values[ndx]; + /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType); + /** @type {string} */ var refType = gluShaderUtil.getDataTypeName(val.dataType); + + if (val.storageType == glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) { + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') + shader += fragIn + ' ' + floatType + ' ' + val.valueName + ';\n'; + else + shader += fragIn + ' ' + floatType + ' v_' + val.valueName + ';\n'; + + shader += 'uniform ' + refType + ' ref_' + val.valueName + ';\n'; + } + } + + shader += '\n'; + shader += 'void main()\n'; + shader += ' {\n'; + + shader += '\t'; + shader += glsShaderLibraryCase.genCompareOp(customColorOut ? 'dEQP_FragColor' : 'gl_FragColor', valueBlock, 'v_', null); + + shader += '}\n'; + return shader; +}; + +glsShaderLibraryCase.caseRequirement = (function() { + +/** + * @constructor + */ +var CaseRequirement = function() { + +/** + * @param {number} shaderType + * @return {boolean} + */ + this.isAffected = function(shaderType) { + for (var i = 0; i < this.shaderTypes.length; i++) + if (this.shaderTypes[i] === shaderType) + return true; + return false; + }; + + this.checkRequirements = function(gl) { + if (this.type === requirementType.EXTENSION) { + var extns = gl.getSupportedExtensions(); + for (var i = 0; i < extns.length; i++) + for (var j = 0; j < this.requirements.length; j++) + if (extns[i] === this.requirements[j]) { + this.supportedExtension = this.requirements[j]; + return true; + } + if (this.requirements.length === 1) + throw Error('Test requires extension of ' + this.requirements[0]); + else + throw Error('Test requires any extension of ' + this.requirements); + } else if (this.type === requirementType.IMPLEMENTATION_LIMIT) { + var value = gl.getParameter(this.enumName); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Failed to read parameter ' + this.enumName, false, true); + + if (!(value > this.referenceValue)) + throw Error('Test requires ' + this.enumName + ' (' + value + ') > ' + this.referenceValue); + } + }; + + this.getSupportedExtension = function() { + return this.supportedExtension; + }; + +}; + +var createAnyExtensionRequirement = function(requirements, shaderTypes) { + var cr = new CaseRequirement(); + cr.type = requirementType.EXTENSION; + cr.requirements = requirements; + cr.shaderTypes = shaderTypes; + return cr; +}; + +var createLimitRequirement = function(enumName, ref) { + var cr = new CaseRequirement(); + cr.type = requirementType.IMPLEMENTATION_LIMIT; + cr.enumName = enumName; + cr.referenceValue = ref; +}; + +/** + * @enum {number} + */ +var requirementType = { + EXTENSION: 0, + IMPLEMENTATION_LIMIT: 1 +}; + +return { + createAnyExtensionRequirement: createAnyExtensionRequirement, + createLimitRequirement: createLimitRequirement, + requirementType: requirementType +}; + +}()); + +/** Specialize a shader only for the vertex test case. + * @param {string} baseCode + * @param {number} shaderType + * @param {Array} requirements + * @return {string} resultBuf + */ +glsShaderLibraryCase.injectExtensionRequirements = function(baseCode, shaderType, requirements) { +/** + * @param {Array} requirements + * @param {number} shaderType + * @return {string} buf + */ + var generateExtensionStatements = function(requirements, shaderType) { + /** @type {string} */ var buf = ''; + + if (requirements) + for (var ndx = 0; ndx < requirements.length; ndx++) + if (requirements[ndx].type === glsShaderLibraryCase.caseRequirement.requirementType.EXTENSION && + requirements[ndx].isAffected(shaderType)) + buf += '#extension ' + requirements[ndx].getSupportedExtension() + ' : require\n'; + + return buf; + }; + + /** @type {string} */ var extensions = generateExtensionStatements(requirements, shaderType); + + if (extensions.length === 0) + return baseCode; + + /** @type {Array} */ var splitLines = baseCode.split('\n'); + /** @type {boolean} */ var firstNonPreprocessorLine = true; + /** @type {string} */ var resultBuf = ''; + + for (var i = 0; i < splitLines.length; i++) { + /** @const @type {boolean} */ var isPreprocessorDirective = (splitLines[i].match(/^\s*#/) !== null); + + if (!isPreprocessorDirective && firstNonPreprocessorLine) { + firstNonPreprocessorLine = false; + resultBuf += extensions; + } + + resultBuf += splitLines[i] + '\n'; + } + + return resultBuf; +}; + +/** Specialize a shader for the vertex shader test case. + * @param {string} src + * @param { {values:Array}} valueBlock + * @return {string} withExt + */ +glsShaderLibraryCase.specializeVertexShader = function(src, valueBlock) { + /** @type {string} */ var decl = ''; + /** @type {string} */ var setup = ''; + /** @type {string} */ var output = ''; + /** @type {Object} */ var state = tcuTestCase.runner; + /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion); + /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute'; + /** @type {string} */ var vtxOut = usesInout ? 'out' : 'varying'; + + // Output (write out position). + output += 'gl_Position = dEQP_Position;\n'; + + // Declarations (position + attribute for each input, varying for each output). + decl += vtxIn + ' highp vec4 dEQP_Position;\n'; + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + /** @type {Array} */ var val = valueBlock.values[ndx]; + /** @type {string} */ var valueName = val.valueName; + /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType); + /** @type {string} */ var dataTypeName = gluShaderUtil.getDataTypeName(val.dataType); + + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) { + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') { + decl += vtxIn + ' ' + floatType + ' ' + valueName + ';\n'; + } else { + decl += vtxIn + ' ' + floatType + ' a_' + valueName + ';\n'; + setup += dataTypeName + ' ' + valueName + ' = ' + dataTypeName + '(a_' + valueName + ');\n'; + } + } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) { + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') + decl += vtxOut + ' ' + floatType + ' ' + valueName + ';\n'; + else { + decl += vtxOut + ' ' + floatType + ' v_' + valueName + ';\n'; + decl += dataTypeName + ' ' + valueName + ';\n'; + + output += 'v_' + valueName + ' = ' + floatType + '(' + valueName + ');\n'; + } + } + } + + /** @type {string} */ + var baseSrc = src + .replace(/\$\{DECLARATIONS\}/g, decl) + .replace(/\$\{DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' ')) + .replace(/\$\{SETUP\}/g, setup) + .replace(/\$\{OUTPUT\}/g, output) + .replace(/\$\{POSITION_FRAG_COLOR\}/g, 'gl_Position'); + + /** @type {string} */ + var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.VERTEX, state.currentTest.spec.requirements); + + return withExt; +}; + +/** Specialize a shader only for the vertex test case. + * @param {string} src + * @param { {values:Array}} valueBlock + * @return {string} withExt + */ +glsShaderLibraryCase.specializeVertexOnly = function(src, valueBlock) { + /** @type {string} */ var decl = ''; + /** @type {string} */ var setup = ''; + /** @type {string} */ var output = ''; + /** @type {Object} */ var state = tcuTestCase.runner; + /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion); + /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute'; + + // Output (write out position). + output += 'gl_Position = dEQP_Position;\n'; + + // Declarations (position + attribute for each input, varying for each output). + decl += vtxIn + ' highp vec4 dEQP_Position;\n'; + + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + /** @type {Array} */ var val = valueBlock.values[ndx]; + /** @type {string} */ var valueName = val.valueName; + /** @type {string} */ var type = gluShaderUtil.getDataTypeName(val.dataType); + + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) { + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') { + decl += vtxIn + ' ' + type + ' ' + valueName + ';\n'; + } else { + /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType); + + decl += vtxIn + ' ' + floatType + ' a_' + valueName + ';\n'; + setup += type + ' ' + valueName + ' = ' + type + '(a_' + valueName + ');\n'; + } + } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM && + !val.valueName.match('\\.')) + decl += 'uniform ' + type + ' ' + valueName + ';\n'; + } + + /** @type {string} */ + var baseSrc = src + .replace(/\$\{VERTEX_DECLARATIONS\}/g, decl) + .replace(/\$\{VERTEX_DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' ')) + .replace(/\$\{VERTEX_SETUP\}/g, setup) + .replace(/\$\{VERTEX_OUTPUT\}/g, output); + + /** @type {string} */ + var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.VERTEX, state.currentTest.spec.requirements); + + return withExt; +}; + +/** Specialize a shader for the fragment shader test case. + * @param {string} src + * @param { {values:Array}} valueBlock + * @return {string} withExt + */ +glsShaderLibraryCase.specializeFragmentShader = function(src, valueBlock) { + /** @type {string} */ var decl = ''; + /** @type {string} */ var setup = ''; + /** @type {string} */ var output = ''; + + /** @type {Object} */ var state = tcuTestCase.runner; + + /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion); + /** @type {boolean} */ var customColorOut = usesInout; + /** @type {string} */ var fragIn = usesInout ? 'in' : 'varying'; + /** @type {string} */ var fragColor = customColorOut ? 'dEQP_FragColor' : 'gl_FragColor'; + + decl += glsShaderLibraryCase.genCompareFunctions(valueBlock, false); + output += glsShaderLibraryCase.genCompareOp(fragColor, valueBlock, '', null); + + if (customColorOut) + decl += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + /** @type {Array} */ var val = valueBlock.values[ndx]; + /** @type {string} */ var valueName = val.valueName; + /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType); + /** @type {string} */ var refType = gluShaderUtil.getDataTypeName(val.dataType); + + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) { + if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') + decl += fragIn + ' ' + floatType + ' ' + valueName + ';\n'; + else { + decl += fragIn + ' ' + floatType + ' v_' + valueName + ';\n'; + var offset = gluShaderUtil.isDataTypeIntOrIVec(val.dataType) ? ' * 1.0025' : ''; // \todo [petri] bit of a hack to avoid errors in chop() due to varying interpolation + setup += refType + ' ' + valueName + ' = ' + refType + '(v_' + valueName + offset + ');\n'; + } + } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) { + decl += 'uniform ' + refType + ' ref_' + valueName + ';\n'; + decl += refType + ' ' + valueName + ';\n'; + } + } + + /* \todo [2010-04-01 petri] Check all outputs. */ + + /** @type {string} */ + var baseSrc = src + .replace(/\$\{DECLARATIONS\}/g, decl) + .replace(/\$\{DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' ')) + .replace(/\$\{SETUP\}/g, setup) + .replace(/\$\{OUTPUT\}/g, output) + .replace(/\$\{POSITION_FRAG_COLOR\}/g, fragColor); + + /** @type {string} */ + var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.FRAGMENT, state.currentTest.spec.requirements); + + return withExt; +}; + +/** Specialize a shader only for the fragment test case. + * @param {string} src + * @param { {values:Array}} valueBlock + * @return {string} withExt + */ +glsShaderLibraryCase.specializeFragmentOnly = function(src, valueBlock) { + /** @type {string} */ var decl = ''; + /** @type {string} */ var output = ''; + /** @type {Object} */ var state = tcuTestCase.runner; + /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion); + /** @type {boolean} */ var customColorOut = usesInout; + /** @type {string} */ var fragIn = usesInout ? 'in' : 'varying'; + /** @type {string} */ var fragColor = customColorOut ? 'dEQP_FragColor' : 'gl_FragColor'; + + decl += glsShaderLibraryCase.genCompareFunctions(valueBlock, false); + output += glsShaderLibraryCase.genCompareOp(fragColor, valueBlock, '', null); + + if (customColorOut) + decl += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + + for (var ndx = 0; ndx < valueBlock.values.length; ndx++) { + /** @type {Array} */ var val = valueBlock.values[ndx]; + /** @type {string} */ var valueName = val.valueName; + /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType); + /** @type {string} */ var refType = gluShaderUtil.getDataTypeName(val.dataType); + + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) { + decl += 'uniform ' + refType + ' ref_' + valueName + ';\n'; + decl += refType + ' ' + valueName + ';\n'; + } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM && + !valueName.match('\\.')) + decl += 'uniform ' + refType + ' ' + valueName + ';\n'; + } + + /** @type {string} */ + var baseSrc = src + .replace(/\$\{FRAGMENT_DECLARATIONS\}/g, decl) + .replace(/\$\{FRAGMENT_DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' ')) + .replace(/\$\{FRAGMENT_OUTPUT\}/g, output) + .replace(/\$\{FRAG_COLOR\}/g, fragColor); + + /** @type {string} */ + var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.FRAGMENT, state.currentTest.spec.requirements); + + return withExt; +}; + +/** + * Is tessellation present + * @return {boolean} True if tessellation is present + */ +glsShaderLibraryCase.isTessellationPresent = function() { + /* TODO: GLES 3.1: implement */ + return false; +}; + +glsShaderLibraryCase.setUniformValue = function(gl, pipelinePrograms, name, val, arrayNdx) { + /** @type {boolean} */ var foundAnyMatch = false; + + for (var programNdx = 0; programNdx < pipelinePrograms.length; ++programNdx) { + /** @const @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(pipelinePrograms[programNdx], name); + /** @const @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(val.dataType); + /** @const @type {number} */ var elemNdx = (val.arrayLength === 1) ? (0) : (arrayNdx * scalarSize); + + if (!loc) + continue; + + foundAnyMatch = true; + + gl.useProgram(pipelinePrograms[programNdx]); + + /** @type {Array} */ var element = val.elements.slice(elemNdx, elemNdx + scalarSize); + switch (val.dataType) { + case gluShaderUtil.DataType.FLOAT: gl.uniform1fv(loc, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_VEC2: gl.uniform2fv(loc, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_VEC3: gl.uniform3fv(loc, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_VEC4: gl.uniform4fv(loc, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT2: gl.uniformMatrix2fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT3: gl.uniformMatrix3fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT4: gl.uniformMatrix4fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.INT: gl.uniform1iv(loc, new Int32Array(element)); break; + case gluShaderUtil.DataType.INT_VEC2: gl.uniform2iv(loc, new Int32Array(element)); break; + case gluShaderUtil.DataType.INT_VEC3: gl.uniform3iv(loc, new Int32Array(element)); break; + case gluShaderUtil.DataType.INT_VEC4: gl.uniform4iv(loc, new Int32Array(element)); break; + + /** TODO: What type should be used for bool uniforms? */ + case gluShaderUtil.DataType.BOOL: gl.uniform1iv(loc, new Int32Array(element)); break; + case gluShaderUtil.DataType.BOOL_VEC2: gl.uniform2iv(loc, new Int32Array(element)); break; + case gluShaderUtil.DataType.BOOL_VEC3: gl.uniform3iv(loc, new Int32Array(element)); break; + case gluShaderUtil.DataType.BOOL_VEC4: gl.uniform4iv(loc, new Int32Array(element)); break; + + case gluShaderUtil.DataType.UINT: gl.uniform1uiv(loc, new Uint32Array(element)); break; + case gluShaderUtil.DataType.UINT_VEC2: gl.uniform2uiv(loc, new Uint32Array(element)); break; + case gluShaderUtil.DataType.UINT_VEC3: gl.uniform3uiv(loc, new Uint32Array(element)); break; + case gluShaderUtil.DataType.UINT_VEC4: gl.uniform4uiv(loc, new Uint32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT2X3: gl.uniformMatrix2x3fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT2X4: gl.uniformMatrix2x4fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT3X2: gl.uniformMatrix3x2fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT3X4: gl.uniformMatrix3x4fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT4X2: gl.uniformMatrix4x2fv(loc, false, new Float32Array(element)); break; + case gluShaderUtil.DataType.FLOAT_MAT4X3: gl.uniformMatrix4x3fv(loc, false, new Float32Array(element)); break; + + default: + testFailed('Unknown data type ' + val.dataType); + } + } + + if (!foundAnyMatch) + bufferedLogToConsole('WARNING // Uniform \"' + name + '\" location is not valid, location = -1. Cannot set value to the uniform.'); +}; + +/** + * Evaluates pixels, if they are white, black or there is any unexpected result + * @param {gluDrawUtil.Surface} surface + * @param {number} minX + * @param {number} maxX + * @param {number} minY + * @param {number} maxY + * @return {boolean} True if tessellation is present + */ +glsShaderLibraryCase.checkPixels = function(surface, minX, maxX, minY, maxY) { + /** @type {boolean} */ var allWhite = true; + /** @type {boolean} */ var allBlack = true; + /** @type {boolean} */ var anyUnexpected = false; + + assertMsgOptions((maxX > minX) && (maxY > minY), 'glsShaderLibraryCase.checkPixels sanity check', false, true); + + for (var y = minY; y <= maxY; y++) { + for (var x = minX; x <= maxX; x++) { + /** @type {number} */ var pixel = surface.getPixelUintRGB8(x, y); + /** @type {boolean} */ var isWhite = (pixel == 0xFFFFFF); + /** @type {boolean} */ var isBlack = (pixel == 0x000000); + + allWhite = allWhite && isWhite; + allBlack = allBlack && isBlack; + anyUnexpected = anyUnexpected || (!isWhite && !isBlack); + + // Early terminate as soon as we know the check hasn't passed + if (!allWhite && !allBlack) + break; + } + } + + if (!allWhite) { + if (anyUnexpected) + testFailed('WARNING: expecting all rendered pixels to be white or black, but got other colors as well!'); + else if (!allBlack) + testFailed('WARNING: got inconsistent results over the image, when all pixels should be the same color!'); + + return false; + } + return true; +}; + +/** + * Initialize a test case + */ +glsShaderLibraryCase.init = function() { +/** @type {Object} */ var state = tcuTestCase.runner; +/** @type {Object} */ var test = state.currentTest; + + bufferedLogToConsole('Processing ' + test.fullName()); + + if (!test.spec.valueBlockList.length) + test.spec.valueBlockList.push(glsShaderLibraryCase.genValueBlock()); + /** @type { {values:Array}} */ var valueBlock = test.spec.valueBlockList[0]; + + if (test.spec.requirements) + for (var ndx = 0; ndx < test.spec.requirements.length; ++ndx) + test.spec.requirements[ndx].checkRequirements(); + + /** @type {Array} */ var sources = []; + + if (test.spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_COMPLETE) { + /** @type {string} */ var vertex = glsShaderLibraryCase.specializeVertexOnly(test.spec.vertexSource, valueBlock); + /** @type {string} */ var fragment = glsShaderLibraryCase.specializeFragmentOnly(test.spec.fragmentSource, valueBlock); + sources.push(gluShaderProgram.genVertexSource(vertex)); + sources.push(gluShaderProgram.genFragmentSource(fragment)); + } else if (test.spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_VERTEX_ONLY) { + sources.push(gluShaderProgram.genVertexSource(glsShaderLibraryCase.specializeVertexShader(test.spec.vertexSource, valueBlock))); + sources.push(gluShaderProgram.genFragmentSource(glsShaderLibraryCase.genFragmentShader(valueBlock))); + } else if (test.spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_FRAGMENT_ONLY) { + sources.push(gluShaderProgram.genVertexSource(glsShaderLibraryCase.genVertexShader(valueBlock))); + sources.push(gluShaderProgram.genFragmentSource(glsShaderLibraryCase.specializeFragmentShader(test.spec.fragmentSource, valueBlock))); + } + + test.programs = []; + test.programs.push({ + programSources: { + sources: sources + } + } + ); + +}; + +/** + * Execute a test case + * @return {boolean} True if test case passed + */ +glsShaderLibraryCase.execute = function() { + /** @const @type {number} */ var quadSize = 1.0; + /** @const @type {Array} */ + var s_positions = [ + -quadSize, -quadSize, 0.0, 1.0, + -quadSize, +quadSize, 0.0, 1.0, + +quadSize, -quadSize, 0.0, 1.0, + +quadSize, +quadSize, 0.0, 1.0 + ]; + + /** @const @type {Array} */ + var s_indices = [ + 0, 1, 2, + 1, 3, 2 + ]; + + var wtu = WebGLTestUtils; + /** @type {WebGL2RenderingContext} */ var gl = wtu.create3DContext('canvas'); + /** @type {Object} */ var state = tcuTestCase.runner; + /** @type {Object} */ var test = state.currentTest; + /** @type {Object} */ var spec = test.spec; + + // Compute viewport. + /* TODO: original code used random number generator to compute viewport, we use whole canvas */ + /** @const @type {number} */ var width = Math.min(canvas.width, glsShaderLibraryCase.VIEWPORT_WIDTH); + /** @const @type {number} */ var height = Math.min(canvas.height, glsShaderLibraryCase.VIEWPORT_HEIGHT); + /** @const @type {number} */ var viewportX = 0; + /** @const @type {number} */ var viewportY = 0; + /** @const @type {number} */ var numVerticesPerDraw = 4; + /** @const @type {boolean} */ var tessellationPresent = glsShaderLibraryCase.isTessellationPresent(); + + /** @type {boolean} */ var allCompilesOk = true; + /** @type {boolean} */ var allLinksOk = true; + /** @type {?string} */ var failReason = null; + + /** @type {number} */ var vertexProgramID = -1; + /** @type {Array} */ var pipelineProgramIDs = []; + /** @type {Array} */ var programs = []; + var programPipeline; + + // Set the name of the current test so testFailedOptions/testPassedOptions can use it. + setCurrentTestName(test.fullName()); + debug('Start testcase: ' + test.fullName()); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Start testcase: ' + test.fullName(), false, true); + + /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, test.programs[0].programSources); + + vertexProgramID = program.getProgram(); + pipelineProgramIDs.push(program.getProgram()); + programs.push(program); + + // Check that compile/link results are what we expect. + + for (var i = 0; i < program.shaders.length; i++) { + if (!program.shaders[i].info.compileOk) + allCompilesOk = false; + } + + if (!program.getProgramInfo().linkOk) + allLinksOk = false; + + switch (spec.expectResult) { + case glsShaderLibraryCase.expectResult.EXPECT_PASS: + case glsShaderLibraryCase.expectResult.EXPECT_VALIDATION_FAIL: + case glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL: + if (!allCompilesOk) + failReason = 'expected shaders to compile and link properly, but failed to compile.'; + else if (!allLinksOk) + failReason = 'expected shaders to compile and link properly, but failed to link.'; + break; + + case glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL: + if (allCompilesOk && !allLinksOk) + failReason = 'expected compilation to fail, but shaders compiled and link failed.'; + else if (allCompilesOk) + failReason = 'expected compilation to fail, but shaders compiled correctly.'; + break; + + case glsShaderLibraryCase.expectResult.EXPECT_LINK_FAIL: + if (!allCompilesOk) + failReason = 'expected linking to fail, but unable to compile.'; + else if (allLinksOk) + failReason = 'expected linking to fail, but passed.'; + break; + + case glsShaderLibraryCase.expectResult.EXPECT_COMPILE_LINK_FAIL: + if (allCompilesOk && allLinksOk) + failReason = 'expected compile or link to fail, but passed.'; + break; + + default: + testFailedOptions('Unknown expected result', true); + return false; + } + + if (failReason != null) { + // \todo [2010-06-07 petri] These should be handled in the test case? + + // If implementation parses shader at link time, report it as quality warning. + if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL && allCompilesOk && !allLinksOk) + bufferedLogToConsole('Quality warning: implementation parses shader at link time: ' + failReason); + else { + bufferedLogToConsole('ERROR: ' + failReason); + testFailedOptions(failReason, true); + } + return false; + } + + // Return if compile/link expected to fail. + if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL || + spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_COMPILE_LINK_FAIL || + spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_LINK_FAIL || + spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL) { + if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL) { + testPassedOptions('Compile/link is expected to succeed', true); + } else { + testPassedOptions('Compile/link is expected to fail', true); + } + setCurrentTestName(''); + return (failReason === null); + } + + // Setup viewport. + gl.viewport(viewportX, viewportY, width, height); + + // Start using program + gl.useProgram(vertexProgramID); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'glUseProgram()', false, true); + + // Fetch location for positions positions. + /** @type {number} */ var positionLoc = gl.getAttribLocation(vertexProgramID, 'dEQP_Position'); + if (positionLoc === -1) { + testFailedOptions("no location found for attribute 'dEQP_Position'", true); + return false; + } + + // Iterate all value blocks. + for (var blockNdx = 0; blockNdx < spec.valueBlockList.length; blockNdx++) { + /** @type { {values:Array}} */ var block = spec.valueBlockList[blockNdx]; + + // always render at least one pass even if there is no input/output data + /** @const @type {number} */ var numRenderPasses = Math.max(block.arrayLength, 1); + + // Iterate all array sub-cases. + for (var arrayNdx = 0; arrayNdx < numRenderPasses; arrayNdx++) { + /** @const @type {number} */ var numValues = block.values.length; + /** @type {Array} */ var vertexArrays = []; + /** @type {number} */ var attribValueNdx = 0; + /** @type {number} */ var postDrawError; + + vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, positionLoc, 4, numVerticesPerDraw, s_positions)); + + // Collect VA pointer for inputs + for (var valNdx = 0; valNdx < numValues; valNdx++) { + var val = block.values[valNdx]; + /** @const @type {string} */ var valueName = val.valueName; + /** @const @type {gluShaderUtil.DataType} */ var dataType = val.dataType; + /** @const @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(val.dataType); + + if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) { + // Replicate values four times. + /** @type {Array} */ var scalars = []; + + for (var repNdx = 0; repNdx < numVerticesPerDraw; repNdx++) + for (var ndx = 0; ndx < scalarSize; ndx++) + scalars[repNdx * scalarSize + ndx] = val.elements[arrayNdx * scalarSize + ndx]; + + // Attribute name prefix. + /** @type {string} */ var attribPrefix = ''; + // \todo [2010-05-27 petri] Should latter condition only apply for vertex cases (or actually non-fragment cases)? + if ((spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_FRAGMENT_ONLY) || (gluShaderUtil.getDataTypeScalarType(dataType) !== 'float')) + attribPrefix = 'a_'; + + // Input always given as attribute. + /** @type {string} */ var attribName = attribPrefix + valueName; + /** @type {number} */ var attribLoc = gl.getAttribLocation(vertexProgramID, attribName); + if (attribLoc === -1) { + bufferedLogToConsole("Warning: no location found for attribute '" + attribName + "'"); + continue; + } + + if (gluShaderUtil.isDataTypeMatrix(dataType)) { + var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(dataType); + var numRows = gluShaderUtil.getDataTypeMatrixNumRows(dataType); + + assertMsgOptions(scalarSize === numCols * numRows, 'Matrix size sanity check', false, true); + + for (var i = 0; i < numCols; i++) + vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, attribLoc + i, numRows, numVerticesPerDraw, scalars, scalarSize * 4, i * numRows * 4)); + } else + vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, attribLoc, scalarSize, numVerticesPerDraw, scalars)); + + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set vertex attrib array', false, true); + } + } + + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'before set uniforms', false, true); + + // set uniform values for outputs (refs). + for (var valNdx = 0; valNdx < numValues; valNdx++) { + /** @type {Array} */ var val1 = block.values[valNdx]; + /** @type {string} */ var valueName1 = val1.valueName; + + if (val1.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) { + // Set reference value. + glsShaderLibraryCase.setUniformValue(gl, pipelineProgramIDs, 'ref_' + valueName1, val1, arrayNdx); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set reference uniforms', false, true); + } else if (val1.storageType === glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM) { + glsShaderLibraryCase.setUniformValue(gl, pipelineProgramIDs, valueName1, val1, arrayNdx); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set uniforms', false, true); + } + } + + // Clear. + gl.clearColor(0.125, 0.25, 0.5, 1); + gl.clear(gl.COLOR_BUFFER_BIT); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'clear buffer', false, true); + + // Use program or pipeline + if (spec.separatePrograms) + gl.useProgram(null); + else + gl.useProgram(vertexProgramID); + + // Draw. + // if (tessellationPresent) { + // gl.patchParameteri(gl.PATCH_VERTICES, 3); + // assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set patchParameteri(PATCH_VERTICES, 3)', false, true); + // } + + gluDrawUtil.draw(gl, vertexProgramID, vertexArrays, gluDrawUtil.triangles(s_indices)); + + postDrawError = gl.getError(); + + if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_PASS) { + /** @type {gluDrawUtil.Surface} */ var surface = new gluDrawUtil.Surface(); + /** @const @type {number} */ var w = s_positions[3]; + /** @const @type {number} */ var minY = Math.ceil(((-quadSize / w) * 0.5 + 0.5) * height + 1.0); + /** @const @type {number} */ var maxY = Math.floor(((+quadSize / w) * 0.5 + 0.5) * height - 0.5); + /** @const @type {number} */ var minX = Math.ceil(((-quadSize / w) * 0.5 + 0.5) * width + 1.0); + /** @const @type {number} */ var maxX = Math.floor(((+quadSize / w) * 0.5 + 0.5) * width - 0.5); + + assertMsgOptions(postDrawError === gl.NO_ERROR, 'draw', false, true); + + surface.readSurface(gl, viewportX, viewportY, width, height); + assertMsgOptions(gl.getError() === gl.NO_ERROR, 'read pixels', false, true); + + if (!glsShaderLibraryCase.checkPixels(surface, minX, maxX, minY, maxY)) { + testFailedOptions(( + 'INCORRECT RESULT for (value block ' + (blockNdx + 1) + + ' of ' + spec.valueBlockList.length + ', sub-case ' + + (arrayNdx + 1) + ' of ' + block.arrayLength + '):' + ), true); + + /* TODO: Port */ + /* + log << TestLog::Message << "Failing shader input/output values:" << TestLog::EndMessage; + dumpValues(block, arrayNdx); + + // Dump image on failure. + log << TestLog::Image("Result", "Rendered result image", surface); + + */ + gl.useProgram(null); + + return false; + } + } else if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_VALIDATION_FAIL) { + /** TODO: GLES 3.1: Implement */ + testFailedOptions('Unsupported test case', true); + } + } + } + gl.useProgram(null); + + assertMsgOptions(gl.getError() === gl.NO_ERROR, '', true, true); + setCurrentTestName(''); + + return true; +}; + +glsShaderLibraryCase.runTestCases = function() { +/** @type {Object} */ var state = tcuTestCase.runner; + if (state.next()) { + try { + glsShaderLibraryCase.init(); + glsShaderLibraryCase.execute(); + } catch (err) { + bufferedLogToConsole(err); + } + tcuTestCase.runner.runCallback(glsShaderLibraryCase.runTestCases); + } else + tcuTestCase.runner.terminate(); + +}; + +glsShaderLibraryCase.genValueBlock = function() { + return { + /** @type {Array} */ values: [], + /** @type {number} */ arrayLength: 0 + }; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js new file mode 100644 index 000000000..31f59de1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js @@ -0,0 +1,1200 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsShaderRenderCase'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuMatrix'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluTexture'); +goog.require('framework.opengl.gluTextureUtil'); +goog.require('framework.opengl.gluShaderProgram'); + +goog.scope(function() { + var glsShaderRenderCase = modules.shared.glsShaderRenderCase; + + var deMath = framework.delibs.debase.deMath; + var deString = framework.delibs.debase.deString; + var deRandom = framework.delibs.debase.deRandom; + var gluTextureUtil = framework.opengl.gluTextureUtil; + var gluTexture = framework.opengl.gluTexture; + var gluDrawUtil = framework.opengl.gluDrawUtil; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuTexture = framework.common.tcuTexture; + var tcuMatrix = framework.common.tcuMatrix; + var tcuRGBA = framework.common.tcuRGBA; + var tcuTestCase = framework.common.tcuTestCase; + var tcuSurface = framework.common.tcuSurface; + var gluShaderProgram = framework.opengl.gluShaderProgram; + + /** @typedef {function(glsShaderRenderCase.ShaderEvalContext)} */ glsShaderRenderCase.ShaderEvalFunc; + + /** @const {number} */ glsShaderRenderCase.GRID_SIZE = 64; + /** @const {number} */ glsShaderRenderCase.MAX_RENDER_WIDTH = 128; + /** @const {number} */ glsShaderRenderCase.MAX_RENDER_HEIGHT = 112; + /** @const {Array} */ glsShaderRenderCase.DEFAULT_CLEAR_COLOR = [0.125, 0.25, 0.5, 1.0]; + /** @const {number} */ glsShaderRenderCase.MAX_USER_ATTRIBS = 4; + /** @const {number} */ glsShaderRenderCase.MAX_TEXTURES = 4; + + /** + * @param {Array} a + * @return {tcuRGBA.RGBA} + */ + glsShaderRenderCase.toRGBA = function(a) { + return tcuRGBA.newRGBAComponents( + deMath.clamp(Math.round(a[0] * 255.0), 0, 255), + deMath.clamp(Math.round(a[1] * 255.0), 0, 255), + deMath.clamp(Math.round(a[2] * 255.0), 0, 255), + deMath.clamp(Math.round(a[3] * 255.0), 0, 255)); + }; + + /** + * Helper function + * @param {?(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} tex + * @return {gluTexture.Type} + */ + glsShaderRenderCase.getTextureType = function(tex) { + if (tex === null || tex.getType() <= 0) + return gluTexture.Type.TYPE_NONE; + else + return tex.getType(); + }; + + /** + * @constructor + * @param {number=} indent + */ + glsShaderRenderCase.LineStream = function(indent) { + indent = indent === undefined ? 0 : indent; + /** @type {number} */ this.m_indent = indent; + /** @type {string} */ this.m_stream; + /** @type {string} */ this.m_string; + }; + + /** + * @return {string} + */ + glsShaderRenderCase.LineStream.prototype.str = function() { + this.m_string = this.m_stream; + return this.m_string; + }; + + /** + * @constructor + * @param {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)=} tex + * @param {tcuTexture.Sampler=} sampler + */ + glsShaderRenderCase.TextureBinding = function(tex, sampler) { + tex = tex === undefined ? null : tex; + sampler = sampler === undefined ? null : sampler; + /** @type {gluTexture.Type} */ this.m_type = glsShaderRenderCase.getTextureType(tex); + /** @type {tcuTexture.Sampler} */ this.m_sampler = sampler; + /** @type {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} */ + this.m_binding = tex; + }; + + /** + * @param {tcuTexture.Sampler} sampler + */ + glsShaderRenderCase.TextureBinding.prototype.setSampler = function(sampler) { + this.m_sampler = sampler; + }; + + /** + * @param {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} tex + */ + glsShaderRenderCase.TextureBinding.prototype.setTexture = function(tex) { + this.m_type = glsShaderRenderCase.getTextureType(tex); + this.m_binding = tex; + }; + + /** @return {gluTexture.Type} */ + glsShaderRenderCase.TextureBinding.prototype.getType = function() { + return this.m_type; + }; + + /** @return {tcuTexture.Sampler} */ + glsShaderRenderCase.TextureBinding.prototype.getSampler = function() { + return this.m_sampler; + }; + + /** @return {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} */ + glsShaderRenderCase.TextureBinding.prototype.getBinding = function() { + return this.m_binding; + }; + + /** + * @constructor + * @param {number} gridSize + * @param {number} width + * @param {number} height + * @param {Array} constCoords + * @param {Array} userAttribTransforms + * @param {Array} textures + */ + glsShaderRenderCase.QuadGrid = function(gridSize, width, height, constCoords, userAttribTransforms, textures) { + /** @type {number} */ this.m_gridSize = gridSize; + /** @type {number} */ this.m_numVertices = (gridSize + 1) * (gridSize + 1); + /** @type {number} */ this.m_numTriangles = (gridSize * gridSize *2); + /** @type {Array} */ this.m_constCoords = constCoords; + /** @type {Array} */ this.m_userAttribTransforms = userAttribTransforms; + /** @type {Array} */ this.m_textures = textures; + /** @type {Array>} */ this.m_screenPos = []; + /** @type {Array>} */ this.m_positions = []; + /** @type {Array>} */ this.m_coords = []; //!< Near-unit coordinates, roughly [-2.0 .. 2.0]. + /** @type {Array>} */ this.m_unitCoords = []; //!< Positive-only coordinates [0.0 .. 1.5]. + /** @type {Array} */ this.m_attribOne = []; + /** @type {Array>} */ this.m_userAttribs = []; + for (var attribNdx = 0; attribNdx < this.getNumUserAttribs(); attribNdx++) + this.m_userAttribs[attribNdx] = []; + /** @type {Array} */ this.m_indices = []; + + /** @type Array} */ var viewportScale = [width, height, 0, 0]; + for (var y = 0; y < gridSize + 1; y++) + for (var x = 0; x < gridSize + 1; x++) { + /** @type {number} */ var sx = x / gridSize; + /** @type {number} */ var sy = y / gridSize; + /** @type {number} */ var fx = 2.0 * sx - 1.0; + /** @type {number} */ var fy = 2.0 * sy - 1.0; + /** @type {number} */ var vtxNdx = ((y * (gridSize + 1)) + x); + + this.m_positions[vtxNdx] = [fx, fy, 0.0, 1.0]; + this.m_attribOne[vtxNdx] = 1.0; + this.m_screenPos[vtxNdx] = deMath.multiply([sx, sy, 0.0, 1.0], viewportScale); + this.m_coords[vtxNdx] = this.getCoords(sx, sy); + this.m_unitCoords[vtxNdx] = this.getUnitCoords(sx, sy); + + for (var attribNdx = 0; attribNdx < this.getNumUserAttribs(); attribNdx++) + this.m_userAttribs[attribNdx][vtxNdx] = this.getUserAttrib(attribNdx, sx, sy); + } + + // Compute indices. + for (var y = 0; y < gridSize; y++) + for (var x = 0; x < gridSize; x++) { + /** @type {number} */ var stride = gridSize + 1; + /** @type {number} */ var v00 = (y * stride) + x; + /** @type {number} */ var v01 = (y * stride) + x + 1; + /** @type {number} */ var v10 = ((y + 1) * stride) + x; + /** @type {number} */ var v11 = ((y + 1) * stride) + x + 1; + + /** @type {number} */ var baseNdx = ((y * gridSize) + x) * 6; + this.m_indices[baseNdx + 0] = v10; + this.m_indices[baseNdx + 1] = v00; + this.m_indices[baseNdx + 2] = v01; + + this.m_indices[baseNdx + 3] = v10; + this.m_indices[baseNdx + 4] = v01; + this.m_indices[baseNdx + 5] = v11; + } + }; + + /** @return {number} */ + glsShaderRenderCase.QuadGrid.prototype.getGridSize = function() { + return this.m_gridSize; + }; + + /** @return {number} */ + glsShaderRenderCase.QuadGrid.prototype.getNumVertices = function() { + return this.m_numVertices; + }; + + /** @return {number} */ + glsShaderRenderCase.QuadGrid.prototype.getNumTriangles = function() { + return this.m_numTriangles; + }; + + /** @return {Array} */ + glsShaderRenderCase.QuadGrid.prototype.getConstCoords = function() { + return this.m_constCoords; + }; + + /** @return {Array} */ + glsShaderRenderCase.QuadGrid.prototype.getUserAttribTransforms = function() { + return this.m_userAttribTransforms; + }; + + /** @return {Array} */ + glsShaderRenderCase.QuadGrid.prototype.getTextures = function() { + return this.m_textures; + }; + + /** @return {Array>} */ + glsShaderRenderCase.QuadGrid.prototype.getPositions = function() { + return this.m_positions; + }; + + /** @return {Array} */ + glsShaderRenderCase.QuadGrid.prototype.getAttribOne = function() { + return this.m_attribOne; + }; + + /** @return {Array>} */ + glsShaderRenderCase.QuadGrid.prototype.getCoordsArray = function() { + return this.m_coords; + }; + + /** @return {Array>} */ + glsShaderRenderCase.QuadGrid.prototype.getUnitCoordsArray = function() { + return this.m_unitCoords; + }; + + /** + * @param {number} attribNdx + * @return {Array} + */ + glsShaderRenderCase.QuadGrid.prototype.getUserAttribByIndex = function(attribNdx) { + return this.m_userAttribs[attribNdx]; + }; + + /** @return {Array} */ + glsShaderRenderCase.QuadGrid.prototype.getIndices = function() { + return this.m_indices; + }; + + /** + * @param {number} sx + * @param {number} sy + * @return {Array} + */ + glsShaderRenderCase.QuadGrid.prototype.getCoords = function(sx, sy) { + /** @type {number} */ var fx = 2.0 * sx - 1.0; + /** @type {number} */ var fy = 2.0 * sy - 1.0; + return [fx, fy, -fx + 0.33 * fy, -0.275 * fx - fy]; + }; + + /** + * @param {number} sx + * @param {number} sy + * @return {Array} + */ + glsShaderRenderCase.QuadGrid.prototype.getUnitCoords = function(sx, sy) { + return [sx, sy, 0.33 * sx + 0.5 * sy, 0.5 * sx + 0.25 * sy]; + }; + + /** + * @return {number} + */ + glsShaderRenderCase.QuadGrid.prototype.getNumUserAttribs = function() { + return this.m_userAttribTransforms.length; + }; + + /** + * @param {number} attribNdx + * @param {number} sx + * @param {number} sy + * @return {Array} + */ + glsShaderRenderCase.QuadGrid.prototype.getUserAttrib = function(attribNdx, sx, sy) { + // homogeneous normalized screen-space coordinates + return tcuMatrix.multiplyMatVec(this.m_userAttribTransforms[attribNdx], [sx, sy, 0.0, 1.0]); + }; + + /** + * @constructor + * @struct + */ + glsShaderRenderCase.ShaderSampler = function() { + /** @type {tcuTexture.Sampler} */ this.sampler; + /** @type {tcuTexture.Texture2D} */ this.tex2D = null; + /** @type {tcuTexture.TextureCube} */ this.texCube = null; + /** @type {tcuTexture.Texture2DArray} */ this.tex2DArray = null; + /** @type {tcuTexture.Texture3D} */ this.tex3D = null; + }; + + /** + * @constructor + * @param {glsShaderRenderCase.QuadGrid} quadGrid_ + */ + glsShaderRenderCase.ShaderEvalContext = function(quadGrid_) { + /** @type {Array} */ this.coords = [0, 0, 0, 0] + /** @type {Array} */ this.unitCoords = [0, 0, 0, 0] + /** @type {Array} */ this.constCoords = quadGrid_.getConstCoords(); + /** @type {Array>} */ this.in_ = []; + /** @type {Array} */ this.textures = []; + /** @type {Array} */ this.color = [0, 0, 0, 0.0]; + /** @type {boolean} */ this.isDiscarded = false; + /** @type {glsShaderRenderCase.QuadGrid} */ this.quadGrid = quadGrid_; + + /** @type {Array} */ var bindings = this.quadGrid.getTextures(); + assertMsgOptions(bindings.length <= glsShaderRenderCase.MAX_TEXTURES, 'Too many bindings.', false, true); + + // Fill in texture array. + for (var ndx = 0; ndx < bindings.length; ndx++) { + /** @type {glsShaderRenderCase.TextureBinding} */ var binding = bindings[ndx]; + + this.textures[ndx] = new glsShaderRenderCase.ShaderSampler(); + + if (binding.getType() == gluTexture.Type.TYPE_NONE) + continue; + + this.textures[ndx].sampler = binding.getSampler(); + + switch (binding.getType()) { + case gluTexture.Type.TYPE_2D: + this.textures[ndx].tex2D = binding.getBinding().getRefTexture(); + break; + case gluTexture.Type.TYPE_CUBE_MAP: + this.textures[ndx].texCube = binding.getBinding().getRefTexture(); + break; + case gluTexture.Type.TYPE_2D_ARRAY: + this.textures[ndx].tex2DArray = binding.getBinding().getRefTexture(); + break; + case gluTexture.Type.TYPE_3D: + this.textures[ndx].tex3D = binding.getBinding().getRefTexture(); + break; + default: + throw new Error("Binding type not supported"); + } + } + }; + + /** + * @param {number} sx + * @param {number} sy + */ + glsShaderRenderCase.ShaderEvalContext.prototype.reset = function(sx, sy) { + // Clear old values + this.color = [0.0, 0.0, 0.0, 1.0]; + this.isDiscarded = false; + + // Compute coords + this.coords = this.quadGrid.getCoords(sx, sy); + this.unitCoords = this.quadGrid.getUnitCoords(sx, sy); + + // Compute user attributes. + /** @type {number} */ var numAttribs = this.quadGrid.getNumUserAttribs(); + assertMsgOptions(numAttribs <= glsShaderRenderCase.MAX_USER_ATTRIBS, 'numAttribs out of range', false, true); + for (var attribNdx = 0; attribNdx < numAttribs; attribNdx++) + this.in_[attribNdx] = this.quadGrid.getUserAttrib(attribNdx, sx, sy); + }; + + glsShaderRenderCase.ShaderEvalContext.prototype.discard = function() { + this.isDiscarded = true; + }; + + /** + * @param {number} unitNdx + * @param {Array} coords + */ + glsShaderRenderCase.ShaderEvalContext.prototype.texture2D = function(unitNdx, coords) { + if (this.textures.length > 0 && this.textures[unitNdx].tex2D) + return this.textures[unitNdx].tex2D.getView().sample(this.textures[unitNdx].sampler, coords, 0.0); + else + return [0.0, 0.0, 0.0, 1.0]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + glsShaderRenderCase.evalCoordsPassthroughX = function(c) { + c.color[0] = c.coords[0]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + glsShaderRenderCase.evalCoordsPassthroughXY = function(c) { + var swizzle01 = deMath.swizzle(c.coords, [0, 1]); + c.color[0] = swizzle01[0]; + c.color[1] = swizzle01[1]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + glsShaderRenderCase.evalCoordsPassthroughXYZ = function(c) { + var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]); + c.color[0] = swizzle012[0]; + c.color[1] = swizzle012[1]; + c.color[2] = swizzle012[2]; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + glsShaderRenderCase.evalCoordsPassthrough = function(c) { + c.color = c.coords; + }; + + /** @param {glsShaderRenderCase.ShaderEvalContext} c */ + glsShaderRenderCase.evalCoordsSwizzleWZYX = function(c) { + c.color = deMath.swizzle(c.coords, [3, 2, 1, 0]); + }; + + /** + * @constructor + * @param {?glsShaderRenderCase.ShaderEvalFunc=} evalFunc + */ + glsShaderRenderCase.ShaderEvaluator = function(evalFunc) { + /** @type {?glsShaderRenderCase.ShaderEvalFunc} */ this.m_evalFunc = evalFunc || null; + }; + + /** + * @param {glsShaderRenderCase.ShaderEvalContext} ctx + */ + glsShaderRenderCase.ShaderEvaluator.prototype.evaluate = function(ctx) { + assertMsgOptions(this.m_evalFunc !== null, 'No evaluation function specified.', false, true); + this.m_evalFunc(ctx); + }; + + /** + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + * @param {boolean} isVertexCase + * @param {glsShaderRenderCase.ShaderEvalFunc=} evalFunc + */ + glsShaderRenderCase.ShaderRenderCase = function(name, description, isVertexCase, evalFunc) { + tcuTestCase.DeqpTest.call(this, name, description); + // evalFunc = evalFunc || null; + /** @type {boolean} */ this.m_isVertexCase = isVertexCase; + /** @type {?glsShaderRenderCase.ShaderEvalFunc} */ this.m_defaultEvaluator = evalFunc || null; + /** @type {glsShaderRenderCase.ShaderEvaluator} */ this.m_evaluator = new glsShaderRenderCase.ShaderEvaluator(this.m_defaultEvaluator); + /** @type {string} */ this.m_vertShaderSource = ''; + /** @type {string} */ this.m_fragShaderSource = ''; + /** @type {Array} */ this.m_clearColor = glsShaderRenderCase.DEFAULT_CLEAR_COLOR; + /** @type {Array} */ this.m_userAttribTransforms = []; + /** @type {Array} */ this.m_textures = []; + /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null; + }; + + /** + * @param {string} name + * @param {string} description + * @param {boolean} isVertexCase + * @param {glsShaderRenderCase.ShaderEvaluator} evaluator + * @return {glsShaderRenderCase.ShaderRenderCase} + */ + glsShaderRenderCase.ShaderRenderCase.newWithEvaluator = function(name, description, isVertexCase, evaluator) { + var renderCase = new glsShaderRenderCase.ShaderRenderCase(name, description, isVertexCase); + renderCase.m_evaluator = evaluator; + return renderCase; + }; + + glsShaderRenderCase.ShaderRenderCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsShaderRenderCase.ShaderRenderCase.prototype.constructor = glsShaderRenderCase.ShaderRenderCase; + + glsShaderRenderCase.ShaderRenderCase.prototype.deinit = function() { + this.m_program = null; + }; + + glsShaderRenderCase.ShaderRenderCase.prototype.init = function() { + this.postinit(); + }; + + glsShaderRenderCase.ShaderRenderCase.prototype.postinit = function() { + if (this.m_vertShaderSource.length === 0 || this.m_fragShaderSource.length === 0) { + assertMsgOptions(this.m_vertShaderSource.length === 0 && this.m_fragShaderSource.length === 0, 'No shader source.', false, true); + this.setupShaderData(); + } + + assertMsgOptions(!this.m_program, 'Program defined.', false, true); + this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(this.m_vertShaderSource, this.m_fragShaderSource)); + + try { + bufferedLogToConsole(this.m_program.program.info.infoLog); // Always log shader program. + + if (!this.m_program.isOk()) + throw new Error("Shader compile error."); + } + catch (exception) { + // Clean up. + this.deinit(); + throw exception; + } + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + glsShaderRenderCase.ShaderRenderCase.prototype.postiterate = function() { + assertMsgOptions(this.m_program !== null, 'Program not specified.', false, true); + /** @type {?WebGLProgram} */ var programID = this.m_program.getProgram(); + gl.useProgram(programID); + + // Create quad grid. + /** @type {Array} */ var viewportSize = this.getViewportSize(); + /** @type {number} */ var width = viewportSize[0]; + /** @type {number} */ var height = viewportSize[1]; + + // \todo [petri] Better handling of constCoords (render in multiple chunks, vary coords). + /** @type {glsShaderRenderCase.QuadGrid} */ + var quadGrid = new glsShaderRenderCase.QuadGrid( + this.m_isVertexCase ? glsShaderRenderCase.GRID_SIZE : 4, width, height, + [0.125, 0.25, 0.5, 1.0], this.m_userAttribTransforms, this.m_textures); + + // Render result. + /** @type {tcuSurface.Surface} */ var resImage = new tcuSurface.Surface(width, height); + this.render(resImage, programID, quadGrid); + + // Compute reference. + /** @type {tcuSurface.Surface} */ var refImage = new tcuSurface.Surface(width, height); + if (this.m_isVertexCase) + this.computeVertexReference(refImage, quadGrid); + else + this.computeFragmentReference(refImage, quadGrid); + + // Compare. + /** @type {boolean} */ var testOk = this.compareImages(resImage, refImage, 0.05); + + // De-initialize. + gl.useProgram(null); + + if (!testOk) + testFailedOptions("Fail", false); + else + testPassedOptions("Pass", true); + + return tcuTestCase.IterateResult.STOP; + }; + + /** + * @return {tcuTestCase.IterateResult} + */ + glsShaderRenderCase.ShaderRenderCase.prototype.iterate = function() { + return this.postiterate(); + }; + + glsShaderRenderCase.ShaderRenderCase.prototype.setupShaderData = function() {}; + + /** + * @param {?WebGLProgram} programId + */ + glsShaderRenderCase.ShaderRenderCase.prototype.setup = function(programId) {}; + + /** + * @param {?WebGLProgram} programId + * @param {Array} constCoords + */ + glsShaderRenderCase.ShaderRenderCase.prototype.setupUniforms = function(programId, constCoords) {}; + + /** + * @return {Array} + */ + glsShaderRenderCase.ShaderRenderCase.prototype.getViewportSize = function() { + return [Math.min(gl.canvas.width, glsShaderRenderCase.MAX_RENDER_WIDTH), + Math.min(gl.canvas.height, glsShaderRenderCase.MAX_RENDER_HEIGHT)]; + }; + + /** + * @param {?WebGLProgram} programId + */ + glsShaderRenderCase.ShaderRenderCase.prototype.setupDefaultInputs = function(programId) { + // SETUP UNIFORMS. + glsShaderRenderCase.setupDefaultUniforms(programId); + + // SETUP TEXTURES. + for (var ndx = 0; ndx < this.m_textures.length; ndx++) { + /** @type {glsShaderRenderCase.TextureBinding} */ var tex = this.m_textures[ndx]; + /** @type {tcuTexture.Sampler} */ var sampler = tex.getSampler(); + /** @type {number} */ var texTarget = gl.NONE; + /** @type {number} */ var texObj = 0; + + if (tex.getType() === gluTexture.Type.TYPE_NONE) + continue; + + switch (tex.getType()) { + case gluTexture.Type.TYPE_2D: + texTarget = gl.TEXTURE_2D; + texObj = tex.getBinding().getGLTexture(); + break; + case gluTexture.Type.TYPE_CUBE_MAP: + texTarget = gl.TEXTURE_CUBE_MAP; + texObj = tex.getBinding().getGLTexture(); + break; + case gluTexture.Type.TYPE_2D_ARRAY: + texTarget = gl.TEXTURE_2D_ARRAY; + texObj = tex.getBinding().getGLTexture(); + break; + case gluTexture.Type.TYPE_3D: + texTarget = gl.TEXTURE_3D; + texObj = tex.getBinding().getGLTexture(); + break; + default: + throw new Error("Type not supported"); + } + + gl.activeTexture(gl.TEXTURE0+ ndx); + gl.bindTexture(texTarget, texObj); + gl.texParameteri(texTarget, gl.TEXTURE_WRAP_S, gluTextureUtil.getGLWrapMode(sampler.wrapS)); + gl.texParameteri(texTarget, gl.TEXTURE_WRAP_T, gluTextureUtil.getGLWrapMode(sampler.wrapT)); + gl.texParameteri(texTarget, gl.TEXTURE_MIN_FILTER, gluTextureUtil.getGLFilterMode(sampler.minFilter)); + gl.texParameteri(texTarget, gl.TEXTURE_MAG_FILTER, gluTextureUtil.getGLFilterMode(sampler.magFilter)); + + if (texTarget === gl.TEXTURE_3D) + gl.texParameteri(texTarget, gl.TEXTURE_WRAP_R, gluTextureUtil.getGLWrapMode(sampler.wrapR)); + + if (sampler.compare != tcuTexture.CompareMode.COMPAREMODE_NONE) + { + gl.texParameteri(texTarget, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + gl.texParameteri(texTarget, gl.TEXTURE_COMPARE_FUNC, gluTextureUtil.getGLCompareFunc(sampler.compare)); + } + } + }; + + /** + * @param {tcuSurface.Surface} result + * @param {?WebGLProgram} programId + * @param {glsShaderRenderCase.QuadGrid} quadGrid + **/ + glsShaderRenderCase.ShaderRenderCase.prototype.render = function(result, programId, quadGrid) { + // Buffer info. + /** @type {number} */ var width = result.getWidth(); + /** @type {number} */ var height = result.getHeight(); + + /** @type {number} */ var xOffsetMax = gl.drawingBufferWidth - width; + /** @type {number} */ var yOffsetMax = gl.drawingBufferHeight - height; + + /** @type {number} */ var hash = deString.deStringHash(this.m_vertShaderSource) + deString.deStringHash(this.m_fragShaderSource); + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(hash); + + /** @type {number} */ var xOffset = rnd.getInt(0, xOffsetMax); + /** @type {number} */ var yOffset = rnd.getInt(0, yOffsetMax); + + gl.viewport(xOffset, yOffset, width, height); + + // Setup program. + this.setupUniforms(programId, quadGrid.getConstCoords()); + this.setupDefaultInputs(programId); + + // Clear. + gl.clearColor(this.m_clearColor[0], this.m_clearColor[1], this.m_clearColor[2], this.m_clearColor[3]); + gl.clear(gl.COLOR_BUFFER_BIT); + + // Draw. + /** @type {Array} */ var vertexArrays = []; + /** @type {number} */ var numElements = quadGrid.getNumTriangles()*3; + + glsShaderRenderCase.getDefaultVertexArrays(quadGrid, programId, vertexArrays); + + gluDrawUtil.draw(gl, programId, vertexArrays, gluDrawUtil.triangles(quadGrid.getIndices())); + + // Read back results. + result.readViewport(gl, [xOffset, yOffset, width, height]); + + }; + + /** + * @param {tcuSurface.Surface} result + * @param {glsShaderRenderCase.QuadGrid} quadGrid + **/ + glsShaderRenderCase.ShaderRenderCase.prototype.computeVertexReference = function(result, quadGrid) { + // Buffer info. + /** @type {number} */ var width = result.getWidth(); + /** @type {number} */ var height = result.getHeight(); + /** @type {number} */ var gridSize = quadGrid.getGridSize(); + /** @type {number} */ var stride = gridSize + 1; + /** @type {boolean} */ var hasAlpha = gl.getContextAttributes().alpha; + /** @type {glsShaderRenderCase.ShaderEvalContext} */ + var evalCtx = new glsShaderRenderCase.ShaderEvalContext(quadGrid); + /** @type {Array} */ var color = []; + // Evaluate color for each vertex. + /** @type {Array>} */ var colors = []; + for (var y = 0; y < gridSize + 1; y++) + for (var x = 0; x < gridSize + 1; x++) { + /** @type {number} */ var sx = x / gridSize; + /** @type {number} */ var sy = y / gridSize; + /** @type {number} */ var vtxNdx = ((y * (gridSize+ 1 )) + x); + + evalCtx.reset(sx, sy); + this.m_evaluator.evaluate(evalCtx); + assertMsgOptions(!evalCtx.isDiscarded, 'Discard is not available in vertex shader.', false, true); + color = evalCtx.color; + + if (!hasAlpha) + color[3] = 1.0; + + colors[vtxNdx] = color; + } + // Render quads. + for (var y = 0; y < gridSize; y++) + for (var x = 0; x < gridSize; x++) { + /** @type {number} */ var x0 = x / gridSize; + /** @type {number} */ var x1 = (x + 1) / gridSize; + /** @type {number} */ var y0 = y / gridSize; + /** @type {number} */ var y1 = (y + 1) / gridSize; + + /** @type {number} */ var sx0 = x0 * width; + /** @type {number} */ var sx1 = x1 * width; + /** @type {number} */ var sy0 = y0 * height; + /** @type {number} */ var sy1 = y1 * height; + /** @type {number} */ var oosx = 1.0 / (sx1 - sx0); + /** @type {number} */ var oosy = 1.0 / (sy1 - sy0); + + /** @type {number} */ var ix0 = Math.ceil(sx0 - 0.5); + /** @type {number} */ var ix1 = Math.ceil(sx1 - 0.5); + /** @type {number} */ var iy0 = Math.ceil(sy0 - 0.5); + /** @type {number} */ var iy1 = Math.ceil(sy1 - 0.5); + + /** @type {number} */ var v00 = (y * stride) + x; + /** @type {number} */ var v01 = (y * stride) + x + 1; + /** @type {number} */ var v10 = ((y + 1) * stride) + x; + /** @type {number} */ var v11 = ((y + 1) * stride) + x + 1; + /** @type {Array} */ var c00 = colors[v00]; + /** @type {Array} */ var c01 = colors[v01]; + /** @type {Array} */ var c10 = colors[v10]; + /** @type {Array} */ var c11 = colors[v11]; + + for (var iy = iy0; iy < iy1; iy++) + for (var ix = ix0; ix < ix1; ix++) { + assertMsgOptions(deMath.deInBounds32(ix, 0, width), 'Out of bounds.', false, true); + assertMsgOptions(deMath.deInBounds32(iy, 0, height), 'Out of bounds.', false, true); + + /** @type {number} */ var sfx = ix + 0.5; + /** @type {number} */ var sfy = iy + 0.5; + /** @type {number} */ var fx1 = deMath.clamp((sfx - sx0) * oosx, 0.0, 1.0); + /** @type {number} */ var fy1 = deMath.clamp((sfy - sy0) * oosy, 0.0, 1.0); + + // Triangle quad interpolation. + /** @type {boolean} */ var tri = fx1 + fy1 <= 1.0; + /** @type {number} */ var tx = tri ? fx1 : (1.0 - fx1); + /** @type {number} */ var ty = tri ? fy1 : (1.0 - fy1); + /** @type {Array} */ var t0 = tri ? c00 : c11; + /** @type {Array} */ var t1 = tri ? c01 : c10; + /** @type {Array} */ var t2 = tri ? c10 : c01; + color = deMath.add(t0, deMath.add(deMath.scale(deMath.subtract(t1, t0), tx), deMath.scale(deMath.subtract(t2, t0), ty))); + + result.setPixel(ix, iy, glsShaderRenderCase.toRGBA(color).toIVec()); + } + } + }; + + /** + * @param {tcuSurface.Surface} result + * @param {glsShaderRenderCase.QuadGrid} quadGrid + **/ + glsShaderRenderCase.ShaderRenderCase.prototype.computeFragmentReference = function(result, quadGrid) { + // Buffer info. + /** @type {number} */ var width = result.getWidth(); + /** @type {number} */ var height = result.getHeight(); + /** @type {boolean} */ var hasAlpha = gl.getContextAttributes().alpha; + /** @type {glsShaderRenderCase.ShaderEvalContext} */ var evalCtx = new glsShaderRenderCase.ShaderEvalContext(quadGrid); + + // Render. + for (var y = 0; y < height; y++) + for (var x = 0; x < width; x++) { + /** @type {number} */ var sx = (x + 0.5) / width; + /** @type {number} */ var sy = (y + 0.5) / height; + + evalCtx.reset(sx, sy); + this.m_evaluator.evaluate(evalCtx); + // Select either clear color or computed color based on discarded bit. + /** @type {Array} */ var color = evalCtx.isDiscarded ? this.m_clearColor : evalCtx.color; + + if (!hasAlpha) + color[3] = 1.0; + + result.setPixel(x, y, glsShaderRenderCase.toRGBA(color).toIVec()); + } + }; + + /** + * @param {tcuSurface.Surface} resImage + * @param {tcuSurface.Surface} refImage + * @param {number} errorThreshold + * @return {boolean} + */ + glsShaderRenderCase.ShaderRenderCase.prototype.compareImages = function(resImage, refImage, errorThreshold) { + return tcuImageCompare.fuzzyCompare("ComparisonResult", "Image comparison result", refImage.getAccess(), resImage.getAccess(), errorThreshold); + }; + + /** + * @param {number} number + * @return {string} */ + glsShaderRenderCase.getIntUniformName = function(number) { + switch (number) { + case 0: return "ui_zero"; + case 1: return "ui_one"; + case 2: return "ui_two"; + case 3: return "ui_three"; + case 4: return "ui_four"; + case 5: return "ui_five"; + case 6: return "ui_six"; + case 7: return "ui_seven"; + case 8: return "ui_eight"; + case 101: return "ui_oneHundredOne"; + default: + throw new Error("Uniform not supported."); + } + }; + + /** + * @param {number} number + * @return {string} */ + glsShaderRenderCase.getFloatUniformName = function(number) { + switch (number) { + case 0: return "uf_zero"; + case 1: return "uf_one"; + case 2: return "uf_two"; + case 3: return "uf_three"; + case 4: return "uf_four"; + case 5: return "uf_five"; + case 6: return "uf_six"; + case 7: return "uf_seven"; + case 8: return "uf_eight"; + default: + throw new Error("Uniform not supported."); + } + }; + + /** + * @param {number} number + * @return {string} */ + glsShaderRenderCase.getFloatFractionUniformName = function(number) { + switch (number) { + case 1: return "uf_one"; + case 2: return "uf_half"; + case 3: return "uf_third"; + case 4: return "uf_fourth"; + case 5: return "uf_fifth"; + case 6: return "uf_sixth"; + case 7: return "uf_seventh"; + case 8: return "uf_eighth"; + default: + throw new Error("Uniform not supported."); + } + }; + + /** + * @param {?WebGLProgram} programID + */ + glsShaderRenderCase.setupDefaultUniforms = function(programID) { + /** @type {?WebGLUniformLocation} */ var uniLoc; + // Bool. + /** + * @constructor + * @struct + */ + var BoolUniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {boolean} */ this.value = value; + }; + + /** @type {Array} */ var s_boolUniforms = [ + new BoolUniform("ub_true", true), + new BoolUniform("ub_false", false) + ]; + + for (var i = 0; i < s_boolUniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_boolUniforms[i].name); + if (uniLoc != null) + gl.uniform1i(uniLoc, s_boolUniforms[i].value ? 1 : 0); + } + + // BVec4. + /** + * @constructor + * @struct + */ + var BVec4Uniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {Array} */ this.value = value; + }; + + /** @type {Array} */ var s_bvec4Uniforms = [ + new BVec4Uniform("ub4_true", [true, true, true, true]), + new BVec4Uniform("ub4_false", [false, false, false, false]) + ]; + + for (var i = 0; i < s_bvec4Uniforms.length; i++) { + /** @type {BVec4Uniform} */ var uni = s_bvec4Uniforms[i]; + /** @type {Array} */ var arr = []; + arr[0] = uni.value[0] ? 1 : 0; + arr[1] = uni.value[1] ? 1 : 0; + arr[2] = uni.value[2] ? 1 : 0; + arr[3] = uni.value[3] ? 1 : 0; + uniLoc = gl.getUniformLocation(programID, uni.name); + if (uniLoc != null) + gl.uniform4iv(uniLoc, new Int32Array(arr)); + } + + // Int. + /** + * @constructor + * @struct + */ + var IntUniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.value = value; + }; + + /** @type {Array} */ var s_intUniforms = [ + new IntUniform("ui_minusOne", -1), + new IntUniform("ui_zero", 0), + new IntUniform("ui_one", 1), + new IntUniform("ui_two", 2), + new IntUniform("ui_three", 3), + new IntUniform("ui_four", 4), + new IntUniform("ui_five", 5), + new IntUniform("ui_six", 6), + new IntUniform("ui_seven", 7), + new IntUniform("ui_eight", 8), + new IntUniform("ui_oneHundredOne", 101) + ]; + + for (var i = 0; i < s_intUniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_intUniforms[i].name); + if (uniLoc != null) + gl.uniform1i(uniLoc, s_intUniforms[i].value); + } + + // IVec2. + /** + * @constructor + * @struct + */ + var IVec2Uniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {Array} */ this.value = value; + }; + + /** @type {Array} */ var s_ivec2Uniforms = [ + new IVec2Uniform("ui2_minusOne", [-1, -1]), + new IVec2Uniform("ui2_zero", [0, 0]), + new IVec2Uniform("ui2_one", [1, 1]), + new IVec2Uniform("ui2_two", [2, 2]), + new IVec2Uniform("ui2_four", [4, 4]), + new IVec2Uniform("ui2_five", [5, 5]) + ]; + + for (var i = 0; i < s_ivec2Uniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_ivec2Uniforms[i].name); + if (uniLoc != null) + gl.uniform2iv(uniLoc, new Int32Array(s_ivec2Uniforms[i].value)); + } + + // IVec3. + /** + * @constructor + * @struct + */ + var IVec3Uniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {Array} */ this.value = value; + }; + + /** @type {Array} */ var s_ivec3Uniforms = [ + new IVec3Uniform("ui3_minusOne", [-1, -1, -1]), + new IVec3Uniform("ui3_zero", [0, 0, 0]), + new IVec3Uniform("ui3_one", [1, 1, 1]), + new IVec3Uniform("ui3_two", [2, 2, 2]), + new IVec3Uniform("ui3_four", [4, 4, 4]), + new IVec3Uniform("ui3_five", [5, 5, 5]) + ]; + + for (var i = 0; i < s_ivec3Uniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_ivec3Uniforms[i].name); + if (uniLoc != null) + gl.uniform3iv(uniLoc, new Int32Array(s_ivec3Uniforms[i].value)); + } + + // IVec4. + /** + * @constructor + * @struct + */ + var IVec4Uniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {Array} */ this.value = value; + }; + /** @type {Array} */ var s_ivec4Uniforms = [ + new IVec4Uniform("ui4_minusOne", [-1, -1, -1, -1]), + new IVec4Uniform("ui4_zero", [0, 0, 0, 0]), + new IVec4Uniform("ui4_one", [1, 1, 1, 1]), + new IVec4Uniform("ui4_two", [2, 2, 2, 2]), + new IVec4Uniform("ui4_four", [4, 4, 4, 4]), + new IVec4Uniform("ui4_five", [5, 5, 5, 5]) + ]; + + for (var i = 0; i < s_ivec4Uniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_ivec4Uniforms[i].name); + if (uniLoc != null) + gl.uniform4iv(uniLoc, new Int32Array(s_ivec4Uniforms[i].value)); + } + + // Float. + /** + * @constructor + * @struct + */ + var FloatUniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {number} */ this.value = value; + }; + /** @type {Array} */ var s_floatUniforms = [ + new FloatUniform("uf_zero", 0.0), + new FloatUniform("uf_one", 1.0), + new FloatUniform("uf_two", 2.0), + new FloatUniform("uf_three", 3.0), + new FloatUniform("uf_four", 4.0), + new FloatUniform("uf_five", 5.0), + new FloatUniform("uf_six", 6.0), + new FloatUniform("uf_seven", 7.0), + new FloatUniform("uf_eight", 8.0), + new FloatUniform("uf_half", 1.0 / 2.0), + new FloatUniform("uf_third", 1.0 / 3.0), + new FloatUniform("uf_fourth", 1.0 / 4.0), + new FloatUniform("uf_fifth", 1.0 / 5.0), + new FloatUniform("uf_sixth", 1.0 / 6.0), + new FloatUniform("uf_seventh", 1.0 / 7.0), + new FloatUniform("uf_eighth", 1.0 / 8.0) + ]; + + for (var i = 0; i < s_floatUniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_floatUniforms[i].name); + if (uniLoc != null) + gl.uniform1f(uniLoc, s_floatUniforms[i].value); + } + + // Vec2. + /** + * @constructor + * @struct + */ + var Vec2Uniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {Array} */ this.value = value; + }; + /** @type {Array} */ var s_vec2Uniforms = [ + new Vec2Uniform("uv2_minusOne", [-1.0, -1.0]), + new Vec2Uniform("uv2_zero", [0.0, 0.0]), + new Vec2Uniform("uv2_half", [0.5, 0.5]), + new Vec2Uniform("uv2_one", [1.0, 1.0]), + new Vec2Uniform("uv2_two", [2.0, 2.0]) + ]; + + for (var i = 0; i < s_vec2Uniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_vec2Uniforms[i].name); + if (uniLoc != null) + gl.uniform2fv(uniLoc, new Float32Array(s_vec2Uniforms[i].value)); + } + + // Vec3. + /** + * @constructor + * @struct + */ + var Vec3Uniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {Array} */ this.value = value; + }; + /** @type {Array} */ var s_vec3Uniforms = [ + new Vec3Uniform("uv3_minusOne", [-1.0, -1.0, -1.0]), + new Vec3Uniform("uv3_zero", [0.0, 0.0, 0.0]), + new Vec3Uniform("uv3_half", [0.5, 0.5, 0.5]), + new Vec3Uniform("uv3_one", [1.0, 1.0, 1.0]), + new Vec3Uniform("uv3_two", [2.0, 2.0, 2.0]) + ]; + + for (var i = 0; i < s_vec3Uniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_vec3Uniforms[i].name); + if (uniLoc != null) + gl.uniform3fv(uniLoc, new Float32Array(s_vec3Uniforms[i].value)); + } + + // Vec4. + /** + * @constructor + * @struct + */ + var Vec4Uniform = function(name, value) { + /** @type {string} */ this.name = name; + /** @type {Array} */ this.value = value; + }; + /** @type {Array} */ var s_vec4Uniforms = [ + new Vec4Uniform("uv4_minusOne", [-1.0, -1.0, -1.0, -1.0]), + new Vec4Uniform("uv4_zero", [0.0, 0.0, 0.0, 0.0]), + new Vec4Uniform("uv4_half", [0.5, 0.5, 0.5, 0.5]), + new Vec4Uniform("uv4_one", [1.0, 1.0, 1.0, 1.0]), + new Vec4Uniform("uv4_two", [2.0, 2.0, 2.0, 2.0]), + new Vec4Uniform("uv4_black", [0.0, 0.0, 0.0, 1.0]), + new Vec4Uniform("uv4_gray", [0.5, 0.5, 0.5, 1.0]), + new Vec4Uniform("uv4_white", [1.0, 1.0, 1.0, 1.0]) + ]; + + for (var i = 0; i < s_vec4Uniforms.length; i++) { + uniLoc = gl.getUniformLocation(programID, s_vec4Uniforms[i].name); + if (uniLoc != null) + gl.uniform4fv(uniLoc, new Float32Array(s_vec4Uniforms[i].value)); + } + }; + + /** + * @param {glsShaderRenderCase.QuadGrid} quadGrid + * @param {?WebGLProgram} program + * @param {Array} vertexArrays + */ + glsShaderRenderCase.getDefaultVertexArrays = function(quadGrid, program, vertexArrays) { + /** @type {number} */ var numElements = quadGrid.getNumVertices(); + var posArray = [].concat.apply([], quadGrid.getPositions()); + var coordsArray = [].concat.apply([], quadGrid.getCoordsArray()); + var unitCoordsArray = [].concat.apply([], quadGrid.getUnitCoordsArray()); + + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numElements, 0, posArray)); + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_coords", 4, numElements, 0, coordsArray)); + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_unitCoords", 4, numElements, 0, unitCoordsArray)); + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_one", 1, numElements, 0, quadGrid.getAttribOne())); + + // a_inN. + for (var userNdx = 0; userNdx < quadGrid.getNumUserAttribs(); userNdx++) { + /** @type {string} */ var name = "a_in" + userNdx; + var userAttribArray = [].concat.apply([], quadGrid.getUserAttribByIndex(userNdx)); + vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding(name, 4, numElements, 0, userAttribArray)); + } + + // Matrix attributes - these are set by location + /** + * @constructor + * @struct + */ + var Matrix = function(name, cols, rows) { + this.name = name; + this.numCols = cols; + this.numRows = rows; + }; + + /** @type {Array} */ var matrices = [ + new Matrix('a_mat2', 2, 2), + new Matrix('a_mat2x3', 2, 3), + new Matrix('a_mat2x4', 2, 4), + new Matrix('a_mat3x2', 3, 2), + new Matrix('a_mat3', 3, 3), + new Matrix('a_mat3x4', 3, 4), + new Matrix('a_mat4x2', 4, 2), + new Matrix('a_mat4x3', 4, 3), + new Matrix('a_mat4', 4, 4) + ]; + + for (var matNdx = 0; matNdx < matrices.length; matNdx++) { + /** @type {number} */ var loc = gl.getAttribLocation(program, matrices[matNdx].name); + + if (loc < 0) + continue; // Not used in shader. + + /** @type {number} */ var numRows = matrices[matNdx].numRows; + /** @type {number} */ var numCols = matrices[matNdx].numCols; + + for (var colNdx = 0; colNdx < numCols; colNdx++) { + var data = [].concat.apply([], quadGrid.getUserAttribByIndex(colNdx)); + vertexArrays.push(gluDrawUtil.newFloatColumnVertexArrayBinding(matrices[matNdx].name, colNdx, numRows, numElements, 4 * 4, data)); + } + } + }; +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js new file mode 100644 index 000000000..962d87fb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js @@ -0,0 +1,367 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsStateQuery'); + +goog.scope(function() { +var glsStateQuery = modules.shared.glsStateQuery; + +/** + * Compare two objects. Objects must have the same type and contents. + * If comparing numbers, allow some epsilon differences + * @param {*} a + * @param {*} b + * return {boolean} + */ +glsStateQuery.compare = function(a, b) { + /** @const */ var eps = 0.01; + if (a === b) + return true; + + if (typeof a === 'number' && typeof b === 'number') + return Math.abs(a - b) < eps; + + //compare array-like parameters + if (typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) + return false; + + if ('length' in a && 'length' in b) { + if (a.length !== b.length) + return false; + for (var i = 0; i < a.length; i++) { + if (typeof a[i] === 'number' && typeof b[i] === 'number') { + if (Math.abs(a[i] - b[i]) >= eps) + return false; + } else if (a[i] !== b[i]) + return false; + } + return true; + } + + } + return false; +}; + +/** + * Verify that WebGL state 'param' has the expected value + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verify = function(param, reference) { + var value = gl.getParameter(param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL current vertex attrib has the expected value + * @param {number} index + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyCurrentVertexAttrib = function(index, reference) { + var value = gl.getVertexAttrib(index, gl.CURRENT_VERTEX_ATTRIB); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL vertex attrib attribute 'param' has the expected value + * @param {number} index + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyVertexAttrib = function(index, param, reference) { + var value = (param == gl.VERTEX_ATTRIB_ARRAY_POINTER) ? + gl.getVertexAttribOffset(index, param) : + gl.getVertexAttrib(index, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL uniform has the expected value + * @param {WebGLProgram} program + * @param {WebGLUniformLocation} location + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyUniform = function(program, location, reference) { + var value = gl.getUniform(program, location); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL shader state 'param' has the expected value + * @param {WebGLShader} shader + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyShader = function(shader, param, reference) { + var value = gl.getShaderParameter(shader, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL program state 'param' has the expected value + * @param {WebGLProgram} program + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyProgram = function(program, param, reference) { + var value = gl.getProgramParameter(program, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL sampler state 'param' has the expected value + * @param {WebGLSampler} sampler + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifySampler = function(sampler, param, reference) { + var value = gl.getSamplerParameter(sampler, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL texture state 'param' has the expected value + * @param {number} target + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyTexture = function(target, param, reference) { + var value = gl.getTexParameter(target, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL state 'param' has one of the expected values + * @param {number} param + * @param {Array<*>} reference + * return {boolean} + */ +glsStateQuery.verifyAnyOf = function(param, reference) { + var value = gl.getParameter(param); + for (var i = 0; i < reference.length; i++) + if (glsStateQuery.compare(value, reference[i])) + return true; + bufferedLogToConsole('Result: ' + value + ' Expected one of: ' + reference); + return false; +}; + +/** + * Verify that WebGL state 'param' has the expected value + * @param {number} param + * @param {number|Array} reference + * @return {boolean} + */ +glsStateQuery.verifyGreaterOrEqual = function(param, reference) { + var value = gl.getParameter(param); + if (reference instanceof Array) { + var v = /** @type {Array} */ (value); + if (v.length != reference.length) { + bufferedLogToConsole('Result: ' + value + ' Expected >= : ' + reference); + return false; + } + for (var i = 0; i < reference.length; i++) + if (v[i] < reference[i]) { + bufferedLogToConsole('Result: ' + value + ' Expected >= : ' + reference); + return false; + } + return true; + } + var n = /** @type {number} */ (value); + if (n < reference) { + bufferedLogToConsole('Result: ' + value + ' Expected >= : ' + reference); + return false; + } + return true; +}; + +/** + * Verify that WebGL state 'param' has the expected value + * @param {number} param + * @param {number|Array} reference + * @return {boolean} + */ +glsStateQuery.verifyLessOrEqual = function(param, reference) { + var value = gl.getParameter(param); + if (reference instanceof Array) { + var v = /** @type {Array} */ (value); + if (v.length != reference.length) { + bufferedLogToConsole('Result: ' + value + ' Expected <= : ' + reference); + return false; + } + for (var i = 0; i > reference.length; i++) + if (v[i] < reference[i]) { + bufferedLogToConsole('Result: ' + value + ' Expected <= : ' + reference); + return false; + } + return true; + } + var n = /** @type {number} */ (value); + if (n > reference) { + bufferedLogToConsole('Result: ' + value + ' Expected <= : ' + reference); + return false; + } + return true; +}; + +/** + * Verify that WebGL state 'param' has the expected value (value & mask == reference) + * @param {number} param + * @param {number} reference + * @param {number} mask + * @return {boolean} + */ +glsStateQuery.verifyMasked = function(param, reference, mask) { + var value = /** @type {number} */ (gl.getParameter(param)); + if ((value & mask) !== reference) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference + 'Mask: 0x' + mask.toString(16)); + return false; + } + return true; +}; + +/** + * Verify that WebGL fbo attachment 'param' has the expected value + * @param {number} fbo + * @param {number} attachment + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyAttachment = function(fbo, attachment, param, reference) { + var value = gl.getFramebufferAttachmentParameter(fbo, attachment, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL fbo color attachment 'param' has the expected value + * @param {number} fbo + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyColorAttachment = function(fbo, param, reference) { + return glsStateQuery.verifyAttachment(fbo, gl.COLOR_ATTACHMENT0, param, reference); +}; + +/** + * Verify that WebGL rbo attribute 'param' has the expected value + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyRenderbuffer = function(param, reference) { + var value = gl.getRenderbufferParameter(gl.RENDERBUFFER, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * Verify that WebGL active uniform block's attribute 'param' has the expected value + * @param {WebGLProgram} program + * @param {number} index + * @param {number} param + * @param {*} reference + * @return {boolean} + */ +glsStateQuery.verifyActiveUniformBlock = function(program, index, param, reference) { + var value = gl.getActiveUniformBlockParameter(program, index, param); + var result = glsStateQuery.compare(value, reference); + if (!result) { + bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference); + } + return result; +}; + +/** + * @param {number} param + * @param {Array} reference + * @param {Array} enableRef + * @return {boolean} + */ + +glsStateQuery.verifyMask = function(param, reference, enableRef) { + var intVector4 = /** @type {Array} */ (gl.getParameter(param)); + + if ((enableRef[0] && (intVector4[0] != reference[0])) || + (enableRef[1] && (intVector4[1] != reference[1])) || + (enableRef[2] && (intVector4[2] != reference[2])) || + (enableRef[3] && (intVector4[3] != reference[3]))) + { + bufferedLogToConsole("// ERROR: expected " + + (enableRef[0] ? "" : "(") + reference[0] + (enableRef[0] ? "" : ")") + ", " + + (enableRef[1] ? "" : "(") + reference[1] + (enableRef[1] ? "" : ")") + ", " + + (enableRef[2] ? "" : "(") + reference[2] + (enableRef[2] ? "" : ")") + ", " + + (enableRef[3] ? "" : "(") + reference[3] + (enableRef[3] ? "" : ")")); + + return false; + } + return true; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js new file mode 100644 index 000000000..f35d94226 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js @@ -0,0 +1,2642 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsTextureTestUtil'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuStringTemplate'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTexLookupVerifier'); +goog.require('framework.common.tcuTexCompareVerifier'); +goog.require('framework.common.tcuTexture'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.delibs.debase.deRandom'); + +goog.scope(function() { +var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier; +var tcuTexCompareVerifier = framework.common.tcuTexCompareVerifier; +var glsTextureTestUtil = modules.shared.glsTextureTestUtil; +var gluDrawUtil = framework.opengl.gluDrawUtil; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var tcuTexture = framework.common.tcuTexture; +var tcuSurface = framework.common.tcuSurface; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var tcuStringTemplate = framework.common.tcuStringTemplate; +var deMath = framework.delibs.debase.deMath; +var tcuImageCompare = framework.common.tcuImageCompare; +var tcuPixelFormat = framework.common.tcuPixelFormat; +var tcuRGBA = framework.common.tcuRGBA; +var deRandom = framework.delibs.debase.deRandom; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +var MIN_SUBPIXEL_BITS = 4; + +/** + * @enum + */ +glsTextureTestUtil.textureType = { + TEXTURETYPE_2D: 0, + TEXTURETYPE_CUBE: 1, + TEXTURETYPE_2D_ARRAY: 2, + TEXTURETYPE_3D: 3, + TEXTURETYPE_CUBE_ARRAY: 4, + TEXTURETYPE_1D: 5, + TEXTURETYPE_1D_ARRAY: 6, + TEXTURETYPE_BUFFER: 7 +}; + +/** + * @enum + */ +glsTextureTestUtil.samplerType = { + SAMPLERTYPE_FLOAT: 0, + SAMPLERTYPE_INT: 1, + SAMPLERTYPE_UINT: 2, + SAMPLERTYPE_SHADOW: 3, + + SAMPLERTYPE_FETCH_FLOAT: 4, + SAMPLERTYPE_FETCH_INT: 5, + SAMPLERTYPE_FETCH_UINT: 6 +}; + +/** + * @param {tcuTexture.TextureFormat} format + * @return {glsTextureTestUtil.samplerType} + */ +glsTextureTestUtil.getSamplerType = function(format) { + if (format == null) + throw new Error('Missing format information'); + + switch (format.type) { + case tcuTexture.ChannelType.SIGNED_INT8: + case tcuTexture.ChannelType.SIGNED_INT16: + case tcuTexture.ChannelType.SIGNED_INT32: + return glsTextureTestUtil.samplerType.SAMPLERTYPE_INT; + + case tcuTexture.ChannelType.UNSIGNED_INT8: + case tcuTexture.ChannelType.UNSIGNED_INT32: + case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: + return glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT; + + // Texture formats used in depth/stencil textures. + case tcuTexture.ChannelType.UNSIGNED_INT16: + case tcuTexture.ChannelType.UNSIGNED_INT_24_8: + return (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) ? glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT : glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT; + + default: + return glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT; + } +}; + +/** + * @constructor + * @param {HTMLElement} canvas + * @param {number} preferredWidth + * @param {number} preferredHeight + * @param {number=} seed + */ +glsTextureTestUtil.RandomViewport = function(canvas, preferredWidth, preferredHeight, seed) { + this.width = Math.min(canvas.width, preferredWidth); + this.height = Math.min(canvas.height, preferredHeight); + + if (typeof seed === 'undefined') + seed = preferredWidth + preferredHeight; + + var rnd = new deRandom.Random(seed); + this.x = rnd.getInt(0, canvas.width - this.width); + this.y = rnd.getInt(0, canvas.height - this.height); +}; + +/** + * @constructor + * @param {glsTextureTestUtil.textureType} texType + */ +glsTextureTestUtil.RenderParams = function(texType) { + this.flags = { + projected: false, + use_bias: false, + log_programs: false, + log_uniforms: false + }; + this.texType = texType; + this.w = [1, 1, 1, 1]; + this.bias = 0; + this.ref = 0; + this.colorScale = [1, 1, 1, 1]; + this.colorBias = [0, 0, 0, 0]; + this.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT; +}; + +/** + * @enum + */ +glsTextureTestUtil.lodMode = { + EXACT: 0, //!< Ideal lod computation. + MIN_BOUND: 1, //!< Use estimation range minimum bound. + MAX_BOUND: 2 //!< Use estimation range maximum bound. + +}; + +/** + * @constructor + * @extends {glsTextureTestUtil.RenderParams} + * @param {glsTextureTestUtil.textureType} texType + * @param {tcuTexture.Sampler=} sampler + * @param {glsTextureTestUtil.lodMode=} lodMode_ + */ +glsTextureTestUtil.ReferenceParams = function(texType, sampler, lodMode_) { + glsTextureTestUtil.RenderParams.call(this, texType); + if (sampler) + this.sampler = sampler; + if (lodMode_) + this.lodMode = lodMode_; + else + this.lodMode = glsTextureTestUtil.lodMode.EXACT; + this.minLod = -1000; + this.maxLod = 1000; + this.baseLevel = 0; + this.maxLevel = 1000; +}; + +glsTextureTestUtil.ReferenceParams.prototype = Object.create(glsTextureTestUtil.RenderParams.prototype); + +/** Copy constructor */ +glsTextureTestUtil.ReferenceParams.prototype.constructor = glsTextureTestUtil.ReferenceParams; + +/** + * @param {Array} bottomLeft + * @param {Array} topRight + * @return {Array} + */ +glsTextureTestUtil.computeQuadTexCoord2D = function(bottomLeft, topRight) { + var dst = []; + dst.length = 4 * 2; + + dst[0] = bottomLeft[0]; dst[1] = bottomLeft[1]; + dst[2] = bottomLeft[0]; dst[3] = topRight[1]; + dst[4] = topRight[0]; dst[5] = bottomLeft[1]; + dst[6] = topRight[0]; dst[7] = topRight[1]; + + return dst; +}; + +/** + * @param {tcuTexture.CubeFace} face + * @return {Array} + */ +glsTextureTestUtil.computeQuadTexCoordCube = function(face) { + var texCoordNegX = [ + -1, 1, -1, + -1, -1, -1, + -1, 1, 1, + -1, -1, 1 + ]; + var texCoordPosX = [ + +1, 1, 1, + +1, -1, 1, + +1, 1, -1, + +1, -1, -1 + ]; + var texCoordNegY = [ + -1, -1, 1, + -1, -1, -1, + 1, -1, 1, + 1, -1, -1 + ]; + var texCoordPosY = [ + -1, +1, -1, + -1, +1, 1, + 1, +1, -1, + 1, +1, 1 + ]; + var texCoordNegZ = [ + 1, 1, -1, + 1, -1, -1, + -1, 1, -1, + -1, -1, -1 + ]; + var texCoordPosZ = [ + -1, 1, +1, + -1, -1, +1, + 1, 1, +1, + 1, -1, +1 + ]; + + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: return texCoordNegX; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: return texCoordPosX; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: return texCoordNegY; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: return texCoordPosY; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: return texCoordNegZ; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: return texCoordPosZ; + } + throw new Error('Unrecognized face ' + face); +}; + +/** + * @param {tcuTexture.CubeFace} face + * @param {Array} bottomLeft + * @param {Array} topRight + * @return {Array} + */ +glsTextureTestUtil.computeQuadTexCoordCubeFace = function(face, bottomLeft, topRight) { + var dst = []; + /** @type {number} */ var sRow = 0; + /** @type {number} */ var tRow = 0; + /** @type {number} */ var mRow = 0; + /** @type {number} */ var sSign = 1.0; + /** @type {number} */ var tSign = 1.0; + /** @type {number} */ var mSign = 1.0; + + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: mRow = 0; sRow = 2; tRow = 1; mSign = -1.0; tSign = -1.0; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: mRow = 0; sRow = 2; tRow = 1; sSign = -1.0; tSign = -1.0; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: mRow = 1; sRow = 0; tRow = 2; mSign = -1.0; tSign = -1.0; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: mRow = 1; sRow = 0; tRow = 2; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: mRow = 2; sRow = 0; tRow = 1; mSign = -1.0; sSign = -1.0; tSign = -1.0; break; + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: mRow = 2; sRow = 0; tRow = 1; tSign = -1.0; break; + default: + throw new Error('Invalid cube face specified.'); + } + + dst[0 + mRow] = mSign; + dst[3 + mRow] = mSign; + dst[6 + mRow] = mSign; + dst[9 + mRow] = mSign; + + dst[0 + sRow] = sSign * bottomLeft[0]; + dst[3 + sRow] = sSign * bottomLeft[0]; + dst[6 + sRow] = sSign * topRight[0]; + dst[9 + sRow] = sSign * topRight[0]; + + dst[0 + tRow] = tSign * bottomLeft[1]; + dst[3 + tRow] = tSign * topRight[1]; + dst[6 + tRow] = tSign * bottomLeft[1]; + dst[9 + tRow] = tSign * topRight[1]; + + return dst; +}; + +/** + * @param {number} layerNdx + * @param {Array} bottomLeft + * @param {Array} topRight + * @return {Array} + */ +glsTextureTestUtil.computeQuadTexCoord2DArray = function(layerNdx, bottomLeft, topRight) { + var dst = []; + dst.length = 4 * 3; + + dst[0] = bottomLeft[0]; dst[1] = bottomLeft[1]; dst[2] = layerNdx; + dst[3] = bottomLeft[0]; dst[4] = topRight[1]; dst[5] = layerNdx; + dst[6] = topRight[0]; dst[7] = bottomLeft[1]; dst[8] = layerNdx; + dst[9] = topRight[0]; dst[10] = topRight[1]; dst[11] = layerNdx; + + return dst; +}; + +/** + * @param {Array} a + * @param {Array} b + * @param {Array} c + * @return {Array} a + (b - a) * c + */ +glsTextureTestUtil.selectCoords = function(a, b, c) { + var x1 = deMath.subtract(b, a); + var x2 = deMath.multiply(x1, c); + var x3 = deMath.add(a, x2); + return x3; +}; + +/** + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} dirSwz + * @return {Array} + */ +glsTextureTestUtil.computeQuadTexCoord3D = function(p0, p1, dirSwz) { + var dst = []; + dst.length = 4 * 3; + + var f0 = deMath.swizzle(([0, 0, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]); + var f1 = deMath.swizzle(([0, 1, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]); + var f2 = deMath.swizzle(([1, 0, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]); + var f3 = deMath.swizzle(([1, 1, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]); + + var v0 = glsTextureTestUtil.selectCoords(p0, p1, f0); + var v1 = glsTextureTestUtil.selectCoords(p0, p1, f1); + var v2 = glsTextureTestUtil.selectCoords(p0, p1, f2); + var v3 = glsTextureTestUtil.selectCoords(p0, p1, f3); + + dst[0] = v0[0]; dst[1] = v0[1]; dst[2] = v0[2]; + dst[3] = v1[0]; dst[4] = v1[1]; dst[5] = v1[2]; + dst[6] = v2[0]; dst[7] = v2[1]; dst[8] = v2[2]; + dst[9] = v3[0]; dst[10] = v3[1]; dst[11] = v3[2]; + + return dst; +}; + +/** + * @enum + */ +glsTextureTestUtil.programType = { + PROGRAM_2D_FLOAT: 0, + PROGRAM_2D_INT: 1, + PROGRAM_2D_UINT: 2, + PROGRAM_2D_SHADOW: 3, + + PROGRAM_2D_FLOAT_BIAS: 4, + PROGRAM_2D_INT_BIAS: 5, + PROGRAM_2D_UINT_BIAS: 6, + PROGRAM_2D_SHADOW_BIAS: 7, + + PROGRAM_1D_FLOAT: 8, + PROGRAM_1D_INT: 9, + PROGRAM_1D_UINT: 10, + PROGRAM_1D_SHADOW: 11, + + PROGRAM_1D_FLOAT_BIAS: 12, + PROGRAM_1D_INT_BIAS: 13, + PROGRAM_1D_UINT_BIAS: 14, + PROGRAM_1D_SHADOW_BIAS: 15, + + PROGRAM_CUBE_FLOAT: 16, + PROGRAM_CUBE_INT: 17, + PROGRAM_CUBE_UINT: 18, + PROGRAM_CUBE_SHADOW: 19, + + PROGRAM_CUBE_FLOAT_BIAS: 20, + PROGRAM_CUBE_INT_BIAS: 21, + PROGRAM_CUBE_UINT_BIAS: 22, + PROGRAM_CUBE_SHADOW_BIAS: 23, + + PROGRAM_1D_ARRAY_FLOAT: 24, + PROGRAM_1D_ARRAY_INT: 25, + PROGRAM_1D_ARRAY_UINT: 26, + PROGRAM_1D_ARRAY_SHADOW: 27, + + PROGRAM_2D_ARRAY_FLOAT: 28, + PROGRAM_2D_ARRAY_INT: 29, + PROGRAM_2D_ARRAY_UINT: 30, + PROGRAM_2D_ARRAY_SHADOW: 31, + + PROGRAM_3D_FLOAT: 32, + PROGRAM_3D_INT: 33, + PROGRAM_3D_UINT: 34, + + PROGRAM_3D_FLOAT_BIAS: 35, + PROGRAM_3D_INT_BIAS: 36, + PROGRAM_3D_UINT_BIAS: 37, + + PROGRAM_CUBE_ARRAY_FLOAT: 38, + PROGRAM_CUBE_ARRAY_INT: 39, + PROGRAM_CUBE_ARRAY_UINT: 40, + PROGRAM_CUBE_ARRAY_SHADOW: 41, + + PROGRAM_BUFFER_FLOAT: 42, + PROGRAM_BUFFER_INT: 43, + PROGRAM_BUFFER_UINT: 44 +}; + +/** + * @constructor + * @param {string} version GL version + * @param {gluShaderUtil.precision} precision + */ +glsTextureTestUtil.ProgramLibrary = function(version, precision) { + this.m_glslVersion = version; + this.m_texCoordPrecision = precision; +}; + +/** + * @param {glsTextureTestUtil.programType} program + * @return {gluShaderProgram.ShaderProgram} + */ +glsTextureTestUtil.ProgramLibrary.prototype.getProgram = function(program) { + /* TODO: Implement */ + // if (m_programs.find(program) != m_programs.end()) + // return m_programs[program]; // Return from cache. + + var vertShaderTemplate = + '${VTX_HEADER}' + + '${VTX_IN} highp vec4 a_position;\n' + + '${VTX_IN} ${PRECISION} ${TEXCOORD_TYPE} a_texCoord;\n' + + '${VTX_OUT} ${PRECISION} ${TEXCOORD_TYPE} v_texCoord;\n' + + '\n' + + 'void main (void)\n' + + ' {\n' + + ' gl_Position = a_position;\n' + + ' v_texCoord = a_texCoord;\n' + + '}\n'; + var fragShaderTemplate = + '${FRAG_HEADER}' + + '${FRAG_IN} ${PRECISION} ${TEXCOORD_TYPE} v_texCoord;\n' + + 'uniform ${PRECISION} float u_bias;\n' + + 'uniform ${PRECISION} float u_ref;\n' + + 'uniform ${PRECISION} vec4 u_colorScale;\n' + + 'uniform ${PRECISION} vec4 u_colorBias;\n' + + 'uniform ${PRECISION} ${SAMPLER_TYPE} u_sampler;\n' + + '\n' + + 'void main (void)\n' + + ' {\n' + + ' ${FRAG_COLOR} = ${LOOKUP} * u_colorScale + u_colorBias;\n' + + '}\n'; + + var params = []; + + var isCube = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT, glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW_BIAS); + var isArray = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW) || + deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW); + + var is1D = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_1D_FLOAT, glsTextureTestUtil.programType.PROGRAM_1D_UINT_BIAS) || + deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW) || + deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT, glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT); + + var is2D = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_2D_FLOAT, glsTextureTestUtil.programType.PROGRAM_2D_UINT_BIAS) || + deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW); + + var is3D = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_3D_FLOAT, glsTextureTestUtil.programType.PROGRAM_3D_UINT_BIAS); + var isCubeArray = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_SHADOW); + var isBuffer = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT, glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT); + + if (this.m_glslVersion === '100 es') { + params['FRAG_HEADER'] = ''; + params['VTX_HEADER'] = ''; + params['VTX_IN'] = 'attribute'; + params['VTX_OUT'] = 'varying'; + params['FRAG_IN'] = 'varying'; + params['FRAG_COLOR'] = 'gl_FragColor'; + } else if (this.m_glslVersion === '300 es' || this.m_glslVersion === '310 es' || this.m_glslVersion === '330 es') { + var ext = null; + + // if (isCubeArray && glu::glslVersionIsES(m_glslVersion)) + // ext = "gl.EXT_texture_cube_map_array"; + // else if (isBuffer && glu::glslVersionIsES(m_glslVersion)) + // ext = "gl.EXT_texture_buffer"; + + var extension = ''; + if (ext) + extension = '\n#extension ' + ext + ' : require'; + + params['FRAG_HEADER'] = '#version ' + this.m_glslVersion + extension + '\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + params['VTX_HEADER'] = '#version ' + this.m_glslVersion + '\n'; + params['VTX_IN'] = 'in'; + params['VTX_OUT'] = 'out'; + params['FRAG_IN'] = 'in'; + params['FRAG_COLOR'] = 'dEQP_FragColor'; + } else + throw new Error('Unsupported version: ' + this.m_glslVersion); + + params['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_texCoordPrecision); + + if (isCubeArray) + params['TEXCOORD_TYPE'] = 'vec4'; + else if (isCube || (is2D && isArray) || is3D) + params['TEXCOORD_TYPE'] = 'vec3'; + else if ((is1D && isArray) || is2D) + params['TEXCOORD_TYPE'] = 'vec2'; + else if (is1D) + params['TEXCOORD_TYPE'] = 'float'; + else + DE_ASSERT(false); + + var sampler = null; + var lookup = null; + + if (this.m_glslVersion === '300 es' || this.m_glslVersion === '310 es' || this.m_glslVersion === '330 es') { + switch (program) { + case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT: sampler = 'sampler2D'; lookup = 'texture(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_INT: sampler = 'isampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_UINT: sampler = 'usampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_SHADOW: sampler = 'sampler2DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT_BIAS: sampler = 'sampler2D'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_INT_BIAS: sampler = 'isampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_UINT_BIAS: sampler = 'usampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_SHADOW_BIAS: sampler = 'sampler2DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref), u_bias), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_FLOAT: sampler = 'sampler1D'; lookup = 'texture(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_INT: sampler = 'isampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_UINT: sampler = 'usampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_SHADOW: sampler = 'sampler1DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_FLOAT_BIAS: sampler = 'sampler1D'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_INT_BIAS: sampler = 'isampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_UINT_BIAS: sampler = 'usampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_SHADOW_BIAS: sampler = 'sampler1DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref), u_bias), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT: sampler = 'samplerCube'; lookup = 'texture(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_INT: sampler = 'isamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_UINT: sampler = 'usamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW: sampler = 'samplerCubeShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT_BIAS: sampler = 'samplerCube'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_INT_BIAS: sampler = 'isamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_UINT_BIAS: sampler = 'usamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW_BIAS: sampler = 'samplerCubeShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref), u_bias), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT: sampler = 'sampler2DArray'; lookup = 'texture(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_INT: sampler = 'isampler2DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_UINT: sampler = 'usampler2DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW: sampler = 'sampler2DArrayShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_3D_FLOAT: sampler = 'sampler3D'; lookup = 'texture(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_3D_INT: sampler = 'isampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_3D_UINT: sampler = ' usampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_3D_FLOAT_BIAS: sampler = 'sampler3D'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break; + case glsTextureTestUtil.programType.PROGRAM_3D_INT_BIAS: sampler = 'isampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_3D_UINT_BIAS: sampler = ' usampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_FLOAT: sampler = 'samplerCubeArray'; lookup = 'texture(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_INT: sampler = 'isamplerCubeArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_UINT: sampler = 'usamplerCubeArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_SHADOW: sampler = 'samplerCubeArrayShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT: sampler = 'sampler1DArray'; lookup = 'texture(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_INT: sampler = 'isampler1DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_UINT: sampler = 'usampler1DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW: sampler = 'sampler1DArrayShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break; + case glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT: sampler = 'samplerBuffer'; lookup = 'texelFetch(u_sampler, int(v_texCoord))'; break; + case glsTextureTestUtil.programType.PROGRAM_BUFFER_INT: sampler = 'isamplerBuffer'; lookup = 'vec4(texelFetch(u_sampler, int(v_texCoord)))'; break; + case glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT: sampler = 'usamplerBuffer'; lookup = 'vec4(texelFetch(u_sampler, int(v_texCoord)))'; break; + default: + DE_ASSERT(false); + } + } else if (this.m_glslVersion === '100 es') { + sampler = isCube ? 'samplerCube' : 'sampler2D'; + + switch (program) { + case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT: lookup = 'texture2D(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT_BIAS: lookup = 'texture2D(u_sampler, v_texCoord, u_bias)'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT: lookup = 'textureCube(u_sampler, v_texCoord)'; break; + case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT_BIAS: lookup = 'textureCube(u_sampler, v_texCoord, u_bias)'; break; + default: + DE_ASSERT(false); + } + } else + DE_ASSERT(!'Unsupported version'); + + params['SAMPLER_TYPE'] = sampler; + params['LOOKUP'] = lookup; + + var vertSrc = tcuStringTemplate.specialize(vertShaderTemplate, params); + var fragSrc = tcuStringTemplate.specialize(fragShaderTemplate, params); + var progObj = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertSrc, fragSrc)); + // if (!progObj.isOk()) { + // // log << *progObj; + // testFailedOptions("Failed to create shader", true); + // } + + // try + // { + // m_programs[program] = progObj; + // } + // catch (...) + // { + // delete progObj; + // throw; + // } + + return progObj; +}; + +// public: +// glsTextureTestUtil.ProgramLibrary (const glu::RenderContext& context, tcu::TestContext& testCtx, glu::GLSLVersion glslVersion, glu::Precision texCoordPrecision); +// ~glsTextureTestUtil.ProgramLibrary (void); + +// glu::ShaderProgram* getProgram (Program program); +// void clear (void); + +// private: +// glsTextureTestUtil.ProgramLibrary (const glsTextureTestUtil.ProgramLibrary& other); +// glsTextureTestUtil.ProgramLibrary& operator= (const glsTextureTestUtil.ProgramLibrary& other); + +// const glu::RenderContext& m_context; +// tcu::TestContext& m_testCtx; +// glu::GLSLVersion m_glslVersion; +// glu::Precision m_texCoordPrecision; +// std::map m_programs; +// }; + +/** + * @constructor + * @param {string} version GL version + * @param {gluShaderUtil.precision} precision + */ +glsTextureTestUtil.TextureRenderer = function(version, precision) { + this.m_programLibrary = new glsTextureTestUtil.ProgramLibrary(version, precision); +}; + +/** + * @param {tcuPixelFormat.PixelFormat} format + * @return {Array} + */ +glsTextureTestUtil.getCompareMask = function(format) { + return [ + format.redBits > 0, + format.greenBits > 0, + format.blueBits > 0, + format.alphaBits > 0 + ]; +}; + +/** + * @param {tcuPixelFormat.PixelFormat} format + * @return {Array} + */ +glsTextureTestUtil.getBitsVec = function(format) { + return [ + format.redBits, + format.greenBits, + format.blueBits, + format.alphaBits + ]; +}; + +/** + * @param {number} texUnit + * @param {Array} texCoord + * @param {glsTextureTestUtil.RenderParams} params + */ +glsTextureTestUtil.TextureRenderer.prototype.renderQuad = function(texUnit, texCoord, params) { + var wCoord = params.flags.projected ? params.w : [1, 1, 1, 1]; + var useBias = params.flags.use_bias; + var logUniforms = params.flags.log_uniforms; + + // Render quad with texture. + var position = [ + -1 * wCoord[0], -1 * wCoord[0], 0, wCoord[0], + -1 * wCoord[1], +1 * wCoord[1], 0, wCoord[1], + +1 * wCoord[2], -1 * wCoord[2], 0, wCoord[2], + +1 * wCoord[3], +1 * wCoord[3], 0, wCoord[3] + ]; + /** @const */ var indices = [0, 1, 2, 2, 1, 3]; + + /** @type {?glsTextureTestUtil.programType} */ var progSpec = null; + var numComps = 0; + if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_2D) { + numComps = 2; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_UINT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_SHADOW_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_SHADOW; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_1D) { + numComps = 1; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_UINT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_SHADOW_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_SHADOW; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_CUBE) { + numComps = 3; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_UINT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_3D) { + numComps = 3; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_3D_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_3D_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_3D_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_3D_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_3D_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_3D_UINT; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY) { + DE_ASSERT(!useBias); // \todo [2012-02-17 pyry] Support bias. + + numComps = 3; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_UINT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_CUBE_ARRAY) { + DE_ASSERT(!useBias); + + numComps = 4; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_UINT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_SHADOW; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_1D_ARRAY) { + DE_ASSERT(!useBias); // \todo [2012-02-17 pyry] Support bias. + + numComps = 2; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_UINT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_BUFFER) { + numComps = 1; + + switch (params.samplerType) { + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FETCH_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FETCH_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_BUFFER_INT; break; + case glsTextureTestUtil.samplerType.SAMPLERTYPE_FETCH_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT; break; + default: throw new Error('Unrecognized sampler type:' + params.samplerType); + } + } else + throw new Error('Unrecognized texture type:' + params.texType); + + if (progSpec === null) + throw new Error('Could not find program specification'); + + var program = this.m_programLibrary.getProgram(progSpec); + + // \todo [2012-09-26 pyry] Move to glsTextureTestUtil.ProgramLibrary and log unique programs only(?) + /* TODO: Port logging + if (params.flags.log_programs) + log << *program; + */ + + // Program and uniforms. + var prog = program.getProgram(); + gl.useProgram(prog); + + var loc = gl.getUniformLocation(prog, 'u_sampler'); + gl.uniform1i(loc, texUnit); + // if (logUniforms) + // log << TestLog::Message << "u_sampler = " << texUnit << TestLog::EndMessage; + + if (useBias) { + gl.uniform1f(gl.getUniformLocation(prog, 'u_bias'), params.bias); + // if (logUniforms) + // log << TestLog::Message << "u_bias = " << params.bias << TestLog::EndMessage; + } + + if (params.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW) { + gl.uniform1f(gl.getUniformLocation(prog, 'u_ref'), params.ref); + // if (logUniforms) + // log << TestLog::Message << "u_ref = " << params.ref << TestLog::EndMessage; + } + + gl.uniform4fv(gl.getUniformLocation(prog, 'u_colorScale'), params.colorScale); + gl.uniform4fv(gl.getUniformLocation(prog, 'u_colorBias'), params.colorBias); + + // if (logUniforms) + // { + // log << TestLog::Message << "u_colorScale = " << params.colorScale << TestLog::EndMessage; + // log << TestLog::Message << "u_colorBias = " << params.colorBias << TestLog::EndMessage; + // } + var vertexArrays = []; + + var posLoc = gl.getAttribLocation(prog, 'a_position'); + if (posLoc === -1) { + testFailedOptions("no location found for attribute 'a_position'", true); + } + var texLoc = gl.getAttribLocation(prog, 'a_texCoord'); + if (texLoc === -1) { + testFailedOptions("no location found for attribute 'a_texCoord'", true); + } + + vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, 4, position)); + vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, texLoc, numComps, 4, texCoord)); + gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices)); +}; + +// public: +// glsTextureTestUtil.TextureRenderer (const glu::RenderContext& context, tcu::TestContext& testCtx, glu::GLSLVersion glslVersion, glu::Precision texCoordPrecision); +// ~glsTextureTestUtil.TextureRenderer (void); + +// void clear (void); //!< Frees allocated resources. Destructor will call clear() as well. + +// void renderQuad (int texUnit, const float* texCoord, TextureType texType); +// void renderQuad (int texUnit, const float* texCoord, const glsTextureTestUtil.RenderParams& params); + +// private: +// glsTextureTestUtil.TextureRenderer (const glsTextureTestUtil.TextureRenderer& other); +// glsTextureTestUtil.TextureRenderer& operator= (const glsTextureTestUtil.TextureRenderer& other); + +// const glu::RenderContext& m_renderCtx; +// tcu::TestContext& m_testCtx; +// glsTextureTestUtil.ProgramLibrary m_programLibrary; +// }; + +/** + * @constructor + * @param {tcuSurface.Surface} surface + * @param {tcuPixelFormat.PixelFormat=} colorFmt + * @param {number=} x + * @param {number=} y + * @param {number=} width + * @param {number=} height + */ +glsTextureTestUtil.SurfaceAccess = function(surface, colorFmt, x, y, width, height) { + this.m_surface = surface; + this.colorMask = undefined; /*TODO*/ + this.m_x = x || 0; + this.m_y = y || 0; + this.m_width = width || surface.getWidth(); + this.m_height = height || surface.getHeight(); +}; + +/** @return {number} */ +glsTextureTestUtil.SurfaceAccess.prototype.getWidth = function() { return this.m_width; }; +/** @return {number} */ +glsTextureTestUtil.SurfaceAccess.prototype.getHeight = function() { return this.m_height; }; + +/** + * @param {Array} color + * @param {number} x + * @param {number} y + */ +glsTextureTestUtil.SurfaceAccess.prototype.setPixel = function(color, x, y) { + /* TODO: Apply color mask */ + var c = color; + for (var i = 0; i < c.length; i++) + c[i] = deMath.clamp(Math.round(color[i] * 255), 0, 255); + this.m_surface.setPixel(x, y, c); +}; + +/** + * @param {glsTextureTestUtil.lodMode} mode + * @param {number} dudx + * @param {number} dvdx + * @param {number} dwdx + * @param {number} dudy + * @param {number} dvdy + * @param {number} dwdy + * @return {number} + */ +glsTextureTestUtil.computeLodFromDerivates3D = function(mode, dudx, dvdx, dwdx, dudy, dvdy, dwdy) { + var p = 0; + switch (mode) { + case glsTextureTestUtil.lodMode.EXACT: + p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx + dwdx * dwdx), Math.sqrt(dudy * dudy + dvdy * dvdy + dwdy * dwdy)); + break; + + case glsTextureTestUtil.lodMode.MIN_BOUND: + case glsTextureTestUtil.lodMode.MAX_BOUND: { + var mu = Math.max(Math.abs(dudx), Math.abs(dudy)); + var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy)); + var mw = Math.max(Math.abs(dwdx), Math.abs(dwdy)); + + p = (mode == glsTextureTestUtil.lodMode.MIN_BOUND) ? Math.max(mu, mv, mw) : mu + mv + mw; + break; + } + + default: + DE_ASSERT(false); + } + + // Native dEQP uses 32-bit numbers. So here 64-bit floating numbers should be transformed into 32-bit ones to ensure the correctness of the result. + return deMath.toFloat32(Math.log(p)) * deMath.INV_LOG_2_FLOAT32; +}; + +/** + * @param {glsTextureTestUtil.lodMode} mode + * @param {Array} dstSize + * @param {Array} srcSize + * @param {Array} sq + * @param {Array} tq + * @param {Array=} rq + * @return {number} + */ +glsTextureTestUtil.computeNonProjectedTriLod = function(mode, dstSize, srcSize, sq, tq, rq) { + var dux = (sq[2] - sq[0]) * srcSize[0]; + var duy = (sq[1] - sq[0]) * srcSize[0]; + var dvx = (tq[2] - tq[0]) * srcSize[1]; + var dvy = (tq[1] - tq[0]) * srcSize[1]; + var dwx = 0; + var dwy = 0; + if (rq) { + dwx = (rq[2] - rq[0]) * srcSize[2]; + dwy = (rq[1] - rq[0]) * srcSize[2]; + } + var dx = dstSize[0]; + var dy = dstSize[1]; + + return glsTextureTestUtil.computeLodFromDerivates3D(mode, dux / dx, dvx / dx, dwx / dx, duy / dy, dvy / dy, dwy / dy); +}; + +/** + * @param {Array} v + * @param {number} x + * @param {number} y + * @return {number} + */ +glsTextureTestUtil.triangleInterpolate = function(v, x, y) { + return v[0] + (v[2] - v[0]) * x + (v[1] - v[0]) * y; +}; + +/** + * @param {Array} s + * @param {Array} w + * @param {number} wx + * @param {number} width + * @param {number} ny + * @return {number} + */ +glsTextureTestUtil.triDerivateX = function(s, w, wx, width, ny) { + var d = w[1] * w[2] * (width * (ny - 1) + wx) - w[0] * (w[2] * width * ny + w[1] * wx); + return (w[0] * w[1] * w[2] * width * (w[1] * (s[0] - s[2]) * (ny - 1) + ny * (w[2] * (s[1] - s[0]) + w[0] * (s[2] - s[1])))) / (d * d); +}; + +/** + * @param {Array} s + * @param {Array} w + * @param {number} wy + * @param {number} height + * @param {number} nx + * @return {number} + */ +glsTextureTestUtil.triDerivateY = function(s, w, wy, height, nx) { + var d = w[1] * w[2] * (height * (nx - 1) + wy) - w[0] * (w[1] * height * nx + w[2] * wy); + return (w[0] * w[1] * w[2] * height * (w[2] * (s[0] - s[1]) * (nx - 1) + nx * (w[0] * (s[1] - s[2]) + w[1] * (s[2] - s[0])))) / (d * d); +}; + +/** + * @param {(tcuTexture.Texture2DView|tcuTexture.Texture2DArrayView|tcuTexture.TextureCubeView)} src + * @param {glsTextureTestUtil.ReferenceParams} params + * @param {Array} texCoord Texture coordinates + * @param {number} lod + * @return {Array} sample + */ +glsTextureTestUtil.execSample = function(src, params, texCoord, lod) { + if (params.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW) + return [src.sampleCompare(params.sampler, params.ref, texCoord, lod), 0, 0, 1]; + else + return src.sample(params.sampler, texCoord, lod); +}; + +/** + * @param {Array} pixel + * @param {Array} scale + * @param {Array} bias + */ +glsTextureTestUtil.applyScaleAndBias = function(pixel, scale, bias) { + pixel[0] = pixel[0] * scale[0] + bias[0]; + pixel[1] = pixel[1] * scale[1] + bias[1]; + pixel[2] = pixel[2] * scale[2] + bias[2]; + pixel[3] = pixel[3] * scale[3] + bias[3]; +}; + +/** + * @param {Array} pixel + * @param {Array} scale + * @param {Array} bias + */ +glsTextureTestUtil.deapplyScaleAndBias = function(pixel, scale, bias) { + pixel[0] = (pixel[0] - bias[0]) / scale[0]; + pixel[1] = (pixel[1] - bias[1]) / scale[1]; + pixel[2] = (pixel[2] - bias[2]) / scale[2]; + pixel[3] = (pixel[3] - bias[3]) / scale[3]; +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.Texture2DView} src + * @param {Array} sq + * @param {Array} tq + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTextureProjected2D = function(dst, src, sq, tq, params) { + /** @type {number} */ var lodBias = params.flags.use_bias ? params.bias : 0.0; + /** @type {number} */ var dstW = dst.getWidth(); + /** @type {number} */ var dstH = dst.getHeight(); + + /** @type {Array} */ var uq = deMath.scale(sq, src.getWidth()); + /** @type {Array} */ var vq = deMath.scale(tq, src.getHeight()); + + /** @type {Array>} */ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + /** @type {Array>} */ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + /** @type {Array>} */ var triU = [deMath.swizzle(uq, [0, 1, 2]), deMath.swizzle(uq, [3, 2, 1])]; + /** @type {Array>} */ var triV = [deMath.swizzle(vq, [0, 1, 2]), deMath.swizzle(vq, [3, 2, 1])]; + /** @type {Array>} */ var triW = [deMath.swizzle(params.w, [0, 1, 2]), deMath.swizzle(params.w, [3, 2, 1])]; + + for (var py = 0; py < dst.getHeight(); py++) { + for (var px = 0; px < dst.getWidth(); px++) { + /** @type {number} */ var wx = px + 0.5; + /** @type {number} */ var wy = py + 0.5; + /** @type {number} */ var nx = wx / dstW; + /** @type {number} */ var ny = wy / dstH; + + /** @type {number} */ var triNdx = nx + ny >= 1.0 ? 1 : 0; + /** @type {number} */ var triWx = triNdx ? dstW - wx : wx; + /** @type {number} */ var triWy = triNdx ? dstH - wy : wy; + /** @type {number} */ var triNx = triNdx ? 1.0 - nx : nx; + /** @type {number} */ var triNy = triNdx ? 1.0 - ny : ny; + + /** @type {number} */ var s = glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy); + /** @type {number} */ var t = glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy); + /** @type {number} */ var lod = glsTextureTestUtil.computeProjectedTriLod2D(params.lodMode, triU[triNdx], triV[triNdx], triW[triNdx], triWx, triWy, dst.getWidth(), dst.getHeight()) + lodBias; + + var pixel = glsTextureTestUtil.execSample(src, params, [s, t], lod); + glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias); + dst.setPixel(pixel, px, py); + } + } +}; + +/** + * @param {glsTextureTestUtil.lodMode} mode + * @param {Array} u + * @param {Array} v + * @param {Array} projection + * @param {number} wx + * @param {number} wy + * @param {number} width + * @param {number} height + * @return {number} + */ +glsTextureTestUtil.computeProjectedTriLod2D = function(mode, u, v, projection, wx, wy, width, height) { + // Exact derivatives. + /** @type {number} */ var dudx = glsTextureTestUtil.triDerivateX(u, projection, wx, width, wy / height); + /** @type {number} */ var dvdx = glsTextureTestUtil.triDerivateX(v, projection, wx, width, wy / height); + /** @type {number} */ var dudy = glsTextureTestUtil.triDerivateY(u, projection, wy, height, wx / width); + /** @type {number} */ var dvdy = glsTextureTestUtil.triDerivateY(v, projection, wy, height, wx / width); + + return glsTextureTestUtil.computeLodFromDerivates2D(mode, dudx, dvdx, dudy, dvdy); +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.Texture2DView} src + * @param {Array} sq + * @param {Array} tq + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTextureNonProjected2D = function(dst, src, sq, tq, params) { + var lodBias = params.flags.use_bias ? params.bias : 0; + + var dstSize = [dst.getWidth(), dst.getHeight()]; + var srcSize = [src.getWidth(), src.getHeight()]; + + // Coordinates and lod per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triLod = [deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[0], triT[0]) + lodBias), params.minLod, params.maxLod), + deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[1], triT[1]) + lodBias), params.minLod, params.maxLod)]; + + + for (var y = 0; y < dst.getHeight(); y++) { + for (var x = 0; x < dst.getWidth(); x++) { + var yf = (y + 0.5) / dst.getHeight(); + var xf = (x + 0.5) / dst.getWidth(); + + var triNdx = xf + yf >= 1 ? 1 : 0; // Top left fill rule. + var triX = triNdx ? 1 - xf : xf; + var triY = triNdx ? 1 - yf : yf; + + var s = glsTextureTestUtil.triangleInterpolate(triS[triNdx], triX, triY); + var t = glsTextureTestUtil.triangleInterpolate(triT[triNdx], triX, triY); + var lod = triLod[triNdx]; + + var pixel = glsTextureTestUtil.execSample(src, params, [s, t], lod); + glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias); + dst.setPixel(pixel, x, y); + } + } +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.Texture2DArrayView} src + * @param {Array} sq + * @param {Array} tq + * @param {Array} rq + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTextureNonProjected2DArray = function(dst, src, sq, tq, rq, params) { + var lodBias = (params.flags.use_bias) ? params.bias : 0; + + var dstSize = [dst.getWidth(), dst.getHeight()]; + var srcSize = [src.getWidth(), src.getHeight()]; + + // Coordinates and lod per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + var triLod = [glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[0], triT[0]) + lodBias, + glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[1], triT[1]) + lodBias]; + + for (var y = 0; y < dst.getHeight(); y++) { + for (var x = 0; x < dst.getWidth(); x++) { + var yf = (y + 0.5) / dst.getHeight(); + var xf = (x + 0.5) / dst.getWidth(); + + var triNdx = xf + yf >= 1 ? 1 : 0; // Top left fill rule. + var triX = triNdx ? 1 - xf : xf; + var triY = triNdx ? 1 - yf : yf; + + var s = glsTextureTestUtil.triangleInterpolate(triS[triNdx], triX, triY); + var t = glsTextureTestUtil.triangleInterpolate(triT[triNdx], triX, triY); + var r = glsTextureTestUtil.triangleInterpolate(triR[triNdx], triX, triY); + var lod = triLod[triNdx]; + + var pixel = glsTextureTestUtil.execSample(src, params, [s, t, r], lod); + glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias); + dst.setPixel(pixel, x, y); + } + } +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.Texture2DView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTexture2D = function(dst, src, texCoord, params) { + var view = src.getSubView(params.baseLevel, params.maxLevel); + var sq = [texCoord[0 + 0], texCoord[2 + 0], texCoord[4 + 0], texCoord[6 + 0]]; + var tq = [texCoord[0 + 1], texCoord[2 + 1], texCoord[4 + 1], texCoord[6 + 1]]; + + if (params.flags.projected) + glsTextureTestUtil.sampleTextureProjected2D(dst, view, sq, tq, params); + else + glsTextureTestUtil.sampleTextureNonProjected2D(dst, view, sq, tq, params); +}; + +/** + * @param {glsTextureTestUtil.lodMode} mode + * @param {number} dudx + * @param {number} dvdx + * @param {number} dudy + * @param {number} dvdy + * @return {number} + */ +glsTextureTestUtil.computeLodFromDerivates2D = function(mode, dudx, dvdx, dudy, dvdy) { + var p = 0; + switch (mode) { + case glsTextureTestUtil.lodMode.EXACT: + p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx), Math.sqrt(dudy * dudy + dvdy * dvdy)); + break; + + case glsTextureTestUtil.lodMode.MIN_BOUND: + case glsTextureTestUtil.lodMode.MAX_BOUND: { + var mu = Math.max(Math.abs(dudx), Math.abs(dudy)); + var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy)); + + p = (mode == glsTextureTestUtil.lodMode.MIN_BOUND) ? Math.max(mu, mv) : mu + mv; + break; + } + + default: + throw new Error('Unrecognized mode:' + mode); + } + + // Native dEQP uses 32-bit numbers. So here 64-bit floating numbers should be transformed into 32-bit ones to ensure the correctness of the result. + return deMath.toFloat32(Math.log(p)) * deMath.INV_LOG_2_FLOAT32; +}; + +/** + * @param {glsTextureTestUtil.lodMode} lodModeParm + * @param {Array} coord + * @param {Array} coordDx + * @param {Array} coordDy + * @param {number} faceSize + * @return {number} + */ +glsTextureTestUtil.computeCubeLodFromDerivates = function(lodModeParm, coord, coordDx, coordDy, faceSize) { + var face = tcuTexture.selectCubeFace(coord); + var maNdx = 0; + var sNdx = 0; + var tNdx = 0; + + // \note Derivate signs don't matter when computing lod + switch (face) { + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: maNdx = 0; sNdx = 2; tNdx = 1; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: maNdx = 1; sNdx = 0; tNdx = 2; break; + case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: + case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: maNdx = 2; sNdx = 0; tNdx = 1; break; + default: + throw new Error('Unrecognized face ' + face); + } { + var sc = coord[sNdx]; + var tc = coord[tNdx]; + var ma = Math.abs(coord[maNdx]); + var scdx = coordDx[sNdx]; + var tcdx = coordDx[tNdx]; + var madx = Math.abs(coordDx[maNdx]); + var scdy = coordDy[sNdx]; + var tcdy = coordDy[tNdx]; + var mady = Math.abs(coordDy[maNdx]); + var dudx = faceSize * 0.5 * (scdx * ma - sc * madx) / (ma * ma); + var dvdx = faceSize * 0.5 * (tcdx * ma - tc * madx) / (ma * ma); + var dudy = faceSize * 0.5 * (scdy * ma - sc * mady) / (ma * ma); + var dvdy = faceSize * 0.5 * (tcdy * ma - tc * mady) / (ma * ma); + return glsTextureTestUtil.computeLodFromDerivates2D(lodModeParm, dudx, dvdx, dudy, dvdy); + } +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.TextureCubeView} src + * @param {Array} sq + * @param {Array} tq + * @param {Array} rq + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTextureCube_str = function(dst, src, sq, tq, rq, params) { + var dstSize = [dst.getWidth(), dst.getHeight()]; + var dstW = dstSize[0]; + var dstH = dstSize[1]; + var srcSize = src.getSize(); + + // Coordinates per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + var triW = [deMath.swizzle(params.w, [0, 1, 2]), deMath.swizzle(params.w, [3, 2, 1])]; + + var lodBias = (params.flags.use_bias ? params.bias : 0); + + for (var py = 0; py < dst.getHeight(); py++) { + for (var px = 0; px < dst.getWidth(); px++) { + var wx = px + 0.5; + var wy = py + 0.5; + var nx = wx / dstW; + var ny = wy / dstH; + var triNdx = nx + ny >= 1 ? 1 : 0; + var triNx = triNdx ? 1 - nx : nx; + var triNy = triNdx ? 1 - ny : ny; + + var coord = [glsTextureTestUtil.triangleInterpolate(triS[triNdx], triNx, triNy), + glsTextureTestUtil.triangleInterpolate(triT[triNdx], triNx, triNy), + glsTextureTestUtil.triangleInterpolate(triR[triNdx], triNx, triNy)]; + var coordDx = [glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triR[triNdx], triW[triNdx], wx, dstW, triNy)]; + var coordDy = [glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triR[triNdx], triW[triNdx], wy, dstH, triNx)]; + + var lod = deMath.clamp((glsTextureTestUtil.computeCubeLodFromDerivates(params.lodMode, coord, coordDx, coordDy, srcSize) + lodBias), params.minLod, params.maxLod); + + var pixel = glsTextureTestUtil.execSample(src, params, coord, lod); + glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias); + dst.setPixel(pixel, px, py); + } + } +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.TextureCubeView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTextureCube = function(dst, src, texCoord, params) { + /*const tcu::TextureCubeView*/ var view = src.getSubView(params.baseLevel, params.maxLevel); + var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + glsTextureTestUtil.sampleTextureCube_str(dst, view, sq, tq, rq, params); +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.Texture2DArrayView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTexture2DArray = function(dst, src, texCoord, params) { + var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + DE_ASSERT(!(params.flags.projected)); // \todo [2012-02-17 pyry] Support projected lookups. + glsTextureTestUtil.sampleTextureNonProjected2DArray(dst, src, sq, tq, rq, params); +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.Texture3DView} src + * @param {Array} sq + * @param {Array} tq + * @param {Array} rq + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTextureNonProjected3D = function(dst, src, sq, tq, rq, params) { + var lodBias = params.flags.use_bias ? params.bias : 0; + + var dstSize = [dst.getWidth(), dst.getHeight()]; + var srcSize = [src.getWidth(), src.getHeight(), src.getDepth()]; + + // Coordinates and lod per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + var triLod = [deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[0], triT[0], triR[0]) + lodBias), params.minLod, params.maxLod), + deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[1], triT[1], triR[1]) + lodBias), params.minLod, params.maxLod)]; + + for (var y = 0; y < dst.getHeight(); y++) { + for (var x = 0; x < dst.getWidth(); x++) { + var yf = (y + 0.5) / dst.getHeight(); + var xf = (x + 0.5) / dst.getWidth(); + + var triNdx = xf + yf >= 1 ? 1 : 0; // Top left fill rule. + var triX = triNdx ? 1 - xf : xf; + var triY = triNdx ? 1 - yf : yf; + + var s = glsTextureTestUtil.triangleInterpolate(triS[triNdx], triX, triY); + var t = glsTextureTestUtil.triangleInterpolate(triT[triNdx], triX, triY); + var r = glsTextureTestUtil.triangleInterpolate(triR[triNdx], triX, triY); + var lod = triLod[triNdx]; + + var pixel = src.sample(params.sampler, [s, t, r], lod); + glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias); + dst.setPixel(pixel, x, y); + } + } +}; + +/** + * @param {glsTextureTestUtil.SurfaceAccess} dst + * @param {tcuTexture.Texture3DView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} params + */ +glsTextureTestUtil.sampleTexture3D = function(dst, src, texCoord, params) { + /*const tcu::TextureCubeView*/ var view = src.getSubView(params.baseLevel, params.maxLevel); + var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + glsTextureTestUtil.sampleTextureNonProjected3D(dst, view, sq, tq, rq, params); +}; + +/** + * @param {tcuSurface.Surface} reference + * @param {tcuSurface.Surface} rendered + * @param {Array} threshold + * @param {Array< Array >} skipPixels + * + * @return {boolean} + */ +glsTextureTestUtil.compareImages = function(reference, rendered, threshold, skipPixels) { + return tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', reference, rendered, threshold, undefined /*tcu::COMPARE_LOG_RESULT*/, skipPixels); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.Texture2DView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {tcuPixelFormat.PixelFormat} pixelFormat + * @return {boolean} + */ +glsTextureTestUtil.verifyTexture2DResult = function(result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat) { + DE_ASSERT(deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask)); + /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + /** @type {number} */ var numFailedPixels; + + /** @type {glsTextureTestUtil.SurfaceAccess} */ var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat); + + glsTextureTestUtil.sampleTexture2D(surface, src, texCoord, sampleParams); + numFailedPixels = glsTextureTestUtil.computeTextureLookupDiff2D(result, reference.getAccess(), errorMask.getAccess(), src, texCoord, sampleParams, lookupPrec, lodPrec/*, testCtx.getWatchDog()*/); + + if (numFailedPixels > 0) + tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess()); + + return numFailedPixels == 0; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.Texture2DView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {Array} nonShadowThreshold + * @return {number} + */ +glsTextureTestUtil.computeTextureCompareDiff2D = function(result, reference, errorMask, src, texCoord, sampleParams, comparePrec, lodPrec, nonShadowThreshold) { + DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight()); + DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight()); + + var sq = [texCoord[0 + 0], texCoord[2 + 0], texCoord[4 + 0], texCoord[6 + 0]]; + var tq = [texCoord[0 + 1], texCoord[2 + 1], texCoord[4 + 1], texCoord[6 + 1]]; + + var dstSize = [result.getWidth(), result.getHeight()]; + var dstW = dstSize[0]; + var dstH = dstSize[1]; + var srcSize = [src.getWidth(), src.getHeight()]; + + // Coordinates and lod per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])]; + + var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0, 0]; + var numFailed = 0; + + var lodOffsets = [ + [-1, 0], + [1, 0], + [0, -1], + [0, 1] + ]; + + /** @type {Array} */ var green = [0, 255, 0, 255]; + errorMask.clear(green); + + /** @type {Array} */ var red = []; + for (var py = 0; py < result.getHeight(); py++) { + for (var px = 0; px < result.getWidth(); px++) { + /** @type {Array} */ + var resPix = result.getPixel(px, py); + /** @type {Array} */ + var refPix = reference.getPixel(px, py); + + if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(deMath.swizzle(refPix, [1, 2, 3]), deMath.swizzle(resPix, [1, 2, 3])), nonShadowThreshold))) { + red = [255, 0, 0, 255]; + errorMask.setPixel(red, px, py); + numFailed += 1; + continue; + } + + if (resPix[0] != refPix[0]) { + var wx = px + 0.5; + var wy = py + 0.5; + var nx = wx / dstW; + var ny = wy / dstH; + + var triNdx = nx + ny >= 1.0 ? 1 : 0; + var triWx = triNdx ? dstW - wx : wx; + var triWy = triNdx ? dstH - wy : wy; + var triNx = triNdx ? 1.0 - nx : nx; + var triNy = triNdx ? 1.0 - ny : ny; + + var coord = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy)]; + var coordDx = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize); + var coordDy = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize); + + var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec); + + // Compute lod bounds across lodOffsets range. + for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) { + var wxo = triWx + lodOffsets[lodOffsNdx][0]; + var wyo = triWy + lodOffsets[lodOffsNdx][1]; + var nxo = wxo / dstW; + var nyo = wyo / dstH; + + var coordO = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo)]; + var coordDxo = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize); + var coordDyo = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize); + var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec); + + lodBounds[0] = Math.min(lodBounds[0], lodO[0]); + lodBounds[1] = Math.max(lodBounds[1], lodO[1]); + } + + var clampedLod = tcuTexLookupVerifier.clampLodBounds(deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec); + var isOk = tcuTexCompareVerifier.isTexCompareResultValid2D(src, sampleParams.sampler, comparePrec, coord, clampedLod, sampleParams.ref, resPix[0]); + + if (!isOk) { + red = [255, 0, 0, 255]; + errorMask.setPixel(red, px, py); + numFailed += 1; + } + } + } + } + + return numFailed; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.Texture3DView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {tcuPixelFormat.PixelFormat} pixelFormat + * @return {boolean} + */ +glsTextureTestUtil.verifyTexture3DResult = function( + result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat +) { + /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + var numFailedPixels = 0; + + assertMsgOptions( + deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask), + 'Compare color masks do not match', false, true + ); + + /** @type {glsTextureTestUtil.SurfaceAccess} */ var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat); + glsTextureTestUtil.sampleTexture3D(surface, src, texCoord, sampleParams); + numFailedPixels = glsTextureTestUtil.computeTextureLookupDiff3D(result, reference.getAccess(), errorMask.getAccess(), src, texCoord, sampleParams, lookupPrec, lodPrec); + + if (numFailedPixels > 0) + tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess()); + + return numFailedPixels == 0; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.Texture3DView} baseView + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @return {number} + */ +glsTextureTestUtil.computeTextureLookupDiff3D = function( + result, reference, errorMask, baseView, texCoord, + sampleParams, lookupPrec, lodPrec +) { + assertMsgOptions( + result.getWidth() == reference.getWidth() && + result.getHeight() == reference.getHeight(), + 'Result and reference images are not the same size', false, true + ); + assertMsgOptions( + result.getWidth() == errorMask.getWidth() && + result.getHeight() == errorMask.getHeight(), + 'Result and error mask images are not the same size', false, true + ); + + /** @type {tcuTexture.Texture3DView} */ + var src = baseView.getSubView( + sampleParams.baseLevel, sampleParams.maxLevel + ); + + var sq = + [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + var tq = + [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + var rq = + [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + var dstSize = [result.getWidth(), result.getHeight()]; + var dstW = dstSize[0]; + var dstH = dstSize[1]; + var srcSize = [src.getWidth(), src.getHeight(), src.getDepth()]; + + // Coordinates and lod per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + var triW = [ + deMath.swizzle(sampleParams.w, [0, 1, 2]), + deMath.swizzle(sampleParams.w, [3, 2, 1]) + ]; + + var lodBias = sampleParams.flags.useBias ? sampleParams.bias : 0.0; + + var posEps = 1.0 / ((1 << MIN_SUBPIXEL_BITS) + 1); + + var numFailed = 0; + + var lodOffsets = [ + [-1, 0], + [+1, 0], + [0, -1], + [0, +1] + ]; + + var green = [0, 255, 0, 255]; + errorMask.clear(new tcuRGBA.RGBA(green).toVec()); + + for (var py = 0; py < result.getHeight(); py++) { + // Ugly hack, validation can take way too long at the moment. + /*TODO: if (watchDog) + qpWatchDog_touch(watchDog);*/ + + for (var px = 0; px < result.getWidth(); px++) { + /** @type {Array} */ + var resPix = result.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias); + /** @type {Array} */ + var refPix = reference.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias); + + // Try comparison to ideal reference first, + // and if that fails use slower verificator. + if (!deMath.boolAll(deMath.lessThanEqual( + deMath.absDiff(resPix, refPix), + lookupPrec.colorThreshold)) + ) { + /** @type {number} */ var wx = px + 0.5; + /** @type {number} */ var wy = py + 0.5; + /** @type {number} */ var nx = wx / dstW; + /** @type {number} */ var ny = wy / dstH; + + /** @type {boolean} */ var tri0 = nx + ny - posEps <= 1.0; + /** @type {boolean} */ var tri1 = nx + ny + posEps >= 1.0; + + var isOk = false; + + assertMsgOptions( + tri0 || tri1, + 'Pixel should belong at least to one triangle', + false, true + ); + + // Pixel can belong to either of the triangles + // if it lies close enough to the edge. + for (var triNdx = (tri0 ? 0 : 1); + triNdx <= (tri1 ? 1 : 0); + triNdx++) { + var triWx = triNdx ? dstW - wx : wx; + var triWy = triNdx ? dstH - wy : wy; + var triNx = triNdx ? 1.0 - nx : nx; + var triNy = triNdx ? 1.0 - ny : ny; + + var coord = [ + glsTextureTestUtil.projectedTriInterpolate( + triS[triNdx], triW[triNdx], triNx, triNy + ), + glsTextureTestUtil.projectedTriInterpolate( + triT[triNdx], triW[triNdx], triNx, triNy + ), + glsTextureTestUtil.projectedTriInterpolate( + triR[triNdx], triW[triNdx], triNx, triNy + ) + ]; + var coordDx = deMath.multiply([ + glsTextureTestUtil.triDerivateX( + triS[triNdx], triW[triNdx], wx, dstW, triNy + ), + glsTextureTestUtil.triDerivateX( + triT[triNdx], triW[triNdx], wx, dstW, triNy + ), + glsTextureTestUtil.triDerivateX( + triR[triNdx], triW[triNdx], wx, dstW, triNy + ) + ], srcSize); + var coordDy = deMath.multiply([ + glsTextureTestUtil.triDerivateY( + triS[triNdx], triW[triNdx], wy, dstH, triNx + ), + glsTextureTestUtil.triDerivateY( + triT[triNdx], triW[triNdx], wy, dstH, triNx + ), + glsTextureTestUtil.triDerivateY( + triR[triNdx], triW[triNdx], wy, dstH, triNx + ) + ], srcSize); + + var lodBounds = + tcuTexLookupVerifier.computeLodBoundsFromDerivates( + coordDx[0], coordDx[1], coordDx[2], + coordDy[0], coordDy[1], coordDy[2], lodPrec + ); + + // Compute lod bounds across lodOffsets range. + for (var lodOffsNdx = 0; + lodOffsNdx < lodOffsets.length; + lodOffsNdx++) { + var wxo = triWx + lodOffsets[lodOffsNdx][0]; + var wyo = triWy + lodOffsets[lodOffsNdx][1]; + var nxo = wxo / dstW; + var nyo = wyo / dstH; + + var coordO = [ + glsTextureTestUtil.projectedTriInterpolate( + triS[triNdx], triW[triNdx], nxo, nyo + ), + glsTextureTestUtil.projectedTriInterpolate( + triT[triNdx], triW[triNdx], nxo, nyo + ), + glsTextureTestUtil.projectedTriInterpolate( + triR[triNdx], triW[triNdx], nxo, nyo + ) + ]; + var coordDxo = deMath.multiply([ + glsTextureTestUtil.triDerivateX( + triS[triNdx], triW[triNdx], wxo, dstW, nyo + ), + glsTextureTestUtil.triDerivateX( + triT[triNdx], triW[triNdx], wxo, dstW, nyo + ), + glsTextureTestUtil.triDerivateX( + triR[triNdx], triW[triNdx], wxo, dstW, nyo + ) + ], srcSize); + var coordDyo = deMath.multiply([ + glsTextureTestUtil.triDerivateY( + triS[triNdx], triW[triNdx], wyo, dstH, nxo + ), + glsTextureTestUtil.triDerivateY( + triT[triNdx], triW[triNdx], wyo, dstH, nxo + ), + glsTextureTestUtil.triDerivateY( + triR[triNdx], triW[triNdx], wyo, dstH, nxo + ) + ], srcSize); + var lodO = + tcuTexLookupVerifier.computeLodBoundsFromDerivates( + coordDxo[0], coordDxo[1], coordDxo[2], + coordDyo[0], coordDyo[1], coordDyo[2], lodPrec + ); + + lodBounds[0] = Math.min(lodBounds[0], lodO[0]); + lodBounds[1] = Math.max(lodBounds[1], lodO[1]); + } + + var clampedLod = tcuTexLookupVerifier.clampLodBounds( + deMath.addScalar(lodBounds, lodBias), + [sampleParams.minLod, sampleParams.maxLod], + lodPrec + ); + + if ( + tcuTexLookupVerifier.isLookupResultValid( + src, sampleParams.sampler, lookupPrec, + coord, clampedLod, resPix + ) + ) { + isOk = true; + break; + } + } + + if (!isOk) { + var red = [255, 0, 0, 255]; + errorMask.setPixel(new tcuRGBA.RGBA(red).toVec(), px, py); + numFailed += 1; + } + } + } + } + + return numFailed; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.TextureCubeView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {tcuPixelFormat.PixelFormat} pixelFormat + * @return {boolean} + */ +glsTextureTestUtil.verifyTextureCubeResult = function( + result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat +) { + /** @type {tcuSurface.Surface} */ + var reference = new tcuSurface.Surface( + result.getWidth(), result.getHeight() + ); + /** @type {tcuSurface.Surface} */ + var errorMask = new tcuSurface.Surface( + result.getWidth(), result.getHeight() + ); + /** @type {number} */ var numFailedPixels = 0; + + assertMsgOptions( + deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask), + 'Compare color masks do not match', false, true + ); + + /** @type {glsTextureTestUtil.SurfaceAccess} */ + var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat); + + glsTextureTestUtil.sampleTextureCube( + surface, src, texCoord, sampleParams + ); + + numFailedPixels = glsTextureTestUtil.computeTextureLookupDiffCube( + result, reference.getAccess(), errorMask.getAccess(), + src, texCoord, sampleParams, lookupPrec, lodPrec + /*, testCtx.getWatchDog()*/ + ); + + if (numFailedPixels > 0) + tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess()); + + return numFailedPixels == 0; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.TextureCubeView} baseView + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @return {number} + */ +glsTextureTestUtil.computeTextureLookupDiffCube = function( + result, reference, errorMask, baseView, texCoord, + sampleParams, lookupPrec, lodPrec +) { + assertMsgOptions( + result.getWidth() == reference.getWidth() && + result.getHeight() == reference.getHeight(), + 'Result and reference images are not the same size', false, true + ); + assertMsgOptions( + result.getWidth() == errorMask.getWidth() && + result.getHeight() == errorMask.getHeight(), + 'Result and error mask images are not the same size', false, true + ); + + /** @type {tcuTexture.TextureCubeView} */ + var src = baseView.getSubView( + sampleParams.baseLevel, sampleParams.maxLevel + ); + + var sq = + [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + var tq = + [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + var rq = + [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + var dstSize = [result.getWidth(), result.getHeight()]; + var dstW = dstSize[0]; + var dstH = dstSize[1]; + var srcSize = [src.getSize(), src.getSize()]; + + // Coordinates and lod per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + var triW = [ + deMath.swizzle(sampleParams.w, [0, 1, 2]), + deMath.swizzle(sampleParams.w, [3, 2, 1]) + ]; + + var lodBias = sampleParams.flags.useBias ? sampleParams.bias : 0.0; + + var posEps = 1.0 / ((1 << MIN_SUBPIXEL_BITS) + 1); + + var numFailed = 0; + + var lodOffsets = [ + [-1, 0], + [+1, 0], + [0, -1], + [0, +1], + + // \note Not strictly allowed by spec, + // but implementations do this in practice. + [-1, -1], + [-1, 1], + [1, -1], + [1, 1] + ]; + + var green = [0, 255, 0, 255]; + errorMask.clear(new tcuRGBA.RGBA(green).toVec()); + + for (var py = 0; py < result.getHeight(); py++) { + // Ugly hack, validation can take way too long at the moment. + /*TODO: if (watchDog) + qpWatchDog_touch(watchDog);*/ + + for (var px = 0; px < result.getWidth(); px++) { + /** @type {Array} */ + var resPix = result.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias); + /** @type {Array} */ + var refPix = reference.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias); + + // Try comparison to ideal reference first, + // and if that fails use slower verificator. + if (!deMath.boolAll(deMath.lessThanEqual( + deMath.absDiff(resPix, refPix), + lookupPrec.colorThreshold)) + ) { + /** @type {number} */ var wx = px + 0.5; + /** @type {number} */ var wy = py + 0.5; + /** @type {number} */ var nx = wx / dstW; + /** @type {number} */ var ny = wy / dstH; + + /** @type {boolean} */ var tri0 = nx + ny - posEps <= 1.0; + /** @type {boolean} */ var tri1 = nx + ny + posEps >= 1.0; + + var isOk = false; + + assertMsgOptions( + tri0 || tri1, + 'Pixel should belong at least to one triangle', + false, true + ); + + // Pixel can belong to either of the triangles + // if it lies close enough to the edge. + for (var triNdx = (tri0 ? 0 : 1); + triNdx <= (tri1 ? 1 : 0); + triNdx++) { + var triWx = triNdx ? dstW - wx : wx; + var triWy = triNdx ? dstH - wy : wy; + var triNx = triNdx ? 1.0 - nx : nx; + var triNy = triNdx ? 1.0 - ny : ny; + + var coord = [ + glsTextureTestUtil.projectedTriInterpolate( + triS[triNdx], triW[triNdx], triNx, triNy + ), + glsTextureTestUtil.projectedTriInterpolate( + triT[triNdx], triW[triNdx], triNx, triNy + ), + glsTextureTestUtil.projectedTriInterpolate( + triR[triNdx], triW[triNdx], triNx, triNy + ) + ]; + var coordDx = [ + glsTextureTestUtil.triDerivateX( + triS[triNdx], triW[triNdx], wx, dstW, triNy + ), + glsTextureTestUtil.triDerivateX( + triT[triNdx], triW[triNdx], wx, dstW, triNy + ), + glsTextureTestUtil.triDerivateX( + triR[triNdx], triW[triNdx], wx, dstW, triNy + ) + ]; + var coordDy = [ + glsTextureTestUtil.triDerivateY( + triS[triNdx], triW[triNdx], wy, dstH, triNx + ), + glsTextureTestUtil.triDerivateY( + triT[triNdx], triW[triNdx], wy, dstH, triNx + ), + glsTextureTestUtil.triDerivateY( + triR[triNdx], triW[triNdx], wy, dstH, triNx + ) + ]; + + var lodBounds = + tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates( + coord, coordDx, coordDy, src.getSize(), lodPrec + ); + + // Compute lod bounds across lodOffsets range. + for (var lodOffsNdx = 0; + lodOffsNdx < lodOffsets.length; + lodOffsNdx++) { + var wxo = triWx + lodOffsets[lodOffsNdx][0]; + var wyo = triWy + lodOffsets[lodOffsNdx][1]; + var nxo = wxo / dstW; + var nyo = wyo / dstH; + + var coordO = [ + glsTextureTestUtil.projectedTriInterpolate( + triS[triNdx], triW[triNdx], nxo, nyo + ), + glsTextureTestUtil.projectedTriInterpolate( + triT[triNdx], triW[triNdx], nxo, nyo + ), + glsTextureTestUtil.projectedTriInterpolate( + triR[triNdx], triW[triNdx], nxo, nyo + ) + ]; + var coordDxo = [ + glsTextureTestUtil.triDerivateX( + triS[triNdx], triW[triNdx], wxo, dstW, nyo + ), + glsTextureTestUtil.triDerivateX( + triT[triNdx], triW[triNdx], wxo, dstW, nyo + ), + glsTextureTestUtil.triDerivateX( + triR[triNdx], triW[triNdx], wxo, dstW, nyo + ) + ]; + var coordDyo = [ + glsTextureTestUtil.triDerivateY( + triS[triNdx], triW[triNdx], wyo, dstH, nxo + ), + glsTextureTestUtil.triDerivateY( + triT[triNdx], triW[triNdx], wyo, dstH, nxo + ), + glsTextureTestUtil.triDerivateY( + triR[triNdx], triW[triNdx], wyo, dstH, nxo + ) + ]; + var lodO = + tcuTexLookupVerifier. + computeCubeLodBoundsFromDerivates( + coordO, coordDxo, coordDyo, + src.getSize(), lodPrec + ); + + lodBounds[0] = Math.min(lodBounds[0], lodO[0]); + lodBounds[1] = Math.max(lodBounds[1], lodO[1]); + } + + var clampedLod = tcuTexLookupVerifier.clampLodBounds( + deMath.addScalar(lodBounds, lodBias), + [sampleParams.minLod, sampleParams.maxLod], + lodPrec + ); + + if (tcuTexLookupVerifier. + isLookupResultValid_TextureCubeView( + src, sampleParams.sampler, lookupPrec, coord, clampedLod, resPix + ) + ) { + isOk = true; + break; + } + } + + if (!isOk) { + var red = [255, 0, 0, 255]; + errorMask.setPixel(new tcuRGBA.RGBA(red).toVec(), px, py); + numFailed += 1; + } + } + } + } + + return numFailed; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.Texture2DArrayView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {tcuPixelFormat.PixelFormat} pixelFormat + * @return {boolean} + */ +glsTextureTestUtil.verifyTexture2DArrayResult = function(result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat) { + DE_ASSERT(deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask)); + /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight()); + /** @type {number} */ var numFailedPixels; + + /** @type {glsTextureTestUtil.SurfaceAccess} */ var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat); + + glsTextureTestUtil.sampleTexture2DArray(surface, src, texCoord, sampleParams); + numFailedPixels = glsTextureTestUtil.computeTextureLookupDiff2DArray(result, reference.getAccess(), errorMask.getAccess(), src, texCoord, sampleParams, lookupPrec, lodPrec/*, testCtx.getWatchDog()*/); + + if (numFailedPixels > 0) + tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess()); + + return numFailedPixels == 0; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.Texture2DArrayView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {Array} nonShadowThreshold + * @return {number} + */ +glsTextureTestUtil.computeTextureCompareDiff2DArray = function(result, reference, errorMask, src, texCoord, sampleParams, comparePrec, lodPrec, nonShadowThreshold) { + DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight()); + DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight()); + + var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + var dstSize = [result.getWidth(), result.getHeight()]; + var dstW = dstSize[0]; + var dstH = dstSize[1]; + var srcSize = [src.getWidth(), src.getHeight()]; + + // Coordinates and lod per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])]; + + var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0, 0]; + var numFailed = 0; + + var lodOffsets = [ + [-1, 0], + [1, 0], + [0, -1], + [0, 1] + ]; + + /** @type {Array} */ var green = [0, 255, 0, 255]; + errorMask.clear(green); + + /** @type {Array} */ var red = []; + for (var py = 0; py < result.getHeight(); py++) { + for (var px = 0; px < result.getWidth(); px++) { + /** @type {Array} */ + var resPix = result.getPixel(px, py); + /** @type {Array} */ + var refPix = reference.getPixel(px, py); + + if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(deMath.swizzle(refPix, [1, 2, 3]), deMath.swizzle(resPix, [1, 2, 3])), nonShadowThreshold))) { + red = [255, 0, 0, 255]; + errorMask.setPixel(red, px, py); + numFailed += 1; + continue; + } + + if (resPix[0] != refPix[0]) { + var wx = px + 0.5; + var wy = py + 0.5; + var nx = wx / dstW; + var ny = wy / dstH; + + var triNdx = nx + ny >= 1.0 ? 1 : 0; + var triWx = triNdx ? dstW - wx : wx; + var triWy = triNdx ? dstH - wy : wy; + var triNx = triNdx ? 1.0 - nx : nx; + var triNy = triNdx ? 1.0 - ny : ny; + + var coord = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], triNx, triNy)]; + var coordDx = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize); + var coordDy = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize); + + var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec); + + // Compute lod bounds across lodOffsets range. + for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) { + var wxo = triWx + lodOffsets[lodOffsNdx][0]; + var wyo = triWy + lodOffsets[lodOffsNdx][1]; + var nxo = wxo / dstW; + var nyo = wyo / dstH; + + var coordO = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo)]; + var coordDxo = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize); + var coordDyo = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize); + var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec); + + lodBounds[0] = Math.min(lodBounds[0], lodO[0]); + lodBounds[1] = Math.max(lodBounds[1], lodO[1]); + } + + var clampedLod = tcuTexLookupVerifier.clampLodBounds(deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec); + var isOk = tcuTexCompareVerifier.isTexCompareResultValid2DArray(src, sampleParams.sampler, comparePrec, coord, clampedLod, sampleParams.ref, resPix[0]); + + if (!isOk) { + red = [255, 0, 0, 255]; + errorMask.setPixel(red, px, py); + numFailed += 1; + } + } + } + } + + return numFailed; +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.TextureCubeView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {Array} nonShadowThreshold + * @return {number} + */ +glsTextureTestUtil.computeTextureCompareDiffCube = function(result, reference, errorMask, src, texCoord, sampleParams, comparePrec, lodPrec, nonShadowThreshold) { + DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight()); + DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight()); + + var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + var dstSize = [result.getWidth(), result.getHeight()]; + var dstW = dstSize[0]; + var dstH = dstSize[1]; + var srcSize = src.getSize(); + + // Coordinates per triangle. + var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])]; + + var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0, 0]; + var numFailed = 0; + + var lodOffsets = [ + [-1, 0], + [1, 0], + [0, -1], + [0, 1] + ]; + + /** @type {Array} */ var green = [0, 255, 0, 255]; + errorMask.clear(new tcuRGBA.RGBA(green).toVec()); + + /** @type {Array} */ var red = []; + for (var py = 0; py < result.getHeight(); py++) { + for (var px = 0; px < result.getWidth(); px++) { + /** @type {Array} */ + var resPix = result.getPixel(px, py); + /** @type {Array} */ + var refPix = reference.getPixel(px, py); + + if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(deMath.swizzle(resPix, [1, 2, 3]), deMath.swizzle(refPix, [1, 2, 3])), nonShadowThreshold))) { + red = [255, 0, 0, 255]; + errorMask.setPixel(red, px, py); + numFailed += 1; + continue; + } + + if (resPix[0] != refPix[0]) { + var wx = px + 0.5; + var wy = py + 0.5; + var nx = wx / dstW; + var ny = wy / dstH; + + var triNdx = nx + ny >= 1.0 ? 1 : 0; + var triWx = triNdx ? dstW - wx : wx; + var triWy = triNdx ? dstH - wy : wy; + var triNx = triNdx ? 1.0 - nx : nx; + var triNy = triNdx ? 1.0 - ny : ny; + + var coord = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], triNx, triNy)]; + var coordDx = [glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triR[triNdx], triW[triNdx], wx, dstW, triNy)]; + var coordDy = [glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triR[triNdx], triW[triNdx], wy, dstH, triNx)]; + + var lodBounds = tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates(coord, coordDx, coordDy, srcSize, lodPrec); + + // Compute lod bounds across lodOffsets range. + for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) { + var wxo = triWx + lodOffsets[lodOffsNdx][0]; + var wyo = triWy + lodOffsets[lodOffsNdx][1]; + var nxo = wxo / dstW; + var nyo = wyo / dstH; + + var coordO = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo), + glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], nxo, nyo)]; + var coordDxo = [glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo), + glsTextureTestUtil.triDerivateX(triR[triNdx], triW[triNdx], wxo, dstW, nyo)]; + var coordDyo = [glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo), + glsTextureTestUtil.triDerivateY(triR[triNdx], triW[triNdx], wyo, dstH, nxo)]; + var lodO = tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates(coordO, coordDxo, coordDyo, srcSize, lodPrec); + + lodBounds[0] = Math.min(lodBounds[0], lodO[0]); + lodBounds[1] = Math.max(lodBounds[1], lodO[1]); + } + + var clampedLod = tcuTexLookupVerifier.clampLodBounds(deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec); + var isOk = tcuTexCompareVerifier.isTexCompareResultValidCube(src, sampleParams.sampler, comparePrec, coord, clampedLod, sampleParams.ref, resPix[0]); + + if (!isOk) { + red = [255, 0, 0, 255]; + errorMask.setPixel(red, px, py); + numFailed += 1; + } + } + } + } + + return numFailed; +}; + +/** + * @param {Array} s + * @param {Array} w + * @param {number} nx + * @param {number} ny + * @return {number} + */ +glsTextureTestUtil.projectedTriInterpolate = function(s, w, nx, ny) { + return (s[0] * (1.0 - nx - ny) / w[0] + s[1] * ny / w[1] + s[2] * nx / w[2]) / ((1.0 - nx - ny) / w[0] + ny / w[1] + nx / w[2]); +}; + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.Texture2DView} baseView + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {*=} watchDog - TODO: ?? + * @return {number} + */ +glsTextureTestUtil.computeTextureLookupDiff2D = function(result, reference, errorMask, baseView, texCoord, sampleParams, lookupPrec, lodPrec, watchDog) { + DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight()); + DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight()); + + /** @type {tcuTexture.Texture2DView} */ var src = baseView.getSubView(sampleParams.baseLevel, sampleParams.maxLevel); + + /** @type {Array} */ var sq = [texCoord[0 + 0], texCoord[2 + 0], texCoord[4 + 0], texCoord[6 + 0]]; + /** @type {Array} */ var tq = [texCoord[0 + 1], texCoord[2 + 1], texCoord[4 + 1], texCoord[6 + 1]]; + + /** @type {Array} */ var dstSize = [result.getWidth(), result.getHeight()]; + /** @type {number} */ var dstW = dstSize[0]; + /** @type {number} */ var dstH = dstSize[1]; + /** @type {Array} */ var srcSize = [src.getWidth(), src.getHeight()]; + + // Coordinates and lod per triangle. + /** @type {Array>} */ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + /** @type {Array>} */ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + /** @type {Array>} */ var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])]; + + /** @type {Array} */ var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0.0, 0.0]; + + /** @type {number} */ var numFailed = 0; + + /** @type {Array>} */ var lodOffsets = [ + [-1, 0], + [1, 0], + [0, -1], + [0, 1] + ]; + + /** @type {Array} */ var green = [0, 255, 0, 255]; + errorMask.clear(new tcuRGBA.RGBA(green).toVec()); + + for (var py = 0; py < result.getHeight(); py++) { + // Ugly hack, validation can take way too long at the moment. + + // TODO:are we implementing qpWatchDog? skipping in the meantime + // if (watchDog) + // qpWatchDog_touch(watchDog); + + for (var px = 0; px < result.getWidth(); px++) { + /** @type {Array} */ + var resPix = result.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias); + /** @type {Array} */ + var refPix = reference.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias); + + // Try comparison to ideal reference first, and if that fails use slower verificator. + if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(resPix, refPix), lookupPrec.colorThreshold))) { + /** @type {number} */ var wx = px + 0.5; + /** @type {number} */ var wy = py + 0.5; + /** @type {number} */ var nx = wx / dstW; + /** @type {number} */ var ny = wy / dstH; + + /** @type {number} */ var triNdx = nx + ny >= 1.0 ? 1 : 0; + /** @type {number} */ var triWx = triNdx ? dstW - wx : wx; + /** @type {number} */ var triWy = triNdx ? dstH - wy : wy; + /** @type {number} */ var triNx = triNdx ? 1.0 - nx : nx; + /** @type {number} */ var triNy = triNdx ? 1.0 - ny : ny; + + /** @type {Array} */ var coord = [ + glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy) + ]; + /** @type {Array} */ var coordDx = deMath.multiply([ + glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize); + /** @type {Array} */ var coordDy = deMath.multiply([ + glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize); + + /** @type {Array} */ + var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec); + + // Compute lod bounds across lodOffsets range. + for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) { + /** @type {number} */ var wxo = triWx + lodOffsets[lodOffsNdx][0]; + /** @type {number} */ var wyo = triWy + lodOffsets[lodOffsNdx][1]; + /** @type {number} */ var nxo = wxo / dstW; + /** @type {number} */ var nyo = wyo / dstH; + + /** @type {Array} */ var coordO = [ + glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo)]; + /** @type {Array} */ var coordDxo = deMath.multiply([ + glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize); + /** @type {Array} */ var coordDyo = deMath.multiply([ + glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize); + /** @type {Array} */ + var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec); + + lodBounds[0] = Math.min(lodBounds[0], lodO[0]); + lodBounds[1] = Math.max(lodBounds[1], lodO[1]); + } + + /** @type {Array} */ var clampedLod = tcuTexLookupVerifier.clampLodBounds( + deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec); + /** @type {boolean} */ + var isOk = tcuTexLookupVerifier.isLookupResultValid_Texture2DView(src, sampleParams.sampler, lookupPrec, coord, clampedLod, resPix); + + if (!isOk) { + /** @type {tcuRGBA.RGBA} */ var red = tcuRGBA.newRGBAComponents(255, 0, 0, 255); + errorMask.setPixel(red.toVec(), px, py); + numFailed += 1; + } + } + } + } + + return numFailed; +}; + +// Verifies texture lookup results and returns number of failed pixels. + +/** + * @param {tcuTexture.ConstPixelBufferAccess} result + * @param {tcuTexture.ConstPixelBufferAccess} reference + * @param {tcuTexture.PixelBufferAccess} errorMask + * @param {tcuTexture.Texture2DArrayView} src + * @param {Array} texCoord + * @param {glsTextureTestUtil.ReferenceParams} sampleParams + * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec + * @param {tcuTexLookupVerifier.LodPrecision} lodPrec + * @param {*=} watchDog - TODO: ?? + * @return {number} + */ +glsTextureTestUtil.computeTextureLookupDiff2DArray = function(result, reference, errorMask, src, texCoord, sampleParams, lookupPrec, lodPrec, watchDog) { + DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight()); + DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight()); + + /** @type {Array} */ var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]]; + /** @type {Array} */ var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]]; + /** @type {Array} */ var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]]; + + /** @type {Array} */ var dstSize = [result.getWidth(), result.getHeight()]; + /** @type {number} */ var dstW = dstSize[0]; + /** @type {number} */ var dstH = dstSize[1]; + /** @type {Array} */ var srcSize = [src.getWidth(), src.getHeight()]; + + // Coordinates and lod per triangle. + /** @type {Array>} */ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])]; + /** @type {Array>} */ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])]; + /** @type {Array>} */ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])]; + /** @type {Array>} */ var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])]; + + /** @type {Array} */ var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0.0, 0.0]; + + /** @type {number} */ var numFailed = 0; + + /** @type {Array>} */ var lodOffsets = [ + [-1, 0], + [1, 0], + [0, -1], + [0, 1] + ]; + + /** @type {Array} */ var green = [0, 255, 0, 255]; + errorMask.clear(new tcuRGBA.RGBA(green).toVec()); + + for (var py = 0; py < result.getHeight(); py++) { + // Ugly hack, validation can take way too long at the moment. + + // TODO:are we implementing qpWatchDog? skipping in the meantime + // if (watchDog) + // qpWatchDog_touch(watchDog); + + for (var px = 0; px < result.getWidth(); px++) { + /** @type {Array} */ + var resPix = result.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias); + /** @type {Array} */ + var refPix = reference.getPixel(px, py); + glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias); + + + // Try comparison to ideal reference first, and if that fails use slower verificator. + if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(resPix, refPix), lookupPrec.colorThreshold))) { + /** @type {number} */ var wx = px + 0.5; + /** @type {number} */ var wy = py + 0.5; + /** @type {number} */ var nx = wx / dstW; + /** @type {number} */ var ny = wy / dstH; + + /** @type {number} */ var triNdx = nx + ny >= 1.0 ? 1 : 0; + /** @type {number} */ var triWx = triNdx ? dstW - wx : wx; + /** @type {number} */ var triWy = triNdx ? dstH - wy : wy; + /** @type {number} */ var triNx = triNdx ? 1.0 - nx : nx; + /** @type {number} */ var triNy = triNdx ? 1.0 - ny : ny; + + /** @type {Array} */ var coord = [ + glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy), + glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], triNx, triNy) + ]; + /** @type {Array} */ var coordDx = deMath.multiply([ + glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize); + /** @type {Array} */ var coordDy = deMath.multiply([ + glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize); + + /** @type {Array} */ + var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec); + + // Compute lod bounds across lodOffsets range. + for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) { + /** @type {number} */ var wxo = triWx + lodOffsets[lodOffsNdx][0]; + /** @type {number} */ var wyo = triWy + lodOffsets[lodOffsNdx][1]; + /** @type {number} */ var nxo = wxo / dstW; + /** @type {number} */ var nyo = wyo / dstH; + + /** @type {Array} */ var coordO = [ + glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo), + glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo), + glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], nxo, nyo) + ]; + /** @type {Array} */ var coordDxo = deMath.multiply([ + glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo), + glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize + ); + /** @type {Array} */ var coordDyo = deMath.multiply([ + glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo), + glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize + ); + /** @type {Array} */ + var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec); + + lodBounds[0] = Math.min(lodBounds[0], lodO[0]); + lodBounds[1] = Math.max(lodBounds[1], lodO[1]); + } + + /** @type {Array} */ var clampedLod = tcuTexLookupVerifier.clampLodBounds( + deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec); + /** @type {boolean} */ + var isOk = tcuTexLookupVerifier.isLookupResultValid_Texture2DArrayView(src, sampleParams.sampler, lookupPrec, coord, clampedLod, resPix); + + if (!isOk) { + /** @type {tcuRGBA.RGBA} */ var red = tcuRGBA.newRGBAComponents(255, 0, 0, 255); + errorMask.setPixel(red.toVec(), px, py); + numFailed += 1; + } + } + } + } + + return numFailed; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js new file mode 100644 index 000000000..e9c45366a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js @@ -0,0 +1,2451 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsUniformBlockCase'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.delibs.debase.deString'); +goog.require('framework.delibs.debase.deUtil'); +goog.require('framework.opengl.gluDrawUtil'); +goog.require('framework.opengl.gluShaderProgram'); +goog.require('framework.opengl.gluShaderUtil'); + +goog.scope(function() { + +var glsUniformBlockCase = modules.shared.glsUniformBlockCase; +var tcuTestCase = framework.common.tcuTestCase; +var gluShaderProgram = framework.opengl.gluShaderProgram; +var gluShaderUtil = framework.opengl.gluShaderUtil; +var gluDrawUtil = framework.opengl.gluDrawUtil; +var deUtil = framework.delibs.debase.deUtil; +var deMath = framework.delibs.debase.deMath; +var deRandom = framework.delibs.debase.deRandom; +var deString = framework.delibs.debase.deString; + +var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); +}; + +var littleEndian = (function() { + var buffer = new ArrayBuffer(2); + new DataView(buffer).setInt16(0, 256, true /* littleEndian */); + // Int16Array uses the platform's endianness. + return new Int16Array(buffer)[0] === 256; +})(); + +/** + * Class to implement some pointers functionality. + * @constructor + */ +glsUniformBlockCase.BlockPointers = function() { + /** @type {ArrayBuffer} */ this.data; //!< Data (vector). + /** @type {Array} */ this.offsets = []; //!< Reference block pointers (map). + /** @type {Array} */ this.sizes = []; +}; + +/** + * push - Adds an offset/size pair to the collection + * @param {number} offset Offset of the element to refer. + * @param {number} size Size of the referred element. + */ +glsUniformBlockCase.BlockPointers.prototype.push = function(offset, size) { + this.offsets.push(offset); + this.sizes.push(size); +}; + +/** + * find - Finds and maps the data at the given offset, and returns a Uint8Array + * @param {number} index of the element to find. + * @return {Uint8Array} + */ +glsUniformBlockCase.BlockPointers.prototype.find = function(index) { + return new Uint8Array(this.data, this.offsets[index], this.sizes[index]); +}; + +/** + * resize - Replaces resize of a vector in C++. Sets the size of the data buffer. + * NOTE: In this case however, if you resize, the data is lost. + * @param {number} newsize The new size of the data buffer. + */ +glsUniformBlockCase.BlockPointers.prototype.resize = function(newsize) { + this.data = new ArrayBuffer(newsize); +}; + +/** + * glsUniformBlockCase.isSupportedGLSLVersion + * @param {gluShaderUtil.GLSLVersion} version + * @return {boolean} + */ +glsUniformBlockCase.isSupportedGLSLVersion = function(version) { + return version >= gluShaderUtil.GLSLVersion.V300_ES; +}; + +/** + * @enum {number} + */ +glsUniformBlockCase.UniformFlags = { + PRECISION_LOW: (1 << 0), + PRECISION_MEDIUM: (1 << 1), + PRECISION_HIGH: (1 << 2), + + LAYOUT_SHARED: (1 << 3), + LAYOUT_PACKED: (1 << 4), + LAYOUT_STD140: (1 << 5), + LAYOUT_ROW_MAJOR: (1 << 6), + LAYOUT_COLUMN_MAJOR: (1 << 7), //!< \note Lack of both flags means column-major matrix. + + DECLARE_VERTEX: (1 << 8), + DECLARE_FRAGMENT: (1 << 9), + + UNUSED_VERTEX: (1 << 10), //!< glsUniformBlockCase.Uniform or struct member is not read in vertex shader. + UNUSED_FRAGMENT: (1 << 11) //!< glsUniformBlockCase.Uniform or struct member is not read in fragment shader. +}; + +/** @const */ glsUniformBlockCase.UniformFlags.PRECISION_MASK = glsUniformBlockCase.UniformFlags.PRECISION_LOW | glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM | glsUniformBlockCase.UniformFlags.PRECISION_HIGH; +/** @const */ glsUniformBlockCase.UniformFlags.LAYOUT_MASK = glsUniformBlockCase.UniformFlags.LAYOUT_SHARED | glsUniformBlockCase.UniformFlags.LAYOUT_PACKED | glsUniformBlockCase.UniformFlags.LAYOUT_STD140 | glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR | glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR; +/** @const */ glsUniformBlockCase.UniformFlags.DECLARE_BOTH = glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT; +/** @const */ glsUniformBlockCase.UniformFlags.UNUSED_BOTH = glsUniformBlockCase.UniformFlags.UNUSED_VERTEX | glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT; + +/** +* glsUniformBlockCase.VarType types enum +* @enum {number} +*/ +glsUniformBlockCase.Type = { + TYPE_BASIC: 0, + TYPE_ARRAY: 1, + TYPE_STRUCT: 2 +}; + +glsUniformBlockCase.Type.TYPE_LAST = Object.keys(glsUniformBlockCase.Type).length; + +/** +* glsUniformBlockCase.TypeArray struct (nothing to do with JS's TypedArrays) +* @param {glsUniformBlockCase.VarType} elementType +* @param {number} arraySize +* @constructor +*/ +glsUniformBlockCase.TypeArray = function(elementType, arraySize) { + /** @type {glsUniformBlockCase.VarType} */ this.elementType = elementType; + /** @type {number} */ this.size = arraySize; +}; + +/** + * glsUniformBlockCase.VarType class + * @constructor + */ +glsUniformBlockCase.VarType = function() { + /** @type {glsUniformBlockCase.Type} */ this.m_type; + /** @type {number} */ this.m_flags = 0; + + /* + * m_data used to be a 'Data' union in C++. Using a var is enough here. + * it will contain any necessary value. + */ + + /** @type {(gluShaderUtil.DataType|glsUniformBlockCase.TypeArray|glsUniformBlockCase.StructType)} */ + this.m_data; +}; + +/** +* Creates a basic type glsUniformBlockCase.VarType. Use this after the constructor call. +* @param {gluShaderUtil.DataType} basicType +* @param {number} flags +* @return {glsUniformBlockCase.VarType} The currently modified object +*/ +glsUniformBlockCase.VarType.prototype.VarTypeBasic = function(basicType, flags) { + this.m_type = glsUniformBlockCase.Type.TYPE_BASIC; + this.m_flags = flags; + this.m_data = basicType; + + return this; +}; + +/** +* Creates an array type glsUniformBlockCase.VarType. Use this after the constructor call. +* @param {glsUniformBlockCase.VarType} elementType +* @param {number} arraySize +* @return {glsUniformBlockCase.VarType} The currently modified object +*/ +glsUniformBlockCase.VarType.prototype.VarTypeArray = function(elementType, arraySize) { + this.m_type = glsUniformBlockCase.Type.TYPE_ARRAY; + this.m_flags = 0; + this.m_data = new glsUniformBlockCase.TypeArray(elementType, arraySize); + + return this; +}; + +/** +* Creates a struct type glsUniformBlockCase.VarType. Use this after the constructor call. +* @param {glsUniformBlockCase.StructType} structPtr +* @return {glsUniformBlockCase.VarType} The currently modified object +*/ +glsUniformBlockCase.VarType.prototype.VarTypeStruct = function(structPtr) { + this.m_type = glsUniformBlockCase.Type.TYPE_STRUCT; + this.m_flags = 0; + this.m_data = structPtr; + + return this; +}; + +/** isBasicType +* @return {boolean} true if the glsUniformBlockCase.VarType represents a basic type. +**/ +glsUniformBlockCase.VarType.prototype.isBasicType = function() { + return this.m_type == glsUniformBlockCase.Type.TYPE_BASIC; +}; + +/** isArrayType +* @return {boolean} true if the glsUniformBlockCase.VarType represents an array. +**/ +glsUniformBlockCase.VarType.prototype.isArrayType = function() { + return this.m_type == glsUniformBlockCase.Type.TYPE_ARRAY; +}; + +/** isStructType +* @return {boolean} true if the glsUniformBlockCase.VarType represents a struct. +**/ +glsUniformBlockCase.VarType.prototype.isStructType = function() { + return this.m_type == glsUniformBlockCase.Type.TYPE_STRUCT; +}; + +/** getFlags +* @return {number} returns the flags of the glsUniformBlockCase.VarType. +**/ +glsUniformBlockCase.VarType.prototype.getFlags = function() { + return this.m_flags; +}; + +/** getBasicType +* @return {gluShaderUtil.DataType} returns the basic data type of the glsUniformBlockCase.VarType. +**/ +glsUniformBlockCase.VarType.prototype.getBasicType = function() { + return /** @type {gluShaderUtil.DataType} */ (this.m_data); +}; + +/** getElementType +* @return {glsUniformBlockCase.VarType} returns the glsUniformBlockCase.VarType of the element in case of an Array. +**/ +glsUniformBlockCase.VarType.prototype.getElementType = function() { + return this.m_data.elementType; +}; + +/** getArraySize +* (not to be confused with a javascript array) +* @return {number} returns the size of the array in case it is an array. +**/ +glsUniformBlockCase.VarType.prototype.getArraySize = function() { + return this.m_data.size; +}; + +/** getStruct +* @return {glsUniformBlockCase.StructType} returns the structure when it is a glsUniformBlockCase.StructType. +**/ +glsUniformBlockCase.VarType.prototype.getStruct = function() { + return /** @type {glsUniformBlockCase.StructType} */ (this.m_data); +}; + +/** + * Creates a basic type glsUniformBlockCase.VarType. + * @param {gluShaderUtil.DataType} basicType + * @param {number} flags + * @return {glsUniformBlockCase.VarType} + */ +glsUniformBlockCase.newVarTypeBasic = function(basicType, flags) { + return new glsUniformBlockCase.VarType().VarTypeBasic(basicType, flags); +}; + +/** +* Creates an array type glsUniformBlockCase.VarType. +* @param {glsUniformBlockCase.VarType} elementType +* @param {number} arraySize +* @return {glsUniformBlockCase.VarType} +*/ +glsUniformBlockCase.newVarTypeArray = function(elementType, arraySize) { + return new glsUniformBlockCase.VarType().VarTypeArray(elementType, arraySize); +}; + +/** +* Creates a struct type glsUniformBlockCase.VarType. +* @param {glsUniformBlockCase.StructType} structPtr +* @return {glsUniformBlockCase.VarType} +*/ +glsUniformBlockCase.newVarTypeStruct = function(structPtr) { + return new glsUniformBlockCase.VarType().VarTypeStruct(structPtr); +}; + +/** glsUniformBlockCase.StructMember + * in the JSDoc annotations or if a number would do. + * @constructor +**/ +glsUniformBlockCase.StructMember = function() { + /** @type {string} */ this.m_name; + /** @type {glsUniformBlockCase.VarType} */ this.m_type; + /** @type {number} */ this.m_flags = 0; +}; + +/** + * Creates a glsUniformBlockCase.StructMember. Use this after the constructor call. + * @param {string} name + * @param {glsUniformBlockCase.VarType} type + * @param {number} flags + * @return {glsUniformBlockCase.StructMember} The currently modified object + */ +glsUniformBlockCase.StructMember.prototype.Constructor = function(name, type, flags) { + this.m_type = type; + this.m_name = name; + this.m_flags = flags; + + return this; +}; + +/** getName +* @return {string} the name of the member +**/ +glsUniformBlockCase.StructMember.prototype.getName = function() { return this.m_name; }; + +/** getType +* @return {glsUniformBlockCase.VarType} the type of the member +**/ +glsUniformBlockCase.StructMember.prototype.getType = function() { return this.m_type; }; + +/** getFlags +* @return {number} the flags in the member +**/ +glsUniformBlockCase.StructMember.prototype.getFlags = function() { return this.m_flags; }; + +/** + * Creates a glsUniformBlockCase.StructMember with name, type and flags. + * @param {string} name + * @param {glsUniformBlockCase.VarType} type + * @return {glsUniformBlockCase.StructMember} + */ + glsUniformBlockCase.newStructMember = function(name, type, flags) { + return new glsUniformBlockCase.StructMember().Constructor(name, type, flags); + }; + +/** + * glsUniformBlockCase.StructType + * @constructor + */ +glsUniformBlockCase.StructType = function() { + /** @type {string}*/ this.m_typeName; + /** @type {Array} */ this.m_members = []; +}; + +/** + * glsUniformBlockCase.StructType - Constructor with type name + * @param {string} typeName + * @return {glsUniformBlockCase.StructType} The currently modified object. + */ +glsUniformBlockCase.StructType.prototype.Constructor = function(typeName) { + /** @type {string}*/ this.m_typeName = typeName; + return this; +}; + +/** getTypeName +* @return {string} +**/ +glsUniformBlockCase.StructType.prototype.getTypeName = function() { + return this.m_typeName; +}; + +/* + * Instead of iterators, we'll add + * a getter for a specific element (getMember), + * and current members amount (getSize). + */ + +/** getMember +* @param {number} memberNdx The index of the member to retrieve. +* @return {glsUniformBlockCase.StructMember} +**/ +glsUniformBlockCase.StructType.prototype.getMember = function(memberNdx) { + if (memberNdx >= 0 && memberNdx < this.m_members.length) + return this.m_members[memberNdx]; + else { + throw new Error("Invalid member index for glsUniformBlockCase.StructType's members"); + } +}; + +/** getSize +* @return {number} The size of the m_members array. +**/ +glsUniformBlockCase.StructType.prototype.getSize = function() { + return this.m_members.length; +}; + +/** addMember +* @param {string} member_name +* @param {glsUniformBlockCase.VarType} member_type +* @param {number=} member_flags +**/ +glsUniformBlockCase.StructType.prototype.addMember = function(member_name, member_type, member_flags) { + var member = glsUniformBlockCase.newStructMember(member_name, member_type, member_flags); + + this.m_members.push(member); +}; + +/** + * Creates a glsUniformBlockCase.StructType. + * @param {string} name + * @return {glsUniformBlockCase.StructType} + */ +glsUniformBlockCase.newStructType = function(name) { + return new glsUniformBlockCase.StructType().Constructor(name); +}; + +/** glsUniformBlockCase.Uniform + * @param {string} name + * @param {glsUniformBlockCase.VarType} type + * @param {number=} flags + * @constructor +**/ +glsUniformBlockCase.Uniform = function(name, type, flags) { + /** @type {string} */ this.m_name = name; + /** @type {glsUniformBlockCase.VarType} */ this.m_type = type; + /** @type {number} */ this.m_flags = (typeof flags === 'undefined') ? 0 : flags; +}; + +/** getName + * @return {string} + */ +glsUniformBlockCase.Uniform.prototype.getName = function() { + return this.m_name; +}; + +/** getType + * @return {glsUniformBlockCase.VarType} + */ +glsUniformBlockCase.Uniform.prototype.getType = function() { + return this.m_type; +}; + +/** getFlags +* @return {number} +**/ +glsUniformBlockCase.Uniform.prototype.getFlags = function() { + return this.m_flags; +}; + +/** glsUniformBlockCase.UniformBlock + * @param {string} blockName + * @constructor +**/ +glsUniformBlockCase.UniformBlock = function(blockName) { + /** @type {string} */ this.m_blockName = blockName; + /** @type {string} */ this.m_instanceName; + /** @type {Array} */ this.m_uniforms = []; + /** @type {number} */ this.m_arraySize = 0; //!< Array size or 0 if not interface block array. + /** @type {number} */ this.m_flags = 0; +}; + +/** getBlockName +* @return {string} +**/ +glsUniformBlockCase.UniformBlock.prototype.getBlockName = function() { + return this.m_blockName; +}; + +/** getInstanceName +* @return {string} +**/ +glsUniformBlockCase.UniformBlock.prototype.getInstanceName = function() { + return this.m_instanceName; +}; + +/** isArray +* @return {boolean} +**/ +glsUniformBlockCase.UniformBlock.prototype.isArray = function() { + return this.m_arraySize > 0; +}; + +/** getArraySize +* @return {number} +**/ +glsUniformBlockCase.UniformBlock.prototype.getArraySize = function() { + return this.m_arraySize; +}; + +/** getFlags +* @return {number} +**/ +glsUniformBlockCase.UniformBlock.prototype.getFlags = function() { + return this.m_flags; +}; + +/** setInstanceName +* @param {string} name +**/ +glsUniformBlockCase.UniformBlock.prototype.setInstanceName = function(name) { + this.m_instanceName = name; +}; + +/** setFlags +* @param {number} flags +**/ +glsUniformBlockCase.UniformBlock.prototype.setFlags = function(flags) { + this.m_flags = flags; +}; + +/** setArraySize +* @param {number} arraySize +**/ +glsUniformBlockCase.UniformBlock.prototype.setArraySize = function(arraySize) { + this.m_arraySize = arraySize; +}; + +/** addUniform +* @param {glsUniformBlockCase.Uniform} uniform +**/ +glsUniformBlockCase.UniformBlock.prototype.addUniform = function(uniform) { + this.m_uniforms.push(uniform); +}; + +/* + * Using uniform getter (getUniform), + * and uniform array size getter (countUniforms) + * instead of iterators. +*/ + +/** + * getUniform + * @param {number} index + * @return {glsUniformBlockCase.Uniform} + */ +glsUniformBlockCase.UniformBlock.prototype.getUniform = function(index) { + if (index >= 0 && index < this.m_uniforms.length) + return this.m_uniforms[index]; + else { + throw new Error("Invalid uniform index for glsUniformBlockCase.UniformBlock's uniforms"); + } +}; + +/** + * countUniforms + * @return {number} + */ +glsUniformBlockCase.UniformBlock.prototype.countUniforms = function() { + return this.m_uniforms.length; +}; + +/** + * glsUniformBlockCase.ShaderInterface + * @constructor + */ +glsUniformBlockCase.ShaderInterface = function() { + /** @type {Array} */ this.m_structs = []; + /** @type {Array} */ this.m_uniformBlocks = []; +}; + +/** allocStruct +* @param {string} name +* @return {glsUniformBlockCase.StructType} +**/ +glsUniformBlockCase.ShaderInterface.prototype.allocStruct = function(name) { + //m_structs.reserve(m_structs.length + 1); + this.m_structs.push(glsUniformBlockCase.newStructType(name)); + return this.m_structs[this.m_structs.length - 1]; +}; + +/** findStruct +* @param {string} name +* @return {glsUniformBlockCase.StructType} +**/ +glsUniformBlockCase.ShaderInterface.prototype.findStruct = function(name) { + for (var pos = 0; pos < this.m_structs.length; pos++) { + if (this.m_structs[pos].getTypeName() == name) + return this.m_structs[pos]; + } + return null; +}; + +/** getNamedStructs +* @param {Array} structs +**/ +glsUniformBlockCase.ShaderInterface.prototype.getNamedStructs = function(structs) { + for (var pos = 0; pos < this.m_structs.length; pos++) { + if (this.m_structs[pos].getTypeName() != undefined) + structs.push(this.m_structs[pos]); + } +}; + +/** allocBlock +* @param {string} name +* @return {glsUniformBlockCase.UniformBlock} +**/ +glsUniformBlockCase.ShaderInterface.prototype.allocBlock = function(name) { + this.m_uniformBlocks.push(new glsUniformBlockCase.UniformBlock(name)); + return this.m_uniformBlocks[this.m_uniformBlocks.length - 1]; +}; + +/** getNumUniformBlocks +* @return {number} +**/ +glsUniformBlockCase.ShaderInterface.prototype.getNumUniformBlocks = function() { + return this.m_uniformBlocks.length; +}; + +/** getUniformBlock +* @param {number} ndx +* @return {glsUniformBlockCase.UniformBlock} +**/ +glsUniformBlockCase.ShaderInterface.prototype.getUniformBlock = function(ndx) { + return this.m_uniformBlocks[ndx]; +}; + +/** + * @constructor + */ +glsUniformBlockCase.BlockLayoutEntry = function() { + return { + /** @type {number} */ size: 0, + /** @type {string} */ name: '', + /** @type {Array} */ activeUniformIndices: [] + }; +}; + +/** + * @constructor + */ +glsUniformBlockCase.UniformLayoutEntry = function() { + return { + /** @type {string} */ name: '', + /** @type {gluShaderUtil.DataType} */ type: gluShaderUtil.DataType.INVALID, + /** @type {number} */ size: 0, + /** @type {number} */ blockNdx: -1, + /** @type {number} */ offset: -1, + /** @type {number} */ arrayStride: -1, + /** @type {number} */ matrixStride: -1, + /** @type {boolean} */ isRowMajor: false + }; +}; + +/** + * @constructor + */ +glsUniformBlockCase.UniformLayout = function() { + /** @type {Array}*/ this.blocks = []; + /** @type {Array}*/ this.uniforms = []; +}; + +/** getUniformIndex, returns a uniform index number in the layout, + * given the uniform's name. + * @param {string} name + * @return {number} uniform's index + */ +glsUniformBlockCase.UniformLayout.prototype.getUniformIndex = function(name) { + for (var ndx = 0; ndx < this.uniforms.length; ndx++) { + if (this.uniforms[ndx].name == name) + return ndx; + } + return -1; +}; + +/** getBlockIndex, returns a block index number in the layout, + * given the block's name. + * @param {string} name the name of the block + * @return {number} block's index + */ +glsUniformBlockCase.UniformLayout.prototype.getBlockIndex = function(name) { + for (var ndx = 0; ndx < this.blocks.length; ndx++) { + if (this.blocks[ndx].name == name) + return ndx; + } + return -1; +}; + +/** + * @enum {number} + */ +glsUniformBlockCase.BufferMode = { + BUFFERMODE_SINGLE: 0, //!< Single buffer shared between uniform blocks. + BUFFERMODE_PER_BLOCK: 1 //!< Per-block buffers +}; + +glsUniformBlockCase.BufferMode.BUFFERMODE_LAST = Object.keys(glsUniformBlockCase.BufferMode).length; + +/** + * glsUniformBlockCase.PrecisionFlagsFmt + * @param {number} flags + * @return {string} + */ +glsUniformBlockCase.PrecisionFlagsFmt = function(flags) { + // Precision. + DE_ASSERT(deMath.dePop32(flags & (glsUniformBlockCase.UniformFlags.PRECISION_LOW | glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM | glsUniformBlockCase.UniformFlags.PRECISION_HIGH)) <= 1); + var str = ''; + str += (flags & glsUniformBlockCase.UniformFlags.PRECISION_LOW ? 'lowp' : + flags & glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM ? 'mediump' : + flags & glsUniformBlockCase.UniformFlags.PRECISION_HIGH ? 'highp' : ''); + + return str; +}; + +/** + * glsUniformBlockCase.LayoutFlagsFmt + * @param {number} flags_ + * @return {string} + */ +glsUniformBlockCase.LayoutFlagsFmt = function(flags_) { + var str = ''; + var bitDesc = + [{ bit: glsUniformBlockCase.UniformFlags.LAYOUT_SHARED, token: 'shared' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_PACKED, token: 'packed' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_STD140, token: 'std140' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR, token: 'row_major' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR, token: 'column_major' } + ]; + + /** @type {number} */ var remBits = flags_; + for (var descNdx = 0; descNdx < bitDesc.length; descNdx++) { + if (remBits & bitDesc[descNdx].bit) { + if (remBits != flags_) + str += ', '; + str += bitDesc[descNdx].token; + remBits &= (~bitDesc[descNdx].bit) & 0xFFFFFFFF; //0xFFFFFFFF truncate to 32 bit value + } + } + DE_ASSERT(remBits == 0); + + return str; +}; + +/** + * @constructor + */ +glsUniformBlockCase.UniformBufferManager = function(renderCtx) { + this.m_renderCtx = renderCtx; + /** @type {Array} */ this.m_buffers = []; +}; + +/** + * allocBuffer + * @return {WebGLBuffer} + */ +glsUniformBlockCase.UniformBufferManager.prototype.allocBuffer = function() { + /** @type {WebGLBuffer} */ var buf = this.m_renderCtx.createBuffer(); + + this.m_buffers.push(buf); + + return buf; +}; + +/** + * @param {string} name + * @param {string} description + * @param {glsUniformBlockCase.BufferMode} bufferMode + * @constructor + * @extends {tcuTestCase.DeqpTest} + */ +glsUniformBlockCase.UniformBlockCase = function(name, description, bufferMode) { + tcuTestCase.DeqpTest.call(this, name, description); + /** @type {string} */ this.m_name = name; + /** @type {string} */ this.m_description = description; + /** @type {glsUniformBlockCase.BufferMode} */ this.m_bufferMode = bufferMode; + /** @type {glsUniformBlockCase.ShaderInterface} */ this.m_interface = new glsUniformBlockCase.ShaderInterface(); +}; + +glsUniformBlockCase.UniformBlockCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype); +glsUniformBlockCase.UniformBlockCase.prototype.constructor = glsUniformBlockCase.UniformBlockCase; + +/** + * glsUniformBlockCase.getDataTypeByteSize + * @param {gluShaderUtil.DataType} type + * @return {number} + */ +glsUniformBlockCase.getDataTypeByteSize = function(type) { + return gluShaderUtil.getDataTypeScalarSize(type) * deMath.INT32_SIZE; +}; + +/** + * glsUniformBlockCase.getDataTypeByteAlignment + * @param {gluShaderUtil.DataType} type + * @return {number} + */ +glsUniformBlockCase.getDataTypeByteAlignment = function(type) { + switch (type) { + case gluShaderUtil.DataType.FLOAT: + case gluShaderUtil.DataType.INT: + case gluShaderUtil.DataType.UINT: + case gluShaderUtil.DataType.BOOL: return 1 * deMath.INT32_SIZE; + + case gluShaderUtil.DataType.FLOAT_VEC2: + case gluShaderUtil.DataType.INT_VEC2: + case gluShaderUtil.DataType.UINT_VEC2: + case gluShaderUtil.DataType.BOOL_VEC2: return 2 * deMath.INT32_SIZE; + + case gluShaderUtil.DataType.FLOAT_VEC3: + case gluShaderUtil.DataType.INT_VEC3: + case gluShaderUtil.DataType.UINT_VEC3: + case gluShaderUtil.DataType.BOOL_VEC3: // Fall-through to vec4 + + case gluShaderUtil.DataType.FLOAT_VEC4: + case gluShaderUtil.DataType.INT_VEC4: + case gluShaderUtil.DataType.UINT_VEC4: + case gluShaderUtil.DataType.BOOL_VEC4: return 4 * deMath.INT32_SIZE; + + default: + DE_ASSERT(false); + return 0; + } +}; + +/** + * glsUniformBlockCase.getDataTypeArrayStride + * @param {gluShaderUtil.DataType} type + * @return {number} + */ +glsUniformBlockCase.getDataTypeArrayStride = function(type) { + DE_ASSERT(!gluShaderUtil.isDataTypeMatrix(type)); + + /** @type {number} */ var baseStride = glsUniformBlockCase.getDataTypeByteSize(type); + /** @type {number} */ var vec4Alignment = deMath.INT32_SIZE * 4; + + DE_ASSERT(baseStride <= vec4Alignment); + return Math.max(baseStride, vec4Alignment); // Really? See rule 4. +}; + +/** + * glsUniformBlockCase.deRoundUp32 Rounds up 'a' in case the + * relationship with 'b' has a decimal part. + * @param {number} a + * @param {number} b + * @return {number} + */ +glsUniformBlockCase.deRoundUp32 = function(a, b) { + var d = Math.trunc(a / b); + return d * b == a ? a : (d + 1) * b; +}; + +/** + * glsUniformBlockCase.computeStd140BaseAlignment + * @param {glsUniformBlockCase.VarType} type + * @return {number} + */ +glsUniformBlockCase.computeStd140BaseAlignment = function(type) { + /** @type {number} */ var vec4Alignment = deMath.INT32_SIZE * 4; + + if (type.isBasicType()) { + /** @type {gluShaderUtil.DataType} */ var basicType = type.getBasicType(); + + if (gluShaderUtil.isDataTypeMatrix(basicType)) { + /** @type {boolean} */ var isRowMajor = !!(type.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR); + /** @type {number} */ var vecSize = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(basicType) : + gluShaderUtil.getDataTypeMatrixNumRows(basicType); + + return glsUniformBlockCase.getDataTypeArrayStride(gluShaderUtil.getDataTypeFloatVec(vecSize)); + } else + return glsUniformBlockCase.getDataTypeByteAlignment(basicType); + } else if (type.isArrayType()) { + /** @type {number} */ var elemAlignment = glsUniformBlockCase.computeStd140BaseAlignment(type.getElementType()); + + // Round up to alignment of vec4 + return glsUniformBlockCase.deRoundUp32(elemAlignment, vec4Alignment); + } else { + DE_ASSERT(type.isStructType()); + + /** @type {number} */ var maxBaseAlignment = 0; + + for (var memberNdx = 0; memberNdx < type.getStruct().getSize(); memberNdx++) { + /** @type {glsUniformBlockCase.StructMember} */ var memberIter = type.getStruct().getMember(memberNdx); + maxBaseAlignment = Math.max(maxBaseAlignment, glsUniformBlockCase.computeStd140BaseAlignment(memberIter.getType())); + } + + return glsUniformBlockCase.deRoundUp32(maxBaseAlignment, vec4Alignment); + } +}; + +/** + * mergeLayoutflags + * @param {number} prevFlags + * @param {number} newFlags + * @return {number} + */ +glsUniformBlockCase.mergeLayoutFlags = function(prevFlags, newFlags) { + /** @type {number} */ var packingMask = glsUniformBlockCase.UniformFlags.LAYOUT_PACKED | glsUniformBlockCase.UniformFlags.LAYOUT_SHARED | glsUniformBlockCase.UniformFlags.LAYOUT_STD140; + /** @type {number} */ var matrixMask = glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR | glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR; + + /** @type {number} */ var mergedFlags = 0; + + mergedFlags |= ((newFlags & packingMask) ? newFlags : prevFlags) & packingMask; + mergedFlags |= ((newFlags & matrixMask) ? newFlags : prevFlags) & matrixMask; + + return mergedFlags; +}; + +/** + * glsUniformBlockCase.computeStd140Layout_B + * @param {glsUniformBlockCase.UniformLayout} layout + * @param {number} curOffset + * @param {number} curBlockNdx + * @param {string} curPrefix + * @param {glsUniformBlockCase.VarType} type + * @param {number} layoutFlags + * @return {number} //This is what would return in the curOffset output parameter in the original C++ project. + */ +glsUniformBlockCase.computeStd140Layout_B = function(layout, curOffset, curBlockNdx, curPrefix, type, layoutFlags) { + /** @type {number} */ var baseAlignment = glsUniformBlockCase.computeStd140BaseAlignment(type); + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entry; + /** @type {number} */ var stride; + /** @type {gluShaderUtil.DataType} */ var elemBasicType; + /** @type {boolean} */ var isRowMajor; + /** @type {number} */ var vecSize; + /** @type {number} */ var numVecs; + + curOffset = deMath.deAlign32(curOffset, baseAlignment); + + if (type.isBasicType()) { + /** @type {gluShaderUtil.DataType} */ var basicType = type.getBasicType(); + entry = new glsUniformBlockCase.UniformLayoutEntry(); + + entry.name = curPrefix; + entry.type = basicType; + entry.size = 1; + entry.arrayStride = 0; + entry.matrixStride = 0; + entry.blockNdx = curBlockNdx; + + if (gluShaderUtil.isDataTypeMatrix(basicType)) { + // Array of vectors as specified in rules 5 & 7. + isRowMajor = !!(layoutFlags & glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR); + vecSize = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(basicType) : + gluShaderUtil.getDataTypeMatrixNumRows(basicType); + numVecs = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(basicType) : + gluShaderUtil.getDataTypeMatrixNumColumns(basicType); + stride = glsUniformBlockCase.getDataTypeArrayStride(gluShaderUtil.getDataTypeFloatVec(vecSize)); + + entry.offset = curOffset; + entry.matrixStride = stride; + entry.isRowMajor = isRowMajor; + + curOffset += numVecs * stride; + } else { + // Scalar or vector. + entry.offset = curOffset; + + curOffset += glsUniformBlockCase.getDataTypeByteSize(basicType); + } + + layout.uniforms.push(entry); + } else if (type.isArrayType()) { + /** @type {glsUniformBlockCase.VarType} */ var elemType = type.getElementType(); + + if (elemType.isBasicType() && !gluShaderUtil.isDataTypeMatrix(elemType.getBasicType())) { + // Array of scalars or vectors. + elemBasicType = elemType.getBasicType(); + entry = new glsUniformBlockCase.UniformLayoutEntry(); + stride = glsUniformBlockCase.getDataTypeArrayStride(elemBasicType); + + entry.name = curPrefix + '[0]'; // Array uniforms are always postfixed with [0] + entry.type = elemBasicType; + entry.blockNdx = curBlockNdx; + entry.offset = curOffset; + entry.size = type.getArraySize(); + entry.arrayStride = stride; + entry.matrixStride = 0; + + curOffset += stride * type.getArraySize(); + + layout.uniforms.push(entry); + } else if (elemType.isBasicType() && gluShaderUtil.isDataTypeMatrix(elemType.getBasicType())) { + // Array of matrices. + elemBasicType = elemType.getBasicType(); + isRowMajor = !!(layoutFlags & glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR); + vecSize = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(elemBasicType) : + gluShaderUtil.getDataTypeMatrixNumRows(elemBasicType); + numVecs = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(elemBasicType) : + gluShaderUtil.getDataTypeMatrixNumColumns(elemBasicType); + stride = glsUniformBlockCase.getDataTypeArrayStride(gluShaderUtil.getDataTypeFloatVec(vecSize)); + entry = new glsUniformBlockCase.UniformLayoutEntry(); + + entry.name = curPrefix + '[0]'; // Array uniforms are always postfixed with [0] + entry.type = elemBasicType; + entry.blockNdx = curBlockNdx; + entry.offset = curOffset; + entry.size = type.getArraySize(); + entry.arrayStride = stride * numVecs; + entry.matrixStride = stride; + entry.isRowMajor = isRowMajor; + + curOffset += numVecs * type.getArraySize() * stride; + + layout.uniforms.push(entry); + } else { + DE_ASSERT(elemType.isStructType() || elemType.isArrayType()); + + for (var elemNdx = 0; elemNdx < type.getArraySize(); elemNdx++) + curOffset = glsUniformBlockCase.computeStd140Layout_B(layout, curOffset, curBlockNdx, curPrefix + '[' + elemNdx + ']', type.getElementType(), layoutFlags); + } + } else { + DE_ASSERT(type.isStructType()); + + for (var memberNdx = 0; memberNdx < type.getStruct().getSize(); memberNdx++) { + /** @type {glsUniformBlockCase.StructMember} */ var memberIter = type.getStruct().getMember(memberNdx); + curOffset = glsUniformBlockCase.computeStd140Layout_B(layout, curOffset, curBlockNdx, curPrefix + '.' + memberIter.getName(), memberIter.getType(), layoutFlags); + } + + curOffset = deMath.deAlign32(curOffset, baseAlignment); + } + + return curOffset; +}; + +/** + * glsUniformBlockCase.computeStd140Layout + * @param {glsUniformBlockCase.UniformLayout} layout + * @param {glsUniformBlockCase.ShaderInterface} sinterface + */ +glsUniformBlockCase.computeStd140Layout = function(layout, sinterface) { + // \todo [2012-01-23 pyry] Uniforms in default block. + + /** @type {number} */ var numUniformBlocks = sinterface.getNumUniformBlocks(); + + for (var blockNdx = 0; blockNdx < numUniformBlocks; blockNdx++) { + /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx); + /** @type {boolean} */ var hasInstanceName = block.getInstanceName() !== undefined; + /** @type {string} */ var blockPrefix = hasInstanceName ? (block.getBlockName() + '.') : ''; + /** @type {number} */ var curOffset = 0; + /** @type {number} */ var activeBlockNdx = layout.blocks.length; + /** @type {number} */ var firstUniformNdx = layout.uniforms.length; + + for (var ubNdx = 0; ubNdx < block.countUniforms(); ubNdx++) { + /** @type {glsUniformBlockCase.Uniform} */ var uniform = block.getUniform(ubNdx); + curOffset = glsUniformBlockCase.computeStd140Layout_B(layout, curOffset, activeBlockNdx, blockPrefix + uniform.getName(), uniform.getType(), glsUniformBlockCase.mergeLayoutFlags(block.getFlags(), uniform.getFlags())); + } + + /** @type {number} */ var uniformIndicesEnd = layout.uniforms.length; + /** @type {number} */ var blockSize = curOffset; + /** @type {number} */ var numInstances = block.isArray() ? block.getArraySize() : 1; + + // Create block layout entries for each instance. + for (var instanceNdx = 0; instanceNdx < numInstances; instanceNdx++) { + // Allocate entry for instance. + layout.blocks.push(new glsUniformBlockCase.BlockLayoutEntry()); + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var blockEntry = layout.blocks[layout.blocks.length - 1]; + + blockEntry.name = block.getBlockName(); + blockEntry.size = blockSize; + + // Compute active uniform set for block. + for (var uniformNdx = firstUniformNdx; uniformNdx < uniformIndicesEnd; uniformNdx++) + blockEntry.activeUniformIndices.push(uniformNdx); + + if (block.isArray()) + blockEntry.name += '[' + instanceNdx + ']'; + } + } +}; + +/** + * glsUniformBlockCase.generateValue - Value generator + * @param {glsUniformBlockCase.UniformLayoutEntry} entry + * @param {Uint8Array} basePtr + * @param {deRandom.Random} rnd + */ +glsUniformBlockCase.generateValue = function(entry, basePtr, rnd) { + /** @type {gluShaderUtil.DataType}*/ var scalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(entry.type); //Using a more appropriate function in this case. + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(entry.type); + /** @type {boolean} */ var isMatrix = gluShaderUtil.isDataTypeMatrix(entry.type); + /** @type {number} */ var numVecs = isMatrix ? (entry.isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(entry.type) : gluShaderUtil.getDataTypeMatrixNumColumns(entry.type)) : 1; + /** @type {number} */ var vecSize = scalarSize / numVecs; + /** @type {boolean} */ var isArray = entry.size > 1; + /** @type {number} */ var compSize = deMath.INT32_SIZE; + + DE_ASSERT(scalarSize % numVecs == 0); + + for (var elemNdx = 0; elemNdx < entry.size; elemNdx++) { + /** @type {Uint8Array} */ var elemPtr = basePtr.subarray(entry.offset + (isArray ? elemNdx * entry.arrayStride : 0)); + + for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) { + /** @type {Uint8Array} */ var vecPtr = elemPtr.subarray(isMatrix ? vecNdx * entry.matrixStride : 0); + + for (var compNdx = 0; compNdx < vecSize; compNdx++) { + /** @type {Uint8Array} */ var compPtr = vecPtr.subarray(compSize * compNdx); + /** @type {number} */ var _random; + + //Copy the random data byte per byte + var _size = glsUniformBlockCase.getDataTypeByteSize(scalarType); + + var nbuffer = new ArrayBuffer(_size); + var nview = new DataView(nbuffer); + + switch (scalarType) { + case gluShaderUtil.DataType.FLOAT: + _random = rnd.getInt(-9, 9); + nview.setFloat32(0, _random, littleEndian); + break; + case gluShaderUtil.DataType.INT: + _random = rnd.getInt(-9, 9); + nview.setInt32(0, _random, littleEndian); + break; + case gluShaderUtil.DataType.UINT: + _random = rnd.getInt(0, 9); + nview.setUint32(0, _random, littleEndian); + break; + // \note Random bit pattern is used for true values. Spec states that all non-zero values are + // interpreted as true but some implementations fail this. + case gluShaderUtil.DataType.BOOL: + _random = rnd.getBool() ? 1 : 0; + nview.setUint32(0, _random, littleEndian); + break; + default: + DE_ASSERT(false); + } + + for (var i = 0; i < _size; i++) { + compPtr[i] = nview.getUint8(i); + } + } + } + } +}; + +/** + * glsUniformBlockCase.generateValues + * @param {glsUniformBlockCase.UniformLayout} layout + * @param {glsUniformBlockCase.BlockPointers} blockPointers + * @param {number} seed + */ +glsUniformBlockCase.generateValues = function(layout, blockPointers, seed) { + /** @type  {deRandom.Random} */ var rnd = new deRandom.Random(seed); + /** @type  {number} */ var numBlocks = layout.blocks.length; + + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + /** @type {Uint8Array} */ var basePtr = blockPointers.find(blockNdx); + /** @type  {number} */ var numEntries = layout.blocks[blockNdx].activeUniformIndices.length; + + for (var entryNdx = 0; entryNdx < numEntries; entryNdx++) { + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entry = layout.uniforms[layout.blocks[blockNdx].activeUniformIndices[entryNdx]]; + glsUniformBlockCase.generateValue(entry, basePtr, rnd); + } + } +}; + +// Shader generator. + +/** + * glsUniformBlockCase.getCompareFuncForType + * @param {gluShaderUtil.DataType} type + * @return {string} + */ +glsUniformBlockCase.getCompareFuncForType = function(type) { + switch (type) { + case gluShaderUtil.DataType.FLOAT: return 'mediump float compare_float (highp float a, highp float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.FLOAT_VEC2: return 'mediump float compare_vec2 (highp vec2 a, highp vec2 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y); }\n'; + case gluShaderUtil.DataType.FLOAT_VEC3: return 'mediump float compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); }\n'; + case gluShaderUtil.DataType.FLOAT_VEC4: return 'mediump float compare_vec4 (highp vec4 a, highp vec4 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z)*compare_float(a.w, b.w); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT2: return 'mediump float compare_mat2 (highp mat2 a, highp mat2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'mediump float compare_mat2x3 (highp mat2x3 a, highp mat2x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'mediump float compare_mat2x4 (highp mat2x4 a, highp mat2x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'mediump float compare_mat3x2 (highp mat3x2 a, highp mat3x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT3: return 'mediump float compare_mat3 (highp mat3 a, highp mat3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'mediump float compare_mat3x4 (highp mat3x4 a, highp mat3x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'mediump float compare_mat4x2 (highp mat4x2 a, highp mat4x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2])*compare_vec2(a[3], b[3]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'mediump float compare_mat4x3 (highp mat4x3 a, highp mat4x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2])*compare_vec3(a[3], b[3]); }\n'; + case gluShaderUtil.DataType.FLOAT_MAT4: return 'mediump float compare_mat4 (highp mat4 a, highp mat4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2])*compare_vec4(a[3], b[3]); }\n'; + case gluShaderUtil.DataType.INT: return 'mediump float compare_int (highp int a, highp int b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.INT_VEC2: return 'mediump float compare_ivec2 (highp ivec2 a, highp ivec2 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.INT_VEC3: return 'mediump float compare_ivec3 (highp ivec3 a, highp ivec3 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.INT_VEC4: return 'mediump float compare_ivec4 (highp ivec4 a, highp ivec4 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.UINT: return 'mediump float compare_uint (highp uint a, highp uint b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.UINT_VEC2: return 'mediump float compare_uvec2 (highp uvec2 a, highp uvec2 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.UINT_VEC3: return 'mediump float compare_uvec3 (highp uvec3 a, highp uvec3 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.UINT_VEC4: return 'mediump float compare_uvec4 (highp uvec4 a, highp uvec4 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.BOOL: return 'mediump float compare_bool (bool a, bool b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.BOOL_VEC2: return 'mediump float compare_bvec2 (bvec2 a, bvec2 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.BOOL_VEC3: return 'mediump float compare_bvec3 (bvec3 a, bvec3 b) { return a == b ? 1.0 : 0.0; }\n'; + case gluShaderUtil.DataType.BOOL_VEC4: return 'mediump float compare_bvec4 (bvec4 a, bvec4 b) { return a == b ? 1.0 : 0.0; }\n'; + default: + throw new Error('Type "' + type + '" not supported.'); + + } +}; + +/** + * glsUniformBlockCase.getCompareDependencies + * @param {Array} compareFuncs Should contain unique elements + * @param {gluShaderUtil.DataType} basicType + */ +glsUniformBlockCase.getCompareDependencies = function(compareFuncs, basicType) { + switch (basicType) { + case gluShaderUtil.DataType.FLOAT_VEC2: + case gluShaderUtil.DataType.FLOAT_VEC3: + case gluShaderUtil.DataType.FLOAT_VEC4: + deUtil.dePushUniqueToArray(compareFuncs, gluShaderUtil.DataType.FLOAT); + deUtil.dePushUniqueToArray(compareFuncs, basicType); + break; + + case gluShaderUtil.DataType.FLOAT_MAT2: + case gluShaderUtil.DataType.FLOAT_MAT2X3: + case gluShaderUtil.DataType.FLOAT_MAT2X4: + case gluShaderUtil.DataType.FLOAT_MAT3X2: + case gluShaderUtil.DataType.FLOAT_MAT3: + case gluShaderUtil.DataType.FLOAT_MAT3X4: + case gluShaderUtil.DataType.FLOAT_MAT4X2: + case gluShaderUtil.DataType.FLOAT_MAT4X3: + case gluShaderUtil.DataType.FLOAT_MAT4: + deUtil.dePushUniqueToArray(compareFuncs, gluShaderUtil.DataType.FLOAT); + deUtil.dePushUniqueToArray(compareFuncs, gluShaderUtil.getDataTypeFloatVec(gluShaderUtil.getDataTypeMatrixNumRows(basicType))); + deUtil.dePushUniqueToArray(compareFuncs, basicType); + break; + + default: + deUtil.dePushUniqueToArray(compareFuncs, basicType); + break; + } +}; + +/** + * glsUniformBlockCase.collectUniqueBasicTypes_B + * @param {Array} basicTypes Should contain unique elements + * @param {glsUniformBlockCase.VarType} type + */ +glsUniformBlockCase.collectUniqueBasicTypes_B = function(basicTypes, type) { + if (type.isStructType()) { + /** @type {glsUniformBlockCase.StructType} */ var stype = type.getStruct(); + for (var memberNdx = 0; memberNdx < stype.getSize(); memberNdx++) + glsUniformBlockCase.collectUniqueBasicTypes_B(basicTypes, stype.getMember(memberNdx).getType()); + } else if (type.isArrayType()) + glsUniformBlockCase.collectUniqueBasicTypes_B(basicTypes, type.getElementType()); + else { + DE_ASSERT(type.isBasicType()); + deUtil.dePushUniqueToArray(basicTypes, type.getBasicType()); + } +}; + +/** + * glsUniformBlockCase.collectUniqueBasicTypes_A + * @param {Array} basicTypes Should contain unique elements + * @param {glsUniformBlockCase.UniformBlock} uniformBlock + */ +glsUniformBlockCase.collectUniqueBasicTypes_A = function(basicTypes, uniformBlock) { + for (var uniformNdx = 0; uniformNdx < uniformBlock.countUniforms(); uniformNdx++) + glsUniformBlockCase.collectUniqueBasicTypes_B(basicTypes, uniformBlock.getUniform(uniformNdx).getType()); +}; + +/** + * glsUniformBlockCase.collectUniqueBasicTypes + * @param {Array} basicTypes Should contain unique elements + * @param {glsUniformBlockCase.ShaderInterface} sinterface + */ +glsUniformBlockCase.collectUniqueBasicTypes = function(basicTypes, sinterface) { + for (var ndx = 0; ndx < sinterface.getNumUniformBlocks(); ++ndx) + glsUniformBlockCase.collectUniqueBasicTypes_A(basicTypes, sinterface.getUniformBlock(ndx)); +}; + +/** + * glsUniformBlockCase.collectUniqueBasicTypes + * @return {string} Was originally an output parameter. As it is a basic type, we have to return it instead. + * @param {glsUniformBlockCase.ShaderInterface} sinterface + */ +glsUniformBlockCase.generateCompareFuncs = function(sinterface) { + /** @type {string} */ var str = ''; + /** @type {Array} */ var types = []; //Will contain unique elements. + /** @type {Array} */ var compareFuncs = []; //Will contain unique elements. + + // Collect unique basic types + glsUniformBlockCase.collectUniqueBasicTypes(types, sinterface); + + // Set of compare functions required + for (var typeNdx = 0; typeNdx < types.length; typeNdx++) + glsUniformBlockCase.getCompareDependencies(compareFuncs, types[typeNdx]); + + for (var type in gluShaderUtil.DataType) { + if (compareFuncs.indexOf(gluShaderUtil.DataType[type]) > -1) + str += glsUniformBlockCase.getCompareFuncForType(gluShaderUtil.DataType[type]); + } + + return str; +}; + +/** + * glsUniformBlockCase.Indent - Prints level_ number of tab chars + * @param {number} level_ + * @return {string} + */ +glsUniformBlockCase.Indent = function(level_) { + var str = ''; + for (var i = 0; i < level_; i++) + str += '\t'; + + return str; +}; + +/** + * glsUniformBlockCase.generateDeclaration_C + * @return {string} src + * @param {glsUniformBlockCase.StructType} structType + * @param {number} indentLevel + */ +glsUniformBlockCase.generateDeclaration_C = function(structType, indentLevel) { + /** @type {string} */ var src = ''; + + DE_ASSERT(structType.getTypeName() !== undefined); + src += glsUniformBlockCase.generateFullDeclaration(structType, indentLevel); + src += ';\n'; + + return src; +}; + +/** + * glsUniformBlockCase.generateFullDeclaration + * @return {string} src + * @param {glsUniformBlockCase.StructType} structType + * @param {number} indentLevel + */ +glsUniformBlockCase.generateFullDeclaration = function(structType, indentLevel) { + var src = 'struct'; + if (structType.getTypeName()) + src += ' ' + structType.getTypeName(); + src += '\n' + glsUniformBlockCase.Indent(indentLevel) + ' {\n'; + + for (var memberNdx = 0; memberNdx < structType.getSize(); memberNdx++) { + src += glsUniformBlockCase.Indent(indentLevel + 1); + /** @type {glsUniformBlockCase.StructMember} */ var memberIter = structType.getMember(memberNdx); + src += glsUniformBlockCase.generateDeclaration_B(memberIter.getType(), memberIter.getName(), indentLevel + 1, memberIter.getFlags() & glsUniformBlockCase.UniformFlags.UNUSED_BOTH); + } + + src += glsUniformBlockCase.Indent(indentLevel) + '}'; + + return src; +}; + +/** + * glsUniformBlockCase.generateLocalDeclaration + * @return {string} src + * @param {glsUniformBlockCase.StructType} structType + * @param {number} indentLevel + */ +glsUniformBlockCase.generateLocalDeclaration = function(structType, indentLevel) { + /** @type {string} */ var src = ''; + + if (structType.getTypeName() === undefined) + src += glsUniformBlockCase.generateFullDeclaration(structType, indentLevel); + else + src += structType.getTypeName(); + + return src; +}; + +/** + * glsUniformBlockCase.generateDeclaration_B + * @return {string} src + * @param {glsUniformBlockCase.VarType} type + * @param {string} name + * @param {number} indentLevel + * @param {number} unusedHints + */ +glsUniformBlockCase.generateDeclaration_B = function(type, name, indentLevel, unusedHints) { + /** @type {string} */ var src = ''; + /** @type {number} */ var flags = type.getFlags(); + + if ((flags & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) != 0) + src += 'layout(' + glsUniformBlockCase.LayoutFlagsFmt(flags & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) + ') '; + + if ((flags & glsUniformBlockCase.UniformFlags.PRECISION_MASK) != 0) + src += glsUniformBlockCase.PrecisionFlagsFmt(flags & glsUniformBlockCase.UniformFlags.PRECISION_MASK) + ' '; + + if (type.isBasicType()) + src += gluShaderUtil.getDataTypeName(type.getBasicType()) + ' ' + name; + else if (type.isArrayType()) { + /** @type {Array} */ var arraySizes = []; + /** @type {glsUniformBlockCase.VarType} */ var curType = type; + while (curType.isArrayType()) { + arraySizes.push(curType.getArraySize()); + curType = curType.getElementType(); + } + + if (curType.isBasicType()) { + if ((curType.getFlags() & glsUniformBlockCase.UniformFlags.PRECISION_MASK) != 0) + src += glsUniformBlockCase.PrecisionFlagsFmt(curType.getFlags() & glsUniformBlockCase.UniformFlags.PRECISION_MASK) + ' '; + src += gluShaderUtil.getDataTypeName(curType.getBasicType()); + } else { + DE_ASSERT(curType.isStructType()); + src += glsUniformBlockCase.generateLocalDeclaration(curType.getStruct(), indentLevel + 1); + } + + src += ' ' + name; + + for (var sizeNdx = 0; sizeNdx < arraySizes.length; sizeNdx++) + src += '[' + arraySizes[sizeNdx] + ']'; + } else { + src += glsUniformBlockCase.generateLocalDeclaration(type.getStruct(), indentLevel + 1); + src += ' ' + name; + } + + src += ';'; + + // Print out unused hints. + if (unusedHints != 0) + src += ' // unused in ' + (unusedHints == glsUniformBlockCase.UniformFlags.UNUSED_BOTH ? 'both shaders' : + unusedHints == glsUniformBlockCase.UniformFlags.UNUSED_VERTEX ? 'vertex shader' : + unusedHints == glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT ? 'fragment shader' : '???'); + + src += '\n'; + + return src; +}; + +/** + * glsUniformBlockCase.generateDeclaration_A + * @return {string} src + * @param {glsUniformBlockCase.Uniform} uniform + * @param {number} indentLevel + */ +glsUniformBlockCase.generateDeclaration_A = function(uniform, indentLevel) { + /** @type {string} */ var src = ''; + + if ((uniform.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) != 0) + src += 'layout(' + glsUniformBlockCase.LayoutFlagsFmt(uniform.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) + ') '; + + src += glsUniformBlockCase.generateDeclaration_B(uniform.getType(), uniform.getName(), indentLevel, uniform.getFlags() & glsUniformBlockCase.UniformFlags.UNUSED_BOTH); + + return src; +}; + +/** + * glsUniformBlockCase.generateDeclaration + * @return {string} src + * @param {glsUniformBlockCase.UniformBlock} block + */ +glsUniformBlockCase.generateDeclaration = function(block) { + /** @type {string} */ var src = ''; + + if ((block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) != 0) + src += 'layout(' + glsUniformBlockCase.LayoutFlagsFmt(block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) + ') '; + + src += 'uniform ' + block.getBlockName(); + src += '\n {\n'; + + for (var uniformNdx = 0; uniformNdx < block.countUniforms(); uniformNdx++) { + src += glsUniformBlockCase.Indent(1); + src += glsUniformBlockCase.generateDeclaration_A(block.getUniform(uniformNdx), 1 /* indent level */); + } + + src += '}'; + + if (block.getInstanceName() !== undefined) { + src += ' ' + block.getInstanceName(); + if (block.isArray()) + src += '[' + block.getArraySize() + ']'; + } else + DE_ASSERT(!block.isArray()); + + src += ';\n'; + + return src; +}; + +/** + * glsUniformBlockCase.newArrayBufferFromView - Creates a new buffer copying data from a given view + * @param {goog.NumberArray} view + * @return {ArrayBuffer} The newly created buffer + */ +glsUniformBlockCase.newArrayBufferFromView = function(view) { + var buffer = new ArrayBuffer(view.length * view.BYTES_PER_ELEMENT); + var copyview; + switch (view.BYTES_PER_ELEMENT) { + case 1: + copyview = new Uint8Array(buffer); break; + case 2: + copyview = new Uint16Array(buffer); break; + case 4: + copyview = new Uint32Array(buffer); break; + default: + assertMsgOptions(false, 'Unexpected value for BYTES_PER_ELEMENT in view', false, true); + } + for (var i = 0; i < view.length; i++) + copyview[i] = view[i]; + + return buffer; +}; + +/** + * glsUniformBlockCase.generateValueSrc + * @return {string} Used to be an output parameter in C++ project + * @param {glsUniformBlockCase.UniformLayoutEntry} entry + * @param {Uint8Array} basePtr + * @param {number} elementNdx + */ +glsUniformBlockCase.generateValueSrc = function(entry, basePtr, elementNdx) { + /** @type {string} */ var src = ''; + /** @type {gluShaderUtil.DataType} */ var scalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(entry.type); + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(entry.type); + /** @type {boolean} */ var isArray = entry.size > 1; + /** @type {Uint8Array} */ var elemPtr = basePtr.subarray(entry.offset + (isArray ? elementNdx * entry.arrayStride : 0)); + /** @type {number} */ var compSize = deMath.INT32_SIZE; + /** @type {Uint8Array} */ var compPtr; + if (scalarSize > 1) + src += gluShaderUtil.getDataTypeName(entry.type) + '('; + + if (gluShaderUtil.isDataTypeMatrix(entry.type)) { + /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(entry.type); + /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(entry.type); + + DE_ASSERT(scalarType == gluShaderUtil.DataType.FLOAT); + + // Constructed in column-wise order. + for (var colNdx = 0; colNdx < numCols; colNdx++) { + for (var rowNdx = 0; rowNdx < numRows; rowNdx++) { + compPtr = elemPtr.subarray(entry.isRowMajor ? rowNdx * entry.matrixStride + colNdx * compSize : + colNdx * entry.matrixStride + rowNdx * compSize); + + if (colNdx > 0 || rowNdx > 0) + src += ', '; + + var newbuffer = new Uint8Array(compPtr.subarray(0, 4)).buffer; + var newview = new DataView(newbuffer); + src += parseFloat(newview.getFloat32(0, littleEndian)).toFixed(1); + } + } + } else { + for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) { + compPtr = elemPtr.subarray(scalarNdx * compSize); + + if (scalarNdx > 0) + src += ', '; + + var newbuffer = glsUniformBlockCase.newArrayBufferFromView(compPtr.subarray(0, 4)); + var newview = new DataView(newbuffer); + + switch (scalarType) { + case gluShaderUtil.DataType.FLOAT: src += parseFloat(newview.getFloat32(0, littleEndian) * 100 / 100).toFixed(1); break; + case gluShaderUtil.DataType.INT: src += newview.getInt32(0, littleEndian); break; + case gluShaderUtil.DataType.UINT: src += newview.getUint32(0, littleEndian) + 'u'; break; + case gluShaderUtil.DataType.BOOL: src += (newview.getUint32(0, littleEndian) != 0 ? 'true' : 'false'); break; + default: + DE_ASSERT(false); + } + } + } + + if (scalarSize > 1) + src += ')'; + + return src; +}; + +/** + * glsUniformBlockCase.generateCompareSrc_A + * @return {string} Used to be an output parameter in C++ project + * @param {string} resultVar + * @param {glsUniformBlockCase.VarType} type + * @param {string} srcName + * @param {string} apiName + * @param {glsUniformBlockCase.UniformLayout} layout + * @param {Uint8Array} basePtr + * @param {number} unusedMask + */ +glsUniformBlockCase.generateCompareSrc_A = function(resultVar, type, srcName, apiName, layout, basePtr, unusedMask) { + /** @type {string} */ var src = ''; + /** @type {string} */ var op; + /** @type {glsUniformBlockCase.VarType|gluShaderUtil.DataType} */ var elementType; + + if (type.isBasicType() || (type.isArrayType() && type.getElementType().isBasicType())) { + // Basic type or array of basic types. + /** @type {boolean} */ var isArray = type.isArrayType(); + elementType = isArray ? type.getElementType().getBasicType() : type.getBasicType(); + /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(elementType); + /** @type {string} */ var fullApiName = apiName + (isArray ? '[0]' : ''); // Arrays are always postfixed with [0] + /** @type {number} */ var uniformNdx = layout.getUniformIndex(fullApiName); + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entry = layout.uniforms[uniformNdx]; + + if (isArray) { + for (var elemNdx = 0; elemNdx < type.getArraySize(); elemNdx++) { + src += '\tresult *= compare_' + typeName + '(' + srcName + '[' + elemNdx + '], '; + src += glsUniformBlockCase.generateValueSrc(entry, basePtr, elemNdx); + src += ');\n'; + } + } else { + src += '\tresult *= compare_' + typeName + '(' + srcName + ', '; + src += glsUniformBlockCase.generateValueSrc(entry, basePtr, 0); + src += ');\n'; + } + } else if (type.isArrayType()) { + elementType = type.getElementType(); + + for (var elementNdx = 0; elementNdx < type.getArraySize(); elementNdx++) { + op = '[' + elementNdx + ']'; + src += glsUniformBlockCase.generateCompareSrc_A(resultVar, elementType, srcName + op, apiName + op, layout, basePtr, unusedMask); + } + } else { + DE_ASSERT(type.isStructType()); + + /** @type {glsUniformBlockCase.StructType} */ var stype = type.getStruct(); + for (var memberNdx = 0; memberNdx < stype.getSize(); memberNdx++) { + /** @type {glsUniformBlockCase.StructMember} */ var memberIter = stype.getMember(memberNdx); + if (memberIter.getFlags() & unusedMask) + continue; // Skip member. + + op = '.' + memberIter.getName(); + src += glsUniformBlockCase.generateCompareSrc_A(resultVar, memberIter.getType(), srcName + op, apiName + op, layout, basePtr, unusedMask); + } + } + + return src; +}; + +/** + * glsUniformBlockCase.generateCompareSrc + * @return {string} Used to be an output parameter in C++ project + * @param {string} resultVar + * @param {glsUniformBlockCase.ShaderInterface} sinterface + * @param {glsUniformBlockCase.UniformLayout} layout + * @param {glsUniformBlockCase.BlockPointers} blockPointers + * @param {boolean} isVertex + */ +glsUniformBlockCase.generateCompareSrc = function(resultVar, sinterface, layout, blockPointers, isVertex) { + /** @type {string} */ var src = ''; + /** @type {number} */ var unusedMask = isVertex ? glsUniformBlockCase.UniformFlags.UNUSED_VERTEX : glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT; + + for (var blockNdx = 0; blockNdx < sinterface.getNumUniformBlocks(); blockNdx++) { + /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx); + + if ((block.getFlags() & (isVertex ? glsUniformBlockCase.UniformFlags.DECLARE_VERTEX : glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT)) == 0) + continue; // Skip. + + /** @type {boolean} */ var hasInstanceName = block.getInstanceName() !== undefined; + /** @type {boolean} */ var isArray = block.isArray(); + /** @type {number} */ var numInstances = isArray ? block.getArraySize() : 1; + /** @type {string} */ var apiPrefix = hasInstanceName ? block.getBlockName() + '.' : ''; + + DE_ASSERT(!isArray || hasInstanceName); + + for (var instanceNdx = 0; instanceNdx < numInstances; instanceNdx++) { + /** @type {string} */ var instancePostfix = isArray ? '[' + instanceNdx + ']' : ''; + /** @type {string} */ var blockInstanceName = block.getBlockName() + instancePostfix; + /** @type {string} */ var srcPrefix = hasInstanceName ? block.getInstanceName() + instancePostfix + '.' : ''; + /** @type {number} */ var activeBlockNdx = layout.getBlockIndex(blockInstanceName); + /** @type {Uint8Array} */ var basePtr = blockPointers.find(activeBlockNdx); + + for (var uniformNdx = 0; uniformNdx < block.countUniforms(); uniformNdx++) { + /** @type {glsUniformBlockCase.Uniform} */ var uniform = block.getUniform(uniformNdx); + + if (uniform.getFlags() & unusedMask) + continue; // Don't read from that uniform. + + src += glsUniformBlockCase.generateCompareSrc_A(resultVar, uniform.getType(), srcPrefix + uniform.getName(), apiPrefix + uniform.getName(), layout, basePtr, unusedMask); + } + } + } + + return src; +}; + +/** + * glsUniformBlockCase.generateVertexShader + * @return {string} src + * @param {glsUniformBlockCase.ShaderInterface} sinterface + * @param {glsUniformBlockCase.UniformLayout} layout + * @param {glsUniformBlockCase.BlockPointers} blockPointers + */ +glsUniformBlockCase.generateVertexShader = function(sinterface, layout, blockPointers) { + /** @type {string} */ var src = ''; + + DE_ASSERT(glsUniformBlockCase.isSupportedGLSLVersion(gluShaderUtil.getGLSLVersion(gl))); + + src += gluShaderUtil.getGLSLVersionDeclaration(gluShaderUtil.getGLSLVersion(gl)) + '\n'; + src += 'in highp vec4 a_position;\n'; + src += 'out mediump float v_vtxResult;\n'; + src += '\n'; + + /** @type {Array} */ var namedStructs = []; + sinterface.getNamedStructs(namedStructs); + for (var structNdx = 0; structNdx < namedStructs.length; structNdx++) + src += glsUniformBlockCase.generateDeclaration_C(namedStructs[structNdx], 0); + + for (var blockNdx = 0; blockNdx < sinterface.getNumUniformBlocks(); blockNdx++) { + /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx); + if (block.getFlags() & glsUniformBlockCase.UniformFlags.DECLARE_VERTEX) + src += glsUniformBlockCase.generateDeclaration(block); + } + + // Comparison utilities. + src += '\n'; + src += glsUniformBlockCase.generateCompareFuncs(sinterface); + + src += '\n' + + 'void main (void)\n' + + ' {\n' + + ' gl_Position = a_position;\n' + + ' mediump float result = 1.0;\n'; + + // Value compare. + src += glsUniformBlockCase.generateCompareSrc('result', sinterface, layout, blockPointers, true); + + src += ' v_vtxResult = result;\n' + + '}\n'; + + return src; +}; + +/** + * glsUniformBlockCase.generateFragmentShader + * @return {string} Used to be an output parameter + * @param {glsUniformBlockCase.ShaderInterface} sinterface + * @param {glsUniformBlockCase.UniformLayout} layout + * @param {glsUniformBlockCase.BlockPointers} blockPointers + */ +glsUniformBlockCase.generateFragmentShader = function(sinterface, layout, blockPointers) { + /** @type {string} */ var src = ''; + DE_ASSERT(glsUniformBlockCase.isSupportedGLSLVersion(gluShaderUtil.getGLSLVersion(gl))); + + src += gluShaderUtil.getGLSLVersionDeclaration(gluShaderUtil.getGLSLVersion(gl)) + '\n'; + src += 'in mediump float v_vtxResult;\n'; + src += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + src += '\n'; + + /** @type {Array} */ var namedStructs = []; + sinterface.getNamedStructs(namedStructs); + for (var structNdx = 0; structNdx < namedStructs.length; structNdx++) + src += glsUniformBlockCase.generateDeclaration_C(namedStructs[structNdx], 0); + + for (var blockNdx = 0; blockNdx < sinterface.getNumUniformBlocks(); blockNdx++) { + /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx); + if (block.getFlags() & glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT) + src += glsUniformBlockCase.generateDeclaration(block); + } + + // Comparison utilities. + src += '\n'; + src += glsUniformBlockCase.generateCompareFuncs(sinterface); + + src += '\n' + + 'void main (void)\n' + + ' {\n' + + ' mediump float result = 1.0;\n'; + + // Value compare. + src += glsUniformBlockCase.generateCompareSrc('result', sinterface, layout, blockPointers, false); + + src += ' dEQP_FragColor = vec4(1.0, v_vtxResult, result, 1.0);\n' + + '}\n'; + + return src; +}; + +/** + * TODO: test glsUniformBlockCase.getGLUniformLayout Gets the uniform blocks and uniforms in the program. + * @param {WebGL2RenderingContext} gl + * @param {glsUniformBlockCase.UniformLayout} layout To store the layout described in program. + * @param {WebGLProgram} program id + */ +glsUniformBlockCase.getGLUniformLayout = function(gl, layout, program) { + /** @type {number} */ var numActiveUniforms = 0; + /** @type {number} */ var numActiveBlocks = 0; + + numActiveUniforms = /** @type {number} */ (gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS)); // ACTIVE_UNIFORM* returns GLInt + numActiveBlocks = /** @type {number} */ (gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS)); + + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var entryBlock; + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entryUniform; + /** @type {number} */ var size; + /** @type {number} */ var nameLen; + /** @type {string} */ var nameBuf; + /** @type {number} */ var numBlockUniforms; + + // Block entries. + //No need to allocate these beforehand: layout.blocks.resize(numActiveBlocks); + for (var blockNdx = 0; blockNdx < numActiveBlocks; blockNdx++) { + entryBlock = new glsUniformBlockCase.BlockLayoutEntry(); + + size = /** @type {number} */ (gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_DATA_SIZE)); + // nameLen not used so this line is removed. + // nameLen = gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_NAME_LENGTH); // TODO: UNIFORM_BLOCK_NAME_LENGTH is removed in WebGL2 + numBlockUniforms = /** @type {number} */ (gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS)); + + nameBuf = gl.getActiveUniformBlockName(program, blockNdx); + + entryBlock.name = nameBuf; + entryBlock.size = size; + //entry.activeUniformIndices.resize(numBlockUniforms); + + if (numBlockUniforms > 0) + entryBlock.activeUniformIndices = gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES); + + layout.blocks.push(entryBlock); //Pushing the block into the array here. + } + + if (numActiveUniforms > 0) { + // glsUniformBlockCase.Uniform entries. + /** @type {Array} */ var uniformIndices = []; + for (var i = 0; i < numActiveUniforms; i++) + uniformIndices.push(i); + + /** @type {Array} */ var types = []; + /** @type {Array} */ var sizes = []; + /** @type {Array} */ var nameLengths = []; + /** @type {Array} */ var blockIndices = []; + /** @type {Array} */ var offsets = []; + /** @type {Array} */ var arrayStrides = []; + /** @type {Array} */ var matrixStrides = []; + /** @type {Array} */ var rowMajorFlags = []; + + // Execute queries. + types = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_TYPE); + sizes = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_SIZE); + // Remove this: nameLengths = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_NAME_LENGTH); + blockIndices = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_BLOCK_INDEX); + offsets = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_OFFSET); + arrayStrides = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_ARRAY_STRIDE); + matrixStrides = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_MATRIX_STRIDE); + rowMajorFlags = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_IS_ROW_MAJOR); + + // Translate to LayoutEntries + // No resize needed. Will push them: layout.uniforms.resize(numActiveUniforms); + for (var uniformNdx = 0; uniformNdx < numActiveUniforms; uniformNdx++) { + entryUniform = new glsUniformBlockCase.UniformLayoutEntry(); + + // Remove this: nameLen = 0; + size = 0; + /** @type {number} */ var type = gl.NONE; + + var uniform = gl.getActiveUniform(program, uniformNdx); + + nameBuf = uniform.name; + // Remove this: nameLen = nameBuf.length; + size = uniform.size; + type = uniform.type; + + // Remove this: nameLen != nameLengths[uniformNdx] || + if (size != sizes[uniformNdx] || + type != types[uniformNdx]) + testFailedOptions("Values returned by gl.getActiveUniform() don't match with values queried with gl.getActiveUniforms().", true); + + entryUniform.name = nameBuf; + entryUniform.type = gluShaderUtil.getDataTypeFromGLType(types[uniformNdx]); + entryUniform.size = sizes[uniformNdx]; + entryUniform.blockNdx = blockIndices[uniformNdx]; + entryUniform.offset = offsets[uniformNdx]; + entryUniform.arrayStride = arrayStrides[uniformNdx]; + entryUniform.matrixStride = matrixStrides[uniformNdx]; + entryUniform.isRowMajor = rowMajorFlags[uniformNdx] != false; + + layout.uniforms.push(entryUniform); //Pushing this uniform in the end. + } + } +}; + +/** + * glsUniformBlockCase.copyUniformData_A - Copies a source uniform buffer segment to a destination uniform buffer segment. + * @param {glsUniformBlockCase.UniformLayoutEntry} dstEntry + * @param {Uint8Array} dstBlockPtr + * @param {glsUniformBlockCase.UniformLayoutEntry} srcEntry + * @param {Uint8Array} srcBlockPtr + */ +glsUniformBlockCase.copyUniformData_A = function(dstEntry, dstBlockPtr, srcEntry, srcBlockPtr) { + /** @type {Uint8Array} */ var dstBasePtr = dstBlockPtr.subarray(dstEntry.offset); + /** @type {Uint8Array} */ var srcBasePtr = srcBlockPtr.subarray(srcEntry.offset); + + DE_ASSERT(dstEntry.size <= srcEntry.size); + DE_ASSERT(dstEntry.type == srcEntry.type); + + /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(dstEntry.type); + /** @type {boolean} */ var isMatrix = gluShaderUtil.isDataTypeMatrix(dstEntry.type); + /** @type {number} */ var compSize = deMath.INT32_SIZE; + + for (var elementNdx = 0; elementNdx < dstEntry.size; elementNdx++) { + /** @type {Uint8Array} */ var dstElemPtr = dstBasePtr.subarray(elementNdx * dstEntry.arrayStride); + /** @type {Uint8Array} */ var srcElemPtr = srcBasePtr.subarray(elementNdx * srcEntry.arrayStride); + + if (isMatrix) { + /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(dstEntry.type); + /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(dstEntry.type); + + for (var colNdx = 0; colNdx < numCols; colNdx++) { + for (var rowNdx = 0; rowNdx < numRows; rowNdx++) { + var srcoffset = dstEntry.isRowMajor ? rowNdx * dstEntry.matrixStride + colNdx * compSize : + colNdx * dstEntry.matrixStride + rowNdx * compSize; + /** @type {Uint8Array} */ var dstCompPtr = dstElemPtr.subarray(srcoffset, srcoffset + compSize); + var dstoffset = srcEntry.isRowMajor ? rowNdx * srcEntry.matrixStride + colNdx * compSize : + colNdx * srcEntry.matrixStride + rowNdx * compSize; + /** @type {Uint8Array} */ var srcCompPtr = srcElemPtr.subarray(dstoffset, dstoffset + compSize); + + //Copy byte per byte + for (var i = 0; i < compSize; i++) + dstCompPtr[i] = srcCompPtr[i]; + } + } + } else + //Copy byte per byte + for (var i = 0; i < scalarSize * compSize; i++) + dstElemPtr[i] = srcElemPtr[i]; + } +}; + +/** + * glsUniformBlockCase.copyUniformData - Copies a source uniform buffer to a destination uniform buffer. + * @param {glsUniformBlockCase.UniformLayout} dstLayout + * @param {glsUniformBlockCase.BlockPointers} dstBlockPointers + * @param {glsUniformBlockCase.UniformLayout} srcLayout + * @param {glsUniformBlockCase.BlockPointers} srcBlockPointers + */ +glsUniformBlockCase.copyUniformData = function(dstLayout, dstBlockPointers, srcLayout, srcBlockPointers) { + // \note Src layout is used as reference in case of activeUniforms happens to be incorrect in dstLayout blocks. + /** @type {number} */ var numBlocks = srcLayout.blocks.length; + + for (var srcBlockNdx = 0; srcBlockNdx < numBlocks; srcBlockNdx++) { + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var srcBlock = srcLayout.blocks[srcBlockNdx]; + /** @type {Uint8Array} */ var srcBlockPtr = srcBlockPointers.find(srcBlockNdx); + /** @type {number} */ var dstBlockNdx = dstLayout.getBlockIndex(srcBlock.name); + /** @type {Uint8Array} */ var dstBlockPtr = dstBlockNdx >= 0 ? dstBlockPointers.find(dstBlockNdx) : null; + + if (dstBlockNdx < 0) + continue; + + for (var srcUniformNdx = 0; srcUniformNdx < srcBlock.activeUniformIndices.length; srcUniformNdx++) { + /** @type {number} */ var srcUniformNdxIter = srcBlock.activeUniformIndices[srcUniformNdx]; + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var srcEntry = srcLayout.uniforms[srcUniformNdxIter]; + /** @type {number} */ var dstUniformNdx = dstLayout.getUniformIndex(srcEntry.name); + + if (dstUniformNdx < 0) + continue; + + glsUniformBlockCase.copyUniformData_A(dstLayout.uniforms[dstUniformNdx], dstBlockPtr, srcEntry, srcBlockPtr); + } + } +}; + + /** + * TODO: Test with an actual WebGL 2.0 context + * iterate - The actual execution of the test. + * @return {tcuTestCase.IterateResult} + */ + glsUniformBlockCase.UniformBlockCase.prototype.iterate = function() { + /** @type {glsUniformBlockCase.UniformLayout} */ var refLayout = new glsUniformBlockCase.UniformLayout(); //!< std140 layout. + /** @type {glsUniformBlockCase.BlockPointers} */ var blockPointers = new glsUniformBlockCase.BlockPointers(); + + // Compute reference layout. + glsUniformBlockCase.computeStd140Layout(refLayout, this.m_interface); + + // Assign storage for reference values. + /** @type {number} */ var totalSize = 0; + for (var blockNdx = 0; blockNdx < refLayout.blocks.length; blockNdx++) { + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var blockIter = refLayout.blocks[blockNdx]; + totalSize += blockIter.size; + } + blockPointers.resize(totalSize); + + // Pointers for each block. + var curOffset = 0; + for (var blockNdx = 0; blockNdx < refLayout.blocks.length; blockNdx++) { + var size = refLayout.blocks[blockNdx].size; + blockPointers.push(curOffset, size); + curOffset += size; + } + + // Generate values. + glsUniformBlockCase.generateValues(refLayout, blockPointers, 1 /* seed */); + + // Generate shaders and build program. + /** @type {string} */ var vtxSrc = glsUniformBlockCase.generateVertexShader(this.m_interface, refLayout, blockPointers); + /** @type {string} */ var fragSrc = glsUniformBlockCase.generateFragmentShader(this.m_interface, refLayout, blockPointers); + + /** @type {gluShaderProgram.ShaderProgram}*/ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSrc, fragSrc)); + bufferedLogToConsole(program.getProgramInfo().infoLog); + + if (!program.isOk()) { + // Compile failed. + testFailedOptions('Compile failed', false); + return tcuTestCase.IterateResult.STOP; + } + + // Query layout from GL. + /** @type {glsUniformBlockCase.UniformLayout} */ var glLayout = new glsUniformBlockCase.UniformLayout(); + glsUniformBlockCase.getGLUniformLayout(gl, glLayout, program.getProgram()); + + // Print layout to log. + bufferedLogToConsole('Active glsUniformBlockCase.Uniform Blocks'); + for (var blockNdx = 0; blockNdx < glLayout.blocks.length; blockNdx++) + bufferedLogToConsole(blockNdx + ': ' + glLayout.blocks[blockNdx]); + + bufferedLogToConsole('Active Uniforms'); + for (var uniformNdx = 0; uniformNdx < glLayout.uniforms.length; uniformNdx++) + bufferedLogToConsole(uniformNdx + ': ' + glLayout.uniforms[uniformNdx]); + + // Check that we can even try rendering with given layout. + if (!this.checkLayoutIndices(glLayout) || !this.checkLayoutBounds(glLayout) || !this.compareTypes(refLayout, glLayout)) { + testFailedOptions('Invalid layout', false); + return tcuTestCase.IterateResult.STOP; // It is not safe to use the given layout. + } + + // Verify all std140 blocks. + if (!this.compareStd140Blocks(refLayout, glLayout)) + testFailedOptions('Invalid std140 layout', false); + + // Verify all shared blocks - all uniforms should be active, and certain properties match. + if (!this.compareSharedBlocks(refLayout, glLayout)) + testFailedOptions('Invalid shared layout', false); + + // Check consistency with index queries + if (!this.checkIndexQueries(program.getProgram(), glLayout)) + testFailedOptions('Inconsintent block index query results', false); + + // Use program. + gl.useProgram(program.getProgram()); + + /** @type {number} */ var binding; + /** @type {WebGLBuffer} */ var buffer; + + // Assign binding points to all active uniform blocks. + for (var blockNdx = 0; blockNdx < glLayout.blocks.length; blockNdx++) { + binding = blockNdx; // \todo [2012-01-25 pyry] Randomize order? + gl.uniformBlockBinding(program.getProgram(), blockNdx, binding); + } + + /** @type {number} */ var numBlocks; + /** @type {glsUniformBlockCase.BlockPointers} */ var glBlockPointers; + + // Allocate buffers, write data and bind to targets. + /** @type {glsUniformBlockCase.UniformBufferManager} */ var bufferManager = new glsUniformBlockCase.UniformBufferManager(gl); + if (this.m_bufferMode == glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK) { + numBlocks = glLayout.blocks.length; + glBlockPointers = new glsUniformBlockCase.BlockPointers(); + + var totalsize = 0; + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) + totalsize += glLayout.blocks[blockNdx].size; + + glBlockPointers.resize(totalsize); + + var offset = 0; + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + glBlockPointers.push(offset, glLayout.blocks[blockNdx].size); + offset += glLayout.blocks[blockNdx].size; + } + + glsUniformBlockCase.copyUniformData(glLayout, glBlockPointers, refLayout, blockPointers); + + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + buffer = bufferManager.allocBuffer(); + binding = blockNdx; + gl.bindBuffer(gl.UNIFORM_BUFFER, buffer); + gl.bufferData(gl.UNIFORM_BUFFER, glBlockPointers.find(blockNdx) /*(glw::GLsizeiptr)glData[blockNdx].size(), &glData[blockNdx][0]*/, gl.STATIC_DRAW); + gl.bindBufferBase(gl.UNIFORM_BUFFER, binding, buffer); + } + } else { + DE_ASSERT(this.m_bufferMode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE); + + totalSize = 0; + curOffset = 0; + numBlocks = glLayout.blocks.length; + /** @type {number} */ var bindingAlignment = 0; + glBlockPointers = new glsUniformBlockCase.BlockPointers(); + + bindingAlignment = /** @type {number} */ (gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT)); + + // Compute total size and offsets. + curOffset = 0; + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + if (bindingAlignment > 0) + curOffset = glsUniformBlockCase.deRoundUp32(curOffset, bindingAlignment); + glBlockPointers.push(curOffset, glLayout.blocks[blockNdx].size); + curOffset += glLayout.blocks[blockNdx].size; + } + totalSize = curOffset; + glBlockPointers.resize(totalSize); + + // Copy to gl format. + glsUniformBlockCase.copyUniformData(glLayout, glBlockPointers, refLayout, blockPointers); + + // Allocate buffer and upload data. + buffer = bufferManager.allocBuffer(); + gl.bindBuffer(gl.UNIFORM_BUFFER, buffer); + if (glBlockPointers.data.byteLength > 0 /*!glData.empty()*/) + gl.bufferData(gl.UNIFORM_BUFFER, glBlockPointers.find(blockNdx) /*(glw::GLsizeiptr)glData.size(), &glData[0]*/, gl.STATIC_DRAW); + + // Bind ranges to binding points. + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + binding = blockNdx; + gl.bindBufferRange(gl.UNIFORM_BUFFER, binding, buffer, glBlockPointers.offsets[blockNdx], glLayout.blocks[blockNdx].size); + } + } + + /** @type {boolean} */ var renderOk = this.render(program); + if (!renderOk) + testFailedOptions('Image compare failed', false); + else + assertMsgOptions(renderOk, '', true, false); + + return tcuTestCase.IterateResult.STOP; +}; + +/** +* compareStd140Blocks +* @param {glsUniformBlockCase.UniformLayout} refLayout +* @param {glsUniformBlockCase.UniformLayout} cmpLayout +**/ +glsUniformBlockCase.UniformBlockCase.prototype.compareStd140Blocks = function(refLayout, cmpLayout) { + /**@type {boolean} */ var isOk = true; + /**@type {number} */ var numBlocks = this.m_interface.getNumUniformBlocks(); + + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + /**@type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.getUniformBlock(blockNdx); + /**@type {boolean} */ var isArray = block.isArray(); + /**@type {string} */ var instanceName = block.getBlockName() + (isArray ? '[0]' : ''); + /**@type {number} */ var refBlockNdx = refLayout.getBlockIndex(instanceName); + /**@type {number} */ var cmpBlockNdx = cmpLayout.getBlockIndex(instanceName); + /**@type {boolean} */ var isUsed = (block.getFlags() & (glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT)) != 0; + + if ((block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_STD140) == 0) + continue; // Not std140 layout. + + DE_ASSERT(refBlockNdx >= 0); + + if (cmpBlockNdx < 0) { + // Not found, should it? + if (isUsed) { + bufferedLogToConsole("Error: glsUniformBlockCase.Uniform block '" + instanceName + "' not found"); + isOk = false; + } + + continue; // Skip block. + } + + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var refBlockLayout = refLayout.blocks[refBlockNdx]; + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var cmpBlockLayout = cmpLayout.blocks[cmpBlockNdx]; + + // \todo [2012-01-24 pyry] Verify that activeUniformIndices is correct. + // \todo [2012-01-24 pyry] Verify all instances. + if (refBlockLayout.activeUniformIndices.length != cmpBlockLayout.activeUniformIndices.length) { + bufferedLogToConsole("Error: Number of active uniforms differ in block '" + instanceName + + "' (expected " + refBlockLayout.activeUniformIndices.length + + ', got ' + cmpBlockLayout.activeUniformIndices.length + + ')'); + isOk = false; + } + + for (var ndx = 0; ndx < refBlockLayout.activeUniformIndices.length; ndx++) { + /** @type {number} */ var ndxIter = refBlockLayout.activeUniformIndices[ndx]; + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var refEntry = refLayout.uniforms[ndxIter]; + /** @type {number} */ var cmpEntryNdx = cmpLayout.getUniformIndex(refEntry.name); + + if (cmpEntryNdx < 0) { + bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + refEntry.name + "' not found"); + isOk = false; + continue; + } + + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var cmpEntry = cmpLayout.uniforms[cmpEntryNdx]; + + if (refEntry.type != cmpEntry.type || + refEntry.size != cmpEntry.size || + refEntry.offset != cmpEntry.offset || + refEntry.arrayStride != cmpEntry.arrayStride || + refEntry.matrixStride != cmpEntry.matrixStride || + refEntry.isRowMajor != cmpEntry.isRowMajor) { + bufferedLogToConsole("Error: Layout mismatch in '" + refEntry.name + "':\n" + + ' expected: type = ' + gluShaderUtil.getDataTypeName(refEntry.type) + ', size = ' + refEntry.size + ', row major = ' + (refEntry.isRowMajor ? 'true' : 'false') + '\n' + + ' got: type = ' + gluShaderUtil.getDataTypeName(cmpEntry.type) + ', size = ' + cmpEntry.size + ', row major = ' + (cmpEntry.isRowMajor ? 'true' : 'false')); + isOk = false; + } + } + } + + return isOk; +}; + +/** +* compareSharedBlocks +* @param {glsUniformBlockCase.UniformLayout} refLayout +* @param {glsUniformBlockCase.UniformLayout} cmpLayout +**/ +glsUniformBlockCase.UniformBlockCase.prototype.compareSharedBlocks = function(refLayout, cmpLayout) { + /** @type {boolean} */ var isOk = true; + /** @type {number} */ var numBlocks = this.m_interface.getNumUniformBlocks(); + + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.getUniformBlock(blockNdx); + /** @type {boolean} */ var isArray = block.isArray(); + /** @type {string} */ var instanceName = block.getBlockName() + (isArray ? '[0]' : ''); + /** @type {number} */ var refBlockNdx = refLayout.getBlockIndex(instanceName); + /** @type {number} */ var cmpBlockNdx = cmpLayout.getBlockIndex(instanceName); + /** @type {boolean} */ var isUsed = (block.getFlags() & (glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT)) != 0; + + if ((block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_SHARED) == 0) + continue; // Not shared layout. + + DE_ASSERT(refBlockNdx >= 0); + + if (cmpBlockNdx < 0) { + // Not found, should it? + if (isUsed) { + bufferedLogToConsole("Error: glsUniformBlockCase.Uniform block '" + instanceName + "' not found"); + isOk = false; + } + + continue; // Skip block. + } + + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var refBlockLayout = refLayout.blocks[refBlockNdx]; + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var cmpBlockLayout = cmpLayout.blocks[cmpBlockNdx]; + + if (refBlockLayout.activeUniformIndices.length != cmpBlockLayout.activeUniformIndices.length) { + bufferedLogToConsole("Error: Number of active uniforms differ in block '" + instanceName + + "' (expected " + refBlockLayout.activeUniformIndices.length + + ', got ' + cmpBlockLayout.activeUniformIndices.length + + ')'); + isOk = false; + } + + for (var ndx = 0; ndx < refBlockLayout.activeUniformIndices.length; ndx++) { + /** @type {number} */ var ndxIter = refBlockLayout.activeUniformIndices[ndx]; + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var refEntry = refLayout.uniforms[ndxIter]; + /** @type {number} */ var cmpEntryNdx = cmpLayout.getUniformIndex(refEntry.name); + + if (cmpEntryNdx < 0) { + bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + refEntry.name + "' not found"); + isOk = false; + continue; + } + + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var cmpEntry = cmpLayout.uniforms[cmpEntryNdx]; + + if (refEntry.type != cmpEntry.type || + refEntry.size != cmpEntry.size || + refEntry.isRowMajor != cmpEntry.isRowMajor) { + bufferedLogToConsole("Error: Layout mismatch in '" + refEntry.name + "':\n" + + ' expected: type = ' + gluShaderUtil.getDataTypeName(refEntry.type) + ', size = ' + refEntry.size + ', row major = ' + (refEntry.isRowMajor ? 'true' : 'false') + '\n' + + ' got: type = ' + gluShaderUtil.getDataTypeName(cmpEntry.type) + ', size = ' + cmpEntry.size + ', row major = ' + (cmpEntry.isRowMajor ? 'true' : 'false')); + isOk = false; + } + } + } + + return isOk; +}; + +/** compareTypes +* @param {glsUniformBlockCase.UniformLayout} refLayout +* @param {glsUniformBlockCase.UniformLayout} cmpLayout +* @return {boolean} true if uniform types are the same +**/ +glsUniformBlockCase.UniformBlockCase.prototype.compareTypes = function(refLayout, cmpLayout) { + /** @type {boolean} */ var isOk = true; + /** @type {number} */ var numBlocks = this.m_interface.getNumUniformBlocks(); + + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.getUniformBlock(blockNdx); + /** @type {boolean} */ var isArray = block.isArray(); + /** @type {number} */ var numInstances = isArray ? block.getArraySize() : 1; + + for (var instanceNdx = 0; instanceNdx < numInstances; instanceNdx++) { + /** @type {string} */ var instanceName; + + instanceName += block.getBlockName(); + if (isArray) + instanceName = instanceName + '[' + instanceNdx + ']'; + + /** @type {number} */ var cmpBlockNdx = cmpLayout.getBlockIndex(instanceName); + + if (cmpBlockNdx < 0) + continue; + + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var cmpBlockLayout = cmpLayout.blocks[cmpBlockNdx]; + + for (var ndx = 0; ndx < cmpBlockLayout.activeUniformIndices.length; ndx++) { + /** @type {number} */ var ndxIter = cmpBlockLayout.activeUniformIndices[ndx]; + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var cmpEntry = cmpLayout.uniforms[ndxIter]; + /** @type {number} */ var refEntryNdx = refLayout.getUniformIndex(cmpEntry.name); + + if (refEntryNdx < 0) { + bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + cmpEntry.name + "' not found in reference layout"); + isOk = false; + continue; + } + + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var refEntry = refLayout.uniforms[refEntryNdx]; + + // \todo [2012-11-26 pyry] Should we check other properties as well? + if (refEntry.type != cmpEntry.type) { + bufferedLogToConsole("Error: glsUniformBlockCase.Uniform type mismatch in '" + refEntry.name + "':
" + + "' expected: '" + gluShaderUtil.getDataTypeName(refEntry.type) + "'
" + + "' got: '" + gluShaderUtil.getDataTypeName(cmpEntry.type) + "'"); + isOk = false; + } + } + } + } + + return isOk; +}; + +/** checkLayoutIndices +* @param {glsUniformBlockCase.UniformLayout} layout Layout whose indices are to be checked +* @return {boolean} true if all is ok +**/ +glsUniformBlockCase.UniformBlockCase.prototype.checkLayoutIndices = function(layout) { + /** @type {number} */ var numUniforms = layout.uniforms.length; + /** @type {number} */ var numBlocks = layout.blocks.length; + /** @type {boolean} */ var isOk = true; + + // Check uniform block indices. + for (var uniformNdx = 0; uniformNdx < numUniforms; uniformNdx++) { + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var uniform = layout.uniforms[uniformNdx]; + + if (uniform.blockNdx < 0 || !deMath.deInBounds32(uniform.blockNdx, 0, numBlocks)) { + bufferedLogToConsole("Error: Invalid block index in uniform '" + uniform.name + "'"); + isOk = false; + } + } + + // Check active uniforms. + for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) { + /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var block = layout.blocks[blockNdx]; + + for (var uniformNdx = 0; uniformNdx < block.activeUniformIndices.length; uniformNdx++) { + /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var activeUniformNdx = block.activeUniformIndices[uniformNdx]; + if (!deMath.deInBounds32(activeUniformNdx, 0, numUniforms)) { + bufferedLogToConsole('Error: Invalid active uniform index ' + activeUniformNdx + " in block '" + block.name); + isOk = false; + } + } + } + return isOk; +}; + +/** checkLayoutBounds +* @param {glsUniformBlockCase.UniformLayout} layout The uniform layout to check +* @return {boolean} true if all is within bounds +**/ +glsUniformBlockCase.UniformBlockCase.prototype.checkLayoutBounds = function(layout) { + /** @type {number} */ var numUniforms = layout.uniforms.length; + /** @type {boolean}*/ var isOk = true; + + for (var uniformNdx = 0; uniformNdx < numUniforms; uniformNdx++) { + /** @type {glsUniformBlockCase.UniformLayoutEntry}*/ var uniform = layout.uniforms[uniformNdx]; + + if (uniform.blockNdx < 0) + continue; + + /** @type {glsUniformBlockCase.BlockLayoutEntry}*/ var block = layout.blocks[uniform.blockNdx]; + /** @type {boolean}*/ var isMatrix = gluShaderUtil.isDataTypeMatrix(uniform.type); + /** @type {number}*/ var numVecs = isMatrix ? (uniform.isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(uniform.type) : gluShaderUtil.getDataTypeMatrixNumColumns(uniform.type)) : 1; + /** @type {number}*/ var numComps = isMatrix ? (uniform.isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(uniform.type) : gluShaderUtil.getDataTypeMatrixNumRows(uniform.type)) : gluShaderUtil.getDataTypeScalarSize(uniform.type); + /** @type {number}*/ var numElements = uniform.size; + /** @type {number}*/ var compSize = deMath.INT32_SIZE; + /** @type {number}*/ var vecSize = numComps * compSize; + + /** @type {number}*/ var minOffset = 0; + /** @type {number}*/ var maxOffset = 0; + + // For negative strides. + minOffset = Math.min(minOffset, (numVecs - 1) * uniform.matrixStride); + minOffset = Math.min(minOffset, (numElements - 1) * uniform.arrayStride); + minOffset = Math.min(minOffset, (numElements - 1) * uniform.arrayStride + (numVecs - 1) * uniform.matrixStride); + + maxOffset = Math.max(maxOffset, vecSize); + maxOffset = Math.max(maxOffset, (numVecs - 1) * uniform.matrixStride + vecSize); + maxOffset = Math.max(maxOffset, (numElements - 1) * uniform.arrayStride + vecSize); + maxOffset = Math.max(maxOffset, (numElements - 1) * uniform.arrayStride + (numVecs - 1) * uniform.matrixStride + vecSize); + + if (uniform.offset + minOffset < 0 || uniform.offset + maxOffset > block.size) { + bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + uniform.name + "' out of block bounds"); + isOk = false; + } + } + + return isOk; +}; + +/** checkIndexQueries +* @param {WebGLProgram} program The shader program to be checked against +* @param {glsUniformBlockCase.UniformLayout} layout The layout to check +* @return {boolean} true if everything matches. +**/ +glsUniformBlockCase.UniformBlockCase.prototype.checkIndexQueries = function(program, layout) { + /** @type {boolean}*/ var allOk = true; + + // \note Spec mandates that uniform blocks are assigned consecutive locations from 0 + // to ACTIVE_UNIFORM_BLOCKS. BlockLayoutEntries are stored in that order in glsUniformBlockCase.UniformLayout. + for (var blockNdx = 0; blockNdx < layout.blocks.length; blockNdx++) { + /** @const */ var block = layout.blocks[blockNdx]; + /** @const */ var queriedNdx = gl.getUniformBlockIndex(program, block.name); + + if (queriedNdx != blockNdx) { + bufferedLogToConsole('ERROR: glGetUniformBlockIndex(' + block.name + ') returned ' + queriedNdx + ', expected ' + blockNdx + '!'); + allOk = false; + } + } + + return allOk; +}; + +/** @const @type {number} */ glsUniformBlockCase.VIEWPORT_WIDTH = 128; +/** @const @type {number} */ glsUniformBlockCase.VIEWPORT_HEIGHT = 128; + +/** Renders a white square, and then tests all pixels are +* effectively white in the color buffer. +* @param {gluShaderProgram.ShaderProgram} program The shader program to use. +* @return {boolean} false if there was at least one incorrect pixel +**/ +glsUniformBlockCase.UniformBlockCase.prototype.render = function(program) { + // Compute viewport. + /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name)); + /** @const */ var viewportW = Math.min(gl.canvas.width, glsUniformBlockCase.VIEWPORT_WIDTH); + /** @const */ var viewportH = Math.min(gl.canvas.height, glsUniformBlockCase.VIEWPORT_HEIGHT); + /** @const */ var viewportX = rnd.getInt(0, gl.canvas.width); + /** @const */ var viewportY = rnd.getInt(0, gl.canvas.height); + + gl.clearColor(0.125, 0.25, 0.5, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + + //Draw + var position = [ + -1.0, -1.0, 0.0, 1.0, + -1.0, 1.0, 0.0, 1.0, + 1.0, -1.0, 0.0, 1.0, + 1.0, 1.0, 0.0, 1.0 + ]; + var indices = [0, 1, 2, 2, 1, 3]; + + gl.viewport(viewportX, viewportY, viewportW, viewportH); + + // Access + var posLoc = gl.getAttribLocation(program.getProgram(), 'a_position'); + var posArray = [new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, 4, position)]; + gluDrawUtil.draw(gl, program.getProgram(), posArray, gluDrawUtil.triangles(indices)); + + // Verify that all pixels are white. + var pixels = new gluDrawUtil.Surface(); + var numFailedPixels = 0; + + var readPixelsX = (viewportX + viewportW) > gl.canvas.width + ? (gl.canvas.width - viewportX) : viewportW; + var readPixelsY = (viewportY + viewportH) > gl.canvas.height + ? (gl.canvas.height - viewportY) : viewportH; + + var buffer = pixels.readSurface(gl, viewportX, viewportY, readPixelsX, readPixelsY); + + var whitePixel = new gluDrawUtil.Pixel([255.0, 255.0, 255.0, 255.0]); + for (var y = 0; y < readPixelsY; y++) { + for (var x = 0; x < readPixelsX; x++) { + if (!pixels.getPixel(x, y).equals(whitePixel)) + numFailedPixels += 1; + } + } + + if (numFailedPixels > 0) { + bufferedLogToConsole('Image comparison failed, got ' + numFailedPixels + ' non-white pixels.'); + } + + return numFailedPixels == 0; +}; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js new file mode 100644 index 000000000..99dc79f35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js @@ -0,0 +1,2534 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program OpenGL ES Utilities + * ------------------------------------------------ + * + * Copyright 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +'use strict'; +goog.provide('modules.shared.glsVertexArrayTests'); +goog.require('framework.common.tcuFloat'); +goog.require('framework.common.tcuImageCompare'); +goog.require('framework.common.tcuLogImage'); +goog.require('framework.common.tcuPixelFormat'); +goog.require('framework.common.tcuRGBA'); +goog.require('framework.common.tcuSurface'); +goog.require('framework.common.tcuTestCase'); +goog.require('framework.delibs.debase.deMath'); +goog.require('framework.delibs.debase.deRandom'); +goog.require('framework.opengl.gluShaderUtil'); +goog.require('framework.opengl.simplereference.sglrGLContext'); +goog.require('framework.opengl.simplereference.sglrReferenceContext'); +goog.require('framework.opengl.simplereference.sglrShaderProgram'); +goog.require('framework.referencerenderer.rrFragmentOperations'); +goog.require('framework.referencerenderer.rrGenericVector'); +goog.require('framework.referencerenderer.rrShadingContext'); +goog.require('framework.referencerenderer.rrVertexAttrib'); +goog.require('framework.referencerenderer.rrVertexPacket'); + +goog.scope(function() { + + var glsVertexArrayTests = modules.shared.glsVertexArrayTests; + var tcuTestCase = framework.common.tcuTestCase; + var tcuRGBA = framework.common.tcuRGBA; + var tcuFloat = framework.common.tcuFloat; + var tcuPixelFormat = framework.common.tcuPixelFormat; + var tcuSurface = framework.common.tcuSurface; + var tcuImageCompare = framework.common.tcuImageCompare; + var tcuLogImage = framework.common.tcuLogImage; + var gluShaderUtil = framework.opengl.gluShaderUtil; + var sglrGLContext = framework.opengl.simplereference.sglrGLContext; + var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext; + var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram; + var deMath = framework.delibs.debase.deMath; + var deRandom = framework.delibs.debase.deRandom; + var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations; + var rrGenericVector = framework.referencerenderer.rrGenericVector; + var rrShadingContext = framework.referencerenderer.rrShadingContext; + var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib; + var rrVertexPacket = framework.referencerenderer.rrVertexPacket; + + var DE_ASSERT = function(x) { + if (!x) + throw new Error('Assert failed'); + }; + + /** + * @interface + */ + glsVertexArrayTests.deArray = function() {}; + + /** + * glsVertexArrayTests.deArray.Target enum + * @enum + */ + glsVertexArrayTests.deArray.Target = { + ELEMENT_ARRAY: 0, + ARRAY: 1 + }; + + /** + * glsVertexArrayTests.deArray.InputType enum + * @enum + */ + glsVertexArrayTests.deArray.InputType = { + FLOAT: 0, + /*FIXED: 1, + DOUBLE: 2,*/ + + BYTE: 1, + SHORT: 2, + + UNSIGNED_BYTE: 3, + UNSIGNED_SHORT: 4, + + INT: 5, + UNSIGNED_INT: 6, + HALF: 7, + UNSIGNED_INT_2_10_10_10: 8, + INT_2_10_10_10: 9 + }; + + /** + * glsVertexArrayTests.deArray.OutputType enum + * @enum + */ + glsVertexArrayTests.deArray.OutputType = { + FLOAT: 0, + VEC2: 1, + VEC3: 2, + VEC4: 3, + + INT: 4, + UINT: 5, + + IVEC2: 6, + IVEC3: 7, + IVEC4: 8, + + UVEC2: 9, + UVEC3: 10, + UVEC4: 11 + }; + + /** + * glsVertexArrayTests.deArray.Usage enum + * @enum + */ + glsVertexArrayTests.deArray.Usage = { + DYNAMIC_DRAW: 0, + STATIC_DRAW: 1, + STREAM_DRAW: 2, + + STREAM_READ: 3, + STREAM_COPY: 4, + + STATIC_READ: 5, + STATIC_COPY: 6, + + DYNAMIC_READ: 7, + DYNAMIC_COPY: 8 + }; + + /** + * glsVertexArrayTests.deArray.Storage enum + * @enum + */ + glsVertexArrayTests.deArray.Storage = { + USER: 0, + BUFFER: 1 + }; + + /** + * glsVertexArrayTests.deArray.Primitive enum + * @enum + */ + glsVertexArrayTests.deArray.Primitive = { + POINTS: 0, + TRIANGLES: 1, + TRIANGLE_FAN: 2, + TRIANGLE_STRIP: 3 + }; + + //glsVertexArrayTests.deArray static functions + + /** + * @param {glsVertexArrayTests.deArray.Target} target + * @return {string} + */ + glsVertexArrayTests.deArray.targetToString = function(target) { + DE_ASSERT(target < Object.keys(glsVertexArrayTests.deArray.Target).length); + + /** @type {Array} */ var targets = + [ + 'element_array', // glsVertexArrayTests.deArray.Target.ELEMENT_ARRAY + 'array' // glsVertexArrayTests.deArray.Target.ARRAY + ]; + DE_ASSERT(targets.length == Object.keys(glsVertexArrayTests.deArray.Target).length); + + return targets[target]; + }; + + /** + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {string} + */ + glsVertexArrayTests.deArray.inputTypeToString = function(type) { + DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.InputType).length); + + /** @type {Array} */ var types = + [ + 'float', // glsVertexArrayTests.deArray.InputType.FLOAT + + 'byte', // glsVertexArrayTests.deArray.InputType.BYTE + 'short', // glsVertexArrayTests.deArray.InputType.SHORT + + 'unsigned_byte', // glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE + 'unsigned_short', // glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT + + 'int', // glsVertexArrayTests.deArray.InputType.INT + 'unsigned_int', // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT + 'half', // glsVertexArrayTests.deArray.InputType.HALF + 'unsigned_int2_10_10_10', // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 + 'int2_10_10_10' // glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.InputType).length); + + return types[type]; + }; + + /** + * @param {glsVertexArrayTests.deArray.OutputType} type + * @return {string} + */ + glsVertexArrayTests.deArray.outputTypeToString = function(type) { + DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.OutputType).length); + + /** @type {Array} */ var types = + [ + 'float', // glsVertexArrayTests.deArray.OutputType.FLOAT + 'vec2', // glsVertexArrayTests.deArray.OutputType.VEC2 + 'vec3', // glsVertexArrayTests.deArray.OutputType.VEC3 + 'vec4', // glsVertexArrayTests.deArray.OutputType.VEC4 + + 'int', // glsVertexArrayTests.deArray.OutputType.INT + 'uint', // glsVertexArrayTests.deArray.OutputType.UINT + + 'ivec2', // glsVertexArrayTests.deArray.OutputType.IVEC2 + 'ivec3', // glsVertexArrayTests.deArray.OutputType.IVEC3 + 'ivec4', // glsVertexArrayTests.deArray.OutputType.IVEC4 + + 'uvec2', // glsVertexArrayTests.deArray.OutputType.UVEC2 + 'uvec3', // glsVertexArrayTests.deArray.OutputType.UVEC3 + 'uvec4' // glsVertexArrayTests.deArray.OutputType.UVEC4 + ]; + DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.OutputType).length); + + return types[type]; + }; + + /** + * @param {glsVertexArrayTests.deArray.Usage} usage + * @return {string} + */ + glsVertexArrayTests.deArray.usageTypeToString = function(usage) { + DE_ASSERT(usage < Object.keys(glsVertexArrayTests.deArray.Usage).length); + + /** @type {Array} */ var usages = + [ + 'dynamic_draw', // glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW + 'static_draw', // glsVertexArrayTests.deArray.Usage.STATIC_DRAW + 'stream_draw', // glsVertexArrayTests.deArray.Usage.STREAM_DRAW + + 'stream_read', // glsVertexArrayTests.deArray.Usage.STREAM_READ + 'stream_copy', // glsVertexArrayTests.deArray.Usage.STREAM_COPY + + 'static_read', // glsVertexArrayTests.deArray.Usage.STATIC_READ + 'static_copy', // glsVertexArrayTests.deArray.Usage.STATIC_COPY + + 'dynamic_read', // glsVertexArrayTests.deArray.Usage.DYNAMIC_READ + 'dynamic_copy' // glsVertexArrayTests.deArray.Usage.DYNAMIC_COPY + ]; + DE_ASSERT(usages.length == Object.keys(glsVertexArrayTests.deArray.Usage).length); + + return usages[usage]; + }; + + /** + * @param {glsVertexArrayTests.deArray.Storage} storage + * @return {string} + */ + glsVertexArrayTests.deArray.storageToString = function(storage) { + DE_ASSERT(storage < Object.keys(glsVertexArrayTests.deArray.Storage).length); + + /** @type {Array} */ var storages = + [ + 'user_ptr', // glsVertexArrayTests.deArray.Storage.USER + 'buffer' // glsVertexArrayTests.deArray.Storage.BUFFER + ]; + DE_ASSERT(storages.length == Object.keys(glsVertexArrayTests.deArray.Storage).length); + + return storages[storage]; + }; + + /** + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @return {string} + */ + glsVertexArrayTests.deArray.primitiveToString = function(primitive) { + DE_ASSERT(primitive < Object.keys(glsVertexArrayTests.deArray.Primitive).length); + + /** @type {Array} */ var primitives = + [ + 'points', // glsVertexArrayTests.deArray.Primitive.POINTS + 'triangles', // glsVertexArrayTests.deArray.Primitive.TRIANGLES + 'triangle_fan', // glsVertexArrayTests.deArray.Primitive.TRIANGLE_FAN + 'triangle_strip' // glsVertexArrayTests.deArray.Primitive.TRIANGLE_STRIP + ]; + DE_ASSERT(primitives.length == Object.keys(glsVertexArrayTests.deArray.Primitive).length); + + return primitives[primitive]; + }; + + /** + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {number} + */ + glsVertexArrayTests.deArray.inputTypeSize = function(type) { + DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.InputType).length); + + /** @type {Array} */ var size = [ + 4, // glsVertexArrayTests.deArray.InputType.FLOAT + + 1, // glsVertexArrayTests.deArray.InputType.BYTE + 2, // glsVertexArrayTests.deArray.InputType.SHORT + + 1, // glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE + 2, // glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT + + 4, // glsVertexArrayTests.deArray.InputType.INT + 4, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT + 2, // glsVertexArrayTests.deArray.InputType.HALF + 4 / 4, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 + 4 / 4 // glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + DE_ASSERT(size.length == Object.keys(glsVertexArrayTests.deArray.InputType).length); + + return size[type]; + }; + + /** + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {boolean} + */ + glsVertexArrayTests.inputTypeIsFloatType = function(type) { + if (type == glsVertexArrayTests.deArray.InputType.FLOAT) + return true; + /*if (type == glsVertexArrayTests.deArray.InputType.FIXED) + return true; + if (type == glsVertexArrayTests.deArray.InputType.DOUBLE) + return true;*/ + if (type == glsVertexArrayTests.deArray.InputType.HALF) + return true; + return false; + }; + + /** + * @param {glsVertexArrayTests.deArray.OutputType} type + * @return {boolean} + */ + glsVertexArrayTests.outputTypeIsFloatType = function(type) { + if (type == glsVertexArrayTests.deArray.OutputType.FLOAT || + type == glsVertexArrayTests.deArray.OutputType.VEC2 || + type == glsVertexArrayTests.deArray.OutputType.VEC3 || + type == glsVertexArrayTests.deArray.OutputType.VEC4) + return true; + + return false; + }; + + //glsVertexArrayTests.deArray member functions (all virtual, since this is an interface) + + /** + * @param {glsVertexArrayTests.deArray.Target} target + * @param {number} size + * @param {Uint8Array} data + * @param {glsVertexArrayTests.deArray.Usage} usage + */ + glsVertexArrayTests.deArray.prototype.data = function(target, size, data, usage) {}; + + /** + * @param {glsVertexArrayTests.deArray.Target} target + * @param {number} offset + * @param {number} size + * @param {Uint8Array} data + */ + glsVertexArrayTests.deArray.prototype.subdata = function(target, offset, size, data) {}; + + /** + * @param {number} attribNdx + * @param {number} offset + * @param {number} size + * @param {glsVertexArrayTests.deArray.InputType} inType + * @param {glsVertexArrayTests.deArray.OutputType} outType + * @param {boolean} normalized + * @param {number} stride + */ + glsVertexArrayTests.deArray.prototype.bind = function(attribNdx, offset, size, inType, outType, normalized, stride) {}; + + /** + * unBind + */ + glsVertexArrayTests.deArray.prototype.unBind = function() {}; + + /** + * @return {boolean} + */ + glsVertexArrayTests.deArray.prototype.isBound = function() {}; + + /** + * @return {number} + */ + glsVertexArrayTests.deArray.prototype.getComponentCount = function() {}; + + /** + * @return {glsVertexArrayTests.deArray.Target} + */ + glsVertexArrayTests.deArray.prototype.getTarget = function() {}; + + /** + * @return {glsVertexArrayTests.deArray.InputType} + */ + glsVertexArrayTests.deArray.prototype.getInputType = function() {}; + + /** + * @return {glsVertexArrayTests.deArray.OutputType} + */ + glsVertexArrayTests.deArray.prototype.getOutputType = function() {}; + + /** + * @return {glsVertexArrayTests.deArray.Storage} + */ + glsVertexArrayTests.deArray.prototype.getStorageType = function() {}; + + /** + * @return {boolean} + */ + glsVertexArrayTests.deArray.prototype.getNormalized = function() {}; + + /** + * @return {number} + */ + glsVertexArrayTests.deArray.prototype.getStride = function() {}; + + /** + * @return {number} + */ + glsVertexArrayTests.deArray.prototype.getAttribNdx = function() {}; + + /** + * @param {number} attribNdx + */ + glsVertexArrayTests.deArray.prototype.setAttribNdx = function(attribNdx) {}; + + //glsVertexArrayTests.ContextArray class, implements glsVertexArrayTests.deArray interface + + /** + * @constructor + * @implements {glsVertexArrayTests.deArray} + * @param {glsVertexArrayTests.deArray.Storage} storage + * @param {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} context + */ + glsVertexArrayTests.ContextArray = function(storage, context) { + /** @type {glsVertexArrayTests.deArray.Storage} */ this.m_storage = storage; + /** @type {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} */ this.m_ctx = context; + /** @type {WebGLBuffer|sglrReferenceContext.DataBuffer|null} */ this.m_glBuffer = null; + + /** @type {boolean} */ this.m_bound = false; + /** @type {number} */ this.m_attribNdx = 0; + /** @type {number} */ this.m_size = 0; + /** @type {Uint8Array} */ this.m_data = null; + /** @type {number} */ this.m_componentCount = 1; + /** @type {glsVertexArrayTests.deArray.Target} */ this.m_target = glsVertexArrayTests.deArray.Target.ARRAY; + /** @type {glsVertexArrayTests.deArray.InputType} */ this.m_inputType = glsVertexArrayTests.deArray.InputType.FLOAT; + /** @type {glsVertexArrayTests.deArray.OutputType} */ this.m_outputType = glsVertexArrayTests.deArray.OutputType.FLOAT; + /** @type {boolean} */ this.m_normalize = false; + /** @type {number} */ this.m_stride = 0; + /** @type {number} */ this.m_offset = 0; + + if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) { + this.m_glBuffer = this.m_ctx.createBuffer(); + } + }; + + // glsVertexArrayTests.ContextArray member functions + + /** + * unBind + */ + glsVertexArrayTests.ContextArray.prototype.unBind = function() { this.m_bound = false; }; + + /** + * @return {boolean} + */ + glsVertexArrayTests.ContextArray.prototype.isBound = function() { return this.m_bound; }; + + /** + * @return {number} + */ + glsVertexArrayTests.ContextArray.prototype.getComponentCount = function() { return this.m_componentCount; }; + + /** + * @return {glsVertexArrayTests.deArray.Target} + */ + glsVertexArrayTests.ContextArray.prototype.getTarget = function() { return this.m_target; }; + + /** + * @return {glsVertexArrayTests.deArray.InputType} + */ + glsVertexArrayTests.ContextArray.prototype.getInputType = function() { return this.m_inputType; }; + + /** + * @return {glsVertexArrayTests.deArray.OutputType} + */ + glsVertexArrayTests.ContextArray.prototype.getOutputType = function() { return this.m_outputType; }; + + /** + * @return {glsVertexArrayTests.deArray.Storage} + */ + glsVertexArrayTests.ContextArray.prototype.getStorageType = function() { return this.m_storage; }; + + /** + * @return {boolean} + */ + glsVertexArrayTests.ContextArray.prototype.getNormalized = function() { return this.m_normalize; }; + + /** + * @return {number} + */ + glsVertexArrayTests.ContextArray.prototype.getStride = function() { return this.m_stride; }; + + /** + * @return {number} + */ + glsVertexArrayTests.ContextArray.prototype.getAttribNdx = function() { return this.m_attribNdx; }; + + /** + * @param {number} attribNdx + */ + glsVertexArrayTests.ContextArray.prototype.setAttribNdx = function(attribNdx) { this.m_attribNdx = attribNdx; }; + + /** + * @param {glsVertexArrayTests.deArray.Target} target + * @param {number} size + * @param {Uint8Array} ptr + * @param {glsVertexArrayTests.deArray.Usage} usage + */ + glsVertexArrayTests.ContextArray.prototype.data = function(target, size, ptr, usage) { + this.m_size = size; + this.m_target = target; + + if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(target), this.m_glBuffer); + + //No need for size param here, as opposed to GL ES. + this.m_ctx.bufferData(glsVertexArrayTests.ContextArray.targetToGL(target), ptr, glsVertexArrayTests.ContextArray.usageToGL(usage)); + } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER) { + this.m_data = new Uint8Array(size); + for (var i = 0; i < size; i++) + this.m_data[i] = ptr[i]; + } else + throw new Error('glsVertexArrayTests.ContextArray.prototype.data - Invalid storage type specified'); + }; + + /** + * @param {glsVertexArrayTests.deArray.Target} target + * @param {number} offset + * @param {number} size + * @param {Uint8Array} ptr + */ + glsVertexArrayTests.ContextArray.prototype.subdata = function(target, offset, size, ptr) { + this.m_target = target; + + if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(target), this.m_glBuffer); + + this.m_ctx.bufferSubData(glsVertexArrayTests.ContextArray.targetToGL(target), offset, ptr); + } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER) + for (var i = offset; i < size; i++) + this.m_data[i] = ptr[i]; + else + throw new Error('glsVertexArrayTests.ContextArray.prototype.subdata - Invalid storage type specified'); + }; + + /** + * @param {number} attribNdx + * @param {number} offset + * @param {number} size + * @param {glsVertexArrayTests.deArray.InputType} inType + * @param {glsVertexArrayTests.deArray.OutputType} outType + * @param {boolean} normalized + * @param {number} stride + */ + glsVertexArrayTests.ContextArray.prototype.bind = function(attribNdx, offset, size, inType, outType, normalized, stride) { + this.m_attribNdx = attribNdx; + this.m_bound = true; + this.m_componentCount = size; + this.m_inputType = inType; + this.m_outputType = outType; + this.m_normalize = normalized; + this.m_stride = stride; + this.m_offset = offset; + }; + + /** + * @param {glsVertexArrayTests.deArray.Target} target + */ + glsVertexArrayTests.ContextArray.prototype.bindIndexArray = function(target) { + if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER) { + } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(target), this.m_glBuffer); + } + }; + + /** + * @param {number} loc + */ + glsVertexArrayTests.ContextArray.prototype.glBind = function(loc) { + if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) { + this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(this.m_target), this.m_glBuffer); + + if (!glsVertexArrayTests.inputTypeIsFloatType(this.m_inputType)) { + // Input is not float type + + if (glsVertexArrayTests.outputTypeIsFloatType(this.m_outputType)) { + // Output type is float type + this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_offset); + } else { + // Output type is int type + this.m_ctx.vertexAttribIPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_stride, this.m_offset); + } + } else { + // Input type is float type + // Output type must be float type + DE_ASSERT(this.m_outputType == glsVertexArrayTests.deArray.OutputType.FLOAT || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC2 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC3 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC4); + + this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_offset); + } + + this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(this.m_target), null); + } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER) { + this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(this.m_target), null); + + if (!glsVertexArrayTests.inputTypeIsFloatType(this.m_inputType)) { + // Input is not float type + + if (glsVertexArrayTests.outputTypeIsFloatType(this.m_outputType)) { + // Output type is float type + this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_data.subarray(this.m_offset)); + } else { + // Output type is int type + this.m_ctx.vertexAttribIPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_stride, this.m_data.subarray(this.m_offset)); + } + } else { + // Input type is float type + + // Output type must be float type + DE_ASSERT(this.m_outputType == glsVertexArrayTests.deArray.OutputType.FLOAT || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC2 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC3 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC4); + + this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_data.subarray(this.m_offset)); + } + } else + throw new Error('glsVertexArrayTests.ContextArray.prototype.glBind - Invalid storage type specified'); + }; + + //glsVertexArrayTests.ContextArray static functions + + /** + * @param {glsVertexArrayTests.deArray.Target} target + * @return {number} + */ + glsVertexArrayTests.ContextArray.targetToGL = function(target) { + DE_ASSERT(target < Object.keys(glsVertexArrayTests.deArray.Target).length); + + /** @type {Array} */ var targets = + [ + gl.ELEMENT_ARRAY_BUFFER, // glsVertexArrayTests.deArray.Target.ELEMENT_ARRAY + gl.ARRAY_BUFFER // glsVertexArrayTests.deArray.Target.ARRAY + ]; + + return targets[target]; + }; + + /** + * @param {glsVertexArrayTests.deArray.Usage} usage + * @return {number} + */ + glsVertexArrayTests.ContextArray.usageToGL = function(usage) { + DE_ASSERT(usage < Object.keys(glsVertexArrayTests.deArray.Usage).length); + + /** @type {Array} */ var usages = + [ + gl.DYNAMIC_DRAW, // glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW + gl.STATIC_DRAW, // glsVertexArrayTests.deArray.Usage.STATIC_DRAW + gl.STREAM_DRAW, // glsVertexArrayTests.deArray.Usage.STREAM_DRAW + + gl.STREAM_READ, // glsVertexArrayTests.deArray.Usage.STREAM_READ + gl.STREAM_COPY, // glsVertexArrayTests.deArray.Usage.STREAM_COPY + + gl.STATIC_READ, // glsVertexArrayTests.deArray.Usage.STATIC_READ + gl.STATIC_COPY, // glsVertexArrayTests.deArray.Usage.STATIC_COPY + + gl.DYNAMIC_READ, // glsVertexArrayTests.deArray.Usage.DYNAMIC_READ + gl.DYNAMIC_COPY // glsVertexArrayTests.deArray.Usage.DYNAMIC_COPY + ]; + DE_ASSERT(usages.length == Object.keys(glsVertexArrayTests.deArray.Usage).length); + + return usages[usage]; + }; + + /** + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {number} + */ + glsVertexArrayTests.ContextArray.inputTypeToGL = function(type) { + DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.InputType).length); + + /** @type {Array} */ var types = + [ + gl.FLOAT, // glsVertexArrayTests.deArray.InputType.FLOAT + + gl.BYTE, // glsVertexArrayTests.deArray.InputType.BYTE + gl.SHORT, // glsVertexArrayTests.deArray.InputType.SHORT + gl.UNSIGNED_BYTE, // glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE + gl.UNSIGNED_SHORT, // glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT + + gl.INT, // glsVertexArrayTests.deArray.InputType.INT + gl.UNSIGNED_INT, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT + gl.HALF_FLOAT, // glsVertexArrayTests.deArray.InputType.HALF + gl.UNSIGNED_INT_2_10_10_10_REV, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 + gl.INT_2_10_10_10_REV // glsVertexArrayTests.deArray.InputType.INT_2_10_10_10 + ]; + DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.InputType).length); + + return types[type]; + }; + + /** + * @param {glsVertexArrayTests.deArray.OutputType} type + * @return {string} + */ + glsVertexArrayTests.ContextArray.outputTypeToGLType = function(type) { + DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.OutputType).length); + + /** @type {Array} */ var types = + [ + 'float', // glsVertexArrayTests.deArray.OutputType.FLOAT + 'vec2', // glsVertexArrayTests.deArray.OutputType.VEC2 + 'vec3', // glsVertexArrayTests.deArray.OutputType.VEC3 + 'vec4', // glsVertexArrayTests.deArray.OutputType.VEC4 + + 'int', // glsVertexArrayTests.deArray.OutputType.INT + 'uint', // glsVertexArrayTests.deArray.OutputType.UINT + + 'ivec2', // glsVertexArrayTests.deArray.OutputType.IVEC2 + 'ivec3', // glsVertexArrayTests.deArray.OutputType.IVEC3 + 'ivec4', // glsVertexArrayTests.deArray.OutputType.IVEC4 + + 'uvec2', // glsVertexArrayTests.deArray.OutputType.UVEC2 + 'uvec3', // glsVertexArrayTests.deArray.OutputType.UVEC3 + 'uvec4' // glsVertexArrayTests.deArray.OutputType.UVEC4 + ]; + DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.OutputType).length); + + return types[type]; + }; + + /** + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @return {number} + */ + glsVertexArrayTests.ContextArray.primitiveToGL = function(primitive) { + /** @type {Array} */ var primitives = + [ + gl.POINTS, // glsVertexArrayTests.deArray.Primitive.POINTS + gl.TRIANGLES, // glsVertexArrayTests.deArray.Primitive.TRIANGLES + gl.TRIANGLE_FAN, // glsVertexArrayTests.deArray.Primitive.TRIANGLE_FAN + gl.TRIANGLE_STRIP // glsVertexArrayTests.deArray.Primitive.TRIANGLE_STRIP + ]; + DE_ASSERT(primitives.length == Object.keys(glsVertexArrayTests.deArray.Primitive).length); + + return primitives[primitive]; + }; + + /** + * @constructor + * @param {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} drawContext + */ + glsVertexArrayTests.ContextArrayPack = function(drawContext) { + /** @type {WebGLRenderingContextBase} */ this.m_renderCtx = gl; + //TODO: Reference rasterizer implementation. + /** @type {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} */ this.m_ctx = drawContext; + + /** @type {Array} */ this.m_arrays = []; + /** @type {sglrShaderProgram.ShaderProgram} */ this.m_program; + /** @type {tcuSurface.Surface} */ this.m_screen = new tcuSurface.Surface( + Math.min(512, canvas.width), + Math.min(512, canvas.height) + ); + }; + + /** + * @return {number} + */ + glsVertexArrayTests.ContextArrayPack.prototype.getArrayCount = function() { + return this.m_arrays.length; + }; + + /** + * @param {glsVertexArrayTests.deArray.Storage} storage + */ + glsVertexArrayTests.ContextArrayPack.prototype.newArray = function(storage) { + this.m_arrays.push(new glsVertexArrayTests.ContextArray(storage, this.m_ctx)); + }; + + /** + * @param {number} i + * @return {glsVertexArrayTests.ContextArray} + */ + glsVertexArrayTests.ContextArrayPack.prototype.getArray = function(i) { + return this.m_arrays[i]; + }; + + /** + * updateProgram + */ + glsVertexArrayTests.ContextArrayPack.prototype.updateProgram = function() { + this.m_program = new glsVertexArrayTests.ContextShaderProgram(this.m_renderCtx, this.m_arrays); + }; + + /** + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @param {number} firstVertex + * @param {number} vertexCount + * @param {boolean} useVao + * @param {number} coordScale + * @param {number} colorScale + */ + glsVertexArrayTests.ContextArrayPack.prototype.render = function(primitive, firstVertex, vertexCount, useVao, coordScale, colorScale) { + var program; + /** @type {(WebGLVertexArrayObject|sglrReferenceContext.VertexArray|null)} */ var vaoID = null; + + this.updateProgram(); + + this.m_ctx.viewport(0, 0, this.m_screen.getWidth(), this.m_screen.getHeight()); + this.m_ctx.clearColor(0.0, 0.0, 0.0, 1.0); + this.m_ctx.clear(gl.COLOR_BUFFER_BIT); + + program = this.m_ctx.createProgram(this.m_program); + + this.m_ctx.useProgram(program); + + this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(program, 'u_coordScale'), coordScale); + this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(program, 'u_colorScale'), colorScale); + + if (useVao) { + vaoID = this.m_ctx.createVertexArray(); + this.m_ctx.bindVertexArray(vaoID); + } + + /** @type {string} */ var attribName; + /** @type {number} */ var loc; + for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) { + if (this.m_arrays[arrayNdx].isBound()) { + attribName = 'a_' + this.m_arrays[arrayNdx].getAttribNdx(); + loc = this.m_ctx.getAttribLocation(program, attribName); + this.m_ctx.enableVertexAttribArray(loc); + + this.m_arrays[arrayNdx].glBind(loc); + } + } + + DE_ASSERT((firstVertex % 6) == 0); + //this.m_ctx.drawArrays(glsVertexArrayTests.ContextArray.primitiveToGL(primitive), firstVertex, vertexCount - firstVertex); + this.m_ctx.drawQuads(gl.TRIANGLES, firstVertex, vertexCount - firstVertex); + + for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) { + if (this.m_arrays[arrayNdx].isBound()) { + attribName = 'a_' + this.m_arrays[arrayNdx].getAttribNdx(); + loc = this.m_ctx.getAttribLocation(program, attribName); + + this.m_ctx.disableVertexAttribArray(loc); + } + } + + if (useVao) + vaoID = this.m_ctx.deleteVertexArray(vaoID); + + this.m_ctx.deleteProgram(program); + this.m_ctx.useProgram(null); + this.m_ctx.readPixels(0, 0, this.m_screen.getWidth(), this.m_screen.getHeight(), gl.RGBA, gl.UNSIGNED_BYTE, this.m_screen.getAccess().getDataPtr()); + }; + + /** + * @return {tcuSurface.Surface} + */ + glsVertexArrayTests.ContextArrayPack.prototype.getSurface = function() { return this.m_screen; }; + + /** + * glsVertexArrayTests.ContextShaderProgram class + * @constructor + * @extends {sglrShaderProgram.ShaderProgram} + * @param {WebGLRenderingContextBase | sglrReferenceContext.ReferenceContext} ctx + * @param {Array} arrays + */ + glsVertexArrayTests.ContextShaderProgram = function(ctx, arrays) { + sglrShaderProgram.ShaderProgram.call(this, this.createProgramDeclaration(ctx, arrays)); + this.m_componentCount = new Array(arrays.length); + /** @type {Array} */ this.m_attrType = new Array(arrays.length); + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) { + this.m_componentCount[arrayNdx] = this.getComponentCount(arrays[arrayNdx].getOutputType()); + this.m_attrType[arrayNdx] = this.mapOutputType(arrays[arrayNdx].getOutputType()); + } + }; + + glsVertexArrayTests.ContextShaderProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype); + glsVertexArrayTests.ContextShaderProgram.prototype.constructor = glsVertexArrayTests.ContextShaderProgram; + + /** + * glsVertexArrayTests.calcShaderColorCoord function + * @param {Array} coord (2 elements) + * @param {Array} color (3 elements) + * @param {goog.NumberArray} attribValue (4 elements) + * @param {boolean} isCoordinate + * @param {number} numComponents + */ + glsVertexArrayTests.calcShaderColorCoord = function(coord, color, attribValue, isCoordinate, numComponents) { + if (isCoordinate) + switch (numComponents) { + case 1: + coord[0] = attribValue[0]; + coord[1] = attribValue[0]; + break; + case 2: + coord[0] = attribValue[0]; + coord[1] = attribValue[1]; + break; + case 3: + coord[0] = attribValue[0] + attribValue[2]; + coord[1] = attribValue[1]; + break; + case 4: + coord[0] = attribValue[0] + attribValue[2]; + coord[1] = attribValue[1] + attribValue[3]; + break; + default: + throw new Error('glsVertexArrayTests.calcShaderColorCoord - Invalid number of components'); + } else { + switch (numComponents) { + case 1: + color[0] = color[0] * attribValue[0]; + break; + case 2: + color[0] = color[0] * attribValue[0]; + color[1] = color[1] * attribValue[1]; + break; + case 3: + color[0] = color[0] * attribValue[0]; + color[1] = color[1] * attribValue[1]; + color[2] = color[2] * attribValue[2]; + break; + case 4: + color[0] = color[0] * attribValue[0] * attribValue[3]; + color[1] = color[1] * attribValue[1] * attribValue[3]; + color[2] = color[2] * attribValue[2] * attribValue[3]; + break; + default: + throw new Error('glsVertexArrayTests.calcShaderColorCoord - Invalid number of components'); + } + } + }; + + /** + * glsVertexArrayTests.ContextShaderProgram.shadeVertices + * @param {Array} inputs + * @param {Array} packets + * @param {number} numPackets + */ + glsVertexArrayTests.ContextShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) { + /** @type {number} */ var u_coordScale = this.getUniformByName('u_coordScale').value[0]; + /** @type {number} */ var u_colorScale = this.getUniformByName('u_colorScale').value[0]; + + for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) { + /** @type {number} */ var varyingLocColor = 0; + + /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx]; + + // Calc output color + /** @type {Array} */ var coord = [1.0, 1.0]; + /** @type {Array} */ var color = [1.0, 1.0, 1.0]; + + for (var attribNdx = 0; attribNdx < this.m_attrType.length; attribNdx++) { + /** @type {number} */ var numComponents = this.m_componentCount[attribNdx]; + + glsVertexArrayTests.calcShaderColorCoord(coord, color, rrVertexAttrib.readVertexAttrib(inputs[attribNdx], packet.instanceNdx, packet.vertexNdx, this.m_attrType[attribNdx]), attribNdx == 0, numComponents); + } + + // Transform position + packet.position = [u_coordScale * coord[0], u_coordScale * coord[1], 1.0, 1.0]; + + // Pass color to FS + packet.outputs[varyingLocColor] = [u_colorScale * color[0], u_colorScale * color[1], u_colorScale * color[2], 1.0]; + } + }; + + /** + * @param {Array} packets + * @param {rrShadingContext.FragmentShadingContext} context + */ + glsVertexArrayTests.ContextShaderProgram.prototype.shadeFragments = function(packets, context) { + var varyingLocColor = 0; + + // Normal shading + for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) + packets[packetNdx].value = rrShadingContext.readTriangleVarying(packets[packetNdx], context, varyingLocColor); + }; + + /** + * @param {Array} arrays + * @return string + */ + glsVertexArrayTests.ContextShaderProgram.prototype.genVertexSource = function(arrays) { + var vertexShaderSrc = ''; + var params = []; + + params['VTX_IN'] = 'in'; + params['VTX_OUT'] = 'out'; + params['FRAG_IN'] = 'in'; + params['FRAG_COLOR'] = 'dEQP_FragColor'; + params['VTX_HDR'] = '#version 300 es\n'; + params['FRAG_HDR'] = '#version 300 es\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + + vertexShaderSrc += params['VTX_HDR']; + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) { + vertexShaderSrc += params['VTX_IN'] + ' highp ' + glsVertexArrayTests.ContextArray.outputTypeToGLType(arrays[arrayNdx].getOutputType()) + ' a_' + arrays[arrayNdx].getAttribNdx() + ';\n'; + } + + vertexShaderSrc += + 'uniform highp float u_coordScale;\n' + + 'uniform highp float u_colorScale;\n' + + params['VTX_OUT'] + ' mediump vec4 v_color;\n' + + 'void main(void)\n' + + ' {\n' + + '\tgl_PointSize = 1.0;\n' + + '\thighp vec2 coord = vec2(1.0, 1.0);\n' + + '\thighp vec3 color = vec3(1.0, 1.0, 1.0);\n'; + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) { + if (arrays[arrayNdx].getAttribNdx() == 0) { + switch (arrays[arrayNdx].getOutputType()) { + case (glsVertexArrayTests.deArray.OutputType.FLOAT): + vertexShaderSrc += + '\tcoord = vec2(a_0);\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.VEC2): + vertexShaderSrc += + '\tcoord = a_0.xy;\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.VEC3): + vertexShaderSrc += + '\tcoord = a_0.xy;\n' + + '\tcoord.x = coord.x + a_0.z;\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.VEC4): + vertexShaderSrc += + '\tcoord = a_0.xy;\n' + + '\tcoord += a_0.zw;\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.IVEC2): + case (glsVertexArrayTests.deArray.OutputType.UVEC2): + vertexShaderSrc += + '\tcoord = vec2(a_0.xy);\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.IVEC3): + case (glsVertexArrayTests.deArray.OutputType.UVEC3): + vertexShaderSrc += + '\tcoord = vec2(a_0.xy);\n' + + '\tcoord.x = coord.x + float(a_0.z);\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.IVEC4): + case (glsVertexArrayTests.deArray.OutputType.UVEC4): + vertexShaderSrc += + '\tcoord = vec2(a_0.xy);\n' + + '\tcoord += vec2(a_0.zw);\n'; + break; + + default: + throw new Error('Invalid output type'); + break; + } + continue; + } + + switch (arrays[arrayNdx].getOutputType()) { + case (glsVertexArrayTests.deArray.OutputType.FLOAT): + vertexShaderSrc += + '\tcolor = color * a_' + arrays[arrayNdx].getAttribNdx() + ';\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.VEC2): + vertexShaderSrc += + '\tcolor.rg = color.rg * a_' + arrays[arrayNdx].getAttribNdx() + '.xy;\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.VEC3): + vertexShaderSrc += + '\tcolor = color.rgb * a_' + arrays[arrayNdx].getAttribNdx() + '.xyz;\n'; + break; + + case (glsVertexArrayTests.deArray.OutputType.VEC4): + vertexShaderSrc += + '\tcolor = color.rgb * a_' + arrays[arrayNdx].getAttribNdx() + '.xyz * a_' + arrays[arrayNdx].getAttribNdx() + '.w;\n'; + break; + + default: + throw new Error('Invalid output type'); + break; + } + } + + vertexShaderSrc += + '\tv_color = vec4(u_colorScale * color, 1.0);\n' + + '\tgl_Position = vec4(u_coordScale * coord, 1.0, 1.0);\n' + + '}\n'; + + return vertexShaderSrc; + }; + + /** + * @return {string} + */ + glsVertexArrayTests.ContextShaderProgram.prototype.genFragmentSource = function() { + var params = []; + + params['VTX_IN'] = 'in'; + params['VTX_OUT'] = 'out'; + params['FRAG_IN'] = 'in'; + params['FRAG_COLOR'] = 'dEQP_FragColor'; + params['VTX_HDR'] = '#version 300 es\n'; + params['FRAG_HDR'] = '#version 300 es\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n'; + + /* TODO: Check if glsl supported version check function is needed.*/ + + var fragmentShaderSrc = params['FRAG_HDR'] + + params['FRAG_IN'] + ' mediump vec4 v_color;\n' + + 'void main(void)\n' + + ' {\n' + + '\t' + params['FRAG_COLOR'] + ' = v_color;\n' + + '}\n'; + + return fragmentShaderSrc; + }; + + /** + * @param {glsVertexArrayTests.deArray.OutputType} type + * @return {rrGenericVector.GenericVecType} + */ + glsVertexArrayTests.ContextShaderProgram.prototype.mapOutputType = function(type) { + switch (type) { + case (glsVertexArrayTests.deArray.OutputType.FLOAT): + case (glsVertexArrayTests.deArray.OutputType.VEC2): + case (glsVertexArrayTests.deArray.OutputType.VEC3): + case (glsVertexArrayTests.deArray.OutputType.VEC4): + return rrGenericVector.GenericVecType.FLOAT; + + case (glsVertexArrayTests.deArray.OutputType.INT): + case (glsVertexArrayTests.deArray.OutputType.IVEC2): + case (glsVertexArrayTests.deArray.OutputType.IVEC3): + case (glsVertexArrayTests.deArray.OutputType.IVEC4): + return rrGenericVector.GenericVecType.INT32; + + case (glsVertexArrayTests.deArray.OutputType.UINT): + case (glsVertexArrayTests.deArray.OutputType.UVEC2): + case (glsVertexArrayTests.deArray.OutputType.UVEC3): + case (glsVertexArrayTests.deArray.OutputType.UVEC4): + return rrGenericVector.GenericVecType.UINT32; + + default: + throw new Error('Invalid output type'); + } + }; + + /** + * @param {glsVertexArrayTests.deArray.OutputType} type + * @return {number} + */ + glsVertexArrayTests.ContextShaderProgram.prototype.getComponentCount = function(type) { + switch (type) { + case (glsVertexArrayTests.deArray.OutputType.FLOAT): + case (glsVertexArrayTests.deArray.OutputType.INT): + case (glsVertexArrayTests.deArray.OutputType.UINT): + return 1; + + case (glsVertexArrayTests.deArray.OutputType.VEC2): + case (glsVertexArrayTests.deArray.OutputType.IVEC2): + case (glsVertexArrayTests.deArray.OutputType.UVEC2): + return 2; + + case (glsVertexArrayTests.deArray.OutputType.VEC3): + case (glsVertexArrayTests.deArray.OutputType.IVEC3): + case (glsVertexArrayTests.deArray.OutputType.UVEC3): + return 3; + + case (glsVertexArrayTests.deArray.OutputType.VEC4): + case (glsVertexArrayTests.deArray.OutputType.IVEC4): + case (glsVertexArrayTests.deArray.OutputType.UVEC4): + return 4; + + default: + throw new Error('Invalid output type'); + } + }; + + /** + * @param {WebGLRenderingContextBase | sglrReferenceContext.ReferenceContext} ctx + * @param {Array} arrays + * @return {sglrShaderProgram.ShaderProgramDeclaration} + */ + glsVertexArrayTests.ContextShaderProgram.prototype.createProgramDeclaration = function(ctx, arrays) { + /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var decl = new sglrShaderProgram.ShaderProgramDeclaration(); + + for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) + decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_' + arrayNdx, this.mapOutputType(arrays[arrayNdx].getOutputType()))); + + decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT)); + decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT)); + + decl.pushVertexSource(new sglrShaderProgram.VertexSource(this.genVertexSource(/*ctx,*/ arrays))); //TODO: Check if we need to review the support of a given GLSL version (we'd need the ctx) + decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(this.genFragmentSource(/*ctx*/))); + + decl.pushUniform(new sglrShaderProgram.Uniform('u_coordScale', gluShaderUtil.DataType.FLOAT)); + decl.pushUniform(new sglrShaderProgram.Uniform('u_colorScale', gluShaderUtil.DataType.FLOAT)); + + return decl; + }; + + /** + * glsVertexArrayTests.GLValue class + * @constructor + */ + glsVertexArrayTests.GLValue = function() { + /** @type {goog.NumberArray} */ this.m_value = [0]; + /** @type {glsVertexArrayTests.deArray.InputType} */ this.m_type; + }; + + /** + * @param {Uint8Array} dst + * @param {glsVertexArrayTests.GLValue} val + */ + glsVertexArrayTests.copyGLValueToArray = function(dst, val) { + /** @type {Uint8Array} */ var val8 = new Uint8Array(val.m_value.buffer); // TODO: Fix encapsulation issue + dst.set(val8); + }; + + /** + * @param {Uint8Array} dst + * @param {goog.NumberArray} src + */ + glsVertexArrayTests.copyArray = function(dst, src) { + /** @type {Uint8Array} */ var src8 = new Uint8Array(src.buffer).subarray(src.byteOffset, src.byteOffset + src.byteLength); // TODO: Fix encapsulation issue + dst.set(src8); + }; + + /** + * typeToTypedArray function. Determines which type of array will store the value, and stores it. + * @param {number} value + * @param {glsVertexArrayTests.deArray.InputType} type + */ + glsVertexArrayTests.GLValue.typeToTypedArray = function(value, type) { + var array; + + switch (type) { + case glsVertexArrayTests.deArray.InputType.FLOAT: + array = new Float32Array(1); + break; + /*case glsVertexArrayTests.deArray.InputType.FIXED: + array = new Int32Array(1); + break; + case glsVertexArrayTests.deArray.InputType.DOUBLE: + array = new Float32Array(1); // 64-bit? + break;*/ + + case glsVertexArrayTests.deArray.InputType.BYTE: + array = new Int8Array(1); + break; + case glsVertexArrayTests.deArray.InputType.SHORT: + array = new Int16Array(1); + break; + + case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE: + array = new Uint8Array(1); + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT: + array = new Uint16Array(1); + break; + + case glsVertexArrayTests.deArray.InputType.INT: + array = new Int32Array(1); + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: + array = new Uint32Array(1); + break; + case glsVertexArrayTests.deArray.InputType.HALF: + array = new Uint16Array(1); + value = glsVertexArrayTests.GLValue.floatToHalf(value); + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10: + array = new Uint32Array(1); + break; + case glsVertexArrayTests.deArray.InputType.INT_2_10_10_10: + array = new Int32Array(1); + break; + default: + throw new Error('glsVertexArrayTests.GLValue.typeToTypedArray - Invalid InputType'); + } + + array[0] = value; + return array; + }; + + /** + * glsVertexArrayTests.GLValue.create + * @param {number} value + * @param {glsVertexArrayTests.deArray.InputType} type + */ + glsVertexArrayTests.GLValue.create = function(value, type) { + var v = new glsVertexArrayTests.GLValue(); + v.m_value = glsVertexArrayTests.GLValue.typeToTypedArray(value, type); + v.m_type = type; + return v; + }; + + /** + * glsVertexArrayTests.GLValue.halfToFloat + * @param {number} value + * @return {number} + */ + glsVertexArrayTests.GLValue.halfToFloat = function(value) { + return tcuFloat.halfFloatToNumberNoDenorm(value); + }; + + /** + * @param {number} f + * @return {number} + */ + glsVertexArrayTests.GLValue.floatToHalf = function(f) { + // No denorm support. + return tcuFloat.numberToHalfFloatNoDenorm(f); + }; + + /** + * glsVertexArrayTests.GLValue.getMaxValue + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.getMaxValue = function(type) { + var value; + + switch (type) { + case glsVertexArrayTests.deArray.InputType.FLOAT: + value = 127; + break; + /*case glsVertexArrayTests.deArray.InputType.FIXED: + value = 32760; + break; + case glsVertexArrayTests.deArray.InputType.DOUBLE: + value = 127; + break;*/ + case glsVertexArrayTests.deArray.InputType.BYTE: + value = 127; + break; + case glsVertexArrayTests.deArray.InputType.SHORT: + value = 32760; + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE: + value = 255; + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT: + value = 65530; + break; + case glsVertexArrayTests.deArray.InputType.INT: + value = 2147483647; + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: + value = 4294967295; + break; + case glsVertexArrayTests.deArray.InputType.HALF: + value = 256; + break; + default: //Original code returns garbage-filled GLValues + return new glsVertexArrayTests.GLValue(); + } + + return glsVertexArrayTests.GLValue.create(value, type); + }; + + /** + * glsVertexArrayTests.GLValue.getMinValue + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.getMinValue = function(type) { + var value; + + switch (type) { + case glsVertexArrayTests.deArray.InputType.FLOAT: + value = -127; + break; + /*case glsVertexArrayTests.deArray.InputType.FIXED: + value = -32760; + break; + case glsVertexArrayTests.deArray.InputType.DOUBLE: + value = -127; + break;*/ + case glsVertexArrayTests.deArray.InputType.BYTE: + value = -127; + break; + case glsVertexArrayTests.deArray.InputType.SHORT: + value = -32760; + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE: + value = 0; + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT: + value = 0; + break; + case glsVertexArrayTests.deArray.InputType.INT: + value = -2147483647; + break; + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: + value = 0; + break; + case glsVertexArrayTests.deArray.InputType.HALF: + value = -256; + break; + + default: //Original code returns garbage-filled GLValues + return new glsVertexArrayTests.GLValue(); + } + + return glsVertexArrayTests.GLValue.create(value, type); + }; + + /** + * glsVertexArrayTests.GLValue.getRandom + * @param {deRandom.Random} rnd + * @param {glsVertexArrayTests.GLValue} min + * @param {glsVertexArrayTests.GLValue} max + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.getRandom = function(rnd, min, max) { + DE_ASSERT(min.getType() == max.getType()); + + var minv = min.interpret(); + var maxv = max.interpret(); + var type = min.getType(); + var value; + + if (maxv < minv) + return min; + + switch (type) { + case glsVertexArrayTests.deArray.InputType.FLOAT: + //case glsVertexArrayTests.deArray.InputType.DOUBLE: + case glsVertexArrayTests.deArray.InputType.HALF: { + return glsVertexArrayTests.GLValue.create(minv + rnd.getFloat() * (maxv - minv), type); + break; + } + + /*case glsVertexArrayTests.deArray.InputType.FIXED: { + return minv == maxv ? min : glsVertexArrayTests.GLValue.create(minv + rnd.getInt() % (maxv - minv), type); + break; + }*/ + + case glsVertexArrayTests.deArray.InputType.SHORT: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT: + case glsVertexArrayTests.deArray.InputType.BYTE: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE: + case glsVertexArrayTests.deArray.InputType.INT: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: { + return glsVertexArrayTests.GLValue.create(minv + rnd.getInt() % (maxv - minv), type); + break; + } + + default: + throw new Error('glsVertexArrayTests.GLValue.getRandom - Invalid input type'); + break; + } + }; + + // Minimum difference required between coordinates + + /** + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.minValue = function(type) { + switch (type) { + case glsVertexArrayTests.deArray.InputType.FLOAT: + case glsVertexArrayTests.deArray.InputType.BYTE: + case glsVertexArrayTests.deArray.InputType.HALF: + //case glsVertexArrayTests.deArray.InputType.DOUBLE: + return glsVertexArrayTests.GLValue.create(4, type); + case glsVertexArrayTests.deArray.InputType.SHORT: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT: + return glsVertexArrayTests.GLValue.create(4 * 256, type); + case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE: + return glsVertexArrayTests.GLValue.create(4 * 2, type); + /*case glsVertexArrayTests.deArray.InputType.FIXED: + return glsVertexArrayTests.GLValue.create(4 * 512, type);*/ + case glsVertexArrayTests.deArray.InputType.INT: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: + return glsVertexArrayTests.GLValue.create(4 * 16777216, type); + + default: + throw new Error('glsVertexArrayTests.GLValue.minValue - Invalid input type'); + } + }; + + /** + * @param {glsVertexArrayTests.GLValue} val + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.abs = function(val) { + var type = val.getType(); + switch (type) { + //case glsVertexArrayTests.deArray.InputType.FIXED: + case glsVertexArrayTests.deArray.InputType.SHORT: + return glsVertexArrayTests.GLValue.create(0x7FFF & val.getValue(), type); + case glsVertexArrayTests.deArray.InputType.BYTE: + return glsVertexArrayTests.GLValue.create(0x7F & val.getValue(), type); + case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: + return val; + case glsVertexArrayTests.deArray.InputType.FLOAT: + case glsVertexArrayTests.deArray.InputType.HALF: + //case glsVertexArrayTests.deArray.InputType.DOUBLE: + return glsVertexArrayTests.GLValue.create(Math.abs(val.interpret()), type); + case glsVertexArrayTests.deArray.InputType.INT: + return glsVertexArrayTests.GLValue.create(0x7FFFFFFF & val.getValue(), type); + default: + throw new Error('glsVertexArrayTests.GLValue.abs - Invalid input type'); + } + }; + + /** + * @return {glsVertexArrayTests.deArray.InputType} + */ + glsVertexArrayTests.GLValue.prototype.getType = function() { + return this.m_type; + }; + + /** + * glsVertexArrayTests.GLValue.toFloat + * @return {number} + */ + glsVertexArrayTests.GLValue.prototype.toFloat = function() { + return this.interpret(); + }; + + /** + * glsVertexArrayTests.GLValue.getValue + * @return {number} + */ + glsVertexArrayTests.GLValue.prototype.getValue = function() { + return this.m_value[0]; + }; + + /** + * interpret function. Returns the m_value as a quantity so arithmetic operations can be performed on it + * Only some types require this. + * @return {number} + */ + glsVertexArrayTests.GLValue.prototype.interpret = function() { + if (this.m_type == glsVertexArrayTests.deArray.InputType.HALF) + return glsVertexArrayTests.GLValue.halfToFloat(this.m_value[0]); + /*else if (this.m_type == glsVertexArrayTests.deArray.InputType.FIXED) { + var maxValue = 65536; + return Math.floor((2 * this.m_value[0] + 1) / (maxValue - 1)); + }*/ + + return this.m_value[0]; + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.add = function(other) { + return glsVertexArrayTests.GLValue.create(this.interpret() + other.interpret(), this.m_type); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.mul = function(other) { + return glsVertexArrayTests.GLValue.create(this.interpret() * other.interpret(), this.m_type); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.div = function(other) { + return glsVertexArrayTests.GLValue.create(this.interpret() / other.interpret(), this.m_type); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.sub = function(other) { + return glsVertexArrayTests.GLValue.create(this.interpret() - other.interpret(), this.m_type); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.addToSelf = function(other) { + this.m_value[0] = this.interpret() + other.interpret(); + return this; + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.subToSelf = function(other) { + this.m_value[0] = this.interpret() - other.interpret(); + return this; + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.mulToSelf = function(other) { + this.m_value[0] = this.interpret() * other.interpret(); + return this; + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {glsVertexArrayTests.GLValue} + */ + glsVertexArrayTests.GLValue.prototype.divToSelf = function(other) { + this.m_value[0] = this.interpret() / other.interpret(); + return this; + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {boolean} + */ + glsVertexArrayTests.GLValue.prototype.equals = function(other) { + return this.m_value[0] == other.getValue(); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {boolean} + */ + glsVertexArrayTests.GLValue.prototype.lessThan = function(other) { + return this.interpret() < other.interpret(); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {boolean} + */ + glsVertexArrayTests.GLValue.prototype.greaterThan = function(other) { + return this.interpret() > other.interpret(); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {boolean} + */ + glsVertexArrayTests.GLValue.prototype.lessOrEqualThan = function(other) { + return this.interpret() <= other.interpret(); + }; + + /** + * @param {glsVertexArrayTests.GLValue} other + * @return {boolean} + */ + glsVertexArrayTests.GLValue.prototype.greaterOrEqualThan = function(other) { + return this.interpret() >= other.interpret(); + }; + + /** + * glsVertexArrayTests.RandomArrayGenerator class. Contains static methods only + */ + glsVertexArrayTests.RandomArrayGenerator = function() {}; + + /** + * glsVertexArrayTests.RandomArrayGenerator.setData + * @param {Uint8Array} data + * @param {glsVertexArrayTests.deArray.InputType} type + * @param {deRandom.Random} rnd + * @param {glsVertexArrayTests.GLValue} min + * @param {glsVertexArrayTests.GLValue} max + */ + glsVertexArrayTests.RandomArrayGenerator.setData = function(data, type, rnd, min, max) { + // Parameter type is not necessary, but we'll use it to assert the created glsVertexArrayTests.GLValue is of the correct type. + /** @type {glsVertexArrayTests.GLValue} */ var value = glsVertexArrayTests.GLValue.getRandom(rnd, min, max); + DE_ASSERT(value.getType() == type); + + glsVertexArrayTests.copyGLValueToArray(data, value); + }; + + /** + * generateArray + * @param {number} seed + * @param {glsVertexArrayTests.GLValue} min + * @param {glsVertexArrayTests.GLValue} max + * @param {number} count + * @param {number} componentCount + * @param {number} stride + * @param {glsVertexArrayTests.deArray.InputType} type + * @return {ArrayBuffer} + */ + glsVertexArrayTests.RandomArrayGenerator.generateArray = function(seed, min, max, count, componentCount, stride, type) { + /** @type {ArrayBuffer} */ var data; + /** @type {Uint8Array} */ var data8; + + var rnd = new deRandom.Random(seed); + + if (stride == 0) + stride = componentCount * glsVertexArrayTests.deArray.inputTypeSize(type); + + data = new ArrayBuffer(stride * count); + data8 = new Uint8Array(data); + + for (var vertexNdx = 0; vertexNdx < count; vertexNdx++) { + for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) { + glsVertexArrayTests.RandomArrayGenerator.setData(data8.subarray(vertexNdx * stride + glsVertexArrayTests.deArray.inputTypeSize(type) * componentNdx), type, rnd, min, max); + } + } + + return data; + }; + + /* { + static char* generateQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, Array::InputType type, glsVertexArrayTests.GLValue min, glsVertexArrayTests.GLValue max); + static char* generatePerQuad (int seed, int count, int componentCount, int stride, Array::Primitive primitive, Array::InputType type, glsVertexArrayTests.GLValue min, glsVertexArrayTests.GLValue max); + + private: + template + static char* createQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, T min, T max); + template + static char* createPerQuads (int seed, int count, int componentCount, int stride, Array::Primitive primitive, T min, T max); + static char* createQuadsPacked (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive); + };*/ + + /** + * @param {number} seed + * @param {number} count + * @param {number} componentCount + * @param {number} offset + * @param {number} stride + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @param {glsVertexArrayTests.deArray.InputType} type + * @param {glsVertexArrayTests.GLValue} min + * @param {glsVertexArrayTests.GLValue} max + * @param {number} scale Coordinate scaling factor + * @return {ArrayBuffer} + */ + glsVertexArrayTests.RandomArrayGenerator.generateQuads = function(seed, count, componentCount, offset, stride, primitive, type, min, max, scale) { + /** @type {ArrayBuffer} */ var data; + + switch (type) { + case glsVertexArrayTests.deArray.InputType.FLOAT: + /*case glsVertexArrayTests.deArray.InputType.FIXED: + case glsVertexArrayTests.deArray.InputType.DOUBLE:*/ + case glsVertexArrayTests.deArray.InputType.BYTE: + case glsVertexArrayTests.deArray.InputType.SHORT: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: + case glsVertexArrayTests.deArray.InputType.INT: + case glsVertexArrayTests.deArray.InputType.HALF: + data = glsVertexArrayTests.RandomArrayGenerator.createQuads(seed, count, componentCount, offset, stride, primitive, min, max, scale); + break; + + case glsVertexArrayTests.deArray.InputType.INT_2_10_10_10: + case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10: + data = glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked(seed, count, componentCount, offset, stride, primitive); + break; + + default: + throw new Error('glsVertexArrayTests.RandomArrayGenerator.generateQuads - Invalid input type'); + break; + } + + return data; + }; + + /** + * @param {number} seed + * @param {number} count + * @param {number} componentCount + * @param {number} offset + * @param {number} stride + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @return {ArrayBuffer} + */ + glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked = function(seed, count, componentCount, offset, stride, primitive) { + DE_ASSERT(componentCount == 4); + + /** @type {number} */ var quadStride = 0; + + if (stride == 0) + stride = deMath.INT32_SIZE; + + switch (primitive) { + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: + quadStride = stride * 6; + break; + + default: + throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked - Invalid primitive'); + break; + } + + /** @type {ArrayBuffer} */ var _data = new ArrayBuffer(offset + quadStride * (count - 1) + stride * 5 + componentCount * glsVertexArrayTests.deArray.inputTypeSize(glsVertexArrayTests.deArray.InputType.INT_2_10_10_10)); // last element must be fully in the array + /** @type {Uint8Array} */ var resultData = new Uint8Array(_data).subarray(offset); + + /** @type {number} */ var max = 1024; + /** @type {number} */ var min = 10; + /** @type {number} */ var max2 = 4; + + var rnd = new deRandom.Random(seed); + + switch (primitive) { + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: { + for (var quadNdx = 0; quadNdx < count; quadNdx++) { + /** @type {number} */ var x1 = min + rnd.getInt() % (max - min); + /** @type {number} */ var x2 = min + rnd.getInt() % (max - x1); + + /** @type {number} */ var y1 = min + rnd.getInt() % (max - min); + /** @type {number} */ var y2 = min + rnd.getInt() % (max - y1); + + /** @type {number} */ var z = min + rnd.getInt() % (max - min); + /** @type {number} */ var w = rnd.getInt() % max2; + + /** @type {number} */ var val1 = (w << 30) | (z << 20) | (y1 << 10) | x1; + /** @type {number} */ var val2 = (w << 30) | (z << 20) | (y1 << 10) | x2; + /** @type {number} */ var val3 = (w << 30) | (z << 20) | (y2 << 10) | x1; + + /** @type {number} */ var val4 = (w << 30) | (z << 20) | (y2 << 10) | x1; + /** @type {number} */ var val5 = (w << 30) | (z << 20) | (y1 << 10) | x2; + /** @type {number} */ var val6 = (w << 30) | (z << 20) | (y2 << 10) | x2; + + glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 0), new Uint32Array([val1])); + glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 1), new Uint32Array([val2])); + glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 2), new Uint32Array([val3])); + glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 3), new Uint32Array([val4])); + glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 4), new Uint32Array([val5])); + glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 5), new Uint32Array([val6])); + } + + break; + } + + default: + throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked - Invalid primitive'); + break; + } + + return _data; + }; + + /** + * @param {number} seed + * @param {number} count + * @param {number} componentCount + * @param {number} offset + * @param {number} stride + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @param {glsVertexArrayTests.GLValue} min + * @param {glsVertexArrayTests.GLValue} max + * @param {number} scale Coordinate scaling factor + * @return {ArrayBuffer} + */ + glsVertexArrayTests.RandomArrayGenerator.createQuads = function(seed, count, componentCount, offset, stride, primitive, min, max, scale) { + var componentStride = min.m_value.byteLength; //TODO: Fix encapsulation issue + var quadStride = 0; + var type = min.getType(); //Instead of using the template parameter. + + if (stride == 0) + stride = componentCount * componentStride; + DE_ASSERT(stride >= componentCount * componentStride); + + switch (primitive) { + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: + quadStride = stride * 6; + break; + + default: + throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuads - Invalid primitive'); + break; + } + + /** @type {ArrayBuffer} */ var _data = new ArrayBuffer(offset + quadStride * count); + /** @type {Uint8Array} */ var resultData = new Uint8Array(_data).subarray(offset); + + var rnd = new deRandom.Random(seed); + + switch (primitive) { + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: { + for (var quadNdx = 0; quadNdx < count; ++quadNdx) { + /** @type {glsVertexArrayTests.GLValue} */ var x1 = null; + /** @type {glsVertexArrayTests.GLValue} */ var x2 = null; + /** @type {glsVertexArrayTests.GLValue} */ var y1 = null; + /** @type {glsVertexArrayTests.GLValue} */ var y2 = null; + /** @type {glsVertexArrayTests.GLValue} */ var z = null; + /** @type {glsVertexArrayTests.GLValue} */ var w = null; + + // attempt to find a good (i.e not extremely small) quad + for (var attemptNdx = 0; attemptNdx < 4; ++attemptNdx) { + x1 = glsVertexArrayTests.GLValue.getRandom(rnd, min, max); + x2 = glsVertexArrayTests.GLValue.getRandom(rnd, glsVertexArrayTests.GLValue.minValue(type), glsVertexArrayTests.GLValue.abs(max.sub(x1))); + + y1 = glsVertexArrayTests.GLValue.getRandom(rnd, min, max); + y2 = glsVertexArrayTests.GLValue.getRandom(rnd, glsVertexArrayTests.GLValue.minValue(type), glsVertexArrayTests.GLValue.abs(max.sub(y1))); + + z = (componentCount > 2) ? (glsVertexArrayTests.GLValue.getRandom(rnd, min, max)) : (glsVertexArrayTests.GLValue.create(0, type)); + w = (componentCount > 3) ? (glsVertexArrayTests.GLValue.getRandom(rnd, min, max)) : (glsVertexArrayTests.GLValue.create(1, type)); + + // no additional components, all is good + if (componentCount <= 2) + break; + + // The result quad is too thin? + if ((Math.abs(x2.interpret() + z.interpret()) < glsVertexArrayTests.GLValue.minValue(type).interpret()) || + (Math.abs(y2.interpret() + w.interpret()) < glsVertexArrayTests.GLValue.minValue(type).interpret())) + continue; + + // all ok + break; + } + + x2 = x1.add(x2); + y2 = y1.add(y2); + + /** + * Transform GL vertex coordinates so that after vertex shading the vertices will be rounded. + * We want to avoid quads that cover a pixel partially + */ + var round = function(pos, scale, offset, range) { + // Perform the same transformation as the vertex shader + var val = (pos.interpret() + offset) * scale; + var half = range / 2; + val = val * half + half; + // Round it + val = Math.round(val); + // And reverse the vertex shading transformation + val = (val - half) / half; + val = val / scale - offset; + return glsVertexArrayTests.GLValue.create(val, pos.m_type); + }; + + var viewport = gl.getParameter(gl.VIEWPORT); + var voffset = 0; + if (componentCount > 2) + voffset = z.interpret(); + x1 = round(x1, scale, voffset, viewport[2]); + x2 = round(x2, scale, voffset, viewport[2]); + voffset = 1; + if (componentCount > 3) + voffset = w.interpret(); + y1 = round(y1, scale, voffset, viewport[3]); + y2 = round(y2, scale, voffset, viewport[3]); + + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride), x1); + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + componentStride), y1); + + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride), x2); + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride + componentStride), y1); + + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 2), x1); + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 2 + componentStride), y2); + + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 3), x1); + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 3 + componentStride), y2); + + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 4), x2); + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 4 + componentStride), y1); + + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 5), x2); + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 5 + componentStride), y2); + + if (componentCount > 2) { + for (var i = 0; i < 6; i++) + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * i + componentStride * 2), z); + } + + if (componentCount > 3) { + for (var i = 0; i < 6; i++) + glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * i + componentStride * 3), w); + } + } + + break; + } + + default: + throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuads - Invalid primitive'); + break; + } + + return _data; + }; + + /** + * @param {number} seed + * @param {number} count + * @param {number} componentCount + * @param {number} stride + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @param {glsVertexArrayTests.deArray.InputType} type + * @param {glsVertexArrayTests.GLValue} min + * @param {glsVertexArrayTests.GLValue} max + */ + glsVertexArrayTests.RandomArrayGenerator.generatePerQuad = function(seed, count, componentCount, stride, primitive, type, min, max) { + /** @type {ArrayBuffer} */ var data = null; + + data = glsVertexArrayTests.RandomArrayGenerator.createPerQuads(seed, count, componentCount, stride, primitive, min, max); + return data; + }; + + /** + * @param {number} seed + * @param {number} count + * @param {number} componentCount + * @param {number} stride + * @param {glsVertexArrayTests.deArray.Primitive} primitive + * @param {glsVertexArrayTests.GLValue} min + * @param {glsVertexArrayTests.GLValue} max + */ + glsVertexArrayTests.RandomArrayGenerator.createPerQuads = function(seed, count, componentCount, stride, primitive, min, max) { + var rnd = new deRandom.Random(seed); + + var componentStride = min.m_value.byteLength; //TODO: Fix encapsulation issue. + + if (stride == 0) + stride = componentStride * componentCount; + + var quadStride = 0; + + switch (primitive) { + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: + quadStride = stride * 6; + break; + + default: + throw new Error('glsVertexArrayTests.RandomArrayGenerator.createPerQuads - Invalid primitive'); + break; + } + + /** @type {ArrayBuffer} */ var data = new ArrayBuffer(count * quadStride); + + for (var quadNdx = 0; quadNdx < count; quadNdx++) { + for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) { + /** @type {glsVertexArrayTests.GLValue} */ var val = glsVertexArrayTests.GLValue.getRandom(rnd, min, max); + + var data8 = new Uint8Array(data); + glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 0 + componentStride * componentNdx), val); + glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 1 + componentStride * componentNdx), val); + glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 2 + componentStride * componentNdx), val); + glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 3 + componentStride * componentNdx), val); + glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 4 + componentStride * componentNdx), val); + glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 5 + componentStride * componentNdx), val); + } + } + + return data; + }; + + /** + * class glsVertexArrayTests.VertexArrayTest + * @constructor + * @extends {tcuTestCase.DeqpTest} + * @param {string} name + * @param {string} description + */ + glsVertexArrayTests.VertexArrayTest = function(name, description) { + tcuTestCase.DeqpTest.call(this, name, description); + + var r = /** @type {number} */ (gl.getParameter(gl.RED_BITS)); + var g = /** @type {number} */ (gl.getParameter(gl.GREEN_BITS)); + var b = /** @type {number} */ (gl.getParameter(gl.BLUE_BITS)); + var a = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS)); + this.m_pixelformat = new tcuPixelFormat.PixelFormat(r, g, b, a); + + /** @type {sglrReferenceContext.ReferenceContextBuffers} */ this.m_refBuffers = null; + /** @type {sglrReferenceContext.ReferenceContext} */ this.m_refContext = null; + /** @type {sglrGLContext.GLContext} */ this.m_glesContext = null; + /** @type {glsVertexArrayTests.ContextArrayPack} */ this.m_glArrayPack = null; + /** @type {glsVertexArrayTests.ContextArrayPack} */ this.m_rrArrayPack = null; + /** @type {boolean} */ this.m_isOk = false; + /** @type {number} */ this.m_maxDiffRed = Math.ceil(256.0 * (2.0 / (1 << this.m_pixelformat.redBits))); + /** @type {number} */ this.m_maxDiffGreen = Math.ceil(256.0 * (2.0 / (1 << this.m_pixelformat.greenBits))); + /** @type {number} */ this.m_maxDiffBlue = Math.ceil(256.0 * (2.0 / (1 << this.m_pixelformat.blueBits))); + }; + + glsVertexArrayTests.VertexArrayTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype); + glsVertexArrayTests.VertexArrayTest.prototype.constructor = glsVertexArrayTests.VertexArrayTest; + + /** + * init + */ + glsVertexArrayTests.VertexArrayTest.prototype.init = function() { + /** @type {number}*/ var renderTargetWidth = Math.min(512, canvas.width); + /** @type {number}*/ var renderTargetHeight = Math.min(512, canvas.height); + /** @type {sglrReferenceContext.ReferenceContextLimits} */ var limits = new sglrReferenceContext.ReferenceContextLimits(gl); + + this.m_glesContext = new sglrGLContext.GLContext(gl); + this.m_refBuffers = new sglrReferenceContext.ReferenceContextBuffers(this.m_pixelformat, 0, 0, renderTargetWidth, renderTargetHeight); + this.m_refContext = new sglrReferenceContext.ReferenceContext(limits, this.m_refBuffers.getColorbuffer(), this.m_refBuffers.getDepthbuffer(), this.m_refBuffers.getStencilbuffer()); + + this.m_glArrayPack = new glsVertexArrayTests.ContextArrayPack(this.m_glesContext); + this.m_rrArrayPack = new glsVertexArrayTests.ContextArrayPack(this.m_refContext); + }; + + /** + * compare + */ + glsVertexArrayTests.VertexArrayTest.prototype.compare = function() { + /** @type {tcuSurface.Surface} */ var ref = this.m_rrArrayPack.getSurface(); + /** @type {tcuSurface.Surface} */ var screen = this.m_glArrayPack.getSurface(); + + if (/** @type {number} */ (this.m_glesContext.getParameter(gl.SAMPLES)) > 1) { + // \todo [mika] Improve compare when using multisampling + bufferedLogToConsole('Warning: Comparison of result from multisample render targets are not as strict as without multisampling. Might produce false positives!'); + this.m_isOk = tcuImageCompare.fuzzyCompare('Compare Results', 'Compare Results', ref.getAccess(), screen.getAccess(), 1.5); + } else { + /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue, 255); + /** @type {tcuSurface.Surface} */ var error = new tcuSurface.Surface(ref.getWidth(), ref.getHeight()); + + this.m_isOk = true; + + for (var y = 1; y < ref.getHeight() - 1; y++) { + for (var x = 1; x < ref.getWidth() - 1; x++) { + /** @type {tcuRGBA.RGBA} */ var refPixel = tcuRGBA.newRGBAFromArray(ref.getPixel(x, y)); + /** @type {tcuRGBA.RGBA} */ var screenPixel = tcuRGBA.newRGBAFromArray(screen.getPixel(x, y)); + /** @type {boolean} */ var isOkPixel = false; + + // Don't do comparisons for this pixel if it belongs to a one-pixel-thin part (i.e. it doesn't have similar-color neighbors in both x and y directions) in both result and reference. + // This fixes some false negatives. + /** @type {boolean} */ var refThin = ( + !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x - 1, y)), threshold) && + !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x + 1, y)), threshold) + ) || ( + !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x, y - 1)), threshold) && + !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x, y + 1)), threshold) + ); + + /** @type {boolean} */ var screenThin = ( + !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x - 1, y)), threshold) && + !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x + 1, y)), threshold) + ) || ( + !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x, y - 1)), threshold) && + !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x, y + 1)), threshold) + ); + + if (refThin && screenThin) + isOkPixel = true; + else { + //NOTE: This will ignore lines less than three pixels wide, so + //even if there's a difference, the test will pass. + for (var dy = -1; dy < 2 && !isOkPixel; dy++) { + for (var dx = -1; dx < 2 && !isOkPixel; dx++) { + // Check reference pixel against screen pixel + /** @type {tcuRGBA.RGBA} */ var screenCmpPixel = tcuRGBA.newRGBAFromArray(screen.getPixel(x + dx, y + dy)); + /** @type {number} (8-bit) */ var r = Math.abs(refPixel.getRed() - screenCmpPixel.getRed()); + /** @type {number} (8-bit) */ var g = Math.abs(refPixel.getGreen() - screenCmpPixel.getGreen()); + /** @type {number} (8-bit) */ var b = Math.abs(refPixel.getBlue() - screenCmpPixel.getBlue()); + + if (r <= this.m_maxDiffRed && g <= this.m_maxDiffGreen && b <= this.m_maxDiffBlue) + isOkPixel = true; + + // Check screen pixels against reference pixel + /** @type {tcuRGBA.RGBA} */ var refCmpPixel = tcuRGBA.newRGBAFromArray(ref.getPixel(x + dx, y + dy)); + r = Math.abs(refCmpPixel.getRed() - screenPixel.getRed()); + g = Math.abs(refCmpPixel.getGreen() - screenPixel.getGreen()); + b = Math.abs(refCmpPixel.getBlue() - screenPixel.getBlue()); + + if (r <= this.m_maxDiffRed && g <= this.m_maxDiffGreen && b <= this.m_maxDiffBlue) + isOkPixel = true; + } + } + } + + if (isOkPixel) + error.setPixel(x, y, + [tcuRGBA.newRGBAFromArray(screen.getPixel(x, y)).getRed(), + (tcuRGBA.newRGBAFromArray(screen.getPixel(x, y)).getGreen() + 255) / 2, + tcuRGBA.newRGBAFromArray(screen.getPixel(x, y)).getBlue(), 255] + ); + else { + error.setPixel(x, y, [255, 0, 0, 255]); + this.m_isOk = false; + } + } + } + + if (!this.m_isOk) { + debug('Image comparison failed, threshold = (' + this.m_maxDiffRed + ', ' + this.m_maxDiffGreen + ', ' + this.m_maxDiffBlue + ')'); + //log << TestLog::ImageSet("Compare result", "Result of rendering"); + tcuImageCompare.displayImages(screen.getAccess(), ref.getAccess(), error.getAccess()); + } else { + //log << TestLog::ImageSet("Compare result", "Result of rendering") + tcuLogImage.logImage('Result', '', screen.getAccess()); + } + } + }; + + //TODO: Is this actually used? -> glsVertexArrayTests.VertexArrayTest& operator= (const glsVertexArrayTests.VertexArrayTest& other); + + /** + * glsVertexArrayTests.MultiVertexArrayTest class + * @constructor + * @extends {glsVertexArrayTests.VertexArrayTest} + * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec + * @param {string} name + * @param {string} desc + */ + glsVertexArrayTests.MultiVertexArrayTest = function(spec, name, desc) { + glsVertexArrayTests.VertexArrayTest.call(this, name, desc); + + /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec} */ this.m_spec = spec; + /** @type {number} */ this.m_iteration = 0; + }; + + glsVertexArrayTests.MultiVertexArrayTest.prototype = Object.create(glsVertexArrayTests.VertexArrayTest.prototype); + glsVertexArrayTests.MultiVertexArrayTest.prototype.constructor = glsVertexArrayTests.MultiVertexArrayTest; + + /** + * glsVertexArrayTests.MultiVertexArrayTest.Spec class + * @constructor + */ + glsVertexArrayTests.MultiVertexArrayTest.Spec = function() { + /** @type {glsVertexArrayTests.deArray.Primitive} */ this.primitive; + /** @type {number} */ this.drawCount = 0; + /** @type {number} */ this.first = 0; + /** @type {Array} */ this.arrays = []; + }; + + /** + * glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec class + * @constructor + * @param {glsVertexArrayTests.deArray.InputType} inputType_ + * @param {glsVertexArrayTests.deArray.OutputType} outputType_ + * @param {glsVertexArrayTests.deArray.Storage} storage_ + * @param {glsVertexArrayTests.deArray.Usage} usage_ + * @param {number} componentCount_ + * @param {number} offset_ + * @param {number} stride_ + * @param {boolean} normalize_ + * @param {glsVertexArrayTests.GLValue} min_ + * @param {glsVertexArrayTests.GLValue} max_ + */ + glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec = function(inputType_, outputType_, storage_, usage_, componentCount_, offset_, stride_, normalize_, min_, max_) { + this.inputType = inputType_; + this.outputType = outputType_; + this.storage = storage_; + this.usage = usage_; + this.componentCount = componentCount_; + this.offset = offset_; + /** @type {number} */ this.stride = stride_; + this.normalize = normalize_; + this.min = min_; + this.max = max_; + }; + + /** + * getName + * @return {string} + */ + glsVertexArrayTests.MultiVertexArrayTest.Spec.prototype.getName = function() { + var name = ''; + + for (var ndx = 0; ndx < this.arrays.length; ++ndx) { + /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var array = this.arrays[ndx]; + + if (this.arrays.length > 1) + name += 'array' + ndx + '_'; + + name += glsVertexArrayTests.deArray.storageToString(array.storage) + '_' + + array.offset + '_' + + array.stride + '_' + + glsVertexArrayTests.deArray.inputTypeToString(array.inputType); + + if (array.inputType != glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 && array.inputType != glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) + name += array.componentCount; + name += '_' + + (array.normalize ? 'normalized_' : '') + + glsVertexArrayTests.deArray.outputTypeToString(array.outputType) + '_' + + glsVertexArrayTests.deArray.usageTypeToString(array.usage) + '_'; + } + + if (this.first) + name += 'first' + this.first + '_'; + + switch (this.primitive) { + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: + name += 'quads_'; + break; + case glsVertexArrayTests.deArray.Primitive.POINTS: + name += 'points_'; + break; + + default: + throw new Error('glsVertexArrayTests.MultiVertexArrayTest.Spec.getName - Invalid primitive type'); + break; + } + + name += this.drawCount; + + return name; + }; + + /** + * getName + * @return {string} + */ + glsVertexArrayTests.MultiVertexArrayTest.Spec.prototype.getDesc = function() { + var desc = ''; + + for (var ndx = 0; ndx < this.arrays.length; ++ndx) { + /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var array = this.arrays[ndx]; + + desc += 'Array ' + ndx + ': ' + + 'Storage in ' + glsVertexArrayTests.deArray.storageToString(array.storage) + ', ' + + 'stride ' + array.stride + ', ' + + 'input datatype ' + glsVertexArrayTests.deArray.inputTypeToString(array.inputType) + ', ' + + 'input component count ' + array.componentCount + ', ' + + (array.normalize ? 'normalized, ' : '') + + 'used as ' + glsVertexArrayTests.deArray.outputTypeToString(array.outputType) + ', '; + } + + desc += 'drawArrays(), ' + + 'first ' + this.first + ', ' + + this.drawCount; + + switch (this.primitive) { + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: + desc += 'quads '; + break; + case glsVertexArrayTests.deArray.Primitive.POINTS: + desc += 'points'; + break; + + default: + throw new Error('glsVertexArrayTests.MultiVertexArrayTest.Spec.getDesc - Invalid primitive type'); + break; + } + + return desc; + }; + + /** + * iterate + * @return {tcuTestCase.IterateResult} + */ + glsVertexArrayTests.MultiVertexArrayTest.prototype.iterate = function() { + if (this.m_iteration == 0) { + var primitiveSize = (this.m_spec.primitive == glsVertexArrayTests.deArray.Primitive.TRIANGLES) ? (6) : (1); // in non-indexed draw Triangles means rectangles + var coordScale = 1.0; + var colorScale = 1.0; + var useVao = true; // WebGL, WebGL 2.0 - gl.getType().getProfile() == glu::PROFILE_CORE; + + // Log info + bufferedLogToConsole(this.m_spec.getDesc()); + + // Color and Coord scale + + // First array is always position + /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var arraySpec = this.m_spec.arrays[0]; + if (arraySpec.inputType == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10) { + if (arraySpec.normalize) + coordScale = 1; + else + coordScale = 1 / 1024; + } else if (arraySpec.inputType == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) { + if (arraySpec.normalize) + coordScale = 1.0; + else + coordScale = 1.0 / 512.0; + } else + coordScale = arraySpec.normalize && !glsVertexArrayTests.inputTypeIsFloatType(arraySpec.inputType) ? 1.0 : 0.9 / arraySpec.max.toFloat(); + + if (arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.VEC3 || arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.VEC4 || + arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.IVEC3 || arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.IVEC4 || + arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.UVEC3 || arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.UVEC4) + coordScale = coordScale * 0.5; + + // And other arrays are color-like + for (var arrayNdx = 1; arrayNdx < this.m_spec.arrays.length; arrayNdx++) { + arraySpec = this.m_spec.arrays[arrayNdx]; + + colorScale *= (arraySpec.normalize && !glsVertexArrayTests.inputTypeIsFloatType(arraySpec.inputType) ? 1.0 : 1.0 / arraySpec.max.toFloat()); + if (arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.VEC4) + colorScale *= (arraySpec.normalize && !glsVertexArrayTests.inputTypeIsFloatType(arraySpec.inputType) ? 1.0 : 1.0 / arraySpec.max.toFloat()); + } + + // Data + + for (var arrayNdx = 0; arrayNdx < this.m_spec.arrays.length; arrayNdx++) { + arraySpec = this.m_spec.arrays[arrayNdx]; + /** @type {number} */ var seed = arraySpec.inputType + 10 * arraySpec.outputType + 100 * arraySpec.storage + 1000 * this.m_spec.primitive + 10000 * arraySpec.usage + this.m_spec.drawCount + 12 * arraySpec.componentCount + arraySpec.stride + arraySpec.normalize; + /** @type {ArrayBuffer} */ var data = null; + /** @type {number} */ var stride = arraySpec.stride == 0 ? arraySpec.componentCount * glsVertexArrayTests.deArray.inputTypeSize(arraySpec.inputType) : arraySpec.stride; + /** @type {number} */ var bufferSize = arraySpec.offset + stride * (this.m_spec.drawCount * primitiveSize - 1) + arraySpec.componentCount * glsVertexArrayTests.deArray.inputTypeSize(arraySpec.inputType); + + switch (this.m_spec.primitive) { + // case glsVertexArrayTests.deArray.Primitive.POINTS: + // data = glsVertexArrayTests.RandomArrayGenerator.generateArray(seed, arraySpec.min, arraySpec.max, arraySpec.count, arraySpec.componentCount, arraySpec.stride, arraySpec.inputType); + // break; + case glsVertexArrayTests.deArray.Primitive.TRIANGLES: + if (arrayNdx == 0) { + data = glsVertexArrayTests.RandomArrayGenerator.generateQuads(seed, this.m_spec.drawCount, arraySpec.componentCount, arraySpec.offset, arraySpec.stride, this.m_spec.primitive, arraySpec.inputType, arraySpec.min, arraySpec.max, coordScale); + } else { + DE_ASSERT(arraySpec.offset == 0); // \note [jarkko] it just hasn't been implemented + data = glsVertexArrayTests.RandomArrayGenerator.generatePerQuad(seed, this.m_spec.drawCount, arraySpec.componentCount, arraySpec.stride, this.m_spec.primitive, arraySpec.inputType, arraySpec.min, arraySpec.max); + } + break; + + default: + throw new Error('glsVertexArrayTests.MultiVertexArrayTest.prototype.iterate - Invalid primitive type'); + break; + } + + this.m_glArrayPack.newArray(arraySpec.storage); + this.m_rrArrayPack.newArray(arraySpec.storage); + + this.m_glArrayPack.getArray(arrayNdx).data(glsVertexArrayTests.deArray.Target.ARRAY, bufferSize, new Uint8Array(data), arraySpec.usage); + this.m_rrArrayPack.getArray(arrayNdx).data(glsVertexArrayTests.deArray.Target.ARRAY, bufferSize, new Uint8Array(data), arraySpec.usage); + + this.m_glArrayPack.getArray(arrayNdx).bind(arrayNdx, arraySpec.offset, arraySpec.componentCount, arraySpec.inputType, arraySpec.outputType, arraySpec.normalize, arraySpec.stride); + this.m_rrArrayPack.getArray(arrayNdx).bind(arrayNdx, arraySpec.offset, arraySpec.componentCount, arraySpec.inputType, arraySpec.outputType, arraySpec.normalize, arraySpec.stride); + } + + try { + this.m_glArrayPack.render(this.m_spec.primitive, this.m_spec.first, this.m_spec.drawCount * primitiveSize, useVao, coordScale, colorScale); + this.m_rrArrayPack.render(this.m_spec.primitive, this.m_spec.first, this.m_spec.drawCount * primitiveSize, useVao, coordScale, colorScale); + } + catch (err) { + // GL Errors are ok if the mode is not properly aligned + + bufferedLogToConsole('Got error: ' + err.message); + + if (this.isUnalignedBufferOffsetTest()) + testFailedOptions('Failed to draw with unaligned buffers', false); // TODO: QP_TEST_RESULT_COMPATIBILITY_WARNING + else if (this.isUnalignedBufferStrideTest()) + testFailedOptions('Failed to draw with unaligned stride', false); // QP_TEST_RESULT_COMPATIBILITY_WARNING + else + throw new Error(err.message); + + return tcuTestCase.IterateResult.STOP; + } + + this.m_iteration++; + return tcuTestCase.IterateResult.CONTINUE; + } else if (this.m_iteration == 1) { + this.compare(); + + if (this.m_isOk) { + testPassedOptions('', true); + } else { + if (this.isUnalignedBufferOffsetTest()) + testFailedOptions('Failed to draw with unaligned buffers', false); // QP_TEST_RESULT_COMPATIBILITY_WARNING + else if (this.isUnalignedBufferStrideTest()) + testFailedOptions('Failed to draw with unaligned stride', false); // QP_TEST_RESULT_COMPATIBILITY_WARNING + else + testFailedOptions('Image comparison failed', false); + } + + this.m_iteration++; + return tcuTestCase.IterateResult.STOP; + } else { + testFailedOptions('glsVertexArrayTests.MultiVertexArrayTest.iterate - Invalid iteration stage', false); + return tcuTestCase.IterateResult.STOP; + } + }; + + /** + * isUnalignedBufferOffsetTest + * @return {boolean} + */ + glsVertexArrayTests.MultiVertexArrayTest.prototype.isUnalignedBufferOffsetTest = function() { + // Buffer offsets should be data type size aligned + for (var i = 0; i < this.m_spec.arrays.length; ++i) { + if (this.m_spec.arrays[i].storage == glsVertexArrayTests.deArray.Storage.BUFFER) { + /** @type {boolean} */ var inputTypePacked = this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10; + + /** @type {number} */ var dataTypeSize = glsVertexArrayTests.deArray.inputTypeSize(this.m_spec.arrays[i].inputType); + if (inputTypePacked) + dataTypeSize = 4; + + if (this.m_spec.arrays[i].offset % dataTypeSize != 0) + return true; + } + } + return false; + }; + + /** + * isUnalignedBufferStrideTest + * @return {boolean} + */ + glsVertexArrayTests.MultiVertexArrayTest.prototype.isUnalignedBufferStrideTest = function() { + // Buffer strides should be data type size aligned + for (var i = 0; i < this.m_spec.arrays.length; ++i) { + if (this.m_spec.arrays[i].storage == glsVertexArrayTests.deArray.Storage.BUFFER) { + /** @type {boolean} */ var inputTypePacked = this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10; + + /** @type {number} */ var dataTypeSize = glsVertexArrayTests.deArray.inputTypeSize(this.m_spec.arrays[i].inputType); + if (inputTypePacked) + dataTypeSize = 4; + + if (this.m_spec.arrays[i].stride % dataTypeSize != 0) + return true; + } + } + return false; + }; + +}); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh b/dom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh new file mode 100644 index 000000000..7dcc44c12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Helper script for properly invoking the closure compiler in order to +# type check the ported dEQP tests. +# +# Assumes the Closure compiler: +# https://github.com/google/closure-compiler +# is installed side-by-side with the WebGL repository, for example: +# +# WebGL/ +# doc/ +# extensions/ +# sdk/ +# ... +# closure/ +# compiler.jar +# +# The externs.zip file inside the closure compiler needs to be modified +# to support WebGL2. +# and that the shell is cd'd into the directory containing this +# script. +# + +: ${JAVA:=java} + +$JAVA -jar ../../../../closure/compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs compiler_additional_extern.js --js functional/**.js framework/**.js modules/**.js --js_output_file /dev/null --js ../closure-library/closure/**.js diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js new file mode 100644 index 000000000..7cd036f1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js @@ -0,0 +1,156 @@ +/* + * Copyright 2013 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for globals in Chrome. This file describes the + * externs API for the chrome.* object when running in a normal browser + * context. For APIs available in Chrome Extensions, see chrome_extensions.js + * in this directory. + * @externs + */ + + +/** + * namespace + * @const + */ +var chrome = {}; + + + +/** + * Returns an object representing current load times. Note that the properties + * on the object do not change and the function must be called again to get + * up-to-date data. + * + * @see http://goto.google.com/chromeloadtimesextension + * + * @return {!ChromeLoadTimes} + */ +chrome.loadTimes = function() {}; + + + +/** + * The data object given by chrome.loadTimes(). + * @constructor + */ +function ChromeLoadTimes() {} + + +/** @type {number} */ +ChromeLoadTimes.prototype.requestTime; + + +/** @type {number} */ +ChromeLoadTimes.prototype.startLoadTime; + + +/** @type {number} */ +ChromeLoadTimes.prototype.commitLoadTime; + + +/** @type {number} */ +ChromeLoadTimes.prototype.finishDocumentLoadTime; + + +/** @type {number} */ +ChromeLoadTimes.prototype.finishLoadTime; + + +/** @type {number} */ +ChromeLoadTimes.prototype.firstPaintTime; + + +/** @type {number} */ +ChromeLoadTimes.prototype.firstPaintAfterLoadTime; + + +/** @type {number} */ +ChromeLoadTimes.prototype.navigationType; + + +/** + * True iff the resource was fetched over SPDY. + * @type {boolean} + */ +ChromeLoadTimes.prototype.wasFetchedViaSpdy; + + +/** @type {boolean} */ +ChromeLoadTimes.prototype.wasNpnNegotiated; + + +/** @type {string} */ +ChromeLoadTimes.prototype.npnNegotiatedProtocol; + + +/** @type {boolean} */ +ChromeLoadTimes.prototype.wasAlternateProtocolAvailable; + + +/** @type {string} */ +ChromeLoadTimes.prototype.connectionInfo; + + +/** + * Returns an object containing timing information. + * @return {!ChromeCsiInfo} + */ +chrome.csi = function() {}; + + + +/** + * The data object given by chrome.csi(). + * @constructor + */ +function ChromeCsiInfo() {} + + +/** + * Same as chrome.loadTimes().requestTime, if defined. + * Otherwise, gives the same value as chrome.loadTimes().startLoadTime. + * In milliseconds, truncated. + * @type {number} + */ +ChromeCsiInfo.prototype.startE; + + +/** + * Same as chrome.loadTimes().finishDocumentLoadTime but in milliseconds and + * truncated. + * @type {number} + */ +ChromeCsiInfo.prototype.onloadT; + + +/** + * The time since startE in milliseconds. + * @type {number} + */ +ChromeCsiInfo.prototype.pageT; + + +/** @type {number} */ +ChromeCsiInfo.prototype.tran; + + +/** + * @param {string|!ArrayBuffer|!Object} message + * @see https://developers.google.com/native-client/devguide/tutorial + */ +HTMLEmbedElement.prototype.postMessage = function(message) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js new file mode 100644 index 000000000..9dcf947c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js @@ -0,0 +1,46 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview JavaScript Built-Ins that are not + * part of any specifications but are + * still needed in some project's build. + * @externs + * + */ + +// Do we need an opera.js? +var opera; +Window.prototype.opera; +Window.prototype.opera.postError; + +/** @constructor */ function XSLTProcessor() {} +/** + * @param {*=} opt_text + * @param {*=} opt_value + * @param {*=} opt_defaultSelected + * @param {*=} opt_selected + * @constructor + * @extends {Element} + */ +function Option(opt_text, opt_value, opt_defaultSelected, opt_selected) {} + + +// The "methods" object is a place to hang arbitrary external +// properties. It is a throwback to pre-typed days, and should +// not be used for any new definitions; it exists only to bridge +// the gap between the old way and the new way. +var methods = {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js new file mode 100644 index 000000000..934b1fe2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js @@ -0,0 +1,2236 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview ECMAScript 3 Built-Ins. This include common extensions so this + * is actually ES3+Reality. + * @externs + * @author stevey@google.com (Steve Yegge) + * @author nicksantos@google.com (Nick Santos) + * @author arv@google.com (Erik Arvidsson) + * @author johnlenz@google.com (John Lenz) + */ + + +// These built-ins are still needed for compilation. + +/** + * @constructor + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments + */ +function Arguments() {} + +/** + * @type {Function} + * @see http://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments/callee + */ +Arguments.prototype.callee; + +/** + * Use the non-standard {@see Function.prototype.caller} property of a function + * object instead. + * @type {Function} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions/arguments/caller + * @deprecated + */ +Arguments.prototype.caller; + +/** + * @type {number} + * @see http://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments/length + */ +Arguments.prototype.length; + +/** + * @type {!Arguments} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments + */ +var arguments; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Properties/Infinity + * @const + */ +var Infinity; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Properties/NaN + * @const + */ +var NaN; + +/** + * @type {undefined} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Properties/undefined + * @const + */ +var undefined; + +/** + * @param {string} uri + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURI + */ +function decodeURI(uri) {} + +/** + * @param {string} uri + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURIComponent + */ +function decodeURIComponent(uri) {} + +/** + * @param {string} uri + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURI + */ +function encodeURI(uri) {} + +/** + * @param {string} uri + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURIComponent + */ +function encodeURIComponent(uri) {} + +/** + * Should only be used in browsers where encode/decodeURIComponent + * are not present, as the latter handle fancy Unicode characters. + * @param {string} str + * @return {string} + * @nosideeffects + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Predefined_Functions/escape_and_unescape_Functions + */ +function escape(str) {} + +/** + * Should only be used in browsers where encode/decodeURIComponent + * are not present, as the latter handle fancy Unicode characters. + * @param {string} str + * @return {string} + * @nosideeffects + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Predefined_Functions/escape_and_unescape_Functions + */ +function unescape(str) {} + +/** + * @param {*} num + * @return {boolean} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/isFinite + */ +function isFinite(num) {} + +/** + * @param {*} num + * @return {boolean} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/isNaN + */ +function isNaN(num) {} + +/** + * @param {*} num + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/parseFloat + */ +function parseFloat(num) {} + +/** + * Parse an integer. Use of {@code parseInt} without {@code base} is strictly + * banned in Google. If you really want to parse octal or hex based on the + * leader, then pass {@code undefined} as the base. + * + * @param {*} num + * @param {number|undefined} base + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/parseInt + */ +function parseInt(num, base) {} + +/** + * @param {string} code + * @return {*} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/eval + */ +function eval(code) {} + +/** + * @constructor + * @param {*=} opt_value + * @return {!Object} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object + */ +function Object(opt_value) {} + +/** + * The constructor of the current object. + * @type {Function} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/constructor + */ +Object.prototype.constructor = function() {}; + +/** + * Binds an object's property to a function to be called when that property is + * looked up. + * Mozilla-only. + * + * @param {string} sprop + * @param {Function} fun + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineGetter + */ +Object.prototype.__defineGetter__ = function(sprop, fun) {}; + +/** + * Binds an object's property to a function to be called when an attempt is made + * to set that property. + * Mozilla-only. + * + * @param {string} sprop + * @param {Function} fun + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineSetter + */ +Object.prototype.__defineSetter__ = function(sprop, fun) {}; + +/** + * Returns whether the object has a property with the specified name. + * + * @param {*} propertyName Implicitly cast to a string. + * @return {boolean} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/hasOwnProperty + */ +Object.prototype.hasOwnProperty = function(propertyName) {}; + +/** + * Returns whether an object exists in another object's prototype chain. + * + * @param {Object} other + * @return {boolean} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/isPrototypeOf + */ +Object.prototype.isPrototypeOf = function(other) {}; + +/** + * Return the function bound as a getter to the specified property. + * Mozilla-only. + * + * @param {string} sprop a string containing the name of the property whose + * getter should be returned + * @return {Function} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupGetter + */ +Object.prototype.__lookupGetter__ = function(sprop) {}; + +/** + * Return the function bound as a setter to the specified property. + * Mozilla-only. + * + * @param {string} sprop a string containing the name of the property whose + * setter should be returned. + * @return {Function} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupSetter + */ +Object.prototype.__lookupSetter__ = function(sprop) {}; + +/** + * Executes a function when a non-existent method is called on an object. + * Mozilla-only. + * + * @param {Function} fun + * @return {*} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/noSuchMethod + */ +Object.prototype.__noSuchMethod__ = function(fun) {}; + +/** + * Points to an object's context. For top-level objects, this is the e.g. window. + * Mozilla-only. + * + * @type {Object} + * @deprecated + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/parent + */ +Object.prototype.__parent__; + +/** + * Points to the object which was used as prototype when the object was instantiated. + * Mozilla-only. + * + * Will be null on Object.prototype. + * + * @type {Object} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/proto + */ +Object.prototype.__proto__; + +/** + * Determine whether the specified property in an object can be enumerated by a + * for..in loop, with the exception of properties inherited through the + * prototype chain. + * + * @param {string} propertyName + * @return {boolean} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/propertyIsEnumerable + */ +Object.prototype.propertyIsEnumerable = function(propertyName) {}; + +/** + * Returns a localized string representing the object. + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toLocaleString + */ +Object.prototype.toLocaleString = function() {}; + +/** + * Returns a string representing the source code of the object. + * Mozilla-only. + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource + */ +Object.prototype.toSource = function() {}; + +/** + * Returns a string representing the object. + * @this {*} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString + */ +Object.prototype.toString = function() {}; + +/** + * Removes a watchpoint set with the {@see Object.prototype.watch} method. + * Mozilla-only. + * @param {string} prop The name of a property of the object. + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/unwatch + */ +Object.prototype.unwatch = function(prop) {}; + +/** + * Returns the object's {@code this} value. + * @return {*} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/valueOf + */ +Object.prototype.valueOf = function() {}; + +/** + * Sets a watchpoint method. + * Mozilla-only. + * @param {string} prop The name of a property of the object. + * @param {Function} handler A function to call. + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/watch + */ +Object.prototype.watch = function(prop, handler) {}; + + +/** + * @constructor + * @param {...*} var_args + * @nosideeffects + * @throws {Error} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function + */ +function Function(var_args) {} + +/** + * @param {...*} var_args + * @return {*} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/call + */ +Function.prototype.call = function(var_args) {}; + +/** + * @param {...*} var_args + * @return {*} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/apply + */ +Function.prototype.apply = function(var_args) {}; + +Function.prototype.arguments; + +/** + * @type {number} + * @deprecated + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/arity + */ +Function.prototype.arity; + +/** + * Nonstandard; Mozilla and JScript only. + * @type {Function} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/caller + */ +Function.prototype.caller; + +/** + * Nonstandard. + * @type {?} + * @see http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/displayName + */ +Function.prototype.displayName; + +/** + * Expected number of arguments. + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/length + */ +Function.prototype.length; + +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/name + */ +Function.prototype.name; + +/** + * @this {Function} + * @return {string} + * @nosideeffects + * @override + */ +Function.prototype.toString = function() {}; + + +/** + * @constructor + * @param {...*} var_args + * @return {!Array.} + * @nosideeffects + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array + */ +function Array(var_args) {} + +// Functions: + +/** + * Returns a new array comprised of this array joined with other array(s) + * and/or value(s). + * + * @param {...*} var_args + * @return {!Array.} + * @this {*} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/concat + */ +Array.prototype.concat = function(var_args) {}; + +/** + * Joins all elements of an array into a string. + * + * @param {*=} opt_separator Specifies a string to separate each element of the + * array. The separator is converted to a string if necessary. If omitted, + * the array elements are separated with a comma. + * @return {string} + * @this {{length: number}|string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/join + */ +Array.prototype.join = function(opt_separator) {}; + +/** + * Removes the last element from an array and returns that element. + * + * @return {T} + * @this {{length: number}|Array.} + * @modifies {this} + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/pop + */ +Array.prototype.pop = function() {}; + +/** + * Mutates an array by appending the given elements and returning the new + * length of the array. + * + * @param {...T} var_args + * @return {number} The new length of the array. + * @this {{length: number}|Array.} + * @template T + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/push + */ +Array.prototype.push = function(var_args) {}; + +/** + * Transposes the elements of an array in place: the first array element becomes the + * last and the last becomes the first. + * + * @this {{length: number}} + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/reverse + */ +Array.prototype.reverse = function() {}; + +/** + * Removes the first element from an array and returns that element. This + * method changes the length of the array. + * + * @this {{length: number}|Array.} + * @modifies {this} + * @return {T} + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/shift + */ +Array.prototype.shift = function() {}; + +/** + * Extracts a section of an array and returns a new array. + * + * @param {*=} opt_begin Zero-based index at which to begin extraction. A + * non-number type will be auto-cast by the browser to a number. + * @param {*=} opt_end Zero-based index at which to end extraction. slice + * extracts up to but not including end. + * @return {!Array.} + * @this {{length: number}|Array.|string} + * @template T + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/slice + */ +Array.prototype.slice = function(opt_begin, opt_end) {}; + +/** + * Sorts the elements of an array in place. + * + * @param {function(T,T):number=} opt_compareFunction Specifies a function that + * defines the sort order. + * @this {{length: number}|Array.} + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/sort + */ +Array.prototype.sort = function(opt_compareFunction) {}; + +/** + * Changes the content of an array, adding new elements while removing old + * elements. + * + * @param {*=} opt_index Index at which to start changing the array. If negative, + * will begin that many elements from the end. A non-number type will be + * auto-cast by the browser to a number. + * @param {*=} opt_howMany An integer indicating the number of old array elements + * to remove. + * @param {...T} var_args + * @return {!Array.} + * @this {{length: number}|Array.} + * @modifies {this} + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/splice + */ +Array.prototype.splice = function(opt_index, opt_howMany, var_args) {}; + +/** + * @return {string} + * @this {Object} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/toSource + */ +Array.prototype.toSource; + +/** + * @this {Array.} + * @return {string} + * @nosideeffects + * @override + */ +Array.prototype.toString = function() {}; + +/** + * Adds one or more elements to the beginning of an array and returns the new + * length of the array. + * + * @param {...*} var_args + * @return {number} The new length of the array + * @this {{length: number}} + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/unshift + */ +Array.prototype.unshift = function(var_args) {}; + +/** + * Apply a function simultaneously against two values of the array (from + * left-to-right) as to reduce it to a single value. + * + * @param {?function(?, T, number, !Array.) : R} callback + * @param {*=} opt_initialValue + * @return {R} + * @this {{length: number}|Array.|string} + * @template T,R + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/reduce + */ +Array.prototype.reduce = function(callback, opt_initialValue) {}; + +/** + * Apply a function simultaneously against two values of the array (from + * right-to-left) as to reduce it to a single value. + * + * @param {?function(?, T, number, !Array.) : R} callback + * @param {*=} opt_initialValue + * @return {R} + * @this {{length: number}|Array.|string} + * @template T,R + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/reduceRight + */ +Array.prototype.reduceRight = function(callback, opt_initialValue) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.): ?} callback + * @param {S=} opt_thisobj + * @return {boolean} + * @this {{length: number}|Array.|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/every + */ +Array.prototype.every = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.): ?} callback + * @param {S=} opt_thisobj + * @return {!Array.} + * @this {{length: number}|Array.|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter + */ +Array.prototype.filter = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.): ?} callback + * @param {S=} opt_thisobj + * @this {{length: number}|Array.|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/forEach + */ +Array.prototype.forEach = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {T} obj + * @param {number=} opt_fromIndex + * @return {number} + * @this {{length: number}|Array.|string} + * @nosideeffects + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/indexOf + */ +Array.prototype.indexOf = function(obj, opt_fromIndex) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {T} obj + * @param {number=} opt_fromIndex + * @return {number} + * @this {{length: number}|Array.|string} + * @nosideeffects + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/lastIndexOf + */ +Array.prototype.lastIndexOf = function(obj, opt_fromIndex) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.): R} callback + * @param {S=} opt_thisobj + * @return {!Array.} + * @this {{length: number}|Array.|string} + * @template T,S,R + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/map + */ +Array.prototype.map = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.): ?} callback + * @param {S=} opt_thisobj + * @return {boolean} + * @this {{length: number}|Array.|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/some + */ +Array.prototype.some = function(callback, opt_thisobj) {}; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/index + */ +Array.prototype.index; + +/** + * @type {?string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/input + */ +Array.prototype.input; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/length + */ +Array.prototype.length; + +/** + * @param {{length: number}|Array.} arr + * @param {?function(this:S, T, number, ?) : ?} callback + * @param {S=} opt_context + * @return {boolean} + * @template T,S + */ +Array.every = function(arr, callback, opt_context) {}; + +/** + * @param {{length: number}|Array.} arr + * @param {?function(this:S, T, number, ?) : ?} callback + * @param {S=} opt_context + * @return {!Array.} + * @template T,S + */ +Array.filter = function(arr, callback, opt_context) {}; + +/** + * @param {{length: number}|Array.} arr + * @param {?function(this:S, T, number, ?) : ?} callback + * @param {S=} opt_context + * @template T,S + */ +Array.forEach = function(arr, callback, opt_context) {}; + +/** + * Mozilla 1.6+ only. + * @param {{length: number}|Array.} arr + * @param {T} obj + * @param {number=} opt_fromIndex + * @return {number} + * @template T + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/indexOf + */ +Array.indexOf = function(arr, obj, opt_fromIndex) {}; + +/** + * Mozilla 1.6+ only. + * @param {{length: number}|Array.} arr + * @param {T} obj + * @param {number=} opt_fromIndex + * @return {number} + * @template T + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/lastIndexOf + */ +Array.lastIndexOf = function(arr, obj, opt_fromIndex) {}; + +/** + * @param {{length: number}|Array.} arr + * @param {?function(this:S, T, number, !Array.): R} callback + * @param {S=} opt_context + * @return {!Array.} + * @template T,S,R + */ +Array.map = function(arr, callback, opt_context) {}; + +/** + * @param {{length: number}|Array.} arr + * @param {?function(this:S, T, number, ?) : ?} callback + * @param {S=} opt_context + * @return {boolean} + * @template T,S + */ +Array.some = function(arr, callback, opt_context) {}; + +/** + * Introduced in 1.8.5. + * @param {*} arr + * @return {boolean} + * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray + */ +Array.isArray = function(arr) {}; + +/** + * @constructor + * @param {*=} opt_value + * @return {boolean} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean + */ +function Boolean(opt_value) {} + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/toSource + * @override + */ +Boolean.prototype.toSource = function() {}; + +/** + * @this {boolean|Boolean} + * @return {string} + * @nosideeffects + * @override + */ +Boolean.prototype.toString = function() {}; + +/** + * @constructor + * @param {*=} opt_value + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number + */ +function Number(opt_value) {} + +/** + * @this {Number|number} + * @param {number=} opt_fractionDigits + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toExponential + */ +Number.prototype.toExponential = function(opt_fractionDigits) {}; + +/** + * @this {Number|number} + * @param {*=} opt_digits + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toFixed + */ +Number.prototype.toFixed = function(opt_digits) {}; + +/** + * @this {Number|number} + * @param {number=} opt_precision + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toPrecision + */ +Number.prototype.toPrecision = function(opt_precision) {}; + +/** + * Returns a string representing the number. + * @this {Number|number} + * @param {(number|Number)=} opt_radix An optional radix. + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toString + * @override + */ +Number.prototype.toString = function(opt_radix) {}; + +// Properties. +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/MAX_VALUE + */ +Number.MAX_VALUE; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/MIN_VALUE + */ +Number.MIN_VALUE; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/NaN + */ +Number.NaN; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/NEGATIVE_INFINITY + */ +Number.NEGATIVE_INFINITY; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/POSITIVE_INFINITY + */ +Number.POSITIVE_INFINITY; + + +/** + * @const + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math + */ +var Math = {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/abs + */ +Math.abs = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/acos + */ +Math.acos = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/asin + */ +Math.asin = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/atan + */ +Math.atan = function(x) {}; + +/** + * @param {*} y + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/atan2 + */ +Math.atan2 = function(y, x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/ceil + */ +Math.ceil = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/cos + */ +Math.cos = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/exp + */ +Math.exp = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/floor + */ +Math.floor = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/log + */ +Math.log = function(x) {}; + +/** + * @param {...*} var_args + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/max + */ +Math.max = function(var_args) {}; + +/** + * @param {...*} var_args + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/min + */ +Math.min = function(var_args) {}; + +/** + * @param {*} x + * @param {*} y + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/pow + */ +Math.pow = function(x, y) {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/random + */ +Math.random = function() {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/round + */ +Math.round = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/sin + */ +Math.sin = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/sqrt + */ +Math.sqrt = function(x) {}; + +/** + * @param {*} x + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/tan + */ +Math.tan = function(x) {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/toSource + */ +Math.toSource = function() {}; + +// Properties: + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/E + */ +Math.E; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LN2 + */ +Math.LN2; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LN10 + */ +Math.LN10; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LOG2E + */ +Math.LOG2E; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LOG10E + */ +Math.LOG10E; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/PI + */ +Math.PI; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/SQRT1_2 + */ +Math.SQRT1_2; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/SQRT2 + */ +Math.SQRT2; + + +/** + * @param {?=} opt_yr_num + * @param {?=} opt_mo_num + * @param {?=} opt_day_num + * @param {?=} opt_hr_num + * @param {?=} opt_min_num + * @param {?=} opt_sec_num + * @param {?=} opt_ms_num + * @constructor + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date + */ +function Date(opt_yr_num, opt_mo_num, opt_day_num, opt_hr_num, opt_min_num, + opt_sec_num, opt_ms_num) {} + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/now + */ +Date.now = function() {}; + +/** + * Parses a string representation of a date, and returns the number + * of milliseconds since January 1, 1970, 00:00:00, local time. + * @param {*} date + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/parse + */ +Date.parse = function(date) {}; + +/** + * @param {number} year + * @param {number} month + * @param {number=} opt_date + * @param {number=} opt_hours + * @param {number=} opt_minute + * @param {number=} opt_second + * @param {number=} opt_ms + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/UTC + */ +Date.UTC = function(year, month, + opt_date, opt_hours, opt_minute, opt_second, opt_ms) {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getDate + */ +Date.prototype.getDate = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getDay + */ +Date.prototype.getDay = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getMonth + */ +Date.prototype.getMonth = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getFullYear + */ +Date.prototype.getFullYear = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getYear + */ +Date.prototype.getYear = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getHours + */ +Date.prototype.getHours = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getMinutes + */ +Date.prototype.getMinutes = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getSeconds + */ +Date.prototype.getSeconds = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getMilliseconds + */ +Date.prototype.getMilliseconds = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getTime + */ +Date.prototype.getTime = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getTimezoneOffset + */ +Date.prototype.getTimezoneOffset = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCDate + */ +Date.prototype.getUTCDate = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCDay + */ +Date.prototype.getUTCDay = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCMonth + */ +Date.prototype.getUTCMonth = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCFullYear + */ +Date.prototype.getUTCFullYear = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCHours + */ +Date.prototype.getUTCHours = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCMinutes + */ +Date.prototype.getUTCMinutes = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCSeconds + */ +Date.prototype.getUTCSeconds = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCMilliseconds + */ +Date.prototype.getUTCMilliseconds = function() {}; + +/** + * Sets the day of the month for a specified date according to local time. + * + * @param {number} dayValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setDate + */ +Date.prototype.setDate = function(dayValue) {}; + +/** + * Set the month for a specified date according to local time. + * + * @param {number} monthValue + * @param {number=} opt_dayValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setMonth + */ +Date.prototype.setMonth = function(monthValue, opt_dayValue) {}; + +/** + * Sets the full year for a specified date according to local time. + * + * @param {number} yearValue + * @param {number=} opt_monthValue + * @param {number=} opt_dayValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setFullYear + */ +Date.prototype.setFullYear = + function(yearValue, opt_monthValue, opt_dayValue) {}; + +/** + * Sets the year for a specified date according to local time. + * + * @param {number} yearValue + * @deprecated + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setYear + */ +Date.prototype.setYear = function(yearValue) {}; + +/** + * Sets the hours for a specified date according to local time. + * + * @param {number} hoursValue + * @param {number=} opt_minutesValue + * @param {number=} opt_secondsValue + * @param {number=} opt_msValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setHours + */ +Date.prototype.setHours = function(hoursValue, opt_minutesValue, + opt_secondsValue, opt_msValue) {}; + +/** + * Sets the minutes for a specified date according to local time. + * + * @param {number} minutesValue + * @param {number=} opt_secondsValue + * @param {number=} opt_msValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setMinutes + */ +Date.prototype.setMinutes = + function(minutesValue, opt_secondsValue, opt_msValue) {}; + +/** + * Sets the seconds for a specified date according to local time. + * + * @param {number} secondsValue + * @param {number=} opt_msValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setSeconds + */ +Date.prototype.setSeconds = function(secondsValue, opt_msValue) {}; + +/** + * Sets the milliseconds for a specified date according to local time. + * + * @param {number} millisecondsValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setMilliseconds + */ +Date.prototype.setMilliseconds = function(millisecondsValue) {}; + +/** + * Sets the Date object to the time represented by a number of milliseconds + * since January 1, 1970, 00:00:00 UTC. + * + * @param {number} timeValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setTime + */ +Date.prototype.setTime = function(timeValue) {}; + +/** + * Sets the day of the month for a specified date according to universal time. + * + * @param {number} dayValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCDate + */ +Date.prototype.setUTCDate = function(dayValue) {}; + +/** + * Sets the month for a specified date according to universal time. + * + * @param {number} monthValue + * @param {number=} opt_dayValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCMonth + */ +Date.prototype.setUTCMonth = function(monthValue, opt_dayValue) {}; + +/** + * Sets the full year for a specified date according to universal time. + * + * @param {number} yearValue + * @param {number=} opt_monthValue + * @param {number=} opt_dayValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCFullYear + */ +Date.prototype.setUTCFullYear = function(yearValue, opt_monthValue, + opt_dayValue) {}; + +/** + * Sets the hour for a specified date according to universal time. + * + * @param {number} hoursValue + * @param {number=} opt_minutesValue + * @param {number=} opt_secondsValue + * @param {number=} opt_msValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCHours + */ +Date.prototype.setUTCHours = function(hoursValue, opt_minutesValue, + opt_secondsValue, opt_msValue) {}; + +/** + * Sets the minutes for a specified date according to universal time. + * + * @param {number} minutesValue + * @param {number=} opt_secondsValue + * @param {number=} opt_msValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCMinutes + */ +Date.prototype.setUTCMinutes = function(minutesValue, opt_secondsValue, + opt_msValue) {}; + + +/** + * Sets the seconds for a specified date according to universal time. + * + * @param {number} secondsValue + * @param {number=} opt_msValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCSeconds + */ +Date.prototype.setUTCSeconds = function(secondsValue, opt_msValue) {}; + +/** + * Sets the milliseconds for a specified date according to universal time. + * + * @param {number} millisecondsValue + * @modifies {this} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCMilliseconds + */ +Date.prototype.setUTCMilliseconds = function(millisecondsValue) {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toSource + * @override + */ +Date.prototype.toSource = function() {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/toDateString + */ +Date.prototype.toDateString = function() {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toGMTString + */ +Date.prototype.toGMTString = function() {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toTimeString + */ +Date.prototype.toTimeString = function() {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toUTCString + */ +Date.prototype.toUTCString = function() {}; + +/** + * @param {(string|Array.)=} opt_locales + * @param {Object=} opt_options + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleDateString + */ +Date.prototype.toLocaleDateString = function(opt_locales, opt_options) {}; + +/** + * @param {string} formatString + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleFormat + */ +Date.prototype.toLocaleFormat = function(formatString) {}; + +/** + * @param {string|Array.=} opt_locales + * @param {Object=} opt_options + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleString + * @see http://www.ecma-international.org/ecma-402/1.0/#sec-13.3.1 + * @override + */ +Date.prototype.toLocaleString = function(opt_locales, opt_options) {}; + +/** + * @param {(string|Array.)=} opt_locales + * @param {Object=} opt_options + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleTimeString + */ +Date.prototype.toLocaleTimeString = function(opt_locales, opt_options) {}; + +/** + * @this {Date} + * @return {string} + * @nosideeffects + * @override + */ +Date.prototype.toString = function() {}; + +/** + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/valueOf + */ +Date.prototype.valueOf; + +/** + * @constructor + * @param {*=} opt_str + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String + */ +function String(opt_str) {} +// Functions: + +/** + * @param {...number} var_args + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fromCharCode + */ +String.fromCharCode = function(var_args) {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/anchor + */ +String.prototype.anchor = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/big + */ +String.prototype.big = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/blink + */ +String.prototype.blink = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/bold + */ +String.prototype.bold = function() {}; + +/** + * Returns the specified character from a string. + * + * @this {String|string} + * @param {number} index + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/charAt + */ +String.prototype.charAt = function(index) {}; + +/** + * Returns a number indicating the Unicode value of the character at the given + * index. + * + * @this {String|string} + * @param {number=} opt_index + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/charCodeAt + */ +String.prototype.charCodeAt = function(opt_index) {}; + +/** + * Combines the text of two or more strings and returns a new string. + * + * @this {String|string} + * @param {...*} var_args + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/concat + */ +String.prototype.concat = function(var_args) {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fixed + */ +String.prototype.fixed = function() {}; + +/** + * @this {String|string} + * @param {string} color + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fontcolor + */ +String.prototype.fontcolor = function(color) {}; + +/** + * @this {String|string} + * @param {number} size + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fontsize + */ +String.prototype.fontsize = function(size) {}; + +/** + * Returns the index within the calling String object of the first occurrence + * of the specified value, starting the search at fromIndex, returns -1 if the + * value is not found. + * + * @this {String|string} + * @param {string|null} searchValue + * @param {(number|null)=} opt_fromIndex + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/indexOf + */ +String.prototype.indexOf = function(searchValue, opt_fromIndex) {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/italics + */ +String.prototype.italics = function() {}; + +/** + * Returns the index within the calling String object of the last occurrence of + * the specified value, or -1 if not found. The calling string is searched + * backward, starting at fromIndex. + * + * @this {String|string} + * @param {string|null} searchValue + * @param {(number|null)=} opt_fromIndex + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/lastIndexOf + */ +String.prototype.lastIndexOf = function(searchValue, opt_fromIndex) {}; + +/** + * @this {String|string} + * @param {string} hrefAttribute + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/link + */ +String.prototype.link = function(hrefAttribute) {}; + +/** + * Returns a number indicating whether a reference string comes before or after + * or is the same as the given string in sort order. + * + * @this {*} + * @param {?string} compareString + * @param {string|Array.=} locales + * @param {Object=} options + * @return {number} + * @nosideeffects + * @see http://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/String/localeCompare + * @see http://www.ecma-international.org/ecma-402/1.0/#sec-13.1.1 + */ +String.prototype.localeCompare = function(compareString, locales, options) {}; + +/** + * Used to retrieve the matches when matching a string against a regular + * expression. + * + * @this {String|string} + * @param {*} regexp + * @return {Array.} This should really return an Array with a few + * special properties, but we do not have a good way to model this in + * our type system. Also see Regexp.prototype.exec. + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/match + */ +String.prototype.match = function(regexp) {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/quote + */ +String.prototype.quote = function() {}; + +/** + * Finds a match between a regular expression and a string, and replaces the + * matched substring with a new substring. + * + * This may have side-effects if the replacement function has side-effects. + * + * @this {String|string} + * @param {RegExp|string} regex + * @param {string|Function} str + * @param {string=} opt_flags + * @return {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replace + */ +String.prototype.replace = function(regex, str, opt_flags) {}; + +/** + * Executes the search for a match between a regular expression and this String + * object. + * + * @this {String|string} + * @param {RegExp|string} regexp + * @return {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/search + */ +String.prototype.search = function(regexp) {}; + +/** + * @this {String|string} + * @param {number} begin + * @param {number=} opt_end + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/slice + */ +String.prototype.slice = function(begin, opt_end) {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/small + */ +String.prototype.small = function() {}; + +/** + * @this {String|string} + * @param {*=} opt_separator + * @param {number=} opt_limit + * @return {!Array.} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/split + */ +String.prototype.split = function(opt_separator, opt_limit) {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/strike + */ +String.prototype.strike = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/sub + */ +String.prototype.sub = function() {}; + +/** + * @this {String|string} + * @param {number} start + * @param {number=} opt_length + * @return {string} The specified substring. + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/substr + */ +String.prototype.substr = function(start, opt_length) {}; + +/** + * @this {String|string} + * @param {number} start + * @param {number=} opt_end + * @return {string} The specified substring. + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/substring + */ +String.prototype.substring = function(start, opt_end) {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/sup + */ +String.prototype.sup = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toLocaleUpperCase + */ +String.prototype.toLocaleUpperCase = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toLocaleLowerCase + */ +String.prototype.toLocaleLowerCase = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toLowerCase + */ +String.prototype.toLowerCase = function() {}; + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toUpperCase + */ +String.prototype.toUpperCase = function() {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toSource + * @override + */ +String.prototype.toSource = function() {}; + +/** + * @this {string|String} + * @return {string} + * @nosideeffects + * @override + */ +String.prototype.toString = function() {}; + +/** + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/valueOf + */ +String.prototype.valueOf; + +/** + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/length + */ +String.prototype.length; + +/** + * @constructor + * @param {*=} opt_pattern + * @param {*=} opt_flags + * @return {!RegExp} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +function RegExp(opt_pattern, opt_flags) {} + +/** + * @param {*} pattern + * @param {*=} opt_flags + * @return {void} + * @modifies {this} + * @deprecated + * @see http://msdn.microsoft.com/en-us/library/x9cswe0z(v=VS.85).aspx + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/compile + */ +RegExp.prototype.compile = function(pattern, opt_flags) {}; + +/** + * @param {*} str The string to search. + * @return {Array.} This should really return an Array with a few + * special properties, but we do not have a good way to model this in + * our type system. Also see String.prototype.match. + * @see http://msdn.microsoft.com/en-us/library/z908hy33(VS.85).aspx + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/exec + */ +RegExp.prototype.exec = function(str) {}; + +/** + * @param {*} str The string to search. + * @return {boolean} Whether the string was matched. + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/test + */ +RegExp.prototype.test = function(str) {}; + +/** + * @this {RegExp} + * @return {string} + * @nosideeffects + * @override + */ +RegExp.prototype.toString = function() {}; + +// Constructor properties: + +/** + * The string against which the last regexp was matched. + * @type {string} + * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_input.html + */ +RegExp.input; + +/** + * The last matched characters. + * @type {string} + * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_lastMatch.html + */ +RegExp.lastMatch; + +/** + * The last matched parenthesized substring, if any. + * @type {string} + * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_lastParen.html + */ +RegExp.lastParen; + +/** + * The substring of the input up to the characters most recently matched. + * @type {string} + * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_leftContext.html + */ +RegExp.leftContext; + +/** + * The substring of the input after the characters most recently matched. + * @type {string} + * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_rightContext.html + */ +RegExp.rightContext; + +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$1; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$2; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$3; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$4; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$5; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$6; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$7; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$8; +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp + */ +RegExp.$9; + +// Prototype properties: + +/** + * Whether to test the regular expression against all possible matches + * in a string, or only against the first. + * @type {boolean} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/global + */ +RegExp.prototype.global; + +/** + * Whether to ignore case while attempting a match in a string. + * @type {boolean} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/ignoreCase + */ +RegExp.prototype.ignoreCase; + +/** + * The index at which to start the next match. + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/lastIndex + */ +RegExp.prototype.lastIndex; + +/** + * Whether or not to search in strings across multiple lines. + * @type {boolean} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/multiline + */ +RegExp.prototype.multiline; + +/** + * The text of the pattern. + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/source + */ +RegExp.prototype.source; + + +/** + * @constructor + * @param {*=} opt_message + * @param {*=} opt_file + * @param {*=} opt_line + * @return {!Error} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error + */ +function Error(opt_message, opt_file, opt_line) {} + + +/** + * Chrome/v8 specific, altering the maximum depth of the stack trace + * (10 by default). + * @type {number} + * @see http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + */ +Error.stackTraceLimit; + + +/** + * Chrome/v8 specific, adds a stack trace to the error object. The optional + * constructorOpt parameter allows you to pass in a function value. When + * collecting the stack trace all frames above the topmost call to this + * function, including that call, will be left out of the stack trace. + * @param {Object} error The object to add the stack trace to. + * @param {Function=} opt_constructor A function in the stack trace + * @see http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + */ +Error.captureStackTrace = function(error, opt_constructor){}; + + +/** + * IE-only. + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/2w6a45b5.aspx + */ +Error.prototype.description; + + +/** + * Mozilla-only. + * @type {number} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/lineNumber + */ +Error.prototype.lineNumber; + +/** + * Mozilla-only + * @type {string} + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/fileName + */ +Error.prototype.fileName; + +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/name + */ +Error.prototype.name; + +/** + * @type {string} + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/message + */ +Error.prototype.message; + +/** + * Doesn't seem to exist, but closure/debug.js references it. + */ +Error.prototype.sourceURL; + +/** @type {string} */ +Error.prototype.stack; + + +/** + * @constructor + * @extends {Error} + * @param {*=} opt_message + * @param {*=} opt_file + * @param {*=} opt_line + * @return {!EvalError} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/EvalError + */ +function EvalError(opt_message, opt_file, opt_line) {} + +/** + * @constructor + * @extends {Error} + * @param {*=} opt_message + * @param {*=} opt_file + * @param {*=} opt_line + * @return {!RangeError} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RangeError + */ +function RangeError(opt_message, opt_file, opt_line) {} + +/** + * @constructor + * @extends {Error} + * @param {*=} opt_message + * @param {*=} opt_file + * @param {*=} opt_line + * @return {!ReferenceError} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/ReferenceError + */ +function ReferenceError(opt_message, opt_file, opt_line) {} + +/** + * @constructor + * @extends {Error} + * @param {*=} opt_message + * @param {*=} opt_file + * @param {*=} opt_line + * @return {!SyntaxError} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/SyntaxError + */ +function SyntaxError(opt_message, opt_file, opt_line) {} + +/** + * @constructor + * @extends {Error} + * @param {*=} opt_message + * @param {*=} opt_file + * @param {*=} opt_line + * @return {!TypeError} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/TypeError + */ +function TypeError(opt_message, opt_file, opt_line) {} + +/** + * @constructor + * @extends {Error} + * @param {*=} opt_message + * @param {*=} opt_file + * @param {*=} opt_line + * @return {!URIError} + * @nosideeffects + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/URIError + */ +function URIError(opt_message, opt_file, opt_line) {} + + +// JScript extensions. +// @see http://msdn.microsoft.com/en-us/library/894hfyb4(VS.80).aspx + +/** + * @param {string} progId + * @param {string=} opt_location + * @constructor + * @see http://msdn.microsoft.com/en-us/library/7sw4ddf8.aspx + */ +function ActiveXObject(progId, opt_location) {} + +/** + * @return {string} + * @nosideeffects + * @see http://msdn.microsoft.com/en-us/library/9k34bww2(VS.80).aspx + */ +function ScriptEngine() {} + +/** + * @return {number} + * @nosideeffects + * @see http://msdn.microsoft.com/en-us/library/yf25ky07(VS.80).aspx + */ +function ScriptEngineMajorVersion() {} + +/** + * @return {number} + * @nosideeffects + * @see http://msdn.microsoft.com/en-us/library/wx3812cz(VS.80).aspx + */ +function ScriptEngineMinorVersion() {} + +/** + * @return {number} + * @nosideeffects + * @see http://msdn.microsoft.com/en-us/library/e98hsk2f(VS.80).aspx + */ +function ScriptEngineBuildVersion() {} diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js new file mode 100644 index 000000000..a7d444a8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js @@ -0,0 +1,269 @@ +/* + * Copyright 2009 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for ECMAScript 5. + * @see http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf + * @externs + */ + + +/** + * @param {Object|undefined} selfObj Specifies the object to which |this| should + * point when the function is run. If the value is null or undefined, it + * will default to the global object. + * @param {...*} var_args Additional arguments that are partially + * applied to fn. + * @return {!Function} A partially-applied form of the Function on which + * bind() was invoked as a method. + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind + */ +Function.prototype.bind = function(selfObj, var_args) {}; + + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim + */ +String.prototype.trim = function() {}; + + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/TrimLeft + */ +String.prototype.trimLeft = function() {}; + + +/** + * @this {String|string} + * @return {string} + * @nosideeffects + * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/TrimRight + */ +String.prototype.trimRight = function() {}; + + +/** + * A object property descriptor used by Object.create, Object.defineProperty, + * Object.defineProperties, Object.getOwnPropertyDescriptor. + * + * Note: not a real constructor. + * @constructor + */ +var ObjectPropertyDescriptor = function(){}; + +/** @type {*} */ +ObjectPropertyDescriptor.prototype.value; + +/** @type {(function():?)||undefined} */ +ObjectPropertyDescriptor.prototype.get; + +/** @type {(function(?):void)||undefined} */ +ObjectPropertyDescriptor.prototype.set; + +/** @type {boolean|undefined} */ +ObjectPropertyDescriptor.prototype.writable; + +/** @type {boolean|undefined} */ +ObjectPropertyDescriptor.prototype.enumerable; + +/** @type {boolean|undefined} */ +ObjectPropertyDescriptor.prototype.configurable; + + +/** + * @param {Object} proto + * @param {Object=} opt_properties A map of ObjectPropertyDescriptors. + * @return {!Object} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/create + */ +Object.create = function(proto, opt_properties) {}; + + +/** + * @param {!Object} obj + * @param {string} prop + * @param {!Object} descriptor A ObjectPropertyDescriptor. + * @return {!Object} + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty + */ +Object.defineProperty = function(obj, prop, descriptor) {}; + + +/** + * @param {!Object} obj + * @param {!Object} props A map of ObjectPropertyDescriptors. + * @return {!Object} + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperties + */ +Object.defineProperties = function(obj, props) {}; + + +/** + * @param {!Object} obj + * @param {string} prop + * @return {!ObjectPropertyDescriptor|undefined} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor + */ +Object.getOwnPropertyDescriptor = function(obj, prop) {}; + + +/** + * @param {!Object} obj + * @return {!Array.} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys + */ +Object.keys = function(obj) {}; + + +/** + * @param {!Object} obj + * @return {!Array.} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames + */ +Object.getOwnPropertyNames = function(obj) {}; + + +/** + * @param {!Object} obj + * @return {Object} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/GetPrototypeOf + */ +Object.getPrototypeOf = function(obj) {}; + + +/** + * @param {T} obj + * @return {T} + * @template T + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/preventExtensions + */ +Object.preventExtensions = function(obj) {}; + + +/** + * @param {T} obj + * @return {T} + * @template T + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/seal + */ +Object.seal = function(obj) {}; + + +/** + * @param {T} obj + * @return {T} + * @template T + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/freeze + */ +Object.freeze = function(obj) {}; + + +/** + * @param {!Object} obj + * @return {boolean} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/isExtensible + */ +Object.isExtensible = function(obj) {}; + + +/** + * @param {!Object} obj + * @return {boolean} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/isSealed + */ +Object.isSealed = function(obj) {}; + + +/** + * @param {!Object} obj + * @return {boolean} + * @nosideeffects + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/isFrozen + */ +Object.isFrozen = function(obj) {}; + + +/** + * As per ECMAScript 5, 15.12.3. + * @param {string=} opt_key The JSON key for this object. + * @return {*} The serializable representation of this object. Note that this + * need not be a string. See http://goo.gl/PEUvs. + */ +Object.prototype.toJSON = function(opt_key) {}; + + +/** + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/toISOString + * @return {string} + */ +Date.prototype.toISOString = function() {}; + + +/** + * @param {*=} opt_ignoredKey + * @return {string} + * @override + */ +Date.prototype.toJSON = function(opt_ignoredKey) {}; + + +/** + * A fake type to model the JSON object. + * @constructor + */ +var JSONType = function() {}; + + +/** + * @param {string} jsonStr The string to parse. + * @param {(function(string, *) : *)=} opt_reviver + * @return {*} The JSON object. + * @throws {Error} + * @nosideeffects + */ +JSONType.prototype.parse = function(jsonStr, opt_reviver) {}; + + +/** + * @param {*} jsonObj Input object. + * @param {(Array.|(function(string, *) : *)|null)=} opt_replacer + * @param {(number|string)=} opt_space + * @return {string} JSON string which represents jsonObj. + * @throws {Error} + * @nosideeffects + */ +JSONType.prototype.stringify = function(jsonObj, opt_replacer, opt_space) {}; + + +/** + * @type {!JSONType} + * @suppress {duplicate} + */ +var JSON; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js new file mode 100644 index 000000000..4afb5777a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js @@ -0,0 +1,856 @@ +/* + * Copyright 2014 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for ECMAScript 6. + * @see http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts + * @see https://www.khronos.org/registry/typedarray/specs/latest/ + * @externs + */ + +// TODO(johnlenz): symbol should be a primitive type. +/** @typedef {?} */ +var symbol; + +/** + * @param {string} description + * @return {symbol} + */ +function Symbol(description) {} + +/** @const {symbol} */ +Symbol.iterator; + + +/** + * @interface + * @template VALUE + */ +function Iterable() {} + +// TODO(johnlenz): remove this when the compiler understands "symbol" natively +/** + * @return {Iterator.} + * @suppress {externsValidation} + */ +Iterable.prototype[Symbol.iterator] = function() {}; + + + +// TODO(johnlenz): Iterator should be a templated record type. +/** + * @interface + * @template VALUE + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol + */ +function Iterator() {} + +/** + * @param {VALUE=} value + * @return {{value:VALUE, done:boolean}} + */ +Iterator.prototype.next; + + +/** + * @constructor + * @see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generator-objects + * @implements {Iterator} + * @template VALUE + */ +var Generator = function() {}; + +/** + * @param {?=} opt_value + * @return {{value:VALUE, done:boolean}} + * @override + */ +Generator.prototype.next = function(opt_value) {}; + +/** + * @param {VALUE} value + * @return {{value:VALUE, done:boolean}} + */ +Generator.prototype.return = function(value) {}; + +/** + * @param {?} exception + * @return {{value:VALUE, done:boolean}} + */ +Generator.prototype.throw = function(exception) {}; + + +// TODO(johnlenz): Array should be Iterable. + + + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.log10 = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.log2 = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.log1p = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.expm1 = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.cosh = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.sinh = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.tanh = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.acosh = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.asinh = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.atanh = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.trunc = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.sign = function(value) {}; + +/** + * @param {number} value + * @return {number} + * @nosideeffects + */ +Math.cbrt = function(value) {}; + +/** + * @param {number} value1 + * @param {...number} var_args + * @return {number} + * @nosideeffects + * @see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot + */ +Math.hypot = function(value1, var_args) {}; + + +/** + * @param {*} a + * @param {*} b + * @return {boolean} + * @see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is + */ +Object.is; + + +/** + * Returns a language-sensitive string representation of this number. + * @param {(string|!Array)=} opt_locales + * @param {Object=} opt_options + * @return {string} + * @nosideeffects + * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString + * @see http://www.ecma-international.org/ecma-402/1.0/#sec-13.2.1 + * @override + */ +Number.prototype.toLocaleString = function(opt_locales, opt_options) {}; + + +/** + * @see http://dev.w3.org/html5/postmsg/ + * @interface + */ +function Transferable() {} + +/** + * @param {number} length The length in bytes + * @constructor + * @noalias + * @throws {Error} + * @nosideeffects + * @implements {Transferable} + */ +function ArrayBuffer(length) {} + +/** @type {number} */ +ArrayBuffer.prototype.byteLength; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!ArrayBuffer} + * @nosideeffects + */ +ArrayBuffer.prototype.slice = function(begin, opt_end) {}; + + +/** + * @constructor + * @noalias + */ +function ArrayBufferView() {} + +/** @type {!ArrayBuffer} */ +ArrayBufferView.prototype.buffer; + +/** @type {number} */ +ArrayBufferView.prototype.byteOffset; + +/** @type {number} */ +ArrayBufferView.prototype.byteLength; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} If the user passes a backing array, then indexed + * accesses will modify the backing array. JSCompiler does not model + * this well. In other words, if you have: + * + * var x = new ArrayBuffer(1); + * var y = new Int8Array(x); + * y[0] = 2; + * + * JSCompiler will not recognize that the last assignment modifies x. + * We workaround this by marking all these arrays as @modifies {arguments}, + * to introduce the possibility that x aliases y. + */ +function Int8Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Int8Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Int8Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Int8Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Int8Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Int8Array} + * @nosideeffects + */ +Int8Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Uint8Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Uint8Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint8Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint8Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Uint8Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Uint8Array} + * @nosideeffects + */ +Uint8Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Uint8ClampedArray(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Uint8ClampedArray.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint8ClampedArray.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint8ClampedArray.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Uint8ClampedArray.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Uint8ClampedArray} + * @nosideeffects + */ +Uint8ClampedArray.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @typedef {Uint8ClampedArray} + * @deprecated CanvasPixelArray has been replaced by Uint8ClampedArray + * in the latest spec. + * @see http://www.w3.org/TR/2dcontext/#imagedata + */ +var CanvasPixelArray; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Int16Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Int16Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Int16Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Int16Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Int16Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Int16Array} + * @nosideeffects + */ +Int16Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Uint16Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Uint16Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint16Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint16Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Uint16Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Uint16Array} + * @nosideeffects + */ +Uint16Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Int32Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Int32Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Int32Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Int32Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Int32Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Int32Array} + * @nosideeffects + */ +Int32Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Uint32Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Uint32Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint32Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Uint32Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Uint32Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Uint32Array} + * @nosideeffects + */ +Uint32Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Float32Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Float32Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Float32Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Float32Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Float32Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Float32Array} + * @nosideeffects + */ +Float32Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {number|ArrayBufferView|Array.|ArrayBuffer} length or array + * or buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_length + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @modifies {arguments} + */ +function Float64Array(length, opt_byteOffset, opt_length) {} + +/** @type {number} */ +Float64Array.BYTES_PER_ELEMENT; + +/** @type {number} */ +Float64Array.prototype.BYTES_PER_ELEMENT; + +/** @type {number} */ +Float64Array.prototype.length; + +/** + * @param {ArrayBufferView|Array.} array + * @param {number=} opt_offset + */ +Float64Array.prototype.set = function(array, opt_offset) {}; + +/** + * @param {number} begin + * @param {number=} opt_end + * @return {!Float64Array} + * @nosideeffects + */ +Float64Array.prototype.subarray = function(begin, opt_end) {}; + + +/** + * @param {ArrayBuffer} buffer + * @param {number=} opt_byteOffset + * @param {number=} opt_byteLength + * @extends {ArrayBufferView} + * @constructor + * @noalias + * @throws {Error} + * @nosideeffects + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays/DataView + */ +function DataView(buffer, opt_byteOffset, opt_byteLength) {} + +/** + * @param {number} byteOffset + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getInt8 = function(byteOffset) {}; + +/** + * @param {number} byteOffset + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getUint8 = function(byteOffset) {}; + +/** + * @param {number} byteOffset + * @param {boolean=} opt_littleEndian + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getInt16 = function(byteOffset, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {boolean=} opt_littleEndian + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getUint16 = function(byteOffset, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {boolean=} opt_littleEndian + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getInt32 = function(byteOffset, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {boolean=} opt_littleEndian + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getUint32 = function(byteOffset, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {boolean=} opt_littleEndian + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getFloat32 = function(byteOffset, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {boolean=} opt_littleEndian + * @return {number} + * @throws {Error} + * @nosideeffects + */ +DataView.prototype.getFloat64 = function(byteOffset, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @throws {Error} + */ +DataView.prototype.setInt8 = function(byteOffset, value) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @throws {Error} + */ +DataView.prototype.setUint8 = function(byteOffset, value) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @param {boolean=} opt_littleEndian + * @throws {Error} + */ +DataView.prototype.setInt16 = function(byteOffset, value, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @param {boolean=} opt_littleEndian + * @throws {Error} + */ +DataView.prototype.setUint16 = function(byteOffset, value, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @param {boolean=} opt_littleEndian + * @throws {Error} + */ +DataView.prototype.setInt32 = function(byteOffset, value, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @param {boolean=} opt_littleEndian + * @throws {Error} + */ +DataView.prototype.setUint32 = function(byteOffset, value, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @param {boolean=} opt_littleEndian + * @throws {Error} + */ +DataView.prototype.setFloat32 = function( + byteOffset, value, opt_littleEndian) {}; + +/** + * @param {number} byteOffset + * @param {number} value + * @param {boolean=} opt_littleEndian + * @throws {Error} + */ +DataView.prototype.setFloat64 = function( + byteOffset, value, opt_littleEndian) {}; + + +/** + * @see https://github.com/promises-aplus/promises-spec + * @typedef {{then: !Function}} + */ +var Thenable; + + +/** + * This is not an official DOM interface. It is used to add generic typing + * and respective type inference where available. + * {@see goog.Thenable} inherits from this making all promises + * interoperate. + * @interface + * @template TYPE + */ +var IThenable = function() {}; + + +/** + * @param {?(function(TYPE): + * (RESULT|IThenable.|Thenable))=} opt_onFulfilled + * @param {?(function(*): *)=} opt_onRejected + * @return {!IThenable.} + * @template RESULT + */ +IThenable.prototype.then = function(opt_onFulfilled, opt_onRejected) {}; + + +/** + * @see https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects + * @param {function( + * function((TYPE|IThenable.|Thenable|null)=), + * function(*=))} resolver + * @constructor + * @implements {IThenable.} + * @template TYPE + */ +var Promise = function(resolver) {}; + + +/** + * @param {(TYPE|IThenable.)=} opt_value + * @return {!Promise.} + * @template TYPE + */ +Promise.resolve = function(opt_value) {}; + + +/** + * @param {*=} opt_error + * @return {!Promise.} + */ +Promise.reject = function(opt_error) {}; + + +/** + * @template T + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise + * @param {!Array>} iterable + * @return {!Promise>} + */ +Promise.all = function(iterable) {}; + + +/** + * @template T + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise + * @param {!Array.} iterable + * @return {!Promise.} + */ +Promise.race = function(iterable) {}; + + +/** + * @param {?(function(TYPE): + * (RESULT|IThenable.|Thenable))=} opt_onFulfilled + * @param {?(function(*): *)=} opt_onRejected + * @return {!Promise.} + * @template RESULT + * @override + */ +Promise.prototype.then = function(opt_onFulfilled, opt_onRejected) {}; + + +/** + * @param {function(*): RESULT} onRejected + * @return {!Promise.} + * @template RESULT + */ +Promise.prototype.catch = function(onRejected) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js new file mode 100644 index 000000000..8be2d6daa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js @@ -0,0 +1,253 @@ +/* + * Copyright 2014 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for ECMAScript 6. + * @see http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts + * @externs + */ + +// TODO(johnlenz): Use Tuples for the Map and Set iterators where appropriate. + +/** + * @constructor + * @param {Iterable.>|!Array.>=} opt_iterable + * @implements {Iterable.>} + * @template KEY, VALUE + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map + */ +function Map(opt_iterable) {} + +/** @return {void} */ +Map.prototype.clear; + +/** + * @param {KEY} key + * @return {boolean} + */ +Map.prototype.delete; + +/** + * @return {!Iterator.>} + * @nosideeffects + */ +Map.prototype.entries; + +/** + * @param {function(this:THIS, VALUE, KEY, MAP):void} callback + * @param {THIS} thisArg + * @this {MAP} + * @template MAP,THIS + */ +Map.prototype.forEach; + +/** + * @param {KEY} key + * @return {VALUE|undefined} + * @nosideeffects + */ +Map.prototype.get; + +/** + * @param {KEY} key + * @return {boolean} + * @nosideeffects + */ +Map.prototype.has; + +/** + * @return {!Iterator.} + */ +Map.prototype.keys; + +/** + * @param {KEY} key + * @param {VALUE} value + * @return {THIS} + * @this {THIS} + * @template THIS + */ +Map.prototype.set; + +/** + * @type {number} + * (readonly) + */ +Map.prototype.size; + +/** + * @return {!Iterator.} + * @nosideeffects + */ +Map.prototype.values; + +/** + * @return {!Iterator.>} + */ +Map.prototype[Symbol.iterator] = function() {}; + + +/** + * @constructor + * @param {Iterable.>|!Array.>=} opt_iterable + * @template KEY, VALUE + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap + */ +function WeakMap(opt_iterable) {} + +/** @return {void} */ +WeakMap.prototype.clear; + +/** + * @param {KEY} key + * @return {boolean} + */ +WeakMap.prototype.delete; + +/** + * @param {KEY} key + * @return {VALUE|undefined} + * @nosideeffects + */ +WeakMap.prototype.get; + +/** + * @param {KEY} key + * @return {boolean} + * @nosideeffects + */ +WeakMap.prototype.has; + +/** + * @param {KEY} key + * @param {VALUE} value + * @return {THIS} + * @this {THIS} + * @template THIS + */ +WeakMap.prototype.set; + + + +/** + * @constructor + * @param {Iterable.|Array.=} opt_iterable + * @implements {Iterable.} + * @template VALUE + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set + */ +function Set(opt_iterable) {} + +/** + * @param {VALUE} value + * @return {THIS} + * @this {THIS} + * @template THIS + */ +Set.prototype.add; + +/** + * @return {void} + */ +Set.prototype.clear; + +/** + * @param {VALUE} value + * @return {boolean} + */ +Set.prototype.delete; + +/** + * @return {!Iterator.>} Where each array has two entries: + * [value, value] + * @nosideeffects + */ +Set.prototype.entries; + +/** + * @param {function(VALUE, VALUE, SET)} callback + * @param {THIS} thisArg + * @this {SET} + * @template SET,THIS + */ +Set.prototype.forEach; + +/** + * @param {VALUE} value + * @return {boolean} + * @nosideeffects + */ +Set.prototype.has; + +/** + * @type {number} (readonly) + */ +Set.prototype.size; + +/** + * @return {!Iterator.} + * @nosideeffects + */ +Set.prototype.keys; + +/** + * @return {!Iterator.} + * @nosideeffects + */ +Set.prototype.values; + +/** + * @return {!Iterator.} + */ +Set.prototype[Symbol.iterator] = function() {}; + + + +/** + * @constructor + * @param {Iterable.|Array.=} opt_iterable + * @template VALUE + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set + */ +function WeakSet(opt_iterable) {} + +/** + * @param {VALUE} value + * @return {THIS} + * @this {THIS} + * @template THIS + */ +WeakSet.prototype.add; + +/** + * @return {void} + */ +WeakSet.prototype.clear; + +/** + * @param {VALUE} value + * @return {boolean} + */ +WeakSet.prototype.delete; + +/** + * @param {VALUE} value + * @return {boolean} + * @nosideeffects + */ +WeakSet.prototype.has; + + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js new file mode 100644 index 000000000..f878a9d22 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js @@ -0,0 +1,961 @@ +/* + * Copyright 2010 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for objects in the File API, File Writer API, and + * File System API. Details of the API are at: + * http://www.w3.org/TR/FileAPI/ + * http://www.w3.org/TR/file-writer-api/ + * http://www.w3.org/TR/file-system-api/ + * + * @externs + * @author dbk@google.com (David Barrett-Kahn) + */ + + +/** + * @see http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob + * @param {Array.=} opt_blobParts + * @param {Object=} opt_options + * @constructor + * @nosideeffects + */ +function Blob(opt_blobParts, opt_options) {} + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-size + * @type {number} + */ +Blob.prototype.size; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-type + * @type {string} + */ +Blob.prototype.type; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-slice + * @param {number} start + * @param {number} length + * @return {!Blob} + * @nosideeffects + */ +Blob.prototype.slice = function(start, length) {}; + +/** + * This replaces Blob.slice in Chrome since WebKit revision 84005. + * @see http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0222.html + * @param {number} start + * @param {number} end + * @return {!Blob} + * @nosideeffects + */ +Blob.prototype.webkitSlice = function(start, end) {}; + +/** + * This replaces Blob.slice in Firefox. + * @see http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0222.html + * @param {number} start + * @param {number} end + * @return {!Blob} + * @nosideeffects + */ +Blob.prototype.mozSlice = function(start, end) {}; + +/** + * @see http://www.w3.org/TR/file-writer-api/#the-blobbuilder-interface + * @constructor + */ +function BlobBuilder() {} + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append0 + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append1 + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append2 + * @param {string|Blob|ArrayBuffer} data + * @param {string=} endings + */ +BlobBuilder.prototype.append = function(data, endings) {}; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-getBlob + * @param {string=} contentType + * @return {!Blob} + */ +BlobBuilder.prototype.getBlob = function(contentType) {}; + +/** + * This has replaced BlobBuilder in Chrome since WebKit revision 84008. + * @see http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0222.html + * @constructor + */ +function WebKitBlobBuilder() {} + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append0 + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append1 + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append2 + * @param {string|Blob|ArrayBuffer} data + * @param {string=} endings + */ +WebKitBlobBuilder.prototype.append = function(data, endings) {}; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-getBlob + * @param {string=} contentType + * @return {!Blob} + */ +WebKitBlobBuilder.prototype.getBlob = function(contentType) {}; + + +/** + * @see http://www.w3.org/TR/file-system-api/#the-directoryentry-interface + * @constructor + * @extends {Entry} + */ +function DirectoryEntry() {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-createReader + * @return {!DirectoryReader} + */ +DirectoryEntry.prototype.createReader = function() {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-getFile + * @param {string} path + * @param {Object=} options + * @param {function(!FileEntry)=} successCallback + * @param {function(!FileError)=} errorCallback + */ +DirectoryEntry.prototype.getFile = function(path, options, successCallback, + errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-getDirectory + * @param {string} path + * @param {Object=} options + * @param {function(!DirectoryEntry)=} successCallback + * @param {function(!FileError)=} errorCallback + */ +DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, + errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-removeRecursively + * @param {function()} successCallback + * @param {function(!FileError)=} errorCallback + */ +DirectoryEntry.prototype.removeRecursively = function(successCallback, + errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#the-directoryreader-interface + * @constructor + */ +function DirectoryReader() {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryReader-readEntries + * @param {function(!Array.)} successCallback + * @param {function(!FileError)=} errorCallback + */ +DirectoryReader.prototype.readEntries = function(successCallback, + errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#the-entry-interface + * @constructor + */ +function Entry() {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-isFile + * @type {boolean} + */ +Entry.prototype.isFile; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-isDirectory + * @type {boolean} + */ +Entry.prototype.isDirectory; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-name + * @type {string} + */ +Entry.prototype.name; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-fullPath + * @type {string} + */ +Entry.prototype.fullPath; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-filesystem + * @type {!FileSystem} + */ +Entry.prototype.filesystem; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-moveTo + * @param {!DirectoryEntry} parent + * @param {string=} newName + * @param {function(!Entry)=} successCallback + * @param {function(!FileError)=} errorCallback + */ +Entry.prototype.moveTo = function(parent, newName, successCallback, + errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-copyTo + * @param {!DirectoryEntry} parent + * @param {string=} newName + * @param {function(!Entry)=} successCallback + * @param {function(!FileError)=} errorCallback + */ +Entry.prototype.copyTo = function(parent, newName, successCallback, + errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-toURL + * @param {string=} mimeType + * @return {string} + */ +Entry.prototype.toURL = function(mimeType) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-remove + * @param {function()} successCallback + * @param {function(!FileError)=} errorCallback + */ +Entry.prototype.remove = function(successCallback, errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-getMetadata + * @param {function(!Metadata)} successCallback + * @param {function(!FileError)=} errorCallback + */ +Entry.prototype.getMetadata = function(successCallback, errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Entry-getParent + * @param {function(!Entry)} successCallback + * @param {function(!FileError)=} errorCallback + */ +Entry.prototype.getParent = function(successCallback, errorCallback) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-file + * @constructor + * @extends {Blob} + */ +function File() {} + +/** + * Chrome uses this instead of name. + * @deprecated Use name instead. + * @type {string} + */ +File.prototype.fileName; + +/** + * Chrome uses this instead of size. + * @deprecated Use size instead. + * @type {string} + */ +File.prototype.fileSize; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-name + * @type {string} + */ +File.prototype.name; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-lastModifiedDate + * @type {Date} + */ +File.prototype.lastModifiedDate; + +/** + * @see http://www.w3.org/TR/file-system-api/#the-fileentry-interface + * @constructor + * @extends {Entry} + */ +function FileEntry() {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileEntry-createWriter + * @param {function(!FileWriter)} successCallback + * @param {function(!FileError)=} errorCallback + */ +FileEntry.prototype.createWriter = function(successCallback, errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileEntry-file + * @param {function(!File)} successCallback + * @param {function(!FileError)=} errorCallback + */ +FileEntry.prototype.file = function(successCallback, errorCallback) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#FileErrorInterface + * @constructor + * @extends {DOMError} + */ +function FileError() {} + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-NOT_FOUND_ERR + * @type {number} + */ +FileError.prototype.NOT_FOUND_ERR = 1; + +/** @type {number} */ +FileError.NOT_FOUND_ERR = 1; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-SECURITY_ERR + * @type {number} + */ +FileError.prototype.SECURITY_ERR = 2; + +/** @type {number} */ +FileError.SECURITY_ERR = 2; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-ABORT_ERR + * @type {number} + */ +FileError.prototype.ABORT_ERR = 3; + +/** @type {number} */ +FileError.ABORT_ERR = 3; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-NOT_READABLE_ERR + * @type {number} + */ +FileError.prototype.NOT_READABLE_ERR = 4; + +/** @type {number} */ +FileError.NOT_READABLE_ERR = 4; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-ENCODING_ERR + * @type {number} + */ +FileError.prototype.ENCODING_ERR = 5; + +/** @type {number} */ +FileError.ENCODING_ERR = 5; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileError-NO_MODIFICATION_ALLOWED_ERR + * @type {number} + */ +FileError.prototype.NO_MODIFICATION_ALLOWED_ERR = 6; + +/** @type {number} */ +FileError.NO_MODIFICATION_ALLOWED_ERR = 6; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileException-INVALID_STATE_ERR + * @type {number} + */ +FileError.prototype.INVALID_STATE_ERR = 7; + +/** @type {number} */ +FileError.INVALID_STATE_ERR = 7; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileException-SYNTAX_ERR + * @type {number} + */ +FileError.prototype.SYNTAX_ERR = 8; + +/** @type {number} */ +FileError.SYNTAX_ERR = 8; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileError-INVALID_MODIFICATION_ERR + * @type {number} + */ +FileError.prototype.INVALID_MODIFICATION_ERR = 9; + +/** @type {number} */ +FileError.INVALID_MODIFICATION_ERR = 9; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileError-QUOTA_EXCEEDED_ERR + * @type {number} + */ +FileError.prototype.QUOTA_EXCEEDED_ERR = 10; + +/** @type {number} */ +FileError.QUOTA_EXCEEDED_ERR = 10; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileException-TYPE_MISMATCH_ERR + * @type {number} + */ +FileError.prototype.TYPE_MISMATCH_ERR = 11; + +/** @type {number} */ +FileError.TYPE_MISMATCH_ERR = 11; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileException-PATH_EXISTS_ERR + * @type {number} + */ +FileError.prototype.PATH_EXISTS_ERR = 12; + +/** @type {number} */ +FileError.PATH_EXISTS_ERR = 12; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-code-exception + * @type {number} + * @deprecated Use the 'name' or 'message' attributes of DOMError rather than + * 'code' + */ +FileError.prototype.code; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-filereader + * @constructor + * @implements {EventTarget} + */ +function FileReader() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +FileReader.prototype.addEventListener = function(type, listener, opt_useCapture) + {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +FileReader.prototype.removeEventListener = function(type, listener, + opt_useCapture) {}; + +/** @override */ +FileReader.prototype.dispatchEvent = function(evt) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-readAsArrayBuffer + * @param {!Blob} blob + */ +FileReader.prototype.readAsArrayBuffer = function(blob) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-readAsBinaryStringAsync + * @param {!Blob} blob + */ +FileReader.prototype.readAsBinaryString = function(blob) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-readAsText + * @param {!Blob} blob + * @param {string=} encoding + */ +FileReader.prototype.readAsText = function(blob, encoding) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-readAsDataURL + * @param {!Blob} blob + */ +FileReader.prototype.readAsDataURL = function(blob) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-abort + */ +FileReader.prototype.abort = function() {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-empty + * @type {number} + */ +FileReader.prototype.EMPTY = 0; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-loading + * @type {number} + */ +FileReader.prototype.LOADING = 1; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-done + * @type {number} + */ +FileReader.prototype.DONE = 2; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-readystate + * @type {number} + */ +FileReader.prototype.readyState; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-result + * @type {string|Blob|ArrayBuffer} + */ +FileReader.prototype.result; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-error + * @type {FileError} + */ +FileReader.prototype.error; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-onloadstart + * @type {?function(!ProgressEvent)} + */ +FileReader.prototype.onloadstart; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-onprogress + * @type {?function(!ProgressEvent)} + */ +FileReader.prototype.onprogress; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-onload + * @type {?function(!ProgressEvent)} + */ +FileReader.prototype.onload; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-onabort + * @type {?function(!ProgressEvent)} + */ +FileReader.prototype.onabort; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-onerror + * @type {?function(!ProgressEvent)} + */ +FileReader.prototype.onerror; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-onloadend + * @type {?function(!ProgressEvent)} + */ +FileReader.prototype.onloadend; + +/** + * @see http://www.w3.org/TR/file-writer-api/#idl-def-FileSaver + * @constructor + */ +function FileSaver() {}; + +/** @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-abort */ +FileSaver.prototype.abort = function() {}; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-INIT + * @type {number} + */ +FileSaver.prototype.INIT = 0; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-WRITING + * @type {number} + */ +FileSaver.prototype.WRITING = 1; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-DONE + * @type {number} + */ +FileSaver.prototype.DONE = 2; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-readyState + * @type {number} + */ +FileSaver.prototype.readyState; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-error + * @type {FileError} + */ +FileSaver.prototype.error; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwritestart + * @type {?function(!ProgressEvent)} + */ +FileSaver.prototype.onwritestart; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onprogress + * @type {?function(!ProgressEvent)} + */ +FileSaver.prototype.onprogress; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwrite + * @type {?function(!ProgressEvent)} + */ +FileSaver.prototype.onwrite; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onabort + * @type {?function(!ProgressEvent)} + */ +FileSaver.prototype.onabort; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onerror + * @type {?function(!ProgressEvent)} + */ +FileSaver.prototype.onerror; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwriteend + * @type {?function(!ProgressEvent)} + */ +FileSaver.prototype.onwriteend; + +/** + * @see http://www.w3.org/TR/file-system-api/#the-filesystem-interface + * @constructor + */ +function FileSystem() {} + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileSystem-name + * @type {string} + */ +FileSystem.prototype.name; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-FileSystem-root + * @type {!DirectoryEntry} + */ +FileSystem.prototype.root; + +/** + * @see http://www.w3.org/TR/file-writer-api/#idl-def-FileWriter + * @constructor + * @extends {FileSaver} + */ +function FileWriter() {} + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-position + * @type {number} + */ +FileWriter.prototype.position; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-length + * @type {number} + */ +FileWriter.prototype.length; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-write + * @param {!Blob} blob + */ +FileWriter.prototype.write = function(blob) {}; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-seek + * @param {number} offset + */ +FileWriter.prototype.seek = function(offset) {}; + +/** + * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-truncate + * @param {number} size + */ +FileWriter.prototype.truncate = function(size) {}; + +/** + * LocalFileSystem interface, implemented by Window and WorkerGlobalScope. + * @see http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem + * @constructor + */ +function LocalFileSystem() {} + +/** + * Metadata interface. + * @see http://www.w3.org/TR/file-system-api/#idl-def-Metadata + * @constructor + */ +function Metadata() {} + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Metadata-modificationTime + * @type {!Date} + */ +Metadata.prototype.modificationTime; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-Metadata-size + * @type {number} + */ +Metadata.prototype.size; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-TEMPORARY + * @type {number} +*/ +Window.prototype.TEMPORARY = 0; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-PERSISTENT + * @type {number} +*/ +Window.prototype.PERSISTENT = 1; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem + * @param {number} type + * @param {number} size + * @param {function(!FileSystem)} successCallback + * @param {function(!FileError)=} errorCallback + */ +function requestFileSystem(type, size, successCallback, errorCallback) {} + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem + * @param {number} type + * @param {number} size + * @param {function(!FileSystem)} successCallback + * @param {function(!FileError)=} errorCallback + */ +Window.prototype.requestFileSystem = function(type, size, successCallback, + errorCallback) {}; + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI + * @param {string} uri + * @param {function(!Entry)} successCallback + * @param {function(!FileError)=} errorCallback + */ +function resolveLocalFileSystemURI(uri, successCallback, errorCallback) {} + +/** + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI + * @param {string} uri + * @param {function(!Entry)} successCallback + * @param {function(!FileError)=} errorCallback + */ +Window.prototype.resolveLocalFileSystemURI = function(uri, successCallback, + errorCallback) {} + +/** + * This has replaced requestFileSystem in Chrome since WebKit revision 84224. + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem + * @param {number} type + * @param {number} size + * @param {function(!FileSystem)} successCallback + * @param {function(!FileError)=} errorCallback + */ +function webkitRequestFileSystem(type, size, successCallback, errorCallback) {} + +/** + * This has replaced requestFileSystem in Chrome since WebKit revision 84224. + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem + * @param {number} type + * @param {number} size + * @param {function(!FileSystem)} successCallback + * @param {function(!FileError)=} errorCallback + */ +Window.prototype.webkitRequestFileSystem = function(type, size, successCallback, + errorCallback) {}; + +/** + * This has replaced resolveLocalFileSystemURI in Chrome since WebKit revision + * 84224. + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI + * @param {string} uri + * @param {function(!Entry)} successCallback + * @param {function(!FileError)=} errorCallback + */ +function webkitResolveLocalFileSystemURI(uri, successCallback, errorCallback) {} + +/** + * This has replaced resolveLocalFileSystemURI in Chrome since WebKit revision + * 84224. + * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI + * @param {string} uri + * @param {function(!Entry)} successCallback + * @param {function(!FileError)=} errorCallback + */ +Window.prototype.webkitResolveLocalFileSystemURI = function(uri, successCallback, + errorCallback) {} + +// WindowBlobURIMethods interface, implemented by Window and WorkerGlobalScope. +// There are three APIs for this: the old specced API, the new specced API, and +// the webkit-prefixed API. +// @see http://www.w3.org/TR/FileAPI/#creating-revoking + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL + * @param {!Object} obj + * @return {string} + */ +function createObjectURL(obj) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL + * @param {!Object} obj + * @return {string} + */ +Window.prototype.createObjectURL = function(obj) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL + * @param {string} url + */ +function revokeObjectURL(url) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL + * @param {string} url + */ +Window.prototype.revokeObjectURL = function(url) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#URL-object + * @constructor + */ +function DOMURL() {} + +/** + * @see http://www.w3.org/TR/FileAPI/# + * @constructor + * @param {string} urlString + * @param {string=} opt_base + * @extends {DOMURL} + */ +function URL(urlString, opt_base) {} + +/** @type {string} */ +URL.prototype.protocol; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL + * @param {!File|!Blob|!MediaSource|!MediaStream} obj + * @return {string} + */ +URL.createObjectURL = function(obj) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL + * @param {string} url + */ +URL.revokeObjectURL = function(url) {}; + +/** + * This has been replaced by URL in Chrome since WebKit revision 75739. + * @constructor + * @param {string} urlString + * @param {string=} opt_base + * @extends {DOMURL} + */ +function webkitURL(urlString, opt_base) {} + +/** @constructor */ +window.webkitURL = webkitURL; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL + * @param {!Object} obj + * @return {string} + */ +webkitURL.createObjectURL = function(obj) {}; + +/** + * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL + * @param {string} url + */ +webkitURL.revokeObjectURL = function(url) {}; + +/** + * @see https://developers.google.com/chrome/whitepapers/storage + * @constructor + */ +function StorageInfo() {} + +/** + * @see https://developers.google.com/chrome/whitepapers/storage + * @type {number} + * */ +StorageInfo.prototype.TEMPORARY = 0; + +/** + * @see https://developers.google.com/chrome/whitepapers/storage + * @type {number} + */ +StorageInfo.prototype.PERSISTENT = 1; + +/** + * @see https://developers.google.com/chrome/whitepapers/storage#requestQuota + * @param {number} type + * @param {number} size + * @param {function(number)} successCallback + * @param {function(!DOMException)=} errorCallback + */ +StorageInfo.prototype.requestQuota = function(type, size, successCallback, + errorCallback) {}; + +/** + * @see https://developers.google.com/chrome/whitepapers/storage#queryUsageAndQuota + * @param {number} type + * @param {function(number, number)} successCallback + * @param {function(!DOMException)=} errorCallback + */ +StorageInfo.prototype.queryUsageAndQuota = function(type, successCallback, + errorCallback) {}; + +/** + * @see https://developers.google.com/chrome/whitepapers/storage + * @type {!StorageInfo} + */ +Window.prototype.webkitStorageInfo; + +/** + * @see https://dvcs.w3.org/hg/quota/raw-file/tip/Overview.html#storagequota-interface. + * @constructor + */ +function StorageQuota() {} + +/** + * @param {number} size + * @param {function(number)=} opt_successCallback + * @param {function(!DOMException)=} opt_errorCallback + */ +StorageQuota.prototype.requestQuota = function(size, opt_successCallback, + opt_errorCallback) {}; + +/** + * @param {function(number, number)} successCallback + * @param {function(!DOMException)=} opt_errorCallback + */ +StorageQuota.prototype.queryUsageAndQuota = function(successCallback, + opt_errorCallback) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js new file mode 100644 index 000000000..097bd8691 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js @@ -0,0 +1,210 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for all the Flash Object JavaScript methods. This + * file depends on w3c_dom2.js. + * Created from + * http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html + * + * @externs + */ + + +// Standard Methods. + +/** + * Call a Flash function exported by ExternalInterface. + * @param {string} xmlString The XML string passed to Flash. The outer element + * should be {@code }. A sample invocation string: + * {@code + * test} + * @return {string} The serialized return value from Flash that you can eval. + */ +HTMLObjectElement.prototype.CallFunction = function(xmlString) {}; + +/** + * Returns the value of the Flash variable specified by varName or null if the + * variable does not exist. + * @param {string} varName The variable name. + * @return {string?} The variable value. + */ +HTMLObjectElement.prototype.GetVariable = function(varName) {}; + +/** + * Activates the frame number specified by {@code frameNumber} in the current + * movie. + * @param {number} frameNumber A non-negative integer frame number. + */ +HTMLObjectElement.prototype.GotoFrame = function(frameNumber) {}; + +/** + * @return {boolean} Whether the movie is currently playing. + */ +HTMLObjectElement.prototype.IsPlaying = function() {}; + +/** + * Loads the movie identified by {@code url} to the layer specified by {@code + * layerNumber}. + * @param {number} layerNumber The layer number. + * @param {string} url The movie URL. + */ +HTMLObjectElement.prototype.LoadMovie = function(layerNumber, url) {}; + +/** + * Pans a zoomed-in movie to the coordinates specified by x and y. Use mode to + * specify whether the values for x and y are pixels or a percent of the window. + * When mode is 0, the coordinates are pixels; when mode is 1, the coordinates + * are percent of the window. + * @param {number} x The x-coordinate. + * @param {number} y The y-coordinate. + * @param {number} mode The mode. + */ +HTMLObjectElement.prototype.Pan = function(x, y, mode) {}; + +/** + * @return {number} The percent of the Flash Player movie that has streamed + * into the browser so far; Possible values are from 0 to 100. + */ +HTMLObjectElement.prototype.PercentLoaded = function() {}; + +/** + * Starts playing the movie. + */ +HTMLObjectElement.prototype.Play = function() {}; + +/** + * Goes to the first frame. + */ +HTMLObjectElement.prototype.Rewind = function() {}; + +/** + * Sets the value of the flash variable. + * @param {string} variableName The variable name. + * @param {string} value The value. + */ +HTMLObjectElement.prototype.SetVariable = function(variableName, value) {}; + +/** + * Zooms in on a rectangular area of the movie. The units of the coordinates + * are in twips (1440 units per inch). + * @param {number} left The left coordinate. + * @param {number} top The top coordinate. + * @param {number} right The right coordinate. + * @param {number} bottom The bottom coordinate. + */ +HTMLObjectElement.prototype.SetZoomRect = function(left, top, right, bottom) {}; + +/** + * Stops playing the movie. + */ +HTMLObjectElement.prototype.StopPlay = function() {}; + +/** + * @return {number} The total number of frames in the movie. + */ +HTMLObjectElement.prototype.TotalFrames = function() {}; + +/** + * Zooms the view by a relative scale factor. + * @param {number} percent The percentage scale factor, should be an integer. + */ +HTMLObjectElement.prototype.Zoom = function(percent) {}; + + +// TellTarget Methods. + +/** + * Executes the action in the timeline specified by {@code target} in the + * specified frame. + * @param {string} target The timeline. + * @param {number} frameNumber The frame number. + */ +HTMLObjectElement.prototype.TCallFrame = function(target, frameNumber) {}; + +/** + * Executes the action in the timeline specified by {@code target} in the + * specified frame. + * @param {string} target The timeline. + * @param {string} label The frame label. + */ +HTMLObjectElement.prototype.TCallLabel = function(target, label) {}; + +/** + * Returns the number of the current frame for the specified timeline. + * @param {string} target The timeline. + * @return {number} The number of the current frame. + */ +HTMLObjectElement.prototype.TCurentFrame = function(target) {}; + +/** + * Returns the label of the current frame for the specified timeline. + * @param {string} target The timeline. + * @return {string} The label of the current frame, empty string if no + * current frame. + */ +HTMLObjectElement.prototype.TCurrentLabel = function(target) {}; + +/** + * Returns a string indicating the value of the property in the + * specified timeline. + * @param {string} target The timeline. + * @param {number} property The integer corresponding to the desired property. + * @return {string} The value of the property. + */ +HTMLObjectElement.prototype.TGetProperty = function(target, property) {}; + +/** + * Returns a number indicating the value of the property in the specified + * timeline. + * @param {string} target The timeline. + * @param {number} property The integer corresponding to the desired property. + * @return {number} A number indicating the value of the property. + */ +HTMLObjectElement.prototype.TGetPropertyAsNumber = function(target, property) {}; + +/** + * Goes to the specified frame number in the specified timeline. + * @param {string} target The timeline. + * @param {number} frameNumber The frame number. + */ +HTMLObjectElement.prototype.TGotoFrame = function(target, frameNumber) {}; + +/** + * Goes to the specified frame label in the specified timeline. + * @param {string} target The timeline. + * @param {string} label The framelabel. + */ +HTMLObjectElement.prototype.TGotoLabel = function(target, label) {}; + +/** + * Plays the specified timeline. + * @param {number} target The timeline. + */ +HTMLObjectElement.prototype.TPlay = function(target) {}; + +/** + * Sets the value of the property in the specified timeline. + * @param {number} target The timeline. + * @param {number} property The integer corresponding to the desired property. + * @param {string|number} value The value. + */ +HTMLObjectElement.prototype.TSetProperty = function(target, property, value) {}; + +/** + * Stops the specified timeline. + * @param {number} target The timeline. + */ +HTMLObjectElement.prototype.TStopPlay = function(target) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js new file mode 100644 index 000000000..c85f7b10f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js @@ -0,0 +1,126 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for Gecko's custom CSS properties. Copied from: + * http://mxr.mozilla.org/mozilla2.0/source/dom/interfaces/css/nsIDOMCSS2Properties.idl + * + * @externs + * @author nicksantos@google.com (Nick Santos) + */ + + +/** @type {string} */ CSSProperties.prototype.MozAppearance; +/** @type {string} */ CSSProperties.prototype.MozBackfaceVisibility; +/** @type {string} */ CSSProperties.prototype.MozBackgroundClip; +/** @type {string} */ CSSProperties.prototype.MozBackgroundInlinePolicy; +/** @type {string} */ CSSProperties.prototype.MozBackgroundOrigin; +/** @type {string} */ CSSProperties.prototype.MozBinding; +/** @type {string} */ CSSProperties.prototype.MozBorderBottomColors; +/** @type {string} */ CSSProperties.prototype.MozBorderEnd; +/** @type {string} */ CSSProperties.prototype.MozBorderEndColor; +/** @type {string} */ CSSProperties.prototype.MozBorderEndStyle; +/** @type {string} */ CSSProperties.prototype.MozBorderEndWidth; +/** @type {string} */ CSSProperties.prototype.MozBorderImage; +/** @type {string} */ CSSProperties.prototype.MozBorderLeftColors; +/** @type {string} */ CSSProperties.prototype.MozBorderRadius; +/** @type {string} */ CSSProperties.prototype.MozBorderRadiusTopleft; +/** @type {string} */ CSSProperties.prototype.MozBorderRadiusTopright; +/** @type {string} */ CSSProperties.prototype.MozBorderRadiusBottomleft; +/** @type {string} */ CSSProperties.prototype.MozBorderRadiusBottomright; +/** @type {string} */ CSSProperties.prototype.MozBorderRightColors; +/** @type {string} */ CSSProperties.prototype.MozBorderStart; +/** @type {string} */ CSSProperties.prototype.MozBorderStartColor; +/** @type {string} */ CSSProperties.prototype.MozBorderStartStyle; +/** @type {string} */ CSSProperties.prototype.MozBorderStartWidth; +/** @type {string} */ CSSProperties.prototype.MozBorderTopColors; +/** @type {string} */ CSSProperties.prototype.MozBoxAlign; +/** @type {string} */ CSSProperties.prototype.MozBoxDirection; +/** @type {string} */ CSSProperties.prototype.MozBoxFlex; +/** @type {string} */ CSSProperties.prototype.MozBoxOrdinalGroup; +/** @type {string} */ CSSProperties.prototype.MozBoxOrient; +/** @type {string} */ CSSProperties.prototype.MozBoxPack; +/** @type {string} */ CSSProperties.prototype.MozBoxSizing; +/** @type {string} */ CSSProperties.prototype.MozBoxShadow; +/** @type {string} */ CSSProperties.prototype.MozColumnCount; +/** @type {string} */ CSSProperties.prototype.MozColumnGap; +/** @type {string} */ CSSProperties.prototype.MozColumnRule; +/** @type {string} */ CSSProperties.prototype.MozColumnRuleColor; +/** @type {string} */ CSSProperties.prototype.MozColumnRuleStyle; +/** @type {string} */ CSSProperties.prototype.MozColumnRuleWidth; +/** @type {string} */ CSSProperties.prototype.MozColumnWidth; +/** @type {string} */ CSSProperties.prototype.MozFloatEdge; +/** @type {string} */ CSSProperties.prototype.MozFontFeatureSettings; +/** @type {string} */ CSSProperties.prototype.MozFontLanguageOverride; +/** @type {string} */ CSSProperties.prototype.MozForceBrokenImageIcon; +/** @type {string} */ CSSProperties.prototype.MozImageRegion; +/** @type {string} */ CSSProperties.prototype.MozMarginEnd; +/** @type {string} */ CSSProperties.prototype.MozMarginStart; +/** @type {number|string} */ CSSProperties.prototype.MozOpacity; +/** @type {string} */ CSSProperties.prototype.MozOutline; +/** @type {string} */ CSSProperties.prototype.MozOutlineColor; +/** @type {string} */ CSSProperties.prototype.MozOutlineOffset; +/** @type {string} */ CSSProperties.prototype.MozOutlineRadius; +/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusBottomleft; +/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusBottomright; +/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusTopleft; +/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusTopright; +/** @type {string} */ CSSProperties.prototype.MozOutlineStyle; +/** @type {string} */ CSSProperties.prototype.MozOutlineWidth; +/** @type {string} */ CSSProperties.prototype.MozPaddingEnd; +/** @type {string} */ CSSProperties.prototype.MozPaddingStart; +/** @type {string} */ CSSProperties.prototype.MozPerspective; +/** @type {string} */ CSSProperties.prototype.MozStackSizing; +/** @type {string} */ CSSProperties.prototype.MozTabSize; +/** @type {string} */ CSSProperties.prototype.MozTransform; +/** @type {string} */ CSSProperties.prototype.MozTransformOrigin; +/** @type {string} */ CSSProperties.prototype.MozTransition; +/** @type {string} */ CSSProperties.prototype.MozTransitionDelay; +/** @type {string} */ CSSProperties.prototype.MozTransitionDuration; +/** @type {string} */ CSSProperties.prototype.MozTransitionProperty; +/** @type {string} */ CSSProperties.prototype.MozTransitionTimingFunction; +/** @type {string} */ CSSProperties.prototype.MozUserFocus; +/** @type {string} */ CSSProperties.prototype.MozUserInput; +/** @type {string} */ CSSProperties.prototype.MozUserModify; +/** @type {string} */ CSSProperties.prototype.MozUserSelect; +/** @type {string} */ CSSProperties.prototype.MozWindowShadow; + + +// These are non-standard Gecko CSSOM properties on Window.prototype.screen. + +/** + * @type {number} + * @see https://developer.mozilla.org/En/DOM/window.screen.availTop + */ +Screen.prototype.availTop; + +/** + * @type {number} + * @see https://developer.mozilla.org/En/DOM/window.screen.availLeft + */ +Screen.prototype.availLeft; + +/** + * @type {number} + * @see https://developer.mozilla.org/En/DOM/window.screen.left + */ +Screen.prototype.left; + +/** + * @type {number} + * @see https://developer.mozilla.org/En/DOM/window.screen.top + */ +Screen.prototype.top; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js new file mode 100644 index 000000000..a3314d812 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js @@ -0,0 +1,1120 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for all the extensions over + * W3C's DOM specification by Gecko. This file depends on + * w3c_dom2.js. + * + * When a non-standard extension appears in both Gecko and IE, we put + * it in gecko_dom.js + * + * @externs + */ + +// TODO: Almost all of it has not been annotated with types. + +// Gecko DOM; + +/** + * Mozilla only??? + * @constructor + * @extends {HTMLElement} + */ +function HTMLSpanElement() {} + +/** + * @see https://developer.mozilla.org/en/Components_object + */ +Window.prototype.Components; + +/** + * @type Window + * @see https://developer.mozilla.org/en/DOM/window.content + */ +Window.prototype.content; + +/** + * @type {boolean} + * @see https://developer.mozilla.org/en/DOM/window.closed + */ +Window.prototype.closed; + +/** @see https://developer.mozilla.org/en/DOM/window.controllers */ +Window.prototype.controllers; + +/** @see https://developer.mozilla.org/en/DOM/window.crypto */ +Window.prototype.crypto; + +/** + * Gets/sets the status bar text for the given window. + * @type {string} + * @see https://developer.mozilla.org/en/DOM/window.defaultStatus + */ +Window.prototype.defaultStatus; + +/** @see https://developer.mozilla.org/en/DOM/window.dialogArguments */ +Window.prototype.dialogArguments; + +/** @see https://developer.mozilla.org/en/DOM/window.directories */ +Window.prototype.directories; + +/** + * @type {HTMLObjectElement|HTMLIFrameElement|null} + * @see https://developer.mozilla.org/en/DOM/window.frameElement + */ +Window.prototype.frameElement; + +/** + * Allows lookup of frames by index or by name. + * @type {?Object} + * @see https://developer.mozilla.org/en/DOM/window.frames + */ +Window.prototype.frames; + +/** + * @type {boolean} + * @see https://developer.mozilla.org/en/DOM/window.fullScreen + */ +Window.prototype.fullScreen; + +/** + * @see https://developer.mozilla.org/en/DOM/Storage#globalStorage + */ +Window.prototype.globalStorage; + +/** + * @type {!History} + * @see https://developer.mozilla.org/en/DOM/window.history + */ +Window.prototype.history; + +/** + * Returns the number of frames (either frame or iframe elements) in the + * window. + * + * @type {number} + * @see https://developer.mozilla.org/en/DOM/window.length + */ +Window.prototype.length; + +/** + * @type {!Location} + * @implicitCast + * @see https://developer.mozilla.org/en/DOM/window.location + */ +Window.prototype.location; + +/** + * @see https://developer.mozilla.org/en/DOM/window.locationbar + */ +Window.prototype.locationbar; + +/** + * @see https://developer.mozilla.org/en/DOM/window.menubar + */ +Window.prototype.menubar; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/DOM/window.name + */ +Window.prototype.name; + +/** + * @type {Navigator} + * @see https://developer.mozilla.org/en/DOM/window.navigator + */ +Window.prototype.navigator; + +/** + * @type {?Window} + * @see https://developer.mozilla.org/en/DOM/window.opener + */ +Window.prototype.opener; + +/** + * @type {!Window} + * @see https://developer.mozilla.org/en/DOM/window.parent + */ +Window.prototype.parent; + +/** @see https://developer.mozilla.org/en/DOM/window.personalbar */ +Window.prototype.personalbar; + +/** @see https://developer.mozilla.org/en/DOM/window.pkcs11 */ +Window.prototype.pkcs11; + +/** @see https://developer.mozilla.org/en/DOM/window */ +Window.prototype.returnValue; + +/** @see https://developer.mozilla.org/en/DOM/window.scrollbars */ +Window.prototype.scrollbars; + +/** + * @type {number} + * @see https://developer.mozilla.org/En/DOM/window.scrollMaxX + */ +Window.prototype.scrollMaxX; + +/** + * @type {number} + * @see https://developer.mozilla.org/En/DOM/window.scrollMaxY + */ +Window.prototype.scrollMaxY; + +/** + * @type {!Window} + * @see https://developer.mozilla.org/en/DOM/window.self + */ +Window.prototype.self; + +/** @see https://developer.mozilla.org/en/DOM/Storage#sessionStorage */ +Window.prototype.sessionStorage; + +/** @see https://developer.mozilla.org/en/DOM/window.sidebar */ +Window.prototype.sidebar; + +/** + * @type {?string} + * @see https://developer.mozilla.org/en/DOM/window.status + */ +Window.prototype.status; + +/** @see https://developer.mozilla.org/en/DOM/window.statusbar */ +Window.prototype.statusbar; + +/** @see https://developer.mozilla.org/en/DOM/window.toolbar */ +Window.prototype.toolbar; + +/** + * @type {!Window} + * @see https://developer.mozilla.org/en/DOM/window.self + */ +Window.prototype.top; + +/** + * @type {!Window} + * @see https://developer.mozilla.org/en/DOM/window.self + */ +Window.prototype.window; + +/** + * @param {*} message + * @see https://developer.mozilla.org/en/DOM/window.alert + */ +Window.prototype.alert = function(message) {}; + +/** + * Decodes a string of data which has been encoded using base-64 encoding. + * + * @param {string} encodedData + * @return {string} + * @see https://developer.mozilla.org/en/DOM/window.atob + * @nosideeffects + */ +function atob(encodedData) {} + +/** @see https://developer.mozilla.org/en/DOM/window.back */ +Window.prototype.back = function() {}; + +/** @see https://developer.mozilla.org/en/DOM/window.blur */ +Window.prototype.blur = function() {}; + +/** + * @param {string} stringToEncode + * @return {string} + * @see https://developer.mozilla.org/en/DOM/window.btoa + * @nosideeffects + */ +function btoa(stringToEncode) {} + +/** @deprecated */ +Window.prototype.captureEvents; + +/** @see https://developer.mozilla.org/en/DOM/window.close */ +Window.prototype.close = function() {}; + +/** @see https://developer.mozilla.org/en/DOM/window.find */ +Window.prototype.find; + +/** @see https://developer.mozilla.org/en/DOM/window.focus */ +Window.prototype.focus = function() {}; + +/** @see https://developer.mozilla.org/en/DOM/window.forward */ +Window.prototype.forward = function() {}; + +/** @see https://developer.mozilla.org/en/DOM/window.getAttention */ +Window.prototype.getAttention = function() {}; + +/** + * @return {Selection} + * @see https://developer.mozilla.org/en/DOM/window.getSelection + * @nosideeffects + */ +Window.prototype.getSelection = function() {}; + +/** @see https://developer.mozilla.org/en/DOM/window.home */ +Window.prototype.home = function() {}; + +Window.prototype.openDialog; +Window.prototype.releaseEvents; +Window.prototype.scrollByLines; +Window.prototype.scrollByPages; + +/** + * @param {string} uri + * @param {?=} opt_arguments + * @param {string=} opt_options + * @see https://developer.mozilla.org/en/DOM/window.showModalDialog + */ +Window.prototype.showModalDialog; + +Window.prototype.sizeToContent; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536769(VS.85).aspx + */ +Window.prototype.stop = function() {}; + +Window.prototype.updateCommands; + +// properties of Document + +/** + * @see https://developer.mozilla.org/en/DOM/document.alinkColor + * @type {string} + */ +Document.prototype.alinkColor; + +/** + * @see https://developer.mozilla.org/en/DOM/document.anchors + * @type {HTMLCollection} + */ +Document.prototype.anchors; + +/** + * @see https://developer.mozilla.org/en/DOM/document.applets + * @type {HTMLCollection} + */ +Document.prototype.applets; +/** @type {boolean} */ Document.prototype.async; +/** @type {string?} */ Document.prototype.baseURI; +Document.prototype.baseURIObject; + +/** + * @see https://developer.mozilla.org/en/DOM/document.bgColor + * @type {string} + */ +Document.prototype.bgColor; + +/** @type {HTMLBodyElement} */ Document.prototype.body; +Document.prototype.characterSet; + +/** + * @see https://developer.mozilla.org/en/DOM/document.compatMode + * @type {string} + */ +Document.prototype.compatMode; + +Document.prototype.contentType; +/** @type {string} */ Document.prototype.cookie; +Document.prototype.defaultView; + +/** + * @see https://developer.mozilla.org/en/DOM/document.designMode + * @type {string} + */ +Document.prototype.designMode; + +Document.prototype.documentURIObject; + +/** + * @see https://developer.mozilla.org/en/DOM/document.domain + * @type {string} + */ +Document.prototype.domain; + +/** + * @see https://developer.mozilla.org/en/DOM/document.embeds + * @type {HTMLCollection} + */ +Document.prototype.embeds; + +/** + * @see https://developer.mozilla.org/en/DOM/document.fgColor + * @type {string} + */ +Document.prototype.fgColor; + +/** @type {Element} */ Document.prototype.firstChild; + +/** + * @see https://developer.mozilla.org/en/DOM/document.forms + * @type {HTMLCollection} + */ +Document.prototype.forms; + +/** @type {number} */ Document.prototype.height; +/** @type {HTMLCollection} */ Document.prototype.images; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/DOM/document.lastModified + */ +Document.prototype.lastModified; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/DOM/document.linkColor + */ +Document.prototype.linkColor; + +/** + * @see https://developer.mozilla.org/en/DOM/document.links + * @type {HTMLCollection} + */ +Document.prototype.links; + +/** + * @type {!Location} + * @implicitCast + */ +Document.prototype.location; + +Document.prototype.namespaceURI; +Document.prototype.nodePrincipal; +Document.prototype.plugins; +Document.prototype.popupNode; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/DOM/document.referrer + */ +Document.prototype.referrer; + +/** + * @type {StyleSheetList} + * @see https://developer.mozilla.org/en/DOM/document.styleSheets + */ +Document.prototype.styleSheets; + +/** @type {?string} */ Document.prototype.title; +Document.prototype.tooltipNode; +/** @type {string} */ Document.prototype.URL; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/DOM/document.vlinkColor + */ +Document.prototype.vlinkColor; + +/** @type {number} */ Document.prototype.width; + +// Methods of Document +/** + * @see https://developer.mozilla.org/en/DOM/document.clear + */ +Document.prototype.clear = function() {}; + +/** + * @see https://developer.mozilla.org/en/DOM/document.close + */ +Document.prototype.close; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/API/document.createElementNS + * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate + * @param {?string} namespaceURI + * @param {string} qualifiedName + * @param {string=} opt_typeExtension + * @return {!Element} + */ +Document.prototype.createElementNS = + function(namespaceURI, qualifiedName, opt_typeExtension) {}; + +/** + * @param {string} type + * @return {Event} + */ +Document.prototype.createEvent = function(type) {}; +Document.prototype.createNSResolver; +/** @return {Range} */ Document.prototype.createRange = function() {}; +Document.prototype.createTreeWalker; + +Document.prototype.evaluate; + +/** + * @param {string} commandName + * @param {?boolean=} opt_showUi + * @param {*=} opt_value + * @see https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commands + */ +Document.prototype.execCommand; + +/** + * @param {string} s id. + * @return {HTMLElement} + * @nosideeffects + * @see https://developer.mozilla.org/en/DOM/document.getElementById + */ +Document.prototype.getElementById = function(s) {}; + +/** + * @param {string} name + * @return {!NodeList} + * @nosideeffects + * @see https://developer.mozilla.org/en/DOM/document.getElementsByClassName + */ +Document.prototype.getElementsByClassName = function(name) {}; + +/** + * @param {string} name + * @return {!NodeList} + * @nosideeffects + * @see https://developer.mozilla.org/en/DOM/document.getElementsByName + */ +Document.prototype.getElementsByName = function(name) {}; + +/** + * @param {string} namespace + * @param {string} name + * @return {!NodeList} + * @nosideeffects + * @see https://developer.mozilla.org/en/DOM/document.getElementsByTagNameNS + */ +Document.prototype.getElementsByTagNameNS = function(namespace, name) {}; + +/** + * @param {Node} externalNode + * @param {boolean} deep + * @return {Node} + */ +Document.prototype.importNode = function(externalNode, deep) {}; + +/** @param {string} uri */ +Document.prototype.load = function(uri) {}; +Document.prototype.loadOverlay; + +/** + * @see https://developer.mozilla.org/en/DOM/document.open + */ +Document.prototype.open; + +/** + * @see https://developer.mozilla.org/en/Midas + * @see http://msdn.microsoft.com/en-us/library/ms536676(VS.85).aspx + */ +Document.prototype.queryCommandEnabled; + +/** + * @see https://developer.mozilla.org/en/Midas + * @see http://msdn.microsoft.com/en-us/library/ms536678(VS.85).aspx + */ +Document.prototype.queryCommandIndeterm; + +/** + * @see https://developer.mozilla.org/en/Midas + * @see http://msdn.microsoft.com/en-us/library/ms536679(VS.85).aspx + */ +Document.prototype.queryCommandState; + +/** + * @see https://developer.mozilla.org/en/DOM/document.queryCommandSupported + * @see http://msdn.microsoft.com/en-us/library/ms536681(VS.85).aspx + * @param {string} command + * @return {?} Implementation-specific. + */ +Document.prototype.queryCommandSupported; + +/** + * @see https://developer.mozilla.org/en/Midas + * @see http://msdn.microsoft.com/en-us/library/ms536683(VS.85).aspx + */ +Document.prototype.queryCommandValue; + +/** + * @see https://developer.mozilla.org/en/DOM/document.write + * @param {string} text + */ +Document.prototype.write = function(text) {}; + +/** + * @see https://developer.mozilla.org/en/DOM/document.writeln + * @param {string} text + */ +Document.prototype.writeln = function(text) {}; + +Document.prototype.ononline; +Document.prototype.onoffline; + +// XUL +/** + * @see http://developer.mozilla.org/en/DOM/document.getBoxObjectFor + * @return {BoxObject} + * @nosideeffects + */ +Document.prototype.getBoxObjectFor = function(element) {}; + +// From: +// http://lxr.mozilla.org/mozilla1.8/source/dom/public/idl/range/nsIDOMNSRange.idl + +/** + * @param {string} tag + * @return {DocumentFragment} + */ +Range.prototype.createContextualFragment; + +/** + * @param {Node} parent + * @param {number} offset + * @return {boolean} + * @nosideeffects + */ +Range.prototype.isPointInRange; + +/** + * @param {Node} parent + * @param {number} offset + * @return {number} + * @nosideeffects + */ +Range.prototype.comparePoint; + +/** + * @param {Node} n + * @return {boolean} + * @nosideeffects + */ +Range.prototype.intersectsNode; + +/** + * @param {Node} n + * @return {number} + * @nosideeffects + */ +Range.prototype.compareNode; + + +/** @constructor */ +function Selection() {} + +/** + * @type {Node} + * @see https://developer.mozilla.org/en/DOM/Selection/anchorNode + */ +Selection.prototype.anchorNode; + +/** + * @type {number} + * @see https://developer.mozilla.org/en/DOM/Selection/anchorOffset + */ +Selection.prototype.anchorOffset; + +/** + * @type {Node} + * @see https://developer.mozilla.org/en/DOM/Selection/focusNode + */ +Selection.prototype.focusNode; + +/** + * @type {number} + * @see https://developer.mozilla.org/en/DOM/Selection/focusOffset + */ +Selection.prototype.focusOffset; + +/** + * @type {boolean} + * @see https://developer.mozilla.org/en/DOM/Selection/isCollapsed + */ +Selection.prototype.isCollapsed; + +/** + * @type {number} + * @see https://developer.mozilla.org/en/DOM/Selection/rangeCount + */ +Selection.prototype.rangeCount; + +/** + * @param {Range} range + * @return {undefined} + * @see https://developer.mozilla.org/en/DOM/Selection/addRange + */ +Selection.prototype.addRange = function(range) {}; + +/** + * @param {number} index + * @return {Range} + * @see https://developer.mozilla.org/en/DOM/Selection/getRangeAt + * @nosideeffects + */ +Selection.prototype.getRangeAt = function(index) {}; + +/** + * @param {Node} node + * @param {number} index + * @return {undefined} + * @see https://developer.mozilla.org/en/DOM/Selection/collapse + */ +Selection.prototype.collapse = function(node, index) {}; + +/** + * @return {undefined} + * @see https://developer.mozilla.org/en/DOM/Selection/collapseToEnd + */ +Selection.prototype.collapseToEnd = function() {}; + +/** + * @return {undefined} + * @see https://developer.mozilla.org/en/DOM/Selection/collapseToStart + */ +Selection.prototype.collapseToStart = function() {}; + +/** + * @param {Node} node + * @param {boolean} partlyContained + * @return {boolean} + * @see https://developer.mozilla.org/en/DOM/Selection/containsNode + * @nosideeffects + */ +Selection.prototype.containsNode = function(node, partlyContained) {}; + +/** + * @see https://developer.mozilla.org/en/DOM/Selection/deleteFromDocument + */ +Selection.prototype.deleteFromDocument = function() {}; + +/** + * @param {Node} parentNode + * @param {number} offset + * @see https://developer.mozilla.org/en/DOM/Selection/extend + */ +Selection.prototype.extend = function(parentNode, offset) {}; + +/** + * @see https://developer.mozilla.org/en/DOM/Selection/removeAllRanges + */ +Selection.prototype.removeAllRanges = function() {}; + +/** + * @param {Range} range + * @see https://developer.mozilla.org/en/DOM/Selection/removeRange + */ +Selection.prototype.removeRange = function(range) {}; + +/** + * @param {Node} parentNode + * @see https://developer.mozilla.org/en/DOM/Selection/selectAllChildren + */ +Selection.prototype.selectAllChildren; + +/** + * @see https://developer.mozilla.org/en/DOM/Selection/selectionLanguageChange + */ +Selection.prototype.selectionLanguageChange; + +/** @type {NamedNodeMap} */ Element.prototype.attributes; +Element.prototype.baseURIObject; +/** @type {!NodeList} */ Element.prototype.childNodes; + +/** + * @type {!NodeList} + * @see https://developer.mozilla.org/en/DOM/element.children + */ +Element.prototype.children; + +/** + * @type {string} + * @implicitCast + */ +Element.prototype.className; +/** @type {string} */ Element.prototype.dir; + +/** + * Firebug sets this property on elements it is inserting into the DOM. + * @type {boolean} + */ +Element.prototype.firebugIgnore; + +/** @type {Node} */ Element.prototype.firstChild; +/** + * @type {string} + * @implicitCast + */ +Element.prototype.id; +/** + * @type {string} + * @implicitCast + */ +Element.prototype.innerHTML; +/** @type {string} */ Element.prototype.lang; +/** @type {Node} */ Element.prototype.lastChild; +Element.prototype.localName; +Element.prototype.name; +Element.prototype.namespaceURI; +/** @type {Node} */ Element.prototype.nextSibling; +Element.prototype.nodeName; +Element.prototype.nodePrincipal; +/** @type {number} */ Element.prototype.nodeType; +Element.prototype.nodeValue; +/** @type {Document} */ Element.prototype.ownerDocument; +/** @type {Node} */ Element.prototype.parentNode; +Element.prototype.prefix; +/** @type {Node} */ Element.prototype.previousSibling; +/** @type {!CSSStyleDeclaration} */ Element.prototype.style; +/** + * @type {number} + * @implicitCast + */ +Element.prototype.tabIndex; + +/** + * @type {string} + * @implicitCast + */ +Element.prototype.textContent; +/** @type {string} */ Element.prototype.title; + +/** + * @param {Node} child + * @return {Node} appendedElement. + * @override + */ +Element.prototype.appendChild = function(child) {}; + +/** + * @override + * @return {!Element} + */ +Element.prototype.cloneNode = function(deep) {}; + +/** @override */ +Element.prototype.dispatchEvent = function(event) {}; + +/** @return {undefined} */ +Element.prototype.blur = function() {}; + +/** @return {undefined} */ +Element.prototype.click = function() {}; + +/** @return {undefined} */ +Element.prototype.focus = function() {}; + +/** + * @return {boolean} + * @override + * @nosideeffects + */ +Element.prototype.hasAttributes = function() {}; + +/** + * @return {boolean} + * @override + * @nosideeffects + */ +Element.prototype.hasChildNodes = function() {}; + +/** @override */ +Element.prototype.insertBefore = function(insertedNode, adjacentNode) {}; + +/** + * @return {undefined} + * @override + */ +Element.prototype.normalize = function() {}; + +/** + * @param {Node} removedNode + * @return {!Node} + * @override + */ +Element.prototype.removeChild = function(removedNode) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Element.prototype.removeEventListener = function(type, handler, opt_useCapture) + {}; + +/** @override */ +Element.prototype.replaceChild = function(insertedNode, replacedNode) {}; + +/** @type {number} */ +HTMLInputElement.prototype.selectionStart; + +/** @type {number} */ +HTMLInputElement.prototype.selectionEnd; + +/** + * @param {number} selectionStart + * @param {number} selectionEnd + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#dom-textarea/input-setselectionrange + */ +HTMLInputElement.prototype.setSelectionRange = + function(selectionStart, selectionEnd) {}; + +/** @type {number} */ +HTMLTextAreaElement.prototype.selectionStart; + +/** @type {number} */ +HTMLTextAreaElement.prototype.selectionEnd; + +/** + * @param {number} selectionStart + * @param {number} selectionEnd + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#dom-textarea/input-setselectionrange + */ +HTMLTextAreaElement.prototype.setSelectionRange = + function(selectionStart, selectionEnd) {}; + +/** @constructor */ +function Navigator() {} + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.appCodeName + */ +Navigator.prototype.appCodeName; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.appVersion + */ +Navigator.prototype.appName; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.appVersion + */ +Navigator.prototype.appVersion; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.buildID + */ +Navigator.prototype.buildID; + +/** + * @type {boolean} + * @see https://developer.mozilla.org/en/Navigator.cookieEnabled + */ +Navigator.prototype.cookieEnabled; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.language + */ +Navigator.prototype.language; + +/** + * @type {MimeTypeArray} + * @see https://developer.mozilla.org/en/Navigator.mimeTypes + */ +Navigator.prototype.mimeTypes; + +/** + * @type {boolean} + * @see https://developer.mozilla.org/en/Navigator.onLine + */ +Navigator.prototype.onLine; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.oscpu + */ +Navigator.prototype.oscpu; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.platform + */ +Navigator.prototype.platform; + +/** + * @type {PluginArray} + * @see https://developer.mozilla.org/en/Navigator.plugins + */ +Navigator.prototype.plugins; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.product + */ +Navigator.prototype.product; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.productSub + */ +Navigator.prototype.productSub; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.securityPolicy + */ +Navigator.prototype.securityPolicy; + +/** + * @param {string} url + * @param {ArrayBufferView|Blob|string|FormData=} opt_data + * @return {boolean} + * @see https://developer.mozilla.org/en-US/docs/Web/API/navigator.sendBeacon + */ +Navigator.prototype.sendBeacon = function(url, opt_data) {}; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.userAgent + */ +Navigator.prototype.userAgent; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.vendor + */ +Navigator.prototype.vendor; + +/** + * @type {string} + * @see https://developer.mozilla.org/en/Navigator.vendorSub + */ +Navigator.prototype.vendorSub; + +/** + * @type {function(): boolean} + * @see https://developer.mozilla.org/en/Navigator.javaEnabled + * @nosideeffects + */ +Navigator.prototype.javaEnabled = function() {}; + +/** + * @constructor + * @see https://developer.mozilla.org/en/DOM/PluginArray + */ +function PluginArray() {} + +/** @type {number} */ +PluginArray.prototype.length; + +/** + * @param {number} index + * @return {Plugin} + */ +PluginArray.prototype.item = function(index) {}; + +/** + * @param {string} name + * @return {Plugin} + */ +PluginArray.prototype.namedItem = function(name) {}; + +/** @param {boolean=} reloadDocuments */ +PluginArray.prototype.refresh = function(reloadDocuments) {}; + +/** @constructor */ +function MimeTypeArray() {} + +/** + * @param {number} index + * @return {MimeType} + */ +MimeTypeArray.prototype.item = function(index) {}; + +/** + * @type {number} + * @see https://developer.mozilla.org/en/DOM/window.navigator.mimeTypes + */ +MimeTypeArray.prototype.length; + +/** + * @param {string} name + * @return {MimeType} + */ +MimeTypeArray.prototype.namedItem = function(name) {}; + +/** @constructor */ +function MimeType() {} + +/** @type {string} */ +MimeType.prototype.description; + +/** @type {Plugin} */ +MimeType.prototype.enabledPlugin; + +/** @type {string} */ +MimeType.prototype.suffixes; + +/** @type {string} */ +MimeType.prototype.type; + +/** @constructor */ +function Plugin() {} + +/** @type {string} */ +Plugin.prototype.description; + +/** @type {string} */ +Plugin.prototype.filename; + +/** @type {number} */ +Plugin.prototype.length; + +/** @type {string} */ +Plugin.prototype.name; + +/** @constructor */ +function BoxObject() {} + +/** @type {Element} */ +BoxObject.prototype.element; + +/** @type {number} */ +BoxObject.prototype.screenX; + +/** @type {number} */ +BoxObject.prototype.screenY; + +/** @type {number} */ +BoxObject.prototype.x; + +/** @type {number} */ +BoxObject.prototype.y; + +/** @type {number} */ +BoxObject.prototype.width; + + +/** + * @type {number} + * @see http://www.google.com/codesearch/p?hl=en#eksvcKKj5Ng/mozilla/dom/public/idl/html/nsIDOMNSHTMLImageElement.idl&q=naturalWidth + */ +HTMLImageElement.prototype.naturalWidth; + +/** + * @type {number} + * @see http://www.google.com/codesearch/p?hl=en#eksvcKKj5Ng/mozilla/dom/public/idl/html/nsIDOMNSHTMLImageElement.idl&q=naturalHeight + */ +HTMLImageElement.prototype.naturalHeight; + + +/** + * @param {Element} element + * @param {?string=} pseudoElt + * @return {CSSStyleDeclaration} + * @nosideeffects + */ +function getComputedStyle(element, pseudoElt) {} diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js new file mode 100644 index 000000000..cf3b21bf1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js @@ -0,0 +1,62 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for all the extensions over + * W3C's event specification by Gecko. This file depends on + * w3c_event.js. + * + * @externs + */ + +// TODO: Almost all of it has not been annotated with types. + +/** @type {number} */ Event.prototype.HORIZONTAL_AXIS; +/** @type {number} */ Event.prototype.VERTICAL_AXIS; +/** @type {boolean} */ Event.prototype.altKey; +/** @type {number} */ Event.prototype.axis; +/** @type {number} */ Event.prototype.button; +/** @type {boolean} */ Event.prototype.cancelBubble; +/** @type {number} */ Event.prototype.charCode; +/** @type {number} */ Event.prototype.clientX; +/** @type {number} */ Event.prototype.clientY; +/** @type {boolean} */ Event.prototype.ctrlKey; +/** @type {EventTarget} */ Event.prototype.explicitOriginalTarget; +/** @type {boolean} */ Event.prototype.isChar; +/** @type {number} */ Event.prototype.keyCode; +/** @type {number} */ Event.prototype.layerX; +/** @type {number} */ Event.prototype.layerY; +/** @type {boolean} */ Event.prototype.metaKey; +/** @type {EventTarget} */ Event.prototype.originalTarget; +/** @type {number} */ Event.prototype.pageX; +/** @type {number} */ Event.prototype.pageY; +/** @type {EventTarget} */ Event.prototype.relatedTarget; +/** @type {number} */ Event.prototype.screenX; +/** @type {number} */ Event.prototype.screenY; +/** @type {boolean} */ Event.prototype.shiftKey; +/** @type {Window} */ Event.prototype.view; +/** @type {number} */ Event.prototype.which; + +/** @constructor */ function nsIDOMPageTransitionEvent() {} +/** @type {boolean} */ nsIDOMPageTransitionEvent.prototype.persisted; + +//Methods +Event.prototype.initKeyEvent; +Event.prototype.initMouseEvent; +Event.prototype.initUIEvent; +Event.prototype.initMessageEvent; +Event.prototype.preventBubble; +Event.prototype.preventCapture; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js new file mode 100644 index 000000000..ccab53d67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js @@ -0,0 +1,73 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for all the extensions over some of the + * W3C's XML specifications by Gecko. This file depends on + * w3c_xml.js. The whole file has been fully type annotated. + * + * @externs + */ + +/** + * XMLSerializer can be used to convert DOM subtree or DOM document into text. + * XMLSerializer is available to unprivileged scripts. + * + * XMLSerializer is mainly useful for applications and extensions based on + * Mozilla platform. While it's available to web pages, it's not part of any + * standard and level of support in other browsers is unknown. + * + * @constructor + */ +function XMLSerializer() {} + +/** + * Returns the serialized subtree in the form of a string + * @param {Node} subtree + * @return {string} + */ +XMLSerializer.prototype.serializeToString = function(subtree) {}; + +/** + * The subtree rooted by the specified element is serialized to a byte stream + * using the character set specified. + * + * @param {Node} subtree + * @return {Object} + */ +XMLSerializer.prototype.serializeToStream = function(subtree) {}; + +/** + * DOMParser is mainly useful for applications and extensions based on Mozilla + * platform. While it's available to web pages, it's not part of any standard and + * level of support in other browsers is unknown. + * + * @constructor + */ +function DOMParser() {} + +/** + * The string passed in is parsed into a DOM document. + * + * Example: + * var parser = new DOMParser(); + * var doc = parser.parseFromString(aStr, "text/xml"); + * + * @param {string} src The UTF16 string to be parsed. + * @param {string} type The content type of the string. + * @return {Document} + */ +DOMParser.prototype.parseFromString = function(src, type) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js new file mode 100644 index 000000000..adb0e1a3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js @@ -0,0 +1,30 @@ +/* + * Copyright 2010 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Declaration of the type level google namespace. + * @externs + * @author nicksantos@google.com (Nick Santos) + */ + +/** + * Suppresses the compiler warning when multiple externs files declare the + * google namespace. + * @suppress {duplicate} + * @noalias + */ +// TODO(nicksantos): Consolidate to one google namespace declaration. +var google = {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js new file mode 100644 index 000000000..007dfaf2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js @@ -0,0 +1,3241 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for all the extensions over the + * W3C's DOM3 specification in HTML5. This file depends on + * w3c_dom3.js. The whole file has been fully type annotated. + * + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/index.html + * @see http://dev.w3.org/html5/spec/Overview.html + * + * This also includes Typed Array definitions from + * http://www.khronos.org/registry/typedarray/specs/latest/ + * + * This relies on w3c_event.js being included first. + * + * @externs + */ + + +/** + * Note: In IE, the contains() method only exists on Elements, not Nodes. + * Therefore, it is recommended that you use the Conformance framework to + * prevent calling this on Nodes which are not Elements. + * @see https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + * + * @param {Node} n The node to check + * @return {boolean} If 'n' is this Node, or is contained within this Node. + * @see https://developer.mozilla.org/en-US/docs/Web/API/Node.contains + * @nosideeffects + */ +Node.prototype.contains = function(n) {}; + + +/** + * @constructor + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-canvas-element + * @extends {HTMLElement} + */ +function HTMLCanvasElement() {} + +/** @type {number} */ +HTMLCanvasElement.prototype.width; + +/** @type {number} */ +HTMLCanvasElement.prototype.height; + +/** + * @param {string=} opt_type + * @param {...*} var_args + * @return {string} + * @throws {Error} + * @nosideeffects + */ +HTMLCanvasElement.prototype.toDataURL = function(opt_type, var_args) {}; + +/** + * @param {string} contextId + * @param {Object=} opt_args + * @return {Object} + */ +HTMLCanvasElement.prototype.getContext = function(contextId, opt_args) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d + */ +function CanvasRenderingContext2D() {} + +/** @type {HTMLCanvasElement} */ +CanvasRenderingContext2D.prototype.canvas; + +/** + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.save = function() {}; + +/** + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.restore = function() {}; + +/** + * @param {number} x + * @param {number} y + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.scale = function(x, y) {}; + +/** + * @param {number} angle + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.rotate = function(angle) {}; + +/** + * @param {number} x + * @param {number} y + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.translate = function(x, y) {}; + +/** + * @param {number} m11 + * @param {number} m12 + * @param {number} m21 + * @param {number} m22 + * @param {number} dx + * @param {number} dy + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.transform = function( + m11, m12, m21, m22, dx, dy) {}; + +/** + * @param {number} m11 + * @param {number} m12 + * @param {number} m21 + * @param {number} m22 + * @param {number} dx + * @param {number} dy + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.setTransform = function( + m11, m12, m21, m22, dx, dy) {}; + +/** + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @return {CanvasGradient} + * @throws {Error} + * @nosideeffects + */ +CanvasRenderingContext2D.prototype.createLinearGradient = function( + x0, y0, x1, y1) {}; + +/** + * @param {number} x0 + * @param {number} y0 + * @param {number} r0 + * @param {number} x1 + * @param {number} y1 + * @param {number} r1 + * @return {CanvasGradient} + * @throws {Error} + * @nosideeffects + */ +CanvasRenderingContext2D.prototype.createRadialGradient = function( + x0, y0, r0, x1, y1, r1) {}; + +/** + * @param {HTMLImageElement|HTMLCanvasElement} image + * @param {string} repetition + * @return {CanvasPattern} + * @throws {Error} + * @nosideeffects + */ +CanvasRenderingContext2D.prototype.createPattern = function( + image, repetition) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.clearRect = function(x, y, w, h) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.fillRect = function(x, y, w, h) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.strokeRect = function(x, y, w, h) {}; + +/** + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.beginPath = function() {}; + +/** + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.closePath = function() {}; + +/** + * @param {number} x + * @param {number} y + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.moveTo = function(x, y) {}; + +/** + * @param {number} x + * @param {number} y + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.lineTo = function(x, y) {}; + +/** + * @param {number} cpx + * @param {number} cpy + * @param {number} x + * @param {number} y + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.quadraticCurveTo = function( + cpx, cpy, x, y) {}; + +/** + * @param {number} cp1x + * @param {number} cp1y + * @param {number} cp2x + * @param {number} cp2y + * @param {number} x + * @param {number} y + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.bezierCurveTo = function( + cp1x, cp1y, cp2x, cp2y, x, y) {}; + +/** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} radius + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.rect = function(x, y, w, h) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} radius + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean=} opt_anticlockwise + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.arc = function( + x, y, radius, startAngle, endAngle, opt_anticlockwise) {}; + +/** + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.fill = function() {}; + +/** + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.stroke = function() {}; + +/** + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.clip = function() {}; + +/** + * @param {number} x + * @param {number} y + * @return {boolean} + * @nosideeffects + */ +CanvasRenderingContext2D.prototype.isPointInPath = function(x, y) {}; + +/** + * @param {string} text + * @param {number} x + * @param {number} y + * @param {number=} opt_maxWidth + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.fillText = function( + text, x, y, opt_maxWidth) {}; + +/** + * @param {string} text + * @param {number} x + * @param {number} y + * @param {number=} opt_maxWidth + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.strokeText = function( + text, x, y, opt_maxWidth) {}; + +/** + * @param {string} text + * @return {TextMetrics} + * @nosideeffects + */ +CanvasRenderingContext2D.prototype.measureText = function(text) {}; + +/** + * @param {HTMLImageElement|HTMLCanvasElement|Image|HTMLVideoElement} image + * @param {number} dx Destination x coordinate. + * @param {number} dy Destination y coordinate. + * @param {number=} opt_dw Destination box width. Defaults to the image width. + * @param {number=} opt_dh Destination box height. + * Defaults to the image height. + * @param {number=} opt_sx Source box x coordinate. Used to select a portion of + * the source image to draw. Defaults to 0. + * @param {number=} opt_sy Source box y coordinate. Used to select a portion of + * the source image to draw. Defaults to 0. + * @param {number=} opt_sw Source box width. Used to select a portion of + * the source image to draw. Defaults to the full image width. + * @param {number=} opt_sh Source box height. Used to select a portion of + * the source image to draw. Defaults to the full image height. + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.drawImage = function( + image, dx, dy, opt_dw, opt_dh, opt_sx, opt_sy, opt_sw, opt_sh) {}; + +/** + * @param {number} sw + * @param {number} sh + * @return {ImageData} + * @nosideeffects + */ +CanvasRenderingContext2D.prototype.createImageData = function(sw, sh) {}; + +/** + * @param {number} sx + * @param {number} sy + * @param {number} sw + * @param {number} sh + * @return {ImageData} + * @throws {Error} + * @nosideeffects + */ +CanvasRenderingContext2D.prototype.getImageData = function(sx, sy, sw, sh) {}; + +/** + * @param {ImageData} imagedata + * @param {number} dx + * @param {number} dy + * @param {number=} opt_dirtyX + * @param {number=} opt_dirtyY + * @param {number=} opt_dirtyWidth + * @param {number=} opt_dirtyHeight + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.putImageData = function(imagedata, dx, dy, + opt_dirtyX, opt_dirtyY, opt_dirtyWidth, opt_dirtyHeight) {}; + +/** + * Note: WebKit only + * @param {number|string=} opt_a + * @param {number=} opt_b + * @param {number=} opt_c + * @param {number=} opt_d + * @param {number=} opt_e + * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.setFillColor; + +/** + * Note: WebKit only + * @param {number|string=} opt_a + * @param {number=} opt_b + * @param {number=} opt_c + * @param {number=} opt_d + * @param {number=} opt_e + * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.setStrokeColor; + +/** + * @return {Array.} + */ +CanvasRenderingContext2D.prototype.getLineDash; + +/** + * @param {Array.} segments + * @return {undefined} + */ +CanvasRenderingContext2D.prototype.setLineDash; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.fillColor; + +/** + * @type {string} + * @implicitCast + */ +CanvasRenderingContext2D.prototype.fillStyle; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.font; + +/** @type {number} */ +CanvasRenderingContext2D.prototype.globalAlpha; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.globalCompositeOperation; + +/** @type {number} */ +CanvasRenderingContext2D.prototype.lineWidth; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.lineCap; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.lineJoin; + +/** @type {number} */ +CanvasRenderingContext2D.prototype.miterLimit; + +/** @type {number} */ +CanvasRenderingContext2D.prototype.shadowBlur; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.shadowColor; + +/** @type {number} */ +CanvasRenderingContext2D.prototype.shadowOffsetX; + +/** @type {number} */ +CanvasRenderingContext2D.prototype.shadowOffsetY; + +/** + * @type {string} + * @implicitCast + */ +CanvasRenderingContext2D.prototype.strokeStyle; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.strokeColor; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.textAlign; + +/** @type {string} */ +CanvasRenderingContext2D.prototype.textBaseline; + +/** + * @constructor + */ +function CanvasGradient() {} + +/** + * @param {number} offset + * @param {string} color + * @return {undefined} + */ +CanvasGradient.prototype.addColorStop = function(offset, color) {}; + +/** + * @constructor + */ +function CanvasPattern() {} + +/** + * @constructor + */ +function TextMetrics() {} + +/** @type {number} */ +TextMetrics.prototype.width; + +/** + * @constructor + */ +function ImageData() {} + +/** @type {Uint8ClampedArray} */ +ImageData.prototype.data; + +/** @type {number} */ +ImageData.prototype.width; + +/** @type {number} */ +ImageData.prototype.height; + +/** + * @constructor + */ +function ClientInformation() {} + +/** @type {boolean} */ +ClientInformation.prototype.onLine; + +/** + * @param {string} protocol + * @param {string} uri + * @param {string} title + * @return {undefined} + */ +ClientInformation.prototype.registerProtocolHandler = function( + protocol, uri, title) {}; + +/** + * @param {string} mimeType + * @param {string} uri + * @param {string} title + * @return {undefined} + */ +ClientInformation.prototype.registerContentHandler = function( + mimeType, uri, title) {}; + +// HTML5 Database objects +/** + * @constructor + */ +function Database() {} + +/** + * @type {string} + */ +Database.prototype.version; + +/** + * @param {function(!SQLTransaction) : void} callback + * @param {(function(!SQLError) : void)=} opt_errorCallback + * @param {Function=} opt_Callback + */ +Database.prototype.transaction = function( + callback, opt_errorCallback, opt_Callback) {}; + +/** + * @param {function(!SQLTransaction) : void} callback + * @param {(function(!SQLError) : void)=} opt_errorCallback + * @param {Function=} opt_Callback + */ +Database.prototype.readTransaction = function( + callback, opt_errorCallback, opt_Callback) {}; + +/** + * @param {string} oldVersion + * @param {string} newVersion + * @param {function(!SQLTransaction) : void} callback + * @param {function(!SQLError) : void} errorCallback + * @param {Function} successCallback + */ +Database.prototype.changeVersion = function( + oldVersion, newVersion, callback, errorCallback, successCallback) {}; + +/** + * @interface + */ +function DatabaseCallback() {} + +/** + * @param {!Database} db + * @return {undefined} + */ +DatabaseCallback.prototype.handleEvent = function(db) {}; + +/** + * @constructor + */ +function SQLError() {} + +/** + * @type {number} + */ +SQLError.prototype.code; + +/** + * @type {string} + */ +SQLError.prototype.message; + +/** + * @constructor + */ +function SQLTransaction() {} + +/** + * @param {string} sqlStatement + * @param {Array.<*>=} opt_queryArgs + * @param {SQLStatementCallback=} opt_callback + * @param {(function(!SQLTransaction, !SQLError) : (boolean|void))=} + * opt_errorCallback + */ +SQLTransaction.prototype.executeSql = function( + sqlStatement, opt_queryArgs, opt_callback, opt_errorCallback) {}; + +/** + * @typedef {(function(!SQLTransaction, !SQLResultSet) : void)} + */ +var SQLStatementCallback; + +/** + * @constructor + */ +function SQLResultSet() {} + +/** + * @type {number} + */ +SQLResultSet.prototype.insertId; + +/** + * @type {number} + */ +SQLResultSet.prototype.rowsAffected; + +/** + * @type {SQLResultSetRowList} + */ +SQLResultSet.prototype.rows; + +/** + * @constructor + */ +function SQLResultSetRowList() {} + +/** + * @type {number} + */ +SQLResultSetRowList.prototype.length; + +/** + * @param {number} index + * @return {Object} + * @nosideeffects + */ +SQLResultSetRowList.prototype.item = function(index) {}; + +/** + * @param {string} name + * @param {string} version + * @param {string} description + * @param {number} size + * @param {(DatabaseCallback|function(Database))=} opt_callback + * @return {Database} + */ +function openDatabase(name, version, description, size, opt_callback) {} + +/** + * @param {string} name + * @param {string} version + * @param {string} description + * @param {number} size + * @param {(DatabaseCallback|function(Database))=} opt_callback + * @return {Database} + */ +Window.prototype.openDatabase = + function(name, version, description, size, opt_callback) {}; + +/** + * @type {boolean} + */ +HTMLImageElement.prototype.complete; + +/** + * @type {string} + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-crossorigin + */ +HTMLImageElement.prototype.crossOrigin; + +/** + * This is a superposition of the Window and Worker postMessage methods. + * @param {*} message + * @param {(string|!Array.)=} opt_targetOriginOrTransfer + * @param {(string|!Array.|!Array.)=} + * opt_targetOriginOrPortsOrTransfer + * @return {void} + */ +function postMessage(message, opt_targetOriginOrTransfer, + opt_targetOriginOrPortsOrTransfer) {} + +/** + * The postMessage method (as implemented in Opera). + * @param {string} message + */ +Document.prototype.postMessage = function(message) {}; + +/** + * Document head accessor. + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#the-head-element-0 + * @type {HTMLHeadElement} + */ +Document.prototype.head; + +/** + * @see https://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariJSRef/DOMApplicationCache/DOMApplicationCache.html + * @constructor + * @implements {EventTarget} + */ +function DOMApplicationCache() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +DOMApplicationCache.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +DOMApplicationCache.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +DOMApplicationCache.prototype.dispatchEvent = function(evt) {}; + +/** + * The object isn't associated with an application cache. This can occur if the + * update process fails and there is no previous cache to revert to, or if there + * is no manifest file. + * @type {number} + */ +DOMApplicationCache.prototype.UNCACHED = 0; + +/** + * The cache is idle. + * @type {number} + */ +DOMApplicationCache.prototype.IDLE = 1; + +/** + * The update has started but the resources are not downloaded yet - for + * example, this can happen when the manifest file is fetched. + * @type {number} + */ +DOMApplicationCache.prototype.CHECKING = 2; + +/** + * The resources are being downloaded into the cache. + * @type {number} + */ +DOMApplicationCache.prototype.DOWNLOADING = 3; + +/** + * Resources have finished downloading and the new cache is ready to be used. + * @type {number} + */ +DOMApplicationCache.prototype.UPDATEREADY = 4; + +/** + * The cache is obsolete. + * @type {number} + */ +DOMApplicationCache.prototype.OBSOLETE = 5; + +/** + * The current status of the application cache. + * @type {number} + */ +DOMApplicationCache.prototype.status; + +/** + * Sent when the update process finishes for the first time; that is, the first + * time an application cache is saved. + * @type {?function(!Event)} + */ +DOMApplicationCache.prototype.oncached; + +/** + * Sent when the cache update process begins. + * @type {?function(!Event)} + */ +DOMApplicationCache.prototype.onchecking; + +/** + * Sent when the update process begins downloading resources in the manifest + * file. + * @type {?function(!Event)} + */ +DOMApplicationCache.prototype.ondownloading; + +/** + * Sent when an error occurs. + * @type {?function(!Event)} + */ +DOMApplicationCache.prototype.onerror; + +/** + * Sent when the update process finishes but the manifest file does not change. + * @type {?function(!Event)} + */ +DOMApplicationCache.prototype.onnoupdate; + +/** + * Sent when each resource in the manifest file begins to download. + * @type {?function(!Event)} + */ +DOMApplicationCache.prototype.onprogress; + +/** + * Sent when there is an existing application cache, the update process + * finishes, and there is a new application cache ready for use. + * @type {?function(!Event)} + */ +DOMApplicationCache.prototype.onupdateready; + +/** + * Replaces the active cache with the latest version. + * @throws {DOMException} + */ +DOMApplicationCache.prototype.swapCache = function() {}; + +/** + * Manually triggers the update process. + * @throws {DOMException} + */ +DOMApplicationCache.prototype.update = function() {}; + +/** @type {DOMApplicationCache} */ +var applicationCache; + +/** @type {DOMApplicationCache} */ +Window.prototype.applicationCache; + +/** + * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers + * @param {...string} var_args + */ +Window.prototype.importScripts = function(var_args) {}; + +/** + * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers + * @param {...string} var_args + */ +var importScripts = function(var_args) {}; + +/** + * @see http://dev.w3.org/html5/workers/ + * @constructor + * @implements {EventTarget} + */ +function WebWorker() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +WebWorker.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +WebWorker.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +WebWorker.prototype.dispatchEvent = function(evt) {}; + +/** + * Stops the worker process + */ +WebWorker.prototype.terminate = function() {}; + +/** + * Posts a message to the worker thread. + * @param {string} message + */ +WebWorker.prototype.postMessage = function(message) {}; + +/** + * Sent when the worker thread posts a message to its creator. + * @type {?function(!MessageEvent.<*>)} + */ +WebWorker.prototype.onmessage; + +/** + * Sent when the worker thread encounters an error. + * TODO(tbreisacher): Should this change to function(!ErrorEvent)? + * @type {?function(!Event)} + */ +WebWorker.prototype.onerror; + +/** + * @see http://dev.w3.org/html5/workers/ + * @constructor + * @implements {EventTarget} + */ +function Worker(opt_arg0) {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Worker.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Worker.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +Worker.prototype.dispatchEvent = function(evt) {}; + +/** + * Stops the worker process + */ +Worker.prototype.terminate = function() {}; + +/** + * Posts a message to the worker thread. + * @param {*} message + * @param {Array.=} opt_transfer + */ +Worker.prototype.postMessage = function(message, opt_transfer) {}; + +/** + * Posts a message to the worker thread. + * @param {*} message + * @param {Array.=} opt_transfer + */ +Worker.prototype.webkitPostMessage = function(message, opt_transfer) {}; + +/** + * Sent when the worker thread posts a message to its creator. + * @type {?function(!MessageEvent.<*>)} + */ +Worker.prototype.onmessage; + +/** + * Sent when the worker thread encounters an error. + * TODO(tbreisacher): Should this change to function(!ErrorEvent)? + * @type {?function(!Event)} + */ +Worker.prototype.onerror; + +/** + * @see http://dev.w3.org/html5/workers/ + * @param {string} scriptURL The URL of the script to run in the SharedWorker. + * @param {string=} opt_name A name that can later be used to obtain a + * reference to the same SharedWorker. + * @constructor + * @implements {EventTarget} + */ +function SharedWorker(scriptURL, opt_name) {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +SharedWorker.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +SharedWorker.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +SharedWorker.prototype.dispatchEvent = function(evt) {}; + +/** + * @type {!MessagePort} + */ +SharedWorker.prototype.port; + +/** + * Called on network errors for loading the initial script. + * TODO(tbreisacher): Should this change to function(!ErrorEvent)? + * @type {?function(!Event)} + */ +SharedWorker.prototype.onerror; + +/** + * @see http://dev.w3.org/html5/workers/ + * @interface + */ +function WorkerLocation() {} + +/** @type {string} */ +WorkerLocation.prototype.protocol; + +/** @type {string} */ +WorkerLocation.prototype.host; + +/** @type {string} */ +WorkerLocation.prototype.hostname; + +/** @type {string} */ +WorkerLocation.prototype.port; + +/** @type {string} */ +WorkerLocation.prototype.pathname; + +/** @type {string} */ +WorkerLocation.prototype.search; + +/** @type {string} */ +WorkerLocation.prototype.hash; + +/** + * @see http://dev.w3.org/html5/workers/ + * @interface + * @extends {EventTarget} + */ +function WorkerGlobalScope() {} + +/** @type {WorkerGlobalScope} */ +WorkerGlobalScope.prototype.self; + +/** @type {WorkerLocation} */ +WorkerGlobalScope.prototype.location; + +/** + * Closes the worker represented by this WorkerGlobalScope. + */ +WorkerGlobalScope.prototype.close = function() {}; + +/** + * Sent when the worker encounters an error. + * @type {?function(!Event)} + */ +WorkerGlobalScope.prototype.onerror; + +/** + * Sent when the worker goes offline. + * @type {?function(!Event)} + */ +WorkerGlobalScope.prototype.onoffline; + +/** + * Sent when the worker goes online. + * @type {?function(!Event)} + */ +WorkerGlobalScope.prototype.ononline; + +/** + * @see http://dev.w3.org/html5/workers/ + * @interface + * @extends {WorkerGlobalScope} + */ +function DedicatedWorkerGlobalScope() {} + +/** + * Posts a message to creator of this worker. + * @param {*} message + * @param {Array.=} opt_transfer + */ +DedicatedWorkerGlobalScope.prototype.postMessage = + function(message, opt_transfer) {}; + +/** + * Posts a message to creator of this worker. + * @param {*} message + * @param {Array.=} opt_transfer + */ +DedicatedWorkerGlobalScope.prototype.webkitPostMessage = + function(message, opt_transfer) {}; + +/** + * Sent when the creator posts a message to this worker. + * @type {?function(!MessageEvent.<*>)} + */ +DedicatedWorkerGlobalScope.prototype.onmessage; + +/** + * @see http://dev.w3.org/html5/workers/ + * @interface + * @extends {WorkerGlobalScope} + */ +function SharedWorkerGlobalScope() {} + +/** @type {string} */ +SharedWorkerGlobalScope.prototype.name; + +/** + * Sent when a connection to this worker is opened. + * @type {?function(!Event)} + */ +SharedWorkerGlobalScope.prototype.onconnect; + +/** @type {Element} */ +HTMLElement.prototype.contextMenu; + +/** @type {boolean} */ +HTMLElement.prototype.draggable; + +/** + * This is actually a DOMSettableTokenList property. However since that + * interface isn't currently defined and no known browsers implement this + * feature, just define the property for now. + * + * @const + * @type {Object} + */ +HTMLElement.prototype.dropzone; + +/** + * @see http://www.w3.org/TR/html5/dom.html#dom-getelementsbyclassname + * @param {string} classNames + * @return {!NodeList} + * @nosideeffects + */ +HTMLElement.prototype.getElementsByClassName = function(classNames) {}; +// NOTE: Document.prototype.getElementsByClassName is in gecko_dom.js + +/** @type {boolean} */ +HTMLElement.prototype.hidden; + +/** @type {boolean} */ +HTMLElement.prototype.spellcheck; + +/** + * @see http://www.w3.org/TR/components-intro/ + * @return {!ShadowRoot} + */ +HTMLElement.prototype.createShadowRoot; + +/** + * @see http://www.w3.org/TR/components-intro/ + * @return {!ShadowRoot} + */ +HTMLElement.prototype.webkitCreateShadowRoot; + +/** + * @see http://www.w3.org/TR/shadow-dom/ + * @type {ShadowRoot} + */ +HTMLElement.prototype.shadowRoot; + +/** + * @see http://www.w3.org/TR/shadow-dom/ + * @return {!NodeList} + */ +HTMLElement.prototype.getDestinationInsertionPoints = function() {}; + +/** + * @see http://www.w3.org/TR/components-intro/ + * @type {function()} + */ +HTMLElement.prototype.createdCallback; + +/** + * @see http://w3c.github.io/webcomponents/explainer/#lifecycle-callbacks + * @type {function()} + */ +HTMLElement.prototype.attachedCallback; + +/** + * @see http://w3c.github.io/webcomponents/explainer/#lifecycle-callbacks + * @type {function()} + */ +HTMLElement.prototype.detachedCallback; + +/** @type {string} */ +HTMLAnchorElement.prototype.hash; + +/** @type {string} */ +HTMLAnchorElement.prototype.host; + +/** @type {string} */ +HTMLAnchorElement.prototype.hostname; + +/** @type {string} */ +HTMLAnchorElement.prototype.pathname; + +/** + * The 'ping' attribute is known to be supported in recent versions (as of + * mid-2014) of Chrome, Safari, and Firefox, and is not supported in any + * current version of Internet Explorer. + * + * @type {string} + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#hyperlink-auditing + */ +HTMLAnchorElement.prototype.ping; + +/** @type {string} */ +HTMLAnchorElement.prototype.port; + +/** @type {string} */ +HTMLAnchorElement.prototype.protocol; + +/** @type {string} */ +HTMLAnchorElement.prototype.search; + +/** + * @type {string} + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#hyperlink-auditing + */ +HTMLAreaElement.prototype.ping; + +/** + * @type {string} + * @see http://www.w3.org/TR/html-markup/iframe.html#iframe.attrs.srcdoc + */ +HTMLIFrameElement.prototype.srcdoc; + +/** @type {string} */ +HTMLInputElement.prototype.autocomplete; + +/** @type {string} */ +HTMLInputElement.prototype.dirname; + +/** @type {FileList} */ +HTMLInputElement.prototype.files; + +/** @type {string} */ +HTMLInputElement.prototype.list; + +/** @type {string} */ +HTMLInputElement.prototype.max; + +/** @type {string} */ +HTMLInputElement.prototype.min; + +/** @type {string} */ +HTMLInputElement.prototype.pattern; + +/** @type {boolean} */ +HTMLInputElement.prototype.multiple; + +/** @type {string} */ +HTMLInputElement.prototype.placeholder; + +/** @type {boolean} */ +HTMLInputElement.prototype.required; + +/** @type {string} */ +HTMLInputElement.prototype.step; + +/** @type {Date} */ +HTMLInputElement.prototype.valueAsDate; + +/** @type {number} */ +HTMLInputElement.prototype.valueAsNumber; + +/** + * Changes the form control's value by the value given in the step attribute + * multiplied by opt_n. + * @param {number=} opt_n step multiplier. Defaults to 1. + */ +HTMLInputElement.prototype.stepDown = function(opt_n) {}; + +/** + * Changes the form control's value by the value given in the step attribute + * multiplied by opt_n. + * @param {number=} opt_n step multiplier. Defaults to 1. + */ +HTMLInputElement.prototype.stepUp = function(opt_n) {}; + + + +/** + * @constructor + * @extends {HTMLElement} + * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement + */ +function HTMLMediaElement() {} + +/** + * @type {number} + * @const + */ +HTMLMediaElement.HAVE_NOTHING; // = 0 + +/** + * @type {number} + * @const + */ +HTMLMediaElement.HAVE_METADATA; // = 1 + +/** + * @type {number} + * @const + */ +HTMLMediaElement.HAVE_CURRENT_DATA; // = 2 + +/** + * @type {number} + * @const + */ +HTMLMediaElement.HAVE_FUTURE_DATA; // = 3 + +/** + * @type {number} + * @const + */ +HTMLMediaElement.HAVE_ENOUGH_DATA; // = 4 + +/** @type {MediaError} */ +HTMLMediaElement.prototype.error; + +/** @type {string} */ +HTMLMediaElement.prototype.src; + +/** @type {string} */ +HTMLMediaElement.prototype.currentSrc; + +/** @type {number} */ +HTMLMediaElement.prototype.networkState; + +/** @type {boolean} */ +HTMLMediaElement.prototype.autobuffer; + +/** @type {TimeRanges} */ +HTMLMediaElement.prototype.buffered; + +/** + * Loads the media element. + */ +HTMLMediaElement.prototype.load = function() {}; + +/** + * @param {string} type Type of the element in question in question. + * @return {string} Whether it can play the type. + * @nosideeffects + */ +HTMLMediaElement.prototype.canPlayType = function(type) {}; + +/** + * Callback when the media is buffered and ready to play through. + * @type {function(!Event)} + */ +HTMLMediaElement.prototype.oncanplaythrough; + +/** @type {number} */ +HTMLMediaElement.prototype.readyState; + +/** @type {boolean} */ +HTMLMediaElement.prototype.seeking; + +/** + * The current time, in seconds. + * @type {number} + */ +HTMLMediaElement.prototype.currentTime; + +/** + * The absolute timeline offset. + * @return {!Date} + */ +HTMLMediaElement.prototype.getStartDate = function() {}; + +/** + * The length of the media in seconds. + * @type {number} + */ +HTMLMediaElement.prototype.duration; + +/** @type {boolean} */ +HTMLMediaElement.prototype.paused; + +/** @type {number} */ +HTMLMediaElement.prototype.defaultPlaybackRate; + +/** @type {number} */ +HTMLMediaElement.prototype.playbackRate; + +/** @type {TimeRanges} */ +HTMLMediaElement.prototype.played; + +/** @type {TimeRanges} */ +HTMLMediaElement.prototype.seekable; + +/** @type {boolean} */ +HTMLMediaElement.prototype.ended; + +/** @type {boolean} */ +HTMLMediaElement.prototype.autoplay; + +/** @type {boolean} */ +HTMLMediaElement.prototype.loop; + +/** + * Starts playing the media. + */ +HTMLMediaElement.prototype.play = function() {}; + +/** + * Pauses the media. + */ +HTMLMediaElement.prototype.pause = function() {}; + +/** @type {boolean} */ +HTMLMediaElement.prototype.controls; + +/** + * The audio volume, from 0.0 (silent) to 1.0 (loudest). + * @type {number} + */ +HTMLMediaElement.prototype.volume; + +/** @type {boolean} */ +HTMLMediaElement.prototype.muted; + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-media-addtexttrack + * @param {string} kind Kind of the text track. + * @param {string=} opt_label Label of the text track. + * @param {string=} opt_language Language of the text track. + * @return {TextTrack} TextTrack object added to the media element. + */ +HTMLMediaElement.prototype.addTextTrack = + function(kind, opt_label, opt_language) {}; + +/** @type {TextTrackList} */ +HTMLMediaElement.prototype.textTracks; + + +/** + * @see http://www.w3.org/TR/shadow-dom/ + * @return {!NodeList} + */ +Text.prototype.getDestinationInsertionPoints = function() {}; + + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttracklist + * @constructor + */ +function TextTrackList() {} + +/** @type {number} */ +TextTrackList.prototype.length; + +/** + * @param {string} id + * @return {TextTrack} + */ +TextTrackList.prototype.getTrackById = function(id) {}; + + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrack + * @constructor + * @implements {EventTarget} + */ +function TextTrack() {} + +/** + * @param {TextTrackCue} cue + */ +TextTrack.prototype.addCue = function(cue) {}; + +/** + * @param {TextTrackCue} cue + */ +TextTrack.prototype.removeCue = function(cue) {}; + +/** + * @const {TextTrackCueList} + */ +TextTrack.prototype.activeCues; + +/** + * @const {TextTrackCueList} + */ +TextTrack.prototype.cues; + +/** @override */ +TextTrack.prototype.addEventListener = function(type, listener, useCapture) {}; + +/** @override */ +TextTrack.prototype.dispatchEvent = function(evt) {}; + +/** @override */ +TextTrack.prototype.removeEventListener = function(type, listener, useCapture) + {}; + + + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcuelist + * @constructor + */ +function TextTrackCueList() {} + +/** @const {number} */ +TextTrackCueList.prototype.length; + +/** + * @param {string} id + * @return {TextTrackCue} + */ +TextTrackCueList.prototype.getCueById = function(id) {}; + + + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue + * @constructor + * @param {number} startTime + * @param {number} endTime + * @param {string} text + */ +function TextTrackCue(startTime, endTime, text) {} + +/** @type {string} */ +TextTrackCue.prototype.id; + +/** @type {number} */ +TextTrackCue.prototype.startTime; + +/** @type {number} */ +TextTrackCue.prototype.endTime; + +/** @type {string} */ +TextTrackCue.prototype.text; + + +/** + * @see http://dev.w3.org/html5/webvtt/#the-vttcue-interface + * @constructor + * @extends {TextTrackCue} + */ +function VTTCue(startTime, endTime, text) {} + + +/** + * @constructor + * @extends {HTMLMediaElement} + */ +function HTMLAudioElement() {} + +/** + * @constructor + * @extends {HTMLMediaElement} + * The webkit-prefixed attributes are defined in + * https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/HTMLVideoElement.idl + */ +function HTMLVideoElement() {} + +/** + * Starts displaying the video in full screen mode. + */ +HTMLVideoElement.prototype.webkitEnterFullscreen = function() {}; + +/** + * Starts displaying the video in full screen mode. + */ +HTMLVideoElement.prototype.webkitEnterFullScreen = function() {}; + +/** + * Stops displaying the video in full screen mode. + */ +HTMLVideoElement.prototype.webkitExitFullscreen = function() {}; + +/** + * Stops displaying the video in full screen mode. + */ +HTMLVideoElement.prototype.webkitExitFullScreen = function() {}; + +/** @type {string} */ +HTMLVideoElement.prototype.width; + +/** @type {string} */ +HTMLVideoElement.prototype.height; + +/** @type {number} */ +HTMLVideoElement.prototype.videoWidth; + +/** @type {number} */ +HTMLVideoElement.prototype.videoHeight; + +/** @type {string} */ +HTMLVideoElement.prototype.poster; + +/** @type {boolean} */ +HTMLVideoElement.prototype.webkitSupportsFullscreen; + +/** @type {boolean} */ +HTMLVideoElement.prototype.webkitDisplayingFullscreen; + +/** @type {number} */ +HTMLVideoElement.prototype.webkitDecodedFrameCount; + +/** @type {number} */ +HTMLVideoElement.prototype.webkitDroppedFrameCount; + +/** + * @constructor + */ +function MediaError() {} + +/** @type {number} */ +MediaError.prototype.code; + +// HTML5 MessageChannel +/** + * @see http://dev.w3.org/html5/spec/comms.html#messagechannel + * @constructor + */ +function MessageChannel() {} + +/** + * Returns the first port. + * @type {!MessagePort} + */ +MessageChannel.prototype.port1; + +/** + * Returns the second port. + * @type {!MessagePort} + */ +MessageChannel.prototype.port2; + +// HTML5 MessagePort +/** + * @see http://dev.w3.org/html5/spec/comms.html#messageport + * @constructor + * @implements {EventTarget} + * @implements {Transferable} + */ +function MessagePort() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +MessagePort.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +MessagePort.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +MessagePort.prototype.dispatchEvent = function(evt) {}; + + +/** + * Posts a message through the channel, optionally with the given + * Array of Transferables. + * @param {*} message + * @param {Array.=} opt_transfer + */ +MessagePort.prototype.postMessage = function(message, opt_transfer) { +}; + +/** + * Begins dispatching messages received on the port. + */ +MessagePort.prototype.start = function() {}; + +/** + * Disconnects the port, so that it is no longer active. + */ +MessagePort.prototype.close = function() {}; + +/** + * TODO(blickly): Change this to MessageEvent.<*> and add casts as needed + * @type {?function(!MessageEvent.)} + */ +MessagePort.prototype.onmessage; + +// HTML5 MessageEvent class +/** + * @see http://dev.w3.org/html5/spec/comms.html#messageevent + * @constructor + * @extends {Event} + * @template T + */ +function MessageEvent() {} + +/** + * The data payload of the message. + * @type {T} + */ +MessageEvent.prototype.data; + +/** + * The origin of the message, for server-sent events and cross-document + * messaging. + * @type {string} + */ +MessageEvent.prototype.origin; + +/** + * The last event ID, for server-sent events. + * @type {string} + */ +MessageEvent.prototype.lastEventId; + +/** + * The window that dispatched the event. + * @type {Window} + */ +MessageEvent.prototype.source; + +/** + * The Array of MessagePorts sent with the message, for cross-document + * messaging and channel messaging. + * @type {Array.} + */ +MessageEvent.prototype.ports; + +/** + * Initializes the event in a manner analogous to the similarly-named methods in + * the DOM Events interfaces. + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {T} dataArg + * @param {string} originArg + * @param {string} lastEventIdArg + * @param {Window} sourceArg + * @param {Array.} portsArg + */ +MessageEvent.prototype.initMessageEvent = function(typeArg, canBubbleArg, + cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg) {}; + +/** + * Initializes the event in a manner analogous to the similarly-named methods in + * the DOM Events interfaces. + * @param {string} namespaceURI + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {T} dataArg + * @param {string} originArg + * @param {string} lastEventIdArg + * @param {Window} sourceArg + * @param {Array.} portsArg + */ +MessageEvent.prototype.initMessageEventNS = function(namespaceURI, typeArg, + canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, + portsArg) {}; + +/** + * HTML5 DataTransfer class. + * + * We say that this extends ClipboardData, because Event.prototype.clipboardData + * is a DataTransfer on WebKit but a ClipboardData on IE. The interfaces are so + * similar that it's easier to merge them. + * + * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html + * @see http://developers.whatwg.org/dnd.html#datatransferitem + * @constructor + * @extends {ClipboardData} + */ +function DataTransfer() {} + +/** @type {string} */ +DataTransfer.prototype.dropEffect; + +/** @type {string} */ +DataTransfer.prototype.effectAllowed; + +/** @type {Array.} */ +DataTransfer.prototype.types; + +/** @type {FileList} */ +DataTransfer.prototype.files; + +/** + * @param {string=} opt_format Format for which to remove data. + * @override + */ +DataTransfer.prototype.clearData = function(opt_format) {}; + +/** + * @param {string} format Format for which to set data. + * @param {string} data Data to add. + * @override + */ +DataTransfer.prototype.setData = function(format, data) {}; + +/** + * @param {string} format Format for which to set data. + * @return {string} Data for the given format. + * @override + */ +DataTransfer.prototype.getData = function(format) { return ''; }; + +/** + * @param {HTMLElement} img The image to use when dragging. + * @param {number} x Horizontal position of the cursor. + * @param {number} y Vertical position of the cursor. + */ +DataTransfer.prototype.setDragImage = function(img, x, y) {}; + +/** + * @param {HTMLElement} elem Element to receive drag result events. + */ +DataTransfer.prototype.addElement = function(elem) {}; + +/** + * Addition for accessing clipboard file data that are part of the proposed + * HTML5 spec. + * @type {DataTransfer} + */ +MouseEvent.prototype.dataTransfer; + +/** + * @typedef {{ + * bubbles: (boolean|undefined), + * cancelable: (boolean|undefined), + * view: (Window|undefined), + * detail: (number|undefined), + * screenX: (number|undefined), + * screenY: (number|undefined), + * clientX: (number|undefined), + * clientY: (number|undefined), + * ctrlKey: (boolean|undefined), + * shiftKey: (boolean|undefined), + * altKey: (boolean|undefined), + * metaKey: (boolean|undefined), + * button: (number|undefined), + * buttons: (number|undefined), + * relatedTarget: (EventTarget|undefined), + * deltaX: (number|undefined), + * deltaY: (number|undefined), + * deltaZ: (number|undefined), + * deltaMode: (number|undefined) + * }} + */ +var WheelEventInit; + +/** + * @param {string} type + * @param {WheelEventInit=} opt_eventInitDict + * @see http://www.w3.org/TR/DOM-Level-3-Events/#interface-WheelEvent + * @constructor + * @extends {MouseEvent} + */ +var WheelEvent = function(type, opt_eventInitDict) {}; + +/** @const {number} */ +WheelEvent.prototype.deltaX; + +/** @const {number} */ +WheelEvent.prototype.deltaY; + +/** @const {number} */ +WheelEvent.prototype.deltaZ; + +/** @const {number} */ +WheelEvent.prototype.deltaMode; + +/** + * HTML5 DataTransferItem class. + * + * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html + * @see http://developers.whatwg.org/dnd.html#datatransferitem + * @constructor + */ +var DataTransferItem = function() {}; + +/** @type {string} */ +DataTransferItem.prototype.kind; + +/** @type {string} */ +DataTransferItem.prototype.type; + +/** + * @param {function(string)} callback + * @nosideeffects + */ +DataTransferItem.prototype.getAsString = function(callback) {}; + +/** + * @return {?File} The file corresponding to this item, or null. + * @nosideeffects + */ +DataTransferItem.prototype.getAsFile = function() { return null; }; + +/** + * @return {?Entry} The Entry corresponding to this item, or null. Note that + * despite its name,this method only works in Chrome, and will eventually + * be renamed to {@code getAsEntry}. + * @nosideeffects + */ +DataTransferItem.prototype.webkitGetAsEntry = function() { return null; }; + +/** + * HTML5 DataTransferItemList class. There are some discrepancies in the docs + * on the whatwg.org site. When in doubt, these prototypes match what is + * implemented as of Chrome 30. + * + * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html + * @see http://developers.whatwg.org/dnd.html#datatransferitem + * @constructor + */ +var DataTransferItemList = function() {}; + +/** @type {number} */ +DataTransferItemList.prototype.length; + +/** + * @param {number} i File to return from the list. + * @return {DataTransferItem} The ith DataTransferItem in the list, or null. + * @nosideeffects + */ +DataTransferItemList.prototype.item = function(i) { return null; }; + +/** + * Adds an item to the list. + * @param {string|!File} data Data for the item being added. + * @param {string=} opt_type Mime type of the item being added. MUST be present + * if the {@code data} parameter is a string. + */ +DataTransferItemList.prototype.add = function(data, opt_type) {}; + +/** + * Removes an item from the list. + * @param {number} i File to remove from the list. + */ +DataTransferItemList.prototype.remove = function(i) {}; + +/** + * Removes all items from the list. + */ +DataTransferItemList.prototype.clear = function() {}; + +/** @type {!DataTransferItemList} */ +DataTransfer.prototype.items; + + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dragevent-interface + * @constructor + * @extends {MouseEvent} + */ +function DragEvent() {} + +/** @type {DataTransfer} */ +DragEvent.prototype.dataTransfer; + + +/** + * @typedef {{ + * lengthComputable: (boolean|undefined), + * loaded: (number|undefined), + * total: (number|undefined) + * }} + */ +var ProgressEventInit; + +/** + * @constructor + * @param {string} type + * @param {ProgressEventInit=} opt_progressEventInitDict + * @extends {Event} + * @see https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent + */ +function ProgressEvent(type, opt_progressEventInitDict) {} + +/** @type {number} */ +ProgressEvent.prototype.total; + +/** @type {number} */ +ProgressEvent.prototype.loaded; + +/** @type {boolean} */ +ProgressEvent.prototype.lengthComputable; + + +/** + * @constructor + */ +function TimeRanges() {} + +/** @type {number} */ +TimeRanges.prototype.length; + +/** + * @param {number} index The index. + * @return {number} The start time of the range at index. + * @throws {DOMException} + */ +TimeRanges.prototype.start = function(index) { return 0; }; + +/** + * @param {number} index The index. + * @return {number} The end time of the range at index. + * @throws {DOMException} + */ +TimeRanges.prototype.end = function(index) { return 0; }; + + +// HTML5 Web Socket class +/** + * @see http://dev.w3.org/html5/websockets/ + * @constructor + * @param {string} url + * @param {string=} opt_protocol + * @implements {EventTarget} + */ +function WebSocket(url, opt_protocol) {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +WebSocket.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +WebSocket.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +WebSocket.prototype.dispatchEvent = function(evt) {}; + +/** + * Returns the URL value that was passed to the constructor. + * @type {string} + */ +WebSocket.prototype.URL; + +/** + * The connection has not yet been established. + * @type {number} + */ +WebSocket.prototype.CONNECTING = 0; + +/** + * The Web Socket connection is established and communication is possible. + * @type {number} + */ +WebSocket.prototype.OPEN = 1; + +/** + * The connection has been closed or could not be opened. + * @type {number} + */ +WebSocket.prototype.CLOSED = 2; + +/** + * Represents the state of the connection. + * @type {number} + */ +WebSocket.prototype.readyState; + +/** + * Returns the number of bytes that have been queued but not yet sent. + * @type {number} + */ +WebSocket.prototype.bufferedAmount; + +/** + * An event handler called on open event. + * @type {?function(!Event)} + */ +WebSocket.prototype.onopen; + +/** + * An event handler called on message event. + * TODO(blickly): Change this to MessageEvent.<*> and add casts as needed + * @type {?function(!MessageEvent.)} + */ +WebSocket.prototype.onmessage; + +/** + * An event handler called on close event. + * @type {?function(!Event)} + */ +WebSocket.prototype.onclose; + +/** + * Transmits data using the connection. + * @param {string|ArrayBuffer|ArrayBufferView} data + * @return {boolean} + */ +WebSocket.prototype.send = function(data) {}; + +/** + * Closes the Web Socket connection or connection attempt, if any. + */ +WebSocket.prototype.close = function() {}; + +/** + * @type {string} Sets the type of data (blob or arraybuffer) for binary data. + */ +WebSocket.prototype.binaryType; + +// HTML5 History +/** + * Pushes a new state into the session history. + * @see http://www.w3.org/TR/html5/history.html#the-history-interface + * @param {*} data New state. + * @param {string} title The title for a new session history entry. + * @param {string=} opt_url The URL for a new session history entry. + */ +History.prototype.pushState = function(data, title, opt_url) {}; + +/** + * Replaces the current state in the session history. + * @see http://www.w3.org/TR/html5/history.html#the-history-interface + * @param {*} data New state. + * @param {string} title The title for a session history entry. + * @param {string=} opt_url The URL for a new session history entry. + */ +History.prototype.replaceState = function(data, title, opt_url) {}; + +/** + * Pending state object. + * @see https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#Reading_the_current_state + * @type {*} + */ +History.prototype.state; + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/#popstateevent + * @constructor + * @extends {Event} + * + * @param {string} type + * @param {{state: *}=} opt_eventInitDict + */ +function PopStateEvent(type, opt_eventInitDict) {} + +/** + * @type {*} + */ +PopStateEvent.prototype.state; + +/** + * Initializes the event after it has been created with document.createEvent + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {*} stateArg + */ +PopStateEvent.prototype.initPopStateEvent = function(typeArg, canBubbleArg, + cancelableArg, stateArg) {}; + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/#hashchangeevent + * @constructor + * @extends {Event} + * + * @param {string} type + * @param {{oldURL: string, newURL: string}=} opt_eventInitDict + */ +function HashChangeEvent(type, opt_eventInitDict) {} + +/** @type {string} */ +HashChangeEvent.prototype.oldURL; + +/** @type {string} */ +HashChangeEvent.prototype.newURL; + +/** + * Initializes the event after it has been created with document.createEvent + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {string} oldURLArg + * @param {string} newURLArg + */ +HashChangeEvent.prototype.initHashChangeEvent = function(typeArg, canBubbleArg, + cancelableArg, oldURLArg, newURLArg) {}; + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/#pagetransitionevent + * @constructor + * @extends {Event} + * + * @param {string} type + * @param {{persisted: boolean}=} opt_eventInitDict + */ +function PageTransitionEvent(type, opt_eventInitDict) {} + +/** @type {boolean} */ +PageTransitionEvent.prototype.persisted; + +/** + * Initializes the event after it has been created with document.createEvent + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {*} persistedArg + */ +PageTransitionEvent.prototype.initPageTransitionEvent = function(typeArg, + canBubbleArg, cancelableArg, persistedArg) {}; + +/** + * @constructor + */ +function FileList() {} + +/** @type {number} */ +FileList.prototype.length; + +/** + * @param {number} i File to return from the list. + * @return {File} The ith file in the list. + * @nosideeffects + */ +FileList.prototype.item = function(i) { return null; }; + +/** + * @type {boolean} + * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#withcredentials + */ +XMLHttpRequest.prototype.withCredentials; + +/** + * @type {XMLHttpRequestUpload} + * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-upload-attribute + */ +XMLHttpRequest.prototype.upload; + +/** + * @param {string} mimeType The mime type to override with. + */ +XMLHttpRequest.prototype.overrideMimeType = function(mimeType) {}; + +/** + * @type {string} + * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute + */ +XMLHttpRequest.prototype.responseType; + +/** + * @type {*} + * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute + */ +XMLHttpRequest.prototype.response; + + +/** + * @type {ArrayBuffer} + * Implemented as a draft spec in Firefox 4 as the way to get a requested array + * buffer from an XMLHttpRequest. + * @see https://developer.mozilla.org/En/Using_XMLHttpRequest#Receiving_binary_data_using_JavaScript_typed_arrays + */ +XMLHttpRequest.prototype.mozResponseArrayBuffer; + +/** + * XMLHttpRequestEventTarget defines events for checking the status of a data + * transfer between a client and a server. This should be a common base class + * for XMLHttpRequest and XMLHttpRequestUpload. + * + * @constructor + * @implements {EventTarget} + */ +function XMLHttpRequestEventTarget() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +XMLHttpRequestEventTarget.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +XMLHttpRequestEventTarget.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +XMLHttpRequestEventTarget.prototype.dispatchEvent = function(evt) {}; + +/** + * An event target to track the status of an upload. + * + * @constructor + * @extends {XMLHttpRequestEventTarget} + */ +function XMLHttpRequestUpload() {} + +/** + * @param {number=} opt_width + * @param {number=} opt_height + * @constructor + * @extends {HTMLImageElement} + */ +function Image(opt_width, opt_height) {} + + +/** + * Dataset collection. + * This is really a DOMStringMap but it behaves close enough to an object to + * pass as an object. + * @type {Object} + * @const + */ +HTMLElement.prototype.dataset; + + +/** + * @constructor + * @see https://dom.spec.whatwg.org/#interface-domtokenlist + */ +function DOMTokenList() {} + +/** + * Returns the number of CSS classes applied to this Element. + * @type {number} + */ +DOMTokenList.prototype.length; + +/** + * @param {number} index The index of the item to return. + * @return {string} The CSS class at the specified index. + * @nosideeffects + */ +DOMTokenList.prototype.item = function(index) {}; + +/** + * @param {string} token The CSS class to check for. + * @return {boolean} Whether the CSS class has been applied to the Element. + * @nosideeffects + */ +DOMTokenList.prototype.contains = function(token) {}; + +/** + * @param {...string} var_args The CSS class(es) to add to this element. + */ +DOMTokenList.prototype.add = function(var_args) {}; + +/** + * @param {...string} var_args The CSS class(es) to remove from this element. + */ +DOMTokenList.prototype.remove = function(var_args) {}; + +/** + * @param {string} token The CSS class to toggle from this element. + * @param {boolean=} opt_force True to add the class whether it exists + * or not. False to remove the class whether it exists or not. + * This argument is not supported on IE 10 and below, according to + * the MDN page linked below. + * @return {boolean} False if the token was removed; True otherwise. + * @see https://developer.mozilla.org/en-US/docs/Web/API/Element.classList + */ +DOMTokenList.prototype.toggle = function(token, opt_force) {}; + +/** + * @return {string} A stringified representation of CSS classes. + * @nosideeffects + * @override + */ +DOMTokenList.prototype.toString = function() {}; + +/** + * A better interface to CSS classes than className. + * @type {DOMTokenList} + * @see http://www.w3.org/TR/html5/elements.html#dom-classlist + * @const + */ +HTMLElement.prototype.classList; + +/** + * Web Cryptography API + * @see http://www.w3.org/TR/WebCryptoAPI/ + */ + +/** @see https://developer.mozilla.org/en/DOM/window.crypto */ +Window.prototype.crypto; + +/** + * @see https://developer.mozilla.org/en/DOM/window.crypto.getRandomValues + * @param {!ArrayBufferView} typedArray + * @return {!ArrayBufferView} + * @throws {Error} + */ +Window.prototype.crypto.getRandomValues = function(typedArray) {}; + +/** + * Constraint Validation API properties and methods + * @see http://www.w3.org/TR/2009/WD-html5-20090423/forms.html#the-constraint-validation-api + */ + +/** @return {boolean} */ +HTMLFormElement.prototype.checkValidity = function() {}; + +/** @type {boolean} */ +HTMLFormElement.prototype.noValidate; + +/** @constructor */ +function ValidityState() {} + +/** @type {boolean} */ +ValidityState.prototype.customError; + +/** @type {boolean} */ +ValidityState.prototype.patternMismatch; + +/** @type {boolean} */ +ValidityState.prototype.rangeOverflow; + +/** @type {boolean} */ +ValidityState.prototype.rangeUnderflow; + +/** @type {boolean} */ +ValidityState.prototype.stepMismatch; + +/** @type {boolean} */ +ValidityState.prototype.typeMismatch; + +/** @type {boolean} */ +ValidityState.prototype.tooLong; + +/** @type {boolean} */ +ValidityState.prototype.valid; + +/** @type {boolean} */ +ValidityState.prototype.valueMissing; + + +/** @type {boolean} */ +HTMLButtonElement.prototype.autofocus; + +/** + * @const + * @type {NodeList} + */ +HTMLButtonElement.prototype.labels; + +/** @type {string} */ +HTMLButtonElement.prototype.validationMessage; + +/** + * @const + * @type {ValidityState} + */ +HTMLButtonElement.prototype.validity; + +/** @type {boolean} */ +HTMLButtonElement.prototype.willValidate; + +/** @return {boolean} */ +HTMLButtonElement.prototype.checkValidity = function() {}; + +/** @param {string} message */ +HTMLButtonElement.prototype.setCustomValidity = function(message) {}; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formaction + */ +HTMLButtonElement.prototype.formAction; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formenctype + */ +HTMLButtonElement.prototype.formEnctype; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formmethod + */ +HTMLButtonElement.prototype.formMethod; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formtarget + */ +HTMLButtonElement.prototype.formTarget; + +/** @type {boolean} */ +HTMLInputElement.prototype.autofocus; + +/** @type {boolean} */ +HTMLInputElement.prototype.formNoValidate; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formaction + */ +HTMLInputElement.prototype.formAction; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formenctype + */ +HTMLInputElement.prototype.formEnctype; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formmethod + */ +HTMLInputElement.prototype.formMethod; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formtarget + */ +HTMLInputElement.prototype.formTarget; + +/** + * @const + * @type {NodeList} + */ +HTMLInputElement.prototype.labels; + +/** @type {string} */ +HTMLInputElement.prototype.validationMessage; + +/** + * @const + * @type {ValidityState} + */ +HTMLInputElement.prototype.validity; + +/** @type {boolean} */ +HTMLInputElement.prototype.willValidate; + +/** @return {boolean} */ +HTMLInputElement.prototype.checkValidity = function() {}; + +/** @param {string} message */ +HTMLInputElement.prototype.setCustomValidity = function(message) {}; + +/** @type {Element} */ +HTMLLabelElement.prototype.control; + +/** @type {boolean} */ +HTMLSelectElement.prototype.autofocus; + +/** + * @const + * @type {NodeList} + */ +HTMLSelectElement.prototype.labels; + +/** @type {HTMLCollection} */ +HTMLSelectElement.prototype.selectedOptions; + +/** @type {string} */ +HTMLSelectElement.prototype.validationMessage; + +/** + * @const + * @type {ValidityState} + */ +HTMLSelectElement.prototype.validity; + +/** @type {boolean} */ +HTMLSelectElement.prototype.willValidate; + +/** @return {boolean} */ +HTMLSelectElement.prototype.checkValidity = function() {}; + +/** @param {string} message */ +HTMLSelectElement.prototype.setCustomValidity = function(message) {}; + +/** @type {boolean} */ +HTMLTextAreaElement.prototype.autofocus; + +/** + * @const + * @type {NodeList} + */ +HTMLTextAreaElement.prototype.labels; + +/** @type {string} */ +HTMLTextAreaElement.prototype.validationMessage; + +/** + * @const + * @type {ValidityState} + */ +HTMLTextAreaElement.prototype.validity; + +/** @type {boolean} */ +HTMLTextAreaElement.prototype.willValidate; + +/** @return {boolean} */ +HTMLTextAreaElement.prototype.checkValidity = function() {}; + +/** @param {string} message */ +HTMLTextAreaElement.prototype.setCustomValidity = function(message) {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/html5/the-embed-element.html#htmlembedelement + */ +function HTMLEmbedElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/dimension-attributes.html#dom-dim-width + */ +HTMLEmbedElement.prototype.width; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/dimension-attributes.html#dom-dim-height + */ +HTMLEmbedElement.prototype.height; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/the-embed-element.html#dom-embed-src + */ +HTMLEmbedElement.prototype.src; + +/** + * @type {string} + * @see http://www.w3.org/TR/html5/the-embed-element.html#dom-embed-type + */ +HTMLEmbedElement.prototype.type; + +// Fullscreen APIs. + +/** + * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-element-requestfullscreen + */ +Element.prototype.requestFullscreen = function() {}; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-fullscreenenabled + */ +Document.prototype.fullscreenEnabled; + +/** + * @type {Element} + * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-fullscreenelement + */ +Document.prototype.fullscreenElement; + +/** + * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-exitfullscreen + */ +Document.prototype.exitFullscreen = function() {}; + +// Externs definitions of browser current implementations. +// Firefox 10 implementation. +Element.prototype.mozRequestFullScreen = function() {}; + +Element.prototype.mozRequestFullScreenWithKeys = function() {}; + +/** @type {boolean} */ +Document.prototype.mozFullScreen; + +Document.prototype.mozCancelFullScreen = function() {}; + +/** @type {Element} */ +Document.prototype.mozFullScreenElement; + +/** @type {boolean} */ +Document.prototype.mozFullScreenEnabled; + +// Chrome 21 implementation. +/** + * The current fullscreen element for the document is set to this element. + * Valid only for Webkit browsers. + * @param {number=} opt_allowKeyboardInput Whether keyboard input is desired. + * Should use ALLOW_KEYBOARD_INPUT constant. + */ +Element.prototype.webkitRequestFullScreen = function(opt_allowKeyboardInput) {}; + +/** + * The current fullscreen element for the document is set to this element. + * Valid only for Webkit browsers. + * @param {number=} opt_allowKeyboardInput Whether keyboard input is desired. + * Should use ALLOW_KEYBOARD_INPUT constant. + */ +Element.prototype.webkitRequestFullscreen = function(opt_allowKeyboardInput) {}; + +/** @type {boolean} */ +Document.prototype.webkitIsFullScreen; + +Document.prototype.webkitCancelFullScreen = function() {}; + +/** @type {Element} */ +Document.prototype.webkitCurrentFullScreenElement; + +/** @type {Element} */ +Document.prototype.webkitFullscreenElement; + +/** @type {boolean} */ +Document.prototype.webkitFullScreenKeyboardInputAllowed; + +// IE 11 implementation. +// http://msdn.microsoft.com/en-us/library/ie/dn265028(v=vs.85).aspx +/** @return {void} */ +Element.prototype.msRequestFullscreen = function() {}; + +/** @return {void} */ +Element.prototype.msExitFullscreen = function() {}; + +/** @type {boolean} */ +Document.prototype.msFullscreenEnabled; + +/** @type {Element} */ +Document.prototype.msFullscreenElement; + +/** @type {number} */ +Element.ALLOW_KEYBOARD_INPUT = 1; + +/** @type {number} */ +Element.prototype.ALLOW_KEYBOARD_INPUT = 1; + + +/** @constructor */ +function MutationObserverInit() {} + +/** @type {boolean} */ +MutationObserverInit.prototype.childList; + +/** @type {boolean} */ +MutationObserverInit.prototype.attributes; + +/** @type {boolean} */ +MutationObserverInit.prototype.characterData; + +/** @type {boolean} */ +MutationObserverInit.prototype.subtree; + +/** @type {boolean} */ +MutationObserverInit.prototype.attributeOldValue; + +/** @type {boolean} */ +MutationObserverInit.prototype.characterDataOldValue; + +/** @type {Array.} */ +MutationObserverInit.prototype.attributeFilter; + + +/** @constructor */ +function MutationRecord() {} + +/** @type {string} */ +MutationRecord.prototype.type; + +/** @type {Node} */ +MutationRecord.prototype.target; + +/** @type {NodeList} */ +MutationRecord.prototype.addedNodes; + +/** @type {NodeList} */ +MutationRecord.prototype.removedNodes; + +/** @type {Node} */ +MutationRecord.prototype.previouSibling; + +/** @type {Node} */ +MutationRecord.prototype.nextSibling; + +/** @type {?string} */ +MutationRecord.prototype.attributeName; + +/** @type {?string} */ +MutationRecord.prototype.attributeNamespace; + +/** @type {?string} */ +MutationRecord.prototype.oldValue; + + +/** + * @see http://www.w3.org/TR/domcore/#mutation-observers + * @param {function(Array., MutationObserver)} callback + * @constructor + */ +function MutationObserver(callback) {} + +/** + * @param {Node} target + * @param {MutationObserverInit=} options + */ +MutationObserver.prototype.observe = function(target, options) {}; + +MutationObserver.prototype.disconnect = function() {}; + +/** + * @type {function(new:MutationObserver, function(Array.))} + */ +Window.prototype.WebKitMutationObserver; + +/** + * @type {function(new:MutationObserver, function(Array.))} + */ +Window.prototype.MozMutationObserver; + + +/** + * @see http://www.w3.org/TR/page-visibility/ + * @type {VisibilityState} + */ +Document.prototype.visibilityState; + +/** + * @type {string} + */ +Document.prototype.mozVisibilityState; + +/** + * @type {string} + */ +Document.prototype.webkitVisibilityState; + +/** + * @type {string} + */ +Document.prototype.msVisibilityState; + +/** + * @see http://www.w3.org/TR/page-visibility/ + * @type {boolean} + */ +Document.prototype.hidden; + +/** + * @type {boolean} + */ +Document.prototype.mozHidden; + +/** + * @type {boolean} + */ +Document.prototype.webkitHidden; + +/** + * @type {boolean} + */ +Document.prototype.msHidden; + +/** + * @see http://www.w3.org/TR/components-intro/ + * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register + * @param {string} type + * @param {{extends: (string|undefined), prototype: (Object|undefined)}} options + */ +Document.prototype.registerElement; + +/** + * This method is deprecated and should be removed by the end of 2014. + * @see http://www.w3.org/TR/components-intro/ + * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register + * @param {string} type + * @param {{extends: (string|undefined), prototype: (Object|undefined)}} options + */ +Document.prototype.register; + +/** + * @type {!FontFaceSet} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfacesource-fonts + */ +Document.prototype.fonts; + + +/** + * Definition of ShadowRoot interface, + * @see http://www.w3.org/TR/shadow-dom/#api-shadow-root + * @constructor + * @extends {DocumentFragment} + */ +function ShadowRoot() {} + +/** + * The host element that a ShadowRoot is attached to. + * Note: this is not yet W3C standard but is undergoing development. + * W3C feature tracking bug: + * https://www.w3.org/Bugs/Public/show_bug.cgi?id=22399 + * Draft specification: + * https://dvcs.w3.org/hg/webcomponents/raw-file/6743f1ace623/spec/shadow/index.html#shadow-root-object + * @type {!Element} + */ +ShadowRoot.prototype.host; + +/** + * @param {string} id id. + * @return {HTMLElement} + * @nosideeffects + */ +ShadowRoot.prototype.getElementById = function(id) {}; + + +/** + * @param {string} className + * @return {!NodeList} + * @nosideeffects + */ +ShadowRoot.prototype.getElementsByClassName = function(className) {}; + + +/** + * @param {string} tagName + * @return {!NodeList} + * @nosideeffects + */ +ShadowRoot.prototype.getElementsByTagName = function(tagName) {}; + + +/** + * @param {string} namespace + * @param {string} localName + * @return {!NodeList} + * @nosideeffects + */ +ShadowRoot.prototype.getElementsByTagNameNS = function(namespace, localName) {}; + + +/** + * @return {Selection} + * @nosideeffects + */ +ShadowRoot.prototype.getSelection = function() {}; + + +/** + * @param {number} x + * @param {number} y + * @return {Element} + * @nosideeffects + */ +ShadowRoot.prototype.elementFromPoint = function(x, y) {}; + + +/** + * @type {boolean} + */ +ShadowRoot.prototype.applyAuthorStyles; + + +/** + * @type {boolean} + */ +ShadowRoot.prototype.resetStyleInheritance; + + +/** + * @type {Element} + */ +ShadowRoot.prototype.activeElement; + + +/** + * @type {?ShadowRoot} + */ +ShadowRoot.prototype.olderShadowRoot; + + +/** + * @type {string} + */ +ShadowRoot.prototype.innerHTML; + + +/** + * @type {!StyleSheetList} + */ +ShadowRoot.prototype.styleSheets; + + + +/** + * @see http://www.w3.org/TR/shadow-dom/#the-content-element + * @constructor + * @extends {HTMLElement} + */ +function HTMLContentElement() {} + +/** + * @type {!string} + */ +HTMLContentElement.prototype.select; + +/** + * @return {!NodeList} + */ +HTMLContentElement.prototype.getDistributedNodes = function() {}; + + +/** + * @see http://www.w3.org/TR/shadow-dom/#the-shadow-element + * @constructor + * @extends {HTMLElement} + */ +function HTMLShadowElement() {} + +/** + * @return {!NodeList} + */ +HTMLShadowElement.prototype.getDistributedNodes = function() {}; + + +/** + * @see http://www.w3.org/TR/html5/webappapis.html#the-errorevent-interface + * + * @constructor + * @extends {Event} + * + * @param {string} type + * @param {ErrorEventInit=} opt_eventInitDict + */ +function ErrorEvent(type, opt_eventInitDict) {} + +/** @const {string} */ +ErrorEvent.prototype.message; + +/** @const {string} */ +ErrorEvent.prototype.filename; + +/** @const {number} */ +ErrorEvent.prototype.lineno; + +/** @const {number} */ +ErrorEvent.prototype.colno; + +/** @const {*} */ +ErrorEvent.prototype.error; + + +/** + * @see http://www.w3.org/TR/html5/webappapis.html#the-errorevent-interface + * + * @typedef {{ + * bubbles: (boolean|undefined), + * cancelable: (boolean|undefined), + * message: string, + * filename: string, + * lineno: number, + * colno: number, + * error: * + * }} + */ + var ErrorEventInit; + + +/** + * @see http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument + * @param {string=} opt_title A title to give the new HTML document + * @return {!HTMLDocument} + */ +DOMImplementation.prototype.createHTMLDocument = function(opt_title) {}; + + + +/** + * @constructor + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element + * @extends {HTMLElement} + */ +function HTMLPictureElement() {} + +/** + * @constructor + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element + * @extends {HTMLElement} + */ +function HTMLSourceElement() {} + +/** @type {string} */ +HTMLSourceElement.prototype.media; + +/** @type {string} */ +HTMLSourceElement.prototype.sizes; + +/** @type {string} */ +HTMLSourceElement.prototype.src; + +/** @type {string} */ +HTMLSourceElement.prototype.srcset; + +/** @type {string} */ +HTMLSourceElement.prototype.type; + +/** @type {string} */ +HTMLImageElement.prototype.sizes; + +/** @type {string} */ +HTMLImageElement.prototype.srcset; + + +/** + * 4.11 Interactive elements + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html + */ + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-details-element + * @constructor + * @extends {HTMLElement} + */ +function HTMLDetailsElement() {} + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-details-open + * @type {boolean} + */ +HTMLDetailsElement.prototype.open; + + +// As of 2/20/2015, has no special web IDL interface nor global +// constructor (i.e. HTMLSummaryElement). + + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menu-type + * @type {string} + */ +HTMLMenuElement.prototype.type; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menu-label + * @type {string} + */ +HTMLMenuElement.prototype.label; + + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-menuitem-element + * @constructor + * @extends {HTMLElement} + */ +function HTMLMenuItemElement() {} + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-type + * @type {string} + */ +HTMLMenuItemElement.prototype.type; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-label + * @type {string} + */ +HTMLMenuItemElement.prototype.label; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-icon + * @type {string} + */ +HTMLMenuItemElement.prototype.icon; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-disabled + * @type {boolean} + */ +HTMLMenuItemElement.prototype.disabled; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-checked + * @type {boolean} + */ +HTMLMenuItemElement.prototype.checked; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-radiogroup + * @type {string} + */ +HTMLMenuItemElement.prototype.radiogroup; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-default + * @type {boolean} + */ +HTMLMenuItemElement.prototype.default; + +// TODO(dbeam): add HTMLMenuItemElement.prototype.command if it's implemented. + + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#relatedevent + * @param {string} type + * @param {{relatedTarget: (EventTarget|undefined)}=} opt_eventInitDict + * @constructor + * @extends {Event} + */ +function RelatedEvent(type, opt_eventInitDict) {} + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-relatedevent-relatedtarget + * @type {EventTarget|undefined} + */ +RelatedEvent.prototype.relatedTarget; + + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-dialog-element + * @constructor + * @extends {HTMLElement} + */ +function HTMLDialogElement() {} + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-open + * @type {boolean} + */ +HTMLDialogElement.prototype.open; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-returnvalue + * @type {string} + */ +HTMLDialogElement.prototype.returnValue; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-show + * @param {(MouseEvent|Element)=} opt_anchor + */ +HTMLDialogElement.prototype.show = function(opt_anchor) {}; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-showmodal + * @param {(MouseEvent|Element)=} opt_anchor + */ +HTMLDialogElement.prototype.showModal = function(opt_anchor) {}; + +/** + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-close + * @param {string=} opt_returnValue + */ +HTMLDialogElement.prototype.close = function(opt_returnValue) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js new file mode 100644 index 000000000..359b9ceb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js @@ -0,0 +1,267 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for IE's custom CSS properties, as defined here: + * http://msdn.microsoft.com/en-us/library/aa768661(VS.85).aspx + * + * This page is also useful for the IDL definitions: + * http://source.winehq.org/source/include/mshtml.idl + * + * @externs + * @author nicksantos@google.com + */ + +/** @type {Element} */ +StyleSheet.prototype.owningElement; + +/** @type {boolean} */ +StyleSheet.prototype.readOnly; + +/** @type {StyleSheetList} */ +StyleSheet.prototype.imports; + +/** @type {string} */ +StyleSheet.prototype.id; + +/** + * @param {string} bstrURL + * @param {number} lIndex + * @return {number} + */ +StyleSheet.prototype.addImport; + +/** + * @param {string} bstrSelector + * @param {string} bstrStyle + * @param {number=} opt_iIndex + * @return {number} + * @see http://msdn.microsoft.com/en-us/library/aa358796%28v=vs.85%29.aspx + */ +StyleSheet.prototype.addRule; + +/** + * @param {number} lIndex + */ +StyleSheet.prototype.removeImport; + +/** + * @param {number} lIndex + */ +StyleSheet.prototype.removeRule; + +/** @type {string} */ +StyleSheet.prototype.cssText; + +/** @type {CSSRuleList} */ +StyleSheet.prototype.rules; + +// StyleSheet methods + +/** + * @param {string} propName + * @return {string} + * @see http://msdn.microsoft.com/en-us/library/aa358797(VS.85).aspx + */ +StyleSheet.prototype.getExpression; + +/** + * @param {string} name + * @param {string} expression + * @return {undefined} + * @see http://msdn.microsoft.com/en-us/library/ms531196(VS.85).aspx + */ +StyleSheet.prototype.setExpression; + +/** + * @param {string} expression + * @return {undefined} + * @see http://msdn.microsoft.com/en-us/library/aa358798(VS.85).aspx + */ +StyleSheet.prototype.removeExpression; + +// IE-only CSS style names. + +/** @type {string} */ CSSProperties.prototype.backgroundPositionX; + +/** @type {string} */ CSSProperties.prototype.backgroundPositionY; + +/** + * @see http://msdn.microsoft.com/en-us/library/ie/ms531081(v=vs.85).aspx + * NOTE: Left untyped to avoid conflict with caller. + */ +CSSProperties.prototype.behavior; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms533883.aspx + */ +CSSProperties.prototype.imeMode; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms534176(VS.85).aspx + */ +CSSProperties.prototype.msInterpolationMode; + +/** @type {string} */ CSSProperties.prototype.overflowX; + +/** @type {string} */ CSSProperties.prototype.overflowY; + +/** @type {number} */ CSSProperties.prototype.pixelWidth; + +/** @type {number} */ CSSProperties.prototype.pixelHeight; + +/** @type {number} */ CSSProperties.prototype.pixelLeft; + +/** @type {number} */ CSSProperties.prototype.pixelTop; + +/** @type {string} */ CSSProperties.prototype.styleFloat; + +/** + * @type {string|number} + * @see http://msdn.microsoft.com/en-us/library/ms535169(VS.85).aspx + */ +CSSProperties.prototype.zoom; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms535153(VS.85).aspx + */ +CSSProperties.prototype.writingMode; + +/** + * IE-specific extensions. + * @see http://blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspx + */ + +/** @type {string} */ +CSSProperties.prototype.MsAccelerator; + +/** @type {string} */ +CSSProperties.prototype.MsBackgroundPositionX; + +/** @type {string} */ +CSSProperties.prototype.MsBackgroundPositionY; + +/** @type {string} */ +CSSProperties.prototype.MsBehavior; + +/** @type {string} */ +CSSProperties.prototype.MsBlockProgression; + +/** @type {string} */ +CSSProperties.prototype.MsFilter; + +/** @type {string} */ +CSSProperties.prototype.MsImeMode; + +/** @type {string} */ +CSSProperties.prototype.MsLayoutGrid; + +/** @type {string} */ +CSSProperties.prototype.MsLayoutGridChar; + +/** @type {string} */ +CSSProperties.prototype.MsLayoutGridLine; + +/** @type {string} */ +CSSProperties.prototype.MsLayoutGridMode; + +/** @type {string} */ +CSSProperties.prototype.MsLayoutGridType; + +/** @type {string} */ +CSSProperties.prototype.MsLineBreak; + +/** @type {string} */ +CSSProperties.prototype.MsLineGridMode; + +/** @type {string} */ +CSSProperties.prototype.MsInterpolationMode; + +/** @type {string} */ +CSSProperties.prototype.MsOverflowX; + +/** @type {string} */ +CSSProperties.prototype.MsOverflowY; + +/** @type {string} */ +CSSProperties.prototype.MsScrollbar3dlightColor; + +/** @type {string} */ +CSSProperties.prototype.MsScrollbarArrowColor; + +/** @type {string} */ +CSSProperties.prototype.MsScrollbarBaseColor; + +/** @type {string} */ +CSSProperties.prototype.MsScrollbarDarkshadowColor; + +/** @type {string} */ +CSSProperties.prototype.MsScrollbarFaceColor; + +CSSProperties.prototype.MsScrollbarHighlightColor; + +/** @type {string} */ +CSSProperties.prototype.MsScrollbarShadowColor; + +/** @type {string} */ +CSSProperties.prototype.MsScrollbarTrackColor; + +/** @type {string} */ +CSSProperties.prototype.MsTextAlignLast; + +/** @type {string} */ +CSSProperties.prototype.MsTextAutospace; + +/** @type {string} */ +CSSProperties.prototype.MsTextJustify; + +/** @type {string} */ +CSSProperties.prototype.MsTextKashidaSpace; + +/** @type {string} */ +CSSProperties.prototype.MsTextOverflow; + +/** @type {string} */ +CSSProperties.prototype.MsTextUnderlinePosition; + +/** @type {string} */ +CSSProperties.prototype.MsWordBreak; + +/** @type {string} */ +CSSProperties.prototype.MsWordWrap; + +/** @type {string} */ +CSSProperties.prototype.MsWritingMode; + +/** @type {string} */ +CSSProperties.prototype.MsZoom; + +// See: http://msdn.microsoft.com/en-us/library/windows/apps/Hh702466.aspx + +/** @type {string} */ +CSSProperties.prototype.msContentZooming; + +/** @type {string} */ +CSSProperties.prototype.msTouchAction; + +/** @type {string} */ +CSSProperties.prototype.msTransform; + +/** @type {string} */ +CSSProperties.prototype.msTransition; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js new file mode 100644 index 000000000..cbb2ea5ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js @@ -0,0 +1,1395 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for all the extensions over the + * W3C's DOM specification by IE in JScript. This file depends on + * w3c_dom2.js. The whole file has NOT been fully type annotated. + * + * When a non-standard extension appears in both Gecko and IE, we put + * it in gecko_dom.js + * + * @externs + * @author stevey@google.com (Steve Yegge) + */ + +// TODO(nicksantos): Rewrite all the DOM interfaces as interfaces, instead +// of kludging them as an inheritance hierarchy. + +/** + * @constructor + * @extends {Document} + * @see http://msdn.microsoft.com/en-us/library/ms757878(VS.85).aspx + */ +function XMLDOMDocument() {} + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms761398(VS.85).aspx + */ +XMLDOMDocument.prototype.async; + +/** + * @type {!Function} + * @see http://msdn.microsoft.com/en-us/library/ms762647(VS.85).aspx + */ +XMLDOMDocument.prototype.ondataavailable; + +/** + * @type {!Function} + * @see http://msdn.microsoft.com/en-us/library/ms764640(VS.85).aspx + */ +XMLDOMDocument.prototype.onreadystatechange; + +/** + * @type {!Function} + * @see http://msdn.microsoft.com/en-us/library/ms753795(VS.85).aspx + */ +XMLDOMDocument.prototype.ontransformnode; + +/** + * @type {Object} + * @see http://msdn.microsoft.com/en-us/library/ms756041(VS.85).aspx + */ +XMLDOMDocument.prototype.parseError; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms761353(VS.85).aspx + */ +XMLDOMDocument.prototype.preserveWhiteSpace; + +/** + * @type {number} + * @see http://msdn.microsoft.com/en-us/library/ms753702(VS.85).aspx + */ +XMLDOMDocument.prototype.readyState; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms762283(VS.85).aspx + * @type {boolean} + */ +XMLDOMDocument.prototype.resolveExternals; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms760290(v=vs.85).aspx + * @param {string} name + * @param {*} value + */ +XMLDOMDocument.prototype.setProperty = function(name, value) {}; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms767669(VS.85).aspx + */ +XMLDOMDocument.prototype.url; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms762791(VS.85).aspx + */ +XMLDOMDocument.prototype.validateOnParse; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms763830(VS.85).aspx + */ +XMLDOMDocument.prototype.abort = function() {}; + +/** + * @param {*} type + * @param {string} name + * @param {string} namespaceURI + * @return {Node} + * @see http://msdn.microsoft.com/en-us/library/ms757901(VS.85).aspx + * @nosideeffects + */ +XMLDOMDocument.prototype.createNode = function(type, name, namespaceURI) {}; + +/** + * @param {string} xmlSource + * @return {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms762722(VS.85).aspx + * @override + */ +XMLDOMDocument.prototype.load = function(xmlSource) {}; + +/** + * @param {string} xmlString + * @return {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms754585(VS.85).aspx + * @override + */ +XMLDOMDocument.prototype.loadXML = function(xmlString) {}; + +/** + * @param {string} id + * @return {Node} + * @see http://msdn.microsoft.com/en-us/library/ms766397(VS.85).aspx + */ +XMLDOMDocument.prototype.nodeFromID = function(id) {}; + +//============================================================================== +// XMLNode methods and properties +// In a real DOM hierarchy, XMLDOMDocument inherits from XMLNode and Document. +// Since we can't express that in our type system, we put XMLNode properties +// on Node. + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms767570(VS.85).aspx + */ +Node.prototype.baseName; + +/** + * @type {?string} + * @see http://msdn.microsoft.com/en-us/library/ms762763(VS.85).aspx + */ +Node.prototype.dataType; + +/** + * @type {Node} + * @see http://msdn.microsoft.com/en-us/library/ms764733(VS.85).aspx + */ +Node.prototype.definition; + +/** + * IE5 used document instead of ownerDocument. + * Old versions of WebKit used document instead of contentDocument. + * @type {Document} + */ +Node.prototype.document; + + +/** + * Inserts the given HTML text into the element at the location. + * @param {string} sWhere Where to insert the HTML text, one of 'beforeBegin', + * 'afterBegin', 'beforeEnd', 'afterEnd'. + * @param {string} sText HTML text to insert. + * @see http://msdn.microsoft.com/en-us/library/ms536452(VS.85).aspx + */ +Node.prototype.insertAdjacentHTML = function(sWhere, sText) {}; + + +/** + * @type {*} + * @see http://msdn.microsoft.com/en-us/library/ms762308(VS.85).aspx + */ +Node.prototype.nodeTypedValue; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms757895(VS.85).aspx + */ +Node.prototype.nodeTypeString; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms762237(VS.85).aspx + */ +Node.prototype.parsed; + +/** + * @type {Element} + * @see http://msdn.microsoft.com/en-us/library/ms534327(VS.85).aspx + */ +Node.prototype.parentElement; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms753816(VS.85).aspx + */ +Node.prototype.specified; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms762687(VS.85).aspx + */ +Node.prototype.text; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms755989(VS.85).aspx + */ +Node.prototype.xml; + +/** + * @param {string} expression An XPath expression. + * @return {NodeList} + * @see http://msdn.microsoft.com/en-us/library/ms754523(VS.85).aspx + * @nosideeffects + */ +Node.prototype.selectNodes = function(expression) {}; + +/** + * @param {string} expression An XPath expression. + * @return {Node} + * @see http://msdn.microsoft.com/en-us/library/ms757846(VS.85).aspx + * @nosideeffects + */ +Node.prototype.selectSingleNode = function(expression) {}; + +/** + * @param {Node} stylesheet XSLT stylesheet. + * @return {string} + * @see http://msdn.microsoft.com/en-us/library/ms761399(VS.85).aspx + * @nosideeffects + */ +Node.prototype.transformNode = function(stylesheet) {}; + +/** + * @param {Node} stylesheet XSLT stylesheet. + * @param {Object} outputObject + * @see http://msdn.microsoft.com/en-us/library/ms766561(VS.85).aspx + */ +Node.prototype.transformNodeToObject = + function(stylesheet, outputObject) {}; + +//============================================================================== +// Node methods + +/** + * @param {boolean=} opt_bRemoveChildren Whether to remove the entire sub-tree. + * Defaults to false. + * @return {Node} The object that was removed. + * @see http://msdn.microsoft.com/en-us/library/ms536708(VS.85).aspx + */ +Node.prototype.removeNode = function(opt_bRemoveChildren) {}; + +/** + * @constructor + */ +function ClipboardData() {} + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx + * @param {string=} opt_type Type of clipboard data to clear. 'Text' or + * 'URL' or 'File' or 'HTML' or 'Image'. + */ +ClipboardData.prototype.clearData = function(opt_type) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx + * @param {string} type Type of clipboard data to set ('Text' or 'URL'). + * @param {string} data Data to set + * @return {boolean} Whether the data were set correctly. + */ +ClipboardData.prototype.setData = function(type, data) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx + * @param {string} type Type of clipboard data to get ('Text' or 'URL'). + * @return {string} The current data + */ +ClipboardData.prototype.getData = function(type) { }; + +/** + * @type {!Window} + * @see https://developer.mozilla.org/en/DOM/window + */ +var window; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx + * @type ClipboardData + */ +Window.prototype.clipboardData; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533724(VS.85).aspx + */ +Window.prototype.dialogHeight; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533725(VS.85).aspx + */ +Window.prototype.dialogLeft; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533726(VS.85).aspx + */ +Window.prototype.dialogTop; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533727(VS.85).aspx + */ +Window.prototype.dialogWidth; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535863(VS.85).aspx + */ +Window.prototype.event; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc197012(VS.85).aspx + */ +Window.prototype.maxConnectionsPer1_0Server; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc197013(VS.85).aspx + */ +Window.prototype.maxConnectionsPerServer; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534198(VS.85).aspx + */ +Window.prototype.offscreenBuffering; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534389(VS.85).aspx + */ +Window.prototype.screenLeft; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534389(VS.85).aspx + */ +Window.prototype.screenTop; + +// Functions + +/** + * @param {string} event + * @param {Function} handler + * @see http://msdn.microsoft.com/en-us/library/ms536343(VS.85).aspx + */ +Window.prototype.attachEvent; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536392(VS.85).aspx + */ +Window.prototype.createPopup; + +/** + * @param {string} event + * @param {Function} handler + * @see http://msdn.microsoft.com/en-us/library/ms536411(VS.85).aspx + */ +Window.prototype.detachEvent; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536420(VS.85).aspx + */ +Window.prototype.execScript; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536425(VS.85).aspx + */ +Window.prototype.focus; + +/** + * @param {number} x + * @param {number} y + * @see http://msdn.microsoft.com/en-us/library/ms536618(VS.85).aspx + */ +Window.prototype.moveBy = function(x, y) {}; + +/** + * @param {number} x + * @param {number} y + * @see http://msdn.microsoft.com/en-us/library/ms536626(VS.85).aspx + */ +Window.prototype.moveTo = function(x, y) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536638(VS.85).aspx + */ +Window.prototype.navigate; + +/** + * @param {*=} opt_url + * @param {string=} opt_windowName + * @param {string=} opt_windowFeatures + * @param {boolean=} opt_replace + * @return {Window} + * @see http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx + */ +Window.prototype.open = function(opt_url, opt_windowName, opt_windowFeatures, + opt_replace) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536672(VS.85).aspx + */ +Window.prototype.print = function() {}; + +/** + * @param {number} width + * @param {number} height + * @see http://msdn.microsoft.com/en-us/library/ms536722(VS.85).aspx + */ +Window.prototype.resizeBy = function(width, height) {}; + +/** + * @param {number} width + * @param {number} height + * @see http://msdn.microsoft.com/en-us/library/ms536723(VS.85).aspx + */ +Window.prototype.resizeTo = function(width, height) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536738(VS.85).aspx + */ +Window.prototype.setActive; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536758(VS.85).aspx + */ +Window.prototype.showHelp; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536761(VS.85).aspx + */ +Window.prototype.showModelessDialog; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535246%28v=vs.85%29.aspx + * @const {!Object} + */ +Window.prototype.external; + +/** + * @constructor + */ +function History() { }; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx + * @param {number|string} delta The number of entries to go back, or + * the URL to which to go back. (URL form is supported only in IE) + */ +History.prototype.go = function(delta) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx + * @param {number=} opt_distance The number of entries to go back + * (Mozilla doesn't support distance -- use #go instead) + */ +History.prototype.back = function(opt_distance) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx + * @type {number} + */ +History.prototype.length; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx + */ +History.prototype.forward = function() {}; + +/** + * @type {boolean} + * @implicitCast + * @see http://msdn.microsoft.com/en-us/library/ie/ms533072(v=vs.85).aspx + */ +HTMLFrameElement.prototype.allowTransparency; + +/** + * @type {Window} + * @see http://msdn.microsoft.com/en-us/library/ms533692(VS.85).aspx + */ +HTMLFrameElement.prototype.contentWindow; + +/** + * @type {boolean} + * @implicitCast + * @see http://msdn.microsoft.com/en-us/library/ie/ms533072(v=vs.85).aspx + */ +HTMLIFrameElement.prototype.allowTransparency; + +/** + * @type {Window} + * @see http://msdn.microsoft.com/en-us/library/ms533692(VS.85).aspx + */ +HTMLIFrameElement.prototype.contentWindow; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536385(VS.85).aspx + */ +HTMLBodyElement.prototype.createControlRange; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx + */ +HTMLScriptElement.prototype.readyState; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx + */ +HTMLIFrameElement.prototype.readyState; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx + */ +HTMLImageElement.prototype.readyState; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx + */ +HTMLObjectElement.prototype.readyState; + + +/** + * @constructor + */ +function ControlRange() {} + +ControlRange.prototype.add; +ControlRange.prototype.addElement; +ControlRange.prototype.execCommand; +ControlRange.prototype.item; +ControlRange.prototype.queryCommandEnabled; +ControlRange.prototype.queryCommandIndeterm; +ControlRange.prototype.queryCommandState; +ControlRange.prototype.queryCommandSupported; +ControlRange.prototype.queryCommandValue; +ControlRange.prototype.remove; +ControlRange.prototype.scrollIntoView; +ControlRange.prototype.select; + +/** + * @constructor + * @see http://msdn.microsoft.com/en-us/library/ms535872.aspx + */ +function TextRange() {} + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533538(VS.85).aspx + */ +TextRange.prototype.boundingHeight; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533539(VS.85).aspx + */ +TextRange.prototype.boundingLeft; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533540(VS.85).aspx + */ +TextRange.prototype.boundingTop; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533541(VS.85).aspx + */ +TextRange.prototype.boundingWidth; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533874(VS.85).aspx + */ +TextRange.prototype.htmlText; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534200(VS.85).aspx + */ +TextRange.prototype.offsetLeft; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534303(VS.85).aspx + */ +TextRange.prototype.offsetTop; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534676(VS.85).aspx + */ +TextRange.prototype.text; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536371(VS.85).aspx + */ +TextRange.prototype.collapse; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536373(VS.85).aspx + */ +TextRange.prototype.compareEndPoints; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536416(VS.85).aspx + */ +TextRange.prototype.duplicate; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536419(VS.85).aspx + */ +TextRange.prototype.execCommand; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536421(VS.85).aspx + */ +TextRange.prototype.expand; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536422(VS.85).aspx + */ +TextRange.prototype.findText; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536432(VS.85).aspx + */ +TextRange.prototype.getBookmark; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536433(VS.85).aspx + */ +TextRange.prototype.getBoundingClientRect; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536435(VS.85).aspx + */ +TextRange.prototype.getClientRects; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536450(VS.85).aspx + */ +TextRange.prototype.inRange; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536458(VS.85).aspx + */ +TextRange.prototype.isEqual; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536616(VS.85).aspx + */ +TextRange.prototype.move; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536620(VS.85).aspx + */ +TextRange.prototype.moveEnd; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536623(VS.85).aspx + */ +TextRange.prototype.moveStart; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536628(VS.85).aspx + */ +TextRange.prototype.moveToBookmark; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536630(VS.85).aspx + */ +TextRange.prototype.moveToElementText; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536632(VS.85).aspx + */ +TextRange.prototype.moveToPoint; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536654(VS.85).aspx + */ +TextRange.prototype.parentElement; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536656(VS.85).aspx + */ +TextRange.prototype.pasteHTML; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536676(VS.85).aspx + */ +TextRange.prototype.queryCommandEnabled; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536678(VS.85).aspx + */ +TextRange.prototype.queryCommandIndeterm; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536679(VS.85).aspx + */ +TextRange.prototype.queryCommandState; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536681(VS.85).aspx + */ +TextRange.prototype.queryCommandSupported; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536683(VS.85).aspx + */ +TextRange.prototype.queryCommandValue; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536730(VS.85).aspx + */ +TextRange.prototype.scrollIntoView; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536735(VS.85).aspx + */ +TextRange.prototype.select; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536745(VS.85).aspx + */ +TextRange.prototype.setEndPoint; + +/** + * @return {undefined} + * @see http://msdn.microsoft.com/en-us/library/ms536418(VS.85).aspx + */ +Selection.prototype.clear = function() {}; + +/** + * @return {TextRange|ControlRange} + * @see http://msdn.microsoft.com/en-us/library/ms536394(VS.85).aspx + */ +Selection.prototype.createRange = function() {}; + +/** + * @return {Array.} + * @see http://msdn.microsoft.com/en-us/library/ms536396(VS.85).aspx + */ +Selection.prototype.createRangeCollection = function() {}; + +/** + * @constructor + * @see http://msdn.microsoft.com/en-us/library/ms537447(VS.85).aspx + */ +function controlRange() {} + + +Document.prototype.loadXML; + + +// http://msdn.microsoft.com/en-us/library/ms531073(VS.85).aspx + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533065(VS.85).aspx + */ +Document.prototype.activeElement; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533553(VS.85).aspx + */ +Document.prototype.charset; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533693(VS.85).aspx + */ +Document.prototype.cookie; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533714(VS.85).aspx + */ +Document.prototype.defaultCharset; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533731(VS.85).aspx + */ +Document.prototype.dir; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc196988(VS.85).aspx + */ +Document.prototype.documentMode; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533747(VS.85).aspx + */ +Document.prototype.expando; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533750(VS.85).aspx + */ +Document.prototype.fileCreatedDate; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533751(VS.85).aspx + */ +Document.prototype.fileModifiedDate; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533752(VS.85).aspx + */ +Document.prototype.fileSize; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534331(VS.85).aspx + */ +Document.prototype.parentWindow; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534353(VS.85).aspx + */ +Document.prototype.protocol; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx + */ +HTMLDocument.prototype.readyState; + +/** + * @type {Selection} + * @see http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx + */ +Document.prototype.selection; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534704(VS.85).aspx + */ +Document.prototype.uniqueID; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534709(VS.85).aspx + */ +Document.prototype.URLUnencoded; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535155(VS.85).aspx + */ +Document.prototype.XMLDocument; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535163(VS.85).aspx + */ +Document.prototype.XSLDocument; + +// functions + +/** + * @param {string} event + * @param {Function} handler + * @see http://msdn.microsoft.com/en-us/library/ms536343(VS.85).aspx + */ +Document.prototype.attachEvent; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536390(VS.85).aspx + */ +Document.prototype.createEventObject; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx + */ +Document.prototype.createStyleSheet; + +/** + * @param {string} event + * @param {Function} handler + * @see http://msdn.microsoft.com/en-us/library/ms536411(VS.85).aspx + */ +Document.prototype.detachEvent; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536425(VS.85).aspx + */ +Document.prototype.focus; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536447(VS.85).aspx + * @return {boolean} + */ +Document.prototype.hasFocus = function() {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536614(VS.85).aspx + */ +Document.prototype.mergeAttributes; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536685(VS.85).aspx + */ +Document.prototype.recalc; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536689(VS.85).aspx + */ +Document.prototype.releaseCapture; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536738(VS.85).aspx + */ +Document.prototype.setActive; + + +// collections + +/** + * @see http://msdn.microsoft.com/en-us/library/ms537434(VS.85).aspx + */ +Document.prototype.all; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms537445(VS.85).aspx + */ +Document.prototype.childNodes; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms537459(VS.85).aspx + */ +Document.prototype.frames; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms537470(VS.85).aspx + */ +Document.prototype.namespaces; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms537487(VS.85).aspx + */ +Document.prototype.scripts; + +/** + * @param {string} sUrl + * @return {number} + * @see http://msdn.microsoft.com/en-us/library/ms535922(VS.85).aspx + */ +Element.prototype.addBehavior = function(sUrl) {}; + +/** + * @param {string} event + * @param {Function} handler + * @see http://msdn.microsoft.com/en-us/library/mm536343(v=vs.85).aspx + */ +Element.prototype.attachEvent; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms533546(VS.85).aspx + */ +Element.prototype.canHaveChildren; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms533559(v=vs.85).aspx + */ +Element.prototype.classid; + +/** + * @param {number} iCoordX Integer that specifies the client window coordinate + * of x. + * @param {number} iCoordY Integer that specifies the client window coordinate + * of y. + * @return {string} The component of an element located at the specified + * coordinates. + * @see http://msdn.microsoft.com/en-us/library/ms536375(VS.85).aspx + * @nosideeffects + */ +Element.prototype.componentFromPoint = function(iCoordX, iCoordY) {}; + + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms533690(VS.85).aspx + */ +Element.prototype.contentEditable; + +/** + * @return {TextRange} + * @see http://msdn.microsoft.com/en-us/library/ms536401(VS.85).aspx + */ +Element.prototype.createTextRange; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms535231(VS.85).aspx + */ +Element.prototype.currentStyle; + +/** + * @param {string} event + * @param {Function} handler + * @see http://msdn.microsoft.com/en-us/library/ie/ms536411(v=vs.85).aspx + */ +Element.prototype.detachEvent; + +/** + * @param {string=} opt_action + * @see http://msdn.microsoft.com/en-us/library/ms536414%28VS.85%29.aspx + */ +Element.prototype.doScroll = function(opt_action) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536423(VS.85).aspx + */ +Element.prototype.fireEvent; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms533783(VS.85).aspx + */ +Element.prototype.hideFocus; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533899.aspx + */ +Element.prototype.innerText; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms537838(VS.85).aspx + */ +Element.prototype.isContentEditable; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms531395(v=vs.85).aspx + * NOTE: Left untyped to avoid conflict with subclasses. + */ +Element.prototype.load; + +/** + * @param {number} pointerId Id of the pointer that is assign to the element. + * @see http://msdn.microsoft.com/en-us/library/ie/hh771882(v=vs.85).aspx + */ +Element.prototype.msSetPointerCapture = function(pointerId) {}; + +/** + * @param {number} pointerId + * @see http://msdn.microsoft.com/en-us/library/ie/hh771880.aspx + */ +Element.prototype.msReleasePointerCapture = function(pointerId) {}; + +/** + * @type {?function(Event)} + * @see http://msdn.microsoft.com/en-us/library/ms536903(v=vs.85).aspx + */ +Element.prototype.onbeforedeactivate; + +/** + * @type {?function(Event)} + * @see http://msdn.microsoft.com/en-us/library/ms536945(VS.85).aspx + */ +Element.prototype.onmouseenter; + +/** + * @type {?function(Event)} + * @see http://msdn.microsoft.com/en-us/library/ms536946(VS.85).aspx + */ +Element.prototype.onmouseleave; + +/** + * @type {?function(Event)} + * @see http://msdn.microsoft.com/en-us/library/ms536969(VS.85).aspx + */ +Element.prototype.onselectstart; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/aa752326(VS.85).aspx + */ +Element.prototype.outerHTML; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536689(VS.85).aspx + */ +Element.prototype.releaseCapture = function() {}; + +/** + * @param {number} iID + * @return {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms536700(VS.85).aspx + */ +Element.prototype.removeBehavior = function(iID) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/aa703996(VS.85).aspx + */ +Element.prototype.runtimeStyle; + +/** + * @param {string} sStoreName The arbitrary name assigned to a persistent object + * in a UserData store. + * @see http://msdn.microsoft.com/en-us/library/ms531403(v=vs.85).aspx + */ +Element.prototype.save = function(sStoreName) {}; + +/** + * @param {boolean=} opt_bContainerCapture Events originating in a container are + * captured by the container. Defaults to true. + * @see http://msdn.microsoft.com/en-us/library/ms536742(VS.85).aspx + */ +Element.prototype.setCapture = function(opt_bContainerCapture) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534635(VS.85).aspx + */ +Element.prototype.sourceIndex; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms537840.aspx + */ +Element.prototype.unselectable; + +/** + * @constructor + * @see http://msdn.microsoft.com/en-us/library/aa752462(v=vs.85).aspx + */ +function HTMLFiltersCollection() {} + +/** + * @see http://msdn.microsoft.com/en-us/library/aa752463(v=vs.85).aspx + * @type {number} + */ +HTMLFiltersCollection.prototype.length; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms537452(v=vs.85).aspx + * @type {HTMLFiltersCollection} + */ +Element.prototype.filters; + +/** + * @constructor + * @see http://msdn.microsoft.com/en-us/library/ms532853(v=vs.85).aspx + */ +function HTMLFilter() {} + +/** + * @see http://msdn.microsoft.com/en-us/library/ms532954(v=vs.85).aspx + */ +HTMLFilter.prototype.apply = function() {}; + +/** + * @constructor + * @extends {HTMLFilter} + * @see http://msdn.microsoft.com/en-us/library/ms532967(v=vs.85).aspx + */ +function AlphaFilter() {} + +/** + * @see http://msdn.microsoft.com/en-us/library/ms532910(v=vs.85).aspx + * @type {number} + */ +AlphaFilter.prototype.Opacity; + +/** + * @constructor + * @extends {HTMLFilter} + * @see http://msdn.microsoft.com/en-us/library/ms532969(v=vs.85).aspx + */ +function AlphaImageLoaderFilter() {} + +/** + * @see http://msdn.microsoft.com/en-us/library/ms532920(v=vs.85).aspx + * @type {string} + */ +AlphaImageLoaderFilter.prototype.sizingMethod; + +/** + * @constructor + * @see http://msdn.microsoft.com/en-us/library/ms535866(VS.85).aspx + */ +function Location() {} + +/** + * @see http://trac.webkit.org/changeset/113945 + * @type {DOMStringList} + */ +Location.prototype.ancestorOrigins; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533775(VS.85).aspx + * @type {string} + */ +Location.prototype.hash; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533784(VS.85).aspx + * @type {string} + */ +Location.prototype.host; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533785(VS.85).aspx + * @type {string} + */ +Location.prototype.hostname; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms533867(VS.85).aspx + * @type {string} + */ +Location.prototype.href; + +/** + * @see https://docs.google.com/document/view?id=1r_VTFKApVOaNIkocrg0z-t7lZgzisTuGTXkdzAk4gLU&hl=en + * @type {string} + */ +Location.prototype.origin; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534332(VS.85).aspx + * @type {string} + */ +Location.prototype.pathname; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534342(VS.85).aspx + */ +Location.prototype.port; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534353(VS.85).aspx + * @type {string} + */ +Location.prototype.protocol; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms534620(VS.85).aspx + * @type {string} + */ +Location.prototype.search; + +/** + * @see http://msdn.microsoft.com/en-us/library/ms536342(VS.85).aspx + * @param {string} url + */ +Location.prototype.assign = function(url) {}; + +/** + * @param {boolean=} opt_forceReload If true, reloads the page from + * the server. Defaults to false. + * @see http://msdn.microsoft.com/en-us/library/ms536691(VS.85).aspx + */ +Location.prototype.reload = function(opt_forceReload) {}; + +/** + * @param {string} url + * @see http://msdn.microsoft.com/en-us/library/ms536712(VS.85).aspx + */ +Location.prototype.replace = function(url) {}; + + +// For IE, returns an object representing key-value pairs for all the global +// variables prefixed with str, e.g. test* + +/** @param {*=} opt_str */ +function RuntimeObject(opt_str) {} + + +/** + * @type {StyleSheet} + * @see http://msdn.microsoft.com/en-us/library/dd347030(VS.85).aspx + */ +HTMLStyleElement.prototype.styleSheet; + + +/** + * IE implements Cross Origin Resource Sharing (cross-domain XMLHttpRequests) + * via the XDomainRequest object. + * + * @constructor + * @see http://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx + * @see http://www.w3.org/TR/cors/ + */ +function XDomainRequest() {} + +/** + * Aborts the request. + * @see http://msdn.microsoft.com/en-us/library/cc288129(v=vs.85).aspx + */ +XDomainRequest.prototype.abort = function() {}; + +/** + * Sets the method and URL for the request. + * @param {string} bstrMethod Either "GET" or "POST" + * @param {string} bstrUrl The target URL + * @see http://msdn.microsoft.com/en-us/library/cc288168(v=vs.85).aspx + */ +XDomainRequest.prototype.open = function(bstrMethod, bstrUrl) {}; + +/** + * Sends the request. + * @param {string=} varBody The POST body to send to the server. If omitted, + * the behavior is identical to sending an empty string. + * @see http://msdn.microsoft.com/en-us/library/cc288207(v=vs.85).aspx + */ +XDomainRequest.prototype.send = function(varBody) {}; + +/** + * Called if the request could not be completed. Note that error information is + * not available. + * @see http://msdn.microsoft.com/en-us/library/ms536930%28v=VS.85%29.aspx + * @type {?function()} + */ +XDomainRequest.prototype.onerror; + +/** + * Called when the response has finished. + * @see http://msdn.microsoft.com/en-us/library/ms536942%28v=VS.85%29.aspx + * @type {?function()} + */ +XDomainRequest.prototype.onload; + +/** + * Called every time part of the response has been received. + * @see http://msdn.microsoft.com/en-us/library/cc197058%28v=VS.85%29.aspx + * @type {?function()} + */ +XDomainRequest.prototype.onprogress; + +/** + * Called if the timeout period has elapsed. + * @see http://msdn.microsoft.com/en-us/library/cc197061%28v=VS.85%29.aspx + * @type {?function()} + */ +XDomainRequest.prototype.ontimeout; + +/** + * The current response body. + * @see http://msdn.microsoft.com/en-us/library/cc287956%28v=VS.85%29.aspx + * @type {string} + */ +XDomainRequest.prototype.responseText; + +/** + * The timeout (in milliseconds) for the request. + * @type {number} + */ +XDomainRequest.prototype.timeout; + +/** + * The Content-Type of the response, or an empty string. + * @type {string} + */ +XDomainRequest.prototype.contentType; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/ms533542(v=vs.85).aspx + */ +Navigator.prototype.browserLanguage; + +/** + * @type {boolean} + * @see http://blogs.msdn.com/b/ie/archive/2011/09/20/touch-input-for-ie10-and-metro-style-apps.aspx + */ +Navigator.prototype.msPointerEnabled; + +/** + * @type {number} + * @see http://msdn.microsoft.com/en-us/library/ms533721(v=vs.85).aspx + */ +Screen.prototype.deviceXDPI; + +/** + * @type {number} + * @see http://msdn.microsoft.com/en-us/library/ms534128%28v=vs.85%29.aspx + */ +Screen.prototype.logicalXDPI; + +/** + * @type {number} + * @see http://msdn.microsoft.com/en-us/library/ms534130%28v=vs.85%29.aspx + */ +Screen.prototype.logicalYDPI; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js new file mode 100644 index 000000000..de2b89904 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js @@ -0,0 +1,309 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for all the extensions over the + * W3C's event specification by IE in JScript. This file depends on + * w3c_event.js. + * + * @see http://msdn.microsoft.com/en-us/library/ms535863.aspx + * @externs + */ + +/** @type {string} */ +Event.prototype.Abstract; + +/** @type {boolean} */ +Event.prototype.altLeft; + +/** @type {string} */ +Event.prototype.Banner; + +/** + * A ClipboardData on IE, but a DataTransfer on WebKit. + * @see http://msdn.microsoft.com/en-us/library/ms535220.aspx + * @type {(ClipboardData|undefined)} + */ +Event.prototype.clipboardData; + +/** @type {boolean} */ +Event.prototype.contentOverflow; + +/** @type {boolean} */ +Event.prototype.ctrlLeft; + +/** @type {string} */ +Event.prototype.dataFld; + +Event.prototype.domain; + +/** @type {Element} */ +Event.prototype.fromElement; + +/** @type {string} */ +Event.prototype.MoreInfo; + +/** @type {string} */ +Event.prototype.nextPage; + +/** @type {number} */ +Event.prototype.offsetX; + +/** @type {number} */ +Event.prototype.offsetY; + +/** @type {string} */ +Event.prototype.propertyName; + +/** @type {string} */ +Event.prototype.qualifier; + +/** @type {number} */ +Event.prototype.reason; + +/** @type {Object.<*,*>} */ +Event.prototype.recordset; + +/** @type {boolean} */ +Event.prototype.repeat; + +/** @type {(boolean|string|undefined)} */ +Event.prototype.returnValue; + +/** @type {string} */ +Event.prototype.saveType; + +Event.prototype.scheme; + +/** @type {boolean} */ +Event.prototype.shiftLeft; + +/** @type {Window} */ +Event.prototype.source; + +/** @type {Element} */ +Event.prototype.srcElement; + +Event.prototype.srcFilter; + +/** @type {string} */ +Event.prototype.srcUrn; + +/** @type {Element} */ +Event.prototype.toElement; + +Event.prototype.userName; + +/** @type {number} */ +Event.prototype.wheelDelta; + +/** @type {number} */ +Event.prototype.x; + +/** @type {number} */ +Event.prototype.y; + +/** + * @constructor + * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441257.aspx + */ +function MSPointerPoint() {} + +/** @type {number} */ +MSPointerPoint.prototype.pointerId; + +/** @type {number} */ +MSPointerPoint.prototype.pointerType; + +/** + * @constructor + * @extends {Event} + * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441233.aspx + */ +function MSPointerEvent() {} + +/** @type {number} */ +MSPointerEvent.MSPOINTER_TYPE_MOUSE; + +/** @type {number} */ +MSPointerEvent.MSPOINTER_TYPE_PEN; + +/** @type {number} */ +MSPointerEvent.MSPOINTER_TYPE_TOUCH; + +/** @type {number} */ +MSPointerEvent.prototype.height; + +/** @type {number} */ +MSPointerEvent.prototype.hwTimestamp; + +/** @type {boolean} */ +MSPointerEvent.prototype.isPrimary; + +/** @type {number} */ +MSPointerEvent.prototype.pointerId; + +/** @type {number} */ +MSPointerEvent.prototype.pointerType; + +/** @type {number} */ +MSPointerEvent.prototype.pressure; + +/** @type {number} */ +MSPointerEvent.prototype.rotation; + +/** @type {number} */ +MSPointerEvent.prototype.tiltX; + +/** @type {number} */ +MSPointerEvent.prototype.tiltY; + +/** @type {number} */ +MSPointerEvent.prototype.timeStamp; + +/** @type {number} */ +MSPointerEvent.prototype.width; + +/** + * @param {number} pointerId + * @return {undefined} + */ +MSPointerEvent.prototype.msReleasePointerCapture; + +/** + * @param {number} pointerId + * @return {undefined} + */ +MSPointerEvent.prototype.msSetPointerCapture; + +/** + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {Window} viewArg + * @param {number} detailArg + * @param {number} screenXArg + * @param {number} screenYArg + * @param {number} clientXArg + * @param {number} clientYArg + * @param {boolean} ctrlKeyArg + * @param {boolean} altKeyArg + * @param {boolean} shiftKeyArg + * @param {boolean} metaKeyArg + * @param {number} buttonArg + * @param {Element} relatedTargetArg + * @param {number} offsetXArg + * @param {number} offsetYArg + * @param {number} widthArg + * @param {number} heightArg + * @param {number} pressure + * @param {number} rotation + * @param {number} tiltX + * @param {number} tiltY + * @param {number} pointerIdArg + * @param {number} pointerType + * @param {number} hwTimestampArg + * @param {boolean} isPrimary + * @return {undefined} + * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441246.aspx + */ +MSPointerEvent.prototype.initPointerEvent; + +/** + * @constructor + * @see http://msdn.microsoft.com/en-us/library/ie/hh968249(v=vs.85).aspx + */ +function MSGesture() {} + +/** + * @type {Element} + */ +MSGesture.prototype.target; + +/** + * @param {number} pointerId + */ +MSGesture.prototype.addPointer = function(pointerId) {}; + +MSGesture.prototype.stop = function() {}; + +/** + * @constructor + * @extends {Event} + * @see http://msdn.microsoft.com/en-us/library/ie/hh772076(v=vs.85).aspx + */ +function MSGestureEvent() {} + +/** @type {number} */ +MSGestureEvent.prototype.expansion; + +/** @type {!MSGesture} */ +MSGestureEvent.prototype.gestureObject; + +/** @type {number} */ +MSGestureEvent.prototype.hwTimestamp; + +/** @type {number} */ +MSGestureEvent.prototype.rotation; + +/** @type {number} */ +MSGestureEvent.prototype.scale; + +/** @type {number} */ +MSGestureEvent.prototype.translationX; + +/** @type {number} */ +MSGestureEvent.prototype.translationY; + +/** @type {number} */ +MSGestureEvent.prototype.velocityAngular; + +/** @type {number} */ +MSGestureEvent.prototype.velocityExpansion; + +/** @type {number} */ +MSGestureEvent.prototype.velocityX; + +/** @type {number} */ +MSGestureEvent.prototype.velocityY; + +/** + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {Window} viewArg + * @param {number} detailArg + * @param {number} screenXArg + * @param {number} screenYArg + * @param {number} clientXArg + * @param {number} clientYArg + * @param {number} offsetXArg + * @param {number} offsetYArg + * @param {number} translationXArg + * @param {number} translationYArg + * @param {number} scaleArg + * @param {number} expansionArg + * @param {number} rotationArg + * @param {number} velocityXArg + * @param {number} velocityYArg + * @param {number} velocityExpansionArg + * @param {number} velocityAngularArg + * @param {number} hwTimestampArg + * @param {EventTarget} relatedTargetArg + * @return {undefined} + * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441187.aspx + */ +MSGestureEvent.prototype.initGestureEvent; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js new file mode 100644 index 000000000..249ffc73a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js @@ -0,0 +1,77 @@ +/* + * Copyright 2009 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for IE's vector markup language, or VML. + * + * @externs + * @author robbyw@google.com (Robby Walker) + */ + + +/** + * @type {Object|string} + * @see http://msdn.microsoft.com/en-us/library/bb263836(VS.85).aspx + */ +Element.prototype.coordorigin; + +/** + * @type {Object|string} + * @see http://msdn.microsoft.com/en-us/library/bb263837(VS.85).aspx + */ +Element.prototype.coordsize; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/bb263839(VS.85).aspx + */ +Element.prototype.fillcolor; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/bb263840(VS.85).aspx + */ +Element.prototype.filled; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/bb263871(VS.85).aspx + */ +Element.prototype.path; + +/** + * @type {number|string} + * @see http://msdn.microsoft.com/en-us/library/bb263877(VS.85).aspx + */ +Element.prototype.rotation; + +/** + * @type {string} + * @see http://msdn.microsoft.com/en-us/library/bb263881(VS.85).aspx + */ +Element.prototype.strokecolor; + +/** + * @type {boolean} + * @see http://msdn.microsoft.com/en-us/library/bb263882(VS.85).aspx + */ +Element.prototype.stroked; + +/** + * @type {number|string} + * @see http://msdn.microsoft.com/en-us/library/bb263883(VS.85).aspx + */ +Element.prototype.strokeweight; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js new file mode 100644 index 000000000..d1404872a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js @@ -0,0 +1,163 @@ +/* + * Copyright 2013 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for the JS Internationalization API as defined in + * http://www.ecma-international.org/ecma-402/1.0/ + * + * @externs + */ + +/** @const */ +var Intl = {}; + +/** + * NOTE: this API is not from ecma402 and is subject to change. + * @param {string|Array.=} opt_locales + * @param {{type: (string|undefined)}=} + * opt_options + * @constructor + */ +Intl.v8BreakIterator = function(opt_locales, opt_options) {}; + +/** + * @param {string} text + */ +Intl.v8BreakIterator.prototype.adoptText = function(text) {}; + +/** + * @return {string} + */ +Intl.v8BreakIterator.prototype.breakType = function() {}; + +/** + * @return {number} + */ +Intl.v8BreakIterator.prototype.current = function() {}; + +/** + * @return {number} + */ +Intl.v8BreakIterator.prototype.first = function() {}; + +/** + * @return {number} + */ +Intl.v8BreakIterator.prototype.next = function() {}; + +/** + * @constructor + * @param {string|Array.=} opt_locales + * @param {{usage: (string|undefined), localeMatcher: (string|undefined), + * sensitivity: (string|undefined), ignorePunctuation: (boolean|undefined), + * numeric: (boolean|undefined), caseFirst: (string|undefined)}=} + * opt_options + */ +Intl.Collator = function(opt_locales, opt_options) {}; + +/** + * @param {Array.} locales + * @param {{localeMatcher: (string|undefined)}=} opt_options + */ +Intl.Collator.supportedLocalesOf = function(locales, opt_options) {}; + +/** + * @param {string} arg1 + * @param {string} arg2 + * @return {number} + */ +Intl.Collator.prototype.compare = function(arg1, arg2) {}; + +/** + * @return {{locale: string, usage: string, sensitivity: string, + * ignorePunctuation: boolean, collation: string, numeric: boolean, + * caseFirst: string}} + */ +Intl.Collator.prototype.resolvedOptions = function() {}; + +/** + * @constructor + * @param {string|Array.=} opt_locales + * @param {{localeMatcher: (string|undefined), useGrouping: (boolean|undefined), + * numberingSystem: (string|undefined), style: (string|undefined), + * currency: (string|undefined), currencyDisplay: (string|undefined), + * minimumIntegerDigits: (number|undefined), + * minimumFractionDigits: (number|undefined), + * maximumFractionDigits: (number|undefined), + * minimumSignificantDigits: (number|undefined), + * maximumSignificantDigits: (number|undefined)}=} + * opt_options + */ +Intl.NumberFormat = function(opt_locales, opt_options) {}; + +/** + * @param {Array.} locales + * @param {{localeMatcher: (string|undefined)}=} opt_options + */ +Intl.NumberFormat.supportedLocalesOf = function(locales, opt_options) {}; + +/** + * @param {number} num + * @return {string} + */ +Intl.NumberFormat.prototype.format = function(num) {}; + +/** + * @return {{locale: string, numberingSystem: string, style: string, + * currency: (string|undefined), currencyDisplay: (string|undefined), + * minimumIntegerDigits: number, minimumFractionDigits: number, + * maximumFractionDigits: number, minimumSignificantDigits: number, + * maximumSignificantDigits: number, useGrouping: boolean}} + */ +Intl.NumberFormat.prototype.resolvedOptions = function() {}; + +/** + * @constructor + * @param {string|Array.=} opt_locales + * @param {{localeMatcher: (string|undefined), + * formatMatcher: (string|undefined), calendar: (string|undefined), + * numberingSystem: (string|undefined), tz: (string|undefined), + * weekday: (string|undefined), era: (string|undefined), + * year: (string|undefined), month: (string|undefined), + * day: (string|undefined), hour: (string|undefined), + * minute: (string|undefined), second: (string|undefined), + * timeZoneName: (string|undefined), hour12: (boolean|undefined)}=} + * opt_options + */ +Intl.DateTimeFormat = function(opt_locales, opt_options) {}; + +/** + * @param {Array.} locales + * @param {{localeMatcher: string}=} opt_options + */ +Intl.DateTimeFormat.supportedLocalesOf = function(locales, opt_options) {}; + +/** + * @param {number} date + * @return {string} + */ +Intl.DateTimeFormat.prototype.format = function(date) {}; + +/** + * @return {{locale: string, calendar: string, numberingSystem: string, + * timeZone: (string|undefined), weekday: (string|undefined), + * era: (string|undefined), year: (string|undefined), + * month: (string|undefined), day: (string|undefined), + * hour: (string|undefined), minute: (string|undefined), + * second: (string|undefined), timeZoneName: (string|undefined), + * hour12: (boolean|undefined)}} + */ +Intl.DateTimeFormat.prototype.resolvedOptions = function() {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js new file mode 100644 index 000000000..232014149 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js @@ -0,0 +1,362 @@ +/* + * Copyright 2009 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for all iPhone extensions. Created from: + * http://developer.apple.com/library/safari/navigation/ + * + * @externs + * @author agrieve@google.com (Andrew Grieve) + */ + +/** + * The Touch class represents a single touch on the surface. A touch is the + * presence or movement of a finger that is part of a unique multi-touch + * sequence. + * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchClassReference/Touch/Touch.html + * @constructor + */ +function Touch() {} + +/** + * The x-coordinate of the touch's location relative to the window's viewport. + * @type {number} + */ +Touch.prototype.clientX; + +/** + * The y-coordinate of the touch's location relative to the window's viewport. + * @type {number} + */ +Touch.prototype.clientY; + +/** + * The unique identifier for this touch object. + * @type {number} + */ +Touch.prototype.identifier; + +/** + * The x-coordinate of the touch's location in page coordinates. + * @type {number} + */ +Touch.prototype.pageX; + +/** + * The y-coordinate of the touch's location in page coordinates. + * @type {number} + */ +Touch.prototype.pageY; + +/** + * The x-coordinate of the touch's location in screen coordinates. + * @type {number} + */ +Touch.prototype.screenX; + +/** + * The y-coordinate of the touch's location in screen coordinates. + * @type {number} + */ +Touch.prototype.screenY; + +/** + * The target of this touch. + * @type {EventTarget} + */ +Touch.prototype.target; + +/** + * Creates a new Touch object. + * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html#//apple_ref/javascript/instm/Document/createTouch + * @param {Window} view + * @param {EventTarget} target + * @param {number} identifier + * @param {number} pageX + * @param {number} pageY + * @param {number} screenX + * @param {number} screenY + * @return {Touch} + */ +Document.prototype.createTouch = function(view, target, identifier, pageX, + pageY, screenX, screenY) {}; + +/** + * The TouchList class is used to represent a collection of Touch objects. + * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchListClassReference/TouchList/TouchList.html + * @constructor + */ +function TouchList() {} + +/** + * The number of Touch objects in this TouchList object. + * @type {number} + */ +TouchList.prototype.length; + +/** + * Returns the Touch object at the given index. + * @param {number} index + * @return {!Touch} + */ +TouchList.prototype.item = function(index) {}; + +/** + * Creates a new TouchList object. + * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html#//apple_ref/javascript/instm/Document/createTouchList + * @param {Array.} touches + * @return {TouchList} + */ +Document.prototype.createTouchList = function(touches) {}; + +/** + * The TouchEvent class encapsulates information about a touch event. + * + *

The system continually sends TouchEvent objects to an application as + * fingers touch and move across a surface. A touch event provides a snapshot of + * all touches during a multi-touch sequence, most importantly the touches that + * are new or have changed for a particular target. A multi-touch sequence + * begins when a finger first touches the surface. Other fingers may + * subsequently touch the surface, and all fingers may move across the surface. + * The sequence ends when the last of these fingers is lifted from the surface. + * An application receives touch event objects during each phase of any touch. + *

+ * + *

The different types of TouchEvent objects that can occur are: + *

    + *
  • touchstart - Sent when a finger for a given event touches the surface. + *
  • touchmove - Sent when a given event moves on the surface. + *
  • touchend - Sent when a given event lifts from the surface. + *
  • touchcancel - Sent when the system cancels tracking for the touch. + *
+ * TouchEvent objects are combined together to form high-level GestureEvent + * objects that are also sent during a multi-touch sequence.

+ * + * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchEventClassReference/TouchEvent/TouchEvent.html + * @extends {UIEvent} + * @constructor + */ +function TouchEvent() {} + +/** + * A collection of Touch objects representing all touches associated with this + * target. + * @type {TouchList} + */ +TouchEvent.prototype.touches; + +/** + * A collection of Touch objects representing all touches associated with this + * target. + * @type {TouchList} + */ +TouchEvent.prototype.targetTouches; + +/** + * A collection of Touch objects representing all touches that changed in this event. + * @type {TouchList} + */ +TouchEvent.prototype.changedTouches; + +/** + * The distance between two fingers since the start of an event as a multiplier + * of the initial distance. The initial value is 1.0. If less than 1.0, the + * gesture is pinch close (to zoom out). If greater than 1.0, the gesture is + * pinch open (to zoom in). + * @type {number} + */ +TouchEvent.prototype.scale; + +/** + * The delta rotation since the start of an event, in degrees, where clockwise + * is positive and counter-clockwise is negative. The initial value is 0.0. + * @type {number} + */ +TouchEvent.prototype.rotation; + +/** + * Initializes a newly created TouchEvent object. + * @param {string} type + * @param {boolean} canBubble + * @param {boolean} cancelable + * @param {Window} view + * @param {number} detail + * @param {number} screenX + * @param {number} screenY + * @param {number} clientX + * @param {number} clientY + * @param {boolean} ctrlKey + * @param {boolean} altKey + * @param {boolean} shiftKey + * @param {boolean} metaKey + * @param {TouchList} touches + * @param {TouchList} targetTouches + * @param {TouchList} changedTouches + * @param {number} scale + * @param {number} rotation + */ +TouchEvent.prototype.initTouchEvent = function(type, canBubble, cancelable, + view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, + metaKey, touches, targetTouches, changedTouches, scale, rotation) {}; + +/** + * The GestureEvent class encapsulates information about a multi-touch gesture. + * + * GestureEvent objects are high-level events that encapsulate the low-level + * TouchEvent objects. Both GestureEvent and TouchEvent events are sent during + * a multi-touch sequence. Gesture events contain scaling and rotation + * information allowing gestures to be combined, if supported by the platform. + * If not supported, one gesture ends before another starts. Listen for + * GestureEvent events if you want to respond to gestures only, not process + * the low-level TouchEvent objects. + * + * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/GestureEventClassReference/GestureEvent/GestureEvent.html + * @extends {UIEvent} + * @constructor + */ +function GestureEvent() {} + +/** + * The distance between two fingers since the start of an event as a multiplier + * of the initial distance. The initial value is 1.0. If less than 1.0, the + * gesture is pinch close (to zoom out). If greater than 1.0, the gesture is + * pinch open (to zoom in). + * @type {number} + */ +GestureEvent.prototype.scale; + +/** + * The delta rotation since the start of an event, in degrees, where clockwise + * is positive and counter-clockwise is negative. The initial value is 0.0. + * @type {number} + */ +GestureEvent.prototype.rotation; + +/** + * The target of this gesture. + * @type {EventTarget} + */ +GestureEvent.prototype.target; + +/** + * Initializes a newly created GestureEvent object. + * @param {string} type + * @param {boolean} canBubble + * @param {boolean} cancelable + * @param {Window} view + * @param {number} detail + * @param {number} screenX + * @param {number} screenY + * @param {number} clientX + * @param {number} clientY + * @param {boolean} ctrlKey + * @param {boolean} altKey + * @param {boolean} shiftKey + * @param {boolean} metaKey + * @param {EventTarget} target + * @param {number} scale + * @param {number} rotation + */ +GestureEvent.prototype.initGestureEvent = function(type, canBubble, cancelable, + view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, + metaKey, target, scale, rotation) {}; + +/** + * Specifies the JavaScript method to invoke when the system cancels tracking + * for the touch. + * @type {?function(!TouchEvent)} + */ +Element.prototype.ontouchcancel; + +/** + * Specifies the JavaScript method to invoke when a given event lifts from the + * surface. + * @type {?function(!TouchEvent)} + */ +Element.prototype.ontouchend; + +/** + * Specifies the JavaScript method to invoke when a finger for a given event + * moves on the surface. + * @type {?function(!TouchEvent)} + */ +Element.prototype.ontouchmove; + +/** + * Specifies the JavaScript method to invoke when a finger for a given event + * touches the surface. + * @type {?function(!TouchEvent)} + */ +Element.prototype.ontouchstart; + +/** + * Specifies the JavaScript method to invoke when a gesture is started by + * two or more fingers touching the surface. + * @type {?function(!GestureEvent)} + */ +Element.prototype.ongesturestart; + +/** + * Specifies the JavaScript method to invoke when fingers are moved during a + * gesture. + * @type {?function(!GestureEvent)} + */ +Element.prototype.ongesturechange; + +/** + * Specifies the JavaScript method to invoke when a gesture ends (when there are + * 0 or 1 fingers touching the surface). + * @type {?function(!GestureEvent)} + */ +Element.prototype.ongestureend; + +/** + * Specifies the JavaScript method to invoke when the browser device's + * orientation changes, i.e.the device is rotated. + * @type {?function(!Event)} + * @see http://developer.apple.com/library/IOS/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html + */ +Window.prototype.onorientationchange; + +/** + * Returns the orientation of the browser's device, one of [-90, 0, 90, 180]. + * @type {number} + * @see http://developer.apple.com/library/IOS/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html + */ +Window.prototype.orientation; + +/** + * @implicitCast + * @type {boolean} + */ +HTMLInputElement.prototype.autocorrect; + +/** + * @implicitCast + * @type {boolean} + */ +HTMLInputElement.prototype.autocapitalize; + +/** + * @implicitCast + * @type {boolean} + */ +HTMLTextAreaElement.prototype.autocorrect; + +/** + * @implicitCast + * @type {boolean} + */ +HTMLTextAreaElement.prototype.autocapitalize; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js new file mode 100644 index 000000000..f813ede3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js @@ -0,0 +1,142 @@ +/* + * Copyright 2012 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for the Media Source Extensions. Note that the + * properties available here are the union of several versions of the spec. + * @see http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html + * + * @externs + */ + +/** + * @constructor + * @implements {EventTarget} + */ +function MediaSource() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +MediaSource.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +MediaSource.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +MediaSource.prototype.dispatchEvent = function(evt) {}; + +/** @type {Array.} */ +MediaSource.prototype.sourceBuffers; + +/** @type {Array.} */ +MediaSource.prototype.activeSourceBuffers; + +/** @type {number} */ +MediaSource.prototype.duration; + +/** + * @param {string} type + * @return {SourceBuffer} + */ +MediaSource.prototype.addSourceBuffer = function(type) {}; + +/** + * @param {SourceBuffer} sourceBuffer + */ +MediaSource.prototype.removeSourceBuffer = function(sourceBuffer) {}; + +/** @type {string} */ +MediaSource.prototype.readyState; + +/** + * @param {string=} opt_error + */ +MediaSource.prototype.endOfStream = function(opt_error) {}; + +/** + * @param {string} type + * @return {boolean} + */ +MediaSource.isTypeSupported = function(type) {}; + + +/** + * @constructor + * @implements {EventTarget} + */ +function SourceBuffer() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +SourceBuffer.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +SourceBuffer.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +SourceBuffer.prototype.dispatchEvent = function(evt) {}; + +/** @type {string} */ +SourceBuffer.prototype.appendMode; + +/** @type {boolean} */ +SourceBuffer.prototype.updating; + +/** @type {TimeRanges} */ +SourceBuffer.prototype.buffered; + +/** @type {number} */ +SourceBuffer.prototype.timestampOffset; + +/** @type {number} */ +SourceBuffer.prototype.appendWindowStart; + +/** @type {number} */ +SourceBuffer.prototype.appendWindowEnd; + +/** + * @param {Uint8Array} data + */ +SourceBuffer.prototype.append = function(data) {}; + +/** + * @param {ArrayBuffer|ArrayBufferView} data + */ +SourceBuffer.prototype.appendBuffer = function(data) {}; + +/** + * Abort the current segment append sequence. + */ +SourceBuffer.prototype.abort = function() {}; + +/** + * @param {number} start + * @param {number} end + */ +SourceBuffer.prototype.remove = function(start, end) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js new file mode 100644 index 000000000..42bc9a4cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js @@ -0,0 +1,32 @@ +/* + * Copyright 2015 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Externs for Page Visibility. + * + * @see http://www.w3.org/TR/page-visibility + * @externs + */ + +/** + * @enum {string} + * @see http://www.w3.org/TR/page-visibility/#VisibilityState + */ +var VisibilityState = { + HIDDEN: 'hidden', + VISIBLE: 'visible', + PRERENDER: 'prerender', + UNLOADED: 'unloaded' +}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js new file mode 100644 index 000000000..be11bd83a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js @@ -0,0 +1,125 @@ +/* + * Copyright 2013 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview This file describes the externs API for V8-specific objects. + * @externs + */ + + + +/** + * Stack frame elements in V8. + * @constructor + */ +function CallSite() {} + + +/** + * Returns the value of this. + * @return {Object|undefined} + */ +CallSite.prototype.getThis = function() {}; + + +/** + * Returns the type of this as a string. This is the name of the function stored + * in the constructor field of this, if available, otherwise the object's + * [[Class]] internal property. + * @return {string|undefined} + */ +CallSite.prototype.getTypeName = function() {}; + + +/** + * Returns the current function. + * @return {!Function|undefined} + */ +CallSite.prototype.getFunction = function() {}; + + +/** + * Returns the name of the current function, typically its name property. If a + * name property is not available an attempt will be made to try to infer a name + * from the function's context. + * @return {string|undefined} + */ +CallSite.prototype.getFunctionName = function() {}; + + +/** + * Returns the name of the property of this or one of its prototypes that holds + * the current function. + * @return {string|undefined} + */ +CallSite.prototype.getMethodName = function() {}; + + +/** + * If this function was defined in a script returns the name of the script + * @return {string|undefined} + */ +CallSite.prototype.getFileName = function() {}; + + +/** + * If this function was defined in a script returns the current line number. + * @return {number|undefined} + */ +CallSite.prototype.getLineNumber = function() {}; + + +/** + * If this function was defined in a script returns the current column number. + * @return {number|undefined} + */ +CallSite.prototype.getColumnNumber = function() {}; + + +/** + * If this function was created using a call to eval, returns a CallSite object + * representing the location where eval was called + * @return {CallSite|undefined} + */ +CallSite.prototype.getEvalOrigin = function() {}; + + +/** + * Is this a toplevel invocation, that is, is this the global object? + * @return {boolean} + */ +CallSite.prototype.isToplevel = function() {}; + + +/** + * Does this call take place in code defined by a call to eval? + * @return {boolean} + */ +CallSite.prototype.isEval = function() {}; + + +/** + * Is this call in native V8 code? + * @return {boolean} + */ +CallSite.prototype.isNative = function() {}; + + +/** + * Is this a constructor call? + * @return {boolean} + */ +CallSite.prototype.isConstructor = function() {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js new file mode 100644 index 000000000..ea34abef5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js @@ -0,0 +1,191 @@ +/* + * Copyright 2011 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for timing control for script base animations. The + * whole file has been fully type annotated. + * + * @see http://www.w3.org/TR/animation-timing/ + * @see http://webstuff.nfshost.com/anim-timing/Overview.html + * @externs + */ + +/** + * @param {function(number)} callback + * @param {Element=} opt_element In early versions of this API, the callback + * was invoked only if the element was visible. + * @return {number} + */ +function requestAnimationFrame(callback, opt_element) {}; + +/** + * @param {number} handle + */ +function cancelRequestAnimationFrame(handle) {}; + +/** + * @param {function(number)} callback + * @param {Element=} opt_element + * @return {number} + */ +function webkitRequestAnimationFrame(callback, opt_element) {}; + +/** + * @param {number} handle + */ +function webkitCancelRequestAnimationFrame(handle) {}; + +/** + * @param {number} handle + */ +function webkitCancelAnimationFrame(handle) {}; + +/** + * @param {?function(number)} callback It's legitimate to pass a null + * callback and listen on the MozBeforePaint event instead. + * @param {Element=} opt_element + * @return {number} + */ +function mozRequestAnimationFrame(callback, opt_element) {}; + +/** + * @param {number} handle + */ +function mozCancelRequestAnimationFrame(handle) {}; + +/** + * @param {number} handle + */ +function mozCancelAnimationFrame(handle) {}; + +/** + * @param {function(number)} callback + * @param {Element=} opt_element + * @return {number} + */ +function msRequestAnimationFrame(callback, opt_element) {}; + +/** + * @param {number} handle + */ +function msCancelRequestAnimationFrame(handle) {}; + +/** + * @param {number} handle + */ +function msCancelAnimationFrame(handle) {}; + +/** + * @param {function(number)} callback + * @param {Element=} opt_element + * @return {number} + */ +function oRequestAnimationFrame(callback, opt_element) {}; + +/** + * @param {number} handle + */ +function oCancelRequestAnimationFrame(handle) {}; + +/** + * @param {number} handle + */ +function oCancelAnimationFrame(handle) {}; + +/** + * @param {function(number)} callback + * @param {Element=} opt_element + * @return {number} + */ +Window.prototype.requestAnimationFrame = function(callback, opt_element) {}; + +/** + * @param {number} handle + */ +Window.prototype.cancelRequestAnimationFrame = function(handle) {}; + +/** + * @param {number} handle + */ +Window.prototype.cancelAnimationFrame = function(handle) {}; + +/** + * @param {function(number)} callback + * @param {Element=} opt_element + * @return {number} + */ +Window.prototype.webkitRequestAnimationFrame = function(callback, opt_element) {}; + +/** + * @param {number} handle + */ +Window.prototype.webkitCancelRequestAnimationFrame = function(handle) {}; + +/** + * @param {number} handle + */ +Window.prototype.webkitCancelAnimationFrame = function(handle) {}; + +/** + * @param {?function(number)} callback It's legitimate to pass a null + * callback and listen on the MozBeforePaint event instead. + * @param {Element=} opt_element + * @return {number} + */ +Window.prototype.mozRequestAnimationFrame = function(callback, opt_element) {}; + +/** + * @param {number} handle + */ +Window.prototype.mozCancelRequestAnimationFrame = function(handle) {}; + +/** + * @param {number} handle + */ +Window.prototype.mozCancelAnimationFrame = function(handle) {}; + +/** + * @param {function(number)} callback + * @param {Element=} opt_element + * @return {number} + */ +Window.prototype.msRequestAnimationFrame = function(callback, opt_element) {}; + +/** + * @param {number} handle + */ +Window.prototype.msCancelRequestAnimationFrame = function(handle) {}; + +/** + * @param {number} handle + */ +Window.prototype.msCancelAnimationFrame = function(handle) {}; + +/** + * @param {function(number)} callback + * @param {Element=} opt_element + * @return {number} + */ +Window.prototype.oRequestAnimationFrame = function(callback, opt_element) {}; + +/** + * @param {number} handle + */ +Window.prototype.oCancelRequestAnimationFrame = function(handle) {}; + +/** + * @param {number} handle + */ +Window.prototype.oCancelAnimationFrame = function(handle) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js new file mode 100644 index 000000000..e3b4ebae9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js @@ -0,0 +1,2505 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's CSS specification + * The whole file has been fully type annotated. + * http://www.w3.org/TR/DOM-Level-2-Style/css.html + * @externs + * @author stevey@google.com (Steve Yegge) + * + * TODO(nicksantos): When there are no more occurrences of w3c_range.js and + * gecko_dom.js being included directly in BUILD files, bug dbeam to split the + * bottom part of this file into a separate externs. + */ + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet + */ +function StyleSheet() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-type + */ +StyleSheet.prototype.type; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-disabled + */ +StyleSheet.prototype.disabled; + +/** + * @type {Node} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-owner + */ +StyleSheet.prototype.ownerNode; + +/** + * @type {StyleSheet} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-parentStyleSheet + */ +StyleSheet.prototype.parentStyleSheet; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-href + */ +StyleSheet.prototype.href; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-title + */ +StyleSheet.prototype.title; + +/** + * @type {MediaList} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-media + */ +StyleSheet.prototype.media; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList + */ +function StyleSheetList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList-length + */ +StyleSheetList.prototype.length; + +/** + * @param {number} index + * @return {StyleSheet} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList-item + */ +StyleSheetList.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList + */ +function MediaList() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList-mediaText + */ +MediaList.prototype.mediaText; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList-length + */ +MediaList.prototype.length; + +/** + * @param {number} index + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList-item + */ +MediaList.prototype.item = function(index) {}; + +/** + * @interface + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-LinkStyle + */ +function LinkStyle() {} + +/** + * @type {StyleSheet} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-LinkStyle-sheet + */ +LinkStyle.prototype.sheet; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle + */ +function DocumentStyle() {} + +/** + * @type {StyleSheetList} + * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle-styleSheets + */ +DocumentStyle.prototype.styleSheets; + +/** + * @constructor + * @extends {StyleSheet} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet + */ +function CSSStyleSheet() {} + +/** + * @type {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-ownerRule + */ +CSSStyleSheet.prototype.ownerRule; + +/** + * @type {CSSRuleList} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-cssRules + */ +CSSStyleSheet.prototype.cssRules; + +/** + * @param {string} rule + * @param {number} index + * @return {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-insertRule + */ +CSSStyleSheet.prototype.insertRule = function(rule, index) {}; + +/** + * @param {number} index + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-deleteRule + */ +CSSStyleSheet.prototype.deleteRule = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList + */ +function CSSRuleList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList-length + */ +CSSRuleList.prototype.length; + +/** + * @param {number} index + * @return {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList-item + */ +CSSRuleList.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule + */ +function CSSRule() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.prototype.type; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-cssText + */ +CSSRule.prototype.cssText; + +/** + * @type {CSSStyleSheet} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-sheet + */ +CSSRule.prototype.parentStyleSheet; + +/** + * @type {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-parentRule + */ +CSSRule.prototype.parentRule; + +/** + * @type {CSSStyleDeclaration} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule + */ +CSSRule.prototype.style; + +/** + * Indicates that the rule is a {@see CSSUnknownRule}. + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.UNKNOWN_RULE = 0; + +/** + * Indicates that the rule is a {@see CSSStyleRule}. + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.STYLE_RULE = 1; + +/** + * Indicates that the rule is a {@see CSSCharsetRule}. + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.CHARSET_RULE = 2; + +/** + * Indicates that the rule is a {@see CSSImportRule}. + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.IMPORT_RULE = 3; + +/** + * Indicates that the rule is a {@see CSSMediaRule}. + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.MEDIA_RULE = 4; + +/** + * Indicates that the rule is a {@see CSSFontFaceRule}. + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.FONT_FACE_RULE = 5; + +/** + * Indicates that the rule is a {@see CSSPageRule}. + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType + */ +CSSRule.PAGE_RULE = 6; + +/** + * @constructor + * @extends {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule + */ +function CSSStyleRule() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule-selectorText + */ +CSSStyleRule.prototype.selectorText; + +/** + * @type {CSSStyleDeclaration} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule-style + */ +CSSStyleRule.prototype.style; + +/** + * @constructor + * @extends {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule + */ +function CSSMediaRule() {} + +/** + * @type {MediaList} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-mediaTypes + */ +CSSMediaRule.prototype.media; + +/** + * @type {CSSRuleList} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-cssRules + */ +CSSMediaRule.prototype.cssRules; + +/** + * @param {string} rule + * @param {number} index + * @return {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-insertRule + */ +CSSMediaRule.prototype.insertRule = function(rule, index) {}; + +/** + * @param {number} index + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-deleteRule + */ +CSSMediaRule.prototype.deleteRule = function(index) {}; + +/** + * @constructor + * @extends {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSFontFaceRule + */ +function CSSFontFaceRule() {} + +/** + * @type {CSSStyleDeclaration} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSFontFaceRule-style + */ +CSSFontFaceRule.prototype.style; + +/** + * @constructor + * @extends {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPageRule + */ +function CSSPageRule() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPageRule-name + */ +CSSPageRule.prototype.selectorText; + +/** + * @type {CSSStyleDeclaration} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPageRule-style + */ +CSSPageRule.prototype.style; + +/** + * @constructor + * @extends {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule + */ +function CSSImportRule() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule-href + */ +CSSImportRule.prototype.href; + +/** + * @type {MediaList} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule-media + */ +CSSImportRule.prototype.media; + +/** + * @type {CSSStyleSheet} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule-styleSheet + */ +CSSImportRule.prototype.styleSheet; + +/** + * @constructor + * @extends {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSCharsetRule + */ +function CSSCharsetRule() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSCharsetRule-encoding + */ +CSSCharsetRule.prototype.encoding; + +/** + * @constructor + * @extends {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSUnknownRule + */ +function CSSUnknownRule() {} + +/** + * @constructor + * @extends {CSSProperties} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration + */ +function CSSStyleDeclaration() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-cssText + */ +CSSStyleDeclaration.prototype.cssText; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-length + */ +CSSStyleDeclaration.prototype.length; + +/** + * @type {CSSRule} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-parentRule + */ +CSSStyleDeclaration.prototype.parentRule; + +/** + * @param {string} propertyName + * @return {CSSValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyCSSValue + */ +CSSStyleDeclaration.prototype.getPropertyCSSValue = function(propertyName) {}; + +/** + * @param {string} propertyName + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyPriority + */ +CSSStyleDeclaration.prototype.getPropertyPriority = function(propertyName) {}; + +/** + * @param {string} propertyName + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue + */ +CSSStyleDeclaration.prototype.getPropertyValue = function(propertyName) {}; + +/** + * @param {number} index + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-item + */ +CSSStyleDeclaration.prototype.item = function(index) {}; + +/** + * @param {string} propertyName + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty + */ +CSSStyleDeclaration.prototype.removeProperty = function(propertyName) {}; + +/** + * @param {string} propertyName + * @param {string} value + * @param {string=} opt_priority + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty + */ +CSSStyleDeclaration.prototype.setProperty = function(propertyName, value, opt_priority) {}; + +// IE-specific + +/** + * @param {string} name + * @param {number=} opt_flags + * @return {string|number|boolean|null} + * @see http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx + */ +CSSStyleDeclaration.prototype.getAttribute = function(name, opt_flags) {}; + +/** + * @param {string} name + * @return {string|number|boolean|null} + * @see http://msdn.microsoft.com/en-us/library/aa358797(VS.85).aspx + */ +CSSStyleDeclaration.prototype.getExpression = function(name) {}; + +/** + * @param {string} name + * @param {number=} opt_flags + * @return {boolean} + * @see http://msdn.microsoft.com/en-us/library/ms536696(VS.85).aspx + */ +CSSStyleDeclaration.prototype.removeAttribute = + function(name, opt_flags) {}; + +/** + * @param {string} name + * @return {boolean} + * @see http://msdn.microsoft.com/en-us/library/aa358798(VS.85).aspx + */ +CSSStyleDeclaration.prototype.removeExpression = function(name) {}; + +/** + * @param {string} name + * @param {*} value + * @param {number=} opt_flags + * @see http://msdn.microsoft.com/en-us/library/ms536739(VS.85).aspx + */ +CSSStyleDeclaration.prototype.setAttribute = function(name, value, opt_flags) {}; + +/** + * @param {string} name + * @param {string} expr + * @param {string=} opt_language + * @return {undefined} + * @see http://msdn.microsoft.com/en-us/library/ms531196(VS.85).aspx + */ +CSSStyleDeclaration.prototype.setExpression = + function(name, expr, opt_language) {}; + + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue + */ +function CSSValue() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-cssText + */ +CSSValue.prototype.cssText; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-cssValueType + */ +CSSValue.prototype.cssValueType; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types + */ +CSSValue.CSS_INHERIT = 0; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types + */ +CSSValue.CSS_PRIMITIVE_VALUE = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types + */ +CSSValue.CSS_VALUE_LIST = 2; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types + */ +CSSValue.CSS_CUSTOM = 3; + +/** + * @constructor + * @extends {CSSValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +function CSSPrimitiveValue() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.prototype.primitiveType; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_UNKNOWN = 0; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_NUMBER = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_PERCENTAGE = 2; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_EMS = 3; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_EXS = 4; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_PX = 5; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_CM = 6; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_MM = 7; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_IN = 8; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_PT = 9; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_PC = 10; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_DEG = 11; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_RAD = 12; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_GRAD = 13; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_MS = 14; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_S = 15; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_HZ = 16; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_KHZ = 17; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_DIMENSION = 18; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_STRING = 19; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_URI = 20; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_IDENT = 21; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_ATTR = 22; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_COUNTER = 23; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_RECT = 24; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue + */ +CSSPrimitiveValue.CSS_RGBCOLOR = 25; + +/** + * @return {Counter} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getCounterValue + * @throws DOMException {@see DomException.INVALID_ACCESS_ERR} + */ +CSSPrimitiveValue.prototype.getCounterValue = function() {}; + +/** + * @param {number} unitType + * @return {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getFloatValue + * @throws DOMException {@see DomException.INVALID_ACCESS_ERR} + */ +CSSPrimitiveValue.prototype.getFloatValue = function(unitType) {}; + +/** + * @return {RGBColor} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getRGBColorValue + * @throws DOMException {@see DomException.INVALID_ACCESS_ERR} + */ +CSSPrimitiveValue.prototype.getRGBColorValue = function() {}; + +/** + * @return {Rect} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getRectValue + * @throws DOMException {@see DomException.INVALID_ACCESS_ERR} + */ +CSSPrimitiveValue.prototype.getRectValue = function() {}; + +/** + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getStringValue + * @throws DOMException {@see DomException.INVALID_ACCESS_ERR} + */ +CSSPrimitiveValue.prototype.getStringValue = function() {}; + +/** + * @param {number} unitType + * @param {number} floatValue + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-setFloatValue + * @throws DOMException {@see DomException.INVALID_ACCESS_ERR}, + * {@see DomException.NO_MODIFICATION_ALLOWED_ERR} + */ +CSSPrimitiveValue.prototype.setFloatValue = function(unitType, floatValue) {}; + +/** + * @param {number} stringType + * @param {string} stringValue + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-setStringValue + * @throws DOMException {@see DomException.INVALID_ACCESS_ERR}, + * {@see DomException.NO_MODIFICATION_ALLOWED_ERR} + */ +CSSPrimitiveValue.prototype.setStringValue = function(stringType, stringValue) {}; + +/** + * @constructor + * @extends {CSSValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValueList + */ +function CSSValueList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValueList-length + */ +CSSValueList.prototype.length; + +/** + * @param {number} index + * @return {CSSValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValueList-item + */ +CSSValueList.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor + */ +function RGBColor() {} + +/** + * @type {CSSPrimitiveValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor-red + */ +RGBColor.prototype.red; + +/** + * @type {CSSPrimitiveValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor-green + */ +RGBColor.prototype.green; + +/** + * @type {CSSPrimitiveValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor-blue + */ +RGBColor.prototype.blue; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect + */ +function Rect() {} + +/** + * @type {CSSPrimitiveValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-top + */ +Rect.prototype.top; + +/** + * @type {CSSPrimitiveValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-right + */ +Rect.prototype.right; + +/** + * @type {CSSPrimitiveValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-bottom + */ +Rect.prototype.bottom; + +/** + * @type {CSSPrimitiveValue} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-left + */ +Rect.prototype.left; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter + */ +function Counter() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter-identifier + */ +Counter.prototype.identifier; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter-listStyle + */ +Counter.prototype.listStyle; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter-separator + */ +Counter.prototype.separator; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ViewCSS + */ +function ViewCSS() {} + +/** + * @param {Element} elt + * @param {?string=} opt_pseudoElt This argument is required according to the + * CSS2 specification, but optional in all major browsers. See the note at + * https://developer.mozilla.org/en-US/docs/Web/API/Window.getComputedStyle + * @return {CSSStyleDeclaration} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSview-getComputedStyle + */ +ViewCSS.prototype.getComputedStyle = function(elt, opt_pseudoElt) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DocumentCSS + */ +function DocumentCSS() {} + +/** + * @param {Element} elt + * @param {string} pseudoElt + * @return {CSSStyleDeclaration} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DocumentCSS-getOverrideStyle + */ +DocumentCSS.prototype.getOverrideStyle = function(elt, pseudoElt) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DOMImplementationCSS + */ +function DOMImplementationCSS() {} + +/** + * @param {string} title + * @param {string} media + * @return {CSSStyleSheet} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DOMImplementationCSS-createCSSStyleSheet + * @throws DOMException {@see DomException.SYNTAX_ERR} + */ +DOMImplementationCSS.prototype.createCSSStyleSheet = function(title, media) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ElementCSSInlineStyle + */ +function ElementCSSInlineStyle() {} + +/** + * @type {CSSStyleDeclaration} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ElementCSSInlineStyle-style + */ +ElementCSSInlineStyle.prototype.style; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties + */ +function CSSProperties() {} + +// CSS 2 properties + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-azimuth + */ +CSSProperties.prototype.azimuth; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-background + */ +CSSProperties.prototype.background; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundAttachment + */ +CSSProperties.prototype.backgroundAttachment; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundColor + */ +CSSProperties.prototype.backgroundColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundImage + */ +CSSProperties.prototype.backgroundImage; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundPosition + */ +CSSProperties.prototype.backgroundPosition; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundRepeat + */ +CSSProperties.prototype.backgroundRepeat; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-background/#the-background-size + */ +CSSProperties.prototype.backgroundSize; + +/** + * @implicitCast + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-border + */ +CSSProperties.prototype.border; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderCollapse + */ +CSSProperties.prototype.borderCollapse; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderColor + */ +CSSProperties.prototype.borderColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderSpacing + */ +CSSProperties.prototype.borderSpacing; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-borderStyle + */ +CSSProperties.prototype.borderStyle; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTop + */ +CSSProperties.prototype.borderTop; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRight + */ +CSSProperties.prototype.borderRight; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottom + */ +CSSProperties.prototype.borderBottom; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeft + */ +CSSProperties.prototype.borderLeft; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTopColor + */ +CSSProperties.prototype.borderTopColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRightColor + */ +CSSProperties.prototype.borderRightColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottomColor + */ +CSSProperties.prototype.borderBottomColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeftColor + */ +CSSProperties.prototype.borderLeftColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTopStyle + */ +CSSProperties.prototype.borderTopStyle; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRightStyle + */ +CSSProperties.prototype.borderRightStyle; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottomStyle + */ +CSSProperties.prototype.borderBottomStyle; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeftStyle + */ +CSSProperties.prototype.borderLeftStyle; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTopWidth + */ +CSSProperties.prototype.borderTopWidth; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRightWidth + */ +CSSProperties.prototype.borderRightWidth; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottomWidth + */ +CSSProperties.prototype.borderBottomWidth; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeftWidth + */ +CSSProperties.prototype.borderLeftWidth; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderWidth + */ +CSSProperties.prototype.borderWidth; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-background/#the-border-radius + */ +CSSProperties.prototype.borderRadius; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-background/#the-border-radius + */ +CSSProperties.prototype.borderBottomLeftRadius; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-background/#the-border-radius + */ +CSSProperties.prototype.borderBottomRightRadius; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-background/#the-border-radius + */ +CSSProperties.prototype.borderTopLeftRadius; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-background/#the-border-radius + */ +CSSProperties.prototype.borderTopRightRadius; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-bottom + */ +CSSProperties.prototype.bottom; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-captionSide + */ +CSSProperties.prototype.captionSide; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-clear + */ +CSSProperties.prototype.clear; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-clip + */ +CSSProperties.prototype.clip; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-color + */ +CSSProperties.prototype.color; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-content + */ +CSSProperties.prototype.content; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-counterIncrement + */ +CSSProperties.prototype.counterIncrement; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-counterReset + */ +CSSProperties.prototype.counterReset; + +/** + * This is not an official part of the W3C spec. In practice, this is a settable + * property that works cross-browser. It is used in goog.dom.setProperties() and + * needs to be extern'd so the --disambiguate_properties JS compiler pass works. + * @type {string} + */ +CSSProperties.prototype.cssText; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cue + */ +CSSProperties.prototype.cue; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cueAfter + */ +CSSProperties.prototype.cueAfter; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cueBefore + */ +CSSProperties.prototype.cueBefore; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cursor + */ +CSSProperties.prototype.cursor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-direction + */ +CSSProperties.prototype.direction; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-display + */ +CSSProperties.prototype.display; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-elevation + */ +CSSProperties.prototype.elevation; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-emptyCells + */ +CSSProperties.prototype.emptyCells; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cssFloat + */ +CSSProperties.prototype.cssFloat; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-font + */ +CSSProperties.prototype.font; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontFamily + */ +CSSProperties.prototype.fontFamily; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontSize + */ +CSSProperties.prototype.fontSize; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontSizeAdjust + */ +CSSProperties.prototype.fontSizeAdjust; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontStretch + */ +CSSProperties.prototype.fontStretch; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontStyle + */ +CSSProperties.prototype.fontStyle; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontVariant + */ +CSSProperties.prototype.fontVariant; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontWeight + */ +CSSProperties.prototype.fontWeight; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-height + */ +CSSProperties.prototype.height; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-left + */ +CSSProperties.prototype.left; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-letterSpacing + */ +CSSProperties.prototype.letterSpacing; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-lineHeight + */ +CSSProperties.prototype.lineHeight; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStyle + */ +CSSProperties.prototype.listStyle; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStyleImage + */ +CSSProperties.prototype.listStyleImage; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStylePosition + */ +CSSProperties.prototype.listStylePosition; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStyleType + */ +CSSProperties.prototype.listStyleType; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-margin + */ +CSSProperties.prototype.margin; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginTop + */ +CSSProperties.prototype.marginTop; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginRight + */ +CSSProperties.prototype.marginRight; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginBottom + */ +CSSProperties.prototype.marginBottom; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginLeft + */ +CSSProperties.prototype.marginLeft; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-markerOffset + */ +CSSProperties.prototype.markerOffset; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marks + */ +CSSProperties.prototype.marks; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-maxHeight + */ +CSSProperties.prototype.maxHeight; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-maxWidth + */ +CSSProperties.prototype.maxWidth; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-minHeight + */ +CSSProperties.prototype.minHeight; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-minWidth + */ +CSSProperties.prototype.minWidth; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-orphans + */ +CSSProperties.prototype.orphans; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outline + */ +CSSProperties.prototype.outline; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outlineColor + */ +CSSProperties.prototype.outlineColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outlineStyle + */ +CSSProperties.prototype.outlineStyle; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outlineWidth + */ +CSSProperties.prototype.outlineWidth; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-overflow + */ +CSSProperties.prototype.overflow; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-padding + */ +CSSProperties.prototype.padding; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingTop + */ +CSSProperties.prototype.paddingTop; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingRight + */ +CSSProperties.prototype.paddingRight; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingBottom + */ +CSSProperties.prototype.paddingBottom; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingLeft + */ +CSSProperties.prototype.paddingLeft; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-page + */ +CSSProperties.prototype.page; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pageBreakAfter + */ +CSSProperties.prototype.pageBreakAfter; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pageBreakBefore + */ +CSSProperties.prototype.pageBreakBefore; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pageBreakInside + */ +CSSProperties.prototype.pageBreakInside; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pause + */ +CSSProperties.prototype.pause; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pauseAfter + */ +CSSProperties.prototype.pauseAfter; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pauseBefore + */ +CSSProperties.prototype.pauseBefore; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pitch + */ +CSSProperties.prototype.pitch; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pitchRange + */ +CSSProperties.prototype.pitchRange; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-playDuring + */ +CSSProperties.prototype.playDuring; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-position + */ +CSSProperties.prototype.position; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-quotes + */ +CSSProperties.prototype.quotes; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-ui/#resize + */ +CSSProperties.prototype.resize; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-richness + */ +CSSProperties.prototype.richness; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-right + */ +CSSProperties.prototype.right; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-size + */ +CSSProperties.prototype.size; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speak + */ +CSSProperties.prototype.speak; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speakHeader + */ +CSSProperties.prototype.speakHeader; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speakNumeral + */ +CSSProperties.prototype.speakNumeral; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speakPunctuation + */ +CSSProperties.prototype.speakPunctuation; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speechRate + */ +CSSProperties.prototype.speechRate; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-stress + */ +CSSProperties.prototype.stress; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-tableLayout + */ +CSSProperties.prototype.tableLayout; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textAlign + */ +CSSProperties.prototype.textAlign; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textDecoration + */ +CSSProperties.prototype.textDecoration; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textIndent + */ +CSSProperties.prototype.textIndent; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textShadow + */ +CSSProperties.prototype.textShadow; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textTransform + */ +CSSProperties.prototype.textTransform; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-top + */ +CSSProperties.prototype.top; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-unicodeBidi + */ +CSSProperties.prototype.unicodeBidi; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-verticalAlign + */ +CSSProperties.prototype.verticalAlign; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-visibility + */ +CSSProperties.prototype.visibility; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-voiceFamily + */ +CSSProperties.prototype.voiceFamily; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-volume + */ +CSSProperties.prototype.volume; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-whiteSpace + */ +CSSProperties.prototype.whiteSpace; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-widows + */ +CSSProperties.prototype.widows; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-width + */ +CSSProperties.prototype.width; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-wordSpacing + */ +CSSProperties.prototype.wordSpacing; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-wordWrap + */ +CSSProperties.prototype.wordWrap; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-zIndex + */ +CSSProperties.prototype.zIndex; + +// CSS 3 properties + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-background/#box-shadow + */ +CSSProperties.prototype.boxShadow; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-ui/#box-sizing + */ +CSSProperties.prototype.boxSizing; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-color/#transparency + */ +CSSProperties.prototype.opacity; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-ui/#text-overflow + */ +CSSProperties.prototype.textOverflow; + +// CSS 3 transforms + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-2d-transforms/#backface-visibility-property + */ +CSSProperties.prototype.backfaceVisibility; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-2d-transforms/#perspective + */ +CSSProperties.prototype.perspective; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-2d-transforms/#perspective-origin + */ +CSSProperties.prototype.perspectiveOrigin; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-2d-transforms/#effects + */ +CSSProperties.prototype.transform; + +/** + * @type {string|number} + * @see http://www.w3.org/TR/css3-2d-transforms/#transform-origin + */ +CSSProperties.prototype.transformOrigin; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-2d-transforms/#transform-style + */ +CSSProperties.prototype.transformStyle; + +// CSS 3 transitions + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-transitions/#transition + */ +CSSProperties.prototype.transition; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-transitions/#transition-delay + */ +CSSProperties.prototype.transitionDelay; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-transitions/#transition-duration + */ +CSSProperties.prototype.transitionDuration; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-transitions/#transition-property-property + */ +CSSProperties.prototype.transitionProperty; + +/** + * @type {string} + * @see http://www.w3.org/TR/css3-transitions/#transition-timing-function + */ +CSSProperties.prototype.transitionTimingFunction; + +/** + * @type {string} + * @see http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty + */ +CSSProperties.prototype.pointerEvents; + +/** + * TODO(dbeam): Put this in separate file named w3c_cssom.js. + * Externs for the CSSOM View Module. + * @see http://www.w3.org/TR/cssom-view/ + */ + +// http://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface + +/** + * @param {string} media_query_list + * @return {MediaQueryList} + * @see http://www.w3.org/TR/cssom-view/#dom-window-matchmedia + */ +Window.prototype.matchMedia = function(media_query_list) {}; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-innerwidth + */ +Window.prototype.innerWidth; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-innerheight + */ +Window.prototype.innerHeight; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-scrollx + */ +Window.prototype.scrollX; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-pagexoffset + */ +Window.prototype.pageXOffset; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-scrolly + */ +Window.prototype.scrollY; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-pageyoffset + */ +Window.prototype.pageYOffset; + +/** + * @param {number} x + * @param {number} y + * @see http://www.w3.org/TR/cssom-view/#dom-window-scroll + */ +Window.prototype.scroll = function(x, y) {}; + +/** + * @param {number} x + * @param {number} y + * @see http://www.w3.org/TR/cssom-view/#dom-window-scrollto + */ +Window.prototype.scrollTo = function(x, y) {}; + +/** + * @param {number} x + * @param {number} y + * @see http://www.w3.org/TR/cssom-view/#dom-window-scrollby + */ +Window.prototype.scrollBy = function(x, y) {}; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-screenx + */ +Window.prototype.screenX; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-screeny + */ +Window.prototype.screenY; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-outerwidth + */ +Window.prototype.outerWidth; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-window-outerheight + */ +Window.prototype.outerHeight; + +/** + * @constructor + * @see http://www.w3.org/TR/cssom-view/#mediaquerylist + */ +function MediaQueryList() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-media + */ +MediaQueryList.prototype.media; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-matches + */ +MediaQueryList.prototype.matches; + +/** + * @param {MediaQueryListListener} listener + * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-addlistener + */ +MediaQueryList.prototype.addListener = function(listener) {}; + +/** + * @param {MediaQueryListListener} listener + * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-removelistener + */ +MediaQueryList.prototype.removeListener = function(listener) {}; + +/** + * @typedef {(function(!MediaQueryList) : void)} + * @see http://www.w3.org/TR/cssom-view/#mediaquerylistlistener + */ +var MediaQueryListListener; + +/** + * @constructor + * @see http://www.w3.org/TR/cssom-view/#screen + */ +function Screen() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-screen-availwidth + */ +Screen.prototype.availWidth; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-screen-availheight + */ +Screen.prototype.availHeight; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-screen-width + */ +Screen.prototype.width; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-screen-height + */ +Screen.prototype.height; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-screen-colordepth + */ +Screen.prototype.colorDepth; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-screen-pixeldepth + */ +Screen.prototype.pixelDepth; + + +// http://www.w3.org/TR/cssom-view/#extensions-to-the-document-interface + +/** + * @param {number} x + * @param {number} y + * @return {?Element} + * @see http://www.w3.org/TR/cssom-view/#dom-document-elementfrompoint + */ +Document.prototype.elementFromPoint = function(x, y) {}; + +/** + * @param {number} x + * @param {number} y + * @return {CaretPosition} + * @see http://www.w3.org/TR/cssom-view/#dom-document-caretpositionfrompoint + */ +Document.prototype.caretPositionFromPoint = function(x, y) {}; + + +/** + * @constructor + * @see http://www.w3.org/TR/cssom-view/#caretposition + */ +function CaretPosition() {} + +/** + * @type {Node} + * @see http://www.w3.org/TR/cssom-view/#dom-caretposition-offsetnode + */ +CaretPosition.prototype.offsetNode; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-caretposition-offset + */ +CaretPosition.prototype.offset; + + +// http://www.w3.org/TR/cssom-view/#extensions-to-the-element-interface + +/** + * @return {!ClientRectList} + * @see http://www.w3.org/TR/cssom-view/#dom-element-getclientrects + */ +Element.prototype.getClientRects = function() {}; + +/** + * @return {!ClientRect} + * @see http://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect + */ +Element.prototype.getBoundingClientRect = function() {}; + +/** + * @param {boolean=} opt_top + * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollintoview + */ +Element.prototype.scrollIntoView = function(opt_top) {}; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-scrolltop + */ +Element.prototype.scrollTop; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollleft + */ +Element.prototype.scrollLeft; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollwidth + */ +Element.prototype.scrollWidth; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollheight + */ +Element.prototype.scrollHeight; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-clienttop + */ +Element.prototype.clientTop; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-clientleft + */ +Element.prototype.clientLeft; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-clientwidth + */ +Element.prototype.clientWidth; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-element-clientheight + */ +Element.prototype.clientHeight; + +// http://www.w3.org/TR/cssom-view/#extensions-to-the-htmlelement-interface + +/** + * @type {Element} + * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent + */ +HTMLElement.prototype.offsetParent; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsettop + */ +HTMLElement.prototype.offsetTop; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetleft + */ +HTMLElement.prototype.offsetLeft; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetwidth + */ +HTMLElement.prototype.offsetWidth; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetheight + */ +HTMLElement.prototype.offsetHeight; + + +// http://www.w3.org/TR/cssom-view/#extensions-to-the-range-interface + +/** + * @return {!ClientRectList} + * @see http://www.w3.org/TR/cssom-view/#dom-range-getclientrects + */ +Range.prototype.getClientRects = function() {}; + +/** + * @return {!ClientRect} + * @see http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect + */ +Range.prototype.getBoundingClientRect = function() {}; + + +// http://www.w3.org/TR/cssom-view/#extensions-to-the-mouseevent-interface + +// MouseEvent: screen{X,Y} and client{X,Y} are in DOM Level 2/3 Event as well, +// so it seems like a specification issue. I've emailed www-style@w3.org in +// hopes of resolving the conflict, but in the mean time they can live here +// (http://lists.w3.org/Archives/Public/www-style/2012May/0039.html). + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-screenx + */ +//MouseEvent.prototype.screenX; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-screeny + */ +//MouseEvent.prototype.screenY; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-pagex + */ +MouseEvent.prototype.pageX; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-pagey + */ +MouseEvent.prototype.pageY; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-clientx + */ +//MouseEvent.prototype.clientX; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-clienty + */ +//MouseEvent.prototype.clientY; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-x + */ +MouseEvent.prototype.x; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-y + */ +MouseEvent.prototype.y; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-offsetx + */ +MouseEvent.prototype.offsetX; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-offsety + */ +MouseEvent.prototype.offsetY; + + +// http://www.w3.org/TR/cssom-view/#rectangles + +/** + * @constructor + * @see http://www.w3.org/TR/cssom-view/#the-clientrectlist-interface + */ +function ClientRectList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrectlist-length + */ +ClientRectList.prototype.length; + +/** + * @param {number} index + * @return {ClientRect} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrectlist-item + */ +ClientRectList.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/cssom-view/#the-clientrect-interface + */ +function ClientRect() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-top + */ +ClientRect.prototype.top; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-right + */ +ClientRect.prototype.right; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-bottom + */ +ClientRect.prototype.bottom; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-left + */ +ClientRect.prototype.left; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-width + */ +ClientRect.prototype.width; + +/** + * @type {number} + * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-height + */ +ClientRect.prototype.height; + +/** + * @constructor + * http://www.w3.org/TR/css3-conditional/#CSS-interface + */ +function CSSInterface() {} + +/** + * @param {string} property + * @param {string=} opt_value + * @return {boolean} + */ +CSSInterface.prototype.supports = function(property, opt_value) {}; + +/** + * TODO(nicksantos): This suppress tag probably isn't needed, and + * should be removed. + * @suppress {duplicate} + * @type {CSSInterface} + */ +var CSS; + +/** @type {CSSInterface} */ +Window.prototype.CSS; + +// http://dev.w3.org/csswg/css-font-loading/ + +/** + * @enum {string} + * @see http://dev.w3.org/csswg/css-font-loading/#enumdef-fontfaceloadstatus + */ +var FontFaceLoadStatus = { + ERROR: 'error', + LOADED: 'loaded', + LOADING: 'loading', + UNLOADED: 'unloaded' +}; + +/** + * @typedef {{ + * style: (string|undefined), + * weight: (string|undefined), + * stretch: (string|undefined), + * unicodeRange: (string|undefined), + * variant: (string|undefined), + * featureSettings: (string|undefined) + * }} + * @see http://dev.w3.org/csswg/css-font-loading/#dictdef-fontfacedescriptors + */ +var FontFaceDescriptors; + +/** + * @constructor + * @param {string} fontFamily + * @param {string} source + * @param {!FontFaceDescriptors} descriptors + * @see http://dev.w3.org/csswg/css-font-loading/#font-face-constructor + */ +function FontFace(fontFamily, source, descriptors) {} + +/** + * @type {string} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-family + */ +FontFace.prototype.family; + +/** + * @type {string} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-style + */ +FontFace.prototype.style; + +/** + * @type {string} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-weight + */ +FontFace.prototype.weight; + +/** + * @type {string} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-stretch + */ +FontFace.prototype.stretch; + +/** + * @type {string} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-unicoderange + */ +FontFace.prototype.unicodeRange; + +/** + * @type {string} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-variant + */ +FontFace.prototype.variant; + +/** + * @type {string} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-featuresettings + */ +FontFace.prototype.featureSettings; + +/** + * @type {FontFaceLoadStatus} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-status + */ +FontFace.prototype.status; + +/** + * @return {!Promise.} + * @see http://dev.w3.org/csswg/css-font-loading/#font-face-load + */ +FontFace.prototype.load = function() {}; + +/** + * @enum + * @see http://dev.w3.org/csswg/css-font-loading/#enumdef-fontfacesetloadstatus + */ +var FontFaceSetLoadStatus = { + LOADED: 'loaded', + LOADING: 'loading' +}; + +/** + * @interface + * @see http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface + */ +function FontFaceSet() {} + +// Event handlers +// http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-events + +/** @type {?function (Event)} */ FontFaceSet.prototype.onloading; +/** @type {?function (Event)} */ FontFaceSet.prototype.onloadingdone; +/** @type {?function (Event)} */ FontFaceSet.prototype.onloadingerror; + +/** + * @param {!FontFace} value + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-add + */ +FontFaceSet.prototype.add = function(value) {}; + +/** + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-clear + */ +FontFaceSet.prototype.clear = function() {}; + +/** + * @param {!FontFace} value + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-delete + */ +FontFaceSet.prototype.delete = function(value) {}; + +/** + * @param {!FontFace} font + * @return {boolean} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-has + */ +FontFaceSet.prototype.has = function(font) {}; + +/** + * @param {function(!FontFace, number, !FontFaceSet)} cb + * @param {Object|undefined=} opt_selfObj + * see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-foreach + */ +FontFaceSet.prototype.forEach = function(cb, opt_selfObj) {}; + +/** + * @param {string} font + * @param {string=} opt_text + * @return {!Promise.>} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-load + */ +FontFaceSet.prototype.load = function(font, opt_text) {}; + +/** + * @param {string} font + * @param {string=} opt_text + * @return {boolean} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-check + */ +FontFaceSet.prototype.check = function(font, opt_text) {}; + +/** + * @type {!Promise.} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-ready + */ +FontFaceSet.prototype.ready; + +/** + * @type {FontFaceSetLoadStatus} + * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-status + */ +FontFaceSet.prototype.status; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js new file mode 100644 index 000000000..1c3d64c93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js @@ -0,0 +1,199 @@ +/* + * Copyright 2010 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's CSS 3D Transforms specification. + * The whole file has been fully type annotated. Created from + * https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html + * + * @externs + */ + +/** + * @constructor + * @param {string=} opt_matrix + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#the-cssmatrix-interface + */ +function CSSMatrix(opt_matrix) {} + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m11; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m12; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m13; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m14; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m21; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m22; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m23; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m24; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m31; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m32; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m33; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m34; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m41; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m42; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m43; + +/** + * @type {number} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes + */ +CSSMatrix.prototype.m44; + +/** + * @param {string} string + * @return {void} + */ +CSSMatrix.prototype.setMatrixValue = function(string) {}; + +/** + * @param {!CSSMatrix} secondMatrix + * @return {!CSSMatrix} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-multiply-CSSMatrix-CSSMatrix-other + */ +CSSMatrix.prototype.multiply = function(secondMatrix) {}; + +/** + * @return {CSSMatrix} Returns void if the matrix is non-invertable. + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-inverse-CSSMatrix + */ +CSSMatrix.prototype.inverse = function() {}; + +/** + * @param {number=} opt_x Defaults to 0. + * @param {number=} opt_y Defaults to 0. + * @param {number=} opt_z Defaults to 0. + * @return {!CSSMatrix} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-translate-CSSMatrix-unrestricted-double-tx-unrestricted-double-ty-unrestricted-double-tz + */ +CSSMatrix.prototype.translate = function(opt_x, opt_y, opt_z) {}; + +/** + * @param {number=} opt_scaleX Defaults to 1. + * @param {number=} opt_scaleY Defaults to scaleX. + * @param {number=} opt_scaleZ Defaults to 1. + * @return {!CSSMatrix} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-scale-CSSMatrix-unrestricted-double-scale-unrestricted-double-originX-unrestricted-double-originY + */ +CSSMatrix.prototype.scale = function(opt_scaleX, opt_scaleY, opt_scaleZ) {}; + +/** + * @param {number=} opt_rotX Defaults to 0. + * @param {number=} opt_rotY Defaults to 0. + * @param {number=} opt_rotZ Defaults to rotX if rotY is not defined, else 0. + * @return {!CSSMatrix} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-rotate-CSSMatrix-unrestricted-double-angle-unrestricted-double-originX-unrestricted-double-originY + */ +CSSMatrix.prototype.rotate = function(opt_rotX, opt_rotY, opt_rotZ) {}; + +/** + * @param {number=} opt_x Defaults to 0. + * @param {number=} opt_y Defaults to 0. + * @param {number=} opt_z Defaults to 0. + * @param {number=} opt_angle Defaults to 0. + * @return {!CSSMatrix} + * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-rotateAxisAngle-CSSMatrix-unrestricted-double-x-unrestricted-double-y-unrestricted-double-z-unrestricted-double-angle + */ +CSSMatrix.prototype.rotateAxisAngle = + function(opt_x, opt_y, opt_z, opt_angle) {}; + +/** + * @constructor + * @param {string=} opt_matrix + * @extends {CSSMatrix} + * @see http://developer.apple.com/safari/library/documentation/AudioVideo/Reference/WebKitCSSMatrixClassReference/WebKitCSSMatrix/WebKitCSSMatrix.html#//apple_ref/javascript/instm/WebKitCSSMatrix/setMatrixValue + */ +function WebKitCSSMatrix(opt_matrix) {} + +/** + * @constructor + * @param {string=} opt_matrix + * @extends {CSSMatrix} + * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh453593.aspx + */ +function MSCSSMatrix(opt_matrix) {} diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js new file mode 100644 index 000000000..de36ea324 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js @@ -0,0 +1,101 @@ +/* + * Copyright 2013 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's device orientation and device motion + * events specification. + * This file depends on w3c_event.js. + * The whole file has been partially type annotated. + * Created from http://dev.w3.org/geo/api/spec-source-orientation. + * + * @externs + */ + +/** + * @constructor + * @extends {Event} + */ +function DeviceOrientationEvent() {} + +/** @type {?number} */ +DeviceOrientationEvent.prototype.alpha; + +/** @type {?number} */ +DeviceOrientationEvent.prototype.beta; + +/** @type {?number} */ +DeviceOrientationEvent.prototype.gamma; + +/** @type {boolean} */ +DeviceOrientationEvent.prototype.absolute; + +/** + * @type {?number} + * @see https://developer.apple.com/library/safari/documentation/SafariDOMAdditions/Reference/DeviceOrientationEventClassRef/DeviceOrientationEvent/DeviceOrientationEvent.html#//apple_ref/javascript/instp/DeviceOrientationEvent/webkitCompassAccuracy + */ +DeviceOrientationEvent.prototype.webkitCompassAccuracy; + +/** + * @type {?number} + * @see https://developer.apple.com/library/safari/documentation/SafariDOMAdditions/Reference/DeviceOrientationEventClassRef/DeviceOrientationEvent/DeviceOrientationEvent.html#//apple_ref/javascript/instp/DeviceOrientationEvent/webkitCompassHeading + */ +DeviceOrientationEvent.prototype.webkitCompassHeading; + +/** + * @constructor + */ +function DeviceAcceleration() {} + +/** @type {?number} */ +DeviceAcceleration.prototype.x; + +/** @type {?number} */ +DeviceAcceleration.prototype.y; + +/** @type {?number} */ +DeviceAcceleration.prototype.z; + +/** + * @constructor + */ +function DeviceRotationRate() {} + +/** @type {?number} */ +DeviceRotationRate.prototype.alpha; + +/** @type {?number} */ +DeviceRotationRate.prototype.beta; + +/** @type {?number} */ +DeviceRotationRate.prototype.gamma; + +/** + * @constructor + * @extends {Event} + */ +function DeviceMotionEvent() {} + +/** @type {?DeviceAcceleration} */ +DeviceMotionEvent.prototype.acceleration; + +/** @type {?DeviceAcceleration} */ +DeviceMotionEvent.prototype.accelerationIncludingGravity; + +/** @type {?DeviceRotationRate} */ +DeviceMotionEvent.prototype.rotationRate; + +/** @type {?number} */ +DeviceMotionEvent.prototype.interval; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js new file mode 100644 index 000000000..d00f73fd4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js @@ -0,0 +1,874 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's DOM Level 1 specification. + * The whole file has been fully type annotated. Created from + * http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html + * + * @externs + * @author stevey@google.com (Steve Yegge) + */ + +/** + * @constructor + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-17189187 + */ +function DOMException() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.INDEX_SIZE_ERR = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.DOMSTRING_SIZE_ERR = 2; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.HIERARCHY_REQUEST_ERR = 3; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.WRONG_DOCUMENT_ERR = 4; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.INVALID_CHARACTER_ERR = 5; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.NO_DATA_ALLOWED_ERR = 6; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.NO_MODIFICATION_ALLOWED_ERR = 7; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.NOT_FOUND_ERR = 8; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.NOT_SUPPORTED_ERR = 9; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +DOMException.INUSE_ATTRIBUTE_ERR = 10; + +/** + * @constructor + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF + */ +function ExceptionCode() {} + +/** + * @constructor + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-102161490 + */ +function DOMImplementation() {} + +/** + * @param {string} feature + * @param {string} version + * @return {boolean} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5CED94D7 + * @nosideeffects + */ +DOMImplementation.prototype.hasFeature = function(feature, version) {}; + +/** + * @constructor + * @implements {EventTarget} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +function Node() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Node.prototype.addEventListener = function(type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Node.prototype.removeEventListener = function(type, listener, opt_useCapture) {}; + +/** @override */ +Node.prototype.dispatchEvent = function(evt) {}; + +/** + * @type {NamedNodeMap} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-attributes + */ +Node.prototype.attributes; + +/** + * @type {!NodeList} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-childNodes + */ +Node.prototype.childNodes; + +/** + * @type {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-firstChild + */ +Node.prototype.firstChild; + +/** + * @type {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-lastChild + */ +Node.prototype.lastChild; + +/** + * @type {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nextSibling + */ +Node.prototype.nextSibling; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeName + */ +Node.prototype.nodeName; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeValue + */ +Node.prototype.nodeValue; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeType + */ +Node.prototype.nodeType; + +/** + * @type {Document} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-ownerDocument + */ +Node.prototype.ownerDocument; + +/** + * @type {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-parentNode + */ +Node.prototype.parentNode; + +/** + * @type {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-previousSibling + */ +Node.prototype.previousSibling; + +/** + * @param {Node} newChild + * @return {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-appendChild + */ +Node.prototype.appendChild = function(newChild) {}; + +/** + * @param {boolean} deep + * @return {!Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-cloneNode + * @nosideeffects + */ +Node.prototype.cloneNode = function(deep) {}; + +/** + * @return {boolean} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-hasChildNodes + * @nosideeffects + */ +Node.prototype.hasChildNodes = function() {}; + +/** + * @param {Node} newChild + * @param {Node} refChild + * @return {!Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-insertBefore + */ +Node.prototype.insertBefore = function(newChild, refChild) {}; + +/** + * @param {Node} oldChild + * @return {!Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeChild + */ +Node.prototype.removeChild = function(oldChild) {}; + +/** + * @param {Node} newChild + * @param {Node} oldChild + * @return {!Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-replaceChild + */ +Node.prototype.replaceChild = function(newChild, oldChild) {}; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.ATTRIBUTE_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.CDATA_SECTION_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.COMMENT_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.DOCUMENT_FRAGMENT_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.DOCUMENT_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.DOCUMENT_TYPE_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.ELEMENT_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.ENTITY_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.ENTITY_REFERENCE_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.PROCESSING_INSTRUCTION_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.TEXT_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.XPATH_NAMESPACE_NODE; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 + */ +Node.NOTATION_NODE; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-B63ED1A3 + */ +function DocumentFragment() {} + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#i-Document + */ +function Document() {} + +/** + * @type {DocumentType} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-doctype + */ +Document.prototype.doctype; + +/** + * @type {!Element} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-documentElement + */ +Document.prototype.documentElement; + +/** + * @type {DOMImplementation} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-implementation + */ +Document.prototype.implementation; + +/** + * @param {string} name + * @return {!Attr} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createAttribute + * @nosideeffects + */ +Document.prototype.createAttribute = function(name) {}; + +/** + * @param {string} data + * @return {!Comment} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createComment + * @nosideeffects + */ +Document.prototype.createComment = function(data) {}; + +/** + * @param {string} data + * @return {!CDATASection} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createCDATASection + * @nosideeffects + */ +Document.prototype.createCDATASection = function(data) {}; + +/** + * @return {!DocumentFragment} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createDocumentFragment + * @nosideeffects + */ +Document.prototype.createDocumentFragment = function() {}; + +/** + * Create a DOM element. + * + * Web components introduced the second parameter as a way of extending existing + * tags (e.g. document.createElement('button', 'fancy-button')). + * + * @param {string} tagName + * @param {string=} opt_typeExtension + * @return {!Element} + * @nosideeffects + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createElement + * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate + */ +Document.prototype.createElement = function(tagName, opt_typeExtension) {}; + +/** + * @param {string} name + * @return {!EntityReference} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createEntityReference + * @nosideeffects + */ +Document.prototype.createEntityReference = function(name) {}; + +/** + * @param {string} target + * @param {string} data + * @return {!ProcessingInstruction} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createProcessingInstruction + * @nosideeffects + */ +Document.prototype.createProcessingInstruction = function(target, data) {}; + +/** + * @param {number|string} data + * @return {!Text} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createTextNode + * @nosideeffects + */ +Document.prototype.createTextNode = function(data) {}; + +/** + * @param {string} tagname + * @return {!NodeList} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-A6C9094 + * @nosideeffects + */ +Document.prototype.getElementsByTagName = function(tagname) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-536297177 + */ +function NodeList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-203510337 + */ +NodeList.prototype.length; + +/** + * @param {number} index + * @return {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-844377136 + */ +NodeList.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1780488922 + */ +function NamedNodeMap() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6D0FB19E + */ +NamedNodeMap.prototype.length; + +/** + * @param {string} name + * @return {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1074577549 + * @nosideeffects + */ +NamedNodeMap.prototype.getNamedItem = function(name) {}; + +/** + * @param {number} index + * @return {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-349467F9 + * @nosideeffects + */ +NamedNodeMap.prototype.item = function(index) {}; + +/** + * @param {string} name + * @return {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D58B193 + */ +NamedNodeMap.prototype.removeNamedItem = function(name) {}; + +/** + * @param {Node} arg + * @return {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1025163788 + */ +NamedNodeMap.prototype.setNamedItem = function(arg) {}; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-FF21A306 + */ +function CharacterData() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-72AB8359 + */ +CharacterData.prototype.data; + +/** + * @type {number} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-7D61178C + */ +CharacterData.prototype.length; + +/** + * @param {string} arg + * @return {undefined} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-32791A2F + */ +CharacterData.prototype.appendData = function(arg) {}; + +/** + * @param {number} offset + * @param {number} count + * @return {undefined} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-7C603781 + */ +CharacterData.prototype.deleteData = function(offset, count) {}; + +/** + * @param {number} offset + * @param {string} arg + * @return {undefined} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-3EDB695F + */ +CharacterData.prototype.insertData = function(offset, arg) {}; + +/** + * @param {number} offset + * @param {number} count + * @param {string} arg + * @return {undefined} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-E5CBA7FB + */ +CharacterData.prototype.replaceData = function(offset, count, arg) {}; + +/** + * @param {number} offset + * @param {number} count + * @return {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6531BCCF + * @nosideeffects + */ +CharacterData.prototype.substringData = function(offset, count) {}; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-637646024 + */ +function Attr() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1112119403 + */ +Attr.prototype.name; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-862529273 + */ +Attr.prototype.specified; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-221662474 + */ +Attr.prototype.value; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614 + */ +function Element() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-tagName + */ +Element.prototype.tagName; + +/** + * @param {string} name + * @param {number?=} opt_flags + * @return {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-getAttribute + * @see http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx + * @nosideeffects + */ +Element.prototype.getAttribute = function(name, opt_flags) {}; + +/** + * @param {string} name + * @return {Attr} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-getAttributeNode + * @nosideeffects + */ +Element.prototype.getAttributeNode = function(name) {}; + +/** + * @param {string} tagname + * @return {!NodeList} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1938918D + * @nosideeffects + */ +Element.prototype.getElementsByTagName = function(tagname) {}; + +/** + * @param {string} name + * @return {undefined} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttribute + */ +Element.prototype.removeAttribute = function(name) {}; + +/** + * @param {Attr} oldAttr + * @return {?Attr} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttributeNode + */ +Element.prototype.removeAttributeNode = function(oldAttr) {}; + +/** + * @param {string} name + * @param {string|number|boolean} value Values are converted to strings with + * ToString, so we accept number and boolean since both convert easily to + * strings. + * @return {undefined} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-setAttribute + */ +Element.prototype.setAttribute = function(name, value) {}; + +/** + * @param {Attr} newAttr + * @return {?Attr} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-setAttributeNode + */ +Element.prototype.setAttributeNode = function(newAttr) {}; + +// Event handlers +// The DOM level 3 spec has a good index of these +// http://www.w3.org/TR/DOM-Level-3-Events/#event-types + +/** @type {?function (Event)} */ Element.prototype.onabort; +/** @type {?function (Event)} */ Element.prototype.onbeforeinput; +/** @type {?function (Event)} */ Element.prototype.onbeforeunload; +/** @type {?function (Event)} */ Element.prototype.onblur; +/** @type {?function (Event)} */ Element.prototype.onchange; +/** @type {?function (Event)} */ Element.prototype.onclick; +/** @type {?function (Event)} */ Element.prototype.oncompositionstart; +/** @type {?function (Event)} */ Element.prototype.oncompositionupdate; +/** @type {?function (Event)} */ Element.prototype.oncompositionend; +/** @type {?function (Event)} */ Element.prototype.oncontextmenu; +/** @type {?function (Event)} */ Element.prototype.oncopy; +/** @type {?function (Event)} */ Element.prototype.oncut; +/** @type {?function (Event)} */ Element.prototype.ondblclick; +/** @type {?function (Event)} */ Element.prototype.onerror; +/** @type {?function (Event)} */ Element.prototype.onfocus; +/** @type {?function (Event)} */ Element.prototype.onfocusin; +/** @type {?function (Event)} */ Element.prototype.onfocusout; +/** @type {?function (Event)} */ Element.prototype.oninput; +/** @type {?function (Event)} */ Element.prototype.onkeydown; +/** @type {?function (Event)} */ Element.prototype.onkeypress; +/** @type {?function (Event)} */ Element.prototype.onkeyup; +/** @type {?function (Event)} */ Element.prototype.onload; +/** @type {?function (Event)} */ Element.prototype.onunload; +/** @type {?function (Event)} */ Element.prototype.onmousedown; +/** @type {?function (Event)} */ Element.prototype.onmousemove; +/** @type {?function (Event)} */ Element.prototype.onmouseout; +/** @type {?function (Event)} */ Element.prototype.onmouseover; +/** @type {?function (Event)} */ Element.prototype.onmouseup; +/** @type {?function (Event)} */ Element.prototype.onmousewheel; +/** @type {?function (Event)} */ Element.prototype.onpaste; +/** @type {?function (Event)} */ Element.prototype.onreset; +/** @type {?function (Event)} */ Element.prototype.onresize; +/** @type {?function (Event)} */ Element.prototype.onscroll; +/** @type {?function (Event)} */ Element.prototype.onselect; +/** @type {?function (Event=)} */ Element.prototype.onsubmit; +/** @type {?function (Event)} */ Element.prototype.ontextinput; +/** @type {?function (Event)} */ Element.prototype.onwheel; + +/** + * @constructor + * @extends {CharacterData} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1312295772 + */ +function Text() {} + +/** + * @param {number} offset + * @return {Text} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-38853C1D + */ +Text.prototype.splitText = function(offset) {}; + +/** + * @constructor + * @extends {CharacterData} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1728279322 + */ +function Comment() {} + +/** + * @constructor + * @extends {Text} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-667469212 + */ +function CDATASection() {} + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-412266927 + */ +function DocumentType() {} + +/** + * @type {NamedNodeMap} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1788794630 + */ +DocumentType.prototype.entities; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1844763134 + */ +DocumentType.prototype.name; + +/** + * @type {NamedNodeMap} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D46829EF + */ +DocumentType.prototype.notations; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5431D1B9 + */ +function Notation() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-54F2B4D0 + */ +Notation.prototype.publicId; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-E8AAB1D0 + */ +Notation.prototype.systemId; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-527DCFF2 + */ +function Entity() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7303025 + */ +Entity.prototype.publicId; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7C29F3E + */ +Entity.prototype.systemId; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6ABAEB38 + */ +Entity.prototype.notationName; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-11C98490 + */ +function EntityReference() {} + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1004215813 + */ +function ProcessingInstruction() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-837822393 + */ +ProcessingInstruction.prototype.data; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1478689192 + */ +ProcessingInstruction.prototype.target; + + +/** + * @constructor + * @implements {EventTarget} + */ +function Window() {} +Window.prototype.Window; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Window.prototype.addEventListener = function(type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Window.prototype.removeEventListener = function(type, listener, opt_useCapture) + {}; + +/** @override */ +Window.prototype.dispatchEvent = function(evt) {}; + +/** @type {?function (Event)} */ Window.prototype.onabort; +/** @type {?function (Event)} */ Window.prototype.onbeforeunload; +/** @type {?function (Event)} */ Window.prototype.onblur; +/** @type {?function (Event)} */ Window.prototype.onchange; +/** @type {?function (Event)} */ Window.prototype.onclick; +/** @type {?function (Event)} */ Window.prototype.onclose; +/** @type {?function (Event)} */ Window.prototype.oncontextmenu; +/** @type {?function (Event)} */ Window.prototype.ondblclick; +/** @type {?function (Event)} */ Window.prototype.ondragdrop; +// onerror has a special signature. +// See https://developer.mozilla.org/en/DOM/window.onerror +// and http://msdn.microsoft.com/en-us/library/cc197053(VS.85).aspx +/** @type {?function (string, string, number)} */ +Window.prototype.onerror; +/** @type {?function (Event)} */ Window.prototype.onfocus; +/** @type {?function (Event)} */ Window.prototype.onhashchange; +/** @type {?function (Event)} */ Window.prototype.onkeydown; +/** @type {?function (Event)} */ Window.prototype.onkeypress; +/** @type {?function (Event)} */ Window.prototype.onkeyup; +/** @type {?function (Event)} */ Window.prototype.onload; +/** @type {?function (Event)} */ Window.prototype.onmousedown; +/** @type {?function (Event)} */ Window.prototype.onmousemove; +/** @type {?function (Event)} */ Window.prototype.onmouseout; +/** @type {?function (Event)} */ Window.prototype.onmouseover; +/** @type {?function (Event)} */ Window.prototype.onmouseup; +/** @type {?function (Event)} */ Window.prototype.onmousewheel; +/** @type {?function (Event)} */ Window.prototype.onpaint; +/** @type {?function (Event)} */ Window.prototype.onpopstate; +/** @type {?function (Event)} */ Window.prototype.onreset; +/** @type {?function (Event)} */ Window.prototype.onresize; +/** @type {?function (Event)} */ Window.prototype.onscroll; +/** @type {?function (Event)} */ Window.prototype.onselect; +/** @type {?function (Event=)} */ Window.prototype.onsubmit; +/** @type {?function (Event)} */ Window.prototype.onunload; +/** @type {?function (Event)} */ Window.prototype.onwheel; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js new file mode 100644 index 000000000..d6642074c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js @@ -0,0 +1,2619 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's DOM Level 2 specification. + * This file depends on w3c_dom1.js. + * The whole file has been fully type annotated. + * Created from + * http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html + * + * @externs + * @author stevey@google.com (Steve Yegge) + */ +// All the provided definitions have been type annotated. + +/** + * @constructor + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75708506 + */ +function HTMLCollection() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40057551 + */ +HTMLCollection.prototype.length; + +/** + * @param {number} index + * @return {Node} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33262535 + * @nosideeffects + */ +HTMLCollection.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection + */ +function HTMLOptionsCollection() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection-length + */ +HTMLOptionsCollection.prototype.length; + +/** + * @param {number} index + * @return {Node} + * @see http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection-item + * @nosideeffects + */ +HTMLOptionsCollection.prototype.item = function(index) {}; + +/** + * @constructor + * @extends {Document} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26809268 + */ +function HTMLDocument() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18446827 + */ +HTMLDocument.prototype.title; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95229140 + */ +HTMLDocument.prototype.referrer; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-2250147 + */ +HTMLDocument.prototype.domain; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46183437 + */ +HTMLDocument.prototype.URL; + +/** + * @type {HTMLBodyElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-56360201 + */ +HTMLDocument.prototype.body; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90379117 + */ +HTMLDocument.prototype.images; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85113862 + */ +HTMLDocument.prototype.applets; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7068919 + */ +HTMLDocument.prototype.links; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-1689064 + */ +HTMLDocument.prototype.forms; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7577272 + */ +HTMLDocument.prototype.anchors; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8747038 + */ +HTMLDocument.prototype.cookie; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-72161170 + * @override + */ +HTMLDocument.prototype.open = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98948567 + * @override + */ +HTMLDocument.prototype.close = function() {}; + +/** + * @param {string} text + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75233634 + * @override + */ +HTMLDocument.prototype.write = function(text) {}; + +/** + * @param {string} text + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35318390 + * @override + */ +HTMLDocument.prototype.writeln = function(text) {}; + +/** + * @param {string} elementName + * @return {!NodeList} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71555259 + * @override + * @nosideeffects + */ +HTMLDocument.prototype.getElementsByName = function(elementName) {}; + +/** + * @param {Node} root + * @param {number=} whatToShow + * @param {NodeFilter=} filter + * @param {boolean=} entityReferenceExpansion + * @return {!NodeIterator} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-Document + * @nosideeffects + */ +HTMLDocument.prototype.createNodeIterator = function( + root, whatToShow, filter, entityReferenceExpansion) {}; + +/** + * @param {Node} root + * @param {number=} whatToShow + * @param {NodeFilter=} filter + * @param {boolean=} entityReferenceExpansion + * @return {!TreeWalker} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-Document + * @nosideeffects + */ +HTMLDocument.prototype.createTreeWalker = function( + root, whatToShow, filter, entityReferenceExpansion) {}; + + +/** @typedef {{ + createNodeIterator: function(Node, number=, NodeFilter=, boolean=) : NodeIterator, + createTreeWalker: function(Node, number=, NodeFilter=, boolean=) : TreeWalker +}} */ +var TraversalDocument; + +/** + * @interface + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeFilter +*/ +function NodeFilter() {} + +/* Constants for whatToShow */ +/** @const {number} */ NodeFilter.SHOW_ALL; +/** @const {number} */ NodeFilter.SHOW_ATTRIBUTE; +/** @const {number} */ NodeFilter.SHOW_CDATA_SECTION; +/** @const {number} */ NodeFilter.SHOW_COMMENT; +/** @const {number} */ NodeFilter.SHOW_DOCUMENT; +/** @const {number} */ NodeFilter.SHOW_DOCUMENT_FRAGMENT; +/** @const {number} */ NodeFilter.SHOW_DOCUMENT_TYPE; +/** @const {number} */ NodeFilter.SHOW_ELEMENT; +/** @const {number} */ NodeFilter.SHOW_ENTITY; +/** @const {number} */ NodeFilter.SHOW_ENTITY_REFERENCE; +/** @const {number} */ NodeFilter.SHOW_NOTATION; +/** @const {number} */ NodeFilter.SHOW_PROCESSING_INSTRUCTION; +/** @const {number} */ NodeFilter.SHOW_TEXT; + +/* Consants for acceptNode */ +/** @const {number} */ NodeFilter.FILTER_ACCEPT; +/** @const {number} */ NodeFilter.FILTER_REJECT; +/** @const {number} */ NodeFilter.FILTER_SKIP; + +/** + * @param {Node} n + * @return {number} Any of NodeFilter.FILTER_* constants. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeFilter-acceptNode +*/ +NodeFilter.prototype.acceptNode = function(n) {}; + +/** + * @interface + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator +*/ +function NodeIterator() {} + +/** + * Detach and invalidate the NodeIterator. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator-detach + */ +NodeIterator.prototype.detach = function() {}; + +/** + * @return {Node} Next node in the set. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator-nextNode + */ +NodeIterator.prototype.nextNode = function() {}; + +/** + * @return {Node} Previous node in the set. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator-previousNode + */ +NodeIterator.prototype.previousNode = function() {}; + +/** + * @interface + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker +*/ +function TreeWalker() {} + +/** + * @return {?Node} The new Node or null. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-firstChild + */ +TreeWalker.prototype.firstChild = function() {}; + +/** + * @return {?Node} The new Node or null.. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-lastChild + */ +TreeWalker.prototype.lastChild = function() {}; + +/** + * @return {?Node} The new Node or null. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-nextNode + */ +TreeWalker.prototype.nextNode = function() {}; + +/** + * @return {?Node} The new Node or null. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-nextSibling + */ +TreeWalker.prototype.nextSibling = function() {}; + +/** + * @return {?Node} The new Node or null. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-parentNode + */ +TreeWalker.prototype.parentNode = function() {}; + +/** + * @return {?Node} The new Node or null. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-previousNode + */ +TreeWalker.prototype.previousNode = function() {}; + +/** + * @return {?Node} The new Node or null. + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-previousSibling + */ +TreeWalker.prototype.previousSibling = function() {}; + +/** + * @type {Node} + */ +TreeWalker.prototype.root; + +/** + * @type {number} + */ +TreeWalker.prototype.whatToShow; + +/** + * @type {NodeFilter} + */ +TreeWalker.prototype.filter; + +/** + * @type {boolean} + */ +TreeWalker.prototype.expandEntityReference; + +/** + * @type {Node} + */ +TreeWalker.prototype.currentNode; + +/** + * @constructor + * @extends {Element} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58190037 + */ +function HTMLElement() {} + +/** + * @implicitCast + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63534901 + */ +HTMLElement.prototype.id; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78276800 + */ +HTMLElement.prototype.title; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59132807 + */ +HTMLElement.prototype.lang; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52460740 + */ +HTMLElement.prototype.dir; + +/** + * @implicitCast + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95362176 + */ +HTMLElement.prototype.className; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33759296 + */ +function HTMLHtmlElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9383775 + */ +HTMLHtmlElement.prototype.version; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77253168 + */ +function HTMLHeadElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96921909 + */ +HTMLHeadElement.prototype.profile; + +/** + * @constructor + * @extends {HTMLElement} + * @implements {LinkStyle} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35143001 + */ +function HTMLLinkElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87355129 + */ +HTMLLinkElement.prototype.disabled; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63954491 + */ +HTMLLinkElement.prototype.charset; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33532588 + */ +HTMLLinkElement.prototype.href; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85145682 + */ +HTMLLinkElement.prototype.hreflang; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75813125 + */ +HTMLLinkElement.prototype.media; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-41369587 + */ +HTMLLinkElement.prototype.rel; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40715461 + */ +HTMLLinkElement.prototype.rev; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84183095 + */ +HTMLLinkElement.prototype.target; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32498296 + */ +HTMLLinkElement.prototype.type; + +/** @type {StyleSheet} */ +HTMLLinkElement.prototype.sheet; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79243169 + */ +function HTMLTitleElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77500413 + */ +HTMLTitleElement.prototype.text; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-37041454 + */ +function HTMLMetaElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87670826 + */ +HTMLMetaElement.prototype.content; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77289449 + */ +HTMLMetaElement.prototype.httpEquiv; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-31037081 + */ +HTMLMetaElement.prototype.name; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35993789 + */ +HTMLMetaElement.prototype.scheme; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73629039 + */ +function HTMLBaseElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-65382887 + */ +HTMLBaseElement.prototype.href; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73844298 + */ +HTMLBaseElement.prototype.target; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85283003 + */ +function HTMLIsIndexElement() {} + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87069980 + */ +HTMLIsIndexElement.prototype.form; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33589862 + */ +HTMLIsIndexElement.prototype.prompt; + +/** + * @constructor + * @extends {HTMLElement} + * @implements {LinkStyle} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16428977 + */ +function HTMLStyleElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-51162010 + */ +HTMLStyleElement.prototype.disabled; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76412738 + */ +HTMLStyleElement.prototype.media; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22472002 + */ +HTMLStyleElement.prototype.type; + +/** @type {StyleSheet} */ +HTMLStyleElement.prototype.sheet; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62018039 + */ +function HTMLBodyElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59424581 + */ +HTMLBodyElement.prototype.aLink; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-37574810 + */ +HTMLBodyElement.prototype.background; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-24940084 + */ +HTMLBodyElement.prototype.bgColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7662206 + */ +HTMLBodyElement.prototype.link; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73714763 + */ +HTMLBodyElement.prototype.text; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83224305 + */ +HTMLBodyElement.prototype.vLink; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40002357 + */ +function HTMLFormElement() {} + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76728479 + */ +HTMLFormElement.prototype.elements; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#HTML-HTMLFormElement-length + */ +HTMLFormElement.prototype.length; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22051454 + */ +HTMLFormElement.prototype.name; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-19661795 + */ +HTMLFormElement.prototype.acceptCharset; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74049184 + */ +HTMLFormElement.prototype.action; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84227810 + */ +HTMLFormElement.prototype.enctype; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82545539 + */ +HTMLFormElement.prototype.method; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6512890 + */ +HTMLFormElement.prototype.target; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76767676 + */ +HTMLFormElement.prototype.submit = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76767677 + */ +HTMLFormElement.prototype.reset = function() {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-94282980 + */ +function HTMLSelectElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58783172 + */ +HTMLSelectElement.prototype.type; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85676760 + */ +HTMLSelectElement.prototype.selectedIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59351919 + */ +HTMLSelectElement.prototype.value; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-5933486 + */ +HTMLSelectElement.prototype.length; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20489458 + */ +HTMLSelectElement.prototype.form; + +/** + * @type {!HTMLOptionsCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30606413 + */ +HTMLSelectElement.prototype.options; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79102918 + */ +HTMLSelectElement.prototype.disabled; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13246613 + */ +HTMLSelectElement.prototype.multiple; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-41636323 + */ +HTMLSelectElement.prototype.name; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18293826 + */ +HTMLSelectElement.prototype.size; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40676705 + */ +HTMLSelectElement.prototype.tabIndex; + +/** + * @param {HTMLElement} element + * @param {HTMLElement} before + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14493106 + */ +HTMLSelectElement.prototype.add = function(element, before) {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-28216144 + * @override + */ +HTMLSelectElement.prototype.blur = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32130014 + * @override + */ +HTMLSelectElement.prototype.focus = function() {}; + +/** + * @param {number} index + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33404570 + */ +HTMLSelectElement.prototype.remove = function(index) {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38450247 + */ +function HTMLOptGroupElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-15518803 + */ +HTMLOptGroupElement.prototype.disabled; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95806054 + */ +HTMLOptGroupElement.prototype.label; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70901257 + */ +function HTMLOptionElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-37770574 + */ +HTMLOptionElement.prototype.defaultSelected; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-23482473 + */ +HTMLOptionElement.prototype.disabled; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-17116503 + */ +HTMLOptionElement.prototype.form; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14038413 + */ +HTMLOptionElement.prototype.index; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40736115 + */ +HTMLOptionElement.prototype.label; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70874476 + */ +HTMLOptionElement.prototype.selected; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48154426 + */ +HTMLOptionElement.prototype.text; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6185554 + */ +HTMLOptionElement.prototype.value; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6043025 + */ +function HTMLInputElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-15328520 + */ +HTMLInputElement.prototype.accept; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59914154 + */ +HTMLInputElement.prototype.accessKey; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96991182 + */ +HTMLInputElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-92701314 + */ +HTMLInputElement.prototype.alt; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30233917 + */ +HTMLInputElement.prototype.checked; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20509171 + */ +HTMLInputElement.prototype.defaultChecked; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26091157 + */ +HTMLInputElement.prototype.defaultValue; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-50886781 + */ +HTMLInputElement.prototype.disabled; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63239895 + */ +HTMLInputElement.prototype.form; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-54719353 + */ +HTMLInputElement.prototype.maxLength; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-89658498 + */ +HTMLInputElement.prototype.name; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88461592 + */ +HTMLInputElement.prototype.readOnly; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79659438 + */ +HTMLInputElement.prototype.size; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-97320704 + */ +HTMLInputElement.prototype.src; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62176355 + */ +HTMLInputElement.prototype.tabIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62883744 + */ +HTMLInputElement.prototype.type; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32463706 + */ +HTMLInputElement.prototype.useMap; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-49531485 + */ +HTMLInputElement.prototype.value; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26838235 + * @override + */ +HTMLInputElement.prototype.blur = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-2651361 + * @override + */ +HTMLInputElement.prototype.click = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-65996295 + * @override + */ +HTMLInputElement.prototype.focus = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-34677168 + */ +HTMLInputElement.prototype.select = function() {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-24874179 + */ +function HTMLTextAreaElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93102991 + */ +HTMLTextAreaElement.prototype.accessKey; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-51387225 + */ +HTMLTextAreaElement.prototype.cols; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-36152213 + */ +HTMLTextAreaElement.prototype.defaultValue; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98725443 + */ +HTMLTextAreaElement.prototype.disabled; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18911464 + */ +HTMLTextAreaElement.prototype.form; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70715578 + */ +HTMLTextAreaElement.prototype.name; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39131423 + */ +HTMLTextAreaElement.prototype.readOnly; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46975887 + */ +HTMLTextAreaElement.prototype.rows; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-60363303 + */ +HTMLTextAreaElement.prototype.tabIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#HTML-HTMLTextAreaElement-type + */ +HTMLTextAreaElement.prototype.type; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70715579 + */ +HTMLTextAreaElement.prototype.value; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6750689 + * @override + */ +HTMLTextAreaElement.prototype.blur = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39055426 + * @override + */ +HTMLTextAreaElement.prototype.focus = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48880622 + */ +HTMLTextAreaElement.prototype.select = function() {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-34812697 + */ +function HTMLButtonElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73169431 + */ +HTMLButtonElement.prototype.accessKey; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-92757155 + */ +HTMLButtonElement.prototype.disabled; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71254493 + */ +HTMLButtonElement.prototype.form; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11029910 + */ +HTMLButtonElement.prototype.name; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39190908 + */ +HTMLButtonElement.prototype.tabIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-27430092 + */ +HTMLButtonElement.prototype.type; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-72856782 + */ +HTMLButtonElement.prototype.value; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13691394 + */ +function HTMLLabelElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43589892 + */ +HTMLLabelElement.prototype.accessKey; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32480901 + */ +HTMLLabelElement.prototype.form; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96509813 + */ +HTMLLabelElement.prototype.htmlFor; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7365882 + */ +function HTMLFieldSetElement() {} + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75392630 + */ +HTMLFieldSetElement.prototype.form; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-21482039 + */ +function HTMLLegendElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11297832 + */ +HTMLLegendElement.prototype.accessKey; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79538067 + */ +HTMLLegendElement.prototype.align; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-29594519 + */ +HTMLLegendElement.prototype.form; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-86834457 + */ +function HTMLUListElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39864178 + */ +HTMLUListElement.prototype.compact; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96874670 + */ +HTMLUListElement.prototype.type; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58056027 + */ +function HTMLOListElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76448506 + */ +HTMLOListElement.prototype.compact; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14793325 + */ +HTMLOListElement.prototype.start; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40971103 + */ +HTMLOListElement.prototype.type; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52368974 + */ +function HTMLDListElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-21738539 + */ +HTMLDListElement.prototype.compact; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71600284 + */ +function HTMLDirectoryElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75317739 + */ +HTMLDirectoryElement.prototype.compact; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-72509186 + * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-menu-element + */ +function HTMLMenuElement() {} + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68436464 + */ +HTMLMenuElement.prototype.compact; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74680021 + */ +function HTMLLIElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52387668 + */ +HTMLLIElement.prototype.type; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-45496263 + */ +HTMLLIElement.prototype.value; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22445964 + */ +function HTMLDivElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70908791 + */ +HTMLDivElement.prototype.align; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84675076 + */ +function HTMLParagraphElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53465507 + */ +HTMLParagraphElement.prototype.align; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43345119 + */ +function HTMLHeadingElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6796462 + */ +HTMLHeadingElement.prototype.align; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70319763 + */ +function HTMLQuoteElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53895598 + */ +HTMLQuoteElement.prototype.cite; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11383425 + */ +function HTMLPreElement() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13894083 + */ +HTMLPreElement.prototype.width; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-56836063 + */ +function HTMLBRElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82703081 + */ +HTMLBRElement.prototype.clear; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32774408 + */ +function HTMLBaseFontElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87502302 + */ +HTMLBaseFontElement.prototype.color; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88128969 + */ +HTMLBaseFontElement.prototype.face; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38930424 + */ +HTMLBaseFontElement.prototype.size; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43943847 + */ +function HTMLFontElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53532975 + */ +HTMLFontElement.prototype.color; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-55715655 + */ +HTMLFontElement.prototype.face; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90127284 + */ +HTMLFontElement.prototype.size; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68228811 + */ +function HTMLHRElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-15235012 + */ +HTMLHRElement.prototype.align; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79813978 + */ +HTMLHRElement.prototype.noShade; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77612587 + */ +HTMLHRElement.prototype.size; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87744198 + */ +HTMLHRElement.prototype.width; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79359609 + */ +function HTMLModElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75101708 + */ +HTMLModElement.prototype.cite; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88432678 + */ +HTMLModElement.prototype.dateTime; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48250443 + */ +function HTMLAnchorElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-89647724 + */ +HTMLAnchorElement.prototype.accessKey; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67619266 + */ +HTMLAnchorElement.prototype.charset; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-92079539 + */ +HTMLAnchorElement.prototype.coords; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88517319 + */ +HTMLAnchorElement.prototype.href; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87358513 + */ +HTMLAnchorElement.prototype.hreflang; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32783304 + */ +HTMLAnchorElement.prototype.name; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-3815891 + */ +HTMLAnchorElement.prototype.rel; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58259771 + */ +HTMLAnchorElement.prototype.rev; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-49899808 + */ +HTMLAnchorElement.prototype.shape; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-41586466 + */ +HTMLAnchorElement.prototype.tabIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6414197 + */ +HTMLAnchorElement.prototype.target; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63938221 + */ +HTMLAnchorElement.prototype.type; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-65068939 + * @override + */ +HTMLAnchorElement.prototype.blur = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-47150313 + * @override + */ +HTMLAnchorElement.prototype.focus = function() {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-17701901 + */ +function HTMLImageElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-3211094 + */ +HTMLImageElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95636861 + */ +HTMLImageElement.prototype.alt; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-136671 + */ +HTMLImageElement.prototype.border; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91561496 + */ +HTMLImageElement.prototype.height; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53675471 + */ +HTMLImageElement.prototype.hspace; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58983880 + */ +HTMLImageElement.prototype.isMap; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77376969 + */ +HTMLImageElement.prototype.longDesc; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91256910 + */ +HTMLImageElement.prototype.lowSrc; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-47534097 + */ +HTMLImageElement.prototype.name; + +/** + * @type {string} + * @implicitCast + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87762984 + */ +HTMLImageElement.prototype.src; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35981181 + */ +HTMLImageElement.prototype.useMap; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85374897 + */ +HTMLImageElement.prototype.vspace; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13839076 + */ +HTMLImageElement.prototype.width; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9893177 + */ +function HTMLObjectElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16962097 + */ +HTMLObjectElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-47783837 + */ +HTMLObjectElement.prototype.archive; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82818419 + */ +HTMLObjectElement.prototype.border; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75241146 + */ +HTMLObjectElement.prototype.code; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-25709136 + */ +HTMLObjectElement.prototype.codeBase; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-19945008 + */ +HTMLObjectElement.prototype.codeType; + +/** + * @type {Document} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38538621 + */ +HTMLObjectElement.prototype.contentDocument; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-81766986 + */ +HTMLObjectElement.prototype.data; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-942770 + */ +HTMLObjectElement.prototype.declare; + +/** + * @type {HTMLFormElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46094773 + */ +HTMLObjectElement.prototype.form; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88925838 + */ +HTMLObjectElement.prototype.height; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-17085376 + */ +HTMLObjectElement.prototype.hspace; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20110362 + */ +HTMLObjectElement.prototype.name; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-25039673 + */ +HTMLObjectElement.prototype.standby; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-27083787 + */ +HTMLObjectElement.prototype.tabIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91665621 + */ +HTMLObjectElement.prototype.type; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6649772 + */ +HTMLObjectElement.prototype.useMap; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8682483 + */ +HTMLObjectElement.prototype.vspace; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38538620 + */ +HTMLObjectElement.prototype.width; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64077273 + */ +function HTMLParamElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59871447 + */ +HTMLParamElement.prototype.name; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18179888 + */ +HTMLParamElement.prototype.type; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77971357 + */ +HTMLParamElement.prototype.value; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-23931872 + */ +HTMLParamElement.prototype.valueType; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-31006348 + */ +function HTMLAppletElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8049912 + */ +HTMLAppletElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58610064 + */ +HTMLAppletElement.prototype.alt; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14476360 + */ +HTMLAppletElement.prototype.archive; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-61509645 + */ +HTMLAppletElement.prototype.code; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6581160 + */ +HTMLAppletElement.prototype.codeBase; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90184867 + */ +HTMLAppletElement.prototype.height; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-1567197 + */ +HTMLAppletElement.prototype.hspace; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39843695 + */ +HTMLAppletElement.prototype.name; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93681523 + */ +HTMLAppletElement.prototype.object; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22637173 + */ +HTMLAppletElement.prototype.vspace; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16526327 + */ +HTMLAppletElement.prototype.width; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-94109203 + */ +function HTMLMapElement() {} + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71838730 + */ +HTMLMapElement.prototype.areas; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52696514 + */ +HTMLMapElement.prototype.name; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26019118 + */ +function HTMLAreaElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-57944457 + */ +HTMLAreaElement.prototype.accessKey; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39775416 + */ +HTMLAreaElement.prototype.alt; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-66021476 + */ +HTMLAreaElement.prototype.coords; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-34672936 + */ +HTMLAreaElement.prototype.href; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-61826871 + */ +HTMLAreaElement.prototype.noHref; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85683271 + */ +HTMLAreaElement.prototype.shape; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8722121 + */ +HTMLAreaElement.prototype.tabIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46054682 + */ +HTMLAreaElement.prototype.target; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-81598695 + */ +function HTMLScriptElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35305677 + */ +HTMLScriptElement.prototype.charset; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93788534 + */ +HTMLScriptElement.prototype.defer; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-56700403 + */ +HTMLScriptElement.prototype.event; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-66979266 + */ +HTMLScriptElement.prototype.htmlFor; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75147231 + */ +HTMLScriptElement.prototype.src; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46872999 + */ +HTMLScriptElement.prototype.text; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30534818 + */ +HTMLScriptElement.prototype.type; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64060425 + */ +function HTMLTableElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-23180977 + */ +HTMLTableElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83532985 + */ +HTMLTableElement.prototype.bgColor; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-50969400 + */ +HTMLTableElement.prototype.border; + +/** + * @type {HTMLTableCaptionElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14594520 + */ +HTMLTableElement.prototype.caption; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59162158 + */ +HTMLTableElement.prototype.cellPadding; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68907883 + */ +HTMLTableElement.prototype.cellSpacing; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64808476 + */ +HTMLTableElement.prototype.frame; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6156016 + */ +HTMLTableElement.prototype.rows; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26347553 + */ +HTMLTableElement.prototype.rules; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-44998528 + */ +HTMLTableElement.prototype.summary; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63206416 + */ +HTMLTableElement.prototype.tBodies; + +/** + * @type {HTMLTableSectionElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64197097 + */ +HTMLTableElement.prototype.tFoot; + +/** + * @type {HTMLTableSectionElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9530944 + */ +HTMLTableElement.prototype.tHead; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77447361 + */ +HTMLTableElement.prototype.width; + +/** + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96920263 + */ +HTMLTableElement.prototype.createCaption = function() {}; + +/** + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8453710 + */ +HTMLTableElement.prototype.createTFoot = function() {}; + +/** + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70313345 + */ +HTMLTableElement.prototype.createTHead = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22930071 + */ +HTMLTableElement.prototype.deleteCaption = function() {}; + +/** + * @param {number} index + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13114938 + */ +HTMLTableElement.prototype.deleteRow = function(index) {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78363258 + */ +HTMLTableElement.prototype.deleteTFoot = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38310198 + */ +HTMLTableElement.prototype.deleteTHead = function() {}; + +/** + * @param {number} index + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39872903 + */ +HTMLTableElement.prototype.insertRow = function(index) {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-12035137 + */ +function HTMLTableCaptionElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79875068 + */ +HTMLTableCaptionElement.prototype.align; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84150186 + */ +function HTMLTableColElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-31128447 + */ +HTMLTableColElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9447412 + */ +HTMLTableColElement.prototype.ch; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-57779225 + */ +HTMLTableColElement.prototype.chOff; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96511335 + */ +HTMLTableColElement.prototype.span; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83291710 + */ +HTMLTableColElement.prototype.vAlign; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-25196799 + */ +HTMLTableColElement.prototype.width; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67417573 + */ +function HTMLTableSectionElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40530119 + */ +HTMLTableSectionElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83470012 + */ +HTMLTableSectionElement.prototype.ch; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53459732 + */ +HTMLTableSectionElement.prototype.chOff; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52092650 + */ +HTMLTableSectionElement.prototype.rows; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-4379116 + */ +HTMLTableSectionElement.prototype.vAlign; + +/** + * @param {number} index + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-5625626 + */ +HTMLTableSectionElement.prototype.deleteRow = function(index) {}; + +/** + * @param {number} index + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93995626 + */ +HTMLTableSectionElement.prototype.insertRow = function(index) {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6986576 + */ +function HTMLTableRowElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74098257 + */ +HTMLTableRowElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18161327 + */ +HTMLTableRowElement.prototype.bgColor; + +/** + * @type {HTMLCollection} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67349879 + */ +HTMLTableRowElement.prototype.cells; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16230502 + */ +HTMLTableRowElement.prototype.ch; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68207461 + */ +HTMLTableRowElement.prototype.chOff; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67347567 + */ +HTMLTableRowElement.prototype.rowIndex; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79105901 + */ +HTMLTableRowElement.prototype.sectionRowIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90000058 + */ +HTMLTableRowElement.prototype.vAlign; + +/** + * @param {number} index + * @return {undefined} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11738598 + */ +HTMLTableRowElement.prototype.deleteCell = function(index) {}; + +/** + * @param {number} index + * @return {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68927016 + */ +HTMLTableRowElement.prototype.insertCell = function(index) {}; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82915075 + */ +function HTMLTableCellElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74444037 + */ +HTMLTableCellElement.prototype.abbr; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98433879 + */ +HTMLTableCellElement.prototype.align; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76554418 + */ +HTMLTableCellElement.prototype.axis; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88135431 + */ +HTMLTableCellElement.prototype.bgColor; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-80748363 + */ +HTMLTableCellElement.prototype.cellIndex; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30914780 + */ +HTMLTableCellElement.prototype.ch; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20144310 + */ +HTMLTableCellElement.prototype.chOff; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84645244 + */ +HTMLTableCellElement.prototype.colSpan; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-89104817 + */ +HTMLTableCellElement.prototype.headers; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83679212 + */ +HTMLTableCellElement.prototype.height; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62922045 + */ +HTMLTableCellElement.prototype.noWrap; + +/** + * @type {number} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48237625 + */ +HTMLTableCellElement.prototype.rowSpan; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-36139952 + */ +HTMLTableCellElement.prototype.scope; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58284221 + */ +HTMLTableCellElement.prototype.vAlign; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-27480795 + */ +HTMLTableCellElement.prototype.width; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43829095 + */ +function HTMLFrameSetElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98869594 + */ +HTMLFrameSetElement.prototype.cols; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-19739247 + */ +HTMLFrameSetElement.prototype.rows; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-97790553 + */ +function HTMLFrameElement() {} + +/** + * @type {Document} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78799536 + */ +HTMLFrameElement.prototype.contentDocument; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11858633 + */ +HTMLFrameElement.prototype.frameBorder; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7836998 + */ +HTMLFrameElement.prototype.longDesc; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-55569778 + */ +HTMLFrameElement.prototype.marginHeight; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8369969 + */ +HTMLFrameElement.prototype.marginWidth; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91128709 + */ +HTMLFrameElement.prototype.name; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-80766578 + */ +HTMLFrameElement.prototype.noResize; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-45411424 + */ +HTMLFrameElement.prototype.scrolling; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78799535 + */ +HTMLFrameElement.prototype.src; + +/** + * @constructor + * @extends {HTMLElement} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-50708718 + */ +function HTMLIFrameElement() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11309947 + */ +HTMLIFrameElement.prototype.align; + +/** + * @type {Document} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67133006 + */ +HTMLIFrameElement.prototype.contentDocument; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22463410 + */ +HTMLIFrameElement.prototype.frameBorder; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-1678118 + */ +HTMLIFrameElement.prototype.height; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70472105 + */ +HTMLIFrameElement.prototype.longDesc; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91371294 + */ +HTMLIFrameElement.prototype.marginHeight; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-66486595 + */ +HTMLIFrameElement.prototype.marginWidth; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96819659 + */ +HTMLIFrameElement.prototype.name; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-36369822 + */ +HTMLIFrameElement.prototype.scrolling; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43933957 + */ +HTMLIFrameElement.prototype.src; + +/** + * @type {string} + * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67133005 + */ +HTMLIFrameElement.prototype.width; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF + */ +DOMException.INVALID_STATE_ERR = 11; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF + */ +DOMException.SYNTAX_ERR = 12; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF + */ +DOMException.INVALID_MODIFICATION_ERR = 13; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF + */ +DOMException.NAMESPACE_ERR = 14; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF + */ +DOMException.INVALID_ACCESS_ERR = 15; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js new file mode 100644 index 000000000..ad34d5658 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js @@ -0,0 +1,854 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's DOM Level 3 specification. + * This file depends on w3c_dom2.js. + * The whole file has been fully type annotated. + * Created from + * http://www.w3.org/TR/DOM-Level-3-Core/ecma-script-binding.html + * + * @externs + * @author stevey@google.com (Steve Yegge) + */ + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF + */ +DOMException.prototype.code; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF + */ +DOMException.VALIDATION_ERR = 16; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF + */ +DOMException.TYPE_MISMATCH_ERR = 17; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList + */ +function DOMStringList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-length + */ +DOMStringList.prototype.length; + +/** + * @param {string} str + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-contains + */ +DOMStringList.prototype.contains = function(str) {}; + +/** + * @param {number} index + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-item + */ +DOMStringList.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList + */ +function NameList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-length + */ +NameList.prototype.length; + +/** + * @param {string} str + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-contains + * @nosideeffects + */ +NameList.prototype.contains = function(str) {}; + +/** + * @param {string} namespaceURI + * @param {string} name + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-containsNS + * @nosideeffects + */ +NameList.prototype.containsNS = function(namespaceURI, name) {}; + +/** + * @param {number} index + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getName + * @nosideeffects + */ +NameList.prototype.getName = function(index) {}; + +/** + * @param {number} index + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getNamespaceURI + * @nosideeffects + */ +NameList.prototype.getNamespaceURI = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList + */ +function DOMImplementationList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList-length + */ +DOMImplementationList.prototype.length; + +/** + * @param {number} index + * @return {DOMImplementation} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList-item + * @nosideeffects + */ +DOMImplementationList.prototype.item = function(index) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationSource + */ +function DOMImplementationSource() {} + +/** + * @param {string} namespaceURI + * @param {string} publicId + * @param {DocumentType} doctype + * @return {Document} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument + * @nosideeffects + */ +DOMImplementation.prototype.createDocument = function(namespaceURI, publicId, doctype) {}; + +/** + * @param {string} qualifiedName + * @param {string} publicId + * @param {string} systemId + * @return {DocumentType} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocType + * @nosideeffects + */ +DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {}; + +/** + * @param {string} features + * @return {DOMImplementation} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-getDOMImpl + * @nosideeffects + */ +DOMImplementationSource.prototype.getDOMImplementation = function(features) {}; + +/** + * @param {string} features + * @return {DOMImplementationList} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-getDOMImpls + * @nosideeffects + */ +DOMImplementationSource.prototype.getDOMImplementationList = function(features) {}; + +/** + * @param {string} feature + * @param {string} version + * @return {Object} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementation3-getFeature + * @nosideeffects + */ +DOMImplementation.prototype.getFeature = function(feature, version) {}; + +/** + * @param {Node} externalNode + * @return {Node} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-adoptNode + */ +Document.prototype.adoptNode = function(externalNode) {}; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-documentURI + */ +Document.prototype.documentURI; + +/** + * @type {DOMConfiguration} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-domConfig + */ +Document.prototype.domConfig; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-inputEncoding + */ +Document.prototype.inputEncoding; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-strictErrorChecking + */ +Document.prototype.strictErrorChecking; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-encoding + */ +Document.prototype.xmlEncoding; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-standalone + */ +Document.prototype.xmlStandalone; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-version + */ +Document.prototype.xmlVersion; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-normalizeDocument + */ +Document.prototype.normalizeDocument = function() {}; + +/** + * @param {Node} n + * @param {string} namespaceURI + * @param {string} qualifiedName + * @return {Node} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode + */ +Document.prototype.renameNode = function(n, namespaceURI, qualifiedName) {}; + +/** + * @type {?string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-baseURI + */ +Node.prototype.baseURI; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSLocalN + */ +Node.prototype.localName; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSname + */ +Node.prototype.namespaceURI; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSPrefix + */ +Node.prototype.prefix; + +/** + * @type {string} + * @implicitCast + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent + */ +Node.prototype.textContent; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_DISCONNECTED + */ +Node.DOCUMENT_POSITION_DISCONNECTED = 0x01; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_PRECEDING + */ +Node.DOCUMENT_POSITION_PRECEDING = 0x02; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_FOLLOWING + */ +Node.DOCUMENT_POSITION_FOLLOWING = 0x04; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_CONTAINS + */ +Node.DOCUMENT_POSITION_CONTAINS = 0x08; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_CONTAINED_BY + */ +Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + */ +Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; + +/** + * @param {Node} other + * @return {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition + * @nosideeffects + */ +Node.prototype.compareDocumentPosition = function(other) {}; + +/** + * @param {string} feature + * @param {string} version + * @return {Object} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-getFeature + * @nosideeffects + */ +Node.prototype.getFeature = function(feature, version) {}; + +/** + * @param {string} key + * @return {Object} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-getUserData + * @nosideeffects + */ +Node.prototype.getUserData = function(key) {}; + +/** + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeHasAttrs + * @nosideeffects + */ +Node.prototype.hasAttributes = function() {}; + +/** + * @param {string} namespaceURI + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace + * @nosideeffects + */ +Node.prototype.isDefaultNamespace = function(namespaceURI) {}; + +/** + * @param {Node} arg + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode + * @nosideeffects + */ +Node.prototype.isEqualNode = function(arg) {}; + +/** + * @param {Node} other + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isSameNode + * @nosideeffects + */ +Node.prototype.isSameNode = function(other) {}; + +/** + * @param {string} feature + * @param {string} version + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-Node-supports + * @nosideeffects + */ +Node.prototype.isSupported = function(feature, version) {}; + +/** + * @param {string} prefix + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI + * @nosideeffects + */ +Node.prototype.lookupNamespaceURI = function(prefix) {}; + +/** + * @param {string} namespaceURI + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix + * @nosideeffects + */ +Node.prototype.lookupPrefix = function(namespaceURI) {}; + +/** + * @return undefined + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-normalize + */ +Node.prototype.normalize = function() {}; + +/** + * @param {Object} key + * @param {Object} data + * @param {UserDataHandler} handler + * @return {Object} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-setUserData' + */ +Node.prototype.setUserData = function(key, data, handler) {}; + +/** + * @param {string} query + * @return {Node} + * @see http://www.w3.org/TR/selectors-api/#queryselector + * @nosideeffects + */ +Node.prototype.querySelector = function(query) {}; + +/** + * @param {string} query + * @return {!NodeList} + * @see http://www.w3.org/TR/selectors-api/#queryselectorall + * @nosideeffects + */ +Node.prototype.querySelectorAll = function(query) {}; + +/** + * @type {Element} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-ownerElement + */ +Attr.prototype.ownerElement; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-isId + */ +Attr.prototype.isId; + +/** + * @type {TypeInfo} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-schemaTypeInfo + */ +Attr.prototype.schemaTypeInfo; + +/** + * @type {TypeInfo} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Element-schemaTypeInfo + */ +Element.prototype.schemaTypeInfo; + +/** + * @param {string} namespaceURI + * @param {string} localName + * @return {Attr} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElGetAtNodeNS + * @nosideeffects + */ +Element.prototype.getAttributeNodeNS = function(namespaceURI, localName) {}; + +/** + * @param {string} namespaceURI + * @param {string} localName + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElGetAttrNS + * @nosideeffects + */ +Element.prototype.getAttributeNS = function(namespaceURI, localName) {}; + +/** + * @param {string} namespaceURI + * @param {string} localName + * @return {!NodeList} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-A6C90942 + * @nosideeffects + */ +Element.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {}; + +/** + * @param {string} name + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElHasAttr + * @nosideeffects + */ +Element.prototype.hasAttribute = function(name) {}; + +/** + * @param {string} namespaceURI + * @param {string} localName + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElHasAttrNS + * @nosideeffects + */ +Element.prototype.hasAttributeNS = function(namespaceURI, localName) {}; + +/** + * @param {string} namespaceURI + * @param {string} localName + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElRemAtNS + */ +Element.prototype.removeAttributeNS = function(namespaceURI, localName) {}; + +/** + * @param {Attr} newAttr + * @return {Attr} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAtNodeNS + */ +Element.prototype.setAttributeNodeNS = function(newAttr) {}; + +/** + * @param {string} namespaceURI + * @param {string} qualifiedName + * @param {string|number|boolean} value Values are converted to strings with + * ToString, so we accept number and boolean since both convert easily to + * strings. + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAttrNS + */ +Element.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {}; + +/** + * @param {string} name + * @param {boolean} isId + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttr + */ +Element.prototype.setIdAttribute = function(name, isId) {}; + +/** + * @param {Attr} idAttr + * @param {boolean} isId + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttrNode + */ +Element.prototype.setIdAttributeNode = function(idAttr, isId) {}; + +/** + * @param {string} namespaceURI + * @param {string} localName + * @param {boolean} isId + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttrNS + */ +Element.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {}; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Text3-wholeText + */ +Text.prototype.wholeText; + +/** + * @param {string} newText + * @return {Text} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Text3-replaceWholeText + */ +Text.prototype.replaceWholeText = function(newText) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo + */ +function TypeInfo() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_EXTENSION + */ +TypeInfo.prototype.DERIVATION_EXTENSION; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_LIST + */ +TypeInfo.prototype.DERIVATION_LIST; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_RESTRICTION + */ +TypeInfo.prototype.DERIVATION_RESTRICTION; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_UNION + */ +TypeInfo.prototype.DERIVATION_UNION; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-typeName + */ +TypeInfo.prototype.typeName; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-typeNamespace + */ +TypeInfo.prototype.typeNamespace; + +/** + * @param {string} typeNamespaceArg + * @param {string} typeNameArg + * @param {number} derivationMethod + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom + * @nosideeffects + */ +TypeInfo.prototype.isDerivedFrom = function(typeNamespaceArg, typeNameArg, derivationMethod) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler + */ +function UserDataHandler() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-CLONED + */ +UserDataHandler.prototype.NODE_CLONED = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-IMPORTED + */ +UserDataHandler.prototype.NODE_IMPORTED = 2; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-DELETED + */ +UserDataHandler.prototype.NODE_DELETED = 3; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-RENAMED + */ +UserDataHandler.prototype.NODE_RENAMED = 4; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-ADOPTED + */ +UserDataHandler.prototype.NODE_ADOPTED = 5; + +/** + * @param {number} operation + * @param {string} key + * @param {*=} opt_data + * @param {?Node=} opt_src + * @param {?Node=} opt_dst + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-handleUserDataEvent + */ +UserDataHandler.prototype.handle = function(operation, key, opt_data, + opt_src, opt_dst) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMError + */ +function DOMError() {} + +/** + * @type {DOMLocator} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-location + */ +DOMError.prototype.location; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-message + */ +DOMError.prototype.message; + +/** + * @type {Object} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-relatedData + */ +DOMError.prototype.relatedData; + +/** + * @type {Object} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-relatedException + */ +DOMError.prototype.relatedException; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-warning + */ +DOMError.SEVERITY_WARNING = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-error + */ +DOMError.SEVERITY_ERROR = 2; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-fatal-error + */ +DOMError.SEVERITY_FATAL_ERROR = 3; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity + */ +DOMError.prototype.severity; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-type + */ +DOMError.prototype.type; + +/** + * @type {string} + * @see http://www.w3.org/TR/dom/#domerror + */ +DOMError.prototype.name; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMErrorHandler + */ +function DOMErrorHandler() {} + +/** + * @param {DOMError} error + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ERRORS-DOMErrorHandler-handleError + */ +DOMErrorHandler.prototype.handleError = function(error) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Interfaces-DOMLocator + */ +function DOMLocator() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-byteOffset + */ +DOMLocator.prototype.byteOffset; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-column-number + */ +DOMLocator.prototype.columnNumber; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-line-number + */ +DOMLocator.prototype.lineNumber; + +/** + * @type {Node} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-node + */ +DOMLocator.prototype.relatedNode; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-uri + */ +DOMLocator.prototype.uri; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-utf16Offset + */ +DOMLocator.prototype.utf16Offset; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration + */ +function DOMConfiguration() {} + +/** + * @type {DOMStringList} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-parameterNames + */ +DOMConfiguration.prototype.parameterNames; + +/** + * @param {string} name + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-canSetParameter + * @nosideeffects + */ +DOMConfiguration.prototype.canSetParameter = function(name) {}; + +/** + * @param {string} name + * @return {*} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-getParameter + * @nosideeffects + */ +DOMConfiguration.prototype.getParameter = function(name) {}; + +/** + * @param {string} name + * @param {*} value + * @return {*} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-property + */ +DOMConfiguration.prototype.setParameter = function(name, value) {}; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-internalSubset + */ +DocumentType.prototype.internalSubset; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-publicId + */ +DocumentType.prototype.publicId; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-systemId + */ +DocumentType.prototype.systemId; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-inputEncoding + */ +Entity.prototype.inputEncoding; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-encoding + */ +Entity.prototype.xmlEncoding; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-version + */ +Entity.prototype.xmlVersion; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js new file mode 100644 index 000000000..ee4b4589a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js @@ -0,0 +1,56 @@ +/* + * Copyright 2009 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for DOM Element Traversal interface. + * This file depends on w3c_dom1.js. + * The whole file has been fully type annotated. + * Created from: + * http://www.w3.org/TR/ElementTraversal/#ecmascript-bindings + * + * @externs + * @author arv@google.com (Erik Arvidsson) + */ + +/** + * @type {Element} + * @see https://developer.mozilla.org/En/DOM/Element.firstElementChild + */ +Element.prototype.firstElementChild; + +/** + * @type {Element} + * @see https://developer.mozilla.org/En/DOM/Element.lastElementChild + */ +Element.prototype.lastElementChild; + +/** + * @type {Element} + * @see https://developer.mozilla.org/En/DOM/Element.previousElementSibling + */ +Element.prototype.previousElementSibling; + +/** + * @type {Element} + * @see https://developer.mozilla.org/En/DOM/Element.nextElementSibling + */ +Element.prototype.nextElementSibling; + +/** + * @type {number} + * @see https://developer.mozilla.org/En/DOM/Element.childElementCount + */ +Element.prototype.childElementCount; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js new file mode 100644 index 000000000..947821a90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js @@ -0,0 +1,54 @@ +/* + * Copyright 2015 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's Encoding specification + * https://encoding.spec.whatwg.org + * @externs + */ + +/** + * @constructor + * @param {string=} encoding + * @param {Object=} options + */ +function TextDecoder(encoding, options) {} + +/** @type {string} **/ TextDecoder.prototype.encoding; +/** @type {boolean} **/ TextDecoder.prototype.fatal; +/** @type {boolean} **/ TextDecoder.prototype.ignoreBOM; + +/** + * @param {!Uint8Array} input + * @param {Object=} options + * @return {string} + */ +TextDecoder.prototype.decode = function decode(input, options) {}; + +/** + * @constructor + * @param {string=} encoding + * @param {Object=} options + */ +function TextEncoder(encoding, options) {} + +/** @type {string} **/ TextEncoder.prototype.encoding; + +/** + * @param {string} input + * @return {!Uint8Array} + */ +TextEncoder.prototype.encode = function(input) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js new file mode 100644 index 000000000..7c72dd183 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js @@ -0,0 +1,372 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's event specification. + * The whole file has been fully type annotated. + * Created from + * http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html + * + * @externs + */ + + +/** + * @interface + */ +function EventTarget() {} + +/** + * @param {string} type + * @param {EventListener|function(!Event):(boolean|undefined)} listener + * @param {boolean} useCapture + * @return {undefined} + */ +EventTarget.prototype.addEventListener = function(type, listener, useCapture) + {}; + +/** + * @param {string} type + * @param {EventListener|function(!Event):(boolean|undefined)} listener + * @param {boolean} useCapture + * @return {undefined} + */ +EventTarget.prototype.removeEventListener = function(type, listener, useCapture) + {}; + +/** + * @param {!Event} evt + * @return {boolean} + */ +EventTarget.prototype.dispatchEvent = function(evt) {}; + +/** + * @interface + */ +function EventListener() {} + +/** + * @param {!Event} evt + * @return {undefined} + */ +EventListener.prototype.handleEvent = function(evt) {}; + +// The EventInit interface and the parameters to the Event constructor are part +// of DOM Level 3 (suggested) and the DOM "Living Standard" (mandated). They are +// included here as externs cannot be redefined. The same applies to other +// *EventInit interfaces and *Event constructors throughout this file. See: +// http://www.w3.org/TR/DOM-Level-3-Events/#event-initializers +// http://dom.spec.whatwg.org/#constructing-events +// https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#event-constructors + +/** + * @typedef {{ + * bubbles: (boolean|undefined), + * cancelable: (boolean|undefined) + * }} + */ +var EventInit; + +/** + * @constructor + * @param {string} type + * @param {EventInit=} opt_eventInitDict + */ +function Event(type, opt_eventInitDict) {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html + */ +Event.AT_TARGET; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html + */ +Event.BUBBLING_PHASE; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html + */ +Event.CAPTURING_PHASE; + + +/** @type {string} */ +Event.prototype.type; + +/** @type {EventTarget} */ +Event.prototype.target; + +/** @type {EventTarget} */ +Event.prototype.currentTarget; + +/** @type {number} */ +Event.prototype.eventPhase; + +/** @type {boolean} */ +Event.prototype.bubbles; + +/** @type {boolean} */ +Event.prototype.cancelable; + +/** @type {number} */ +Event.prototype.timeStamp; + +/** + * Present for events spawned in browsers that support shadow dom. + * @type {Array.|undefined} + */ +Event.prototype.path; + +/** + * @return {undefined} + */ +Event.prototype.stopPropagation = function() {}; + +/** + * @return {undefined} + */ +Event.prototype.preventDefault = function() {}; + +/** + * @param {string} eventTypeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @return {undefined} + */ +Event.prototype.initEvent = function(eventTypeArg, canBubbleArg, cancelableArg) {}; + +/** + * @typedef {{ + * bubbles: (boolean|undefined), + * cancelable: (boolean|undefined), + * detail: * + * }} + */ +var CustomEventInit; + +/** + * @constructor + * @extends {Event} + * @param {string} type + * @param {CustomEventInit=} opt_eventInitDict + * @see http://www.w3.org/TR/DOM-Level-3-Events/#interface-CustomEvent + */ +function CustomEvent(type, opt_eventInitDict) {} + +/** + * @param {string} eventType + * @param {boolean} bubbles + * @param {boolean} cancelable + * @param {*} detail + */ +CustomEvent.prototype.initCustomEvent = function( + eventType, bubbles, cancelable, detail) {}; + +/** + * @type {*} + */ +CustomEvent.prototype.detail; + +/** + * @interface + */ +function DocumentEvent() {} + +/** + * @param {string} eventType + * @return {!Event} + */ +DocumentEvent.prototype.createEvent = function(eventType) {}; + +/** + * @typedef {{ + * bubbles: (boolean|undefined), + * cancelable: (boolean|undefined), + * view: (Window|undefined), + * detail: (number|undefined) + * }} + */ +var UIEventInit; + +/** + * @constructor + * @extends {Event} + * @param {string} type + * @param {UIEventInit=} opt_eventInitDict + */ +function UIEvent(type, opt_eventInitDict) {} + +/** @type {number} */ +UIEvent.prototype.detail; + +/** + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {Window} viewArg + * @param {number} detailArg + * @return {undefined} + */ +UIEvent.prototype.initUIEvent = function(typeArg, canBubbleArg, cancelableArg, + viewArg, detailArg) {}; + +/** + * @typedef {{ + * bubbles: (boolean|undefined), + * cancelable: (boolean|undefined), + * view: (Window|undefined), + * detail: (number|undefined), + * screenX: (number|undefined), + * screenY: (number|undefined), + * clientX: (number|undefined), + * clientY: (number|undefined), + * ctrlKey: (boolean|undefined), + * shiftKey: (boolean|undefined), + * altKey: (boolean|undefined), + * metaKey: (boolean|undefined), + * button: (number|undefined), + * buttons: (number|undefined), + * relatedTarget: (EventTarget|undefined) + * }} + */ +var MouseEventInit; + +/** + * @constructor + * @extends {UIEvent} + * @param {string} type + * @param {MouseEventInit=} opt_eventInitDict + */ +function MouseEvent(type, opt_eventInitDict) {} + +/** @type {number} */ +MouseEvent.prototype.screenX; + +/** @type {number} */ +MouseEvent.prototype.screenY; + +/** @type {number} */ +MouseEvent.prototype.clientX; + +/** @type {number} */ +MouseEvent.prototype.clientY; + +/** @type {boolean} */ +MouseEvent.prototype.ctrlKey; + +/** @type {boolean} */ +MouseEvent.prototype.shiftKey; + +/** @type {boolean} */ +MouseEvent.prototype.altKey; + +/** @type {boolean} */ +MouseEvent.prototype.metaKey; + +/** @type {number} */ +MouseEvent.prototype.button; + +/** @type {EventTarget} */ +MouseEvent.prototype.relatedTarget; + + +/** + * @constructor + * @extends {Event} + */ +function MutationEvent() {} + +/** @type {Node} */ +MutationEvent.prototype.relatedNode; + +/** @type {string} */ +MutationEvent.prototype.prevValue; + +/** @type {string} */ +MutationEvent.prototype.newValue; + +/** @type {string} */ +MutationEvent.prototype.attrName; + +/** @type {number} */ +MutationEvent.prototype.attrChange; + +/** + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {Node} relatedNodeArg + * @param {string} prevValueArg + * @param {string} newValueArg + * @param {string} attrNameArg + * @param {number} attrChangeArg + * @return {undefined} + */ +MutationEvent.prototype.initMutationEvent = function(typeArg, canBubbleArg, cancelableArg, relatedNodeArg, prevValueArg, newValueArg, attrNameArg, attrChangeArg) {}; + + +// DOM3 +/** + * @typedef {{ + * bubbles: (boolean|undefined), + * cancelable: (boolean|undefined), + * view: (Window|undefined), + * detail: (number|undefined), + * char: (string|undefined), + * key: (string|undefined), + * code: (string|undefined), + * location: (number|undefined), + * ctrlKey: (boolean|undefined), + * shiftKey: (boolean|undefined), + * altKey: (boolean|undefined), + * metaKey: (boolean|undefined), + * repeat: (boolean|undefined), + * locale: (string|undefined) + * }} + */ +var KeyboardEventInit; + +/** + * @constructor + * @extends {UIEvent} + * @param {string} type + * @param {KeyboardEventInit=} opt_eventInitDict + */ +function KeyboardEvent(type, opt_eventInitDict) {} + +/** @type {string} */ +KeyboardEvent.prototype.keyIdentifier; + +/** @type {boolean} */ +KeyboardEvent.prototype.ctrlKey; + +/** @type {boolean} */ +KeyboardEvent.prototype.shiftKey; + +/** @type {boolean} */ +KeyboardEvent.prototype.altKey; + +/** @type {boolean} */ +KeyboardEvent.prototype.metaKey; + +/** + * @param {string} keyIdentifierArg + * @return {boolean} + */ +KeyboardEvent.prototype.getModifierState = function(keyIdentifierArg) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js new file mode 100644 index 000000000..e98716e2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js @@ -0,0 +1,63 @@ +/* + * Copyright 2010 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's event Level 3 specification. + * This file depends on w3c_event.js. + * The whole file has been partially type annotated. + * Created from + * http://www.w3.org/TR/DOM-Level-3-Events/#ecma-script-binding-ecma-binding + * + * @externs + */ + +/** + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {Window} viewArg + * @param {string} keyIdentifierArg + * @param {number} keyLocationArg + * @param {string} modifiersList + */ +KeyboardEvent.prototype.initKeyboardEvent = function(typeArg, canBubbleArg, cancelableArg, viewArg, keyIdentifierArg, keyLocationArg, modifiersList) {}; + +/** @type {string} */ +KeyboardEvent.prototype.char; + +/** @type {string} */ +KeyboardEvent.prototype.key; + +/** @type {number} */ +KeyboardEvent.prototype.location; + +/** @type {boolean} */ +KeyboardEvent.prototype.repeat; + +/** @type {string} */ +KeyboardEvent.prototype.locale; + +/** @type {number} */ +MouseEvent.prototype.buttons; + +/** @type {boolean} */ +Event.prototype.defaultPrevented; + +/** @type {string} */ +Event.prototype.namespaceURI; + +/** @return {undefined} */ +Event.prototype.stopImmediatePropagation = function() {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js new file mode 100644 index 000000000..0b9db0913 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js @@ -0,0 +1,101 @@ +/* + * Copyright 2009 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's Geolocation specification + * http://www.w3.org/TR/geolocation-API/ + * @externs + */ + +/** + * @constructor + * @see http://www.w3.org/TR/geolocation-API/#geolocation + */ +function Geolocation() {} + +/** + * @param {function(GeolocationPosition)} successCallback + * @param {(function(GeolocationPositionError)|null)=} opt_errorCallback + * @param {GeolocationPositionOptions=} opt_options + */ +Geolocation.prototype.getCurrentPosition = function(successCallback, + opt_errorCallback, + opt_options) {}; + +/** + * @param {function(GeolocationPosition)} successCallback + * @param {(function(GeolocationPositionError)|null)=} opt_errorCallback + * @param {GeolocationPositionOptions=} opt_options + * @return {number} + */ +Geolocation.prototype.watchPosition = function(successCallback, + opt_errorCallback, + opt_options) {}; + +/** @param {number} watchId */ +Geolocation.prototype.clearWatch = function(watchId) {}; + + +/** + * @constructor + * @see http://www.w3.org/TR/geolocation-API/#coordinates + */ +function GeolocationCoordinates() {} +/** @type {number} */ GeolocationCoordinates.prototype.latitude; +/** @type {number} */ GeolocationCoordinates.prototype.longitude; +/** @type {number} */ GeolocationCoordinates.prototype.accuracy; +/** @type {number} */ GeolocationCoordinates.prototype.altitude; +/** @type {number} */ GeolocationCoordinates.prototype.altitudeAccuracy; +/** @type {number} */ GeolocationCoordinates.prototype.heading; +/** @type {number} */ GeolocationCoordinates.prototype.speed; + + +/** + * @constructor + * @see http://www.w3.org/TR/geolocation-API/#position + */ +function GeolocationPosition() {} +/** @type {GeolocationCoordinates} */ +GeolocationPosition.prototype.coords; +/** @type {Date} */ GeolocationPosition.prototype.timestamp; + + +/** + * @constructor + * @see http://www.w3.org/TR/geolocation-API/#position-options + */ +function GeolocationPositionOptions() {} +/** @type {boolean} */ +GeolocationPositionOptions.prototype.enableHighAccuracy; +/** @type {number} */ GeolocationPositionOptions.prototype.maximumAge; +/** @type {number} */ GeolocationPositionOptions.prototype.timeout; + + +/** + * @constructor + * @see http://www.w3.org/TR/geolocation-API/#position-error + */ +function GeolocationPositionError() {} +/** @type {number} */ GeolocationPositionError.prototype.code; +/** @type {string} */ GeolocationPositionError.prototype.message; +/** @type {number} */ GeolocationPositionError.prototype.UNKNOWN_ERROR; +/** @type {number} */ GeolocationPositionError.prototype.PERMISSION_DENIED; +/** @type {number} */ +GeolocationPositionError.prototype.POSITION_UNAVAILABLE; +/** @type {number} */ GeolocationPositionError.prototype.TIMEOUT; + +/** @type {Geolocation} */ +Navigator.prototype.geolocation; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js new file mode 100644 index 000000000..19c35ec1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js @@ -0,0 +1,914 @@ +/* + * Copyright 2011 The Closure Compiler Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's IndexedDB API. In Chrome all the + * IndexedDB classes are prefixed with 'webkit'. In order to access constants + * and static methods of these classes they must be duplicated with the + * prefix here. + * @see http://www.w3.org/TR/IndexedDB/ + * + * @externs + * @author guido.tapia@picnet.com.au (Guido Tapia) + */ + +/** @type {IDBFactory} */ +Window.prototype.moz_indexedDB; + +/** @type {IDBFactory} */ +Window.prototype.mozIndexedDB; + +/** @type {IDBFactory} */ +Window.prototype.webkitIndexedDB; + +/** @type {IDBFactory} */ +Window.prototype.msIndexedDB; + +/** @type {IDBFactory} */ +Window.prototype.indexedDB; + +/** + * @constructor + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBFactory + */ +function IDBFactory() {} + +/** + * @param {string} name The name of the database to open. + * @param {number=} opt_version The version at which to open the database. + * @return {!IDBOpenDBRequest} The IDBRequest object. + */ +IDBFactory.prototype.open = function(name, opt_version) {}; + +/** + * @param {string} name The name of the database to delete. + * @return {!IDBOpenDBRequest} The IDBRequest object. + */ +IDBFactory.prototype.deleteDatabase = function(name) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabaseException + */ +function IDBDatabaseException() {} + +/** + * @constructor + * @extends {IDBDatabaseException} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabaseException + */ +function webkitIDBDatabaseException() {} + +/** + * @const + * @type {number} + */ +IDBDatabaseException.UNKNOWN_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.UNKNOWN_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.NON_TRANSIENT_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.NON_TRANSIENT_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.NOT_FOUND_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.NOT_FOUND_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.CONSTRAINT_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.CONSTRAINT_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.DATA_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.DATA_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.NOT_ALLOWED_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.NOT_ALLOWED_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.TRANSACTION_INACTIVE_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.TRANSACTION_INACTIVE_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.ABORT_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.ABORT_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.READ_ONLY_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.READ_ONLY_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.TIMEOUT_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.TIMEOUT_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.QUOTA_ERR; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.QUOTA_ERR; + +/** + * @const + * @type {number} + */ +IDBDatabaseException.prototype.code; + +/** + * @const + * @type {number} + */ +webkitIDBDatabaseException.prototype.code; + +/** + * @const + * @type {string} + */ +IDBDatabaseException.prototype.message; + +/** + * @const + * @type {string} + */ +webkitIDBDatabaseException.prototype.message; + +/** + * @constructor + * @implements {EventTarget} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest + */ +function IDBRequest() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +IDBRequest.prototype.addEventListener = + function(type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +IDBRequest.prototype.removeEventListener = + function(type, listener, opt_useCapture) {}; + +/** @override */ +IDBRequest.prototype.dispatchEvent = function(evt) {}; + +/** + * @constructor + * @extends {IDBRequest} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest + */ +function webkitIDBRequest() {} + +/** + * @type {number} + * @const + */ +IDBRequest.LOADING; + +/** + * @type {number} + * @const + */ +webkitIDBRequest.LOADING; + +/** + * @type {number} + * @const + */ +IDBRequest.DONE; + +/** + * @type {number} + * @const + */ +webkitIDBRequest.DONE; + +/** @type {number} */ +IDBRequest.prototype.readyState; // readonly + +/** @type {function(!Event)} */ +IDBRequest.prototype.onsuccess = function(e) {}; + +/** @type {function(!Event)} */ +IDBRequest.prototype.onerror = function(e) {}; + +/** @type {*} */ +IDBRequest.prototype.result; // readonly + +/** + * @type {number} + * @deprecated Use "error" + */ +IDBRequest.prototype.errorCode; // readonly + + +/** @type {!DOMError} */ +IDBRequest.prototype.error; // readonly + +/** @type {Object} */ +IDBRequest.prototype.source; // readonly + +/** @type {IDBTransaction} */ +IDBRequest.prototype.transaction; // readonly + +/** + * @constructor + * @extends {IDBRequest} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBOpenDBRequest + */ +function IDBOpenDBRequest() {} + +/** + * @type {function(!IDBVersionChangeEvent)} + */ +IDBOpenDBRequest.prototype.onblocked = function(e) {}; + +/** + * @type {function(!IDBVersionChangeEvent)} + */ +IDBOpenDBRequest.prototype.onupgradeneeded = function(e) {}; + +/** + * @constructor + * @implements {EventTarget} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase + */ +function IDBDatabase() {} + +/** + * @type {string} + * @const + */ +IDBDatabase.prototype.name; + +/** + * @type {string} + * @const + */ +IDBDatabase.prototype.description; + +/** + * @type {string} + * @const + */ +IDBDatabase.prototype.version; + +/** + * @type {DOMStringList} + * @const + */ +IDBDatabase.prototype.objectStoreNames; + +/** + * @param {string} name The name of the object store. + * @param {Object=} opt_parameters Parameters to be passed + * creating the object store. + * @return {!IDBObjectStore} The created/open object store. + */ +IDBDatabase.prototype.createObjectStore = + function(name, opt_parameters) {}; + +/** + * @param {string} name The name of the object store to remove. + */ +IDBDatabase.prototype.deleteObjectStore = function(name) {}; + +/** + * @param {string} version The new version of the database. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBDatabase.prototype.setVersion = function(version) {}; + +/** + * @param {Array.} storeNames The stores to open in this transaction. + * @param {(number|string)=} mode The mode for opening the object stores. + * @return {!IDBTransaction} The IDBRequest object. + */ +IDBDatabase.prototype.transaction = function(storeNames, mode) {}; + +/** + * Closes the database connection. + */ +IDBDatabase.prototype.close = function() {}; + +/** + * @type {Function} + */ +IDBDatabase.prototype.onabort = function() {}; + +/** + * @type {Function} + */ +IDBDatabase.prototype.onerror = function() {}; + +/** + * @type {Function} + */ +IDBDatabase.prototype.onversionchange = function() {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +IDBDatabase.prototype.addEventListener = + function(type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +IDBDatabase.prototype.removeEventListener = + function(type, listener, opt_useCapture) {}; + +/** @override */ +IDBDatabase.prototype.dispatchEvent = function(evt) {}; + +/** + * Typedef for valid key types according to the w3 specification. Note that this + * is slightly wider than what is actually allowed, as all Array elements must + * have a valid key type. + * @see http://www.w3.org/TR/IndexedDB/#key-construct + * @typedef {number|string|!Date|!Array.} + */ +var IDBKeyType; + +/** + * @constructor + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore + */ +function IDBObjectStore() {} + +/** + * @type {string} + */ +IDBObjectStore.prototype.name; + +/** + * @type {string} + */ +IDBObjectStore.prototype.keyPath; + +/** + * @type {DOMStringList} + */ +IDBObjectStore.prototype.indexNames; + +/** @type {IDBTransaction} */ +IDBObjectStore.prototype.transaction; + +/** @type {boolean} */ +IDBObjectStore.prototype.autoIncrement; + +/** + * @param {*} value The value to put into the object store. + * @param {IDBKeyType=} key The key of this value. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBObjectStore.prototype.put = function(value, key) {}; + +/** + * @param {*} value The value to add into the object store. + * @param {IDBKeyType=} key The key of this value. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBObjectStore.prototype.add = function(value, key) {}; + +/** + * @param {IDBKeyType} key The key of this value. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBObjectStore.prototype.delete = function(key) {}; + +/** + * @param {IDBKeyType|!IDBKeyRange} key The key of the document to retrieve. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBObjectStore.prototype.get = function(key) {}; + +/** + * @return {!IDBRequest} The IDBRequest object. + */ +IDBObjectStore.prototype.clear = function() {}; + +/** + * @param {IDBKeyRange=} range The range of the cursor. + * @param {(number|string)=} direction The direction of cursor enumeration. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBObjectStore.prototype.openCursor = function(range, direction) {}; + +/** + * @param {string} name The name of the index. + * @param {string|!Array.} keyPath The path to the index key. + * @param {Object=} opt_paramters Optional parameters + * for the created index. + * @return {!IDBIndex} The IDBIndex object. + */ +IDBObjectStore.prototype.createIndex = function(name, keyPath, opt_paramters) {}; + +/** + * @param {string} name The name of the index to retrieve. + * @return {!IDBIndex} The IDBIndex object. + */ +IDBObjectStore.prototype.index = function(name) {}; + +/** + * @param {string} indexName The name of the index to remove. + */ +IDBObjectStore.prototype.deleteIndex = function(indexName) {}; + +/** + * @param {(IDBKeyType|IDBKeyRange)=} key The key of this value. + * @return {!IDBRequest} The IDBRequest object. + * @see http://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-count + */ +IDBObjectStore.prototype.count = function(key) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBIndex + */ +function IDBIndex() {} + +/** + * @type {string} + * @const + */ +IDBIndex.prototype.name; + +/** + * @type {!IDBObjectStore} + * @const + */ +IDBIndex.prototype.objectStore; + +/** + * @type {string} + * @const + */ +IDBIndex.prototype.keyPath; + +/** + * @type {boolean} + * @const + */ +IDBIndex.prototype.unique; + +/** + * @param {IDBKeyRange=} range The range of the cursor. + * @param {(number|string)=} direction The direction of cursor enumeration. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBIndex.prototype.openCursor = function(range, direction) {}; + +/** + * @param {IDBKeyRange=} range The range of the cursor. + * @param {(number|string)=} direction The direction of cursor enumeration. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBIndex.prototype.openKeyCursor = function(range, direction) {}; + +/** + * @param {IDBKeyType|!IDBKeyRange} key The id of the object to retrieve. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBIndex.prototype.get = function(key) {}; + +/** + * @param {IDBKeyType|!IDBKeyRange} key The id of the object to retrieve. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBIndex.prototype.getKey = function(key) {}; + +/** + * @constructor + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor + */ +function IDBCursor() {} + +/** + * @constructor + * @extends {IDBCursor} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor + */ +function webkitIDBCursor() {} + +/** + * @const + * @type {number} + */ +IDBCursor.NEXT; + +/** + * @const + * @type {number} + */ +webkitIDBCursor.NEXT; + +/** + * @const + * @type {number} + */ +IDBCursor.NEXT_NO_DUPLICATE; + +/** + * @const + * @type {number} + */ +webkitIDBCursor.NEXT_NO_DUPLICATE; + +/** + * @const + * @type {number} + */ +IDBCursor.PREV; + +/** + * @const + * @type {number} + */ +webkitIDBCursor.PREV; + +/** + * @const + * @type {number} + */ +IDBCursor.PREV_NO_DUPLICATE; + +/** + * @const + * @type {number} + */ +webkitIDBCursor.PREV_NO_DUPLICATE; + +/** + * @type {*} + * @const + */ +IDBCursor.prototype.source; + +/** + * @type {number} + * @const + */ +IDBCursor.prototype.direction; + +/** + * @type {IDBKeyType} + * @const + */ +IDBCursor.prototype.key; + +/** + * @type {number} + * @const + */ +IDBCursor.prototype.primaryKey; + +/** + * @param {*} value The new value for the current object in the cursor. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBCursor.prototype.update = function(value) {}; + +/** + * Note: Must be quoted to avoid parse error. + * @param {IDBKeyType=} key Continue enumerating the cursor from the specified + * key (or next). + */ +IDBCursor.prototype.continue = function(key) {}; + +/** + * @param {number} count Number of times to iterate the cursor. + */ +IDBCursor.prototype.advance = function(count) {}; + +/** + * Note: Must be quoted to avoid parse error. + * @return {!IDBRequest} The IDBRequest object. + */ +IDBCursor.prototype.delete = function() {}; + +/** + * @constructor + * @extends {IDBCursor} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursorWithValue + */ +function IDBCursorWithValue() {} + +/** @type {*} */ +IDBCursorWithValue.prototype.value; // readonly + +/** + * @constructor + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBTransaction + */ +function IDBTransaction() {} + +/** + * @constructor + * @extends {IDBTransaction} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBTransaction + */ +function webkitIDBTransaction() {} + +/** + * @const + * @type {number} + */ +IDBTransaction.READ_WRITE; + +/** + * @const + * @type {number} + */ +webkitIDBTransaction.READ_WRITE; + +/** + * @const + * @type {number} + */ +IDBTransaction.READ_ONLY; + +/** + * @const + * @type {number} + */ +webkitIDBTransaction.READ_ONLY; + +/** + * @const + * @type {number} + */ +IDBTransaction.VERSION_CHANGE; + +/** + * @const + * @type {number} + */ +webkitIDBTransaction.VERSION_CHANGE; + +/** + * @type {number|string} + * @const + */ +IDBTransaction.prototype.mode; + +/** + * @type {IDBDatabase} + * @const + */ +IDBTransaction.prototype.db; + +/** + * @param {string} name The name of the object store to retrieve. + * @return {!IDBObjectStore} The object store. + */ +IDBTransaction.prototype.objectStore = function(name) {}; + +/** + * Aborts the transaction. + */ +IDBTransaction.prototype.abort = function() {}; + +/** + * @type {Function} + */ +IDBTransaction.prototype.onabort = function() {}; + +/** + * @type {Function} + */ +IDBTransaction.prototype.oncomplete = function() {}; + +/** + * @type {Function} + */ +IDBTransaction.prototype.onerror = function() {}; + +/** + * @constructor + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange + */ +function IDBKeyRange() {} + +/** + * @constructor + * @extends {IDBKeyRange} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange + */ +function webkitIDBKeyRange() {} + +/** + * @type {*} + * @const + */ +IDBKeyRange.prototype.lower; + +/** + * @type {*} + * @const + */ +IDBKeyRange.prototype.upper; + +/** + * @type {*} + * @const + */ +IDBKeyRange.prototype.lowerOpen; + +/** + * @type {*} + * @const + */ +IDBKeyRange.prototype.upperOpen; + +/** + * @param {IDBKeyType} value The single key value of this range. + * @return {!IDBKeyRange} The key range. + */ +IDBKeyRange.only = function(value) {}; + +/** + * @param {IDBKeyType} value The single key value of this range. + * @return {!IDBKeyRange} The key range. + */ +webkitIDBKeyRange.only = function(value) {}; + +/** + * @param {IDBKeyType} bound Creates a lower bound key range. + * @param {boolean=} open Open the key range. + * @return {!IDBKeyRange} The key range. + */ +IDBKeyRange.lowerBound = function(bound, open) {}; + +/** + * @param {IDBKeyType} bound Creates a lower bound key range. + * @param {boolean=} open Open the key range. + * @return {!IDBKeyRange} The key range. + */ +webkitIDBKeyRange.lowerBound = function(bound, open) {}; + +/** + * @param {IDBKeyType} bound Creates an upper bound key range. + * @param {boolean=} open Open the key range. + * @return {!IDBKeyRange} The key range. + */ +IDBKeyRange.upperBound = function(bound, open) {}; + +/** + * @param {IDBKeyType} bound Creates an upper bound key range. + * @param {boolean=} open Open the key range. + * @return {!IDBKeyRange} The key range. + */ +webkitIDBKeyRange.upperBound = function(bound, open) {}; + +/** + * @param {IDBKeyType} left The left bound value. + * @param {IDBKeyType} right The right bound value. + * @param {boolean=} openLeft Whether the left bound value should be excluded. + * @param {boolean=} openRight Whether the right bound value should be excluded. + * @return {!IDBKeyRange} The key range. + */ +IDBKeyRange.bound = function(left, right, openLeft, openRight) {}; + +/** + * @param {IDBKeyType} left The left bound value. + * @param {IDBKeyType} right The right bound value. + * @param {boolean=} openLeft Whether the left bound value should be excluded. + * @param {boolean=} openRight Whether the right bound value should be excluded. + * @return {!IDBKeyRange} The key range. + */ +webkitIDBKeyRange.bound = function(left, right, openLeft, openRight) {}; + +/** + * @constructor + * @extends {Event} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBVersionChangeEvent + */ +function IDBVersionChangeEvent() {} + +/** + * @type {number} + * @const + */ +IDBVersionChangeEvent.prototype.oldVersion; + +/** + * @type {?number} + * @const + */ +IDBVersionChangeEvent.prototype.newVersion; + +/** + * @constructor + * @extends {IDBVersionChangeEvent} + * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBVersionChangeEvent + */ +function webkitIDBVersionChangeEvent() {} + +/** + * @type {string} + * @const + */ +webkitIDBVersionChangeEvent.prototype.version; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js new file mode 100644 index 000000000..cf0315e7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js @@ -0,0 +1,161 @@ +/* + * Copyright 2011 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's Navigation Timing specification. + * + * Created from + * @see http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html + * @see http://w3c-test.org/webperf/specs/ResourceTiming + * @see http://www.w3.org/TR/performance-timeline + * + * @externs + */ + +/** @constructor */ +function PerformanceTiming() {} +/** @type {number} */ PerformanceTiming.prototype.navigationStart; +/** @type {number} */ PerformanceTiming.prototype.unloadEventStart; +/** @type {number} */ PerformanceTiming.prototype.unloadEventEnd; +/** @type {number} */ PerformanceTiming.prototype.redirectStart; +/** @type {number} */ PerformanceTiming.prototype.redirectEnd; +/** @type {number} */ PerformanceTiming.prototype.fetchStart; +/** @type {number} */ PerformanceTiming.prototype.domainLookupStart; +/** @type {number} */ PerformanceTiming.prototype.domainLookupEnd; +/** @type {number} */ PerformanceTiming.prototype.connectStart; +/** @type {number} */ PerformanceTiming.prototype.connectEnd; +/** @type {number} */ PerformanceTiming.prototype.secureConnectionStart; +/** @type {number} */ PerformanceTiming.prototype.requestStart; +/** @type {number} */ PerformanceTiming.prototype.responseStart; +/** @type {number} */ PerformanceTiming.prototype.responseEnd; +/** @type {number} */ PerformanceTiming.prototype.domLoading; +/** @type {number} */ PerformanceTiming.prototype.domInteractive; +/** @type {number} */ PerformanceTiming.prototype.domContentLoadedEventStart; +/** @type {number} */ PerformanceTiming.prototype.domContentLoadedEventEnd; +/** @type {number} */ PerformanceTiming.prototype.domComplete; +/** @type {number} */ PerformanceTiming.prototype.loadEventStart; +/** @type {number} */ PerformanceTiming.prototype.loadEventEnd; + +/** @constructor */ +function PerformanceEntry() {} +/** @type {string} */ PerformanceEntry.prototype.name; +/** @type {string} */ PerformanceEntry.prototype.entryType; +/** @type {number} */ PerformanceEntry.prototype.startTime; +/** @type {number} */ PerformanceEntry.prototype.duration; + +/** + * @constructor + * @extends {PerformanceEntry} + */ +function PerformanceResourceTiming() {} +/** @type {number} */ PerformanceResourceTiming.prototype.redirectStart; +/** @type {number} */ PerformanceResourceTiming.prototype.redirectEnd; +/** @type {number} */ PerformanceResourceTiming.prototype.fetchStart; +/** @type {number} */ PerformanceResourceTiming.prototype.domainLookupStart; +/** @type {number} */ PerformanceResourceTiming.prototype.domainLookupEnd; +/** @type {number} */ PerformanceResourceTiming.prototype.connectStart; +/** @type {number} */ PerformanceResourceTiming.prototype.connectEnd; +/** @type {number} */ +PerformanceResourceTiming.prototype.secureConnectionStart; +/** @type {number} */ PerformanceResourceTiming.prototype.requestStart; +/** @type {number} */ PerformanceResourceTiming.prototype.responseStart; +/** @type {number} */ PerformanceResourceTiming.prototype.responseEnd; +/** @type {string} */ PerformanceResourceTiming.prototype.initiatorType; + +/** @constructor */ +function PerformanceNavigation() {} +/** @type {number} */ PerformanceNavigation.prototype.TYPE_NAVIGATE = 0; +/** @type {number} */ PerformanceNavigation.prototype.TYPE_RELOAD = 1; +/** @type {number} */ PerformanceNavigation.prototype.TYPE_BACK_FORWARD = 2; +/** @type {number} */ PerformanceNavigation.prototype.TYPE_RESERVED = 255; +/** @type {number} */ PerformanceNavigation.prototype.type; +/** @type {number} */ PerformanceNavigation.prototype.redirectCount; + +// Only available in WebKit, and only with the --enable-memory-info flag. +/** @constructor */ +function PerformanceMemory() {} +/** @type {number} */ PerformanceMemory.prototype.jsHeapSizeLimit; +/** @type {number} */ PerformanceMemory.prototype.totalJSHeapSize; +/** @type {number} */ PerformanceMemory.prototype.usedJSHeapSize; + +/** @constructor */ +function Performance() {} +/** @type {PerformanceTiming} */ Performance.prototype.timing; +/** @type {PerformanceNavigation} */ Performance.prototype.navigation; + +/** + * Clears the buffer used to store the current list of + * PerformanceResourceTiming resources. + * @return {undefined} + */ +Performance.prototype.clearResourceTimings = function() {}; + +/** + * Clear out the buffer of performance timing events for webkit browsers. + * @return {undefined} + */ +Performance.prototype.webkitClearResourceTimings = function() {}; + +/** + * Set the maximum number of PerformanceResourceTiming resources that may be + * stored in the buffer. + * @param {number} maxSize + */ +Performance.prototype.setResourceTimingBufferSize = function(maxSize) {}; + +/** + * @return {Array.} A copy of the PerformanceEntry list, + * in chronological order with respect to startTime. + * @nosideeffects + */ +Performance.prototype.getEntries = function() {}; + +/** + * @param {string} entryType Only return {@code PerformanceEntry}s with this + * entryType. + * @return {Array.} A copy of the PerformanceEntry list, + * in chronological order with respect to startTime. + * @nosideeffects + */ +Performance.prototype.getEntriesByType = function(entryType) {}; + +/** + * @param {string} name Only return {@code PerformanceEntry}s with this name. + * @param {string=} opt_entryType Only return {@code PerformanceEntry}s with + * this entryType. + * @return {Array.} PerformanceEntry list in chronological + * order with respect to startTime. + * @nosideeffects + */ +Performance.prototype.getEntriesByName = function(name, opt_entryType) {}; + +// Only available in WebKit, and only with the --enable-memory-info flag. +/** @type {PerformanceMemory} */ Performance.prototype.memory; + +/** + * @return {number} + * @nosideeffects + */ +Performance.prototype.now = function() {}; + +/** + * @return {number} + * @nosideeffects + */ +Performance.prototype.webkitNow = function() {}; + +/** @type {Performance} */ +Window.prototype.performance; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js new file mode 100644 index 000000000..fb79fd236 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js @@ -0,0 +1,248 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's range specification. + * This file depends on w3c_dom2.js. + * The whole file has been fully type annotated. + * Created from + * http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html + * + * @externs + * @author stevey@google.com (Steve Yegge) + */ + + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Interface + */ +function Range() {} + +/** + * @type {Node} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-startParent + */ +Range.prototype.startContainer; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-startOffset + */ +Range.prototype.startOffset; + +/** + * @type {Node} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-endParent + */ +Range.prototype.endContainer; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-endOffset + */ +Range.prototype.endOffset; + +/** + * @type {boolean} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-collapsed + */ +Range.prototype.collapsed; + +/** + * @type {Node} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-commonParent + */ +Range.prototype.commonAncestorContainer; + +/** + * @param {Node} refNode + * @param {number} offset + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setStart + */ +Range.prototype.setStart = function(refNode, offset) {}; + +/** + * @param {Node} refNode + * @param {number} offset + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEnd + */ +Range.prototype.setEnd = function(refNode, offset) {}; + +/** + * @param {Node} refNode + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-setStartBefore + */ +Range.prototype.setStartBefore = function(refNode) {}; + +/** + * @param {Node} refNode + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setStartAfter + */ +Range.prototype.setStartAfter = function(refNode) {}; + +/** + * @param {Node} refNode + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEndBefore + */ +Range.prototype.setEndBefore = function(refNode) {}; + +/** + * @param {Node} refNode + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEndAfter + */ +Range.prototype.setEndAfter = function(refNode) {}; + +/** + * @param {boolean} toStart + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-collapse + */ +Range.prototype.collapse = function(toStart) {}; + +/** + * @param {Node} refNode + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-selectNode + */ +Range.prototype.selectNode = function(refNode) {}; + +/** + * @param {Node} refNode + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-selectNodeContents + */ +Range.prototype.selectNodeContents = function(refNode) {}; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow + */ +Range.prototype.START_TO_START = 0; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow + */ +Range.prototype.START_TO_END = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow + */ +Range.prototype.END_TO_END = 2; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow + */ +Range.prototype.END_TO_START = 3; + +/** + * @param {number} how + * @param {Range} sourceRange + * @return {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-compareBoundaryPoints + */ +Range.prototype.compareBoundaryPoints = function(how, sourceRange) {}; + +/** + * @return {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-deleteContents + */ +Range.prototype.deleteContents = function() {}; + +/** + * @return {DocumentFragment} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-extractContents + */ +Range.prototype.extractContents = function() {}; + +/** + * @return {DocumentFragment} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-cloneContents + */ +Range.prototype.cloneContents = function() {}; + +/** + * @param {Node} newNode + * @return {DocumentFragment} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-insertNode + */ +Range.prototype.insertNode = function(newNode) {}; + +/** + * @param {Node} newParent + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-surroundContents + */ +Range.prototype.surroundContents = function(newParent) {}; + +/** + * @return {Range} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-clone + */ +Range.prototype.cloneRange = function() {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-detach + */ +Range.prototype.detach = function() {}; + +// Introduced in DOM Level 2: +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-DocumentRange-idl + */ +function DocumentRange() {} + +/** + * @return {Range} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-DocumentRange-method-createRange + */ +DocumentRange.prototype.createRange = function() {}; + +// Introduced in DOM Level 2: +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeException + */ +function RangeException() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode + */ +RangeException.prototype.code; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode + */ +RangeException.prototype.BAD_BOUNDARYPOINTS_ERR = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode + */ +RangeException.prototype.INVALID_NODE_TYPE_ERR = 2; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js new file mode 100644 index 000000000..f10971f91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js @@ -0,0 +1,1002 @@ +/* + * Copyright 2012 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for components of the WebRTC browser API. + * @see http://dev.w3.org/2011/webrtc/editor/webrtc.html + * @see http://tools.ietf.org/html/draft-ietf-rtcweb-jsep-01 + * @see http://www.w3.org/TR/mediacapture-streams/ + * + * @externs + * @author bemasc@google.com (Benjamin M. Schwartz) + */ + +/** + * @typedef {string} + * @see {http://dev.w3.org/2011/webrtc/editor/getusermedia.html + * #idl-def-MediaStreamTrackState} + * In WebIDL this is an enum with values 'live', 'mute', and 'ended', + * but there is no mechanism in Closure for describing a specialization of + * the string type. + */ +var MediaStreamTrackState; + +/** + * @interface + */ +function SourceInfo() {} + +/** @const {string} */ +SourceInfo.prototype.kind; + +/** @const {string} */ +SourceInfo.prototype.id; + +/** @const {?string} */ +SourceInfo.prototype.label; + +/** @const {boolean} */ +SourceInfo.prototype.facing; + +/** + * @interface + * @see http://www.w3.org/TR/mediacapture-streams/#mediastreamtrack + */ +function MediaStreamTrack() {} + +/** + * @param {!function(!Array.)} callback + */ +MediaStreamTrack.getSources = function(callback) {}; + +/** + * @type {string} + * @const + */ +MediaStreamTrack.prototype.kind; + +/** + * @type {string} + * @const + */ +MediaStreamTrack.prototype.id; + +/** + * @type {string} + * @const + */ +MediaStreamTrack.prototype.label; + +/** + * @type {boolean} + */ +MediaStreamTrack.prototype.enabled; + +/** + * @type {MediaStreamTrackState} + * Read only. + */ +MediaStreamTrack.prototype.readyState; + +/** + * @type {?function(!Event)} + */ +MediaStreamTrack.prototype.onmute; + +/** + * @type {?function(!Event)} + */ +MediaStreamTrack.prototype.onunmute; + +/** + * @type {?function(!Event)} + */ +MediaStreamTrack.prototype.onended; + +/** + * @return {!MediaStreamTrack} + */ +MediaStreamTrack.prototype.clone = function() {}; + +/** @return {void} */ +MediaStreamTrack.prototype.stop = function() {}; + +/** + * @constructor + * @extends {Event} + * @private + * @see http://dev.w3.org/2011/webrtc/editor/ + * webrtc-20120720.html#mediastreamtrackevent + * TODO(bemasc): Update this link to the final definition once one exists + * (https://www.w3.org/Bugs/Public/show_bug.cgi?id=19568) + */ +function MediaStreamTrackEvent() {} + +/** + * @type {!MediaStreamTrack} + * @const + */ +MediaStreamTrackEvent.prototype.track; + +/** + * @param {!MediaStream|!Array.=} streamOrTracks + * @constructor + * @implements {EventTarget} + * @see http://www.w3.org/TR/mediacapture-streams/#mediastream + */ +function MediaStream(streamOrTracks) {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +MediaStream.prototype.addEventListener = function(type, listener, + opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +MediaStream.prototype.removeEventListener = function(type, listener, + opt_useCapture) {}; + +/** @override */ +MediaStream.prototype.dispatchEvent = function(evt) {}; + +/** + * TODO(bemasc): Remove this property. + * @deprecated + * @type {string} + * @const + */ +MediaStream.prototype.label; + +/** + * @type {string} + * @const + */ +MediaStream.prototype.id; + +/** + * @return {!Array.} + */ +MediaStream.prototype.getAudioTracks = function() {}; + +/** + * @return {!Array.} + */ +MediaStream.prototype.getVideoTracks = function() {}; + +/** + * @param {string} trackId + * @return {MediaStreamTrack} + */ +MediaStream.prototype.getTrackById = function(trackId) {}; + +/** + * @param {!MediaStreamTrack} track + */ +MediaStream.prototype.addTrack = function(track) {}; + +/** + * @param {!MediaStreamTrack} track + */ +MediaStream.prototype.removeTrack = function(track) {}; + +/** + * @type {boolean} + */ +MediaStream.prototype.ended; + +/** + * @type {?function(!Event)} + */ +MediaStream.prototype.onended; + +/** + * @type {?function(!MediaStreamTrackEvent)} + */ +MediaStream.prototype.onaddtrack; + +/** + * @type {?function(!MediaStreamTrackEvent)} + */ +MediaStream.prototype.onremovetrack; + +/** + * @deprecated + * TODO(bemasc): Remove this method once browsers have updated to + * MediaStreamTrack.stop(). + */ +MediaStream.prototype.stop = function() {}; + +/** + * @type {function(new: MediaStream, + * (!MediaStream|!Array.)=)} + */ +var webkitMediaStream; + +/** + * This interface defines the available constraint attributes. These are the + * attributes defined in + * {@see http://tools.ietf.org/html/draft-alvestrand-constraints-resolution-01}. + * Note that although that draft refers to "Media Constraints", the W3C uses + * the terms "Media[Stream|Track]Constraints" for this type, and + * defines a different type (for RTCPeerConnection) called "MediaConstraints". + * + * This interface type is not part of any standard, so it is marked as private. + * It is defined here in order to reserve the property names, which would + * otherwise be rewritten when the compiler processes an object literal. + * Several subsequent interfaces are defined in the same pattern. + * + * Note that although this list includes all the properties supported by + * libjingle (and hence by Chromium), browsers are permitted to offer other + * properties as well ({ + * @see http://tools.ietf.org/html/draft-burnett-rtcweb-constraints-registry-02 + * }), and browsers are expected to silently ignore unknown properties. This + * creates the potential for a very confusing situation in which properties + * not listed here are renamed by the compiler and then ignored by the browser. + * + * @interface + * @private + */ +function MediaTrackConstraintSetInterface_() {} + +/** + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.minWidth; + +/** + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.maxWidth; + +/** + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.minHeight; + +/** + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.maxHeight; + +/** + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.minAspectRatio; + +/** + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.maxAspectRatio; + +/** + * Due to a typo, this is called "minFramerate" in the -01 draft. + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.minFrameRate; + +/** + * @type {?number} + */ +MediaTrackConstraintSetInterface_.prototype.maxFrameRate; + +/** + * This type and two more below are defined as unions with Object because they + * are normally used as record types by constructing an Object literal, but all + * of their properties are optional. + * @typedef {Object|MediaTrackConstraintSetInterface_} + */ +var MediaTrackConstraintSet; + +/** + * @interface + * @private + */ +function MediaTrackConstraintsInterface_() {} + +/** + * @type {?MediaTrackConstraintSet} + */ +MediaTrackConstraintsInterface_.prototype.mandatory; + +/** + * @type {?Array.} + */ +MediaTrackConstraintsInterface_.prototype.optional; + +/** + * @typedef {Object|MediaTrackConstraintsInterface_} + */ +var MediaTrackConstraints; + +/** + * @interface + * @private + */ +function MediaStreamConstraintsInterface_() {} + +/** + * @type {boolean|MediaTrackConstraints} + */ +MediaStreamConstraintsInterface_.prototype.audio; + +/** + * @type {boolean|MediaTrackConstraints} + */ +MediaStreamConstraintsInterface_.prototype.video; + +/** + * @typedef {Object|MediaStreamConstraintsInterface_} + */ +var MediaStreamConstraints; + +/** + * @see {http://dev.w3.org/2011/webrtc/editor/getusermedia.html# + * navigatorusermediaerror-and-navigatorusermediaerrorcallback} + * @interface + */ +function NavigatorUserMediaError() {} + +/** + * @type {number} + * @deprecated Removed from the standard and some browsers. + * @const + */ +NavigatorUserMediaError.prototype.PERMISSION_DENIED; /** 1 */ + +/** + * @type {number} + * @deprecated Removed from the standard and some browsers. + * Read only. + */ +NavigatorUserMediaError.prototype.code; + +/** + * @type {string} + * Read only. + */ +NavigatorUserMediaError.prototype.name; + +/** + * @type {?string} + * Read only. + */ +NavigatorUserMediaError.prototype.message; + +/** + * @type {?string} + * Read only. + */ +NavigatorUserMediaError.prototype.constraintName; + +/** + * @param {MediaStreamConstraints} constraints A MediaStreamConstraints object. + * @param {function(!MediaStream)} successCallback + * A NavigatorUserMediaSuccessCallback function. + * @param {function(!NavigatorUserMediaError)=} errorCallback A + * NavigatorUserMediaErrorCallback function. + * @see http://dev.w3.org/2011/webrtc/editor/getusermedia.html + * @see http://www.w3.org/TR/mediacapture-streams/ + */ +Navigator.prototype.webkitGetUserMedia = + function(constraints, successCallback, errorCallback) {}; + +/** + * @param {string} type + * @param {!Object} eventInitDict + * @constructor + */ +function MediaStreamEvent(type, eventInitDict) {} + +/** + * @type {?MediaStream} + * @const + */ +MediaStreamEvent.prototype.stream; + +/** + * @typedef {string} + * @see http://www.w3.org/TR/webrtc/#rtcsdptype + * In WebIDL this is an enum with values 'offer', 'pranswer', and 'answer', + * but there is no mechanism in Closure for describing a specialization of + * the string type. + */ +var RTCSdpType; + +/** + * @param {!Object=} descriptionInitDict The RTCSessionDescriptionInit + * dictionary. This optional argument may have type + * {type:RTCSdpType, sdp:string}, but neither of these keys are required to be + * present, and other keys are ignored, so the closest Closure type is Object. + * @constructor + * @see http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcsessiondescription-class + */ +function RTCSessionDescription(descriptionInitDict) {} + +/** + * @type {?RTCSdpType} + * @see http://www.w3.org/TR/webrtc/#widl-RTCSessionDescription-type + */ +RTCSessionDescription.prototype.type; + +/** + * @type {?string} + * @see http://www.w3.org/TR/webrtc/#widl-RTCSessionDescription-sdp + */ +RTCSessionDescription.prototype.sdp; + +/** + * TODO(bemasc): Remove this definition once it is removed from the browser. + * @param {string} label The label index (audio/video/data -> 0,1,2) + * @param {string} sdp The ICE candidate in SDP text form + * @constructor + */ +function IceCandidate(label, sdp) {} + +/** + * @return {string} + */ +IceCandidate.prototype.toSdp = function() {}; + +/** + * @type {?string} + */ +IceCandidate.prototype.label; + +/** + * @param {!Object=} candidateInitDict The RTCIceCandidateInit dictionary. + * This optional argument may have type + * {candidate: string, sdpMid: string, sdpMLineIndex:number}, but none of + * these keys are required to be present, and other keys are ignored, so the + * closest Closure type is Object. + * @constructor + * @see http://www.w3.org/TR/webrtc/#rtcicecandidate-type + */ +function RTCIceCandidate(candidateInitDict) {} + +/** + * @type {?string} + */ +RTCIceCandidate.prototype.candidate; + +/** + * @type {?string} + */ +RTCIceCandidate.prototype.sdpMid; + +/** + * @type {?number} + */ +RTCIceCandidate.prototype.sdpMLineIndex; + +/** + * @typedef {{url: string}} + * @private + * @see http://www.w3.org/TR/webrtc/#rtciceserver-type + * This dictionary type also has an optional key {credential: ?string}. + */ +var RTCIceServerRecord_; + +/** + * @interface + * @private + */ +function RTCIceServerInterface_() {} + +/** + * @type {string} + */ +RTCIceServerInterface_.prototype.url; + +/** + * @type {?string} + */ +RTCIceServerInterface_.prototype.credential; + +/** + * This type, and several below it, are constructed as unions between records + * + * @typedef {RTCIceServerRecord_|RTCIceServerInterface_} + * @private + */ +var RTCIceServer; + +/** + * @typedef {{iceServers: !Array.}} + * @private + */ +var RTCConfigurationRecord_; + +/** + * @interface + * @private + */ +function RTCConfigurationInterface_() {} + +/** + * @type {!Array.} + */ +RTCConfigurationInterface_.prototype.iceServers; + +/** + * @typedef {RTCConfigurationRecord_|RTCConfigurationInterface_} + */ +var RTCConfiguration; + +/** + * @typedef {function(!RTCSessionDescription)} + */ +var RTCSessionDescriptionCallback; + +/** + * @typedef {function(string)} + */ +var RTCPeerConnectionErrorCallback; + +/** + * @typedef {function()} + */ +var RTCVoidCallback; + +/** + * @typedef {string} + */ +var RTCSignalingState; + +/** + * @typedef {string} + */ +var RTCIceConnectionState; + +/** + * @typedef {string} + */ +var RTCIceGatheringState; + +/** + * @param {string} type + * @param {!Object} eventInitDict + * @constructor + */ +function RTCPeerConnectionIceEvent(type, eventInitDict) {} + +/** + * @type {RTCIceCandidate} + * @const + */ +RTCPeerConnectionIceEvent.prototype.candidate; + +// Note: The specification of RTCStats types is still under development. +// Declarations here will be updated and removed to follow the development of +// modern browsers, breaking compatibility with older versions as they become +// obsolete. +/** + * @interface + */ +function RTCStatsReport() {} + +/** + * @type {Date} + * @const + */ +RTCStatsReport.prototype.timestamp; + +/** + * @return {!Array.} + */ +RTCStatsReport.prototype.names = function() {}; + +/** + * @param {string} name + * @return {string} + */ +RTCStatsReport.prototype.stat = function(name) {}; + +/** + * @deprecated + * @type {RTCStatsReport} + * @const + */ +RTCStatsReport.prototype.local; + +/** + * @deprecated + * @type {RTCStatsReport} + * @const + */ +RTCStatsReport.prototype.remote; + +/** + * @type {string} + * @const + */ +RTCStatsReport.prototype.type; + +/** + * @type {string} + * @const + */ +RTCStatsReport.prototype.id; + +/** + * TODO(bemasc): Remove this type once it is no longer in use. It has already + * been removed from the specification. + * @typedef {RTCStatsReport} + * @deprecated + */ +var RTCStatsElement; + +/** + * @interface + */ +function RTCStatsResponse() {} + +/** + * @return {!Array.} + */ +RTCStatsResponse.prototype.result = function() {}; + +/** + * @typedef {function(!RTCStatsResponse, MediaStreamTrack=)} + */ +var RTCStatsCallback; + +/** + * This type is not yet standardized, so the properties here only represent + * the current capabilities of libjingle (and hence Chromium). + * TODO(bemasc): Add a link to the relevant standard once MediaConstraint has a + * standard definition. + * + * @interface + * @private + */ +function MediaConstraintSetInterface_() {} + +/** + * @type {?boolean} + */ +MediaConstraintSetInterface_.prototype.OfferToReceiveAudio; + +/** + * @type {?boolean} + */ +MediaConstraintSetInterface_.prototype.OfferToReceiveVideo; + +/** + * @type {?boolean} + */ +MediaConstraintSetInterface_.prototype.DtlsSrtpKeyAgreement; + +/** + * @type {?boolean} + */ +MediaConstraintSetInterface_.prototype.RtpDataChannels; + +/** + * TODO(bemasc): Make this type public once it is defined in a standard. + * + * @typedef {Object|MediaConstraintSetInterface_} + * @private + */ +var MediaConstraintSet_; + +/** + * @interface + * @private + */ +function MediaConstraintsInterface_() {} + +/** + * @type {?MediaConstraintSet_} + */ +MediaConstraintsInterface_.prototype.mandatory; + +/** + * @type {?Array.} + */ +MediaConstraintsInterface_.prototype.optional; + +/** + * This type is used extensively in + * {@see http://dev.w3.org/2011/webrtc/editor/webrtc.html} but is not yet + * defined. + * + * @typedef {Object|MediaConstraintsInterface_} + */ +var MediaConstraints; + +/** + * @interface + */ +function RTCDataChannel() {} + +/** + * @type {string} + * @const + */ +RTCDataChannel.prototype.label; + +/** + * @type {boolean} + * @const + */ +RTCDataChannel.prototype.reliable; + +/** + * An enumerated string type (RTCDataChannelState) with values: + * "connecting", "open", "closing", and "closed". + * @type {string} + * Read only. + */ +RTCDataChannel.prototype.readyState; + +/** + * @type {number} + * Read only. + */ +RTCDataChannel.prototype.bufferedAmount; + +/** + * @type {?function(!Event)} + */ +RTCDataChannel.prototype.onopen; + +/** + * @type {?function(!Event)} + */ +RTCDataChannel.prototype.onerror; + +/** + * @type {?function(!Event)} + */ +RTCDataChannel.prototype.onclose; + +RTCDataChannel.prototype.close = function() {}; + +/** + * @type {?function(!MessageEvent.<*>)} + */ +RTCDataChannel.prototype.onmessage; + +/** + * @type {string} + */ +RTCDataChannel.prototype.binaryType; + +/** + * @param {string|!Blob|!ArrayBuffer|!ArrayBufferView} data + */ +RTCDataChannel.prototype.send = function(data) {}; + +/** + * @constructor + * @extends {Event} + * @private + */ +function RTCDataChannelEvent() {} + +/** + * @type {!RTCDataChannel} + * Read only. + */ +RTCDataChannelEvent.prototype.channel; + +/** + * @typedef {{reliable: boolean}} + */ +var RTCDataChannelInitRecord_; + +/** + * @interface + * @private + */ +function RTCDataChannelInitInterface_() {} + +/** + * @type {boolean} + */ +RTCDataChannelInitInterface_.prototype.reliable; + +/** + * @typedef {RTCDataChannelInitInterface_|RTCDataChannelInitRecord_} + */ +var RTCDataChannelInit; + +/** + * @param {RTCConfiguration} configuration + * @param {!MediaConstraints=} constraints + * @constructor + * @implements {EventTarget} + */ +function RTCPeerConnection(configuration, constraints) {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +RTCPeerConnection.prototype.addEventListener = function( + type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +RTCPeerConnection.prototype.removeEventListener = function( + type, listener, opt_useCapture) {}; + +/** @override */ +RTCPeerConnection.prototype.dispatchEvent = function(evt) {}; + +/** + * @param {!RTCSessionDescriptionCallback} successCallback + * @param {!RTCPeerConnectionErrorCallback=} failureCallback + * @param {!MediaConstraints=} constraints + */ +RTCPeerConnection.prototype.createOffer = function(successCallback, + failureCallback, constraints) {}; + +/** + * @param {RTCSessionDescriptionCallback} successCallback + * @param {?RTCPeerConnectionErrorCallback=} failureCallback + * @param {!MediaConstraints=} constraints + */ +RTCPeerConnection.prototype.createAnswer = function(successCallback, + failureCallback, constraints) {}; + +/** + * @param {!RTCSessionDescription} description + * @param {!RTCVoidCallback=} successCallback + * @param {!RTCPeerConnectionErrorCallback=} failureCallback + */ +RTCPeerConnection.prototype.setLocalDescription = function(description, + successCallback, failureCallback) {}; + +/** + * @param {!RTCSessionDescription} description + * @param {!RTCVoidCallback=} successCallback + * @param {!RTCPeerConnectionErrorCallback=} failureCallback + */ +RTCPeerConnection.prototype.setRemoteDescription = function(description, + successCallback, failureCallback) {}; + +/** + * @type {?RTCSessionDescription} + * Read only. + */ +RTCPeerConnection.prototype.localDescription; + +/** + * @type {?RTCSessionDescription} + * Read only. + */ +RTCPeerConnection.prototype.remoteDescription; + +/** + * @type {RTCSignalingState} + * Read only. + */ +RTCPeerConnection.prototype.signalingState; + +/** + * @param {?RTCConfiguration=} configuration + * @param {?MediaConstraints=} constraints + */ +RTCPeerConnection.prototype.updateIce = function(configuration, constraints) {}; + +/** + * @param {!RTCIceCandidate} candidate + */ +RTCPeerConnection.prototype.addIceCandidate = function(candidate) {}; + +/** + * @type {!RTCIceGatheringState} + * Read only. + */ +RTCPeerConnection.prototype.iceGatheringState; + +/** + * @type {!RTCIceConnectionState} + * Read only. + */ +RTCPeerConnection.prototype.iceConnectionState; + +/** + * @return {!Array.} + */ +RTCPeerConnection.prototype.getLocalStreams = function() {}; + +/** + * @return {!Array.} + */ +RTCPeerConnection.prototype.getRemoteStreams = function() {}; + +/** + * @param {string} streamId + * @return {MediaStream} + */ +RTCPeerConnection.prototype.getStreamById = function(streamId) {}; + +/** + * @param {?string} label + * @param {RTCDataChannelInit=} dataChannelDict + * @return {!RTCDataChannel} + */ +RTCPeerConnection.prototype.createDataChannel = + function(label, dataChannelDict) {}; +/** + * @param {!MediaStream} stream + * @param {!MediaConstraints=} constraints + */ +RTCPeerConnection.prototype.addStream = function(stream, constraints) {}; + +/** + * @param {!MediaStream} stream + */ +RTCPeerConnection.prototype.removeStream = function(stream) {}; + +// TODO(bemasc): Add identity provider stuff once implementations exist + +/** + * @param {!RTCStatsCallback} successCallback + * @param {MediaStreamTrack=} selector + */ +RTCPeerConnection.prototype.getStats = function(successCallback, selector) {}; + +RTCPeerConnection.prototype.close = function() {}; + +/** + * @type {?function(!Event)} + */ +RTCPeerConnection.prototype.onnegotiationneeded; + +/** + * @type {?function(!RTCPeerConnectionIceEvent)} + */ +RTCPeerConnection.prototype.onicecandidate; + +/** + * @type {?function(!Event)} + */ +RTCPeerConnection.prototype.onsignalingstatechange; + +/** + * @type {?function(!MediaStreamEvent)} + */ +RTCPeerConnection.prototype.onaddstream; + +/** + * @type {?function(!MediaStreamEvent)} + */ +RTCPeerConnection.prototype.onremovestream; + +/** + * @type {?function(!Event)} + */ +RTCPeerConnection.prototype.oniceconnectionstatechange; + +/** + * @type {?function(!RTCDataChannelEvent)} + */ +RTCPeerConnection.prototype.ondatachannel; + +/** + * @type {function(new: RTCPeerConnection, RTCConfiguration, + * !MediaConstraints=)} + */ +var webkitRTCPeerConnection; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js new file mode 100644 index 000000000..546dec9ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js @@ -0,0 +1,94 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's Selectors API. + * This file depends on w3c_dom1.js. + * @see http://www.w3.org/TR/selectors-api2/ + * + * @externs + */ + +/** + * @param {string} selectors + * @return {Element} + * @override + */ +Document.prototype.querySelector = function(selectors) {}; + +/** + * @param {string} selectors + * @return {!NodeList} + * @override + */ +Document.prototype.querySelectorAll = function(selectors) {}; + +/** + * @param {string} selectors + * @return {Element} + * @override + */ +Element.prototype.querySelector = function(selectors) {}; + +/** + * @param {string} selectors + * @return {!NodeList} + * @override + */ +Element.prototype.querySelectorAll = function(selectors) {}; + +/** + * https://dom.spec.whatwg.org/#dom-element-matches + * https://developer.mozilla.org/en-US/docs/Web/API/Element.matches + * @param {string} selectors + * @return {boolean} + */ +Element.prototype.matches = function(selectors) {}; + +/** + * @param {string} selectors + * @param {(Node|NodeList)=} refNodes + * @return {boolean} + */ +Element.prototype.matchesSelector = function(selectors, refNodes) {}; + +/** + * @see https://developer.mozilla.org/en/DOM/Node.mozMatchesSelector + * @param {string} selectors + * @return {boolean} + */ +Element.prototype.mozMatchesSelector = function(selectors) {}; + +/** + * @see http://developer.apple.com/library/safari/documentation/WebKit/Reference/ElementClassRef/Element/Element.html + * @param {string} selectors + * @return {boolean} + */ +Element.prototype.webkitMatchesSelector = function(selectors) {}; + +/** + * @see http://msdn.microsoft.com/en-us/library/ff975201.aspx + * @param {string} selectors + * @return {boolean} + */ +Element.prototype.msMatchesSelector = function(selectors) {}; + +/** + * @see http://www.opera.com/docs/changelogs/windows/1150/ + * @param {string} selectors + * @return {boolean} + */ +Element.prototype.oMatchesSelector = function(selectors) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js new file mode 100644 index 000000000..7dadd2426 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js @@ -0,0 +1,417 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for W3C's XML related specifications. + * This file depends on w3c_dom2.js. + * The whole file has been fully type annotated. + * + * Provides the XML standards from W3C. + * Includes: + * XPath - Fully type annotated + * XMLHttpRequest - Fully type annotated + * + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html + * @see http://www.w3.org/TR/XMLHttpRequest/ + * @see http://www.w3.org/TR/XMLHttpRequest2/ + * + * @externs + * @author stevey@google.com (Steve Yegge) + */ + + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathException + */ +function XPathException() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#INVALID_EXPRESSION_ERR + */ +XPathException.INVALID_EXPRESSION_ERR = 52; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#TYPE_ERR + */ +XPathException.TYPE_ERR = 52; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html# + */ +XPathException.prototype.code; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator + */ +function XPathEvaluator() {} + +/** + * @param {string} expr + * @param {?XPathNSResolver=} opt_resolver + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createExpression + * @throws XPathException + * @throws DOMException + */ +XPathEvaluator.prototype.createExpression = function(expr, opt_resolver) {}; + +/** + * @param {Node} nodeResolver + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createNSResolver + */ +XPathEvaluator.prototype.createNSResolver = function(nodeResolver) {}; + +/** + * @param {string} expr + * @param {Node} contextNode + * @param {?XPathNSResolver=} opt_resolver + * @param {?number=} opt_type + * @param {*=} opt_result + * @return {XPathResult} + * @throws XPathException + * @throws DOMException + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate + */ +XPathEvaluator.prototype.evaluate = function(expr, contextNode, opt_resolver, + opt_type, opt_result) {}; + + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression + */ +function XPathExpression() {} + +/** + * @param {Node} contextNode + * @param {number=} opt_type + * @param {*=} opt_result + * @return {*} + * @throws XPathException + * @throws DOMException + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression-evaluate + */ +XPathExpression.prototype.evaluate = function(contextNode, opt_type, + opt_result) {}; + + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver + */ +function XPathNSResolver() {} + +/** + * @param {string} prefix + * @return {?string} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver-lookupNamespaceURI + */ +XPathNSResolver.prototype.lookupNamespaceURI = function(prefix) {}; + +/** + * From http://www.w3.org/TR/xpath + * + * XPath is a language for addressing parts of an XML document, designed to be + * used by both XSLT and XPointer. + * + * @noalias + * @constructor + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult + */ +function XPathResult() {} + +/** + * @type {boolean} {@see XPathException.TYPE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-booleanValue + */ +XPathResult.prototype.booleanValue; + +/** + * @type {boolean} {@see XPathException.TYPE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-invalid-iterator-state + */ +XPathResult.prototype.invalidInteratorState; + +/** + * @type {number} + * @throws XPathException {@see XPathException.TYPE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-numberValue + */ +XPathResult.prototype.numberValue; + +/** + * @type {number} + * @throws XPathException {@see XPathException.TYPE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-resultType + */ +XPathResult.prototype.resultType; + +/** + * @type {Node} + * @throws XPathException {@see XPathException.TYPE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-singleNodeValue + */ +XPathResult.prototype.singleNodeValue; + +/** + * @type {number} + * @throws XPathException {@see XPathException.TYPE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshot-length + */ +XPathResult.prototype.snapshotLength; + +/** + * @type {string} + * @throws XPathException {@see XPathException.TYPE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-stringValue + */ +XPathResult.prototype.stringValue; + +/** + * @return {Node} + * @throws XPathException {@see XPathException.TYPE_ERR} + * @throws DOMException {@see DOMException.INVALID_STATE_ERR} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-iterateNext + */ +XPathResult.prototype.iterateNext = function() {}; + +/** + * @param {number} index + * @return {Node} + * @throws XPathException + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshotItem + */ +XPathResult.prototype.snapshotItem = function(index) {}; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-TYPE + */ +XPathResult.ANY_TYPE = 0; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-NUMBER-TYPE + */ +XPathResult.NUMBER_TYPE = 1; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-STRING-TYPE + */ +XPathResult.STRING_TYPE = 2; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-BOOLEAN-TYPE + */ +XPathResult.BOOLEAN_TYPE = 3; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-ITERATOR-TYPE + */ +XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-ITERATOR-TYPE + */ +XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-SNAPSHOT-TYPE + */ +XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-SNAPSHOT-TYPE + */ +XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-UNORDERED-NODE-TYPE + */ +XPathResult.ANY_UNORDERED_NODE_TYPE = 8; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-FIRST-ORDERED-NODE-TYPE + */ +XPathResult.FIRST_ORDERED_NODE_TYPE = 9; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace + */ +function XPathNamespace() {} + +/** + * @type {Element} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace-ownerElement + */ +XPathNamespace.prototype.ownerElement; + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPATH_NAMESPACE_NODE + */ +XPathNamespace.XPATH_NAMESPACE_NODE = 13; + +/** + * From http://www.w3.org/TR/XMLHttpRequest/ + * + * (Draft) + * + * The XMLHttpRequest Object specification defines an API that provides + * scripted client functionality for transferring data between a client and a + * server. + * + * @constructor + * @implements {EventTarget} + * @see http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest-object + */ +function XMLHttpRequest() {} + +/** + * @param {boolean=} opt_useCapture + * @override + */ +XMLHttpRequest.prototype.addEventListener = + function(type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +XMLHttpRequest.prototype.removeEventListener = + function(type, listener, opt_useCapture) {}; + +/** @override */ +XMLHttpRequest.prototype.dispatchEvent = function(evt) {}; + +/** + * @param {string} method + * @param {string} url + * @param {?boolean=} opt_async + * @param {?string=} opt_user + * @param {?string=} opt_password + * @return {undefined} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-open()-method + */ +XMLHttpRequest.prototype.open = function(method, url, opt_async, opt_user, + opt_password) {}; + +/** + * @param {string} header + * @param {string} value + * @return {undefined} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method + */ +XMLHttpRequest.prototype.setRequestHeader = function(header, value) {}; + +/** + * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=} opt_data + * @return {undefined} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-send()-method + */ +XMLHttpRequest.prototype.send = function(opt_data) {}; + +/** + * @return {undefined} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-abort()-method + */ +XMLHttpRequest.prototype.abort = function() {}; + +/** + * @return {string} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method + */ +XMLHttpRequest.prototype.getAllResponseHeaders = function() {}; + +/** + * @param {string} header + * @return {string} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method + */ +XMLHttpRequest.prototype.getResponseHeader = function(header) {}; + +/** + * @type {string} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute + */ +XMLHttpRequest.prototype.responseText; + +/** + * @type {Document} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsexml-attribute + */ +XMLHttpRequest.prototype.responseXML; + +/** + * @type {number} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-readystate-attribute + */ +XMLHttpRequest.prototype.readyState; + +/** + * @type {number} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute + */ +XMLHttpRequest.prototype.status; + +/** + * @type {string} + * @see http://www.w3.org/TR/XMLHttpRequest/#the-statustext-attribute + */ +XMLHttpRequest.prototype.statusText; + +/** + * @type {Function} + * @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange + */ +XMLHttpRequest.prototype.onreadystatechange; + +/** + * @type {Function} + * @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onerror + */ +XMLHttpRequest.prototype.onerror; + +/** + * The FormData object represents an ordered collection of entries. Each entry + * has a name and value. + * + * @param {?Element=} opt_form An optional form to use for constructing the form + * data set. + * @constructor + * @see http://www.w3.org/TR/XMLHttpRequest2/#the-formdata-interface + */ +function FormData(opt_form) {} + +/** + * @param {string} name + * @param {Blob|string} value + */ +FormData.prototype.append = function(name, value) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js new file mode 100644 index 000000000..60841f8e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js @@ -0,0 +1,456 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for WebKit's custom CSS properties. Copied from: + * {@link + * http://trac.webkit.org/browser/trunk/Source/WebCore/css/CSSPropertyNames.in} + * + * If you make changes to this file, notice that every property appears + * twice: once as an uppercase name and once as a lowercase name. + * WebKit allows both. The uppercase version is preferred. + * + * @externs + * @author nicksantos@google.com (Nick Santos) + */ + +/** @type {string} */ CSSProperties.prototype.WebkitAlignContent; +/** @type {string} */ CSSProperties.prototype.WebkitAlignItems; +/** @type {string} */ CSSProperties.prototype.WebkitAlignSelf; +/** @type {string} */ CSSProperties.prototype.WebkitAnimation; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationDelay; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationDirection; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationDuration; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationFillMode; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationIterationCount; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationName; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationPlayState; +/** @type {string} */ CSSProperties.prototype.WebkitAnimationTimingFunction; +/** @type {string} */ CSSProperties.prototype.WebkitAppearance; +/** @type {string} */ CSSProperties.prototype.WebkitAppRegion; +/** @type {string} */ CSSProperties.prototype.WebkitAspectRatio; +/** @type {string} */ CSSProperties.prototype.WebkitBackfaceVisibility; +/** @type {string} */ CSSProperties.prototype.WebkitBackgroundClip; +/** @type {string} */ CSSProperties.prototype.WebkitBackgroundComposite; +/** @type {string} */ CSSProperties.prototype.WebkitBackgroundOrigin; +/** @type {string} */ CSSProperties.prototype.WebkitBackgroundSize; +/** @type {string} */ CSSProperties.prototype.WebkitBinding; +/** @type {string} */ CSSProperties.prototype.WebkitBlendMode; +/** @type {string} */ CSSProperties.prototype.WebkitBorderAfter; +/** @type {string} */ CSSProperties.prototype.WebkitBorderAfterColor; +/** @type {string} */ CSSProperties.prototype.WebkitBorderAfterStyle; +/** @type {string} */ CSSProperties.prototype.WebkitBorderAfterWidth; +/** @type {string} */ CSSProperties.prototype.WebkitBorderBefore; +/** @type {string} */ CSSProperties.prototype.WebkitBorderBeforeColor; +/** @type {string} */ CSSProperties.prototype.WebkitBorderBeforeStyle; +/** @type {string} */ CSSProperties.prototype.WebkitBorderBeforeWidth; +/** @type {string} */ CSSProperties.prototype.WebkitBorderBottomLeftRadius; +/** @type {string} */ CSSProperties.prototype.WebkitBorderBottomRightRadius; +/** @type {string} */ CSSProperties.prototype.WebkitBorderEnd; +/** @type {string} */ CSSProperties.prototype.WebkitBorderEndColor; +/** @type {string} */ CSSProperties.prototype.WebkitBorderEndStyle; +/** @type {string} */ CSSProperties.prototype.WebkitBorderEndWidth; +/** @type {string} */ CSSProperties.prototype.WebkitBorderFit; +/** @type {string} */ CSSProperties.prototype.WebkitBorderHorizontalSpacing; +/** @type {string} */ CSSProperties.prototype.WebkitBorderImage; +/** @type {string} */ CSSProperties.prototype.WebkitBorderRadius; +/** @type {string} */ CSSProperties.prototype.WebkitBorderStart; +/** @type {string} */ CSSProperties.prototype.WebkitBorderStartColor; +/** @type {string} */ CSSProperties.prototype.WebkitBorderStartStyle; +/** @type {string} */ CSSProperties.prototype.WebkitBorderStartWidth; +/** @type {string} */ CSSProperties.prototype.WebkitBorderTopLeftRadius; +/** @type {string} */ CSSProperties.prototype.WebkitBorderTopRightRadius; +/** @type {string} */ CSSProperties.prototype.WebkitBorderVerticalSpacing; +/** @type {string} */ CSSProperties.prototype.WebkitBoxAlign; +/** @type {string} */ CSSProperties.prototype.WebkitBoxDecorationBreak; +/** @type {string} */ CSSProperties.prototype.WebkitBoxDirection; +/** @type {string} */ CSSProperties.prototype.WebkitBoxFlex; +/** @type {string} */ CSSProperties.prototype.WebkitBoxFlexGroup; +/** @type {string} */ CSSProperties.prototype.WebkitBoxLines; +/** @type {string} */ CSSProperties.prototype.WebkitBoxOrdinalGroup; +/** @type {string} */ CSSProperties.prototype.WebkitBoxOrient; +/** @type {string} */ CSSProperties.prototype.WebkitBoxPack; +/** @type {string} */ CSSProperties.prototype.WebkitBoxReflect; +/** @type {string} */ CSSProperties.prototype.WebkitBoxShadow; +/** @type {string} */ CSSProperties.prototype.WebkitBoxSizing; +/** @type {string} */ CSSProperties.prototype.WebkitColorCorrection; +/** @type {string} */ CSSProperties.prototype.WebkitColumnAxis; +/** @type {string} */ CSSProperties.prototype.WebkitColumnBreakAfter; +/** @type {string} */ CSSProperties.prototype.WebkitColumnBreakBefore; +/** @type {string} */ CSSProperties.prototype.WebkitColumnBreakInside; +/** @type {string} */ CSSProperties.prototype.WebkitColumnCount; +/** @type {string} */ CSSProperties.prototype.WebkitColumnGap; +/** @type {string} */ CSSProperties.prototype.WebkitColumnProgression; +/** @type {string} */ CSSProperties.prototype.WebkitColumnRule; +/** @type {string} */ CSSProperties.prototype.WebkitColumnRuleColor; +/** @type {string} */ CSSProperties.prototype.WebkitColumnRuleStyle; +/** @type {string} */ CSSProperties.prototype.WebkitColumnRuleWidth; +/** @type {string} */ CSSProperties.prototype.WebkitColumns; +/** @type {string} */ CSSProperties.prototype.WebkitColumnSpan; +/** @type {string} */ CSSProperties.prototype.WebkitColumnWidth; +/** @type {string} */ CSSProperties.prototype.WebkitDashboardRegion; +/** @type {string} */ CSSProperties.prototype.WebkitFilter; +/** @type {string} */ CSSProperties.prototype.WebkitFlex; +/** @type {string} */ CSSProperties.prototype.WebkitFlexBasis; +/** @type {string} */ CSSProperties.prototype.WebkitFlexDirection; +/** @type {string} */ CSSProperties.prototype.WebkitFlexFlow; +/** @type {string} */ CSSProperties.prototype.WebkitFlexGrow; +/** @type {string} */ CSSProperties.prototype.WebkitFlexShrink; +/** @type {string} */ CSSProperties.prototype.WebkitFlexWrap; +/** @type {string} */ CSSProperties.prototype.WebkitFlowFrom; +/** @type {string} */ CSSProperties.prototype.WebkitFlowInto; +/** @type {string} */ CSSProperties.prototype.WebkitFontSizeDelta; +/** @type {string} */ CSSProperties.prototype.WebkitFontSmoothing; +/** @type {string} */ CSSProperties.prototype.WebkitGridColumn; +/** @type {string} */ CSSProperties.prototype.WebkitGridColumns; +/** @type {string} */ CSSProperties.prototype.WebkitGridRow; +/** @type {string} */ CSSProperties.prototype.WebkitGridRows; +/** @type {string} */ CSSProperties.prototype.WebkitHighlight; +/** @type {string} */ CSSProperties.prototype.WebkitHyphenateCharacter; +/** @type {string} */ CSSProperties.prototype.WebkitHyphenateLimitAfter; +/** @type {string} */ CSSProperties.prototype.WebkitHyphenateLimitBefore; +/** @type {string} */ CSSProperties.prototype.WebkitHyphenateLimitLines; +/** @type {string} */ CSSProperties.prototype.WebkitHyphens; +/** @type {string} */ CSSProperties.prototype.WebkitJustifyContent; +/** @type {string} */ CSSProperties.prototype.WebkitLineAlign; +/** @type {string} */ CSSProperties.prototype.WebkitLineBoxContain; +/** @type {string} */ CSSProperties.prototype.WebkitLineBreak; +/** @type {string} */ CSSProperties.prototype.WebkitLineClamp; +/** @type {string} */ CSSProperties.prototype.WebkitLineGrid; +/** @type {string} */ CSSProperties.prototype.WebkitLineSnap; +/** @type {string} */ CSSProperties.prototype.WebkitLocale; +/** @type {string} */ CSSProperties.prototype.WebkitLogicalHeight; +/** @type {string} */ CSSProperties.prototype.WebkitLogicalWidth; +/** @type {string} */ CSSProperties.prototype.WebkitMarginAfter; +/** @type {string} */ CSSProperties.prototype.WebkitMarginAfterCollapse; +/** @type {string} */ CSSProperties.prototype.WebkitMarginBefore; +/** @type {string} */ CSSProperties.prototype.WebkitMarginBeforeCollapse; +/** @type {string} */ CSSProperties.prototype.WebkitMarginBottomCollapse; +/** @type {string} */ CSSProperties.prototype.WebkitMarginCollapse; +/** @type {string} */ CSSProperties.prototype.WebkitMarginEnd; +/** @type {string} */ CSSProperties.prototype.WebkitMarginStart; +/** @type {string} */ CSSProperties.prototype.WebkitMarginTopCollapse; +/** @type {string} */ CSSProperties.prototype.WebkitMarquee; +/** @type {string} */ CSSProperties.prototype.WebkitMarqueeDirection; +/** @type {string} */ CSSProperties.prototype.WebkitMarqueeIncrement; +/** @type {string} */ CSSProperties.prototype.WebkitMarqueeRepetition; +/** @type {string} */ CSSProperties.prototype.WebkitMarqueeSpeed; +/** @type {string} */ CSSProperties.prototype.WebkitMarqueeStyle; +/** @type {string} */ CSSProperties.prototype.WebkitMask; +/** @type {string} */ CSSProperties.prototype.WebkitMaskAttachment; +/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImage; +/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageOutset; +/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageRepeat; +/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageSlice; +/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageSource; +/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageWidth; +/** @type {string} */ CSSProperties.prototype.WebkitMaskClip; +/** @type {string} */ CSSProperties.prototype.WebkitMaskComposite; +/** @type {string} */ CSSProperties.prototype.WebkitMaskImage; +/** @type {string} */ CSSProperties.prototype.WebkitMaskOrigin; +/** @type {string} */ CSSProperties.prototype.WebkitMaskPosition; +/** @type {string} */ CSSProperties.prototype.WebkitMaskPositionX; +/** @type {string} */ CSSProperties.prototype.WebkitMaskPositionY; +/** @type {string} */ CSSProperties.prototype.WebkitMaskRepeat; +/** @type {string} */ CSSProperties.prototype.WebkitMaskRepeatX; +/** @type {string} */ CSSProperties.prototype.WebkitMaskRepeatY; +/** @type {string} */ CSSProperties.prototype.WebkitMaskSize; +/** @type {string} */ +CSSProperties.prototype.WebkitMatchNearestMailBlockquoteColor; +/** @type {string} */ CSSProperties.prototype.WebkitMaxLogicalHeight; +/** @type {string} */ CSSProperties.prototype.WebkitMaxLogicalWidth; +/** @type {string} */ CSSProperties.prototype.WebkitMinLogicalHeight; +/** @type {string} */ CSSProperties.prototype.WebkitMinLogicalWidth; +/** @type {string} */ CSSProperties.prototype.WebkitNbspMode; +/** @type {string} */ CSSProperties.prototype.WebkitOrder; +/** @type {string} */ CSSProperties.prototype.WebkitOverflowScrolling; +/** @type {string} */ CSSProperties.prototype.WebkitPaddingAfter; +/** @type {string} */ CSSProperties.prototype.WebkitPaddingBefore; +/** @type {string} */ CSSProperties.prototype.WebkitPaddingEnd; +/** @type {string} */ CSSProperties.prototype.WebkitPaddingStart; +/** @type {string} */ CSSProperties.prototype.WebkitPerspective; +/** @type {string} */ CSSProperties.prototype.WebkitPerspectiveOrigin; +/** @type {string} */ CSSProperties.prototype.WebkitPerspectiveOriginX; +/** @type {string} */ CSSProperties.prototype.WebkitPerspectiveOriginY; +/** @type {string} */ CSSProperties.prototype.WebkitPrintColorAdjust; +/** @type {string} */ CSSProperties.prototype.WebkitRegionBreakAfter; +/** @type {string} */ CSSProperties.prototype.WebkitRegionBreakBefore; +/** @type {string} */ CSSProperties.prototype.WebkitRegionBreakInside; +/** @type {string} */ CSSProperties.prototype.WebkitRegionOverflow; +/** @type {string} */ CSSProperties.prototype.WebkitRtlOrdering; +/** @type {string} */ CSSProperties.prototype.WebkitRubyPosition; +/** @type {string} */ CSSProperties.prototype.WebkitShapeInside; +/** @type {string} */ CSSProperties.prototype.WebkitShapeMargin; +/** @type {string} */ CSSProperties.prototype.WebkitShapeOutside; +/** @type {string} */ CSSProperties.prototype.WebkitShapePadding; +/** @type {string} */ CSSProperties.prototype.WebkitTapHighlightColor; +/** @type {string} */ CSSProperties.prototype.WebkitTextAlignLast; +/** @type {string} */ CSSProperties.prototype.WebkitTextCombine; +/** @type {string} */ CSSProperties.prototype.WebkitTextDecorationLine; +/** @type {string} */ CSSProperties.prototype.WebkitTextDecorationsInEffect; +/** @type {string} */ CSSProperties.prototype.WebkitTextDecorationStyle; +/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasis; +/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasisColor; +/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasisPosition; +/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasisStyle; +/** @type {string} */ CSSProperties.prototype.WebkitTextFillColor; +/** @type {string} */ CSSProperties.prototype.WebkitTextOrientation; +/** @type {string} */ CSSProperties.prototype.WebkitTextSecurity; +/** @type {string} */ CSSProperties.prototype.WebkitTextSizeAdjust; +/** @type {string} */ CSSProperties.prototype.WebkitTextStroke; +/** @type {string} */ CSSProperties.prototype.WebkitTextStrokeColor; +/** @type {string} */ CSSProperties.prototype.WebkitTextStrokeWidth; +/** @type {string} */ CSSProperties.prototype.WebkitTransform; +/** @type {string} */ CSSProperties.prototype.WebkitTransformOrigin; +/** @type {string} */ CSSProperties.prototype.WebkitTransformOriginX; +/** @type {string} */ CSSProperties.prototype.WebkitTransformOriginY; +/** @type {string} */ CSSProperties.prototype.WebkitTransformOriginZ; +/** @type {string} */ CSSProperties.prototype.WebkitTransformStyle; +/** @type {string} */ CSSProperties.prototype.WebkitTransition; +/** @type {string} */ CSSProperties.prototype.WebkitTransitionDelay; +/** @type {string} */ CSSProperties.prototype.WebkitTransitionDuration; +/** @type {string} */ CSSProperties.prototype.WebkitTransitionProperty; +/** @type {string} */ CSSProperties.prototype.WebkitTransitionRepeatCount; +/** @type {string} */ CSSProperties.prototype.WebkitTransitionTimingFunction; +/** @type {string} */ CSSProperties.prototype.WebkitUserDrag; +/** @type {string} */ CSSProperties.prototype.WebkitUserModify; +/** @type {string} */ CSSProperties.prototype.WebkitUserSelect; +/** @type {string} */ CSSProperties.prototype.WebkitWrap; +/** @type {string} */ CSSProperties.prototype.WebkitWrapFlow; +/** @type {string} */ CSSProperties.prototype.WebkitWrapThrough; +/** @type {string} */ CSSProperties.prototype.WebkitWritingMode; + +// WebKit also adds bindings for the lowercase versions of these properties. +// The uppercase version is preferred. + +/** @type {string} */ CSSProperties.prototype.webkitAlignContent; +/** @type {string} */ CSSProperties.prototype.webkitAlignItems; +/** @type {string} */ CSSProperties.prototype.webkitAlignSelf; +/** @type {string} */ CSSProperties.prototype.webkitAnimation; +/** @type {string} */ CSSProperties.prototype.webkitAnimationDelay; +/** @type {string} */ CSSProperties.prototype.webkitAnimationDirection; +/** @type {string} */ CSSProperties.prototype.webkitAnimationDuration; +/** @type {string} */ CSSProperties.prototype.webkitAnimationFillMode; +/** @type {string} */ CSSProperties.prototype.webkitAnimationIterationCount; +/** @type {string} */ CSSProperties.prototype.webkitAnimationName; +/** @type {string} */ CSSProperties.prototype.webkitAnimationPlayState; +/** @type {string} */ CSSProperties.prototype.webkitAnimationTimingFunction; +/** @type {string} */ CSSProperties.prototype.webkitAppearance; +/** @type {string} */ CSSProperties.prototype.webkitAppRegion; +/** @type {string} */ CSSProperties.prototype.webkitAspectRatio; +/** @type {string} */ CSSProperties.prototype.webkitBackfaceVisibility; +/** @type {string} */ CSSProperties.prototype.webkitBackgroundClip; +/** @type {string} */ CSSProperties.prototype.webkitBackgroundComposite; +/** @type {string} */ CSSProperties.prototype.webkitBackgroundOrigin; +/** @type {string} */ CSSProperties.prototype.webkitBackgroundSize; +/** @type {string} */ CSSProperties.prototype.webkitBinding; +/** @type {string} */ CSSProperties.prototype.webkitBlendMode; +/** @type {string} */ CSSProperties.prototype.webkitBorderAfter; +/** @type {string} */ CSSProperties.prototype.webkitBorderAfterColor; +/** @type {string} */ CSSProperties.prototype.webkitBorderAfterStyle; +/** @type {string} */ CSSProperties.prototype.webkitBorderAfterWidth; +/** @type {string} */ CSSProperties.prototype.webkitBorderBefore; +/** @type {string} */ CSSProperties.prototype.webkitBorderBeforeColor; +/** @type {string} */ CSSProperties.prototype.webkitBorderBeforeStyle; +/** @type {string} */ CSSProperties.prototype.webkitBorderBeforeWidth; +/** @type {string} */ CSSProperties.prototype.webkitBorderBottomLeftRadius; +/** @type {string} */ CSSProperties.prototype.webkitBorderBottomRightRadius; +/** @type {string} */ CSSProperties.prototype.webkitBorderEnd; +/** @type {string} */ CSSProperties.prototype.webkitBorderEndColor; +/** @type {string} */ CSSProperties.prototype.webkitBorderEndStyle; +/** @type {string} */ CSSProperties.prototype.webkitBorderEndWidth; +/** @type {string} */ CSSProperties.prototype.webkitBorderFit; +/** @type {string} */ CSSProperties.prototype.webkitBorderHorizontalSpacing; +/** @type {string} */ CSSProperties.prototype.webkitBorderImage; +/** @type {string} */ CSSProperties.prototype.webkitBorderRadius; +/** @type {string} */ CSSProperties.prototype.webkitBorderStart; +/** @type {string} */ CSSProperties.prototype.webkitBorderStartColor; +/** @type {string} */ CSSProperties.prototype.webkitBorderStartStyle; +/** @type {string} */ CSSProperties.prototype.webkitBorderStartWidth; +/** @type {string} */ CSSProperties.prototype.webkitBorderTopLeftRadius; +/** @type {string} */ CSSProperties.prototype.webkitBorderTopRightRadius; +/** @type {string} */ CSSProperties.prototype.webkitBorderVerticalSpacing; +/** @type {string} */ CSSProperties.prototype.webkitBoxAlign; +/** @type {string} */ CSSProperties.prototype.webkitBoxDecorationBreak; +/** @type {string} */ CSSProperties.prototype.webkitBoxDirection; +/** @type {string} */ CSSProperties.prototype.webkitBoxFlex; +/** @type {string} */ CSSProperties.prototype.webkitBoxFlexGroup; +/** @type {string} */ CSSProperties.prototype.webkitBoxLines; +/** @type {string} */ CSSProperties.prototype.webkitBoxOrdinalGroup; +/** @type {string} */ CSSProperties.prototype.webkitBoxOrient; +/** @type {string} */ CSSProperties.prototype.webkitBoxPack; +/** @type {string} */ CSSProperties.prototype.webkitBoxReflect; +/** @type {string} */ CSSProperties.prototype.webkitBoxShadow; +/** @type {string} */ CSSProperties.prototype.webkitBoxSizing; +/** @type {string} */ CSSProperties.prototype.webkitColorCorrection; +/** @type {string} */ CSSProperties.prototype.webkitColumnAxis; +/** @type {string} */ CSSProperties.prototype.webkitColumnBreakAfter; +/** @type {string} */ CSSProperties.prototype.webkitColumnBreakBefore; +/** @type {string} */ CSSProperties.prototype.webkitColumnBreakInside; +/** @type {string} */ CSSProperties.prototype.webkitColumnCount; +/** @type {string} */ CSSProperties.prototype.webkitColumnGap; +/** @type {string} */ CSSProperties.prototype.webkitColumnProgression; +/** @type {string} */ CSSProperties.prototype.webkitColumnRule; +/** @type {string} */ CSSProperties.prototype.webkitColumnRuleColor; +/** @type {string} */ CSSProperties.prototype.webkitColumnRuleStyle; +/** @type {string} */ CSSProperties.prototype.webkitColumnRuleWidth; +/** @type {string} */ CSSProperties.prototype.webkitColumns; +/** @type {string} */ CSSProperties.prototype.webkitColumnSpan; +/** @type {string} */ CSSProperties.prototype.webkitColumnWidth; +/** @type {string} */ CSSProperties.prototype.webkitDashboardRegion; +/** @type {string} */ CSSProperties.prototype.webkitFilter; +/** @type {string} */ CSSProperties.prototype.webkitFlex; +/** @type {string} */ CSSProperties.prototype.webkitFlexBasis; +/** @type {string} */ CSSProperties.prototype.webkitFlexDirection; +/** @type {string} */ CSSProperties.prototype.webkitFlexFlow; +/** @type {string} */ CSSProperties.prototype.webkitFlexGrow; +/** @type {string} */ CSSProperties.prototype.webkitFlexShrink; +/** @type {string} */ CSSProperties.prototype.webkitFlexWrap; +/** @type {string} */ CSSProperties.prototype.webkitFlowFrom; +/** @type {string} */ CSSProperties.prototype.webkitFlowInto; +/** @type {string} */ CSSProperties.prototype.webkitFontSizeDelta; +/** @type {string} */ CSSProperties.prototype.webkitFontSmoothing; +/** @type {string} */ CSSProperties.prototype.webkitGridColumn; +/** @type {string} */ CSSProperties.prototype.webkitGridColumns; +/** @type {string} */ CSSProperties.prototype.webkitGridRow; +/** @type {string} */ CSSProperties.prototype.webkitGridRows; +/** @type {string} */ CSSProperties.prototype.webkitHighlight; +/** @type {string} */ CSSProperties.prototype.webkitHyphenateCharacter; +/** @type {string} */ CSSProperties.prototype.webkitHyphenateLimitAfter; +/** @type {string} */ CSSProperties.prototype.webkitHyphenateLimitBefore; +/** @type {string} */ CSSProperties.prototype.webkitHyphenateLimitLines; +/** @type {string} */ CSSProperties.prototype.webkitHyphens; +/** @type {string} */ CSSProperties.prototype.webkitJustifyContent; +/** @type {string} */ CSSProperties.prototype.webkitLineAlign; +/** @type {string} */ CSSProperties.prototype.webkitLineBoxContain; +/** @type {string} */ CSSProperties.prototype.webkitLineBreak; +/** @type {string} */ CSSProperties.prototype.webkitLineClamp; +/** @type {string} */ CSSProperties.prototype.webkitLineGrid; +/** @type {string} */ CSSProperties.prototype.webkitLineSnap; +/** @type {string} */ CSSProperties.prototype.webkitLocale; +/** @type {string} */ CSSProperties.prototype.webkitLogicalHeight; +/** @type {string} */ CSSProperties.prototype.webkitLogicalWidth; +/** @type {string} */ CSSProperties.prototype.webkitMarginAfter; +/** @type {string} */ CSSProperties.prototype.webkitMarginAfterCollapse; +/** @type {string} */ CSSProperties.prototype.webkitMarginBefore; +/** @type {string} */ CSSProperties.prototype.webkitMarginBeforeCollapse; +/** @type {string} */ CSSProperties.prototype.webkitMarginBottomCollapse; +/** @type {string} */ CSSProperties.prototype.webkitMarginCollapse; +/** @type {string} */ CSSProperties.prototype.webkitMarginEnd; +/** @type {string} */ CSSProperties.prototype.webkitMarginStart; +/** @type {string} */ CSSProperties.prototype.webkitMarginTopCollapse; +/** @type {string} */ CSSProperties.prototype.webkitMarquee; +/** @type {string} */ CSSProperties.prototype.webkitMarqueeDirection; +/** @type {string} */ CSSProperties.prototype.webkitMarqueeIncrement; +/** @type {string} */ CSSProperties.prototype.webkitMarqueeRepetition; +/** @type {string} */ CSSProperties.prototype.webkitMarqueeSpeed; +/** @type {string} */ CSSProperties.prototype.webkitMarqueeStyle; +/** @type {string} */ CSSProperties.prototype.webkitMask; +/** @type {string} */ CSSProperties.prototype.webkitMaskAttachment; +/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImage; +/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageOutset; +/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageRepeat; +/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageSlice; +/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageSource; +/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageWidth; +/** @type {string} */ CSSProperties.prototype.webkitMaskClip; +/** @type {string} */ CSSProperties.prototype.webkitMaskComposite; +/** @type {string} */ CSSProperties.prototype.webkitMaskImage; +/** @type {string} */ CSSProperties.prototype.webkitMaskOrigin; +/** @type {string} */ CSSProperties.prototype.webkitMaskPosition; +/** @type {string} */ CSSProperties.prototype.webkitMaskPositionX; +/** @type {string} */ CSSProperties.prototype.webkitMaskPositionY; +/** @type {string} */ CSSProperties.prototype.webkitMaskRepeat; +/** @type {string} */ CSSProperties.prototype.webkitMaskRepeatX; +/** @type {string} */ CSSProperties.prototype.webkitMaskRepeatY; +/** @type {string} */ CSSProperties.prototype.webkitMaskSize; +/** @type {string} */ +CSSProperties.prototype.webkitMatchNearestMailBlockquoteColor; +/** @type {string} */ CSSProperties.prototype.webkitMaxLogicalHeight; +/** @type {string} */ CSSProperties.prototype.webkitMaxLogicalWidth; +/** @type {string} */ CSSProperties.prototype.webkitMinLogicalHeight; +/** @type {string} */ CSSProperties.prototype.webkitMinLogicalWidth; +/** @type {string} */ CSSProperties.prototype.webkitNbspMode; +/** @type {string} */ CSSProperties.prototype.webkitOrder; +/** @type {string} */ CSSProperties.prototype.webkitOverflowScrolling; +/** @type {string} */ CSSProperties.prototype.webkitPaddingAfter; +/** @type {string} */ CSSProperties.prototype.webkitPaddingBefore; +/** @type {string} */ CSSProperties.prototype.webkitPaddingEnd; +/** @type {string} */ CSSProperties.prototype.webkitPaddingStart; +/** @type {string} */ CSSProperties.prototype.webkitPerspective; +/** @type {string} */ CSSProperties.prototype.webkitPerspectiveOrigin; +/** @type {string} */ CSSProperties.prototype.webkitPerspectiveOriginX; +/** @type {string} */ CSSProperties.prototype.webkitPerspectiveOriginY; +/** @type {string} */ CSSProperties.prototype.webkitPrintColorAdjust; +/** @type {string} */ CSSProperties.prototype.webkitRegionBreakAfter; +/** @type {string} */ CSSProperties.prototype.webkitRegionBreakBefore; +/** @type {string} */ CSSProperties.prototype.webkitRegionBreakInside; +/** @type {string} */ CSSProperties.prototype.webkitRegionOverflow; +/** @type {string} */ CSSProperties.prototype.webkitRtlOrdering; +/** @type {string} */ CSSProperties.prototype.webkitRubyPosition; +/** @type {string} */ CSSProperties.prototype.webkitShapeInside; +/** @type {string} */ CSSProperties.prototype.webkitShapeMargin; +/** @type {string} */ CSSProperties.prototype.webkitShapeOutside; +/** @type {string} */ CSSProperties.prototype.webkitShapePadding; +/** @type {string} */ CSSProperties.prototype.webkitTapHighlightColor; +/** @type {string} */ CSSProperties.prototype.webkitTextAlignLast; +/** @type {string} */ CSSProperties.prototype.webkitTextCombine; +/** @type {string} */ CSSProperties.prototype.webkitTextDecorationLine; +/** @type {string} */ CSSProperties.prototype.webkitTextDecorationsInEffect; +/** @type {string} */ CSSProperties.prototype.webkitTextDecorationStyle; +/** @type {string} */ CSSProperties.prototype.webkitTextEmphasis; +/** @type {string} */ CSSProperties.prototype.webkitTextEmphasisColor; +/** @type {string} */ CSSProperties.prototype.webkitTextEmphasisPosition; +/** @type {string} */ CSSProperties.prototype.webkitTextEmphasisStyle; +/** @type {string} */ CSSProperties.prototype.webkitTextFillColor; +/** @type {string} */ CSSProperties.prototype.webkitTextOrientation; +/** @type {string} */ CSSProperties.prototype.webkitTextSecurity; +/** @type {string} */ CSSProperties.prototype.webkitTextSizeAdjust; +/** @type {string} */ CSSProperties.prototype.webkitTextStroke; +/** @type {string} */ CSSProperties.prototype.webkitTextStrokeColor; +/** @type {string} */ CSSProperties.prototype.webkitTextStrokeWidth; +/** @type {string} */ CSSProperties.prototype.webkitTransform; +/** @type {string} */ CSSProperties.prototype.webkitTransformOrigin; +/** @type {string} */ CSSProperties.prototype.webkitTransformOriginX; +/** @type {string} */ CSSProperties.prototype.webkitTransformOriginY; +/** @type {string} */ CSSProperties.prototype.webkitTransformOriginZ; +/** @type {string} */ CSSProperties.prototype.webkitTransformStyle; +/** @type {string} */ CSSProperties.prototype.webkitTransition; +/** @type {string} */ CSSProperties.prototype.webkitTransitionDelay; +/** @type {string} */ CSSProperties.prototype.webkitTransitionDuration; +/** @type {string} */ CSSProperties.prototype.webkitTransitionProperty; +/** @type {string} */ CSSProperties.prototype.webkitTransitionRepeatCount; +/** @type {string} */ CSSProperties.prototype.webkitTransitionTimingFunction; +/** @type {string} */ CSSProperties.prototype.webkitUserDrag; +/** @type {string} */ CSSProperties.prototype.webkitUserModify; +/** @type {string} */ CSSProperties.prototype.webkitUserSelect; +/** @type {string} */ CSSProperties.prototype.webkitWrap; +/** @type {string} */ CSSProperties.prototype.webkitWrapFlow; +/** @type {string} */ CSSProperties.prototype.webkitWrapThrough; +/** @type {string} */ CSSProperties.prototype.webkitWritingMode; + +/** + * @constructor + * @param {number} x + * @param {number} y + */ +function WebKitPoint(x, y) {} + +/** @type {number} */ +WebKitPoint.prototype.x; + +/** @type {number} */ +WebKitPoint.prototype.y; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js new file mode 100644 index 000000000..da8c8fdde --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js @@ -0,0 +1,281 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for all the extensions over W3C's DOM + * specification by WebKit. This file depends on w3c_dom2.js. + * All the provided definitions has been type annotated + * + * @externs + */ + + +/** + * @param {boolean=} opt_center + * @see https://bugzilla.mozilla.org/show_bug.cgi?id=403510 + */ +Element.prototype.scrollIntoViewIfNeeded = function(opt_center) {}; + +/** + * @constructor + * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/MemoryInfo.idl + * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/MemoryInfo.cpp + */ +function MemoryInfo() {}; + +/** @type {number} */ +MemoryInfo.prototype.totalJSHeapSize; + +/** @type {number} */ +MemoryInfo.prototype.usedJSHeapSize; + +/** @type {number} */ +MemoryInfo.prototype.jsHeapSizeLimit; + +/** + * @constructor + * @see http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/ScriptProfileNode.idl + */ +function ScriptProfileNode() {}; + +/** @type {string} */ +ScriptProfileNode.prototype.functionName; + +/** @type {string} */ +ScriptProfileNode.prototype.url; + +/** @type {number} */ +ScriptProfileNode.prototype.lineNumber; + +/** @type {number} */ +ScriptProfileNode.prototype.totalTime; + +/** @type {number} */ +ScriptProfileNode.prototype.selfTime; + +/** @type {number} */ +ScriptProfileNode.prototype.numberOfCalls; + +/** @type {Array.} */ +ScriptProfileNode.prototype.children; + +/** @type {boolean} */ +ScriptProfileNode.prototype.visible; + +/** @type {number} */ +ScriptProfileNode.prototype.callUID; + +/** + * @constructor + * @see http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/ScriptProfile.idl + */ +function ScriptProfile() {}; + +/** @type {string} */ +ScriptProfile.prototype.title; + +/** @type {number} */ +ScriptProfile.prototype.uid; + +/** @type {ScriptProfileNode} */ +ScriptProfile.prototype.head; + +/** + * @constructor + * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/Console.idl + * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/Console.cpp + */ +function Console() {}; + +/** + * @param {*} condition + * @param {...*} var_args + */ +Console.prototype.assert = function(condition, var_args) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.error = function(var_args) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.info = function(var_args) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.log = function(var_args) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.warn = function(var_args) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.debug = function(var_args) {}; + +/** + * @param {*} value + */ +Console.prototype.dir = function(value) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.dirxml = function(var_args) {}; + +/** + * @param {!Object} data + * @param {*=} opt_columns + */ +Console.prototype.table = function(data, opt_columns) {}; + +/** + * @return {undefined} + */ +Console.prototype.trace = function() {}; + +/** + * @param {*} value + */ +Console.prototype.count = function(value) {}; + +/** + * @param {*} value + */ +Console.prototype.markTimeline = function(value) {}; + +/** + * @param {string=} opt_title + */ +Console.prototype.profile = function(opt_title) {}; + +/** @type {Array.} */ +Console.prototype.profiles; + +/** + * @param {string=} opt_title + */ +Console.prototype.profileEnd = function(opt_title) {}; + +/** + * @param {string} name + */ +Console.prototype.time = function(name) {}; + +/** + * @param {string} name + */ +Console.prototype.timeEnd = function(name) {}; + +/** + * @param {*} value + */ +Console.prototype.timeStamp = function(value) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.group = function(var_args) {}; + +/** + * @param {...*} var_args + */ +Console.prototype.groupCollapsed = function(var_args) {}; + +Console.prototype.groupEnd = function() {}; + +Console.prototype.clear = function() {}; + +/** @type {MemoryInfo} */ +Console.prototype.memory; + +/** @type {!Console} */ +Window.prototype.console; + +/** + * @type {!Console} + * @suppress {duplicate} + */ +var console; + +/** + * @type {number} + * @see http://developer.android.com/reference/android/webkit/WebView.html + */ +Window.prototype.devicePixelRatio; + +/** @type {Node} */ +Selection.prototype.baseNode; + +/** @type {number} */ +Selection.prototype.baseOffset; + +/** @type {Node} */ +Selection.prototype.extentNode; + +/** @type {number} */ +Selection.prototype.extentOffset; + +/** @type {string} */ +Selection.prototype.type; + +/** + * @return {undefined} + */ +Selection.prototype.empty = function() {}; + +/** + * @param {Node} baseNode + * @param {number} baseOffset + * @param {Node} extentNode + * @param {number} extentOffset + * @return {undefined} + */ +Selection.prototype.setBaseAndExtent = + function(baseNode, baseOffset, extentNode, extentOffset) {}; + +/** + * @param {string} alter + * @param {string} direction + * @param {string} granularity + * @return {undefined} + */ +Selection.prototype.modify = function(alter, direction, granularity) {}; + +/** + * @param {Element} element + * @param {string} pseudoElement + * @param {boolean=} opt_authorOnly + * @return {CSSRuleList} + * @nosideeffects + */ +ViewCSS.prototype.getMatchedCSSRules = + function(element, pseudoElement, opt_authorOnly) {}; + +/** + * @param {string} contextId + * @param {string} name + * @param {number} width + * @param {number} height + * @nosideeffects + */ +Document.prototype.getCSSCanvasContext = + function(contextId, name, width, height) {}; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js new file mode 100644 index 000000000..9fad616f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js @@ -0,0 +1,48 @@ +/* + * Copyright 2009 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Definitions for all the extensions over W3C's + * event specification by WebKit. This file depends on w3c_event.js. + * All the provided definitions have been type annotated + * + * @externs + */ + +/** @type {number} */ +Event.prototype.wheelDeltaX; + +/** @type {number} */ +Event.prototype.wheelDeltaY; + +/** + * @constructor + * @extends {Event} + * @see http://developer.apple.com/library/safari/documentation/AudioVideo/Reference/WebKitAnimationEventClassReference/WebKitAnimationEvent/WebKitAnimationEvent.html + */ +function WebKitAnimationEvent() {} + +/** + * @type {string} + * @const + */ +WebKitAnimationEvent.prototype.animationName; + +/** + * @type {number} + * @const + */ +WebKitAnimationEvent.prototype.elapsedTime; \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js new file mode 100644 index 000000000..30e4a0bc7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js @@ -0,0 +1,201 @@ +/* + * Copyright 2010 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for W3C's Notifications specification. + * @externs + */ + +/** + * @typedef {{dir: (string|undefined), lang: (string|undefined), + * body: (string|undefined), tag: (string|undefined), + * icon: (string|undefined)}} + * @see http://notifications.spec.whatwg.org/#notificationoptions + */ +var NotificationOptions; + +/** @interface */ +var NotificationOptionsInterface_; +/** @type {string} */ NotificationOptionsInterface_.prototype.dir; +/** @type {string} */ NotificationOptionsInterface_.prototype.lang; +/** @type {string} */ NotificationOptionsInterface_.prototype.body; +/** @type {string} */ NotificationOptionsInterface_.prototype.tag; +/** @type {string} */ NotificationOptionsInterface_.prototype.icon; + +/** + * @param {string} title + * @param {NotificationOptions=} opt_options + * @constructor + * @implements {EventTarget} + * @see http://notifications.spec.whatwg.org/#notification + */ +function Notification(title, opt_options) {} + +/** + * @type {string} + */ +Notification.permission; + +/** + * @param {NotificationPermissionCallback=} opt_callback + */ +Notification.requestPermission = function(opt_callback) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Notification.prototype.addEventListener = + function(type, listener, opt_useCapture) {}; + +/** + * @param {boolean=} opt_useCapture + * @override + */ +Notification.prototype.removeEventListener = + function(type, listener, opt_useCapture) {}; + +/** @override */ +Notification.prototype.dispatchEvent = function(evt) {}; + +/** + * The ID used by clients to uniquely identify notifications to eliminate + * duplicate notifications. + * @type {string} + * @deprecated Use NotificationOptions.tag instead. + */ +Notification.prototype.replaceId; + +/** + * The string used by clients to specify the directionality (rtl/ltr) of the + * notification. + * @type {string} + * @deprecated Use NotificationOptions.titleDir and bodyDir instead. + */ +Notification.prototype.dir; + +/** + * Displays the notification. + */ +Notification.prototype.show = function() {}; + +/** + * Prevents the notification from being displayed, or closes it if it is already + * displayed. + */ +Notification.prototype.cancel = function() {}; + +/** + * Prevents the notification from being displayed, or closes it if it is already + * displayed. + */ +Notification.prototype.close = function() {}; + +/** + * An event handler called when notification is closed. + * @type {?function(Event)} + */ +Notification.prototype.onclose; + +/** + * An event handler called if the notification could not be displayed due to + * an error (i.e. resource could not be loaded). + * @type {?function(Event)} + */ +Notification.prototype.onerror; + +/** + * An event handler called when the notification has become visible. + * @type {?function(Event)} + * @deprecated Use onshow instead. + */ +Notification.prototype.ondisplay; + +/** + * An event handler called when the notification has become visible. + * @type {?function(Event)} + */ +Notification.prototype.onshow; + +/** + * An event handler called when the notification has been clicked on. + * @type {?function(Event)} + */ +Notification.prototype.onclick; + +/** + * @constructor + */ +window.Notification = Notification; + +/** + * @type {string} + */ +window.Notification.permission; + +/** + * @param {NotificationPermissionCallback=} opt_callback + */ +window.Notification.requestPermission = function(opt_callback) {}; + +/** + * @typedef {function(string)} + * @see http://notifications.spec.whatwg.org/#notificationpermissioncallback + */ +var NotificationPermissionCallback; + +/** + * @constructor + * @see http://dev.w3.org/2006/webapi/WebNotifications/publish/#dialog-if + * @deprecated Use Notification instead. + */ +function NotificationCenter() {} + +/** + * Creates a text+icon notification and displays it to the user. + * @param {string} iconUrl + * @param {string} title + * @param {string} body + * @return {Notification} + */ +NotificationCenter.prototype.createNotification = + function(iconUrl, title, body) {}; + +/** + * Creates an HTML notification and displays it to the user. + * @param {string} url + * @return {Notification} + */ +NotificationCenter.prototype.createHTMLNotification = function(url) {}; + +/** + * Checks if the user has permission to display notifications. + * @return {number} + */ +NotificationCenter.prototype.checkPermission = function() {}; + +/** + * Requests permission from the user to display notifications. + * @param {Function=} opt_callback + * @return {void} + */ +NotificationCenter.prototype.requestPermission = function(opt_callback) {}; + +/** + * WebKit browsers expose the NotificationCenter API through + * window.webkitNotifications. + * @type {NotificationCenter} + */ +Window.prototype.webkitNotifications; diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js new file mode 100644 index 000000000..eee69d258 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js @@ -0,0 +1,148 @@ +/* + * Copyright 2009 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Definitions for W3C's WebStorage specification. + * This file depends on html5.js. + * @externs + */ + +/** + * @interface + * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-storage-interface + */ +function Storage() {} + +/** + * @type {number} + * @const + */ +Storage.prototype.length; + +/** + * @param {number} index + * @return {?string} + */ +Storage.prototype.key = function(index) {}; + +/** + * @param {string} key + * @return {?string} + */ +Storage.prototype.getItem = function(key) {}; + +/** + * @param {string} key + * @param {string} data + * @return {void} + */ +Storage.prototype.setItem = function(key, data) {}; + +/** + * @param {string} key + * @return {void} + */ +Storage.prototype.removeItem = function(key) {}; + +/** + * @return {void} + */ +Storage.prototype.clear = function() {}; + +/** + * @interface + * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-sessionstorage-attribute + */ +function WindowSessionStorage() {} + +/** + * @type {Storage} + */ +WindowSessionStorage.prototype.sessionStorage; + +/** + * Window implements WindowSessionStorage + * + * @type {Storage} + */ +Window.prototype.sessionStorage; + +/** + * @interface + * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-localstorage-attribute + */ +function WindowLocalStorage() {} + +/** + * @type {Storage} + */ +WindowLocalStorage.prototype.localStorage; + +/** + * Window implements WindowLocalStorage + * + * @type {Storage} + */ +Window.prototype.localStorage; + +/** + * This is the storage event interface. + * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-storage-event + * @extends {Event} + * @constructor + */ +function StorageEvent() {} + +/** + * @type {string} + */ +StorageEvent.prototype.key; + +/** + * @type {?string} + */ +StorageEvent.prototype.oldValue; + +/** + * @type {?string} + */ +StorageEvent.prototype.newValue; + +/** + * @type {string} + */ +StorageEvent.prototype.url; + +/** + * @type {?Storage} + */ +StorageEvent.prototype.storageArea; + +/** + * @param {string} typeArg + * @param {boolean} canBubbleArg + * @param {boolean} cancelableArg + * @param {string} keyArg + * @param {?string} oldValueArg + * @param {?string} newValueArg + * @param {string} urlArg + * @param {?Storage} storageAreaArg + * @return {void} + */ +StorageEvent.prototype.initStorageEvent = function(typeArg, canBubbleArg, + cancelableArg, keyArg, + oldValueArg, newValueArg, + urlArg, storageAreaArg) {}; + diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js new file mode 100644 index 000000000..34e3945c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js @@ -0,0 +1,191 @@ +/* + * Copyright 2008 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview JavaScript Built-Ins for windows properties. + * + * @externs + * @author stevey@google.com (Steve Yegge) + */ + +// Window properties +// Only common properties are here. Others such as open() +// should be used with an explicit Window object. + +/** + * @type {!Window} + * @see https://developer.mozilla.org/en/DOM/window.top + * @const + */ +var top; + +/** + * @type {Navigator} + * @see https://developer.mozilla.org/en/DOM/window.navigator + * @const + */ +var navigator; + +/** + * @type {!HTMLDocument} + * @see https://developer.mozilla.org/en/DOM/window.document + * @const + */ +var document; + +/** + * @type {Location} + * @see https://developer.mozilla.org/en/DOM/window.location + * @const + * @suppress {duplicate} + * @implicitCast + */ +var location; + +/** + * @type {!Screen} + * @see https://developer.mozilla.org/En/DOM/window.screen + * @const + */ +var screen; + +/** + * @type {!Window} + * @see https://developer.mozilla.org/En/DOM/Window.self + * @const + */ +var self; + +// Magic functions for Firefox's LiveConnect. +// We'll probably never use these in practice. But redefining them +// will fire up the JVM, so we want to reserve the symbol names. + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaArray + */ +var JavaArray; + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaClass + */ +var JavaClass; + +// We just ripped this from the FF source; it doesn't appear to be +// publicly documented. +var JavaMember; + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaObject + */ +var JavaObject; + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaPackage + */ +var JavaPackage; + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Packages + */ +var Packages; + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/java + */ +var java; + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/netscape + */ +var netscape; + +/** + * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/sun + */ +var sun; + +/** + * @see https://developer.mozilla.org/en/DOM/window.alert + */ +function alert(x) {} + +/** + * @param {number|undefined|null} immediateID + * @see https://developer.mozilla.org/en-US/docs/DOM/window.clearImmediate + * @see http://msdn.microsoft.com/en-us/library/ie/hh924825(v=vs.85).aspx + */ +function clearImmediate(immediateID) {} + +/** + * @param {number|undefined?} intervalID + * @see https://developer.mozilla.org/en/DOM/window.clearInterval + * @suppress {duplicate} + */ +function clearInterval(intervalID) {} + +/** + * @param {number|undefined?} timeoutID + * @see https://developer.mozilla.org/en/DOM/window.clearTimeout + * @suppress {duplicate} + */ +function clearTimeout(timeoutID) {} + +/** + * @param {*} message + * @return {boolean} + * @see https://developer.mozilla.org/en/DOM/window.confirm + */ +function confirm(message) {} + +/** + * @see https://developer.mozilla.org/en/DOM/window.dump + */ +function dump(x) {} + +/** + * @param {string} message + * @param {string=} opt_value + * @return {?string} + * @see https://developer.mozilla.org/en/DOM/window.prompt + */ +function prompt(message, opt_value) {} + +/** + * @param {function()} callback + * @return {number} + * @see https://developer.mozilla.org/en-US/docs/DOM/window.setImmediate + * @see http://msdn.microsoft.com/en-us/library/ie/hh773176(v=vs.85).aspx + */ +function setImmediate(callback) {} + +/** + * @param {Function|string} callback + * @param {number=} opt_delay + * @return {number} + * @see https://developer.mozilla.org/en/DOM/window.setInterval + * @see https://html.spec.whatwg.org/multipage/webappapis.html#timers + */ +function setInterval(callback, opt_delay) {} + +/** + * @param {Function|string} callback + * @param {number=} opt_delay + * @param {...*} var_args + * @return {number} + * @see https://developer.mozilla.org/en/DOM/window.setTimeout + * @see https://html.spec.whatwg.org/multipage/webappapis.html#timers + */ +function setTimeout(callback, opt_delay, var_args) {} diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js new file mode 100644 index 000000000..d6122231f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js @@ -0,0 +1,4 @@ +/** @type {WebGL2RenderingContext} */ var myContext; +console.log(myContext.READ_BUFFER); +// See whether WebGL 1.0 properties are correctly type checked. +console.log(myContext.DEPTH_BUFFER_BIT); diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh new file mode 100644 index 000000000..508941f3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +: ${JAVA:=java} + +# Temporary shell script to help shake out the bugs to webgl2.js until +# it's folded back into the Closure workspace. +$JAVA -jar ../../../../closure/compiler.jar \ + --use_only_custom_externs \ + --js test-webgl2.js \ + --externs temp_externs/chrome.js \ + --externs temp_externs/deprecated.js \ + --externs temp_externs/es3.js \ + --externs temp_externs/es5.js \ + --externs temp_externs/es6.js \ + --externs temp_externs/es6_collections.js \ + --externs temp_externs/fileapi.js \ + --externs temp_externs/flash.js \ + --externs temp_externs/gecko_css.js \ + --externs temp_externs/gecko_dom.js \ + --externs temp_externs/gecko_event.js \ + --externs temp_externs/gecko_xml.js \ + --externs temp_externs/google.js \ + --externs temp_externs/html5.js \ + --externs temp_externs/ie_css.js \ + --externs temp_externs/ie_dom.js \ + --externs temp_externs/ie_event.js \ + --externs temp_externs/ie_vml.js \ + --externs temp_externs/intl.js \ + --externs temp_externs/iphone.js \ + --externs temp_externs/mediasource.js \ + --externs temp_externs/page_visibility.js \ + --externs temp_externs/v8.js \ + --externs temp_externs/w3c_anim_timing.js \ + --externs temp_externs/w3c_css.js \ + --externs temp_externs/w3c_css3d.js \ + --externs temp_externs/w3c_device_sensor_event.js \ + --externs temp_externs/w3c_dom1.js \ + --externs temp_externs/w3c_dom2.js \ + --externs temp_externs/w3c_dom3.js \ + --externs temp_externs/w3c_elementtraversal.js \ + --externs temp_externs/w3c_encoding.js \ + --externs temp_externs/w3c_event.js \ + --externs temp_externs/w3c_event3.js \ + --externs temp_externs/w3c_geolocation.js \ + --externs temp_externs/w3c_indexeddb.js \ + --externs temp_externs/w3c_navigation_timing.js \ + --externs temp_externs/w3c_range.js \ + --externs temp_externs/w3c_rtc.js \ + --externs temp_externs/w3c_selectors.js \ + --externs temp_externs/w3c_xml.js \ + --externs temp_externs/webkit_css.js \ + --externs temp_externs/webkit_dom.js \ + --externs temp_externs/webkit_event.js \ + --externs temp_externs/webkit_notifications.js \ + --externs temp_externs/webstorage.js \ + --externs temp_externs/window.js \ + --externs webgl2.js \ + --compilation_level ADVANCED \ + --warning_level VERBOSE \ + --js_output_file /dev/null diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js b/dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js new file mode 100644 index 000000000..5e3680d69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js @@ -0,0 +1,5537 @@ +/* + * Copyright 2010 The Closure Compiler Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// WebGL 2.0 portions: + +/* +** Copyright (c) 2015 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. +*/ + +/** + * @fileoverview Definitions for WebGL functions as described at + * http://www.khronos.org/registry/webgl/specs/latest/1.0 and + * http://www.khronos.org/registry/webgl/specs/latest/2.0 + * + * This file is current up to the WebGL 2.0 spec, including extensions. + * + * This relies on html5.js being included for Canvas and Typed Array support. + * + * This includes some extensions defined at + * http://www.khronos.org/registry/webgl/extensions/ + * + * This file will be merged back into the Closure workspace as soon as + * the WebGL 2.0 changes have been fully tested. + * + * @externs + */ + +/** + * @constructor + * @noalias + * @private + */ +function WebGLRenderingContextBase() {} + +/** @typedef {number} */ +WebGLRenderingContextBase.GLenum; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_BUFFER_BIT; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BUFFER_BIT; + +/** @type {number} */ +WebGLRenderingContextBase.COLOR_BUFFER_BIT; + +/** @type {number} */ +WebGLRenderingContextBase.POINTS; + +/** @type {number} */ +WebGLRenderingContextBase.LINES; + +/** @type {number} */ +WebGLRenderingContextBase.LINE_LOOP; + +/** @type {number} */ +WebGLRenderingContextBase.LINE_STRIP; + +/** @type {number} */ +WebGLRenderingContextBase.TRIANGLES; + +/** @type {number} */ +WebGLRenderingContextBase.TRIANGLE_STRIP; + +/** @type {number} */ +WebGLRenderingContextBase.TRIANGLE_FAN; + +/** @type {number} */ +WebGLRenderingContextBase.ZERO; + +/** @type {number} */ +WebGLRenderingContextBase.ONE; + +/** @type {number} */ +WebGLRenderingContextBase.SRC_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.ONE_MINUS_SRC_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.SRC_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.ONE_MINUS_SRC_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.DST_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.ONE_MINUS_DST_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.DST_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.ONE_MINUS_DST_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.SRC_ALPHA_SATURATE; + +/** @type {number} */ +WebGLRenderingContextBase.FUNC_ADD; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_EQUATION; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_EQUATION_RGB; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_EQUATION_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.FUNC_SUBTRACT; + +/** @type {number} */ +WebGLRenderingContextBase.FUNC_REVERSE_SUBTRACT; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_DST_RGB; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_SRC_RGB; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_DST_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_SRC_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.CONSTANT_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.ONE_MINUS_CONSTANT_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.CONSTANT_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.ONE_MINUS_CONSTANT_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.ARRAY_BUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.ELEMENT_ARRAY_BUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.ARRAY_BUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.ELEMENT_ARRAY_BUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.STREAM_DRAW; + +/** @type {number} */ +WebGLRenderingContextBase.STATIC_DRAW; + +/** @type {number} */ +WebGLRenderingContextBase.DYNAMIC_DRAW; + +/** @type {number} */ +WebGLRenderingContextBase.BUFFER_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.BUFFER_USAGE; + +/** @type {number} */ +WebGLRenderingContextBase.CURRENT_VERTEX_ATTRIB; + +/** @type {number} */ +WebGLRenderingContextBase.FRONT; + +/** @type {number} */ +WebGLRenderingContextBase.BACK; + +/** @type {number} */ +WebGLRenderingContextBase.FRONT_AND_BACK; + +/** @type {number} */ +WebGLRenderingContextBase.CULL_FACE; + +/** @type {number} */ +WebGLRenderingContextBase.BLEND; + +/** @type {number} */ +WebGLRenderingContextBase.DITHER; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_TEST; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_TEST; + +/** @type {number} */ +WebGLRenderingContextBase.SCISSOR_TEST; + +/** @type {number} */ +WebGLRenderingContextBase.POLYGON_OFFSET_FILL; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLE_ALPHA_TO_COVERAGE; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLE_COVERAGE; + +/** @type {number} */ +WebGLRenderingContextBase.NO_ERROR; + +/** @type {number} */ +WebGLRenderingContextBase.INVALID_ENUM; + +/** @type {number} */ +WebGLRenderingContextBase.INVALID_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.INVALID_OPERATION; + +/** @type {number} */ +WebGLRenderingContextBase.OUT_OF_MEMORY; + +/** @type {number} */ +WebGLRenderingContextBase.CW; + +/** @type {number} */ +WebGLRenderingContextBase.CCW; + +/** @type {number} */ +WebGLRenderingContextBase.LINE_WIDTH; + +/** @type {number} */ +WebGLRenderingContextBase.ALIASED_POINT_SIZE_RANGE; + +/** @type {number} */ +WebGLRenderingContextBase.ALIASED_LINE_WIDTH_RANGE; + +/** @type {number} */ +WebGLRenderingContextBase.CULL_FACE_MODE; + +/** @type {number} */ +WebGLRenderingContextBase.FRONT_FACE; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_RANGE; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_CLEAR_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_FUNC; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_CLEAR_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_FUNC; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_PASS_DEPTH_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_PASS_DEPTH_PASS; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_REF; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_VALUE_MASK; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BACK_FUNC; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BACK_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BACK_PASS_DEPTH_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BACK_PASS_DEPTH_PASS; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BACK_REF; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BACK_VALUE_MASK; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BACK_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.VIEWPORT; + +/** @type {number} */ +WebGLRenderingContextBase.SCISSOR_BOX; + +/** @type {number} */ +WebGLRenderingContextBase.COLOR_CLEAR_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.COLOR_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.UNPACK_ALIGNMENT; + +/** @type {number} */ +WebGLRenderingContextBase.PACK_ALIGNMENT; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_TEXTURE_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_VIEWPORT_DIMS; + +/** @type {number} */ +WebGLRenderingContextBase.SUBPIXEL_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.RED_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.GREEN_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.BLUE_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.ALPHA_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.POLYGON_OFFSET_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.POLYGON_OFFSET_FACTOR; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_BINDING_2D; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLE_BUFFERS; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLES; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLE_COVERAGE_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLE_COVERAGE_INVERT; + +/** @type {number} */ +WebGLRenderingContextBase.COMPRESSED_TEXTURE_FORMATS; + +/** @type {number} */ +WebGLRenderingContextBase.DONT_CARE; + +/** @type {number} */ +WebGLRenderingContextBase.FASTEST; + +/** @type {number} */ +WebGLRenderingContextBase.NICEST; + +/** @type {number} */ +WebGLRenderingContextBase.GENERATE_MIPMAP_HINT; + +/** @type {number} */ +WebGLRenderingContextBase.BYTE; + +/** @type {number} */ +WebGLRenderingContextBase.UNSIGNED_BYTE; + +/** @type {number} */ +WebGLRenderingContextBase.SHORT; + +/** @type {number} */ +WebGLRenderingContextBase.UNSIGNED_SHORT; + +/** @type {number} */ +WebGLRenderingContextBase.INT; + +/** @type {number} */ +WebGLRenderingContextBase.UNSIGNED_INT; + +/** @type {number} */ +WebGLRenderingContextBase.FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_COMPONENT; + +/** @type {number} */ +WebGLRenderingContextBase.ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.RGB; + +/** @type {number} */ +WebGLRenderingContextBase.RGBA; + +/** @type {number} */ +WebGLRenderingContextBase.LUMINANCE; + +/** @type {number} */ +WebGLRenderingContextBase.LUMINANCE_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.UNSIGNED_SHORT_4_4_4_4; + +/** @type {number} */ +WebGLRenderingContextBase.UNSIGNED_SHORT_5_5_5_1; + +/** @type {number} */ +WebGLRenderingContextBase.UNSIGNED_SHORT_5_6_5; + +/** @type {number} */ +WebGLRenderingContextBase.FRAGMENT_SHADER; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_SHADER; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_VERTEX_ATTRIBS; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_VERTEX_UNIFORM_VECTORS; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_VARYING_VECTORS; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_COMBINED_TEXTURE_IMAGE_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_VERTEX_TEXTURE_IMAGE_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_TEXTURE_IMAGE_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_FRAGMENT_UNIFORM_VECTORS; + +/** @type {number} */ +WebGLRenderingContextBase.SHADER_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.DELETE_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.LINK_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.VALIDATE_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.ATTACHED_SHADERS; + +/** @type {number} */ +WebGLRenderingContextBase.ACTIVE_UNIFORMS; + +/** @type {number} */ +WebGLRenderingContextBase.ACTIVE_ATTRIBUTES; + +/** @type {number} */ +WebGLRenderingContextBase.SHADING_LANGUAGE_VERSION; + +/** @type {number} */ +WebGLRenderingContextBase.CURRENT_PROGRAM; + +/** @type {number} */ +WebGLRenderingContextBase.NEVER; + +/** @type {number} */ +WebGLRenderingContextBase.LESS; + +/** @type {number} */ +WebGLRenderingContextBase.EQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.LEQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.GREATER; + +/** @type {number} */ +WebGLRenderingContextBase.NOTEQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.GEQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.ALWAYS; + +/** @type {number} */ +WebGLRenderingContextBase.KEEP; + +/** @type {number} */ +WebGLRenderingContextBase.REPLACE; + +/** @type {number} */ +WebGLRenderingContextBase.INCR; + +/** @type {number} */ +WebGLRenderingContextBase.DECR; + +/** @type {number} */ +WebGLRenderingContextBase.INVERT; + +/** @type {number} */ +WebGLRenderingContextBase.INCR_WRAP; + +/** @type {number} */ +WebGLRenderingContextBase.DECR_WRAP; + +/** @type {number} */ +WebGLRenderingContextBase.VENDOR; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERER; + +/** @type {number} */ +WebGLRenderingContextBase.VERSION; + +/** @type {number} */ +WebGLRenderingContextBase.NEAREST; + +/** @type {number} */ +WebGLRenderingContextBase.LINEAR; + +/** @type {number} */ +WebGLRenderingContextBase.NEAREST_MIPMAP_NEAREST; + +/** @type {number} */ +WebGLRenderingContextBase.LINEAR_MIPMAP_NEAREST; + +/** @type {number} */ +WebGLRenderingContextBase.NEAREST_MIPMAP_LINEAR; + +/** @type {number} */ +WebGLRenderingContextBase.LINEAR_MIPMAP_LINEAR; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_MAG_FILTER; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_MIN_FILTER; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_WRAP_S; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_WRAP_T; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_2D; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_CUBE_MAP; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_BINDING_CUBE_MAP; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_CUBE_MAP_POSITIVE_X; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_CUBE_MAP_NEGATIVE_X; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_CUBE_MAP_POSITIVE_Y; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_CUBE_MAP_NEGATIVE_Y; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_CUBE_MAP_POSITIVE_Z; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE_CUBE_MAP_NEGATIVE_Z; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_CUBE_MAP_TEXTURE_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE0; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE1; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE2; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE3; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE4; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE5; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE6; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE7; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE8; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE9; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE10; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE11; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE12; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE13; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE14; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE15; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE16; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE17; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE18; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE19; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE20; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE21; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE22; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE23; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE24; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE25; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE26; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE27; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE28; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE29; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE30; + +/** @type {number} */ +WebGLRenderingContextBase.TEXTURE31; + +/** @type {number} */ +WebGLRenderingContextBase.ACTIVE_TEXTURE; + +/** @type {number} */ +WebGLRenderingContextBase.REPEAT; + +/** @type {number} */ +WebGLRenderingContextBase.CLAMP_TO_EDGE; + +/** @type {number} */ +WebGLRenderingContextBase.MIRRORED_REPEAT; + +/** @type {number} */ +WebGLRenderingContextBase.FLOAT_VEC2; + +/** @type {number} */ +WebGLRenderingContextBase.FLOAT_VEC3; + +/** @type {number} */ +WebGLRenderingContextBase.FLOAT_VEC4; + +/** @type {number} */ +WebGLRenderingContextBase.INT_VEC2; + +/** @type {number} */ +WebGLRenderingContextBase.INT_VEC3; + +/** @type {number} */ +WebGLRenderingContextBase.INT_VEC4; + +/** @type {number} */ +WebGLRenderingContextBase.BOOL; + +/** @type {number} */ +WebGLRenderingContextBase.BOOL_VEC2; + +/** @type {number} */ +WebGLRenderingContextBase.BOOL_VEC3; + +/** @type {number} */ +WebGLRenderingContextBase.BOOL_VEC4; + +/** @type {number} */ +WebGLRenderingContextBase.FLOAT_MAT2; + +/** @type {number} */ +WebGLRenderingContextBase.FLOAT_MAT3; + +/** @type {number} */ +WebGLRenderingContextBase.FLOAT_MAT4; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLER_2D; + +/** @type {number} */ +WebGLRenderingContextBase.SAMPLER_CUBE; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_ENABLED; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_STRIDE; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_NORMALIZED; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_POINTER; + +/** @type {number} */ +WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.IMPLEMENTATION_COLOR_READ_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.IMPLEMENTATION_COLOR_READ_FORMAT; + +/** @type {number} */ +WebGLRenderingContextBase.COMPILE_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.LOW_FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.MEDIUM_FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.HIGH_FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.LOW_INT; + +/** @type {number} */ +WebGLRenderingContextBase.MEDIUM_INT; + +/** @type {number} */ +WebGLRenderingContextBase.HIGH_INT; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.RGBA4; + +/** @type {number} */ +WebGLRenderingContextBase.RGB5_A1; + +/** @type {number} */ +WebGLRenderingContextBase.RGB565; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_COMPONENT16; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_INDEX; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_INDEX8; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_STENCIL; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_WIDTH; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_HEIGHT; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_INTERNAL_FORMAT; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_RED_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_GREEN_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_BLUE_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_ALPHA_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_DEPTH_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_STENCIL_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE; + +/** @type {number} */ +WebGLRenderingContextBase.COLOR_ATTACHMENT0; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.STENCIL_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.DEPTH_STENCIL_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.NONE; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_COMPLETE; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_INCOMPLETE_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_INCOMPLETE_DIMENSIONS; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_UNSUPPORTED; + +/** @type {number} */ +WebGLRenderingContextBase.FRAMEBUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.RENDERBUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.MAX_RENDERBUFFER_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.INVALID_FRAMEBUFFER_OPERATION; + +/** @type {number} */ +WebGLRenderingContextBase.UNPACK_FLIP_Y_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.UNPACK_PREMULTIPLY_ALPHA_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.CONTEXT_LOST_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.UNPACK_COLORSPACE_CONVERSION_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.BROWSER_DEFAULT_WEBGL; + + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_BUFFER_BIT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BUFFER_BIT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.COLOR_BUFFER_BIT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.POINTS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINES; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINE_LOOP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINE_STRIP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TRIANGLES; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TRIANGLE_STRIP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TRIANGLE_FAN; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ZERO; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ONE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SRC_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ONE_MINUS_SRC_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SRC_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ONE_MINUS_SRC_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DST_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ONE_MINUS_DST_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DST_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ONE_MINUS_DST_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SRC_ALPHA_SATURATE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FUNC_ADD; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_EQUATION; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_EQUATION_RGB; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_EQUATION_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FUNC_SUBTRACT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FUNC_REVERSE_SUBTRACT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_DST_RGB; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_SRC_RGB; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_DST_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_SRC_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CONSTANT_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ONE_MINUS_CONSTANT_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CONSTANT_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ONE_MINUS_CONSTANT_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND_COLOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ARRAY_BUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ELEMENT_ARRAY_BUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ARRAY_BUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ELEMENT_ARRAY_BUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STREAM_DRAW; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STATIC_DRAW; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DYNAMIC_DRAW; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BUFFER_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BUFFER_USAGE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CURRENT_VERTEX_ATTRIB; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRONT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BACK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRONT_AND_BACK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CULL_FACE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLEND; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DITHER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_TEST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_TEST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SCISSOR_TEST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.POLYGON_OFFSET_FILL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLE_ALPHA_TO_COVERAGE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLE_COVERAGE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NO_ERROR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INVALID_ENUM; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INVALID_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INVALID_OPERATION; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.OUT_OF_MEMORY; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CW; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CCW; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINE_WIDTH; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ALIASED_POINT_SIZE_RANGE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ALIASED_LINE_WIDTH_RANGE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CULL_FACE_MODE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRONT_FACE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_RANGE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_CLEAR_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_FUNC; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_CLEAR_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_FUNC; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_PASS_DEPTH_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_PASS_DEPTH_PASS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_REF; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_VALUE_MASK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BACK_FUNC; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BACK_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BACK_PASS_DEPTH_FAIL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BACK_PASS_DEPTH_PASS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BACK_REF; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BACK_VALUE_MASK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BACK_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VIEWPORT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SCISSOR_BOX; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.COLOR_CLEAR_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.COLOR_WRITEMASK; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNPACK_ALIGNMENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.PACK_ALIGNMENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_TEXTURE_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_VIEWPORT_DIMS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SUBPIXEL_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RED_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.GREEN_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BLUE_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ALPHA_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_BITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.POLYGON_OFFSET_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.POLYGON_OFFSET_FACTOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_BINDING_2D; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLE_BUFFERS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLES; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLE_COVERAGE_VALUE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLE_COVERAGE_INVERT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.COMPRESSED_TEXTURE_FORMATS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DONT_CARE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FASTEST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NICEST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.GENERATE_MIPMAP_HINT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BYTE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNSIGNED_BYTE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SHORT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNSIGNED_SHORT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNSIGNED_INT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_COMPONENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RGB; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RGBA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LUMINANCE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LUMINANCE_ALPHA; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNSIGNED_SHORT_4_4_4_4; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNSIGNED_SHORT_5_5_5_1; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNSIGNED_SHORT_5_6_5; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAGMENT_SHADER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_SHADER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_VERTEX_ATTRIBS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_VERTEX_UNIFORM_VECTORS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_VARYING_VECTORS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_COMBINED_TEXTURE_IMAGE_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_VERTEX_TEXTURE_IMAGE_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_TEXTURE_IMAGE_UNITS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_FRAGMENT_UNIFORM_VECTORS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SHADER_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DELETE_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINK_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VALIDATE_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ATTACHED_SHADERS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ACTIVE_UNIFORMS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ACTIVE_ATTRIBUTES; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SHADING_LANGUAGE_VERSION; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CURRENT_PROGRAM; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NEVER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LESS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.EQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LEQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.GREATER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NOTEQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.GEQUAL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ALWAYS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.KEEP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.REPLACE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INCR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DECR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INVERT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INCR_WRAP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DECR_WRAP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VENDOR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERSION; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NEAREST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINEAR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NEAREST_MIPMAP_NEAREST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINEAR_MIPMAP_NEAREST; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NEAREST_MIPMAP_LINEAR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LINEAR_MIPMAP_LINEAR; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_MAG_FILTER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_MIN_FILTER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_WRAP_S; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_WRAP_T; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_2D; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_BINDING_CUBE_MAP; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_POSITIVE_X; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_NEGATIVE_X; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_POSITIVE_Y; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_NEGATIVE_Y; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_POSITIVE_Z; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_NEGATIVE_Z; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_CUBE_MAP_TEXTURE_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE0; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE1; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE2; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE3; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE4; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE5; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE6; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE7; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE8; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE9; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE10; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE11; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE12; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE13; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE14; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE15; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE16; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE17; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE18; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE19; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE20; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE21; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE22; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE23; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE24; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE25; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE26; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE27; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE28; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE29; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE30; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.TEXTURE31; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.ACTIVE_TEXTURE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.REPEAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CLAMP_TO_EDGE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MIRRORED_REPEAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FLOAT_VEC2; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FLOAT_VEC3; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FLOAT_VEC4; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INT_VEC2; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INT_VEC3; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INT_VEC4; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BOOL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BOOL_VEC2; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BOOL_VEC3; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BOOL_VEC4; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FLOAT_MAT2; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FLOAT_MAT3; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FLOAT_MAT4; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLER_2D; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.SAMPLER_CUBE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_ENABLED; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_STRIDE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_NORMALIZED; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_POINTER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.IMPLEMENTATION_COLOR_READ_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.IMPLEMENTATION_COLOR_READ_FORMAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.COMPILE_STATUS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LOW_FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MEDIUM_FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.HIGH_FLOAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.LOW_INT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MEDIUM_INT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.HIGH_INT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RGBA4; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RGB5_A1; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RGB565; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_COMPONENT16; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_INDEX; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_INDEX8; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_STENCIL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_WIDTH; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_HEIGHT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_INTERNAL_FORMAT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_RED_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_GREEN_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_BLUE_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_ALPHA_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_DEPTH_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_STENCIL_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.COLOR_ATTACHMENT0; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.STENCIL_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.DEPTH_STENCIL_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.NONE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_COMPLETE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_DIMENSIONS; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_UNSUPPORTED; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.FRAMEBUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.RENDERBUFFER_BINDING; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.MAX_RENDERBUFFER_SIZE; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.INVALID_FRAMEBUFFER_OPERATION; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNPACK_FLIP_Y_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNPACK_PREMULTIPLY_ALPHA_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.CONTEXT_LOST_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.UNPACK_COLORSPACE_CONVERSION_WEBGL; + +/** @type {number} */ +WebGLRenderingContextBase.prototype.BROWSER_DEFAULT_WEBGL; + + +/** + * @type {!HTMLCanvasElement} + */ +WebGLRenderingContextBase.prototype.canvas; + +/** + * @type {number} + */ +WebGLRenderingContextBase.prototype.drawingBufferWidth; + +/** + * @type {number} + */ +WebGLRenderingContextBase.prototype.drawingBufferHeight; + +/** + * @return {!WebGLContextAttributes} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getContextAttributes = function() {}; + +/** + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isContextLost = function() {}; + +/** + * @return {!Array.} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getSupportedExtensions = function() {}; + +/** + * Note that this has side effects by enabling the extension even if the + * result is not used. + * @param {string} name + * @return {Object} + */ +WebGLRenderingContextBase.prototype.getExtension = function(name) {}; + +/** + * @param {number} texture + */ +WebGLRenderingContextBase.prototype.activeTexture = function(texture) {}; + +/** + * @param {WebGLProgram} program + * @param {WebGLShader} shader + */ +WebGLRenderingContextBase.prototype.attachShader = function(program, shader) {}; + +/** + * @param {WebGLProgram} program + * @param {number} index + * @param {string} name + */ +WebGLRenderingContextBase.prototype.bindAttribLocation = function( + program, index, name) {}; + +/** + * @param {number} target + * @param {WebGLBuffer} buffer + */ +WebGLRenderingContextBase.prototype.bindBuffer = function(target, buffer) {}; + +/** + * @param {number} target + * @param {WebGLFramebuffer} buffer + */ +WebGLRenderingContextBase.prototype.bindFramebuffer = function(target, buffer) {}; + +/** + * @param {number} target + * @param {WebGLRenderbuffer} buffer + */ +WebGLRenderingContextBase.prototype.bindRenderbuffer = function(target, buffer) {}; + +/** + * @param {number} target + * @param {WebGLTexture} texture + */ +WebGLRenderingContextBase.prototype.bindTexture = function(target, texture) {}; + +/** + * @param {number} red + * @param {number} green + * @param {number} blue + * @param {number} alpha + */ +WebGLRenderingContextBase.prototype.blendColor = function( + red, blue, green, alpha) {}; + +/** + * @param {number} mode + */ +WebGLRenderingContextBase.prototype.blendEquation = function(mode) {}; + +/** + * @param {number} modeRGB + * @param {number} modeAlpha + */ +WebGLRenderingContextBase.prototype.blendEquationSeparate = function( + modeRGB, modeAlpha) {}; + +/** + * @param {number} sfactor + * @param {number} dfactor + */ +WebGLRenderingContextBase.prototype.blendFunc = function(sfactor, dfactor) {}; + +/** + * @param {number} srcRGB + * @param {number} dstRGB + * @param {number} srcAlpha + * @param {number} dstAlpha + */ +WebGLRenderingContextBase.prototype.blendFuncSeparate = function( + srcRGB, dstRGB, srcAlpha, dstAlpha) {}; + +/** + * @param {number} target + * @param {ArrayBufferView|ArrayBuffer|number} data + * @param {number} usage + */ +WebGLRenderingContextBase.prototype.bufferData = function(target, data, usage) {}; + +/** + * @param {number} target + * @param {number} offset + * @param {ArrayBufferView|ArrayBuffer} data + */ +WebGLRenderingContextBase.prototype.bufferSubData = function( + target, offset, data) {}; + +/** + * @param {number} target + * @return {number} + */ +WebGLRenderingContextBase.prototype.checkFramebufferStatus = function(target) {}; + +/** + * @param {number} mask + */ +WebGLRenderingContextBase.prototype.clear = function(mask) {}; + +/** + * @param {number} red + * @param {number} green + * @param {number} blue + * @param {number} alpha + */ +WebGLRenderingContextBase.prototype.clearColor = function( + red, green, blue, alpha) {}; + +/** + * @param {number} depth + */ +WebGLRenderingContextBase.prototype.clearDepth = function(depth) {}; + +/** + * @param {number} s + */ +WebGLRenderingContextBase.prototype.clearStencil = function(s) {}; + +/** + * @param {boolean} red + * @param {boolean} green + * @param {boolean} blue + * @param {boolean} alpha + */ +WebGLRenderingContextBase.prototype.colorMask = function( + red, green, blue, alpha) {}; + +/** + * @param {WebGLShader} shader + */ +WebGLRenderingContextBase.prototype.compileShader = function(shader) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} internalformat + * @param {number} width + * @param {number} height + * @param {number} border + * @param {ArrayBufferView} data + */ +WebGLRenderingContextBase.prototype.compressedTexImage2D = function( + target, level, internalformat, width, height, border, data) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} xoffset + * @param {number} yoffset + * @param {number} width + * @param {number} height + * @param {number} format + * @param {ArrayBufferView} data + */ +WebGLRenderingContextBase.prototype.compressedTexSubImage2D = function( + target, level, xoffset, yoffset, width, height, format, data) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} format + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} border + */ +WebGLRenderingContextBase.prototype.copyTexImage2D = function( + target, level, format, x, y, width, height, border) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} xoffset + * @param {number} yoffset + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ +WebGLRenderingContextBase.prototype.copyTexSubImage2D = function( + target, level, xoffset, yoffset, x, y, width, height) {}; + +/** + * @return {!WebGLBuffer} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.createBuffer = function() {}; + +/** + * @return {!WebGLFramebuffer} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.createFramebuffer = function() {}; + +/** + * @return {!WebGLProgram} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.createProgram = function() {}; + +/** + * @return {!WebGLRenderbuffer} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.createRenderbuffer = function() {}; + +/** + * @param {number} type + * @return {!WebGLShader} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.createShader = function(type) {}; + +/** + * @return {!WebGLTexture} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.createTexture = function() {}; + +/** + * @param {number} mode + */ +WebGLRenderingContextBase.prototype.cullFace = function(mode) {}; + +/** + * @param {WebGLBuffer} buffer + */ +WebGLRenderingContextBase.prototype.deleteBuffer = function(buffer) {}; + +/** + * @param {WebGLFramebuffer} buffer + */ +WebGLRenderingContextBase.prototype.deleteFramebuffer = function(buffer) {}; + +/** + * @param {WebGLProgram} program + */ +WebGLRenderingContextBase.prototype.deleteProgram = function(program) {}; + +/** + * @param {WebGLRenderbuffer} buffer + */ +WebGLRenderingContextBase.prototype.deleteRenderbuffer = function(buffer) {}; + +/** + * @param {WebGLShader} shader + */ +WebGLRenderingContextBase.prototype.deleteShader = function(shader) {}; + +/** + * @param {WebGLTexture} texture + */ +WebGLRenderingContextBase.prototype.deleteTexture = function(texture) {}; + +/** + * @param {number} func + */ +WebGLRenderingContextBase.prototype.depthFunc = function(func) {}; + +/** + * @param {boolean} flag + */ +WebGLRenderingContextBase.prototype.depthMask = function(flag) {}; + +/** + * @param {number} nearVal + * @param {number} farVal + */ +WebGLRenderingContextBase.prototype.depthRange = function(nearVal, farVal) {}; + +/** + * @param {WebGLProgram} program + * @param {WebGLShader} shader + */ +WebGLRenderingContextBase.prototype.detachShader = function(program, shader) {}; + +/** + * @param {number} flags + */ +WebGLRenderingContextBase.prototype.disable = function(flags) {}; + +/** + * @param {number} index + */ +WebGLRenderingContextBase.prototype.disableVertexAttribArray = function( + index) {}; + +/** + * @param {number} mode + * @param {number} first + * @param {number} count + */ +WebGLRenderingContextBase.prototype.drawArrays = function(mode, first, count) {}; + +/** + * @param {number} mode + * @param {number} count + * @param {number} type + * @param {number} offset + */ +WebGLRenderingContextBase.prototype.drawElements = function( + mode, count, type, offset) {}; + +/** + * @param {number} cap + */ +WebGLRenderingContextBase.prototype.enable = function(cap) {}; + +/** + * @param {number} index + */ +WebGLRenderingContextBase.prototype.enableVertexAttribArray = function( + index) {}; + +WebGLRenderingContextBase.prototype.finish = function() {}; + +WebGLRenderingContextBase.prototype.flush = function() {}; + +/** + * @param {number} target + * @param {number} attachment + * @param {number} renderbuffertarget + * @param {WebGLRenderbuffer} renderbuffer + */ +WebGLRenderingContextBase.prototype.framebufferRenderbuffer = function( + target, attachment, renderbuffertarget, renderbuffer) {}; + +/** + * @param {number} target + * @param {number} attachment + * @param {number} textarget + * @param {WebGLTexture} texture + * @param {number} level + */ +WebGLRenderingContextBase.prototype.framebufferTexture2D = function( + target, attachment, textarget, texture, level) {}; + +/** + * @param {number} mode + */ +WebGLRenderingContextBase.prototype.frontFace = function(mode) {}; + +/** + * @param {number} target + */ +WebGLRenderingContextBase.prototype.generateMipmap = function(target) {}; + +/** + * @param {WebGLProgram} program + * @param {number} index + * @return {WebGLActiveInfo} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getActiveAttrib = function(program, index) {}; + +/** + * @param {WebGLProgram} program + * @param {number} index + * @return {WebGLActiveInfo} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getActiveUniform = function(program, index) {}; + +/** + * @param {WebGLProgram} program + * @return {!Array.} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getAttachedShaders = function(program) {}; + +/** + * @param {WebGLProgram} program + * @param {string} name + * @return {number} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getAttribLocation = function(program, name) {}; + +/** + * @param {number} target + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getBufferParameter = function(target, pname) {}; + +/** + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getParameter = function(pname) {}; + +/** + * @return {number} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getError = function() {}; + +/** + * @param {number} target + * @param {number} attachment + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getFramebufferAttachmentParameter = function( + target, attachment, pname) {}; + +/** + * @param {WebGLProgram} program + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getProgramParameter = function( + program, pname) {}; + +/** + * @param {WebGLProgram} program + * @return {string} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getProgramInfoLog = function(program) {}; + +/** + * @param {number} target + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getRenderbufferParameter = function( + target, pname) {}; + +/** + * @param {WebGLShader} shader + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getShaderParameter = function(shader, pname) {}; + +/** + * @param {number} shadertype + * @param {number} precisiontype + * @return {WebGLShaderPrecisionFormat} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getShaderPrecisionFormat = function(shadertype, + precisiontype) {}; + +/** + * @param {WebGLShader} shader + * @return {string} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getShaderInfoLog = function(shader) {}; + +/** + * @param {WebGLShader} shader + * @return {string} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getShaderSource = function(shader) {}; + +/** + * @param {number} target + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getTexParameter = function(target, pname) {}; + +/** + * @param {WebGLProgram} program + * @param {WebGLUniformLocation} location + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getUniform = function(program, location) {}; + +/** + * @param {WebGLProgram} program + * @param {string} name + * @return {WebGLUniformLocation} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getUniformLocation = function(program, name) {}; + +/** + * @param {number} index + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getVertexAttrib = function(index, pname) {}; + +/** + * @param {number} index + * @param {number} pname + * @return {number} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.getVertexAttribOffset = function( + index, pname) {}; + +/** + * @param {number} target + * @param {number} mode + */ +WebGLRenderingContextBase.prototype.hint = function(target, mode) {}; + +/** + * @param {WebGLObject} buffer + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isBuffer = function(buffer) {}; + +/** + * @param {number} cap + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isEnabled = function(cap) {}; + +/** + * @param {WebGLObject} framebuffer + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isFramebuffer = function(framebuffer) {}; + +/** + * @param {WebGLObject} program + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isProgram = function(program) {}; + +/** + * @param {WebGLObject} renderbuffer + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isRenderbuffer = function(renderbuffer) {}; + +/** + * @param {WebGLObject} shader + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isShader = function(shader) {}; + +/** + * @param {WebGLObject} texture + * @return {boolean} + * @nosideeffects + */ +WebGLRenderingContextBase.prototype.isTexture = function(texture) {}; + +/** + * @param {number} width + */ +WebGLRenderingContextBase.prototype.lineWidth = function(width) {}; + +/** + * @param {WebGLProgram} program + */ +WebGLRenderingContextBase.prototype.linkProgram = function(program) {}; + +/** + * @param {number} pname + * @param {number} param + */ +WebGLRenderingContextBase.prototype.pixelStorei = function(pname, param) {}; + +/** + * @param {number} factor + * @param {number} units + */ +WebGLRenderingContextBase.prototype.polygonOffset = function(factor, units) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} format + * @param {number} type + * @param {ArrayBufferView} pixels + */ +WebGLRenderingContextBase.prototype.readPixels = function( + x, y, width, height, format, type, pixels) {}; + +/** + * @param {number} target + * @param {number} internalformat + * @param {number} width + * @param {number} height + */ +WebGLRenderingContextBase.prototype.renderbufferStorage = function( + target, internalformat, width, height) {}; + +/** + * @param {number} coverage + * @param {boolean} invert + */ +WebGLRenderingContextBase.prototype.sampleCoverage = function(coverage, invert) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ +WebGLRenderingContextBase.prototype.scissor = function(x, y, width, height) {}; + +/** + * @param {WebGLShader} shader + * @param {string} source + */ +WebGLRenderingContextBase.prototype.shaderSource = function(shader, source) {}; + +/** + * @param {number} func + * @param {number} ref + * @param {number} mask + */ +WebGLRenderingContextBase.prototype.stencilFunc = function(func, ref, mask) {}; + +/** + * @param {number} face + * @param {number} func + * @param {number} ref + * @param {number} mask + */ +WebGLRenderingContextBase.prototype.stencilFuncSeparate = function( + face, func, ref, mask) {}; + +/** + * @param {number} mask + */ +WebGLRenderingContextBase.prototype.stencilMask = function(mask) {}; + +/** + * @param {number} face + * @param {number} mask + */ +WebGLRenderingContextBase.prototype.stencilMaskSeparate = function(face, mask) {}; + +/** + * @param {number} fail + * @param {number} zfail + * @param {number} zpass + */ +WebGLRenderingContextBase.prototype.stencilOp = function(fail, zfail, zpass) {}; + +/** + * @param {number} face + * @param {number} fail + * @param {number} zfail + * @param {number} zpass + */ +WebGLRenderingContextBase.prototype.stencilOpSeparate = function( + face, fail, zfail, zpass) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} internalformat + * @param {number} format or width + * @param {number} type or height + * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement| + * number} img or border + * @param {number=} opt_format + * @param {number=} opt_type + * @param {ArrayBufferView=} opt_pixels + */ +WebGLRenderingContextBase.prototype.texImage2D = function( + target, level, internalformat, format, type, img, opt_format, opt_type, + opt_pixels) {}; + +/** + * @param {number} target + * @param {number} pname + * @param {number} param + */ +WebGLRenderingContextBase.prototype.texParameterf = function( + target, pname, param) {}; + +/** + * @param {number} target + * @param {number} pname + * @param {number} param + */ +WebGLRenderingContextBase.prototype.texParameteri = function( + target, pname, param) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} xoffset + * @param {number} yoffset + * @param {number} format or width + * @param {number} type or height + * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement| + * number} data or format + * @param {number=} opt_type + * @param {ArrayBufferView=} opt_pixels + */ +WebGLRenderingContextBase.prototype.texSubImage2D = function( + target, level, xoffset, yoffset, format, type, data, opt_type, + opt_pixels) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value + */ +WebGLRenderingContextBase.prototype.uniform1f = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Float32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform1fv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value + */ +WebGLRenderingContextBase.prototype.uniform1i = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Int32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform1iv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value1 + * @param {number} value2 + */ +WebGLRenderingContextBase.prototype.uniform2f = function( + location, value1, value2) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Float32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform2fv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value1 + * @param {number} value2 + */ +WebGLRenderingContextBase.prototype.uniform2i = function( + location, value1, value2) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Int32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform2iv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value1 + * @param {number} value2 + * @param {number} value3 + */ +WebGLRenderingContextBase.prototype.uniform3f = function( + location, value1, value2, value3) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Float32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform3fv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value1 + * @param {number} value2 + * @param {number} value3 + */ +WebGLRenderingContextBase.prototype.uniform3i = function( + location, value1, value2, value3) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Int32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform3iv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value1 + * @param {number} value2 + * @param {number} value3 + * @param {number} value4 + */ +WebGLRenderingContextBase.prototype.uniform4f = function( + location, value1, value2, value3, value4) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Float32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform4fv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} value1 + * @param {number} value2 + * @param {number} value3 + * @param {number} value4 + */ +WebGLRenderingContextBase.prototype.uniform4i = function( + location, value1, value2, value3, value4) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Int32Array|Array.} value + */ +WebGLRenderingContextBase.prototype.uniform4iv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} data + */ +WebGLRenderingContextBase.prototype.uniformMatrix2fv = function( + location, transpose, data) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} data + */ +WebGLRenderingContextBase.prototype.uniformMatrix3fv = function( + location, transpose, data) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} data + */ +WebGLRenderingContextBase.prototype.uniformMatrix4fv = function( + location, transpose, data) {}; + +/** + * @param {WebGLProgram} program + */ +WebGLRenderingContextBase.prototype.useProgram = function(program) {}; + +/** + * @param {WebGLProgram} program + */ +WebGLRenderingContextBase.prototype.validateProgram = function(program) {}; + +/** + * @param {number} indx + * @param {number} x + */ +WebGLRenderingContextBase.prototype.vertexAttrib1f = function(indx, x) {}; + +/** + * @param {number} indx + * @param {Float32Array|Array.} values + */ +WebGLRenderingContextBase.prototype.vertexAttrib1fv = function(indx, values) {}; + +/** + * @param {number} indx + * @param {number} x + * @param {number} y + */ +WebGLRenderingContextBase.prototype.vertexAttrib2f = function( + indx, x, y) {}; + +/** + * @param {number} indx + * @param {Float32Array|Array.} values + */ +WebGLRenderingContextBase.prototype.vertexAttrib2fv = function( + indx, values) {}; + +/** + * @param {number} indx + * @param {number} x + * @param {number} y + * @param {number} z + */ +WebGLRenderingContextBase.prototype.vertexAttrib3f = function( + indx, x, y, z) {}; + +/** + * @param {number} indx + * @param {Float32Array|Array.} values + */ +WebGLRenderingContextBase.prototype.vertexAttrib3fv = function(indx, values) {}; + +/** + * @param {number} indx + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ +WebGLRenderingContextBase.prototype.vertexAttrib4f = function( + indx, x, y, z, w) {}; + +/** + * @param {number} indx + * @param {Float32Array|Array.} values + */ +WebGLRenderingContextBase.prototype.vertexAttrib4fv = function(indx, values) {}; + +/** + * @param {number} indx + * @param {number} size + * @param {number} type + * @param {boolean} normalized + * @param {number} stride + * @param {number} offset + */ +WebGLRenderingContextBase.prototype.vertexAttribPointer = function( + indx, size, type, normalized, stride, offset) {}; + +/** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ +WebGLRenderingContextBase.prototype.viewport = function(x, y, width, height) {}; + + +/** + * @constructor + * @noalias + */ +function WebGLContextAttributes() {} + +/** + * @type {boolean} + */ +WebGLContextAttributes.prototype.alpha; + +/** + * @type {boolean} + */ +WebGLContextAttributes.prototype.depth; + +/** + * @type {boolean} + */ +WebGLContextAttributes.prototype.stencil; + +/** + * @type {boolean} + */ +WebGLContextAttributes.prototype.antialias; + +/** + * @type {boolean} + */ +WebGLContextAttributes.prototype.premultipliedAlpha; + +/** + * @type {boolean} + */ +WebGLContextAttributes.prototype.preserveDrawingBuffer; + + +/** + * @param {string} eventType + * @constructor + * @noalias + * @extends {Event} + */ +function WebGLContextEvent(eventType) {} + +/** + * @type {string} + */ +WebGLContextEvent.prototype.statusMessage; + + +/** + * @constructor + * @noalias + */ +function WebGLShaderPrecisionFormat() {} + +/** + * @type {number} + */ +WebGLShaderPrecisionFormat.prototype.rangeMin; + +/** + * @type {number} + */ +WebGLShaderPrecisionFormat.prototype.rangeMax; + +/** + * @type {number} + */ +WebGLShaderPrecisionFormat.prototype.precision; + + +/** + * @constructor + * @noalias + */ +function WebGLObject() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLBuffer() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLFramebuffer() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLProgram() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLRenderbuffer() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLShader() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLTexture() {} + + +/** + * @constructor + * @noalias + */ +function WebGLActiveInfo() {} + +/** @type {number} */ +WebGLActiveInfo.prototype.size; + +/** @type {number} */ +WebGLActiveInfo.prototype.type; + +/** @type {string} */ +WebGLActiveInfo.prototype.name; + + +/** + * @constructor + * @noalias + */ +function WebGLUniformLocation() {} + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/OES_texture_float/ + * @constructor + * @noalias + */ +function OES_texture_float() {} + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/ + * @constructor + * @noalias + */ +function OES_texture_half_float() {} + +/** @type {number} */ +OES_texture_half_float.prototype.HALF_FLOAT_OES; + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/ + * @constructor + * @noalias + */ +function WEBGL_lose_context() {} + +WEBGL_lose_context.prototype.loseContext = function() {}; + +WEBGL_lose_context.prototype.restoreContext = function() {}; + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/ + * @constructor + * @noalias + */ +function OES_standard_derivatives() {} + +/** @type {number} */ +OES_standard_derivatives.prototype.FRAGMENT_SHADER_DERIVATIVE_HINT_OES; + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLVertexArrayObjectOES() {} + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ + * @constructor + * @noalias + */ +function OES_vertex_array_object() {} + +/** @type {number} */ +OES_vertex_array_object.prototype.VERTEX_ARRAY_BINDING_OES; + +/** + * @return {WebGLVertexArrayObjectOES} + * @nosideeffects + */ +OES_vertex_array_object.prototype.createVertexArrayOES = function() {}; + +/** + * @param {WebGLVertexArrayObjectOES} arrayObject + */ +OES_vertex_array_object.prototype.deleteVertexArrayOES = + function(arrayObject) {}; + +/** + * @param {WebGLVertexArrayObjectOES} arrayObject + * @return {boolean} + * @nosideeffects + */ +OES_vertex_array_object.prototype.isVertexArrayOES = function(arrayObject) {}; + +/** + * @param {WebGLVertexArrayObjectOES} arrayObject + */ +OES_vertex_array_object.prototype.bindVertexArrayOES = function(arrayObject) {}; + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/ + * @constructor + * @noalias + */ +function WEBGL_debug_renderer_info() {} + +/** @type {number} */ +WEBGL_debug_renderer_info.prototype.UNMASKED_VENDOR_WEBGL; + +/** @type {number} */ +WEBGL_debug_renderer_info.prototype.UNMASKED_RENDERER_WEBGL; + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/ + * @constructor + * @noalias + */ +function WEBGL_debug_shaders() {} + +/** + * @param {WebGLShader} shader + * @return {string} + * @nosideeffects + */ +WEBGL_debug_shaders.prototype.getTranslatedShaderSource = function(shader) {}; + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ + * @constructor + * @noalias + */ +function WEBGL_compressed_texture_s3tc() {} + +/** @type {number} */ +WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGB_S3TC_DXT1_EXT; + +/** @type {number} */ +WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGBA_S3TC_DXT1_EXT; + +/** @type {number} */ +WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGBA_S3TC_DXT3_EXT; + +/** @type {number} */ +WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGBA_S3TC_DXT5_EXT; + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/OES_depth_texture/ + * @constructor + * @noalias + */ +function OES_depth_texture() {} + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/ + * @constructor + * @noalias + */ +function OES_element_index_uint() {} + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/ + * @constructor + * @noalias + */ +function EXT_texture_filter_anisotropic() {} + +/** @type {number} */ +EXT_texture_filter_anisotropic.prototype.TEXTURE_MAX_ANISOTROPY_EXT; + +/** @type {number} */ +EXT_texture_filter_anisotropic.prototype.MAX_TEXTURE_MAX_ANISOTROPY_EXT; + + + +/** + * @see http://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/ + * @constructor + * @noalias + */ +function ANGLE_instanced_arrays() {} + + +/** @type {number} */ +ANGLE_instanced_arrays.prototype.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE; + + +/** + * @param {number} mode Primitive type. + * @param {number} first First vertex. + * @param {number} count Number of vertices per instance. + * @param {number} primcount Number of instances. + */ +ANGLE_instanced_arrays.prototype.drawArraysInstancedANGLE = function( + mode, first, count, primcount) {}; + + +/** + * @param {number} mode Primitive type. + * @param {number} count Number of vertex indices per instance. + * @param {number} type Type of a vertex index. + * @param {number} offset Offset to the first vertex index. + * @param {number} primcount Number of instances. + */ +ANGLE_instanced_arrays.prototype.drawElementsInstancedANGLE = function( + mode, count, type, offset, primcount) {}; + + +/** + * @param {number} index Attribute index. + * @param {number} divisor Instance divisor. + */ +ANGLE_instanced_arrays.prototype.vertexAttribDivisorANGLE = function( + index, divisor) {}; + + +/** + * @constructor + * @noalias + * @extends {WebGLRenderingContextBase} + */ +function WebGLRenderingContext() {} + + +/** + * @constructor + * @private + * @noalias + * @extends {WebGLRenderingContextBase} + */ +function WebGL2RenderingContextBase() {} + + +/** @type {number} */ +WebGL2RenderingContextBase.READ_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.UNPACK_ROW_LENGTH; + +/** @type {number} */ +WebGL2RenderingContextBase.UNPACK_SKIP_ROWS; + +/** @type {number} */ +WebGL2RenderingContextBase.UNPACK_SKIP_PIXELS; + +/** @type {number} */ +WebGL2RenderingContextBase.PACK_ROW_LENGTH; + +/** @type {number} */ +WebGL2RenderingContextBase.PACK_SKIP_ROWS; + +/** @type {number} */ +WebGL2RenderingContextBase.PACK_SKIP_PIXELS; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR; + +/** @type {number} */ +WebGL2RenderingContextBase.DEPTH; + +/** @type {number} */ +WebGL2RenderingContextBase.STENCIL; + +/** @type {number} */ +WebGL2RenderingContextBase.RED; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB8; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA8; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB10_A2; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_BINDING_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.UNPACK_SKIP_IMAGES; + +/** @type {number} */ +WebGL2RenderingContextBase.UNPACK_IMAGE_HEIGHT; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_WRAP_R; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_3D_TEXTURE_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_2_10_10_10_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_ELEMENTS_VERTICES; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_ELEMENTS_INDICES; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_MIN_LOD; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_MAX_LOD; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_BASE_LEVEL; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_MAX_LEVEL; + +/** @type {number} */ +WebGL2RenderingContextBase.MIN; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX; + +/** @type {number} */ +WebGL2RenderingContextBase.DEPTH_COMPONENT24; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_TEXTURE_LOD_BIAS; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_COMPARE_MODE; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_COMPARE_FUNC; + +/** @type {number} */ +WebGL2RenderingContextBase.CURRENT_QUERY; + +/** @type {number} */ +WebGL2RenderingContextBase.QUERY_RESULT; + +/** @type {number} */ +WebGL2RenderingContextBase.QUERY_RESULT_AVAILABLE; + +/** @type {number} */ +WebGL2RenderingContextBase.STREAM_READ; + +/** @type {number} */ +WebGL2RenderingContextBase.STREAM_COPY; + +/** @type {number} */ +WebGL2RenderingContextBase.STATIC_READ; + +/** @type {number} */ +WebGL2RenderingContextBase.STATIC_COPY; + +/** @type {number} */ +WebGL2RenderingContextBase.DYNAMIC_READ; + +/** @type {number} */ +WebGL2RenderingContextBase.DYNAMIC_COPY; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_DRAW_BUFFERS; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER0; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER1; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER2; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER3; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER4; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER5; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER6; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER7; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER8; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER9; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER10; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER11; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER12; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER13; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER14; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_BUFFER15; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_FRAGMENT_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_VERTEX_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.SAMPLER_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.SAMPLER_2D_SHADOW; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAGMENT_SHADER_DERIVATIVE_HINT; + +/** @type {number} */ +WebGL2RenderingContextBase.PIXEL_PACK_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.PIXEL_UNPACK_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.PIXEL_PACK_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.PIXEL_UNPACK_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.FLOAT_MAT2x3; + +/** @type {number} */ +WebGL2RenderingContextBase.FLOAT_MAT2x4; + +/** @type {number} */ +WebGL2RenderingContextBase.FLOAT_MAT3x2; + +/** @type {number} */ +WebGL2RenderingContextBase.FLOAT_MAT3x4; + +/** @type {number} */ +WebGL2RenderingContextBase.FLOAT_MAT4x2; + +/** @type {number} */ +WebGL2RenderingContextBase.FLOAT_MAT4x3; + +/** @type {number} */ +WebGL2RenderingContextBase.SRGB; + +/** @type {number} */ +WebGL2RenderingContextBase.SRGB8; + +/** @type {number} */ +WebGL2RenderingContextBase.SRGB8_ALPHA8; + +/** @type {number} */ +WebGL2RenderingContextBase.COMPARE_REF_TO_TEXTURE; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA32F; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB32F; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA16F; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB16F; + +/** @type {number} */ +WebGL2RenderingContextBase.VERTEX_ATTRIB_ARRAY_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_ARRAY_TEXTURE_LAYERS; + +/** @type {number} */ +WebGL2RenderingContextBase.MIN_PROGRAM_TEXEL_OFFSET; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_PROGRAM_TEXEL_OFFSET; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_VARYING_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_BINDING_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.R11F_G11F_B10F; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_10F_11F_11F_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB9_E5; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_5_9_9_9_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_MODE; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_VARYINGS; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_START; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN; + +/** @type {number} */ +WebGL2RenderingContextBase.RASTERIZER_DISCARD; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS; + +/** @type {number} */ +WebGL2RenderingContextBase.INTERLEAVED_ATTRIBS; + +/** @type {number} */ +WebGL2RenderingContextBase.SEPARATE_ATTRIBS; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA32I; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB32I; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA16I; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB16I; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA8I; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB8I; + +/** @type {number} */ +WebGL2RenderingContextBase.RED_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.SAMPLER_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.SAMPLER_2D_ARRAY_SHADOW; + +/** @type {number} */ +WebGL2RenderingContextBase.SAMPLER_CUBE_SHADOW; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_VEC2; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_VEC3; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_VEC4; + +/** @type {number} */ +WebGL2RenderingContextBase.INT_SAMPLER_2D; + +/** @type {number} */ +WebGL2RenderingContextBase.INT_SAMPLER_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.INT_SAMPLER_CUBE; + +/** @type {number} */ +WebGL2RenderingContextBase.INT_SAMPLER_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_2D; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_CUBE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.DEPTH_COMPONENT32F; + +/** @type {number} */ +WebGL2RenderingContextBase.DEPTH32F_STENCIL8; + +/** @type {number} */ +WebGL2RenderingContextBase.FLOAT_32_UNSIGNED_INT_24_8_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_RED_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_DEFAULT; + +/** @type {number} */ +WebGL2RenderingContextBase.DEPTH_STENCIL_ATTACHMENT; + +/** @type {number} */ +WebGL2RenderingContextBase.DEPTH_STENCIL; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_INT_24_8; + +/** @type {number} */ +WebGL2RenderingContextBase.DEPTH24_STENCIL8; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNED_NORMALIZED; + +// Same as FRAMEBUFFER_BINDING +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_FRAMEBUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.READ_FRAMEBUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.DRAW_FRAMEBUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.READ_FRAMEBUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.RENDERBUFFER_SAMPLES; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_COLOR_ATTACHMENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT1; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT2; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT3; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT4; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT5; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT6; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT7; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT8; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT9; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT10; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT11; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT12; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT13; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT14; + +/** @type {number} */ +WebGL2RenderingContextBase.COLOR_ATTACHMENT15; + +/** @type {number} */ +WebGL2RenderingContextBase.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_SAMPLES; + +/** @type {number} */ +WebGL2RenderingContextBase.HALF_FLOAT; + +/** @type {number} */ +WebGL2RenderingContextBase.RG; + +/** @type {number} */ +WebGL2RenderingContextBase.RG_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.R8; + +/** @type {number} */ +WebGL2RenderingContextBase.RG8; + +/** @type {number} */ +WebGL2RenderingContextBase.R16F; + +/** @type {number} */ +WebGL2RenderingContextBase.R32F; + +/** @type {number} */ +WebGL2RenderingContextBase.RG16F; + +/** @type {number} */ +WebGL2RenderingContextBase.RG32F; + +/** @type {number} */ +WebGL2RenderingContextBase.R8I; + +/** @type {number} */ +WebGL2RenderingContextBase.R8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.R16I; + +/** @type {number} */ +WebGL2RenderingContextBase.R16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.R32I; + +/** @type {number} */ +WebGL2RenderingContextBase.R32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RG8I; + +/** @type {number} */ +WebGL2RenderingContextBase.RG8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RG16I; + +/** @type {number} */ +WebGL2RenderingContextBase.RG16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.RG32I; + +/** @type {number} */ +WebGL2RenderingContextBase.RG32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.VERTEX_ARRAY_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.R8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.RG8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.RGBA8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.SIGNED_NORMALIZED; + +/** @type {number} */ +WebGL2RenderingContextBase.COPY_READ_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.COPY_WRITE_BUFFER; + +// Same as COPY_READ_BUFFER +/** @type {number} */ +WebGL2RenderingContextBase.COPY_READ_BUFFER_BINDING; + +// Same as COPY_WRITE_BUFFER +/** @type {number} */ +WebGL2RenderingContextBase.COPY_WRITE_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BUFFER_START; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BUFFER_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_VERTEX_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_FRAGMENT_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_COMBINED_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_UNIFORM_BUFFER_BINDINGS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_UNIFORM_BLOCK_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BUFFER_OFFSET_ALIGNMENT; + +/** @type {number} */ +WebGL2RenderingContextBase.ACTIVE_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_TYPE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BLOCK_INDEX; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_OFFSET; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_ARRAY_STRIDE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_MATRIX_STRIDE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_IS_ROW_MAJOR; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BLOCK_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BLOCK_DATA_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BLOCK_ACTIVE_UNIFORMS; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER; + +/** @type {number} */ +WebGL2RenderingContextBase.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER; + +/** @type {number} */ +WebGL2RenderingContextBase.INVALID_INDEX; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_VERTEX_OUTPUT_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_FRAGMENT_INPUT_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_SERVER_WAIT_TIMEOUT; + +/** @type {number} */ +WebGL2RenderingContextBase.OBJECT_TYPE; + +/** @type {number} */ +WebGL2RenderingContextBase.SYNC_CONDITION; + +/** @type {number} */ +WebGL2RenderingContextBase.SYNC_STATUS; + +/** @type {number} */ +WebGL2RenderingContextBase.SYNC_FLAGS; + +/** @type {number} */ +WebGL2RenderingContextBase.SYNC_FENCE; + +/** @type {number} */ +WebGL2RenderingContextBase.SYNC_GPU_COMMANDS_COMPLETE; + +/** @type {number} */ +WebGL2RenderingContextBase.UNSIGNALED; + +/** @type {number} */ +WebGL2RenderingContextBase.SIGNALED; + +/** @type {number} */ +WebGL2RenderingContextBase.ALREADY_SIGNALED; + +/** @type {number} */ +WebGL2RenderingContextBase.TIMEOUT_EXPIRED; + +/** @type {number} */ +WebGL2RenderingContextBase.CONDITION_SATISFIED; + +/** @type {number} */ +WebGL2RenderingContextBase.WAIT_FAILED; + +/** @type {number} */ +WebGL2RenderingContextBase.SYNC_FLUSH_COMMANDS_BIT; + +/** @type {number} */ +WebGL2RenderingContextBase.VERTEX_ATTRIB_ARRAY_DIVISOR; + +/** @type {number} */ +WebGL2RenderingContextBase.ANY_SAMPLES_PASSED; + +/** @type {number} */ +WebGL2RenderingContextBase.ANY_SAMPLES_PASSED_CONSERVATIVE; + +/** @type {number} */ +WebGL2RenderingContextBase.SAMPLER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.RGB10_A2UI; + +/** @type {number} */ +WebGL2RenderingContextBase.INT_2_10_10_10_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_PAUSED; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_ACTIVE; + +/** @type {number} */ +WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_IMMUTABLE_FORMAT; + +/** @type {number} */ +WebGL2RenderingContextBase.MAX_ELEMENT_INDEX; + +/** @type {number} */ +WebGL2RenderingContextBase.NUM_SAMPLE_COUNTS; + +/** @type {number} */ +WebGL2RenderingContextBase.TEXTURE_IMMUTABLE_LEVELS; + +/** @type {number} */ +WebGL2RenderingContextBase.TIMEOUT_IGNORED; + + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.READ_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNPACK_ROW_LENGTH; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNPACK_SKIP_ROWS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNPACK_SKIP_PIXELS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.PACK_ROW_LENGTH; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.PACK_SKIP_ROWS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.PACK_SKIP_PIXELS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DEPTH; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.STENCIL; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB10_A2; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_BINDING_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNPACK_SKIP_IMAGES; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNPACK_IMAGE_HEIGHT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_WRAP_R; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_3D_TEXTURE_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_2_10_10_10_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_ELEMENTS_VERTICES; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_ELEMENTS_INDICES; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_MIN_LOD; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_MAX_LOD; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_BASE_LEVEL; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_MAX_LEVEL; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MIN; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DEPTH_COMPONENT24; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_TEXTURE_LOD_BIAS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_COMPARE_MODE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_COMPARE_FUNC; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.CURRENT_QUERY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.QUERY_RESULT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.QUERY_RESULT_AVAILABLE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.STREAM_READ; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.STREAM_COPY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.STATIC_READ; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.STATIC_COPY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DYNAMIC_READ; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DYNAMIC_COPY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_DRAW_BUFFERS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER0; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER1; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER2; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER3; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER4; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER5; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER6; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER7; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER9; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER10; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER11; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER12; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER13; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER14; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_BUFFER15; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_FRAGMENT_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_VERTEX_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SAMPLER_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SAMPLER_2D_SHADOW; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAGMENT_SHADER_DERIVATIVE_HINT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.PIXEL_PACK_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.PIXEL_UNPACK_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.PIXEL_PACK_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.PIXEL_UNPACK_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FLOAT_MAT2x3; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FLOAT_MAT2x4; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FLOAT_MAT3x2; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FLOAT_MAT3x4; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FLOAT_MAT4x2; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FLOAT_MAT4x3; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SRGB; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SRGB8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SRGB8_ALPHA8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COMPARE_REF_TO_TEXTURE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA32F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB32F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA16F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB16F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_ARRAY_TEXTURE_LAYERS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MIN_PROGRAM_TEXEL_OFFSET; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_PROGRAM_TEXEL_OFFSET; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_VARYING_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_BINDING_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R11F_G11F_B10F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_10F_11F_11F_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB9_E5; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_5_9_9_9_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_MODE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_VARYINGS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_START; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RASTERIZER_DISCARD; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.INTERLEAVED_ATTRIBS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SEPARATE_ATTRIBS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA32I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB32I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA16I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB16I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA8I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB8I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RED_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SAMPLER_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SAMPLER_2D_ARRAY_SHADOW; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SAMPLER_CUBE_SHADOW; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_VEC2; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_VEC3; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_VEC4; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.INT_SAMPLER_2D; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.INT_SAMPLER_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.INT_SAMPLER_CUBE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.INT_SAMPLER_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_2D; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_3D; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_CUBE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_2D_ARRAY; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DEPTH_COMPONENT32F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DEPTH32F_STENCIL8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FLOAT_32_UNSIGNED_INT_24_8_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_RED_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_DEFAULT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DEPTH_STENCIL_ATTACHMENT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DEPTH_STENCIL; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_INT_24_8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DEPTH24_STENCIL8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNED_NORMALIZED; + +// Same as FRAMEBUFFER_BINDING +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_FRAMEBUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.READ_FRAMEBUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.DRAW_FRAMEBUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.READ_FRAMEBUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RENDERBUFFER_SAMPLES; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_COLOR_ATTACHMENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT1; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT2; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT3; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT4; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT5; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT6; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT7; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT9; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT10; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT11; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT12; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT13; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT14; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT15; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_SAMPLES; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.HALF_FLOAT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG_INTEGER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG8; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R16F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R32F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG16F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG32F; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R8I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R16I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R32I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG8I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG8UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG16I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG16UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG32I; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG32UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.VERTEX_ARRAY_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.R8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RG8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGBA8_SNORM; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SIGNED_NORMALIZED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COPY_READ_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COPY_WRITE_BUFFER; + +// Same as COPY_READ_BUFFER +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COPY_READ_BUFFER_BINDING; + +// Same as COPY_WRITE_BUFFER +/** @type {number} */ +WebGL2RenderingContextBase.prototype.COPY_WRITE_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_START; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_VERTEX_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_FRAGMENT_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_COMBINED_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_UNIFORM_BUFFER_BINDINGS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_UNIFORM_BLOCK_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_OFFSET_ALIGNMENT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.ACTIVE_UNIFORM_BLOCKS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_TYPE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_INDEX; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_OFFSET; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_ARRAY_STRIDE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_MATRIX_STRIDE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_IS_ROW_MAJOR; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_DATA_SIZE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_ACTIVE_UNIFORMS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.INVALID_INDEX; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_VERTEX_OUTPUT_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_FRAGMENT_INPUT_COMPONENTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_SERVER_WAIT_TIMEOUT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.OBJECT_TYPE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SYNC_CONDITION; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SYNC_STATUS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SYNC_FLAGS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SYNC_FENCE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SYNC_GPU_COMMANDS_COMPLETE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.UNSIGNALED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SIGNALED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.ALREADY_SIGNALED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TIMEOUT_EXPIRED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.CONDITION_SATISFIED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.WAIT_FAILED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SYNC_FLUSH_COMMANDS_BIT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_DIVISOR; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.ANY_SAMPLES_PASSED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.ANY_SAMPLES_PASSED_CONSERVATIVE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.SAMPLER_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.RGB10_A2UI; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.INT_2_10_10_10_REV; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_PAUSED; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_ACTIVE; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BINDING; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_IMMUTABLE_FORMAT; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.MAX_ELEMENT_INDEX; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.NUM_SAMPLE_COUNTS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TEXTURE_IMMUTABLE_LEVELS; + +/** @type {number} */ +WebGL2RenderingContextBase.prototype.TIMEOUT_IGNORED; + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLQuery() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLSampler() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLSync() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLTransformFeedback() {} + + +/** + * @constructor + * @noalias + * @extends {WebGLObject} + */ +function WebGLVertexArrayObject() {} + + +/** + * @param {number} target + * @param {WebGLQuery} query + */ +WebGL2RenderingContextBase.prototype.beginQuery = function(target, query) {}; + +/** + * @param {number} primitiveMode + */ +WebGL2RenderingContextBase.prototype.beginTransformFeedback = function(primitiveMode) {}; + +/** + * @param {number} target + * @param {number} index + * @param {WebGLBuffer} buffer + */ +WebGL2RenderingContextBase.prototype.bindBufferBase = function(target, index, buffer) {}; + +/** + * @param {number} target + * @param {number} index + * @param {WebGLBuffer} buffer + * @param {number} offset + * @param {number} size + */ +WebGL2RenderingContextBase.prototype.bindBufferRange = function(target, index, buffer, offset, size) {}; + +/** + * @param {number} unit + * @param {WebGLSampler} sampler + */ +WebGL2RenderingContextBase.prototype.bindSampler = function(unit, sampler) {}; + +/** + * @param {number} target + * @param {WebGLTransformFeedback} id + */ +WebGL2RenderingContextBase.prototype.bindTransformFeedback = function(target, id) {}; + +/** + * @param {WebGLVertexArrayObject} array + */ +WebGL2RenderingContextBase.prototype.bindVertexArray = function(array) {}; + +/** + * @param {number} srcX0 + * @param {number} srcY0 + * @param {number} srcX1 + * @param {number} srcY1 + * @param {number} dstX0 + * @param {number} dstY0 + * @param {number} dstX1 + * @param {number} dstY1 + * @param {number} mask + * @param {number} filter + */ +WebGL2RenderingContextBase.prototype.blitFramebuffer = function( + srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, + dstX1, dstY1, mask, filter) {}; + +/** + * @param {number} buffer + * @param {number} drawbuffer + * @param {Int32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.clearBufferiv = function(buffer, drawbuffer, value) {}; + +/** + * @param {number} buffer + * @param {number} drawbuffer + * @param {Uint32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.clearBufferuiv = function(buffer, drawbuffer, value) {}; + +/** + * @param {number} buffer + * @param {number} drawbuffer + * @param {Float32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.clearBufferfv = function(buffer, drawbuffer, value) {}; + +/** + * @param {number} buffer + * @param {number} drawbuffer + * @param {number} depth + * @param {number} stencil + */ +WebGL2RenderingContextBase.prototype.clearBufferfi = function(buffer, drawbuffer, depth, stencil) {}; + +/** + * @param {WebGLSync} sync + * @param {number} flags + * @param {number} timeout + * @return {number} + */ +WebGL2RenderingContextBase.prototype.clientWaitSync = function(sync, flags, timeout) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} internalformat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} border + * @param {ArrayBufferView} data + */ +WebGL2RenderingContextBase.prototype.compressedTexImage3D = function( + target, level, internalformat, width, height, depth, border, data) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} xoffset + * @param {number} yoffset + * @param {number} zoffset + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} format + * @param {ArrayBufferView} data + */ +WebGL2RenderingContextBase.prototype.compressedTexSubImage3D = function( + target, level, xoffset, yoffset, zoffset, width, height, depth, format, data) {}; + +/** + * @param {number} readTarget + * @param {number} writeTarget + * @param {number} readOffset + * @param {number} writeOffset + * @param {number} size + */ +WebGL2RenderingContextBase.prototype.copyBufferSubData = function( + readTarget, writeTarget, readOffset, writeOffset, size) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} xoffset + * @param {number} yoffset + * @param {number} zoffset + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ +WebGL2RenderingContextBase.prototype.copyTexSubImage3D = function( + target, level, xoffset, yoffset, zoffset, x, y, width, height) {}; + +/** + * @return {!WebGLQuery} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.createQuery = function() {}; + +/** + * @return {!WebGLSampler} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.createSampler = function() {}; + +/** + * @return {!WebGLTransformFeedback} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.createTransformFeedback = function() {}; + +/** + * @return {!WebGLVertexArrayObject} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.createVertexArray = function() {}; + + +/** + * @param {WebGLQuery} query + */ +WebGL2RenderingContextBase.prototype.deleteQuery = function(query) {}; + +/** + * @param {WebGLSampler} sampler + */ +WebGL2RenderingContextBase.prototype.deleteSampler = function(sampler) {}; + +/** + * @param {WebGLSync} sync + */ +WebGL2RenderingContextBase.prototype.deleteSync = function(sync) {}; + +/** + * @param {WebGLTransformFeedback} feedback + */ +WebGL2RenderingContextBase.prototype.deleteTransformFeedback = function(feedback) {}; + +/** + * @param {WebGLVertexArrayObject} vertexArray + */ +WebGL2RenderingContextBase.prototype.deleteVertexArray = function(vertexArray) {}; + +/** + * @param {number} mode + * @param {number} first + * @param {number} count + * @param {number} instanceCount + */ +WebGL2RenderingContextBase.prototype.drawArraysInstanced = function(mode, first, count, instanceCount) {}; + +/** + * @param {number} mode + * @param {number} count + * @param {number} type + * @param {number} offset + * @param {number} instanceCount + */ +WebGL2RenderingContextBase.prototype.drawElementsInstanced = function(mode, count, type, offset, instanceCount) {}; + +/** + * @param {number} mode + * @param {number} start + * @param {number} end + * @param {number} count + * @param {number} type + * @param {number} offset + */ +WebGL2RenderingContextBase.prototype.drawRangeElements = function(mode, start, end, count, type, offset) {}; + +/** + * @param {Array.} buffers + */ +WebGL2RenderingContextBase.prototype.drawBuffers = function(buffers) {}; + +/** + * @param {number} target + */ +WebGL2RenderingContextBase.prototype.endQuery = function(target) {}; + +/** + */ +WebGL2RenderingContextBase.prototype.endTransformFeedback = function() {}; + +/** + * @param {number} condition + * @param {number} flags + * @return {WebGLSync} + */ +WebGL2RenderingContextBase.prototype.fenceSync = function(condition, flags) {}; + +/** + * @param {number} target + * @param {number} attachment + * @param {WebGLTexture} texture + * @param {number} level + * @param {number} layer + */ +WebGL2RenderingContextBase.prototype.framebufferTextureLayer = function( + target, attachment, texture, level, layer) {}; + +/** + * @param {WebGLProgram} program + * @param {number} uniformBlockIndex + * @return {string} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getActiveUniformBlockName = function(program, uniformBlockIndex) {}; + +/** + * @param {WebGLProgram} program + * @param {number} uniformBlockIndex + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getActiveUniformBlockParameter = function( + program, uniformBlockIndex, pname) {}; + +/** + * @param {WebGLProgram} program + * @param {Array.} uniformIndices + * @param {number} pname + * @return {Array.} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getActiveUniforms = function( + program, uniformIndices, pname) {}; + +/** + * @param {number} target + * @param {number} offset + * @param {ArrayBuffer} returnedData + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getBufferSubData = function( + target, offset, returnedData) {}; + +/** + * @param {WebGLProgram} program + * @param {string} name + * @return {number} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getFragDataLocation = function(program, name) {}; + +/** + * @param {number} target + * @param {number} index + * @return {*} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getIndexedParameter = function(target, index) {}; + +/** + * @param {number} target + * @param {number} internalformat + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getInternalformatParameter = function(target, internalformat, pname) {}; + +/** + * @param {number} target + * @param {number} pname + * @return {WebGLQuery} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getQuery = function(target, pname) {}; + +/** + * @param {WebGLQuery} query + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getQueryParameter = function(query, pname) {}; + +/** + * @param {WebGLSampler} sampler + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getSamplerParameter = function(sampler, pname) {}; + +/** + * @param {WebGLSync} sync + * @param {number} pname + * @return {*} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getSyncParameter = function(sync, pname) {}; + +/** + * @param {WebGLProgram} program + * @param {number} index + * @return {WebGLActiveInfo} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getTransformFeedbackVarying = function(program, index) {}; + +/** + * @param {WebGLProgram} program + * @param {string} uniformBlockName + * @return {number} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getUniformBlockIndex = function(program, uniformBlockName) {}; + +/** + * @param {WebGLProgram} program + * @param {Array.} uniformNames + * @return {Array.} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.getUniformIndices = function(program, uniformNames) {}; + +/** + * @param {number} target + * @param {Array.} attachments + */ +WebGL2RenderingContextBase.prototype.invalidateFramebuffer = function(target, attachments) {}; + +/** + * @param {number} target + * @param {Array.} attachments + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ +WebGL2RenderingContextBase.prototype.invalidateSubFramebuffer = function( + target, attachments, x, y, width, height) {}; + +/** + * @param {WebGLQuery} query + * @return {boolean} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.isQuery = function(query) {}; + +/** + * @param {WebGLSampler} sampler + * @return {boolean} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.isSampler = function(sampler) {}; + +/** + * @param {WebGLSync} sync + * @return {boolean} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.isSync = function(sync) {}; + +/** + * @param {WebGLTransformFeedback} feedback + * @return {boolean} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.isTransformFeedback = function(feedback) {}; + +/** + * @param {WebGLVertexArrayObject} vertexArray + * @return {boolean} + * @nosideeffects + */ +WebGL2RenderingContextBase.prototype.isVertexArray = function(vertexArray) {}; + +/** + */ +WebGL2RenderingContextBase.prototype.pauseTransformFeedback = function() {}; + +/** + * @param {number} src + */ +WebGL2RenderingContextBase.prototype.readBuffer = function(src) {}; + +/** + * @param {number} target + * @param {number} samples + * @param {number} internalformat + * @param {number} width + * @param {number} height + */ +WebGL2RenderingContextBase.prototype.renderbufferStorageMultisample = function( + target, samples, internalformat, width, height) {}; + +/** + */ +WebGL2RenderingContextBase.prototype.resumeTransformFeedback = function() {}; + +/** + * @param {WebGLSampler} sampler + * @param {number} pname + * @param {number} param + */ +WebGL2RenderingContextBase.prototype.samplerParameteri = function(sampler, pname, param) {}; + +/** + * @param {WebGLSampler} sampler + * @param {number} pname + * @param {number} param + */ +WebGL2RenderingContextBase.prototype.samplerParameterf = function(sampler, pname, param) {}; + +/** + * @param {number} target + * @param {number} levels + * @param {number} internalformat + * @param {number} width + * @param {number} height + */ +WebGL2RenderingContextBase.prototype.texStorage2D = function(target, levels, internalformat, width, height) {}; + +/** + * @param {number} target + * @param {number} levels + * @param {number} internalformat + * @param {number} width + * @param {number} height + * @param {number} depth + */ +WebGL2RenderingContextBase.prototype.texStorage3D = function(target, levels, internalformat, width, height, depth) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} internalformat + * @param {number} width + * @param {number} height + * @param {number} depth + * @param {number} border + * @param {number} format + * @param {number} type + * @param {ArrayBufferView} pixels + */ +WebGL2RenderingContextBase.prototype.texImage3D = function( + target, level, internalformat, width, height, depth, border, format, type, pixels) {}; + +/** + * @param {number} target + * @param {number} level + * @param {number} xoffset + * @param {number} yoffset + * @param {number} zoffset + * @param {number} format or width + * @param {number} type or height + * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement| + * number} source or depth + * @param {number=} opt_format + * @param {number=} opt_type + * @param {ArrayBufferView=} opt_pixels + */ +WebGL2RenderingContextBase.prototype.texSubImage3D = function( + target, level, xoffset, yoffset, zoffset, format, type, source, opt_format, opt_type, opt_pixels) {}; + +/** + * @param {WebGLProgram} program + * @param {Array.} varyings + * @param {number} bufferMode + */ +WebGL2RenderingContextBase.prototype.transformFeedbackVaryings = function(program, varyings, bufferMode) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} v0 + */ +WebGL2RenderingContextBase.prototype.uniform1ui = function(location, v0) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} v0 + * @param {number} v1 + */ +WebGL2RenderingContextBase.prototype.uniform2ui = function(location, v0, v1) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} v0 + * @param {number} v1 + * @param {number} v2 + */ +WebGL2RenderingContextBase.prototype.uniform3ui = function(location, v0, v1, v2) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {number} v0 + * @param {number} v1 + * @param {number} v2 + * @param {number} v3 + */ +WebGL2RenderingContextBase.prototype.uniform4ui = function(location, v0, v1, v2, v3) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Uint32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniform1uiv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Uint32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniform2uiv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Uint32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniform3uiv = function(location, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {Uint32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniform4uiv = function(location, value) {}; + +/** + * @param {WebGLProgram} program + * @param {number} uniformBlockIndex + * @param {number} uniformBlockBinding + */ +WebGL2RenderingContextBase.prototype.uniformBlockBinding = function(program, uniformBlockIndex, uniformBlockBinding) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniformMatrix2x3fv = function(location, transpose, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniformMatrix3x2fv = function(location, transpose, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniformMatrix2x4fv = function(location, transpose, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniformMatrix4x2fv = function(location, transpose, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniformMatrix3x4fv = function(location, transpose, value) {}; + +/** + * @param {WebGLUniformLocation} location + * @param {boolean} transpose + * @param {Float32Array|Array.} value + */ +WebGL2RenderingContextBase.prototype.uniformMatrix4x3fv = function(location, transpose, value) {}; + +/** + * @param {number} index + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ +WebGL2RenderingContextBase.prototype.vertexAttribI4i = function(index, x, y, z, w) {}; + +/** + * @param {number} index + * @param {(Array.|Int32Array)} v + */ +WebGL2RenderingContextBase.prototype.vertexAttribI4iv = function(index, v) {}; + +/** + * @param {number} index + * @param {number} x + * @param {number} y + * @param {number} z + * @param {number} w + */ +WebGL2RenderingContextBase.prototype.vertexAttribI4ui = function(index, x, y, z, w) {}; + +/** + * @param {number} index + * @param {(Array.|Uint32Array)} v + */ +WebGL2RenderingContextBase.prototype.vertexAttribI4uiv = function(index, v) {}; + +/** + * @param {number} index + * @param {number} size + * @param {number} type + * @param {number} stride + * @param {number} offset + */ +WebGL2RenderingContextBase.prototype.vertexAttribIPointer = function(index, size, type, stride, offset) {}; + +/** + * @param {number} index + * @param {number} divisor + */ +WebGL2RenderingContextBase.prototype.vertexAttribDivisor = function(index, divisor) {}; + +/** + * @param {WebGLSync} sync + * @param {number} flags + * @param {number} timeout + */ +WebGL2RenderingContextBase.prototype.waitSync = function(sync, flags, timeout) {}; + +/** + * @constructor + * @noalias + * @extends {WebGL2RenderingContextBase} + */ +function WebGL2RenderingContext() {} diff --git a/dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png b/dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png new file mode 100644 index 000000000..4ec975107 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html b/dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html new file mode 100644 index 000000000..8f6ce2049 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html @@ -0,0 +1,277 @@ + + + + + + +WebGL Big FBO Test + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html new file mode 100644 index 000000000..4b8dc23b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html @@ -0,0 +1,176 @@ + + + + + + +Float32Array garbage collection test + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html b/dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html new file mode 100644 index 000000000..5238ec20e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html @@ -0,0 +1,289 @@ + + + + + + +Buffer allocation test + + + + + +
+
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html new file mode 100644 index 000000000..654c458b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html @@ -0,0 +1,109 @@ + + + + + + +Canvas Compositing Test + + + + + +Below are 2 50x50 pixel canvas but using CSS to display them at 100x100 pixels.
+They are solid black with a red triangle
+They each have a 10px CSS solid black border around them.
+Depending on how the browser composites the canvas with the page they will get +a white outline
+
+2d canvas
+ +
+
+3d canvas
+
+ +
+
+img tag
+ +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png new file mode 100644 index 000000000..ba80dbe76 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html b/dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html new file mode 100644 index 000000000..de563c1a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html @@ -0,0 +1,240 @@ + + + + + + +Indexing with a constant expression should compile only if the index is in range + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html new file mode 100644 index 000000000..6822bc234 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html @@ -0,0 +1,56 @@ + + + + + + +Test that contexts are freed and garbage collected reasonably + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html b/dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html new file mode 100644 index 000000000..489aea6ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html @@ -0,0 +1,112 @@ + + + + + + +WebGL cube map out of order upload test. + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html b/dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html new file mode 100644 index 000000000..a9aa71b47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html @@ -0,0 +1,223 @@ + + + + + + +WebGL FBO Lost Context Test + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html new file mode 100644 index 000000000..519f023cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html @@ -0,0 +1,110 @@ + + + + + + +WebGL Lots of polygons example. + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html new file mode 100644 index 000000000..78f40ae8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html @@ -0,0 +1,176 @@ + + + + + + +WebGL Lots of polygons example. + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html new file mode 100644 index 000000000..16cde8b20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html @@ -0,0 +1,58 @@ + + + + + + +WebGL Multisample Renderbuffer Corruption Test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html b/dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html new file mode 100644 index 000000000..598be0e8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html @@ -0,0 +1,64 @@ + + + + + + + + + +
content that is tall like several articles
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html new file mode 100644 index 000000000..4328d71eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html @@ -0,0 +1,126 @@ + + + + + + +WebGL out of bounds uniform array access. + + + + + +
+
+
elem mult:
+ +
line width:
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html new file mode 100644 index 000000000..88b033e93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html @@ -0,0 +1,105 @@ + + + + + + +WebGL Out Of Memory Test + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html new file mode 100644 index 000000000..86028f952 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html @@ -0,0 +1,141 @@ + + + + + + +WebGL Out Of Resources Test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html new file mode 100644 index 000000000..16a3d3ef7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html @@ -0,0 +1,135 @@ + + + + + + +WebGL Out Of VRAM Test + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html new file mode 100644 index 000000000..dcb2a272c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html b/dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html new file mode 100644 index 000000000..9cfdfb2bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html @@ -0,0 +1,101 @@ + + + + + + + + + + +

Should be green in the rectangle below:

+ +
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html b/dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html new file mode 100644 index 000000000..8c2a7419a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html @@ -0,0 +1,86 @@ + + + + + + +WebGL Behavior After Alert and Read Pixels Test + + + + + + + +
Verify WebGL behavior after an alert and then a readPixels()
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample-100.png b/dom/canvas/test/webgl-conf/checkout/extra/sample-100.png new file mode 100644 index 000000000..197c869b6 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/sample-100.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample-200.png b/dom/canvas/test/webgl-conf/checkout/extra/sample-200.png new file mode 100644 index 000000000..89f2b782a Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/sample-200.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample-400.png b/dom/canvas/test/webgl-conf/checkout/extra/sample-400.png new file mode 100644 index 000000000..aaee3ce0d Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/sample-400.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample.svg b/dom/canvas/test/webgl-conf/checkout/extra/sample.svg new file mode 100644 index 000000000..dfca52402 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/sample.svg @@ -0,0 +1,4 @@ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html b/dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html new file mode 100644 index 000000000..c86ff6eea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html @@ -0,0 +1,57 @@ + + + + + +Simulated Attrib 0 Bug Test + + + + +
Simulated Attrib 0 Bug Test
+
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html b/dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html new file mode 100644 index 000000000..0970a3842 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html @@ -0,0 +1,133 @@ + + + + + + +WebGL Slow Shader example. + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html new file mode 100644 index 000000000..3a20ad236 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js new file mode 100644 index 000000000..e6dd62c9a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js @@ -0,0 +1,174 @@ +/* +** 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. +*/ + +// This block needs to be outside the onload handler in order for this +// test to run reliably in WebKit's test harness (at least the +// Chromium port). https://bugs.webkit.org/show_bug.cgi?id=87448 +initTestingHarness(); + +var old = debug; +var debug = function(msg) { + console.log(msg); + old(msg); +}; + +function generateTest(pixelFormat, pixelType, prologue) { + var wtu = WebGLTestUtils; + var gl = null; + var textureLoc = null; + var successfullyParsed = false; + + // Test each format separately because many browsers implement each + // differently. Some might be GPU accelerated, some might not. Etc... + var videos = [ + { src: "../resources/red-green.mp4" , type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', }, + { src: "../resources/red-green.webmvp8.webm", type: 'video/webm; codecs="vp8, vorbis"', }, + { src: "../resources/red-green.webmvp9.webm", type: 'video/webm; codecs="vp9"', }, + { src: "../resources/red-green.theora.ogv", type: 'video/ogg; codecs="theora, vorbis"', }, + ]; + + var videoNdx = 0; + var video; + + function runNextVideo() { + if (video) { + video.pause(); + } + + if (videoNdx == videos.length) { + finishTest(); + return; + } + + var info = videos[videoNdx++]; + debug(""); + debug("testing: " + info.type); + video = document.createElement("video"); + var canPlay = true; + if (!video.canPlayType) { + testFailed("video.canPlayType required method missing"); + runNextVideo(); + return; + } + + if(!video.canPlayType(info.type).replace(/no/, '')) { + debug(info.type + " unsupported"); + runNextVideo(); + return; + }; + + document.body.appendChild(video); + video.type = info.type; + video.crossOrigin = 'anonymous'; + video.src = info.src; + wtu.startPlayingAndWaitForVideo(video, runTest); + } + + var init = function() + { + description('Verify texImage2D and texSubImage2D code paths taking video elements (' + pixelFormat + '/' + pixelType + ')'); + + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + var program = wtu.setupTexturedQuad(gl); + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + textureLoc = gl.getUniformLocation(program, "tex"); + runNextVideo(); + } + + function runOneIteration(videoElement, useTexSubImage2D, flipY, topColor, bottomColor) + { + 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); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(gl.TEXTURE_2D, texture); + // Set up texture parameters + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_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); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + // Upload the videoElement into the texture + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(gl.TEXTURE_2D, 0, gl[pixelFormat], + videoElement.videoWidth, videoElement.videoHeight, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl[pixelFormat], gl[pixelType], videoElement); + } else { + gl.texImage2D(gl.TEXTURE_2D, 0, gl[pixelFormat], gl[pixelFormat], gl[pixelType], videoElement); + } + + 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.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + // Check a few pixels near the top and bottom and make sure they have + // the right color. + var tolerance = 5; + debug("Checking lower left corner"); + wtu.checkCanvasRect(gl, 4, 4, 2, 2, bottomColor, + "shouldBe " + bottomColor, tolerance); + debug("Checking upper left corner"); + wtu.checkCanvasRect(gl, 4, gl.canvas.height - 8, 2, 2, topColor, + "shouldBe " + topColor, tolerance); + } + + function runTest(videoElement) + { + var red = [255, 0, 0]; + var green = [0, 255, 0]; + runOneIteration(videoElement, false, true, red, green); + runOneIteration(videoElement, false, false, green, red); + runOneIteration(videoElement, true, true, red, green); + runOneIteration(videoElement, true, false, green, red); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + + runNextVideo(); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html b/dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html new file mode 100644 index 000000000..2c423e02a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html @@ -0,0 +1,68 @@ + + + + + + +Tests that resources allocated by a WebGL context are freed in a reasonable timeframe. + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html b/dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html new file mode 100644 index 000000000..4cdcf64a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html @@ -0,0 +1,250 @@ + + + + +Testing resolution of texture uploads + + + + + +
+
+

IMG to SVG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 100x100 PNG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 200x200 PNG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 400x400 PNG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG SRCSET to multiple PNGs with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to SVG with no attributes - 200x200 sizing via CSS

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 400x400 PNG with no attributes - 200x200 sizing via CSS

+
+
+ +
+
+
+
+

+
+
+
+
+

+ IMG to SVG with no attributes and no sizing via CSS
+ (although the width and height of the container set a size) +

+
+
+ +
+
+
+
+

+
+
+
+
+

Out of page SVG with no dimensions

+
+
+ Not a child of document +
+
+
+
+

+
+
+
+
+

Out of page SVG with 200x200 specified

+
+
+ Not a child of document +
+
+
+
+

+
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html b/dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html new file mode 100644 index 000000000..74f15608a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html @@ -0,0 +1,163 @@ + + + + + +Micro-benchmark for WebGL drawElements index validation + + + + + +

Micro-benchmark for WebGL drawElements index validation

+

Note that these test cases are completely artificial, and their results only very rough indicators of the performance of a specific part of the system.

+

The benchmark does not perform any drawing, but rather measures the time the browser takes to upload indices and to check if there are out-of-range indices.

+ + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html b/dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html new file mode 100644 index 000000000..86b4d0c05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html @@ -0,0 +1,296 @@ + + + + + + +WebGL Information + + + + + +

WebGL Info

+
+

WebGL Extensions

+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html b/dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html new file mode 100644 index 000000000..2cccd47ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html @@ -0,0 +1,171 @@ + + + + + + +WebGL Shader Translator + + + + + + +

WebGL Shader Translator

+

This page uses the browser's built-in shader translation facilities to show how a shader +is changed before being passed on to the underlying platform's graphics driver.

+ +

WebGL GLSL shader

+ +

+ + +

+

Shader translated for graphics driver

+ +

Enabled shader extensions

+

None

+

Shader info log

+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/js/desktop-gl-constants.js b/dom/canvas/test/webgl-conf/checkout/js/desktop-gl-constants.js new file mode 100644 index 000000000..3ad7d0be2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/desktop-gl-constants.js @@ -0,0 +1,2656 @@ +/* +** 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. +*/ + +// Defines a bunch of DesktopGL constants so we can make sure WebGL +// implementations disallow them. + +// Some of these are also GLES2/GLES3 constants that have been removed from +// WebGL. + +var desktopGL = { + 'MIN': 0x8007, + 'MAX': 0x8008, + 'QUADS': 0x0007, + 'QUAD_STRIP': 0x0008, + 'POLYGON': 0x0009, + '1': 0x0001, + '2': 0x0002, + '3': 0x0003, + '4': 0x0004, + 'STATIC_READ': 0x88E5, + 'CLIP_PLANE0': 0x3000, + 'PERSPECTIVE_CORRECTION_HINT': 0x0C50, + 'ACCUM_BUFFER_BIT': 0x0200, + 'RGB4': 0x804F, + 'RGB5': 0x8050, + 'RGB8': 0x8051, + 'RGB10': 0x8052, + 'RGB12': 0x8053, + 'RGB16': 0x8054, + 'RGBA2': 0x8055, + 'RGBA4': 0x8056, + 'RGB5_A1': 0x8057, + 'RGBA8': 0x8058, + 'RGB10_A2': 0x8059, + 'RGBA12': 0x805A, + 'RGBA16': 0x805B, + 'SMOOTH_POINT_SIZE_RANGE': 0x0B12, + 'SMOOTH_POINT_SIZE_GRANULARITY': 0x0B13, + 'SMOOTH_LINE_WIDTH_RANGE': 0x0B22, + 'SMOOTH_LINE_WIDTH_GRANULARITY': 0x0B23, + 'UNSIGNED_BYTE_3_3_2': 0x8032, + 'UNSIGNED_SHORT_4_4_4_4': 0x8033, + 'UNSIGNED_SHORT_5_5_5_1': 0x8034, + 'UNSIGNED_INT_8_8_8_8': 0x8035, + 'UNSIGNED_INT_10_10_10_2': 0x8036, + 'RESCALE_NORMAL': 0x803A, + 'TEXTURE_BINDING_3D': 0x806A, + 'PACK_SKIP_IMAGES': 0x806B, + 'PACK_IMAGE_HEIGHT': 0x806C, + 'UNPACK_SKIP_IMAGES': 0x806D, + 'UNPACK_IMAGE_HEIGHT': 0x806E, + 'TEXTURE_3D': 0x806F, + 'PROXY_TEXTURE_3D': 0x8070, + 'TEXTURE_DEPTH': 0x8071, + 'TEXTURE_WRAP_R': 0x8072, + 'MAX_3D_TEXTURE_SIZE': 0x8073, + 'BGR': 0x80E0, + 'BGRA': 0x80E1, + 'MAX_ELEMENTS_VERTICES': 0x80E8, + 'MAX_ELEMENTS_INDICES': 0x80E9, + 'CLAMP_TO_EDGE': 0x812F, + 'TEXTURE_MIN_LOD': 0x813A, + 'TEXTURE_MAX_LOD': 0x813B, + 'TEXTURE_BASE_LEVEL': 0x813C, + 'TEXTURE_MAX_LEVEL': 0x813D, + 'LIGHT_MODEL_COLOR_CONTROL': 0x81F8, + 'SINGLE_COLOR': 0x81F9, + 'SEPARATE_SPECULAR_COLOR': 0x81FA, + 'UNSIGNED_BYTE_2_3_3_REV': 0x8362, + 'UNSIGNED_SHORT_5_6_5': 0x8363, + 'UNSIGNED_SHORT_5_6_5_REV': 0x8364, + 'UNSIGNED_SHORT_4_4_4_4_REV': 0x8365, + 'UNSIGNED_SHORT_1_5_5_5_REV': 0x8366, + 'UNSIGNED_INT_8_8_8_8_REV': 0x8367, + 'UNSIGNED_INT_2_10_10_10_REV': 0x8368, + 'ALIASED_POINT_SIZE_RANGE': 0x846D, + 'ALIASED_LINE_WIDTH_RANGE': 0x846E, + 'MULTISAMPLE': 0x809D, + 'SAMPLE_ALPHA_TO_COVERAGE': 0x809E, + 'SAMPLE_ALPHA_TO_ONE': 0x809F, + 'SAMPLE_COVERAGE': 0x80A0, + 'SAMPLE_BUFFERS': 0x80A8, + 'SAMPLES': 0x80A9, + 'SAMPLE_COVERAGE_VALUE': 0x80AA, + 'SAMPLE_COVERAGE_INVERT': 0x80AB, + 'CLAMP_TO_BORDER': 0x812D, + 'TEXTURE0': 0x84C0, + 'TEXTURE1': 0x84C1, + 'TEXTURE2': 0x84C2, + 'TEXTURE3': 0x84C3, + 'TEXTURE4': 0x84C4, + 'TEXTURE5': 0x84C5, + 'TEXTURE6': 0x84C6, + 'TEXTURE7': 0x84C7, + 'TEXTURE8': 0x84C8, + 'TEXTURE9': 0x84C9, + 'TEXTURE10': 0x84CA, + 'TEXTURE11': 0x84CB, + 'TEXTURE12': 0x84CC, + 'TEXTURE13': 0x84CD, + 'TEXTURE14': 0x84CE, + 'TEXTURE15': 0x84CF, + 'TEXTURE16': 0x84D0, + 'TEXTURE17': 0x84D1, + 'TEXTURE18': 0x84D2, + 'TEXTURE19': 0x84D3, + 'TEXTURE20': 0x84D4, + 'TEXTURE21': 0x84D5, + 'TEXTURE22': 0x84D6, + 'TEXTURE23': 0x84D7, + 'TEXTURE24': 0x84D8, + 'TEXTURE25': 0x84D9, + 'TEXTURE26': 0x84DA, + 'TEXTURE27': 0x84DB, + 'TEXTURE28': 0x84DC, + 'TEXTURE29': 0x84DD, + 'TEXTURE30': 0x84DE, + 'TEXTURE31': 0x84DF, + 'ACTIVE_TEXTURE': 0x84E0, + 'CLIENT_ACTIVE_TEXTURE': 0x84E1, + 'MAX_TEXTURE_UNITS': 0x84E2, + 'TRANSPOSE_MODELVIEW_MATRIX': 0x84E3, + 'TRANSPOSE_PROJECTION_MATRIX': 0x84E4, + 'TRANSPOSE_TEXTURE_MATRIX': 0x84E5, + 'TRANSPOSE_COLOR_MATRIX': 0x84E6, + 'SUBTRACT': 0x84E7, + 'COMPRESSED_ALPHA': 0x84E9, + 'COMPRESSED_LUMINANCE': 0x84EA, + 'COMPRESSED_LUMINANCE_ALPHA': 0x84EB, + 'COMPRESSED_INTENSITY': 0x84EC, + 'COMPRESSED_RGB': 0x84ED, + 'COMPRESSED_RGBA': 0x84EE, + 'TEXTURE_COMPRESSION_HINT': 0x84EF, + 'NORMAL_MAP': 0x8511, + 'REFLECTION_MAP': 0x8512, + 'TEXTURE_CUBE_MAP': 0x8513, + 'TEXTURE_BINDING_CUBE_MAP': 0x8514, + 'TEXTURE_CUBE_MAP_POSITIVE_X': 0x8515, + 'TEXTURE_CUBE_MAP_NEGATIVE_X': 0x8516, + 'TEXTURE_CUBE_MAP_POSITIVE_Y': 0x8517, + 'TEXTURE_CUBE_MAP_NEGATIVE_Y': 0x8518, + 'TEXTURE_CUBE_MAP_POSITIVE_Z': 0x8519, + 'TEXTURE_CUBE_MAP_NEGATIVE_Z': 0x851A, + 'PROXY_TEXTURE_CUBE_MAP': 0x851B, + 'MAX_CUBE_MAP_TEXTURE_SIZE': 0x851C, + 'COMBINE': 0x8570, + 'COMBINE_RGB': 0x8571, + 'COMBINE_ALPHA': 0x8572, + 'RGB_SCALE': 0x8573, + 'ADD_SIGNED': 0x8574, + 'INTERPOLATE': 0x8575, + 'CONSTANT': 0x8576, + 'PRIMARY_COLOR': 0x8577, + 'PREVIOUS': 0x8578, + 'SOURCE0_RGB': 0x8580, + 'SOURCE1_RGB': 0x8581, + 'SOURCE2_RGB': 0x8582, + 'SOURCE0_ALPHA': 0x8588, + 'SOURCE1_ALPHA': 0x8589, + 'SOURCE2_ALPHA': 0x858A, + 'OPERAND0_RGB': 0x8590, + 'OPERAND1_RGB': 0x8591, + 'OPERAND2_RGB': 0x8592, + 'OPERAND0_ALPHA': 0x8598, + 'OPERAND1_ALPHA': 0x8599, + 'OPERAND2_ALPHA': 0x859A, + 'TEXTURE_COMPRESSED_IMAGE_SIZE': 0x86A0, + 'TEXTURE_COMPRESSED': 0x86A1, + 'NUM_COMPRESSED_TEXTURE_FORMATS': 0x86A2, + 'COMPRESSED_TEXTURE_FORMATS': 0x86A3, + 'DOT3_RGB': 0x86AE, + 'DOT3_RGBA': 0x86AF, + 'MULTISAMPLE_BIT': 0x20000000, + 'BLEND_DST_RGB': 0x80C8, + 'BLEND_SRC_RGB': 0x80C9, + 'BLEND_DST_ALPHA': 0x80CA, + 'BLEND_SRC_ALPHA': 0x80CB, + 'POINT_SIZE_MIN': 0x8126, + 'POINT_SIZE_MAX': 0x8127, + 'POINT_FADE_THRESHOLD_SIZE': 0x8128, + 'POINT_DISTANCE_ATTENUATION': 0x8129, + 'GENERATE_MIPMAP': 0x8191, + 'GENERATE_MIPMAP_HINT': 0x8192, + 'DEPTH_COMPONENT16': 0x81A5, + 'DEPTH_COMPONENT24': 0x81A6, + 'DEPTH_COMPONENT32': 0x81A7, + 'MIRRORED_REPEAT': 0x8370, + 'FOG_COORDINATE_SOURCE': 0x8450, + 'FOG_COORDINATE': 0x8451, + 'FRAGMENT_DEPTH': 0x8452, + 'CURRENT_FOG_COORDINATE': 0x8453, + 'FOG_COORDINATE_ARRAY_TYPE': 0x8454, + 'FOG_COORDINATE_ARRAY_STRIDE': 0x8455, + 'FOG_COORDINATE_ARRAY_POINTER': 0x8456, + 'FOG_COORDINATE_ARRAY': 0x8457, + 'COLOR_SUM': 0x8458, + 'CURRENT_SECONDARY_COLOR': 0x8459, + 'SECONDARY_COLOR_ARRAY_SIZE': 0x845A, + 'SECONDARY_COLOR_ARRAY_TYPE': 0x845B, + 'SECONDARY_COLOR_ARRAY_STRIDE': 0x845C, + 'SECONDARY_COLOR_ARRAY_POINTER': 0x845D, + 'SECONDARY_COLOR_ARRAY': 0x845E, + 'MAX_TEXTURE_LOD_BIAS': 0x84FD, + 'TEXTURE_FILTER_CONTROL': 0x8500, + 'TEXTURE_LOD_BIAS': 0x8501, + 'INCR_WRAP': 0x8507, + 'DECR_WRAP': 0x8508, + 'TEXTURE_DEPTH_SIZE': 0x884A, + 'DEPTH_TEXTURE_MODE': 0x884B, + 'TEXTURE_COMPARE_MODE': 0x884C, + 'TEXTURE_COMPARE_FUNC': 0x884D, + 'COMPARE_R_TO_TEXTURE': 0x884E, + 'BUFFER_SIZE': 0x8764, + 'BUFFER_USAGE': 0x8765, + 'QUERY_COUNTER_BITS': 0x8864, + 'CURRENT_QUERY': 0x8865, + 'QUERY_RESULT': 0x8866, + 'QUERY_RESULT_AVAILABLE': 0x8867, + 'ARRAY_BUFFER': 0x8892, + 'ELEMENT_ARRAY_BUFFER': 0x8893, + 'ARRAY_BUFFER_BINDING': 0x8894, + 'ELEMENT_ARRAY_BUFFER_BINDING': 0x8895, + 'VERTEX_ARRAY_BUFFER_BINDING': 0x8896, + 'NORMAL_ARRAY_BUFFER_BINDING': 0x8897, + 'COLOR_ARRAY_BUFFER_BINDING': 0x8898, + 'INDEX_ARRAY_BUFFER_BINDING': 0x8899, + 'TEXTURE_COORD_ARRAY_BUFFER_BINDING': 0x889A, + 'EDGE_FLAG_ARRAY_BUFFER_BINDING': 0x889B, + 'SECONDARY_COLOR_ARRAY_BUFFER_BINDING': 0x889C, + 'FOG_COORDINATE_ARRAY_BUFFER_BINDING': 0x889D, + 'WEIGHT_ARRAY_BUFFER_BINDING': 0x889E, + 'VERTEX_ATTRIB_ARRAY_BUFFER_BINDING': 0x889F, + 'READ_ONLY': 0x88B8, + 'WRITE_ONLY': 0x88B9, + 'READ_WRITE': 0x88BA, + 'BUFFER_ACCESS': 0x88BB, + 'BUFFER_MAPPED': 0x88BC, + 'BUFFER_MAP_POINTER': 0x88BD, + 'STREAM_DRAW': 0x88E0, + 'STREAM_READ': 0x88E1, + 'STREAM_COPY': 0x88E2, + 'STATIC_DRAW': 0x88E4, + 'STATIC_READ': 0x88E5, + 'STATIC_COPY': 0x88E6, + 'DYNAMIC_DRAW': 0x88E8, + 'DYNAMIC_READ': 0x88E9, + 'DYNAMIC_COPY': 0x88EA, + 'SAMPLES_PASSED': 0x8914, + 'VERTEX_ATTRIB_ARRAY_ENABLED': 0x8622, + 'VERTEX_ATTRIB_ARRAY_SIZE': 0x8623, + 'VERTEX_ATTRIB_ARRAY_STRIDE': 0x8624, + 'VERTEX_ATTRIB_ARRAY_TYPE': 0x8625, + 'CURRENT_VERTEX_ATTRIB': 0x8626, + 'VERTEX_PROGRAM_POINT_SIZE': 0x8642, + 'VERTEX_PROGRAM_TWO_SIDE': 0x8643, + 'VERTEX_ATTRIB_ARRAY_POINTER': 0x8645, + 'STENCIL_BACK_FUNC': 0x8800, + 'STENCIL_BACK_FAIL': 0x8801, + 'STENCIL_BACK_PASS_DEPTH_FAIL': 0x8802, + 'STENCIL_BACK_PASS_DEPTH_PASS': 0x8803, + 'MAX_DRAW_BUFFERS': 0x8824, + 'DRAW_BUFFER0': 0x8825, + 'DRAW_BUFFER1': 0x8826, + 'DRAW_BUFFER2': 0x8827, + 'DRAW_BUFFER3': 0x8828, + 'DRAW_BUFFER4': 0x8829, + 'DRAW_BUFFER5': 0x882A, + 'DRAW_BUFFER6': 0x882B, + 'DRAW_BUFFER7': 0x882C, + 'DRAW_BUFFER8': 0x882D, + 'DRAW_BUFFER9': 0x882E, + 'DRAW_BUFFER10': 0x882F, + 'DRAW_BUFFER11': 0x8830, + 'DRAW_BUFFER12': 0x8831, + 'DRAW_BUFFER13': 0x8832, + 'DRAW_BUFFER14': 0x8833, + 'DRAW_BUFFER15': 0x8834, + 'BLEND_EQUATION_ALPHA': 0x883D, + 'POINT_SPRITE': 0x8861, + 'COORD_REPLACE': 0x8862, + 'MAX_VERTEX_ATTRIBS': 0x8869, + 'VERTEX_ATTRIB_ARRAY_NORMALIZED': 0x886A, + 'MAX_TEXTURE_COORDS': 0x8871, + 'MAX_TEXTURE_IMAGE_UNITS': 0x8872, + 'FRAGMENT_SHADER': 0x8B30, + 'VERTEX_SHADER': 0x8B31, + 'MAX_FRAGMENT_UNIFORM_COMPONENTS': 0x8B49, + 'MAX_VERTEX_UNIFORM_COMPONENTS': 0x8B4A, + 'MAX_VARYING_FLOATS': 0x8B4B, + 'MAX_VERTEX_TEXTURE_IMAGE_UNITS': 0x8B4C, + 'MAX_COMBINED_TEXTURE_IMAGE_UNITS': 0x8B4D, + 'SHADER_TYPE': 0x8B4F, + 'FLOAT_VEC2': 0x8B50, + 'FLOAT_VEC3': 0x8B51, + 'FLOAT_VEC4': 0x8B52, + 'INT_VEC2': 0x8B53, + 'INT_VEC3': 0x8B54, + 'INT_VEC4': 0x8B55, + 'BOOL': 0x8B56, + 'BOOL_VEC2': 0x8B57, + 'BOOL_VEC3': 0x8B58, + 'BOOL_VEC4': 0x8B59, + 'FLOAT_MAT2': 0x8B5A, + 'FLOAT_MAT3': 0x8B5B, + 'FLOAT_MAT4': 0x8B5C, + 'SAMPLER_1D': 0x8B5D, + 'SAMPLER_2D': 0x8B5E, + 'SAMPLER_3D': 0x8B5F, + 'SAMPLER_CUBE': 0x8B60, + 'SAMPLER_1D_SHADOW': 0x8B61, + 'SAMPLER_2D_SHADOW': 0x8B62, + 'DELETE_STATUS': 0x8B80, + 'COMPILE_STATUS': 0x8B81, + 'LINK_STATUS': 0x8B82, + 'VALIDATE_STATUS': 0x8B83, + 'INFO_LOG_LENGTH': 0x8B84, + 'ATTACHED_SHADERS': 0x8B85, + 'ACTIVE_UNIFORMS': 0x8B86, + 'ACTIVE_UNIFORM_MAX_LENGTH': 0x8B87, + 'SHADER_SOURCE_LENGTH': 0x8B88, + 'ACTIVE_ATTRIBUTES': 0x8B89, + 'ACTIVE_ATTRIBUTE_MAX_LENGTH': 0x8B8A, + 'FRAGMENT_SHADER_DERIVATIVE_HINT': 0x8B8B, + 'SHADING_LANGUAGE_VERSION': 0x8B8C, + 'CURRENT_PROGRAM': 0x8B8D, + 'POINT_SPRITE_COORD_ORIGIN': 0x8CA0, + 'LOWER_LEFT': 0x8CA1, + 'UPPER_LEFT': 0x8CA2, + 'STENCIL_BACK_REF': 0x8CA3, + 'STENCIL_BACK_VALUE_MASK': 0x8CA4, + 'STENCIL_BACK_WRITEMASK': 0x8CA5, + 'CURRENT_RASTER_SECONDARY_COLOR': 0x845F, + 'PIXEL_PACK_BUFFER': 0x88EB, + 'PIXEL_UNPACK_BUFFER': 0x88EC, + 'PIXEL_PACK_BUFFER_BINDING': 0x88ED, + 'PIXEL_UNPACK_BUFFER_BINDING': 0x88EF, + 'FLOAT_MAT2x3': 0x8B65, + 'FLOAT_MAT2x4': 0x8B66, + 'FLOAT_MAT3x2': 0x8B67, + 'FLOAT_MAT3x4': 0x8B68, + 'FLOAT_MAT4x2': 0x8B69, + 'FLOAT_MAT4x3': 0x8B6A, + 'SRGB': 0x8C40, + 'SRGB8': 0x8C41, + 'SRGB_ALPHA': 0x8C42, + 'SRGB8_ALPHA8': 0x8C43, + 'SLUMINANCE_ALPHA': 0x8C44, + 'SLUMINANCE8_ALPHA8': 0x8C45, + 'SLUMINANCE': 0x8C46, + 'SLUMINANCE8': 0x8C47, + 'COMPRESSED_SRGB': 0x8C48, + 'COMPRESSED_SRGB_ALPHA': 0x8C49, + 'COMPRESSED_SLUMINANCE': 0x8C4A, + 'COMPRESSED_SLUMINANCE_ALPHA': 0x8C4B, + 'CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT': 0x0001, + 'MAJOR_VERSION': 0x821B, + 'MINOR_VERSION': 0x821C, + 'NUM_EXTENSIONS': 0x821D, + 'CONTEXT_FLAGS': 0x821E, + 'DEPTH_BUFFER': 0x8223, + 'STENCIL_BUFFER': 0x8224, + 'COMPRESSED_RED': 0x8225, + 'COMPRESSED_RG': 0x8226, + 'RGBA32F': 0x8814, + 'RGB32F': 0x8815, + 'RGBA16F': 0x881A, + 'RGB16F': 0x881B, + 'VERTEX_ATTRIB_ARRAY_INTEGER': 0x88FD, + 'MAX_ARRAY_TEXTURE_LAYERS': 0x88FF, + 'MIN_PROGRAM_TEXEL_OFFSET': 0x8904, + 'MAX_PROGRAM_TEXEL_OFFSET': 0x8905, + 'CLAMP_VERTEX_COLOR': 0x891A, + 'CLAMP_FRAGMENT_COLOR': 0x891B, + 'CLAMP_READ_COLOR': 0x891C, + 'FIXED_ONLY': 0x891D, + 'TEXTURE_RED_TYPE': 0x8C10, + 'TEXTURE_GREEN_TYPE': 0x8C11, + 'TEXTURE_BLUE_TYPE': 0x8C12, + 'TEXTURE_ALPHA_TYPE': 0x8C13, + 'TEXTURE_LUMINANCE_TYPE': 0x8C14, + 'TEXTURE_INTENSITY_TYPE': 0x8C15, + 'TEXTURE_DEPTH_TYPE': 0x8C16, + 'UNSIGNED_NORMALIZED': 0x8C17, + 'TEXTURE_1D_ARRAY': 0x8C18, + 'PROXY_TEXTURE_1D_ARRAY': 0x8C19, + 'TEXTURE_2D_ARRAY': 0x8C1A, + 'PROXY_TEXTURE_2D_ARRAY': 0x8C1B, + 'TEXTURE_BINDING_1D_ARRAY': 0x8C1C, + 'TEXTURE_BINDING_2D_ARRAY': 0x8C1D, + 'R11F_G11F_B10F': 0x8C3A, + 'UNSIGNED_INT_10F_11F_11F_REV': 0x8C3B, + 'RGB9_E5': 0x8C3D, + 'UNSIGNED_INT_5_9_9_9_REV': 0x8C3E, + 'TEXTURE_SHARED_SIZE': 0x8C3F, + 'TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH': 0x8C76, + 'TRANSFORM_FEEDBACK_BUFFER_MODE': 0x8C7F, + 'MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS': 0x8C80, + 'TRANSFORM_FEEDBACK_VARYINGS': 0x8C83, + 'TRANSFORM_FEEDBACK_BUFFER_START': 0x8C84, + 'TRANSFORM_FEEDBACK_BUFFER_SIZE': 0x8C85, + 'PRIMITIVES_GENERATED': 0x8C87, + 'TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN': 0x8C88, + 'RASTERIZER_DISCARD': 0x8C89, + 'MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS': 0x8C8A, + 'MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS': 0x8C8B, + 'INTERLEAVED_ATTRIBS': 0x8C8C, + 'SEPARATE_ATTRIBS': 0x8C8D, + 'TRANSFORM_FEEDBACK_BUFFER': 0x8C8E, + 'TRANSFORM_FEEDBACK_BUFFER_BINDING': 0x8C8F, + 'RGBA32UI': 0x8D70, + 'RGB32UI': 0x8D71, + 'RGBA16UI': 0x8D76, + 'RGB16UI': 0x8D77, + 'RGBA8UI': 0x8D7C, + 'RGB8UI': 0x8D7D, + 'RGBA32I': 0x8D82, + 'RGB32I': 0x8D83, + 'RGBA16I': 0x8D88, + 'RGB16I': 0x8D89, + 'RGBA8I': 0x8D8E, + 'RGB8I': 0x8D8F, + 'RED_INTEGER': 0x8D94, + 'GREEN_INTEGER': 0x8D95, + 'BLUE_INTEGER': 0x8D96, + 'ALPHA_INTEGER': 0x8D97, + 'RGB_INTEGER': 0x8D98, + 'RGBA_INTEGER': 0x8D99, + 'BGR_INTEGER': 0x8D9A, + 'BGRA_INTEGER': 0x8D9B, + 'SAMPLER_1D_ARRAY': 0x8DC0, + 'SAMPLER_2D_ARRAY': 0x8DC1, + 'SAMPLER_1D_ARRAY_SHADOW': 0x8DC3, + 'SAMPLER_2D_ARRAY_SHADOW': 0x8DC4, + 'SAMPLER_CUBE_SHADOW': 0x8DC5, + 'UNSIGNED_INT_VEC2': 0x8DC6, + 'UNSIGNED_INT_VEC3': 0x8DC7, + 'UNSIGNED_INT_VEC4': 0x8DC8, + 'INT_SAMPLER_1D': 0x8DC9, + 'INT_SAMPLER_2D': 0x8DCA, + 'INT_SAMPLER_3D': 0x8DCB, + 'INT_SAMPLER_CUBE': 0x8DCC, + 'INT_SAMPLER_1D_ARRAY': 0x8DCE, + 'INT_SAMPLER_2D_ARRAY': 0x8DCF, + 'UNSIGNED_INT_SAMPLER_1D': 0x8DD1, + 'UNSIGNED_INT_SAMPLER_2D': 0x8DD2, + 'UNSIGNED_INT_SAMPLER_3D': 0x8DD3, + 'UNSIGNED_INT_SAMPLER_CUBE': 0x8DD4, + 'UNSIGNED_INT_SAMPLER_1D_ARRAY': 0x8DD6, + 'UNSIGNED_INT_SAMPLER_2D_ARRAY': 0x8DD7, + 'QUERY_WAIT': 0x8E13, + 'QUERY_NO_WAIT': 0x8E14, + 'QUERY_BY_REGION_WAIT': 0x8E15, + 'QUERY_BY_REGION_NO_WAIT': 0x8E16, + 'MULTISAMPLE_3DFX': 0x86B2, + 'SAMPLE_BUFFERS_3DFX': 0x86B3, + 'SAMPLES_3DFX': 0x86B4, + 'MULTISAMPLE_BIT_3DFX': 0x20000000, + 'COMPRESSED_RGB_FXT1_3DFX': 0x86B0, + 'COMPRESSED_RGBA_FXT1_3DFX': 0x86B1, + 'UNPACK_CLIENT_STORAGE_APPLE': 0x85B2, + 'ELEMENT_ARRAY_APPLE': 0x8768, + 'ELEMENT_ARRAY_TYPE_APPLE': 0x8769, + 'ELEMENT_ARRAY_POINTER_APPLE': 0x876A, + 'HALF_APPLE': 0x140B, + 'RGBA_FLOAT32_APPLE': 0x8814, + 'RGB_FLOAT32_APPLE': 0x8815, + 'ALPHA_FLOAT32_APPLE': 0x8816, + 'INTENSITY_FLOAT32_APPLE': 0x8817, + 'LUMINANCE_FLOAT32_APPLE': 0x8818, + 'LUMINANCE_ALPHA_FLOAT32_APPLE': 0x8819, + 'RGBA_FLOAT16_APPLE': 0x881A, + 'RGB_FLOAT16_APPLE': 0x881B, + 'ALPHA_FLOAT16_APPLE': 0x881C, + 'INTENSITY_FLOAT16_APPLE': 0x881D, + 'LUMINANCE_FLOAT16_APPLE': 0x881E, + 'LUMINANCE_ALPHA_FLOAT16_APPLE': 0x881F, + 'COLOR_FLOAT_APPLE': 0x8A0F, + 'BUFFER_SERIALIZED_MODIFY_APPLE': 0x8A12, + 'BUFFER_FLUSHING_UNMAP_APPLE': 0x8A13, + 'MIN_PBUFFER_VIEWPORT_DIMS_APPLE': 0x8A10, + 'LIGHT_MODEL_SPECULAR_VECTOR_APPLE': 0x85B0, + 'TEXTURE_RANGE_LENGTH_APPLE': 0x85B7, + 'TEXTURE_RANGE_POINTER_APPLE': 0x85B8, + 'TEXTURE_STORAGE_HINT_APPLE': 0x85BC, + 'STORAGE_PRIVATE_APPLE': 0x85BD, + 'STORAGE_CACHED_APPLE': 0x85BE, + 'STORAGE_SHARED_APPLE': 0x85BF, + 'TRANSFORM_HINT_APPLE': 0x85B1, + 'VERTEX_ARRAY_BINDING_APPLE': 0x85B5, + 'VERTEX_ARRAY_RANGE_APPLE': 0x851D, + 'VERTEX_ARRAY_RANGE_LENGTH_APPLE': 0x851E, + 'VERTEX_ARRAY_STORAGE_HINT_APPLE': 0x851F, + 'MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE': 0x8520, + 'VERTEX_ARRAY_RANGE_POINTER_APPLE': 0x8521, + 'STORAGE_CACHED_APPLE': 0x85BE, + 'STORAGE_SHARED_APPLE': 0x85BF, + 'YCBCR_422_APPLE': 0x85B9, + 'UNSIGNED_SHORT_8_8_APPLE': 0x85BA, + 'UNSIGNED_SHORT_8_8_REV_APPLE': 0x85BB, + 'RGBA_FLOAT_MODE_ARB': 0x8820, + 'CLAMP_VERTEX_COLOR_ARB': 0x891A, + 'CLAMP_FRAGMENT_COLOR_ARB': 0x891B, + 'CLAMP_READ_COLOR_ARB': 0x891C, + 'FIXED_ONLY_ARB': 0x891D, + 'DEPTH_COMPONENT32F': 0x8CAC, + 'DEPTH32F_STENCIL8': 0x8CAD, + 'FLOAT_32_UNSIGNED_INT_24_8_REV': 0x8DAD, + 'DEPTH_COMPONENT16_ARB': 0x81A5, + 'DEPTH_COMPONENT24_ARB': 0x81A6, + 'DEPTH_COMPONENT32_ARB': 0x81A7, + 'TEXTURE_DEPTH_SIZE_ARB': 0x884A, + 'DEPTH_TEXTURE_MODE_ARB': 0x884B, + 'MAX_DRAW_BUFFERS_ARB': 0x8824, + 'DRAW_BUFFER0_ARB': 0x8825, + 'DRAW_BUFFER1_ARB': 0x8826, + 'DRAW_BUFFER2_ARB': 0x8827, + 'DRAW_BUFFER3_ARB': 0x8828, + 'DRAW_BUFFER4_ARB': 0x8829, + 'DRAW_BUFFER5_ARB': 0x882A, + 'DRAW_BUFFER6_ARB': 0x882B, + 'DRAW_BUFFER7_ARB': 0x882C, + 'DRAW_BUFFER8_ARB': 0x882D, + 'DRAW_BUFFER9_ARB': 0x882E, + 'DRAW_BUFFER10_ARB': 0x882F, + 'DRAW_BUFFER11_ARB': 0x8830, + 'DRAW_BUFFER12_ARB': 0x8831, + 'DRAW_BUFFER13_ARB': 0x8832, + 'DRAW_BUFFER14_ARB': 0x8833, + 'DRAW_BUFFER15_ARB': 0x8834, + 'FRAGMENT_PROGRAM_ARB': 0x8804, + 'PROGRAM_ALU_INSTRUCTIONS_ARB': 0x8805, + 'PROGRAM_TEX_INSTRUCTIONS_ARB': 0x8806, + 'PROGRAM_TEX_INDIRECTIONS_ARB': 0x8807, + 'PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB': 0x8808, + 'PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB': 0x8809, + 'PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB': 0x880A, + 'MAX_PROGRAM_ALU_INSTRUCTIONS_ARB': 0x880B, + 'MAX_PROGRAM_TEX_INSTRUCTIONS_ARB': 0x880C, + 'MAX_PROGRAM_TEX_INDIRECTIONS_ARB': 0x880D, + 'MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB': 0x880E, + 'MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB': 0x880F, + 'MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB': 0x8810, + 'MAX_TEXTURE_COORDS_ARB': 0x8871, + 'MAX_TEXTURE_IMAGE_UNITS_ARB': 0x8872, + 'FRAGMENT_SHADER_ARB': 0x8B30, + 'MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB': 0x8B49, + 'FRAGMENT_SHADER_DERIVATIVE_HINT_ARB': 0x8B8B, + 'INVALID_FRAMEBUFFER_OPERATION': 0x0506, + 'FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING': 0x8210, + 'FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE': 0x8211, + 'FRAMEBUFFER_ATTACHMENT_RED_SIZE': 0x8212, + 'FRAMEBUFFER_ATTACHMENT_GREEN_SIZE': 0x8213, + 'FRAMEBUFFER_ATTACHMENT_BLUE_SIZE': 0x8214, + 'FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE': 0x8215, + 'FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE': 0x8216, + 'FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE': 0x8217, + 'FRAMEBUFFER_DEFAULT': 0x8218, + 'FRAMEBUFFER_UNDEFINED': 0x8219, + 'DEPTH_STENCIL_ATTACHMENT': 0x821A, + 'INDEX': 0x8222, + 'MAX_RENDERBUFFER_SIZE': 0x84E8, + 'DEPTH_STENCIL': 0x84F9, + 'UNSIGNED_INT_24_8': 0x84FA, + 'DEPTH24_STENCIL8': 0x88F0, + 'TEXTURE_STENCIL_SIZE': 0x88F1, + 'UNSIGNED_NORMALIZED': 0x8C17, + 'SRGB': 0x8C40, + 'DRAW_FRAMEBUFFER_BINDING': 0x8CA6, + 'FRAMEBUFFER_BINDING': 0x8CA6, + 'RENDERBUFFER_BINDING': 0x8CA7, + 'READ_FRAMEBUFFER': 0x8CA8, + 'DRAW_FRAMEBUFFER': 0x8CA9, + 'READ_FRAMEBUFFER_BINDING': 0x8CAA, + 'RENDERBUFFER_SAMPLES': 0x8CAB, + 'FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE': 0x8CD0, + 'FRAMEBUFFER_ATTACHMENT_OBJECT_NAME': 0x8CD1, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL': 0x8CD2, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE': 0x8CD3, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER': 0x8CD4, + 'FRAMEBUFFER_COMPLETE': 0x8CD5, + 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT': 0x8CD6, + 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT': 0x8CD7, + 'FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER': 0x8CDB, + 'FRAMEBUFFER_INCOMPLETE_READ_BUFFER': 0x8CDC, + 'FRAMEBUFFER_UNSUPPORTED': 0x8CDD, + 'MAX_COLOR_ATTACHMENTS': 0x8CDF, + 'COLOR_ATTACHMENT0': 0x8CE0, + 'COLOR_ATTACHMENT1': 0x8CE1, + 'COLOR_ATTACHMENT2': 0x8CE2, + 'COLOR_ATTACHMENT3': 0x8CE3, + 'COLOR_ATTACHMENT4': 0x8CE4, + 'COLOR_ATTACHMENT5': 0x8CE5, + 'COLOR_ATTACHMENT6': 0x8CE6, + 'COLOR_ATTACHMENT7': 0x8CE7, + 'COLOR_ATTACHMENT8': 0x8CE8, + 'COLOR_ATTACHMENT9': 0x8CE9, + 'COLOR_ATTACHMENT10': 0x8CEA, + 'COLOR_ATTACHMENT11': 0x8CEB, + 'COLOR_ATTACHMENT12': 0x8CEC, + 'COLOR_ATTACHMENT13': 0x8CED, + 'COLOR_ATTACHMENT14': 0x8CEE, + 'COLOR_ATTACHMENT15': 0x8CEF, + 'DEPTH_ATTACHMENT': 0x8D00, + 'STENCIL_ATTACHMENT': 0x8D20, + 'FRAMEBUFFER': 0x8D40, + 'RENDERBUFFER': 0x8D41, + 'RENDERBUFFER_WIDTH': 0x8D42, + 'RENDERBUFFER_HEIGHT': 0x8D43, + 'RENDERBUFFER_INTERNAL_FORMAT': 0x8D44, + 'STENCIL_INDEX1': 0x8D46, + 'STENCIL_INDEX4': 0x8D47, + 'STENCIL_INDEX8': 0x8D48, + 'STENCIL_INDEX16': 0x8D49, + 'RENDERBUFFER_RED_SIZE': 0x8D50, + 'RENDERBUFFER_GREEN_SIZE': 0x8D51, + 'RENDERBUFFER_BLUE_SIZE': 0x8D52, + 'RENDERBUFFER_ALPHA_SIZE': 0x8D53, + 'RENDERBUFFER_DEPTH_SIZE': 0x8D54, + 'RENDERBUFFER_STENCIL_SIZE': 0x8D55, + 'FRAMEBUFFER_INCOMPLETE_MULTISAMPLE': 0x8D56, + 'MAX_SAMPLES': 0x8D57, + 'FRAMEBUFFER_SRGB': 0x8DB9, + 'LINES_ADJACENCY_ARB': 0xA, + 'LINE_STRIP_ADJACENCY_ARB': 0xB, + 'TRIANGLES_ADJACENCY_ARB': 0xC, + 'TRIANGLE_STRIP_ADJACENCY_ARB': 0xD, + 'PROGRAM_POINT_SIZE_ARB': 0x8642, + 'MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB': 0x8C29, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER': 0x8CD4, + 'FRAMEBUFFER_ATTACHMENT_LAYERED_ARB': 0x8DA7, + 'FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB': 0x8DA8, + 'FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB': 0x8DA9, + 'GEOMETRY_SHADER_ARB': 0x8DD9, + 'GEOMETRY_VERTICES_OUT_ARB': 0x8DDA, + 'GEOMETRY_INPUT_TYPE_ARB': 0x8DDB, + 'GEOMETRY_OUTPUT_TYPE_ARB': 0x8DDC, + 'MAX_GEOMETRY_VARYING_COMPONENTS_ARB': 0x8DDD, + 'MAX_VERTEX_VARYING_COMPONENTS_ARB': 0x8DDE, + 'MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB': 0x8DDF, + 'MAX_GEOMETRY_OUTPUT_VERTICES_ARB': 0x8DE0, + 'MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB': 0x8DE1, + 'HALF_FLOAT_ARB': 0x140B, + 'HALF_FLOAT': 0x140B, + 'CONSTANT_COLOR': 0x8001, + 'ONE_MINUS_CONSTANT_COLOR': 0x8002, + 'CONSTANT_ALPHA': 0x8003, + 'ONE_MINUS_CONSTANT_ALPHA': 0x8004, + 'BLEND_COLOR': 0x8005, + 'FUNC_ADD': 0x8006, + 'MIN': 0x8007, + 'MAX': 0x8008, + 'BLEND_EQUATION': 0x8009, + 'FUNC_SUBTRACT': 0x800A, + 'FUNC_REVERSE_SUBTRACT': 0x800B, + 'CONVOLUTION_1D': 0x8010, + 'CONVOLUTION_2D': 0x8011, + 'SEPARABLE_2D': 0x8012, + 'CONVOLUTION_BORDER_MODE': 0x8013, + 'CONVOLUTION_FILTER_SCALE': 0x8014, + 'CONVOLUTION_FILTER_BIAS': 0x8015, + 'REDUCE': 0x8016, + 'CONVOLUTION_FORMAT': 0x8017, + 'CONVOLUTION_WIDTH': 0x8018, + 'CONVOLUTION_HEIGHT': 0x8019, + 'MAX_CONVOLUTION_WIDTH': 0x801A, + 'MAX_CONVOLUTION_HEIGHT': 0x801B, + 'POST_CONVOLUTION_RED_SCALE': 0x801C, + 'POST_CONVOLUTION_GREEN_SCALE': 0x801D, + 'POST_CONVOLUTION_BLUE_SCALE': 0x801E, + 'POST_CONVOLUTION_ALPHA_SCALE': 0x801F, + 'POST_CONVOLUTION_RED_BIAS': 0x8020, + 'POST_CONVOLUTION_GREEN_BIAS': 0x8021, + 'POST_CONVOLUTION_BLUE_BIAS': 0x8022, + 'POST_CONVOLUTION_ALPHA_BIAS': 0x8023, + 'HISTOGRAM': 0x8024, + 'PROXY_HISTOGRAM': 0x8025, + 'HISTOGRAM_WIDTH': 0x8026, + 'HISTOGRAM_FORMAT': 0x8027, + 'HISTOGRAM_RED_SIZE': 0x8028, + 'HISTOGRAM_GREEN_SIZE': 0x8029, + 'HISTOGRAM_BLUE_SIZE': 0x802A, + 'HISTOGRAM_ALPHA_SIZE': 0x802B, + 'HISTOGRAM_LUMINANCE_SIZE': 0x802C, + 'HISTOGRAM_SINK': 0x802D, + 'MINMAX': 0x802E, + 'MINMAX_FORMAT': 0x802F, + 'MINMAX_SINK': 0x8030, + 'TABLE_TOO_LARGE': 0x8031, + 'COLOR_MATRIX': 0x80B1, + 'COLOR_MATRIX_STACK_DEPTH': 0x80B2, + 'MAX_COLOR_MATRIX_STACK_DEPTH': 0x80B3, + 'POST_COLOR_MATRIX_RED_SCALE': 0x80B4, + 'POST_COLOR_MATRIX_GREEN_SCALE': 0x80B5, + 'POST_COLOR_MATRIX_BLUE_SCALE': 0x80B6, + 'POST_COLOR_MATRIX_ALPHA_SCALE': 0x80B7, + 'POST_COLOR_MATRIX_RED_BIAS': 0x80B8, + 'POST_COLOR_MATRIX_GREEN_BIAS': 0x80B9, + 'POST_COLOR_MATRIX_BLUE_BIAS': 0x80BA, + 'POST_COLOR_MATRIX_ALPHA_BIAS': 0x80BB, + 'COLOR_TABLE': 0x80D0, + 'POST_CONVOLUTION_COLOR_TABLE': 0x80D1, + 'POST_COLOR_MATRIX_COLOR_TABLE': 0x80D2, + 'PROXY_COLOR_TABLE': 0x80D3, + 'PROXY_POST_CONVOLUTION_COLOR_TABLE': 0x80D4, + 'PROXY_POST_COLOR_MATRIX_COLOR_TABLE': 0x80D5, + 'COLOR_TABLE_SCALE': 0x80D6, + 'COLOR_TABLE_BIAS': 0x80D7, + 'COLOR_TABLE_FORMAT': 0x80D8, + 'COLOR_TABLE_WIDTH': 0x80D9, + 'COLOR_TABLE_RED_SIZE': 0x80DA, + 'COLOR_TABLE_GREEN_SIZE': 0x80DB, + 'COLOR_TABLE_BLUE_SIZE': 0x80DC, + 'COLOR_TABLE_ALPHA_SIZE': 0x80DD, + 'COLOR_TABLE_LUMINANCE_SIZE': 0x80DE, + 'COLOR_TABLE_INTENSITY_SIZE': 0x80DF, + 'IGNORE_BORDER': 0x8150, + 'CONSTANT_BORDER': 0x8151, + 'WRAP_BORDER': 0x8152, + 'REPLICATE_BORDER': 0x8153, + 'CONVOLUTION_BORDER_COLOR': 0x8154, + 'VERTEX_ATTRIB_ARRAY_DIVISOR_ARB': 0x88FE, + 'MAP_READ_BIT': 0x0001, + 'MAP_WRITE_BIT': 0x0002, + 'MAP_INVALIDATE_RANGE_BIT': 0x0004, + 'MAP_INVALIDATE_BUFFER_BIT': 0x0008, + 'MAP_FLUSH_EXPLICIT_BIT': 0x0010, + 'MAP_UNSYNCHRONIZED_BIT': 0x0020, + 'MATRIX_PALETTE_ARB': 0x8840, + 'MAX_MATRIX_PALETTE_STACK_DEPTH_ARB': 0x8841, + 'MAX_PALETTE_MATRICES_ARB': 0x8842, + 'CURRENT_PALETTE_MATRIX_ARB': 0x8843, + 'MATRIX_INDEX_ARRAY_ARB': 0x8844, + 'CURRENT_MATRIX_INDEX_ARB': 0x8845, + 'MATRIX_INDEX_ARRAY_SIZE_ARB': 0x8846, + 'MATRIX_INDEX_ARRAY_TYPE_ARB': 0x8847, + 'MATRIX_INDEX_ARRAY_STRIDE_ARB': 0x8848, + 'MATRIX_INDEX_ARRAY_POINTER_ARB': 0x8849, + 'MULTISAMPLE_ARB': 0x809D, + 'SAMPLE_ALPHA_TO_COVERAGE_ARB': 0x809E, + 'SAMPLE_ALPHA_TO_ONE_ARB': 0x809F, + 'SAMPLE_COVERAGE_ARB': 0x80A0, + 'SAMPLE_BUFFERS_ARB': 0x80A8, + 'SAMPLES_ARB': 0x80A9, + 'SAMPLE_COVERAGE_VALUE_ARB': 0x80AA, + 'SAMPLE_COVERAGE_INVERT_ARB': 0x80AB, + 'MULTISAMPLE_BIT_ARB': 0x20000000, + 'TEXTURE0_ARB': 0x84C0, + 'TEXTURE1_ARB': 0x84C1, + 'TEXTURE2_ARB': 0x84C2, + 'TEXTURE3_ARB': 0x84C3, + 'TEXTURE4_ARB': 0x84C4, + 'TEXTURE5_ARB': 0x84C5, + 'TEXTURE6_ARB': 0x84C6, + 'TEXTURE7_ARB': 0x84C7, + 'TEXTURE8_ARB': 0x84C8, + 'TEXTURE9_ARB': 0x84C9, + 'TEXTURE10_ARB': 0x84CA, + 'TEXTURE11_ARB': 0x84CB, + 'TEXTURE12_ARB': 0x84CC, + 'TEXTURE13_ARB': 0x84CD, + 'TEXTURE14_ARB': 0x84CE, + 'TEXTURE15_ARB': 0x84CF, + 'TEXTURE16_ARB': 0x84D0, + 'TEXTURE17_ARB': 0x84D1, + 'TEXTURE18_ARB': 0x84D2, + 'TEXTURE19_ARB': 0x84D3, + 'TEXTURE20_ARB': 0x84D4, + 'TEXTURE21_ARB': 0x84D5, + 'TEXTURE22_ARB': 0x84D6, + 'TEXTURE23_ARB': 0x84D7, + 'TEXTURE24_ARB': 0x84D8, + 'TEXTURE25_ARB': 0x84D9, + 'TEXTURE26_ARB': 0x84DA, + 'TEXTURE27_ARB': 0x84DB, + 'TEXTURE28_ARB': 0x84DC, + 'TEXTURE29_ARB': 0x84DD, + 'TEXTURE30_ARB': 0x84DE, + 'TEXTURE31_ARB': 0x84DF, + 'ACTIVE_TEXTURE_ARB': 0x84E0, + 'CLIENT_ACTIVE_TEXTURE_ARB': 0x84E1, + 'MAX_TEXTURE_UNITS_ARB': 0x84E2, + 'QUERY_COUNTER_BITS_ARB': 0x8864, + 'CURRENT_QUERY_ARB': 0x8865, + 'QUERY_RESULT_ARB': 0x8866, + 'QUERY_RESULT_AVAILABLE_ARB': 0x8867, + 'SAMPLES_PASSED_ARB': 0x8914, + 'PIXEL_PACK_BUFFER_ARB': 0x88EB, + 'PIXEL_UNPACK_BUFFER_ARB': 0x88EC, + 'PIXEL_PACK_BUFFER_BINDING_ARB': 0x88ED, + 'PIXEL_UNPACK_BUFFER_BINDING_ARB': 0x88EF, + 'POINT_SIZE_MIN_ARB': 0x8126, + 'POINT_SIZE_MAX_ARB': 0x8127, + 'POINT_FADE_THRESHOLD_SIZE_ARB': 0x8128, + 'POINT_DISTANCE_ATTENUATION_ARB': 0x8129, + 'POINT_SPRITE_ARB': 0x8861, + 'COORD_REPLACE_ARB': 0x8862, + 'PROGRAM_OBJECT_ARB': 0x8B40, + 'SHADER_OBJECT_ARB': 0x8B48, + 'OBJECT_TYPE_ARB': 0x8B4E, + 'OBJECT_SUBTYPE_ARB': 0x8B4F, + 'FLOAT_VEC2_ARB': 0x8B50, + 'FLOAT_VEC3_ARB': 0x8B51, + 'FLOAT_VEC4_ARB': 0x8B52, + 'INT_VEC2_ARB': 0x8B53, + 'INT_VEC3_ARB': 0x8B54, + 'INT_VEC4_ARB': 0x8B55, + 'BOOL_ARB': 0x8B56, + 'BOOL_VEC2_ARB': 0x8B57, + 'BOOL_VEC3_ARB': 0x8B58, + 'BOOL_VEC4_ARB': 0x8B59, + 'FLOAT_MAT2_ARB': 0x8B5A, + 'FLOAT_MAT3_ARB': 0x8B5B, + 'FLOAT_MAT4_ARB': 0x8B5C, + 'SAMPLER_1D_ARB': 0x8B5D, + 'SAMPLER_2D_ARB': 0x8B5E, + 'SAMPLER_3D_ARB': 0x8B5F, + 'SAMPLER_CUBE_ARB': 0x8B60, + 'SAMPLER_1D_SHADOW_ARB': 0x8B61, + 'SAMPLER_2D_SHADOW_ARB': 0x8B62, + 'SAMPLER_2D_RECT_ARB': 0x8B63, + 'SAMPLER_2D_RECT_SHADOW_ARB': 0x8B64, + 'OBJECT_DELETE_STATUS_ARB': 0x8B80, + 'OBJECT_COMPILE_STATUS_ARB': 0x8B81, + 'OBJECT_LINK_STATUS_ARB': 0x8B82, + 'OBJECT_VALIDATE_STATUS_ARB': 0x8B83, + 'OBJECT_INFO_LOG_LENGTH_ARB': 0x8B84, + 'OBJECT_ATTACHED_OBJECTS_ARB': 0x8B85, + 'OBJECT_ACTIVE_UNIFORMS_ARB': 0x8B86, + 'OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB': 0x8B87, + 'ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH': 0x8A35, + 'UNIFORM_NAME_LENGTH': 0x8A39, + 'UNIFORM_BLOCK_NAME_LENGTH': 0x8A41, + 'OBJECT_SHADER_SOURCE_LENGTH_ARB': 0x8B88, + 'SHADING_LANGUAGE_VERSION_ARB': 0x8B8C, + 'TEXTURE_COMPARE_MODE_ARB': 0x884C, + 'TEXTURE_COMPARE_FUNC_ARB': 0x884D, + 'COMPARE_R_TO_TEXTURE_ARB': 0x884E, + 'TEXTURE_COMPARE_FAIL_VALUE_ARB': 0x80BF, + 'CLAMP_TO_BORDER_ARB': 0x812D, + 'TEXTURE_BUFFER_ARB': 0x8C2A, + 'MAX_TEXTURE_BUFFER_SIZE_ARB': 0x8C2B, + 'TEXTURE_BINDING_BUFFER_ARB': 0x8C2C, + 'TEXTURE_BUFFER_DATA_STORE_BINDING_ARB': 0x8C2D, + 'TEXTURE_BUFFER_FORMAT_ARB': 0x8C2E, + 'COMPRESSED_ALPHA_ARB': 0x84E9, + 'COMPRESSED_LUMINANCE_ARB': 0x84EA, + 'COMPRESSED_LUMINANCE_ALPHA_ARB': 0x84EB, + 'COMPRESSED_INTENSITY_ARB': 0x84EC, + 'COMPRESSED_RGB_ARB': 0x84ED, + 'COMPRESSED_RGBA_ARB': 0x84EE, + 'TEXTURE_COMPRESSION_HINT_ARB': 0x84EF, + 'TEXTURE_COMPRESSED_IMAGE_SIZE_ARB': 0x86A0, + 'TEXTURE_COMPRESSED_ARB': 0x86A1, + 'NUM_COMPRESSED_TEXTURE_FORMATS_ARB': 0x86A2, + 'COMPRESSED_TEXTURE_FORMATS_ARB': 0x86A3, + 'COMPRESSED_RED_RGTC1': 0x8DBB, + 'COMPRESSED_SIGNED_RED_RGTC1': 0x8DBC, + 'COMPRESSED_RG_RGTC2': 0x8DBD, + 'COMPRESSED_SIGNED_RG_RGTC2': 0x8DBE, + 'NORMAL_MAP_ARB': 0x8511, + 'REFLECTION_MAP_ARB': 0x8512, + 'TEXTURE_CUBE_MAP_ARB': 0x8513, + 'TEXTURE_BINDING_CUBE_MAP_ARB': 0x8514, + 'TEXTURE_CUBE_MAP_POSITIVE_X_ARB': 0x8515, + 'TEXTURE_CUBE_MAP_NEGATIVE_X_ARB': 0x8516, + 'TEXTURE_CUBE_MAP_POSITIVE_Y_ARB': 0x8517, + 'TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB': 0x8518, + 'TEXTURE_CUBE_MAP_POSITIVE_Z_ARB': 0x8519, + 'TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB': 0x851A, + 'PROXY_TEXTURE_CUBE_MAP_ARB': 0x851B, + 'MAX_CUBE_MAP_TEXTURE_SIZE_ARB': 0x851C, + 'SUBTRACT_ARB': 0x84E7, + 'COMBINE_ARB': 0x8570, + 'COMBINE_RGB_ARB': 0x8571, + 'COMBINE_ALPHA_ARB': 0x8572, + 'RGB_SCALE_ARB': 0x8573, + 'ADD_SIGNED_ARB': 0x8574, + 'INTERPOLATE_ARB': 0x8575, + 'CONSTANT_ARB': 0x8576, + 'PRIMARY_COLOR_ARB': 0x8577, + 'PREVIOUS_ARB': 0x8578, + 'SOURCE0_RGB_ARB': 0x8580, + 'SOURCE1_RGB_ARB': 0x8581, + 'SOURCE2_RGB_ARB': 0x8582, + 'SOURCE0_ALPHA_ARB': 0x8588, + 'SOURCE1_ALPHA_ARB': 0x8589, + 'SOURCE2_ALPHA_ARB': 0x858A, + 'OPERAND0_RGB_ARB': 0x8590, + 'OPERAND1_RGB_ARB': 0x8591, + 'OPERAND2_RGB_ARB': 0x8592, + 'OPERAND0_ALPHA_ARB': 0x8598, + 'OPERAND1_ALPHA_ARB': 0x8599, + 'OPERAND2_ALPHA_ARB': 0x859A, + 'DOT3_RGB_ARB': 0x86AE, + 'DOT3_RGBA_ARB': 0x86AF, + 'RGBA32F_ARB': 0x8814, + 'RGB32F_ARB': 0x8815, + 'ALPHA32F_ARB': 0x8816, + 'INTENSITY32F_ARB': 0x8817, + 'LUMINANCE32F_ARB': 0x8818, + 'LUMINANCE_ALPHA32F_ARB': 0x8819, + 'RGBA16F_ARB': 0x881A, + 'RGB16F_ARB': 0x881B, + 'ALPHA16F_ARB': 0x881C, + 'INTENSITY16F_ARB': 0x881D, + 'LUMINANCE16F_ARB': 0x881E, + 'LUMINANCE_ALPHA16F_ARB': 0x881F, + 'TEXTURE_RED_TYPE_ARB': 0x8C10, + 'TEXTURE_GREEN_TYPE_ARB': 0x8C11, + 'TEXTURE_BLUE_TYPE_ARB': 0x8C12, + 'TEXTURE_ALPHA_TYPE_ARB': 0x8C13, + 'TEXTURE_LUMINANCE_TYPE_ARB': 0x8C14, + 'TEXTURE_INTENSITY_TYPE_ARB': 0x8C15, + 'TEXTURE_DEPTH_TYPE_ARB': 0x8C16, + 'UNSIGNED_NORMALIZED_ARB': 0x8C17, + 'MIRRORED_REPEAT_ARB': 0x8370, + 'TEXTURE_RECTANGLE_ARB': 0x84F5, + 'TEXTURE_BINDING_RECTANGLE_ARB': 0x84F6, + 'PROXY_TEXTURE_RECTANGLE_ARB': 0x84F7, + 'MAX_RECTANGLE_TEXTURE_SIZE_ARB': 0x84F8, + 'SAMPLER_2D_RECT_ARB': 0x8B63, + 'SAMPLER_2D_RECT_SHADOW_ARB': 0x8B64, + 'RED': 0x1903, + 'RG': 0x8227, + 'RG_INTEGER': 0x8228, + 'R8': 0x8229, + 'R16': 0x822A, + 'RG8': 0x822B, + 'RG16': 0x822C, + 'R16F': 0x822D, + 'R32F': 0x822E, + 'RG16F': 0x822F, + 'RG32F': 0x8230, + 'R8I': 0x8231, + 'R8UI': 0x8232, + 'R16I': 0x8233, + 'R16UI': 0x8234, + 'R32I': 0x8235, + 'R32UI': 0x8236, + 'RG8I': 0x8237, + 'RG8UI': 0x8238, + 'RG16I': 0x8239, + 'RG16UI': 0x823A, + 'RG32I': 0x823B, + 'RG32UI': 0x823C, + 'TRANSPOSE_MODELVIEW_MATRIX_ARB': 0x84E3, + 'TRANSPOSE_PROJECTION_MATRIX_ARB': 0x84E4, + 'TRANSPOSE_TEXTURE_MATRIX_ARB': 0x84E5, + 'TRANSPOSE_COLOR_MATRIX_ARB': 0x84E6, + 'VERTEX_ARRAY_BINDING': 0x85B5, + 'MODELVIEW0_ARB': 0x1700, + 'MODELVIEW1_ARB': 0x850A, + 'MAX_VERTEX_UNITS_ARB': 0x86A4, + 'ACTIVE_VERTEX_UNITS_ARB': 0x86A5, + 'WEIGHT_SUM_UNITY_ARB': 0x86A6, + 'VERTEX_BLEND_ARB': 0x86A7, + 'CURRENT_WEIGHT_ARB': 0x86A8, + 'WEIGHT_ARRAY_TYPE_ARB': 0x86A9, + 'WEIGHT_ARRAY_STRIDE_ARB': 0x86AA, + 'WEIGHT_ARRAY_SIZE_ARB': 0x86AB, + 'WEIGHT_ARRAY_POINTER_ARB': 0x86AC, + 'WEIGHT_ARRAY_ARB': 0x86AD, + 'MODELVIEW2_ARB': 0x8722, + 'MODELVIEW3_ARB': 0x8723, + 'MODELVIEW4_ARB': 0x8724, + 'MODELVIEW5_ARB': 0x8725, + 'MODELVIEW6_ARB': 0x8726, + 'MODELVIEW7_ARB': 0x8727, + 'MODELVIEW8_ARB': 0x8728, + 'MODELVIEW9_ARB': 0x8729, + 'MODELVIEW10_ARB': 0x872A, + 'MODELVIEW11_ARB': 0x872B, + 'MODELVIEW12_ARB': 0x872C, + 'MODELVIEW13_ARB': 0x872D, + 'MODELVIEW14_ARB': 0x872E, + 'MODELVIEW15_ARB': 0x872F, + 'MODELVIEW16_ARB': 0x8730, + 'MODELVIEW17_ARB': 0x8731, + 'MODELVIEW18_ARB': 0x8732, + 'MODELVIEW19_ARB': 0x8733, + 'MODELVIEW20_ARB': 0x8734, + 'MODELVIEW21_ARB': 0x8735, + 'MODELVIEW22_ARB': 0x8736, + 'MODELVIEW23_ARB': 0x8737, + 'MODELVIEW24_ARB': 0x8738, + 'MODELVIEW25_ARB': 0x8739, + 'MODELVIEW26_ARB': 0x873A, + 'MODELVIEW27_ARB': 0x873B, + 'MODELVIEW28_ARB': 0x873C, + 'MODELVIEW29_ARB': 0x873D, + 'MODELVIEW30_ARB': 0x873E, + 'MODELVIEW31_ARB': 0x873F, + 'BUFFER_SIZE_ARB': 0x8764, + 'BUFFER_USAGE_ARB': 0x8765, + 'ARRAY_BUFFER_ARB': 0x8892, + 'ELEMENT_ARRAY_BUFFER_ARB': 0x8893, + 'ARRAY_BUFFER_BINDING_ARB': 0x8894, + 'ELEMENT_ARRAY_BUFFER_BINDING_ARB': 0x8895, + 'VERTEX_ARRAY_BUFFER_BINDING_ARB': 0x8896, + 'NORMAL_ARRAY_BUFFER_BINDING_ARB': 0x8897, + 'COLOR_ARRAY_BUFFER_BINDING_ARB': 0x8898, + 'INDEX_ARRAY_BUFFER_BINDING_ARB': 0x8899, + 'TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB': 0x889A, + 'EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB': 0x889B, + 'SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB': 0x889C, + 'FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB': 0x889D, + 'WEIGHT_ARRAY_BUFFER_BINDING_ARB': 0x889E, + 'VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB': 0x889F, + 'READ_ONLY_ARB': 0x88B8, + 'WRITE_ONLY_ARB': 0x88B9, + 'READ_WRITE_ARB': 0x88BA, + 'BUFFER_ACCESS_ARB': 0x88BB, + 'BUFFER_MAPPED_ARB': 0x88BC, + 'BUFFER_MAP_POINTER_ARB': 0x88BD, + 'STREAM_DRAW_ARB': 0x88E0, + 'STREAM_READ_ARB': 0x88E1, + 'STREAM_COPY_ARB': 0x88E2, + 'STATIC_DRAW_ARB': 0x88E4, + 'STATIC_READ_ARB': 0x88E5, + 'STATIC_COPY_ARB': 0x88E6, + 'DYNAMIC_DRAW_ARB': 0x88E8, + 'DYNAMIC_READ_ARB': 0x88E9, + 'DYNAMIC_COPY_ARB': 0x88EA, + 'COLOR_SUM_ARB': 0x8458, + 'VERTEX_PROGRAM_ARB': 0x8620, + 'VERTEX_ATTRIB_ARRAY_ENABLED_ARB': 0x8622, + 'VERTEX_ATTRIB_ARRAY_SIZE_ARB': 0x8623, + 'VERTEX_ATTRIB_ARRAY_STRIDE_ARB': 0x8624, + 'VERTEX_ATTRIB_ARRAY_TYPE_ARB': 0x8625, + 'CURRENT_VERTEX_ATTRIB_ARB': 0x8626, + 'PROGRAM_LENGTH_ARB': 0x8627, + 'PROGRAM_STRING_ARB': 0x8628, + 'MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB': 0x862E, + 'MAX_PROGRAM_MATRICES_ARB': 0x862F, + 'CURRENT_MATRIX_STACK_DEPTH_ARB': 0x8640, + 'CURRENT_MATRIX_ARB': 0x8641, + 'VERTEX_PROGRAM_POINT_SIZE_ARB': 0x8642, + 'VERTEX_PROGRAM_TWO_SIDE_ARB': 0x8643, + 'VERTEX_ATTRIB_ARRAY_POINTER_ARB': 0x8645, + 'PROGRAM_ERROR_POSITION_ARB': 0x864B, + 'PROGRAM_BINDING_ARB': 0x8677, + 'MAX_VERTEX_ATTRIBS_ARB': 0x8869, + 'VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB': 0x886A, + 'PROGRAM_ERROR_STRING_ARB': 0x8874, + 'PROGRAM_FORMAT_ASCII_ARB': 0x8875, + 'PROGRAM_FORMAT_ARB': 0x8876, + 'PROGRAM_INSTRUCTIONS_ARB': 0x88A0, + 'MAX_PROGRAM_INSTRUCTIONS_ARB': 0x88A1, + 'PROGRAM_NATIVE_INSTRUCTIONS_ARB': 0x88A2, + 'MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB': 0x88A3, + 'PROGRAM_TEMPORARIES_ARB': 0x88A4, + 'MAX_PROGRAM_TEMPORARIES_ARB': 0x88A5, + 'PROGRAM_NATIVE_TEMPORARIES_ARB': 0x88A6, + 'MAX_PROGRAM_NATIVE_TEMPORARIES_ARB': 0x88A7, + 'PROGRAM_PARAMETERS_ARB': 0x88A8, + 'MAX_PROGRAM_PARAMETERS_ARB': 0x88A9, + 'PROGRAM_NATIVE_PARAMETERS_ARB': 0x88AA, + 'MAX_PROGRAM_NATIVE_PARAMETERS_ARB': 0x88AB, + 'PROGRAM_ATTRIBS_ARB': 0x88AC, + 'MAX_PROGRAM_ATTRIBS_ARB': 0x88AD, + 'PROGRAM_NATIVE_ATTRIBS_ARB': 0x88AE, + 'MAX_PROGRAM_NATIVE_ATTRIBS_ARB': 0x88AF, + 'PROGRAM_ADDRESS_REGISTERS_ARB': 0x88B0, + 'MAX_PROGRAM_ADDRESS_REGISTERS_ARB': 0x88B1, + 'PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB': 0x88B2, + 'MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB': 0x88B3, + 'MAX_PROGRAM_LOCAL_PARAMETERS_ARB': 0x88B4, + 'MAX_PROGRAM_ENV_PARAMETERS_ARB': 0x88B5, + 'PROGRAM_UNDER_NATIVE_LIMITS_ARB': 0x88B6, + 'TRANSPOSE_CURRENT_MATRIX_ARB': 0x88B7, + 'MATRIX0_ARB': 0x88C0, + 'MATRIX1_ARB': 0x88C1, + 'MATRIX2_ARB': 0x88C2, + 'MATRIX3_ARB': 0x88C3, + 'MATRIX4_ARB': 0x88C4, + 'MATRIX5_ARB': 0x88C5, + 'MATRIX6_ARB': 0x88C6, + 'MATRIX7_ARB': 0x88C7, + 'MATRIX8_ARB': 0x88C8, + 'MATRIX9_ARB': 0x88C9, + 'MATRIX10_ARB': 0x88CA, + 'MATRIX11_ARB': 0x88CB, + 'MATRIX12_ARB': 0x88CC, + 'MATRIX13_ARB': 0x88CD, + 'MATRIX14_ARB': 0x88CE, + 'MATRIX15_ARB': 0x88CF, + 'MATRIX16_ARB': 0x88D0, + 'MATRIX17_ARB': 0x88D1, + 'MATRIX18_ARB': 0x88D2, + 'MATRIX19_ARB': 0x88D3, + 'MATRIX20_ARB': 0x88D4, + 'MATRIX21_ARB': 0x88D5, + 'MATRIX22_ARB': 0x88D6, + 'MATRIX23_ARB': 0x88D7, + 'MATRIX24_ARB': 0x88D8, + 'MATRIX25_ARB': 0x88D9, + 'MATRIX26_ARB': 0x88DA, + 'MATRIX27_ARB': 0x88DB, + 'MATRIX28_ARB': 0x88DC, + 'MATRIX29_ARB': 0x88DD, + 'MATRIX30_ARB': 0x88DE, + 'MATRIX31_ARB': 0x88DF, + 'VERTEX_SHADER_ARB': 0x8B31, + 'MAX_VERTEX_UNIFORM_COMPONENTS_ARB': 0x8B4A, + 'MAX_VARYING_FLOATS_ARB': 0x8B4B, + 'MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB': 0x8B4C, + 'MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB': 0x8B4D, + 'OBJECT_ACTIVE_ATTRIBUTES_ARB': 0x8B89, + 'OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB': 0x8B8A, + 'TEXTURE_POINT_MODE_ATIX': 0x60B0, + 'TEXTURE_POINT_ONE_COORD_ATIX': 0x60B1, + 'TEXTURE_POINT_SPRITE_ATIX': 0x60B2, + 'POINT_SPRITE_CULL_MODE_ATIX': 0x60B3, + 'POINT_SPRITE_CULL_CENTER_ATIX': 0x60B4, + 'POINT_SPRITE_CULL_CLIP_ATIX': 0x60B5, + 'MODULATE_ADD_ATIX': 0x8744, + 'MODULATE_SIGNED_ADD_ATIX': 0x8745, + 'MODULATE_SUBTRACT_ATIX': 0x8746, + 'SECONDARY_COLOR_ATIX': 0x8747, + 'TEXTURE_OUTPUT_RGB_ATIX': 0x8748, + 'TEXTURE_OUTPUT_ALPHA_ATIX': 0x8749, + 'OUTPUT_POINT_SIZE_ATIX': 0x610E, + 'MAX_DRAW_BUFFERS_ATI': 0x8824, + 'DRAW_BUFFER0_ATI': 0x8825, + 'DRAW_BUFFER1_ATI': 0x8826, + 'DRAW_BUFFER2_ATI': 0x8827, + 'DRAW_BUFFER3_ATI': 0x8828, + 'DRAW_BUFFER4_ATI': 0x8829, + 'DRAW_BUFFER5_ATI': 0x882A, + 'DRAW_BUFFER6_ATI': 0x882B, + 'DRAW_BUFFER7_ATI': 0x882C, + 'DRAW_BUFFER8_ATI': 0x882D, + 'DRAW_BUFFER9_ATI': 0x882E, + 'DRAW_BUFFER10_ATI': 0x882F, + 'DRAW_BUFFER11_ATI': 0x8830, + 'DRAW_BUFFER12_ATI': 0x8831, + 'DRAW_BUFFER13_ATI': 0x8832, + 'DRAW_BUFFER14_ATI': 0x8833, + 'DRAW_BUFFER15_ATI': 0x8834, + 'ELEMENT_ARRAY_ATI': 0x8768, + 'ELEMENT_ARRAY_TYPE_ATI': 0x8769, + 'ELEMENT_ARRAY_POINTER_ATI': 0x876A, + 'BUMP_ROT_MATRIX_ATI': 0x8775, + 'BUMP_ROT_MATRIX_SIZE_ATI': 0x8776, + 'BUMP_NUM_TEX_UNITS_ATI': 0x8777, + 'BUMP_TEX_UNITS_ATI': 0x8778, + 'DUDV_ATI': 0x8779, + 'DU8DV8_ATI': 0x877A, + 'BUMP_ENVMAP_ATI': 0x877B, + 'BUMP_TARGET_ATI': 0x877C, + 'RED_BIT_ATI': 0x00000001, + '2X_BIT_ATI': 0x00000001, + '4X_BIT_ATI': 0x00000002, + 'GREEN_BIT_ATI': 0x00000002, + 'COMP_BIT_ATI': 0x00000002, + 'BLUE_BIT_ATI': 0x00000004, + '8X_BIT_ATI': 0x00000004, + 'NEGATE_BIT_ATI': 0x00000004, + 'BIAS_BIT_ATI': 0x00000008, + 'HALF_BIT_ATI': 0x00000008, + 'QUARTER_BIT_ATI': 0x00000010, + 'EIGHTH_BIT_ATI': 0x00000020, + 'SATURATE_BIT_ATI': 0x00000040, + 'FRAGMENT_SHADER_ATI': 0x8920, + 'REG_0_ATI': 0x8921, + 'REG_1_ATI': 0x8922, + 'REG_2_ATI': 0x8923, + 'REG_3_ATI': 0x8924, + 'REG_4_ATI': 0x8925, + 'REG_5_ATI': 0x8926, + 'CON_0_ATI': 0x8941, + 'CON_1_ATI': 0x8942, + 'CON_2_ATI': 0x8943, + 'CON_3_ATI': 0x8944, + 'CON_4_ATI': 0x8945, + 'CON_5_ATI': 0x8946, + 'CON_6_ATI': 0x8947, + 'CON_7_ATI': 0x8948, + 'MOV_ATI': 0x8961, + 'ADD_ATI': 0x8963, + 'MUL_ATI': 0x8964, + 'SUB_ATI': 0x8965, + 'DOT3_ATI': 0x8966, + 'DOT4_ATI': 0x8967, + 'MAD_ATI': 0x8968, + 'LERP_ATI': 0x8969, + 'CND_ATI': 0x896A, + 'CND0_ATI': 0x896B, + 'DOT2_ADD_ATI': 0x896C, + 'SECONDARY_INTERPOLATOR_ATI': 0x896D, + 'NUM_FRAGMENT_REGISTERS_ATI': 0x896E, + 'NUM_FRAGMENT_CONSTANTS_ATI': 0x896F, + 'NUM_PASSES_ATI': 0x8970, + 'NUM_INSTRUCTIONS_PER_PASS_ATI': 0x8971, + 'NUM_INSTRUCTIONS_TOTAL_ATI': 0x8972, + 'NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI': 0x8973, + 'NUM_LOOPBACK_COMPONENTS_ATI': 0x8974, + 'COLOR_ALPHA_PAIRING_ATI': 0x8975, + 'SWIZZLE_STR_ATI': 0x8976, + 'SWIZZLE_STQ_ATI': 0x8977, + 'SWIZZLE_STR_DR_ATI': 0x8978, + 'SWIZZLE_STQ_DQ_ATI': 0x8979, + 'SWIZZLE_STRQ_ATI': 0x897A, + 'SWIZZLE_STRQ_DQ_ATI': 0x897B, + 'PN_TRIANGLES_ATI': 0x87F0, + 'MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI': 0x87F1, + 'PN_TRIANGLES_POINT_MODE_ATI': 0x87F2, + 'PN_TRIANGLES_NORMAL_MODE_ATI': 0x87F3, + 'PN_TRIANGLES_TESSELATION_LEVEL_ATI': 0x87F4, + 'PN_TRIANGLES_POINT_MODE_LINEAR_ATI': 0x87F5, + 'PN_TRIANGLES_POINT_MODE_CUBIC_ATI': 0x87F6, + 'PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI': 0x87F7, + 'PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI': 0x87F8, + 'STENCIL_BACK_FUNC_ATI': 0x8800, + 'STENCIL_BACK_FAIL_ATI': 0x8801, + 'STENCIL_BACK_PASS_DEPTH_FAIL_ATI': 0x8802, + 'STENCIL_BACK_PASS_DEPTH_PASS_ATI': 0x8803, + 'TEXT_FRAGMENT_SHADER_ATI': 0x8200, + 'COMPRESSED_LUMINANCE_ALPHA_3DC_ATI': 0x8837, + 'MODULATE_ADD_ATI': 0x8744, + 'MODULATE_SIGNED_ADD_ATI': 0x8745, + 'MODULATE_SUBTRACT_ATI': 0x8746, + 'RGBA_FLOAT32_ATI': 0x8814, + 'RGB_FLOAT32_ATI': 0x8815, + 'ALPHA_FLOAT32_ATI': 0x8816, + 'INTENSITY_FLOAT32_ATI': 0x8817, + 'LUMINANCE_FLOAT32_ATI': 0x8818, + 'LUMINANCE_ALPHA_FLOAT32_ATI': 0x8819, + 'RGBA_FLOAT16_ATI': 0x881A, + 'RGB_FLOAT16_ATI': 0x881B, + 'ALPHA_FLOAT16_ATI': 0x881C, + 'INTENSITY_FLOAT16_ATI': 0x881D, + 'LUMINANCE_FLOAT16_ATI': 0x881E, + 'LUMINANCE_ALPHA_FLOAT16_ATI': 0x881F, + 'MIRROR_CLAMP_ATI': 0x8742, + 'MIRROR_CLAMP_TO_EDGE_ATI': 0x8743, + 'STATIC_ATI': 0x8760, + 'DYNAMIC_ATI': 0x8761, + 'PRESERVE_ATI': 0x8762, + 'DISCARD_ATI': 0x8763, + 'OBJECT_BUFFER_SIZE_ATI': 0x8764, + 'OBJECT_BUFFER_USAGE_ATI': 0x8765, + 'ARRAY_OBJECT_BUFFER_ATI': 0x8766, + 'ARRAY_OBJECT_OFFSET_ATI': 0x8767, + 'MAX_VERTEX_STREAMS_ATI': 0x876B, + 'VERTEX_SOURCE_ATI': 0x876C, + 'VERTEX_STREAM0_ATI': 0x876D, + 'VERTEX_STREAM1_ATI': 0x876E, + 'VERTEX_STREAM2_ATI': 0x876F, + 'VERTEX_STREAM3_ATI': 0x8770, + 'VERTEX_STREAM4_ATI': 0x8771, + 'VERTEX_STREAM5_ATI': 0x8772, + 'VERTEX_STREAM6_ATI': 0x8773, + 'VERTEX_STREAM7_ATI': 0x8774, + '422_EXT': 0x80CC, + '422_REV_EXT': 0x80CD, + '422_AVERAGE_EXT': 0x80CE, + '422_REV_AVERAGE_EXT': 0x80CF, + 'CG_VERTEX_SHADER_EXT': 0x890E, + 'CG_FRAGMENT_SHADER_EXT': 0x890F, + 'ABGR_EXT': 0x8000, + 'BGR_EXT': 0x80E0, + 'BGRA_EXT': 0x80E1, + 'MAX_VERTEX_BINDABLE_UNIFORMS_EXT': 0x8DE2, + 'MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT': 0x8DE3, + 'MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT': 0x8DE4, + 'MAX_BINDABLE_UNIFORM_SIZE_EXT': 0x8DED, + 'UNIFORM_BUFFER_EXT': 0x8DEE, + 'UNIFORM_BUFFER_BINDING_EXT': 0x8DEF, + 'CONSTANT_COLOR_EXT': 0x8001, + 'ONE_MINUS_CONSTANT_COLOR_EXT': 0x8002, + 'CONSTANT_ALPHA_EXT': 0x8003, + 'ONE_MINUS_CONSTANT_ALPHA_EXT': 0x8004, + 'BLEND_COLOR_EXT': 0x8005, + 'BLEND_EQUATION_RGB_EXT': 0x8009, + 'BLEND_EQUATION_ALPHA_EXT': 0x883D, + 'BLEND_DST_RGB_EXT': 0x80C8, + 'BLEND_SRC_RGB_EXT': 0x80C9, + 'BLEND_DST_ALPHA_EXT': 0x80CA, + 'BLEND_SRC_ALPHA_EXT': 0x80CB, + 'FUNC_ADD_EXT': 0x8006, + 'MIN_EXT': 0x8007, + 'MAX_EXT': 0x8008, + 'BLEND_EQUATION_EXT': 0x8009, + 'FUNC_SUBTRACT_EXT': 0x800A, + 'FUNC_REVERSE_SUBTRACT_EXT': 0x800B, + 'CLIP_VOLUME_CLIPPING_HINT_EXT': 0x80F0, + 'CMYK_EXT': 0x800C, + 'CMYKA_EXT': 0x800D, + 'PACK_CMYK_HINT_EXT': 0x800E, + 'UNPACK_CMYK_HINT_EXT': 0x800F, + 'ARRAY_ELEMENT_LOCK_FIRST_EXT': 0x81A8, + 'ARRAY_ELEMENT_LOCK_COUNT_EXT': 0x81A9, + 'CONVOLUTION_1D_EXT': 0x8010, + 'CONVOLUTION_2D_EXT': 0x8011, + 'SEPARABLE_2D_EXT': 0x8012, + 'CONVOLUTION_BORDER_MODE_EXT': 0x8013, + 'CONVOLUTION_FILTER_SCALE_EXT': 0x8014, + 'CONVOLUTION_FILTER_BIAS_EXT': 0x8015, + 'REDUCE_EXT': 0x8016, + 'CONVOLUTION_FORMAT_EXT': 0x8017, + 'CONVOLUTION_WIDTH_EXT': 0x8018, + 'CONVOLUTION_HEIGHT_EXT': 0x8019, + 'MAX_CONVOLUTION_WIDTH_EXT': 0x801A, + 'MAX_CONVOLUTION_HEIGHT_EXT': 0x801B, + 'POST_CONVOLUTION_RED_SCALE_EXT': 0x801C, + 'POST_CONVOLUTION_GREEN_SCALE_EXT': 0x801D, + 'POST_CONVOLUTION_BLUE_SCALE_EXT': 0x801E, + 'POST_CONVOLUTION_ALPHA_SCALE_EXT': 0x801F, + 'POST_CONVOLUTION_RED_BIAS_EXT': 0x8020, + 'POST_CONVOLUTION_GREEN_BIAS_EXT': 0x8021, + 'POST_CONVOLUTION_BLUE_BIAS_EXT': 0x8022, + 'POST_CONVOLUTION_ALPHA_BIAS_EXT': 0x8023, + 'TANGENT_ARRAY_EXT': 0x8439, + 'BINORMAL_ARRAY_EXT': 0x843A, + 'CURRENT_TANGENT_EXT': 0x843B, + 'CURRENT_BINORMAL_EXT': 0x843C, + 'TANGENT_ARRAY_TYPE_EXT': 0x843E, + 'TANGENT_ARRAY_STRIDE_EXT': 0x843F, + 'BINORMAL_ARRAY_TYPE_EXT': 0x8440, + 'BINORMAL_ARRAY_STRIDE_EXT': 0x8441, + 'TANGENT_ARRAY_POINTER_EXT': 0x8442, + 'BINORMAL_ARRAY_POINTER_EXT': 0x8443, + 'MAP1_TANGENT_EXT': 0x8444, + 'MAP2_TANGENT_EXT': 0x8445, + 'MAP1_BINORMAL_EXT': 0x8446, + 'MAP2_BINORMAL_EXT': 0x8447, + 'DEPTH_BOUNDS_TEST_EXT': 0x8890, + 'DEPTH_BOUNDS_EXT': 0x8891, + 'PROGRAM_MATRIX_EXT': 0x8E2D, + 'TRANSPOSE_PROGRAM_MATRIX_EXT': 0x8E2E, + 'PROGRAM_MATRIX_STACK_DEPTH_EXT': 0x8E2F, + 'MAX_ELEMENTS_VERTICES': 0x80E8, + 'MAX_ELEMENTS_INDICES': 0x80E9, + 'FOG_COORDINATE_SOURCE_EXT': 0x8450, + 'FOG_COORDINATE_EXT': 0x8451, + 'FRAGMENT_DEPTH_EXT': 0x8452, + 'CURRENT_FOG_COORDINATE_EXT': 0x8453, + 'FOG_COORDINATE_ARRAY_TYPE_EXT': 0x8454, + 'FOG_COORDINATE_ARRAY_STRIDE_EXT': 0x8455, + 'FOG_COORDINATE_ARRAY_POINTER_EXT': 0x8456, + 'FOG_COORDINATE_ARRAY_EXT': 0x8457, + 'FRAGMENT_LIGHTING_EXT': 0x8400, + 'FRAGMENT_COLOR_MATERIAL_EXT': 0x8401, + 'FRAGMENT_COLOR_MATERIAL_FACE_EXT': 0x8402, + 'FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT': 0x8403, + 'MAX_FRAGMENT_LIGHTS_EXT': 0x8404, + 'MAX_ACTIVE_LIGHTS_EXT': 0x8405, + 'CURRENT_RASTER_NORMAL_EXT': 0x8406, + 'LIGHT_ENV_MODE_EXT': 0x8407, + 'FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT': 0x8408, + 'FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT': 0x8409, + 'FRAGMENT_LIGHT_MODEL_AMBIENT_EXT': 0x840A, + 'FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT': 0x840B, + 'FRAGMENT_LIGHT0_EXT': 0x840C, + 'FRAGMENT_LIGHT7_EXT': 0x8413, + 'DRAW_FRAMEBUFFER_BINDING_EXT': 0x8CA6, + 'READ_FRAMEBUFFER_EXT': 0x8CA8, + 'DRAW_FRAMEBUFFER_EXT': 0x8CA9, + 'READ_FRAMEBUFFER_BINDING_EXT': 0x8CAA, + 'RENDERBUFFER_SAMPLES_EXT': 0x8CAB, + 'FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT': 0x8D56, + 'MAX_SAMPLES_EXT': 0x8D57, + 'INVALID_FRAMEBUFFER_OPERATION_EXT': 0x0506, + 'MAX_RENDERBUFFER_SIZE_EXT': 0x84E8, + 'FRAMEBUFFER_BINDING_EXT': 0x8CA6, + 'RENDERBUFFER_BINDING_EXT': 0x8CA7, + 'FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT': 0x8CD0, + 'FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT': 0x8CD1, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT': 0x8CD2, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT': 0x8CD3, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT': 0x8CD4, + 'FRAMEBUFFER_COMPLETE_EXT': 0x8CD5, + 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT': 0x8CD6, + 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT': 0x8CD7, + 'FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT': 0x8CD9, + 'FRAMEBUFFER_INCOMPLETE_FORMATS_EXT': 0x8CDA, + 'FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT': 0x8CDB, + 'FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT': 0x8CDC, + 'FRAMEBUFFER_UNSUPPORTED_EXT': 0x8CDD, + 'MAX_COLOR_ATTACHMENTS_EXT': 0x8CDF, + 'COLOR_ATTACHMENT0_EXT': 0x8CE0, + 'COLOR_ATTACHMENT1_EXT': 0x8CE1, + 'COLOR_ATTACHMENT2_EXT': 0x8CE2, + 'COLOR_ATTACHMENT3_EXT': 0x8CE3, + 'COLOR_ATTACHMENT4_EXT': 0x8CE4, + 'COLOR_ATTACHMENT5_EXT': 0x8CE5, + 'COLOR_ATTACHMENT6_EXT': 0x8CE6, + 'COLOR_ATTACHMENT7_EXT': 0x8CE7, + 'COLOR_ATTACHMENT8_EXT': 0x8CE8, + 'COLOR_ATTACHMENT9_EXT': 0x8CE9, + 'COLOR_ATTACHMENT10_EXT': 0x8CEA, + 'COLOR_ATTACHMENT11_EXT': 0x8CEB, + 'COLOR_ATTACHMENT12_EXT': 0x8CEC, + 'COLOR_ATTACHMENT13_EXT': 0x8CED, + 'COLOR_ATTACHMENT14_EXT': 0x8CEE, + 'COLOR_ATTACHMENT15_EXT': 0x8CEF, + 'DEPTH_ATTACHMENT_EXT': 0x8D00, + 'STENCIL_ATTACHMENT_EXT': 0x8D20, + 'FRAMEBUFFER_EXT': 0x8D40, + 'RENDERBUFFER_EXT': 0x8D41, + 'RENDERBUFFER_WIDTH_EXT': 0x8D42, + 'RENDERBUFFER_HEIGHT_EXT': 0x8D43, + 'RENDERBUFFER_INTERNAL_FORMAT_EXT': 0x8D44, + 'STENCIL_INDEX1_EXT': 0x8D46, + 'STENCIL_INDEX4_EXT': 0x8D47, + 'STENCIL_INDEX8_EXT': 0x8D48, + 'STENCIL_INDEX16_EXT': 0x8D49, + 'RENDERBUFFER_RED_SIZE_EXT': 0x8D50, + 'RENDERBUFFER_GREEN_SIZE_EXT': 0x8D51, + 'RENDERBUFFER_BLUE_SIZE_EXT': 0x8D52, + 'RENDERBUFFER_ALPHA_SIZE_EXT': 0x8D53, + 'RENDERBUFFER_DEPTH_SIZE_EXT': 0x8D54, + 'RENDERBUFFER_STENCIL_SIZE_EXT': 0x8D55, + 'FRAMEBUFFER_SRGB_EXT': 0x8DB9, + 'FRAMEBUFFER_SRGB_CAPABLE_EXT': 0x8DBA, + 'LINES_ADJACENCY_EXT': 0xA, + 'LINE_STRIP_ADJACENCY_EXT': 0xB, + 'TRIANGLES_ADJACENCY_EXT': 0xC, + 'TRIANGLE_STRIP_ADJACENCY_EXT': 0xD, + 'PROGRAM_POINT_SIZE_EXT': 0x8642, + 'MAX_VARYING_COMPONENTS_EXT': 0x8B4B, + 'MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT': 0x8C29, + 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT': 0x8CD4, + 'FRAMEBUFFER_ATTACHMENT_LAYERED_EXT': 0x8DA7, + 'FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT': 0x8DA8, + 'FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT': 0x8DA9, + 'GEOMETRY_SHADER_EXT': 0x8DD9, + 'GEOMETRY_VERTICES_OUT_EXT': 0x8DDA, + 'GEOMETRY_INPUT_TYPE_EXT': 0x8DDB, + 'GEOMETRY_OUTPUT_TYPE_EXT': 0x8DDC, + 'MAX_GEOMETRY_VARYING_COMPONENTS_EXT': 0x8DDD, + 'MAX_VERTEX_VARYING_COMPONENTS_EXT': 0x8DDE, + 'MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT': 0x8DDF, + 'MAX_GEOMETRY_OUTPUT_VERTICES_EXT': 0x8DE0, + 'MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT': 0x8DE1, + 'VERTEX_ATTRIB_ARRAY_INTEGER_EXT': 0x88FD, + 'SAMPLER_1D_ARRAY_EXT': 0x8DC0, + 'SAMPLER_2D_ARRAY_EXT': 0x8DC1, + 'SAMPLER_BUFFER_EXT': 0x8DC2, + 'SAMPLER_1D_ARRAY_SHADOW_EXT': 0x8DC3, + 'SAMPLER_2D_ARRAY_SHADOW_EXT': 0x8DC4, + 'SAMPLER_CUBE_SHADOW_EXT': 0x8DC5, + 'UNSIGNED_INT_VEC2_EXT': 0x8DC6, + 'UNSIGNED_INT_VEC3_EXT': 0x8DC7, + 'UNSIGNED_INT_VEC4_EXT': 0x8DC8, + 'INT_SAMPLER_1D_EXT': 0x8DC9, + 'INT_SAMPLER_2D_EXT': 0x8DCA, + 'INT_SAMPLER_3D_EXT': 0x8DCB, + 'INT_SAMPLER_CUBE_EXT': 0x8DCC, + 'INT_SAMPLER_2D_RECT_EXT': 0x8DCD, + 'INT_SAMPLER_1D_ARRAY_EXT': 0x8DCE, + 'INT_SAMPLER_2D_ARRAY_EXT': 0x8DCF, + 'INT_SAMPLER_BUFFER_EXT': 0x8DD0, + 'UNSIGNED_INT_SAMPLER_1D_EXT': 0x8DD1, + 'UNSIGNED_INT_SAMPLER_2D_EXT': 0x8DD2, + 'UNSIGNED_INT_SAMPLER_3D_EXT': 0x8DD3, + 'UNSIGNED_INT_SAMPLER_CUBE_EXT': 0x8DD4, + 'UNSIGNED_INT_SAMPLER_2D_RECT_EXT': 0x8DD5, + 'UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT': 0x8DD6, + 'UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT': 0x8DD7, + 'UNSIGNED_INT_SAMPLER_BUFFER_EXT': 0x8DD8, + 'HISTOGRAM_EXT': 0x8024, + 'PROXY_HISTOGRAM_EXT': 0x8025, + 'HISTOGRAM_WIDTH_EXT': 0x8026, + 'HISTOGRAM_FORMAT_EXT': 0x8027, + 'HISTOGRAM_RED_SIZE_EXT': 0x8028, + 'HISTOGRAM_GREEN_SIZE_EXT': 0x8029, + 'HISTOGRAM_BLUE_SIZE_EXT': 0x802A, + 'HISTOGRAM_ALPHA_SIZE_EXT': 0x802B, + 'HISTOGRAM_LUMINANCE_SIZE_EXT': 0x802C, + 'HISTOGRAM_SINK_EXT': 0x802D, + 'MINMAX_EXT': 0x802E, + 'MINMAX_FORMAT_EXT': 0x802F, + 'MINMAX_SINK_EXT': 0x8030, + 'FRAGMENT_MATERIAL_EXT': 0x8349, + 'FRAGMENT_NORMAL_EXT': 0x834A, + 'FRAGMENT_COLOR_EXT': 0x834C, + 'ATTENUATION_EXT': 0x834D, + 'SHADOW_ATTENUATION_EXT': 0x834E, + 'TEXTURE_APPLICATION_MODE_EXT': 0x834F, + 'TEXTURE_LIGHT_EXT': 0x8350, + 'TEXTURE_MATERIAL_FACE_EXT': 0x8351, + 'TEXTURE_MATERIAL_PARAMETER_EXT': 0x8352, + 'FRAGMENT_DEPTH_EXT': 0x8452, + 'MULTISAMPLE_EXT': 0x809D, + 'SAMPLE_ALPHA_TO_MASK_EXT': 0x809E, + 'SAMPLE_ALPHA_TO_ONE_EXT': 0x809F, + 'SAMPLE_MASK_EXT': 0x80A0, + '1PASS_EXT': 0x80A1, + '2PASS_0_EXT': 0x80A2, + '2PASS_1_EXT': 0x80A3, + '4PASS_0_EXT': 0x80A4, + '4PASS_1_EXT': 0x80A5, + '4PASS_2_EXT': 0x80A6, + '4PASS_3_EXT': 0x80A7, + 'SAMPLE_BUFFERS_EXT': 0x80A8, + 'SAMPLES_EXT': 0x80A9, + 'SAMPLE_MASK_VALUE_EXT': 0x80AA, + 'SAMPLE_MASK_INVERT_EXT': 0x80AB, + 'SAMPLE_PATTERN_EXT': 0x80AC, + 'MULTISAMPLE_BIT_EXT': 0x20000000, + 'DEPTH_STENCIL_EXT': 0x84F9, + 'UNSIGNED_INT_24_8_EXT': 0x84FA, + 'DEPTH24_STENCIL8_EXT': 0x88F0, + 'TEXTURE_STENCIL_SIZE_EXT': 0x88F1, + 'R11F_G11F_B10F_EXT': 0x8C3A, + 'UNSIGNED_INT_10F_11F_11F_REV_EXT': 0x8C3B, + 'RGBA_SIGNED_COMPONENTS_EXT': 0x8C3C, + 'UNSIGNED_BYTE_3_3_2_EXT': 0x8032, + 'UNSIGNED_SHORT_4_4_4_4_EXT': 0x8033, + 'UNSIGNED_SHORT_5_5_5_1_EXT': 0x8034, + 'UNSIGNED_INT_8_8_8_8_EXT': 0x8035, + 'UNSIGNED_INT_10_10_10_2_EXT': 0x8036, + 'TEXTURE_1D': 0x0DE0, + 'TEXTURE_2D': 0x0DE1, + 'PROXY_TEXTURE_1D': 0x8063, + 'PROXY_TEXTURE_2D': 0x8064, + 'TEXTURE_3D_EXT': 0x806F, + 'PROXY_TEXTURE_3D_EXT': 0x8070, + 'COLOR_TABLE_FORMAT_EXT': 0x80D8, + 'COLOR_TABLE_WIDTH_EXT': 0x80D9, + 'COLOR_TABLE_RED_SIZE_EXT': 0x80DA, + 'COLOR_TABLE_GREEN_SIZE_EXT': 0x80DB, + 'COLOR_TABLE_BLUE_SIZE_EXT': 0x80DC, + 'COLOR_TABLE_ALPHA_SIZE_EXT': 0x80DD, + 'COLOR_TABLE_LUMINANCE_SIZE_EXT': 0x80DE, + 'COLOR_TABLE_INTENSITY_SIZE_EXT': 0x80DF, + 'COLOR_INDEX1_EXT': 0x80E2, + 'COLOR_INDEX2_EXT': 0x80E3, + 'COLOR_INDEX4_EXT': 0x80E4, + 'COLOR_INDEX8_EXT': 0x80E5, + 'COLOR_INDEX12_EXT': 0x80E6, + 'COLOR_INDEX16_EXT': 0x80E7, + 'TEXTURE_INDEX_SIZE_EXT': 0x80ED, + 'TEXTURE_CUBE_MAP_ARB': 0x8513, + 'PROXY_TEXTURE_CUBE_MAP_ARB': 0x851B, + 'PIXEL_PACK_BUFFER_EXT': 0x88EB, + 'PIXEL_UNPACK_BUFFER_EXT': 0x88EC, + 'PIXEL_PACK_BUFFER_BINDING_EXT': 0x88ED, + 'PIXEL_UNPACK_BUFFER_BINDING_EXT': 0x88EF, + 'PIXEL_TRANSFORM_2D_EXT': 0x8330, + 'PIXEL_MAG_FILTER_EXT': 0x8331, + 'PIXEL_MIN_FILTER_EXT': 0x8332, + 'PIXEL_CUBIC_WEIGHT_EXT': 0x8333, + 'CUBIC_EXT': 0x8334, + 'AVERAGE_EXT': 0x8335, + 'PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT': 0x8336, + 'MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT': 0x8337, + 'PIXEL_TRANSFORM_2D_MATRIX_EXT': 0x8338, + 'POINT_SIZE_MIN_EXT': 0x8126, + 'POINT_SIZE_MAX_EXT': 0x8127, + 'POINT_FADE_THRESHOLD_SIZE_EXT': 0x8128, + 'DISTANCE_ATTENUATION_EXT': 0x8129, + 'POLYGON_OFFSET_EXT': 0x8037, + 'POLYGON_OFFSET_FACTOR_EXT': 0x8038, + 'POLYGON_OFFSET_BIAS_EXT': 0x8039, + 'RESCALE_NORMAL_EXT': 0x803A, + 'COLOR_SUM_EXT': 0x8458, + 'CURRENT_SECONDARY_COLOR_EXT': 0x8459, + 'SECONDARY_COLOR_ARRAY_SIZE_EXT': 0x845A, + 'SECONDARY_COLOR_ARRAY_TYPE_EXT': 0x845B, + 'SECONDARY_COLOR_ARRAY_STRIDE_EXT': 0x845C, + 'SECONDARY_COLOR_ARRAY_POINTER_EXT': 0x845D, + 'SECONDARY_COLOR_ARRAY_EXT': 0x845E, + 'LIGHT_MODEL_COLOR_CONTROL_EXT': 0x81F8, + 'SINGLE_COLOR_EXT': 0x81F9, + 'SEPARATE_SPECULAR_COLOR_EXT': 0x81FA, + 'SHARED_TEXTURE_PALETTE_EXT': 0x81FB, + 'STENCIL_TAG_BITS_EXT': 0x88F2, + 'STENCIL_CLEAR_TAG_VALUE_EXT': 0x88F3, + 'STENCIL_TEST_TWO_SIDE_EXT': 0x8910, + 'ACTIVE_STENCIL_FACE_EXT': 0x8911, + 'INCR_WRAP_EXT': 0x8507, + 'DECR_WRAP_EXT': 0x8508, + 'ALPHA4_EXT': 0x803B, + 'ALPHA8_EXT': 0x803C, + 'ALPHA12_EXT': 0x803D, + 'ALPHA16_EXT': 0x803E, + 'LUMINANCE4_EXT': 0x803F, + 'LUMINANCE8_EXT': 0x8040, + 'LUMINANCE12_EXT': 0x8041, + 'LUMINANCE16_EXT': 0x8042, + 'LUMINANCE4_ALPHA4_EXT': 0x8043, + 'LUMINANCE6_ALPHA2_EXT': 0x8044, + 'LUMINANCE8_ALPHA8_EXT': 0x8045, + 'LUMINANCE12_ALPHA4_EXT': 0x8046, + 'LUMINANCE12_ALPHA12_EXT': 0x8047, + 'LUMINANCE16_ALPHA16_EXT': 0x8048, + 'INTENSITY_EXT': 0x8049, + 'INTENSITY4_EXT': 0x804A, + 'INTENSITY8_EXT': 0x804B, + 'INTENSITY12_EXT': 0x804C, + 'INTENSITY16_EXT': 0x804D, + 'RGB2_EXT': 0x804E, + 'RGB4_EXT': 0x804F, + 'RGB5_EXT': 0x8050, + 'RGB8_EXT': 0x8051, + 'RGB10_EXT': 0x8052, + 'RGB12_EXT': 0x8053, + 'RGB16_EXT': 0x8054, + 'RGBA2_EXT': 0x8055, + 'RGBA4_EXT': 0x8056, + 'RGB5_A1_EXT': 0x8057, + 'RGBA8_EXT': 0x8058, + 'RGB10_A2_EXT': 0x8059, + 'RGBA12_EXT': 0x805A, + 'RGBA16_EXT': 0x805B, + 'TEXTURE_RED_SIZE_EXT': 0x805C, + 'TEXTURE_GREEN_SIZE_EXT': 0x805D, + 'TEXTURE_BLUE_SIZE_EXT': 0x805E, + 'TEXTURE_ALPHA_SIZE_EXT': 0x805F, + 'TEXTURE_LUMINANCE_SIZE_EXT': 0x8060, + 'TEXTURE_INTENSITY_SIZE_EXT': 0x8061, + 'REPLACE_EXT': 0x8062, + 'PROXY_TEXTURE_1D_EXT': 0x8063, + 'PROXY_TEXTURE_2D_EXT': 0x8064, + 'PACK_SKIP_IMAGES_EXT': 0x806B, + 'PACK_IMAGE_HEIGHT_EXT': 0x806C, + 'UNPACK_SKIP_IMAGES_EXT': 0x806D, + 'UNPACK_IMAGE_HEIGHT_EXT': 0x806E, + 'TEXTURE_3D_EXT': 0x806F, + 'PROXY_TEXTURE_3D_EXT': 0x8070, + 'TEXTURE_DEPTH_EXT': 0x8071, + 'TEXTURE_WRAP_R_EXT': 0x8072, + 'MAX_3D_TEXTURE_SIZE_EXT': 0x8073, + 'COMPARE_REF_DEPTH_TO_TEXTURE_EXT': 0x884E, + 'MAX_ARRAY_TEXTURE_LAYERS_EXT': 0x88FF, + 'TEXTURE_1D_ARRAY_EXT': 0x8C18, + 'PROXY_TEXTURE_1D_ARRAY_EXT': 0x8C19, + 'TEXTURE_2D_ARRAY_EXT': 0x8C1A, + 'PROXY_TEXTURE_2D_ARRAY_EXT': 0x8C1B, + 'TEXTURE_BINDING_1D_ARRAY_EXT': 0x8C1C, + 'TEXTURE_BINDING_2D_ARRAY_EXT': 0x8C1D, + 'TEXTURE_BUFFER_EXT': 0x8C2A, + 'MAX_TEXTURE_BUFFER_SIZE_EXT': 0x8C2B, + 'TEXTURE_BINDING_BUFFER_EXT': 0x8C2C, + 'TEXTURE_BUFFER_DATA_STORE_BINDING_EXT': 0x8C2D, + 'TEXTURE_BUFFER_FORMAT_EXT': 0x8C2E, + 'COMPRESSED_RGB_S3TC_DXT1_EXT': 0x83F0, + 'COMPRESSED_RGBA_S3TC_DXT1_EXT': 0x83F1, + 'COMPRESSED_LUMINANCE_LATC1_EXT': 0x8C70, + 'COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT': 0x8C71, + 'COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT': 0x8C72, + 'COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT': 0x8C73, + 'COMPRESSED_RED_RGTC1_EXT': 0x8DBB, + 'COMPRESSED_SIGNED_RED_RGTC1_EXT': 0x8DBC, + 'COMPRESSED_RED_GREEN_RGTC2_EXT': 0x8DBD, + 'COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT': 0x8DBE, + 'COMPRESSED_RGB_S3TC_DXT1_EXT': 0x83F0, + 'COMPRESSED_RGBA_S3TC_DXT1_EXT': 0x83F1, + 'COMPRESSED_RGBA_S3TC_DXT3_EXT': 0x83F2, + 'COMPRESSED_RGBA_S3TC_DXT5_EXT': 0x83F3, + 'NORMAL_MAP_EXT': 0x8511, + 'REFLECTION_MAP_EXT': 0x8512, + 'TEXTURE_CUBE_MAP_EXT': 0x8513, + 'TEXTURE_BINDING_CUBE_MAP_EXT': 0x8514, + 'TEXTURE_CUBE_MAP_POSITIVE_X_EXT': 0x8515, + 'TEXTURE_CUBE_MAP_NEGATIVE_X_EXT': 0x8516, + 'TEXTURE_CUBE_MAP_POSITIVE_Y_EXT': 0x8517, + 'TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT': 0x8518, + 'TEXTURE_CUBE_MAP_POSITIVE_Z_EXT': 0x8519, + 'TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT': 0x851A, + 'PROXY_TEXTURE_CUBE_MAP_EXT': 0x851B, + 'MAX_CUBE_MAP_TEXTURE_SIZE_EXT': 0x851C, + 'CLAMP_TO_EDGE_EXT': 0x812F, + 'COMBINE_EXT': 0x8570, + 'COMBINE_RGB_EXT': 0x8571, + 'COMBINE_ALPHA_EXT': 0x8572, + 'RGB_SCALE_EXT': 0x8573, + 'ADD_SIGNED_EXT': 0x8574, + 'INTERPOLATE_EXT': 0x8575, + 'CONSTANT_EXT': 0x8576, + 'PRIMARY_COLOR_EXT': 0x8577, + 'PREVIOUS_EXT': 0x8578, + 'SOURCE0_RGB_EXT': 0x8580, + 'SOURCE1_RGB_EXT': 0x8581, + 'SOURCE2_RGB_EXT': 0x8582, + 'SOURCE0_ALPHA_EXT': 0x8588, + 'SOURCE1_ALPHA_EXT': 0x8589, + 'SOURCE2_ALPHA_EXT': 0x858A, + 'OPERAND0_RGB_EXT': 0x8590, + 'OPERAND1_RGB_EXT': 0x8591, + 'OPERAND2_RGB_EXT': 0x8592, + 'OPERAND0_ALPHA_EXT': 0x8598, + 'OPERAND1_ALPHA_EXT': 0x8599, + 'OPERAND2_ALPHA_EXT': 0x859A, + 'DOT3_RGB_EXT': 0x8740, + 'DOT3_RGBA_EXT': 0x8741, + 'TEXTURE_MAX_ANISOTROPY_EXT': 0x84FE, + 'MAX_TEXTURE_MAX_ANISOTROPY_EXT': 0x84FF, + 'RGBA32UI_EXT': 0x8D70, + 'RGB32UI_EXT': 0x8D71, + 'ALPHA32UI_EXT': 0x8D72, + 'INTENSITY32UI_EXT': 0x8D73, + 'LUMINANCE32UI_EXT': 0x8D74, + 'LUMINANCE_ALPHA32UI_EXT': 0x8D75, + 'RGBA16UI_EXT': 0x8D76, + 'RGB16UI_EXT': 0x8D77, + 'ALPHA16UI_EXT': 0x8D78, + 'INTENSITY16UI_EXT': 0x8D79, + 'LUMINANCE16UI_EXT': 0x8D7A, + 'LUMINANCE_ALPHA16UI_EXT': 0x8D7B, + 'RGBA8UI_EXT': 0x8D7C, + 'RGB8UI_EXT': 0x8D7D, + 'ALPHA8UI_EXT': 0x8D7E, + 'INTENSITY8UI_EXT': 0x8D7F, + 'LUMINANCE8UI_EXT': 0x8D80, + 'LUMINANCE_ALPHA8UI_EXT': 0x8D81, + 'RGBA32I_EXT': 0x8D82, + 'RGB32I_EXT': 0x8D83, + 'ALPHA32I_EXT': 0x8D84, + 'INTENSITY32I_EXT': 0x8D85, + 'LUMINANCE32I_EXT': 0x8D86, + 'LUMINANCE_ALPHA32I_EXT': 0x8D87, + 'RGBA16I_EXT': 0x8D88, + 'RGB16I_EXT': 0x8D89, + 'ALPHA16I_EXT': 0x8D8A, + 'INTENSITY16I_EXT': 0x8D8B, + 'LUMINANCE16I_EXT': 0x8D8C, + 'LUMINANCE_ALPHA16I_EXT': 0x8D8D, + 'RGBA8I_EXT': 0x8D8E, + 'RGB8I_EXT': 0x8D8F, + 'ALPHA8I_EXT': 0x8D90, + 'INTENSITY8I_EXT': 0x8D91, + 'LUMINANCE8I_EXT': 0x8D92, + 'LUMINANCE_ALPHA8I_EXT': 0x8D93, + 'RED_INTEGER_EXT': 0x8D94, + 'GREEN_INTEGER_EXT': 0x8D95, + 'BLUE_INTEGER_EXT': 0x8D96, + 'ALPHA_INTEGER_EXT': 0x8D97, + 'RGB_INTEGER_EXT': 0x8D98, + 'RGBA_INTEGER_EXT': 0x8D99, + 'BGR_INTEGER_EXT': 0x8D9A, + 'BGRA_INTEGER_EXT': 0x8D9B, + 'LUMINANCE_INTEGER_EXT': 0x8D9C, + 'LUMINANCE_ALPHA_INTEGER_EXT': 0x8D9D, + 'RGBA_INTEGER_MODE_EXT': 0x8D9E, + 'MAX_TEXTURE_LOD_BIAS_EXT': 0x84FD, + 'TEXTURE_FILTER_CONTROL_EXT': 0x8500, + 'TEXTURE_LOD_BIAS_EXT': 0x8501, + 'MIRROR_CLAMP_EXT': 0x8742, + 'MIRROR_CLAMP_TO_EDGE_EXT': 0x8743, + 'MIRROR_CLAMP_TO_BORDER_EXT': 0x8912, + 'TEXTURE_PRIORITY_EXT': 0x8066, + 'TEXTURE_RESIDENT_EXT': 0x8067, + 'TEXTURE_1D_BINDING_EXT': 0x8068, + 'TEXTURE_2D_BINDING_EXT': 0x8069, + 'TEXTURE_3D_BINDING_EXT': 0x806A, + 'PERTURB_EXT': 0x85AE, + 'TEXTURE_NORMAL_EXT': 0x85AF, + 'TEXTURE_RECTANGLE_EXT': 0x84F5, + 'TEXTURE_BINDING_RECTANGLE_EXT': 0x84F6, + 'PROXY_TEXTURE_RECTANGLE_EXT': 0x84F7, + 'MAX_RECTANGLE_TEXTURE_SIZE_EXT': 0x84F8, + 'SRGB_EXT': 0x8C40, + 'SRGB8_EXT': 0x8C41, + 'SRGB_ALPHA_EXT': 0x8C42, + 'SRGB8_ALPHA8_EXT': 0x8C43, + 'SLUMINANCE_ALPHA_EXT': 0x8C44, + 'SLUMINANCE8_ALPHA8_EXT': 0x8C45, + 'SLUMINANCE_EXT': 0x8C46, + 'SLUMINANCE8_EXT': 0x8C47, + 'COMPRESSED_SRGB_EXT': 0x8C48, + 'COMPRESSED_SRGB_ALPHA_EXT': 0x8C49, + 'COMPRESSED_SLUMINANCE_EXT': 0x8C4A, + 'COMPRESSED_SLUMINANCE_ALPHA_EXT': 0x8C4B, + 'COMPRESSED_SRGB_S3TC_DXT1_EXT': 0x8C4C, + 'COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT': 0x8C4D, + 'COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT': 0x8C4E, + 'COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT': 0x8C4F, + 'RGB9_E5_EXT': 0x8C3D, + 'UNSIGNED_INT_5_9_9_9_REV_EXT': 0x8C3E, + 'TEXTURE_SHARED_SIZE_EXT': 0x8C3F, + 'TEXTURE_SWIZZLE_R_EXT': 0x8E42, + 'TEXTURE_SWIZZLE_G_EXT': 0x8E43, + 'TEXTURE_SWIZZLE_B_EXT': 0x8E44, + 'TEXTURE_SWIZZLE_A_EXT': 0x8E45, + 'TEXTURE_SWIZZLE_RGBA_EXT': 0x8E46, + 'TIME_ELAPSED_EXT': 0x88BF, + 'TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT': 0x8C76, + 'TRANSFORM_FEEDBACK_BUFFER_MODE_EXT': 0x8C7F, + 'MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT': 0x8C80, + 'TRANSFORM_FEEDBACK_VARYINGS_EXT': 0x8C83, + 'TRANSFORM_FEEDBACK_BUFFER_START_EXT': 0x8C84, + 'TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT': 0x8C85, + 'PRIMITIVES_GENERATED_EXT': 0x8C87, + 'TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT': 0x8C88, + 'RASTERIZER_DISCARD_EXT': 0x8C89, + 'MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT': 0x8C8A, + 'MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT': 0x8C8B, + 'INTERLEAVED_ATTRIBS_EXT': 0x8C8C, + 'SEPARATE_ATTRIBS_EXT': 0x8C8D, + 'TRANSFORM_FEEDBACK_BUFFER_EXT': 0x8C8E, + 'TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT': 0x8C8F, + 'DOUBLE_EXT': 0x140A, + 'VERTEX_ARRAY_EXT': 0x8074, + 'NORMAL_ARRAY_EXT': 0x8075, + 'COLOR_ARRAY_EXT': 0x8076, + 'INDEX_ARRAY_EXT': 0x8077, + 'TEXTURE_COORD_ARRAY_EXT': 0x8078, + 'EDGE_FLAG_ARRAY_EXT': 0x8079, + 'VERTEX_ARRAY_SIZE_EXT': 0x807A, + 'VERTEX_ARRAY_TYPE_EXT': 0x807B, + 'VERTEX_ARRAY_STRIDE_EXT': 0x807C, + 'VERTEX_ARRAY_COUNT_EXT': 0x807D, + 'NORMAL_ARRAY_TYPE_EXT': 0x807E, + 'NORMAL_ARRAY_STRIDE_EXT': 0x807F, + 'NORMAL_ARRAY_COUNT_EXT': 0x8080, + 'COLOR_ARRAY_SIZE_EXT': 0x8081, + 'COLOR_ARRAY_TYPE_EXT': 0x8082, + 'COLOR_ARRAY_STRIDE_EXT': 0x8083, + 'COLOR_ARRAY_COUNT_EXT': 0x8084, + 'INDEX_ARRAY_TYPE_EXT': 0x8085, + 'INDEX_ARRAY_STRIDE_EXT': 0x8086, + 'INDEX_ARRAY_COUNT_EXT': 0x8087, + 'TEXTURE_COORD_ARRAY_SIZE_EXT': 0x8088, + 'TEXTURE_COORD_ARRAY_TYPE_EXT': 0x8089, + 'TEXTURE_COORD_ARRAY_STRIDE_EXT': 0x808A, + 'TEXTURE_COORD_ARRAY_COUNT_EXT': 0x808B, + 'EDGE_FLAG_ARRAY_STRIDE_EXT': 0x808C, + 'EDGE_FLAG_ARRAY_COUNT_EXT': 0x808D, + 'VERTEX_ARRAY_POINTER_EXT': 0x808E, + 'NORMAL_ARRAY_POINTER_EXT': 0x808F, + 'COLOR_ARRAY_POINTER_EXT': 0x8090, + 'INDEX_ARRAY_POINTER_EXT': 0x8091, + 'TEXTURE_COORD_ARRAY_POINTER_EXT': 0x8092, + 'EDGE_FLAG_ARRAY_POINTER_EXT': 0x8093, + 'BGRA': 0x80E1, + 'VERTEX_SHADER_EXT': 0x8780, + 'VERTEX_SHADER_BINDING_EXT': 0x8781, + 'OP_INDEX_EXT': 0x8782, + 'OP_NEGATE_EXT': 0x8783, + 'OP_DOT3_EXT': 0x8784, + 'OP_DOT4_EXT': 0x8785, + 'OP_MUL_EXT': 0x8786, + 'OP_ADD_EXT': 0x8787, + 'OP_MADD_EXT': 0x8788, + 'OP_FRAC_EXT': 0x8789, + 'OP_MAX_EXT': 0x878A, + 'OP_MIN_EXT': 0x878B, + 'OP_SET_GE_EXT': 0x878C, + 'OP_SET_LT_EXT': 0x878D, + 'OP_CLAMP_EXT': 0x878E, + 'OP_FLOOR_EXT': 0x878F, + 'OP_ROUND_EXT': 0x8790, + 'OP_EXP_BASE_2_EXT': 0x8791, + 'OP_LOG_BASE_2_EXT': 0x8792, + 'OP_POWER_EXT': 0x8793, + 'OP_RECIP_EXT': 0x8794, + 'OP_RECIP_SQRT_EXT': 0x8795, + 'OP_SUB_EXT': 0x8796, + 'OP_CROSS_PRODUCT_EXT': 0x8797, + 'OP_MULTIPLY_MATRIX_EXT': 0x8798, + 'OP_MOV_EXT': 0x8799, + 'OUTPUT_VERTEX_EXT': 0x879A, + 'OUTPUT_COLOR0_EXT': 0x879B, + 'OUTPUT_COLOR1_EXT': 0x879C, + 'OUTPUT_TEXTURE_COORD0_EXT': 0x879D, + 'OUTPUT_TEXTURE_COORD1_EXT': 0x879E, + 'OUTPUT_TEXTURE_COORD2_EXT': 0x879F, + 'OUTPUT_TEXTURE_COORD3_EXT': 0x87A0, + 'OUTPUT_TEXTURE_COORD4_EXT': 0x87A1, + 'OUTPUT_TEXTURE_COORD5_EXT': 0x87A2, + 'OUTPUT_TEXTURE_COORD6_EXT': 0x87A3, + 'OUTPUT_TEXTURE_COORD7_EXT': 0x87A4, + 'OUTPUT_TEXTURE_COORD8_EXT': 0x87A5, + 'OUTPUT_TEXTURE_COORD9_EXT': 0x87A6, + 'OUTPUT_TEXTURE_COORD10_EXT': 0x87A7, + 'OUTPUT_TEXTURE_COORD11_EXT': 0x87A8, + 'OUTPUT_TEXTURE_COORD12_EXT': 0x87A9, + 'OUTPUT_TEXTURE_COORD13_EXT': 0x87AA, + 'OUTPUT_TEXTURE_COORD14_EXT': 0x87AB, + 'OUTPUT_TEXTURE_COORD15_EXT': 0x87AC, + 'OUTPUT_TEXTURE_COORD16_EXT': 0x87AD, + 'OUTPUT_TEXTURE_COORD17_EXT': 0x87AE, + 'OUTPUT_TEXTURE_COORD18_EXT': 0x87AF, + 'OUTPUT_TEXTURE_COORD19_EXT': 0x87B0, + 'OUTPUT_TEXTURE_COORD20_EXT': 0x87B1, + 'OUTPUT_TEXTURE_COORD21_EXT': 0x87B2, + 'OUTPUT_TEXTURE_COORD22_EXT': 0x87B3, + 'OUTPUT_TEXTURE_COORD23_EXT': 0x87B4, + 'OUTPUT_TEXTURE_COORD24_EXT': 0x87B5, + 'OUTPUT_TEXTURE_COORD25_EXT': 0x87B6, + 'OUTPUT_TEXTURE_COORD26_EXT': 0x87B7, + 'OUTPUT_TEXTURE_COORD27_EXT': 0x87B8, + 'OUTPUT_TEXTURE_COORD28_EXT': 0x87B9, + 'OUTPUT_TEXTURE_COORD29_EXT': 0x87BA, + 'OUTPUT_TEXTURE_COORD30_EXT': 0x87BB, + 'OUTPUT_TEXTURE_COORD31_EXT': 0x87BC, + 'OUTPUT_FOG_EXT': 0x87BD, + 'SCALAR_EXT': 0x87BE, + 'VECTOR_EXT': 0x87BF, + 'MATRIX_EXT': 0x87C0, + 'VARIANT_EXT': 0x87C1, + 'INVARIANT_EXT': 0x87C2, + 'LOCAL_CONSTANT_EXT': 0x87C3, + 'LOCAL_EXT': 0x87C4, + 'MAX_VERTEX_SHADER_INSTRUCTIONS_EXT': 0x87C5, + 'MAX_VERTEX_SHADER_VARIANTS_EXT': 0x87C6, + 'MAX_VERTEX_SHADER_INVARIANTS_EXT': 0x87C7, + 'MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT': 0x87C8, + 'MAX_VERTEX_SHADER_LOCALS_EXT': 0x87C9, + 'MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT': 0x87CA, + 'MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT': 0x87CB, + 'MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT': 0x87CC, + 'MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT': 0x87CD, + 'MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT': 0x87CE, + 'VERTEX_SHADER_INSTRUCTIONS_EXT': 0x87CF, + 'VERTEX_SHADER_VARIANTS_EXT': 0x87D0, + 'VERTEX_SHADER_INVARIANTS_EXT': 0x87D1, + 'VERTEX_SHADER_LOCAL_CONSTANTS_EXT': 0x87D2, + 'VERTEX_SHADER_LOCALS_EXT': 0x87D3, + 'VERTEX_SHADER_OPTIMIZED_EXT': 0x87D4, + 'X_EXT': 0x87D5, + 'Y_EXT': 0x87D6, + 'Z_EXT': 0x87D7, + 'W_EXT': 0x87D8, + 'NEGATIVE_X_EXT': 0x87D9, + 'NEGATIVE_Y_EXT': 0x87DA, + 'NEGATIVE_Z_EXT': 0x87DB, + 'NEGATIVE_W_EXT': 0x87DC, + 'ZERO_EXT': 0x87DD, + 'ONE_EXT': 0x87DE, + 'NEGATIVE_ONE_EXT': 0x87DF, + 'NORMALIZED_RANGE_EXT': 0x87E0, + 'FULL_RANGE_EXT': 0x87E1, + 'CURRENT_VERTEX_EXT': 0x87E2, + 'MVP_MATRIX_EXT': 0x87E3, + 'VARIANT_VALUE_EXT': 0x87E4, + 'VARIANT_DATATYPE_EXT': 0x87E5, + 'VARIANT_ARRAY_STRIDE_EXT': 0x87E6, + 'VARIANT_ARRAY_TYPE_EXT': 0x87E7, + 'VARIANT_ARRAY_EXT': 0x87E8, + 'VARIANT_ARRAY_POINTER_EXT': 0x87E9, + 'INVARIANT_VALUE_EXT': 0x87EA, + 'INVARIANT_DATATYPE_EXT': 0x87EB, + 'LOCAL_CONSTANT_VALUE_EXT': 0x87EC, + 'LOCAL_CONSTANT_DATATYPE_EXT': 0x87ED, + 'MODELVIEW0_STACK_DEPTH_EXT': 0x0BA3, + 'MODELVIEW0_MATRIX_EXT': 0x0BA6, + 'MODELVIEW0_EXT': 0x1700, + 'MODELVIEW1_STACK_DEPTH_EXT': 0x8502, + 'MODELVIEW1_MATRIX_EXT': 0x8506, + 'VERTEX_WEIGHTING_EXT': 0x8509, + 'MODELVIEW1_EXT': 0x850A, + 'CURRENT_VERTEX_WEIGHT_EXT': 0x850B, + 'VERTEX_WEIGHT_ARRAY_EXT': 0x850C, + 'VERTEX_WEIGHT_ARRAY_SIZE_EXT': 0x850D, + 'VERTEX_WEIGHT_ARRAY_TYPE_EXT': 0x850E, + 'VERTEX_WEIGHT_ARRAY_STRIDE_EXT': 0x850F, + 'VERTEX_WEIGHT_ARRAY_POINTER_EXT': 0x8510, + 'OCCLUSION_TEST_HP': 0x8165, + 'OCCLUSION_TEST_RESULT_HP': 0x8166, + 'MIRRORED_REPEAT_IBM': 0x8370, + 'RED_MIN_CLAMP_INGR': 0x8560, + 'GREEN_MIN_CLAMP_INGR': 0x8561, + 'BLUE_MIN_CLAMP_INGR': 0x8562, + 'ALPHA_MIN_CLAMP_INGR': 0x8563, + 'RED_MAX_CLAMP_INGR': 0x8564, + 'GREEN_MAX_CLAMP_INGR': 0x8565, + 'BLUE_MAX_CLAMP_INGR': 0x8566, + 'ALPHA_MAX_CLAMP_INGR': 0x8567, + 'INTERLACE_READ_INGR': 0x8568, + 'PARALLEL_ARRAYS_INTEL': 0x83F4, + 'VERTEX_ARRAY_PARALLEL_POINTERS_INTEL': 0x83F5, + 'NORMAL_ARRAY_PARALLEL_POINTERS_INTEL': 0x83F6, + 'COLOR_ARRAY_PARALLEL_POINTERS_INTEL': 0x83F7, + 'TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL': 0x83F8, + 'KTX_FRONT_REGION': 0x0, + 'KTX_BACK_REGION': 0x1, + 'KTX_Z_REGION': 0x2, + 'KTX_STENCIL_REGION': 0x3, + 'TEXTURE_1D_STACK_MESAX': 0x8759, + 'TEXTURE_2D_STACK_MESAX': 0x875A, + 'PROXY_TEXTURE_1D_STACK_MESAX': 0x875B, + 'PROXY_TEXTURE_2D_STACK_MESAX': 0x875C, + 'TEXTURE_1D_STACK_BINDING_MESAX': 0x875D, + 'TEXTURE_2D_STACK_BINDING_MESAX': 0x875E, + 'PACK_INVERT_MESA': 0x8758, + 'UNSIGNED_SHORT_8_8_MESA': 0x85BA, + 'UNSIGNED_SHORT_8_8_REV_MESA': 0x85BB, + 'YCBCR_MESA': 0x8757, + 'QUERY_WAIT_NV': 0x8E13, + 'QUERY_NO_WAIT_NV': 0x8E14, + 'QUERY_BY_REGION_WAIT_NV': 0x8E15, + 'QUERY_BY_REGION_NO_WAIT_NV': 0x8E16, + 'DEPTH_STENCIL_TO_RGBA_NV': 0x886E, + 'DEPTH_STENCIL_TO_BGRA_NV': 0x886F, + 'DEPTH_COMPONENT32F_NV': 0x8DAB, + 'DEPTH32F_STENCIL8_NV': 0x8DAC, + 'FLOAT_32_UNSIGNED_INT_24_8_REV_NV': 0x8DAD, + 'DEPTH_BUFFER_FLOAT_MODE_NV': 0x8DAF, + 'DEPTH_CLAMP_NV': 0x864F, + 'SAMPLE_COUNT_BITS_NV': 0x8864, + 'CURRENT_SAMPLE_COUNT_QUERY_NV': 0x8865, + 'QUERY_RESULT_NV': 0x8866, + 'QUERY_RESULT_AVAILABLE_NV': 0x8867, + 'SAMPLE_COUNT_NV': 0x8914, + 'EVAL_2D_NV': 0x86C0, + 'EVAL_TRIANGULAR_2D_NV': 0x86C1, + 'MAP_TESSELLATION_NV': 0x86C2, + 'MAP_ATTRIB_U_ORDER_NV': 0x86C3, + 'MAP_ATTRIB_V_ORDER_NV': 0x86C4, + 'EVAL_FRACTIONAL_TESSELLATION_NV': 0x86C5, + 'EVAL_VERTEX_ATTRIB0_NV': 0x86C6, + 'EVAL_VERTEX_ATTRIB1_NV': 0x86C7, + 'EVAL_VERTEX_ATTRIB2_NV': 0x86C8, + 'EVAL_VERTEX_ATTRIB3_NV': 0x86C9, + 'EVAL_VERTEX_ATTRIB4_NV': 0x86CA, + 'EVAL_VERTEX_ATTRIB5_NV': 0x86CB, + 'EVAL_VERTEX_ATTRIB6_NV': 0x86CC, + 'EVAL_VERTEX_ATTRIB7_NV': 0x86CD, + 'EVAL_VERTEX_ATTRIB8_NV': 0x86CE, + 'EVAL_VERTEX_ATTRIB9_NV': 0x86CF, + 'EVAL_VERTEX_ATTRIB10_NV': 0x86D0, + 'EVAL_VERTEX_ATTRIB11_NV': 0x86D1, + 'EVAL_VERTEX_ATTRIB12_NV': 0x86D2, + 'EVAL_VERTEX_ATTRIB13_NV': 0x86D3, + 'EVAL_VERTEX_ATTRIB14_NV': 0x86D4, + 'EVAL_VERTEX_ATTRIB15_NV': 0x86D5, + 'MAX_MAP_TESSELLATION_NV': 0x86D6, + 'MAX_RATIONAL_EVAL_ORDER_NV': 0x86D7, + 'SAMPLE_POSITION_NV': 0x8E50, + 'SAMPLE_MASK_NV': 0x8E51, + 'SAMPLE_MASK_VALUE_NV': 0x8E52, + 'TEXTURE_BINDING_RENDERBUFFER_NV': 0x8E53, + 'TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV': 0x8E54, + 'TEXTURE_RENDERBUFFER_NV': 0x8E55, + 'SAMPLER_RENDERBUFFER_NV': 0x8E56, + 'INT_SAMPLER_RENDERBUFFER_NV': 0x8E57, + 'UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV': 0x8E58, + 'MAX_SAMPLE_MASK_WORDS_NV': 0x8E59, + 'ALL_COMPLETED_NV': 0x84F2, + 'FENCE_STATUS_NV': 0x84F3, + 'FENCE_CONDITION_NV': 0x84F4, + 'FLOAT_R_NV': 0x8880, + 'FLOAT_RG_NV': 0x8881, + 'FLOAT_RGB_NV': 0x8882, + 'FLOAT_RGBA_NV': 0x8883, + 'FLOAT_R16_NV': 0x8884, + 'FLOAT_R32_NV': 0x8885, + 'FLOAT_RG16_NV': 0x8886, + 'FLOAT_RG32_NV': 0x8887, + 'FLOAT_RGB16_NV': 0x8888, + 'FLOAT_RGB32_NV': 0x8889, + 'FLOAT_RGBA16_NV': 0x888A, + 'FLOAT_RGBA32_NV': 0x888B, + 'TEXTURE_FLOAT_COMPONENTS_NV': 0x888C, + 'FLOAT_CLEAR_COLOR_VALUE_NV': 0x888D, + 'FLOAT_RGBA_MODE_NV': 0x888E, + 'FOG_DISTANCE_MODE_NV': 0x855A, + 'EYE_RADIAL_NV': 0x855B, + 'EYE_PLANE_ABSOLUTE_NV': 0x855C, + 'MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV': 0x8868, + 'FRAGMENT_PROGRAM_NV': 0x8870, + 'MAX_TEXTURE_COORDS_NV': 0x8871, + 'MAX_TEXTURE_IMAGE_UNITS_NV': 0x8872, + 'FRAGMENT_PROGRAM_BINDING_NV': 0x8873, + 'PROGRAM_ERROR_STRING_NV': 0x8874, + 'MAX_PROGRAM_EXEC_INSTRUCTIONS_NV': 0x88F4, + 'MAX_PROGRAM_CALL_DEPTH_NV': 0x88F5, + 'MAX_PROGRAM_IF_DEPTH_NV': 0x88F6, + 'MAX_PROGRAM_LOOP_DEPTH_NV': 0x88F7, + 'MAX_PROGRAM_LOOP_COUNT_NV': 0x88F8, + 'RENDERBUFFER_COVERAGE_SAMPLES_NV': 0x8CAB, + 'RENDERBUFFER_COLOR_SAMPLES_NV': 0x8E10, + 'MAX_MULTISAMPLE_COVERAGE_MODES_NV': 0x8E11, + 'MULTISAMPLE_COVERAGE_MODES_NV': 0x8E12, + 'GEOMETRY_PROGRAM_NV': 0x8C26, + 'MAX_PROGRAM_OUTPUT_VERTICES_NV': 0x8C27, + 'MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV': 0x8C28, + 'MIN_PROGRAM_TEXEL_OFFSET_NV': 0x8904, + 'MAX_PROGRAM_TEXEL_OFFSET_NV': 0x8905, + 'PROGRAM_ATTRIB_COMPONENTS_NV': 0x8906, + 'PROGRAM_RESULT_COMPONENTS_NV': 0x8907, + 'MAX_PROGRAM_ATTRIB_COMPONENTS_NV': 0x8908, + 'MAX_PROGRAM_RESULT_COMPONENTS_NV': 0x8909, + 'MAX_PROGRAM_GENERIC_ATTRIBS_NV': 0x8DA5, + 'MAX_PROGRAM_GENERIC_RESULTS_NV': 0x8DA6, + 'HALF_FLOAT_NV': 0x140B, + 'MAX_SHININESS_NV': 0x8504, + 'MAX_SPOT_EXPONENT_NV': 0x8505, + 'MULTISAMPLE_FILTER_HINT_NV': 0x8534, + 'PIXEL_COUNTER_BITS_NV': 0x8864, + 'CURRENT_OCCLUSION_QUERY_ID_NV': 0x8865, + 'PIXEL_COUNT_NV': 0x8866, + 'PIXEL_COUNT_AVAILABLE_NV': 0x8867, + 'DEPTH_STENCIL_NV': 0x84F9, + 'UNSIGNED_INT_24_8_NV': 0x84FA, + 'MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV': 0x8DA0, + 'MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV': 0x8DA1, + 'VERTEX_PROGRAM_PARAMETER_BUFFER_NV': 0x8DA2, + 'GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV': 0x8DA3, + 'FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV': 0x8DA4, + 'WRITE_PIXEL_DATA_RANGE_NV': 0x8878, + 'READ_PIXEL_DATA_RANGE_NV': 0x8879, + 'WRITE_PIXEL_DATA_RANGE_LENGTH_NV': 0x887A, + 'READ_PIXEL_DATA_RANGE_LENGTH_NV': 0x887B, + 'WRITE_PIXEL_DATA_RANGE_POINTER_NV': 0x887C, + 'READ_PIXEL_DATA_RANGE_POINTER_NV': 0x887D, + 'POINT_SPRITE_NV': 0x8861, + 'COORD_REPLACE_NV': 0x8862, + 'POINT_SPRITE_R_MODE_NV': 0x8863, + 'FRAME_NV': 0x8E26, + 'FIELDS_NV': 0x8E27, + 'CURRENT_TIME_NV': 0x8E28, + 'NUM_FILL_STREAMS_NV': 0x8E29, + 'PRESENT_TIME_NV': 0x8E2A, + 'PRESENT_DURATION_NV': 0x8E2B, + 'PRIMITIVE_RESTART_NV': 0x8558, + 'PRIMITIVE_RESTART_INDEX_NV': 0x8559, + 'REGISTER_COMBINERS_NV': 0x8522, + 'VARIABLE_A_NV': 0x8523, + 'VARIABLE_B_NV': 0x8524, + 'VARIABLE_C_NV': 0x8525, + 'VARIABLE_D_NV': 0x8526, + 'VARIABLE_E_NV': 0x8527, + 'VARIABLE_F_NV': 0x8528, + 'VARIABLE_G_NV': 0x8529, + 'CONSTANT_COLOR0_NV': 0x852A, + 'CONSTANT_COLOR1_NV': 0x852B, + 'PRIMARY_COLOR_NV': 0x852C, + 'SECONDARY_COLOR_NV': 0x852D, + 'SPARE0_NV': 0x852E, + 'SPARE1_NV': 0x852F, + 'DISCARD_NV': 0x8530, + 'E_TIMES_F_NV': 0x8531, + 'SPARE0_PLUS_SECONDARY_COLOR_NV': 0x8532, + 'UNSIGNED_IDENTITY_NV': 0x8536, + 'UNSIGNED_INVERT_NV': 0x8537, + 'EXPAND_NORMAL_NV': 0x8538, + 'EXPAND_NEGATE_NV': 0x8539, + 'HALF_BIAS_NORMAL_NV': 0x853A, + 'HALF_BIAS_NEGATE_NV': 0x853B, + 'SIGNED_IDENTITY_NV': 0x853C, + 'SIGNED_NEGATE_NV': 0x853D, + 'SCALE_BY_TWO_NV': 0x853E, + 'SCALE_BY_FOUR_NV': 0x853F, + 'SCALE_BY_ONE_HALF_NV': 0x8540, + 'BIAS_BY_NEGATIVE_ONE_HALF_NV': 0x8541, + 'COMBINER_INPUT_NV': 0x8542, + 'COMBINER_MAPPING_NV': 0x8543, + 'COMBINER_COMPONENT_USAGE_NV': 0x8544, + 'COMBINER_AB_DOT_PRODUCT_NV': 0x8545, + 'COMBINER_CD_DOT_PRODUCT_NV': 0x8546, + 'COMBINER_MUX_SUM_NV': 0x8547, + 'COMBINER_SCALE_NV': 0x8548, + 'COMBINER_BIAS_NV': 0x8549, + 'COMBINER_AB_OUTPUT_NV': 0x854A, + 'COMBINER_CD_OUTPUT_NV': 0x854B, + 'COMBINER_SUM_OUTPUT_NV': 0x854C, + 'MAX_GENERAL_COMBINERS_NV': 0x854D, + 'NUM_GENERAL_COMBINERS_NV': 0x854E, + 'COLOR_SUM_CLAMP_NV': 0x854F, + 'COMBINER0_NV': 0x8550, + 'COMBINER1_NV': 0x8551, + 'COMBINER2_NV': 0x8552, + 'COMBINER3_NV': 0x8553, + 'COMBINER4_NV': 0x8554, + 'COMBINER5_NV': 0x8555, + 'COMBINER6_NV': 0x8556, + 'COMBINER7_NV': 0x8557, + 'PER_STAGE_CONSTANTS_NV': 0x8535, + 'EMBOSS_LIGHT_NV': 0x855D, + 'EMBOSS_CONSTANT_NV': 0x855E, + 'EMBOSS_MAP_NV': 0x855F, + 'NORMAL_MAP_NV': 0x8511, + 'REFLECTION_MAP_NV': 0x8512, + 'COMBINE4_NV': 0x8503, + 'SOURCE3_RGB_NV': 0x8583, + 'SOURCE3_ALPHA_NV': 0x858B, + 'OPERAND3_RGB_NV': 0x8593, + 'OPERAND3_ALPHA_NV': 0x859B, + 'TEXTURE_UNSIGNED_REMAP_MODE_NV': 0x888F, + 'TEXTURE_RECTANGLE_NV': 0x84F5, + 'TEXTURE_BINDING_RECTANGLE_NV': 0x84F6, + 'PROXY_TEXTURE_RECTANGLE_NV': 0x84F7, + 'MAX_RECTANGLE_TEXTURE_SIZE_NV': 0x84F8, + 'OFFSET_TEXTURE_RECTANGLE_NV': 0x864C, + 'OFFSET_TEXTURE_RECTANGLE_SCALE_NV': 0x864D, + 'DOT_PRODUCT_TEXTURE_RECTANGLE_NV': 0x864E, + 'RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV': 0x86D9, + 'UNSIGNED_INT_S8_S8_8_8_NV': 0x86DA, + 'UNSIGNED_INT_8_8_S8_S8_REV_NV': 0x86DB, + 'DSDT_MAG_INTENSITY_NV': 0x86DC, + 'SHADER_CONSISTENT_NV': 0x86DD, + 'TEXTURE_SHADER_NV': 0x86DE, + 'SHADER_OPERATION_NV': 0x86DF, + 'CULL_MODES_NV': 0x86E0, + 'OFFSET_TEXTURE_2D_MATRIX_NV': 0x86E1, + 'OFFSET_TEXTURE_MATRIX_NV': 0x86E1, + 'OFFSET_TEXTURE_2D_SCALE_NV': 0x86E2, + 'OFFSET_TEXTURE_SCALE_NV': 0x86E2, + 'OFFSET_TEXTURE_BIAS_NV': 0x86E3, + 'OFFSET_TEXTURE_2D_BIAS_NV': 0x86E3, + 'PREVIOUS_TEXTURE_INPUT_NV': 0x86E4, + 'CONST_EYE_NV': 0x86E5, + 'PASS_THROUGH_NV': 0x86E6, + 'CULL_FRAGMENT_NV': 0x86E7, + 'OFFSET_TEXTURE_2D_NV': 0x86E8, + 'DEPENDENT_AR_TEXTURE_2D_NV': 0x86E9, + 'DEPENDENT_GB_TEXTURE_2D_NV': 0x86EA, + 'DOT_PRODUCT_NV': 0x86EC, + 'DOT_PRODUCT_DEPTH_REPLACE_NV': 0x86ED, + 'DOT_PRODUCT_TEXTURE_2D_NV': 0x86EE, + 'DOT_PRODUCT_TEXTURE_CUBE_MAP_NV': 0x86F0, + 'DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV': 0x86F1, + 'DOT_PRODUCT_REFLECT_CUBE_MAP_NV': 0x86F2, + 'DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV': 0x86F3, + 'HILO_NV': 0x86F4, + 'DSDT_NV': 0x86F5, + 'DSDT_MAG_NV': 0x86F6, + 'DSDT_MAG_VIB_NV': 0x86F7, + 'HILO16_NV': 0x86F8, + 'SIGNED_HILO_NV': 0x86F9, + 'SIGNED_HILO16_NV': 0x86FA, + 'SIGNED_RGBA_NV': 0x86FB, + 'SIGNED_RGBA8_NV': 0x86FC, + 'SIGNED_RGB_NV': 0x86FE, + 'SIGNED_RGB8_NV': 0x86FF, + 'SIGNED_LUMINANCE_NV': 0x8701, + 'SIGNED_LUMINANCE8_NV': 0x8702, + 'SIGNED_LUMINANCE_ALPHA_NV': 0x8703, + 'SIGNED_LUMINANCE8_ALPHA8_NV': 0x8704, + 'SIGNED_ALPHA_NV': 0x8705, + 'SIGNED_ALPHA8_NV': 0x8706, + 'SIGNED_INTENSITY_NV': 0x8707, + 'SIGNED_INTENSITY8_NV': 0x8708, + 'DSDT8_NV': 0x8709, + 'DSDT8_MAG8_NV': 0x870A, + 'DSDT8_MAG8_INTENSITY8_NV': 0x870B, + 'SIGNED_RGB_UNSIGNED_ALPHA_NV': 0x870C, + 'SIGNED_RGB8_UNSIGNED_ALPHA8_NV': 0x870D, + 'HI_SCALE_NV': 0x870E, + 'LO_SCALE_NV': 0x870F, + 'DS_SCALE_NV': 0x8710, + 'DT_SCALE_NV': 0x8711, + 'MAGNITUDE_SCALE_NV': 0x8712, + 'VIBRANCE_SCALE_NV': 0x8713, + 'HI_BIAS_NV': 0x8714, + 'LO_BIAS_NV': 0x8715, + 'DS_BIAS_NV': 0x8716, + 'DT_BIAS_NV': 0x8717, + 'MAGNITUDE_BIAS_NV': 0x8718, + 'VIBRANCE_BIAS_NV': 0x8719, + 'TEXTURE_BORDER_VALUES_NV': 0x871A, + 'TEXTURE_HI_SIZE_NV': 0x871B, + 'TEXTURE_LO_SIZE_NV': 0x871C, + 'TEXTURE_DS_SIZE_NV': 0x871D, + 'TEXTURE_DT_SIZE_NV': 0x871E, + 'TEXTURE_MAG_SIZE_NV': 0x871F, + 'UNSIGNED_INT_S8_S8_8_8_NV': 0x86DA, + 'UNSIGNED_INT_8_8_S8_S8_REV_NV': 0x86DB, + 'DSDT_MAG_INTENSITY_NV': 0x86DC, + 'DOT_PRODUCT_TEXTURE_3D_NV': 0x86EF, + 'HILO_NV': 0x86F4, + 'DSDT_NV': 0x86F5, + 'DSDT_MAG_NV': 0x86F6, + 'DSDT_MAG_VIB_NV': 0x86F7, + 'HILO16_NV': 0x86F8, + 'SIGNED_HILO_NV': 0x86F9, + 'SIGNED_HILO16_NV': 0x86FA, + 'SIGNED_RGBA_NV': 0x86FB, + 'SIGNED_RGBA8_NV': 0x86FC, + 'SIGNED_RGB_NV': 0x86FE, + 'SIGNED_RGB8_NV': 0x86FF, + 'SIGNED_LUMINANCE_NV': 0x8701, + 'SIGNED_LUMINANCE8_NV': 0x8702, + 'SIGNED_LUMINANCE_ALPHA_NV': 0x8703, + 'SIGNED_LUMINANCE8_ALPHA8_NV': 0x8704, + 'SIGNED_ALPHA_NV': 0x8705, + 'SIGNED_ALPHA8_NV': 0x8706, + 'SIGNED_INTENSITY_NV': 0x8707, + 'SIGNED_INTENSITY8_NV': 0x8708, + 'DSDT8_NV': 0x8709, + 'DSDT8_MAG8_NV': 0x870A, + 'DSDT8_MAG8_INTENSITY8_NV': 0x870B, + 'SIGNED_RGB_UNSIGNED_ALPHA_NV': 0x870C, + 'SIGNED_RGB8_UNSIGNED_ALPHA8_NV': 0x870D, + 'OFFSET_PROJECTIVE_TEXTURE_2D_NV': 0x8850, + 'OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV': 0x8851, + 'OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV': 0x8852, + 'OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV': 0x8853, + 'OFFSET_HILO_TEXTURE_2D_NV': 0x8854, + 'OFFSET_HILO_TEXTURE_RECTANGLE_NV': 0x8855, + 'OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV': 0x8856, + 'OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV': 0x8857, + 'DEPENDENT_HILO_TEXTURE_2D_NV': 0x8858, + 'DEPENDENT_RGB_TEXTURE_3D_NV': 0x8859, + 'DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV': 0x885A, + 'DOT_PRODUCT_PASS_THROUGH_NV': 0x885B, + 'DOT_PRODUCT_TEXTURE_1D_NV': 0x885C, + 'DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV': 0x885D, + 'HILO8_NV': 0x885E, + 'SIGNED_HILO8_NV': 0x885F, + 'FORCE_BLUE_TO_ONE_NV': 0x8860, + 'BACK_PRIMARY_COLOR_NV': 0x8C77, + 'BACK_SECONDARY_COLOR_NV': 0x8C78, + 'TEXTURE_COORD_NV': 0x8C79, + 'CLIP_DISTANCE_NV': 0x8C7A, + 'VERTEX_ID_NV': 0x8C7B, + 'PRIMITIVE_ID_NV': 0x8C7C, + 'GENERIC_ATTRIB_NV': 0x8C7D, + 'TRANSFORM_FEEDBACK_ATTRIBS_NV': 0x8C7E, + 'TRANSFORM_FEEDBACK_BUFFER_MODE_NV': 0x8C7F, + 'MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV': 0x8C80, + 'ACTIVE_VARYINGS_NV': 0x8C81, + 'ACTIVE_VARYING_MAX_LENGTH_NV': 0x8C82, + 'TRANSFORM_FEEDBACK_VARYINGS_NV': 0x8C83, + 'TRANSFORM_FEEDBACK_BUFFER_START_NV': 0x8C84, + 'TRANSFORM_FEEDBACK_BUFFER_SIZE_NV': 0x8C85, + 'TRANSFORM_FEEDBACK_RECORD_NV': 0x8C86, + 'PRIMITIVES_GENERATED_NV': 0x8C87, + 'TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV': 0x8C88, + 'RASTERIZER_DISCARD_NV': 0x8C89, + 'MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV': 0x8C8A, + 'MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV': 0x8C8B, + 'INTERLEAVED_ATTRIBS_NV': 0x8C8C, + 'SEPARATE_ATTRIBS_NV': 0x8C8D, + 'TRANSFORM_FEEDBACK_BUFFER_NV': 0x8C8E, + 'TRANSFORM_FEEDBACK_BUFFER_BINDING_NV': 0x8C8F, + 'VERTEX_ARRAY_RANGE_NV': 0x851D, + 'VERTEX_ARRAY_RANGE_LENGTH_NV': 0x851E, + 'VERTEX_ARRAY_RANGE_VALID_NV': 0x851F, + 'MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV': 0x8520, + 'VERTEX_ARRAY_RANGE_POINTER_NV': 0x8521, + 'VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV': 0x8533, + 'VERTEX_PROGRAM_NV': 0x8620, + 'VERTEX_STATE_PROGRAM_NV': 0x8621, + 'ATTRIB_ARRAY_SIZE_NV': 0x8623, + 'ATTRIB_ARRAY_STRIDE_NV': 0x8624, + 'ATTRIB_ARRAY_TYPE_NV': 0x8625, + 'CURRENT_ATTRIB_NV': 0x8626, + 'PROGRAM_LENGTH_NV': 0x8627, + 'PROGRAM_STRING_NV': 0x8628, + 'MODELVIEW_PROJECTION_NV': 0x8629, + 'IDENTITY_NV': 0x862A, + 'INVERSE_NV': 0x862B, + 'TRANSPOSE_NV': 0x862C, + 'INVERSE_TRANSPOSE_NV': 0x862D, + 'MAX_TRACK_MATRIX_STACK_DEPTH_NV': 0x862E, + 'MAX_TRACK_MATRICES_NV': 0x862F, + 'MATRIX0_NV': 0x8630, + 'MATRIX1_NV': 0x8631, + 'MATRIX2_NV': 0x8632, + 'MATRIX3_NV': 0x8633, + 'MATRIX4_NV': 0x8634, + 'MATRIX5_NV': 0x8635, + 'MATRIX6_NV': 0x8636, + 'MATRIX7_NV': 0x8637, + 'CURRENT_MATRIX_STACK_DEPTH_NV': 0x8640, + 'CURRENT_MATRIX_NV': 0x8641, + 'VERTEX_PROGRAM_POINT_SIZE_NV': 0x8642, + 'VERTEX_PROGRAM_TWO_SIDE_NV': 0x8643, + 'PROGRAM_PARAMETER_NV': 0x8644, + 'ATTRIB_ARRAY_POINTER_NV': 0x8645, + 'PROGRAM_TARGET_NV': 0x8646, + 'PROGRAM_RESIDENT_NV': 0x8647, + 'TRACK_MATRIX_NV': 0x8648, + 'TRACK_MATRIX_TRANSFORM_NV': 0x8649, + 'VERTEX_PROGRAM_BINDING_NV': 0x864A, + 'PROGRAM_ERROR_POSITION_NV': 0x864B, + 'VERTEX_ATTRIB_ARRAY0_NV': 0x8650, + 'VERTEX_ATTRIB_ARRAY1_NV': 0x8651, + 'VERTEX_ATTRIB_ARRAY2_NV': 0x8652, + 'VERTEX_ATTRIB_ARRAY3_NV': 0x8653, + 'VERTEX_ATTRIB_ARRAY4_NV': 0x8654, + 'VERTEX_ATTRIB_ARRAY5_NV': 0x8655, + 'VERTEX_ATTRIB_ARRAY6_NV': 0x8656, + 'VERTEX_ATTRIB_ARRAY7_NV': 0x8657, + 'VERTEX_ATTRIB_ARRAY8_NV': 0x8658, + 'VERTEX_ATTRIB_ARRAY9_NV': 0x8659, + 'VERTEX_ATTRIB_ARRAY10_NV': 0x865A, + 'VERTEX_ATTRIB_ARRAY11_NV': 0x865B, + 'VERTEX_ATTRIB_ARRAY12_NV': 0x865C, + 'VERTEX_ATTRIB_ARRAY13_NV': 0x865D, + 'VERTEX_ATTRIB_ARRAY14_NV': 0x865E, + 'VERTEX_ATTRIB_ARRAY15_NV': 0x865F, + 'MAP1_VERTEX_ATTRIB0_4_NV': 0x8660, + 'MAP1_VERTEX_ATTRIB1_4_NV': 0x8661, + 'MAP1_VERTEX_ATTRIB2_4_NV': 0x8662, + 'MAP1_VERTEX_ATTRIB3_4_NV': 0x8663, + 'MAP1_VERTEX_ATTRIB4_4_NV': 0x8664, + 'MAP1_VERTEX_ATTRIB5_4_NV': 0x8665, + 'MAP1_VERTEX_ATTRIB6_4_NV': 0x8666, + 'MAP1_VERTEX_ATTRIB7_4_NV': 0x8667, + 'MAP1_VERTEX_ATTRIB8_4_NV': 0x8668, + 'MAP1_VERTEX_ATTRIB9_4_NV': 0x8669, + 'MAP1_VERTEX_ATTRIB10_4_NV': 0x866A, + 'MAP1_VERTEX_ATTRIB11_4_NV': 0x866B, + 'MAP1_VERTEX_ATTRIB12_4_NV': 0x866C, + 'MAP1_VERTEX_ATTRIB13_4_NV': 0x866D, + 'MAP1_VERTEX_ATTRIB14_4_NV': 0x866E, + 'MAP1_VERTEX_ATTRIB15_4_NV': 0x866F, + 'MAP2_VERTEX_ATTRIB0_4_NV': 0x8670, + 'MAP2_VERTEX_ATTRIB1_4_NV': 0x8671, + 'MAP2_VERTEX_ATTRIB2_4_NV': 0x8672, + 'MAP2_VERTEX_ATTRIB3_4_NV': 0x8673, + 'MAP2_VERTEX_ATTRIB4_4_NV': 0x8674, + 'MAP2_VERTEX_ATTRIB5_4_NV': 0x8675, + 'MAP2_VERTEX_ATTRIB6_4_NV': 0x8676, + 'MAP2_VERTEX_ATTRIB7_4_NV': 0x8677, + 'MAP2_VERTEX_ATTRIB8_4_NV': 0x8678, + 'MAP2_VERTEX_ATTRIB9_4_NV': 0x8679, + 'MAP2_VERTEX_ATTRIB10_4_NV': 0x867A, + 'MAP2_VERTEX_ATTRIB11_4_NV': 0x867B, + 'MAP2_VERTEX_ATTRIB12_4_NV': 0x867C, + 'MAP2_VERTEX_ATTRIB13_4_NV': 0x867D, + 'MAP2_VERTEX_ATTRIB14_4_NV': 0x867E, + 'MAP2_VERTEX_ATTRIB15_4_NV': 0x867F, + 'MAX_PROGRAM_EXEC_INSTRUCTIONS_NV': 0x88F4, + 'MAX_PROGRAM_CALL_DEPTH_NV': 0x88F5, + 'MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB': 0x8B4C, + 'BYTE': 0x1400, + 'PALETTE4_RGB8_OES': 0x8B90, + 'PALETTE4_RGBA8_OES': 0x8B91, + 'PALETTE4_R5_G6_B5_OES': 0x8B92, + 'PALETTE4_RGBA4_OES': 0x8B93, + 'PALETTE4_RGB5_A1_OES': 0x8B94, + 'PALETTE8_RGB8_OES': 0x8B95, + 'PALETTE8_RGBA8_OES': 0x8B96, + 'PALETTE8_R5_G6_B5_OES': 0x8B97, + 'PALETTE8_RGBA4_OES': 0x8B98, + 'PALETTE8_RGB5_A1_OES': 0x8B99, + 'IMPLEMENTATION_COLOR_READ_TYPE_OES': 0x8B9A, + 'IMPLEMENTATION_COLOR_READ_FORMAT_OES': 0x8B9B, + 'INTERLACE_OML': 0x8980, + 'INTERLACE_READ_OML': 0x8981, + 'PACK_RESAMPLE_OML': 0x8984, + 'UNPACK_RESAMPLE_OML': 0x8985, + 'RESAMPLE_REPLICATE_OML': 0x8986, + 'RESAMPLE_ZERO_FILL_OML': 0x8987, + 'RESAMPLE_AVERAGE_OML': 0x8988, + 'RESAMPLE_DECIMATE_OML': 0x8989, + 'FORMAT_SUBSAMPLE_24_24_OML': 0x8982, + 'FORMAT_SUBSAMPLE_244_244_OML': 0x8983, + 'VERTEX23_BIT_PGI': 0x00000004, + 'VERTEX4_BIT_PGI': 0x00000008, + 'COLOR3_BIT_PGI': 0x00010000, + 'COLOR4_BIT_PGI': 0x00020000, + 'EDGEFLAG_BIT_PGI': 0x00040000, + 'INDEX_BIT_PGI': 0x00080000, + 'MAT_AMBIENT_BIT_PGI': 0x00100000, + 'MAT_AMBIENT_AND_DIFFUSE_BIT_PGI': 0x00200000, + 'MAT_DIFFUSE_BIT_PGI': 0x00400000, + 'MAT_EMISSION_BIT_PGI': 0x00800000, + 'MAT_COLOR_INDEXES_BIT_PGI': 0x01000000, + 'MAT_SHININESS_BIT_PGI': 0x02000000, + 'MAT_SPECULAR_BIT_PGI': 0x04000000, + 'NORMAL_BIT_PGI': 0x08000000, + 'TEXCOORD1_BIT_PGI': 0x10000000, + 'TEXCOORD2_BIT_PGI': 0x20000000, + 'TEXCOORD3_BIT_PGI': 0x40000000, + 'TEXCOORD4_BIT_PGI': 0x80000000, + 'SCREEN_COORDINATES_REND': 0x8490, + 'INVERTED_SCREEN_W_REND': 0x8491, + 'RGB_S3TC': 0x83A0, + 'RGB4_S3TC': 0x83A1, + 'RGBA_S3TC': 0x83A2, + 'RGBA4_S3TC': 0x83A3, + 'RGBA_DXT5_S3TC': 0x83A4, + 'RGBA4_DXT5_S3TC': 0x83A5, + 'EXTENDED_RANGE_SGIS': 0x85A5, + 'MIN_RED_SGIS': 0x85A6, + 'MAX_RED_SGIS': 0x85A7, + 'MIN_GREEN_SGIS': 0x85A8, + 'MAX_GREEN_SGIS': 0x85A9, + 'MIN_BLUE_SGIS': 0x85AA, + 'MAX_BLUE_SGIS': 0x85AB, + 'MIN_ALPHA_SGIS': 0x85AC, + 'MAX_ALPHA_SGIS': 0x85AD, + 'GENERATE_MIPMAP_SGIS': 0x8191, + 'GENERATE_MIPMAP_HINT_SGIS': 0x8192, + 'MULTISAMPLE_SGIS': 0x809D, + 'SAMPLE_ALPHA_TO_MASK_SGIS': 0x809E, + 'SAMPLE_ALPHA_TO_ONE_SGIS': 0x809F, + 'SAMPLE_MASK_SGIS': 0x80A0, + '1PASS_SGIS': 0x80A1, + '2PASS_0_SGIS': 0x80A2, + '2PASS_1_SGIS': 0x80A3, + '4PASS_0_SGIS': 0x80A4, + '4PASS_1_SGIS': 0x80A5, + '4PASS_2_SGIS': 0x80A6, + '4PASS_3_SGIS': 0x80A7, + 'SAMPLE_BUFFERS_SGIS': 0x80A8, + 'SAMPLES_SGIS': 0x80A9, + 'SAMPLE_MASK_VALUE_SGIS': 0x80AA, + 'SAMPLE_MASK_INVERT_SGIS': 0x80AB, + 'SAMPLE_PATTERN_SGIS': 0x80AC, + 'MULTISAMPLE_BIT_EXT': 0x20000000, + 'EYE_DISTANCE_TO_POINT_SGIS': 0x81F0, + 'OBJECT_DISTANCE_TO_POINT_SGIS': 0x81F1, + 'EYE_DISTANCE_TO_LINE_SGIS': 0x81F2, + 'OBJECT_DISTANCE_TO_LINE_SGIS': 0x81F3, + 'EYE_POINT_SGIS': 0x81F4, + 'OBJECT_POINT_SGIS': 0x81F5, + 'EYE_LINE_SGIS': 0x81F6, + 'OBJECT_LINE_SGIS': 0x81F7, + 'CLAMP_TO_BORDER_SGIS': 0x812D, + 'CLAMP_TO_EDGE_SGIS': 0x812F, + 'TEXTURE_MIN_LOD_SGIS': 0x813A, + 'TEXTURE_MAX_LOD_SGIS': 0x813B, + 'TEXTURE_BASE_LEVEL_SGIS': 0x813C, + 'TEXTURE_MAX_LEVEL_SGIS': 0x813D, + 'ASYNC_MARKER_SGIX': 0x8329, + 'ASYNC_HISTOGRAM_SGIX': 0x832C, + 'MAX_ASYNC_HISTOGRAM_SGIX': 0x832D, + 'ASYNC_TEX_IMAGE_SGIX': 0x835C, + 'ASYNC_DRAW_PIXELS_SGIX': 0x835D, + 'ASYNC_READ_PIXELS_SGIX': 0x835E, + 'MAX_ASYNC_TEX_IMAGE_SGIX': 0x835F, + 'MAX_ASYNC_DRAW_PIXELS_SGIX': 0x8360, + 'MAX_ASYNC_READ_PIXELS_SGIX': 0x8361, + 'ALPHA_MIN_SGIX': 0x8320, + 'ALPHA_MAX_SGIX': 0x8321, + 'CONVOLUTION_HINT_SGIX': 0x8316, + 'DEPTH_COMPONENT16_SGIX': 0x81A5, + 'DEPTH_COMPONENT24_SGIX': 0x81A6, + 'DEPTH_COMPONENT32_SGIX': 0x81A7, + 'FOG_OFFSET_SGIX': 0x8198, + 'FOG_OFFSET_VALUE_SGIX': 0x8199, + 'INTERLACE_SGIX': 0x8094, + 'PACK_RESAMPLE_SGIX': 0x842E, + 'UNPACK_RESAMPLE_SGIX': 0x842F, + 'RESAMPLE_DECIMATE_SGIX': 0x8430, + 'RESAMPLE_REPLICATE_SGIX': 0x8433, + 'RESAMPLE_ZERO_FILL_SGIX': 0x8434, + 'TEXTURE_COMPARE_SGIX': 0x819A, + 'TEXTURE_COMPARE_OPERATOR_SGIX': 0x819B, + 'TEXTURE_LEQUAL_R_SGIX': 0x819C, + 'TEXTURE_GEQUAL_R_SGIX': 0x819D, + 'SHADOW_AMBIENT_SGIX': 0x80BF, + 'TEXTURE_MAX_CLAMP_S_SGIX': 0x8369, + 'TEXTURE_MAX_CLAMP_T_SGIX': 0x836A, + 'TEXTURE_MAX_CLAMP_R_SGIX': 0x836B, + 'TEXTURE_MULTI_BUFFER_HINT_SGIX': 0x812E, + 'RGB_SIGNED_SGIX': 0x85E0, + 'RGBA_SIGNED_SGIX': 0x85E1, + 'ALPHA_SIGNED_SGIX': 0x85E2, + 'LUMINANCE_SIGNED_SGIX': 0x85E3, + 'INTENSITY_SIGNED_SGIX': 0x85E4, + 'LUMINANCE_ALPHA_SIGNED_SGIX': 0x85E5, + 'RGB16_SIGNED_SGIX': 0x85E6, + 'RGBA16_SIGNED_SGIX': 0x85E7, + 'ALPHA16_SIGNED_SGIX': 0x85E8, + 'LUMINANCE16_SIGNED_SGIX': 0x85E9, + 'INTENSITY16_SIGNED_SGIX': 0x85EA, + 'LUMINANCE16_ALPHA16_SIGNED_SGIX': 0x85EB, + 'RGB_EXTENDED_RANGE_SGIX': 0x85EC, + 'RGBA_EXTENDED_RANGE_SGIX': 0x85ED, + 'ALPHA_EXTENDED_RANGE_SGIX': 0x85EE, + 'LUMINANCE_EXTENDED_RANGE_SGIX': 0x85EF, + 'INTENSITY_EXTENDED_RANGE_SGIX': 0x85F0, + 'LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX': 0x85F1, + 'RGB16_EXTENDED_RANGE_SGIX': 0x85F2, + 'RGBA16_EXTENDED_RANGE_SGIX': 0x85F3, + 'ALPHA16_EXTENDED_RANGE_SGIX': 0x85F4, + 'LUMINANCE16_EXTENDED_RANGE_SGIX': 0x85F5, + 'INTENSITY16_EXTENDED_RANGE_SGIX': 0x85F6, + 'LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX': 0x85F7, + 'MIN_LUMINANCE_SGIS': 0x85F8, + 'MAX_LUMINANCE_SGIS': 0x85F9, + 'MIN_INTENSITY_SGIS': 0x85FA, + 'MAX_INTENSITY_SGIS': 0x85FB, + 'POST_TEXTURE_FILTER_BIAS_SGIX': 0x8179, + 'POST_TEXTURE_FILTER_SCALE_SGIX': 0x817A, + 'POST_TEXTURE_FILTER_BIAS_RANGE_SGIX': 0x817B, + 'POST_TEXTURE_FILTER_SCALE_RANGE_SGIX': 0x817C, + 'VERTEX_PRECLIP_SGIX': 0x83EE, + 'VERTEX_PRECLIP_HINT_SGIX': 0x83EF, + 'VERTEX_PRECLIP_SGIX': 0x83EE, + 'VERTEX_PRECLIP_HINT_SGIX': 0x83EF, + 'COLOR_MATRIX_SGI': 0x80B1, + 'COLOR_MATRIX_STACK_DEPTH_SGI': 0x80B2, + 'MAX_COLOR_MATRIX_STACK_DEPTH_SGI': 0x80B3, + 'POST_COLOR_MATRIX_RED_SCALE_SGI': 0x80B4, + 'POST_COLOR_MATRIX_GREEN_SCALE_SGI': 0x80B5, + 'POST_COLOR_MATRIX_BLUE_SCALE_SGI': 0x80B6, + 'POST_COLOR_MATRIX_ALPHA_SCALE_SGI': 0x80B7, + 'POST_COLOR_MATRIX_RED_BIAS_SGI': 0x80B8, + 'POST_COLOR_MATRIX_GREEN_BIAS_SGI': 0x80B9, + 'POST_COLOR_MATRIX_BLUE_BIAS_SGI': 0x80BA, + 'POST_COLOR_MATRIX_ALPHA_BIAS_SGI': 0x80BB, + 'COLOR_TABLE_SGI': 0x80D0, + 'POST_CONVOLUTION_COLOR_TABLE_SGI': 0x80D1, + 'POST_COLOR_MATRIX_COLOR_TABLE_SGI': 0x80D2, + 'PROXY_COLOR_TABLE_SGI': 0x80D3, + 'PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI': 0x80D4, + 'PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI': 0x80D5, + 'COLOR_TABLE_SCALE_SGI': 0x80D6, + 'COLOR_TABLE_BIAS_SGI': 0x80D7, + 'COLOR_TABLE_FORMAT_SGI': 0x80D8, + 'COLOR_TABLE_WIDTH_SGI': 0x80D9, + 'COLOR_TABLE_RED_SIZE_SGI': 0x80DA, + 'COLOR_TABLE_GREEN_SIZE_SGI': 0x80DB, + 'COLOR_TABLE_BLUE_SIZE_SGI': 0x80DC, + 'COLOR_TABLE_ALPHA_SIZE_SGI': 0x80DD, + 'COLOR_TABLE_LUMINANCE_SIZE_SGI': 0x80DE, + 'COLOR_TABLE_INTENSITY_SIZE_SGI': 0x80DF, + 'TEXTURE_COLOR_TABLE_SGI': 0x80BC, + 'PROXY_TEXTURE_COLOR_TABLE_SGI': 0x80BD, + 'UNPACK_CONSTANT_DATA_SUNX': 0x81D5, + 'TEXTURE_CONSTANT_DATA_SUNX': 0x81D6, + 'WRAP_BORDER_SUN': 0x81D4, + 'GLOBAL_ALPHA_SUN': 0x81D9, + 'GLOBAL_ALPHA_FACTOR_SUN': 0x81DA, + 'QUAD_MESH_SUN': 0x8614, + 'TRIANGLE_MESH_SUN': 0x8615, + 'SLICE_ACCUM_SUN': 0x85CC, + 'RESTART_SUN': 0x01, + 'REPLACE_MIDDLE_SUN': 0x02, + 'REPLACE_OLDEST_SUN': 0x03, + 'TRIANGLE_LIST_SUN': 0x81D7, + 'REPLACEMENT_CODE_SUN': 0x81D8, + 'REPLACEMENT_CODE_ARRAY_SUN': 0x85C0, + 'REPLACEMENT_CODE_ARRAY_TYPE_SUN': 0x85C1, + 'REPLACEMENT_CODE_ARRAY_STRIDE_SUN': 0x85C2, + 'REPLACEMENT_CODE_ARRAY_POINTER_SUN': 0x85C3, + 'R1UI_V3F_SUN': 0x85C4, + 'R1UI_C4UB_V3F_SUN': 0x85C5, + 'R1UI_C3F_V3F_SUN': 0x85C6, + 'R1UI_N3F_V3F_SUN': 0x85C7, + 'R1UI_C4F_N3F_V3F_SUN': 0x85C8, + 'R1UI_T2F_V3F_SUN': 0x85C9, + 'R1UI_T2F_N3F_V3F_SUN': 0x85CA, + 'R1UI_T2F_C4F_N3F_V3F_SUN': 0x85CB, + 'PHONG_WIN': 0x80EA, + 'PHONG_HINT_WIN': 0x80EB, + 'PROGRAM_BINARY_RETRIEVABLE_HINT': 0x8257, + 'PROGRAM_BINARY_LENGTH': 0x8741, + 'PROGRAM_BINARY_FORMATS': 0x87FE, + 'NUM_PROGRAM_BINARY_FORMATS': 0x87FF, + 'PRIMITIVE_RESTART_FIXED_INDEX': 0x8D69, + 'FOG_SPECULAR_TEXTURE_WIN': 0x80EC +}; diff --git a/dom/canvas/test/webgl-conf/checkout/js/glsl-conformance-test.js b/dom/canvas/test/webgl-conf/checkout/js/glsl-conformance-test.js new file mode 100644 index 000000000..a4c93d7ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/glsl-conformance-test.js @@ -0,0 +1,393 @@ +/* +** 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. +*/ +GLSLConformanceTester = (function(){ + +var wtu = WebGLTestUtils; +var defaultVertexShader = [ + "attribute vec4 vPosition;", + "void main()", + "{", + " gl_Position = vPosition;", + "}" +].join('\n'); + +var defaultFragmentShader = [ + "precision mediump float;", + "void main()", + "{", + " gl_FragColor = vec4(1.0,0.0,0.0,1.0);", + "}" +].join('\n'); + +var defaultESSL3VertexShader = [ + "#version 300 es", + "in vec4 vPosition;", + "void main()", + "{", + " gl_Position = vPosition;", + "}" +].join('\n'); + +var defaultESSL3FragmentShader = [ + "#version 300 es", + "precision mediump float;", + "out vec4 my_FragColor;", + "void main()", + "{", + " my_FragColor = vec4(1.0,0.0,0.0,1.0);", + "}" +].join('\n'); + +function log(msg) { + bufferedLogToConsole(msg); +} + +var vShaderDB = {}; +var fShaderDB = {}; + +/** + * The info parameter should contain the following keys. Note that you may leave + * the parameters for one shader out, in which case the default shader will be + * used. + * vShaderSource: the source code for vertex shader + * vShaderId: id of an element containing vertex shader source code. Used if + * vShaderSource is not specified. + * vShaderSuccess: true if vertex shader compilation should + * succeed. + * fShaderSource: the source code for fragment shader + * fShaderId: id of an element containing fragment shader source code. Used if + * fShaderSource is not specified. + * fShaderSuccess: true if fragment shader compilation should + * succeed. + * linkSuccess: true if link should succeed + * passMsg: msg to describe success condition. + * render: if true render to unit quad. Green = success + * uniforms: an array of objects specifying uniforms to set prior to rendering. + * Each object should have the following keys: + * name: uniform variable name in the shader source. Uniform location will + * be queried based on its name. + * functionName: name of the function used to set the uniform. For example: + * 'uniform1i' + * value: value of the uniform to set. + */ +function runOneTest(gl, info) { + var passMsg = info.passMsg + debug(""); + debug("test: " + passMsg); + + var consoleDiv = document.getElementById("console"); + + var vIsDefault = false; + var fIsDefault = false; + + if (info.vShaderSource === undefined) { + if (info.vShaderId) { + info.vShaderSource = document.getElementById(info.vShaderId).text; + } else { + vIsDefault = true; + } + } + if (info.fShaderSource === undefined) { + if (info.fShaderId) { + info.fShaderSource = document.getElementById(info.fShaderId).text; + } else { + fIsDefault = true; + } + } + + var vLabel = (vIsDefault ? "default" : "test") + " vertex shader"; + var fLabel = (fIsDefault ? "default" : "test") + " fragment shader"; + if (vIsDefault) { + info.vShaderSource = defaultVertexShader; + info.vShaderSuccess = true; + } + if (fIsDefault) { + info.fShaderSource = defaultFragmentShader; + info.fShaderSuccess = true; + } + + if (vIsDefault != fIsDefault) { + // The language version of the default shader is chosen + // according to the language version of the other shader. + // We rely on "#version 300 es" being in this usual format. + // It must be on the first line of the shader according to the spec. + if (fIsDefault) { + // If we're using the default fragment shader, we need to make sure that + // it's language version matches with the vertex shader. + if (info.vShaderSource.split('\n')[0] == '#version 300 es') { + info.fShaderSource = defaultESSL3FragmentShader; + } + } else { + // If we're using the default vertex shader, we need to make sure that + // it's language version matches with the fragment shader. + if (info.fShaderSource.split('\n')[0] == '#version 300 es') { + info.vShaderSource = defaultESSL3VertexShader; + } + } + } + + var vSource = info.vShaderPrep ? info.vShaderPrep(info.vShaderSource) : + info.vShaderSource; + + if (!quietMode()) + wtu.addShaderSource(consoleDiv, vLabel, vSource); + + // Reuse identical shaders so we test shared shader. + var vShader = vShaderDB[vSource]; + if (!vShader) { + vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER); + if (info.vShaderTest) { + if (!info.vShaderTest(vShader)) { + testFailed("[vertex shader test] " + passMsg); + return; + } + } + // As per GLSL 1.0.17 10.27 we can only check for success on + // compileShader, not failure. + if (!info.ignoreResults && info.vShaderSuccess && !vShader) { + testFailed("[unexpected vertex shader compile status] (expected: " + + info.vShaderSuccess + ") " + passMsg); + } + // Save the shaders so we test shared shader. + if (vShader) { + vShaderDB[vSource] = vShader; + } + } + + var debugShaders = gl.getExtension('WEBGL_debug_shaders'); + if (debugShaders && vShader && !quietMode()) { + wtu.addShaderSource(consoleDiv, vLabel + " translated for driver", + debugShaders.getTranslatedShaderSource(vShader)); + } + + var fSource = info.fShaderPrep ? info.fShaderPrep(info.fShaderSource) : + info.fShaderSource; + + if (!quietMode()) + wtu.addShaderSource(consoleDiv, fLabel, fSource); + + // Reuse identical shaders so we test shared shader. + var fShader = fShaderDB[fSource]; + if (!fShader) { + fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER); + if (info.fShaderTest) { + if (!info.fShaderTest(fShader)) { + testFailed("[fragment shader test] " + passMsg); + return; + } + } + //debug(fShader == null ? "fail" : "succeed"); + // As per GLSL 1.0.17 10.27 we can only check for success on + // compileShader, not failure. + if (!info.ignoreResults && info.fShaderSuccess && !fShader) { + testFailed("[unexpected fragment shader compile status] (expected: " + + info.fShaderSuccess + ") " + passMsg); + return; + } + + // Safe the shaders so we test shared shader. + if (fShader) { + fShaderDB[fSource] = fShader; + } + } + + if (debugShaders && fShader && !quietMode()) { + wtu.addShaderSource(consoleDiv, fLabel + " translated for driver", + debugShaders.getTranslatedShaderSource(fShader)); + } + + if (vShader && fShader) { + var program = gl.createProgram(); + gl.attachShader(program, vShader); + gl.attachShader(program, fShader); + + if (vSource.indexOf("vPosition") >= 0) { + gl.bindAttribLocation(program, 0, "vPosition"); + } + if (vSource.indexOf("texCoord0") >= 0) { + gl.bindAttribLocation(program, 1, "texCoord0"); + } + gl.linkProgram(program); + var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0); + if (!linked) { + var error = gl.getProgramInfoLog(program); + log("*** Error linking program '"+program+"':"+error); + } + if (!info.ignoreResults && linked != info.linkSuccess) { + testFailed("[unexpected link status] " + passMsg); + return; + } + } else { + if (!info.ignoreResults && info.linkSuccess) { + testFailed("[link failed] " + passMsg); + return; + } + } + + if (parseInt(wtu.getUrlOptions().dumpShaders)) { + var vInfo = { + shader: vShader, + shaderSuccess: info.vShaderSuccess, + label: vLabel, + source: vSource + }; + var fInfo = { + shader: fShader, + shaderSuccess: info.fShaderSuccess, + label: fLabel, + source: fSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vInfo, fInfo); + } + + if (!info.render) { + testPassed(passMsg); + return; + } + + gl.useProgram(program); + + if (info.uniforms !== undefined) { + for (var i = 0; i < info.uniforms.length; ++i) { + var uniformLocation = gl.getUniformLocation(program, info.uniforms[i].name); + gl[info.uniforms[i].functionName](uniformLocation, info.uniforms[i].value); + debug(info.uniforms[i].name + ' set to ' + info.uniforms[i].value); + } + } + + wtu.setupUnitQuad(gl); + wtu.clearAndDrawUnitQuad(gl); + + var div = document.createElement("div"); + div.className = "testimages"; + wtu.insertImage(div, "result", wtu.makeImageFromCanvas(gl.canvas)); + div.appendChild(document.createElement('br')); + consoleDiv.appendChild(div); + + var tolerance = 0; + if (info.renderTolerance !== undefined) { + tolerance = info.renderTolerance; + } + wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", tolerance); +} + +function runTests(shaderInfos, opt_contextVersion) { + var wtu = WebGLTestUtils; + var canvas = document.createElement('canvas'); + canvas.width = 32; + canvas.height = 32; + var gl = wtu.create3DContext(canvas, undefined, opt_contextVersion); + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + var testIndex = 0; + var runNextTest = function() { + if (testIndex == shaderInfos.length) { + finishTest(); + return; + } + + runOneTest(gl, shaderInfos[testIndex++]); + setTimeout(runNextTest, 1); + } + runNextTest(); +}; + +function getSource(elem) { + var str = elem.text; + return str.replace(/^\s*/, '').replace(/\s*$/, ''); +} + +function getPassMessage(source) { + var lines = source.split('\n'); + return lines[0].substring(3); +} + +function getSuccess(msg) { + if (msg.indexOf("fail") >= 0) { + return false; + } + if (msg.indexOf("succeed") >= 0) { + return true; + } + testFailed("bad test description. Must have 'fail' or 'succeed'"); +} + +function setupTest() { + var info = {}; + + var vShaderElem = document.getElementById('vertexShader'); + if (vShaderElem) { + info.vShaderSource = getSource(vShaderElem); + info.passMsg = getPassMessage(info.vShaderSource); + info.vShaderSuccess = getSuccess(info.passMsg); + } + + var fShaderElem = document.getElementById('fragmentShader'); + if (fShaderElem) { + info.fShaderSource = getSource(fShaderElem); + info.passMsg = getPassMessage(info.fShaderSource); + info.fShaderSuccess = getSuccess(info.passMsg); + } + + // linkSuccess should be true if shader success value is undefined or true for both shaders. + info.linkSuccess = info.vShaderSuccess !== false && info.fShaderSuccess !== false; + + if (info.passMsg === undefined) { + testFailed("no test shader found."); + finishTest(); + return; + } + + return info; +} + +function runTest() { + var info = setupTest(); + description(info.passMsg); + runTests([info]); +} + +function runRenderTests(tests, opt_contextVersion) { + for (var ii = 0; ii < tests.length; ++ii) { + tests[ii].render = true + } + runTests(tests, opt_contextVersion); +} + +function runRenderTest() { + var info = setupTest(); + description(info.passMsg); + runRenderTests([info]); +} + +return { + runTest: runTest, + runTests: runTests, + runRenderTest: runRenderTest, + runRenderTests: runRenderTests +}; +}()); diff --git a/dom/canvas/test/webgl-conf/checkout/js/glsl-constructor-tests-generator.js b/dom/canvas/test/webgl-conf/checkout/js/glsl-constructor-tests-generator.js new file mode 100644 index 000000000..7f796c2cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/glsl-constructor-tests-generator.js @@ -0,0 +1,936 @@ +/* +** Copyright (c) 2014 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. +*/ + + +var GLSLConstructorTestsGenerator = (function() { + +var wtu = WebGLTestUtils; + +// Shader code templates +var constructorVertexTemplate = [ + "attribute vec4 vPosition;", + + "precision mediump int;", + "precision mediump float;", + + // Colors used to signal correctness of component values comparison + "const vec4 green = vec4(0.0, 1.0, 0.0, 1.0);", + "const vec4 red = vec4(1.0, 0.0, 0.0, 1.0);", + + // Error bound used in comparison of floating point values + "$(errorBound)", + + "varying vec4 vColor;", + + "void main() {", + " $(argsList)", + + " $(type) v = $(type)($(argsConstr));", + + " if ($(checkCompVals))", + " vColor = green;", + " else", + " vColor = red;", + + " gl_Position = vPosition;", + "}" +].join("\n"); + + +var passThroughColorFragmentShader = [ + "precision mediump float;", + + "varying vec4 vColor;", + + "void main() {", + " gl_FragColor = vColor;", + "}" +].join('\n'); + + +var constructorFragmentTemplate = [ + "precision mediump int;", + "precision mediump float;", + + // Colors used to signal correctness of component values comparison + "const vec4 green = vec4(0.0, 1.0, 0.0, 1.0); ", + "const vec4 red = vec4(1.0, 0.0, 0.0, 1.0); ", + + // Error bound used in comparison of floating point values + "$(errorBound)", + + "void main() {", + " $(argsList)", + + " $(type) v = $(type)($(argsConstr));", + + " if ($(checkCompVals))", + " gl_FragColor = green;", + " else", + " gl_FragColor = red;", + "}" +].join("\n"); + + +// Coding of the different argument types +// s : scalar +// v2 : vec2 +// v3 : vec3 +// v4 : vec4 +// m2 : mat2 +// m3 : mat3 +// m4 : mat4 + +// Returns the dimensions of the type +// Count of columns, count of rows +function getTypeCodeDimensions(typeCode) { + switch (typeCode) { + case "s": return [1, 1]; + case "v2": return [1, 2]; + case "v3": return [1, 3]; + case "v4": return [1, 4]; + case "m2": return [2, 2]; + case "m3": return [3, 3]; + case "m4": return [4, 4]; + + default: + wtu.error("GLSLConstructorTestsGenerator.getTypeCodeDimensions(), unknown type code"); + debugger; + } +}; + + +// Returns the component count for the type code +function getTypeCodeComponentCount(typeCode) { + var dim = getTypeCodeDimensions(typeCode); + + return dim[0] * dim[1]; +} + + +// Returns glsl name of type code +function getGLSLBaseTypeName(typeCode) { + switch(typeCode) { + case "s": return ""; + case "v2": return "vec2"; + case "v3": return "vec3"; + case "v4": return "vec4"; + case "m2": return "mat2"; + case "m3": return "mat3"; + case "m4": return "mat4"; + + default: + wtu.error("GLSLConstructorTestsGenerator.getGLSLBaseTypeName(), unknown type code"); + debugger; + } +} + + +// Returns the scalar glsl type name related to the structured type +function getGLSLScalarType(targetType) { + switch(targetType[0]) { + case 'i': return "int"; + case 'b': return "bool"; + + case 'v': + case 'm': + return "float"; + + default: + wtu.error("GLSLConstructorTestsGenerator.getGLSLScalarType(), unknown target type"); + debugger; + } +} + + +// Returns the scalar prefix for the associated scalar type +function getGLSLScalarPrefix(targetType) { + switch(targetType[0]) { + case 'i': + case 'b': + return targetType[0]; + + case 'v': + case 'm': + return ''; + + default: + wtu.error("GLSLConstructorTestsGenerator.getGLSLScalarPrefix(), unknown target type"); + debugger; + } +} + + +// Returns the type for a specified target type and argument type code +function getGLSLArgumentType(typeCode, targetType) { + var baseType = getGLSLBaseTypeName(typeCode); + if (baseType !== "") { + if (typeCode[0] === "v") { + // Vectors come in different flavours + return getGLSLScalarPrefix(targetType) + baseType; + } + else + return baseType; + } + else + return getGLSLScalarType(targetType); +} + + +// Returns the glsl type of the argument components +function getGLSLArgumentComponentType(argTypeCode, targetType) { + var scalarType; + + if (argTypeCode[0] === "m") { + // Matrices are always floats + scalarType = "float"; + } + else + scalarType = getGLSLScalarType(targetType); + + return scalarType; +} + + +function getGLSLColumnSize(targetType) { + colSize = parseInt(targetType.slice(-1)); + + if (!isNaN(colSize)) + return colSize; + + wtu.error("GLSLConstructorTestsGenerator.getGLSLColumnSize(), invalid target type"); + debugger; +} + + +// Returns correct string representation of scalar value +function getScalarTypeValStr(val, scalarType) { + if (val == null) + debugger; + + switch (scalarType) { + case "float": return val.toFixed(1); + case "int": return val; + case "bool": return (val === 0) ? "false" : "true"; + + default: + wtu.error("GLSLConstructorTestsGenerator.getScalarTypeValStr(), unknown scalar type"); + debugger; + } +} + + +// Returns true if the glsl type name is a matrix +function isGLSLTypeMatrix(type) { + return (type.indexOf("mat") !== -1); +} + + +// Returns true if the glsl type name is a vector +function isGLSLTypeVector(type) { + return (type.indexOf("vec") !== -1); +} + + +// Returns the count of components +function getGLSLTypeComponentCount(type) { + var colSize = getGLSLColumnSize(type); + + if (isGLSLTypeMatrix(type)) + return colSize * colSize; + else + return colSize; +} + + +// Returns the constructor expression with the components set to a sequence of scalar values +// Like vec3(1.0, 2.0, 3.0) +function getComponentSequenceConstructorExpression(typeCode, firstCompValue, targetType) { + var scalarType = getGLSLArgumentComponentType(typeCode, targetType); + + if (typeCode === "s") { + // Scalar + return getScalarTypeValStr(firstCompValue, scalarType) + ";"; + } + else { + // Structured typeargTypeCode[0] === "m" + compCount = getTypeCodeComponentCount(typeCode); + var constrExpParts = new Array(compCount); + for (var aa = 0; aa < compCount; ++aa) + constrExpParts[aa] = getScalarTypeValStr(firstCompValue + aa, scalarType); + + return getGLSLArgumentType(typeCode, targetType) + "(" + constrExpParts.join(", ") + ");"; + } +} + + +// Returns the expression to select a component of the structured type +function getComponentSelectorExpStr(targetType, compIx) { + if (isGLSLTypeMatrix(targetType)) { + var colRowIx = getColRowIndexFromLinearIndex(compIx, getGLSLColumnSize(targetType)); + return "v[" + colRowIx.colIx + "][" + colRowIx.rowIx + "]"; + } + else + return "v[" + compIx + "]"; +} + + +// Returns expression which validates the components set by the constructor expression +function getComponentValidationExpression(refCompVals, targetType) { + // Early out for invalid arguments + if (refCompVals.length === 0) + return "false"; + + var scalarType = getGLSLScalarType(targetType); + var checkComponentValueParts = new Array(refCompVals.length); + for (var cc = 0; cc < refCompVals.length; ++cc) { + var val_str = getScalarTypeValStr(refCompVals[cc], scalarType); + var comp_sel_exp = getComponentSelectorExpStr(targetType, cc); + if (scalarType === "float") { + // Comparison of floating point values with error bound + checkComponentValueParts[cc] = "abs(" + comp_sel_exp + " - " + val_str + ") <= errorBound"; + } + else { + // Simple comparison to expected value + checkComponentValueParts[cc] = comp_sel_exp + " == " + val_str; + } + } + + return checkComponentValueParts.join(" && "); +} + + +// Returns substitution parts to turn the shader template into testable shader code +function getTestShaderParts(targetType, argExp, firstCompValue) { + // glsl code of declarations of arguments + var argsListParts = new Array(argExp.length); + + // glsl code of constructor expression + var argsConstrParts = new Array(argExp.length); + + // glsl type expression + var typeExpParts = new Array(argExp.length); + for (var aa = 0; aa < argExp.length; ++aa) { + var typeCode = argExp[aa]; + var argCompCount = getTypeCodeComponentCount(typeCode); + var argName = "a" + aa; + var argType = getGLSLArgumentType(typeCode, targetType); + var argConstrExp = argType + " " + argName + " = " + getComponentSequenceConstructorExpression(typeCode, firstCompValue, targetType); + + // Add construction of one argument + // Indent if not first argument + argsListParts[aa] = ((aa > 0) ? " " : "") + argConstrExp; + + // Add argument name to target type argument list + argsConstrParts[aa] = argName; + + // Add type name to type expression + typeExpParts[aa] = argType; + + // Increment argument component value so all argument component arguments have a unique value + firstCompValue += argCompCount; + } + + return { + argsList: argsListParts.join("\n") + "\n", + argsConstr: argsConstrParts.join(", "), + typeExp: targetType + "(" + typeExpParts.join(", ") + ")" + }; +} + + +// Utility functions to manipulate the array of reference values + +// Returns array filled with identical values +function getArrayWithIdenticalValues(size, val) { + var matArray = new Array(size); + for (var aa = 0; aa < size; ++aa) + matArray[aa] = val; + + return matArray; +} + + +// Returns array filled with increasing values from a specified start value +function getArrayWithIncreasingValues(size, start) { + var matArray = new Array(size); + for (var aa = 0; aa < size; ++aa) + matArray[aa] = start + aa; + + return matArray; +} + + +// Utility functions to manipulate the array of reference values if the target type is a matrix + +// Returns an array which is the column order layout of a square matrix where the diagonal is set to a specified value +function matCompArraySetDiagonal(matArray, diagVal) { + // The entries for the diagonal start at array index 0 and increase + // by column size + 1 + var colSize = Math.round(Math.sqrt(matArray.length)); + var dIx = 0; + do { + matArray[dIx] = diagVal; + dIx += (colSize + 1); + } + while (dIx < colSize * colSize); + + return matArray; +} + + +// Returns an array which contains the values of an identity matrix read out in column order +function matCompArrayCreateDiagonalMatrix(colSize, diagVal) { + var size = colSize * colSize; + var matArray = new Array(size); + for (var aa = 0; aa < size; ++aa) + matArray[aa] = 0; + + return matCompArraySetDiagonal(matArray, diagVal); +} + + +// Returns the column and row index from the linear index if the components of the matrix are stored in column order in an array +// in a one dimensional array in column order +function getColRowIndexFromLinearIndex(linIx, colSize) { + return { + colIx: Math.floor(linIx / colSize), + rowIx: linIx % colSize + }; +} + + +// Returns the linear index for matrix column and row index for a specified matrix size +function getLinearIndexFromColRowIndex(rowColIx, colSize) { + return rowColIx.colIx * colSize + rowColIx.rowIx; +} + + +// Returns a matrix set from another matrix +function matCompArraySetMatrixFromMatrix(dstColSize, srcMatArray) { + // Overwrite components from destination with the source component values at the same col, row coordinates + var dstMatArray = matCompArrayCreateDiagonalMatrix(dstColSize, 1); + + var srcColSize = Math.round(Math.sqrt(srcMatArray.length)); + + for (var c_ix = 0; c_ix < srcMatArray.length; ++c_ix) { + var srcMatIx = getColRowIndexFromLinearIndex(c_ix, srcColSize); + if (srcMatIx.colIx < dstColSize && srcMatIx.rowIx < dstColSize) { + // Source matrix coordinates are valid destination matrix coordinates + dstMatArray[getLinearIndexFromColRowIndex(srcMatIx, dstColSize)] = srcMatArray[c_ix]; + } + } + + return dstMatArray; +} + + +// Returns the glsl code to verify if the components are set correctly +// and the message to display for the test +function getConstructorExpressionInfo(targetType, argExp, firstCompValue) { + var argCompCountsSum = 0; + var argCompCounts = new Array(argExp.length); + for (var aa = 0; aa < argExp.length; ++aa) { + argCompCounts[aa] = getTypeCodeComponentCount(argExp[aa]); + argCompCountsSum += argCompCounts[aa]; + } + + var targetCompCount = getGLSLTypeComponentCount(targetType); + + var refCompVals; + var testMsg; + var valid; + + if (argCompCountsSum === 0) { + // A constructor needs at least one argument + refCompVals = []; + testMsg = "invalid (no arguments)"; + valid = false; + } + else { + if (isGLSLTypeVector(targetType)) { + if (argCompCountsSum === 1) { + // One scalar argument + // Vector constructor with one scalar argument set all components to the same value + refCompVals = getArrayWithIdenticalValues(targetCompCount, firstCompValue); + testMsg = "valid (all components set to the same value)"; + valid = true; + } + else { + // Not one scalar argument + if (argCompCountsSum < targetCompCount) { + // Not all components set + refCompVals = []; + testMsg = "invalid (not enough arguments)"; + valid = false; + } + else { + // argCompCountsSum >= targetCompCount + // All components set + var lastArgFirstCompIx = argCompCountsSum - argCompCounts[argCompCounts.length - 1]; + + if (lastArgFirstCompIx < targetCompCount) { + // First component of last argument is used + refCompVals = getArrayWithIncreasingValues(targetCompCount, firstCompValue); + testMsg = "valid"; + valid = true; + } + else { + // First component of last argument is not used + refCompVals = []; + testMsg = "invalid (unused argument)"; + valid = false; + } + } + } + } + else { + // Matrix target type + if (argCompCountsSum === 1) { + // One scalar argument + // Matrix constructors with one scalar set all components on the diagonal to the same value + // All other components are set to zero + refCompVals = matCompArrayCreateDiagonalMatrix(Math.round(Math.sqrt(targetCompCount)), firstCompValue); + testMsg = "valid (diagonal components set to the same value, off-diagonal components set to zero)"; + valid = true; + } + else { + // Not one scalar argument + if (argExp.length === 1 && argExp[0][0] === "m") { + // One single matrix argument + var dstColSize = getGLSLColumnSize(targetType); + refCompVals = matCompArraySetMatrixFromMatrix(dstColSize, getArrayWithIncreasingValues(getTypeCodeComponentCount(argExp[0]), firstCompValue)); + testMsg = "valid, components at corresponding col, row indices are set from argument, other components are set from identity matrix"; + valid = true; + } + else { + // More than one argument or one argument not of type matrix + // Can be treated in the same manner + // Arguments can not be of type matrix + var matFound = false; + for (var aa = 0; aa < argExp.length; ++aa) + if (argExp[aa][0] === "m") + matFound = true; + + if (matFound) { + refCompVals = []; + testMsg = "invalid, argument list greater than one contains matrix type"; + valid = false; + } + else { + if (argCompCountsSum < targetCompCount) { + refCompVals = []; + testMsg = "invalid (not enough arguments)"; + valid = false; + } + else { + // argCompCountsSum >= targetCompCount + // All components set + var lastArgFirstCompIx = argCompCountsSum - argCompCounts[argCompCounts.length - 1]; + + if (lastArgFirstCompIx < targetCompCount) { + // First component of last argument is used + refCompVals = getArrayWithIncreasingValues(targetCompCount, firstCompValue); + testMsg = "valid"; + valid = true; + } + else { + // First component of last argument is not used + refCompVals = []; + testMsg = "invalid (unused argument)"; + valid = false; + } + } + } + } + } + } + } + + // Check if no case is missed + if (testMsg == null || valid == null) { + wtu.error("GLSLConstructorTestsGenerator.getConstructorExpressionInfo(), info not set"); + debugger; + } + + return { + refCompVals: refCompVals, + testMsg: testMsg, + valid: valid + }; +} + + +// Returns a vertex shader testcase and a fragment shader testcase +function getVertexAndFragmentShaderTestCase(targetType, argExp) { + var firstCompValue = 0; + if (isGLSLTypeMatrix(targetType)) { + // Use value different from 0 and 1 + // 0 and 1 are values used by matrix constructed from a matrix or a single scalar + firstCompValue = 2; + } + + var argCode = getTestShaderParts (targetType, argExp, firstCompValue); + var expInfo = getConstructorExpressionInfo(targetType, argExp, firstCompValue); + + var substitutions = { + type: targetType, + errorBound: (getGLSLScalarType(targetType) === "float") ? "const float errorBound = 1.0E-5;" : "", + argsList: argCode.argsList, + argsConstr: argCode.argsConstr, + checkCompVals: getComponentValidationExpression(expInfo.refCompVals, targetType) + }; + + return [ { + // Test constructor argument list in vertex shader + vShaderSource: wtu.replaceParams(constructorVertexTemplate, substitutions), + vShaderSuccess: expInfo.valid, + fShaderSource: passThroughColorFragmentShader, + fShaderSuccess: true, + linkSuccess: expInfo.valid, + passMsg: "Vertex shader : " + argCode.typeExp + ", " + expInfo.testMsg, + render: expInfo.valid + }, { + // Test constructor argument list in fragment shader + fShaderSource: wtu.replaceParams(constructorFragmentTemplate, substitutions), + fShaderSuccess: expInfo.valid, + linkSuccess: expInfo.valid, + passMsg: "Fragment shader : " + argCode.typeExp + ", " + expInfo.testMsg, + render: expInfo.valid + } + ]; +} + + +// Incrementing the argument expressions +// Utility object which defines the order of incrementing the argument types +var typeCodeIncrementer = { + s: { typeCode: "v2", order: 0 }, + v2: { typeCode: "v3", order: 1 }, + v3: { typeCode: "v4", order: 2 }, + v4: { typeCode: "m2", order: 3 }, + m2: { typeCode: "m3", order: 4 }, + m3: { typeCode: "m4", order: 5 }, + m4: { typeCode: "s", order: 6 }, + first: "s" +} + + +// Returns the next argument sequence +function getNextArgumentSequence(inSeq) { + var nextSeq; + if (inSeq.length === 0) { + // Current argument sequence is empty, add first argument + nextSeq = [typeCodeIncrementer.first]; + } + else { + nextSeq = new Array(inSeq.length); + var overflow = true; + for (var aa = 0; aa < inSeq.length; ++aa) { + var currArg = inSeq[aa]; + if (overflow) { + // Increment the current argument type + var nextArg = typeCodeIncrementer[currArg].typeCode; + nextSeq[aa] = nextArg; + overflow = (nextArg === typeCodeIncrementer.first); + } + else { + // Copy remainder of sequence + nextSeq[aa] = currArg; + } + } + + if (overflow) { + nextSeq.push(typeCodeIncrementer.first); + } + } + + return nextSeq; +} + + +// Returns true if two argument expressions are equal +function areArgExpEqual(expA, expB) { + if (expA.length !== expB.length) + return false; + + for (var aa = 0; aa < expA.length; ++aa) + if (expA[aa] !== expB[aa]) + return false; + + return true; +} + + +// Returns true if first argument expression is smaller +// (comes before the second one in iterating order) +// compared to the second argument expression +function isArgExpSmallerOrEqual(argExpA, argExpB) { + var aLen = argExpA.length; + var bLen = argExpB.length; + if (aLen !== bLen) + return (aLen < bLen); + + // Argument type expression lengths are equal + for (var aa = aLen - 1; aa >= 0; --aa) { + var argA = argExpA[aa]; + var argB = argExpB[aa]; + + if (argA !== argB) { + var aOrder = typeCodeIncrementer[argA].order; + var bOrder = typeCodeIncrementer[argB].order; + if (aOrder !== bOrder) + return (aOrder < bOrder); + } + } + + // Argument type expressions are equal + return true; +} + + +// Returns the next argument expression from sequence set +// Returns null if end is reached +function getNextArgumentExpression(testExp, testSet) { + var testInterval = testSet[testExp.ix]; + + if (areArgExpEqual(testExp.argExp, testInterval[1])) { + // End of current interval reached + if (testExp.ix === testSet.length - 1) { + // End of set reached + return null; + } + else { + // Return first argument expression of next interval + var nextIx = testExp.ix + 1; + return { ix: nextIx, argExp: testSet[nextIx][0] }; + } + } + else { + // Return next expression in current interval + return { ix: testExp.ix, argExp: getNextArgumentSequence(testExp.argExp) }; + } +} + + +// Returns an array of the parts in the string separated by commas and with the white space trimmed +function convertCsvToArray(str) { + // Checks type codes in input + function checkInput(el, ix, arr) { + var typeCode = el.trim(); + if (!(typeCode in typeCodeIncrementer) && typeCode !== "first") { + wtu.error("GLSLConstructorTestsGenerator.convertCsvToArray(), unknown type code" + typeCode); + debugger; + } + + arr[ix] = typeCode; + } + + var spArr = str.split(","); + + // Convert empty string to empty array + if (spArr.length === 1 && spArr[0].trim() === "") + spArr = []; + + spArr.forEach(checkInput); + + return spArr; +} + + +// Processes the set of specified test sequences +function processInputs(testSequences) { + var testSet = new Array(testSequences.length); + for (var tt = 0; tt < testSequences.length; ++tt) { + var interval = testSequences[tt]; + var bounds = interval.split("-"); + var begin = convertCsvToArray(bounds[0]); + var end = convertCsvToArray(bounds[bounds.length - 1]); + + // Check if interval is valid + if (!isArgExpSmallerOrEqual(begin, end)) { + wtu.error("GLSLConstructorTestsGenerator.processInputs(), interval not valid"); + debugger; + } + + testSet[tt] = [ begin, end ]; + } + + return testSet; +} + + +/** + * Returns list of test cases for vector types + * All combinations of arguments up to one unused argument of one component are tested + * @param {targetType} Name of target type to test the constructor expressions on + * @param {testSet} Set of intervals of argument sequences to test + */ +function getConstructorTests(targetType, testSequences) { + // List of tests to return + var testInfos = []; + + // List of argument types + var testSet = processInputs(testSequences); + var testExp = { ix: 0, argExp: testSet[0][0] }; + + do { + // Add one vertex shader test case and one fragment shader test case + testInfos = testInfos.concat(getVertexAndFragmentShaderTestCase(targetType, testExp.argExp)); + + // Generate next argument expression + testExp = getNextArgumentExpression(testExp, testSet); + } + while (testExp != null); + + return testInfos; +} + + +// Returns default test argument expression set +// For details on input format : see bottom of file +function getDefaultTestSet(targetType) { + switch(targetType) { + case "vec2": + case "ivec2": + case "bvec2": + return [ + // No arguments and all single argument expressions + " - m4", + + // All two argument expressions with a scalar as second argument + "s, s - m4, s", + + // All two arguments expressions with a scalar as first argument + "s, v2", "s, v3", "s, v4", "s, m2", "s, m3", "s, m4", + + // Three argument expression + "s, s, s" + ]; + + case "vec3": + case "ivec3": + case "bvec3": + return [ + // No arguments and all single argument expressions + " - m4", + + // All two argument expressions with a scalar as second argument + "s, s - m4, s", + + // All two argument expressions with a scalar as first argument + "s, v2", "s, v3", "s, v4", "s, m2", "s, m3", "s, m4", + + // All three argument expressions with two scalars as second and third argument + "s, s, s - m4, s, s", + + // All three argument expressions with two scalars as first and second argument + "s, s, v2", "s, s, v3", "s, s, v4", "s, s, m2", "s, s, m3", "s, s, m4", + + // Four argument expression + "s, s, s, s" + ]; + + case "vec4": + case "ivec4": + case "bvec4": + case "mat2": + return [ + // No arguments and all single argument expressions + " - m4", + + // All two argument expressions with a scalar as second argument + "s, s - m4, s", + + // All two argument expressions with a scalar as first argument + "s, v2", "s, v3", "s, v4", "s, m2", "s, m3", "s, m4", + + // All three argument expressions with two scalars as second and third argument + "s, s, s - m4, s, s", + + // All three argument expressions with two scalars as first and second argument + "s, s, v2", "s, s, v3", "s, s, v4", "s, s, m2", "s, s, m3", "s, s, m4", + + // All four argument expressions with three scalars as second, third and fourth argument + "s, s, s, s - m4, s, s, s", + + // All four argument expressions with three scalars as first, second and third argument + "s, s, s, v2", "s, s, s, v3", "s, s, s, v4", "s, s, s, m2", "s, s, s, m3", "s, s, s, m4", + + // Five argument expression + "s, s, s, s, s" + ]; + + case "mat3": + case "mat4": + return [ + // No arguments and all single argument expressions + " - m4", + + // All two argument expressions with a scalar as second argument + "s, s - m4, s", + + // All two argument expressions with a scalar as first argument + "s, v2", "s, v3", "s, v4", "s, m2", "s, m3", "s, m4", + + // Several argument sequences + "v4, s, v4", "v4, s, v3, v2", "v4, v4, v3, v2", "v4, v4, v4, v4", "v2, v2, v2, v2, v2", "v2, v2, v2, v2, v2, v2, v2, v2", + "v3, v3, v3", "v3, v3, v3, s", "v3, v3, v3, v3, v3, s", "v3, v3, v3, v3, v3, s, s", + ]; + } +} + + +// Return publics +return { + getConstructorTests: getConstructorTests, + getDefaultTestSet: getDefaultTestSet +}; + +}()); + + +// Input is an array of intervals of argument types +// The generated test argument sequences are from (including) the lower interval boundary +// until (including) the upper boundary +// Coding and order of the different argument types : +// s : scalar +// v2 : vec2 +// v3 : vec3 +// v4 : vec4 +// m2 : mat2 +// m3 : mat3 +// m4 : mat4 + +// One interval is put in one string +// Low and high bound are separated by a dash. +// If there is no dash it is regarded as an interval of one expression +// The individual argument codes are separated by commas +// The individual arguments are incremented from left to right +// The left most argument is the one which is incremented first +// Once the left most arguments wraps the second argument is increased +// Examples : +// "s - m4" : All single arguments from scalar up to (including) mat4 +// "m2, s - m4, s" : All two argument expressions with a matrix argument as first argument and a scalar as second argument +// " - m4, m4" : The empty argument, all one arguments and all two argument expressions +// "m2, s, v3, m4" : One 4 argument expression : mat2, scalar, vec3, mat4 diff --git a/dom/canvas/test/webgl-conf/checkout/js/glsl-generator.js b/dom/canvas/test/webgl-conf/checkout/js/glsl-generator.js new file mode 100644 index 000000000..dbb97eb02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/glsl-generator.js @@ -0,0 +1,1251 @@ +/* +** 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. +*/ +GLSLGenerator = (function() { + +var vertexShaderTemplate = [ + "attribute vec4 aPosition;", + "", + "varying vec4 vColor;", + "", + "$(extra)", + "$(emu)", + "", + "void main()", + "{", + " gl_Position = aPosition;", + " vec2 texcoord = vec2(aPosition.xy * 0.5 + vec2(0.5, 0.5));", + " vec4 color = vec4(", + " texcoord,", + " texcoord.x * texcoord.y,", + " (1.0 - texcoord.x) * texcoord.y * 0.5 + 0.5);", + " $(test)", + "}" +].join("\n"); + +var fragmentShaderTemplate = [ + "precision mediump float;", + "", + "varying vec4 vColor;", + "", + "$(extra)", + "$(emu)", + "", + "void main()", + "{", + " $(test)", + "}" +].join("\n"); + +var baseVertexShader = [ + "attribute vec4 aPosition;", + "", + "varying vec4 vColor;", + "", + "void main()", + "{", + " gl_Position = aPosition;", + " vec2 texcoord = vec2(aPosition.xy * 0.5 + vec2(0.5, 0.5));", + " vColor = vec4(", + " texcoord,", + " texcoord.x * texcoord.y,", + " (1.0 - texcoord.x) * texcoord.y * 0.5 + 0.5);", + "}" +].join("\n"); + +var baseVertexShaderWithColor = [ + "attribute vec4 aPosition;", + "attribute vec4 aColor;", + "", + "varying vec4 vColor;", + "", + "void main()", + "{", + " gl_Position = aPosition;", + " vColor = aColor;", + "}" +].join("\n"); + +var baseFragmentShader = [ + "precision mediump float;", + "varying vec4 vColor;", + "", + "void main()", + "{", + " gl_FragColor = vColor;", + "}" +].join("\n"); + +var types = [ + { type: "float", + code: [ + "float $(func)_emu($(args)) {", + " return $(func)_base($(baseArgs));", + "}"].join("\n") + }, + { type: "vec2", + code: [ + "vec2 $(func)_emu($(args)) {", + " return vec2(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)));", + "}"].join("\n") + }, + { type: "vec3", + code: [ + "vec3 $(func)_emu($(args)) {", + " return vec3(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)));", + "}"].join("\n") + }, + { type: "vec4", + code: [ + "vec4 $(func)_emu($(args)) {", + " return vec4(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)),", + " $(func)_base($(baseArgsW)));", + "}"].join("\n") + } +]; + +var bvecTypes = [ + { type: "bvec2", + code: [ + "bvec2 $(func)_emu($(args)) {", + " return bvec2(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)));", + "}"].join("\n") + }, + { type: "bvec3", + code: [ + "bvec3 $(func)_emu($(args)) {", + " return bvec3(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)));", + "}"].join("\n") + }, + { type: "bvec4", + code: [ + "vec4 $(func)_emu($(args)) {", + " return bvec4(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)),", + " $(func)_base($(baseArgsW)));", + "}"].join("\n") + } +]; + +var replaceRE = /\$\((\w+)\)/g; + +var replaceParams = function(str) { + var args = arguments; + return str.replace(replaceRE, function(str, p1, offset, s) { + for (var ii = 1; ii < args.length; ++ii) { + if (args[ii][p1] !== undefined) { + return args[ii][p1]; + } + } + throw "unknown string param '" + p1 + "'"; + }); +}; + +var generateReferenceShader = function( + shaderInfo, template, params, typeInfo, test) { + var input = shaderInfo.input; + var output = shaderInfo.output; + var feature = params.feature; + var testFunc = params.testFunc; + var emuFunc = params.emuFunc || ""; + var extra = params.extra || ''; + var args = params.args || "$(type) value"; + var type = typeInfo.type; + var typeCode = typeInfo.code; + + var baseArgs = params.baseArgs || "value$(field)"; + var baseArgsX = replaceParams(baseArgs, {field: ".x"}); + var baseArgsY = replaceParams(baseArgs, {field: ".y"}); + var baseArgsZ = replaceParams(baseArgs, {field: ".z"}); + var baseArgsW = replaceParams(baseArgs, {field: ".w"}); + var baseArgs = replaceParams(baseArgs, {field: ""}); + + test = replaceParams(test, { + input: input, + output: output, + func: feature + "_emu" + }); + emuFunc = replaceParams(emuFunc, { + func: feature + }); + args = replaceParams(args, { + type: type + }); + typeCode = replaceParams(typeCode, { + func: feature, + type: type, + args: args, + baseArgs: baseArgs, + baseArgsX: baseArgsX, + baseArgsY: baseArgsY, + baseArgsZ: baseArgsZ, + baseArgsW: baseArgsW + }); + var shader = replaceParams(template, { + extra: extra, + emu: emuFunc + "\n\n" + typeCode, + test: test + }); + return shader; +}; + +var generateTestShader = function( + shaderInfo, template, params, test) { + var input = shaderInfo.input; + var output = shaderInfo.output; + var feature = params.feature; + var testFunc = params.testFunc; + var extra = params.extra || ''; + + test = replaceParams(test, { + input: input, + output: output, + func: feature + }); + var shader = replaceParams(template, { + extra: extra, + emu: '', + test: test + }); + return shader; +}; + +function _reportResults(refData, refImg, testData, testImg, tolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv) { + var same = true; + var firstFailure = null; + for (var yy = 0; yy < height; ++yy) { + for (var xx = 0; xx < width; ++xx) { + var offset = (yy * width + xx) * 4; + var imgOffset = ((height - yy - 1) * width + xx) * 4; + imgData.data[imgOffset + 0] = 0; + imgData.data[imgOffset + 1] = 0; + imgData.data[imgOffset + 2] = 0; + imgData.data[imgOffset + 3] = 255; + if (Math.abs(refData[offset + 0] - testData[offset + 0]) > tolerance || + Math.abs(refData[offset + 1] - testData[offset + 1]) > tolerance || + Math.abs(refData[offset + 2] - testData[offset + 2]) > tolerance || + Math.abs(refData[offset + 3] - testData[offset + 3]) > tolerance) { + var detail = 'at (' + xx + ',' + yy + '): ref=(' + + refData[offset + 0] + ',' + + refData[offset + 1] + ',' + + refData[offset + 2] + ',' + + refData[offset + 3] + ') test=(' + + testData[offset + 0] + ',' + + testData[offset + 1] + ',' + + testData[offset + 2] + ',' + + testData[offset + 3] + ') tolerance=' + tolerance; + consoleDiv.appendChild(document.createTextNode(detail)); + consoleDiv.appendChild(document.createElement('br')); + if (!firstFailure) { + firstFailure = ": " + detail; + } + imgData.data[imgOffset] = 255; + same = false; + } + } + } + + var diffImg = null; + if (!same) { + ctx.putImageData(imgData, 0, 0); + diffImg = wtu.makeImageFromCanvas(canvas2d); + } + + var div = document.createElement("div"); + div.className = "testimages"; + wtu.insertImage(div, "ref", refImg); + wtu.insertImage(div, "test", testImg); + if (diffImg) { + wtu.insertImage(div, "diff", diffImg); + } + div.appendChild(document.createElement('br')); + + consoleDiv.appendChild(div); + + if (!same) { + testFailed("images are different" + (firstFailure ? firstFailure : "")); + } else { + testPassed("images are the same"); + } + + consoleDiv.appendChild(document.createElement('hr')); +} + +var runFeatureTest = function(params) { + var wtu = WebGLTestUtils; + var gridRes = params.gridRes; + var vertexTolerance = params.tolerance || 0; + var fragmentTolerance = params.tolerance || 1; + if ('fragmentTolerance' in params) + fragmentTolerance = params.fragmentTolerance; + + description("Testing GLSL feature: " + params.feature); + + var width = 32; + var height = 32; + + var consoleDiv = document.getElementById("console"); + var canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + var gl = wtu.create3DContext(canvas, { premultipliedAlpha: false }); + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + var canvas2d = document.createElement('canvas'); + canvas2d.width = width; + canvas2d.height = height; + var ctx = canvas2d.getContext("2d"); + var imgData = ctx.getImageData(0, 0, width, height); + + var shaderInfos = [ + { type: "vertex", + input: "color", + output: "vColor", + vertexShaderTemplate: vertexShaderTemplate, + fragmentShaderTemplate: baseFragmentShader, + tolerance: vertexTolerance + }, + { type: "fragment", + input: "vColor", + output: "gl_FragColor", + vertexShaderTemplate: baseVertexShader, + fragmentShaderTemplate: fragmentShaderTemplate, + tolerance: fragmentTolerance + } + ]; + for (var ss = 0; ss < shaderInfos.length; ++ss) { + var shaderInfo = shaderInfos[ss]; + var tests = params.tests; + var testTypes = params.emuFuncs || (params.bvecTest ? bvecTypes : types); + // Test vertex shaders + for (var ii = 0; ii < tests.length; ++ii) { + var type = testTypes[ii]; + if (params.simpleEmu) { + type = { + type: type.type, + code: params.simpleEmu + }; + } + debug(""); + var str = replaceParams(params.testFunc, { + func: params.feature, + type: type.type, + arg0: type.type + }); + var passMsg = "Testing: " + str + " in " + shaderInfo.type + " shader"; + debug(passMsg); + + var referenceVertexShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + type, + tests[ii]); + var referenceFragmentShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + type, + tests[ii]); + var testVertexShaderSource = generateTestShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + tests[ii]); + var testFragmentShaderSource = generateTestShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + tests[ii]); + + + debug(""); + var referenceVertexShader = wtu.loadShader(gl, referenceVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'reference'); + var referenceFragmentShader = wtu.loadShader(gl, referenceFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'reference'); + var testVertexShader = wtu.loadShader(gl, testVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'test'); + var testFragmentShader = wtu.loadShader(gl, testFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'test'); + debug(""); + + if (parseInt(wtu.getUrlOptions().dumpShaders)) { + var vRefInfo = { + shader: referenceVertexShader, + shaderSuccess: true, + label: "reference vertex shader", + source: referenceVertexShaderSource + }; + var fRefInfo = { + shader: referenceFragmentShader, + shaderSuccess: true, + label: "reference fragment shader", + source: referenceFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vRefInfo, fRefInfo); + + var vTestInfo = { + shader: testVertexShader, + shaderSuccess: true, + label: "test vertex shader", + source: testVertexShaderSource + }; + var fTestInfo = { + shader: testFragmentShader, + shaderSuccess: true, + label: "test fragment shader", + source: testFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vTestInfo, fTestInfo); + } + + var refData = draw( + referenceVertexShader, referenceFragmentShader); + var refImg = wtu.makeImageFromCanvas(canvas); + if (ss == 0) { + var testData = draw( + testVertexShader, referenceFragmentShader); + } else { + var testData = draw( + referenceVertexShader, testFragmentShader); + } + var testImg = wtu.makeImageFromCanvas(canvas); + + _reportResults(refData, refImg, testData, testImg, shaderInfo.tolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv); + } + } + + finishTest(); + + function draw(vertexShader, fragmentShader) { + var program = wtu.createProgram(gl, vertexShader, fragmentShader, testFailed); + + var posLoc = gl.getAttribLocation(program, "aPosition"); + wtu.setupIndexedQuad(gl, gridRes, posLoc); + + gl.useProgram(program); + wtu.clearAndDrawIndexedQuad(gl, gridRes, [0, 0, 255, 255]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + +}; + +var runBasicTest = function(params) { + var wtu = WebGLTestUtils; + var gridRes = params.gridRes; + var vertexTolerance = params.tolerance || 0; + var fragmentTolerance = vertexTolerance; + if ('fragmentTolerance' in params) + fragmentTolerance = params.fragmentTolerance || 0; + + description("Testing : " + document.getElementsByTagName("title")[0].innerText); + + var width = 32; + var height = 32; + + var consoleDiv = document.getElementById("console"); + var canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + var gl = wtu.create3DContext(canvas); + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + var canvas2d = document.createElement('canvas'); + canvas2d.width = width; + canvas2d.height = height; + var ctx = canvas2d.getContext("2d"); + var imgData = ctx.getImageData(0, 0, width, height); + + var shaderInfos = [ + { type: "vertex", + input: "color", + output: "vColor", + vertexShaderTemplate: vertexShaderTemplate, + fragmentShaderTemplate: baseFragmentShader, + tolerance: vertexTolerance + }, + { type: "fragment", + input: "vColor", + output: "gl_FragColor", + vertexShaderTemplate: baseVertexShader, + fragmentShaderTemplate: fragmentShaderTemplate, + tolerance: fragmentTolerance + } + ]; + for (var ss = 0; ss < shaderInfos.length; ++ss) { + var shaderInfo = shaderInfos[ss]; + var tests = params.tests; +// var testTypes = params.emuFuncs || (params.bvecTest ? bvecTypes : types); + // Test vertex shaders + for (var ii = 0; ii < tests.length; ++ii) { + var test = tests[ii]; + debug(""); + var passMsg = "Testing: " + test.name + " in " + shaderInfo.type + " shader"; + debug(passMsg); + + function genShader(shaderInfo, template, shader, subs) { + shader = replaceParams(shader, subs, { + input: shaderInfo.input, + output: shaderInfo.output + }); + shader = replaceParams(template, subs, { + test: shader, + emu: "", + extra: "" + }); + return shader; + } + + var referenceVertexShaderSource = genShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + test.reference.shader, + test.reference.subs); + var referenceFragmentShaderSource = genShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + test.reference.shader, + test.reference.subs); + var testVertexShaderSource = genShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + test.test.shader, + test.test.subs); + var testFragmentShaderSource = genShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + test.test.shader, + test.test.subs); + + debug(""); + var referenceVertexShader = wtu.loadShader(gl, referenceVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'reference'); + var referenceFragmentShader = wtu.loadShader(gl, referenceFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'reference'); + var testVertexShader = wtu.loadShader(gl, testVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'test'); + var testFragmentShader = wtu.loadShader(gl, testFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'test'); + debug(""); + + if (parseInt(wtu.getUrlOptions().dumpShaders)) { + var vRefInfo = { + shader: referenceVertexShader, + shaderSuccess: true, + label: "reference vertex shader", + source: referenceVertexShaderSource + }; + var fRefInfo = { + shader: referenceFragmentShader, + shaderSuccess: true, + label: "reference fragment shader", + source: referenceFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vRefInfo, fRefInfo); + + var vTestInfo = { + shader: testVertexShader, + shaderSuccess: true, + label: "test vertex shader", + source: testVertexShaderSource + }; + var fTestInfo = { + shader: testFragmentShader, + shaderSuccess: true, + label: "test fragment shader", + source: testFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vTestInfo, fTestInfo); + } + + var refData = draw(referenceVertexShader, referenceFragmentShader); + var refImg = wtu.makeImageFromCanvas(canvas); + if (ss == 0) { + var testData = draw(testVertexShader, referenceFragmentShader); + } else { + var testData = draw(referenceVertexShader, testFragmentShader); + } + var testImg = wtu.makeImageFromCanvas(canvas); + + _reportResults(refData, refImg, testData, testImg, shaderInfo.tolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv); + } + } + + finishTest(); + + function draw(vertexShader, fragmentShader) { + var program = wtu.createProgram(gl, vertexShader, fragmentShader, testFailed); + + var posLoc = gl.getAttribLocation(program, "aPosition"); + wtu.setupIndexedQuad(gl, gridRes, posLoc); + + gl.useProgram(program); + wtu.clearAndDrawIndexedQuad(gl, gridRes, [0, 0, 255, 255]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + +}; + +var runReferenceImageTest = function(params) { + var wtu = WebGLTestUtils; + var gridRes = params.gridRes; + var vertexTolerance = params.tolerance || 0; + var fragmentTolerance = vertexTolerance; + if ('fragmentTolerance' in params) + fragmentTolerance = params.fragmentTolerance || 0; + + description("Testing GLSL feature: " + params.feature); + + var width = 32; + var height = 32; + + var consoleDiv = document.getElementById("console"); + var canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + var gl = wtu.create3DContext(canvas, { antialias: false, premultipliedAlpha: false }); + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + var canvas2d = document.createElement('canvas'); + canvas2d.width = width; + canvas2d.height = height; + var ctx = canvas2d.getContext("2d"); + var imgData = ctx.getImageData(0, 0, width, height); + + // State for reference images for vertex shader tests. + // These are drawn with the same tessellated grid as the test vertex + // shader so that the interpolation is identical. The grid is reused + // from test to test; the colors are changed. + + var indexedQuadForReferenceVertexShader = + wtu.setupIndexedQuad(gl, gridRes, 0); + var referenceVertexShaderProgram = + wtu.setupProgram(gl, [ baseVertexShaderWithColor, baseFragmentShader ], + ["aPosition", "aColor"]); + var referenceVertexShaderColorBuffer = gl.createBuffer(); + + var shaderInfos = [ + { type: "vertex", + input: "color", + output: "vColor", + vertexShaderTemplate: vertexShaderTemplate, + fragmentShaderTemplate: baseFragmentShader, + tolerance: vertexTolerance + }, + { type: "fragment", + input: "vColor", + output: "gl_FragColor", + vertexShaderTemplate: baseVertexShader, + fragmentShaderTemplate: fragmentShaderTemplate, + tolerance: fragmentTolerance + } + ]; + for (var ss = 0; ss < shaderInfos.length; ++ss) { + var shaderInfo = shaderInfos[ss]; + var tests = params.tests; + var testTypes = params.emuFuncs || (params.bvecTest ? bvecTypes : types); + // Test vertex shaders + for (var ii = 0; ii < tests.length; ++ii) { + var type = testTypes[ii]; + var isVertex = (ss == 0); + debug(""); + var str = replaceParams(params.testFunc, { + func: params.feature, + type: type.type, + arg0: type.type + }); + var passMsg = "Testing: " + str + " in " + shaderInfo.type + " shader"; + debug(passMsg); + + var referenceVertexShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + type, + tests[ii].source); + var referenceFragmentShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + type, + tests[ii].source); + var testVertexShaderSource = generateTestShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + tests[ii].source); + var testFragmentShaderSource = generateTestShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + tests[ii].source); + var referenceTextureOrArray = generateReferenceImage( + gl, + tests[ii].generator, + isVertex ? gridRes : width, + isVertex ? gridRes : height, + isVertex); + + debug(""); + var testVertexShader = wtu.loadShader(gl, testVertexShaderSource, gl.VERTEX_SHADER, testFailed, true); + var testFragmentShader = wtu.loadShader(gl, testFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true); + debug(""); + + + if (parseInt(wtu.getUrlOptions().dumpShaders)) { + var vRefInfo = { + shader: referenceVertexShader, + shaderSuccess: true, + label: "reference vertex shader", + source: referenceVertexShaderSource + }; + var fRefInfo = { + shader: referenceFragmentShader, + shaderSuccess: true, + label: "reference fragment shader", + source: referenceFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vRefInfo, fRefInfo); + + var vTestInfo = { + shader: testVertexShader, + shaderSuccess: true, + label: "test vertex shader", + source: testVertexShaderSource + }; + var fTestInfo = { + shader: testFragmentShader, + shaderSuccess: true, + label: "test fragment shader", + source: testFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vTestInfo, fTestInfo); + } + + var refData; + if (isVertex) { + refData = drawVertexReferenceImage(referenceTextureOrArray); + } else { + refData = drawFragmentReferenceImage(referenceTextureOrArray); + } + var refImg = wtu.makeImageFromCanvas(canvas); + var testData; + if (isVertex) { + var referenceFragmentShader = wtu.loadShader(gl, referenceFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed); + testData = draw( + testVertexShader, referenceFragmentShader); + } else { + var referenceVertexShader = wtu.loadShader(gl, referenceVertexShaderSource, gl.VERTEX_SHADER, testFailed); + testData = draw( + referenceVertexShader, testFragmentShader); + } + var testImg = wtu.makeImageFromCanvas(canvas); + var testTolerance = shaderInfo.tolerance; + // Provide per-test tolerance so that we can increase it only for those desired. + if ('tolerance' in tests[ii]) + testTolerance = tests[ii].tolerance || 0; + _reportResults(refData, refImg, testData, testImg, testTolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv); + } + } + + finishTest(); + + function draw(vertexShader, fragmentShader) { + var program = wtu.createProgram(gl, vertexShader, fragmentShader, testFailed); + + var posLoc = gl.getAttribLocation(program, "aPosition"); + wtu.setupIndexedQuad(gl, gridRes, posLoc); + + gl.useProgram(program); + wtu.clearAndDrawIndexedQuad(gl, gridRes, [0, 0, 255, 255]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + + function drawVertexReferenceImage(colors) { + gl.bindBuffer(gl.ARRAY_BUFFER, indexedQuadForReferenceVertexShader[0]); + gl.enableVertexAttribArray(0); + gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); + gl.bindBuffer(gl.ARRAY_BUFFER, referenceVertexShaderColorBuffer); + gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); + gl.enableVertexAttribArray(1); + gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, 0); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexedQuadForReferenceVertexShader[1]); + gl.useProgram(referenceVertexShaderProgram); + wtu.clearAndDrawIndexedQuad(gl, gridRes); + gl.disableVertexAttribArray(0); + gl.disableVertexAttribArray(1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + + function drawFragmentReferenceImage(texture) { + var program = wtu.setupTexturedQuad(gl); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, texture); + var texLoc = gl.getUniformLocation(program, "tex"); + gl.uniform1i(texLoc, 0); + wtu.clearAndDrawUnitQuad(gl); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + + /** + * Creates and returns either a Uint8Array (for vertex shaders) or + * WebGLTexture (for fragment shaders) containing the reference + * image for the function being tested. Exactly how the function is + * evaluated, and the size of the returned texture or array, depends on + * whether we are testing a vertex or fragment shader. If a fragment + * shader, the function is evaluated at the pixel centers. If a + * vertex shader, the function is evaluated at the triangle's + * vertices. + * + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use to generate texture objects. + * @param {!function(number,number,number,number): !Array.} generator The reference image generator function. + * @param {number} width The width of the texture to generate if testing a fragment shader; the grid resolution if testing a vertex shader. + * @param {number} height The height of the texture to generate if testing a fragment shader; the grid resolution if testing a vertex shader. + * @param {boolean} isVertex True if generating a reference image for a vertex shader; false if for a fragment shader. + * @return {!WebGLTexture|!Uint8Array} The texture object or array that was generated. + */ + function generateReferenceImage( + gl, + generator, + width, + height, + isVertex) { + + // Note: the math in this function must match that in the vertex and + // fragment shader templates above. + function computeTexCoord(x) { + return x * 0.5 + 0.5; + } + + function computeVertexColor(texCoordX, texCoordY) { + return [ texCoordX, + texCoordY, + texCoordX * texCoordY, + (1.0 - texCoordX) * texCoordY * 0.5 + 0.5 ]; + } + + /** + * Computes fragment color according to the algorithm used for interpolation + * in OpenGL (GLES 2.0 spec 3.5.1, OpenGL 4.3 spec 14.6.1). + */ + function computeInterpolatedColor(texCoordX, texCoordY) { + // Calculate grid line indexes below and to the left from texCoord. + var gridBottom = Math.floor(texCoordY * gridRes); + if (gridBottom == gridRes) { + --gridBottom; + } + var gridLeft = Math.floor(texCoordX * gridRes); + if (gridLeft == gridRes) { + --gridLeft; + } + + // Calculate coordinates relative to the grid cell. + var cellX = texCoordX * gridRes - gridLeft; + var cellY = texCoordY * gridRes - gridBottom; + + // Barycentric coordinates inside either triangle ACD or ABC + // are used as weights for the vertex colors in the corners: + // A--B + // |\ | + // | \| + // D--C + + var aColor = computeVertexColor(gridLeft / gridRes, (gridBottom + 1) / gridRes); + var bColor = computeVertexColor((gridLeft + 1) / gridRes, (gridBottom + 1) / gridRes); + var cColor = computeVertexColor((gridLeft + 1) / gridRes, gridBottom / gridRes); + var dColor = computeVertexColor(gridLeft / gridRes, gridBottom / gridRes); + + // Calculate weights. + var a, b, c, d; + + if (cellX + cellY < 1) { + // In bottom triangle ACD. + a = cellY; // area of triangle C-D-(cellX, cellY) relative to ACD + c = cellX; // area of triangle D-A-(cellX, cellY) relative to ACD + d = 1 - a - c; + b = 0; + } else { + // In top triangle ABC. + a = 1 - cellX; // area of the triangle B-C-(cellX, cellY) relative to ABC + c = 1 - cellY; // area of the triangle A-B-(cellX, cellY) relative to ABC + b = 1 - a - c; + d = 0; + } + + var interpolated = []; + for (var ii = 0; ii < aColor.length; ++ii) { + interpolated.push(a * aColor[ii] + b * bColor[ii] + c * cColor[ii] + d * dColor[ii]); + } + return interpolated; + } + + function clamp(value, minVal, maxVal) { + return Math.max(minVal, Math.min(value, maxVal)); + } + + // Evaluates the function at clip coordinates (px,py), storing the + // result in the array "pixel". Each channel's result is clamped + // between 0 and 255. + function evaluateAtClipCoords(px, py, pixel, colorFunc) { + var tcx = computeTexCoord(px); + var tcy = computeTexCoord(py); + + var color = colorFunc(tcx, tcy); + + var output = generator(color[0], color[1], color[2], color[3]); + + // Multiply by 256 to get even distribution for all values between 0 and 1. + // Use rounding rather than truncation to more closely match the GPU's behavior. + pixel[0] = clamp(Math.round(256 * output[0]), 0, 255); + pixel[1] = clamp(Math.round(256 * output[1]), 0, 255); + pixel[2] = clamp(Math.round(256 * output[2]), 0, 255); + pixel[3] = clamp(Math.round(256 * output[3]), 0, 255); + } + + function generateFragmentReference() { + var data = new Uint8Array(4 * width * height); + + var horizTexel = 1.0 / width; + var vertTexel = 1.0 / height; + var halfHorizTexel = 0.5 * horizTexel; + var halfVertTexel = 0.5 * vertTexel; + + var pixel = new Array(4); + + for (var yi = 0; yi < height; ++yi) { + for (var xi = 0; xi < width; ++xi) { + // The function must be evaluated at pixel centers. + + // Compute desired position in clip space + var px = -1.0 + 2.0 * (halfHorizTexel + xi * horizTexel); + var py = -1.0 + 2.0 * (halfVertTexel + yi * vertTexel); + + evaluateAtClipCoords(px, py, pixel, computeInterpolatedColor); + var index = 4 * (width * yi + xi); + data[index + 0] = pixel[0]; + data[index + 1] = pixel[1]; + data[index + 2] = pixel[2]; + data[index + 3] = pixel[3]; + } + } + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + 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.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, + gl.RGBA, gl.UNSIGNED_BYTE, data); + return texture; + } + + function generateVertexReference() { + // We generate a Uint8Array which contains the evaluation of the + // function at the vertices of the triangle mesh. It is expected + // that the width and the height are identical, and equivalent + // to the grid resolution. + if (width != height) { + throw "width and height must be equal"; + } + + var texSize = 1 + width; + var data = new Uint8Array(4 * texSize * texSize); + + var step = 2.0 / width; + + var pixel = new Array(4); + + for (var yi = 0; yi < texSize; ++yi) { + for (var xi = 0; xi < texSize; ++xi) { + // The function is evaluated at the triangles' vertices. + + // Compute desired position in clip space + var px = -1.0 + (xi * step); + var py = -1.0 + (yi * step); + + evaluateAtClipCoords(px, py, pixel, computeVertexColor); + var index = 4 * (texSize * yi + xi); + data[index + 0] = pixel[0]; + data[index + 1] = pixel[1]; + data[index + 2] = pixel[2]; + data[index + 3] = pixel[3]; + } + } + + return data; + } + + //---------------------------------------------------------------------- + // Body of generateReferenceImage + // + + if (isVertex) { + return generateVertexReference(); + } else { + return generateFragmentReference(); + } + } +}; + +return { + /** + * runs a bunch of GLSL tests using the passed in parameters + * The parameters are: + * + * feature: + * the name of the function being tested (eg, sin, dot, + * normalize) + * + * testFunc: + * The prototype of function to be tested not including the + * return type. + * + * emuFunc: + * A base function that can be used to generate emulation + * functions. Example for 'ceil' + * + * float $(func)_base(float value) { + * float m = mod(value, 1.0); + * return m != 0.0 ? (value + 1.0 - m) : value; + * } + * + * args: + * The arguments to the function + * + * baseArgs: (optional) + * The arguments when a base function is used to create an + * emulation function. For example 'float sign_base(float v)' + * is used to implemenent vec2 sign_emu(vec2 v). + * + * simpleEmu: + * if supplied, the code that can be used to generate all + * functions for all types. + * + * Example for 'normalize': + * + * $(type) $(func)_emu($(args)) { + * return value / length(value); + * } + * + * gridRes: (optional) + * The resolution of the mesh to generate. The default is a + * 1x1 grid but many vertex shaders need a higher resolution + * otherwise the only values passed in are the 4 corners + * which often have the same value. + * + * tests: + * The code for each test. It is assumed the tests are for + * float, vec2, vec3, vec4 in that order. + * + * tolerance: (optional) + * Allow some tolerance in the comparisons. The tolerance is applied to + * both vertex and fragment shaders. The default tolerance is 0, meaning + * the values have to be identical. + * + * fragmentTolerance: (optional) + * Specify a tolerance which only applies to fragment shaders. The + * fragment-only tolerance will override the shared tolerance for + * fragment shaders if both are specified. Fragment shaders usually + * use mediump float precision so they sometimes require higher tolerance + * than vertex shaders which use highp by default. + */ + runFeatureTest: runFeatureTest, + + /* + * Runs a bunch of GLSL tests using the passed in parameters + * + * The parameters are: + * + * tests: + * Array of tests. For each test the following parameters are expected + * + * name: + * some description of the test + * reference: + * parameters for the reference shader (see below) + * test: + * parameters for the test shader (see below) + * + * The parameter for the reference and test shaders are + * + * shader: the GLSL for the shader + * subs: any substitutions you wish to define for the shader. + * + * Each shader is created from a basic template that + * defines an input and an output. You can see the + * templates at the top of this file. The input and output + * change depending on whether or not we are generating + * a vertex or fragment shader. + * + * All this code function does is a bunch of string substitutions. + * A substitution is defined by $(name). If name is found in + * the 'subs' parameter it is replaced. 4 special names exist. + * + * 'input' the input to your GLSL. Always a vec4. All change + * from 0 to 1 over the quad to be drawn. + * + * 'output' the output color. Also a vec4 + * + * 'emu' a place to insert extra stuff + * 'extra' a place to insert extra stuff. + * + * You can think of the templates like this + * + * $(extra) + * $(emu) + * + * void main() { + * // do math to calculate input + * ... + * + * $(shader) + * } + * + * Your shader first has any subs you provided applied as well + * as 'input' and 'output' + * + * It is then inserted into the template which is also provided + * with your subs. + * + * gridRes: (optional) + * The resolution of the mesh to generate. The default is a + * 1x1 grid but many vertex shaders need a higher resolution + * otherwise the only values passed in are the 4 corners + * which often have the same value. + * + * tolerance: (optional) + * Allow some tolerance in the comparisons. The tolerance is applied to + * both vertex and fragment shaders. The default tolerance is 0, meaning + * the values have to be identical. + * + * fragmentTolerance: (optional) + * Specify a tolerance which only applies to fragment shaders. The + * fragment-only tolerance will override the shared tolerance for + * fragment shaders if both are specified. Fragment shaders usually + * use mediump float precision so they sometimes require higher tolerance + * than vertex shaders which use highp. + */ + runBasicTest: runBasicTest, + + /** + * Runs a bunch of GLSL tests using the passed in parameters. The + * expected results are computed as a reference image in JavaScript + * instead of on the GPU. The parameters are: + * + * feature: + * the name of the function being tested (eg, sin, dot, + * normalize) + * + * testFunc: + * The prototype of function to be tested not including the + * return type. + * + * args: + * The arguments to the function + * + * gridRes: (optional) + * The resolution of the mesh to generate. The default is a + * 1x1 grid but many vertex shaders need a higher resolution + * otherwise the only values passed in are the 4 corners + * which often have the same value. + * + * tests: + * Array of tests. It is assumed the tests are for float, vec2, + * vec3, vec4 in that order. For each test the following + * parameters are expected: + * + * source: the GLSL source code for the tests + * + * generator: a JavaScript function taking four parameters + * which evaluates the same function as the GLSL source, + * returning its result as a newly allocated array. + * + * tolerance: (optional) a per-test tolerance. + * + * extra: (optional) + * Extra GLSL code inserted at the top of each test's shader. + * + * tolerance: (optional) + * Allow some tolerance in the comparisons. The tolerance is applied to + * both vertex and fragment shaders. The default tolerance is 0, meaning + * the values have to be identical. + * + * fragmentTolerance: (optional) + * Specify a tolerance which only applies to fragment shaders. The + * fragment-only tolerance will override the shared tolerance for + * fragment shaders if both are specified. Fragment shaders usually + * use mediump float precision so they sometimes require higher tolerance + * than vertex shaders which use highp. + */ + runReferenceImageTest: runReferenceImageTest, + + none: false +}; + +}()); + diff --git a/dom/canvas/test/webgl-conf/checkout/js/js-test-post.js b/dom/canvas/test/webgl-conf/checkout/js/js-test-post.js new file mode 100644 index 000000000..e2e2f6031 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/js-test-post.js @@ -0,0 +1,29 @@ +/* +** 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. +*/ + +shouldBeTrue("successfullyParsed"); +_addSpan('
TEST COMPLETE'); +if (_jsTestPreVerboseLogging) { + _bufferedLogToConsole('TEST COMPLETE'); +} +notifyFinishedToHarness() diff --git a/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js b/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js new file mode 100644 index 000000000..df30a6fab --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js @@ -0,0 +1,744 @@ +/* +** 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. +*/ + +(function() { + var testHarnessInitialized = false; + + var initNonKhronosFramework = function() { + if (testHarnessInitialized) { + return; + } + testHarnessInitialized = true; + + /* -- plaform specific code -- */ + + // WebKit Specific code. Add your code here. + if (window.testRunner && !window.layoutTestController) { + window.layoutTestController = window.testRunner; + } + + if (window.layoutTestController) { + window.layoutTestController.overridePreference("WebKitWebGLEnabled", "1"); + window.layoutTestController.dumpAsText(); + window.layoutTestController.waitUntilDone(); + } + if (window.internals) { + // The WebKit testing system compares console output. + // Because the output of the WebGL Tests is GPU dependent + // we turn off console messages. + window.console.log = function() { }; + window.console.error = function() { }; + window.internals.settings.setWebGLErrorsToConsoleEnabled(false); + + // RAF doesn't work in LayoutTests. Disable it so the tests will + // use setTimeout instead. + window.requestAnimationFrame = undefined; + window.webkitRequestAnimationFrame = undefined; + } + + /* -- end platform specific code --*/ + } + + this.initTestingHarness = function() { + initNonKhronosFramework(); + } +}()); + +var getUrlOptions = (function() { + var _urlOptionsParsed = false; + var _urlOptions = {}; + return function() { + if (!_urlOptionsParsed) { + var s = window.location.href; + var q = s.indexOf("?"); + var e = s.indexOf("#"); + if (e < 0) { + e = s.length; + } + var query = s.substring(q + 1, e); + var pairs = query.split("&"); + for (var ii = 0; ii < pairs.length; ++ii) { + var keyValue = pairs[ii].split("="); + var key = keyValue[0]; + var value = decodeURIComponent(keyValue[1]); + _urlOptions[key] = value; + } + _urlOptionsParsed = true; + } + + return _urlOptions; + } +})(); + +if (typeof quietMode == 'undefined') { + var quietMode = (function() { + var _quietModeChecked = false; + var _isQuiet = false; + return function() { + if (!_quietModeChecked) { + _isQuiet = (getUrlOptions().quiet == 1); + _quietModeChecked = true; + } + return _isQuiet; + } + })(); +} + +function nonKhronosFrameworkNotifyDone() { + // WebKit Specific code. Add your code here. + if (window.layoutTestController) { + window.layoutTestController.notifyDone(); + } +} + +function reportTestResultsToHarness(success, msg) { + if (window.parent.webglTestHarness) { + window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg); + } +} + +function reportSkippedTestResultsToHarness(success, msg) { + if (window.parent.webglTestHarness) { + window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg, true); + } +} + +function notifyFinishedToHarness() { + if (window.parent.webglTestHarness) { + window.parent.webglTestHarness.notifyFinished(window.location.pathname); + } + if (window.nonKhronosFrameworkNotifyDone) { + window.nonKhronosFrameworkNotifyDone(); + } +} + +var _bufferedConsoleLogs = []; + +function _bufferedLogToConsole(msg) +{ + if (_bufferedConsoleLogs) { + _bufferedConsoleLogs.push(msg); + } else if (window.console) { + window.console.log(msg); + } +} + +// Public entry point exposed to many other files. +function bufferedLogToConsole(msg) +{ + _bufferedLogToConsole(msg); +} + +// Called implicitly by testFailed(). +function _flushBufferedLogsToConsole() +{ + if (_bufferedConsoleLogs) { + if (window.console) { + for (var ii = 0; ii < _bufferedConsoleLogs.length; ++ii) { + window.console.log(_bufferedConsoleLogs[ii]); + } + } + _bufferedConsoleLogs = null; + } +} + +var _jsTestPreVerboseLogging = false; + +function enableJSTestPreVerboseLogging() +{ + _jsTestPreVerboseLogging = true; +} + +function description(msg) +{ + initTestingHarness(); + if (msg === undefined) { + msg = document.title; + } + // For MSIE 6 compatibility + var span = document.createElement("span"); + span.innerHTML = '

' + msg + '

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

'; + var description = document.getElementById("description"); + if (description.firstChild) + description.replaceChild(span, description.firstChild); + else + description.appendChild(span); + if (_jsTestPreVerboseLogging) { + _bufferedLogToConsole(msg); + } +} + +function _addSpan(contents) +{ + var span = document.createElement("span"); + document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace + span.innerHTML = contents + '
'; +} + +function debug(msg) +{ + if (!quietMode()) + _addSpan(msg); + if (_jsTestPreVerboseLogging) { + _bufferedLogToConsole(msg); + } +} + +function escapeHTML(text) +{ + return text.replace(/&/g, "&").replace(/PASS ' + escapeHTML(msg) + ''); + if (_jsTestPreVerboseLogging) { + _bufferedLogToConsole('PASS ' + msg); + } +} + +/** + * @param {string=} msg + */ +function testFailed(msg) { + msg = msg || 'Failed'; + if (_currentTestName) + msg = _currentTestName + ': ' + msg; + + reportTestResultsToHarness(false, msg); + _addSpan('FAIL ' + escapeHTML(msg) + ''); + _bufferedLogToConsole('FAIL ' + msg); + _flushBufferedLogsToConsole(); +} + +var _currentTestName; + +/** + * Sets the current test name for usage within testPassedOptions/testFailedOptions. + * @param {string=} name The name to set as the current test name. + */ +function setCurrentTestName(name) +{ + _currentTestName = name; +} + +/** + * Gets the current test name in use within testPassedOptions/testFailedOptions. + * @return {string} The name of the current test. + */ +function getCurrentTestName() +{ + return _currentTestName; +} + +/** + * Variation of the testPassed function, with the option to not show (and thus not count) the test's pass result. + * @param {string} msg The message to be shown in the pass result. + * @param {boolean} addSpan Indicates whether the message will be visible (thus counted in the results) or not. + */ +function testPassedOptions(msg, addSpan) +{ + if (addSpan && !quietMode()) + { + reportTestResultsToHarness(true, _currentTestName + ": " + msg); + _addSpan('PASS ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + ''); + } + if (_jsTestPreVerboseLogging) { + _bufferedLogToConsole('PASS ' + msg); + } +} + +/** + * Report skipped tests. + * @param {string} msg The message to be shown in the skip result. + * @param {boolean} addSpan Indicates whether the message will be visible (thus counted in the results) or not. + */ +function testSkippedOptions(msg, addSpan) +{ + if (addSpan && !quietMode()) + { + reportSkippedTestResultsToHarness(true, _currentTestName + ": " + msg); + _addSpan('SKIP ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + ''); + } + if (_jsTestPreVerboseLogging) { + _bufferedLogToConsole('SKIP' + msg); + } +} + +/** + * Variation of the testFailed function, with the option to throw an exception or not. + * @param {string} msg The message to be shown in the fail result. + * @param {boolean} exthrow Indicates whether the function will throw a TestFailedException or not. + */ +function testFailedOptions(msg, exthrow) +{ + reportTestResultsToHarness(false, _currentTestName + ": " + msg); + _addSpan('FAIL ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + ''); + _bufferedLogToConsole('FAIL ' + msg); + _flushBufferedLogsToConsole(); + if (exthrow) { + _currentTestName = ""; //Remembering to set the name of current testcase to empty string. + throw new TestFailedException(msg); + } +} + +function areArraysEqual(_a, _b) +{ + try { + if (_a.length !== _b.length) + return false; + for (var i = 0; i < _a.length; i++) + if (_a[i] !== _b[i]) + return false; + } catch (ex) { + return false; + } + return true; +} + +function isMinusZero(n) +{ + // the only way to tell 0 from -0 in JS is the fact that 1/-0 is + // -Infinity instead of Infinity + return n === 0 && 1/n < 0; +} + +function isResultCorrect(_actual, _expected) +{ + if (_expected === 0) + return _actual === _expected && (1/_actual) === (1/_expected); + if (_actual === _expected) + return true; + if (typeof(_expected) == "number" && isNaN(_expected)) + return typeof(_actual) == "number" && isNaN(_actual); + if (Object.prototype.toString.call(_expected) == Object.prototype.toString.call([])) + return areArraysEqual(_actual, _expected); + return false; +} + +function stringify(v) +{ + if (v === 0 && 1/v < 0) + return "-0"; + else return "" + v; +} + +function evalAndLog(_a) +{ + if (typeof _a != "string") + debug("WARN: tryAndLog() expects a string argument"); + + // Log first in case things go horribly wrong or this causes a sync event. + debug(_a); + + var _av; + try { + _av = eval(_a); + } catch (e) { + testFailed(_a + " threw exception " + e); + } + return _av; +} + +function shouldBe(_a, _b, quiet) +{ + if (typeof _a != "string" || typeof _b != "string") + debug("WARN: shouldBe() expects string arguments"); + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + + if (exception) + testFailed(_a + " should be " + _bv + ". Threw exception " + exception); + else if (isResultCorrect(_av, _bv)) { + if (!quiet) { + testPassed(_a + " is " + _b); + } + } else if (typeof(_av) == typeof(_bv)) + testFailed(_a + " should be " + _bv + ". Was " + stringify(_av) + "."); + else + testFailed(_a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ")."); +} + +function shouldNotBe(_a, _b, quiet) +{ + if (typeof _a != "string" || typeof _b != "string") + debug("WARN: shouldNotBe() expects string arguments"); + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + + if (exception) + testFailed(_a + " should not be " + _bv + ". Threw exception " + exception); + else if (!isResultCorrect(_av, _bv)) { + if (!quiet) { + testPassed(_a + " is not " + _b); + } + } else + testFailed(_a + " should not be " + _bv + "."); +} + +function shouldBeTrue(_a) { shouldBe(_a, "true"); } +function shouldBeFalse(_a) { shouldBe(_a, "false"); } +function shouldBeNaN(_a) { shouldBe(_a, "NaN"); } +function shouldBeNull(_a) { shouldBe(_a, "null"); } + +function shouldBeEqualToString(a, b) +{ + var unevaledString = '"' + b.replace(/"/g, "\"") + '"'; + shouldBe(a, unevaledString); +} + +function shouldEvaluateTo(actual, expected) { + // A general-purpose comparator. 'actual' should be a string to be + // evaluated, as for shouldBe(). 'expected' may be any type and will be + // used without being eval'ed. + if (expected == null) { + // Do this before the object test, since null is of type 'object'. + shouldBeNull(actual); + } else if (typeof expected == "undefined") { + shouldBeUndefined(actual); + } else if (typeof expected == "function") { + // All this fuss is to avoid the string-arg warning from shouldBe(). + try { + var actualValue = eval(actual); + } catch (e) { + testFailed("Evaluating " + actual + ": Threw exception " + e); + return; + } + shouldBe("'" + actualValue.toString().replace(/\n/g, "") + "'", + "'" + expected.toString().replace(/\n/g, "") + "'"); + } else if (typeof expected == "object") { + shouldBeTrue(actual + " == '" + expected + "'"); + } else if (typeof expected == "string") { + shouldBe(actual, expected); + } else if (typeof expected == "boolean") { + shouldBe("typeof " + actual, "'boolean'"); + if (expected) + shouldBeTrue(actual); + else + shouldBeFalse(actual); + } else if (typeof expected == "number") { + shouldBe(actual, stringify(expected)); + } else { + debug(expected + " is unknown type " + typeof expected); + shouldBeTrue(actual, "'" +expected.toString() + "'"); + } +} + +function shouldBeNonZero(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + " should be non-zero. Threw exception " + exception); + else if (_av != 0) + testPassed(_a + " is non-zero."); + else + testFailed(_a + " should be non-zero. Was " + _av); +} + +function shouldBeNonNull(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + " should be non-null. Threw exception " + exception); + else if (_av != null) + testPassed(_a + " is non-null."); + else + testFailed(_a + " should be non-null. Was " + _av); +} + +function shouldBeUndefined(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + " should be undefined. Threw exception " + exception); + else if (typeof _av == "undefined") + testPassed(_a + " is undefined."); + else + testFailed(_a + " should be undefined. Was " + _av); +} + +function shouldBeDefined(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + " should be defined. Threw exception " + exception); + else if (_av !== undefined) + testPassed(_a + " is defined."); + else + testFailed(_a + " should be defined. Was " + _av); +} + +function shouldBeLessThanOrEqual(_a, _b) { + if (typeof _a != "string" || typeof _b != "string") + debug("WARN: shouldBeLessThanOrEqual expects string arguments"); + + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + + if (exception) + testFailed(_a + " should be <= " + _b + ". Threw exception " + exception); + else if (typeof _av == "undefined" || _av > _bv) + testFailed(_a + " should be >= " + _b + ". Was " + _av + " (of type " + typeof _av + ")."); + else + testPassed(_a + " is <= " + _b); +} + +function shouldBeGreaterThanOrEqual(_a, _b) { + if (typeof _a != "string" || typeof _b != "string") + debug("WARN: shouldBeGreaterThanOrEqual expects string arguments"); + + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + + if (exception) + testFailed(_a + " should be >= " + _b + ". Threw exception " + exception); + else if (typeof _av == "undefined" || _av < _bv) + testFailed(_a + " should be >= " + _b + ". Was " + _av + " (of type " + typeof _av + ")."); + else + testPassed(_a + " is >= " + _b); +} + +function expectTrue(v, msg) { + if (v) { + testPassed(msg); + } else { + testFailed(msg); + } +} + +function shouldThrow(_a, _e) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + var _ev; + if (_e) + _ev = eval(_e); + + if (exception) { + if (typeof _e == "undefined" || exception == _ev) + testPassed(_a + " threw exception " + exception + "."); + else + testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Threw exception " + exception + "."); + } else if (typeof _av == "undefined") + testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was undefined."); + else + testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was " + _av + "."); +} + +function shouldBeType(_a, _type) { + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + var _typev = eval(_type); + + if(_typev === Number){ + if(_av instanceof Number){ + testPassed(_a + " is an instance of Number"); + } + else if(typeof(_av) === 'number'){ + testPassed(_a + " is an instance of Number"); + } + else{ + testFailed(_a + " is not an instance of Number"); + } + } + else if (_av instanceof _typev) { + testPassed(_a + " is an instance of " + _type); + } else { + testFailed(_a + " is not an instance of " + _type); + } +} + +/** + * Shows a message in case expression test fails. + * @param {boolean} exp + * @param {straing} message + */ +function checkMessage(exp, message) { + if ( !exp ) + _addSpan('WARNING ' + escapeHTML(_currentTestName) + ": " + escapeHTML(message) + ''); +} + +function assertMsg(assertion, msg) { + if (assertion) { + testPassed(msg); + } else { + testFailed(msg); + } +} + +/** + * Variation of the assertMsg function, with the option to not show (and thus not count) the test's pass result, + * and throw or not a TestFailedException in case of failure. + * @param {boolean} assertion If this is true, means success, else failure. + * @param {?string} msg The message to be shown in the result. + * @param {boolean} verbose In case of success, determines if the test will show it's result and count in the results. + * @param {boolean} exthrow In case of failure, determines if the function will throw a TestFailedException. + */ +function assertMsgOptions(assertion, msg, verbose, exthrow) { + if (assertion) { + testPassedOptions(msg, verbose); + } else { + testFailedOptions(msg, exthrow); + } +} + + +function webglHarnessCollectGarbage() { + if (window.GCController) { + window.GCController.collect(); + return; + } + + if (window.opera && window.opera.collect) { + window.opera.collect(); + return; + } + + try { + window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIDOMWindowUtils) + .garbageCollect(); + return; + } catch(e) {} + + if (window.gc) { + window.gc(); + return; + } + + if (window.CollectGarbage) { + CollectGarbage(); + return; + } + + function gcRec(n) { + if (n < 1) + return {}; + var temp = {i: "ab" + i + (i / 100000)}; + temp += "foo"; + gcRec(n-1); + } + for (var i = 0; i < 1000; i++) + gcRec(10); +} + +function finishTest() { + successfullyParsed = true; + var epilogue = document.createElement("script"); + var basePath = ""; + var expectedBase = "js-test-pre.js"; + var scripts = document.getElementsByTagName('script'); + for (var script, i = 0; script = scripts[i]; i++) { + var src = script.src; + var l = src.length; + if (src.substr(l - expectedBase.length) == expectedBase) { + basePath = src.substr(0, l - expectedBase.length); + break; + } + } + epilogue.src = basePath + "js-test-post.js"; + document.body.appendChild(epilogue); +} + diff --git a/dom/canvas/test/webgl-conf/checkout/js/pnglib.js b/dom/canvas/test/webgl-conf/checkout/js/pnglib.js new file mode 100644 index 000000000..d2a9b99e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/pnglib.js @@ -0,0 +1,207 @@ +/** +* A handy class to calculate color values. +* +* @version 1.0 +* @author Robert Eisele +* @copyright Copyright (c) 2010, Robert Eisele +* @link http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/ +* @license http://www.opensource.org/licenses/bsd-license.php BSD License +* +*/ + +(function() { + + // helper functions for that ctx + function write(buffer, offs) { + for (var i = 2; i < arguments.length; i++) { + for (var j = 0; j < arguments[i].length; j++) { + buffer[offs++] = arguments[i].charAt(j); + } + } + } + + function byte2(w) { + return String.fromCharCode((w >> 8) & 255, w & 255); + } + + function byte4(w) { + return String.fromCharCode((w >> 24) & 255, (w >> 16) & 255, (w >> 8) & 255, w & 255); + } + + function byte2lsb(w) { + return String.fromCharCode(w & 255, (w >> 8) & 255); + } + + window.PNGlib = function(width,height,depth) { + + this.width = width; + this.height = height; + this.depth = depth; + + // pixel data and row filter identifier size + this.pix_size = height * (width + 1); + + // deflate header, pix_size, block headers, adler32 checksum + this.data_size = 2 + this.pix_size + 5 * Math.floor((0xfffe + this.pix_size) / 0xffff) + 4; + + // offsets and sizes of Png chunks + this.ihdr_offs = 0; // IHDR offset and size + this.ihdr_size = 4 + 4 + 13 + 4; + this.plte_offs = this.ihdr_offs + this.ihdr_size; // PLTE offset and size + this.plte_size = 4 + 4 + 3 * depth + 4; + this.trns_offs = this.plte_offs + this.plte_size; // tRNS offset and size + this.trns_size = 4 + 4 + depth + 4; + this.idat_offs = this.trns_offs + this.trns_size; // IDAT offset and size + this.idat_size = 4 + 4 + this.data_size + 4; + this.iend_offs = this.idat_offs + this.idat_size; // IEND offset and size + this.iend_size = 4 + 4 + 4; + this.buffer_size = this.iend_offs + this.iend_size; // total PNG size + + this.buffer = new Array(); + this.palette = new Object(); + this.pindex = 0; + + var _crc32 = new Array(); + + // initialize buffer with zero bytes + for (var i = 0; i < this.buffer_size; i++) { + this.buffer[i] = "\x00"; + } + + // initialize non-zero elements + write(this.buffer, this.ihdr_offs, byte4(this.ihdr_size - 12), 'IHDR', byte4(width), byte4(height), "\x08\x03"); + write(this.buffer, this.plte_offs, byte4(this.plte_size - 12), 'PLTE'); + write(this.buffer, this.trns_offs, byte4(this.trns_size - 12), 'tRNS'); + write(this.buffer, this.idat_offs, byte4(this.idat_size - 12), 'IDAT'); + write(this.buffer, this.iend_offs, byte4(this.iend_size - 12), 'IEND'); + + // initialize deflate header + var header = ((8 + (7 << 4)) << 8) | (3 << 6); + header+= 31 - (header % 31); + + write(this.buffer, this.idat_offs + 8, byte2(header)); + + // initialize deflate block headers + for (var i = 0; (i << 16) - 1 < this.pix_size; i++) { + var size, bits; + if (i + 0xffff < this.pix_size) { + size = 0xffff; + bits = "\x00"; + } else { + size = this.pix_size - (i << 16) - i; + bits = "\x01"; + } + write(this.buffer, this.idat_offs + 8 + 2 + (i << 16) + (i << 2), bits, byte2lsb(size), byte2lsb(~size)); + } + + /* Create crc32 lookup table */ + for (var i = 0; i < 256; i++) { + var c = i; + for (var j = 0; j < 8; j++) { + if (c & 1) { + c = -306674912 ^ ((c >> 1) & 0x7fffffff); + } else { + c = (c >> 1) & 0x7fffffff; + } + } + _crc32[i] = c; + } + + // compute the index into a png for a given pixel + this.index = function(x,y) { + var i = y * (this.width + 1) + x + 1; + var j = this.idat_offs + 8 + 2 + 5 * Math.floor((i / 0xffff) + 1) + i; + return j; + } + + // convert a color and build up the palette + this.color = function(red, green, blue, alpha) { + + alpha = alpha >= 0 ? alpha : 255; + var color = (((((alpha << 8) | red) << 8) | green) << 8) | blue; + + if (typeof this.palette[color] == "undefined") { + if (this.pindex == this.depth) return "\x00"; + + var ndx = this.plte_offs + 8 + 3 * this.pindex; + + this.buffer[ndx + 0] = String.fromCharCode(red); + this.buffer[ndx + 1] = String.fromCharCode(green); + this.buffer[ndx + 2] = String.fromCharCode(blue); + this.buffer[this.trns_offs+8+this.pindex] = String.fromCharCode(alpha); + + this.palette[color] = String.fromCharCode(this.pindex++); + } + return this.palette[color]; + } + + // output a PNG string, Base64 encoded + this.getBase64 = function() { + + var s = this.getDump(); + + var ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var c1, c2, c3, e1, e2, e3, e4; + var l = s.length; + var i = 0; + var r = ""; + + do { + c1 = s.charCodeAt(i); + e1 = c1 >> 2; + c2 = s.charCodeAt(i+1); + e2 = ((c1 & 3) << 4) | (c2 >> 4); + c3 = s.charCodeAt(i+2); + if (l < i+2) { e3 = 64; } else { e3 = ((c2 & 0xf) << 2) | (c3 >> 6); } + if (l < i+3) { e4 = 64; } else { e4 = c3 & 0x3f; } + r+= ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4); + } while ((i+= 3) < l); + return r; + } + + // output a PNG string + this.getDump = function() { + + // compute adler32 of output pixels + row filter bytes + var BASE = 65521; /* largest prime smaller than 65536 */ + var NMAX = 5552; /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + var s1 = 1; + var s2 = 0; + var n = NMAX; + + for (var y = 0; y < this.height; y++) { + for (var x = -1; x < this.width; x++) { + s1+= this.buffer[this.index(x, y)].charCodeAt(0); + s2+= s1; + if ((n-= 1) == 0) { + s1%= BASE; + s2%= BASE; + n = NMAX; + } + } + } + s1%= BASE; + s2%= BASE; + write(this.buffer, this.idat_offs + this.idat_size - 8, byte4((s2 << 16) | s1)); + + // compute crc32 of the PNG chunks + function crc32(png, offs, size) { + var crc = -1; + for (var i = 4; i < size-4; i += 1) { + crc = _crc32[(crc ^ png[offs+i].charCodeAt(0)) & 0xff] ^ ((crc >> 8) & 0x00ffffff); + } + write(png, offs+size-4, byte4(crc ^ -1)); + } + + crc32(this.buffer, this.ihdr_offs, this.ihdr_size); + crc32(this.buffer, this.plte_offs, this.plte_size); + crc32(this.buffer, this.trns_offs, this.trns_size); + crc32(this.buffer, this.idat_offs, this.idat_size); + crc32(this.buffer, this.iend_offs, this.iend_size); + + // convert PNG to string + return "\211PNG\r\n\032\n"+this.buffer.join(''); + } + } + +})(); diff --git a/dom/canvas/test/webgl-conf/checkout/js/test-eval.js b/dom/canvas/test/webgl-conf/checkout/js/test-eval.js new file mode 100644 index 000000000..2d863239e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/test-eval.js @@ -0,0 +1,32 @@ +/* +** 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. +*/ +/** + * Calls eval. + * + * This is here so other modules can use "use strict": + */ +TestEval = function(str) { + return eval(str); +}; + + diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/clipping-wide-points.js b/dom/canvas/test/webgl-conf/checkout/js/tests/clipping-wide-points.js new file mode 100644 index 000000000..fd86bf5fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/clipping-wide-points.js @@ -0,0 +1,109 @@ +/* +** Copyright (c) 2016 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. +*/ + +'use strict'; +description("This test ensures clipping works with wide points whose centers are out of the viewport"); + +var wtu = WebGLTestUtils; +var gl = wtu.create3DContext("testbed", undefined, contextVersion); + +var pointSize; + +function setupProgram() { + var vs = "attribute vec4 pos;" + + "uniform float pointSize; " + + "void main() {" + + " gl_PointSize = pointSize;" + + " gl_Position = pos;" + + "}"; + var fs = "precision mediump float;" + + "void main() {" + + " gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);" + + "}"; + var program = wtu.setupProgram(gl, [vs, fs], ['pos']); + if (program) { + var loc = gl.getUniformLocation(program, 'pointSize'); + gl.uniform1f(loc, pointSize); + gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0); + gl.enableVertexAttribArray(0); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors after setting up program"); + } + return program; +} + +function runOneTestCase(vertex) { + debug(""); + debug("testing point at (" + vertex[0] + ", " + vertex[1] + ", " + vertex[2] + ")"); + var data = new Float32Array(vertex); + gl.bufferSubData(gl.ARRAY_BUFFER, 0, data); + + gl.clear(gl.COLOR_BUFFER_BIT); + gl.drawArrays(gl.POINTS, 0, 1); + wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 255, 0]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors after running one test case"); +} + +function runTests() { + if (!gl) { + testFailed("context does not exist"); + return; + } + + var range = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE); + if (range[1] < 2.0) { + testPassed("ALIASDED_POINT_SIZE_RANGE less than 2"); + return; + } + pointSize = 2.0; + + var data = new Float32Array(4); + var buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW); + + var program = setupProgram(); + if (!program) { + testFailed("fail to set up program"); + return; + } + + gl.disable(gl.BLEND); + gl.disable(gl.DITHER); + gl.disable(gl.DEPTH_TEST); + + gl.clearColor(1.0, 0.0, 0.0, 1.0); + + var vertices = [ + [ 0.99, 0.5, 0.0, 1.0 ], + [ 1.01, 0.5, 0.0, 1.0 ], + [ 0.5, 0.99, 0.0, 1.0 ], + [ 0.5, 1.01, 0.0, 1.0 ], + ]; + for (var idx = 0; idx < vertices.length; ++idx) { + runOneTestCase(vertices[idx]); + } +} + +runTests(); +debug(""); +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/compound-assignment-type-combination.js b/dom/canvas/test/webgl-conf/checkout/js/tests/compound-assignment-type-combination.js new file mode 100644 index 000000000..d824f3194 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/compound-assignment-type-combination.js @@ -0,0 +1,150 @@ +/* +** Copyright (c) 2014 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. +*/ + +'use strict'; + +// ESSL 1.00 spec section 5.8 (also ESSL 3.00 spec section 5.8): +// "The l-value and the expression must satisfy the semantic requirements of both op and equals (=)" +// In the semantic requirements of assignment (=): +// "The lvalue-expression and rvalue-expression must have the same type" + +var runTest = function(contextVersion) { + var vertexTemplateESSL1 = [ + 'precision mediump float;', + + 'uniform $(rtype) ur;', + 'uniform $(ltype) ul;', + + 'void main() {', + ' $(ltype) a = ul;', + ' a $(op) ur;', + ' gl_Position = vec4(float(a$(ltypeToScalar)));', + '}' + ].join('\n'); + + var vertexTemplateESSL3 = [ + '#version 300 es', + vertexTemplateESSL1 + ].join('\n'); + + var fragmentTemplateESSL1 = [ + 'precision mediump float;', + + 'uniform $(rtype) ur;', + 'uniform $(ltype) ul;', + + 'void main() {', + ' $(ltype) a = ul;', + ' a $(op) ur;', + ' gl_FragColor = vec4(float(a$(ltypeToScalar)));', + '}' + ].join('\n'); + + var fragmentTemplateESSL3 = [ + '#version 300 es', + 'out mediump vec4 my_FragColor;', + fragmentTemplateESSL1 + ].join('\n').replace('gl_FragColor', 'my_FragColor'); + + var isNonSquareMatrix = function(typeStr) { + return typeStr.substring(0, 3) == 'mat' && + typeStr.length > 5 && + typeStr[3] != typeStr[5]; + } + + var vsTemplate = contextVersion < 2 ? vertexTemplateESSL1 : vertexTemplateESSL3; + var fsTemplate = contextVersion < 2 ? fragmentTemplateESSL1 : fragmentTemplateESSL3; + + var wtu = WebGLTestUtils; + + var tests = []; + + var baseTypes = ['float', 'int']; + var vecTypes = [['vec2', 'vec3', 'vec4', 'mat2', 'mat3', 'mat4'], ['ivec2', 'ivec3', 'ivec4']]; + if (contextVersion >= 2) { + vecTypes[0] = ['vec2', 'vec3', 'vec4', 'mat2x2', 'mat3x3', 'mat4x4', 'mat2x3', 'mat2x4', 'mat3x2', 'mat3x4', 'mat4x2', 'mat4x3']; + } + var ops = ['+=', '-=', '*=', '/=']; + + var fs, vs; + for (var k = 0; k < ops.length; ++k) { + var op = ops[k]; + for (var i = 0; i < baseTypes.length; ++i) { + var baseType = baseTypes[i]; + for (var j = 0; j < vecTypes[i].length; ++j) { + var vecType = vecTypes[i][j]; + var vecTypeToScalar = vecType.substring(0, 3) == 'mat' ? '[0].x' : '.x'; + + var pushTest = function(ltype, rtype, ltypeToScalar, expectSuccess) { + vs = wtu.replaceParams(vsTemplate, {ltype: ltype, rtype: rtype, ltypeToScalar: ltypeToScalar, op: op}); + fs = wtu.replaceParams(fsTemplate, {ltype: ltype, rtype: rtype, ltypeToScalar: ltypeToScalar, op: op}); + tests.push({ + vShaderSource: vs, + vShaderSuccess: expectSuccess, + linkSuccess: expectSuccess, + passMsg: ltype + " " + op + " " + rtype + " in a vertex shader should " + (expectSuccess ? "succeed." : "fail.") + }); + tests.push({ + fShaderSource: fs, + fShaderSuccess: expectSuccess, + linkSuccess: expectSuccess, + passMsg: ltype + " " + op + " " + rtype + " in a fragment shader should " + (expectSuccess ? "succeed." : "fail.") + }); + } + + // "scalar op= vector" is not okay, since the result of op is a vector, + // which can't be assigned to a scalar. + pushTest(baseType, vecType, '', false); + + if (j > 0) { + var vecType2 = vecTypes[i][j - 1]; + // "vector1 op= vector2" is not okay when vector1 and vector2 have + // non-matching dimensions. + pushTest(vecType, vecType2, vecTypeToScalar, false); + } + + // "vector op= scalar" is okay. + pushTest(vecType, baseType, vecTypeToScalar, true); + + // vecX *= matX is okay (effectively, this treats vector as a row vector). + if (vecType.substring(0, 3) == 'vec' && op == '*=') { + pushTest(vecType, 'mat' + vecType[3], vecTypeToScalar, true); + } + + if (op != '*=' || !isNonSquareMatrix(vecType)) { + // "vector1 op= vector2" is okay when vector1 and vector2 have the same + // type (does a component-wise operation or matrix multiplication). + pushTest(vecType, vecType, vecTypeToScalar, true); + } else { + // non-square matrices can only be compound multiplied with a square matrix. + pushTest(vecType, vecType, vecTypeToScalar, false); + pushTest(vecType, 'mat' + vecType[3], vecTypeToScalar, true); + } + } + } + } + + GLSLConformanceTester.runTests(tests, contextVersion); +} + +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/gl-enum-tests.js b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-enum-tests.js new file mode 100644 index 000000000..3a17f09b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-enum-tests.js @@ -0,0 +1,140 @@ +/* +** Copyright (c) 2015 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. +*/ + +// This test relies on the surrounding web page defining a variable +// "contextVersion" which indicates what version of WebGL it's running +// on -- 1 for WebGL 1.0, 2 for WebGL 2.0, etc. + +"use strict"; +description("This test ensures various WebGL functions fail when passed invalid OpenGL ES enums."); + +debug(""); +debug("Canvas.getContext"); + +var wtu = WebGLTestUtils; +var gl = wtu.create3DContext("canvas", undefined, contextVersion); +if (!gl) { + testFailed("context does not exist"); +} else { + testPassed("context exists"); + + debug(""); + debug("Checking gl enums."); + + var buffer = new ArrayBuffer(2); + var buf = new Uint16Array(buffer); + var tex = gl.createTexture(); + var program = wtu.createProgram(gl, wtu.loadStandardVertexShader(gl), wtu.loadStandardFragmentShader(gl)); + gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer()); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + var tests = [ + "gl.disable(desktopGL['CLIP_PLANE0'])", + "gl.disable(desktopGL['POINT_SPRITE'])", + "gl.getBufferParameter(gl.ARRAY_BUFFER, desktopGL['PIXEL_PACK_BUFFER'])", + "gl.hint(desktopGL['PERSPECTIVE_CORRECTION_HINT'], gl.FASTEST)", + "gl.isEnabled(desktopGL['CLIP_PLANE0'])", + "gl.isEnabled(desktopGL['POINT_SPRITE'])", + "gl.pixelStorei(desktopGL['PACK_SWAP_BYTES'], 1)", + "gl.getParameter(desktopGL['NUM_COMPRESSED_TEXTURE_FORMATS'])", + "gl.getParameter(desktopGL['EXTENSIONS'])", + "gl.getParameter(desktopGL['SHADER_COMPILER'])", + "gl.getParameter(desktopGL['SHADER_BINARY_FORMATS'])", + "gl.getParameter(desktopGL['NUM_SHADER_BINARY_FORMATS'])", + ]; + + if (contextVersion < 2) { + tests = tests.concat([ + "gl.blendEquation(desktopGL['MIN'])", + "gl.blendEquation(desktopGL['MAX'])", + "gl.blendEquationSeparate(desktopGL['MIN'], gl.FUNC_ADD)", + "gl.blendEquationSeparate(desktopGL['MAX'], gl.FUNC_ADD)", + "gl.blendEquationSeparate(gl.FUNC_ADD, desktopGL['MIN'])", + "gl.blendEquationSeparate(gl.FUNC_ADD, desktopGL['MAX'])", + "gl.bufferData(gl.ARRAY_BUFFER, 16, desktopGL['STREAM_READ'])", + "gl.bufferData(gl.ARRAY_BUFFER, 16, desktopGL['STREAM_COPY'])", + "gl.bufferData(gl.ARRAY_BUFFER, 16, desktopGL['STATIC_READ'])", + "gl.bufferData(gl.ARRAY_BUFFER, 16, desktopGL['STATIC_COPY'])", + "gl.bufferData(gl.ARRAY_BUFFER, 16, desktopGL['DYNAMIC_READ'])", + "gl.bufferData(gl.ARRAY_BUFFER, 16, desktopGL['DYNAMIC_COPY'])", + "gl.bindTexture(desktopGL['TEXTURE_2D_ARRAY'], tex)", + "gl.bindTexture(desktopGL['TEXTURE_3D'], tex)", + ]); + } else { + tests = tests.concat([ + "gl.bindTexture(desktopGL['TEXTURE_RECTANGLE_EXT'], tex)", + "gl.enable(desktopGL['PRIMITIVE_RESTART_FIXED_INDEX'])", + "gl.getActiveUniforms(program, [0], desktopGL['UNIFORM_NAME_LENGTH'])", + "gl.getProgramParameter(program, desktopGL['ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH'])", + "gl.getProgramParameter(program, desktopGL['TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH'])", + "gl.getProgramParameter(program, desktopGL['PROGRAM_BINARY_RETRIEVABLE_HINT'])", + "gl.getProgramParameter(program, desktopGL['PROGRAM_BINARY_LENGTH'])", + "gl.getParameter(program, desktopGL['NUM_PROGRAM_BINARY_FORMATS'])", + ]); + } + + for (var ii = 0; ii < tests.length; ++ii) { + TestEval(tests[ii]); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, tests[ii] + " should return INVALID_ENUM."); + } + + gl.bindTexture(gl.TEXTURE_2D, tex); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + tests = [ + "gl.getTexParameter(gl.TEXTURE_2D, desktopGL['GENERATE_MIPMAP'])", + "gl.texParameteri(gl.TEXTURE_2D, desktopGL['GENERATE_MIPMAP'], 1)", + "gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, desktopGL['CLAMP_TO_BORDER'])", + ]; + + if (contextVersion < 2) { + tests = tests.concat([ + "gl.texParameteri(desktopGL['TEXTURE_2D_ARRAY'], gl.TEXTURE_MAG_FILTER, gl.NEAREST)", + "gl.texParameteri(desktopGL['TEXTURE_3D'], gl.TEXTURE_MAG_FILTER, gl.NEAREST)", + ]); + } else { + tests = tests.concat([ + "gl.texParameteri(desktopGL['TEXTURE_2D'], desktopGL['TEXTURE_SWIZZLE_R_EXT'], gl.RED)", + "gl.texParameteri(desktopGL['TEXTURE_2D'], desktopGL['TEXTURE_SWIZZLE_G_EXT'], gl.RED)", + "gl.texParameteri(desktopGL['TEXTURE_2D'], desktopGL['TEXTURE_SWIZZLE_B_EXT'], gl.RED)", + "gl.texParameteri(desktopGL['TEXTURE_2D'], desktopGL['TEXTURE_SWIZZLE_A_EXT'], gl.RED)", + "gl.texParameteri(desktopGL['TEXTURE_2D'], gl.TEXTURE_WRAP_R, desktopGL['CLAMP_TO_BORDER'])", + ]); + } + + for (var ii = 0; ii < tests.length; ++ii) { + TestEval(tests[ii]); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, tests[ii] + " should return INVALID_ENUM."); + } + if (contextVersion >= 2) { + var uniformBlockProgram = wtu.loadUniformBlockProgram(gl); + gl.linkProgram(uniformBlockProgram); + shouldBe('gl.getProgramParameter(uniformBlockProgram, gl.LINK_STATUS)', 'true'); + shouldBe('gl.getError()', 'gl.NO_ERROR'); + gl.getActiveUniformBlockParameter(uniformBlockProgram, 0, desktopGL['UNIFORM_BLOCK_NAME_LENGTH']); + shouldBe('gl.getError()', 'gl.INVALID_ENUM'); + } +} + +debug(""); +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/gl-get-tex-parameter.js b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-get-tex-parameter.js new file mode 100644 index 000000000..db38fb05c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-get-tex-parameter.js @@ -0,0 +1,200 @@ +/* +** Copyright (c) 2015 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. +*/ + +// This test relies on the surrounding web page defining a variable +// "contextVersion" which indicates what version of WebGL it's running +// on -- 1 for WebGL 1.0, 2 for WebGL 2.0, etc. + +"use strict"; +description(); +var wtu = WebGLTestUtils; +var gl = wtu.create3DContext("example", undefined, contextVersion); + +// NOTE: We explicitly do this in a funky order +// to hopefully find subtle bugs. + +var targets = [ + 'TEXTURE_2D', + 'TEXTURE_2D', + 'TEXTURE_CUBE_MAP', + 'TEXTURE_CUBE_MAP' +]; + +if (contextVersion > 1) { + targets = targets.concat([ + 'TEXTURE_2D_ARRAY', + 'TEXTURE_2D_ARRAY', + 'TEXTURE_3D', + 'TEXTURE_3D' + ]); +} + +// Create textures on different active textures. +for (var ii = 0; ii < targets.length; ++ii) { + var target = targets[ii]; + var tex = gl.createTexture(); + gl.activeTexture(gl.TEXTURE0 + ii); + gl.bindTexture(gl[target], tex); +} + +wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + +var states = [ + { state: 'TEXTURE_WRAP_S', default: 'REPEAT', value1: 'CLAMP_TO_EDGE', value2: 'REPEAT' }, + { state: 'TEXTURE_WRAP_T', default: 'REPEAT', value1: 'MIRRORED_REPEAT', value2: 'REPEAT' }, + { state: 'TEXTURE_MAG_FILTER', default: 'LINEAR', value1: 'NEAREST', value2: 'LINEAR' }, + { state: 'TEXTURE_MIN_FILTER', default: 'NEAREST_MIPMAP_LINEAR', value1: 'LINEAR_MIPMAP_LINEAR', value2: 'NEAREST' } +]; + +if (contextVersion > 1) { + states = states.concat([ + { state: 'TEXTURE_WRAP_R', default: 'REPEAT', value1: 'CLAMP_TO_EDGE', value2: 'MIRRORED_REPEAT' }, + { state: 'TEXTURE_COMPARE_FUNC', default: 'LEQUAL', value1: 'GREATER', value2: 'LESS' }, + { state: 'TEXTURE_COMPARE_MODE', default: 'NONE', value1: 'COMPARE_REF_TO_TEXTURE', value2: 'NONE' }, + { state: 'TEXTURE_BASE_LEVEL', default: 0, value1: 100, value2: 99 }, + { state: 'TEXTURE_MAX_LEVEL', default: 1000, value1: 800, value2: 300 }, + { state: 'TEXTURE_MIN_LOD', default: -1000.0, value1: -500.0, value2: -999.0 }, + { state: 'TEXTURE_MAX_LOD', default: 1000.0, value1: 500.0, value2: 999.0 }, + // Note: For TEXTURE_IMMUTABLE_LEVELS and TEXTURE_IMMUTABLE_FORMAT, + // these two pname are used by getTexParameter API only, not available in texParameter[fi] in specifications. + // Thus, these two states store default value only. + { state: 'TEXTURE_IMMUTABLE_LEVELS', default: 0, }, + { state: 'TEXTURE_IMMUTABLE_FORMAT', default: false, } + ]); +} + +function getStateInfoValue(stateInfo, item, method) { + switch (stateInfo.state) { + case 'TEXTURE_WRAP_R': + case 'TEXTURE_WRAP_S': + case 'TEXTURE_WRAP_T': + case 'TEXTURE_MAG_FILTER': + case 'TEXTURE_MIN_FILTER': + case 'TEXTURE_COMPARE_FUNC': + case 'TEXTURE_COMPARE_MODE': + if (method === 'Get') { + return 'gl["' + stateInfo[item] + '"]'; + } else if (method === 'Set') { + return gl[stateInfo[item]]; + } + break; + case 'TEXTURE_BASE_LEVEL': + case 'TEXTURE_MAX_LEVEL': + case 'TEXTURE_MIN_LOD': + case 'TEXTURE_MAX_LOD': + if (method === 'Get') { + return '' + stateInfo[item]; + } else if (method === 'Set') { + return stateInfo[item]; + } + break; + case 'TEXTURE_IMMUTABLE_LEVELS': + case 'TEXTURE_IMMUTABLE_FORMAT': + // Return default value only. + return '' + stateInfo.default; + default: + wtu.error("Not reached!"); + return null; + break; + } +} + +function applyStates(fn) { + for (var ss = 0; ss < states.length; ++ss) { + var stateInfo = states[ss]; + for (var ii = 0; ii < targets.length; ++ii) { + var target = targets[ii]; + gl.activeTexture(gl.TEXTURE0 + ii); + fn(target, stateInfo); + } + } +} + +// test the default state. +applyStates(function(target, stateInfo) { + var a = 'gl.getTexParameter(gl["' + target + '"], gl["' + stateInfo.state + '"])'; + var b = getStateInfoValue(stateInfo, 'default', 'Get'); + shouldBe(a, b); +}); + +// test new state +applyStates(function(target, stateInfo) { + switch (stateInfo.state) { + case 'TEXTURE_IMMUTABLE_FORMAT': + case 'TEXTURE_IMMUTABLE_LEVELS': + // Skip these two pname for texParameterf[fi]. + break; + case 'TEXTURE_MIN_LOD': + case 'TEXTURE_MAX_LOD': + gl.texParameterf(gl[target], gl[stateInfo.state], getStateInfoValue(stateInfo, 'value1', 'Set')); + break; + default: + gl.texParameteri(gl[target], gl[stateInfo.state], getStateInfoValue(stateInfo, 'value1', 'Set')); + break; + } +}); + +applyStates(function(target, stateInfo) { + var a = 'gl.getTexParameter(gl["' + target + '"], gl["' + stateInfo.state + '"])'; + var b = getStateInfoValue(stateInfo, 'value1', 'Get'); + shouldBe(a, b); +}); + +// test different states on each target. +function getItem(count) { + return (count % 2) ? 'value2' : 'value1'; +} + +applyStates(function() { + var count = 0; + return function(target, stateInfo) { + switch (stateInfo.state) { + case 'TEXTURE_IMMUTABLE_FORMAT': + case 'TEXTURE_IMMUTABLE_LEVELS': + // Skip these two pname for texParameterf[fi]. + break; + case 'TEXTURE_MIN_LOD': + case 'TEXTURE_MAX_LOD': + gl.texParameterf(gl[target], gl[stateInfo.state], getStateInfoValue(stateInfo, getItem(count), 'Set')); + break; + default: + gl.texParameteri(gl[target], gl[stateInfo.state], getStateInfoValue(stateInfo, getItem(count), 'Set')); + break; + } + ++count; + } +}()); + +applyStates(function() { + var count = 0; + return function(target, stateInfo) { + var a = 'gl.getTexParameter(gl["' + target + '"], gl["' + stateInfo.state + '"])'; + var b = getStateInfoValue(stateInfo, getItem(count), 'Get'); + shouldBe(a, b); + ++count; + }; +}()); + +wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/gl-object-get-calls.js b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-object-get-calls.js new file mode 100644 index 000000000..05e5a053d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-object-get-calls.js @@ -0,0 +1,1092 @@ +/* +** Copyright (c) 2015 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. +*/ + +// This test relies on the surrounding web page defining a variable +// "contextVersion" which indicates what version of WebGL it's running +// on -- 1 for WebGL 1.0, 2 for WebGL 2.0, etc. + +"use strict"; +var wtu = WebGLTestUtils; +description("Test of get calls against GL objects like getBufferParameter, etc."); + +var gl = wtu.create3DContext(undefined, undefined, contextVersion); + +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]; +if (contextVersion > 1) { + bufferTypes = bufferTypes.concat([gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, gl.PIXEL_PACK_BUFFER, gl.PIXEL_UNPACK_BUFFER, gl.TRANSFORM_FEEDBACK_BUFFER, gl.UNIFORM_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)); + gl.bindBuffer(bufferType, null); +} +testInvalidArgument( + "getBufferParameter", + "target", + bufferTypes, + function(target) { + return gl.getBufferParameter(target, gl.BUFFER_SIZE); + } +); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +var testCases = [ + { contextStencil: true}, + { contextStencil: false} +]; + +for (var run = 0; run < testCases.length; ++run) { + debug(""); + debug("Test getFramebufferAttachmentParameter with stencil " + testCases[run].contextStencil); + + if (testCases[run].contextStencil) { + gl = wtu.create3DContext(null, {stencil: true}, contextVersion); + } else { + gl = wtu.create3DContext(null, {stencil: false}, contextVersion); + } + + var texture = gl.createTexture(); + var anotherTexture = 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 colorAttachmentsNum = 1; + if (contextVersion > 1) { + gl.bindTexture(gl.TEXTURE_2D, anotherTexture); + 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); + colorAttachmentsNum = gl.getParameter(gl.MAX_COLOR_ATTACHMENTS); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + colorAttachmentsNum - 1, gl.TEXTURE_2D, anotherTexture, 0); + } + var renderbuffer = gl.createRenderbuffer(); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + if (contextVersion == 1) + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 2, 2); + else + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, 2, 2); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer); + if (contextVersion > 1) + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, renderbuffer); + shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE'); + // The for loop tests two color attachments for WebGL 2: the first one (gl.COLOR_ATTACHMENT0) + // and the last one (gl.COLOR_ATTACHMENT0 + gl.MAX_COLOR_ATTACHMENTS - 1). + for (var ii = 0; ii < colorAttachmentsNum; ii += (colorAttachmentsNum > 1 ? colorAttachmentsNum - 1 : 1)) { + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.TEXTURE'); + if (ii == 0) + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)', 'texture'); + else + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)', 'anotherTexture'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL)', '0'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE)', '0'); + if (contextVersion > 1) { + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ' + ii + ', gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER)', '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'); + if (contextVersion > 1) { + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.RENDERBUFFER'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)', 'renderbuffer'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.RENDERBUFFER'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)', 'renderbuffer'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + } + var validParametersForFBAttachment = + [ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, + gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, + gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, + gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE + ]; + if (contextVersion > 1) { + validParametersForFBAttachment = validParametersForFBAttachment.concat([ + gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, + gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, + gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, + gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER + ]); + } + testInvalidArgument( + "getFramebufferAttachmentParameter", + "parameter", + validParametersForFBAttachment, + function(parameter) { + return gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT, parameter); + } + ); + var validTargetsForFBAttachment = [gl.FRAMEBUFFER]; + if (contextVersion > 1) { + validTargetsForFBAttachment = validTargetsForFBAttachment.concat([gl.READ_FRAMEBUFFER, gl.DRAW_FRAMEBUFFER]); + } + testInvalidArgument( + "getFramebufferAttachmentParameter", + "target", + validTargetsForFBAttachment, + function(target) { + return gl.getFramebufferAttachmentParameter(target, gl.COLOR_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); + } + ); + var validAttachmentsForFBAttachment = new Array( + gl.COLOR_ATTACHMENT0, + gl.DEPTH_ATTACHMENT, + gl.STENCIL_ATTACHMENT, + gl.DEPTH_STENCIL_ATTACHMENT + ); + if (contextVersion > 1) { + for (var ii = 1; ii < gl.getParameter(gl.MAX_COLOR_ATTACHMENTS); ++ii) { + validAttachmentsForFBAttachment[validAttachmentsForFBAttachment.length] = gl.COLOR_ATTACHMENT0 + ii; + } + } + testInvalidArgument( + "getFramebufferAttachmentParameter", + "attachment", + validAttachmentsForFBAttachment, + function(attachment) { + return gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); + } + ); + if (contextVersion > 1) { + // test default framebuffer + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.FRAMEBUFFER_DEFAULT'); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.FRAMEBUFFER_DEFAULT'); + if (testCases[run].contextStencil) + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.FRAMEBUFFER_DEFAULT'); + else + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + if (testCases[run].contextStencil) { + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + shouldBeNonZero('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + } else { + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE)'); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)'); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)'); + } + testInvalidArgument( + "getFramebufferAttachmentParameter", + "parameter", + validParametersForFBAttachment, + function(parameter) { + return gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, parameter); + } + ); + testInvalidArgument( + "getFramebufferAttachmentParameter", + "target", + validTargetsForFBAttachment, + function(target) { + return gl.getFramebufferAttachmentParameter(target, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); + } + ); + testInvalidArgument( + "getFramebufferAttachmentParameter", + "attachment", + [ gl.BACK, + gl.DEPTH, + gl.STENCIL + ], + function(attachment) { + return gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); + } + ); + } +} +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +debug(""); +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'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); +shouldThrow('gl.getAttachedShaders(null)'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); +shouldThrow('gl.getAttachedShaders(standardVert)'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +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'); +if (contextVersion > 1) { + var buffer = gl.createBuffer(); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buffer); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 1024, gl.DYNAMIC_DRAW); + var uniformBlockProgram = wtu.loadUniformBlockProgram(gl); + var transformFeedbackVars = ["normal", "ecPosition"]; + gl.transformFeedbackVaryings(uniformBlockProgram, transformFeedbackVars, gl.INTERLEAVED_ATTRIBS); + gl.linkProgram(uniformBlockProgram); + shouldBe('gl.getProgramParameter(uniformBlockProgram, gl.LINK_STATUS)', 'true'); + shouldBe('gl.getError()', 'gl.NO_ERROR'); + shouldBe('gl.getProgramParameter(uniformBlockProgram, gl.ACTIVE_UNIFORM_BLOCKS)', '1'); + shouldBe('gl.getProgramParameter(uniformBlockProgram, gl.TRANSFORM_FEEDBACK_VARYINGS)', '2'); + shouldBe('gl.getProgramParameter(uniformBlockProgram, gl.TRANSFORM_FEEDBACK_BUFFER_MODE)', 'gl.INTERLEAVED_ATTRIBS'); +} +var program = standardProgram; +var validArrayForProgramParameter = [ + gl.DELETE_STATUS, + gl.LINK_STATUS, + gl.VALIDATE_STATUS, + gl.ATTACHED_SHADERS, + gl.ACTIVE_ATTRIBUTES, + gl.ACTIVE_UNIFORMS +]; +if (contextVersion > 1) { + validArrayForProgramParameter = validArrayForProgramParameter.concat([ + gl.ACTIVE_UNIFORM_BLOCKS, + gl.TRANSFORM_FEEDBACK_VARYINGS, + gl.TRANSFORM_FEEDBACK_BUFFER_MODE + ]); + program = uniformBlockProgram; +} +testInvalidArgument( + "getProgramParameter", + "parameter", + validArrayForProgramParameter, + function(parameter) { + return gl.getProgramParameter(program, parameter); + } +); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +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(); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); +gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); +wtu.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)'); +if (contextVersion > 1) { + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA4, 2, 2); + shouldBe('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_SAMPLES)', '4'); +} +var validArrayForRenderbuffer = new Array( + 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 +); +if (contextVersion > 1) { + validArrayForRenderbuffer[validArrayForRenderbuffer.length] = gl.RENDERBUFFER_SAMPLES; +} +testInvalidArgument( + "getRenderbufferParameter", + "parameter", + validArrayForRenderbuffer, + function(parameter) { + return gl.getRenderbufferParameter(gl.RENDERBUFFER, parameter); + }); +testInvalidArgument( + "getRenderbufferParameter", + "target", + [ gl.RENDERBUFFER ], + function(target) { + return gl.getRenderbufferParameter(target, gl.RENDERBUFFER_WIDTH); + } +); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +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); + } +); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +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'); +if (contextVersion > 1) { + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_BASE_LEVEL, 0); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, gl.LEQUAL); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAX_LEVEL, 10); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAX_LOD, 10); + gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_LOD, 0); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_BASE_LEVEL)', '0'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC)', 'gl.LEQUAL'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE)', 'gl.COMPARE_REF_TO_TEXTURE'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAX_LEVEL)', '10'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAX_LOD)', '10'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MIN_LOD)', '0'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_R)', 'gl.CLAMP_TO_EDGE'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_FORMAT)', 'false'); + shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_LEVELS)', '0'); +} +var validParametersForTexture = [ + gl.TEXTURE_MAG_FILTER, + gl.TEXTURE_MIN_FILTER, + gl.TEXTURE_WRAP_S, + gl.TEXTURE_WRAP_T, +]; +if (contextVersion > 1) { + validParametersForTexture = validParametersForTexture.concat([ + gl.TEXTURE_BASE_LEVEL, + gl.TEXTURE_COMPARE_FUNC, + gl.TEXTURE_COMPARE_MODE, + gl.TEXTURE_MAX_LEVEL, + gl.TEXTURE_MAX_LOD, + gl.TEXTURE_MIN_LOD, + gl.TEXTURE_WRAP_R, + gl.TEXTURE_IMMUTABLE_FORMAT, + gl.TEXTURE_IMMUTABLE_LEVELS, + ]); +} +testInvalidArgument( + "getTexParameter", + "parameter", + validParametersForTexture, + function(parameter) { + return gl.getTexParameter(gl.TEXTURE_2D, parameter); + } +); +var validTargetsForTexture = [ gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP]; +if (contextVersion > 1) { + validTargetsForTexture = validTargetsForTexture.concat([ gl.TEXTURE_3D, gl.TEXTURE_2D_ARRAY]); +} +testInvalidArgument( + "getTexParameter", + "target", + validTargetsForTexture, + function(target) { + return gl.getTexParameter(target, gl.TEXTURE_MAG_FILTER); + } +); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +debug(""); +debug("Test getUniform with all variants of data types"); +debug("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); +wtu.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]'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +debug("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); +wtu.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]'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +debug("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); +wtu.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]'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +debug("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); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); +shouldBe('gl.getUniform(samplerProgram, s2DValLoc)', '0'); +shouldBe('gl.getUniform(samplerProgram, sCubeValLoc)', '1'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +debug("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]); +wtu.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]'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +if (contextVersion > 1) { + debug("Unsigned Integer uniform variables"); + var uintProgram = wtu.loadProgramFromFile(gl, "../../resources/uintUniformShader.vert", "../../resources/noopUniformShaderES3.frag"); + shouldBe('gl.getProgramParameter(uintProgram, gl.LINK_STATUS)', 'true'); + var uvalLoc = gl.getUniformLocation(uintProgram, "uval"); + var uval2Loc = gl.getUniformLocation(uintProgram, "uval2"); + var uval3Loc = gl.getUniformLocation(uintProgram, "uval3"); + var uval4Loc = gl.getUniformLocation(uintProgram, "uval4"); + gl.useProgram(uintProgram); + gl.uniform1ui(uvalLoc, 1); + gl.uniform2ui(uval2Loc, 2, 3); + gl.uniform3ui(uval3Loc, 4, 5, 6); + gl.uniform4ui(uval4Loc, 7, 8, 9, 10); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + shouldBe('gl.getUniform(uintProgram, uvalLoc)', '1'); + shouldBe('gl.getUniform(uintProgram, uval2Loc)', '[2, 3]'); + shouldBe('gl.getUniform(uintProgram, uval3Loc)', '[4, 5, 6]'); + shouldBe('gl.getUniform(uintProgram, uval4Loc)', '[7, 8, 9, 10]'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + debug("Matrix uniform variables for WebGL 2"); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + var matForWebGL2Program = wtu.loadProgramFromFile(gl, "../../resources/matForWebGL2UniformShader.vert", "../../resources/noopUniformShaderES3.frag"); + shouldBe('gl.getProgramParameter(matForWebGL2Program, gl.LINK_STATUS)', 'true'); + var mval2x3Loc = gl.getUniformLocation(matForWebGL2Program, "mval2x3"); + var mval2x4Loc = gl.getUniformLocation(matForWebGL2Program, "mval2x4"); + var mval3x2Loc = gl.getUniformLocation(matForWebGL2Program, "mval3x2"); + var mval3x4Loc = gl.getUniformLocation(matForWebGL2Program, "mval3x4"); + var mval4x2Loc = gl.getUniformLocation(matForWebGL2Program, "mval4x2"); + var mval4x3Loc = gl.getUniformLocation(matForWebGL2Program, "mval4x3"); + gl.useProgram(matForWebGL2Program); + gl.uniformMatrix2x3fv(mval2x3Loc, false, [1, 2, 3, 4, 5, 6]); + gl.uniformMatrix2x4fv(mval2x4Loc, false, [7, 8, 9, 10, 11, 12, 13, 14]); + gl.uniformMatrix3x2fv(mval3x2Loc, false, [15, 16, 17, 18, 19, 20]); + gl.uniformMatrix3x4fv(mval3x4Loc, false, [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); + gl.uniformMatrix4x2fv(mval4x2Loc, false, [33, 34, 35, 36, 37, 38, 39, 40]); + gl.uniformMatrix4x3fv(mval4x3Loc, false, [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + shouldBe('gl.getUniform(matForWebGL2Program, mval2x3Loc)', '[1, 2, 3, 4, 5, 6]'); + shouldBe('gl.getUniform(matForWebGL2Program, mval2x4Loc)', '[7, 8, 9, 10, 11, 12, 13, 14]'); + shouldBe('gl.getUniform(matForWebGL2Program, mval3x2Loc)', '[15, 16, 17, 18, 19, 20]'); + shouldBe('gl.getUniform(matForWebGL2Program, mval3x4Loc)', '[21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]'); + shouldBe('gl.getUniform(matForWebGL2Program, mval4x2Loc)', '[33, 34, 35, 36, 37, 38, 39, 40]'); + shouldBe('gl.getUniform(matForWebGL2Program, mval4x3Loc)', '[41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + debug("Sampler uniform variables for WebGL2"); + var samplerForWebGL2Program = wtu.loadProgramFromFile(gl, "../../resources/noopUniformShaderES3.vert", "../../resources/samplerForWebGL2UniformShader.frag"); + shouldBe('gl.getProgramParameter(samplerForWebGL2Program, gl.LINK_STATUS)', 'true'); + var s3DValLoc = gl.getUniformLocation(samplerForWebGL2Program, "s3D"); + var s2DArrayValLoc = gl.getUniformLocation(samplerForWebGL2Program, "s2DArray"); + gl.useProgram(samplerForWebGL2Program); + gl.uniform1i(s3DValLoc, 0); + gl.uniform1i(s2DArrayValLoc, 1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + shouldBe('gl.getUniform(samplerForWebGL2Program, s3DValLoc)', '0'); + shouldBe('gl.getUniform(samplerForWebGL2Program, s2DArrayValLoc)', '1'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); +} + +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'); +if (contextVersion > 1) { + shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_DIVISOR)', '0'); + shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_INTEGER)', 'false'); + gl.vertexAttribDivisor(1, 2); + shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_DIVISOR)', '2'); +} +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]'); +if (contextVersion > 1) { + var intArray = new Int32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + gl.bufferData(gl.ARRAY_BUFFER, intArray, gl.DYNAMIC_DRAW); + gl.enableVertexAttribArray(1); + // feed fixed-point data to buffer + gl.vertexAttribIPointer(1, 4, gl.INT, false, 0, 0); + shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE)', 'gl.INT'); + shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_INTEGER)', 'true'); +} +wtu.glErrorShouldBe(gl, gl.NO_ERROR); +var validArrayForVertexAttrib = new Array( + 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.CURRENT_VERTEX_ATTRIB +); +if (contextVersion > 1) { + validArrayForVertexAttrib[validArrayForVertexAttrib.length] = gl.VERTEX_ATTRIB_ARRAY_DIVISOR; + validArrayForVertexAttrib[validArrayForVertexAttrib.length] = gl.VERTEX_ATTRIB_ARRAY_INTEGER; +} +testInvalidArgument( + "getVertexAttrib", + "parameter", + validArrayForVertexAttrib, + function(parameter) { + return gl.getVertexAttrib(1, parameter); + } +); +var numVertexAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); +wtu.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); +gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); +wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); +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)'); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +if (contextVersion > 1) { + debug(""); + debug("Test getInternalformatParameter") + + shouldBeNonNull('gl.getInternalformatParameter(gl.RENDERBUFFER, gl.R32I, gl.SAMPLES)'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + testInvalidArgument( + "getInternalformatParameter", + "target", + [ gl.RENDERBUFFER ], + function(target) { + return gl.getInternalformatParameter(target, gl.R32I, gl.SAMPLES); + }); + + testInvalidArgument( + "getInternalformatParameter", + "pname", + [ gl.SAMPLES ], + function(pname) { + return gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA4, pname); + }); + + var validArrayForInterformat = new Array( + gl.R8, gl.R8_SNORM, gl.RG8, gl.RG8_SNORM, + gl.RGB8, gl.RGB8_SNORM, gl.RGB565, gl.RGBA4, + gl.RGB5_A1, gl.RGBA8, gl.RGBA8_SNORM, gl.RGB10_A2, + gl.RGB10_A2UI, gl.SRGB8, gl.SRGB8_ALPHA8, gl.R16F, + gl.RG16F, gl.RGB16F, gl.RGBA16F, gl.R32F, + gl.RG32F, gl.RGB32F, gl.RGBA32F, gl.R11F_G11F_B10F, + gl.RGB9_E5, gl.R8I, gl.R8UI, gl.R16I, + gl.R16UI, gl.R32I, gl.R32UI, gl.RG8I, + gl.RG8UI, gl.RG16I, gl.RG16UI, gl.RG32I, + gl.RG32UI, gl.RGB8I, gl.RGB8UI, gl.RGB16I, + gl.RGB16UI, gl.RGB32I, gl.RGB32UI, gl.RGBA8I, + gl.RGBA8UI, gl.RGBA16I, gl.RGBA16UI, gl.RGBA32I, + gl.RGBA32UI, gl.RGB, gl.RGBA, gl.DEPTH_STENCIL, gl.DEPTH_COMPONENT16, + gl.DEPTH_COMPONENT24, gl.DEPTH_COMPONENT32F, gl.DEPTH24_STENCIL8, + gl.DEPTH32F_STENCIL8, gl.STENCIL_INDEX8 + ); + testInvalidArgument( + "getInternalformatParameter", + "internalformat", + validArrayForInterformat, + function(internalformat) { + return gl.getInternalformatParameter(gl.RENDERBUFFER, internalformat, gl.SAMPLES); + }); + + + debug(""); + debug("Test getIndexedParameter"); + var buffer = gl.createBuffer(); + gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buffer); + gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 64, gl.DYNAMIC_DRAW); + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buffer, 4, 8); + shouldBe('gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, 0)', 'buffer'); + shouldBe('gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_SIZE, 0)', '8'); + shouldBe('gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_START, 0)', '4'); + var buffer1 = gl.createBuffer(); + gl.bindBuffer(gl.UNIFORM_BUFFER, buffer1); + gl.bufferData(gl.UNIFORM_BUFFER, 64, gl.DYNAMIC_DRAW); + var offsetUniform = gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT); + gl.bindBufferRange(gl.UNIFORM_BUFFER, 1, buffer1, offsetUniform, 8); + shouldBe('gl.getIndexedParameter(gl.UNIFORM_BUFFER_BINDING, 1)', 'buffer1'); + shouldBe('gl.getIndexedParameter(gl.UNIFORM_BUFFER_SIZE, 1)', '8'); + shouldBe('gl.getIndexedParameter(gl.UNIFORM_BUFFER_START, 1)', 'offsetUniform'); + + gl.bindBufferBase(gl.UNIFORM_BUFFER, 1, null); + shouldBe('gl.getIndexedParameter(gl.UNIFORM_BUFFER_BINDING, 1)', 'null'); + + var validArrayForTarget = new Array( + gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, + gl.TRANSFORM_FEEDBACK_BUFFER_SIZE, + gl.TRANSFORM_FEEDBACK_BUFFER_START, + gl.UNIFORM_BUFFER_BINDING, + gl.UNIFORM_BUFFER_SIZE, + gl.UNIFORM_BUFFER_START + ); + testInvalidArgument( + "getIndexedParameter", + "target", + validArrayForTarget, + function(target) { + return gl.getIndexedParameter(target, 0); + }); + + debug(""); + debug("Test getSamplerParameter"); + var sampler = gl.createSampler(); + gl.samplerParameteri(sampler, gl.TEXTURE_COMPARE_FUNC, gl.LEQUAL); + gl.samplerParameteri(sampler, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.samplerParameterf(sampler, gl.TEXTURE_MAX_LOD, 10); + gl.samplerParameteri(sampler, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.samplerParameterf(sampler, gl.TEXTURE_MIN_LOD, 0); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_COMPARE_FUNC)', 'gl.LEQUAL'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_COMPARE_MODE)', 'gl.COMPARE_REF_TO_TEXTURE'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_MAG_FILTER)', 'gl.NEAREST'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_MAX_LOD)', '10'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_MIN_FILTER)', 'gl.NEAREST'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_MIN_LOD)', '0'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_WRAP_R)', 'gl.CLAMP_TO_EDGE'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_WRAP_S)', 'gl.CLAMP_TO_EDGE'); + shouldBe('gl.getSamplerParameter(sampler, gl.TEXTURE_WRAP_T)', 'gl.CLAMP_TO_EDGE'); + var validArrayForSamplerParameter = new Array( + gl.TEXTURE_COMPARE_FUNC, + gl.TEXTURE_COMPARE_MODE, + gl.TEXTURE_MAG_FILTER, + gl.TEXTURE_MAX_LOD, + gl.TEXTURE_MIN_FILTER, + gl.TEXTURE_MIN_LOD, + gl.TEXTURE_WRAP_R, + gl.TEXTURE_WRAP_S, + gl.TEXTURE_WRAP_T + ); + testInvalidArgument( + "getSamplerParameter", + "pname", + validArrayForSamplerParameter, + function(pname) { + return gl.getSamplerParameter(sampler, pname); + }); + + debug(""); + debug("Test getSyncParameter"); + var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); + shouldBe('gl.getSyncParameter(sync, gl.OBJECT_TYPE)', 'gl.SYNC_FENCE'); + var sync_status = gl.getSyncParameter(sync, gl.SYNC_STATUS); + switch (sync_status) { + case gl.UNSIGNALED: + testPassed('gl.getSyncParameter(sync, gl.SYNC_CONDITION) is gl.UNSIGNALED'); + break; + case gl.SIGNALED: + testPassed('gl.getSyncParameter(sync, gl.SYNC_CONDITION) is gl.SIGNALED'); + break; + default: + testFailed('gl.getSyncParameter(sync, gl.SYNC_CONDITION) was ' + sync_status + + ', expected gl.UNSIGNALED or gl.SIGNALED'); + break; + } + shouldBe('gl.getSyncParameter(sync, gl.SYNC_CONDITION)', 'gl.SYNC_GPU_COMMANDS_COMPLETE'); + shouldBe('gl.getSyncParameter(sync, gl.SYNC_FLAGS)', '0'); + var validArrayForSyncParameter = new Array( + gl.OBJECT_TYPE, + gl.SYNC_STATUS, + gl.SYNC_CONDITION, + gl.SYNC_FLAGS + ); + testInvalidArgument( + "getSyncParameter", + "pname", + validArrayForSyncParameter, + function(pname) { + return gl.getSyncParameter(sync, pname); + }); + + debug(""); + debug("Test getQueryParameter"); + var query = gl.createQuery(); + gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, query); + gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); + shouldBe('gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE)', 'false'); + // Queries' results are tested elsewhere in the conformance suite. It's complicated + // to wait for this query's result to become available and verify it. + var validArrayForPname = new Array( + gl.QUERY_RESULT, + gl.QUERY_RESULT_AVAILABLE + ); + testInvalidArgument( + "getQueryParameter", + "pname", + validArrayForPname, + function(pname) { + return gl.getQueryParameter(query, pname); + } + ); + + debug(""); + debug("Test getFragDataLocation"); + var baseVertShader = '' + + '#version 300 es\n' + + 'uniform mat4 modelViewMatrix;\n' + + 'uniform mat4 projectionMatrix;\n' + + 'in vec4 vertex;\n' + + 'out vec4 position;\n' + + 'void main (void)\n' + + '{\n' + + ' position = modelViewMatrix * vertex;\n' + + ' gl_Position = projectionMatrix * position;\n' + + '}\n'; + var baseFragShader = '' + + '#version 300 es\n' + + 'in lowp vec4 position;\n' + + 'layout(location = 0) out mediump vec4 fragColor;\n' + + 'void main (void)\n' + + '{\n' + + ' fragColor = position;\n' + + '}\n'; + var vertShader = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(vertShader, baseVertShader); + gl.compileShader(vertShader); + shouldBe('gl.getShaderParameter(vertShader, gl.COMPILE_STATUS)', 'true'); + var fragShader = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(fragShader, baseFragShader); + gl.compileShader(fragShader); + shouldBe('gl.getShaderParameter(fragShader, gl.COMPILE_STATUS)', 'true'); + var program = gl.createProgram(); + gl.attachShader(program, vertShader); + gl.attachShader(program, fragShader); + gl.linkProgram(program); + shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)','true'); + shouldBe('gl.getFragDataLocation(program, "vertexColor")', '-1'); + shouldBe('gl.getFragDataLocation(program, "modelViewMatrix")', '-1'); + shouldBe('gl.getFragDataLocation(program, "projectionMatrix")', '-1'); + shouldBe('gl.getFragDataLocation(program, "position")', '-1'); + shouldBe('gl.getFragDataLocation(program, "fragColor")', '0'); + + debug(""); + debug("Test getActiveUniforms"); + var program = wtu.loadUniformBlockProgram(gl); + gl.linkProgram(program); + shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true'); + shouldBe('gl.getError()', 'gl.NO_ERROR'); + + var numActiveUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); + var blockIndex = gl.getUniformBlockIndex(program, "Transform"); + var uniformIndices = []; + for (var i = 0; i < numActiveUniforms; i++) + uniformIndices.push(i); + var types = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_TYPE); + var sizes = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_SIZE); + var blockIndices = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_BLOCK_INDEX); + var offsets = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_OFFSET); + var arrayStrides = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_ARRAY_STRIDE); + var matrixStrides = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_MATRIX_STRIDE); + var rowMajors = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_IS_ROW_MAJOR); + for (var i = 0; i < numActiveUniforms; i++) { + if (types[i] != gl.FLOAT_MAT4 && types[i] != gl.FLOAT_MAT3) + testFailed("expected value: GL_FLOAT_MAT4 or GL_FLOAT_MAT3" + " actual value for UNIFORM_TYPE for uniform index[" + i + "]:" + wtu.glEnumToString(gl, types[i])); + if (sizes[i] != 1) + testFailed("expected value: 1" + " actual value for UNIFORM_SIZE for uniform index[" + i + "]:" + sizes[i]); + if (blockIndices[i] != blockIndex) + testFailed("expected value: 0" + " actual value for UNIFORM_BLOCK_INDEX for uniform index[" + i + "]:" + blockIndices[i]); + if (offsets[i] < 0) + testFailed("expected value >= 0" + " actual value for UNIFORM_OFFSET for uniform index[" + i + "]:" + offsets[i]); + if (arrayStrides[i] != 0) + testFailed("expected value: 0" + " actual value for UNIFORM_ARRAY_STRIDE for uniform index[" + i + "]:" + arrayStrides[i]); + if (matrixStrides[i] < 0) + testFailed("expected value >= 0" + " actual value for UNIFORM_MATRIX_STRIDE for uniform index[" + i + "]:" + matrixStrides[i]); + shouldBe('typeof rowMajors[i]', '"boolean"'); + if (rowMajors[i] != false) + testFailed("expected value: 0" + " actual value for UNIFORM_IS_ROW_MAJOR for uniform index[" + i + "]:" + rowMajors[i]); + } + + var validArrayForPname = new Array( + gl.UNIFORM_TYPE, + gl.UNIFORM_SIZE, + gl.UNIFORM_BLOCK_INDEX, + gl.UNIFORM_OFFSET, + gl.UNIFORM_ARRAY_STRIDE, + gl.UNIFORM_MATRIX_STRIDE, + gl.UNIFORM_IS_ROW_MAJOR + ); + testInvalidArgument( + "getActiveUniforms", + "pname", + validArrayForPname, + function(pname) { + return gl.getActiveUniforms(program, uniformIndices, pname); + } + ); + + debug(""); + debug("Test getUniformBlockIndex"); + var program = wtu.loadUniformBlockProgram(gl); + gl.linkProgram(program); + shouldBeTrue('gl.getProgramParameter(program, gl.LINK_STATUS)'); + shouldBe('gl.getUniformBlockIndex(program, "Transform")', '0'); + shouldBe('gl.getUniformBlockIndex(program, "u_modelViewMatrix")', 'gl.INVALID_INDEX'); + shouldBe('gl.getUniformBlockIndex(program, "normal")', 'gl.INVALID_INDEX'); + shouldBe('gl.getUniformBlockIndex(program, "u_normal")', 'gl.INVALID_INDEX'); + var noUniformProgram = wtu.loadStandardProgram(gl); + gl.linkProgram(noUniformProgram); + shouldBeTrue('gl.getProgramParameter(noUniformProgram, gl.LINK_STATUS)'); + shouldBe('gl.getUniformBlockIndex(noUniformProgram, "u_modelViewProjMatrix")', 'gl.INVALID_INDEX'); + shouldBe('gl.getUniformBlockIndex(noUniformProgram, "u_normal")', 'gl.INVALID_INDEX'); + + debug(""); + debug("Test getActiveUniformBlockName"); + var program = wtu.loadUniformBlockProgram(gl); + gl.linkProgram(program); + shouldBeTrue('gl.getProgramParameter(program, gl.LINK_STATUS)'); + shouldBeEqualToString('gl.getActiveUniformBlockName(program, 0)', 'Transform'); + shouldBeNull('gl.getActiveUniformBlockName(program, -1)'); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + shouldBeNull('gl.getActiveUniformBlockName(program, 1)'); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + shouldBeNull('gl.getActiveUniformBlockName(program, gl.INVALID_INDEX)'); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + var noLinkProgram = gl.createProgram(); + shouldBeFalse('gl.getProgramParameter(noLinkProgram, gl.LINK_STATUS)'); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.getActiveUniformBlockName(noLinkProgram, 0)'); + var noUniformProgram = wtu.loadStandardProgram(gl); + gl.linkProgram(noUniformProgram); + shouldBeTrue('gl.getProgramParameter(noUniformProgram, gl.LINK_STATUS)'); + shouldBeNull('gl.getActiveUniformBlockName(noUniformProgram, -1)'); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + shouldBeNull('gl.getActiveUniformBlockName(noUniformProgram, 0)'); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + shouldBeNull('gl.getActiveUniformBlockName(noUniformProgram, gl.INVALID_INDEX)'); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + debug(""); + debug("Test getActiveUniformBlockParameter"); + var program = wtu.loadUniformBlockProgram(gl); + gl.linkProgram(program); + shouldBeTrue('gl.getProgramParameter(program, gl.LINK_STATUS)'); + shouldBe('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_BINDING)', '0'); + gl.uniformBlockBinding(program, 0, 1); + shouldBe('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_BINDING)', '1'); + // The actual block data size can be bigger than 164, depending on the uniform block layout. + shouldBeTrue('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_DATA_SIZE) >= 164'); + shouldBe('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS)', '3'); + shouldBeTrue('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER)'); + shouldBeFalse('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER)'); + var indices = gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES); + for (var i = 0; i < 3; i++) { + if (indices[i] < 0) + testFailed("expected value >= 0" + " actual value for UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES for uniform index[" + i + "]:" + indices[i]); + } + var validArrayForPname = new Array( + gl.UNIFORM_BLOCK_BINDING, + gl.UNIFORM_BLOCK_DATA_SIZE, + gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS, + gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, + gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, + gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER + ); + testInvalidArgument( + "getActiveUniformBlockParameter", + "pname", + validArrayForPname, + function(pname) { + return gl.getActiveUniformBlockParameter(program, 0, pname); + } + ); +} + +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/gl-vertex-attrib.js b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-vertex-attrib.js new file mode 100644 index 000000000..ddff0e550 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-vertex-attrib.js @@ -0,0 +1,280 @@ +/* +** Copyright (c) 2015 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. +*/ + +// This test relies on the surrounding web page defining a variable +// "contextVersion" which indicates what version of WebGL it's running +// on -- 1 for WebGL 1.0, 2 for WebGL 2.0, etc. + +"use strict"; +description("This test ensures WebGL implementations vertexAttrib can be set and read."); + +debug(""); +debug("Canvas.getContext"); + +var wtu = WebGLTestUtils; +var gl = wtu.create3DContext("canvas", undefined, contextVersion); +if (!gl) { + testFailed("context does not exist"); +} else { + testPassed("context exists"); + + debug(""); + debug("Checking gl.vertexAttrib."); + + var numVertexAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); + for (var ii = 0; ii < numVertexAttribs; ++ii) { + gl.vertexAttrib1fv(ii, [1]); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib1fv(ii, new Float32Array([-1])); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '-1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib2fv(ii, [1, 2]); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib2fv(ii, new Float32Array([1, -2])); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '-2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib3fv(ii, [1, 2, 3]); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '3'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib3fv(ii, new Float32Array([1, -2, 3])); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '-2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '3'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib4fv(ii, [1, 2, 3, 4]); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '3'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '4'); + + gl.vertexAttrib4fv(ii, new Float32Array([1, 2, -3, 4])); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '-3'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '4'); + + gl.vertexAttrib1f(ii, 5); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '5'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib2f(ii, 6, 7); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '6'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '7'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib3f(ii, 7, 8, 9); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '7'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '8'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '9'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '1'); + + gl.vertexAttrib4f(ii, 6, 7, 8, 9); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Float32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '6'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '7'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '8'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '9'); + + if (contextVersion > 1) { + gl.vertexAttribI4i(ii, -1, 0, 1, 2); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Int32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '-1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '2'); + + gl.vertexAttribI4ui(ii, 0, 1, 2, 3); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Uint32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '3'); + + gl.vertexAttribI4iv(ii, [-1, 0, 1, 2]); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Int32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '-1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '2'); + + gl.vertexAttribI4iv(ii, new Int32Array([1, 0, -1, 2])); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Int32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '-1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '2'); + + gl.vertexAttribI4uiv(ii, [0, 1, 2, 3]); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Uint32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '3'); + + gl.vertexAttribI4uiv(ii, new Uint32Array([0, 2, 1, 3])); + shouldBeType('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)', 'Uint32Array'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[0]', '0'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[1]', '2'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[2]', '1'); + shouldBe('gl.getVertexAttrib(' + ii + ', gl.CURRENT_VERTEX_ATTRIB)[3]', '3'); + } + } + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + debug(""); + debug("Checking out-of-range vertexAttrib index"); + gl.getVertexAttrib(numVertexAttribs, gl.CURRENT_VERTEX_ATTRIB); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib1fv(numVertexAttribs, [1]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib1fv(numVertexAttribs, new Float32Array([-1])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib2fv(numVertexAttribs, [1, 2]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib2fv(numVertexAttribs, new Float32Array([1, -2])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib3fv(numVertexAttribs, [1, 2, 3]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib3fv(numVertexAttribs, new Float32Array([1, -2, 3])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib4fv(numVertexAttribs, [1, 2, 3, 4]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib4fv(numVertexAttribs, new Float32Array([1, 2, -3, 4])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib1f(numVertexAttribs, 5); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib2f(numVertexAttribs, 6, 7); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib3f(numVertexAttribs, 7, 8, 9); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib4f(numVertexAttribs, 6, 7, 8, 9); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + if (contextVersion > 1) { + gl.vertexAttribI4i(numVertexAttribs, -1, 0, 1, 2); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4ui(numVertexAttribs, 0, 1, 2, 3); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4iv(numVertexAttribs, [-1, 0, 1, 2]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4iv(numVertexAttribs, new Int32Array([1, 0, -1, 2])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4uiv(numVertexAttribs, [0, 1, 2, 3]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4uiv(numVertexAttribs, new Uint32Array([0, 2, 1, 3])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + } + + debug(""); + debug("Checking invalid array lengths"); + numVertexAttribs = numVertexAttribs - 1; + gl.vertexAttrib1fv(numVertexAttribs, []); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib1fv(numVertexAttribs, new Float32Array([])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib2fv(numVertexAttribs, [1]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib2fv(numVertexAttribs, new Float32Array([1])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib3fv(numVertexAttribs, [1, 2]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib3fv(numVertexAttribs, new Float32Array([1, -2])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib4fv(numVertexAttribs, [1, 2, 3]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttrib4fv(numVertexAttribs, new Float32Array([1, 2, -3])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + if (contextVersion > 1) { + gl.vertexAttribI4iv(numVertexAttribs, [-1, 0, 1]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4iv(numVertexAttribs, new Int32Array([1, 0, -1])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4uiv(numVertexAttribs, [0, 1, 2]); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + + gl.vertexAttribI4uiv(numVertexAttribs, new Uint32Array([0, 2, 1])); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE); + } +} + +debug(""); +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/instanceof-test.js b/dom/canvas/test/webgl-conf/checkout/js/tests/instanceof-test.js new file mode 100644 index 000000000..bd1ca2af8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/instanceof-test.js @@ -0,0 +1,122 @@ +/* +** Copyright (c) 2015 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. +*/ + +// This test relies on the surrounding web page defining a variable +// "contextVersion" which indicates what version of WebGL it's running +// on -- 1 for WebGL 1.0, 2 for WebGL 2.0, etc. + +"use strict"; +var wtu = WebGLTestUtils; +description(document.title); +debug("Tests that instanceof works on WebGL objects."); +debug(""); + +function checkGLError(message) { + var error = gl.getError(); + if (error != gl.NO_ERROR) { + wtu.error("Error: " + message + " caused " + wtu.glEnumToString(gl, error)); + } +} + +var gl = wtu.create3DContext("canvas", undefined, contextVersion); +if (contextVersion === 1) { + shouldBeTrue('gl instanceof WebGLRenderingContext'); +} else if (contextVersion === 2) { + shouldBeTrue('gl instanceof WebGL2RenderingContext'); +} + +shouldBeTrue('gl.createBuffer() instanceof WebGLBuffer'); +checkGLError("createBuffer") + +shouldBeTrue('gl.createFramebuffer() instanceof WebGLFramebuffer'); +checkGLError("createFramebuffer") + +shouldBeTrue('gl.createProgram() instanceof WebGLProgram'); +checkGLError("createProgram") + +shouldBeTrue('gl.createRenderbuffer() instanceof WebGLRenderbuffer'); +checkGLError("createRenderbuffer") + +shouldBeTrue('gl.createShader(gl.VERTEX_SHADER) instanceof WebGLShader'); +checkGLError("createShader") + +shouldBeTrue('gl.createTexture() instanceof WebGLTexture'); +checkGLError("createTexture") + +if (contextVersion > 1) { + shouldBeTrue('gl.createQuery() instanceof WebGLQuery'); + checkGLError("createQuery") + + shouldBeTrue('gl.createSampler() instanceof WebGLSampler'); + checkGLError("createSampler") + + shouldBeTrue('gl.createTransformFeedback() instanceof WebGLTransformFeedback'); + checkGLError("createTransformFeedback") + + shouldBeTrue('gl.createVertexArray() instanceof WebGLVertexArrayObject'); + checkGLError("createVertexArray") +} + +var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['vPosition'], [0]); + +shouldBeTrue('gl.getUniformLocation(program, "color") instanceof WebGLUniformLocation'); +checkGLError("getUniformLocation") + +shouldBeTrue('gl.getActiveAttrib(program, 0) instanceof WebGLActiveInfo'); +checkGLError("getActiveAttrib") + +shouldBeTrue('gl.getActiveUniform(program, 0) instanceof WebGLActiveInfo'); +checkGLError("getActiveUniform") + +debug(""); +debug("Tests that those WebGL objects can not be constructed through new operator"); +debug(""); + +function shouldThrowWithNew(objectType, objectName) { + try { + new objectType; + testFailed('new ' + objectName + ' did not throw'); + } catch (e) { + testPassed('new ' + objectName + ' threw an error'); + } +} + +shouldThrowWithNew(window.WebGLRenderingContext, 'WebGLRenderingContext'); +shouldThrowWithNew(window.WebGLActiveInfo, 'WebGLActiveInfo'); +shouldThrowWithNew(window.WebGLBuffer, 'WebGLBuffer'); +shouldThrowWithNew(window.WebGLFramebuffer, 'WebGLFramebuffer'); +shouldThrowWithNew(window.WebGLProgram, 'WebGLProgram'); +shouldThrowWithNew(window.WebGLRenderbuffer, 'WebGLRenderbuffer'); +shouldThrowWithNew(window.WebGLShader, 'WebGLShader'); +shouldThrowWithNew(window.WebGLTexture, 'WebGLTexture'); +shouldThrowWithNew(window.WebGLUniformLocation, 'WebGLUniformLocation'); +shouldThrowWithNew(window.WebGLShaderPrecisionFormat, 'WebGLShaderPrecisionFormat'); +if (contextVersion > 1) { + shouldThrowWithNew(window.WebGLQuery, 'WebGLQuery'); + shouldThrowWithNew(window.WebGLSampler, 'WebGLSampler'); + shouldThrowWithNew(window.WebGLSync, 'WebGLSync'); + shouldThrowWithNew(window.WebGLTransformFeedback, 'WebGLTransformFeedback'); + shouldThrowWithNew(window.WebGLVertexArrayObject, 'WebGLVertexArrayObject'); +} + +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/iterable-test.js b/dom/canvas/test/webgl-conf/checkout/js/tests/iterable-test.js new file mode 100644 index 000000000..31abe5011 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/iterable-test.js @@ -0,0 +1,173 @@ +/* +** Copyright (c) 2013 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ +IterableTest = (function() { + + var wtu = WebGLTestUtils; + + function run(test, iterations) { + var target = iterations || 10; + var count = 0; + + function doNextTest() { + ++count; + debug("Test " + count + " of " + target); + var success = test(); + if (count < target && success !== false) { + wtu.waitForComposite(doNextTest); + //setTimeout(doNextTest, 100); + } else { + finishTest(); + } + } + + doNextTest(); + } + + // Creates a canvas and a texture then exits. There are + // no references to either so both should be garbage collected. + function createContextCreationAndDestructionTest() { + var textureSize = null; + + return function() { + 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); + if (textureSize === null) { + var maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); + textureSize = Math.min(1024, maxTextureSize); + } + var tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, textureSize, textureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, + null); + gl.clear(gl.COLOR_BUFFER_BIT); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors"); + + return true; + }; + } + + // Creates many small canvases and attaches them to the DOM. + // This tests an edge case discovered in Chrome where the creation of multiple + // WebGL contexts would eventually lead to context creation failure. + // (crbug.com/319265) The test does not require that old contexts remain + // valid, only that new ones can be created. + function createContextCreationTest() { + return function() { + var canvas = document.createElement("canvas"); + canvas.width = 1; + canvas.height = 1; + + document.body.appendChild(canvas); + + var gl = wtu.create3DContext(canvas); + if (!gl) { + return false; + } + + gl.clear(gl.COLOR_BUFFER_BIT); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors"); + + return true; + }; + } + + // Draws rectangle on a passed canvas with preserveDrawingBuffer + // and antialiasing ON, tests rect color on every iteration. + function createMultisampleCorruptionTest(gl) { + var lastContext = null; + // Allocate a read back buffer in advance and reuse it for all iterations + // to avoid memory issues because of late garbage collection. + var readBackBuf = new Uint8Array(gl.canvas.width * gl.canvas.height * 4); + + var program = wtu.loadStandardProgram(gl); + var uniforms = wtu.getUniformMap(gl, program); + gl.useProgram(program); + + gl.clearColor(1.0, 0.0, 0.0, 1.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + 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); + gl.vertexAttrib3f(1, 0.0, 0.0, 1.0); + + var identityMat = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]); + + gl.uniformMatrix4fv(uniforms.u_modelViewProjMatrix.location, false, identityMat); + + function test() { + 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 = "Canvas should be red"; + wtu.checkCanvasRectColor(gl, + 0, 0, gl.canvas.width, gl.canvas.height, + [255, 0, 0, 255], null, + function() { + testPassed(msg); + }, + function() { + testFailed(msg); + return false; + }, + debug, readBackBuf); + document.body.removeChild(lastContext.canvas); + } + + lastContext = gl2; + return true; + }; + + // First pass does initialization + test(); + + return test; + } + + return { + run: run, + + createContextCreationAndDestructionTest: createContextCreationAndDestructionTest, + createContextCreationTest: createContextCreationTest, + createMultisampleCorruptionTest: createMultisampleCorruptionTest + }; + +})(); diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/oes-texture-float-and-half-float-linear.js b/dom/canvas/test/webgl-conf/checkout/js/tests/oes-texture-float-and-half-float-linear.js new file mode 100644 index 000000000..7cc06312d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/oes-texture-float-and-half-float-linear.js @@ -0,0 +1,183 @@ +/* +** Copyright (c) 2013 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +function generateTest(extensionTypeName, extensionName, pixelType, prologue) { + var wtu = WebGLTestUtils; + var gl = null; + var successfullyParsed = false; + + var init = function() + { + description("This test verifies the functionality of the " + extensionName + " extension, if it is available."); + + var canvas = document.getElementById("canvas"); + gl = wtu.create3DContext(canvas); + + if (!prologue(gl, extensionTypeName)) { + finishTest(); + return; + } + + // Before the extension is enabled + var extensionEnabled = false; + runTestSuite(extensionEnabled); + + if (!gl.getExtension(extensionName)) + testPassed("No " + extensionName + " support -- this is legal"); + else { + // After the extension is enabled + extensionEnabled = true; + runTestSuite(extensionEnabled); + } + + finishTest(); + } + + function runTestSuite(extensionEnabled) + { + var magF = [gl.NEAREST, gl.LINEAR]; + var minF = [gl.NEAREST, gl.LINEAR, gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_LINEAR]; + var tex2DFShader = [ + 'uniform sampler2D tex;', + 'void main() {', + ' gl_FragData[0] = texture2D(tex, vec2(0.5, 0.5)) * vec4(4.0, 2.0, 2.0, 1);', + '}'].join('\n'); + + var positionVertexShader = [ + 'attribute vec4 vPosition;', + 'void main() {', + ' gl_Position = vPosition;', + '}'].join('\n'); + + var texCubeFShader = [ + 'uniform samplerCube tex;', + 'void main() {', + ' gl_FragColor = textureCube(tex, normalize(vec3(0.5, 0.5, 1))) * vec4(4.0, 2.0, 2.0, 1);', + '}'].join('\n'); + + var vs = wtu.loadShader(gl, positionVertexShader, gl.VERTEX_SHADER); + var fs_2d = wtu.loadShader(gl, tex2DFShader, gl.FRAGMENT_SHADER); + var fs_cube = wtu.loadShader(gl, texCubeFShader, gl.FRAGMENT_SHADER); + + // TEXTURE_2D + var program = wtu.setupProgram(gl, [vs, fs_2d]); + gl.useProgram(program); + wtu.setupUnitQuad(gl); + for (var kk = 0; kk < 2; ++kk) { + for (var ii = 0; ii < 6; ++ii) { + var linear = false; + if (magF[kk] == gl.LINEAR || (minF[ii] != gl.NEAREST && minF[ii] != gl.NEAREST_MIPMAP_NEAREST)) + linear = true; + var color = (!extensionEnabled && linear) ? [0, 0, 0, 255] : [255, 255, 255, 255]; + runEachTest(gl.TEXTURE_2D, magF[kk], minF[ii], linear, extensionEnabled, color); + } + } + + // TEXTURE_CUBE_MAP + var programCube = wtu.setupProgram(gl, [vs, fs_cube]); + gl.useProgram(programCube); + wtu.setupUnitQuad(gl); + for (var kk = 0; kk < 2; ++kk) { + for (var ii = 0; ii < 6; ++ii) { + var linear = false; + if (magF[kk] == gl.LINEAR || (minF[ii] != gl.NEAREST && minF[ii] != gl.NEAREST_MIPMAP_NEAREST)) + linear = true; + var color = (!extensionEnabled && linear) ? [0, 0, 0, 255] : [255, 255, 255, 255]; + runEachTest(gl.TEXTURE_CUBE_MAP, magF[kk], minF[ii], linear, extensionEnabled, color); + } + } + } + + function runEachTest(textureTarget, magFilter, minFilter, linear, extensionEnabled, expected) + { + var format = gl.RGBA; + var numberOfChannels = 4; + debug(""); + debug("testing target: " + wtu.glEnumToString(gl,textureTarget) + + ", testing format: " + wtu.glEnumToString(gl, format) + + ", magFilter is: " + wtu.glEnumToString(gl, magFilter) + + ", minFilter is: " + wtu.glEnumToString(gl, minFilter) + + ", " + extensionName + " is " + (extensionEnabled ? "enabled": "not enabled") + ); + + // Generate data. + var width = 4; + var height = 4; + var canvas2d = document.createElement('canvas'); + canvas2d.width = width; + canvas2d.height = height; + var ctx2d = canvas2d.getContext('2d'); + var color = [64, 128, 128, 255]; + ctx2d.fillStyle = "rgba(" + color[0] + "," + color[1] + "," + color[2] + "," + color[3] + ")"; + ctx2d.fillRect(0, 0, width, height); + + var texture = gl.createTexture(); + gl.bindTexture(textureTarget, texture); + gl.texParameteri(textureTarget, gl.TEXTURE_MAG_FILTER, magFilter); + gl.texParameteri(textureTarget, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(textureTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(textureTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + + if (textureTarget == gl.TEXTURE_2D) { + gl.texImage2D(gl.TEXTURE_2D, 0, format, format, gl[pixelType], canvas2d); + if (minFilter != gl.NEAREST && minFilter != gl.LINEAR) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors during texture setup"); + gl.generateMipmap(gl.TEXTURE_2D); + if (gl.getError() != gl.NO_ERROR) { + debug("generateMipmap failed for floating-point TEXTURE_2D -- this is legal -- skipping the rest of this test"); + return; + } + } + } else if (textureTarget == gl.TEXTURE_CUBE_MAP) { + 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 tt = 0; tt < targets.length; ++tt) + gl.texImage2D(targets[tt], 0, format, format, gl[pixelType], canvas2d); + if (minFilter != gl.NEAREST && minFilter != gl.LINEAR) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors during texture setup"); + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + if (gl.getError() != gl.NO_ERROR) { + debug("generateMipmap failed for floating-point TEXTURE_CUBE_MAP -- this is legal -- skipping the rest of this test"); + return; + } + } + } + wtu.clearAndDrawUnitQuad(gl); + if (!linear) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, extensionTypeName + " texture with non-Linear filter should succeed with NO_ERROR no matter whether " + extensionName + " is enabled or not"); + } else if (!extensionEnabled) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, extensionTypeName + " texture with Linear filter should produce [0, 0, 0, 1.0] with NO_ERROR if " + extensionName + " isn't enabled"); + } else { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, extensionTypeName + " texture with Linear filter should succeed with NO_ERROR if " + extensionTypeName + " is enabled"); + } + + wtu.checkCanvas(gl, expected, "should be " + expected[0] + "," + expected[1] + "," + expected[2] + "," + expected[3]); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/out-of-bounds-test.js b/dom/canvas/test/webgl-conf/checkout/js/tests/out-of-bounds-test.js new file mode 100644 index 000000000..69846cda0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/out-of-bounds-test.js @@ -0,0 +1,343 @@ +/* +** Copyright (c) 2014 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. +*/ + +'use strict'; + +var OutOfBoundsTest = (function() { + +var runCommonInvalidValueTests = function(callTemplate, gl, wtu, ext) { + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {count: -1, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {count: 0, type: 'gl.UNSIGNED_BYTE', offset: -1})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {count: -1, type: 'gl.UNSIGNED_BYTE', offset: 1})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {count: 1, type: 'gl.UNSIGNED_BYTE', offset: -1})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {count: '0xffffffff', type: 'gl.UNSIGNED_BYTE', offset: 0})); +}; + +var setupProgramAndBindVertexArray = function(gl, wtu) { + var program = wtu.loadStandardProgram(gl); + + gl.useProgram(program); + var vertexObject = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); + gl.enableVertexAttribArray(0); + + return program; +}; + +var setupProgram2 = function(gl, wtu) { + var vshader = [ + 'attribute vec3 aOne;', + 'attribute vec2 aTwo;', + 'void main() {', + ' gl_Position = vec4(aOne, 1.0) + vec4(aTwo, 0.0, 1.0);', + '}' + ].join('\n'); + + var fshader = [ + 'void main() {', + ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);', + '}' + ].join('\n'); + + var program = wtu.setupProgram(gl, [vshader, fshader], [ "aOne", "aTwo" ]); + if (!program) { + testFailed("failed to create test program"); + } + return program; +}; + +var runDrawArraysTest = function(callTemplate, gl, wtu, ext) { + var program = setupProgramAndBindVertexArray(gl, wtu); + + debug("Test empty buffer") + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ ]), gl.STATIC_DRAW); + gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 1})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 10000})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 10000000000000})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 1, count: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 100, count: 0})); + runCommonInvalidValueTests(callTemplate, gl, wtu, ext); + + debug("") + debug("Test buffer with 3 float vectors") + 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.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 3})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 3, count: 2})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 10000})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 10000000000000})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 100, count: 0})); + runCommonInvalidValueTests(callTemplate, gl, wtu, ext); + + debug("") + debug("Test buffer with interleaved (3+2) float vectors") + + setupProgram2(gl, wtu); + + var vbo = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vbo); + // enough for 9 vertices, so 3 triangles + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(9*5), gl.STATIC_DRAW); + + // bind first 3 elements, with a stride of 5 float elements + gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 5*4, 0); + // bind 2 elements, starting after the first 3; same stride of 5 float elements + gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 5*4, 3*4); + + gl.enableVertexAttribArray(0); + gl.enableVertexAttribArray(1); + + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 9})); + + // negative values must generate INVALID_VALUE; they can never be valid + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {offset: 0, count: -500})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {offset: -200, count: 1})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {offset: -200, count: -500})); + + // 0xffffffff needs to convert to a 'long' IDL argument as -1, as per + // WebIDL 4.1.7. JS ToInt32(0xffffffff) == -1. Thus INVALID_VALUE. + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {offset: 0, count: '0xffffffff'})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {offset: '0xffffffff', count: '0xffffffff'})); + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {offset: '0xffffffff', count: 1})); + + // values that could otherwise be valid but aren't due to bindings generate + // INVALID_OPERATION + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 200})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: '0x7fffffff'})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: '0x7fffffff', count: 1})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: '0x7fffffff', count: '0x7fffffff'})); +}; + +var runDrawElementsTest = function(callTemplate, gl, wtu, ext) { + var program = setupProgramAndBindVertexArray(gl, wtu); + var contextVersion = wtu.getDefault3DContextVersion(); + + 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.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); + + var indexObject = gl.createBuffer(); + + debug('Test empty index buffer'); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array([ ]), gl.STATIC_DRAW); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 0, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 3, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 10000, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 10000000000000, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 1, type: 'gl.UNSIGNED_BYTE', offset: 0})); + runCommonInvalidValueTests(callTemplate, gl, wtu, ext); + + debug(''); + debug('Test buffer with 3 byte indexes'); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array([ 0, 1, 2 ]), gl.STATIC_DRAW); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 3, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 3, type: 'gl.UNSIGNED_BYTE', offset: 2})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 10000, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 10000000000000, type: 'gl.UNSIGNED_BYTE', offset: 0})); + runCommonInvalidValueTests(callTemplate, gl, wtu, ext); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 0, type: 'gl.UNSIGNED_BYTE', offset: 4})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: '0x7fffffff', type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: '0x7fffffff', type: 'gl.UNSIGNED_BYTE', offset: '0x7fffffff'})); + + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, 'gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, (new Uint8Array([ 3, 0, 1, 2 ])).subarray(1), gl.STATIC_DRAW)'); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 3, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, 'gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint8Array([ 3, 0, 1]))'); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 3, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, 'gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, (new Uint8Array([ 3, 0, 1, 2 ])).subarray(1))'); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 3, type: 'gl.UNSIGNED_BYTE', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 0, type: 'gl.UNSIGNED_BYTE', offset: 0})); + + debug(''); + debug('Test buffer with interleaved (3+2) float vectors'); + + setupProgram2(gl, wtu); + + var vbo = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vbo); + // enough for 9 vertices, so 3 triangles + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(9*5), gl.STATIC_DRAW); + + // bind first 3 elements, with a stride of 5 float elements + gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 5*4, 0); + // bind 2 elements, starting after the first 3; same stride of 5 float elements + gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 5*4, 3*4); + + gl.enableVertexAttribArray(0); + gl.enableVertexAttribArray(1); + + var ebo = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebo); + // For WebGL 2, PRIMITIVE_RESTART_FIXED_INDEX is always enabled. + // 0xffff will be handled as a primitive restart. + if (contextVersion <= 1) { + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array( + [ 0, 1, 2, + 1, 2, 0, + 2, 0, 1, + 201, 202, 203, + 0x7fff, 0x7fff, 0x7fff, + 0xffff, 0xffff, 0xffff ]), + gl.STATIC_DRAW); + } else { + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array( + [ 0, 1, 2, + 1, 2, 0, + 2, 0, 1, + 201, 202, 203, + 0x7fff, 0x7fff, 0x7fff, + 0xffff - 1, 0xffff - 1, 0xffff - 1 ]), + gl.STATIC_DRAW); + } + + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 9, type: 'gl.UNSIGNED_SHORT', offset: 0})); + + + // invalid operation with indices that would be valid with correct bindings + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 9, type: 'gl.UNSIGNED_SHORT', offset: 1000})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 12, type: 'gl.UNSIGNED_SHORT', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 15, type: 'gl.UNSIGNED_SHORT', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 18, type: 'gl.UNSIGNED_SHORT', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 3, type: 'gl.UNSIGNED_SHORT', offset: 2*15})); + + // 0xffffffff needs to convert to a 'long' IDL argument as -1, as per + // WebIDL 4.1.7. JS ToInt32(0xffffffff) == -1. Thus INVALID_VALUE. + wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, wtu.replaceParams(callTemplate, {count: '0xffffffff', type: 'gl.UNSIGNED_SHORT', offset: 0})); + // offset is defined as GLintptr, which is long long in IDL (64-bit). + // 2^32 - 1 should not overflow, and only result in INVALID_OPERATION. + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 1, type: 'gl.UNSIGNED_SHORT', offset: '0xffffffff'})); + + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: '0x7fffffff', type: 'gl.UNSIGNED_SHORT', offset: 0})); + + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 0, type: 'gl.UNSIGNED_SHORT', offset: 0})); + + // invalid operation with offset that's not a multiple of the type size + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 6, type: 'gl.UNSIGNED_SHORT', offset: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 6, type: 'gl.UNSIGNED_SHORT', offset: 1})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 6, type: 'gl.UNSIGNED_SHORT', offset: 2})); + + // invalid operation if no buffer is bound to ELEMENT_ARRAY_BUFFER + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 6, type: 'gl.UNSIGNED_SHORT', offset: 0})); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebo); + + debug(''); + debug('Test buffer setting attrib 0 to a buffer too small and disable it.'); + var smallVBO = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, smallVBO); + gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW); + gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0x10); + gl.disableVertexAttribArray(0); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {count: 6, type: 'gl.UNSIGNED_SHORT', offset: 2})); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {count: 6, type: 'gl.UNSIGNED_SHORT', offset: 2})); +}; + +var runInstancedTest = function(callTemplate, gl, wtu, ext) { + setupProgram2(gl, wtu); + + // Initialize non-instanced attribute data. + // Enough for 9 vertices, so 3 triangles. + var vbo = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vbo); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(9*3), gl.STATIC_DRAW); + + gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); + + // Setup buffer for instanced attribute data. + var vbo2 = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vbo2); + gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0); + + gl.enableVertexAttribArray(0); + gl.enableVertexAttribArray(1); + + debug('Test out-of-range instanced attributes'); + debug(''); + + debug('Test with an empty buffer for the instanced attribute'); + ext.vertexAttribDivisorANGLE(1, 1); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 10000, primcount: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 1})); + + debug('Test with a buffer with 1 float for the instanced attribute'); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(1), gl.STATIC_DRAW); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 0})); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 10000, primcount: 0})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 1})); + + debug(''); + debug('Test with a buffer with 2 floats for the instanced attribute'); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(2), gl.STATIC_DRAW); + debug('Divisor 1'); + ext.vertexAttribDivisorANGLE(1, 1); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 1})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 2})); + debug('Divisor 3'); + ext.vertexAttribDivisorANGLE(1, 3); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 3})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 4})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 10000})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: '0x7fffffff'})); + + debug(''); + debug('Test with a buffer with 4 floats for the instanced attribute'); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(4), gl.STATIC_DRAW); + debug('Divisor 1'); + ext.vertexAttribDivisorANGLE(1, 1); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 2})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 3})); + debug('Divisor 2'); + ext.vertexAttribDivisorANGLE(1, 2); + wtu.shouldGenerateGLError(gl, gl.NO_ERROR, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 4})); + wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, wtu.replaceParams(callTemplate, {offset: 0, count: 9, primcount: 5})); +}; + +var runDrawArraysInstancedTest = function(callTemplate, gl, wtu, ext) { + runInstancedTest(callTemplate, gl, wtu, ext); +}; + +var runDrawElementsInstancedTest = function(callTemplate, gl, wtu, ext) { + var ebo = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebo); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array( + [ 0, 1, 2, + 5, 4, 3, + 6, 7, 8 ]), + gl.STATIC_DRAW); + callTemplate = wtu.replaceParams(callTemplate, {type: 'gl.UNSIGNED_BYTE', offset: '$(offset)', count: '$(count)', primcount: '$(primcount)'}); + runInstancedTest(callTemplate, gl, wtu, ext); +}; + +return { + runDrawArraysTest: runDrawArraysTest, + runDrawArraysInstancedTest: runDrawArraysInstancedTest, + runDrawElementsTest: runDrawElementsTest, + runDrawElementsInstancedTest: runDrawElementsInstancedTest +}; + +})(); diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js new file mode 100644 index 000000000..33ab722d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js @@ -0,0 +1,329 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var realRedColor = [255, 0, 0]; + var realGreenColor = [0, 255, 0]; + var realBlueColor = [0, 0, 255]; + var realCyanColor = [0, 255, 255]; + var redColor = realRedColor; + var greenColor = realGreenColor; + var blueColor = realBlueColor; + var cyanColor = realCyanColor; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking a sub-rectangle of a canvas (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + + // The sub-rectangle tests only apply to WebGL 2.0 for the + // time being, though the tests for the WebGL 1.0 + // format/internal format/type combinations are generated into + // conformance/textures/. + if (wtu.getDefault3DContextVersion() < 2) { + debug('Test only applies to WebGL 2.0'); + finishTest(); + return; + } + + gl = wtu.create3DContext("example", { preserveDrawingBuffer: true }); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + blueColor = [0, 0, 0]; + cyanColor = [0, 0, 0]; + break; + + case gl.RG: + case gl.RG_INTEGER: + blueColor = [0, 0, 0]; + cyanColor = [0, 255, 0]; + break; + + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + gl.disable(gl.BLEND); + + var canvas2d = document.createElement('canvas'); + runTest(canvas2d, setupSourceCanvas2D, '2D-rendered canvas'); + + var canvasWebGL = document.createElement('canvas'); + runTest(canvasWebGL, setupSourceCanvasWebGL, 'WebGL-rendered canvas'); + + finishTest(); + } + + function fillStyle2D(ctx, color) { + ctx.fillStyle = 'rgb(' + color[0] + ', ' + color[1] + ', ' + color[2] + ')'; + } + + function setupSourceCanvas2D(canvas) { + var width = canvas.width; + var height = canvas.height; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + + var ctx = canvas.getContext('2d'); + // Always use the same pattern for this test: four quadrants: + // red green + // blue cyan + // Handle odd-sized canvases + fillStyle2D(ctx, realRedColor); + ctx.fillRect(0, 0, halfWidth, halfHeight); + fillStyle2D(ctx, realGreenColor); + ctx.fillRect(halfWidth, 0, width - halfWidth, halfHeight); + fillStyle2D(ctx, realBlueColor); + ctx.fillRect(0, halfHeight, halfWidth, height - halfHeight); + fillStyle2D(ctx, realCyanColor); + ctx.fillRect(halfWidth, halfHeight, width - halfWidth, height - halfHeight); + } + + function clearColorWebGL(ctx, color) { + ctx.clearColor(color[0] / 255.0, color[1] / 255.0, color[2] / 255.0, 1.0); + ctx.clear(ctx.COLOR_BUFFER_BIT); + } + + function setupSourceCanvasWebGL(canvas) { + var width = canvas.width; + var height = canvas.height; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + + var ctx = canvas.getContext('webgl'); + // Always use the same pattern for this test: four quadrants: + // red green + // blue cyan + // Handle odd-sized canvases + + ctx.viewport(0, 0, width, height); + ctx.enable(ctx.SCISSOR_TEST); + // OpenGL origin is lower-left + ctx.scissor(0, 0, halfWidth, halfHeight); + clearColorWebGL(ctx, realBlueColor); + ctx.scissor(halfWidth, 0, width - halfWidth, halfHeight); + clearColorWebGL(ctx, realCyanColor); + ctx.scissor(0, halfHeight, halfWidth, height - halfHeight); + clearColorWebGL(ctx, realRedColor); + ctx.scissor(halfWidth, halfHeight, width - halfWidth, height - halfHeight); + clearColorWebGL(ctx, realGreenColor); + } + + function runOneIteration(sourceDescription, useTexSubImage2D, flipY, + canvas, canvasSize, canvasSetupFunction, + sourceSubRectangle, expected, + bindingTarget, program) + { + sourceSubRectangleString = ''; + if (sourceSubRectangle) { + sourceSubRectangleString = ', sourceSubRectangle=' + sourceSubRectangle; + } + debug(''); + debug('Testing ' + sourceDescription + ' with ' + + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + + ', flipY=' + flipY + + ', bindingTarget=' + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP') + + sourceSubRectangleString); + + var loc; + var skipCorner = false; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + switch (gl[pixelFormat]) { + case gl.RED_INTEGER: + case gl.RG_INTEGER: + case gl.RGB_INTEGER: + case gl.RGBA_INTEGER: + // https://github.com/KhronosGroup/WebGL/issues/1819 + skipCorner = true; + break; + } + } + + if (skipCorner && sourceSubRectangle && + sourceSubRectangle[2] == 1 && sourceSubRectangle[3] == 1) { + debug("Test skipped, see WebGL#1819"); + return; + } + + // Initialize the contents of the source canvas. + var width = canvasSize[0]; + var height = canvasSize[1]; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + canvas.width = width; + canvas.height = height; + canvasSetupFunction(canvas); + + // Upload the source canvas to the texture and draw it to a quad. + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Enable writes to the RGBA channels + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + var targets = [gl.TEXTURE_2D]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + // In this test, this is always specified. It's currently WebGL 2.0-specific. + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + // Upload the image into the texture + var uploadWidth = sourceSubRectangle[2]; + var uploadHeight = sourceSubRectangle[3]; + for (var tt = 0; tt < targets.length; ++tt) { + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(targets[tt], 0, gl[internalFormat], + uploadWidth, uploadHeight, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, + uploadWidth, uploadHeight, + gl[pixelFormat], gl[pixelType], canvas); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], + uploadWidth, uploadHeight, 0, + gl[pixelFormat], gl[pixelType], canvas); + } + } + + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + + // The tests are constructed to upload a single solid color + // out of the canvas. + var outputCanvasWidth = gl.drawingBufferWidth; + var outputCanvasHeight = gl.drawingBufferHeight; + var outputCanvasHalfWidth = Math.floor(outputCanvasWidth / 2); + var outputCanvasHalfHeight = Math.floor(outputCanvasHeight / 2); + var top = 0; + var bottom = outputCanvasHeight - outputCanvasHalfHeight; + var left = 0; + var right = outputCanvasWidth - outputCanvasHalfWidth; + + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + + // Check the four quadrants and make sure they have the right color. + // This is split up into four tests only because of the driver bug above. + var msg = 'should be ' + expected; + wtu.checkCanvasRect(gl, left, top, outputCanvasHalfWidth, outputCanvasHalfHeight, expected, msg); + if (!skipCorner) { + wtu.checkCanvasRect(gl, right, top, outputCanvasHalfWidth, outputCanvasHalfHeight, expected, msg); + } + wtu.checkCanvasRect(gl, left, bottom, outputCanvasHalfWidth, outputCanvasHalfHeight, expected, msg); + if (!skipCorner) { + wtu.checkCanvasRect(gl, right, bottom, outputCanvasHalfWidth, outputCanvasHalfHeight, expected, msg); + } + } + } + + function runTest(canvas, canvasSetupFunction, sourceDescription) + { + var program = tiu.setupTexturedQuad(gl, internalFormat); + runTestOnBindingTarget(gl.TEXTURE_2D, program, canvas, canvasSetupFunction, sourceDescription); + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + runTestOnBindingTarget(gl.TEXTURE_CUBE_MAP, program, canvas, canvasSetupFunction, sourceDescription); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + } + + function runTestOnBindingTarget(bindingTarget, program, canvas, canvasSetupFunction, sourceDescription) { + var cases = [ + // Small canvas cases. Expected that these won't be + // GPU-accelerated in most browsers' implementations. + { expected: redColor, flipY: false, size: [2, 2], subRect: [0, 0, 1, 1] }, + { expected: greenColor, flipY: false, size: [2, 2], subRect: [1, 0, 1, 1] }, + { expected: blueColor, flipY: false, size: [2, 2], subRect: [0, 1, 1, 1] }, + { expected: cyanColor, flipY: false, size: [2, 2], subRect: [1, 1, 1, 1] }, + { expected: redColor, flipY: true, size: [2, 2], subRect: [0, 1, 1, 1] }, + { expected: greenColor, flipY: true, size: [2, 2], subRect: [1, 1, 1, 1] }, + { expected: blueColor, flipY: true, size: [2, 2], subRect: [0, 0, 1, 1] }, + { expected: cyanColor, flipY: true, size: [2, 2], subRect: [1, 0, 1, 1] }, + + // Larger canvas cases. Expected that these will be + // GPU-accelerated in most browsers' implementations. + // Changes will be gladly accepted to trigger more + // browsers' heuristics to accelerate these canvases. + { expected: redColor, flipY: false, size: [384, 384], subRect: [ 0, 0, 192, 192] }, + { expected: greenColor, flipY: false, size: [384, 384], subRect: [192, 0, 192, 192] }, + { expected: blueColor, flipY: false, size: [384, 384], subRect: [ 0, 192, 192, 192] }, + { expected: cyanColor, flipY: false, size: [384, 384], subRect: [192, 192, 192, 192] }, + { expected: blueColor, flipY: true, size: [384, 384], subRect: [ 0, 0, 192, 192] }, + { expected: cyanColor, flipY: true, size: [384, 384], subRect: [192, 0, 192, 192] }, + { expected: redColor, flipY: true, size: [384, 384], subRect: [ 0, 192, 192, 192] }, + { expected: greenColor, flipY: true, size: [384, 384], subRect: [192, 192, 192, 192] }, + + ]; + + for (var i in cases) { + runOneIteration(sourceDescription, false, cases[i].flipY, + canvas, cases[i].size, canvasSetupFunction, + cases[i].subRect, + cases[i].expected, bindingTarget, program); + + // In Chrome, this hits a bug on Mac with Intel GPU. + // Chromium bug: crbug.com/665656 + // Apple Radar: 29563996 + //runOneIteration(sourceDescription, true, cases[i].flipY, + // canvas, cases[i].size, canvasSetupFunction, + // cases[i].subRect, + // cases[i].expected, bindingTarget, program); + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas.js new file mode 100644 index 000000000..4024a0200 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-canvas.js @@ -0,0 +1,320 @@ +/* +** 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var whiteColor = [255, 255, 255, 255]; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking canvas elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + whiteColor = [255, 0, 0, 255]; + greenColor = [0, 0, 0]; + break; + case gl.RG: + case gl.RG_INTEGER: + whiteColor = [255, 255, 0, 255]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var testCanvas = document.createElement('canvas'); + runTest(testCanvas); + //document.body.appendChild(testCanvas); + } + + function setCanvasToRedGreen(ctx) { + var width = ctx.canvas.width; + var height = ctx.canvas.height; + var halfHeight = Math.floor(height / 2); + ctx.fillStyle = "#ff0000"; + ctx.fillRect(0, 0, width, halfHeight); + ctx.fillStyle = "#00ff00"; + ctx.fillRect(0, halfHeight, width, height - halfHeight); + } + + function drawTextInCanvas(ctx, bindingTarget) { + var width = ctx.canvas.width; + var height = ctx.canvas.height; + ctx.fillStyle = "#ffffff"; + ctx.fillRect(0, 0, width, height); + ctx.font = '20pt Arial'; + ctx.fillStyle = 'black'; + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + ctx.fillText("1234567890", width / 2, height / 4); + } + + function setCanvasTo257x257(ctx, bindingTarget) { + ctx.canvas.width = 257; + ctx.canvas.height = 257; + setCanvasToRedGreen(ctx); + } + + function setCanvasToMin(ctx, bindingTarget) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + // cube map texture must be square. + ctx.canvas.width = 2; + } else { + ctx.canvas.width = 1; + } + ctx.canvas.height = 2; + setCanvasToRedGreen(ctx); + } + + function checkSourceCanvasImageData(imageDataBefore, imageDataAfter) { + if (imageDataBefore.length != imageDataAfter.length) { + testFailed("The size of image data in source canvas become different after it is used in webgl texture."); + return; + } + for (var i = 0; i < imageDataAfter.length; i++) { + if (imageDataBefore[i] != imageDataAfter[i]) { + testFailed("Pixel values in source canvas have changed after canvas used in webgl texture."); + return; + } + } + testPassed("Pixel values in source canvas remain unchanged after canvas used in webgl texture."); + } + + function runOneIteration(canvas, useTexSubImage2D, flipY, program, bindingTarget, opt_texture, opt_fontTest) + { + debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + + ' with flipY=' + flipY + ' bindingTarget=' + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP') + + ' canvas size: ' + canvas.width + 'x' + canvas.height + + (opt_fontTest ? " with fonts" : " with red-green")); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + if (!opt_texture) { + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + } else { + var texture = opt_texture; + } + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + var targets = [gl.TEXTURE_2D]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + // Upload the image into the texture + for (var tt = 0; tt < targets.length; ++tt) { + // Initialize the texture to black first + if (useTexSubImage2D) { + gl.texImage2D(targets[tt], 0, gl[internalFormat], canvas.width, canvas.height, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, gl[pixelFormat], gl[pixelType], canvas); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], gl[pixelFormat], gl[pixelType], canvas); + } + } + + var width = gl.canvas.width; + var height = gl.canvas.height; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + var top = flipY ? 0 : (height - halfHeight); + var bottom = flipY ? (height - halfHeight) : 0; + + var loc; + var skipCorner = false; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + switch (gl[pixelFormat]) { + case gl.RED_INTEGER: + case gl.RG_INTEGER: + case gl.RGB_INTEGER: + case gl.RGBA_INTEGER: + // https://github.com/KhronosGroup/WebGL/issues/1819 + skipCorner = true; + break; + } + } + + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 255, 0, 255]); + + if (opt_fontTest) { + // check half is a solid color. + wtu.checkCanvasRect( + gl, 0, top, width, halfHeight, + whiteColor, + "should be white"); + // check other half is not a solid color. + wtu.checkCanvasRectColor( + gl, 0, bottom, width, halfHeight, + whiteColor, 0, + function() { + testFailed("font missing"); + }, + function() { + testPassed("font rendered"); + }, + debug); + } else { + // Check the top and bottom halves and make sure they have the right color. + debug("Checking " + (flipY ? "top" : "bottom")); + wtu.checkCanvasRect(gl, 0, bottom, (skipCorner && flipY) ? halfWidth : width, halfHeight, redColor, + "shouldBe " + redColor); + debug("Checking " + (flipY ? "bottom" : "top")); + wtu.checkCanvasRect(gl, 0, top, (skipCorner && !flipY) ? halfWidth : width, halfHeight, greenColor, + "shouldBe " + greenColor); + } + + if (!useTexSubImage2D && pixelFormat == "RGBA") { + if (pixelType == "FLOAT") { + // Attempt to set a pixel in the texture to ensure the texture was + // actually created with floats. Regression test for http://crbug.com/484968 + var pixels = new Float32Array([1000.0, 1000.0, 1000.0, 1000.0]); + gl.texSubImage2D(targets[tt], 0, 0, 0, 1, 1, gl[pixelFormat], gl[pixelType], pixels); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Texture should be backed by floats"); + } else if (pixelType == "HALF_FLOAT_OES" || pixelType == "HALF_FLOAT") { + // Attempt to set a pixel in the texture to ensure the texture was + // actually created with half-floats. Regression test for http://crbug.com/484968 + var halfFloatTenK = 0x70E2; // Half float 10000 + var pixels = new Uint16Array([halfFloatTenK, halfFloatTenK, halfFloatTenK, halfFloatTenK]); + gl.texSubImage2D(targets[tt], 0, 0, 0, 1, 1, gl[pixelFormat], gl[pixelType], pixels); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Texture should be backed by half-floats"); + } + } + } + + if (false) { + var m = wtu.makeImageFromCanvas(gl.canvas); + document.getElementById("console").appendChild(m); + document.getElementById("console").appendChild(document.createElement("hr")); + } + + return texture; + } + + function runTest(canvas) + { + var ctx = canvas.getContext("2d"); + + var cases = [ + { sub: false, flipY: true, font: false, init: setCanvasToMin }, + { sub: false, flipY: false, font: false }, + { sub: true, flipY: true, font: false }, + { sub: true, flipY: false, font: false }, + { sub: false, flipY: true, font: false, init: setCanvasTo257x257 }, + { sub: false, flipY: false, font: false }, + { sub: true, flipY: true, font: false }, + { sub: true, flipY: false, font: false }, + { sub: false, flipY: true, font: true, init: drawTextInCanvas }, + { sub: false, flipY: false, font: true }, + { sub: true, flipY: true, font: true }, + { sub: true, flipY: false, font: true }, + ]; + + function runTexImageTest(bindingTarget) { + var program; + if (bindingTarget == gl.TEXTURE_2D) { + program = tiu.setupTexturedQuad(gl, internalFormat); + } else { + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + } + + return new Promise(function(resolve, reject) { + var count = 4; + var caseNdx = 0; + var texture = undefined; + function runNextTest() { + var c = cases[caseNdx]; + var imageDataBefore = null; + if (c.init) { + c.init(ctx, bindingTarget); + imageDataBefore = ctx.getImageData(0, 0, canvas.width, canvas.height); + } + texture = runOneIteration(canvas, c.sub, c.flipY, program, bindingTarget, texture, c.font); + if (c.init) { + debug("Checking if pixel values in source canvas change after canvas used as webgl texture"); + checkSourceCanvasImageData(imageDataBefore, ctx.getImageData(0, 0, canvas.width, canvas.height)); + } + // for the first 2 iterations always make a new texture. + if (count > 2) { + gl.deleteTexture(texture); + texture = undefined; + } + ++caseNdx; + if (caseNdx == cases.length) { + caseNdx = 0; + --count; + if (!count) { + resolve("SUCCESS"); + return; + } + } + wtu.waitForComposite(runNextTest); + } + runNextTest(); + }); + } + + runTexImageTest(gl.TEXTURE_2D).then(function(val) { + runTexImageTest(gl.TEXTURE_CUBE_MAP).then(function(val) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + }); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js new file mode 100644 index 000000000..2b8d04740 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js @@ -0,0 +1,63 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking ImageBitmap created from a Blob (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var xhr = new XMLHttpRequest(); + xhr.open("GET", resourcePath + "red-green-semi-transparent.png"); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + var blob = xhr.response; + runImageBitmapTest(blob, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false); + finishTest(); + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js new file mode 100644 index 000000000..98ec219c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js @@ -0,0 +1,89 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking ImageBitmap created from an HTMLCanvasElement (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var testCanvas = document.createElement('canvas'); + var ctx = testCanvas.getContext("2d"); + setCanvasToMin(ctx); + runImageBitmapTest(testCanvas, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false); + + setCanvasTo257x257(ctx); + runImageBitmapTest(testCanvas, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false); + finishTest(); + } + + function setCanvasToRedGreen(ctx) { + var width = ctx.canvas.width; + var halfWidth = Math.floor(width / 2); + var height = ctx.canvas.height; + var halfHeight = Math.floor(height / 2); + ctx.fillStyle = "rgba(255, 0, 0, 1)"; + ctx.fillRect(0, 0, halfWidth, halfHeight); + ctx.fillStyle = "rgba(255, 0, 0, 0.5)"; + ctx.fillRect(halfWidth, 0, halfWidth, halfHeight); + ctx.fillStyle = "rgba(0, 255, 0, 1)"; + ctx.fillRect(0, halfHeight, halfWidth, halfHeight); + ctx.fillStyle = "rgba(0, 255, 0, 0.5)"; + ctx.fillRect(halfWidth, halfHeight, halfWidth, halfHeight); + } + + function setCanvasToMin(ctx) { + ctx.canvas.width = 2; + ctx.canvas.height = 2; + setCanvasToRedGreen(ctx); + } + + function setCanvasTo257x257(ctx) { + ctx.canvas.width = 257; + ctx.canvas.height = 257; + setCanvasToRedGreen(ctx); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js new file mode 100644 index 000000000..6c07b5dbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js @@ -0,0 +1,67 @@ +/* +** Copyright (c) 2015 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking ImageBitmap created from an ImageBitmap (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + gl.disable(gl.BLEND); + + var imageData = new ImageData(new Uint8ClampedArray( + [255, 0, 0, 255, + 255, 0, 0, 0, + 0, 255, 0, 255, + 0, 255, 0, 0]), + 2, 2); + + createImageBitmap(imageData, {imageOrientation: "none", premultiplyAlpha: "none"}).then(function(bitmap) { + // bitmap is in unpremultiplied form + runImageBitmapTest(bitmap, 0, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false); + finishTest(); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js new file mode 100644 index 000000000..1c26db6ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js @@ -0,0 +1,64 @@ +/* +** Copyright (c) 2015 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking ImageBitmap created from ImageData (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + gl.disable(gl.BLEND); + + var imageData = new ImageData(new Uint8ClampedArray( + [255, 0, 0, 255, + 255, 0, 0, 0, + 0, 255, 0, 255, + 0, 255, 0, 0]), + 2, 2); + + runImageBitmapTest(imageData, 0, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false); + finishTest(); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js new file mode 100644 index 000000000..e242b8606 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js @@ -0,0 +1,61 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking ImageBitmap created from an HTMLImageElement (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var image = new Image(); + image.onload = function() { + bufferedLogToConsole("Source image has been loaded"); + runImageBitmapTest(image, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false); + finishTest(); + } + image.src = resourcePath + "red-green-semi-transparent.png"; + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js new file mode 100644 index 000000000..1ef2dabe2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js @@ -0,0 +1,61 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking ImageBitmap created from an HTMLVideoElement (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var video = document.createElement("video"); + video.oncanplaythrough = function() { + runImageBitmapTest(video, 1, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false); + finishTest(); + } + video.src = resourcePath + "red-green.theora.ogv"; + document.body.appendChild(video); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-data.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-data.js new file mode 100644 index 000000000..80abb697c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image-data.js @@ -0,0 +1,267 @@ +/* +** 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var imageData = null; + var blackColor = [0, 0, 0]; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking ImageData (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + gl.disable(gl.BLEND); + + var canvas2d = document.getElementById("texcanvas"); + var context2d = canvas2d.getContext("2d"); + imageData = context2d.createImageData(2, 2); + var data = imageData.data; + data[0] = 255; + data[1] = 0; + data[2] = 0; + data[3] = 255; + data[4] = 255; + data[5] = 0; + data[6] = 0; + data[7] = 0; + data[8] = 0; + data[9] = 255; + data[10] = 0; + data[11] = 255; + data[12] = 0; + data[13] = 255; + data[14] = 0; + data[15] = 0; + + runTest(); + } + + function runOneIteration(useTexSubImage2D, flipY, premultiplyAlpha, + sourceSubRectangle, expected, + bindingTarget, program) + { + sourceSubRectangleString = ''; + if (sourceSubRectangle) { + sourceSubRectangleString = ', sourceSubRectangle=' + sourceSubRectangle; + } + debug(''); + debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + + ' with flipY=' + flipY + ' and premultiplyAlpha=' + premultiplyAlpha + + ', bindingTarget=' + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP') + + sourceSubRectangleString); + + var loc; + var skipCorner = false; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + switch (gl[pixelFormat]) { + case gl.RED_INTEGER: + case gl.RG_INTEGER: + case gl.RGB_INTEGER: + case gl.RGBA_INTEGER: + // https://github.com/KhronosGroup/WebGL/issues/1819 + skipCorner = true; + break; + } + } + + if (skipCorner && expected.length == 1 && (flipY ^ sourceSubRectangle[1] == 0)) { + debug("Test skipped, see WebGL#1819"); + return; + } + + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Enable writes to the RGBA channels + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiplyAlpha); + var targets = [gl.TEXTURE_2D]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + // Handle the source sub-rectangle if specified (WebGL 2.0 only) + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + } + // Upload the image into the texture + for (var tt = 0; tt < targets.length; ++tt) { + if (sourceSubRectangle) { + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(targets[tt], 0, gl[internalFormat], + sourceSubRectangle[2], sourceSubRectangle[3], 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, + sourceSubRectangle[2], sourceSubRectangle[3], + gl[pixelFormat], gl[pixelType], imageData); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], + sourceSubRectangle[2], sourceSubRectangle[3], 0, + gl[pixelFormat], gl[pixelType], imageData); + } + } else { + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(targets[tt], 0, gl[internalFormat], imageData.width, imageData.height, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, gl[pixelFormat], gl[pixelType], imageData); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], gl[pixelFormat], gl[pixelType], imageData); + } + } + } + + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + } + + var width = gl.canvas.width; + var halfWidth = Math.floor(width / 2); + var height = gl.canvas.height; + var halfHeight = Math.floor(height / 2); + + var top = 0; + var bottom = height - halfHeight; + var left = 0; + var right = width - halfWidth; + + var tl, tr, bl, br; + if (expected.length == 1) { + tl = tr = bl = br = expected[0]; + } else { + tl = expected[0]; + tr = expected[1]; + bl = expected[2]; + br = expected[3]; + } + + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + + // Check the top pixel and bottom pixel and make sure they have + // the right color. + wtu.checkCanvasRect(gl, left, top, halfWidth, halfHeight, tl, "shouldBe " + tl); + if (!skipCorner) { + wtu.checkCanvasRect(gl, right, top, halfWidth, halfHeight, tr, "shouldBe " + tr); + } + wtu.checkCanvasRect(gl, left, bottom, halfWidth, halfHeight, bl, "shouldBe " + bl); + if (!skipCorner) { + wtu.checkCanvasRect(gl, right, bottom, halfWidth, halfHeight, br, "shouldBe " + br); + } + } + } + + function runTest() + { + var program = tiu.setupTexturedQuad(gl, internalFormat); + runTestOnBindingTarget(gl.TEXTURE_2D, program); + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + runTestOnBindingTarget(gl.TEXTURE_CUBE_MAP, program); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + } + + function runTestOnBindingTarget(bindingTarget, program) { + var k = blackColor; + var r = redColor; + var g = greenColor; + var cases = [ + { expected: [r, r, g, g], flipY: false, premultiplyAlpha: false, sub: false }, + { expected: [r, r, g, g], flipY: false, premultiplyAlpha: false, sub: true }, + { expected: [r, k, g, k], flipY: false, premultiplyAlpha: true, sub: false }, + { expected: [r, k, g, k], flipY: false, premultiplyAlpha: true, sub: true }, + { expected: [g, g, r, r], flipY: true, premultiplyAlpha: false, sub: false }, + { expected: [g, g, r, r], flipY: true, premultiplyAlpha: false, sub: true }, + { expected: [g, k, r, k], flipY: true, premultiplyAlpha: true, sub: false }, + { expected: [g, k, r, k], flipY: true, premultiplyAlpha: true, sub: true }, + ]; + + if (wtu.getDefault3DContextVersion() > 1) { + var morecases = []; + // Make 2 copies of the original case: top left and bottom right 1x1 rectangles + for (var i = 0; i < cases.length; i++) { + for (var subX = 0; subX <= 1; subX++) { + var subY = subX == 0 ? 1 : 0; + // shallow-copy cases[i] into newcase + var newcase = Object.assign({}, cases[i]); + newcase.expected = [cases[i].expected[subY * 2 + subX]]; + newcase.sourceSubRectangle = [subX, subY, 1, 1]; + morecases.push(newcase); + } + } + cases = cases.concat(morecases); + } + + for (var i in cases) { + runOneIteration(cases[i].sub, cases[i].flipY, cases[i].premultiplyAlpha, + cases[i].sourceSubRectangle, cases[i].expected, + bindingTarget, program); + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image.js new file mode 100644 index 000000000..51de6018d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-image.js @@ -0,0 +1,263 @@ +/* +** 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var imgCanvas; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking image elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + wtu.loadTexture(gl, resourcePath + "red-green.png", runTest); + } + + function runOneIteration(image, useTexSubImage2D, flipY, topColor, bottomColor, + sourceSubRectangle, bindingTarget, program) + { + sourceSubRectangleString = ''; + if (sourceSubRectangle) { + sourceSubRectangleString = ' sourceSubRectangle=' + sourceSubRectangle; + } + debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + + ' with ' + image.width + 'x' + image.height + ' flipY=' + flipY + ' bindingTarget=' + + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP') + + sourceSubRectangleString); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + var targets = [gl.TEXTURE_2D]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + // Handle the source sub-rectangle if specified (WebGL 2.0 only) + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + } + // Upload the image into the texture + for (var tt = 0; tt < targets.length; ++tt) { + if (sourceSubRectangle) { + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(targets[tt], 0, gl[internalFormat], + sourceSubRectangle[2], sourceSubRectangle[3], 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, + sourceSubRectangle[2], sourceSubRectangle[3], + gl[pixelFormat], gl[pixelType], image); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], + sourceSubRectangle[2], sourceSubRectangle[3], 0, + gl[pixelFormat], gl[pixelType], image); + } + } else { + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(targets[tt], 0, gl[internalFormat], image.width, image.height, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, gl[pixelFormat], gl[pixelType], image); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], gl[pixelFormat], gl[pixelType], image); + } + } + } + + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + } + + var loc; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + } + + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + + // Draw the triangles + wtu.clearAndDrawUnitQuad(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); + } + } + + function runTestOnImage(image) { + var cases = [ + { sub: false, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: false, flipY: false, topColor: greenColor, bottomColor: redColor }, + { sub: true, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: true, flipY: false, topColor: greenColor, bottomColor: redColor }, + ]; + + + if (wtu.getDefault3DContextVersion() > 1) { + cases = cases.concat([ + { sub: false, flipY: false, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [0, 0, 1, 1] }, + { sub: false, flipY: true, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [0, 0, 1, 1] }, + { sub: false, flipY: false, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [0, 1, 1, 1] }, + { sub: false, flipY: true, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [0, 1, 1, 1] }, + { sub: true, flipY: false, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [0, 0, 1, 1] }, + { sub: true, flipY: true, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [0, 0, 1, 1] }, + { sub: true, flipY: false, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [0, 1, 1, 1] }, + { sub: true, flipY: true, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [0, 1, 1, 1] }, + ]); + } + + var program = tiu.setupTexturedQuad(gl, internalFormat); + for (var i in cases) { + runOneIteration(image, cases[i].sub, cases[i].flipY, + cases[i].topColor, cases[i].bottomColor, + cases[i].sourceSubRectangle, + gl.TEXTURE_2D, program); + } + // cube map texture must be square. + if (image.width != image.height) + return; + // Skip sub-rectangle tests for cube map textures for the moment. + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + for (var i in cases) { + if (!cases[i].sourceSubRectangle) { + runOneIteration(image, cases[i].sub, cases[i].flipY, + cases[i].topColor, cases[i].bottomColor, + undefined, + gl.TEXTURE_CUBE_MAP, program); + } + } + } + + function runTest(image) + { + runTestOnImage(image); + + imgCanvas = document.createElement("canvas"); + imgCanvas.width = 2; + imgCanvas.height = 2; + var imgCtx = imgCanvas.getContext("2d"); + var imgData = imgCtx.createImageData(2, 2); + imgData.data[0] = redColor[0]; + imgData.data[1] = redColor[1]; + imgData.data[2] = redColor[2]; + imgData.data[3] = 255; + imgData.data[4] = redColor[0]; + imgData.data[5] = redColor[1]; + imgData.data[6] = redColor[2]; + imgData.data[7] = 255; + imgData.data[8] = greenColor[0]; + imgData.data[9] = greenColor[1]; + imgData.data[10] = greenColor[2]; + imgData.data[11] = 255; + imgData.data[12] = greenColor[0]; + imgData.data[13] = greenColor[1]; + imgData.data[14] = greenColor[2]; + imgData.data[15] = 255; + imgCtx.putImageData(imgData, 0, 0); + + // apparently Image is different than . + var newImage = new Image(); + newImage.onload = function() { + runTest2(newImage); + }; + newImage.onerror = function() { + testFailed("Creating image from canvas failed. Image src: " + this.src); + finishTest(); + }; + newImage.src = imgCanvas.toDataURL(); + } + + function runTest2(image) { + runTestOnImage(image); + + wtu.makeImageFromCanvas(imgCanvas, function() { + runTest3(this); + }); + } + + function runTest3(image) { + runTestOnImage(image); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-svg-image.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-svg-image.js new file mode 100644 index 000000000..be5a845b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-svg-image.js @@ -0,0 +1,148 @@ +/* +** Copyright (c) 2013 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var imgCanvas; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking SVG image elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + wtu.loadTexture(gl, resourcePath + "red-green.svg", runTest); + } + + function runOneIteration(image, useTexSubImage2D, flipY, topColor, bottomColor, bindingTarget, program) + { + debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + + ' with flipY=' + flipY + ' bindingTarget=' + + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP')); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + var targets = [gl.TEXTURE_2D]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + // Upload the image into the texture + for (var tt = 0; tt < targets.length; ++tt) { + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(targets[tt], 0, gl[internalFormat], image.width, image.height, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, gl[pixelFormat], gl[pixelType], image); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], gl[pixelFormat], gl[pixelType], image); + } + } + + var loc; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + } + + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + // Draw the triangles + wtu.clearAndDrawUnitQuad(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); + } + } + + function runTest(image) + { + var program = tiu.setupTexturedQuad(gl, internalFormat); + runTestOnBindingTarget(image, gl.TEXTURE_2D, program); + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + runTestOnBindingTarget(image, gl.TEXTURE_CUBE_MAP, program); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + } + + function runTestOnBindingTarget(image, bindingTarget, program) { + var cases = [ + { sub: false, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: false, flipY: false, topColor: greenColor, bottomColor: redColor }, + { sub: true, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: true, flipY: false, topColor: greenColor, bottomColor: redColor }, + ]; + for (var i in cases) { + runOneIteration(image, cases[i].sub, cases[i].flipY, + cases[i].topColor, cases[i].bottomColor, + bindingTarget, program); + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-video.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-video.js new file mode 100644 index 000000000..2d0103059 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-video.js @@ -0,0 +1,299 @@ +/* +** 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. +*/ + +// This block needs to be outside the onload handler in order for this +// test to run reliably in WebKit's test harness (at least the +// Chromium port). https://bugs.webkit.org/show_bug.cgi?id=87448 +initTestingHarness(); + +var old = debug; +var debug = function(msg) { + bufferedLogToConsole(msg); + old(msg); +}; + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + // Test each format separately because many browsers implement each + // differently. Some might be GPU accelerated, some might not. Etc... + var videos = [ + { src: resourcePath + "red-green.mp4" , type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', }, + { src: resourcePath + "red-green.webmvp8.webm", type: 'video/webm; codecs="vp8, vorbis"', }, + { src: resourcePath + "red-green.webmvp9.webm", type: 'video/webm; codecs="vp9"', }, + { src: resourcePath + "red-green.theora.ogv", type: 'video/ogg; codecs="theora, vorbis"', }, + ]; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking video elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + runTest(); + } + + function runOneIteration(videoElement, useTexSubImage2D, flipY, topColor, bottomColor, sourceSubRectangle, program, bindingTarget) + { + sourceSubRectangleString = ''; + if (sourceSubRectangle) { + sourceSubRectangleString = ' sourceSubRectangle=' + sourceSubRectangle; + } + debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + + ' with flipY=' + flipY + ' bindingTarget=' + + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP') + + sourceSubRectangleString); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + var targets = [gl.TEXTURE_2D]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + // Handle the source sub-rectangle if specified (WebGL 2.0 only) + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + } + // Upload the videoElement into the texture + for (var tt = 0; tt < targets.length; ++tt) { + if (sourceSubRectangle) { + // Initialize the texture to black first + if (useTexSubImage2D) { + // Skip sub-rectangle tests for cube map textures for the moment. + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + continue; + } + gl.texImage2D(targets[tt], 0, gl[internalFormat], + sourceSubRectangle[2], sourceSubRectangle[3], 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, + sourceSubRectangle[2], sourceSubRectangle[3], + gl[pixelFormat], gl[pixelType], videoElement); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], + sourceSubRectangle[2], sourceSubRectangle[3], 0, + gl[pixelFormat], gl[pixelType], videoElement); + } + } else { + // Initialize the texture to black first + if (useTexSubImage2D) { + var width = videoElement.videoWidth; + var height = videoElement.videoHeight; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + // cube map texture must be square. + width = Math.max(width, height); + height = width; + } + gl.texImage2D(targets[tt], 0, gl[internalFormat], + width, height, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, gl[pixelFormat], gl[pixelType], videoElement); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], gl[pixelFormat], gl[pixelType], videoElement); + } + } + } + + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + } + + 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); + + var loc; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + } + + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + // Check a few pixels near the top and bottom and make sure they have + // the right color. + var tolerance = 5; + debug("Checking lower left corner"); + wtu.checkCanvasRect(gl, 4, 4, 2, 2, bottomColor, + "shouldBe " + bottomColor, tolerance); + debug("Checking upper left corner"); + wtu.checkCanvasRect(gl, 4, gl.canvas.height - 8, 2, 2, topColor, + "shouldBe " + topColor, tolerance); + } + } + + function runTest(videoElement) + { + var cases = [ + { sub: false, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: false, flipY: false, topColor: greenColor, bottomColor: redColor }, + { sub: true, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: true, flipY: false, topColor: greenColor, bottomColor: redColor }, + ]; + + if (wtu.getDefault3DContextVersion() > 1) { + cases = cases.concat([ + { sub: false, flipY: false, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [20, 16, 40, 32] }, + { sub: false, flipY: true, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [20, 16, 40, 32] }, + { sub: false, flipY: false, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [20, 80, 40, 32] }, + { sub: false, flipY: true, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [20, 80, 40, 32] }, + { sub: true, flipY: false, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [20, 16, 40, 32] }, + { sub: true, flipY: true, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [20, 16, 40, 32] }, + { sub: true, flipY: false, topColor: greenColor, bottomColor: greenColor, + sourceSubRectangle: [20, 80, 40, 32] }, + { sub: true, flipY: true, topColor: redColor, bottomColor: redColor, + sourceSubRectangle: [20, 80, 40, 32] }, + ]); + } + + function runTexImageTest(bindingTarget) { + var program; + if (bindingTarget == gl.TEXTURE_2D) { + program = tiu.setupTexturedQuad(gl, internalFormat); + } else { + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + } + + return new Promise(function(resolve, reject) { + var videoNdx = 0; + var video; + function runNextVideo() { + if (video) { + video.pause(); + } + + if (videoNdx == videos.length) { + resolve("SUCCESS"); + return; + } + + var info = videos[videoNdx++]; + debug(""); + debug("testing: " + info.type); + video = document.createElement("video"); + var canPlay = true; + if (!video.canPlayType) { + testFailed("video.canPlayType required method missing"); + runNextVideo(); + return; + } + + if(!video.canPlayType(info.type).replace(/no/, '')) { + debug(info.type + " unsupported"); + runNextVideo(); + return; + }; + + document.body.appendChild(video); + video.type = info.type; + video.src = info.src; + wtu.startPlayingAndWaitForVideo(video, runTest); + } + function runTest() { + for (var i in cases) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + // Cube map texture must be square but video is not square. + if (!cases[i].sub) { + break; + } + // Skip sub-rectangle tests for cube map textures for the moment. + if (cases[i].sourceSubRectangle) { + break; + } + } + runOneIteration(video, cases[i].sub, cases[i].flipY, + cases[i].topColor, cases[i].bottomColor, + cases[i].sourceSubRectangle, + program, bindingTarget); + } + runNextVideo(); + } + runNextVideo(); + }); + } + + runTexImageTest(gl.TEXTURE_2D).then(function(val) { + runTexImageTest(gl.TEXTURE_CUBE_MAP).then(function(val) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + }); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js new file mode 100644 index 000000000..534965ba3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js @@ -0,0 +1,249 @@ +/* +** Copyright (c) 2014 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage2D and texSubImage2D code paths taking webgl canvas elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + runTest(); + } + + function setCanvasToRedGreen(ctx) { + var width = ctx.canvas.width; + var height = ctx.canvas.height; + var halfHeight = Math.floor(height / 2); + + ctx.viewport(0, 0, width, height); + + ctx.enable(ctx.SCISSOR_TEST); + ctx.scissor(0, 0, width, halfHeight); + ctx.clearColor(1.0, 0, 0, 1.0); + ctx.clear(ctx.COLOR_BUFFER_BIT); + ctx.scissor(0, halfHeight, width, height - halfHeight); + ctx.clearColor(0.0, 1.0, 0, 1.0); + ctx.clear(ctx.COLOR_BUFFER_BIT); + ctx.disable(ctx.SCISSOR_TEST); + } + + function setCanvasTo257x257(ctx, bindingTarget) { + ctx.canvas.width = 257; + ctx.canvas.height = 257; + setCanvasToRedGreen(ctx); + } + + function setCanvasToMin(ctx, bindingTarget) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + // cube map texture must be square. + ctx.canvas.width = 2; + } else { + ctx.canvas.width = 1; + } + ctx.canvas.height = 2; + setCanvasToRedGreen(ctx); + } + + function runOneIteration(canvas, useTexSubImage2D, flipY, program, bindingTarget, opt_texture) + { + debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + ' with flipY=' + + flipY + ' bindingTarget=' + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP') + + ' canvas size: ' + canvas.width + 'x' + canvas.height + ' with red-green'); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + if (!opt_texture) { + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + } else { + var texture = opt_texture; + } + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + var targets = [gl.TEXTURE_2D]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + // Upload the image into the texture + for (var tt = 0; tt < targets.length; ++tt) { + // Initialize the texture to black first + if (useTexSubImage2D) { + gl.texImage2D(targets[tt], 0, gl[internalFormat], canvas.width, canvas.height, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, gl[pixelFormat], gl[pixelType], canvas); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], gl[pixelFormat], gl[pixelType], canvas); + } + } + + var width = gl.canvas.width; + var height = gl.canvas.height; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + var top = flipY ? (height - halfHeight) : 0; + var bottom = flipY ? 0 : (height - halfHeight); + + var loc; + var skipCorner = false; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + switch (gl[pixelFormat]) { + case gl.RED_INTEGER: + case gl.RG_INTEGER: + case gl.RGB_INTEGER: + case gl.RGBA_INTEGER: + // https://github.com/KhronosGroup/WebGL/issues/1819 + skipCorner = true; + break; + } + } + + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 255, 0, 255]); + + // Check the top and bottom halves and make sure they have the right color. + debug("Checking " + (flipY ? "top" : "bottom")); + wtu.checkCanvasRect(gl, 0, bottom, (skipCorner && !flipY) ? halfWidth : width, halfHeight, redColor, + "shouldBe " + redColor); + debug("Checking " + (flipY ? "bottom" : "top")); + wtu.checkCanvasRect(gl, 0, top, (skipCorner && flipY) ? halfWidth : width, halfHeight, greenColor, + "shouldBe " + greenColor); + } + + if (false) { + var ma = wtu.makeImageFromCanvas(canvas); + document.getElementById("console").appendChild(ma); + + var m = wtu.makeImageFromCanvas(gl.canvas); + document.getElementById("console").appendChild(m); + document.getElementById("console").appendChild(document.createElement("hr")); + } + + return texture; + } + + function runTest() + { + var ctx = wtu.create3DContext(); + var canvas = ctx.canvas; + + var cases = [ + { sub: false, flipY: true, init: setCanvasToMin }, + { sub: false, flipY: false }, + { sub: true, flipY: true }, + { sub: true, flipY: false }, + { sub: false, flipY: true, init: setCanvasTo257x257 }, + { sub: false, flipY: false }, + { sub: true, flipY: true }, + { sub: true, flipY: false }, + ]; + + function runTexImageTest(bindingTarget) { + var program; + if (bindingTarget == gl.TEXTURE_2D) { + program = tiu.setupTexturedQuad(gl, internalFormat); + } else { + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + } + + return new Promise(function(resolve, reject) { + var count = 4; + var caseNdx = 0; + var texture = undefined; + function runNextTest() { + var c = cases[caseNdx]; + if (c.init) { + c.init(ctx, bindingTarget); + } + texture = runOneIteration(canvas, c.sub, c.flipY, program, bindingTarget, texture); + // for the first 2 iterations always make a new texture. + if (count > 2) { + texture = undefined; + } + ++caseNdx; + if (caseNdx == cases.length) { + caseNdx = 0; + --count; + if (!count) { + resolve("SUCCESS"); + return; + } + } + wtu.waitForComposite(runNextTest); + } + runNextTest(); + }); + } + + runTexImageTest(gl.TEXTURE_2D).then(function(val) { + runTexImageTest(gl.TEXTURE_CUBE_MAP).then(function(val) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + }); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas-sub-rectangle.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas-sub-rectangle.js new file mode 100644 index 000000000..be7e2cea4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas-sub-rectangle.js @@ -0,0 +1,304 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var realRedColor = [255, 0, 0]; + var realGreenColor = [0, 255, 0]; + var realBlueColor = [0, 0, 255]; + var realCyanColor = [0, 255, 255]; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + var blueColor = [0, 0, 255]; + var cyanColor = [0, 255, 255]; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking a sub-rectangle of a canvas (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + blueColor = [0, 0, 0]; + cyanColor = [0, 0, 0]; + break; + + case gl.RG: + case gl.RG_INTEGER: + blueColor = [0, 0, 0]; + cyanColor = [0, 255, 0]; + break; + + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var canvas2d = document.createElement('canvas'); + runTest(canvas2d, setupSourceCanvas2D, '2D-rendered canvas'); + + var canvasWebGL = document.createElement('canvas'); + runTest(canvasWebGL, setupSourceCanvasWebGL, 'WebGL-rendered canvas'); + + finishTest(); + } + + function uploadCanvasToTexture(canvas, useTexSubImage3D, flipY, bindingTarget, + depth, sourceSubRectangle, unpackImageHeight) + { + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); + var uploadWidth = canvas.width; + var uploadHeight = canvas.height; + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + uploadWidth = sourceSubRectangle[2]; + uploadHeight = sourceSubRectangle[3]; + } + if (unpackImageHeight) { + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, unpackImageHeight); + } + // Upload the image into the texture + if (useTexSubImage3D) { + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(bindingTarget, 0, 0, 0, 0, uploadWidth, uploadHeight, depth, + gl[pixelFormat], gl[pixelType], canvas); + } else { + gl.texImage3D(bindingTarget, 0, gl[internalFormat], uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], canvas); + } + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors from texture upload"); + } + + function fillStyle2D(ctx, color) { + ctx.fillStyle = 'rgb(' + color[0] + ', ' + color[1] + ', ' + color[2] + ')'; + } + + function setupSourceCanvas2D(canvas) { + var width = canvas.width; + var height = canvas.height; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + + var ctx = canvas.getContext('2d'); + // Always use the same pattern for this test: four quadrants: + // red green + // blue cyan + // Handle odd-sized canvases + fillStyle2D(ctx, realRedColor); + ctx.fillRect(0, 0, halfWidth, halfHeight); + fillStyle2D(ctx, realGreenColor); + ctx.fillRect(halfWidth, 0, width - halfWidth, halfHeight); + fillStyle2D(ctx, realBlueColor); + ctx.fillRect(0, halfHeight, halfWidth, height - halfHeight); + fillStyle2D(ctx, realCyanColor); + ctx.fillRect(halfWidth, halfHeight, width - halfWidth, height - halfHeight); + } + + function clearColorWebGL(ctx, color) { + ctx.clearColor(color[0] / 255.0, color[1] / 255.0, color[2] / 255.0, 1.0); + ctx.clear(ctx.COLOR_BUFFER_BIT); + } + + function setupSourceCanvasWebGL(canvas) { + var width = canvas.width; + var height = canvas.height; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + + var ctx = canvas.getContext('webgl'); + // Always use the same pattern for this test: four quadrants: + // red green + // blue cyan + // Handle odd-sized canvases + + ctx.viewport(0, 0, width, height); + ctx.enable(ctx.SCISSOR_TEST); + // OpenGL origin is lower-left + ctx.scissor(0, 0, halfWidth, halfHeight); + clearColorWebGL(ctx, realBlueColor); + ctx.scissor(halfWidth, 0, width - halfWidth, halfHeight); + clearColorWebGL(ctx, realCyanColor); + ctx.scissor(0, halfHeight, halfWidth, height - halfHeight); + clearColorWebGL(ctx, realRedColor); + ctx.scissor(halfWidth, halfHeight, width - halfWidth, height - halfHeight); + clearColorWebGL(ctx, realGreenColor); + } + + function runOneIteration(canvas, useTexSubImage3D, flipY, bindingTarget, + depth, sourceSubRectangle, unpackImageHeight, + rTextureCoord, expectedColor, program, + canvasSize, canvasSetupFunction, sourceDescription) + { + debug(''); + debug('Testing ' + sourceDescription + ' with ' + + (useTexSubImage3D ? 'texSubImage3D' : 'texImage3D') + + ', flipY=' + flipY + ', bindingTarget=' + + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY') + + ', sourceSubRectangle=' + sourceSubRectangle + + ', depth=' + depth + + (unpackImageHeight ? ', unpackImageHeight=' + unpackImageHeight : '') + + ', rTextureCoord=' + rTextureCoord); + + // Initialize the contents of the source canvas. + var width = canvasSize[0]; + var height = canvasSize[1]; + var halfWidth = Math.floor(width / 2); + var halfHeight = Math.floor(height / 2); + canvas.width = width; + canvas.height = height; + canvasSetupFunction(canvas); + + uploadCanvasToTexture(canvas, useTexSubImage3D, flipY, bindingTarget, + depth, sourceSubRectangle, unpackImageHeight); + var rCoordLocation = gl.getUniformLocation(program, 'uRCoord'); + if (!rCoordLocation) { + testFailed('Shader incorrectly set up; couldn\'t find uRCoord uniform'); + return; + } + gl.uniform1f(rCoordLocation, rTextureCoord); + + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + // Check the rendered canvas + wtu.checkCanvasRect(gl, 0, 0, canvasSize[0], canvasSize[1], expectedColor, "shouldBe " + expectedColor); + } + + function runTest(canvas, canvasSetupFunction, sourceDescription) + { + var cases = [ + // Small canvas cases. Expected that these won't be + // GPU-accelerated in most browsers' implementations. + + // No UNPACK_IMAGE_HEIGHT specified. + { expected: redColor, flipY: false, size: [4, 4], subRect: [0, 0, 2, 2], depth: 2, rTextureCoord: 0.0 }, + { expected: blueColor, flipY: false, size: [4, 4], subRect: [0, 0, 2, 2], depth: 2, rTextureCoord: 1.0 }, + { expected: blueColor, flipY: true, size: [4, 4], subRect: [0, 0, 2, 2], depth: 2, rTextureCoord: 0.0 }, + { expected: redColor, flipY: true, size: [4, 4], subRect: [0, 0, 2, 2], depth: 2, rTextureCoord: 1.0 }, + { expected: greenColor, flipY: false, size: [4, 4], subRect: [2, 0, 2, 2], depth: 2, rTextureCoord: 0.0 }, + { expected: cyanColor, flipY: false, size: [4, 4], subRect: [2, 0, 2, 2], depth: 2, rTextureCoord: 1.0 }, + { expected: cyanColor, flipY: true, size: [4, 4], subRect: [2, 0, 2, 2], depth: 2, rTextureCoord: 0.0 }, + { expected: greenColor, flipY: true, size: [4, 4], subRect: [2, 0, 2, 2], depth: 2, rTextureCoord: 1.0 }, + + // Use UNPACK_IMAGE_HEIGHT to skip some pixels. + { expected: redColor, flipY: false, size: [4, 4], subRect: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0 }, + { expected: blueColor, flipY: false, size: [4, 4], subRect: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0 }, + { expected: blueColor, flipY: true, size: [4, 4], subRect: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0 }, + { expected: redColor, flipY: true, size: [4, 4], subRect: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0 }, + { expected: greenColor, flipY: false, size: [4, 4], subRect: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0 }, + { expected: cyanColor, flipY: false, size: [4, 4], subRect: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0 }, + { expected: cyanColor, flipY: true, size: [4, 4], subRect: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0 }, + { expected: greenColor, flipY: true, size: [4, 4], subRect: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0 }, + + // Larger canvas cases. Expected that these will be + // GPU-accelerated in most browsers' implementations. + // Changes will be gladly accepted to trigger more + // browsers' heuristics to accelerate these canvases. + + // No UNPACK_IMAGE_HEIGHT specified. + { expected: redColor, flipY: false, size: [384, 384], subRect: [0, 0, 192, 192], depth: 2, rTextureCoord: 0.0 }, + { expected: blueColor, flipY: false, size: [384, 384], subRect: [0, 0, 192, 192], depth: 2, rTextureCoord: 1.0 }, + { expected: blueColor, flipY: true, size: [384, 384], subRect: [0, 0, 192, 192], depth: 2, rTextureCoord: 0.0 }, + { expected: redColor, flipY: true, size: [384, 384], subRect: [0, 0, 192, 192], depth: 2, rTextureCoord: 1.0 }, + { expected: greenColor, flipY: false, size: [384, 384], subRect: [192, 0, 192, 192], depth: 2, rTextureCoord: 0.0 }, + { expected: cyanColor, flipY: false, size: [384, 384], subRect: [192, 0, 192, 192], depth: 2, rTextureCoord: 1.0 }, + { expected: cyanColor, flipY: true, size: [384, 384], subRect: [192, 0, 192, 192], depth: 2, rTextureCoord: 0.0 }, + { expected: greenColor, flipY: true, size: [384, 384], subRect: [192, 0, 192, 192], depth: 2, rTextureCoord: 1.0 }, + + // Use UNPACK_IMAGE_HEIGHT to skip some pixels. + { expected: redColor, flipY: false, size: [384, 384], subRect: [0, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 0.0 }, + { expected: blueColor, flipY: false, size: [384, 384], subRect: [0, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 1.0 }, + { expected: blueColor, flipY: true, size: [384, 384], subRect: [0, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 0.0 }, + { expected: redColor, flipY: true, size: [384, 384], subRect: [0, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 1.0 }, + { expected: greenColor, flipY: false, size: [384, 384], subRect: [192, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 0.0 }, + { expected: cyanColor, flipY: false, size: [384, 384], subRect: [192, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 1.0 }, + { expected: cyanColor, flipY: true, size: [384, 384], subRect: [192, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 0.0 }, + { expected: greenColor, flipY: true, size: [384, 384], subRect: [192, 0, 96, 96], depth: 2, unpackImageHeight: 192, rTextureCoord: 1.0 }, + ]; + + var program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + for (var i in cases) { + runOneIteration(canvas, false, cases[i].flipY, gl.TEXTURE_3D, + cases[i].depth, cases[i].subRect, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].expected, + program, cases[i].size, canvasSetupFunction, sourceDescription); + runOneIteration(canvas, true, cases[i].flipY, gl.TEXTURE_3D, + cases[i].depth, cases[i].subRect, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].expected, + program, cases[i].size, canvasSetupFunction, sourceDescription); + } + + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + for (var i in cases) { + runOneIteration(canvas, false, cases[i].flipY, gl.TEXTURE_2D_ARRAY, + cases[i].depth, cases[i].subRect, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].expected, + program, cases[i].size, canvasSetupFunction, sourceDescription); + runOneIteration(canvas, true, cases[i].flipY, gl.TEXTURE_2D_ARRAY, + cases[i].depth, cases[i].subRect, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].expected, + program, cases[i].size, canvasSetupFunction, sourceDescription); + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas.js new file mode 100644 index 000000000..c577d0f44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-canvas.js @@ -0,0 +1,233 @@ +/* +** Copyright (c) 2015 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var whiteColor = [255, 255, 255, 255]; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking canvas elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + whiteColor = [255, 0, 0, 255]; + greenColor = [0, 0, 0]; + break; + case gl.RG: + case gl.RG_INTEGER: + whiteColor = [255, 255, 0, 255]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var testCanvas = document.createElement('canvas'); + runTest(testCanvas); + //document.body.appendChild(testCanvas); + } + + function setCanvasToRedGreen(ctx) { + var width = ctx.canvas.width; + var height = ctx.canvas.height; + var halfHeight = Math.floor(height / 2); + ctx.fillStyle = "#ff0000"; + ctx.fillRect(0, 0, width, halfHeight); + ctx.fillStyle = "#00ff00"; + ctx.fillRect(0, halfHeight, width, height - halfHeight); + } + + function drawTextInCanvas(ctx, bindingTarget) { + var width = ctx.canvas.width; + var height = ctx.canvas.height; + ctx.fillStyle = "#ffffff"; + ctx.fillRect(0, 0, width, height); + ctx.font = '20pt Arial'; + ctx.fillStyle = 'black'; + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + ctx.fillText("1234567890", width / 2, height / 4); + } + + function setCanvasTo257x257(ctx, bindingTarget) { + ctx.canvas.width = 257; + ctx.canvas.height = 257; + setCanvasToRedGreen(ctx); + } + + function setCanvasToMin(ctx, bindingTarget) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + // cube map texture must be square. + ctx.canvas.width = 2; + } else { + ctx.canvas.width = 1; + } + ctx.canvas.height = 2; + setCanvasToRedGreen(ctx); + } + + function runOneIteration(canvas, flipY, program, bindingTarget, opt_texture, opt_fontTest) + { + debug('Testing ' + ' with flipY=' + flipY + ' bindingTarget=' + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY') + + ' canvas size: ' + canvas.width + 'x' + canvas.height + (opt_fontTest ? " with fonts" : " with red-green")); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + if (!opt_texture) { + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + } else { + var texture = opt_texture; + } + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], canvas.width, canvas.height, 1 /* depth */, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(bindingTarget, 0, 0, 0, 0, canvas.width, canvas.height, 1 /* depth */, + gl[pixelFormat], gl[pixelType], canvas); + + var width = gl.canvas.width; + var height = gl.canvas.height; + var halfHeight = Math.floor(height / 2); + var top = flipY ? 0 : (height - halfHeight); + var bottom = flipY ? (height - halfHeight) : 0; + + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 255, 0, 255]); + + if (opt_fontTest) { + // check half is a solid color. + wtu.checkCanvasRect( + gl, 0, top, width, halfHeight, + whiteColor, + "should be white"); + // check other half is not a solid color. + wtu.checkCanvasRectColor( + gl, 0, bottom, width, halfHeight, + whiteColor, 0, + function() { + testFailed("font missing"); + }, + function() { + testPassed("font renderered"); + }, + debug); + } else { + // Check the top and bottom halves and make sure they have the right color. + debug("Checking " + (flipY ? "top" : "bottom")); + wtu.checkCanvasRect(gl, 0, bottom, width, halfHeight, redColor, + "shouldBe " + redColor); + debug("Checking " + (flipY ? "bottom" : "top")); + wtu.checkCanvasRect(gl, 0, top, width, halfHeight, greenColor, + "shouldBe " + greenColor); + } + + return texture; + } + + function runTest(canvas) + { + var ctx = canvas.getContext("2d"); + + var cases = [ + { flipY: true, font: false, init: setCanvasToMin }, + { flipY: false, font: false }, + { flipY: true, font: false, init: setCanvasTo257x257 }, + { flipY: false, font: false }, + { flipY: true, font: true, init: drawTextInCanvas }, + { flipY: false, font: true }, + ]; + + function runTexImageTest(bindingTarget) { + var program; + if (bindingTarget == gl.TEXTURE_3D) { + program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + } else { // TEXTURE_2D_ARRAY + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + } + + return new Promise(function(resolve, reject) { + var count = 4; + var caseNdx = 0; + var texture = undefined; + function runNextTest() { + var c = cases[caseNdx]; + if (c.init) { + c.init(ctx, bindingTarget); + } + texture = runOneIteration(canvas, c.flipY, program, bindingTarget, texture, c.font); + // for the first 2 iterations always make a new texture. + if (count > 2) { + texture = undefined; + } + ++caseNdx; + if (caseNdx == cases.length) { + caseNdx = 0; + --count; + if (!count) { + resolve("SUCCESS"); + return; + } + } + wtu.waitForComposite(runNextTest); + } + runNextTest(); + }); + } + + runTexImageTest(gl.TEXTURE_3D).then(function(val) { + runTexImageTest(gl.TEXTURE_2D_ARRAY).then(function(val) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + }); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js new file mode 100644 index 000000000..1dab09bfa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js @@ -0,0 +1,63 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking ImageBitmap created from a Blob (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var xhr = new XMLHttpRequest(); + xhr.open("GET", resourcePath + "red-green-semi-transparent.png"); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + var blob = xhr.response; + runImageBitmapTest(blob, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true); + finishTest(); + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-canvas.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-canvas.js new file mode 100644 index 000000000..fb7d5e6ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-canvas.js @@ -0,0 +1,89 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking ImageBitmap created from an HTMLCanvasElement (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var testCanvas = document.createElement('canvas'); + var ctx = testCanvas.getContext("2d"); + setCanvasToMin(ctx); + runImageBitmapTest(testCanvas, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true); + + setCanvasTo257x257(ctx); + runImageBitmapTest(testCanvas, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true); + finishTest(); + } + + function setCanvasToRedGreen(ctx) { + var width = ctx.canvas.width; + var halfWidth = Math.floor(width / 2); + var height = ctx.canvas.height; + var halfHeight = Math.floor(height / 2); + ctx.fillStyle = "rgba(255, 0, 0, 1)"; + ctx.fillRect(0, 0, halfWidth, halfHeight); + ctx.fillStyle = "rgba(255, 0, 0, 0.5)"; + ctx.fillRect(halfWidth, 0, halfWidth, halfHeight); + ctx.fillStyle = "rgba(0, 255, 0, 1)"; + ctx.fillRect(0, halfHeight, halfWidth, halfHeight); + ctx.fillStyle = "rgba(0, 255, 0, 0.5)"; + ctx.fillRect(halfWidth, halfHeight, halfWidth, halfHeight); + } + + function setCanvasToMin(ctx) { + ctx.canvas.width = 2; + ctx.canvas.height = 2; + setCanvasToRedGreen(ctx); + } + + function setCanvasTo257x257(ctx) { + ctx.canvas.width = 257; + ctx.canvas.height = 257; + setCanvasToRedGreen(ctx); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-bitmap.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-bitmap.js new file mode 100644 index 000000000..ba715426f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-bitmap.js @@ -0,0 +1,67 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking ImageBitmap created from an ImageBitmap (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + gl.disable(gl.BLEND); + + var imageData = new ImageData(new Uint8ClampedArray( + [255, 0, 0, 255, + 255, 0, 0, 0, + 0, 255, 0, 255, + 0, 255, 0, 0]), + 2, 2); + + createImageBitmap(imageData, {imageOrientation: "none", premultiplyAlpha: "none"}).then(function(bitmap) { + // bitmap is in unpremultiplied form + runImageBitmapTest(bitmap, 0, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true); + finishTest(); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-data.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-data.js new file mode 100644 index 000000000..71411657b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-data.js @@ -0,0 +1,64 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking ImageBitmap created from ImageData (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + gl.disable(gl.BLEND); + + var imageData = new ImageData(new Uint8ClampedArray( + [255, 0, 0, 255, + 255, 0, 0, 0, + 0, 255, 0, 255, + 0, 255, 0, 0]), + 2, 2); + + runImageBitmapTest(imageData, 0, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true); + finishTest(); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image.js new file mode 100644 index 000000000..2574becd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image.js @@ -0,0 +1,60 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking ImageBitmap created from an HTMLImageElement (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + var image = new Image(); + image.onload = function() { + runImageBitmapTest(image, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true); + finishTest(); + } + image.src = resourcePath + "red-green-semi-transparent.png"; + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-video.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-video.js new file mode 100644 index 000000000..e385ff90a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-video.js @@ -0,0 +1,61 @@ +/* +** Copyright (c) 2016 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking ImageBitmap created from an HTMLVideoElement (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + if(!window.createImageBitmap || !window.ImageBitmap) { + finishTest(); + return; + } + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + video = document.createElement("video"); + video.oncanplaythrough = function() { + runImageBitmapTest(video, 1, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true); + finishTest(); + } + video.src = resourcePath + "red-green.theora.ogv"; + document.body.appendChild(video); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-data.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-data.js new file mode 100644 index 000000000..e1368275d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image-data.js @@ -0,0 +1,276 @@ +/* +** Copyright (c) 2015 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var imageData = null; + var blackColor = [0, 0, 0]; + var originalPixels = (function() { + // (red|green|blue|cyan)(opaque|transparent) + var ro = [255, 0, 0, 255]; var rt = [255, 0, 0, 0]; + var go = [0, 255, 0, 255]; var gt = [0, 255, 0, 0]; + var bo = [0, 0, 255, 255]; var bt = [0, 0, 255, 0]; + var co = [0, 255, 255, 255]; var ct = [0, 255, 255, 0]; + return [ro, rt, go, gt, + ro, rt, go, gt, + bo, bt, co, ct, + bo, bt, co, ct]; + })(); + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking ImageData (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + gl.disable(gl.BLEND); + + var canvas2d = document.getElementById("texcanvas"); + var context2d = canvas2d.getContext("2d"); + imageData = context2d.createImageData(4, 4); + var data = imageData.data; + for (var i = 0; i < originalPixels.length; i++) { + data.set(originalPixels[i], 4 * i); + } + + runTest(); + } + + function runOneIteration(useTexSubImage3D, flipY, premultiplyAlpha, bindingTarget, + depth, sourceSubRectangle, rTexCoord, program) + { + var expected = simulate(flipY, premultiplyAlpha, depth, sourceSubRectangle, rTexCoord); + var sourceSubRectangleString = ''; + if (sourceSubRectangle) { + sourceSubRectangleString = ', sourceSubRectangle=' + sourceSubRectangle; + sourceSubRectangleString += ', rTexCoord=' + rTexCoord; + } + debug(''); + debug('Testing ' + (useTexSubImage3D ? 'texSubImage3D' : 'texImage3D') + + ' with flipY=' + flipY + ', premultiplyAlpha=' + premultiplyAlpha + + ', bindingTarget=' + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY') + + sourceSubRectangleString); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Enable writes to the RGBA channels + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiplyAlpha); + gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); + var uploadWidth = imageData.width; + var uploadHeight = imageData.height; + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + uploadWidth = sourceSubRectangle[2]; + uploadHeight = sourceSubRectangle[3]; + } + // Upload the image into the texture + if (useTexSubImage3D) { + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(bindingTarget, 0, 0, 0, 0, uploadWidth, uploadHeight, depth, + gl[pixelFormat], gl[pixelType], imageData); + } else { + gl.texImage3D(bindingTarget, 0, gl[internalFormat], uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], imageData); + } + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors from texture upload"); + + var tl = expected[0][0]; + var tr = expected[0][1]; + var bl = expected[1][0]; + var br = expected[1][1]; + + var rCoordLocation = gl.getUniformLocation(program, 'uRCoord'); + if (!rCoordLocation) { + testFailed("Shader incorrectly set up; couldn't find uRCoord uniform"); + return; + } + gl.uniform1f(rCoordLocation, rTexCoord); + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + + var width = gl.canvas.width; + var halfWidth = Math.floor(width / 2); + var height = gl.canvas.height; + var halfHeight = Math.floor(height / 2); + + var top = 0; + var bottom = height - halfHeight; + var left = 0; + var right = width - halfWidth; + + debug("Checking pixel values"); + debug("Expecting: " + expected); + var expectedH = expected.length; + var expectedW = expected[0].length; + var texelH = Math.floor(gl.canvas.height / expectedH); + var texelW = Math.floor(gl.canvas.width / expectedW); + // For each entry of the expected[][] array, check the appropriate + // canvas rectangle for correctness. + for (var row = 0; row < expectedH; row++) { + var y = row * texelH; + for (var col = 0; col < expectedW; col++) { + var x = col * texelW; + var val = expected[row][col]; + wtu.checkCanvasRect(gl, x, y, texelW, texelH, val, "should be " + val); + } + } + } + + function runTest() + { + var program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + runTestOnBindingTarget(gl.TEXTURE_3D, program); + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + runTestOnBindingTarget(gl.TEXTURE_2D_ARRAY, program); + + debug(""); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + } + + function simulate(flipY, premultiplyAlpha, depth, sourceSubRectangle, rTexCoord) { + var ro = [255, 0, 0]; var rt = premultiplyAlpha ? [0, 0, 0] : [255, 0, 0]; + var go = [0, 255, 0]; var gt = premultiplyAlpha ? [0, 0, 0] : [0, 255, 0]; + var bo = [0, 0, 255]; var bt = premultiplyAlpha ? [0, 0, 0] : [0, 0, 255]; + var co = [0, 255, 255]; var ct = premultiplyAlpha ? [0, 0, 0] : [0, 255, 255]; + var expected = [[ro, rt, go, gt], + [ro, rt, go, gt], + [bo, bt, co, ct], + [bo, bt, co, ct]]; + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + for (var row = 0; row < 4; row++) { + for (var col = 0; col < 4; col++) { + expected[row][col][1] = 0; // zero the green channel + } + } + // fall-through + case gl.RG: + case gl.RG_INTEGER: + for (var row = 0; row < 4; row++) { + for (var col = 0; col < 4; col++) { + expected[row][col][2] = 0; // zero the blue channel + } + } + break; + default: + break; + } + + if (flipY) { + expected.reverse(); + } + + if (sourceSubRectangle) { + let expected2 = []; + for (var row = 0; row < sourceSubRectangle[3]; row++) { + expected2[row] = []; + for (var col = 0; col < sourceSubRectangle[2]; col++) { + expected2[row][col] = + expected[sourceSubRectangle[1] + row + rTexCoord * sourceSubRectangle[3]][sourceSubRectangle[0] + col]; + } + } + expected = expected2; + } + + return expected; + } + + function runTestOnBindingTarget(bindingTarget, program) { + var rects = [ + undefined, + [0, 0, 2, 2], + [2, 0, 2, 2], + ]; + var dbg = false; // Set to true for debug output images + if (dbg) { + (function() { + debug(""); + debug("Original ImageData (transparent pixels appear black):"); + var cvs = document.createElement("canvas"); + cvs.width = 4; + cvs.height = 4; + cvs.style.width = "32px"; + cvs.style.height = "32px"; + cvs.style.imageRendering = "pixelated"; + cvs.style.background = "#000"; + var ctx = cvs.getContext("2d"); + ctx.putImageData(imageData, 0, 0); + var output = document.getElementById("console"); + output.appendChild(cvs); + })(); + } + for (const sub of [false, true]) { + for (const flipY of [false, true]) { + for (const premul of [false, true]) { + for (let irect = 0; irect < rects.length; irect++) { + var rect = rects[irect]; + let depth = rect ? 2 : 1; + for (let rTexCoord = 0; rTexCoord < depth; rTexCoord++) { + // TODO: add tests for UNPACK_IMAGE_HEIGHT. + runOneIteration(sub, flipY, premul, bindingTarget, + depth, rect, rTexCoord, program); + if (dbg) { + debug("Actual:"); + var img = document.createElement("img"); + img.src = gl.canvas.toDataURL("image/png"); + var output = document.getElementById("console"); + output.appendChild(img); + } + } + } + } + } + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image.js new file mode 100644 index 000000000..eb7bb6a00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-image.js @@ -0,0 +1,277 @@ +/* +** Copyright (c) 2015 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var imgCanvas; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + var blueColor = [0, 0, 255]; + var cyanColor = [0, 255, 255]; + var imageURLs = [resourcePath + "red-green.png", + resourcePath + "red-green-blue-cyan-4x4.png"]; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking image elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + blueColor = [0, 0, 0]; + cyanColor = [0, 0, 0]; + break; + + case gl.RG: + case gl.RG_INTEGER: + blueColor = [0, 0, 0]; + cyanColor = [0, 255, 0]; + break; + + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + wtu.loadImagesAsync(imageURLs, runTest); + } + + function uploadImageToTexture(image, useTexSubImage3D, flipY, bindingTarget, + depth, sourceSubRectangle, unpackImageHeight) + { + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); + var uploadWidth = image.width; + var uploadHeight = image.height; + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + uploadWidth = sourceSubRectangle[2]; + uploadHeight = sourceSubRectangle[3]; + } + if (unpackImageHeight) { + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, unpackImageHeight); + } + // Upload the image into the texture + if (useTexSubImage3D) { + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(bindingTarget, 0, 0, 0, 0, uploadWidth, uploadHeight, depth, + gl[pixelFormat], gl[pixelType], image); + } else { + gl.texImage3D(bindingTarget, 0, gl[internalFormat], uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], image); + } + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors from texture upload"); + } + + function runRedGreenTest(image) { + function runOneIteration(image, useTexSubImage3D, flipY, bindingTarget, topColor, bottomColor, program) + { + debug('Testing ' + (useTexSubImage3D ? 'texSubImage3D' : 'texImage3D') + + ' with flipY=' + flipY + ' bindingTarget=' + + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY')); + + uploadImageToTexture(image, useTexSubImage3D, flipY, bindingTarget, 1); + + // Draw the triangles + wtu.clearAndDrawUnitQuad(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); + } + + var cases = [ + { sub: false, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: false, flipY: false, topColor: greenColor, bottomColor: redColor }, + { sub: true, flipY: true, topColor: redColor, bottomColor: greenColor }, + { sub: true, flipY: false, topColor: greenColor, bottomColor: redColor }, + ]; + + var program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + for (var i in cases) { + runOneIteration(image, cases[i].sub, cases[i].flipY, gl.TEXTURE_3D, + cases[i].topColor, cases[i].bottomColor, program); + } + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + for (var i in cases) { + runOneIteration(image, cases[i].sub, cases[i].flipY, gl.TEXTURE_2D_ARRAY, + cases[i].topColor, cases[i].bottomColor, program); + } + } + + function runRedGreenBlueCyanTest(image) { + function runOneIteration(image, useTexSubImage3D, flipY, bindingTarget, + depth, sourceSubRectangle, unpackImageHeight, + rTextureCoord, topColor, bottomColor, program) + { + sourceSubRectangleString = ''; + if (sourceSubRectangle) { + sourceSubRectangleString = ' sourceSubRectangle=' + sourceSubRectangle; + } + unpackImageHeightString = ''; + if (unpackImageHeight) { + unpackImageHeightString = ' unpackImageHeight=' + unpackImageHeight; + } + debug('Testing ' + (useTexSubImage3D ? 'texSubImage3D' : 'texImage3D') + + ' with flipY=' + flipY + ' bindingTarget=' + + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY') + + sourceSubRectangleString + ' depth=' + depth + unpackImageHeightString + + ' rTextureCoord=' + rTextureCoord); + + uploadImageToTexture(image, useTexSubImage3D, flipY, bindingTarget, + depth, sourceSubRectangle, unpackImageHeight); + var rCoordLocation = gl.getUniformLocation(program, 'uRCoord'); + if (!rCoordLocation) { + testFailed('Shader incorrectly set up; couldn\'t find uRCoord uniform'); + return; + } + gl.uniform1f(rCoordLocation, rTextureCoord); + + // Draw the triangles + wtu.clearAndDrawUnitQuad(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); + } + + var cases = [ + // No UNPACK_IMAGE_HEIGHT specified. + { flipY: false, sourceSubRectangle: [0, 0, 2, 2], depth: 2, rTextureCoord: 0.0, + topColor: redColor, bottomColor: redColor }, + { flipY: false, sourceSubRectangle: [0, 0, 2, 2], depth: 2, rTextureCoord: 1.0, + topColor: blueColor, bottomColor: blueColor }, + { flipY: true, sourceSubRectangle: [0, 0, 2, 2], depth: 2, rTextureCoord: 0.0, + topColor: blueColor, bottomColor: blueColor }, + { flipY: true, sourceSubRectangle: [0, 0, 2, 2], depth: 2, rTextureCoord: 1.0, + topColor: redColor, bottomColor: redColor }, + { flipY: false, sourceSubRectangle: [2, 0, 2, 2], depth: 2, rTextureCoord: 0.0, + topColor: greenColor, bottomColor: greenColor }, + { flipY: false, sourceSubRectangle: [2, 0, 2, 2], depth: 2, rTextureCoord: 1.0, + topColor: cyanColor, bottomColor: cyanColor }, + { flipY: true, sourceSubRectangle: [2, 0, 2, 2], depth: 2, rTextureCoord: 0.0, + topColor: cyanColor, bottomColor: cyanColor }, + { flipY: true, sourceSubRectangle: [2, 0, 2, 2], depth: 2, rTextureCoord: 1.0, + topColor: greenColor, bottomColor: greenColor }, + + // Use UNPACK_IMAGE_HEIGHT to skip some pixels. + { flipY: false, sourceSubRectangle: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0, + topColor: redColor, bottomColor: redColor }, + { flipY: false, sourceSubRectangle: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0, + topColor: blueColor, bottomColor: blueColor }, + { flipY: true, sourceSubRectangle: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0, + topColor: blueColor, bottomColor: blueColor }, + { flipY: true, sourceSubRectangle: [0, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0, + topColor: redColor, bottomColor: redColor }, + { flipY: false, sourceSubRectangle: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0, + topColor: greenColor, bottomColor: greenColor }, + { flipY: false, sourceSubRectangle: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0, + topColor: cyanColor, bottomColor: cyanColor }, + { flipY: true, sourceSubRectangle: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 0.0, + topColor: cyanColor, bottomColor: cyanColor }, + { flipY: true, sourceSubRectangle: [2, 0, 1, 1], depth: 2, unpackImageHeight: 2, rTextureCoord: 1.0, + topColor: greenColor, bottomColor: greenColor }, + ]; + + var program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + for (var i in cases) { + runOneIteration(image, false, cases[i].flipY, gl.TEXTURE_3D, + cases[i].depth, cases[i].sourceSubRectangle, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].topColor, cases[i].bottomColor, + program); + runOneIteration(image, true, cases[i].flipY, gl.TEXTURE_3D, + cases[i].depth, cases[i].sourceSubRectangle, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].topColor, cases[i].bottomColor, + program); + } + + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + for (var i in cases) { + runOneIteration(image, false, cases[i].flipY, gl.TEXTURE_2D_ARRAY, + cases[i].depth, cases[i].sourceSubRectangle, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].topColor, cases[i].bottomColor, + program); + runOneIteration(image, true, cases[i].flipY, gl.TEXTURE_2D_ARRAY, + cases[i].depth, cases[i].sourceSubRectangle, + cases[i].unpackImageHeight, cases[i].rTextureCoord, + cases[i].topColor, cases[i].bottomColor, + program); + } + } + + function runTest(imageMap) + { + runRedGreenTest(imageMap[imageURLs[0]]); + runRedGreenBlueCyanTest(imageMap[imageURLs[1]]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-svg-image.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-svg-image.js new file mode 100644 index 000000000..c940a601a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-svg-image.js @@ -0,0 +1,121 @@ +/* +** Copyright (c) 2015 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var imgCanvas; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking SVG image elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + wtu.loadTexture(gl, resourcePath + "red-green.svg", runTest); + } + + function runOneIteration(image, flipY, topColor, bottomColor, bindingTarget, program) + { + debug('Testing ' + ' with flipY=' + flipY + ' bindingTarget=' + + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY')); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + // Upload the image into the texture + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], image.width, image.height, 1 /* depth */, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(bindingTarget, 0, 0, 0, 0, image.width, image.height, 1 /* depth */, + gl[pixelFormat], gl[pixelType], image); + + // Draw the triangles + wtu.clearAndDrawUnitQuad(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); + } + + function runTest(image) + { + var program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + runTestOnBindingTarget(image, gl.TEXTURE_3D, program); + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + runTestOnBindingTarget(image, gl.TEXTURE_2D_ARRAY, program); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + } + + function runTestOnBindingTarget(image, bindingTarget, program) { + var cases = [ + { flipY: true, topColor: redColor, bottomColor: greenColor }, + { flipY: false, topColor: greenColor, bottomColor: redColor }, + ]; + for (var i in cases) { + runOneIteration(image, cases[i].flipY, + cases[i].topColor, cases[i].bottomColor, + bindingTarget, program); + } + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-video.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-video.js new file mode 100644 index 000000000..3495bf17f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-video.js @@ -0,0 +1,260 @@ +/* +** Copyright (c) 2015 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. +*/ + +// This block needs to be outside the onload handler in order for this +// test to run reliably in WebKit's test harness (at least the +// Chromium port). https://bugs.webkit.org/show_bug.cgi?id=87448 +initTestingHarness(); + +var old = debug; +var debug = function(msg) { + bufferedLogToConsole(msg); + old(msg); +}; + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + // Test each format separately because many browsers implement each + // differently. Some might be GPU accelerated, some might not. Etc... + var videos = [ + { src: resourcePath + "red-green.mp4" , type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', }, + { src: resourcePath + "red-green.webmvp9.webm", type: 'video/webm; codecs="vp9"', }, + { src: resourcePath + "red-green.webmvp8.webm", type: 'video/webm; codecs="vp8, vorbis"', }, + { src: resourcePath + "red-green.theora.ogv", type: 'video/ogg; codecs="theora, vorbis"', }, + ]; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking video elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + runTest(); + } + + function runOneIteration(videoElement, flipY, useTexSubImage3D, topColor, bottomColor, program, bindingTarget, + depth, sourceSubRectangle, unpackImageHeight, rTextureCoord) + { + debug('Testing ' + + (useTexSubImage3D ? "texSubImage3D" : "texImage3D") + + ' with flipY=' + flipY + ' bindingTarget=' + + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY') + + (sourceSubRectangle ? ', sourceSubRectangle=' + sourceSubRectangle : '') + + (unpackImageHeight ? ', unpackImageHeight=' + unpackImageHeight : '') + + ', depth=' + depth + + ', rTextureCoord=' + rTextureCoord); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); + var uploadWidth = videoElement.width; + var uploadHeight = videoElement.height; + if (sourceSubRectangle) { + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, sourceSubRectangle[0]); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, sourceSubRectangle[1]); + uploadWidth = sourceSubRectangle[2]; + uploadHeight = sourceSubRectangle[3]; + } + if (unpackImageHeight) { + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, unpackImageHeight); + } + // Upload the videoElement into the texture + if (useTexSubImage3D) { + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], + uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(bindingTarget, 0, 0, 0, 0, + uploadWidth, uploadHeight, depth, + gl[pixelFormat], gl[pixelType], videoElement); + } else { + gl.texImage3D(bindingTarget, 0, gl[internalFormat], + uploadWidth, uploadHeight, depth, 0, + gl[pixelFormat], gl[pixelType], videoElement); + } + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0); + + 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); + + var rCoordLocation = gl.getUniformLocation(program, 'uRCoord'); + if (!rCoordLocation) { + testFailed('Shader incorrectly set up; couldn\'t find uRCoord uniform'); + return; + } + gl.uniform1f(rCoordLocation, rTextureCoord); + + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + // Check a few pixels near the top and bottom and make sure they have + // the right color. + var tolerance = 5; + debug("Checking lower left corner"); + wtu.checkCanvasRect(gl, 4, 4, 2, 2, bottomColor, + "shouldBe " + bottomColor, tolerance); + debug("Checking upper left corner"); + wtu.checkCanvasRect(gl, 4, gl.canvas.height - 8, 2, 2, topColor, + "shouldBe " + topColor, tolerance); + } + + function runTest(videoElement) + { + var cases = [ + // No UNPACK_IMAGE_HEIGHT specified. + { flipY: false, sourceSubRectangle: [32, 16, 16, 16], depth: 5, rTextureCoord: 0, + topColor: redColor, bottomColor: redColor }, + // Note that an rTextureCoord of 4.0 satisfies the need to + // have it be >= 1.0 for the TEXTURE_3D case, and also its + // use as an index in the TEXTURE_2D_ARRAY case. + { flipY: false, sourceSubRectangle: [32, 16, 16, 16], depth: 5, rTextureCoord: 4, + topColor: greenColor, bottomColor: greenColor }, + { flipY: false, sourceSubRectangle: [24, 48, 32, 32], depth: 1, rTextureCoord: 0, + topColor: greenColor, bottomColor: redColor }, + { flipY: true, sourceSubRectangle: [24, 48, 32, 32], depth: 1, rTextureCoord: 0, + topColor: redColor, bottomColor: greenColor }, + + // Use UNPACK_IMAGE_HEIGHT to skip some pixels. + { flipY: false, sourceSubRectangle: [32, 16, 16, 16], depth: 2, unpackImageHeight: 64, rTextureCoord: 0, + topColor: redColor, bottomColor: redColor }, + { flipY: false, sourceSubRectangle: [32, 16, 16, 16], depth: 2, unpackImageHeight: 64, rTextureCoord: 1, + topColor: greenColor, bottomColor: greenColor }, + ]; + + function runTexImageTest(bindingTarget) { + var program; + if (bindingTarget == gl.TEXTURE_3D) { + program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + } else { + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + } + + return new Promise(function(resolve, reject) { + var videoNdx = 0; + var video; + function runNextVideo() { + if (video) { + video.pause(); + } + + if (videoNdx == videos.length) { + resolve("SUCCESS"); + return; + } + + var info = videos[videoNdx++]; + debug(""); + debug("testing: " + info.type); + video = document.createElement("video"); + var canPlay = true; + if (!video.canPlayType) { + testFailed("video.canPlayType required method missing"); + runNextVideo(); + return; + } + + if(!video.canPlayType(info.type).replace(/no/, '')) { + debug(info.type + " unsupported"); + runNextVideo(); + return; + }; + + document.body.appendChild(video); + video.type = info.type; + video.src = info.src; + wtu.startPlayingAndWaitForVideo(video, runTest); + } + function runTest() { + for (var i in cases) { + runOneIteration(video, cases[i].flipY, false, + cases[i].topColor, cases[i].bottomColor, + program, bindingTarget, cases[i].depth, + cases[i].sourceSubRectangle, + cases[i].unpackImageHeight, + cases[i].rTextureCoord); + runOneIteration(video, cases[i].flipY, true, + cases[i].topColor, cases[i].bottomColor, + program, bindingTarget, cases[i].depth, + cases[i].sourceSubRectangle, + cases[i].unpackImageHeight, + cases[i].rTextureCoord); + } + runNextVideo(); + } + runNextVideo(); + }); + } + + runTexImageTest(gl.TEXTURE_3D).then(function(val) { + runTexImageTest(gl.TEXTURE_2D_ARRAY).then(function(val) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + }); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-webgl-canvas.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-webgl-canvas.js new file mode 100644 index 000000000..f9415cf85 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-3d-with-webgl-canvas.js @@ -0,0 +1,204 @@ +/* +** Copyright (c) 2015 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. +*/ + +function generateTest(internalFormat, pixelFormat, pixelType, prologue, resourcePath, defaultContextVersion) { + var wtu = WebGLTestUtils; + var tiu = TexImageUtils; + var gl = null; + var successfullyParsed = false; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + + function init() + { + description('Verify texImage3D and texSubImage3D code paths taking webgl canvas elements (' + internalFormat + '/' + pixelFormat + '/' + pixelType + ')'); + + // Set the default context version while still allowing the webglVersion URL query string to override it. + wtu.setDefault3DContextVersion(defaultContextVersion); + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + break; + default: + break; + } + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + runTest(); + } + + function setCanvasToRedGreen(ctx) { + var width = ctx.canvas.width; + var height = ctx.canvas.height; + var halfHeight = Math.floor(height / 2); + + ctx.viewport(0, 0, width, height); + + ctx.enable(ctx.SCISSOR_TEST); + ctx.scissor(0, 0, width, halfHeight); + ctx.clearColor(1.0, 0, 0, 1.0); + ctx.clear(ctx.COLOR_BUFFER_BIT); + ctx.scissor(0, halfHeight, width, height - halfHeight); + ctx.clearColor(0.0, 1.0, 0, 1.0); + ctx.clear(ctx.COLOR_BUFFER_BIT); + ctx.disable(ctx.SCISSOR_TEST); + } + + function setCanvasTo257x257(ctx, bindingTarget) { + ctx.canvas.width = 257; + ctx.canvas.height = 257; + setCanvasToRedGreen(ctx); + } + + function setCanvasToMin(ctx, bindingTarget) { + ctx.canvas.width = 1; + ctx.canvas.height = 2; + setCanvasToRedGreen(ctx); + } + + function runOneIteration(canvas, flipY, program, bindingTarget, opt_texture) + { + debug('Testing ' + flipY + ' bindingTarget=' + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY') + + ' canvas size: ' + canvas.width + 'x' + canvas.height + ' with red-green'); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + if (!opt_texture) { + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + } else { + var texture = opt_texture; + } + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);'); + + // Upload the image into the texture + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], canvas.width, canvas.height, 1 /* depth */, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(bindingTarget, 0, 0, 0, 0, canvas.width, canvas.height, 1 /* depth */, + gl[pixelFormat], gl[pixelType], canvas); + + var width = gl.canvas.width; + var height = gl.canvas.height; + var halfHeight = Math.floor(height / 2); + var top = flipY ? (height - halfHeight) : 0; + var bottom = flipY ? 0 : (height - halfHeight); + + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 255, 0, 255]); + + // Check the top and bottom halves and make sure they have the right color. + debug("Checking " + (flipY ? "top" : "bottom")); + wtu.checkCanvasRect(gl, 0, bottom, width, halfHeight, redColor, "shouldBe " + redColor); + debug("Checking " + (flipY ? "bottom" : "top")); + wtu.checkCanvasRect(gl, 0, top, width, halfHeight, greenColor, "shouldBe " + greenColor); + + if (false) { + var ma = wtu.makeImageFromCanvas(canvas); + document.getElementById("console").appendChild(ma); + + var m = wtu.makeImageFromCanvas(gl.canvas); + document.getElementById("console").appendChild(m); + document.getElementById("console").appendChild(document.createElement("hr")); + } + + return texture; + } + + function runTest() + { + var ctx = wtu.create3DContext(); + var canvas = ctx.canvas; + + var cases = [ + { flipY: true, init: setCanvasToMin }, + { flipY: false }, + { flipY: true, init: setCanvasTo257x257 }, + { flipY: false }, + ]; + + function runTexImageTest(bindingTarget) { + var program; + if (bindingTarget == gl.TEXTURE_3D) { + program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + } else { + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + } + + return new Promise(function(resolve, reject) { + var count = 4; + var caseNdx = 0; + var texture = undefined; + function runNextTest() { + var c = cases[caseNdx]; + if (c.init) { + c.init(ctx, bindingTarget); + } + texture = runOneIteration(canvas, c.flipY, program, bindingTarget, texture); + // for the first 2 iterations always make a new texture. + if (count > 2) { + texture = undefined; + } + ++caseNdx; + if (caseNdx == cases.length) { + caseNdx = 0; + --count; + if (!count) { + resolve("SUCCESS"); + return; + } + } + wtu.waitForComposite(runNextTest); + } + runNextTest(); + }); + } + + runTexImageTest(gl.TEXTURE_3D).then(function(val) { + runTexImageTest(gl.TEXTURE_2D_ARRAY).then(function(val) { + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + finishTest(); + }); + }); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-utils.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-utils.js new file mode 100644 index 000000000..ba5be49a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-utils.js @@ -0,0 +1,818 @@ +/* +** Copyright (c) 2015 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. +*/ +var TexImageUtils = (function() { + + "use strict"; + + var wtu = WebGLTestUtils; + + /** + * A vertex shader for a single texture. + * @type {string} + */ + var simpleTextureVertexShaderES3 = [ + '#version 300 es', + 'in vec4 vPosition;', + 'in vec2 texCoord0;', + 'out vec2 texCoord;', + 'void main() {', + ' gl_Position = vPosition;', + ' texCoord = texCoord0;', + '}'].join('\n'); + + /** + * A fragment shader for a single unsigned integer texture. + * @type {string} + */ + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simpleUintTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump usampler2D tex;', + 'in vec2 texCoord;', + 'out vec4 fragData;', + 'void main() {', + ' uvec4 data = texture(tex, texCoord);', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single signed integer texture. + * @type {string} + */ + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simpleIntTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump isampler2D tex;', + 'in vec2 texCoord;', + 'out vec4 fragData;', + 'void main() {', + ' ivec4 data = texture(tex, texCoord);', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single cube map unsigned integer texture. + * @type {string} + */ + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simpleCubeMapUintTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump usamplerCube tex;', + 'uniform int face;', + 'in vec2 texCoord;', + 'out vec4 fragData;', + 'void main() {', + // Transform [0, 1] -> [-1, 1] + ' vec2 texC2 = (texCoord * 2.) - 1.;', + // Transform 2d tex coord. to each face of TEXTURE_CUBE_MAP coord. + ' vec3 texCube = vec3(0., 0., 0.);', + ' if (face == 34069) {', // TEXTURE_CUBE_MAP_POSITIVE_X + ' texCube = vec3(1., -texC2.y, -texC2.x);', + ' } else if (face == 34070) {', // TEXTURE_CUBE_MAP_NEGATIVE_X + ' texCube = vec3(-1., -texC2.y, texC2.x);', + ' } else if (face == 34071) {', // TEXTURE_CUBE_MAP_POSITIVE_Y + ' texCube = vec3(texC2.x, 1., texC2.y);', + ' } else if (face == 34072) {', // TEXTURE_CUBE_MAP_NEGATIVE_Y + ' texCube = vec3(texC2.x, -1., -texC2.y);', + ' } else if (face == 34073) {', // TEXTURE_CUBE_MAP_POSITIVE_Z + ' texCube = vec3(texC2.x, -texC2.y, 1.);', + ' } else if (face == 34074) {', // TEXTURE_CUBE_MAP_NEGATIVE_Z + ' texCube = vec3(-texC2.x, -texC2.y, -1.);', + ' }', + ' uvec4 data = texture(tex, texCube);', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single cube map signed integer texture. + * @type {string} + */ + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simpleCubeMapIntTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump isamplerCube tex;', + 'uniform int face;', + 'in vec2 texCoord;', + 'out vec4 fragData;', + 'void main() {', + // Transform [0, 1] -> [-1, 1] + ' vec2 texC2 = (texCoord * 2.) - 1.;', + // Transform 2d tex coord. to each face of TEXTURE_CUBE_MAP coord. + ' vec3 texCube = vec3(0., 0., 0.);', + ' if (face == 34069) {', // TEXTURE_CUBE_MAP_POSITIVE_X + ' texCube = vec3(1., -texC2.y, -texC2.x);', + ' } else if (face == 34070) {', // TEXTURE_CUBE_MAP_NEGATIVE_X + ' texCube = vec3(-1., -texC2.y, texC2.x);', + ' } else if (face == 34071) {', // TEXTURE_CUBE_MAP_POSITIVE_Y + ' texCube = vec3(texC2.x, 1., texC2.y);', + ' } else if (face == 34072) {', // TEXTURE_CUBE_MAP_NEGATIVE_Y + ' texCube = vec3(texC2.x, -1., -texC2.y);', + ' } else if (face == 34073) {', // TEXTURE_CUBE_MAP_POSITIVE_Z + ' texCube = vec3(texC2.x, -texC2.y, 1.);', + ' } else if (face == 34074) {', // TEXTURE_CUBE_MAP_NEGATIVE_Z + ' texCube = vec3(-texC2.x, -texC2.y, -1.);', + ' }', + ' ivec4 data = texture(tex, texCube);', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single 3D texture. + * @type {string} + */ + // Note that the tex coordinate r (the uniform uRCoord) is set to 0.0 by default. + var simple3DTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump sampler3D tex;', + 'in vec2 texCoord;', + 'uniform float uRCoord;', + 'out vec4 fragData;', + 'void main() {', + ' fragData = vec4(texture(tex, vec3(texCoord, uRCoord)).rgb, 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single 3D unsigned integer texture. + * @type {string} + */ + // Note that the tex coordinate r (the uniform uRCoord) is set to 0.0 by default. + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simple3DUintTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump usampler3D tex;', + 'in vec2 texCoord;', + 'uniform float uRCoord;', + 'out vec4 fragData;', + 'void main() {', + ' uvec4 data = texture(tex, vec3(texCoord, uRCoord));', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single 3D signed integer texture. + * @type {string} + */ + // Note that the tex coordinate r (the uniform uRCoord) is set to 0.0 by default. + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simple3DIntTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump isampler3D tex;', + 'in vec2 texCoord;', + 'uniform float uRCoord;', + 'out vec4 fragData;', + 'void main() {', + ' ivec4 data = texture(tex, vec3(texCoord, uRCoord));', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single 2D_ARRAY texture. + * @type {string} + */ + // Note that the first image in the array (selected by the uniform + // uRCoord) is used by default. + var simple2DArrayTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump sampler2DArray tex;', + 'in vec2 texCoord;', + 'uniform float uRCoord;', + 'out vec4 fragData;', + 'void main() {', + ' fragData = vec4(texture(tex, vec3(texCoord, uRCoord)).rgb, 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single 2D_ARRAY unsigned integer texture. + * @type {string} + */ + // Note that the first image in the array (selected by the uniform + // uRCoord) is used by default. + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simple2DArrayUintTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump usampler2DArray tex;', + 'in vec2 texCoord;', + 'uniform float uRCoord;', + 'out vec4 fragData;', + 'void main() {', + ' uvec4 data = texture(tex, vec3(texCoord, uRCoord));', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + /** + * A fragment shader for a single 2D_ARRAY signed integer texture. + * @type {string} + */ + // Note that the first image in the array (selected by the uniform + // uRCoord) is used by default. + // Note we always output 1.0 for alpha because if the texture does not contain + // alpha channel, sampling returns 1; for RGBA textures, sampling returns [0,255]. + var simple2DArrayIntTextureFragmentShaderES3 = [ + '#version 300 es', + 'precision mediump float;', + 'uniform mediump isampler2DArray tex;', + 'in vec2 texCoord;', + 'uniform float uRCoord;', + 'out vec4 fragData;', + 'void main() {', + ' ivec4 data = texture(tex, vec3(texCoord, uRCoord));', + ' fragData = vec4(float(data[0])/255.0,', + ' float(data[1])/255.0,', + ' float(data[2])/255.0,', + ' 1.0);', + '}'].join('\n'); + + + /** + * Creates a simple texture vertex shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimpleTextureVertexShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simpleTextureVertexShaderES3, gl.VERTEX_SHADER); + }; + + /** + * Creates a simple unsigned integer texture fragment shader. + * Output is scaled by 1/255 to bring the result into normalized float range. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimpleUintTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simpleUintTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple signed integer texture fragment shader. + * Output is scaled by 1/255 to bring the result into normalized float range. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimpleIntTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simpleIntTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple cube map unsigned integer texture fragment shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimpleCubeMapUintTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simpleCubeMapUintTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple cube map signed integer texture fragment shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimpleCubeMapIntTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simpleCubeMapIntTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple 3D texture fragment shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimple3DTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simple3DTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple 3D unsigned integer texture fragment shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimple3DUintTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simple3DUintTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple 3D signed integer texture fragment shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimple3DIntTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simple3DIntTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple 2D_ARRAY texture fragment shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimple2DArrayTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simple2DArrayTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple 2D_ARRAY integer texture fragment shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLShader} + */ + var setupSimple2DArrayUintTextureFragmentShader = function(gl) { + return WebGLTestUtils.loadShader(gl, simple2DArrayUintTextureFragmentShaderES3, gl.FRAGMENT_SHADER); + }; + + /** + * Creates a simple unsigned integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimpleUintTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimpleUintTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple signed integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimpleIntTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimpleIntTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple cube map unsigned integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimpleCubeMapUintTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl); + var fs = setupSimpleCubeMapUintTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple cube map signed integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimpleCubeMapIntTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl); + var fs = setupSimpleCubeMapIntTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple 3D texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimple3DTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimple3DTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple 3D unsigned integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimple3DUintTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimple3DUintTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple 3D signed integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimple3DIntTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimple3DIntTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple 2D_ARRAY texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimple2DArrayTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimple2DArrayTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple 2D_ARRAY unsigned integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimple2DArrayUintTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimple2DArrayUintTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a simple 2D_ARRAY signed integer texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ + var setupSimple2DArrayIntTextureProgram = function(gl, opt_positionLocation, opt_texcoordLocation) + { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + var vs = setupSimpleTextureVertexShader(gl), + fs = setupSimple2DArrayIntTextureFragmentShader(gl); + if (!vs || !fs) { + return null; + } + var program = WebGLTestUtils.setupProgram( + gl, + [vs, fs], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); + if (!program) { + gl.deleteShader(fs); + gl.deleteShader(vs); + } + gl.useProgram(program); + return program; + }; + + /** + * Creates a program and buffers for rendering a unsigned integer textured quad. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLProgram} + */ + var setupUintTexturedQuad = function(gl) { + var program = setupSimpleUintTextureProgram(gl); + wtu.setupUnitQuad(gl); + return program; + }; + + /** + * Creates a program and buffers for rendering a signed integer textured quad. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLProgram} + */ + var setupIntTexturedQuad = function(gl) { + var program = setupSimpleIntTextureProgram(gl); + wtu.setupUnitQuad(gl); + return program; + }; + + /** + * Creates a program and buffers for rendering a textured quad with + * a cube map unsigned integer texture. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLProgram} + */ + var setupUintTexturedQuadWithCubeMap = function(gl) + { + var program = setupSimpleCubeMapUintTextureProgram(gl); + wtu.setupUnitQuad(gl); + return program; + }; + + /** + * Creates a program and buffers for rendering a textured quad with + * a cube map signed integer texture. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {!WebGLProgram} + */ + var setupIntTexturedQuadWithCubeMap = function(gl) + { + var program = setupSimpleCubeMapIntTextureProgram(gl); + wtu.setupUnitQuad(gl); + return program; + }; + + /** + * Does the GL internal format represent an unsigned integer format + * texture? + * @return {boolean} + */ + var isUintFormat = function(internalFormat) + { + return (internalFormat == "R8UI" || internalFormat == "RG8UI" || internalFormat == "RGB8UI" || internalFormat == "RGBA8UI" || + internalFormat == "R16UI" || internalFormat == "RG16UI" || internalFormat == "RGB16UI" || internalFormat == "RGBA16UI" || + internalFormat == "R32UI" || internalFormat == "RG32UI" || internalFormat == "RGB32UI" || internalFormat == "RGBA32UI"); + }; + + /** + * Does the GL internal format represent an signed integer format + * texture? + * @return {boolean} + */ + var isIntFormat = function(internalFormat) + { + return (internalFormat == "R8I" || internalFormat == "RG8I" || internalFormat == "RGB8I" || internalFormat == "RGBA8I" || + internalFormat == "R16I" || internalFormat == "RG16I" || internalFormat == "RGB16I" || internalFormat == "RGBA16I" || + internalFormat == "R32I" || internalFormat == "RG32I" || internalFormat == "RGB32I" || internalFormat == "RGBA32I"); + }; + + /** + * Createa a program and buffers for rendering a textured quad for + * tex-image-and-sub-image tests. Handle selection of correct + * program to handle texture format. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} internalFormat The internal format for texture to be tested. + */ + var setupTexturedQuad = function(gl, internalFormat) + { + if (isUintFormat(internalFormat)) + return setupUintTexturedQuad(gl); + if (isIntFormat(internalFormat)) + return setupIntTexturedQuad(gl); + return wtu.setupTexturedQuad(gl); + }; + + /** + * Createa a program and buffers for rendering a textured quad with + * a cube map for tex-image-and-sub-image tests. Handle selection of + * correct program to handle texture format. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} internalFormat The internal format for texture to be tested. + */ + function setupTexturedQuadWithCubeMap(gl, internalFormat) + { + if (isUintFormat(internalFormat)) + return setupUintTexturedQuadWithCubeMap(gl); + if (isIntFormat(internalFormat)) + return setupIntTexturedQuadWithCubeMap(gl); + return wtu.setupTexturedQuadWithCubeMap(gl); + } + + /** + * Createa a program and buffers for rendering a textured quad with a 3D texture + * for tex-image-and-sub-image tests. Handle selection of correct + * program to handle texture format. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} internalFormat The internal format for texture to be tested. + */ + var setupTexturedQuadWith3D = function(gl, internalFormat) + { + var program; + if (isUintFormat(internalFormat)) + program = setupSimple3DUintTextureProgram(gl); + else if (isIntFormat(internalFormat)) + program = setupSimple3DIntTextureProgram(gl); + else + program = setupSimple3DTextureProgram(gl); + var uRCoordLoc = gl.getUniformLocation(program, 'uRCoord'); + gl.uniform1f(uRCoordLoc, 0.0); + wtu.setupUnitQuad(gl); + return program; + }; + + /** + * Createa a program and buffers for rendering a textured quad with a 2D_ARRAY + * texture for tex-image-and-sub-image tests. Handle selection of correct + * program to handle texture format. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} internalFormat The internal format for texture to be tested. + */ + var setupTexturedQuadWith2DArray = function(gl, internalFormat) + { + var program; + if (isUintFormat(internalFormat)) + program = setupSimple2DArrayUintTextureProgram(gl); + else if (isIntFormat(internalFormat)) + program = setupSimple2DArrayIntTextureProgram(gl); + else + program = setupSimple2DArrayTextureProgram(gl); + var uRCoordLoc = gl.getUniformLocation(program, 'uRCoord'); + gl.uniform1f(uRCoordLoc, 0.0); + wtu.setupUnitQuad(gl); + return program; + }; + + return { + setupTexturedQuad: setupTexturedQuad, + setupTexturedQuadWithCubeMap: setupTexturedQuadWithCubeMap, + setupTexturedQuadWith3D: setupTexturedQuadWith3D, + setupTexturedQuadWith2DArray: setupTexturedQuadWith2DArray + }; + +}()); diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js new file mode 100644 index 000000000..af7f3d141 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js @@ -0,0 +1,408 @@ +/* +** Copyright (c) 2016 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. +*/ + + +function runOneIterationImageBitmapTest(useTexSubImage, bindingTarget, program, bitmap, flipY, premultiplyAlpha, optionsVal, + internalFormat, pixelFormat, pixelType, gl, tiu, wtu) +{ + var halfRed = [128, 0, 0]; + var halfGreen = [0, 128, 0]; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + var blackColor = [0, 0, 0]; + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + halfGreen = [0, 0, 0]; + break; + default: + break; + } + + switch (gl[internalFormat]) { + case gl.SRGB8: + case gl.SRGB8_ALPHA8: + // Math.pow((128 / 255 + 0.055) / 1.055, 2.4) * 255 = 55 + halfRed = [55, 0, 0]; + halfGreen = [0, 55, 0]; + break; + default: + break; + } + + var str; + if (optionsVal.is3D) { + str = 'Testing ' + (useTexSubImage ? 'texSubImage3D' : 'texImage3D') + + ' with flipY=' + flipY + ', premultiplyAlpha=' + premultiplyAlpha + + ', bindingTarget=' + (bindingTarget == gl.TEXTURE_3D ? 'TEXTURE_3D' : 'TEXTURE_2D_ARRAY'); + } else { + str = 'Testing ' + (useTexSubImage ? 'texSubImage2D' : 'texImage2D') + + ' with flipY=' + flipY + ', premultiplyAlpha=' + premultiplyAlpha + + ', bindingTarget=' + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP'); + } + debug(str); + bufferedLogToConsole(str); + + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Enable writes to the RGBA channels + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + + var targets = [bindingTarget]; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + 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]; + } + + bufferedLogToConsole("Starts uploading the image into texture"); + // Upload the image into the texture + for (var tt = 0; tt < targets.length; ++tt) { + if (optionsVal.is3D) { + gl.texImage3D(targets[tt], 0, gl[internalFormat], bitmap.width, bitmap.height, 1 /* depth */, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage3D(targets[tt], 0, 0, 0, 0, bitmap.width, bitmap.height, 1, + gl[pixelFormat], gl[pixelType], bitmap); + } else { + if (useTexSubImage) { + // Initialize the texture to black first + gl.texImage2D(targets[tt], 0, gl[internalFormat], bitmap.width, bitmap.height, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(targets[tt], 0, 0, 0, gl[pixelFormat], gl[pixelType], bitmap); + } else { + gl.texImage2D(targets[tt], 0, gl[internalFormat], gl[pixelFormat], gl[pixelType], bitmap); + } + } + } + bufferedLogToConsole("Uploading texture completed"); + + var width = gl.canvas.width; + var halfWidth = Math.floor(width / 2); + var quaterWidth = Math.floor(halfWidth / 2); + var height = gl.canvas.height; + var halfHeight = Math.floor(height / 2); + var quaterHeight = Math.floor(halfHeight / 2); + + var top = flipY ? quaterHeight : (height - halfHeight + quaterHeight); + var bottom = flipY ? (height - halfHeight + quaterHeight) : quaterHeight; + + var tl = redColor; + var tr = premultiplyAlpha ? ((optionsVal.alpha == 0.5) ? halfRed : (optionsVal.alpha == 1) ? redColor : blackColor) : redColor; + var bl = greenColor; + var br = premultiplyAlpha ? ((optionsVal.alpha == 0.5) ? halfGreen : (optionsVal.alpha == 1) ? greenColor : blackColor) : greenColor; + + var loc; + var skipCorner = false; + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + loc = gl.getUniformLocation(program, "face"); + switch (pixelFormat) { + case gl.RED_INTEGER: + case gl.RG_INTEGER: + case gl.RGB_INTEGER: + case gl.RGBA_INTEGER: + // https://github.com/KhronosGroup/WebGL/issues/1819 + skipCorner = true; + break; + } + } + + var tolerance = 10; + for (var tt = 0; tt < targets.length; ++tt) { + if (bindingTarget == gl.TEXTURE_CUBE_MAP) { + gl.uniform1i(loc, targets[tt]); + } + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + + // Check the top pixel and bottom pixel and make sure they have + // the right color. + bufferedLogToConsole("Checking " + (flipY ? "top" : "bottom")); + wtu.checkCanvasRect(gl, quaterWidth, bottom, 2, 2, tl, "shouldBe " + tl); + if (!skipCorner && !flipY) { + wtu.checkCanvasRect(gl, halfWidth + quaterWidth, bottom, 2, 2, tr, "shouldBe " + tr, tolerance); + } + bufferedLogToConsole("Checking " + (flipY ? "bottom" : "top")); + wtu.checkCanvasRect(gl, quaterWidth, top, 2, 2, bl, "shouldBe " + bl); + if (!skipCorner && flipY) { + wtu.checkCanvasRect(gl, halfWidth + quaterWidth, top, 2, 2, br, "shouldBe " + br, tolerance); + } + } + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); +} + +function resetUnpackParams(gl) +{ + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0); + gl.pixelStorei(gl.UNPACK_ROW_LENGTH, 0); + gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0); +} + +function runOneIterationImageBitmapTestSubSource(useTexSubImage, bindingTarget, program, bitmap, flipY, premultiplyAlpha, optionsVal, + internalFormat, pixelFormat, pixelType, gl, tiu, wtu) +{ + var halfRed = [128, 0, 0]; + var halfGreen = [0, 128, 0]; + var redColor = [255, 0, 0]; + var greenColor = [0, 255, 0]; + var blackColor = [0, 0, 0]; + + switch (gl[pixelFormat]) { + case gl.RED: + case gl.RED_INTEGER: + greenColor = [0, 0, 0]; + halfGreen = [0, 0, 0]; + break; + default: + break; + } + + switch (gl[internalFormat]) { + case gl.SRGB8: + case gl.SRGB8_ALPHA8: + // Math.pow((128 / 255 + 0.055) / 1.055, 2.4) * 255 = 55 + halfRed = [55, 0, 0]; + halfGreen = [0, 55, 0]; + break; + default: + break; + } + + var str; + if (optionsVal.is3D) { + str = 'Testing ' + (useTexSubImage ? 'texSubImage3D' : 'texImage3D') + '[SubSource]' + + ' with flipY=' + flipY + ', premultiplyAlpha=' + premultiplyAlpha + + ', bindingTarget=TEXTURE_3D'; + } else { + str = 'Testing ' + (useTexSubImage ? 'texSubImage2D' : 'texImage2D') + '[SubSource]' + + ' with flipY=' + flipY + ', premultiplyAlpha=' + premultiplyAlpha + + ', bindingTarget=TEXTURE_2D'; + } + debug(str); + bufferedLogToConsole(str); + + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Enable writes to the RGBA channels + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(bindingTarget, texture); + // Set up texture parameters + gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + + var srcTL = redColor; + var srcTR = premultiplyAlpha ? ((optionsVal.alpha == 0.5) ? halfRed : (optionsVal.alpha == 1) ? redColor : blackColor) : redColor; + var srcBL = greenColor; + var srcBR = premultiplyAlpha ? ((optionsVal.alpha == 0.5) ? halfGreen : (optionsVal.alpha == 1) ? greenColor : blackColor) : greenColor; + + var tl, tr, bl, br; + + bufferedLogToConsole("Starts uploading the image into texture"); + // Upload the image into the texture + if (optionsVal.is3D) { + if (useTexSubImage) { + // Initialize the texture to black first + gl.texImage3D(bindingTarget, 0, gl[internalFormat], bitmap.width, bitmap.height, 1 /* depth */, 0, + gl[pixelFormat], gl[pixelType], null); + // Only upload the left half image to the right half texture. + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0); + gl.texSubImage3D(bindingTarget, 0, bitmap.width / 2, 0, 0, bitmap.width / 2, bitmap.height, 1, + gl[pixelFormat], gl[pixelType], bitmap); + tl = blackColor; + tr = srcTL; + bl = blackColor; + br = srcBL; + } else { + // Only upload the bottom middle quarter image + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, bitmap.height / 2); + gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0); + gl.texImage3D(bindingTarget, 0, gl[internalFormat], bitmap.width, bitmap.height / 2, 1 /* depth */, 0, + gl[pixelFormat], gl[pixelType], bitmap); + if (!flipY) { + tl = srcBL; + tr = srcBR; + bl = srcBL; + br = srcBR; + } else { + tl = srcTL; + tr = srcTR; + bl = srcTL; + br = srcTR; + } + } + } else { + if (useTexSubImage) { + // Initialize the texture to black first + gl.texImage2D(bindingTarget, 0, gl[internalFormat], bitmap.width, bitmap.height, 0, + gl[pixelFormat], gl[pixelType], null); + // Only upload the left half image to the right half texture. + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0); + gl.texSubImage2D(bindingTarget, 0, bitmap.width / 2, 0, bitmap.width / 2, bitmap.height, + gl[pixelFormat], gl[pixelType], bitmap); + tl = blackColor; + tr = srcTL; + bl = blackColor; + br = srcBL; + } else { + // Only upload the right bottom image. + gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, bitmap.width / 2); + gl.pixelStorei(gl.UNPACK_SKIP_ROWS, bitmap.height / 2); + gl.texImage2D(bindingTarget, 0, gl[internalFormat], bitmap.width / 2, bitmap.height / 2, 0, + gl[pixelFormat], gl[pixelType], bitmap); + resetUnpackParams(gl); + if (!flipY) { + tl = srcBR; + tr = srcBR; + bl = srcBR; + br = srcBR; + } else { + tl = srcTR; + tr = srcTR; + bl = srcTR; + br = srcTR; + } + } + } + bufferedLogToConsole("Uploading texture completed"); + + var width = gl.canvas.width; + var halfWidth = Math.floor(width / 2); + var quaterWidth = Math.floor(halfWidth / 2); + var height = gl.canvas.height; + var halfHeight = Math.floor(height / 2); + var quaterHeight = Math.floor(halfHeight / 2); + + var top = flipY ? quaterHeight : (height - halfHeight + quaterHeight); + var bottom = flipY ? (height - halfHeight + quaterHeight) : quaterHeight; + + + var tolerance = 10; + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + + // Check the top pixel and bottom pixel and make sure they have + // the right color. + // For right side, check pixels closer to left to avoid border in the video tests. + bufferedLogToConsole("Checking " + (flipY ? "top" : "bottom")); + wtu.checkCanvasRect(gl, quaterWidth, bottom, 2, 2, tl, "shouldBe " + tl, tolerance); + wtu.checkCanvasRect(gl, halfWidth + quaterWidth / 2, bottom, 2, 2, tr, "shouldBe " + tr, tolerance); + bufferedLogToConsole("Checking " + (flipY ? "bottom" : "top")); + wtu.checkCanvasRect(gl, quaterWidth, top, 2, 2, bl, "shouldBe " + bl, tolerance); + wtu.checkCanvasRect(gl, halfWidth + quaterWidth / 2, top, 2, 2, br, "shouldBe " + br, tolerance); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); +} + +function runTestOnBindingTargetImageBitmap(bindingTarget, program, bitmaps, optionsVal, + internalFormat, pixelFormat, pixelType, gl, tiu, wtu) +{ + var cases = [ + { sub: false, bitmap: bitmaps.noFlipYPremul, flipY: false, premultiply: true }, + { sub: true, bitmap: bitmaps.noFlipYPremul, flipY: false, premultiply: true }, + { sub: false, bitmap: bitmaps.noFlipYUnpremul, flipY: false, premultiply: false }, + { sub: true, bitmap: bitmaps.noFlipYUnpremul, flipY: false, premultiply: false }, + { sub: false, bitmap: bitmaps.flipYPremul, flipY: true, premultiply: true }, + { sub: true, bitmap: bitmaps.flipYPremul, flipY: true, premultiply: true }, + { sub: false, bitmap: bitmaps.flipYUnpremul, flipY: true, premultiply: false }, + { sub: true, bitmap: bitmaps.flipYUnpremul, flipY: true, premultiply: false }, + ]; + + for (var i in cases) { + runOneIterationImageBitmapTest(cases[i].sub, bindingTarget, program, cases[i].bitmap, + cases[i].flipY, cases[i].premultiply, optionsVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu); + } + + if (wtu.getDefault3DContextVersion() > 1 && + (bindingTarget == gl.TEXTURE_2D || bindingTarget == gl.TEXTURE_3D)) { + // SKip testing source sub region on TEXTURE_CUBE_MAP and TEXTURE_2D_ARRAY to save running time. + for (var i in cases) { + runOneIterationImageBitmapTestSubSource(cases[i].sub, bindingTarget, program, cases[i].bitmap, + cases[i].flipY, cases[i].premultiply, optionsVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu); + } + } +} + +function runImageBitmapTestInternal(bitmaps, alphaVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, is3D) +{ + var optionsVal = {alpha: alphaVal, is3D: is3D}; + var program; + if (is3D) { + program = tiu.setupTexturedQuadWith3D(gl, internalFormat); + runTestOnBindingTargetImageBitmap(gl.TEXTURE_3D, program, bitmaps, optionsVal, + internalFormat, pixelFormat, pixelType, gl, tiu, wtu); + } else { + program = tiu.setupTexturedQuad(gl, internalFormat); + runTestOnBindingTargetImageBitmap(gl.TEXTURE_2D, program, bitmaps, optionsVal, + internalFormat, pixelFormat, pixelType, gl, tiu, wtu); + } + + // cube map texture must be square + if (bitmaps.noFlipYPremul.width == bitmaps.noFlipYPremul.height) { + if (is3D) { + program = tiu.setupTexturedQuadWith2DArray(gl, internalFormat); + runTestOnBindingTargetImageBitmap(gl.TEXTURE_2D_ARRAY, program, bitmaps, optionsVal, + internalFormat, pixelFormat, pixelType, gl, tiu, wtu); + } else { + program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); + runTestOnBindingTargetImageBitmap(gl.TEXTURE_CUBE_MAP, program, bitmaps, optionsVal, + internalFormat, pixelFormat, pixelType, gl, tiu, wtu); + } + } +} + +function runImageBitmapTest(source, alphaVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, is3D) +{ + var bitmaps = []; + var p1 = createImageBitmap(source, {imageOrientation: "none", premultiplyAlpha: "premultiply"}).then(function(imageBitmap) { bitmaps.noFlipYPremul = imageBitmap }); + var p2 = createImageBitmap(source, {imageOrientation: "none", premultiplyAlpha: "none"}).then(function(imageBitmap) { bitmaps.noFlipYUnpremul = imageBitmap }); + var p3 = createImageBitmap(source, {imageOrientation: "flipY", premultiplyAlpha: "premultiply"}).then(function(imageBitmap) { bitmaps.flipYPremul = imageBitmap }); + var p4 = createImageBitmap(source, {imageOrientation: "flipY", premultiplyAlpha: "none"}).then(function(imageBitmap) { bitmaps.flipYUnpremul = imageBitmap }); + Promise.all([p1, p2, p3, p4]).then(function() { + bufferedLogToConsole("All createImageBitmap promises are resolved"); + runImageBitmapTestInternal(bitmaps, alphaVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, is3D); + }, function() { + // createImageBitmap with options could be rejected if it is not supported + finishTest(); + return; + }); +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-input-validation.js b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-input-validation.js new file mode 100644 index 000000000..154dfbddf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-input-validation.js @@ -0,0 +1,580 @@ +/* +** Copyright (c) 2015 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. +*/ + +// This test relies on the surrounding web page defining a variable +// "contextVersion" which indicates what version of WebGL it's running +// on -- 1 for WebGL 1.0, 2 for WebGL 2.0, etc. + +"use strict"; +description("Validate tex functions input parameters"); + +var wtu = WebGLTestUtils; +var gl = null; +var tex = null; +var error = 0; + +shouldBeNonNull("gl = wtu.create3DContext(undefined, undefined, contextVersion)"); +shouldBeNonNull("tex = gl.createTexture()"); +gl.bindTexture(gl.TEXTURE_2D, tex); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +function enumToString(value) { + return wtu.glEnumToString(gl, value); +} + +function testTexParameter(testCase) { + var msg = "paramName: " + enumToString(testCase.pname); + error = testCase.expectedError; + gl.texParameteri(testCase.target, testCase.pname, testCase.param); + wtu.glErrorShouldBe(gl, error, msg); + gl.texParameterf(testCase.target, testCase.pname, testCase.param); + wtu.glErrorShouldBe(gl, error, msg); +} + +function testGetTexParameter(testCase) { + var msg = "paramName: " + enumToString(testCase.pname); + error = testCase.expectedError; + gl.getTexParameter(testCase.target, testCase.pname); + wtu.glErrorShouldBe(gl, error, msg); +} + +function testTexImage2D(testCase) { + var level = 0; + var width = 16; + var height = 16; + var msg = " internalFormat: " + enumToString(testCase.internalFormat) + + " target: " + enumToString(testCase.target) + + " format: " + enumToString(testCase.format) + + " type: " + enumToString(testCase.type) + + " border: " + testCase.border; + + gl.texImage2D(testCase.target, level, testCase.internalFormat, width, height, testCase.border, testCase.format, testCase.type, null); + error = testCase.expectedError; + wtu.glErrorShouldBe(gl, error, msg); +} + +function testTexSubImage2D(testCase) { + var level = 0; + var xoffset = 0; + var yoffset = 0; + var width = 16; + var height = 16; + var msg = " format: " + enumToString(testCase.format) + + " type: " + enumToString(testCase.type); + var array = new Uint8Array(width * height * 4); + + gl.texSubImage2D(testCase.target, level, xoffset, yoffset, width, height, testCase.format, testCase.type, array); + error = testCase.expectedError; + wtu.glErrorShouldBe(gl, error, msg); +} + +function testCopyTexImage2D(testCase) { + var level = 0; + var x = 0; + var y = 0; + var width = 16; + var height = 16; + var msg = " colorBufferFormat: " + enumToString(testCase.colorBufferFormat) + + " internalFormat: " + enumToString(testCase.internalFormat) + + " target: " + enumToString(testCase.target) + + " border: " + testCase.border; + + gl.renderbufferStorage(gl.RENDERBUFFER, testCase.colorBufferFormat, width, height); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE"); + + gl.copyTexImage2D(testCase.target, level, testCase.internalFormat, x, y, width, height, testCase.border); + error = testCase.expectedError; + wtu.glErrorShouldBe(gl, error, msg); +} + +function testCopyTexSubImage2D(testCase) { + var level = 0; + var x = 0; + var y = 0; + var width = 16; + var height = 16; + var xoffset = 0; + var yoffset = 0; + var border = 0; + var type = gl.UNSIGNED_BYTE; + var msg = " colorBufferFormat: " + enumToString(testCase.colorBufferFormat) + + " internalFormat: " + enumToString(testCase.internalFormat) + + " target: " + enumToString(testCase.target); + + gl.renderbufferStorage(gl.RENDERBUFFER, testCase.colorBufferFormat, width, height); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE"); + + gl.texImage2D(testCase.target, level, testCase.internalFormat, xoffset + width, yoffset + height, border, testCase.internalFormat, type, null); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + gl.copyTexSubImage2D(testCase.target, level, xoffset, yoffset, x, y, width, height); + error = testCase.expectedError; + wtu.glErrorShouldBe(gl, error, msg); +} + +function testCopyFromInternalFBO(testCase) { + var target = gl.TEXTURE_2D; + var level = 0; + var x = 0; + var y = 0; + var width = 16; + var height = 16; + var xoffset = 0; + var yoffset = 0; + var border = 0; + var type = gl.UNSIGNED_BYTE; + var msg = " colorBufferFormat: " + enumToString(testCase.contextAlpha ? gl.RGBA : gl.RGB) + + " internalFormat: " + enumToString(testCase.internalFormat); + + if (testCase.contextAlpha) { + gl = wtu.create3DContext(null, { alpha: true }, contextVersion); + } else { + gl = wtu.create3DContext(null, { alpha: false }, contextVersion); + } + shouldBeNonNull("gl"); + shouldBeNonNull("tex = gl.createTexture()"); + gl.bindTexture(target, tex); + if (testCase.subImage) { + gl.texImage2D(target, level, testCase.internalFormat, xoffset + width, yoffset + height, border, testCase.internalFormat, type, null); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + gl.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); + } else { + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + gl.copyTexImage2D(target, level, testCase.internalFormat, x, y, width, height, border); + } + error = testCase.expectedError; + wtu.glErrorShouldBe(gl, error, msg); +} + +// Only for WebGL2.0. +function testTexImage3D(testCase) { + var level = 0; + var width = 16; + var height = 16; + var depth = 16; + var msg = " internalFormat: " + enumToString(testCase.internalFormat) + + " target: " + enumToString(testCase.target) + + " format: " + enumToString(testCase.format) + + " type: " + enumToString(testCase.type) + + " border: " + testCase.border; + + gl.texImage3D(testCase.target, level, testCase.internalFormat, width, height, depth, testCase.border, testCase.format, testCase.type, null); + error = testCase.expectedError; + wtu.glErrorShouldBe(gl, error, msg); +} + +function testTexSubImage3D(testCase) { + var level = 0; + var xoffset = 0; + var yoffset = 0; + var zoffset = 0; + var width = 16; + var height = 16; + var depth = 16; + var msg = " format: " + enumToString(testCase.format) + + " type: " + enumToString(testCase.type); + var array = new Uint8Array(width * height * depth * 4); + + gl.texSubImage3D(testCase.target, level, xoffset, yoffset, zoffset, width, height, depth, testCase.format, testCase.type, array); + error = testCase.expectedError; + wtu.glErrorShouldBe(gl, error, msg); +} + + +// Start checking. + +debug(""); +debug("Checking TexParameter: a set of inputs that are valid in GL but invalid in WebGL"); + +testCases = [ + { target: 0x0DE0, // GL_TEXTURE_1D + pname: gl.TEXTURE_WRAP_T, + param: gl.REPEAT, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_2D, + pname: gl.TEXTURE_WRAP_T, + param: 0x2900, // GL_CLAMP + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_2D, + pname: gl.TEXTURE_WRAP_T, + param: gl.REPEAT, + expectedError: gl.NO_ERROR } +]; + +if (contextVersion < 2) { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + pname: 0x813A, // GL_TEXTURE_MIN_LOD + param: 0, + expectedError: gl.INVALID_ENUM } + ]); +} else { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + pname: 0x8E42, // GL_TEXTURE_SWIZZLE_R + param: 0x1903, // GL_RED + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_2D, + pname: 0x8072, // GL_TEXTURE_WRAP_R + param: 0x2900, // GL_CLAMP + expectedError: gl.INVALID_ENUM } + ]); +} + +for (var ii = 0; ii < testCases.length; ++ii) { + testTexParameter(testCases[ii]); +} + +debug(""); +debug("Checking GetTexParameter: a set of inputs that are valid in GL but invalid in WebGL"); + +testCases = [ + { target: 0x0DE0, // GL_TEXTURE_1D + pname: gl.TEXTURE_WRAP_T, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_2D, + pname: gl.TEXTURE_WRAP_T, + expectedError: gl.NO_ERROR } +]; + +if (contextVersion < 2) { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + pname: 0x813A, // GL_TEXTURE_MIN_LOD + expectedError: gl.INVALID_ENUM } + ]); +} else { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + pname: 0x8E42, // GL_TEXTURE_SWIZZLE_R + expectedError: gl.INVALID_ENUM } + ]); +} + +for (var ii = 0; ii < testCases.length; ++ii) { + testGetTexParameter(testCases[ii]); +} + +debug(""); +debug("Checking TexImage2D: a set of inputs that are valid in GL but invalid in WebGL"); + +var testCases = [ + { target: 0x8064, // GL_PROXY_TEXTURE_2D + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_2D, + internalFormat: 0x1903, // GL_RED + border: 0, + format: 0x1903, // GL_RED + type: gl.UNSIGNED_BYTE, + expectedError: [gl.INVALID_ENUM, gl.INVALID_VALUE] }, + { target: gl.TEXTURE_2D, + internalFormat: gl.RGBA, + border: 1, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_VALUE }, + { target: gl.TEXTURE_2D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGB, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_OPERATION }, + { target: gl.TEXTURE_2D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.NO_ERROR } +]; + +if (contextVersion < 2) { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.BYTE, + expectedError: gl.INVALID_ENUM } + ]); +} else { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.BYTE, + expectedError: gl.INVALID_OPERATION }, + { target: gl.TEXTURE_3D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM } + ]); +} + +for (var ii = 0; ii < testCases.length; ++ii) { + testTexImage2D(testCases[ii]); +} + +debug(""); +debug("Checking TexSubImage2D: a set of inputs that are valid in GL but invalid in WebGL"); + +testCases = [ + { target: gl.TEXTURE_2D, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.NO_ERROR } +]; + +if (contextVersion < 2) { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + format: 0x1903, // GL_RED + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_2D, + format: gl.RGBA, + type: gl.BYTE, + expectedError: gl.INVALID_ENUM } + ]); +} else { + testCases = testCases.concat([ + { target: gl.TEXTURE_2D, + format: gl.RED, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_OPERATION }, + { target: gl.TEXTURE_2D, + format: gl.RGBA, + type: gl.BYTE, + expectedError: gl.INVALID_OPERATION }, + { target: gl.TEXTURE_3D, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM }, + ]); +} + +for (var ii = 0; ii < testCases.length; ++ii) { + testTexSubImage2D(testCases[ii]); +} + +debug(""); +debug("Checking CopyTexImage2D: a set of inputs that are valid in GL but invalid in WebGL"); + +var colorBuffer = null; +var fbo = null; + +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); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +testCases = [ + { target: gl.TEXTURE_2D, + colorBufferFormat: gl.RGB565, + internalFormat: 0x8054, // GL_RGB16 + border: 0, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_2D, + colorBufferFormat: gl.RGB565, + internalFormat: gl.RGBA, + border: 1, + expectedError: gl.INVALID_VALUE }, + { target: gl.TEXTURE_2D, + colorBufferFormat: gl.RGB565, + internalFormat: gl.RGBA, + border: 0, + expectedError: gl.INVALID_OPERATION }, + { target: gl.TEXTURE_2D, + colorBufferFormat: gl.RGB565, + internalFormat: gl.RGB, + border: 0, + expectedError: gl.NO_ERROR } +]; + +if (contextVersion > 1) { + testCases = testCases.concat([ + { target: gl.TEXTURE_3D, + colorBufferFormat: gl.RGB5_A1, + internalFormat: gl.RGBA, + border: 0, + expectedError: gl.INVALID_ENUM } + ]); +} + +for (var ii = 0; ii < testCases.length; ++ii) { + testCopyTexImage2D(testCases[ii]); +} + +debug(""); +debug("Checking CopyTexSubImage2D: a set of inputs that are valid in GL but invalid in WebGL"); + +testCases = [ + { target: gl.TEXTURE_2D, + colorBufferFormat: gl.RGB5_A1, + internalFormat: gl.RGBA, + expectedError: gl.NO_ERROR }, + { target: gl.TEXTURE_2D, + colorBufferFormat: gl.RGB565, + internalFormat: gl.RGBA, + expectedError: gl.INVALID_OPERATION } +]; + +for (var ii = 0; ii < testCases.length; ++ii) { + testCopyTexSubImage2D(testCases[ii]); +} + +debug(""); +debug("Checking CopyTex{Sub}Image2D: copy from WebGL internal framebuffer"); + +testCases = [ + { contextAlpha: true, + internalFormat: gl.RGBA, + subImage: false, + expectedError: gl.NO_ERROR }, + { contextAlpha: false, + internalFormat: gl.RGBA, + subImage: false, + expectedError: gl.INVALID_OPERATION }, + { contextAlpha: true, + internalFormat: gl.RGBA, + subImage: true, + expectedError: gl.NO_ERROR }, + { contextAlpha: false, + internalFormat: gl.RGBA, + subImage: true, + expectedError: gl.INVALID_OPERATION } +]; + +for (var ii = 0; ii < testCases.length; ++ii) { + testCopyFromInternalFBO(testCases[ii]); +} + +if (contextVersion > 1) { +// Create new texture for testing api of WebGL 2.0. +shouldBeNonNull("tex = gl.createTexture()"); +gl.bindTexture(gl.TEXTURE_3D, tex); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + +debug(""); +debug("Checking TexImage3D: a set of inputs that are valid in GL but invalid in WebGL"); + +var testCases = [ + { target: 0x8070, // GL_PROXY_TEXTURE_3D + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_3D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGB, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_OPERATION }, + { target: gl.TEXTURE_3D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.BYTE, + expectedError: gl.INVALID_OPERATION}, + { target: gl.TEXTURE_3D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.NO_ERROR } +]; + +for (var ii = 0; ii < testCases.length; ++ii) { + testTexImage3D(testCases[ii]); +} + +debug(""); +debug("Checking TexImage3D: bad target, internalformats, formats, types"); + +var testCases = [ + { target: gl.TEXTURE_2D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_3D, + internalFormat: gl.RG, + border: 0, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_VALUE}, + { target: gl.TEXTURE_3D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RG8, + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_3D, + internalFormat: gl.RGBA, + border: 0, + format: gl.RGBA, + type: gl.INT, + expectedError: gl.INVALID_OPERATION}, +]; + +for (var ii = 0; ii < testCases.length; ++ii) { + testTexImage3D(testCases[ii]); +} + +debug(""); +debug("Checking TexSubImage3D: a set of inputs that are valid in GL but invalid in WebGL"); + +testCases = [ + { target: gl.TEXTURE_3D, + format: 0x80E0, // GL_BGR + type: gl.UNSIGNED_BYTE, + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_3D, + format: gl.RGBA, + type: 0x8032, // GL_UNSIGNED_BYTE_3_3_2 + expectedError: gl.INVALID_ENUM }, + { target: gl.TEXTURE_3D, + format: gl.RGBA, + type: gl.UNSIGNED_BYTE, + expectedError: gl.NO_ERROR } +]; + +for (var ii = 0; ii < testCases.length; ++ii) { + testTexSubImage3D(testCases[ii]); +} + +} + +var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-test-cases.js b/dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-test-cases.js new file mode 100644 index 000000000..462eaae1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-test-cases.js @@ -0,0 +1,90 @@ +/* +** Copyright (c) 2013 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +// The "name" attribute is a concession to browsers which don't +// implement the "name" property on function objects. +var testCases = + [ {name: "Float32Array", + unsigned: false, + integral: false, + elementSizeInBytes: 4, + testValues: [ -500.5, 500.5 ], + expectedValues: [ -500.5, 500.5 ] + }, + {name: "Float64Array", + unsigned: false, + integral: false, + elementSizeInBytes: 8, + testValues: [ -500.5, 500.5 ], + expectedValues: [ -500.5, 500.5 ] + }, + {name: "Int8Array", + unsigned: false, + integral: true, + elementSizeInBytes: 1, + testValues: [ -128, 127, -129, 128 ], + expectedValues: [ -128, 127, 127, -128 ] + }, + {name: "Int16Array", + unsigned: false, + integral: true, + elementSizeInBytes: 2, + testValues: [ -32768, 32767, -32769, 32768 ], + expectedValues: [ -32768, 32767, 32767, -32768 ] + }, + {name: "Int32Array", + unsigned: false, + integral: true, + elementSizeInBytes: 4, + testValues: [ -2147483648, 2147483647, -2147483649, 2147483648 ], + expectedValues: [ -2147483648, 2147483647, 2147483647, -2147483648 ] + }, + {name: "Uint8Array", + unsigned: true, + integral: true, + elementSizeInBytes: 1, + testValues: [ 0, 255, -1, 256 ], + expectedValues: [ 0, 255, 255, 0 ] + }, + {name: "Uint8ClampedArray", + unsigned: true, + integral: true, + elementSizeInBytes: 1, + testValues: [ 0, 255, -1, 256 ], + expectedValues: [ 0, 255, 0, 255 ] + }, + {name: "Uint16Array", + unsigned: true, + integral: true, + elementSizeInBytes: 2, + testValues: [ 0, 65535, -1, 65536 ], + expectedValues: [ 0, 65535, 65535, 0 ] + }, + {name: "Uint32Array", + unsigned: true, + integral: true, + elementSizeInBytes: 4, + testValues: [ 0, 4294967295, -1, 4294967296 ], + expectedValues: [ 0, 4294967295, 4294967295, 0 ] + } + ]; diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-worker.js b/dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-worker.js new file mode 100644 index 000000000..c68ee07c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/typed-array-worker.js @@ -0,0 +1,89 @@ +/* +** Copyright (c) 2013 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +function constructTypedArray(type, data) { + if (type == 'Int8Array') { + return new Int8Array(data); + } else if (type == 'Uint8Array') { + return new Uint8Array(data); + } else if (type == 'Uint8ClampedArray') { + return new Uint8ClampedArray(data); + } else if (type == 'Int16Array') { + return new Int16Array(data); + } else if (type == 'Uint16Array') { + return new Uint16Array(data); + } else if (type == 'Int32Array') { + return new Int32Array(data); + } else if (type == 'Uint32Array') { + return new Uint32Array(data); + } else if (type == 'Float32Array') { + return new Float32Array(data); + } else if (type == 'Float64Array') { + return new Float64Array(data); + } +} + +function constructDataView(subType, elementSizeInBytes, data) { + var setter = "set" + subType; + var byteOffset = 0; + var buffer = new ArrayBuffer(elementSizeInBytes * data.length); + var dataView = new DataView(buffer); + for (var ii = 0; ii < data.length; ++ii) { + dataView[setter](byteOffset, data[ii]); + byteOffset += elementSizeInBytes; + } + return dataView; +} + +onmessage = function(event) { + var message = event.data; + if (message.command == 'copy' || + message.command == 'transfer' || + message.command == 'copyBuffer' || + message.command == 'transferBuffer') { + var view; + if (message.type != 'DataView') { + view = constructTypedArray(message.type, message.data); + } else { + view = constructDataView(message.subType, message.elementSizeInBytes, message.data); + } + var valueToSend; + if (message.command == 'copy' || + message.command == 'transfer') { + valueToSend = view; + } else { + valueToSend = view.buffer; + } + var transferablesToSend = undefined; + if (message.command == 'transfer' || + message.command == 'transferBuffer') { + transferablesToSend = [ view.buffer ]; + } + postMessage(valueToSend, transferablesToSend); + } else if (message.command == 'pong') { + postMessage(message.data, message.transferables); + } else if (message.command == 'ignore') { + } else { + postMessage('error: unknown message'); + } +}; diff --git a/dom/canvas/test/webgl-conf/checkout/js/webgl-test-harness.js b/dom/canvas/test/webgl-conf/checkout/js/webgl-test-harness.js new file mode 100644 index 000000000..0287bf6ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/webgl-test-harness.js @@ -0,0 +1,659 @@ +/* +** 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. +*/ + +// This is a test harness for running javascript tests in the browser. +// The only identifier exposed by this harness is WebGLTestHarnessModule. +// +// To use it make an HTML page with an iframe. Then call the harness like this +// +// function reportResults(type, msg, success) { +// ... +// return true; +// } +// +// var fileListURL = '00_test_list.txt'; +// var testHarness = new WebGLTestHarnessModule.TestHarness( +// iframe, +// fileListURL, +// reportResults, +// options); +// +// The harness will load the fileListURL and parse it for the URLs, one URL +// per line preceded by options, see below. URLs should be on the same domain +// and at the same folder level or below the main html file. If any URL ends +// in .txt it will be parsed as well so you can nest .txt files. URLs inside a +// .txt file should be relative to that text file. +// +// During startup, for each page found the reportFunction will be called with +// WebGLTestHarnessModule.TestHarness.reportType.ADD_PAGE and msg will be +// the URL of the test. +// +// Each test is required to call testHarness.reportResults. This is most easily +// accomplished by storing that value on the main window with +// +// window.webglTestHarness = testHarness +// +// and then adding these to functions to your tests. +// +// function reportTestResultsToHarness(success, msg) { +// if (window.parent.webglTestHarness) { +// window.parent.webglTestHarness.reportResults(success, msg); +// } +// } +// +// function notifyFinishedToHarness() { +// if (window.parent.webglTestHarness) { +// window.parent.webglTestHarness.notifyFinished(); +// } +// } +// +// This way your tests will still run without the harness and you can use +// any testing framework you want. +// +// Each test should call reportTestResultsToHarness with true for success if it +// succeeded and false if it fail followed and any message it wants to +// associate with the test. If your testing framework supports checking for +// timeout you can call it with success equal to undefined in that case. +// +// To run the tests, call testHarness.runTests(options); +// +// For each test run, before the page is loaded the reportFunction will be +// called with WebGLTestHarnessModule.TestHarness.reportType.START_PAGE and msg +// will be the URL of the test. You may return false if you want the test to be +// skipped. +// +// For each test completed the reportFunction will be called with +// with WebGLTestHarnessModule.TestHarness.reportType.TEST_RESULT, +// success = true on success, false on failure, undefined on timeout +// and msg is any message the test choose to pass on. +// +// When all the tests on the page have finished your page must call +// notifyFinishedToHarness. If notifyFinishedToHarness is not called +// the harness will assume the test timed out. +// +// When all the tests on a page have finished OR the page as timed out the +// reportFunction will be called with +// WebGLTestHarnessModule.TestHarness.reportType.FINISH_PAGE +// where success = true if the page has completed or undefined if the page timed +// out. +// +// Finally, when all the tests have completed the reportFunction will be called +// with WebGLTestHarnessModule.TestHarness.reportType.FINISHED_ALL_TESTS. +// +// Harness Options +// +// These are passed in to the TestHarness as a JavaScript object +// +// version: (required!) +// +// Specifies a version used to filter tests. Tests marked as requiring +// a version greater than this version will not be included. +// +// example: new TestHarness(...., {version: "3.1.2"}); +// +// minVersion: +// +// Specifies the minimum version a test must require to be included. +// This basically flips the filter so that only tests marked with +// --min-version will be included if they are at this minVersion or +// greater. +// +// example: new TestHarness(...., {minVersion: "2.3.1"}); +// +// maxVersion: +// +// Specifies the maximum version a test must require to be included. +// This basically flips the filter so that only tests marked with +// --max-version will be included if they are at this maxVersion or +// less. +// +// example: new TestHarness(...., {maxVersion: "2.3.1"}); +// +// fast: +// +// Specifies to skip any tests marked as slow. +// +// example: new TestHarness(..., {fast: true}); +// +// Test Options: +// +// Any test URL or .txt file can be prefixed by the following options +// +// min-version: +// +// Sets the minimum version required to include this test. A version is +// passed into the harness options. Any test marked as requiring a +// min-version greater than the version passed to the harness is skipped. +// This allows you to add new tests to a suite of tests for a future +// version of the suite without including the test in the current version. +// If no -min-version is specified it is inheriited from the .txt file +// including it. The default is 1.0.0 +// +// example: --min-version 2.1.3 sometest.html +// +// max-version: +// +// Sets the maximum version required to include this test. A version is +// passed into the harness options. Any test marked as requiring a +// max-version less than the version passed to the harness is skipped. +// This allows you to test functionality that has been removed from later +// versions of the suite. +// If no -max-version is specified it is inherited from the .txt file +// including it. +// +// example: --max-version 1.9.9 sometest.html +// +// slow: +// +// Marks a test as slow. Slow tests can be skipped by passing fastOnly: true +// to the TestHarness. Of course you need to pass all tests but sometimes +// you'd like to test quickly and run only the fast subset of tests. +// +// example: --slow some-test-that-takes-2-mins.html +// + +WebGLTestHarnessModule = function() { + +/** + * Wrapped logging function. + */ +var log = function(msg) { + if (window.console && window.console.log) { + window.console.log(msg); + } +}; + +/** + * Loads text from an external file. This function is synchronous. + * @param {string} url The url of the external file. + * @param {!function(bool, string): void} callback that is sent a bool for + * success and the string. + */ +var loadTextFileAsynchronous = function(url, callback) { + log ("loading: " + url); + var error = 'loadTextFileSynchronous failed to load url "' + url + '"'; + var request; + if (window.XMLHttpRequest) { + request = new XMLHttpRequest(); + if (request.overrideMimeType) { + request.overrideMimeType('text/plain'); + } + } else { + throw 'XMLHttpRequest is disabled'; + } + try { + request.open('GET', url, true); + request.onreadystatechange = function() { + if (request.readyState == 4) { + var text = ''; + // HTTP reports success with a 200 status. The file protocol reports + // success with zero. HTTP does not use zero as a status code (they + // start at 100). + // https://developer.mozilla.org/En/Using_XMLHttpRequest + var success = request.status == 200 || request.status == 0; + if (success) { + text = request.responseText; + } + log("loaded: " + url); + callback(success, text); + } + }; + request.send(null); + } catch (e) { + log("failed to load: " + url); + callback(false, ''); + } +}; + +/** + * @param {string} versionString WebGL version string. + * @return {number} Integer containing the WebGL major version. + */ +var getMajorVersion = function(versionString) { + if (!versionString) { + return 1; + } + return parseInt(versionString.split(" ")[0].split(".")[0], 10); +}; + +/** + * @param {string} url Base URL of the test. + * @param {map} options Map of options to append to the URL's query string. + * @return {string} URL that will run the test with the given WebGL version. + */ +var getURLWithOptions = function(url, options) { + var queryArgs = 0; + + for (i in options) { + url += queryArgs ? "&" : "?"; + url += i + "=" + options[i]; + queryArgs++; + } + + return url; +}; + +/** + * Compare version strings. + */ +var greaterThanOrEqualToVersion = function(have, want) { + have = have.split(" ")[0].split("."); + want = want.split(" ")[0].split("."); + + //have 1.2.3 want 1.1 + //have 1.1.1 want 1.1 + //have 1.0.9 want 1.1 + //have 1.1 want 1.1.1 + + for (var ii = 0; ii < want.length; ++ii) { + var wantNum = parseInt(want[ii]); + var haveNum = have[ii] ? parseInt(have[ii]) : 0 + if (haveNum > wantNum) { + return true; // 2.0.0 is greater than 1.2.3 + } + if (haveNum < wantNum) { + return false; + } + } + return true; +}; + +/** + * Reads a file, recursively adding files referenced inside. + * + * Each line of URL is parsed, comments starting with '#' or ';' + * or '//' are stripped. + * + * arguments beginning with -- are extracted + * + * lines that end in .txt are recursively scanned for more files + * other lines are added to the list of files. + * + * @param {string} url The url of the file to read. + * @param {function(boolean, !Array.):void} callback + * Callback that is called with true for success and an + * array of filenames. + * @param {Object} options Optional options + * + * Options: + * version: {string} The version of the conformance test. + * Tests with the argument --min-version will + * be ignored version is less then + * + */ +var getFileList = function(url, callback, options) { + var files = []; + + var copyObject = function(obj) { + return JSON.parse(JSON.stringify(obj)); + }; + + var toCamelCase = function(str) { + return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase() }); + }; + + var globalOptions = copyObject(options); + globalOptions.defaultVersion = "1.0"; + globalOptions.defaultMaxVersion = null; + + var getFileListImpl = function(prefix, line, lineNum, hierarchicalOptions, callback) { + var files = []; + + var args = line.split(/\s+/); + var nonOptions = []; + var useTest = true; + var testOptions = {}; + for (var jj = 0; jj < args.length; ++jj) { + var arg = args[jj]; + if (arg[0] == '-') { + if (arg[1] != '-') { + throw ("bad option at in " + url + ":" + lineNum + ": " + arg); + } + var option = arg.substring(2); + switch (option) { + // no argument options. + case 'slow': + testOptions[toCamelCase(option)] = true; + break; + // one argument options. + case 'min-version': + case 'max-version': + ++jj; + testOptions[toCamelCase(option)] = args[jj]; + break; + default: + throw ("bad unknown option '" + option + "' at in " + url + ":" + lineNum + ": " + arg); + } + } else { + nonOptions.push(arg); + } + } + var url = prefix + nonOptions.join(" "); + + if (url.substr(url.length - 4) != '.txt') { + var minVersion = testOptions.minVersion; + if (!minVersion) { + minVersion = hierarchicalOptions.defaultVersion; + } + var maxVersion = testOptions.maxVersion; + if (!maxVersion) { + maxVersion = hierarchicalOptions.defaultMaxVersion; + } + var slow = testOptions.slow; + if (!slow) { + slow = hierarchicalOptions.defaultSlow; + } + + if (globalOptions.fast && slow) { + useTest = false; + } else if (globalOptions.minVersion) { + useTest = greaterThanOrEqualToVersion(minVersion, globalOptions.minVersion); + } else if (globalOptions.maxVersion && maxVersion) { + useTest = greaterThanOrEqualToVersion(globalOptions.maxVersion, maxVersion); + } else { + useTest = greaterThanOrEqualToVersion(globalOptions.version, minVersion); + if (maxVersion) { + useTest = useTest && greaterThanOrEqualToVersion(maxVersion, globalOptions.version); + } + } + } + + if (!useTest) { + callback(true, []); + return; + } + + if (url.substr(url.length - 4) == '.txt') { + // If a version was explicity specified pass it down. + if (testOptions.minVersion) { + hierarchicalOptions.defaultVersion = testOptions.minVersion; + } + if (testOptions.maxVersion) { + hierarchicalOptions.defaultMaxVersion = testOptions.maxVersion; + } + if (testOptions.slow) { + hierarchicalOptions.defaultSlow = testOptions.slow; + } + loadTextFileAsynchronous(url, function() { + return function(success, text) { + if (!success) { + callback(false, ''); + return; + } + var lines = text.split('\n'); + var prefix = ''; + var lastSlash = url.lastIndexOf('/'); + if (lastSlash >= 0) { + prefix = url.substr(0, lastSlash + 1); + } + var fail = false; + var count = 1; + var index = 0; + for (var ii = 0; ii < lines.length; ++ii) { + var str = lines[ii].replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + if (str.length > 4 && + str[0] != '#' && + str[0] != ";" && + str.substr(0, 2) != "//") { + ++count; + getFileListImpl(prefix, str, ii + 1, copyObject(hierarchicalOptions), function(index) { + return function(success, new_files) { + //log("got files: " + new_files.length); + if (success) { + files[index] = new_files; + } + finish(success); + }; + }(index++)); + } + } + finish(true); + + function finish(success) { + if (!success) { + fail = true; + } + --count; + //log("count: " + count); + if (!count) { + callback(!fail, files); + } + } + } + }()); + } else { + files.push(url); + callback(true, files); + } + }; + + getFileListImpl('', url, 1, globalOptions, function(success, files) { + // flatten + var flat = []; + flatten(files); + function flatten(files) { + for (var ii = 0; ii < files.length; ++ii) { + var value = files[ii]; + if (typeof(value) == "string") { + flat.push(value); + } else { + flatten(value); + } + } + } + callback(success, flat); + }); +}; + +var FilterURL = (function() { + var prefix = window.location.pathname; + prefix = prefix.substring(0, prefix.lastIndexOf("/") + 1); + return function(url) { + if (url.substring(0, prefix.length) == prefix) { + url = url.substring(prefix.length); + } + return url; + }; +}()); + +var TestFile = function(url) { + this.url = url; +}; + +var Test = function(file) { + this.file = file; +}; + +var TestHarness = function(iframe, filelistUrl, reportFunc, options) { + this.window = window; + this.iframes = iframe.length ? iframe : [iframe]; + this.reportFunc = reportFunc; + this.timeoutDelay = 20000; + this.files = []; + this.allowSkip = options.allowSkip; + this.webglVersion = getMajorVersion(options.version); + this.dumpShaders = options.dumpShaders; + this.quiet = options.quiet; + + var that = this; + getFileList(filelistUrl, function() { + return function(success, files) { + that.addFiles_(success, files); + }; + }(), options); + +}; + +TestHarness.reportType = { + ADD_PAGE: 1, + READY: 2, + START_PAGE: 3, + TEST_RESULT: 4, + FINISH_PAGE: 5, + FINISHED_ALL_TESTS: 6 +}; + +TestHarness.prototype.addFiles_ = function(success, files) { + if (!success) { + this.reportFunc( + TestHarness.reportType.FINISHED_ALL_TESTS, + '', + 'Unable to load tests. Are you running locally?\n' + + 'You need to run from a server or configure your\n' + + 'browser to allow access to local files (not recommended).\n\n' + + 'Note: An easy way to run from a server:\n\n' + + '\tcd path_to_tests\n' + + '\tpython -m SimpleHTTPServer\n\n' + + 'then point your browser to ' + + '' + + 'http://localhost:8000/webgl-conformance-tests.html', + false) + return; + } + log("total files: " + files.length); + for (var ii = 0; ii < files.length; ++ii) { + log("" + ii + ": " + files[ii]); + this.files.push(new TestFile(files[ii])); + this.reportFunc(TestHarness.reportType.ADD_PAGE, '', files[ii], undefined); + } + this.reportFunc(TestHarness.reportType.READY, '', undefined, undefined); +} + +TestHarness.prototype.runTests = function(opt_options) { + var options = opt_options || { }; + options.start = options.start || 0; + options.count = options.count || this.files.length; + + this.idleIFrames = this.iframes.slice(0); + this.runningTests = {}; + var testsToRun = []; + for (var ii = 0; ii < options.count; ++ii) { + testsToRun.push(ii + options.start); + } + this.numTestsRemaining = options.count; + this.testsToRun = testsToRun; + this.startNextTest(); +}; + +TestHarness.prototype.setTimeout = function(test) { + var that = this; + test.timeoutId = this.window.setTimeout(function() { + that.timeout(test); + }, this.timeoutDelay); +}; + +TestHarness.prototype.clearTimeout = function(test) { + this.window.clearTimeout(test.timeoutId); +}; + +TestHarness.prototype.startNextTest = function() { + if (this.numTestsRemaining == 0) { + log("done"); + this.reportFunc(TestHarness.reportType.FINISHED_ALL_TESTS, + '', '', true); + } else { + while (this.testsToRun.length > 0 && this.idleIFrames.length > 0) { + var testId = this.testsToRun.shift(); + var iframe = this.idleIFrames.shift(); + this.startTest(iframe, this.files[testId], this.webglVersion); + } + } +}; + +TestHarness.prototype.startTest = function(iframe, testFile, webglVersion) { + var test = { + iframe: iframe, + testFile: testFile + }; + var url = testFile.url; + this.runningTests[url] = test; + log("loading: " + url); + if (this.reportFunc(TestHarness.reportType.START_PAGE, url, url, undefined)) { + iframe.src = getURLWithOptions(url, { + "webglVersion": webglVersion, + "dumpShaders": this.dumpShaders, + "quiet": this.quiet + }); + this.setTimeout(test); + } else { + this.reportResults(url, !!this.allowSkip, "skipped", true); + this.notifyFinished(url); + } +}; + +TestHarness.prototype.getTest = function(url) { + var test = this.runningTests[FilterURL(url)]; + if (!test) { + throw("unknown test:" + url); + } + return test; +}; + +TestHarness.prototype.reportResults = function(url, success, msg, skipped) { + url = FilterURL(url); + var test = this.getTest(url); + this.clearTimeout(test); + log(success ? "PASS" : "FAIL", msg); + this.reportFunc(TestHarness.reportType.TEST_RESULT, url, msg, success, skipped); + // For each result we get, reset the timeout + this.setTimeout(test); +}; + +TestHarness.prototype.dequeTest = function(test) { + this.clearTimeout(test); + this.idleIFrames.push(test.iframe); + delete this.runningTests[test.testFile.url]; + --this.numTestsRemaining; +} + +TestHarness.prototype.notifyFinished = function(url) { + url = FilterURL(url); + var test = this.getTest(url); + log(url + ": finished"); + this.dequeTest(test); + this.reportFunc(TestHarness.reportType.FINISH_PAGE, url, url, true); + this.startNextTest(); +}; + +TestHarness.prototype.timeout = function(test) { + this.dequeTest(test); + var url = test.testFile.url; + log(url + ": timeout"); + this.reportFunc(TestHarness.reportType.FINISH_PAGE, url, url, undefined); + this.startNextTest(); +}; + +TestHarness.prototype.setTimeoutDelay = function(x) { + this.timeoutDelay = x; +}; + +return { + 'TestHarness': TestHarness, + 'getMajorVersion': getMajorVersion, + 'getURLWithOptions': getURLWithOptions + }; + +}(); + + + diff --git a/dom/canvas/test/webgl-conf/checkout/js/webgl-test-utils.js b/dom/canvas/test/webgl-conf/checkout/js/webgl-test-utils.js new file mode 100644 index 000000000..545ccaed5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/webgl-test-utils.js @@ -0,0 +1,3122 @@ +/* +** 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. +*/ +var WebGLTestUtils = (function() { +"use strict"; + +/** + * Wrapped logging function. + * @param {string} msg The message to log. + */ +var log = function(msg) { + bufferedLogToConsole(msg); +}; + +/** + * Wrapped logging function. + * @param {string} msg The message to log. + */ +var error = function(msg) { + // For the time being, diverting this to window.console.log rather + // than window.console.error. If anyone cares enough they can + // generalize the mechanism in js-test-pre.js. + log(msg); +}; + +/** + * Turn off all logging. + */ +var loggingOff = function() { + log = function() {}; + error = function() {}; +}; + +/** + * Converts a WebGL enum to a string. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} value The enum value. + * @return {string} The enum as a string. + */ +var glEnumToString = function(gl, value) { + // Optimization for the most common enum: + if (value === gl.NO_ERROR) { + return "NO_ERROR"; + } + for (var p in gl) { + if (gl[p] == value) { + if (p == 'drawingBufferWidth' || p == 'drawingBufferHeight') { + continue; + } + return p; + } + } + return "0x" + Number(value).toString(16); +}; + +var lastError = ""; + +/** + * Returns the last compiler/linker error. + * @return {string} The last compiler/linker error. + */ +var getLastError = function() { + return lastError; +}; + +/** + * Whether a haystack ends with a needle. + * @param {string} haystack String to search + * @param {string} needle String to search for. + * @param {boolean} True if haystack ends with needle. + */ +var endsWith = function(haystack, needle) { + return haystack.substr(haystack.length - needle.length) === needle; +}; + +/** + * Whether a haystack starts with a needle. + * @param {string} haystack String to search + * @param {string} needle String to search for. + * @param {boolean} True if haystack starts with needle. + */ +var startsWith = function(haystack, needle) { + return haystack.substr(0, needle.length) === needle; +}; + +/** + * A vertex shader for a single texture. + * @type {string} + */ +var simpleTextureVertexShader = [ + 'attribute vec4 vPosition;', + 'attribute vec2 texCoord0;', + 'varying vec2 texCoord;', + 'void main() {', + ' gl_Position = vPosition;', + ' texCoord = texCoord0;', + '}'].join('\n'); + +/** + * A fragment shader for a single texture. + * @type {string} + */ +var simpleTextureFragmentShader = [ + 'precision mediump float;', + 'uniform sampler2D tex;', + 'varying vec2 texCoord;', + 'void main() {', + ' gl_FragData[0] = texture2D(tex, texCoord);', + '}'].join('\n'); + +/** + * A fragment shader for a single cube map texture. + * @type {string} + */ +var simpleCubeMapTextureFragmentShader = [ + 'precision mediump float;', + 'uniform samplerCube tex;', + 'uniform int face;', + 'varying vec2 texCoord;', + 'void main() {', + // Transform [0, 1] -> [-1, 1] + ' vec2 texC2 = (texCoord * 2.) - 1.;', + // Transform 2d tex coord. to each face of TEXTURE_CUBE_MAP coord. + ' vec3 texCube = vec3(0., 0., 0.);', + ' if (face == 34069) {', // TEXTURE_CUBE_MAP_POSITIVE_X + ' texCube = vec3(1., -texC2.y, -texC2.x);', + ' } else if (face == 34070) {', // TEXTURE_CUBE_MAP_NEGATIVE_X + ' texCube = vec3(-1., -texC2.y, texC2.x);', + ' } else if (face == 34071) {', // TEXTURE_CUBE_MAP_POSITIVE_Y + ' texCube = vec3(texC2.x, 1., texC2.y);', + ' } else if (face == 34072) {', // TEXTURE_CUBE_MAP_NEGATIVE_Y + ' texCube = vec3(texC2.x, -1., -texC2.y);', + ' } else if (face == 34073) {', // TEXTURE_CUBE_MAP_POSITIVE_Z + ' texCube = vec3(texC2.x, -texC2.y, 1.);', + ' } else if (face == 34074) {', // TEXTURE_CUBE_MAP_NEGATIVE_Z + ' texCube = vec3(-texC2.x, -texC2.y, -1.);', + ' }', + ' gl_FragData[0] = textureCube(tex, texCube);', + '}'].join('\n'); + +/** + * A vertex shader for a single texture. + * @type {string} + */ +var noTexCoordTextureVertexShader = [ + 'attribute vec4 vPosition;', + 'varying vec2 texCoord;', + 'void main() {', + ' gl_Position = vPosition;', + ' texCoord = vPosition.xy * 0.5 + 0.5;', + '}'].join('\n'); + +/** + * A vertex shader for a uniform color. + * @type {string} + */ +var simpleVertexShader = [ + 'attribute vec4 vPosition;', + 'void main() {', + ' gl_Position = vPosition;', + '}'].join('\n'); + +/** + * A fragment shader for a uniform color. + * @type {string} + */ +var simpleColorFragmentShader = [ + 'precision mediump float;', + 'uniform vec4 u_color;', + 'void main() {', + ' gl_FragData[0] = u_color;', + '}'].join('\n'); + +/** + * A vertex shader for vertex colors. + * @type {string} + */ +var simpleVertexColorVertexShader = [ + 'attribute vec4 vPosition;', + 'attribute vec4 a_color;', + 'varying vec4 v_color;', + 'void main() {', + ' gl_Position = vPosition;', + ' v_color = a_color;', + '}'].join('\n'); + +/** + * A fragment shader for vertex colors. + * @type {string} + */ +var simpleVertexColorFragmentShader = [ + 'precision mediump float;', + 'varying vec4 v_color;', + 'void main() {', + ' gl_FragData[0] = v_color;', + '}'].join('\n'); + +/** + * Creates a program, attaches shaders, binds attrib locations, links the + * program and calls useProgram. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} shaders The shaders to + * attach, or the source, or the id of a script to get + * the source from. + * @param {!Array.} opt_attribs The attribs names. + * @param {!Array.} opt_locations The locations for the attribs. + * @param {boolean} opt_logShaders Whether to log shader source. + */ +var setupProgram = function( + gl, shaders, opt_attribs, opt_locations, opt_logShaders) { + var realShaders = []; + var program = gl.createProgram(); + var shaderCount = 0; + for (var ii = 0; ii < shaders.length; ++ii) { + var shader = shaders[ii]; + var shaderType = undefined; + if (typeof shader == 'string') { + var element = document.getElementById(shader); + if (element) { + if (element.type != "x-shader/x-vertex" && element.type != "x-shader/x-fragment") + shaderType = ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER; + shader = loadShaderFromScript(gl, shader, shaderType, undefined, opt_logShaders); + } else if (endsWith(shader, ".vert")) { + shader = loadShaderFromFile(gl, shader, gl.VERTEX_SHADER, undefined, opt_logShaders); + } else if (endsWith(shader, ".frag")) { + shader = loadShaderFromFile(gl, shader, gl.FRAGMENT_SHADER, undefined, opt_logShaders); + } else { + shader = loadShader(gl, shader, ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER, undefined, opt_logShaders); + } + } else if (opt_logShaders) { + throw 'Shader source logging requested but no shader source provided'; + } + if (shader) { + ++shaderCount; + gl.attachShader(program, shader); + } + } + if (shaderCount != 2) { + error("Error in compiling shader"); + return null; + } + if (opt_attribs) { + for (var ii = 0; ii < opt_attribs.length; ++ii) { + gl.bindAttribLocation( + program, + opt_locations ? opt_locations[ii] : ii, + opt_attribs[ii]); + } + } + gl.linkProgram(program); + + // Check the link status + var linked = gl.getProgramParameter(program, gl.LINK_STATUS); + if (!linked) { + // something went wrong with the link + lastError = gl.getProgramInfoLog (program); + error("Error in program linking:" + lastError); + + gl.deleteProgram(program); + return null; + } + + gl.useProgram(program); + return program; +}; + +/** + * Creates a program, attaches shader, sets up trasnform feedback varyings, + * binds attrib locations, links the program and calls useProgram. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} shaders The shaders to + * attach, or the source, or the id of a script to get + * the source from. + * @param {!Array.} varyings The transform feedback varying names. + * @param {number} bufferMode The mode used to capture the varying variables. + * @param {!Array.} opt_attribs The attribs names. + * @param {!Array.} opt_locations The locations for the attribs. + * @param {boolean} opt_logShaders Whether to log shader source. + */ +var setupTransformFeedbackProgram = function( + gl, shaders, varyings, bufferMode, opt_attribs, opt_locations, opt_logShaders) { + var realShaders = []; + var program = gl.createProgram(); + var shaderCount = 0; + for (var ii = 0; ii < shaders.length; ++ii) { + var shader = shaders[ii]; + var shaderType = undefined; + if (typeof shader == 'string') { + var element = document.getElementById(shader); + if (element) { + if (element.type != "x-shader/x-vertex" && element.type != "x-shader/x-fragment") + shaderType = ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER; + shader = loadShaderFromScript(gl, shader, shaderType, undefined, opt_logShaders); + } else if (endsWith(shader, ".vert")) { + shader = loadShaderFromFile(gl, shader, gl.VERTEX_SHADER, undefined, opt_logShaders); + } else if (endsWith(shader, ".frag")) { + shader = loadShaderFromFile(gl, shader, gl.FRAGMENT_SHADER, undefined, opt_logShaders); + } else { + shader = loadShader(gl, shader, ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER, undefined, opt_logShaders); + } + } else if (opt_logShaders) { + throw 'Shader source logging requested but no shader source provided'; + } + if (shader) { + ++shaderCount; + gl.attachShader(program, shader); + } + } + if (shaderCount != 2) { + error("Error in compiling shader"); + return null; + } + + if (opt_attribs) { + for (var ii = 0; ii < opt_attribs.length; ++ii) { + gl.bindAttribLocation( + program, + opt_locations ? opt_locations[ii] : ii, + opt_attribs[ii]); + } + } + + gl.transformFeedbackVaryings(program, varyings, bufferMode); + + gl.linkProgram(program); + + // Check the link status + var linked = gl.getProgramParameter(program, gl.LINK_STATUS); + if (!linked) { + // something went wrong with the link + lastError = gl.getProgramInfoLog (program); + error("Error in program linking:" + lastError); + + gl.deleteProgram(program); + return null; + } + + gl.useProgram(program); + return program; +}; + +/** + * Creates a simple texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @return {WebGLProgram} + */ +var setupNoTexCoordTextureProgram = function(gl) { + return setupProgram(gl, + [noTexCoordTextureVertexShader, simpleTextureFragmentShader], + ['vPosition'], + [0]); +}; + +/** + * Creates a simple texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ +var setupSimpleTextureProgram = function( + gl, opt_positionLocation, opt_texcoordLocation) { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + return setupProgram(gl, + [simpleTextureVertexShader, simpleTextureFragmentShader], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); +}; + +/** + * Creates a simple cube map texture program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {WebGLProgram} + */ +var setupSimpleCubeMapTextureProgram = function( + gl, opt_positionLocation, opt_texcoordLocation) { + opt_positionLocation = opt_positionLocation || 0; + opt_texcoordLocation = opt_texcoordLocation || 1; + return setupProgram(gl, + [simpleTextureVertexShader, simpleCubeMapTextureFragmentShader], + ['vPosition', 'texCoord0'], + [opt_positionLocation, opt_texcoordLocation]); +}; + +/** + * Creates a simple vertex color program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_vertexColorLocation The attrib location + * for vertex colors. + * @return {WebGLProgram} + */ +var setupSimpleVertexColorProgram = function( + gl, opt_positionLocation, opt_vertexColorLocation) { + opt_positionLocation = opt_positionLocation || 0; + opt_vertexColorLocation = opt_vertexColorLocation || 1; + return setupProgram(gl, + [simpleVertexColorVertexShader, simpleVertexColorFragmentShader], + ['vPosition', 'a_color'], + [opt_positionLocation, opt_vertexColorLocation]); +}; + +/** + * Creates a simple color program. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @return {WebGLProgram} + */ +var setupSimpleColorProgram = function(gl, opt_positionLocation) { + opt_positionLocation = opt_positionLocation || 0; + return setupProgram(gl, + [simpleVertexShader, simpleColorFragmentShader], + ['vPosition'], + [opt_positionLocation]); +}; + +/** + * Creates buffers for a textured unit quad and attaches them to vertex attribs. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {!Array.} The buffer objects that were + * created. + */ +var setupUnitQuad = function(gl, opt_positionLocation, opt_texcoordLocation) { + return setupUnitQuadWithTexCoords(gl, [ 0.0, 0.0 ], [ 1.0, 1.0 ], + opt_positionLocation, opt_texcoordLocation); +}; + +/** + * Creates buffers for a textured unit quad with specified lower left + * and upper right texture coordinates, and attaches them to vertex + * attribs. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} lowerLeftTexCoords The texture coordinates for the lower left corner. + * @param {!Array.} upperRightTexCoords The texture coordinates for the upper right corner. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {!Array.} The buffer objects that were + * created. + */ +var setupUnitQuadWithTexCoords = function( + gl, lowerLeftTexCoords, upperRightTexCoords, + opt_positionLocation, opt_texcoordLocation) { + return setupQuad(gl, { + positionLocation: opt_positionLocation || 0, + texcoordLocation: opt_texcoordLocation || 1, + lowerLeftTexCoords: lowerLeftTexCoords, + upperRightTexCoords: upperRightTexCoords + }); +}; + +/** + * Makes a quad with various options. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Object} options + * + * scale: scale to multiple unit quad values by. default 1.0. + * positionLocation: attribute location for position. + * texcoordLocation: attribute location for texcoords. + * If this does not exist no texture coords are created. + * lowerLeftTexCoords: an array of 2 values for the + * lowerLeftTexCoords. + * upperRightTexCoords: an array of 2 values for the + * upperRightTexCoords. + */ +var setupQuad = function(gl, options) { + var positionLocation = options.positionLocation || 0; + var scale = options.scale || 1; + + var objects = []; + + var vertexObject = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ + 1.0 * scale , 1.0 * scale, + -1.0 * scale , 1.0 * scale, + -1.0 * scale , -1.0 * scale, + 1.0 * scale , 1.0 * scale, + -1.0 * scale , -1.0 * scale, + 1.0 * scale , -1.0 * scale]), gl.STATIC_DRAW); + gl.enableVertexAttribArray(positionLocation); + gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0); + objects.push(vertexObject); + + if (options.texcoordLocation !== undefined) { + var llx = options.lowerLeftTexCoords[0]; + var lly = options.lowerLeftTexCoords[1]; + var urx = options.upperRightTexCoords[0]; + var ury = options.upperRightTexCoords[1]; + + vertexObject = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ + urx, ury, + llx, ury, + llx, lly, + urx, ury, + llx, lly, + urx, lly]), gl.STATIC_DRAW); + gl.enableVertexAttribArray(options.texcoordLocation); + gl.vertexAttribPointer(options.texcoordLocation, 2, gl.FLOAT, false, 0, 0); + objects.push(vertexObject); + } + + return objects; +}; + +/** + * Creates a program and buffers for rendering a textured quad. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for + * position. Default = 0. + * @param {number} opt_texcoordLocation The attrib location for + * texture coords. Default = 1. + * @return {!WebGLProgram} + */ +var setupTexturedQuad = function( + gl, opt_positionLocation, opt_texcoordLocation) { + var program = setupSimpleTextureProgram( + gl, opt_positionLocation, opt_texcoordLocation); + setupUnitQuad(gl, opt_positionLocation, opt_texcoordLocation); + return program; +}; + +/** + * Creates a program and buffers for rendering a color quad. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for position. + * @return {!WebGLProgram} + */ +var setupColorQuad = function(gl, opt_positionLocation) { + opt_positionLocation = opt_positionLocation || 0; + var program = setupSimpleColorProgram(gl); + setupUnitQuad(gl, opt_positionLocation); + return program; +}; + +/** + * Creates a program and buffers for rendering a textured quad with + * specified lower left and upper right texture coordinates. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} lowerLeftTexCoords The texture coordinates for the lower left corner. + * @param {!Array.} upperRightTexCoords The texture coordinates for the upper right corner. + * @param {number} opt_positionLocation The attrib location for position. + * @param {number} opt_texcoordLocation The attrib location for texture coords. + * @return {!WebGLProgram} + */ +var setupTexturedQuadWithTexCoords = function( + gl, lowerLeftTexCoords, upperRightTexCoords, + opt_positionLocation, opt_texcoordLocation) { + var program = setupSimpleTextureProgram( + gl, opt_positionLocation, opt_texcoordLocation); + setupUnitQuadWithTexCoords(gl, lowerLeftTexCoords, upperRightTexCoords, + opt_positionLocation, opt_texcoordLocation); + return program; +}; + +/** + * Creates a program and buffers for rendering a textured quad with + * a cube map texture. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} opt_positionLocation The attrib location for + * position. Default = 0. + * @param {number} opt_texcoordLocation The attrib location for + * texture coords. Default = 1. + * @return {!WebGLProgram} + */ +var setupTexturedQuadWithCubeMap = function( + gl, opt_positionLocation, opt_texcoordLocation) { + var program = setupSimpleCubeMapTextureProgram( + gl, opt_positionLocation, opt_texcoordLocation); + setupUnitQuad(gl, opt_positionLocation, opt_texcoordLocation); + return program; +}; + +/** + * Creates a unit quad with only positions of a given resolution. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} gridRes The resolution of the mesh grid, + * expressed in the number of quads across and down. + * @param {number} opt_positionLocation The attrib location for position. + */ +var setupIndexedQuad = function ( + gl, gridRes, opt_positionLocation, opt_flipOddTriangles) { + return setupIndexedQuadWithOptions(gl, + { gridRes: gridRes, + positionLocation: opt_positionLocation, + flipOddTriangles: opt_flipOddTriangles + }); +}; + +/** + * Creates a quad with various options. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Object} options The options. See below. + * @return {!Array.} The created buffers. + * [positions, , indices] + * + * Options: + * gridRes: number of quads across and down grid. + * positionLocation: attrib location for position + * flipOddTriangles: reverse order of vertices of every other + * triangle + * positionOffset: offset added to each vertex + * positionMult: multipier for each vertex + * colorLocation: attrib location for vertex colors. If + * undefined no vertex colors will be created. + */ +var setupIndexedQuadWithOptions = function (gl, options) { + var positionLocation = options.positionLocation || 0; + var objects = []; + + var gridRes = options.gridRes || 1; + var positionOffset = options.positionOffset || 0; + var positionMult = options.positionMult || 1; + var vertsAcross = gridRes + 1; + var numVerts = vertsAcross * vertsAcross; + var positions = new Float32Array(numVerts * 3); + var indices = new Uint16Array(6 * gridRes * gridRes); + var poffset = 0; + + for (var yy = 0; yy <= gridRes; ++yy) { + for (var xx = 0; xx <= gridRes; ++xx) { + positions[poffset + 0] = (-1 + 2 * xx / gridRes) * positionMult + positionOffset; + positions[poffset + 1] = (-1 + 2 * yy / gridRes) * positionMult + positionOffset; + positions[poffset + 2] = 0; + + poffset += 3; + } + } + + var buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW); + gl.enableVertexAttribArray(positionLocation); + gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0); + objects.push(buf); + + if (options.colorLocation !== undefined) { + var colors = new Float32Array(numVerts * 4); + for (var yy = 0; yy <= gridRes; ++yy) { + for (var xx = 0; xx <= gridRes; ++xx) { + if (options.color !== undefined) { + colors[poffset + 0] = options.color[0]; + colors[poffset + 1] = options.color[1]; + colors[poffset + 2] = options.color[2]; + colors[poffset + 3] = options.color[3]; + } else { + colors[poffset + 0] = xx / gridRes; + colors[poffset + 1] = yy / gridRes; + colors[poffset + 2] = (xx / gridRes) * (yy / gridRes); + colors[poffset + 3] = (yy % 2) * 0.5 + 0.5; + } + poffset += 4; + } + } + + buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); + gl.enableVertexAttribArray(options.colorLocation); + gl.vertexAttribPointer(options.colorLocation, 4, gl.FLOAT, false, 0, 0); + objects.push(buf); + } + + var tbase = 0; + for (var yy = 0; yy < gridRes; ++yy) { + var index = yy * vertsAcross; + for (var xx = 0; xx < gridRes; ++xx) { + indices[tbase + 0] = index + 0; + indices[tbase + 1] = index + 1; + indices[tbase + 2] = index + vertsAcross; + indices[tbase + 3] = index + vertsAcross; + indices[tbase + 4] = index + 1; + indices[tbase + 5] = index + vertsAcross + 1; + + if (options.flipOddTriangles) { + indices[tbase + 4] = index + vertsAcross + 1; + indices[tbase + 5] = index + 1; + } + + index += 1; + tbase += 6; + } + } + + buf = gl.createBuffer(); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW); + objects.push(buf); + + return objects; +}; + +/** + * Returns the constructor for a typed array that corresponds to the given + * WebGL type. + * @param {!WebGLRenderingContext} gl A WebGLRenderingContext. + * @param {number} type The WebGL type (eg, gl.UNSIGNED_BYTE) + * @return {!Constructor} The typed array constructor that + * corresponds to the given type. + */ +var glTypeToTypedArrayType = function(gl, type) { + switch (type) { + case gl.BYTE: + return window.Int8Array; + case gl.UNSIGNED_BYTE: + return window.Uint8Array; + case gl.SHORT: + return window.Int16Array; + case gl.UNSIGNED_SHORT: + case gl.UNSIGNED_SHORT_5_6_5: + case gl.UNSIGNED_SHORT_4_4_4_4: + case gl.UNSIGNED_SHORT_5_5_5_1: + return window.Uint16Array; + case gl.INT: + return window.Int32Array; + case gl.UNSIGNED_INT: + return window.Uint32Array; + default: + throw 'unknown gl type ' + glEnumToString(gl, type); + } +}; + +/** + * Returns the number of bytes per component for a given WebGL type. + * @param {!WebGLRenderingContext} gl A WebGLRenderingContext. + * @param {GLenum} type The WebGL type (eg, gl.UNSIGNED_BYTE) + * @return {number} The number of bytes per component. + */ +var getBytesPerComponent = function(gl, type) { + switch (type) { + case gl.BYTE: + case gl.UNSIGNED_BYTE: + return 1; + case gl.SHORT: + case gl.UNSIGNED_SHORT: + case gl.UNSIGNED_SHORT_5_6_5: + case gl.UNSIGNED_SHORT_4_4_4_4: + case gl.UNSIGNED_SHORT_5_5_5_1: + return 2; + case gl.INT: + case gl.UNSIGNED_INT: + return 4; + default: + throw 'unknown gl type ' + glEnumToString(gl, type); + } +}; + +/** + * Returns the number of typed array elements per pixel for a given WebGL + * format/type combination. The corresponding typed array type can be determined + * by calling glTypeToTypedArrayType. + * @param {!WebGLRenderingContext} gl A WebGLRenderingContext. + * @param {GLenum} format The WebGL format (eg, gl.RGBA) + * @param {GLenum} type The WebGL type (eg, gl.UNSIGNED_BYTE) + * @return {number} The number of typed array elements per pixel. + */ +var getTypedArrayElementsPerPixel = function(gl, format, type) { + switch (type) { + case gl.UNSIGNED_SHORT_5_6_5: + case gl.UNSIGNED_SHORT_4_4_4_4: + case gl.UNSIGNED_SHORT_5_5_5_1: + return 1; + case gl.UNSIGNED_BYTE: + break; + default: + throw 'not a gl type for color information ' + glEnumToString(gl, type); + } + + switch (format) { + case gl.RGBA: + return 4; + case gl.RGB: + return 3; + case gl.LUMINANCE_ALPHA: + return 2; + case gl.LUMINANCE: + case gl.ALPHA: + return 1; + default: + throw 'unknown gl format ' + glEnumToString(gl, format); + } +}; + +/** + * Fills the given texture with a solid color. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!WebGLTexture} tex The texture to fill. + * @param {number} width The width of the texture to create. + * @param {number} height The height of the texture to create. + * @param {!Array.} color The color to fill with. + * where each element is in the range 0 to 255. + * @param {number} opt_level The level of the texture to fill. Default = 0. + * @param {number} opt_format The format for the texture. + * @param {number} opt_internalFormat The internal format for the texture. + */ +var fillTexture = function(gl, tex, width, height, color, opt_level, opt_format, opt_type, opt_internalFormat) { + opt_level = opt_level || 0; + opt_format = opt_format || gl.RGBA; + opt_type = opt_type || gl.UNSIGNED_BYTE; + opt_internalFormat = opt_internalFormat || opt_format; + var pack = gl.getParameter(gl.UNPACK_ALIGNMENT); + var numComponents = color.length; + var bytesPerComponent = getBytesPerComponent(gl, opt_type); + var rowSize = numComponents * width * bytesPerComponent; + var paddedRowSize = Math.floor((rowSize + pack - 1) / pack) * pack; + var size = rowSize + (height - 1) * paddedRowSize; + size = Math.floor((size + bytesPerComponent - 1) / bytesPerComponent) * bytesPerComponent; + var buf = new (glTypeToTypedArrayType(gl, opt_type))(size); + for (var yy = 0; yy < height; ++yy) { + var off = yy * paddedRowSize; + for (var xx = 0; xx < width; ++xx) { + for (var jj = 0; jj < numComponents; ++jj) { + buf[off++] = color[jj]; + } + } + } + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.texImage2D( + gl.TEXTURE_2D, opt_level, opt_internalFormat, width, height, 0, + opt_format, opt_type, buf); +}; + +/** + * Creates a texture and fills it with a solid color. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} width The width of the texture to create. + * @param {number} height The height of the texture to create. + * @param {!Array.} color The color to fill with. A 4 element array + * where each element is in the range 0 to 255. + * @return {!WebGLTexture} + */ +var createColoredTexture = function(gl, width, height, color) { + var tex = gl.createTexture(); + fillTexture(gl, tex, width, height, color); + return tex; +}; + +var ubyteToFloat = function(c) { + return c / 255; +}; + +var ubyteColorToFloatColor = function(color) { + var floatColor = []; + for (var ii = 0; ii < color.length; ++ii) { + floatColor[ii] = ubyteToFloat(color[ii]); + } + return floatColor; +}; + +/** + * Sets the "u_color" uniform of the current program to color. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} color 4 element array of 0-1 color + * components. + */ +var setFloatDrawColor = function(gl, color) { + var program = gl.getParameter(gl.CURRENT_PROGRAM); + var colorLocation = gl.getUniformLocation(program, "u_color"); + gl.uniform4fv(colorLocation, color); +}; + +/** + * Sets the "u_color" uniform of the current program to color. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} color 4 element array of 0-255 color + * components. + */ +var setUByteDrawColor = function(gl, color) { + setFloatDrawColor(gl, ubyteColorToFloatColor(color)); +}; + +/** + * Draws a previously setup quad in the given color. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} color The color to draw with. A 4 + * element array where each element is in the range 0 to + * 1. + */ +var drawFloatColorQuad = function(gl, color) { + var program = gl.getParameter(gl.CURRENT_PROGRAM); + var colorLocation = gl.getUniformLocation(program, "u_color"); + gl.uniform4fv(colorLocation, color); + gl.drawArrays(gl.TRIANGLES, 0, 6); +}; + + +/** + * Draws a previously setup quad in the given color. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} color The color to draw with. A 4 + * element array where each element is in the range 0 to + * 255. + */ +var drawUByteColorQuad = function(gl, color) { + drawFloatColorQuad(gl, ubyteColorToFloatColor(color)); +}; + +/** + * Draws a previously setupUnitQuad. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + */ +var drawUnitQuad = function(gl) { + gl.drawArrays(gl.TRIANGLES, 0, 6); +}; + +/** + * Clears then Draws a previously setupUnitQuad. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!Array.} opt_color The color to fill clear with before + * drawing. A 4 element array where each element is in the range 0 to + * 255. Default [255, 255, 255, 255] + */ +var clearAndDrawUnitQuad = function(gl, opt_color) { + opt_color = opt_color || [255, 255, 255, 255]; + gl.clearColor( + opt_color[0] / 255, + opt_color[1] / 255, + opt_color[2] / 255, + opt_color[3] / 255); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + drawUnitQuad(gl); +}; + +/** + * Draws a quad previously setup with setupIndexedQuad. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} gridRes Resolution of grid. + */ +var drawIndexedQuad = function(gl, gridRes) { + gl.drawElements(gl.TRIANGLES, gridRes * gridRes * 6, gl.UNSIGNED_SHORT, 0); +}; + +/** + * Draws a previously setupIndexedQuad + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number} gridRes Resolution of grid. + * @param {!Array.} opt_color The color to fill clear with before + * drawing. A 4 element array where each element is in the range 0 to + * 255. Default [255, 255, 255, 255] + */ +var clearAndDrawIndexedQuad = function(gl, gridRes, opt_color) { + opt_color = opt_color || [255, 255, 255, 255]; + gl.clearColor( + opt_color[0] / 255, + opt_color[1] / 255, + opt_color[2] / 255, + opt_color[3] / 255); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + drawIndexedQuad(gl, gridRes); +}; + +/** + * Clips a range to min, max + * (Eg. clipToRange(-5,7,0,20) would return {value:0,extent:2} + * @param {number} value start of range + * @param {number} extent extent of range + * @param {number} min min. + * @param {number} max max. + * @return {!{value:number,extent:number}} The clipped value. + */ +var clipToRange = function(value, extent, min, max) { + if (value < min) { + extent -= min - value; + value = min; + } + var end = value + extent; + if (end > max) { + extent -= end - max; + } + if (extent < 0) { + value = max; + extent = 0; + } + return {value:value, extent: extent}; +}; + +/** + * Determines if the passed context is an instance of a WebGLRenderingContext + * or later variant (like WebGL2RenderingContext) + * @param {CanvasRenderingContext} ctx The context to check. + */ +var isWebGLContext = function(ctx) { + if (ctx instanceof WebGLRenderingContext) + return true; + + if ('WebGL2RenderingContext' in window && ctx instanceof WebGL2RenderingContext) + return true; + + return false; +}; + +/** + * Creates a check rect is used by checkCanvasRects. + * @param {number} x left corner of region to check. + * @param {number} y bottom corner of region to check in case of checking from + * a GL context or top corner in case of checking from a 2D context. + * @param {number} width width of region to check. + * @param {number} height width of region to check. + * @param {!Array.} color The color expected. A 4 element array where + * each element is in the range 0 to 255. + * @param {string} opt_msg Message to associate with success. Eg + * ("should be red"). + * @param {number} opt_errorRange Optional. Acceptable error in + * color checking. 0 by default. + */ +var makeCheckRect = function(x, y, width, height, color, msg, errorRange) { + var rect = { + 'x': x, 'y': y, + 'width': width, 'height': height, + 'color': color, 'msg': msg, + 'errorRange': errorRange, + + 'checkRect': function (buf, l, b, w) { + for (var px = (x - l) ; px < (x + width - l) ; ++px) { + for (var py = (y - b) ; py < (y + height - b) ; ++py) { + var offset = (py * w + px) * 4; + for (var j = 0; j < color.length; ++j) { + if (Math.abs(buf[offset + j] - color[j]) > errorRange) { + testFailed(msg); + var was = buf[offset + 0].toString(); + for (j = 1; j < color.length; ++j) { + was += "," + buf[offset + j]; + } + debug('at (' + px + ', ' + py + + ') expected: ' + color + ' was ' + was); + return; + } + } + } + } + testPassed(msg); + } + } + return rect; +}; + +/** + * Checks that a portions of a canvas or the currently attached framebuffer is 1 color. + * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The + * WebGLRenderingContext or 2D context to use. + * @param {!Array.} array of rects to check for matching color. + */ +var checkCanvasRects = function(gl, rects) { + if (rects.length > 0) { + var left = rects[0].x; + var right = rects[0].x + rects[1].width; + var bottom = rects[0].y; + var top = rects[0].y + rects[0].height; + for (var i = 1; i < rects.length; ++i) { + left = Math.min(left, rects[i].x); + right = Math.max(right, rects[i].x + rects[i].width); + bottom = Math.min(bottom, rects[i].y); + top = Math.max(top, rects[i].y + rects[i].height); + } + var width = right - left; + var height = top - bottom; + var buf = new Uint8Array(width * height * 4); + gl.readPixels(left, bottom, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf); + for (var i = 0; i < rects.length; ++i) { + rects[i].checkRect(buf, left, bottom, width); + } + } +}; + +/** + * Checks that a portion of a canvas or the currently attached framebuffer is 1 color. + * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The + * WebGLRenderingContext or 2D context to use. + * @param {number} x left corner of region to check. + * @param {number} y bottom corner of region to check in case of checking from + * a GL context or top corner in case of checking from a 2D context. + * @param {number} width width of region to check. + * @param {number} height width of region to check. + * @param {!Array.} color The color expected. A 4 element array where + * each element is in the range 0 to 255. + * @param {number} opt_errorRange Optional. Acceptable error in + * color checking. 0 by default. + * @param {!function()} sameFn Function to call if all pixels + * are the same as color. + * @param {!function()} differentFn Function to call if a pixel + * is different than color + * @param {!function()} logFn Function to call for logging. + * @param {Uint8Array} opt_readBackBuf typically passed to reuse existing + * buffer while reading back pixels. + */ +var checkCanvasRectColor = function(gl, x, y, width, height, color, opt_errorRange, sameFn, differentFn, logFn, opt_readBackBuf) { + if (isWebGLContext(gl) && !gl.getParameter(gl.FRAMEBUFFER_BINDING)) { + // We're reading the backbuffer so clip. + var xr = clipToRange(x, width, 0, gl.canvas.width); + var yr = clipToRange(y, height, 0, gl.canvas.height); + if (!xr.extent || !yr.extent) { + logFn("checking rect: effective width or height is zero"); + sameFn(); + return; + } + x = xr.value; + y = yr.value; + width = xr.extent; + height = yr.extent; + } + var errorRange = opt_errorRange || 0; + if (!errorRange.length) { + errorRange = [errorRange, errorRange, errorRange, errorRange] + } + var buf; + if (isWebGLContext(gl)) { + buf = opt_readBackBuf ? opt_readBackBuf : new Uint8Array(width * height * 4); + gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf); + } else { + buf = gl.getImageData(x, y, width, height).data; + } + for (var i = 0; i < width * height; ++i) { + var offset = i * 4; + for (var j = 0; j < color.length; ++j) { + if (Math.abs(buf[offset + j] - color[j]) > errorRange[j]) { + var was = buf[offset + 0].toString(); + for (j = 1; j < color.length; ++j) { + was += "," + buf[offset + j]; + } + differentFn('at (' + (x + (i % width)) + ', ' + (y + Math.floor(i / width)) + + ') expected: ' + color + ' was ' + was); + return; + } + } + } + sameFn(); +}; + +/** + * Checks that a portion of a canvas or the currently attached framebuffer is 1 color. + * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The + * WebGLRenderingContext or 2D context to use. + * @param {number} x left corner of region to check. + * @param {number} y bottom corner of region to check in case of checking from + * a GL context or top corner in case of checking from a 2D context. + * @param {number} width width of region to check. + * @param {number} height width of region to check. + * @param {!Array.} color The color expected. A 4 element array where + * each element is in the range 0 to 255. + * @param {string} opt_msg Message to associate with success or failure. Eg + * ("should be red"). + * @param {number} opt_errorRange Optional. Acceptable error in + * color checking. 0 by default. + */ +var checkCanvasRect = function(gl, x, y, width, height, color, opt_msg, opt_errorRange) { + checkCanvasRectColor( + gl, x, y, width, height, color, opt_errorRange, + function() { + var msg = opt_msg; + if (msg === undefined) + msg = "should be " + color.toString(); + testPassed(msg); + }, + function(differentMsg) { + var msg = opt_msg; + if (msg === undefined) + msg = "should be " + color.toString(); + testFailed(msg + "\n" + differentMsg); + }, + debug); +}; + +/** + * Checks that an entire canvas or the currently attached framebuffer is 1 color. + * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The + * WebGLRenderingContext or 2D context to use. + * @param {!Array.} color The color expected. A 4 element array where + * each element is in the range 0 to 255. + * @param {string} msg Message to associate with success. Eg ("should be red"). + * @param {number} errorRange Optional. Acceptable error in + * color checking. 0 by default. + */ +var checkCanvas = function(gl, color, msg, errorRange) { + checkCanvasRect(gl, 0, 0, gl.canvas.width, gl.canvas.height, color, msg, errorRange); +}; + +/** + * Checks a rectangular area both inside the area and outside + * the area. + * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The + * WebGLRenderingContext or 2D context to use. + * @param {number} x left corner of region to check. + * @param {number} y bottom corner of region to check in case of checking from + * a GL context or top corner in case of checking from a 2D context. + * @param {number} width width of region to check. + * @param {number} height width of region to check. + * @param {!Array.} innerColor The color expected inside + * the area. A 4 element array where each element is in the + * range 0 to 255. + * @param {!Array.} outerColor The color expected + * outside. A 4 element array where each element is in the + * range 0 to 255. + * @param {!number} opt_edgeSize: The number of pixels to skip + * around the edges of the area. Defaut 0. + * @param {!{width:number, height:number}} opt_outerDimensions + * The outer dimensions. Default the size of gl.canvas. + */ +var checkAreaInAndOut = function(gl, x, y, width, height, innerColor, outerColor, opt_edgeSize, opt_outerDimensions) { + var outerDimensions = opt_outerDimensions || { width: gl.canvas.width, height: gl.canvas.height }; + var edgeSize = opt_edgeSize || 0; + checkCanvasRect(gl, x + edgeSize, y + edgeSize, width - edgeSize * 2, height - edgeSize * 2, innerColor); + checkCanvasRect(gl, 0, 0, x - edgeSize, outerDimensions.height, outerColor); + checkCanvasRect(gl, x + width + edgeSize, 0, outerDimensions.width - x - width - edgeSize, outerDimensions.height, outerColor); + checkCanvasRect(gl, 0, 0, outerDimensions.width, y - edgeSize, outerColor); + checkCanvasRect(gl, 0, y + height + edgeSize, outerDimensions.width, outerDimensions.height - y - height - edgeSize, outerColor); +}; + +/** + * Checks that an entire buffer matches the floating point values provided. + * (WebGL 2.0 only) + * @param {!WebGL2RenderingContext} gl The WebGL2RenderingContext to use. + * @param {number} target The buffer target to bind to. + * @param {!Array.} expected The values expected. + * @param {string} opt_msg Optional. Message to associate with success. Eg ("should be red"). + * @param {number} opt_errorRange Optional. Acceptable error in value checking. 0.001 by default. + */ +var checkFloatBuffer = function(gl, target, expected, opt_msg, opt_errorRange) { + if (opt_msg === undefined) + opt_msg = "buffer should match expected values"; + + if (opt_errorRange === undefined) + opt_errorRange = 0.001; + + var floatArray = new Float32Array(expected.length); + gl.getBufferSubData(target, 0, floatArray); + + for (var i = 0; i < expected.length; i++) { + if (Math.abs(floatArray[i] - expected[i]) > opt_errorRange) { + testFailed(opt_msg); + debug('at [' + i + '] expected: ' + expected[i] + ' was ' + floatArray[i]); + return; + } + } + testPassed(opt_msg); +}; + +/** + * Loads a texture, calls callback when finished. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} url URL of image to load + * @param {function(!Image): void} callback Function that gets called after + * image has loaded + * @return {!WebGLTexture} The created texture. + */ +var loadTexture = function(gl, url, callback) { + var texture = gl.createTexture(); + 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); + var image = new Image(); + image.onload = function() { + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); + callback(image); + }; + image.src = url; + return texture; +}; + +/** + * Checks whether the bound texture has expected dimensions. One corner pixel + * of the texture will be changed as a side effect. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!WebGLTexture} texture The texture to check. + * @param {number} width Expected width. + * @param {number} height Expected height. + * @param {GLenum} opt_format The texture's format. Defaults to RGBA. + * @param {GLenum} opt_type The texture's type. Defaults to UNSIGNED_BYTE. + */ +var checkTextureSize = function(gl, width, height, opt_format, opt_type) { + opt_format = opt_format || gl.RGBA; + opt_type = opt_type || gl.UNSIGNED_BYTE; + + var numElements = getTypedArrayElementsPerPixel(gl, opt_format, opt_type); + var buf = new (glTypeToTypedArrayType(gl, opt_type))(numElements); + + var errors = 0; + gl.texSubImage2D(gl.TEXTURE_2D, 0, width - 1, height - 1, 1, 1, opt_format, opt_type, buf); + if (gl.getError() != gl.NO_ERROR) { + testFailed("Texture was smaller than the expected size " + width + "x" + height); + ++errors; + } + gl.texSubImage2D(gl.TEXTURE_2D, 0, width - 1, height, 1, 1, opt_format, opt_type, buf); + if (gl.getError() == gl.NO_ERROR) { + testFailed("Texture was taller than " + height); + ++errors; + } + gl.texSubImage2D(gl.TEXTURE_2D, 0, width, height - 1, 1, 1, opt_format, opt_type, buf); + if (gl.getError() == gl.NO_ERROR) { + testFailed("Texture was wider than " + width); + ++errors; + } + if (errors == 0) { + testPassed("Texture had the expected size " + width + "x" + height); + } +}; + +/** + * Makes a shallow copy of an object. + * @param {!Object} src Object to copy + * @return {!Object} The copy of src. + */ +var shallowCopyObject = function(src) { + var dst = {}; + for (var attr in src) { + if (src.hasOwnProperty(attr)) { + dst[attr] = src[attr]; + } + } + return dst; +}; + +/** + * Checks if an attribute exists on an object case insensitive. + * @param {!Object} obj Object to check + * @param {string} attr Name of attribute to look for. + * @return {string?} The name of the attribute if it exists, + * undefined if not. + */ +var hasAttributeCaseInsensitive = function(obj, attr) { + var lower = attr.toLowerCase(); + for (var key in obj) { + if (obj.hasOwnProperty(key) && key.toLowerCase() == lower) { + return key; + } + } +}; + +/** + * Returns a map of URL querystring options + * @return {Object?} Object containing all the values in the URL querystring + */ +var getUrlOptions = (function() { + var _urlOptionsParsed = false; + var _urlOptions = {}; + return function() { + if (!_urlOptionsParsed) { + var s = window.location.href; + var q = s.indexOf("?"); + var e = s.indexOf("#"); + if (e < 0) { + e = s.length; + } + var query = s.substring(q + 1, e); + var pairs = query.split("&"); + for (var ii = 0; ii < pairs.length; ++ii) { + var keyValue = pairs[ii].split("="); + var key = keyValue[0]; + var value = decodeURIComponent(keyValue[1]); + _urlOptions[key] = value; + } + _urlOptionsParsed = true; + } + + return _urlOptions; + } +})(); + +var default3DContextVersion = 1; + +/** + * Set the default context version for create3DContext. + * Initially the default version is 1. + * @param {number} Default version of WebGL contexts. + */ +var setDefault3DContextVersion = function(version) { + default3DContextVersion = version; +}; + +/** + * Get the default contex version for create3DContext. + * First it looks at the URI option |webglVersion|. If it does not exist, + * then look at the global default3DContextVersion variable. + */ +var getDefault3DContextVersion = function() { + return parseInt(getUrlOptions().webglVersion, 10) || default3DContextVersion; +}; + +/** + * Creates a webgl context. + * @param {!Canvas|string} opt_canvas The canvas tag to get + * context from. If one is not passed in one will be + * created. If it's a string it's assumed to be the id of a + * canvas. + * @param {Object} opt_attributes Context attributes. + * @param {!number} opt_version Version of WebGL context to create. + * The default version can be set by calling setDefault3DContextVersion. + * @return {!WebGLRenderingContext} The created context. + */ +var create3DContext = function(opt_canvas, opt_attributes, opt_version) { + if (window.initTestingHarness) { + window.initTestingHarness(); + } + var attributes = shallowCopyObject(opt_attributes || {}); + if (!hasAttributeCaseInsensitive(attributes, "antialias")) { + attributes.antialias = false; + } + if (!opt_version) { + opt_version = parseInt(getUrlOptions().webglVersion, 10) || default3DContextVersion; + } + opt_canvas = opt_canvas || document.createElement("canvas"); + if (typeof opt_canvas == 'string') { + opt_canvas = document.getElementById(opt_canvas); + } + var context = null; + + var names; + switch (opt_version) { + case 2: + names = ["webgl2", "experimental-webgl2"]; break; + default: + names = ["webgl", "experimental-webgl"]; break; + } + + for (var i = 0; i < names.length; ++i) { + try { + context = opt_canvas.getContext(names[i], attributes); + } catch (e) { + } + if (context) { + break; + } + } + if (!context) { + testFailed("Unable to fetch WebGL rendering context for Canvas"); + } + return context; +}; + +/** + * Defines the exception type for a GL error. + * @constructor + * @param {string} message The error message. + * @param {number} error GL error code + */ +function GLErrorException (message, error) { + this.message = message; + this.name = "GLErrorException"; + this.error = error; +}; + +/** + * Wraps a WebGL function with a function that throws an exception if there is + * an error. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} fname Name of function to wrap. + * @return {function()} The wrapped function. + */ +var createGLErrorWrapper = function(context, fname) { + return function() { + var rv = context[fname].apply(context, arguments); + var err = context.getError(); + if (err != context.NO_ERROR) { + var msg = "GL error " + glEnumToString(context, err) + " in " + fname; + throw new GLErrorException(msg, err); + } + return rv; + }; +}; + +/** + * Creates a WebGL context where all functions are wrapped to throw an exception + * if there is an error. + * @param {!Canvas} canvas The HTML canvas to get a context from. + * @param {Object} opt_attributes Context attributes. + * @param {!number} opt_version Version of WebGL context to create + * @return {!Object} The wrapped context. + */ +function create3DContextWithWrapperThatThrowsOnGLError(canvas, opt_attributes, opt_version) { + var context = create3DContext(canvas, opt_attributes, opt_version); + var wrap = {}; + for (var i in context) { + try { + if (typeof context[i] == 'function') { + wrap[i] = createGLErrorWrapper(context, i); + } else { + wrap[i] = context[i]; + } + } catch (e) { + error("createContextWrapperThatThrowsOnGLError: Error accessing " + i); + } + } + wrap.getError = function() { + return context.getError(); + }; + return wrap; +}; + +/** + * Tests that an evaluated expression generates a specific GL error. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number|Array.} glErrors The expected gl error or an array of expected errors. + * @param {string} evalStr The string to evaluate. + */ +var shouldGenerateGLError = function(gl, glErrors, evalStr, opt_msg) { + var exception; + try { + eval(evalStr); + } catch (e) { + exception = e; + } + if (exception) { + testFailed(evalStr + " threw exception " + exception); + } else { + if (!opt_msg) { + opt_msg = "after evaluating: " + evalStr; + } + glErrorShouldBe(gl, glErrors, opt_msg); + } +}; + +/** + * Tests that an evaluated expression does not generate a GL error. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} evalStr The string to evaluate. + */ +var failIfGLError = function(gl, evalStr) { + var exception; + try { + eval(evalStr); + } catch (e) { + exception = e; + } + if (exception) { + testFailed(evalStr + " threw exception " + exception); + } else { + glErrorShouldBeImpl(gl, gl.NO_ERROR, false, "after evaluating: " + evalStr); + } +}; + +/** + * Tests that the first error GL returns is the specified error. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number|Array.} glErrors The expected gl error or an array of expected errors. + * @param {string} opt_msg Optional additional message. + */ +var glErrorShouldBe = function(gl, glErrors, opt_msg) { + glErrorShouldBeImpl(gl, glErrors, true, opt_msg); +}; + + + +/** + * Tests that the first error GL returns is the specified error. Allows suppression of successes. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {number|Array.} glErrors The expected gl error or an array of expected errors. + * @param {boolean} reportSuccesses Whether to report successes as passes, or to silently pass. + * @param {string} opt_msg Optional additional message. + */ +var glErrorShouldBeImpl = function(gl, glErrors, reportSuccesses, opt_msg) { + if (!glErrors.length) { + glErrors = [glErrors]; + } + opt_msg = opt_msg || ""; + var err = gl.getError(); + var ndx = glErrors.indexOf(err); + var errStrs = []; + for (var ii = 0; ii < glErrors.length; ++ii) { + errStrs.push(glEnumToString(gl, glErrors[ii])); + } + var expected = errStrs.join(" or "); + if (ndx < 0) { + var msg = "getError expected" + ((glErrors.length > 1) ? " one of: " : ": "); + testFailed(msg + expected + ". Was " + glEnumToString(gl, err) + " : " + opt_msg); + } else if (reportSuccesses) { + var msg = "getError was " + ((glErrors.length > 1) ? "one of: " : "expected value: "); + testPassed(msg + expected + " : " + opt_msg); + } +}; + +/** + * Links a WebGL program, throws if there are errors. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!WebGLProgram} program The WebGLProgram to link. + * @param {function(string): void} opt_errorCallback callback for errors. + */ +var linkProgram = function(gl, program, opt_errorCallback) { + var errFn = opt_errorCallback || testFailed; + // Link the program + gl.linkProgram(program); + + // Check the link status + var linked = gl.getProgramParameter(program, gl.LINK_STATUS); + if (!linked) { + // something went wrong with the link + var error = gl.getProgramInfoLog (program); + + errFn("Error in program linking:" + error); + + gl.deleteProgram(program); + } +}; + +/** + * Loads text from an external file. This function is asynchronous. + * @param {string} url The url of the external file. + * @param {!function(bool, string): void} callback that is sent a bool for + * success and the string. + */ +var loadTextFileAsync = function(url, callback) { + log ("loading: " + url); + var error = 'loadTextFileAsync failed to load url "' + url + '"'; + var request; + if (window.XMLHttpRequest) { + request = new XMLHttpRequest(); + if (request.overrideMimeType) { + request.overrideMimeType('text/plain'); + } + } else { + throw 'XMLHttpRequest is disabled'; + } + try { + request.open('GET', url, true); + request.onreadystatechange = function() { + if (request.readyState == 4) { + var text = ''; + // HTTP reports success with a 200 status. The file protocol reports + // success with zero. HTTP does not use zero as a status code (they + // start at 100). + // https://developer.mozilla.org/En/Using_XMLHttpRequest + var success = request.status == 200 || request.status == 0; + if (success) { + text = request.responseText; + log("completed load request: " + url); + } else { + log("loading " + url + " resulted in unexpected status: " + request.status + " " + request.statusText); + } + callback(success, text); + } + }; + request.onerror = function(errorEvent) { + log("error occurred loading " + url); + callback(false, ''); + }; + request.send(null); + } catch (err) { + log("failed to load: " + url + " with exception " + err.message); + callback(false, ''); + } +}; + +/** + * Recursively loads a file as a list. Each line is parsed for a relative + * path. If the file ends in .txt the contents of that file is inserted in + * the list. + * + * @param {string} url The url of the external file. + * @param {!function(bool, Array): void} callback that is sent a bool + * for success and the array of strings. + */ +var getFileListAsync = function(url, callback) { + var files = []; + + var getFileListImpl = function(url, callback) { + var files = []; + if (url.substr(url.length - 4) == '.txt') { + loadTextFileAsync(url, function() { + return function(success, text) { + if (!success) { + callback(false, ''); + return; + } + var lines = text.split('\n'); + var prefix = ''; + var lastSlash = url.lastIndexOf('/'); + if (lastSlash >= 0) { + prefix = url.substr(0, lastSlash + 1); + } + var fail = false; + var count = 1; + var index = 0; + for (var ii = 0; ii < lines.length; ++ii) { + var str = lines[ii].replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + if (str.length > 4 && + str[0] != '#' && + str[0] != ";" && + str.substr(0, 2) != "//") { + var names = str.split(/ +/); + var new_url = prefix + str; + if (names.length == 1) { + new_url = prefix + str; + ++count; + getFileListImpl(new_url, function(index) { + return function(success, new_files) { + log("got files: " + new_files.length); + if (success) { + files[index] = new_files; + } + finish(success); + }; + }(index++)); + } else { + var s = ""; + var p = ""; + for (var jj = 0; jj < names.length; ++jj) { + s += p + prefix + names[jj]; + p = " "; + } + files[index++] = s; + } + } + } + finish(true); + + function finish(success) { + if (!success) { + fail = true; + } + --count; + log("count: " + count); + if (!count) { + callback(!fail, files); + } + } + } + }()); + + } else { + files.push(url); + callback(true, files); + } + }; + + getFileListImpl(url, function(success, files) { + // flatten + var flat = []; + flatten(files); + function flatten(files) { + for (var ii = 0; ii < files.length; ++ii) { + var value = files[ii]; + if (typeof(value) == "string") { + flat.push(value); + } else { + flatten(value); + } + } + } + callback(success, flat); + }); +}; + +/** + * Gets a file from a file/URL. + * @param {string} file the URL of the file to get. + * @return {string} The contents of the file. + */ +var readFile = function(file) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", file, false); + xhr.send(); + return xhr.responseText.replace(/\r/g, ""); +}; + +var readFileList = function(url) { + var files = []; + if (url.substr(url.length - 4) == '.txt') { + var lines = readFile(url).split('\n'); + var prefix = ''; + var lastSlash = url.lastIndexOf('/'); + if (lastSlash >= 0) { + prefix = url.substr(0, lastSlash + 1); + } + for (var ii = 0; ii < lines.length; ++ii) { + var str = lines[ii].replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + if (str.length > 4 && + str[0] != '#' && + str[0] != ";" && + str.substr(0, 2) != "//") { + var names = str.split(/ +/); + if (names.length == 1) { + var new_url = prefix + str; + files = files.concat(readFileList(new_url)); + } else { + var s = ""; + var p = ""; + for (var jj = 0; jj < names.length; ++jj) { + s += p + prefix + names[jj]; + p = " "; + } + files.push(s); + } + } + } + } else { + files.push(url); + } + return files; +}; + +/** + * Loads a shader. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} shaderSource The shader source. + * @param {number} shaderType The type of shader. + * @param {function(string): void} opt_errorCallback callback for errors. + * @param {boolean} opt_logShaders Whether to log shader source. + * @param {string} opt_shaderLabel Label that identifies the shader source in + * the log. + * @param {string} opt_url URL from where the shader source was loaded from. + * If opt_logShaders is set, then a link to the source file will also be + * added. + * @param {boolean} Skip compilation status check. Default = false. + * @return {!WebGLShader} The created shader. + */ +var loadShader = function( + gl, shaderSource, shaderType, opt_errorCallback, opt_logShaders, + opt_shaderLabel, opt_url, opt_skipCompileStatus) { + var errFn = opt_errorCallback || error; + // Create the shader object + var shader = gl.createShader(shaderType); + if (shader == null) { + errFn("*** Error: unable to create shader '"+shaderSource+"'"); + return null; + } + + // Load the shader source + gl.shaderSource(shader, shaderSource); + var err = gl.getError(); + if (err != gl.NO_ERROR) { + errFn("*** Error loading shader '" + shader + "':" + glEnumToString(gl, err)); + return null; + } + + // Compile the shader + gl.compileShader(shader); + + if (opt_logShaders) { + var label = shaderType == gl.VERTEX_SHADER ? 'vertex shader' : 'fragment_shader'; + if (opt_shaderLabel) { + label = opt_shaderLabel + ' ' + label; + } + addShaderSources( + gl, document.getElementById('console'), label, shader, shaderSource, opt_url); + } + + // Check the compile status + if (!opt_skipCompileStatus) { + var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); + if (!compiled) { + // Something went wrong during compilation; get the error + lastError = gl.getShaderInfoLog(shader); + errFn("*** Error compiling " + glEnumToString(gl, shaderType) + " '" + shader + "':" + lastError); + gl.deleteShader(shader); + return null; + } + } + + return shader; +} + +/** + * Loads a shader from a URL. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {file} file The URL of the shader source. + * @param {number} type The type of shader. + * @param {function(string): void} opt_errorCallback callback for errors. + * @param {boolean} opt_logShaders Whether to log shader source. + * @param {boolean} Skip compilation status check. Default = false. + * @return {!WebGLShader} The created shader. + */ +var loadShaderFromFile = function( + gl, file, type, opt_errorCallback, opt_logShaders, opt_skipCompileStatus) { + var shaderSource = readFile(file); + return loadShader(gl, shaderSource, type, opt_errorCallback, + opt_logShaders, undefined, file, opt_skipCompileStatus); +}; + +var loadShaderFromFileAsync = function( + gl, file, type, opt_errorCallback, opt_logShaders, opt_skipCompileStatus, callback) { + loadTextFileAsync(file, function(gl, type, opt_errorCallback, opt_logShaders, file, opt_skipCompileStatus){ + return function(success, shaderSource) { + if (success) { + var shader = loadShader(gl, shaderSource, type, opt_errorCallback, + opt_logShaders, undefined, file, opt_skipCompileStatus); + callback(true, shader); + } else { + callback(false, null); + } + } + }(gl, type, opt_errorCallback, opt_logShaders, file, opt_skipCompileStatus)); +}; + +/** + * Gets the content of script. + * @param {string} scriptId The id of the script tag. + * @return {string} The content of the script. + */ +var getScript = function(scriptId) { + var shaderScript = document.getElementById(scriptId); + if (!shaderScript) { + throw("*** Error: unknown script element " + scriptId); + } + return shaderScript.text; +}; + +/** + * Loads a shader from a script tag. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} scriptId The id of the script tag. + * @param {number} opt_shaderType The type of shader. If not passed in it will + * be derived from the type of the script tag. + * @param {function(string): void} opt_errorCallback callback for errors. + * @param {boolean} opt_logShaders Whether to log shader source. + * @param {boolean} Skip compilation status check. Default = false. + * @return {!WebGLShader} The created shader. + */ +var loadShaderFromScript = function( + gl, scriptId, opt_shaderType, opt_errorCallback, opt_logShaders, opt_skipCompileStatus) { + var shaderSource = ""; + var shaderScript = document.getElementById(scriptId); + if (!shaderScript) { + throw("*** Error: unknown script element " + scriptId); + } + shaderSource = shaderScript.text; + + if (!opt_shaderType) { + if (shaderScript.type == "x-shader/x-vertex") { + opt_shaderType = gl.VERTEX_SHADER; + } else if (shaderScript.type == "x-shader/x-fragment") { + opt_shaderType = gl.FRAGMENT_SHADER; + } else { + throw("*** Error: unknown shader type"); + return null; + } + } + + return loadShader(gl, shaderSource, opt_shaderType, opt_errorCallback, + opt_logShaders, undefined, undefined, opt_skipCompileStatus); +}; + +var loadStandardProgram = function(gl) { + var program = gl.createProgram(); + gl.attachShader(program, loadStandardVertexShader(gl)); + gl.attachShader(program, loadStandardFragmentShader(gl)); + gl.bindAttribLocation(program, 0, "a_vertex"); + gl.bindAttribLocation(program, 1, "a_normal"); + linkProgram(gl, program); + return program; +}; + +var loadStandardProgramAsync = function(gl, callback) { + loadStandardVertexShaderAsync(gl, function(gl) { + return function(success, vs) { + if (success) { + loadStandardFragmentShaderAsync(gl, function(vs) { + return function(success, fs) { + if (success) { + var program = gl.createProgram(); + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.bindAttribLocation(program, 0, "a_vertex"); + gl.bindAttribLocation(program, 1, "a_normal"); + linkProgram(gl, program); + callback(true, program); + } else { + callback(false, null); + } + }; + }(vs)); + } else { + callback(false, null); + } + }; + }(gl)); +}; + +/** + * Loads shaders from files, creates a program, attaches the shaders and links. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} vertexShaderPath The URL of the vertex shader. + * @param {string} fragmentShaderPath The URL of the fragment shader. + * @param {function(string): void} opt_errorCallback callback for errors. + * @return {!WebGLProgram} The created program. + */ +var loadProgramFromFile = function( + gl, vertexShaderPath, fragmentShaderPath, opt_errorCallback) { + var program = gl.createProgram(); + var vs = loadShaderFromFile( + gl, vertexShaderPath, gl.VERTEX_SHADER, opt_errorCallback); + var fs = loadShaderFromFile( + gl, fragmentShaderPath, gl.FRAGMENT_SHADER, opt_errorCallback); + if (vs && fs) { + gl.attachShader(program, vs); + gl.attachShader(program, fs); + linkProgram(gl, program, opt_errorCallback); + } + if (vs) { + gl.deleteShader(vs); + } + if (fs) { + gl.deleteShader(fs); + } + return program; +}; + +/** + * Loads shaders from script tags, creates a program, attaches the shaders and + * links. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} vertexScriptId The id of the script tag that contains the + * vertex shader. + * @param {string} fragmentScriptId The id of the script tag that contains the + * fragment shader. + * @param {function(string): void} opt_errorCallback callback for errors. + * @return {!WebGLProgram} The created program. + */ +var loadProgramFromScript = function loadProgramFromScript( + gl, vertexScriptId, fragmentScriptId, opt_errorCallback) { + var program = gl.createProgram(); + gl.attachShader( + program, + loadShaderFromScript( + gl, vertexScriptId, gl.VERTEX_SHADER, opt_errorCallback)); + gl.attachShader( + program, + loadShaderFromScript( + gl, fragmentScriptId, gl.FRAGMENT_SHADER, opt_errorCallback)); + linkProgram(gl, program, opt_errorCallback); + return program; +}; + +/** + * Loads shaders from source, creates a program, attaches the shaders and + * links. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!WebGLShader} vertexShader The vertex shader. + * @param {!WebGLShader} fragmentShader The fragment shader. + * @param {function(string): void} opt_errorCallback callback for errors. + * @return {!WebGLProgram} The created program. + */ +var createProgram = function(gl, vertexShader, fragmentShader, opt_errorCallback) { + var program = gl.createProgram(); + gl.attachShader(program, vertexShader); + gl.attachShader(program, fragmentShader); + linkProgram(gl, program, opt_errorCallback); + return program; +}; + +/** + * Loads shaders from source, creates a program, attaches the shaders and + * links. + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} vertexShader The vertex shader source. + * @param {string} fragmentShader The fragment shader source. + * @param {function(string): void} opt_errorCallback callback for errors. + * @param {boolean} opt_logShaders Whether to log shader source. + * @return {!WebGLProgram} The created program. + */ +var loadProgram = function( + gl, vertexShader, fragmentShader, opt_errorCallback, opt_logShaders) { + var program; + var vs = loadShader( + gl, vertexShader, gl.VERTEX_SHADER, opt_errorCallback, opt_logShaders); + var fs = loadShader( + gl, fragmentShader, gl.FRAGMENT_SHADER, opt_errorCallback, opt_logShaders); + if (vs && fs) { + program = createProgram(gl, vs, fs, opt_errorCallback) + } + if (vs) { + gl.deleteShader(vs); + } + if (fs) { + gl.deleteShader(fs); + } + return program; +}; + +/** + * Loads shaders from source, creates a program, attaches the shaders and + * links but expects error. + * + * GLSL 1.0.17 10.27 effectively says that compileShader can + * always succeed as long as linkProgram fails so we can't + * rely on compileShader failing. This function expects + * one of the shader to fail OR linking to fail. + * + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} vertexShaderScriptId The vertex shader. + * @param {string} fragmentShaderScriptId The fragment shader. + * @return {WebGLProgram} The created program. + */ +var loadProgramFromScriptExpectError = function( + gl, vertexShaderScriptId, fragmentShaderScriptId) { + var vertexShader = loadShaderFromScript(gl, vertexShaderScriptId); + if (!vertexShader) { + return null; + } + var fragmentShader = loadShaderFromScript(gl, fragmentShaderScriptId); + if (!fragmentShader) { + return null; + } + var linkSuccess = true; + var program = gl.createProgram(); + gl.attachShader(program, vertexShader); + gl.attachShader(program, fragmentShader); + linkSuccess = true; + linkProgram(gl, program, function() { + linkSuccess = false; + }); + return linkSuccess ? program : null; +}; + + +var getActiveMap = function(gl, program, typeInfo) { + var numVariables = gl.getProgramParameter(program, gl[typeInfo.param]); + var variables = {}; + for (var ii = 0; ii < numVariables; ++ii) { + var info = gl[typeInfo.activeFn](program, ii); + variables[info.name] = { + name: info.name, + size: info.size, + type: info.type, + location: gl[typeInfo.locFn](program, info.name) + }; + } + return variables; +}; + +/** + * Returns a map of attrib names to info about those + * attribs. + * + * eg: + * { "attrib1Name": + * { + * name: "attrib1Name", + * size: 1, + * type: gl.FLOAT_MAT2, + * location: 0 + * }, + * "attrib2Name[0]": + * { + * name: "attrib2Name[0]", + * size: 4, + * type: gl.FLOAT, + * location: 1 + * }, + * } + * + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {WebGLProgram} The program to query for attribs. + * @return the map. + */ +var getAttribMap = function(gl, program) { + return getActiveMap(gl, program, { + param: "ACTIVE_ATTRIBUTES", + activeFn: "getActiveAttrib", + locFn: "getAttribLocation" + }); +}; + +/** + * Returns a map of uniform names to info about those uniforms. + * + * eg: + * { "uniform1Name": + * { + * name: "uniform1Name", + * size: 1, + * type: gl.FLOAT_MAT2, + * location: WebGLUniformLocation + * }, + * "uniform2Name[0]": + * { + * name: "uniform2Name[0]", + * size: 4, + * type: gl.FLOAT, + * location: WebGLUniformLocation + * }, + * } + * + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {WebGLProgram} The program to query for uniforms. + * @return the map. + */ +var getUniformMap = function(gl, program) { + return getActiveMap(gl, program, { + param: "ACTIVE_UNIFORMS", + activeFn: "getActiveUniform", + locFn: "getUniformLocation" + }); +}; + +var basePath; +var getResourcePath = function() { + if (!basePath) { + var expectedBase = "js/webgl-test-utils.js"; + var scripts = document.getElementsByTagName('script'); + for (var script, i = 0; script = scripts[i]; i++) { + var src = script.src; + var l = src.length; + if (src.substr(l - expectedBase.length) == expectedBase) { + basePath = src.substr(0, l - expectedBase.length); + } + } + } + return basePath + "resources/"; +}; + +var loadStandardVertexShader = function(gl) { + return loadShaderFromFile( + gl, getResourcePath() + "vertexShader.vert", gl.VERTEX_SHADER); +}; +var loadStandardVertexShaderAsync = function(gl, callback) { + loadShaderFromFileAsync(gl, getResourcePath() + "vertexShader.vert", gl.VERTEX_SHADER, undefined, undefined, undefined, callback); +}; + +var loadStandardFragmentShader = function(gl) { + return loadShaderFromFile( + gl, getResourcePath() + "fragmentShader.frag", gl.FRAGMENT_SHADER); +}; +var loadStandardFragmentShaderAsync = function(gl, callback) { + loadShaderFromFileAsync(gl, getResourcePath() + "fragmentShader.frag", gl.FRAGMENT_SHADER, undefined, undefined, undefined, callback); +}; + +var loadUniformBlockProgram = function(gl) { + var program = gl.createProgram(); + gl.attachShader(program, loadUniformBlockVertexShader(gl)); + gl.attachShader(program, loadUniformBlockFragmentShader(gl)); + gl.bindAttribLocation(program, 0, "a_vertex"); + gl.bindAttribLocation(program, 1, "a_normal"); + linkProgram(gl, program); + return program; +}; + +var loadUniformBlockVertexShader = function(gl) { + return loadShaderFromFile( + gl, getResourcePath() + "uniformBlockShader.vert", gl.VERTEX_SHADER); +}; + +var loadUniformBlockFragmentShader = function(gl) { + return loadShaderFromFile( + gl, getResourcePath() + "uniformBlockShader.frag", gl.FRAGMENT_SHADER); +}; + +/** + * Loads an image asynchronously. + * @param {string} url URL of image to load. + * @param {!function(!Element): void} callback Function to call + * with loaded image. + */ +var loadImageAsync = function(url, callback) { + var img = document.createElement('img'); + img.onload = function() { + callback(img); + }; + img.src = url; +}; + +/** + * Loads an array of images. + * @param {!Array.} urls URLs of images to load. + * @param {!function(!{string, img}): void} callback Callback + * that gets passed map of urls to img tags. + */ +var loadImagesAsync = function(urls, callback) { + var count = 1; + var images = { }; + function countDown() { + --count; + if (count == 0) { + log("loadImagesAsync: all images loaded"); + callback(images); + } + } + function imageLoaded(url) { + return function(img) { + images[url] = img; + log("loadImagesAsync: loaded " + url); + countDown(); + } + } + for (var ii = 0; ii < urls.length; ++ii) { + ++count; + loadImageAsync(urls[ii], imageLoaded(urls[ii])); + } + countDown(); +}; + +/** + * Returns a map of key=value values from url. + * @return {!Object.} map of keys to values. + */ +var getUrlArguments = function() { + var args = {}; + try { + var s = window.location.href; + var q = s.indexOf("?"); + var e = s.indexOf("#"); + if (e < 0) { + e = s.length; + } + var query = s.substring(q + 1, e); + var pairs = query.split("&"); + for (var ii = 0; ii < pairs.length; ++ii) { + var keyValue = pairs[ii].split("="); + var key = keyValue[0]; + var value = decodeURIComponent(keyValue[1]); + args[key] = value; + } + } catch (e) { + throw "could not parse url"; + } + return args; +}; + +/** + * Makes an image from a src. + * @param {string} src Image source URL. + * @param {function()} onload Callback to call when the image has finised loading. + * @param {function()} onerror Callback to call when an error occurs. + * @return {!Image} The created image. + */ +var makeImage = function(src, onload, onerror) { + var img = document.createElement('img'); + if (onload) { + img.onload = onload; + } + if (onerror) { + img.onerror = onerror; + } else { + img.onerror = function() { + log("WARNING: creating image failed; src: " + this.src); + }; + } + if (src) { + img.src = src; + } + return img; +} + +/** + * Makes an image element from a canvas. + * @param {!HTMLCanvas} canvas Canvas to make image from. + * @param {function()} onload Callback to call when the image has finised loading. + * @param {string} imageFormat Image format to be passed to toDataUrl(). + * @return {!Image} The created image. + */ +var makeImageFromCanvas = function(canvas, onload, imageFormat) { + return makeImage(canvas.toDataURL(imageFormat), onload); +}; + +/** + * Makes a video element from a src. + * @param {string} src Video source URL. + * @param {function()} onerror Callback to call when an error occurs. + * @return {!Video} The created video. + */ +var makeVideo = function(src, onerror) { + var vid = document.createElement('video'); + if (onerror) { + vid.onerror = onerror; + } else { + vid.onerror = function() { + log("WARNING: creating video failed; src: " + this.src); + }; + } + if (src) { + vid.src = src; + } + return vid; +} + +/** + * Inserts an image with a caption into 'element'. + * @param {!HTMLElement} element Element to append image to. + * @param {string} caption caption to associate with image. + * @param {!Image} img image to insert. + */ +var insertImage = function(element, caption, img) { + var div = document.createElement("div"); + var label = document.createElement("div"); + label.appendChild(document.createTextNode(caption)); + div.appendChild(label); + div.appendChild(img); + element.appendChild(div); +}; + +/** + * Inserts a 'label' that when clicked expands to the pre formatted text + * supplied by 'source'. + * @param {!HTMLElement} element element to append label to. + * @param {string} label label for anchor. + * @param {string} source preformatted text to expand to. + * @param {string} opt_url URL of source. If provided a link to the source file + * will also be added. + */ +var addShaderSource = function(element, label, source, opt_url) { + var div = document.createElement("div"); + var s = document.createElement("pre"); + s.className = "shader-source"; + s.style.display = "none"; + var ol = document.createElement("ol"); + //s.appendChild(document.createTextNode(source)); + var lines = source.split("\n"); + for (var ii = 0; ii < lines.length; ++ii) { + var line = lines[ii]; + var li = document.createElement("li"); + li.appendChild(document.createTextNode(line)); + ol.appendChild(li); + } + s.appendChild(ol); + var l = document.createElement("a"); + l.href = "show-shader-source"; + l.appendChild(document.createTextNode(label)); + l.addEventListener('click', function(event) { + if (event.preventDefault) { + event.preventDefault(); + } + s.style.display = (s.style.display == 'none') ? 'block' : 'none'; + return false; + }, false); + div.appendChild(l); + if (opt_url) { + var u = document.createElement("a"); + u.href = opt_url; + div.appendChild(document.createTextNode(" ")); + u.appendChild(document.createTextNode("(" + opt_url + ")")); + div.appendChild(u); + } + div.appendChild(s); + element.appendChild(div); +}; + +/** + * Inserts labels that when clicked expand to show the original source of the + * shader and also translated source of the shader, if that is available. + * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {!HTMLElement} element element to append label to. + * @param {string} label label for anchor. + * @param {WebGLShader} shader Shader to show the sources for. + * @param {string} shaderSource Original shader source. + * @param {string} opt_url URL of source. If provided a link to the source file + * will also be added. + */ +var addShaderSources = function( + gl, element, label, shader, shaderSource, opt_url) { + addShaderSource(element, label, shaderSource, opt_url); + + var debugShaders = gl.getExtension('WEBGL_debug_shaders'); + if (debugShaders && shader) { + var translatedSource = debugShaders.getTranslatedShaderSource(shader); + if (translatedSource != '') { + addShaderSource(element, label + ' translated for driver', translatedSource); + } + } +}; + +/** + * Sends shader information to the server to be dumped into text files + * when tests are run from within the test-runner harness. + * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. + * @param {string} url URL of current. + * @param {string} passMsg Test description. + * @param {object} vInfo Object containing vertex shader information. + * @param {object} fInfo Object containing fragment shader information. + */ +var dumpShadersInfo = function(gl, url, passMsg, vInfo, fInfo) { + var shaderInfo = {}; + shaderInfo.url = url; + shaderInfo.testDescription = passMsg; + shaderInfo.vLabel = vInfo.label; + shaderInfo.vShouldCompile = vInfo.shaderSuccess; + shaderInfo.vSource = vInfo.source; + shaderInfo.fLabel = fInfo.label; + shaderInfo.fShouldCompile = fInfo.shaderSuccess; + shaderInfo.fSource = fInfo.source; + shaderInfo.vTranslatedSource = null; + shaderInfo.fTranslatedSource = null; + var debugShaders = gl.getExtension('WEBGL_debug_shaders'); + if (debugShaders) { + if (vInfo.shader) + shaderInfo.vTranslatedSource = debugShaders.getTranslatedShaderSource(vInfo.shader); + if (fInfo.shader) + shaderInfo.fTranslatedSource = debugShaders.getTranslatedShaderSource(fInfo.shader); + } + + var dumpShaderInfoRequest = new XMLHttpRequest(); + dumpShaderInfoRequest.open('POST', "/dumpShaderInfo", true); + dumpShaderInfoRequest.setRequestHeader("Content-Type", "text/plain"); + dumpShaderInfoRequest.send(JSON.stringify(shaderInfo)); +}; + +// Add your prefix here. +var browserPrefixes = [ + "", + "MOZ_", + "OP_", + "WEBKIT_" +]; + +/** + * Given an extension name like WEBGL_compressed_texture_s3tc + * returns the name of the supported version extension, like + * WEBKIT_WEBGL_compressed_teture_s3tc + * @param {string} name Name of extension to look for. + * @return {string} name of extension found or undefined if not + * found. + */ +var getSupportedExtensionWithKnownPrefixes = function(gl, name) { + var supported = gl.getSupportedExtensions(); + for (var ii = 0; ii < browserPrefixes.length; ++ii) { + var prefixedName = browserPrefixes[ii] + name; + if (supported.indexOf(prefixedName) >= 0) { + return prefixedName; + } + } +}; + +/** + * Given an extension name like WEBGL_compressed_texture_s3tc + * returns the supported version extension, like + * WEBKIT_WEBGL_compressed_teture_s3tc + * @param {string} name Name of extension to look for. + * @return {WebGLExtension} The extension or undefined if not + * found. + */ +var getExtensionWithKnownPrefixes = function(gl, name) { + for (var ii = 0; ii < browserPrefixes.length; ++ii) { + var prefixedName = browserPrefixes[ii] + name; + var ext = gl.getExtension(prefixedName); + if (ext) { + return ext; + } + } +}; + +/** + * Returns possible prefixed versions of an extension's name. + * @param {string} name Name of extension. May already include a prefix. + * @return {Array.} Variations of the extension name with known + * browser prefixes. + */ +var getExtensionPrefixedNames = function(name) { + var unprefix = function(name) { + for (var ii = 0; ii < browserPrefixes.length; ++ii) { + if (browserPrefixes[ii].length > 0 && + name.substring(0, browserPrefixes[ii].length).toLowerCase() === + browserPrefixes[ii].toLowerCase()) { + return name.substring(browserPrefixes[ii].length); + } + } + return name; + } + + var unprefixed = unprefix(name); + + var variations = []; + for (var ii = 0; ii < browserPrefixes.length; ++ii) { + variations.push(browserPrefixes[ii] + unprefixed); + } + + return variations; +}; + +var replaceRE = /\$\((\w+)\)/g; + +/** + * Replaces strings with property values. + * Given a string like "hello $(first) $(last)" and an object + * like {first:"John", last:"Smith"} will return + * "hello John Smith". + * @param {string} str String to do replacements in. + * @param {...} 1 or more objects containing properties. + */ +var replaceParams = function(str) { + var args = arguments; + return str.replace(replaceRE, function(str, p1, offset, s) { + for (var ii = 1; ii < args.length; ++ii) { + if (args[ii][p1] !== undefined) { + return args[ii][p1]; + } + } + throw "unknown string param '" + p1 + "'"; + }); +}; + +var upperCaseFirstLetter = function(str) { + return str.substring(0, 1).toUpperCase() + str.substring(1); +}; + +/** + * Gets a prefixed property. For example, + * + * var fn = getPrefixedProperty( + * window, + * "requestAnimationFrame"); + * + * Will return either: + * "window.requestAnimationFrame", + * "window.oRequestAnimationFrame", + * "window.msRequestAnimationFrame", + * "window.mozRequestAnimationFrame", + * "window.webKitRequestAnimationFrame", + * undefined + * + * the non-prefixed function is tried first. + */ +var propertyPrefixes = ["", "moz", "ms", "o", "webkit"]; +var getPrefixedProperty = function(obj, propertyName) { + for (var ii = 0; ii < propertyPrefixes.length; ++ii) { + var prefix = propertyPrefixes[ii]; + var name = prefix + propertyName; + log(name); + var property = obj[name]; + if (property) { + return property; + } + if (ii == 0) { + propertyName = upperCaseFirstLetter(propertyName); + } + } + return undefined; +}; + +var _requestAnimFrame; + +/** + * Provides requestAnimationFrame in a cross browser way. + */ +var requestAnimFrame = function(callback) { + if (!_requestAnimFrame) { + _requestAnimFrame = getPrefixedProperty(window, "requestAnimationFrame") || + function(callback, element) { + return window.setTimeout(callback, 1000 / 70); + }; + } + _requestAnimFrame.call(window, callback); +}; + +var _cancelAnimFrame; + +/** + * Provides cancelAnimationFrame in a cross browser way. + */ +var cancelAnimFrame = function(request) { + if (!_cancelAnimFrame) { + _cancelAnimFrame = getPrefixedProperty(window, "cancelAnimationFrame") || + window.clearTimeout; + } + _cancelAnimFrame.call(window, request); +}; + +/** + * Provides requestFullScreen in a cross browser way. + */ +var requestFullScreen = function(element) { + var fn = getPrefixedProperty(element, "requestFullScreen"); + if (fn) { + fn.call(element); + } +}; + +/** + * Provides cancelFullScreen in a cross browser way. + */ +var cancelFullScreen = function() { + var fn = getPrefixedProperty(document, "cancelFullScreen"); + if (fn) { + fn.call(document); + } +}; + +var fullScreenStateName; +(function() { + var fullScreenStateNames = [ + "isFullScreen", + "fullScreen" + ]; + for (var ii = 0; ii < fullScreenStateNames.length; ++ii) { + var propertyName = fullScreenStateNames[ii]; + for (var jj = 0; jj < propertyPrefixes.length; ++jj) { + var prefix = propertyPrefixes[jj]; + if (prefix.length) { + propertyName = upperCaseFirstLetter(propertyName); + fullScreenStateName = prefix + propertyName; + if (document[fullScreenStateName] !== undefined) { + return; + } + } + } + fullScreenStateName = undefined; + } +}()); + +/** + * @return {boolean} True if fullscreen mode is active. + */ +var getFullScreenState = function() { + log("fullscreenstatename:" + fullScreenStateName); + log(document[fullScreenStateName]); + return document[fullScreenStateName]; +}; + +/** + * @param {!HTMLElement} element The element to go fullscreen. + * @param {!function(boolean)} callback A function that will be called + * when entering/exiting fullscreen. It is passed true if + * entering fullscreen, false if exiting. + */ +var onFullScreenChange = function(element, callback) { + propertyPrefixes.forEach(function(prefix) { + var eventName = prefix + "fullscreenchange"; + log("addevent: " + eventName); + document.addEventListener(eventName, function(event) { + log("event: " + eventName); + callback(getFullScreenState()); + }); + }); +}; + +/** + * @param {!string} buttonId The id of the button that will toggle fullscreen + * mode. + * @param {!string} fullscreenId The id of the element to go fullscreen. + * @param {!function(boolean)} callback A function that will be called + * when entering/exiting fullscreen. It is passed true if + * entering fullscreen, false if exiting. + * @return {boolean} True if fullscreen mode is supported. + */ +var setupFullscreen = function(buttonId, fullscreenId, callback) { + if (!fullScreenStateName) { + return false; + } + + var fullscreenElement = document.getElementById(fullscreenId); + onFullScreenChange(fullscreenElement, callback); + + var toggleFullScreen = function(event) { + if (getFullScreenState()) { + cancelFullScreen(fullscreenElement); + } else { + requestFullScreen(fullscreenElement); + } + event.preventDefault(); + return false; + }; + + var buttonElement = document.getElementById(buttonId); + buttonElement.addEventListener('click', toggleFullScreen); + + return true; +}; + +/** + * Waits for the browser to composite the web page. + * @param {function()} callback A function to call after compositing has taken + * place. + */ +var waitForComposite = function(callback) { + var frames = 5; + var countDown = function() { + if (frames == 0) { + // TODO(kbr): unify with js-test-pre.js and enable these with + // verbose logging. + // log("waitForComposite: callback"); + callback(); + } else { + // log("waitForComposite: countdown(" + frames + ")"); + --frames; + requestAnimFrame.call(window, countDown); + } + }; + countDown(); +}; + +/** + * Runs an array of functions, yielding to the browser between each step. + * If you want to know when all the steps are finished add a last step. + * @param {!Array.} steps Array of functions. + */ +var runSteps = function(steps) { + if (!steps.length) { + return; + } + + // copy steps so they can't be modifed. + var stepsToRun = steps.slice(); + var currentStep = 0; + var runNextStep = function() { + stepsToRun[currentStep++](); + if (currentStep < stepsToRun.length) { + setTimeout(runNextStep, 1); + } + }; + runNextStep(); +}; + +/** + * Starts playing a video and waits for it to be consumable. + * @param {!HTMLVideoElement} video An HTML5 Video element. + * @param {!function(!HTMLVideoElement): void} callback Function to call when + * video is ready. + */ +var startPlayingAndWaitForVideo = function(video, callback) { + var gotPlaying = false; + var gotTimeUpdate = false; + + var maybeCallCallback = function() { + if (gotPlaying && gotTimeUpdate && callback) { + callback(video); + callback = undefined; + video.removeEventListener('playing', playingListener, true); + video.removeEventListener('timeupdate', timeupdateListener, true); + } + }; + + var playingListener = function() { + gotPlaying = true; + maybeCallCallback(); + }; + + var timeupdateListener = function() { + // Checking to make sure the current time has advanced beyond + // the start time seems to be a reliable heuristic that the + // video element has data that can be consumed. + if (video.currentTime > 0.0) { + gotTimeUpdate = true; + maybeCallCallback(); + } + }; + + video.addEventListener('playing', playingListener, true); + video.addEventListener('timeupdate', timeupdateListener, true); + video.loop = true; + video.play(); +}; + +var getHost = function(url) { + url = url.replace("\\", "/"); + var pos = url.indexOf("://"); + if (pos >= 0) { + url = url.substr(pos + 3); + } + var parts = url.split('/'); + return parts[0]; +} + +// 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. +var getBaseDomain = function(host) { + var parts = host.split(":"); + var hostname = parts[0]; + var port = parts[1] || "80"; + parts = hostname.split("."); + if(parts.length < 2) + return hostname + ":" + port; + var tld = parts[parts.length-1]; + var domain = parts[parts.length-2]; + return domain + "." + tld + ":" + port; +} + +var runningOnLocalhost = function() { + return window.location.hostname.indexOf("localhost") != -1 || + window.location.hostname.indexOf("127.0.0.1") != -1; +} + +var getLocalCrossOrigin = function() { + var domain; + if (window.location.host.indexOf("localhost") != -1) { + domain = "127.0.0.1"; + } else { + domain = "localhost"; + } + + var port = window.location.port || "80"; + return window.location.protocol + "//" + domain + ":" + port +} + +var getRelativePath = function(path) { + var relparts = window.location.pathname.split("/"); + relparts.pop(); // Pop off filename + var pathparts = path.split("/"); + + var i; + for (i = 0; i < pathparts.length; ++i) { + switch (pathparts[i]) { + case "": break; + case ".": break; + case "..": + relparts.pop(); + break; + default: + relparts.push(pathparts[i]); + break; + } + } + + return relparts.join("/"); +} + +var setupImageForCrossOriginTest = function(img, imgUrl, localUrl, callback) { + window.addEventListener("load", function() { + if (typeof(img) == "string") + img = document.querySelector(img); + if (!img) + img = new Image(); + + img.addEventListener("load", callback, false); + img.addEventListener("error", callback, false); + + if (runningOnLocalhost()) + img.src = getLocalCrossOrigin() + getRelativePath(localUrl); + else + img.src = getUrlOptions().imgUrl || imgUrl; + }, false); +} + +/** + * Convert sRGB color to linear color. + * @param {!Array.} color The color to be converted. + * The array has 4 elements, for example [R, G, B, A]. + * where each element is in the range 0 to 255. + * @return {!Array.} color The color to be converted. + * The array has 4 elements, for example [R, G, B, A]. + * where each element is in the range 0 to 255. + */ +var sRGBToLinear = function(color) { + return [sRGBChannelToLinear(color[0]), + sRGBChannelToLinear(color[1]), + sRGBChannelToLinear(color[2]), + color[3]] +} + +/** + * Convert linear color to sRGB color. + * @param {!Array.} color The color to be converted. + * The array has 4 elements, for example [R, G, B, A]. + * where each element is in the range 0 to 255. + * @return {!Array.} color The color to be converted. + * The array has 4 elements, for example [R, G, B, A]. + * where each element is in the range 0 to 255. + */ +var linearToSRGB = function(color) { + return [linearChannelToSRGB(color[0]), + linearChannelToSRGB(color[1]), + linearChannelToSRGB(color[2]), + color[3]] +} + +function sRGBChannelToLinear(value) { + value = value / 255; + if (value <= 0.04045) + value = value / 12.92; + else + value = Math.pow((value + 0.055) / 1.055, 2.4); + return Math.trunc(value * 255 + 0.5); +} + +function linearChannelToSRGB(value) { + value = value / 255; + if (value <= 0.0) { + value = 0.0; + } else if (value < 0.0031308) { + value = value * 12.92; + } else if (value < 1) { + value = Math.pow(value, 0.41666) * 1.055 - 0.055; + } else { + value = 1.0; + } + return Math.trunc(value * 255 + 0.5); +} +var API = { + addShaderSource: addShaderSource, + addShaderSources: addShaderSources, + cancelAnimFrame: cancelAnimFrame, + create3DContext: create3DContext, + GLErrorException: GLErrorException, + create3DContextWithWrapperThatThrowsOnGLError: create3DContextWithWrapperThatThrowsOnGLError, + checkAreaInAndOut: checkAreaInAndOut, + checkCanvas: checkCanvas, + checkCanvasRect: checkCanvasRect, + checkCanvasRectColor: checkCanvasRectColor, + checkCanvasRects: checkCanvasRects, + checkFloatBuffer: checkFloatBuffer, + checkTextureSize: checkTextureSize, + clipToRange: clipToRange, + createColoredTexture: createColoredTexture, + createProgram: createProgram, + clearAndDrawUnitQuad: clearAndDrawUnitQuad, + clearAndDrawIndexedQuad: clearAndDrawIndexedQuad, + drawUnitQuad: drawUnitQuad, + drawIndexedQuad: drawIndexedQuad, + drawUByteColorQuad: drawUByteColorQuad, + drawFloatColorQuad: drawFloatColorQuad, + dumpShadersInfo: dumpShadersInfo, + endsWith: endsWith, + failIfGLError: failIfGLError, + fillTexture: fillTexture, + getBytesPerComponent: getBytesPerComponent, + getDefault3DContextVersion: getDefault3DContextVersion, + getExtensionPrefixedNames: getExtensionPrefixedNames, + getExtensionWithKnownPrefixes: getExtensionWithKnownPrefixes, + getFileListAsync: getFileListAsync, + getLastError: getLastError, + getPrefixedProperty: getPrefixedProperty, + getScript: getScript, + getSupportedExtensionWithKnownPrefixes: getSupportedExtensionWithKnownPrefixes, + getTypedArrayElementsPerPixel: getTypedArrayElementsPerPixel, + getUrlArguments: getUrlArguments, + getUrlOptions: getUrlOptions, + getAttribMap: getAttribMap, + getUniformMap: getUniformMap, + glEnumToString: glEnumToString, + glErrorShouldBe: glErrorShouldBe, + glTypeToTypedArrayType: glTypeToTypedArrayType, + hasAttributeCaseInsensitive: hasAttributeCaseInsensitive, + insertImage: insertImage, + loadImageAsync: loadImageAsync, + loadImagesAsync: loadImagesAsync, + loadProgram: loadProgram, + loadProgramFromFile: loadProgramFromFile, + loadProgramFromScript: loadProgramFromScript, + loadProgramFromScriptExpectError: loadProgramFromScriptExpectError, + loadShader: loadShader, + loadShaderFromFile: loadShaderFromFile, + loadShaderFromScript: loadShaderFromScript, + loadStandardProgram: loadStandardProgram, + loadStandardProgramAsync: loadStandardProgramAsync, + loadStandardVertexShader: loadStandardVertexShader, + loadStandardVertexShaderAsync: loadStandardVertexShaderAsync, + loadStandardFragmentShader: loadStandardFragmentShader, + loadStandardFragmentShaderAsync: loadStandardFragmentShaderAsync, + loadUniformBlockProgram: loadUniformBlockProgram, + loadUniformBlockVertexShader: loadUniformBlockVertexShader, + loadUniformBlockFragmentShader: loadUniformBlockFragmentShader, + loadTextFileAsync: loadTextFileAsync, + loadTexture: loadTexture, + log: log, + loggingOff: loggingOff, + makeCheckRect: makeCheckRect, + makeImage: makeImage, + makeImageFromCanvas: makeImageFromCanvas, + makeVideo: makeVideo, + error: error, + shallowCopyObject: shallowCopyObject, + setDefault3DContextVersion: setDefault3DContextVersion, + setupColorQuad: setupColorQuad, + setupProgram: setupProgram, + setupTransformFeedbackProgram: setupTransformFeedbackProgram, + setupQuad: setupQuad, + setupIndexedQuad: setupIndexedQuad, + setupIndexedQuadWithOptions: setupIndexedQuadWithOptions, + setupSimpleColorProgram: setupSimpleColorProgram, + setupSimpleTextureProgram: setupSimpleTextureProgram, + setupSimpleCubeMapTextureProgram: setupSimpleCubeMapTextureProgram, + setupSimpleVertexColorProgram: setupSimpleVertexColorProgram, + setupNoTexCoordTextureProgram: setupNoTexCoordTextureProgram, + setupTexturedQuad: setupTexturedQuad, + setupTexturedQuadWithTexCoords: setupTexturedQuadWithTexCoords, + setupTexturedQuadWithCubeMap: setupTexturedQuadWithCubeMap, + setupUnitQuad: setupUnitQuad, + setupUnitQuadWithTexCoords: setupUnitQuadWithTexCoords, + setFloatDrawColor: setFloatDrawColor, + setUByteDrawColor: setUByteDrawColor, + startPlayingAndWaitForVideo: startPlayingAndWaitForVideo, + startsWith: startsWith, + shouldGenerateGLError: shouldGenerateGLError, + readFile: readFile, + readFileList: readFileList, + replaceParams: replaceParams, + requestAnimFrame: requestAnimFrame, + runSteps: runSteps, + waitForComposite: waitForComposite, + + // fullscreen api + setupFullscreen: setupFullscreen, + + // sRGB converter api + sRGBToLinear: sRGBToLinear, + linearToSRGB: linearToSRGB, + + getHost: getHost, + getBaseDomain: getBaseDomain, + runningOnLocalhost: runningOnLocalhost, + getLocalCrossOrigin: getLocalCrossOrigin, + getRelativePath: getRelativePath, + setupImageForCrossOriginTest: setupImageForCrossOriginTest, + + none: false +}; + +Object.defineProperties(API, { + noTexCoordTextureVertexShader: { value: noTexCoordTextureVertexShader, writable: false }, + simpleTextureVertexShader: { value: simpleTextureVertexShader, writable: false }, + simpleColorFragmentShader: { value: simpleColorFragmentShader, writable: false }, + simpleVertexShader: { value: simpleVertexShader, writable: false }, + simpleTextureFragmentShader: { value: simpleTextureFragmentShader, writable: false }, + simpleCubeMapTextureFragmentShader: { value: simpleCubeMapTextureFragmentShader, writable: false }, + simpleVertexColorFragmentShader: { value: simpleVertexColorFragmentShader, writable: false }, + simpleVertexColorVertexShader: { value: simpleVertexColorVertexShader, writable: false } +}); + +return API; + +}()); diff --git a/dom/canvas/test/webgl-conf/checkout/py/lint/LICENSE b/dom/canvas/test/webgl-conf/checkout/py/lint/LICENSE new file mode 100644 index 000000000..45896e6be --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/py/lint/LICENSE @@ -0,0 +1,30 @@ +W3C 3-clause BSD License + +http://www.w3.org/Consortium/Legal/2008/03-bsd-license.html + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of works must retain the original copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the original copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name of the W3C nor the names of its contributors may be + used to endorse or promote products derived from this work without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dom/canvas/test/webgl-conf/checkout/py/lint/README.md b/dom/canvas/test/webgl-conf/checkout/py/lint/README.md new file mode 100644 index 000000000..b030932f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/py/lint/README.md @@ -0,0 +1,115 @@ +## Introduction + +We have a lint tool for catching common mistakes in test files. The tool comes from +[W3C/wpt-tools](https://github.com/w3c/wpt-tools/) with modification for catching +common mistakes in submitted pull request, all WebGL/sdk/tests and specified folder. + +The copyright of this tool is belong to W3C and/or the author listed in the test +file. The tool is dual-licensed under the +[W3C Test Suite License](http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) +and [BSD 3-clause License](http://www.w3.org/Consortium/Legal/2008/03-bsd-license), +which are introduced in +[W3C's test suite licensing policy](http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright). + +Now the tool can check html, htm, xhtml, xhtm, js, frag and vert files. +- You can run it manually by starting the `lint.py` executable from the root of your local +WebGL/sdk/tests working directory like this: + +``` +./py/lint/lint.py +``` + +You can use the lint tool to check submitted pull request and fix the errors reported by the tool. +Reviewers will not merge branches with tests that have lint errors, so you must either +[fix all lint errors](#fixing-lint-errors) or update +[white-list test files] (#updating-the-whitelist) to suppress the errors. + +## Usage of lint tool + +1. Check other repos, specify the repo name with `-r`, default +is WebGL/sdk/tests:
+ +./py/lint/lint.py -r demo-express + +1. Check submitted pull request:
+ +./py/lint/lint.py -p + +1. Check specified folder, the specified folder must be relative path of +WebGL/sdk/tests:
+ +./py/lint/lint.py -d conformance/attribs + + +## Fixing lint errors + +You must fix any errors the lint tool reports, unless an error is for +something essential to a certain test or that for some other exceptional +reason shouldn't prevent the test from being merged. In those cases you can +update [white-list test files](#updating-the-whiteslist) to suppress the errors. +Otherwise, use the details in this section to fix all errors reported. + +* **CR AT EOL**: Test-file line ends with CR (U+000D) character; **fix**: + reformat file so each line just has LF (U+000A) line ending (standard, + cross-platform "Unix" line endings instead of, e.g., DOS line endings). + +* **INDENT TABS**: Test-file line starts with one or more tab characters; + **fix**: use spaces to replace any tab characters at beginning of lines. + +* **TRAILING WHITESPACE**: Test-file line has trailing whitespace; **fix**: + remove trailing whitespace from all lines in the file. + +* **UNNECESSARY EXECUTABLE PERMISSION**: Test file contains unnecessary executable permission; **fix**: + remove unnecessary executable permission of the file. + +* **FILENAME WHITESPACE**: Test file name contains white space; **fix**: + remove white space from test file name. + +## Updating the whitelist + +Normally you must [fix all lint errors](#fixing-lint-errors). But in the +unusual case of error reports for things essential to certain tests or that +for other exceptional reasons shouldn't prevent a merge of a test, you can +update and commit the `lint.whitelist` file in the WebGL/sdk/tests/py/lint/ +directory to suppress errors the lint tool would report for a test file. + +To add a test file or directory to the whitelist, use the following format: + +``` +ERROR TYPE:file/name/pattern +``` + +For example, to whitelist the file `example/file.html` such that all +`TRAILING WHITESPACE` errors the lint tool would report for it are +suppressed, add the following line to the `lint.whitelist` file. + +``` +TRAILING WHITESPACE:example/file.html +``` + +To whitelist an entire directory rather than just one file, use the `*` +wildcard. For example, to whitelist the `example` directory such that all +`TRAILING WHITESPACE` errors the lint tool would report for any files in it +are suppressed, add the following line to the `lint.whitelist` file. + +``` +TRAILING WHITESPACE:example/* +``` + +If needed, you can also use the `*` wildcard to express other filename +patterns or directory-name patterns (just as you would when, e.g., +executing shell commands from the command line). + +Finally, to whitelist just one line in a file, use the following format: + +``` +ERROR TYPE:file/name/pattern:line_number +``` + +For example, to whitelist just line 128 of the file `example/file.html` +such that any `TRAILING WHITESPACE` error the lint tool would report for +that line is suppressed, add the following to the `lint.whitelist` file. + +``` +TRAILING WHITESPACE:example/file.html:128 +``` diff --git a/dom/canvas/test/webgl-conf/checkout/py/lint/lint.py b/dom/canvas/test/webgl-conf/checkout/py/lint/lint.py new file mode 100755 index 000000000..2dea67b6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/py/lint/lint.py @@ -0,0 +1,223 @@ +#! /usr/bin/env python +import os +import subprocess +import re +import sys +import fnmatch +import commands + +from collections import defaultdict +from optparse import OptionParser + +lint_root = os.path.dirname(os.path.abspath(__file__)) +repo_root = os.path.dirname(os.path.dirname(lint_root)) + + +def git(command, *args): + args = list(args) + proc_kwargs = {"cwd": repo_root} + command_line = ["git", command] + args + + try: + return subprocess.check_output(command_line, **proc_kwargs) + except subprocess.CalledProcessError: + raise + + +def iter_files(flag=False, floder=""): + if floder != "" and floder != None: + os.chdir(repo_root) + for pardir, subdir, files in os.walk(floder): + for item in subdir + files: + if not os.path.isdir(os.path.join(pardir, item)): + yield os.path.join(pardir, item) + os.chdir(lint_root) + else: + if not flag: + os.chdir(repo_root) + for pardir, subdir, files in os.walk(repo_root): + for item in subdir + files: + if not os.path.isdir(os.path.join(pardir, item)): + yield os.path.join(pardir, item).split(repo_root + "/")[1] + os.chdir(lint_root) + else: + for item in git("diff", "--name-status", "HEAD~1").strip().split("\n"): + status = item.split("\t") + if status[0].strip() != "D": + yield status[1] + + +def check_filename_space(path): + bname = os.path.basename(path) + if re.compile(" ").search(bname): + return [("FILENAME WHITESPACE", "Filename of %s contains white space" % path, None)] + return [] + + +def check_permission(path): + bname = os.path.basename(path) + if not re.compile('\.py$|\.sh$').search(bname): + if os.access(os.path.join(repo_root, path), os.X_OK): + return [("UNNECESSARY EXECUTABLE PERMISSION", "%s contains unnecessary executable permission" % path, None)] + return [] + + +def parse_whitelist_file(filename): + data = defaultdict(lambda:defaultdict(set)) + + with open(filename) as f: + for line in f: + line = line.strip() + if not line or line.startswith("#"): + continue + parts = [item.strip() for item in line.split(":")] + if len(parts) == 2: + parts.append(None) + else: + parts[-1] = int(parts[-1]) + + error_type, file_match, line_number = parts + data[file_match][error_type].add(line_number) + + def inner(path, errors): + whitelisted = [False for item in xrange(len(errors))] + + for file_match, whitelist_errors in data.iteritems(): + if fnmatch.fnmatch(path, file_match): + for i, (error_type, msg, line) in enumerate(errors): + if "*" in whitelist_errors: + whitelisted[i] = True + elif error_type in whitelist_errors: + allowed_lines = whitelist_errors[error_type] + if None in allowed_lines or line in allowed_lines: + whitelisted[i] = True + + return [item for i, item in enumerate(errors) if not whitelisted[i]] + return inner + + +_whitelist_fn = None +def whitelist_errors(path, errors): + global _whitelist_fn + + if _whitelist_fn is None: + _whitelist_fn = parse_whitelist_file(os.path.join(lint_root, "lint.whitelist")) + return _whitelist_fn(path, errors) + + +class Regexp(object): + pattern = None + file_extensions = None + error = None + _re = None + + def __init__(self): + self._re = re.compile(self.pattern) + + def applies(self, path): + return (self.file_extensions is None or + os.path.splitext(path)[1] in self.file_extensions) + + def search(self, line): + return self._re.search(line) + + +class TrailingWhitespaceRegexp(Regexp): + pattern = " $" + error = "TRAILING WHITESPACE" + + +class TabsRegexp(Regexp): + pattern = "^\t" + error = "INDENT TABS" + + +class CRRegexp(Regexp): + pattern = "\r$" + error = "CR AT EOL" + +regexps = [item() for item in + [TrailingWhitespaceRegexp, + TabsRegexp, + CRRegexp]] + + +def check_regexp_line(path, f): + errors = [] + + applicable_regexps = [regexp for regexp in regexps if regexp.applies(path)] + + for i, line in enumerate(f): + for regexp in applicable_regexps: + if regexp.search(line): + errors.append((regexp.error, "%s line %i" % (path, i+1), i+1)) + + return errors + + +def output_errors(errors): + for error_type, error, line_number in errors: + print "%s: %s" % (error_type, error) + + +def output_error_count(error_count): + if not error_count: + return + + by_type = " ".join("%s: %d" % item for item in error_count.iteritems()) + count = sum(error_count.values()) + if count == 1: + print "There was 1 error (%s)" % (by_type,) + else: + print "There were %d errors (%s)" % (count, by_type) + + +def main(): + global repo_root + error_count = defaultdict(int) + + parser = OptionParser() + parser.add_option('-p', '--pull', dest="pull_request", action='store_true', default=False) + parser.add_option("-d", '--dir', dest="dir", help="specify the checking dir, e.g. tools") + parser.add_option("-r", '--repo', dest="repo", help="specify the repo, e.g. WebGL") + options, args = parser.parse_args() + if options.pull_request == True: + options.pull_request = "WebGL" + repo_root = repo_root.replace("WebGL/sdk/tests", options.pull_request) + if options.repo == "" or options.repo == None: + options.repo = "WebGL/sdk/tests" + repo_root = repo_root.replace("WebGL/sdk/tests", options.repo) + + def run_lint(path, fn, *args): + errors = whitelist_errors(path, fn(path, *args)) + output_errors(errors) + for error_type, error, line in errors: + error_count[error_type] += 1 + + for path in iter_files(options.pull_request, options.dir): + abs_path = os.path.join(repo_root, path) + if not os.path.exists(abs_path): + continue + for path_fn in file_path_lints: + run_lint(path, path_fn) + for state_fn in file_state_lints: + run_lint(path, state_fn) + + if not os.path.isdir(abs_path): + if re.compile('\.html$|\.htm$|\.xhtml$|\.xhtm$|\.frag$|\.vert$|\.js$').search(abs_path): + with open(abs_path) as f: + for file_fn in file_content_lints: + run_lint(path, file_fn, f) + f.seek(0) + + output_error_count(error_count) + return sum(error_count.itervalues()) + +file_path_lints = [check_filename_space] +file_content_lints = [check_regexp_line] +file_state_lints = [check_permission] + +if __name__ == "__main__": + error_count = main() + if error_count > 0: + sys.exit(1) diff --git a/dom/canvas/test/webgl-conf/checkout/py/lint/lint.whitelist b/dom/canvas/test/webgl-conf/checkout/py/lint/lint.whitelist new file mode 100644 index 000000000..a6016d7e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/py/lint/lint.whitelist @@ -0,0 +1,46 @@ +# File containing whiteslist for lint errors +# Format is: +# ERROR TYPE:file/name/pattern[:line number] +# e.g. +# TRAILING WHITESPACE:example/file.html:128 +# to allow trailing whitespace on example/file.html line 128 + +## Whitespace rules that we can't enforce yet ## + +TRAILING WHITESPACE:*.md +TRAILING WHITESPACE:*.txt +TRAILING WHITESPACE:*.frag +TRAILING WHITESPACE:*.vert + +## Accept executable permission ## + +UNNECESSARY EXECUTABLE PERMISSION:*.cgi +UNNECESSARY EXECUTABLE PERMISSION:.git/* + +## Ignore INDENT TABS ## + +INDENT TABS:*.frag +INDENT TABS:*.vert +#The original dEQP tests used tabs throughout. +INDENT TABS:deqp/functional/gles3/*.js + +## File types that should never be checked ## + +*:*.pdf +*:*.jpg +*:*.png +*:*.gif +*:*.pdf +*:*.wav +*:*.mp3 +*:*.m4a +*:*.oga +*:*.ogv +*:*.webm +*:*.mp4 +*:*.m4v +*:*.ttf +*:*.woff +*:*.eot +*:*.sfd +*:*.swf diff --git a/dom/canvas/test/webgl-conf/checkout/py/tex_image_test_generator.py b/dom/canvas/test/webgl-conf/checkout/py/tex_image_test_generator.py new file mode 100644 index 000000000..609e878db --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/py/tex_image_test_generator.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" + Generator for tex-2d* and tex-3d* tests. + This file needs to be run in its folder. +""" + +import os +import os.path +import sys + +_LICENSE = """ + +""" + +_DO_NOT_EDIT_WARNING = """ + +""" + +_ELEMENT_TYPES = [ + 'canvas', + 'canvas-sub-rectangle', + 'image', + 'image-data', + 'svg-image', + 'video', + 'webgl-canvas', + 'image-bitmap-from-image-data', + 'image-bitmap-from-image', + 'image-bitmap-from-video', + 'image-bitmap-from-canvas', + 'image-bitmap-from-blob', + 'image-bitmap-from-image-bitmap' +] + +_FORMATS_TYPES_WEBGL1 = [ + {'internal_format': 'RGB', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGB', 'format': 'RGB', 'type': 'UNSIGNED_SHORT_5_6_5' }, + {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_4_4_4_4' }, + {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_5_5_5_1' }, +] + +_FORMATS_TYPES_WEBGL2 = [ + {'internal_format': 'R8', 'format': 'RED', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'R16F', 'format': 'RED', 'type': 'HALF_FLOAT' }, + {'internal_format': 'R16F', 'format': 'RED', 'type': 'FLOAT' }, + {'internal_format': 'R32F', 'format': 'RED', 'type': 'FLOAT' }, + {'internal_format': 'R8UI', 'format': 'RED_INTEGER', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RG8', 'format': 'RG', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RG16F', 'format': 'RG', 'type': 'HALF_FLOAT' }, + {'internal_format': 'RG16F', 'format': 'RG', 'type': 'FLOAT' }, + {'internal_format': 'RG32F', 'format': 'RG', 'type': 'FLOAT' }, + {'internal_format': 'RG8UI', 'format': 'RG_INTEGER', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGB8', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'SRGB8', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGB565', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGB565', 'format': 'RGB', 'type': 'UNSIGNED_SHORT_5_6_5' }, + {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'UNSIGNED_INT_10F_11F_11F_REV' }, + {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'HALF_FLOAT' }, + {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'FLOAT' }, + {'internal_format': 'RGB9_E5', 'format': 'RGB', 'type': 'HALF_FLOAT' }, + {'internal_format': 'RGB9_E5', 'format': 'RGB', 'type': 'FLOAT' }, + {'internal_format': 'RGB16F', 'format': 'RGB', 'type': 'HALF_FLOAT' }, + {'internal_format': 'RGB16F', 'format': 'RGB', 'type': 'FLOAT' }, + {'internal_format': 'RGB32F', 'format': 'RGB', 'type': 'FLOAT' }, + {'internal_format': 'RGB8UI', 'format': 'RGB_INTEGER', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGBA8', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'SRGB8_ALPHA8', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGB5_A1', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGB5_A1', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_5_5_5_1' }, + {'internal_format': 'RGBA4', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' }, + {'internal_format': 'RGBA4', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_4_4_4_4' }, + {'internal_format': 'RGBA16F', 'format': 'RGBA', 'type': 'HALF_FLOAT' }, + {'internal_format': 'RGBA16F', 'format': 'RGBA', 'type': 'FLOAT' }, + {'internal_format': 'RGBA32F', 'format': 'RGBA', 'type': 'FLOAT' }, + {'internal_format': 'RGBA8UI', 'format': 'RGBA_INTEGER', 'type': 'UNSIGNED_BYTE' }, +] + +def GenerateFilename(dimension, element_type, internal_format, format, type): + """Generate test filename.""" + filename = ("tex-" + dimension + "d-" + + internal_format + "-" + format + "-" + type + ".html") + return filename.lower() + +def WriteTest(filename, dimension, element_type, internal_format, format, type, default_context_version): + """Write one test.""" + file = open(filename, "wb") + file.write(_LICENSE) + file.write(_DO_NOT_EDIT_WARNING) + code = """ + + + + + + + +""" + if element_type == 'image-bitmap-from-image-data' or element_type == 'image-bitmap-from-image' or \ + element_type == 'image-bitmap-from-video' or element_type == 'image-bitmap-from-canvas' or \ + element_type == 'image-bitmap-from-blob' or element_type == 'image-bitmap-from-image-bitmap': + code += """ +""" + code += """ + + +""" + if element_type == 'image-data': + code += """ +""" + code += """ +""" + code += """ +
+
+ + + +""" + file.write(code % { + 'dimension': dimension, + 'element_type': element_type, + 'internal_format': internal_format, + 'format': format, + 'type': type, + 'default_context_version': default_context_version, + }) + file.close() + +def GenerateTests(test_dir, test_cases, dimension, default_context_version): + test_dir_template = test_dir + '/%s' + for element_type in _ELEMENT_TYPES: + os.chdir(test_dir_template % element_type.replace('-', '_')) + if dimension == '3': + # Assume we write 2D tests first. + index_file = open("00_test_list.txt", "ab") + else: + index_file = open("00_test_list.txt", "wb") + for tex_info in test_cases: + internal_format = tex_info['internal_format'] + format = tex_info['format'] + type = tex_info['type'] + filename = GenerateFilename(dimension, element_type, internal_format, format, type) + index_file.write(filename) + index_file.write('\n') + WriteTest(filename, dimension, element_type, internal_format, format, type, default_context_version) + index_file.close(); + +def main(argv): + """This is the main function.""" + py_dir = os.path.dirname(os.path.realpath(__file__)) + GenerateTests(os.path.realpath(py_dir + '/../conformance/textures'), _FORMATS_TYPES_WEBGL1, '2', '1') + GenerateTests(os.path.realpath(py_dir + '/../conformance2/textures'), _FORMATS_TYPES_WEBGL2, '2', '2') + GenerateTests(os.path.realpath(py_dir + '/../conformance2/textures'), _FORMATS_TYPES_WEBGL2, '3', '2') + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/dom/canvas/test/webgl-conf/checkout/resources/1-channel.jpg b/dom/canvas/test/webgl-conf/checkout/resources/1-channel.jpg new file mode 100644 index 000000000..2b16f42ab Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/1-channel.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/3x3.png b/dom/canvas/test/webgl-conf/checkout/resources/3x3.png new file mode 100644 index 000000000..6cf1e7447 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/3x3.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/blue-1x1.jpg b/dom/canvas/test/webgl-conf/checkout/resources/blue-1x1.jpg new file mode 100644 index 000000000..a70bbb021 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/blue-1x1.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/boolUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/boolUniformShader.vert new file mode 100644 index 000000000..9226b3b5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/boolUniformShader.vert @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2009 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +uniform bool bval; +uniform bvec2 bval2; +uniform bvec3 bval3; +uniform bvec4 bval4; + +void main() +{ + bool allSet = bval + && bval2[0] && bval2[1] + && bval3[0] && bval3[1] && bval3[2] + && bval4[0] && bval4[1] && bval4[2] && bval4[3]; + gl_Position = vec4((allSet ? 1.0 : -1.0), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/bug-32888-texture.png b/dom/canvas/test/webgl-conf/checkout/resources/bug-32888-texture.png new file mode 100644 index 000000000..e78cfe799 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/bug-32888-texture.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/floatUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/floatUniformShader.vert new file mode 100644 index 000000000..58991b474 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/floatUniformShader.vert @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2009 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +uniform float fval; +uniform vec2 fval2; +uniform vec3 fval3; +uniform vec4 fval4; + +void main() +{ + float sum = fval + + fval2[0] + fval2[1] + + fval3[0] + fval3[1] + fval3[2] + + fval4[0] + fval4[1] + fval4[2] + fval4[3]; + gl_Position = vec4(sum, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/fragmentShader.frag b/dom/canvas/test/webgl-conf/checkout/resources/fragmentShader.frag new file mode 100644 index 000000000..08596ed5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/fragmentShader.frag @@ -0,0 +1,32 @@ +/* +Copyright (C) 2009 Apple Computer, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. AS IS AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// Workaround for non-compliant WebGL implementations (FIXME) +varying mediump vec3 v_normal; + +void main() +{ + gl_FragColor = vec4(v_normal/2.0+vec3(0.5), 1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/glsl-feature-tests.css b/dom/canvas/test/webgl-conf/checkout/resources/glsl-feature-tests.css new file mode 100644 index 000000000..c8063d92b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/glsl-feature-tests.css @@ -0,0 +1,29 @@ +canvas { + background-color: white; + background-image: linear-gradient(0, rgba(200, 200, 200, .5) 50%, transparent 50%), linear-gradient(rgba(200, 200, 200, .5) 50%, transparent 50%); + background-size: 8px 8px; +} + +.shader-source { + border: 1px dashed black; + padding: 1em; +} + +.shader-source li:nth-child(odd) { background: #f8f8f8; } +.shader-source li:nth-child(even) { background: #f0f0f0; } + +.testimages { +} + +.testimages br { + clear: both; +} + +.testimages > div { + float: left; + margin: 1em; +} + +IMG { + border: 1px solid black; +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/glsl-generator.js b/dom/canvas/test/webgl-conf/checkout/resources/glsl-generator.js new file mode 100644 index 000000000..dbb97eb02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/glsl-generator.js @@ -0,0 +1,1251 @@ +/* +** 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. +*/ +GLSLGenerator = (function() { + +var vertexShaderTemplate = [ + "attribute vec4 aPosition;", + "", + "varying vec4 vColor;", + "", + "$(extra)", + "$(emu)", + "", + "void main()", + "{", + " gl_Position = aPosition;", + " vec2 texcoord = vec2(aPosition.xy * 0.5 + vec2(0.5, 0.5));", + " vec4 color = vec4(", + " texcoord,", + " texcoord.x * texcoord.y,", + " (1.0 - texcoord.x) * texcoord.y * 0.5 + 0.5);", + " $(test)", + "}" +].join("\n"); + +var fragmentShaderTemplate = [ + "precision mediump float;", + "", + "varying vec4 vColor;", + "", + "$(extra)", + "$(emu)", + "", + "void main()", + "{", + " $(test)", + "}" +].join("\n"); + +var baseVertexShader = [ + "attribute vec4 aPosition;", + "", + "varying vec4 vColor;", + "", + "void main()", + "{", + " gl_Position = aPosition;", + " vec2 texcoord = vec2(aPosition.xy * 0.5 + vec2(0.5, 0.5));", + " vColor = vec4(", + " texcoord,", + " texcoord.x * texcoord.y,", + " (1.0 - texcoord.x) * texcoord.y * 0.5 + 0.5);", + "}" +].join("\n"); + +var baseVertexShaderWithColor = [ + "attribute vec4 aPosition;", + "attribute vec4 aColor;", + "", + "varying vec4 vColor;", + "", + "void main()", + "{", + " gl_Position = aPosition;", + " vColor = aColor;", + "}" +].join("\n"); + +var baseFragmentShader = [ + "precision mediump float;", + "varying vec4 vColor;", + "", + "void main()", + "{", + " gl_FragColor = vColor;", + "}" +].join("\n"); + +var types = [ + { type: "float", + code: [ + "float $(func)_emu($(args)) {", + " return $(func)_base($(baseArgs));", + "}"].join("\n") + }, + { type: "vec2", + code: [ + "vec2 $(func)_emu($(args)) {", + " return vec2(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)));", + "}"].join("\n") + }, + { type: "vec3", + code: [ + "vec3 $(func)_emu($(args)) {", + " return vec3(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)));", + "}"].join("\n") + }, + { type: "vec4", + code: [ + "vec4 $(func)_emu($(args)) {", + " return vec4(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)),", + " $(func)_base($(baseArgsW)));", + "}"].join("\n") + } +]; + +var bvecTypes = [ + { type: "bvec2", + code: [ + "bvec2 $(func)_emu($(args)) {", + " return bvec2(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)));", + "}"].join("\n") + }, + { type: "bvec3", + code: [ + "bvec3 $(func)_emu($(args)) {", + " return bvec3(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)));", + "}"].join("\n") + }, + { type: "bvec4", + code: [ + "vec4 $(func)_emu($(args)) {", + " return bvec4(", + " $(func)_base($(baseArgsX)),", + " $(func)_base($(baseArgsY)),", + " $(func)_base($(baseArgsZ)),", + " $(func)_base($(baseArgsW)));", + "}"].join("\n") + } +]; + +var replaceRE = /\$\((\w+)\)/g; + +var replaceParams = function(str) { + var args = arguments; + return str.replace(replaceRE, function(str, p1, offset, s) { + for (var ii = 1; ii < args.length; ++ii) { + if (args[ii][p1] !== undefined) { + return args[ii][p1]; + } + } + throw "unknown string param '" + p1 + "'"; + }); +}; + +var generateReferenceShader = function( + shaderInfo, template, params, typeInfo, test) { + var input = shaderInfo.input; + var output = shaderInfo.output; + var feature = params.feature; + var testFunc = params.testFunc; + var emuFunc = params.emuFunc || ""; + var extra = params.extra || ''; + var args = params.args || "$(type) value"; + var type = typeInfo.type; + var typeCode = typeInfo.code; + + var baseArgs = params.baseArgs || "value$(field)"; + var baseArgsX = replaceParams(baseArgs, {field: ".x"}); + var baseArgsY = replaceParams(baseArgs, {field: ".y"}); + var baseArgsZ = replaceParams(baseArgs, {field: ".z"}); + var baseArgsW = replaceParams(baseArgs, {field: ".w"}); + var baseArgs = replaceParams(baseArgs, {field: ""}); + + test = replaceParams(test, { + input: input, + output: output, + func: feature + "_emu" + }); + emuFunc = replaceParams(emuFunc, { + func: feature + }); + args = replaceParams(args, { + type: type + }); + typeCode = replaceParams(typeCode, { + func: feature, + type: type, + args: args, + baseArgs: baseArgs, + baseArgsX: baseArgsX, + baseArgsY: baseArgsY, + baseArgsZ: baseArgsZ, + baseArgsW: baseArgsW + }); + var shader = replaceParams(template, { + extra: extra, + emu: emuFunc + "\n\n" + typeCode, + test: test + }); + return shader; +}; + +var generateTestShader = function( + shaderInfo, template, params, test) { + var input = shaderInfo.input; + var output = shaderInfo.output; + var feature = params.feature; + var testFunc = params.testFunc; + var extra = params.extra || ''; + + test = replaceParams(test, { + input: input, + output: output, + func: feature + }); + var shader = replaceParams(template, { + extra: extra, + emu: '', + test: test + }); + return shader; +}; + +function _reportResults(refData, refImg, testData, testImg, tolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv) { + var same = true; + var firstFailure = null; + for (var yy = 0; yy < height; ++yy) { + for (var xx = 0; xx < width; ++xx) { + var offset = (yy * width + xx) * 4; + var imgOffset = ((height - yy - 1) * width + xx) * 4; + imgData.data[imgOffset + 0] = 0; + imgData.data[imgOffset + 1] = 0; + imgData.data[imgOffset + 2] = 0; + imgData.data[imgOffset + 3] = 255; + if (Math.abs(refData[offset + 0] - testData[offset + 0]) > tolerance || + Math.abs(refData[offset + 1] - testData[offset + 1]) > tolerance || + Math.abs(refData[offset + 2] - testData[offset + 2]) > tolerance || + Math.abs(refData[offset + 3] - testData[offset + 3]) > tolerance) { + var detail = 'at (' + xx + ',' + yy + '): ref=(' + + refData[offset + 0] + ',' + + refData[offset + 1] + ',' + + refData[offset + 2] + ',' + + refData[offset + 3] + ') test=(' + + testData[offset + 0] + ',' + + testData[offset + 1] + ',' + + testData[offset + 2] + ',' + + testData[offset + 3] + ') tolerance=' + tolerance; + consoleDiv.appendChild(document.createTextNode(detail)); + consoleDiv.appendChild(document.createElement('br')); + if (!firstFailure) { + firstFailure = ": " + detail; + } + imgData.data[imgOffset] = 255; + same = false; + } + } + } + + var diffImg = null; + if (!same) { + ctx.putImageData(imgData, 0, 0); + diffImg = wtu.makeImageFromCanvas(canvas2d); + } + + var div = document.createElement("div"); + div.className = "testimages"; + wtu.insertImage(div, "ref", refImg); + wtu.insertImage(div, "test", testImg); + if (diffImg) { + wtu.insertImage(div, "diff", diffImg); + } + div.appendChild(document.createElement('br')); + + consoleDiv.appendChild(div); + + if (!same) { + testFailed("images are different" + (firstFailure ? firstFailure : "")); + } else { + testPassed("images are the same"); + } + + consoleDiv.appendChild(document.createElement('hr')); +} + +var runFeatureTest = function(params) { + var wtu = WebGLTestUtils; + var gridRes = params.gridRes; + var vertexTolerance = params.tolerance || 0; + var fragmentTolerance = params.tolerance || 1; + if ('fragmentTolerance' in params) + fragmentTolerance = params.fragmentTolerance; + + description("Testing GLSL feature: " + params.feature); + + var width = 32; + var height = 32; + + var consoleDiv = document.getElementById("console"); + var canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + var gl = wtu.create3DContext(canvas, { premultipliedAlpha: false }); + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + var canvas2d = document.createElement('canvas'); + canvas2d.width = width; + canvas2d.height = height; + var ctx = canvas2d.getContext("2d"); + var imgData = ctx.getImageData(0, 0, width, height); + + var shaderInfos = [ + { type: "vertex", + input: "color", + output: "vColor", + vertexShaderTemplate: vertexShaderTemplate, + fragmentShaderTemplate: baseFragmentShader, + tolerance: vertexTolerance + }, + { type: "fragment", + input: "vColor", + output: "gl_FragColor", + vertexShaderTemplate: baseVertexShader, + fragmentShaderTemplate: fragmentShaderTemplate, + tolerance: fragmentTolerance + } + ]; + for (var ss = 0; ss < shaderInfos.length; ++ss) { + var shaderInfo = shaderInfos[ss]; + var tests = params.tests; + var testTypes = params.emuFuncs || (params.bvecTest ? bvecTypes : types); + // Test vertex shaders + for (var ii = 0; ii < tests.length; ++ii) { + var type = testTypes[ii]; + if (params.simpleEmu) { + type = { + type: type.type, + code: params.simpleEmu + }; + } + debug(""); + var str = replaceParams(params.testFunc, { + func: params.feature, + type: type.type, + arg0: type.type + }); + var passMsg = "Testing: " + str + " in " + shaderInfo.type + " shader"; + debug(passMsg); + + var referenceVertexShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + type, + tests[ii]); + var referenceFragmentShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + type, + tests[ii]); + var testVertexShaderSource = generateTestShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + tests[ii]); + var testFragmentShaderSource = generateTestShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + tests[ii]); + + + debug(""); + var referenceVertexShader = wtu.loadShader(gl, referenceVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'reference'); + var referenceFragmentShader = wtu.loadShader(gl, referenceFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'reference'); + var testVertexShader = wtu.loadShader(gl, testVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'test'); + var testFragmentShader = wtu.loadShader(gl, testFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'test'); + debug(""); + + if (parseInt(wtu.getUrlOptions().dumpShaders)) { + var vRefInfo = { + shader: referenceVertexShader, + shaderSuccess: true, + label: "reference vertex shader", + source: referenceVertexShaderSource + }; + var fRefInfo = { + shader: referenceFragmentShader, + shaderSuccess: true, + label: "reference fragment shader", + source: referenceFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vRefInfo, fRefInfo); + + var vTestInfo = { + shader: testVertexShader, + shaderSuccess: true, + label: "test vertex shader", + source: testVertexShaderSource + }; + var fTestInfo = { + shader: testFragmentShader, + shaderSuccess: true, + label: "test fragment shader", + source: testFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vTestInfo, fTestInfo); + } + + var refData = draw( + referenceVertexShader, referenceFragmentShader); + var refImg = wtu.makeImageFromCanvas(canvas); + if (ss == 0) { + var testData = draw( + testVertexShader, referenceFragmentShader); + } else { + var testData = draw( + referenceVertexShader, testFragmentShader); + } + var testImg = wtu.makeImageFromCanvas(canvas); + + _reportResults(refData, refImg, testData, testImg, shaderInfo.tolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv); + } + } + + finishTest(); + + function draw(vertexShader, fragmentShader) { + var program = wtu.createProgram(gl, vertexShader, fragmentShader, testFailed); + + var posLoc = gl.getAttribLocation(program, "aPosition"); + wtu.setupIndexedQuad(gl, gridRes, posLoc); + + gl.useProgram(program); + wtu.clearAndDrawIndexedQuad(gl, gridRes, [0, 0, 255, 255]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + +}; + +var runBasicTest = function(params) { + var wtu = WebGLTestUtils; + var gridRes = params.gridRes; + var vertexTolerance = params.tolerance || 0; + var fragmentTolerance = vertexTolerance; + if ('fragmentTolerance' in params) + fragmentTolerance = params.fragmentTolerance || 0; + + description("Testing : " + document.getElementsByTagName("title")[0].innerText); + + var width = 32; + var height = 32; + + var consoleDiv = document.getElementById("console"); + var canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + var gl = wtu.create3DContext(canvas); + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + var canvas2d = document.createElement('canvas'); + canvas2d.width = width; + canvas2d.height = height; + var ctx = canvas2d.getContext("2d"); + var imgData = ctx.getImageData(0, 0, width, height); + + var shaderInfos = [ + { type: "vertex", + input: "color", + output: "vColor", + vertexShaderTemplate: vertexShaderTemplate, + fragmentShaderTemplate: baseFragmentShader, + tolerance: vertexTolerance + }, + { type: "fragment", + input: "vColor", + output: "gl_FragColor", + vertexShaderTemplate: baseVertexShader, + fragmentShaderTemplate: fragmentShaderTemplate, + tolerance: fragmentTolerance + } + ]; + for (var ss = 0; ss < shaderInfos.length; ++ss) { + var shaderInfo = shaderInfos[ss]; + var tests = params.tests; +// var testTypes = params.emuFuncs || (params.bvecTest ? bvecTypes : types); + // Test vertex shaders + for (var ii = 0; ii < tests.length; ++ii) { + var test = tests[ii]; + debug(""); + var passMsg = "Testing: " + test.name + " in " + shaderInfo.type + " shader"; + debug(passMsg); + + function genShader(shaderInfo, template, shader, subs) { + shader = replaceParams(shader, subs, { + input: shaderInfo.input, + output: shaderInfo.output + }); + shader = replaceParams(template, subs, { + test: shader, + emu: "", + extra: "" + }); + return shader; + } + + var referenceVertexShaderSource = genShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + test.reference.shader, + test.reference.subs); + var referenceFragmentShaderSource = genShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + test.reference.shader, + test.reference.subs); + var testVertexShaderSource = genShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + test.test.shader, + test.test.subs); + var testFragmentShaderSource = genShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + test.test.shader, + test.test.subs); + + debug(""); + var referenceVertexShader = wtu.loadShader(gl, referenceVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'reference'); + var referenceFragmentShader = wtu.loadShader(gl, referenceFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'reference'); + var testVertexShader = wtu.loadShader(gl, testVertexShaderSource, gl.VERTEX_SHADER, testFailed, true, 'test'); + var testFragmentShader = wtu.loadShader(gl, testFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true, 'test'); + debug(""); + + if (parseInt(wtu.getUrlOptions().dumpShaders)) { + var vRefInfo = { + shader: referenceVertexShader, + shaderSuccess: true, + label: "reference vertex shader", + source: referenceVertexShaderSource + }; + var fRefInfo = { + shader: referenceFragmentShader, + shaderSuccess: true, + label: "reference fragment shader", + source: referenceFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vRefInfo, fRefInfo); + + var vTestInfo = { + shader: testVertexShader, + shaderSuccess: true, + label: "test vertex shader", + source: testVertexShaderSource + }; + var fTestInfo = { + shader: testFragmentShader, + shaderSuccess: true, + label: "test fragment shader", + source: testFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vTestInfo, fTestInfo); + } + + var refData = draw(referenceVertexShader, referenceFragmentShader); + var refImg = wtu.makeImageFromCanvas(canvas); + if (ss == 0) { + var testData = draw(testVertexShader, referenceFragmentShader); + } else { + var testData = draw(referenceVertexShader, testFragmentShader); + } + var testImg = wtu.makeImageFromCanvas(canvas); + + _reportResults(refData, refImg, testData, testImg, shaderInfo.tolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv); + } + } + + finishTest(); + + function draw(vertexShader, fragmentShader) { + var program = wtu.createProgram(gl, vertexShader, fragmentShader, testFailed); + + var posLoc = gl.getAttribLocation(program, "aPosition"); + wtu.setupIndexedQuad(gl, gridRes, posLoc); + + gl.useProgram(program); + wtu.clearAndDrawIndexedQuad(gl, gridRes, [0, 0, 255, 255]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + +}; + +var runReferenceImageTest = function(params) { + var wtu = WebGLTestUtils; + var gridRes = params.gridRes; + var vertexTolerance = params.tolerance || 0; + var fragmentTolerance = vertexTolerance; + if ('fragmentTolerance' in params) + fragmentTolerance = params.fragmentTolerance || 0; + + description("Testing GLSL feature: " + params.feature); + + var width = 32; + var height = 32; + + var consoleDiv = document.getElementById("console"); + var canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + var gl = wtu.create3DContext(canvas, { antialias: false, premultipliedAlpha: false }); + if (!gl) { + testFailed("context does not exist"); + finishTest(); + return; + } + + var canvas2d = document.createElement('canvas'); + canvas2d.width = width; + canvas2d.height = height; + var ctx = canvas2d.getContext("2d"); + var imgData = ctx.getImageData(0, 0, width, height); + + // State for reference images for vertex shader tests. + // These are drawn with the same tessellated grid as the test vertex + // shader so that the interpolation is identical. The grid is reused + // from test to test; the colors are changed. + + var indexedQuadForReferenceVertexShader = + wtu.setupIndexedQuad(gl, gridRes, 0); + var referenceVertexShaderProgram = + wtu.setupProgram(gl, [ baseVertexShaderWithColor, baseFragmentShader ], + ["aPosition", "aColor"]); + var referenceVertexShaderColorBuffer = gl.createBuffer(); + + var shaderInfos = [ + { type: "vertex", + input: "color", + output: "vColor", + vertexShaderTemplate: vertexShaderTemplate, + fragmentShaderTemplate: baseFragmentShader, + tolerance: vertexTolerance + }, + { type: "fragment", + input: "vColor", + output: "gl_FragColor", + vertexShaderTemplate: baseVertexShader, + fragmentShaderTemplate: fragmentShaderTemplate, + tolerance: fragmentTolerance + } + ]; + for (var ss = 0; ss < shaderInfos.length; ++ss) { + var shaderInfo = shaderInfos[ss]; + var tests = params.tests; + var testTypes = params.emuFuncs || (params.bvecTest ? bvecTypes : types); + // Test vertex shaders + for (var ii = 0; ii < tests.length; ++ii) { + var type = testTypes[ii]; + var isVertex = (ss == 0); + debug(""); + var str = replaceParams(params.testFunc, { + func: params.feature, + type: type.type, + arg0: type.type + }); + var passMsg = "Testing: " + str + " in " + shaderInfo.type + " shader"; + debug(passMsg); + + var referenceVertexShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + type, + tests[ii].source); + var referenceFragmentShaderSource = generateReferenceShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + type, + tests[ii].source); + var testVertexShaderSource = generateTestShader( + shaderInfo, + shaderInfo.vertexShaderTemplate, + params, + tests[ii].source); + var testFragmentShaderSource = generateTestShader( + shaderInfo, + shaderInfo.fragmentShaderTemplate, + params, + tests[ii].source); + var referenceTextureOrArray = generateReferenceImage( + gl, + tests[ii].generator, + isVertex ? gridRes : width, + isVertex ? gridRes : height, + isVertex); + + debug(""); + var testVertexShader = wtu.loadShader(gl, testVertexShaderSource, gl.VERTEX_SHADER, testFailed, true); + var testFragmentShader = wtu.loadShader(gl, testFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed, true); + debug(""); + + + if (parseInt(wtu.getUrlOptions().dumpShaders)) { + var vRefInfo = { + shader: referenceVertexShader, + shaderSuccess: true, + label: "reference vertex shader", + source: referenceVertexShaderSource + }; + var fRefInfo = { + shader: referenceFragmentShader, + shaderSuccess: true, + label: "reference fragment shader", + source: referenceFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vRefInfo, fRefInfo); + + var vTestInfo = { + shader: testVertexShader, + shaderSuccess: true, + label: "test vertex shader", + source: testVertexShaderSource + }; + var fTestInfo = { + shader: testFragmentShader, + shaderSuccess: true, + label: "test fragment shader", + source: testFragmentShaderSource + }; + wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vTestInfo, fTestInfo); + } + + var refData; + if (isVertex) { + refData = drawVertexReferenceImage(referenceTextureOrArray); + } else { + refData = drawFragmentReferenceImage(referenceTextureOrArray); + } + var refImg = wtu.makeImageFromCanvas(canvas); + var testData; + if (isVertex) { + var referenceFragmentShader = wtu.loadShader(gl, referenceFragmentShaderSource, gl.FRAGMENT_SHADER, testFailed); + testData = draw( + testVertexShader, referenceFragmentShader); + } else { + var referenceVertexShader = wtu.loadShader(gl, referenceVertexShaderSource, gl.VERTEX_SHADER, testFailed); + testData = draw( + referenceVertexShader, testFragmentShader); + } + var testImg = wtu.makeImageFromCanvas(canvas); + var testTolerance = shaderInfo.tolerance; + // Provide per-test tolerance so that we can increase it only for those desired. + if ('tolerance' in tests[ii]) + testTolerance = tests[ii].tolerance || 0; + _reportResults(refData, refImg, testData, testImg, testTolerance, + width, height, ctx, imgData, wtu, canvas2d, consoleDiv); + } + } + + finishTest(); + + function draw(vertexShader, fragmentShader) { + var program = wtu.createProgram(gl, vertexShader, fragmentShader, testFailed); + + var posLoc = gl.getAttribLocation(program, "aPosition"); + wtu.setupIndexedQuad(gl, gridRes, posLoc); + + gl.useProgram(program); + wtu.clearAndDrawIndexedQuad(gl, gridRes, [0, 0, 255, 255]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + + function drawVertexReferenceImage(colors) { + gl.bindBuffer(gl.ARRAY_BUFFER, indexedQuadForReferenceVertexShader[0]); + gl.enableVertexAttribArray(0); + gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); + gl.bindBuffer(gl.ARRAY_BUFFER, referenceVertexShaderColorBuffer); + gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); + gl.enableVertexAttribArray(1); + gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, 0); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexedQuadForReferenceVertexShader[1]); + gl.useProgram(referenceVertexShaderProgram); + wtu.clearAndDrawIndexedQuad(gl, gridRes); + gl.disableVertexAttribArray(0); + gl.disableVertexAttribArray(1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + + function drawFragmentReferenceImage(texture) { + var program = wtu.setupTexturedQuad(gl); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, texture); + var texLoc = gl.getUniformLocation(program, "tex"); + gl.uniform1i(texLoc, 0); + wtu.clearAndDrawUnitQuad(gl); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw"); + + var img = new Uint8Array(width * height * 4); + gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img); + return img; + } + + /** + * Creates and returns either a Uint8Array (for vertex shaders) or + * WebGLTexture (for fragment shaders) containing the reference + * image for the function being tested. Exactly how the function is + * evaluated, and the size of the returned texture or array, depends on + * whether we are testing a vertex or fragment shader. If a fragment + * shader, the function is evaluated at the pixel centers. If a + * vertex shader, the function is evaluated at the triangle's + * vertices. + * + * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use to generate texture objects. + * @param {!function(number,number,number,number): !Array.} generator The reference image generator function. + * @param {number} width The width of the texture to generate if testing a fragment shader; the grid resolution if testing a vertex shader. + * @param {number} height The height of the texture to generate if testing a fragment shader; the grid resolution if testing a vertex shader. + * @param {boolean} isVertex True if generating a reference image for a vertex shader; false if for a fragment shader. + * @return {!WebGLTexture|!Uint8Array} The texture object or array that was generated. + */ + function generateReferenceImage( + gl, + generator, + width, + height, + isVertex) { + + // Note: the math in this function must match that in the vertex and + // fragment shader templates above. + function computeTexCoord(x) { + return x * 0.5 + 0.5; + } + + function computeVertexColor(texCoordX, texCoordY) { + return [ texCoordX, + texCoordY, + texCoordX * texCoordY, + (1.0 - texCoordX) * texCoordY * 0.5 + 0.5 ]; + } + + /** + * Computes fragment color according to the algorithm used for interpolation + * in OpenGL (GLES 2.0 spec 3.5.1, OpenGL 4.3 spec 14.6.1). + */ + function computeInterpolatedColor(texCoordX, texCoordY) { + // Calculate grid line indexes below and to the left from texCoord. + var gridBottom = Math.floor(texCoordY * gridRes); + if (gridBottom == gridRes) { + --gridBottom; + } + var gridLeft = Math.floor(texCoordX * gridRes); + if (gridLeft == gridRes) { + --gridLeft; + } + + // Calculate coordinates relative to the grid cell. + var cellX = texCoordX * gridRes - gridLeft; + var cellY = texCoordY * gridRes - gridBottom; + + // Barycentric coordinates inside either triangle ACD or ABC + // are used as weights for the vertex colors in the corners: + // A--B + // |\ | + // | \| + // D--C + + var aColor = computeVertexColor(gridLeft / gridRes, (gridBottom + 1) / gridRes); + var bColor = computeVertexColor((gridLeft + 1) / gridRes, (gridBottom + 1) / gridRes); + var cColor = computeVertexColor((gridLeft + 1) / gridRes, gridBottom / gridRes); + var dColor = computeVertexColor(gridLeft / gridRes, gridBottom / gridRes); + + // Calculate weights. + var a, b, c, d; + + if (cellX + cellY < 1) { + // In bottom triangle ACD. + a = cellY; // area of triangle C-D-(cellX, cellY) relative to ACD + c = cellX; // area of triangle D-A-(cellX, cellY) relative to ACD + d = 1 - a - c; + b = 0; + } else { + // In top triangle ABC. + a = 1 - cellX; // area of the triangle B-C-(cellX, cellY) relative to ABC + c = 1 - cellY; // area of the triangle A-B-(cellX, cellY) relative to ABC + b = 1 - a - c; + d = 0; + } + + var interpolated = []; + for (var ii = 0; ii < aColor.length; ++ii) { + interpolated.push(a * aColor[ii] + b * bColor[ii] + c * cColor[ii] + d * dColor[ii]); + } + return interpolated; + } + + function clamp(value, minVal, maxVal) { + return Math.max(minVal, Math.min(value, maxVal)); + } + + // Evaluates the function at clip coordinates (px,py), storing the + // result in the array "pixel". Each channel's result is clamped + // between 0 and 255. + function evaluateAtClipCoords(px, py, pixel, colorFunc) { + var tcx = computeTexCoord(px); + var tcy = computeTexCoord(py); + + var color = colorFunc(tcx, tcy); + + var output = generator(color[0], color[1], color[2], color[3]); + + // Multiply by 256 to get even distribution for all values between 0 and 1. + // Use rounding rather than truncation to more closely match the GPU's behavior. + pixel[0] = clamp(Math.round(256 * output[0]), 0, 255); + pixel[1] = clamp(Math.round(256 * output[1]), 0, 255); + pixel[2] = clamp(Math.round(256 * output[2]), 0, 255); + pixel[3] = clamp(Math.round(256 * output[3]), 0, 255); + } + + function generateFragmentReference() { + var data = new Uint8Array(4 * width * height); + + var horizTexel = 1.0 / width; + var vertTexel = 1.0 / height; + var halfHorizTexel = 0.5 * horizTexel; + var halfVertTexel = 0.5 * vertTexel; + + var pixel = new Array(4); + + for (var yi = 0; yi < height; ++yi) { + for (var xi = 0; xi < width; ++xi) { + // The function must be evaluated at pixel centers. + + // Compute desired position in clip space + var px = -1.0 + 2.0 * (halfHorizTexel + xi * horizTexel); + var py = -1.0 + 2.0 * (halfVertTexel + yi * vertTexel); + + evaluateAtClipCoords(px, py, pixel, computeInterpolatedColor); + var index = 4 * (width * yi + xi); + data[index + 0] = pixel[0]; + data[index + 1] = pixel[1]; + data[index + 2] = pixel[2]; + data[index + 3] = pixel[3]; + } + } + + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + 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.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, + gl.RGBA, gl.UNSIGNED_BYTE, data); + return texture; + } + + function generateVertexReference() { + // We generate a Uint8Array which contains the evaluation of the + // function at the vertices of the triangle mesh. It is expected + // that the width and the height are identical, and equivalent + // to the grid resolution. + if (width != height) { + throw "width and height must be equal"; + } + + var texSize = 1 + width; + var data = new Uint8Array(4 * texSize * texSize); + + var step = 2.0 / width; + + var pixel = new Array(4); + + for (var yi = 0; yi < texSize; ++yi) { + for (var xi = 0; xi < texSize; ++xi) { + // The function is evaluated at the triangles' vertices. + + // Compute desired position in clip space + var px = -1.0 + (xi * step); + var py = -1.0 + (yi * step); + + evaluateAtClipCoords(px, py, pixel, computeVertexColor); + var index = 4 * (texSize * yi + xi); + data[index + 0] = pixel[0]; + data[index + 1] = pixel[1]; + data[index + 2] = pixel[2]; + data[index + 3] = pixel[3]; + } + } + + return data; + } + + //---------------------------------------------------------------------- + // Body of generateReferenceImage + // + + if (isVertex) { + return generateVertexReference(); + } else { + return generateFragmentReference(); + } + } +}; + +return { + /** + * runs a bunch of GLSL tests using the passed in parameters + * The parameters are: + * + * feature: + * the name of the function being tested (eg, sin, dot, + * normalize) + * + * testFunc: + * The prototype of function to be tested not including the + * return type. + * + * emuFunc: + * A base function that can be used to generate emulation + * functions. Example for 'ceil' + * + * float $(func)_base(float value) { + * float m = mod(value, 1.0); + * return m != 0.0 ? (value + 1.0 - m) : value; + * } + * + * args: + * The arguments to the function + * + * baseArgs: (optional) + * The arguments when a base function is used to create an + * emulation function. For example 'float sign_base(float v)' + * is used to implemenent vec2 sign_emu(vec2 v). + * + * simpleEmu: + * if supplied, the code that can be used to generate all + * functions for all types. + * + * Example for 'normalize': + * + * $(type) $(func)_emu($(args)) { + * return value / length(value); + * } + * + * gridRes: (optional) + * The resolution of the mesh to generate. The default is a + * 1x1 grid but many vertex shaders need a higher resolution + * otherwise the only values passed in are the 4 corners + * which often have the same value. + * + * tests: + * The code for each test. It is assumed the tests are for + * float, vec2, vec3, vec4 in that order. + * + * tolerance: (optional) + * Allow some tolerance in the comparisons. The tolerance is applied to + * both vertex and fragment shaders. The default tolerance is 0, meaning + * the values have to be identical. + * + * fragmentTolerance: (optional) + * Specify a tolerance which only applies to fragment shaders. The + * fragment-only tolerance will override the shared tolerance for + * fragment shaders if both are specified. Fragment shaders usually + * use mediump float precision so they sometimes require higher tolerance + * than vertex shaders which use highp by default. + */ + runFeatureTest: runFeatureTest, + + /* + * Runs a bunch of GLSL tests using the passed in parameters + * + * The parameters are: + * + * tests: + * Array of tests. For each test the following parameters are expected + * + * name: + * some description of the test + * reference: + * parameters for the reference shader (see below) + * test: + * parameters for the test shader (see below) + * + * The parameter for the reference and test shaders are + * + * shader: the GLSL for the shader + * subs: any substitutions you wish to define for the shader. + * + * Each shader is created from a basic template that + * defines an input and an output. You can see the + * templates at the top of this file. The input and output + * change depending on whether or not we are generating + * a vertex or fragment shader. + * + * All this code function does is a bunch of string substitutions. + * A substitution is defined by $(name). If name is found in + * the 'subs' parameter it is replaced. 4 special names exist. + * + * 'input' the input to your GLSL. Always a vec4. All change + * from 0 to 1 over the quad to be drawn. + * + * 'output' the output color. Also a vec4 + * + * 'emu' a place to insert extra stuff + * 'extra' a place to insert extra stuff. + * + * You can think of the templates like this + * + * $(extra) + * $(emu) + * + * void main() { + * // do math to calculate input + * ... + * + * $(shader) + * } + * + * Your shader first has any subs you provided applied as well + * as 'input' and 'output' + * + * It is then inserted into the template which is also provided + * with your subs. + * + * gridRes: (optional) + * The resolution of the mesh to generate. The default is a + * 1x1 grid but many vertex shaders need a higher resolution + * otherwise the only values passed in are the 4 corners + * which often have the same value. + * + * tolerance: (optional) + * Allow some tolerance in the comparisons. The tolerance is applied to + * both vertex and fragment shaders. The default tolerance is 0, meaning + * the values have to be identical. + * + * fragmentTolerance: (optional) + * Specify a tolerance which only applies to fragment shaders. The + * fragment-only tolerance will override the shared tolerance for + * fragment shaders if both are specified. Fragment shaders usually + * use mediump float precision so they sometimes require higher tolerance + * than vertex shaders which use highp. + */ + runBasicTest: runBasicTest, + + /** + * Runs a bunch of GLSL tests using the passed in parameters. The + * expected results are computed as a reference image in JavaScript + * instead of on the GPU. The parameters are: + * + * feature: + * the name of the function being tested (eg, sin, dot, + * normalize) + * + * testFunc: + * The prototype of function to be tested not including the + * return type. + * + * args: + * The arguments to the function + * + * gridRes: (optional) + * The resolution of the mesh to generate. The default is a + * 1x1 grid but many vertex shaders need a higher resolution + * otherwise the only values passed in are the 4 corners + * which often have the same value. + * + * tests: + * Array of tests. It is assumed the tests are for float, vec2, + * vec3, vec4 in that order. For each test the following + * parameters are expected: + * + * source: the GLSL source code for the tests + * + * generator: a JavaScript function taking four parameters + * which evaluates the same function as the GLSL source, + * returning its result as a newly allocated array. + * + * tolerance: (optional) a per-test tolerance. + * + * extra: (optional) + * Extra GLSL code inserted at the top of each test's shader. + * + * tolerance: (optional) + * Allow some tolerance in the comparisons. The tolerance is applied to + * both vertex and fragment shaders. The default tolerance is 0, meaning + * the values have to be identical. + * + * fragmentTolerance: (optional) + * Specify a tolerance which only applies to fragment shaders. The + * fragment-only tolerance will override the shared tolerance for + * fragment shaders if both are specified. Fragment shaders usually + * use mediump float precision so they sometimes require higher tolerance + * than vertex shaders which use highp. + */ + runReferenceImageTest: runReferenceImageTest, + + none: false +}; + +}()); + diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-1024x1024.jpg b/dom/canvas/test/webgl-conf/checkout/resources/gray-1024x1024.jpg new file mode 100644 index 000000000..e06e7f5ee Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-1024x1024.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256-with-128-alpha.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256-with-128-alpha.png new file mode 100644 index 000000000..183e55de2 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256-with-128-alpha.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256.png new file mode 100644 index 000000000..01e486b5a Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-256.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-default-gamma.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-default-gamma.png new file mode 100644 index 000000000..a5a89beb7 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-default-gamma.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma0.1.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma0.1.png new file mode 100644 index 000000000..637c792da Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma0.1.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma1.0.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma1.0.png new file mode 100644 index 000000000..40ceeb046 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma1.0.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma2.0.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma2.0.png new file mode 100644 index 000000000..73fcf7b41 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma2.0.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma4.0.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma4.0.png new file mode 100644 index 000000000..d878f1e96 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma4.0.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma9.0.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma9.0.png new file mode 100644 index 000000000..8a69ed1f3 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp-gamma9.0.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp.png b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp.png new file mode 100644 index 000000000..a5a89beb7 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/gray-ramp.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/green-2x2-16bit.png b/dom/canvas/test/webgl-conf/checkout/resources/green-2x2-16bit.png new file mode 100644 index 000000000..7fcb96960 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/green-2x2-16bit.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/intArrayUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/intArrayUniformShader.vert new file mode 100644 index 000000000..d82074e47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/intArrayUniformShader.vert @@ -0,0 +1,8 @@ +uniform int ival; +uniform int ival2[2]; + +void main() +{ + int sum = ival + ival2[0] + ival2[1]; + gl_Position = vec4(sum, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/intUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/intUniformShader.vert new file mode 100644 index 000000000..051c05e2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/intUniformShader.vert @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2009 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +uniform int ival; +uniform ivec2 ival2; +uniform ivec3 ival3; +uniform ivec4 ival4; + +void main() +{ + int sum = ival + + ival2[0] + ival2[1] + + ival3[0] + ival3[1] + ival3[2] + + ival4[0] + ival4[1] + ival4[2] + ival4[3]; + gl_Position = vec4(sum, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/js-test-style.css b/dom/canvas/test/webgl-conf/checkout/resources/js-test-style.css new file mode 100644 index 000000000..bb7d5148e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/js-test-style.css @@ -0,0 +1,17 @@ +.pass { + font-weight: bold; + color: green; +} +.fail { + font-weight: bold; + color: red; +} +.warn { + font-weight: bold; + color: yellow; + text-shadow: 1px 1px #ff0000 +} +#console { + white-space: pre-wrap; + font-family: monospace; +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/matForWebGL2UniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/matForWebGL2UniformShader.vert new file mode 100644 index 000000000..56bf75826 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/matForWebGL2UniformShader.vert @@ -0,0 +1,42 @@ +#version 300 es + +/* +** Copyright (c) 2015 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. +*/ + +uniform mat2x3 mval2x3; +uniform mat2x4 mval2x4; +uniform mat3x2 mval3x2; +uniform mat3x4 mval3x4; +uniform mat4x2 mval4x2; +uniform mat4x3 mval4x3; + +void main() +{ + + gl_Position = vec4(mval2x3 * vec2(1.0, 2.0), 0.0) + + mval2x4 * vec2(1.0, 2.0) + + vec4(mval3x2 * vec3(1.0, 2.0, 3.0), 0.0, 0.0) + + mval3x4 * vec3(1.0, 2.0, 3.0) + + vec4(mval4x2 * vec4(1.0, 2.0, 3.0, 4.0), 0.0, 0.0) + + vec4(mval4x3 * vec4(1.0, 2.0, 3.0, 4.0), 0.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/matUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/matUniformShader.vert new file mode 100644 index 000000000..123a4be03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/matUniformShader.vert @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2009 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +uniform mat2 mval2; +uniform mat3 mval3; +uniform mat4 mval4; + +void main() +{ + gl_Position = vec4(mval2 * vec2(1.0, 2.0), 0.0, 0.0) + + vec4(mval3 * vec3(1.0, 2.0, 3.0), 0.0) + + mval4 * vec4(1.0, 2.0, 3.0, 4.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.frag b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.frag new file mode 100644 index 000000000..b2dfc9f1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.frag @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2009 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +void main() +{ + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.vert new file mode 100644 index 000000000..821e440d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShader.vert @@ -0,0 +1,4 @@ +void main() +{ + gl_Position = vec4(0.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.frag b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.frag new file mode 100644 index 000000000..00af837a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.frag @@ -0,0 +1,40 @@ +#version 300 es + +/* + * Copyright (c) 2015 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +precision mediump float; + +out vec4 fragColor; + +void main() +{ + fragColor = vec4(0.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.vert b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.vert new file mode 100644 index 000000000..e213a4bb3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/noopUniformShaderES3.vert @@ -0,0 +1,6 @@ +#version 300 es + +void main() +{ + gl_Position = vec4(0.0, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/npot-video.mp4 b/dom/canvas/test/webgl-conf/checkout/resources/npot-video.mp4 new file mode 100644 index 000000000..59f5f774a Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/npot-video.mp4 differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/npot-video.theora.ogv b/dom/canvas/test/webgl-conf/checkout/resources/npot-video.theora.ogv new file mode 100644 index 000000000..4458678fb Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/npot-video.theora.ogv differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/npot-video.webmvp8.webm b/dom/canvas/test/webgl-conf/checkout/resources/npot-video.webmvp8.webm new file mode 100644 index 000000000..47277bdaa Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/npot-video.webmvp8.webm differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/ogles-tests.css b/dom/canvas/test/webgl-conf/checkout/resources/ogles-tests.css new file mode 100644 index 000000000..42269c8b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/ogles-tests.css @@ -0,0 +1,30 @@ +canvas { + background-color: white; + background-size: 8px 8px; +} + +.shader-source { + border: 1px dashed black; + padding: 1em; +} + +.shader-source li:nth-child(odd) { background: #f8f8f8; } +.shader-source li:nth-child(even) { background: #f0f0f0; } + +.testimages { +} + +.testimages br { + clear: both; +} + +.testimages > div { + float: left; + margin: 1em; +} + +IMG { + border: 1px solid black; + width: 250px; + height: 250px; +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/opengl_logo.jpg b/dom/canvas/test/webgl-conf/checkout/resources/opengl_logo.jpg new file mode 100644 index 000000000..e3b70bef3 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/opengl_logo.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.png b/dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.png new file mode 100644 index 000000000..80b2d1d42 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.psd b/dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.psd new file mode 100644 index 000000000..9cf26f941 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green-blue-cyan-4x4.psd differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green-semi-transparent.png b/dom/canvas/test/webgl-conf/checkout/resources/red-green-semi-transparent.png new file mode 100644 index 000000000..11f2928ae Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green-semi-transparent.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green.mp4 b/dom/canvas/test/webgl-conf/checkout/resources/red-green.mp4 new file mode 100644 index 000000000..4bd6d5965 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green.mp4 differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green.png b/dom/canvas/test/webgl-conf/checkout/resources/red-green.png new file mode 100644 index 000000000..605ac9ba1 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green.svg b/dom/canvas/test/webgl-conf/checkout/resources/red-green.svg new file mode 100644 index 000000000..fe4d20718 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/red-green.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green.theora.ogv b/dom/canvas/test/webgl-conf/checkout/resources/red-green.theora.ogv new file mode 100644 index 000000000..1543915a1 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green.theora.ogv differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp8.webm b/dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp8.webm new file mode 100644 index 000000000..fde59a18b Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp8.webm differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp9.webm b/dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp9.webm new file mode 100644 index 000000000..23dd3051c Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-green.webmvp9.webm differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-indexed.png b/dom/canvas/test/webgl-conf/checkout/resources/red-indexed.png new file mode 100644 index 000000000..3188d2d75 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-indexed.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/samplerForWebGL2UniformShader.frag b/dom/canvas/test/webgl-conf/checkout/resources/samplerForWebGL2UniformShader.frag new file mode 100644 index 000000000..44cf1b11a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/samplerForWebGL2UniformShader.frag @@ -0,0 +1,34 @@ +#version 300 es + +/* +** Copyright (c) 2015 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. +*/ + +precision mediump float; +uniform mediump sampler3D s3D; +uniform mediump sampler2DArray s2DArray; +out vec4 fragColor; +void main() +{ + fragColor = texture(s3D, vec3(0.5, 0.5, 0.5)) + + texture(s2DArray, vec3(0.5, 0.5, 0.5)); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/samplerUniformShader.frag b/dom/canvas/test/webgl-conf/checkout/resources/samplerUniformShader.frag new file mode 100644 index 000000000..11cba1274 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/samplerUniformShader.frag @@ -0,0 +1,8 @@ +precision mediump float; +uniform sampler2D s2D; +uniform samplerCube sCube; +void main() +{ + gl_FragColor = texture2D(s2D, vec2(0.5, 0.5)) + + textureCube(sCube, vec3(0.5, 0.5, 0.5)); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-cie-rgb-profile.png b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-cie-rgb-profile.png new file mode 100644 index 000000000..aa8bf3771 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-cie-rgb-profile.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colormatch-profile.png b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colormatch-profile.png new file mode 100644 index 000000000..63454ec0d Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colormatch-profile.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.jpg b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.jpg new file mode 100644 index 000000000..a9186968f Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.png b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.png new file mode 100644 index 000000000..592262737 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-colorspin-profile.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-e-srgb-profile.png b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-e-srgb-profile.png new file mode 100644 index 000000000..2792b0ac5 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-e-srgb-profile.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-smpte-c-profile.png b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-smpte-c-profile.png new file mode 100644 index 000000000..2904e8952 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-smpte-c-profile.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-srgb-iec61966-2.1-profile.png b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-srgb-iec61966-2.1-profile.png new file mode 100644 index 000000000..a0201f113 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/small-square-with-srgb-iec61966-2.1-profile.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/structUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/structUniformShader.vert new file mode 100644 index 000000000..59c719a00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/structUniformShader.vert @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +attribute vec4 a_vertex; +attribute vec3 a_normal; + +uniform mat4 u_modelViewProjMatrix; + +struct MyStruct +{ + int x; + int y; +}; + +uniform MyStruct u_struct; +uniform float u_array[4]; + +varying vec3 v_normal; + +void main() +{ + v_normal = a_normal; + gl_Position = u_modelViewProjMatrix * a_vertex + + vec4(u_struct.x, u_struct.y, 0, 1) + + vec4(u_array[0], u_array[1], u_array[2], u_array[3]); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/thunderbird-logo-64x64.png b/dom/canvas/test/webgl-conf/checkout/resources/thunderbird-logo-64x64.png new file mode 100644 index 000000000..e2326f551 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/thunderbird-logo-64x64.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/transparent-on-left-indexed.png b/dom/canvas/test/webgl-conf/checkout/resources/transparent-on-left-indexed.png new file mode 100644 index 000000000..2be312744 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/transparent-on-left-indexed.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/uintUniformShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/uintUniformShader.vert new file mode 100644 index 000000000..5f9501c75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/uintUniformShader.vert @@ -0,0 +1,38 @@ +#version 300 es + +/* +** Copyright (c) 2015 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. +*/ + +uniform uint uval; +uniform uvec2 uval2; +uniform uvec3 uval3; +uniform uvec4 uval4; + +void main() +{ + uint sum = uval + + uval2[0] + uval2[1] + + uval3[0] + uval3[1] + uval3[2] + + uval4[0] + uval4[1] + uval4[2] + uval4[3]; + gl_Position = vec4(sum, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.frag b/dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.frag new file mode 100644 index 000000000..8718ee86c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.frag @@ -0,0 +1,36 @@ +#version 300 es + +/* +** Copyright (c) 2015 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. +*/ + +precision mediump float; + +in vec3 normal; +in vec4 ecPosition; + +out vec4 fragColor; + +void main() +{ + fragColor = vec4(normal/2.0+vec3(0.5), 1); +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.vert new file mode 100644 index 000000000..ba02029c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/uniformBlockShader.vert @@ -0,0 +1,43 @@ +#version 300 es + +/* +** Copyright (c) 2015 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. +*/ + +in vec4 a_vertex; +in vec3 a_normal; + +uniform Transform { + mat4 u_modelViewMatrix; + mat4 u_projectionMatrix; + mat3 u_normalMatrix; +}; + +out vec3 normal; +out vec4 ecPosition; + +void main() +{ + normal = normalize(u_normalMatrix * a_normal); + ecPosition = u_modelViewMatrix * a_vertex; + gl_Position = u_projectionMatrix * ecPosition; +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/vertexShader.vert b/dom/canvas/test/webgl-conf/checkout/resources/vertexShader.vert new file mode 100644 index 000000000..fe6640b75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/resources/vertexShader.vert @@ -0,0 +1,36 @@ +/* +Copyright (C) 2009 Apple Computer, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. AS IS AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +attribute vec4 a_vertex; +attribute vec3 a_normal; + +uniform mediump mat4 u_modelViewProjMatrix; + +varying vec3 v_normal; + +void main() +{ + v_normal = a_normal; + gl_Position = u_modelViewProjMatrix * a_vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/resources/webgl-logo.png b/dom/canvas/test/webgl-conf/checkout/resources/webgl-logo.png new file mode 100644 index 000000000..b9b22e1ab Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/webgl-logo.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/zero-alpha.png b/dom/canvas/test/webgl-conf/checkout/resources/zero-alpha.png new file mode 100644 index 000000000..e55630c11 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/zero-alpha.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/test-guidelines.md b/dom/canvas/test/webgl-conf/checkout/test-guidelines.md new file mode 100644 index 000000000..909738cee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/test-guidelines.md @@ -0,0 +1,181 @@ +Contributing WebGL conformance tests Guidelines +=============================================== + +Thank you for contributing to the WebGL conformance tests. +Please try to follow these guidelines when submitting a test. + +* If you're new to git [here's a terse set of instructions](http://www.khronos.org/webgl/wiki/Using_Github_To_Contribute "Using Github to Contribute"). + +* All changes and/or new tests should go in the sdk/tests folder: + * Tests that apply to WebGL 1 to sdk/tests/conformance + * Tests that only concern WebGL 2 to sdk/tests/conformance2 + +The tests under conformance-suites are snapshots and are only to be updated by +the WebGL Working Group when "official" snapshots are taken. + +* Please use the Khronos Group License (MIT) + +These lines appears at the top of every html and js file under sdk/tests/conformance + + + +* Please use code similar to the code in existing tests + + Ideally, copy an existing test and modify it for your new test. Try not to duplicate + code that already exists where appropriate. In particular + + * use the functions in WebGLTestUtils rather than duplicating functionality. + + In particular, as much as possible, keep the WebGL code in your test specific + to the issue being tested and try to use the helper functions to handle + common setup. + + Examples: + + * to create a WebGL context call `WebGLTestUtils.create3DContext`. Passed nothing + it will create an offscreen canvas. Passed a canvas element it will create + a context on that element. Passed a string it will look up the canvas element + with the matching id and create a context from that element. + + * use `WebGLTestUtils.checkCanvas` or `WebGLTestUtils.checkCanvasRect` rather + than checking rendering results by hand. + + * use the various quad and draw functions + + * `WebGLTestUtils.setupUnitQuad` and `WebGLTestUtils.clearAndDrawUnitQuad` for + simple drawing. + + * `WebGLTestUtils.setupColorQuad`, `WebGLTestUtils.drawFloatColorQuad`, and + `WebGLTestUilts.drawUByteColorQuad` for drawing in a particular color. + + * `WebGLTestUtils.setupIndexedQuad` and `WebGLTestUtils.clearAndDrawIndexedQuad` + if you need a higher subdivision of vertices and/or vertex colors. + + * use `WebgLTestUtils.setupTexturedQuad` if you need a unit quad with texture coords. + By default the positions will be at location 0 and the texture coords at location 1. + + * If you need a custom shader use `WebGLTestUtils.setupProgram`. Note that it takes + the following arguments. `gl`, `shaders`, `opt_attribs`, `opt_locations`, and + `opt_logShaders` where: + + `gl` is the WebGL context. + + `shaders` are an array of either script element ids, shader source, or WebGLShader + objects. The first element in the array is the vertex shader, the second the fragment + shader. + + `opt_attribs` is an optional array of attribute names. If provided the named attributes + will have their locations bound to their index in this array. + + `opt_locations` is an optional array of attribute locations. If provided each attribute + name in `opt_attribs` is bound to the corresponding location in `opt_locations`. + + `opt_logShaders` is an optional boolean value. If set to true, the shader source will + be logged on the test page. It is recommended to use this in tests that concentrate on + shaders. + + * If you need to wait for a composite call `WebGLTestUtils.waitForComposite`. + As compositing is a browser specific thing this provides a central place to + update all tests that rely on compositing to function. + + * Code/Tag Order + + Most tests run inline. They don't use window.onload or the load event. This works by placing + the script tag inside the body, *after* the canvas and required divs. + + +
+
+ + + * Tests that take a long time use setTimeout so as not to freeze the browser. + + Many browsers will terminate JavaScript that takes more than a few seconds to execute + without returning control to the browser. The workaround is code like this + + var numTests = 10; + var currenTest = 0; + function runNextTest() { + if (currentTest == numTests) { + finishTest(); // Tells the harness you're done. + return; + } + // Run your test. + ... + ++currentTest; + setTimeout(runNextTest, 100); + } + runNextTest(); + + Remember the tests need to run without timing out even and slow mobile devices. + The harness resets the timeout timer every time a test reports success or failure + so as long as some part of your test calls `testPassed` or `testFailed` or one of the + many wrappers (`shouldXXX`, `glErrorShouldBe`, `WebGLTestUtils.checkCanvasXXX`, etc..) + every so often the harness will not timeout your test. + + * The test harness requires the global variable `successfullyParsed` to be set to true. + This usually appears at the end of a file. + + var successfullyParsed = true; + + * Do not use browser specific code. + + * Do not check the browser version. Use feature detection. + + * If you do need feature detection consider putting it into WebGLTestUtils so that + other tests can go through the same abstraction and the workaround is isolated + to one place. + + * Vendors may place test harness specific code in the testing infrastructure. + + resources/js-test-pre.js + conformance/more/unit.js + + * Indent with spaces not tabs. (not everyone uses your tab settings). + + * All HTML files must have a `` + + * All HTML files must have a `` + + * All JavaScript must start with "use strict"; + +* If adding a new test edit the appropriate 00_test_list.txt file + + Each folder has a 00_test_list.txt file that lists the test in that folder. + Each new test should be prefixed with the option `--min-version ` where + version is 1 more than the newest official version. At the time of this writing + all new tests should be prefixed with `--min-version 1.0.4` + + diff --git a/dom/canvas/test/webgl-conf/checkout/webgl-conformance-tests.html b/dom/canvas/test/webgl-conf/checkout/webgl-conformance-tests.html new file mode 100644 index 000000000..2aa8ac06c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/webgl-conformance-tests.html @@ -0,0 +1,1268 @@ + + + + + + + +WebGL Conformance Tests + + + + + + +
+ +
+
    +
+
+ + +
+ + + + + diff --git a/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py b/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py new file mode 100755 index 000000000..1b8888ab1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py @@ -0,0 +1,532 @@ +#!/usr/bin/env python +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# Write a Mochitest manifest for WebGL conformance test files. + +import os +import re + +# All paths in this file are based where this file is run. +WRAPPER_TEMPLATE_FILE = 'mochi-wrapper.html.template' +MANIFEST_TEMPLATE_FILE = 'mochitest.ini.template' +ERRATA_FILE = 'mochitest-errata.ini' +DEST_MANIFEST_PATHSTR = 'generated-mochitest.ini' + +BASE_TEST_LIST_PATHSTR = 'checkout/00_test_list.txt' +GENERATED_PATHSTR = 'generated' +WEBGL2_TEST_MANGLE = '2_' +PATH_SEP_MANGLING = '__' +WEBGL2_SKIP_IF_CONDITION = "(os == 'android' || os == 'linux' || " \ + "(os == 'win' && os_version == '5.1'))" + +SUPPORT_DIRS = [ + 'checkout', +] + +EXTRA_SUPPORT_FILES = [ + 'always-fail.html', + 'iframe-passthrough.css', + 'mochi-single.html', +] + +ACCEPTABLE_ERRATA_KEYS = set([ + 'fail-if', + 'skip-if', + 'subsuite', +]) + +######################################################################## +# GetTestList + +def GetTestList(): + split = BASE_TEST_LIST_PATHSTR.rsplit('/', 1) + basePath = '.' + testListFile = split[-1] + if len(split) == 2: + basePath = split[0] + + allowWebGL1 = True + allowWebGL2 = True + alwaysFailEntry = TestEntry('always-fail.html', True, False) + testList = [alwaysFailEntry] + AccumTests(basePath, testListFile, allowWebGL1, allowWebGL2, testList) + + for x in testList: + x.path = os.path.relpath(x.path, basePath).replace(os.sep, '/') + continue + + return testList + +############################## +# Internals + +def IsVersionLess(a, b): + aSplit = [int(x) for x in a.split('.')] + bSplit = [int(x) for x in b.split('.')] + + while len(aSplit) < len(bSplit): + aSplit.append(0) + + while len(aSplit) > len(bSplit): + bSplit.append(0) + + for i in range(len(aSplit)): + aVal = aSplit[i] + bVal = bSplit[i] + + if aVal == bVal: + continue + + return aVal < bVal + + return False + +class TestEntry: + def __init__(self, path, webgl1, webgl2): + self.path = path + self.webgl1 = webgl1 + self.webgl2 = webgl2 + return + + +def AccumTests(pathStr, listFile, allowWebGL1, allowWebGL2, out_testList): + listPathStr = pathStr + '/' + listFile + + listPath = listPathStr.replace('/', os.sep) + assert os.path.exists(listPath), 'Bad `listPath`: ' + listPath + + with open(listPath, 'rb') as fIn: + lineNum = 0 + for line in fIn: + lineNum += 1 + + line = line.rstrip() + if not line: + continue + + curLine = line.lstrip() + if curLine.startswith('//'): + continue + if curLine.startswith('#'): + continue + + webgl1 = allowWebGL1 + webgl2 = allowWebGL2 + while curLine.startswith('--'): # '--min-version 1.0.2 foo.html' + (flag, curLine) = curLine.split(' ', 1) + if flag == '--min-version': + (minVersion, curLine) = curLine.split(' ', 1) + if not IsVersionLess(minVersion, "2.0.0"): # >= 2.0.0 + webgl1 = False + break + elif flag == '--max-version': + (maxVersion, curLine) = curLine.split(' ', 1) + if IsVersionLess(maxVersion, "2.0.0"): + webgl2 = False + break + elif flag == '--slow': + continue # TODO + else: + text = 'Unknown flag \'{}\': {}:{}: {}'.format(flag, listPath, + lineNum, line) + assert False, text + continue + + assert(webgl1 or webgl2) + + split = curLine.rsplit('.', 1) + assert len(split) == 2, 'Bad split for `line`: ' + line + (name, ext) = split + + if ext == 'html': + newTestFilePathStr = pathStr + '/' + curLine + entry = TestEntry(newTestFilePathStr, webgl1, webgl2) + out_testList.append(entry) + continue + + assert ext == 'txt', 'Bad `ext` on `line`: ' + line + + split = curLine.rsplit('/', 1) + nextListFile = split[-1] + nextPathStr = '' + if len(split) != 1: + nextPathStr = split[0] + + nextPathStr = pathStr + '/' + nextPathStr + AccumTests(nextPathStr, nextListFile, webgl1, webgl2, out_testList) + continue + + return + +######################################################################## +# Templates + +def FillTemplate(inFilePath, templateDict, outFilePath): + templateShell = ImportTemplate(inFilePath) + OutputFilledTemplate(templateShell, templateDict, outFilePath) + return + + +def ImportTemplate(inFilePath): + with open(inFilePath, 'rb') as f: + return TemplateShell(f) + + +def OutputFilledTemplate(templateShell, templateDict, outFilePath): + spanStrList = templateShell.Fill(templateDict) + + with open(outFilePath, 'wb') as f: + f.writelines(spanStrList) + return + +############################## +# Internals + +def WrapWithIndent(lines, indentLen): + split = lines.split('\n') + if len(split) == 1: + return lines + + ret = [split[0]] + indentSpaces = ' ' * indentLen + for line in split[1:]: + ret.append(indentSpaces + line) + + return '\n'.join(ret) + + +templateRE = re.compile('(%%.*?%%)') +assert templateRE.split(' foo = %%BAR%%;') == [' foo = ', '%%BAR%%', ';'] + + +class TemplateShellSpan: + def __init__(self, span): + self.span = span + + self.isLiteralSpan = True + if self.span.startswith('%%') and self.span.endswith('%%'): + self.isLiteralSpan = False + self.span = self.span[2:-2] + + return + + + def Fill(self, templateDict, indentLen): + if self.isLiteralSpan: + return self.span + + assert self.span in templateDict, '\'' + self.span + '\' not in dict!' + + filling = templateDict[self.span] + + return WrapWithIndent(filling, indentLen) + + +class TemplateShell: + def __init__(self, iterableLines): + spanList = [] + curLiteralSpan = [] + for line in iterableLines: + split = templateRE.split(line) + + for cur in split: + isTemplateSpan = cur.startswith('%%') and cur.endswith('%%') + if not isTemplateSpan: + curLiteralSpan.append(cur) + continue + + if curLiteralSpan: + span = ''.join(curLiteralSpan) + span = TemplateShellSpan(span) + spanList.append(span) + curLiteralSpan = [] + + assert len(cur) >= 4 + + span = TemplateShellSpan(cur) + spanList.append(span) + continue + continue + + if curLiteralSpan: + span = ''.join(curLiteralSpan) + span = TemplateShellSpan(span) + spanList.append(span) + + self.spanList = spanList + return + + + # Returns spanStrList. + def Fill(self, templateDict): + indentLen = 0 + ret = [] + for span in self.spanList: + span = span.Fill(templateDict, indentLen) + ret.append(span) + + # Get next `indentLen`. + try: + lineStartPos = span.rindex('\n') + 1 + + # let span = 'foo\nbar' + # len(span) is 7 + # lineStartPos is 4 + indentLen = len(span) - lineStartPos + except ValueError: + indentLen += len(span) + continue + + return ret + +######################################################################## +# Output + +def IsWrapperWebGL2(wrapperPath): + return wrapperPath.startswith(GENERATED_PATHSTR + '/test_' + WEBGL2_TEST_MANGLE) + + +def WriteWrapper(entryPath, webgl2, templateShell, wrapperPathAccum): + mangledPath = entryPath.replace('/', PATH_SEP_MANGLING) + maybeWebGL2Mangle = '' + if webgl2: + maybeWebGL2Mangle = WEBGL2_TEST_MANGLE + + # Mochitests must start with 'test_' or similar, or the test + # runner will ignore our tests. + # The error text is "is not a valid test". + wrapperFileName = 'test_' + maybeWebGL2Mangle + mangledPath + + wrapperPath = GENERATED_PATHSTR + '/' + wrapperFileName + print('Adding wrapper: ' + wrapperPath) + + args = '' + if webgl2: + args = '?webglVersion=2' + + templateDict = { + 'TEST_PATH': entryPath, + 'ARGS': args, + } + + OutputFilledTemplate(templateShell, templateDict, wrapperPath) + + if webgl2: + assert IsWrapperWebGL2(wrapperPath) + + wrapperPathAccum.append(wrapperPath) + return + + +def WriteWrappers(testEntryList): + templateShell = ImportTemplate(WRAPPER_TEMPLATE_FILE) + + generatedDirPath = GENERATED_PATHSTR.replace('/', os.sep) + if not os.path.exists(generatedDirPath): + os.mkdir(generatedDirPath) + assert os.path.isdir(generatedDirPath) + + wrapperPathList = [] + for entry in testEntryList: + if entry.webgl1: + WriteWrapper(entry.path, False, templateShell, wrapperPathList) + if entry.webgl2: + WriteWrapper(entry.path, True, templateShell, wrapperPathList) + continue + + print('{} wrappers written.\n'.format(len(wrapperPathList))) + return wrapperPathList + + +kManifestRelPathStr = os.path.relpath('.', os.path.dirname(DEST_MANIFEST_PATHSTR)) +kManifestRelPathStr = kManifestRelPathStr.replace(os.sep, '/') + +def ManifestPathStr(pathStr): + pathStr = kManifestRelPathStr + '/' + pathStr + return os.path.normpath(pathStr).replace(os.sep, '/') + + +def WriteManifest(wrapperPathStrList, supportPathStrList): + destPathStr = DEST_MANIFEST_PATHSTR + print 'Generating manifest: ' + destPathStr + + errataMap = LoadErrata() + + # DEFAULT_ERRATA + defaultSectionName = 'DEFAULT' + + defaultSectionLines = [] + if defaultSectionName in errataMap: + defaultSectionLines = errataMap[defaultSectionName] + del errataMap[defaultSectionName] + + defaultSectionStr = '\n'.join(defaultSectionLines) + + # SUPPORT_FILES + supportPathStrList = [ManifestPathStr(x) for x in supportPathStrList] + supportPathStrList = sorted(supportPathStrList) + supportFilesStr = '\n'.join(supportPathStrList) + + # MANIFEST_TESTS + manifestTestLineList = [] + wrapperPathStrList = sorted(wrapperPathStrList) + for wrapperPathStr in wrapperPathStrList: + #print 'wrapperPathStr: ' + wrapperPathStr + + wrapperManifestPathStr = ManifestPathStr(wrapperPathStr) + sectionName = '[' + wrapperManifestPathStr + ']' + manifestTestLineList.append(sectionName) + + errataLines = [] + if wrapperPathStr in errataMap: + errataLines = errataMap[wrapperPathStr] + del errataMap[wrapperPathStr] + + if IsWrapperWebGL2(wrapperPathStr): + needsSkip = True + for i in range(len(errataLines)): + if errataLines[i].startswith('skip-if'): + errataLines[i] += ' || ' + WEBGL2_SKIP_IF_CONDITION + needsSkip = False + continue + + if needsSkip: + errataLines.append('skip-if = ' + WEBGL2_SKIP_IF_CONDITION) + + manifestTestLineList += errataLines + continue + + if errataMap: + print 'Errata left in map:' + for x in errataMap.keys(): + print ' '*4 + x + assert False + + manifestTestsStr = '\n'.join(manifestTestLineList) + + # Fill the template. + templateDict = { + 'DEFAULT_ERRATA': defaultSectionStr, + 'SUPPORT_FILES': supportFilesStr, + 'MANIFEST_TESTS': manifestTestsStr, + } + + destPath = destPathStr.replace('/', os.sep) + FillTemplate(MANIFEST_TEMPLATE_FILE, templateDict, destPath) + return + +############################## +# Internals + +kManifestHeaderRegex = re.compile(r'[[]([^]]*)[]]') + +def LoadINI(path): + curSectionName = None + curSectionMap = {} + + lineNum = 0 + + ret = {} + ret[curSectionName] = (lineNum, curSectionMap) + + with open(path, 'rb') as f: + for line in f: + lineNum += 1 + + line = line.strip() + if not line: + continue + + if line[0] in [';', '#']: + continue + + if line[0] == '[': + assert line[-1] == ']', '{}:{}'.format(path, lineNum) + + curSectionName = line[1:-1] + assert curSectionName not in ret, 'Line {}: Duplicate section: {}'.format(lineNum, line) + + curSectionMap = {} + ret[curSectionName] = (lineNum, curSectionMap) + continue + + split = line.split('=', 1) + key = split[0].strip() + val = '' + if len(split) == 2: + val = split[1].strip() + + curSectionMap[key] = (lineNum, val) + continue + + return ret + + +def LoadErrata(): + iniMap = LoadINI(ERRATA_FILE) + + ret = {} + + for (sectionName, (sectionLineNum, sectionMap)) in iniMap.iteritems(): + curLines = [] + + if sectionName == None: + continue + elif sectionName != 'DEFAULT': + path = sectionName.replace('/', os.sep) + assert os.path.exists(path), 'Errata line {}: Invalid file: {}'.format(sectionLineNum, sectionName) + + for (key, (lineNum, val)) in sectionMap.iteritems(): + assert key in ACCEPTABLE_ERRATA_KEYS, 'Line {}: {}'.format(lineNum, key) + + curLine = '{} = {}'.format(key, val) + curLines.append(curLine) + continue + + ret[sectionName] = curLines + continue + + return ret + +######################################################################## + +def GetSupportFileList(): + ret = EXTRA_SUPPORT_FILES[:] + + for pathStr in SUPPORT_DIRS: + ret += GetFilePathListForDir(pathStr) + continue + + for pathStr in ret: + path = pathStr.replace('/', os.sep) + assert os.path.exists(path), path + '\n\n\n' + 'pathStr: ' + str(pathStr) + continue + + return ret + + +def GetFilePathListForDir(baseDir): + ret = [] + for root, folders, files in os.walk(baseDir): + for f in files: + filePath = os.path.join(root, f) + filePath = filePath.replace(os.sep, '/') + ret.append(filePath) + + return ret + + +if __name__ == '__main__': + fileDir = os.path.dirname(__file__) + assert not fileDir, 'Run this file from its directory, not ' + fileDir + + testEntryList = GetTestList() + wrapperPathStrList = WriteWrappers(testEntryList) + + supportPathStrList = GetSupportFileList() + WriteManifest(wrapperPathStrList, supportPathStrList) + + print('Done!') diff --git a/dom/canvas/test/webgl-conf/generated-mochitest.ini b/dom/canvas/test/webgl-conf/generated-mochitest.ini new file mode 100644 index 000000000..1b2c05c14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated-mochitest.ini @@ -0,0 +1,8376 @@ +# This is a GENERATED FILE. Do not edit it directly. +# Regenerated it by using `python generate-wrappers-and-manifest.py`. +# Mark failing (fail-if) and crashing (skip-if) tests in mochitest-errata.ini. + +[DEFAULT] +subsuite = webgl +skip-if = os == 'b2g' || ((os == 'linux') && (buildapp == 'mulet')) + +support-files = always-fail.html + checkout/00_test_list.txt + checkout/CONFORMANCE_RULES.txt + checkout/README.md + checkout/closure-library/AUTHORS + checkout/closure-library/CONTRIBUTING + checkout/closure-library/LICENSE + checkout/closure-library/README-Khronos.txt + checkout/closure-library/README.md + checkout/closure-library/closure/bin/build/closurebuilder.py + checkout/closure-library/closure/bin/build/depstree.py + checkout/closure-library/closure/bin/build/depswriter.py + checkout/closure-library/closure/bin/build/jscompiler.py + checkout/closure-library/closure/bin/build/source.py + checkout/closure-library/closure/bin/build/treescan.py + checkout/closure-library/closure/bin/calcdeps.py + checkout/closure-library/closure/bin/scopify.py + checkout/closure-library/closure/goog/base.js + checkout/closure-library/closure/goog/deps.js + checkout/conformance/00_readme.txt + checkout/conformance/00_test_list.txt + checkout/conformance/attribs/00_test_list.txt + checkout/conformance/attribs/gl-bindAttribLocation-aliasing.html + checkout/conformance/attribs/gl-bindAttribLocation-matrix.html + checkout/conformance/attribs/gl-bindAttribLocation-repeated.html + checkout/conformance/attribs/gl-disabled-vertex-attrib.html + checkout/conformance/attribs/gl-enable-vertex-attrib.html + checkout/conformance/attribs/gl-matrix-attributes.html + checkout/conformance/attribs/gl-vertex-attrib-render.html + checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html + checkout/conformance/attribs/gl-vertex-attrib.html + checkout/conformance/attribs/gl-vertexattribpointer-offsets.html + checkout/conformance/attribs/gl-vertexattribpointer.html + checkout/conformance/buffers/00_test_list.txt + checkout/conformance/buffers/buffer-bind-test.html + checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html + checkout/conformance/buffers/buffer-data-array-buffer-delete.html + checkout/conformance/buffers/buffer-uninitialized.html + checkout/conformance/buffers/element-array-buffer-delete-recreate.html + checkout/conformance/buffers/index-validation-copies-indices.html + checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html + checkout/conformance/buffers/index-validation-large-buffer.html + checkout/conformance/buffers/index-validation-verifies-too-many-indices.html + checkout/conformance/buffers/index-validation-with-resized-buffer.html + checkout/conformance/buffers/index-validation.html + checkout/conformance/canvas/00_test_list.txt + checkout/conformance/canvas/buffer-offscreen-test.html + checkout/conformance/canvas/buffer-preserve-test.html + checkout/conformance/canvas/canvas-test.html + checkout/conformance/canvas/canvas-zero-size.html + checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html + checkout/conformance/canvas/draw-webgl-to-canvas-test.html + checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html + checkout/conformance/canvas/drawingbuffer-static-canvas-test.html + checkout/conformance/canvas/drawingbuffer-test.html + checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html + checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html + checkout/conformance/canvas/rapid-resizing.html + checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html + checkout/conformance/canvas/to-data-url-test.html + checkout/conformance/canvas/viewport-unchanged-upon-resize.html + checkout/conformance/context/00_test_list.txt + checkout/conformance/context/constants-and-properties.html + checkout/conformance/context/context-attribute-preserve-drawing-buffer.html + checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html + checkout/conformance/context/context-creation-and-destruction.html + checkout/conformance/context/context-creation.html + checkout/conformance/context/context-eviction-with-garbage-collection.html + checkout/conformance/context/context-hidden-alpha.html + checkout/conformance/context/context-lost-restored.html + checkout/conformance/context/context-lost.html + checkout/conformance/context/context-no-alpha-fbo-with-alpha.html + checkout/conformance/context/context-release-upon-reload.html + checkout/conformance/context/context-release-with-workers.html + checkout/conformance/context/context-size-change.html + checkout/conformance/context/context-type-test.html + checkout/conformance/context/incorrect-context-object-behaviour.html + checkout/conformance/context/methods.html + checkout/conformance/context/premultiplyalpha-test.html + checkout/conformance/context/resource-sharing-test.html + checkout/conformance/context/resources/context-release-child-with-worker.html + checkout/conformance/context/resources/context-release-upon-reload-child.html + checkout/conformance/context/resources/context-release-worker.js + checkout/conformance/context/user-defined-properties-on-context.html + checkout/conformance/extensions/00_test_list.txt + checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html + checkout/conformance/extensions/angle-instanced-arrays.html + checkout/conformance/extensions/ext-blend-minmax.html + checkout/conformance/extensions/ext-disjoint-timer-query.html + checkout/conformance/extensions/ext-frag-depth.html + checkout/conformance/extensions/ext-sRGB.html + checkout/conformance/extensions/ext-shader-texture-lod.html + checkout/conformance/extensions/ext-texture-filter-anisotropic.html + checkout/conformance/extensions/get-extension.html + checkout/conformance/extensions/oes-element-index-uint.html + checkout/conformance/extensions/oes-standard-derivatives.html + checkout/conformance/extensions/oes-texture-float-linear.html + checkout/conformance/extensions/oes-texture-float-with-canvas.html + checkout/conformance/extensions/oes-texture-float-with-image-data.html + checkout/conformance/extensions/oes-texture-float-with-image.html + checkout/conformance/extensions/oes-texture-float-with-video.html + checkout/conformance/extensions/oes-texture-float.html + checkout/conformance/extensions/oes-texture-half-float-linear.html + checkout/conformance/extensions/oes-texture-half-float-with-canvas.html + checkout/conformance/extensions/oes-texture-half-float-with-image-data.html + checkout/conformance/extensions/oes-texture-half-float-with-image.html + checkout/conformance/extensions/oes-texture-half-float-with-video.html + checkout/conformance/extensions/oes-texture-half-float.html + checkout/conformance/extensions/oes-vertex-array-object-bufferData.html + checkout/conformance/extensions/oes-vertex-array-object.html + checkout/conformance/extensions/webgl-compressed-texture-atc.html + checkout/conformance/extensions/webgl-compressed-texture-etc.html + checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html + checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html + checkout/conformance/extensions/webgl-compressed-texture-s3tc.html + checkout/conformance/extensions/webgl-compressed-texture-size-limit.html + checkout/conformance/extensions/webgl-debug-renderer-info.html + checkout/conformance/extensions/webgl-debug-shaders.html + checkout/conformance/extensions/webgl-depth-texture.html + checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html + checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html + checkout/conformance/extensions/webgl-draw-buffers.html + checkout/conformance/extensions/webgl-shared-resources.html + checkout/conformance/glsl/00_test_list.txt + checkout/conformance/glsl/bugs/00_test_list.txt + checkout/conformance/glsl/bugs/README.md + checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html + checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html + checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html + checkout/conformance/glsl/bugs/angle-dx-variable-bug.html + checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html + checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html + checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html + checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html + checkout/conformance/glsl/bugs/compound-assignment-type-combination.html + checkout/conformance/glsl/bugs/conditional-discard-in-loop.html + checkout/conformance/glsl/bugs/conditional-discard-optimization.html + checkout/conformance/glsl/bugs/constant-precision-qualifier.html + checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html + checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html + checkout/conformance/glsl/bugs/floored-division-accuracy.html + checkout/conformance/glsl/bugs/fragcoord-linking-bug.html + checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html + checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html + checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html + checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html + checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html + checkout/conformance/glsl/bugs/loop-if-loop-gradient.html + checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html + checkout/conformance/glsl/bugs/multiplication-assignment.html + checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html + checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html + checkout/conformance/glsl/bugs/nested-sequence-operator.html + checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html + checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html + checkout/conformance/glsl/bugs/qualcomm-crash.html + checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html + checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html + checkout/conformance/glsl/bugs/sampler-struct-function-arg.html + checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html + checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html + checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html + checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html + checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html + checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html + checkout/conformance/glsl/constructors/00_test_list.txt + checkout/conformance/glsl/constructors/glsl-construct-bvec2.html + checkout/conformance/glsl/constructors/glsl-construct-bvec3.html + checkout/conformance/glsl/constructors/glsl-construct-bvec4.html + checkout/conformance/glsl/constructors/glsl-construct-ivec2.html + checkout/conformance/glsl/constructors/glsl-construct-ivec3.html + checkout/conformance/glsl/constructors/glsl-construct-ivec4.html + checkout/conformance/glsl/constructors/glsl-construct-mat2.html + checkout/conformance/glsl/constructors/glsl-construct-mat3.html + checkout/conformance/glsl/constructors/glsl-construct-mat4.html + checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html + checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html + checkout/conformance/glsl/constructors/glsl-construct-vec2.html + checkout/conformance/glsl/constructors/glsl-construct-vec3.html + checkout/conformance/glsl/constructors/glsl-construct-vec4.html + checkout/conformance/glsl/functions/00_test_list.txt + checkout/conformance/glsl/functions/glsl-function-abs.html + checkout/conformance/glsl/functions/glsl-function-acos.html + checkout/conformance/glsl/functions/glsl-function-asin.html + checkout/conformance/glsl/functions/glsl-function-atan-xy.html + checkout/conformance/glsl/functions/glsl-function-atan.html + checkout/conformance/glsl/functions/glsl-function-ceil.html + checkout/conformance/glsl/functions/glsl-function-clamp-float.html + checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html + checkout/conformance/glsl/functions/glsl-function-cos.html + checkout/conformance/glsl/functions/glsl-function-cross.html + checkout/conformance/glsl/functions/glsl-function-distance.html + checkout/conformance/glsl/functions/glsl-function-dot.html + checkout/conformance/glsl/functions/glsl-function-faceforward.html + checkout/conformance/glsl/functions/glsl-function-floor.html + checkout/conformance/glsl/functions/glsl-function-fract.html + checkout/conformance/glsl/functions/glsl-function-length.html + checkout/conformance/glsl/functions/glsl-function-lessThan.html + checkout/conformance/glsl/functions/glsl-function-max-float.html + checkout/conformance/glsl/functions/glsl-function-max-gentype.html + checkout/conformance/glsl/functions/glsl-function-min-float.html + checkout/conformance/glsl/functions/glsl-function-min-gentype.html + checkout/conformance/glsl/functions/glsl-function-mix-float.html + checkout/conformance/glsl/functions/glsl-function-mix-gentype.html + checkout/conformance/glsl/functions/glsl-function-mod-float.html + checkout/conformance/glsl/functions/glsl-function-mod-gentype.html + checkout/conformance/glsl/functions/glsl-function-normalize.html + checkout/conformance/glsl/functions/glsl-function-reflect.html + checkout/conformance/glsl/functions/glsl-function-refract.html + checkout/conformance/glsl/functions/glsl-function-sign.html + checkout/conformance/glsl/functions/glsl-function-sin.html + checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html + checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html + checkout/conformance/glsl/functions/glsl-function-step-float.html + checkout/conformance/glsl/functions/glsl-function-step-gentype.html + checkout/conformance/glsl/functions/glsl-function.html + checkout/conformance/glsl/implicit/00_test_list.txt + checkout/conformance/glsl/implicit/add_int_float.vert.html + checkout/conformance/glsl/implicit/add_int_mat2.vert.html + checkout/conformance/glsl/implicit/add_int_mat3.vert.html + checkout/conformance/glsl/implicit/add_int_mat4.vert.html + checkout/conformance/glsl/implicit/add_int_vec2.vert.html + checkout/conformance/glsl/implicit/add_int_vec3.vert.html + checkout/conformance/glsl/implicit/add_int_vec4.vert.html + checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html + checkout/conformance/glsl/implicit/assign_int_to_float.vert.html + checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html + checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html + checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html + checkout/conformance/glsl/implicit/construct_struct.vert.html + checkout/conformance/glsl/implicit/divide_int_float.vert.html + checkout/conformance/glsl/implicit/divide_int_mat2.vert.html + checkout/conformance/glsl/implicit/divide_int_mat3.vert.html + checkout/conformance/glsl/implicit/divide_int_mat4.vert.html + checkout/conformance/glsl/implicit/divide_int_vec2.vert.html + checkout/conformance/glsl/implicit/divide_int_vec3.vert.html + checkout/conformance/glsl/implicit/divide_int_vec4.vert.html + checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html + checkout/conformance/glsl/implicit/equal_int_float.vert.html + checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html + checkout/conformance/glsl/implicit/function_int_float.vert.html + checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html + checkout/conformance/glsl/implicit/greater_than.vert.html + checkout/conformance/glsl/implicit/greater_than_equal.vert.html + checkout/conformance/glsl/implicit/less_than.vert.html + checkout/conformance/glsl/implicit/less_than_equal.vert.html + checkout/conformance/glsl/implicit/multiply_int_float.vert.html + checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html + checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html + checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html + checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html + checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html + checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html + checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html + checkout/conformance/glsl/implicit/not_equal_int_float.vert.html + checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html + checkout/conformance/glsl/implicit/subtract_int_float.vert.html + checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html + checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html + checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html + checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html + checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html + checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html + checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html + checkout/conformance/glsl/implicit/ternary_int_float.vert.html + checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html + checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html + checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html + checkout/conformance/glsl/literals/00_test_list.txt + checkout/conformance/glsl/literals/float_literal.vert.html + checkout/conformance/glsl/literals/literal_precision.html + checkout/conformance/glsl/literals/overflow_leak.vert.html + checkout/conformance/glsl/matrices/00_test_list.txt + checkout/conformance/glsl/matrices/glsl-mat3-construction.html + checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html + checkout/conformance/glsl/matrices/matrix-compound-multiply.html + checkout/conformance/glsl/misc/00_test_list.txt + checkout/conformance/glsl/misc/attrib-location-length-limits.html + checkout/conformance/glsl/misc/boolean_precision.html + checkout/conformance/glsl/misc/const-variable-initialization.html + checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html + checkout/conformance/glsl/misc/empty-declaration.html + checkout/conformance/glsl/misc/empty_main.vert.html + checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html + checkout/conformance/glsl/misc/gl_position_unset.vert.html + checkout/conformance/glsl/misc/global-variable-init.html + checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html + checkout/conformance/glsl/misc/glsl-function-nodes.html + checkout/conformance/glsl/misc/glsl-long-variable-names.html + checkout/conformance/glsl/misc/glsl-vertex-branch.html + checkout/conformance/glsl/misc/include.vs + checkout/conformance/glsl/misc/large-loop-compile.html + checkout/conformance/glsl/misc/non-ascii-comments.vert.html + checkout/conformance/glsl/misc/non-ascii.vert.html + checkout/conformance/glsl/misc/re-compile-re-link.html + checkout/conformance/glsl/misc/sequence-operator-returns-constant.html + checkout/conformance/glsl/misc/shader-precision-format-obeyed.html + checkout/conformance/glsl/misc/shader-struct-scope.html + checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html + checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html + checkout/conformance/glsl/misc/shader-with-256-character-define.html + checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html + checkout/conformance/glsl/misc/shader-with-257-character-define.html + checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html + checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html + checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html + checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html + checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html + checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html + checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html + checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html + checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html + checkout/conformance/glsl/misc/shader-with-comma-assignment.html + checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html + checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html + checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html + checkout/conformance/glsl/misc/shader-with-conditional-scoping.html + checkout/conformance/glsl/misc/shader-with-default-precision.frag.html + checkout/conformance/glsl/misc/shader-with-default-precision.vert.html + checkout/conformance/glsl/misc/shader-with-define-line-continuation.frag.html + checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html + checkout/conformance/glsl/misc/shader-with-dfdx.frag.html + checkout/conformance/glsl/misc/shader-with-do-loop.html + checkout/conformance/glsl/misc/shader-with-error-directive.html + checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html + checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-for-loop.html + checkout/conformance/glsl/misc/shader-with-for-scoping.html + checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html + checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html + checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html + checkout/conformance/glsl/misc/shader-with-functional-scoping.html + checkout/conformance/glsl/misc/shader-with-glcolor.vert.html + checkout/conformance/glsl/misc/shader-with-gles-1.frag.html + checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html + checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html + checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html + checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html + checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html + checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html + checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html + checkout/conformance/glsl/misc/shader-with-include.vert.html + checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html + checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html + checkout/conformance/glsl/misc/shader-with-long-line.html + checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html + checkout/conformance/glsl/misc/shader-with-non-reserved-words.html + checkout/conformance/glsl/misc/shader-with-precision.frag.html + checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html + checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html + checkout/conformance/glsl/misc/shader-with-reserved-words.html + checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html + checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html + checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html + checkout/conformance/glsl/misc/shader-with-two-initializer-types.html + checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html + checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html + checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html + checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html + checkout/conformance/glsl/misc/shader-with-version-100.frag.html + checkout/conformance/glsl/misc/shader-with-version-100.vert.html + checkout/conformance/glsl/misc/shader-with-version-120.vert.html + checkout/conformance/glsl/misc/shader-with-version-130.vert.html + checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html + checkout/conformance/glsl/misc/shader-with-while-loop.html + checkout/conformance/glsl/misc/shader-without-precision.frag.html + checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html + checkout/conformance/glsl/misc/shaders-with-invariance.html + checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html + checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html + checkout/conformance/glsl/misc/shaders-with-missing-varyings.html + checkout/conformance/glsl/misc/shaders-with-name-conflicts.html + checkout/conformance/glsl/misc/shaders-with-uniform-structs.html + checkout/conformance/glsl/misc/shaders-with-varyings.html + checkout/conformance/glsl/misc/shared.html + checkout/conformance/glsl/misc/struct-assign.html + checkout/conformance/glsl/misc/struct-equals.html + checkout/conformance/glsl/misc/struct-mixed-array-declarators.html + checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html + checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html + checkout/conformance/glsl/misc/struct-nesting-under-maximum.html + checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html + checkout/conformance/glsl/misc/struct-unary-operators.html + checkout/conformance/glsl/misc/ternary-operator-on-arrays.html + checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html + checkout/conformance/glsl/misc/ternary-operators-in-initializers.html + checkout/conformance/glsl/misc/uniform-location-length-limits.html + checkout/conformance/glsl/reserved/00_test_list.txt + checkout/conformance/glsl/reserved/_webgl_field.vert.html + checkout/conformance/glsl/reserved/_webgl_function.vert.html + checkout/conformance/glsl/reserved/_webgl_struct.vert.html + checkout/conformance/glsl/reserved/_webgl_variable.vert.html + checkout/conformance/glsl/reserved/webgl_field.vert.html + checkout/conformance/glsl/reserved/webgl_function.vert.html + checkout/conformance/glsl/reserved/webgl_struct.vert.html + checkout/conformance/glsl/reserved/webgl_variable.vert.html + checkout/conformance/glsl/samplers/00_test_list.txt + checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html + checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html + checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html + checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html + checkout/conformance/glsl/variables/00_test_list.txt + checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html + checkout/conformance/glsl/variables/gl-fragcoord.html + checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html + checkout/conformance/glsl/variables/gl-frontfacing.html + checkout/conformance/glsl/variables/gl-pointcoord.html + checkout/conformance/glsl/variables/glsl-built-ins.html + checkout/conformance/limits/00_test_list.txt + checkout/conformance/limits/gl-line-width.html + checkout/conformance/limits/gl-max-texture-dimensions.html + checkout/conformance/limits/gl-min-attribs.html + checkout/conformance/limits/gl-min-textures.html + checkout/conformance/limits/gl-min-uniforms.html + checkout/conformance/manual/angle-instanced-arrays-state-leakage.html + checkout/conformance/manual/canvas-clear-on-zero-count-draw.html + checkout/conformance/manual/canvas-no-clear-on-readpixels.html + checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html + checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html + checkout/conformance/misc/00_test_list.txt + checkout/conformance/misc/bad-arguments-test.html + checkout/conformance/misc/boolean-argument-conversion.html + checkout/conformance/misc/delayed-drawing.html + checkout/conformance/misc/error-reporting.html + checkout/conformance/misc/expando-loss.html + checkout/conformance/misc/functions-returning-strings.html + checkout/conformance/misc/instanceof-test.html + checkout/conformance/misc/invalid-passed-params.html + checkout/conformance/misc/is-object.html + checkout/conformance/misc/null-object-behaviour.html + checkout/conformance/misc/object-deletion-behaviour.html + checkout/conformance/misc/shader-precision-format.html + checkout/conformance/misc/type-conversion-test.html + checkout/conformance/misc/uninitialized-test.html + checkout/conformance/misc/webgl-specific.html + checkout/conformance/more/00_test_list.txt + checkout/conformance/more/README.md + checkout/conformance/more/all_tests.html + checkout/conformance/more/all_tests_linkonly.html + checkout/conformance/more/all_tests_sequential.html + checkout/conformance/more/conformance/argGenerators-A.js + checkout/conformance/more/conformance/argGenerators-B1.js + checkout/conformance/more/conformance/argGenerators-B2.js + checkout/conformance/more/conformance/argGenerators-B3.js + checkout/conformance/more/conformance/argGenerators-B4.js + checkout/conformance/more/conformance/argGenerators-C.js + checkout/conformance/more/conformance/argGenerators-D_G.js + checkout/conformance/more/conformance/argGenerators-G_I.js + checkout/conformance/more/conformance/argGenerators-L_S.js + checkout/conformance/more/conformance/argGenerators-S_V.js + checkout/conformance/more/conformance/badArgsArityLessThanArgc.html + checkout/conformance/more/conformance/constants.html + checkout/conformance/more/conformance/fuzzTheAPI.html + checkout/conformance/more/conformance/getContext.html + checkout/conformance/more/conformance/methods.html + checkout/conformance/more/conformance/quickCheckAPI-A.html + checkout/conformance/more/conformance/quickCheckAPI-B1.html + checkout/conformance/more/conformance/quickCheckAPI-B2.html + checkout/conformance/more/conformance/quickCheckAPI-B3.html + checkout/conformance/more/conformance/quickCheckAPI-B4.html + checkout/conformance/more/conformance/quickCheckAPI-C.html + checkout/conformance/more/conformance/quickCheckAPI-D_G.html + checkout/conformance/more/conformance/quickCheckAPI-G_I.html + checkout/conformance/more/conformance/quickCheckAPI-L_S.html + checkout/conformance/more/conformance/quickCheckAPI-S_V.html + checkout/conformance/more/conformance/quickCheckAPI.js + checkout/conformance/more/conformance/quickCheckAPIBadArgs.html + checkout/conformance/more/conformance/webGLArrays.html + checkout/conformance/more/demos/opengl_web.html + checkout/conformance/more/demos/video.html + checkout/conformance/more/functions/bindBuffer.html + checkout/conformance/more/functions/bindBufferBadArgs.html + checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html + checkout/conformance/more/functions/bufferData.html + checkout/conformance/more/functions/bufferDataBadArgs.html + checkout/conformance/more/functions/bufferSubData.html + checkout/conformance/more/functions/bufferSubDataBadArgs.html + checkout/conformance/more/functions/copyTexImage2D.html + checkout/conformance/more/functions/copyTexImage2DBadArgs.html + checkout/conformance/more/functions/copyTexSubImage2D.html + checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html + checkout/conformance/more/functions/deleteBufferBadArgs.html + checkout/conformance/more/functions/drawArrays.html + checkout/conformance/more/functions/drawArraysOutOfBounds.html + checkout/conformance/more/functions/drawElements.html + checkout/conformance/more/functions/drawElementsBadArgs.html + checkout/conformance/more/functions/isTests.html + checkout/conformance/more/functions/isTestsBadArgs.html + checkout/conformance/more/functions/readPixels.html + checkout/conformance/more/functions/readPixelsBadArgs.html + checkout/conformance/more/functions/texImage2D.html + checkout/conformance/more/functions/texImage2DBadArgs.html + checkout/conformance/more/functions/texImage2DHTML.html + checkout/conformance/more/functions/texImage2DHTMLBadArgs.html + checkout/conformance/more/functions/texSubImage2D.html + checkout/conformance/more/functions/texSubImage2DBadArgs.html + checkout/conformance/more/functions/texSubImage2DHTML.html + checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html + checkout/conformance/more/functions/uniformMatrix.html + checkout/conformance/more/functions/uniformMatrixBadArgs.html + checkout/conformance/more/functions/uniformf.html + checkout/conformance/more/functions/uniformfArrayLen1.html + checkout/conformance/more/functions/uniformfBadArgs.html + checkout/conformance/more/functions/uniformi.html + checkout/conformance/more/functions/uniformiBadArgs.html + checkout/conformance/more/functions/vertexAttrib.html + checkout/conformance/more/functions/vertexAttribBadArgs.html + checkout/conformance/more/functions/vertexAttribPointer.html + checkout/conformance/more/functions/vertexAttribPointerBadArgs.html + checkout/conformance/more/glsl/arrayOutOfBounds.html + checkout/conformance/more/glsl/longLoops.html + checkout/conformance/more/glsl/uniformOutOfBounds.html + checkout/conformance/more/glsl/unusedAttribsUniforms.html + checkout/conformance/more/index.html + checkout/conformance/more/performance/CPUvsGPU.html + checkout/conformance/more/performance/bandwidth.html + checkout/conformance/more/performance/jsGCPause.html + checkout/conformance/more/performance/jsMatrixMult.html + checkout/conformance/more/performance/jsToGLOverhead.html + checkout/conformance/more/unit.css + checkout/conformance/more/unit.js + checkout/conformance/more/util.js + checkout/conformance/ogles/00_test_list.txt + checkout/conformance/ogles/GL/abs/abs_001_to_006.html + checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag + checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert + checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/abs/input.run.txt + checkout/conformance/ogles/GL/acos/acos_001_to_006.html + checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag + checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert + checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/acos/input.run.txt + checkout/conformance/ogles/GL/all/all_001_to_004.html + checkout/conformance/ogles/GL/all/all_bvec2_frag.frag + checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag + checkout/conformance/ogles/GL/all/all_bvec2_vert.vert + checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert + checkout/conformance/ogles/GL/all/all_bvec3_frag.frag + checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag + checkout/conformance/ogles/GL/all/all_bvec3_vert.vert + checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert + checkout/conformance/ogles/GL/all/input.run.txt + checkout/conformance/ogles/GL/any/any_001_to_004.html + checkout/conformance/ogles/GL/any/any_bvec2_frag.frag + checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag + checkout/conformance/ogles/GL/any/any_bvec2_vert.vert + checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert + checkout/conformance/ogles/GL/any/any_bvec3_frag.frag + checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag + checkout/conformance/ogles/GL/any/any_bvec3_vert.vert + checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert + checkout/conformance/ogles/GL/any/input.run.txt + checkout/conformance/ogles/GL/array/array_001_to_006.html + checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag + checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert + checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag + checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert + checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag + checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert + checkout/conformance/ogles/GL/array/input.run.txt + checkout/conformance/ogles/GL/asin/asin_001_to_006.html + checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag + checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert + checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/asin/input.run.txt + checkout/conformance/ogles/GL/atan/atan_001_to_008.html + checkout/conformance/ogles/GL/atan/atan_009_to_012.html + checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag + checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag + checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag + checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert + checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert + checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert + checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag + checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag + checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert + checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert + checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag + checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag + checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert + checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert + checkout/conformance/ogles/GL/atan/input.run.txt + checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html + checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html + checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert + checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert + checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert + checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert + checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert + checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert + checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert + checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag + checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert + checkout/conformance/ogles/GL/biConstants/input.run.txt + checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag + checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert + checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html + checkout/conformance/ogles/GL/biuDepthRange/input.run.txt + checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag + checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag + checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag + checkout/conformance/ogles/GL/build/CorrectComma_frag.frag + checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert + checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert + checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert + checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag + checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag + checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag + checkout/conformance/ogles/GL/build/CorrectFull_vert.vert + checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag + checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert + checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert + checkout/conformance/ogles/GL/build/CorrectModule_frag.frag + checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag + checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag + checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert + checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag + checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag + checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag + checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag + checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag + checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag + checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert + checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag + checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert + checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag + checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag + checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag + checkout/conformance/ogles/GL/build/FunctionParam_vert.vert + checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag + checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag + checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert + checkout/conformance/ogles/GL/build/ParseTest3_frag.frag + checkout/conformance/ogles/GL/build/ParseTest4_frag.frag + checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag + checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag + checkout/conformance/ogles/GL/build/TernaryOp_frag.frag + checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag + checkout/conformance/ogles/GL/build/array10_frag.frag + checkout/conformance/ogles/GL/build/array11_frag.frag + checkout/conformance/ogles/GL/build/array1_frag.frag + checkout/conformance/ogles/GL/build/array2_frag.frag + checkout/conformance/ogles/GL/build/array3_frag.frag + checkout/conformance/ogles/GL/build/array4_frag.frag + checkout/conformance/ogles/GL/build/array5_frag.frag + checkout/conformance/ogles/GL/build/array6_frag.frag + checkout/conformance/ogles/GL/build/array7_frag.frag + checkout/conformance/ogles/GL/build/array8_frag.frag + checkout/conformance/ogles/GL/build/array9_frag.frag + checkout/conformance/ogles/GL/build/attribute1_vert.vert + checkout/conformance/ogles/GL/build/attribute2_vert.vert + checkout/conformance/ogles/GL/build/attribute_frag.frag + checkout/conformance/ogles/GL/build/attribute_vert.vert + checkout/conformance/ogles/GL/build/break_frag.frag + checkout/conformance/ogles/GL/build/build_001_to_008.html + checkout/conformance/ogles/GL/build/build_009_to_016.html + checkout/conformance/ogles/GL/build/build_017_to_024.html + checkout/conformance/ogles/GL/build/build_025_to_032.html + checkout/conformance/ogles/GL/build/build_033_to_040.html + checkout/conformance/ogles/GL/build/build_041_to_048.html + checkout/conformance/ogles/GL/build/build_049_to_056.html + checkout/conformance/ogles/GL/build/build_057_to_064.html + checkout/conformance/ogles/GL/build/build_065_to_072.html + checkout/conformance/ogles/GL/build/build_073_to_080.html + checkout/conformance/ogles/GL/build/build_081_to_088.html + checkout/conformance/ogles/GL/build/build_089_to_096.html + checkout/conformance/ogles/GL/build/build_097_to_104.html + checkout/conformance/ogles/GL/build/build_105_to_112.html + checkout/conformance/ogles/GL/build/build_113_to_120.html + checkout/conformance/ogles/GL/build/build_121_to_128.html + checkout/conformance/ogles/GL/build/build_129_to_136.html + checkout/conformance/ogles/GL/build/build_137_to_144.html + checkout/conformance/ogles/GL/build/build_145_to_152.html + checkout/conformance/ogles/GL/build/build_153_to_160.html + checkout/conformance/ogles/GL/build/build_161_to_168.html + checkout/conformance/ogles/GL/build/build_169_to_176.html + checkout/conformance/ogles/GL/build/build_177_to_178.html + checkout/conformance/ogles/GL/build/comma1_vert.vert + checkout/conformance/ogles/GL/build/comma2_frag.frag + checkout/conformance/ogles/GL/build/comma2_vert.vert + checkout/conformance/ogles/GL/build/comma3_vert.vert + checkout/conformance/ogles/GL/build/comment_frag.frag + checkout/conformance/ogles/GL/build/conditional1_frag.frag + checkout/conformance/ogles/GL/build/conditional2_frag.frag + checkout/conformance/ogles/GL/build/conditional3_frag.frag + checkout/conformance/ogles/GL/build/constFunc_frag.frag + checkout/conformance/ogles/GL/build/constructor1_frag.frag + checkout/conformance/ogles/GL/build/constructor2_frag.frag + checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag + checkout/conformance/ogles/GL/build/continue_frag.frag + checkout/conformance/ogles/GL/build/dataType10_frag.frag + checkout/conformance/ogles/GL/build/dataType11_frag.frag + checkout/conformance/ogles/GL/build/dataType12_frag.frag + checkout/conformance/ogles/GL/build/dataType13_frag.frag + checkout/conformance/ogles/GL/build/dataType19_frag.frag + checkout/conformance/ogles/GL/build/dataType1_frag.frag + checkout/conformance/ogles/GL/build/dataType2_frag.frag + checkout/conformance/ogles/GL/build/dataType3_frag.frag + checkout/conformance/ogles/GL/build/dataType4_frag.frag + checkout/conformance/ogles/GL/build/dataType5_frag.frag + checkout/conformance/ogles/GL/build/dataType6_frag.frag + checkout/conformance/ogles/GL/build/dataType7_frag.frag + checkout/conformance/ogles/GL/build/dataType8_frag.frag + checkout/conformance/ogles/GL/build/dataType9_frag.frag + checkout/conformance/ogles/GL/build/default.frag + checkout/conformance/ogles/GL/build/default.vert + checkout/conformance/ogles/GL/build/dowhile_frag.frag + checkout/conformance/ogles/GL/build/dvec2_frag.frag + checkout/conformance/ogles/GL/build/dvec3_frag.frag + checkout/conformance/ogles/GL/build/dvec4_frag.frag + checkout/conformance/ogles/GL/build/extension2_V100_frag.frag + checkout/conformance/ogles/GL/build/extension3_V100_frag.frag + checkout/conformance/ogles/GL/build/extension5_V100_frag.frag + checkout/conformance/ogles/GL/build/extension6_V100_frag.frag + checkout/conformance/ogles/GL/build/extension7_V100_frag.frag + checkout/conformance/ogles/GL/build/extension8_V100_frag.frag + checkout/conformance/ogles/GL/build/extension9_V100_frag.frag + checkout/conformance/ogles/GL/build/float2_frag.frag + checkout/conformance/ogles/GL/build/float3_frag.frag + checkout/conformance/ogles/GL/build/float4_frag.frag + checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert + checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert + checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert + checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert + checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert + checkout/conformance/ogles/GL/build/function10_frag.frag + checkout/conformance/ogles/GL/build/function1_frag.frag + checkout/conformance/ogles/GL/build/function2_V100_frag.frag + checkout/conformance/ogles/GL/build/function3_frag.frag + checkout/conformance/ogles/GL/build/function4_frag.frag + checkout/conformance/ogles/GL/build/function6_frag.frag + checkout/conformance/ogles/GL/build/function7_frag.frag + checkout/conformance/ogles/GL/build/function8_frag.frag + checkout/conformance/ogles/GL/build/function9_frag.frag + checkout/conformance/ogles/GL/build/hvec2_frag.frag + checkout/conformance/ogles/GL/build/hvec3_frag.frag + checkout/conformance/ogles/GL/build/hvec4_frag.frag + checkout/conformance/ogles/GL/build/identifier1_frag.frag + checkout/conformance/ogles/GL/build/identifier2_frag.frag + checkout/conformance/ogles/GL/build/identifier3_frag.frag + checkout/conformance/ogles/GL/build/if1_frag.frag + checkout/conformance/ogles/GL/build/if2_frag.frag + checkout/conformance/ogles/GL/build/increment1_frag.frag + checkout/conformance/ogles/GL/build/increment2_frag.frag + checkout/conformance/ogles/GL/build/increment3_frag.frag + checkout/conformance/ogles/GL/build/increment4_frag.frag + checkout/conformance/ogles/GL/build/increment6_frag.frag + checkout/conformance/ogles/GL/build/input.run.txt + checkout/conformance/ogles/GL/build/main1_vert.vert + checkout/conformance/ogles/GL/build/main2_vert.vert + checkout/conformance/ogles/GL/build/main3_vert.vert + checkout/conformance/ogles/GL/build/matrix_V100_frag.frag + checkout/conformance/ogles/GL/build/normal_vert.vert + checkout/conformance/ogles/GL/build/parser10_frag.frag + checkout/conformance/ogles/GL/build/parser1_vert.vert + checkout/conformance/ogles/GL/build/parser3_frag.frag + checkout/conformance/ogles/GL/build/parser4_frag.frag + checkout/conformance/ogles/GL/build/parser5_frag.frag + checkout/conformance/ogles/GL/build/parser6_frag.frag + checkout/conformance/ogles/GL/build/parser7_frag.frag + checkout/conformance/ogles/GL/build/parser8_frag.frag + checkout/conformance/ogles/GL/build/parser9_frag.frag + checkout/conformance/ogles/GL/build/preprocess0_frag.frag + checkout/conformance/ogles/GL/build/preprocess10_frag.frag + checkout/conformance/ogles/GL/build/preprocess1_frag.frag + checkout/conformance/ogles/GL/build/preprocess2_frag.frag + checkout/conformance/ogles/GL/build/preprocess3_frag.frag + checkout/conformance/ogles/GL/build/preprocess4_frag.frag + checkout/conformance/ogles/GL/build/preprocess6_frag.frag + checkout/conformance/ogles/GL/build/preprocess7_frag.frag + checkout/conformance/ogles/GL/build/scoping1_frag.frag + checkout/conformance/ogles/GL/build/scoping2_frag.frag + checkout/conformance/ogles/GL/build/struct10_frag.frag + checkout/conformance/ogles/GL/build/struct11_frag.frag + checkout/conformance/ogles/GL/build/struct1_frag.frag + checkout/conformance/ogles/GL/build/struct2_frag.frag + checkout/conformance/ogles/GL/build/struct3_frag.frag + checkout/conformance/ogles/GL/build/struct4_frag.frag + checkout/conformance/ogles/GL/build/struct5_frag.frag + checkout/conformance/ogles/GL/build/struct6_frag.frag + checkout/conformance/ogles/GL/build/struct7_frag.frag + checkout/conformance/ogles/GL/build/struct8_frag.frag + checkout/conformance/ogles/GL/build/struct9_frag.frag + checkout/conformance/ogles/GL/build/swizzle1_frag.frag + checkout/conformance/ogles/GL/build/swizzle2_frag.frag + checkout/conformance/ogles/GL/build/swizzle3_frag.frag + checkout/conformance/ogles/GL/build/typecast_frag.frag + checkout/conformance/ogles/GL/build/uniform1_frag.frag + checkout/conformance/ogles/GL/build/uniform_frag.frag + checkout/conformance/ogles/GL/build/varying1_frag.frag + checkout/conformance/ogles/GL/build/varying2_frag.frag + checkout/conformance/ogles/GL/build/varying3_frag.frag + checkout/conformance/ogles/GL/build/varying_frag.frag + checkout/conformance/ogles/GL/build/vector_frag.frag + checkout/conformance/ogles/GL/build/version2_V100_frag.frag + checkout/conformance/ogles/GL/build/version3_V100_frag.frag + checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag + checkout/conformance/ogles/GL/build/vertexOnly_frag.frag + checkout/conformance/ogles/GL/build/vertex_vert.vert + checkout/conformance/ogles/GL/build/while1_frag.frag + checkout/conformance/ogles/GL/build/while2_frag.frag + checkout/conformance/ogles/GL/build/while_frag.frag + checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html + checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag + checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt + checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html + checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag + checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert + checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/ceil/input.run.txt + checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html + checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag + checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag + checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert + checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert + checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag + checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag + checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert + checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert + checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag + checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag + checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert + checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert + checkout/conformance/ogles/GL/clamp/input.run.txt + checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html + checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html + checkout/conformance/ogles/GL/control_flow/for_break_frag.frag + checkout/conformance/ogles/GL/control_flow/for_break_vert.vert + checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag + checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert + checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag + checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert + checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag + checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert + checkout/conformance/ogles/GL/control_flow/input.run.txt + checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag + checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert + checkout/conformance/ogles/GL/cos/cos_001_to_006.html + checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag + checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert + checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/cos/input.run.txt + checkout/conformance/ogles/GL/cross/cross_001_to_002.html + checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag + checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag + checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert + checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert + checkout/conformance/ogles/GL/cross/input.run.txt + checkout/conformance/ogles/GL/default/default.frag + checkout/conformance/ogles/GL/default/default.vert + checkout/conformance/ogles/GL/default/default_001_to_001.html + checkout/conformance/ogles/GL/default/default_textured.frag + checkout/conformance/ogles/GL/default/default_textured.vert + checkout/conformance/ogles/GL/default/expected.frag + checkout/conformance/ogles/GL/default/input.run.txt + checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html + checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag + checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert + checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/degrees/input.run.txt + checkout/conformance/ogles/GL/discard/discard_001_to_002.html + checkout/conformance/ogles/GL/discard/discard_cond_frag.frag + checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag + checkout/conformance/ogles/GL/discard/discard_frag.frag + checkout/conformance/ogles/GL/discard/input.run.txt + checkout/conformance/ogles/GL/distance/distance_001_to_006.html + checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag + checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag + checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert + checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert + checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag + checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag + checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert + checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert + checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag + checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag + checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert + checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert + checkout/conformance/ogles/GL/distance/input.run.txt + checkout/conformance/ogles/GL/dot/dot_001_to_006.html + checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag + checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag + checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert + checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert + checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag + checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag + checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert + checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert + checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag + checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag + checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert + checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert + checkout/conformance/ogles/GL/dot/input.run.txt + checkout/conformance/ogles/GL/equal/equal_001_to_008.html + checkout/conformance/ogles/GL/equal/equal_009_to_012.html + checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag + checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag + checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert + checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert + checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag + checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag + checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert + checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert + checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag + checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag + checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert + checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert + checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag + checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag + checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert + checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert + checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag + checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag + checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert + checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert + checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag + checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag + checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert + checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert + checkout/conformance/ogles/GL/equal/input.run.txt + checkout/conformance/ogles/GL/exp/exp_001_to_008.html + checkout/conformance/ogles/GL/exp/exp_009_to_012.html + checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag + checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag + checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag + checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert + checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert + checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert + checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag + checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag + checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert + checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert + checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag + checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag + checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert + checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert + checkout/conformance/ogles/GL/exp/input.run.txt + checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html + checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html + checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag + checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag + checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag + checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert + checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert + checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert + checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag + checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag + checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert + checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert + checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag + checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag + checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert + checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert + checkout/conformance/ogles/GL/exp2/input.run.txt + checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html + checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag + checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag + checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert + checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert + checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag + checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag + checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert + checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert + checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag + checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag + checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert + checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert + checkout/conformance/ogles/GL/faceforward/input.run.txt + checkout/conformance/ogles/GL/floor/floor_001_to_006.html + checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag + checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert + checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/floor/input.run.txt + checkout/conformance/ogles/GL/fract/fract_001_to_006.html + checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag + checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert + checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/fract/input.run.txt + checkout/conformance/ogles/GL/functions/array_float_frag.frag + checkout/conformance/ogles/GL/functions/array_float_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert + checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag + checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert + checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert + checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag + checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert + checkout/conformance/ogles/GL/functions/functions_001_to_008.html + checkout/conformance/ogles/GL/functions/functions_009_to_016.html + checkout/conformance/ogles/GL/functions/functions_017_to_024.html + checkout/conformance/ogles/GL/functions/functions_025_to_032.html + checkout/conformance/ogles/GL/functions/functions_033_to_040.html + checkout/conformance/ogles/GL/functions/functions_041_to_048.html + checkout/conformance/ogles/GL/functions/functions_049_to_056.html + checkout/conformance/ogles/GL/functions/functions_057_to_064.html + checkout/conformance/ogles/GL/functions/functions_065_to_072.html + checkout/conformance/ogles/GL/functions/functions_073_to_080.html + checkout/conformance/ogles/GL/functions/functions_081_to_088.html + checkout/conformance/ogles/GL/functions/functions_089_to_096.html + checkout/conformance/ogles/GL/functions/functions_097_to_104.html + checkout/conformance/ogles/GL/functions/functions_105_to_112.html + checkout/conformance/ogles/GL/functions/functions_113_to_120.html + checkout/conformance/ogles/GL/functions/functions_121_to_126.html + checkout/conformance/ogles/GL/functions/input.run.txt + checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert + checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert + checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert + checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert + checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert + checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert + checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert + checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag + checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert + checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert + checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag + checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert + checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag + checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert + checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag + checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert + checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag + checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert + checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag + checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert + checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html + checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag + checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag + checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag + checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag + checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag + checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert + checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt + checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html + checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag + checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt + checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert + checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert + checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert + checkout/conformance/ogles/GL/greaterThan/input.run.txt + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert + checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert + checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt + checkout/conformance/ogles/GL/inversesqrt/input.run.txt + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/length/input.run.txt + checkout/conformance/ogles/GL/length/length_001_to_006.html + checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag + checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert + checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/lessThan/input.run.txt + checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html + checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag + checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag + checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert + checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert + checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag + checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag + checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert + checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert + checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag + checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag + checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert + checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert + checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag + checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag + checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert + checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert + checkout/conformance/ogles/GL/lessThanEqual/input.run.txt + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert + checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert + checkout/conformance/ogles/GL/log/input.run.txt + checkout/conformance/ogles/GL/log/log_001_to_008.html + checkout/conformance/ogles/GL/log/log_009_to_012.html + checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag + checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag + checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag + checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert + checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert + checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert + checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag + checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag + checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert + checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert + checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag + checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag + checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert + checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert + checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/log2/input.run.txt + checkout/conformance/ogles/GL/log2/log2_001_to_008.html + checkout/conformance/ogles/GL/log2/log2_009_to_012.html + checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag + checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag + checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag + checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert + checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert + checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert + checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag + checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag + checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert + checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert + checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag + checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag + checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert + checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert + checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag + checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert + checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag + checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert + checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag + checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert + checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag + checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert + checkout/conformance/ogles/GL/mat/const_mat2_frag.frag + checkout/conformance/ogles/GL/mat/const_mat2_vert.vert + checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag + checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert + checkout/conformance/ogles/GL/mat/const_mat3_frag.frag + checkout/conformance/ogles/GL/mat/const_mat3_vert.vert + checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag + checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert + checkout/conformance/ogles/GL/mat/const_mat4_frag.frag + checkout/conformance/ogles/GL/mat/const_mat4_vert.vert + checkout/conformance/ogles/GL/mat/input.run.txt + checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag + checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert + checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag + checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert + checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag + checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert + checkout/conformance/ogles/GL/mat/mat2_float_frag.frag + checkout/conformance/ogles/GL/mat/mat2_float_vert.vert + checkout/conformance/ogles/GL/mat/mat2_frag.frag + checkout/conformance/ogles/GL/mat/mat2_vert.vert + checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag + checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert + checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag + checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert + checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag + checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert + checkout/conformance/ogles/GL/mat/mat3_float_frag.frag + checkout/conformance/ogles/GL/mat/mat3_float_vert.vert + checkout/conformance/ogles/GL/mat/mat3_frag.frag + checkout/conformance/ogles/GL/mat/mat3_vert.vert + checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag + checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert + checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag + checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert + checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag + checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert + checkout/conformance/ogles/GL/mat/mat4_frag.frag + checkout/conformance/ogles/GL/mat/mat4_vert.vert + checkout/conformance/ogles/GL/mat/mat_001_to_008.html + checkout/conformance/ogles/GL/mat/mat_009_to_016.html + checkout/conformance/ogles/GL/mat/mat_017_to_024.html + checkout/conformance/ogles/GL/mat/mat_025_to_032.html + checkout/conformance/ogles/GL/mat/mat_033_to_040.html + checkout/conformance/ogles/GL/mat/mat_041_to_046.html + checkout/conformance/ogles/GL/mat3/input.run.txt + checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html + checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag + checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert + checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag + checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert + checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag + checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert + checkout/conformance/ogles/GL/matrixCompMult/input.run.txt + checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert + checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert + checkout/conformance/ogles/GL/max/input.run.txt + checkout/conformance/ogles/GL/max/max_001_to_006.html + checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/min/input.run.txt + checkout/conformance/ogles/GL/min/min_001_to_006.html + checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/mix/input.run.txt + checkout/conformance/ogles/GL/mix/mix_001_to_006.html + checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag + checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag + checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert + checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert + checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag + checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag + checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert + checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert + checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag + checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag + checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert + checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert + checkout/conformance/ogles/GL/mod/input.run.txt + checkout/conformance/ogles/GL/mod/mod_001_to_008.html + checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag + checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag + checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert + checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert + checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag + checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag + checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert + checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert + checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag + checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag + checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert + checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert + checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag + checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert + checkout/conformance/ogles/GL/normalize/input.run.txt + checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html + checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag + checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert + checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/not/input.run.txt + checkout/conformance/ogles/GL/not/not_001_to_004.html + checkout/conformance/ogles/GL/not/not_bvec2_frag.frag + checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag + checkout/conformance/ogles/GL/not/not_bvec2_vert.vert + checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert + checkout/conformance/ogles/GL/not/not_bvec3_frag.frag + checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag + checkout/conformance/ogles/GL/not/not_bvec3_vert.vert + checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert + checkout/conformance/ogles/GL/notEqual/input.run.txt + checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html + checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html + checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag + checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag + checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert + checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert + checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag + checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag + checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert + checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert + checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag + checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag + checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert + checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert + checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag + checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag + checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert + checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert + checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag + checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag + checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert + checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert + checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag + checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag + checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert + checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert + checkout/conformance/ogles/GL/operators/addsubtract_frag.frag + checkout/conformance/ogles/GL/operators/addsubtract_vert.vert + checkout/conformance/ogles/GL/operators/assignments_frag.frag + checkout/conformance/ogles/GL/operators/assignments_vert.vert + checkout/conformance/ogles/GL/operators/division_frag.frag + checkout/conformance/ogles/GL/operators/division_vert.vert + checkout/conformance/ogles/GL/operators/equality_frag.frag + checkout/conformance/ogles/GL/operators/equality_vert.vert + checkout/conformance/ogles/GL/operators/input.run.txt + checkout/conformance/ogles/GL/operators/logical_frag.frag + checkout/conformance/ogles/GL/operators/logical_vert.vert + checkout/conformance/ogles/GL/operators/multiplicative_frag.frag + checkout/conformance/ogles/GL/operators/multiplicative_vert.vert + checkout/conformance/ogles/GL/operators/operators_001_to_008.html + checkout/conformance/ogles/GL/operators/operators_009_to_016.html + checkout/conformance/ogles/GL/operators/operators_017_to_024.html + checkout/conformance/ogles/GL/operators/operators_025_to_026.html + checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag + checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert + checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag + checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert + checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag + checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert + checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag + checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert + checkout/conformance/ogles/GL/operators/relational_frag.frag + checkout/conformance/ogles/GL/operators/relational_vert.vert + checkout/conformance/ogles/GL/operators/selection_frag.frag + checkout/conformance/ogles/GL/operators/selection_vert.vert + checkout/conformance/ogles/GL/operators/unary_frag.frag + checkout/conformance/ogles/GL/operators/unary_vert.vert + checkout/conformance/ogles/GL/pow/input.run.txt + checkout/conformance/ogles/GL/pow/pow_001_to_008.html + checkout/conformance/ogles/GL/pow/pow_009_to_016.html + checkout/conformance/ogles/GL/pow/pow_017_to_024.html + checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag + checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag + checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag + checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag + checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag + checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag + checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert + checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert + checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert + checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert + checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert + checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert + checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag + checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert + checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert + checkout/conformance/ogles/GL/radians/input.run.txt + checkout/conformance/ogles/GL/radians/radians_001_to_006.html + checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag + checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert + checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/reflect/input.run.txt + checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html + checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag + checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag + checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert + checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert + checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag + checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag + checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert + checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert + checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag + checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag + checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert + checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert + checkout/conformance/ogles/GL/refract/input.run.txt + checkout/conformance/ogles/GL/refract/refract_001_to_006.html + checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag + checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag + checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert + checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert + checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag + checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag + checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert + checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert + checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag + checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag + checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert + checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert + checkout/conformance/ogles/GL/sign/input.run.txt + checkout/conformance/ogles/GL/sign/sign_001_to_006.html + checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag + checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert + checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/sin/input.run.txt + checkout/conformance/ogles/GL/sin/sin_001_to_006.html + checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag + checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert + checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/smoothstep/input.run.txt + checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html + checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag + checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag + checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert + checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert + checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert + checkout/conformance/ogles/GL/sqrt/input.run.txt + checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html + checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag + checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert + checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/step/input.run.txt + checkout/conformance/ogles/GL/step/step_001_to_006.html + checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag + checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag + checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert + checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert + checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag + checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag + checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert + checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert + checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag + checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag + checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert + checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert + checkout/conformance/ogles/GL/struct/input.run.txt + checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag + checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert + checkout/conformance/ogles/GL/struct/struct_001_to_008.html + checkout/conformance/ogles/GL/struct/struct_009_to_016.html + checkout/conformance/ogles/GL/struct/struct_017_to_024.html + checkout/conformance/ogles/GL/struct/struct_025_to_032.html + checkout/conformance/ogles/GL/struct/struct_033_to_040.html + checkout/conformance/ogles/GL/struct/struct_041_to_048.html + checkout/conformance/ogles/GL/struct/struct_049_to_056.html + checkout/conformance/ogles/GL/struct/struct_bool_frag.frag + checkout/conformance/ogles/GL/struct/struct_bool_vert.vert + checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag + checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert + checkout/conformance/ogles/GL/struct/struct_float_frag.frag + checkout/conformance/ogles/GL/struct/struct_float_vert.vert + checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag + checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert + checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag + checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert + checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag + checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert + checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag + checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert + checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag + checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert + checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag + checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert + checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag + checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert + checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag + checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert + checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag + checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert + checkout/conformance/ogles/GL/struct/structnest_float_frag.frag + checkout/conformance/ogles/GL/struct/structnest_float_vert.vert + checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag + checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert + checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag + checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert + checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag + checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert + checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag + checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert + checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag + checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert + checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag + checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/input.run.txt + checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html + checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html + checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert + checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag + checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert + checkout/conformance/ogles/GL/tan/input.run.txt + checkout/conformance/ogles/GL/tan/tan_001_to_006.html + checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag + checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag + checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert + checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert + checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag + checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag + checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert + checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert + checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag + checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag + checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert + checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert + checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag + checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert + checkout/conformance/ogles/GL/vec/input.run.txt + checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag + checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert + checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag + checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert + checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag + checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert + checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag + checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert + checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag + checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert + checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag + checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert + checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag + checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert + checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag + checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert + checkout/conformance/ogles/GL/vec/vec_001_to_008.html + checkout/conformance/ogles/GL/vec/vec_009_to_016.html + checkout/conformance/ogles/GL/vec/vec_017_to_018.html + checkout/conformance/ogles/GL/vec3/input.run.txt + checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html + checkout/conformance/ogles/GL/vec3/vec3array_frag.frag + checkout/conformance/ogles/GL/vec3/vec3array_vert.vert + checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag + checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert + checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag + checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert + checkout/conformance/ogles/GL/vec3/vec3single_frag.frag + checkout/conformance/ogles/GL/vec3/vec3single_vert.vert + checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag + checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert + checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag + checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert + checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag + checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert + checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag + checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert + checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag + checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert + checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag + checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert + checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag + checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag + checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert + checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag + checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert + checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag + checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert + checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag + checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert + checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag + checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag + checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert + checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag + checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert + checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag + checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert + checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag + checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert + checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag + checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert + checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag + checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert + checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag + checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert + checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag + checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert + checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert + checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag + checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag + checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert + checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag + checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert + checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag + checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert + checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert + checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert + checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert + checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag + checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert + checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag + checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert + checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag + checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert + checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag + checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert + checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag + checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert + checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag + checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert + checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag + checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert + checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag + checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert + checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag + checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert + checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag + checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert + checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert + checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert + checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert + checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag + checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert + checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag + checkout/conformance/ogles/GL2Tests/glUniform/default.vert + checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag + checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert + checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag + checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert + checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag + checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert + checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag + checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert + checkout/conformance/ogles/GL2Tests/relink_program/simple.frag + checkout/conformance/ogles/GL2Tests/relink_program/simple.vert + checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag + checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag + checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert + checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert + checkout/conformance/ogles/README.md + checkout/conformance/ogles/mustpass.run.txt + checkout/conformance/ogles/ogles-utils.js + checkout/conformance/ogles/process-ogles2-tests.py + checkout/conformance/programs/00_test_list.txt + checkout/conformance/programs/get-active-test.html + checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html + checkout/conformance/programs/gl-bind-attrib-location-test.html + checkout/conformance/programs/gl-get-active-attribute.html + checkout/conformance/programs/gl-get-active-uniform.html + checkout/conformance/programs/gl-getshadersource.html + checkout/conformance/programs/gl-shader-test.html + checkout/conformance/programs/invalid-UTF-16.html + checkout/conformance/programs/program-infolog.html + checkout/conformance/programs/program-test.html + checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html + checkout/conformance/reading/00_test_list.txt + checkout/conformance/reading/read-pixels-pack-alignment.html + checkout/conformance/reading/read-pixels-test.html + checkout/conformance/renderbuffers/00_test_list.txt + checkout/conformance/renderbuffers/feedback-loop.html + checkout/conformance/renderbuffers/framebuffer-object-attachment.html + checkout/conformance/renderbuffers/framebuffer-state-restoration.html + checkout/conformance/renderbuffers/framebuffer-test.html + checkout/conformance/renderbuffers/renderbuffer-initialization.html + checkout/conformance/rendering/00_test_list.txt + checkout/conformance/rendering/clipping-wide-points.html + checkout/conformance/rendering/culling.html + checkout/conformance/rendering/default-texture-draw-bug.html + checkout/conformance/rendering/draw-arrays-out-of-bounds.html + checkout/conformance/rendering/draw-elements-out-of-bounds.html + checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html + checkout/conformance/rendering/framebuffer-switch.html + checkout/conformance/rendering/framebuffer-texture-switch.html + checkout/conformance/rendering/gl-clear.html + checkout/conformance/rendering/gl-drawarrays.html + checkout/conformance/rendering/gl-drawelements.html + checkout/conformance/rendering/gl-scissor-canvas-dimensions.html + checkout/conformance/rendering/gl-scissor-fbo-test.html + checkout/conformance/rendering/gl-scissor-test.html + checkout/conformance/rendering/gl-viewport-test-2.html + checkout/conformance/rendering/gl-viewport-test.html + checkout/conformance/rendering/line-loop-tri-fan.html + checkout/conformance/rendering/many-draw-calls.html + checkout/conformance/rendering/more-than-65536-indices.html + checkout/conformance/rendering/multisample-corruption.html + checkout/conformance/rendering/negative-one-index.html + checkout/conformance/rendering/out-of-bounds-index-buffers.html + checkout/conformance/rendering/point-no-attributes.html + checkout/conformance/rendering/point-size.html + checkout/conformance/rendering/point-specific-shader-variables.html + checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html + checkout/conformance/rendering/polygon-offset.html + checkout/conformance/rendering/simple.html + checkout/conformance/rendering/triangle.html + checkout/conformance/rendering/vertex-texture-fetch.html + checkout/conformance/state/00_test_list.txt + checkout/conformance/state/diffs.txt + checkout/conformance/state/gl-enable-enum-test.html + checkout/conformance/state/gl-enum-tests.html + checkout/conformance/state/gl-get-calls.html + checkout/conformance/state/gl-geterror.html + checkout/conformance/state/gl-getstring.html + checkout/conformance/state/gl-initial-state.html + checkout/conformance/state/gl-object-get-calls.html + checkout/conformance/state/state-uneffected-after-compositing.html + checkout/conformance/textures/00_test_list.txt + checkout/conformance/textures/canvas/00_test_list.txt + checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt + checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image/00_test_list.txt + checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt + checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt + checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt + checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt + checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt + checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt + checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/image_data/00_test_list.txt + checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/misc/00_test_list.txt + checkout/conformance/textures/misc/compressed-tex-image.html + checkout/conformance/textures/misc/copy-tex-image-2d-formats.html + checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html + checkout/conformance/textures/misc/copy-tex-sub-image-2d-partial-texture.html + checkout/conformance/textures/misc/cube-incomplete-fbo.html + checkout/conformance/textures/misc/default-texture.html + checkout/conformance/textures/misc/gl-get-tex-parameter.html + checkout/conformance/textures/misc/gl-pixelstorei.html + checkout/conformance/textures/misc/gl-teximage.html + checkout/conformance/textures/misc/mipmap-fbo.html + checkout/conformance/textures/misc/origin-clean-conformance.html + checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html + checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html + checkout/conformance/textures/misc/tex-image-canvas-corruption.html + checkout/conformance/textures/misc/tex-image-webgl.html + checkout/conformance/textures/misc/tex-image-with-format-and-type.html + checkout/conformance/textures/misc/tex-image-with-invalid-data.html + checkout/conformance/textures/misc/tex-input-validation.html + checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html + checkout/conformance/textures/misc/tex-sub-image-2d.html + checkout/conformance/textures/misc/texparameter-test.html + checkout/conformance/textures/misc/texture-active-bind-2.html + checkout/conformance/textures/misc/texture-active-bind.html + checkout/conformance/textures/misc/texture-attachment-formats.html + checkout/conformance/textures/misc/texture-clear.html + checkout/conformance/textures/misc/texture-complete.html + checkout/conformance/textures/misc/texture-copying-feedback-loops.html + checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html + checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html + checkout/conformance/textures/misc/texture-fakeblack.html + checkout/conformance/textures/misc/texture-formats-test.html + checkout/conformance/textures/misc/texture-hd-dpi.html + checkout/conformance/textures/misc/texture-mips.html + checkout/conformance/textures/misc/texture-npot-video.html + checkout/conformance/textures/misc/texture-npot.html + checkout/conformance/textures/misc/texture-size-cube-maps.html + checkout/conformance/textures/misc/texture-size-limit.html + checkout/conformance/textures/misc/texture-size.html + checkout/conformance/textures/misc/texture-sub-image-cube-maps.html + checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html + checkout/conformance/textures/misc/texture-upload-cube-maps.html + checkout/conformance/textures/misc/texture-upload-size.html + checkout/conformance/textures/svg_image/00_test_list.txt + checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/video/00_test_list.txt + checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/textures/webgl_canvas/00_test_list.txt + checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html + checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html + checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html + checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html + checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html + checkout/conformance/typedarrays/00_test_list.txt + checkout/conformance/typedarrays/array-buffer-crash.html + checkout/conformance/typedarrays/array-buffer-view-crash.html + checkout/conformance/typedarrays/array-large-array-tests.html + checkout/conformance/typedarrays/array-unit-tests.html + checkout/conformance/typedarrays/data-view-crash.html + checkout/conformance/typedarrays/data-view-test.html + checkout/conformance/typedarrays/typed-arrays-in-workers.html + checkout/conformance/uniforms/00_test_list.txt + checkout/conformance/uniforms/gl-uniform-arrays.html + checkout/conformance/uniforms/gl-uniform-bool.html + checkout/conformance/uniforms/gl-uniform-struct-unused.html + checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html + checkout/conformance/uniforms/gl-uniformmatrix4fv.html + checkout/conformance/uniforms/gl-unknown-uniform.html + checkout/conformance/uniforms/null-uniform-location.html + checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html + checkout/conformance/uniforms/uniform-default-values.html + checkout/conformance/uniforms/uniform-location.html + checkout/conformance/uniforms/uniform-samplers-test.html + checkout/conformance/uniforms/uniform-values-per-program.html + checkout/conformance2/00_test_list.txt + checkout/conformance2/attribs/00_test_list.txt + checkout/conformance2/attribs/gl-vertex-attrib-i-render.html + checkout/conformance2/attribs/gl-vertex-attrib.html + checkout/conformance2/attribs/gl-vertexattribipointer-offsets.html + checkout/conformance2/attribs/gl-vertexattribipointer.html + checkout/conformance2/buffers/00_test_list.txt + checkout/conformance2/buffers/bound-buffer-size-change-test.html + checkout/conformance2/buffers/buffer-copying-contents.html + checkout/conformance2/buffers/buffer-copying-restrictions.html + checkout/conformance2/buffers/buffer-data-and-buffer-sub-data-sub-source.html + checkout/conformance2/buffers/buffer-overflow-test.html + checkout/conformance2/buffers/buffer-type-restrictions.html + checkout/conformance2/buffers/get-buffer-sub-data.html + checkout/conformance2/buffers/getBufferSubData.html + checkout/conformance2/buffers/one-large-uniform-buffer.html + checkout/conformance2/buffers/uniform-buffers.html + checkout/conformance2/context/00_test_list.txt + checkout/conformance2/context/constants-and-properties-2.html + checkout/conformance2/context/context-attributes-depth-stencil-antialias-obeyed.html + checkout/conformance2/context/context-type-test-2.html + checkout/conformance2/context/methods-2.html + checkout/conformance2/extensions/00_test_list.txt + checkout/conformance2/extensions/ext-color-buffer-float.html + checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html + checkout/conformance2/extensions/promoted-extensions-in-shaders.html + checkout/conformance2/extensions/promoted-extensions.html + checkout/conformance2/glsl3/00_test_list.txt + checkout/conformance2/glsl3/array-as-return-value.html + checkout/conformance2/glsl3/array-assign-constructor.html + checkout/conformance2/glsl3/array-assign.html + checkout/conformance2/glsl3/array-complex-indexing.html + checkout/conformance2/glsl3/array-element-increment.html + checkout/conformance2/glsl3/array-equality.html + checkout/conformance2/glsl3/array-in-complex-expression.html + checkout/conformance2/glsl3/array-length-side-effects.html + checkout/conformance2/glsl3/attrib-location-length-limits.html + checkout/conformance2/glsl3/bool-type-cast-bug-uint-ivec-uvec.html + checkout/conformance2/glsl3/compare-structs-containing-arrays.html + checkout/conformance2/glsl3/compound-assignment-type-combination.html + checkout/conformance2/glsl3/const-array-init.html + checkout/conformance2/glsl3/forbidden-operators.html + checkout/conformance2/glsl3/frag-depth.html + checkout/conformance2/glsl3/invalid-default-precision.html + checkout/conformance2/glsl3/invalid-invariant.html + checkout/conformance2/glsl3/loops-with-side-effects.html + checkout/conformance2/glsl3/misplaced-version-directive.html + checkout/conformance2/glsl3/no-attribute-vertex-shader.html + checkout/conformance2/glsl3/sampler-no-precision.html + checkout/conformance2/glsl3/sequence-operator-returns-non-constant.html + checkout/conformance2/glsl3/shader-linking.html + checkout/conformance2/glsl3/shader-with-1024-character-define.html + checkout/conformance2/glsl3/shader-with-1024-character-identifier.frag.html + checkout/conformance2/glsl3/shader-with-1025-character-define.html + checkout/conformance2/glsl3/shader-with-1025-character-identifier.frag.html + checkout/conformance2/glsl3/shader-with-invalid-characters.html + checkout/conformance2/glsl3/shader-with-mis-matching-uniform-block.html + checkout/conformance2/glsl3/short-circuiting-in-loop-condition.html + checkout/conformance2/glsl3/texture-offset-out-of-range.html + checkout/conformance2/glsl3/texture-offset-uniform-texture-coordinate.html + checkout/conformance2/glsl3/tricky-loop-conditions.html + checkout/conformance2/glsl3/unary-minus-operator-in-dynamic-loop.html + checkout/conformance2/glsl3/uniform-block-layout-match.html + checkout/conformance2/glsl3/uniform-block-layouts.html + checkout/conformance2/glsl3/uniform-location-length-limits.html + checkout/conformance2/glsl3/valid-invariant.html + checkout/conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug.html + checkout/conformance2/glsl3/vector-dynamic-indexing.html + checkout/conformance2/misc/00_test_list.txt + checkout/conformance2/misc/expando-loss-2.html + checkout/conformance2/misc/getextension-while-pbo-bound-stability.html + checkout/conformance2/misc/instanceof-test.html + checkout/conformance2/misc/object-deletion-behaviour-2.html + checkout/conformance2/misc/uninitialized-test-2.html + checkout/conformance2/misc/views-with-offsets.html + checkout/conformance2/programs/00_test_list.txt + checkout/conformance2/programs/active-built-in-attribs.html + checkout/conformance2/programs/gl-get-frag-data-location.html + checkout/conformance2/query/00_test_list.txt + checkout/conformance2/query/occlusion-query.html + checkout/conformance2/query/query.html + checkout/conformance2/reading/00_test_list.txt + checkout/conformance2/reading/format-r11f-g11f-b10f.html + checkout/conformance2/reading/read-pixels-from-fbo-test.html + checkout/conformance2/reading/read-pixels-from-rgb8-into-pbo-bug.html + checkout/conformance2/reading/read-pixels-into-pixel-pack-buffer.html + checkout/conformance2/reading/read-pixels-pack-parameters.html + checkout/conformance2/renderbuffers/00_test_list.txt + checkout/conformance2/renderbuffers/framebuffer-object-attachment.html + checkout/conformance2/renderbuffers/framebuffer-test.html + checkout/conformance2/renderbuffers/framebuffer-texture-layer.html + checkout/conformance2/renderbuffers/invalidate-framebuffer.html + checkout/conformance2/renderbuffers/multisample-with-full-sample-counts.html + checkout/conformance2/renderbuffers/multisampled-renderbuffer-initialization.html + checkout/conformance2/renderbuffers/readbuffer.html + checkout/conformance2/rendering/00_test_list.txt + checkout/conformance2/rendering/attrib-type-match.html + checkout/conformance2/rendering/blitframebuffer-filter-outofbounds.html + checkout/conformance2/rendering/blitframebuffer-filter-srgb.html + checkout/conformance2/rendering/blitframebuffer-multisampled-readbuffer.html + checkout/conformance2/rendering/blitframebuffer-outside-readbuffer.html + checkout/conformance2/rendering/blitframebuffer-scissor-enabled.html + checkout/conformance2/rendering/blitframebuffer-size-overflow.html + checkout/conformance2/rendering/blitframebuffer-srgb-and-linear-drawbuffers.html + checkout/conformance2/rendering/blitframebuffer-stencil-only.html + checkout/conformance2/rendering/blitframebuffer-test.html + checkout/conformance2/rendering/canvas-resizing-with-pbo-bound.html + checkout/conformance2/rendering/clear-func-buffer-type-match.html + checkout/conformance2/rendering/clear-srgb-color-buffer.html + checkout/conformance2/rendering/clipping-wide-points.html + checkout/conformance2/rendering/draw-buffers.html + checkout/conformance2/rendering/element-index-uint.html + checkout/conformance2/rendering/framebuffer-completeness-unaffected.html + checkout/conformance2/rendering/framebuffer-unsupported.html + checkout/conformance2/rendering/fs-color-type-mismatch-color-buffer-type.html + checkout/conformance2/rendering/instanced-arrays.html + checkout/conformance2/rendering/instanced-rendering-bug.html + checkout/conformance2/rendering/out-of-bounds-index-buffers-after-copying.html + checkout/conformance2/rendering/rendering-sampling-feedback-loop.html + checkout/conformance2/rendering/rgb-format-support.html + checkout/conformance2/rendering/uniform-block-buffer-size.html + checkout/conformance2/samplers/00_test_list.txt + checkout/conformance2/samplers/sampler-drawing-test.html + checkout/conformance2/samplers/samplers.html + checkout/conformance2/state/00_test_list.txt + checkout/conformance2/state/gl-enum-tests.html + checkout/conformance2/state/gl-get-calls.html + checkout/conformance2/state/gl-getstring.html + checkout/conformance2/state/gl-object-get-calls.html + checkout/conformance2/sync/00_test_list.txt + checkout/conformance2/sync/sync-webgl-specific.html + checkout/conformance2/textures/00_test_list.txt + checkout/conformance2/textures/canvas/00_test_list.txt + checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/canvas/tex-2d-r16f-red-float.html + checkout/conformance2/textures/canvas/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/canvas/tex-2d-r32f-red-float.html + checkout/conformance2/textures/canvas/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/canvas/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/canvas/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/canvas/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/canvas/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/canvas/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/canvas/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/canvas/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/canvas/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/canvas/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/canvas/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/canvas/tex-3d-r16f-red-float.html + checkout/conformance2/textures/canvas/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/canvas/tex-3d-r32f-red-float.html + checkout/conformance2/textures/canvas/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/canvas/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/canvas/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/canvas/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/canvas/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/canvas/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/canvas/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/canvas/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/canvas/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/canvas/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/canvas/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/00_test_list.txt + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r32f-red-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r32f-red-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/canvas_sub_rectangle/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image/00_test_list.txt + checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/00_test_list.txt + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_blob/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/00_test_list.txt + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/00_test_list.txt + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/00_test_list.txt + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/00_test_list.txt + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/00_test_list.txt + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_bitmap_from_video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/00_test_list.txt + checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_data/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_data/tex-2d-r16f-red-float.html + checkout/conformance2/textures/image_data/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/image_data/tex-2d-r32f-red-float.html + checkout/conformance2/textures/image_data/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/image_data/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_data/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/image_data/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_data/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_data/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_data/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_data/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_data/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_data/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_data/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/image_data/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/image_data/tex-3d-r16f-red-float.html + checkout/conformance2/textures/image_data/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/image_data/tex-3d-r32f-red-float.html + checkout/conformance2/textures/image_data/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/image_data/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/image_data/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/image_data/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/image_data/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/image_data/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/image_data/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/image_data/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/image_data/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/image_data/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/image_data/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/image_data/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/misc/00_test_list.txt + checkout/conformance2/textures/misc/active-3d-texture-bug.html + checkout/conformance2/textures/misc/compressed-tex-image.html + checkout/conformance2/textures/misc/copy-texture-image-luma-format.html + checkout/conformance2/textures/misc/copy-texture-image-webgl-specific.html + checkout/conformance2/textures/misc/copy-texture-image.html + checkout/conformance2/textures/misc/gl-get-tex-parameter.html + checkout/conformance2/textures/misc/integer-cubemap-specification-order-bug.html + checkout/conformance2/textures/misc/integer-cubemap-texture-sampling.html + checkout/conformance2/textures/misc/mipmap-fbo.html + checkout/conformance2/textures/misc/tex-3d-size-limit.html + checkout/conformance2/textures/misc/tex-image-and-sub-image-with-array-buffer-view-sub-source.html + checkout/conformance2/textures/misc/tex-image-with-bad-args-from-dom-elements.html + checkout/conformance2/textures/misc/tex-image-with-bad-args.html + checkout/conformance2/textures/misc/tex-image-with-different-data-source.html + checkout/conformance2/textures/misc/tex-input-validation.html + checkout/conformance2/textures/misc/tex-mipmap-levels.html + checkout/conformance2/textures/misc/tex-new-formats.html + checkout/conformance2/textures/misc/tex-srgb-mipmap.html + checkout/conformance2/textures/misc/tex-storage-2d.html + checkout/conformance2/textures/misc/tex-storage-and-subimage-3d.html + checkout/conformance2/textures/misc/tex-storage-compressed-formats.html + checkout/conformance2/textures/misc/tex-unpack-params.html + checkout/conformance2/textures/misc/texel-fetch-undefined.html + checkout/conformance2/textures/misc/texture-npot.html + checkout/conformance2/textures/svg_image/00_test_list.txt + checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/svg_image/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/svg_image/tex-2d-r16f-red-float.html + checkout/conformance2/textures/svg_image/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/svg_image/tex-2d-r32f-red-float.html + checkout/conformance2/textures/svg_image/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/svg_image/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/svg_image/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/svg_image/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/svg_image/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/svg_image/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/svg_image/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/svg_image/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/svg_image/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/svg_image/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/svg_image/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/svg_image/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/svg_image/tex-3d-r16f-red-float.html + checkout/conformance2/textures/svg_image/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/svg_image/tex-3d-r32f-red-float.html + checkout/conformance2/textures/svg_image/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/svg_image/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/svg_image/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/svg_image/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/svg_image/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/svg_image/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/svg_image/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/svg_image/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/svg_image/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/svg_image/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/svg_image/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/svg_image/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/video/00_test_list.txt + checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/video/tex-2d-r16f-red-float.html + checkout/conformance2/textures/video/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/video/tex-2d-r32f-red-float.html + checkout/conformance2/textures/video/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/video/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/video/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/video/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/video/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/video/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/video/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/video/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/video/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/video/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/video/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/video/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/video/tex-3d-r16f-red-float.html + checkout/conformance2/textures/video/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/video/tex-3d-r32f-red-float.html + checkout/conformance2/textures/video/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/video/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/video/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/video/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/video/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/video/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/video/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/video/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/video/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/video/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/video/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/video/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/00_test_list.txt + checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-r16f-red-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-r32f-red-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-r8-red-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rg16f-rg-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rg32f-rg-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb32f-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgba32f-rgba-float.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r16f-red-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r32f-red-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r8-red-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-r8ui-red_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rg16f-rg-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rg32f-rg-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rg8-rg-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb16f-rgb-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb32f-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgb9_e5-rgb-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgba16f-rgba-half_float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgba32f-rgba-float.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8-rgba-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8-rgb-unsigned_byte.html + checkout/conformance2/textures/webgl_canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html + checkout/conformance2/transform_feedback/00_test_list.txt + checkout/conformance2/transform_feedback/transform_feedback.html + checkout/conformance2/transform_feedback/two-unreferenced-varyings.html + checkout/conformance2/transform_feedback/unwritten-output-defaults-to-zero.html + checkout/conformance2/vertex_arrays/00_test_list.txt + checkout/conformance2/vertex_arrays/vertex-array-object.html + checkout/deqp/00_test_list.txt + checkout/deqp/LICENSE + checkout/deqp/README.md + checkout/deqp/build.py + checkout/deqp/compiler.jar + checkout/deqp/compiler_additional_extern.js + checkout/deqp/data/gles2/shaders/00_test_list.txt + checkout/deqp/data/gles2/shaders/conditionals.html + checkout/deqp/data/gles2/shaders/conditionals.test + checkout/deqp/data/gles2/shaders/constant_expressions.html + checkout/deqp/data/gles2/shaders/constant_expressions.test + checkout/deqp/data/gles2/shaders/constants.html + checkout/deqp/data/gles2/shaders/constants.test + checkout/deqp/data/gles2/shaders/conversions.html + checkout/deqp/data/gles2/shaders/conversions.test + checkout/deqp/data/gles2/shaders/declarations.html + checkout/deqp/data/gles2/shaders/declarations.test + checkout/deqp/data/gles2/shaders/fragdata.html + checkout/deqp/data/gles2/shaders/fragdata.test + checkout/deqp/data/gles2/shaders/functions.html + checkout/deqp/data/gles2/shaders/functions.test + checkout/deqp/data/gles2/shaders/invalid_texture_functions.html + checkout/deqp/data/gles2/shaders/invalid_texture_functions.test + checkout/deqp/data/gles2/shaders/keywords.html + checkout/deqp/data/gles2/shaders/keywords.test + checkout/deqp/data/gles2/shaders/linkage.html + checkout/deqp/data/gles2/shaders/linkage.test + checkout/deqp/data/gles2/shaders/preprocessor.html + checkout/deqp/data/gles2/shaders/preprocessor.test + checkout/deqp/data/gles2/shaders/qualification_order.html + checkout/deqp/data/gles2/shaders/qualification_order.test + checkout/deqp/data/gles2/shaders/reserved_operators.html + checkout/deqp/data/gles2/shaders/reserved_operators.test + checkout/deqp/data/gles2/shaders/scoping.html + checkout/deqp/data/gles2/shaders/scoping.test + checkout/deqp/data/gles2/shaders/shader-lib-test.html + checkout/deqp/data/gles2/shaders/swizzles.html + checkout/deqp/data/gles2/shaders/swizzles.test + checkout/deqp/data/gles2/shaders/template.html + checkout/deqp/data/gles3/shaders/00_test_list.txt + checkout/deqp/data/gles3/shaders/arrays.html + checkout/deqp/data/gles3/shaders/arrays.test + checkout/deqp/data/gles3/shaders/conditionals.html + checkout/deqp/data/gles3/shaders/conditionals.test + checkout/deqp/data/gles3/shaders/constant_expressions.html + checkout/deqp/data/gles3/shaders/constant_expressions.test + checkout/deqp/data/gles3/shaders/constants.html + checkout/deqp/data/gles3/shaders/constants.test + checkout/deqp/data/gles3/shaders/conversions.html + checkout/deqp/data/gles3/shaders/conversions.test + checkout/deqp/data/gles3/shaders/declarations.html + checkout/deqp/data/gles3/shaders/declarations.test + checkout/deqp/data/gles3/shaders/fragdata.html + checkout/deqp/data/gles3/shaders/fragdata.test + checkout/deqp/data/gles3/shaders/functions.html + checkout/deqp/data/gles3/shaders/functions.test + checkout/deqp/data/gles3/shaders/invalid_texture_functions.html + checkout/deqp/data/gles3/shaders/invalid_texture_functions.test + checkout/deqp/data/gles3/shaders/keywords.html + checkout/deqp/data/gles3/shaders/keywords.test + checkout/deqp/data/gles3/shaders/linkage.html + checkout/deqp/data/gles3/shaders/linkage.test + checkout/deqp/data/gles3/shaders/negative.html + checkout/deqp/data/gles3/shaders/negative.test + checkout/deqp/data/gles3/shaders/preprocessor.html + checkout/deqp/data/gles3/shaders/preprocessor.test + checkout/deqp/data/gles3/shaders/qualification_order.html + checkout/deqp/data/gles3/shaders/qualification_order.test + checkout/deqp/data/gles3/shaders/scoping.html + checkout/deqp/data/gles3/shaders/scoping.test + checkout/deqp/data/gles3/shaders/switch.html + checkout/deqp/data/gles3/shaders/switch.test + checkout/deqp/data/gles3/shaders/swizzles.html + checkout/deqp/data/gles3/shaders/swizzles.test + checkout/deqp/data/gles3/shaders/template.html + checkout/deqp/deqp-deps.js + checkout/deqp/framework/common/tcuBilinearImageCompare.js + checkout/deqp/framework/common/tcuCompressedTexture.js + checkout/deqp/framework/common/tcuFloat.js + checkout/deqp/framework/common/tcuFloatFormat.js + checkout/deqp/framework/common/tcuFuzzyImageCompare.js + checkout/deqp/framework/common/tcuImageCompare.js + checkout/deqp/framework/common/tcuInterval.js + checkout/deqp/framework/common/tcuLogImage.js + checkout/deqp/framework/common/tcuMatrix.js + checkout/deqp/framework/common/tcuMatrixUtil.js + checkout/deqp/framework/common/tcuPixelFormat.js + checkout/deqp/framework/common/tcuRGBA.js + checkout/deqp/framework/common/tcuSkipList.js + checkout/deqp/framework/common/tcuStringTemplate.js + checkout/deqp/framework/common/tcuSurface.js + checkout/deqp/framework/common/tcuTestCase.js + checkout/deqp/framework/common/tcuTexCompareVerifier.js + checkout/deqp/framework/common/tcuTexLookupVerifier.js + checkout/deqp/framework/common/tcuTexVerifierUtil.js + checkout/deqp/framework/common/tcuTexture.js + checkout/deqp/framework/common/tcuTextureUtil.js + checkout/deqp/framework/delibs/debase/deMath.js + checkout/deqp/framework/delibs/debase/deRandom.js + checkout/deqp/framework/delibs/debase/deString.js + checkout/deqp/framework/delibs/debase/deUtil.js + checkout/deqp/framework/opengl/gluDrawUtil.js + checkout/deqp/framework/opengl/gluObjectWrapper.js + checkout/deqp/framework/opengl/gluPixelTransfer.js + checkout/deqp/framework/opengl/gluShaderProgram.js + checkout/deqp/framework/opengl/gluShaderUtil.js + checkout/deqp/framework/opengl/gluStrUtil.js + checkout/deqp/framework/opengl/gluTexture.js + checkout/deqp/framework/opengl/gluTextureUtil.js + checkout/deqp/framework/opengl/gluVarType.js + checkout/deqp/framework/opengl/gluVarTypeUtil.js + checkout/deqp/framework/opengl/simplereference/00_test_list.txt + checkout/deqp/framework/opengl/simplereference/referencecontext.html + checkout/deqp/framework/opengl/simplereference/sglrGLContext.js + checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js + checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js + checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js + checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js + checkout/deqp/framework/referencerenderer/rrDefs.js + checkout/deqp/framework/referencerenderer/rrFragmentOperations.js + checkout/deqp/framework/referencerenderer/rrGenericVector.js + checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js + checkout/deqp/framework/referencerenderer/rrRenderState.js + checkout/deqp/framework/referencerenderer/rrRenderer.js + checkout/deqp/framework/referencerenderer/rrShaders.js + checkout/deqp/framework/referencerenderer/rrShadingContext.js + checkout/deqp/framework/referencerenderer/rrUtil.js + checkout/deqp/framework/referencerenderer/rrVertexAttrib.js + checkout/deqp/framework/referencerenderer/rrVertexPacket.js + checkout/deqp/functional/gles3/00_test_list.txt + checkout/deqp/functional/gles3/attriblocation.html + checkout/deqp/functional/gles3/booleanstatequery.html + checkout/deqp/functional/gles3/buffercopy.html + checkout/deqp/functional/gles3/bufferobjectquery.html + checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt + checkout/deqp/functional/gles3/builtinprecision/abs.html + checkout/deqp/functional/gles3/builtinprecision/acos.html + checkout/deqp/functional/gles3/builtinprecision/acosh.html + checkout/deqp/functional/gles3/builtinprecision/add.html + checkout/deqp/functional/gles3/builtinprecision/asin.html + checkout/deqp/functional/gles3/builtinprecision/asinh.html + checkout/deqp/functional/gles3/builtinprecision/atan.html + checkout/deqp/functional/gles3/builtinprecision/atan2.html + checkout/deqp/functional/gles3/builtinprecision/atanh.html + checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py + checkout/deqp/functional/gles3/builtinprecision/ceil.html + checkout/deqp/functional/gles3/builtinprecision/clamp.html + checkout/deqp/functional/gles3/builtinprecision/cos.html + checkout/deqp/functional/gles3/builtinprecision/cosh.html + checkout/deqp/functional/gles3/builtinprecision/cross.html + checkout/deqp/functional/gles3/builtinprecision/degrees.html + checkout/deqp/functional/gles3/builtinprecision/determinant.html + checkout/deqp/functional/gles3/builtinprecision/distance.html + checkout/deqp/functional/gles3/builtinprecision/div.html + checkout/deqp/functional/gles3/builtinprecision/dot.html + checkout/deqp/functional/gles3/builtinprecision/exp.html + checkout/deqp/functional/gles3/builtinprecision/exp2.html + checkout/deqp/functional/gles3/builtinprecision/faceforward.html + checkout/deqp/functional/gles3/builtinprecision/floor.html + checkout/deqp/functional/gles3/builtinprecision/fract.html + checkout/deqp/functional/gles3/builtinprecision/inverse.html + checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html + checkout/deqp/functional/gles3/builtinprecision/length.html + checkout/deqp/functional/gles3/builtinprecision/log.html + checkout/deqp/functional/gles3/builtinprecision/log2.html + checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html + checkout/deqp/functional/gles3/builtinprecision/max.html + checkout/deqp/functional/gles3/builtinprecision/min.html + checkout/deqp/functional/gles3/builtinprecision/mix.html + checkout/deqp/functional/gles3/builtinprecision/mod.html + checkout/deqp/functional/gles3/builtinprecision/modf.html + checkout/deqp/functional/gles3/builtinprecision/mul.html + checkout/deqp/functional/gles3/builtinprecision/normalize.html + checkout/deqp/functional/gles3/builtinprecision/outerproduct.html + checkout/deqp/functional/gles3/builtinprecision/pow.html + checkout/deqp/functional/gles3/builtinprecision/radians.html + checkout/deqp/functional/gles3/builtinprecision/reflect.html + checkout/deqp/functional/gles3/builtinprecision/refract.html + checkout/deqp/functional/gles3/builtinprecision/round.html + checkout/deqp/functional/gles3/builtinprecision/roundeven.html + checkout/deqp/functional/gles3/builtinprecision/sign.html + checkout/deqp/functional/gles3/builtinprecision/sin.html + checkout/deqp/functional/gles3/builtinprecision/sinh.html + checkout/deqp/functional/gles3/builtinprecision/smoothstep.html + checkout/deqp/functional/gles3/builtinprecision/sqrt.html + checkout/deqp/functional/gles3/builtinprecision/step.html + checkout/deqp/functional/gles3/builtinprecision/sub.html + checkout/deqp/functional/gles3/builtinprecision/tan.html + checkout/deqp/functional/gles3/builtinprecision/tanh.html + checkout/deqp/functional/gles3/builtinprecision/transpose.html + checkout/deqp/functional/gles3/builtinprecision/trunc.html + checkout/deqp/functional/gles3/clipping.html + checkout/deqp/functional/gles3/defaultvertexattribute.html + checkout/deqp/functional/gles3/draw/00_test_list.txt + checkout/deqp/functional/gles3/draw/draw_arrays.html + checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html + checkout/deqp/functional/gles3/draw/draw_elements.html + checkout/deqp/functional/gles3/draw/draw_elements_instanced.html + checkout/deqp/functional/gles3/draw/draw_range_elements.html + checkout/deqp/functional/gles3/draw/draw_test_generator.py + checkout/deqp/functional/gles3/draw/instancing.html + checkout/deqp/functional/gles3/draw/random.html + checkout/deqp/functional/gles3/es3fApiCase.js + checkout/deqp/functional/gles3/es3fAttribLocationTests.js + checkout/deqp/functional/gles3/es3fBooleanStateQuery.js + checkout/deqp/functional/gles3/es3fBufferCopyTests.js + checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js + checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js + checkout/deqp/functional/gles3/es3fClippingTests.js + checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js + checkout/deqp/functional/gles3/es3fDrawTests.js + checkout/deqp/functional/gles3/es3fFboColorbufferTests.js + checkout/deqp/functional/gles3/es3fFboCompletenessTests.js + checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js + checkout/deqp/functional/gles3/es3fFboInvalidateTests.js + checkout/deqp/functional/gles3/es3fFboMultisampleTests.js + checkout/deqp/functional/gles3/es3fFboRenderTest.js + checkout/deqp/functional/gles3/es3fFboStateQueryTests.js + checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js + checkout/deqp/functional/gles3/es3fFboTestCase.js + checkout/deqp/functional/gles3/es3fFboTestUtil.js + checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js + checkout/deqp/functional/gles3/es3fFragDepthTests.js + checkout/deqp/functional/gles3/es3fFragmentOutputTests.js + checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js + checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js + checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js + checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js + checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js + checkout/deqp/functional/gles3/es3fLifetimeTests.js + checkout/deqp/functional/gles3/es3fMultisampleTests.js + checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js + checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js + checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js + checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js + checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js + checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js + checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js + checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js + checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js + checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js + checkout/deqp/functional/gles3/es3fRboStateQueryTests.js + checkout/deqp/functional/gles3/es3fReadPixelTests.js + checkout/deqp/functional/gles3/es3fSamplerObjectTests.js + checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js + checkout/deqp/functional/gles3/es3fShaderApiTests.js + checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js + checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js + checkout/deqp/functional/gles3/es3fShaderDerivateTests.js + checkout/deqp/functional/gles3/es3fShaderIndexingTests.js + checkout/deqp/functional/gles3/es3fShaderLoopTests.js + checkout/deqp/functional/gles3/es3fShaderMatrixTest.js + checkout/deqp/functional/gles3/es3fShaderOperatorTests.js + checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js + checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js + checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js + checkout/deqp/functional/gles3/es3fShaderStructTests.js + checkout/deqp/functional/gles3/es3fShaderSwitchTests.js + checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js + checkout/deqp/functional/gles3/es3fStringQueryTests.js + checkout/deqp/functional/gles3/es3fSyncTests.js + checkout/deqp/functional/gles3/es3fTextureFilteringTests.js + checkout/deqp/functional/gles3/es3fTextureFormatTests.js + checkout/deqp/functional/gles3/es3fTextureShadowTests.js + checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js + checkout/deqp/functional/gles3/es3fTextureStateQuery.js + checkout/deqp/functional/gles3/es3fTextureWrapTests.js + checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js + checkout/deqp/functional/gles3/es3fUniformApiTests.js + checkout/deqp/functional/gles3/es3fUniformBlockTests.js + checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js + checkout/deqp/functional/gles3/es3fVertexArrayTests.js + checkout/deqp/functional/gles3/fbocolorbuffer.html + checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt + checkout/deqp/functional/gles3/fbocolorbuffer/blend.html + checkout/deqp/functional/gles3/fbocolorbuffer/clear.html + checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py + checkout/deqp/functional/gles3/fbocolorbuffer/tex2d.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex3d.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html + checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html + checkout/deqp/functional/gles3/fbocolorbuffer/texcube.html + checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html + checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html + checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html + checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html + checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html + checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html + checkout/deqp/functional/gles3/fbocompleteness.html + checkout/deqp/functional/gles3/fbodepthbuffer.html + checkout/deqp/functional/gles3/fboinvalidate.html + checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt + checkout/deqp/functional/gles3/fboinvalidate/default.html + checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py + checkout/deqp/functional/gles3/fboinvalidate/format_00.html + checkout/deqp/functional/gles3/fboinvalidate/format_01.html + checkout/deqp/functional/gles3/fboinvalidate/format_02.html + checkout/deqp/functional/gles3/fboinvalidate/sub.html + checkout/deqp/functional/gles3/fboinvalidate/target.html + checkout/deqp/functional/gles3/fboinvalidate/whole.html + checkout/deqp/functional/gles3/fbomultisample.2_samples.html + checkout/deqp/functional/gles3/fbomultisample.4_samples.html + checkout/deqp/functional/gles3/fbomultisample.8_samples.html + checkout/deqp/functional/gles3/fbomultisample.html + checkout/deqp/functional/gles3/fborender.html + checkout/deqp/functional/gles3/fborender/00_test_list.txt + checkout/deqp/functional/gles3/fborender/fborender_test_generator.py + checkout/deqp/functional/gles3/fborender/recreate_color_00.html + checkout/deqp/functional/gles3/fborender/recreate_color_01.html + checkout/deqp/functional/gles3/fborender/recreate_color_02.html + checkout/deqp/functional/gles3/fborender/recreate_color_03.html + checkout/deqp/functional/gles3/fborender/recreate_color_04.html + checkout/deqp/functional/gles3/fborender/recreate_color_05.html + checkout/deqp/functional/gles3/fborender/recreate_color_06.html + checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html + checkout/deqp/functional/gles3/fborender/resize_00.html + checkout/deqp/functional/gles3/fborender/resize_01.html + checkout/deqp/functional/gles3/fborender/resize_02.html + checkout/deqp/functional/gles3/fborender/resize_03.html + checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html + checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html + checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html + checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html + checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html + checkout/deqp/functional/gles3/fborender/stencil_clear.html + checkout/deqp/functional/gles3/fbostatequery.html + checkout/deqp/functional/gles3/fbostencilbuffer.html + checkout/deqp/functional/gles3/floatstatequery.html + checkout/deqp/functional/gles3/fragdepth.html + checkout/deqp/functional/gles3/fragmentoutput.html + checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt + checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html + checkout/deqp/functional/gles3/fragmentoutput/array.float.html + checkout/deqp/functional/gles3/fragmentoutput/array.int.html + checkout/deqp/functional/gles3/fragmentoutput/array.uint.html + checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html + checkout/deqp/functional/gles3/fragmentoutput/basic.float.html + checkout/deqp/functional/gles3/fragmentoutput/basic.int.html + checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html + checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py + checkout/deqp/functional/gles3/fragmentoutput/random_00.html + checkout/deqp/functional/gles3/fragmentoutput/random_01.html + checkout/deqp/functional/gles3/fragmentoutput/random_02.html + checkout/deqp/functional/gles3/framebufferblit.html + checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt + checkout/deqp/functional/gles3/framebufferblit/conversion_00.html + checkout/deqp/functional/gles3/framebufferblit/conversion_01.html + checkout/deqp/functional/gles3/framebufferblit/conversion_02.html + checkout/deqp/functional/gles3/framebufferblit/conversion_03.html + checkout/deqp/functional/gles3/framebufferblit/conversion_04.html + checkout/deqp/functional/gles3/framebufferblit/conversion_05.html + checkout/deqp/functional/gles3/framebufferblit/conversion_06.html + checkout/deqp/functional/gles3/framebufferblit/conversion_07.html + checkout/deqp/functional/gles3/framebufferblit/conversion_08.html + checkout/deqp/functional/gles3/framebufferblit/conversion_09.html + checkout/deqp/functional/gles3/framebufferblit/conversion_10.html + checkout/deqp/functional/gles3/framebufferblit/conversion_11.html + checkout/deqp/functional/gles3/framebufferblit/conversion_12.html + checkout/deqp/functional/gles3/framebufferblit/conversion_13.html + checkout/deqp/functional/gles3/framebufferblit/conversion_14.html + checkout/deqp/functional/gles3/framebufferblit/conversion_15.html + checkout/deqp/functional/gles3/framebufferblit/conversion_16.html + checkout/deqp/functional/gles3/framebufferblit/conversion_17.html + checkout/deqp/functional/gles3/framebufferblit/conversion_18.html + checkout/deqp/functional/gles3/framebufferblit/conversion_19.html + checkout/deqp/functional/gles3/framebufferblit/conversion_20.html + checkout/deqp/functional/gles3/framebufferblit/conversion_21.html + checkout/deqp/functional/gles3/framebufferblit/conversion_22.html + checkout/deqp/functional/gles3/framebufferblit/conversion_23.html + checkout/deqp/functional/gles3/framebufferblit/conversion_24.html + checkout/deqp/functional/gles3/framebufferblit/conversion_25.html + checkout/deqp/functional/gles3/framebufferblit/conversion_26.html + checkout/deqp/functional/gles3/framebufferblit/conversion_27.html + checkout/deqp/functional/gles3/framebufferblit/conversion_28.html + checkout/deqp/functional/gles3/framebufferblit/conversion_29.html + checkout/deqp/functional/gles3/framebufferblit/conversion_30.html + checkout/deqp/functional/gles3/framebufferblit/conversion_31.html + checkout/deqp/functional/gles3/framebufferblit/conversion_32.html + checkout/deqp/functional/gles3/framebufferblit/conversion_33.html + checkout/deqp/functional/gles3/framebufferblit/conversion_34.html + checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html + checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html + checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html + checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html + checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html + checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html + checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html + checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html + checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py + checkout/deqp/functional/gles3/framebufferblit/rect_00.html + checkout/deqp/functional/gles3/framebufferblit/rect_01.html + checkout/deqp/functional/gles3/framebufferblit/rect_02.html + checkout/deqp/functional/gles3/framebufferblit/rect_03.html + checkout/deqp/functional/gles3/framebufferblit/rect_04.html + checkout/deqp/functional/gles3/framebufferblit/rect_05.html + checkout/deqp/functional/gles3/framebufferblit/rect_06.html + checkout/deqp/functional/gles3/indexedstatequery.html + checkout/deqp/functional/gles3/instancedrendering.html + checkout/deqp/functional/gles3/integerstatequery.html + checkout/deqp/functional/gles3/internalformatquery.html + checkout/deqp/functional/gles3/lifetime.html + checkout/deqp/functional/gles3/multisample.html + checkout/deqp/functional/gles3/negativebufferapi.html + checkout/deqp/functional/gles3/negativefragmentapi.html + checkout/deqp/functional/gles3/negativeshaderapi.html + checkout/deqp/functional/gles3/negativestateapi.html + checkout/deqp/functional/gles3/negativetextureapi.html + checkout/deqp/functional/gles3/negativevertexarrayapi.html + checkout/deqp/functional/gles3/occlusionquery.html + checkout/deqp/functional/gles3/occlusionquery_conservative.html + checkout/deqp/functional/gles3/occlusionquery_strict.html + checkout/deqp/functional/gles3/pixelbufferobject.html + checkout/deqp/functional/gles3/primitiverestart.html + checkout/deqp/functional/gles3/primitiverestart/00.html + checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt + checkout/deqp/functional/gles3/primitiverestart/01.html + checkout/deqp/functional/gles3/primitiverestart/02.html + checkout/deqp/functional/gles3/primitiverestart/03.html + checkout/deqp/functional/gles3/primitiverestart/04.html + checkout/deqp/functional/gles3/primitiverestart/05.html + checkout/deqp/functional/gles3/primitiverestart/06.html + checkout/deqp/functional/gles3/primitiverestart/07.html + checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py + checkout/deqp/functional/gles3/rasterizerdiscard.html + checkout/deqp/functional/gles3/rbostatequery.html + checkout/deqp/functional/gles3/readpixel.html + checkout/deqp/functional/gles3/samplerobject.html + checkout/deqp/functional/gles3/samplerstatequery.html + checkout/deqp/functional/gles3/shaderapi.html + checkout/deqp/functional/gles3/shaderbuiltinvar.html + checkout/deqp/functional/gles3/shadercommonfunction.html + checkout/deqp/functional/gles3/shaderderivate.html + checkout/deqp/functional/gles3/shaderderivate_dfdx.html + checkout/deqp/functional/gles3/shaderderivate_dfdy.html + checkout/deqp/functional/gles3/shaderderivate_fwidth.html + checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt + checkout/deqp/functional/gles3/shaderindexing/mat_00.html + checkout/deqp/functional/gles3/shaderindexing/mat_01.html + checkout/deqp/functional/gles3/shaderindexing/mat_02.html + checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py + checkout/deqp/functional/gles3/shaderindexing/tmp.html + checkout/deqp/functional/gles3/shaderindexing/uniform.html + checkout/deqp/functional/gles3/shaderindexing/varying.html + checkout/deqp/functional/gles3/shaderindexing/vec2.html + checkout/deqp/functional/gles3/shaderindexing/vec3.html + checkout/deqp/functional/gles3/shaderindexing/vec4.html + checkout/deqp/functional/gles3/shaderloop_do_while.html + checkout/deqp/functional/gles3/shaderloop_for.html + checkout/deqp/functional/gles3/shaderloop_while.html + checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt + checkout/deqp/functional/gles3/shadermatrix/add_assign.html + checkout/deqp/functional/gles3/shadermatrix/add_const.html + checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html + checkout/deqp/functional/gles3/shadermatrix/add_uniform.html + checkout/deqp/functional/gles3/shadermatrix/determinant.html + checkout/deqp/functional/gles3/shadermatrix/div_assign.html + checkout/deqp/functional/gles3/shadermatrix/div_const.html + checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html + checkout/deqp/functional/gles3/shadermatrix/div_uniform.html + checkout/deqp/functional/gles3/shadermatrix/inverse.html + checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html + checkout/deqp/functional/gles3/shadermatrix/mul_assign.html + checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html + checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html + checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html + checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html + checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html + checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html + checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html + checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html + checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html + checkout/deqp/functional/gles3/shadermatrix/negation.html + checkout/deqp/functional/gles3/shadermatrix/outerproduct.html + checkout/deqp/functional/gles3/shadermatrix/post_decrement.html + checkout/deqp/functional/gles3/shadermatrix/post_increment.html + checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html + checkout/deqp/functional/gles3/shadermatrix/pre_increment.html + checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py + checkout/deqp/functional/gles3/shadermatrix/sub_assign.html + checkout/deqp/functional/gles3/shadermatrix/sub_const.html + checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html + checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html + checkout/deqp/functional/gles3/shadermatrix/transpose.html + checkout/deqp/functional/gles3/shadermatrix/unary_addition.html + checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt + checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry.html + checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html + checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html + checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html + checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html + checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html + checkout/deqp/functional/gles3/shaderoperator/bool_compare.html + checkout/deqp/functional/gles3/shaderoperator/common_fucntions.html + checkout/deqp/functional/gles3/shaderoperator/common_functions.html + checkout/deqp/functional/gles3/shaderoperator/exponential.html + checkout/deqp/functional/gles3/shaderoperator/float_compare.html + checkout/deqp/functional/gles3/shaderoperator/geometric.html + checkout/deqp/functional/gles3/shaderoperator/int_compare.html + checkout/deqp/functional/gles3/shaderoperator/selection.html + checkout/deqp/functional/gles3/shaderoperator/sequence.html + checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py + checkout/deqp/functional/gles3/shaderoperator/unary_operator.html + checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html + checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html + checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html + checkout/deqp/functional/gles3/shaderpackingfunction.html + checkout/deqp/functional/gles3/shaderprecision_float.html + checkout/deqp/functional/gles3/shaderprecision_int.html + checkout/deqp/functional/gles3/shaderprecision_uint.html + checkout/deqp/functional/gles3/shaderstatequery.html + checkout/deqp/functional/gles3/shaderstruct.html + checkout/deqp/functional/gles3/shaderswitch.html + checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt + checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py + checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html + checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html + checkout/deqp/functional/gles3/shadertexturefunction/texture.html + checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html + checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html + checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html + checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html + checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html + checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html + checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html + checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html + checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html + checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html + checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html + checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html + checkout/deqp/functional/gles3/stringquery.html + checkout/deqp/functional/gles3/sync.html + checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt + checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html + checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html + checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html + checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html + checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html + checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html + checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html + checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html + checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html + checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html + checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html + checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html + checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html + checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html + checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html + checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html + checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html + checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html + checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html + checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html + checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html + checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html + checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html + checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html + checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html + checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html + checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html + checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html + checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html + checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html + checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html + checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html + checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html + checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html + checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html + checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py + checkout/deqp/functional/gles3/textureformat/00_test_list.txt + checkout/deqp/functional/gles3/textureformat/compressed_2d.html + checkout/deqp/functional/gles3/textureformat/compressed_cube.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html + checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html + checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html + checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py + checkout/deqp/functional/gles3/textureformat/unsized_2d.html + checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html + checkout/deqp/functional/gles3/textureformat/unsized_3d.html + checkout/deqp/functional/gles3/textureshadow/00_test_list.txt + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html + checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html + checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html + checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html + checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html + checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py + checkout/deqp/functional/gles3/texturespecification/00_test_list.txt + checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html + checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html + checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html + checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html + checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html + checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html + checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html + checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html + checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html + checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html + checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html + checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html + checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html + checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html + checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html + checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html + checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html + checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html + checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py + checkout/deqp/functional/gles3/texturestatequery.html + checkout/deqp/functional/gles3/texturewrap.html + checkout/deqp/functional/gles3/texturewrap/00_test_list.txt + checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html + checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html + checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html + checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html + checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html + checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html + checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html + checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html + checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html + checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html + checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html + checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html + checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html + checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html + checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html + checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html + checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html + checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html + checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html + checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html + checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html + checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html + checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py + checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt + checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html + checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html + checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html + checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html + checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html + checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html + checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html + checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html + checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html + checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html + checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html + checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html + checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html + checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html + checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html + checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html + checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html + checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html + checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html + checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html + checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html + checkout/deqp/functional/gles3/transformfeedback/point_size.html + checkout/deqp/functional/gles3/transformfeedback/position.html + checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html + checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html + checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html + checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html + checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html + checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html + checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py + checkout/deqp/functional/gles3/uniformapi.html + checkout/deqp/functional/gles3/uniformapi/00_test_list.txt + checkout/deqp/functional/gles3/uniformapi/info_query.html + checkout/deqp/functional/gles3/uniformapi/random.html + checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py + checkout/deqp/functional/gles3/uniformapi/value_assigned.html + checkout/deqp/functional/gles3/uniformapi/value_initial.html + checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt + checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html + checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html + checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html + checkout/deqp/functional/gles3/uniformbuffers/random.html + checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html + checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html + checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html + checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html + checkout/deqp/functional/gles3/uniformbuffers/single_struct.html + checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html + checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py + checkout/deqp/functional/gles3/vertexarrayobject.html + checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt + checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html + checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html + checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html + checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html + checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html + checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py + checkout/deqp/genHTMLfromTest.py + checkout/deqp/modules/shared/glsAttributeLocationTests.js + checkout/deqp/modules/shared/glsBufferTestUtil.js + checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js + checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js + checkout/deqp/modules/shared/glsDrawTests.js + checkout/deqp/modules/shared/glsFboCompletenessTests.js + checkout/deqp/modules/shared/glsFboUtil.js + checkout/deqp/modules/shared/glsLifetimeTests.js + checkout/deqp/modules/shared/glsRandomUniformBlockCase.js + checkout/deqp/modules/shared/glsSamplerObjectTest.js + checkout/deqp/modules/shared/glsShaderExecUtil.js + checkout/deqp/modules/shared/glsShaderLibrary.js + checkout/deqp/modules/shared/glsShaderLibraryCase.js + checkout/deqp/modules/shared/glsShaderRenderCase.js + checkout/deqp/modules/shared/glsStateQuery.js + checkout/deqp/modules/shared/glsTextureTestUtil.js + checkout/deqp/modules/shared/glsUniformBlockCase.js + checkout/deqp/modules/shared/glsVertexArrayTests.js + checkout/deqp/run-closure.sh + checkout/deqp/temp_externs/chrome.js + checkout/deqp/temp_externs/deprecated.js + checkout/deqp/temp_externs/es3.js + checkout/deqp/temp_externs/es5.js + checkout/deqp/temp_externs/es6.js + checkout/deqp/temp_externs/es6_collections.js + checkout/deqp/temp_externs/fileapi.js + checkout/deqp/temp_externs/flash.js + checkout/deqp/temp_externs/gecko_css.js + checkout/deqp/temp_externs/gecko_dom.js + checkout/deqp/temp_externs/gecko_event.js + checkout/deqp/temp_externs/gecko_xml.js + checkout/deqp/temp_externs/google.js + checkout/deqp/temp_externs/html5.js + checkout/deqp/temp_externs/ie_css.js + checkout/deqp/temp_externs/ie_dom.js + checkout/deqp/temp_externs/ie_event.js + checkout/deqp/temp_externs/ie_vml.js + checkout/deqp/temp_externs/intl.js + checkout/deqp/temp_externs/iphone.js + checkout/deqp/temp_externs/mediasource.js + checkout/deqp/temp_externs/page_visibility.js + checkout/deqp/temp_externs/v8.js + checkout/deqp/temp_externs/w3c_anim_timing.js + checkout/deqp/temp_externs/w3c_css.js + checkout/deqp/temp_externs/w3c_css3d.js + checkout/deqp/temp_externs/w3c_device_sensor_event.js + checkout/deqp/temp_externs/w3c_dom1.js + checkout/deqp/temp_externs/w3c_dom2.js + checkout/deqp/temp_externs/w3c_dom3.js + checkout/deqp/temp_externs/w3c_elementtraversal.js + checkout/deqp/temp_externs/w3c_encoding.js + checkout/deqp/temp_externs/w3c_event.js + checkout/deqp/temp_externs/w3c_event3.js + checkout/deqp/temp_externs/w3c_geolocation.js + checkout/deqp/temp_externs/w3c_indexeddb.js + checkout/deqp/temp_externs/w3c_navigation_timing.js + checkout/deqp/temp_externs/w3c_range.js + checkout/deqp/temp_externs/w3c_rtc.js + checkout/deqp/temp_externs/w3c_selectors.js + checkout/deqp/temp_externs/w3c_xml.js + checkout/deqp/temp_externs/webkit_css.js + checkout/deqp/temp_externs/webkit_dom.js + checkout/deqp/temp_externs/webkit_event.js + checkout/deqp/temp_externs/webkit_notifications.js + checkout/deqp/temp_externs/webstorage.js + checkout/deqp/temp_externs/window.js + checkout/deqp/test-webgl2.js + checkout/deqp/test-webgl2.sh + checkout/deqp/webgl2.js + checkout/extra/50x50pixel-black-with-red-triangle.png + checkout/extra/big-fbos-example.html + checkout/extra/buffer-gc-stress.html + checkout/extra/buffer-sizes.html + checkout/extra/canvas-compositing-test.html + checkout/extra/canvas-compositing-test.png + checkout/extra/constant-index-out-of-range.html + checkout/extra/context-creation-and-destruction-stress.html + checkout/extra/cube-map-uploads-out-of-order.html + checkout/extra/fbo-lost-context.html + checkout/extra/lots-of-polys-example.html + checkout/extra/lots-of-polys-shader-example.html + checkout/extra/multisample-corruption-stress.html + checkout/extra/offscreen-issue.html + checkout/extra/out-of-bounds-uniform-array-access.html + checkout/extra/out-of-memory.html + checkout/extra/out-of-resources.html + checkout/extra/out-of-vram.html + checkout/extra/point-no-attributes-stress.html + checkout/extra/program-test-1.html + checkout/extra/readpixels-after-alert.html + checkout/extra/sample-100.png + checkout/extra/sample-200.png + checkout/extra/sample-400.png + checkout/extra/sample.svg + checkout/extra/simulated-attrib-0-bug-test.html + checkout/extra/slow-shader-example.html + checkout/extra/tex-image-with-video-test.html + checkout/extra/tex-image-with-video-test.js + checkout/extra/texture-allocation-stress-test.html + checkout/extra/texture-sizing.html + checkout/extra/webgl-drawelements-validation.html + checkout/extra/webgl-info.html + checkout/extra/webgl-translate-shader.html + checkout/js/desktop-gl-constants.js + checkout/js/glsl-conformance-test.js + checkout/js/glsl-constructor-tests-generator.js + checkout/js/glsl-generator.js + checkout/js/js-test-post.js + checkout/js/js-test-pre.js + checkout/js/pnglib.js + checkout/js/test-eval.js + checkout/js/tests/clipping-wide-points.js + checkout/js/tests/compound-assignment-type-combination.js + checkout/js/tests/gl-enum-tests.js + checkout/js/tests/gl-get-tex-parameter.js + checkout/js/tests/gl-object-get-calls.js + checkout/js/tests/gl-vertex-attrib.js + checkout/js/tests/instanceof-test.js + checkout/js/tests/iterable-test.js + checkout/js/tests/oes-texture-float-and-half-float-linear.js + checkout/js/tests/out-of-bounds-test.js + checkout/js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js + checkout/js/tests/tex-image-and-sub-image-2d-with-canvas.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image-data.js + checkout/js/tests/tex-image-and-sub-image-2d-with-image.js + checkout/js/tests/tex-image-and-sub-image-2d-with-svg-image.js + checkout/js/tests/tex-image-and-sub-image-2d-with-video.js + checkout/js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js + checkout/js/tests/tex-image-and-sub-image-3d-with-canvas-sub-rectangle.js + checkout/js/tests/tex-image-and-sub-image-3d-with-canvas.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-canvas.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-bitmap.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image-data.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-image.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-video.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image-data.js + checkout/js/tests/tex-image-and-sub-image-3d-with-image.js + checkout/js/tests/tex-image-and-sub-image-3d-with-svg-image.js + checkout/js/tests/tex-image-and-sub-image-3d-with-video.js + checkout/js/tests/tex-image-and-sub-image-3d-with-webgl-canvas.js + checkout/js/tests/tex-image-and-sub-image-utils.js + checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js + checkout/js/tests/tex-input-validation.js + checkout/js/tests/typed-array-test-cases.js + checkout/js/tests/typed-array-worker.js + checkout/js/webgl-test-harness.js + checkout/js/webgl-test-utils.js + checkout/py/lint/LICENSE + checkout/py/lint/README.md + checkout/py/lint/lint.py + checkout/py/lint/lint.whitelist + checkout/py/tex_image_test_generator.py + checkout/resources/1-channel.jpg + checkout/resources/3x3.png + checkout/resources/blue-1x1.jpg + checkout/resources/boolUniformShader.vert + checkout/resources/bug-32888-texture.png + checkout/resources/floatUniformShader.vert + checkout/resources/fragmentShader.frag + checkout/resources/glsl-feature-tests.css + checkout/resources/glsl-generator.js + checkout/resources/gray-1024x1024.jpg + checkout/resources/gray-ramp-256-with-128-alpha.png + checkout/resources/gray-ramp-256.png + checkout/resources/gray-ramp-default-gamma.png + checkout/resources/gray-ramp-gamma0.1.png + checkout/resources/gray-ramp-gamma1.0.png + checkout/resources/gray-ramp-gamma2.0.png + checkout/resources/gray-ramp-gamma4.0.png + checkout/resources/gray-ramp-gamma9.0.png + checkout/resources/gray-ramp.png + checkout/resources/green-2x2-16bit.png + checkout/resources/intArrayUniformShader.vert + checkout/resources/intUniformShader.vert + checkout/resources/js-test-style.css + checkout/resources/matForWebGL2UniformShader.vert + checkout/resources/matUniformShader.vert + checkout/resources/noopUniformShader.frag + checkout/resources/noopUniformShader.vert + checkout/resources/noopUniformShaderES3.frag + checkout/resources/noopUniformShaderES3.vert + checkout/resources/npot-video.mp4 + checkout/resources/npot-video.theora.ogv + checkout/resources/npot-video.webmvp8.webm + checkout/resources/ogles-tests.css + checkout/resources/opengl_logo.jpg + checkout/resources/red-green-blue-cyan-4x4.png + checkout/resources/red-green-blue-cyan-4x4.psd + checkout/resources/red-green-semi-transparent.png + checkout/resources/red-green.mp4 + checkout/resources/red-green.png + checkout/resources/red-green.svg + checkout/resources/red-green.theora.ogv + checkout/resources/red-green.webmvp8.webm + checkout/resources/red-green.webmvp9.webm + checkout/resources/red-indexed.png + checkout/resources/samplerForWebGL2UniformShader.frag + checkout/resources/samplerUniformShader.frag + checkout/resources/small-square-with-cie-rgb-profile.png + checkout/resources/small-square-with-colormatch-profile.png + checkout/resources/small-square-with-colorspin-profile.jpg + checkout/resources/small-square-with-colorspin-profile.png + checkout/resources/small-square-with-e-srgb-profile.png + checkout/resources/small-square-with-smpte-c-profile.png + checkout/resources/small-square-with-srgb-iec61966-2.1-profile.png + checkout/resources/structUniformShader.vert + checkout/resources/thunderbird-logo-64x64.png + checkout/resources/transparent-on-left-indexed.png + checkout/resources/uintUniformShader.vert + checkout/resources/uniformBlockShader.frag + checkout/resources/uniformBlockShader.vert + checkout/resources/vertexShader.vert + checkout/resources/webgl-logo.png + checkout/resources/zero-alpha.png + checkout/test-guidelines.md + checkout/webgl-conformance-tests.html + iframe-passthrough.css + mochi-single.html + +[generated/test_..__always-fail.html] +fail-if = 1 +[generated/test_2_conformance2__attribs__gl-vertex-attrib-i-render.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__attribs__gl-vertex-attrib.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__attribs__gl-vertexattribipointer-offsets.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__attribs__gl-vertexattribipointer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__bound-buffer-size-change-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__buffer-copying-contents.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__buffer-copying-restrictions.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__buffer-data-and-buffer-sub-data-sub-source.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__buffer-overflow-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__buffer-type-restrictions.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__get-buffer-sub-data.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__one-large-uniform-buffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__buffers__uniform-buffers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__context__constants-and-properties-2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__context__context-attributes-depth-stencil-antialias-obeyed.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__context__context-type-test-2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__context__methods-2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__extensions__ext-color-buffer-float.html] +skip-if = (os == 'mac' && debug) || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__extensions__ext-disjoint-timer-query-webgl2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__extensions__promoted-extensions-in-shaders.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__extensions__promoted-extensions.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-as-return-value.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-assign-constructor.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-assign.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-complex-indexing.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-element-increment.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-equality.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-in-complex-expression.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__array-length-side-effects.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__attrib-location-length-limits.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__bool-type-cast-bug-uint-ivec-uvec.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__compare-structs-containing-arrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__compound-assignment-type-combination.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__const-array-init.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__forbidden-operators.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__frag-depth.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__invalid-default-precision.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__invalid-invariant.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__loops-with-side-effects.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__misplaced-version-directive.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__no-attribute-vertex-shader.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__sampler-no-precision.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__sequence-operator-returns-non-constant.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__shader-linking.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__shader-with-1024-character-define.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__shader-with-1024-character-identifier.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__shader-with-1025-character-define.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__shader-with-1025-character-identifier.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__shader-with-invalid-characters.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__shader-with-mis-matching-uniform-block.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__short-circuiting-in-loop-condition.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__texture-offset-out-of-range.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__texture-offset-uniform-texture-coordinate.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__tricky-loop-conditions.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__unary-minus-operator-in-dynamic-loop.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__uniform-block-layout-match.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__uniform-block-layouts.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__uniform-location-length-limits.html] +skip-if = (os == 'win' && debug) || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__valid-invariant.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__vector-dynamic-indexing-nv-driver-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__misc__expando-loss-2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__misc__getextension-while-pbo-bound-stability.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__misc__instanceof-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__misc__object-deletion-behaviour-2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__misc__uninitialized-test-2.html] +skip-if = (os == 'mac') || (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__misc__views-with-offsets.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__programs__active-built-in-attribs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__programs__gl-get-frag-data-location.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__query__occlusion-query.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__query__query.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__reading__format-r11f-g11f-b10f.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__reading__read-pixels-from-fbo-test.html] +skip-if = (os == 'mac') || (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__reading__read-pixels-from-rgb8-into-pbo-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__reading__read-pixels-into-pixel-pack-buffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__reading__read-pixels-pack-parameters.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__renderbuffers__framebuffer-object-attachment.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__renderbuffers__framebuffer-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__renderbuffers__framebuffer-texture-layer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__renderbuffers__invalidate-framebuffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__renderbuffers__multisample-with-full-sample-counts.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__renderbuffers__multisampled-renderbuffer-initialization.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__renderbuffers__readbuffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__attrib-type-match.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-filter-outofbounds.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-filter-srgb.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-multisampled-readbuffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-outside-readbuffer.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-scissor-enabled.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-size-overflow.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-srgb-and-linear-drawbuffers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-stencil-only.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__blitframebuffer-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__canvas-resizing-with-pbo-bound.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__clear-func-buffer-type-match.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__clear-srgb-color-buffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__clipping-wide-points.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__draw-buffers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__element-index-uint.html] +fail-if = (os != 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__framebuffer-completeness-unaffected.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__framebuffer-unsupported.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__fs-color-type-mismatch-color-buffer-type.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__instanced-arrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__instanced-rendering-bug.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__out-of-bounds-index-buffers-after-copying.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__rendering-sampling-feedback-loop.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__rgb-format-support.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__rendering__uniform-block-buffer-size.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__samplers__sampler-drawing-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__samplers__samplers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__state__gl-enum-tests.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__state__gl-get-calls.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__state__gl-getstring.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__state__gl-object-get-calls.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r32f-red-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8-red-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8ui-red_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg32f-rg-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8-rg-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb32f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba32f-rgba-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r16f-red-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r16f-red-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r32f-red-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r8-red-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-r8ui-red_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rg32f-rg-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rg8-rg-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb32f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgba32f-rgba-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgba8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-srgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__image_data__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__active-3d-texture-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__copy-texture-image-luma-format.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__copy-texture-image-webgl-specific.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__copy-texture-image.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__gl-get-tex-parameter.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__integer-cubemap-specification-order-bug.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__integer-cubemap-texture-sampling.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__mipmap-fbo.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-3d-size-limit.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-image-and-sub-image-with-array-buffer-view-sub-source.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-image-with-bad-args-from-dom-elements.html] +skip-if = (os == 'win') || (os == 'mac') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-image-with-bad-args.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-image-with-different-data-source.html] +skip-if = (os == 'mac' && debug) || (os == 'win' && debug) || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__textures__misc__tex-input-validation.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-mipmap-levels.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-new-formats.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-srgb-mipmap.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-storage-2d.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-storage-and-subimage-3d.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-storage-compressed-formats.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__tex-unpack-params.html] +skip-if = (os == 'mac' && debug) || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__misc__texel-fetch-undefined.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__misc__texture-npot.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r16f-red-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r16f-red-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r32f-red-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r8-red-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-r8ui-red_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rg32f-rg-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rg8-rg-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb32f-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-half_float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgba32f-rgba-float.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgba8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-srgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__video__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r32f-red-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8-red-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8ui-red_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg32f-rg-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8-rg-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb32f-rgb-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-half_float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba32f-rgba-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__transform_feedback__transform_feedback.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__transform_feedback__two-unreferenced-varyings.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__transform_feedback__unwritten-output-defaults-to-zero.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__vertex_arrays__vertex-array-object.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-bindAttribLocation-aliasing.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-bindAttribLocation-matrix.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-bindAttribLocation-repeated.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-disabled-vertex-attrib.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-enable-vertex-attrib.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-matrix-attributes.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-vertex-attrib-render.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-vertex-attrib-zero-issues.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-vertexattribpointer-offsets.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__attribs__gl-vertexattribpointer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__buffer-bind-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__buffer-data-and-buffer-sub-data.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__buffer-data-array-buffer-delete.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__buffer-uninitialized.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__element-array-buffer-delete-recreate.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__index-validation-copies-indices.html] +fail-if = (os != 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__index-validation-crash-with-buffer-sub-data.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__index-validation-large-buffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__index-validation-verifies-too-many-indices.html] +fail-if = (os != 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__index-validation-with-resized-buffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__buffers__index-validation.html] +fail-if = (os != 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__buffer-offscreen-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__buffer-preserve-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__canvas-test.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__canvas-zero-size.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__draw-webgl-to-canvas-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__drawingbuffer-hd-dpi-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__drawingbuffer-static-canvas-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__drawingbuffer-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__rapid-resizing.html] +fail-if = (os == 'win' && os_version == '5.1') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__texture-bindings-unaffected-on-resize.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__to-data-url-test.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__canvas__viewport-unchanged-upon-resize.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-attribute-preserve-drawing-buffer.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-attributes-alpha-depth-stencil-antialias.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-creation-and-destruction.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-creation.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-eviction-with-garbage-collection.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-hidden-alpha.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-lost-restored.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-lost.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-no-alpha-fbo-with-alpha.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-release-upon-reload.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-release-with-workers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__context-size-change.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__incorrect-context-object-behaviour.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__premultiplyalpha-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__resource-sharing-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__context__user-defined-properties-on-context.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__ext-disjoint-timer-query.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__ext-texture-filter-anisotropic.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__get-extension.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__oes-texture-float-linear.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-compressed-texture-atc.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-compressed-texture-etc.html] +fail-if = (os == 'mac') || (os == 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-compressed-texture-pvrtc.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-compressed-texture-size-limit.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-debug-renderer-info.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-debug-shaders.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__extensions__webgl-shared-resources.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__angle-ambiguous-function-call.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__angle-constructor-invalid-parameters.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__angle-d3d11-compiler-error.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__angle-dx-variable-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__array-of-struct-with-int-first-position.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__bool-type-cast-bug-int-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__compare-loop-index-to-uniform.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__complex-glsl-does-not-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__compound-assignment-type-combination.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__conditional-discard-in-loop.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__conditional-discard-optimization.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__constant-precision-qualifier.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__floored-division-accuracy.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__fragcoord-linking-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__logic-inside-block-without-braces.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__long-expressions-should-not-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__loop-if-loop-gradient.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__modulo-arithmetic-accuracy.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__multiplication-assignment.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__nested-functions-should-not-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__nested-loops-with-break-and-continue.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__nested-sequence-operator.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__qualcomm-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__sampler-array-using-loop-index.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__sampler-struct-function-arg.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__sequence-operator-evaluation-order.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__struct-constructor-highp-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__temp-expressions-should-not-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__undefined-index-should-not-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__bugs__uniforms-should-not-lose-values.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-bvec2.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-bvec3.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-bvec4.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-ivec2.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-ivec3.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-ivec4.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-mat2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-mat3.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-mat4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-index.html] +skip-if = (os == 'mac') || (os == 'win') || (os == 'linux') || (os == 'android') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec2.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec3.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-abs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-acos.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-asin.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-atan-xy.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-atan.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-ceil.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-clamp-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-clamp-gentype.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-cos.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-cross.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-distance.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-dot.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-faceforward.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-floor.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-fract.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-length.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-max-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-max-gentype.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-min-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-min-gentype.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-mix-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-mix-gentype.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-mod-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-mod-gentype.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-normalize.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-reflect.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-sign.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-sin.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-gentype.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-step-float.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function-step-gentype.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__functions__glsl-function.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_int_mat2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_int_mat3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_int_mat4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_int_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_int_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_int_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__add_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__assign_int_to_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__construct_struct.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_int_mat2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_int_mat3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_int_mat4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_int_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_int_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_int_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__divide_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__equal_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__equal_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__equal_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__equal_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__function_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__function_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__function_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__function_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__greater_than.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__greater_than_equal.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__less_than.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__less_than_equal.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_int_mat2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_int_mat3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_int_mat4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_int_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_int_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_int_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__not_equal_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_int_mat2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_int_mat3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_int_mat4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_int_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_int_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_int_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__ternary_int_float.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__literals__float_literal.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__literals__literal_precision.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__literals__overflow_leak.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__matrices__glsl-mat3-construction.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__matrices__glsl-mat4-to-mat3.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__matrices__matrix-compound-multiply.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__boolean_precision.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__const-variable-initialization.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__embedded-struct-definitions-forbidden.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__empty-declaration.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__empty_main.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__expression-list-in-declarator-initializer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__gl_position_unset.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__global-variable-init.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__glsl-function-nodes.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__glsl-long-variable-names.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__glsl-vertex-branch.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__large-loop-compile.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__non-ascii-comments.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__non-ascii.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__re-compile-re-link.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__sequence-operator-returns-constant.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-precision-format-obeyed.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-struct-scope.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-varying-packing-restrictions.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-256-character-define.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-256-character-identifier.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-uniform.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-attrib-array.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-attrib-struct.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-clipvertex.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-comma-assignment.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-comma-conditional-assignment.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping-negative.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-default-precision.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-default-precision.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-define-line-continuation.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-dfdx.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-do-loop.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-error-directive.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-float-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-for-loop.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-for-scoping.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-frag-depth.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-function-recursion.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-function-scoped-struct.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-functional-scoping.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-glcolor.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-gles-1.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-gles-symbol.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-hex-int-constant-macro.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-include.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-int-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-invalid-identifier.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-limited-indexing.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-long-line.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-non-ascii-error.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-non-reserved-words.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-precision.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-preprocessor-whitespace.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-quoted-error.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-reserved-words.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-short-circuiting-operators.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-similar-uniform-array-names.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-too-many-uniforms.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-two-initializer-types.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-vec2-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-vec3-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-vec4-return-value.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-version-100.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-version-100.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-version-120.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-version-130.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-webgl-identifier.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-with-while-loop.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shader-without-precision.frag.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-invariance.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-varyings.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-missing-varyings.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-name-conflicts.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-uniform-structs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shaders-with-varyings.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__shared.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-assign.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-equals.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-mixed-array-declarators.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-nesting-exceeds-maximum.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-nesting-of-variable-names.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-nesting-under-maximum.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-specifiers-in-uniforms.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__struct-unary-operators.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__ternary-operator-on-arrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__ternary-operators-in-global-initializers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__misc__ternary-operators-in-initializers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved___webgl_field.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved___webgl_function.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved___webgl_struct.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved___webgl_variable.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved__webgl_field.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved__webgl_function.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved__webgl_struct.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__reserved__webgl_variable.vert.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__samplers__glsl-function-texture2d-bias.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__samplers__glsl-function-texture2dlod.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__samplers__glsl-function-texture2dproj.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__samplers__glsl-function-texture2dprojlod.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__variables__gl-fragcoord-xy-values.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__variables__gl-fragcoord.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__variables__gl-fragdata-and-fragcolor.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__variables__gl-frontfacing.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__variables__gl-pointcoord.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__glsl__variables__glsl-built-ins.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__limits__gl-line-width.html] +skip-if = (os == 'mac') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__limits__gl-max-texture-dimensions.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__limits__gl-min-attribs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__limits__gl-min-textures.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__limits__gl-min-uniforms.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__bad-arguments-test.html] +skip-if = (os == 'mac') || (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__boolean-argument-conversion.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__delayed-drawing.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__error-reporting.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__expando-loss.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__functions-returning-strings.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__invalid-passed-params.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__is-object.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__null-object-behaviour.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__object-deletion-behaviour.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__shader-precision-format.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__type-conversion-test.html] +skip-if = (os == 'mac' && debug) || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__uninitialized-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__misc__webgl-specific.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__constants.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__getContext.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__methods.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-A.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-B1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-B2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-B3.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-B4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-C.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-D_G.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-G_I.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-L_S.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__quickCheckAPI-S_V.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__conformance__webGLArrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__bindBuffer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__bindBufferBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__bindFramebufferLeaveNonZero.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__bufferData.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__bufferDataBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__bufferSubData.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__bufferSubDataBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__copyTexImage2D.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__copyTexImage2DBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__copyTexSubImage2D.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__copyTexSubImage2DBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__deleteBufferBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__drawArrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__drawArraysOutOfBounds.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__drawElements.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__drawElementsBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__isTests.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__isTestsBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__readPixels.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__readPixelsBadArgs.html] +skip-if = 1 || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texImage2D.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texImage2DBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texImage2DHTML.html] +skip-if = 1 || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texImage2DHTMLBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texSubImage2D.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texSubImage2DBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texSubImage2DHTML.html] +skip-if = 1 || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__texSubImage2DHTMLBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__uniformMatrix.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__uniformMatrixBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__uniformf.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__uniformfArrayLen1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__uniformfBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__uniformi.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__uniformiBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__vertexAttrib.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__vertexAttribBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__vertexAttribPointer.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__functions__vertexAttribPointerBadArgs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__glsl__arrayOutOfBounds.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__more__glsl__uniformOutOfBounds.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__abs__abs_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__acos__acos_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__all__all_001_to_004.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__any__any_001_to_004.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__array__array_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__asin__asin_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__atan__atan_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__atan__atan_009_to_012.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__biConstants__biConstants_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__biConstants__biConstants_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_017_to_024.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_025_to_032.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_033_to_040.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_041_to_048.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_049_to_056.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_057_to_064.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_065_to_072.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_073_to_080.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_081_to_088.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_089_to_096.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_097_to_104.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_105_to_112.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_113_to_120.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_121_to_128.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_129_to_136.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_137_to_144.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_145_to_152.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_153_to_160.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_161_to_168.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_169_to_176.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__build__build_177_to_178.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__ceil__ceil_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__clamp__clamp_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__control_flow__control_flow_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__control_flow__control_flow_009_to_010.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__cos__cos_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__cross__cross_001_to_002.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__default__default_001_to_001.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__degrees__degrees_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__discard__discard_001_to_002.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__distance__distance_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__dot__dot_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__equal__equal_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__equal__equal_009_to_012.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__exp2__exp2_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__exp2__exp2_009_to_012.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__exp__exp_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__exp__exp_009_to_012.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__faceforward__faceforward_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__floor__floor_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__fract__fract_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_017_to_024.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_025_to_032.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_033_to_040.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_041_to_048.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_049_to_056.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_057_to_064.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_065_to_072.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_073_to_080.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_081_to_088.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_089_to_096.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_097_to_104.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_105_to_112.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_113_to_120.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__functions__functions_121_to_126.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__length__length_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__lessThan__lessThan_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__log2__log2_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__log2__log2_009_to_012.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__log__log_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__log__log_009_to_012.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mat3__mat3_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mat__mat_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mat__mat_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mat__mat_017_to_024.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mat__mat_025_to_032.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mat__mat_033_to_040.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mat__mat_041_to_046.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__max__max_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__min__min_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mix__mix_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__mod__mod_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__normalize__normalize_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__notEqual__notEqual_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__notEqual__notEqual_009_to_012.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__not__not_001_to_004.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__operators__operators_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__operators__operators_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__operators__operators_017_to_024.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__operators__operators_025_to_026.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__pow__pow_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__pow__pow_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__pow__pow_017_to_024.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__radians__radians_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__reflect__reflect_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__refract__refract_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__sign__sign_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__sin__sin_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__sqrt__sqrt_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__step__step_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__struct__struct_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__struct__struct_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__struct__struct_017_to_024.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__struct__struct_025_to_032.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__struct__struct_033_to_040.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__struct__struct_041_to_048.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__struct__struct_049_to_056.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__tan__tan_001_to_006.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__vec3__vec3_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__vec__vec_001_to_008.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__vec__vec_009_to_016.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__ogles__GL__vec__vec_017_to_018.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__get-active-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__gl-bind-attrib-location-long-names-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__gl-bind-attrib-location-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__gl-get-active-attribute.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__gl-get-active-uniform.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__gl-getshadersource.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__gl-shader-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__invalid-UTF-16.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__program-infolog.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__program-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__reading__read-pixels-pack-alignment.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__reading__read-pixels-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__renderbuffers__feedback-loop.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__renderbuffers__framebuffer-state-restoration.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__renderbuffers__renderbuffer-initialization.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__culling.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__default-texture-draw-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__draw-arrays-out-of-bounds.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__draw-elements-out-of-bounds.html] +fail-if = (os != 'win') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__draw-with-changing-start-vertex-bug.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__framebuffer-switch.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__framebuffer-texture-switch.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__gl-clear.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__gl-drawarrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__gl-drawelements.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__gl-scissor-canvas-dimensions.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__gl-scissor-fbo-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__gl-scissor-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__gl-viewport-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__line-loop-tri-fan.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__many-draw-calls.html] +skip-if = debug || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__more-than-65536-indices.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__multisample-corruption.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__negative-one-index.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__out-of-bounds-index-buffers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__point-no-attributes.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__point-size.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__point-specific-shader-variables.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__polygon-offset.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__simple.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__rendering__triangle.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__state__gl-enable-enum-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__state__gl-get-calls.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__state__gl-geterror.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__state__gl-initial-state.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__state__state-uneffected-after-compositing.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__copy-tex-image-2d-formats.html] +skip-if = (os == 'mac') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__cube-incomplete-fbo.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__default-texture.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__gl-pixelstorei.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__gl-teximage.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__mipmap-fbo.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__origin-clean-conformance.html] +skip-if = 1 || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html] +skip-if = (os == 'win' && os_version == '6.1') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-image-canvas-corruption.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-image-webgl.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html] +fail-if = (os == 'mac') +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-image-with-invalid-data.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-sub-image-2d-bad-args.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__tex-sub-image-2d.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texparameter-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-active-bind-2.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-active-bind.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-attachment-formats.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-clear.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-complete.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-copying-feedback-loops.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-cube-as-fbo-attachment.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-draw-with-2d-and-cube.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-hd-dpi.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-mips.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-size-cube-maps.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-size-limit.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-size.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-sub-image-cube-maps.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-transparent-pixels-initialized.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-upload-cube-maps.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__misc__texture-upload-size.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__typedarrays__array-buffer-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__typedarrays__array-buffer-view-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__typedarrays__array-large-array-tests.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__typedarrays__array-unit-tests.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__typedarrays__data-view-crash.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__typedarrays__data-view-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__typedarrays__typed-arrays-in-workers.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__gl-uniform-arrays.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__gl-uniform-bool.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__gl-uniformmatrix4fv.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__gl-unknown-uniform.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__null-uniform-location.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__out-of-bounds-uniform-array-access.html] +skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__uniform-default-values.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__uniform-location.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__uniform-samplers-test.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance__uniforms__uniform-values-per-program.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_conformance__attribs__gl-bindAttribLocation-aliasing.html] +skip-if = (os == 'android') +[generated/test_conformance__attribs__gl-bindAttribLocation-matrix.html] +skip-if = (os == 'android') +[generated/test_conformance__attribs__gl-bindAttribLocation-repeated.html] +[generated/test_conformance__attribs__gl-disabled-vertex-attrib.html] +fail-if = (os == 'android') +[generated/test_conformance__attribs__gl-enable-vertex-attrib.html] +[generated/test_conformance__attribs__gl-matrix-attributes.html] +[generated/test_conformance__attribs__gl-vertex-attrib-render.html] +[generated/test_conformance__attribs__gl-vertex-attrib-zero-issues.html] +[generated/test_conformance__attribs__gl-vertex-attrib.html] +[generated/test_conformance__attribs__gl-vertexattribpointer-offsets.html] +[generated/test_conformance__attribs__gl-vertexattribpointer.html] +fail-if = (os == 'android') +[generated/test_conformance__buffers__buffer-bind-test.html] +[generated/test_conformance__buffers__buffer-data-and-buffer-sub-data.html] +[generated/test_conformance__buffers__buffer-data-array-buffer-delete.html] +[generated/test_conformance__buffers__buffer-uninitialized.html] +[generated/test_conformance__buffers__element-array-buffer-delete-recreate.html] +[generated/test_conformance__buffers__index-validation-copies-indices.html] +[generated/test_conformance__buffers__index-validation-crash-with-buffer-sub-data.html] +[generated/test_conformance__buffers__index-validation-large-buffer.html] +[generated/test_conformance__buffers__index-validation-verifies-too-many-indices.html] +[generated/test_conformance__buffers__index-validation-with-resized-buffer.html] +[generated/test_conformance__buffers__index-validation.html] +[generated/test_conformance__canvas__buffer-offscreen-test.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__canvas__buffer-preserve-test.html] +[generated/test_conformance__canvas__canvas-test.html] +[generated/test_conformance__canvas__canvas-zero-size.html] +[generated/test_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html] +[generated/test_conformance__canvas__draw-webgl-to-canvas-test.html] +[generated/test_conformance__canvas__drawingbuffer-hd-dpi-test.html] +skip-if = (os == 'android') +[generated/test_conformance__canvas__drawingbuffer-static-canvas-test.html] +skip-if = (os == 'mac') +[generated/test_conformance__canvas__drawingbuffer-test.html] +[generated/test_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html] +[generated/test_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html] +[generated/test_conformance__canvas__rapid-resizing.html] +skip-if = (os == 'android') +[generated/test_conformance__canvas__texture-bindings-unaffected-on-resize.html] +[generated/test_conformance__canvas__to-data-url-test.html] +[generated/test_conformance__canvas__viewport-unchanged-upon-resize.html] +skip-if = (os == 'mac') +[generated/test_conformance__context__constants-and-properties.html] +[generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html] +[generated/test_conformance__context__context-attributes-alpha-depth-stencil-antialias.html] +skip-if = (os == 'b2g') || (os == 'linux') || (os == 'android') +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__context__context-creation-and-destruction.html] +[generated/test_conformance__context__context-creation.html] +skip-if = (os == 'android') +[generated/test_conformance__context__context-eviction-with-garbage-collection.html] +skip-if = (os == 'android') +[generated/test_conformance__context__context-hidden-alpha.html] +[generated/test_conformance__context__context-lost-restored.html] +[generated/test_conformance__context__context-lost.html] +[generated/test_conformance__context__context-no-alpha-fbo-with-alpha.html] +[generated/test_conformance__context__context-release-upon-reload.html] +skip-if = (os == 'android') +[generated/test_conformance__context__context-release-with-workers.html] +skip-if = (os == 'android') +[generated/test_conformance__context__context-size-change.html] +[generated/test_conformance__context__context-type-test.html] +[generated/test_conformance__context__incorrect-context-object-behaviour.html] +[generated/test_conformance__context__methods.html] +[generated/test_conformance__context__premultiplyalpha-test.html] +[generated/test_conformance__context__resource-sharing-test.html] +[generated/test_conformance__context__user-defined-properties-on-context.html] +[generated/test_conformance__extensions__angle-instanced-arrays-out-of-bounds.html] +[generated/test_conformance__extensions__angle-instanced-arrays.html] +fail-if = (os == 'mac') +[generated/test_conformance__extensions__ext-blend-minmax.html] +[generated/test_conformance__extensions__ext-disjoint-timer-query.html] +[generated/test_conformance__extensions__ext-frag-depth.html] +[generated/test_conformance__extensions__ext-sRGB.html] +[generated/test_conformance__extensions__ext-shader-texture-lod.html] +[generated/test_conformance__extensions__ext-texture-filter-anisotropic.html] +[generated/test_conformance__extensions__get-extension.html] +[generated/test_conformance__extensions__oes-element-index-uint.html] +[generated/test_conformance__extensions__oes-standard-derivatives.html] +[generated/test_conformance__extensions__oes-texture-float-linear.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-canvas.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-image-data.html] +skip-if = (os == 'win' && os_version == '6.1') +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-image.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-video.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-linear.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-canvas.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-image-data.html] +skip-if = (os == 'win' && os_version == '6.1') +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-image.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-video.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float.html] +fail-if = (os == 'mac') || (os == 'win') || (os == 'android') || (os == 'linux') +[generated/test_conformance__extensions__oes-vertex-array-object-bufferData.html] +[generated/test_conformance__extensions__oes-vertex-array-object.html] +skip-if = (os == 'mac' && os_version == '10.6') +fail-if = (os == 'mac') || (os == 'linux') || (os == 'win') +[generated/test_conformance__extensions__webgl-compressed-texture-atc.html] +[generated/test_conformance__extensions__webgl-compressed-texture-etc.html] +[generated/test_conformance__extensions__webgl-compressed-texture-pvrtc.html] +[generated/test_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html] +[generated/test_conformance__extensions__webgl-compressed-texture-s3tc.html] +[generated/test_conformance__extensions__webgl-compressed-texture-size-limit.html] +skip-if = (os == 'win') +[generated/test_conformance__extensions__webgl-debug-renderer-info.html] +[generated/test_conformance__extensions__webgl-debug-shaders.html] +[generated/test_conformance__extensions__webgl-depth-texture.html] +[generated/test_conformance__extensions__webgl-draw-buffers-framebuffer-unsupported.html] +fail-if = (os == 'mac') || (os == 'linux') +[generated/test_conformance__extensions__webgl-draw-buffers-max-draw-buffers.html] +[generated/test_conformance__extensions__webgl-draw-buffers.html] +skip-if = (os == 'linux') || (os == 'win') +fail-if = (os == 'mac') +[generated/test_conformance__extensions__webgl-shared-resources.html] +[generated/test_conformance__glsl__bugs__angle-ambiguous-function-call.html] +[generated/test_conformance__glsl__bugs__angle-constructor-invalid-parameters.html] +[generated/test_conformance__glsl__bugs__angle-d3d11-compiler-error.html] +[generated/test_conformance__glsl__bugs__angle-dx-variable-bug.html] +[generated/test_conformance__glsl__bugs__array-of-struct-with-int-first-position.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__bool-type-cast-bug-int-float.html] +[generated/test_conformance__glsl__bugs__compare-loop-index-to-uniform.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__complex-glsl-does-not-crash.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__compound-assignment-type-combination.html] +[generated/test_conformance__glsl__bugs__conditional-discard-in-loop.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__conditional-discard-optimization.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__constant-precision-qualifier.html] +[generated/test_conformance__glsl__bugs__essl3-shaders-with-webgl1.html] +[generated/test_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html] +fail-if = (os == 'win' && os_version == '5.1') +[generated/test_conformance__glsl__bugs__floored-division-accuracy.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__fragcoord-linking-bug.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html] +[generated/test_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html] +[generated/test_conformance__glsl__bugs__logic-inside-block-without-braces.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__long-expressions-should-not-crash.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__loop-if-loop-gradient.html] +[generated/test_conformance__glsl__bugs__modulo-arithmetic-accuracy.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__multiplication-assignment.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__nested-functions-should-not-crash.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__nested-loops-with-break-and-continue.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__nested-sequence-operator.html] +[generated/test_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html] +[generated/test_conformance__glsl__bugs__qualcomm-crash.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html] +[generated/test_conformance__glsl__bugs__sampler-array-using-loop-index.html] +[generated/test_conformance__glsl__bugs__sampler-struct-function-arg.html] +skip-if = (os == 'linux') || (os == 'android') +[generated/test_conformance__glsl__bugs__sequence-operator-evaluation-order.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html] +[generated/test_conformance__glsl__bugs__struct-constructor-highp-bug.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__temp-expressions-should-not-crash.html] +skip-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__glsl__bugs__undefined-index-should-not-crash.html] +[generated/test_conformance__glsl__bugs__uniforms-should-not-lose-values.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-bvec2.html] +skip-if = (os == 'linux') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-bvec3.html] +skip-if = (os == 'linux') || (os == 'mac') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-bvec4.html] +skip-if = (os == 'linux') || (os == 'mac') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-ivec2.html] +skip-if = (os == 'linux') +[generated/test_conformance__glsl__constructors__glsl-construct-ivec3.html] +skip-if = (os == 'linux') || (os == 'mac') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-ivec4.html] +skip-if = (os == 'linux') || (os == 'mac') +[generated/test_conformance__glsl__constructors__glsl-construct-mat2.html] +skip-if = ((os == 'linux') && asan) +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__constructors__glsl-construct-mat3.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__constructors__glsl-construct-mat4.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html] +skip-if = (os == 'linux') +[generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-index.html] +skip-if = (os == 'mac') || (os == 'win') || (os == 'linux') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-vec2.html] +[generated/test_conformance__glsl__constructors__glsl-construct-vec3.html] +skip-if = (os == 'linux') +[generated/test_conformance__glsl__constructors__glsl-construct-vec4.html] +skip-if = (os == 'linux') +[generated/test_conformance__glsl__functions__glsl-function-abs.html] +[generated/test_conformance__glsl__functions__glsl-function-acos.html] +[generated/test_conformance__glsl__functions__glsl-function-asin.html] +[generated/test_conformance__glsl__functions__glsl-function-atan-xy.html] +[generated/test_conformance__glsl__functions__glsl-function-atan.html] +skip-if = (os == 'linux') +[generated/test_conformance__glsl__functions__glsl-function-ceil.html] +[generated/test_conformance__glsl__functions__glsl-function-clamp-float.html] +[generated/test_conformance__glsl__functions__glsl-function-clamp-gentype.html] +[generated/test_conformance__glsl__functions__glsl-function-cos.html] +[generated/test_conformance__glsl__functions__glsl-function-cross.html] +[generated/test_conformance__glsl__functions__glsl-function-distance.html] +[generated/test_conformance__glsl__functions__glsl-function-dot.html] +[generated/test_conformance__glsl__functions__glsl-function-faceforward.html] +[generated/test_conformance__glsl__functions__glsl-function-floor.html] +[generated/test_conformance__glsl__functions__glsl-function-fract.html] +[generated/test_conformance__glsl__functions__glsl-function-length.html] +[generated/test_conformance__glsl__functions__glsl-function-max-float.html] +[generated/test_conformance__glsl__functions__glsl-function-max-gentype.html] +[generated/test_conformance__glsl__functions__glsl-function-min-float.html] +[generated/test_conformance__glsl__functions__glsl-function-min-gentype.html] +[generated/test_conformance__glsl__functions__glsl-function-mix-float.html] +[generated/test_conformance__glsl__functions__glsl-function-mix-gentype.html] +[generated/test_conformance__glsl__functions__glsl-function-mod-float.html] +[generated/test_conformance__glsl__functions__glsl-function-mod-gentype.html] +[generated/test_conformance__glsl__functions__glsl-function-normalize.html] +[generated/test_conformance__glsl__functions__glsl-function-reflect.html] +[generated/test_conformance__glsl__functions__glsl-function-sign.html] +[generated/test_conformance__glsl__functions__glsl-function-sin.html] +[generated/test_conformance__glsl__functions__glsl-function-smoothstep-float.html] +[generated/test_conformance__glsl__functions__glsl-function-smoothstep-gentype.html] +fail-if = (os == 'mac' && os_version == '10.8') +[generated/test_conformance__glsl__functions__glsl-function-step-float.html] +[generated/test_conformance__glsl__functions__glsl-function-step-gentype.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__functions__glsl-function.html] +[generated/test_conformance__glsl__implicit__add_int_float.vert.html] +[generated/test_conformance__glsl__implicit__add_int_mat2.vert.html] +[generated/test_conformance__glsl__implicit__add_int_mat3.vert.html] +[generated/test_conformance__glsl__implicit__add_int_mat4.vert.html] +[generated/test_conformance__glsl__implicit__add_int_vec2.vert.html] +[generated/test_conformance__glsl__implicit__add_int_vec3.vert.html] +[generated/test_conformance__glsl__implicit__add_int_vec4.vert.html] +[generated/test_conformance__glsl__implicit__add_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__add_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__add_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__implicit__assign_int_to_float.vert.html] +[generated/test_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html] +[generated/test_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html] +[generated/test_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html] +[generated/test_conformance__glsl__implicit__construct_struct.vert.html] +[generated/test_conformance__glsl__implicit__divide_int_float.vert.html] +[generated/test_conformance__glsl__implicit__divide_int_mat2.vert.html] +[generated/test_conformance__glsl__implicit__divide_int_mat3.vert.html] +[generated/test_conformance__glsl__implicit__divide_int_mat4.vert.html] +[generated/test_conformance__glsl__implicit__divide_int_vec2.vert.html] +[generated/test_conformance__glsl__implicit__divide_int_vec3.vert.html] +[generated/test_conformance__glsl__implicit__divide_int_vec4.vert.html] +[generated/test_conformance__glsl__implicit__divide_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__divide_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__divide_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__implicit__equal_int_float.vert.html] +[generated/test_conformance__glsl__implicit__equal_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__equal_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__equal_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__implicit__function_int_float.vert.html] +[generated/test_conformance__glsl__implicit__function_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__function_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__function_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__implicit__greater_than.vert.html] +[generated/test_conformance__glsl__implicit__greater_than_equal.vert.html] +[generated/test_conformance__glsl__implicit__less_than.vert.html] +[generated/test_conformance__glsl__implicit__less_than_equal.vert.html] +[generated/test_conformance__glsl__implicit__multiply_int_float.vert.html] +[generated/test_conformance__glsl__implicit__multiply_int_mat2.vert.html] +[generated/test_conformance__glsl__implicit__multiply_int_mat3.vert.html] +[generated/test_conformance__glsl__implicit__multiply_int_mat4.vert.html] +[generated/test_conformance__glsl__implicit__multiply_int_vec2.vert.html] +[generated/test_conformance__glsl__implicit__multiply_int_vec3.vert.html] +[generated/test_conformance__glsl__implicit__multiply_int_vec4.vert.html] +[generated/test_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__implicit__not_equal_int_float.vert.html] +[generated/test_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__implicit__subtract_int_float.vert.html] +[generated/test_conformance__glsl__implicit__subtract_int_mat2.vert.html] +[generated/test_conformance__glsl__implicit__subtract_int_mat3.vert.html] +[generated/test_conformance__glsl__implicit__subtract_int_mat4.vert.html] +[generated/test_conformance__glsl__implicit__subtract_int_vec2.vert.html] +[generated/test_conformance__glsl__implicit__subtract_int_vec3.vert.html] +[generated/test_conformance__glsl__implicit__subtract_int_vec4.vert.html] +[generated/test_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__implicit__ternary_int_float.vert.html] +[generated/test_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html] +[generated/test_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html] +[generated/test_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html] +[generated/test_conformance__glsl__literals__float_literal.vert.html] +[generated/test_conformance__glsl__literals__literal_precision.html] +[generated/test_conformance__glsl__literals__overflow_leak.vert.html] +[generated/test_conformance__glsl__matrices__glsl-mat3-construction.html] +[generated/test_conformance__glsl__matrices__glsl-mat4-to-mat3.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__matrices__matrix-compound-multiply.html] +[generated/test_conformance__glsl__misc__attrib-location-length-limits.html] +[generated/test_conformance__glsl__misc__boolean_precision.html] +[generated/test_conformance__glsl__misc__const-variable-initialization.html] +[generated/test_conformance__glsl__misc__embedded-struct-definitions-forbidden.html] +[generated/test_conformance__glsl__misc__empty-declaration.html] +[generated/test_conformance__glsl__misc__empty_main.vert.html] +[generated/test_conformance__glsl__misc__expression-list-in-declarator-initializer.html] +[generated/test_conformance__glsl__misc__gl_position_unset.vert.html] +[generated/test_conformance__glsl__misc__global-variable-init.html] +[generated/test_conformance__glsl__misc__glsl-function-nodes.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__misc__glsl-long-variable-names.html] +[generated/test_conformance__glsl__misc__glsl-vertex-branch.html] +[generated/test_conformance__glsl__misc__large-loop-compile.html] +fail-if = (os == 'win' && os_version == '5.1') +[generated/test_conformance__glsl__misc__non-ascii-comments.vert.html] +[generated/test_conformance__glsl__misc__non-ascii.vert.html] +[generated/test_conformance__glsl__misc__re-compile-re-link.html] +fail-if = (os == 'android' && android_version == '10') +[generated/test_conformance__glsl__misc__sequence-operator-returns-constant.html] +[generated/test_conformance__glsl__misc__shader-precision-format-obeyed.html] +[generated/test_conformance__glsl__misc__shader-struct-scope.html] +[generated/test_conformance__glsl__misc__shader-uniform-packing-restrictions.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__misc__shader-varying-packing-restrictions.html] +[generated/test_conformance__glsl__misc__shader-with-256-character-define.html] +[generated/test_conformance__glsl__misc__shader-with-256-character-identifier.frag.html] +[generated/test_conformance__glsl__misc__shader-with-257-character-define.html] +[generated/test_conformance__glsl__misc__shader-with-257-character-identifier.frag.html] +[generated/test_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html] +[generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html] +[generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html] +[generated/test_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html] +[generated/test_conformance__glsl__misc__shader-with-array-of-structs-uniform.html] +[generated/test_conformance__glsl__misc__shader-with-attrib-array.vert.html] +[generated/test_conformance__glsl__misc__shader-with-attrib-struct.vert.html] +[generated/test_conformance__glsl__misc__shader-with-clipvertex.vert.html] +[generated/test_conformance__glsl__misc__shader-with-comma-assignment.html] +[generated/test_conformance__glsl__misc__shader-with-comma-conditional-assignment.html] +[generated/test_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html] +[generated/test_conformance__glsl__misc__shader-with-conditional-scoping-negative.html] +[generated/test_conformance__glsl__misc__shader-with-conditional-scoping.html] +[generated/test_conformance__glsl__misc__shader-with-default-precision.frag.html] +[generated/test_conformance__glsl__misc__shader-with-default-precision.vert.html] +[generated/test_conformance__glsl__misc__shader-with-define-line-continuation.frag.html] +[generated/test_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html] +[generated/test_conformance__glsl__misc__shader-with-dfdx.frag.html] +[generated/test_conformance__glsl__misc__shader-with-do-loop.html] +[generated/test_conformance__glsl__misc__shader-with-error-directive.html] +[generated/test_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html] +[generated/test_conformance__glsl__misc__shader-with-float-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-for-loop.html] +[generated/test_conformance__glsl__misc__shader-with-for-scoping.html] +[generated/test_conformance__glsl__misc__shader-with-frag-depth.frag.html] +[generated/test_conformance__glsl__misc__shader-with-function-recursion.frag.html] +[generated/test_conformance__glsl__misc__shader-with-function-scoped-struct.html] +[generated/test_conformance__glsl__misc__shader-with-functional-scoping.html] +[generated/test_conformance__glsl__misc__shader-with-glcolor.vert.html] +[generated/test_conformance__glsl__misc__shader-with-gles-1.frag.html] +[generated/test_conformance__glsl__misc__shader-with-gles-symbol.frag.html] +[generated/test_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html] +[generated/test_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html] +[generated/test_conformance__glsl__misc__shader-with-hex-int-constant-macro.html] +[generated/test_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html] +[generated/test_conformance__glsl__misc__shader-with-include.vert.html] +[generated/test_conformance__glsl__misc__shader-with-int-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-invalid-identifier.frag.html] +[generated/test_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-limited-indexing.frag.html] +[generated/test_conformance__glsl__misc__shader-with-long-line.html] +[generated/test_conformance__glsl__misc__shader-with-non-ascii-error.frag.html] +[generated/test_conformance__glsl__misc__shader-with-non-reserved-words.html] +skip-if = 1 +fail-if = (os == 'android') +[generated/test_conformance__glsl__misc__shader-with-precision.frag.html] +[generated/test_conformance__glsl__misc__shader-with-preprocessor-whitespace.html] +[generated/test_conformance__glsl__misc__shader-with-quoted-error.frag.html] +[generated/test_conformance__glsl__misc__shader-with-reserved-words.html] +[generated/test_conformance__glsl__misc__shader-with-short-circuiting-operators.html] +[generated/test_conformance__glsl__misc__shader-with-similar-uniform-array-names.html] +[generated/test_conformance__glsl__misc__shader-with-too-many-uniforms.html] +[generated/test_conformance__glsl__misc__shader-with-two-initializer-types.html] +[generated/test_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html] +[generated/test_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html] +[generated/test_conformance__glsl__misc__shader-with-vec2-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-vec3-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-vec4-return-value.frag.html] +[generated/test_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html] +[generated/test_conformance__glsl__misc__shader-with-version-100.frag.html] +[generated/test_conformance__glsl__misc__shader-with-version-100.vert.html] +[generated/test_conformance__glsl__misc__shader-with-version-120.vert.html] +[generated/test_conformance__glsl__misc__shader-with-version-130.vert.html] +[generated/test_conformance__glsl__misc__shader-with-webgl-identifier.vert.html] +[generated/test_conformance__glsl__misc__shader-with-while-loop.html] +[generated/test_conformance__glsl__misc__shader-without-precision.frag.html] +[generated/test_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html] +[generated/test_conformance__glsl__misc__shaders-with-invariance.html] +fail-if = (os == 'mac') +[generated/test_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html] +[generated/test_conformance__glsl__misc__shaders-with-mis-matching-varyings.html] +[generated/test_conformance__glsl__misc__shaders-with-missing-varyings.html] +[generated/test_conformance__glsl__misc__shaders-with-name-conflicts.html] +[generated/test_conformance__glsl__misc__shaders-with-uniform-structs.html] +[generated/test_conformance__glsl__misc__shaders-with-varyings.html] +[generated/test_conformance__glsl__misc__shared.html] +[generated/test_conformance__glsl__misc__struct-assign.html] +[generated/test_conformance__glsl__misc__struct-equals.html] +[generated/test_conformance__glsl__misc__struct-mixed-array-declarators.html] +[generated/test_conformance__glsl__misc__struct-nesting-exceeds-maximum.html] +[generated/test_conformance__glsl__misc__struct-nesting-of-variable-names.html] +[generated/test_conformance__glsl__misc__struct-nesting-under-maximum.html] +[generated/test_conformance__glsl__misc__struct-specifiers-in-uniforms.html] +[generated/test_conformance__glsl__misc__struct-unary-operators.html] +[generated/test_conformance__glsl__misc__ternary-operator-on-arrays.html] +[generated/test_conformance__glsl__misc__ternary-operators-in-global-initializers.html] +[generated/test_conformance__glsl__misc__ternary-operators-in-initializers.html] +[generated/test_conformance__glsl__misc__uniform-location-length-limits.html] +[generated/test_conformance__glsl__reserved___webgl_field.vert.html] +[generated/test_conformance__glsl__reserved___webgl_function.vert.html] +fail-if = (os == 'b2g') +[generated/test_conformance__glsl__reserved___webgl_struct.vert.html] +[generated/test_conformance__glsl__reserved___webgl_variable.vert.html] +[generated/test_conformance__glsl__reserved__webgl_field.vert.html] +[generated/test_conformance__glsl__reserved__webgl_function.vert.html] +fail-if = (os == 'b2g') +[generated/test_conformance__glsl__reserved__webgl_struct.vert.html] +[generated/test_conformance__glsl__reserved__webgl_variable.vert.html] +[generated/test_conformance__glsl__samplers__glsl-function-texture2d-bias.html] +[generated/test_conformance__glsl__samplers__glsl-function-texture2dlod.html] +[generated/test_conformance__glsl__samplers__glsl-function-texture2dproj.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__samplers__glsl-function-texture2dprojlod.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__variables__gl-fragcoord-xy-values.html] +[generated/test_conformance__glsl__variables__gl-fragcoord.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__variables__gl-fragdata-and-fragcolor.html] +[generated/test_conformance__glsl__variables__gl-frontfacing.html] +[generated/test_conformance__glsl__variables__gl-pointcoord.html] +fail-if = (os == 'mac' && os_version == '10.8') +[generated/test_conformance__glsl__variables__glsl-built-ins.html] +skip-if = (os == 'android') +[generated/test_conformance__limits__gl-line-width.html] +[generated/test_conformance__limits__gl-max-texture-dimensions.html] +fail-if = (os == 'mac' && os_version == '10.8') +[generated/test_conformance__limits__gl-min-attribs.html] +[generated/test_conformance__limits__gl-min-textures.html] +skip-if = (os == 'linux') +[generated/test_conformance__limits__gl-min-uniforms.html] +[generated/test_conformance__misc__bad-arguments-test.html] +skip-if = (os == 'mac') || (os == 'win') || (os == 'linux') || (os == 'android') +[generated/test_conformance__misc__boolean-argument-conversion.html] +skip-if = (os == 'android') +[generated/test_conformance__misc__delayed-drawing.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__misc__error-reporting.html] +fail-if = (os == 'b2g') +[generated/test_conformance__misc__expando-loss.html] +[generated/test_conformance__misc__functions-returning-strings.html] +[generated/test_conformance__misc__instanceof-test.html] +[generated/test_conformance__misc__invalid-passed-params.html] +skip-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__misc__is-object.html] +[generated/test_conformance__misc__null-object-behaviour.html] +[generated/test_conformance__misc__object-deletion-behaviour.html] +skip-if = (os == 'android' && debug) +fail-if = (os == 'android') +[generated/test_conformance__misc__shader-precision-format.html] +skip-if = (os == 'android') +[generated/test_conformance__misc__type-conversion-test.html] +skip-if = (os == 'android') || (os == 'b2g') || (os == 'linux') +fail-if = (os == 'linux') +[generated/test_conformance__misc__uninitialized-test.html] +skip-if = (os == 'android') +[generated/test_conformance__misc__webgl-specific.html] +[generated/test_conformance__more__conformance__constants.html] +[generated/test_conformance__more__conformance__getContext.html] +[generated/test_conformance__more__conformance__methods.html] +[generated/test_conformance__more__conformance__quickCheckAPI-A.html] +[generated/test_conformance__more__conformance__quickCheckAPI-B1.html] +[generated/test_conformance__more__conformance__quickCheckAPI-B2.html] +[generated/test_conformance__more__conformance__quickCheckAPI-B3.html] +[generated/test_conformance__more__conformance__quickCheckAPI-B4.html] +[generated/test_conformance__more__conformance__quickCheckAPI-C.html] +[generated/test_conformance__more__conformance__quickCheckAPI-D_G.html] +skip-if = (os == 'android') +[generated/test_conformance__more__conformance__quickCheckAPI-G_I.html] +[generated/test_conformance__more__conformance__quickCheckAPI-L_S.html] +[generated/test_conformance__more__conformance__quickCheckAPI-S_V.html] +[generated/test_conformance__more__conformance__webGLArrays.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bindBuffer.html] +[generated/test_conformance__more__functions__bindBufferBadArgs.html] +[generated/test_conformance__more__functions__bindFramebufferLeaveNonZero.html] +[generated/test_conformance__more__functions__bufferData.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bufferDataBadArgs.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bufferSubData.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bufferSubDataBadArgs.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__copyTexImage2D.html] +[generated/test_conformance__more__functions__copyTexImage2DBadArgs.html] +[generated/test_conformance__more__functions__copyTexSubImage2D.html] +[generated/test_conformance__more__functions__copyTexSubImage2DBadArgs.html] +[generated/test_conformance__more__functions__deleteBufferBadArgs.html] +[generated/test_conformance__more__functions__drawArrays.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__drawArraysOutOfBounds.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__drawElements.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__drawElementsBadArgs.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__isTests.html] +[generated/test_conformance__more__functions__isTestsBadArgs.html] +[generated/test_conformance__more__functions__readPixels.html] +[generated/test_conformance__more__functions__readPixelsBadArgs.html] +skip-if = 1 +[generated/test_conformance__more__functions__texImage2D.html] +[generated/test_conformance__more__functions__texImage2DBadArgs.html] +[generated/test_conformance__more__functions__texImage2DHTML.html] +skip-if = 1 +[generated/test_conformance__more__functions__texImage2DHTMLBadArgs.html] +[generated/test_conformance__more__functions__texSubImage2D.html] +[generated/test_conformance__more__functions__texSubImage2DBadArgs.html] +[generated/test_conformance__more__functions__texSubImage2DHTML.html] +skip-if = 1 +[generated/test_conformance__more__functions__texSubImage2DHTMLBadArgs.html] +[generated/test_conformance__more__functions__uniformMatrix.html] +[generated/test_conformance__more__functions__uniformMatrixBadArgs.html] +[generated/test_conformance__more__functions__uniformf.html] +[generated/test_conformance__more__functions__uniformfArrayLen1.html] +[generated/test_conformance__more__functions__uniformfBadArgs.html] +[generated/test_conformance__more__functions__uniformi.html] +[generated/test_conformance__more__functions__uniformiBadArgs.html] +[generated/test_conformance__more__functions__vertexAttrib.html] +[generated/test_conformance__more__functions__vertexAttribBadArgs.html] +[generated/test_conformance__more__functions__vertexAttribPointer.html] +[generated/test_conformance__more__functions__vertexAttribPointerBadArgs.html] +[generated/test_conformance__more__glsl__arrayOutOfBounds.html] +[generated/test_conformance__more__glsl__uniformOutOfBounds.html] +[generated/test_conformance__ogles__GL__abs__abs_001_to_006.html] +[generated/test_conformance__ogles__GL__acos__acos_001_to_006.html] +[generated/test_conformance__ogles__GL__all__all_001_to_004.html] +[generated/test_conformance__ogles__GL__any__any_001_to_004.html] +[generated/test_conformance__ogles__GL__array__array_001_to_006.html] +[generated/test_conformance__ogles__GL__asin__asin_001_to_006.html] +[generated/test_conformance__ogles__GL__atan__atan_001_to_008.html] +[generated/test_conformance__ogles__GL__atan__atan_009_to_012.html] +[generated/test_conformance__ogles__GL__biConstants__biConstants_001_to_008.html] +[generated/test_conformance__ogles__GL__biConstants__biConstants_009_to_016.html] +[generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html] +fail-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__ogles__GL__build__build_001_to_008.html] +[generated/test_conformance__ogles__GL__build__build_009_to_016.html] +[generated/test_conformance__ogles__GL__build__build_017_to_024.html] +[generated/test_conformance__ogles__GL__build__build_025_to_032.html] +[generated/test_conformance__ogles__GL__build__build_033_to_040.html] +[generated/test_conformance__ogles__GL__build__build_041_to_048.html] +[generated/test_conformance__ogles__GL__build__build_049_to_056.html] +[generated/test_conformance__ogles__GL__build__build_057_to_064.html] +[generated/test_conformance__ogles__GL__build__build_065_to_072.html] +[generated/test_conformance__ogles__GL__build__build_073_to_080.html] +[generated/test_conformance__ogles__GL__build__build_081_to_088.html] +[generated/test_conformance__ogles__GL__build__build_089_to_096.html] +[generated/test_conformance__ogles__GL__build__build_097_to_104.html] +[generated/test_conformance__ogles__GL__build__build_105_to_112.html] +[generated/test_conformance__ogles__GL__build__build_113_to_120.html] +[generated/test_conformance__ogles__GL__build__build_121_to_128.html] +[generated/test_conformance__ogles__GL__build__build_129_to_136.html] +[generated/test_conformance__ogles__GL__build__build_137_to_144.html] +[generated/test_conformance__ogles__GL__build__build_145_to_152.html] +[generated/test_conformance__ogles__GL__build__build_153_to_160.html] +[generated/test_conformance__ogles__GL__build__build_161_to_168.html] +[generated/test_conformance__ogles__GL__build__build_169_to_176.html] +[generated/test_conformance__ogles__GL__build__build_177_to_178.html] +[generated/test_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html] +skip-if = (os == 'win') +[generated/test_conformance__ogles__GL__ceil__ceil_001_to_006.html] +[generated/test_conformance__ogles__GL__clamp__clamp_001_to_006.html] +[generated/test_conformance__ogles__GL__control_flow__control_flow_001_to_008.html] +[generated/test_conformance__ogles__GL__control_flow__control_flow_009_to_010.html] +[generated/test_conformance__ogles__GL__cos__cos_001_to_006.html] +[generated/test_conformance__ogles__GL__cross__cross_001_to_002.html] +[generated/test_conformance__ogles__GL__default__default_001_to_001.html] +[generated/test_conformance__ogles__GL__degrees__degrees_001_to_006.html] +[generated/test_conformance__ogles__GL__discard__discard_001_to_002.html] +[generated/test_conformance__ogles__GL__distance__distance_001_to_006.html] +[generated/test_conformance__ogles__GL__dot__dot_001_to_006.html] +[generated/test_conformance__ogles__GL__equal__equal_001_to_008.html] +[generated/test_conformance__ogles__GL__equal__equal_009_to_012.html] +[generated/test_conformance__ogles__GL__exp2__exp2_001_to_008.html] +[generated/test_conformance__ogles__GL__exp2__exp2_009_to_012.html] +[generated/test_conformance__ogles__GL__exp__exp_001_to_008.html] +[generated/test_conformance__ogles__GL__exp__exp_009_to_012.html] +[generated/test_conformance__ogles__GL__faceforward__faceforward_001_to_006.html] +[generated/test_conformance__ogles__GL__floor__floor_001_to_006.html] +[generated/test_conformance__ogles__GL__fract__fract_001_to_006.html] +[generated/test_conformance__ogles__GL__functions__functions_001_to_008.html] +fail-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__ogles__GL__functions__functions_009_to_016.html] +[generated/test_conformance__ogles__GL__functions__functions_017_to_024.html] +[generated/test_conformance__ogles__GL__functions__functions_025_to_032.html] +[generated/test_conformance__ogles__GL__functions__functions_033_to_040.html] +[generated/test_conformance__ogles__GL__functions__functions_041_to_048.html] +[generated/test_conformance__ogles__GL__functions__functions_049_to_056.html] +[generated/test_conformance__ogles__GL__functions__functions_057_to_064.html] +[generated/test_conformance__ogles__GL__functions__functions_065_to_072.html] +[generated/test_conformance__ogles__GL__functions__functions_073_to_080.html] +[generated/test_conformance__ogles__GL__functions__functions_081_to_088.html] +[generated/test_conformance__ogles__GL__functions__functions_089_to_096.html] +[generated/test_conformance__ogles__GL__functions__functions_097_to_104.html] +[generated/test_conformance__ogles__GL__functions__functions_105_to_112.html] +[generated/test_conformance__ogles__GL__functions__functions_113_to_120.html] +[generated/test_conformance__ogles__GL__functions__functions_121_to_126.html] +[generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html] +fail-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html] +[generated/test_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html] +[generated/test_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html] +[generated/test_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html] +[generated/test_conformance__ogles__GL__length__length_001_to_006.html] +[generated/test_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html] +[generated/test_conformance__ogles__GL__lessThan__lessThan_001_to_008.html] +[generated/test_conformance__ogles__GL__log2__log2_001_to_008.html] +[generated/test_conformance__ogles__GL__log2__log2_009_to_012.html] +[generated/test_conformance__ogles__GL__log__log_001_to_008.html] +[generated/test_conformance__ogles__GL__log__log_009_to_012.html] +[generated/test_conformance__ogles__GL__mat3__mat3_001_to_006.html] +skip-if = (os == 'win' && os_version != '5.1') +[generated/test_conformance__ogles__GL__mat__mat_001_to_008.html] +[generated/test_conformance__ogles__GL__mat__mat_009_to_016.html] +[generated/test_conformance__ogles__GL__mat__mat_017_to_024.html] +[generated/test_conformance__ogles__GL__mat__mat_025_to_032.html] +[generated/test_conformance__ogles__GL__mat__mat_033_to_040.html] +[generated/test_conformance__ogles__GL__mat__mat_041_to_046.html] +[generated/test_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html] +[generated/test_conformance__ogles__GL__max__max_001_to_006.html] +[generated/test_conformance__ogles__GL__min__min_001_to_006.html] +[generated/test_conformance__ogles__GL__mix__mix_001_to_006.html] +[generated/test_conformance__ogles__GL__mod__mod_001_to_008.html] +[generated/test_conformance__ogles__GL__normalize__normalize_001_to_006.html] +[generated/test_conformance__ogles__GL__notEqual__notEqual_001_to_008.html] +skip-if = (os == 'linux') +[generated/test_conformance__ogles__GL__notEqual__notEqual_009_to_012.html] +[generated/test_conformance__ogles__GL__not__not_001_to_004.html] +[generated/test_conformance__ogles__GL__operators__operators_001_to_008.html] +[generated/test_conformance__ogles__GL__operators__operators_009_to_016.html] +[generated/test_conformance__ogles__GL__operators__operators_017_to_024.html] +[generated/test_conformance__ogles__GL__operators__operators_025_to_026.html] +[generated/test_conformance__ogles__GL__pow__pow_001_to_008.html] +[generated/test_conformance__ogles__GL__pow__pow_009_to_016.html] +[generated/test_conformance__ogles__GL__pow__pow_017_to_024.html] +[generated/test_conformance__ogles__GL__radians__radians_001_to_006.html] +[generated/test_conformance__ogles__GL__reflect__reflect_001_to_006.html] +[generated/test_conformance__ogles__GL__refract__refract_001_to_006.html] +[generated/test_conformance__ogles__GL__sign__sign_001_to_006.html] +skip-if = (os == 'linux') +[generated/test_conformance__ogles__GL__sin__sin_001_to_006.html] +fail-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html] +[generated/test_conformance__ogles__GL__sqrt__sqrt_001_to_006.html] +[generated/test_conformance__ogles__GL__step__step_001_to_006.html] +[generated/test_conformance__ogles__GL__struct__struct_001_to_008.html] +[generated/test_conformance__ogles__GL__struct__struct_009_to_016.html] +[generated/test_conformance__ogles__GL__struct__struct_017_to_024.html] +[generated/test_conformance__ogles__GL__struct__struct_025_to_032.html] +[generated/test_conformance__ogles__GL__struct__struct_033_to_040.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__ogles__GL__struct__struct_041_to_048.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__ogles__GL__struct__struct_049_to_056.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html] +[generated/test_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html] +[generated/test_conformance__ogles__GL__tan__tan_001_to_006.html] +[generated/test_conformance__ogles__GL__vec3__vec3_001_to_008.html] +[generated/test_conformance__ogles__GL__vec__vec_001_to_008.html] +[generated/test_conformance__ogles__GL__vec__vec_009_to_016.html] +[generated/test_conformance__ogles__GL__vec__vec_017_to_018.html] +[generated/test_conformance__programs__get-active-test.html] +fail-if = (os == 'b2g') +[generated/test_conformance__programs__gl-bind-attrib-location-long-names-test.html] +[generated/test_conformance__programs__gl-bind-attrib-location-test.html] +[generated/test_conformance__programs__gl-get-active-attribute.html] +[generated/test_conformance__programs__gl-get-active-uniform.html] +[generated/test_conformance__programs__gl-getshadersource.html] +[generated/test_conformance__programs__gl-shader-test.html] +[generated/test_conformance__programs__invalid-UTF-16.html] +[generated/test_conformance__programs__program-infolog.html] +[generated/test_conformance__programs__program-test.html] +fail-if = (os == 'android' && android_version == '10') +[generated/test_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html] +[generated/test_conformance__reading__read-pixels-pack-alignment.html] +[generated/test_conformance__reading__read-pixels-test.html] +skip-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__renderbuffers__feedback-loop.html] +[generated/test_conformance__renderbuffers__framebuffer-object-attachment.html] +skip-if = (os == 'android') +[generated/test_conformance__renderbuffers__framebuffer-state-restoration.html] +[generated/test_conformance__renderbuffers__framebuffer-test.html] +[generated/test_conformance__renderbuffers__renderbuffer-initialization.html] +[generated/test_conformance__rendering__clipping-wide-points.html] +fail-if = (os == 'linux') +[generated/test_conformance__rendering__culling.html] +[generated/test_conformance__rendering__default-texture-draw-bug.html] +[generated/test_conformance__rendering__draw-arrays-out-of-bounds.html] +[generated/test_conformance__rendering__draw-elements-out-of-bounds.html] +[generated/test_conformance__rendering__draw-with-changing-start-vertex-bug.html] +[generated/test_conformance__rendering__framebuffer-switch.html] +skip-if = (os == 'android') +[generated/test_conformance__rendering__framebuffer-texture-switch.html] +skip-if = (os == 'android') +[generated/test_conformance__rendering__gl-clear.html] +[generated/test_conformance__rendering__gl-drawarrays.html] +[generated/test_conformance__rendering__gl-drawelements.html] +[generated/test_conformance__rendering__gl-scissor-canvas-dimensions.html] +[generated/test_conformance__rendering__gl-scissor-fbo-test.html] +[generated/test_conformance__rendering__gl-scissor-test.html] +[generated/test_conformance__rendering__gl-viewport-test.html] +[generated/test_conformance__rendering__line-loop-tri-fan.html] +[generated/test_conformance__rendering__many-draw-calls.html] +skip-if = (os == 'android') || debug +[generated/test_conformance__rendering__more-than-65536-indices.html] +[generated/test_conformance__rendering__multisample-corruption.html] +skip-if = (os == 'mac') || (os == 'android') || (os == 'win') +[generated/test_conformance__rendering__negative-one-index.html] +[generated/test_conformance__rendering__out-of-bounds-index-buffers.html] +[generated/test_conformance__rendering__point-no-attributes.html] +[generated/test_conformance__rendering__point-size.html] +[generated/test_conformance__rendering__point-specific-shader-variables.html] +[generated/test_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html] +[generated/test_conformance__rendering__polygon-offset.html] +[generated/test_conformance__rendering__simple.html] +[generated/test_conformance__rendering__triangle.html] +[generated/test_conformance__state__gl-enable-enum-test.html] +[generated/test_conformance__state__gl-enum-tests.html] +[generated/test_conformance__state__gl-get-calls.html] +[generated/test_conformance__state__gl-geterror.html] +[generated/test_conformance__state__gl-getstring.html] +[generated/test_conformance__state__gl-initial-state.html] +[generated/test_conformance__state__gl-object-get-calls.html] +[generated/test_conformance__state__state-uneffected-after-compositing.html] +[generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html] +[generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +[generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html] +[generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +[generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +[generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html] +[generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +[generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html] +[generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +[generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +[generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html] +[generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +[generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html] +[generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +[generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +[generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html] +[generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +[generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html] +[generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +[generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +[generated/test_conformance__textures__misc__compressed-tex-image.html] +[generated/test_conformance__textures__misc__copy-tex-image-2d-formats.html] +skip-if = (os == 'win' && os_version == '5.1') +[generated/test_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html] +[generated/test_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html] +[generated/test_conformance__textures__misc__cube-incomplete-fbo.html] +skip-if = (os == 'android') +fail-if = (os == 'mac') || (os == 'linux') +[generated/test_conformance__textures__misc__default-texture.html] +[generated/test_conformance__textures__misc__gl-get-tex-parameter.html] +[generated/test_conformance__textures__misc__gl-pixelstorei.html] +[generated/test_conformance__textures__misc__gl-teximage.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__mipmap-fbo.html] +[generated/test_conformance__textures__misc__origin-clean-conformance.html] +skip-if = 1 +[generated/test_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html] +skip-if = (os == 'win' && debug) +[generated/test_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html] +[generated/test_conformance__textures__misc__tex-image-canvas-corruption.html] +[generated/test_conformance__textures__misc__tex-image-webgl.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__tex-image-with-format-and-type.html] +[generated/test_conformance__textures__misc__tex-image-with-invalid-data.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__tex-input-validation.html] +[generated/test_conformance__textures__misc__tex-sub-image-2d-bad-args.html] +[generated/test_conformance__textures__misc__tex-sub-image-2d.html] +[generated/test_conformance__textures__misc__texparameter-test.html] +[generated/test_conformance__textures__misc__texture-active-bind-2.html] +[generated/test_conformance__textures__misc__texture-active-bind.html] +[generated/test_conformance__textures__misc__texture-attachment-formats.html] +[generated/test_conformance__textures__misc__texture-clear.html] +[generated/test_conformance__textures__misc__texture-complete.html] +[generated/test_conformance__textures__misc__texture-copying-feedback-loops.html] +[generated/test_conformance__textures__misc__texture-cube-as-fbo-attachment.html] +[generated/test_conformance__textures__misc__texture-draw-with-2d-and-cube.html] +[generated/test_conformance__textures__misc__texture-fakeblack.html] +[generated/test_conformance__textures__misc__texture-formats-test.html] +[generated/test_conformance__textures__misc__texture-hd-dpi.html] +[generated/test_conformance__textures__misc__texture-mips.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-npot-video.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-npot.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-size-cube-maps.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-size-limit.html] +skip-if = (os == 'linux' && asan) +fail-if = (os == 'linux') || (os == 'android') +[generated/test_conformance__textures__misc__texture-size.html] +skip-if = (os == 'android') || (os == 'win') +[generated/test_conformance__textures__misc__texture-sub-image-cube-maps.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-transparent-pixels-initialized.html] +[generated/test_conformance__textures__misc__texture-upload-cube-maps.html] +[generated/test_conformance__textures__misc__texture-upload-size.html] +skip-if = (os == 'win') || (os == 'android') +[generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html] +[generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +[generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html] +[generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +[generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +[generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html] +fail-if = (os == 'android') +[generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'android') +[generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html] +fail-if = (os == 'android') +[generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html] +[generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +[generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html] +[generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +[generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +[generated/test_conformance__typedarrays__array-buffer-crash.html] +[generated/test_conformance__typedarrays__array-buffer-view-crash.html] +[generated/test_conformance__typedarrays__array-large-array-tests.html] +[generated/test_conformance__typedarrays__array-unit-tests.html] +[generated/test_conformance__typedarrays__data-view-crash.html] +[generated/test_conformance__typedarrays__data-view-test.html] +[generated/test_conformance__typedarrays__typed-arrays-in-workers.html] +[generated/test_conformance__uniforms__gl-uniform-arrays.html] +[generated/test_conformance__uniforms__gl-uniform-bool.html] +[generated/test_conformance__uniforms__gl-uniformmatrix4fv.html] +[generated/test_conformance__uniforms__gl-unknown-uniform.html] +[generated/test_conformance__uniforms__null-uniform-location.html] +[generated/test_conformance__uniforms__out-of-bounds-uniform-array-access.html] +skip-if = (os == 'android') || (os == 'mac' && os_version == '10.6') +[generated/test_conformance__uniforms__uniform-default-values.html] +skip-if = (os == 'android') || (os == 'linux') || (os == 'win') +[generated/test_conformance__uniforms__uniform-location.html] +[generated/test_conformance__uniforms__uniform-samplers-test.html] +[generated/test_conformance__uniforms__uniform-values-per-program.html] +skip-if = (os == 'win' && os_version != '5.1') diff --git a/dom/canvas/test/webgl-conf/generated/test_..__always-fail.html b/dom/canvas/test/webgl-conf/generated/test_..__always-fail.html new file mode 100644 index 000000000..7ab5863e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_..__always-fail.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib-i-render.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib-i-render.html new file mode 100644 index 000000000..c72b0cb19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib-i-render.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib.html new file mode 100644 index 000000000..dfb2dcaa1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertex-attrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer-offsets.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer-offsets.html new file mode 100644 index 000000000..77e4f0093 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer-offsets.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer.html new file mode 100644 index 000000000..669135801 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__attribs__gl-vertexattribipointer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__bound-buffer-size-change-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__bound-buffer-size-change-test.html new file mode 100644 index 000000000..a3b3b61b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__bound-buffer-size-change-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-contents.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-contents.html new file mode 100644 index 000000000..7162452c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-contents.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-restrictions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-restrictions.html new file mode 100644 index 000000000..697e5f941 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-copying-restrictions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-data-and-buffer-sub-data-sub-source.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-data-and-buffer-sub-data-sub-source.html new file mode 100644 index 000000000..68cdc923c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-data-and-buffer-sub-data-sub-source.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-overflow-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-overflow-test.html new file mode 100644 index 000000000..87a17f50c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-overflow-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-type-restrictions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-type-restrictions.html new file mode 100644 index 000000000..f44465150 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__buffer-type-restrictions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__get-buffer-sub-data.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__get-buffer-sub-data.html new file mode 100644 index 000000000..dc50a7026 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__get-buffer-sub-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__getBufferSubData.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__getBufferSubData.html new file mode 100644 index 000000000..187a83639 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__getBufferSubData.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__one-large-uniform-buffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__one-large-uniform-buffer.html new file mode 100644 index 000000000..1ea2d20d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__one-large-uniform-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__uniform-buffers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__uniform-buffers.html new file mode 100644 index 000000000..955033eea --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__buffers__uniform-buffers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__constants-and-properties-2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__constants-and-properties-2.html new file mode 100644 index 000000000..04eb07009 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__constants-and-properties-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-attributes-depth-stencil-antialias-obeyed.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-attributes-depth-stencil-antialias-obeyed.html new file mode 100644 index 000000000..f9d0f8879 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-attributes-depth-stencil-antialias-obeyed.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-type-test-2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-type-test-2.html new file mode 100644 index 000000000..82798cc91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__context-type-test-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__methods-2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__methods-2.html new file mode 100644 index 000000000..772067802 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__context__methods-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-color-buffer-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-color-buffer-float.html new file mode 100644 index 000000000..8fa9939c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-color-buffer-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-disjoint-timer-query-webgl2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-disjoint-timer-query-webgl2.html new file mode 100644 index 000000000..c04cfdbd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-disjoint-timer-query-webgl2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions-in-shaders.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions-in-shaders.html new file mode 100644 index 000000000..72de78381 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions-in-shaders.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions.html new file mode 100644 index 000000000..e8e77c302 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__promoted-extensions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-as-return-value.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-as-return-value.html new file mode 100644 index 000000000..64c0bf826 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-as-return-value.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign-constructor.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign-constructor.html new file mode 100644 index 000000000..129fcec5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign-constructor.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign.html new file mode 100644 index 000000000..f5adeac5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-assign.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-complex-indexing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-complex-indexing.html new file mode 100644 index 000000000..550cd825c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-complex-indexing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-element-increment.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-element-increment.html new file mode 100644 index 000000000..d46ec9469 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-element-increment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-equality.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-equality.html new file mode 100644 index 000000000..0200bb137 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-equality.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-in-complex-expression.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-in-complex-expression.html new file mode 100644 index 000000000..ce5da4171 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-in-complex-expression.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-length-side-effects.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-length-side-effects.html new file mode 100644 index 000000000..7d72a5f2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__array-length-side-effects.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__attrib-location-length-limits.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__attrib-location-length-limits.html new file mode 100644 index 000000000..9d2674d18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__attrib-location-length-limits.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__bool-type-cast-bug-uint-ivec-uvec.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__bool-type-cast-bug-uint-ivec-uvec.html new file mode 100644 index 000000000..1937446b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__bool-type-cast-bug-uint-ivec-uvec.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compare-structs-containing-arrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compare-structs-containing-arrays.html new file mode 100644 index 000000000..31cf4c0b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compare-structs-containing-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compound-assignment-type-combination.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compound-assignment-type-combination.html new file mode 100644 index 000000000..536314602 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__compound-assignment-type-combination.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__const-array-init.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__const-array-init.html new file mode 100644 index 000000000..5fad533ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__const-array-init.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__forbidden-operators.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__forbidden-operators.html new file mode 100644 index 000000000..975251d5c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__forbidden-operators.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__frag-depth.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__frag-depth.html new file mode 100644 index 000000000..47dc92fbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__frag-depth.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-default-precision.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-default-precision.html new file mode 100644 index 000000000..2c85219b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-default-precision.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-invariant.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-invariant.html new file mode 100644 index 000000000..c29114b1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__invalid-invariant.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__loops-with-side-effects.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__loops-with-side-effects.html new file mode 100644 index 000000000..02cc30ac7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__loops-with-side-effects.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__misplaced-version-directive.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__misplaced-version-directive.html new file mode 100644 index 000000000..ae794f222 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__misplaced-version-directive.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__no-attribute-vertex-shader.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__no-attribute-vertex-shader.html new file mode 100644 index 000000000..f05151c3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__no-attribute-vertex-shader.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sampler-no-precision.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sampler-no-precision.html new file mode 100644 index 000000000..7170d5bf5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sampler-no-precision.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sequence-operator-returns-non-constant.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sequence-operator-returns-non-constant.html new file mode 100644 index 000000000..a83b2e22d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__sequence-operator-returns-non-constant.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-linking.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-linking.html new file mode 100644 index 000000000..8af0dd8d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-linking.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-define.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-define.html new file mode 100644 index 000000000..ba45f3a10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-define.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-identifier.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-identifier.frag.html new file mode 100644 index 000000000..a16e2b1b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1024-character-identifier.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-define.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-define.html new file mode 100644 index 000000000..b48b7ea6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-define.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-identifier.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-identifier.frag.html new file mode 100644 index 000000000..a5e5ae680 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-1025-character-identifier.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-invalid-characters.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-invalid-characters.html new file mode 100644 index 000000000..2f838fce3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-invalid-characters.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-mis-matching-uniform-block.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-mis-matching-uniform-block.html new file mode 100644 index 000000000..264016082 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__shader-with-mis-matching-uniform-block.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__short-circuiting-in-loop-condition.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__short-circuiting-in-loop-condition.html new file mode 100644 index 000000000..75b1f52c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__short-circuiting-in-loop-condition.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-out-of-range.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-out-of-range.html new file mode 100644 index 000000000..fe093a97f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-out-of-range.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-uniform-texture-coordinate.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-uniform-texture-coordinate.html new file mode 100644 index 000000000..0e9665679 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-offset-uniform-texture-coordinate.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__tricky-loop-conditions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__tricky-loop-conditions.html new file mode 100644 index 000000000..49f833bc2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__tricky-loop-conditions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__unary-minus-operator-in-dynamic-loop.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__unary-minus-operator-in-dynamic-loop.html new file mode 100644 index 000000000..c6cbe0bb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__unary-minus-operator-in-dynamic-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layout-match.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layout-match.html new file mode 100644 index 000000000..ef5b3185c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layout-match.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layouts.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layouts.html new file mode 100644 index 000000000..0b1d1d2b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-block-layouts.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-location-length-limits.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-location-length-limits.html new file mode 100644 index 000000000..0caca1887 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__uniform-location-length-limits.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__valid-invariant.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__valid-invariant.html new file mode 100644 index 000000000..7e3757c3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__valid-invariant.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing-nv-driver-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing-nv-driver-bug.html new file mode 100644 index 000000000..6527650d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing-nv-driver-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html new file mode 100644 index 000000000..83e586558 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__expando-loss-2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__expando-loss-2.html new file mode 100644 index 000000000..8ec3c8865 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__expando-loss-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__getextension-while-pbo-bound-stability.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__getextension-while-pbo-bound-stability.html new file mode 100644 index 000000000..43fc1e9ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__getextension-while-pbo-bound-stability.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__instanceof-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__instanceof-test.html new file mode 100644 index 000000000..471fc8747 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__instanceof-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__object-deletion-behaviour-2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__object-deletion-behaviour-2.html new file mode 100644 index 000000000..32d6a8332 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__object-deletion-behaviour-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__uninitialized-test-2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__uninitialized-test-2.html new file mode 100644 index 000000000..29c20a2f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__uninitialized-test-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__views-with-offsets.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__views-with-offsets.html new file mode 100644 index 000000000..d0d639840 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__misc__views-with-offsets.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__active-built-in-attribs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__active-built-in-attribs.html new file mode 100644 index 000000000..bdc4599f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__active-built-in-attribs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__gl-get-frag-data-location.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__gl-get-frag-data-location.html new file mode 100644 index 000000000..45aadacd0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__gl-get-frag-data-location.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__occlusion-query.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__occlusion-query.html new file mode 100644 index 000000000..a8e365e77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__occlusion-query.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__query.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__query.html new file mode 100644 index 000000000..7a4e6e996 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__query.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__format-r11f-g11f-b10f.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__format-r11f-g11f-b10f.html new file mode 100644 index 000000000..785c4685f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__format-r11f-g11f-b10f.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-fbo-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-fbo-test.html new file mode 100644 index 000000000..8821c5429 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-fbo-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-rgb8-into-pbo-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-rgb8-into-pbo-bug.html new file mode 100644 index 000000000..d57191b13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-from-rgb8-into-pbo-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-into-pixel-pack-buffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-into-pixel-pack-buffer.html new file mode 100644 index 000000000..ea111eb51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-into-pixel-pack-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-pack-parameters.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-pack-parameters.html new file mode 100644 index 000000000..11b6c5fdd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__reading__read-pixels-pack-parameters.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-object-attachment.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-object-attachment.html new file mode 100644 index 000000000..2efa9ab06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-object-attachment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-test.html new file mode 100644 index 000000000..d90e1f34d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-texture-layer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-texture-layer.html new file mode 100644 index 000000000..36f6135ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__framebuffer-texture-layer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__invalidate-framebuffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__invalidate-framebuffer.html new file mode 100644 index 000000000..fbc7edc7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__invalidate-framebuffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisample-with-full-sample-counts.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisample-with-full-sample-counts.html new file mode 100644 index 000000000..75ec0edd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisample-with-full-sample-counts.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisampled-renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisampled-renderbuffer-initialization.html new file mode 100644 index 000000000..dfbfe036b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__multisampled-renderbuffer-initialization.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__readbuffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__readbuffer.html new file mode 100644 index 000000000..dc0453dc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__renderbuffers__readbuffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__attrib-type-match.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__attrib-type-match.html new file mode 100644 index 000000000..02ca28566 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__attrib-type-match.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-outofbounds.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-outofbounds.html new file mode 100644 index 000000000..d7e019a48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-outofbounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-srgb.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-srgb.html new file mode 100644 index 000000000..39a76e198 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-filter-srgb.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-multisampled-readbuffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-multisampled-readbuffer.html new file mode 100644 index 000000000..534203318 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-multisampled-readbuffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-outside-readbuffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-outside-readbuffer.html new file mode 100644 index 000000000..ec294adbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-outside-readbuffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-scissor-enabled.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-scissor-enabled.html new file mode 100644 index 000000000..dd6126940 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-scissor-enabled.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-size-overflow.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-size-overflow.html new file mode 100644 index 000000000..85ba914ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-size-overflow.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-srgb-and-linear-drawbuffers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-srgb-and-linear-drawbuffers.html new file mode 100644 index 000000000..77370818f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-srgb-and-linear-drawbuffers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-stencil-only.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-stencil-only.html new file mode 100644 index 000000000..cad540fbd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-stencil-only.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-test.html new file mode 100644 index 000000000..f959dcb7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__blitframebuffer-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__canvas-resizing-with-pbo-bound.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__canvas-resizing-with-pbo-bound.html new file mode 100644 index 000000000..5c3f49680 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__canvas-resizing-with-pbo-bound.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-func-buffer-type-match.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-func-buffer-type-match.html new file mode 100644 index 000000000..fc661b5c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-func-buffer-type-match.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-srgb-color-buffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-srgb-color-buffer.html new file mode 100644 index 000000000..d08cfe522 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clear-srgb-color-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clipping-wide-points.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clipping-wide-points.html new file mode 100644 index 000000000..5e6c6bfbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__clipping-wide-points.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__draw-buffers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__draw-buffers.html new file mode 100644 index 000000000..43307805c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__draw-buffers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__element-index-uint.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__element-index-uint.html new file mode 100644 index 000000000..8180603cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__element-index-uint.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-completeness-unaffected.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-completeness-unaffected.html new file mode 100644 index 000000000..93e8439f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-completeness-unaffected.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-unsupported.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-unsupported.html new file mode 100644 index 000000000..4529ef996 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__framebuffer-unsupported.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__fs-color-type-mismatch-color-buffer-type.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__fs-color-type-mismatch-color-buffer-type.html new file mode 100644 index 000000000..c458c082e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__fs-color-type-mismatch-color-buffer-type.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-arrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-arrays.html new file mode 100644 index 000000000..27b6c3d24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-rendering-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-rendering-bug.html new file mode 100644 index 000000000..6a335d460 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__instanced-rendering-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__out-of-bounds-index-buffers-after-copying.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__out-of-bounds-index-buffers-after-copying.html new file mode 100644 index 000000000..5e91e3b89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__out-of-bounds-index-buffers-after-copying.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rendering-sampling-feedback-loop.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rendering-sampling-feedback-loop.html new file mode 100644 index 000000000..e276066a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rendering-sampling-feedback-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rgb-format-support.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rgb-format-support.html new file mode 100644 index 000000000..09a3bf62f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__rgb-format-support.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__uniform-block-buffer-size.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__uniform-block-buffer-size.html new file mode 100644 index 000000000..c2c5806c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__uniform-block-buffer-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__sampler-drawing-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__sampler-drawing-test.html new file mode 100644 index 000000000..ccb137449 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__sampler-drawing-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__samplers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__samplers.html new file mode 100644 index 000000000..f9047b52f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__samplers__samplers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-enum-tests.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-enum-tests.html new file mode 100644 index 000000000..0700bc8e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-enum-tests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-get-calls.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-get-calls.html new file mode 100644 index 000000000..bf6967ce0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-get-calls.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-getstring.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-getstring.html new file mode 100644 index 000000000..e60ab332e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-getstring.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-object-get-calls.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-object-get-calls.html new file mode 100644 index 000000000..2928299d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__state__gl-object-get-calls.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..538b2de1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..0f2524d1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..a032873d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-float.html new file mode 100644 index 000000000..5c5c8f7b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..fc9ec1fcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r32f-red-float.html new file mode 100644 index 000000000..a0ffef71c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..871f9c51d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..ad73b061b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..536865b39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..748645327 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..3baedef4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..5d9db46a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..a2b66853a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..a12337230 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..da5f50e4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..93f1f878f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..78ea03044 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..a67fa5b56 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..350e8978c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..5e60d09eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..202623909 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..1eb4336e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..9bdd93225 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..db4b725c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..9fcb3a1f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..8067dda41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..59dc25cb3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..54bffe498 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..4584d22d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..49e6011c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..e5efc4d69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..bec5f5eb7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..afbbc3998 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..36fc896a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-float.html new file mode 100644 index 000000000..75b9da510 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..fbbce6313 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r32f-red-float.html new file mode 100644 index 000000000..263fbc0c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..424252c4e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..052cb6a24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..bea56ae3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..f41bd034d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..20992fd0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..7d45197ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..dc813a1c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..a5d8b640f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..49ffc6449 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..660b0ef0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..200c25f6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..5f6a170bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..9e578698d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..f417e8e8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..d100b3830 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..d302f60ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..65899f13a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..e0b32f855 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..94eb992a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..a8d341284 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..5d3962b17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..7b3369363 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..b66f0d74a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..f8223a558 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..ec96df5fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..83d5ebbd0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..013bd5d45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..20560bf95 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-float.html new file mode 100644 index 000000000..bbd5cbefd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..8a5d33781 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r32f-red-float.html new file mode 100644 index 000000000..2cb93e34c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..505b5d45e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..dd647735b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..447009cfc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..2f0f9db0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..009134025 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..0aaf046c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..4b42d3e92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..793ff02e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..706b0520f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..10e03a726 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..1d50898f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..e02394152 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..cfc91db8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..522f368c9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..4b138ad4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..752faadd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..49339fd62 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..1807abdcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..605e6e8a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..951b0045d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..dc9b74069 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..2cb3eaad1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..dbae03e07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..abef1e9cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..a883f5bf8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..bee6464d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..b6d1d6e8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..6d4c831c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..cb6fd4346 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..80a985598 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-float.html new file mode 100644 index 000000000..4392e7c36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..536a82a2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r32f-red-float.html new file mode 100644 index 000000000..f204312ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..65b687969 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..622f2e5c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..2fe210774 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..bdf3622b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..8451ee5ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..1bb678eb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..0890e43f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..2d9f9622e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..df8438b65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..1acfc8d0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..952368b5b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..299b82ed6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..027835df1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..98daec043 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..6bb57e5bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..df32e75af --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..51809d13e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..7a970ed24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..bdd02872a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..98bb27d51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..e3df23c0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..70c5ff86b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..0be8d4718 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..29aaec0d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..04bcf493c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..905f05b74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..4152f3834 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..277a3a81e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..5469ccb43 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..03d63d5b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-float.html new file mode 100644 index 000000000..4970c061f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..49dd438de --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r32f-red-float.html new file mode 100644 index 000000000..a92aff232 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..247bc4ecd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..2cd935f6e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..ada379524 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..cf195bda0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..a7a0d4e5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..1f4f92feb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..a4b178f11 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..242942bb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..8afab38bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..00d0c76ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..62cbc72ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..dbffd5f91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..6e1316ca5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..61cc83f56 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..63f389773 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..e587192df --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..8701dd346 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..ea1657503 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..81edc3c16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..6329e1649 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..ae86b7f25 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..d096b92a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..aa3c7a32d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..67bbeaaa0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..55075510c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..a73f778a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..08e2b48ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..39f3a179f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..b89f4b6e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..5d54c0c89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-float.html new file mode 100644 index 000000000..84362b6a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..50397b900 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r32f-red-float.html new file mode 100644 index 000000000..48bdb09eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..4d2d67d68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..3fa70aa6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..96951be74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..f9a55844a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..19e0a90a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..f23b3c2cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..f661290e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..0c70d2dee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..c014ba34b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..71e6ed4b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..a6ac75eba --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..ecb48e09b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..24f57cbc2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..2e6f5b699 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..97f95f907 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..de09a856e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..80ff1a35d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..5c6853809 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..937fe5ac4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..848bf58a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..002c65714 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..c307c8c4d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..229a6655f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..f75a31197 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..7ee489c27 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..994a2cb00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..b328e80b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..f8baf0bf5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..99c4d15cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..a6bf8e4db --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-float.html new file mode 100644 index 000000000..5ed8bab48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..f74f8d43e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r32f-red-float.html new file mode 100644 index 000000000..60807d3b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..77da6fd2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..8504ca5bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..c8daea805 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..7c82c9221 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..7aca8bc78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..efe57a43e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..411001958 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..024e5d208 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..c9a030081 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..afbd0c680 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..a672dbc52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..c06e0aa8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..933183626 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..1c0cc7eb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..9bf5a975c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..a0d788a1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..fe1928363 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..73df8de35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..71c1031b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..9d253445e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..bf97fec0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..ea2881d4e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..69ccdfb7f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..e1d7f9e79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..cab688fa8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..b4787d5b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..ace7e65ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..ed80a6e11 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..8191fa90b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..c43355fb6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-float.html new file mode 100644 index 000000000..a2c23653e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..b40413e6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r32f-red-float.html new file mode 100644 index 000000000..defc51a6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..2ca329f24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..9bb455926 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..ab3c6789e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..cd1d4d276 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..82ee7bab2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..45db01a02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..1734a30b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..98e40b651 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..aba83ad23 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..28dc0df76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..64c770f52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..c229be8cd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..a81528190 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..9dbbf9a68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..664173930 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..069fd3df6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..a8bb1fdf0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..ff054fe78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..5ba22d198 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..e80a25270 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..e2d7116f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..04f61d5df --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..04f2b5166 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..e171ee56b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..de0266fcf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..4e547b6bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..e3caf2d51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__image_data__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__active-3d-texture-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__active-3d-texture-bug.html new file mode 100644 index 000000000..2196361f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__active-3d-texture-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-luma-format.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-luma-format.html new file mode 100644 index 000000000..5f70440bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-luma-format.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-webgl-specific.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-webgl-specific.html new file mode 100644 index 000000000..eef9b72f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image-webgl-specific.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image.html new file mode 100644 index 000000000..26e9fc1f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__copy-texture-image.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__gl-get-tex-parameter.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__gl-get-tex-parameter.html new file mode 100644 index 000000000..280eeef09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__gl-get-tex-parameter.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-specification-order-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-specification-order-bug.html new file mode 100644 index 000000000..78e2f438a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-specification-order-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-texture-sampling.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-texture-sampling.html new file mode 100644 index 000000000..40804f10d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__integer-cubemap-texture-sampling.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__mipmap-fbo.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__mipmap-fbo.html new file mode 100644 index 000000000..426270bf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__mipmap-fbo.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-3d-size-limit.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-3d-size-limit.html new file mode 100644 index 000000000..7ba3ee5d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-3d-size-limit.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-and-sub-image-with-array-buffer-view-sub-source.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-and-sub-image-with-array-buffer-view-sub-source.html new file mode 100644 index 000000000..f0f50944a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-and-sub-image-with-array-buffer-view-sub-source.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args-from-dom-elements.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args-from-dom-elements.html new file mode 100644 index 000000000..750f4b45f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args-from-dom-elements.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args.html new file mode 100644 index 000000000..3a41fdf14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-bad-args.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-different-data-source.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-different-data-source.html new file mode 100644 index 000000000..b3f8842d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-with-different-data-source.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-input-validation.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-input-validation.html new file mode 100644 index 000000000..9f8a66842 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-input-validation.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-mipmap-levels.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-mipmap-levels.html new file mode 100644 index 000000000..dcdd7830f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-mipmap-levels.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-new-formats.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-new-formats.html new file mode 100644 index 000000000..66d6b0a04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-new-formats.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-srgb-mipmap.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-srgb-mipmap.html new file mode 100644 index 000000000..d971f0309 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-srgb-mipmap.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-2d.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-2d.html new file mode 100644 index 000000000..c26cb8a7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-2d.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-and-subimage-3d.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-and-subimage-3d.html new file mode 100644 index 000000000..18b13e249 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-and-subimage-3d.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-compressed-formats.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-compressed-formats.html new file mode 100644 index 000000000..246ff74c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-storage-compressed-formats.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-unpack-params.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-unpack-params.html new file mode 100644 index 000000000..0bd728646 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-unpack-params.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texel-fetch-undefined.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texel-fetch-undefined.html new file mode 100644 index 000000000..3e4e9327a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texel-fetch-undefined.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texture-npot.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texture-npot.html new file mode 100644 index 000000000..18b333c16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__texture-npot.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..bb1c2b034 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..896208761 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..8f24d7b1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-float.html new file mode 100644 index 000000000..b55e01672 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..c55f9728e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r32f-red-float.html new file mode 100644 index 000000000..52d3c2b8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..406a0de09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..e4b192394 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..b618ca5a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..7f6dd7bde --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..1c1b7e4d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..c6113faf3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..5012896a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..0a74463e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..ba882ffd0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..848365ca1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..90c5f9568 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..9b1af897b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..c0edfcf29 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..feb6f9941 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..7233c2194 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..bb210c1ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..d18aba77b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..927ff271c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..9e68fbf61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..cf3314685 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..459f199d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..b9efa5947 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..d0aa959f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..81ed5ac7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..2667ad0b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..16a80c887 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..cbfeb55af --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..0bfaa8d74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..4546eb20c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..aabeb7496 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-float.html new file mode 100644 index 000000000..32181c281 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..6fa523ed5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r32f-red-float.html new file mode 100644 index 000000000..f1e25a626 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..e004ebc5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..282057dfb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..7d8b11e03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..429f9a872 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..9d3b4fa96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..2282379fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..e2cdba287 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..a26064e14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..2339da11b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..6967a2a1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..2dfc120b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..4eec278d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..4381bd547 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..ef106dffd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..d48c68e70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..2d0c955cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..57d036d3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..b6f1ea621 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..50eba0b48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..d9846322d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..bfbeb7c30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..445b681be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..8d9d172ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..aa3f2c659 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..cf4bd95db --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..2eac7fc2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..c9d4bb11d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__svg_image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..e5ce8cb4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..f3afcb675 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..824fb1aed --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-float.html new file mode 100644 index 000000000..cd03c78cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..ac1ad9cd9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r32f-red-float.html new file mode 100644 index 000000000..a205aa8df --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..27676b17c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..acfcd6966 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..09e261f6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..9f5f1f9da --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..f6b3791ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..431653271 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..528d24b31 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..2e3f6c9fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..9f95bd206 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..ffee0f813 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..4f7652f53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..803d0d6d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..45cdeb8ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..c31cc94a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..125d655a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..f71c76f33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..0045359fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..24e3f515d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..0f33257a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..46f24d9e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..3bb7227b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..1553aaa69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..9d030a1d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..2081fdedf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..fa1794b54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..a6b179cfb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..4356ede7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..241a53a2a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..f2edc1def --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..329042488 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-float.html new file mode 100644 index 000000000..ee559ebdc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..bbd8b4c75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r32f-red-float.html new file mode 100644 index 000000000..b970df0aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..1fefab671 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..edd2fbdcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..0825be92c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..59c108085 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..6e279bf26 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..809e2f5a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..2737ddfd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..fb4e7062c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..54cdff209 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..d48fe513b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..4cc3b9606 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..de177379e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..3f2ab2cf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..98684d38c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..36ecfcb7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..10c3e7a0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-float.html new file mode 100644 index 000000000..a402e9cb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-half_float.html new file mode 100644 index 000000000..248f20ccd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..016a5d495 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..0cf3547de --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..98bd77570 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..0669261e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..854ce3b0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..870515992 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..7339a753f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..526d87f3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..48b6cfd13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__video__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..bff28a729 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..beb146ef5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..63562c998 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-float.html new file mode 100644 index 000000000..41acd15fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-half_float.html new file mode 100644 index 000000000..2ebaf0ac1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r32f-red-float.html new file mode 100644 index 000000000..a61033dbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..3757afe98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..951e9d7a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-float.html new file mode 100644 index 000000000..27494025d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-half_float.html new file mode 100644 index 000000000..43ff884a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg32f-rg-float.html new file mode 100644 index 000000000..194015500 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..551051572 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..5a0f88c53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-float.html new file mode 100644 index 000000000..9cd0b4295 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..3b53bc34a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb32f-rgb-float.html new file mode 100644 index 000000000..cd0cc693d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..959525539 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..bf8378874 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..6b8f33b71 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..6c46180a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..7b2034382 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..4bcb36c0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-float.html new file mode 100644 index 000000000..d131fce6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..000ebc6e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba32f-rgba-float.html new file mode 100644 index 000000000..8bbf90eb7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..6cec8cf33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..57695c260 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..27691af1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..c93a911a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..11d3e450d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..1f1f3045b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-2d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-float.html new file mode 100644 index 000000000..be8586768 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html new file mode 100644 index 000000000..2ee40469d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html new file mode 100644 index 000000000..c749f4631 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-float.html new file mode 100644 index 000000000..f3536711c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-half_float.html new file mode 100644 index 000000000..ef5c591bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r16f-red-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r32f-red-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r32f-red-float.html new file mode 100644 index 000000000..7ba317178 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r32f-red-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8-red-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8-red-unsigned_byte.html new file mode 100644 index 000000000..254cc6ab0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8-red-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8ui-red_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8ui-red_integer-unsigned_byte.html new file mode 100644 index 000000000..25a48bbad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-r8ui-red_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-float.html new file mode 100644 index 000000000..db4f02db1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-half_float.html new file mode 100644 index 000000000..2b12d35b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg16f-rg-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg32f-rg-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg32f-rg-float.html new file mode 100644 index 000000000..159e46bc6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg32f-rg-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8-rg-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8-rg-unsigned_byte.html new file mode 100644 index 000000000..a356e72db --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8-rg-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html new file mode 100644 index 000000000..4e845ba29 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rg8ui-rg_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-float.html new file mode 100644 index 000000000..fc2c93cf0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-half_float.html new file mode 100644 index 000000000..b1046b46b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb16f-rgb-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb32f-rgb-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb32f-rgb-float.html new file mode 100644 index 000000000..c04d56eb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb32f-rgb-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_byte.html new file mode 100644 index 000000000..38c72d8ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..7919f7854 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html new file mode 100644 index 000000000..265f98084 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..4e55021b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..4e4a1aaa5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html new file mode 100644 index 000000000..0b7540443 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-float.html new file mode 100644 index 000000000..afa1b4982 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-half_float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-half_float.html new file mode 100644 index 000000000..d735a93f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba16f-rgba-half_float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba32f-rgba-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba32f-rgba-float.html new file mode 100644 index 000000000..1e754946a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba32f-rgba-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_byte.html new file mode 100644 index 000000000..62f36fe02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..2899b7ad1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8-rgba-unsigned_byte.html new file mode 100644 index 000000000..bbd21fb50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html new file mode 100644 index 000000000..a90d6d342 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8-rgb-unsigned_byte.html new file mode 100644 index 000000000..f4a83b43a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html new file mode 100644 index 000000000..21afe6773 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__webgl_canvas__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__transform_feedback.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__transform_feedback.html new file mode 100644 index 000000000..324d5c6f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__transform_feedback.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__two-unreferenced-varyings.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__two-unreferenced-varyings.html new file mode 100644 index 000000000..76d0cbf8d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__two-unreferenced-varyings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__unwritten-output-defaults-to-zero.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__unwritten-output-defaults-to-zero.html new file mode 100644 index 000000000..382b910e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__transform_feedback__unwritten-output-defaults-to-zero.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__vertex_arrays__vertex-array-object.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__vertex_arrays__vertex-array-object.html new file mode 100644 index 000000000..96cd57aae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__vertex_arrays__vertex-array-object.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-aliasing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-aliasing.html new file mode 100644 index 000000000..604fec6db --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-aliasing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-matrix.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-matrix.html new file mode 100644 index 000000000..7440a2245 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-matrix.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-repeated.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-repeated.html new file mode 100644 index 000000000..cbf205458 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-bindAttribLocation-repeated.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-disabled-vertex-attrib.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-disabled-vertex-attrib.html new file mode 100644 index 000000000..dc8546280 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-disabled-vertex-attrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-enable-vertex-attrib.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-enable-vertex-attrib.html new file mode 100644 index 000000000..1b1af2d5b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-enable-vertex-attrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-matrix-attributes.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-matrix-attributes.html new file mode 100644 index 000000000..36b535f3b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-matrix-attributes.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-render.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-render.html new file mode 100644 index 000000000..487a8d498 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-render.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-zero-issues.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-zero-issues.html new file mode 100644 index 000000000..24c4d98c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertex-attrib-zero-issues.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer-offsets.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer-offsets.html new file mode 100644 index 000000000..4d101b2b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer-offsets.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer.html new file mode 100644 index 000000000..295f2eef1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__attribs__gl-vertexattribpointer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-bind-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-bind-test.html new file mode 100644 index 000000000..516d14e63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-bind-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-and-buffer-sub-data.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-and-buffer-sub-data.html new file mode 100644 index 000000000..b040a8a1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-and-buffer-sub-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-array-buffer-delete.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-array-buffer-delete.html new file mode 100644 index 000000000..a5e258fcd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-data-array-buffer-delete.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-uninitialized.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-uninitialized.html new file mode 100644 index 000000000..b2ba00be5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__buffer-uninitialized.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__element-array-buffer-delete-recreate.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__element-array-buffer-delete-recreate.html new file mode 100644 index 000000000..867e7b5f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__element-array-buffer-delete-recreate.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-copies-indices.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-copies-indices.html new file mode 100644 index 000000000..fb36aff0d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-copies-indices.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-crash-with-buffer-sub-data.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-crash-with-buffer-sub-data.html new file mode 100644 index 000000000..db7404ef9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-crash-with-buffer-sub-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-large-buffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-large-buffer.html new file mode 100644 index 000000000..05e669a29 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-large-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-verifies-too-many-indices.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-verifies-too-many-indices.html new file mode 100644 index 000000000..13260bff5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-verifies-too-many-indices.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-with-resized-buffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-with-resized-buffer.html new file mode 100644 index 000000000..8d643c95f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation-with-resized-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation.html new file mode 100644 index 000000000..3199b9549 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__buffers__index-validation.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-offscreen-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-offscreen-test.html new file mode 100644 index 000000000..620e7e21d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-offscreen-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-preserve-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-preserve-test.html new file mode 100644 index 000000000..e1a98a1d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__buffer-preserve-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-test.html new file mode 100644 index 000000000..78572de79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-zero-size.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-zero-size.html new file mode 100644 index 000000000..ad1022e40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__canvas-zero-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html new file mode 100644 index 000000000..389b5b416 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-webgl-to-canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-webgl-to-canvas-test.html new file mode 100644 index 000000000..8bdc3c68a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__draw-webgl-to-canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-hd-dpi-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-hd-dpi-test.html new file mode 100644 index 000000000..f7141311f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-hd-dpi-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-static-canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-static-canvas-test.html new file mode 100644 index 000000000..c4693a999 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-static-canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-test.html new file mode 100644 index 000000000..40edd2a83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__drawingbuffer-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html new file mode 100644 index 000000000..c1563c6eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html new file mode 100644 index 000000000..6223fb81d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__rapid-resizing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__rapid-resizing.html new file mode 100644 index 000000000..01e029d19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__rapid-resizing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__texture-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__texture-bindings-unaffected-on-resize.html new file mode 100644 index 000000000..702bece75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__texture-bindings-unaffected-on-resize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__to-data-url-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__to-data-url-test.html new file mode 100644 index 000000000..b394238f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__to-data-url-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__viewport-unchanged-upon-resize.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__viewport-unchanged-upon-resize.html new file mode 100644 index 000000000..d0ef7cc80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__canvas__viewport-unchanged-upon-resize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attribute-preserve-drawing-buffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attribute-preserve-drawing-buffer.html new file mode 100644 index 000000000..9cc9fdf74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attribute-preserve-drawing-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attributes-alpha-depth-stencil-antialias.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attributes-alpha-depth-stencil-antialias.html new file mode 100644 index 000000000..6bf25ca91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-attributes-alpha-depth-stencil-antialias.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation-and-destruction.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation-and-destruction.html new file mode 100644 index 000000000..48e252c2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation-and-destruction.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation.html new file mode 100644 index 000000000..a97347451 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-creation.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-eviction-with-garbage-collection.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-eviction-with-garbage-collection.html new file mode 100644 index 000000000..756c49f6b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-eviction-with-garbage-collection.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-hidden-alpha.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-hidden-alpha.html new file mode 100644 index 000000000..5aa661020 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-hidden-alpha.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost-restored.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost-restored.html new file mode 100644 index 000000000..3ec2aba0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost-restored.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost.html new file mode 100644 index 000000000..e9910668c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-lost.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-no-alpha-fbo-with-alpha.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-no-alpha-fbo-with-alpha.html new file mode 100644 index 000000000..63db785ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-no-alpha-fbo-with-alpha.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-upon-reload.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-upon-reload.html new file mode 100644 index 000000000..6f6a78c5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-upon-reload.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-with-workers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-with-workers.html new file mode 100644 index 000000000..1d9657bf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-release-with-workers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-size-change.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-size-change.html new file mode 100644 index 000000000..40856ec5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__context-size-change.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__incorrect-context-object-behaviour.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__incorrect-context-object-behaviour.html new file mode 100644 index 000000000..dee1aed75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__incorrect-context-object-behaviour.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__premultiplyalpha-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__premultiplyalpha-test.html new file mode 100644 index 000000000..c8f8594a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__premultiplyalpha-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__resource-sharing-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__resource-sharing-test.html new file mode 100644 index 000000000..b0794f6e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__resource-sharing-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__user-defined-properties-on-context.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__user-defined-properties-on-context.html new file mode 100644 index 000000000..9e4244101 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__context__user-defined-properties-on-context.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-disjoint-timer-query.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-disjoint-timer-query.html new file mode 100644 index 000000000..d2ec460d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-disjoint-timer-query.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-texture-filter-anisotropic.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-texture-filter-anisotropic.html new file mode 100644 index 000000000..d1544506e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-texture-filter-anisotropic.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__get-extension.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__get-extension.html new file mode 100644 index 000000000..f51b3fd8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__get-extension.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__oes-texture-float-linear.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__oes-texture-float-linear.html new file mode 100644 index 000000000..5595f807b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__oes-texture-float-linear.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-atc.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-atc.html new file mode 100644 index 000000000..393052881 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-atc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-etc.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-etc.html new file mode 100644 index 000000000..a5a859b15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-etc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-pvrtc.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-pvrtc.html new file mode 100644 index 000000000..51bb0f79e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-pvrtc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html new file mode 100644 index 000000000..4d64f1cb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc.html new file mode 100644 index 000000000..090e0afed --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-size-limit.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-size-limit.html new file mode 100644 index 000000000..ddde30e65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-compressed-texture-size-limit.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-renderer-info.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-renderer-info.html new file mode 100644 index 000000000..4554d52b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-renderer-info.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-shaders.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-shaders.html new file mode 100644 index 000000000..be9dddefd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-debug-shaders.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-shared-resources.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-shared-resources.html new file mode 100644 index 000000000..6d4d41a01 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-shared-resources.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-ambiguous-function-call.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-ambiguous-function-call.html new file mode 100644 index 000000000..7c0395851 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-ambiguous-function-call.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-constructor-invalid-parameters.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-constructor-invalid-parameters.html new file mode 100644 index 000000000..9ad5b6e54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-constructor-invalid-parameters.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-d3d11-compiler-error.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-d3d11-compiler-error.html new file mode 100644 index 000000000..375cf9696 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-d3d11-compiler-error.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-dx-variable-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-dx-variable-bug.html new file mode 100644 index 000000000..6f9624e91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__angle-dx-variable-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__array-of-struct-with-int-first-position.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__array-of-struct-with-int-first-position.html new file mode 100644 index 000000000..3fab5efea --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__array-of-struct-with-int-first-position.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__bool-type-cast-bug-int-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__bool-type-cast-bug-int-float.html new file mode 100644 index 000000000..b64cbf393 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__bool-type-cast-bug-int-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compare-loop-index-to-uniform.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compare-loop-index-to-uniform.html new file mode 100644 index 000000000..27522195e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compare-loop-index-to-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__complex-glsl-does-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__complex-glsl-does-not-crash.html new file mode 100644 index 000000000..9640ca6e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__complex-glsl-does-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compound-assignment-type-combination.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compound-assignment-type-combination.html new file mode 100644 index 000000000..4fd97a6c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__compound-assignment-type-combination.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-in-loop.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-in-loop.html new file mode 100644 index 000000000..a9761f44f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-in-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-optimization.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-optimization.html new file mode 100644 index 000000000..5974aed3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__conditional-discard-optimization.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__constant-precision-qualifier.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__constant-precision-qualifier.html new file mode 100644 index 000000000..6fc3e0d4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__constant-precision-qualifier.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html new file mode 100644 index 000000000..2a64f736b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floored-division-accuracy.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floored-division-accuracy.html new file mode 100644 index 000000000..2752ab0c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__floored-division-accuracy.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__fragcoord-linking-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__fragcoord-linking-bug.html new file mode 100644 index 000000000..a515d5dd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__fragcoord-linking-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html new file mode 100644 index 000000000..4db862ff8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html new file mode 100644 index 000000000..4a94ba233 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html new file mode 100644 index 000000000..2bff81bc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__logic-inside-block-without-braces.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__logic-inside-block-without-braces.html new file mode 100644 index 000000000..8cd271930 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__logic-inside-block-without-braces.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__long-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__long-expressions-should-not-crash.html new file mode 100644 index 000000000..955324689 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__long-expressions-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__loop-if-loop-gradient.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__loop-if-loop-gradient.html new file mode 100644 index 000000000..afc7be655 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__loop-if-loop-gradient.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__modulo-arithmetic-accuracy.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__modulo-arithmetic-accuracy.html new file mode 100644 index 000000000..a2dc3da45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__modulo-arithmetic-accuracy.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__multiplication-assignment.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__multiplication-assignment.html new file mode 100644 index 000000000..09c76737d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__multiplication-assignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-functions-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-functions-should-not-crash.html new file mode 100644 index 000000000..c3d6d8d33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-functions-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-loops-with-break-and-continue.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-loops-with-break-and-continue.html new file mode 100644 index 000000000..299382f8d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-loops-with-break-and-continue.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-sequence-operator.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-sequence-operator.html new file mode 100644 index 000000000..e7bb425fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__nested-sequence-operator.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html new file mode 100644 index 000000000..c00567c79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html new file mode 100644 index 000000000..c8e0c1191 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-crash.html new file mode 100644 index 000000000..b08c64913 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html new file mode 100644 index 000000000..abe930636 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-array-using-loop-index.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-array-using-loop-index.html new file mode 100644 index 000000000..bb8cc5eaf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-array-using-loop-index.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-struct-function-arg.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-struct-function-arg.html new file mode 100644 index 000000000..1b62efcca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sampler-struct-function-arg.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sequence-operator-evaluation-order.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sequence-operator-evaluation-order.html new file mode 100644 index 000000000..09345d09a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sequence-operator-evaluation-order.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html new file mode 100644 index 000000000..6ecfb3840 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__struct-constructor-highp-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__struct-constructor-highp-bug.html new file mode 100644 index 000000000..2b8a03064 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__struct-constructor-highp-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__temp-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__temp-expressions-should-not-crash.html new file mode 100644 index 000000000..8975a5745 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__temp-expressions-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__undefined-index-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__undefined-index-should-not-crash.html new file mode 100644 index 000000000..7eba8654c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__undefined-index-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__uniforms-should-not-lose-values.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__uniforms-should-not-lose-values.html new file mode 100644 index 000000000..dd50924a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__bugs__uniforms-should-not-lose-values.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec2.html new file mode 100644 index 000000000..ca96e9f2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec3.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec3.html new file mode 100644 index 000000000..ed05b26b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec4.html new file mode 100644 index 000000000..12c9daf5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-bvec4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec2.html new file mode 100644 index 000000000..8862a4490 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec3.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec3.html new file mode 100644 index 000000000..3a228f200 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec4.html new file mode 100644 index 000000000..12f5518ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-ivec4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat2.html new file mode 100644 index 000000000..3397fb5bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat3.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat3.html new file mode 100644 index 000000000..055d3959f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat4.html new file mode 100644 index 000000000..5f08d95d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-mat4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html new file mode 100644 index 000000000..44c9e6fee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-index.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-index.html new file mode 100644 index 000000000..67e0f0b8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-index.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec2.html new file mode 100644 index 000000000..b378d501f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec3.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec3.html new file mode 100644 index 000000000..803bb8491 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html new file mode 100644 index 000000000..aa2cea042 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-abs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-abs.html new file mode 100644 index 000000000..ba47559fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-abs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-acos.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-acos.html new file mode 100644 index 000000000..eee1127f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-acos.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-asin.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-asin.html new file mode 100644 index 000000000..cf1ef703e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-asin.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan-xy.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan-xy.html new file mode 100644 index 000000000..aadba2758 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan-xy.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan.html new file mode 100644 index 000000000..a7285c19a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-atan.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-ceil.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-ceil.html new file mode 100644 index 000000000..a43e779e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-ceil.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-float.html new file mode 100644 index 000000000..7af3ecb31 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-gentype.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-gentype.html new file mode 100644 index 000000000..a346f365d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-clamp-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cos.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cos.html new file mode 100644 index 000000000..63a7f29e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cos.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cross.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cross.html new file mode 100644 index 000000000..99dffa8bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-cross.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-distance.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-distance.html new file mode 100644 index 000000000..99fb19873 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-distance.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-dot.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-dot.html new file mode 100644 index 000000000..3034d765b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-dot.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-faceforward.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-faceforward.html new file mode 100644 index 000000000..fb2c8a12c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-faceforward.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-floor.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-floor.html new file mode 100644 index 000000000..bf59d9f51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-floor.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-fract.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-fract.html new file mode 100644 index 000000000..2e6c9f83b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-fract.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-length.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-length.html new file mode 100644 index 000000000..d7719d7b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-length.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-float.html new file mode 100644 index 000000000..2e8dcb217 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-gentype.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-gentype.html new file mode 100644 index 000000000..218db9ece --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-max-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-float.html new file mode 100644 index 000000000..567f13adb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-gentype.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-gentype.html new file mode 100644 index 000000000..680eb1692 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-min-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-float.html new file mode 100644 index 000000000..8b2e966a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-gentype.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-gentype.html new file mode 100644 index 000000000..6d48aadc6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mix-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-float.html new file mode 100644 index 000000000..2ba50da06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-gentype.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-gentype.html new file mode 100644 index 000000000..aa7e397d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-mod-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-normalize.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-normalize.html new file mode 100644 index 000000000..8c6027277 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-normalize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-reflect.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-reflect.html new file mode 100644 index 000000000..d1203d608 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-reflect.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sign.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sign.html new file mode 100644 index 000000000..7e45c8b54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sign.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sin.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sin.html new file mode 100644 index 000000000..d14454b92 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-sin.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-float.html new file mode 100644 index 000000000..69e2f765d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-gentype.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-gentype.html new file mode 100644 index 000000000..bb29af33b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-smoothstep-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-float.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-float.html new file mode 100644 index 000000000..2a27e3f58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-gentype.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-gentype.html new file mode 100644 index 000000000..f28f95682 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function-step-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function.html new file mode 100644 index 000000000..4618bc7af --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__functions__glsl-function.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_float.vert.html new file mode 100644 index 000000000..302716849 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat2.vert.html new file mode 100644 index 000000000..69ecc1429 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat3.vert.html new file mode 100644 index 000000000..2c2d2e9d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat4.vert.html new file mode 100644 index 000000000..5f8a012a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec2.vert.html new file mode 100644 index 000000000..4c250cbab --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec3.vert.html new file mode 100644 index 000000000..0e6ca88c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec4.vert.html new file mode 100644 index 000000000..6ba5b540c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec2_vec2.vert.html new file mode 100644 index 000000000..c04af59c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec3_vec3.vert.html new file mode 100644 index 000000000..c5420d229 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec4_vec4.vert.html new file mode 100644 index 000000000..18d605303 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__add_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_int_to_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_int_to_float.vert.html new file mode 100644 index 000000000..b0a80bfc7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_int_to_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html new file mode 100644 index 000000000..e6933372a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html new file mode 100644 index 000000000..47cfe8d70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html new file mode 100644 index 000000000..67e9f8f51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__construct_struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__construct_struct.vert.html new file mode 100644 index 000000000..fd28dc47f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__construct_struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_float.vert.html new file mode 100644 index 000000000..1539c21f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat2.vert.html new file mode 100644 index 000000000..f82534505 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat3.vert.html new file mode 100644 index 000000000..2839b9aee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat4.vert.html new file mode 100644 index 000000000..e07c9322a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec2.vert.html new file mode 100644 index 000000000..0ff6e961d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec3.vert.html new file mode 100644 index 000000000..c261b23f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec4.vert.html new file mode 100644 index 000000000..2e49ad401 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec2_vec2.vert.html new file mode 100644 index 000000000..3bfe7ad46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec3_vec3.vert.html new file mode 100644 index 000000000..49ecfb921 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec4_vec4.vert.html new file mode 100644 index 000000000..213859341 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__divide_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_int_float.vert.html new file mode 100644 index 000000000..52f5d86c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec2_vec2.vert.html new file mode 100644 index 000000000..31ee74de1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec3_vec3.vert.html new file mode 100644 index 000000000..1dd62f23b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec4_vec4.vert.html new file mode 100644 index 000000000..abb1c3500 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__equal_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_int_float.vert.html new file mode 100644 index 000000000..f1188a760 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec2_vec2.vert.html new file mode 100644 index 000000000..5877ad7a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec3_vec3.vert.html new file mode 100644 index 000000000..ab1acaff9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec4_vec4.vert.html new file mode 100644 index 000000000..8069ca361 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__function_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than.vert.html new file mode 100644 index 000000000..b707df7b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than_equal.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than_equal.vert.html new file mode 100644 index 000000000..6818baa1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__greater_than_equal.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than.vert.html new file mode 100644 index 000000000..cc238aecf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than_equal.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than_equal.vert.html new file mode 100644 index 000000000..84db6e208 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__less_than_equal.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_float.vert.html new file mode 100644 index 000000000..7b14f33c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat2.vert.html new file mode 100644 index 000000000..ecde81d7b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat3.vert.html new file mode 100644 index 000000000..9b6fb0fb0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat4.vert.html new file mode 100644 index 000000000..cc8b76977 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec2.vert.html new file mode 100644 index 000000000..d1f827889 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec3.vert.html new file mode 100644 index 000000000..617b48980 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec4.vert.html new file mode 100644 index 000000000..bc6be7282 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html new file mode 100644 index 000000000..50dcc337a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html new file mode 100644 index 000000000..4f27db69f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html new file mode 100644 index 000000000..23e645493 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_int_float.vert.html new file mode 100644 index 000000000..b84f6e7ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html new file mode 100644 index 000000000..0e6769da1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html new file mode 100644 index 000000000..c6b09e6dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html new file mode 100644 index 000000000..f52d2102c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_float.vert.html new file mode 100644 index 000000000..8810349ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat2.vert.html new file mode 100644 index 000000000..c98fbe333 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat3.vert.html new file mode 100644 index 000000000..1133b1d94 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat4.vert.html new file mode 100644 index 000000000..5d8f7cf11 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec2.vert.html new file mode 100644 index 000000000..bb67fffc8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec3.vert.html new file mode 100644 index 000000000..59de3d07a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec4.vert.html new file mode 100644 index 000000000..4d1accb3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html new file mode 100644 index 000000000..0205b6c5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html new file mode 100644 index 000000000..048affebf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html new file mode 100644 index 000000000..8dbb4abc7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_int_float.vert.html new file mode 100644 index 000000000..6547f4b30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html new file mode 100644 index 000000000..f7d504f8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html new file mode 100644 index 000000000..5507f7536 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html new file mode 100644 index 000000000..01b16a554 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__float_literal.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__float_literal.vert.html new file mode 100644 index 000000000..96200bc25 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__float_literal.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__literal_precision.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__literal_precision.html new file mode 100644 index 000000000..8876a306d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__literal_precision.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__overflow_leak.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__overflow_leak.vert.html new file mode 100644 index 000000000..ff3c7fe4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__literals__overflow_leak.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat3-construction.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat3-construction.html new file mode 100644 index 000000000..c2f45d8ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat3-construction.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat4-to-mat3.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat4-to-mat3.html new file mode 100644 index 000000000..636a71fce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__glsl-mat4-to-mat3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__matrix-compound-multiply.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__matrix-compound-multiply.html new file mode 100644 index 000000000..74920ce48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__matrices__matrix-compound-multiply.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__boolean_precision.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__boolean_precision.html new file mode 100644 index 000000000..7c1647ddf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__boolean_precision.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__const-variable-initialization.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__const-variable-initialization.html new file mode 100644 index 000000000..d1d9aa258 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__const-variable-initialization.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__embedded-struct-definitions-forbidden.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__embedded-struct-definitions-forbidden.html new file mode 100644 index 000000000..90782b246 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__embedded-struct-definitions-forbidden.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty-declaration.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty-declaration.html new file mode 100644 index 000000000..dc1242bd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty-declaration.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty_main.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty_main.vert.html new file mode 100644 index 000000000..6cd05725e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__empty_main.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__expression-list-in-declarator-initializer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__expression-list-in-declarator-initializer.html new file mode 100644 index 000000000..9e4b24888 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__expression-list-in-declarator-initializer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__gl_position_unset.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__gl_position_unset.vert.html new file mode 100644 index 000000000..7e2cc3201 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__gl_position_unset.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__global-variable-init.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__global-variable-init.html new file mode 100644 index 000000000..864ca9a9b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__global-variable-init.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-function-nodes.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-function-nodes.html new file mode 100644 index 000000000..cf0b2d87a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-function-nodes.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-long-variable-names.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-long-variable-names.html new file mode 100644 index 000000000..2eda6d483 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-long-variable-names.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-vertex-branch.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-vertex-branch.html new file mode 100644 index 000000000..1f1ac6cb4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__glsl-vertex-branch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__large-loop-compile.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__large-loop-compile.html new file mode 100644 index 000000000..2317c7f05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__large-loop-compile.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii-comments.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii-comments.vert.html new file mode 100644 index 000000000..06f68acbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii-comments.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii.vert.html new file mode 100644 index 000000000..2634debc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__non-ascii.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__re-compile-re-link.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__re-compile-re-link.html new file mode 100644 index 000000000..cf7bdbf3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__re-compile-re-link.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__sequence-operator-returns-constant.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__sequence-operator-returns-constant.html new file mode 100644 index 000000000..eabe8f7b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__sequence-operator-returns-constant.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-precision-format-obeyed.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-precision-format-obeyed.html new file mode 100644 index 000000000..6dcd7f38b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-precision-format-obeyed.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-struct-scope.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-struct-scope.html new file mode 100644 index 000000000..ab85178b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-struct-scope.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html new file mode 100644 index 000000000..abee7d690 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-varying-packing-restrictions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-varying-packing-restrictions.html new file mode 100644 index 000000000..5a779261d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-varying-packing-restrictions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-define.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-define.html new file mode 100644 index 000000000..27e79a4af --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-define.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-identifier.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-identifier.frag.html new file mode 100644 index 000000000..a4830856a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-256-character-identifier.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html new file mode 100644 index 000000000..565a3c521 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html new file mode 100644 index 000000000..f4f87caa5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html new file mode 100644 index 000000000..ef0b82fb7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html new file mode 100644 index 000000000..68ff8493b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-uniform.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-uniform.html new file mode 100644 index 000000000..47bc717ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-array-of-structs-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-array.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-array.vert.html new file mode 100644 index 000000000..66e95fec8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-array.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-struct.vert.html new file mode 100644 index 000000000..ada8d9add --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-attrib-struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-clipvertex.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-clipvertex.vert.html new file mode 100644 index 000000000..2cf55ce1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-clipvertex.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-assignment.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-assignment.html new file mode 100644 index 000000000..d6505f903 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-assignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-conditional-assignment.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-conditional-assignment.html new file mode 100644 index 000000000..a7e5eb605 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-conditional-assignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html new file mode 100644 index 000000000..4a4e1c02d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping-negative.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping-negative.html new file mode 100644 index 000000000..c895e02d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping-negative.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping.html new file mode 100644 index 000000000..5e0a52ca6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-conditional-scoping.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.frag.html new file mode 100644 index 000000000..aabd6064f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.vert.html new file mode 100644 index 000000000..aa16c6a65 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-default-precision.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-define-line-continuation.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-define-line-continuation.frag.html new file mode 100644 index 000000000..fa12d7762 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-define-line-continuation.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html new file mode 100644 index 000000000..c5798c9b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx.frag.html new file mode 100644 index 000000000..ab59e77a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-dfdx.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-do-loop.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-do-loop.html new file mode 100644 index 000000000..1c64f5d2f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-do-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-error-directive.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-error-directive.html new file mode 100644 index 000000000..da461df12 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-error-directive.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html new file mode 100644 index 000000000..c07978ce7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-float-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-float-return-value.frag.html new file mode 100644 index 000000000..a25987590 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-float-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-loop.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-loop.html new file mode 100644 index 000000000..eed62e39a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-scoping.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-scoping.html new file mode 100644 index 000000000..14e759fbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-for-scoping.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-frag-depth.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-frag-depth.frag.html new file mode 100644 index 000000000..ebd69ccbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-frag-depth.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-recursion.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-recursion.frag.html new file mode 100644 index 000000000..e5e97602a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-recursion.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-scoped-struct.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-scoped-struct.html new file mode 100644 index 000000000..e3ca903b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-function-scoped-struct.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-functional-scoping.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-functional-scoping.html new file mode 100644 index 000000000..4521d05d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-functional-scoping.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glcolor.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glcolor.vert.html new file mode 100644 index 000000000..d2694070b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glcolor.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-1.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-1.frag.html new file mode 100644 index 000000000..ad838fa80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-1.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-symbol.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-symbol.frag.html new file mode 100644 index 000000000..c24eb0276 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-gles-symbol.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html new file mode 100644 index 000000000..ea2ca4345 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html new file mode 100644 index 000000000..605f6eb3b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-hex-int-constant-macro.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-hex-int-constant-macro.html new file mode 100644 index 000000000..0b5284911 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-hex-int-constant-macro.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html new file mode 100644 index 000000000..f344b6d85 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-include.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-include.vert.html new file mode 100644 index 000000000..1f3e0a7cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-include.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-int-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-int-return-value.frag.html new file mode 100644 index 000000000..007546c6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-int-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-invalid-identifier.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-invalid-identifier.frag.html new file mode 100644 index 000000000..7b95633db --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-invalid-identifier.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html new file mode 100644 index 000000000..5d44d919b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html new file mode 100644 index 000000000..2bf70edca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html new file mode 100644 index 000000000..327057470 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-limited-indexing.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-limited-indexing.frag.html new file mode 100644 index 000000000..89c9c7bb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-limited-indexing.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-long-line.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-long-line.html new file mode 100644 index 000000000..b12cee8d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-long-line.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-ascii-error.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-ascii-error.frag.html new file mode 100644 index 000000000..6a542e573 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-ascii-error.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-reserved-words.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-reserved-words.html new file mode 100644 index 000000000..0f6863c7a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-non-reserved-words.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-precision.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-precision.frag.html new file mode 100644 index 000000000..fa6b78946 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-precision.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-preprocessor-whitespace.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-preprocessor-whitespace.html new file mode 100644 index 000000000..2a033d06c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-preprocessor-whitespace.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-quoted-error.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-quoted-error.frag.html new file mode 100644 index 000000000..748bb9c87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-quoted-error.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-reserved-words.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-reserved-words.html new file mode 100644 index 000000000..14b6b80ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-reserved-words.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-short-circuiting-operators.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-short-circuiting-operators.html new file mode 100644 index 000000000..86daad1b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-short-circuiting-operators.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-similar-uniform-array-names.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-similar-uniform-array-names.html new file mode 100644 index 000000000..b905b95a9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-similar-uniform-array-names.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-too-many-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-too-many-uniforms.html new file mode 100644 index 000000000..7ac650c20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-too-many-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-two-initializer-types.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-two-initializer-types.html new file mode 100644 index 000000000..3987fc654 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-two-initializer-types.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html new file mode 100644 index 000000000..03de5c80d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html new file mode 100644 index 000000000..d02b55088 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec2-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec2-return-value.frag.html new file mode 100644 index 000000000..55302d2d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec2-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec3-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec3-return-value.frag.html new file mode 100644 index 000000000..b05b1014d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec3-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-return-value.frag.html new file mode 100644 index 000000000..f8fb25405 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html new file mode 100644 index 000000000..83aecdab8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.frag.html new file mode 100644 index 000000000..6d1e1c4bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.vert.html new file mode 100644 index 000000000..39d061d56 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-100.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-120.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-120.vert.html new file mode 100644 index 000000000..26b519cda --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-120.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-130.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-130.vert.html new file mode 100644 index 000000000..9310710c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-version-130.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-webgl-identifier.vert.html new file mode 100644 index 000000000..08e090af8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-webgl-identifier.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-while-loop.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-while-loop.html new file mode 100644 index 000000000..3baa09a7c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-with-while-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-without-precision.frag.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-without-precision.frag.html new file mode 100644 index 000000000..6a616862a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-without-precision.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html new file mode 100644 index 000000000..101fb5a91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-invariance.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-invariance.html new file mode 100644 index 000000000..75c2ee22a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-invariance.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html new file mode 100644 index 000000000..24f8055e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-varyings.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-varyings.html new file mode 100644 index 000000000..8ef663015 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-mis-matching-varyings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-missing-varyings.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-missing-varyings.html new file mode 100644 index 000000000..2468cd710 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-missing-varyings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-name-conflicts.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-name-conflicts.html new file mode 100644 index 000000000..65544c41c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-name-conflicts.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-uniform-structs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-uniform-structs.html new file mode 100644 index 000000000..39f5c5a86 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-uniform-structs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-varyings.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-varyings.html new file mode 100644 index 000000000..822d39250 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shaders-with-varyings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shared.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shared.html new file mode 100644 index 000000000..d9a6cda91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shared.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-assign.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-assign.html new file mode 100644 index 000000000..1ef045777 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-assign.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-equals.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-equals.html new file mode 100644 index 000000000..7cf25ea73 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-equals.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-mixed-array-declarators.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-mixed-array-declarators.html new file mode 100644 index 000000000..514aaf8aa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-mixed-array-declarators.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-exceeds-maximum.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-exceeds-maximum.html new file mode 100644 index 000000000..2409bf628 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-exceeds-maximum.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-of-variable-names.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-of-variable-names.html new file mode 100644 index 000000000..d2508cae4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-of-variable-names.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-under-maximum.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-under-maximum.html new file mode 100644 index 000000000..cd07d1ee1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-nesting-under-maximum.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-specifiers-in-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-specifiers-in-uniforms.html new file mode 100644 index 000000000..51d1f1b4d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-specifiers-in-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-unary-operators.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-unary-operators.html new file mode 100644 index 000000000..b3651585d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__struct-unary-operators.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operator-on-arrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operator-on-arrays.html new file mode 100644 index 000000000..d90c75865 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operator-on-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-global-initializers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-global-initializers.html new file mode 100644 index 000000000..a4c53e4bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-global-initializers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-initializers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-initializers.html new file mode 100644 index 000000000..67e1a1b67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__ternary-operators-in-initializers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_field.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_field.vert.html new file mode 100644 index 000000000..33a642ec8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_field.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_function.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_function.vert.html new file mode 100644 index 000000000..c508e9b9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_function.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_struct.vert.html new file mode 100644 index 000000000..2f5dc77b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_variable.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_variable.vert.html new file mode 100644 index 000000000..97c9fa65f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved___webgl_variable.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_field.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_field.vert.html new file mode 100644 index 000000000..ff13f13c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_field.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_function.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_function.vert.html new file mode 100644 index 000000000..99015fd50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_function.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_struct.vert.html new file mode 100644 index 000000000..421f00b84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_variable.vert.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_variable.vert.html new file mode 100644 index 000000000..efb3c458c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__reserved__webgl_variable.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2d-bias.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2d-bias.html new file mode 100644 index 000000000..7b0c79458 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2d-bias.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dlod.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dlod.html new file mode 100644 index 000000000..849d8f870 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dlod.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dproj.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dproj.html new file mode 100644 index 000000000..ae4a88e31 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dproj.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dprojlod.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dprojlod.html new file mode 100644 index 000000000..f54aa4aea --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__samplers__glsl-function-texture2dprojlod.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord-xy-values.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord-xy-values.html new file mode 100644 index 000000000..219657e0f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord-xy-values.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord.html new file mode 100644 index 000000000..a50bffed5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragcoord.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragdata-and-fragcolor.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragdata-and-fragcolor.html new file mode 100644 index 000000000..1b4719ab9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-fragdata-and-fragcolor.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-frontfacing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-frontfacing.html new file mode 100644 index 000000000..b52f54b02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-frontfacing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-pointcoord.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-pointcoord.html new file mode 100644 index 000000000..03b6c2e74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__gl-pointcoord.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__glsl-built-ins.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__glsl-built-ins.html new file mode 100644 index 000000000..94a9d7538 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__variables__glsl-built-ins.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-line-width.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-line-width.html new file mode 100644 index 000000000..9e5e7514e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-line-width.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-max-texture-dimensions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-max-texture-dimensions.html new file mode 100644 index 000000000..bb343f7d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-max-texture-dimensions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-attribs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-attribs.html new file mode 100644 index 000000000..a066bcfc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-attribs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-textures.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-textures.html new file mode 100644 index 000000000..25b4e1139 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-textures.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-uniforms.html new file mode 100644 index 000000000..233bc1003 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__limits__gl-min-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__bad-arguments-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__bad-arguments-test.html new file mode 100644 index 000000000..a9ee47523 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__bad-arguments-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__boolean-argument-conversion.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__boolean-argument-conversion.html new file mode 100644 index 000000000..18ea991c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__boolean-argument-conversion.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__delayed-drawing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__delayed-drawing.html new file mode 100644 index 000000000..638f02b35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__delayed-drawing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__error-reporting.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__error-reporting.html new file mode 100644 index 000000000..dc8dbad60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__error-reporting.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__expando-loss.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__expando-loss.html new file mode 100644 index 000000000..5523b558c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__expando-loss.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__functions-returning-strings.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__functions-returning-strings.html new file mode 100644 index 000000000..45ce883cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__functions-returning-strings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__invalid-passed-params.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__invalid-passed-params.html new file mode 100644 index 000000000..f0d3ccea0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__invalid-passed-params.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__is-object.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__is-object.html new file mode 100644 index 000000000..37378a028 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__is-object.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__null-object-behaviour.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__null-object-behaviour.html new file mode 100644 index 000000000..39b5b01a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__null-object-behaviour.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__object-deletion-behaviour.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__object-deletion-behaviour.html new file mode 100644 index 000000000..b50a79de9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__object-deletion-behaviour.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__shader-precision-format.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__shader-precision-format.html new file mode 100644 index 000000000..0b04d938b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__shader-precision-format.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__type-conversion-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__type-conversion-test.html new file mode 100644 index 000000000..b9bf95e83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__type-conversion-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__uninitialized-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__uninitialized-test.html new file mode 100644 index 000000000..af564919f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__uninitialized-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__webgl-specific.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__webgl-specific.html new file mode 100644 index 000000000..f506a7c38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__misc__webgl-specific.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__constants.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__constants.html new file mode 100644 index 000000000..de55ff6f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__constants.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__getContext.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__getContext.html new file mode 100644 index 000000000..386288b5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__getContext.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__methods.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__methods.html new file mode 100644 index 000000000..e89184fb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__methods.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-A.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-A.html new file mode 100644 index 000000000..826454d2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-A.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B1.html new file mode 100644 index 000000000..fbf1b78c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B2.html new file mode 100644 index 000000000..d80b10d0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B3.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B3.html new file mode 100644 index 000000000..f385a327a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B4.html new file mode 100644 index 000000000..daf72cf6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-B4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-C.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-C.html new file mode 100644 index 000000000..96c02598f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-C.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-D_G.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-D_G.html new file mode 100644 index 000000000..0442b08ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-D_G.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-G_I.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-G_I.html new file mode 100644 index 000000000..c7b3fff72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-G_I.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-L_S.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-L_S.html new file mode 100644 index 000000000..23b612209 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-L_S.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-S_V.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-S_V.html new file mode 100644 index 000000000..328210e55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__quickCheckAPI-S_V.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__webGLArrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__webGLArrays.html new file mode 100644 index 000000000..802a60857 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__conformance__webGLArrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBuffer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBuffer.html new file mode 100644 index 000000000..188a2b876 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBuffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBufferBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBufferBadArgs.html new file mode 100644 index 000000000..f75ed509f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindBufferBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindFramebufferLeaveNonZero.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindFramebufferLeaveNonZero.html new file mode 100644 index 000000000..afdf8e7ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bindFramebufferLeaveNonZero.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferData.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferData.html new file mode 100644 index 000000000..62e7657ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferData.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferDataBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferDataBadArgs.html new file mode 100644 index 000000000..9f6a9ee3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferDataBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubData.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubData.html new file mode 100644 index 000000000..00886aad9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubData.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubDataBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubDataBadArgs.html new file mode 100644 index 000000000..466ea88ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__bufferSubDataBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2D.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2D.html new file mode 100644 index 000000000..45ec0caab --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2DBadArgs.html new file mode 100644 index 000000000..cae90332f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2D.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2D.html new file mode 100644 index 000000000..857ff97a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2DBadArgs.html new file mode 100644 index 000000000..16057b2b5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__copyTexSubImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__deleteBufferBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__deleteBufferBadArgs.html new file mode 100644 index 000000000..22ac8ce79 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__deleteBufferBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArrays.html new file mode 100644 index 000000000..1af803a1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArraysOutOfBounds.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArraysOutOfBounds.html new file mode 100644 index 000000000..7a4eaa3d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawArraysOutOfBounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElements.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElements.html new file mode 100644 index 000000000..437894a17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElements.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElementsBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElementsBadArgs.html new file mode 100644 index 000000000..b7b996253 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__drawElementsBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTests.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTests.html new file mode 100644 index 000000000..705947d16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTestsBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTestsBadArgs.html new file mode 100644 index 000000000..65cc3e278 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__isTestsBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixels.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixels.html new file mode 100644 index 000000000..366b78581 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixels.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixelsBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixelsBadArgs.html new file mode 100644 index 000000000..2c2be0e70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__readPixelsBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2D.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2D.html new file mode 100644 index 000000000..5272d16af --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DBadArgs.html new file mode 100644 index 000000000..541dba245 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTML.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTML.html new file mode 100644 index 000000000..84ad2ccad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTML.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTMLBadArgs.html new file mode 100644 index 000000000..5897fe022 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texImage2DHTMLBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2D.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2D.html new file mode 100644 index 000000000..2ab43a85b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DBadArgs.html new file mode 100644 index 000000000..1cbf538d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTML.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTML.html new file mode 100644 index 000000000..8b98997ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTML.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTMLBadArgs.html new file mode 100644 index 000000000..dab2e1c2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__texSubImage2DHTMLBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrix.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrix.html new file mode 100644 index 000000000..46a6ae753 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrix.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrixBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrixBadArgs.html new file mode 100644 index 000000000..10cc10992 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformMatrixBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformf.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformf.html new file mode 100644 index 000000000..3d53100d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformf.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfArrayLen1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfArrayLen1.html new file mode 100644 index 000000000..666826ba4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfArrayLen1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfBadArgs.html new file mode 100644 index 000000000..ee6f4116f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformfBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformi.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformi.html new file mode 100644 index 000000000..447a212ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformi.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformiBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformiBadArgs.html new file mode 100644 index 000000000..51aacf5dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__uniformiBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttrib.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttrib.html new file mode 100644 index 000000000..e28fb755d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribBadArgs.html new file mode 100644 index 000000000..c884668b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointer.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointer.html new file mode 100644 index 000000000..a9c3a5bda --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointerBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointerBadArgs.html new file mode 100644 index 000000000..34c72d24d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__functions__vertexAttribPointerBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__arrayOutOfBounds.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__arrayOutOfBounds.html new file mode 100644 index 000000000..672dcddbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__arrayOutOfBounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__uniformOutOfBounds.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__uniformOutOfBounds.html new file mode 100644 index 000000000..d8a993518 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__more__glsl__uniformOutOfBounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__abs__abs_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__abs__abs_001_to_006.html new file mode 100644 index 000000000..7c9897696 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__abs__abs_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__acos__acos_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__acos__acos_001_to_006.html new file mode 100644 index 000000000..6a7f2c227 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__acos__acos_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__all__all_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__all__all_001_to_004.html new file mode 100644 index 000000000..90060719d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__all__all_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__any__any_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__any__any_001_to_004.html new file mode 100644 index 000000000..09ff93cd8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__any__any_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__array__array_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__array__array_001_to_006.html new file mode 100644 index 000000000..98bb1361d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__array__array_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__asin__asin_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__asin__asin_001_to_006.html new file mode 100644 index 000000000..2792b773e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__asin__asin_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_001_to_008.html new file mode 100644 index 000000000..ed08c1ced --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_009_to_012.html new file mode 100644 index 000000000..bde690902 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__atan__atan_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_001_to_008.html new file mode 100644 index 000000000..1b65b3d9a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_009_to_016.html new file mode 100644 index 000000000..14062c6fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biConstants__biConstants_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html new file mode 100644 index 000000000..de1584485 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_001_to_008.html new file mode 100644 index 000000000..cd8fb1cdf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_009_to_016.html new file mode 100644 index 000000000..04bb6d876 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_017_to_024.html new file mode 100644 index 000000000..3c3db4a89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_025_to_032.html new file mode 100644 index 000000000..a0af5a45f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_033_to_040.html new file mode 100644 index 000000000..9b8336751 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_041_to_048.html new file mode 100644 index 000000000..0d550cb15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_049_to_056.html new file mode 100644 index 000000000..567af5214 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_057_to_064.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_057_to_064.html new file mode 100644 index 000000000..c2ae8fd44 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_057_to_064.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_065_to_072.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_065_to_072.html new file mode 100644 index 000000000..33c611ccf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_065_to_072.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_073_to_080.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_073_to_080.html new file mode 100644 index 000000000..31d017629 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_073_to_080.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_081_to_088.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_081_to_088.html new file mode 100644 index 000000000..347bb62d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_081_to_088.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_089_to_096.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_089_to_096.html new file mode 100644 index 000000000..c6371d256 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_089_to_096.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_097_to_104.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_097_to_104.html new file mode 100644 index 000000000..a93014bf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_097_to_104.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_105_to_112.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_105_to_112.html new file mode 100644 index 000000000..e30307f08 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_105_to_112.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_113_to_120.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_113_to_120.html new file mode 100644 index 000000000..4e3ba4d6c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_113_to_120.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_121_to_128.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_121_to_128.html new file mode 100644 index 000000000..deda08207 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_121_to_128.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_129_to_136.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_129_to_136.html new file mode 100644 index 000000000..a5e5c4760 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_129_to_136.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_137_to_144.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_137_to_144.html new file mode 100644 index 000000000..813687514 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_137_to_144.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_145_to_152.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_145_to_152.html new file mode 100644 index 000000000..2b84b397e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_145_to_152.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_153_to_160.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_153_to_160.html new file mode 100644 index 000000000..f4865610e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_153_to_160.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_161_to_168.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_161_to_168.html new file mode 100644 index 000000000..0b669a80d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_161_to_168.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_169_to_176.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_169_to_176.html new file mode 100644 index 000000000..a7b7d1d7f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_169_to_176.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_177_to_178.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_177_to_178.html new file mode 100644 index 000000000..f852ce643 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__build__build_177_to_178.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html new file mode 100644 index 000000000..046ea12c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__ceil__ceil_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__ceil__ceil_001_to_006.html new file mode 100644 index 000000000..e9806b7d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__ceil__ceil_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__clamp__clamp_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__clamp__clamp_001_to_006.html new file mode 100644 index 000000000..2594183af --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__clamp__clamp_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_001_to_008.html new file mode 100644 index 000000000..50ff3487b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_009_to_010.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_009_to_010.html new file mode 100644 index 000000000..6cad486a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__control_flow__control_flow_009_to_010.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cos__cos_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cos__cos_001_to_006.html new file mode 100644 index 000000000..082ce69f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cos__cos_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cross__cross_001_to_002.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cross__cross_001_to_002.html new file mode 100644 index 000000000..ecabd67ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__cross__cross_001_to_002.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__default__default_001_to_001.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__default__default_001_to_001.html new file mode 100644 index 000000000..583f00ea1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__default__default_001_to_001.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__degrees__degrees_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__degrees__degrees_001_to_006.html new file mode 100644 index 000000000..ec9fe44c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__degrees__degrees_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__discard__discard_001_to_002.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__discard__discard_001_to_002.html new file mode 100644 index 000000000..9a42ddf4e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__discard__discard_001_to_002.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__distance__distance_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__distance__distance_001_to_006.html new file mode 100644 index 000000000..48be31230 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__distance__distance_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__dot__dot_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__dot__dot_001_to_006.html new file mode 100644 index 000000000..55b7a0fe7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__dot__dot_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_001_to_008.html new file mode 100644 index 000000000..c991a1dc3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_009_to_012.html new file mode 100644 index 000000000..8f578966c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__equal__equal_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_001_to_008.html new file mode 100644 index 000000000..fc451f7cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_009_to_012.html new file mode 100644 index 000000000..446039d93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp2__exp2_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_001_to_008.html new file mode 100644 index 000000000..c19f46e13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_009_to_012.html new file mode 100644 index 000000000..344649a08 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__exp__exp_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__faceforward__faceforward_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__faceforward__faceforward_001_to_006.html new file mode 100644 index 000000000..273a89294 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__faceforward__faceforward_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__floor__floor_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__floor__floor_001_to_006.html new file mode 100644 index 000000000..901fff340 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__floor__floor_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__fract__fract_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__fract__fract_001_to_006.html new file mode 100644 index 000000000..3eee81a1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__fract__fract_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_001_to_008.html new file mode 100644 index 000000000..d0beae706 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_009_to_016.html new file mode 100644 index 000000000..e4881dcd7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_017_to_024.html new file mode 100644 index 000000000..532178fa7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_025_to_032.html new file mode 100644 index 000000000..26e5922cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_033_to_040.html new file mode 100644 index 000000000..c5bc3d735 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_041_to_048.html new file mode 100644 index 000000000..0cbe6c897 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_049_to_056.html new file mode 100644 index 000000000..c50681462 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_057_to_064.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_057_to_064.html new file mode 100644 index 000000000..df1663f96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_057_to_064.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_065_to_072.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_065_to_072.html new file mode 100644 index 000000000..963f3e270 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_065_to_072.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_073_to_080.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_073_to_080.html new file mode 100644 index 000000000..1ea031825 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_073_to_080.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_081_to_088.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_081_to_088.html new file mode 100644 index 000000000..f178ab417 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_081_to_088.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_089_to_096.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_089_to_096.html new file mode 100644 index 000000000..6caa20bc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_089_to_096.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_097_to_104.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_097_to_104.html new file mode 100644 index 000000000..e8dac1f8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_097_to_104.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_105_to_112.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_105_to_112.html new file mode 100644 index 000000000..7e2d18a66 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_105_to_112.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_113_to_120.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_113_to_120.html new file mode 100644 index 000000000..4ac2b2a2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_113_to_120.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_121_to_126.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_121_to_126.html new file mode 100644 index 000000000..9f88b7f1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__functions__functions_121_to_126.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html new file mode 100644 index 000000000..46b2d9e30 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html new file mode 100644 index 000000000..16ff5f36e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html new file mode 100644 index 000000000..22d2120ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html new file mode 100644 index 000000000..1501e4e69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html new file mode 100644 index 000000000..ef635f2d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__length__length_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__length__length_001_to_006.html new file mode 100644 index 000000000..d621f0599 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__length__length_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html new file mode 100644 index 000000000..cb7c1941d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThan__lessThan_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThan__lessThan_001_to_008.html new file mode 100644 index 000000000..e7a9bce6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__lessThan__lessThan_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_001_to_008.html new file mode 100644 index 000000000..ffb057c5e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_009_to_012.html new file mode 100644 index 000000000..112dd86c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log2__log2_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_001_to_008.html new file mode 100644 index 000000000..0fe9734f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_009_to_012.html new file mode 100644 index 000000000..b38254e17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__log__log_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat3__mat3_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat3__mat3_001_to_006.html new file mode 100644 index 000000000..ddd2260c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat3__mat3_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_001_to_008.html new file mode 100644 index 000000000..841eaa935 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_009_to_016.html new file mode 100644 index 000000000..02da94580 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_017_to_024.html new file mode 100644 index 000000000..a2decd992 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_025_to_032.html new file mode 100644 index 000000000..bbd015732 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_033_to_040.html new file mode 100644 index 000000000..0d273a39b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_041_to_046.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_041_to_046.html new file mode 100644 index 000000000..b7c161098 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mat__mat_041_to_046.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html new file mode 100644 index 000000000..446e6a7fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__max__max_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__max__max_001_to_006.html new file mode 100644 index 000000000..c95586dcc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__max__max_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__min__min_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__min__min_001_to_006.html new file mode 100644 index 000000000..2ca2e9bd7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__min__min_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mix__mix_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mix__mix_001_to_006.html new file mode 100644 index 000000000..9eb32829c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mix__mix_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mod__mod_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mod__mod_001_to_008.html new file mode 100644 index 000000000..37ac5d01b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__mod__mod_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__normalize__normalize_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__normalize__normalize_001_to_006.html new file mode 100644 index 000000000..d9b426e40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__normalize__normalize_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_001_to_008.html new file mode 100644 index 000000000..86dbb9d16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_009_to_012.html new file mode 100644 index 000000000..0993afdf5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__notEqual__notEqual_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__not__not_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__not__not_001_to_004.html new file mode 100644 index 000000000..a1169cad6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__not__not_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_001_to_008.html new file mode 100644 index 000000000..318606725 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_009_to_016.html new file mode 100644 index 000000000..4d1efd854 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_017_to_024.html new file mode 100644 index 000000000..459a2ef70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_025_to_026.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_025_to_026.html new file mode 100644 index 000000000..065e82d2c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__operators__operators_025_to_026.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_001_to_008.html new file mode 100644 index 000000000..dba7780be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_009_to_016.html new file mode 100644 index 000000000..8938f1a9e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_017_to_024.html new file mode 100644 index 000000000..4545461c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__pow__pow_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__radians__radians_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__radians__radians_001_to_006.html new file mode 100644 index 000000000..a8779fcf7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__radians__radians_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__reflect__reflect_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__reflect__reflect_001_to_006.html new file mode 100644 index 000000000..7c39169bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__reflect__reflect_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__refract__refract_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__refract__refract_001_to_006.html new file mode 100644 index 000000000..15eb4c89b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__refract__refract_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sign__sign_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sign__sign_001_to_006.html new file mode 100644 index 000000000..d71f6c3a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sign__sign_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sin__sin_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sin__sin_001_to_006.html new file mode 100644 index 000000000..6052960e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sin__sin_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html new file mode 100644 index 000000000..02f1edb74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sqrt__sqrt_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sqrt__sqrt_001_to_006.html new file mode 100644 index 000000000..95034e328 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__sqrt__sqrt_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__step__step_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__step__step_001_to_006.html new file mode 100644 index 000000000..3d8241961 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__step__step_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_001_to_008.html new file mode 100644 index 000000000..f9b0a6eb3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_009_to_016.html new file mode 100644 index 000000000..fc9965db3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_017_to_024.html new file mode 100644 index 000000000..964993a37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_025_to_032.html new file mode 100644 index 000000000..533e11412 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_033_to_040.html new file mode 100644 index 000000000..c615e6e5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_041_to_048.html new file mode 100644 index 000000000..4770b09b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_049_to_056.html new file mode 100644 index 000000000..64dadb258 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__struct__struct_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html new file mode 100644 index 000000000..42fa605da --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html new file mode 100644 index 000000000..3ea2497cb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html new file mode 100644 index 000000000..90db6a600 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html new file mode 100644 index 000000000..114249043 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html new file mode 100644 index 000000000..fa7888aa3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html new file mode 100644 index 000000000..124d3d379 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html new file mode 100644 index 000000000..6199ccfdc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html new file mode 100644 index 000000000..4af2f37be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html new file mode 100644 index 000000000..dbeb61c06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html new file mode 100644 index 000000000..98883b6fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html new file mode 100644 index 000000000..cfcd025f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html new file mode 100644 index 000000000..b0416a1f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html new file mode 100644 index 000000000..45c6908b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html new file mode 100644 index 000000000..d5c21a390 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html new file mode 100644 index 000000000..4177cf301 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__tan__tan_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__tan__tan_001_to_006.html new file mode 100644 index 000000000..6842952ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__tan__tan_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec3__vec3_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec3__vec3_001_to_008.html new file mode 100644 index 000000000..81488170d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec3__vec3_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_001_to_008.html new file mode 100644 index 000000000..65fde815e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_009_to_016.html new file mode 100644 index 000000000..696e32c03 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_017_to_018.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_017_to_018.html new file mode 100644 index 000000000..aebbe7287 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__ogles__GL__vec__vec_017_to_018.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__get-active-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__get-active-test.html new file mode 100644 index 000000000..8f0094230 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__get-active-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-long-names-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-long-names-test.html new file mode 100644 index 000000000..139bddc34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-long-names-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-test.html new file mode 100644 index 000000000..6e4c1c5e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-bind-attrib-location-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-attribute.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-attribute.html new file mode 100644 index 000000000..a84be1916 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-attribute.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-uniform.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-uniform.html new file mode 100644 index 000000000..853dfcaa6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-get-active-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-getshadersource.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-getshadersource.html new file mode 100644 index 000000000..13b384163 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-getshadersource.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-shader-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-shader-test.html new file mode 100644 index 000000000..0e9c9de60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__gl-shader-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__invalid-UTF-16.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__invalid-UTF-16.html new file mode 100644 index 000000000..f6a80f8c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__invalid-UTF-16.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-infolog.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-infolog.html new file mode 100644 index 000000000..176d1a379 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-infolog.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-test.html new file mode 100644 index 000000000..5bea0747c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__program-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html new file mode 100644 index 000000000..0eda5997c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-pack-alignment.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-pack-alignment.html new file mode 100644 index 000000000..380f1d478 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-pack-alignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-test.html new file mode 100644 index 000000000..f3202f20c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__reading__read-pixels-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__feedback-loop.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__feedback-loop.html new file mode 100644 index 000000000..cd6900b46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__feedback-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__framebuffer-state-restoration.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__framebuffer-state-restoration.html new file mode 100644 index 000000000..12bc3a286 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__framebuffer-state-restoration.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__renderbuffer-initialization.html new file mode 100644 index 000000000..60e068a45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__renderbuffers__renderbuffer-initialization.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__culling.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__culling.html new file mode 100644 index 000000000..143ade576 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__culling.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__default-texture-draw-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__default-texture-draw-bug.html new file mode 100644 index 000000000..0fc8c2cc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__default-texture-draw-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-arrays-out-of-bounds.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-arrays-out-of-bounds.html new file mode 100644 index 000000000..321cb768b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-arrays-out-of-bounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-elements-out-of-bounds.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-elements-out-of-bounds.html new file mode 100644 index 000000000..361f81939 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-elements-out-of-bounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-with-changing-start-vertex-bug.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-with-changing-start-vertex-bug.html new file mode 100644 index 000000000..4822e01e9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__draw-with-changing-start-vertex-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-switch.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-switch.html new file mode 100644 index 000000000..cb36665b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-switch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-texture-switch.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-texture-switch.html new file mode 100644 index 000000000..d286ab483 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__framebuffer-texture-switch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-clear.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-clear.html new file mode 100644 index 000000000..9fdf198ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-clear.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawarrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawarrays.html new file mode 100644 index 000000000..a96d36da6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawarrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawelements.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawelements.html new file mode 100644 index 000000000..606656831 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-drawelements.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-canvas-dimensions.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-canvas-dimensions.html new file mode 100644 index 000000000..332e11be6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-canvas-dimensions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-fbo-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-fbo-test.html new file mode 100644 index 000000000..df14682c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-fbo-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-test.html new file mode 100644 index 000000000..363655a6a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-scissor-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-viewport-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-viewport-test.html new file mode 100644 index 000000000..2ff8fb9bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__gl-viewport-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__line-loop-tri-fan.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__line-loop-tri-fan.html new file mode 100644 index 000000000..c8bd6f11d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__line-loop-tri-fan.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__many-draw-calls.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__many-draw-calls.html new file mode 100644 index 000000000..684abd43d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__many-draw-calls.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__more-than-65536-indices.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__more-than-65536-indices.html new file mode 100644 index 000000000..406dc7d49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__more-than-65536-indices.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__multisample-corruption.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__multisample-corruption.html new file mode 100644 index 000000000..1a2b26c91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__multisample-corruption.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__negative-one-index.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__negative-one-index.html new file mode 100644 index 000000000..d1311b2c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__negative-one-index.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__out-of-bounds-index-buffers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__out-of-bounds-index-buffers.html new file mode 100644 index 000000000..9df405d82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__out-of-bounds-index-buffers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-no-attributes.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-no-attributes.html new file mode 100644 index 000000000..5288b8c7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-no-attributes.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-size.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-size.html new file mode 100644 index 000000000..bdd43b2c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-specific-shader-variables.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-specific-shader-variables.html new file mode 100644 index 000000000..ba3354790 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-specific-shader-variables.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html new file mode 100644 index 000000000..c5b90dc04 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__polygon-offset.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__polygon-offset.html new file mode 100644 index 000000000..f21798479 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__polygon-offset.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__simple.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__simple.html new file mode 100644 index 000000000..b058499d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__simple.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__triangle.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__triangle.html new file mode 100644 index 000000000..478f0a20f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__rendering__triangle.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-enable-enum-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-enable-enum-test.html new file mode 100644 index 000000000..36db4bb82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-enable-enum-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-get-calls.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-get-calls.html new file mode 100644 index 000000000..0a67f104b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-get-calls.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-geterror.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-geterror.html new file mode 100644 index 000000000..56fcf26f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-geterror.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-initial-state.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-initial-state.html new file mode 100644 index 000000000..681a7fabc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__gl-initial-state.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__state-uneffected-after-compositing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__state-uneffected-after-compositing.html new file mode 100644 index 000000000..75c0c10bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__state__state-uneffected-after-compositing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..7b70b2cfd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..0d7c4ba9b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..34a0f5b97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..b6c82e2e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..a2b08deb5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..0dd7626c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..fbcb7c3fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..1ce50eade --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..8ed7879a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..bce998e99 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..914d81c23 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..a641f4ffb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..0a7996e1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..64f188299 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..2f7404f41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..e0b2cb972 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..cdac00347 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..ddfd9b25b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..6001b3e88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..df1e7f71d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-2d-formats.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-2d-formats.html new file mode 100644 index 000000000..bdf902860 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-2d-formats.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html new file mode 100644 index 000000000..58ebcc958 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html new file mode 100644 index 000000000..f76a34850 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__cube-incomplete-fbo.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__cube-incomplete-fbo.html new file mode 100644 index 000000000..3d3ef87d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__cube-incomplete-fbo.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__default-texture.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__default-texture.html new file mode 100644 index 000000000..4b33a8a06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__default-texture.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-pixelstorei.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-pixelstorei.html new file mode 100644 index 000000000..1d8d9f3d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-pixelstorei.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-teximage.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-teximage.html new file mode 100644 index 000000000..9fee64081 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__gl-teximage.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__mipmap-fbo.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__mipmap-fbo.html new file mode 100644 index 000000000..f33ea5a08 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__mipmap-fbo.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__origin-clean-conformance.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__origin-clean-conformance.html new file mode 100644 index 000000000..62575898a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__origin-clean-conformance.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html new file mode 100644 index 000000000..a53fb58a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html new file mode 100644 index 000000000..a2976e2da --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-canvas-corruption.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-canvas-corruption.html new file mode 100644 index 000000000..ab1cbaa4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-canvas-corruption.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-webgl.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-webgl.html new file mode 100644 index 000000000..81e27d7c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-webgl.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html new file mode 100644 index 000000000..76211a546 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-invalid-data.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-invalid-data.html new file mode 100644 index 000000000..a7f4f668f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-image-with-invalid-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d-bad-args.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d-bad-args.html new file mode 100644 index 000000000..66950b2df --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d-bad-args.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d.html new file mode 100644 index 000000000..a35c3c00c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__tex-sub-image-2d.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texparameter-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texparameter-test.html new file mode 100644 index 000000000..efce96e42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texparameter-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind-2.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind-2.html new file mode 100644 index 000000000..17da3e6ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind.html new file mode 100644 index 000000000..5d9aa5ed1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-active-bind.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-attachment-formats.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-attachment-formats.html new file mode 100644 index 000000000..9d5e4a6ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-attachment-formats.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-clear.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-clear.html new file mode 100644 index 000000000..4bd545f39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-clear.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-complete.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-complete.html new file mode 100644 index 000000000..a6def8c45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-complete.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-copying-feedback-loops.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-copying-feedback-loops.html new file mode 100644 index 000000000..70bf92cf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-copying-feedback-loops.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-cube-as-fbo-attachment.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-cube-as-fbo-attachment.html new file mode 100644 index 000000000..398a54406 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-cube-as-fbo-attachment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-draw-with-2d-and-cube.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-draw-with-2d-and-cube.html new file mode 100644 index 000000000..a35654ef9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-draw-with-2d-and-cube.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-hd-dpi.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-hd-dpi.html new file mode 100644 index 000000000..246cb2791 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-hd-dpi.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-mips.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-mips.html new file mode 100644 index 000000000..912f32adb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-mips.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-cube-maps.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-cube-maps.html new file mode 100644 index 000000000..8b4e7bd2e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-cube-maps.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-limit.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-limit.html new file mode 100644 index 000000000..4503e7c23 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size-limit.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size.html new file mode 100644 index 000000000..e8a394e4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-sub-image-cube-maps.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-sub-image-cube-maps.html new file mode 100644 index 000000000..630012683 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-sub-image-cube-maps.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-transparent-pixels-initialized.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-transparent-pixels-initialized.html new file mode 100644 index 000000000..84017062e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-transparent-pixels-initialized.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-cube-maps.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-cube-maps.html new file mode 100644 index 000000000..5c784a9fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-cube-maps.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-size.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-size.html new file mode 100644 index 000000000..22723d99c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__misc__texture-upload-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..48045a9f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..dd9c5b2ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..0cc05e325 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..82b809b3e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..69eaffca2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..fc7638ad8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..c6dc45985 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..9a9821d82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..1eefbe8b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..380252f3c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..742bad519 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..53474bf7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..edbe68ee4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..757c011de --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..c4784f2f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-crash.html new file mode 100644 index 000000000..591c92fd0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-view-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-view-crash.html new file mode 100644 index 000000000..395640a2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-buffer-view-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-large-array-tests.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-large-array-tests.html new file mode 100644 index 000000000..fc8bcefa3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-large-array-tests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-unit-tests.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-unit-tests.html new file mode 100644 index 000000000..21c043175 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__array-unit-tests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-crash.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-crash.html new file mode 100644 index 000000000..a27fcc8c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-test.html new file mode 100644 index 000000000..c9f135286 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__data-view-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__typed-arrays-in-workers.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__typed-arrays-in-workers.html new file mode 100644 index 000000000..2680a873d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__typedarrays__typed-arrays-in-workers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-arrays.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-arrays.html new file mode 100644 index 000000000..427733848 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-bool.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-bool.html new file mode 100644 index 000000000..88c7eb709 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniform-bool.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniformmatrix4fv.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniformmatrix4fv.html new file mode 100644 index 000000000..e3bc474bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-uniformmatrix4fv.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-unknown-uniform.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-unknown-uniform.html new file mode 100644 index 000000000..741899bb2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__gl-unknown-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__null-uniform-location.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__null-uniform-location.html new file mode 100644 index 000000000..b48f12b78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__null-uniform-location.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__out-of-bounds-uniform-array-access.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__out-of-bounds-uniform-array-access.html new file mode 100644 index 000000000..adda209f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__out-of-bounds-uniform-array-access.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-default-values.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-default-values.html new file mode 100644 index 000000000..c695081ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-default-values.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-location.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-location.html new file mode 100644 index 000000000..52f78224d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-location.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-samplers-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-samplers-test.html new file mode 100644 index 000000000..394cc7d80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-samplers-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-values-per-program.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-values-per-program.html new file mode 100644 index 000000000..7b9e48b21 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__uniforms__uniform-values-per-program.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-aliasing.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-aliasing.html new file mode 100644 index 000000000..22faa9149 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-aliasing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-matrix.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-matrix.html new file mode 100644 index 000000000..672b06c8c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-matrix.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-repeated.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-repeated.html new file mode 100644 index 000000000..e93e2386c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-bindAttribLocation-repeated.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-disabled-vertex-attrib.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-disabled-vertex-attrib.html new file mode 100644 index 000000000..8eebcdfbc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-disabled-vertex-attrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-enable-vertex-attrib.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-enable-vertex-attrib.html new file mode 100644 index 000000000..51c7b3460 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-enable-vertex-attrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-matrix-attributes.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-matrix-attributes.html new file mode 100644 index 000000000..84d1685a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-matrix-attributes.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-render.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-render.html new file mode 100644 index 000000000..5fcdb16d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-render.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-zero-issues.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-zero-issues.html new file mode 100644 index 000000000..c6d69ea6f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib-zero-issues.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib.html new file mode 100644 index 000000000..d8d7e5435 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertex-attrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer-offsets.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer-offsets.html new file mode 100644 index 000000000..fccf3e1f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer-offsets.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer.html b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer.html new file mode 100644 index 000000000..2ed139be1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__attribs__gl-vertexattribpointer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-bind-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-bind-test.html new file mode 100644 index 000000000..6999cacf7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-bind-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-and-buffer-sub-data.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-and-buffer-sub-data.html new file mode 100644 index 000000000..afa1eea68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-and-buffer-sub-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-array-buffer-delete.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-array-buffer-delete.html new file mode 100644 index 000000000..2924cb7d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-data-array-buffer-delete.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-uninitialized.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-uninitialized.html new file mode 100644 index 000000000..497ac74fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__buffer-uninitialized.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__element-array-buffer-delete-recreate.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__element-array-buffer-delete-recreate.html new file mode 100644 index 000000000..d46004230 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__element-array-buffer-delete-recreate.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-copies-indices.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-copies-indices.html new file mode 100644 index 000000000..c6dccd405 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-copies-indices.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-crash-with-buffer-sub-data.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-crash-with-buffer-sub-data.html new file mode 100644 index 000000000..99b218f10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-crash-with-buffer-sub-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-large-buffer.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-large-buffer.html new file mode 100644 index 000000000..bf120120f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-large-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-verifies-too-many-indices.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-verifies-too-many-indices.html new file mode 100644 index 000000000..fbeb24b58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-verifies-too-many-indices.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-with-resized-buffer.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-with-resized-buffer.html new file mode 100644 index 000000000..a2d2aeaa4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation-with-resized-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation.html b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation.html new file mode 100644 index 000000000..c0ef1ef80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__buffers__index-validation.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-offscreen-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-offscreen-test.html new file mode 100644 index 000000000..f05ad62f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-offscreen-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-preserve-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-preserve-test.html new file mode 100644 index 000000000..cd412d2ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__buffer-preserve-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-test.html new file mode 100644 index 000000000..d3db773db --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-zero-size.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-zero-size.html new file mode 100644 index 000000000..aa0d78a39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__canvas-zero-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html new file mode 100644 index 000000000..2417c8aca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-webgl-to-canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-webgl-to-canvas-test.html new file mode 100644 index 000000000..6f7929efe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__draw-webgl-to-canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-hd-dpi-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-hd-dpi-test.html new file mode 100644 index 000000000..2bb6de666 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-hd-dpi-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-static-canvas-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-static-canvas-test.html new file mode 100644 index 000000000..eb00bb61d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-static-canvas-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-test.html new file mode 100644 index 000000000..d7c6498e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__drawingbuffer-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html new file mode 100644 index 000000000..050523b89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html new file mode 100644 index 000000000..7a4298d35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__rapid-resizing.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__rapid-resizing.html new file mode 100644 index 000000000..18909c765 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__rapid-resizing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__texture-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__texture-bindings-unaffected-on-resize.html new file mode 100644 index 000000000..dff6d7afc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__texture-bindings-unaffected-on-resize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__to-data-url-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__to-data-url-test.html new file mode 100644 index 000000000..0809e82e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__to-data-url-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__viewport-unchanged-upon-resize.html b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__viewport-unchanged-upon-resize.html new file mode 100644 index 000000000..f83b9261c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__canvas__viewport-unchanged-upon-resize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__constants-and-properties.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__constants-and-properties.html new file mode 100644 index 000000000..f603dffc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__constants-and-properties.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html new file mode 100644 index 000000000..f31c4b096 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attributes-alpha-depth-stencil-antialias.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attributes-alpha-depth-stencil-antialias.html new file mode 100644 index 000000000..30eb1c750 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attributes-alpha-depth-stencil-antialias.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation-and-destruction.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation-and-destruction.html new file mode 100644 index 000000000..d8b69fa19 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation-and-destruction.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation.html new file mode 100644 index 000000000..d6785a5e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-creation.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-eviction-with-garbage-collection.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-eviction-with-garbage-collection.html new file mode 100644 index 000000000..97c3ad5d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-eviction-with-garbage-collection.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-hidden-alpha.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-hidden-alpha.html new file mode 100644 index 000000000..b360e4326 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-hidden-alpha.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost-restored.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost-restored.html new file mode 100644 index 000000000..0f5ae851e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost-restored.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost.html new file mode 100644 index 000000000..aeb1e3c29 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-lost.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-no-alpha-fbo-with-alpha.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-no-alpha-fbo-with-alpha.html new file mode 100644 index 000000000..323912a20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-no-alpha-fbo-with-alpha.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-upon-reload.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-upon-reload.html new file mode 100644 index 000000000..c4129995f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-upon-reload.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-with-workers.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-with-workers.html new file mode 100644 index 000000000..a1c823d13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-release-with-workers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-size-change.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-size-change.html new file mode 100644 index 000000000..4d22b66c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-size-change.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-type-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-type-test.html new file mode 100644 index 000000000..b4c27e5ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__context-type-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__incorrect-context-object-behaviour.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__incorrect-context-object-behaviour.html new file mode 100644 index 000000000..e380347d8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__incorrect-context-object-behaviour.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__methods.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__methods.html new file mode 100644 index 000000000..fb6229d96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__methods.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__premultiplyalpha-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__premultiplyalpha-test.html new file mode 100644 index 000000000..8bc76ae76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__premultiplyalpha-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__resource-sharing-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__resource-sharing-test.html new file mode 100644 index 000000000..3ff49db1e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__resource-sharing-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__context__user-defined-properties-on-context.html b/dom/canvas/test/webgl-conf/generated/test_conformance__context__user-defined-properties-on-context.html new file mode 100644 index 000000000..fa4d9d57d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__context__user-defined-properties-on-context.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays-out-of-bounds.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays-out-of-bounds.html new file mode 100644 index 000000000..261dbd062 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays-out-of-bounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays.html new file mode 100644 index 000000000..9d60f91e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__angle-instanced-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-blend-minmax.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-blend-minmax.html new file mode 100644 index 000000000..657011b52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-blend-minmax.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-disjoint-timer-query.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-disjoint-timer-query.html new file mode 100644 index 000000000..d8b360841 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-disjoint-timer-query.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-frag-depth.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-frag-depth.html new file mode 100644 index 000000000..ac4fc1b6a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-frag-depth.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-sRGB.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-sRGB.html new file mode 100644 index 000000000..284c333bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-sRGB.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-shader-texture-lod.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-shader-texture-lod.html new file mode 100644 index 000000000..2eb957ec3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-shader-texture-lod.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-texture-filter-anisotropic.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-texture-filter-anisotropic.html new file mode 100644 index 000000000..ce4d12fd7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-texture-filter-anisotropic.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__get-extension.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__get-extension.html new file mode 100644 index 000000000..3352b84d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__get-extension.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-element-index-uint.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-element-index-uint.html new file mode 100644 index 000000000..929b3ccab --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-element-index-uint.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-standard-derivatives.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-standard-derivatives.html new file mode 100644 index 000000000..a31ee7635 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-standard-derivatives.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-linear.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-linear.html new file mode 100644 index 000000000..66a48100b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-linear.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-canvas.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-canvas.html new file mode 100644 index 000000000..da5d212a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-canvas.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image-data.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image-data.html new file mode 100644 index 000000000..8b4497aa6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image.html new file mode 100644 index 000000000..b4f180767 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-image.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-video.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-video.html new file mode 100644 index 000000000..4468530e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float-with-video.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float.html new file mode 100644 index 000000000..291ee9c55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-linear.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-linear.html new file mode 100644 index 000000000..ae07ff0d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-linear.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-canvas.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-canvas.html new file mode 100644 index 000000000..b0ad151bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-canvas.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image-data.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image-data.html new file mode 100644 index 000000000..2c23f4c5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image.html new file mode 100644 index 000000000..5a945d104 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-image.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-video.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-video.html new file mode 100644 index 000000000..a232ab9b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float-with-video.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float.html new file mode 100644 index 000000000..a260fc1b3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-half-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object-bufferData.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object-bufferData.html new file mode 100644 index 000000000..907e5d459 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object-bufferData.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object.html new file mode 100644 index 000000000..1bfc7071e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-atc.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-atc.html new file mode 100644 index 000000000..48e535be9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-atc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-etc.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-etc.html new file mode 100644 index 000000000..cda91b3d2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-etc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-pvrtc.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-pvrtc.html new file mode 100644 index 000000000..073ed3871 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-pvrtc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html new file mode 100644 index 000000000..684f8e5f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc-srgb.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc.html new file mode 100644 index 000000000..080ae201b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-s3tc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-size-limit.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-size-limit.html new file mode 100644 index 000000000..0f46c5dcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-compressed-texture-size-limit.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-renderer-info.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-renderer-info.html new file mode 100644 index 000000000..973ed5619 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-renderer-info.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-shaders.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-shaders.html new file mode 100644 index 000000000..d2433383d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-debug-shaders.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-depth-texture.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-depth-texture.html new file mode 100644 index 000000000..c1195ef3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-depth-texture.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-framebuffer-unsupported.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-framebuffer-unsupported.html new file mode 100644 index 000000000..8bf076410 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-framebuffer-unsupported.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-max-draw-buffers.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-max-draw-buffers.html new file mode 100644 index 000000000..ee8fe17f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers-max-draw-buffers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers.html new file mode 100644 index 000000000..09d279149 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-draw-buffers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-shared-resources.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-shared-resources.html new file mode 100644 index 000000000..4344c0340 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-shared-resources.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-ambiguous-function-call.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-ambiguous-function-call.html new file mode 100644 index 000000000..d7b49f38c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-ambiguous-function-call.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-constructor-invalid-parameters.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-constructor-invalid-parameters.html new file mode 100644 index 000000000..1c499caea --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-constructor-invalid-parameters.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-d3d11-compiler-error.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-d3d11-compiler-error.html new file mode 100644 index 000000000..6e0f977fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-d3d11-compiler-error.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-dx-variable-bug.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-dx-variable-bug.html new file mode 100644 index 000000000..8d978580e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__angle-dx-variable-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__array-of-struct-with-int-first-position.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__array-of-struct-with-int-first-position.html new file mode 100644 index 000000000..12943f70d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__array-of-struct-with-int-first-position.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__bool-type-cast-bug-int-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__bool-type-cast-bug-int-float.html new file mode 100644 index 000000000..1216dd16b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__bool-type-cast-bug-int-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compare-loop-index-to-uniform.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compare-loop-index-to-uniform.html new file mode 100644 index 000000000..0ba486f61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compare-loop-index-to-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__complex-glsl-does-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__complex-glsl-does-not-crash.html new file mode 100644 index 000000000..4f94e04d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__complex-glsl-does-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compound-assignment-type-combination.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compound-assignment-type-combination.html new file mode 100644 index 000000000..5f8130744 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__compound-assignment-type-combination.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-in-loop.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-in-loop.html new file mode 100644 index 000000000..05b2c706b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-in-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-optimization.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-optimization.html new file mode 100644 index 000000000..c6d20fbcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__conditional-discard-optimization.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__constant-precision-qualifier.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__constant-precision-qualifier.html new file mode 100644 index 000000000..7589bfbef --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__constant-precision-qualifier.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__essl3-shaders-with-webgl1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__essl3-shaders-with-webgl1.html new file mode 100644 index 000000000..1d614f569 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__essl3-shaders-with-webgl1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html new file mode 100644 index 000000000..a42c8d854 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floored-division-accuracy.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floored-division-accuracy.html new file mode 100644 index 000000000..effab16d5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__floored-division-accuracy.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__fragcoord-linking-bug.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__fragcoord-linking-bug.html new file mode 100644 index 000000000..95168eb5a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__fragcoord-linking-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html new file mode 100644 index 000000000..366d7ff96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html new file mode 100644 index 000000000..8a0f8e957 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__global-invariant-does-not-leak-across-shaders.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html new file mode 100644 index 000000000..30cb896dc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__invariant-does-not-leak-across-shaders.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__logic-inside-block-without-braces.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__logic-inside-block-without-braces.html new file mode 100644 index 000000000..39200dfc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__logic-inside-block-without-braces.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__long-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__long-expressions-should-not-crash.html new file mode 100644 index 000000000..72decedf8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__long-expressions-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__loop-if-loop-gradient.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__loop-if-loop-gradient.html new file mode 100644 index 000000000..a37c9df87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__loop-if-loop-gradient.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__modulo-arithmetic-accuracy.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__modulo-arithmetic-accuracy.html new file mode 100644 index 000000000..dfbe4c85a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__modulo-arithmetic-accuracy.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__multiplication-assignment.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__multiplication-assignment.html new file mode 100644 index 000000000..da4ad29a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__multiplication-assignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-functions-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-functions-should-not-crash.html new file mode 100644 index 000000000..735e2dfc9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-functions-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-loops-with-break-and-continue.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-loops-with-break-and-continue.html new file mode 100644 index 000000000..5f405d648 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-loops-with-break-and-continue.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-sequence-operator.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-sequence-operator.html new file mode 100644 index 000000000..2ba8dcb47 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__nested-sequence-operator.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html new file mode 100644 index 000000000..45888f126 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html new file mode 100644 index 000000000..da1646f1b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__pow-with-constant-exponent-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-crash.html new file mode 100644 index 000000000..a066c4bf8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html new file mode 100644 index 000000000..3283e09a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__qualcomm-loop-with-continue-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-array-using-loop-index.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-array-using-loop-index.html new file mode 100644 index 000000000..1be512629 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-array-using-loop-index.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-struct-function-arg.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-struct-function-arg.html new file mode 100644 index 000000000..75a03cd7f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sampler-struct-function-arg.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sequence-operator-evaluation-order.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sequence-operator-evaluation-order.html new file mode 100644 index 000000000..8de50c5fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sequence-operator-evaluation-order.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html new file mode 100644 index 000000000..e9284ba4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__sketchfab-lighting-shader-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__struct-constructor-highp-bug.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__struct-constructor-highp-bug.html new file mode 100644 index 000000000..3aaa44283 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__struct-constructor-highp-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__temp-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__temp-expressions-should-not-crash.html new file mode 100644 index 000000000..43de19a72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__temp-expressions-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__undefined-index-should-not-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__undefined-index-should-not-crash.html new file mode 100644 index 000000000..15867d191 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__undefined-index-should-not-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__uniforms-should-not-lose-values.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__uniforms-should-not-lose-values.html new file mode 100644 index 000000000..4390e32a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__bugs__uniforms-should-not-lose-values.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec2.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec2.html new file mode 100644 index 000000000..1f08fd4fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec3.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec3.html new file mode 100644 index 000000000..e729f89f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec4.html new file mode 100644 index 000000000..f52926f7e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-bvec4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec2.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec2.html new file mode 100644 index 000000000..4751e019d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec3.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec3.html new file mode 100644 index 000000000..cd1076173 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec4.html new file mode 100644 index 000000000..55eba7344 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-ivec4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat2.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat2.html new file mode 100644 index 000000000..ed92f9538 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat3.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat3.html new file mode 100644 index 000000000..94ea44c0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat4.html new file mode 100644 index 000000000..5a008cd69 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-mat4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html new file mode 100644 index 000000000..acfb6cb3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-index.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-index.html new file mode 100644 index 000000000..deaf09943 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-index.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec2.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec2.html new file mode 100644 index 000000000..4748b3469 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec3.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec3.html new file mode 100644 index 000000000..5576e9958 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec4.html new file mode 100644 index 000000000..9b97de6a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__constructors__glsl-construct-vec4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-abs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-abs.html new file mode 100644 index 000000000..1e090f9be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-abs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-acos.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-acos.html new file mode 100644 index 000000000..cb6523e97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-acos.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-asin.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-asin.html new file mode 100644 index 000000000..89d48965c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-asin.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan-xy.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan-xy.html new file mode 100644 index 000000000..083fd7e3b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan-xy.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan.html new file mode 100644 index 000000000..65b36f5b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-atan.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-ceil.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-ceil.html new file mode 100644 index 000000000..5eccd8be6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-ceil.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-float.html new file mode 100644 index 000000000..57f7cf720 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-gentype.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-gentype.html new file mode 100644 index 000000000..eca71c919 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-clamp-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cos.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cos.html new file mode 100644 index 000000000..5e99d52c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cos.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cross.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cross.html new file mode 100644 index 000000000..a0d61fbda --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-cross.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-distance.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-distance.html new file mode 100644 index 000000000..eb5948329 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-distance.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-dot.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-dot.html new file mode 100644 index 000000000..0b194e60b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-dot.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-faceforward.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-faceforward.html new file mode 100644 index 000000000..ba03abd87 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-faceforward.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-floor.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-floor.html new file mode 100644 index 000000000..47dee7b99 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-floor.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-fract.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-fract.html new file mode 100644 index 000000000..3129ca58f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-fract.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-length.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-length.html new file mode 100644 index 000000000..a38e84159 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-length.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-float.html new file mode 100644 index 000000000..9cec6186c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-gentype.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-gentype.html new file mode 100644 index 000000000..6229f1c01 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-max-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-float.html new file mode 100644 index 000000000..c68850ac7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-gentype.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-gentype.html new file mode 100644 index 000000000..a81eb63c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-min-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-float.html new file mode 100644 index 000000000..3fba43260 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-gentype.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-gentype.html new file mode 100644 index 000000000..9f92ea3c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mix-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-float.html new file mode 100644 index 000000000..21e87455f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-gentype.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-gentype.html new file mode 100644 index 000000000..9f5d03a75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-mod-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-normalize.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-normalize.html new file mode 100644 index 000000000..eb4a0c78d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-normalize.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-reflect.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-reflect.html new file mode 100644 index 000000000..83a598f74 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-reflect.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sign.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sign.html new file mode 100644 index 000000000..75ead8e48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sign.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sin.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sin.html new file mode 100644 index 000000000..860c59d81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-sin.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-float.html new file mode 100644 index 000000000..c40411dc1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-gentype.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-gentype.html new file mode 100644 index 000000000..37ea6e0ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-smoothstep-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-float.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-float.html new file mode 100644 index 000000000..c9af1f113 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-float.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-gentype.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-gentype.html new file mode 100644 index 000000000..bb9f8d8e7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function-step-gentype.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function.html new file mode 100644 index 000000000..565ea0b2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__functions__glsl-function.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_float.vert.html new file mode 100644 index 000000000..4086512b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat2.vert.html new file mode 100644 index 000000000..64356fa4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat3.vert.html new file mode 100644 index 000000000..2d317e40d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat4.vert.html new file mode 100644 index 000000000..d2453f5bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec2.vert.html new file mode 100644 index 000000000..32ab2b9ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec3.vert.html new file mode 100644 index 000000000..24d01cb39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec4.vert.html new file mode 100644 index 000000000..2f323bd71 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec2_vec2.vert.html new file mode 100644 index 000000000..80baeca49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec3_vec3.vert.html new file mode 100644 index 000000000..ad4d91663 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec4_vec4.vert.html new file mode 100644 index 000000000..a52ae5100 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__add_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_int_to_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_int_to_float.vert.html new file mode 100644 index 000000000..e14d06a16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_int_to_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html new file mode 100644 index 000000000..e5b3006ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec2_to_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html new file mode 100644 index 000000000..874884fa9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec3_to_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html new file mode 100644 index 000000000..d38d42c4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__assign_ivec4_to_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__construct_struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__construct_struct.vert.html new file mode 100644 index 000000000..fda782d52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__construct_struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_float.vert.html new file mode 100644 index 000000000..b9d0beec2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat2.vert.html new file mode 100644 index 000000000..6429ef1b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat3.vert.html new file mode 100644 index 000000000..d26e0baae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat4.vert.html new file mode 100644 index 000000000..60e0ea463 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec2.vert.html new file mode 100644 index 000000000..4150ca57b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec3.vert.html new file mode 100644 index 000000000..5b405df9b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec4.vert.html new file mode 100644 index 000000000..5bad7394f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec2_vec2.vert.html new file mode 100644 index 000000000..ca8e1a966 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec3_vec3.vert.html new file mode 100644 index 000000000..a636fa551 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec4_vec4.vert.html new file mode 100644 index 000000000..bdcd14a82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__divide_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_int_float.vert.html new file mode 100644 index 000000000..a0c914f33 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec2_vec2.vert.html new file mode 100644 index 000000000..2729b3f20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec3_vec3.vert.html new file mode 100644 index 000000000..e66dbd608 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec4_vec4.vert.html new file mode 100644 index 000000000..9791f389a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__equal_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_int_float.vert.html new file mode 100644 index 000000000..b935ad05c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec2_vec2.vert.html new file mode 100644 index 000000000..c2f86e57f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec3_vec3.vert.html new file mode 100644 index 000000000..cb91420c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec4_vec4.vert.html new file mode 100644 index 000000000..3f2bb3801 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__function_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than.vert.html new file mode 100644 index 000000000..14ce644de --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than_equal.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than_equal.vert.html new file mode 100644 index 000000000..61ad0f418 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__greater_than_equal.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than.vert.html new file mode 100644 index 000000000..191f39e37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than_equal.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than_equal.vert.html new file mode 100644 index 000000000..c6af0b74c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__less_than_equal.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_float.vert.html new file mode 100644 index 000000000..dc128b268 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat2.vert.html new file mode 100644 index 000000000..9dc7b4d4a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat3.vert.html new file mode 100644 index 000000000..332a11974 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat4.vert.html new file mode 100644 index 000000000..80f1b04e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec2.vert.html new file mode 100644 index 000000000..5b81f9aa9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec3.vert.html new file mode 100644 index 000000000..4efd200ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec4.vert.html new file mode 100644 index 000000000..78ab46226 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html new file mode 100644 index 000000000..94214f08b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html new file mode 100644 index 000000000..02ee6b434 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html new file mode 100644 index 000000000..97017c072 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__multiply_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_int_float.vert.html new file mode 100644 index 000000000..465767644 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html new file mode 100644 index 000000000..c9ddb1acb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html new file mode 100644 index 000000000..42e132a09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html new file mode 100644 index 000000000..2ea9dd8ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__not_equal_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_float.vert.html new file mode 100644 index 000000000..80ff8e97b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat2.vert.html new file mode 100644 index 000000000..de743e904 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat3.vert.html new file mode 100644 index 000000000..b2fc158e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat4.vert.html new file mode 100644 index 000000000..07ace683b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_mat4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec2.vert.html new file mode 100644 index 000000000..857c13066 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec3.vert.html new file mode 100644 index 000000000..a58d7d555 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec4.vert.html new file mode 100644 index 000000000..1fc56a2fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_int_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html new file mode 100644 index 000000000..5e1431556 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html new file mode 100644 index 000000000..94bc219d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html new file mode 100644 index 000000000..e5e990196 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__subtract_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_int_float.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_int_float.vert.html new file mode 100644 index 000000000..f8735e8f4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_int_float.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html new file mode 100644 index 000000000..c1f1e13c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec2_vec2.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html new file mode 100644 index 000000000..0b7c4d44e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec3_vec3.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html new file mode 100644 index 000000000..d41fc71c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__implicit__ternary_ivec4_vec4.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__float_literal.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__float_literal.vert.html new file mode 100644 index 000000000..dd3d00106 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__float_literal.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__literal_precision.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__literal_precision.html new file mode 100644 index 000000000..91afc2382 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__literal_precision.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__overflow_leak.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__overflow_leak.vert.html new file mode 100644 index 000000000..2d8b5a557 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__literals__overflow_leak.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat3-construction.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat3-construction.html new file mode 100644 index 000000000..38b278e27 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat3-construction.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat4-to-mat3.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat4-to-mat3.html new file mode 100644 index 000000000..7c4076b24 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__glsl-mat4-to-mat3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__matrix-compound-multiply.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__matrix-compound-multiply.html new file mode 100644 index 000000000..b62dd1236 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__matrices__matrix-compound-multiply.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__attrib-location-length-limits.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__attrib-location-length-limits.html new file mode 100644 index 000000000..ff5ed5af0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__attrib-location-length-limits.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__boolean_precision.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__boolean_precision.html new file mode 100644 index 000000000..fe59014df --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__boolean_precision.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__const-variable-initialization.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__const-variable-initialization.html new file mode 100644 index 000000000..483ae1a17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__const-variable-initialization.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__embedded-struct-definitions-forbidden.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__embedded-struct-definitions-forbidden.html new file mode 100644 index 000000000..42f789113 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__embedded-struct-definitions-forbidden.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty-declaration.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty-declaration.html new file mode 100644 index 000000000..9e40964dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty-declaration.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty_main.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty_main.vert.html new file mode 100644 index 000000000..6260a799b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__empty_main.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__expression-list-in-declarator-initializer.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__expression-list-in-declarator-initializer.html new file mode 100644 index 000000000..66a6cc9a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__expression-list-in-declarator-initializer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__gl_position_unset.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__gl_position_unset.vert.html new file mode 100644 index 000000000..3b6cede41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__gl_position_unset.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__global-variable-init.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__global-variable-init.html new file mode 100644 index 000000000..5d95f7dad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__global-variable-init.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-function-nodes.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-function-nodes.html new file mode 100644 index 000000000..3997338fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-function-nodes.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-long-variable-names.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-long-variable-names.html new file mode 100644 index 000000000..911e3ebca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-long-variable-names.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-vertex-branch.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-vertex-branch.html new file mode 100644 index 000000000..1a3277cef --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__glsl-vertex-branch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__large-loop-compile.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__large-loop-compile.html new file mode 100644 index 000000000..ac72cf704 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__large-loop-compile.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii-comments.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii-comments.vert.html new file mode 100644 index 000000000..4a018a03b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii-comments.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii.vert.html new file mode 100644 index 000000000..15367e559 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__non-ascii.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__re-compile-re-link.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__re-compile-re-link.html new file mode 100644 index 000000000..dd6d5781c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__re-compile-re-link.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__sequence-operator-returns-constant.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__sequence-operator-returns-constant.html new file mode 100644 index 000000000..56896accc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__sequence-operator-returns-constant.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-precision-format-obeyed.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-precision-format-obeyed.html new file mode 100644 index 000000000..5247fbeb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-precision-format-obeyed.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-struct-scope.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-struct-scope.html new file mode 100644 index 000000000..fe4b2e636 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-struct-scope.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-uniform-packing-restrictions.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-uniform-packing-restrictions.html new file mode 100644 index 000000000..fb4563f36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-uniform-packing-restrictions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-varying-packing-restrictions.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-varying-packing-restrictions.html new file mode 100644 index 000000000..920f3ace3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-varying-packing-restrictions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-define.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-define.html new file mode 100644 index 000000000..968c8449c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-define.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-identifier.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-identifier.frag.html new file mode 100644 index 000000000..cdae429f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-256-character-identifier.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-define.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-define.html new file mode 100644 index 000000000..b721f2df6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-define.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-identifier.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-identifier.frag.html new file mode 100644 index 000000000..efb79d1d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-257-character-identifier.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html new file mode 100644 index 000000000..e17b06732 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html new file mode 100644 index 000000000..43cdd5ca7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html new file mode 100644 index 000000000..633774647 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-arbitrary-indexing.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html new file mode 100644 index 000000000..dd0f00535 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-containing-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-uniform.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-uniform.html new file mode 100644 index 000000000..f97ce5823 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-array-of-structs-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-array.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-array.vert.html new file mode 100644 index 000000000..9749cd798 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-array.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-struct.vert.html new file mode 100644 index 000000000..7f989683c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-attrib-struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-clipvertex.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-clipvertex.vert.html new file mode 100644 index 000000000..6484bf93a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-clipvertex.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-assignment.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-assignment.html new file mode 100644 index 000000000..19fd24f15 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-assignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-conditional-assignment.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-conditional-assignment.html new file mode 100644 index 000000000..101982f90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-conditional-assignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html new file mode 100644 index 000000000..c893a67be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-comma-separated-variable-declarations.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping-negative.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping-negative.html new file mode 100644 index 000000000..fc67ba85d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping-negative.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping.html new file mode 100644 index 000000000..fb65efcb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-conditional-scoping.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.frag.html new file mode 100644 index 000000000..c01d39cef --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.vert.html new file mode 100644 index 000000000..70ef1144f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-default-precision.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-define-line-continuation.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-define-line-continuation.frag.html new file mode 100644 index 000000000..fc36f094a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-define-line-continuation.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html new file mode 100644 index 000000000..2f18225d9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx-no-ext.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx.frag.html new file mode 100644 index 000000000..1c5ff8082 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-dfdx.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-do-loop.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-do-loop.html new file mode 100644 index 000000000..eaeb0d8f3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-do-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-error-directive.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-error-directive.html new file mode 100644 index 000000000..e33e0ddd2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-error-directive.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html new file mode 100644 index 000000000..45a0cc06d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-explicit-int-cast.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-float-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-float-return-value.frag.html new file mode 100644 index 000000000..eb4ee4de6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-float-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-loop.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-loop.html new file mode 100644 index 000000000..ed1790b34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-scoping.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-scoping.html new file mode 100644 index 000000000..f2f9fd68b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-for-scoping.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-frag-depth.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-frag-depth.frag.html new file mode 100644 index 000000000..ec74ce4f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-frag-depth.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-recursion.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-recursion.frag.html new file mode 100644 index 000000000..a5b9553b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-recursion.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-scoped-struct.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-scoped-struct.html new file mode 100644 index 000000000..35ca0156d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-function-scoped-struct.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-functional-scoping.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-functional-scoping.html new file mode 100644 index 000000000..40dce70ae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-functional-scoping.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glcolor.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glcolor.vert.html new file mode 100644 index 000000000..86eb0bd85 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glcolor.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-1.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-1.frag.html new file mode 100644 index 000000000..a2ea68a72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-1.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-symbol.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-symbol.frag.html new file mode 100644 index 000000000..ca402b9ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-gles-symbol.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html new file mode 100644 index 000000000..b86645c83 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-global-variable-precision-mismatch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html new file mode 100644 index 000000000..792d77625 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-glprojectionmatrix.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-hex-int-constant-macro.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-hex-int-constant-macro.html new file mode 100644 index 000000000..22f2c8ab7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-hex-int-constant-macro.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html new file mode 100644 index 000000000..b15a75d1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-implicit-vec3-to-vec4-cast.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-include.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-include.vert.html new file mode 100644 index 000000000..e95ff7478 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-include.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-int-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-int-return-value.frag.html new file mode 100644 index 000000000..66337cbe2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-int-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-invalid-identifier.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-invalid-identifier.frag.html new file mode 100644 index 000000000..62cac85fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-invalid-identifier.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html new file mode 100644 index 000000000..9c28bc77d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec2-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html new file mode 100644 index 000000000..28513a730 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec3-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html new file mode 100644 index 000000000..b0d051f1d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-ivec4-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-limited-indexing.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-limited-indexing.frag.html new file mode 100644 index 000000000..daa6dbefc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-limited-indexing.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-long-line.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-long-line.html new file mode 100644 index 000000000..25edef1be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-long-line.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-ascii-error.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-ascii-error.frag.html new file mode 100644 index 000000000..2fe77dd48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-ascii-error.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-reserved-words.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-reserved-words.html new file mode 100644 index 000000000..994b6ee2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-non-reserved-words.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-precision.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-precision.frag.html new file mode 100644 index 000000000..ece605131 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-precision.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-preprocessor-whitespace.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-preprocessor-whitespace.html new file mode 100644 index 000000000..e71401344 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-preprocessor-whitespace.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-quoted-error.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-quoted-error.frag.html new file mode 100644 index 000000000..2395271a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-quoted-error.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-reserved-words.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-reserved-words.html new file mode 100644 index 000000000..a2b4dba0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-reserved-words.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-short-circuiting-operators.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-short-circuiting-operators.html new file mode 100644 index 000000000..4a2dcc15a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-short-circuiting-operators.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-similar-uniform-array-names.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-similar-uniform-array-names.html new file mode 100644 index 000000000..b7408fc0c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-similar-uniform-array-names.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-too-many-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-too-many-uniforms.html new file mode 100644 index 000000000..27983560c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-too-many-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-two-initializer-types.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-two-initializer-types.html new file mode 100644 index 000000000..5758cdd6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-two-initializer-types.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html new file mode 100644 index 000000000..790d9a069 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-undefined-preprocessor-symbol.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html new file mode 100644 index 000000000..627d4eed3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-uniform-in-loop-condition.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec2-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec2-return-value.frag.html new file mode 100644 index 000000000..0f83622e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec2-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec3-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec3-return-value.frag.html new file mode 100644 index 000000000..4b8ab7593 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec3-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-return-value.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-return-value.frag.html new file mode 100644 index 000000000..3dbab3944 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-return-value.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html new file mode 100644 index 000000000..820e3d0f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-vec4-vec3-vec4-conditional.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.frag.html new file mode 100644 index 000000000..ac9a8f490 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.vert.html new file mode 100644 index 000000000..3614dfbb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-100.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-120.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-120.vert.html new file mode 100644 index 000000000..b85a28014 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-120.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-130.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-130.vert.html new file mode 100644 index 000000000..35d022738 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-version-130.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-webgl-identifier.vert.html new file mode 100644 index 000000000..63ecfd690 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-webgl-identifier.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-while-loop.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-while-loop.html new file mode 100644 index 000000000..8e7878317 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-with-while-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-without-precision.frag.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-without-precision.frag.html new file mode 100644 index 000000000..02e5ea3c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shader-without-precision.frag.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html new file mode 100644 index 000000000..5d5cac30f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-constant-expression-loop-conditions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-invariance.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-invariance.html new file mode 100644 index 000000000..213b91188 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-invariance.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html new file mode 100644 index 000000000..3f40462e6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-varyings.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-varyings.html new file mode 100644 index 000000000..9645dd336 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-mis-matching-varyings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-missing-varyings.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-missing-varyings.html new file mode 100644 index 000000000..bee9b7fb8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-missing-varyings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-name-conflicts.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-name-conflicts.html new file mode 100644 index 000000000..15118f407 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-name-conflicts.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-uniform-structs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-uniform-structs.html new file mode 100644 index 000000000..1755bb5b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-uniform-structs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-varyings.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-varyings.html new file mode 100644 index 000000000..392a8864b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shaders-with-varyings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shared.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shared.html new file mode 100644 index 000000000..9ba2d28bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__shared.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-assign.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-assign.html new file mode 100644 index 000000000..65a6ce51a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-assign.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-equals.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-equals.html new file mode 100644 index 000000000..3ef036c60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-equals.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-mixed-array-declarators.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-mixed-array-declarators.html new file mode 100644 index 000000000..f1498da7c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-mixed-array-declarators.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-exceeds-maximum.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-exceeds-maximum.html new file mode 100644 index 000000000..47cfa9642 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-exceeds-maximum.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-of-variable-names.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-of-variable-names.html new file mode 100644 index 000000000..49eb69693 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-of-variable-names.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-under-maximum.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-under-maximum.html new file mode 100644 index 000000000..3c51df991 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-nesting-under-maximum.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-specifiers-in-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-specifiers-in-uniforms.html new file mode 100644 index 000000000..2ab839263 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-specifiers-in-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-unary-operators.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-unary-operators.html new file mode 100644 index 000000000..5da6239a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__struct-unary-operators.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operator-on-arrays.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operator-on-arrays.html new file mode 100644 index 000000000..a5d3dd3be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operator-on-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-global-initializers.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-global-initializers.html new file mode 100644 index 000000000..c01660a35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-global-initializers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-initializers.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-initializers.html new file mode 100644 index 000000000..e97e28241 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__ternary-operators-in-initializers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__uniform-location-length-limits.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__uniform-location-length-limits.html new file mode 100644 index 000000000..0ffb8c1df --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__misc__uniform-location-length-limits.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_field.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_field.vert.html new file mode 100644 index 000000000..7f65662b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_field.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_function.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_function.vert.html new file mode 100644 index 000000000..fb7f3c00a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_function.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_struct.vert.html new file mode 100644 index 000000000..e2be8d5f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_variable.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_variable.vert.html new file mode 100644 index 000000000..517ad88d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved___webgl_variable.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_field.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_field.vert.html new file mode 100644 index 000000000..982a9c9a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_field.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_function.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_function.vert.html new file mode 100644 index 000000000..634e51b88 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_function.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_struct.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_struct.vert.html new file mode 100644 index 000000000..502e106ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_struct.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_variable.vert.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_variable.vert.html new file mode 100644 index 000000000..9ceb03025 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__reserved__webgl_variable.vert.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2d-bias.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2d-bias.html new file mode 100644 index 000000000..8ce0a8296 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2d-bias.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dlod.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dlod.html new file mode 100644 index 000000000..882401e72 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dlod.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dproj.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dproj.html new file mode 100644 index 000000000..e6e6c93af --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dproj.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dprojlod.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dprojlod.html new file mode 100644 index 000000000..ee9d93f0e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__samplers__glsl-function-texture2dprojlod.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord-xy-values.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord-xy-values.html new file mode 100644 index 000000000..0512ba850 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord-xy-values.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord.html new file mode 100644 index 000000000..180c84c31 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragcoord.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragdata-and-fragcolor.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragdata-and-fragcolor.html new file mode 100644 index 000000000..80c68445d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-fragdata-and-fragcolor.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-frontfacing.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-frontfacing.html new file mode 100644 index 000000000..39d4c3236 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-frontfacing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-pointcoord.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-pointcoord.html new file mode 100644 index 000000000..3c6931703 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__gl-pointcoord.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__glsl-built-ins.html b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__glsl-built-ins.html new file mode 100644 index 000000000..c37e9a7cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__glsl__variables__glsl-built-ins.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-line-width.html b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-line-width.html new file mode 100644 index 000000000..61f8e72a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-line-width.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-max-texture-dimensions.html b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-max-texture-dimensions.html new file mode 100644 index 000000000..a529dcab1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-max-texture-dimensions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-attribs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-attribs.html new file mode 100644 index 000000000..101cfdb91 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-attribs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-textures.html b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-textures.html new file mode 100644 index 000000000..8ff1eac8e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-textures.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-uniforms.html b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-uniforms.html new file mode 100644 index 000000000..a913d8819 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__limits__gl-min-uniforms.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__bad-arguments-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__bad-arguments-test.html new file mode 100644 index 000000000..9e89c2993 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__bad-arguments-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__boolean-argument-conversion.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__boolean-argument-conversion.html new file mode 100644 index 000000000..28d3da59e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__boolean-argument-conversion.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__delayed-drawing.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__delayed-drawing.html new file mode 100644 index 000000000..920a2f459 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__delayed-drawing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__error-reporting.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__error-reporting.html new file mode 100644 index 000000000..4d54fcf07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__error-reporting.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__expando-loss.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__expando-loss.html new file mode 100644 index 000000000..d67fe63f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__expando-loss.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__functions-returning-strings.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__functions-returning-strings.html new file mode 100644 index 000000000..07e8c553f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__functions-returning-strings.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__instanceof-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__instanceof-test.html new file mode 100644 index 000000000..e32671712 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__instanceof-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__invalid-passed-params.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__invalid-passed-params.html new file mode 100644 index 000000000..f559f9011 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__invalid-passed-params.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__is-object.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__is-object.html new file mode 100644 index 000000000..fb64bef48 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__is-object.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__null-object-behaviour.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__null-object-behaviour.html new file mode 100644 index 000000000..856a26aa1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__null-object-behaviour.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__object-deletion-behaviour.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__object-deletion-behaviour.html new file mode 100644 index 000000000..1852e12e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__object-deletion-behaviour.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__shader-precision-format.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__shader-precision-format.html new file mode 100644 index 000000000..fd8246316 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__shader-precision-format.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__type-conversion-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__type-conversion-test.html new file mode 100644 index 000000000..662c20d1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__type-conversion-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__uninitialized-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__uninitialized-test.html new file mode 100644 index 000000000..82d535e41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__uninitialized-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__misc__webgl-specific.html b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__webgl-specific.html new file mode 100644 index 000000000..87f554293 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__misc__webgl-specific.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__constants.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__constants.html new file mode 100644 index 000000000..b53023ab8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__constants.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__getContext.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__getContext.html new file mode 100644 index 000000000..ebe38ac8f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__getContext.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__methods.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__methods.html new file mode 100644 index 000000000..14ae05e81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__methods.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-A.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-A.html new file mode 100644 index 000000000..5f01c85e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-A.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B1.html new file mode 100644 index 000000000..1d2808ee7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B2.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B2.html new file mode 100644 index 000000000..cd2df15c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B3.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B3.html new file mode 100644 index 000000000..d6e8bf70b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B3.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B4.html new file mode 100644 index 000000000..8573bea76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-B4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-C.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-C.html new file mode 100644 index 000000000..5547c3759 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-C.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-D_G.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-D_G.html new file mode 100644 index 000000000..f053569f9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-D_G.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-G_I.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-G_I.html new file mode 100644 index 000000000..f0a5f5ac7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-G_I.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-L_S.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-L_S.html new file mode 100644 index 000000000..429a92a23 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-L_S.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-S_V.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-S_V.html new file mode 100644 index 000000000..3849a13dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__quickCheckAPI-S_V.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__webGLArrays.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__webGLArrays.html new file mode 100644 index 000000000..a800bd766 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__conformance__webGLArrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBuffer.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBuffer.html new file mode 100644 index 000000000..546012a53 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBuffer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBufferBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBufferBadArgs.html new file mode 100644 index 000000000..0c728dc9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindBufferBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindFramebufferLeaveNonZero.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindFramebufferLeaveNonZero.html new file mode 100644 index 000000000..81e3c49e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bindFramebufferLeaveNonZero.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferData.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferData.html new file mode 100644 index 000000000..a51bf0941 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferData.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferDataBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferDataBadArgs.html new file mode 100644 index 000000000..42b061059 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferDataBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubData.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubData.html new file mode 100644 index 000000000..c76d889d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubData.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubDataBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubDataBadArgs.html new file mode 100644 index 000000000..be19652ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__bufferSubDataBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2D.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2D.html new file mode 100644 index 000000000..d6ddfc208 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2DBadArgs.html new file mode 100644 index 000000000..77cbd79cc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2D.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2D.html new file mode 100644 index 000000000..928b83b89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2DBadArgs.html new file mode 100644 index 000000000..7d5afab46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__copyTexSubImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__deleteBufferBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__deleteBufferBadArgs.html new file mode 100644 index 000000000..a264dcefe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__deleteBufferBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArrays.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArrays.html new file mode 100644 index 000000000..3c8bb5685 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArraysOutOfBounds.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArraysOutOfBounds.html new file mode 100644 index 000000000..d4a603d89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawArraysOutOfBounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElements.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElements.html new file mode 100644 index 000000000..65941b61d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElements.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElementsBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElementsBadArgs.html new file mode 100644 index 000000000..cfd5cc5f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__drawElementsBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTests.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTests.html new file mode 100644 index 000000000..bb9ca0bfa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTestsBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTestsBadArgs.html new file mode 100644 index 000000000..e70c48907 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__isTestsBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixels.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixels.html new file mode 100644 index 000000000..5d23818ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixels.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixelsBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixelsBadArgs.html new file mode 100644 index 000000000..3ba7ce2c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__readPixelsBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2D.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2D.html new file mode 100644 index 000000000..b70efc09d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DBadArgs.html new file mode 100644 index 000000000..d8b4ab47c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTML.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTML.html new file mode 100644 index 000000000..a8d7ba9bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTML.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTMLBadArgs.html new file mode 100644 index 000000000..eef174553 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texImage2DHTMLBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2D.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2D.html new file mode 100644 index 000000000..e53db88ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2D.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DBadArgs.html new file mode 100644 index 000000000..5fead1ecd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTML.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTML.html new file mode 100644 index 000000000..65c3caf10 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTML.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTMLBadArgs.html new file mode 100644 index 000000000..e0f92eef5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__texSubImage2DHTMLBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrix.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrix.html new file mode 100644 index 000000000..5075edc1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrix.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrixBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrixBadArgs.html new file mode 100644 index 000000000..ea302ea80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformMatrixBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformf.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformf.html new file mode 100644 index 000000000..f5b8d0b17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformf.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfArrayLen1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfArrayLen1.html new file mode 100644 index 000000000..c91ad19a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfArrayLen1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfBadArgs.html new file mode 100644 index 000000000..29afd04fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformfBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformi.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformi.html new file mode 100644 index 000000000..7644a49e8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformi.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformiBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformiBadArgs.html new file mode 100644 index 000000000..ab88a5e40 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__uniformiBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttrib.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttrib.html new file mode 100644 index 000000000..8b1860f35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttrib.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribBadArgs.html new file mode 100644 index 000000000..44d5285b2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointer.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointer.html new file mode 100644 index 000000000..974988409 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointer.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointerBadArgs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointerBadArgs.html new file mode 100644 index 000000000..717ceb2fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__functions__vertexAttribPointerBadArgs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__arrayOutOfBounds.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__arrayOutOfBounds.html new file mode 100644 index 000000000..3564e78ef --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__arrayOutOfBounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__uniformOutOfBounds.html b/dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__uniformOutOfBounds.html new file mode 100644 index 000000000..2553658b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__more__glsl__uniformOutOfBounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__abs__abs_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__abs__abs_001_to_006.html new file mode 100644 index 000000000..b08be2b3b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__abs__abs_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__acos__acos_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__acos__acos_001_to_006.html new file mode 100644 index 000000000..bf0689cc3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__acos__acos_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__all__all_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__all__all_001_to_004.html new file mode 100644 index 000000000..c8382587b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__all__all_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__any__any_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__any__any_001_to_004.html new file mode 100644 index 000000000..0f284e422 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__any__any_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__array__array_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__array__array_001_to_006.html new file mode 100644 index 000000000..121fe9727 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__array__array_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__asin__asin_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__asin__asin_001_to_006.html new file mode 100644 index 000000000..f696ef64f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__asin__asin_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_001_to_008.html new file mode 100644 index 000000000..43fd03a13 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_009_to_012.html new file mode 100644 index 000000000..0f552514e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__atan__atan_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_001_to_008.html new file mode 100644 index 000000000..188d25f08 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_009_to_016.html new file mode 100644 index 000000000..6e9c75dc0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biConstants__biConstants_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html new file mode 100644 index 000000000..da32306b1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_001_to_008.html new file mode 100644 index 000000000..623254d5f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_009_to_016.html new file mode 100644 index 000000000..531eea9a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_017_to_024.html new file mode 100644 index 000000000..2c37f2f00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_025_to_032.html new file mode 100644 index 000000000..20e638ecf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_033_to_040.html new file mode 100644 index 000000000..937f3722b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_041_to_048.html new file mode 100644 index 000000000..851d8fe3d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_049_to_056.html new file mode 100644 index 000000000..6f899a174 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_057_to_064.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_057_to_064.html new file mode 100644 index 000000000..dfec51d93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_057_to_064.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_065_to_072.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_065_to_072.html new file mode 100644 index 000000000..b6bfa2d6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_065_to_072.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_073_to_080.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_073_to_080.html new file mode 100644 index 000000000..770b86203 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_073_to_080.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_081_to_088.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_081_to_088.html new file mode 100644 index 000000000..6bbe6b5bb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_081_to_088.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_089_to_096.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_089_to_096.html new file mode 100644 index 000000000..12ef04393 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_089_to_096.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_097_to_104.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_097_to_104.html new file mode 100644 index 000000000..aa0fc344e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_097_to_104.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_105_to_112.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_105_to_112.html new file mode 100644 index 000000000..603e6ef80 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_105_to_112.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_113_to_120.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_113_to_120.html new file mode 100644 index 000000000..a38269739 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_113_to_120.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_121_to_128.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_121_to_128.html new file mode 100644 index 000000000..0df064e3b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_121_to_128.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_129_to_136.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_129_to_136.html new file mode 100644 index 000000000..6dfb3819a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_129_to_136.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_137_to_144.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_137_to_144.html new file mode 100644 index 000000000..f40ebcf28 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_137_to_144.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_145_to_152.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_145_to_152.html new file mode 100644 index 000000000..7de072f41 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_145_to_152.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_153_to_160.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_153_to_160.html new file mode 100644 index 000000000..d842c25b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_153_to_160.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_161_to_168.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_161_to_168.html new file mode 100644 index 000000000..ee1bb12fd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_161_to_168.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_169_to_176.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_169_to_176.html new file mode 100644 index 000000000..62140837c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_169_to_176.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_177_to_178.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_177_to_178.html new file mode 100644 index 000000000..58a53dbae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__build__build_177_to_178.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html new file mode 100644 index 000000000..94b830f37 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__ceil__ceil_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__ceil__ceil_001_to_006.html new file mode 100644 index 000000000..67f38a588 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__ceil__ceil_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__clamp__clamp_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__clamp__clamp_001_to_006.html new file mode 100644 index 000000000..cf2f0881a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__clamp__clamp_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_001_to_008.html new file mode 100644 index 000000000..2955aa974 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_009_to_010.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_009_to_010.html new file mode 100644 index 000000000..60e6f7e4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__control_flow__control_flow_009_to_010.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cos__cos_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cos__cos_001_to_006.html new file mode 100644 index 000000000..b8fd4a85c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cos__cos_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cross__cross_001_to_002.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cross__cross_001_to_002.html new file mode 100644 index 000000000..6bbcd19a3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__cross__cross_001_to_002.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__default__default_001_to_001.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__default__default_001_to_001.html new file mode 100644 index 000000000..231cfcbd3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__default__default_001_to_001.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__degrees__degrees_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__degrees__degrees_001_to_006.html new file mode 100644 index 000000000..51d3b4a82 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__degrees__degrees_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__discard__discard_001_to_002.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__discard__discard_001_to_002.html new file mode 100644 index 000000000..009989450 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__discard__discard_001_to_002.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__distance__distance_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__distance__distance_001_to_006.html new file mode 100644 index 000000000..ce6a8c3c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__distance__distance_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__dot__dot_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__dot__dot_001_to_006.html new file mode 100644 index 000000000..ab0bb867a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__dot__dot_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_001_to_008.html new file mode 100644 index 000000000..faa9858de --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_009_to_012.html new file mode 100644 index 000000000..a515ae488 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__equal__equal_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_001_to_008.html new file mode 100644 index 000000000..bf4b04b17 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_009_to_012.html new file mode 100644 index 000000000..bab48cc39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp2__exp2_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_001_to_008.html new file mode 100644 index 000000000..ebf648f7f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_009_to_012.html new file mode 100644 index 000000000..ea6eed56c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__exp__exp_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__faceforward__faceforward_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__faceforward__faceforward_001_to_006.html new file mode 100644 index 000000000..fc59e6140 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__faceforward__faceforward_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__floor__floor_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__floor__floor_001_to_006.html new file mode 100644 index 000000000..08bc5f66a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__floor__floor_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__fract__fract_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__fract__fract_001_to_006.html new file mode 100644 index 000000000..c9c466b4c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__fract__fract_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_001_to_008.html new file mode 100644 index 000000000..221261fd4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_009_to_016.html new file mode 100644 index 000000000..8b00a8a0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_017_to_024.html new file mode 100644 index 000000000..671b0ddf7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_025_to_032.html new file mode 100644 index 000000000..dd419bac9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_033_to_040.html new file mode 100644 index 000000000..8af941d63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_041_to_048.html new file mode 100644 index 000000000..aa2159431 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_049_to_056.html new file mode 100644 index 000000000..d66e5dfc9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_057_to_064.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_057_to_064.html new file mode 100644 index 000000000..194b383c6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_057_to_064.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_065_to_072.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_065_to_072.html new file mode 100644 index 000000000..bcf06f966 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_065_to_072.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_073_to_080.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_073_to_080.html new file mode 100644 index 000000000..762f18d52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_073_to_080.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_081_to_088.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_081_to_088.html new file mode 100644 index 000000000..0016e725c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_081_to_088.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_089_to_096.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_089_to_096.html new file mode 100644 index 000000000..b059b20f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_089_to_096.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_097_to_104.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_097_to_104.html new file mode 100644 index 000000000..ed3f79a5d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_097_to_104.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_105_to_112.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_105_to_112.html new file mode 100644 index 000000000..f47f414d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_105_to_112.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_113_to_120.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_113_to_120.html new file mode 100644 index 000000000..3db4e4730 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_113_to_120.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_121_to_126.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_121_to_126.html new file mode 100644 index 000000000..939260534 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__functions__functions_121_to_126.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html new file mode 100644 index 000000000..a9192acaa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html new file mode 100644 index 000000000..e92bf65c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__gl_FrontFacing__gl_FrontFacing_001_to_001.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html new file mode 100644 index 000000000..d7f2ff099 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThanEqual__greaterThanEqual_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html new file mode 100644 index 000000000..a648496fc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__greaterThan__greaterThan_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html new file mode 100644 index 000000000..4a1a23ce8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__inversesqrt__inversesqrt_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__length__length_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__length__length_001_to_006.html new file mode 100644 index 000000000..b6ed6ced2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__length__length_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html new file mode 100644 index 000000000..8da0d0088 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThanEqual__lessThanEqual_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThan__lessThan_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThan__lessThan_001_to_008.html new file mode 100644 index 000000000..0b611f938 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__lessThan__lessThan_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_001_to_008.html new file mode 100644 index 000000000..534482859 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_009_to_012.html new file mode 100644 index 000000000..53052b6d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log2__log2_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_001_to_008.html new file mode 100644 index 000000000..f5ae21f9f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_009_to_012.html new file mode 100644 index 000000000..ce4e95ab6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__log__log_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat3__mat3_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat3__mat3_001_to_006.html new file mode 100644 index 000000000..3a5089e09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat3__mat3_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_001_to_008.html new file mode 100644 index 000000000..b7603c118 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_009_to_016.html new file mode 100644 index 000000000..75e19e4ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_017_to_024.html new file mode 100644 index 000000000..1751c1c34 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_025_to_032.html new file mode 100644 index 000000000..a467af228 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_033_to_040.html new file mode 100644 index 000000000..9303225a2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_041_to_046.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_041_to_046.html new file mode 100644 index 000000000..a51307545 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mat__mat_041_to_046.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html new file mode 100644 index 000000000..4312b6be2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__matrixCompMult__matrixCompMult_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__max__max_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__max__max_001_to_006.html new file mode 100644 index 000000000..1bdf2faf2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__max__max_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__min__min_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__min__min_001_to_006.html new file mode 100644 index 000000000..5fb5d211d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__min__min_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mix__mix_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mix__mix_001_to_006.html new file mode 100644 index 000000000..3a7fb7684 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mix__mix_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mod__mod_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mod__mod_001_to_008.html new file mode 100644 index 000000000..3af4a2e97 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__mod__mod_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__normalize__normalize_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__normalize__normalize_001_to_006.html new file mode 100644 index 000000000..bbe7cdbfa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__normalize__normalize_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_001_to_008.html new file mode 100644 index 000000000..2dea69ed8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_009_to_012.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_009_to_012.html new file mode 100644 index 000000000..5dcbdeb75 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__notEqual__notEqual_009_to_012.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__not__not_001_to_004.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__not__not_001_to_004.html new file mode 100644 index 000000000..d9b77a715 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__not__not_001_to_004.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_001_to_008.html new file mode 100644 index 000000000..80f1fb00d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_009_to_016.html new file mode 100644 index 000000000..51958c64c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_017_to_024.html new file mode 100644 index 000000000..87c3826be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_025_to_026.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_025_to_026.html new file mode 100644 index 000000000..81c3a4eb1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__operators__operators_025_to_026.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_001_to_008.html new file mode 100644 index 000000000..8fbd80b9e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_009_to_016.html new file mode 100644 index 000000000..c5a5343f2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_017_to_024.html new file mode 100644 index 000000000..33699d5a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__pow__pow_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__radians__radians_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__radians__radians_001_to_006.html new file mode 100644 index 000000000..2b7afbc36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__radians__radians_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__reflect__reflect_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__reflect__reflect_001_to_006.html new file mode 100644 index 000000000..b069481b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__reflect__reflect_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__refract__refract_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__refract__refract_001_to_006.html new file mode 100644 index 000000000..9c7ece4e0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__refract__refract_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sign__sign_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sign__sign_001_to_006.html new file mode 100644 index 000000000..1317b2769 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sign__sign_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sin__sin_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sin__sin_001_to_006.html new file mode 100644 index 000000000..2b415894e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sin__sin_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html new file mode 100644 index 000000000..19670034c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__smoothstep__smoothstep_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sqrt__sqrt_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sqrt__sqrt_001_to_006.html new file mode 100644 index 000000000..455345809 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__sqrt__sqrt_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__step__step_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__step__step_001_to_006.html new file mode 100644 index 000000000..19cfef910 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__step__step_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_001_to_008.html new file mode 100644 index 000000000..30fd482c2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_009_to_016.html new file mode 100644 index 000000000..9f8e906fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_017_to_024.html new file mode 100644 index 000000000..43ca8516a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_025_to_032.html new file mode 100644 index 000000000..9777afaad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_033_to_040.html new file mode 100644 index 000000000..b89dd4cff --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_041_to_048.html new file mode 100644 index 000000000..498f81bba --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_049_to_056.html new file mode 100644 index 000000000..1daa37a5b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__struct__struct_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html new file mode 100644 index 000000000..3cb910891 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html new file mode 100644 index 000000000..7a77df048 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html new file mode 100644 index 000000000..d8b634883 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_017_to_024.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html new file mode 100644 index 000000000..439c76067 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_025_to_032.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html new file mode 100644 index 000000000..b6542409a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_033_to_040.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html new file mode 100644 index 000000000..883184afb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_041_to_048.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html new file mode 100644 index 000000000..9d54a4440 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_049_to_056.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html new file mode 100644 index 000000000..5a3ef032f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_057_to_064.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html new file mode 100644 index 000000000..2270db981 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_065_to_072.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html new file mode 100644 index 000000000..537d9709f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_073_to_080.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html new file mode 100644 index 000000000..d8217b703 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_081_to_088.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html new file mode 100644 index 000000000..346f5612e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_089_to_096.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html new file mode 100644 index 000000000..08756e159 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_097_to_104.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html new file mode 100644 index 000000000..f43469c3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_105_to_112.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html new file mode 100644 index 000000000..80e2b189e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__swizzlers__swizzlers_113_to_120.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__tan__tan_001_to_006.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__tan__tan_001_to_006.html new file mode 100644 index 000000000..166d5c9eb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__tan__tan_001_to_006.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec3__vec3_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec3__vec3_001_to_008.html new file mode 100644 index 000000000..86ba81d0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec3__vec3_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_001_to_008.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_001_to_008.html new file mode 100644 index 000000000..9fabf18bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_001_to_008.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_009_to_016.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_009_to_016.html new file mode 100644 index 000000000..e3bf169dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_009_to_016.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_017_to_018.html b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_017_to_018.html new file mode 100644 index 000000000..7a97367b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__ogles__GL__vec__vec_017_to_018.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__get-active-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__get-active-test.html new file mode 100644 index 000000000..f10e5a1c1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__get-active-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-long-names-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-long-names-test.html new file mode 100644 index 000000000..8940a1119 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-long-names-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-test.html new file mode 100644 index 000000000..d41637850 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-bind-attrib-location-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-attribute.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-attribute.html new file mode 100644 index 000000000..cb4828783 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-attribute.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-uniform.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-uniform.html new file mode 100644 index 000000000..36330ed06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-get-active-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-getshadersource.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-getshadersource.html new file mode 100644 index 000000000..9d7a02d09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-getshadersource.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-shader-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-shader-test.html new file mode 100644 index 000000000..1e1c232f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__gl-shader-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__invalid-UTF-16.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__invalid-UTF-16.html new file mode 100644 index 000000000..2d45b547d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__invalid-UTF-16.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-infolog.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-infolog.html new file mode 100644 index 000000000..82f84b826 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-infolog.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-test.html new file mode 100644 index 000000000..44072f6e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__program-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html new file mode 100644 index 000000000..5126225ed --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__programs__use-program-crash-with-discard-in-fragment-shader.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-pack-alignment.html b/dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-pack-alignment.html new file mode 100644 index 000000000..cad4058f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-pack-alignment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-test.html new file mode 100644 index 000000000..5b6368b7a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__reading__read-pixels-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__feedback-loop.html b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__feedback-loop.html new file mode 100644 index 000000000..6512c444b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__feedback-loop.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-object-attachment.html b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-object-attachment.html new file mode 100644 index 000000000..96a3ec05a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-object-attachment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-state-restoration.html b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-state-restoration.html new file mode 100644 index 000000000..ad95fab61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-state-restoration.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-test.html new file mode 100644 index 000000000..04970422c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__framebuffer-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__renderbuffer-initialization.html new file mode 100644 index 000000000..6f2df4298 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__renderbuffers__renderbuffer-initialization.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__clipping-wide-points.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__clipping-wide-points.html new file mode 100644 index 000000000..1568549a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__clipping-wide-points.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__culling.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__culling.html new file mode 100644 index 000000000..1b85137ba --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__culling.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__default-texture-draw-bug.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__default-texture-draw-bug.html new file mode 100644 index 000000000..63e8750e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__default-texture-draw-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-arrays-out-of-bounds.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-arrays-out-of-bounds.html new file mode 100644 index 000000000..f15ca64c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-arrays-out-of-bounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-elements-out-of-bounds.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-elements-out-of-bounds.html new file mode 100644 index 000000000..24ce1d88d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-elements-out-of-bounds.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-with-changing-start-vertex-bug.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-with-changing-start-vertex-bug.html new file mode 100644 index 000000000..ef7aaee4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__draw-with-changing-start-vertex-bug.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-switch.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-switch.html new file mode 100644 index 000000000..b236df752 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-switch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-texture-switch.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-texture-switch.html new file mode 100644 index 000000000..d5db7e08c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__framebuffer-texture-switch.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-clear.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-clear.html new file mode 100644 index 000000000..6dfc01f89 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-clear.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawarrays.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawarrays.html new file mode 100644 index 000000000..7872d352f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawarrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawelements.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawelements.html new file mode 100644 index 000000000..6b41a8cc2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-drawelements.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-canvas-dimensions.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-canvas-dimensions.html new file mode 100644 index 000000000..a2b3c2b67 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-canvas-dimensions.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-fbo-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-fbo-test.html new file mode 100644 index 000000000..700530ff8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-fbo-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-test.html new file mode 100644 index 000000000..6c62215b0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-scissor-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-viewport-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-viewport-test.html new file mode 100644 index 000000000..369d1b2ab --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__gl-viewport-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__line-loop-tri-fan.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__line-loop-tri-fan.html new file mode 100644 index 000000000..a6a6a4e00 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__line-loop-tri-fan.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__many-draw-calls.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__many-draw-calls.html new file mode 100644 index 000000000..f53cd66c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__many-draw-calls.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__more-than-65536-indices.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__more-than-65536-indices.html new file mode 100644 index 000000000..0040aad6e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__more-than-65536-indices.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__multisample-corruption.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__multisample-corruption.html new file mode 100644 index 000000000..55e0e5f50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__multisample-corruption.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__negative-one-index.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__negative-one-index.html new file mode 100644 index 000000000..5c2d9b2bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__negative-one-index.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__out-of-bounds-index-buffers.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__out-of-bounds-index-buffers.html new file mode 100644 index 000000000..c4bb23a96 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__out-of-bounds-index-buffers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-no-attributes.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-no-attributes.html new file mode 100644 index 000000000..c5a385770 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-no-attributes.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-size.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-size.html new file mode 100644 index 000000000..b505c35c7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-specific-shader-variables.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-specific-shader-variables.html new file mode 100644 index 000000000..39217fdce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-specific-shader-variables.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html new file mode 100644 index 000000000..d3f0ba0be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__point-with-gl-pointcoord-in-fragment-shader.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__polygon-offset.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__polygon-offset.html new file mode 100644 index 000000000..3762fda54 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__polygon-offset.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__simple.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__simple.html new file mode 100644 index 000000000..c101f45c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__simple.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__triangle.html b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__triangle.html new file mode 100644 index 000000000..96fd5eacd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__rendering__triangle.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enable-enum-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enable-enum-test.html new file mode 100644 index 000000000..a8e628162 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enable-enum-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enum-tests.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enum-tests.html new file mode 100644 index 000000000..867bb8eb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-enum-tests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-get-calls.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-get-calls.html new file mode 100644 index 000000000..ea01963ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-get-calls.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-geterror.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-geterror.html new file mode 100644 index 000000000..6f3efdd90 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-geterror.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-getstring.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-getstring.html new file mode 100644 index 000000000..6c1d37823 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-getstring.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-initial-state.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-initial-state.html new file mode 100644 index 000000000..2cd9bdfe4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-initial-state.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-object-get-calls.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-object-get-calls.html new file mode 100644 index 000000000..e2a0b1f49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__gl-object-get-calls.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__state__state-uneffected-after-compositing.html b/dom/canvas/test/webgl-conf/generated/test_conformance__state__state-uneffected-after-compositing.html new file mode 100644 index 000000000..1bc63bc36 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__state__state-uneffected-after-compositing.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..649fac057 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..624a2edca --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..3d9e2259d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..c84170aee --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..1bb105202 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..9069d79dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..60e269cd1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..3008e8bb9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..14fa34adf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..54abdacf9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__canvas_sub_rectangle__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..35db8726a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..54cb01946 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..626716181 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..31eaac73a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..d86b0c5f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..c5ce2f806 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..fa3c5aec4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..25610b67e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..3d925f683 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..6a3550a32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__image_data__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__compressed-tex-image.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__compressed-tex-image.html new file mode 100644 index 000000000..26745ff16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__compressed-tex-image.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-2d-formats.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-2d-formats.html new file mode 100644 index 000000000..bdfd79a0a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-2d-formats.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html new file mode 100644 index 000000000..66393b1b4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-image-and-sub-image-2d.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html new file mode 100644 index 000000000..3842106a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__copy-tex-sub-image-2d-partial-texture.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__cube-incomplete-fbo.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__cube-incomplete-fbo.html new file mode 100644 index 000000000..917ef47b9 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__cube-incomplete-fbo.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__default-texture.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__default-texture.html new file mode 100644 index 000000000..ba22f047b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__default-texture.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-get-tex-parameter.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-get-tex-parameter.html new file mode 100644 index 000000000..1c894157a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-get-tex-parameter.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-pixelstorei.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-pixelstorei.html new file mode 100644 index 000000000..eceb9e3fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-pixelstorei.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-teximage.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-teximage.html new file mode 100644 index 000000000..42232ca39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__gl-teximage.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__mipmap-fbo.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__mipmap-fbo.html new file mode 100644 index 000000000..409b3a8e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__mipmap-fbo.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__origin-clean-conformance.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__origin-clean-conformance.html new file mode 100644 index 000000000..43fe45644 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__origin-clean-conformance.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html new file mode 100644 index 000000000..03ab84017 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html new file mode 100644 index 000000000..44a59ae76 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-and-uniform-binding-bugs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-canvas-corruption.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-canvas-corruption.html new file mode 100644 index 000000000..79d7b2a94 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-canvas-corruption.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-webgl.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-webgl.html new file mode 100644 index 000000000..6ebc597e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-webgl.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-format-and-type.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-format-and-type.html new file mode 100644 index 000000000..177c23fde --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-format-and-type.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-invalid-data.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-invalid-data.html new file mode 100644 index 000000000..9462a7bce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-image-with-invalid-data.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-input-validation.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-input-validation.html new file mode 100644 index 000000000..e9530161b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-input-validation.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d-bad-args.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d-bad-args.html new file mode 100644 index 000000000..2580342bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d-bad-args.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d.html new file mode 100644 index 000000000..6f143d024 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__tex-sub-image-2d.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texparameter-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texparameter-test.html new file mode 100644 index 000000000..e65082b52 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texparameter-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind-2.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind-2.html new file mode 100644 index 000000000..9aa23878e --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind-2.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind.html new file mode 100644 index 000000000..bd44a15e4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-active-bind.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-attachment-formats.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-attachment-formats.html new file mode 100644 index 000000000..58964de1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-attachment-formats.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-clear.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-clear.html new file mode 100644 index 000000000..99cff64a1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-clear.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-complete.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-complete.html new file mode 100644 index 000000000..e682038c4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-complete.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-copying-feedback-loops.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-copying-feedback-loops.html new file mode 100644 index 000000000..09f00a3d6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-copying-feedback-loops.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-cube-as-fbo-attachment.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-cube-as-fbo-attachment.html new file mode 100644 index 000000000..9c0e0eb3f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-cube-as-fbo-attachment.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-draw-with-2d-and-cube.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-draw-with-2d-and-cube.html new file mode 100644 index 000000000..fd78dda57 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-draw-with-2d-and-cube.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-fakeblack.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-fakeblack.html new file mode 100644 index 000000000..40cd63c42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-fakeblack.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-formats-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-formats-test.html new file mode 100644 index 000000000..6c8858d1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-formats-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-hd-dpi.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-hd-dpi.html new file mode 100644 index 000000000..7a768817b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-hd-dpi.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-mips.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-mips.html new file mode 100644 index 000000000..c7a090693 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-mips.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot-video.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot-video.html new file mode 100644 index 000000000..d6997b29a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot-video.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot.html new file mode 100644 index 000000000..503f2fd3b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-npot.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-cube-maps.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-cube-maps.html new file mode 100644 index 000000000..edbab7bbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-cube-maps.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-limit.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-limit.html new file mode 100644 index 000000000..87e07e4f1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size-limit.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size.html new file mode 100644 index 000000000..7c6a091e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-sub-image-cube-maps.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-sub-image-cube-maps.html new file mode 100644 index 000000000..227e4c39b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-sub-image-cube-maps.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-transparent-pixels-initialized.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-transparent-pixels-initialized.html new file mode 100644 index 000000000..b15ef564a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-transparent-pixels-initialized.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-cube-maps.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-cube-maps.html new file mode 100644 index 000000000..abb663b35 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-cube-maps.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-size.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-size.html new file mode 100644 index 000000000..9c89051fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__misc__texture-upload-size.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..a280b4daa --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..6fe26930c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..58c7ab73d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..e2bf42472 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..e310df3c8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__svg_image__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..a6e34a8a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..f8836f4dd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..cd8aec7d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..3dc49808c --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..02ede1c1f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html new file mode 100644 index 000000000..77c35802b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html new file mode 100644 index 000000000..d7a39a82d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgb-rgb-unsigned_short_5_6_5.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html new file mode 100644 index 000000000..2ac339c39 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_byte.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html new file mode 100644 index 000000000..c1cb39cc5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html new file mode 100644 index 000000000..b6c65a7ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__textures__webgl_canvas__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-crash.html new file mode 100644 index 000000000..d1ade2ed3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-view-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-view-crash.html new file mode 100644 index 000000000..7bc6a9860 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-buffer-view-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-large-array-tests.html b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-large-array-tests.html new file mode 100644 index 000000000..419983e6d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-large-array-tests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-unit-tests.html b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-unit-tests.html new file mode 100644 index 000000000..60913f9a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__array-unit-tests.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-crash.html b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-crash.html new file mode 100644 index 000000000..e03ba1f6f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-crash.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-test.html new file mode 100644 index 000000000..899ac3711 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__data-view-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__typed-arrays-in-workers.html b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__typed-arrays-in-workers.html new file mode 100644 index 000000000..c5a0ff80d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__typedarrays__typed-arrays-in-workers.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-arrays.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-arrays.html new file mode 100644 index 000000000..9d13a210a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-arrays.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-bool.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-bool.html new file mode 100644 index 000000000..3df3166ad --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniform-bool.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniformmatrix4fv.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniformmatrix4fv.html new file mode 100644 index 000000000..bfb39befd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-uniformmatrix4fv.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-unknown-uniform.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-unknown-uniform.html new file mode 100644 index 000000000..082a20211 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__gl-unknown-uniform.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__null-uniform-location.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__null-uniform-location.html new file mode 100644 index 000000000..1de56ab51 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__null-uniform-location.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__out-of-bounds-uniform-array-access.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__out-of-bounds-uniform-array-access.html new file mode 100644 index 000000000..b6927012f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__out-of-bounds-uniform-array-access.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-default-values.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-default-values.html new file mode 100644 index 000000000..3d749c7b7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-default-values.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-location.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-location.html new file mode 100644 index 000000000..6837f529f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-location.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-samplers-test.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-samplers-test.html new file mode 100644 index 000000000..3ac0e3cbf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-samplers-test.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-values-per-program.html b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-values-per-program.html new file mode 100644 index 000000000..bb9fcf260 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__uniforms__uniform-values-per-program.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/iframe-passthrough.css b/dom/canvas/test/webgl-conf/iframe-passthrough.css new file mode 100644 index 000000000..fddd7ee68 --- /dev/null +++ b/dom/canvas/test/webgl-conf/iframe-passthrough.css @@ -0,0 +1,36 @@ +html { + height: 100%; + + border: none; + /* + border-left-style: solid; + border-left-color: blue; + border-left-width: 4px; + */ +} + +body { + margin: 0px; + min-height: 100%; + + display: flex; + flex-flow: column; + + border: none; + /* + border-left-style: solid; + border-left-color: green; + border-left-width: 4px; + */ +} + +iframe { + flex: auto; + + border: none; + /* + border-left-style: solid; + border-left-color: red; + border-left-width: 4px; + */ +} diff --git a/dom/canvas/test/webgl-conf/mochi-single.html b/dom/canvas/test/webgl-conf/mochi-single.html new file mode 100644 index 000000000..0d7000c61 --- /dev/null +++ b/dom/canvas/test/webgl-conf/mochi-single.html @@ -0,0 +1,65 @@ + + + + + + WebGL Conformance Test Suite Single Test Wrapper + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/mochi-wrapper.html.template b/dom/canvas/test/webgl-conf/mochi-wrapper.html.template new file mode 100644 index 000000000..b47111f63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/mochi-wrapper.html.template @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/mochitest-errata.ini b/dom/canvas/test/webgl-conf/mochitest-errata.ini new file mode 100644 index 000000000..e9f3db3af --- /dev/null +++ b/dom/canvas/test/webgl-conf/mochitest-errata.ini @@ -0,0 +1,913 @@ +# *** WARNING! *** +# Modification to this file only take effect after running +# generate-wrappers-and-manifest.py + +# See python/mozbuild/mozbuild/mozinfo.py for incoming data. + +########## +# android_version strings +# https://en.wikipedia.org/wiki/Android_version_history +# * Android 'Gingerbread' 2.3-2.3.2: 9 +# * Android 'Gingerbread' 2.3.3+: 10 ('2.3' slaves) +# * Android 'ICS' 4.0-4.0.2: 14 ('4.0' slaves, inactive) +# * Android 'ICS' 4.0.3+: 15 +# * Android 'Jellybean' 4.3: 18 ('4.3' slaves) + +########## +# os_version strings +# https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx +# * Windows XP: 5.1 +# * Windows XP 64-bit: 5.2 +# * Windows Vista: 6.0 +# * Windows 7: 6.1 +# * Windows 8: 6.2 +# * Windows 8.1: 6.3 +# * Windows 10: 10.0 + +[DEFAULT] +subsuite = webgl +# Skip B2G for now, until we get a handle on the longer tail of emulator bugs. +# Bug 1136181 disabled on Mulet for intermittent failures +skip-if = os == 'b2g' || ((os == 'linux') && (buildapp == 'mulet')) + +[generated/test_..__always-fail.html] +fail-if = 1 + +#################### +# Tests requesting non-local network connections. + +[generated/test_conformance__more__functions__readPixelsBadArgs.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to www.opengl.org (45.55.206.190) was made. +skip-if = 1 +[generated/test_2_conformance__more__functions__readPixelsBadArgs.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to www.opengl.org (45.55.206.190) was made. +skip-if = 1 + +[generated/test_conformance__more__functions__texImage2DHTML.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to mashable.com (88.221.93.55) was made. +skip-if = 1 +[generated/test_2_conformance__more__functions__texImage2DHTML.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to mashable.com (88.221.93.55) was made. +skip-if = 1 + +[generated/test_conformance__more__functions__texSubImage2DHTML.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to mashable.com (184.50.232.90) was made. +skip-if = 1 +[generated/test_2_conformance__more__functions__texSubImage2DHTML.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to mashable.com (184.50.232.90) was made. +skip-if = 1 + +[generated/test_2_conformance__textures__misc__origin-clean-conformance.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to www.opengl.org (104.131.58.36) was made. +skip-if = 1 +[generated/test_conformance__textures__misc__origin-clean-conformance.html] +# (TODO) FATAL ERROR: Non-local network connections are disabled and a connection attempt to www.opengl.org (104.131.58.36) was made. +skip-if = 1 + + +#################### +# Timing out +[generated/test_conformance__uniforms__uniform-default-values.html] +# Timeout on Windows, crash on Android/Linux. +skip-if = (os == 'android') || (os == 'linux') || (os == 'win') +[generated/test_conformance__ogles__GL__mat3__mat3_001_to_006.html] +# Timeout on D3D11 +skip-if = (os == 'win' && os_version != '5.1') + +#################### +# Tests expect conservative index validation, which we skip on WebGL 2. +# ANGLE still provides it though, so they pass on windows. +[generated/test_2_conformance__rendering__draw-elements-out-of-bounds.html] +fail-if = (os != 'win') +[generated/test_2_conformance__buffers__index-validation-copies-indices.html] +fail-if = (os != 'win') +[generated/test_2_conformance__buffers__index-validation.html] +fail-if = (os != 'win') +[generated/test_2_conformance__buffers__index-validation-verifies-too-many-indices.html] +fail-if = (os != 'win') +[generated/test_2_conformance2__rendering__element-index-uint.html] +fail-if = (os != 'win') + +######################################################################## +# Complicated + +[generated/test_conformance__context__context-attributes-alpha-depth-stencil-antialias.html] +fail-if = (os == 'mac' && os_version == '10.6') +# Asserts on 'B2G ICS Emulator Debug' and linux debug. Crashes on Android. +skip-if = (os == 'b2g') || (os == 'linux') || (os == 'android') + +[generated/test_conformance__extensions__webgl-draw-buffers.html] +fail-if = (os == 'mac') +# Crashes +# Pass in Win XP but fails in other windows platforms. +skip-if = (os == 'linux') || (os == 'win') + +[generated/test_conformance__glsl__constructors__glsl-construct-bvec3.html] +# Crashes from libglsl.so +# application crashed [@ jemalloc_crash] on Android +skip-if = (os == 'linux') || (os == 'mac') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-bvec4.html] +# application crashed [@ ParseOperand::GetLogicalSize() const + 0x4] +skip-if = (os == 'linux') || (os == 'mac') || (os == 'android') + +[generated/test_conformance__glsl__constructors__glsl-construct-ivec3.html] +# application crashed [@ ParseOperand::GetLogicalSize() const + 0x4] +# application crashed [@ jemalloc_crash] on Android +skip-if = (os == 'linux') || (os == 'mac') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-ivec4.html] +# Assume crashes like ivec3 +skip-if = (os == 'linux') || (os == 'mac') + +[generated/test_conformance__glsl__constructors__glsl-construct-mat2.html] +fail-if = (os == 'mac' && os_version == '10.6') +# Crashes on Linux ASAN +skip-if = ((os == 'linux') && asan) + +[generated/test_conformance__misc__type-conversion-test.html] +fail-if = (os == 'linux') +# Resets device on Android 2.3. +# Crashes on B2G ICS Emulator, desktop Linux, and Mulet Linux x64. +skip-if = (os == 'android') || (os == 'b2g') || (os == 'linux') + +[generated/test_conformance__misc__object-deletion-behaviour.html] +fail-if = (os == 'android') +# void mozilla::gl::GLContext::fDetachShader(GLuint, GLuint): Generated unexpected GL_INVALID_VALUE error. (0x0501) +skip-if = (os == 'android' && debug) + +[generated/test_conformance__extensions__oes-vertex-array-object.html] +fail-if = (os == 'mac') || (os == 'linux') || (os == 'win') +# 10.6 crash: +# PROCESS-CRASH | dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-vertex-array-object.html | application crashed [@ gleRunVertexSubmitImmediate + 0xf24] +skip-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__textures__misc__texture-size.html] +# application crashed [@ mozilla::gl::GLContext::AfterGLCall] +skip-if = (os == 'android') || (os == 'win') + +[generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__vertex_arrays__vertex-array-object.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_conformance__extensions__oes-texture-half-float.html] +fail-if = (os == 'mac') || (os == 'win') || (os == 'android') || (os == 'linux') +[generated/test_conformance__attribs__gl-vertexattribpointer.html] +fail-if = (os == 'android') +[generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html] +fail-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html] +fail-if = (os == 'android') || (os == 'linux') + +[generated/test_conformance__textures__misc__texture-size-limit.html] +fail-if = (os == 'linux') || (os == 'android') +skip-if = (os == 'linux' && asan) +[generated/test_2_conformance2__reading__read-pixels-from-fbo-test.html] +skip-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__misc__uninitialized-test-2.html] +skip-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance__misc__bad-arguments-test.html] +# skip because some result logged after SimpleTest.finish() +skip-if = (os == 'mac') || (os == 'win') +[generated/test_conformance__misc__bad-arguments-test.html] +# skip because some result logged after SimpleTest.finish() +skip-if = (os == 'mac') || (os == 'win') || (os == 'linux') || (os == 'android') +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-index.html] +# skip this test because finish() was called multiple times +skip-if = (os == 'mac') || (os == 'win') || (os == 'linux') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-index.html] +# skip this test because finish() was called multiple times +skip-if = (os == 'mac') || (os == 'win') || (os == 'linux') || (os == 'android') +[generated/test_conformance__textures__misc__cube-incomplete-fbo.html] +fail-if = (os == 'mac') || (os == 'linux') +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__sampler-struct-function-arg.html] +# Crashes +skip-if = (os == 'linux') || (os == 'android') +[generated/test_conformance__glsl__constructors__glsl-construct-bvec2.html] +# mozalloc_abort in libglsl.so +skip-if = (os == 'linux') || (os == 'android') +[generated/test_conformance__glsl__bugs__pow-of-small-constant-in-user-defined-function.html] +skip-if = (os == 'android') +[generated/test_2_conformance2__textures__misc__tex-image-with-bad-args-from-dom-elements.html] +skip-if = (os == 'win') || (os == 'mac') +[generated/test_2_conformance2__textures__misc__tex-image-with-different-data-source.html] +# Bug 1324349 +skip-if = (os == 'mac' && debug) || (os == 'win' && debug) +fail-if = (os == 'mac') || (os == 'win') +[generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html] +# timed out crash +skip-if = (os == 'android') +[generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html] +# timed out +skip-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-video.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-video.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__webgl-draw-buffers-framebuffer-unsupported.html] +fail-if = (os == 'mac') || (os == 'linux') +[generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_byte.html] +fail-if = (os == 'android') +[generated/test_conformance__textures__video__tex-2d-rgb-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'android') +[generated/test_conformance__textures__video__tex-2d-rgba-rgba-unsigned_byte.html] +fail-if = (os == 'android') +[generated/test_2_conformance2__buffers__buffer-type-restrictions.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__glsl3__tricky-loop-conditions.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__misc__views-with-offsets.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__rendering__blitframebuffer-outside-readbuffer.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__rendering__clear-func-buffer-type-match.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__rendering__fs-color-type-mismatch-color-buffer-type.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__rendering__instanced-rendering-bug.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__textures__misc__copy-texture-image.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__textures__misc__integer-cubemap-specification-order-bug.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__textures__misc__tex-srgb-mipmap.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rg16f-rg-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rg32f-rg-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rg8-rg-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb16f-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb32f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgb9_e5-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgba16f-rgba-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgba32f-rgba-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgba8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-srgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance__extensions__webgl-compressed-texture-etc.html] +fail-if = (os == 'mac') || (os == 'win') +######################################################################## +# "tst-linux{32,64}-spot-NNN" Slaves: +# Android 2.3, B2G Emu, Linux, and Mulet. +# Android: os == 'android'. (Not enough info to separate out 2.3) +# B2G Emu: os == 'b2g'. +# Linux: os == 'linux'. +# Mulet: os == 'b2g' && buildapp == 'mulet'. +[generated/test_conformance__glsl__bugs__temp-expressions-should-not-crash.html] +# Coincidentally enough, crashes on Linux and Android 4.0. +skip-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__misc__invalid-passed-params.html] +# Causes consistent *blues*: "DMError: Remote Device Error: unable to +# connect to 127.0.0.1 after 5 attempts" on 'Android 2.3 Opt'. +skip-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__ogles__GL__functions__functions_001_to_008.html] +fail-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__ogles__GL__sin__sin_001_to_006.html] +fail-if = (os == 'android') || (os == 'linux') +[generated/test_2_conformance2__glsl3__shader-with-invalid-characters.html] +fail-if = (os == 'mac') || (os == 'win') +[generated/test_conformance__reading__read-pixels-test.html] +# Causes consistent *blues*: "DMError: Remote Device Error: unable to +# connect to 127.0.0.1 after 5 attempts" on 'Android 2.3 Opt'. +# Crashes near on B2G ICS Emulator. +skip-if = (os == 'android') || (os == 'linux') +[generated/test_conformance__textures__misc__texture-upload-size.html] +# application crashed [@ mozilla::WebGLTexture::TexSubImage] +skip-if = (os == 'win') || (os == 'android') + +######################################################################## +######################################################################## +# Android + +[generated/test_conformance__attribs__gl-disabled-vertex-attrib.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-linear.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-canvas.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-image.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-float-with-image-data.html] +fail-if = (os == 'android') +# Frequent but intermittent timeout on win7 +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_conformance__extensions__oes-texture-half-float-linear.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-canvas.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-image.html] +fail-if = (os == 'android') +[generated/test_conformance__extensions__oes-texture-half-float-with-image-data.html] +fail-if = (os == 'android') +# Frequent but intermittent timeout on win7 +skip-if = (os == 'win' && os_version == '6.1') + +[generated/test_conformance__canvas__buffer-offscreen-test.html] +# Causes frequent *blues*: "DMError: Remote Device Error: unable to +# connect to 127.0.0.1 after 5 attempts" on 'Android 2.3 Opt'. +skip-if = (os == 'android' && android_version == '10') + +[generated/test_conformance__canvas__rapid-resizing.html] +# Frequent orange crash. +skip-if = (os == 'android') + +[generated/test_conformance__glsl__bugs__long-expressions-should-not-crash.html] +# Crashes sometimes +skip-if = (os == 'android') +[generated/test_conformance__canvas__drawingbuffer-hd-dpi-test.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__context__context-creation.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__context__context-eviction-with-garbage-collection.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__nested-functions-should-not-crash.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__conditional-discard-optimization.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__conditional-discard-in-loop.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__floored-division-accuracy.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__variables__gl-fragcoord.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__rendering__many-draw-calls.html] +# Crashes on Android +# Times-out on DEBUG builds +skip-if = (os == 'android') || debug +[generated/test_2_conformance__rendering__many-draw-calls.html] +# Appears to just take too long on debug, most of the time. +skip-if = debug +[generated/test_conformance__uniforms__out-of-bounds-uniform-array-access.html] +# Crashes +skip-if = (os == 'android') || (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__samplers__glsl-function-texture2dproj.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__rendering__framebuffer-switch.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__modulo-arithmetic-accuracy.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__multiplication-assignment.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__rendering__framebuffer-texture-switch.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__array-of-struct-with-int-first-position.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__more__conformance__quickCheckAPI-D_G.html] +# void mozilla::gl::GLContext::fGenerateMipmap(GLenum): Generated unexpected GL_INVALID_ENUM error. (0x0500) +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-size-cube-maps.html] +# application crashed [@ mozilla::gl::GLContext::AfterGLCall] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-mips.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__logic-inside-block-without-braces.html] +# application crashed [@ MustSkipMarking] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__gl-fragcoord-multisampling-bug.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__samplers__glsl-function-texture2dprojlod.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__compare-loop-index-to-uniform.html] +skip-if = (os == 'android') +[generated/test_conformance__misc__boolean-argument-conversion.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-npot.html] +# application crashed [@ mozilla::gl::GLContext::AfterGLCall] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-npot-video.html] +# application crashed [@ mozilla::layers::GLImage::GetAsSoure] +skip-if = (os == 'android') +[generated/test_conformance__glsl__functions__glsl-function-step-gentype.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__misc__shader-precision-format.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__tex-image-webgl.html] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__gl-teximage.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__sequence-operator-evaluation-order.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__fragcoord-linking-bug.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__textures__misc__texture-sub-image-cube-maps.html] +# application crashed [@ mozilla::gl::GLContext::AfterGLCall] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__struct-constructor-highp-bug.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__variables__glsl-built-ins.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__nested-loops-with-break-and-continue.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__qualcomm-crash.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__uniforms-should-not-lose-values.html] +# application crashed [@ jemalloc_crash] +skip-if = (os == 'android') +#################### +# 2.3 failures +[generated/test_conformance__glsl__misc__re-compile-re-link.html] +fail-if = (os == 'android' && android_version == '10') +[generated/test_conformance__programs__program-test.html] +fail-if = (os == 'android' && android_version == '10') +[generated/test_conformance__textures__misc__tex-image-with-invalid-data.html] +skip-if = (os == 'android') +#################### +# Timeouts +[generated/test_conformance__context__context-release-upon-reload.html] +skip-if = (os == 'android') +[generated/test_conformance__context__context-release-with-workers.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__misc__shader-uniform-packing-restrictions.html] +skip-if = (os == 'android') +[generated/test_conformance__glsl__bugs__complex-glsl-does-not-crash.html] +skip-if = (os == 'android') + +[generated/test_conformance__glsl__misc__shader-with-non-reserved-words.html] +fail-if = (os == 'android') +# (TODO) Generates results after calling finish() +skip-if = 1 + +#################### +# Timeout on 2.3 +[generated/test_conformance__misc__delayed-drawing.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__conformance__webGLArrays.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bufferData.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bufferDataBadArgs.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bufferSubData.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__bufferSubDataBadArgs.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__drawArrays.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__drawArraysOutOfBounds.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__drawElements.html] +skip-if = (os == 'android' && android_version == '10') +[generated/test_conformance__more__functions__drawElementsBadArgs.html] +skip-if = (os == 'android' && android_version == '10') + +#################### + +[generated/test_conformance__attribs__gl-bindAttribLocation-aliasing.html] +# OOM crash +skip-if = (os == 'android') +[generated/test_conformance__attribs__gl-bindAttribLocation-matrix.html] +# OOM crash +skip-if = (os == 'android') +[generated/test_conformance__misc__uninitialized-test.html] +# Crashes +skip-if = (os == 'android') +[generated/test_conformance__renderbuffers__framebuffer-object-attachment.html] +# Crashes +skip-if = (os == 'android') + +######################################################################## +######################################################################## +# B2G +[generated/test_conformance__glsl__reserved___webgl_function.vert.html] +fail-if = (os == 'b2g') +[generated/test_conformance__glsl__reserved__webgl_function.vert.html] +fail-if = (os == 'b2g') +[generated/test_conformance__misc__error-reporting.html] +fail-if = (os == 'b2g') +[generated/test_conformance__programs__get-active-test.html] +fail-if = (os == 'b2g') + + +######################################################################## +######################################################################## +# Linux +[generated/test_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html] +# mozalloc_abort in libglsl.so +skip-if = (os == 'linux') +[generated/test_conformance__glsl__constructors__glsl-construct-vec3.html] +# Crashes +skip-if = (os == 'linux') +[generated/test_conformance__glsl__constructors__glsl-construct-vec4.html] +# Inferred crash from vec3 above. +skip-if = (os == 'linux') +[generated/test_conformance__glsl__constructors__glsl-construct-ivec2.html] +# Crashes from libglsl.so +skip-if = (os == 'linux') +[generated/test_conformance__glsl__functions__glsl-function-atan.html] +# Crashes +skip-if = (os == 'linux') +[generated/test_conformance__limits__gl-min-textures.html] +# mesa upgrade issues or task cluster issues- we just need it green; bug 1220658 +skip-if = (os == 'linux') +[generated/test_conformance__ogles__GL__notEqual__notEqual_001_to_008.html] +# Crashes +skip-if = (os == 'linux') +[generated/test_conformance__ogles__GL__sign__sign_001_to_006.html] +# Crashes +skip-if = (os == 'linux') +[generated/test_conformance__rendering__clipping-wide-points.html] +fail-if = (os == 'linux') + +######################################################################## +######################################################################## +# Mac +[generated/test_conformance__canvas__drawingbuffer-static-canvas-test.html] +# Intermittent crash on OSX. +skip-if = (os == 'mac') +[generated/test_conformance__canvas__viewport-unchanged-upon-resize.html] +# New OSX r7 machines and 10.10.5 is causing perma failure (bug 1216549) +skip-if = (os == 'mac') +[generated/test_conformance__rendering__multisample-corruption.html] +# application crashed [@ gldAttachDrawable + 0x9e0]. Also crash on Android. +skip-if = (os == 'mac') || (os == 'android') || (os == 'win') +[generated/test_2_conformance__textures__misc__copy-tex-image-2d-formats.html] +# Assertion: ""GFX: We should have caught all other errors"" in WebGLTextureUpload.cpp +skip-if = (os == 'mac') + +#################### +# 10.6 +[generated/test_conformance__glsl__constructors__glsl-construct-mat3.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__constructors__glsl-construct-mat4.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__matrices__glsl-mat4-to-mat3.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__glsl__misc__glsl-function-nodes.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__ogles__GL__struct__struct_033_to_040.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__ogles__GL__struct__struct_041_to_048.html] +fail-if = (os == 'mac' && os_version == '10.6') +[generated/test_conformance__ogles__GL__struct__struct_049_to_056.html] +fail-if = (os == 'mac' && os_version == '10.6') + +#################### +# 10.8 +[generated/test_conformance__glsl__functions__glsl-function-smoothstep-gentype.html] +fail-if = (os == 'mac' && os_version == '10.8') +[generated/test_conformance__glsl__variables__gl-pointcoord.html] +fail-if = (os == 'mac' && os_version == '10.8') +[generated/test_conformance__limits__gl-max-texture-dimensions.html] +fail-if = (os == 'mac' && os_version == '10.8') + +#################### +# failure on OSX +[generated/test_conformance__extensions__angle-instanced-arrays.html] +fail-if = (os == 'mac') +[generated/test_conformance__glsl__misc__shaders-with-invariance.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__misc__tex-unpack-params.html] +skip-if = (os == 'mac' && debug) +fail-if = (os == 'mac') +[generated/test_2_conformance2__glsl3__valid-invariant.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__reading__format-r11f-g11f-b10f.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__rendering__blitframebuffer-filter-outofbounds.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__rendering__blitframebuffer-filter-srgb.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__rendering__framebuffer-unsupported.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r16f-red-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r32f-red-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8-red-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-r8ui-red_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg16f-rg-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg32f-rg-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8-rg-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb16f-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb32f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgb9_e5-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba16f-rgba-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba32f-rgba-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__canvas_sub_rectangle__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r16f-red-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r16f-red-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r32f-red-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r8-red-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-r8ui-red_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rg16f-rg-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rg32f-rg-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rg8-rg-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb16f-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb32f-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb565-rgb-unsigned_short_5_6_5.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgb9_e5-rgb-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgba16f-rgba-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgba32f-rgba-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgba8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-srgb8-rgb-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image__tex-3d-srgb8_alpha8-rgba-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image_data__tex-2d-rg8ui-rg_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image_data__tex-2d-rgb8ui-rgb_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__image_data__tex-2d-rgba8ui-rgba_integer-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__misc__copy-texture-image-luma-format.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__misc__integer-cubemap-texture-sampling.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__misc__tex-mipmap-levels.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-r16f-red-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-r16f-red-half_float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-r32f-red-float.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-r8-red-unsigned_byte.html] +fail-if = (os == 'mac') +[generated/test_2_conformance2__textures__video__tex-3d-r8ui-red_integer-unsigned_byte.html] +fail-if = (os == 'mac') + +[generated/test_2_conformance2__extensions__ext-color-buffer-float.html] +skip-if = (os == 'mac' && debug) +[generated/test_2_conformance__limits__gl-line-width.html] +skip-if = (os == 'mac') +[generated/test_2_conformance__misc__type-conversion-test.html] +skip-if = (os == 'mac' && debug) + +######################################################################## +######################################################################## +# Win +[generated/test_2_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html] +# time out crash +skip-if = (os == 'win') +[generated/test_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html] +# time out crash +skip-if = (os == 'win') +[generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html] +skip-if = (os == 'win') +[generated/test_conformance__glsl__misc__large-loop-compile.html] +fail-if = (os == 'win' && os_version == '5.1') +[generated/test_conformance__textures__misc__copy-tex-image-2d-formats.html] +skip-if = (os == 'win' && os_version == '5.1') +[generated/test_conformance__uniforms__uniform-values-per-program.html] +# Crashes on D3D11 debug. +skip-if = (os == 'win' && os_version != '5.1') +[generated/test_2_conformance2__glsl3__uniform-location-length-limits.html] +# time out crash +skip-if = (os == 'win' && debug) +[generated/test_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html] +# time out crash +skip-if = (os == 'win' && debug) +[generated/test_conformance__extensions__webgl-compressed-texture-size-limit.html] +# skip this because the result is not always pass +skip-if = (os == 'win') +[generated/test_2_conformance2__glsl3__loops-with-side-effects.html] +# application crashed [@ nvoglv32.dll + 0x999512] +skip-if = (os == 'win') +[generated/test_2_conformance2__attribs__gl-vertex-attrib-i-render.html] +# timed out crash +skip-if = (os == 'win') +[generated/test_2_conformance__canvas__canvas-test.html] +# this test is not always passed every time on opt and debug build +skip-if = (os == 'win') +[generated/test_2_conformance__canvas__to-data-url-test.html] +# TEST-UNEXPECTED-ERROR: Assertion count 1 is greater than expected range 0-0 assertions +skip-if = (os == 'win') +[generated/test_2_conformance__textures__misc__texture-size-cube-maps.html] +# Random failures +skip-if = (os == 'win') +[generated/test_2_conformance__ogles__GL__struct__struct_025_to_032.html] +# application crashed [@ nvoglv32.dll + 0x90b445] +skip-if = (os == 'win') +[generated/test_2_conformance__uniforms__out-of-bounds-uniform-array-access.html] +# application terminated +skip-if = (os == 'win') +[generated/test_2_conformance__textures__misc__texture-size.html] +skip-if = (os == 'win') +[generated/test_2_conformance2__query__occlusion-query.html] +skip-if = (os == 'win') +[generated/test_2_conformance2__query__query.html] +# random timed out +skip-if = (os == 'win') +[generated/test_2_conformance2__attribs__gl-vertex-attrib.html] +# random timed out +skip-if = (os == 'win') +[generated/test_2_conformance2__glsl3__short-circuiting-in-loop-condition.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__context__context-attribute-preserve-drawing-buffer.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-bvec2.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-bvec3.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-bvec4.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-ivec2.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-ivec3.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-ivec4.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec-mat-corner-cases.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec2.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec3.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html] +# Failure on win7 but got passed on win7 vm +skip-if = (os == 'win' && os_version == '6.1') +[generated/test_2_conformance__extensions__webgl-compressed-texture-size-limit.html] +# Test timed out. +skip-if = (os == 'win') +[generated/test_2_conformance2__textures__misc__tex-input-validation.html] +skip-if = (os == 'win') +[generated/test_2_conformance2__buffers__get-buffer-sub-data.html] +skip-if = (os == 'win') + +#################### +# failure on Windows +[generated/test_2_conformance__canvas__rapid-resizing.html] +fail-if = (os == 'win' && os_version == '5.1') +[generated/test_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html] +fail-if = (os == 'win' && os_version == '5.1') diff --git a/dom/canvas/test/webgl-conf/mochitest.ini.template b/dom/canvas/test/webgl-conf/mochitest.ini.template new file mode 100644 index 000000000..885022f73 --- /dev/null +++ b/dom/canvas/test/webgl-conf/mochitest.ini.template @@ -0,0 +1,10 @@ +# This is a GENERATED FILE. Do not edit it directly. +# Regenerated it by using `python generate-wrappers-and-manifest.py`. +# Mark failing (fail-if) and crashing (skip-if) tests in mochitest-errata.ini. + +[DEFAULT] +%%DEFAULT_ERRATA%% + +support-files = %%SUPPORT_FILES%% + +%%MANIFEST_TESTS%% diff --git a/dom/canvas/test/webgl-mochitest/driver-info.js b/dom/canvas/test/webgl-mochitest/driver-info.js new file mode 100644 index 000000000..e2f6e003a --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/driver-info.js @@ -0,0 +1,169 @@ +DriverInfo = (function() { + // --------------------------------------------------------------------------- + // Debug info handling + + function defaultInfoFunc(str) { + console.log('Info: ' + str); + } + + var gInfoFunc = defaultInfoFunc; + function setInfoFunc(func) { + gInfoFunc = func; + } + + function info(str) { + gInfoFunc(str); + } + + // --------------------------------------------------------------------------- + // OS and driver identification + // Stolen from dom/canvas/test/webgl/test_webgl_conformance_test_suite.html + function detectDriverInfo() { + try { + var cc = SpecialPowers.Cc; + } catch (e) { + throw 'No SpecialPowers!'; + } + + const Cc = SpecialPowers.Cc; + const Ci = SpecialPowers.Ci; + var doc = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser).parseFromString("", "text/html"); + + var canvas = doc.createElement("canvas"); + canvas.width = 1; + canvas.height = 1; + + var type = ""; + var gl = null; + try { + gl = canvas.getContext("experimental-webgl"); + } catch(e) {} + + if (!gl) { + info('Failed to create WebGL context for querying driver info.'); + throw 'WebGL failed'; + } + + var ext = gl.getExtension("WEBGL_debug_renderer_info"); + // this extension is unconditionally available to chrome. No need to check. + + var webglRenderer = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL); + var webglVendor = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL); + return [webglVendor, webglRenderer]; + } + + function detectOSInfo() { + try { + var cc = SpecialPowers.Cc; + } catch (e) { + throw 'No SpecialPowers!'; + } + + const Cc = SpecialPowers.Cc; + const Ci = SpecialPowers.Ci; + + // From reftest.js: + var runtime = Cc['@mozilla.org/xre/app-info;1'].getService(Ci.nsIXULRuntime); + + var os = null; + var version = null; + if (navigator.platform.indexOf('Win') == 0) { + os = OS.WINDOWS; + + // code borrowed from browser/modules/test/browser_taskbar_preview.js + version = SpecialPowers.Services.sysinfo.getProperty('version'); + version = parseFloat(version); + // Version 6.0 is Vista, 6.1 is 7. + + } else if (navigator.platform.indexOf('Mac') == 0) { + os = OS.MAC; + + var versionMatch = /Mac OS X (\d+.\d+)/.exec(navigator.userAgent); + version = versionMatch ? parseFloat(versionMatch[1]) : null; + + } else if (runtime.widgetToolkit == 'gonk') { + os = OS.B2G; + + } else if (navigator.appVersion.indexOf('Android') != -1) { + os = OS.ANDROID; + // From layout/tools/reftest/reftest.js: + version = SpecialPowers.Services.sysinfo.getProperty('version'); + + } else if (navigator.platform.indexOf('Linux') == 0) { + // Must be checked after android, as android also has a 'Linux' platform string. + os = OS.LINUX; + } + + return [os, version]; + } + + var OS = { + WINDOWS: 'windows', + MAC: 'mac', + LINUX: 'linux', + ANDROID: 'android', + B2G: 'b2g', + }; + + var DRIVER = { + MESA: 'mesa', + NVIDIA: 'nvidia', + ANDROID_X86_EMULATOR: 'android x86 emulator', + ANGLE: 'angle', + }; + + var kOS = null; + var kOSVersion = null; + var kDriver = null; + + try { + [kOS, kOSVersion] = detectOSInfo(); + } catch (e) { + // Generally just fails when we don't have SpecialPowers. + } + + try { + var glVendor, glRenderer; + [glVendor, glRenderer] = detectDriverInfo(); + info('GL vendor: ' + glVendor); + info('GL renderer: ' + glRenderer); + + if (glRenderer.includes('llvmpipe')) { + kDriver = DRIVER.MESA; + } else if (glRenderer.includes('Android Emulator')) { + kDriver = DRIVER.ANDROID_X86_EMULATOR; + } else if (glRenderer.includes('ANGLE')) { + kDriver = DRIVER.ANGLE; + } else if (glVendor.includes('NVIDIA')) { + kDriver = DRIVER.NVIDIA; + } + } catch (e) { + // detectDriverInfo is fallible where WebGL fails. + } + + if (kOS) { + info('OS detected as: ' + kOS); + info(' Version: ' + kOSVersion); + } else { + info('OS not detected.'); + info(' `platform`: ' + navigator.platform); + info(' `appVersion`: ' + navigator.appVersion); + info(' `userAgent`: ' + navigator.userAgent); + } + if (kDriver) { + info('GL driver detected as: ' + kDriver); + } else { + info('GL driver not detected.'); + } + + return { + setInfoFunc: setInfoFunc, + + OS: OS, + DRIVER: DRIVER, + getOS: function() { return kOS; }, + getDriver: function() { return kDriver; }, + getOSVersion: function() { return kOSVersion; }, + }; +})(); + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/ensure-ext.js b/dom/canvas/test/webgl-mochitest/ensure-exts/ensure-ext.js new file mode 100644 index 000000000..8d710139f --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/ensure-ext.js @@ -0,0 +1,44 @@ +'use strict'; + +function EnsureExt(extName, shouldHave=true) { + EnsureExtFor('webgl', extName, shouldHave); + EnsureExtFor('webgl2', extName, shouldHave); +} + +function EnsureExtFor(contextType, extName, shouldHave=true) { + var c = document.createElement('canvas'); + var gl = c.getContext(contextType); + + if (!gl) { + todo(false, 'Failed to create context: ' + contextType); + return; + } + + var ext = gl.getExtension(extName); + var haveText = ' have ' + contextType + ' extension ' + extName + '.'; + if (shouldHave) { + ok(ext, 'Should' + haveText); + } else { + ok(!ext, 'Should not' + haveText); + } +} + +function Lastly_WithDraftExtsEnabled(func) { + SimpleTest.waitForExplicitFinish(); + + var fnEnsure = function() { + func(); + SimpleTest.finish(); + }; + + if ('SpecialPowers' in window) { + var prefStateList = [ + ['webgl.enable-draft-extensions', true], + ]; + var prefEnv = {'set': prefStateList}; + SpecialPowers.pushPrefEnv(prefEnv, fnEnsure); + } else { + console.log('Couldn\'t use SpecialPowers to enable draft extensions.'); + fnEnsure(); + } +} diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html new file mode 100644 index 000000000..5905539a4 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html new file mode 100644 index 000000000..46b135b79 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html new file mode 100644 index 000000000..443c7ab70 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html new file mode 100644 index 000000000..af94cbc65 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_frag_depth.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_frag_depth.html new file mode 100644 index 000000000..9dbac9881 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_frag_depth.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_sRGB.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_sRGB.html new file mode 100644 index 000000000..cbdde000a --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_sRGB.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html new file mode 100644 index 000000000..c3a51c0c9 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html new file mode 100644 index 000000000..877c4440b --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html new file mode 100644 index 000000000..359726256 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html new file mode 100644 index 000000000..9a88b2771 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html new file mode 100644 index 000000000..6d68f0b4e --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html new file mode 100644 index 000000000..9e6ade9f4 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html new file mode 100644 index 000000000..327625c01 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html new file mode 100644 index 000000000..c95481398 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html new file mode 100644 index 000000000..6ad800110 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html new file mode 100644 index 000000000..6d8a864c0 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html new file mode 100644 index 000000000..068351635 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/ensure-exts/test_common.html b/dom/canvas/test/webgl-mochitest/ensure-exts/test_common.html new file mode 100644 index 000000000..153161d93 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/ensure-exts/test_common.html @@ -0,0 +1,110 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/es3-data.js b/dom/canvas/test/webgl-mochitest/es3-data.js new file mode 100644 index 000000000..ec00cf82e --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/es3-data.js @@ -0,0 +1,4719 @@ +// The compressed data are created by Mali GPU Texture Compression Tool +// (http://malideveloper.arm.com/resources/tools/mali-gpu-texture-compression-tool/). +// Simply convert image to ktx format then strip the ktx header to +// get compressed data. +// +// The decompressed data are create by Khronos KTX library and tools +// (https://github.com/KhronosGroup/KTX) +// Calling _ktxUnpackETC with previous generated compressed data to +// get decompressed data. + +var img_4x4_r11_eac = { + compressed: new Uint8Array([ + 0x0f, 0xf9, 0xbe, 0xff, 0xef, 0xb6, 0xff, 0xff, + ]), + decompressed: new Uint8Array([ + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x4b, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + ]) +} + +var img_4x4_signed_r11_eac = { + compressed: new Uint8Array([ + 0x90, 0xf9, 0xbe, 0xff, 0xef, 0xb6, 0xff, 0xff, + ]), + decompressed: new Uint8Array([ + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x4c, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + ]) +} + +var img_4x4_rg11_eac = { + compressed: new Uint8Array([ + 0x2e, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0x2e, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + ]) +} + +var img_4x4_signed_rg11_eac = { + compressed: new Uint8Array([ + 0xae, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0xae, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + ]) +} + +var img_4x4_rgb_etc2 = { + compressed: new Uint8Array([ + 0x04, 0xf0, 0xf0, 0x02, 0x07, 0x45, 0x00, 0x00 + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + ]) +} + +var img_4x4_rgb_punchthrough_etc2 = { + compressed: new Uint8Array([ + 0x04, 0xf0, 0xf0, 0x00, 0xbf, 0x5f, 0x02, 0x05, + ]), + decompressed: new Uint8Array([ + 0xfc, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, + 0xfc, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ]) +} + +var img_4x4_rgba_etc2 = { + compressed: new Uint8Array([ + 0x44, 0x89, 0x69, 0x24, 0x41, 0x43, 0x04, 0x41, + 0x04, 0xf0, 0xf0, 0x02, 0x07, 0x45, 0x00, 0x00, + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x04, + 0xff, 0x00, 0x00, 0x04, 0x00, 0xff, 0x00, 0x04, + 0x00, 0xff, 0x00, 0x04, 0x00, 0xff, 0x00, 0x1c, + 0xff, 0x00, 0x00, 0x34, 0x00, 0xff, 0x00, 0x1c, + 0xff, 0x00, 0x00, 0x04, 0xff, 0x00, 0x00, 0x34, + 0xff, 0x00, 0x00, 0x7c, 0x00, 0xff, 0x00, 0x34, + 0x00, 0xff, 0x00, 0x04, 0x00, 0xff, 0x00, 0x1c, + 0x00, 0xff, 0x00, 0x34, 0x00, 0xff, 0x00, 0x1c, + ]) +} + +var img_8x8_r11_eac = { + compressed: new Uint8Array([ + 0x0f, 0xf9, 0xbe, 0xff, 0xef, 0xb6, 0xff, 0xff, + 0x5e, 0xb3, 0xeb, 0xa4, 0xba, 0xff, 0xa4, 0x92, + 0x00, 0xf6, 0xfb, 0xed, 0xbe, 0xff, 0xed, 0xb6, + 0x2c, 0xfd, 0x1c, 0x7f, 0xc7, 0x00, 0x7f, 0xff, + ]), + decompressed: new Uint8Array([ + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x4b, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0xe2, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb3, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb3, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0xb3, 0x00, 0x00, 0xff, 0xb3, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb3, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb3, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0xb3, 0x00, 0x00, 0xff, 0xb3, 0x00, 0x00, 0xff, + 0xb3, 0x00, 0x00, 0xff, 0xb3, 0x00, 0x00, 0xff, + ]) +} + +var img_8x8_signed_r11_eac = { + compressed: new Uint8Array([ + 0x90, 0xf9, 0xbe, 0xff, 0xef, 0xb6, 0xff, 0xff, + 0xdf, 0xb3, 0xeb, 0xa4, 0xba, 0xff, 0xa4, 0x92, + 0xfb, 0x20, 0xeb, 0xa4, 0xba, 0xff, 0xa4, 0x92, + 0xac, 0xfd, 0x1c, 0x7f, 0xc7, 0x00, 0x7f, 0xff, + ]), + decompressed: new Uint8Array([ + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x4c, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0xe2, 0x00, 0x00, 0xff, + 0xe2, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb2, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb2, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0xb2, 0x00, 0x00, 0xff, 0xb2, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb2, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x96, 0x00, 0x00, 0xff, + 0x96, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xb2, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0xb2, 0x00, 0x00, 0xff, 0xb2, 0x00, 0x00, 0xff, + 0xb2, 0x00, 0x00, 0xff, 0xb2, 0x00, 0x00, 0xff, + ]) +} + +var img_8x8_rg11_eac = { + compressed: new Uint8Array([ + 0x2e, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0x2e, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + 0x2e, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0x2e, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0x2e, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + 0x2e, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0x00, 0x00, 0x24, 0x92, 0x49, 0x24, 0x92, 0x49, + 0x2e, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + ]) +} + +var img_8x8_signed_rg11_eac = { + compressed: new Uint8Array([ + 0xae, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0xae, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + 0xae, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0xae, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0xae, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + 0xae, 0xf0, 0xe7, 0x92, 0x79, 0xff, 0x92, 0x49, + 0x80, 0x00, 0x49, 0x24, 0x92, 0x49, 0x24, 0x92, + 0xae, 0xf0, 0x3c, 0xff, 0xcf, 0x24, 0xff, 0xff, + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + ]) +} + +var img_8x8_rgb_etc2 = { + compressed: new Uint8Array([ + 0x04, 0xf0, 0xf0, 0x02, 0x07, 0x45, 0x00, 0x00, + 0x04, 0x0f, 0xff, 0x02, 0x07, 0x45, 0x00, 0x00, + 0x04, 0xf0, 0xf0, 0xf2, 0xf8, 0xba, 0x00, 0x00, + 0x04, 0x0f, 0x0f, 0xf2, 0xf8, 0xba, 0x00, 0x00 + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, + 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, + 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, + 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, + 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, + ]) +} + +var img_8x8_rgb_punchthrough_etc2 = { + compressed: new Uint8Array([ + 0x04, 0xf0, 0xf0, 0x00, 0x5f, 0xef, 0x01, 0x44, + 0xfb, 0xf0, 0x00, 0xf0, 0xfd, 0xfa, 0x10, 0x80, + 0xfb, 0x0f, 0x0f, 0x00, 0x7f, 0x6f, 0x02, 0x40, + 0x04, 0xff, 0x00, 0xf0, 0xf7, 0x6d, 0x05, 0x04, + ]), + decompressed: new Uint8Array([ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, + 0xfc, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfc, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + ]) +} + +var img_8x8_rgba_etc2 = { + compressed: new Uint8Array([ + 0x35, 0x83, 0x6d, 0x26, 0x88, 0x46, 0x64, 0x37, + 0x04, 0xf0, 0xf0, 0x02, 0x07, 0x45, 0x00, 0x00, + 0x69, 0xa8, 0x66, 0x76, 0x45, 0x68, 0x86, 0xd1, + 0x04, 0x0f, 0xff, 0x02, 0x07, 0x45, 0x00, 0x00, + 0x69, 0xa8, 0x6d, 0xb2, 0x53, 0x80, 0xaf, 0x41, + 0x04, 0xf0, 0xf0, 0xf2, 0xf8, 0xba, 0x00, 0x00, + 0x8c, 0xca, 0xf4, 0x2b, 0x0a, 0x05, 0x34, 0x9b, + 0x04, 0x0f, 0x0f, 0xf2, 0xf8, 0xba, 0x00, 0x00, + ]), + decompressed: new Uint8Array([ + 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, + 0xff, 0x00, 0x00, 0x05, 0x00, 0xff, 0x00, 0x05, + 0xff, 0xff, 0x00, 0x05, 0x00, 0x00, 0xff, 0x05, + 0xff, 0xff, 0x00, 0x05, 0x00, 0x00, 0xff, 0x05, + 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x05, + 0xff, 0x00, 0x00, 0x15, 0x00, 0xff, 0x00, 0x25, + 0x00, 0x00, 0xff, 0x2d, 0x00, 0x00, 0xff, 0x2d, + 0xff, 0xff, 0x00, 0x19, 0x00, 0x00, 0xff, 0x05, + 0xff, 0x00, 0x00, 0x05, 0xff, 0x00, 0x00, 0x15, + 0xff, 0x00, 0x00, 0x3d, 0x00, 0xff, 0x00, 0x5d, + 0xff, 0xff, 0x00, 0x73, 0xff, 0xff, 0x00, 0x55, + 0xff, 0xff, 0x00, 0x2d, 0x00, 0x00, 0xff, 0x19, + 0x00, 0xff, 0x00, 0x05, 0x00, 0xff, 0x00, 0x25, + 0x00, 0xff, 0x00, 0x5d, 0x00, 0xff, 0x00, 0x95, + 0x00, 0x00, 0xff, 0xc3, 0x00, 0x00, 0xff, 0x9b, + 0x00, 0x00, 0xff, 0x55, 0x00, 0x00, 0xff, 0x2d, + 0x00, 0xff, 0x00, 0x05, 0xff, 0x00, 0xff, 0x2d, + 0x00, 0xff, 0x00, 0x73, 0xff, 0x00, 0xff, 0xc3, + 0x00, 0x00, 0xff, 0xf8, 0x00, 0xff, 0xff, 0xb0, + 0x00, 0x00, 0xff, 0x74, 0x00, 0xff, 0xff, 0x2c, + 0xff, 0x00, 0xff, 0x05, 0xff, 0x00, 0xff, 0x2d, + 0x00, 0xff, 0x00, 0x55, 0xff, 0x00, 0xff, 0x9b, + 0x00, 0xff, 0xff, 0xb0, 0x00, 0xff, 0xff, 0x98, + 0x00, 0x00, 0xff, 0x5c, 0x00, 0xff, 0xff, 0x2c, + 0x00, 0xff, 0x00, 0x05, 0x00, 0xff, 0x00, 0x19, + 0x00, 0xff, 0x00, 0x2d, 0xff, 0x00, 0xff, 0x55, + 0x00, 0x00, 0xff, 0x74, 0x00, 0x00, 0xff, 0x5c, + 0x00, 0x00, 0xff, 0x2c, 0x00, 0xff, 0xff, 0x14, + 0xff, 0x00, 0xff, 0x05, 0xff, 0x00, 0xff, 0x05, + 0xff, 0x00, 0xff, 0x19, 0xff, 0x00, 0xff, 0x2d, + 0x00, 0xff, 0xff, 0x2c, 0x00, 0xff, 0xff, 0x2c, + 0x00, 0xff, 0xff, 0x14, 0x00, 0xff, 0xff, 0x14, + ]) +} + +/* This image exercises every ETC2 block type */ +var img_32x32_r11_eac = { + compressed: new Uint8Array([ + 0x6e, 0x61, 0x92, 0x08, 0x02, 0x01, 0x12, 0x53, + 0x21, 0x32, 0xf2, 0x8d, 0x01, 0xf0, 0x9f, 0x02, + 0x2b, 0x4b, 0xd0, 0x9d, 0x41, 0xf0, 0x29, 0x12, + 0x1f, 0x30, 0xc0, 0x2e, 0x0a, 0xf0, 0xad, 0x02, + 0x20, 0x34, 0xf0, 0x1b, 0x42, 0xb6, 0x1a, 0x02, + 0x1e, 0x34, 0xb0, 0x8d, 0x0a, 0xb0, 0x3f, 0x0a, + 0x2a, 0x21, 0xf1, 0xbf, 0x1a, 0xf1, 0x3e, 0x0b, + 0x47, 0x32, 0x29, 0xb0, 0x52, 0xb0, 0x1f, 0xac, + 0x31, 0x4f, 0x9f, 0xc0, 0x49, 0x49, 0xb0, 0xdb, + 0x0a, 0x23, 0xda, 0x1c, 0x08, 0x18, 0x90, 0x21, + 0x08, 0x2d, 0x08, 0x0c, 0x92, 0x91, 0x22, 0x4a, + 0x04, 0x00, 0x40, 0x70, 0x87, 0x40, 0x30, 0x9f, + 0x0c, 0x1c, 0x61, 0x30, 0xd2, 0x61, 0x3a, 0x83, + 0x12, 0x14, 0x81, 0x9c, 0x8b, 0x50, 0xb4, 0x39, + 0x1a, 0x28, 0x66, 0x00, 0x64, 0xa0, 0x51, 0x45, + 0x2e, 0x33, 0x42, 0x02, 0x64, 0xb6, 0xdf, 0xff, + 0x34, 0x31, 0x82, 0x62, 0x08, 0x48, 0xb6, 0x9b, + 0x07, 0x2d, 0xa3, 0x45, 0x60, 0x2b, 0x10, 0x44, + 0x08, 0x18, 0x67, 0x12, 0x86, 0x24, 0x92, 0x5b, + 0x02, 0x00, 0xe0, 0x3e, 0x10, 0xe9, 0x74, 0xd5, + 0x08, 0x1c, 0x09, 0x44, 0x88, 0x84, 0xe9, 0xa4, + 0x16, 0x19, 0x4a, 0xdf, 0x6d, 0xbe, 0xd7, 0x6d, + 0x20, 0x11, 0x4f, 0xe6, 0xb6, 0xef, 0x6f, 0xf6, + 0x2f, 0x44, 0xb2, 0xc9, 0x24, 0xbb, 0x6f, 0xff, + 0x2c, 0x41, 0xdb, 0xf9, 0x65, 0x12, 0x44, 0x8c, + 0x07, 0x13, 0x09, 0x54, 0xdb, 0x29, 0xb4, 0x9a, + 0x01, 0x02, 0x6c, 0xf2, 0xd9, 0xb5, 0xbb, 0x6d, + 0x0e, 0x15, 0x64, 0x96, 0x40, 0x28, 0x41, 0x24, + 0x14, 0x13, 0x6a, 0x48, 0xe7, 0x5e, 0x7f, 0xbe, + 0x1e, 0x19, 0x92, 0x69, 0xa6, 0x87, 0x4f, 0xff, + 0x36, 0x14, 0x6d, 0x14, 0x40, 0x12, 0x5b, 0xb7, + 0x54, 0x2b, 0x6d, 0xa4, 0x91, 0x00, 0x0b, 0x6d, + 0x19, 0x43, 0xfe, 0xdf, 0xa4, 0xd8, 0x0d, 0x09, + 0x10, 0x21, 0xf0, 0x10, 0x00, 0x44, 0x04, 0x91, + 0x01, 0x23, 0x92, 0x49, 0x34, 0x9b, 0x69, 0x37, + 0x11, 0x18, 0x6c, 0x00, 0x07, 0xe2, 0xdf, 0xed, + 0x21, 0x23, 0x40, 0x28, 0x84, 0xd0, 0x49, 0xb0, + 0x13, 0x36, 0x9b, 0x6d, 0x36, 0xdf, 0xff, 0xff, + 0x38, 0x17, 0x26, 0x49, 0xb6, 0xda, 0xdf, 0xfe, + 0x60, 0x44, 0x49, 0x22, 0x49, 0x00, 0x09, 0x24, + 0x2c, 0x53, 0x9b, 0x62, 0x44, 0x29, 0x14, 0x89, + 0x0b, 0x1c, 0x93, 0xf0, 0x3f, 0x82, 0xd9, 0xfd, + 0x0f, 0x13, 0x3f, 0xf5, 0xbf, 0x3b, 0x6f, 0xf6, + 0x1e, 0x10, 0xb7, 0x27, 0x74, 0xa4, 0x43, 0x62, + 0x21, 0x1a, 0x00, 0x50, 0x07, 0x17, 0xfb, 0x6f, + 0x36, 0x11, 0x6c, 0x0c, 0x00, 0x96, 0xcd, 0x6c, + 0x3f, 0x1d, 0x80, 0xab, 0x01, 0xd6, 0x0d, 0xac, + 0x4c, 0x23, 0x49, 0x20, 0x00, 0xb6, 0xdf, 0xff, + 0x35, 0x20, 0xdb, 0xfd, 0xed, 0x36, 0xd6, 0x49, + 0x1e, 0x19, 0x22, 0xf4, 0x2f, 0x66, 0x66, 0x66, + 0x19, 0x13, 0x3b, 0x69, 0xb7, 0x9f, 0xfd, 0xbf, + 0x2b, 0x16, 0x4e, 0x76, 0x25, 0x02, 0x72, 0xaf, + 0x35, 0x10, 0x68, 0x54, 0x85, 0x03, 0x61, 0x26, + 0x39, 0x1d, 0x44, 0x42, 0x25, 0x12, 0xeb, 0x76, + 0x3d, 0x1d, 0x29, 0x20, 0x09, 0xb2, 0x4d, 0xb6, + 0x65, 0x37, 0x6d, 0xb4, 0x91, 0x20, 0x49, 0x77, + 0x68, 0x42, 0x17, 0xf4, 0x2f, 0x68, 0x56, 0xd5, + 0x49, 0x54, 0x02, 0x60, 0x26, 0x22, 0x62, 0x26, + 0x5a, 0x4c, 0x68, 0x56, 0x84, 0x68, 0x46, 0x84, + 0x4a, 0x27, 0x66, 0x74, 0x67, 0x46, 0x74, 0x2f, + 0x53, 0x2b, 0x68, 0x66, 0x85, 0x68, 0x56, 0x85, + 0x51, 0x2b, 0x68, 0x66, 0x86, 0x68, 0x66, 0x86, + 0x52, 0x25, 0x68, 0x46, 0x45, 0x66, 0x64, 0x27, + 0x77, 0x32, 0x6d, 0x16, 0x8c, 0x46, 0x61, 0x37, + ]), + decompressed: new Uint8Array([ + 0x7a, 0x00, 0x00, 0xff, 0x7a, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x36, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x43, 0x00, 0x00, 0xff, 0x43, 0x00, 0x00, 0xff, + 0x4f, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x49, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x42, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x42, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x6b, 0x00, 0x00, 0xff, + 0x7a, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x2e, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x4a, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x7a, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x12, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x12, 0x00, 0x00, 0xff, + 0x12, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x4a, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x08, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x22, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x52, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x08, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x09, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x09, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x22, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x52, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x52, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x52, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x09, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x13, 0x00, 0x00, 0xff, + 0x2c, 0x00, 0x00, 0xff, 0x2c, 0x00, 0x00, 0xff, + 0x43, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x43, 0x00, 0x00, 0xff, 0x5b, 0x00, 0x00, 0xff, + 0x2b, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x13, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x13, 0x00, 0x00, 0xff, 0x2c, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x5b, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x2c, 0x00, 0x00, 0xff, 0x29, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x29, 0x00, 0x00, 0xff, + 0x43, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x5b, 0x00, 0x00, 0xff, + 0x4f, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x29, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x29, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x5b, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x27, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x2e, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x19, 0x00, 0x00, 0xff, 0x27, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x30, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x27, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x27, 0x00, 0x00, 0xff, + 0x30, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x4a, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x49, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x2d, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x2b, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x54, 0x00, 0x00, 0xff, 0x68, 0x00, 0x00, 0xff, + 0x49, 0x00, 0x00, 0xff, 0x2d, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x54, 0x00, 0x00, 0xff, 0x68, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x11, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x54, 0x00, 0x00, 0xff, 0x68, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x11, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x54, 0x00, 0x00, 0xff, 0x68, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x64, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x08, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x64, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x22, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x64, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x64, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x19, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x27, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x2c, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x36, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x4d, 0x00, 0x00, 0xff, + 0x56, 0x00, 0x00, 0xff, 0x6b, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x51, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x29, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x19, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x1e, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x27, 0x00, 0x00, 0xff, + 0x27, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x2c, 0x00, 0x00, 0xff, 0x2c, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x4d, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x71, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x29, 0x00, 0x00, 0xff, + 0x22, 0x00, 0x00, 0xff, 0x22, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1e, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x2e, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x39, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x4d, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x7a, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x29, 0x00, 0x00, 0xff, + 0x27, 0x00, 0x00, 0xff, 0x27, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x1e, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x35, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x56, 0x00, 0x00, 0xff, + 0x6b, 0x00, 0x00, 0xff, 0x83, 0x00, 0x00, 0xff, + 0x60, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x2b, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x50, 0x00, 0x00, 0xff, + 0x5f, 0x00, 0x00, 0xff, 0x71, 0x00, 0x00, 0xff, + 0x78, 0x00, 0x00, 0xff, 0x60, 0x00, 0x00, 0xff, + 0x48, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x43, 0x00, 0x00, 0xff, 0x43, 0x00, 0x00, 0xff, + 0x43, 0x00, 0x00, 0xff, 0x43, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x4c, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x5f, 0x00, 0x00, 0xff, + 0x68, 0x00, 0x00, 0xff, 0x7a, 0x00, 0x00, 0xff, + 0x98, 0x00, 0x00, 0xff, 0x78, 0x00, 0x00, 0xff, + 0x60, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x4e, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x4e, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x4e, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x4e, 0x00, 0x00, 0xff, 0x52, 0x00, 0x00, 0xff, + 0x4f, 0x00, 0x00, 0xff, 0x4f, 0x00, 0x00, 0xff, + 0x4f, 0x00, 0x00, 0xff, 0x4f, 0x00, 0x00, 0xff, + 0x4d, 0x00, 0x00, 0xff, 0x4d, 0x00, 0x00, 0xff, + 0x4d, 0x00, 0x00, 0xff, 0x4d, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x4c, 0x00, 0x00, 0xff, + 0x56, 0x00, 0x00, 0xff, 0x56, 0x00, 0x00, 0xff, + 0x5f, 0x00, 0x00, 0xff, 0x68, 0x00, 0x00, 0xff, + 0x7a, 0x00, 0x00, 0xff, 0x8c, 0x00, 0x00, 0xff, + 0x98, 0x00, 0x00, 0xff, 0x98, 0x00, 0x00, 0xff, + 0x78, 0x00, 0x00, 0xff, 0x78, 0x00, 0x00, 0xff, + 0x6c, 0x00, 0x00, 0xff, 0x6c, 0x00, 0x00, 0xff, + 0x6c, 0x00, 0x00, 0xff, 0x6c, 0x00, 0x00, 0xff, + 0x66, 0x00, 0x00, 0xff, 0x62, 0x00, 0x00, 0xff, + 0x62, 0x00, 0x00, 0xff, 0x62, 0x00, 0x00, 0xff, + 0x5e, 0x00, 0x00, 0xff, 0x5e, 0x00, 0x00, 0xff, + 0x5e, 0x00, 0x00, 0xff, 0x5e, 0x00, 0x00, 0xff, + 0x5f, 0x00, 0x00, 0xff, 0x5b, 0x00, 0x00, 0xff, + 0x5b, 0x00, 0x00, 0xff, 0x5b, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x56, 0x00, 0x00, 0xff, 0x5e, 0x00, 0x00, 0xff, + 0x62, 0x00, 0x00, 0xff, 0x66, 0x00, 0x00, 0xff, + 0x68, 0x00, 0x00, 0xff, 0x7a, 0x00, 0x00, 0xff, + 0x8c, 0x00, 0x00, 0xff, 0x9b, 0x00, 0x00, 0xff, + ]) +} + +var img_32x32_signed_r11_eac = { + compressed: new Uint8Array([ + 0xef, 0x61, 0x92, 0x08, 0x02, 0x01, 0x12, 0x53, + 0xa2, 0x32, 0xf2, 0x8d, 0x01, 0xf0, 0x9f, 0x02, + 0xab, 0x4b, 0xd0, 0x9d, 0x41, 0xf0, 0x29, 0x12, + 0xa0, 0x30, 0xc0, 0x2e, 0x0a, 0xf0, 0xad, 0x02, + 0xa1, 0x34, 0xf0, 0x1b, 0x42, 0xb6, 0x1a, 0x02, + 0x9f, 0x34, 0xb0, 0x8d, 0x0a, 0xb0, 0x3f, 0x0a, + 0xaa, 0x21, 0xf1, 0xbf, 0x1a, 0xf1, 0x3e, 0x0b, + 0xc8, 0x32, 0x29, 0xb0, 0x52, 0xb0, 0x1f, 0xac, + 0xb2, 0x4f, 0x9f, 0xc0, 0x49, 0x49, 0xb0, 0xdb, + 0x8a, 0x16, 0xfe, 0x1e, 0x08, 0x1d, 0x20, 0x22, + 0x88, 0x2d, 0x08, 0x0c, 0x92, 0x91, 0x10, 0x02, + 0x85, 0x1d, 0x20, 0x60, 0x46, 0x20, 0x20, 0x56, + 0x8c, 0x1c, 0x61, 0x30, 0xd2, 0x61, 0x3a, 0x83, + 0x93, 0x11, 0x81, 0x9c, 0x8b, 0x50, 0xb4, 0x39, + 0x94, 0x2f, 0x42, 0xc8, 0x2d, 0xf2, 0x79, 0xe7, + 0xaf, 0x33, 0x42, 0x02, 0x64, 0xb6, 0xdf, 0xff, + 0xb5, 0x31, 0x82, 0x62, 0x08, 0x48, 0xb6, 0x9b, + 0x84, 0x1a, 0xd7, 0x51, 0xac, 0x83, 0x0b, 0x25, + 0x8a, 0x16, 0x66, 0xa4, 0x85, 0x49, 0x22, 0x5b, + 0x83, 0x1d, 0xa0, 0x2a, 0x08, 0xc4, 0xe2, 0x8c, + 0x8d, 0x15, 0x2d, 0x86, 0xd1, 0x09, 0x41, 0x00, + 0x96, 0x19, 0x4a, 0xdf, 0x6d, 0xbe, 0xd7, 0x6d, + 0xa1, 0x11, 0x4f, 0xe6, 0xb6, 0xef, 0x6f, 0xf6, + 0xb0, 0x44, 0xb2, 0xc9, 0x24, 0xbb, 0x6f, 0xff, + 0xad, 0x41, 0xdb, 0xf9, 0x65, 0x12, 0x44, 0x8c, + 0x82, 0x1d, 0xd2, 0x78, 0x49, 0xa0, 0x90, 0x08, + 0x82, 0x00, 0x6c, 0xe2, 0xd9, 0x91, 0xb9, 0x24, + 0x8e, 0x15, 0x64, 0x96, 0x40, 0x28, 0x41, 0x24, + 0x95, 0x13, 0x6a, 0x48, 0xe7, 0x5c, 0x7f, 0xbe, + 0xa1, 0x18, 0x00, 0x51, 0x45, 0x0a, 0x8d, 0xb6, + 0xb7, 0x14, 0x6d, 0x14, 0x40, 0x12, 0x5b, 0xb7, + 0xcf, 0x10, 0x6d, 0xa4, 0x89, 0x92, 0x4f, 0xff, + 0x99, 0x43, 0xfe, 0xdf, 0xa4, 0xd8, 0x0d, 0x09, + 0x90, 0x21, 0xf0, 0x10, 0x00, 0x44, 0x02, 0x89, + 0x89, 0x2d, 0x49, 0x24, 0xaa, 0x56, 0xd4, 0xaf, + 0x91, 0x18, 0x6c, 0x00, 0x07, 0xe2, 0xdf, 0xed, + 0xa1, 0x23, 0x40, 0x28, 0x84, 0xd0, 0x49, 0xb0, + 0x93, 0x36, 0x9b, 0x6d, 0x36, 0xdf, 0xff, 0xff, + 0xbc, 0x12, 0x48, 0x01, 0x6d, 0xb6, 0x4d, 0xb5, + 0xe1, 0x44, 0x49, 0x22, 0x49, 0x00, 0x09, 0x24, + 0xad, 0x53, 0x9b, 0x62, 0x44, 0x29, 0x14, 0x89, + 0x8b, 0x1c, 0x93, 0xf0, 0x3f, 0x82, 0xd9, 0xfd, + 0x91, 0x16, 0x1f, 0xf3, 0x3f, 0x12, 0x4f, 0xe4, + 0x9e, 0x10, 0xb7, 0x27, 0x74, 0xa4, 0x43, 0x62, + 0xa1, 0x1a, 0x00, 0x50, 0x07, 0x17, 0xfb, 0x6f, + 0xb6, 0x11, 0x6c, 0x0c, 0x00, 0x96, 0xcd, 0x6c, + 0xc0, 0x1d, 0x05, 0x28, 0x0a, 0xb0, 0x1d, 0x60, + 0xcd, 0x23, 0x49, 0x20, 0x00, 0xb6, 0xdf, 0xff, + 0xb6, 0x20, 0xdb, 0xfd, 0xed, 0x36, 0xd6, 0x49, + 0x9f, 0x19, 0x22, 0xf4, 0x67, 0x66, 0x66, 0x66, + 0x99, 0x13, 0x3b, 0x6b, 0xb7, 0xbf, 0xfd, 0xbf, + 0xab, 0x17, 0x4e, 0xf6, 0x2e, 0x02, 0xf2, 0xb7, + 0xb1, 0x11, 0x42, 0x60, 0x26, 0x93, 0xf9, 0x6f, + 0xba, 0x1d, 0x48, 0x84, 0x44, 0x22, 0x59, 0x2e, + 0xbd, 0x1d, 0x29, 0x20, 0x09, 0xb2, 0x4d, 0xb6, + 0xe6, 0x37, 0x6d, 0xb4, 0x91, 0x20, 0x49, 0x77, + 0xe8, 0x42, 0x17, 0xf4, 0x2f, 0x68, 0x56, 0xd5, + 0xc9, 0x54, 0x02, 0x60, 0x26, 0x22, 0x62, 0x26, + 0xcc, 0x21, 0x66, 0x76, 0x67, 0x66, 0x76, 0x67, + 0xcb, 0x27, 0x66, 0x74, 0x67, 0x46, 0x74, 0x2f, + 0xd4, 0x2b, 0x68, 0x66, 0x85, 0x68, 0x56, 0x85, + 0xd2, 0x2b, 0x68, 0x66, 0x86, 0x68, 0x66, 0x86, + 0xd3, 0x25, 0x68, 0x46, 0x45, 0x66, 0x64, 0x27, + 0xf8, 0x32, 0x6d, 0x16, 0x8c, 0x46, 0x61, 0x37, + ]), + decompressed: new Uint8Array([ + 0x7b, 0x00, 0x00, 0xff, 0x7b, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x43, 0x00, 0x00, 0xff, 0x43, 0x00, 0x00, 0xff, + 0x4f, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x4a, 0x00, 0x00, 0xff, + 0x4a, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x42, 0x00, 0x00, 0xff, 0x30, 0x00, 0x00, 0xff, + 0x30, 0x00, 0x00, 0xff, 0x30, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x42, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x42, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x54, 0x00, 0x00, 0xff, 0x6c, 0x00, 0x00, 0xff, + 0x7b, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x27, 0x00, 0x00, 0xff, 0x30, 0x00, 0x00, 0xff, + 0x30, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x2e, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x30, 0x00, 0x00, 0xff, 0x39, 0x00, 0x00, 0xff, + 0x4b, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x7b, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x13, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x27, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x21, 0x00, 0x00, 0xff, 0x30, 0x00, 0x00, 0xff, + 0x42, 0x00, 0x00, 0xff, 0x54, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x21, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x13, 0x00, 0x00, 0xff, + 0x13, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x21, 0x00, 0x00, 0xff, 0x30, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x4b, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x08, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x09, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x08, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x09, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x09, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x06, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x2d, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x2c, 0x00, 0x00, 0xff, 0x2c, 0x00, 0x00, 0xff, + 0x17, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x2d, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x2c, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x4c, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x35, 0x00, 0x00, 0xff, + 0x21, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x04, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x08, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x21, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x2b, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x05, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x21, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x19, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x2b, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x35, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x11, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x13, 0x00, 0x00, 0xff, 0x21, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x35, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x10, 0x00, 0x00, 0xff, 0x10, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x21, 0x00, 0x00, 0xff, + 0x21, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x5d, 0x00, 0x00, 0xff, + 0x49, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x2d, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x2b, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x43, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x55, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x49, 0x00, 0x00, 0xff, 0x2d, 0x00, 0x00, 0xff, + 0x2d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x43, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x55, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x11, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x43, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x55, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x11, 0x00, 0x00, 0xff, 0x09, 0x00, 0x00, 0xff, + 0x02, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0xff, + 0x03, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x16, 0x00, 0x00, 0xff, 0x16, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x31, 0x00, 0x00, 0xff, 0x31, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x55, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x19, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x42, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x65, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x08, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x18, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x29, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x65, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x24, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3c, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x3f, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x65, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x19, 0x00, 0x00, 0xff, 0x19, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0x14, 0x00, 0x00, 0xff, 0x14, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0xff, + 0x24, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x49, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x65, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x2a, 0x00, 0x00, 0xff, 0x18, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0xff, + 0x15, 0x00, 0x00, 0xff, 0x1c, 0x00, 0x00, 0xff, + 0x1c, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x27, 0x00, 0x00, 0xff, 0x2e, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x57, 0x00, 0x00, 0xff, 0x6c, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x52, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1a, 0x00, 0x00, 0xff, 0x1a, 0x00, 0x00, 0xff, + 0x1e, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x23, 0x00, 0x00, 0xff, + 0x2e, 0x00, 0x00, 0xff, 0x2e, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x37, 0x00, 0x00, 0xff, 0x38, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x72, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x23, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x20, 0x00, 0x00, 0xff, 0x20, 0x00, 0x00, 0xff, + 0x1e, 0x00, 0x00, 0xff, 0x1e, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0x2f, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x37, 0x00, 0x00, 0xff, + 0x38, 0x00, 0x00, 0xff, 0x39, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x5d, 0x00, 0x00, 0xff, 0x7b, 0x00, 0x00, 0xff, + 0x52, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x2a, 0x00, 0x00, 0xff, + 0x28, 0x00, 0x00, 0xff, 0x28, 0x00, 0x00, 0xff, + 0x26, 0x00, 0x00, 0xff, 0x26, 0x00, 0x00, 0xff, + 0x1e, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x25, 0x00, 0x00, 0xff, 0x25, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x35, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x39, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x3c, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x57, 0x00, 0x00, 0xff, + 0x6c, 0x00, 0x00, 0xff, 0x83, 0x00, 0x00, 0xff, + 0x60, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x34, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x2b, 0x00, 0x00, 0xff, 0x2b, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x32, 0x00, 0x00, 0xff, 0x32, 0x00, 0x00, 0xff, + 0x35, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x3b, 0x00, 0x00, 0xff, 0x3b, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x40, 0x00, 0x00, 0xff, 0x40, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x3d, 0x00, 0x00, 0xff, + 0x3d, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x51, 0x00, 0x00, 0xff, + 0x60, 0x00, 0x00, 0xff, 0x72, 0x00, 0x00, 0xff, + 0x78, 0x00, 0x00, 0xff, 0x60, 0x00, 0x00, 0xff, + 0x48, 0x00, 0x00, 0xff, 0x34, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3a, 0x00, 0x00, 0xff, 0x3a, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x3e, 0x00, 0x00, 0xff, 0x3e, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x46, 0x00, 0x00, 0xff, 0x46, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x44, 0x00, 0x00, 0xff, 0x44, 0x00, 0x00, 0xff, + 0x41, 0x00, 0x00, 0xff, 0x45, 0x00, 0x00, 0xff, + 0x45, 0x00, 0x00, 0xff, 0x4d, 0x00, 0x00, 0xff, + 0x51, 0x00, 0x00, 0xff, 0x60, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x7b, 0x00, 0x00, 0xff, + 0x97, 0x00, 0x00, 0xff, 0x78, 0x00, 0x00, 0xff, + 0x60, 0x00, 0x00, 0xff, 0x48, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x53, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x50, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x50, 0x00, 0x00, 0xff, + 0x4f, 0x00, 0x00, 0xff, 0x4f, 0x00, 0x00, 0xff, + 0x4f, 0x00, 0x00, 0xff, 0x53, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x50, 0x00, 0x00, 0xff, + 0x50, 0x00, 0x00, 0xff, 0x50, 0x00, 0x00, 0xff, + 0x4e, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x4e, 0x00, 0x00, 0xff, 0x4e, 0x00, 0x00, 0xff, + 0x4d, 0x00, 0x00, 0xff, 0x4d, 0x00, 0x00, 0xff, + 0x57, 0x00, 0x00, 0xff, 0x57, 0x00, 0x00, 0xff, + 0x60, 0x00, 0x00, 0xff, 0x69, 0x00, 0x00, 0xff, + 0x7b, 0x00, 0x00, 0xff, 0x8c, 0x00, 0x00, 0xff, + 0x97, 0x00, 0x00, 0xff, 0x97, 0x00, 0x00, 0xff, + 0x78, 0x00, 0x00, 0xff, 0x78, 0x00, 0x00, 0xff, + 0x6c, 0x00, 0x00, 0xff, 0x6c, 0x00, 0x00, 0xff, + 0x6c, 0x00, 0x00, 0xff, 0x6c, 0x00, 0x00, 0xff, + 0x64, 0x00, 0x00, 0xff, 0x64, 0x00, 0x00, 0xff, + 0x64, 0x00, 0x00, 0xff, 0x64, 0x00, 0x00, 0xff, + 0x5f, 0x00, 0x00, 0xff, 0x5f, 0x00, 0x00, 0xff, + 0x5f, 0x00, 0x00, 0xff, 0x5f, 0x00, 0x00, 0xff, + 0x60, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x5c, 0x00, 0x00, 0xff, 0x5c, 0x00, 0x00, 0xff, + 0x5e, 0x00, 0x00, 0xff, 0x5e, 0x00, 0x00, 0xff, + 0x5e, 0x00, 0x00, 0xff, 0x5e, 0x00, 0x00, 0xff, + 0x57, 0x00, 0x00, 0xff, 0x5f, 0x00, 0x00, 0xff, + 0x63, 0x00, 0x00, 0xff, 0x67, 0x00, 0x00, 0xff, + 0x69, 0x00, 0x00, 0xff, 0x7b, 0x00, 0x00, 0xff, + 0x8c, 0x00, 0x00, 0xff, 0x9b, 0x00, 0x00, 0xff, + ]) +} + +var img_32x32_rg11_eac = { + compressed: new Uint8Array([ + 0xa3, 0x8b, 0x92, 0x08, 0x02, 0x01, 0x12, 0x53, + 0x88, 0x72, 0xdb, 0x5d, 0x68, 0xb4, 0x49, 0x01, + 0x54, 0x30, 0xf2, 0x8d, 0x02, 0xf1, 0x2f, 0x03, + 0x64, 0x30, 0xf2, 0x8d, 0x02, 0xf1, 0x2f, 0x03, + 0x5f, 0x47, 0xd1, 0x1d, 0x42, 0xf0, 0x39, 0x1b, + 0x70, 0x47, 0xd1, 0x1d, 0x42, 0xf0, 0x39, 0x1b, + 0x57, 0x62, 0xa0, 0x2c, 0x0a, 0xd0, 0xab, 0x02, + 0x69, 0x67, 0xa0, 0xbc, 0x13, 0xd1, 0x3b, 0x0b, + 0x54, 0x30, 0xf0, 0x2d, 0x83, 0xda, 0xac, 0x43, + 0x64, 0x30, 0xf0, 0x2d, 0x83, 0xda, 0xac, 0x43, + 0x4a, 0x7b, 0xd4, 0x4d, 0x41, 0xd6, 0x2f, 0x41, + 0x4a, 0x7b, 0xd4, 0x4d, 0x41, 0xd6, 0x2f, 0x41, + 0x71, 0xbd, 0xd1, 0x2d, 0x11, 0xd0, 0xac, 0x02, + 0x5e, 0x44, 0xf5, 0x2f, 0x51, 0xf4, 0xaf, 0x02, + 0x9f, 0x49, 0x48, 0x92, 0x04, 0x92, 0xdb, 0xb7, + 0x85, 0x6b, 0x05, 0x38, 0x0a, 0xb0, 0x1d, 0x60, + 0x69, 0x69, 0xbb, 0x58, 0x00, 0x25, 0x20, 0x9a, + 0x69, 0x69, 0xbb, 0x58, 0x00, 0x25, 0x20, 0x9a, + 0x1c, 0x32, 0xfe, 0xae, 0x10, 0x9c, 0x99, 0x31, + 0x33, 0x44, 0xda, 0x2c, 0x10, 0x19, 0x20, 0x22, + 0x17, 0x22, 0x8a, 0x4e, 0x92, 0xb5, 0x90, 0x03, + 0x24, 0x20, 0x86, 0x4e, 0x49, 0x91, 0xa0, 0x03, + 0x13, 0x3d, 0x18, 0xea, 0x0e, 0x14, 0xbc, 0x1e, + 0x0c, 0x20, 0x9b, 0x7b, 0x37, 0x97, 0x0d, 0x07, + 0x01, 0x8f, 0x96, 0x4b, 0x24, 0x96, 0x4d, 0x2c, + 0x29, 0x3a, 0x54, 0x2a, 0x80, 0x54, 0x2e, 0x2a, + 0x5c, 0x47, 0x29, 0x00, 0xc2, 0x64, 0x26, 0xb0, + 0x41, 0x34, 0xb1, 0x9c, 0x0b, 0x14, 0xb1, 0x31, + 0x6a, 0x44, 0x6a, 0xc0, 0xad, 0x82, 0x61, 0x26, + 0x45, 0x20, 0x66, 0x0a, 0x64, 0xf4, 0x6b, 0xc6, + 0xb4, 0x4b, 0x64, 0x14, 0x80, 0x92, 0x4f, 0xff, + 0x64, 0x47, 0x64, 0x14, 0x80, 0x00, 0x0b, 0x6d, + 0x5d, 0x62, 0xb2, 0xe1, 0x04, 0x24, 0x24, 0x52, + 0x6d, 0x62, 0xb2, 0xe1, 0x04, 0x24, 0x24, 0x52, + 0x17, 0x2a, 0xf7, 0xd5, 0xe8, 0x0b, 0xaa, 0x05, + 0x20, 0x2a, 0xf7, 0xd5, 0xe8, 0x0b, 0xaa, 0x05, + 0x0e, 0x3d, 0x77, 0xb4, 0xe7, 0x49, 0xbb, 0x5b, + 0x1f, 0x30, 0x63, 0x82, 0xaf, 0x24, 0x00, 0x1b, + 0x0d, 0x42, 0x80, 0x18, 0x08, 0xd2, 0x68, 0x25, + 0x0f, 0x2a, 0xf6, 0xaf, 0x45, 0xe0, 0x70, 0x85, + 0x3f, 0x42, 0x09, 0x44, 0x88, 0xa0, 0x6b, 0xad, + 0x17, 0x2a, 0xa9, 0x74, 0x85, 0xa9, 0x7b, 0xed, + 0x6f, 0x23, 0x6f, 0xfb, 0xff, 0xf7, 0xf3, 0xff, + 0x06, 0xb2, 0xb6, 0xdd, 0x6d, 0xba, 0xd9, 0x6d, + 0xa3, 0x37, 0x2e, 0xf6, 0x7f, 0xaf, 0xfb, 0x7f, + 0x1c, 0x5d, 0x73, 0x88, 0xc0, 0xf0, 0x0f, 0xc0, + 0x7a, 0xb5, 0xdb, 0x6d, 0xb6, 0xdf, 0xff, 0xff, + 0x5a, 0xbd, 0x8a, 0x24, 0x92, 0x80, 0x0d, 0xb6, + 0x63, 0x50, 0xb7, 0x69, 0x24, 0x12, 0x46, 0xd4, + 0x71, 0x67, 0xdb, 0xfb, 0xae, 0x12, 0x46, 0xd4, + 0x1a, 0x3c, 0x84, 0xf2, 0xdb, 0x2d, 0xb6, 0xdb, + 0x1a, 0x3c, 0x84, 0xf2, 0xdb, 0x2d, 0xb6, 0xdb, + 0x01, 0x2f, 0x02, 0x78, 0x04, 0xb4, 0x0b, 0x6d, + 0x01, 0x20, 0x02, 0x68, 0x04, 0xd8, 0x0d, 0xb6, + 0x2e, 0x42, 0x40, 0x04, 0x24, 0x82, 0xeb, 0xb6, + 0x28, 0x2a, 0x56, 0xd5, 0x7f, 0x0a, 0xfb, 0xff, + 0x64, 0x47, 0x42, 0x48, 0xa6, 0x9e, 0xff, 0xbe, + 0x31, 0x20, 0x66, 0xda, 0xef, 0x58, 0x6d, 0x34, + 0xab, 0x20, 0x49, 0x04, 0x10, 0x4c, 0x2d, 0xb6, + 0x2e, 0x20, 0x92, 0x69, 0xa6, 0x83, 0x46, 0xdb, + 0xd9, 0x2b, 0x6d, 0x12, 0x44, 0x12, 0xeb, 0xbf, + 0x0a, 0x19, 0x25, 0x28, 0x01, 0xb6, 0x4f, 0xb5, + 0xe5, 0x1f, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0x4c, 0x4c, 0x6d, 0xb0, 0x49, 0xb6, 0xcf, 0xff, + 0x55, 0x47, 0xff, 0x6f, 0x24, 0x90, 0x08, 0x52, + 0x4d, 0x62, 0xfe, 0xdf, 0xa4, 0xd8, 0x0d, 0x49, + 0x2f, 0x5a, 0xf4, 0x20, 0x00, 0x66, 0xd4, 0xd1, + 0x32, 0x52, 0xfa, 0x19, 0x24, 0x68, 0x06, 0xda, + 0x03, 0x85, 0x92, 0xd9, 0x2d, 0x96, 0xdb, 0x2f, + 0x03, 0x85, 0x90, 0x09, 0x28, 0x96, 0xd1, 0x2f, + 0x5b, 0x20, 0x6c, 0x00, 0x06, 0xc3, 0xfd, 0xbf, + 0x39, 0x20, 0x6c, 0x00, 0x06, 0xc0, 0x0d, 0x80, + 0x89, 0x42, 0x46, 0x00, 0xa5, 0x82, 0x51, 0x34, + 0x47, 0x42, 0x10, 0xaa, 0x08, 0xd4, 0x8b, 0xa1, + 0xc1, 0x36, 0x60, 0x00, 0xc0, 0x16, 0xdb, 0x6d, + 0x15, 0x22, 0x9f, 0xff, 0x3f, 0xe9, 0x24, 0x92, + 0xe4, 0x11, 0x6c, 0x01, 0xb6, 0xb6, 0x4f, 0xfd, + 0x07, 0x1a, 0x49, 0x24, 0x00, 0xb4, 0x0f, 0xfd, + 0xee, 0x2d, 0x48, 0x92, 0x04, 0x92, 0xdb, 0xb6, + 0x33, 0xb2, 0x00, 0x09, 0x24, 0xb6, 0xdd, 0xb6, + 0x75, 0x31, 0x9b, 0x64, 0x84, 0x2d, 0x96, 0xc9, + 0x58, 0x72, 0xbb, 0x60, 0x25, 0x04, 0x82, 0x40, + 0x4b, 0x3a, 0x02, 0xd4, 0xad, 0x0b, 0xf1, 0x6f, + 0x1b, 0x45, 0xb7, 0xf9, 0x3f, 0xb0, 0x0b, 0xf8, + 0x46, 0x8f, 0x9b, 0x6b, 0xf6, 0x9f, 0xfd, 0xbf, + 0x1f, 0x32, 0x9f, 0xf6, 0x7f, 0x84, 0x9f, 0xc9, + 0x85, 0x47, 0x93, 0xc5, 0x3e, 0x82, 0xe1, 0x34, + 0x2e, 0x4a, 0xda, 0x21, 0xa0, 0xd4, 0x8b, 0x82, + 0xa5, 0x20, 0x00, 0x60, 0x07, 0x1b, 0xfd, 0xb7, + 0x1a, 0x10, 0xff, 0xbf, 0xf8, 0xec, 0x06, 0xd8, + 0xdb, 0x24, 0x6c, 0x0c, 0x00, 0x96, 0xcd, 0x6c, + 0x02, 0xfd, 0x00, 0x0a, 0x00, 0x00, 0x08, 0x00, + 0xeb, 0x2d, 0x80, 0xab, 0x01, 0xb0, 0x1d, 0x60, + 0x09, 0x1a, 0x69, 0x22, 0x48, 0x92, 0x5d, 0xb6, + 0xed, 0x03, 0x6d, 0xb4, 0x92, 0xb6, 0xdf, 0xff, + 0x4d, 0x5c, 0x6d, 0xb0, 0x49, 0xb6, 0xdf, 0xff, + 0x9a, 0x33, 0x92, 0xd9, 0x40, 0x3b, 0x66, 0x49, + 0x65, 0x5f, 0xdb, 0xfd, 0xed, 0x12, 0x46, 0x00, + 0x94, 0x37, 0x66, 0x66, 0x66, 0x42, 0xf4, 0x2f, + 0x30, 0x29, 0xdb, 0xf9, 0x2d, 0x24, 0x06, 0xd2, + 0x94, 0x20, 0x5b, 0x61, 0xb7, 0x1f, 0xfd, 0xbf, + 0x00, 0x46, 0xdb, 0x6f, 0xb7, 0xff, 0xfd, 0xbf, + 0xc3, 0x27, 0x4e, 0xf6, 0x2e, 0x02, 0xf2, 0xb7, + 0x06, 0x2b, 0xb2, 0xf9, 0xee, 0xfe, 0xfd, 0x77, + 0xd3, 0x2b, 0x66, 0x62, 0x66, 0x93, 0xf9, 0x6f, + 0x0b, 0x10, 0x6a, 0x74, 0xa7, 0x6e, 0xd6, 0x4d, + 0xe1, 0x2d, 0x44, 0x82, 0x04, 0x12, 0x59, 0x6e, + 0x07, 0x19, 0x42, 0x64, 0x2e, 0x32, 0xf3, 0x2f, + 0xe6, 0x2d, 0x04, 0xa8, 0x01, 0xb2, 0x0d, 0x6c, + 0x11, 0x10, 0x6d, 0x14, 0x44, 0x12, 0xeb, 0xbf, + 0xed, 0x2d, 0x05, 0x28, 0x0a, 0xb0, 0x1d, 0x60, + 0x64, 0x51, 0x68, 0x92, 0x04, 0x92, 0xdb, 0xbf, + 0xdc, 0x37, 0x17, 0xf4, 0x2f, 0x66, 0x66, 0xce, + 0x87, 0x62, 0x97, 0x61, 0x2e, 0x44, 0x44, 0x8c, + 0xc7, 0x72, 0x92, 0xe9, 0x2e, 0x12, 0xe1, 0x2e, + 0x55, 0x47, 0x02, 0xf0, 0x2f, 0x42, 0xf4, 0x2f, + 0xd8, 0xdd, 0x12, 0xe1, 0x2e, 0x12, 0xe1, 0x2e, + 0x51, 0x4c, 0x62, 0xf6, 0x2f, 0x66, 0x76, 0x67, + 0xe5, 0x12, 0x68, 0x56, 0x66, 0x42, 0xf3, 0x37, + 0x03, 0xef, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0xe5, 0x1f, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0x4a, 0x47, 0x62, 0xf6, 0x67, 0x66, 0x76, 0x66, + 0xdf, 0x2f, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0x02, 0xdf, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0xe9, 0x1b, 0x64, 0x46, 0x45, 0x46, 0x54, 0x26, + 0x4d, 0x41, 0x66, 0x54, 0x26, 0x42, 0xf3, 0x2f, + 0xea, 0x2d, 0x46, 0x54, 0x26, 0x22, 0xe3, 0x2e, + 0x8c, 0x40, 0x68, 0x84, 0x44, 0x12, 0xe9, 0x77, + ]), + decompressed: new Uint8Array([ + 0xab, 0xb9, 0x00, 0xff, 0xab, 0xb9, 0x00, 0xff, + 0x93, 0xa4, 0x00, 0xff, 0x7b, 0x8f, 0x00, 0xff, + 0x7e, 0x8e, 0x00, 0xff, 0x6c, 0x7c, 0x00, 0xff, + 0x7e, 0x8e, 0x00, 0xff, 0x7e, 0x8e, 0x00, 0xff, + 0x7b, 0x8c, 0x00, 0xff, 0x7b, 0x8c, 0x00, 0xff, + 0x87, 0x98, 0x00, 0xff, 0x67, 0x78, 0x00, 0xff, + 0x6f, 0x81, 0x00, 0xff, 0x81, 0x93, 0x00, 0xff, + 0x81, 0x93, 0x00, 0xff, 0x6f, 0x81, 0x00, 0xff, + 0x7e, 0x8e, 0x00, 0xff, 0x6c, 0x7c, 0x00, 0xff, + 0x6c, 0x7c, 0x00, 0xff, 0x6c, 0x7c, 0x00, 0xff, + 0x74, 0x74, 0x00, 0xff, 0x74, 0x74, 0x00, 0xff, + 0x74, 0x74, 0x00, 0xff, 0x89, 0x89, 0x00, 0xff, + 0x87, 0x8a, 0x00, 0xff, 0x87, 0x8a, 0x00, 0xff, + 0x87, 0x8a, 0x00, 0xff, 0x87, 0x8a, 0x00, 0xff, + 0x7f, 0x79, 0x00, 0xff, 0x8b, 0x8b, 0x00, 0xff, + 0xa3, 0x9d, 0x00, 0xff, 0xaf, 0xa9, 0x00, 0xff, + 0xab, 0xb9, 0x00, 0xff, 0x93, 0xa4, 0x00, 0xff, + 0x93, 0xa4, 0x00, 0xff, 0x7b, 0x8f, 0x00, 0xff, + 0x5a, 0x6a, 0x00, 0xff, 0x5a, 0x6a, 0x00, 0xff, + 0x5a, 0x6a, 0x00, 0xff, 0x5a, 0x6a, 0x00, 0xff, + 0x67, 0x78, 0x00, 0xff, 0x6f, 0x80, 0x00, 0xff, + 0x67, 0x78, 0x00, 0xff, 0x67, 0x78, 0x00, 0xff, + 0x4b, 0x57, 0x00, 0xff, 0x4b, 0x57, 0x00, 0xff, + 0x5d, 0x75, 0x00, 0xff, 0x5d, 0x75, 0x00, 0xff, + 0x5a, 0x6a, 0x00, 0xff, 0x6c, 0x7c, 0x00, 0xff, + 0x6c, 0x7c, 0x00, 0xff, 0x42, 0x52, 0x00, 0xff, + 0x66, 0x66, 0x00, 0xff, 0x66, 0x66, 0x00, 0xff, + 0x66, 0x66, 0x00, 0xff, 0x66, 0x66, 0x00, 0xff, + 0x71, 0x72, 0x00, 0xff, 0x71, 0x72, 0x00, 0xff, + 0x71, 0x72, 0x00, 0xff, 0x66, 0x66, 0x00, 0xff, + 0x7f, 0x67, 0x00, 0xff, 0x97, 0x79, 0x00, 0xff, + 0xa3, 0x8b, 0x00, 0xff, 0xbb, 0x9d, 0x00, 0xff, + 0xab, 0xb9, 0x00, 0xff, 0x93, 0xa4, 0x00, 0xff, + 0x6b, 0x7a, 0x00, 0xff, 0x6b, 0x7a, 0x00, 0xff, + 0x63, 0x73, 0x00, 0xff, 0x4b, 0x5b, 0x00, 0xff, + 0x39, 0x49, 0x00, 0xff, 0x4b, 0x5b, 0x00, 0xff, + 0x3f, 0x50, 0x00, 0xff, 0x53, 0x64, 0x00, 0xff, + 0x53, 0x64, 0x00, 0xff, 0x33, 0x44, 0x00, 0xff, + 0x4b, 0x4b, 0x00, 0xff, 0x39, 0x39, 0x00, 0xff, + 0x39, 0x39, 0x00, 0xff, 0x4b, 0x4b, 0x00, 0xff, + 0x4b, 0x5b, 0x00, 0xff, 0x4b, 0x5b, 0x00, 0xff, + 0x63, 0x73, 0x00, 0xff, 0x4b, 0x5b, 0x00, 0xff, + 0x3c, 0x3c, 0x00, 0xff, 0x3c, 0x3c, 0x00, 0xff, + 0x51, 0x51, 0x00, 0xff, 0x3c, 0x3c, 0x00, 0xff, + 0x50, 0x3e, 0x00, 0xff, 0x50, 0x3e, 0x00, 0xff, + 0x5b, 0x46, 0x00, 0xff, 0x66, 0x52, 0x00, 0xff, + 0x8b, 0x5b, 0x00, 0xff, 0x97, 0x67, 0x00, 0xff, + 0xaf, 0x79, 0x00, 0xff, 0xbb, 0x8b, 0x00, 0xff, + 0x93, 0xa4, 0x00, 0xff, 0x6b, 0x7a, 0x00, 0xff, + 0x7b, 0x8f, 0x00, 0xff, 0x53, 0x65, 0x00, 0xff, + 0x4b, 0x5b, 0x00, 0xff, 0x39, 0x49, 0x00, 0xff, + 0x39, 0x49, 0x00, 0xff, 0x27, 0x37, 0x00, 0xff, + 0x4b, 0x5c, 0x00, 0xff, 0x3f, 0x50, 0x00, 0xff, + 0x33, 0x44, 0x00, 0xff, 0x33, 0x44, 0x00, 0xff, + 0x27, 0x27, 0x00, 0xff, 0x27, 0x27, 0x00, 0xff, + 0x27, 0x27, 0x00, 0xff, 0x27, 0x27, 0x00, 0xff, + 0x39, 0x49, 0x00, 0xff, 0x27, 0x37, 0x00, 0xff, + 0x39, 0x49, 0x00, 0xff, 0x27, 0x37, 0x00, 0xff, + 0x51, 0x51, 0x00, 0xff, 0x27, 0x27, 0x00, 0xff, + 0x19, 0x19, 0x00, 0xff, 0x27, 0x27, 0x00, 0xff, + 0x50, 0x3e, 0x00, 0xff, 0x5b, 0x46, 0x00, 0xff, + 0x50, 0x3e, 0x00, 0xff, 0x50, 0x3e, 0x00, 0xff, + 0x8b, 0x49, 0x00, 0xff, 0xa3, 0x5b, 0x00, 0xff, + 0xaf, 0x67, 0x00, 0xff, 0xc3, 0x79, 0x00, 0xff, + 0x81, 0x81, 0x00, 0xff, 0x6f, 0x6f, 0x00, 0xff, + 0x4b, 0x4b, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x40, 0x4f, 0x00, 0xff, 0x40, 0x4f, 0x00, 0xff, + 0x1f, 0x27, 0x00, 0xff, 0x1f, 0x27, 0x00, 0xff, + 0x19, 0x28, 0x00, 0xff, 0x2f, 0x40, 0x00, 0xff, + 0x1f, 0x28, 0x00, 0xff, 0x13, 0x1e, 0x00, 0xff, + 0x10, 0x10, 0x00, 0xff, 0x16, 0x16, 0x00, 0xff, + 0x10, 0x10, 0x00, 0xff, 0x19, 0x1c, 0x00, 0xff, + 0x11, 0x11, 0x00, 0xff, 0x21, 0x32, 0x00, 0xff, + 0x11, 0x11, 0x00, 0xff, 0x31, 0x44, 0x00, 0xff, + 0x48, 0x50, 0x00, 0xff, 0x50, 0x56, 0x00, 0xff, + 0x30, 0x38, 0x00, 0xff, 0x30, 0x38, 0x00, 0xff, + 0x3a, 0x27, 0x00, 0xff, 0x5e, 0x4f, 0x00, 0xff, + 0x72, 0x61, 0x00, 0xff, 0x5e, 0x4f, 0x00, 0xff, + 0x8c, 0x38, 0x00, 0xff, 0x98, 0x44, 0x00, 0xff, + 0xb8, 0x58, 0x00, 0xff, 0xd8, 0x74, 0x00, 0xff, + 0x93, 0x93, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x4b, 0x4b, 0x00, 0xff, 0x39, 0x39, 0x00, 0xff, + 0x40, 0x4f, 0x00, 0xff, 0x16, 0x27, 0x00, 0xff, + 0x40, 0x4f, 0x00, 0xff, 0x1f, 0x27, 0x00, 0xff, + 0x07, 0x18, 0x00, 0xff, 0x07, 0x18, 0x00, 0xff, + 0x1f, 0x28, 0x00, 0xff, 0x13, 0x1e, 0x00, 0xff, + 0x19, 0x1c, 0x00, 0xff, 0x10, 0x10, 0x00, 0xff, + 0x16, 0x16, 0x00, 0xff, 0x10, 0x10, 0x00, 0xff, + 0x21, 0x32, 0x00, 0xff, 0x11, 0x11, 0x00, 0xff, + 0x21, 0x32, 0x00, 0xff, 0x11, 0x23, 0x00, 0xff, + 0x3c, 0x47, 0x00, 0xff, 0x30, 0x38, 0x00, 0xff, + 0x48, 0x50, 0x00, 0xff, 0x3c, 0x47, 0x00, 0xff, + 0x4a, 0x39, 0x00, 0xff, 0x4a, 0x39, 0x00, 0xff, + 0x5e, 0x4f, 0x00, 0xff, 0x72, 0x61, 0x00, 0xff, + 0xa0, 0x50, 0x00, 0xff, 0x98, 0x44, 0x00, 0xff, + 0xb8, 0x58, 0x00, 0xff, 0xd8, 0x74, 0x00, 0xff, + 0x93, 0x93, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x39, 0x39, 0x00, 0xff, 0x2d, 0x2d, 0x00, 0xff, + 0x28, 0x3b, 0x00, 0xff, 0x04, 0x13, 0x00, 0xff, + 0x0d, 0x13, 0x00, 0xff, 0x31, 0x3b, 0x00, 0xff, + 0x19, 0x28, 0x00, 0xff, 0x07, 0x18, 0x00, 0xff, + 0x00, 0x06, 0x00, 0xff, 0x13, 0x1e, 0x00, 0xff, + 0x0d, 0x1c, 0x00, 0xff, 0x0d, 0x1c, 0x00, 0xff, + 0x0d, 0x1c, 0x00, 0xff, 0x00, 0x06, 0x00, 0xff, + 0x11, 0x23, 0x00, 0xff, 0x11, 0x23, 0x00, 0xff, + 0x11, 0x23, 0x00, 0xff, 0x21, 0x32, 0x00, 0xff, + 0x3c, 0x1d, 0x00, 0xff, 0x50, 0x2f, 0x00, 0xff, + 0x50, 0x2f, 0x00, 0xff, 0x78, 0x56, 0x00, 0xff, + 0x7e, 0x49, 0x00, 0xff, 0x7e, 0x49, 0x00, 0xff, + 0x72, 0x3f, 0x00, 0xff, 0x72, 0x3f, 0x00, 0xff, + 0xac, 0x58, 0x00, 0xff, 0xac, 0x58, 0x00, 0xff, + 0xb8, 0x58, 0x00, 0xff, 0xd8, 0x74, 0x00, 0xff, + 0x81, 0x81, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x39, 0x39, 0x00, 0xff, 0x39, 0x39, 0x00, 0xff, + 0x04, 0x13, 0x00, 0xff, 0x16, 0x27, 0x00, 0xff, + 0x0d, 0x13, 0x00, 0xff, 0x0d, 0x13, 0x00, 0xff, + 0x19, 0x28, 0x00, 0xff, 0x07, 0x18, 0x00, 0xff, + 0x0d, 0x12, 0x00, 0xff, 0x00, 0x06, 0x00, 0xff, + 0x19, 0x28, 0x00, 0xff, 0x19, 0x28, 0x00, 0xff, + 0x00, 0x06, 0x00, 0xff, 0x19, 0x28, 0x00, 0xff, + 0x11, 0x11, 0x00, 0xff, 0x11, 0x23, 0x00, 0xff, + 0x11, 0x11, 0x00, 0xff, 0x11, 0x11, 0x00, 0xff, + 0x50, 0x2f, 0x00, 0xff, 0x3c, 0x1d, 0x00, 0xff, + 0x3c, 0x1d, 0x00, 0xff, 0x50, 0x2f, 0x00, 0xff, + 0x72, 0x3f, 0x00, 0xff, 0x7e, 0x49, 0x00, 0xff, + 0x86, 0x55, 0x00, 0xff, 0x86, 0x55, 0x00, 0xff, + 0xa0, 0x50, 0x00, 0xff, 0xac, 0x58, 0x00, 0xff, + 0xb8, 0x58, 0x00, 0xff, 0xd8, 0x74, 0x00, 0xff, + 0x75, 0x85, 0x00, 0xff, 0x51, 0x61, 0x00, 0xff, + 0x3f, 0x4f, 0x00, 0xff, 0x2d, 0x3d, 0x00, 0xff, + 0x29, 0x32, 0x00, 0xff, 0x07, 0x10, 0x00, 0xff, + 0x13, 0x1c, 0x00, 0xff, 0x1d, 0x26, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x05, 0x0d, 0x00, 0xff, + 0x05, 0x0d, 0x00, 0xff, 0x11, 0x16, 0x00, 0xff, + 0x11, 0x21, 0x00, 0xff, 0x11, 0x21, 0x00, 0xff, + 0x29, 0x21, 0x00, 0xff, 0x11, 0x0b, 0x00, 0xff, + 0x37, 0x1d, 0x00, 0xff, 0x1f, 0x07, 0x00, 0xff, + 0x4f, 0x1d, 0x00, 0xff, 0x4f, 0x1d, 0x00, 0xff, + 0x55, 0x32, 0x00, 0xff, 0x75, 0x53, 0x00, 0xff, + 0x87, 0x32, 0x00, 0xff, 0x67, 0x11, 0x00, 0xff, + 0x94, 0x00, 0x00, 0xff, 0x82, 0x1c, 0x00, 0xff, + 0xaf, 0x49, 0x00, 0xff, 0xaf, 0x49, 0x00, 0xff, + 0xd2, 0x5a, 0x00, 0xff, 0xd2, 0x39, 0x00, 0xff, + 0xd2, 0x5a, 0x00, 0xff, 0xe8, 0x70, 0x00, 0xff, + 0x63, 0x73, 0x00, 0xff, 0x63, 0x73, 0x00, 0xff, + 0x3f, 0x4f, 0x00, 0xff, 0x3f, 0x4f, 0x00, 0xff, + 0x1d, 0x26, 0x00, 0xff, 0x29, 0x32, 0x00, 0xff, + 0x07, 0x10, 0x00, 0xff, 0x13, 0x1c, 0x00, 0xff, + 0x11, 0x16, 0x00, 0xff, 0x00, 0x04, 0x00, 0xff, + 0x05, 0x0d, 0x00, 0xff, 0x11, 0x16, 0x00, 0xff, + 0x05, 0x15, 0x00, 0xff, 0x05, 0x15, 0x00, 0xff, + 0x11, 0x0b, 0x00, 0xff, 0x05, 0x00, 0x00, 0xff, + 0x1f, 0x07, 0x00, 0xff, 0x1f, 0x07, 0x00, 0xff, + 0x37, 0x07, 0x00, 0xff, 0x5b, 0x29, 0x00, 0xff, + 0x55, 0x32, 0x00, 0xff, 0x87, 0x32, 0x00, 0xff, + 0x75, 0x53, 0x00, 0xff, 0x87, 0x32, 0x00, 0xff, + 0x82, 0x1c, 0x00, 0xff, 0x94, 0x00, 0x00, 0xff, + 0x82, 0x1c, 0x00, 0xff, 0xaf, 0x49, 0x00, 0xff, + 0xd2, 0x39, 0x00, 0xff, 0xd2, 0x39, 0x00, 0xff, + 0xe8, 0x4f, 0x00, 0xff, 0xe8, 0x70, 0x00, 0xff, + 0x75, 0x85, 0x00, 0xff, 0x51, 0x61, 0x00, 0xff, + 0x51, 0x61, 0x00, 0xff, 0x2d, 0x3d, 0x00, 0xff, + 0x29, 0x32, 0x00, 0xff, 0x1d, 0x26, 0x00, 0xff, + 0x29, 0x32, 0x00, 0xff, 0x13, 0x1c, 0x00, 0xff, + 0x29, 0x49, 0x00, 0xff, 0x0e, 0x2e, 0x00, 0xff, + 0x00, 0x16, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x05, 0x15, 0x00, 0xff, 0x00, 0x0b, 0x00, 0xff, + 0x11, 0x0b, 0x00, 0xff, 0x11, 0x0b, 0x00, 0xff, + 0x1f, 0x07, 0x00, 0xff, 0x2b, 0x13, 0x00, 0xff, + 0x37, 0x07, 0x00, 0xff, 0x4f, 0x1d, 0x00, 0xff, + 0x87, 0x32, 0x00, 0xff, 0x87, 0x32, 0x00, 0xff, + 0x87, 0x32, 0x00, 0xff, 0x87, 0x32, 0x00, 0xff, + 0xaf, 0x49, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xd2, 0x5a, 0x00, 0xff, 0xd2, 0x39, 0x00, 0xff, + 0xe8, 0x4f, 0x00, 0xff, 0xe8, 0x70, 0x00, 0xff, + 0x87, 0x97, 0x00, 0xff, 0x63, 0x73, 0x00, 0xff, + 0x2d, 0x3d, 0x00, 0xff, 0x2d, 0x3d, 0x00, 0xff, + 0x1d, 0x26, 0x00, 0xff, 0x13, 0x1c, 0x00, 0xff, + 0x07, 0x10, 0x00, 0xff, 0x1d, 0x26, 0x00, 0xff, + 0x00, 0x16, 0x00, 0xff, 0x29, 0x49, 0x00, 0xff, + 0x00, 0x16, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x05, 0x15, 0x00, 0xff, + 0x29, 0x21, 0x00, 0xff, 0x1d, 0x15, 0x00, 0xff, + 0x43, 0x29, 0x00, 0xff, 0x37, 0x1d, 0x00, 0xff, + 0x5b, 0x29, 0x00, 0xff, 0x4f, 0x1d, 0x00, 0xff, + 0x87, 0x32, 0x00, 0xff, 0x87, 0x32, 0x00, 0xff, + 0x87, 0x32, 0x00, 0xff, 0x87, 0x32, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xd2, 0x39, 0x00, 0xff, 0xd2, 0x39, 0x00, 0xff, + 0xe8, 0x4f, 0x00, 0xff, 0xe8, 0x70, 0x00, 0xff, + 0x7c, 0x9b, 0x00, 0xff, 0x6d, 0x89, 0x00, 0xff, + 0x54, 0x5f, 0x00, 0xff, 0x18, 0x2f, 0x00, 0xff, + 0x20, 0x20, 0x00, 0xff, 0x0e, 0x0e, 0x00, 0xff, + 0x0e, 0x0e, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x05, 0x05, 0x00, 0xff, + 0x09, 0x11, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x0e, 0x18, 0x00, 0xff, 0x0e, 0x18, 0x00, 0xff, + 0x32, 0x24, 0x00, 0xff, 0x3e, 0x2e, 0x00, 0xff, + 0x44, 0x13, 0x00, 0xff, 0x6c, 0x3b, 0x00, 0xff, + 0x6c, 0x1f, 0x00, 0xff, 0x8c, 0x41, 0x00, 0xff, + 0x99, 0x32, 0x00, 0xff, 0x99, 0x32, 0x00, 0xff, + 0x99, 0x32, 0x00, 0xff, 0xbb, 0x10, 0x00, 0xff, + 0xc5, 0x05, 0x00, 0xff, 0xcf, 0x0b, 0x00, 0xff, + 0xd5, 0x0e, 0x00, 0xff, 0xe1, 0x13, 0x00, 0xff, + 0xe7, 0x24, 0x00, 0xff, 0xe7, 0x40, 0x00, 0xff, + 0xe7, 0x58, 0x00, 0xff, 0xe7, 0x70, 0x00, 0xff, + 0x7c, 0x9b, 0x00, 0xff, 0x6d, 0x9b, 0x00, 0xff, + 0x6d, 0x7d, 0x00, 0xff, 0x18, 0x2f, 0x00, 0xff, + 0x0e, 0x0e, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x09, 0x11, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x26, 0x2e, 0x00, 0xff, 0x26, 0x2e, 0x00, 0xff, + 0x26, 0x18, 0x00, 0xff, 0x4a, 0x3a, 0x00, 0xff, + 0x58, 0x25, 0x00, 0xff, 0x44, 0x13, 0x00, 0xff, + 0x8c, 0x41, 0x00, 0xff, 0x80, 0x35, 0x00, 0xff, + 0x99, 0x32, 0x00, 0xff, 0xa5, 0x3e, 0x00, 0xff, + 0x8d, 0x28, 0x00, 0xff, 0xbb, 0x10, 0x00, 0xff, + 0xc5, 0x05, 0x00, 0xff, 0xcf, 0x08, 0x00, 0xff, + 0xdb, 0x0e, 0x00, 0xff, 0xe5, 0x11, 0x00, 0xff, + 0xe9, 0x24, 0x00, 0xff, 0xe9, 0x3c, 0x00, 0xff, + 0xe9, 0x58, 0x00, 0xff, 0xe9, 0x70, 0x00, 0xff, + 0x8b, 0xad, 0x00, 0xff, 0x6d, 0x89, 0x00, 0xff, + 0x6d, 0x7d, 0x00, 0xff, 0x36, 0x41, 0x00, 0xff, + 0x0e, 0x0e, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x05, 0x05, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x26, 0x2e, 0x00, 0xff, 0x32, 0x3a, 0x00, 0xff, + 0x3e, 0x2e, 0x00, 0xff, 0x4a, 0x3a, 0x00, 0xff, + 0x6c, 0x3b, 0x00, 0xff, 0x6c, 0x3b, 0x00, 0xff, + 0x74, 0x2b, 0x00, 0xff, 0x8c, 0x41, 0x00, 0xff, + 0x99, 0x32, 0x00, 0xff, 0x99, 0x32, 0x00, 0xff, + 0xa5, 0x3e, 0x00, 0xff, 0xbb, 0x10, 0x00, 0xff, + 0xcb, 0x02, 0x00, 0xff, 0xd5, 0x08, 0x00, 0xff, + 0xe1, 0x0b, 0x00, 0xff, 0xeb, 0x11, 0x00, 0xff, + 0xeb, 0x24, 0x00, 0xff, 0xeb, 0x3c, 0x00, 0xff, + 0xeb, 0x58, 0x00, 0xff, 0xeb, 0x70, 0x00, 0xff, + 0x8b, 0xad, 0x00, 0xff, 0x6d, 0x9b, 0x00, 0xff, + 0x6d, 0x7d, 0x00, 0xff, 0x6d, 0x7d, 0x00, 0xff, + 0x35, 0x35, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x11, 0x11, 0x00, 0xff, 0x05, 0x05, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x26, 0x2e, 0x00, 0xff, 0x32, 0x3a, 0x00, 0xff, + 0x4a, 0x3a, 0x00, 0xff, 0x4a, 0x3a, 0x00, 0xff, + 0x6c, 0x3b, 0x00, 0xff, 0x80, 0x4d, 0x00, 0xff, + 0x8c, 0x41, 0x00, 0xff, 0x80, 0x35, 0x00, 0xff, + 0xa5, 0x3e, 0x00, 0xff, 0xa5, 0x3e, 0x00, 0xff, + 0x99, 0x32, 0x00, 0xff, 0xbb, 0x10, 0x00, 0xff, + 0xcf, 0x02, 0x00, 0xff, 0xdb, 0x05, 0x00, 0xff, + 0xe5, 0x0b, 0x00, 0xff, 0xeb, 0x0e, 0x00, 0xff, + 0xed, 0x24, 0x00, 0xff, 0xed, 0x3c, 0x00, 0xff, + 0xed, 0x54, 0x00, 0xff, 0xed, 0x70, 0x00, 0xff, + 0x7d, 0x95, 0x00, 0xff, 0x7d, 0x95, 0x00, 0xff, + 0x5d, 0x77, 0x00, 0xff, 0x5d, 0x77, 0x00, 0xff, + 0x5c, 0x6e, 0x00, 0xff, 0x25, 0x37, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x13, 0x13, 0x00, 0xff, 0x13, 0x13, 0x00, 0xff, + 0x13, 0x13, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3d, 0x1b, 0x00, 0xff, 0x55, 0x33, 0x00, 0xff, + 0x6b, 0x49, 0x00, 0xff, 0x6b, 0x49, 0x00, 0xff, + 0x69, 0x3f, 0x00, 0xff, 0x81, 0x57, 0x00, 0xff, + 0x8d, 0x63, 0x00, 0xff, 0x81, 0x57, 0x00, 0xff, + 0xa0, 0x17, 0x00, 0xff, 0xb5, 0x2d, 0x00, 0xff, + 0xb5, 0x2d, 0x00, 0xff, 0xd3, 0x05, 0x00, 0xff, + 0xd7, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x00, 0xff, + 0xea, 0x0a, 0x00, 0xff, 0xf0, 0x10, 0x00, 0xff, + 0xe8, 0x1d, 0x00, 0xff, 0xea, 0x3e, 0x00, 0xff, + 0xee, 0x5f, 0x00, 0xff, 0xf0, 0x80, 0x00, 0xff, + 0x7d, 0x95, 0x00, 0xff, 0x5d, 0x77, 0x00, 0xff, + 0x5d, 0x77, 0x00, 0xff, 0x41, 0x65, 0x00, 0xff, + 0x3e, 0x55, 0x00, 0xff, 0x25, 0x37, 0x00, 0xff, + 0x1b, 0x0a, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x13, 0x13, 0x00, 0xff, 0x13, 0x13, 0x00, 0xff, + 0x33, 0x33, 0x00, 0xff, 0x13, 0x13, 0x00, 0xff, + 0x3d, 0x1b, 0x00, 0xff, 0x55, 0x33, 0x00, 0xff, + 0x55, 0x33, 0x00, 0xff, 0x6b, 0x49, 0x00, 0xff, + 0x75, 0x4b, 0x00, 0xff, 0x69, 0x3f, 0x00, 0xff, + 0x81, 0x57, 0x00, 0xff, 0x8d, 0x63, 0x00, 0xff, + 0xb5, 0x2d, 0x00, 0xff, 0xa0, 0x17, 0x00, 0xff, + 0xd3, 0x05, 0x00, 0xff, 0xd3, 0x05, 0x00, 0xff, + 0xd7, 0x00, 0x00, 0xff, 0xed, 0x05, 0x00, 0xff, + 0xea, 0x0a, 0x00, 0xff, 0xf0, 0x10, 0x00, 0xff, + 0xe8, 0x1d, 0x00, 0xff, 0xec, 0x3e, 0x00, 0xff, + 0xee, 0x5f, 0x00, 0xff, 0xf2, 0x80, 0x00, 0xff, + 0x71, 0x65, 0x00, 0xff, 0x5d, 0x53, 0x00, 0xff, + 0x49, 0x41, 0x00, 0xff, 0x35, 0x2f, 0x00, 0xff, + 0x25, 0x37, 0x00, 0xff, 0x25, 0x37, 0x00, 0xff, + 0x3e, 0x28, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x33, 0x00, 0xff, + 0x33, 0x33, 0x00, 0xff, 0x33, 0x33, 0x00, 0xff, + 0x55, 0x33, 0x00, 0xff, 0x55, 0x33, 0x00, 0xff, + 0x77, 0x33, 0x00, 0xff, 0x77, 0x33, 0x00, 0xff, + 0x8d, 0x33, 0x00, 0xff, 0x8d, 0x33, 0x00, 0xff, + 0x8d, 0x33, 0x00, 0xff, 0xa5, 0x4b, 0x00, 0xff, + 0xb5, 0x2d, 0x00, 0xff, 0xb5, 0x2d, 0x00, 0xff, + 0xd3, 0x05, 0x00, 0xff, 0xd3, 0x05, 0x00, 0xff, + 0xe1, 0x00, 0x00, 0xff, 0xed, 0x05, 0x00, 0xff, + 0xe6, 0x05, 0x00, 0xff, 0xf0, 0x10, 0x00, 0xff, + 0xea, 0x1d, 0x00, 0xff, 0xec, 0x3e, 0x00, 0xff, + 0xf0, 0x5f, 0x00, 0xff, 0xf2, 0x80, 0x00, 0xff, + 0x71, 0x65, 0x00, 0xff, 0x5d, 0x53, 0x00, 0xff, + 0x49, 0x41, 0x00, 0xff, 0x35, 0x2f, 0x00, 0xff, + 0x07, 0x19, 0x00, 0xff, 0x25, 0x37, 0x00, 0xff, + 0x3e, 0x28, 0x00, 0xff, 0x1b, 0x0a, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x33, 0x33, 0x00, 0xff, 0x53, 0x53, 0x00, 0xff, + 0x55, 0x33, 0x00, 0xff, 0x6b, 0x49, 0x00, 0xff, + 0x77, 0x33, 0x00, 0xff, 0x77, 0x33, 0x00, 0xff, + 0x81, 0x27, 0x00, 0xff, 0x99, 0x3f, 0x00, 0xff, + 0x99, 0x3f, 0x00, 0xff, 0x8d, 0x33, 0x00, 0xff, + 0xb5, 0x2d, 0x00, 0xff, 0xb5, 0x2d, 0x00, 0xff, + 0xd3, 0x05, 0x00, 0xff, 0xd3, 0x05, 0x00, 0xff, + 0xe1, 0x00, 0x00, 0xff, 0xed, 0x05, 0x00, 0xff, + 0xe6, 0x05, 0x00, 0xff, 0xea, 0x0a, 0x00, 0xff, + 0xea, 0x1d, 0x00, 0xff, 0xee, 0x3e, 0x00, 0xff, + 0xf0, 0x5f, 0x00, 0xff, 0xf2, 0x80, 0x00, 0xff, + 0x7b, 0x74, 0x00, 0xff, 0x57, 0x4a, 0x00, 0xff, + 0x60, 0x4a, 0x00, 0xff, 0x4e, 0x35, 0x00, 0xff, + 0x45, 0x33, 0x00, 0xff, 0x33, 0x23, 0x00, 0xff, + 0x45, 0x33, 0x00, 0xff, 0x45, 0x33, 0x00, 0xff, + 0x56, 0x22, 0x00, 0xff, 0x66, 0x00, 0x00, 0xff, + 0x56, 0x22, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x8d, 0x4a, 0x00, 0xff, 0x65, 0x26, 0x00, 0xff, + 0x8d, 0x4a, 0x00, 0xff, 0x79, 0x3a, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0x9f, 0x28, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0xb5, 0x0b, 0x00, 0xff, + 0xc3, 0x00, 0x00, 0xff, 0xe9, 0x11, 0x00, 0xff, + 0xdf, 0x00, 0x00, 0xff, 0xe9, 0x02, 0x00, 0xff, + 0xeb, 0x00, 0x00, 0xff, 0xed, 0x05, 0x00, 0xff, + 0xed, 0x0a, 0x00, 0xff, 0xef, 0x10, 0x00, 0xff, + 0xeb, 0x1b, 0x00, 0xff, 0xec, 0x3e, 0x00, 0xff, + 0xed, 0x5c, 0x00, 0xff, 0xef, 0x7a, 0x00, 0xff, + 0x90, 0x89, 0x00, 0xff, 0x57, 0x4a, 0x00, 0xff, + 0x4e, 0x35, 0x00, 0xff, 0x4e, 0x35, 0x00, 0xff, + 0x45, 0x33, 0x00, 0xff, 0x33, 0x23, 0x00, 0xff, + 0x33, 0x23, 0x00, 0xff, 0x54, 0x43, 0x00, 0xff, + 0x76, 0x43, 0x00, 0xff, 0x86, 0x10, 0x00, 0xff, + 0x86, 0x10, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x8d, 0x4a, 0x00, 0xff, 0x8d, 0x4a, 0x00, 0xff, + 0x79, 0x3a, 0x00, 0xff, 0x8d, 0x4a, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0x9f, 0x28, 0x00, 0xff, + 0xb5, 0x0b, 0x00, 0xff, 0xb5, 0x0b, 0x00, 0xff, + 0xc3, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xe5, 0x00, 0x00, 0xff, 0xe5, 0x00, 0x00, 0xff, + 0xe9, 0x01, 0x00, 0xff, 0xeb, 0x05, 0x00, 0xff, + 0xeb, 0x0a, 0x00, 0xff, 0xed, 0x10, 0x00, 0xff, + 0xeb, 0x1b, 0x00, 0xff, 0xec, 0x39, 0x00, 0xff, + 0xed, 0x5c, 0x00, 0xff, 0xef, 0x7a, 0x00, 0xff, + 0x90, 0x89, 0x00, 0xff, 0x6c, 0x5f, 0x00, 0xff, + 0x4e, 0x35, 0x00, 0xff, 0x60, 0x4a, 0x00, 0xff, + 0x54, 0x43, 0x00, 0xff, 0x54, 0x43, 0x00, 0xff, + 0x66, 0x0f, 0x00, 0xff, 0x54, 0x43, 0x00, 0xff, + 0x76, 0x43, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x86, 0x10, 0x00, 0xff, 0x86, 0x10, 0x00, 0xff, + 0xad, 0x32, 0x00, 0xff, 0xad, 0x32, 0x00, 0xff, + 0x95, 0x1e, 0x00, 0xff, 0xa1, 0x26, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0x9f, 0x28, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xb5, 0x0b, 0x00, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xe5, 0x00, 0x00, 0xff, 0xe5, 0x00, 0x00, 0xff, + 0xe7, 0x01, 0x00, 0xff, 0xe9, 0x05, 0x00, 0xff, + 0xe9, 0x0a, 0x00, 0xff, 0xeb, 0x10, 0x00, 0xff, + 0xeb, 0x1b, 0x00, 0xff, 0xec, 0x39, 0x00, 0xff, + 0xed, 0x5c, 0x00, 0xff, 0xef, 0x7a, 0x00, 0xff, + 0x90, 0x89, 0x00, 0xff, 0x7b, 0x74, 0x00, 0xff, + 0x60, 0x4a, 0x00, 0xff, 0x60, 0x4a, 0x00, 0xff, + 0x54, 0x43, 0x00, 0xff, 0x54, 0x43, 0x00, 0xff, + 0x66, 0x0f, 0x00, 0xff, 0x66, 0x0f, 0x00, 0xff, + 0x76, 0x43, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x86, 0x10, 0x00, 0xff, 0x86, 0x10, 0x00, 0xff, + 0x8d, 0x0e, 0x00, 0xff, 0xa1, 0x26, 0x00, 0xff, + 0xa1, 0x26, 0x00, 0xff, 0x8d, 0x0e, 0x00, 0xff, + 0xb5, 0x0b, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xdf, 0x00, 0x00, 0xff, 0xdf, 0x00, 0x00, 0xff, + 0xe5, 0x01, 0x00, 0xff, 0xe7, 0x07, 0x00, 0xff, + 0xe7, 0x0c, 0x00, 0xff, 0xe9, 0x10, 0x00, 0xff, + 0xeb, 0x1b, 0x00, 0xff, 0xec, 0x39, 0x00, 0xff, + 0xed, 0x5c, 0x00, 0xff, 0xef, 0x7a, 0x00, 0xff, + 0x9d, 0x83, 0x00, 0xff, 0x9d, 0x83, 0x00, 0xff, + 0x8e, 0x56, 0x00, 0xff, 0x73, 0x38, 0x00, 0xff, + 0x73, 0x3e, 0x00, 0xff, 0x73, 0x32, 0x00, 0xff, + 0x7c, 0x26, 0x00, 0xff, 0x7c, 0x1c, 0x00, 0xff, + 0x82, 0x1c, 0x00, 0xff, 0x8e, 0x28, 0x00, 0xff, + 0x8e, 0x28, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xb3, 0x0e, 0x00, 0xff, 0xad, 0x08, 0x00, 0xff, + 0xbd, 0x18, 0x00, 0xff, 0xb9, 0x12, 0x00, 0xff, + 0xbf, 0x00, 0x00, 0xff, 0xc9, 0x02, 0x00, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xdb, 0x00, 0x00, 0xff, 0xdd, 0x00, 0x00, 0xff, + 0xdf, 0x02, 0x00, 0xff, 0xe1, 0x02, 0x00, 0xff, + 0xe4, 0x02, 0x00, 0xff, 0xe6, 0x08, 0x00, 0xff, + 0xe8, 0x0e, 0x00, 0xff, 0xea, 0x16, 0x00, 0xff, + 0xeb, 0x23, 0x00, 0xff, 0xed, 0x41, 0x00, 0xff, + 0xef, 0x6e, 0x00, 0xff, 0xf1, 0x82, 0x00, 0xff, + 0x9d, 0x83, 0x00, 0xff, 0xa3, 0x8d, 0x00, 0xff, + 0xa9, 0x6f, 0x00, 0xff, 0x8e, 0x56, 0x00, 0xff, + 0x85, 0x3e, 0x00, 0xff, 0x85, 0x32, 0x00, 0xff, + 0x8b, 0x26, 0x00, 0xff, 0x8b, 0x1c, 0x00, 0xff, + 0xa4, 0x1c, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xb0, 0x28, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xad, 0x08, 0x00, 0xff, 0xbd, 0x18, 0x00, 0xff, + 0xbd, 0x18, 0x00, 0xff, 0xb3, 0x0e, 0x00, 0xff, + 0xc9, 0x02, 0x00, 0xff, 0xc9, 0x02, 0x00, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xdb, 0x05, 0x00, 0xff, + 0xdd, 0x05, 0x00, 0xff, 0xdf, 0x05, 0x00, 0xff, + 0xe1, 0x08, 0x00, 0xff, 0xe3, 0x08, 0x00, 0xff, + 0xe2, 0x02, 0x00, 0xff, 0xe4, 0x0b, 0x00, 0xff, + 0xe6, 0x13, 0x00, 0xff, 0xe8, 0x19, 0x00, 0xff, + 0xe9, 0x32, 0x00, 0xff, 0xeb, 0x55, 0x00, 0xff, + 0xed, 0x6e, 0x00, 0xff, 0xef, 0x91, 0x00, 0xff, + 0xa3, 0x8d, 0x00, 0xff, 0x94, 0x79, 0x00, 0xff, + 0xa9, 0x6f, 0x00, 0xff, 0x8e, 0x56, 0x00, 0xff, + 0x9a, 0x42, 0x00, 0xff, 0x9a, 0x38, 0x00, 0xff, + 0xa0, 0x2c, 0x00, 0xff, 0xa0, 0x20, 0x00, 0xff, + 0xa4, 0x1c, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xb0, 0x28, 0x00, 0xff, 0xb0, 0x28, 0x00, 0xff, + 0xcb, 0x0e, 0x00, 0xff, 0xcb, 0x0e, 0x00, 0xff, + 0xcb, 0x0e, 0x00, 0xff, 0xd1, 0x12, 0x00, 0xff, + 0xd5, 0x0d, 0x00, 0xff, 0xd5, 0x0d, 0x00, 0xff, + 0xe5, 0x10, 0x00, 0xff, 0xdb, 0x05, 0x00, 0xff, + 0xdd, 0x08, 0x00, 0xff, 0xdf, 0x0b, 0x00, 0xff, + 0xe1, 0x0b, 0x00, 0xff, 0xe3, 0x0b, 0x00, 0xff, + 0xe2, 0x08, 0x00, 0xff, 0xe4, 0x0e, 0x00, 0xff, + 0xe6, 0x16, 0x00, 0xff, 0xe8, 0x1f, 0x00, 0xff, + 0xe7, 0x41, 0x00, 0xff, 0xe9, 0x55, 0x00, 0xff, + 0xeb, 0x82, 0x00, 0xff, 0xed, 0xa0, 0x00, 0xff, + 0xa3, 0x8d, 0x00, 0xff, 0x94, 0x79, 0x00, 0xff, + 0xa9, 0x6f, 0x00, 0xff, 0x8e, 0x56, 0x00, 0xff, + 0xa9, 0x42, 0x00, 0xff, 0xa9, 0x38, 0x00, 0xff, + 0xb2, 0x2c, 0x00, 0xff, 0xb2, 0x20, 0x00, 0xff, + 0xa4, 0x1c, 0x00, 0xff, 0xb0, 0x28, 0x00, 0xff, + 0xb0, 0x28, 0x00, 0xff, 0xb0, 0x28, 0x00, 0xff, + 0xd7, 0x18, 0x00, 0xff, 0xd1, 0x12, 0x00, 0xff, + 0xd7, 0x18, 0x00, 0xff, 0xd7, 0x18, 0x00, 0xff, + 0xdf, 0x19, 0x00, 0xff, 0xdf, 0x19, 0x00, 0xff, + 0xe5, 0x10, 0x00, 0xff, 0xe5, 0x10, 0x00, 0xff, + 0xdf, 0x0e, 0x00, 0xff, 0xe1, 0x0e, 0x00, 0xff, + 0xe3, 0x10, 0x00, 0xff, 0xe5, 0x10, 0x00, 0xff, + 0xe0, 0x0b, 0x00, 0xff, 0xe2, 0x13, 0x00, 0xff, + 0xe4, 0x19, 0x00, 0xff, 0xe6, 0x1f, 0x00, 0xff, + 0xe7, 0x41, 0x00, 0xff, 0xe7, 0x6e, 0x00, 0xff, + 0xe9, 0x82, 0x00, 0xff, 0xeb, 0xa0, 0x00, 0xff, + 0xd3, 0x8d, 0x00, 0xff, 0xc4, 0x7b, 0x00, 0xff, + 0xbb, 0x57, 0x00, 0xff, 0xbb, 0x57, 0x00, 0xff, + 0xce, 0x49, 0x00, 0xff, 0xce, 0x49, 0x00, 0xff, + 0xb9, 0x35, 0x00, 0xff, 0xb9, 0x35, 0x00, 0xff, + 0xcb, 0x29, 0x00, 0xff, 0xcb, 0x29, 0x00, 0xff, + 0xcb, 0x29, 0x00, 0xff, 0xcb, 0x29, 0x00, 0xff, + 0xd8, 0x1f, 0x00, 0xff, 0xd8, 0x1f, 0x00, 0xff, + 0xdd, 0x1f, 0x00, 0xff, 0xe0, 0x1f, 0x00, 0xff, + 0xe7, 0x1e, 0x00, 0xff, 0xe7, 0x1e, 0x00, 0xff, + 0xe7, 0x1e, 0x00, 0xff, 0xe7, 0x1e, 0x00, 0xff, + 0xe3, 0x1c, 0x00, 0xff, 0xe3, 0x1c, 0x00, 0xff, + 0xe3, 0x1c, 0x00, 0xff, 0xe3, 0x1c, 0x00, 0xff, + 0xdf, 0x19, 0x00, 0xff, 0xdf, 0x25, 0x00, 0xff, + 0xe2, 0x25, 0x00, 0xff, 0xe2, 0x31, 0x00, 0xff, + 0xe4, 0x50, 0x00, 0xff, 0xe4, 0x68, 0x00, 0xff, + 0xe6, 0x80, 0x00, 0xff, 0xe6, 0x94, 0x00, 0xff, + 0xe8, 0x9f, 0x00, 0xff, 0xd3, 0x8d, 0x00, 0xff, + 0xcd, 0x69, 0x00, 0xff, 0xbb, 0x57, 0x00, 0xff, + 0xce, 0x49, 0x00, 0xff, 0xce, 0x49, 0x00, 0xff, + 0xce, 0x49, 0x00, 0xff, 0xce, 0x49, 0x00, 0xff, + 0xd8, 0x45, 0x00, 0xff, 0xd8, 0x45, 0x00, 0xff, + 0xd8, 0x41, 0x00, 0xff, 0xd8, 0x41, 0x00, 0xff, + 0xdd, 0x3b, 0x00, 0xff, 0xe0, 0x3b, 0x00, 0xff, + 0xe3, 0x3b, 0x00, 0xff, 0xe6, 0x3b, 0x00, 0xff, + 0xe9, 0x3e, 0x00, 0xff, 0xe9, 0x36, 0x00, 0xff, + 0xe9, 0x36, 0x00, 0xff, 0xe9, 0x36, 0x00, 0xff, + 0xe7, 0x36, 0x00, 0xff, 0xe7, 0x36, 0x00, 0xff, + 0xe7, 0x36, 0x00, 0xff, 0xe7, 0x36, 0x00, 0xff, + 0xe4, 0x31, 0x00, 0xff, 0xe4, 0x41, 0x00, 0xff, + 0xe4, 0x41, 0x00, 0xff, 0xe7, 0x55, 0x00, 0xff, + 0xe6, 0x68, 0x00, 0xff, 0xe8, 0x74, 0x00, 0xff, + 0xe8, 0x94, 0x00, 0xff, 0xea, 0xa0, 0x00, 0xff, + 0xfa, 0xb1, 0x00, 0xff, 0xe8, 0x9f, 0x00, 0xff, + 0xe2, 0x7b, 0x00, 0xff, 0xcd, 0x69, 0x00, 0xff, + 0xe3, 0x65, 0x00, 0xff, 0xe3, 0x65, 0x00, 0xff, + 0xe3, 0x65, 0x00, 0xff, 0xe3, 0x65, 0x00, 0xff, + 0xe5, 0x5d, 0x00, 0xff, 0xe5, 0x5d, 0x00, 0xff, + 0xe5, 0x59, 0x00, 0xff, 0xe5, 0x59, 0x00, 0xff, + 0xe3, 0x57, 0x00, 0xff, 0xe6, 0x57, 0x00, 0xff, + 0xe9, 0x57, 0x00, 0xff, 0xec, 0x57, 0x00, 0xff, + 0xeb, 0x5a, 0x00, 0xff, 0xeb, 0x52, 0x00, 0xff, + 0xeb, 0x52, 0x00, 0xff, 0xeb, 0x52, 0x00, 0xff, + 0xeb, 0x50, 0x00, 0xff, 0xeb, 0x50, 0x00, 0xff, + 0xeb, 0x50, 0x00, 0xff, 0xeb, 0x50, 0x00, 0xff, + 0xe7, 0x55, 0x00, 0xff, 0xe7, 0x55, 0x00, 0xff, + 0xea, 0x65, 0x00, 0xff, 0xea, 0x65, 0x00, 0xff, + 0xea, 0x74, 0x00, 0xff, 0xea, 0x80, 0x00, 0xff, + 0xec, 0xa0, 0x00, 0xff, 0xec, 0xac, 0x00, 0xff, + 0xfa, 0xb1, 0x00, 0xff, 0xfa, 0xb1, 0x00, 0xff, + 0xf1, 0x8d, 0x00, 0xff, 0xf1, 0x8d, 0x00, 0xff, + 0xf8, 0x7d, 0x00, 0xff, 0xf8, 0x7d, 0x00, 0xff, + 0xf8, 0x7d, 0x00, 0xff, 0xf8, 0x7d, 0x00, 0xff, + 0xf2, 0x75, 0x00, 0xff, 0xf2, 0x75, 0x00, 0xff, + 0xf2, 0x75, 0x00, 0xff, 0xf2, 0x75, 0x00, 0xff, + 0xe9, 0x73, 0x00, 0xff, 0xec, 0x73, 0x00, 0xff, + 0xf1, 0x73, 0x00, 0xff, 0xf1, 0x73, 0x00, 0xff, + 0xed, 0x72, 0x00, 0xff, 0xed, 0x72, 0x00, 0xff, + 0xed, 0x72, 0x00, 0xff, 0xed, 0x66, 0x00, 0xff, + 0xef, 0x6a, 0x00, 0xff, 0xef, 0x6a, 0x00, 0xff, + 0xef, 0x6a, 0x00, 0xff, 0xef, 0x6a, 0x00, 0xff, + 0xea, 0x65, 0x00, 0xff, 0xed, 0x71, 0x00, 0xff, + 0xed, 0x7d, 0x00, 0xff, 0xef, 0x7d, 0x00, 0xff, + 0xec, 0x80, 0x00, 0xff, 0xee, 0x94, 0x00, 0xff, + 0xee, 0xac, 0x00, 0xff, 0xee, 0xc4, 0x00, 0xff, + ]) +} + +var img_32x32_signed_rg11_eac = { + compressed: new Uint8Array([ + 0x24, 0x8b, 0x92, 0x08, 0x02, 0x01, 0x12, 0x53, + 0x09, 0x72, 0xdb, 0x5d, 0x68, 0xb4, 0x49, 0x01, + 0xd6, 0x62, 0xd2, 0x0b, 0x01, 0xd0, 0x9d, 0x02, + 0xe6, 0x62, 0xd2, 0x0b, 0x01, 0xd0, 0x9d, 0x02, + 0xe0, 0x47, 0xd1, 0x1d, 0x42, 0xf0, 0x39, 0x1b, + 0xf1, 0x47, 0xd1, 0x1d, 0x42, 0xf0, 0x39, 0x1b, + 0xd8, 0x62, 0xa0, 0x2c, 0x0a, 0xd0, 0xab, 0x02, + 0xd8, 0x69, 0xd0, 0x2f, 0x0a, 0xf4, 0xad, 0x42, + 0xd4, 0x30, 0xf0, 0x2d, 0x83, 0xda, 0xac, 0x43, + 0xe4, 0x30, 0xf0, 0x2d, 0x83, 0xda, 0xac, 0x43, + 0xcb, 0x7b, 0xd4, 0x4d, 0x41, 0xd6, 0x2f, 0x41, + 0xcb, 0x7b, 0xd4, 0x4d, 0x41, 0xd6, 0x2f, 0x41, + 0xf2, 0xbd, 0xd1, 0x2d, 0x11, 0xd0, 0xac, 0x02, + 0xe0, 0x47, 0xf5, 0x2f, 0x51, 0xf4, 0xaf, 0x02, + 0x1f, 0x49, 0x48, 0x92, 0x04, 0x92, 0xdb, 0xb7, + 0xf5, 0x6b, 0x80, 0xab, 0x01, 0xd6, 0x0f, 0xac, + 0xe9, 0x69, 0xbb, 0x58, 0x00, 0x25, 0x20, 0x9a, + 0xe9, 0x69, 0xbb, 0x58, 0x00, 0x25, 0x20, 0x9a, + 0x9d, 0x32, 0xfe, 0xae, 0x10, 0x9c, 0x99, 0x31, + 0xb2, 0x3c, 0xfe, 0xbe, 0x18, 0x1d, 0xb0, 0x2b, + 0x90, 0x3c, 0xa2, 0xde, 0x00, 0xd9, 0x09, 0x22, + 0xa5, 0x20, 0x86, 0x4e, 0x49, 0x91, 0xa0, 0x03, + 0x93, 0x3d, 0x18, 0xea, 0x0e, 0x14, 0xbc, 0x1e, + 0x98, 0x2a, 0x32, 0xf0, 0x6f, 0x22, 0xa8, 0x57, + 0x82, 0x8f, 0x96, 0x4b, 0x24, 0x96, 0x4d, 0x2c, + 0xa9, 0x3a, 0x54, 0x2a, 0x80, 0x54, 0x2e, 0x2a, + 0xdd, 0x47, 0x29, 0x00, 0xc2, 0x64, 0x26, 0xb0, + 0xb7, 0x4b, 0xd5, 0x0f, 0x02, 0x98, 0x29, 0x78, + 0xea, 0x44, 0x6a, 0xc0, 0xad, 0x82, 0x61, 0x26, + 0xc5, 0x20, 0x66, 0x0a, 0x64, 0xf4, 0x6b, 0xc6, + 0x35, 0x4b, 0x64, 0x14, 0x80, 0x92, 0x4f, 0xff, + 0xe5, 0x47, 0x64, 0x14, 0x80, 0x00, 0x0b, 0x6d, + 0xdd, 0x62, 0xb2, 0xe1, 0x04, 0x24, 0x24, 0x52, + 0xed, 0x62, 0xb2, 0xe1, 0x04, 0x24, 0x24, 0x52, + 0x97, 0x2a, 0xf7, 0xd5, 0xe8, 0x0b, 0xaa, 0x05, + 0xa0, 0x2a, 0xf7, 0xd5, 0xe8, 0x0b, 0xaa, 0x05, + 0x8e, 0x3d, 0x77, 0xb4, 0xe7, 0x49, 0xbb, 0x5b, + 0xa0, 0x30, 0x63, 0x82, 0xaf, 0x24, 0x00, 0x1b, + 0x8e, 0x42, 0x80, 0x18, 0x08, 0xd2, 0x68, 0x25, + 0x8f, 0x2a, 0xf6, 0xaf, 0x45, 0xe0, 0x70, 0x85, + 0xc0, 0x42, 0x09, 0x44, 0x88, 0xa0, 0x6b, 0xad, + 0x97, 0x2a, 0xa9, 0x74, 0x85, 0xa9, 0x7b, 0xed, + 0xf0, 0x23, 0x6f, 0xfb, 0xff, 0xf7, 0xf3, 0xff, + 0x87, 0xb2, 0xb6, 0xdd, 0x6d, 0xba, 0xd9, 0x6d, + 0x24, 0x37, 0x2e, 0xf6, 0x7f, 0xaf, 0xfb, 0x7f, + 0xa7, 0x4c, 0x63, 0x90, 0xc9, 0xe0, 0x9f, 0xc9, + 0xfb, 0xb5, 0xdb, 0x6d, 0xb6, 0xdf, 0xff, 0xff, + 0xdb, 0xbd, 0x8a, 0x24, 0x92, 0x80, 0x0d, 0xb6, + 0xe3, 0x50, 0xb7, 0x69, 0x24, 0x12, 0x46, 0xd4, + 0xf1, 0x67, 0xdb, 0xfb, 0xae, 0x12, 0x46, 0xd4, + 0x9b, 0x3c, 0x84, 0xf2, 0xdb, 0x2d, 0xb6, 0xdb, + 0x9b, 0x3c, 0x84, 0xf2, 0xdb, 0x2d, 0xb6, 0xdb, + 0x80, 0x2f, 0x02, 0x78, 0x04, 0xb4, 0x0b, 0x6d, + 0x80, 0x20, 0x02, 0x68, 0x04, 0xd8, 0x0d, 0xb6, + 0xaf, 0x42, 0x40, 0x04, 0x24, 0x82, 0xeb, 0xb6, + 0xa8, 0x2a, 0x56, 0xd5, 0x7f, 0x0a, 0xfb, 0xff, + 0xe5, 0x47, 0x42, 0x48, 0xa6, 0x9e, 0xff, 0xbe, + 0xb2, 0x20, 0x66, 0xda, 0xef, 0x58, 0x6d, 0x34, + 0x20, 0x20, 0x00, 0x41, 0x04, 0x0a, 0x0f, 0xff, + 0xaf, 0x20, 0x92, 0x69, 0xa6, 0x83, 0x46, 0xdb, + 0x5a, 0x2b, 0x6d, 0x14, 0x44, 0x12, 0xdb, 0xbf, + 0x8b, 0x19, 0x25, 0x28, 0x01, 0xb6, 0x4f, 0xb5, + 0x66, 0x1f, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0xcd, 0x4c, 0x6d, 0xb0, 0x49, 0xb6, 0xcf, 0xff, + 0xd5, 0x47, 0xff, 0x6f, 0x24, 0x90, 0x08, 0x12, + 0xcd, 0x62, 0xfe, 0xdf, 0xa4, 0xd8, 0x0d, 0x49, + 0xb0, 0x5a, 0xf4, 0x20, 0x00, 0x66, 0xd4, 0xd1, + 0xb3, 0x52, 0xfa, 0x19, 0x24, 0x68, 0x06, 0xda, + 0x83, 0x85, 0x92, 0xd9, 0x2d, 0x96, 0xdb, 0x2f, + 0x83, 0x85, 0x90, 0x09, 0x28, 0x96, 0xd1, 0x2f, + 0xdc, 0x20, 0x6c, 0x00, 0x06, 0xc3, 0xfd, 0xbf, + 0xaf, 0x20, 0x4a, 0x49, 0x27, 0xf2, 0x4f, 0xe4, + 0x0a, 0x42, 0x46, 0x00, 0xa5, 0x82, 0x51, 0x34, + 0xc8, 0x42, 0x10, 0xaa, 0x08, 0xd4, 0x8b, 0xa1, + 0x41, 0x36, 0x60, 0x00, 0xc0, 0x16, 0xdb, 0x6d, + 0x92, 0x3c, 0x9f, 0xff, 0x3f, 0xe4, 0x92, 0x49, + 0x64, 0x11, 0x6c, 0x01, 0xb6, 0xb6, 0x4f, 0xfd, + 0x89, 0x1a, 0x6d, 0xb6, 0x49, 0x90, 0x0d, 0xb4, + 0x6f, 0x2d, 0x49, 0x12, 0x40, 0x12, 0x5b, 0x76, + 0xb3, 0xb2, 0x00, 0x09, 0x24, 0xb6, 0xdd, 0xb6, + 0xf6, 0x31, 0x9b, 0x64, 0x84, 0x2d, 0x96, 0xc9, + 0xd9, 0x72, 0xbb, 0x60, 0x25, 0x04, 0x82, 0x40, + 0xcb, 0x3a, 0x02, 0xd4, 0xad, 0x0b, 0xf1, 0x6f, + 0xa9, 0x3a, 0xb7, 0xf0, 0x3f, 0xa1, 0x2b, 0xfa, + 0xf0, 0x23, 0x76, 0xd3, 0xed, 0x7f, 0xfb, 0x7f, + 0x9f, 0x32, 0x9f, 0xf6, 0x7f, 0x84, 0x9f, 0xc9, + 0x06, 0x47, 0x93, 0xc5, 0x3e, 0x82, 0xe1, 0x34, + 0xb6, 0x32, 0xd8, 0x33, 0x81, 0xd1, 0x19, 0x8b, + 0x26, 0x20, 0x00, 0x60, 0x07, 0x1b, 0xfd, 0xb7, + 0x9a, 0x10, 0xff, 0xbf, 0xf8, 0xec, 0x06, 0xd8, + 0x5b, 0x24, 0x6c, 0x0c, 0x00, 0x96, 0xcd, 0x6c, + 0x82, 0xfd, 0x00, 0x0a, 0x00, 0x00, 0x08, 0x00, + 0x6b, 0x2d, 0x80, 0xab, 0x01, 0xb0, 0x1d, 0x60, + 0x89, 0x1a, 0x69, 0x22, 0x00, 0x96, 0xdd, 0xb7, + 0x6d, 0x00, 0x49, 0x20, 0x00, 0xdb, 0x6f, 0xff, + 0xce, 0x5c, 0x6d, 0xb2, 0x49, 0xb6, 0xcf, 0xff, + 0x1b, 0x33, 0x92, 0xd9, 0x40, 0x3b, 0x66, 0x49, + 0xe6, 0x5f, 0xdb, 0xfd, 0xed, 0x12, 0x46, 0x00, + 0x15, 0x37, 0x66, 0x66, 0x66, 0x42, 0xf4, 0x2f, + 0xb1, 0x29, 0xdb, 0xf9, 0x2d, 0x24, 0x06, 0xd2, + 0x15, 0x20, 0x5b, 0x61, 0xb7, 0x1f, 0xfd, 0xbf, + 0x84, 0x41, 0xb6, 0xdd, 0x6e, 0xdb, 0x6b, 0x76, + 0x43, 0x27, 0x4e, 0xf6, 0x2e, 0x02, 0xf2, 0xb7, + 0x86, 0x2b, 0xb2, 0xf9, 0xee, 0xfe, 0xfd, 0x77, + 0x54, 0x2b, 0x66, 0x62, 0x66, 0x93, 0xf9, 0x6f, + 0x8b, 0x2a, 0x46, 0x62, 0x66, 0x4a, 0xd4, 0x05, + 0x61, 0x2d, 0x44, 0x82, 0x04, 0x12, 0x59, 0x6e, + 0x88, 0x1b, 0x62, 0x64, 0x26, 0x22, 0xf3, 0x2f, + 0x66, 0x2d, 0x04, 0xa8, 0x01, 0xb2, 0x0d, 0x6c, + 0x91, 0x10, 0x6d, 0x14, 0x44, 0x12, 0xeb, 0xbf, + 0x6c, 0x2d, 0x80, 0xab, 0x01, 0xd6, 0x0d, 0xac, + 0xe7, 0x6b, 0x6d, 0x12, 0x44, 0x92, 0xed, 0xbf, + 0x5d, 0x37, 0x17, 0xf4, 0x2f, 0x66, 0x66, 0xce, + 0x07, 0x62, 0x97, 0x61, 0x2e, 0x44, 0x44, 0x8c, + 0x47, 0x72, 0x92, 0xe9, 0x2e, 0x12, 0xe1, 0x2e, + 0xd5, 0x47, 0x02, 0xf0, 0x2f, 0x42, 0xf4, 0x2f, + 0x59, 0xdd, 0x12, 0xe1, 0x2e, 0x12, 0xe1, 0x2e, + 0xd2, 0x4c, 0x62, 0xf6, 0x2f, 0x66, 0x76, 0x67, + 0x66, 0x12, 0x68, 0x56, 0x66, 0x42, 0xf3, 0x37, + 0x83, 0xef, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0x66, 0x1f, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0xc7, 0x47, 0x42, 0xf6, 0x2f, 0x62, 0xf6, 0x67, + 0x60, 0x2f, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0x83, 0xdf, 0x97, 0x79, 0x77, 0x97, 0x79, 0x77, + 0x66, 0x1b, 0x42, 0x62, 0x2e, 0x32, 0xf1, 0x2f, + 0xcd, 0x5b, 0x66, 0x64, 0x26, 0x42, 0xf3, 0x37, + 0x6b, 0x2d, 0x44, 0x54, 0x65, 0x42, 0x62, 0x2e, + 0x0d, 0x40, 0x68, 0x84, 0x44, 0x12, 0xe9, 0x77, + ]), + decompressed: new Uint8Array([ + 0xab, 0xb9, 0x00, 0xff, 0xab, 0xb9, 0x00, 0xff, + 0x93, 0xa4, 0x00, 0xff, 0x7c, 0x8f, 0x00, 0xff, + 0x80, 0x8f, 0x00, 0xff, 0x6e, 0x7e, 0x00, 0xff, + 0x80, 0x8f, 0x00, 0xff, 0x80, 0x8f, 0x00, 0xff, + 0x7c, 0x8c, 0x00, 0xff, 0x7c, 0x8c, 0x00, 0xff, + 0x87, 0x98, 0x00, 0xff, 0x68, 0x79, 0x00, 0xff, + 0x70, 0x81, 0x00, 0xff, 0x81, 0x8d, 0x00, 0xff, + 0x81, 0x8d, 0x00, 0xff, 0x70, 0x81, 0x00, 0xff, + 0x7e, 0x8d, 0x00, 0xff, 0x6c, 0x7c, 0x00, 0xff, + 0x6c, 0x7c, 0x00, 0xff, 0x6c, 0x7c, 0x00, 0xff, + 0x75, 0x75, 0x00, 0xff, 0x75, 0x75, 0x00, 0xff, + 0x75, 0x75, 0x00, 0xff, 0x89, 0x89, 0x00, 0xff, + 0x87, 0x87, 0x00, 0xff, 0x87, 0x87, 0x00, 0xff, + 0x87, 0x87, 0x00, 0xff, 0x87, 0x87, 0x00, 0xff, + 0x7f, 0x7b, 0x00, 0xff, 0x8a, 0x8c, 0x00, 0xff, + 0xa2, 0x98, 0x00, 0xff, 0xae, 0xaa, 0x00, 0xff, + 0xab, 0xb9, 0x00, 0xff, 0x93, 0xa4, 0x00, 0xff, + 0x93, 0xa4, 0x00, 0xff, 0x7c, 0x8f, 0x00, 0xff, + 0x5c, 0x6c, 0x00, 0xff, 0x5c, 0x6c, 0x00, 0xff, + 0x5c, 0x6c, 0x00, 0xff, 0x5c, 0x6c, 0x00, 0xff, + 0x68, 0x79, 0x00, 0xff, 0x70, 0x80, 0x00, 0xff, + 0x68, 0x79, 0x00, 0xff, 0x68, 0x79, 0x00, 0xff, + 0x4c, 0x5e, 0x00, 0xff, 0x4c, 0x5e, 0x00, 0xff, + 0x5e, 0x70, 0x00, 0xff, 0x5e, 0x70, 0x00, 0xff, + 0x5a, 0x6a, 0x00, 0xff, 0x6c, 0x7c, 0x00, 0xff, + 0x6c, 0x7c, 0x00, 0xff, 0x42, 0x52, 0x00, 0xff, + 0x67, 0x67, 0x00, 0xff, 0x67, 0x67, 0x00, 0xff, + 0x67, 0x67, 0x00, 0xff, 0x67, 0x67, 0x00, 0xff, + 0x72, 0x70, 0x00, 0xff, 0x72, 0x70, 0x00, 0xff, + 0x72, 0x70, 0x00, 0xff, 0x67, 0x68, 0x00, 0xff, + 0x7f, 0x69, 0x00, 0xff, 0x96, 0x7b, 0x00, 0xff, + 0xa2, 0x8c, 0x00, 0xff, 0xba, 0x98, 0x00, 0xff, + 0xab, 0xb9, 0x00, 0xff, 0x93, 0xa4, 0x00, 0xff, + 0x6c, 0x7b, 0x00, 0xff, 0x6c, 0x7b, 0x00, 0xff, + 0x5c, 0x6c, 0x00, 0xff, 0x4a, 0x5a, 0x00, 0xff, + 0x38, 0x48, 0x00, 0xff, 0x4a, 0x5a, 0x00, 0xff, + 0x40, 0x51, 0x00, 0xff, 0x54, 0x65, 0x00, 0xff, + 0x54, 0x65, 0x00, 0xff, 0x34, 0x45, 0x00, 0xff, + 0x4c, 0x4c, 0x00, 0xff, 0x3a, 0x3a, 0x00, 0xff, + 0x3a, 0x3a, 0x00, 0xff, 0x4c, 0x4c, 0x00, 0xff, + 0x4b, 0x5b, 0x00, 0xff, 0x4b, 0x5b, 0x00, 0xff, + 0x63, 0x73, 0x00, 0xff, 0x4b, 0x5b, 0x00, 0xff, + 0x3d, 0x3d, 0x00, 0xff, 0x3d, 0x3d, 0x00, 0xff, + 0x52, 0x52, 0x00, 0xff, 0x3d, 0x3d, 0x00, 0xff, + 0x51, 0x40, 0x00, 0xff, 0x51, 0x40, 0x00, 0xff, + 0x5c, 0x4c, 0x00, 0xff, 0x67, 0x54, 0x00, 0xff, + 0x8a, 0x57, 0x00, 0xff, 0x96, 0x69, 0x00, 0xff, + 0xae, 0x7b, 0x00, 0xff, 0xba, 0x8c, 0x00, 0xff, + 0x93, 0xa4, 0x00, 0xff, 0x6c, 0x7b, 0x00, 0xff, + 0x7c, 0x8f, 0x00, 0xff, 0x54, 0x66, 0x00, 0xff, + 0x4a, 0x5a, 0x00, 0xff, 0x38, 0x48, 0x00, 0xff, + 0x38, 0x48, 0x00, 0xff, 0x26, 0x36, 0x00, 0xff, + 0x4c, 0x5d, 0x00, 0xff, 0x40, 0x51, 0x00, 0xff, + 0x34, 0x45, 0x00, 0xff, 0x34, 0x45, 0x00, 0xff, + 0x28, 0x28, 0x00, 0xff, 0x28, 0x28, 0x00, 0xff, + 0x28, 0x28, 0x00, 0xff, 0x28, 0x28, 0x00, 0xff, + 0x39, 0x49, 0x00, 0xff, 0x27, 0x37, 0x00, 0xff, + 0x39, 0x49, 0x00, 0xff, 0x27, 0x37, 0x00, 0xff, + 0x52, 0x52, 0x00, 0xff, 0x28, 0x28, 0x00, 0xff, + 0x1a, 0x1a, 0x00, 0xff, 0x28, 0x28, 0x00, 0xff, + 0x51, 0x40, 0x00, 0xff, 0x5c, 0x4c, 0x00, 0xff, + 0x51, 0x40, 0x00, 0xff, 0x51, 0x40, 0x00, 0xff, + 0x8a, 0x4b, 0x00, 0xff, 0xa2, 0x57, 0x00, 0xff, + 0xae, 0x69, 0x00, 0xff, 0xc2, 0x7b, 0x00, 0xff, + 0x80, 0x80, 0x00, 0xff, 0x6f, 0x6f, 0x00, 0xff, + 0x4b, 0x4b, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x41, 0x4d, 0x00, 0xff, 0x41, 0x4d, 0x00, 0xff, + 0x20, 0x29, 0x00, 0xff, 0x20, 0x29, 0x00, 0xff, + 0x19, 0x29, 0x00, 0xff, 0x2b, 0x41, 0x00, 0xff, + 0x22, 0x29, 0x00, 0xff, 0x16, 0x1f, 0x00, 0xff, + 0x10, 0x10, 0x00, 0xff, 0x16, 0x14, 0x00, 0xff, + 0x10, 0x10, 0x00, 0xff, 0x19, 0x1a, 0x00, 0xff, + 0x12, 0x11, 0x00, 0xff, 0x22, 0x32, 0x00, 0xff, + 0x12, 0x11, 0x00, 0xff, 0x32, 0x44, 0x00, 0xff, + 0x49, 0x4f, 0x00, 0xff, 0x51, 0x5b, 0x00, 0xff, + 0x31, 0x3b, 0x00, 0xff, 0x31, 0x3b, 0x00, 0xff, + 0x3a, 0x27, 0x00, 0xff, 0x5e, 0x4f, 0x00, 0xff, + 0x72, 0x61, 0x00, 0xff, 0x5e, 0x4f, 0x00, 0xff, + 0x8c, 0x39, 0x00, 0xff, 0x98, 0x45, 0x00, 0xff, + 0xb8, 0x59, 0x00, 0xff, 0xd8, 0x75, 0x00, 0xff, + 0x92, 0x92, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x4b, 0x4b, 0x00, 0xff, 0x39, 0x39, 0x00, 0xff, + 0x41, 0x4d, 0x00, 0xff, 0x17, 0x29, 0x00, 0xff, + 0x41, 0x4d, 0x00, 0xff, 0x20, 0x29, 0x00, 0xff, + 0x07, 0x19, 0x00, 0xff, 0x07, 0x19, 0x00, 0xff, + 0x22, 0x29, 0x00, 0xff, 0x16, 0x1f, 0x00, 0xff, + 0x19, 0x1a, 0x00, 0xff, 0x10, 0x10, 0x00, 0xff, + 0x16, 0x14, 0x00, 0xff, 0x10, 0x10, 0x00, 0xff, + 0x22, 0x32, 0x00, 0xff, 0x12, 0x11, 0x00, 0xff, + 0x22, 0x32, 0x00, 0xff, 0x12, 0x23, 0x00, 0xff, + 0x3d, 0x47, 0x00, 0xff, 0x31, 0x3b, 0x00, 0xff, + 0x49, 0x4f, 0x00, 0xff, 0x3d, 0x47, 0x00, 0xff, + 0x4a, 0x39, 0x00, 0xff, 0x4a, 0x39, 0x00, 0xff, + 0x5e, 0x4f, 0x00, 0xff, 0x72, 0x61, 0x00, 0xff, + 0xa0, 0x51, 0x00, 0xff, 0x98, 0x45, 0x00, 0xff, + 0xb8, 0x59, 0x00, 0xff, 0xd8, 0x75, 0x00, 0xff, + 0x92, 0x92, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x39, 0x39, 0x00, 0xff, 0x2d, 0x2d, 0x00, 0xff, + 0x29, 0x3b, 0x00, 0xff, 0x05, 0x14, 0x00, 0xff, + 0x0e, 0x14, 0x00, 0xff, 0x32, 0x3b, 0x00, 0xff, + 0x19, 0x29, 0x00, 0xff, 0x07, 0x19, 0x00, 0xff, + 0x00, 0x07, 0x00, 0xff, 0x16, 0x1f, 0x00, 0xff, + 0x0d, 0x1e, 0x00, 0xff, 0x0d, 0x1e, 0x00, 0xff, + 0x0d, 0x1e, 0x00, 0xff, 0x00, 0x08, 0x00, 0xff, + 0x12, 0x23, 0x00, 0xff, 0x12, 0x23, 0x00, 0xff, + 0x12, 0x23, 0x00, 0xff, 0x22, 0x32, 0x00, 0xff, + 0x3d, 0x1b, 0x00, 0xff, 0x51, 0x2f, 0x00, 0xff, + 0x51, 0x2f, 0x00, 0xff, 0x79, 0x5b, 0x00, 0xff, + 0x7e, 0x49, 0x00, 0xff, 0x7e, 0x49, 0x00, 0xff, + 0x72, 0x3f, 0x00, 0xff, 0x72, 0x3f, 0x00, 0xff, + 0xac, 0x59, 0x00, 0xff, 0xac, 0x59, 0x00, 0xff, + 0xb8, 0x59, 0x00, 0xff, 0xd8, 0x75, 0x00, 0xff, + 0x80, 0x80, 0x00, 0xff, 0x5d, 0x5d, 0x00, 0xff, + 0x39, 0x39, 0x00, 0xff, 0x39, 0x39, 0x00, 0xff, + 0x05, 0x14, 0x00, 0xff, 0x17, 0x29, 0x00, 0xff, + 0x0e, 0x14, 0x00, 0xff, 0x0e, 0x14, 0x00, 0xff, + 0x19, 0x29, 0x00, 0xff, 0x07, 0x19, 0x00, 0xff, + 0x07, 0x13, 0x00, 0xff, 0x00, 0x07, 0x00, 0xff, + 0x19, 0x2a, 0x00, 0xff, 0x19, 0x2a, 0x00, 0xff, + 0x00, 0x08, 0x00, 0xff, 0x19, 0x2a, 0x00, 0xff, + 0x12, 0x11, 0x00, 0xff, 0x12, 0x23, 0x00, 0xff, + 0x12, 0x11, 0x00, 0xff, 0x12, 0x11, 0x00, 0xff, + 0x51, 0x2f, 0x00, 0xff, 0x3d, 0x1b, 0x00, 0xff, + 0x3d, 0x1b, 0x00, 0xff, 0x51, 0x2f, 0x00, 0xff, + 0x72, 0x3f, 0x00, 0xff, 0x7e, 0x49, 0x00, 0xff, + 0x85, 0x55, 0x00, 0xff, 0x85, 0x55, 0x00, 0xff, + 0xa0, 0x51, 0x00, 0xff, 0xac, 0x59, 0x00, 0xff, + 0xb8, 0x59, 0x00, 0xff, 0xd8, 0x75, 0x00, 0xff, + 0x75, 0x84, 0x00, 0xff, 0x51, 0x61, 0x00, 0xff, + 0x3f, 0x4f, 0x00, 0xff, 0x2d, 0x3d, 0x00, 0xff, + 0x29, 0x32, 0x00, 0xff, 0x07, 0x10, 0x00, 0xff, + 0x13, 0x1c, 0x00, 0xff, 0x1d, 0x26, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x05, 0x0e, 0x00, 0xff, + 0x05, 0x0e, 0x00, 0xff, 0x11, 0x17, 0x00, 0xff, + 0x12, 0x21, 0x00, 0xff, 0x12, 0x21, 0x00, 0xff, + 0x2a, 0x21, 0x00, 0xff, 0x12, 0x0b, 0x00, 0xff, + 0x38, 0x1d, 0x00, 0xff, 0x20, 0x07, 0x00, 0xff, + 0x50, 0x1d, 0x00, 0xff, 0x50, 0x1d, 0x00, 0xff, + 0x56, 0x33, 0x00, 0xff, 0x76, 0x54, 0x00, 0xff, + 0x87, 0x33, 0x00, 0xff, 0x68, 0x12, 0x00, 0xff, + 0x94, 0x00, 0x00, 0xff, 0x82, 0x1b, 0x00, 0xff, + 0xaf, 0x4b, 0x00, 0xff, 0xaf, 0x4b, 0x00, 0xff, + 0xd2, 0x5b, 0x00, 0xff, 0xd2, 0x3a, 0x00, 0xff, + 0xd2, 0x5b, 0x00, 0xff, 0xe8, 0x71, 0x00, 0xff, + 0x63, 0x73, 0x00, 0xff, 0x63, 0x73, 0x00, 0xff, + 0x3f, 0x4f, 0x00, 0xff, 0x3f, 0x4f, 0x00, 0xff, + 0x1d, 0x26, 0x00, 0xff, 0x29, 0x32, 0x00, 0xff, + 0x07, 0x10, 0x00, 0xff, 0x13, 0x1c, 0x00, 0xff, + 0x11, 0x17, 0x00, 0xff, 0x00, 0x05, 0x00, 0xff, + 0x05, 0x0e, 0x00, 0xff, 0x11, 0x17, 0x00, 0xff, + 0x06, 0x15, 0x00, 0xff, 0x06, 0x15, 0x00, 0xff, + 0x12, 0x0b, 0x00, 0xff, 0x06, 0x00, 0x00, 0xff, + 0x20, 0x07, 0x00, 0xff, 0x20, 0x07, 0x00, 0xff, + 0x38, 0x07, 0x00, 0xff, 0x5c, 0x29, 0x00, 0xff, + 0x56, 0x33, 0x00, 0xff, 0x87, 0x33, 0x00, 0xff, + 0x76, 0x54, 0x00, 0xff, 0x87, 0x33, 0x00, 0xff, + 0x82, 0x1b, 0x00, 0xff, 0x94, 0x00, 0x00, 0xff, + 0x82, 0x1b, 0x00, 0xff, 0xaf, 0x4b, 0x00, 0xff, + 0xd2, 0x3a, 0x00, 0xff, 0xd2, 0x3a, 0x00, 0xff, + 0xe8, 0x50, 0x00, 0xff, 0xe8, 0x71, 0x00, 0xff, + 0x75, 0x84, 0x00, 0xff, 0x51, 0x61, 0x00, 0xff, + 0x51, 0x61, 0x00, 0xff, 0x2d, 0x3d, 0x00, 0xff, + 0x29, 0x32, 0x00, 0xff, 0x1d, 0x26, 0x00, 0xff, + 0x29, 0x32, 0x00, 0xff, 0x13, 0x1c, 0x00, 0xff, + 0x29, 0x4a, 0x00, 0xff, 0x0e, 0x2f, 0x00, 0xff, + 0x00, 0x17, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x06, 0x15, 0x00, 0xff, 0x00, 0x0b, 0x00, 0xff, + 0x12, 0x0b, 0x00, 0xff, 0x12, 0x0b, 0x00, 0xff, + 0x20, 0x07, 0x00, 0xff, 0x2c, 0x13, 0x00, 0xff, + 0x38, 0x07, 0x00, 0xff, 0x50, 0x1d, 0x00, 0xff, + 0x87, 0x33, 0x00, 0xff, 0x87, 0x33, 0x00, 0xff, + 0x87, 0x33, 0x00, 0xff, 0x87, 0x33, 0x00, 0xff, + 0xaf, 0x4b, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xd2, 0x5b, 0x00, 0xff, 0xd2, 0x3a, 0x00, 0xff, + 0xe8, 0x50, 0x00, 0xff, 0xe8, 0x71, 0x00, 0xff, + 0x86, 0x96, 0x00, 0xff, 0x63, 0x73, 0x00, 0xff, + 0x2d, 0x3d, 0x00, 0xff, 0x2d, 0x3d, 0x00, 0xff, + 0x1d, 0x26, 0x00, 0xff, 0x13, 0x1c, 0x00, 0xff, + 0x07, 0x10, 0x00, 0xff, 0x1d, 0x26, 0x00, 0xff, + 0x00, 0x17, 0x00, 0xff, 0x29, 0x4a, 0x00, 0xff, + 0x00, 0x17, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x06, 0x15, 0x00, 0xff, + 0x2a, 0x21, 0x00, 0xff, 0x1e, 0x15, 0x00, 0xff, + 0x44, 0x29, 0x00, 0xff, 0x38, 0x1d, 0x00, 0xff, + 0x5c, 0x29, 0x00, 0xff, 0x50, 0x1d, 0x00, 0xff, + 0x87, 0x33, 0x00, 0xff, 0x87, 0x33, 0x00, 0xff, + 0x87, 0x33, 0x00, 0xff, 0x87, 0x33, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xd2, 0x3a, 0x00, 0xff, 0xd2, 0x3a, 0x00, 0xff, + 0xe8, 0x50, 0x00, 0xff, 0xe8, 0x71, 0x00, 0xff, + 0x7c, 0x9a, 0x00, 0xff, 0x6d, 0x88, 0x00, 0xff, + 0x54, 0x5f, 0x00, 0xff, 0x18, 0x2f, 0x00, 0xff, + 0x21, 0x21, 0x00, 0xff, 0x0f, 0x0f, 0x00, 0xff, + 0x0f, 0x0f, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x05, 0x05, 0x00, 0xff, + 0x09, 0x11, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x0f, 0x18, 0x00, 0xff, 0x0f, 0x18, 0x00, 0xff, + 0x33, 0x24, 0x00, 0xff, 0x3f, 0x2e, 0x00, 0xff, + 0x45, 0x14, 0x00, 0xff, 0x6d, 0x3c, 0x00, 0xff, + 0x6d, 0x20, 0x00, 0xff, 0x8c, 0x42, 0x00, 0xff, + 0x99, 0x33, 0x00, 0xff, 0x99, 0x33, 0x00, 0xff, + 0x99, 0x33, 0x00, 0xff, 0xbb, 0x11, 0x00, 0xff, + 0xc5, 0x06, 0x00, 0xff, 0xcb, 0x0c, 0x00, 0xff, + 0xd5, 0x0f, 0x00, 0xff, 0xe1, 0x14, 0x00, 0xff, + 0xe7, 0x25, 0x00, 0xff, 0xe7, 0x41, 0x00, 0xff, + 0xe7, 0x59, 0x00, 0xff, 0xe7, 0x71, 0x00, 0xff, + 0x7c, 0x9a, 0x00, 0xff, 0x6d, 0x9a, 0x00, 0xff, + 0x6d, 0x7d, 0x00, 0xff, 0x18, 0x2f, 0x00, 0xff, + 0x0f, 0x0f, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x09, 0x11, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x27, 0x2e, 0x00, 0xff, 0x27, 0x2e, 0x00, 0xff, + 0x27, 0x18, 0x00, 0xff, 0x4b, 0x3a, 0x00, 0xff, + 0x59, 0x26, 0x00, 0xff, 0x45, 0x14, 0x00, 0xff, + 0x8c, 0x42, 0x00, 0xff, 0x80, 0x36, 0x00, 0xff, + 0x99, 0x33, 0x00, 0xff, 0xa3, 0x3f, 0x00, 0xff, + 0x8d, 0x29, 0x00, 0xff, 0xbb, 0x11, 0x00, 0xff, + 0xc5, 0x06, 0x00, 0xff, 0xcf, 0x09, 0x00, 0xff, + 0xdb, 0x0f, 0x00, 0xff, 0xe5, 0x12, 0x00, 0xff, + 0xe9, 0x25, 0x00, 0xff, 0xe9, 0x3d, 0x00, 0xff, + 0xe9, 0x59, 0x00, 0xff, 0xe9, 0x71, 0x00, 0xff, + 0x8a, 0xac, 0x00, 0xff, 0x6d, 0x88, 0x00, 0xff, + 0x6d, 0x7d, 0x00, 0xff, 0x36, 0x41, 0x00, 0xff, + 0x0f, 0x0f, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x05, 0x05, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x27, 0x2e, 0x00, 0xff, 0x33, 0x3a, 0x00, 0xff, + 0x3f, 0x2e, 0x00, 0xff, 0x4b, 0x3a, 0x00, 0xff, + 0x6d, 0x3c, 0x00, 0xff, 0x6d, 0x3c, 0x00, 0xff, + 0x75, 0x2c, 0x00, 0xff, 0x8c, 0x42, 0x00, 0xff, + 0x99, 0x33, 0x00, 0xff, 0x99, 0x33, 0x00, 0xff, + 0xa3, 0x3f, 0x00, 0xff, 0xbb, 0x11, 0x00, 0xff, + 0xcb, 0x03, 0x00, 0xff, 0xd5, 0x09, 0x00, 0xff, + 0xe1, 0x0c, 0x00, 0xff, 0xeb, 0x12, 0x00, 0xff, + 0xeb, 0x25, 0x00, 0xff, 0xeb, 0x3d, 0x00, 0xff, + 0xeb, 0x59, 0x00, 0xff, 0xeb, 0x71, 0x00, 0xff, + 0x8a, 0xac, 0x00, 0xff, 0x6d, 0x9a, 0x00, 0xff, + 0x6d, 0x7d, 0x00, 0xff, 0x6d, 0x7d, 0x00, 0xff, + 0x36, 0x36, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x11, 0x11, 0x00, 0xff, 0x05, 0x05, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x09, 0x11, 0x00, 0xff, + 0x27, 0x2e, 0x00, 0xff, 0x33, 0x3a, 0x00, 0xff, + 0x4b, 0x3a, 0x00, 0xff, 0x4b, 0x3a, 0x00, 0xff, + 0x6d, 0x3c, 0x00, 0xff, 0x80, 0x4e, 0x00, 0xff, + 0x8c, 0x42, 0x00, 0xff, 0x80, 0x36, 0x00, 0xff, + 0xa3, 0x3f, 0x00, 0xff, 0xa3, 0x3f, 0x00, 0xff, + 0x99, 0x33, 0x00, 0xff, 0xbb, 0x11, 0x00, 0xff, + 0xcf, 0x03, 0x00, 0xff, 0xdb, 0x06, 0x00, 0xff, + 0xe1, 0x0c, 0x00, 0xff, 0xeb, 0x0f, 0x00, 0xff, + 0xed, 0x25, 0x00, 0xff, 0xed, 0x3d, 0x00, 0xff, + 0xed, 0x55, 0x00, 0xff, 0xed, 0x71, 0x00, 0xff, + 0x7d, 0x94, 0x00, 0xff, 0x7d, 0x94, 0x00, 0xff, + 0x5d, 0x77, 0x00, 0xff, 0x5d, 0x77, 0x00, 0xff, + 0x5d, 0x6f, 0x00, 0xff, 0x26, 0x38, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x13, 0x13, 0x00, 0xff, 0x13, 0x13, 0x00, 0xff, + 0x13, 0x13, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x3e, 0x1d, 0x00, 0xff, 0x56, 0x33, 0x00, 0xff, + 0x6c, 0x4b, 0x00, 0xff, 0x6c, 0x4b, 0x00, 0xff, + 0x6a, 0x40, 0x00, 0xff, 0x81, 0x58, 0x00, 0xff, + 0x8d, 0x64, 0x00, 0xff, 0x81, 0x58, 0x00, 0xff, + 0x9f, 0x18, 0x00, 0xff, 0xb4, 0x2d, 0x00, 0xff, + 0xb4, 0x2d, 0x00, 0xff, 0xd2, 0x06, 0x00, 0xff, + 0xd6, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x00, 0xff, + 0xe9, 0x0a, 0x00, 0xff, 0xef, 0x10, 0x00, 0xff, + 0xe8, 0x1d, 0x00, 0xff, 0xea, 0x3e, 0x00, 0xff, + 0xec, 0x5f, 0x00, 0xff, 0xf0, 0x80, 0x00, 0xff, + 0x7d, 0x94, 0x00, 0xff, 0x5d, 0x77, 0x00, 0xff, + 0x5d, 0x77, 0x00, 0xff, 0x49, 0x65, 0x00, 0xff, + 0x3f, 0x56, 0x00, 0xff, 0x26, 0x38, 0x00, 0xff, + 0x1c, 0x0b, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, + 0x13, 0x13, 0x00, 0xff, 0x13, 0x13, 0x00, 0xff, + 0x33, 0x33, 0x00, 0xff, 0x13, 0x13, 0x00, 0xff, + 0x3e, 0x1d, 0x00, 0xff, 0x56, 0x33, 0x00, 0xff, + 0x56, 0x33, 0x00, 0xff, 0x6c, 0x4b, 0x00, 0xff, + 0x76, 0x4c, 0x00, 0xff, 0x6a, 0x40, 0x00, 0xff, + 0x81, 0x58, 0x00, 0xff, 0x8d, 0x64, 0x00, 0xff, + 0xb4, 0x2d, 0x00, 0xff, 0x9f, 0x18, 0x00, 0xff, + 0xd2, 0x06, 0x00, 0xff, 0xd2, 0x06, 0x00, 0xff, + 0xd6, 0x00, 0x00, 0xff, 0xec, 0x05, 0x00, 0xff, + 0xe9, 0x0a, 0x00, 0xff, 0xef, 0x10, 0x00, 0xff, + 0xe8, 0x1d, 0x00, 0xff, 0xea, 0x3e, 0x00, 0xff, + 0xee, 0x5f, 0x00, 0xff, 0xf0, 0x80, 0x00, 0xff, + 0x71, 0x65, 0x00, 0xff, 0x5d, 0x53, 0x00, 0xff, + 0x49, 0x41, 0x00, 0xff, 0x35, 0x2f, 0x00, 0xff, + 0x26, 0x38, 0x00, 0xff, 0x26, 0x38, 0x00, 0xff, + 0x3f, 0x29, 0x00, 0xff, 0x08, 0x00, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x33, 0x00, 0xff, + 0x33, 0x33, 0x00, 0xff, 0x33, 0x33, 0x00, 0xff, + 0x56, 0x33, 0x00, 0xff, 0x56, 0x33, 0x00, 0xff, + 0x78, 0x33, 0x00, 0xff, 0x78, 0x33, 0x00, 0xff, + 0x8d, 0x34, 0x00, 0xff, 0x8d, 0x34, 0x00, 0xff, + 0x8d, 0x34, 0x00, 0xff, 0xa5, 0x4c, 0x00, 0xff, + 0xb4, 0x2d, 0x00, 0xff, 0xb4, 0x2d, 0x00, 0xff, + 0xd2, 0x06, 0x00, 0xff, 0xd2, 0x06, 0x00, 0xff, + 0xe0, 0x00, 0x00, 0xff, 0xec, 0x05, 0x00, 0xff, + 0xe5, 0x07, 0x00, 0xff, 0xef, 0x10, 0x00, 0xff, + 0xe8, 0x1d, 0x00, 0xff, 0xec, 0x3e, 0x00, 0xff, + 0xee, 0x5f, 0x00, 0xff, 0xf2, 0x80, 0x00, 0xff, + 0x71, 0x65, 0x00, 0xff, 0x5d, 0x53, 0x00, 0xff, + 0x49, 0x41, 0x00, 0xff, 0x35, 0x2f, 0x00, 0xff, + 0x08, 0x1a, 0x00, 0xff, 0x26, 0x38, 0x00, 0xff, + 0x3f, 0x29, 0x00, 0xff, 0x1c, 0x0b, 0x00, 0xff, + 0x33, 0x00, 0x00, 0xff, 0x33, 0x00, 0x00, 0xff, + 0x33, 0x33, 0x00, 0xff, 0x53, 0x53, 0x00, 0xff, + 0x56, 0x33, 0x00, 0xff, 0x6c, 0x4b, 0x00, 0xff, + 0x78, 0x33, 0x00, 0xff, 0x78, 0x33, 0x00, 0xff, + 0x81, 0x28, 0x00, 0xff, 0x99, 0x40, 0x00, 0xff, + 0x99, 0x40, 0x00, 0xff, 0x8d, 0x34, 0x00, 0xff, + 0xb4, 0x2d, 0x00, 0xff, 0xb4, 0x2d, 0x00, 0xff, + 0xd2, 0x06, 0x00, 0xff, 0xd2, 0x06, 0x00, 0xff, + 0xe0, 0x00, 0x00, 0xff, 0xec, 0x05, 0x00, 0xff, + 0xe5, 0x07, 0x00, 0xff, 0xe9, 0x0a, 0x00, 0xff, + 0xea, 0x1d, 0x00, 0xff, 0xec, 0x3e, 0x00, 0xff, + 0xf0, 0x5f, 0x00, 0xff, 0xf2, 0x80, 0x00, 0xff, + 0x7c, 0x75, 0x00, 0xff, 0x58, 0x4b, 0x00, 0xff, + 0x61, 0x4b, 0x00, 0xff, 0x4f, 0x36, 0x00, 0xff, + 0x45, 0x32, 0x00, 0xff, 0x33, 0x23, 0x00, 0xff, + 0x45, 0x32, 0x00, 0xff, 0x45, 0x32, 0x00, 0xff, + 0x56, 0x22, 0x00, 0xff, 0x68, 0x00, 0x00, 0xff, + 0x56, 0x22, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x8d, 0x4b, 0x00, 0xff, 0x66, 0x27, 0x00, 0xff, + 0x8d, 0x4b, 0x00, 0xff, 0x7a, 0x39, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0x9f, 0x28, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0xb5, 0x0b, 0x00, 0xff, + 0xc2, 0x00, 0x00, 0xff, 0xe8, 0x11, 0x00, 0xff, + 0xde, 0x00, 0x00, 0xff, 0xe8, 0x02, 0x00, 0xff, + 0xea, 0x00, 0x00, 0xff, 0xec, 0x05, 0x00, 0xff, + 0xec, 0x0a, 0x00, 0xff, 0xee, 0x10, 0x00, 0xff, + 0xeb, 0x1c, 0x00, 0xff, 0xec, 0x3a, 0x00, 0xff, + 0xed, 0x5d, 0x00, 0xff, 0xee, 0x7b, 0x00, 0xff, + 0x90, 0x89, 0x00, 0xff, 0x58, 0x4b, 0x00, 0xff, + 0x4f, 0x36, 0x00, 0xff, 0x4f, 0x36, 0x00, 0xff, + 0x45, 0x32, 0x00, 0xff, 0x33, 0x23, 0x00, 0xff, + 0x33, 0x23, 0x00, 0xff, 0x54, 0x44, 0x00, 0xff, + 0x76, 0x43, 0x00, 0xff, 0x87, 0x10, 0x00, 0xff, + 0x87, 0x10, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x8d, 0x4b, 0x00, 0xff, 0x8d, 0x4b, 0x00, 0xff, + 0x7a, 0x39, 0x00, 0xff, 0x8d, 0x4b, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0x9f, 0x28, 0x00, 0xff, + 0xb5, 0x0b, 0x00, 0xff, 0xb5, 0x0b, 0x00, 0xff, + 0xc2, 0x00, 0x00, 0xff, 0xd4, 0x00, 0x00, 0xff, + 0xe4, 0x00, 0x00, 0xff, 0xe4, 0x00, 0x00, 0xff, + 0xe8, 0x01, 0x00, 0xff, 0xea, 0x07, 0x00, 0xff, + 0xea, 0x0c, 0x00, 0xff, 0xec, 0x10, 0x00, 0xff, + 0xeb, 0x1c, 0x00, 0xff, 0xec, 0x3a, 0x00, 0xff, + 0xed, 0x5d, 0x00, 0xff, 0xee, 0x7b, 0x00, 0xff, + 0x90, 0x89, 0x00, 0xff, 0x6d, 0x60, 0x00, 0xff, + 0x4f, 0x36, 0x00, 0xff, 0x61, 0x4b, 0x00, 0xff, + 0x54, 0x44, 0x00, 0xff, 0x54, 0x44, 0x00, 0xff, + 0x66, 0x11, 0x00, 0xff, 0x54, 0x44, 0x00, 0xff, + 0x76, 0x43, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x87, 0x10, 0x00, 0xff, 0x87, 0x10, 0x00, 0xff, + 0xad, 0x30, 0x00, 0xff, 0xad, 0x30, 0x00, 0xff, + 0x95, 0x1e, 0x00, 0xff, 0xa1, 0x27, 0x00, 0xff, + 0x9f, 0x28, 0x00, 0xff, 0x9f, 0x28, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xb5, 0x0b, 0x00, 0xff, + 0xd4, 0x00, 0x00, 0xff, 0xd4, 0x00, 0x00, 0xff, + 0xe4, 0x00, 0x00, 0xff, 0xe4, 0x00, 0x00, 0xff, + 0xe6, 0x01, 0x00, 0xff, 0xe8, 0x07, 0x00, 0xff, + 0xe8, 0x0c, 0x00, 0xff, 0xea, 0x10, 0x00, 0xff, + 0xeb, 0x1c, 0x00, 0xff, 0xec, 0x3a, 0x00, 0xff, + 0xed, 0x5d, 0x00, 0xff, 0xee, 0x7b, 0x00, 0xff, + 0x90, 0x89, 0x00, 0xff, 0x7c, 0x75, 0x00, 0xff, + 0x61, 0x4b, 0x00, 0xff, 0x61, 0x4b, 0x00, 0xff, + 0x54, 0x44, 0x00, 0xff, 0x54, 0x44, 0x00, 0xff, + 0x66, 0x11, 0x00, 0xff, 0x66, 0x11, 0x00, 0xff, + 0x76, 0x43, 0x00, 0xff, 0x76, 0x43, 0x00, 0xff, + 0x87, 0x10, 0x00, 0xff, 0x87, 0x10, 0x00, 0xff, + 0x8d, 0x0f, 0x00, 0xff, 0xa1, 0x27, 0x00, 0xff, + 0xa1, 0x27, 0x00, 0xff, 0x8d, 0x0f, 0x00, 0xff, + 0xb5, 0x0b, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xc1, 0x17, 0x00, 0xff, 0xc1, 0x17, 0x00, 0xff, + 0xd4, 0x00, 0x00, 0xff, 0xd4, 0x00, 0x00, 0xff, + 0xde, 0x00, 0x00, 0xff, 0xde, 0x00, 0x00, 0xff, + 0xe4, 0x01, 0x00, 0xff, 0xe6, 0x07, 0x00, 0xff, + 0xe6, 0x0c, 0x00, 0xff, 0xe8, 0x12, 0x00, 0xff, + 0xeb, 0x1c, 0x00, 0xff, 0xec, 0x3a, 0x00, 0xff, + 0xed, 0x58, 0x00, 0xff, 0xee, 0x7b, 0x00, 0xff, + 0x9d, 0x83, 0x00, 0xff, 0x9d, 0x83, 0x00, 0xff, + 0x8e, 0x57, 0x00, 0xff, 0x74, 0x39, 0x00, 0xff, + 0x74, 0x3f, 0x00, 0xff, 0x74, 0x33, 0x00, 0xff, + 0x7d, 0x27, 0x00, 0xff, 0x7d, 0x1d, 0x00, 0xff, + 0x82, 0x1c, 0x00, 0xff, 0x8e, 0x28, 0x00, 0xff, + 0x8e, 0x28, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xb2, 0x0e, 0x00, 0xff, 0xac, 0x08, 0x00, 0xff, + 0xbc, 0x18, 0x00, 0xff, 0xb8, 0x12, 0x00, 0xff, + 0xbf, 0x00, 0x00, 0xff, 0xc9, 0x03, 0x00, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xda, 0x00, 0x00, 0xff, 0xdc, 0x01, 0x00, 0xff, + 0xde, 0x03, 0x00, 0xff, 0xe0, 0x03, 0x00, 0xff, + 0xe3, 0x02, 0x00, 0xff, 0xe5, 0x08, 0x00, 0xff, + 0xe7, 0x0e, 0x00, 0xff, 0xe9, 0x16, 0x00, 0xff, + 0xeb, 0x2b, 0x00, 0xff, 0xed, 0x49, 0x00, 0xff, + 0xef, 0x6d, 0x00, 0xff, 0xef, 0x8a, 0x00, 0xff, + 0x9d, 0x83, 0x00, 0xff, 0xa3, 0x8d, 0x00, 0xff, + 0xa9, 0x70, 0x00, 0xff, 0x8e, 0x57, 0x00, 0xff, + 0x85, 0x3f, 0x00, 0xff, 0x85, 0x33, 0x00, 0xff, + 0x8b, 0x27, 0x00, 0xff, 0x8b, 0x1d, 0x00, 0xff, + 0xa4, 0x1c, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xb0, 0x28, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xac, 0x08, 0x00, 0xff, 0xbc, 0x18, 0x00, 0xff, + 0xbc, 0x18, 0x00, 0xff, 0xb2, 0x0e, 0x00, 0xff, + 0xc9, 0x03, 0x00, 0xff, 0xc9, 0x03, 0x00, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xdb, 0x07, 0x00, 0xff, + 0xdc, 0x06, 0x00, 0xff, 0xde, 0x06, 0x00, 0xff, + 0xe0, 0x06, 0x00, 0xff, 0xe2, 0x09, 0x00, 0xff, + 0xe1, 0x02, 0x00, 0xff, 0xe3, 0x0b, 0x00, 0xff, + 0xe5, 0x13, 0x00, 0xff, 0xe7, 0x19, 0x00, 0xff, + 0xe9, 0x2b, 0x00, 0xff, 0xeb, 0x49, 0x00, 0xff, + 0xed, 0x6d, 0x00, 0xff, 0xef, 0x8a, 0x00, 0xff, + 0xa3, 0x8d, 0x00, 0xff, 0x94, 0x7a, 0x00, 0xff, + 0xa9, 0x70, 0x00, 0xff, 0x8e, 0x57, 0x00, 0xff, + 0x9a, 0x43, 0x00, 0xff, 0x9a, 0x39, 0x00, 0xff, + 0xa0, 0x2d, 0x00, 0xff, 0xa0, 0x21, 0x00, 0xff, + 0xa4, 0x1c, 0x00, 0xff, 0xa4, 0x1c, 0x00, 0xff, + 0xb0, 0x28, 0x00, 0xff, 0xb0, 0x28, 0x00, 0xff, + 0xca, 0x0e, 0x00, 0xff, 0xca, 0x0e, 0x00, 0xff, + 0xca, 0x0e, 0x00, 0xff, 0xd0, 0x12, 0x00, 0xff, + 0xd5, 0x0d, 0x00, 0xff, 0xd5, 0x0d, 0x00, 0xff, + 0xe5, 0x11, 0x00, 0xff, 0xdb, 0x07, 0x00, 0xff, + 0xdc, 0x09, 0x00, 0xff, 0xde, 0x09, 0x00, 0xff, + 0xe0, 0x0c, 0x00, 0xff, 0xe2, 0x0c, 0x00, 0xff, + 0xe1, 0x08, 0x00, 0xff, 0xe3, 0x0e, 0x00, 0xff, + 0xe5, 0x16, 0x00, 0xff, 0xe7, 0x1f, 0x00, 0xff, + 0xe7, 0x3d, 0x00, 0xff, 0xe9, 0x5b, 0x00, 0xff, + 0xeb, 0x7f, 0x00, 0xff, 0xed, 0x9c, 0x00, 0xff, + 0xa3, 0x8d, 0x00, 0xff, 0x94, 0x7a, 0x00, 0xff, + 0xa9, 0x70, 0x00, 0xff, 0x8e, 0x57, 0x00, 0xff, + 0xa9, 0x43, 0x00, 0xff, 0xa9, 0x39, 0x00, 0xff, + 0xb2, 0x2d, 0x00, 0xff, 0xb2, 0x21, 0x00, 0xff, + 0xa4, 0x1c, 0x00, 0xff, 0xb0, 0x28, 0x00, 0xff, + 0xb0, 0x28, 0x00, 0xff, 0xb0, 0x28, 0x00, 0xff, + 0xd6, 0x18, 0x00, 0xff, 0xd0, 0x12, 0x00, 0xff, + 0xd6, 0x18, 0x00, 0xff, 0xd6, 0x18, 0x00, 0xff, + 0xdf, 0x19, 0x00, 0xff, 0xdf, 0x19, 0x00, 0xff, + 0xe5, 0x11, 0x00, 0xff, 0xe5, 0x11, 0x00, 0xff, + 0xde, 0x0e, 0x00, 0xff, 0xe0, 0x0e, 0x00, 0xff, + 0xe2, 0x11, 0x00, 0xff, 0xe4, 0x11, 0x00, 0xff, + 0xdf, 0x0b, 0x00, 0xff, 0xe1, 0x13, 0x00, 0xff, + 0xe3, 0x19, 0x00, 0xff, 0xe5, 0x1f, 0x00, 0xff, + 0xe5, 0x49, 0x00, 0xff, 0xe7, 0x6d, 0x00, 0xff, + 0xe9, 0x8a, 0x00, 0xff, 0xeb, 0x9c, 0x00, 0xff, + 0xd3, 0x8c, 0x00, 0xff, 0xc4, 0x7b, 0x00, 0xff, + 0xbb, 0x57, 0x00, 0xff, 0xbb, 0x57, 0x00, 0xff, + 0xcd, 0x49, 0x00, 0xff, 0xcd, 0x49, 0x00, 0xff, + 0xb8, 0x35, 0x00, 0xff, 0xb8, 0x35, 0x00, 0xff, + 0xcb, 0x2a, 0x00, 0xff, 0xcb, 0x2a, 0x00, 0xff, + 0xcb, 0x2a, 0x00, 0xff, 0xcb, 0x2a, 0x00, 0xff, + 0xd8, 0x1f, 0x00, 0xff, 0xd8, 0x1f, 0x00, 0xff, + 0xdd, 0x1f, 0x00, 0xff, 0xe0, 0x1f, 0x00, 0xff, + 0xe7, 0x27, 0x00, 0xff, 0xe7, 0x1b, 0x00, 0xff, + 0xe7, 0x1b, 0x00, 0xff, 0xe7, 0x1b, 0x00, 0xff, + 0xe3, 0x1d, 0x00, 0xff, 0xe3, 0x1d, 0x00, 0xff, + 0xe3, 0x1d, 0x00, 0xff, 0xe3, 0x1d, 0x00, 0xff, + 0xde, 0x1b, 0x00, 0xff, 0xe0, 0x2a, 0x00, 0xff, + 0xe0, 0x2a, 0x00, 0xff, 0xe3, 0x34, 0x00, 0xff, + 0xe4, 0x51, 0x00, 0xff, 0xe4, 0x69, 0x00, 0xff, + 0xe4, 0x80, 0x00, 0xff, 0xe6, 0x94, 0x00, 0xff, + 0xe8, 0x9e, 0x00, 0xff, 0xd3, 0x8c, 0x00, 0xff, + 0xcd, 0x69, 0x00, 0xff, 0xbb, 0x57, 0x00, 0xff, + 0xcd, 0x49, 0x00, 0xff, 0xcd, 0x49, 0x00, 0xff, + 0xcd, 0x49, 0x00, 0xff, 0xcd, 0x49, 0x00, 0xff, + 0xd8, 0x46, 0x00, 0xff, 0xd8, 0x46, 0x00, 0xff, + 0xd8, 0x42, 0x00, 0xff, 0xd8, 0x42, 0x00, 0xff, + 0xdd, 0x3b, 0x00, 0xff, 0xe0, 0x3b, 0x00, 0xff, + 0xe3, 0x3b, 0x00, 0xff, 0xe6, 0x3b, 0x00, 0xff, + 0xe9, 0x3b, 0x00, 0xff, 0xe9, 0x3b, 0x00, 0xff, + 0xe9, 0x3b, 0x00, 0xff, 0xe9, 0x33, 0x00, 0xff, + 0xe7, 0x37, 0x00, 0xff, 0xe7, 0x37, 0x00, 0xff, + 0xe7, 0x37, 0x00, 0xff, 0xe7, 0x37, 0x00, 0xff, + 0xe3, 0x34, 0x00, 0xff, 0xe3, 0x43, 0x00, 0xff, + 0xe6, 0x43, 0x00, 0xff, 0xe6, 0x52, 0x00, 0xff, + 0xe6, 0x69, 0x00, 0xff, 0xe6, 0x75, 0x00, 0xff, + 0xe8, 0x94, 0x00, 0xff, 0xe8, 0xa0, 0x00, 0xff, + 0xfa, 0xb0, 0x00, 0xff, 0xe8, 0x9e, 0x00, 0xff, + 0xe2, 0x7b, 0x00, 0xff, 0xcd, 0x69, 0x00, 0xff, + 0xe2, 0x65, 0x00, 0xff, 0xe2, 0x65, 0x00, 0xff, + 0xe2, 0x65, 0x00, 0xff, 0xe2, 0x65, 0x00, 0xff, + 0xe5, 0x5e, 0x00, 0xff, 0xe5, 0x5e, 0x00, 0xff, + 0xe5, 0x5a, 0x00, 0xff, 0xe5, 0x5a, 0x00, 0xff, + 0xe3, 0x57, 0x00, 0xff, 0xe6, 0x57, 0x00, 0xff, + 0xe9, 0x57, 0x00, 0xff, 0xec, 0x57, 0x00, 0xff, + 0xeb, 0x57, 0x00, 0xff, 0xeb, 0x57, 0x00, 0xff, + 0xeb, 0x57, 0x00, 0xff, 0xeb, 0x4f, 0x00, 0xff, + 0xeb, 0x51, 0x00, 0xff, 0xeb, 0x51, 0x00, 0xff, + 0xeb, 0x51, 0x00, 0xff, 0xeb, 0x51, 0x00, 0xff, + 0xe6, 0x52, 0x00, 0xff, 0xe9, 0x52, 0x00, 0xff, + 0xe9, 0x61, 0x00, 0xff, 0xe9, 0x6b, 0x00, 0xff, + 0xe8, 0x75, 0x00, 0xff, 0xea, 0x80, 0x00, 0xff, + 0xea, 0xa0, 0x00, 0xff, 0xec, 0xac, 0x00, 0xff, + 0xfa, 0xb0, 0x00, 0xff, 0xfa, 0xb0, 0x00, 0xff, + 0xf1, 0x8c, 0x00, 0xff, 0xf1, 0x8c, 0x00, 0xff, + 0xf7, 0x7d, 0x00, 0xff, 0xf7, 0x7d, 0x00, 0xff, + 0xf7, 0x7d, 0x00, 0xff, 0xf7, 0x7d, 0x00, 0xff, + 0xf2, 0x76, 0x00, 0xff, 0xf2, 0x76, 0x00, 0xff, + 0xf2, 0x76, 0x00, 0xff, 0xf2, 0x76, 0x00, 0xff, + 0xe9, 0x73, 0x00, 0xff, 0xec, 0x73, 0x00, 0xff, + 0xf1, 0x73, 0x00, 0xff, 0xf1, 0x73, 0x00, 0xff, + 0xed, 0x6f, 0x00, 0xff, 0xed, 0x6f, 0x00, 0xff, + 0xed, 0x6f, 0x00, 0xff, 0xed, 0x6f, 0x00, 0xff, + 0xef, 0x6b, 0x00, 0xff, 0xef, 0x6b, 0x00, 0xff, + 0xef, 0x6b, 0x00, 0xff, 0xef, 0x6b, 0x00, 0xff, + 0xeb, 0x6b, 0x00, 0xff, 0xeb, 0x6b, 0x00, 0xff, + 0xee, 0x7a, 0x00, 0xff, 0xee, 0x7a, 0x00, 0xff, + 0xec, 0x80, 0x00, 0xff, 0xec, 0x94, 0x00, 0xff, + 0xee, 0xac, 0x00, 0xff, 0xee, 0xc4, 0x00, 0xff, + ]) +} + +var img_32x32_rgb_etc2 = { + compressed: new Uint8Array([ + 0x8d, 0x9d, 0xb6, 0x4a, 0xc4, 0x80, 0x83, 0x97, + 0x64, 0x74, 0x95, 0x4b, 0xae, 0xa2, 0x91, 0x05, + 0x74, 0x85, 0xa7, 0x25, 0xfa, 0xa6, 0xff, 0x42, + 0x64, 0x74, 0x85, 0x49, 0xae, 0xea, 0x89, 0xba, + 0x64, 0x74, 0x7c, 0x4b, 0xa8, 0x8a, 0xa4, 0x81, + 0x73, 0x73, 0x85, 0x29, 0xab, 0xa3, 0x3e, 0x2a, + 0x75, 0x74, 0x86, 0x25, 0xaa, 0x6e, 0x71, 0x11, + 0xbe, 0x7f, 0x04, 0x62, 0xbb, 0x6c, 0x86, 0xcf, + + 0x74, 0x74, 0x97, 0x48, 0xec, 0xf0, 0x50, 0xe6, + 0x21, 0x30, 0x5f, 0x4a, 0xbd, 0xe8, 0x8e, 0x5b, + 0x10, 0x27, 0x3a, 0x46, 0x8c, 0xe2, 0x87, 0x10, + 0x1e, 0x18, 0x48, 0x07, 0x6b, 0x31, 0xe9, 0xa9, + 0x05, 0x13, 0x23, 0x57, 0x66, 0xd6, 0x34, 0xc4, + 0x43, 0x4e, 0x5c, 0x2b, 0xbd, 0xee, 0x59, 0xb4, + 0x57, 0x44, 0x55, 0x45, 0x44, 0x2b, 0xa9, 0x01, + 0x9a, 0x48, 0x41, 0x2e, 0x00, 0x31, 0xf0, 0xc5, + + 0x6c, 0x7c, 0x9e, 0x4a, 0xfb, 0xf2, 0xd8, 0x58, + 0x18, 0x20, 0x4a, 0x27, 0x6b, 0x90, 0x0e, 0x35, + 0x00, 0x0b, 0x29, 0x2f, 0xcc, 0x29, 0xf0, 0x87, + 0x03, 0x10, 0x2f, 0x26, 0x76, 0x48, 0x29, 0x19, + 0x33, 0x18, 0x40, 0x26, 0x06, 0x76, 0x2e, 0x3e, + 0xb9, 0x06, 0x32, 0x2b, 0x02, 0x13, 0x10, 0x03, + 0x49, 0x15, 0xd0, 0x06, 0xcc, 0xe9, 0x02, 0x33, + 0x6a, 0x06, 0x6b, 0x33, 0xf1, 0x05, 0x01, 0xff, + + 0x74, 0x95, 0xa6, 0x2c, 0x70, 0xf0, 0xbe, 0x5c, + 0x1d, 0x1d, 0x32, 0x4e, 0xfe, 0xf6, 0x4c, 0xe8, + 0x00, 0x01, 0x37, 0x2a, 0x0c, 0x63, 0x0c, 0x6b, + 0x23, 0x28, 0x43, 0x26, 0x03, 0x11, 0xea, 0xd1, + 0x63, 0x30, 0x66, 0x46, 0x05, 0x23, 0x5b, 0xa1, + 0xf3, 0x12, 0x93, 0x46, 0x0b, 0x57, 0x06, 0xa8, + 0x60, 0x86, 0x04, 0xf6, 0x18, 0x46, 0x80, 0x00, + 0x72, 0xa6, 0x0d, 0x73, 0x8b, 0x2f, 0x64, 0x48, + + 0x50, 0x6c, 0x85, 0x6b, 0xec, 0x00, 0xc0, 0x1f, + 0x31, 0x40, 0x63, 0x6c, 0x71, 0xfc, 0x2d, 0x09, + 0x07, 0x01, 0x33, 0x6b, 0x6f, 0x73, 0xa1, 0x33, + 0xeb, 0x35, 0x53, 0x5a, 0x02, 0x7f, 0x31, 0x83, + 0x7b, 0x55, 0x67, 0x27, 0x84, 0x6f, 0x61, 0x29, + 0x51, 0x05, 0x68, 0x8b, 0xfe, 0x00, 0xfe, 0x21, + 0xe0, 0x01, 0x09, 0x22, 0x0c, 0x1f, 0x70, 0x03, + 0x72, 0x9e, 0x0c, 0x7a, 0xa1, 0x2f, 0x43, 0x87, + + 0x77, 0x6d, 0x8f, 0x4a, 0xff, 0x70, 0x36, 0x3e, + 0x0e, 0x15, 0x43, 0x67, 0x13, 0x33, 0x62, 0xfc, + 0xb8, 0x04, 0xb1, 0xb3, 0x31, 0xcf, 0x01, 0x11, + 0x83, 0x44, 0x64, 0x47, 0x96, 0x18, 0x80, 0x5c, + 0x58, 0x14, 0xc9, 0x1a, 0x01, 0x77, 0x72, 0x08, + 0xd9, 0x0f, 0x08, 0x42, 0xef, 0xef, 0x89, 0x03, + 0x74, 0x80, 0x04, 0xf7, 0x14, 0x3f, 0x00, 0x42, + 0x74, 0x9c, 0x07, 0xf7, 0x9b, 0x2f, 0x43, 0x47, + + 0x98, 0x84, 0xa5, 0x0e, 0xf1, 0xd2, 0x10, 0xec, + 0xb8, 0xbc, 0xfa, 0xc2, 0x10, 0x85, 0xc8, 0xd2, + 0x51, 0x05, 0x41, 0x2a, 0x01, 0x11, 0x30, 0x6f, + 0xb3, 0x10, 0x10, 0x03, 0x24, 0x57, 0x8b, 0x3a, + 0xca, 0x08, 0x10, 0x22, 0x73, 0x33, 0x9f, 0x89, + 0x6c, 0x80, 0x05, 0x72, 0x04, 0x0e, 0xe2, 0x46, + 0x70, 0x80, 0x04, 0x76, 0x1c, 0x56, 0xe2, 0x03, + 0x74, 0xa6, 0x0c, 0xfa, 0xa5, 0x37, 0x0a, 0x50, + + 0xdf, 0x94, 0x8d, 0x4a, 0x73, 0x31, 0xb9, 0x9c, + 0xd2, 0x53, 0x53, 0x47, 0x77, 0x77, 0x99, 0x88, + 0x64, 0xae, 0x0d, 0xe6, 0x26, 0x5f, 0xf1, 0xe4, + 0x6a, 0xa0, 0x0c, 0xf2, 0x1e, 0x47, 0x71, 0xe3, + 0x72, 0xa2, 0x0c, 0xf3, 0x18, 0x4f, 0x71, 0xa0, + 0x70, 0x9c, 0x0c, 0x72, 0x1c, 0x47, 0x90, 0xa2, + 0x6e, 0x9a, 0x0c, 0x72, 0x3c, 0x6f, 0x70, 0x61, + 0x70, 0x54, 0x15, 0x73, 0xa7, 0x3f, 0x72, 0x22, + ]), + decompressed: new Uint8Array([ + 0xa9, 0xb9, 0xd2, 0xff, 0xa9, 0xb9, 0xd2, 0xff, + 0x90, 0xa1, 0xc2, 0xff, 0x7c, 0x8d, 0xae, 0xff, + 0x80, 0x90, 0xb1, 0xff, 0x6c, 0x7c, 0x9d, 0xff, + 0x80, 0x90, 0xb1, 0xff, 0x80, 0x90, 0xb1, 0xff, + 0x7c, 0x8d, 0xaf, 0xff, 0x7c, 0x8d, 0xaf, 0xff, + 0x88, 0x99, 0xbb, 0xff, 0x66, 0x77, 0x99, 0xff, + 0x6f, 0x80, 0x91, 0xff, 0x83, 0x94, 0xa5, 0xff, + 0x83, 0x94, 0xa5, 0xff, 0x6f, 0x80, 0x91, 0xff, + 0x80, 0x90, 0x98, 0xff, 0x6c, 0x7c, 0x84, 0xff, + 0x6c, 0x7c, 0x84, 0xff, 0x6c, 0x7c, 0x84, 0xff, + 0x72, 0x72, 0x83, 0xff, 0x7c, 0x7c, 0x8d, 0xff, + 0x72, 0x72, 0x83, 0xff, 0x88, 0x88, 0x99, 0xff, + 0x88, 0x88, 0x99, 0xff, 0x88, 0x88, 0x99, 0xff, + 0x88, 0x88, 0x99, 0xff, 0x88, 0x88, 0x99, 0xff, + 0x7d, 0x7e, 0x82, 0xff, 0x8f, 0x8d, 0x8f, 0xff, + 0xa0, 0x9d, 0x9c, 0xff, 0xb2, 0xac, 0xa9, 0xff, + 0xa9, 0xb9, 0xd2, 0xff, 0x95, 0xa5, 0xbe, 0xff, + 0x90, 0xa1, 0xc2, 0xff, 0x7c, 0x8d, 0xae, 0xff, + 0x5a, 0x6a, 0x8b, 0xff, 0x5a, 0x6a, 0x8b, 0xff, + 0x5a, 0x6a, 0x8b, 0xff, 0x5a, 0x6a, 0x8b, 0xff, + 0x66, 0x77, 0x99, 0xff, 0x72, 0x83, 0xa5, 0xff, + 0x66, 0x77, 0x99, 0xff, 0x66, 0x77, 0x99, 0xff, + 0x49, 0x5a, 0x6b, 0xff, 0x49, 0x5a, 0x6b, 0xff, + 0x5d, 0x6e, 0x7f, 0xff, 0x5d, 0x6e, 0x7f, 0xff, + 0x5a, 0x6a, 0x72, 0xff, 0x6c, 0x7c, 0x84, 0xff, + 0x6c, 0x7c, 0x84, 0xff, 0x46, 0x56, 0x5e, 0xff, + 0x66, 0x66, 0x77, 0xff, 0x66, 0x66, 0x77, 0xff, + 0x66, 0x66, 0x77, 0xff, 0x66, 0x66, 0x77, 0xff, + 0x72, 0x72, 0x83, 0xff, 0x72, 0x72, 0x83, 0xff, + 0x72, 0x72, 0x83, 0xff, 0x66, 0x66, 0x77, 0xff, + 0x82, 0x6c, 0x71, 0xff, 0x94, 0x7b, 0x7e, 0xff, + 0xa5, 0x8b, 0x8b, 0xff, 0xb7, 0x9a, 0x98, 0xff, + 0xa9, 0xb9, 0xd2, 0xff, 0x95, 0xa5, 0xbe, 0xff, + 0x6a, 0x7b, 0x9c, 0xff, 0x6a, 0x7b, 0x9c, 0xff, + 0x5f, 0x6f, 0x98, 0xff, 0x4b, 0x5b, 0x84, 0xff, + 0x39, 0x49, 0x72, 0xff, 0x4b, 0x5b, 0x84, 0xff, + 0x3f, 0x50, 0x72, 0xff, 0x55, 0x66, 0x88, 0xff, + 0x55, 0x66, 0x88, 0xff, 0x33, 0x44, 0x66, 0xff, + 0x4d, 0x4d, 0x5e, 0xff, 0x3b, 0x3b, 0x4c, 0xff, + 0x3b, 0x3b, 0x4c, 0xff, 0x4d, 0x4d, 0x5e, 0xff, + 0x4b, 0x5b, 0x63, 0xff, 0x4b, 0x5b, 0x63, 0xff, + 0x5f, 0x6f, 0x77, 0xff, 0x4b, 0x5b, 0x63, 0xff, + 0x3c, 0x3c, 0x5e, 0xff, 0x3c, 0x3c, 0x5e, 0xff, + 0x50, 0x50, 0x72, 0xff, 0x3c, 0x3c, 0x5e, 0xff, + 0x50, 0x3f, 0x61, 0xff, 0x50, 0x3f, 0x61, 0xff, + 0x5a, 0x49, 0x6b, 0xff, 0x66, 0x55, 0x77, 0xff, + 0x88, 0x5a, 0x5f, 0xff, 0x99, 0x69, 0x6c, 0xff, + 0xab, 0x79, 0x79, 0xff, 0xbc, 0x88, 0x86, 0xff, + 0x95, 0xa5, 0xbe, 0xff, 0x6f, 0x7f, 0x98, 0xff, + 0x7c, 0x8d, 0xae, 0xff, 0x56, 0x67, 0x88, 0xff, + 0x4b, 0x5b, 0x84, 0xff, 0x39, 0x49, 0x72, 0xff, + 0x39, 0x49, 0x72, 0xff, 0x25, 0x35, 0x5e, 0xff, + 0x49, 0x5a, 0x7c, 0xff, 0x3f, 0x50, 0x72, 0xff, + 0x33, 0x44, 0x66, 0xff, 0x33, 0x44, 0x66, 0xff, + 0x27, 0x27, 0x38, 0xff, 0x27, 0x27, 0x38, 0xff, + 0x27, 0x27, 0x38, 0xff, 0x27, 0x27, 0x38, 0xff, + 0x39, 0x49, 0x51, 0xff, 0x25, 0x35, 0x3d, 0xff, + 0x39, 0x49, 0x51, 0xff, 0x25, 0x35, 0x3d, 0xff, + 0x50, 0x50, 0x72, 0xff, 0x2a, 0x2a, 0x4c, 0xff, + 0x16, 0x16, 0x38, 0xff, 0x2a, 0x2a, 0x4c, 0xff, + 0x50, 0x3f, 0x61, 0xff, 0x5a, 0x49, 0x6b, 0xff, + 0x50, 0x3f, 0x61, 0xff, 0x50, 0x3f, 0x61, 0xff, + 0x8d, 0x48, 0x4e, 0xff, 0x9e, 0x57, 0x5b, 0xff, + 0xb0, 0x67, 0x68, 0xff, 0xc1, 0x76, 0x75, 0xff, + 0x80, 0x80, 0xa2, 0xff, 0x6e, 0x6e, 0x90, 0xff, + 0x4d, 0x4d, 0x80, 0xff, 0x61, 0x61, 0x94, 0xff, + 0x3e, 0x4e, 0x77, 0xff, 0x3e, 0x4e, 0x77, 0xff, + 0x20, 0x28, 0x49, 0xff, 0x20, 0x28, 0x49, 0xff, + 0x19, 0x2a, 0x42, 0xff, 0x2d, 0x3e, 0x56, 0xff, + 0x21, 0x29, 0x5b, 0xff, 0x15, 0x1d, 0x4f, 0xff, + 0x10, 0x10, 0x42, 0xff, 0x16, 0x16, 0x48, 0xff, + 0x10, 0x10, 0x42, 0xff, 0x1a, 0x1a, 0x4c, 0xff, + 0x11, 0x11, 0x33, 0xff, 0x22, 0x33, 0x55, 0xff, + 0x11, 0x11, 0x33, 0xff, 0x32, 0x43, 0x65, 0xff, + 0x47, 0x4f, 0x5f, 0xff, 0x53, 0x5b, 0x6b, 0xff, + 0x31, 0x39, 0x49, 0xff, 0x31, 0x39, 0x49, 0xff, + 0x38, 0x27, 0x38, 0xff, 0x5e, 0x4d, 0x5e, 0xff, + 0x72, 0x61, 0x72, 0xff, 0x5e, 0x4d, 0x5e, 0xff, + 0x8b, 0x39, 0x31, 0xff, 0x97, 0x45, 0x3d, 0xff, + 0xba, 0x57, 0x57, 0xff, 0xd7, 0x74, 0x74, 0xff, + 0x94, 0x94, 0xb6, 0xff, 0x5a, 0x5a, 0x7c, 0xff, + 0x4d, 0x4d, 0x80, 0xff, 0x3b, 0x3b, 0x6e, 0xff, + 0x3e, 0x4e, 0x77, 0xff, 0x18, 0x28, 0x51, 0xff, + 0x46, 0x4e, 0x6f, 0xff, 0x20, 0x28, 0x49, 0xff, + 0x07, 0x18, 0x30, 0xff, 0x07, 0x18, 0x30, 0xff, + 0x21, 0x29, 0x5b, 0xff, 0x15, 0x1d, 0x4f, 0xff, + 0x1a, 0x1a, 0x4c, 0xff, 0x10, 0x10, 0x42, 0xff, + 0x16, 0x16, 0x48, 0xff, 0x10, 0x10, 0x42, 0xff, + 0x22, 0x33, 0x55, 0xff, 0x11, 0x11, 0x33, 0xff, + 0x22, 0x33, 0x55, 0xff, 0x12, 0x23, 0x45, 0xff, + 0x3d, 0x45, 0x55, 0xff, 0x31, 0x39, 0x49, 0xff, + 0x47, 0x4f, 0x5f, 0xff, 0x3d, 0x45, 0x55, 0xff, + 0x4c, 0x3b, 0x4c, 0xff, 0x4c, 0x3b, 0x4c, 0xff, + 0x5e, 0x4d, 0x5e, 0xff, 0x72, 0x61, 0x72, 0xff, + 0xa1, 0x4f, 0x47, 0xff, 0x97, 0x45, 0x3d, 0xff, + 0xba, 0x57, 0x57, 0xff, 0xd7, 0x74, 0x74, 0xff, + 0x94, 0x94, 0xb6, 0xff, 0x5a, 0x5a, 0x7c, 0xff, + 0x3b, 0x3b, 0x6e, 0xff, 0x27, 0x27, 0x5a, 0xff, + 0x2a, 0x3a, 0x63, 0xff, 0x04, 0x14, 0x3d, 0xff, + 0x0c, 0x14, 0x35, 0xff, 0x32, 0x3a, 0x5b, 0xff, + 0x19, 0x2a, 0x42, 0xff, 0x07, 0x18, 0x30, 0xff, + 0x00, 0x07, 0x39, 0xff, 0x15, 0x1d, 0x4f, 0xff, + 0x0d, 0x1d, 0x4f, 0xff, 0x0d, 0x1d, 0x4f, 0xff, + 0x0d, 0x1d, 0x4f, 0xff, 0x00, 0x07, 0x39, 0xff, + 0x12, 0x23, 0x45, 0xff, 0x12, 0x23, 0x45, 0xff, + 0x12, 0x23, 0x45, 0xff, 0x22, 0x33, 0x55, 0xff, + 0x3d, 0x1c, 0x1c, 0xff, 0x51, 0x30, 0x30, 0xff, + 0x51, 0x30, 0x30, 0xff, 0x77, 0x56, 0x56, 0xff, + 0x7c, 0x49, 0x5a, 0xff, 0x7c, 0x49, 0x5a, 0xff, + 0x72, 0x3f, 0x50, 0xff, 0x72, 0x3f, 0x50, 0xff, + 0xad, 0x5b, 0x53, 0xff, 0xad, 0x5b, 0x53, 0xff, + 0xba, 0x57, 0x57, 0xff, 0xd7, 0x74, 0x74, 0xff, + 0x80, 0x80, 0xa2, 0xff, 0x5a, 0x5a, 0x7c, 0xff, + 0x3b, 0x3b, 0x6e, 0xff, 0x3b, 0x3b, 0x6e, 0xff, + 0x04, 0x14, 0x3d, 0xff, 0x18, 0x28, 0x51, 0xff, + 0x0c, 0x14, 0x35, 0xff, 0x0c, 0x14, 0x35, 0xff, + 0x19, 0x2a, 0x42, 0xff, 0x07, 0x18, 0x30, 0xff, + 0x0b, 0x13, 0x45, 0xff, 0x00, 0x07, 0x39, 0xff, + 0x19, 0x29, 0x5b, 0xff, 0x19, 0x29, 0x5b, 0xff, + 0x00, 0x07, 0x39, 0xff, 0x19, 0x29, 0x5b, 0xff, + 0x11, 0x11, 0x33, 0xff, 0x12, 0x23, 0x45, 0xff, + 0x11, 0x11, 0x33, 0xff, 0x11, 0x11, 0x33, 0xff, + 0x51, 0x30, 0x30, 0xff, 0x3d, 0x1c, 0x1c, 0xff, + 0x3d, 0x1c, 0x1c, 0xff, 0x51, 0x30, 0x30, 0xff, + 0x72, 0x3f, 0x50, 0xff, 0x7c, 0x49, 0x5a, 0xff, + 0x88, 0x55, 0x66, 0xff, 0x88, 0x55, 0x66, 0xff, + 0xa1, 0x4f, 0x47, 0xff, 0xad, 0x5b, 0x53, 0xff, + 0xba, 0x57, 0x57, 0xff, 0xd7, 0x74, 0x74, 0xff, + 0x74, 0x84, 0xa5, 0xff, 0x4e, 0x5e, 0x7f, 0xff, + 0x41, 0x51, 0x83, 0xff, 0x2d, 0x3d, 0x6f, 0xff, + 0x29, 0x32, 0x5b, 0xff, 0x07, 0x10, 0x39, 0xff, + 0x13, 0x1c, 0x45, 0xff, 0x1d, 0x26, 0x4f, 0xff, + 0x00, 0x00, 0x18, 0xff, 0x05, 0x0d, 0x2e, 0xff, + 0x05, 0x0d, 0x2e, 0xff, 0x11, 0x19, 0x3a, 0xff, + 0x11, 0x21, 0x3a, 0xff, 0x11, 0x21, 0x3a, 0xff, + 0x29, 0x21, 0x32, 0xff, 0x13, 0x0b, 0x1c, 0xff, + 0x36, 0x1d, 0x47, 0xff, 0x20, 0x07, 0x31, 0xff, + 0x4f, 0x1d, 0x47, 0xff, 0x4f, 0x1d, 0x47, 0xff, + 0x56, 0x34, 0x45, 0xff, 0x76, 0x54, 0x65, 0xff, + 0x87, 0x32, 0x54, 0xff, 0x67, 0x12, 0x34, 0xff, + 0x93, 0x00, 0x00, 0xff, 0x82, 0x1c, 0x1c, 0xff, + 0xb0, 0x4a, 0x4a, 0xff, 0xb0, 0x4a, 0x4a, 0xff, + 0xd2, 0x5b, 0x5b, 0xff, 0xd2, 0x39, 0x39, 0xff, + 0xd2, 0x5b, 0x5b, 0xff, 0xe8, 0x71, 0x71, 0xff, + 0x62, 0x72, 0x93, 0xff, 0x62, 0x72, 0x93, 0xff, + 0x41, 0x51, 0x83, 0xff, 0x41, 0x51, 0x83, 0xff, + 0x1d, 0x26, 0x4f, 0xff, 0x29, 0x32, 0x5b, 0xff, + 0x07, 0x10, 0x39, 0xff, 0x13, 0x1c, 0x45, 0xff, + 0x11, 0x19, 0x3a, 0xff, 0x00, 0x03, 0x24, 0xff, + 0x05, 0x0d, 0x2e, 0xff, 0x11, 0x19, 0x3a, 0xff, + 0x05, 0x15, 0x2e, 0xff, 0x05, 0x15, 0x2e, 0xff, + 0x13, 0x0b, 0x1c, 0xff, 0x07, 0x00, 0x10, 0xff, + 0x20, 0x07, 0x31, 0xff, 0x20, 0x07, 0x31, 0xff, + 0x39, 0x07, 0x31, 0xff, 0x5b, 0x29, 0x53, 0xff, + 0x56, 0x34, 0x45, 0xff, 0x87, 0x32, 0x54, 0xff, + 0x76, 0x54, 0x65, 0xff, 0x87, 0x32, 0x54, 0xff, + 0x82, 0x1c, 0x1c, 0xff, 0x93, 0x00, 0x00, 0xff, + 0x82, 0x1c, 0x1c, 0xff, 0xb0, 0x4a, 0x4a, 0xff, + 0xd2, 0x39, 0x39, 0xff, 0xd2, 0x39, 0x39, 0xff, + 0xe8, 0x4f, 0x4f, 0xff, 0xe8, 0x71, 0x71, 0xff, + 0x74, 0x84, 0xa5, 0xff, 0x4e, 0x5e, 0x7f, 0xff, + 0x53, 0x63, 0x95, 0xff, 0x2d, 0x3d, 0x6f, 0xff, + 0x29, 0x32, 0x6b, 0xff, 0x1d, 0x26, 0x5f, 0xff, + 0x29, 0x32, 0x6b, 0xff, 0x13, 0x1c, 0x55, 0xff, + 0x2a, 0x4b, 0x5b, 0xff, 0x0d, 0x2e, 0x3e, 0xff, + 0x00, 0x14, 0x24, 0xff, 0x00, 0x00, 0x07, 0xff, + 0x05, 0x15, 0x2e, 0xff, 0x00, 0x0b, 0x24, 0xff, + 0x13, 0x0b, 0x1c, 0xff, 0x13, 0x0b, 0x1c, 0xff, + 0x20, 0x07, 0x31, 0xff, 0x2c, 0x13, 0x3d, 0xff, + 0x39, 0x07, 0x31, 0xff, 0x4f, 0x1d, 0x47, 0xff, + 0x87, 0x32, 0x54, 0xff, 0x87, 0x32, 0x54, 0xff, + 0x87, 0x32, 0x54, 0xff, 0x87, 0x32, 0x54, 0xff, + 0xb0, 0x4a, 0x4a, 0xff, 0xc1, 0x17, 0x17, 0xff, + 0xc1, 0x17, 0x17, 0xff, 0xc1, 0x17, 0x17, 0xff, + 0xd2, 0x5b, 0x5b, 0xff, 0xd2, 0x39, 0x39, 0xff, + 0xe8, 0x4f, 0x4f, 0xff, 0xe8, 0x71, 0x71, 0xff, + 0x88, 0x98, 0xb9, 0xff, 0x62, 0x72, 0x93, 0xff, + 0x2d, 0x3d, 0x6f, 0xff, 0x2d, 0x3d, 0x6f, 0xff, + 0x1d, 0x26, 0x5f, 0xff, 0x13, 0x1c, 0x55, 0xff, + 0x07, 0x10, 0x49, 0xff, 0x1d, 0x26, 0x5f, 0xff, + 0x00, 0x14, 0x24, 0xff, 0x2a, 0x4b, 0x5b, 0xff, + 0x00, 0x14, 0x24, 0xff, 0x00, 0x00, 0x07, 0xff, + 0x00, 0x00, 0x18, 0xff, 0x05, 0x15, 0x2e, 0xff, + 0x29, 0x21, 0x32, 0xff, 0x1d, 0x15, 0x26, 0xff, + 0x42, 0x29, 0x53, 0xff, 0x36, 0x1d, 0x47, 0xff, + 0x5b, 0x29, 0x53, 0xff, 0x4f, 0x1d, 0x47, 0xff, + 0x87, 0x32, 0x54, 0xff, 0x87, 0x32, 0x54, 0xff, + 0x87, 0x32, 0x54, 0xff, 0x87, 0x32, 0x54, 0xff, + 0xc1, 0x17, 0x17, 0xff, 0xc1, 0x17, 0x17, 0xff, + 0xc1, 0x17, 0x17, 0xff, 0xc1, 0x17, 0x17, 0xff, + 0xd2, 0x39, 0x39, 0xff, 0xd2, 0x39, 0x39, 0xff, + 0xe8, 0x4f, 0x4f, 0xff, 0xe8, 0x71, 0x71, 0xff, + 0x7c, 0x9e, 0xaf, 0xff, 0x66, 0x88, 0x99, 0xff, + 0x51, 0x62, 0x73, 0xff, 0x1a, 0x2b, 0x3c, 0xff, + 0x21, 0x21, 0x3a, 0xff, 0x0f, 0x0f, 0x28, 0xff, + 0x0d, 0x0d, 0x4f, 0xff, 0x00, 0x00, 0x35, 0xff, + 0x00, 0x00, 0x20, 0xff, 0x05, 0x05, 0x36, 0xff, + 0x09, 0x11, 0x32, 0xff, 0x09, 0x11, 0x32, 0xff, + 0x10, 0x18, 0x31, 0xff, 0x10, 0x18, 0x31, 0xff, + 0x34, 0x24, 0x55, 0xff, 0x3e, 0x2e, 0x5f, 0xff, + 0x46, 0x14, 0x46, 0xff, 0x6c, 0x3a, 0x6c, 0xff, + 0x6a, 0x20, 0x41, 0xff, 0x8c, 0x42, 0x63, 0xff, + 0x99, 0x33, 0x44, 0xff, 0x99, 0x33, 0x44, 0xff, + 0x99, 0x33, 0x44, 0xff, 0xbb, 0x11, 0x22, 0xff, + 0xc3, 0x06, 0x04, 0xff, 0xcd, 0x0b, 0x0b, 0xff, + 0xd7, 0x0f, 0x12, 0xff, 0xe1, 0x14, 0x19, 0xff, + 0xe7, 0x26, 0x28, 0xff, 0xe7, 0x3f, 0x44, 0xff, + 0xe7, 0x59, 0x5f, 0xff, 0xe7, 0x72, 0x7b, 0xff, + 0x7c, 0x9e, 0xaf, 0xff, 0x72, 0x94, 0xa5, 0xff, + 0x6e, 0x7f, 0x90, 0xff, 0x1a, 0x2b, 0x3c, 0xff, + 0x0f, 0x0f, 0x28, 0xff, 0x00, 0x00, 0x14, 0xff, + 0x00, 0x00, 0x35, 0xff, 0x00, 0x00, 0x35, 0xff, + 0x00, 0x00, 0x20, 0xff, 0x00, 0x00, 0x20, 0xff, + 0x09, 0x11, 0x32, 0xff, 0x09, 0x11, 0x32, 0xff, + 0x26, 0x2e, 0x47, 0xff, 0x26, 0x2e, 0x47, 0xff, + 0x28, 0x18, 0x49, 0xff, 0x4a, 0x3a, 0x6b, 0xff, + 0x5a, 0x28, 0x5a, 0xff, 0x46, 0x14, 0x46, 0xff, + 0x8c, 0x42, 0x63, 0xff, 0x80, 0x36, 0x57, 0xff, + 0x99, 0x33, 0x44, 0xff, 0xa4, 0x3e, 0x4f, 0xff, + 0x8e, 0x28, 0x39, 0xff, 0xbb, 0x11, 0x22, 0xff, + 0xc7, 0x05, 0x03, 0xff, 0xd1, 0x09, 0x0a, 0xff, + 0xdb, 0x0e, 0x11, 0xff, 0xe5, 0x12, 0x18, 0xff, + 0xe9, 0x25, 0x26, 0xff, 0xe9, 0x3e, 0x42, 0xff, + 0xe9, 0x58, 0x5d, 0xff, 0xe9, 0x71, 0x79, 0xff, + 0x88, 0xaa, 0xbb, 0xff, 0x66, 0x88, 0x99, 0xff, + 0x6e, 0x7f, 0x90, 0xff, 0x37, 0x48, 0x59, 0xff, + 0x0f, 0x0f, 0x28, 0xff, 0x00, 0x00, 0x14, 0xff, + 0x00, 0x00, 0x18, 0xff, 0x00, 0x00, 0x18, 0xff, + 0x05, 0x05, 0x36, 0xff, 0x00, 0x00, 0x20, 0xff, + 0x00, 0x00, 0x0c, 0xff, 0x09, 0x11, 0x32, 0xff, + 0x26, 0x2e, 0x47, 0xff, 0x32, 0x3a, 0x53, 0xff, + 0x3e, 0x2e, 0x5f, 0xff, 0x4a, 0x3a, 0x6b, 0xff, + 0x6c, 0x3a, 0x6c, 0xff, 0x6c, 0x3a, 0x6c, 0xff, + 0x76, 0x2c, 0x4d, 0xff, 0x8c, 0x42, 0x63, 0xff, + 0x99, 0x33, 0x44, 0xff, 0x99, 0x33, 0x44, 0xff, + 0xa4, 0x3e, 0x4f, 0xff, 0xbb, 0x11, 0x22, 0xff, + 0xcb, 0x03, 0x02, 0xff, 0xd5, 0x08, 0x09, 0xff, + 0xdf, 0x0c, 0x10, 0xff, 0xe9, 0x11, 0x17, 0xff, + 0xeb, 0x24, 0x24, 0xff, 0xeb, 0x3d, 0x40, 0xff, + 0xeb, 0x57, 0x5b, 0xff, 0xeb, 0x70, 0x77, 0xff, + 0x88, 0xaa, 0xbb, 0xff, 0x72, 0x94, 0xa5, 0xff, + 0x6e, 0x7f, 0x90, 0xff, 0x6e, 0x7f, 0x90, 0xff, + 0x35, 0x35, 0x4e, 0xff, 0x00, 0x00, 0x14, 0xff, + 0x00, 0x00, 0x18, 0xff, 0x00, 0x00, 0x35, 0xff, + 0x11, 0x11, 0x42, 0xff, 0x05, 0x05, 0x36, 0xff, + 0x00, 0x00, 0x0c, 0xff, 0x09, 0x11, 0x32, 0xff, + 0x26, 0x2e, 0x47, 0xff, 0x32, 0x3a, 0x53, 0xff, + 0x4a, 0x3a, 0x6b, 0xff, 0x4a, 0x3a, 0x6b, 0xff, + 0x6c, 0x3a, 0x6c, 0xff, 0x80, 0x4e, 0x80, 0xff, + 0x8c, 0x42, 0x63, 0xff, 0x80, 0x36, 0x57, 0xff, + 0xa4, 0x3e, 0x4f, 0xff, 0xa4, 0x3e, 0x4f, 0xff, + 0x99, 0x33, 0x44, 0xff, 0xbb, 0x11, 0x22, 0xff, + 0xcf, 0x02, 0x01, 0xff, 0xd9, 0x06, 0x08, 0xff, + 0xe3, 0x0b, 0x0f, 0xff, 0xed, 0x0f, 0x16, 0xff, + 0xed, 0x23, 0x22, 0xff, 0xed, 0x3c, 0x3e, 0xff, + 0xed, 0x56, 0x59, 0xff, 0xed, 0x6f, 0x75, 0xff, + 0x7c, 0x95, 0xae, 0xff, 0x7c, 0x95, 0xae, 0xff, + 0x5f, 0x78, 0x91, 0xff, 0x5f, 0x78, 0x91, 0xff, + 0x5d, 0x6e, 0x90, 0xff, 0x26, 0x37, 0x59, 0xff, + 0x00, 0x00, 0x09, 0xff, 0x04, 0x00, 0x26, 0xff, + 0x13, 0x13, 0x46, 0xff, 0x13, 0x13, 0x46, 0xff, + 0x13, 0x13, 0x46, 0xff, 0x33, 0x00, 0x11, 0xff, + 0x3e, 0x1c, 0x3e, 0xff, 0x55, 0x33, 0x55, 0xff, + 0x6c, 0x4a, 0x6c, 0xff, 0x6c, 0x4a, 0x6c, 0xff, + 0x6a, 0x41, 0x52, 0xff, 0x80, 0x57, 0x68, 0xff, + 0x8c, 0x63, 0x74, 0xff, 0x80, 0x57, 0x68, 0xff, + 0x9f, 0x17, 0x17, 0xff, 0xb5, 0x2d, 0x2d, 0xff, + 0xb5, 0x2d, 0x2d, 0xff, 0xd2, 0x06, 0x06, 0xff, + 0xd6, 0x00, 0x00, 0xff, 0xe2, 0x00, 0x03, 0xff, + 0xe9, 0x0a, 0x12, 0xff, 0xef, 0x10, 0x18, 0xff, + 0xe7, 0x1e, 0x20, 0xff, 0xea, 0x3f, 0x3e, 0xff, + 0xed, 0x60, 0x5b, 0xff, 0xf0, 0x80, 0x79, 0xff, + 0x7c, 0x95, 0xae, 0xff, 0x5f, 0x78, 0x91, 0xff, + 0x5f, 0x78, 0x91, 0xff, 0x45, 0x5e, 0x77, 0xff, + 0x40, 0x51, 0x73, 0xff, 0x26, 0x37, 0x59, 0xff, + 0x1e, 0x0d, 0x40, 0xff, 0x00, 0x00, 0x09, 0xff, + 0x13, 0x13, 0x46, 0xff, 0x13, 0x13, 0x46, 0xff, + 0x33, 0x33, 0x66, 0xff, 0x13, 0x13, 0x46, 0xff, + 0x3e, 0x1c, 0x3e, 0xff, 0x55, 0x33, 0x55, 0xff, + 0x55, 0x33, 0x55, 0xff, 0x6c, 0x4a, 0x6c, 0xff, + 0x76, 0x4d, 0x5e, 0xff, 0x6a, 0x41, 0x52, 0xff, + 0x80, 0x57, 0x68, 0xff, 0x8c, 0x63, 0x74, 0xff, + 0xb5, 0x2d, 0x2d, 0xff, 0x9f, 0x17, 0x17, 0xff, + 0xd2, 0x06, 0x06, 0xff, 0xd2, 0x06, 0x06, 0xff, + 0xd6, 0x00, 0x00, 0xff, 0xec, 0x05, 0x0d, 0xff, + 0xe9, 0x0a, 0x12, 0xff, 0xef, 0x10, 0x18, 0xff, + 0xe8, 0x1e, 0x1f, 0xff, 0xeb, 0x3e, 0x3d, 0xff, + 0xee, 0x5f, 0x5a, 0xff, 0xf1, 0x80, 0x78, 0xff, + 0x6f, 0x67, 0x88, 0xff, 0x5b, 0x53, 0x74, 0xff, + 0x49, 0x41, 0x62, 0xff, 0x35, 0x2d, 0x4e, 0xff, + 0x26, 0x37, 0x59, 0xff, 0x26, 0x37, 0x59, 0xff, + 0x3b, 0x2a, 0x5d, 0xff, 0x04, 0x00, 0x26, 0xff, + 0x33, 0x00, 0x11, 0xff, 0x33, 0x33, 0x66, 0xff, + 0x33, 0x33, 0x66, 0xff, 0x33, 0x33, 0x66, 0xff, + 0x55, 0x33, 0x55, 0xff, 0x55, 0x33, 0x55, 0xff, + 0x77, 0x33, 0x55, 0xff, 0x77, 0x33, 0x55, 0xff, + 0x8f, 0x34, 0x55, 0xff, 0x8f, 0x34, 0x55, 0xff, + 0x8f, 0x34, 0x55, 0xff, 0xa5, 0x4a, 0x6b, 0xff, + 0xb5, 0x2d, 0x2d, 0xff, 0xb5, 0x2d, 0x2d, 0xff, + 0xd2, 0x06, 0x06, 0xff, 0xd2, 0x06, 0x06, 0xff, + 0xe2, 0x00, 0x03, 0xff, 0xec, 0x05, 0x0d, 0xff, + 0xe5, 0x06, 0x0e, 0xff, 0xef, 0x10, 0x18, 0xff, + 0xe9, 0x1d, 0x1e, 0xff, 0xec, 0x3e, 0x3c, 0xff, + 0xef, 0x5f, 0x59, 0xff, 0xf2, 0x7f, 0x77, 0xff, + 0x6f, 0x67, 0x88, 0xff, 0x5b, 0x53, 0x74, 0xff, + 0x49, 0x41, 0x62, 0xff, 0x35, 0x2d, 0x4e, 0xff, + 0x09, 0x1a, 0x3c, 0xff, 0x26, 0x37, 0x59, 0xff, + 0x3b, 0x2a, 0x5d, 0xff, 0x1e, 0x0d, 0x40, 0xff, + 0x33, 0x00, 0x11, 0xff, 0x33, 0x00, 0x11, 0xff, + 0x33, 0x33, 0x66, 0xff, 0x53, 0x53, 0x86, 0xff, + 0x55, 0x33, 0x55, 0xff, 0x6c, 0x4a, 0x6c, 0xff, + 0x77, 0x33, 0x55, 0xff, 0x77, 0x33, 0x55, 0xff, + 0x83, 0x28, 0x49, 0xff, 0x99, 0x3e, 0x5f, 0xff, + 0x99, 0x3e, 0x5f, 0xff, 0x8f, 0x34, 0x55, 0xff, + 0xb5, 0x2d, 0x2d, 0xff, 0xb5, 0x2d, 0x2d, 0xff, + 0xd2, 0x06, 0x06, 0xff, 0xd2, 0x06, 0x06, 0xff, + 0xe2, 0x00, 0x03, 0xff, 0xec, 0x05, 0x0d, 0xff, + 0xe5, 0x06, 0x0e, 0xff, 0xe9, 0x0a, 0x12, 0xff, + 0xea, 0x1d, 0x1d, 0xff, 0xed, 0x3d, 0x3b, 0xff, + 0xf0, 0x5e, 0x58, 0xff, 0xf3, 0x7f, 0x76, 0xff, + 0x7c, 0x74, 0x95, 0xff, 0x56, 0x4e, 0x6f, 0xff, + 0x62, 0x49, 0x7b, 0xff, 0x4e, 0x35, 0x67, 0xff, + 0x44, 0x33, 0x66, 0xff, 0x34, 0x23, 0x56, 0xff, + 0x44, 0x33, 0x66, 0xff, 0x44, 0x33, 0x66, 0xff, + 0x56, 0x23, 0x56, 0xff, 0x67, 0x00, 0x01, 0xff, + 0x56, 0x23, 0x56, 0xff, 0x76, 0x43, 0x76, 0xff, + 0x8d, 0x4b, 0x6c, 0xff, 0x67, 0x25, 0x46, 0xff, + 0x8d, 0x4b, 0x6c, 0xff, 0x7b, 0x39, 0x5a, 0xff, + 0x9f, 0x28, 0x39, 0xff, 0x9f, 0x28, 0x39, 0xff, + 0x9f, 0x28, 0x39, 0xff, 0xb5, 0x0b, 0x0b, 0xff, + 0xc1, 0x00, 0x00, 0xff, 0xe7, 0x11, 0x11, 0xff, + 0xdf, 0x00, 0x00, 0xff, 0xe9, 0x02, 0x0a, 0xff, + 0xeb, 0x00, 0x04, 0xff, 0xec, 0x05, 0x0a, 0xff, + 0xed, 0x0a, 0x10, 0xff, 0xee, 0x0f, 0x16, 0xff, + 0xeb, 0x1c, 0x1c, 0xff, 0xec, 0x3c, 0x3b, 0xff, + 0xed, 0x5c, 0x59, 0xff, 0xee, 0x7b, 0x78, 0xff, + 0x90, 0x88, 0xa9, 0xff, 0x56, 0x4e, 0x6f, 0xff, + 0x4e, 0x35, 0x67, 0xff, 0x4e, 0x35, 0x67, 0xff, + 0x44, 0x33, 0x66, 0xff, 0x34, 0x23, 0x56, 0xff, + 0x34, 0x23, 0x56, 0xff, 0x54, 0x43, 0x76, 0xff, + 0x76, 0x43, 0x76, 0xff, 0x87, 0x10, 0x21, 0xff, + 0x87, 0x10, 0x21, 0xff, 0x76, 0x43, 0x76, 0xff, + 0x8d, 0x4b, 0x6c, 0xff, 0x8d, 0x4b, 0x6c, 0xff, + 0x7b, 0x39, 0x5a, 0xff, 0x8d, 0x4b, 0x6c, 0xff, + 0x9f, 0x28, 0x39, 0xff, 0x9f, 0x28, 0x39, 0xff, + 0xb5, 0x0b, 0x0b, 0xff, 0xb5, 0x0b, 0x0b, 0xff, + 0xc1, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xe5, 0x00, 0x06, 0xff, 0xe5, 0x00, 0x06, 0xff, + 0xe9, 0x01, 0x05, 0xff, 0xea, 0x06, 0x0b, 0xff, + 0xeb, 0x0b, 0x11, 0xff, 0xec, 0x10, 0x17, 0xff, + 0xeb, 0x1c, 0x1c, 0xff, 0xec, 0x3b, 0x3b, 0xff, + 0xed, 0x5b, 0x59, 0xff, 0xee, 0x7b, 0x78, 0xff, + 0x90, 0x88, 0xa9, 0xff, 0x6a, 0x62, 0x83, 0xff, + 0x4e, 0x35, 0x67, 0xff, 0x62, 0x49, 0x7b, 0xff, + 0x54, 0x43, 0x76, 0xff, 0x54, 0x43, 0x76, 0xff, + 0x66, 0x11, 0x55, 0xff, 0x54, 0x43, 0x76, 0xff, + 0x76, 0x43, 0x76, 0xff, 0x76, 0x43, 0x76, 0xff, + 0x87, 0x10, 0x21, 0xff, 0x87, 0x10, 0x21, 0xff, + 0xad, 0x32, 0x53, 0xff, 0xad, 0x32, 0x53, 0xff, + 0x97, 0x1c, 0x3d, 0xff, 0xa1, 0x26, 0x47, 0xff, + 0x9f, 0x28, 0x39, 0xff, 0x9f, 0x28, 0x39, 0xff, + 0xc1, 0x17, 0x17, 0xff, 0xb5, 0x0b, 0x0b, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xe5, 0x00, 0x06, 0xff, 0xe5, 0x00, 0x06, 0xff, + 0xe7, 0x01, 0x06, 0xff, 0xe8, 0x06, 0x0c, 0xff, + 0xe9, 0x0b, 0x12, 0xff, 0xea, 0x10, 0x18, 0xff, + 0xeb, 0x1b, 0x1c, 0xff, 0xec, 0x3b, 0x3b, 0xff, + 0xed, 0x5b, 0x59, 0xff, 0xee, 0x7a, 0x78, 0xff, + 0x90, 0x88, 0xa9, 0xff, 0x7c, 0x74, 0x95, 0xff, + 0x62, 0x49, 0x7b, 0xff, 0x62, 0x49, 0x7b, 0xff, + 0x54, 0x43, 0x76, 0xff, 0x54, 0x43, 0x76, 0xff, + 0x66, 0x11, 0x55, 0xff, 0x66, 0x11, 0x55, 0xff, + 0x76, 0x43, 0x76, 0xff, 0x76, 0x43, 0x76, 0xff, + 0x87, 0x10, 0x21, 0xff, 0x87, 0x10, 0x21, 0xff, + 0x8b, 0x10, 0x31, 0xff, 0xa1, 0x26, 0x47, 0xff, + 0xa1, 0x26, 0x47, 0xff, 0x8b, 0x10, 0x31, 0xff, + 0xb5, 0x0b, 0x0b, 0xff, 0xc1, 0x17, 0x17, 0xff, + 0xc1, 0x17, 0x17, 0xff, 0xc1, 0x17, 0x17, 0xff, + 0xd5, 0x00, 0x00, 0xff, 0xd5, 0x00, 0x00, 0xff, + 0xdf, 0x00, 0x00, 0xff, 0xdf, 0x00, 0x00, 0xff, + 0xe5, 0x02, 0x07, 0xff, 0xe6, 0x07, 0x0d, 0xff, + 0xe7, 0x0c, 0x13, 0xff, 0xe8, 0x11, 0x19, 0xff, + 0xeb, 0x1b, 0x1c, 0xff, 0xec, 0x3a, 0x3b, 0xff, + 0xed, 0x5a, 0x59, 0xff, 0xee, 0x7a, 0x78, 0xff, + 0x9e, 0x86, 0xa7, 0xff, 0x9a, 0x82, 0xa3, 0xff, + 0x8f, 0x56, 0x7f, 0xff, 0x72, 0x39, 0x62, 0xff, + 0x71, 0x3c, 0x75, 0xff, 0x75, 0x31, 0x68, 0xff, + 0x7a, 0x26, 0x5b, 0xff, 0x7e, 0x1b, 0x4e, 0xff, + 0x82, 0x1c, 0x4f, 0xff, 0x8e, 0x28, 0x5b, 0xff, + 0x8e, 0x28, 0x5b, 0xff, 0xa4, 0x1c, 0x1c, 0xff, + 0xb3, 0x0e, 0x0e, 0xff, 0xad, 0x08, 0x08, 0xff, + 0xbd, 0x18, 0x18, 0xff, 0xb7, 0x12, 0x12, 0xff, + 0xbd, 0x00, 0x00, 0xff, 0xc9, 0x03, 0x0b, 0xff, + 0xd6, 0x00, 0x08, 0xff, 0xd6, 0x00, 0x08, 0xff, + 0xdb, 0x00, 0x08, 0xff, 0xdd, 0x01, 0x07, 0xff, + 0xdf, 0x02, 0x06, 0xff, 0xe1, 0x03, 0x05, 0xff, + 0xe3, 0x00, 0x00, 0xff, 0xe5, 0x07, 0x0a, 0xff, + 0xe7, 0x0e, 0x14, 0xff, 0xe9, 0x15, 0x1e, 0xff, + 0xeb, 0x26, 0x24, 0xff, 0xed, 0x46, 0x42, 0xff, + 0xef, 0x66, 0x5f, 0xff, 0xf1, 0x85, 0x7d, 0xff, + 0x9a, 0x82, 0xa3, 0xff, 0xa4, 0x8c, 0xad, 0xff, + 0xa9, 0x70, 0x99, 0xff, 0x8f, 0x56, 0x7f, 0xff, + 0x83, 0x3f, 0x6a, 0xff, 0x88, 0x34, 0x5d, 0xff, + 0x8c, 0x29, 0x50, 0xff, 0x90, 0x1e, 0x43, 0xff, + 0xa4, 0x1c, 0x1c, 0xff, 0xa4, 0x1c, 0x1c, 0xff, + 0xb0, 0x28, 0x28, 0xff, 0xa4, 0x1c, 0x1c, 0xff, + 0xad, 0x08, 0x08, 0xff, 0xbd, 0x18, 0x18, 0xff, + 0xbd, 0x18, 0x18, 0xff, 0xb3, 0x0e, 0x0e, 0xff, + 0xc9, 0x03, 0x0b, 0xff, 0xc9, 0x03, 0x0b, 0xff, + 0xd6, 0x00, 0x08, 0xff, 0xdc, 0x06, 0x0e, 0xff, + 0xdc, 0x05, 0x0c, 0xff, 0xde, 0x06, 0x0b, 0xff, + 0xe0, 0x07, 0x0a, 0xff, 0xe2, 0x08, 0x09, 0xff, + 0xe2, 0x04, 0x03, 0xff, 0xe4, 0x0b, 0x0d, 0xff, + 0xe6, 0x12, 0x17, 0xff, 0xe8, 0x19, 0x21, 0xff, + 0xe9, 0x31, 0x2b, 0xff, 0xeb, 0x51, 0x49, 0xff, + 0xed, 0x71, 0x66, 0xff, 0xef, 0x90, 0x84, 0xff, + 0xa4, 0x8c, 0xad, 0xff, 0x94, 0x7c, 0x9d, 0xff, + 0xa9, 0x70, 0x99, 0xff, 0x8f, 0x56, 0x7f, 0xff, + 0x96, 0x41, 0x5f, 0xff, 0x9a, 0x36, 0x52, 0xff, + 0x9e, 0x2b, 0x45, 0xff, 0xa2, 0x20, 0x38, 0xff, + 0xa4, 0x1c, 0x1c, 0xff, 0xa4, 0x1c, 0x1c, 0xff, + 0xb0, 0x28, 0x28, 0xff, 0xb0, 0x28, 0x28, 0xff, + 0xcc, 0x0e, 0x0e, 0xff, 0xcc, 0x0e, 0x0e, 0xff, + 0xcc, 0x0e, 0x0e, 0xff, 0xd0, 0x12, 0x12, 0xff, + 0xd3, 0x0d, 0x15, 0xff, 0xd3, 0x0d, 0x15, 0xff, + 0xe6, 0x10, 0x18, 0xff, 0xdc, 0x06, 0x0e, 0xff, + 0xdd, 0x09, 0x10, 0xff, 0xdf, 0x0a, 0x0f, 0xff, + 0xe1, 0x0b, 0x0e, 0xff, 0xe3, 0x0c, 0x0d, 0xff, + 0xe1, 0x08, 0x06, 0xff, 0xe3, 0x0f, 0x10, 0xff, + 0xe5, 0x16, 0x1a, 0xff, 0xe7, 0x1d, 0x24, 0xff, + 0xe7, 0x3c, 0x33, 0xff, 0xe9, 0x5c, 0x50, 0xff, + 0xeb, 0x7c, 0x6e, 0xff, 0xed, 0x9b, 0x8b, 0xff, + 0xa4, 0x8c, 0xad, 0xff, 0x94, 0x7c, 0x9d, 0xff, + 0xa9, 0x70, 0x99, 0xff, 0x8f, 0x56, 0x7f, 0xff, + 0xa8, 0x44, 0x54, 0xff, 0xac, 0x39, 0x47, 0xff, + 0xb0, 0x2e, 0x3a, 0xff, 0xb5, 0x23, 0x2d, 0xff, + 0xa4, 0x1c, 0x1c, 0xff, 0xb0, 0x28, 0x28, 0xff, + 0xb0, 0x28, 0x28, 0xff, 0xb0, 0x28, 0x28, 0xff, + 0xd6, 0x18, 0x18, 0xff, 0xd0, 0x12, 0x12, 0xff, + 0xd6, 0x18, 0x18, 0xff, 0xd6, 0x18, 0x18, 0xff, + 0xdf, 0x19, 0x21, 0xff, 0xdf, 0x19, 0x21, 0xff, + 0xe6, 0x10, 0x18, 0xff, 0xe6, 0x10, 0x18, 0xff, + 0xde, 0x0e, 0x14, 0xff, 0xe0, 0x0f, 0x13, 0xff, + 0xe2, 0x10, 0x12, 0xff, 0xe4, 0x11, 0x11, 0xff, + 0xe0, 0x0c, 0x09, 0xff, 0xe2, 0x13, 0x13, 0xff, + 0xe4, 0x1a, 0x1d, 0xff, 0xe6, 0x21, 0x27, 0xff, + 0xe5, 0x47, 0x3a, 0xff, 0xe7, 0x67, 0x57, 0xff, + 0xe9, 0x87, 0x75, 0xff, 0xeb, 0xa6, 0x92, 0xff, + 0xd5, 0x8b, 0x83, 0xff, 0xc1, 0x77, 0x6f, 0xff, + 0xb9, 0x56, 0x56, 0xff, 0xb9, 0x56, 0x56, 0xff, + 0xcd, 0x49, 0x49, 0xff, 0xcd, 0x49, 0x49, 0xff, + 0xb9, 0x35, 0x35, 0xff, 0xb9, 0x35, 0x35, 0xff, + 0xcb, 0x2e, 0x2c, 0xff, 0xcb, 0x2c, 0x2c, 0xff, + 0xcb, 0x2a, 0x2c, 0xff, 0xcb, 0x28, 0x2c, 0xff, + 0xd7, 0x20, 0x24, 0xff, 0xda, 0x20, 0x23, 0xff, + 0xdd, 0x1f, 0x22, 0xff, 0xe0, 0x1f, 0x21, 0xff, + 0xe7, 0x22, 0x24, 0xff, 0xe7, 0x20, 0x24, 0xff, + 0xe7, 0x1d, 0x24, 0xff, 0xe7, 0x1b, 0x24, 0xff, + 0xe3, 0x1c, 0x20, 0xff, 0xe3, 0x1c, 0x20, 0xff, + 0xe3, 0x1c, 0x20, 0xff, 0xe3, 0x1c, 0x20, 0xff, + 0xdf, 0x1a, 0x20, 0xff, 0xe0, 0x23, 0x25, 0xff, + 0xe1, 0x2b, 0x2a, 0xff, 0xe2, 0x34, 0x2f, 0xff, + 0xe3, 0x54, 0x49, 0xff, 0xe4, 0x69, 0x5e, 0xff, + 0xe5, 0x7e, 0x74, 0xff, 0xe6, 0x92, 0x89, 0xff, + 0xe7, 0x9d, 0x95, 0xff, 0xd5, 0x8b, 0x83, 0xff, + 0xcd, 0x6a, 0x6a, 0xff, 0xb9, 0x56, 0x56, 0xff, + 0xcd, 0x49, 0x49, 0xff, 0xcd, 0x49, 0x49, 0xff, + 0xcd, 0x49, 0x49, 0xff, 0xcd, 0x49, 0x49, 0xff, + 0xd8, 0x46, 0x46, 0xff, 0xd8, 0x44, 0x46, 0xff, + 0xd8, 0x42, 0x46, 0xff, 0xd8, 0x40, 0x46, 0xff, + 0xdd, 0x3c, 0x3f, 0xff, 0xe0, 0x3b, 0x3e, 0xff, + 0xe3, 0x3b, 0x3d, 0xff, 0xe6, 0x3a, 0x3c, 0xff, + 0xe9, 0x3d, 0x3c, 0xff, 0xe9, 0x3a, 0x3c, 0xff, + 0xe9, 0x38, 0x3c, 0xff, 0xe9, 0x35, 0x3c, 0xff, + 0xe7, 0x36, 0x3b, 0xff, 0xe7, 0x36, 0x3b, 0xff, + 0xe7, 0x36, 0x3b, 0xff, 0xe7, 0x36, 0x3b, 0xff, + 0xe3, 0x34, 0x3a, 0xff, 0xe4, 0x3d, 0x3f, 0xff, + 0xe5, 0x45, 0x44, 0xff, 0xe6, 0x4e, 0x49, 0xff, + 0xe6, 0x63, 0x59, 0xff, 0xe7, 0x78, 0x6f, 0xff, + 0xe8, 0x8d, 0x84, 0xff, 0xe9, 0xa2, 0x99, 0xff, + 0xfb, 0xb1, 0xa9, 0xff, 0xe7, 0x9d, 0x95, 0xff, + 0xdf, 0x7c, 0x7c, 0xff, 0xcd, 0x6a, 0x6a, 0xff, + 0xe2, 0x66, 0x66, 0xff, 0xe2, 0x66, 0x66, 0xff, + 0xe2, 0x66, 0x66, 0xff, 0xe2, 0x66, 0x66, 0xff, + 0xe5, 0x5f, 0x5f, 0xff, 0xe5, 0x5d, 0x5f, 0xff, + 0xe5, 0x5b, 0x5f, 0xff, 0xe5, 0x59, 0x5f, 0xff, + 0xe3, 0x58, 0x59, 0xff, 0xe6, 0x57, 0x58, 0xff, + 0xe9, 0x57, 0x57, 0xff, 0xec, 0x56, 0x56, 0xff, + 0xeb, 0x58, 0x53, 0xff, 0xeb, 0x55, 0x53, 0xff, + 0xeb, 0x53, 0x53, 0xff, 0xeb, 0x50, 0x53, 0xff, + 0xeb, 0x51, 0x55, 0xff, 0xeb, 0x51, 0x55, 0xff, + 0xeb, 0x51, 0x55, 0xff, 0xeb, 0x51, 0x55, 0xff, + 0xe7, 0x4f, 0x53, 0xff, 0xe8, 0x57, 0x58, 0xff, + 0xe9, 0x60, 0x5d, 0xff, 0xea, 0x68, 0x62, 0xff, + 0xe9, 0x73, 0x6a, 0xff, 0xea, 0x87, 0x7f, 0xff, + 0xeb, 0x9c, 0x94, 0xff, 0xec, 0xb1, 0xa9, 0xff, + 0xfb, 0xb1, 0xa9, 0xff, 0xfb, 0xb1, 0xa9, 0xff, + 0xf3, 0x90, 0x90, 0xff, 0xf3, 0x90, 0x90, 0xff, + 0xf8, 0x7c, 0x7c, 0xff, 0xf8, 0x7c, 0x7c, 0xff, + 0xf8, 0x7c, 0x7c, 0xff, 0xf8, 0x7c, 0x7c, 0xff, + 0xf2, 0x77, 0x79, 0xff, 0xf2, 0x75, 0x79, 0xff, + 0xf2, 0x73, 0x79, 0xff, 0xf2, 0x71, 0x79, 0xff, + 0xe9, 0x73, 0x74, 0xff, 0xec, 0x73, 0x73, 0xff, + 0xef, 0x72, 0x72, 0xff, 0xf2, 0x72, 0x71, 0xff, + 0xed, 0x72, 0x6b, 0xff, 0xed, 0x70, 0x6b, 0xff, + 0xed, 0x6d, 0x6b, 0xff, 0xed, 0x6b, 0x6b, 0xff, + 0xef, 0x6b, 0x70, 0xff, 0xef, 0x6b, 0x70, 0xff, + 0xef, 0x6b, 0x70, 0xff, 0xef, 0x6b, 0x70, 0xff, + 0xeb, 0x69, 0x6d, 0xff, 0xec, 0x71, 0x72, 0xff, + 0xed, 0x7a, 0x77, 0xff, 0xee, 0x82, 0x7c, 0xff, + 0xec, 0x82, 0x7a, 0xff, 0xed, 0x97, 0x8f, 0xff, + 0xee, 0xab, 0xa4, 0xff, 0xef, 0xc0, 0xba, 0xff, + ]) +} + +var img_32x32_rgb_punchthrough_etc2 = { + compressed: new Uint8Array([ + 0x84, 0x94, 0xb4, 0x05, 0xf6, 0xff, 0x99, 0x00, + 0x74, 0x84, 0xa4, 0x05, 0xff, 0xf6, 0x08, 0x91, + 0x5f, 0x6f, 0x8f, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x4b, 0x5b, 0x6b, 0x00, 0xff, 0xfd, 0x20, 0x00, + 0x56, 0x66, 0x6e, 0x00, 0xdf, 0xfd, 0x00, 0x02, + 0x0e, 0x67, 0x33, 0x54, 0xff, 0xb9, 0x00, 0xc4, + 0xeb, 0x78, 0x54, 0x61, 0xff, 0xff, 0x08, 0x00, + 0x8b, 0x4b, 0x53, 0x00, 0xff, 0xf7, 0x00, 0x00, + 0xeb, 0x79, 0x44, 0x74, 0xff, 0xff, 0x80, 0x00, + 0x01, 0x10, 0x3f, 0x00, 0xfb, 0xb7, 0x00, 0x00, + 0x10, 0x27, 0x3a, 0x00, 0xff, 0xfb, 0x00, 0xc4, + 0x05, 0x24, 0x00, 0x38, 0xff, 0xef, 0x00, 0x10, + 0x05, 0x13, 0x23, 0x50, 0xfe, 0xff, 0x00, 0x00, + 0x41, 0x4c, 0x5c, 0x25, 0xff, 0xa7, 0x00, 0xb0, + 0x61, 0x43, 0x53, 0x00, 0xfe, 0xff, 0x01, 0x00, + 0x8b, 0x3b, 0x33, 0x01, 0xff, 0x9e, 0x00, 0x60, + 0x0e, 0x79, 0x34, 0x71, 0xff, 0xff, 0x80, 0x00, + 0x18, 0x20, 0x58, 0x04, 0xbb, 0xbf, 0x04, 0x40, + 0x16, 0x25, 0x3d, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x03, 0x10, 0x2f, 0x00, 0xff, 0xdf, 0x00, 0x60, + 0x0c, 0x24, 0x21, 0x31, 0xee, 0xff, 0x00, 0x10, + 0x79, 0x3f, 0x50, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x93, 0x34, 0x34, 0x21, 0xfa, 0xf7, 0x07, 0x08, + 0xf9, 0x66, 0xc3, 0x31, 0xff, 0x3f, 0x00, 0xc0, + 0x74, 0x94, 0xa4, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x0f, 0x0f, 0x21, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x01, 0x01, 0x22, 0x0d, 0x7f, 0x70, 0x08, 0x00, + 0x23, 0x28, 0x43, 0x00, 0xff, 0xf7, 0x00, 0x08, + 0x6a, 0x3f, 0x6d, 0x04, 0xe7, 0xef, 0x19, 0x00, + 0xa6, 0x46, 0x56, 0x00, 0xf7, 0x77, 0x00, 0x00, + 0xc3, 0x08, 0x09, 0x00, 0xff, 0xfc, 0x00, 0x00, + 0xef, 0x43, 0x4b, 0x00, 0xff, 0xff, 0x00, 0x70, + 0x6c, 0x74, 0x94, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x21, 0x35, 0x57, 0x04, 0xf7, 0xcf, 0x88, 0x30, + 0x06, 0x13, 0x33, 0x65, 0x77, 0x77, 0x88, 0x00, + 0x0e, 0x35, 0x42, 0x4c, 0xea, 0x3f, 0x11, 0x80, + 0x88, 0x64, 0x74, 0x01, 0xf2, 0xbb, 0x08, 0x00, + 0x1c, 0x00, 0xa2, 0x24, 0xf0, 0xff, 0x01, 0x00, + 0xd2, 0x01, 0x01, 0x01, 0xff, 0xfc, 0x00, 0x04, + 0xe1, 0x3b, 0x3b, 0x00, 0xff, 0x1f, 0x00, 0x60, + 0x58, 0x4f, 0x70, 0x01, 0x7f, 0xff, 0x80, 0x00, + 0x3b, 0x2d, 0x5f, 0x01, 0xfa, 0xff, 0x07, 0x10, + 0x6a, 0x2e, 0x55, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x88, 0x30, 0x50, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x15, 0x23, 0xb1, 0x11, 0xf2, 0xff, 0x0e, 0x00, + 0xdf, 0x00, 0x00, 0x01, 0xfc, 0xbf, 0x02, 0x20, + 0xe0, 0x02, 0x0a, 0x00, 0x7f, 0xff, 0x00, 0x00, + 0xe0, 0x27, 0x27, 0x21, 0xff, 0xe8, 0x00, 0x10, + 0x90, 0x6e, 0x96, 0x01, 0xff, 0xff, 0xc0, 0x00, + 0x8e, 0x3c, 0x5e, 0x00, 0xef, 0xff, 0x00, 0x00, + 0xf2, 0x22, 0x82, 0x51, 0xff, 0xff, 0x00, 0x01, + 0xb2, 0x17, 0x17, 0x01, 0xaa, 0xba, 0x45, 0x54, + 0xc2, 0x0f, 0x08, 0x04, 0x7e, 0xef, 0x80, 0x01, + 0xd9, 0x09, 0x10, 0x00, 0xff, 0xb3, 0x00, 0x00, + 0xe0, 0x12, 0x1a, 0x01, 0x6c, 0xff, 0x10, 0x20, + 0xef, 0x4b, 0x43, 0x00, 0xff, 0xff, 0x00, 0x00, + 0xb3, 0x53, 0x53, 0x01, 0xef, 0xff, 0x00, 0x00, + 0xc0, 0x40, 0x40, 0x00, 0xdd, 0xdd, 0x22, 0x22, + 0xd0, 0x40, 0x40, 0x00, 0xdd, 0xdd, 0x00, 0x00, + 0xd8, 0x38, 0x38, 0x00, 0xfd, 0xdd, 0x00, 0x00, + 0xe0, 0x33, 0x3b, 0x01, 0xdb, 0xbf, 0x04, 0x40, + 0xe0, 0x47, 0x4e, 0x00, 0xdf, 0xff, 0x00, 0x00, + 0xd8, 0x37, 0x3e, 0x00, 0xee, 0xdd, 0x10, 0x20, + 0xe0, 0x73, 0x6b, 0x00, 0xff, 0xff, 0x00, 0x00, + ]), + decompressed: new Uint8Array([ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x9c, 0xbd, 0xff, 0x7c, 0x8c, 0xad, 0xff, + 0x7b, 0x8c, 0xad, 0xff, 0x6b, 0x7c, 0x9d, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4a, 0x5a, 0x6b, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5b, 0x6b, 0x7c, 0xff, + 0x5a, 0x6b, 0x73, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x42, 0x52, 0x5a, 0xff, + 0x66, 0x66, 0x77, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x3e, 0x60, 0xff, 0x3e, 0x3e, 0x60, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x74, 0x84, 0xa5, 0xff, 0x52, 0x62, 0x83, 0xff, + 0x52, 0x63, 0x84, 0xff, 0x41, 0x52, 0x73, 0xff, + 0x41, 0x52, 0x73, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x4a, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4f, 0x3e, 0x60, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x4a, 0x52, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x17, 0x4a, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x33, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x53, 0x5b, 0x6b, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0x62, 0x73, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x39, 0x31, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x31, 0x39, 0x49, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x94, 0x41, 0x39, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x39, 0xff, + 0x08, 0x10, 0x31, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x29, 0x41, 0xff, 0x08, 0x19, 0x31, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x4a, 0x29, 0x39, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xad, 0x5a, 0x52, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x39, 0x39, 0x6c, 0xff, + 0x00, 0x10, 0x39, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x19, 0x31, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4a, 0x29, 0x39, 0xff, 0x39, 0x18, 0x28, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0b, 0x2d, 0xff, + 0x44, 0x22, 0x44, 0xff, 0x44, 0x22, 0x44, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa5, 0x42, 0x42, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0x31, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x83, 0x20, 0x20, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x29, 0x62, 0xff, + 0x29, 0x32, 0x6b, 0xff, 0x18, 0x21, 0x5a, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x21, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb5, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd2, 0x39, 0x39, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x2d, 0x3e, 0x71, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb5, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd2, 0x39, 0x39, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x21, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6b, 0x39, 0x6b, 0xff, + 0x6a, 0x20, 0x41, 0xff, 0x8c, 0x42, 0x63, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc6, 0x08, 0x08, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x3a, 0x42, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x21, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc6, 0x08, 0x08, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x3a, 0x42, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x31, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x3a, 0x42, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x31, 0xff, 0x08, 0x08, 0x31, 0xff, + 0x00, 0x00, 0x07, 0xff, 0x08, 0x08, 0x31, 0xff, + 0x29, 0x31, 0x4a, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x42, 0x63, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xa5, 0x42, 0x52, 0xff, 0xa5, 0x42, 0x52, 0xff, + 0x94, 0x31, 0x42, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x29, 0x39, 0x5a, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6d, 0x4b, 0x6d, 0xff, 0x6d, 0x4b, 0x6d, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x63, 0x73, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb5, 0x2d, 0x2d, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xd6, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x29, 0x39, 0x5a, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xcc, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xd6, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xef, 0x41, 0x41, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x66, 0x33, 0x55, 0xff, + 0x66, 0x33, 0x55, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x42, 0x52, 0xff, 0x8c, 0x42, 0x52, 0xff, + 0x8c, 0x42, 0x52, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xcc, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xdf, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xef, 0x41, 0x41, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3a, 0x29, 0x5b, 0xff, 0x18, 0x07, 0x39, 0xff, + 0x22, 0x11, 0x33, 0xff, 0x22, 0x11, 0x33, 0xff, + 0x43, 0x43, 0x76, 0xff, 0x43, 0x43, 0x76, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x6d, 0x4b, 0x6d, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x94, 0x4a, 0x5a, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xcc, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x39, 0x39, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x31, 0x21, 0x52, 0xff, + 0x41, 0x31, 0x62, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x99, 0x22, 0x33, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xde, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x21, 0x21, 0xff, 0xf8, 0x32, 0x32, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x21, 0x52, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb5, 0x0b, 0x0b, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0xff, + 0xe6, 0x08, 0x08, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x21, 0x21, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5a, 0x18, 0x5a, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc1, 0x17, 0x17, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x62, 0x4a, 0x7b, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc1, 0x17, 0x17, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x10, 0x18, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7b, 0x18, 0x4a, 0xff, + 0x82, 0x1c, 0x4f, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb5, 0x10, 0x10, 0xff, 0xad, 0x08, 0x08, 0xff, + 0xbd, 0x18, 0x18, 0xff, 0xb5, 0x10, 0x10, 0xff, + 0xbe, 0x00, 0x00, 0xff, 0xc6, 0x08, 0x08, 0xff, + 0xd6, 0x00, 0x08, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x10, 0x18, 0xff, 0xef, 0x18, 0x20, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xdf, 0x08, 0x10, 0xff, + 0xe7, 0x10, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x8c, 0x52, 0x7c, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xce, 0x10, 0x10, 0xff, 0xce, 0x10, 0x10, 0xff, + 0xce, 0x10, 0x10, 0xff, 0xce, 0x10, 0x10, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xde, 0x08, 0x10, 0xff, 0xde, 0x08, 0x10, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x8c, 0x52, 0x7c, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x11, 0x19, 0xff, + 0xde, 0x08, 0x10, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x21, 0x29, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb5, 0x52, 0x52, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xde, 0x29, 0x29, 0xff, 0xe6, 0x31, 0x31, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xce, 0x4a, 0x4a, 0xff, 0xce, 0x4a, 0x4a, 0xff, + 0xce, 0x4a, 0x4a, 0xff, 0xce, 0x4a, 0x4a, 0xff, + 0xd6, 0x42, 0x42, 0xff, 0xd6, 0x42, 0x42, 0xff, + 0xd6, 0x42, 0x42, 0xff, 0xd6, 0x42, 0x42, 0xff, + 0xde, 0x39, 0x39, 0xff, 0xde, 0x39, 0x39, 0xff, + 0xde, 0x39, 0x39, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x31, 0x39, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x39, 0x39, 0xff, + 0xde, 0x31, 0x39, 0xff, 0xe6, 0x39, 0x41, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xef, 0x52, 0x5a, 0xff, + 0xef, 0x52, 0x5a, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ]) +} + +var img_32x32_rgba_etc2 = { + compressed: new Uint8Array([ + 0x04, 0x1d, 0x6d, 0x26, 0x91, 0x48, 0x84, 0x45, + 0x8d, 0x9d, 0xb6, 0x4a, 0xc4, 0x80, 0x83, 0x97, + 0x0b, 0x12, 0x48, 0x94, 0x88, 0x44, 0x42, 0x25, + 0x64, 0x74, 0x95, 0x4b, 0xae, 0xa2, 0x91, 0x05, + 0x15, 0x11, 0x68, 0x86, 0x84, 0x44, 0x54, 0x26, + 0x74, 0x85, 0xa7, 0x25, 0xfa, 0xa6, 0xff, 0x42, + 0x1b, 0x12, 0x68, 0x66, 0xa7, 0x66, 0xf6, 0x6f, + 0x64, 0x74, 0x85, 0x49, 0xae, 0xea, 0x89, 0xba, + 0x1d, 0x12, 0x66, 0x76, 0xa7, 0x6a, 0x76, 0x86, + 0x64, 0x74, 0x7c, 0x4b, 0xa8, 0x8a, 0xa4, 0x81, + 0x15, 0x11, 0x22, 0xf4, 0x26, 0x44, 0x56, 0x84, + 0x73, 0x73, 0x85, 0x29, 0xab, 0xa3, 0x3e, 0x2a, + 0x0b, 0x1b, 0x22, 0xf2, 0x25, 0x44, 0x44, 0x88, + 0x75, 0x74, 0x86, 0x25, 0xaa, 0x6e, 0x71, 0x11, + 0x04, 0x1d, 0x22, 0xe4, 0x45, 0x48, 0x86, 0x91, + 0xbe, 0x7f, 0x04, 0x62, 0xbb, 0x6c, 0x86, 0xcf, + 0x0b, 0x1b, 0x6d, 0x24, 0x89, 0x44, 0x02, 0x25, + 0x74, 0x74, 0x97, 0x48, 0xec, 0xf0, 0x50, 0xe6, + 0x1a, 0x10, 0x6d, 0x16, 0x88, 0x42, 0x63, 0x37, + 0x21, 0x30, 0x5f, 0x4a, 0xbd, 0xe8, 0x8e, 0x5b, + 0x37, 0x21, 0x68, 0x86, 0x44, 0x42, 0x52, 0x2f, + 0x10, 0x27, 0x3a, 0x46, 0x8c, 0xe2, 0x87, 0x10, + 0x4a, 0x3b, 0x64, 0x54, 0x66, 0x42, 0x74, 0x2f, + 0x1e, 0x18, 0x48, 0x07, 0x6b, 0x31, 0xe9, 0xa9, + 0x4b, 0x3a, 0x42, 0xf4, 0x2f, 0x46, 0x64, 0x66, + 0x05, 0x13, 0x23, 0x57, 0x66, 0xd6, 0x34, 0xc4, + 0x38, 0x22, 0x33, 0x74, 0x2f, 0x46, 0x66, 0x84, + 0x43, 0x4e, 0x5c, 0x2b, 0xbd, 0xee, 0x59, 0xb4, + 0x1f, 0x2b, 0x12, 0xf2, 0x25, 0x44, 0x46, 0x88, + 0x57, 0x44, 0x55, 0x45, 0x44, 0x2b, 0xa9, 0x01, + 0x0b, 0x1b, 0x12, 0xf2, 0x25, 0x44, 0x04, 0x89, + 0x9a, 0x48, 0x41, 0x2e, 0x00, 0x31, 0xf0, 0xc5, + 0x10, 0x19, 0x6d, 0x24, 0x48, 0x22, 0x59, 0x77, + 0x6c, 0x7c, 0x9e, 0x4a, 0xfb, 0xf2, 0xd8, 0x58, + 0x32, 0x22, 0x6d, 0x24, 0x88, 0x22, 0x51, 0x77, + 0x18, 0x20, 0x4a, 0x27, 0x6b, 0x90, 0x0e, 0x35, + 0x59, 0x42, 0x44, 0x02, 0x25, 0x12, 0xe9, 0x77, + 0x00, 0x0b, 0x29, 0x2f, 0xcc, 0x29, 0xf0, 0x87, + 0x8c, 0x32, 0x68, 0x54, 0x66, 0x42, 0xf3, 0x37, + 0x03, 0x10, 0x2f, 0x26, 0x76, 0x48, 0x29, 0x19, + 0x96, 0x4a, 0x42, 0xf4, 0x2e, 0x46, 0x66, 0x45, + 0x33, 0x18, 0x40, 0x26, 0x06, 0x76, 0x2e, 0x3e, + 0x71, 0x31, 0x12, 0xf2, 0x25, 0x44, 0x46, 0x88, + 0xb9, 0x06, 0x32, 0x2b, 0x02, 0x13, 0x10, 0x03, + 0x38, 0x22, 0x9b, 0xf1, 0x2e, 0x44, 0x46, 0x91, + 0x49, 0x15, 0xd0, 0x06, 0xcc, 0xe9, 0x02, 0x33, + 0x15, 0x11, 0x97, 0x70, 0x25, 0x44, 0x06, 0x91, + 0x6a, 0x06, 0x6b, 0x33, 0xf1, 0x05, 0x01, 0xff, + 0x15, 0x17, 0x6d, 0xb4, 0x49, 0x12, 0x4d, 0xff, + 0x74, 0x95, 0xa6, 0x2c, 0x70, 0xf0, 0xbe, 0x5c, + 0x40, 0x24, 0x6d, 0xb4, 0x49, 0x12, 0x4d, 0xbf, + 0x1d, 0x1d, 0x32, 0x4e, 0xfe, 0xf6, 0x4c, 0xe8, + 0x7f, 0x4b, 0x69, 0x22, 0x00, 0x92, 0xdb, 0xbf, + 0x00, 0x01, 0x37, 0x2a, 0x0c, 0x63, 0x0c, 0x6b, + 0xc7, 0x32, 0x68, 0x94, 0x24, 0x13, 0x69, 0xbf, + 0x23, 0x28, 0x43, 0x26, 0x03, 0x11, 0xea, 0xd1, + 0xd9, 0x32, 0x33, 0x73, 0x2e, 0x42, 0x46, 0x89, + 0x63, 0x30, 0x66, 0x46, 0x05, 0x23, 0x5b, 0xa1, + 0x95, 0x4b, 0xbb, 0xf1, 0x2d, 0x24, 0x06, 0x92, + 0xf3, 0x12, 0x93, 0x46, 0x0b, 0x57, 0x06, 0xa8, + 0x4b, 0x3a, 0xdb, 0xf9, 0x2d, 0x20, 0x04, 0x92, + 0x60, 0x86, 0x04, 0xf6, 0x18, 0x46, 0x80, 0x00, + 0x1c, 0x12, 0xdf, 0xf9, 0x2d, 0x44, 0x96, 0xdb, + 0x72, 0xa6, 0x0d, 0x73, 0x8b, 0x2f, 0x64, 0x48, + 0x15, 0x17, 0x6d, 0xb2, 0x52, 0x90, 0x0f, 0xf5, + 0x50, 0x6c, 0x85, 0x6b, 0xec, 0x00, 0xc0, 0x1f, + 0x3d, 0x21, 0x49, 0xb0, 0x09, 0x92, 0x0f, 0xb5, + 0x31, 0x40, 0x63, 0x6c, 0x71, 0xfc, 0x2d, 0x09, + 0x7d, 0x34, 0x49, 0xb0, 0x0a, 0xb2, 0x0f, 0xf4, + 0x07, 0x01, 0x33, 0x6b, 0x6f, 0x73, 0xa1, 0x33, + 0xbb, 0x5a, 0x00, 0xab, 0x01, 0xd6, 0x0f, 0xa8, + 0xeb, 0x35, 0x53, 0x5a, 0x02, 0x7f, 0x31, 0x83, + 0xc7, 0x32, 0xfa, 0x1f, 0xa1, 0xd4, 0x28, 0x13, + 0x7b, 0x55, 0x67, 0x27, 0x84, 0x6f, 0x61, 0x29, + 0x91, 0x4b, 0xfa, 0xcb, 0x20, 0x00, 0xa4, 0x9b, + 0x51, 0x05, 0x68, 0x8b, 0xfe, 0x00, 0xfe, 0x21, + 0x4a, 0x21, 0xff, 0x5b, 0x20, 0x00, 0x94, 0x9b, + 0xe0, 0x01, 0x09, 0x22, 0x0c, 0x1f, 0x70, 0x03, + 0x1b, 0x12, 0xff, 0xeb, 0x60, 0x25, 0x26, 0xdb, + 0x72, 0x9e, 0x0c, 0x7a, 0xa1, 0x2f, 0x43, 0x87, + 0x0d, 0x19, 0x29, 0x20, 0x09, 0xb0, 0x0f, 0xac, + 0x77, 0x6d, 0x8f, 0x4a, 0xff, 0x70, 0x36, 0x3e, + 0x2f, 0x21, 0x29, 0xb0, 0x4a, 0x80, 0x1d, 0x60, + 0x0e, 0x15, 0x43, 0x67, 0x13, 0x33, 0x62, 0xfc, + 0x59, 0x49, 0x05, 0x38, 0x0a, 0xb0, 0x1d, 0x60, + 0xb8, 0x04, 0xb1, 0xb3, 0x31, 0xcf, 0x01, 0x11, + 0x7d, 0x34, 0x81, 0x3d, 0x0b, 0xf4, 0x2f, 0x42, + 0x83, 0x44, 0x64, 0x47, 0x96, 0x18, 0x80, 0x5c, + 0x84, 0x37, 0xf4, 0x3f, 0x0b, 0xd0, 0xba, 0x13, + 0x58, 0x14, 0xc9, 0x1a, 0x01, 0x77, 0x72, 0x08, + 0x63, 0x4b, 0xf6, 0x0d, 0x01, 0x80, 0xa0, 0x53, + 0xd9, 0x0f, 0x08, 0x42, 0xef, 0xef, 0x89, 0x03, + 0x37, 0x22, 0xfa, 0x0b, 0x02, 0x05, 0x34, 0x9b, + 0x74, 0x80, 0x04, 0xf7, 0x14, 0x3f, 0x00, 0x42, + 0x15, 0x11, 0xd6, 0x08, 0x01, 0x05, 0x24, 0x9b, + 0x74, 0x9c, 0x07, 0xf7, 0x9b, 0x2f, 0x43, 0x47, + 0x0a, 0x12, 0x49, 0x22, 0x52, 0x04, 0xa8, 0x01, + 0x98, 0x84, 0xa5, 0x0e, 0xf1, 0xd2, 0x10, 0xec, + 0x14, 0x11, 0x05, 0x38, 0x0a, 0xb0, 0x1f, 0x60, + 0xb8, 0xbc, 0xfa, 0xc2, 0x10, 0x85, 0xc8, 0xd2, + 0x2f, 0x21, 0x05, 0x38, 0x0b, 0xa0, 0xad, 0x01, + 0x51, 0x05, 0x41, 0x2a, 0x01, 0x11, 0x30, 0x6f, + 0x39, 0x3b, 0xb0, 0xad, 0x02, 0xf4, 0x1f, 0x41, + 0xb3, 0x10, 0x10, 0x03, 0x24, 0x57, 0x8b, 0x3a, + 0x3d, 0x21, 0xf0, 0x2f, 0x02, 0xd0, 0x2d, 0x0b, + 0xca, 0x08, 0x10, 0x22, 0x73, 0x33, 0x9f, 0x89, + 0x30, 0x22, 0xf4, 0x1d, 0x02, 0xa0, 0xa8, 0x53, + 0x6c, 0x80, 0x05, 0x72, 0x04, 0x0e, 0xe2, 0x46, + 0x1f, 0x2b, 0xb0, 0x18, 0x0a, 0x05, 0x32, 0x9b, + 0x70, 0x80, 0x04, 0x76, 0x1c, 0x56, 0xe2, 0x03, + 0x0b, 0x12, 0xb0, 0x18, 0x09, 0x05, 0x22, 0x92, + 0x74, 0xa6, 0x0c, 0xfa, 0xa5, 0x37, 0x0a, 0x50, + 0x04, 0x1d, 0x4d, 0xb4, 0x9b, 0x29, 0x30, 0x52, + 0xdf, 0x94, 0x8d, 0x4a, 0x73, 0x31, 0xb9, 0x9c, + 0x0f, 0x11, 0x4d, 0xb2, 0x9b, 0x29, 0x30, 0x53, + 0xd2, 0x53, 0x53, 0x47, 0x77, 0x77, 0x99, 0x88, + 0x0d, 0x19, 0x80, 0xaa, 0x0a, 0xd0, 0x2f, 0x41, + 0x64, 0xae, 0x0d, 0xe6, 0x26, 0x5f, 0xf1, 0xe4, + 0x11, 0x12, 0xd0, 0xaf, 0x42, 0xf4, 0x2f, 0x82, + 0x6a, 0xa0, 0x0c, 0xf2, 0x1e, 0x47, 0x71, 0xe3, + 0x19, 0x10, 0xa1, 0x3a, 0x13, 0xa1, 0x38, 0x53, + 0x72, 0xa2, 0x0c, 0xf3, 0x18, 0x4f, 0x71, 0xa0, + 0x10, 0x19, 0xf0, 0x2d, 0x0a, 0xa0, 0xb8, 0x53, + 0x70, 0x9c, 0x0c, 0x72, 0x1c, 0x47, 0x90, 0xa2, + 0x0b, 0x1b, 0xa0, 0xa8, 0x0a, 0x05, 0x32, 0x93, + 0x6e, 0x9a, 0x0c, 0x72, 0x3c, 0x6f, 0x70, 0x61, + 0x04, 0x1d, 0xa0, 0xa0, 0x52, 0x29, 0x34, 0x9b, + 0x70, 0x54, 0x15, 0x73, 0xa7, 0x3f, 0x72, 0x22, + ]), + decompressed: new Uint8Array([ + 0xa9, 0xb9, 0xd2, 0x00, 0xa9, 0xb9, 0xd2, 0x00, + 0x90, 0xa1, 0xc2, 0x01, 0x7c, 0x8d, 0xae, 0x01, + 0x80, 0x90, 0xb1, 0x03, 0x6c, 0x7c, 0x9d, 0x03, + 0x80, 0x90, 0xb1, 0x03, 0x80, 0x90, 0xb1, 0x06, + 0x7c, 0x8d, 0xaf, 0x08, 0x7c, 0x8d, 0xaf, 0x08, + 0x88, 0x99, 0xbb, 0x0b, 0x66, 0x77, 0x99, 0x0b, + 0x6f, 0x80, 0x91, 0x0e, 0x83, 0x94, 0xa5, 0x0e, + 0x83, 0x94, 0xa5, 0x0e, 0x6f, 0x80, 0x91, 0x0e, + 0x80, 0x90, 0x98, 0x10, 0x6c, 0x7c, 0x84, 0x10, + 0x6c, 0x7c, 0x84, 0x10, 0x6c, 0x7c, 0x84, 0x10, + 0x72, 0x72, 0x83, 0x0e, 0x7c, 0x7c, 0x8d, 0x0b, + 0x72, 0x72, 0x83, 0x0b, 0x88, 0x88, 0x99, 0x08, + 0x88, 0x88, 0x99, 0x06, 0x88, 0x88, 0x99, 0x06, + 0x88, 0x88, 0x99, 0x04, 0x88, 0x88, 0x99, 0x04, + 0x7d, 0x7e, 0x82, 0x02, 0x8f, 0x8d, 0x8f, 0x01, + 0xa0, 0x9d, 0x9c, 0x01, 0xb2, 0xac, 0xa9, 0x00, + 0xa9, 0xb9, 0xd2, 0x00, 0x95, 0xa5, 0xbe, 0x01, + 0x90, 0xa1, 0xc2, 0x01, 0x7c, 0x8d, 0xae, 0x02, + 0x5a, 0x6a, 0x8b, 0x03, 0x5a, 0x6a, 0x8b, 0x03, + 0x5a, 0x6a, 0x8b, 0x06, 0x5a, 0x6a, 0x8b, 0x09, + 0x66, 0x77, 0x99, 0x0b, 0x72, 0x83, 0xa5, 0x0b, + 0x66, 0x77, 0x99, 0x0e, 0x66, 0x77, 0x99, 0x12, + 0x49, 0x5a, 0x6b, 0x13, 0x49, 0x5a, 0x6b, 0x13, + 0x5d, 0x6e, 0x7f, 0x16, 0x5d, 0x6e, 0x7f, 0x16, + 0x5a, 0x6a, 0x72, 0x18, 0x6c, 0x7c, 0x84, 0x15, + 0x6c, 0x7c, 0x84, 0x15, 0x46, 0x56, 0x5e, 0x15, + 0x66, 0x66, 0x77, 0x12, 0x66, 0x66, 0x77, 0x12, + 0x66, 0x66, 0x77, 0x0e, 0x66, 0x66, 0x77, 0x0b, + 0x72, 0x72, 0x83, 0x09, 0x72, 0x72, 0x83, 0x09, + 0x72, 0x72, 0x83, 0x06, 0x66, 0x66, 0x77, 0x04, + 0x82, 0x6c, 0x71, 0x03, 0x94, 0x7b, 0x7e, 0x02, + 0xa5, 0x8b, 0x8b, 0x01, 0xb7, 0x9a, 0x98, 0x01, + 0xa9, 0xb9, 0xd2, 0x01, 0x95, 0xa5, 0xbe, 0x01, + 0x6a, 0x7b, 0x9c, 0x02, 0x6a, 0x7b, 0x9c, 0x03, + 0x5f, 0x6f, 0x98, 0x06, 0x4b, 0x5b, 0x84, 0x06, + 0x39, 0x49, 0x72, 0x09, 0x4b, 0x5b, 0x84, 0x0c, + 0x3f, 0x50, 0x72, 0x0e, 0x55, 0x66, 0x88, 0x12, + 0x55, 0x66, 0x88, 0x12, 0x33, 0x44, 0x66, 0x17, + 0x4d, 0x4d, 0x5e, 0x19, 0x3b, 0x3b, 0x4c, 0x1c, + 0x3b, 0x3b, 0x4c, 0x1f, 0x4d, 0x4d, 0x5e, 0x1f, + 0x4b, 0x5b, 0x63, 0x1e, 0x4b, 0x5b, 0x63, 0x1e, + 0x5f, 0x6f, 0x77, 0x1e, 0x4b, 0x5b, 0x63, 0x1b, + 0x3c, 0x3c, 0x5e, 0x1b, 0x3c, 0x3c, 0x5e, 0x17, + 0x50, 0x50, 0x72, 0x12, 0x3c, 0x3c, 0x5e, 0x12, + 0x50, 0x3f, 0x61, 0x0f, 0x50, 0x3f, 0x61, 0x0c, + 0x5a, 0x49, 0x6b, 0x09, 0x66, 0x55, 0x77, 0x06, + 0x88, 0x5a, 0x5f, 0x05, 0x99, 0x69, 0x6c, 0x03, + 0xab, 0x79, 0x79, 0x02, 0xbc, 0x88, 0x86, 0x01, + 0x95, 0xa5, 0xbe, 0x01, 0x6f, 0x7f, 0x98, 0x02, + 0x7c, 0x8d, 0xae, 0x03, 0x56, 0x67, 0x88, 0x05, + 0x4b, 0x5b, 0x84, 0x06, 0x39, 0x49, 0x72, 0x09, + 0x39, 0x49, 0x72, 0x0c, 0x25, 0x35, 0x5e, 0x0f, + 0x49, 0x5a, 0x7c, 0x12, 0x3f, 0x50, 0x72, 0x17, + 0x33, 0x44, 0x66, 0x1b, 0x33, 0x44, 0x66, 0x1e, + 0x27, 0x27, 0x38, 0x22, 0x27, 0x27, 0x38, 0x27, + 0x27, 0x27, 0x38, 0x27, 0x27, 0x27, 0x38, 0x27, + 0x39, 0x49, 0x51, 0x29, 0x25, 0x35, 0x3d, 0x29, + 0x39, 0x49, 0x51, 0x29, 0x25, 0x35, 0x3d, 0x24, + 0x50, 0x50, 0x72, 0x21, 0x2a, 0x2a, 0x4c, 0x1e, + 0x16, 0x16, 0x38, 0x1b, 0x2a, 0x2a, 0x4c, 0x17, + 0x50, 0x3f, 0x61, 0x14, 0x5a, 0x49, 0x6b, 0x0f, + 0x50, 0x3f, 0x61, 0x0c, 0x50, 0x3f, 0x61, 0x09, + 0x8d, 0x48, 0x4e, 0x06, 0x9e, 0x57, 0x5b, 0x05, + 0xb0, 0x67, 0x68, 0x03, 0xc1, 0x76, 0x75, 0x02, + 0x80, 0x80, 0xa2, 0x01, 0x6e, 0x6e, 0x90, 0x04, + 0x4d, 0x4d, 0x80, 0x04, 0x61, 0x61, 0x94, 0x06, + 0x3e, 0x4e, 0x77, 0x0b, 0x3e, 0x4e, 0x77, 0x0b, + 0x20, 0x28, 0x49, 0x11, 0x20, 0x28, 0x49, 0x14, + 0x19, 0x2a, 0x42, 0x1d, 0x2d, 0x3e, 0x56, 0x1d, + 0x21, 0x29, 0x5b, 0x23, 0x15, 0x1d, 0x4f, 0x29, + 0x10, 0x10, 0x42, 0x2c, 0x16, 0x16, 0x48, 0x35, + 0x10, 0x10, 0x42, 0x35, 0x1a, 0x1a, 0x4c, 0x35, + 0x11, 0x11, 0x33, 0x33, 0x22, 0x33, 0x55, 0x33, + 0x11, 0x11, 0x33, 0x33, 0x32, 0x43, 0x65, 0x33, + 0x47, 0x4f, 0x5f, 0x2e, 0x53, 0x5b, 0x6b, 0x28, + 0x31, 0x39, 0x49, 0x28, 0x31, 0x39, 0x49, 0x1e, + 0x38, 0x27, 0x38, 0x1b, 0x5e, 0x4d, 0x5e, 0x15, + 0x72, 0x61, 0x72, 0x11, 0x5e, 0x4d, 0x5e, 0x0b, + 0x8b, 0x39, 0x31, 0x09, 0x97, 0x45, 0x3d, 0x06, + 0xba, 0x57, 0x57, 0x04, 0xd7, 0x74, 0x74, 0x04, + 0x94, 0x94, 0xb6, 0x01, 0x5a, 0x5a, 0x7c, 0x04, + 0x4d, 0x4d, 0x80, 0x06, 0x3b, 0x3b, 0x6e, 0x09, + 0x3e, 0x4e, 0x77, 0x0b, 0x18, 0x28, 0x51, 0x11, + 0x46, 0x4e, 0x6f, 0x17, 0x20, 0x28, 0x49, 0x1c, + 0x07, 0x18, 0x30, 0x23, 0x07, 0x18, 0x30, 0x29, + 0x21, 0x29, 0x5b, 0x31, 0x15, 0x1d, 0x4f, 0x31, + 0x1a, 0x1a, 0x4c, 0x3b, 0x10, 0x10, 0x42, 0x3b, + 0x16, 0x16, 0x48, 0x44, 0x10, 0x10, 0x42, 0x44, + 0x22, 0x33, 0x55, 0x45, 0x11, 0x11, 0x33, 0x45, + 0x22, 0x33, 0x55, 0x3f, 0x12, 0x23, 0x45, 0x3f, + 0x3d, 0x45, 0x55, 0x3a, 0x31, 0x39, 0x49, 0x34, + 0x47, 0x4f, 0x5f, 0x2e, 0x3d, 0x45, 0x55, 0x28, + 0x4c, 0x3b, 0x4c, 0x21, 0x4c, 0x3b, 0x4c, 0x1b, + 0x5e, 0x4d, 0x5e, 0x15, 0x72, 0x61, 0x72, 0x11, + 0xa1, 0x4f, 0x47, 0x0c, 0x97, 0x45, 0x3d, 0x09, + 0xba, 0x57, 0x57, 0x06, 0xd7, 0x74, 0x74, 0x04, + 0x94, 0x94, 0xb6, 0x04, 0x5a, 0x5a, 0x7c, 0x06, + 0x3b, 0x3b, 0x6e, 0x09, 0x27, 0x27, 0x5a, 0x0c, + 0x2a, 0x3a, 0x63, 0x11, 0x04, 0x14, 0x3d, 0x14, + 0x0c, 0x14, 0x35, 0x1c, 0x32, 0x3a, 0x5b, 0x22, + 0x19, 0x2a, 0x42, 0x29, 0x07, 0x18, 0x30, 0x31, + 0x00, 0x07, 0x39, 0x3b, 0x15, 0x1d, 0x4f, 0x43, + 0x0d, 0x1d, 0x4f, 0x44, 0x0d, 0x1d, 0x4f, 0x4d, + 0x0d, 0x1d, 0x4f, 0x4d, 0x00, 0x07, 0x39, 0x56, + 0x12, 0x23, 0x45, 0x54, 0x12, 0x23, 0x45, 0x54, + 0x12, 0x23, 0x45, 0x4e, 0x22, 0x33, 0x55, 0x4e, + 0x3d, 0x1c, 0x1c, 0x46, 0x51, 0x30, 0x30, 0x40, + 0x51, 0x30, 0x30, 0x3a, 0x77, 0x56, 0x56, 0x34, + 0x7c, 0x49, 0x5a, 0x27, 0x7c, 0x49, 0x5a, 0x21, + 0x72, 0x3f, 0x50, 0x1b, 0x72, 0x3f, 0x50, 0x15, + 0xad, 0x5b, 0x53, 0x0f, 0xad, 0x5b, 0x53, 0x0c, + 0xba, 0x57, 0x57, 0x09, 0xd7, 0x74, 0x74, 0x06, + 0x80, 0x80, 0xa2, 0x04, 0x5a, 0x5a, 0x7c, 0x06, + 0x3b, 0x3b, 0x6e, 0x09, 0x3b, 0x3b, 0x6e, 0x0f, + 0x04, 0x14, 0x3d, 0x14, 0x18, 0x28, 0x51, 0x17, + 0x0c, 0x14, 0x35, 0x22, 0x0c, 0x14, 0x35, 0x28, + 0x19, 0x2a, 0x42, 0x31, 0x07, 0x18, 0x30, 0x3b, + 0x0b, 0x13, 0x45, 0x43, 0x00, 0x07, 0x39, 0x4f, + 0x19, 0x29, 0x5b, 0x56, 0x19, 0x29, 0x5b, 0x5c, + 0x00, 0x07, 0x39, 0x65, 0x19, 0x29, 0x5b, 0x65, + 0x11, 0x11, 0x33, 0x66, 0x12, 0x23, 0x45, 0x66, + 0x11, 0x11, 0x33, 0x60, 0x11, 0x11, 0x33, 0x60, + 0x51, 0x30, 0x30, 0x50, 0x3d, 0x1c, 0x1c, 0x50, + 0x3d, 0x1c, 0x1c, 0x46, 0x51, 0x30, 0x30, 0x3a, + 0x72, 0x3f, 0x50, 0x31, 0x7c, 0x49, 0x5a, 0x27, + 0x88, 0x55, 0x66, 0x21, 0x88, 0x55, 0x66, 0x1b, + 0xa1, 0x4f, 0x47, 0x14, 0xad, 0x5b, 0x53, 0x0f, + 0xba, 0x57, 0x57, 0x09, 0xd7, 0x74, 0x74, 0x06, + 0x74, 0x84, 0xa5, 0x06, 0x4e, 0x5e, 0x7f, 0x08, + 0x41, 0x51, 0x83, 0x0b, 0x2d, 0x3d, 0x6f, 0x11, + 0x29, 0x32, 0x5b, 0x18, 0x07, 0x10, 0x39, 0x22, + 0x13, 0x1c, 0x45, 0x28, 0x1d, 0x26, 0x4f, 0x2e, + 0x00, 0x00, 0x18, 0x39, 0x05, 0x0d, 0x2e, 0x45, + 0x05, 0x0d, 0x2e, 0x51, 0x11, 0x19, 0x3a, 0x5d, + 0x11, 0x21, 0x3a, 0x65, 0x11, 0x21, 0x3a, 0x74, + 0x29, 0x21, 0x32, 0x74, 0x13, 0x0b, 0x1c, 0x7d, + 0x36, 0x1d, 0x47, 0x76, 0x20, 0x07, 0x31, 0x76, + 0x4f, 0x1d, 0x47, 0x76, 0x4f, 0x1d, 0x47, 0x6e, + 0x56, 0x34, 0x45, 0x68, 0x76, 0x54, 0x65, 0x5c, + 0x87, 0x32, 0x54, 0x53, 0x67, 0x12, 0x34, 0x4a, + 0x93, 0x00, 0x00, 0x3a, 0x82, 0x1c, 0x1c, 0x34, + 0xb0, 0x4a, 0x4a, 0x28, 0xb0, 0x4a, 0x4a, 0x1e, + 0xd2, 0x5b, 0x5b, 0x17, 0xd2, 0x39, 0x39, 0x12, + 0xd2, 0x5b, 0x5b, 0x0b, 0xe8, 0x71, 0x71, 0x08, + 0x62, 0x72, 0x93, 0x06, 0x62, 0x72, 0x93, 0x0b, + 0x41, 0x51, 0x83, 0x0e, 0x41, 0x51, 0x83, 0x14, + 0x1d, 0x26, 0x4f, 0x18, 0x29, 0x32, 0x5b, 0x22, + 0x07, 0x10, 0x39, 0x2e, 0x13, 0x1c, 0x45, 0x3a, + 0x11, 0x19, 0x3a, 0x45, 0x00, 0x03, 0x24, 0x51, + 0x05, 0x0d, 0x2e, 0x5d, 0x11, 0x19, 0x3a, 0x69, + 0x05, 0x15, 0x2e, 0x74, 0x05, 0x15, 0x2e, 0x7d, + 0x13, 0x0b, 0x1c, 0x86, 0x07, 0x00, 0x10, 0x8f, + 0x20, 0x07, 0x31, 0x8e, 0x20, 0x07, 0x31, 0x8e, + 0x39, 0x07, 0x31, 0x86, 0x5b, 0x29, 0x53, 0x86, + 0x56, 0x34, 0x45, 0x77, 0x87, 0x32, 0x54, 0x68, + 0x76, 0x54, 0x65, 0x5c, 0x87, 0x32, 0x54, 0x53, + 0x82, 0x1c, 0x1c, 0x46, 0x93, 0x00, 0x00, 0x3a, + 0x82, 0x1c, 0x1c, 0x2e, 0xb0, 0x4a, 0x4a, 0x28, + 0xd2, 0x39, 0x39, 0x1b, 0xd2, 0x39, 0x39, 0x12, + 0xe8, 0x4f, 0x4f, 0x0e, 0xe8, 0x71, 0x71, 0x0b, + 0x74, 0x84, 0xa5, 0x08, 0x4e, 0x5e, 0x7f, 0x0b, + 0x53, 0x63, 0x95, 0x11, 0x2d, 0x3d, 0x6f, 0x17, + 0x29, 0x32, 0x6b, 0x22, 0x1d, 0x26, 0x5f, 0x28, + 0x29, 0x32, 0x6b, 0x34, 0x13, 0x1c, 0x55, 0x40, + 0x2a, 0x4b, 0x5b, 0x51, 0x0d, 0x2e, 0x3e, 0x5d, + 0x00, 0x14, 0x24, 0x69, 0x00, 0x00, 0x07, 0x75, + 0x05, 0x15, 0x2e, 0x86, 0x00, 0x0b, 0x24, 0x8f, + 0x13, 0x0b, 0x1c, 0x98, 0x13, 0x0b, 0x1c, 0xa1, + 0x20, 0x07, 0x31, 0xa2, 0x2c, 0x13, 0x3d, 0xa2, + 0x39, 0x07, 0x31, 0x9a, 0x4f, 0x1d, 0x47, 0x8e, + 0x87, 0x32, 0x54, 0x83, 0x87, 0x32, 0x54, 0x77, + 0x87, 0x32, 0x54, 0x68, 0x87, 0x32, 0x54, 0x5c, + 0xb0, 0x4a, 0x4a, 0x50, 0xc1, 0x17, 0x17, 0x40, + 0xc1, 0x17, 0x17, 0x34, 0xc1, 0x17, 0x17, 0x28, + 0xd2, 0x5b, 0x5b, 0x1e, 0xd2, 0x39, 0x39, 0x17, + 0xe8, 0x4f, 0x4f, 0x12, 0xe8, 0x71, 0x71, 0x0b, + 0x88, 0x98, 0xb9, 0x08, 0x62, 0x72, 0x93, 0x0e, + 0x2d, 0x3d, 0x6f, 0x14, 0x2d, 0x3d, 0x6f, 0x19, + 0x1d, 0x26, 0x5f, 0x22, 0x13, 0x1c, 0x55, 0x2e, + 0x07, 0x10, 0x49, 0x3a, 0x1d, 0x26, 0x5f, 0x4a, + 0x00, 0x14, 0x24, 0x51, 0x2a, 0x4b, 0x5b, 0x69, + 0x00, 0x14, 0x24, 0x75, 0x00, 0x00, 0x07, 0x89, + 0x00, 0x00, 0x18, 0x98, 0x05, 0x15, 0x2e, 0xa1, + 0x29, 0x21, 0x32, 0xb0, 0x1d, 0x15, 0x26, 0xb0, + 0x42, 0x29, 0x53, 0xba, 0x36, 0x1d, 0x47, 0xb2, + 0x5b, 0x29, 0x53, 0xb2, 0x4f, 0x1d, 0x47, 0xa2, + 0x87, 0x32, 0x54, 0x95, 0x87, 0x32, 0x54, 0x83, + 0x87, 0x32, 0x54, 0x77, 0x87, 0x32, 0x54, 0x68, + 0xc1, 0x17, 0x17, 0x50, 0xc1, 0x17, 0x17, 0x46, + 0xc1, 0x17, 0x17, 0x3a, 0xc1, 0x17, 0x17, 0x2e, + 0xd2, 0x39, 0x39, 0x21, 0xd2, 0x39, 0x39, 0x1b, + 0xe8, 0x4f, 0x4f, 0x12, 0xe8, 0x71, 0x71, 0x0e, + 0x7c, 0x9e, 0xaf, 0x0a, 0x66, 0x88, 0x99, 0x0d, + 0x51, 0x62, 0x73, 0x12, 0x1a, 0x2b, 0x3c, 0x1c, + 0x21, 0x21, 0x3a, 0x28, 0x0f, 0x0f, 0x28, 0x30, + 0x0d, 0x0d, 0x4f, 0x3a, 0x00, 0x00, 0x35, 0x4e, + 0x00, 0x00, 0x20, 0x57, 0x05, 0x05, 0x36, 0x6b, + 0x09, 0x11, 0x32, 0x83, 0x09, 0x11, 0x32, 0x8f, + 0x10, 0x18, 0x31, 0xa0, 0x10, 0x18, 0x31, 0xaf, + 0x34, 0x24, 0x55, 0xc1, 0x3e, 0x2e, 0x5f, 0xca, + 0x46, 0x14, 0x46, 0xca, 0x6c, 0x3a, 0x6c, 0xca, + 0x6a, 0x20, 0x41, 0xc1, 0x8c, 0x42, 0x63, 0xb2, + 0x99, 0x33, 0x44, 0xa5, 0x99, 0x33, 0x44, 0x8d, + 0x99, 0x33, 0x44, 0x81, 0xbb, 0x11, 0x22, 0x6d, + 0xc3, 0x06, 0x04, 0x60, 0xcd, 0x0b, 0x0b, 0x4e, + 0xd7, 0x0f, 0x12, 0x3f, 0xe1, 0x14, 0x19, 0x33, + 0xe7, 0x26, 0x28, 0x23, 0xe7, 0x3f, 0x44, 0x1d, + 0xe7, 0x59, 0x5f, 0x14, 0xe7, 0x72, 0x7b, 0x0f, + 0x7c, 0x9e, 0xaf, 0x0a, 0x72, 0x94, 0xa5, 0x10, + 0x6e, 0x7f, 0x90, 0x17, 0x1a, 0x2b, 0x3c, 0x1f, + 0x0f, 0x0f, 0x28, 0x28, 0x00, 0x00, 0x14, 0x34, + 0x00, 0x00, 0x35, 0x44, 0x00, 0x00, 0x35, 0x4e, + 0x00, 0x00, 0x20, 0x63, 0x00, 0x00, 0x20, 0x77, + 0x09, 0x11, 0x32, 0x83, 0x09, 0x11, 0x32, 0x97, + 0x26, 0x2e, 0x47, 0xaf, 0x26, 0x2e, 0x47, 0xc1, + 0x28, 0x18, 0x49, 0xca, 0x4a, 0x3a, 0x6b, 0xdc, + 0x5a, 0x28, 0x5a, 0xdc, 0x46, 0x14, 0x46, 0xdc, + 0x8c, 0x42, 0x63, 0xd3, 0x80, 0x36, 0x57, 0xc1, + 0x99, 0x33, 0x44, 0xad, 0xa4, 0x3e, 0x4f, 0x99, + 0x8e, 0x28, 0x39, 0x81, 0xbb, 0x11, 0x22, 0x79, + 0xc7, 0x05, 0x03, 0x60, 0xd1, 0x09, 0x0a, 0x4e, + 0xdb, 0x0e, 0x11, 0x45, 0xe5, 0x12, 0x18, 0x33, + 0xe9, 0x25, 0x26, 0x28, 0xe9, 0x3e, 0x42, 0x1d, + 0xe9, 0x58, 0x5d, 0x17, 0xe9, 0x71, 0x79, 0x0f, + 0x88, 0xaa, 0xbb, 0x0a, 0x66, 0x88, 0x99, 0x10, + 0x6e, 0x7f, 0x90, 0x17, 0x37, 0x48, 0x59, 0x1f, + 0x0f, 0x0f, 0x28, 0x28, 0x00, 0x00, 0x14, 0x34, + 0x00, 0x00, 0x18, 0x44, 0x00, 0x00, 0x18, 0x56, + 0x05, 0x05, 0x36, 0x63, 0x00, 0x00, 0x20, 0x77, + 0x00, 0x00, 0x0c, 0x8f, 0x09, 0x11, 0x32, 0xa3, + 0x26, 0x2e, 0x47, 0xb8, 0x32, 0x3a, 0x53, 0xca, + 0x3e, 0x2e, 0x5f, 0xdc, 0x4a, 0x3a, 0x6b, 0xeb, + 0x6c, 0x3a, 0x6c, 0xee, 0x6c, 0x3a, 0x6c, 0xe5, + 0x76, 0x2c, 0x4d, 0xdc, 0x8c, 0x42, 0x63, 0xca, + 0x99, 0x33, 0x44, 0xb9, 0x99, 0x33, 0x44, 0xa5, + 0xa4, 0x3e, 0x4f, 0x8d, 0xbb, 0x11, 0x22, 0x79, + 0xcb, 0x03, 0x02, 0x66, 0xd5, 0x08, 0x09, 0x54, + 0xdf, 0x0c, 0x10, 0x45, 0xe9, 0x11, 0x17, 0x33, + 0xeb, 0x24, 0x24, 0x28, 0xeb, 0x3d, 0x40, 0x20, + 0xeb, 0x57, 0x5b, 0x17, 0xeb, 0x70, 0x77, 0x0f, + 0x88, 0xaa, 0xbb, 0x0a, 0x72, 0x94, 0xa5, 0x10, + 0x6e, 0x7f, 0x90, 0x17, 0x6e, 0x7f, 0x90, 0x1f, + 0x35, 0x35, 0x4e, 0x28, 0x00, 0x00, 0x14, 0x34, + 0x00, 0x00, 0x18, 0x44, 0x00, 0x00, 0x35, 0x56, + 0x11, 0x11, 0x42, 0x63, 0x05, 0x05, 0x36, 0x77, + 0x00, 0x00, 0x0c, 0x8f, 0x09, 0x11, 0x32, 0xa3, + 0x26, 0x2e, 0x47, 0xb8, 0x32, 0x3a, 0x53, 0xca, + 0x4a, 0x3a, 0x6b, 0xdc, 0x4a, 0x3a, 0x6b, 0xeb, + 0x6c, 0x3a, 0x6c, 0xfd, 0x80, 0x4e, 0x80, 0xee, + 0x8c, 0x42, 0x63, 0xdc, 0x80, 0x36, 0x57, 0xca, + 0xa4, 0x3e, 0x4f, 0xb9, 0xa4, 0x3e, 0x4f, 0xa5, + 0x99, 0x33, 0x44, 0x8d, 0xbb, 0x11, 0x22, 0x79, + 0xcf, 0x02, 0x01, 0x66, 0xd9, 0x06, 0x08, 0x54, + 0xe3, 0x0b, 0x0f, 0x45, 0xed, 0x0f, 0x16, 0x33, + 0xed, 0x23, 0x22, 0x28, 0xed, 0x3c, 0x3e, 0x20, + 0xed, 0x56, 0x59, 0x17, 0xed, 0x6f, 0x75, 0x0f, + 0x7c, 0x95, 0xae, 0x0a, 0x7c, 0x95, 0xae, 0x10, + 0x5f, 0x78, 0x91, 0x17, 0x5f, 0x78, 0x91, 0x1f, + 0x5d, 0x6e, 0x90, 0x29, 0x26, 0x37, 0x59, 0x37, + 0x00, 0x00, 0x09, 0x41, 0x04, 0x00, 0x26, 0x55, + 0x13, 0x13, 0x46, 0x65, 0x13, 0x13, 0x46, 0x74, + 0x13, 0x13, 0x46, 0x8c, 0x33, 0x00, 0x11, 0x9e, + 0x3e, 0x1c, 0x3e, 0xb1, 0x55, 0x33, 0x55, 0xca, + 0x6c, 0x4a, 0x6c, 0xde, 0x6c, 0x4a, 0x6c, 0xe8, + 0x6a, 0x41, 0x52, 0xeb, 0x80, 0x57, 0x68, 0xeb, + 0x8c, 0x63, 0x74, 0xdc, 0x80, 0x57, 0x68, 0xca, + 0x9f, 0x17, 0x17, 0xb5, 0xb5, 0x2d, 0x2d, 0xa1, + 0xb5, 0x2d, 0x2d, 0x89, 0xd2, 0x06, 0x06, 0x75, + 0xd6, 0x00, 0x00, 0x62, 0xe2, 0x00, 0x03, 0x56, + 0xe9, 0x0a, 0x12, 0x44, 0xef, 0x10, 0x18, 0x36, + 0xe7, 0x1e, 0x20, 0x27, 0xea, 0x3f, 0x3e, 0x1f, + 0xed, 0x60, 0x5b, 0x16, 0xf0, 0x80, 0x79, 0x0e, + 0x7c, 0x95, 0xae, 0x0a, 0x5f, 0x78, 0x91, 0x10, + 0x5f, 0x78, 0x91, 0x17, 0x45, 0x5e, 0x77, 0x1f, + 0x40, 0x51, 0x73, 0x29, 0x26, 0x37, 0x59, 0x37, + 0x1e, 0x0d, 0x40, 0x41, 0x00, 0x00, 0x09, 0x4f, + 0x13, 0x13, 0x46, 0x65, 0x13, 0x13, 0x46, 0x74, + 0x33, 0x33, 0x66, 0x83, 0x13, 0x13, 0x46, 0x9e, + 0x3e, 0x1c, 0x3e, 0xb1, 0x55, 0x33, 0x55, 0xc0, + 0x55, 0x33, 0x55, 0xca, 0x6c, 0x4a, 0x6c, 0xde, + 0x76, 0x4d, 0x5e, 0xdc, 0x6a, 0x41, 0x52, 0xdc, + 0x80, 0x57, 0x68, 0xd3, 0x8c, 0x63, 0x74, 0xc1, + 0xb5, 0x2d, 0x2d, 0xa9, 0x9f, 0x17, 0x17, 0x95, + 0xd2, 0x06, 0x06, 0x89, 0xd2, 0x06, 0x06, 0x75, + 0xd6, 0x00, 0x00, 0x62, 0xec, 0x05, 0x0d, 0x4e, + 0xe9, 0x0a, 0x12, 0x44, 0xef, 0x10, 0x18, 0x36, + 0xe8, 0x1e, 0x1f, 0x27, 0xeb, 0x3e, 0x3d, 0x1f, + 0xee, 0x5f, 0x5a, 0x16, 0xf1, 0x80, 0x78, 0x0e, + 0x6f, 0x67, 0x88, 0x0a, 0x5b, 0x53, 0x74, 0x0d, + 0x49, 0x41, 0x62, 0x12, 0x35, 0x2d, 0x4e, 0x1c, + 0x26, 0x37, 0x59, 0x23, 0x26, 0x37, 0x59, 0x2f, + 0x3b, 0x2a, 0x5d, 0x41, 0x04, 0x00, 0x26, 0x4f, + 0x33, 0x00, 0x11, 0x59, 0x33, 0x33, 0x66, 0x6b, + 0x33, 0x33, 0x66, 0x83, 0x33, 0x33, 0x66, 0x92, + 0x55, 0x33, 0x55, 0xa7, 0x55, 0x33, 0x55, 0xb1, + 0x77, 0x33, 0x55, 0xc0, 0x77, 0x33, 0x55, 0xca, + 0x8f, 0x34, 0x55, 0xca, 0x8f, 0x34, 0x55, 0xca, + 0x8f, 0x34, 0x55, 0xc1, 0xa5, 0x4a, 0x6b, 0xaf, + 0xb5, 0x2d, 0x2d, 0xa1, 0xb5, 0x2d, 0x2d, 0x95, + 0xd2, 0x06, 0x06, 0x7d, 0xd2, 0x06, 0x06, 0x69, + 0xe2, 0x00, 0x03, 0x5c, 0xec, 0x05, 0x0d, 0x4e, + 0xe5, 0x06, 0x0e, 0x3c, 0xef, 0x10, 0x18, 0x30, + 0xe9, 0x1d, 0x1e, 0x27, 0xec, 0x3e, 0x3c, 0x1c, + 0xef, 0x5f, 0x59, 0x13, 0xf2, 0x7f, 0x77, 0x0e, + 0x6f, 0x67, 0x88, 0x0a, 0x5b, 0x53, 0x74, 0x0d, + 0x49, 0x41, 0x62, 0x12, 0x35, 0x2d, 0x4e, 0x19, + 0x09, 0x1a, 0x3c, 0x23, 0x26, 0x37, 0x59, 0x2f, + 0x3b, 0x2a, 0x5d, 0x37, 0x1e, 0x0d, 0x40, 0x49, + 0x33, 0x00, 0x11, 0x59, 0x33, 0x00, 0x11, 0x65, + 0x33, 0x33, 0x66, 0x74, 0x53, 0x53, 0x86, 0x83, + 0x55, 0x33, 0x55, 0x93, 0x6c, 0x4a, 0x6c, 0xa7, + 0x77, 0x33, 0x55, 0xb1, 0x77, 0x33, 0x55, 0xb1, + 0x83, 0x28, 0x49, 0xb8, 0x99, 0x3e, 0x5f, 0xb8, + 0x99, 0x3e, 0x5f, 0xaf, 0x8f, 0x34, 0x55, 0xa0, + 0xb5, 0x2d, 0x2d, 0x95, 0xb5, 0x2d, 0x2d, 0x89, + 0xd2, 0x06, 0x06, 0x75, 0xd2, 0x06, 0x06, 0x69, + 0xe2, 0x00, 0x03, 0x56, 0xec, 0x05, 0x0d, 0x44, + 0xe5, 0x06, 0x0e, 0x3c, 0xe9, 0x0a, 0x12, 0x30, + 0xea, 0x1d, 0x1d, 0x22, 0xed, 0x3d, 0x3b, 0x19, + 0xf0, 0x5e, 0x58, 0x13, 0xf3, 0x7f, 0x76, 0x0e, + 0x7c, 0x74, 0x95, 0x08, 0x56, 0x4e, 0x6f, 0x0b, + 0x62, 0x49, 0x7b, 0x11, 0x4e, 0x35, 0x67, 0x16, + 0x44, 0x33, 0x66, 0x21, 0x34, 0x23, 0x56, 0x29, + 0x44, 0x33, 0x66, 0x33, 0x44, 0x33, 0x66, 0x41, + 0x56, 0x23, 0x56, 0x51, 0x67, 0x00, 0x01, 0x5d, + 0x56, 0x23, 0x56, 0x69, 0x76, 0x43, 0x76, 0x75, + 0x8d, 0x4b, 0x6c, 0x83, 0x67, 0x25, 0x46, 0x92, + 0x8d, 0x4b, 0x6c, 0x9e, 0x7b, 0x39, 0x5a, 0x9e, + 0x9f, 0x28, 0x39, 0xa2, 0x9f, 0x28, 0x39, 0xa2, + 0x9f, 0x28, 0x39, 0x99, 0xb5, 0x0b, 0x0b, 0x90, + 0xc1, 0x00, 0x00, 0x87, 0xe7, 0x11, 0x11, 0x7b, + 0xdf, 0x00, 0x00, 0x67, 0xe9, 0x02, 0x0a, 0x5b, + 0xeb, 0x00, 0x04, 0x4f, 0xec, 0x05, 0x0a, 0x3f, + 0xed, 0x0a, 0x10, 0x33, 0xee, 0x0f, 0x16, 0x27, + 0xeb, 0x1c, 0x1c, 0x1e, 0xec, 0x3c, 0x3b, 0x17, + 0xed, 0x5c, 0x59, 0x12, 0xee, 0x7b, 0x78, 0x0b, + 0x90, 0x88, 0xa9, 0x05, 0x56, 0x4e, 0x6f, 0x0b, + 0x4e, 0x35, 0x67, 0x0e, 0x4e, 0x35, 0x67, 0x14, + 0x44, 0x33, 0x66, 0x1b, 0x34, 0x23, 0x56, 0x21, + 0x34, 0x23, 0x56, 0x29, 0x54, 0x43, 0x76, 0x3b, + 0x76, 0x43, 0x76, 0x45, 0x87, 0x10, 0x21, 0x51, + 0x87, 0x10, 0x21, 0x5d, 0x76, 0x43, 0x76, 0x69, + 0x8d, 0x4b, 0x6c, 0x74, 0x8d, 0x4b, 0x6c, 0x83, + 0x7b, 0x39, 0x5a, 0x8c, 0x8d, 0x4b, 0x6c, 0x8c, + 0x9f, 0x28, 0x39, 0x90, 0x9f, 0x28, 0x39, 0x8a, + 0xb5, 0x0b, 0x0b, 0x8a, 0xb5, 0x0b, 0x0b, 0x7b, + 0xc1, 0x00, 0x00, 0x73, 0xd5, 0x00, 0x00, 0x67, + 0xe5, 0x00, 0x06, 0x5b, 0xe5, 0x00, 0x06, 0x4f, + 0xe9, 0x01, 0x05, 0x45, 0xea, 0x06, 0x0b, 0x39, + 0xeb, 0x0b, 0x11, 0x2d, 0xec, 0x10, 0x17, 0x27, + 0xeb, 0x1c, 0x1c, 0x1b, 0xec, 0x3b, 0x3b, 0x12, + 0xed, 0x5b, 0x59, 0x0e, 0xee, 0x7b, 0x78, 0x0b, + 0x90, 0x88, 0xa9, 0x05, 0x6a, 0x62, 0x83, 0x08, + 0x4e, 0x35, 0x67, 0x0b, 0x62, 0x49, 0x7b, 0x11, + 0x54, 0x43, 0x76, 0x15, 0x54, 0x43, 0x76, 0x21, + 0x66, 0x11, 0x55, 0x29, 0x54, 0x43, 0x76, 0x33, + 0x76, 0x43, 0x76, 0x39, 0x76, 0x43, 0x76, 0x45, + 0x87, 0x10, 0x21, 0x51, 0x87, 0x10, 0x21, 0x5d, + 0xad, 0x32, 0x53, 0x65, 0xad, 0x32, 0x53, 0x6b, + 0x97, 0x1c, 0x3d, 0x74, 0xa1, 0x26, 0x47, 0x74, + 0x9f, 0x28, 0x39, 0x7b, 0x9f, 0x28, 0x39, 0x75, + 0xc1, 0x17, 0x17, 0x75, 0xb5, 0x0b, 0x0b, 0x6c, + 0xd5, 0x00, 0x00, 0x67, 0xd5, 0x00, 0x00, 0x5b, + 0xe5, 0x00, 0x06, 0x4f, 0xe5, 0x00, 0x06, 0x47, + 0xe7, 0x01, 0x06, 0x39, 0xe8, 0x06, 0x0c, 0x33, + 0xe9, 0x0b, 0x12, 0x27, 0xea, 0x10, 0x18, 0x1d, + 0xeb, 0x1b, 0x1c, 0x17, 0xec, 0x3b, 0x3b, 0x12, + 0xed, 0x5b, 0x59, 0x0b, 0xee, 0x7a, 0x78, 0x08, + 0x90, 0x88, 0xa9, 0x05, 0x7c, 0x74, 0x95, 0x08, + 0x62, 0x49, 0x7b, 0x0b, 0x62, 0x49, 0x7b, 0x0e, + 0x54, 0x43, 0x76, 0x15, 0x54, 0x43, 0x76, 0x1b, + 0x66, 0x11, 0x55, 0x21, 0x66, 0x11, 0x55, 0x29, + 0x76, 0x43, 0x76, 0x31, 0x76, 0x43, 0x76, 0x39, + 0x87, 0x10, 0x21, 0x45, 0x87, 0x10, 0x21, 0x51, + 0x8b, 0x10, 0x31, 0x59, 0xa1, 0x26, 0x47, 0x59, + 0xa1, 0x26, 0x47, 0x65, 0x8b, 0x10, 0x31, 0x65, + 0xb5, 0x0b, 0x0b, 0x63, 0xc1, 0x17, 0x17, 0x63, + 0xc1, 0x17, 0x17, 0x63, 0xc1, 0x17, 0x17, 0x63, + 0xd5, 0x00, 0x00, 0x5b, 0xd5, 0x00, 0x00, 0x4f, + 0xdf, 0x00, 0x00, 0x47, 0xdf, 0x00, 0x00, 0x3b, + 0xe5, 0x02, 0x07, 0x33, 0xe6, 0x07, 0x0d, 0x27, + 0xe7, 0x0c, 0x13, 0x1d, 0xe8, 0x11, 0x19, 0x1d, + 0xeb, 0x1b, 0x1c, 0x12, 0xec, 0x3a, 0x3b, 0x0e, + 0xed, 0x5a, 0x59, 0x0b, 0xee, 0x7a, 0x78, 0x08, + 0x9e, 0x86, 0xa7, 0x02, 0x9a, 0x82, 0xa3, 0x05, + 0x8f, 0x56, 0x7f, 0x08, 0x72, 0x39, 0x62, 0x0b, + 0x71, 0x3c, 0x75, 0x11, 0x75, 0x31, 0x68, 0x16, + 0x7a, 0x26, 0x5b, 0x1a, 0x7e, 0x1b, 0x4e, 0x20, + 0x82, 0x1c, 0x4f, 0x29, 0x8e, 0x28, 0x5b, 0x33, + 0x8e, 0x28, 0x5b, 0x3b, 0xa4, 0x1c, 0x1c, 0x41, + 0xb3, 0x0e, 0x0e, 0x45, 0xad, 0x08, 0x08, 0x4b, + 0xbd, 0x18, 0x18, 0x54, 0xb7, 0x12, 0x12, 0x54, + 0xbd, 0x00, 0x00, 0x55, 0xc9, 0x03, 0x0b, 0x55, + 0xd6, 0x00, 0x08, 0x4f, 0xd6, 0x00, 0x08, 0x4f, + 0xdb, 0x00, 0x08, 0x48, 0xdd, 0x01, 0x07, 0x3e, + 0xdf, 0x02, 0x06, 0x38, 0xe1, 0x03, 0x05, 0x32, + 0xe3, 0x00, 0x00, 0x27, 0xe5, 0x07, 0x0a, 0x21, + 0xe7, 0x0e, 0x14, 0x1b, 0xe9, 0x15, 0x1e, 0x15, + 0xeb, 0x26, 0x24, 0x0f, 0xed, 0x46, 0x42, 0x0c, + 0xef, 0x66, 0x5f, 0x09, 0xf1, 0x85, 0x7d, 0x06, + 0x9a, 0x82, 0xa3, 0x02, 0xa4, 0x8c, 0xad, 0x05, + 0xa9, 0x70, 0x99, 0x05, 0x8f, 0x56, 0x7f, 0x08, + 0x83, 0x3f, 0x6a, 0x0d, 0x88, 0x34, 0x5d, 0x11, + 0x8c, 0x29, 0x50, 0x16, 0x90, 0x1e, 0x43, 0x1a, + 0xa4, 0x1c, 0x1c, 0x21, 0xa4, 0x1c, 0x1c, 0x29, + 0xb0, 0x28, 0x28, 0x29, 0xa4, 0x1c, 0x1c, 0x33, + 0xad, 0x08, 0x08, 0x3c, 0xbd, 0x18, 0x18, 0x3c, + 0xbd, 0x18, 0x18, 0x45, 0xb3, 0x0e, 0x0e, 0x45, + 0xc9, 0x03, 0x0b, 0x41, 0xc9, 0x03, 0x0b, 0x41, + 0xd6, 0x00, 0x08, 0x41, 0xdc, 0x06, 0x0e, 0x41, + 0xdc, 0x05, 0x0c, 0x38, 0xde, 0x06, 0x0b, 0x32, + 0xe0, 0x07, 0x0a, 0x2c, 0xe2, 0x08, 0x09, 0x26, + 0xe2, 0x04, 0x03, 0x21, 0xe4, 0x0b, 0x0d, 0x1b, + 0xe6, 0x12, 0x17, 0x15, 0xe8, 0x19, 0x21, 0x11, + 0xe9, 0x31, 0x2b, 0x0c, 0xeb, 0x51, 0x49, 0x09, + 0xed, 0x71, 0x66, 0x06, 0xef, 0x90, 0x84, 0x03, + 0xa4, 0x8c, 0xad, 0x02, 0x94, 0x7c, 0x9d, 0x02, + 0xa9, 0x70, 0x99, 0x05, 0x8f, 0x56, 0x7f, 0x08, + 0x96, 0x41, 0x5f, 0x0a, 0x9a, 0x36, 0x52, 0x0d, + 0x9e, 0x2b, 0x45, 0x11, 0xa2, 0x20, 0x38, 0x16, + 0xa4, 0x1c, 0x1c, 0x1b, 0xa4, 0x1c, 0x1c, 0x21, + 0xb0, 0x28, 0x28, 0x21, 0xb0, 0x28, 0x28, 0x29, + 0xcc, 0x0e, 0x0e, 0x2a, 0xcc, 0x0e, 0x0e, 0x33, + 0xcc, 0x0e, 0x0e, 0x33, 0xd0, 0x12, 0x12, 0x33, + 0xd3, 0x0d, 0x15, 0x37, 0xd3, 0x0d, 0x15, 0x37, + 0xe6, 0x10, 0x18, 0x37, 0xdc, 0x06, 0x0e, 0x2f, + 0xdd, 0x09, 0x10, 0x2c, 0xdf, 0x0a, 0x0f, 0x2c, + 0xe1, 0x0b, 0x0e, 0x26, 0xe3, 0x0c, 0x0d, 0x20, + 0xe1, 0x08, 0x06, 0x1b, 0xe3, 0x0f, 0x10, 0x15, + 0xe5, 0x16, 0x1a, 0x11, 0xe7, 0x1d, 0x24, 0x0b, + 0xe7, 0x3c, 0x33, 0x09, 0xe9, 0x5c, 0x50, 0x06, + 0xeb, 0x7c, 0x6e, 0x03, 0xed, 0x9b, 0x8b, 0x03, + 0xa4, 0x8c, 0xad, 0x02, 0x94, 0x7c, 0x9d, 0x02, + 0xa9, 0x70, 0x99, 0x02, 0x8f, 0x56, 0x7f, 0x05, + 0xa8, 0x44, 0x54, 0x07, 0xac, 0x39, 0x47, 0x0a, + 0xb0, 0x2e, 0x3a, 0x0d, 0xb5, 0x23, 0x2d, 0x11, + 0xa4, 0x1c, 0x1c, 0x15, 0xb0, 0x28, 0x28, 0x15, + 0xb0, 0x28, 0x28, 0x1b, 0xb0, 0x28, 0x28, 0x21, + 0xd6, 0x18, 0x18, 0x24, 0xd0, 0x12, 0x12, 0x24, + 0xd6, 0x18, 0x18, 0x2a, 0xd6, 0x18, 0x18, 0x2a, + 0xdf, 0x19, 0x21, 0x29, 0xdf, 0x19, 0x21, 0x29, + 0xe6, 0x10, 0x18, 0x29, 0xe6, 0x10, 0x18, 0x23, + 0xde, 0x0e, 0x14, 0x26, 0xe0, 0x0f, 0x13, 0x20, + 0xe2, 0x10, 0x12, 0x20, 0xe4, 0x11, 0x11, 0x16, + 0xe0, 0x0c, 0x09, 0x15, 0xe2, 0x13, 0x13, 0x11, + 0xe4, 0x1a, 0x1d, 0x0b, 0xe6, 0x21, 0x27, 0x0b, + 0xe5, 0x47, 0x3a, 0x06, 0xe7, 0x67, 0x57, 0x06, + 0xe9, 0x87, 0x75, 0x03, 0xeb, 0xa6, 0x92, 0x03, + 0xd5, 0x8b, 0x83, 0x01, 0xc1, 0x77, 0x6f, 0x01, + 0xb9, 0x56, 0x56, 0x02, 0xb9, 0x56, 0x56, 0x03, + 0xcd, 0x49, 0x49, 0x05, 0xcd, 0x49, 0x49, 0x08, + 0xb9, 0x35, 0x35, 0x08, 0xb9, 0x35, 0x35, 0x0c, + 0xcb, 0x2e, 0x2c, 0x0e, 0xcb, 0x2c, 0x2c, 0x11, + 0xcb, 0x2a, 0x2c, 0x14, 0xcb, 0x28, 0x2c, 0x16, + 0xd7, 0x20, 0x24, 0x18, 0xda, 0x20, 0x23, 0x1d, + 0xdd, 0x1f, 0x22, 0x1d, 0xe0, 0x1f, 0x21, 0x1d, + 0xe7, 0x22, 0x24, 0x1e, 0xe7, 0x20, 0x24, 0x1e, + 0xe7, 0x1d, 0x24, 0x1e, 0xe7, 0x1b, 0x24, 0x1b, + 0xe3, 0x1c, 0x20, 0x19, 0xe3, 0x1c, 0x20, 0x17, + 0xe3, 0x1c, 0x20, 0x14, 0xe3, 0x1c, 0x20, 0x11, + 0xdf, 0x1a, 0x20, 0x0f, 0xe0, 0x23, 0x25, 0x0c, + 0xe1, 0x2b, 0x2a, 0x09, 0xe2, 0x34, 0x2f, 0x06, + 0xe3, 0x54, 0x49, 0x05, 0xe4, 0x69, 0x5e, 0x03, + 0xe5, 0x7e, 0x74, 0x02, 0xe6, 0x92, 0x89, 0x01, + 0xe7, 0x9d, 0x95, 0x00, 0xd5, 0x8b, 0x83, 0x01, + 0xcd, 0x6a, 0x6a, 0x01, 0xb9, 0x56, 0x56, 0x02, + 0xcd, 0x49, 0x49, 0x02, 0xcd, 0x49, 0x49, 0x05, + 0xcd, 0x49, 0x49, 0x05, 0xcd, 0x49, 0x49, 0x08, + 0xd8, 0x46, 0x46, 0x0b, 0xd8, 0x44, 0x46, 0x0b, + 0xd8, 0x42, 0x46, 0x0e, 0xd8, 0x40, 0x46, 0x11, + 0xdd, 0x3c, 0x3f, 0x12, 0xe0, 0x3b, 0x3e, 0x15, + 0xe3, 0x3b, 0x3d, 0x15, 0xe6, 0x3a, 0x3c, 0x18, + 0xe9, 0x3d, 0x3c, 0x16, 0xe9, 0x3a, 0x3c, 0x16, + 0xe9, 0x38, 0x3c, 0x16, 0xe9, 0x35, 0x3c, 0x13, + 0xe7, 0x36, 0x3b, 0x11, 0xe7, 0x36, 0x3b, 0x11, + 0xe7, 0x36, 0x3b, 0x0e, 0xe7, 0x36, 0x3b, 0x0b, + 0xe3, 0x34, 0x3a, 0x09, 0xe4, 0x3d, 0x3f, 0x09, + 0xe5, 0x45, 0x44, 0x06, 0xe6, 0x4e, 0x49, 0x04, + 0xe6, 0x63, 0x59, 0x03, 0xe7, 0x78, 0x6f, 0x02, + 0xe8, 0x8d, 0x84, 0x01, 0xe9, 0xa2, 0x99, 0x01, + 0xfb, 0xb1, 0xa9, 0x00, 0xe7, 0x9d, 0x95, 0x00, + 0xdf, 0x7c, 0x7c, 0x01, 0xcd, 0x6a, 0x6a, 0x01, + 0xe2, 0x66, 0x66, 0x02, 0xe2, 0x66, 0x66, 0x02, + 0xe2, 0x66, 0x66, 0x05, 0xe2, 0x66, 0x66, 0x05, + 0xe5, 0x5f, 0x5f, 0x08, 0xe5, 0x5d, 0x5f, 0x08, + 0xe5, 0x5b, 0x5f, 0x0b, 0xe5, 0x59, 0x5f, 0x0b, + 0xe3, 0x58, 0x59, 0x0c, 0xe6, 0x57, 0x58, 0x0f, + 0xe9, 0x57, 0x57, 0x0f, 0xec, 0x56, 0x56, 0x0f, + 0xeb, 0x58, 0x53, 0x10, 0xeb, 0x55, 0x53, 0x10, + 0xeb, 0x53, 0x53, 0x10, 0xeb, 0x50, 0x53, 0x10, + 0xeb, 0x51, 0x55, 0x0e, 0xeb, 0x51, 0x55, 0x0b, + 0xeb, 0x51, 0x55, 0x0b, 0xeb, 0x51, 0x55, 0x08, + 0xe7, 0x4f, 0x53, 0x06, 0xe8, 0x57, 0x58, 0x06, + 0xe9, 0x60, 0x5d, 0x04, 0xea, 0x68, 0x62, 0x04, + 0xe9, 0x73, 0x6a, 0x02, 0xea, 0x87, 0x7f, 0x01, + 0xeb, 0x9c, 0x94, 0x01, 0xec, 0xb1, 0xa9, 0x00, + 0xfb, 0xb1, 0xa9, 0x00, 0xfb, 0xb1, 0xa9, 0x00, + 0xf3, 0x90, 0x90, 0x00, 0xf3, 0x90, 0x90, 0x01, + 0xf8, 0x7c, 0x7c, 0x02, 0xf8, 0x7c, 0x7c, 0x02, + 0xf8, 0x7c, 0x7c, 0x02, 0xf8, 0x7c, 0x7c, 0x02, + 0xf2, 0x77, 0x79, 0x05, 0xf2, 0x75, 0x79, 0x05, + 0xf2, 0x73, 0x79, 0x05, 0xf2, 0x71, 0x79, 0x08, + 0xe9, 0x73, 0x74, 0x09, 0xec, 0x73, 0x73, 0x09, + 0xef, 0x72, 0x72, 0x09, 0xf2, 0x72, 0x71, 0x09, + 0xed, 0x72, 0x6b, 0x0a, 0xed, 0x70, 0x6b, 0x0a, + 0xed, 0x6d, 0x6b, 0x0a, 0xed, 0x6b, 0x6b, 0x0a, + 0xef, 0x6b, 0x70, 0x08, 0xef, 0x6b, 0x70, 0x08, + 0xef, 0x6b, 0x70, 0x06, 0xef, 0x6b, 0x70, 0x06, + 0xeb, 0x69, 0x6d, 0x04, 0xec, 0x71, 0x72, 0x04, + 0xed, 0x7a, 0x77, 0x01, 0xee, 0x82, 0x7c, 0x01, + 0xec, 0x82, 0x7a, 0x01, 0xed, 0x97, 0x8f, 0x01, + 0xee, 0xab, 0xa4, 0x00, 0xef, 0xc0, 0xba, 0x00, + ]) +} + diff --git a/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py b/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py new file mode 100644 index 000000000..919ba2328 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py @@ -0,0 +1,101 @@ +import sys +import os.path +import re + +assert len(sys.argv) == 2 +mochiPath = sys.argv[1] + +extDotPos = mochiPath.find('.html') +assert extDotPos != -1, 'mochitest target must be an html doc.' + +testPath = mochiPath[:extDotPos] + '.solo.html' + +def ReadLocalFile(include): + incPath = os.path.dirname(mochiPath) + filePath = os.path.join(incPath, include) + + data = None + try: + f = open(filePath, 'r') + data = f.read() + except: + pass + + try: + f.close() + except: + pass + + return data + +kSimpleTestReplacement = ''' + + +
+ +''' + +fin = open(mochiPath, 'rb') +fout = open(testPath, 'wb') +includePattern = re.compile('\\s*') +cssPattern = re.compile(']*)[\'"]>') +for line in fin: + skipLine = False + for css in cssPattern.findall(line): + skipLine = True + print('Ignoring stylesheet: ' + css) + + for inc in includePattern.findall(line): + skipLine = True + if inc == '/MochiKit/MochiKit': + continue + + if inc == '/tests/SimpleTest/SimpleTest': + print('Injecting SimpleTest replacement') + fout.write(kSimpleTestReplacement); + continue + + incData = ReadLocalFile(inc + '.js') + if not incData: + print('Warning: Unknown JS file ignored: ' + inc + '.js') + continue + + print('Injecting include: ' + inc + '.js') + fout.write('\n\n'); + continue + + if skipLine: + continue + + fout.write(line) + continue + +fin.close() +fout.close() diff --git a/dom/canvas/test/webgl-mochitest/mochitest.ini b/dom/canvas/test/webgl-mochitest/mochitest.ini new file mode 100644 index 000000000..d5bc8701d --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/mochitest.ini @@ -0,0 +1,96 @@ +[DEFAULT] +subsuite = webgl + +support-files = + ensure-exts/ensure-ext.js + driver-info.js + es3-data.js + webgl-util.js + +[ensure-exts/test_ANGLE_instanced_arrays.html] +fail-if = (os == 'android') || (os == 'mac' && os_version == '10.6') +[ensure-exts/test_EXT_blend_minmax.html] +fail-if = (os == 'android') +[ensure-exts/test_EXT_color_buffer_half_float.html] +fail-if = (os == 'android') +[ensure-exts/test_EXT_disjoint_timer_query.html] +fail-if = (os == 'android') || (os == 'mac') || (os == 'win' && os_version == '5.1') +[ensure-exts/test_EXT_frag_depth.html] +fail-if = (os == 'android') +[ensure-exts/test_EXT_sRGB.html] +fail-if = (os == 'android') || (os == 'mac' && os_version == '10.6') || (os == 'win') +[ensure-exts/test_EXT_shader_texture_lod.html] +fail-if = (os == 'android') +[ensure-exts/test_EXT_texture_filter_anisotropic.html] +fail-if = (os == 'android') || (os == 'linux') +[ensure-exts/test_OES_standard_derivatives.html] +fail-if = (os == 'android') +[ensure-exts/test_WEBGL_color_buffer_float.html] +fail-if = (os == 'android') +[ensure-exts/test_WEBGL_compressed_texture_atc.html] +fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win') +[ensure-exts/test_WEBGL_compressed_texture_es3.html] +fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win') +[ensure-exts/test_WEBGL_compressed_texture_etc1.html] +fail-if = (os == 'linux') || (os == 'mac') || (os == 'win' && os_version == '5.1') +[ensure-exts/test_WEBGL_compressed_texture_pvrtc.html] +fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win') +[ensure-exts/test_WEBGL_compressed_texture_s3tc.html] +fail-if = (os == 'android') || (os == 'linux') +[ensure-exts/test_WEBGL_depth_texture.html] +fail-if = (os == 'mac' && os_version == '10.6') +[ensure-exts/test_WEBGL_draw_buffers.html] +fail-if = (os == 'android') || (os == 'win' && os_version == '5.1') + +[ensure-exts/test_common.html] + + +[regress/test_bug_1268096.html] + + +[test_backends.html] +[test_backbuffer_channels.html] +[test_depth_readpixels.html] +[test_canvas_size.html] +[test_capture.html] +support-files = ../captureStream_common.js +# Even though we use ../ here, in the test HTML, we need to omit this. Sub-CWD relative +# paths are fine, but they locate the file and dump it in the current directory. +[test_cubemap_must_be_square.html] +[test_depth_tex_lazy_clear.html] +[test_draw.html] +[test_fb_param.html] +[test_fb_param_crash.html] +[test_hidden_alpha.html] +[test_hidden_depth_stencil.html] +fail-if = (os == 'win' && os_version == '5.1') +[test_implicit_color_buffer_float.html] +[test_highp_fs.html] +[test_no_arr_points.html] +skip-if = android_version == '18' #Android 4.3 aws only; bug 1030942 +[test_noprog_draw.html] +[test_pixel_pack_buffer.html] +[test_privileged_exts.html] +[test_renderer_strings.html] +[test_sab_with_webgl.html] +[test_texsubimage_float.html] +[test_uninit_data.html] +[test_webgl_available.html] +#[test_webgl_color_buffer_float.html] +# We haven't cleaned up the Try results yet, but let's get this on the books first. +[test_webgl_conformance.html] +skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests +[test_webgl_compressed_texture_es3.html] +[test_webgl_force_enable.html] +[test_webgl_request_context.html] +skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests +[test_webgl_request_mismatch.html] +skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests +[test_webgl2_not_exposed.html] +skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests +[test_webgl2_invalidate_framebuffer.html] +skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests +[test_webgl2_alpha_luminance.html] +skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests +[test_fuzzing_bugs.html] +[test_webglcontextcreationerror.html] diff --git a/dom/canvas/test/webgl-mochitest/regress/test_bug_1268096.html b/dom/canvas/test/webgl-mochitest/regress/test_bug_1268096.html new file mode 100644 index 000000000..be66cc5f0 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/regress/test_bug_1268096.html @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_backbuffer_channels.html b/dom/canvas/test/webgl-mochitest/test_backbuffer_channels.html new file mode 100644 index 000000000..ef880f9c2 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_backbuffer_channels.html @@ -0,0 +1,111 @@ + +WebGL test: bug 958723 + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_backends.html b/dom/canvas/test/webgl-mochitest/test_backends.html new file mode 100644 index 000000000..50ba4cbd4 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_backends.html @@ -0,0 +1,169 @@ + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_canvas_size.html b/dom/canvas/test/webgl-mochitest/test_canvas_size.html new file mode 100644 index 000000000..a9ea076a8 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_canvas_size.html @@ -0,0 +1,54 @@ + + + + + + + +WebGL test: Framebuffer maximum size test. (Bug 1290333) + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_capture.html b/dom/canvas/test/webgl-mochitest/test_capture.html new file mode 100644 index 000000000..1de9a2c0b --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_capture.html @@ -0,0 +1,207 @@ + + + +WebGL test: CaptureStream() + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_cubemap_must_be_square.html b/dom/canvas/test/webgl-mochitest/test_cubemap_must_be_square.html new file mode 100644 index 000000000..f2bc2914b --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_cubemap_must_be_square.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_depth_readpixels.html b/dom/canvas/test/webgl-mochitest/test_depth_readpixels.html new file mode 100644 index 000000000..895e7c98f --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_depth_readpixels.html @@ -0,0 +1,60 @@ + + + +WebGL test: Check for error on ReadPixels from a depth-only FB. + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_depth_tex_lazy_clear.html b/dom/canvas/test/webgl-mochitest/test_depth_tex_lazy_clear.html new file mode 100644 index 000000000..a3f2dc409 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_depth_tex_lazy_clear.html @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_draw.html b/dom/canvas/test/webgl-mochitest/test_draw.html new file mode 100644 index 000000000..90d244719 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_draw.html @@ -0,0 +1,131 @@ + + + +WebGL test: Basic drawing + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_fb_param.html b/dom/canvas/test/webgl-mochitest/test_fb_param.html new file mode 100644 index 000000000..5907221dd --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_fb_param.html @@ -0,0 +1,54 @@ + +WebGL test: bug 958491 + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_fb_param_crash.html b/dom/canvas/test/webgl-mochitest/test_fb_param_crash.html new file mode 100644 index 000000000..56a29be46 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_fb_param_crash.html @@ -0,0 +1,48 @@ + +WebGL test: bug 958723 + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_fuzzing_bugs.html b/dom/canvas/test/webgl-mochitest/test_fuzzing_bugs.html new file mode 100644 index 000000000..3b0b1016c --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_fuzzing_bugs.html @@ -0,0 +1,159 @@ + +WebGL fuzzy bugs + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_hidden_alpha.html b/dom/canvas/test/webgl-mochitest/test_hidden_alpha.html new file mode 100644 index 000000000..addc1b016 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_hidden_alpha.html @@ -0,0 +1,156 @@ + +WebGL test: Hidden alpha on no-alpha contexts + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_hidden_depth_stencil.html b/dom/canvas/test/webgl-mochitest/test_hidden_depth_stencil.html new file mode 100644 index 000000000..987af9e37 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_hidden_depth_stencil.html @@ -0,0 +1,159 @@ + +WebGL test: Hidden depth/stencil passes without a depth/stencil buffer respectively + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_highp_fs.html b/dom/canvas/test/webgl-mochitest/test_highp_fs.html new file mode 100644 index 000000000..8d82c33e4 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_highp_fs.html @@ -0,0 +1,61 @@ + +WebGL test: `highp` support + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_implicit_color_buffer_float.html b/dom/canvas/test/webgl-mochitest/test_implicit_color_buffer_float.html new file mode 100644 index 000000000..bbabef3e8 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_implicit_color_buffer_float.html @@ -0,0 +1,199 @@ + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_no_arr_points.html b/dom/canvas/test/webgl-mochitest/test_no_arr_points.html new file mode 100644 index 000000000..caeea696e --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_no_arr_points.html @@ -0,0 +1,169 @@ + +WebGL test: Drawing without attrib arrays + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_noprog_draw.html b/dom/canvas/test/webgl-mochitest/test_noprog_draw.html new file mode 100644 index 000000000..55e755894 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_noprog_draw.html @@ -0,0 +1,80 @@ + + + +WebGL test: Drawing with a null program + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_pixel_pack_buffer.html b/dom/canvas/test/webgl-mochitest/test_pixel_pack_buffer.html new file mode 100644 index 000000000..bfacc5bfa --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_pixel_pack_buffer.html @@ -0,0 +1,288 @@ + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_privileged_exts.html b/dom/canvas/test/webgl-mochitest/test_privileged_exts.html new file mode 100644 index 000000000..c7895bcdf --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_privileged_exts.html @@ -0,0 +1,32 @@ + + + +WebGL test: Check for privileged ext access. + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_renderer_strings.html b/dom/canvas/test/webgl-mochitest/test_renderer_strings.html new file mode 100644 index 000000000..4890abf91 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_renderer_strings.html @@ -0,0 +1,102 @@ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_sab_with_webgl.html b/dom/canvas/test/webgl-mochitest/test_sab_with_webgl.html new file mode 100644 index 000000000..56b89950a --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_sab_with_webgl.html @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_texsubimage_float.html b/dom/canvas/test/webgl-mochitest/test_texsubimage_float.html new file mode 100644 index 000000000..75735c657 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_texsubimage_float.html @@ -0,0 +1,62 @@ + +WebGL test: bug 1003607 + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_uninit_data.html b/dom/canvas/test/webgl-mochitest/test_uninit_data.html new file mode 100644 index 000000000..541cfdbe5 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_uninit_data.html @@ -0,0 +1,84 @@ + + + + + + Test contents of uninitialized buffers + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl2_alpha_luminance.html b/dom/canvas/test/webgl-mochitest/test_webgl2_alpha_luminance.html new file mode 100644 index 000000000..3ec6c1909 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl2_alpha_luminance.html @@ -0,0 +1,114 @@ + + +WebGL2 test: Alpha and Luminance Textures + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl2_invalidate_framebuffer.html b/dom/canvas/test/webgl-mochitest/test_webgl2_invalidate_framebuffer.html new file mode 100644 index 000000000..6a384e1b9 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl2_invalidate_framebuffer.html @@ -0,0 +1,27 @@ + + + +WebGL2 test: Framebuffers + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html b/dom/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html new file mode 100644 index 000000000..d8d2f54c0 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html @@ -0,0 +1,37 @@ + + + +WebGL test: WebGL2RenderingContext only exposed when appropriate + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_available.html b/dom/canvas/test/webgl-mochitest/test_webgl_available.html new file mode 100644 index 000000000..f6817c985 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_available.html @@ -0,0 +1,19 @@ + + + + + WebGL test: Check that WebGL works out-of-the-box. + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_color_buffer_float.html b/dom/canvas/test/webgl-mochitest/test_webgl_color_buffer_float.html new file mode 100644 index 000000000..94a75fa91 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_color_buffer_float.html @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_compressed_texture_es3.html b/dom/canvas/test/webgl-mochitest/test_webgl_compressed_texture_es3.html new file mode 100644 index 000000000..48dee2fc6 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_compressed_texture_es3.html @@ -0,0 +1,753 @@ + + + + + + + + +WebGL test: test WEBGL_compressed_texture_es3 extension + + + +
+ +
+ + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_conformance.html b/dom/canvas/test/webgl-mochitest/test_webgl_conformance.html new file mode 100644 index 000000000..b4d1407f9 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_conformance.html @@ -0,0 +1,29 @@ + + + +WebGL test: 'webgl' context request + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_force_enable.html b/dom/canvas/test/webgl-mochitest/test_webgl_force_enable.html new file mode 100644 index 000000000..4b4611dd2 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_force_enable.html @@ -0,0 +1,50 @@ + + + +WebGL test: Check that WebGL works (or not) if it should (or should not). + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_request_context.html b/dom/canvas/test/webgl-mochitest/test_webgl_request_context.html new file mode 100644 index 000000000..d11584e08 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_request_context.html @@ -0,0 +1,36 @@ + +WebGL test: 'webgl' and 'experimental-webgl' context requests succeed, + 'moz-webgl' context requests fail. + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html b/dom/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html new file mode 100644 index 000000000..8b8920603 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html @@ -0,0 +1,90 @@ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/test_webglcontextcreationerror.html b/dom/canvas/test/webgl-mochitest/test_webglcontextcreationerror.html new file mode 100644 index 000000000..65d9b4eb2 --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webglcontextcreationerror.html @@ -0,0 +1,66 @@ + + + + + + + + + + + diff --git a/dom/canvas/test/webgl-mochitest/webgl-util.js b/dom/canvas/test/webgl-mochitest/webgl-util.js new file mode 100644 index 000000000..21ef9cf0f --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/webgl-util.js @@ -0,0 +1,170 @@ +WebGLUtil = (function() { + // --------------------------------------------------------------------------- + // Error handling (for obvious failures, such as invalid element ids) + + function defaultErrorFunc(str) { + console.log('Error: ' + str); + } + + var gErrorFunc = defaultErrorFunc; + function setErrorFunc(func) { + gErrorFunc = func; + } + + function error(str) { + gErrorFunc(str); + } + + // --------------------------------------------------------------------------- + // Warning handling (for failures that may be intentional) + + function defaultWarningFunc(str) { + console.log('Warning: ' + str); + } + + var gWarningFunc = defaultWarningFunc; + function setWarningFunc(func) { + gWarningFunc = func; + } + + function warning(str) { + gWarningFunc(str); + } + + // --------------------------------------------------------------------------- + // WebGL helpers + + function getWebGL(canvasId, requireConformant, attributes) { + // `requireConformant` will default to falsey if it is not supplied. + + var canvas = document.getElementById(canvasId); + + var gl = null; + try { + gl = canvas.getContext('webgl', attributes); + } catch(e) {} + + if (!gl && !requireConformant) { + try { + gl = canvas.getContext('experimental-webgl', attributes); + } catch(e) {} + } + + if (!gl) { + error('WebGL context could not be retrieved from \'' + canvasId + '\'.'); + return null; + } + + return gl; + } + + function withWebGL2(canvasId, callback, onFinished) { + var run = function() { + var canvas = document.getElementById(canvasId); + + var gl = null; + try { + gl = canvas.getContext('webgl2'); + } catch(e) {} + + if (!gl) { + todo(false, 'WebGL2 is not supported'); + onFinished(); + return; + } + + function errorFunc(str) { + ok(false, 'Error: ' + str); + } + setErrorFunc(errorFunc); + setWarningFunc(errorFunc); + + callback(gl); + onFinished(); + }; + + try { + var prefArrArr = [ + ['webgl.force-enabled', true], + ['webgl.enable-webgl2', true], + ]; + var prefEnv = {'set': prefArrArr}; + SpecialPowers.pushPrefEnv(prefEnv, run); + } catch (e) { + warning('No SpecialPowers, but trying WebGL2 anyway...'); + run(); + } + } + + function getContentFromElem(elem) { + var str = ""; + var k = elem.firstChild; + while (k) { + if (k.nodeType == 3) + str += k.textContent; + + k = k.nextSibling; + } + + return str; + } + + // Returns a valid shader, or null on errors. + function createShaderById(gl, id) { + var elem = document.getElementById(id); + if (!elem) { + error('Failed to create shader from non-existent id \'' + id + '\'.'); + return null; + } + + var src = getContentFromElem(elem); + + var shader; + if (elem.type == "x-shader/x-fragment") { + shader = gl.createShader(gl.FRAGMENT_SHADER); + } else if (elem.type == "x-shader/x-vertex") { + shader = gl.createShader(gl.VERTEX_SHADER); + } else { + error('Bad MIME type for shader \'' + id + '\': ' + elem.type + '.'); + return null; + } + + gl.shaderSource(shader, src); + gl.compileShader(shader); + + return shader; + } + + function createProgramByIds(gl, vsId, fsId) { + var vs = createShaderById(gl, vsId); + var fs = createShaderById(gl, fsId); + if (!vs || !fs) + return null; + + var prog = gl.createProgram(); + gl.attachShader(prog, vs); + gl.attachShader(prog, fs); + gl.linkProgram(prog); + + if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) { + var str = "Shader program linking failed:"; + str += "\nShader program info log:\n" + gl.getProgramInfoLog(prog); + str += "\n\nVert shader log:\n" + gl.getShaderInfoLog(vs); + str += "\n\nFrag shader log:\n" + gl.getShaderInfoLog(fs); + warning(str); + return null; + } + + return prog; + } + + return { + setErrorFunc: setErrorFunc, + setWarningFunc: setWarningFunc, + + getWebGL: getWebGL, + withWebGL2: withWebGL2, + createShaderById: createShaderById, + createProgramByIds: createProgramByIds, + }; +})(); -- cgit v1.2.3